Repository navigation
Install the repo without the Daml toolchain #158
Description
User story / Problem statement
Currently the root package.json carries "postinstall": "npm run setup",
which is scripts/fetch-dep.sh: it wants dpm, a JDK 17+, git and a 123 MB
clone of canton-network/splice, and it takes minutes on a first run. npm runs
a dependency's postinstall during the consumer's install, so anyone
depending on this repository pays for the entire Daml toolchain in order to
start an HTTP service that never reads a DAR. On a machine without dpm the
install does not merely slow down, it fails outright.
Expected outcome
A root npm install compiles the registry service and vendors nothing.
Vendoring the Splice DARs becomes an explicit npm run setup, which is the
command that already did it. A checkout that has never run setup can still
install and build the service.
Acceptance criteria
Install lifecycle
-
postinstallis gone from the rootpackage.json -
preparerunstsc -p registry/tsconfig.json - A root
npm installin a fresh clone createsregistry/dist/index.jsand
does not createdeps/ - A root
npm installsucceeds withdpmabsent fromPATH -
npm run setupstill vendors, unchanged
Dependency closure
- The root manifest declares
dotenv,express,express-openapi-validator
andpinoasdependencies, at the rangesregistry/package.jsonuses - The root manifest declares
typescript,@types/expressand@types/node
asdevDependencies, at those same ranges -
registry/package.jsondeclares@types/nodeexplicitly - Both lockfiles are regenerated, and
npm cisucceeds at the root and in
registry/
Nothing else moves
-
registry/'s own lint, build, suite typecheck and unit suite all still pass
Documentation
- No document claims that a root
npm installvendors the Daml dependencies
Alternatives considered
- Guard
postinstallso it no-ops during a consumer's install (detecting via
INIT_CWD,npm_config_globalor similar). Rejected: the detection is fragile
across npm, pnpm and yarn, and it still leaves a script in the consumer's
install graph that can fail. Deleting it removes the whole class of failure. - Keep
postinstalland tell consumers to install with--ignore-scripts.
Rejected: that flag also skipsprepare, so the consumer gets no build at all.
Technical notes
tscreads type declarations that ship insidepinoand
express-openapi-validator, so the runtimedependenciesare needed for the
compile, not only at runtime. A root build with devDependencies alone dies
with twoTS2307: Cannot find moduleerrors. Declaring them in this issue
rather than a later one is what keeps this one independently green.- Pin
@types/nodeat the version that already resolves transitively (^26.1.1
at the time of writing; confirm with
node -e 'console.log(require("./registry/node_modules/@types/node/package.json").version)').
registry/srcusesnode:path,node:urlandprocess, and compiles today
only because vitest and tsx pull the package in. Pinning a lower major would
silently change the type surface the existing suites were vetted against. registry/tsconfig.jsonneeds no change:outDirandincludeare relative
to the tsconfig's own directory, so a root-driven build emits to
registry/distexactly ascd registry && npm run builddoes.- No CI job runs a root
npm install. Thedamljob calls
bash scripts/fetch-dep.shdirectly, and theregistryjob installs inside
registry/..github/workflows/release.ymlalso callsfetch-dep.sh
directly, at lines 148 and 178; its onlynpm run setupmention is a comment
describing what a consumer does, which stays true. So deletingpostinstall
changes no workflow behaviour and needs no workflow edit. registry/package-lock.jsonhas to be regenerated alongside
registry/package.json, or theregistryCI job'snpm cifails loudly on
the drift.- Sites that state or imply that
npm installvendors:README.md(three),
RUNBOOK.md(two),ARCHITECTURE.md(one),CLAUDE.md(three),SPEC.md
(one).RUNBOOK.md'scd registry && npm installis correct and stays.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity