Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/remarkablemark/lerna-template
🐉 Lerna TypeScript template
https://github.com/remarkablemark/lerna-template
lerna monorepo react storybook template typescript
Last synced: 3 months ago
JSON representation
🐉 Lerna TypeScript template
- Host: GitHub
- URL: https://github.com/remarkablemark/lerna-template
- Owner: remarkablemark
- License: mit
- Created: 2021-09-11T03:26:44.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-01T12:05:02.000Z (9 months ago)
- Last Synced: 2024-05-01T21:25:41.688Z (9 months ago)
- Topics: lerna, monorepo, react, storybook, template, typescript
- Language: TypeScript
- Homepage: https://lerna-template.netlify.app
- Size: 12.2 MB
- Stars: 14
- Watchers: 1
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lerna Template
[![build](https://github.com/remarkablemark/lerna-template/actions/workflows/build.yml/badge.svg)](https://github.com/remarkablemark/lerna-template/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/remarkablemark/lerna-template/branch/master/graph/badge.svg?token=1SYU67HOUQ)](https://codecov.io/gh/remarkablemark/lerna-template)
[![Netlify Status](https://api.netlify.com/api/v1/badges/46dc4645-697d-455e-8156-9817213bb13a/deploy-status)](https://app.netlify.com/sites/lerna-template/deploys)[Lerna](https://github.com/lerna/lerna) template.
## Prerequisites
- [Node.js](https://nodejs.org/)
- [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)## Install
Clone the repository:
```sh
git clone https://github.com/remarkablemark/lerna-template.git
cd lerna-template
```Install the dependencies:
```sh
npm install
```## Available Scripts
In the root directory, you can run:
### `npm run build`
Builds all packages:
```sh
npm run build
```Builds a single package:
```sh
npm run build -- --scope=
```For example:
```sh
npm run build -- --scope=example-a
```### `npm run clean`
Deletes build artifacts for all packages:
```sh
npm run clean
```Cleans a single package:
```sh
npm run clean -- --scope=
```For example:
```sh
npm run clean -- --scope=example-a
```### `npm run create-package`
Creates a package:
```sh
npm run create-package
```Creates a package using the CLI:
```sh
npm run create-package -- --template=
```Creates package `foo` using the TypeScript template (default):
```sh
npm run create-package foo -- --template=typescript
```Creates package `bar` using the React template:
```sh
npm run create-package bar -- --template=react
```### `npm run lint`
Lints all packages:
```sh
npm run lint
```Lints a single package:
```sh
npm run lint -- --scope=
```For example:
```sh
npm run lint -- --scope=example-a
```### `npm run lint:fix`
Fixes lint errors for all packages:
```sh
npm run lint:fix
```Fixes lint errors for a single package:
```sh
npm run lint:fix -- --scope=
```For example:
```sh
npm run lint:fix -- --scope=example-a
```### `npm run storybook`
Runs Storybook server:
```sh
npm run storybook
```### `npm test`
Runs tests for all packages:
```sh
npm test
```Runs tests for a single package:
```sh
npm test -- --scope=
```For example:
```sh
npm run test -- --scope=example-a
```## Release
Release is automated with [Lerna](https://lerna.js.org/).
If npm publish failed:
1. Delete the Git tags on remote
2. Rerun the [publish](https://github.com/remarkablemark/lerna-template/actions/workflows/publish.yml) workflowBecause 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.
### Canary
To release a canary version for testing, run the [publish](https://github.com/remarkablemark/lerna-template/actions/workflows/publish.yml) workflow with a branch other than `master`.
### Dry Run
To see the to-be-updated versions, run the [publish](https://github.com/remarkablemark/lerna-template/actions/workflows/publish.yml) workflow and enable **Dry run**.
## License
[MIT](LICENSE)