@smoothbricks/nx-plugin 0.4.22 → 0.4.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +93 -33
  2. package/dist/bin/smoo-nx-exec.js +35 -11
  3. package/dist/bin/smoo-nx-nextest-extract.d.ts +3 -0
  4. package/dist/bin/smoo-nx-nextest-extract.d.ts.map +1 -0
  5. package/dist/bin/smoo-nx-nextest-extract.js +41 -0
  6. package/dist/cargo-closure-input.d.ts +63 -0
  7. package/dist/cargo-closure-input.d.ts.map +1 -0
  8. package/dist/cargo-closure-input.js +197 -0
  9. package/dist/cargo-source-hash.d.ts +37 -0
  10. package/dist/cargo-source-hash.d.ts.map +1 -1
  11. package/dist/cargo-source-hash.js +108 -190
  12. package/dist/cross-check-policy.d.ts +14 -0
  13. package/dist/cross-check-policy.d.ts.map +1 -1
  14. package/dist/cross-check-policy.js +15 -1
  15. package/dist/ensure-built.d.ts +3 -2
  16. package/dist/ensure-built.d.ts.map +1 -1
  17. package/dist/ensure-built.js +33 -56
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +152 -91
  20. package/dist/managed-files/ci-workflow.d.ts.map +1 -1
  21. package/dist/managed-files/ci-workflow.js +12 -15
  22. package/dist/managed-files/files.d.ts.map +1 -1
  23. package/dist/managed-files/files.js +10 -0
  24. package/dist/managed-files/publish-workflow.d.ts.map +1 -1
  25. package/dist/managed-files/publish-workflow.js +12 -6
  26. package/dist/manifest-hash.d.ts.map +1 -1
  27. package/dist/manifest-hash.js +24 -30
  28. package/dist/nextest-extraction.d.ts +101 -0
  29. package/dist/nextest-extraction.d.ts.map +1 -0
  30. package/dist/nextest-extraction.js +268 -0
  31. package/dist/package-target-policy.js +1 -1
  32. package/dist/platform-targets.d.ts +7 -0
  33. package/dist/platform-targets.d.ts.map +1 -1
  34. package/dist/platform-targets.js +7 -0
  35. package/dist/workspace-config-policy.d.ts +1 -1
  36. package/dist/workspace-config-policy.d.ts.map +1 -1
  37. package/dist/workspace-config-policy.js +1 -1
  38. package/managed/raw/envrc +38 -1
  39. package/managed/raw/tooling/direnv/developer-links.ts +201 -0
  40. package/managed/raw/tooling/direnv/devenv.smoo.nix +75 -51
  41. package/managed/raw/tooling/direnv/secret-references.ts +3 -1
  42. package/managed/raw/tooling/direnv/setup-environment.ts +562 -78
  43. package/managed/raw/tooling/direnv/shared-caches.sh +53 -0
  44. package/managed/raw/tooling/git-hooks/pre-push.sh +22 -1
  45. package/managed/templates/github/workflows/managed-files.yml +4 -3
  46. package/nextest.toml +5 -5
  47. package/package.json +4 -3
  48. package/src/__tests__/fixture-nx-env.ts +31 -0
  49. package/src/__tests__/in-process-nx-index.ts +9 -0
  50. package/src/bin/smoo-nx-exec.ts +40 -11
  51. package/src/bin/smoo-nx-nextest-extract.ts +43 -0
  52. package/src/bounded-test-policy.test.ts +4 -1
  53. package/src/cargo-closure-input.test.ts +184 -0
  54. package/src/cargo-closure-input.ts +247 -0
  55. package/src/cargo-source-hash.test.ts +8 -9
  56. package/src/cargo-source-hash.ts +146 -47
  57. package/src/cross-check-policy.ts +15 -3
  58. package/src/ensure-built.test.ts +65 -5
  59. package/src/ensure-built.ts +40 -85
  60. package/src/index.test.ts +222 -75
  61. package/src/index.ts +213 -101
  62. package/src/managed-files/ci-workflow.ts +12 -15
  63. package/src/managed-files/files.ts +10 -0
  64. package/src/managed-files/generator.test.ts +29 -0
  65. package/src/managed-files/publish-workflow.ts +17 -6
  66. package/src/manifest-hash.test.ts +21 -1
  67. package/src/manifest-hash.ts +26 -29
  68. package/src/nextest-extraction.test.ts +74 -0
  69. package/src/nextest-extraction.ts +329 -0
  70. package/src/package-target-policy.ts +1 -1
  71. package/src/platform-targets.ts +8 -0
  72. package/src/workspace-config-policy.ts +6 -1
@@ -4,6 +4,7 @@ import { chmod, mkdir, mkdtemp, readFile, realpath, rm, symlink, writeFile } fro
4
4
  import { tmpdir } from 'node:os';
5
5
  import { dirname, join } from 'node:path';
6
6
  import { fileURLToPath } from 'node:url';
7
+ import { stripVTControlCharacters } from 'node:util';
7
8
 
8
9
  import type { Task } from 'nx/src/config/task-graph';
9
10
 
@@ -446,6 +447,26 @@ describe('smoo-nx-exec', () => {
446
447
  expect(run.stdout.split('\n')[0]).toBe(MARKER);
447
448
  });
448
449
 
450
+ it("hands the exec'd binary blocking stdio, so a pipe its output fills is never cut", async () => {
451
+ // Node leaves a pipe O_NONBLOCK on macOS, and the flag belongs to the open file description, so
452
+ // it survives execve: the binary's writes then fail with EAGAIN once the pipe holds 64 KiB and
453
+ // nobody is reading. A reader that starts late is what makes the pipe fill.
454
+ const flood = join(workspace, 'flood');
455
+ await writeFile(flood, '#!/bin/sh\nhead -c 300000 /dev/zero\n');
456
+ await chmod(flood, 0o755);
457
+ try {
458
+ const piped = Bun.spawn(
459
+ ['sh', '-c', `"$0" "$1" app:build -- ./flood | { sleep 1; tr -cd '\\000' | wc -c; }`, 'node', builtBinEntry],
460
+ { cwd: workspace, env: fixtureNxEnvironment(), stdout: 'pipe', stderr: 'pipe' },
461
+ );
462
+ const received = (await new Response(piped.stdout).text()).trim();
463
+ expect(await piped.exited).toBe(0);
464
+ expect(received).toBe('300000');
465
+ } finally {
466
+ await rm(flood, { force: true });
467
+ }
468
+ });
469
+
449
470
  it('leaves the exec\u0027d binary the caller\u0027s cwd and none of Nx\u0027s environment', async () => {
450
471
  // Invoked from a subdirectory, with the binary named relative to it: the
451
472
  // resolution the wrapper's users actually perform.
@@ -508,7 +529,7 @@ describe('smoo-nx-exec', () => {
508
529
  expect(await readFile(builds(), 'utf-8')).toBe(before);
509
530
  });
510
531
 
511
- it('runs again when a dependency\u0027s own inputs change', async () => {
532
+ it('runs again when a dependency\u0027s own inputs change, keeping stdout for the binary alone', async () => {
512
533
  const before = await readFile(builds(), 'utf-8');
513
534
  await writeFile(join(workspace, 'packages', 'lib', 'source1.txt'), 'lib changed\n');
514
535
  const changed = await runBin(workspace, ['app:build', '--', './report']);
@@ -516,6 +537,13 @@ describe('smoo-nx-exec', () => {
516
537
  expect(await readFile(join(workspace, 'packages', 'lib', 'dist', 'lib.txt'), 'utf-8')).toBe('lib changed\n');
517
538
  expect(await readFile(marker(), 'utf-8')).toBe('built\nlib changed\n');
518
539
  expect(await readFile(builds(), 'utf-8')).toBe(`${before}lib changed\n`);
540
+ // The run's log is on stderr. Stdout is the exec'd binary's and holds
541
+ // nothing else, or `wrapper | jq` reads Nx's banner as data.
542
+ expect(stripVTControlCharacters(changed.stderr)).toContain('nx run lib:build');
543
+ expect(changed.stdout.split('\n')[0], changed.stdout).toBe(MARKER);
544
+ for (const line of changed.stdout.split('\n').filter((line) => line !== '')) {
545
+ expect(line === MARKER || line.startsWith('cwd=') || /^NX_[A-Z_]+=/.test(line), line).toBe(true);
546
+ }
519
547
 
520
548
  // And the graph settles back to silence, which is only reachable if the
521
549
  // dependent-outputs task was hashed too.
@@ -544,6 +572,38 @@ describe('smoo-nx-exec', () => {
544
572
  expect(settled.stdout.split('\n')[0]).toBe(MARKER);
545
573
  });
546
574
 
575
+ it('without a binary, stays silent and exits 0 when nothing is stale', async () => {
576
+ const run = await runBin(workspace, ['app:build']);
577
+ expect(run.code, run.stdout + run.stderr).toBe(0);
578
+ expect(run.stdout).toBe('');
579
+ expect(run.stderr).toBe('');
580
+ });
581
+
582
+ it('without a binary, runs what is stale, shows that run and exits 0', async () => {
583
+ const before = await readFile(builds(), 'utf-8');
584
+ await writeFile(join(workspace, 'packages', 'lib', 'source1.txt'), 'lib checked\n');
585
+ const run = await runBin(workspace, ['app:build']);
586
+ expect(run.code, run.stdout + run.stderr).toBe(0);
587
+ // An outer `nx run nx-plugin:test` exports FORCE_COLOR, so the fixture's
588
+ // Nx styles its task lines; what the test pins is the line, not its colour.
589
+ expect(stripVTControlCharacters(run.stderr)).toContain('nx run lib:build');
590
+ expect(run.stdout).toBe('');
591
+ expect(await readFile(marker(), 'utf-8')).toBe('built\nlib checked\n');
592
+ expect(await readFile(builds(), 'utf-8')).toBe(`${before}lib checked\n`);
593
+
594
+ const settled = await runBin(workspace, ['app:build']);
595
+ expect(settled.code, settled.stdout + settled.stderr).toBe(0);
596
+ expect(settled.stdout).toBe('');
597
+ expect(settled.stderr).toBe('');
598
+ });
599
+
600
+ it('without a binary, exits with a failing target\u0027s code', async () => {
601
+ const run = await runBin(workspace, ['app:broken']);
602
+ expect(run.code).toBe(1);
603
+ expect(stripVTControlCharacters(run.stderr)).toContain('nx run app:broken');
604
+ expect(run.stdout).toBe('');
605
+ });
606
+
547
607
  it('forwards a failing target\u0027s exit code and never execs', async () => {
548
608
  const run = await runBin(workspace, ['app:broken', '--', './report']);
549
609
  expect(run.code).toBe(1);
@@ -557,7 +617,7 @@ describe('smoo-nx-exec', () => {
557
617
  });
558
618
  expect(run.code).toBe(0);
559
619
  expect(run.stderr).toContain('daemon is disabled');
560
- expect(run.stdout).toContain(MARKER);
620
+ expect(run.stdout.split('\n')[0], run.stdout).toBe(MARKER);
561
621
  });
562
622
 
563
623
  it('prints the message from a plain-object Nx rejection', async () => {
@@ -597,9 +657,9 @@ describe('smoo-nx-exec', () => {
597
657
  });
598
658
 
599
659
  it('rejects a malformed invocation with a usage error', async () => {
600
- const missingSeparator = await runBin(workspace, ['app:build']);
601
- expect(missingSeparator.code).toBe(2);
602
- expect(missingSeparator.stderr).toContain('missing `--`');
660
+ const emptyCommand = await runBin(workspace, ['app:build', '--']);
661
+ expect(emptyCommand.code).toBe(2);
662
+ expect(emptyCommand.stderr).toContain('no binary given');
603
663
 
604
664
  const badTarget = await runBin(workspace, ['build', '--', './report']);
605
665
  expect(badTarget.code).toBe(2);
@@ -14,7 +14,6 @@ import type * as NxHashTask from 'nx/src/hasher/hash-task';
14
14
  import type * as NxTaskHasher from 'nx/src/hasher/task-hasher';
15
15
  import type * as NxNative from 'nx/src/native';
16
16
  import type * as NxExecutionHooks from 'nx/src/project-graph/plugins/tasks-execution-hooks';
17
- import type * as NxProjectGraph from 'nx/src/project-graph/project-graph';
18
17
  import type * as NxCache from 'nx/src/tasks-runner/cache';
19
18
  import type * as NxCreateTaskGraph from 'nx/src/tasks-runner/create-task-graph';
20
19
  import type { TaskResults } from 'nx/src/tasks-runner/life-cycle';
@@ -24,7 +23,6 @@ import type * as NxTasksRunnerUtils from 'nx/src/tasks-runner/utils';
24
23
  import type * as NxCacheDirectory from 'nx/src/utils/cache-directory';
25
24
  import type * as NxCommandLineUtils from 'nx/src/utils/command-line-utils';
26
25
  import type { NxArgs } from 'nx/src/utils/command-line-utils';
27
- import type * as NxExitCodes from 'nx/src/utils/exit-codes';
28
26
  import type * as NxPerfLogging from 'nx/src/utils/perf-logging';
29
27
  import type * as NxWorkspaceRoot from 'nx/src/utils/workspace-root';
30
28
 
@@ -35,7 +33,6 @@ interface NxRuntimeModules {
35
33
  readonly 'nx/src/hasher/task-hasher': typeof NxTaskHasher;
36
34
  readonly 'nx/src/native': typeof NxNative;
37
35
  readonly 'nx/src/project-graph/plugins/tasks-execution-hooks': typeof NxExecutionHooks;
38
- readonly 'nx/src/project-graph/project-graph': typeof NxProjectGraph;
39
36
  readonly 'nx/src/tasks-runner/cache': typeof NxCache;
40
37
  readonly 'nx/src/tasks-runner/create-task-graph': typeof NxCreateTaskGraph;
41
38
  readonly 'nx/src/tasks-runner/run-command': typeof NxRunCommand;
@@ -43,7 +40,6 @@ interface NxRuntimeModules {
43
40
  readonly 'nx/src/tasks-runner/utils': typeof NxTasksRunnerUtils;
44
41
  readonly 'nx/src/utils/cache-directory': typeof NxCacheDirectory;
45
42
  readonly 'nx/src/utils/command-line-utils': typeof NxCommandLineUtils;
46
- readonly 'nx/src/utils/exit-codes': typeof NxExitCodes;
47
43
  readonly 'nx/src/utils/perf-logging': typeof NxPerfLogging;
48
44
  readonly 'nx/src/utils/workspace-root': typeof NxWorkspaceRoot;
49
45
  }
@@ -99,7 +95,8 @@ export type MissReason =
99
95
  * `built` means the work was handed to Nx — which may have restored outputs
100
96
  * from the local cache rather than recompiled anything. The line `hit` draws is
101
97
  * "did this process have to do work", which is what a CLI wrapper needs in
102
- * order to decide whether to stay quiet.
98
+ * order to decide whether to stay quiet. A run writes only to stderr: stdout
99
+ * belongs to whatever the caller goes on to run.
103
100
  *
104
101
  * `failed` is an operational outcome, not an exception: the target ran and did
105
102
  * not succeed. A caller re-raises `signal` when there is one and exits with
@@ -225,7 +222,7 @@ export function unvouched<Entry>(entries: readonly Entry[], verdicts: readonly b
225
222
  * on every invocation. So it never spawns the `nx` CLI: a native filesystem
226
223
  * snapshot refreshes the daemon's inputs, the task hashes and on-disk output
227
224
  * verification are daemon round-trips, and the cache lookup is a local SQLite
228
- * read. Nx's task runner is only invoked once something needs running.
225
+ * read. Only a miss starts the workspace's `nx` CLI, to run the target.
229
226
  *
230
227
  * With the daemon disabled there is no probe to make — hashing would have to
231
228
  * build the project graph in this process, and no service holds the recorded
@@ -278,7 +275,7 @@ async function ensureBuiltInWorkspace(
278
275
  // this explicit fallback path, which also lets a deliberately minimal
279
276
  // checkout-local CLI stand in for Nx.
280
277
  if (process.env.NX_DAEMON === 'false') {
281
- return runViaCli(workspaceRoot, selector);
278
+ return runViaCli(workspaceRoot, selector, { kind: 'no-daemon', taskId: selectorTaskId(selector) });
282
279
  }
283
280
  // Nx rejects daemon access when the client package's version differs from
284
281
  // the workspace's running daemon. Resolve every runtime module from the
@@ -288,7 +285,7 @@ async function ensureBuiltInWorkspace(
288
285
  bindWorkspaceRoot(workspaceRoot, requireNx);
289
286
  const { daemonClient } = requireNx('nx/src/daemon/client/client');
290
287
  if (!daemonClient.enabled()) {
291
- return runViaCli(workspaceRoot, selector);
288
+ return runViaCli(workspaceRoot, selector, { kind: 'no-daemon', taskId: selectorTaskId(selector) });
292
289
  }
293
290
 
294
291
  // An outer Nx task exports its own cache-bypass setting to the process it
@@ -356,32 +353,33 @@ async function ensureBuiltInWorkspace(
356
353
 
357
354
  performance.mark('ensureBuilt:probe:start');
358
355
  let reason: MissReason | null;
359
- const selectorTaskId =
360
- selector.configuration === undefined
361
- ? `${selector.project}:${selector.target}`
362
- : `${selector.project}:${selector.target}:${selector.configuration}`;
363
356
  if (process.env.NX_SKIP_NX_CACHE === 'true' || process.env.NX_DISABLE_NX_CACHE === 'true') {
364
- reason = { kind: 'cache-disabled', taskId: selectorTaskId };
357
+ reason = { kind: 'cache-disabled', taskId: selectorTaskId(selector) };
365
358
  } else if (inputsChanged) {
366
- reason = { kind: 'stale-inputs', taskId: selectorTaskId };
359
+ reason = { kind: 'stale-inputs', taskId: selectorTaskId(selector) };
367
360
  } else {
368
361
  reason = await probe(workspaceRoot, nxJson, nxArgs, projectGraph, taskGraph, tasks, requireNx);
369
362
  }
370
363
  performance.measure('ensureBuilt:probe', 'ensureBuilt:probe:start');
371
- const outcome =
372
- reason === null
373
- ? { result: HIT, taskResults: NO_TASK_RESULTS }
374
- : await runTarget(nxJson, nxArgs, overrides, selector, reason, requireNx);
364
+ // The CLI runs the hooks around its own run, under its own id. This process
365
+ // ran none of the tasks, so it reports none for the id it opened.
366
+ const result = reason === null ? HIT : await runViaCli(workspaceRoot, selector, reason);
375
367
  await hooks.runPostTasksExecution({
376
368
  id: runId,
377
- taskResults: outcome.taskResults,
369
+ taskResults: NO_TASK_RESULTS,
378
370
  workspaceRoot,
379
371
  nxJsonConfiguration: nxJson,
380
372
  argv: process.argv,
381
373
  startTime,
382
374
  endTime: Date.now(),
383
375
  });
384
- return outcome.result;
376
+ return result;
377
+ }
378
+
379
+ function selectorTaskId(selector: TargetSelector): string {
380
+ return selector.configuration === undefined
381
+ ? `${selector.project}:${selector.target}`
382
+ : `${selector.project}:${selector.target}:${selector.configuration}`;
385
383
  }
386
384
 
387
385
  /**
@@ -797,78 +795,35 @@ function isSystemError(error: unknown): boolean {
797
795
  return error instanceof Error && 'code' in error && typeof error.code === 'string';
798
796
  }
799
797
 
800
- interface CompletedRun {
801
- readonly result: EnsureBuiltResult;
802
- readonly taskResults: TaskResults;
803
- }
804
-
805
- async function runTarget(
806
- nxJson: NxJsonConfiguration,
807
- nxArgs: NxArgs,
808
- overrides: Record<string, unknown>,
809
- selector: TargetSelector,
810
- reason: MissReason,
811
- requireNx: WorkspaceNxRequire,
812
- ): Promise<CompletedRun> {
813
- const { runCommandForTasks } = requireNx('nx/src/tasks-runner/run-command');
814
- const { createProjectGraphAsync } = requireNx('nx/src/project-graph/project-graph');
815
- const { signalToCode } = requireNx('nx/src/utils/exit-codes');
816
- // `runCommandForTasks` derives its own task graph and hashes, so the probe's
817
- // work is not reusable. That duplication is one daemon round-trip on a path
818
- // that is about to run a build.
819
- const projectGraph = await createProjectGraphAsync();
820
- const { taskResults, completed } = await runCommandForTasks(
821
- [requireProject(projectGraph, selector.project)],
822
- projectGraph,
823
- { nxJson },
824
- nxArgs,
825
- overrides,
826
- selector.project,
827
- {},
828
- { excludeTaskDependencies: false, loadDotEnvFiles: process.env.NX_LOAD_DOT_ENV_FILES !== 'false' },
829
- );
830
- if (!completed) {
831
- // Nx's own encoding of an interrupted run: `runCommand` reports
832
- // `signalToCode('SIGINT')` here. The runner does not surface which signal
833
- // actually arrived, so there is none to forward — only the code Nx's CLI
834
- // would have exited with.
835
- return {
836
- result: { disposition: 'failed', reason, exitCode: signalToCode('SIGINT'), signal: null },
837
- taskResults,
838
- };
839
- }
840
- for (const taskResult of Object.values(taskResults)) {
841
- if (taskResult.status === 'failure' || taskResult.status === 'skipped') {
842
- return { result: { disposition: 'failed', reason, exitCode: 1, signal: null }, taskResults };
843
- }
844
- }
845
- return { result: { disposition: 'built', reason }, taskResults };
846
- }
847
-
848
798
  /**
849
- * The daemon-disabled path: hand the target to the workspace's own `nx`, with
850
- * stdio inherited.
799
+ * Run the target through the workspace's own `nx`, the invocation whose hashes
800
+ * the probe reproduces, with the child's stdout on this process's stderr.
851
801
  *
852
- * Inheriting rather than piping is the point. The wrapper this facility
802
+ * A child, because Nx does not only write through `process.stdout`: its Rust
803
+ * pseudo-terminal and the forked executors it starts with inherited stdio
804
+ * write task output straight to file descriptor 1, and Node cannot point that
805
+ * descriptor elsewhere in its own process. In a child it is simply stderr, so
806
+ * the stdout of a wrapper that goes on to exec a binary carries nothing but
807
+ * that binary's output (`<cli> list | jq` reads only data).
808
+ *
809
+ * Inheriting rather than piping is the other half. The wrapper this facility
853
810
  * replaces piped Nx's output so it could read a cache marker out of the log and
854
811
  * stay silent on a hit — a text heuristic over ANSI-coloured, format-unstable
855
- * output. Without a daemon there is nothing to be silent about: no cheap probe
856
- * exists, so the run is unconditional, the output is the run's own, and the
857
- * child's exit status is forwarded verbatim.
812
+ * output. The probe already decided this is no hit, so the output is the run's
813
+ * own, and the child's exit status is forwarded verbatim.
858
814
  */
859
- async function runViaCli(workspaceRoot: string, selector: TargetSelector): Promise<EnsureBuiltResult> {
815
+ async function runViaCli(
816
+ workspaceRoot: string,
817
+ selector: TargetSelector,
818
+ reason: MissReason,
819
+ ): Promise<EnsureBuiltResult> {
860
820
  const nxCli = join(workspaceRoot, 'node_modules', '.bin', 'nx');
861
821
  if (!existsSync(nxCli)) {
862
- throw new Error(`ensureBuilt: the Nx daemon is disabled and ${nxCli} does not exist`);
863
- }
864
- const reason: MissReason = { kind: 'no-daemon', taskId: `${selector.project}:${selector.target}` };
865
- const targetSpec = selector.configuration
866
- ? `${selector.project}:${selector.target}:${selector.configuration}`
867
- : `${selector.project}:${selector.target}`;
868
- const signalToCode = nxSignalToCode;
869
- const child = spawn(nxCli, ['run', targetSpec, '--outputStyle=stream'], {
822
+ throw new Error(`ensureBuilt: ${describeMiss(reason)}, and ${nxCli} does not exist`);
823
+ }
824
+ const child = spawn(nxCli, ['run', selectorTaskId(selector), '--outputStyle=stream'], {
870
825
  cwd: workspaceRoot,
871
- stdio: 'inherit',
826
+ stdio: ['inherit', 2, 'inherit'],
872
827
  });
873
828
  // `Promise.withResolvers` would read better but needs lib es2024; this
874
829
  // package inherits lib es2022 from tsconfig.base.json.
@@ -876,7 +831,7 @@ async function runViaCli(workspaceRoot: string, selector: TargetSelector): Promi
876
831
  child.once('error', reject);
877
832
  child.once('exit', (code, signal) => settle({ code, signal }));
878
833
  });
879
- return cliExitOutcome(reason, exit, signalToCode);
834
+ return cliExitOutcome(reason, exit, nxSignalToCode);
880
835
  }
881
836
 
882
837
  function nxSignalToCode(signal: NodeJS.Signals | null): number {