Repository navigation
Prepare the 0.1.0 release: runnable examples, a printing quickstart, metadata and the 0.1 changeset - #139
Merged
Conversation
…metadata and the 0.1 changeset The 0.1.0 release needs examples a new user can run, CI that keeps them honest, a README quickstart that prints its results when copied into a clean project, package metadata that points at the docs site, a changelog entry that says what 0.1 means, and a version commit that passes its own tests. - examples/: four programs covering the jobs the README presents (read a CCD, build one and round-trip it, lenient versus strict parsing of a quirky document, edit a section into a CDA R2 revision). Each imports @cosyte/ccda by name, so it runs against the built package through its own exports, and asserts its own output. The one input document is a copy of the quickstart fixture, kept in a .ts module because this repository never tracks an XML document as a file. - pnpm examples runs them all (scripts/run-examples.ts, refusing to pass when it finds nothing to run); typecheck:examples and lint:examples check them against the built types. The PHI scan already walks the whole tree. ci.yml gains an examples job with the same action pins as the conformance job; format and format:check cover examples/. - README Usage: the block now prints its key results with console.log, followed by a text block of the output, and test/docs-content.test.ts runs the block as a program and requires its stdout to equal that text block, with a negative control. The `// =>` claims and the MRN input the first-use tests mutate are unchanged. - README Status states what 0.1.0 promises, and the version commit now keeps it true: scripts/sync-readme-version.ts rewrites the one bold backticked version in `## Status` to package.json's, run by the `version` script after sync-version.mjs. With the Status as it was, the Version Packages commit failed "states the version package.json declares" in the release Verify step, before anything publishes; the sync also keeps the published README from declaring 0.0.15 at 0.1.0. - package.json: keywords for C-CDA and its document types; homepage https://docs.cosyte.com/ccda. - .changeset/first-minor-release.md: the minor that states what 0.1 covers, what the version promises below 1.0, and what is not covered yet. It is the changelog entry the release generates. 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/ccdafor its 0.1.0 release. No change undersrc/.What changes
examples/: four runnable programs, one per job the README presents:
read-a-ccd.ts: the document type, the patient and MRN, and the problems, medications and allergies with their code systems.build-and-round-trip.ts: build a spec-clean CCD, read back a UCUM-checked vital sign, check the six required sections and the re-serialized fixed point.lenient-and-strict.ts: a document with a missing medication route reads leniently withMISSING_ROUTE_CODE, and{ strict: true }refuses it with the same code.edit-a-section.ts: replace one section and add another witheditCcda, getting a CDA R2 revision (versionNumber2,RPLC).Each imports
@cosyte/ccdaby name, so it resolves through the package's ownexportsto the builtdist/, prints what it read or built, and asserts its own output. The one input document (examples/data/ccd.ts) is a byte-for-byte copy of the quickstart fixture intest/__fixtures__/first-use.ts, kept in a.tsmodule because this repository never tracks an XML document as a file.Scripts:
pnpm examples(scripts/run-examples.ts, which refuses to pass when it finds nothing to run),typecheck:examplesandlint:examples(against the built types, viaexamples/tsconfig.jsonandexamples/eslint.config.js). The PHI scan already walks the whole tree,examples/included.formatandformat:checknow coverexamples/.CI: a new
examplesjob inci.yml(install, build, typecheck, lint, run), with the same action pins as theconformancejob.README quickstart: the
## Usageblock now prints its key results, followed by atextblock showing the output.test/docs-content.test.tsruns the block as a program against the built entry and requires stdout to equal that text block byte for byte, plus a negative control. The// =>claims and theMRN001input the first-use tests mutate are unchanged.README Status, and the version commit: Status now states what 0.1.0 promises. The README status test requires the version
package.jsondeclares, and the release pipeline runspnpm teston the Version Packages commit before publishing; the Status as it was names only0.0.15, so that commit would have failed there.scripts/sync-readme-version.tsrewrites the one bold backticked version in## Statustopackage.json's, run by theversionscript aftersync-version.mjs(tested intest/scripts/sync-readme-version.test.ts).package.json: keywords for C-CDA and its document types;
homepageis now https://docs.cosyte.com/ccda.description,repositoryandbugswere already correct.Changeset
first-minor-release.md(minor): what 0.1 covers, what the version promises below 1.0, what is not covered yet. It becomes the generated changelog entry.Quickstart proof
From the packed tarball:
Release commit simulation
On a copy of this branch:
pnpm run version(printssync-readme-version: README.md -> 0.1.0, generates the 0.1.0 changelog section), committed locally, thenpnpm typecheck && pnpm lint && pnpm test && pnpm build && pnpm attwexits 0 (43 files, 1369 passed) andformat:checkis clean.Local gates
pnpm typecheck && pnpm lint && pnpm test && pnpm build && pnpm attwpass (43 files, 1369 tests), as doformat:check,phi-scan,check:no-emdash,check:no-internal-refs,typecheck:examples,lint:examplesandexamples.https://claude.ai/code/session_01U24bnHKNxQWMxmfN7ny7w9