fix: generate error code catalog from single YAML source - #1400
mysteriousskater wants to merge 3 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 |
…ed-error-code-references Resolves merge conflicts against CalloraOrg/Callora-Backend@1518ce6 (68 commit(s) behind) so the PR is mergeable.
…AML source - Restore docs/error-codes.yaml, scripts/generate-error-codes.mjs and scripts/generate-error-codes.test.mjs, which this branch had deleted. - Generate the canonical catalog into docs/error-code-catalog.md from the single YAML source instead of the hand-written page. - Replace the duplicated generated table in docs/error-codes.md with a pointer to the generated catalog; the envelope/error-class/gateway/billing reference there is kept. - Revert the unrelated package.json edits (version, private, test script). Refs CalloraOrg#1335
|
@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. |
Overview
This PR consolidates the duplicated error code documentation into a single hand-maintained source.
docs/error-codes.yamlbecomes the sole source of truth; the generator now emits bothsrc/errors/codes.tsanddocs/error-code-catalog.md, the hand-writtendocs/error-codes.mdduplicate is 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[MODIFY]
scripts/generate-error-codes.mjsdocs/error-code-catalog.mdin addition tosrc/errors/codes.tsfrom the YAML source.npm run error-codes:checkfails when the generated markdown (or TypeScript) is stale.[MODIFY]
docs/error-code-catalog.md[MODIFY]
package.jsonerror-codes:checkto the generator's check mode.[MODIFY]
scripts/generate-error-codes.test.mjsVerification Results
docs/error-codes.yamlis the sole source;docs/error-codes.mdremoveddocs/error-code-catalog.mdSecurity and Failure Modes
Compatibility
src/errors/codes.tsoutput is unchanged in shape, so existing imports and error handling continue to work.docs/error-codes.mdcontent is preserved through the generateddocs/error-code-catalog.md.Closes #1335