refactor(init): split init flows into separate functions#753
refactor(init): split init flows into separate functions#753rexxars wants to merge 5 commits intorefactor/extract-init-cmd-to-actionfrom
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move doInitNextJs (renamed to initNextJs), writeOrOverwrite, and writeSourceFiles into a dedicated initNextJs.ts file. Shared helpers (shouldPrompt, flagOrDefault, getPostInitMCPPrompt, writeStagingEnvIfNeeded) are moved to initHelpers.ts to avoid circular dependencies between the orchestrator and the Next.js flow module. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @rexxars's task in 3m 11s —— View job Review
These helpers were moved verbatim from the old monolithic file — no issue there — but No other behavioral differences found. The refactoring is functionally equivalent to the original code. |
…d scaffolding Extract the shared template selection and scaffolding pipeline into scaffoldTemplate.ts (selectTemplate + scaffoldAndInstall), create a dedicated initApp.ts for the app template flow, and slim initStudio.ts down to studio-only logic. The orchestrator in initAction.ts now branches on isAppTemplate before calling the appropriate flow function. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d819061 to
e738e9f
Compare
Coverage Delta
Comparing 11 changed files against main @ Overall Coverage
|
Note
This is part 2 of a larger
initrefactor. See #748 for part 1.Makes it easier to reason about and make changes to each individual init flow.