Skip to content

feat(media): the @dcmjs-org/media bundle - #586

Merged
awatson1978 merged 1 commit into
release/1.0-beta-mediafrom
media/bundle-package
Oct 2, 2026
Merged

awatson1978 merged 1 commit into
release/1.0-beta-mediafrom
media/bundle-package

Conversation

@awatson1978

Copy link
Copy Markdown
Collaborator

This adds the @dcmjs-org/media bundle package — one dependency for all three bulk-data surfaces. The dicomdir, pdfs, and video waves each landed as their own scoped package on this staging branch; this package ties them together so a consumer who wants "the media stuff" installs one thing and gets the namespace shapes dcmjs v2 consumers already know: media (the DICOMDIR builder), encapsulated (PDF and video wrapping, both directions), and image (codec-free image instances plus the JPEG/MP4 header readers). createVideoEventSource, the streaming MP4 → events source, rides along as a top-level named export since v2 never gave it a namespace.

The namespace shapes come from v2's src/index.js — the media, encapsulated, and image object literals there are reproduced name for name — but every import here comes from the three workspace packages (@dcmjs-org/dicomdir, @dcmjs-org/pdfs, @dcmjs-org/video, all workspace:*), not from v2 source paths. The bundle adds no behavior of its own: every export is the same function object as the underlying package's export.

Everything in this PR is hand-written, and it is small on purpose: a package.json, a ~68-line index that is almost entirely import/export lists, a README, and a smoke test. The test is the real contract: it asserts identity (toBe, not shape) between every re-exported name and the underlying package's export, so a future refactor that silently swaps in a wrapper or a copy fails the suite. One test also drives a real PDF round trip through the bundle (encapsulated.encapsulatePdf → encapsulated.extractEncapsulatedPdf, byte-identical) to prove the re-exports are wired to working code, not just truthy objects.

import { media, encapsulated, image } from "@dcmjs-org/media";

const dataset = encapsulated.encapsulatePdf(pdfBytes, { PatientName: "DOE^JANE" });
const dicomdir = media.buildDicomDirDataset(fileSetDescription);
const info = image.parseMp4Info(mp4Bytes);

5 new tests. Full suite on this branch: 935 passing (947 total, 12 skipped), build green.

🤖 Generated with Claude Code

@awatson1978
awatson1978 merged commit f789687 into release/1.0-beta-media Oct 2, 2026
10 checks passed
@awatson1978
awatson1978 deleted the media/bundle-package branch October 2, 2026 21:49
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