Repository navigation
fix: generate error-code catalog from yaml single source - #1400
mysteriousskater wants to merge 2 commits into
Conversation
|
@mysteriousskater Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Thanks for the contribution! We reviewed this PR while merging the open queue and couldn't merge it yet. Here's what needs fixing:
This branch also has merge conflicts with |
|
@greatest0fallt1me Thanks for the review — pushed a fix to this branch. What changed:
Verification (plain Node, no install needed):
|
|
@greatest0fallt1me Thanks — this now does what the title describes, with nothing deleted:
Verified locally on this branch head with Node 20:
Please re-review. |
ed7293b to
163eacf
Compare
163eacf to
23eea12
Compare
Overview
This PR consolidates the duplicated error code references by making
docs/error-codes.yamlthe single hand-maintained source. The generator now emits bothsrc/errors/codes.tsanddocs/error-code-catalog.md, the hand-written duplicatedocs/error-codes.mdis removed, andnpm run error-codes:checkverifies the generated markdown is up to date.Related Issue
Changes
🗂️ Single Source of Truth
[MODIFY]
docs/error-codes.yaml[DELETE]
docs/error-codes.md⚙️ Generator
[MODIFY]
scripts/generate-error-codes.mjsdocs/error-code-catalog.mdin addition tosrc/errors/codes.ts, both derived fromdocs/error-codes.yaml.--checkmode now also fails when the generated markdown is stale, sonpm run error-codes:checkcovers both outputs.[MODIFY]
docs/error-code-catalog.md🧪 Tests & Scripts
[MODIFY]
scripts/generate-error-codes.test.mjs[MODIFY]
package.jsonerror-codes:checkwired to verify both generated outputs.Verification Results
docs/error-codes.yamlis the sole source;docs/error-codes.mdremoveddocs/error-code-catalog.mdSecurity and Failure Modes
docs/error-codes.mdeliminates a divergence risk where client developers could map error handling against outdated codes.Compatibility
src/errors/codes.tsoutput is unchanged in shape, so existing imports keep working.docs/error-code-catalog.mdremains at the same path, now generated.docs/error-codes.mdis removed; any external links to it should point to the catalog instead.Closes #1335