File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,6 +67,22 @@ cache_root="${XDG_CACHE_HOME:-$original_home/.cache}"
6767pr_home=" ${VP_PKG_PR_NEW_HOME:- $cache_root / vite-plus/ pkg-pr-new/ $pr_ref } "
6868installer_home=" $( mktemp -d " ${TMPDIR:-/ tmp} /vite-plus-pr-installer.XXXXXX" ) "
6969
70+ # Numeric pkg.pr.new references are mutable PR aliases. The installer reuses a
71+ # version directory named after the reference, so its lockfile can retain the
72+ # checksum from an older publish of the same PR and fail with
73+ # ERR_PNPM_TARBALL_INTEGRITY after the alias is refreshed. Keep the downloaded
74+ # runtime/package-manager cache, but force the wrapper dependency to resolve
75+ # and install again for every PR-alias run. Commit SHA references are immutable
76+ # and can safely retain their installed dependency state.
77+ case " $pr_ref " in
78+ * [!0-9]* ) ;;
79+ * )
80+ cached_version_dir=" $pr_home /pkg-pr-new-$pr_ref "
81+ rm -rf " $cached_version_dir /node_modules"
82+ rm -f " $cached_version_dir /pnpm-lock.yaml"
83+ ;;
84+ esac
85+
7086cleanup () {
7187 rm -rf " $installer_home "
7288}
You can’t perform that action at this time.
0 commit comments