lerna cli with custom command extensions, forked with official lerna
MIT License
lerna cli with custom command extensions, forked with official lerna
See https://github.com/lerna/lerna/issues/2742
lerna
even in global command. see import-local
lerna.json
in packages
packages/
foo/
projects/
bar/
lerna.json
lerna.json
packages
workspace:version
packages/
lerna.json
pnpm-workspace.yaml
In my best practices case: use pnpm as a monorepo manager, use lerna for publishing or some custom commands.npm install lerna-cli -D
lerna --help
lerna.json
Add extendCommands
field, supports local file or npm package
+ "extendCommands": [
+ "./commands/custom",
+ "lerna-custom-command",
+ ],
Add command.js
/**
* @see https://github.com/yargs/yargs/blob/master/docs/advanced.md#providing-a-command-module
*/
exports.command = 'custom'
exports.describe = 'custom command.'
exports.builder = {
exact: {
describe: 'Specify lerna dependency version in package.json without a caret (^)',
type: 'boolean'
},
independent: {
describe: 'Version packages independently',
alias: 'i',
type: 'boolean'
}
}
exports.handler = function handler(argv) {
return require('..')(argv)
}
lerna custom
lerna.json
Add extendCommands
field, supports local file or npm package
+ "extendCommands": [
+ "lerna-custom-preset-command",
+ ],
command.js
or command/index.js
module.exports = [
require('lerna-command-a/command'),
require('lerna-command-b/command'),
require('lerna-command-c/command')
]
lerna custom-a
lerna custom-b
lerna custom-c
git checkout -b feature-new
or git checkout -b fix-which-bug
git commit -am 'feat: some description (close #123)'
or git commit -am 'fix: some description (fix #123)'
git push
This library is written and maintained by imcuttle, [email protected].
MIT - imcuttle 🐟