Repository navigation
Prepare the 0.1.0 release: runnable examples, a self-contained quickstart, metadata and the 0.1 changeset - #153
Merged
Merged
Conversation
…tart, 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 runs when copied into an empty project, package metadata that points at the docs site, and a changelog entry that says what 0.1 means for someone depending on the package. - examples/: four programs covering the jobs the README presents (read the four views, walk every element with its typed value, tolerate a missing preamble and re-serialize spec-clean, de-identify with an audit report). Each imports @cosyte/dicom by name, so it runs against the built package through its own exports, and asserts its own output. The one object is the first-use fixture's bytes as base64 in examples/data/ct-object.ts, since this repository builds fixtures in modules rather than committing binary files. - 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, and phi-scan:examples names them to the PHI scanner, whose roots are test/, README.md and docs-content/. The scanner decodes the base64 object and scans it. - ci.yml gains an examples job, with actions pinned by commit to what the tags dictionary-regen.yml uses resolve to today; format and format:check cover examples/. - README Usage: the block read study.dcm from disk, so it could not run from a clean install. It now parses the same synthetic object inline (the fixture's preamble-less variant, as base64, so the tolerated DICOM_MISSING_PREAMBLE it shows is real) and prints its key results, followed by a text block of the output. test/docs-content.test.ts runs it unmodified, asserts the inline object is byte-identical to the fixture, and requires its stdout to equal the text block, with a negative control; the claim-mutation and compile checks stay. - package.json: keywords for imaging and de-identification; homepage https://docs.cosyte.com/dicom. - .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/dicomfor its 0.1.0 release. No change undersrc/.What changes
examples/: four runnable programs, one per job the README presents:
read-metadata.ts: the patient, study, series and image views, the SOP class named from the dictionary, the study date converted.walk-elements.ts: every element with its dictionary name and its typed, decoded value.tolerate-and-reserialize.ts: an object saved without its preamble reads withDICOM_MISSING_PREAMBLE;serializeDicomwrites spec-clean Part 10 that reads back with no warning and the same values.deidentify.ts: the PS3.15 Annex E Basic Profile applied to the header, the audit report printed, the result written out and re-read; the source dataset is unchanged.Each imports
@cosyte/dicomby name, so it resolves through the package's ownexportsto the builtdist/, prints what it read or wrote, and asserts its own output. The one object is the first-use fixture (test/fixtures/first-use/ct-object.ts) as base64 inexamples/data/ct-object.ts, since this repository builds fixtures in modules rather than committing binary files.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), andphi-scan:examples(the scanner's roots aretest/,README.mdanddocs-content/; it decodes the base64 object and scans it as DICOM).formatandformat:checknow coverexamples/.CI: a new
examplesjob inci.yml. This repo'sdictionary-regen.ymlreferencescheckout@v7,pnpm/action-setup@v6andsetup-node@v6by tag; the new job pins each by the commit that tag resolves to today.README quickstart: the
## Usageblock readstudy.dcmfrom disk, so it could not run from a clean install. It now parses the same synthetic object inline (the fixture's preamble-less variant as base64, so theDICOM_MISSING_PREAMBLEit shows is one the object really carries) and prints its key results, followed by atextblock with the output.test/docs-content.test.tsruns the block unmodified, asserts the inline object is byte-identical toFIRST_USE_CT_NO_PREAMBLE, and requires stdout to equal the text block, with a negative control. The compile check and the claim-mutation check are kept; the temporarystudy.dcmrewrite is gone because nothing reads a file any more.package.json: keywords for imaging and de-identification;
homepageis now https://docs.cosyte.com/dicom.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(package.json andsrc/version.tsto 0.1.0, the changelog section generated), committed locally, thenpnpm typecheck && pnpm lint && pnpm test && pnpm build && pnpm attwexits 0 (105 files, 2617 passed) andformat:checkis clean.Local gates
pnpm typecheck && pnpm lint && pnpm test && pnpm build && pnpm attwpass (105 files, 2617 tests), as doformat:check,phi-scan,check:no-emdash,check:no-internal-refs,typecheck:examples,lint:examples,examplesandphi-scan:examples.pnpm phi-scanprints a PARTIAL note about one object indocs-content/cookbook.md(an undefined-length value); it exits 0 and prints the same onmain, so it is not from this change.https://claude.ai/code/session_01U24bnHKNxQWMxmfN7ny7w9