From 27ecebed67a692aba506a8a4d09c98f4559a7c2d Mon Sep 17 00:00:00 2001 From: skulidropek <66840575+skulidropek@users.noreply.github.com> Date: Wed, 25 Mar 2026 20:05:37 +0000 Subject: [PATCH] fix: simplify bootstrap next-step output --- packages/app/src/app/program.ts | 7 +++++-- packages/app/tests/program.test.ts | 20 ++++++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/packages/app/src/app/program.ts b/packages/app/src/app/program.ts index ccd87c2..1bf91d3 100644 --- a/packages/app/src/app/program.ts +++ b/packages/app/src/app/program.ts @@ -3,6 +3,9 @@ import { type BootstrapSummary, validateNodeMajorVersion } from "../core/bootstr import { bootstrapProject } from "../shell/bootstrap.js" import { formatUsage, readCliOptions } from "../shell/cli.js" +const formatProjectDirectoryHint = (projectDir: string): string => + projectDir.split(/[\\/]/g).filter(Boolean).at(-1) ?? projectDir + export const formatSuccess = (summary: BootstrapSummary): string => [ "", @@ -12,8 +15,8 @@ export const formatSuccess = (summary: BootstrapSummary): string => `MCP ready for: ${summary.mcpAgents.join(", ")}`, "Dependencies already installed with pnpm.", "Next:", - ` cd "${summary.projectDir}"`, - " pnpm run agent", + ` cd ${formatProjectDirectoryHint(summary.projectDir)}`, + " pnpm run dev", ].join("\n") const cliProgram = pipe( diff --git a/packages/app/tests/program.test.ts b/packages/app/tests/program.test.ts index 2abb93d..639a414 100644 --- a/packages/app/tests/program.test.ts +++ b/packages/app/tests/program.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest" import { formatSuccess } from "../src/app/program.js" describe("formatSuccess", () => { - it("guides users to pnpm after bootstrap succeeds", () => { + it("guides users to the project directory and pnpm dev after bootstrap succeeds", () => { const output = formatSuccess({ projectDir: "/tmp/demo-project", projectName: "Demo Project", @@ -11,9 +11,21 @@ describe("formatSuccess", () => { }) expect(output).toContain("Dependencies already installed with pnpm.") - expect(output).toContain('cd "/tmp/demo-project"') - expect(output).toContain("pnpm run agent") + expect(output).toContain("cd demo-project") + expect(output).toContain("pnpm run dev") + expect(output).not.toContain('cd "/tmp/demo-project"') + expect(output).not.toContain("pnpm run agent") expect(output).not.toContain("&&") - expect(output).not.toContain("npm run dev") + }) + + it("uses the last path segment for Windows-style project paths too", () => { + const output = formatSuccess({ + projectDir: "D:\\Projects\\test-box\\spawndock-app-11", + projectName: "Spawndock App 11", + previewOrigin: "https://api.example.com/preview/spawndock-app-11", + mcpAgents: ["OpenCode"], + }) + + expect(output).toContain("Next:\n cd spawndock-app-11\n pnpm run dev") }) })