@astrojs/mdx 0.7.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/CHANGELOG.md +23 -0
  3. package/README.md +59 -63
  4. package/dist/astro-data-utils.d.ts +1 -1
  5. package/dist/astro-data-utils.js +5 -24
  6. package/dist/index.d.ts +0 -7
  7. package/dist/index.js +3 -9
  8. package/package.json +4 -5
  9. package/src/astro-data-utils.ts +6 -28
  10. package/src/index.ts +3 -14
  11. package/test/fixtures/mdx-component/dist/index.html +3 -0
  12. package/test/fixtures/mdx-component/node_modules/.vite/deps_temp/package.json +1 -0
  13. package/test/fixtures/mdx-custom-frontmatter-name/dist/glob.json +1 -0
  14. package/test/fixtures/mdx-custom-frontmatter-name/dist/index.html +1 -0
  15. package/test/fixtures/mdx-custom-frontmatter-name/node_modules/.vite/deps_temp/package.json +1 -0
  16. package/test/fixtures/mdx-frontmatter/dist/glob.json +1 -0
  17. package/test/fixtures/mdx-frontmatter/dist/index.html +17 -0
  18. package/test/fixtures/mdx-frontmatter/dist/with-headings/index.html +18 -0
  19. package/test/fixtures/mdx-frontmatter/node_modules/.vite/deps_temp/package.json +1 -0
  20. package/test/fixtures/mdx-frontmatter-injection/node_modules/.bin/astro +2 -2
  21. package/test/fixtures/mdx-get-headings/dist/pages.json +1 -0
  22. package/test/fixtures/mdx-get-headings/dist/test/index.html +5 -0
  23. package/test/fixtures/mdx-get-headings/dist/test-with-jsx-expressions/index.html +3 -0
  24. package/test/fixtures/mdx-get-headings/node_modules/.vite/deps_temp/package.json +1 -0
  25. package/test/fixtures/mdx-get-static-paths/dist/one/index.html +13 -0
  26. package/test/fixtures/mdx-page/dist/index.html +1 -0
  27. package/test/fixtures/mdx-page/node_modules/.bin/astro +2 -2
  28. package/test/fixtures/mdx-page/node_modules/.vite/deps_temp/package.json +1 -0
  29. package/test/fixtures/mdx-plus-react/dist/client.0d691cb3.js +32 -0
  30. package/test/fixtures/mdx-plus-react/dist/index.html +8 -0
  31. package/test/fixtures/mdx-plus-react/node_modules/.bin/astro +2 -2
  32. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/@astrojs_react_client__js.js +95 -0
  33. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/@astrojs_react_client__js.js.map +7 -0
  34. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/_metadata.json +47 -0
  35. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/chunk-CDYRCHBX.js +7480 -0
  36. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/chunk-CDYRCHBX.js.map +7 -0
  37. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/chunk-RRXZ3AUC.js +326 -0
  38. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/chunk-RRXZ3AUC.js.map +7 -0
  39. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/chunk-TWLJ45QX.js +27 -0
  40. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/chunk-TWLJ45QX.js.map +7 -0
  41. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/package.json +1 -0
  42. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/react-dom.js +12 -0
  43. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/react-dom.js.map +7 -0
  44. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/react.js +11 -0
  45. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/react.js.map +7 -0
  46. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/react_jsx-dev-runtime.js +41 -0
  47. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/react_jsx-dev-runtime.js.map +7 -0
  48. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/react_jsx-runtime.js +62 -0
  49. package/test/fixtures/mdx-plus-react/node_modules/.vite/deps_temp/react_jsx-runtime.js.map +7 -0
  50. package/test/fixtures/mdx-rehype-plugins/dist/reading-time.json +1 -0
  51. package/test/fixtures/mdx-rehype-plugins/dist/space-ipsum/index.html +13 -0
  52. package/test/fixtures/mdx-rehype-plugins/node_modules/.vite/deps_temp/package.json +1 -0
  53. package/test/fixtures/mdx-remark-plugins/dist/with-gfm/index.html +2 -0
  54. package/test/fixtures/mdx-remark-plugins/dist/with-toc/index.html +22 -0
  55. package/test/fixtures/mdx-remark-plugins/node_modules/.vite/deps_temp/package.json +1 -0
  56. package/test/fixtures/mdx-syntax-hightlighting/dist/index.html +6 -0
  57. package/test/fixtures/mdx-syntax-hightlighting/node_modules/.vite/deps_temp/package.json +1 -0
  58. package/test/fixtures/mdx-url-export/dist/pages.json +1 -0
  59. package/test/fixtures/mdx-url-export/dist/test-1/index.html +1 -0
  60. package/test/fixtures/mdx-url-export/dist/test-2/index.html +1 -0
  61. package/test/fixtures/mdx-url-export/dist/with-url-override/index.html +1 -0
  62. package/test/fixtures/mdx-url-export/node_modules/.vite/deps_temp/package.json +1 -0
  63. package/test/fixtures/node_modules/.vite/deps_temp/package.json +1 -0
  64. package/test/mdx-frontmatter.test.js +0 -17
  65. package/test/fixtures/mdx-custom-frontmatter-name/src/pages/glob.json.js +0 -9
  66. package/test/fixtures/mdx-custom-frontmatter-name/src/pages/index.mdx +0 -6
@@ -0,0 +1 @@
1
+ <!DOCTYPE html><h1 id="im-a-test-with-a-url-override">I’m a test with a url override!</h1>
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -56,21 +56,4 @@ describe('MDX frontmatter', () => {
56
56
  expect(headingSlugs).to.contain('section-1');
57
57
  expect(headingSlugs).to.contain('section-2');
58
58
  });
59
-
60
- it('extracts frontmatter to "customFrontmatter" export when configured', async () => {
61
- const customFixture = await loadFixture({
62
- root: new URL('./fixtures/mdx-custom-frontmatter-name/', import.meta.url),
63
- integrations: [
64
- mdx({
65
- frontmatterOptions: {
66
- name: 'customFrontmatter',
67
- },
68
- }),
69
- ],
70
- });
71
- await customFixture.build();
72
-
73
- const { titles } = JSON.parse(await customFixture.readFile('/glob.json'));
74
- expect(titles).to.include('Using YAML frontmatter');
75
- });
76
59
  });
@@ -1,9 +0,0 @@
1
- export async function get() {
2
- const mdxPages = await import.meta.glob('./*.mdx', { eager: true });
3
-
4
- return {
5
- body: JSON.stringify({
6
- titles: Object.values(mdxPages ?? {}).map(v => v?.customFrontmatter?.title),
7
- })
8
- }
9
- }
@@ -1,6 +0,0 @@
1
- ---
2
- title: 'Using YAML frontmatter'
3
- illThrowIfIDontExist: "Oh no, that's scary!"
4
- ---
5
-
6
- # {customFrontmatter.illThrowIfIDontExist}