feat: distribute the CLI as a dpm component - #33
Merged
Conversation
bun build --compile (npm run build:binary) produces a self-contained binary for the dpm component distribution channel. The binary entry embeds the bundled templates at compile time and paths.js materializes them into the project's .generated/ on demand, since init and docker compose need real files. The npm/Node channel is unchanged.
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.
Summary
Closes #32
Ships canton-barebones through a second distribution channel: a dpm component with self-contained per-platform binaries, published to
ghcr.io/bootnodedev/canton-bareboneson every release. Canton developers can install it with dpm and rundpm canton-barebones <cmd>(aliasdpm cbn) without Node on the host. The npm channel is unchanged and both channels ship the same source and version.Changes
templates/are embedded at compile time and materialized into the project's.generated/at runtime (docker compose needs a real file path). The Node/npm code path is untouched — no runtime branching, the entry point decides.dpm publish component) andlicensefield inpackage.json.scripts/build-component.js+dpm-component/component.yaml: cross-compiles the five platforms and assembles the per-platform component layout (binary + manifest + LICENSE; windows variant points at the.exe).dpm publish component --dry-runvalidation, and a smoke test of the linux binary. dpm is pinned by version + sha256 via a shared composite action (.github/actions/setup-dpm).latesttags) right after a successful npm publish, using the workflow'sGITHUB_TOKEN— no new secrets.docs/dpm-local-testing.mdcaptures the local end-to-end test against an ephemeral registry, including dpm quirks.Acceptance criteria
ghcr.io/bootnodedev/canton-bareboneswith a strict-semver tag pluslatestdpm publish component --dry-run) and smoke-test a compiled binaryNote: the ghcr publish path runs for the first time on the next release; making the package public in the org settings after that first publish is a one-time manual step (documented in the workflow comments).
Test plan
Automated tests
scripts/embedded-templates.test.js(new): materialization to.generated/, npm-channel passthrough, stale-copy rewrite, fail-loud on non-embedded files. Run withnpm test(34 tests).componentjob: builds all five platforms, validates withdpm publish component --dry-run, smoke-tests the linux binary (initfrom embedded templates).Manual verification
Full end-to-end against a local OCI registry (now documented in
docs/dpm-local-testing.md): published the component to an ephemeralregistry:2, installed it withdpm add componentin a clean project, and raninit,validate,start(full Canton stack up and healthy),status --json, andresetthroughdpm canton-barebones/dpm cbnon darwin/arm64.Breaking changes
None.
Checklist
Screenshots
None.