fuma-content 1.1.0 → 1.1.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 (125) hide show
  1. package/dist/{build-mdx-BZxE8t2a.js → build-mdx-CUp6FpfT.js} +2 -2
  2. package/dist/{build-mdx-BZxE8t2a.js.map → build-mdx-CUp6FpfT.js.map} +1 -1
  3. package/dist/build-mdx-D6zM3Sgl.js +4 -0
  4. package/dist/bun/index.d.ts +1 -1
  5. package/dist/bun/index.js +2 -2
  6. package/dist/{code-generator-CjC4EEXg.js → code-generator-Qhhq7kHh.js} +30 -24
  7. package/dist/code-generator-Qhhq7kHh.js.map +1 -0
  8. package/dist/collections/data/runtime.d.ts +6 -6
  9. package/dist/collections/data.d.ts +5 -5
  10. package/dist/collections/data.d.ts.map +1 -1
  11. package/dist/collections/data.js +3 -3
  12. package/dist/collections/fs.d.ts +2 -2
  13. package/dist/collections/fs.js +1 -1
  14. package/dist/collections/index.d.ts +1 -1
  15. package/dist/collections/index.js +1 -1
  16. package/dist/collections/json/loader-webpack.d.ts +3 -3
  17. package/dist/collections/json/loader-webpack.js +6 -6
  18. package/dist/collections/mdx/loader-webpack.d.ts +3 -3
  19. package/dist/collections/mdx/loader-webpack.js +6 -6
  20. package/dist/collections/mdx/react.d.ts +10 -10
  21. package/dist/collections/mdx/runtime-browser.d.ts +10 -10
  22. package/dist/collections/mdx/runtime-browser.js +1 -1
  23. package/dist/collections/mdx/runtime-dynamic.d.ts +9 -9
  24. package/dist/collections/mdx/runtime-dynamic.js +6 -6
  25. package/dist/collections/mdx/runtime.d.ts +9 -9
  26. package/dist/collections/mdx.d.ts +5 -5
  27. package/dist/collections/mdx.js +4 -4
  28. package/dist/collections/runtime/file-store.d.ts +3 -3
  29. package/dist/collections/runtime/file-store.js +1 -4
  30. package/dist/collections/runtime/file-store.js.map +1 -1
  31. package/dist/collections/runtime/store.d.ts +2 -2
  32. package/dist/collections/runtime/store.js +1 -1
  33. package/dist/collections/yaml/loader-webpack.d.ts +3 -3
  34. package/dist/collections/yaml/loader-webpack.js +6 -6
  35. package/dist/{collections-DNFRdCuB.js → collections-CNWuMDAZ.js} +7 -13
  36. package/dist/collections-CNWuMDAZ.js.map +1 -0
  37. package/dist/config/index.d.ts +2 -2
  38. package/dist/config/index.js.map +1 -1
  39. package/dist/{core-BO3b8jMg.d.ts → core-CT06v32N.d.ts} +23 -24
  40. package/dist/core-CT06v32N.d.ts.map +1 -0
  41. package/dist/{core-D5QHSKk6.js → core-Uv3jZqL-.js} +15 -20
  42. package/dist/core-Uv3jZqL-.js.map +1 -0
  43. package/dist/{data-9h98oZwj.js → data-Cxsx5KPD.js} +34 -33
  44. package/dist/data-Cxsx5KPD.js.map +1 -0
  45. package/dist/{dynamic-CTYYdl7_.d.ts → dynamic-Ck1wYoaL.d.ts} +2 -2
  46. package/dist/{dynamic-CTYYdl7_.d.ts.map → dynamic-Ck1wYoaL.d.ts.map} +1 -1
  47. package/dist/{dynamic-DhKTOrIl.js → dynamic-CtOB4Rkp.js} +2 -2
  48. package/dist/{dynamic-DhKTOrIl.js.map → dynamic-CtOB4Rkp.js.map} +1 -1
  49. package/dist/dynamic.d.ts +2 -2
  50. package/dist/dynamic.js +1 -1
  51. package/dist/{file-store-laO4IjvB.d.ts → file-store-Dm1SjuLg.d.ts} +2 -3
  52. package/dist/file-store-Dm1SjuLg.d.ts.map +1 -0
  53. package/dist/fs-CXzVd2Dp.js +68 -0
  54. package/dist/fs-CXzVd2Dp.js.map +1 -0
  55. package/dist/{fs-D34Sztbh.d.ts → fs-CmwaaFyx.d.ts} +6 -5
  56. package/dist/fs-CmwaaFyx.d.ts.map +1 -0
  57. package/dist/{git-CQWA37-X.js → git-DnejL9r_.js} +2 -2
  58. package/dist/{git-CQWA37-X.js.map → git-DnejL9r_.js.map} +1 -1
  59. package/dist/{git-2CjUW3M5.d.ts → git-n-9ddn78.d.ts} +2 -2
  60. package/dist/{git-2CjUW3M5.d.ts.map → git-n-9ddn78.d.ts.map} +1 -1
  61. package/dist/{index-Da88Sj8w.d.ts → index-BheUVWBm.d.ts} +3 -3
  62. package/dist/{index-Da88Sj8w.d.ts.map → index-BheUVWBm.d.ts.map} +1 -1
  63. package/dist/index.d.ts +2 -2
  64. package/dist/index.js +2 -2
  65. package/dist/load-from-file-D-Xm95Fz.js +3 -0
  66. package/dist/{load-from-file-irx0JI6j.js → load-from-file-z7EGuf2n.js} +2 -2
  67. package/dist/{load-from-file-irx0JI6j.js.map → load-from-file-z7EGuf2n.js.map} +1 -1
  68. package/dist/{loader-BuR4gkKg.js → loader-B4nQrRwA.js} +2 -2
  69. package/dist/{loader-BuR4gkKg.js.map → loader-B4nQrRwA.js.map} +1 -1
  70. package/dist/loader-B6ordrWK.js +9 -0
  71. package/dist/{loader-BhXHF8vy.js → loader-BK8PnqRg.js} +2 -2
  72. package/dist/{loader-BhXHF8vy.js.map → loader-BK8PnqRg.js.map} +1 -1
  73. package/dist/{loader-D6StkShK.js → loader-CnksfM7I.js} +3 -3
  74. package/dist/{loader-D6StkShK.js.map → loader-CnksfM7I.js.map} +1 -1
  75. package/dist/{loader-DwpOcxgh.js → loader-Cnz-VHne.js} +2 -2
  76. package/dist/{loader-DwpOcxgh.js.map → loader-Cnz-VHne.js.map} +1 -1
  77. package/dist/{loader-BzQpSBvP.js → loader-CuntMmR4.js} +2 -2
  78. package/dist/{loader-BzQpSBvP.js.map → loader-CuntMmR4.js.map} +1 -1
  79. package/dist/loader-Cx1Rg_VM.js +8 -0
  80. package/dist/loader-Dao_nv3e.js +8 -0
  81. package/dist/mdx-Cw1nBJ0D.js +306 -0
  82. package/dist/mdx-Cw1nBJ0D.js.map +1 -0
  83. package/dist/{mdx-Dt9hirUu.d.ts → mdx-PaqRNZMS.d.ts} +7 -16
  84. package/dist/mdx-PaqRNZMS.d.ts.map +1 -0
  85. package/dist/next/index.d.ts +1 -1
  86. package/dist/next/index.js +3 -3
  87. package/dist/node/index.d.ts +1 -1
  88. package/dist/node/loader.d.ts +1 -1
  89. package/dist/node/loader.js +3 -3
  90. package/dist/plugins/git.d.ts +2 -2
  91. package/dist/plugins/git.js +1 -1
  92. package/dist/plugins/json-schema.d.ts +1 -1
  93. package/dist/plugins/json-schema.js +2 -2
  94. package/dist/plugins/loader/index.d.ts +3 -3
  95. package/dist/plugins/loader/index.js +1 -1
  96. package/dist/plugins/loader/webpack.d.ts +3 -3
  97. package/dist/plugins/loader/webpack.js +2 -2
  98. package/dist/{runtime-HN-HSB0Z.d.ts → runtime-BUUHSFlR.d.ts} +5 -5
  99. package/dist/{runtime-HN-HSB0Z.d.ts.map → runtime-BUUHSFlR.d.ts.map} +1 -1
  100. package/dist/{runtime-browser-BQEk7qjc.d.ts → runtime-browser-B70WGxeQ.d.ts} +4 -4
  101. package/dist/{runtime-browser-BQEk7qjc.d.ts.map → runtime-browser-B70WGxeQ.d.ts.map} +1 -1
  102. package/dist/{store-IvpEBdxi.js → store-CRyvZFKN.js} +7 -10
  103. package/dist/{store-IvpEBdxi.js.map → store-CRyvZFKN.js.map} +1 -1
  104. package/dist/{store-DiuGdV5M.d.ts → store-D_PPrdRE.d.ts} +4 -4
  105. package/dist/{store-DiuGdV5M.d.ts.map → store-D_PPrdRE.d.ts.map} +1 -1
  106. package/dist/vite/index.d.ts +1 -1
  107. package/dist/vite/index.js +3 -3
  108. package/package.json +10 -10
  109. package/dist/build-mdx-LhpFasX-.js +0 -4
  110. package/dist/code-generator-CjC4EEXg.js.map +0 -1
  111. package/dist/collections-DNFRdCuB.js.map +0 -1
  112. package/dist/core-BO3b8jMg.d.ts.map +0 -1
  113. package/dist/core-D5QHSKk6.js.map +0 -1
  114. package/dist/data-9h98oZwj.js.map +0 -1
  115. package/dist/file-store-laO4IjvB.d.ts.map +0 -1
  116. package/dist/fs-D34Sztbh.d.ts.map +0 -1
  117. package/dist/fs-WWbLA7Gx.js +0 -66
  118. package/dist/fs-WWbLA7Gx.js.map +0 -1
  119. package/dist/load-from-file-BZxc_BhC.js +0 -3
  120. package/dist/loader-AIEwGc2f.js +0 -9
  121. package/dist/loader-DCK4RwOh.js +0 -8
  122. package/dist/loader-zsTVgQjO.js +0 -8
  123. package/dist/mdx-Dt9hirUu.d.ts.map +0 -1
  124. package/dist/mdx-iZ2uP27Z.js +0 -303
  125. package/dist/mdx-iZ2uP27Z.js.map +0 -1
@@ -278,7 +278,7 @@ function remarkPostprocess({ _format, includeProcessedMarkdown = false, includeM
278
278
  const markdown = toMarkdown(tree, {
279
279
  ...processor.data("settings"),
280
280
  extensions: processor.data("toMarkdownExtensions") || [],
281
- handlers: { heading: (node) => {
281
+ handlers: { heading(node) {
282
282
  const id = node.data?.hProperties?.id;
283
283
  const content = flattenNode(node);
284
284
  return headingIds && id ? `${content} [#${id}]` : content;
@@ -397,4 +397,4 @@ async function buildMDX(core, collection, { filePath, frontmatter, source, _comp
397
397
 
398
398
  //#endregion
399
399
  export { buildMDX as t };
400
- //# sourceMappingURL=build-mdx-BZxE8t2a.js.map
400
+ //# sourceMappingURL=build-mdx-CUp6FpfT.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-mdx-BZxE8t2a.js","names":["newChildren: RootContent[]","ElementLikeTypes: ElementLikeContent[\"type\"][]","attributes: Record<string, string | null>","nodes: RootContent[] | undefined","extractedLines: string[]","content: string","fs","path","queue: Promise<void>[]","_stringifyProcessor: Processor | undefined","urls: ExtractedReference[]","postprocessOptions: PostprocessOptions","remarkIncludeOptions: RemarkIncludeOptions"],"sources":["../src/collections/mdx/remark-unravel.ts","../src/collections/mdx/mdast-utils.ts","../src/collections/mdx/remark-include.ts","../src/collections/mdx/remark-postprocess.ts","../src/collections/mdx/remark-preprocess.ts","../src/collections/mdx/build-mdx.ts"],"sourcesContent":["// from internal remark plugins in https://github.com/mdx-js/mdx/blob/main/packages/mdx/lib/plugin/remark-mark-and-unravel.js\n// we need to ensure consistency with MDX.js when parsing embed content in `remark-include`\nimport { visit } from \"unist-util-visit\";\nimport type { Transformer } from \"unified\";\nimport type { Root, RootContent } from \"mdast\";\n\nexport function remarkMarkAndUnravel(): Transformer<Root, Root> {\n return (tree) => {\n visit(tree, (node, index, parent) => {\n let offset = -1;\n let all = true;\n let oneOrMore = false;\n\n if (parent && typeof index === \"number\" && node.type === \"paragraph\") {\n const children = node.children;\n\n while (++offset < children.length) {\n const child = children[offset];\n\n if (child.type === \"mdxJsxTextElement\" || child.type === \"mdxTextExpression\") {\n oneOrMore = true;\n } else if (child.type === \"text\" && child.value.trim().length === 0) {\n // Empty.\n } else {\n all = false;\n break;\n }\n }\n\n if (all && oneOrMore) {\n offset = -1;\n const newChildren: RootContent[] = [];\n\n while (++offset < children.length) {\n const child = children[offset];\n\n if (child.type === \"mdxJsxTextElement\") {\n // @ts-expect-error: mutate because it is faster; content model is fine.\n child.type = \"mdxJsxFlowElement\";\n }\n\n if (child.type === \"mdxTextExpression\") {\n // @ts-expect-error: mutate because it is faster; content model is fine.\n child.type = \"mdxFlowExpression\";\n }\n\n if (child.type === \"text\" && /^[\\t\\r\\n ]+$/.test(String(child.value))) {\n // Empty.\n } else {\n newChildren.push(child);\n }\n }\n\n parent.children.splice(index, 1, ...newChildren);\n return index;\n }\n }\n });\n };\n}\n","import type { RootContent } from \"mdast\";\n\nexport function flattenNode(node: RootContent): string {\n if (\"children\" in node) return node.children.map((child) => flattenNode(child)).join(\"\");\n\n if (\"value\" in node) return node.value;\n\n return \"\";\n}\n","import { type PluggableList, type Processor, type Transformer, unified } from \"unified\";\nimport { visit } from \"unist-util-visit\";\nimport type { Code, Node, Root, RootContent } from \"mdast\";\nimport * as path from \"node:path\";\nimport * as fs from \"node:fs/promises\";\nimport { fumaMatter } from \"@/collections/mdx/fuma-matter\";\nimport type { MdxJsxFlowElement, MdxJsxTextElement } from \"mdast-util-mdx-jsx\";\nimport { VFile } from \"vfile\";\nimport type { Directives } from \"mdast-util-directive\";\nimport { remarkMarkAndUnravel } from \"@/collections/mdx/remark-unravel\";\nimport { flattenNode } from \"./mdast-utils\";\n\nexport interface Params {\n lang?: string;\n meta?: string;\n}\n\nconst ElementLikeTypes: ElementLikeContent[\"type\"][] = [\n \"mdxJsxFlowElement\",\n \"mdxJsxTextElement\",\n \"containerDirective\",\n \"textDirective\",\n \"leafDirective\",\n];\ntype ElementLikeContent = MdxJsxFlowElement | MdxJsxTextElement | Directives;\n\nfunction isElementLike(node: Node): node is ElementLikeContent {\n return ElementLikeTypes.includes(node.type as ElementLikeContent[\"type\"]);\n}\n\nfunction parseElementAttributes(\n element: ElementLikeContent,\n): Record<string, string | null | undefined> {\n if (Array.isArray(element.attributes)) {\n const attributes: Record<string, string | null> = {};\n\n for (const attr of element.attributes) {\n if (\n attr.type === \"mdxJsxAttribute\" &&\n (typeof attr.value === \"string\" || attr.value === null)\n ) {\n attributes[attr.name] = attr.value;\n }\n }\n\n return attributes;\n }\n\n return element.attributes ?? {};\n}\n\nfunction parseSpecifier(specifier: string): {\n file: string;\n section?: string;\n} {\n const idx = specifier.lastIndexOf(\"#\");\n if (idx === -1) return { file: specifier };\n\n return {\n file: specifier.slice(0, idx),\n section: specifier.slice(idx + 1),\n };\n}\n\nfunction extractSection(root: Root, section: string): Root | undefined {\n let nodes: RootContent[] | undefined;\n let capturingHeadingContent = false;\n\n visit(root, (node) => {\n if (node.type === \"heading\") {\n if (capturingHeadingContent) {\n return false;\n }\n\n if (node.data?.hProperties?.id === section) {\n capturingHeadingContent = true;\n nodes = [node];\n return \"skip\";\n }\n\n return;\n }\n\n if (capturingHeadingContent) {\n nodes?.push(node as RootContent);\n return \"skip\";\n }\n\n if (isElementLike(node) && node.name === \"section\") {\n const attributes = parseElementAttributes(node);\n\n if (attributes.id === section) {\n nodes = node.children;\n return false;\n }\n }\n });\n\n if (nodes)\n return {\n type: \"root\",\n children: nodes,\n };\n}\n\n// region marker regexes\nconst REGION_MARKERS = [\n {\n start: /^\\s*\\/\\/\\s*#?region\\b\\s*(.*?)\\s*$/,\n end: /^\\s*\\/\\/\\s*#?endregion\\b\\s*(.*?)\\s*$/,\n },\n {\n start: /^\\s*<!--\\s*#?region\\b\\s*(.*?)\\s*-->/,\n end: /^\\s*<!--\\s*#?endregion\\b\\s*(.*?)\\s*-->/,\n },\n {\n start: /^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\//,\n end: /^\\s*\\/\\*\\s*#endregion\\b\\s*(.*?)\\s*\\*\\//,\n },\n {\n start: /^\\s*#[rR]egion\\b\\s*(.*?)\\s*$/,\n end: /^\\s*#[eE]nd ?[rR]egion\\b\\s*(.*?)\\s*$/,\n },\n {\n start: /^\\s*#\\s*#?region\\b\\s*(.*?)\\s*$/,\n end: /^\\s*#\\s*#?endregion\\b\\s*(.*?)\\s*$/,\n },\n {\n start: /^\\s*(?:--|::|@?REM)\\s*#region\\b\\s*(.*?)\\s*$/,\n end: /^\\s*(?:--|::|@?REM)\\s*#endregion\\b\\s*(.*?)\\s*$/,\n },\n {\n start: /^\\s*#pragma\\s+region\\b\\s*(.*?)\\s*$/,\n end: /^\\s*#pragma\\s+endregion\\b\\s*(.*?)\\s*$/,\n },\n {\n start: /^\\s*\\(\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\)/,\n end: /^\\s*\\(\\*\\s*#endregion\\b\\s*(.*?)\\s*\\*\\)/,\n },\n];\n\nfunction dedent(lines: string[]): string {\n const minIndent = lines.reduce((min, line) => {\n const match = line.match(/^(\\s*)\\S/);\n return match ? Math.min(min, match[1].length) : min;\n }, Infinity);\n\n return minIndent === Infinity\n ? lines.join(\"\\n\")\n : lines.map((l) => l.slice(minIndent)).join(\"\\n\");\n}\n\nfunction extractCodeRegion(content: string, regionName: string): string {\n const lines = content.split(\"\\n\");\n\n for (let i = 0; i < lines.length; i++) {\n for (const re of REGION_MARKERS) {\n let match = re.start.exec(lines[i]);\n if (match?.[1] !== regionName) continue;\n\n let depth = 1;\n const extractedLines: string[] = [];\n for (let j = i + 1; j < lines.length; j++) {\n match = re.start.exec(lines[j]);\n if (match) {\n depth++;\n continue;\n }\n\n match = re.end.exec(lines[j]);\n if (match) {\n if (match[1] === regionName) depth = 0;\n else if (match[1] === \"\") depth--;\n else continue;\n\n if (depth > 0) continue;\n return dedent(extractedLines);\n } else {\n extractedLines.push(lines[j]);\n }\n }\n }\n }\n throw new Error(`Region \"${regionName}\" not found`);\n}\n\nexport interface RemarkIncludeOptions {\n /**\n * remark plugins to preprocess the MDAST tree before scanning headings/sections.\n *\n * e.g. parse headings before extraction.\n */\n preprocess?: PluggableList;\n}\n\nexport function remarkInclude(\n this: Processor,\n { preprocess = [] }: RemarkIncludeOptions = {},\n): Transformer<Root, Root> {\n const TagName = \"include\";\n const preprocessor = unified().use(remarkMarkAndUnravel).use(preprocess);\n\n const embedContent = async (\n targetPath: string,\n heading: string | undefined,\n params: Params,\n parent: VFile,\n ) => {\n const { _getProcessor = () => this, _compiler } = parent.data;\n let content: string;\n try {\n content = (await fs.readFile(targetPath)).toString();\n } catch (e) {\n throw new Error(\n `failed to read file ${targetPath}\\n${e instanceof Error ? e.message : String(e)}`,\n { cause: e },\n );\n }\n\n const ext = path.extname(targetPath);\n _compiler?.addDependency(targetPath);\n if (params.lang || (ext !== \".md\" && ext !== \".mdx\")) {\n const lang = params.lang ?? ext.slice(1);\n\n return {\n type: \"code\",\n lang,\n meta: params.meta,\n value: heading ? extractCodeRegion(content, heading) : content,\n data: {},\n } satisfies Code;\n }\n\n const parser = await _getProcessor(ext === \".mdx\" ? \"mdx\" : \"md\");\n const parsed = fumaMatter(content);\n const targetFile = new VFile({\n path: targetPath,\n value: parsed.content,\n data: {\n ...parent.data,\n frontmatter: parsed.data as Record<string, unknown>,\n },\n });\n\n let mdast = await preprocessor.run(parser.parse(targetFile) as Root, targetFile);\n\n if (heading) {\n const extracted = extractSection(mdast, heading);\n if (!extracted)\n throw new Error(\n `Cannot find section ${heading} in ${targetPath}, make sure you have encapsulated the section in a <section id=\"${heading}\"> tag, or a :::section directive with remark-directive configured.`,\n );\n\n mdast = extracted;\n }\n\n await update(mdast, targetFile);\n return mdast;\n };\n\n async function update(tree: Root, file: VFile) {\n const queue: Promise<void>[] = [];\n\n visit(tree, ElementLikeTypes, (_node, _, parent) => {\n const node = _node as ElementLikeContent;\n if (node.name !== TagName) return;\n\n const specifier = flattenNode(node);\n if (specifier.length === 0) return \"skip\";\n\n const attributes = parseElementAttributes(node);\n const { file: relativePath, section } = parseSpecifier(specifier);\n const targetPath = path.resolve(\n \"cwd\" in attributes ? file.cwd : (file.dirname ?? \"\"),\n relativePath,\n );\n\n queue.push(\n embedContent(targetPath, section, attributes, file).then((replace) => {\n Object.assign(parent && parent.type === \"paragraph\" ? parent : node, replace);\n }),\n );\n\n return \"skip\";\n });\n\n await Promise.all(queue);\n }\n\n return async (tree, file) => {\n await update(tree, file);\n };\n}\n","import type { Processor, Transformer } from \"unified\";\nimport type { Heading, Root, RootContent } from \"mdast\";\nimport { visit } from \"unist-util-visit\";\nimport { toMarkdown } from \"mdast-util-to-markdown\";\nimport { valueToEstree } from \"estree-util-value-to-estree\";\nimport { removePosition } from \"unist-util-remove-position\";\nimport remarkMdx from \"remark-mdx\";\nimport { flattenNode } from \"./mdast-utils\";\n\nexport interface ExtractedReference {\n href: string;\n}\n\nexport interface PostprocessOptions {\n _format: \"md\" | \"mdx\";\n\n /**\n * Properties to export from `vfile.data`\n */\n valueToExport?: string[];\n\n /**\n * stringify MDAST and export via `_markdown`.\n */\n includeProcessedMarkdown?:\n | boolean\n | {\n /**\n * include heading IDs into the processed markdown.\n */\n headingIds?: boolean;\n };\n\n /**\n * extract link references, export via `extractedReferences`.\n */\n extractLinkReferences?: boolean;\n\n /**\n * store MDAST and export via `_mdast`.\n */\n includeMDAST?:\n | boolean\n | {\n removePosition?: boolean;\n };\n}\n\n/**\n * - collect references\n * - write frontmatter (auto-title & description)\n */\nexport function remarkPostprocess(\n this: Processor,\n {\n _format,\n includeProcessedMarkdown = false,\n includeMDAST = false,\n extractLinkReferences = false,\n valueToExport = [],\n }: PostprocessOptions,\n): Transformer<Root, Root> {\n let _stringifyProcessor: Processor | undefined;\n const getStringifyProcessor = () => {\n return (_stringifyProcessor ??=\n _format === \"mdx\"\n ? this\n : // force Markdown processor to stringify MDX nodes\n this().use(remarkMdx).freeze());\n };\n\n return (tree, file) => {\n const frontmatter = (file.data.frontmatter ??= {});\n if (!frontmatter.title) {\n visit(tree, \"heading\", (node) => {\n if (node.depth === 1) {\n frontmatter.title = flattenNode(node);\n return false;\n }\n });\n }\n\n file.data[\"mdx-export\"] ??= [];\n file.data[\"mdx-export\"].push({\n name: \"frontmatter\",\n value: frontmatter,\n });\n\n if (extractLinkReferences) {\n const urls: ExtractedReference[] = [];\n\n visit(tree, \"link\", (node) => {\n urls.push({\n href: node.url,\n });\n return \"skip\";\n });\n\n file.data[\"mdx-export\"].push({\n name: \"extractedReferences\",\n value: urls,\n });\n }\n\n if (includeProcessedMarkdown) {\n const { headingIds = true } =\n typeof includeProcessedMarkdown === \"object\" ? includeProcessedMarkdown : {};\n const processor = getStringifyProcessor();\n const markdown = toMarkdown(tree, {\n ...processor.data(\"settings\"),\n // from https://github.com/remarkjs/remark/blob/main/packages/remark-stringify/lib/index.js\n extensions: processor.data(\"toMarkdownExtensions\") || [],\n handlers: {\n heading: (node: Heading) => {\n const id = node.data?.hProperties?.id;\n const content = flattenNode(node);\n return headingIds && id ? `${content} [#${id}]` : content;\n },\n },\n });\n\n file.data[\"mdx-export\"].push({\n name: \"_markdown\",\n value: markdown,\n });\n }\n\n if (includeMDAST) {\n const options = includeMDAST === true ? {} : includeMDAST;\n const mdast = JSON.stringify(\n options.removePosition ? removePosition(structuredClone(tree)) : tree,\n );\n\n file.data[\"mdx-export\"].push({\n name: \"_mdast\",\n value: mdast,\n });\n }\n\n for (const { name, value } of file.data[\"mdx-export\"]) {\n tree.children.unshift(getMdastExport(name, value));\n }\n\n // reset the data to reduce memory usage\n file.data[\"mdx-export\"] = [];\n\n for (const name of valueToExport) {\n if (!(name in file.data)) continue;\n\n tree.children.unshift(getMdastExport(name, file.data[name]));\n }\n };\n}\n\n/**\n * MDX.js first converts javascript (with esm support) into mdast nodes with remark-mdx, then handle the other remark plugins\n *\n * Therefore, if we want to inject an export, we must convert the object into AST, then add the mdast node\n */\nfunction getMdastExport(name: string, value: unknown): RootContent {\n return {\n type: \"mdxjsEsm\",\n value: \"\",\n data: {\n estree: {\n type: \"Program\",\n sourceType: \"module\",\n body: [\n {\n type: \"ExportNamedDeclaration\",\n specifiers: [],\n attributes: [],\n source: null,\n declaration: {\n type: \"VariableDeclaration\",\n kind: \"let\",\n declarations: [\n {\n type: \"VariableDeclarator\",\n id: {\n type: \"Identifier\",\n name,\n },\n init: valueToEstree(value),\n },\n ],\n },\n },\n ],\n },\n },\n };\n}\n","import type { Processor, Transformer } from \"unified\";\nimport type { Root } from \"mdast\";\n\nexport interface PreprocessOptions {\n preprocessor?: Processor<Root>;\n}\n\ndeclare module \"vfile\" {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- extend data map\n interface DataMap {\n _preprocessed?: boolean;\n }\n}\n\nexport function remarkPreprocess(options?: PreprocessOptions): Transformer<Root, Root> {\n return async (tree, file) => {\n if (file.data._preprocessed) return;\n file.data._preprocessed = true;\n\n if (options?.preprocessor) {\n return (await options.preprocessor.run(tree)) as Root;\n }\n };\n}\n","import { createProcessor } from \"@mdx-js/mdx\";\nimport { VFile } from \"vfile\";\nimport { remarkInclude, type RemarkIncludeOptions } from \"@/collections/mdx/remark-include\";\nimport { type PostprocessOptions, remarkPostprocess } from \"@/collections/mdx/remark-postprocess\";\nimport type { Core } from \"@/core\";\nimport { remarkPreprocess } from \"@/collections/mdx/remark-preprocess\";\nimport type { Pluggable } from \"unified\";\nimport { createCache } from \"@/utils/async-cache\";\nimport type { CompilerOptions } from \"@/plugins/loader\";\nimport type { MDXContent } from \"mdx/types\";\nimport { MDXCollection } from \"../mdx\";\n\ntype MDXProcessor = ReturnType<typeof createProcessor>;\n\ninterface BuildMDXOptions {\n /**\n * Specify a file path for source\n */\n filePath: string;\n source: string;\n frontmatter?: Record<string, unknown>;\n\n environment: \"bundler\" | \"runtime\";\n isDevelopment: boolean;\n _compiler?: CompilerOptions;\n}\n\nexport interface FumaContentDataMap {\n /**\n * [Fuma Content] raw frontmatter, you can modify it\n */\n frontmatter?: Record<string, unknown>;\n\n /**\n * [Fuma Content] additional ESM exports to write\n */\n \"mdx-export\"?: { name: string; value: unknown }[];\n\n /**\n * [Fuma Content] The compiler object from loader\n */\n _compiler?: CompilerOptions;\n\n /**\n * [Fuma Content] get internal processor, do not use this on user land.\n */\n _getProcessor?: (format: \"md\" | \"mdx\") => MDXProcessor | Promise<MDXProcessor>;\n}\n\ndeclare module \"vfile\" {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- extend data map\n interface DataMap extends FumaContentDataMap {}\n}\n\nexport interface CompiledMDX<Frontmatter = Record<string, unknown>> extends Record<\n string,\n unknown\n> {\n frontmatter: Frontmatter;\n default: MDXContent;\n\n /**\n * Enable from `postprocess` option.\n */\n _markdown?: string;\n /**\n * Enable from `postprocess` option.\n */\n _mdast?: string;\n}\n\nexport async function buildMDX(\n core: Core,\n collection: MDXCollection | undefined,\n { filePath, frontmatter, source, _compiler, environment, isDevelopment }: BuildMDXOptions,\n): Promise<VFile> {\n const processorCache = createCache(core.cache).$value<MDXProcessor>();\n\n function getProcessor(format: \"md\" | \"mdx\") {\n const key = `build-mdx:${collection?.name ?? \"global\"}:${format}`;\n\n return processorCache.cached(key, async () => {\n const mdxOptions = await collection?.getMDXOptions?.(environment);\n const preprocessPlugin = [remarkPreprocess, collection?.preprocess] satisfies Pluggable;\n const postprocessOptions: PostprocessOptions = {\n _format: format,\n ...collection?.postprocess,\n };\n const remarkIncludeOptions: RemarkIncludeOptions = {\n preprocess: [preprocessPlugin],\n };\n\n return createProcessor({\n outputFormat: \"program\",\n development: isDevelopment,\n ...mdxOptions,\n remarkPlugins: [\n preprocessPlugin,\n [remarkInclude, remarkIncludeOptions],\n ...(mdxOptions?.remarkPlugins ?? []),\n [remarkPostprocess, postprocessOptions],\n ],\n format,\n });\n });\n }\n\n let vfile = new VFile({\n value: source,\n path: filePath,\n cwd: core.getOptions().cwd,\n data: {\n frontmatter,\n _compiler,\n _getProcessor: getProcessor,\n },\n });\n\n if (collection && collection) {\n vfile = await collection.vfile.run(vfile, {\n collection,\n filePath,\n source,\n });\n }\n\n return (await getProcessor(filePath.endsWith(\".mdx\") ? \"mdx\" : \"md\")).process(vfile);\n}\n"],"mappings":";;;;;;;;;;;;;;AAMA,SAAgB,uBAAgD;AAC9D,SAAQ,SAAS;AACf,QAAM,OAAO,MAAM,OAAO,WAAW;GACnC,IAAI,SAAS;GACb,IAAI,MAAM;GACV,IAAI,YAAY;AAEhB,OAAI,UAAU,OAAO,UAAU,YAAY,KAAK,SAAS,aAAa;IACpE,MAAM,WAAW,KAAK;AAEtB,WAAO,EAAE,SAAS,SAAS,QAAQ;KACjC,MAAM,QAAQ,SAAS;AAEvB,SAAI,MAAM,SAAS,uBAAuB,MAAM,SAAS,oBACvD,aAAY;cACH,MAAM,SAAS,UAAU,MAAM,MAAM,MAAM,CAAC,WAAW,GAAG,QAE9D;AACL,YAAM;AACN;;;AAIJ,QAAI,OAAO,WAAW;AACpB,cAAS;KACT,MAAMA,cAA6B,EAAE;AAErC,YAAO,EAAE,SAAS,SAAS,QAAQ;MACjC,MAAM,QAAQ,SAAS;AAEvB,UAAI,MAAM,SAAS,oBAEjB,OAAM,OAAO;AAGf,UAAI,MAAM,SAAS,oBAEjB,OAAM,OAAO;AAGf,UAAI,MAAM,SAAS,UAAU,eAAe,KAAK,OAAO,MAAM,MAAM,CAAC,EAAE,OAGrE,aAAY,KAAK,MAAM;;AAI3B,YAAO,SAAS,OAAO,OAAO,GAAG,GAAG,YAAY;AAChD,YAAO;;;IAGX;;;;;;ACvDN,SAAgB,YAAY,MAA2B;AACrD,KAAI,cAAc,KAAM,QAAO,KAAK,SAAS,KAAK,UAAU,YAAY,MAAM,CAAC,CAAC,KAAK,GAAG;AAEx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LikeContent[\"type\"][]","attributes: Record<string, string | null>","nodes: RootContent[] | undefined","extractedLines: string[]","content: string","fs","path","queue: Promise<void>[]","_stringifyProcessor: Processor | undefined","urls: ExtractedReference[]","postprocessOptions: PostprocessOptions","remarkIncludeOptions: RemarkIncludeOptions"],"sources":["../src/collections/mdx/remark-unravel.ts","../src/collections/mdx/mdast-utils.ts","../src/collections/mdx/remark-include.ts","../src/collections/mdx/remark-postprocess.ts","../src/collections/mdx/remark-preprocess.ts","../src/collections/mdx/build-mdx.ts"],"sourcesContent":["// from internal remark plugins in https://github.com/mdx-js/mdx/blob/main/packages/mdx/lib/plugin/remark-mark-and-unravel.js\n// we need to ensure consistency with MDX.js when parsing embed content in `remark-include`\nimport { visit } from \"unist-util-visit\";\nimport type { Transformer } from \"unified\";\nimport type { Root, RootContent } from \"mdast\";\n\nexport function remarkMarkAndUnravel(): Transformer<Root, Root> {\n return (tree) => {\n visit(tree, (node, index, parent) => {\n let offset = -1;\n let all = true;\n let oneOrMore = false;\n\n if (parent && typeof index === \"number\" && node.type === \"paragraph\") {\n const children = node.children;\n\n while (++offset < children.length) {\n const child = children[offset];\n\n if (child.type === \"mdxJsxTextElement\" || child.type === \"mdxTextExpression\") {\n oneOrMore = true;\n } else if (child.type === \"text\" && child.value.trim().length === 0) {\n // Empty.\n } else {\n all = false;\n break;\n }\n }\n\n if (all && oneOrMore) {\n offset = -1;\n const newChildren: RootContent[] = [];\n\n while (++offset < children.length) {\n const child = children[offset];\n\n if (child.type === \"mdxJsxTextElement\") {\n // @ts-expect-error: mutate because it is faster; content model is fine.\n child.type = \"mdxJsxFlowElement\";\n }\n\n if (child.type === \"mdxTextExpression\") {\n // @ts-expect-error: mutate because it is faster; content model is fine.\n child.type = \"mdxFlowExpression\";\n }\n\n if (child.type === \"text\" && /^[\\t\\r\\n ]+$/.test(String(child.value))) {\n // Empty.\n } else {\n newChildren.push(child);\n }\n }\n\n parent.children.splice(index, 1, ...newChildren);\n return index;\n }\n }\n });\n };\n}\n","import type { RootContent } from \"mdast\";\n\nexport function flattenNode(node: RootContent): string {\n if (\"children\" in node) return node.children.map((child) => flattenNode(child)).join(\"\");\n\n if (\"value\" in node) return node.value;\n\n return \"\";\n}\n","import { type PluggableList, type Processor, type Transformer, unified } from \"unified\";\nimport { visit } from \"unist-util-visit\";\nimport type { Code, Node, Root, RootContent } from \"mdast\";\nimport * as path from \"node:path\";\nimport * as fs from \"node:fs/promises\";\nimport { fumaMatter } from \"@/collections/mdx/fuma-matter\";\nimport type { MdxJsxFlowElement, MdxJsxTextElement } from \"mdast-util-mdx-jsx\";\nimport { VFile } from \"vfile\";\nimport type { Directives } from \"mdast-util-directive\";\nimport { remarkMarkAndUnravel } from \"@/collections/mdx/remark-unravel\";\nimport { flattenNode } from \"./mdast-utils\";\n\nexport interface Params {\n lang?: string;\n meta?: string;\n}\n\nconst ElementLikeTypes: ElementLikeContent[\"type\"][] = [\n \"mdxJsxFlowElement\",\n \"mdxJsxTextElement\",\n \"containerDirective\",\n \"textDirective\",\n \"leafDirective\",\n];\ntype ElementLikeContent = MdxJsxFlowElement | MdxJsxTextElement | Directives;\n\nfunction isElementLike(node: Node): node is ElementLikeContent {\n return ElementLikeTypes.includes(node.type as ElementLikeContent[\"type\"]);\n}\n\nfunction parseElementAttributes(\n element: ElementLikeContent,\n): Record<string, string | null | undefined> {\n if (Array.isArray(element.attributes)) {\n const attributes: Record<string, string | null> = {};\n\n for (const attr of element.attributes) {\n if (\n attr.type === \"mdxJsxAttribute\" &&\n (typeof attr.value === \"string\" || attr.value === null)\n ) {\n attributes[attr.name] = attr.value;\n }\n }\n\n return attributes;\n }\n\n return element.attributes ?? {};\n}\n\nfunction parseSpecifier(specifier: string): {\n file: string;\n section?: string;\n} {\n const idx = specifier.lastIndexOf(\"#\");\n if (idx === -1) return { file: specifier };\n\n return {\n file: specifier.slice(0, idx),\n section: specifier.slice(idx + 1),\n };\n}\n\nfunction extractSection(root: Root, section: string): Root | undefined {\n let nodes: RootContent[] | undefined;\n let capturingHeadingContent = false;\n\n visit(root, (node) => {\n if (node.type === \"heading\") {\n if (capturingHeadingContent) {\n return false;\n }\n\n if (node.data?.hProperties?.id === section) {\n capturingHeadingContent = true;\n nodes = [node];\n return \"skip\";\n }\n\n return;\n }\n\n if (capturingHeadingContent) {\n nodes?.push(node as RootContent);\n return \"skip\";\n }\n\n if (isElementLike(node) && node.name === \"section\") {\n const attributes = parseElementAttributes(node);\n\n if (attributes.id === section) {\n nodes = node.children;\n return false;\n }\n }\n });\n\n if (nodes)\n return {\n type: \"root\",\n children: nodes,\n };\n}\n\n// region marker regexes\nconst REGION_MARKERS = [\n {\n start: /^\\s*\\/\\/\\s*#?region\\b\\s*(.*?)\\s*$/,\n end: /^\\s*\\/\\/\\s*#?endregion\\b\\s*(.*?)\\s*$/,\n },\n {\n start: /^\\s*<!--\\s*#?region\\b\\s*(.*?)\\s*-->/,\n end: /^\\s*<!--\\s*#?endregion\\b\\s*(.*?)\\s*-->/,\n },\n {\n start: /^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\//,\n end: /^\\s*\\/\\*\\s*#endregion\\b\\s*(.*?)\\s*\\*\\//,\n },\n {\n start: /^\\s*#[rR]egion\\b\\s*(.*?)\\s*$/,\n end: /^\\s*#[eE]nd ?[rR]egion\\b\\s*(.*?)\\s*$/,\n },\n {\n start: /^\\s*#\\s*#?region\\b\\s*(.*?)\\s*$/,\n end: /^\\s*#\\s*#?endregion\\b\\s*(.*?)\\s*$/,\n },\n {\n start: /^\\s*(?:--|::|@?REM)\\s*#region\\b\\s*(.*?)\\s*$/,\n end: /^\\s*(?:--|::|@?REM)\\s*#endregion\\b\\s*(.*?)\\s*$/,\n },\n {\n start: /^\\s*#pragma\\s+region\\b\\s*(.*?)\\s*$/,\n end: /^\\s*#pragma\\s+endregion\\b\\s*(.*?)\\s*$/,\n },\n {\n start: /^\\s*\\(\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\)/,\n end: /^\\s*\\(\\*\\s*#endregion\\b\\s*(.*?)\\s*\\*\\)/,\n },\n];\n\nfunction dedent(lines: string[]): string {\n const minIndent = lines.reduce((min, line) => {\n const match = line.match(/^(\\s*)\\S/);\n return match ? Math.min(min, match[1].length) : min;\n }, Infinity);\n\n return minIndent === Infinity\n ? lines.join(\"\\n\")\n : lines.map((l) => l.slice(minIndent)).join(\"\\n\");\n}\n\nfunction extractCodeRegion(content: string, regionName: string): string {\n const lines = content.split(\"\\n\");\n\n for (let i = 0; i < lines.length; i++) {\n for (const re of REGION_MARKERS) {\n let match = re.start.exec(lines[i]);\n if (match?.[1] !== regionName) continue;\n\n let depth = 1;\n const extractedLines: string[] = [];\n for (let j = i + 1; j < lines.length; j++) {\n match = re.start.exec(lines[j]);\n if (match) {\n depth++;\n continue;\n }\n\n match = re.end.exec(lines[j]);\n if (match) {\n if (match[1] === regionName) depth = 0;\n else if (match[1] === \"\") depth--;\n else continue;\n\n if (depth > 0) continue;\n return dedent(extractedLines);\n } else {\n extractedLines.push(lines[j]);\n }\n }\n }\n }\n throw new Error(`Region \"${regionName}\" not found`);\n}\n\nexport interface RemarkIncludeOptions {\n /**\n * remark plugins to preprocess the MDAST tree before scanning headings/sections.\n *\n * e.g. parse headings before extraction.\n */\n preprocess?: PluggableList;\n}\n\nexport function remarkInclude(\n this: Processor,\n { preprocess = [] }: RemarkIncludeOptions = {},\n): Transformer<Root, Root> {\n const TagName = \"include\";\n const preprocessor = unified().use(remarkMarkAndUnravel).use(preprocess);\n\n const embedContent = async (\n targetPath: string,\n heading: string | undefined,\n params: Params,\n parent: VFile,\n ) => {\n const { _getProcessor = () => this, _compiler } = parent.data;\n let content: string;\n try {\n content = (await fs.readFile(targetPath)).toString();\n } catch (e) {\n throw new Error(\n `failed to read file ${targetPath}\\n${e instanceof Error ? e.message : String(e)}`,\n { cause: e },\n );\n }\n\n const ext = path.extname(targetPath);\n _compiler?.addDependency(targetPath);\n if (params.lang || (ext !== \".md\" && ext !== \".mdx\")) {\n const lang = params.lang ?? ext.slice(1);\n\n return {\n type: \"code\",\n lang,\n meta: params.meta,\n value: heading ? extractCodeRegion(content, heading) : content,\n data: {},\n } satisfies Code;\n }\n\n const parser = await _getProcessor(ext === \".mdx\" ? \"mdx\" : \"md\");\n const parsed = fumaMatter(content);\n const targetFile = new VFile({\n path: targetPath,\n value: parsed.content,\n data: {\n ...parent.data,\n frontmatter: parsed.data as Record<string, unknown>,\n },\n });\n\n let mdast = await preprocessor.run(parser.parse(targetFile) as Root, targetFile);\n\n if (heading) {\n const extracted = extractSection(mdast, heading);\n if (!extracted)\n throw new Error(\n `Cannot find section ${heading} in ${targetPath}, make sure you have encapsulated the section in a <section id=\"${heading}\"> tag, or a :::section directive with remark-directive configured.`,\n );\n\n mdast = extracted;\n }\n\n await update(mdast, targetFile);\n return mdast;\n };\n\n async function update(tree: Root, file: VFile) {\n const queue: Promise<void>[] = [];\n\n visit(tree, ElementLikeTypes, (_node, _, parent) => {\n const node = _node as ElementLikeContent;\n if (node.name !== TagName) return;\n\n const specifier = flattenNode(node);\n if (specifier.length === 0) return \"skip\";\n\n const attributes = parseElementAttributes(node);\n const { file: relativePath, section } = parseSpecifier(specifier);\n const targetPath = path.resolve(\n \"cwd\" in attributes ? file.cwd : (file.dirname ?? \"\"),\n relativePath,\n );\n\n queue.push(\n embedContent(targetPath, section, attributes, file).then((replace) => {\n Object.assign(parent && parent.type === \"paragraph\" ? parent : node, replace);\n }),\n );\n\n return \"skip\";\n });\n\n await Promise.all(queue);\n }\n\n return async (tree, file) => {\n await update(tree, file);\n };\n}\n","import type { Processor, Transformer } from \"unified\";\nimport type { Heading, Root, RootContent } from \"mdast\";\nimport { visit } from \"unist-util-visit\";\nimport { toMarkdown } from \"mdast-util-to-markdown\";\nimport { valueToEstree } from \"estree-util-value-to-estree\";\nimport { removePosition } from \"unist-util-remove-position\";\nimport remarkMdx from \"remark-mdx\";\nimport { flattenNode } from \"./mdast-utils\";\n\nexport interface ExtractedReference {\n href: string;\n}\n\nexport interface PostprocessOptions {\n _format: \"md\" | \"mdx\";\n\n /**\n * Properties to export from `vfile.data`\n */\n valueToExport?: string[];\n\n /**\n * stringify MDAST and export via `_markdown`.\n */\n includeProcessedMarkdown?:\n | boolean\n | {\n /**\n * include heading IDs into the processed markdown.\n */\n headingIds?: boolean;\n };\n\n /**\n * extract link references, export via `extractedReferences`.\n */\n extractLinkReferences?: boolean;\n\n /**\n * store MDAST and export via `_mdast`.\n */\n includeMDAST?:\n | boolean\n | {\n removePosition?: boolean;\n };\n}\n\n/**\n * - collect references\n * - write frontmatter (auto-title & description)\n */\nexport function remarkPostprocess(\n this: Processor,\n {\n _format,\n includeProcessedMarkdown = false,\n includeMDAST = false,\n extractLinkReferences = false,\n valueToExport = [],\n }: PostprocessOptions,\n): Transformer<Root, Root> {\n let _stringifyProcessor: Processor | undefined;\n const getStringifyProcessor = () => {\n return (_stringifyProcessor ??=\n _format === \"mdx\"\n ? this\n : // force Markdown processor to stringify MDX nodes\n this().use(remarkMdx).freeze());\n };\n\n return (tree, file) => {\n const frontmatter = (file.data.frontmatter ??= {});\n if (!frontmatter.title) {\n visit(tree, \"heading\", (node) => {\n if (node.depth === 1) {\n frontmatter.title = flattenNode(node);\n return false;\n }\n });\n }\n\n file.data[\"mdx-export\"] ??= [];\n file.data[\"mdx-export\"].push({\n name: \"frontmatter\",\n value: frontmatter,\n });\n\n if (extractLinkReferences) {\n const urls: ExtractedReference[] = [];\n\n visit(tree, \"link\", (node) => {\n urls.push({\n href: node.url,\n });\n return \"skip\";\n });\n\n file.data[\"mdx-export\"].push({\n name: \"extractedReferences\",\n value: urls,\n });\n }\n\n if (includeProcessedMarkdown) {\n const { headingIds = true } =\n typeof includeProcessedMarkdown === \"object\" ? includeProcessedMarkdown : {};\n const processor = getStringifyProcessor();\n const markdown = toMarkdown(tree, {\n ...processor.data(\"settings\"),\n // from https://github.com/remarkjs/remark/blob/main/packages/remark-stringify/lib/index.js\n extensions: processor.data(\"toMarkdownExtensions\") || [],\n handlers: {\n heading(node: Heading) {\n const id = node.data?.hProperties?.id;\n const content = flattenNode(node);\n return headingIds && id ? `${content} [#${id}]` : content;\n },\n },\n });\n\n file.data[\"mdx-export\"].push({\n name: \"_markdown\",\n value: markdown,\n });\n }\n\n if (includeMDAST) {\n const options = includeMDAST === true ? {} : includeMDAST;\n const mdast = JSON.stringify(\n options.removePosition ? removePosition(structuredClone(tree)) : tree,\n );\n\n file.data[\"mdx-export\"].push({\n name: \"_mdast\",\n value: mdast,\n });\n }\n\n for (const { name, value } of file.data[\"mdx-export\"]) {\n tree.children.unshift(getMdastExport(name, value));\n }\n\n // reset the data to reduce memory usage\n file.data[\"mdx-export\"] = [];\n\n for (const name of valueToExport) {\n if (!(name in file.data)) continue;\n\n tree.children.unshift(getMdastExport(name, file.data[name]));\n }\n };\n}\n\n/**\n * MDX.js first converts javascript (with esm support) into mdast nodes with remark-mdx, then handle the other remark plugins\n *\n * Therefore, if we want to inject an export, we must convert the object into AST, then add the mdast node\n */\nfunction getMdastExport(name: string, value: unknown): RootContent {\n return {\n type: \"mdxjsEsm\",\n value: \"\",\n data: {\n estree: {\n type: \"Program\",\n sourceType: \"module\",\n body: [\n {\n type: \"ExportNamedDeclaration\",\n specifiers: [],\n attributes: [],\n source: null,\n declaration: {\n type: \"VariableDeclaration\",\n kind: \"let\",\n declarations: [\n {\n type: \"VariableDeclarator\",\n id: {\n type: \"Identifier\",\n name,\n },\n init: valueToEstree(value),\n },\n ],\n },\n },\n ],\n },\n },\n };\n}\n","import type { Processor, Transformer } from \"unified\";\nimport type { Root } from \"mdast\";\n\nexport interface PreprocessOptions {\n preprocessor?: Processor<Root>;\n}\n\ndeclare module \"vfile\" {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- extend data map\n interface DataMap {\n _preprocessed?: boolean;\n }\n}\n\nexport function remarkPreprocess(options?: PreprocessOptions): Transformer<Root, Root> {\n return async (tree, file) => {\n if (file.data._preprocessed) return;\n file.data._preprocessed = true;\n\n if (options?.preprocessor) {\n return (await options.preprocessor.run(tree)) as Root;\n }\n };\n}\n","import { createProcessor } from \"@mdx-js/mdx\";\nimport { VFile } from \"vfile\";\nimport { remarkInclude, type RemarkIncludeOptions } from \"@/collections/mdx/remark-include\";\nimport { type PostprocessOptions, remarkPostprocess } from \"@/collections/mdx/remark-postprocess\";\nimport type { Core } from \"@/core\";\nimport { remarkPreprocess } from \"@/collections/mdx/remark-preprocess\";\nimport type { Pluggable } from \"unified\";\nimport { createCache } from \"@/utils/async-cache\";\nimport type { CompilerOptions } from \"@/plugins/loader\";\nimport type { MDXContent } from \"mdx/types\";\nimport { MDXCollection } from \"../mdx\";\n\ntype MDXProcessor = ReturnType<typeof createProcessor>;\n\ninterface BuildMDXOptions {\n /**\n * Specify a file path for source\n */\n filePath: string;\n source: string;\n frontmatter?: Record<string, unknown>;\n\n environment: \"bundler\" | \"runtime\";\n isDevelopment: boolean;\n _compiler?: CompilerOptions;\n}\n\nexport interface FumaContentDataMap {\n /**\n * [Fuma Content] raw frontmatter, you can modify it\n */\n frontmatter?: Record<string, unknown>;\n\n /**\n * [Fuma Content] additional ESM exports to write\n */\n \"mdx-export\"?: { name: string; value: unknown }[];\n\n /**\n * [Fuma Content] The compiler object from loader\n */\n _compiler?: CompilerOptions;\n\n /**\n * [Fuma Content] get internal processor, do not use this on user land.\n */\n _getProcessor?: (format: \"md\" | \"mdx\") => MDXProcessor | Promise<MDXProcessor>;\n}\n\ndeclare module \"vfile\" {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- extend data map\n interface DataMap extends FumaContentDataMap {}\n}\n\nexport interface CompiledMDX<Frontmatter = Record<string, unknown>> extends Record<\n string,\n unknown\n> {\n frontmatter: Frontmatter;\n default: MDXContent;\n}\n\nexport async function buildMDX(\n core: Core,\n collection: MDXCollection | undefined,\n { filePath, frontmatter, source, _compiler, environment, isDevelopment }: BuildMDXOptions,\n): Promise<VFile> {\n const processorCache = createCache(core.cache).$value<MDXProcessor>();\n\n function getProcessor(format: \"md\" | \"mdx\") {\n const key = `build-mdx:${collection?.name ?? \"global\"}:${format}`;\n\n return processorCache.cached(key, async () => {\n const mdxOptions = await collection?.getMDXOptions?.(environment);\n const preprocessPlugin = [remarkPreprocess, collection?.preprocess] satisfies Pluggable;\n const postprocessOptions: PostprocessOptions = {\n _format: format,\n ...collection?.postprocess,\n };\n const remarkIncludeOptions: RemarkIncludeOptions = {\n preprocess: [preprocessPlugin],\n };\n\n return createProcessor({\n outputFormat: \"program\",\n development: isDevelopment,\n ...mdxOptions,\n remarkPlugins: [\n preprocessPlugin,\n [remarkInclude, remarkIncludeOptions],\n ...(mdxOptions?.remarkPlugins ?? []),\n [remarkPostprocess, postprocessOptions],\n ],\n format,\n });\n });\n }\n\n let vfile = new VFile({\n value: source,\n path: filePath,\n cwd: core.getOptions().cwd,\n data: {\n frontmatter,\n _compiler,\n _getProcessor: getProcessor,\n },\n });\n\n if (collection && collection) {\n vfile = await collection.vfile.run(vfile, {\n collection,\n filePath,\n source,\n });\n }\n\n return (await getProcessor(filePath.endsWith(\".mdx\") ? \"mdx\" : \"md\")).process(vfile);\n}\n"],"mappings":";;;;;;;;;;;;;;AAMA,SAAgB,uBAAgD;AAC9D,SAAQ,SAAS;AACf,QAAM,OAAO,MAAM,OAAO,WAAW;GACnC,IAAI,SAAS;GACb,IAAI,MAAM;GACV,IAAI,YAAY;AAEhB,OAAI,UAAU,OAAO,UAAU,YAAY,KAAK,SAAS,aAAa;IACpE,MAAM,WAAW,KAAK;AAEtB,WAAO,EAAE,SAAS,SAAS,QAAQ;KACjC,MAAM,QAAQ,SAAS;AAEvB,SAAI,MAAM,SAAS,uBAAuB,MAAM,SAAS,oBACvD,aAAY;cACH,MAAM,SAAS,UAAU,MAAM,MAAM,MAAM,CAAC,WAAW,GAAG,QAE9D;AACL,YAAM;AACN;;;AAIJ,QAAI,OAAO,WAAW;AACpB,cAAS;KACT,MAAMA,cAA6B,EAAE;AAErC,YAAO,EAAE,SAAS,SAAS,QAAQ;M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B;KACxC;IACD;IACD,CAAC;IACF;;CAGJ,IAAI,QAAQ,IAAI,MAAM;EACpB,OAAO;EACP,MAAM;EACN,KAAK,KAAK,YAAY,CAAC;EACvB,MAAM;GACJ;GACA;GACA,eAAe;GAChB;EACF,CAAC;AAEF,KAAI,cAAc,WAChB,SAAQ,MAAM,WAAW,MAAM,IAAI,OAAO;EACxC;EACA;EACA;EACD,CAAC;AAGJ,SAAQ,MAAM,aAAa,SAAS,SAAS,OAAO,GAAG,QAAQ,KAAK,EAAE,QAAQ,MAAM"}
@@ -0,0 +1,4 @@
1
+ import "./fuma-matter-BuBO2w-p.js";
2
+ import { t as buildMDX } from "./build-mdx-CUp6FpfT.js";
3
+
4
+ export { buildMDX };
@@ -1,4 +1,4 @@
1
- import { n as CoreOptions, t as Core } from "../core-BO3b8jMg.js";
1
+ import { n as CoreOptions, t as Core } from "../core-CT06v32N.js";
2
2
  import { BunPlugin } from "bun";
3
3
 
4
4
  //#region src/bun/index.d.ts
package/dist/bun/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { t as Core } from "../core-D5QHSKk6.js";
2
- import { n as loaderPlugin } from "../loader-BuR4gkKg.js";
1
+ import { t as Core } from "../core-Uv3jZqL-.js";
2
+ import { n as loaderPlugin } from "../loader-B4nQrRwA.js";
3
3
  import { pathToFileURL } from "node:url";
4
4
 
5
5
  //#region src/bun/index.ts
@@ -2,13 +2,6 @@ import path from "node:path";
2
2
  import { URLSearchParams } from "node:url";
3
3
 
4
4
  //#region src/utils/code-generator.ts
5
- function importInfo() {
6
- return {
7
- named: /* @__PURE__ */ new Map(),
8
- namespaces: /* @__PURE__ */ new Set(),
9
- isUsed: /* @__PURE__ */ new Set()
10
- };
11
- }
12
5
  /**
13
6
  * Code generator (one instance per file)
14
7
  */
@@ -25,18 +18,26 @@ var CodeGenerator = class {
25
18
  };
26
19
  }
27
20
  addNamespaceImport(namespace, specifier, typeOnly = false) {
28
- const info = this.importInfos.get(specifier) ?? importInfo();
21
+ const info = this.importInfos.get(specifier) ?? {};
29
22
  this.importInfos.set(specifier, info);
30
- if (!typeOnly) info.isUsed.add(namespace);
23
+ if (!typeOnly) {
24
+ info.isUsed ??= /* @__PURE__ */ new Set();
25
+ info.isUsed.add(namespace);
26
+ }
27
+ info.namespaces ??= /* @__PURE__ */ new Set();
31
28
  info.namespaces.add(namespace);
32
29
  }
33
30
  addNamedImport(names, specifier, typeOnly = false) {
34
- const info = this.importInfos.get(specifier) ?? importInfo();
31
+ const info = this.importInfos.get(specifier) ?? {};
35
32
  this.importInfos.set(specifier, info);
33
+ info.named ??= /* @__PURE__ */ new Map();
36
34
  for (const name of names) {
37
35
  const [memberName, importName = memberName] = name.split(/\s+as\s+/, 2);
38
36
  info.named.set(importName, memberName);
39
- if (!typeOnly) info.isUsed.add(importName);
37
+ if (!typeOnly) {
38
+ info.isUsed ??= /* @__PURE__ */ new Set();
39
+ info.isUsed.add(importName);
40
+ }
40
41
  }
41
42
  }
42
43
  push(...insert) {
@@ -68,25 +69,30 @@ var CodeGenerator = class {
68
69
  formatImportPath(file) {
69
70
  const ext = path.extname(file);
70
71
  let filename;
71
- if (ext === ".ts" || ext === ".tsx") {
72
- filename = file.substring(0, file.length - ext.length);
73
- if (this.options.jsExtension) filename += ".js";
74
- } else filename = file;
72
+ switch (ext) {
73
+ case ".ts":
74
+ case ".tsx":
75
+ filename = file.substring(0, file.length - ext.length);
76
+ if (this.options.jsExtension) filename += ".js";
77
+ break;
78
+ default: filename = file;
79
+ }
75
80
  const importPath = slash(path.relative(this.options.outDir, filename));
76
81
  return importPath.startsWith("../") ? importPath : `./${importPath}`;
77
82
  }
78
83
  toString() {
79
84
  const final = ["// @ts-nocheck"];
80
85
  if (this.options.target === "vite") final.push("/// <reference types=\"vite/client\" />");
81
- for (const [specifier, info] of this.importInfos) {
82
- const { namespaces, named, isUsed } = info;
83
- for (const namespace of namespaces) final.push(isUsed.has(namespace) ? `import * as ${namespace} from "${specifier}";` : `import type * as ${namespace} from "${specifier}";`);
84
- const namedImports = [];
85
- for (const [importName, memberName] of named) {
86
- const item = importName === memberName ? importName : `${memberName} as ${importName}`;
87
- namedImports.push(isUsed.has(importName) ? item : `type ${item}`);
86
+ for (const [specifier, { namespaces, isUsed, named }] of this.importInfos) {
87
+ if (namespaces) for (const namespace of namespaces) final.push(isUsed?.has(namespace) ? `import * as ${namespace} from "${specifier}";` : `import type * as ${namespace} from "${specifier}";`);
88
+ if (named && named.size > 0) {
89
+ const namedImports = [];
90
+ for (const [importName, memberName] of named) {
91
+ const item = importName === memberName ? importName : `${memberName} as ${importName}`;
92
+ namedImports.push(isUsed?.has(importName) ? item : `type ${item}`);
93
+ }
94
+ final.push(`import { ${namedImports.join(", ")} } from "${specifier}";`);
88
95
  }
89
- if (namedImports.length > 0) final.push(`import { ${namedImports.join(", ")} } from "${specifier}";`);
90
96
  }
91
97
  final.push(...this.lines);
92
98
  return final.join("\n");
@@ -99,4 +105,4 @@ function slash(path$1) {
99
105
 
100
106
  //#endregion
101
107
  export { slash as n, CodeGenerator as t };
102
- //# sourceMappingURL=code-generator-CjC4EEXg.js.map
108
+ //# sourceMappingURL=code-generator-Qhhq7kHh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-generator-Qhhq7kHh.js","names":["filename: string","final: string[]","namedImports: string[]","path"],"sources":["../src/utils/code-generator.ts"],"sourcesContent":["import type { EmitConfig } from \"@/config\";\nimport path from \"node:path\";\nimport { URLSearchParams } from \"node:url\";\n\nexport interface CodeGeneratorOptions extends EmitConfig {\n outDir: string;\n}\n\ninterface ImportInfo {\n /**\n * import name -> member name\n */\n named?: Map<string, string>;\n namespaces?: Set<string>;\n /**\n * a set of import names, the import is type-only if its name is missing in this set.\n */\n isUsed?: Set<string>;\n}\n\n/**\n * Code generator (one instance per file)\n */\nexport class CodeGenerator {\n private readonly lines: string[] = [];\n // specifier -> imported members/info\n private readonly importInfos = new Map<string, ImportInfo>();\n private eagerImportId = 0;\n\n readonly options: CodeGeneratorOptions;\n constructor({\n target = \"default\",\n jsExtension = false,\n outDir = \"\",\n }: Partial<CodeGeneratorOptions>) {\n this.options = {\n target,\n jsExtension,\n outDir,\n };\n }\n\n addNamespaceImport(namespace: string, specifier: string, typeOnly = false) {\n const info = this.importInfos.get(specifier) ?? {};\n this.importInfos.set(specifier, info);\n if (!typeOnly) {\n info.isUsed ??= new Set();\n info.isUsed.add(namespace);\n }\n\n info.namespaces ??= new Set();\n info.namespaces.add(namespace);\n }\n\n addNamedImport(names: string[], specifier: string, typeOnly = false) {\n const info = this.importInfos.get(specifier) ?? {};\n this.importInfos.set(specifier, info);\n info.named ??= new Map();\n\n for (const name of names) {\n const [memberName, importName = memberName] = name.split(/\\s+as\\s+/, 2);\n info.named.set(importName, memberName);\n if (!typeOnly) {\n info.isUsed ??= new Set();\n info.isUsed.add(importName);\n }\n }\n }\n\n push(...insert: string[]) {\n this.lines.push(...insert);\n }\n\n async pushAsync(insert: Promise<string | undefined>[]) {\n for (const line of await Promise.all(insert)) {\n if (line === undefined) continue;\n\n this.lines.push(line);\n }\n }\n\n /** generate a random import name that is unique in file. */\n generateImportName(): string {\n return `__${this.eagerImportId++}`;\n }\n\n formatDynamicImport(specifier: string, mod?: string): string {\n let s = `import(\"${specifier}\")`;\n if (mod) s += `.then(mod => mod.${mod})`;\n return s;\n }\n\n formatQuery(query: Record<string, string | undefined>) {\n const params = new URLSearchParams();\n for (const k in query) {\n const value = query[k];\n if (typeof value === \"string\") params.set(k, value);\n }\n return params.toString();\n }\n\n formatImportPath(file: string) {\n const ext = path.extname(file);\n let filename: string;\n\n switch (ext) {\n case \".ts\":\n case \".tsx\":\n filename = file.substring(0, file.length - ext.length);\n if (this.options.jsExtension) filename += \".js\";\n break;\n default:\n filename = file;\n }\n\n const importPath = slash(path.relative(this.options.outDir, filename));\n return importPath.startsWith(\"../\") ? importPath : `./${importPath}`;\n }\n\n toString() {\n const final: string[] = [\"// @ts-nocheck\"];\n if (this.options.target === \"vite\") {\n final.push('/// <reference types=\"vite/client\" />');\n }\n\n for (const [specifier, { namespaces, isUsed, named }] of this.importInfos) {\n if (namespaces)\n for (const namespace of namespaces) {\n final.push(\n isUsed?.has(namespace)\n ? `import * as ${namespace} from \"${specifier}\";`\n : `import type * as ${namespace} from \"${specifier}\";`,\n );\n }\n\n if (named && named.size > 0) {\n const namedImports: string[] = [];\n\n for (const [importName, memberName] of named) {\n const item = importName === memberName ? importName : `${memberName} as ${importName}`;\n\n namedImports.push(isUsed?.has(importName) ? item : `type ${item}`);\n }\n\n final.push(`import { ${namedImports.join(\", \")} } from \"${specifier}\";`);\n }\n }\n\n final.push(...this.lines);\n return final.join(\"\\n\");\n }\n}\n\nexport function slash(path: string): string {\n const isExtendedLengthPath = path.startsWith(\"\\\\\\\\?\\\\\");\n\n if (isExtendedLengthPath) {\n return path;\n }\n\n return path.replaceAll(\"\\\\\", \"/\");\n}\n\nexport function ident(code: string, tab: number = 1) {\n return code\n .split(\"\\n\")\n .map((v) => \" \".repeat(tab) + v)\n .join(\"\\n\");\n}\n"],"mappings":";;;;;;;AAuBA,IAAa,gBAAb,MAA2B;CACzB,AAAiB,QAAkB,EAAE;CAErC,AAAiB,8BAAc,IAAI,KAAyB;CAC5D,AAAQ,gBAAgB;CAExB,AAAS;CACT,YAAY,EACV,SAAS,WACT,cAAc,OACd,SAAS,MACuB;AAChC,OAAK,UAAU;GACb;GACA;GACA;GACD;;CAGH,mBAAmB,WAAmB,WAAmB,WAAW,OAAO;EACzE,MAAM,OAAO,KAAK,YAAY,IAAI,UAAU,IAAI,EAAE;AAClD,OAAK,YAAY,IAAI,WAAW,KAAK;AACrC,MAAI,CAAC,UAAU;AACb,QAAK,2BAAW,IAAI,KAAK;AACzB,QAAK,OAAO,IAAI,UAAU;;AAG5B,OAAK,+BAAe,IAAI,KAAK;AAC7B,OAAK,WAAW,IAAI,UAAU;;CAGhC,eAAe,OAAiB,WAAmB,WAAW,OAAO;EACnE,MAAM,OAAO,KAAK,YAAY,IAAI,UAAU,IAAI,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B;AAC1C,MAAI,KAAK,QAAQ,WAAW,OAC1B,OAAM,KAAK,0CAAwC;AAGrD,OAAK,MAAM,CAAC,WAAW,EAAE,YAAY,QAAQ,YAAY,KAAK,aAAa;AACzE,OAAI,WACF,MAAK,MAAM,aAAa,WACtB,OAAM,KACJ,QAAQ,IAAI,UAAU,GAClB,eAAe,UAAU,SAAS,UAAU,MAC5C,oBAAoB,UAAU,SAAS,UAAU,IACtD;AAGL,OAAI,SAAS,MAAM,OAAO,GAAG;IAC3B,MAAMC,eAAyB,EAAE;AAEjC,SAAK,MAAM,CAAC,YAAY,eAAe,OAAO;KAC5C,MAAM,OAAO,eAAe,aAAa,aAAa,GAAG,WAAW,MAAM;AAE1E,kBAAa,KAAK,QAAQ,IAAI,WAAW,GAAG,OAAO,QAAQ,OAAO;;AAGpE,UAAM,KAAK,YAAY,aAAa,KAAK,KAAK,CAAC,WAAW,UAAU,IAAI;;;AAI5E,QAAM,KAAK,GAAG,KAAK,MAAM;AACzB,SAAO,MAAM,KAAK,KAAK;;;AAI3B,SAAgB,MAAM,QAAsB;AAG1C,KAF6BC,OAAK,WAAW,UAAU,CAGrD,QAAOA;AAGT,QAAOA,OAAK,WAAW,MAAM,IAAI"}
@@ -1,10 +1,10 @@
1
- import { D as GetCollectionConfig } from "../../core-BO3b8jMg.js";
2
- import "../../dynamic-CTYYdl7_.js";
3
- import "../../index-Da88Sj8w.js";
4
- import "../../fs-D34Sztbh.js";
1
+ import { D as GetCollectionConfig } from "../../core-CT06v32N.js";
2
+ import "../../dynamic-Ck1wYoaL.js";
3
+ import "../../index-BheUVWBm.js";
4
+ import "../../fs-CmwaaFyx.js";
5
5
  import { DataCollection } from "../data.js";
6
- import "../../store-DiuGdV5M.js";
7
- import { t as FileCollectionStore } from "../../file-store-laO4IjvB.js";
6
+ import "../../store-D_PPrdRE.js";
7
+ import { t as FileCollectionStore } from "../../file-store-Dm1SjuLg.js";
8
8
 
9
9
  //#region src/collections/data/runtime.d.ts
10
10
  declare function dataStore<Config, Name extends string>(_name: Name, base: string, input: Record<string, unknown>): FileCollectionStore<{
@@ -1,7 +1,7 @@
1
- import { v as AsyncPipe } from "../core-BO3b8jMg.js";
2
- import "../dynamic-CTYYdl7_.js";
3
- import { r as LoaderConfig } from "../index-Da88Sj8w.js";
4
- import { n as FileSystemCollectionConfig, t as FileSystemCollection } from "../fs-D34Sztbh.js";
1
+ import { v as AsyncPipe } from "../core-CT06v32N.js";
2
+ import "../dynamic-Ck1wYoaL.js";
3
+ import { r as LoaderConfig } from "../index-BheUVWBm.js";
4
+ import { n as FileSystemCollectionConfig, t as FileSystemCollection } from "../fs-CmwaaFyx.js";
5
5
  import { StandardSchemaV1 } from "@standard-schema/spec";
6
6
 
7
7
  //#region src/collections/data.d.ts
@@ -24,6 +24,7 @@ interface DataCollectionConfig<Schema extends StandardSchemaV1 | undefined> exte
24
24
  loaders?: LoadersConfig;
25
25
  }
26
26
  declare class DataCollection<Schema extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined> extends FileSystemCollection {
27
+ #private;
27
28
  schema?: Schema;
28
29
  /**
29
30
  * Transform data
@@ -37,7 +38,6 @@ declare class DataCollection<Schema extends StandardSchemaV1 | undefined = Stand
37
38
  loaders: _loadersConfig,
38
39
  schema
39
40
  }: DataCollectionConfig<Schema>);
40
- private generateCollectionStore;
41
41
  }
42
42
  declare function dataCollection<Schema extends StandardSchemaV1 | undefined = undefined>(config: DataCollectionConfig<Schema>): DataCollection<Schema>;
43
43
  declare function yamlLoader(): LoaderConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","names":[],"sources":["../../src/collections/data.ts"],"sourcesContent":[],"mappings":";;;;;;;UAUiB,yBAAA;;;;AAAjB,UAKU,aAAA,CALO;EAKP,IAAA,CAAA,EAAA,OAAA;EAMO,IAAA,CAAA,EAAA,OAAA;EAAoC,MAAA,CAAA,EAH1C,MAG0C,CAAA,MAAA,EAH3B,YAG2B,CAAA;;AAI1C,UAJM,oBAIN,CAAA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AAA;;AAI1C,UAJM,oBAIN,CAAA,eAJ0C,gBAI1C,GAAA,SAAA,CAAA,SAJgF,IAIhF,CAHT,0BAGS,EAAA,kBAAA,CAAA,CAAA;EAMC,MAAA,CAAA,EAND,MAMC;EAV+E;;AAa3F;;;EAGW,OAAA,CAAA,EANC,aAMD;;AAIM,cAPJ,cAOI,CAAA,eANA,gBAMA,GAAA,SAAA,GAN+B,gBAM/B,GAAA,SAAA,CAAA,SALP,oBAAA,CAKO;EACF,CAAA,OAAA;EAAe,MAAA,CAAA,EALnB,MAKmB;EAA+C;;;EAE9C,SAAA,MAAA,EAHd,SAGc,CAAA,OAAA,EAHd,yBAGc,CAAA;EAAgD,WAAA,EAFhE,MAEgE,SAFjD,gBAEiD,GAF9B,gBAAA,CAAiB,UAEa,CAFF,MAEE,CAAA,GAAA,OAAA;EAA7B,YAAA,EAAlC,MAAmD,SAApC,gBAAoC,GAAjB,gBAAA,CAAiB,WAAA,CAAY,MAAZ,CAAA,GAAA,OAAA;EAGnD,WAAA,CAAA;IAAA,GAAA;IAAA,KAAA;IAAA,OAAA,EAAqB,cAArB;IAAA;EAAA,CAAA,EAAoD,oBAApD,CAAyE,MAAzE,CAAA;;AAAqB,iBA8DrB,cA9DqB,CAAA,eA8DS,gBA9DT,GAAA,SAAA,GAAA,SAAA,CAAA,CAAA,MAAA,EA+D3B,oBA/D2B,CA+DN,MA/DM,CAAA,CAAA,EA+DC,cA/DD,CA+DC,MA/DD,CAAA;AAAqB,iBAoE1C,UAAA,CAAA,CApE0C,EAoE5B,YApE4B;AAA+B,iBA2HzE,UAAA,CAAA,CA3HyE,EA2H3D,YA3H2D"}
@@ -1,5 +1,5 @@
1
- import "../loader-BuR4gkKg.js";
2
- import "../fs-WWbLA7Gx.js";
3
- import { i as yamlLoader, n as dataCollection, r as jsonLoader, t as DataCollection } from "../data-9h98oZwj.js";
1
+ import "../loader-B4nQrRwA.js";
2
+ import "../fs-CXzVd2Dp.js";
3
+ import { i as yamlLoader, n as dataCollection, r as jsonLoader, t as DataCollection } from "../data-Cxsx5KPD.js";
4
4
 
5
5
  export { DataCollection, dataCollection, jsonLoader, yamlLoader };
@@ -1,3 +1,3 @@
1
- import "../core-BO3b8jMg.js";
2
- import { n as FileSystemCollectionConfig, r as fileSystemCollection, t as FileSystemCollection } from "../fs-D34Sztbh.js";
1
+ import "../core-CT06v32N.js";
2
+ import { n as FileSystemCollectionConfig, r as fileSystemCollection, t as FileSystemCollection } from "../fs-CmwaaFyx.js";
3
3
  export { FileSystemCollection, FileSystemCollectionConfig, fileSystemCollection };
@@ -1,3 +1,3 @@
1
- import { n as fileSystemCollection, t as FileSystemCollection } from "../fs-WWbLA7Gx.js";
1
+ import { n as fileSystemCollection, t as FileSystemCollection } from "../fs-CXzVd2Dp.js";
2
2
 
3
3
  export { FileSystemCollection, fileSystemCollection };
@@ -1,2 +1,2 @@
1
- import { _ as defineCollectionHook, g as CollectionHookContext, h as CollectionHook, m as Collection } from "../core-BO3b8jMg.js";
1
+ import { _ as defineCollectionHook, g as CollectionHookContext, h as CollectionHook, m as Collection } from "../core-CT06v32N.js";
2
2
  export { Collection, CollectionHook, CollectionHookContext, defineCollectionHook };
@@ -1,3 +1,3 @@
1
- import { n as defineCollectionHook, t as Collection } from "../collections-DNFRdCuB.js";
1
+ import { n as defineCollectionHook, t as Collection } from "../collections-CNWuMDAZ.js";
2
2
 
3
3
  export { Collection, defineCollectionHook };
@@ -1,6 +1,6 @@
1
- import "../../core-BO3b8jMg.js";
2
- import "../../dynamic-CTYYdl7_.js";
3
- import { l as WebpackLoader } from "../../index-Da88Sj8w.js";
1
+ import "../../core-CT06v32N.js";
2
+ import "../../dynamic-Ck1wYoaL.js";
3
+ import { l as WebpackLoader } from "../../index-BheUVWBm.js";
4
4
 
5
5
  //#region src/collections/json/loader-webpack.d.ts
6
6
  declare const _default: WebpackLoader;
@@ -1,11 +1,11 @@
1
- import "../../dynamic-DhKTOrIl.js";
1
+ import "../../dynamic-CtOB4Rkp.js";
2
2
  import "../../validation-BvVvvLII.js";
3
- import "../../loader-BuR4gkKg.js";
4
- import "../../fs-WWbLA7Gx.js";
5
- import "../../data-9h98oZwj.js";
3
+ import "../../loader-B4nQrRwA.js";
4
+ import "../../fs-CXzVd2Dp.js";
5
+ import "../../data-Cxsx5KPD.js";
6
6
  import { createWebpackLoader } from "../../plugins/loader/webpack.js";
7
- import "../../loader-BzQpSBvP.js";
8
- import { t as createJsonLoader } from "../../loader-BhXHF8vy.js";
7
+ import "../../loader-CuntMmR4.js";
8
+ import { t as createJsonLoader } from "../../loader-BK8PnqRg.js";
9
9
 
10
10
  //#region src/collections/json/loader-webpack.ts
11
11
  var loader_webpack_default = createWebpackLoader((core) => createJsonLoader(core, "json"));
@@ -1,6 +1,6 @@
1
- import "../../core-BO3b8jMg.js";
2
- import "../../dynamic-CTYYdl7_.js";
3
- import { l as WebpackLoader } from "../../index-Da88Sj8w.js";
1
+ import "../../core-CT06v32N.js";
2
+ import "../../dynamic-Ck1wYoaL.js";
3
+ import { l as WebpackLoader } from "../../index-BheUVWBm.js";
4
4
 
5
5
  //#region src/collections/mdx/loader-webpack.d.ts
6
6
  declare const _default: WebpackLoader;
@@ -1,12 +1,12 @@
1
- import "../../dynamic-DhKTOrIl.js";
1
+ import "../../dynamic-CtOB4Rkp.js";
2
2
  import "../../validation-BvVvvLII.js";
3
- import "../../loader-BuR4gkKg.js";
4
- import "../../fs-WWbLA7Gx.js";
5
- import "../../git-CQWA37-X.js";
6
- import "../../mdx-iZ2uP27Z.js";
3
+ import "../../loader-B4nQrRwA.js";
4
+ import "../../fs-CXzVd2Dp.js";
5
+ import "../../git-DnejL9r_.js";
6
+ import "../../mdx-Cw1nBJ0D.js";
7
7
  import { createWebpackLoader } from "../../plugins/loader/webpack.js";
8
8
  import "../../fuma-matter-BuBO2w-p.js";
9
- import { t as createMdxLoader } from "../../loader-D6StkShK.js";
9
+ import { t as createMdxLoader } from "../../loader-CnksfM7I.js";
10
10
 
11
11
  //#region src/collections/mdx/loader-webpack.ts
12
12
  var loader_webpack_default = createWebpackLoader(createMdxLoader);
@@ -1,13 +1,13 @@
1
- import "../../core-BO3b8jMg.js";
2
- import "../../dynamic-CTYYdl7_.js";
3
- import "../../index-Da88Sj8w.js";
4
- import "../../fs-D34Sztbh.js";
5
- import "../../store-DiuGdV5M.js";
6
- import "../../file-store-laO4IjvB.js";
7
- import { i as CompiledMDX } from "../../mdx-Dt9hirUu.js";
8
- import { t as MDXStoreBrowserData } from "../../runtime-browser-BQEk7qjc.js";
9
- import "../../git-2CjUW3M5.js";
10
- import "../../runtime-HN-HSB0Z.js";
1
+ import "../../core-CT06v32N.js";
2
+ import "../../dynamic-Ck1wYoaL.js";
3
+ import "../../index-BheUVWBm.js";
4
+ import "../../fs-CmwaaFyx.js";
5
+ import "../../store-D_PPrdRE.js";
6
+ import "../../file-store-Dm1SjuLg.js";
7
+ import { i as CompiledMDX } from "../../mdx-PaqRNZMS.js";
8
+ import { t as MDXStoreBrowserData } from "../../runtime-browser-B70WGxeQ.js";
9
+ import "../../git-n-9ddn78.js";
10
+ import "../../runtime-BUUHSFlR.js";
11
11
  import { ReactNode } from "react";
12
12
 
13
13
  //#region src/collections/mdx/react.d.ts
@@ -1,11 +1,11 @@
1
- import "../../core-BO3b8jMg.js";
2
- import "../../dynamic-CTYYdl7_.js";
3
- import "../../index-Da88Sj8w.js";
4
- import "../../fs-D34Sztbh.js";
5
- import "../../store-DiuGdV5M.js";
6
- import "../../file-store-laO4IjvB.js";
7
- import "../../mdx-Dt9hirUu.js";
8
- import { n as _internal_data, r as mdxStoreBrowser, t as MDXStoreBrowserData } from "../../runtime-browser-BQEk7qjc.js";
9
- import "../../git-2CjUW3M5.js";
10
- import { i as WithGit, r as WithExtractedReferences } from "../../runtime-HN-HSB0Z.js";
1
+ import "../../core-CT06v32N.js";
2
+ import "../../dynamic-Ck1wYoaL.js";
3
+ import "../../index-BheUVWBm.js";
4
+ import "../../fs-CmwaaFyx.js";
5
+ import "../../store-D_PPrdRE.js";
6
+ import "../../file-store-Dm1SjuLg.js";
7
+ import "../../mdx-PaqRNZMS.js";
8
+ import { n as _internal_data, r as mdxStoreBrowser, t as MDXStoreBrowserData } from "../../runtime-browser-B70WGxeQ.js";
9
+ import "../../git-n-9ddn78.js";
10
+ import { i as WithGit, r as WithExtractedReferences } from "../../runtime-BUUHSFlR.js";
11
11
  export { MDXStoreBrowserData, WithExtractedReferences, WithGit, _internal_data, mdxStoreBrowser };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { t as createCache } from "../../async-cache-U87GzQTb.js";
4
- import { t as MapCollectionStore } from "../../store-IvpEBdxi.js";
4
+ import { t as MapCollectionStore } from "../../store-CRyvZFKN.js";
5
5
 
6
6
  //#region src/collections/mdx/runtime-browser.ts
7
7
  const _internal_data = /* @__PURE__ */ new Map();
@@ -1,12 +1,12 @@
1
- import { D as GetCollectionConfig, n as CoreOptions } from "../../core-BO3b8jMg.js";
2
- import "../../dynamic-CTYYdl7_.js";
3
- import "../../index-Da88Sj8w.js";
4
- import "../../fs-D34Sztbh.js";
5
- import "../../store-DiuGdV5M.js";
6
- import { t as FileCollectionStore } from "../../file-store-laO4IjvB.js";
7
- import { i as CompiledMDX, t as MDXCollection } from "../../mdx-Dt9hirUu.js";
8
- import "../../git-2CjUW3M5.js";
9
- import { i as WithGit, r as WithExtractedReferences } from "../../runtime-HN-HSB0Z.js";
1
+ import { D as GetCollectionConfig, n as CoreOptions } from "../../core-CT06v32N.js";
2
+ import "../../dynamic-Ck1wYoaL.js";
3
+ import "../../index-BheUVWBm.js";
4
+ import "../../fs-CmwaaFyx.js";
5
+ import "../../store-D_PPrdRE.js";
6
+ import { t as FileCollectionStore } from "../../file-store-Dm1SjuLg.js";
7
+ import { i as CompiledMDX, t as MDXCollection } from "../../mdx-PaqRNZMS.js";
8
+ import "../../git-n-9ddn78.js";
9
+ import { i as WithGit, r as WithExtractedReferences } from "../../runtime-BUUHSFlR.js";
10
10
  import { MDXContent } from "mdx/types";
11
11
 
12
12
  //#region src/collections/mdx/runtime-dynamic.d.ts
@@ -1,13 +1,13 @@
1
- import { t as Core } from "../../core-D5QHSKk6.js";
1
+ import { t as Core } from "../../core-Uv3jZqL-.js";
2
2
  import "../../validation-BvVvvLII.js";
3
3
  import { t as createCache } from "../../async-cache-U87GzQTb.js";
4
- import "../../loader-BuR4gkKg.js";
5
- import "../../fs-WWbLA7Gx.js";
6
- import "../../git-CQWA37-X.js";
7
- import { t as MDXCollection } from "../../mdx-iZ2uP27Z.js";
4
+ import "../../loader-B4nQrRwA.js";
5
+ import "../../fs-CXzVd2Dp.js";
6
+ import "../../git-DnejL9r_.js";
7
+ import { t as MDXCollection } from "../../mdx-Cw1nBJ0D.js";
8
8
  import { FileCollectionStore } from "../runtime/file-store.js";
9
9
  import { t as fumaMatter } from "../../fuma-matter-BuBO2w-p.js";
10
- import { t as buildMDX } from "../../build-mdx-BZxE8t2a.js";
10
+ import { t as buildMDX } from "../../build-mdx-CUp6FpfT.js";
11
11
  import fs from "node:fs/promises";
12
12
  import path from "node:path";
13
13
  import { pathToFileURL } from "node:url";
@@ -1,10 +1,10 @@
1
- import "../../core-BO3b8jMg.js";
2
- import "../../dynamic-CTYYdl7_.js";
3
- import "../../index-Da88Sj8w.js";
4
- import "../../fs-D34Sztbh.js";
5
- import "../../store-DiuGdV5M.js";
6
- import "../../file-store-laO4IjvB.js";
7
- import "../../mdx-Dt9hirUu.js";
8
- import "../../git-2CjUW3M5.js";
9
- import { a as mdxStore, i as WithGit, n as MDXStoreLazyData, o as mdxStoreLazy, r as WithExtractedReferences, t as MDXStoreData } from "../../runtime-HN-HSB0Z.js";
1
+ import "../../core-CT06v32N.js";
2
+ import "../../dynamic-Ck1wYoaL.js";
3
+ import "../../index-BheUVWBm.js";
4
+ import "../../fs-CmwaaFyx.js";
5
+ import "../../store-D_PPrdRE.js";
6
+ import "../../file-store-Dm1SjuLg.js";
7
+ import "../../mdx-PaqRNZMS.js";
8
+ import "../../git-n-9ddn78.js";
9
+ import { a as mdxStore, i as WithGit, n as MDXStoreLazyData, o as mdxStoreLazy, r as WithExtractedReferences, t as MDXStoreData } from "../../runtime-BUUHSFlR.js";
10
10
  export { MDXStoreData, MDXStoreLazyData, WithExtractedReferences, WithGit, mdxStore, mdxStoreLazy };
@@ -1,6 +1,6 @@
1
- import "../core-BO3b8jMg.js";
2
- import "../dynamic-CTYYdl7_.js";
3
- import "../index-Da88Sj8w.js";
4
- import "../fs-D34Sztbh.js";
5
- import { a as ExtractedReference, i as CompiledMDX, n as MDXCollectionConfig, r as mdxCollection, t as MDXCollection } from "../mdx-Dt9hirUu.js";
1
+ import "../core-CT06v32N.js";
2
+ import "../dynamic-Ck1wYoaL.js";
3
+ import "../index-BheUVWBm.js";
4
+ import "../fs-CmwaaFyx.js";
5
+ import { a as ExtractedReference, i as CompiledMDX, n as MDXCollectionConfig, r as mdxCollection, t as MDXCollection } from "../mdx-PaqRNZMS.js";
6
6
  export { CompiledMDX, ExtractedReference, MDXCollection, MDXCollectionConfig, mdxCollection };
@@ -1,7 +1,7 @@
1
1
  import "../validation-BvVvvLII.js";
2
- import "../loader-BuR4gkKg.js";
3
- import "../fs-WWbLA7Gx.js";
4
- import "../git-CQWA37-X.js";
5
- import { n as mdxCollection, t as MDXCollection } from "../mdx-iZ2uP27Z.js";
2
+ import "../loader-B4nQrRwA.js";
3
+ import "../fs-CXzVd2Dp.js";
4
+ import "../git-DnejL9r_.js";
5
+ import { n as mdxCollection, t as MDXCollection } from "../mdx-Cw1nBJ0D.js";
6
6
 
7
7
  export { MDXCollection, mdxCollection };