diff --git a/.changeset/lucky-flowers-wonder.md b/.changeset/lucky-flowers-wonder.md new file mode 100644 index 000000000000..ce94336576d5 --- /dev/null +++ b/.changeset/lucky-flowers-wonder.md @@ -0,0 +1,5 @@ +--- +"@astrojs/mdx": patch +--- + +Update to `es-module-lexer@1.1.1` diff --git a/packages/integrations/mdx/CHANGELOG.md b/packages/integrations/mdx/CHANGELOG.md index 074162dc2f7f..59d299960f54 100644 --- a/packages/integrations/mdx/CHANGELOG.md +++ b/packages/integrations/mdx/CHANGELOG.md @@ -1,5 +1,9 @@ # @astrojs/mdx +## 0.17.1 + +- Updated to es-module-lexer@1.1.1 + ## 0.17.0 ### Minor Changes diff --git a/packages/integrations/mdx/package.json b/packages/integrations/mdx/package.json index 5d69781a8bb5..1e526bbc5b0e 100644 --- a/packages/integrations/mdx/package.json +++ b/packages/integrations/mdx/package.json @@ -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", diff --git a/packages/integrations/mdx/src/index.ts b/packages/integrations/mdx/src/index.ts index 7012849a4921..ecd7b7b43f79 100644 --- a/packages/integrations/mdx/src/index.ts +++ b/packages/integrations/mdx/src/index.ts @@ -112,13 +112,13 @@ export default function mdx(partialMdxOptions: Partial = {}): 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({ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a53c5b009cf5..c4b46873854a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -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