nx 19.6.2 → 19.7.0-beta.1

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 (38) hide show
  1. package/package.json +12 -12
  2. package/src/daemon/client/client.d.ts +3 -6
  3. package/src/daemon/client/client.js +5 -4
  4. package/src/daemon/message-types/task-history.d.ts +9 -9
  5. package/src/daemon/message-types/task-history.js +7 -7
  6. package/src/daemon/server/handle-task-history.d.ts +9 -0
  7. package/src/daemon/server/handle-task-history.js +28 -0
  8. package/src/daemon/server/server.js +4 -5
  9. package/src/hasher/hash-task.js +36 -1
  10. package/src/native/index.d.ts +45 -4
  11. package/src/native/native-bindings.js +4 -0
  12. package/src/native/nx.wasi-browser.js +50 -36
  13. package/src/native/nx.wasi.cjs +48 -36
  14. package/src/native/nx.wasm32-wasi.wasm +0 -0
  15. package/src/nx-cloud/update-manager.d.ts +2 -0
  16. package/src/tasks-runner/cache.d.ts +21 -2
  17. package/src/tasks-runner/cache.js +117 -25
  18. package/src/tasks-runner/default-tasks-runner.d.ts +6 -0
  19. package/src/tasks-runner/default-tasks-runner.js +34 -1
  20. package/src/tasks-runner/life-cycles/task-history-life-cycle-old.d.ts +9 -0
  21. package/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +54 -0
  22. package/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts +1 -0
  23. package/src/tasks-runner/life-cycles/task-history-life-cycle.js +19 -21
  24. package/src/tasks-runner/run-command.js +3 -1
  25. package/src/tasks-runner/task-orchestrator.js +10 -1
  26. package/src/utils/cache-directory.d.ts +1 -0
  27. package/src/utils/cache-directory.js +7 -3
  28. package/src/utils/db-connection.d.ts +2 -0
  29. package/src/utils/db-connection.js +11 -0
  30. package/src/utils/legacy-task-history.d.ts +8 -0
  31. package/src/utils/legacy-task-history.js +87 -0
  32. package/src/utils/task-history.d.ts +6 -8
  33. package/src/utils/task-history.js +16 -88
  34. package/src/utils/workspace-context.js +1 -1
  35. package/src/daemon/server/handle-get-task-history.d.ts +0 -4
  36. package/src/daemon/server/handle-get-task-history.js +0 -11
  37. package/src/daemon/server/handle-write-task-runs-to-history.d.ts +0 -5
  38. package/src/daemon/server/handle-write-task-runs-to-history.js +0 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "19.6.2",
3
+ "version": "19.7.0-beta.1",
4
4
  "private": false,
5
5
  "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
6
6
  "repository": {
@@ -71,7 +71,7 @@
71
71
  "yargs-parser": "21.1.1",
72
72
  "node-machine-id": "1.1.12",
73
73
  "ora": "5.3.0",
74
- "@nrwl/tao": "19.6.2"
74
+ "@nrwl/tao": "19.7.0-beta.1"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "@swc-node/register": "^1.8.0",
@@ -86,16 +86,16 @@
86
86
  }
87
87
  },
88
88
  "optionalDependencies": {
89
- "@nx/nx-darwin-x64": "19.6.2",
90
- "@nx/nx-darwin-arm64": "19.6.2",
91
- "@nx/nx-linux-x64-gnu": "19.6.2",
92
- "@nx/nx-linux-x64-musl": "19.6.2",
93
- "@nx/nx-win32-x64-msvc": "19.6.2",
94
- "@nx/nx-linux-arm64-gnu": "19.6.2",
95
- "@nx/nx-linux-arm64-musl": "19.6.2",
96
- "@nx/nx-linux-arm-gnueabihf": "19.6.2",
97
- "@nx/nx-win32-arm64-msvc": "19.6.2",
98
- "@nx/nx-freebsd-x64": "19.6.2"
89
+ "@nx/nx-darwin-x64": "19.7.0-beta.1",
90
+ "@nx/nx-darwin-arm64": "19.7.0-beta.1",
91
+ "@nx/nx-linux-x64-gnu": "19.7.0-beta.1",
92
+ "@nx/nx-linux-x64-musl": "19.7.0-beta.1",
93
+ "@nx/nx-win32-x64-msvc": "19.7.0-beta.1",
94
+ "@nx/nx-linux-arm64-gnu": "19.7.0-beta.1",
95
+ "@nx/nx-linux-arm64-musl": "19.7.0-beta.1",
96
+ "@nx/nx-linux-arm-gnueabihf": "19.7.0-beta.1",
97
+ "@nx/nx-win32-arm64-msvc": "19.7.0-beta.1",
98
+ "@nx/nx-freebsd-x64": "19.7.0-beta.1"
99
99
  },
100
100
  "nx-migrations": {
101
101
  "migrations": "./migrations.json",
@@ -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
  }
@@ -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;