feat: distribute the registry as a runnable npm dependency - #171
Merged
Conversation
…ycle chore: build the registry on install instead of vendoring the Daml deps
feat: publish the registry as the root package's bin
feat: guard the root and registry manifests against dependency drift
docs: document consuming the registry as an npm dependency
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
Part of #157
canton-dappboosterneeds to run this registry in its local stack with the pin in alockfile, the way it already consumes
@bootnodedev/canton-wallet-service. Todaynothing here is packable, and a root
npm installvendors 124 MB of Splice for aservice that never reads a DAR. This makes the root manifest the npm face of the
repository and ships the six task branches of the epic (#164, #165, #166, #167, #168,
#170).
Changes
@bootnodedev/canton-token-forge0.2.0,"type": "module",bin,files,engines >=20, and the service's four runtimedependencies
postinstalldeleted,preparecompilesregistry/src; vendoring the Splice DARsis now the explicit
npm run setup.gitignoreasregistry/**/dist,so
registry/distreaches the tarballscripts/check-registry-deps.mjs+npm run check:deps: fails when the twomanifests or their lockfiles disagree on a declared package
scripts/registry-install-smoke.sh+npm run smoke:registry: packs, installs intoa scratch consumer and runs the bin, with no participant and no Daml toolchain
packageCI job running both, plus an ungated table asserting where thebuild-output ignore rule lives and what it covers
README.mddocuments the consumer install;RUNBOOK.md,ARCHITECTURE.md,CLAUDE.mdandSPEC.mdrefreshedAcceptance criteria
dependenciesand gets a working installwith neither
dpmnor a JDK onPATHpnpm exec canton-token-forge-registrystarts the service, configured entirelyfrom the environment. Diverged: npm links and runs the bin unmodified, but
pnpm 10 and 11 refuse a git dependency that builds on install unless the
consumer allowlists the resolved specifier. Documented in
README.mdandtracked as Reconsider building the registry on install, which pnpm consumers must allowlist #169
it on every change that could break it
registry/dependency lists cannot drift without failing a check.Scoped: the guard compares the packages declared in both manifests plus
their lockfile resolutions; the full runtime closure was considered and declined
and the git-credentials precondition
v0.2.0is cut after merge and the pin the README names resolvesTest plan
Automated tests
The two new scripts are the tests.
npm run check:depscompares 7 shared packages andexits 0;
npm run smoke:registrypacks the 24-entry tarball, assertsregistry/dist/index.jsand the four OpenAPI specs are in it, installs it into a scratch consumer and runs the bin
twice (unconfigured, then serving
/healthzand/registry/metadata/v1/infoagainst aclosed port). Both run in the new
packagejob. The registry's own 205-test suite isunchanged and green. All three checks were green on
427969c; CI runs only on pullrequests and pushes to
main, so this PR is the first run over the merged tree.Manual verification
A real
npm install github:BootNodeDev/canton-token-forge#<sha>from a scratch consumeroutside the repository lands the 24-entry payload and runs the bin. Each of the six task
PRs carried its own review round before merging here.
Breaking changes
A root
npm installno longer vendors the Splice DARs; that isnpm run setupnow. Theroot package also gains a scoped name,
"type": "module"and a Node>=20floor. Nothingoutside this repository consumes it yet.
Checklist
Screenshots
None.