Skip to content
This repository has been archived by the owner on Sep 15, 2020. It is now read-only.
/ mono Public archive

Manage JavaScript mono repos with ease. 😲

License

Notifications You must be signed in to change notification settings

enzsft/mono

Repository files navigation

@enzsft/mono

😲

Manage JavaScript mono repos with ease.

Build Status Coverage via Codecov npm version undefined

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 ❤️ 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 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.