Skip to content

Commit bf5824f

Browse files
committed
Change to use exports
1 parent d056940 commit bf5824f

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@
6969
],
7070
"sideEffects": false,
7171
"type": "module",
72-
"main": "index.js",
73-
"types": "index.d.ts",
72+
"exports": "./index.js",
7473
"files": [
7574
"lib/",
7675
"index.d.ts",

readme.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -685,9 +685,9 @@ It lets you define your own schema of what is and isn’t allowed.
685685

686686
## Related
687687

688-
* [`MDX`](https://github.com/mdx-js/mdx)
688+
* [`MDX`][mdx]
689689
— JSX *in* markdown
690-
* [`remark-gfm`](https://github.com/remarkjs/remark-gfm)
690+
* [`remark-gfm`][remark-gfm]
691691
— add support for GitHub flavored markdown support
692692
* [`react-remark`][react-remark]
693693
— modern hook based alternative

test.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
/* @jsxRuntime automatic @jsxImportSource react */
22
/**
33
* @typedef {import('hast').Root} Root
4-
* @typedef {import('./index.js').ExtraProps} ExtraProps
4+
* @typedef {import('react-markdown').ExtraProps} ExtraProps
55
*/
66

77
import assert from 'node:assert/strict'
88
import test from 'node:test'
99
import {renderToStaticMarkup} from 'react-dom/server'
10+
import Markdown from 'react-markdown'
1011
import rehypeRaw from 'rehype-raw'
1112
import remarkGfm from 'remark-gfm'
1213
import remarkToc from 'remark-toc'
1314
import {visit} from 'unist-util-visit'
14-
import Markdown from './index.js'
1515

1616
test('react-markdown', async function (t) {
1717
await t.test('should expose the public api', async function () {
18-
assert.deepEqual(Object.keys(await import('./index.js')).sort(), [
18+
assert.deepEqual(Object.keys(await import('react-markdown')).sort(), [
1919
'default',
2020
'defaultUrlTransform'
2121
])

0 commit comments

Comments
 (0)