Skip to content

Commit 19c9689

Browse files
committed
Change to use exports
1 parent edc7e66 commit 19c9689

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
],
2929
"sideEffects": false,
3030
"type": "module",
31-
"main": "index.js",
32-
"types": "index.d.ts",
31+
"exports": "./index.js",
3332
"files": [
3433
"lib/",
3534
"index.d.ts",

test/index.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
/**
2-
* @typedef {import('../index.js').Fragment} Fragment
3-
* @typedef {import('../index.js').Jsx} Jsx
4-
* @typedef {import('../index.js').JsxDev} JsxDev
2+
* @typedef {import('hast-util-to-jsx-runtime').Fragment} Fragment
3+
* @typedef {import('hast-util-to-jsx-runtime').Jsx} Jsx
4+
* @typedef {import('hast-util-to-jsx-runtime').JsxDev} JsxDev
5+
*
56
* @typedef {import('../lib/index.js').Source} Source
67
*/
78

89
import assert from 'node:assert/strict'
910
import test from 'node:test'
1011
import {h, s} from 'hastscript'
12+
import {toJsxRuntime} from 'hast-util-to-jsx-runtime'
1113
import React from 'react'
1214
import * as dev from 'react/jsx-dev-runtime'
1315
import * as prod from 'react/jsx-runtime'
1416
import {renderToStaticMarkup} from 'react-dom/server'
15-
import {toJsxRuntime} from '../index.js'
1617

1718
/** @type {{Fragment: Fragment, jsx: Jsx, jsxs: Jsx}} */
1819
// @ts-expect-error: the react types are missing.
@@ -24,9 +25,10 @@ const development = {Fragment: dev.Fragment, jsxDEV: dev.jsxDEV}
2425

2526
test('core', async function (t) {
2627
await t.test('should expose the public api', async function () {
27-
assert.deepEqual(Object.keys(await import('../index.js')).sort(), [
28-
'toJsxRuntime'
29-
])
28+
assert.deepEqual(
29+
Object.keys(await import('hast-util-to-jsx-runtime')).sort(),
30+
['toJsxRuntime']
31+
)
3032
})
3133

3234
await t.test(

0 commit comments

Comments
 (0)