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: improve pnpm sorting #314

Merged
merged 4 commits into from
Mar 30, 2024
Merged

Conversation

westrik
Copy link
Contributor

@westrik westrik commented Mar 27, 2024

#313 added the ability to deeply sort a pnpm object in package.json. This PR improves pnpm sorting in the following ways:

  • groups similar fields together
  • sorts pnpm.overrides entries with the same package name using semver rather than alphabetically

Example:

Before this change:

"pnpm": {
  "overrides": {
      "@react-stately/selection@~3.10.3": "3.10.3",
      "@react-stately/selection@~3.7.0": "3.7.0"
  }
}

After this change:

"pnpm": {
  "overrides": {
      "@react-stately/selection@~3.7.0": "3.7.0",
      "@react-stately/selection@~3.10.3": "3.10.3"
  }
}

@keithamus
Copy link
Owner

@samsternatretool what do you think?

@samsternatretool
Copy link
Contributor

@keithamus LGTM from me! @westrik is on my team at Retool and he noticed some subtlety when it comes to sorting pnpm overrides after we merged my original change.

@keithamus
Copy link
Owner

Some failing tests in Node 12 because of Array#at. Will need to use an alternative or polyfill.

@westrik
Copy link
Contributor Author

westrik commented Mar 28, 2024

Some failing tests in Node 12 because of Array#at. Will need to use an alternative or polyfill.

updated with alternative

@keithamus keithamus merged commit a55cbb7 into keithamus:main Mar 30, 2024
4 checks passed
Copy link

🎉 This PR is included in version 2.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants