-
Notifications
You must be signed in to change notification settings - Fork 0
Script Picker
tavlean edited this page May 28, 2026
·
2 revisions
pickDevScript(cwd) in src/servers.ts picks which package.json script to run.
- Canonical name chain:
dev→start→develop. First match wins. - If none, walk scripts in declared order and inspect each value against a token list. First match wins.
- If still none, throw, which surfaces in the launcher as a clear error toast.
Catches monorepo conventions like dev:web, start:dev, framework-specific scripts:
vite, next dev, astro dev, nuxt dev, webpack-dev-server, webpack serve,
parcel, gatsby develop, remix dev / remix vite:dev, turbo dev,
bun --watch / --hot / run dev, nodemon, tsx watch, ts-node-dev,
serve, http-server, live-server
Patterns are conservative: \bvite\b(?!\s+(?:build|preview|optimize)) excludes obvious non-dev usages so a build:vite-config doesn't get picked.
V8 preserves object insertion order, so the same package.json always picks the same script. No flakiness across runs.
- Per-project script override. Some users may want to pin a specific script per project even if the heuristic picks another. Would need a small preference store keyed by canonical cwd. Not yet implemented because real-world need hasn't shown up.
- New dev-server tools land regularly; the token list will need occasional updates. Adding a token is a one-line change.