UNPKG

lerna

Version:

Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository

54 lines (51 loc) 1.34 kB
import { Command, collectProjectUpdates, listableFormatProjects, output } from "./chunk-WC2B4V4E.js"; // libs/commands/changed/src/index.ts function factory(argv) { return new ChangedCommand(argv); } var ChangedCommand = class extends Command { result; get otherCommandConfigs() { return ["version", "publish"]; } initialize() { if (this.options.conventionalGraduate) { this.options.conventionalCommits = true; if (this.options.forcePublish) { this.logger.warn("option", "--force-publish superseded by --conventional-graduate"); } } const projectsWithPackage = Object.values(this.projectGraph.nodes).filter((node) => !!node.package); const updates = collectProjectUpdates( projectsWithPackage, this.projectGraph, this.execOpts, this.options ); this.result = listableFormatProjects(updates, this.projectGraph, this.options); if (this.result.count === 0) { this.logger.info("", "No changed packages found"); process.exitCode = 1; return false; } return true; } execute() { output(this.result?.text); this.logger.success( "found", "%d %s ready to publish", this.result?.count, this.result?.count === 1 ? "package" : "packages" ); } }; export { factory, ChangedCommand };