Managing mono repos should be easy. We've written @enzsft/mono to make it easy to work with mono repos and perform common tasks across multiple packages easily!
This package has a hard dependency on Yarn Workspaces. Please ensure you have Yarn installed and Workspaces enabled.
🧐
Motivation Yarn Workspaces are amazing! We
🏎
Getting started Getting up and running is fast!
1. Install the package:
yarn global add @enzsft/mono
2. Use the tool:
# Add react to all packages
mono add react react-dom
# Already have a tool installed called 'mono'?
# Not a problem, just use the alternative tool name!
enz-mono add react react-dom
Commands
Add
Use the Add command to add dependencies to packages in your mono repo.
mono add react react-dom
# Dev dependencies
mono add jest --dev
# Shorthand dev dependencies
mono add jest -D
Run
Use the Run command to run NPM scripts in packages in your mono repo.
mono run start
# Forwarding arguments to the NPM script
mono run test -- --coverage
Remove
Use the Remove command to remove dependencies from packages in your mono repo.
mono remove react react-dom
List
List out all your packages in the format name@version
.
mono list
Find
Find all of your package relative directory paths.
mono find
Common options
Include
Use the Include option to filter packages on a command:
# Only add to the package named 'app'
mono add react react-dom --include app
# Shorthand
mono add react react-dom -i app
# Only add to the packages named 'app' and 'e2e'
mono add jest --include app,e2e
# Add to all packages starting with 'app-'
mono add react react-dom --include app-*
💖
Built with TypeScript with TypeScript type definitions are bundled in with the module. No need to install an additional module for type definitions.
😽
Alternatives Lerna is a great alternative with fleshed out features. Unlike Lerna this tool does not focus on publishing packages.