mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-09 05:26:24 +09:00
## Summary Generated previews now reuse the npm CLI path supplied by the npx launcher instead of rediscovering npm or npm.cmd through the MCP subprocess PATH. The same invocation is used for dependency installation, production builds, and preview server startup, with the existing platform command retained as a fallback for direct launches. ## Technical choices - Invoke npm-cli.js with the current Node executable when npm_execpath identifies npm as the launcher. - Parse Windows paths with the platform path implementation. - Keep npm and npm.cmd fallback behavior when Webstudio was not launched through npm. - Inject executable paths in tests so launcher behavior is deterministic. ## Todo - [x] Reuse the npx npm launcher during generated dependency installation. - [x] Apply the same launcher to generated build and server commands. - [x] Cover Windows launcher paths and direct-launch fallbacks. - [x] Run focused tests, typecheck, lint, formatting, and production build. ## Verification - pnpm --filter webstudio test -- src/commands/preview.test.ts src/preview-server.test.ts - pnpm --filter webstudio typecheck - pnpm exec oxlint --deny-warnings on the four changed files - pnpm --filter webstudio build - git diff --check All checks passed. The build emitted the existing Radix use-client bundling warnings. Agent evaluations were not run because they require separate explicit approval.