@@ -62,7 +62,7 @@ internals away.
62
62
## Install
63
63
64
64
This package is [ ESM only] [ esm ] .
65
- In Node.js (version 14.14+ and 16.0 +), install with [ npm] [ ] :
65
+ In Node.js (version 16 +), install with [ npm] [ ] :
66
66
67
67
``` sh
68
68
npm install mdast-util-mdx-expression
@@ -99,10 +99,10 @@ b {true}.
99
99
``` js
100
100
import fs from ' node:fs/promises'
101
101
import * as acorn from ' acorn'
102
- import {fromMarkdown } from ' mdast-util-from-markdown'
103
- import {toMarkdown } from ' mdast-util-to-markdown'
104
102
import {mdxExpression } from ' micromark-extension-mdx-expression'
103
+ import {fromMarkdown } from ' mdast-util-from-markdown'
105
104
import {mdxExpressionFromMarkdown , mdxExpressionToMarkdown } from ' mdast-util-mdx-expression'
105
+ import {toMarkdown } from ' mdast-util-to-markdown'
106
106
107
107
const doc = await fs .readFile (' example.mdx' )
108
108
@@ -208,11 +208,15 @@ MDX expression node, occurring in flow (block) (TypeScript type).
208
208
209
209
``` ts
210
210
import type {Program } from ' estree-jsx'
211
- import type {Literal } from ' mdast'
211
+ import type {Data , Literal } from ' mdast'
212
212
213
213
interface MdxFlowExpression extends Literal {
214
214
type: ' mdxFlowExpression'
215
- data? : {estree? : Program | null | undefined } & Literal [' data' ]
215
+ data? : MdxFlowExpressionData | undefined
216
+ }
217
+
218
+ interface MdxFlowExpressionData extends Data {
219
+ estree? : Program | null | undefined
216
220
}
217
221
```
218
222
@@ -224,11 +228,15 @@ MDX expression node, occurring in text (block) (TypeScript type).
224
228
225
229
``` ts
226
230
import type {Program } from ' estree-jsx'
227
- import type {Literal } from ' mdast'
231
+ import type {Data , Literal } from ' mdast'
228
232
229
233
interface MdxTextExpression extends Literal {
230
234
type: ' mdxTextExpression'
231
- data? : {estree? : Program | null | undefined } & Literal [' data' ]
235
+ data? : MdxTextExpressionData | undefined
236
+ }
237
+
238
+ interface MdxTextExpressionData extends Data {
239
+ estree? : Program | null | undefined
232
240
}
233
241
```
234
242
@@ -241,11 +249,15 @@ Same as [`MdxFlowExpression`][api-mdx-flow-expression], but registered with
241
249
242
250
``` ts
243
251
import type {Program } from ' estree-jsx'
244
- import type {Literal } from ' hast'
252
+ import type {Data , Literal } from ' hast'
245
253
246
254
interface MdxFlowExpressionHast extends Literal {
247
255
type: ' mdxFlowExpression'
248
- data? : {estree? : Program | null | undefined } & Literal [' data' ]
256
+ data? : MdxFlowExpressionData | undefined
257
+ }
258
+
259
+ interface MdxFlowExpressionData extends Data {
260
+ estree? : Program | null | undefined
249
261
}
250
262
```
251
263
@@ -258,11 +270,15 @@ Same as [`MdxTextExpression`][api-mdx-text-expression], but registered with
258
270
259
271
``` ts
260
272
import type {Program } from ' estree-jsx'
261
- import type {Literal } from ' hast'
273
+ import type {Data , Literal } from ' hast'
262
274
263
275
interface MdxTextExpressionHast extends Literal {
264
276
type: ' mdxTextExpression'
265
- data? : {estree? : Program | null | undefined } & Literal [' data' ]
277
+ data? : MdxTextExpressionData | undefined
278
+ }
279
+
280
+ interface MdxTextExpressionData extends Data {
281
+ estree? : Program | null | undefined
266
282
}
267
283
```
268
284
@@ -288,7 +304,7 @@ The following interfaces are added to **[mdast][]** by this utility.
288
304
289
305
``` idl
290
306
interface MdxFlowExpression <: Literal {
291
- type: " mdxFlowExpression"
307
+ type: ' mdxFlowExpression'
292
308
}
293
309
```
294
310
@@ -315,7 +331,7 @@ Yields:
315
331
316
332
``` idl
317
333
interface MdxTextExpression <: Literal {
318
- type: " mdxTextExpression"
334
+ type: ' mdxTextExpression"
319
335
}
320
336
```
321
337
@@ -379,12 +395,15 @@ visit(tree, function (node) {
379
395
380
396
## Compatibility
381
397
382
- Projects maintained by the unified collective are compatible with all maintained
398
+ Projects maintained by the unified collective are compatible with maintained
383
399
versions of Node.js.
384
- As of now, that is Node.js 14.14+ and 16.0+.
385
- Our projects sometimes work with older versions, but this is not guaranteed.
386
400
387
- This plugin works with ` mdast-util-from-markdown ` version 1+ and
401
+ When we cut a new major release, we drop support for unmaintained versions of
402
+ Node.
403
+ This means we try to keep the current release line,
404
+ ` mdast-util-mdx-expression@^1 ` , compatible with Node.js 12.
405
+
406
+ This utility works with ` mdast-util-from-markdown ` version 1+ and
388
407
` mdast-util-to-markdown ` version 1+.
389
408
390
409
## Related
@@ -424,9 +443,9 @@ abide by its terms.
424
443
425
444
[ downloads ] : https://www.npmjs.com/package/mdast-util-mdx-expression
426
445
427
- [ size-badge ] : https://img.shields.io/bundlephobia/minzip/ mdast-util-mdx-expression.svg
446
+ [ size-badge ] : https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q= mdast-util-mdx-expression
428
447
429
- [ size ] : https://bundlephobia .com/result?p =mdast-util-mdx-expression
448
+ [ size ] : https://bundlejs .com/?q =mdast-util-mdx-expression
430
449
431
450
[ sponsors-badge ] : https://opencollective.com/unified/sponsors/badge.svg
432
451
0 commit comments