Skip to content

Commit b5f36de

Browse files
committedJul 6, 2023
Change to use export map
1 parent 77d6cb1 commit b5f36de

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed
 

‎.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.DS_Store
2-
lib/index.d.ts
3-
test.d.ts
2+
*.d.ts
43
*.log
54
coverage/
65
node_modules/
76
yarn.lock
7+
!/index.d.ts

‎index.test-d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import type {
1818
TableRow
1919
} from 'mdast'
2020
import type {Node, Parent} from 'unist'
21-
import {CONTINUE, EXIT, SKIP, visit} from './index.js'
21+
import {CONTINUE, EXIT, SKIP, visit} from 'unist-util-visit'
2222

2323
// To do: use `mdast` when released.
2424
type Nodes = Root | Content

‎package.json

+11-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@
4040
],
4141
"sideEffects": false,
4242
"type": "module",
43-
"main": "index.js",
44-
"types": "index.d.ts",
43+
"exports": "./index.js",
4544
"files": [
4645
"lib/",
4746
"index.d.ts",
@@ -99,6 +98,16 @@
9998
"strict": true
10099
},
101100
"xo": {
101+
"overrides": [
102+
{
103+
"files": [
104+
"**/*.ts"
105+
],
106+
"rules": {
107+
"import/no-extraneous-dependencies": "off"
108+
}
109+
}
110+
],
102111
"prettier": true
103112
}
104113
}

‎test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import test from 'node:test'
99
import {fromMarkdown} from 'mdast-util-from-markdown'
1010
import {gfmFromMarkdown} from 'mdast-util-gfm'
1111
import {gfm} from 'micromark-extension-gfm'
12-
import {CONTINUE, EXIT, SKIP, visit} from './index.js'
12+
import {CONTINUE, EXIT, SKIP, visit} from 'unist-util-visit'
1313

1414
const tree = fromMarkdown('Some _emphasis_, **importance**, and `code`.')
1515

@@ -50,7 +50,7 @@ const reverseTypes = [
5050

5151
test('visit', async function (t) {
5252
await t.test('should expose the public api', async function () {
53-
assert.deepEqual(Object.keys(await import('./index.js')).sort(), [
53+
assert.deepEqual(Object.keys(await import('unist-util-visit')).sort(), [
5454
'CONTINUE',
5555
'EXIT',
5656
'SKIP',

0 commit comments

Comments
 (0)
Please sign in to comment.