https://github.com/jenbuzz/monorepo-boilerplate
Monorepo-Boilerplate using Yarn Workspaces and Lerna
https://github.com/jenbuzz/monorepo-boilerplate
lerna monorepo monorepo-example yarn-workspaces
Last synced: 10 months ago
JSON representation
Monorepo-Boilerplate using Yarn Workspaces and Lerna
- Host: GitHub
- URL: https://github.com/jenbuzz/monorepo-boilerplate
- Owner: jenbuzz
- Created: 2019-01-24T20:54:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-24T21:20:59.000Z (over 7 years ago)
- Last Synced: 2025-04-11T17:50:38.072Z (about 1 year ago)
- Topics: lerna, monorepo, monorepo-example, yarn-workspaces
- Language: JavaScript
- Homepage:
- Size: 35.2 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# monorepo-boilerplate
This project serves as a boilerplate for setting up a monorepo using Yarn Workspaces and Lerna.
## Usage
Run 'client' package which uses 'shared' package:
```
$ node packages/client/index.js
```
Run 'server' package which uses 'shared' package:
```
$ node packages/server/index.js
```
Run 'test' script in all packages with one command from root:
```
$ yarn test
```
## How was this created?
* Create package.json with ```"private": true``` and ```"workspaces": ["packages/*"]```.
* Create folder 'packages' with the subfolders: 'client', 'server', and 'shared'.
* Run ```yarn init -y``` in all packages subfolders.
* Add 'shared' as a dependency in package.json in 'client' and 'server' folders.
* Run ```yarn install```.
* Create an index.js file with a function in 'shared' folder.
* Create an index.js file in both 'client' and 'server' folders which requires 'shared'.
* Run ```yarn add -D -W lerna``` from root to add Lerna.
* Run ```npx lerna init``` to setup Lerna.
* Add ```"npmClient": "yarn"``` and ```"useWorkspaces": true``` to lerna.json.
* Add test script that runs lerna to package.json in root.
* Add test script to package.json in all packages folders.