8000 feat!: drop CJS, now it's ESM-only · antfu/markdown-it-github-alerts@fc388da · GitHub
[go: up one dir, main page]

Skip to content

Commit fc388da

Browse files
committed
feat!: drop CJS, now it's ESM-only
1 parent 5663a02 commit fc388da

File tree

6 files changed

+21
-143
lines changed

6 files changed

+21
-143
lines changed

build.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ export default defineBuildConfig({
44
entries: [
55
'src/index',
66
],
7-
declaration: true,
7+
declaration: 'node16',
88
clean: true,
9-
rollup: {
10-
emitCJS: true,
11-
},
129
})

eslint.config.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11
// @ts-check
22
import antfu from '@antfu/eslint-config'
33

4-
export default antfu(
5-
{
6-
ignores: [
7-
// eslint ignore globs here
8-
],
9-
},
10-
{
11-
rules: {
12-
// overrides
13-
},
14-
},
15-
)
4+
export default antfu()

package.json

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,12 @@
1919
],
2020
"sideEffects": false,
2121
"exports": {
22-
".": {
23-
"types": "./dist/index.d.ts",
24-
"import": "./dist/index.mjs",
25-
"require": "./dist/index.cjs"
26-
},
22+
".": "./dist/index.mjs",
2723
"./styles/*": "./styles/*"
2824
},
2925
"main": "./dist/index.mjs",
3026
"module": "./dist/index.mjs",
31-
"types": "./dist/index.d.ts",
32-
"typesVersions": {
33-
"*": {
34-
"*": [
35-
"./dist/*",
36-
"./dist/index.d.ts"
37-
]
38-
}
39-
},
27+
"types": "./dist/index.d.mts",
4028
"files": [
4129
"dist",
4230
"styles"

pnpm-lock.yaml

Lines changed: 13 additions & 109 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type MarkdownIt from 'markdown-it'
1+
import type { PluginWithOptions } from 'markdown-it'
22

33
export interface MarkdownItGitHubAlertsOptions {
44
/**
@@ -45,7 +45,7 @@ const DEFAULT_GITHUB_ICONS = {
4545
caution: '<svg class="octicon octicon-stop mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>',
4646
}
4747

48-
const MarkdownItGitHubAlerts: MarkdownIt.PluginWithOptions<MarkdownItGitHubAlertsOptions> = (md, options = {}) => {
48+
const MarkdownItGitHubAlerts: PluginWithOptions<MarkdownItGitHubAlertsOptions> = (md, options = {}) => {
4949
const {
5050
markers = ['TIP', 'NOTE', 'IMPORTANT', 'WARNING', 'CAUTION'],
5151
icons = DEFAULT_GITHUB_ICONS,

0 commit comments

Comments
 (0)
0