refactor: drop shelljs - #1206
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe change replaces shelljs filesystem operations with Node ChangesFilesystem operation migration
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Checkov (3.3.8)package.jsonTraceback (most recent call last): 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1206 +/- ##
==========================================
- Coverage 58.78% 53.96% -4.83%
==========================================
Files 4 4
Lines 296 265 -31
Branches 64 62 -2
==========================================
- Hits 174 143 -31
- Misses 119 122 +3
+ Partials 3 0 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/git-utils.ts (1)
37-39: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winRun excluded-asset removals concurrently.
The loop waits for each deletion before starting the next one, unnecessarily increasing cleanup time when a pattern matches many paths. The test helper already uses
Promise.allfor equivalent removals. (nodejs.org)Suggested change
- for (const file of files) { - await fs.promises.rm(file, {force: true, recursive: true}); - } + await Promise.all( + files.map(file => fs.promises.rm(file, {force: true, recursive: true})) + );🤖 Prompt for 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. In `@src/git-utils.ts` around lines 37 - 39, Update the excluded-asset removal loop to start all fs.promises.rm operations concurrently and await their completion with Promise.all, preserving force and recursive options for every file.
🤖 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.
Nitpick comments:
In `@src/git-utils.ts`:
- Around line 37-39: Update the excluded-asset removal loop to start all
fs.promises.rm operations concurrently and await their completion with
Promise.all, preserving force and recursive options for every file.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c992474e-0f15-4bfb-9469-1eaea6357597
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (3)
__tests__/git-utils.test.tspackage.jsonsrc/git-utils.ts
https://nodejs.org/api/fs.html#fspromisescpsrc-dest-options
https://nodejs.org/api/fs.html#fspromisesrmpath-options
We already target Node.js 24 runtime so shouldn't be a problem here. |


Replace
shelljsrm & cp w/ Node.js built-infs#cpandfs#rmAPI.All tests passed on my machine locally.
Summary by CodeRabbit