feat: add explicit cypress install step after dependency install#1799
Open
mschile wants to merge 1 commit into
Open
feat: add explicit cypress install step after dependency install#1799mschile wants to merge 1 commit into
mschile wants to merge 1 commit into
Conversation
Package managers may no longer run a dependency's postinstall script by default (pnpm and Yarn Berry already block them, npm 12 will via RFC #868). Cypress downloads its binary via postinstall, so on a cold cache the binary was not downloaded and `cypress verify` failed. Run a package-manager-aware `cypress install` after dependencies are installed (npx/yarn/pnpm), keeping the binary available regardless of package manager. The step is a no-op when the binary is already present and is skipped when CYPRESS_INSTALL_BINARY=0. Closes #1798 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Adds an explicit, package-manager-aware
cypress installstep that runs after dependency install inindex.js.npm→npx cypress installyarn→yarn cypress installpnpm→pnpm cypress installThe package manager is detected by lockfile (the same detection already used for dependency install). The step runs on every install path (including a custom
install-command), is skipped wheninstall: false, and respectsCYPRESS_INSTALL_BINARY=0.Why
Package managers may no longer run a dependency's
postinstallscript by default — pnpm and Yarn Berry (≥4.14) already block them, and npm 12 will via RFC #868. Cypress downloads its binary via apostinstallscript, so:~/.cache/Cypress, unaffected.cypress verifyfailed.Running
cypress installexplicitly keeps the binary available on a cold cache regardless of package manager. It's a no-op when the binary is already present, so it's safe to run unconditionally.Notes for reviewers
installMaybe()betweeninstall()andlistCypressBinaries().core.exportVariable('CYPRESS_CACHE_FOLDER', ...)is needed in the new function —install()always runs immediately before it and already exports it for the process.dist/index.jsrebuilt via the pre-commit hook (ncc build).Closes #1798
References
🤖 Generated with Claude Code
Note
Low Risk
CI install-path change only; respects existing skip flags and is a no-op when the binary is already present.
Overview
Adds
installCypressBinary(), which runs an explicit package-manager-awarecypress installafter dependency install so the Cypress binary is downloaded whenpostinstallis skipped (pnpm, Yarn Berry, upcoming npm behavior). It uses the same lockfile detection as install: yarn →yarn cypress install, pnpm →pnpm cypress install, otherwise npx →npx cypress install. It no-ops whenCYPRESS_INSTALL_BINARY=0.installMaybe()now calls this step betweeninstall()andlistCypressBinaries(); verify/cache behavior is unchanged.dist/index.jsis rebuilt to matchindex.js.Reviewed by Cursor Bugbot for commit bd9852b. Bugbot is set up for automated code reviews on this repo. Configure here.