Skip to content

Commit 7c75796

Browse files
committedSep 25, 2023
Change to use exports
1 parent 8763a11 commit 7c75796

7 files changed

+18
-12
lines changed
 
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: ‎lib/find-repo.js renamed to ‎lib/find-repo.node.js

File renamed without changes.

Diff for: ‎lib/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ import {toString} from 'mdast-util-to-string'
128128
import propose_ from 'propose'
129129
import {visit} from 'unist-util-visit'
130130
import {VFile} from 'vfile'
131-
import {checkFiles} from './check-files.js'
132131
import {constants} from './constants.js'
133-
import {findRepo} from './find-repo.js'
132+
import {checkFiles} from '#check-files'
133+
import {findRepo} from '#find-repo'
134134

135135
const propose = /** @type {Propose} */ (propose_)
136136

Diff for: ‎package.json

+11-6
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,22 @@
3434
],
3535
"sideEffects": false,
3636
"type": "module",
37-
"main": "index.js",
38-
"types": "index.d.ts",
37+
"exports": "./index.js",
38+
"imports": {
39+
"#check-files": {
40+
"node": "./lib/check-files.node.js",
41+
"default": "./lib/check-files.default.js"
42+
},
43+
"#find-repo": {
44+
"node": "./lib/find-repo.node.js",
45+
"default": "./lib/find-repo.default.js"
46+
}
47+
},
3948
"files": [
4049
"lib/",
4150
"index.d.ts",
4251
"index.js"
4352
],
44-
"browser": {
45-
"./lib/check-files.js": "./lib/check-files.browser.js",
46-
"./lib/find-repo.js": "./lib/find-repo.browser.js"
47-
},
4853
"dependencies": {
4954
"@types/mdast": "^4.0.0",
5055
"github-slugger": "^2.0.0",

Diff for: ‎test/index.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ import {fileURLToPath} from 'node:url'
1616
import test from 'node:test'
1717
import {promisify} from 'node:util'
1818
import {remark} from 'remark'
19+
import remarkValidateLinks from 'remark-validate-links'
1920
import strip from 'strip-ansi'
2021
import {read} from 'to-vfile'
21-
import remarkValidateLinks from '../index.js'
2222
import sort from './sort.js'
2323

2424
const exec = promisify(execCallback)
@@ -36,9 +36,10 @@ test('remark-validate-links', async function (t) {
3636
process.chdir(fileURLToPath(fakeBaseUrl))
3737

3838
await t.test('should expose the public api', async function () {
39-
assert.deepEqual(Object.keys(await import('../index.js')).sort(), [
40-
'default'
41-
])
39+
assert.deepEqual(
40+
Object.keys(await import('remark-validate-links')).sort(),
41+
['default']
42+
)
4243
})
4344

4445
await t.test('should work on the API', async function () {

0 commit comments

Comments
 (0)
Please sign in to comment.