tckb / network-monorepo

A monorepo containing all the main components of Streamr Network.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Streamr

Streamr Network + Client Monorepo

Streamr network, client & supporting packages. Work in progress.

Contains

Build Status

Client – Lint, Unit, Integration Tests

Client – Test Build

Protocol – Lint, Test and Publish

Broker – Lint, Test and Publish

Network – Lint, Test and Publish

Installation

Uses lerna.

# from top level
npm ci # installs monorepo top-level dependencies
npm run bootstrap # installs dependencies for all packages and links them together

Install + link one sub-package

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.

Important: Do not use npm ci or npm install for monorepo sub-packages.

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

Regenerate lockfiles

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.

Clean node_modules

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

Install an npm/internal dependency into a sub-package

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

List active versions & symlinks

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

image

About

A monorepo containing all the main components of Streamr Network.


Languages

Language:TypeScript 79.7%Language:JavaScript 17.5%Language:Java 2.2%Language:HTML 0.5%Language:Makefile 0.1%Language:Dockerfile 0.0%Language:Shell 0.0%