nx 19.6.1 → 19.7.0-beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. package/README.md +1 -1
  2. package/package.json +12 -12
  3. package/src/command-line/add/add.js +1 -5
  4. package/src/command-line/add/command-object.js +1 -5
  5. package/src/command-line/affected/affected.js +0 -3
  6. package/src/command-line/exec/exec.js +0 -3
  7. package/src/command-line/generate/command-object.js +2 -5
  8. package/src/command-line/generate/generate.js +4 -8
  9. package/src/command-line/import/command-object.js +1 -1
  10. package/src/command-line/import/utils/prepare-source-repo.js +2 -2
  11. package/src/command-line/migrate/command-object.js +3 -2
  12. package/src/command-line/migrate/migrate.js +0 -3
  13. package/src/command-line/release/changelog.js +0 -3
  14. package/src/command-line/release/command-object.js +1 -5
  15. package/src/command-line/release/plan-check.js +0 -3
  16. package/src/command-line/release/plan.js +0 -3
  17. package/src/command-line/release/publish.js +0 -6
  18. package/src/command-line/release/release.js +0 -3
  19. package/src/command-line/release/version.js +0 -3
  20. package/src/command-line/repair/command-object.js +2 -4
  21. package/src/command-line/repair/repair.js +2 -6
  22. package/src/command-line/run/run-one.js +0 -3
  23. package/src/command-line/show/command-object.js +2 -2
  24. package/src/command-line/sync/command-object.js +3 -8
  25. package/src/command-line/sync/sync.js +1 -5
  26. package/src/command-line/watch/command-object.js +1 -1
  27. package/src/command-line/watch/watch.js +0 -3
  28. package/src/command-line/yargs-utils/shared-options.js +3 -3
  29. package/src/core/graph/main.js +1 -1
  30. package/src/daemon/client/client.d.ts +3 -6
  31. package/src/daemon/client/client.js +5 -4
  32. package/src/daemon/message-types/task-history.d.ts +9 -9
  33. package/src/daemon/message-types/task-history.js +7 -7
  34. package/src/daemon/server/handle-task-history.d.ts +9 -0
  35. package/src/daemon/server/handle-task-history.js +28 -0
  36. package/src/daemon/server/server.js +4 -5
  37. package/src/hasher/hash-task.js +36 -1
  38. package/src/native/assert-supported-platform.js +1 -1
  39. package/src/native/index.d.ts +45 -4
  40. package/src/native/native-bindings.js +4 -0
  41. package/src/native/nx.wasi-browser.js +50 -36
  42. package/src/native/nx.wasi.cjs +48 -36
  43. package/src/native/nx.wasm32-wasi.wasm +0 -0
  44. package/src/nx-cloud/update-manager.d.ts +2 -0
  45. package/src/nx-cloud/utilities/url-shorten.js +1 -1
  46. package/src/plugins/js/package-json/create-package-json.d.ts +1 -0
  47. package/src/plugins/js/package-json/create-package-json.js +1 -1
  48. package/src/tasks-runner/cache.d.ts +21 -2
  49. package/src/tasks-runner/cache.js +118 -26
  50. package/src/tasks-runner/default-tasks-runner.d.ts +6 -0
  51. package/src/tasks-runner/default-tasks-runner.js +31 -1
  52. package/src/tasks-runner/life-cycles/task-history-life-cycle-old.d.ts +9 -0
  53. package/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +54 -0
  54. package/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts +1 -0
  55. package/src/tasks-runner/life-cycles/task-history-life-cycle.js +19 -21
  56. package/src/tasks-runner/run-command.js +3 -1
  57. package/src/tasks-runner/task-orchestrator.js +10 -1
  58. package/src/utils/cache-directory.d.ts +1 -0
  59. package/src/utils/cache-directory.js +7 -3
  60. package/src/utils/db-connection.d.ts +2 -0
  61. package/src/utils/db-connection.js +11 -0
  62. package/src/utils/git-utils.js +1 -1
  63. package/src/utils/legacy-task-history.d.ts +8 -0
  64. package/src/utils/legacy-task-history.js +87 -0
  65. package/src/utils/logger.js +1 -1
  66. package/src/utils/task-history.d.ts +6 -8
  67. package/src/utils/task-history.js +16 -88
  68. package/src/utils/workspace-context.js +1 -1
  69. package/src/daemon/server/handle-get-task-history.d.ts +0 -4
  70. package/src/daemon/server/handle-get-task-history.js +0 -11
  71. package/src/daemon/server/handle-write-task-runs-to-history.d.ts +0 -5
  72. package/src/daemon/server/handle-write-task-runs-to-history.js +0 -11
@@ -3,8 +3,7 @@ import { FileData, ProjectGraph } from '../../config/project-graph';
3
3
  import { Hash } from '../../hasher/task-hasher';
4
4
  import { Task, TaskGraph } from '../../config/task-graph';
5
5
  import { ConfigurationSourceMaps } from '../../project-graph/utils/project-configuration-utils';
6
- import { NxWorkspaceFiles } from '../../native';
7
- import { TaskRun } from '../../utils/task-history';
6
+ import { NxWorkspaceFiles, TaskRun } from '../../native';
8
7
  import type { SyncGeneratorChangesResult } from '../../utils/sync-generators';
9
8
  export type UnregisterCallback = () => void;
10
9
  export type ChangedFile = {
@@ -51,10 +50,8 @@ export declare class DaemonClient {
51
50
  getWorkspaceFiles(projectRootMap: Record<string, string>): Promise<NxWorkspaceFiles>;
52
51
  getFilesInDirectory(dir: string): Promise<string[]>;
53
52
  hashGlob(globs: string[], exclude?: string[]): Promise<string>;
54
- getTaskHistoryForHashes(hashes: string[]): Promise<{
55
- [hash: string]: TaskRun[];
56
- }>;
57
- writeTaskRunsToHistory(taskRuns: TaskRun[]): Promise<void>;
53
+ getFlakyTasks(hashes: string[]): Promise<string[]>;
54
+ recordTaskRuns(taskRuns: TaskRun[]): Promise<void>;
58
55
  getSyncGeneratorChanges(generators: string[]): Promise<SyncGeneratorChangesResult[]>;
59
56
  flushSyncGeneratorChangesToDisk(generators: string[]): Promise<void>;
60
57
  getRegisteredSyncGenerators(): Promise<string[]>;
@@ -25,6 +25,7 @@ const get_nx_workspace_files_1 = require("../message-types/get-nx-workspace-file
25
25
  const get_context_file_data_1 = require("../message-types/get-context-file-data");
26
26
  const get_files_in_directory_1 = require("../message-types/get-files-in-directory");
27
27
  const hash_glob_1 = require("../message-types/hash-glob");
28
+ const task_history_1 = require("../message-types/task-history");
28
29
  const force_shutdown_1 = require("../message-types/force-shutdown");
29
30
  const get_sync_generator_changes_1 = require("../message-types/get-sync-generator-changes");
30
31
  const get_registered_sync_generators_1 = require("../message-types/get-registered-sync-generators");
@@ -235,16 +236,16 @@ class DaemonClient {
235
236
  };
236
237
  return this.sendToDaemonViaQueue(message);
237
238
  }
238
- getTaskHistoryForHashes(hashes) {
239
+ getFlakyTasks(hashes) {
239
240
  const message = {
240
- type: 'GET_TASK_HISTORY_FOR_HASHES',
241
+ type: task_history_1.GET_FLAKY_TASKS,
241
242
  hashes,
242
243
  };
243
244
  return this.sendToDaemonViaQueue(message);
244
245
  }
245
- writeTaskRunsToHistory(taskRuns) {
246
+ recordTaskRuns(taskRuns) {
246
247
  const message = {
247
- type: 'WRITE_TASK_RUNS_TO_HISTORY',
248
+ type: task_history_1.RECORD_TASK_RUNS,
248
249
  taskRuns,
249
250
  };
250
251
  return this.sendMessageToDaemon(message);
@@ -1,13 +1,13 @@
1
- import { TaskRun } from '../../utils/task-history';
2
- export declare const GET_TASK_HISTORY_FOR_HASHES: "GET_TASK_HISTORY_FOR_HASHES";
3
- export type HandleGetTaskHistoryForHashesMessage = {
4
- type: typeof GET_TASK_HISTORY_FOR_HASHES;
1
+ import type { TaskRun } from '../../native';
2
+ export declare const GET_FLAKY_TASKS: "GET_FLAKY_TASKS";
3
+ export type HandleGetFlakyTasks = {
4
+ type: typeof GET_FLAKY_TASKS;
5
5
  hashes: string[];
6
6
  };
7
- export declare function isHandleGetTaskHistoryForHashesMessage(message: unknown): message is HandleGetTaskHistoryForHashesMessage;
8
- export declare const WRITE_TASK_RUNS_TO_HISTORY: "WRITE_TASK_RUNS_TO_HISTORY";
9
- export type HandleWriteTaskRunsToHistoryMessage = {
10
- type: typeof WRITE_TASK_RUNS_TO_HISTORY;
7
+ export declare function isHandleGetFlakyTasksMessage(message: unknown): message is HandleGetFlakyTasks;
8
+ export declare const RECORD_TASK_RUNS: "RECORD_TASK_RUNS";
9
+ export type HandleRecordTaskRunsMessage = {
10
+ type: typeof RECORD_TASK_RUNS;
11
11
  taskRuns: TaskRun[];
12
12
  };
13
- export declare function isHandleWriteTaskRunsToHistoryMessage(message: unknown): message is HandleWriteTaskRunsToHistoryMessage;
13
+ export declare function isHandleWriteTaskRunsToHistoryMessage(message: unknown): message is HandleRecordTaskRunsMessage;
@@ -1,19 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WRITE_TASK_RUNS_TO_HISTORY = exports.GET_TASK_HISTORY_FOR_HASHES = void 0;
4
- exports.isHandleGetTaskHistoryForHashesMessage = isHandleGetTaskHistoryForHashesMessage;
3
+ exports.RECORD_TASK_RUNS = exports.GET_FLAKY_TASKS = void 0;
4
+ exports.isHandleGetFlakyTasksMessage = isHandleGetFlakyTasksMessage;
5
5
  exports.isHandleWriteTaskRunsToHistoryMessage = isHandleWriteTaskRunsToHistoryMessage;
6
- exports.GET_TASK_HISTORY_FOR_HASHES = 'GET_TASK_HISTORY_FOR_HASHES';
7
- function isHandleGetTaskHistoryForHashesMessage(message) {
6
+ exports.GET_FLAKY_TASKS = 'GET_FLAKY_TASKS';
7
+ function isHandleGetFlakyTasksMessage(message) {
8
8
  return (typeof message === 'object' &&
9
9
  message !== null &&
10
10
  'type' in message &&
11
- message['type'] === exports.GET_TASK_HISTORY_FOR_HASHES);
11
+ message['type'] === exports.GET_FLAKY_TASKS);
12
12
  }
13
- exports.WRITE_TASK_RUNS_TO_HISTORY = 'WRITE_TASK_RUNS_TO_HISTORY';
13
+ exports.RECORD_TASK_RUNS = 'RECORD_TASK_RUNS';
14
14
  function isHandleWriteTaskRunsToHistoryMessage(message) {
15
15
  return (typeof message === 'object' &&
16
16
  message !== null &&
17
17
  'type' in message &&
18
- message['type'] === exports.WRITE_TASK_RUNS_TO_HISTORY);
18
+ message['type'] === exports.RECORD_TASK_RUNS);
19
19
  }
@@ -0,0 +1,9 @@
1
+ import { TaskRun } from '../../native';
2
+ export declare function handleRecordTaskRuns(taskRuns: TaskRun[]): Promise<{
3
+ response: string;
4
+ description: string;
5
+ }>;
6
+ export declare function handleGetFlakyTasks(hashes: string[]): Promise<{
7
+ response: string;
8
+ description: string;
9
+ }>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleRecordTaskRuns = handleRecordTaskRuns;
4
+ exports.handleGetFlakyTasks = handleGetFlakyTasks;
5
+ const task_history_1 = require("../../utils/task-history");
6
+ let taskHistory;
7
+ function getTaskHistory() {
8
+ if (!taskHistory) {
9
+ taskHistory = new task_history_1.TaskHistory();
10
+ }
11
+ return taskHistory;
12
+ }
13
+ async function handleRecordTaskRuns(taskRuns) {
14
+ const taskHistory = getTaskHistory();
15
+ await taskHistory.recordTaskRuns(taskRuns);
16
+ return {
17
+ response: 'true',
18
+ description: 'handleRecordTaskRuns',
19
+ };
20
+ }
21
+ async function handleGetFlakyTasks(hashes) {
22
+ const taskHistory = getTaskHistory();
23
+ const history = await taskHistory.getFlakyTasks(hashes);
24
+ return {
25
+ response: JSON.stringify(history),
26
+ description: 'handleGetFlakyTasks',
27
+ };
28
+ }
@@ -38,8 +38,7 @@ const handle_get_files_in_directory_1 = require("./handle-get-files-in-directory
38
38
  const hash_glob_1 = require("../message-types/hash-glob");
39
39
  const handle_hash_glob_1 = require("./handle-hash-glob");
40
40
  const task_history_1 = require("../message-types/task-history");
41
- const handle_get_task_history_1 = require("./handle-get-task-history");
42
- const handle_write_task_runs_to_history_1 = require("./handle-write-task-runs-to-history");
41
+ const handle_task_history_1 = require("./handle-task-history");
43
42
  const force_shutdown_1 = require("../message-types/force-shutdown");
44
43
  const handle_force_shutdown_1 = require("./handle-force-shutdown");
45
44
  const get_sync_generator_changes_1 = require("../message-types/get-sync-generator-changes");
@@ -140,11 +139,11 @@ async function handleMessage(socket, data) {
140
139
  else if ((0, hash_glob_1.isHandleHashGlobMessage)(payload)) {
141
140
  await handleResult(socket, hash_glob_1.HASH_GLOB, () => (0, handle_hash_glob_1.handleHashGlob)(payload.globs, payload.exclude));
142
141
  }
143
- else if ((0, task_history_1.isHandleGetTaskHistoryForHashesMessage)(payload)) {
144
- await handleResult(socket, 'GET_TASK_HISTORY_FOR_HASHES', () => (0, handle_get_task_history_1.handleGetTaskHistoryForHashes)(payload.hashes));
142
+ else if ((0, task_history_1.isHandleGetFlakyTasksMessage)(payload)) {
143
+ await handleResult(socket, 'GET_TASK_HISTORY_FOR_HASHES', () => (0, handle_task_history_1.handleGetFlakyTasks)(payload.hashes));
145
144
  }
146
145
  else if ((0, task_history_1.isHandleWriteTaskRunsToHistoryMessage)(payload)) {
147
- await handleResult(socket, 'WRITE_TASK_RUNS_TO_HISTORY', () => (0, handle_write_task_runs_to_history_1.handleWriteTaskRunsToHistory)(payload.taskRuns));
146
+ await handleResult(socket, 'WRITE_TASK_RUNS_TO_HISTORY', () => (0, handle_task_history_1.handleRecordTaskRuns)(payload.taskRuns));
148
147
  }
149
148
  else if ((0, force_shutdown_1.isHandleForceShutdownMessage)(payload)) {
150
149
  await handleResult(socket, 'FORCE_SHUTDOWN', () => (0, handle_force_shutdown_1.handleForceShutdown)(server));
@@ -6,8 +6,22 @@ const utils_1 = require("../tasks-runner/utils");
6
6
  const project_graph_1 = require("../project-graph/project-graph");
7
7
  const task_hasher_1 = require("./task-hasher");
8
8
  const nx_json_1 = require("../config/nx-json");
9
+ const native_1 = require("../native");
10
+ const db_connection_1 = require("../utils/db-connection");
11
+ let taskDetails;
12
+ function getTaskDetails() {
13
+ // TODO: Remove when wasm supports sqlite
14
+ if (native_1.IS_WASM) {
15
+ return null;
16
+ }
17
+ if (!taskDetails) {
18
+ taskDetails = new native_1.TaskDetails((0, db_connection_1.getDbConnection)());
19
+ }
20
+ return taskDetails;
21
+ }
9
22
  async function hashTasksThatDoNotDependOnOutputsOfOtherTasks(hasher, projectGraph, taskGraph, nxJson) {
10
23
  performance.mark('hashMultipleTasks:start');
24
+ const taskDetails = getTaskDetails();
11
25
  const tasks = Object.values(taskGraph.tasks);
12
26
  const tasksWithHashers = await Promise.all(tasks.map(async (task) => {
13
27
  const customHasher = (0, utils_1.getCustomHasher)(task, projectGraph);
@@ -23,16 +37,26 @@ async function hashTasksThatDoNotDependOnOutputsOfOtherTasks(hasher, projectGrap
23
37
  (0, task_hasher_1.getInputs)(task, projectGraph, nxJson).depsOutputs.length > 0);
24
38
  })
25
39
  .map((t) => t.task);
26
- const hashes = await hasher.hashTasks(tasksToHash, taskGraph);
40
+ const hashes = await hasher.hashTasks(tasksToHash, taskGraph, process.env);
27
41
  for (let i = 0; i < tasksToHash.length; i++) {
28
42
  tasksToHash[i].hash = hashes[i].value;
29
43
  tasksToHash[i].hashDetails = hashes[i].details;
30
44
  }
45
+ // TODO: Remove if when wasm supports sqlite
46
+ if (taskDetails) {
47
+ taskDetails.recordTaskDetails(tasksToHash.map((task) => ({
48
+ hash: task.hash,
49
+ project: task.target.project,
50
+ target: task.target.target,
51
+ configuration: task.target.configuration,
52
+ })));
53
+ }
31
54
  performance.mark('hashMultipleTasks:end');
32
55
  performance.measure('hashMultipleTasks', 'hashMultipleTasks:start', 'hashMultipleTasks:end');
33
56
  }
34
57
  async function hashTask(hasher, projectGraph, taskGraph, task, env) {
35
58
  performance.mark('hashSingleTask:start');
59
+ const taskDetails = getTaskDetails();
36
60
  const customHasher = (0, utils_1.getCustomHasher)(task, projectGraph);
37
61
  const projectsConfigurations = (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph);
38
62
  const { value, details } = await (customHasher
@@ -48,6 +72,17 @@ async function hashTask(hasher, projectGraph, taskGraph, task, env) {
48
72
  : hasher.hashTask(task, taskGraph, env));
49
73
  task.hash = value;
50
74
  task.hashDetails = details;
75
+ // TODO: Remove if when wasm supports sqlite
76
+ if (taskDetails) {
77
+ taskDetails.recordTaskDetails([
78
+ {
79
+ hash: task.hash,
80
+ project: task.target.project,
81
+ target: task.target.target,
82
+ configuration: task.target.configuration,
83
+ },
84
+ ]);
85
+ }
51
86
  performance.mark('hashSingleTask:end');
52
87
  performance.measure('hashSingleTask', 'hashSingleTask:start', 'hashSingleTask:end');
53
88
  }
@@ -18,7 +18,7 @@ function assertSupportedPlatform() {
18
18
  `The Nx CLI could not find or load the native binary for your supported platform (${process.platform}-${process.arch}).`,
19
19
  'This likely means that optional dependencies were not installed correctly, or your system is missing some system dependencies.',
20
20
  ];
21
- if (process.env.NX_VERBOSE_LOGGING == 'true') {
21
+ if (process.env.NX_VERBOSE_LOGGING === 'true') {
22
22
  bodyLines.push('', 'Additional error information:', e.message);
23
23
  }
24
24
  }
@@ -26,6 +26,23 @@ export declare class ImportResult {
26
26
  staticImportExpressions: Array<string>
27
27
  }
28
28
 
29
+ export declare class NxCache {
30
+ cacheDirectory: string
31
+ constructor(workspaceRoot: string, cachePath: string, dbConnection: ExternalObject<Connection>)
32
+ get(hash: string): CachedResult | null
33
+ put(hash: string, terminalOutput: string, outputs: Array<string>, code: number): void
34
+ applyRemoteCacheResults(hash: string, result: CachedResult): void
35
+ getTaskOutputsPath(hash: string): string
36
+ copyFilesFromCache(cachedResult: CachedResult, outputs: Array<string>): void
37
+ removeOldCacheRecords(): void
38
+ }
39
+
40
+ export declare class NxTaskHistory {
41
+ constructor(db: ExternalObject<Connection>)
42
+ recordTaskRuns(taskRuns: Array<TaskRun>): void
43
+ getFlakyTasks(hashes: Array<string>): Array<string>
44
+ }
45
+
29
46
  export declare class RustPseudoTerminal {
30
47
  constructor()
31
48
  runCommand(command: string, commandDir?: string | undefined | null, jsEnv?: Record<string, string> | undefined | null, execArgv?: Array<string> | undefined | null, quiet?: boolean | undefined | null, tty?: boolean | undefined | null): ChildProcess
@@ -36,6 +53,11 @@ export declare class RustPseudoTerminal {
36
53
  fork(id: string, forkScript: string, pseudoIpcPath: string, commandDir: string | undefined | null, jsEnv: Record<string, string> | undefined | null, execArgv: Array<string> | undefined | null, quiet: boolean): ChildProcess
37
54
  }
38
55
 
56
+ export declare class TaskDetails {
57
+ constructor(db: ExternalObject<Connection>)
58
+ recordTaskDetails(tasks: Array<HashedTask>): void
59
+ }
60
+
39
61
  export declare class TaskHasher {
40
62
  constructor(workspaceRoot: string, projectGraph: ExternalObject<ProjectGraph>, projectFileMap: ExternalObject<ProjectFiles>, allWorkspaceFiles: ExternalObject<Array<FileData>>, tsConfig: Buffer, tsConfigPaths: Record<string, Array<string>>, options?: HasherOptions | undefined | null)
41
63
  hashPlans(hashPlans: ExternalObject<Record<string, Array<HashInstruction>>>, jsEnv: Record<string, string>): NapiDashMap
@@ -67,6 +89,14 @@ export declare class WorkspaceContext {
67
89
  getFilesInDirectory(directory: string): Array<string>
68
90
  }
69
91
 
92
+ export interface CachedResult {
93
+ code: number
94
+ terminalOutput: string
95
+ outputsPath: string
96
+ }
97
+
98
+ export declare export function connectToNxDb(cacheDir: string, nxVersion: string): ExternalObject<Connection>
99
+
70
100
  export declare export function copy(src: string, dest: string): void
71
101
 
72
102
  export interface DepsOutputsInput {
@@ -84,10 +114,6 @@ export declare const enum EventType {
84
114
  create = 'create'
85
115
  }
86
116
 
87
- /**
88
- * Expands the given entries into a list of existing directories and files.
89
- * This is used for copying outputs to and from the cache
90
- */
91
117
  export declare export function expandOutputs(directory: string, entries: Array<string>): Array<string>
92
118
 
93
119
  export interface ExternalDependenciesInput {
@@ -131,6 +157,13 @@ export interface HashDetails {
131
157
  details: Record<string, string>
132
158
  }
133
159
 
160
+ export interface HashedTask {
161
+ hash: string
162
+ project: string
163
+ target: string
164
+ configuration?: string
165
+ }
166
+
134
167
  export interface HasherOptions {
135
168
  selectivelyHashTsConfig: boolean
136
169
  }
@@ -203,6 +236,14 @@ export interface TaskGraph {
203
236
  dependencies: Record<string, Array<string>>
204
237
  }
205
238
 
239
+ export interface TaskRun {
240
+ hash: string
241
+ status: string
242
+ code: number
243
+ start: number
244
+ end: number
245
+ }
246
+
206
247
  export interface TaskTarget {
207
248
  project: string
208
249
  target: string
@@ -364,10 +364,14 @@ if (!nativeBinding) {
364
364
  module.exports.ChildProcess = nativeBinding.ChildProcess
365
365
  module.exports.HashPlanner = nativeBinding.HashPlanner
366
366
  module.exports.ImportResult = nativeBinding.ImportResult
367
+ module.exports.NxCache = nativeBinding.NxCache
368
+ module.exports.NxTaskHistory = nativeBinding.NxTaskHistory
367
369
  module.exports.RustPseudoTerminal = nativeBinding.RustPseudoTerminal
370
+ module.exports.TaskDetails = nativeBinding.TaskDetails
368
371
  module.exports.TaskHasher = nativeBinding.TaskHasher
369
372
  module.exports.Watcher = nativeBinding.Watcher
370
373
  module.exports.WorkspaceContext = nativeBinding.WorkspaceContext
374
+ module.exports.connectToNxDb = nativeBinding.connectToNxDb
371
375
  module.exports.copy = nativeBinding.copy
372
376
  module.exports.EventType = nativeBinding.EventType
373
377
  module.exports.expandOutputs = nativeBinding.expandOutputs
@@ -14,7 +14,7 @@ const __wasi = new __WASI({
14
14
  const __emnapiContext = __emnapiGetDefaultContext()
15
15
 
16
16
  const __sharedMemory = new WebAssembly.Memory({
17
- initial: 16384,
17
+ initial: 1024,
18
18
  maximum: 32768,
19
19
  shared: true,
20
20
  })
@@ -55,49 +55,63 @@ function __napi_rs_initialize_modules(__napiInstance) {
55
55
  __napiInstance.exports['__napi_register__get_files_for_outputs_1']?.()
56
56
  __napiInstance.exports['__napi_register__remove_2']?.()
57
57
  __napiInstance.exports['__napi_register__copy_3']?.()
58
- __napiInstance.exports['__napi_register__hash_array_4']?.()
59
- __napiInstance.exports['__napi_register__hash_file_5']?.()
60
- __napiInstance.exports['__napi_register__ImportResult_struct_6']?.()
61
- __napiInstance.exports['__napi_register__find_imports_7']?.()
62
- __napiInstance.exports['__napi_register__transfer_project_graph_8']?.()
63
- __napiInstance.exports['__napi_register__ExternalNode_struct_9']?.()
64
- __napiInstance.exports['__napi_register__Target_struct_10']?.()
65
- __napiInstance.exports['__napi_register__Project_struct_11']?.()
66
- __napiInstance.exports['__napi_register__ProjectGraph_struct_12']?.()
67
- __napiInstance.exports['__napi_register__HashPlanner_struct_13']?.()
68
- __napiInstance.exports['__napi_register__HashPlanner_impl_17']?.()
69
- __napiInstance.exports['__napi_register__HashDetails_struct_18']?.()
70
- __napiInstance.exports['__napi_register__HasherOptions_struct_19']?.()
71
- __napiInstance.exports['__napi_register__TaskHasher_struct_20']?.()
72
- __napiInstance.exports['__napi_register__TaskHasher_impl_23']?.()
73
- __napiInstance.exports['__napi_register__Task_struct_24']?.()
74
- __napiInstance.exports['__napi_register__TaskTarget_struct_25']?.()
75
- __napiInstance.exports['__napi_register__TaskGraph_struct_26']?.()
76
- __napiInstance.exports['__napi_register__FileData_struct_27']?.()
77
- __napiInstance.exports['__napi_register__InputsInput_struct_28']?.()
78
- __napiInstance.exports['__napi_register__FileSetInput_struct_29']?.()
79
- __napiInstance.exports['__napi_register__RuntimeInput_struct_30']?.()
80
- __napiInstance.exports['__napi_register__EnvironmentInput_struct_31']?.()
81
- __napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_32']?.()
82
- __napiInstance.exports['__napi_register__DepsOutputsInput_struct_33']?.()
83
- __napiInstance.exports['__napi_register__NxJson_struct_34']?.()
84
- __napiInstance.exports['__napi_register__WorkspaceContext_struct_35']?.()
85
- __napiInstance.exports['__napi_register__WorkspaceContext_impl_44']?.()
86
- __napiInstance.exports['__napi_register__WorkspaceErrors_45']?.()
87
- __napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_46']?.()
88
- __napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_47']?.()
89
- __napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_48']?.()
90
- __napiInstance.exports['__napi_register__FileMap_struct_49']?.()
91
- __napiInstance.exports['__napi_register____test_only_transfer_file_map_50']?.()
92
- __napiInstance.exports['__napi_register__IS_WASM_51']?.()
58
+ __napiInstance.exports['__napi_register__CachedResult_struct_4']?.()
59
+ __napiInstance.exports['__napi_register__NxCache_struct_5']?.()
60
+ __napiInstance.exports['__napi_register__NxCache_impl_13']?.()
61
+ __napiInstance.exports['__napi_register__hash_array_14']?.()
62
+ __napiInstance.exports['__napi_register__hash_file_15']?.()
63
+ __napiInstance.exports['__napi_register__IS_WASM_16']?.()
64
+ __napiInstance.exports['__napi_register__get_binary_target_17']?.()
65
+ __napiInstance.exports['__napi_register__ImportResult_struct_18']?.()
66
+ __napiInstance.exports['__napi_register__find_imports_19']?.()
67
+ __napiInstance.exports['__napi_register__transfer_project_graph_20']?.()
68
+ __napiInstance.exports['__napi_register__ExternalNode_struct_21']?.()
69
+ __napiInstance.exports['__napi_register__Target_struct_22']?.()
70
+ __napiInstance.exports['__napi_register__Project_struct_23']?.()
71
+ __napiInstance.exports['__napi_register__ProjectGraph_struct_24']?.()
72
+ __napiInstance.exports['__napi_register__HashedTask_struct_25']?.()
73
+ __napiInstance.exports['__napi_register__TaskDetails_struct_26']?.()
74
+ __napiInstance.exports['__napi_register__TaskDetails_impl_29']?.()
75
+ __napiInstance.exports['__napi_register__HashPlanner_struct_30']?.()
76
+ __napiInstance.exports['__napi_register__HashPlanner_impl_34']?.()
77
+ __napiInstance.exports['__napi_register__HashDetails_struct_35']?.()
78
+ __napiInstance.exports['__napi_register__HasherOptions_struct_36']?.()
79
+ __napiInstance.exports['__napi_register__TaskHasher_struct_37']?.()
80
+ __napiInstance.exports['__napi_register__TaskHasher_impl_40']?.()
81
+ __napiInstance.exports['__napi_register__TaskRun_struct_41']?.()
82
+ __napiInstance.exports['__napi_register__NxTaskHistory_struct_42']?.()
83
+ __napiInstance.exports['__napi_register__NxTaskHistory_impl_46']?.()
84
+ __napiInstance.exports['__napi_register__Task_struct_47']?.()
85
+ __napiInstance.exports['__napi_register__TaskTarget_struct_48']?.()
86
+ __napiInstance.exports['__napi_register__TaskGraph_struct_49']?.()
87
+ __napiInstance.exports['__napi_register__FileData_struct_50']?.()
88
+ __napiInstance.exports['__napi_register__InputsInput_struct_51']?.()
89
+ __napiInstance.exports['__napi_register__FileSetInput_struct_52']?.()
90
+ __napiInstance.exports['__napi_register__RuntimeInput_struct_53']?.()
91
+ __napiInstance.exports['__napi_register__EnvironmentInput_struct_54']?.()
92
+ __napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_55']?.()
93
+ __napiInstance.exports['__napi_register__DepsOutputsInput_struct_56']?.()
94
+ __napiInstance.exports['__napi_register__NxJson_struct_57']?.()
95
+ __napiInstance.exports['__napi_register__WorkspaceContext_struct_58']?.()
96
+ __napiInstance.exports['__napi_register__WorkspaceContext_impl_67']?.()
97
+ __napiInstance.exports['__napi_register__WorkspaceErrors_68']?.()
98
+ __napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_69']?.()
99
+ __napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_70']?.()
100
+ __napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_71']?.()
101
+ __napiInstance.exports['__napi_register__FileMap_struct_72']?.()
102
+ __napiInstance.exports['__napi_register____test_only_transfer_file_map_73']?.()
93
103
  }
94
104
  export const HashPlanner = __napiModule.exports.HashPlanner
95
105
  export const ImportResult = __napiModule.exports.ImportResult
106
+ export const NxCache = __napiModule.exports.NxCache
107
+ export const NxTaskHistory = __napiModule.exports.NxTaskHistory
108
+ export const TaskDetails = __napiModule.exports.TaskDetails
96
109
  export const TaskHasher = __napiModule.exports.TaskHasher
97
110
  export const WorkspaceContext = __napiModule.exports.WorkspaceContext
98
111
  export const copy = __napiModule.exports.copy
99
112
  export const expandOutputs = __napiModule.exports.expandOutputs
100
113
  export const findImports = __napiModule.exports.findImports
114
+ export const getBinaryTarget = __napiModule.exports.getBinaryTarget
101
115
  export const getFilesForOutputs = __napiModule.exports.getFilesForOutputs
102
116
  export const hashArray = __napiModule.exports.hashArray
103
117
  export const hashFile = __napiModule.exports.hashFile
@@ -86,45 +86,57 @@ function __napi_rs_initialize_modules(__napiInstance) {
86
86
  __napiInstance.exports['__napi_register__get_files_for_outputs_1']?.()
87
87
  __napiInstance.exports['__napi_register__remove_2']?.()
88
88
  __napiInstance.exports['__napi_register__copy_3']?.()
89
- __napiInstance.exports['__napi_register__hash_array_4']?.()
90
- __napiInstance.exports['__napi_register__hash_file_5']?.()
91
- __napiInstance.exports['__napi_register__IS_WASM_6']?.()
92
- __napiInstance.exports['__napi_register__get_binary_target_7']?.()
93
- __napiInstance.exports['__napi_register__ImportResult_struct_8']?.()
94
- __napiInstance.exports['__napi_register__find_imports_9']?.()
95
- __napiInstance.exports['__napi_register__transfer_project_graph_10']?.()
96
- __napiInstance.exports['__napi_register__ExternalNode_struct_11']?.()
97
- __napiInstance.exports['__napi_register__Target_struct_12']?.()
98
- __napiInstance.exports['__napi_register__Project_struct_13']?.()
99
- __napiInstance.exports['__napi_register__ProjectGraph_struct_14']?.()
100
- __napiInstance.exports['__napi_register__HashPlanner_struct_15']?.()
101
- __napiInstance.exports['__napi_register__HashPlanner_impl_19']?.()
102
- __napiInstance.exports['__napi_register__HashDetails_struct_20']?.()
103
- __napiInstance.exports['__napi_register__HasherOptions_struct_21']?.()
104
- __napiInstance.exports['__napi_register__TaskHasher_struct_22']?.()
105
- __napiInstance.exports['__napi_register__TaskHasher_impl_25']?.()
106
- __napiInstance.exports['__napi_register__Task_struct_26']?.()
107
- __napiInstance.exports['__napi_register__TaskTarget_struct_27']?.()
108
- __napiInstance.exports['__napi_register__TaskGraph_struct_28']?.()
109
- __napiInstance.exports['__napi_register__FileData_struct_29']?.()
110
- __napiInstance.exports['__napi_register__InputsInput_struct_30']?.()
111
- __napiInstance.exports['__napi_register__FileSetInput_struct_31']?.()
112
- __napiInstance.exports['__napi_register__RuntimeInput_struct_32']?.()
113
- __napiInstance.exports['__napi_register__EnvironmentInput_struct_33']?.()
114
- __napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_34']?.()
115
- __napiInstance.exports['__napi_register__DepsOutputsInput_struct_35']?.()
116
- __napiInstance.exports['__napi_register__NxJson_struct_36']?.()
117
- __napiInstance.exports['__napi_register__WorkspaceContext_struct_37']?.()
118
- __napiInstance.exports['__napi_register__WorkspaceContext_impl_46']?.()
119
- __napiInstance.exports['__napi_register__WorkspaceErrors_47']?.()
120
- __napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_48']?.()
121
- __napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_49']?.()
122
- __napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_50']?.()
123
- __napiInstance.exports['__napi_register__FileMap_struct_51']?.()
124
- __napiInstance.exports['__napi_register____test_only_transfer_file_map_52']?.()
89
+ __napiInstance.exports['__napi_register__CachedResult_struct_4']?.()
90
+ __napiInstance.exports['__napi_register__NxCache_struct_5']?.()
91
+ __napiInstance.exports['__napi_register__NxCache_impl_13']?.()
92
+ __napiInstance.exports['__napi_register__hash_array_14']?.()
93
+ __napiInstance.exports['__napi_register__hash_file_15']?.()
94
+ __napiInstance.exports['__napi_register__IS_WASM_16']?.()
95
+ __napiInstance.exports['__napi_register__get_binary_target_17']?.()
96
+ __napiInstance.exports['__napi_register__ImportResult_struct_18']?.()
97
+ __napiInstance.exports['__napi_register__find_imports_19']?.()
98
+ __napiInstance.exports['__napi_register__transfer_project_graph_20']?.()
99
+ __napiInstance.exports['__napi_register__ExternalNode_struct_21']?.()
100
+ __napiInstance.exports['__napi_register__Target_struct_22']?.()
101
+ __napiInstance.exports['__napi_register__Project_struct_23']?.()
102
+ __napiInstance.exports['__napi_register__ProjectGraph_struct_24']?.()
103
+ __napiInstance.exports['__napi_register__HashedTask_struct_25']?.()
104
+ __napiInstance.exports['__napi_register__TaskDetails_struct_26']?.()
105
+ __napiInstance.exports['__napi_register__TaskDetails_impl_29']?.()
106
+ __napiInstance.exports['__napi_register__HashPlanner_struct_30']?.()
107
+ __napiInstance.exports['__napi_register__HashPlanner_impl_34']?.()
108
+ __napiInstance.exports['__napi_register__HashDetails_struct_35']?.()
109
+ __napiInstance.exports['__napi_register__HasherOptions_struct_36']?.()
110
+ __napiInstance.exports['__napi_register__TaskHasher_struct_37']?.()
111
+ __napiInstance.exports['__napi_register__TaskHasher_impl_40']?.()
112
+ __napiInstance.exports['__napi_register__TaskRun_struct_41']?.()
113
+ __napiInstance.exports['__napi_register__NxTaskHistory_struct_42']?.()
114
+ __napiInstance.exports['__napi_register__NxTaskHistory_impl_46']?.()
115
+ __napiInstance.exports['__napi_register__Task_struct_47']?.()
116
+ __napiInstance.exports['__napi_register__TaskTarget_struct_48']?.()
117
+ __napiInstance.exports['__napi_register__TaskGraph_struct_49']?.()
118
+ __napiInstance.exports['__napi_register__FileData_struct_50']?.()
119
+ __napiInstance.exports['__napi_register__InputsInput_struct_51']?.()
120
+ __napiInstance.exports['__napi_register__FileSetInput_struct_52']?.()
121
+ __napiInstance.exports['__napi_register__RuntimeInput_struct_53']?.()
122
+ __napiInstance.exports['__napi_register__EnvironmentInput_struct_54']?.()
123
+ __napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_55']?.()
124
+ __napiInstance.exports['__napi_register__DepsOutputsInput_struct_56']?.()
125
+ __napiInstance.exports['__napi_register__NxJson_struct_57']?.()
126
+ __napiInstance.exports['__napi_register__WorkspaceContext_struct_58']?.()
127
+ __napiInstance.exports['__napi_register__WorkspaceContext_impl_67']?.()
128
+ __napiInstance.exports['__napi_register__WorkspaceErrors_68']?.()
129
+ __napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_69']?.()
130
+ __napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_70']?.()
131
+ __napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_71']?.()
132
+ __napiInstance.exports['__napi_register__FileMap_struct_72']?.()
133
+ __napiInstance.exports['__napi_register____test_only_transfer_file_map_73']?.()
125
134
  }
126
135
  module.exports.HashPlanner = __napiModule.exports.HashPlanner
127
136
  module.exports.ImportResult = __napiModule.exports.ImportResult
137
+ module.exports.NxCache = __napiModule.exports.NxCache
138
+ module.exports.NxTaskHistory = __napiModule.exports.NxTaskHistory
139
+ module.exports.TaskDetails = __napiModule.exports.TaskDetails
128
140
  module.exports.TaskHasher = __napiModule.exports.TaskHasher
129
141
  module.exports.WorkspaceContext = __napiModule.exports.WorkspaceContext
130
142
  module.exports.copy = __napiModule.exports.copy
Binary file
@@ -1,5 +1,6 @@
1
1
  import type { CloudTaskRunnerOptions } from './nx-cloud-tasks-runner-shell';
2
2
  import { TasksRunner } from '../tasks-runner/tasks-runner';
3
+ import { RemoteCacheV2 } from '../tasks-runner/default-tasks-runner';
3
4
  export declare class NxCloudEnterpriseOutdatedError extends Error {
4
5
  constructor(url: string);
5
6
  }
@@ -10,6 +11,7 @@ export interface NxCloudClient {
10
11
  configureLightClientRequire: () => (paths: string[]) => void;
11
12
  commands: Record<string, () => Promise<void>>;
12
13
  nxCloudTasksRunner: TasksRunner<CloudTaskRunnerOptions>;
14
+ remoteCache: RemoteCacheV2;
13
15
  }
14
16
  export declare function verifyOrUpdateNxCloudClient(options: CloudTaskRunnerOptions): Promise<{
15
17
  nxCloudClient: NxCloudClient;
@@ -95,7 +95,7 @@ async function getInstallationSupportsGitHub(apiUrl) {
95
95
  return !!response.data.isGithubIntegrationEnabled;
96
96
  }
97
97
  catch (e) {
98
- if (process.env.NX_VERBOSE_LOGGING) {
98
+ if (process.env.NX_VERBOSE_LOGGING === 'true') {
99
99
  devkit_exports_1.logger.warn(`Failed to access system features. GitHub integration assumed to be disabled.
100
100
  ${e}`);
101
101
  }
@@ -18,6 +18,7 @@ export declare function createPackageJson(projectName: string, graph: ProjectGra
18
18
  root?: string;
19
19
  isProduction?: boolean;
20
20
  helperDependencies?: string[];
21
+ skipPackageManager?: boolean;
21
22
  }, fileMap?: ProjectFileMap): PackageJson;
22
23
  export declare function findProjectsNpmDependencies(projectNode: ProjectGraphProjectNode, graph: ProjectGraph, target: string, rootPackageJson: PackageJson, options: {
23
24
  helperDependencies?: string[];
@@ -108,7 +108,7 @@ function createPackageJson(projectName, graph, options = {}, fileMap = null) {
108
108
  packageJson.dependencies &&= (0, object_sort_1.sortObjectByKeys)(packageJson.dependencies);
109
109
  packageJson.peerDependencies &&= (0, object_sort_1.sortObjectByKeys)(packageJson.peerDependencies);
110
110
  packageJson.peerDependenciesMeta &&= (0, object_sort_1.sortObjectByKeys)(packageJson.peerDependenciesMeta);
111
- if (rootPackageJson.packageManager) {
111
+ if (rootPackageJson.packageManager && !options.skipPackageManager) {
112
112
  if (packageJson.packageManager &&
113
113
  packageJson.packageManager !== rootPackageJson.packageManager) {
114
114
  output_1.output.warn({