mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
Update MDX integration to es-module-lexer@1.1.1 (#6296)
* Update MDX integration to es-module-lexer@1.1.1 * Added missing pnpm-lock.yaml file * Create lucky-flowers-wonder.md --------- Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
This commit is contained in:
parent
f91a7f376c
commit
075b87e8b7
5 changed files with 16 additions and 11 deletions
5
.changeset/lucky-flowers-wonder.md
Normal file
5
.changeset/lucky-flowers-wonder.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@astrojs/mdx": patch
|
||||
---
|
||||
|
||||
Update to `es-module-lexer@1.1.1`
|
|
@ -1,5 +1,9 @@
|
|||
# @astrojs/mdx
|
||||
|
||||
## 0.17.1
|
||||
|
||||
- Updated to es-module-lexer@1.1.1
|
||||
|
||||
## 0.17.0
|
||||
|
||||
### Minor Changes
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@astrojs/mdx",
|
||||
"description": "Use MDX within Astro",
|
||||
"version": "0.17.0",
|
||||
"version": "0.17.1",
|
||||
"type": "module",
|
||||
"types": "./dist/index.d.ts",
|
||||
"author": "withastro",
|
||||
|
@ -35,7 +35,7 @@
|
|||
"@mdx-js/mdx": "^2.3.0",
|
||||
"@mdx-js/rollup": "^2.3.0",
|
||||
"acorn": "^8.8.0",
|
||||
"es-module-lexer": "^0.10.5",
|
||||
"es-module-lexer": "^1.1.1",
|
||||
"estree-util-visit": "^1.2.0",
|
||||
"github-slugger": "^1.4.0",
|
||||
"gray-matter": "^4.0.3",
|
||||
|
|
|
@ -112,13 +112,13 @@ export default function mdx(partialMdxOptions: Partial<MdxOptions> = {}): AstroI
|
|||
}
|
||||
|
||||
const { fileUrl, fileId } = getFileInfo(id, config);
|
||||
if (!moduleExports.includes('url')) {
|
||||
if (!moduleExports.find(({n}) => n === 'url')) {
|
||||
code += `\nexport const url = ${JSON.stringify(fileUrl)};`;
|
||||
}
|
||||
if (!moduleExports.includes('file')) {
|
||||
if (!moduleExports.find(({n}) => n === 'file')) {
|
||||
code += `\nexport const file = ${JSON.stringify(fileId)};`;
|
||||
}
|
||||
if (!moduleExports.includes('Content')) {
|
||||
if (!moduleExports.find(({n}) => n === 'Content')) {
|
||||
// Make `Content` the default export so we can wrap `MDXContent` and pass in `Fragment`
|
||||
code = code.replace('export default MDXContent;', '');
|
||||
code += `\nexport const Content = (props = {}) => MDXContent({
|
||||
|
|
|
@ -2901,7 +2901,7 @@ importers:
|
|||
astro-scripts: workspace:*
|
||||
chai: ^4.3.6
|
||||
cheerio: ^1.0.0-rc.11
|
||||
es-module-lexer: ^0.10.5
|
||||
es-module-lexer: ^1.1.1
|
||||
estree-util-visit: ^1.2.0
|
||||
github-slugger: ^1.4.0
|
||||
gray-matter: ^4.0.3
|
||||
|
@ -2929,7 +2929,7 @@ importers:
|
|||
'@mdx-js/mdx': 2.3.0
|
||||
'@mdx-js/rollup': 2.3.0
|
||||
acorn: 8.8.2
|
||||
es-module-lexer: 0.10.5
|
||||
es-module-lexer: 1.1.1
|
||||
estree-util-visit: 1.2.1
|
||||
github-slugger: 1.5.0
|
||||
gray-matter: 4.0.3
|
||||
|
@ -9296,10 +9296,6 @@ packages:
|
|||
unbox-primitive: 1.0.2
|
||||
which-typed-array: 1.1.9
|
||||
|
||||
/es-module-lexer/0.10.5:
|
||||
resolution: {integrity: sha512-+7IwY/kiGAacQfY+YBhKMvEmyAJnw5grTUgjG85Pe7vcUI/6b7pZjZG8nQ7+48YhzEAEqrEgD2dCz/JIK+AYvw==}
|
||||
dev: false
|
||||
|
||||
/es-module-lexer/1.1.1:
|
||||
resolution: {integrity: sha512-n3ruqU8Te7I5prBd6d0darM8ajFuVNhLWvgo04hN7goWSaSrxe7ENOZitac7akN0A2o+8fMomBDsNPvW/eE3CQ==}
|
||||
dev: false
|
||||
|
|
Loading…
Reference in a new issue