Repository navigation
fix(init): give pnpm/action-setup a version in the deploy workflow - #1068
Open
morinokami wants to merge 1 commit into
Open
morinokami wants to merge 1 commit into
morinokami wants to merge 1 commit into
Conversation
The workflow that `void init --github` writes for a pnpm project ran `pnpm/action-setup@v5` without a version. The action stops there when package.json declares none, and init writes none for a new Vite+ project, so the workflow failed before it installed anything. The step now uses `pnpm/action-setup@v6` and sets `version` when package.json declares no pnpm version: the major of the pnpm that installed the project, read from node_modules/.modules.yaml, or `latest` before an install. pnpm 11 and later refuse a locked package published within the last day, which pnpm 10 locks, so the major has to match the pnpm that wrote the lockfile. A project that declares a version keeps the bare step, because the action rejects a `version` input that differs from `packageManager`. The wizard writes the workflow before its install, so it sets the version after the install, and only in a workflow that it has just created. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This branch has not been deployed
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.
The workflow that
void init --githubwrites for a pnpm project sets up pnpm with a bare- uses: pnpm/action-setup@v5. The action takes the version from itsversioninput or frompackageManagerinpackage.json, and stops with "No pnpm version is specified" when it has neither. A new Vite+ project fromvoid inithas neither: 328c186 (#406) removed thepackageManagerpin that #93 had added for this workflow, and left the workflow as it was. Its deploy workflow therefore stops at the second step.Fix
The step is now
pnpm/action-setup@v6, and it gets aversionwhenpackage.jsondeclares no pnpm version:node_modules/.modules.yaml, orlatestbefore an install. The major matters: pnpm 11 and later refuse a locked package published within the last day, and pnpm 10 locks such packages. A lockfile that pnpm 10.28.0 wrote for a new starter failedpnpm install --frozen-lockfileunder 11.29.0 and 12.26.0 withERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION, for the 2 of its 464 packages that were under a day old.versionwhenpackage.jsonhaspackageManager: "pnpm@…", or adevEngines.packageManagerwith aversion. The action reads both, and rejects aversioninput that differs frompackageManager.package.jsonstill gets no pnpm version, so #406 stays fixed. The deployment guide says where the version comes from and when to change it, and the pull request preview example in the Cloudflare guide uses v6.Tests
packages/void/test/unit/init.test.tshas 9 new cases: the version from both formats of.modules.yamland without one, noversionfor each declaration inpackage.json, the array form ofdevEngines.packageManager(which the action does not read), the wizard's update after its install, and an existing workflow that stays as it is. 8 fail withmain'sinit.ts; the last one fails without the check that the wizard created the workflow.Verification
vpr test:all: builds the packages and playgrounds, runsvp checkandcheck:types, and runs the platform, unit and integration groups; 271/271 tasks pass.void init --githubfrom this branch writesversion: latestbefore an install,version: 12after an install with pnpm 12.26.0,version: 10after one with pnpm 10.28.0, and noversiononcepackageManageris set.pnpm/action-setup(v5 atfc06bc1, v6.1.1).🤖 Generated with Claude Code