Repository navigation
Add runnable examples, package metadata and the 0.1.0 changeset - #86
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepares
@cosyte/mllpfor its 0.1.0 release. No change undersrc/.What changes
examples/: four runnable programs covering the jobs the README presents, each importing@cosyte/mllpby name (resolved through the package's ownexportstodist/) and checking its own output withnode:assert:send-and-acknowledge.ts: server and client on loopback;AAfor a committed message,AEwhen the commit handler throws, MSA-2 echoing the control id.frame-and-unframe.ts:encodeFrameandFrameReader, a frame split across reads, andFS LFrefused by default and reported asMLLP_LF_AFTER_FSwhen opted into.test-without-a-socket.ts: aConnectionoverInMemoryTransport.pair()against a one-byte-per-read test double.verify-an-engine.ts:runDifferentialagainst a local server,parity-observed.examples/README.mdhas 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 nodist/or no example.examplesjob inci.yml(Node 22 and 24): install, build,pnpm examples. Actions pinned by SHA. Not a required context.examples/tsconfig.jsonmaps the package name tosrc/fortscand typescript-eslint only.pnpm typecheckaddstsc --noEmit -p examples,pnpm lintandformataddexamples/, and the eslint ignore onexamples/**is removed. At run time tsx reads the root tsconfig, which maps nothing.homepagehttps://docs.cosyte.com/mllp.repositoryandbugswere already correct.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 forfirst-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 missingdist/refuses (exit 2), a type error and ananyin an example redtypecheckandlint, and a planted PID segment inexamples/is a hit for the all-mode PHI scan CI runs.README quickstart, from a packed tarball
Output:
acknowledgement code: AA,MSA-2 echoes the control id sent: true,messages committed: 1.https://claude.ai/code/session_01U24bnHKNxQWMxmfN7ny7w9