Skip to content

chore: use native node:fs for removal scripts - #26219

Merged
andreiborza merged 1 commit into
getsentry:developfrom
43081j:jg/rimrafless
Nov 10, 2026
Merged

andreiborza merged 1 commit into
getsentry:developfrom
43081j:jg/rimrafless

Conversation

@43081j

@43081j 43081j commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Why: Part of #26187. Barely any of rimraf's functionality is used in this repo, so its just acting as a convenience wrapper to let us call it via CLI. We can achieve the same through a small script.

How to review: Just ensure the scripts are consistent with each other and CI passes.

Unsure about: N/A

@andreiborza it actually turns out the bundler-plugin-integration-tests already use premove in develop 👀

@43081j
43081j requested review from a team as code owners November 9, 2026 16:03
@43081j
43081j requested review from JPeer264, andreiborza, chargome, logaretm, msonnb and nicohrubec and removed request for a team November 9, 2026 16:03

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.


for (const path of globSync(['suites/**/dist', 'loader-suites/**/dist', 'tmp'])) {
rmSync(path, { recursive: true, force: true });
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean scripts fail on Node 20

Medium Severity

The new clean scripts import globSync from node:fs, but that API ships only in Node 22+. This repo still supports Node 20.19 (engines and CI), so pnpm clean and the browser-integration-tests pretest crash there with a missing-export / not-a-function error instead of removing build artifacts.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ee036d8. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • browser-integration-tests are not run against 20.x in CI, they run against 24.22.1 (per whats in package.json)
  • no other CI job currently runs clean

Part of tidying up dependencies, supply chain security, etc.

This replaces `rimraf` (7MB, 9 packages) with an in-house script of a
few lines of `node:fs`.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9b03122. Configure here.

const { globSync, rmSync } = require('fs');

for (const path of globSync(['suites/**/node_modules', 'suites/**/tmp_*'])) {
rmSync(path, { recursive: true, force: true });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean scripts crash on Node 20

Medium Severity

These clean scripts import globSync from node:fs, which was added in Node 22 and is not present on Node 20. node-integration-tests and browser-integration-tests still declare >=20.19.0 in engines, and CI runs the Node integration suite on 20.19. On that version the import fails, so cleanup never runs — including the docker teardown that follows in clean.js.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9b03122. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • browser-integration-tests are not run against 20.x in CI, they run against 24.22.1 (per whats in package.json)
  • no other CI job currently runs clean

@andreiborza andreiborza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for the contribution!

@andreiborza
andreiborza merged commit 312de2e into getsentry:develop Nov 10, 2026
377 checks passed
msonnb added a commit that referenced this pull request Nov 10, 2026
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution. See #26219

Co-authored-by: andreiborza <168741329+andreiborza@users.noreply.github.com>
Co-authored-by: Martin Sonnberger <martin.sonnberger@sentry.io>
nicohrubec added a commit that referenced this pull request Nov 10, 2026
**Why:** Removing rimraf in #26219 left two unused lockfile entries that
pnpm prunes during installation, causing develop's lockfile stability
check to fail. Commit the generated cleanup to restore CI.

Co-authored-by: OpenAI Codex <codex@openai.com>
@43081j
43081j deleted the jg/rimrafless branch November 10, 2026 14:56
andreiborza pushed a commit that referenced this pull request Nov 10, 2026
**Why:** Removing rimraf in #26219 left two unused lockfile entries that
pnpm prunes during installation, causing develop's lockfile stability
check to fail. Commit the generated cleanup to restore CI.

Co-authored-by: OpenAI Codex <codex@openai.com>
andreiborza pushed a commit that referenced this pull request Nov 10, 2026
**Why:** Removing rimraf in #26219 left two unused lockfile entries that
pnpm prunes during installation, causing develop's lockfile stability
check to fail. Commit the generated cleanup to restore CI.

Co-authored-by: OpenAI Codex <codex@openai.com>
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.

2 participants