MCPcopy Create free account
hub / github.com/netlify/cli / getExecaOptions

Function getExecaOptions

tests/integration/utils/dev-server.ts:13–35  ·  view source on GitHub ↗
({ cwd, env }: { cwd: string; env: NodeJS.ProcessEnv })

Source from the content-addressed store, hash-verified

11import { handleQuestions } from './handle-questions.js'
12
13export const getExecaOptions = ({ cwd, env }: { cwd: string; env: NodeJS.ProcessEnv }) => {
14 // Unused vars here are in order to omit LANg and LC_ALL from envs
15
16 const { LANG, LC_ALL, ...baseEnv } = process.env
17
18 // Diagnostics for the Node 24 serve-mode hang. The trace flags surface any
19 // uncaught exception, deprecation warning, or process.exit. --report-on-signal
20 // makes Node emit a full diagnostic report (stacks + libuv handles) on SIGUSR2,
21 // written to a file in cwd. The test util sends SIGUSR2 just before the
22 // start-timeout fires so the report captures *what* the process is stuck on.
23 // Note: --report-on-fatalerror, --report-uncaught-exception, and
24 // --report-filename are NOT permitted in NODE_OPTIONS (Worker threads reject
25 // env vars containing them), so we keep this list to the allowed subset.
26 const traceFlags = '--trace-warnings --trace-uncaught --trace-exit --report-on-signal --report-signal=SIGUSR2'
27 const nodeOptions = baseEnv.NODE_OPTIONS ? `${baseEnv.NODE_OPTIONS} ${traceFlags}` : traceFlags
28
29 return {
30 cwd,
31 extendEnv: false,
32 env: { ...baseEnv, BROWSER: 'none', NODE_OPTIONS: nodeOptions, ...env },
33 encoding: 'utf8',
34 }
35}
36
37export interface DevServer {
38 url: string

Callers 3

asyncErrorBlockFunction · 0.85
startServerFunction · 0.85
asyncErrorBlockFunction · 0.85

Calls

no outgoing calls

Tested by 2

asyncErrorBlockFunction · 0.68
asyncErrorBlockFunction · 0.68