Skip to content

fix(docs): use rimraf for cross-platform clean script - #79

Open
dsorajisto wants to merge 1 commit into
salesforce:mainfrom
dsorajisto:fix-docs-clean-windows-compat
Open

fix(docs): use rimraf for cross-platform clean script#79
dsorajisto wants to merge 1 commit into
salesforce:mainfrom
dsorajisto:fix-docs-clean-windows-compat

Conversation

@dsorajisto

@dsorajisto dsorajisto commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

What

Swaps the clean script in apps/docs/package.json from rm -rf to rimraf for cross-platform compatibility. Adds rimraf as a devDependency.

Why

The current script:

"clean": "rm -rf build .docusaurus"

fails on Windows Command Prompt because rm doesn't exist there. Windows contributors running pnpm --filter @agentscript/docs clean get 'rm' is not recognized as an internal or external command.

rimraf is the JS ecosystem standard for cross-platform recursive delete and accepts the same positional path arguments, so the invocation surface is unchanged for macOS/Linux users.

How

  • apps/docs/package.json:
    • "clean": "rm -rf build .docusaurus""clean": "rimraf build .docusaurus"
    • Add "rimraf": "^6.1.3" to devDependencies (alphabetically ordered)
  • pnpm-lock.yaml: regenerated by pnpm install — 38 line additions covering rimraf and its transitive deps (glob, minimatch, etc.). No other packages affected.

Test Plan

Verified locally on macOS (arm64):

mkdir -p apps/docs/build/foo apps/docs/.docusaurus/bar
touch apps/docs/build/foo/x.txt apps/docs/.docusaurus/bar/y.txt
pnpm --filter @agentscript/docs clean
ls apps/docs/build       # → No such file or directory
ls apps/docs/.docusaurus # → No such file or directory

Both target directories were deleted as expected. The behavior on Windows should be equivalent since rimraf is designed for that.

  • pnpm --filter @agentscript/docs clean works on macOS (removes both dirs)
  • pnpm install regenerates lockfile cleanly
  • Verified on Windows — I don't have a Windows environment; happy for a Windows reviewer to sanity-check

Related

Loosely related to #67 (Windows docs build failures). Does not claim to fully fix #67 — the reporter's original error was about docusaurus not being recognized, which is a different failure mode — but this removes one concrete Windows-hostile bit from the docs package.

Checklist

  • My code follows the project's coding style
  • I have reviewed my own diff
  • I have added/updated documentation as needed
  • This change does not introduce new warnings

The docs package's clean script used `rm -rf` which doesn't
exist on Windows Command Prompt, so `pnpm --filter
@agentscript/docs clean` failed for Windows contributors.

Swaps `rm -rf` for `rimraf` (the JS ecosystem standard for
cross-platform recursive delete) and adds it as a devDependency.
The invocation surface is identical (rimraf accepts the same
positional path arguments as rm -rf).

Verified locally on macOS: `pnpm --filter @agentscript/docs clean`
deletes both `build/` and `.docusaurus/` as expected.

Loosely related to salesforce#67 (Windows docs build failures). Does not
claim to fully fix salesforce#67 since the reporter's original error was
about `docusaurus` not being recognized, not about the clean
script — but this is one concrete Windows-hostile bit in the
same package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant