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

chore: specify pnpm version in package json #1676

Merged
merged 2 commits into from
Aug 4, 2023
Merged

chore: specify pnpm version in package json #1676

merged 2 commits into from
Aug 4, 2023

Conversation

bartektelec
Copy link
Contributor

@bartektelec bartektelec commented Jul 30, 2023

specifies the pnpm version to use when contributing
enables contributors to easily switch to the correct version using corepack

update:
looks like the codesandbox demo runs of pnpm@7.26.3, do we want to lock the pnpm version to the major? pnpm@^7.0.0

@kettanaito
Copy link
Member

@bartektelec, we need to lock PNPM version to the one used on the CI to make sure builds are passing (lock mismatches due to PNPM version mismatches throw):

- uses: pnpm/action-setup@v2
with:
version: 7.12

If the sandbox is using an older/newer version, it likely has to be pinned to but we don't have to solve it. The need to have a stable version is to:

  • Make sure it's signaled for new contributors cloning the project locally;
  • Make sure new contributors don't commit the lockfile generated on a different PNPM version, breaking the build.

CONTRIBUTING.md Outdated Show resolved Hide resolved
Copy link
Member

@kettanaito kettanaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this! I left a few suggestions on how to make a new contributing experience a bit more streamlined in regards to the correct PNPM version. Let me know what you think.

Copy link
Member

@kettanaito kettanaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fantastic! Thank you for improving the experience, @bartektelec! 👏

@kettanaito
Copy link
Member

Welcome to contributors! 🎉

@kettanaito kettanaito merged commit c0cec11 into mswjs:main Aug 4, 2023
9 checks passed
@kettanaito
Copy link
Member

Released: v1.2.4 🎉

This has been released in v1.2.4!

Make sure to always update to the latest version (npm i msw@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

@auskast
Copy link

auskast commented Aug 25, 2023

Specifying the pnpm version in the engines field causes consumers of the package not running the specified pnpm version to not be able to install the library. The packageManager field should be sufficient for development purposes.

Error message:

 ERR_PNPM_UNSUPPORTED_ENGINE  Unsupported environment (bad pnpm and/or Node.js version)

This error happened while installing a direct dependency of /tmp/renovate/repos/<redacted>

Your pnpm version is incompatible with "registry.npmjs.org/msw/1.2.4".

Expected version: ~7.12
Got: 8.6.12

This is happening because the package's manifest has an engines.pnpm field specified.
To fix this issue, install the required pnpm version globally.

To install the latest version of pnpm, run "pnpm i -g pnpm".
To check your pnpm version, run "pnpm -v".

@kettanaito
Copy link
Member

Thanks for reporting this, @auskast. I've addressed this issue in #1713. The fix will be automatically released in the upcoming days.

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.

3 participants