You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve Node.js caching using package-lock.json (#409)
This PR updates the caching strategy for Node.js dependencies to base the cache key on the contents of `package-lock.json`, rather than the `node` or `node_modules` directories.
### Problem
Currently, caching is ineffective because:
* The cache key relies on `node` and `node_modules` directories.
* These directories are not checked into the repository and therefore don’t exist when the cache is computed.
### Solution
Update the cache key to use the contents of `package-lock.json`, which is a reliable representation of the dependency tree:
* If `package-lock.json` **is not committed**, the cache behavior remains unchanged.
* If it **is committed**, caching will function as expected, restoring and saving dependencies based on lockfile changes.
### Additional Changes
* Commit `package-lock.json` in the `logging-parent` repository to evaluate the effectiveness of this approach.
* Reverts the use of `npm-shrinkwrap.json` introduced in #367.
0 commit comments