diff --git a/dev/index.d.ts b/dev/index.d.ts index 9d21541..639316f 100644 --- a/dev/index.d.ts +++ b/dev/index.d.ts @@ -1,5 +1,3 @@ -import type {OnEnterError} from './lib/index.js' - export type { CompileContext, Encoding, @@ -13,6 +11,8 @@ export type { Value } from './lib/index.js' +export {fromMarkdown} from './lib/index.js' + /** * Interface of tracked data. * @@ -77,5 +77,3 @@ declare module 'micromark-util-types' { _spread?: boolean } } - -export {fromMarkdown} from './lib/index.js' diff --git a/package.json b/package.json index 6b14c02..1d69a2d 100644 --- a/package.json +++ b/package.json @@ -28,18 +28,16 @@ ], "sideEffects": false, "type": "module", - "main": "index.js", - "types": "index.d.ts", + "exports": { + "development": "./dev/index.js", + "default": "./index.js" + }, "files": [ "dev/", "lib/", "index.d.ts", "index.js" ], - "exports": { - "development": "./dev/index.js", - "default": "./index.js" - }, "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", diff --git a/test/index.js b/test/index.js index 3a16fcc..96defea 100644 --- a/test/index.js +++ b/test/index.js @@ -9,14 +9,15 @@ import {commonmark} from 'commonmark.json' import {fromHtml} from 'hast-util-from-html' import {toHtml} from 'hast-util-to-html' import {toHast} from 'mdast-util-to-hast' +import {fromMarkdown} from 'mdast-util-from-markdown' import {toString} from 'mdast-util-to-string' -import {fromMarkdown} from '../dev/index.js' test('fromMarkdown', async function (t) { await t.test('should expose the public api', async function () { - assert.deepEqual(Object.keys(await import('../dev/index.js')).sort(), [ - 'fromMarkdown' - ]) + assert.deepEqual( + Object.keys(await import('mdast-util-from-markdown')).sort(), + ['fromMarkdown'] + ) }) await t.test('should parse an empty document', async function () {