fix(dev): make npm run dev work on Windows (#374)

spawnSync('npm') without a shell fails with ENOENT on Windows because npm is npm.cmd, not npm.exe. The root dev script also used Unix VAR=value prefixes, which cmd.exe rejects.

Use shell: true when spawning npm on Windows, and set renderer URLs with cross-env.
This commit is contained in:
Hanlin
2026-09-14 19:04:22 +08:00
committed by GitHub
parent ed2bb86536
commit e064f3ad68
3 changed files with 74 additions and 38 deletions
+62 -36
View File
@@ -20,6 +20,7 @@
"@eslint/js": "^10.0.1",
"@playwright/test": "^1.61.1",
"concurrently": "^9.2.4",
"cross-env": "^10.1.0",
"eslint": "^10.8.0",
"eslint-plugin-react-hooks": "^7.1.1",
"globals": "^17.8.0",
@@ -203,8 +204,8 @@
"@genoffice/electron-utils": "*",
"@genoffice/file-parse": "*",
"@genoffice/i18n": "*",
"@genoffice/ui": "*",
"@genoffice/pptx-render": "*",
"@genoffice/ui": "*",
"@genoffice/xlsx-gateway": "*",
"@univerjs/core": "^0.25.1",
"@univerjs/data-validation": "^0.25.1",
@@ -251,10 +252,10 @@
"@genoffice/agent-core": "*",
"@genoffice/ai-provider": "*",
"@genoffice/ai-search": "*",
"@genoffice/cli": "*",
"@genoffice/docs": "*",
"@genoffice/docx-engine": "*",
"@genoffice/electron-utils": "*",
"@genoffice/cli": "*",
"@genoffice/i18n": "*",
"@genoffice/pipelines": "*",
"@genoffice/pptx-engine": "*",
@@ -1479,6 +1480,13 @@
"integrity": "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==",
"license": "MIT"
},
"node_modules/@epic-web/invariant": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@epic-web/invariant/-/invariant-1.0.0.tgz",
"integrity": "sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==",
"dev": true,
"license": "MIT"
},
"node_modules/@esbuild/aix-ppc64": {
"version": "0.25.12",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
@@ -2135,6 +2143,10 @@
"resolved": "packages/ai-search",
"link": true
},
"node_modules/@genoffice/cli": {
"resolved": "packages/cli",
"link": true
},
"node_modules/@genoffice/docs": {
"resolved": "apps/docs",
"link": true
@@ -2155,10 +2167,6 @@
"resolved": "packages/font-metrics",
"link": true
},
"node_modules/@genoffice/cli": {
"resolved": "packages/cli",
"link": true
},
"node_modules/@genoffice/html": {
"resolved": "apps/html",
"link": true
@@ -7607,6 +7615,24 @@
"optional": true,
"peer": true
},
"node_modules/cross-env": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-10.1.0.tgz",
"integrity": "sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@epic-web/invariant": "^1.0.0",
"cross-spawn": "^7.0.6"
},
"bin": {
"cross-env": "dist/bin/cross-env.js",
"cross-env-shell": "dist/bin/cross-env-shell.js"
},
"engines": {
"node": ">=20"
}
},
"node_modules/cross-spawn": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
@@ -14945,6 +14971,36 @@
"vitest": "^4.1.11"
}
},
"packages/cli": {
"name": "@genoffice/cli",
"version": "0.6.0",
"license": "Apache-2.0",
"dependencies": {
"@genoffice/ai-provider": "*",
"@genoffice/ai-search": "*",
"@genoffice/docx-engine": "*",
"@genoffice/pdf2docx": "*",
"@genoffice/pipelines": "*",
"@genoffice/pptx-engine": "*",
"@genoffice/pptx-ops": "*",
"@genoffice/pptx-render": "*",
"@genoffice/xlsx-gateway": "*",
"@tiptap/core": "3.31.0",
"jsdom": "^28.0.0",
"jszip": "^3.10.1",
"numfmt": "^3.2.6",
"undici": "^6.28.0"
},
"bin": {
"genoffice": "bin/genoffice"
},
"devDependencies": {
"@types/node": "^24.10.1",
"esbuild": "^0.25.12",
"typescript": "^5.9.3",
"vitest": "^4.1.11"
}
},
"packages/docx-engine": {
"name": "@genoffice/docx-engine",
"version": "0.1.0",
@@ -15002,36 +15058,6 @@
"vitest": "^4.1.11"
}
},
"packages/cli": {
"name": "@genoffice/cli",
"version": "0.3.0",
"license": "Apache-2.0",
"dependencies": {
"@genoffice/ai-provider": "*",
"@genoffice/ai-search": "*",
"@genoffice/docx-engine": "*",
"@genoffice/pdf2docx": "*",
"@genoffice/pipelines": "*",
"@genoffice/pptx-engine": "*",
"@genoffice/pptx-ops": "*",
"@genoffice/pptx-render": "*",
"@genoffice/xlsx-gateway": "*",
"@tiptap/core": "3.31.0",
"jsdom": "^28.0.0",
"jszip": "^3.10.1",
"numfmt": "^3.2.6",
"undici": "^6.28.0"
},
"bin": {
"genoffice": "bin/genoffice"
},
"devDependencies": {
"@types/node": "^24.10.1",
"esbuild": "^0.25.12",
"typescript": "^5.9.3",
"vitest": "^4.1.11"
}
},
"packages/html2docx": {
"name": "@genoffice/html2docx",
"version": "0.1.0",