docs: update REPO_SNAPSHOT for config validation#40
Merged
Conversation
- Add TrackerConfig, ToastConfig, BudgetConfig types to shared module description - Add validateConfig() and DEFAULT_CONFIG to shared module description - Add config validation maintenance notes
There was a problem hiding this comment.
Pull request overview
该 PR 更新了仓库技术快照文档(REPO_SNAPSHOT),补充并强调 lib/shared.ts 中新增的配置类型、默认配置与配置校验能力,以及相关维护注意事项,便于后续维护与协作对齐。
Changes:
- 在
REPO_SNAPSHOT.md的关键模块描述中补充TrackerConfig/ToastConfig/BudgetConfig/ConfigValidationResult、validateConfig()与DEFAULT_CONFIG - 在维护提醒中增加配置验证与告警展示/输出渠道说明
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ## 维护提醒 | ||
|
|
||
| - `BUILTIN_PRICING` 已统一到 `lib/shared.ts`,修改定价只需改一处 | ||
| - 配置验证统一在 `lib/shared.ts` 的 `validateConfig()`,无效字段静默修正为默认值 |
There was a problem hiding this comment.
这里的描述“无效字段静默修正为默认值”与实际实现不完全一致:validateConfig() 对部分无效字段是“忽略/丢弃”(例如 budget.daily/weekly/monthly 非法时会忽略该字段;pricing map 中非法条目会跳过),同时会在 warnings 中记录提示。建议把措辞改为“无效字段会被忽略或回退到默认值,并记录 warnings(不抛错)”以避免误导维护者。
Suggested change
| - 配置验证统一在 `lib/shared.ts` 的 `validateConfig()`,无效字段静默修正为默认值 | |
| - 配置验证统一在 `lib/shared.ts` 的 `validateConfig()`,无效字段会被忽略或回退到默认值,并记录 warnings(不抛错) |
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
context/tech/REPO_SNAPSHOT.md,补充 config validation 相关内容lib/shared.ts模块描述中添加新增的类型和函数