-
-
Notifications
You must be signed in to change notification settings - Fork 941
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
.pnpmfile change not triger resolution #6726
Comments
How can we know if the file has changed? We could store the hash of the file in the lockfile. However, the hash won't change if the modification will happen not in |
at least change .pnpmfile.cjs should trigger resolution |
Let me try to understand the point of @tjx666 . The pnpmfile file affects resolution, since it can mutate the dependencies of a package in hooks, so it's reasonable that any modification to it need to trigger an resolution. The best way of it can be store the hash of pnpmfile in the lockfile, and possibly the file path of it, if renaming a pnpmfile, e.g., from pnpmfile.js to pnpmfile.js hit a corner case. |
#4794 |
I realized storing the hash value of pnpmfile.js in the lockfile is a bad idea. Instead, make sure the hooks in the pnpmfile.js are invoked for each dependencies in package.json, before checking a lockfile is up-to-date. |
But doesn't the readPackage hook get called during the resolution step? |
@icy0307 It seems like not for every dependency, according to #4794 (comment). |
@thynson yes, not invoke for every dependency only if resolution get skipped. |
Fixed by #7662 |
pnpm version: 8.6.3
Code to reproduce the issue:
https://stackblitz.com/edit/node-3neeb1?file=.pnpmfile.cjs
.pnpmfile.cjs
Lockfile is up to date, resolution step is skipped
Expected behavior:
change
.pnpmfile.cjs
should always trigger resolutionActual behavior:
as title
Additional information:
node -v
prints: v16.20.0The text was updated successfully, but these errors were encountered: