create-fumadocs-app 16.1.0 → 16.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.
- package/dist/bin.js +7 -3
- package/dist/bin.js.map +1 -1
- package/dist/{constants-CtPvUb8m.js → constants-79vschUq.js} +31 -23
- package/dist/constants-79vschUq.js.map +1 -0
- package/dist/{index-B2olqGcn.d.ts → index-Dw7e2NvW.d.ts} +2 -2
- package/dist/index-Dw7e2NvW.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/plugins/ai.d.ts +1 -2
- package/dist/plugins/ai.d.ts.map +1 -1
- package/dist/plugins/biome.base.d.ts.map +1 -1
- package/dist/plugins/biome.d.ts +1 -2
- package/dist/plugins/biome.d.ts.map +1 -1
- package/dist/plugins/biome.js +1 -1
- package/dist/plugins/biome.next.d.ts.map +1 -1
- package/dist/plugins/eslint.d.ts +1 -2
- package/dist/plugins/eslint.d.ts.map +1 -1
- package/dist/plugins/next-use-src.d.ts +1 -2
- package/dist/plugins/next-use-src.d.ts.map +1 -1
- package/dist/plugins/next-use-takumi.d.ts +1 -2
- package/dist/plugins/next-use-takumi.d.ts.map +1 -1
- package/dist/plugins/next-use-takumi.js +4 -4
- package/dist/plugins/next-use-takumi.js.map +1 -1
- package/dist/plugins/orama-cloud.d.ts +1 -2
- package/dist/plugins/orama-cloud.d.ts.map +1 -1
- package/dist/plugins/orama-cloud.js +29 -2
- package/dist/plugins/orama-cloud.js.map +1 -1
- package/dist/plugins/oxlint.d.ts +1 -2
- package/dist/plugins/oxlint.d.ts.map +1 -1
- package/dist/plugins/oxlint.js +1 -1
- package/dist/{src-JHqNPoYJ.js → src-DvzlNXXv.js} +9 -8
- package/dist/{src-JHqNPoYJ.js.map → src-DvzlNXXv.js.map} +1 -1
- package/package.json +5 -5
- package/template/+next+fuma-docs-mdx/package.json +2 -2
- package/template/+next+fuma-docs-mdx+static/package.json +2 -2
- package/template/astro/README.md +11 -0
- package/template/astro/astro.config.mjs +41 -0
- package/template/astro/content/docs/index.mdx +21 -0
- package/template/astro/content/docs/meta.json +3 -0
- package/template/astro/content/docs/test.mdx +16 -0
- package/template/astro/example.gitignore +21 -0
- package/template/astro/package.json +32 -0
- package/template/astro/public/favicon.svg +33 -0
- package/template/astro/src/components/docs.tsx +44 -0
- package/template/astro/src/components/layout.astro +18 -0
- package/template/astro/src/components/search.tsx +88 -0
- package/template/astro/src/content.config.ts +26 -0
- package/template/astro/src/lib/source.ts +59 -0
- package/template/astro/src/pages/[...slug].astro +51 -0
- package/template/astro/src/pages/api/search.ts +19 -0
- package/template/astro/src/pages/og/docs/[...slug]/image.webp.ts +33 -0
- package/template/astro/src/styles/global.css +12 -0
- package/template/astro/tsconfig.json +10 -0
- package/template/react-router/app/routes/og.docs.tsx +1 -1
- package/template/react-router/package.json +7 -7
- package/template/react-router/vite.config.ts +0 -3
- package/template/react-router-spa/package.json +5 -5
- package/template/tanstack-start/package.json +1 -1
- package/template/tanstack-start-spa/package.json +2 -2
- package/template/waku/package.json +2 -2
- package/template/waku/src/pages/_api/og/docs/[...slugs]/image.webp.tsx +1 -1
- package/template/waku/waku.config.ts +0 -1
- package/dist/constants-CtPvUb8m.js.map +0 -1
- package/dist/index-B2olqGcn.d.ts.map +0 -1
package/dist/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as templates, n as isCI } from "./constants-
|
|
3
|
-
import { n as getPackageManager, r as managers, t as create } from "./src-
|
|
2
|
+
import { i as templates, n as isCI } from "./constants-79vschUq.js";
|
|
3
|
+
import { n as getPackageManager, r as managers, t as create } from "./src-DvzlNXXv.js";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { cancel, confirm, group, intro, isCancel, outro, select, spinner, text } from "@clack/prompts";
|
|
@@ -121,7 +121,7 @@ async function main() {
|
|
|
121
121
|
},
|
|
122
122
|
aiChat: async ({ results }) => {
|
|
123
123
|
if (config.aiChat !== void 0) return config.aiChat;
|
|
124
|
-
if (isCI || results.template === "+next+fuma-docs-mdx+static" || results.template.endsWith("-spa")) return false;
|
|
124
|
+
if (isCI || results.template === "astro" || results.template === "+next+fuma-docs-mdx+static" || results.template.endsWith("-spa")) return false;
|
|
125
125
|
return select({
|
|
126
126
|
message: "Configure AI Chat?",
|
|
127
127
|
options: [
|
|
@@ -157,6 +157,10 @@ async function main() {
|
|
|
157
157
|
process.exit(0);
|
|
158
158
|
} });
|
|
159
159
|
const projectName = options.name.toLowerCase().replace(/\s/, "-");
|
|
160
|
+
if (options.template === "astro" && options.aiChat) {
|
|
161
|
+
console.warn(pc.yellow("AI Chat is not supported by the Astro template yet, skipping it."));
|
|
162
|
+
options.aiChat = false;
|
|
163
|
+
}
|
|
160
164
|
if (!isCI) await checkDir(projectName);
|
|
161
165
|
const info = spinner();
|
|
162
166
|
info.start(`Generating Project`);
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","names":[],"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport {\n cancel,\n confirm,\n group,\n intro,\n isCancel,\n outro,\n select,\n spinner,\n text,\n} from '@clack/prompts';\nimport pc from 'picocolors';\nimport { getPackageManager, managers } from './auto-install';\nimport { create, type Template, type TemplatePlugin } from './index';\nimport { isCI, templates } from './constants';\nimport { Option, program } from '@commander-js/extra-typings';\n\nconst command = program\n .argument('[name]', 'the project name')\n .option('--src', '(Next.js only) enable `src/` directory')\n .option('--install', 'install packages automatically')\n .option('--no-git', 'disable auto Git repository initialization')\n .addOption(\n new Option(\n '--linter <name>',\n 'configure a linter/formatter, ESLint is currently Next.js only.',\n ).choices(['eslint', 'oxlint', 'biome']),\n )\n .addOption(\n new Option('--search <name>', 'configure a search solution').choices(['orama', 'orama-cloud']),\n )\n .addOption(\n new Option('--og-image <name>', 'configure OG image generation').choices(['next-og', 'takumi']),\n )\n .addOption(\n new Option('--ai-chat <name>', 'configure AI chat').choices([\n 'openrouter',\n 'llmgateway',\n 'inkeep',\n ]),\n )\n .addOption(\n new Option('--template <name>', 'choose a template').choices(\n templates.map((item) => item.value),\n ),\n )\n .addOption(\n new Option('--pm <name>', 'choose a package manager')\n .choices(managers)\n .default(getPackageManager()),\n );\n\nasync function main(): Promise<void> {\n command.parse(process.argv);\n const defaultName = command.args[0];\n const config = command.opts();\n intro(pc.bgCyan(pc.bold('Create Fumadocs App')));\n\n const options = await group(\n {\n name: async () => {\n if (defaultName) return defaultName;\n if (isCI) return 'untitled';\n\n return text({\n message: 'Project name',\n placeholder: 'my-app',\n defaultValue: 'my-app',\n });\n },\n template: async () => {\n if (config.template) return config.template;\n if (isCI) return '+next+fuma-docs-mdx';\n\n return select<Template>({\n message: 'Choose a template',\n initialValue: '+next+fuma-docs-mdx',\n options: templates,\n });\n },\n src: async ({ results }: { results: { template?: Template } }) => {\n if (config.src !== undefined) return config.src;\n if (isCI || !results.template?.startsWith('+next')) return false;\n\n return confirm({\n message: 'Use `/src` directory?',\n initialValue: false,\n });\n },\n lint: async ({ results }: { results: { template?: Template } }) => {\n if (config.linter !== undefined) return config.linter;\n if (isCI) return 'disabled';\n\n return select({\n message: 'Configure linter?',\n options: results.template?.startsWith('+next')\n ? [\n {\n value: 'disabled',\n label: 'Disabled',\n },\n {\n value: 'eslint',\n label: 'ESLint',\n },\n {\n value: 'biome',\n label: 'Biome',\n },\n {\n value: 'oxlint',\n label: 'Oxlint',\n },\n ]\n : [\n {\n value: 'disabled',\n label: 'Disabled',\n },\n {\n value: 'biome',\n label: 'Biome',\n },\n {\n value: 'oxlint',\n label: 'Oxlint',\n },\n ],\n });\n },\n search: async () => {\n if (config.search !== undefined) return config.search;\n if (isCI) return 'orama';\n\n return select({\n message: 'Choose a search solution?',\n options: [\n {\n value: 'orama',\n label: 'Default',\n hint: 'local search powered by Orama, recommended',\n },\n {\n value: 'orama-cloud',\n label: 'Orama Cloud',\n hint: '3rd party search solution, signup needed',\n },\n ],\n });\n },\n ogImage: async ({ results }: { results: { template?: Template } }) => {\n if (config.ogImage !== undefined) return config.ogImage;\n if (!results.template?.startsWith('+next')) return 'takumi';\n if (isCI) return 'next/og';\n\n return select({\n message: 'Configure Open Graph Image generation?',\n options: [\n {\n value: 'next/og',\n label: 'next/og',\n hint: 'Next.js built-in solution',\n },\n {\n value: 'takumi',\n label: 'Takumi',\n hint: 'Output WebP format, framework-agnostic',\n },\n ],\n });\n },\n aiChat: async ({ results }: { results: { template?: Template } }) => {\n if (config.aiChat !== undefined) return config.aiChat;\n if (\n isCI ||\n results.template === '+next+fuma-docs-mdx+static' ||\n results.template!.endsWith('-spa')\n )\n return false;\n\n return select<false | 'openrouter' | 'llmgateway' | 'inkeep'>({\n message: 'Configure AI Chat?',\n options: [\n {\n value: false,\n label: 'No',\n },\n {\n value: 'openrouter',\n label: 'AI SDK',\n hint: 'default to OpenRouter',\n },\n {\n value: 'llmgateway',\n label: 'LLMGateway',\n hint: 'open-source LLM gateway, API key required',\n },\n {\n value: 'inkeep',\n label: 'Inkeep AI',\n hint: 'API key required',\n },\n ],\n });\n },\n installDeps: async () => {\n if (config.install !== undefined) return config.install;\n if (isCI) return false;\n\n return confirm({\n message: `Do you want to install packages automatically? (detected as ${config.pm})`,\n });\n },\n },\n {\n onCancel: () => {\n cancel('Installation Stopped.');\n process.exit(0);\n },\n },\n );\n\n const projectName = options.name.toLowerCase().replace(/\\s/, '-');\n if (!isCI) await checkDir(projectName);\n\n const info = spinner();\n info.start(`Generating Project`);\n const plugins: TemplatePlugin[] = [];\n\n if (options.src) {\n const { nextUseSrc } = await import('./plugins/next-use-src');\n plugins.push(nextUseSrc());\n }\n\n if (options.search === 'orama-cloud') {\n const { oramaCloud } = await import('./plugins/orama-cloud');\n plugins.push(oramaCloud());\n }\n\n switch (options.lint) {\n case 'eslint': {\n const { eslint } = await import('./plugins/eslint');\n plugins.push(eslint());\n break;\n }\n case 'biome': {\n const { biome } = await import('./plugins/biome');\n plugins.push(biome());\n break;\n }\n case 'oxlint': {\n const { oxlint } = await import('./plugins/oxlint');\n plugins.push(oxlint());\n break;\n }\n }\n\n if (options.ogImage === 'takumi') {\n const { nextUseTakumi } = await import('./plugins/next-use-takumi');\n plugins.push(nextUseTakumi());\n }\n\n if (options.aiChat) {\n const { ai } = await import('./plugins/ai');\n\n plugins.push(ai(options.aiChat));\n }\n\n await create({\n packageManager: config.pm,\n template: options.template,\n outputDir: projectName,\n installDeps: options.installDeps,\n initializeGit: config.git,\n plugins,\n log: (message) => {\n info.message(message);\n },\n });\n\n info.stop('Project Generated');\n\n outro(pc.bgGreen(pc.bold('Done')));\n\n console.log(pc.bold('\\nOpen the project'));\n console.log(pc.cyan(`cd ${projectName}`));\n\n console.log(pc.bold('\\nRun Development Server'));\n if (config.pm === 'npm' || config.pm === 'bun') {\n console.log(pc.cyan(`${config.pm} run dev`));\n } else {\n console.log(pc.cyan(`${config.pm} dev`));\n }\n console.log(pc.bold('\\nYou can now open the project and start writing documents'));\n\n process.exit(0);\n}\n\nasync function checkDir(outputDir: string) {\n const destDir = await fs.readdir(outputDir).catch(() => null);\n if (!destDir || destDir.length === 0) return;\n const del = await confirm({\n message: `directory ${outputDir} already exists, do you want to delete its files?`,\n });\n\n if (isCancel(del)) {\n cancel();\n process.exit(1);\n }\n\n if (!del) return;\n\n const info = spinner();\n info.start(`Deleting files in ${outputDir}`);\n\n await Promise.all(\n destDir.map((item) => {\n return fs.rm(path.join(outputDir, item), {\n recursive: true,\n force: true,\n });\n }),\n );\n\n info.stop(`Deleted files in ${outputDir}`);\n}\n\nmain().catch((e: unknown) => {\n console.error(e);\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;AAoBA,MAAM,UAAU,QACb,SAAS,UAAU,kBAAkB,CAAC,CACtC,OAAO,SAAS,wCAAwC,CAAC,CACzD,OAAO,aAAa,gCAAgC,CAAC,C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,WAAW;GACX,OAAO;EACT,CAAC;CACH,CAAC,CACH;CAEA,KAAK,KAAK,oBAAoB,WAAW;AAC3C;AAEA,KAAK,CAAC,CAAC,OAAO,MAAe;CAC3B,QAAQ,MAAM,CAAC;CACf,QAAQ,KAAK,CAAC;AAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"bin.js","names":[],"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport {\n cancel,\n confirm,\n group,\n intro,\n isCancel,\n outro,\n select,\n spinner,\n text,\n} from '@clack/prompts';\nimport pc from 'picocolors';\nimport { getPackageManager, managers } from './auto-install';\nimport { create, type Template, type TemplatePlugin } from './index';\nimport { isCI, templates } from './constants';\nimport { Option, program } from '@commander-js/extra-typings';\n\nconst command = program\n .argument('[name]', 'the project name')\n .option('--src', '(Next.js only) enable `src/` directory')\n .option('--install', 'install packages automatically')\n .option('--no-git', 'disable auto Git repository initialization')\n .addOption(\n new Option(\n '--linter <name>',\n 'configure a linter/formatter, ESLint is currently Next.js only.',\n ).choices(['eslint', 'oxlint', 'biome']),\n )\n .addOption(\n new Option('--search <name>', 'configure a search solution').choices(['orama', 'orama-cloud']),\n )\n .addOption(\n new Option('--og-image <name>', 'configure OG image generation').choices(['next-og', 'takumi']),\n )\n .addOption(\n new Option('--ai-chat <name>', 'configure AI chat').choices([\n 'openrouter',\n 'llmgateway',\n 'inkeep',\n ]),\n )\n .addOption(\n new Option('--template <name>', 'choose a template').choices(\n templates.map((item) => item.value),\n ),\n )\n .addOption(\n new Option('--pm <name>', 'choose a package manager')\n .choices(managers)\n .default(getPackageManager()),\n );\n\nasync function main(): Promise<void> {\n command.parse(process.argv);\n const defaultName = command.args[0];\n const config = command.opts();\n intro(pc.bgCyan(pc.bold('Create Fumadocs App')));\n\n const options = await group(\n {\n name: async () => {\n if (defaultName) return defaultName;\n if (isCI) return 'untitled';\n\n return text({\n message: 'Project name',\n placeholder: 'my-app',\n defaultValue: 'my-app',\n });\n },\n template: async () => {\n if (config.template) return config.template;\n if (isCI) return '+next+fuma-docs-mdx';\n\n return select<Template>({\n message: 'Choose a template',\n initialValue: '+next+fuma-docs-mdx',\n options: templates,\n });\n },\n src: async ({ results }: { results: { template?: Template } }) => {\n if (config.src !== undefined) return config.src;\n if (isCI || !results.template?.startsWith('+next')) return false;\n\n return confirm({\n message: 'Use `/src` directory?',\n initialValue: false,\n });\n },\n lint: async ({ results }: { results: { template?: Template } }) => {\n if (config.linter !== undefined) return config.linter;\n if (isCI) return 'disabled';\n\n return select({\n message: 'Configure linter?',\n options: results.template?.startsWith('+next')\n ? [\n {\n value: 'disabled',\n label: 'Disabled',\n },\n {\n value: 'eslint',\n label: 'ESLint',\n },\n {\n value: 'biome',\n label: 'Biome',\n },\n {\n value: 'oxlint',\n label: 'Oxlint',\n },\n ]\n : [\n {\n value: 'disabled',\n label: 'Disabled',\n },\n {\n value: 'biome',\n label: 'Biome',\n },\n {\n value: 'oxlint',\n label: 'Oxlint',\n },\n ],\n });\n },\n search: async () => {\n if (config.search !== undefined) return config.search;\n if (isCI) return 'orama';\n\n return select({\n message: 'Choose a search solution?',\n options: [\n {\n value: 'orama',\n label: 'Default',\n hint: 'local search powered by Orama, recommended',\n },\n {\n value: 'orama-cloud',\n label: 'Orama Cloud',\n hint: '3rd party search solution, signup needed',\n },\n ],\n });\n },\n ogImage: async ({ results }: { results: { template?: Template } }) => {\n if (config.ogImage !== undefined) return config.ogImage;\n if (!results.template?.startsWith('+next')) return 'takumi';\n if (isCI) return 'next/og';\n\n return select({\n message: 'Configure Open Graph Image generation?',\n options: [\n {\n value: 'next/og',\n label: 'next/og',\n hint: 'Next.js built-in solution',\n },\n {\n value: 'takumi',\n label: 'Takumi',\n hint: 'Output WebP format, framework-agnostic',\n },\n ],\n });\n },\n aiChat: async ({ results }: { results: { template?: Template } }) => {\n if (config.aiChat !== undefined) return config.aiChat;\n if (\n isCI ||\n results.template === 'astro' ||\n results.template === '+next+fuma-docs-mdx+static' ||\n results.template!.endsWith('-spa')\n )\n return false;\n\n return select<false | 'openrouter' | 'llmgateway' | 'inkeep'>({\n message: 'Configure AI Chat?',\n options: [\n {\n value: false,\n label: 'No',\n },\n {\n value: 'openrouter',\n label: 'AI SDK',\n hint: 'default to OpenRouter',\n },\n {\n value: 'llmgateway',\n label: 'LLMGateway',\n hint: 'open-source LLM gateway, API key required',\n },\n {\n value: 'inkeep',\n label: 'Inkeep AI',\n hint: 'API key required',\n },\n ],\n });\n },\n installDeps: async () => {\n if (config.install !== undefined) return config.install;\n if (isCI) return false;\n\n return confirm({\n message: `Do you want to install packages automatically? (detected as ${config.pm})`,\n });\n },\n },\n {\n onCancel: () => {\n cancel('Installation Stopped.');\n process.exit(0);\n },\n },\n );\n\n const projectName = options.name.toLowerCase().replace(/\\s/, '-');\n if (options.template === 'astro' && options.aiChat) {\n console.warn(pc.yellow('AI Chat is not supported by the Astro template yet, skipping it.'));\n options.aiChat = false;\n }\n\n if (!isCI) await checkDir(projectName);\n\n const info = spinner();\n info.start(`Generating Project`);\n const plugins: TemplatePlugin[] = [];\n\n if (options.src) {\n const { nextUseSrc } = await import('./plugins/next-use-src');\n plugins.push(nextUseSrc());\n }\n\n if (options.search === 'orama-cloud') {\n const { oramaCloud } = await import('./plugins/orama-cloud');\n plugins.push(oramaCloud());\n }\n\n switch (options.lint) {\n case 'eslint': {\n const { eslint } = await import('./plugins/eslint');\n plugins.push(eslint());\n break;\n }\n case 'biome': {\n const { biome } = await import('./plugins/biome');\n plugins.push(biome());\n break;\n }\n case 'oxlint': {\n const { oxlint } = await import('./plugins/oxlint');\n plugins.push(oxlint());\n break;\n }\n }\n\n if (options.ogImage === 'takumi') {\n const { nextUseTakumi } = await import('./plugins/next-use-takumi');\n plugins.push(nextUseTakumi());\n }\n\n if (options.aiChat) {\n const { ai } = await import('./plugins/ai');\n\n plugins.push(ai(options.aiChat));\n }\n\n await create({\n packageManager: config.pm,\n template: options.template,\n outputDir: projectName,\n installDeps: options.installDeps,\n initializeGit: config.git,\n plugins,\n log: (message) => {\n info.message(message);\n },\n });\n\n info.stop('Project Generated');\n\n outro(pc.bgGreen(pc.bold('Done')));\n\n console.log(pc.bold('\\nOpen the project'));\n console.log(pc.cyan(`cd ${projectName}`));\n\n console.log(pc.bold('\\nRun Development Server'));\n if (config.pm === 'npm' || config.pm === 'bun') {\n console.log(pc.cyan(`${config.pm} run dev`));\n } else {\n console.log(pc.cyan(`${config.pm} dev`));\n }\n console.log(pc.bold('\\nYou can now open the project and start writing documents'));\n\n process.exit(0);\n}\n\nasync function checkDir(outputDir: string) {\n const destDir = await fs.readdir(outputDir).catch(() => null);\n if (!destDir || destDir.length === 0) return;\n const del = await confirm({\n message: `directory ${outputDir} already exists, do you want to delete its files?`,\n });\n\n if (isCancel(del)) {\n cancel();\n process.exit(1);\n }\n\n if (!del) return;\n\n const info = spinner();\n info.start(`Deleting files in ${outputDir}`);\n\n await Promise.all(\n destDir.map((item) => {\n return fs.rm(path.join(outputDir, item), {\n recursive: true,\n force: true,\n });\n }),\n );\n\n info.stop(`Deleted files in ${outputDir}`);\n}\n\nmain().catch((e: unknown) => {\n console.error(e);\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;AAoBA,MAAM,UAAU,QACb,SAAS,UAAU,kBAAkB,CAAC,CACtC,OAAO,SAAS,wCAAwC,CAAC,CACzD,OAAO,aAAa,gCAAgC,CAAC,CACrD,OAAO,YAAY,4CAA4C,CAAC,CAChE,UACC,IAAI,OACF,mBACA,iEACF,CAAC,CAAC,QAAQ;CAAC;CAAU;CAAU;AAAO,CAAC,CACzC,CAAC,CACA,UACC,IAAI,OAAO,mBAAmB,6BAA6B,CAAC,CAAC,QAAQ,CAAC,SAAS,aAAa,CAAC,CAC/F,CAAC,CACA,UACC,IAAI,OAAO,qBAAqB,+BAA+B,CAAC,CAAC,QAAQ,CAAC,WAAW,QAAQ,CAAC,CAChG,CAAC,CACA,UACC,IAAI,OAAO,oBAAoB,mBAAm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ll = (all, no_symbols) => {
|
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region ../create-app-versions/package.json
|
|
15
15
|
var dependencies$3 = {
|
|
16
|
-
"@biomejs/biome": "^2.5.
|
|
16
|
+
"@biomejs/biome": "^2.5.3",
|
|
17
17
|
"@orama/core": "^1.2.19",
|
|
18
|
-
"@takumi-rs/image-response": "^1.8.7",
|
|
19
18
|
"fumadocs-core": "workspace:*",
|
|
20
19
|
"fumadocs-mdx": "workspace:*",
|
|
21
20
|
"fumadocs-ui": "workspace:*",
|
|
22
|
-
"oxlint": "^1.
|
|
23
|
-
"react": "^19.2.7"
|
|
21
|
+
"oxlint": "^1.73.0",
|
|
22
|
+
"react": "^19.2.7",
|
|
23
|
+
"takumi-js": "^2.0.1"
|
|
24
24
|
};
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region ../core/package.json
|
|
@@ -47,7 +47,7 @@ var package_exports$2 = /* @__PURE__ */ __exportAll({
|
|
|
47
47
|
version: () => version$2
|
|
48
48
|
});
|
|
49
49
|
var name$2 = "fumadocs-core";
|
|
50
|
-
var version$2 = "16.11.
|
|
50
|
+
var version$2 = "16.11.2";
|
|
51
51
|
var description$2 = "The React.js library for building a documentation website";
|
|
52
52
|
var keywords$2 = ["Docs", "Fumadocs"];
|
|
53
53
|
var homepage$2 = "https://fumadocs.dev";
|
|
@@ -67,6 +67,7 @@ var exports$2 = {
|
|
|
67
67
|
"./content/toc": "./dist/content/toc.js",
|
|
68
68
|
"./dynamic-link": "./dist/dynamic-link.js",
|
|
69
69
|
"./framework": "./dist/framework/index.js",
|
|
70
|
+
"./framework/astro": "./dist/framework/astro.js",
|
|
70
71
|
"./framework/next": "./dist/framework/next.js",
|
|
71
72
|
"./framework/react-router": "./dist/framework/react-router.js",
|
|
72
73
|
"./framework/tanstack": "./dist/framework/tanstack.js",
|
|
@@ -174,10 +175,10 @@ var devDependencies$2 = {
|
|
|
174
175
|
"@types/hast": "^3.0.4",
|
|
175
176
|
"@types/mdast": "^4.0.4",
|
|
176
177
|
"@types/negotiator": "^0.6.4",
|
|
177
|
-
"@types/node": "26.1.
|
|
178
|
+
"@types/node": "26.1.1",
|
|
178
179
|
"@types/react": "^19.2.17",
|
|
179
180
|
"@types/react-dom": "^19.2.3",
|
|
180
|
-
"algoliasearch": "5.55.
|
|
181
|
+
"algoliasearch": "5.55.2",
|
|
181
182
|
"flexsearch": "^0.8.212",
|
|
182
183
|
"image-size": "^2.0.2",
|
|
183
184
|
"lucide-react": "^1.23.0",
|
|
@@ -185,12 +186,12 @@ var devDependencies$2 = {
|
|
|
185
186
|
"next": "16.2.10",
|
|
186
187
|
"npm-to-yarn": "^3.0.1",
|
|
187
188
|
"path-to-regexp": "^8.4.2",
|
|
188
|
-
"react-router": "^8.
|
|
189
|
+
"react-router": "^8.2.0",
|
|
189
190
|
"remark-directive": "^4.0.0",
|
|
190
191
|
"remark-mdx": "^3.1.1",
|
|
191
192
|
"remove-markdown": "^0.6.4",
|
|
192
193
|
"tsconfig": "workspace:*",
|
|
193
|
-
"tsdown": "0.22.
|
|
194
|
+
"tsdown": "0.22.4",
|
|
194
195
|
"typescript": "^6.0.3",
|
|
195
196
|
"waku": "1.0.0-beta.6",
|
|
196
197
|
"zod": "4.4.3"
|
|
@@ -357,7 +358,7 @@ var devDependencies$1 = {
|
|
|
357
358
|
"@types/bun": "^1.3.14",
|
|
358
359
|
"@types/mdast": "^4.0.4",
|
|
359
360
|
"@types/mdx": "^2.0.14",
|
|
360
|
-
"@types/node": "^26.1.
|
|
361
|
+
"@types/node": "^26.1.1",
|
|
361
362
|
"@types/picomatch": "^4.0.3",
|
|
362
363
|
"@types/react": "^19.2.17",
|
|
363
364
|
"fumadocs-core": "workspace:*",
|
|
@@ -367,12 +368,12 @@ var devDependencies$1 = {
|
|
|
367
368
|
"remark": "^15.0.1",
|
|
368
369
|
"remark-directive": "^4.0.0",
|
|
369
370
|
"remark-mdx": "^3.1.1",
|
|
370
|
-
"rolldown": "^1.1.
|
|
371
|
-
"satteri": "^0.9.
|
|
371
|
+
"rolldown": "^1.1.5",
|
|
372
|
+
"satteri": "^0.9.5",
|
|
372
373
|
"tsconfig": "workspace:*",
|
|
373
|
-
"tsdown": "0.22.
|
|
374
|
+
"tsdown": "0.22.4",
|
|
374
375
|
"vite": "^8.1.3",
|
|
375
|
-
"webpack": "^5.108.
|
|
376
|
+
"webpack": "^5.108.4"
|
|
376
377
|
};
|
|
377
378
|
var peerDependencies$1 = {
|
|
378
379
|
"@fumadocs/satteri": "0.x.x",
|
|
@@ -444,7 +445,7 @@ var package_exports = /* @__PURE__ */ __exportAll({
|
|
|
444
445
|
version: () => version
|
|
445
446
|
});
|
|
446
447
|
var name = "@fumadocs/base-ui";
|
|
447
|
-
var version = "16.11.
|
|
448
|
+
var version = "16.11.2";
|
|
448
449
|
var description = "The Base UI version of Fumadocs UI";
|
|
449
450
|
var keywords = ["Docs", "Fumadocs"];
|
|
450
451
|
var homepage = "https://fumadocs.dev";
|
|
@@ -485,7 +486,6 @@ var exports = {
|
|
|
485
486
|
"./components/ui/accordion": "./dist/components/ui/accordion.js",
|
|
486
487
|
"./components/ui/button": "./dist/components/ui/button.js",
|
|
487
488
|
"./components/ui/collapsible": "./dist/components/ui/collapsible.js",
|
|
488
|
-
"./components/ui/navigation-menu": "./dist/components/ui/navigation-menu.js",
|
|
489
489
|
"./components/ui/popover": "./dist/components/ui/popover.js",
|
|
490
490
|
"./components/ui/scroll-area": "./dist/components/ui/scroll-area.js",
|
|
491
491
|
"./components/ui/tabs": "./dist/components/ui/tabs.js",
|
|
@@ -537,6 +537,7 @@ var exports = {
|
|
|
537
537
|
"./og": "./dist/og.js",
|
|
538
538
|
"./og/takumi": "./dist/og/takumi.js",
|
|
539
539
|
"./page": "./dist/page.js",
|
|
540
|
+
"./provider/astro": "./dist/provider/astro.js",
|
|
540
541
|
"./provider/base": "./dist/provider/base.js",
|
|
541
542
|
"./provider/next": "./dist/provider/next.js",
|
|
542
543
|
"./provider/react-router": "./dist/provider/react-router.js",
|
|
@@ -579,10 +580,10 @@ var devDependencies = {
|
|
|
579
580
|
"@fumadocs/cli": "workspace:*",
|
|
580
581
|
"@tailwindcss/cli": "^4.3.2",
|
|
581
582
|
"@tailwindcss/oxide": "^4.3.2",
|
|
582
|
-
"@tsdown/css": "^0.22.
|
|
583
|
+
"@tsdown/css": "^0.22.4",
|
|
583
584
|
"@types/hast": "^3.0.4",
|
|
584
585
|
"@types/mdx": "^2.0.14",
|
|
585
|
-
"@types/node": "^26.1.
|
|
586
|
+
"@types/node": "^26.1.1",
|
|
586
587
|
"@types/react": "^19.2.17",
|
|
587
588
|
"@types/react-dom": "^19.2.3",
|
|
588
589
|
"fuma-cli": "^0.1.1",
|
|
@@ -590,21 +591,21 @@ var devDependencies = {
|
|
|
590
591
|
"react-medium-image-zoom": "^5.4.8",
|
|
591
592
|
"tailwindcss": "^4.3.2",
|
|
592
593
|
"tsconfig": "workspace:*",
|
|
593
|
-
"tsdown": "0.22.
|
|
594
|
+
"tsdown": "0.22.4",
|
|
594
595
|
"unified": "^11.0.5"
|
|
595
596
|
};
|
|
596
597
|
var peerDependencies = {
|
|
597
|
-
"@takumi-rs/image-response": "*",
|
|
598
598
|
"@types/mdx": "*",
|
|
599
599
|
"@types/react": "*",
|
|
600
600
|
"fumadocs-core": "workspace:*",
|
|
601
601
|
"next": "16.x.x",
|
|
602
602
|
"react": "^19.2.0",
|
|
603
|
-
"react-dom": "^19.2.0"
|
|
603
|
+
"react-dom": "^19.2.0",
|
|
604
|
+
"takumi-js": "*"
|
|
604
605
|
};
|
|
605
606
|
var peerDependenciesMeta = {
|
|
606
607
|
"next": { "optional": true },
|
|
607
|
-
"
|
|
608
|
+
"takumi-js": { "optional": true },
|
|
608
609
|
"@types/mdx": { "optional": true },
|
|
609
610
|
"@types/react": { "optional": true }
|
|
610
611
|
};
|
|
@@ -641,6 +642,13 @@ const templates = [
|
|
|
641
642
|
appDir: "",
|
|
642
643
|
rootProviderPath: "app/layout.tsx"
|
|
643
644
|
},
|
|
645
|
+
{
|
|
646
|
+
value: "astro",
|
|
647
|
+
label: "Astro: React Islands",
|
|
648
|
+
hint: "uses Astro Content Collections and Fumadocs UI as a React island",
|
|
649
|
+
appDir: "src",
|
|
650
|
+
rootProviderPath: "components/docs.tsx"
|
|
651
|
+
},
|
|
644
652
|
{
|
|
645
653
|
value: "+next+fuma-docs-mdx+static",
|
|
646
654
|
label: "Next.js Static: Fumadocs MDX",
|
|
@@ -691,4 +699,4 @@ depVersions["fumadocs-ui"] = `npm:${name}@${version}`;
|
|
|
691
699
|
//#endregion
|
|
692
700
|
export { templates as i, isCI as n, sourceDir as r, depVersions as t };
|
|
693
701
|
|
|
694
|
-
//# sourceMappingURL=constants-
|
|
702
|
+
//# sourceMappingURL=constants-79vschUq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-79vschUq.js","names":["corePkg","mdxPkg","basePkg","versionPkg.dependencies","basePkg.name","basePkg.version"],"sources":["../../create-app-versions/package.json","../../core/package.json","../../mdx/package.json","../../base-ui/package.json","../src/constants.ts"],"sourcesContent":["","","","","import { fileURLToPath } from 'node:url';\nimport versionPkg from '../../create-app-versions/package.json';\nimport * as corePkg from '../../core/package.json';\nimport * as mdxPkg from '../../mdx/package.json';\nimport * as basePkg from '../../base-ui/package.json';\n\nexport const sourceDir = fileURLToPath(new URL(`../`, import.meta.url).href);\n\nexport const isCI = Boolean(process.env.CI);\n\nexport interface TemplateInfo {\n value:\n | '+next+fuma-docs-mdx'\n | 'astro'\n | 'waku'\n | 'react-router'\n | 'react-router-spa'\n | 'tanstack-start'\n | 'tanstack-start-spa'\n | '+next+fuma-docs-mdx+static';\n label: string;\n appDir: string;\n /**\n * path to root provider, relative to `appDir``\n */\n rootProviderPath: string;\n hint?: string;\n /**\n * rename files when copying from template\n */\n rename?: (name: string) => string;\n}\n\nexport const templates: TemplateInfo[] = [\n {\n value: '+next+fuma-docs-mdx',\n label: 'Next.js: Fumadocs MDX',\n hint: 'recommended',\n appDir: '',\n rootProviderPath: 'app/layout.tsx',\n },\n {\n value: 'astro',\n label: 'Astro: React Islands',\n hint: 'uses Astro Content Collections and Fumadocs UI as a React island',\n appDir: 'src',\n rootProviderPath: 'components/docs.tsx',\n },\n {\n value: '+next+fuma-docs-mdx+static',\n label: 'Next.js Static: Fumadocs MDX',\n appDir: '',\n rootProviderPath: 'components/provider.tsx',\n },\n {\n value: 'waku',\n label: 'Waku: Fumadocs MDX',\n appDir: 'src',\n rootProviderPath: 'components/provider.tsx',\n },\n {\n value: 'react-router',\n label: 'React Router: Fumadocs MDX (not RSC)',\n appDir: 'app',\n rootProviderPath: 'root.tsx',\n },\n {\n value: 'react-router-spa',\n label: 'React Router SPA: Fumadocs MDX (not RSC)',\n hint: 'SPA mode allows you to host the site statically, compatible with a CDN.',\n appDir: 'app',\n rootProviderPath: 'root.tsx',\n },\n {\n value: 'tanstack-start',\n label: 'Tanstack Start: Fumadocs MDX (not RSC)',\n appDir: 'src',\n rootProviderPath: 'routes/__root.tsx',\n },\n {\n value: 'tanstack-start-spa',\n label: 'Tanstack Start SPA: Fumadocs MDX (not RSC)',\n hint: 'SPA mode allows you to host the site statically, compatible with a CDN.',\n appDir: 'src',\n rootProviderPath: 'routes/__root.tsx',\n },\n];\n\nconst workspaces = [corePkg, mdxPkg, basePkg];\n\nexport const depVersions = versionPkg.dependencies;\n\nfor (const workspace of workspaces) {\n depVersions[workspace.name as keyof typeof depVersions] = workspace.version;\n}\n\ndepVersions['fumadocs-ui'] = `npm:${basePkg.name}@${basePkg.version}`;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C;AAE3B,KAAK,MAAM,aAAa,YACtB,YAAY,UAAU,QAAoC,UAAU;AAGtE,YAAY,iBAAiB,OAAOC,KAAa,GAAGC"}
|
|
@@ -4,7 +4,7 @@ declare const managers: readonly ["npm", "yarn", "bun", "pnpm"];
|
|
|
4
4
|
//#endregion
|
|
5
5
|
//#region src/constants.d.ts
|
|
6
6
|
interface TemplateInfo {
|
|
7
|
-
value: '+next+fuma-docs-mdx' | 'waku' | 'react-router' | 'react-router-spa' | 'tanstack-start' | 'tanstack-start-spa' | '+next+fuma-docs-mdx+static';
|
|
7
|
+
value: '+next+fuma-docs-mdx' | 'astro' | 'waku' | 'react-router' | 'react-router-spa' | 'tanstack-start' | 'tanstack-start-spa' | '+next+fuma-docs-mdx+static';
|
|
8
8
|
label: string;
|
|
9
9
|
appDir: string;
|
|
10
10
|
/**
|
|
@@ -64,4 +64,4 @@ interface TemplatePlugin {
|
|
|
64
64
|
declare function create(createOptions: Options): Promise<void>;
|
|
65
65
|
//#endregion
|
|
66
66
|
export { TemplatePluginContext as a, TemplatePlugin as i, PackageJsonType as n, create as o, Template as r, Options as t };
|
|
67
|
-
//# sourceMappingURL=index-
|
|
67
|
+
//# sourceMappingURL=index-Dw7e2NvW.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Dw7e2NvW.d.ts","names":[],"sources":["../src/auto-install.ts","../src/constants.ts","../src/index.ts"],"mappings":";KAEY,yBAAyB;cAExB;;;UCMI;EACf;EASA;EACA;;;;EAIA;EACA;;;;EAIA,UAAU;;;;KCvBA,WAAW;UACN;EACf;EACA,UAAU;;;;;;EAOV,iBAAiB;EAEjB;EACA;EACA,OAAO;EACP,UAAU;;UAGK;EACf,UAAU;EACV,MAAM;;;;EAIN;;;;EAKA;;KAGU;EACV;EACA;EACA;EACA,UAAU;EACV,eAAe;EACf,kBAAkB;IAChB;KAEC,UAAU,KAAK,IAAI,QAAQ;UAEf;EACf,YACE,MAAM,KAAK,gCACX,MAAM,iBACH,iBAAiB;EACtB,eACE,MAAM,uBACN,aAAa,oBACV,iBAAiB;EACtB,cAAc,MAAM,0BAA0B;EAC9C,UAAU,MAAM,uBAAuB,oBAAoB;;iBAGvC,OAAO,eAAe,UAAU"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TemplatePluginContext, i as TemplatePlugin, n as PackageJsonType, o as create, r as Template, t as Options } from "./index-
|
|
1
|
+
import { a as TemplatePluginContext, i as TemplatePlugin, n as PackageJsonType, o as create, r as Template, t as Options } from "./index-Dw7e2NvW.js";
|
|
2
2
|
export { Options, PackageJsonType, Template, TemplatePlugin, TemplatePluginContext, create };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as create } from "./src-
|
|
1
|
+
import { t as create } from "./src-DvzlNXXv.js";
|
|
2
2
|
export { create };
|
package/dist/plugins/ai.d.ts
CHANGED
package/dist/plugins/ai.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.d.ts","names":[],"sources":["../../src/plugins/ai.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ai.d.ts","names":[],"sources":["../../src/plugins/ai.ts"],"mappings":";;iBAegB,GAAG,mDAAmD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biome.base.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"biome.base.d.ts","names":[],"sources":["../../src/plugins/biome.base.json.d.ts"],"mappings":";YAAW;kBACM;MACT;MACA;MACA;;kBAES;MACT;MACA;;kBAES;MACT;WACK,aAAa;aACX;aACA;;kBAEE;MACT;WACK,aAAa;mBACL;QACT;;mBAES;QACT;;;kBAGK;YACH;cACI;UACF;;;;kBAKE;WACP,SAAS,KAAK,OAAO,WAAW,QAAQ"}
|
package/dist/plugins/biome.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biome.d.ts","names":[],"sources":["../../src/plugins/biome.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"biome.d.ts","names":[],"sources":["../../src/plugins/biome.ts"],"mappings":";;iBAOgB,SAAS"}
|
package/dist/plugins/biome.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as depVersions } from "../constants-
|
|
1
|
+
import { t as depVersions } from "../constants-79vschUq.js";
|
|
2
2
|
import { i as writeFile, n as pick } from "../utils-BZh9vMXJ.js";
|
|
3
3
|
import biome_base_default from "./biome.base.js";
|
|
4
4
|
import biome_next_default from "./biome.next.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biome.next.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"biome.next.d.ts","names":[],"sources":["../../src/plugins/biome.next.json.d.ts"],"mappings":";YAAW;kBACM;MACT;MACA;MACA;;kBAES;MACT;MACA;;kBAES;MACT;WACK,aAAa;aACX;aACA;;kBAEE;MACT;WACK,aAAa;mBACL;QACT;;mBAES;QACT;QACA;;;kBAGK;YACH;cACI;UACF;;;;kBAKE;WACP,SAAS,KAAK,OAAO,WAAW,QAAQ"}
|
package/dist/plugins/eslint.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.d.ts","names":[],"sources":["../../src/plugins/eslint.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"eslint.d.ts","names":[],"sources":["../../src/plugins/eslint.ts"],"mappings":";;iBAoBgB,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-use-src.d.ts","names":[],"sources":["../../src/plugins/next-use-src.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"next-use-src.d.ts","names":[],"sources":["../../src/plugins/next-use-src.ts"],"mappings":";;;;;iBAOgB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-use-takumi.d.ts","names":[],"sources":["../../src/plugins/next-use-takumi.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"next-use-takumi.d.ts","names":[],"sources":["../../src/plugins/next-use-takumi.ts"],"mappings":";;iBAMgB,iBAAiB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as depVersions } from "../constants-
|
|
1
|
+
import { t as depVersions } from "../constants-79vschUq.js";
|
|
2
2
|
import { n as pick } from "../utils-BZh9vMXJ.js";
|
|
3
3
|
import { readFile, writeFile } from "node:fs/promises";
|
|
4
4
|
import { join } from "node:path";
|
|
@@ -10,7 +10,7 @@ function nextUseTakumi() {
|
|
|
10
10
|
...packageJson,
|
|
11
11
|
dependencies: {
|
|
12
12
|
...packageJson.dependencies,
|
|
13
|
-
...pick(depVersions, ["
|
|
13
|
+
...pick(depVersions, ["takumi-js"])
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
return packageJson;
|
|
@@ -26,7 +26,7 @@ function nextUseTakumi() {
|
|
|
26
26
|
}
|
|
27
27
|
async function replaceImports(context) {
|
|
28
28
|
const path = join(context.appDir, "app/og/docs/[...slug]/route.tsx");
|
|
29
|
-
await writeFile(path, (await readFile(path, "utf-8")).replaceAll("next/og", "
|
|
29
|
+
await writeFile(path, (await readFile(path, "utf-8")).replaceAll("next/og", "takumi-js/response").replaceAll("fumadocs-ui/og", "fumadocs-ui/og/takumi").replace("height: 630,", "height: 630,\n format: 'webp',"));
|
|
30
30
|
}
|
|
31
31
|
async function replaceImagePath(context) {
|
|
32
32
|
const path = join(context.appDir, "lib/source.ts");
|
|
@@ -35,7 +35,7 @@ async function replaceImagePath(context) {
|
|
|
35
35
|
async function nextConfigExternal(context) {
|
|
36
36
|
const path = join(context.dest, "next.config.mjs");
|
|
37
37
|
await writeFile(path, (await readFile(path, "utf-8")).replace("const config = {", `const config = {
|
|
38
|
-
serverExternalPackages: ['@takumi-rs/
|
|
38
|
+
serverExternalPackages: ['@takumi-rs/core'],`));
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
41
|
export { nextUseTakumi };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-use-takumi.js","names":[],"sources":["../../src/plugins/next-use-takumi.ts"],"sourcesContent":["import { TemplatePlugin, TemplatePluginContext } from '@/index';\nimport { depVersions } from '@/constants';\nimport { pick } from '@/utils';\nimport { join } from 'node:path';\nimport { readFile, writeFile } from 'node:fs/promises';\n\nexport function nextUseTakumi(): TemplatePlugin {\n return {\n packageJson(packageJson) {\n if (this.template.value.startsWith('+next')) {\n return {\n ...packageJson,\n dependencies: {\n ...packageJson.dependencies,\n ...pick(depVersions, ['
|
|
1
|
+
{"version":3,"file":"next-use-takumi.js","names":[],"sources":["../../src/plugins/next-use-takumi.ts"],"sourcesContent":["import { TemplatePlugin, TemplatePluginContext } from '@/index';\nimport { depVersions } from '@/constants';\nimport { pick } from '@/utils';\nimport { join } from 'node:path';\nimport { readFile, writeFile } from 'node:fs/promises';\n\nexport function nextUseTakumi(): TemplatePlugin {\n return {\n packageJson(packageJson) {\n if (this.template.value.startsWith('+next')) {\n return {\n ...packageJson,\n dependencies: {\n ...packageJson.dependencies,\n ...pick(depVersions, ['takumi-js']),\n },\n };\n }\n return packageJson;\n },\n async afterWrite() {\n if (this.template.value.startsWith('+next')) {\n await replaceImports(this);\n await replaceImagePath(this);\n await nextConfigExternal(this);\n }\n },\n };\n}\n\nasync function replaceImports(context: TemplatePluginContext) {\n const path = join(context.appDir, 'app/og/docs/[...slug]/route.tsx');\n const content = await readFile(path, 'utf-8');\n const replaced = content\n .replaceAll('next/og', 'takumi-js/response')\n .replaceAll('fumadocs-ui/og', 'fumadocs-ui/og/takumi')\n .replace('height: 630,', \"height: 630,\\n format: 'webp',\");\n\n await writeFile(path, replaced);\n}\n\nasync function replaceImagePath(context: TemplatePluginContext) {\n const path = join(context.appDir, 'lib/source.ts');\n const content = await readFile(path, 'utf-8');\n const replaced = content.replaceAll('image.png', 'image.webp');\n\n await writeFile(path, replaced);\n}\n\nasync function nextConfigExternal(context: TemplatePluginContext) {\n const path = join(context.dest, 'next.config.mjs');\n const content = await readFile(path, 'utf-8');\n\n const replaced = content.replace(\n 'const config = {',\n `const config = {\n serverExternalPackages: ['@takumi-rs/core'],`,\n );\n\n await writeFile(path, replaced);\n}\n"],"mappings":";;;;;AAMA,SAAgB,gBAAgC;CAC9C,OAAO;EACL,YAAY,aAAa;GACvB,IAAI,KAAK,SAAS,MAAM,WAAW,OAAO,GACxC,OAAO;IACL,GAAG;IACH,cAAc;KACZ,GAAG,YAAY;KACf,GAAG,KAAK,aAAa,CAAC,WAAW,CAAC;IACpC;GACF;GAEF,OAAO;EACT;EACA,MAAM,aAAa;GACjB,IAAI,KAAK,SAAS,MAAM,WAAW,OAAO,GAAG;IAC3C,MAAM,eAAe,IAAI;IACzB,MAAM,iBAAiB,IAAI;IAC3B,MAAM,mBAAmB,IAAI;GAC/B;EACF;CACF;AACF;AAEA,eAAe,eAAe,SAAgC;CAC5D,MAAM,OAAO,KAAK,QAAQ,QAAQ,iCAAiC;CAOnE,MAAM,UAAU,OALC,MADK,SAAS,MAAM,OAAO,EAAA,CAEzC,WAAW,WAAW,oBAAoB,CAAC,CAC3C,WAAW,kBAAkB,uBAAuB,CAAC,CACrD,QAAQ,gBAAgB,qCAEE,CAAC;AAChC;AAEA,eAAe,iBAAiB,SAAgC;CAC9D,MAAM,OAAO,KAAK,QAAQ,QAAQ,eAAe;CAIjD,MAAM,UAAU,OAFC,MADK,SAAS,MAAM,OAAO,EAAA,CACnB,WAAW,aAAa,YAEpB,CAAC;AAChC;AAEA,eAAe,mBAAmB,SAAgC;CAChE,MAAM,OAAO,KAAK,QAAQ,MAAM,iBAAiB;CASjD,MAAM,UAAU,OANC,MAFK,SAAS,MAAM,OAAO,EAAA,CAEnB,QACvB,oBACA;+CAI2B,CAAC;AAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orama-cloud.d.ts","names":[],"sources":["../../src/plugins/orama-cloud.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"orama-cloud.d.ts","names":[],"sources":["../../src/plugins/orama-cloud.ts"],"mappings":";;iBAOgB,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as sourceDir, t as depVersions } from "../constants-
|
|
1
|
+
import { r as sourceDir, t as depVersions } from "../constants-79vschUq.js";
|
|
2
2
|
import { i as writeFile$1, n as pick, t as copy } from "../utils-BZh9vMXJ.js";
|
|
3
3
|
import { n as getCodeValue, t as createSourceFile } from "../shared-Bilr6W8M.js";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
@@ -204,6 +204,11 @@ See https://fumadocs.dev/docs/headless/search/orama-cloud for integrating Orama
|
|
|
204
204
|
mod.removeRoute("api/search");
|
|
205
205
|
});
|
|
206
206
|
else if (template.value.startsWith("+next")) await Promise.all([fs.unlink(path.join(appDir, "app/api/search/route.ts")).catch(() => null), writeFile$1(path.join(appDir, "app/static.json/route.ts"), route.next)]);
|
|
207
|
+
else if (template.value === "astro") await Promise.all([
|
|
208
|
+
fs.unlink(path.join(appDir, "pages/api/search.ts")).catch(() => null),
|
|
209
|
+
writeFile$1(path.join(appDir, "pages/static.json.ts"), route.astro),
|
|
210
|
+
writeFile$1(path.join(appDir, "lib/export-static-indexes.ts"), astroExportSearchIndexes)
|
|
211
|
+
]);
|
|
207
212
|
else await Promise.all([fs.unlink(path.join(appDir, "pages/_api/api/search.ts")).catch(() => null), writeFile$1(path.join(appDir, "pages/_api/static.json.ts"), route.waku)]);
|
|
208
213
|
const filePath = {
|
|
209
214
|
"+next+fuma-docs-mdx": ".next/server/app/static.json.body",
|
|
@@ -212,6 +217,7 @@ See https://fumadocs.dev/docs/headless/search/orama-cloud for integrating Orama
|
|
|
212
217
|
"tanstack-start-spa": "dist/client/static.json",
|
|
213
218
|
"react-router": "build/client/static.json",
|
|
214
219
|
"react-router-spa": "build/client/static.json",
|
|
220
|
+
astro: "dist/static.json",
|
|
215
221
|
waku: "dist/public/static.json"
|
|
216
222
|
}[template.value];
|
|
217
223
|
await writeFile$1(path.join(dest, "scripts/sync-content.ts"), `import { type OramaDocument, sync } from 'fumadocs-core/search/orama-cloud';
|
|
@@ -273,8 +279,29 @@ export async function GET() {
|
|
|
273
279
|
|
|
274
280
|
export const getConfig = () => ({
|
|
275
281
|
render: 'static',
|
|
276
|
-
})
|
|
282
|
+
});`,
|
|
283
|
+
astro: `import type { APIRoute } from 'astro';
|
|
284
|
+
import { exportSearchIndexes } from '@/lib/export-static-indexes';
|
|
285
|
+
|
|
286
|
+
export const GET: APIRoute = async () => {
|
|
287
|
+
return Response.json(await exportSearchIndexes());
|
|
288
|
+
};`
|
|
277
289
|
};
|
|
290
|
+
const astroExportSearchIndexes = `import { getStructuredData, source } from '@/lib/source';
|
|
291
|
+
import type { OramaDocument } from 'fumadocs-core/search/orama-cloud';
|
|
292
|
+
|
|
293
|
+
export async function exportSearchIndexes() {
|
|
294
|
+
return source.getPages().map((page) => {
|
|
295
|
+
return {
|
|
296
|
+
id: page.url,
|
|
297
|
+
structured: getStructuredData(page.data._raw),
|
|
298
|
+
url: page.url,
|
|
299
|
+
title: page.data.title,
|
|
300
|
+
description: page.data.description,
|
|
301
|
+
} satisfies OramaDocument;
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
`;
|
|
278
305
|
//#endregion
|
|
279
306
|
export { oramaCloud };
|
|
280
307
|
|