fix(scripts): launch vite through entrypoint on Windows#202
Merged
Conversation
| import { describe, expect, it } from 'bun:test' | ||
| import { existsSync, readFileSync } from 'node:fs' | ||
| import { bunCommand, bunRunCommand } from '../../scripts/lib/bunCommand' | ||
| import { bunCommand, bunRunCommand, viteCommand } from '../../scripts/lib/bunCommand' |
DavidBabinec
force-pushed
the
fix/windows-vite-entrypoint
branch
from
July 8, 2026 18:57
d15376e to
880cfb3
Compare
DavidBabinec
marked this pull request as ready for review
July 8, 2026 19:23
lauer3912
pushed a commit
to ClawCopilot/Instatic
that referenced
this pull request
Jul 20, 2026
# Conflicts: # scripts/dev.ts # scripts/e2e-dev.ts # scripts/lib/bunCommand.ts # scripts/start.ts # src/__tests__/devWorkflow.test.ts
lauer3912
pushed a commit
to ClawCopilot/Instatic
that referenced
this pull request
Jul 20, 2026
Cherry-picked 15 upstream commits across 5 phases: Phase 1 — Security: - ae7ed0d: CSP base-uri + object-src (CoreBunch#158) - c0087ec: XSS scheme-check htmlAttributes (CoreBunch#155) Phase 2 — Windows compatibility: - 75086cf: Windows port probing (CoreBunch#170) - fdfcb15: vite through entrypoint (CoreBunch#202) - 8c957fe: Windows-safe slot symlink swap (CoreBunch#187) Phase 3 — Editor fixes (7 commits): - Font weights, malformed fonts tolerance, empty container, canvas pan, layer icons, explorer tabs, responsive nav Phase 4 — CMS core: - 43abba0: Transactional site-document save (43 files) - 61fcebc: Stop forcing table kind 'data' (CoreBunch#216) - 3a4a6fc: Custom data-table fields editing (CoreBunch#182) Phase 5 — Other: - f139d3c: YouTube iframe routing (CoreBunch#151) - 6447a65: JSON-import media validation (CoreBunch#154) - 9a3af2d: Publisher media background optimization - 081e0d3: Collapse data.rows SQL query (CoreBunch#159) Additional workspace fixes: - Migration 020 conflict resolved (renumbered to 021) - staticArtefact.ts: Windows plain-file slot swap - 15 test files: EBUSY-safe cleanup on Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
viteCommand(...), which runs Vite by calling the current Bun executable withnode_modules/vite/bin/vite.jsdirectly.scripts/dev.tsandscripts/e2e-dev.tsfrombun run dev:vitetoviteCommand(...).scripts/vite.tsas the package-script wrapper for Vite commands.dev:vite,build, andpreviewso package scripts no longer invoke barevite.devWorkflow.test.tsto assert the direct Vite entrypoint path and rejectbunRunCommand('dev:vite')/ barevitelauncher regressions.Why
PR #193 fixed direct Windows
uv_spawnfailures, but the follow-up user report showed another lookup layer still failing:$ vite --host "127.0.0.1" --port "5173" --strictPort bun: command not found: vite error: script "dev:vite" exited with code 1That means
bun run dev:vitestill asks Bun's package-script runner to resolve the barevitecommand on that Windows setup. This PR removes that lookup path entirely forbun run dev: the child process is nowprocess.execPathplus Vite's JS entrypoint path.Verification
bun test src/__tests__/devWorkflow.test.tsfailed before the helper/wrapper existed, then passed after the fix.bun -e "import { viteCommand } from './scripts/lib/bunCommand.ts'; const r = Bun.spawnSync(viteCommand('--version'), { stdout: 'pipe', stderr: 'pipe' }); console.log('exit', r.exitCode); console.log(r.stdout.toString().trim()); console.error(r.stderr.toString().trim()); process.exit(r.exitCode ?? 1);"bun run scripts/vite.ts --versionbun run dev:vite --versionbun run buildbun run lintbun test→6024 pass, 0 failPORT=3091 VITE_PORT=5191 bun run devsmoke: CMS listened on3091, Vite reported ready on5191, nocommand not found,Script not found,uv_spawn, orENOENToutput.