0.3.2 • Published 3 years ago
multi-updates v0.3.2
multi-updates
Update npm dependencies across all packages in a monorepo, with support for version constraints
multi-updates is a simple CLI tool that uses
updates to find new versions of npm
dependencies in multiple packages
(updates operates on a single
package). The typical use-case is to streamline version management in
monorepos, where having multiple versions of the same dependency across
packages can cause conflicts.
Install
# install globally
npm install -g multi-updates
# or install locally as a devDependency
npm install --save-dev multi-updatesUsage
The basic usage is as follow:
# Check and select available updates, then reinstall modules
multi-updates && npm installYou can configure multi-updates by providing the following parameters:
{
"multiUpdates": {
"packages": ["./", "packages/*"],
"exclude": ["packageA", "packageB"],
"constraints": { "eslint": "^7.11.0", "jest": "26.6.0" }
}
}where:
packagesis a list of globs pointing at the packages to checkexcludeis a list of dependencies for which updates won't be checkedconstraintsis a mapping of dependencies to their constrained version, in the usual npm format. Those dependencies will be set to the supplied version in all the packages, regardless of available updates
The configuration can be specified in various ways (by order of precedence):
- any file specified by the
--configparameter that can be read with node'srequirefunction - a
multi-updates.config.jsfile located at the monorepo's root - a
multi-updates.config.jsonfile located at the monorepo's root - a
multiUpdatesentry specified in the rootpackage.jsonfile, as pictured above
For an example of an actual configuration file, check
multi-updates.config.sample.js.
License
multi-updates is MIT licensed