###Initial setup: Install rimraf (cross platform module to deal with files)
yarn global add rimraf
Clean all lock files and node_modules:
./bin/cleanup.sh
Setup:
yarn install
###Add a new package:
- create a new dir under ./packages/
- add your package to lerna.json "packages"
- add your package as new workspace in root package.json "workspaces"
- add your package as a code-resource in root tsconfig.json "paths"
###Working with workspaces
Add dependency to all packages at once:
lerna add husky
with Yarn:
yarn add husky -W
Add local dependency to a specific workspace:
lerna add @zm-blood-components/common --scope=@zm-blood-components/donor
with Yarn:
yarn workspace @zm-blood-components/common add react
Run command inside a specific package from root (--stream pipes output):
lerna run --scope @zm-blood-components/common test --stream
with Yarn:
yarn workspace @zm-blood-components/common build
Run command in all packages:
lerna run build