Skip to content

fix(deps): take astm, dicom, ncpdp, terminology and x12 at 0.2 and keep fmt canonical - #140

Merged
NSchatz merged 2 commits into
mainfrom
fix/libraries-0-2
Nov 29, 2026
Merged

NSchatz merged 2 commits into
mainfrom
fix/libraries-0-2

Conversation

@NSchatz

@NSchatz NSchatz commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

What

  • Take @cosyte/astm, @cosyte/dicom, @cosyte/ncpdp, @cosyte/terminology and @cosyte/x12 at ^0.2.0 (lockfile updated).
  • cosyte fmt passes { normalize: true } to the ASTM record serializer and to the NCPDP Telecom and SCRIPT serializers, so it keeps writing the canonical form.
  • A source comment names the DICOM fatal codes by their new names.
  • Three tests: fmt of an ASTM input with a nonstandard field delimiter writes the canonical delimiters; fmt of a Telecom input with an empty field before a segment separator writes the canonical fixture; two SCRIPT inputs that differ only in tag whitespace format alike.
  • The floors in test/sibling-releases.test.ts for those five packages move to 0.2.0.
  • A patch changeset that names each passed-through code that changes.

Why

In 0.2 the ASTM, NCPDP and DICOM serializers write a parsed message back as it was read unless asked for { normalize: true }. fmt exists to write the canonical form, so without the option it would silently stop normalizing. The other packages' 0.2 changes touch nothing this package calls, apart from the code strings a parse failure passes through on stderr, which the changeset lists. Exit codes and CLI_* codes do not change.

Proof

  • The three new tests failed with the normalize change removed from src/core/parsers.ts (3 failed, 61 passed in test/formats.test.ts) and pass with it.
  • Run locally, each exit 0: pnpm typecheck, lint, format:check, phi-scan, test:coverage (828 passed), build, attw, smoke, check:no-emdash, check:no-internal-refs, check:readme, check:claude-card, check:catalog, check:process, check:docs-content, check:docs-reference, typecheck:examples, lint:examples, examples, phi-scan:examples, test:perf.
  • npm install of the packed tarball into an empty directory outside the repo: exit 0.
  • Left to CI: the coverage ratchet, mutation, Bun, Deno, Windows and macOS.

Choices

  • fmt asks for normalize: true on all three NCPDP and ASTM serializer calls, SCRIPT included, because the command's documented purpose is the canonical form.
  • The DICOM parseDicom calls keep Buffer.from(bytes): a Buffer is a Uint8Array, which 0.2 accepts.
  • @cosyte/deid still declares these three parsers as 0.1 peers, so an install gets 0.1 copies for it beside the 0.2 copies this package uses. Left as it is.

@NSchatz
NSchatz merged commit e206a13 into main Nov 29, 2026
25 checks passed
@NSchatz
NSchatz deleted the fix/libraries-0-2 branch November 29, 2026 15:20
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