nx 21.6.4 → 21.6.6

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 (74) hide show
  1. package/bin/nx.js +3 -0
  2. package/migrations.json +37 -0
  3. package/package.json +11 -11
  4. package/release/changelog-renderer/index.d.ts +1 -0
  5. package/release/changelog-renderer/index.d.ts.map +1 -1
  6. package/release/changelog-renderer/index.js +46 -15
  7. package/schemas/nx-schema.json +79 -0
  8. package/src/command-line/nx-cloud/complete-run/command-object.d.ts +3 -0
  9. package/src/command-line/nx-cloud/complete-run/command-object.d.ts.map +1 -0
  10. package/src/command-line/nx-cloud/complete-run/command-object.js +16 -0
  11. package/src/command-line/nx-cloud/complete-run/stop-all-agents.d.ts +5 -0
  12. package/src/command-line/nx-cloud/complete-run/stop-all-agents.d.ts.map +1 -0
  13. package/src/command-line/nx-cloud/complete-run/stop-all-agents.js +7 -0
  14. package/src/command-line/nx-cloud/start-agent/command-object.d.ts +3 -0
  15. package/src/command-line/nx-cloud/start-agent/command-object.d.ts.map +1 -0
  16. package/src/command-line/nx-cloud/start-agent/command-object.js +15 -0
  17. package/src/command-line/nx-cloud/start-agent/start-agent.d.ts +5 -0
  18. package/src/command-line/nx-cloud/start-agent/start-agent.d.ts.map +1 -0
  19. package/src/command-line/nx-cloud/start-agent/start-agent.js +7 -0
  20. package/src/command-line/nx-cloud/start-ci-run/command-object.js +1 -1
  21. package/src/command-line/nx-commands.d.ts.map +1 -1
  22. package/src/command-line/nx-commands.js +12 -8
  23. package/src/core/graph/main.js +1 -1
  24. package/src/daemon/client/client.d.ts +4 -0
  25. package/src/daemon/client/client.d.ts.map +1 -1
  26. package/src/daemon/client/client.js +23 -0
  27. package/src/daemon/message-types/register-project-graph-listener.d.ts +6 -0
  28. package/src/daemon/message-types/register-project-graph-listener.d.ts.map +1 -0
  29. package/src/daemon/message-types/register-project-graph-listener.js +11 -0
  30. package/src/daemon/server/project-graph-incremental-recomputation.d.ts +3 -1
  31. package/src/daemon/server/project-graph-incremental-recomputation.d.ts.map +1 -1
  32. package/src/daemon/server/project-graph-incremental-recomputation.js +13 -5
  33. package/src/daemon/server/project-graph-listener-sockets.d.ts +8 -0
  34. package/src/daemon/server/project-graph-listener-sockets.d.ts.map +1 -0
  35. package/src/daemon/server/project-graph-listener-sockets.js +24 -0
  36. package/src/daemon/server/server.d.ts.map +1 -1
  37. package/src/daemon/server/server.js +9 -2
  38. package/src/generators/utils/project-configuration.js +13 -1
  39. package/src/migrations/update-15-0-0/prefix-outputs.d.ts +3 -0
  40. package/src/migrations/update-15-0-0/prefix-outputs.d.ts.map +1 -0
  41. package/src/migrations/update-15-0-0/prefix-outputs.js +49 -0
  42. package/src/migrations/update-16-0-0/remove-nrwl-cli.d.ts +3 -0
  43. package/src/migrations/update-16-0-0/remove-nrwl-cli.d.ts.map +1 -0
  44. package/src/migrations/update-16-0-0/remove-nrwl-cli.js +16 -0
  45. package/src/migrations/update-16-0-0/update-depends-on-to-tokens.d.ts +3 -0
  46. package/src/migrations/update-16-0-0/update-depends-on-to-tokens.d.ts.map +1 -0
  47. package/src/migrations/update-16-0-0/update-depends-on-to-tokens.js +97 -0
  48. package/src/migrations/update-16-0-0/update-nx-cloud-runner.d.ts +3 -0
  49. package/src/migrations/update-16-0-0/update-nx-cloud-runner.d.ts.map +1 -0
  50. package/src/migrations/update-16-0-0/update-nx-cloud-runner.js +29 -0
  51. package/src/migrations/update-16-2-0/remove-run-commands-output-path.d.ts +3 -0
  52. package/src/migrations/update-16-2-0/remove-run-commands-output-path.d.ts.map +1 -0
  53. package/src/migrations/update-16-2-0/remove-run-commands-output-path.js +45 -0
  54. package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.d.ts +13 -0
  55. package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.d.ts.map +1 -0
  56. package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.js +67 -0
  57. package/src/native/nx.wasm32-wasi.wasm +0 -0
  58. package/src/plugins/package-json/create-nodes.js +1 -1
  59. package/src/plugins/project-json/build-nodes/project-json.d.ts +0 -1
  60. package/src/plugins/project-json/build-nodes/project-json.d.ts.map +1 -1
  61. package/src/plugins/project-json/build-nodes/project-json.js +1 -13
  62. package/src/project-graph/utils/project-configuration-utils.d.ts.map +1 -1
  63. package/src/project-graph/utils/project-configuration-utils.js +9 -0
  64. package/src/tasks-runner/is-tui-enabled.d.ts.map +1 -1
  65. package/src/tasks-runner/is-tui-enabled.js +0 -1
  66. package/src/tasks-runner/life-cycles/task-history-life-cycle-old.d.ts.map +1 -1
  67. package/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +8 -2
  68. package/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts.map +1 -1
  69. package/src/tasks-runner/life-cycles/task-history-life-cycle.js +8 -2
  70. package/src/tasks-runner/life-cycles/tui-summary-life-cycle.d.ts +1 -1
  71. package/src/tasks-runner/life-cycles/tui-summary-life-cycle.d.ts.map +1 -1
  72. package/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +83 -55
  73. package/src/tasks-runner/run-command.d.ts.map +1 -1
  74. package/src/tasks-runner/run-command.js +3 -0
@@ -43,6 +43,10 @@ export declare class DaemonClient {
43
43
  changedProjects: string[];
44
44
  changedFiles: ChangedFile[];
45
45
  } | null) => void): Promise<UnregisterCallback>;
46
+ registerProjectGraphRecomputationListener(callback: (error: Error | null | 'closed', data: {
47
+ projectGraph: ProjectGraph;
48
+ sourceMaps: ConfigurationSourceMaps;
49
+ } | null) => void): Promise<UnregisterCallback>;
46
50
  processInBackground(requirePath: string, data: any): Promise<any>;
47
51
  recordOutputsHash(outputs: string[], hash: string): Promise<any>;
48
52
  outputsHashesMatch(outputs: string[], hash: string): Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/client/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAS,MAAM,eAAe,CAAC;AAoBpD,O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Q,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAQlD,uBAAuB,CACrB,UAAU,EAAE,MAAM,EAAE,GACnB,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAQpC,+BAA+B,CAC7B,UAAU,EAAE,MAAM,EAAE,GACnB,OAAO,CAAC,+BAA+B,CAAC;IAQ3C,2BAA2B,IAAI,OAAO,CAAC;QACrC,gBAAgB,EAAE,MAAM,EAAE,CAAC;QAC3B,cAAc,EAAE,MAAM,EAAE,CAAC;KAC1B,CAAC;IAOF,sBAAsB,CACpB,YAAY,EAAE,MAAM,EAAE,EACtB,YAAY,EAAE,MAAM,EAAE,EACtB,YAAY,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,IAAI,CAAC;IAUV,oBAAoB,CACxB,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IAQzB,qBAAqB,CACzB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,IAAI,CAAC;IAQV,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC;YAgB7B,oBAAoB;IAMlC,OAAO,CAAC,eAAe;YA8DT,mBAAmB;IA8BjC,OAAO,CAAC,gCAAgC;IAyBxC,OAAO,CAAC,aAAa;IAgDf,iBAAiB,IAAI,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAwDjD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAkB5B;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC;AAE/C,wBAAgB,eAAe,YAE9B"}
@@ -31,6 +31,7 @@ const update_workspace_context_1 = require("../message-types/update-workspace-co
31
31
  const flush_sync_generator_changes_to_disk_1 = require("../message-types/flush-sync-generator-changes-to-disk");
32
32
  const delayed_spinner_1 = require("../../utils/delayed-spinner");
33
33
  const run_tasks_execution_hooks_1 = require("../message-types/run-tasks-execution-hooks");
34
+ const register_project_graph_listener_1 = require("../message-types/register-project-graph-listener");
34
35
  const DAEMON_ENV_SETTINGS = {
35
36
  NX_PROJECT_GLOB_CACHE: 'false',
36
37
  NX_CACHE_PROJECTS_CONFIG: 'false',
@@ -184,6 +185,28 @@ class DaemonClient {
184
185
  messenger?.close();
185
186
  };
186
187
  }
188
+ async registerProjectGraphRecomputationListener(callback) {
189
+ let messenger;
190
+ await this.queue.sendToQueue(() => {
191
+ messenger = new daemon_socket_messenger_1.DaemonSocketMessenger((0, net_1.connect)((0, socket_utils_1.getFullOsSocketPath)())).listen((message) => {
192
+ try {
193
+ const parsedMessage = JSON.parse(message);
194
+ callback(null, parsedMessage);
195
+ }
196
+ catch (e) {
197
+ callback(e, null);
198
+ }
199
+ }, () => {
200
+ callback('closed', null);
201
+ }, (err) => callback(err, null));
202
+ return messenger.sendMessage({
203
+ type: register_project_graph_listener_1.REGISTER_PROJECT_GRAPH_LISTENER,
204
+ });
205
+ });
206
+ return () => {
207
+ messenger?.close();
208
+ };
209
+ }
187
210
  processInBackground(requirePath, data) {
188
211
  return this.sendToDaemonViaQueue({
189
212
  type: 'PROCESS_IN_BACKGROUND',
@@ -0,0 +1,6 @@
1
+ export declare const REGISTER_PROJECT_GRAPH_LISTENER = "REGISTER_PROJECT_GRAPH_LISTENER";
2
+ export type RegisterProjectGraphListenerMessage = {
3
+ type: typeof REGISTER_PROJECT_GRAPH_LISTENER;
4
+ };
5
+ export declare function isRegisterProjectGraphListenerMessage(message: unknown): message is RegisterProjectGraphListenerMessage;
6
+ //# sourceMappingURL=register-project-graph-listener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-project-graph-listener.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/message-types/register-project-graph-listener.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,oCACT,CAAC;AAEpC,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,OAAO,+BAA+B,CAAC;CAC9C,CAAC;AAEF,wBAAgB,qCAAqC,CACnD,OAAO,EAAE,OAAO,GACf,OAAO,IAAI,mCAAmC,CAOhD"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REGISTER_PROJECT_GRAPH_LISTENER = void 0;
4
+ exports.isRegisterProjectGraphListenerMessage = isRegisterProjectGraphListenerMessage;
5
+ exports.REGISTER_PROJECT_GRAPH_LISTENER = 'REGISTER_PROJECT_GRAPH_LISTENER';
6
+ function isRegisterProjectGraphListenerMessage(message) {
7
+ return (typeof message === 'object' &&
8
+ message !== null &&
9
+ 'type' in message &&
10
+ message['type'] === exports.REGISTER_PROJECT_GRAPH_LISTENER);
11
+ }
@@ -1,6 +1,7 @@
1
1
  import { FileData, FileMap, ProjectGraph } from '../../config/project-graph';
2
2
  import { FileMapCache } from '../../project-graph/nx-deps-cache';
3
3
  import { NxWorkspaceFilesExternals } from '../../native';
4
+ import { ConfigurationSourceMaps } from '../../project-graph/utils/project-configuration-utils';
4
5
  interface SerializedProjectGraph {
5
6
  error: Error | null;
6
7
  projectGraph: ProjectGraph | null;
@@ -9,6 +10,7 @@ interface SerializedProjectGraph {
9
10
  allWorkspaceFiles: FileData[] | null;
10
11
  serializedProjectGraph: string | null;
11
12
  serializedSourceMaps: string | null;
13
+ sourceMaps: ConfigurationSourceMaps | null;
12
14
  rustReferences: NxWorkspaceFilesExternals | null;
13
15
  }
14
16
  export declare let fileMapWithFiles: {
@@ -20,6 +22,6 @@ export declare let currentProjectFileMapCache: FileMapCache | undefined;
20
22
  export declare let currentProjectGraph: ProjectGraph | undefined;
21
23
  export declare function getCachedSerializedProjectGraphPromise(): Promise<SerializedProjectGraph>;
22
24
  export declare function addUpdatedAndDeletedFiles(createdFiles: string[], updatedFiles: string[], deletedFiles: string[]): void;
23
- export declare function registerProjectGraphRecomputationListener(listener: (projectGraph: ProjectGraph) => void): void;
25
+ export declare function registerProjectGraphRecomputationListener(listener: (projectGraph: ProjectGraph, sourceMaps: ConfigurationSourceMaps) => void): void;
24
26
  export {};
25
27
  //# sourceMappingURL=project-graph-incremental-recomputation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"project-graph-incremental-recomputation.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/server/project-graph-incremental-recomputation.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EACR,OAAO,EACP,YAAY,EAEb,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EACL,YAAY,EAIb,MAAM,mCAAmC,CAAC;AAa3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAUzD,UAAU,sBAAsB;IAC9B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,mBAAmB,EAAE,YAAY,GAAG,IAAI,CAAC;IACzC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,iBAAiB,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IACrC,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,cAAc,EAAE,yBAAyB,GAAG,IAAI,CAAC;CAClD;AAGD,eAAO,IAAI,gBAAgB,EACvB;IACE,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,QAAQ,EAAE,CAAC;IAC9B,cAAc,EAAE,yBAAyB,CAAC;CAC3C,GACD,SAAS,CAAC;AACd,eAAO,IAAI,0BAA0B,EAAE,YAAY,GAAG,SAAS,CAAC;AAChE,eAAO,IAAI,mBAAmB,EAAE,YAAY,GAAG,SAAS,CAAC;AAYzD,wBAAsB,sCAAsC,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAoD9F;AAED,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,MAAM,EAAE,EACtB,YAAY,EAAE,MAAM,EAAE,EACtB,YAAY,EAAE,MAAM,EAAE,QAsCvB;AAED,wBAAgB,yCAAyC,CACvD,QAAQ,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,QAG/C"}
1
+ {"version":3,"file":"project-graph-incremental-recomputation.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/server/project-graph-incremental-recomputation.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EACR,OAAO,EACP,YAAY,EAEb,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EACL,YAAY,EAIb,MAAM,mCAAmC,CAAC;AAc3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAEL,uBAAuB,EACxB,MAAM,uDAAuD,CAAC;AAS/D,UAAU,sBAAsB;IAC9B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,mBAAmB,EAAE,YAAY,GAAG,IAAI,CAAC;IACzC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,iBAAiB,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IACrC,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,UAAU,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC3C,cAAc,EAAE,yBAAyB,GAAG,IAAI,CAAC;CAClD;AAGD,eAAO,IAAI,gBAAgB,EACvB;IACE,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,QAAQ,EAAE,CAAC;IAC9B,cAAc,EAAE,yBAAyB,CAAC;CAC3C,GACD,SAAS,CAAC;AACd,eAAO,IAAI,0BAA0B,EAAE,YAAY,GAAG,SAAS,CAAC;AAChE,eAAO,IAAI,mBAAmB,EAAE,YAAY,GAAG,SAAS,CAAC;AAYzD,wBAAsB,sCAAsC,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAwD9F;AAED,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,MAAM,EAAE,EACtB,YAAY,EAAE,MAAM,EAAE,EACtB,YAAY,EAAE,MAAM,EAAE,QAuCvB;AAED,wBAAgB,yCAAyC,CACvD,QAAQ,EAAE,CACR,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,uBAAuB,KAChC,IAAI,QAGV"}
@@ -15,6 +15,7 @@ const fileutils_1 = require("../../utils/fileutils");
15
15
  const workspace_context_1 = require("../../utils/workspace-context");
16
16
  const workspace_root_1 = require("../../utils/workspace-root");
17
17
  const file_watcher_sockets_1 = require("./file-watching/file-watcher-sockets");
18
+ const project_graph_listener_sockets_1 = require("./project-graph-listener-sockets");
18
19
  const logger_1 = require("./logger");
19
20
  const error_types_1 = require("../../project-graph/error-types");
20
21
  const get_plugins_1 = require("../../project-graph/plugins/get-plugins");
@@ -56,7 +57,7 @@ async function getCachedSerializedProjectGraphPromise() {
56
57
  }
57
58
  const result = await cachedSerializedProjectGraphPromise;
58
59
  if (wasScheduled) {
59
- notifyProjectGraphRecomputationListeners(result.projectGraph);
60
+ notifyProjectGraphRecomputationListeners(result.projectGraph, result.sourceMaps);
60
61
  }
61
62
  return result;
62
63
  }
@@ -65,6 +66,7 @@ async function getCachedSerializedProjectGraphPromise() {
65
66
  error: e,
66
67
  serializedProjectGraph: null,
67
68
  serializedSourceMaps: null,
69
+ sourceMaps: null,
68
70
  projectGraph: null,
69
71
  projectFileMapCache: null,
70
72
  fileMap: null,
@@ -96,11 +98,11 @@ function addUpdatedAndDeletedFiles(createdFiles, updatedFiles, deletedFiles) {
96
98
  }
97
99
  cachedSerializedProjectGraphPromise =
98
100
  processFilesAndCreateAndSerializeProjectGraph(await (0, get_plugins_1.getPlugins)());
99
- const { projectGraph } = await cachedSerializedProjectGraphPromise;
101
+ const { projectGraph, sourceMaps } = await cachedSerializedProjectGraphPromise;
100
102
  if (createdFiles.length > 0) {
101
103
  (0, file_watcher_sockets_1.notifyFileWatcherSockets)(createdFiles, null, null);
102
104
  }
103
- notifyProjectGraphRecomputationListeners(projectGraph);
105
+ notifyProjectGraphRecomputationListeners(projectGraph, sourceMaps);
104
106
  }, waitPeriod);
105
107
  }
106
108
  }
@@ -191,6 +193,7 @@ async function processFilesAndCreateAndSerializeProjectGraph(plugins) {
191
193
  allWorkspaceFiles: null,
192
194
  serializedProjectGraph: null,
193
195
  serializedSourceMaps: null,
196
+ sourceMaps: null,
194
197
  };
195
198
  }
196
199
  }
@@ -205,6 +208,7 @@ async function processFilesAndCreateAndSerializeProjectGraph(plugins) {
205
208
  allWorkspaceFiles: null,
206
209
  serializedProjectGraph: null,
207
210
  serializedSourceMaps: null,
211
+ sourceMaps: null,
208
212
  };
209
213
  }
210
214
  else {
@@ -221,6 +225,7 @@ async function processFilesAndCreateAndSerializeProjectGraph(plugins) {
221
225
  allWorkspaceFiles: null,
222
226
  serializedProjectGraph: null,
223
227
  serializedSourceMaps: null,
228
+ sourceMaps: null,
224
229
  };
225
230
  }
226
231
  }
@@ -261,6 +266,7 @@ async function createAndSerializeProjectGraph({ projects, sourceMaps, }) {
261
266
  allWorkspaceFiles,
262
267
  serializedProjectGraph,
263
268
  serializedSourceMaps,
269
+ sourceMaps,
264
270
  rustReferences,
265
271
  };
266
272
  }
@@ -274,6 +280,7 @@ async function createAndSerializeProjectGraph({ projects, sourceMaps, }) {
274
280
  allWorkspaceFiles: null,
275
281
  serializedProjectGraph: null,
276
282
  serializedSourceMaps: null,
283
+ sourceMaps: null,
277
284
  rustReferences: null,
278
285
  };
279
286
  }
@@ -298,8 +305,9 @@ async function resetInternalStateIfNxDepsMissing() {
298
305
  await resetInternalState();
299
306
  }
300
307
  }
301
- function notifyProjectGraphRecomputationListeners(projectGraph) {
308
+ function notifyProjectGraphRecomputationListeners(projectGraph, sourceMaps) {
302
309
  for (const listener of projectGraphRecomputationListeners) {
303
- listener(projectGraph);
310
+ listener(projectGraph, sourceMaps);
304
311
  }
312
+ (0, project_graph_listener_sockets_1.notifyProjectGraphListenerSockets)(projectGraph, sourceMaps);
305
313
  }
@@ -0,0 +1,8 @@
1
+ import { Socket } from 'net';
2
+ import { ProjectGraph } from '../../config/project-graph';
3
+ import { ConfigurationSourceMaps } from '../../project-graph/utils/project-configuration-utils';
4
+ export declare let registeredProjectGraphListenerSockets: Socket[];
5
+ export declare function removeRegisteredProjectGraphListenerSocket(socket: Socket): void;
6
+ export declare function hasRegisteredProjectGraphListenerSockets(): boolean;
7
+ export declare function notifyProjectGraphListenerSockets(projectGraph: ProjectGraph, sourceMaps: ConfigurationSourceMaps): Promise<void>;
8
+ //# sourceMappingURL=project-graph-listener-sockets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-graph-listener-sockets.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/server/project-graph-listener-sockets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAGhG,eAAO,IAAI,qCAAqC,EAAE,MAAM,EAAO,CAAC;AAEhE,wBAAgB,0CAA0C,CAAC,MAAM,EAAE,MAAM,QAGxE;AAED,wBAAgB,wCAAwC,YAEvD;AAED,wBAAsB,iCAAiC,CACrD,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,uBAAuB,iBAgBpC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registeredProjectGraphListenerSockets = void 0;
4
+ exports.removeRegisteredProjectGraphListenerSocket = removeRegisteredProjectGraphListenerSocket;
5
+ exports.hasRegisteredProjectGraphListenerSockets = hasRegisteredProjectGraphListenerSockets;
6
+ exports.notifyProjectGraphListenerSockets = notifyProjectGraphListenerSockets;
7
+ const server_1 = require("./server");
8
+ exports.registeredProjectGraphListenerSockets = [];
9
+ function removeRegisteredProjectGraphListenerSocket(socket) {
10
+ exports.registeredProjectGraphListenerSockets =
11
+ exports.registeredProjectGraphListenerSockets.filter((s) => s !== socket);
12
+ }
13
+ function hasRegisteredProjectGraphListenerSockets() {
14
+ return exports.registeredProjectGraphListenerSockets.length > 0;
15
+ }
16
+ async function notifyProjectGraphListenerSockets(projectGraph, sourceMaps) {
17
+ if (!hasRegisteredProjectGraphListenerSockets()) {
18
+ return;
19
+ }
20
+ await Promise.all(exports.registeredProjectGraphListenerSockets.map((socket) => (0, server_1.handleResult)(socket, 'PROJECT_GRAPH_UPDATED', () => Promise.resolve({
21
+ description: 'Project graph updated',
22
+ response: JSON.stringify({ projectGraph, sourceMaps }),
23
+ }))));
24
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/server/server.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAyInD,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAGF,eAAO,MAAM,WAAW,EAAE,GAAG,CAAC,MAAM,CAAa,CAAC;AAsLlD,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,iBAqBnC;AAiMD,wBAAsB,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,CAgEnD"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/server/server.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAkJnD,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAGF,eAAO,MAAM,WAAW,EAAE,GAAG,CAAC,MAAM,CAAa,CAAC;AAyLlD,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,iBAqBnC;AAoMD,wBAAsB,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,CAgEnD"}
@@ -17,6 +17,7 @@ const workspace_root_1 = require("../../utils/workspace-root");
17
17
  const cache_1 = require("../cache");
18
18
  const socket_utils_1 = require("../socket-utils");
19
19
  const file_watcher_sockets_1 = require("./file-watching/file-watcher-sockets");
20
+ const project_graph_listener_sockets_1 = require("./project-graph-listener-sockets");
20
21
  const handle_hash_tasks_1 = require("./handle-hash-tasks");
21
22
  const handle_outputs_tracking_1 = require("./handle-outputs-tracking");
22
23
  const handle_process_in_background_1 = require("./handle-process-in-background");
@@ -52,6 +53,7 @@ const flush_sync_generator_changes_to_disk_1 = require("../message-types/flush-s
52
53
  const handle_flush_sync_generator_changes_to_disk_1 = require("./handle-flush-sync-generator-changes-to-disk");
53
54
  const run_tasks_execution_hooks_1 = require("../message-types/run-tasks-execution-hooks");
54
55
  const handle_tasks_execution_hooks_1 = require("./handle-tasks-execution-hooks");
56
+ const register_project_graph_listener_1 = require("../message-types/register-project-graph-listener");
55
57
  let performanceObserver;
56
58
  let workspaceWatcherError;
57
59
  let outputsWatcherError;
@@ -82,6 +84,7 @@ const server = (0, net_1.createServer)(async (socket) => {
82
84
  exports.openSockets.delete(socket);
83
85
  logger_1.serverLogger.log(`Closed a connection. Number of open connections: ${numberOfOpenConnections}`);
84
86
  (0, file_watcher_sockets_1.removeRegisteredFileWatcherSocket)(socket);
87
+ (0, project_graph_listener_sockets_1.removeRegisteredProjectGraphListenerSocket)(socket);
85
88
  });
86
89
  });
87
90
  registerProcessTerminationListeners();
@@ -126,6 +129,9 @@ async function handleMessage(socket, data) {
126
129
  else if (payload.type === 'REGISTER_FILE_WATCHER') {
127
130
  file_watcher_sockets_1.registeredFileWatcherSockets.push({ socket, config: payload.config });
128
131
  }
132
+ else if ((0, register_project_graph_listener_1.isRegisterProjectGraphListenerMessage)(payload)) {
133
+ project_graph_listener_sockets_1.registeredProjectGraphListenerSockets.push(socket);
134
+ }
129
135
  else if ((0, glob_1.isHandleGlobMessage)(payload)) {
130
136
  await handleResult(socket, glob_1.GLOB, () => (0, handle_glob_1.handleGlob)(payload.globs, payload.exclude));
131
137
  }
@@ -201,8 +207,9 @@ async function handleResult(socket, type, hrFn) {
201
207
  logger_1.serverLogger.log(`Handled ${type}. Handling time: ${doneHandlingMark.getTime() - startMark.getTime()}. Response time: ${endMark.getTime() - doneHandlingMark.getTime()}.`);
202
208
  }
203
209
  function handleInactivityTimeout() {
204
- if ((0, file_watcher_sockets_1.hasRegisteredFileWatcherSockets)()) {
205
- logger_1.serverLogger.log(`There are open file watchers. Resetting inactivity timer.`);
210
+ if ((0, file_watcher_sockets_1.hasRegisteredFileWatcherSockets)() ||
211
+ (0, project_graph_listener_sockets_1.hasRegisteredProjectGraphListenerSockets)()) {
212
+ logger_1.serverLogger.log(`There are open file watchers or project graph listeners. Resetting inactivity timer.`);
206
213
  (0, shutdown_utils_1.resetInactivityTimeout)(handleInactivityTimeout);
207
214
  }
208
215
  else {
@@ -181,9 +181,21 @@ function readAndCombineAllProjectConfigurations(tree) {
181
181
  if ((0, path_1.basename)(projectFile) === 'project.json') {
182
182
  const json = (0, json_1.readJson)(tree, projectFile);
183
183
  const config = (0, project_json_1.buildProjectFromProjectJson)(json, projectFile);
184
+ if (!config.name) {
185
+ try {
186
+ const packageJson = (0, json_1.readJson)(tree, (0, path_2.joinPathFragments)(config.root, 'package.json'));
187
+ if (packageJson.name) {
188
+ config.name = packageJson.name;
189
+ }
190
+ }
191
+ catch {
192
+ // Maybe no package json, is ok.
193
+ }
194
+ config.name ??= (0, to_project_name_1.toProjectName)(projectFile);
195
+ }
184
196
  (0, project_configuration_utils_1.mergeProjectConfigurationIntoRootMap)(rootMap, config, undefined, undefined, true);
185
197
  }
186
- else if ((0, path_1.basename)(projectFile) === 'package.json') {
198
+ if ((0, path_1.basename)(projectFile) === 'package.json') {
187
199
  const packageJson = (0, json_1.readJson)(tree, projectFile);
188
200
  // We don't want to have all of the extra inferred stuff in here, as
189
201
  // when generators update the project they shouldn't inline that stuff.
@@ -0,0 +1,3 @@
1
+ import { Tree } from '../../generators/tree';
2
+ export default function (tree: Tree): Promise<void>;
3
+ //# sourceMappingURL=prefix-outputs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prefix-outputs.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/migrations/update-15-0-0/prefix-outputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAgB7C,yBAA+B,IAAI,EAAE,IAAI,iBAoDxC"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
5
+ const project_configuration_1 = require("../../generators/utils/project-configuration");
6
+ const nx_json_1 = require("../../generators/utils/nx-json");
7
+ const path_1 = require("path");
8
+ const utils_1 = require("../../tasks-runner/utils");
9
+ const json_1 = require("../../generators/utils/json");
10
+ async function default_1(tree) {
11
+ // If the workspace doesn't have a nx.json, don't make any changes
12
+ if (!tree.exists('nx.json')) {
13
+ return;
14
+ }
15
+ const nxJson = (0, nx_json_1.readNxJson)(tree);
16
+ for (const [projectName, project] of (0, project_configuration_1.getProjects)(tree)) {
17
+ for (const [_, target] of Object.entries(project.targets ?? {})) {
18
+ if (!target.outputs) {
19
+ continue;
20
+ }
21
+ target.outputs = (0, utils_1.transformLegacyOutputs)(project.root, target.outputs);
22
+ }
23
+ try {
24
+ (0, project_configuration_1.updateProjectConfiguration)(tree, projectName, project);
25
+ }
26
+ catch {
27
+ if (tree.exists((0, path_1.join)(project.root, 'package.json'))) {
28
+ (0, json_1.updateJson)(tree, (0, path_1.join)(project.root, 'package.json'), (json) => {
29
+ for (const target of Object.values(json.nx?.targets ?? {})) {
30
+ if (target.outputs) {
31
+ target.outputs = (0, utils_1.transformLegacyOutputs)(project.root, target.outputs);
32
+ }
33
+ }
34
+ return json;
35
+ });
36
+ }
37
+ }
38
+ }
39
+ if (nxJson.targetDefaults) {
40
+ for (const [_, target] of Object.entries(nxJson.targetDefaults)) {
41
+ if (!target.outputs) {
42
+ continue;
43
+ }
44
+ target.outputs = (0, utils_1.transformLegacyOutputs)('{projectRoot}', target.outputs);
45
+ }
46
+ (0, nx_json_1.updateNxJson)(tree, nxJson);
47
+ }
48
+ await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
49
+ }
@@ -0,0 +1,3 @@
1
+ import { Tree } from '../../generators/tree';
2
+ export default function (tree: Tree): Promise<void>;
3
+ //# sourceMappingURL=remove-nrwl-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-nrwl-cli.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/migrations/update-16-0-0/remove-nrwl-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAI7C,yBAA+B,IAAI,EAAE,IAAI,iBAYxC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
5
+ const json_1 = require("../../generators/utils/json");
6
+ async function default_1(tree) {
7
+ (0, json_1.updateJson)(tree, 'package.json', (json) => {
8
+ for (const deps of [json.dependencies, json.devDependencies]) {
9
+ if (deps) {
10
+ delete deps['@nrwl/cli'];
11
+ }
12
+ }
13
+ return json;
14
+ });
15
+ await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
16
+ }
@@ -0,0 +1,3 @@
1
+ import { Tree } from '../../generators/tree';
2
+ export default function (tree: Tree): Promise<void>;
3
+ //# sourceMappingURL=update-depends-on-to-tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-depends-on-to-tokens.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/migrations/update-16-0-0/update-depends-on-to-tokens.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAG7C,yBAA+B,IAAI,EAAE,IAAI,iBAyDxC"}
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const project_configuration_1 = require("../../generators/utils/project-configuration");
5
+ const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
6
+ async function default_1(tree) {
7
+ updateDependsOnAndInputsInsideNxJson(tree);
8
+ const projectsConfigurations = (0, project_configuration_1.getProjects)(tree);
9
+ for (const [projectName, projectConfiguration] of projectsConfigurations) {
10
+ let projectChanged = false;
11
+ for (const [targetName, targetConfiguration] of Object.entries(projectConfiguration.targets ?? {})) {
12
+ for (const dependency of targetConfiguration.dependsOn ?? []) {
13
+ if (typeof dependency !== 'string') {
14
+ if (dependency.projects === 'self' ||
15
+ dependency.projects === '{self}') {
16
+ delete dependency.projects;
17
+ projectChanged = true;
18
+ }
19
+ else if (dependency.projects === 'dependencies' ||
20
+ dependency.projects === '{dependencies}') {
21
+ delete dependency.projects;
22
+ dependency.dependencies = true;
23
+ projectChanged = true;
24
+ }
25
+ }
26
+ }
27
+ for (let i = 0; i < (targetConfiguration.inputs?.length ?? 0); i++) {
28
+ const input = targetConfiguration.inputs[i];
29
+ if (typeof input !== 'string') {
30
+ if ('projects' in input &&
31
+ (input.projects === 'self' || input.projects === '{self}')) {
32
+ delete input.projects;
33
+ projectChanged = true;
34
+ }
35
+ else if ('projects' in input &&
36
+ (input.projects === 'dependencies' ||
37
+ input.projects === '{dependencies}')) {
38
+ delete input.projects;
39
+ targetConfiguration.inputs[i] = {
40
+ ...input,
41
+ dependencies: true,
42
+ };
43
+ projectChanged = true;
44
+ }
45
+ }
46
+ }
47
+ }
48
+ if (projectChanged) {
49
+ (0, project_configuration_1.updateProjectConfiguration)(tree, projectName, projectConfiguration);
50
+ }
51
+ }
52
+ await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
53
+ }
54
+ function updateDependsOnAndInputsInsideNxJson(tree) {
55
+ const nxJson = (0, project_configuration_1.readNxJson)(tree);
56
+ let nxJsonChanged = false;
57
+ for (const [target, defaults] of Object.entries(nxJson?.targetDefaults ?? {})) {
58
+ for (const dependency of defaults.dependsOn ?? []) {
59
+ if (typeof dependency !== 'string') {
60
+ if (dependency.projects === 'self' ||
61
+ dependency.projects === '{self}') {
62
+ delete dependency.projects;
63
+ nxJsonChanged = true;
64
+ }
65
+ else if (dependency.projects === 'dependencies' ||
66
+ dependency.projects === '{dependencies}') {
67
+ delete dependency.projects;
68
+ dependency.dependencies = true;
69
+ nxJsonChanged = true;
70
+ }
71
+ }
72
+ }
73
+ for (let i = 0; i < (defaults.inputs?.length ?? 0); i++) {
74
+ const input = defaults.inputs[i];
75
+ if (typeof input !== 'string') {
76
+ if ('projects' in input &&
77
+ (input.projects === 'self' || input.projects === '{self}')) {
78
+ delete input.projects;
79
+ nxJsonChanged = true;
80
+ }
81
+ else if ('projects' in input &&
82
+ (input.projects === 'dependencies' ||
83
+ input.projects === '{dependencies}')) {
84
+ delete input.projects;
85
+ defaults.inputs[i] = {
86
+ ...input,
87
+ dependencies: true,
88
+ };
89
+ nxJsonChanged = true;
90
+ }
91
+ }
92
+ }
93
+ }
94
+ if (nxJsonChanged) {
95
+ (0, project_configuration_1.updateNxJson)(tree, nxJson);
96
+ }
97
+ }
@@ -0,0 +1,3 @@
1
+ import { Tree } from '../../generators/tree';
2
+ export default function (tree: Tree): Promise<void>;
3
+ //# sourceMappingURL=update-nx-cloud-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-nx-cloud-runner.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/migrations/update-16-0-0/update-nx-cloud-runner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAI7C,yBAA+B,IAAI,EAAE,IAAI,iBAyBxC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const project_configuration_1 = require("../../generators/utils/project-configuration");
5
+ const json_1 = require("../../generators/utils/json");
6
+ const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
7
+ async function default_1(tree) {
8
+ (0, json_1.updateJson)(tree, 'package.json', (json) => {
9
+ if (json.dependencies && json.dependencies['@nrwl/nx-cloud']) {
10
+ json.dependencies['nx-cloud'] = json.dependencies['@nrwl/nx-cloud'];
11
+ delete json.dependencies['@nrwl/nx-cloud'];
12
+ }
13
+ if (json.devDependencies && json.devDependencies['@nrwl/nx-cloud']) {
14
+ json.devDependencies['nx-cloud'] = json.devDependencies['@nrwl/nx-cloud'];
15
+ delete json.devDependencies['@nrwl/nx-cloud'];
16
+ }
17
+ return json;
18
+ });
19
+ const nxJson = (0, project_configuration_1.readNxJson)(tree);
20
+ if (!nxJson)
21
+ return;
22
+ for (let opts of Object.values(nxJson.tasksRunnerOptions ?? {})) {
23
+ if (opts.runner === '@nrwl/nx-cloud') {
24
+ opts.runner = 'nx-cloud';
25
+ }
26
+ }
27
+ (0, project_configuration_1.updateNxJson)(tree, nxJson);
28
+ await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
29
+ }
@@ -0,0 +1,3 @@
1
+ import { Tree } from '../../generators/tree';
2
+ export default function removeRunCommandsOutputPath(tree: Tree): Promise<void>;
3
+ //# sourceMappingURL=remove-run-commands-output-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-run-commands-output-path.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/migrations/update-16-2-0/remove-run-commands-output-path.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAO7C,wBAA8B,2BAA2B,CAAC,IAAI,EAAE,IAAI,iBAoBnE"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = removeRunCommandsOutputPath;
4
+ const path_1 = require("../../utils/path");
5
+ const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
6
+ const json_1 = require("../../generators/utils/json");
7
+ const project_configuration_1 = require("../../generators/utils/project-configuration");
8
+ async function removeRunCommandsOutputPath(tree) {
9
+ for (const [project, configuration] of (0, project_configuration_1.getProjects)(tree).entries()) {
10
+ const targets = configuration.targets ?? {};
11
+ let changed = false;
12
+ for (const [, target] of Object.entries(targets)) {
13
+ changed ||= updateTargetBlock(target);
14
+ }
15
+ if (changed) {
16
+ (0, project_configuration_1.updateProjectConfiguration)(tree, project, configuration);
17
+ }
18
+ }
19
+ if (tree.exists('nx.json')) {
20
+ (0, json_1.updateJson)(tree, 'nx.json', (json) => {
21
+ for (const [, target] of Object.entries(json.targetDefaults ?? {})) {
22
+ updateTargetBlock(target);
23
+ }
24
+ return json;
25
+ });
26
+ }
27
+ await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
28
+ }
29
+ function updateTargetBlock(target) {
30
+ let changed = false;
31
+ if (target.executor === 'nx:run-commands' && target.options?.outputPath) {
32
+ changed = true;
33
+ const outputs = new Set(target.outputs ?? []);
34
+ outputs.delete('{options.outputPath}');
35
+ const newOutputs = Array.isArray(target.options.outputPath)
36
+ ? target.options.outputPath.map((p) => (0, path_1.joinPathFragments)('{workspaceRoot}', p))
37
+ : [(0, path_1.joinPathFragments)('{workspaceRoot}', target.options.outputPath)];
38
+ for (const outputPath of newOutputs) {
39
+ outputs.add(outputPath);
40
+ }
41
+ delete target.options.outputPath;
42
+ target.outputs = Array.from(outputs);
43
+ }
44
+ return changed;
45
+ }
@@ -0,0 +1,13 @@
1
+ import { Tree } from '../../generators/tree';
2
+ /**
3
+ * This function escapes dollar sign in env variables
4
+ * It will go through:
5
+ * - '.env', '.local.env', '.env.local'
6
+ * - .env.[target-name], .[target-name].env
7
+ * - .env.[target-name].[configuration-name], .[target-name].[configuration-name].env
8
+ * - .env.[configuration-name], .[configuration-name].env
9
+ * at each project root and workspace root
10
+ * @param tree
11
+ */
12
+ export default function escapeDollarSignEnvVariables(tree: Tree): void;
13
+ //# sourceMappingURL=escape-dollar-sign-env-variables.d.ts.map