Streamr network, client & supporting packages. Work in progress.
- network (streamr-network)
- broker (streamr-broker)
- client (streamr-client)
- protocol (streamr-client-protocol)
- test-utils (streamr-test-utils)
- cli-tools (@streamr/cli-tools)
- cross-client-testing (com.streamr.client_testing)
Uses lerna.
# from top level
npm ci # installs monorepo top-level dependencies
npm run bootstrap # installs dependencies for all packages and links them together
The script bootstrap-pkg
script installs all dependencies of a sub-package, links internal packages, builds sub-deps and the target dep by running their prepare
scripts.
Normal npm ci
and npm install
commmands will not work within a sub-package e.g. packages/streamr-client
, because npm
doesn't know how to deal with the monorepo sub-package linking.
# from top level
npm run bootstrap-pkg $PACKAGE_NAME
# e.g.
npm run bootstrap-pkg streamr-client
npm run bootstrap-pkg streamr-network
Note that bootstrap-pkg
won't generate package-lock.json
for you. To (re)generate lockfiles use bootstrap
.
# from top level
npm run boostrap
If generating the package-lock.json
creates a particularly noisy diff, you may want to remove all node_modules
from every sub-package before (re)running bootstrap
. See below.
This removes all node_modules
from each sub-package. This seems to produce cleaner package-lock.json
diffs.
# from top level
npm run clean
# then optionally
npm run bootstrap
Manually add the package + version to the appropriate package.json
and run npm run bootstrap-pkg $PACKAGE_NAME
.
Alternatively, this may work:
# from top level
npx lerna add $NPM_DEP --scope $PACKAGE_NAME
# e.g.
npx lerna add express --scope stream-network
Check which packages are currently being symlinked.
# from top level
npm run versions
This lists internal packages & their versions on the left, linked packages are columns.
If the package on the left links to the package in the column, it shows a checkmark & the semver range, otherwise it shows the mismatched semver range and prints a warning at the end.
It prints the version ranges so you can double-check that they're formatted as you expect e.g. ^X.Y.Z
vs X.Y.Z