chore: add Windows compatibility for npm scripts (#1170)

<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Make npm scripts work on Windows by replacing rm -rf with rimraf and
using cross-env for environment variables. This enables local dev and
packaging on Windows without WSL.

- **Refactors**
- Changed clean to use rimraf and delete out and scaffold/node_modules.
- Prefixed dev:engine, staging:engine, and staging:gateway with
cross-env.

- **Dependencies**
  - Added rimraf ^6.0.1. Run npm install.

<!-- End of auto-generated description by cubic. -->

Co-authored-by: 顾颢 <guhao@dayee.com>
This commit is contained in:
顾颢
2025-09-04 05:57:30 +08:00
committed by GitHub
parent ebcf89ee6c
commit 06d79f89ac
2 changed files with 209 additions and 30 deletions

View File

@@ -12,11 +12,11 @@
"node": ">=20"
},
"scripts": {
"clean": "rm -rf out && rm -rf scaffold/node_modules",
"clean": "rimraf out scaffold/node_modules",
"start": "electron-forge start",
"dev:engine": "DYAD_ENGINE_URL=http://localhost:8080/v1 npm start",
"staging:engine": "DYAD_ENGINE_URL=https://staging---dyad-llm-engine-kq7pivehnq-uc.a.run.app/v1 npm start",
"staging:gateway": "DYAD_GATEWAY_URL=https://staging---litellm-gcp-cloud-run-kq7pivehnq-uc.a.run.app/v1 npm start",
"dev:engine": "cross-env DYAD_ENGINE_URL=http://localhost:8080/v1 npm start",
"staging:engine": "cross-env DYAD_ENGINE_URL=https://staging---dyad-llm-engine-kq7pivehnq-uc.a.run.app/v1 npm start",
"staging:gateway": "cross-env DYAD_GATEWAY_URL=https://staging---litellm-gcp-cloud-run-kq7pivehnq-uc.a.run.app/v1 npm start",
"package": "npm run clean && electron-forge package",
"make": "npm run clean && electron-forge make",
"publish": "npm run clean && electron-forge publish",
@@ -79,6 +79,7 @@
"lint-staged": "^15.5.2",
"oxlint": "^1.8.0",
"prettier": "3.5.3",
"rimraf": "^6.0.1",
"typescript": "^5.8.3",
"vite": "^5.4.17",
"vitest": "^3.1.1"