Skip to content

fix: emit only the requested JSON schema - #78

Open
ryanduguid wants to merge 2 commits into
ConsumerDataStandardsAustralia:mainfrom
ryanduguid:fix/schema-json-output
Open

ryanduguid wants to merge 2 commits into
ConsumerDataStandardsAustralia:mainfrom
ryanduguid:fix/schema-json-output

Conversation

@ryanduguid

@ryanduguid ryanduguid commented Sep 21, 2026 •

Copy link
Copy Markdown

testdocs schema testdoc currently writes a text label followed by both schemas. testdocs schema changelog also prepends a label. Both exit successfully, but their output cannot be parsed as JSON.

Remove the label and stop the testdoc switch case from falling through. Set process.exitCode instead of forcing an immediate exit, so asynchronous stdout writes can finish. Each command emits only the requested JSON schema. Node documents the output-loss risk of immediate exit in its process documentation.

Verification at fd396ec on Windows with Node 24.19.0:

  • node test/schema-output.js: all 8 checks pass. These cover ordinary pipes, files, delayed stdout writes and missing or invalid arguments. Both delayed-write cases fail on the previous PR head with empty output. The delayed stream models asynchronous writes; it is not a Linux execution test.
  • TypeScript compilation, JavaScript syntax checking and git diff --check pass.
  • npm run build compiles successfully, then fails at the unchanged copy-additional step because cli/config.json is absent. PR fix: propagate validation and generation failures #79 removes that unused step.
  • The existing lint script invokes undeclared TSLint, so lint remains unavailable.

No dependencies or schema definitions changed. Linux execution and full documentation generation were not verified. This branch is independent of #77.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant