Skip to content

Commit 8dae633

Browse files
fix(cli): simplify Fumadocs setup by removing template selection
1 parent 77e0cb7 commit 8dae633

File tree

1 file changed

+3
-51
lines changed

1 file changed

+3
-51
lines changed

apps/cli/src/helpers/addons/fumadocs-setup.ts

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,35 @@
11
import path from "node:path";
2-
import { isCancel, log, select, spinner } from "@clack/prompts";
2+
import { log } from "@clack/prompts";
33
import consola from "consola";
44
import { execa } from "execa";
55
import fs from "fs-extra";
66
import pc from "picocolors";
77
import type { ProjectConfig } from "../../types";
8-
import { exitCancelled } from "../../utils/errors";
98
import { getPackageExecutionCommand } from "../../utils/package-runner";
109

11-
type FumadocsTemplate =
12-
| "next-mdx"
13-
| "next-content-collections"
14-
| "react-router-mdx-remote"
15-
| "tanstack-start-mdx-remote";
16-
17-
const TEMPLATES = {
18-
"next-mdx": {
19-
label: "Next.js: Fumadocs MDX",
20-
hint: "Recommended template with MDX support",
21-
value: "+next+fuma-docs-mdx",
22-
},
23-
"next-content-collections": {
24-
label: "Next.js: Content Collections",
25-
hint: "Template using Next.js content collections",
26-
value: "+next+content-collections",
27-
},
28-
"react-router-mdx-remote": {
29-
label: "React Router: MDX Remote",
30-
hint: "Template for React Router with MDX remote",
31-
value: "react-router",
32-
},
33-
"tanstack-start-mdx-remote": {
34-
label: "Tanstack Start: MDX Remote",
35-
hint: "Template for Tanstack Start with MDX remote",
36-
value: "tanstack-start",
37-
},
38-
} as const;
39-
4010
export async function setupFumadocs(config: ProjectConfig) {
4111
const { packageManager, projectDir } = config;
4212

4313
try {
4414
log.info("Setting up Fumadocs...");
4515

46-
const template = await select<FumadocsTemplate>({
47-
message: "Choose a template",
48-
options: Object.entries(TEMPLATES).map(([key, template]) => ({
49-
value: key as FumadocsTemplate,
50-
label: template.label,
51-
hint: template.hint,
52-
})),
53-
initialValue: "next-mdx",
54-
});
55-
56-
if (isCancel(template)) return exitCancelled("Operation cancelled");
57-
58-
const templateArg = TEMPLATES[template].value;
59-
60-
const commandWithArgs = `create-fumadocs-app@latest fumadocs --template ${templateArg} --src --no-install --pm ${packageManager} --no-eslint --no-git`;
16+
const commandWithArgs = `create-fumadocs-app@latest fumadocs --src --no-install --pm ${packageManager} --no-eslint --no-biome --no-git`;
6117

6218
const fumadocsInitCommand = getPackageExecutionCommand(
6319
packageManager,
6420
commandWithArgs,
6521
);
6622

67-
const s = spinner();
68-
s.start("Setting up Fumadocs...");
69-
7023
const appsDir = path.join(projectDir, "apps");
7124
await fs.ensureDir(appsDir);
7225

7326
await execa(fumadocsInitCommand, {
7427
cwd: appsDir,
7528
env: { CI: "true" },
7629
shell: true,
30+
stdio: "inherit",
7731
});
7832

79-
s.stop("Fumadocs setup complete!");
80-
8133
const fumadocsDir = path.join(projectDir, "apps", "fumadocs");
8234
const packageJsonPath = path.join(fumadocsDir, "package.json");
8335

0 commit comments

Comments
 (0)