{"action":"created","issue":{"url":"https://api.github.com/repos/yarnpkg/yarn/issues/3603","repository_url":"https://api.github.com/repos/yarnpkg/yarn","labels_url":"https://api.github.com/repos/yarnpkg/yarn/issues/3603/labels{/name}","comments_url":"https://api.github.com/repos/yarnpkg/yarn/issues/3603/comments","events_url":"https://api.github.com/repos/yarnpkg/yarn/issues/3603/events","html_url":"https://github.com/yarnpkg/yarn/issues/3603","id":234295223,"number":3603,"title":"(discussion) upgrade vs upgrade [package] version inconsistency","user":{"login":"rally25rs","id":38535,"avatar_url":"https://avatars0.githubusercontent.com/u/38535?v=3","gravatar_id":"","url":"https://api.github.com/users/rally25rs","html_url":"https://github.com/rally25rs","followers_url":"https://api.github.com/users/rally25rs/followers","following_url":"https://api.github.com/users/rally25rs/following{/other_user}","gists_url":"https://api.github.com/users/rally25rs/gists{/gist_id}","starred_url":"https://api.github.com/users/rally25rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rally25rs/subscriptions","organizations_url":"https://api.github.com/users/rally25rs/orgs","repos_url":"https://api.github.com/users/rally25rs/repos","events_url":"https://api.github.com/users/rally25rs/events{/privacy}","received_events_url":"https://api.github.com/users/rally25rs/received_events","type":"User","site_admin":false},"labels":[{"id":446320944,"url":"https://api.github.com/repos/yarnpkg/yarn/labels/cat-discussion","name":"cat-discussion","color":"c2e0c6","default":false},{"id":313603439,"url":"https://api.github.com/repos/yarnpkg/yarn/labels/cat-feature","name":"cat-feature","color":"84b6eb","default":false},{"id":594046112,"url":"https://api.github.com/repos/yarnpkg/yarn/labels/triaged","name":"triaged","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":{"login":"cpojer","id":13352,"avatar_url":"https://avatars3.githubusercontent.com/u/13352?v=3","gravatar_id":"","url":"https://api.github.com/users/cpojer","html_url":"https://github.com/cpojer","followers_url":"https://api.github.com/users/cpojer/followers","following_url":"https://api.github.com/users/cpojer/following{/other_user}","gists_url":"https://api.github.com/users/cpojer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpojer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpojer/subscriptions","organizations_url":"https://api.github.com/users/cpojer/orgs","repos_url":"https://api.github.com/users/cpojer/repos","events_url":"https://api.github.com/users/cpojer/events{/privacy}","received_events_url":"https://api.github.com/users/cpojer/received_events","type":"User","site_admin":false},"assignees":[{"login":"cpojer","id":13352,"avatar_url":"https://avatars3.githubusercontent.com/u/13352?v=3","gravatar_id":"","url":"https://api.github.com/users/cpojer","html_url":"https://github.com/cpojer","followers_url":"https://api.github.com/users/cpojer/followers","following_url":"https://api.github.com/users/cpojer/following{/other_user}","gists_url":"https://api.github.com/users/cpojer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpojer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpojer/subscriptions","organizations_url":"https://api.github.com/users/cpojer/orgs","repos_url":"https://api.github.com/users/cpojer/repos","events_url":"https://api.github.com/users/cpojer/events{/privacy}","received_events_url":"https://api.github.com/users/cpojer/received_events","type":"User","site_admin":false},{"login":"rally25rs","id":38535,"avatar_url":"https://avatars0.githubusercontent.com/u/38535?v=3","gravatar_id":"","url":"https://api.github.com/users/rally25rs","html_url":"https://github.com/rally25rs","followers_url":"https://api.github.com/users/rally25rs/followers","following_url":"https://api.github.com/users/rally25rs/following{/other_user}","gists_url":"https://api.github.com/users/rally25rs/gists{/gist_id}","starred_url":"https://api.github.com/users/rally25rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rally25rs/subscriptions","organizations_url":"https://api.github.com/users/rally25rs/orgs","repos_url":"https://api.github.com/users/rally25rs/repos","events_url":"https://api.github.com/users/rally25rs/events{/privacy}","received_events_url":"https://api.github.com/users/rally25rs/received_events","type":"User","site_admin":false},{"login":"arcanis","id":1037931,"avatar_url":"https://avatars1.githubusercontent.com/u/1037931?v=3","gravatar_id":"","url":"https://api.github.com/users/arcanis","html_url":"https://github.com/arcanis","followers_url":"https://api.github.com/users/arcanis/followers","following_url":"https://api.github.com/users/arcanis/following{/other_user}","gists_url":"https://api.github.com/users/arcanis/gists{/gist_id}","starred_url":"https://api.github.com/users/arcanis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arcanis/subscriptions","organizations_url":"https://api.github.com/users/arcanis/orgs","repos_url":"https://api.github.com/users/arcanis/repos","events_url":"https://api.github.com/users/arcanis/events{/privacy}","received_events_url":"https://api.github.com/users/arcanis/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2017-06-07T18:06:04Z","updated_at":"2017-06-21T00:18:03Z","closed_at":null,"body":"_this is a discussion issue spawned from #3510_\r\n\r\n## Existing Behavior\r\n\r\nCurrently (yarn 0.24 & 0.25) the `upgrade` command has this behavior:\r\n\r\nGiven a package.json\r\n\r\n```\r\n\"dependencies\": {\r\n    \"left-pad\": \"<=1.1.1\"\r\n}\r\n```\r\n\r\nAnd the `left-pad` package has these versions defined in the registry:\r\n\r\n```\r\n0.0.9\r\n1.0.0\r\n1.1.0\r\n1.1.1\r\n1.1.2\r\n1.1.3\r\n2.0.0\r\n```\r\n\r\n> yarn upgrade\r\nUpgrades to 1.1.1 because it matches the package.json semver range (<=1.1.1)\r\n\r\n> yarn upgrade left-pad\r\nUpgrades to 2.0.0 because a package was passed with no explicit version\r\n\r\n> yarn upgrade left-pad@~1.1.2\r\nUpgrades to 1.1.3 because it is the latest match for the passed in semver range (~1.1.2)\r\n\r\nThis actually follows correctly with how [the documentation for upgrade](https://yarnpkg.com/en/docs/cli/upgrade) is currently written:\r\n\r\n> yarn upgrade\r\n>\r\n> This command updates all dependencies to their latest version based on the version range specified in the package.json file.\r\n>\r\n> yarn upgrade [package]\r\n>\r\n> This upgrades a single named package to the version specified by the latest tag (potentially upgrading the package across major versions).\r\n>\r\n> yarn upgrade [package@version]\r\n>\r\n> This will upgrade (or downgrade) an installed package to the specified version. You can use any SemVer version number or range.\r\n\r\nThe current behavior happens because underneath `upgrade` it hands the parameters off to the `add` command, so it basically is the same as `yarn add left-pad`.\r\nThe `add` command treats the absence of an explicit version range as \"use `latest`\"\r\n\r\n## Up For Discussion\r\n\r\nShould we make a breaking change to `yarn upgrade [package]` and split it into the following cases:\r\n\r\n* Leave upgrade with no additional parameters how it is:\r\n> yarn upgrade\r\n>\r\n> This command updates all dependencies to their latest version based on the version range specified in the package.json file.\r\n\r\n* Change passing a package without an explicit version to respect package.json\r\n> yarn upgrade [package]\r\n>\r\n> This upgrades a single named package to the latest version based on the version range specified in the package.json file.\r\n\r\n* Leave handling an explicit version the same as how it is\r\n> yarn upgrade [package@version]\r\n>\r\n> This will upgrade (or downgrade) an installed package to the specified version. You can use any SemVer version number or range.\r\n\r\n* Utilize the --latest flag from PR #3510 for an upgrade without a specific package, and add it to the docs\r\n> yarn upgrade --latest\r\n>\r\n> This command updates all dependencies to the version specified by the latest tag (potentially upgrading the package across major versions).\r\n\r\n* Utilize the --latest flag from PR #3510 for an upgrade with a specific package, and add it to the docs\r\n> yarn upgrade [package] --latest\r\n>\r\n> This upgrades a single named package to the version specified by the latest tag (potentially upgrading the package across major versions).\r\n"},"comment":{"url":"https://api.github.com/repos/yarnpkg/yarn/issues/comments/309927201","html_url":"https://github.com/yarnpkg/yarn/issues/3603#issuecomment-309927201","issue_url":"https://api.github.com/repos/yarnpkg/yarn/issues/3603","id":309927201,"user":{"login":"bestander","id":2121048,"avatar_url":"https://avatars0.githubusercontent.com/u/2121048?v=3","gravatar_id":"","url":"https://api.github.com/users/bestander","html_url":"https://github.com/bestander","followers_url":"https://api.github.com/users/bestander/followers","following_url":"https://api.github.com/users/bestander/following{/other_user}","gists_url":"https://api.github.com/users/bestander/gists{/gist_id}","starred_url":"https://api.github.com/users/bestander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bestander/subscriptions","organizations_url":"https://api.github.com/users/bestander/orgs","repos_url":"https://api.github.com/users/bestander/repos","events_url":"https://api.github.com/users/bestander/events{/privacy}","received_events_url":"https://api.github.com/users/bestander/received_events","type":"User","site_admin":false},"created_at":"2017-06-21T00:18:03Z","updated_at":"2017-06-21T00:18:03Z","body":"@rally25rs what would be your next step?\r\nDo you want to copy your issue into an RFC and send a PR as a followup?\r\n\r\nI think all the points above make sense, would be great to get the commands consistent."}}
{"actor":{"display_login":"bestander"}}