fix(cli): make bare volcano init produce base-only scaffold#9
Conversation
…e help text Bare "volcano init" now creates only the base scaffold (volcano/ directory with env files, migrations dir, and README) instead of defaulting to the JavaScript template. Help text updated to accurately describe each template, list all accepted aliases, and document all available --example options.
There was a problem hiding this comment.
Pull request overview
This PR changes the default behavior of volcano init so that running it without a template generates only the base scaffold (env files, migrations directory, and a Volcano README), rather than implicitly defaulting to the JavaScript starter. It also updates user-facing documentation/help text and adjusts tests to match the new default.
Changes:
- Update
projectinitso an empty starter name results in applying only thebasestarter (no language template). - Refresh CLI help text and repository docs to describe the base-only default and template aliases.
- Update init/projectinit tests to assert base-only outputs for bare
volcano init.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates quickstart to explicitly run init javascript, and documents base-only behavior for bare init. |
| internal/projectinit/starters/README.md | Updates the starter resolution model docs to reflect base-only default and adds a resolution table entry for bare init. |
| internal/projectinit/projectinit.go | Removes the JavaScript default starter and makes empty starter resolve to base-only. |
| internal/projectinit/projectinit_test.go | Updates scaffold expectations and conflict/idempotency assertions for the base-only default. |
| internal/cmd/root/root_test.go | Updates root-level init integration test expectations for base-only output. |
| internal/cmd/init/init.go | Updates init command long help text to document base-only default and list template aliases/examples. |
| internal/cmd/init/init_test.go | Updates help/output assertions to match the new base-only default behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
marckong
left a comment
There was a problem hiding this comment.
Summary
Changes bare volcano init to produce a base-only scaffold (env files, migrations dir, README) instead of defaulting to the JavaScript template, by removing defaultStarter so an empty starter falls back to base. Help text, README quickstart, starter docs, and all affected tests are updated to match.
defaultStarter = "javascript"removed; empty starter now resolves tobaseStarter.- Alias list in help text matches the
starterAliasesmap; README quickstart switched toinit javascriptso the subsequentconfig deploystep stays valid. - e2e tests build their own fixtures and none rely on bare
initcreating functions, so nothing downstream breaks.
Review
Clean, well-scoped change — the implementation, docs, and tests are internally consistent and the full suite is green (verified go build ./..., go vet, go test ./...). No blocking issues found. One minor, non-blocking observation:
printResult(internal/cmd/init/init.go:154) always printsvolcano functions deploy --allas a Next step, even for the now-default base-only scaffold that contains no functions. Not introduced by this PR and harmless (theconfig deploystep is already gated onhasConfig), but the default path now surfaces a step with nothing to deploy — worth a follow-up if you want the guidance to track what was actually scaffolded.
Overall correctness: correct — existing code and tests pass, and the patch is free of blocking issues.
swkeever
left a comment
There was a problem hiding this comment.
Reviewed the base-only init behavior and ran go test ./... / go build ./.... No blocking issues found.
| Every init run applies the `base` starter first. If no template is provided, | ||
| `projectinit` then applies the default starter, currently `javascript`. | ||
| only the `base` starter is applied (environment files, migrations directory, | ||
| and README — no language-specific files). |
There was a problem hiding this comment.
Now that the no-template path creates only env files, migrations, and a README, the generated internal/projectinit/starters/base/volcano/README.md is stale: it still says the directory contains configuration/functions and suggests volcano functions deploy --all / cloud function deploy even though bare init creates no functions. Can we update that generated README guidance to match the new base-only scaffold?
Tracking
volcano initpreviously defaulted to the JavaScript templateSummary
volcano initto create a base-only scaffold (environment files, migrations directory, README) instead of defaulting to the JavaScript templatedefaultStarter = "javascript"fromprojectinit; when no template is given, only thebasestarter is appliedinithelp text to document the base-only default and list all template aliasesvolcano init javascriptso subsequent commands (config deploy,functions deploy --all) remain validstarters/README.mdresolution model to reflect base-only default and add the barevolcano initcase to the resolution tableVerification
make lintgo test ./...go build ./...