feat: add bootcamp init to scaffold a config file#49
Merged
Conversation
Scaffold a .bootcamprc.json in the current directory so users can customize style, defaults, prompts, and excluded docs without hand-writing config. - --force to overwrite, --print to preview on stdout, --path for a custom location, --style to preset a built-in pack - Reuses generateExampleConfig(); validates --style against known packs - Routes --style via getCliFlagValue to avoid the root --style option collision (same pattern as diff --output) - Unit tests (mocked fs) + real-CLI e2e tests in an isolated temp cwd - README + CHANGELOG updates Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
bootcamp initcommand that scaffolds a.bootcamprc.jsonconfiguration file in the current directory, so users can customize style, defaults, prompts, and excluded docs without hand-writing config from scratch.Usage
Behavior
.bootcamprc.json(or--path) using the existinggenerateExampleConfig()template--force--printwrites to stdout instead of disk (handy for piping/inspection)--stylepresets a built-in pack and is validated against the known packsImplementation note
The root command already defines
-s, --style, so Commander routes a bare--styleto the root rather than the subcommand. This is the same collision thediffcommand handles for--output, soinitreuses the existinggetCliFlagValuehelper to read--stylereliably.Changes
src/commands/init-command.ts—runInitCommand()+buildInitConfig()src/cli.ts— registers theinitsubcommandTesting
test/init-command.test.ts— 9 unit tests (default write, overwrite guard,--force,--print, invalid style, style embedding, custom path,buildInitConfig) with mockedfs/promisestest/e2e/init-command.e2e.test.ts— 4 real-CLI e2e tests in an isolated temp cwd (scaffold + overwrite guard +--force,--print,--style/--path, invalid style)initsubcommand assertion to the CLI wiring testlint✓,typecheck✓,build✓, full unit suite 1049 passing, coverage above thresholds (init-command.ts ~91%), all e2e ✓