Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn upgrade-interactive on a git url dep turns it into a regular registry package #2922

Closed
magicmark opened this issue Mar 14, 2017 · 4 comments

Comments

@magicmark
Copy link
Contributor

magicmark commented Mar 14, 2017

Do you want to request a feature or report a bug?
Bug.

What is the current behavior?
yarn upgrade-interactive in a repo on a git+ssh:// url as a dependency turns the git+ssh url into a regular registry.yarnpkg.com package instead of the git url.

tl;dr:
A deps B.
Initially, A's yarn.lock file looks like this:

"B@git+ssh://git@github.com/magicmark/B.git#v1.0.0":
  version "1.0.0"
  resolved "git+ssh://git@github.com/magicmark/B.git#8b2a343f1ef4ad1a29a01d4680d955b0b9ed0aa5"

After doing $ yarn upgrade-interactive, and trying to upgrade to 1.0.1, the lockfile looks like this:

B@^0.0.1:
  version "0.0.1"
  resolved "https://registry.yarnpkg.com/B/-/B-0.0.1.tgz#6585073338a033249060fde993d9815a909443bb"

If the current behavior is a bug, please provide the steps to reproduce.

  • Clone https://github.com/magicmark/A
  • Do a $ yarn install
  • Check yarn.lock file to see the correct git url
  • Do $ yarn upgrade-interactive and upgrade B
  • Check yarn.lock file and see that the resolved package is a different package.

What is the expected behavior?

  • The package that yarn upgrades B to should be the new upstream version from the git url, not the yarn registry.

Please mention your node.js, yarn and operating system version.

$ yarn --version
0.23.0-20170314.1919

$ node -v
v6.2.1

OS X 10.11.6

@gkinsman
Copy link

gkinsman commented Apr 2, 2017

There is an unfortunate conflict between "text": "github:requirejs/text#latest", and the text npm package that makes this issue a bit worse - I've run into it using Aurelia but I'd guess it could happen to anyone.

It happens with yarn upgrade as well as upgrade-interactive.

@juanca
Copy link
Contributor

juanca commented Apr 4, 2017

yarn upgrade should be deferring to package.json for source. I'm not sure how upgrade-interactive works but I hope it uses yarn upgrade under the hood.

@arcanis
Copy link
Member

arcanis commented Apr 19, 2017

Yeah, it seems that upgrade-interactive is currently only using the displayed version for informational purposes. It internally runs yarn add <package-name>, which automatically bumps the version to the latest available in the registry (which of course doesn't work for exotic packages, such as git or file:).

@BYK
Copy link
Member

BYK commented Oct 30, 2017

Looks like this is fixed in a recent version of Yarn so closing.

@BYK BYK closed this as completed Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants