Repository navigation
Fix pnpm strict minimumReleaseAge, Windows compatibility, and Yarn edges - #98
Merged
Merged
Conversation
Member
|
Thanks. Released in 1.3.4. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix pnpm minimumReleaseAge across versions, Windows pnpm spawning, and Yarn edge cases
Thanks for the quick fix for #97 (24c624a). While testing it on Windows and against newer pnpm releases, I ran into a few follow-ups. Currently update-db doesn't run on windows. This should resolve that.
Sorry it took so long. I had to get some approvals and reviews done within my company to approve me pushing this change.
Background
pnpm 11 enabled
minimumReleaseAgeby default, and strict mode rejectspnpm up --no-save. 24c624a handles that by catchingERR_PNPM_STRICT_MIN_RELEASE_AGE_REQUIRES_SAVEand falling back to temporary overrides pinned to the newest policy-compliant versions.pnpm has changed again since then:
up --no-savenow resolves mature versions natively and succeeds, so the fallback is never reached. The existing "respects strict pnpm minimumReleaseAge" test assumed the 12.0–12.4.1 behavior and fails on 12.4.2+.Changes
pnpmis a.cmdshim, whichexecFileSynccan't launch without a shell (spawnSync pnpm ENOENT, as reported on 1.3.3). A smallrunPnpmhelper uses a shell onwin32with argument quoting, and refuses args containing%or!sincecmd.exeexpands them even inside quotes. Missing-binary detection also recognizes cmd.exe's "is not recognized" message.Tests
minimumReleaseAgetest: it now asserts whichever path the installed pnpm takes. On 12.0.0–12.4.1 the fallback runs, with the same assertions as before. On other versions pnpm updates natively, so the test checks that the fallback did not run,package.jsonis untouched, and the lockfile moved off the old version. It doesn't assert the exact resolved version, since that depends on whether the registry serves per-version publish times (pnpm#13741).2>/dev/nullprobes are replaced with anisInstalled()helper usingstdio: 'ignore'. On Windows,cmd.exechoked on the redirect and made installed tools look missing.checkYarnLockfilenormalizes CRLF, since Yarn Berry writes native line endings on Windows..cmdshim andpath.delimiteron Windows, so it runs on both platforms.Notes
Windows CI Tests
I added Windows jobs so the shell/quoting test path is exercised. These can be left out of the PR if you don't want windows CI jobs. I have run them through GitHub actions and they did pass on my GitHub fork.
