Lines 168-208javascript
168 server.once('listening', () => server.close(() => resolve(true)));
169 server.listen(port, '127.0.0.1');
172async function resolveDashboardPort(preferredPort) {
173 if (await portHasHealthyDashboard(preferredPort))
174 return preferredPort;
175 if (await portIsAvailable(preferredPort))
176 return preferredPort;
177 for (let port = preferredPort + 1; port <= preferredPort + 50; port += 1) {
178 if (await portIsAvailable(port))
181 return preferredPort;
183async function startDashboardInBackground(port) {
185 if (await waitForDashboard(port, 1000)) {
186 const { closeSync } = await import('fs');
187 const logFile = await dashboardLogFile(port);
188 closeSync(logFile.fd);
189 return { ready: true, port, url: `http://localhost:${port}/overview`, logPath: logFile.logPath };
192 const { spawn } = await import('child_process');
193 const { closeSync } = await import('fs');
194 const serverPackageJson = require.resolve('@customize-agent/server/package.json');
195 const serverRoot = dirname(serverPackageJson);
196 const nextBin = require.resolve('next/dist/bin/next', { paths: [serverRoot] });
197 const logFile = await dashboardLogFile(port);
198 logPath = logFile.logPath;
199 const child = spawn(process.execPath, [nextBin, 'start', '-p', String(port), '-H', '127.0.0.1'], {
202 stdio: ['ignore', logFile.fd, logFile.fd],
205 NODE_ENV: 'production',
HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
dist/index.jsView on unpkg · L188 206 CUSTOMIZE_PROJECT_ROOT: PROJECT_ROOT,