{"id":17242814,"url":"https://github.com/imcuttle/lerna-cli","last_synced_at":"2025-10-16T13:03:09.645Z","repository":{"id":45113042,"uuid":"306226775","full_name":"imcuttle/lerna-cli","owner":"imcuttle","description":"lerna cli with custom command extensions, forked with official lerna","archived":false,"fork":false,"pushed_at":"2024-09-10T10:29:14.000Z","size":1428,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T02:34:02.392Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imcuttle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-22T04:56:55.000Z","updated_at":"2024-09-10T10:30:14.000Z","dependencies_parsed_at":"2024-10-19T22:21:55.063Z","dependency_job_id":"d4c6b41b-9d54-46e8-b20c-1d1b7db354b6","html_url":"https://github.com/imcuttle/lerna-cli","commit_stats":{"total_commits":31,"total_committers":5,"mean_commits":6.2,"dds":0.6451612903225806,"last_synced_commit":"d4fa8b9b4404a85ae725385f88e0ffd1a40ce5f5"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Flerna-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Flerna-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Flerna-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Flerna-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imcuttle","download_url":"https://codeload.github.com/imcuttle/lerna-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248814686,"owners_count":21165802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T06:14:08.600Z","updated_at":"2025-10-16T13:03:09.593Z","avatar_url":"https://github.com/imcuttle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lerna-cli\n\n[![Build status](https://img.shields.io/travis/imcuttle/lerna-cli/master.svg?style=flat-square)](https://travis-ci.org/imcuttle/lerna-cli)\n[![Test coverage](https://img.shields.io/codecov/c/github/imcuttle/lerna-cli.svg?style=flat-square)](https://codecov.io/github/imcuttle/lerna-cli?branch=master)\n[![NPM version](https://img.shields.io/npm/v/lerna-cli.svg?style=flat-square)](https://www.npmjs.com/package/lerna-cli)\n[![NPM Downloads](https://img.shields.io/npm/dm/lerna-cli.svg?style=flat-square\u0026maxAge=43200)](https://www.npmjs.com/package/lerna-cli)\n[![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://prettier.io/)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat-square)](https://conventionalcommits.org)\n\n\u003e lerna cli with custom command extensions, forked with official [lerna](https://www.npmjs.com/package/lerna)\n\nSee https://github.com/lerna/lerna/issues/2742\n\n## Features (VS Official lerna)\n\n- Use local `lerna` even in global command. see [import-local](https://www.npmjs.com/package/import-local)\n- Custom command\n- Nested `lerna.json` in packages\n  ```text\n  packages/\n    foo/\n      projects/\n        bar/\n      lerna.json\n  lerna.json\n  ```\n- Respect pnpm-workspace.yaml\n  1. overwriting `packages`\n  2. dependencies' version allows `workspace:version`\n  ```text\n  packages/\n  lerna.json\n  pnpm-workspace.yaml\n  ```\n  In my best practices case: use pnpm as a monorepo manager, use lerna for publishing or some custom commands.\n\n## Installation\n\n```bash\nnpm install lerna-cli -D\n\nlerna --help\n```\n\n## Custom commands\n\n1. `lerna.json`\n\nAdd `extendCommands` field, supports local file or npm package\n\n```diff\n+ \"extendCommands\": [\n+   \"./commands/custom\",\n+   \"lerna-custom-command\",\n+ ],\n```\n\n2. Write myself custom command\n\n- See official command: [@lerna/init](https://github.com/lerna/lerna/tree/master/commands/init), [@lerna/add](https://github.com/lerna/lerna/tree/master/commands/add)\n\nAdd `command.js`\n\n```javascript\n/**\n * @see https://github.com/yargs/yargs/blob/master/docs/advanced.md#providing-a-command-module\n */\nexports.command = 'custom'\n\nexports.describe = 'custom command.'\n\nexports.builder = {\n  exact: {\n    describe: 'Specify lerna dependency version in package.json without a caret (^)',\n    type: 'boolean'\n  },\n  independent: {\n    describe: 'Version packages independently',\n    alias: 'i',\n    type: 'boolean'\n  }\n}\n\nexports.handler = function handler(argv) {\n  return require('..')(argv)\n}\n```\n\n3. Run custom command\n\n```bash\nlerna custom\n```\n\n## Custom preset\n\n1. `lerna.json`\n\nAdd `extendCommands` field, supports local file or npm package\n\n```diff\n+ \"extendCommands\": [\n+   \"lerna-custom-preset-command\",\n+ ],\n```\n\n2. Write myself custom command preset in `command.js` or `command/index.js`\n\n```javascript\nmodule.exports = [\n  require('lerna-command-a/command'),\n  require('lerna-command-b/command'),\n  require('lerna-command-c/command')\n]\n```\n\n3. Run custom command\n\n```bash\nlerna custom-a\nlerna custom-b\nlerna custom-c\n```\n\n## Recommanded Commands\n\n- [lerna-gpm](https://github.com/imcuttle/lerna-gpm) - lerna command for git package manager\n- [lerna-command-toc](https://github.com/imcuttle/lerna-command-toc) - lerna command for generate toc of packages in markdown\n\n## Contributing\n\n- Fork it!\n- Create your new branch:  \n  `git checkout -b feature-new` or `git checkout -b fix-which-bug`\n- Start your magic work now\n- Make sure npm test passes\n- Commit your changes:  \n  `git commit -am 'feat: some description (close #123)'` or `git commit -am 'fix: some description (fix #123)'`\n- Push to the branch: `git push`\n- Submit a pull request :)\n\n## Authors\n\nThis library is written and maintained by imcuttle, \u003ca href=\"mailto:imcuttle@163.com.com\"\u003eimcuttle@163.com.com\u003c/a\u003e.\n\n## License\n\nMIT - [imcuttle](https://github.com/imcuttle) 🐟\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Flerna-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimcuttle%2Flerna-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Flerna-cli/lists"}