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

[rush] unexpected version string with pnpm v9? #5047

Open
jeremymeng opened this issue Dec 16, 2024 · 4 comments
Open

[rush] unexpected version string with pnpm v9? #5047

jeremymeng opened this issue Dec 16, 2024 · 4 comments

Comments

@jeremymeng
Copy link
Member

After upgrading to pnpm v9, we found that some version strings look strange. There are two version formats for non-workspace projects in our mono repo under importers/dependencies:

https://github.com/Azure/azure-sdk-for-js/blob/050adc297757b27e2344498a653042f58739d884/common/config/rush/pnpm-lock.yaml#L13-L15
Image

and

https://github.com/Azure/azure-sdk-for-js/blob/050adc297757b27e2344498a653042f58739d884/common/config/rush/pnpm-lock.yaml#L424-L426

Image

while rush update/install etc. are working fine. At least the second version string format is not considered valid by some of our internal tools.

@jeremymeng
Copy link
Member Author

@fzxen any insights?

@fzxen
Copy link
Contributor

fzxen commented Dec 18, 2024

This seems to be the behavior of pnpm. Pnpm will add a suffix related to peerDependencies in the version field.
If you need to parse the version field, you can use @pnpm/dependency-path to remove the suffix

import dp from '@pnpm/dependency-path';

const versionString = "file:projects/abort-controller.tgz([email protected](@types/[email protected])([email protected])([email protected](@types/[email protected]))"
dp.removeSuffix(versionString) // 'file:projects/abort-controller.tgz'

@jeremymeng
Copy link
Member Author

@fzxen is it expected for the version string to only contains this part (no suffix)?

     version: file:projects/arm-iothub-profile-2020-09-01-hybrid.tgz

@fzxen
Copy link
Contributor

fzxen commented Dec 25, 2024

@fzxen is it expected for the version string to only contains this part (no suffix)?

     version: file:projects/arm-iothub-profile-2020-09-01-hybrid.tgz

@jeremymeng Both of these version strings are as expected. The suffix is added when the dependency has peer dependencies.

https://pnpm.io/how-peers-are-resolved

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

No branches or pull requests

2 participants