Skip to content

fix(core): use rimraf instead of rm -rf in build script for Windows support#3297

Draft
nynexman4464 wants to merge 1 commit into
mainfrom
navi/fix/core-build-cross-platform-rm
Draft

fix(core): use rimraf instead of rm -rf in build script for Windows support#3297
nynexman4464 wants to merge 1 commit into
mainfrom
navi/fix/core-build-cross-platform-rm

Conversation

@nynexman4464

Copy link
Copy Markdown
Contributor

What

Replace rm -rf dist with rimraf dist in packages/core's build script, and add rimraf as a devDependency.

Why

The build script in @astryxdesign/core currently starts with rm -rf dist, which fails on Windows cmd/PowerShell:

> @astryxdesign/core@0.1.1 build C:\Users\alex-\dev\astryx\packages\core
> rm -rf dist && pnpm build:esm && tsc --project tsconfig.build.json && pnpm build:css && pnpm build:umd

'rm' is not recognized as an internal or external command,
operable program or batch file.
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @astryxdesign/core@0.1.1 build

This is the only rm -rf in any package script across the entire repo, so it's a one-line fix:

$ rg -nE 'rm -rf' --type=json packages apps
packages/core/package.json:625:    "build": "rm -rf dist && pnpm build:esm && ..."

How

  • packages/core/package.json:
    • rm -rf distrimraf dist
    • Add "rimraf": "^6.0.1" to devDependencies

Testing

  • pnpm -F @astryxdesign/core build on macOS still produces the same dist/ output (verified locally).
  • Windows path would now invoke the rimraf JS binary instead of relying on a POSIX rm.

Notes

rimraf is the npm-ecosystem standard for cross-platform recursive delete (~50KB, no runtime deps relevant to the build). Alternatives considered:

  • Inline node -e "require('fs').rmSync(...)" — works but ugly, and quote-escaping varies across cmd.exe/PowerShell/sh.
  • Move the clean into the existing JS build scripts (scripts/build-css.mjs etc.) — bigger surface area for a small problem.

🧭 Drafted with Navi — session

…upport

The `build` script in @astryxdesign/core started with `rm -rf dist`, which
fails on Windows cmd/PowerShell with:

    'rm' is not recognized as an internal or external command

Switch to `rimraf` (added as a devDependency) so the build is portable
across macOS, Linux, and Windows. This is the only `rm -rf` in any
package script in the repo.
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Error Error Jun 30, 2026 11:34pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

1 participant