MCPcopy
hub / github.com/TypeStrong/ts-node / phase3

Function phase3

src/bin.ts:342–419  ·  view source on GitHub ↗
(payload: BootstrapState)

Source from the content-addressed store, hash-verified

340}
341
342function phase3(payload: BootstrapState) {
343 const {
344 emit,
345 files,
346 pretty,
347 transpileOnly,
348 transpiler,
349 noExperimentalReplAwait,
350 typeCheck,
351 swc,
352 compilerHost,
353 ignore,
354 preferTsExts,
355 logError,
356 scriptMode,
357 cwdMode,
358 project,
359 skipProject,
360 skipIgnore,
361 compiler,
362 ignoreDiagnostics,
363 compilerOptions,
364 argsRequire,
365 scope,
366 scopeDir,
367 esm,
368 experimentalSpecifierResolution,
369 } = payload.parseArgvResult;
370 const { cwd } = payload.phase2Result!;
371
372 // NOTE: When we transition to a child process for ESM, the entry-point script determined
373 // here might not be the one used later in `phase4`. This can happen when we execute the
374 // original entry-point but then the process forks itself using e.g. `child_process.fork`.
375 // We will always use the original TS project in forked processes anyway, so it is
376 // expected and acceptable to retrieve the entry-point information here in `phase2`.
377 // See: https://github.com/TypeStrong/ts-node/issues/1812.
378 const { entryPointPath } = getEntryPointInfo(payload);
379
380 const preloadedConfig = findAndReadConfig({
381 cwd,
382 emit,
383 files,
384 pretty,
385 transpileOnly: transpileOnly ?? transpiler != null ? true : undefined,
386 experimentalReplAwait: noExperimentalReplAwait ? false : undefined,
387 typeCheck,
388 transpiler,
389 swc,
390 compilerHost,
391 ignore,
392 logError,
393 projectSearchDir: getProjectSearchDir(
394 cwd,
395 scriptMode,
396 cwdMode,
397 entryPointPath
398 ),
399 project,

Callers 1

bootstrapFunction · 0.85

Calls 3

findAndReadConfigFunction · 0.90
getEntryPointInfoFunction · 0.85
getProjectSearchDirFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…