diff --git a/.changeset/quiet-scaffold-output.md b/.changeset/quiet-scaffold-output.md new file mode 100644 index 0000000..eac9325 --- /dev/null +++ b/.changeset/quiet-scaffold-output.md @@ -0,0 +1,6 @@ +--- +"@marko/create": patch +"create-marko": patch +--- + +Run the scaffold's install and git steps quietly behind the progress spinner. The noisy internals — pnpm's ignored-builds notice, esbuild's postinstall, the confirmation re-install, husky's `.git can't be found`, and git probes like `fatal: not a git repository` — are no longer printed. Install output is surfaced only when it genuinely fails. diff --git a/packages/create/src/cli.ts b/packages/create/src/cli.ts index d2b2f01..d7b00be 100644 --- a/packages/create/src/cli.ts +++ b/packages/create/src/cli.ts @@ -98,31 +98,30 @@ export async function run(options: CliOptions): Promise { } const spin = p.spinner(); - let spinning = false; + spin.start("Setting up project"); + let installLog = ""; const result = createProject({ ...options, name, template }); - result.on("download", () => { - spin.start("Downloading app"); - spinning = true; - }); - result.on("install", (installer: string) => { - if (spinning) { - spin.stop("Downloaded app"); - spinning = false; - } - p.log.step(`Installing dependencies with ${color.cyan(installer)}`); - }); - result.on("install-error", (installer: string) => - p.log.warn( - `${color.cyan(`${installer} install`)} did not finish cleanly. Your ` + - "project was still created — you may need to install dependencies manually.", - ), + result.on("download", () => spin.message("Downloading app")); + result.on("install", (installer: string) => + spin.message(`Installing dependencies with ${installer}`), ); - result.on("init", () => p.log.step("Initializing git repository")); + result.on("install-error", (_installer: string, log?: string) => { + installLog = log ?? ""; + }); + result.on("init", () => spin.message("Setting up git repository")); try { const { projectPath, installer, installed, scripts } = await result; - if (spinning) spin.stop("Downloaded app"); + spin.stop("Project created"); + + if (!installed) { + p.log.warn( + `${color.cyan(`${installer} install`)} did not finish cleanly — you ` + + "may need to run it yourself.", + ); + if (installLog.trim()) p.log.message(installLog.trim()); + } // ` run