Skip to content

Add runnable examples, package metadata and the 0.1.0 changeset - #86

Merged
NSchatz merged 1 commit into
mainfrom
release-0.1-prep
Sep 25, 2026
Merged

NSchatz merged 1 commit into
mainfrom
release-0.1-prep

Conversation

@NSchatz

@NSchatz NSchatz commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Prepares @cosyte/mllp for its 0.1.0 release. No change under src/.

What changes

  • examples/: four runnable programs covering the jobs the README presents, each importing @cosyte/mllp by name (resolved through the package's own exports to dist/) and checking its own output with node:assert:
    • send-and-acknowledge.ts: server and client on loopback; AA for a committed message, AE when the commit handler throws, MSA-2 echoing the control id.
    • frame-and-unframe.ts: encodeFrame and FrameReader, a frame split across reads, and FS LF refused by default and reported as MLLP_LF_AFTER_FS when opted into.
    • test-without-a-socket.ts: a Connection over InMemoryTransport.pair() against a one-byte-per-read test double.
    • verify-an-engine.ts: runDifferential against a local server, parity-observed.
    • examples/README.md has the table.
  • pnpm examples (scripts/run-examples.ts, modelled on hl7's runner): runs every top-level example with tsx, fails on any non-zero exit, refuses (exit 2) when there is no dist/ or no example.
  • CI: a new examples job in ci.yml (Node 22 and 24): install, build, pnpm examples. Actions pinned by SHA. Not a required context.
  • Gates cover the examples before any build: examples/tsconfig.json maps the package name to src/ for tsc and typescript-eslint only. pnpm typecheck adds tsc --noEmit -p examples, pnpm lint and format add examples/, and the eslint ignore on examples/** is removed. At run time tsx reads the root tsconfig, which maps nothing.
  • package.json: description names Node.js and TypeScript, wider keywords, homepage https://docs.cosyte.com/mllp. repository and bugs were already correct.
  • Changeset what-0-1-means.md (minor): what 0.1 covers, what the version promises below 1.0, what is not covered yet. Checked against the shared release-notes renderer: headline kept, no violations.
  • documentation/release-0.1.0-readiness.md: rows for the new changeset and for first-use-examples-executed.md, which the table was missing.

Checks run locally (pnpm 10.0.0, Node 24)

typecheck, lint, test (86 files, 1493 tests), build, attw, format:check, phi-scan (all-mode and --staged), check:no-emdash, check:no-internal-refs, check:agent-notes, examples (4 of 4): all exit 0. Negative controls: a failing assertion reds the runner (exit 1), a missing dist/ refuses (exit 2), a type error and an any in an example red typecheck and lint, and a planted PID segment in examples/ is a hit for the all-mode PHI scan CI runs.

README quickstart, from a packed tarball

pnpm build && npm pack                                  # cosyte-mllp-0.0.11.tgz
npm install ./cosyte-mllp-0.0.11.tgz @cosyte/hl7        # into an empty directory; hl7 0.0.10 from npm
node qs-extract.mjs node_modules/@cosyte/mllp/README.md # block at README line 80
node quickstart.mts                                     # exit 0

Output: acknowledgement code: AA, MSA-2 echoes the control id sent: true, messages committed: 1.

https://claude.ai/code/session_01U24bnHKNxQWMxmfN7ny7w9

The package is about to publish 0.1.0, and a reader of the repository had
no runnable program beyond the README block. Four examples now cover the
jobs the README presents: sending and acknowledging over loopback (AA on a
commit, AE on a thrown commit), framing without a socket (including a
deviation that is refused by default and reported by code when opted
into), driving a Connection over the in-memory transport, and the
differential harness aimed at a local server. Each imports @cosyte/mllp
by name, resolved through the package's own exports to dist/, and checks
its own output.

pnpm examples (scripts/run-examples.ts) runs them all and refuses when
there is no build or no example. A new examples job in ci.yml installs,
builds and runs it on Node 22 and 24, with actions pinned by SHA. It is
not a required context yet.

The examples are held to the repository's gates before any build:
examples/tsconfig.json maps the package name to src/ for tsc and
typescript-eslint only, so pnpm typecheck and pnpm lint now cover
examples/ (the eslint ignore on examples/ is removed), and format covers
them too. At run time tsx reads the root tsconfig, which maps nothing.

package.json: a description naming Node.js and TypeScript, wider
keywords, and homepage at docs.cosyte.com/mllp. The new changeset tells
a user what 0.1 covers, what the version promises and what is not
covered yet; the readiness record gains its row and the one it was
missing.

Claude-Session: https://claude.ai/code/session_01U24bnHKNxQWMxmfN7ny7w9
@NSchatz
NSchatz enabled auto-merge (squash) September 25, 2026 20:27
@NSchatz
NSchatz merged commit a3a2eee into main Sep 25, 2026
11 checks passed
@NSchatz
NSchatz deleted the release-0.1-prep branch September 25, 2026 20:32
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