{"action":"created","issue":{"url":"https://api.github.com/repos/lerna/lerna/issues/961","repository_url":"https://api.github.com/repos/lerna/lerna","labels_url":"https://api.github.com/repos/lerna/lerna/issues/961/labels{/name}","comments_url":"https://api.github.com/repos/lerna/lerna/issues/961/comments","events_url":"https://api.github.com/repos/lerna/lerna/issues/961/events","html_url":"https://github.com/lerna/lerna/issues/961","id":248280229,"node_id":"MDU6SXNzdWUyNDgyODAyMjk=","number":961,"title":"Separate \"version\" and \"publish\" commands","user":{"login":"shawnbot","id":113896,"node_id":"MDQ6VXNlcjExMzg5Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/113896?v=4","gravatar_id":"","url":"https://api.github.com/users/shawnbot","html_url":"https://github.com/shawnbot","followers_url":"https://api.github.com/users/shawnbot/followers","following_url":"https://api.github.com/users/shawnbot/following{/other_user}","gists_url":"https://api.github.com/users/shawnbot/gists{/gist_id}","starred_url":"https://api.github.com/users/shawnbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawnbot/subscriptions","organizations_url":"https://api.github.com/users/shawnbot/orgs","repos_url":"https://api.github.com/users/shawnbot/repos","events_url":"https://api.github.com/users/shawnbot/events{/privacy}","received_events_url":"https://api.github.com/users/shawnbot/received_events","type":"User","site_admin":true},"labels":[{"id":380273259,"node_id":"MDU6TGFiZWwzODAyNzMyNTk=","url":"https://api.github.com/repos/lerna/lerna/labels/discussion","name":"discussion","color":"0052cc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/lerna/lerna/milestones/2","html_url":"https://github.com/lerna/lerna/milestone/2","labels_url":"https://api.github.com/repos/lerna/lerna/milestones/2/labels","id":3023875,"node_id":"MDk6TWlsZXN0b25lMzAyMzg3NQ==","number":2,"title":"v3.0.0","description":"Drop node v4, expose internals as reusable packages, run local lerna from global cli, rename \"updated\" -> \"changed\", rename various option flags, and remove ability to publish root package.json","creator":{"login":"evocateur","id":5605,"node_id":"MDQ6VXNlcjU2MDU=","avatar_url":"https://avatars3.githubusercontent.com/u/5605?v=4","gravatar_id":"","url":"https://api.github.com/users/evocateur","html_url":"https://github.com/evocateur","followers_url":"https://api.github.com/users/evocateur/followers","following_url":"https://api.github.com/users/evocateur/following{/other_user}","gists_url":"https://api.github.com/users/evocateur/gists{/gist_id}","starred_url":"https://api.github.com/users/evocateur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evocateur/subscriptions","organizations_url":"https://api.github.com/users/evocateur/orgs","repos_url":"https://api.github.com/users/evocateur/repos","events_url":"https://api.github.com/users/evocateur/events{/privacy}","received_events_url":"https://api.github.com/users/evocateur/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":39,"state":"closed","created_at":"2018-01-09T18:37:08Z","updated_at":"2018-12-27T00:24:27Z","due_on":null,"closed_at":"2018-12-27T00:24:27Z"},"comments":16,"created_at":"2017-08-06T23:49:45Z","updated_at":"2018-12-27T10:09:15Z","closed_at":"2018-07-27T17:13:03Z","author_association":"CONTRIBUTOR","body":"Lerna needs a separate `version` command.\r\n\r\n### Why\r\nFolks who use npm a lot are probably comfortable with the separation between the `npm version` and `npm publish` commands. For me, this separation is important because it allows me to double- and triple-check things before publishing. When versioning and publishing a monorepo with dozens of packages, the \"publish anxiety\" factor is even higher. I've worked through some of that anxiety with various permutations of `--skip-git` and `--skip-npm` then `git diff`, but at some point you have to `git reset` and just trust that Lerna is going to do the right thing.\r\n\r\nThe other problem is that Lerna doesn't make it easy (possible?) to just publish all of the packages using the existing `package.json` versions. AFAICT, it's not possible to skip the increment step, which means that you have to run something like this instead:\r\n\r\n```\r\nlerna exec --bail=false npm publish\r\n```\r\n\r\n...which will output a lot of scary `npm publish` error messages for any of your packages that haven't been bumped since the last release.\r\n\r\nWe recently introduced a CI-driven automated publishing workflow in [Primer](/primer/primer-css), and to get around this we resorted to [running](https://github.com/primer/primer-css/blob/master/script/release#L9) a [`try-publish` script](https://github.com/primer/primer-css/blob/master/script/try-publish), which would only run `npm publish` if the version in each module's `package.json` hadn't already been published. Other teams that want to automate publishing will inevitably run into the same issue, and it would stink if they all ended up having to come up with their own solutions for it.\r\n\r\n### How\r\nThere are a couple of ways to go about this:\r\n\r\n1. To maintain backwards compatibility with the current CLI API, the `publish` command could introduce two new options:\r\n    * one that does everything _but_ the git and npm steps, e.g. `lerna publish --skip-publish`\r\n    * one that _only_ publishes without touching any `package.json` files, e.g. `lerna publish --skip-version`\r\n\r\n1. If you're comfortable breaking the `publish` CLI for 2.x users, you could avoid adding any additional options to `publish` and just move all of the versioning logic over to a new `version` command."},"comment":{"url":"https://api.github.com/repos/lerna/lerna/issues/comments/450120974","html_url":"https://github.com/lerna/lerna/issues/961#issuecomment-450120974","issue_url":"https://api.github.com/repos/lerna/lerna/issues/961","id":450120974,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDEyMDk3NA==","user":{"login":"lock[bot]","id":33595554,"node_id":"MDM6Qm90MzM1OTU1NTQ=","avatar_url":"https://avatars1.githubusercontent.com/in/6672?v=4","gravatar_id":"","url":"https://api.github.com/users/lock%5Bbot%5D","html_url":"https://github.com/apps/lock","followers_url":"https://api.github.com/users/lock%5Bbot%5D/followers","following_url":"https://api.github.com/users/lock%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/lock%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/lock%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lock%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/lock%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/lock%5Bbot%5D/repos","events_url":"https://api.github.com/users/lock%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/lock%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-12-27T10:09:15Z","updated_at":"2018-12-27T10:09:15Z","author_association":"NONE","body":"This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.\n"}}
{"actor":{"display_login":"lock"}}