Skip to content

Remove rimraf dependency, use built-in fs instead#452

Merged
rzhao271 merged 2 commits intomainfrom
copilot/remove-rimraf-dependency
Mar 12, 2026
Merged

Remove rimraf dependency, use built-in fs instead#452
rzhao271 merged 2 commits intomainfrom
copilot/remove-rimraf-dependency

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 12, 2026

scripts/reset.js depended on rimraf (a transitive dep, never declared directly) to delete the dist folder. Replaced with Node.js built-in fs.

Changes

  • scripts/reset.js: replaced async rimraf(dir, cb) with fs.rmSync(dir, { recursive: true, force: true })
  • Used fs.mkdirSync(dir, { recursive: true }) instead of bare mkdirSync for robustness when dir already exists
// Before
const rimraf = require("rimraf");
rimraf(outputDirectory, function () {
  fs.mkdirSync(outputDirectory);
});

// After
fs.rmSync(outputDirectory, { recursive: true, force: true });
fs.mkdirSync(outputDirectory, { recursive: true });

Copilot AI and others added 2 commits March 12, 2026 17:42
Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com>
@rzhao271 rzhao271 marked this pull request as ready for review March 12, 2026 17:47
@rzhao271 rzhao271 enabled auto-merge (squash) March 12, 2026 17:47
@rzhao271 rzhao271 added this to the 1.112.0 milestone Mar 12, 2026
@rzhao271 rzhao271 merged commit e9d02c3 into main Mar 12, 2026
5 checks passed
@rzhao271 rzhao271 deleted the copilot/remove-rimraf-dependency branch March 12, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants