fix(settings): scaffold settings.json template on first run (#202) - #275
Open
innocarpe wants to merge 1 commit into
Open
fix(settings): scaffold settings.json template on first run (#202)#275innocarpe wants to merge 1 commit into
innocarpe wants to merge 1 commit into
Conversation
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
~/.deepcode/settings.jsonwith a ready-to-edit template instead of failing with "API key not found" and forcing the user to author the file from scratch.Why
A fresh install never scaffolds
settings.json: the directory exists but the file does not, so the first prompt fails withAPI key not found. Please configure ~/.deepcode/settings.json— leaving users to guess the schema. This makes onboarding require only pasting their API key.Changes
packages/core/src/settings.ts: addDEFAULT_SETTINGS_TEMPLATEandensureUserSettingsFile()which creates the file on first run (never overwrites an existing one).packages/core/src/index.ts: exportensureUserSettingsFile.packages/cli/src/cli.tsx: call it at startup and printCreated <path> — edit it to add your API key.when scaffolded.packages/core/src/tests/settings-and-notify.test.ts: tests for scaffolding and no-overwrite behavior.Validation
npm run typecheck✅npm test— new settings tests pass ✅Closes #202