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.
Yarn Workspaces are amazing! We ❤️ them! However they're missing a few features that we think are essential to a complete mono repo tool. This package merely builds upon Yarn Workspaces and adds a few features we hope they'll add in the future 🙂. Seriously, Yarn does all the heavy lifting in this package so you know you're in good hands, we merely orchestrate it and nudge it in the right direction.
Getting up and running is fast! ⚡️
yarn global add @enzsft/mono
# 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
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
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
Use the Remove command to remove dependencies from packages in your mono repo.
mono remove react react-dom
List out all your packages in the format name@version
.
mono list
Find all of your package relative directory paths.
mono find
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-*
TypeScript type definitions are bundled in with the module. No need to install an additional module for type definitions.
Lerna is a great alternative with fleshed out features. Unlike Lerna this tool does not focus on publishing packages.