v0.9.0 — Polish, error codes, Vitest tests
What's new
Added
UMD-NNNerror code system. Every script that can fail now emits a structured error with code, title, one-paragraph remedy, and docs link. ~20 codes covering detection, config, backup, visual regression, AST,
profiles, substitution.- New reference:
references/error-codes.md— full catalog. - New helpers:
scripts/_errors.mjs(registry + makeError + didYouMean),scripts/_response.mjs(unified envelope:{ ok, command, version, timestamp, payload | errors, warnings }). - "Did you mean?" suggestions for typo'd profile / brand / component names.
- Vitest test suite in
tests/with config + 3 initial test files (errors, load-config, ast-extract). New scripts:npm test,npm run test:watch. CI runs tests on every push/PR.
Changed
scripts/load-config.mjs— now emitsUMD-010/UMD-011/UMD-012with structured details.SKILL.md— points atreferences/error-codes.mdfor error handling..github/workflows/ci.yml— addsnpm install + npm teststeps.
新增
UMD-NNN错误码体系。每个可能失败的脚本现在都发出结构化错误,含 code、title、一段补救、文档链接。约 20 个码,覆盖检测、配置、备份、视觉回归、AST、profile、替换。- 新增参考文档:
references/error-codes.md—— 完整目录。 - 新增辅助模块:
scripts/_errors.mjs(注册表 + makeError + didYouMean)、scripts/_response.mjs(统一信封:{ ok, command, version, timestamp, payload | errors, warnings })。 - "Did you mean?" 提示 —— profile / brand / 组件名拼错时给出最近匹配建议。
- Vitest 测试套件:
tests/含配置 + 3 个初始测试文件(errors、load-config、ast-extract)。新增脚本:npm test、npm run test:watch。CI 每次 push/PR 都跑测试。
改动
scripts/load-config.mjs—— 输出带结构化详情的UMD-010/UMD-011/UMD-012错误码。SKILL.md—— 失败模式指向references/error-codes.md。.github/workflows/ci.yml—— 加npm install + npm test步骤。