Skip to content

Commit

Permalink
Change to use exports
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 27, 2023
1 parent d056940 commit bf5824f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@
],
"sideEffects": false,
"type": "module",
"main": "index.js",
"types": "index.d.ts",
"exports": "./index.js",
"files": [
"lib/",
"index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,9 @@ It lets you define your own schema of what is and isn’t allowed.

## Related

* [`MDX`](https://github.com/mdx-js/mdx)
* [`MDX`][mdx]
— JSX *in* markdown
* [`remark-gfm`](https://github.com/remarkjs/remark-gfm)
* [`remark-gfm`][remark-gfm]
— add support for GitHub flavored markdown support
* [`react-remark`][react-remark]
— modern hook based alternative
Expand Down
6 changes: 3 additions & 3 deletions test.jsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/* @jsxRuntime automatic @jsxImportSource react */
/**
* @typedef {import('hast').Root} Root
* @typedef {import('./index.js').ExtraProps} ExtraProps
* @typedef {import('react-markdown').ExtraProps} ExtraProps
*/

import assert from 'node:assert/strict'
import test from 'node:test'
import {renderToStaticMarkup} from 'react-dom/server'
import Markdown from 'react-markdown'
import rehypeRaw from 'rehype-raw'
import remarkGfm from 'remark-gfm'
import remarkToc from 'remark-toc'
import {visit} from 'unist-util-visit'
import Markdown from './index.js'

test('react-markdown', async function (t) {
await t.test('should expose the public api', async function () {
assert.deepEqual(Object.keys(await import('./index.js')).sort(), [
assert.deepEqual(Object.keys(await import('react-markdown')).sort(), [
'default',
'defaultUrlTransform'
])
Expand Down

0 comments on commit bf5824f

Please sign in to comment.