@ox-content/vite-plugin-solid 2.81.0 → 2.82.0
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.
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
}
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
20
20
|
value: mod,
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":";;;;;;;;;;UASiB;;;;;;EAMf;;UAGe;EACf;EACA;;;;;KAMU,gBAAgB;;;;;;;;KAShB,mBAAmB;;;;;;;;;;;UAYd,gCAAgC;;;;;;;;EAQ/C;;;;;;;;;;;;;;;;;;EAmBA,aAAa;;;;;;;;EASb,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;EAyB5B;;;;;;;;;EAUA,SAAS;;;;;UAMM;;;;;EAKf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;UAMe;;;;;EAKf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;UAMe;;;;;EAKf,mBAAmB;;;;;EAMnB,sBAAsB;;UAGP;EACf,QAAQ;EACR,WAAW;;UAGI;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB,YAAY;EACZ;EACA,QAAQ;EACR;;UAGe;EACf;EACA;EACA;EACA,aAAa;;UAGE;EACf;EACA,OAAO;EACP;EACA;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC9Kc,eAAe,UAAS,0BAA+B"}
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":";;;;;;;;;;UASiB;;;;;;EAMf;;UAGe;EACf;EACA;;;;;KAMU,gBAAgB;;;;;;;;KAShB,mBAAmB;;;;;;;;;;;UAYd,gCAAgC;;;;;;;;EAQ/C;;;;;;;;;;;;;;;;;;EAmBA,aAAa;;;;;;;;EASb,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;EAyB5B;;;;;;;;;EAUA,SAAS;;;;;UAMM;;;;;EAKf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;UAMe;;;;;EAKf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;UAMe;;;;;EAKf,mBAAmB;;;;;EAMnB,sBAAsB;;UAGP;EACf,QAAQ;EACR,WAAW;;UAGI;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB,YAAY;EACZ;EACA,QAAQ;EACR;;UAGe;EACf;EACA;EACA;EACA,aAAa;;UAGE;EACf;EACA,OAAO;EACP;EACA;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC9Kc,eAAe,UAAS,0BAA+B"}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["baseTransformMarkdown","oxContent"],"sources":["../src/components.ts","../src/environment.ts","../src/options.ts","../src/codegen.ts","../src/markdown.ts","../src/transform.ts","../src/verify.ts","../src/index.ts"],"sourcesContent":["/**\n * Resolves the `components` option into a name → path map, expanding glob\n * patterns against the Vite project root.\n */\n\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport type { ComponentsMap, ComponentsOption } from \"./types\";\n\nexport async function resolveComponentsGlob(\n componentsOption: ComponentsOption,\n root: string,\n): Promise<ComponentsMap> {\n if (typeof componentsOption === \"object\" && !Array.isArray(componentsOption)) {\n return componentsOption;\n }\n\n const patterns = Array.isArray(componentsOption) ? componentsOption : [componentsOption];\n const result: ComponentsMap = {};\n\n for (const pattern of patterns) {\n for (const file of await globFiles(pattern, root)) {\n const baseName = path.basename(file, path.extname(file));\n const relativePath = \"./\" + path.relative(root, file).replace(/\\\\/g, \"/\");\n result[toPascalCase(baseName)] = relativePath;\n }\n }\n\n return result;\n}\n\nasync function globFiles(pattern: string, root: string): Promise<string[]> {\n const files: string[] = [];\n const normalized = pattern.replace(/\\\\/g, \"/\").replace(/^\\.\\//, \"\");\n\n if (!hasWildcard(normalized)) {\n const fullPath = path.resolve(root, normalized);\n if (fs.existsSync(fullPath)) {\n files.push(fullPath);\n }\n return files;\n }\n\n // Walk from the deepest wildcard-free prefix, then keep only the paths the\n // whole pattern matches. Deriving the base directory alone is not enough:\n // `src/components/**/*.tsx` must not collect the non-component files below\n // `src/components`, and the generated module would fail to import them.\n const baseDir = path.resolve(root, staticPrefix(normalized));\n if (!fs.existsSync(baseDir)) {\n return files;\n }\n\n // Only a pattern whose wildcards are confined to the file name can stay\n // shallow. A wildcard in a directory segment (`src/*/Button.tsx`) puts its\n // matches below `baseDir`, and `**` crosses directory boundaries even inside\n // the last segment, so both need the recursive walk.\n const segments = normalized.split(\"/\");\n const crossesDirectories = normalized.includes(\"**\") || segments.slice(0, -1).some(hasWildcard);\n\n const candidates: string[] = [];\n if (crossesDirectories) {\n await walkDir(baseDir, candidates);\n } else {\n const entries = await fs.promises.readdir(baseDir, { withFileTypes: true });\n for (const entry of entries) {\n if (entry.isFile()) {\n candidates.push(path.join(baseDir, entry.name));\n }\n }\n }\n\n const matcher = globToRegExp(normalized);\n for (const candidate of candidates) {\n if (matcher.test(path.relative(root, candidate).replace(/\\\\/g, \"/\"))) {\n files.push(candidate);\n }\n }\n\n return files;\n}\n\n/** Whether a pattern (or one segment of it) contains a wildcard `globToRegExp` expands. */\nfunction hasWildcard(pattern: string): boolean {\n return pattern.includes(\"*\") || pattern.includes(\"?\");\n}\n\n/** Leading path segments of a pattern that contain no wildcard. */\nfunction staticPrefix(pattern: string): string {\n const segments: string[] = [];\n for (const segment of pattern.split(\"/\")) {\n if (hasWildcard(segment)) break;\n segments.push(segment);\n }\n return segments.join(\"/\");\n}\n\n/**\n * Translates a glob into an anchored `RegExp`: `**` crosses directory\n * boundaries, `*` and `?` stay within one segment.\n */\nfunction globToRegExp(pattern: string): RegExp {\n let source = \"\";\n let index = 0;\n\n while (index < pattern.length) {\n const char = pattern[index];\n if (char === \"*\") {\n if (pattern[index + 1] === \"*\") {\n index += 2;\n if (pattern[index] === \"/\") {\n index += 1;\n source += \"(?:[^/]+/)*\";\n } else {\n source += \".*\";\n }\n continue;\n }\n source += \"[^/]*\";\n } else if (char === \"?\") {\n source += \"[^/]\";\n } else {\n source += char.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n }\n index += 1;\n }\n\n return new RegExp(`^${source}$`);\n}\n\nasync function walkDir(dir: string, files: string[]): Promise<void> {\n const entries = await fs.promises.readdir(dir, { withFileTypes: true });\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n\n if (entry.isDirectory()) {\n await walkDir(fullPath, files);\n } else if (entry.isFile()) {\n files.push(fullPath);\n }\n }\n}\n\nfunction toPascalCase(str: string): string {\n return str.replace(/[-_](\\w)/g, (_, c) => c.toUpperCase()).replace(/^\\w/, (c) => c.toUpperCase());\n}\n","import type { EnvironmentOptions } from \"vite\";\nimport type { ResolvedSolidOptions } from \"./types\";\n\nexport function createSolidMarkdownEnvironment(\n mode: \"ssr\" | \"client\",\n options: ResolvedSolidOptions,\n): EnvironmentOptions {\n const isSSR = mode === \"ssr\";\n\n return {\n build: {\n outDir: isSSR ? `${options.outDir}/.ox-content/ssr` : `${options.outDir}/.ox-content/client`,\n ssr: isSSR,\n rollupOptions: {\n output: {\n format: \"esm\",\n entryFileNames: isSSR ? \"[name].js\" : \"[name].[hash].js\",\n },\n },\n ...(isSSR && { target: \"node18\", minify: false }),\n },\n resolve: {\n // `solid` must lead: Solid libraries ship their uncompiled JSX behind that\n // condition, and the server/client split then comes from `node`/`browser`.\n conditions: isSSR ? [\"solid\", \"node\", \"import\"] : [\"solid\", \"browser\", \"import\"],\n },\n optimizeDeps: {\n include: isSSR ? [] : [\"solid-js\", \"solid-js/web\"],\n exclude: [\"@ox-content/vite-plugin\", \"@ox-content/vite-plugin-solid\"],\n },\n };\n}\n","import type { BuiltinEmbedOptions, ResolvedSolidOptions, SolidIntegrationOptions } from \"./types\";\n\nconst DEFAULT_MARKDOWN_EXTENSIONS = [\".md\", \".markdown\", \".mdx\"] as const;\n\nexport function resolveSolidOptions(\n options: SolidIntegrationOptions,\n): Omit<ResolvedSolidOptions, \"components\"> {\n return {\n srcDir: options.srcDir ?? \"docs\",\n outDir: options.outDir ?? \"dist\",\n base: options.base ?? \"/\",\n extensions: normalizeMarkdownExtensions(options.extensions),\n gfm: options.gfm ?? true,\n autolinks: options.autolinks ?? options.gfm ?? true,\n frontmatter: options.frontmatter ?? true,\n toc: options.toc ?? true,\n tocMaxDepth: options.tocMaxDepth ?? 3,\n codeAnnotations: resolveCodeAnnotationsOptions(options.codeAnnotations),\n verifySolidPlugin: options.verifySolidPlugin ?? true,\n embeds: resolveBuiltinEmbedOptions(options.embeds),\n };\n}\n\nexport function normalizeMarkdownExtensions(extensions?: readonly string[]): string[] {\n const values = extensions?.length ? extensions : DEFAULT_MARKDOWN_EXTENSIONS;\n return Array.from(\n new Map(\n values.map((extension) => {\n const value = extension.startsWith(\".\") ? extension : `.${extension}`;\n return [value.toLowerCase(), value] as const;\n }),\n ).values(),\n );\n}\n\nexport function isMarkdownFilePath(filePath: string, extensions: readonly string[]): boolean {\n const pathname = filePath.split(\"?\")[0].split(\"#\")[0].toLowerCase();\n return extensions.some((extension) => pathname.endsWith(extension.toLowerCase()));\n}\n\nfunction resolveCodeAnnotationsOptions(\n options: SolidIntegrationOptions[\"codeAnnotations\"],\n): ResolvedSolidOptions[\"codeAnnotations\"] {\n if (!options) {\n return { enabled: false, metaKey: \"annotate\" };\n }\n\n if (options === true) {\n return { enabled: true, metaKey: \"annotate\" };\n }\n\n return { enabled: true, metaKey: options.metaKey ?? \"annotate\" };\n}\n\nfunction resolveBuiltinEmbedOptions(\n options: BuiltinEmbedOptions | false | undefined,\n): ResolvedSolidOptions[\"embeds\"] {\n if (options === false) return { github: false, openGraph: false };\n return {\n github: resolveSingleEmbedOptions(options?.github),\n openGraph: resolveSingleEmbedOptions(options?.openGraph),\n };\n}\n\nfunction resolveSingleEmbedOptions<T extends object>(options: boolean | T | undefined): T | false {\n if (options === false) return false;\n if (options === true || options === undefined) return {} as T;\n return options;\n}\n","/**\n * Generates the Solid module a Markdown file compiles to.\n *\n * The output is JSX on purpose. Solid has no runtime element factory to target\n * — `vite-plugin-solid` compiles this into DOM or SSR instructions — so unlike\n * the React and Vue integrations there is no factory-call form to emit.\n */\n\nimport * as path from \"path\";\nimport type { ComponentIsland, ResolvedSolidOptions } from \"./types\";\n\nexport function generateSolidModule(\n content: string,\n usedComponents: string[],\n islands: ComponentIsland[],\n frontmatter: Record<string, unknown>,\n options: ResolvedSolidOptions & { root?: string },\n id: string,\n): string {\n const rawHtml = JSON.stringify(content);\n const frontmatterLiteral = JSON.stringify(frontmatter);\n\n // Markdown with no registered component skips the island runtime entirely and\n // compiles to a single `innerHTML` binding — no imports needed, because Solid\n // injects whatever its compiled output requires.\n if (islands.length === 0) {\n return `\nexport const frontmatter = ${frontmatterLiteral};\n\nconst rawHtml = ${rawHtml};\n\nexport default function MarkdownContent() {\n return <div class=\"ox-content\" innerHTML={rawHtml} />;\n}\n`;\n }\n\n const imports = renderComponentImports(usedComponents, options, id);\n const componentMap = usedComponents.map((name) => ` ${name},`).join(\"\\n\");\n\n return `\nimport { onCleanup, onMount } from 'solid-js';\nimport { render } from 'solid-js/web';\nimport { initIslands } from '@ox-content/islands';\n${imports}\n\nexport const frontmatter = ${frontmatterLiteral};\n\nconst rawHtml = ${rawHtml};\nconst components = {\n${componentMap}\n};\n\nfunction createSolidHydrate() {\n return (element, props) => {\n const componentName = element.dataset.oxIsland;\n const Component = components[componentName];\n if (!Component) return;\n\n // Read the slot content before clearing: the island element still holds the\n // markup the Markdown transform left behind.\n const islandContent = element.dataset.oxContent || element.innerHTML;\n element.innerHTML = '';\n\n const dispose = render(\n () =>\n islandContent\n ? <Component {...props}><div innerHTML={islandContent} /></Component>\n : <Component {...props} />,\n element,\n );\n\n return () => dispose();\n };\n}\n\nexport default function MarkdownContent() {\n let container;\n\n onMount(() => {\n if (!container) return;\n const controller = initIslands(createSolidHydrate(), {\n selector: '.ox-content [data-ox-island]',\n });\n onCleanup(() => controller.destroy());\n });\n\n return <div class=\"ox-content\" ref={container} innerHTML={rawHtml} />;\n}\n`;\n}\n\n/** Rewrites registered component paths as imports relative to the Markdown file. */\nfunction renderComponentImports(\n usedComponents: string[],\n options: ResolvedSolidOptions & { root?: string },\n id: string,\n): string {\n const mdDir = path.dirname(id);\n const root = options.root || process.cwd();\n\n return usedComponents\n .map((name) => {\n const componentPath = options.components[name];\n if (!componentPath) return \"\";\n const absolutePath = path.resolve(root, componentPath.replace(/^\\.\\//, \"\"));\n const relativePath = path.relative(mdDir, absolutePath).replace(/\\\\/g, \"/\");\n const importPath = relativePath.startsWith(\".\") ? relativePath : \"./\" + relativePath;\n return `import ${name} from '${importPath}';`;\n })\n .filter(Boolean)\n .join(\"\\n\");\n}\n","/**\n * Markdown-side scanning shared by the Solid transform: locating component\n * tags, keeping fenced samples literal, and round-tripping islands through the\n * rendered HTML as placeholder markers.\n */\n\nimport type { ComponentIsland, ComponentsMap } from \"./types\";\n\nconst COMPONENT_REGEX = /<([A-Z][a-zA-Z0-9]*)\\s*([^>]*?)\\s*(?:\\/>|>([\\s\\S]*?)<\\/\\1>)/g;\nconst PROP_REGEX = /([a-zA-Z0-9-]+)(?:=(?:\"([^\"]*)\"|'([^']*)'|{([^}]*)}|\\[([^\\]]*)\\]))?/g;\n\nconst ISLAND_MARKER_PREFIX = \"OXCONTENT-ISLAND-\";\nconst ISLAND_MARKER_SUFFIX = \"-PLACEHOLDER\";\n\ninterface Range {\n start: number;\n end: number;\n}\n\nexport interface ScannedMarkdown {\n /** Markdown with component tags replaced by island placeholder markers. */\n content: string;\n islands: ComponentIsland[];\n usedComponents: string[];\n}\n\n/**\n * Replaces every registered component tag with a placeholder marker that\n * survives Markdown rendering, so the island can be re-attached to the produced\n * HTML afterwards. Tags inside fenced code blocks are left as literal text.\n */\nexport function scanComponents(markdown: string, components: ComponentsMap): ScannedMarkdown {\n const usedComponents: string[] = [];\n const islands: ComponentIsland[] = [];\n const fenceRanges = collectFenceRanges(markdown);\n\n let islandIndex = 0;\n let content = \"\";\n let lastIndex = 0;\n let match: RegExpExecArray | null;\n\n COMPONENT_REGEX.lastIndex = 0;\n while ((match = COMPONENT_REGEX.exec(markdown)) !== null) {\n const [fullMatch, componentName, propsString, rawIslandContent] = match;\n const matchStart = match.index;\n const matchEnd = matchStart + fullMatch.length;\n\n if (\n !Object.prototype.hasOwnProperty.call(components, componentName) ||\n isInRanges(matchStart, matchEnd, fenceRanges)\n ) {\n content += markdown.slice(lastIndex, matchEnd);\n lastIndex = matchEnd;\n continue;\n }\n\n if (!usedComponents.includes(componentName)) {\n usedComponents.push(componentName);\n }\n\n const islandId = `ox-island-${islandIndex++}`;\n islands.push({\n name: componentName,\n props: parseProps(propsString),\n position: matchStart,\n id: islandId,\n content: typeof rawIslandContent === \"string\" ? rawIslandContent.trim() : undefined,\n });\n\n content += markdown.slice(lastIndex, matchStart) + createIslandMarker(islandId);\n lastIndex = matchEnd;\n }\n\n content += markdown.slice(lastIndex);\n\n return { content, islands, usedComponents };\n}\n\n/** Swaps the placeholder markers in rendered HTML for island mount points. */\nexport function injectIslandMarkers(html: string, islands: ComponentIsland[]): string {\n let output = html;\n\n for (const island of islands) {\n const marker = createIslandMarker(island.id);\n const propsAttr =\n Object.keys(island.props).length > 0\n ? ` data-ox-props='${JSON.stringify(island.props).replace(/'/g, \"'\")}'`\n : \"\";\n const contentAttr = island.content\n ? ` data-ox-content='${island.content.replace(/'/g, \"'\")}'`\n : \"\";\n const attrs = `data-ox-island=\"${island.name}\"${propsAttr}${contentAttr}`;\n output = output.replaceAll(`<p>${marker}</p>`, `<div ${attrs}></div>`);\n output = output.replaceAll(marker, `<span ${attrs}></span>`);\n }\n\n return output;\n}\n\nexport function extractFrontmatter(content: string): {\n content: string;\n frontmatter: Record<string, unknown>;\n} {\n const frontmatterRegex = /^---\\n([\\s\\S]*?)\\n---\\n/;\n const match = frontmatterRegex.exec(content);\n\n if (!match) {\n return { content, frontmatter: {} };\n }\n\n const frontmatter: Record<string, unknown> = {};\n\n for (const line of match[1].split(\"\\n\")) {\n const colonIndex = line.indexOf(\":\");\n if (colonIndex > 0) {\n const key = line.slice(0, colonIndex).trim();\n let value: unknown = line.slice(colonIndex + 1).trim();\n try {\n value = JSON.parse(value as string);\n } catch {\n if (\n typeof value === \"string\" &&\n ((value.startsWith('\"') && value.endsWith('\"')) ||\n (value.startsWith(\"'\") && value.endsWith(\"'\")))\n ) {\n value = value.slice(1, -1);\n }\n }\n frontmatter[key] = value;\n }\n }\n\n return { content: content.slice(match[0].length), frontmatter };\n}\n\nfunction createIslandMarker(islandId: string): string {\n return `${ISLAND_MARKER_PREFIX}${islandId}${ISLAND_MARKER_SUFFIX}`;\n}\n\nfunction collectFenceRanges(content: string): Range[] {\n const ranges: Range[] = [];\n let inFence = false;\n let fenceChar = \"\";\n let fenceLength = 0;\n let fenceStart = 0;\n let pos = 0;\n\n while (pos < content.length) {\n const lineEnd = content.indexOf(\"\\n\", pos);\n const next = lineEnd === -1 ? content.length : lineEnd + 1;\n const line = content.slice(pos, lineEnd === -1 ? content.length : lineEnd);\n const fenceMatch = line.match(/^\\s{0,3}([`~]{3,})/);\n\n if (fenceMatch) {\n const marker = fenceMatch[1];\n if (!inFence) {\n inFence = true;\n fenceChar = marker[0];\n fenceLength = marker.length;\n fenceStart = pos;\n } else if (marker[0] === fenceChar && marker.length >= fenceLength) {\n inFence = false;\n ranges.push({ start: fenceStart, end: next });\n fenceChar = \"\";\n fenceLength = 0;\n }\n }\n\n pos = next;\n }\n\n if (inFence) {\n ranges.push({ start: fenceStart, end: content.length });\n }\n\n return ranges;\n}\n\nfunction isInRanges(start: number, end: number, ranges: Range[]): boolean {\n for (const range of ranges) {\n if (start < range.end && end > range.start) {\n return true;\n }\n }\n return false;\n}\n\nfunction parseProps(propsString: string): Record<string, unknown> {\n const props: Record<string, unknown> = {};\n if (!propsString) return props;\n\n PROP_REGEX.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = PROP_REGEX.exec(propsString)) !== null) {\n const [, name, doubleQuoted, singleQuoted, braceValue, bracketValue] = match;\n if (!name) continue;\n\n if (doubleQuoted !== undefined) props[name] = doubleQuoted;\n else if (singleQuoted !== undefined) props[name] = singleQuoted;\n else if (braceValue !== undefined) {\n try {\n props[name] = JSON.parse(braceValue);\n } catch {\n props[name] = braceValue;\n }\n } else if (bracketValue !== undefined) {\n try {\n props[name] = JSON.parse(`[${bracketValue}]`);\n } catch {\n props[name] = bracketValue;\n }\n } else props[name] = true;\n }\n\n return props;\n}\n","import { transformMarkdown as baseTransformMarkdown } from \"@ox-content/vite-plugin\";\nimport { generateSolidModule } from \"./codegen\";\nimport { extractFrontmatter, injectIslandMarkers, scanComponents } from \"./markdown\";\nimport type { ResolvedSolidOptions, SolidTransformResult } from \"./types\";\n\nexport async function transformMarkdownWithSolid(\n code: string,\n id: string,\n options: ResolvedSolidOptions,\n): Promise<SolidTransformResult> {\n // `frontmatter: false` means the body is taken verbatim, so a leading `---`\n // block stays in the rendered document instead of becoming module exports.\n const { content: markdownContent, frontmatter } = options.frontmatter\n ? extractFrontmatter(code)\n : { content: code, frontmatter: {} };\n const scanned = scanComponents(markdownContent, options.components);\n\n const transformed = await baseTransformMarkdown(scanned.content, id, createBaseOptions(options));\n\n const htmlWithIslands = injectIslandMarkers(transformed.html, scanned.islands);\n\n return {\n code: generateSolidModule(\n htmlWithIslands,\n scanned.usedComponents,\n scanned.islands,\n frontmatter,\n options,\n id,\n ),\n map: null,\n usedComponents: scanned.usedComponents,\n frontmatter,\n };\n}\n\n/**\n * Options handed to the core Markdown transform.\n *\n * The site-level features (SSG, search, OG images, highlighting) are turned off\n * here: this path only produces the HTML that gets embedded in a Solid module,\n * and the host app owns everything around it. Frontmatter is stripped before\n * this point, so the core parser sees a body-only document.\n */\nfunction createBaseOptions(\n options: ResolvedSolidOptions,\n): Parameters<typeof baseTransformMarkdown>[2] {\n return {\n srcDir: options.srcDir,\n outDir: options.outDir,\n base: options.base,\n extensions: options.extensions,\n ssg: {\n enabled: false,\n extension: \".html\",\n clean: false,\n bare: false,\n generateOgImage: false,\n lastUpdated: false,\n },\n gfm: options.gfm,\n frontmatter: false,\n toc: options.toc,\n tocMaxDepth: options.tocMaxDepth,\n codeAnnotations: options.codeAnnotations,\n footnotes: true,\n tables: true,\n taskLists: true,\n strikethrough: true,\n autolinks: options.autolinks,\n highlight: false,\n highlightTheme: \"github-dark\",\n highlightLangs: [],\n mermaid: false,\n ogImage: false,\n ogImageOptions: {\n vuePlugin: \"vitejs\",\n width: 1200,\n height: 630,\n cache: true,\n concurrency: 1,\n },\n transformers: [],\n docs: false,\n ogViewer: false,\n search: {\n enabled: false,\n limit: 10,\n prefix: true,\n placeholder: \"Search...\",\n hotkey: \"k\",\n },\n embeds: options.embeds,\n i18n: false,\n } as unknown as Parameters<typeof baseTransformMarkdown>[2];\n}\n","/**\n * Guards against the two ways `vite-plugin-solid` can fail to compile the\n * Markdown modules this plugin emits.\n *\n * Both are configuration mistakes with silent-until-cryptic failure modes, so\n * each is checked as early as it can be observed: plugin presence and ordering\n * are known once the config resolves, while the `extensions` option is held in\n * the Solid plugin's closure and can only be inferred from whether the generated\n * JSX actually got compiled.\n */\n\nimport type { ResolvedConfig } from \"vite\";\n\nexport const TRANSFORM_PLUGIN_NAME = \"ox-content:solid-transform\";\n\nconst SOLID_PLUGIN_NAME = \"solid\";\n\n/**\n * Emitted by both generated module shapes. Solid's JSX has no runtime factory,\n * so this attribute only survives into the final module when nothing compiled\n * the JSX away — which is exactly the misconfiguration worth reporting.\n */\nexport const UNCOMPILED_JSX_MARKER = \"innerHTML={rawHtml}\";\n\nexport function formatSolidPluginError(reason: \"missing\" | \"ordering\" | \"extensions\"): string {\n const example = [\n \" plugins: [\",\n \" oxContentSolid({ srcDir: 'docs' }),\",\n \" solid({ extensions: ['.md', '.markdown', '.mdx'] }),\",\n \" ]\",\n ].join(\"\\n\");\n\n const detail = {\n missing:\n \"vite-plugin-solid was not found in the Vite config. Markdown files are emitted as Solid JSX, which only runs after babel-preset-solid compiles it.\",\n ordering:\n \"vite-plugin-solid runs before oxContentSolid(), so it sees raw Markdown instead of the generated JSX. Both plugins are `enforce: 'pre'`, so their order follows the `plugins` array.\",\n extensions:\n \"vite-plugin-solid did not compile the generated Markdown module. Its `extensions` option must list the Markdown extensions; by default it only looks at .jsx/.tsx files.\",\n }[reason];\n\n return `[ox-content:solid] ${detail}\\n\\n${example}\\n`;\n}\n\n/**\n * Throws when `vite-plugin-solid` is absent, or placed where it would see raw\n * Markdown instead of the JSX this plugin generates.\n */\nexport function verifySolidPluginOrder(config: ResolvedConfig): void {\n const names = config.plugins.map((plugin) => plugin.name);\n const solidIndex = names.indexOf(SOLID_PLUGIN_NAME);\n\n if (solidIndex === -1) {\n throw new Error(formatSolidPluginError(\"missing\"));\n }\n\n const transformIndex = names.indexOf(TRANSFORM_PLUGIN_NAME);\n if (transformIndex !== -1 && solidIndex < transformIndex) {\n throw new Error(formatSolidPluginError(\"ordering\"));\n }\n}\n","/**\n * Vite Plugin for Ox Content Solid Integration\n *\n * Uses Vite's Environment API to enable embedding Solid components in Markdown.\n */\n\nimport type { Plugin, PluginOption, ResolvedConfig } from \"vite\";\nimport { oxContent } from \"@ox-content/vite-plugin\";\nimport { resolveComponentsGlob } from \"./components\";\nimport { createSolidMarkdownEnvironment } from \"./environment\";\nimport { isMarkdownFilePath, resolveSolidOptions } from \"./options\";\nimport { transformMarkdownWithSolid } from \"./transform\";\nimport {\n formatSolidPluginError,\n TRANSFORM_PLUGIN_NAME,\n UNCOMPILED_JSX_MARKER,\n verifySolidPluginOrder,\n} from \"./verify\";\nimport type { SolidIntegrationOptions } from \"./types\";\n\nexport type {\n SolidIntegrationOptions,\n ResolvedSolidOptions,\n ComponentsOption,\n ComponentsMap,\n BuiltinEmbedOptions,\n GitHubEmbedOptions,\n OpenGraphEmbedOptions,\n ResolvedBuiltinEmbedOptions,\n SolidTransformResult,\n ComponentIsland,\n} from \"./types\";\n\n/**\n * Creates the Ox Content Solid integration plugin.\n *\n * Unlike the React and Svelte integrations, this plugin must be listed **before**\n * `vite-plugin-solid`, and that plugin must be told about the Markdown\n * extensions. Markdown is turned into Solid JSX here, and Solid's JSX is\n * compile-time only — `vite-plugin-solid` is what turns it into DOM or SSR\n * instructions.\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { defineConfig } from 'vite';\n * import solid from 'vite-plugin-solid';\n * import { oxContentSolid } from '@ox-content/vite-plugin-solid';\n *\n * export default defineConfig({\n * plugins: [\n * oxContentSolid({\n * srcDir: 'docs',\n * components: {\n * Counter: './src/components/Counter.tsx',\n * },\n * }),\n * solid({ extensions: ['.md', '.markdown', '.mdx'] }),\n * ],\n * });\n * ```\n */\nexport function oxContentSolid(options: SolidIntegrationOptions = {}): PluginOption[] {\n const resolved = resolveSolidOptions(options);\n let componentMap = new Map<string, string>();\n let config: ResolvedConfig;\n\n if (typeof options.components === \"object\" && !Array.isArray(options.components)) {\n componentMap = new Map(Object.entries(options.components));\n }\n\n const solidTransformPlugin: Plugin = {\n name: TRANSFORM_PLUGIN_NAME,\n enforce: \"pre\",\n\n async configResolved(resolvedConfig) {\n config = resolvedConfig;\n\n if (resolved.verifySolidPlugin) {\n verifySolidPluginOrder(resolvedConfig);\n }\n\n const componentsOption = options.components;\n if (componentsOption) {\n const resolvedComponents = await resolveComponentsGlob(componentsOption, config.root);\n componentMap = new Map(Object.entries(resolvedComponents));\n }\n },\n\n async transform(code, id) {\n if (!isMarkdownFilePath(id, resolved.extensions)) {\n return null;\n }\n\n const result = await transformMarkdownWithSolid(code, id, {\n ...resolved,\n components: Object.fromEntries(componentMap),\n root: config.root,\n });\n\n return {\n code: result.code,\n map: result.map,\n };\n },\n };\n\n // `post` so every `pre`/normal plugin — vite-plugin-solid included — has\n // already had its turn at the module.\n const solidVerifyPlugin: Plugin = {\n name: \"ox-content:solid-verify\",\n enforce: \"post\",\n\n transform(code, id) {\n if (!resolved.verifySolidPlugin) return null;\n if (!isMarkdownFilePath(id, resolved.extensions)) return null;\n if (!code.includes(UNCOMPILED_JSX_MARKER)) return null;\n\n this.error(formatSolidPluginError(\"extensions\"));\n },\n };\n\n const solidEnvironmentPlugin: Plugin = {\n name: \"ox-content:solid-environment\",\n\n config() {\n const envOptions = {\n ...resolved,\n components: Object.fromEntries(componentMap),\n };\n return {\n environments: {\n oxcontent_ssr: createSolidMarkdownEnvironment(\"ssr\", envOptions),\n oxcontent_client: createSolidMarkdownEnvironment(\"client\", envOptions),\n },\n };\n },\n\n resolveId(id) {\n if (id === \"virtual:ox-content-solid/components\") {\n return \"\\0virtual:ox-content-solid/components\";\n }\n return null;\n },\n\n load(id) {\n if (id === \"\\0virtual:ox-content-solid/components\") {\n return generateComponentsModule(componentMap);\n }\n return null;\n },\n\n applyToEnvironment(environment) {\n return [\"oxcontent_ssr\", \"oxcontent_client\", \"client\", \"ssr\"].includes(environment.name);\n },\n };\n\n const solidHmrPlugin: Plugin = {\n name: \"ox-content:solid-hmr\",\n apply: \"serve\",\n\n handleHotUpdate({ file, server, modules }) {\n const isComponent = Array.from(componentMap.values()).some((path) =>\n file.endsWith(path.replace(/^\\.\\//, \"\")),\n );\n\n if (isComponent) {\n const mdModules = Array.from(server.moduleGraph.idToModuleMap.values()).filter(\n (mod) => mod.file && isMarkdownFilePath(mod.file, resolved.extensions),\n );\n\n if (mdModules.length > 0) {\n server.ws.send({\n type: \"custom\",\n event: \"ox-content:solid-update\",\n data: { file },\n });\n return [...modules, ...mdModules];\n }\n }\n\n return modules;\n },\n };\n\n const basePlugins = oxContent(options).flatMap((plugin) =>\n Array.isArray(plugin) ? plugin : [plugin],\n ) as Plugin[];\n const environmentPlugin = basePlugins.find((plugin) => plugin.name === \"ox-content:environment\");\n const plugins: Plugin[] = [\n solidTransformPlugin,\n solidVerifyPlugin,\n solidEnvironmentPlugin,\n solidHmrPlugin,\n ];\n\n if (environmentPlugin) {\n plugins.push(environmentPlugin);\n }\n\n return plugins;\n}\n\nfunction generateComponentsModule(componentMap: Map<string, string>): string {\n const imports: string[] = [];\n const exports: string[] = [];\n\n componentMap.forEach((path, name) => {\n imports.push(`import ${name} from '${path}';`);\n exports.push(` ${name},`);\n });\n\n return `\n${imports.join(\"\\n\")}\n\nexport const components = {\n${exports.join(\"\\n\")}\n};\n\nexport default components;\n`;\n}\n\nexport { oxContent } from \"@ox-content/vite-plugin\";\n"],"mappings":";;;;;;;;AASA,eAAsB,sBACpB,kBACA,MACwB;CACxB,IAAI,OAAO,qBAAqB,YAAY,CAAC,MAAM,QAAQ,iBAAiB,EAC1E,OAAO;CAGT,MAAM,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W,CACvE;IAED,IAAI,UAAU,SAAS,GAAG;KACxB,OAAO,GAAG,KAAK;MACb,MAAM;MACN,OAAO;MACP,MAAM,EAAE,MAAM;MACf,CAAC;KACF,OAAO,CAAC,GAAG,SAAS,GAAG,UAAU;;;GAIrC,OAAO;;EAEV;CAKD,MAAM,oBAHcC,YAAU,QAAQ,CAAC,SAAS,WAC9C,MAAM,QAAQ,OAAO,GAAG,SAAS,CAAC,OAAO,CAEN,CAAC,MAAM,WAAW,OAAO,SAAS,yBAAyB;CAChG,MAAM,UAAoB;EACxB;EACA;EACA;EACA;EACD;CAED,IAAI,mBACF,QAAQ,KAAK,kBAAkB;CAGjC,OAAO;;AAGT,SAAS,yBAAyB,cAA2C;CAC3E,MAAM,UAAoB,EAAE;CAC5B,MAAM,UAAoB,EAAE;CAE5B,aAAa,SAAS,MAAM,SAAS;EACnC,QAAQ,KAAK,UAAU,KAAK,SAAS,KAAK,IAAI;EAC9C,QAAQ,KAAK,KAAK,KAAK,GAAG;GAC1B;CAEF,OAAO;EACP,QAAQ,KAAK,KAAK,CAAC;;;EAGnB,QAAQ,KAAK,KAAK,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["baseTransformMarkdown","oxContent"],"sources":["../src/components.ts","../src/environment.ts","../src/options.ts","../src/codegen.ts","../src/markdown.ts","../src/transform.ts","../src/verify.ts","../src/index.ts"],"sourcesContent":["/**\n * Resolves the `components` option into a name → path map, expanding glob\n * patterns against the Vite project root.\n */\n\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport type { ComponentsMap, ComponentsOption } from \"./types\";\n\nexport async function resolveComponentsGlob(\n componentsOption: ComponentsOption,\n root: string,\n): Promise<ComponentsMap> {\n if (typeof componentsOption === \"object\" && !Array.isArray(componentsOption)) {\n return componentsOption;\n }\n\n const patterns = Array.isArray(componentsOption) ? componentsOption : [componentsOption];\n const result: ComponentsMap = {};\n\n for (const pattern of patterns) {\n for (const file of await globFiles(pattern, root)) {\n const baseName = path.basename(file, path.extname(file));\n const relativePath = \"./\" + path.relative(root, file).replace(/\\\\/g, \"/\");\n result[toPascalCase(baseName)] = relativePath;\n }\n }\n\n return result;\n}\n\nasync function globFiles(pattern: string, root: string): Promise<string[]> {\n const files: string[] = [];\n const normalized = pattern.replace(/\\\\/g, \"/\").replace(/^\\.\\//, \"\");\n\n if (!hasWildcard(normalized)) {\n const fullPath = path.resolve(root, normalized);\n if (fs.existsSync(fullPath)) {\n files.push(fullPath);\n }\n return files;\n }\n\n // Walk from the deepest wildcard-free prefix, then keep only the paths the\n // whole pattern matches. Deriving the base directory alone is not enough:\n // `src/components/**/*.tsx` must not collect the non-component files below\n // `src/components`, and the generated module would fail to import them.\n const baseDir = path.resolve(root, staticPrefix(normalized));\n if (!fs.existsSync(baseDir)) {\n return files;\n }\n\n // Only a pattern whose wildcards are confined to the file name can stay\n // shallow. A wildcard in a directory segment (`src/*/Button.tsx`) puts its\n // matches below `baseDir`, and `**` crosses directory boundaries even inside\n // the last segment, so both need the recursive walk.\n const segments = normalized.split(\"/\");\n const crossesDirectories = normalized.includes(\"**\") || segments.slice(0, -1).some(hasWildcard);\n\n const candidates: string[] = [];\n if (crossesDirectories) {\n await walkDir(baseDir, candidates);\n } else {\n const entries = await fs.promises.readdir(baseDir, { withFileTypes: true });\n for (const entry of entries) {\n if (entry.isFile()) {\n candidates.push(path.join(baseDir, entry.name));\n }\n }\n }\n\n const matcher = globToRegExp(normalized);\n for (const candidate of candidates) {\n if (matcher.test(path.relative(root, candidate).replace(/\\\\/g, \"/\"))) {\n files.push(candidate);\n }\n }\n\n return files;\n}\n\n/** Whether a pattern (or one segment of it) contains a wildcard `globToRegExp` expands. */\nfunction hasWildcard(pattern: string): boolean {\n return pattern.includes(\"*\") || pattern.includes(\"?\");\n}\n\n/** Leading path segments of a pattern that contain no wildcard. */\nfunction staticPrefix(pattern: string): string {\n const segments: string[] = [];\n for (const segment of pattern.split(\"/\")) {\n if (hasWildcard(segment)) break;\n segments.push(segment);\n }\n return segments.join(\"/\");\n}\n\n/**\n * Translates a glob into an anchored `RegExp`: `**` crosses directory\n * boundaries, `*` and `?` stay within one segment.\n */\nfunction globToRegExp(pattern: string): RegExp {\n let source = \"\";\n let index = 0;\n\n while (index < pattern.length) {\n const char = pattern[index];\n if (char === \"*\") {\n if (pattern[index + 1] === \"*\") {\n index += 2;\n if (pattern[index] === \"/\") {\n index += 1;\n source += \"(?:[^/]+/)*\";\n } else {\n source += \".*\";\n }\n continue;\n }\n source += \"[^/]*\";\n } else if (char === \"?\") {\n source += \"[^/]\";\n } else {\n source += char.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n }\n index += 1;\n }\n\n return new RegExp(`^${source}$`);\n}\n\nasync function walkDir(dir: string, files: string[]): Promise<void> {\n const entries = await fs.promises.readdir(dir, { withFileTypes: true });\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n\n if (entry.isDirectory()) {\n await walkDir(fullPath, files);\n } else if (entry.isFile()) {\n files.push(fullPath);\n }\n }\n}\n\nfunction toPascalCase(str: string): string {\n return str.replace(/[-_](\\w)/g, (_, c) => c.toUpperCase()).replace(/^\\w/, (c) => c.toUpperCase());\n}\n","import type { EnvironmentOptions } from \"vite\";\nimport type { ResolvedSolidOptions } from \"./types\";\n\nexport function createSolidMarkdownEnvironment(\n mode: \"ssr\" | \"client\",\n options: ResolvedSolidOptions,\n): EnvironmentOptions {\n const isSSR = mode === \"ssr\";\n\n return {\n build: {\n outDir: isSSR ? `${options.outDir}/.ox-content/ssr` : `${options.outDir}/.ox-content/client`,\n ssr: isSSR,\n rollupOptions: {\n output: {\n format: \"esm\",\n entryFileNames: isSSR ? \"[name].js\" : \"[name].[hash].js\",\n },\n },\n ...(isSSR && { target: \"node18\", minify: false }),\n },\n resolve: {\n // `solid` must lead: Solid libraries ship their uncompiled JSX behind that\n // condition, and the server/client split then comes from `node`/`browser`.\n conditions: isSSR ? [\"solid\", \"node\", \"import\"] : [\"solid\", \"browser\", \"import\"],\n },\n optimizeDeps: {\n include: isSSR ? [] : [\"solid-js\", \"solid-js/web\"],\n exclude: [\"@ox-content/vite-plugin\", \"@ox-content/vite-plugin-solid\"],\n },\n };\n}\n","import type { BuiltinEmbedOptions, ResolvedSolidOptions, SolidIntegrationOptions } from \"./types\";\n\nconst DEFAULT_MARKDOWN_EXTENSIONS = [\".md\", \".markdown\", \".mdx\"] as const;\n\nexport function resolveSolidOptions(\n options: SolidIntegrationOptions,\n): Omit<ResolvedSolidOptions, \"components\"> {\n return {\n srcDir: options.srcDir ?? \"docs\",\n outDir: options.outDir ?? \"dist\",\n base: options.base ?? \"/\",\n extensions: normalizeMarkdownExtensions(options.extensions),\n gfm: options.gfm ?? true,\n autolinks: options.autolinks ?? options.gfm ?? true,\n frontmatter: options.frontmatter ?? true,\n toc: options.toc ?? true,\n tocMaxDepth: options.tocMaxDepth ?? 3,\n codeAnnotations: resolveCodeAnnotationsOptions(options.codeAnnotations),\n verifySolidPlugin: options.verifySolidPlugin ?? true,\n embeds: resolveBuiltinEmbedOptions(options.embeds),\n };\n}\n\nexport function normalizeMarkdownExtensions(extensions?: readonly string[]): string[] {\n const values = extensions?.length ? extensions : DEFAULT_MARKDOWN_EXTENSIONS;\n return Array.from(\n new Map(\n values.map((extension) => {\n const value = extension.startsWith(\".\") ? extension : `.${extension}`;\n return [value.toLowerCase(), value] as const;\n }),\n ).values(),\n );\n}\n\nexport function isMarkdownFilePath(filePath: string, extensions: readonly string[]): boolean {\n const pathname = filePath.split(\"?\")[0].split(\"#\")[0].toLowerCase();\n return extensions.some((extension) => pathname.endsWith(extension.toLowerCase()));\n}\n\nfunction resolveCodeAnnotationsOptions(\n options: SolidIntegrationOptions[\"codeAnnotations\"],\n): ResolvedSolidOptions[\"codeAnnotations\"] {\n if (!options) {\n return { enabled: false, metaKey: \"annotate\" };\n }\n\n if (options === true) {\n return { enabled: true, metaKey: \"annotate\" };\n }\n\n return { enabled: true, metaKey: options.metaKey ?? \"annotate\" };\n}\n\nfunction resolveBuiltinEmbedOptions(\n options: BuiltinEmbedOptions | false | undefined,\n): ResolvedSolidOptions[\"embeds\"] {\n if (options === false) return { github: false, openGraph: false };\n return {\n github: resolveSingleEmbedOptions(options?.github),\n openGraph: resolveSingleEmbedOptions(options?.openGraph),\n };\n}\n\nfunction resolveSingleEmbedOptions<T extends object>(options: boolean | T | undefined): T | false {\n if (options === false) return false;\n if (options === true || options === undefined) return {} as T;\n return options;\n}\n","/**\n * Generates the Solid module a Markdown file compiles to.\n *\n * The output is JSX on purpose. Solid has no runtime element factory to target\n * — `vite-plugin-solid` compiles this into DOM or SSR instructions — so unlike\n * the React and Vue integrations there is no factory-call form to emit.\n */\n\nimport * as path from \"path\";\nimport type { ComponentIsland, ResolvedSolidOptions } from \"./types\";\n\nexport function generateSolidModule(\n content: string,\n usedComponents: string[],\n islands: ComponentIsland[],\n frontmatter: Record<string, unknown>,\n options: ResolvedSolidOptions & { root?: string },\n id: string,\n): string {\n const rawHtml = JSON.stringify(content);\n const frontmatterLiteral = JSON.stringify(frontmatter);\n\n // Markdown with no registered component skips the island runtime entirely and\n // compiles to a single `innerHTML` binding — no imports needed, because Solid\n // injects whatever its compiled output requires.\n if (islands.length === 0) {\n return `\nexport const frontmatter = ${frontmatterLiteral};\n\nconst rawHtml = ${rawHtml};\n\nexport default function MarkdownContent() {\n return <div class=\"ox-content\" innerHTML={rawHtml} />;\n}\n`;\n }\n\n const imports = renderComponentImports(usedComponents, options, id);\n const componentMap = usedComponents.map((name) => ` ${name},`).join(\"\\n\");\n\n return `\nimport { onCleanup, onMount } from 'solid-js';\nimport { render } from 'solid-js/web';\nimport { initIslands } from '@ox-content/islands';\n${imports}\n\nexport const frontmatter = ${frontmatterLiteral};\n\nconst rawHtml = ${rawHtml};\nconst components = {\n${componentMap}\n};\n\nfunction createSolidHydrate() {\n return (element, props) => {\n const componentName = element.dataset.oxIsland;\n const Component = components[componentName];\n if (!Component) return;\n\n // Read the slot content before clearing: the island element still holds the\n // markup the Markdown transform left behind.\n const islandContent = element.dataset.oxContent || element.innerHTML;\n element.innerHTML = '';\n\n const dispose = render(\n () =>\n islandContent\n ? <Component {...props}><div innerHTML={islandContent} /></Component>\n : <Component {...props} />,\n element,\n );\n\n return () => dispose();\n };\n}\n\nexport default function MarkdownContent() {\n let container;\n\n onMount(() => {\n if (!container) return;\n const controller = initIslands(createSolidHydrate(), {\n selector: '.ox-content [data-ox-island]',\n });\n onCleanup(() => controller.destroy());\n });\n\n return <div class=\"ox-content\" ref={container} innerHTML={rawHtml} />;\n}\n`;\n}\n\n/** Rewrites registered component paths as imports relative to the Markdown file. */\nfunction renderComponentImports(\n usedComponents: string[],\n options: ResolvedSolidOptions & { root?: string },\n id: string,\n): string {\n const mdDir = path.dirname(id);\n const root = options.root || process.cwd();\n\n return usedComponents\n .map((name) => {\n const componentPath = options.components[name];\n if (!componentPath) return \"\";\n const absolutePath = path.resolve(root, componentPath.replace(/^\\.\\//, \"\"));\n const relativePath = path.relative(mdDir, absolutePath).replace(/\\\\/g, \"/\");\n const importPath = relativePath.startsWith(\".\") ? relativePath : \"./\" + relativePath;\n return `import ${name} from '${importPath}';`;\n })\n .filter(Boolean)\n .join(\"\\n\");\n}\n","/**\n * Markdown-side scanning shared by the Solid transform: locating component\n * tags, keeping fenced samples literal, and round-tripping islands through the\n * rendered HTML as placeholder markers.\n */\n\nimport type { ComponentIsland, ComponentsMap } from \"./types\";\n\nconst COMPONENT_REGEX = /<([A-Z][a-zA-Z0-9]*)\\s*([^>]*?)\\s*(?:\\/>|>([\\s\\S]*?)<\\/\\1>)/g;\nconst PROP_REGEX = /([a-zA-Z0-9-]+)(?:=(?:\"([^\"]*)\"|'([^']*)'|{([^}]*)}|\\[([^\\]]*)\\]))?/g;\n\nconst ISLAND_MARKER_PREFIX = \"OXCONTENT-ISLAND-\";\nconst ISLAND_MARKER_SUFFIX = \"-PLACEHOLDER\";\n\ninterface Range {\n start: number;\n end: number;\n}\n\nexport interface ScannedMarkdown {\n /** Markdown with component tags replaced by island placeholder markers. */\n content: string;\n islands: ComponentIsland[];\n usedComponents: string[];\n}\n\n/**\n * Replaces every registered component tag with a placeholder marker that\n * survives Markdown rendering, so the island can be re-attached to the produced\n * HTML afterwards. Tags inside fenced code blocks are left as literal text.\n */\nexport function scanComponents(markdown: string, components: ComponentsMap): ScannedMarkdown {\n const usedComponents: string[] = [];\n const islands: ComponentIsland[] = [];\n const fenceRanges = collectFenceRanges(markdown);\n\n let islandIndex = 0;\n let content = \"\";\n let lastIndex = 0;\n let match: RegExpExecArray | null;\n\n COMPONENT_REGEX.lastIndex = 0;\n while ((match = COMPONENT_REGEX.exec(markdown)) !== null) {\n const [fullMatch, componentName, propsString, rawIslandContent] = match;\n const matchStart = match.index;\n const matchEnd = matchStart + fullMatch.length;\n\n if (\n !Object.prototype.hasOwnProperty.call(components, componentName) ||\n isInRanges(matchStart, matchEnd, fenceRanges)\n ) {\n content += markdown.slice(lastIndex, matchEnd);\n lastIndex = matchEnd;\n continue;\n }\n\n if (!usedComponents.includes(componentName)) {\n usedComponents.push(componentName);\n }\n\n const islandId = `ox-island-${islandIndex++}`;\n islands.push({\n name: componentName,\n props: parseProps(propsString),\n position: matchStart,\n id: islandId,\n content: typeof rawIslandContent === \"string\" ? rawIslandContent.trim() : undefined,\n });\n\n content += markdown.slice(lastIndex, matchStart) + createIslandMarker(islandId);\n lastIndex = matchEnd;\n }\n\n content += markdown.slice(lastIndex);\n\n return { content, islands, usedComponents };\n}\n\n/** Swaps the placeholder markers in rendered HTML for island mount points. */\nexport function injectIslandMarkers(html: string, islands: ComponentIsland[]): string {\n let output = html;\n\n for (const island of islands) {\n const marker = createIslandMarker(island.id);\n const propsAttr =\n Object.keys(island.props).length > 0\n ? ` data-ox-props='${JSON.stringify(island.props).replace(/'/g, \"'\")}'`\n : \"\";\n const contentAttr = island.content\n ? ` data-ox-content='${island.content.replace(/'/g, \"'\")}'`\n : \"\";\n const attrs = `data-ox-island=\"${island.name}\"${propsAttr}${contentAttr}`;\n output = output.replaceAll(`<p>${marker}</p>`, `<div ${attrs}></div>`);\n output = output.replaceAll(marker, `<span ${attrs}></span>`);\n }\n\n return output;\n}\n\nexport function extractFrontmatter(content: string): {\n content: string;\n frontmatter: Record<string, unknown>;\n} {\n const frontmatterRegex = /^---\\n([\\s\\S]*?)\\n---\\n/;\n const match = frontmatterRegex.exec(content);\n\n if (!match) {\n return { content, frontmatter: {} };\n }\n\n const frontmatter: Record<string, unknown> = {};\n\n for (const line of match[1].split(\"\\n\")) {\n const colonIndex = line.indexOf(\":\");\n if (colonIndex > 0) {\n const key = line.slice(0, colonIndex).trim();\n let value: unknown = line.slice(colonIndex + 1).trim();\n try {\n value = JSON.parse(value as string);\n } catch {\n if (\n typeof value === \"string\" &&\n ((value.startsWith('\"') && value.endsWith('\"')) ||\n (value.startsWith(\"'\") && value.endsWith(\"'\")))\n ) {\n value = value.slice(1, -1);\n }\n }\n frontmatter[key] = value;\n }\n }\n\n return { content: content.slice(match[0].length), frontmatter };\n}\n\nfunction createIslandMarker(islandId: string): string {\n return `${ISLAND_MARKER_PREFIX}${islandId}${ISLAND_MARKER_SUFFIX}`;\n}\n\nfunction collectFenceRanges(content: string): Range[] {\n const ranges: Range[] = [];\n let inFence = false;\n let fenceChar = \"\";\n let fenceLength = 0;\n let fenceStart = 0;\n let pos = 0;\n\n while (pos < content.length) {\n const lineEnd = content.indexOf(\"\\n\", pos);\n const next = lineEnd === -1 ? content.length : lineEnd + 1;\n const line = content.slice(pos, lineEnd === -1 ? content.length : lineEnd);\n const fenceMatch = line.match(/^\\s{0,3}([`~]{3,})/);\n\n if (fenceMatch) {\n const marker = fenceMatch[1];\n if (!inFence) {\n inFence = true;\n fenceChar = marker[0];\n fenceLength = marker.length;\n fenceStart = pos;\n } else if (marker[0] === fenceChar && marker.length >= fenceLength) {\n inFence = false;\n ranges.push({ start: fenceStart, end: next });\n fenceChar = \"\";\n fenceLength = 0;\n }\n }\n\n pos = next;\n }\n\n if (inFence) {\n ranges.push({ start: fenceStart, end: content.length });\n }\n\n return ranges;\n}\n\nfunction isInRanges(start: number, end: number, ranges: Range[]): boolean {\n for (const range of ranges) {\n if (start < range.end && end > range.start) {\n return true;\n }\n }\n return false;\n}\n\nfunction parseProps(propsString: string): Record<string, unknown> {\n const props: Record<string, unknown> = {};\n if (!propsString) return props;\n\n PROP_REGEX.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = PROP_REGEX.exec(propsString)) !== null) {\n const [, name, doubleQuoted, singleQuoted, braceValue, bracketValue] = match;\n if (!name) continue;\n\n if (doubleQuoted !== undefined) props[name] = doubleQuoted;\n else if (singleQuoted !== undefined) props[name] = singleQuoted;\n else if (braceValue !== undefined) {\n try {\n props[name] = JSON.parse(braceValue);\n } catch {\n props[name] = braceValue;\n }\n } else if (bracketValue !== undefined) {\n try {\n props[name] = JSON.parse(`[${bracketValue}]`);\n } catch {\n props[name] = bracketValue;\n }\n } else props[name] = true;\n }\n\n return props;\n}\n","import { transformMarkdown as baseTransformMarkdown } from \"@ox-content/vite-plugin\";\nimport { generateSolidModule } from \"./codegen\";\nimport { extractFrontmatter, injectIslandMarkers, scanComponents } from \"./markdown\";\nimport type { ResolvedSolidOptions, SolidTransformResult } from \"./types\";\n\nexport async function transformMarkdownWithSolid(\n code: string,\n id: string,\n options: ResolvedSolidOptions,\n): Promise<SolidTransformResult> {\n // `frontmatter: false` means the body is taken verbatim, so a leading `---`\n // block stays in the rendered document instead of becoming module exports.\n const { content: markdownContent, frontmatter } = options.frontmatter\n ? extractFrontmatter(code)\n : { content: code, frontmatter: {} };\n const scanned = scanComponents(markdownContent, options.components);\n\n const transformed = await baseTransformMarkdown(scanned.content, id, createBaseOptions(options));\n\n const htmlWithIslands = injectIslandMarkers(transformed.html, scanned.islands);\n\n return {\n code: generateSolidModule(\n htmlWithIslands,\n scanned.usedComponents,\n scanned.islands,\n frontmatter,\n options,\n id,\n ),\n map: null,\n usedComponents: scanned.usedComponents,\n frontmatter,\n };\n}\n\n/**\n * Options handed to the core Markdown transform.\n *\n * The site-level features (SSG, search, OG images, highlighting) are turned off\n * here: this path only produces the HTML that gets embedded in a Solid module,\n * and the host app owns everything around it. Frontmatter is stripped before\n * this point, so the core parser sees a body-only document.\n */\nfunction createBaseOptions(\n options: ResolvedSolidOptions,\n): Parameters<typeof baseTransformMarkdown>[2] {\n return {\n srcDir: options.srcDir,\n outDir: options.outDir,\n base: options.base,\n extensions: options.extensions,\n ssg: {\n enabled: false,\n extension: \".html\",\n clean: false,\n bare: false,\n generateOgImage: false,\n lastUpdated: false,\n },\n gfm: options.gfm,\n frontmatter: false,\n toc: options.toc,\n tocMaxDepth: options.tocMaxDepth,\n codeAnnotations: options.codeAnnotations,\n footnotes: true,\n tables: true,\n taskLists: true,\n strikethrough: true,\n autolinks: options.autolinks,\n highlight: false,\n highlightTheme: \"github-dark\",\n highlightLangs: [],\n mermaid: false,\n ogImage: false,\n ogImageOptions: {\n vuePlugin: \"vitejs\",\n width: 1200,\n height: 630,\n cache: true,\n concurrency: 1,\n },\n transformers: [],\n docs: false,\n ogViewer: false,\n search: {\n enabled: false,\n limit: 10,\n prefix: true,\n placeholder: \"Search...\",\n hotkey: \"k\",\n },\n embeds: options.embeds,\n i18n: false,\n } as unknown as Parameters<typeof baseTransformMarkdown>[2];\n}\n","/**\n * Guards against the two ways `vite-plugin-solid` can fail to compile the\n * Markdown modules this plugin emits.\n *\n * Both are configuration mistakes with silent-until-cryptic failure modes, so\n * each is checked as early as it can be observed: plugin presence and ordering\n * are known once the config resolves, while the `extensions` option is held in\n * the Solid plugin's closure and can only be inferred from whether the generated\n * JSX actually got compiled.\n */\n\nimport type { ResolvedConfig } from \"vite\";\n\nexport const TRANSFORM_PLUGIN_NAME = \"ox-content:solid-transform\";\n\nconst SOLID_PLUGIN_NAME = \"solid\";\n\n/**\n * Emitted by both generated module shapes. Solid's JSX has no runtime factory,\n * so this attribute only survives into the final module when nothing compiled\n * the JSX away — which is exactly the misconfiguration worth reporting.\n */\nexport const UNCOMPILED_JSX_MARKER = \"innerHTML={rawHtml}\";\n\nexport function formatSolidPluginError(reason: \"missing\" | \"ordering\" | \"extensions\"): string {\n const example = [\n \" plugins: [\",\n \" oxContentSolid({ srcDir: 'docs' }),\",\n \" solid({ extensions: ['.md', '.markdown', '.mdx'] }),\",\n \" ]\",\n ].join(\"\\n\");\n\n const detail = {\n missing:\n \"vite-plugin-solid was not found in the Vite config. Markdown files are emitted as Solid JSX, which only runs after babel-preset-solid compiles it.\",\n ordering:\n \"vite-plugin-solid runs before oxContentSolid(), so it sees raw Markdown instead of the generated JSX. Both plugins are `enforce: 'pre'`, so their order follows the `plugins` array.\",\n extensions:\n \"vite-plugin-solid did not compile the generated Markdown module. Its `extensions` option must list the Markdown extensions; by default it only looks at .jsx/.tsx files.\",\n }[reason];\n\n return `[ox-content:solid] ${detail}\\n\\n${example}\\n`;\n}\n\n/**\n * Throws when `vite-plugin-solid` is absent, or placed where it would see raw\n * Markdown instead of the JSX this plugin generates.\n */\nexport function verifySolidPluginOrder(config: ResolvedConfig): void {\n const names = config.plugins.map((plugin) => plugin.name);\n const solidIndex = names.indexOf(SOLID_PLUGIN_NAME);\n\n if (solidIndex === -1) {\n throw new Error(formatSolidPluginError(\"missing\"));\n }\n\n const transformIndex = names.indexOf(TRANSFORM_PLUGIN_NAME);\n if (transformIndex !== -1 && solidIndex < transformIndex) {\n throw new Error(formatSolidPluginError(\"ordering\"));\n }\n}\n","/**\n * Vite Plugin for Ox Content Solid Integration\n *\n * Uses Vite's Environment API to enable embedding Solid components in Markdown.\n */\n\nimport type { Plugin, PluginOption, ResolvedConfig } from \"vite\";\nimport { oxContent } from \"@ox-content/vite-plugin\";\nimport { resolveComponentsGlob } from \"./components\";\nimport { createSolidMarkdownEnvironment } from \"./environment\";\nimport { isMarkdownFilePath, resolveSolidOptions } from \"./options\";\nimport { transformMarkdownWithSolid } from \"./transform\";\nimport {\n formatSolidPluginError,\n TRANSFORM_PLUGIN_NAME,\n UNCOMPILED_JSX_MARKER,\n verifySolidPluginOrder,\n} from \"./verify\";\nimport type { SolidIntegrationOptions } from \"./types\";\n\nexport type {\n SolidIntegrationOptions,\n ResolvedSolidOptions,\n ComponentsOption,\n ComponentsMap,\n BuiltinEmbedOptions,\n GitHubEmbedOptions,\n OpenGraphEmbedOptions,\n ResolvedBuiltinEmbedOptions,\n SolidTransformResult,\n ComponentIsland,\n} from \"./types\";\n\n/**\n * Creates the Ox Content Solid integration plugin.\n *\n * Unlike the React and Svelte integrations, this plugin must be listed **before**\n * `vite-plugin-solid`, and that plugin must be told about the Markdown\n * extensions. Markdown is turned into Solid JSX here, and Solid's JSX is\n * compile-time only — `vite-plugin-solid` is what turns it into DOM or SSR\n * instructions.\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { defineConfig } from 'vite';\n * import solid from 'vite-plugin-solid';\n * import { oxContentSolid } from '@ox-content/vite-plugin-solid';\n *\n * export default defineConfig({\n * plugins: [\n * oxContentSolid({\n * srcDir: 'docs',\n * components: {\n * Counter: './src/components/Counter.tsx',\n * },\n * }),\n * solid({ extensions: ['.md', '.markdown', '.mdx'] }),\n * ],\n * });\n * ```\n */\nexport function oxContentSolid(options: SolidIntegrationOptions = {}): PluginOption[] {\n const resolved = resolveSolidOptions(options);\n let componentMap = new Map<string, string>();\n let config: ResolvedConfig;\n\n if (typeof options.components === \"object\" && !Array.isArray(options.components)) {\n componentMap = new Map(Object.entries(options.components));\n }\n\n const solidTransformPlugin: Plugin = {\n name: TRANSFORM_PLUGIN_NAME,\n enforce: \"pre\",\n\n async configResolved(resolvedConfig) {\n config = resolvedConfig;\n\n if (resolved.verifySolidPlugin) {\n verifySolidPluginOrder(resolvedConfig);\n }\n\n const componentsOption = options.components;\n if (componentsOption) {\n const resolvedComponents = await resolveComponentsGlob(componentsOption, config.root);\n componentMap = new Map(Object.entries(resolvedComponents));\n }\n },\n\n async transform(code, id) {\n if (!isMarkdownFilePath(id, resolved.extensions)) {\n return null;\n }\n\n const result = await transformMarkdownWithSolid(code, id, {\n ...resolved,\n components: Object.fromEntries(componentMap),\n root: config.root,\n });\n\n return {\n code: result.code,\n map: result.map,\n };\n },\n };\n\n // `post` so every `pre`/normal plugin — vite-plugin-solid included — has\n // already had its turn at the module.\n const solidVerifyPlugin: Plugin = {\n name: \"ox-content:solid-verify\",\n enforce: \"post\",\n\n transform(code, id) {\n if (!resolved.verifySolidPlugin) return null;\n if (!isMarkdownFilePath(id, resolved.extensions)) return null;\n if (!code.includes(UNCOMPILED_JSX_MARKER)) return null;\n\n this.error(formatSolidPluginError(\"extensions\"));\n },\n };\n\n const solidEnvironmentPlugin: Plugin = {\n name: \"ox-content:solid-environment\",\n\n config() {\n const envOptions = {\n ...resolved,\n components: Object.fromEntries(componentMap),\n };\n return {\n environments: {\n oxcontent_ssr: createSolidMarkdownEnvironment(\"ssr\", envOptions),\n oxcontent_client: createSolidMarkdownEnvironment(\"client\", envOptions),\n },\n };\n },\n\n resolveId(id) {\n if (id === \"virtual:ox-content-solid/components\") {\n return \"\\0virtual:ox-content-solid/components\";\n }\n return null;\n },\n\n load(id) {\n if (id === \"\\0virtual:ox-content-solid/components\") {\n return generateComponentsModule(componentMap);\n }\n return null;\n },\n\n applyToEnvironment(environment) {\n return [\"oxcontent_ssr\", \"oxcontent_client\", \"client\", \"ssr\"].includes(environment.name);\n },\n };\n\n const solidHmrPlugin: Plugin = {\n name: \"ox-content:solid-hmr\",\n apply: \"serve\",\n\n handleHotUpdate({ file, server, modules }) {\n const isComponent = Array.from(componentMap.values()).some((path) =>\n file.endsWith(path.replace(/^\\.\\//, \"\")),\n );\n\n if (isComponent) {\n const mdModules = Array.from(server.moduleGraph.idToModuleMap.values()).filter(\n (mod) => mod.file && isMarkdownFilePath(mod.file, resolved.extensions),\n );\n\n if (mdModules.length > 0) {\n server.ws.send({\n type: \"custom\",\n event: \"ox-content:solid-update\",\n data: { file },\n });\n return [...modules, ...mdModules];\n }\n }\n\n return modules;\n },\n };\n\n const basePlugins = oxContent(options).flatMap((plugin) =>\n Array.isArray(plugin) ? plugin : [plugin],\n ) as Plugin[];\n const environmentPlugin = basePlugins.find((plugin) => plugin.name === \"ox-content:environment\");\n const plugins: Plugin[] = [\n solidTransformPlugin,\n solidVerifyPlugin,\n solidEnvironmentPlugin,\n solidHmrPlugin,\n ];\n\n if (environmentPlugin) {\n plugins.push(environmentPlugin);\n }\n\n return plugins;\n}\n\nfunction generateComponentsModule(componentMap: Map<string, string>): string {\n const imports: string[] = [];\n const exports: string[] = [];\n\n componentMap.forEach((path, name) => {\n imports.push(`import ${name} from '${path}';`);\n exports.push(` ${name},`);\n });\n\n return `\n${imports.join(\"\\n\")}\n\nexport const components = {\n${exports.join(\"\\n\")}\n};\n\nexport default components;\n`;\n}\n\nexport { oxContent } from \"@ox-content/vite-plugin\";\n"],"mappings":";;;;;;;;AASA,eAAsB,sBACpB,kBACA,MACwB;CACxB,IAAI,OAAO,qBAAqB,YAAY,CAAC,MAAM,QAAQ,gBAAgB,GACzE,OAAO;CAGT,MAAM,WAAW,MAAM,QAAQ,gBAAgB,IAAI,mBAAmB,CAAC,gBAAgB;CACvF,MAAM,SAAwB,CAAC;CAE/B,KAAK,MAAM,WAAW,UACpB,KAAK,MAAM,QAAQ,MAAM,UAAU,SAAS,IAAI,GAAG;EACjD,MAAM,WAAW,KAAK,SAAS,MAAM,KAAK,QAAQ,IAAI,CAAC;EACvD,MAAM,eAAe,OAAO,KAAK,SAAS,MAAM,IAAI,CAAC,CAAC,QAAQ,OAAO,GAAG;EACxE,OAAO,aAAa,QAAQ,KAAK;CACnC;CAGF,OAAO;AACT;AAEA,eAAe,UAAU,SAAiB,MAAiC;CACzE,MAAM,QAAkB,CAAC;CACzB,MAAM,aAAa,QAAQ,QAAQ,OAAO,GAAG,CAAC,CAAC,QAAQ,SAAS,EAAE;CAElE,IAAI,CAAC,YAAY,UAAU,GAAG;EAC5B,MAAM,WAAW,KAAK,QAAQ,MAAM,UAAU;EAC9C,IAAI,GAAG,WAAW,Q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C,YAAU,OAAO,CAAC,CAAC,SAAS,WAC9C,MAAM,QAAQ,MAAM,IAAI,SAAS,CAAC,MAAM,CAEN,CAAC,CAAC,MAAM,WAAW,OAAO,SAAS,wBAAwB;CAC/F,MAAM,UAAoB;EACxB;EACA;EACA;EACA;CACF;CAEA,IAAI,mBACF,QAAQ,KAAK,iBAAiB;CAGhC,OAAO;AACT;AAEA,SAAS,yBAAyB,cAA2C;CAC3E,MAAM,UAAoB,CAAC;CAC3B,MAAM,UAAoB,CAAC;CAE3B,aAAa,SAAS,MAAM,SAAS;EACnC,QAAQ,KAAK,UAAU,KAAK,SAAS,KAAK,GAAG;EAC7C,QAAQ,KAAK,KAAK,KAAK,EAAE;CAC3B,CAAC;CAED,OAAO;EACP,QAAQ,KAAK,IAAI,EAAE;;;EAGnB,QAAQ,KAAK,IAAI,EAAE;;;;;AAKrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ox-content/vite-plugin-solid",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.82.0",
|
|
4
4
|
"description": "Solid integration for Ox Content - Embed Solid components in Markdown",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"provenance": true
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@ox-content/islands": "2.
|
|
39
|
-
"@ox-content/vite-plugin": "2.
|
|
38
|
+
"@ox-content/islands": "2.82.0",
|
|
39
|
+
"@ox-content/vite-plugin": "2.82.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/node": "^26.1.2",
|