MCPcopy Create free account
hub / github.com/altic-dev/Pilot / detectDevCommand

Function detectDevCommand

src/lib/build-detector.ts:99–126  ·  view source on GitHub ↗

* Detect dev server command

(framework: string, scripts?: Record<string, string>)

Source from the content-addressed store, hash-verified

97 * Detect dev server command
98 */
99function detectDevCommand(framework: string, scripts?: Record<string, string>): string {
100 if (!scripts) {
101 return 'npm run dev';
102 }
103
104 // Priority order for dev scripts
105 const devScriptNames = ['dev', 'start', 'serve', 'preview'];
106
107 for (const scriptName of devScriptNames) {
108 if (scripts[scriptName]) {
109 return scriptName;
110 }
111 }
112
113 // Fallback based on framework
114 switch (framework) {
115 case 'Next.js':
116 case 'Vite':
117 case 'Remix':
118 return 'dev';
119 case 'Create React App':
120 case 'Vue':
121 case 'Angular':
122 return 'start';
123 default:
124 return 'dev';
125 }
126}
127
128/**
129 * Detect build command

Callers 1

detectBuildConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected