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

feat: update version when pinnedVersion is * #5720

Merged
merged 3 commits into from Nov 30, 2022

Conversation

HomyeeKing
Copy link
Contributor

close #5681

@zkochan
Copy link
Member

zkochan commented Nov 30, 2022

add a changeset

@zkochan zkochan merged commit c245edf into pnpm:main Nov 30, 2022
@HomyeeKing HomyeeKing deleted the fix/wildcard branch December 1, 2022 02:29
@zkochan zkochan added this to the v7.18 milestone Dec 3, 2022
@folknor
Copy link

folknor commented Dec 28, 2022

Did this change cause pnpm (EDIT: when I run pnpm up in the project folder, that is) to change my dependencies in package.json from for example:

  85   │     "devDependencies": {
  86   │         "@fortawesome/fontawesome-free": "latest",
  87   │         "@parcel/config-default": "nightly",
  88   │         "@parcel/core": "nightly",
  89   │         "@parcel/optimizer-cssnano": "nightly",
  90   │         "@parcel/optimizer-htmlnano": "nightly",
  91   │         "@parcel/optimizer-svgo": "nightly",
  92   │         "@parcel/packager-css": "nightly",
  93   │         "@parcel/packager-html": "nightly",
  94   │         "@parcel/packager-raw-url": "nightly",
  95   │         "@parcel/transformer-css": "nightly",
  96   │         "@parcel/transformer-html": "nightly",
  97   │         "@parcel/transformer-image": "nightly",
  98   │         "@parcel/transformer-js": "nightly",
  99   │         "@parcel/transformer-postcss": "nightly",
 100   │         "@parcel/transformer-posthtml": "nightly",
 101   │         "@parcel/transformer-sass": "nightly",
 102   │         "@parcel/transformer-webmanifest": "nightly",
 103   │         "@popperjs/core": "latest",
 104   │         "animate.css": "latest",
 105   │         "animated-scroll-to": "latest",
 106   │         "autoprefixer": "latest",
 107   │         "blueimp-gallery": "latest",
 108   │         "bootstrap": "latest",
 109   │         "browserslist": "latest",
 110   │         "browserslist-useragent-regexp": "latest",
 111   │         "copyfiles": "latest",
 112   │         "dompurify": "latest",
 113   │         "fabric": "latest",
 114   │         "parcel": "nightly",
 115   │         "postcss": "latest",
 116   │         "postcss-preset-env": "latest",
 117   │         "rimraf": "latest",
 118   │         "sass": "latest",
 119   │         "sharp": "^0.31.2"

to

  85   │     "devDependencies": {
  86   │         "@fortawesome/fontawesome-free": "^6.2.1",
  87   │         "@parcel/config-default": "2.0.0-nightly.1223",
  88   │         "@parcel/core": "2.0.0-nightly.1221",
  89   │         "@parcel/optimizer-cssnano": "2.0.0-nightly.1223",
  90   │         "@parcel/optimizer-htmlnano": "2.0.0-nightly.1223",
  91   │         "@parcel/optimizer-svgo": "2.8.3-nightly.2846",
  92   │         "@parcel/packager-css": "2.0.0-nightly.1223",
  93   │         "@parcel/packager-html": "2.0.0-nightly.1223",
  94   │         "@parcel/packager-raw-url": "2.8.3-nightly.2846",
  95   │         "@parcel/transformer-css": "2.0.0-nightly.1223",
  96   │         "@parcel/transformer-html": "2.0.0-nightly.1223",
  97   │         "@parcel/transformer-image": "2.8.3-nightly.2846",
  98   │         "@parcel/transformer-js": "2.0.0-nightly.1223",
  99   │         "@parcel/transformer-postcss": "2.0.0-nightly.1223",
 100   │         "@parcel/transformer-posthtml": "2.0.0-nightly.1223",
 101   │         "@parcel/transformer-sass": "2.0.0-nightly.1223",
 102   │         "@parcel/transformer-webmanifest": "2.8.3-nightly.2846",
 103   │         "@popperjs/core": "^2.11.6",
 104   │         "animate.css": "^4.1.1",
 105   │         "animated-scroll-to": "^2.3.0",
 106   │         "autoprefixer": "^10.4.13",
 107   │         "blueimp-gallery": "^3.4.0",
 108   │         "bootstrap": "^5.2.3",
 109   │         "browserslist": "^4.21.4",
 110   │         "browserslist-useragent-regexp": "^4.0.0",
 111   │         "copyfiles": "^2.4.1",
 112   │         "dompurify": "^2.4.1",
 113   │         "fabric": "^5.3.0",
 114   │         "parcel": "2.0.0-nightly.1221",
 115   │         "postcss": "^8.4.20",
 116   │         "postcss-preset-env": "^7.8.3",
 117   │         "rimraf": "^3.0.2",
 118   │         "sass": "^1.57.1",
 119   │         "sharp": "^0.31.3"
 120   │     }

And if so, am I correct in that there's no way for me to prevent it?

@HomyeeKing
Copy link
Contributor Author

@folknor
it has nothing to do with this commit, it just handle the none case (such as foo: *),
most of your deps are pinned as major through this function,
https://github.com/pnpm/pnpm/blob/main/packages/which-version-is-pinned/src/index.ts#L3

and it seems no way to avoid upgrading version, since it always updated
https://github.com/pnpm/pnpm/blob/main/pkg-manager/core/src/install/index.ts#L498

@folknor
Copy link

folknor commented Jan 6, 2023

@HomyeeKing This behavior is not present in pnpm v7.17.1, but is present in 7.18, which is the first release with this pull request.

I've read through every other commit between 7.17.1 and 7.18, and the only other one that might be related is f3bfa2a as far as I can see.

@folknor
Copy link

folknor commented Jan 10, 2023

@zkochan 7.24.2 still does this, can you read through my comments here and let me know if I should open a new issue about this? The way I see it (and of course my perspective could be completely wrong 😄 ) this is either (1) a regression, (2) something that should be a config setting, or (3) intended behavior that won't change.

Question is if it was caused by this pull request or not. I don't know. I just know what I wrote previously. I'm not sure how to test 7.18 without this pull locally.

Edit: Thank you 🥳

@HomyeeKing
Copy link
Contributor Author

@folknor sorry, I will check the code this weekend, kind of busy recently 😅

@HomyeeKing
Copy link
Contributor Author

@folknor
Copy link

folknor commented Jan 14, 2023

@folknor https://github.com/pnpm/pnpm/pull/5764/files#diff-d2d9ebb33dc9a2437d69f3c4c77d5e194a34b29dc80bce3a23a3aca0a45c4866L165

Thank you! I disregarded that commit when I looked through the list because I presumed that it would only affect versions that had workspace: in them.

Do you think I should file a ticket or just comment on that PR referrencing the discussion here?

@HomyeeKing
Copy link
Contributor Author

comment on that PR and describe your case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

when semver is wildcard, package.json is not updated with exact version
3 participants