create-fumadocs-app 16.1.25 → 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.
Files changed (107) hide show
  1. package/dist/bin.js +86 -61
  2. package/dist/bin.js.map +1 -1
  3. package/dist/{constants-DcFItL2q.js → constants-BN-PbHNc.js} +36 -25
  4. package/dist/{constants-DcFItL2q.js.map → constants-BN-PbHNc.js.map} +1 -1
  5. package/dist/feature-BmBh9LJX.js +27 -0
  6. package/dist/feature-BmBh9LJX.js.map +1 -0
  7. package/dist/index.js +1 -1
  8. package/dist/plugins/feature.d.ts +7 -0
  9. package/dist/plugins/feature.d.ts.map +1 -0
  10. package/dist/plugins/feature.js +2 -0
  11. package/dist/plugins/next-use-src.d.ts +1 -2
  12. package/dist/plugins/next-use-src.d.ts.map +1 -1
  13. package/dist/{src-Cu_0JPcZ.js → src-DN4YX_PA.js} +64 -4
  14. package/dist/src-DN4YX_PA.js.map +1 -0
  15. package/package.json +8 -11
  16. package/template/+next+fuma-docs-mdx/app/docs/[[...slug]]/page.tsx +2 -2
  17. package/template/+next+fuma-docs-mdx/app/llms-full.txt/route.ts +2 -5
  18. package/template/+next+fuma-docs-mdx/app/llms.mdx/docs/[[...slug]]/route.ts +3 -2
  19. package/template/+next+fuma-docs-mdx/app/llms.txt/route.ts +3 -4
  20. package/template/+next+fuma-docs-mdx/app/og/docs/[...slug]/route.tsx +8 -11
  21. package/template/+next+fuma-docs-mdx/lib/shared.ts +18 -0
  22. package/template/+next+fuma-docs-mdx/lib/source.ts +5 -25
  23. package/template/+next+fuma-docs-mdx/package.json +6 -6
  24. package/template/+next+fuma-docs-mdx+static/app/docs/[[...slug]]/page.tsx +2 -2
  25. package/template/+next+fuma-docs-mdx+static/app/llms-full.txt/route.ts +2 -5
  26. package/template/+next+fuma-docs-mdx+static/app/llms.mdx/docs/[[...slug]]/route.ts +3 -2
  27. package/template/+next+fuma-docs-mdx+static/app/llms.txt/route.ts +3 -4
  28. package/template/+next+fuma-docs-mdx+static/app/og/docs/[...slug]/route.tsx +8 -11
  29. package/template/+next+fuma-docs-mdx+static/lib/shared.ts +18 -0
  30. package/template/+next+fuma-docs-mdx+static/lib/source.ts +5 -25
  31. package/template/+next+fuma-docs-mdx+static/package.json +6 -6
  32. package/template/astro/package.json +4 -4
  33. package/template/astro/src/lib/shared.ts +11 -0
  34. package/template/astro/src/lib/source.ts +0 -6
  35. package/template/astro/src/pages/[...slug].astro +3 -2
  36. package/template/astro/src/pages/og/docs/[...slug]/image.webp.ts +7 -15
  37. package/template/react-router/app/lib/shared.ts +16 -4
  38. package/template/react-router/app/lib/source.ts +5 -16
  39. package/template/react-router/app/llms/full.ts +2 -5
  40. package/template/react-router/app/llms/index.ts +3 -4
  41. package/template/react-router/app/llms/mdx.ts +2 -2
  42. package/template/react-router/app/routes/docs.tsx +3 -3
  43. package/template/react-router/app/routes/og.docs.tsx +7 -10
  44. package/template/react-router/package.json +5 -5
  45. package/template/react-router/react-router.config.ts +2 -2
  46. package/template/react-router-spa/app/lib/shared.ts +10 -0
  47. package/template/react-router-spa/app/lib/source.ts +5 -16
  48. package/template/react-router-spa/app/llms/full.ts +2 -5
  49. package/template/react-router-spa/app/llms/index.ts +3 -4
  50. package/template/react-router-spa/app/llms/mdx.ts +2 -2
  51. package/template/react-router-spa/app/routes/docs.tsx +2 -2
  52. package/template/react-router-spa/package.json +4 -4
  53. package/template/tanstack-start/package.json +7 -7
  54. package/template/tanstack-start/src/lib/shared.ts +7 -3
  55. package/template/tanstack-start/src/lib/source.ts +5 -7
  56. package/template/tanstack-start/src/routes/docs/$.tsx +2 -2
  57. package/template/tanstack-start/src/routes/docs/{$}[.]md.ts +2 -2
  58. package/template/tanstack-start/src/routes/llms-full[.]txt.ts +2 -6
  59. package/template/tanstack-start/src/routes/llms[.]txt.ts +2 -5
  60. package/template/tanstack-start/src/start.ts +2 -2
  61. package/template/tanstack-start-spa/package.json +9 -9
  62. package/template/tanstack-start-spa/src/lib/shared.ts +7 -3
  63. package/template/tanstack-start-spa/src/lib/source.ts +5 -7
  64. package/template/tanstack-start-spa/src/routes/docs/$.tsx +2 -2
  65. package/template/tanstack-start-spa/src/routes/docs/{$}[.]md.ts +2 -2
  66. package/template/tanstack-start-spa/src/routes/llms-full[.]txt.ts +2 -6
  67. package/template/tanstack-start-spa/src/routes/llms[.]txt.ts +2 -5
  68. package/template/waku/package.json +5 -5
  69. package/template/waku/src/lib/shared.ts +18 -0
  70. package/template/waku/src/lib/source.ts +5 -22
  71. package/template/waku/src/pages/_api/llms-full.txt.ts +2 -4
  72. package/template/waku/src/pages/_api/llms.mdx/docs/[...slugs]/content.md.ts +2 -2
  73. package/template/waku/src/pages/_api/llms.txt.ts +3 -4
  74. package/template/waku/src/pages/_api/og/docs/[...slugs]/image.webp.tsx +7 -10
  75. package/template/waku/src/pages/docs/[...slugs].tsx +3 -3
  76. package/dist/plugins/ai.d.ts +0 -6
  77. package/dist/plugins/ai.d.ts.map +0 -1
  78. package/dist/plugins/ai.js +0 -90
  79. package/dist/plugins/ai.js.map +0 -1
  80. package/dist/plugins/biome.d.ts +0 -6
  81. package/dist/plugins/biome.d.ts.map +0 -1
  82. package/dist/plugins/biome.js +0 -95
  83. package/dist/plugins/biome.js.map +0 -1
  84. package/dist/plugins/eslint.d.ts +0 -6
  85. package/dist/plugins/eslint.d.ts.map +0 -1
  86. package/dist/plugins/eslint.js +0 -46
  87. package/dist/plugins/eslint.js.map +0 -1
  88. package/dist/plugins/next-use-takumi.d.ts +0 -6
  89. package/dist/plugins/next-use-takumi.d.ts.map +0 -1
  90. package/dist/plugins/next-use-takumi.js +0 -46
  91. package/dist/plugins/next-use-takumi.js.map +0 -1
  92. package/dist/plugins/orama-cloud.d.ts +0 -6
  93. package/dist/plugins/orama-cloud.d.ts.map +0 -1
  94. package/dist/plugins/orama-cloud.js +0 -299
  95. package/dist/plugins/orama-cloud.js.map +0 -1
  96. package/dist/plugins/oxlint.d.ts +0 -6
  97. package/dist/plugins/oxlint.d.ts.map +0 -1
  98. package/dist/plugins/oxlint.js +0 -71
  99. package/dist/plugins/oxlint.js.map +0 -1
  100. package/dist/shared-CcvF1NPu.js +0 -145
  101. package/dist/shared-CcvF1NPu.js.map +0 -1
  102. package/dist/src-Cu_0JPcZ.js.map +0 -1
  103. package/dist/utils-BZh9vMXJ.js +0 -76
  104. package/dist/utils-BZh9vMXJ.js.map +0 -1
  105. package/template/+orama-cloud/@app/components/search.tsx +0 -54
  106. package/template/+orama-cloud/@app/lib/export-static-indexes.ts +0 -14
  107. package/template/+orama-cloud/@root/.env.example +0 -6
package/dist/bin.js CHANGED
@@ -1,30 +1,54 @@
1
1
  #!/usr/bin/env node
2
- import { i as templates, n as isCI } from "./constants-DcFItL2q.js";
3
- import { n as getPackageManager, r as managers, t as create } from "./src-Cu_0JPcZ.js";
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 { Option, program } from "@commander-js/extra-typings";
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 command = program.argument("[name]", "the project name").option("--src", "(Next.js only) enable `src/` directory").option("--install", "install packages automatically").option("--no-git", "disable auto Git repository initialization").addOption(new Option("--linter <name>", "configure a linter/formatter, ESLint is currently Next.js only.").choices([
15
+ const linters = [
11
16
  "eslint",
12
17
  "oxlint",
13
18
  "biome"
14
- ])).addOption(new Option("--search <name>", "configure a search solution").choices(["orama", "orama-cloud"])).addOption(new Option("--og-image <name>", "configure OG image generation").choices(["next-og", "takumi"])).addOption(new Option("--ai-chat <name>", "configure AI chat").choices([
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
- ])).addOption(new Option("--template <name>", "choose a template").choices(templates.map((item) => item.value))).addOption(new Option("--pm <name>", "choose a package manager").choices(managers).default(getPackageManager()));
19
- async function main() {
20
- command.parse(process.argv);
21
- const defaultName = command.args[0];
22
- const config = command.opts();
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);
46
+ const skipPrompts = isCI || config.yes === true;
23
47
  intro(pc.bgCyan(pc.bold("Create Fumadocs App")));
24
48
  const options = await group({
25
49
  name: async () => {
26
50
  if (defaultName) return defaultName;
27
- if (isCI) return "untitled";
51
+ if (skipPrompts) return "untitled";
28
52
  return text({
29
53
  message: "Project name",
30
54
  placeholder: "my-app",
@@ -33,7 +57,7 @@ async function main() {
33
57
  },
34
58
  template: async () => {
35
59
  if (config.template) return config.template;
36
- if (isCI) return "+next+fuma-docs-mdx";
60
+ if (skipPrompts) return "+next+fuma-docs-mdx";
37
61
  return select({
38
62
  message: "Choose a template",
39
63
  initialValue: "+next+fuma-docs-mdx",
@@ -42,7 +66,7 @@ async function main() {
42
66
  },
43
67
  src: async ({ results }) => {
44
68
  if (config.src !== void 0) return config.src;
45
- if (isCI || !results.template?.startsWith("+next")) return false;
69
+ if (skipPrompts || !results.template?.startsWith("+next")) return false;
46
70
  return confirm({
47
71
  message: "Use `/src` directory?",
48
72
  initialValue: false
@@ -50,7 +74,7 @@ async function main() {
50
74
  },
51
75
  lint: async ({ results }) => {
52
76
  if (config.linter !== void 0) return config.linter;
53
- if (isCI) return "disabled";
77
+ if (skipPrompts) return "disabled";
54
78
  return select({
55
79
  message: "Configure linter?",
56
80
  options: results.template?.startsWith("+next") ? [
@@ -88,24 +112,42 @@ async function main() {
88
112
  },
89
113
  search: async () => {
90
114
  if (config.search !== void 0) return config.search;
91
- if (isCI) return "orama";
115
+ if (skipPrompts) return "orama";
92
116
  return select({
93
117
  message: "Choose a search solution?",
94
- options: [{
95
- value: "orama",
96
- label: "Default",
97
- hint: "local search powered by ZBSearch, recommended"
98
- }, {
99
- value: "orama-cloud",
100
- label: "Orama Cloud",
101
- hint: "3rd party search solution, signup needed"
102
- }]
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
+ ]
103
145
  });
104
146
  },
105
147
  ogImage: async ({ results }) => {
106
148
  if (config.ogImage !== void 0) return config.ogImage;
107
149
  if (!results.template?.startsWith("+next")) return "takumi";
108
- if (isCI) return "next/og";
150
+ if (skipPrompts) return "next/og";
109
151
  return select({
110
152
  message: "Configure Open Graph Image generation?",
111
153
  options: [{
@@ -121,7 +163,7 @@ async function main() {
121
163
  },
122
164
  aiChat: async ({ results }) => {
123
165
  if (config.aiChat !== void 0) return config.aiChat;
124
- if (isCI || results.template === "astro" || results.template === "+next+fuma-docs-mdx+static" || results.template.endsWith("-spa")) return false;
166
+ if (skipPrompts || results.template === "astro" || results.template === "+next+fuma-docs-mdx+static" || results.template.endsWith("-spa")) return false;
125
167
  return select({
126
168
  message: "Configure AI Chat?",
127
169
  options: [
@@ -149,7 +191,7 @@ async function main() {
149
191
  },
150
192
  installDeps: async () => {
151
193
  if (config.install !== void 0) return config.install;
152
- if (isCI) return false;
194
+ if (skipPrompts) return false;
153
195
  return confirm({ message: `Do you want to install packages automatically? (detected as ${config.pm})` });
154
196
  }
155
197
  }, { onCancel: () => {
@@ -161,7 +203,7 @@ async function main() {
161
203
  console.warn(pc.yellow("AI Chat is not supported by the Astro template yet, skipping it."));
162
204
  options.aiChat = false;
163
205
  }
164
- if (!isCI) await checkDir(projectName);
206
+ if (!isCI) await checkDir(projectName, skipPrompts);
165
207
  const info = spinner();
166
208
  info.start(`Generating Project`);
167
209
  const plugins = [];
@@ -169,35 +211,10 @@ async function main() {
169
211
  const { nextUseSrc } = await import("./plugins/next-use-src.js");
170
212
  plugins.push(nextUseSrc());
171
213
  }
172
- if (options.search === "orama-cloud") {
173
- const { oramaCloud } = await import("./plugins/orama-cloud.js");
174
- plugins.push(oramaCloud());
175
- }
176
- switch (options.lint) {
177
- case "eslint": {
178
- const { eslint } = await import("./plugins/eslint.js");
179
- plugins.push(eslint());
180
- break;
181
- }
182
- case "biome": {
183
- const { biome } = await import("./plugins/biome.js");
184
- plugins.push(biome());
185
- break;
186
- }
187
- case "oxlint": {
188
- const { oxlint } = await import("./plugins/oxlint.js");
189
- plugins.push(oxlint());
190
- break;
191
- }
192
- }
193
- if (options.ogImage === "takumi") {
194
- const { nextUseTakumi } = await import("./plugins/next-use-takumi.js");
195
- plugins.push(nextUseTakumi());
196
- }
197
- if (options.aiChat) {
198
- const { ai } = await import("./plugins/ai.js");
199
- plugins.push(ai(options.aiChat));
200
- }
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 }));
201
218
  await create({
202
219
  packageManager: config.pm,
203
220
  template: options.template,
@@ -219,9 +236,13 @@ async function main() {
219
236
  console.log(pc.bold("\nYou can now open the project and start writing documents"));
220
237
  process.exit(0);
221
238
  }
222
- async function checkDir(outputDir) {
239
+ async function checkDir(outputDir, skipPrompts) {
223
240
  const destDir = await fs.readdir(outputDir).catch(() => null);
224
241
  if (!destDir || destDir.length === 0) return;
242
+ if (skipPrompts) {
243
+ cancel(`directory ${outputDir} already exists and is not empty.`);
244
+ process.exit(1);
245
+ }
225
246
  const del = await confirm({ message: `directory ${outputDir} already exists, do you want to delete its files?` });
226
247
  if (isCancel(del)) {
227
248
  cancel();
@@ -238,10 +259,14 @@ async function checkDir(outputDir) {
238
259
  }));
239
260
  info.stop(`Deleted files in ${outputDir}`);
240
261
  }
241
- main().catch((e) => {
242
- console.error(e);
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)));
243
268
  process.exit(1);
244
- });
269
+ }
245
270
  //#endregion
246
271
  export {};
247
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 .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 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 (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,mBAAmB,CAAC,CAAC,QAAQ;CAC1D;CACA;CACA;AACF,CAAC,CACH,CAAC,CACA,UACC,IA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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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= {
16
- "@biomejs/biome": "^2.5.11",
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.81.0",
23
+ "oxlint": "^1.82.0",
22
24
  "react": "^19.2.8",
23
- "takumi-js": "^2.13.4"
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.7";
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.32",
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.4.1",
192
+ "@types/node": "26.5.0",
185
193
  "@types/react": "^19.2.18",
186
- "@types/react-dom": "^19.2.5",
194
+ "@types/react-dom": "^19.2.7",
187
195
  "algoliasearch": "5.57.0",
188
196
  "flexsearch": "^0.8.212",
189
- "lucide-react": "^1.39.0",
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.22.14",
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.0",
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.3",
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.0",
374
+ "@types/bun": "^1.4.2",
364
375
  "@types/mdast": "^4.0.4",
365
376
  "@types/mdx": "^2.0.14",
366
- "@types/node": "^26.4.1",
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.6",
387
+ "rolldown": "^1.2.7",
377
388
  "satteri": "^0.10.5",
378
389
  "tsconfig": "workspace:*",
379
- "tsdown": "0.22.14",
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.7";
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.7.0",
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.4",
580
- "lucide-react": "^1.39.0",
581
- "motion": "^13.1.1",
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.22.14",
604
+ "@tsdown/css": "^0.23.0",
594
605
  "@types/hast": "^3.0.5",
595
606
  "@types/mdx": "^2.0.14",
596
- "@types/node": "^26.4.1",
607
+ "@types/node": "^26.5.0",
597
608
  "@types/react": "^19.2.18",
598
- "@types/react-dom": "^19.2.5",
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.22.14",
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-DcFItL2q.js.map
724
+ //# sourceMappingURL=constants-BN-PbHNc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants-DcFItL2q.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"}
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-Cu_0JPcZ.js";
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"}
@@ -0,0 +1,2 @@
1
+ import { t as feature } from "../feature-BmBh9LJX.js";
2
+ export { feature };
@@ -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":";;;;;iBAOgB,cAAc"}
1
+ {"version":3,"file":"next-use-src.d.ts","names":[],"sources":["../../src/plugins/next-use-src.ts"],"mappings":";;;;;wBAOgB,cAAc"}