Skip to content

Commit f9fab12

Browse files
committed
Change to use exports
1 parent 6724645 commit f9fab12

File tree

81 files changed

+352
-123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+352
-123
lines changed

packages/hast-util-from-string/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
],
2727
"sideEffects": false,
2828
"type": "module",
29-
"main": "index.js",
30-
"types": "index.d.ts",
29+
"exports": "./index.js",
3130
"files": [
3231
"index.d.ts",
3332
"index.js",

packages/hast-util-from-string/test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@
44

55
import assert from 'node:assert/strict'
66
import test from 'node:test'
7-
import {fromString} from './index.js'
7+
import {fromString} from 'hast-util-from-string'
88

99
test('hast-util-from-string', async function (t) {
10+
await t.test('should expose the public api', async function () {
11+
assert.deepEqual(
12+
Object.keys(await import('hast-util-from-string')).sort(),
13+
['fromString']
14+
)
15+
})
16+
1017
await t.test('should set text nodes', async function () {
1118
/** @type {Nodes} */
1219
const node = {type: 'text', value: 'alpha'}

packages/hast-util-is-body-ok-link/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
],
2727
"sideEffects": false,
2828
"type": "module",
29-
"main": "index.js",
30-
"types": "index.d.ts",
29+
"exports": "./index.js",
3130
"files": [
3231
"index.d.ts",
3332
"index.js",

packages/hast-util-is-body-ok-link/test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {isBodyOkLink} from './index.js'
4+
import {isBodyOkLink} from 'hast-util-is-body-ok-link'
55

66
test('isBodyOkLink', async function (t) {
7+
await t.test('should expose the public api', async function () {
8+
assert.deepEqual(
9+
Object.keys(await import('hast-util-is-body-ok-link')).sort(),
10+
['isBodyOkLink']
11+
)
12+
})
13+
714
await t.test('should be yes for `link`s with `itemProp`', async function () {
815
assert.equal(isBodyOkLink(h('link', {itemProp: 'foo'})), true)
916
})

packages/hast-util-is-conditional-comment/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
],
2626
"sideEffects": false,
2727
"type": "module",
28-
"main": "index.js",
29-
"types": "index.d.ts",
28+
"exports": "./index.js",
3029
"files": [
3130
"index.d.ts",
3231
"index.js",

packages/hast-util-is-conditional-comment/test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {isConditionalComment} from './index.js'
4+
import {isConditionalComment} from 'hast-util-is-conditional-comment'
55

66
test('hast-util-is-conditional-comment', async function (t) {
7+
await t.test('should expose the public api', async function () {
8+
assert.deepEqual(
9+
Object.keys(await import('hast-util-is-conditional-comment')).sort(),
10+
['isConditionalComment']
11+
)
12+
})
13+
714
await t.test('should detect a bunch of comments', async function () {
815
const fixtures = [
916
'[if IE]>…<![endif]',

packages/hast-util-is-css-link/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
],
2626
"sideEffects": false,
2727
"type": "module",
28-
"main": "index.js",
29-
"types": "index.d.ts",
28+
"exports": "./index.js",
3029
"files": [
3130
"index.d.ts",
3231
"index.js",

packages/hast-util-is-css-link/test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {isCssLink} from './index.js'
4+
import {isCssLink} from 'hast-util-is-css-link'
55

66
test('hast-util-is-css-link', async function (t) {
7+
await t.test('should expose the public api', async function () {
8+
assert.deepEqual(
9+
Object.keys(await import('hast-util-is-css-link')).sort(),
10+
['isCssLink']
11+
)
12+
})
13+
714
await t.test(
815
'should be yes for `link` with `[rel=stylesheet]` and no `[type]`',
916
async function () {

packages/hast-util-is-css-style/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
],
2626
"sideEffects": false,
2727
"type": "module",
28-
"main": "index.js",
29-
"types": "index.d.ts",
28+
"exports": "./index.js",
3029
"files": [
3130
"index.d.ts",
3231
"index.js",

packages/hast-util-is-css-style/test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {isCssStyle} from './index.js'
4+
import {isCssStyle} from 'hast-util-is-css-style'
55

66
test('hast-util-is-css-style', async function (t) {
7+
await t.test('should expose the public api', async function () {
8+
assert.deepEqual(
9+
Object.keys(await import('hast-util-is-css-style')).sort(),
10+
['isCssStyle']
11+
)
12+
})
13+
714
await t.test('should be yes for a `style` node', async function () {
815
assert.equal(isCssStyle(h('style')), true)
916
})

0 commit comments

Comments
 (0)