@lerna-lite/cli
Advanced tools
Comparing version 0.3.4 to 0.3.5
#!/usr/bin/env node | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
@@ -16,41 +16,41 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
function logCliVersion() { | ||
var _a; | ||
const pkg = require('../package.json'); | ||
npmlog_1.default.notice('cli', `version ${(_a = pkg === null || pkg === void 0 ? void 0 : pkg.version) !== null && _a !== void 0 ? _a : ''}`); | ||
var _a; | ||
const pkg = require('../package.json'); | ||
npmlog_1.default.notice('cli', `version ${(_a = pkg === null || pkg === void 0 ? void 0 : pkg.version) !== null && _a !== void 0 ? _a : ''}`); | ||
} | ||
function publishHandler(argv) { | ||
logCliVersion(); | ||
new publish_1.PublishCommand(argv); | ||
logCliVersion(); | ||
new publish_1.PublishCommand(argv); | ||
} | ||
function versionHandler(argv) { | ||
logCliVersion(); | ||
new version_1.VersionCommand(argv); | ||
logCliVersion(); | ||
new version_1.VersionCommand(argv); | ||
} | ||
const cli = (0, yargs_1.default)(process.argv, process.cwd()); | ||
(0, yargs_1.default)(process.argv.slice(2)) | ||
.example('$0 version build -- --silent', '# `npm version build --silent` in all packages with a build script') | ||
.command({ | ||
.example('$0 version build -- --silent', '# `npm version build --silent` in all packages with a build script') | ||
.command({ | ||
command: 'publish [bump]', | ||
describe: 'publish a new version', | ||
handler: publishHandler, | ||
}) | ||
.command({ | ||
}) | ||
.command({ | ||
command: 'version [bump]', | ||
describe: 'roll a new version', | ||
handler: versionHandler, | ||
}) | ||
.parserConfiguration({ | ||
}) | ||
.parserConfiguration({ | ||
'populate--': true, | ||
}) | ||
.positional('script', { | ||
}) | ||
.positional('script', { | ||
describe: 'The npm script to run. Pass flags to send to the npm client after --', | ||
type: 'string', | ||
}) | ||
.options({ ...versionCommandOptions_1.versionCommandOptions, ...publishCommandOptions_1.publishCommandOptions }) | ||
.demandCommand(1, 'A command is required. Pass --help to see all available commands and options.') | ||
.usage('Usage: $0 <command> [options]') | ||
.recommendCommands() | ||
.help() | ||
.wrap(null) | ||
.fail((msg, err) => { | ||
}) | ||
.options({ ...versionCommandOptions_1.versionCommandOptions, ...publishCommandOptions_1.publishCommandOptions }) | ||
.demandCommand(1, 'A command is required. Pass --help to see all available commands and options.') | ||
.usage('Usage: $0 <command> [options]') | ||
.recommendCommands() | ||
.help() | ||
.wrap(null) | ||
.fail((msg, err) => { | ||
// certain yargs validations throw strings :P | ||
@@ -60,20 +60,20 @@ const actual = err || new Error(msg); | ||
if (actual.name !== 'ValidationError' && !actual.pkg) { | ||
// the recommendCommands() message is too terse | ||
if (/Did you mean/.test(actual.message)) { | ||
npmlog_1.default.error('lerna', `Unknown command "${cli.parsed.argv._[0]}"`); | ||
} | ||
npmlog_1.default.error('lerna', actual.message); | ||
// the recommendCommands() message is too terse | ||
if (/Did you mean/.test(actual.message)) { | ||
npmlog_1.default.error('lerna', `Unknown command "${cli.parsed.argv._[0]}"`); | ||
} | ||
npmlog_1.default.error('lerna', actual.message); | ||
} | ||
// exit non-zero so the CLI can be usefully chained | ||
cli.exit(actual.exitCode > 0 ? actual.exitCode : 1, actual); | ||
}) | ||
.wrap(cli.terminalWidth()).epilogue((0, dedent_1.default) ` | ||
}) | ||
.wrap(cli.terminalWidth()).epilogue((0, dedent_1.default)` | ||
When a command fails, all logs are written to lerna-debug.log in the current working directory. | ||
For more information, find our manual at https://github.com/ghiscoding/lerna-lite | ||
`) | ||
// workaround yargs bug that re-interprets unknown arguments in argv._ | ||
.parserConfiguration({ | ||
// workaround yargs bug that re-interprets unknown arguments in argv._ | ||
.parserConfiguration({ | ||
'populate--': true, | ||
}) | ||
.argv; | ||
//# sourceMappingURL=cli.js.map | ||
}) | ||
.argv; | ||
//# sourceMappingURL=cli.js.map |
{ | ||
"name": "@lerna-lite/cli", | ||
"description": "Lerna-Lite CLI for the Version/Publish commands", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"main": "dist/index.js", | ||
@@ -36,5 +36,5 @@ "types": "dist/index.d.ts", | ||
"dependencies": { | ||
"@lerna-lite/core": "^0.3.4", | ||
"@lerna-lite/publish": "^0.3.4", | ||
"@lerna-lite/version": "^0.3.4", | ||
"@lerna-lite/core": "^0.3.5", | ||
"@lerna-lite/publish": "^0.3.5", | ||
"@lerna-lite/version": "^0.3.5", | ||
"dedent": "^0.7.0", | ||
@@ -47,5 +47,5 @@ "dotenv": "^14.3.2", | ||
"@types/npmlog": "^4.1.4", | ||
"@types/yargs": "^17.0.8" | ||
"@types/yargs": "^17.0.9" | ||
}, | ||
"gitHead": "2bca550e36259af5ef69dae1624a2e54bae3d14f" | ||
"gitHead": "c64bf64a0662afa82b1452925516f0eeb728d648" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
739
35461
Updated@lerna-lite/core@^0.3.5
Updated@lerna-lite/publish@^0.3.5
Updated@lerna-lite/version@^0.3.5