feat: config versioning + forge config get/set commands (#66, #74)#98
Merged
feat: config versioning + forge config get/set commands (#66, #74)#98
Conversation
Add schema version field for future migration support and new CLI commands for reading/writing config values by dot-notation path. - Add `version` field (default: '1') to MonitorForgeConfigSchema - loadConfig() backfills missing version with warning for pre-v0.3 configs - New `forge config get <path>` — sub-tree accessor (scalar or object) - New `forge config set <path> <value>` — scalar setter with JSON.parse type detection, Zod validation, and stripped-key warnings - Derive CLI version from package.json (eliminate drift) - Bump package version to 0.3.0 - Add version field to all 15 presets - 13 new tests for config commands (356 total, 0 type errors) Closes #66, closes #74 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add forbidden-key validation for __proto__, constructor, and prototype segments in dot-path parsing. Remove redundant JSON.parse deep-copy since setByPath already uses structuredClone. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
Author
Code reviewFound 1 issue:
monitor-forge/forge/src/commands/config.ts Lines 153 to 160 in 5626c37 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Match the output contract from forge/AGENTS.md and the pattern used by all other mutating commands (source add, panel add, view add, theme set). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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
versionfield to config schema (default:'1') for future migration supportforge config get <path>command — sub-tree accessor returning scalar or JSON objectforge config set <path> <value>command — scalar setter with JSON.parse type detection, Zod validation, and stripped-key warnings for unknown pathsloadConfig()backfills missing version field with warning for pre-v0.3 configspackage.json(eliminates drift)0.3.0version: '1'Test plan
forge config get monitor.namereturns correct valueforge config get monitorreturns full sub-tree as JSONforge config set map.zoom 5sets number (not string)forge config set map.zoom abcfails with Zod validation errorforge config set monitor.nonexistent fooemits stripped-key warningforge init --template tech-minimal --forcestampsversion: '1'forge --versionoutputs0.3.0(from package.json)Closes #66, closes #74
🤖 Generated with Claude Code