UNPKG

npm-ws-tools

Version:

Command line tools for working with npm workspaces. Includes version bumping and dependencies version update

23 lines 1.09 kB
import { Command } from 'commander'; import { Package } from "./Package.js"; import { bumpVersions, updateDependencies } from "./bump.js"; import { getVersion } from "./utils.js"; const program = new Command(); program.version(getVersion()); program.command("bump [version]") .description("Bump the version of all selected projects") .option('-x, --exclude [projectsPattern}]', 'A glob or project path to exclude') .action((version, options) => { const root = Package.findClosest().loadRoot().excludeProjects(options.exclude); bumpVersions(root, version); }); program.command("dep <name> <version>") .description("Update the named dependency version. Example `dep @my/package ^123`") .option('-x, --exclude [projectsPattern}]', 'A glob or project path to exclude') .action((name, version, options) => { const root = Package.findClosest().loadRoot().excludeProjects(options.exclude); console.log(`Updating dependency ${name} to version ${version}`); updateDependencies(root, { [name]: version }); }); program.parse(); //# sourceMappingURL=index.js.map