🐉 Lerna TypeScript template
MIT License
Lerna template.
Clone the repository:
git clone https://github.com/remarkablemark/lerna-template.git
cd lerna-template
Install the dependencies:
npm install
In the root directory, you can run:
npm run build
Builds all packages:
npm run build
Builds a single package:
npm run build -- --scope=<package-name>
For example:
npm run build -- --scope=example-a
npm run clean
Deletes build artifacts for all packages:
npm run clean
Cleans a single package:
npm run clean -- --scope=<package-name>
For example:
npm run clean -- --scope=example-a
npm run create-package
Creates a package:
npm run create-package
Creates a package using the CLI:
npm run create-package <package-name> -- --template=<template>
Creates package foo
using the TypeScript template (default):
npm run create-package foo -- --template=typescript
Creates package bar
using the React template:
npm run create-package bar -- --template=react
npm run lint
Lints all packages:
npm run lint
Lints a single package:
npm run lint -- --scope=<package-name>
For example:
npm run lint -- --scope=example-a
npm run lint:fix
Fixes lint errors for all packages:
npm run lint:fix
Fixes lint errors for a single package:
npm run lint:fix -- --scope=<package-name>
For example:
npm run lint:fix -- --scope=example-a
npm run storybook
Runs Storybook server:
npm run storybook
npm test
Runs tests for all packages:
npm test
Runs tests for a single package:
npm test -- --scope=<package-name>
For example:
npm run test -- --scope=example-a
Release is automated with Lerna.
If npm publish failed:
Because Lerna commits and pushes the release to the remote repository, branch protection rules have been disabled.
To prevent race conditions with Lerna release, don't merge PRs until after the publish workflow is done.
To release a canary version for testing, run the publish workflow with a branch other than master
.
To see the to-be-updated versions, run the publish workflow and enable Dry run.