Skip to content

Fix frontend build cleanup on Windows - #252

Open
snowyukitty wants to merge 1 commit into
cloudflare:mainfrom
snowyukitty:fix/windows-frontend-build-clean
Open

Fix frontend build cleanup on Windows#252
snowyukitty wants to merge 1 commit into
cloudflare:mainfrom
snowyukitty:fix/windows-frontend-build-clean

Conversation

@snowyukitty

Copy link
Copy Markdown
Contributor

What does this change?

Fixes #250.

Replace the POSIX-only rm executable in the workshop-frontend Vite+ clean:dist task with Node's built-in recursive filesystem removal. This lets the frontend build, and therefore pnpm lint, run on Windows without changing the task's cleanup behavior.

Why is this obviously correct and trivially verifiable?

fs.rmSync(..., { recursive: true, force: true }) has the two properties this task needs from rm -rf: it removes the complete dist tree and does not fail when the path is absent. Node is already the runtime for every repository task, so the replacement adds no dependency or platform-specific executable. The task remains uncached and remains the build dependency; only its command changes.

Verification on Windows 11 with Node 24.19.0 and pnpm 11.17.0:

  • before: pnpm exec vp run -F @gadgets/workshop-frontend --no-cache build failed with Failed to find executable rm;
  • after: the same command completed both TypeScript checks and the production Vite build;
  • a stale sentinel placed under dist/ before the run was removed;
  • pnpm lint completed successfully (existing warnings only).

AI tools assisted the investigation, patch drafting, and review. The failure and verification results above were reproduced locally.

Checklist

  • This is a small, concrete change; it is not a feature, refactor, or low-value cleanup.
  • I understand that maintainers decide whether the change is obviously correct and trivially verifiable.
  • I have read and followed the contribution guidelines.

@github-actions github-actions Bot added the workshop/frontend Changes to the Workshop frontend label Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

workshop/frontend Changes to the Workshop frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workshop-frontend build cannot run its clean task on Windows

1 participant