perf(build): use node:fs for cache checks - #7107
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughUpdated cache filesystem utilities to use Node Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This switches from globby/cpy/etc to using the built-in `node:fs` functions. We can use `fs.cp` to recursively copy, and `fs.readdir` to recursively read, so we no longer need dependencies to do this.
4f9542e to
cb1499f
Compare
e18e dependency analysisNo dependency warnings found. |
@netlify/build
@netlify/build-info
@netlify/cache-utils
@netlify/config
@netlify/edge-bundler
@netlify/functions-utils
@netlify/git-utils
@netlify/headers-parser
@netlify/api
@netlify/nock-udp
@netlify/opentelemetry-sdk-setup
@netlify/opentelemetry-utils
@netlify/redirect-parser
@netlify/run-utils
@netlify/zip-it-and-ship-it
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cache-utils/src/fs.ts`:
- Around line 19-29: Update the cache copy implementation around the fs.cp call
so junk files are excluded without preventing traversal of directories or their
non-junk descendants. Remove the current filter-based behavior and pre-filter
entries or use a custom recursive walk, preserving recursive copying and the
existing destination options.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: cbada2e8-1dd3-4816-848a-e549e4862d64
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
packages/cache-utils/package.jsonpackages/cache-utils/src/fs.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
netlify/blueprints(manual)
💤 Files with no reviewable changes (1)
- packages/cache-utils/package.json
This switches from globby/cpy/etc to using the built-in
node:fsfunctions.We can use
fs.cpto recursively copy, andfs.readdirto recursively read, so we no longer need dependencies to do this.For us to review and ship your PR efficiently, please perform the following steps:
we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or
something that`s on fire 🔥 (e.g. incident related), you can skip this step.
your code follows our style guide and passes our tests.
A picture of a cute animal (not mandatory, but encouraged)