1.0.0 • Published 5 years ago

@bsawyer/mpm v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

mpm

CLI for managing multiple npm packages

Why

If you're developing multiple interdependent packages and wish to have a consistent development and versioning workflow without dealing with complicated build configurations or setting up symlinks.

How

This cli is a simple wrapper for yarn or npm commands in most cases. It does a little magic for managing independent versions across packages e.g. you have package A and B which both depend on package C.

~ mpm version C@patch

This will also bump A and B a patch version.

Shared dependencies are also a bonus if you follow the recommended directory structure as they can be installed once in the root.

~ mpm add mocha --dev

Now all packages will have their devDependencies updated to depend on mocha and it will be installed once in the parent node_modules directory.

Structure

The recommended directory structure looks like:

node_modules/
packages/
    node_modules/
        my-awesome-module/
            package.json
package.json

packages/node_modules/** aren't remotely installed modules. They are the packages you will be developing. By naming the immediate parent directory node_modules, when one module requires another they will resolve to a sibling directory.

Usage

Usage: mpm <command> [options]


Commands:

  add <package> [options]      add dependencies for managed packages
  apply <plan> [options]       apply version plan
  config <method>              manage local configuration
  init <package> [options]     generate one or more new managed packages
  install [options]            install managed packages dependencies
  list [options]               list managed packages and managed dependencies
  plan <package> [options]     plan the versioning of managed packages
  publish [options]            publish managed packages
  remove <package> [options]   remove dependencies for managed packages
  run [options] <script>       run script for managed packages
  help [cmd]                   display help for [cmd]

Options:

  -h, --help     output usage information
  -V, --version  output the version number

Known issues

If you want to install a local package globally that depends on another managed package, you will have to remove those definitions in the package.json file before running npm i -g. After installing you can put them back.

Inspired by

License

MIT

1.0.0

5 years ago