Skip to content

refactor: split the eager and async engines into packages/legacy - #565

Merged
awatson1978 merged 3 commits into
release/1.0-beta-corefrom
split/legacy-package
Oct 2, 2026
Merged

awatson1978 merged 3 commits into
release/1.0-beta-corefrom
split/legacy-package

Conversation

@awatson1978

Copy link
Copy Markdown
Collaborator

This PR starts the @dcmjs/legacy package — the second half of the package-folder split that #564 began. The engines dcmjs users run today (DicomMessage, DicomDict, AsyncDicomReader, and the datasetToBlob helpers) move into packages/legacy, depending on @dcmjs/core and nothing else.

Same commit shape as #564:

  1. The first commit is the scaffold: packages/legacy/package.json (private, version 0.0.0, with "@dcmjs/core": "workspace:*" and pako as its dependencies) and a README.
  2. The second commit is a pure git mv, zero edits — all four files record as R100 renames into packages/legacy/src/.
  3. The third commit is the hand-written rewiring: the moved files' building-block imports now come from @dcmjs/core by name instead of relative paths (the one import that stays relative is DicomMessage → DicomDict, which lives in this package), a two-line shim at each old path under src/ keeps every existing import in src/, test/, and the root index working unchanged, and packages/legacy/src/index.js exports the package surface.

On that surface: per the plan discussion, @dcmjs/legacy re-exports DicomMetaDictionary, the BufferStream classes, and SplitDataView from @dcmjs/core — they've lived on the legacy surface historically, but their code is core's (see #564 for the placement reasoning on each). The direction of that edge is the point: legacy depends on core, never the reverse, so the sync reader can one day be deprecated and removed without touching core or the new engines.

Nothing else moved. decodeCore still sits in src/core/ because it belongs to the streaming-reader wave, not here — it reads through DicomMessage.lookupTag today, and breaking that edge is parser-split work, not move work. The anonymizer, normalizers, adapters, SR, and the rest of the classic extras stay in root src/ for the wrapper package (step 7 of the landing order).

The hand-written total is about 90 changed lines (scaffold 37, import rewiring 29, shims 8, index 18), well under the 500 budget; the pure moves are exempt and declared above. After each commit group: the full suite is 844 passed / 12 skipped / 856, pnpm run build produces the same bundle surface (UMD export names checked against the previous build), and lint and format pass.

🤖 Generated with Claude Code

awatson1978 and others added 3 commits October 1, 2026 22:12
Adds packages/legacy/package.json and README.md, following the same
scaffold precedent as @dcmjs/core (private, version 0.0.0 until the
publish switch flips). The package depends on @dcmjs/core via
workspace:*; the lockfile picks up the new project and link.

Co-Authored-By: Claude Fable 5 <[email protected]>
… git mv)

Pure file moves, zero edits: DicomMessage, DicomDict, AsyncDicomReader,
and datasetToBlob. The rewiring commit in this PR repoints their
building-block imports at @dcmjs/core and adds shims at the old paths.

Co-Authored-By: Claude Fable 5 <[email protected]>
Hand-written rewiring for the pure-move commit before it:

- the moved engines now import their building blocks from @dcmjs/core
  by name instead of relative paths; the only relative import left is
  DicomMessage -> DicomDict, which lives in this package
- a shim at each old path under src/ re-exporting from the new
  packages/legacy location, so every existing import in src/, test/,
  and the root index keeps working unchanged
- packages/legacy/src/index.js exporting the package surface, which
  also re-exports DicomMetaDictionary, the BufferStream classes, and
  SplitDataView from @dcmjs/core for surface compatibility

Co-Authored-By: Claude Fable 5 <[email protected]>
@awatson1978
awatson1978 merged commit f5f93b6 into release/1.0-beta-core Oct 2, 2026
12 of 13 checks passed
@awatson1978
awatson1978 deleted the split/legacy-package branch October 2, 2026 04:13
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant