Skip to content

Commit

Permalink
Refactor to hide internal API from export map
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Apr 16, 2024
1 parent 704ba98 commit bba3e39
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ packages/micromark-util-decode-numeric-character-reference/index.js
packages/micromark-util-decode-string/index.js
packages/micromark-util-normalize-identifier/index.js
packages/micromark-util-sanitize-uri/index.js
packages/micromark-util-subtokenize/lib/
packages/micromark-util-subtokenize/index.js
packages/micromark-util-subtokenize/splice-buffer.js
test/fixtures/
test/fuzz-bundle.cjs
!packages/micromark-util-types/index.d.ts
5 changes: 4 additions & 1 deletion packages/micromark-util-subtokenize/dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
import {splice} from 'micromark-util-chunked'
import {codes, types} from 'micromark-util-symbol'
import {ok as assert} from 'devlop'
import {SpliceBuffer} from './splice-buffer.js'
import {SpliceBuffer} from './lib/splice-buffer.js'

// Hidden API exposed for testing.
export {SpliceBuffer} from './lib/splice-buffer.js'

/**
* Tokenize subcontent.
Expand Down
16 changes: 4 additions & 12 deletions packages/micromark-util-subtokenize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,14 @@
"type": "module",
"files": [
"dev/",
"lib/",
"index.d.ts.map",
"index.d.ts",
"index.js",
"splice-buffer.d.ts.map",
"splice-buffer.d.ts",
"splice-buffer.js"
"index.js"
],
"exports": {
".": {
"development": "./dev/index.js",
"default": "./index.js"
},
"./splice-buffer": {
"development": "./dev/splice-buffer.js",
"default": "./splice-buffer.js"
}
"development": "./dev/index.js",
"default": "./index.js"
},
"dependencies": {
"devlop": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion test/misc/splice-buffer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import {SpliceBuffer} from 'micromark-util-subtokenize/splice-buffer'
import {SpliceBuffer} from 'micromark-util-subtokenize'

test('SpliceBuffer', function () {
/** @type {SpliceBuffer<bigint>} */
Expand Down

0 comments on commit bba3e39

Please sign in to comment.