presets(vercel): hard link custom function dirs instead of copying#4373
presets(vercel): hard link custom function dirs instead of copying#4373RihanArfan wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughA new ChangesHard-link based Vercel function directory creation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
commit: |
| * | ||
| * Entries listed in `skip` are ignored at the top level only. | ||
| */ | ||
| export async function hardLinkDir(src: string, dest: string, options: { skip?: Set<string> } = {}) { |
There was a problem hiding this comment.
Have you tried fs.cp (https://nodejs.org/api/fs.html#fspromisescpsrc-dest-options) with COPYFILE_FICLONE flag? (https://nodejs.org/api/fs.html#fspromisescopyfilesrc-dest-mode) (it should have same CoW effect but hopefully faster since we don't do recursion ourselve.)
❓ Type of change
📚 Description
Instead of copying __server.func when there is modifications to .vc-config.json, we now hard link all files to it. We cannot symlink within a functions dir to another since on Vercel the builder cannot resolve the files, which is why we recursively hard link.
📝 Checklist