nx 24.0.0-beta.2 → 24.0.0-beta.4

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 (158) hide show
  1. package/dist/bin/post-install.js +5 -3
  2. package/dist/src/adapter/ngcli-adapter.js +1 -2
  3. package/dist/src/command-line/add/add.d.ts +2 -0
  4. package/dist/src/command-line/add/add.js +23 -5
  5. package/dist/src/command-line/affected/affected.js +2 -2
  6. package/dist/src/command-line/init/implementation/add-nx-to-nest.js +21 -62
  7. package/dist/src/command-line/migrate/agentic/definitions.d.ts +1 -3
  8. package/dist/src/command-line/migrate/agentic/definitions.js +5 -97
  9. package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +7 -41
  10. package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +9 -48
  11. package/dist/src/command-line/migrate/agentic/handoff.d.ts +1 -43
  12. package/dist/src/command-line/migrate/agentic/handoff.js +3 -119
  13. package/dist/src/command-line/migrate/agentic/instruction-files.d.ts +0 -21
  14. package/dist/src/command-line/migrate/agentic/instruction-files.js +6 -27
  15. package/dist/src/command-line/migrate/agentic/master/run-master-session.d.ts +19 -1
  16. package/dist/src/command-line/migrate/agentic/master/run-master-session.js +63 -36
  17. package/dist/src/command-line/migrate/agentic/master/spawn-master.d.ts +1 -0
  18. package/dist/src/command-line/migrate/agentic/master/spawn-master.js +7 -5
  19. package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.d.ts +2 -2
  20. package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.js +2 -2
  21. package/dist/src/command-line/migrate/agentic/prompts/fragments.d.ts +1 -12
  22. package/dist/src/command-line/migrate/agentic/prompts/fragments.js +8 -17
  23. package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.d.ts +0 -15
  24. package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.js +3 -100
  25. package/dist/src/command-line/migrate/agentic/select.d.ts +12 -6
  26. package/dist/src/command-line/migrate/agentic/select.js +35 -5
  27. package/dist/src/command-line/migrate/agentic/types.d.ts +9 -68
  28. package/dist/src/command-line/migrate/agentic/types.js +5 -5
  29. package/dist/src/command-line/migrate/command-object.js +3 -3
  30. package/dist/src/command-line/migrate/execute-migration.d.ts +4 -4
  31. package/dist/src/command-line/migrate/execute-migration.js +7 -5
  32. package/dist/src/command-line/migrate/migrate-analytics.d.ts +12 -1
  33. package/dist/src/command-line/migrate/migrate-analytics.js +26 -0
  34. package/dist/src/command-line/migrate/migrate-commits.d.ts +9 -10
  35. package/dist/src/command-line/migrate/migrate-commits.js +25 -18
  36. package/dist/src/command-line/migrate/migrate-output.d.ts +1 -6
  37. package/dist/src/command-line/migrate/migrate-output.js +1 -10
  38. package/dist/src/command-line/migrate/migrate.d.ts +3 -0
  39. package/dist/src/command-line/migrate/migrate.js +77 -44
  40. package/dist/src/command-line/migrate/run/agent-output.d.ts +1 -0
  41. package/dist/src/command-line/migrate/run/agent-output.js +4 -0
  42. package/dist/src/command-line/migrate/run/broker.js +1 -1
  43. package/dist/src/command-line/migrate/run/give-up.d.ts +4 -3
  44. package/dist/src/command-line/migrate/run/give-up.js +8 -5
  45. package/dist/src/command-line/migrate/run/index.d.ts +2 -1
  46. package/dist/src/command-line/migrate/run/index.js +5 -1
  47. package/dist/src/command-line/migrate/run/issues.js +7 -2
  48. package/dist/src/command-line/migrate/run/orchestrator.d.ts +40 -4
  49. package/dist/src/command-line/migrate/run/orchestrator.js +233 -92
  50. package/dist/src/command-line/migrate/run/run-state.d.ts +4 -1
  51. package/dist/src/command-line/migrate/run/run-state.js +20 -2
  52. package/dist/src/command-line/migrate/run/runbook.d.ts +1 -0
  53. package/dist/src/command-line/migrate/run/runbook.js +99 -21
  54. package/dist/src/command-line/migrate/run/state-lock.d.ts +29 -4
  55. package/dist/src/command-line/migrate/run/state-lock.js +102 -10
  56. package/dist/src/command-line/migrate/run/util.d.ts +4 -2
  57. package/dist/src/command-line/migrate/run/util.js +23 -2
  58. package/dist/src/command-line/migrate/run/worker.d.ts +1 -1
  59. package/dist/src/command-line/migrate/run/worker.js +252 -250
  60. package/dist/src/command-line/release/changelog.js +9 -6
  61. package/dist/src/command-line/release/config/config.d.ts +1 -0
  62. package/dist/src/command-line/release/config/config.js +48 -9
  63. package/dist/src/command-line/release/release.js +2 -2
  64. package/dist/src/command-line/release/utils/git.js +8 -7
  65. package/dist/src/command-line/release/utils/interpolate-release-config.d.ts +6 -0
  66. package/dist/src/command-line/release/utils/interpolate-release-config.js +39 -0
  67. package/dist/src/command-line/release/utils/release-graph.d.ts +5 -0
  68. package/dist/src/command-line/release/utils/release-graph.js +1 -0
  69. package/dist/src/command-line/release/utils/resolve-changelog-renderer.js +2 -2
  70. package/dist/src/command-line/release/utils/shared.js +10 -10
  71. package/dist/src/command-line/release/utils/version-plan-utils.d.ts +3 -12
  72. package/dist/src/command-line/release/utils/version-plan-utils.js +33 -55
  73. package/dist/src/command-line/release/version/version-actions.js +2 -1
  74. package/dist/src/command-line/release/version.js +5 -2
  75. package/dist/src/command-line/show/projects.js +5 -3
  76. package/dist/src/command-line/yargs-utils/shared-options.js +1 -1
  77. package/dist/src/config/misc-interfaces.d.ts +6 -0
  78. package/dist/src/config/nx-json.d.ts +8 -5
  79. package/dist/src/config/workspace-json-project-json.d.ts +23 -12
  80. package/dist/src/core/graph/main.js +1 -1
  81. package/dist/src/core/graph/runtime.js +1 -1
  82. package/dist/src/core/graph/styles.css +1 -1
  83. package/dist/src/core/graph/styles.js +1 -1
  84. package/dist/src/devkit-exports.d.ts +8 -0
  85. package/dist/src/devkit-exports.js +12 -1
  86. package/dist/src/devkit-internals.d.ts +2 -1
  87. package/dist/src/devkit-internals.js +7 -3
  88. package/dist/src/executors/run-commands/run-commands.impl.d.ts +2 -2
  89. package/dist/src/executors/run-commands/run-commands.impl.js +20 -10
  90. package/dist/src/executors/run-commands/running-tasks.d.ts +12 -3
  91. package/dist/src/executors/run-commands/running-tasks.js +22 -18
  92. package/dist/src/hasher/check-task-files.js +1 -4
  93. package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.d.ts +1 -2
  94. package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.js +6 -11
  95. package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.md +2 -2
  96. package/dist/src/migrations/update-24-0-0/enable-legacy-affected.d.ts +4 -0
  97. package/dist/src/migrations/update-24-0-0/enable-legacy-affected.js +15 -0
  98. package/dist/src/migrations/update-24-0-0/enable-legacy-affected.md +30 -0
  99. package/dist/src/migrations/update-24-0-0/move-custom-hashers-to-inputs.md +7 -6
  100. package/dist/src/migrations/update-24-0-0/rename-ultracache-ignore-options.d.ts +3 -0
  101. package/dist/src/migrations/update-24-0-0/rename-ultracache-ignore-options.js +130 -0
  102. package/dist/src/migrations/update-24-0-0/rename-ultracache-ignore-options.md +62 -0
  103. package/dist/src/native/index.d.ts +11 -5
  104. package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
  105. package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
  106. package/dist/src/plugins/js/lock-file/pnpm-parser.js +1 -3
  107. package/dist/src/plugins/js/lock-file/pruned-output.d.ts +2 -2
  108. package/dist/src/plugins/js/lock-file/pruned-output.js +4 -4
  109. package/dist/src/project-graph/affected/affected-tasks.d.ts +6 -5
  110. package/dist/src/project-graph/affected/affected-tasks.js +16 -6
  111. package/dist/src/project-graph/plugins/loaded-nx-plugin.js +49 -6
  112. package/dist/src/project-graph/utils/project-configuration/target-merging.js +1 -1
  113. package/dist/src/project-graph/utils/project-configuration/target-normalization.js +7 -133
  114. package/dist/src/project-graph/utils/project-configuration-utils.js +2 -2
  115. package/dist/src/tasks-runner/pseudo-ipc.d.ts +1 -0
  116. package/dist/src/tasks-runner/pseudo-ipc.js +4 -0
  117. package/dist/src/tasks-runner/readiness/probes.d.ts +6 -1
  118. package/dist/src/tasks-runner/readiness/probes.js +41 -2
  119. package/dist/src/tasks-runner/readiness/ready-signal-server.d.ts +18 -0
  120. package/dist/src/tasks-runner/readiness/ready-signal-server.js +71 -0
  121. package/dist/src/tasks-runner/readiness/ready-signal.d.ts +25 -0
  122. package/dist/src/tasks-runner/readiness/ready-signal.js +70 -0
  123. package/dist/src/tasks-runner/readiness/ready-when.d.ts +35 -10
  124. package/dist/src/tasks-runner/readiness/ready-when.js +197 -42
  125. package/dist/src/tasks-runner/readiness/startup-host.d.ts +1 -0
  126. package/dist/src/tasks-runner/readiness/startup-host.js +32 -0
  127. package/dist/src/tasks-runner/task-env.js +11 -0
  128. package/dist/src/tasks-runner/task-orchestrator.d.ts +8 -0
  129. package/dist/src/tasks-runner/task-orchestrator.js +152 -42
  130. package/dist/src/tasks-runner/tokens.d.ts +54 -0
  131. package/dist/src/tasks-runner/tokens.js +161 -0
  132. package/dist/src/tasks-runner/utils.d.ts +15 -1
  133. package/dist/src/tasks-runner/utils.js +79 -33
  134. package/dist/src/ultracache/config.d.ts +3 -3
  135. package/dist/src/ultracache/config.js +4 -4
  136. package/dist/src/utils/acknowledge-build-scripts.d.ts +34 -1
  137. package/dist/src/utils/acknowledge-build-scripts.js +171 -32
  138. package/dist/src/utils/long-running-target.d.ts +1 -3
  139. package/dist/src/utils/long-running-target.js +1 -3
  140. package/migrations.json +13 -6
  141. package/package.json +11 -11
  142. package/schemas/migrations-schema.json +11 -0
  143. package/schemas/nx-schema.json +24 -13
  144. package/schemas/project-schema.json +15 -9
  145. package/dist/src/command-line/migrate/agentic/prompts/generic-validation.d.ts +0 -56
  146. package/dist/src/command-line/migrate/agentic/prompts/generic-validation.js +0 -67
  147. package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.d.ts +0 -49
  148. package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.js +0 -53
  149. package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.d.ts +0 -26
  150. package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.js +0 -27
  151. package/dist/src/command-line/migrate/agentic/prompts/system-prompt.d.ts +0 -70
  152. package/dist/src/command-line/migrate/agentic/prompts/system-prompt.js +0 -113
  153. package/dist/src/command-line/migrate/agentic/run-step.d.ts +0 -68
  154. package/dist/src/command-line/migrate/agentic/run-step.js +0 -148
  155. package/dist/src/command-line/migrate/agentic/runner.d.ts +0 -21
  156. package/dist/src/command-line/migrate/agentic/runner.js +0 -262
  157. package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.d.ts +0 -9
  158. package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.js +0 -18
@@ -8,6 +8,7 @@ const tslib_1 = require("tslib");
8
8
  const yargs_parser_1 = tslib_1.__importDefault(require("yargs-parser"));
9
9
  const is_tui_enabled_1 = require("../../tasks-runner/is-tui-enabled");
10
10
  const pseudo_terminal_1 = require("../../tasks-runner/pseudo-terminal");
11
+ const tokens_1 = require("../../tasks-runner/tokens");
11
12
  const utils_1 = require("../../tasks-runner/utils");
12
13
  const noop_child_process_1 = require("../../tasks-runner/running-tasks/noop-child-process");
13
14
  const running_tasks_1 = require("./running-tasks");
@@ -40,8 +41,9 @@ async function default_1(options, context) {
40
41
  success: results.code === 0,
41
42
  };
42
43
  }
43
- async function runCommands(options, context, task) {
44
- const normalized = normalizeOptions(options);
44
+ async function runCommands(options, context, task, baseEnv) {
45
+ let env;
46
+ const normalized = normalizeOptions(options, () => (env ??= (0, running_tasks_1.processEnv)(options.color, (0, running_tasks_1.calculateCwd)(options.cwd, context), options.env ?? {}, options.envFile, baseEnv)));
45
47
  if (normalized.readyWhenStatus.length && !normalized.parallel) {
46
48
  throw new Error('ERROR: Bad executor config for run-commands - "readyWhen" can only be used when "parallel=true".');
47
49
  }
@@ -79,10 +81,10 @@ async function runCommands(options, context, task) {
79
81
  : undefined,
80
82
  };
81
83
  const runningTask = isSingleCommandAndCanUsePseudoTerminal
82
- ? await (0, running_tasks_1.runSingleCommandWithPseudoTerminal)(normalized, context, resolvedTask)
84
+ ? await (0, running_tasks_1.runSingleCommandWithPseudoTerminal)(normalized, context, resolvedTask, baseEnv)
83
85
  : options.parallel
84
- ? new running_tasks_1.ParallelRunningTasks(normalized, context, resolvedTask)
85
- : new running_tasks_1.SeriallyRunningTasks(normalized, context, tuiEnabled, resolvedTask);
86
+ ? new running_tasks_1.ParallelRunningTasks(normalized, context, resolvedTask, baseEnv)
87
+ : new running_tasks_1.SeriallyRunningTasks(normalized, context, tuiEnabled, resolvedTask, baseEnv);
86
88
  return runningTask;
87
89
  }
88
90
  catch (e) {
@@ -92,7 +94,7 @@ async function runCommands(options, context, task) {
92
94
  throw new Error(`ERROR: Something went wrong in run-commands - ${e.message}`);
93
95
  }
94
96
  }
95
- function normalizeOptions(options) {
97
+ function normalizeOptions(options, env) {
96
98
  if (options.readyWhen && typeof options.readyWhen === 'string') {
97
99
  options.readyWhenStatus = [
98
100
  { stringToMatch: options.readyWhen, found: false },
@@ -135,17 +137,25 @@ function normalizeOptions(options) {
135
137
  options.parsedArgs = parseArgs(unparsedCommandArgs, options.unknownOptions, options.args);
136
138
  options.unparsedCommandArgs = unparsedCommandArgs;
137
139
  options.commands.forEach((c) => {
138
- c.command = interpolateArgsIntoCommand(c.command, options, c.forwardAllArgs ?? options.forwardAllArgs ?? true);
140
+ c.command = interpolateArgsIntoCommand(c.command, options, c.forwardAllArgs ?? options.forwardAllArgs ?? true, env);
139
141
  });
140
142
  return options;
141
143
  }
142
- function interpolateArgsIntoCommand(command, opts, forwardAllArgs) {
144
+ function interpolateArgsIntoCommand(command, opts, forwardAllArgs, env = () => process.env) {
143
145
  if (command.indexOf('{args.') > -1 && command.indexOf('{args}') > -1) {
144
146
  throw new Error('Command should not contain both {args} and {args.*} values. Please choose one to use.');
145
147
  }
146
148
  if (command.indexOf('{args.') > -1) {
147
- const regex = /{args\.([^}]+)}/g;
148
- return command.replace(regex, (_, group) => opts.parsedArgs[group] !== undefined ? opts.parsedArgs[group] : '');
149
+ return (0, tokens_1.resolveTokens)(command, {
150
+ isToken: (name) => name === 'args',
151
+ // Overrides are parsed without dot-notation, so `{args.a.b}` reads the
152
+ // `--a.b` override
153
+ read: (_, path) => Object.hasOwn(opts.parsedArgs, path)
154
+ ? opts.parsedArgs[path]
155
+ : undefined,
156
+ env: { read: env },
157
+ noValue: () => '',
158
+ });
149
159
  }
150
160
  else if (command.indexOf('{args}') > -1) {
151
161
  const regex = /{args}/g;
@@ -13,7 +13,7 @@ export declare class ParallelRunningTasks implements RunningTask {
13
13
  private exited;
14
14
  private exitCode;
15
15
  private exitTerminalOutput;
16
- constructor(options: NormalizedRunCommandsOptions, context: ExecutorContext, task: Pick<Task, 'id' | 'ultracache'>);
16
+ constructor(options: NormalizedRunCommandsOptions, context: ExecutorContext, task: Pick<Task, 'id' | 'ultracache'>, baseEnv?: NodeJS.ProcessEnv);
17
17
  getResults(): Promise<{
18
18
  code: number;
19
19
  terminalOutput: string;
@@ -29,6 +29,7 @@ export declare class ParallelRunningTasks implements RunningTask {
29
29
  export declare class SeriallyRunningTasks implements RunningTask {
30
30
  private readonly tuiEnabled;
31
31
  private readonly task;
32
+ private readonly baseEnv?;
32
33
  private terminalOutputChunks;
33
34
  private currentProcess;
34
35
  private exitCallbacks;
@@ -37,7 +38,7 @@ export declare class SeriallyRunningTasks implements RunningTask {
37
38
  private outputCallbacks;
38
39
  private exited;
39
40
  private exitTerminalOutput;
40
- constructor(options: NormalizedRunCommandsOptions, context: ExecutorContext, tuiEnabled: boolean, task: Pick<Task, 'id' | 'ultracache'>);
41
+ constructor(options: NormalizedRunCommandsOptions, context: ExecutorContext, tuiEnabled: boolean, task: Pick<Task, 'id' | 'ultracache'>, baseEnv?: NodeJS.ProcessEnv);
41
42
  private emitExit;
42
43
  getResults(): Promise<{
43
44
  code: number;
@@ -50,4 +51,12 @@ export declare class SeriallyRunningTasks implements RunningTask {
50
51
  private run;
51
52
  private createProcess;
52
53
  }
53
- export declare function runSingleCommandWithPseudoTerminal(normalized: NormalizedRunCommandsOptions, context: ExecutorContext, task: Pick<Task, 'id' | 'ultracache'>): Promise<PseudoTtyProcess>;
54
+ export declare function runSingleCommandWithPseudoTerminal(normalized: NormalizedRunCommandsOptions, context: ExecutorContext, task: Pick<Task, 'id' | 'ultracache'>, baseEnv?: NodeJS.ProcessEnv): Promise<PseudoTtyProcess>;
55
+ export declare function calculateCwd(cwd: string | undefined, context: ExecutorContext): string;
56
+ /**
57
+ * Env variables are processed in the following order:
58
+ * - env option from executor options
59
+ * - env file from envFile option if provided
60
+ * - local env variables, read from `baseEnv`
61
+ */
62
+ export declare function processEnv(color: boolean, cwd: string, envOptionFromExecutor: Record<string, string>, envFile?: string, baseEnv?: NodeJS.ProcessEnv): Record<string, string>;
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SeriallyRunningTasks = exports.ParallelRunningTasks = void 0;
4
4
  exports.runSingleCommandWithPseudoTerminal = runSingleCommandWithPseudoTerminal;
5
+ exports.calculateCwd = calculateCwd;
6
+ exports.processEnv = processEnv;
5
7
  const tslib_1 = require("tslib");
6
8
  const pc = tslib_1.__importStar(require("picocolors"));
7
9
  const child_process_1 = require("child_process");
@@ -10,6 +12,7 @@ const path_1 = require("path");
10
12
  const native_1 = require("../../native");
11
13
  const pseudo_terminal_1 = require("../../tasks-runner/pseudo-terminal");
12
14
  const task_env_1 = require("../../tasks-runner/task-env");
15
+ const tokens_1 = require("../../tasks-runner/tokens");
13
16
  const task_io_service_1 = require("../../tasks-runner/task-io-service");
14
17
  const exit_codes_1 = require("../../utils/exit-codes");
15
18
  const output_1 = require("../../utils/output");
@@ -39,14 +42,14 @@ function commandExitedNonZeroWarning(command) {
39
42
  return `Warning: command "${command}" exited with non-zero status code`;
40
43
  }
41
44
  class ParallelRunningTasks {
42
- constructor(options, context, task) {
45
+ constructor(options, context, task, baseEnv) {
43
46
  this.exitCallbacks = [];
44
47
  this.outputCallbacks = [];
45
48
  // Memoized exit so late getResults()/onExit() callers don't hang.
46
49
  this.exited = false;
47
50
  this.exitCode = 0;
48
51
  this.exitTerminalOutput = '';
49
- this.childProcesses = options.commands.map((commandConfig) => new RunningNodeProcess(commandConfig, options.color, calculateCwd(options.cwd, context), options.env ?? {}, options.readyWhenStatus, options.streamOutput, options.envFile, task));
52
+ this.childProcesses = options.commands.map((commandConfig) => new RunningNodeProcess(commandConfig, options.color, calculateCwd(options.cwd, context), options.env ?? {}, options.readyWhenStatus, options.streamOutput, options.envFile, task, baseEnv));
50
53
  this.readyWhenStatus = options.readyWhenStatus;
51
54
  this.streamOutput = options.streamOutput;
52
55
  this.run();
@@ -156,9 +159,10 @@ class ParallelRunningTasks {
156
159
  }
157
160
  exports.ParallelRunningTasks = ParallelRunningTasks;
158
161
  class SeriallyRunningTasks {
159
- constructor(options, context, tuiEnabled, task) {
162
+ constructor(options, context, tuiEnabled, task, baseEnv) {
160
163
  this.tuiEnabled = tuiEnabled;
161
164
  this.task = task;
165
+ this.baseEnv = baseEnv;
162
166
  this.terminalOutputChunks = [];
163
167
  this.currentProcess = null;
164
168
  this.exitCallbacks = [];
@@ -225,7 +229,7 @@ class SeriallyRunningTasks {
225
229
  }
226
230
  async run(options, context) {
227
231
  for (const c of options.commands) {
228
- const childProcess = await this.createProcess(c, options.color, calculateCwd(options.cwd, context), options.processEnv ?? options.env ?? {}, this.task, options.usePty, options.streamOutput, options.tty, options.envFile);
232
+ const childProcess = await this.createProcess(c, options.color, calculateCwd(options.cwd, context), options.processEnv ?? options.env ?? {}, this.task, options.usePty, options.streamOutput, options.tty, options.envFile, this.baseEnv);
229
233
  this.currentProcess = childProcess;
230
234
  childProcess.onOutput((output) => {
231
235
  for (const cb of this.outputCallbacks) {
@@ -244,7 +248,7 @@ class SeriallyRunningTasks {
244
248
  }
245
249
  }
246
250
  }
247
- async createProcess(commandConfig, color, cwd, env, task, usePty = true, streamOutput = true, tty, envFile) {
251
+ async createProcess(commandConfig, color, cwd, env, task, usePty = true, streamOutput = true, tty, envFile, baseEnv) {
248
252
  // The rust runCommand is always a tty, so it will not look nice in parallel and if we need prefixes
249
253
  // currently does not work properly in windows
250
254
  if (process.env.NX_NATIVE_COMMAND_RUNNER !== 'false' &&
@@ -253,7 +257,7 @@ class SeriallyRunningTasks {
253
257
  pseudo_terminal_1.PseudoTerminal.isSupported()) {
254
258
  const pseudoTerminal = (0, pseudo_terminal_1.createPseudoTerminal)();
255
259
  registerProcessListener(this, pseudoTerminal);
256
- const pseudoTtyProcess = await createProcessWithPseudoTty(pseudoTerminal, commandConfig, color, cwd, env, streamOutput, tty, envFile);
260
+ const pseudoTtyProcess = await createProcessWithPseudoTty(pseudoTerminal, commandConfig, color, cwd, env, streamOutput, tty, envFile, baseEnv);
257
261
  // Register process for metrics collection (direct run-commands execution)
258
262
  // Skip registration if we're in a forked executor - the fork wrapper already registered
259
263
  const pid = pseudoTtyProcess.getPid();
@@ -262,7 +266,7 @@ class SeriallyRunningTasks {
262
266
  }
263
267
  return pseudoTtyProcess;
264
268
  }
265
- return new RunningNodeProcess(commandConfig, color, cwd, env, [], streamOutput, envFile, task);
269
+ return new RunningNodeProcess(commandConfig, color, cwd, env, [], streamOutput, envFile, task, baseEnv);
266
270
  }
267
271
  }
268
272
  exports.SeriallyRunningTasks = SeriallyRunningTasks;
@@ -271,7 +275,7 @@ class RunningNodeProcess {
271
275
  stream(chunk, target = process.stdout) {
272
276
  streamChunk(chunk, this.streamOutput, target);
273
277
  }
274
- constructor(commandConfig, color, cwd, env, readyWhenStatus, streamOutput = true, envFile, task) {
278
+ constructor(commandConfig, color, cwd, env, readyWhenStatus, streamOutput = true, envFile, task, baseEnv) {
275
279
  this.readyWhenStatus = readyWhenStatus;
276
280
  this.streamOutput = streamOutput;
277
281
  this.task = task;
@@ -283,7 +287,7 @@ class RunningNodeProcess {
283
287
  this.exited = false;
284
288
  this.exitCode = 0;
285
289
  this.exitTerminalOutput = '';
286
- env = processEnv(color, cwd, env, envFile);
290
+ env = processEnv(color, cwd, env, envFile, baseEnv);
287
291
  this.command = commandConfig.command;
288
292
  const header = pc.dim('> ') + commandConfig.command + '\r\n\r\n';
289
293
  this.terminalOutputChunks.push(header);
@@ -458,9 +462,9 @@ class RunningNodeProcess {
458
462
  }
459
463
  }
460
464
  }
461
- async function runSingleCommandWithPseudoTerminal(normalized, context, task) {
465
+ async function runSingleCommandWithPseudoTerminal(normalized, context, task, baseEnv) {
462
466
  const pseudoTerminal = (0, pseudo_terminal_1.createPseudoTerminal)();
463
- const pseudoTtyProcess = await createProcessWithPseudoTty(pseudoTerminal, normalized.commands[0], normalized.color, calculateCwd(normalized.cwd, context), normalized.env, normalized.streamOutput, pseudoTerminal ? normalized.isTTY : false, normalized.envFile);
467
+ const pseudoTtyProcess = await createProcessWithPseudoTty(pseudoTerminal, normalized.commands[0], normalized.color, calculateCwd(normalized.cwd, context), normalized.env, normalized.streamOutput, pseudoTerminal ? normalized.isTTY : false, normalized.envFile, baseEnv);
464
468
  // Register process for metrics collection (direct run-commands execution)
465
469
  // Skip registration if we're in a forked executor - the fork wrapper already registered
466
470
  const pid = pseudoTtyProcess.getPid();
@@ -470,10 +474,10 @@ async function runSingleCommandWithPseudoTerminal(normalized, context, task) {
470
474
  registerProcessListener(pseudoTtyProcess, pseudoTerminal);
471
475
  return pseudoTtyProcess;
472
476
  }
473
- async function createProcessWithPseudoTty(pseudoTerminal, commandConfig, color, cwd, env, streamOutput = true, tty, envFile) {
477
+ async function createProcessWithPseudoTty(pseudoTerminal, commandConfig, color, cwd, env, streamOutput = true, tty, envFile, baseEnv) {
474
478
  return pseudoTerminal.runCommand(commandConfig.command, {
475
479
  cwd,
476
- jsEnv: processEnv(color, cwd, env, envFile),
480
+ jsEnv: processEnv(color, cwd, env, envFile, baseEnv),
477
481
  quiet: !streamOutput,
478
482
  tty,
479
483
  });
@@ -511,15 +515,15 @@ function calculateCwd(cwd, context) {
511
515
  * Env variables are processed in the following order:
512
516
  * - env option from executor options
513
517
  * - env file from envFile option if provided
514
- * - local env variables
518
+ * - local env variables, read from `baseEnv`
515
519
  */
516
- function processEnv(color, cwd, envOptionFromExecutor, envFile) {
517
- let localEnv = (0, npm_run_path_1.env)({ cwd: cwd ?? process.cwd() });
520
+ function processEnv(color, cwd, envOptionFromExecutor, envFile, baseEnv = process.env) {
521
+ let localEnv = (0, npm_run_path_1.env)({ cwd: cwd ?? process.cwd(), env: baseEnv });
518
522
  localEnv = {
519
- ...process.env,
523
+ ...baseEnv,
520
524
  ...localEnv,
521
525
  };
522
- if (process.env.NX_LOAD_DOT_ENV_FILES !== 'false' && envFile) {
526
+ if ((0, tokens_1.readEnv)(baseEnv, 'NX_LOAD_DOT_ENV_FILES') !== 'false' && envFile) {
523
527
  loadEnvVarsFile(envFile, localEnv);
524
528
  }
525
529
  let res = {
@@ -128,10 +128,7 @@ function getUnresolvedOutputs(taskId, projectGraph) {
128
128
  ? targetConfig.configurations?.[configuration]
129
129
  : undefined),
130
130
  };
131
- return (targetConfig.outputs ?? []).filter((output) => [...output.matchAll(/\{options\.([^}]+)\}/g)].some(([, key]) => {
132
- const value = key.split('.').reduce((acc, k) => acc?.[k], options);
133
- return value === undefined;
134
- }));
131
+ return (targetConfig.outputs ?? []).filter((output) => /{options.*}/.test((0, utils_1.interpolateOutput)(output, projectNode, options)));
135
132
  }
136
133
  function getTaskGraph(taskId, projectGraph) {
137
134
  const cached = taskGraphCache.get(taskId);
@@ -6,7 +6,6 @@ import { Tree } from '../../generators/tree';
6
6
  * via `cacheableOperations`; Nx 23 removed that derivation and those targets
7
7
  * silently stopped being cacheable.
8
8
  *
9
- * Write the intent into the executor key so it no longer depends on the
10
- * deprecated fallback that restores the old behavior at run time.
9
+ * Write the intent into the executor key, which is where Nx reads `cache` from.
11
10
  */
12
11
  export default function update(tree: Tree): Promise<void>;
@@ -6,9 +6,6 @@ const format_changed_files_1 = require("../../generators/internal-utils/format-c
6
6
  const json_1 = require("../../generators/utils/json");
7
7
  const project_configuration_1 = require("../../generators/utils/project-configuration");
8
8
  const path_1 = require("../../utils/path");
9
- // TODO(v24): remove this migration alongside the runtime fallback it exists to
10
- // retire (`isLegacyCachedTarget` in `target-normalization.ts`), along with its
11
- // registration in `packages/nx/migrations.json`.
12
9
  /**
13
10
  * Target defaults resolve to a single key rather than merging, so an executor
14
11
  * key hides the target name key entirely. Before Nx 23 a hidden `cache: true`
@@ -16,8 +13,7 @@ const path_1 = require("../../utils/path");
16
13
  * via `cacheableOperations`; Nx 23 removed that derivation and those targets
17
14
  * silently stopped being cacheable.
18
15
  *
19
- * Write the intent into the executor key so it no longer depends on the
20
- * deprecated fallback that restores the old behavior at run time.
16
+ * Write the intent into the executor key, which is where Nx reads `cache` from.
21
17
  */
22
18
  async function update(tree) {
23
19
  const nxJson = (0, project_configuration_1.readNxJson)(tree);
@@ -77,8 +73,8 @@ async function update(tree) {
77
73
  * `targets` — including any that is continuous, which makes `nx.json` fail graph
78
74
  * construction outright. The key is only safe when every target through it
79
75
  * independently wants caching and none of them can be continuous. Anything else
80
- * is left to the runtime fallback, which decides per target after normalization
81
- * and can therefore see continuity this migration cannot.
76
+ * is left unchanged, so those targets stay uncached until someone sets `cache`
77
+ * on the key by hand.
82
78
  */
83
79
  function canEnableCache(targetDefaults, key, targets, workspaceRoot, projectsMap) {
84
80
  // Targets written with `command` are rewritten to `nx:run-commands` and
@@ -126,9 +122,9 @@ function canEnableCache(targetDefaults, key, targets, workspaceRoot, projectsMap
126
122
  }
127
123
  /**
128
124
  * Whether the target name key declares `cache: true` on an entry that always
129
- * applies. Mirrors `declaresCacheTrue` in `target-normalization.ts`: a filtered
130
- * entry declaring `cache` makes the value unknowable without project context,
131
- * so nothing is claimed. Among unfiltered entries the last wins.
125
+ * applies. A filtered entry declaring `cache` makes the value unknowable
126
+ * without project context, so nothing is claimed. Among unfiltered entries the
127
+ * last wins.
132
128
  */
133
129
  function declaresCacheTrue(value) {
134
130
  if (!value) {
@@ -239,7 +235,6 @@ function executorDeclaresContinuous(executor, workspaceRoot, projectsMap) {
239
235
  }
240
236
  /**
241
237
  * Target names the pre-23 `longRunningTask` guard excluded from caching.
242
- * Mirrors `isLongRunningTarget` in `target-normalization.ts`.
243
238
  */
244
239
  function isLongRunningTargetName(targetName) {
245
240
  return (targetName.endsWith(':watch') ||
@@ -8,9 +8,9 @@ This migration copies `cache` onto each executor key that applies to a target wh
8
8
 
9
9
  An executor key applies to every target that resolves through it, so the migration updates a key only when it can establish that caching is right for all of them. It leaves the key unchanged when the key already declares `cache`, when it declares `continuous: true`, when every entry on the key is filtered so none of them always applies, when a target through it is continuous or is a long-running target such as `serve`, `dev`, or `start`, when the executor's own schema marks its targets continuous, or when a target through it has no target name key enabling `cache`. It never updates the `nx:run-commands` or `nx:run-script` keys, because targets written with `command` and targets derived from `package.json` scripts resolve through those keys without naming them.
10
10
 
11
- Where the migration makes no change, Nx still decides at run time, per target rather than per key: a target whose target name key enables `cache`, and whose resolved configuration still leaves `cache` undefined, gets it back and is reported as a deprecated fallback. Because that test is applied to the resolved target rather than to the key, it also covers the cases where a key looks decided but is not for this project — an executor key whose entries are all filtered, or whose only `cache` declaration is filtered out here. It equally covers the targets left behind because a sibling target through the same key does not opt in, and the targets reaching the `nx:run-commands` and `nx:run-script` keys. Three cases get no fallback and no warning. A continuous or long-running target, because caching it is invalid. A target whose resolved configuration already sets `cache`. And a target whose target name key was discarded as incompatible, because its entry named an executor the target does not use — before Nx 23 that target was cacheable, since cacheability was matched on target name alone and the entry's `executor` was never read. Restoring it here would mean setting `cache` with no executor key to point the user at and no migration able to retire the behavior, so it is deliberately left alone. Set `cache` on those targets directly.
11
+ Where the migration makes no change, the targets resolving through that key are not cached. Nx 24 reads `cache` from the key that wins resolution and nothing else, so `cache` on a target name key has no effect once an executor key applies. That leaves the keys the migration skips, the keys whose only `cache` declaration is filtered, the targets passed over because a sibling target through the same key does not opt in, and the targets reaching the `nx:run-commands` and `nx:run-script` keys. Set `cache` on the key those targets resolve through, or on the targets themselves.
12
12
 
13
- Targets are read from each project's `project.json` and from the `nx.targets` block of its `package.json`. Targets inferred by a plugin, and targets derived from `package.json` scripts, are not visible to the migration — the latter is why the `nx:run-script` key is never updated. A key that looks safe here may still serve an inferred target. Set `cache` on the executor key by hand only after checking that no target reaching it is continuous; Nx rejects a target that is both cacheable and continuous. Nx names both keys in a run-time warning. That warning is emitted during project graph construction, so while the daemon is running it goes to `.nx/workspace-data/d/daemon.log` rather than the terminal; CI runs, where the daemon is disabled, print it normally.
13
+ Targets are read from each project's `project.json` and from the `nx.targets` block of its `package.json`. Targets inferred by a plugin, and targets derived from `package.json` scripts, are not visible to the migration — the latter is why the `nx:run-script` key is never updated. A key that looks safe here may still serve an inferred target. Set `cache` on the executor key by hand only after checking that no target reaching it is continuous; Nx rejects a target that is both cacheable and continuous.
14
14
 
15
15
  #### Sample code changes
16
16
 
@@ -0,0 +1,4 @@
1
+ import type { Tree } from '../../generators/tree';
2
+ export default function enableLegacyAffected(tree: Tree): Promise<{
3
+ skipAgentic: boolean;
4
+ }>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = enableLegacyAffected;
4
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
5
+ const nx_json_1 = require("../../generators/utils/nx-json");
6
+ async function enableLegacyAffected(tree) {
7
+ const nxJson = (0, nx_json_1.readNxJson)(tree);
8
+ if (!nxJson || nxJson.affected?.legacy !== undefined) {
9
+ return { skipAgentic: true };
10
+ }
11
+ nxJson.affected = { ...nxJson.affected, legacy: true };
12
+ (0, nx_json_1.updateNxJson)(tree, nxJson);
13
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
14
+ return { skipAgentic: true };
15
+ }
@@ -0,0 +1,30 @@
1
+ #### Keep legacy `nx affected` selection
2
+
3
+ In Nx 24, `nx affected -t` selects only the tasks whose inputs a change reaches, instead of every task of each affected project.
4
+ This migration sets `affected.legacy` to `true` in `nx.json`, so existing workspaces keep selecting whole projects after upgrading.
5
+
6
+ To switch to task selection, remove the setting or set it to `false`.
7
+ The `NX_LEGACY_AFFECTED` environment variable overrides the setting for a single run: `false` selects tasks and `true` selects projects.
8
+
9
+ The migration skips workspaces that already set `affected.legacy`.
10
+
11
+ #### Sample code changes
12
+
13
+ ##### Before
14
+
15
+ ```json title="nx.json"
16
+ {
17
+ "defaultBase": "main"
18
+ }
19
+ ```
20
+
21
+ ##### After
22
+
23
+ ```json title="nx.json"
24
+ {
25
+ "defaultBase": "main",
26
+ "affected": {
27
+ "legacy": true
28
+ }
29
+ }
30
+ ```
@@ -6,10 +6,11 @@ that hash the same things, so the targets keep caching correctly once the hasher
6
6
  is gone.
7
7
 
8
8
  The generator half of this migration only scans. It edits no files, and it lists
9
- every executor that declares a hasher in the advisory context, one line each,
10
- with the executor name, the hasher path, and the `executors.json` path. Lines
11
- starting with `Could not parse` name files the scan skipped, and lines starting
12
- with `Entry` name executor entries it could not read.
9
+ every executor that declares a hasher in the `impl.agentContext` field of the
10
+ step's `nx_migrate_prompt` block, one line each, with the executor name, the
11
+ hasher path, and the `executors.json` path. Lines starting with
12
+ `Could not parse` name files the scan skipped, and lines starting with `Entry`
13
+ name executor entries it could not read.
13
14
 
14
15
  Do not touch executors that declare no hasher, executors installed from
15
16
  `node_modules`, or any other caching configuration.
@@ -18,13 +19,13 @@ Do not touch executors that declare no hasher, executors installed from
18
19
 
19
20
  Confirm this before changing anything. If it fails, make no changes and stop:
20
21
 
21
- 1. The advisory context lists at least one executor that declares a custom
22
+ 1. `impl.agentContext` lists at least one executor that declares a custom
22
23
  hasher, or at least one file or entry it could not read. Read each of those
23
24
  yourself; if it declares no `hasher`, drop it from the list.
24
25
 
25
26
  ## Step 1: Read what each hasher hashes
26
27
 
27
- Open the hasher module named in the advisory context. Work out every value it
28
+ Open the hasher module named in `impl.agentContext`. Work out every value it
28
29
  feeds into the hash it returns:
29
30
 
30
31
  - `context.hasher.hashTask(task, ...)` alone is Nx default hashing.
@@ -0,0 +1,3 @@
1
+ import type { MigrationReturnObject } from '../../config/misc-interfaces';
2
+ import type { Tree } from '../../generators/tree';
3
+ export default function update(tree: Tree): Promise<MigrationReturnObject>;
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = update;
4
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
5
+ const project_configuration_1 = require("../../generators/utils/project-configuration");
6
+ const RENAMED_ULTRACACHE_KEYS = new Map([
7
+ ['ignoredReads', 'ignoreReads'],
8
+ ['ignoredWrites', 'ignoreWrites'],
9
+ ]);
10
+ const WORKFLOWS_DIR = '.nx/workflows';
11
+ const CONFIG_EXTENSIONS = ['yaml', 'yml'];
12
+ const OLD_CONFIG_PATH = /(\.nx\/workflows\/)sandboxing-config\.(ya?ml)/g;
13
+ // Matches a block-style key at the start of a line or after a sequence dash,
14
+ // optionally quoted. Comments and values are left alone.
15
+ const OLD_YAML_KEY = /^(\s*(?:-\s+)?)(['"]?)exclude-(reads|writes)\2(\s*:)/gm;
16
+ async function update(tree) {
17
+ const manual = [];
18
+ for (const [name, project] of (0, project_configuration_1.getProjects)(tree)) {
19
+ let changed = false;
20
+ for (const target of Object.values(project.targets ?? {})) {
21
+ changed = renameUltracacheKeys(target) || changed;
22
+ }
23
+ const rewritten = rewriteConfigPaths(project);
24
+ if (changed || rewritten !== project) {
25
+ (0, project_configuration_1.updateProjectConfiguration)(tree, name, rewritten);
26
+ }
27
+ }
28
+ const nxJson = (0, project_configuration_1.readNxJson)(tree);
29
+ if (nxJson) {
30
+ let changed = false;
31
+ for (const value of Object.values(nxJson.targetDefaults ?? {})) {
32
+ for (const entry of targetDefaultEntries(value)) {
33
+ changed = renameUltracacheKeys(entry) || changed;
34
+ }
35
+ }
36
+ const rewritten = rewriteConfigPaths(nxJson);
37
+ if (changed || rewritten !== nxJson) {
38
+ (0, project_configuration_1.updateNxJson)(tree, rewritten);
39
+ }
40
+ }
41
+ manual.push(...renameWorkspaceConfig(tree));
42
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
43
+ if (manual.length === 0) {
44
+ return { skipAgentic: true };
45
+ }
46
+ return { nextSteps: manual, agentContext: manual };
47
+ }
48
+ function targetDefaultEntries(value) {
49
+ return Array.isArray(value) ? value : [value];
50
+ }
51
+ function renameUltracacheKeys(target) {
52
+ const ultracache = target?.ultracache;
53
+ if (!ultracache ||
54
+ typeof ultracache !== 'object' ||
55
+ !Object.keys(ultracache).some((key) => RENAMED_ULTRACACHE_KEYS.has(key))) {
56
+ return false;
57
+ }
58
+ const renamed = {};
59
+ for (const [key, value] of Object.entries(ultracache)) {
60
+ const newKey = RENAMED_ULTRACACHE_KEYS.get(key) ?? key;
61
+ renamed[newKey] = mergePatterns(renamed[newKey], value);
62
+ }
63
+ target.ultracache = renamed;
64
+ return true;
65
+ }
66
+ // A target may already declare the new key beside the old one; keep both sets.
67
+ function mergePatterns(existing, incoming) {
68
+ if (existing === undefined) {
69
+ return incoming;
70
+ }
71
+ if (!Array.isArray(existing) || !Array.isArray(incoming)) {
72
+ return incoming;
73
+ }
74
+ return [...existing, ...incoming.filter((p) => !existing.includes(p))];
75
+ }
76
+ // Returns the same reference when nothing changed.
77
+ function rewriteConfigPaths(value) {
78
+ if (typeof value === 'string') {
79
+ const replaced = value.replace(OLD_CONFIG_PATH, '$1ultracache-config.$2');
80
+ return (replaced === value ? value : replaced);
81
+ }
82
+ if (Array.isArray(value)) {
83
+ const mapped = value.map(rewriteConfigPaths);
84
+ return (mapped.some((v, i) => v !== value[i]) ? mapped : value);
85
+ }
86
+ if (value && typeof value === 'object') {
87
+ let changed = false;
88
+ const mapped = {};
89
+ for (const [key, v] of Object.entries(value)) {
90
+ mapped[key] = rewriteConfigPaths(v);
91
+ changed ||= mapped[key] !== v;
92
+ }
93
+ return (changed ? mapped : value);
94
+ }
95
+ return value;
96
+ }
97
+ function renameWorkspaceConfig(tree) {
98
+ const existingNew = CONFIG_EXTENSIONS.map((ext) => `${WORKFLOWS_DIR}/ultracache-config.${ext}`).filter((path) => tree.exists(path));
99
+ const manual = [];
100
+ for (const ext of CONFIG_EXTENSIONS) {
101
+ const oldPath = `${WORKFLOWS_DIR}/sandboxing-config.${ext}`;
102
+ if (!tree.exists(oldPath)) {
103
+ continue;
104
+ }
105
+ if (existingNew.length > 0) {
106
+ manual.push(`Both "${oldPath}" and "${existingNew[0]}" exist. Nx Cloud reads only "${existingNew[0]}", so merge the patterns from "${oldPath}" into it and delete "${oldPath}".`);
107
+ continue;
108
+ }
109
+ const newPath = `${WORKFLOWS_DIR}/ultracache-config.${ext}`;
110
+ tree.rename(oldPath, newPath);
111
+ existingNew.push(newPath);
112
+ }
113
+ for (const path of existingNew) {
114
+ const content = tree.read(path, 'utf-8') ?? '';
115
+ const updated = content.replace(OLD_YAML_KEY, '$1$2ignore-$3$2$4');
116
+ if (updated !== content) {
117
+ tree.write(path, updated);
118
+ }
119
+ if (hasOldYamlKey(updated)) {
120
+ manual.push(`"${path}" still uses "exclude-reads" or "exclude-writes" in a form the migration could not rewrite. Rename them to "ignore-reads" and "ignore-writes".`);
121
+ }
122
+ }
123
+ return manual;
124
+ }
125
+ function hasOldYamlKey(content) {
126
+ return content
127
+ .split('\n')
128
+ .map((line) => line.replace(/#.*$/, ''))
129
+ .some((line) => /['"]?exclude-(reads|writes)['"]?\s*:/.test(line));
130
+ }
@@ -0,0 +1,62 @@
1
+ #### Rename ultracache ignore options
2
+
3
+ Nx 24 renames the `ultracache` target options `ignoredReads` and `ignoredWrites` to `ignoreReads` and `ignoreWrites`.
4
+ The workspace-wide exclusions file moves from `.nx/workflows/sandboxing-config.yaml` to `.nx/workflows/ultracache-config.yaml`, and its `exclude-reads` and `exclude-writes` keys become `ignore-reads` and `ignore-writes`.
5
+
6
+ This migration renames the options in every target in `project.json` files, in the `nx` block of `package.json` files, and in `targetDefaults` in `nx.json`.
7
+ When a target sets both the old and the new option, it combines their patterns under the new one.
8
+ It renames `.nx/workflows/sandboxing-config.yaml` (or `.yml`) and the keys inside it, including those in `task-exclusions` entries.
9
+ It also updates any `inputs` or `namedInputs` entry that points at the old file.
10
+
11
+ If `.nx/workflows/ultracache-config.yaml` already exists, the migration leaves both files in place and lists them in its next steps so you can merge them by hand.
12
+ It does the same when the file writes those keys in a form it can't rewrite, such as an inline `{ }` map.
13
+
14
+ #### Sample code changes
15
+
16
+ ##### Before
17
+
18
+ ```json title="apps/app/project.json"
19
+ {
20
+ "targets": {
21
+ "build": {
22
+ "ultracache": {
23
+ "ignoredReads": ["tmp/**"],
24
+ "ignoredWrites": ["**/.cache/**"]
25
+ }
26
+ }
27
+ }
28
+ }
29
+ ```
30
+
31
+ ```yaml title=".nx/workflows/sandboxing-config.yaml"
32
+ exclude-reads:
33
+ - 'dist/**'
34
+ task-exclusions:
35
+ - target: lint
36
+ exclude-writes:
37
+ - .eslintcache/**
38
+ ```
39
+
40
+ ##### After
41
+
42
+ ```json title="apps/app/project.json"
43
+ {
44
+ "targets": {
45
+ "build": {
46
+ "ultracache": {
47
+ "ignoreReads": ["tmp/**"],
48
+ "ignoreWrites": ["**/.cache/**"]
49
+ }
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ ```yaml title=".nx/workflows/ultracache-config.yaml"
56
+ ignore-reads:
57
+ - 'dist/**'
58
+ task-exclusions:
59
+ - target: lint
60
+ ignore-writes:
61
+ - .eslintcache/**
62
+ ```