Skip to content

Commit

Permalink
Remove unneeded main, types fields
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 8, 2023
1 parent 8b27f61 commit b46fc50
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
6 changes: 2 additions & 4 deletions dev/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type {OnEnterError} from './lib/index.js'

export type {
CompileContext,
Encoding,
Expand All @@ -13,6 +11,8 @@ export type {
Value
} from './lib/index.js'

export {fromMarkdown} from './lib/index.js'

/**
* Interface of tracked data.
*
Expand Down Expand Up @@ -77,5 +77,3 @@ declare module 'micromark-util-types' {
_spread?: boolean
}
}

export {fromMarkdown} from './lib/index.js'
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 5 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit b46fc50

Please sign in to comment.