create-fumadocs-app 16.1.26 → 16.2.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/bin.js +71 -51
- package/dist/bin.js.map +1 -1
- package/dist/{constants-CUM-6EFt.js → constants-BN-PbHNc.js} +36 -25
- package/dist/{constants-CUM-6EFt.js.map → constants-BN-PbHNc.js.map} +1 -1
- package/dist/feature-BmBh9LJX.js +27 -0
- package/dist/feature-BmBh9LJX.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/plugins/feature.d.ts +7 -0
- package/dist/plugins/feature.d.ts.map +1 -0
- package/dist/plugins/feature.js +2 -0
- package/dist/plugins/next-use-src.d.ts +1 -2
- package/dist/plugins/next-use-src.d.ts.map +1 -1
- package/dist/{src-CFQISDh_.js → src-DN4YX_PA.js} +64 -4
- package/dist/src-DN4YX_PA.js.map +1 -0
- package/package.json +8 -11
- package/template/+next+fuma-docs-mdx/app/docs/[[...slug]]/page.tsx +2 -2
- package/template/+next+fuma-docs-mdx/app/llms-full.txt/route.ts +2 -5
- package/template/+next+fuma-docs-mdx/app/llms.mdx/docs/[[...slug]]/route.ts +3 -2
- package/template/+next+fuma-docs-mdx/app/llms.txt/route.ts +3 -4
- package/template/+next+fuma-docs-mdx/app/og/docs/[...slug]/route.tsx +8 -11
- package/template/+next+fuma-docs-mdx/lib/shared.ts +18 -0
- package/template/+next+fuma-docs-mdx/lib/source.ts +5 -25
- package/template/+next+fuma-docs-mdx/package.json +6 -6
- package/template/+next+fuma-docs-mdx+static/app/docs/[[...slug]]/page.tsx +2 -2
- package/template/+next+fuma-docs-mdx+static/app/llms-full.txt/route.ts +2 -5
- package/template/+next+fuma-docs-mdx+static/app/llms.mdx/docs/[[...slug]]/route.ts +3 -2
- package/template/+next+fuma-docs-mdx+static/app/llms.txt/route.ts +3 -4
- package/template/+next+fuma-docs-mdx+static/app/og/docs/[...slug]/route.tsx +8 -11
- package/template/+next+fuma-docs-mdx+static/lib/shared.ts +18 -0
- package/template/+next+fuma-docs-mdx+static/lib/source.ts +5 -25
- package/template/+next+fuma-docs-mdx+static/package.json +6 -6
- package/template/astro/package.json +4 -4
- package/template/astro/src/lib/shared.ts +11 -0
- package/template/astro/src/lib/source.ts +0 -6
- package/template/astro/src/pages/[...slug].astro +3 -2
- package/template/astro/src/pages/og/docs/[...slug]/image.webp.ts +7 -15
- package/template/react-router/app/lib/shared.ts +16 -4
- package/template/react-router/app/lib/source.ts +5 -16
- package/template/react-router/app/llms/full.ts +2 -5
- package/template/react-router/app/llms/index.ts +3 -4
- package/template/react-router/app/llms/mdx.ts +2 -2
- package/template/react-router/app/routes/docs.tsx +3 -3
- package/template/react-router/app/routes/og.docs.tsx +7 -10
- package/template/react-router/package.json +5 -5
- package/template/react-router/react-router.config.ts +2 -2
- package/template/react-router-spa/app/lib/shared.ts +10 -0
- package/template/react-router-spa/app/lib/source.ts +5 -16
- package/template/react-router-spa/app/llms/full.ts +2 -5
- package/template/react-router-spa/app/llms/index.ts +3 -4
- package/template/react-router-spa/app/llms/mdx.ts +2 -2
- package/template/react-router-spa/app/routes/docs.tsx +2 -2
- package/template/react-router-spa/package.json +4 -4
- package/template/tanstack-start/package.json +7 -7
- package/template/tanstack-start/src/lib/shared.ts +7 -3
- package/template/tanstack-start/src/lib/source.ts +5 -7
- package/template/tanstack-start/src/routes/docs/$.tsx +2 -2
- package/template/tanstack-start/src/routes/docs/{$}[.]md.ts +2 -2
- package/template/tanstack-start/src/routes/llms-full[.]txt.ts +2 -6
- package/template/tanstack-start/src/routes/llms[.]txt.ts +2 -5
- package/template/tanstack-start/src/start.ts +2 -2
- package/template/tanstack-start-spa/package.json +9 -9
- package/template/tanstack-start-spa/src/lib/shared.ts +7 -3
- package/template/tanstack-start-spa/src/lib/source.ts +5 -7
- package/template/tanstack-start-spa/src/routes/docs/$.tsx +2 -2
- package/template/tanstack-start-spa/src/routes/docs/{$}[.]md.ts +2 -2
- package/template/tanstack-start-spa/src/routes/llms-full[.]txt.ts +2 -6
- package/template/tanstack-start-spa/src/routes/llms[.]txt.ts +2 -5
- package/template/waku/package.json +5 -5
- package/template/waku/src/lib/shared.ts +18 -0
- package/template/waku/src/lib/source.ts +5 -22
- package/template/waku/src/pages/_api/llms-full.txt.ts +2 -4
- package/template/waku/src/pages/_api/llms.mdx/docs/[...slugs]/content.md.ts +2 -2
- package/template/waku/src/pages/_api/llms.txt.ts +3 -4
- package/template/waku/src/pages/_api/og/docs/[...slugs]/image.webp.tsx +7 -10
- package/template/waku/src/pages/docs/[...slugs].tsx +3 -3
- package/dist/plugins/ai.d.ts +0 -6
- package/dist/plugins/ai.d.ts.map +0 -1
- package/dist/plugins/ai.js +0 -90
- package/dist/plugins/ai.js.map +0 -1
- package/dist/plugins/biome.d.ts +0 -6
- package/dist/plugins/biome.d.ts.map +0 -1
- package/dist/plugins/biome.js +0 -95
- package/dist/plugins/biome.js.map +0 -1
- package/dist/plugins/eslint.d.ts +0 -6
- package/dist/plugins/eslint.d.ts.map +0 -1
- package/dist/plugins/eslint.js +0 -46
- package/dist/plugins/eslint.js.map +0 -1
- package/dist/plugins/next-use-takumi.d.ts +0 -6
- package/dist/plugins/next-use-takumi.d.ts.map +0 -1
- package/dist/plugins/next-use-takumi.js +0 -46
- package/dist/plugins/next-use-takumi.js.map +0 -1
- package/dist/plugins/orama-cloud.d.ts +0 -6
- package/dist/plugins/orama-cloud.d.ts.map +0 -1
- package/dist/plugins/orama-cloud.js +0 -299
- package/dist/plugins/orama-cloud.js.map +0 -1
- package/dist/plugins/oxlint.d.ts +0 -6
- package/dist/plugins/oxlint.d.ts.map +0 -1
- package/dist/plugins/oxlint.js +0 -71
- package/dist/plugins/oxlint.js.map +0 -1
- package/dist/shared-CcvF1NPu.js +0 -145
- package/dist/shared-CcvF1NPu.js.map +0 -1
- package/dist/src-CFQISDh_.js.map +0 -1
- package/dist/utils-BZh9vMXJ.js +0 -76
- package/dist/utils-BZh9vMXJ.js.map +0 -1
- package/template/+orama-cloud/@app/components/search.tsx +0 -54
- package/template/+orama-cloud/@app/lib/export-static-indexes.ts +0 -14
- package/template/+orama-cloud/@root/.env.example +0 -6
package/dist/bin.js
CHANGED
|
@@ -1,25 +1,48 @@
|
|
|
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-BN-PbHNc.js";
|
|
3
|
+
import { n as getPackageManager, r as managers, t as create } from "./src-DN4YX_PA.js";
|
|
4
|
+
import { t as feature } from "./feature-BmBh9LJX.js";
|
|
4
5
|
import fs from "node:fs/promises";
|
|
5
6
|
import path from "node:path";
|
|
6
7
|
import { cancel, confirm, group, intro, isCancel, outro, select, spinner, text } from "@clack/prompts";
|
|
7
8
|
import pc from "picocolors";
|
|
8
|
-
import {
|
|
9
|
+
import { cac } from "cac";
|
|
10
|
+
import { ai } from "@fumadocs/cli/features/ai";
|
|
11
|
+
import { lint } from "@fumadocs/cli/features/lint";
|
|
12
|
+
import { og } from "@fumadocs/cli/features/og";
|
|
13
|
+
import { search } from "@fumadocs/cli/features/search";
|
|
9
14
|
//#region src/bin.ts
|
|
10
|
-
const
|
|
15
|
+
const linters = [
|
|
11
16
|
"eslint",
|
|
12
17
|
"oxlint",
|
|
13
18
|
"biome"
|
|
14
|
-
]
|
|
19
|
+
];
|
|
20
|
+
const searchProviders = [
|
|
21
|
+
"orama",
|
|
22
|
+
"orama-cloud",
|
|
23
|
+
"algolia",
|
|
24
|
+
"typesense",
|
|
25
|
+
"mixedbread"
|
|
26
|
+
];
|
|
27
|
+
const ogImages = ["next-og", "takumi"];
|
|
28
|
+
const aiChats = [
|
|
15
29
|
"openrouter",
|
|
16
30
|
"llmgateway",
|
|
17
31
|
"inkeep"
|
|
18
|
-
]
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
32
|
+
];
|
|
33
|
+
const templateNames = templates.map((item) => item.value);
|
|
34
|
+
const cli = cac("create-fumadocs-app");
|
|
35
|
+
cli.command("[name]", "create a Fumadocs app, [name] is the project name").option("--src", "(Next.js only) enable `src/` directory").option("--install", "install packages automatically").option("--no-git", "disable auto Git repository initialization").option("-y, --yes", "skip prompts and use defaults for unspecified options").option("--linter <name>", `configure a linter/formatter, ESLint is currently Next.js only. (${linters.join(", ")})`).option("--search <name>", `configure a search solution (${searchProviders.join(", ")})`).option("--og-image <name>", `configure OG image generation (${ogImages.join(", ")})`).option("--ai-chat <name>", `configure AI chat (${aiChats.join(", ")})`).option("--template <name>", `choose a template (${templateNames.join(", ")})`).option("--pm <name>", `choose a package manager (${managers.join(", ")})`, { default: getPackageManager() }).action(main);
|
|
36
|
+
function checkOption(name, value, choices) {
|
|
37
|
+
if (value !== void 0 && !choices.includes(value)) throw new Error(`invalid value for --${name}: ${value}, expected: ${choices.join(", ")}`);
|
|
38
|
+
}
|
|
39
|
+
async function main(defaultName, config) {
|
|
40
|
+
checkOption("linter", config.linter, linters);
|
|
41
|
+
checkOption("search", config.search, searchProviders);
|
|
42
|
+
checkOption("og-image", config.ogImage, ogImages);
|
|
43
|
+
checkOption("ai-chat", config.aiChat, aiChats);
|
|
44
|
+
checkOption("template", config.template, templateNames);
|
|
45
|
+
checkOption("pm", config.pm, managers);
|
|
23
46
|
const skipPrompts = isCI || config.yes === true;
|
|
24
47
|
intro(pc.bgCyan(pc.bold("Create Fumadocs App")));
|
|
25
48
|
const options = await group({
|
|
@@ -92,15 +115,33 @@ async function main() {
|
|
|
92
115
|
if (skipPrompts) return "orama";
|
|
93
116
|
return select({
|
|
94
117
|
message: "Choose a search solution?",
|
|
95
|
-
options: [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
118
|
+
options: [
|
|
119
|
+
{
|
|
120
|
+
value: "orama",
|
|
121
|
+
label: "Default",
|
|
122
|
+
hint: "local search powered by ZBSearch, recommended"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
value: "orama-cloud",
|
|
126
|
+
label: "Orama Cloud",
|
|
127
|
+
hint: "3rd party search solution, signup needed"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
value: "algolia",
|
|
131
|
+
label: "Algolia",
|
|
132
|
+
hint: "signup needed"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
value: "typesense",
|
|
136
|
+
label: "Typesense",
|
|
137
|
+
hint: "self-hosted or cloud"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
value: "mixedbread",
|
|
141
|
+
label: "Mixedbread",
|
|
142
|
+
hint: "AI search, signup needed"
|
|
143
|
+
}
|
|
144
|
+
]
|
|
104
145
|
});
|
|
105
146
|
},
|
|
106
147
|
ogImage: async ({ results }) => {
|
|
@@ -170,35 +211,10 @@ async function main() {
|
|
|
170
211
|
const { nextUseSrc } = await import("./plugins/next-use-src.js");
|
|
171
212
|
plugins.push(nextUseSrc());
|
|
172
213
|
}
|
|
173
|
-
if (options.search
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
switch (options.lint) {
|
|
178
|
-
case "eslint": {
|
|
179
|
-
const { eslint } = await import("./plugins/eslint.js");
|
|
180
|
-
plugins.push(eslint());
|
|
181
|
-
break;
|
|
182
|
-
}
|
|
183
|
-
case "biome": {
|
|
184
|
-
const { biome } = await import("./plugins/biome.js");
|
|
185
|
-
plugins.push(biome());
|
|
186
|
-
break;
|
|
187
|
-
}
|
|
188
|
-
case "oxlint": {
|
|
189
|
-
const { oxlint } = await import("./plugins/oxlint.js");
|
|
190
|
-
plugins.push(oxlint());
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
if (options.ogImage === "takumi") {
|
|
195
|
-
const { nextUseTakumi } = await import("./plugins/next-use-takumi.js");
|
|
196
|
-
plugins.push(nextUseTakumi());
|
|
197
|
-
}
|
|
198
|
-
if (options.aiChat) {
|
|
199
|
-
const { ai } = await import("./plugins/ai.js");
|
|
200
|
-
plugins.push(ai(options.aiChat));
|
|
201
|
-
}
|
|
214
|
+
if (options.search !== "orama") plugins.push(feature(search, { provider: options.search }));
|
|
215
|
+
if (options.lint !== "disabled") plugins.push(feature(lint, { linter: options.lint }));
|
|
216
|
+
if (options.ogImage === "takumi" && options.template.startsWith("+next")) plugins.push(feature(og, { engine: "takumi" }));
|
|
217
|
+
if (options.aiChat) plugins.push(feature(ai, { provider: options.aiChat }));
|
|
202
218
|
await create({
|
|
203
219
|
packageManager: config.pm,
|
|
204
220
|
template: options.template,
|
|
@@ -243,10 +259,14 @@ async function checkDir(outputDir, skipPrompts) {
|
|
|
243
259
|
}));
|
|
244
260
|
info.stop(`Deleted files in ${outputDir}`);
|
|
245
261
|
}
|
|
246
|
-
|
|
247
|
-
|
|
262
|
+
cli.help();
|
|
263
|
+
try {
|
|
264
|
+
cli.parse(process.argv, { run: false });
|
|
265
|
+
await cli.runMatchedCommand();
|
|
266
|
+
} catch (e) {
|
|
267
|
+
console.error(pc.red(e instanceof Error ? e.message : String(e)));
|
|
248
268
|
process.exit(1);
|
|
249
|
-
}
|
|
269
|
+
}
|
|
250
270
|
//#endregion
|
|
251
271
|
export {};
|
|
252
272
|
|
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 .option('-y, --yes', 'skip prompts and use defaults for unspecified options')\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 const skipPrompts = isCI || config.yes === true;\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 (skipPrompts) 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 (skipPrompts) 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 (skipPrompts || !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 (skipPrompts) 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 (skipPrompts) 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 ZBSearch, 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 (skipPrompts) 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 skipPrompts ||\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 (skipPrompts) 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, skipPrompts);\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, skipPrompts: boolean) {\n const destDir = await fs.readdir(outputDir).catch(() => null);\n if (!destDir || destDir.length === 0) return;\n if (skipPrompts) {\n cancel(`directory ${outputDir} already exists and is not empty.`);\n process.exit(1);\n }\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,OAAO,aAAa,uDAAuD,CAAC,CAC5E,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,mBAAmB,CAAC,CAAC,QAAQ;CAC1D;CACA;CACA;AACF,CAAC,CACH,CAAC,CACA,UACC,IAAI,OAAO,qBAAqB,mBAAmB,CAAC,CAAC,QACnD,UAAU,KAAK,SAAS,KAAK,KAAK,CACpC,CACF,CAAC,CACA,UACC,IAAI,OAAO,eAAe,0BAA0B,CAAC,CAClD,QAAQ,QAAQ,CAAC,CACjB,QAAQ,kBAAkB,CAAC,CAChC;AAEF,eAAe,OAAsB;CACnC,QAAQ,MAAM,QAAQ,IAAI;CAC1B,MAAM,cAAc,QAAQ,KAAK;CACjC,M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AAO,OAAO,SAAS,OAAO,OAAO,OACvC,QAAQ,IAAI,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,CAAC;MAE3C,QAAQ,IAAI,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,CAAC;CAEzC,QAAQ,IAAI,GAAG,KAAK,4DAA4D,CAAC;CAEjF,QAAQ,KAAK,CAAC;AAChB;AAEA,eAAe,SAAS,WAAmB,aAAsB;CAC/D,MAAM,UAAU,MAAM,GAAG,QAAQ,SAAS,CAAC,CAAC,YAAY,IAAI;CAC5D,IAAI,CAAC,WAAW,QAAQ,WAAW,GAAG;CACtC,IAAI,aAAa;EACf,OAAO,aAAa,UAAU,kCAAkC;EAChE,QAAQ,KAAK,CAAC;CAChB;CACA,MAAM,MAAM,MAAM,QAAQ,EACxB,SAAS,aAAa,UAAU,mDAClC,CAAC;CAED,IAAI,SAAS,GAAG,GAAG;EACjB,OAAO;EACP,QAAQ,KAAK,CAAC;CAChB;CAEA,IAAI,CAAC,KAAK;CAEV,MAAM,OAAO,QAAQ;CACrB,KAAK,MAAM,qBAAqB,WAAW;CAE3C,MAAM,QAAQ,IACZ,QAAQ,KAAK,SAAS;EACpB,OAAO,GAAG,GAAG,KAAK,KAAK,WAAW,IAAI,GAAG;GACvC,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, type PackageManager } from './auto-install';\nimport { create, type Template, type TemplatePlugin } from './index';\nimport { isCI, templates } from './constants';\nimport { cac } from 'cac';\nimport { feature } from './plugins/feature';\nimport { ai, type AIProvider } from '@fumadocs/cli/features/ai';\nimport { lint } from '@fumadocs/cli/features/lint';\nimport { og } from '@fumadocs/cli/features/og';\nimport { search, type SearchProvider } from '@fumadocs/cli/features/search';\n\nconst linters = ['eslint', 'oxlint', 'biome'] as const;\nconst searchProviders = ['orama', 'orama-cloud', 'algolia', 'typesense', 'mixedbread'] as const;\nconst ogImages = ['next-og', 'takumi'] as const;\nconst aiChats = ['openrouter', 'llmgateway', 'inkeep'] as const;\nconst templateNames = templates.map((item) => item.value);\n\ninterface CliOptions {\n src?: boolean;\n install?: boolean;\n git: boolean;\n yes?: boolean;\n linter?: (typeof linters)[number];\n search?: SearchProvider | 'orama';\n ogImage?: (typeof ogImages)[number];\n aiChat?: AIProvider;\n template?: Template;\n pm: PackageManager;\n}\n\nconst cli = cac('create-fumadocs-app');\n\ncli\n .command('[name]', 'create a Fumadocs app, [name] is 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 .option('-y, --yes', 'skip prompts and use defaults for unspecified options')\n .option(\n '--linter <name>',\n `configure a linter/formatter, ESLint is currently Next.js only. (${linters.join(', ')})`,\n )\n .option('--search <name>', `configure a search solution (${searchProviders.join(', ')})`)\n .option('--og-image <name>', `configure OG image generation (${ogImages.join(', ')})`)\n .option('--ai-chat <name>', `configure AI chat (${aiChats.join(', ')})`)\n .option('--template <name>', `choose a template (${templateNames.join(', ')})`)\n .option('--pm <name>', `choose a package manager (${managers.join(', ')})`, {\n default: getPackageManager(),\n })\n .action(main);\n\nfunction checkOption(name: string, value: string | undefined, choices: readonly string[]) {\n if (value !== undefined && !choices.includes(value))\n throw new Error(`invalid value for --${name}: ${value}, expected: ${choices.join(', ')}`);\n}\n\nasync function main(defaultName: string | undefined, config: CliOptions): Promise<void> {\n checkOption('linter', config.linter, linters);\n checkOption('search', config.search, searchProviders);\n checkOption('og-image', config.ogImage, ogImages);\n checkOption('ai-chat', config.aiChat, aiChats);\n checkOption('template', config.template, templateNames);\n checkOption('pm', config.pm, managers);\n const skipPrompts = isCI || config.yes === true;\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 (skipPrompts) 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 (skipPrompts) 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 (skipPrompts || !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 (skipPrompts) 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 (skipPrompts) 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 ZBSearch, recommended',\n },\n {\n value: 'orama-cloud',\n label: 'Orama Cloud',\n hint: '3rd party search solution, signup needed',\n },\n { value: 'algolia', label: 'Algolia', hint: 'signup needed' },\n { value: 'typesense', label: 'Typesense', hint: 'self-hosted or cloud' },\n { value: 'mixedbread', label: 'Mixedbread', hint: 'AI search, signup needed' },\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 (skipPrompts) 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 skipPrompts ||\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 (skipPrompts) 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, skipPrompts);\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') plugins.push(feature(search, { provider: options.search }));\n if (options.lint !== 'disabled') plugins.push(feature(lint, { linter: options.lint }));\n if (options.ogImage === 'takumi' && options.template.startsWith('+next'))\n plugins.push(feature(og, { engine: 'takumi' }));\n if (options.aiChat) plugins.push(feature(ai, { provider: options.aiChat }));\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, skipPrompts: boolean) {\n const destDir = await fs.readdir(outputDir).catch(() => null);\n if (!destDir || destDir.length === 0) return;\n if (skipPrompts) {\n cancel(`directory ${outputDir} already exists and is not empty.`);\n process.exit(1);\n }\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\ncli.help();\n\ntry {\n cli.parse(process.argv, { run: false });\n await cli.runMatchedCommand();\n} catch (e) {\n console.error(pc.red(e instanceof Error ? e.message : String(e)));\n process.exit(1);\n}\n"],"mappings":";;;;;;;;;;;;;;AAyBA,MAAM,UAAU;CAAC;CAAU;CAAU;AAAO;AAC5C,MAAM,kBAAkB;CAAC;CAAS;CAAe;CAAW;CAAa;A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,OAAO,GAAG,KAAK,CAAC;CAEzC,QAAQ,IAAI,GAAG,KAAK,4DAA4D,CAAC;CAEjF,QAAQ,KAAK,CAAC;AAChB;AAEA,eAAe,SAAS,WAAmB,aAAsB;CAC/D,MAAM,UAAU,MAAM,GAAG,QAAQ,SAAS,CAAC,CAAC,YAAY,IAAI;CAC5D,IAAI,CAAC,WAAW,QAAQ,WAAW,GAAG;CACtC,IAAI,aAAa;EACf,OAAO,aAAa,UAAU,kCAAkC;EAChE,QAAQ,KAAK,CAAC;CAChB;CACA,MAAM,MAAM,MAAM,QAAQ,EACxB,SAAS,aAAa,UAAU,mDAClC,CAAC;CAED,IAAI,SAAS,GAAG,GAAG;EACjB,OAAO;EACP,QAAQ,KAAK,CAAC;CAChB;CAEA,IAAI,CAAC,KAAK;CAEV,MAAM,OAAO,QAAQ;CACrB,KAAK,MAAM,qBAAqB,WAAW;CAE3C,MAAM,QAAQ,IACZ,QAAQ,KAAK,SAAS;EACpB,OAAO,GAAG,GAAG,KAAK,KAAK,WAAW,IAAI,GAAG;GACvC,WAAW;GACX,OAAO;EACT,CAAC;CACH,CAAC,CACH;CAEA,KAAK,KAAK,oBAAoB,WAAW;AAC3C;AAEA,IAAI,KAAK;AAET,IAAI;CACF,IAAI,MAAM,QAAQ,MAAM,EAAE,KAAK,MAAM,CAAC;CACtC,MAAM,IAAI,kBAAkB;AAC9B,SAAS,GAAG;CACV,QAAQ,MAAM,GAAG,IAAI,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC,CAAC,CAAC;CAChE,QAAQ,KAAK,CAAC;AAChB"}
|
|
@@ -13,14 +13,18 @@ var __exportAll = (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.12",
|
|
17
|
+
"@mixedbread/sdk": "^0.77.0",
|
|
17
18
|
"@orama/core": "^1.2.19",
|
|
19
|
+
"algoliasearch": "^5.57.0",
|
|
18
20
|
"fumadocs-core": "workspace:*",
|
|
19
21
|
"fumadocs-mdx": "workspace:*",
|
|
20
22
|
"fumadocs-ui": "workspace:*",
|
|
21
|
-
"oxlint": "^1.
|
|
23
|
+
"oxlint": "^1.82.0",
|
|
22
24
|
"react": "^19.2.8",
|
|
23
|
-
"takumi-js": "^2.13.
|
|
25
|
+
"takumi-js": "^2.13.7",
|
|
26
|
+
"typesense": "^3.0.6",
|
|
27
|
+
"typesense-fumadocs-adapter": "^0.4.3"
|
|
24
28
|
};
|
|
25
29
|
//#endregion
|
|
26
30
|
//#region ../core/package.json
|
|
@@ -43,11 +47,12 @@ var package_exports$2 = /* @__PURE__ */ __exportAll({
|
|
|
43
47
|
publishConfig: () => publishConfig$2,
|
|
44
48
|
repository: () => repository$2,
|
|
45
49
|
scripts: () => scripts$2,
|
|
50
|
+
sideEffects: () => sideEffects,
|
|
46
51
|
type: () => type$2,
|
|
47
52
|
version: () => version$2
|
|
48
53
|
});
|
|
49
54
|
var name$2 = "fumadocs-core";
|
|
50
|
-
var version$2 = "16.15.
|
|
55
|
+
var version$2 = "16.15.9";
|
|
51
56
|
var description$2 = "The React.js library for building a documentation website";
|
|
52
57
|
var keywords$2 = ["Docs", "Fumadocs"];
|
|
53
58
|
var homepage$2 = "https://fumadocs.dev";
|
|
@@ -57,6 +62,7 @@ var author$2 = "Fuma Nama";
|
|
|
57
62
|
var repository$2 = "github:fuma-nama/fumadocs";
|
|
58
63
|
var files$2 = ["dist"];
|
|
59
64
|
var type$2 = "module";
|
|
65
|
+
var sideEffects = false;
|
|
60
66
|
var exports$2 = {
|
|
61
67
|
"./breadcrumb": "./dist/breadcrumb.js",
|
|
62
68
|
"./content/github": "./dist/content/github.js",
|
|
@@ -80,6 +86,7 @@ var exports$2 = {
|
|
|
80
86
|
"./i18n": "./dist/i18n/index.js",
|
|
81
87
|
"./i18n/middleware": "./dist/i18n/middleware.js",
|
|
82
88
|
"./link": "./dist/link.js",
|
|
89
|
+
"./mcp": "./dist/mcp.js",
|
|
83
90
|
"./mdx-plugins": "./dist/mdx-plugins/index.js",
|
|
84
91
|
"./mdx-plugins/codeblock-utils": "./dist/mdx-plugins/codeblock-utils.js",
|
|
85
92
|
"./mdx-plugins/rehype-code": "./dist/mdx-plugins/rehype-code.js",
|
|
@@ -174,19 +181,20 @@ var devDependencies$2 = {
|
|
|
174
181
|
"@formatjs/intl-localematcher": "^0.8.13",
|
|
175
182
|
"@mdx-js/mdx": "^3.1.1",
|
|
176
183
|
"@mixedbread/sdk": "0.77.0",
|
|
184
|
+
"@modelcontextprotocol/server": "2.0.0",
|
|
177
185
|
"@orama/core": "^1.2.19",
|
|
178
186
|
"@oramacloud/client": "^2.1.4",
|
|
179
187
|
"@shikijs/transformers": "^4.4.3",
|
|
180
|
-
"@tanstack/react-router": "1.170.
|
|
188
|
+
"@tanstack/react-router": "1.170.33",
|
|
181
189
|
"@types/estree-jsx": "^1.0.5",
|
|
182
190
|
"@types/hast": "^3.0.5",
|
|
183
191
|
"@types/mdast": "^4.0.4",
|
|
184
|
-
"@types/node": "26.
|
|
192
|
+
"@types/node": "26.5.0",
|
|
185
193
|
"@types/react": "^19.2.18",
|
|
186
|
-
"@types/react-dom": "^19.2.
|
|
194
|
+
"@types/react-dom": "^19.2.7",
|
|
187
195
|
"algoliasearch": "5.57.0",
|
|
188
196
|
"flexsearch": "^0.8.212",
|
|
189
|
-
"lucide-react": "^1.
|
|
197
|
+
"lucide-react": "^1.43.0",
|
|
190
198
|
"next": "16.3.4",
|
|
191
199
|
"path-to-regexp": "^8.4.2",
|
|
192
200
|
"react-router": "^8.3.1",
|
|
@@ -194,7 +202,7 @@ var devDependencies$2 = {
|
|
|
194
202
|
"remark-mdx": "^3.1.1",
|
|
195
203
|
"remove-markdown": "^0.7.0",
|
|
196
204
|
"tsconfig": "workspace:*",
|
|
197
|
-
"tsdown": "0.
|
|
205
|
+
"tsdown": "0.23.0",
|
|
198
206
|
"typescript": "^7.0.2",
|
|
199
207
|
"waku": "1.0.0-rc.0",
|
|
200
208
|
"zod": "4.5.4"
|
|
@@ -202,6 +210,7 @@ var devDependencies$2 = {
|
|
|
202
210
|
var peerDependencies$2 = {
|
|
203
211
|
"@mdx-js/mdx": "*",
|
|
204
212
|
"@mixedbread/sdk": "0.x.x",
|
|
213
|
+
"@modelcontextprotocol/server": "2.x.x",
|
|
205
214
|
"@orama/core": "1.x.x",
|
|
206
215
|
"@oramacloud/client": "2.x.x",
|
|
207
216
|
"@tanstack/react-router": "1.x.x",
|
|
@@ -226,6 +235,7 @@ var peerDependenciesMeta$2 = {
|
|
|
226
235
|
"@types/hast": { "optional": true },
|
|
227
236
|
"@types/mdast": { "optional": true },
|
|
228
237
|
"@mixedbread/sdk": { "optional": true },
|
|
238
|
+
"@modelcontextprotocol/server": { "optional": true },
|
|
229
239
|
"@types/react": { "optional": true },
|
|
230
240
|
"@orama/core": { "optional": true },
|
|
231
241
|
"@oramacloud/client": { "optional": true },
|
|
@@ -258,6 +268,7 @@ var package_default$2 = {
|
|
|
258
268
|
repository: repository$2,
|
|
259
269
|
files: files$2,
|
|
260
270
|
type: type$2,
|
|
271
|
+
sideEffects,
|
|
261
272
|
exports: exports$2,
|
|
262
273
|
publishConfig: publishConfig$2,
|
|
263
274
|
scripts: scripts$2,
|
|
@@ -347,23 +358,23 @@ var dependencies$1 = {
|
|
|
347
358
|
"mdast-util-mdx": "^3.0.0",
|
|
348
359
|
"picocolors": "^1.1.1",
|
|
349
360
|
"picomatch": "^4.0.7",
|
|
350
|
-
"tinyexec": "^1.3.
|
|
361
|
+
"tinyexec": "^1.3.1",
|
|
351
362
|
"tinyglobby": "^0.2.17",
|
|
352
363
|
"unified": "^11.0.5",
|
|
353
364
|
"unist-util-remove-position": "^5.0.0",
|
|
354
365
|
"unist-util-visit": "^5.1.0",
|
|
355
366
|
"vfile": "^6.0.3",
|
|
356
367
|
"yaml": "^2.9.0",
|
|
357
|
-
"yuku-analyzer": "^0.9.
|
|
368
|
+
"yuku-analyzer": "^0.9.5",
|
|
358
369
|
"zod": "^4.5.4"
|
|
359
370
|
};
|
|
360
371
|
var devDependencies$1 = {
|
|
361
372
|
"@fumadocs/satteri": "workspace:*",
|
|
362
373
|
"@fumadocs/vite": "workspace:*",
|
|
363
|
-
"@types/bun": "^1.4.
|
|
374
|
+
"@types/bun": "^1.4.2",
|
|
364
375
|
"@types/mdast": "^4.0.4",
|
|
365
376
|
"@types/mdx": "^2.0.14",
|
|
366
|
-
"@types/node": "^26.
|
|
377
|
+
"@types/node": "^26.5.0",
|
|
367
378
|
"@types/picomatch": "^4.0.3",
|
|
368
379
|
"@types/react": "^19.2.18",
|
|
369
380
|
"fumadocs-core": "workspace:*",
|
|
@@ -373,10 +384,10 @@ var devDependencies$1 = {
|
|
|
373
384
|
"remark": "^15.0.1",
|
|
374
385
|
"remark-directive": "^4.0.0",
|
|
375
386
|
"remark-mdx": "^3.1.1",
|
|
376
|
-
"rolldown": "^1.2.
|
|
387
|
+
"rolldown": "^1.2.7",
|
|
377
388
|
"satteri": "^0.10.5",
|
|
378
389
|
"tsconfig": "workspace:*",
|
|
379
|
-
"tsdown": "0.
|
|
390
|
+
"tsdown": "0.23.0",
|
|
380
391
|
"vite": "^8.2.2",
|
|
381
392
|
"webpack": "^5.110.3"
|
|
382
393
|
};
|
|
@@ -450,7 +461,7 @@ var package_exports = /* @__PURE__ */ __exportAll({
|
|
|
450
461
|
version: () => version
|
|
451
462
|
});
|
|
452
463
|
var name = "@fumadocs/base-ui";
|
|
453
|
-
var version = "16.15.
|
|
464
|
+
var version = "16.15.9";
|
|
454
465
|
var description = "The Base UI version of Fumadocs UI";
|
|
455
466
|
var keywords = ["Docs", "Fumadocs"];
|
|
456
467
|
var homepage = "https://fumadocs.dev";
|
|
@@ -572,13 +583,13 @@ var scripts = {
|
|
|
572
583
|
"types:check": "tsc --noEmit"
|
|
573
584
|
};
|
|
574
585
|
var dependencies = {
|
|
575
|
-
"@base-ui/react": "^1.
|
|
586
|
+
"@base-ui/react": "^1.8.0",
|
|
576
587
|
"@fuma-translate/react": "^1.0.2",
|
|
577
588
|
"@fumadocs/tailwind": "workspace:*",
|
|
578
589
|
"class-variance-authority": "^0.7.1",
|
|
579
|
-
"cn": "^0.2.
|
|
580
|
-
"lucide-react": "^1.
|
|
581
|
-
"motion": "^13.
|
|
590
|
+
"cn": "^0.2.6",
|
|
591
|
+
"lucide-react": "^1.43.0",
|
|
592
|
+
"motion": "^13.2.0",
|
|
582
593
|
"next-themes": "^0.4.6",
|
|
583
594
|
"react-remove-scroll": "^2.7.2",
|
|
584
595
|
"rehype-raw": "^7.0.0",
|
|
@@ -590,18 +601,18 @@ var devDependencies = {
|
|
|
590
601
|
"@fumadocs/cli": "workspace:*",
|
|
591
602
|
"@tailwindcss/cli": "^4.3.3",
|
|
592
603
|
"@tailwindcss/oxide": "^4.3.3",
|
|
593
|
-
"@tsdown/css": "^0.
|
|
604
|
+
"@tsdown/css": "^0.23.0",
|
|
594
605
|
"@types/hast": "^3.0.5",
|
|
595
606
|
"@types/mdx": "^2.0.14",
|
|
596
|
-
"@types/node": "^26.
|
|
607
|
+
"@types/node": "^26.5.0",
|
|
597
608
|
"@types/react": "^19.2.18",
|
|
598
|
-
"@types/react-dom": "^19.2.
|
|
609
|
+
"@types/react-dom": "^19.2.7",
|
|
599
610
|
"fuma-cli": "^0.1.1",
|
|
600
611
|
"fumadocs-core": "workspace:*",
|
|
601
612
|
"react-medium-image-zoom": "^5.4.9",
|
|
602
613
|
"tailwindcss": "^4.3.3",
|
|
603
614
|
"tsconfig": "workspace:*",
|
|
604
|
-
"tsdown": "0.
|
|
615
|
+
"tsdown": "0.23.0",
|
|
605
616
|
"unified": "^11.0.5"
|
|
606
617
|
};
|
|
607
618
|
var peerDependencies = {
|
|
@@ -710,4 +721,4 @@ depVersions["fumadocs-ui"] = `npm:${name}@${version}`;
|
|
|
710
721
|
//#endregion
|
|
711
722
|
export { templates as i, isCI as n, sourceDir as r, depVersions as t };
|
|
712
723
|
|
|
713
|
-
//# sourceMappingURL=constants-
|
|
724
|
+
//# sourceMappingURL=constants-BN-PbHNc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants-
|
|
1
|
+
{"version":3,"file":"constants-BN-PbHNc.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: powerful and mature',\n appDir: '',\n rootProviderPath: 'app/layout.tsx',\n },\n {\n value: 'waku',\n label: 'Waku: Fumadocs MDX',\n hint: 'recommended: fast and simple',\n appDir: 'src',\n rootProviderPath: 'components/provider.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: '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 value: 'astro',\n label: 'Astro: React Islands',\n hint: 'partial support only, uses Astro Content Collections.',\n appDir: 'src',\n rootProviderPath: 'components/docs.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AIMA,MAAa,YAAY,cAAc,IAAI,IAAI,OAAO,YAAY,GAAG,CAAC,CAAC,IAAI;AAE3E,MAAa,OAAO,QAAQ,QAAQ,IAAI,EAAE;AAyB1C,MAAa,YAA4B;CACvC;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,kBAAkB;CACpB;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,kBAAkB;CACpB;CACA;EACE,OAAO;EACP,OAAO;EACP,QAAQ;EACR,kBAAkB;CACpB;CACA;EACE,OAAO;EACP,OAAO;EACP,QAAQ;EACR,kBAAkB;CACpB;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,kBAAkB;CACpB;CACA;EACE,OAAO;EACP,OAAO;EACP,QAAQ;EACR,kBAAkB;CACpB;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,kBAAkB;CACpB;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,kBAAkB;CACpB;AACF;AAEA,MAAM,aAAa;CAACA;CAASC;CAAQC;AAAO;AAE5C,MAAa,cAAcC;AAE3B,KAAK,MAAM,aAAa,YACtB,YAAY,UAAU,QAAoC,UAAU;AAGtE,YAAY,iBAAiB,OAAOC,KAAa,GAAGC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { t as depVersions } from "./constants-BN-PbHNc.js";
|
|
2
|
+
import { HttpRegistryConnector } from "fuma-cli/registry/connector";
|
|
3
|
+
import { getDefaultConfig } from "@fumadocs/cli/config";
|
|
4
|
+
import { runFeature } from "@fumadocs/cli/features";
|
|
5
|
+
import { loadProject } from "@fumadocs/cli/project";
|
|
6
|
+
//#region src/plugins/feature.ts
|
|
7
|
+
/** apply a Fumadocs CLI feature to the generated project */
|
|
8
|
+
function feature(feature, options) {
|
|
9
|
+
return { async afterWrite() {
|
|
10
|
+
const config = await getDefaultConfig(this.dest);
|
|
11
|
+
const project = await loadProject(config, this.dest);
|
|
12
|
+
await runFeature(feature, options, {
|
|
13
|
+
project,
|
|
14
|
+
connector: new HttpRegistryConnector("https://fumadocs.dev/registry"),
|
|
15
|
+
versions: depVersions,
|
|
16
|
+
io: {
|
|
17
|
+
log: this.log,
|
|
18
|
+
installDependencies: false,
|
|
19
|
+
confirmOverwrite: async () => true
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
} };
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { feature as t };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=feature-BmBh9LJX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-BmBh9LJX.js","names":[],"sources":["../src/plugins/feature.ts"],"sourcesContent":["import type { TemplatePlugin } from '@/index';\nimport { HttpRegistryConnector } from 'fuma-cli/registry/connector';\nimport { getDefaultConfig } from '@fumadocs/cli/config';\nimport { type Feature, runFeature } from '@fumadocs/cli/features';\nimport { loadProject } from '@fumadocs/cli/project';\nimport { depVersions } from '@/constants';\n\n/** apply a Fumadocs CLI feature to the generated project */\nexport function feature<O extends object>(feature: Feature<O>, options: O): TemplatePlugin {\n return {\n async afterWrite() {\n const config = await getDefaultConfig(this.dest);\n const project = await loadProject(config, this.dest);\n\n await runFeature(feature, options, {\n project,\n connector: new HttpRegistryConnector('https://fumadocs.dev/registry'),\n versions: depVersions,\n io: { log: this.log, installDependencies: false, confirmOverwrite: async () => true },\n });\n },\n };\n}\n"],"mappings":";;;;;;;AAQA,SAAgB,QAA0B,SAAqB,SAA4B;CACzF,OAAO,EACL,MAAM,aAAa;EACjB,MAAM,SAAS,MAAM,iBAAiB,KAAK,IAAI;EAC/C,MAAM,UAAU,MAAM,YAAY,QAAQ,KAAK,IAAI;EAEnD,MAAM,WAAW,SAAS,SAAS;GACjC;GACA,WAAW,IAAI,sBAAsB,+BAA+B;GACpE,UAAU;GACV,IAAI;IAAE,KAAK,KAAK;IAAK,qBAAqB;IAAO,kBAAkB,YAAY;GAAK;EACtF,CAAC;CACH,EACF;AACF"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as create } from "./src-
|
|
1
|
+
import { t as create } from "./src-DN4YX_PA.js";
|
|
2
2
|
export { create };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { i as TemplatePlugin } from "../index-DngbqLn1.js";
|
|
2
|
+
import { Feature } from "@fumadocs/cli/features";
|
|
3
|
+
//#region src/plugins/feature.d.ts
|
|
4
|
+
/** apply a Fumadocs CLI feature to the generated project */
|
|
5
|
+
export declare function feature<O extends object>(feature: Feature<O>, options: O): TemplatePlugin;
|
|
6
|
+
//#endregion
|
|
7
|
+
//# sourceMappingURL=feature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.d.ts","names":[],"sources":["../../src/plugins/feature.ts"],"mappings":";;;;wBAQgB,QAAQ,kBAAkB,SAAS,QAAQ,IAAI,SAAS,IAAI"}
|
|
@@ -3,7 +3,6 @@ import { i as TemplatePlugin } from "../index-DngbqLn1.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Use `src` for app directory
|
|
5
5
|
*/
|
|
6
|
-
declare function nextUseSrc(): TemplatePlugin;
|
|
6
|
+
export declare function nextUseSrc(): TemplatePlugin;
|
|
7
7
|
//#endregion
|
|
8
|
-
export { nextUseSrc };
|
|
9
8
|
//# sourceMappingURL=next-use-src.d.ts.map
|
|
@@ -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":";;;;;wBAOgB,cAAc"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { i as templates, r as sourceDir, t as depVersions } from "./constants-
|
|
2
|
-
import { r as tryGitInit, t as copy } from "./utils-BZh9vMXJ.js";
|
|
1
|
+
import { i as templates, r as sourceDir, t as depVersions } from "./constants-BN-PbHNc.js";
|
|
3
2
|
import fs from "node:fs/promises";
|
|
4
|
-
import path from "node:path";
|
|
3
|
+
import path, { join } from "node:path";
|
|
5
4
|
import { x } from "tinyexec";
|
|
6
5
|
//#region src/auto-install.ts
|
|
7
6
|
const managers = [
|
|
@@ -31,6 +30,67 @@ async function autoInstall(manager, dest) {
|
|
|
31
30
|
});
|
|
32
31
|
}
|
|
33
32
|
//#endregion
|
|
33
|
+
//#region src/utils.ts
|
|
34
|
+
async function copy(from, to, options = {}) {
|
|
35
|
+
const { rename = (s) => s, filterDir = () => true, filter = () => true } = options;
|
|
36
|
+
const stats = await fs.stat(from);
|
|
37
|
+
if (stats.isDirectory() && filterDir(from)) {
|
|
38
|
+
const files = await fs.readdir(from);
|
|
39
|
+
await Promise.all(files.map((file) => copy(path.join(from, file), path.join(to, file), options)));
|
|
40
|
+
}
|
|
41
|
+
if (stats.isFile() && filter(from)) {
|
|
42
|
+
to = rename(to);
|
|
43
|
+
await fs.mkdir(path.dirname(to), { recursive: true });
|
|
44
|
+
await fs.copyFile(from, to);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async function isInGitRepository(cwd) {
|
|
48
|
+
const { exitCode } = await x("git", ["rev-parse", "--is-inside-work-tree"], { nodeOptions: { cwd } });
|
|
49
|
+
return exitCode === 0;
|
|
50
|
+
}
|
|
51
|
+
async function isDefaultBranchSet(cwd) {
|
|
52
|
+
const { exitCode } = await x("git", ["config", "init.defaultBranch"], { nodeOptions: { cwd } });
|
|
53
|
+
return exitCode === 0;
|
|
54
|
+
}
|
|
55
|
+
async function tryGitInit(cwd) {
|
|
56
|
+
const { exitCode } = await x("git", ["--version"]);
|
|
57
|
+
if (exitCode !== 0) return false;
|
|
58
|
+
if (await isInGitRepository(cwd)) return false;
|
|
59
|
+
try {
|
|
60
|
+
await x("git", ["init"], {
|
|
61
|
+
throwOnError: true,
|
|
62
|
+
nodeOptions: { cwd }
|
|
63
|
+
});
|
|
64
|
+
if (!await isDefaultBranchSet(cwd)) await x("git", [
|
|
65
|
+
"checkout",
|
|
66
|
+
"-b",
|
|
67
|
+
"main"
|
|
68
|
+
], {
|
|
69
|
+
throwOnError: true,
|
|
70
|
+
nodeOptions: { cwd }
|
|
71
|
+
});
|
|
72
|
+
await x("git", ["add", "-A"], {
|
|
73
|
+
throwOnError: true,
|
|
74
|
+
nodeOptions: { cwd }
|
|
75
|
+
});
|
|
76
|
+
await x("git", [
|
|
77
|
+
"commit",
|
|
78
|
+
"-m",
|
|
79
|
+
"Initial commit from Create Fumadocs App"
|
|
80
|
+
], {
|
|
81
|
+
throwOnError: true,
|
|
82
|
+
nodeOptions: { cwd }
|
|
83
|
+
});
|
|
84
|
+
return true;
|
|
85
|
+
} catch {
|
|
86
|
+
await fs.rm(join(cwd, ".git"), {
|
|
87
|
+
recursive: true,
|
|
88
|
+
force: true
|
|
89
|
+
});
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
34
94
|
//#region src/index.ts
|
|
35
95
|
async function create(createOptions) {
|
|
36
96
|
const { outputDir, plugins = [], packageManager = "npm", initializeGit = false, installDeps = false, log = console.log } = createOptions;
|
|
@@ -85,4 +145,4 @@ async function initPackageJson(projectName, packageJsonPath) {
|
|
|
85
145
|
//#endregion
|
|
86
146
|
export { getPackageManager as n, managers as r, create as t };
|
|
87
147
|
|
|
88
|
-
//# sourceMappingURL=src-
|
|
148
|
+
//# sourceMappingURL=src-DN4YX_PA.js.map
|