refactor(functions-utils): replace dependencies with native APIs - #7148
refactor(functions-utils): replace dependencies with native APIs#714843081j wants to merge 1 commit into
Conversation
This replaces the following in `functions-utils`: - `cpy` with `fs.cp`, still filtering out `junk` - `path-exists` with `fs.access` and, in tests, `existsSync` - `sort-on` with a basic sort function - `tmp-promise` with `fs.mkdtemp` and `randomUUID`
📝 WalkthroughSummary by CodeRabbit
WalkthroughReplaces Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
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 |
e18e dependency analysisNo dependency warnings found. |
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/functions-utils/src/main.ts`:
- Around line 14-28: Ensure the destination directory returned by getDist() is
created before the fs.cp call in the copy flow. Add the directory-creation step
after validating dist and before copying src, while preserving the existing
recursive copy, force, and filter 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: 3191968d-7aa6-4408-87d8-06b91e101428
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (4)
packages/functions-utils/package.jsonpackages/functions-utils/src/main.tspackages/functions-utils/tests/helpers/main.tspackages/functions-utils/tests/main.test.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
netlify/blueprints(manual)
@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: |
This replaces the following in
functions-utils:cpywithfs.cp, still filtering outjunkpath-existswithfs.accessand, in tests,existsSyncsort-onwith a basic sort functiontmp-promisewithfs.mkdtempandrandomUUIDFor 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)