{"action":"closed","issue":{"url":"https://api.github.com/repos/lerna/lerna/issues/1598","repository_url":"https://api.github.com/repos/lerna/lerna","labels_url":"https://api.github.com/repos/lerna/lerna/issues/1598/labels{/name}","comments_url":"https://api.github.com/repos/lerna/lerna/issues/1598/comments","events_url":"https://api.github.com/repos/lerna/lerna/issues/1598/events","html_url":"https://github.com/lerna/lerna/issues/1598","id":353316026,"node_id":"MDU6SXNzdWUzNTMzMTYwMjY=","number":1598,"title":"lerna version prerelease/preminor --no-preid  or --preid=\"\" are not working","user":{"login":"sergiohgz","id":14012309,"node_id":"MDQ6VXNlcjE0MDEyMzA5","avatar_url":"https://avatars3.githubusercontent.com/u/14012309?v=4","gravatar_id":"","url":"https://api.github.com/users/sergiohgz","html_url":"https://github.com/sergiohgz","followers_url":"https://api.github.com/users/sergiohgz/followers","following_url":"https://api.github.com/users/sergiohgz/following{/other_user}","gists_url":"https://api.github.com/users/sergiohgz/gists{/gist_id}","starred_url":"https://api.github.com/users/sergiohgz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergiohgz/subscriptions","organizations_url":"https://api.github.com/users/sergiohgz/orgs","repos_url":"https://api.github.com/users/sergiohgz/repos","events_url":"https://api.github.com/users/sergiohgz/events{/privacy}","received_events_url":"https://api.github.com/users/sergiohgz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-23T10:16:21Z","updated_at":"2018-08-24T01:12:25Z","closed_at":"2018-08-24T01:12:25Z","author_association":"NONE","body":"From a monorepo with stable version (X.Y.Z), when running `lerna version` with `--no-preid` or `--preid=\"\"`, it still uses default preid (`alpha`).\r\n\r\n## Expected Behavior\r\nWith `lerna version prerelease --no-preid` or `lerna version prerelease --preid=\"\"`:\r\n> @sergiohgz/pkg1: 1.0.0 -> 1.0.1-0\r\n> @sergiohgz/pkg2: 1.0.0 -> 1.0.1-0\r\n\r\nWith `lerna version preminor --no-preid` or `lerna version preminor --preid=\"\"`:\r\n> @sergiohgz/pkg1: 1.0.0 -> 1.1.0-0\r\n> @sergiohgz/pkg2: 1.0.0 -> 1.1.0-0\r\n\r\n## Current Behavior\r\nWith `lerna version prerelease --no-preid` or `lerna version prerelease --preid=\"\"`:\r\n> @sergiohgz/pkg1: 1.0.0 -> 1.0.1-alpha.0\r\n> @sergiohgz/pkg2: 1.0.0 -> 1.0.1-alpha.0\r\n\r\nWith `lerna version preminor --no-preid` or `lerna version preminor --preid=\"\"`:\r\n> @sergiohgz/pkg1: 1.0.0 -> 1.1.0-alpha.0\r\n> @sergiohgz/pkg2: 1.0.0 -> 1.1.0-alpha.0\r\n\r\n## Possible Solution\r\nI cannot find where `--no-preid` is accepted as an option (as `--nopreid` is rejected as option by `yargs`), but if that is provided, the default preid should be `undefined` , not `\"alpha\"` string.\r\nThe solution for `--preid=\"\"` is having an extra control of the `preid` option defined at [this line](https://github.com/lerna/lerna/blob/master/commands/version/index.js#L196), because an empty string is a falsy value and continue to next possible option.\r\n\r\n## Steps to Reproduce (for bugs)\r\nNotes: the use of `--force-publish` option is for testing purposes\r\n1. lerna version prerelease --no-preid --force-publish\r\n2. lerna version prerelease --preid=\"\" --force-publish\r\n3. lerna version preminor --no-preid --force-publish\r\n4. lerna version preminor --preid=\"\" --force-publish\r\n\r\n<details><summary>lerna.json</summary><p>\r\n\r\n```json\r\n\"lerna\": \"3.1.4\",\r\n  \"packages\": [\r\n    \"packages/*\"\r\n  ],\r\n  \"version\": \"1.0.0\",\r\n  \"command\": {\r\n    \"version\": {\r\n      \"message\": \"[ci-skip] %s\"\r\n    }\r\n  }\r\n```\r\n</p></details>\r\n\r\n## Context\r\nAccording to [SemVer Specification, paragraph 9](https://semver.org/#spec-item-9), in pre-release versions are a identifier formed by ASCII alphanumeric numbers are mandatory (at least one), but a number itself is a correct identifier, so it is not necessary a keyword like 'alpha'.\r\nIf we recover the possibility to have an empty string as preid (or the `--no-preid` option working), we could have a behaviour like the `npm version` itself.\r\n\r\n## Your Environment\r\n\r\n| Executable | Version |\r\n| ---: | :--- |\r\n| `lerna --version` | 3.1.4 |\r\n| `npm --version`  | 6.4.0 |\r\n| `node --version` | 8.11.0 |\r\n\r\n| OS | Version |\r\n| --- | --- |\r\n| Fedora | 28 |\r\n| Ubuntu | 16.04 |\r\n"}}
{"actor":{"display_login":"evocateur"}}