UNPKG

@lerna/publish

Version:

Publish packages in the current project

34 lines (33 loc) 966 B
var import_core = require("@lerna/core"); module.exports = function factory(argv) { return new ListCommand(argv); }; class ListCommand extends import_core.Command { // TODO: refactor based on TS feedback // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore result; get requiresGit() { return false; } initialize() { let chain = Promise.resolve(); chain = chain.then(() => (0, import_core.getFilteredPackages)(this.packageGraph, this.execOpts, this.options)); chain = chain.then((filteredPackages) => { this.result = (0, import_core.listableFormat)(filteredPackages, this.options); }); return chain; } execute() { if (this.result.text.length) { (0, import_core.output)(this.result.text); } this.logger.success( "found", "%d %s", this.result.count, this.result.count === 1 ? "package" : "packages" ); } } module.exports.ListCommand = ListCommand;