Monorepo containing all the main components of Streamr Network.
- network-node (@streamr/network-node)
- network-tracker (@streamr/network-tracker)
- protocol (@streamr/protocol)
- utils (@streamr/utils)
- test-utils (@streamr/test-utils)
Node.js 16.13.x is the minimum required version. Node.js 18.12.x , NPM 8.x and later versions are recommended. |
---|
The monorepo is managed using npm workspaces.
Installation on an Apple Silicon Mac requires additional steps, see install-on-apple-silicon.md.
Important: Do not use npm ci
or npm install
directly in the sub-package directories.
The go-to command for most use cases.
To install all required dependencies and build all sub-packages (linking sub-packages together as needed):
# from top level
npm run bootstrap
To install the required dependencies and build a specific sub-package:
# from top level
npm run bootstrap-pkg --package=$PACKAGE_NAME
To only install required dependencies and link sub-packages together (and skip build phase):
# from top level
npm ci
To build all sub-packages:
# from top level
npm run build
To build a specific sub-package:
# from top level
npm run build --workspace=$PACKAGE_NAME
To clear all caches and remove the dist
directory from each sub-package:
# from top level
npm run clean-dist
To removes all caches, built files, and node_modules
of each sub-package, and the
top-level node_modules
:
# from top level
npm run clean
To install git hooks (e.g. Husky for conventional commit validation):
npm run install-git-hooks
Manually add the entry to the package.json
of the sub-package and
run npm run bootstrap-pkg $PACKAGE_NAME
.
Alternatively, run:
npm install some-dependency --workspace=$PACKAGE_NAME
Check which sub-packages are currently being symlinked.
# from top level
npm run versions
This lists sub-packages & their versions on the left, linked
sub-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
All the above packages should be released at the same time.
git checkout main
git pull
./update-versions.sh <SEMVER>
E.g../update-versions 7.1.1
npm run clean && npm install && npm run build && npm run versions
- Look at the output of the above and ensure all versions are linked properly (i.e. no yellow or red markers)
- Update client and cli-tool CHANGELOG.md
- If releasing a major / minor version, update API docs link in packages/client/README.md.
- Add relevant files to git staging
git commit -m "release(client, cli-tools): vX.Y.Z"
git tag client/vX.Y.Z
git tag cli-tools/vX.Y.Z
- Push to main
git push origin
- Push to tag
git push origin client/vX.Y.Z
- Push to tag
git push origin cli-tools/vX.Y.Z
- At this point we are to do the actual release
- Clean and rebuild project with
npm run clean && npm run bootstrap
- Then we do actual publishing of packages with
./release.sh <NPM_TAG>
. Use argumentbeta
if publishing a beta version. Uselatest
instead when publishing a stable version. - Update client docs if major or minor change:
# Generate & upload API docs (if a major/minor version update)
cd packages/client
npm run docs
aws s3 cp ./docs s3://api-docs.streamr.network/client/vX.Y --recursive --profile streamr-api-docs-upload
Broker is released independently of other packages because it follows its own versioning for the time being.
git checkout main
cd packages/broker
npm version <SEMVER_OPTION>
git add package.json
git commit -m "release(broker): vX.Y.Z"
git tag broker/vX.Y.Z
git push origin
git push origin broker/vX.Y.Z
npm run build
npm publish
- Go to https://github.com/streamr-dev/network/actions/workflows/release.yml
- From "run workflow" dropdown:
- select
main
branch - click "Run workflow"
- select
- You can manually cancel other queued workflows (triggered by possible previous commits to
main
) - After ~1 hour a new release is ready, annotated with
latest
tag: https://hub.docker.com/r/streamr/broker-node/tags