Skip to content

Commit 943f6ac

Browse files
committed
1 parent 13542c3 commit 943f6ac

File tree

14 files changed

+71
-50
lines changed

14 files changed

+71
-50
lines changed

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,28 @@
1717
"packages/remark-cli/"
1818
],
1919
"devDependencies": {
20-
"@types/mdast": "^3.0.0",
20+
"@types/mdast": "^4.0.0",
2121
"@types/node": "^20.0.0",
2222
"c8": "^8.0.0",
2323
"camelcase": "^8.0.0",
2424
"execa": "^8.0.0",
25-
"mdast-util-assert": "^4.0.0",
26-
"mdast-util-gfm": "^2.0.0",
27-
"micromark-extension-gfm": "^2.0.0",
25+
"mdast-util-assert": "^5.0.0",
26+
"mdast-util-gfm": "^3.0.0",
27+
"micromark-extension-gfm": "^3.0.0",
2828
"prettier": "^3.0.0",
2929
"remark-preset-wooorm": "^9.0.0",
3030
"rimraf": "^3.0.0",
3131
"type-coverage": "^2.0.0",
3232
"typescript": "^5.0.0",
33-
"unified": "^10.0.0",
34-
"unist-util-remove-position": "^4.0.0",
33+
"unified": "^11.0.0",
34+
"unist-util-remove-position": "^5.0.0",
3535
"xo": "^0.56.0"
3636
},
3737
"scripts": {
38+
"#": "./packages/remark-cli/cli.js . -qfo",
3839
"prepack": "npm run build && npm run format",
3940
"build": "tsc --build --clean && tsc --build && type-coverage",
40-
"format": "./packages/remark-cli/cli.js . -qfo && prettier . -w --log-level warn && xo --fix",
41+
"format": "prettier . -w --log-level warn && xo --fix",
4142
"test-api": "npm run test --workspaces && node --conditions development test/index.js",
4243
"test-coverage": "c8 --100 --reporter lcov npm run test-api",
4344
"test": "npm run build && npm run format && npm run test-coverage"

packages/remark-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"dependencies": {
3434
"markdown-extensions": "^2.0.0",
3535
"remark": "^14.0.0",
36-
"unified-args": "^10.0.0"
36+
"unified-args": "^11.0.0"
3737
},
3838
"scripts": {
3939
"test": "node --conditions development test.js"

packages/remark-cli/test.js

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,32 @@ test('remark-cli', async (t) => {
1818
'',
1919
'Options:',
2020
'',
21+
' --[no-]color specify color in report (on by default)',
22+
' --[no-]config search for configuration files (on by default)',
23+
' -e --ext <extensions> specify extensions',
24+
' --file-path <path> specify path to process as',
25+
' -f --frail exit with 1 on warnings',
2126
' -h --help output usage information',
22-
' -v --version output version number',
27+
' --[no-]ignore search for ignore files (on by default)',
28+
' -i --ignore-path <path> specify ignore file',
29+
' --ignore-path-resolve-from cwd|dir resolve patterns in `ignore-path` from its directory or cwd',
30+
' --ignore-pattern <globs> specify ignore patterns',
31+
' --inspect output formatted syntax tree',
2332
' -o --output [path] specify output location',
33+
' -q --quiet output only warnings and errors',
2434
' -r --rc-path <path> specify configuration file',
25-
' -i --ignore-path <path> specify ignore file',
35+
' --report <reporter> specify reporter',
2636
' -s --setting <settings> specify settings',
27-
' -e --ext <extensions> specify extensions',
28-
' -u --use <plugins> use plugins',
29-
' -w --watch watch for changes and reprocess',
30-
' -q --quiet output only warnings and errors',
3137
' -S --silent output only errors',
32-
' -f --frail exit with 1 on warnings',
33-
' -t --tree specify input and output as syntax tree',
34-
' --report <reporter> specify reporter',
35-
' --file-path <path> specify path to process as',
36-
' --ignore-path-resolve-from dir|cwd resolve patterns in `ignore-path` from its directory or cwd',
37-
' --ignore-pattern <globs> specify ignore patterns',
3838
' --silently-ignore do not fail when given ignored files',
39+
' --[no-]stdout specify writing to stdout (on by default)',
40+
' -t --tree specify input and output as syntax tree',
3941
' --tree-in specify input as syntax tree',
4042
' --tree-out output syntax tree',
41-
' --inspect output formatted syntax tree',
42-
' --[no-]stdout specify writing to stdout (on by default)',
43-
' --[no-]color specify color in report (on by default)',
44-
' --[no-]config search for configuration files (on by default)',
45-
' --[no-]ignore search for ignore files (on by default)',
43+
' -u --use <plugins> use plugins',
44+
' --verbose report extra info for messages',
45+
' -v --version output version number',
46+
' -w --watch watch for changes and reprocess',
4647
'',
4748
'Examples:',
4849
'',

packages/remark-parse/lib/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {fromMarkdown} from 'mdast-util-from-markdown'
1010
* @type {import('unified').Plugin<[Options?] | void[], string, Root>}
1111
*/
1212
export default function remarkParse(options) {
13-
/** @type {import('unified').ParserFunction<Root>} */
13+
/** @type {import('unified').Parser<Root>} */
1414
const parser = (doc) => {
1515
// Assume options.
1616
const settings = /** @type {Options} */ (this.data('settings'))
@@ -21,7 +21,9 @@ export default function remarkParse(options) {
2121
// Note: these options are not in the readme.
2222
// The goal is for them to be set by plugins on `data` instead of being
2323
// passed by users.
24+
// @ts-expect-error: to do: type.
2425
extensions: this.data('micromarkExtensions') || [],
26+
// @ts-expect-error: to do: type.
2527
mdastExtensions: this.data('fromMarkdownExtensions') || []
2628
})
2729
)

packages/remark-parse/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
"index.js"
4242
],
4343
"dependencies": {
44-
"@types/mdast": "^3.0.0",
45-
"mdast-util-from-markdown": "^1.0.0",
46-
"unified": "^10.0.0"
44+
"@types/mdast": "^4.0.0",
45+
"mdast-util-from-markdown": "^2.0.0",
46+
"unified": "^11.0.0"
4747
},
4848
"scripts": {
4949
"test": "node --conditions development test.js"

packages/remark-parse/test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ test('remarkParse', async (t) => {
1515

1616
await t.test('extensions', () => {
1717
const tree = unified()
18+
// @ts-expect-error: to do: type settings.
1819
.data('micromarkExtensions', [gfm()])
20+
// @ts-expect-error: to do: type settings.
1921
.data('fromMarkdownExtensions', [gfmFromMarkdown()])
2022
.use(remarkParse)
2123
.parse('* [x] [email protected] ~~strikethrough~~')
2224

23-
removePosition(tree, true)
25+
removePosition(tree, {force: true})
2426

2527
assert.deepEqual(
2628
tree,

packages/remark-stringify/lib/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {toMarkdown} from 'mdast-util-to-markdown'
1111
* @type {import('unified').Plugin<[Options?]|void[], Node, string>}
1212
*/
1313
export default function remarkStringify(options) {
14-
/** @type {import('unified').CompilerFunction<Node, string>} */
14+
/** @type {import('unified').Compiler<Node, string>} */
1515
const compiler = (tree) => {
1616
// Assume options.
1717
const settings = /** @type {Options} */ (this.data('settings'))
@@ -23,7 +23,9 @@ export default function remarkStringify(options) {
2323
// The goal is for it to be set by plugins on `data` instead of being
2424
// passed by users.
2525
extensions:
26+
// @ts-expect-error: to do: type.
2627
/** @type {ToMarkdownOptions['extensions']} */ (
28+
// @ts-expect-error: to do: type.
2729
this.data('toMarkdownExtensions')
2830
) || []
2931
})

packages/remark-stringify/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
"index.js"
4242
],
4343
"dependencies": {
44-
"@types/mdast": "^3.0.0",
45-
"mdast-util-to-markdown": "^1.0.0",
46-
"unified": "^10.0.0"
44+
"@types/mdast": "^4.0.0",
45+
"mdast-util-to-markdown": "^2.0.0",
46+
"unified": "^11.0.0"
4747
},
4848
"scripts": {
4949
"test": "node --conditions development test.js"

packages/remark-stringify/test.js

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ test('remarkStringify', async (t) => {
4747
() => {
4848
unified()
4949
.use(remarkStringify)
50+
// @ts-expect-error: to do: type settings.
5051
.data('settings', {bullet: true})
5152
.stringify({
5253
type: 'root',
@@ -63,6 +64,7 @@ test('remarkStringify', async (t) => {
6364
() => {
6465
unified()
6566
.use(remarkStringify)
67+
// @ts-expect-error: to do: type settings.
6668
.data('settings', {listItemIndent: 'foo'})
6769
.stringify({
6870
type: 'root',
@@ -79,6 +81,7 @@ test('remarkStringify', async (t) => {
7981
() => {
8082
unified()
8183
.use(remarkStringify)
84+
// @ts-expect-error: to do: type settings.
8285
.data('settings', {rule: true})
8386
.stringify({type: 'root', children: [{type: 'thematicBreak'}]})
8487
},
@@ -90,6 +93,7 @@ test('remarkStringify', async (t) => {
9093
() => {
9194
unified()
9295
.use(remarkStringify)
96+
// @ts-expect-error: to do: type settings.
9397
.data('settings', {ruleRepetition: 1})
9498
.stringify({type: 'root', children: [{type: 'thematicBreak'}]})
9599
},
@@ -101,6 +105,7 @@ test('remarkStringify', async (t) => {
101105
() => {
102106
unified()
103107
.use(remarkStringify)
108+
// @ts-expect-error: to do: type settings.
104109
.data('settings', {ruleRepetition: true})
105110
.stringify({type: 'root', children: [{type: 'thematicBreak'}]})
106111
},
@@ -112,6 +117,7 @@ test('remarkStringify', async (t) => {
112117
() => {
113118
unified()
114119
.use(remarkStringify)
120+
// @ts-expect-error: to do: type settings.
115121
.data('settings', {emphasis: '-'})
116122
.stringify({type: 'root', children: [{type: 'emphasis', children: []}]})
117123
},
@@ -123,6 +129,7 @@ test('remarkStringify', async (t) => {
123129
() => {
124130
unified()
125131
.use(remarkStringify)
132+
// @ts-expect-error: to do: type settings.
126133
.data('settings', {strong: '-'})
127134
.stringify({type: 'root', children: [{type: 'strong', children: []}]})
128135
},
@@ -134,6 +141,7 @@ test('remarkStringify', async (t) => {
134141
() => {
135142
unified()
136143
.use(remarkStringify)
144+
// @ts-expect-error: to do: type settings.
137145
.data('settings', {fence: '-'})
138146
.stringify({type: 'root', children: [{type: 'code', value: ''}]})
139147
},
@@ -154,7 +162,7 @@ test('remarkStringify', async (t) => {
154162
}
155163
]
156164
}),
157-
'* alpha\n',
165+
'* alpha\n',
158166
'no ordered, start, or spread'
159167
)
160168

@@ -171,7 +179,7 @@ test('remarkStringify', async (t) => {
171179
}
172180
]
173181
}),
174-
'* bravo\n',
182+
'* bravo\n',
175183
'start; no ordered or spread'
176184
)
177185

@@ -194,7 +202,7 @@ test('remarkStringify', async (t) => {
194202
}
195203
]
196204
}),
197-
'* charlie\n\n* delta\n',
205+
'* charlie\n\n* delta\n',
198206
'spread; no ordered or start'
199207
)
200208

@@ -214,7 +222,7 @@ test('remarkStringify', async (t) => {
214222
}
215223
]
216224
}),
217-
'1. echo\n',
225+
'1. echo\n',
218226
'ordered; no start or spread'
219227
)
220228

@@ -238,7 +246,7 @@ test('remarkStringify', async (t) => {
238246
}
239247
]
240248
}),
241-
'1. foxtrot\n\n2. golf\n',
249+
'1. foxtrot\n\n2. golf\n',
242250
'ordered and spread; no start'
243251
)
244252

@@ -263,7 +271,7 @@ test('remarkStringify', async (t) => {
263271
}
264272
]
265273
}),
266-
'3. hotel\n\n4. india\n',
274+
'3. hotel\n\n4. india\n',
267275
'ordered, spread, and start'
268276
)
269277
})
@@ -282,19 +290,19 @@ test('remarkStringify', async (t) => {
282290

283291
assert.equal(
284292
toString({type: 'listItem', children}),
285-
'* alpha\n\n > bravo\n',
293+
'* alpha\n\n > bravo\n',
286294
'no spread'
287295
)
288296

289297
assert.equal(
290298
toString({type: 'listItem', spread: true, children}),
291-
'* alpha\n\n > bravo\n',
299+
'* alpha\n\n > bravo\n',
292300
'spread: true'
293301
)
294302

295303
assert.equal(
296304
toString({type: 'listItem', spread: false, children}),
297-
'* alpha\n > bravo\n',
305+
'* alpha\n > bravo\n',
298306
'spread: false'
299307
)
300308
})
@@ -466,6 +474,7 @@ test('stringify escapes', () => {
466474

467475
test('extensions', () => {
468476
const doc = unified()
477+
// @ts-expect-error: to do: type settings.
469478
.data('toMarkdownExtensions', [gfmToMarkdown()])
470479
.use(remarkStringify)
471480
.stringify({
@@ -591,8 +600,8 @@ test('extensions', () => {
591600
'',
592601
'## Tasklist',
593602
'',
594-
'* [ ] to do',
595-
'* [x] done',
603+
'* [ ] to do',
604+
'* [x] done',
596605
''
597606
].join('\n')
598607
)

packages/remark/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
"index.js"
3939
],
4040
"dependencies": {
41-
"@types/mdast": "^3.0.0",
41+
"@types/mdast": "^4.0.0",
4242
"remark-parse": "^10.0.0",
4343
"remark-stringify": "^10.0.0",
44-
"unified": "^10.0.0"
44+
"unified": "^11.0.0"
4545
},
4646
"scripts": {
4747
"test": "node --conditions development test.js"

0 commit comments

Comments
 (0)