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.
- package/package.json +12 -12
- package/src/daemon/client/client.d.ts +3 -6
- package/src/daemon/client/client.js +5 -4
- package/src/daemon/message-types/task-history.d.ts +9 -9
- package/src/daemon/message-types/task-history.js +7 -7
- package/src/daemon/server/handle-task-history.d.ts +9 -0
- package/src/daemon/server/handle-task-history.js +28 -0
- package/src/daemon/server/server.js +4 -5
- package/src/hasher/hash-task.js +36 -1
- package/src/native/index.d.ts +45 -4
- package/src/native/native-bindings.js +4 -0
- package/src/native/nx.wasi-browser.js +50 -36
- package/src/native/nx.wasi.cjs +48 -36
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/update-manager.d.ts +2 -0
- package/src/tasks-runner/cache.d.ts +21 -2
- package/src/tasks-runner/cache.js +117 -25
- package/src/tasks-runner/default-tasks-runner.d.ts +6 -0
- package/src/tasks-runner/default-tasks-runner.js +34 -1
- package/src/tasks-runner/life-cycles/task-history-life-cycle-old.d.ts +9 -0
- package/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +54 -0
- package/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts +1 -0
- package/src/tasks-runner/life-cycles/task-history-life-cycle.js +19 -21
- package/src/tasks-runner/run-command.js +3 -1
- package/src/tasks-runner/task-orchestrator.js +10 -1
- package/src/utils/cache-directory.d.ts +1 -0
- package/src/utils/cache-directory.js +7 -3
- package/src/utils/db-connection.d.ts +2 -0
- package/src/utils/db-connection.js +11 -0
- package/src/utils/legacy-task-history.d.ts +8 -0
- package/src/utils/legacy-task-history.js +87 -0
- package/src/utils/task-history.d.ts +6 -8
- package/src/utils/task-history.js +16 -88
- package/src/utils/workspace-context.js +1 -1
- package/src/daemon/server/handle-get-task-history.d.ts +0 -4
- package/src/daemon/server/handle-get-task-history.js +0 -11
- package/src/daemon/server/handle-write-task-runs-to-history.d.ts +0 -5
- 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.
|
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.
|
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.
|
90
|
-
"@nx/nx-darwin-arm64": "19.
|
91
|
-
"@nx/nx-linux-x64-gnu": "19.
|
92
|
-
"@nx/nx-linux-x64-musl": "19.
|
93
|
-
"@nx/nx-win32-x64-msvc": "19.
|
94
|
-
"@nx/nx-linux-arm64-gnu": "19.
|
95
|
-
"@nx/nx-linux-arm64-musl": "19.
|
96
|
-
"@nx/nx-linux-arm-gnueabihf": "19.
|
97
|
-
"@nx/nx-win32-arm64-msvc": "19.
|
98
|
-
"@nx/nx-freebsd-x64": "19.
|
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
|
-
|
55
|
-
|
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
|
-
|
239
|
+
getFlakyTasks(hashes) {
|
239
240
|
const message = {
|
240
|
-
type:
|
241
|
+
type: task_history_1.GET_FLAKY_TASKS,
|
241
242
|
hashes,
|
242
243
|
};
|
243
244
|
return this.sendToDaemonViaQueue(message);
|
244
245
|
}
|
245
|
-
|
246
|
+
recordTaskRuns(taskRuns) {
|
246
247
|
const message = {
|
247
|
-
type:
|
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 '../../
|
2
|
-
export declare const
|
3
|
-
export type
|
4
|
-
type: typeof
|
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
|
8
|
-
export declare const
|
9
|
-
export type
|
10
|
-
type: typeof
|
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
|
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.
|
4
|
-
exports.
|
3
|
+
exports.RECORD_TASK_RUNS = exports.GET_FLAKY_TASKS = void 0;
|
4
|
+
exports.isHandleGetFlakyTasksMessage = isHandleGetFlakyTasksMessage;
|
5
5
|
exports.isHandleWriteTaskRunsToHistoryMessage = isHandleWriteTaskRunsToHistoryMessage;
|
6
|
-
exports.
|
7
|
-
function
|
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.
|
11
|
+
message['type'] === exports.GET_FLAKY_TASKS);
|
12
12
|
}
|
13
|
-
exports.
|
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.
|
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
|
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.
|
144
|
-
await handleResult(socket, 'GET_TASK_HISTORY_FOR_HASHES', () => (0,
|
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,
|
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));
|
package/src/hasher/hash-task.js
CHANGED
@@ -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
|
}
|
package/src/native/index.d.ts
CHANGED
@@ -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:
|
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['
|
59
|
-
__napiInstance.exports['
|
60
|
-
__napiInstance.exports['
|
61
|
-
__napiInstance.exports['
|
62
|
-
__napiInstance.exports['
|
63
|
-
__napiInstance.exports['
|
64
|
-
__napiInstance.exports['
|
65
|
-
__napiInstance.exports['
|
66
|
-
__napiInstance.exports['
|
67
|
-
__napiInstance.exports['
|
68
|
-
__napiInstance.exports['
|
69
|
-
__napiInstance.exports['
|
70
|
-
__napiInstance.exports['
|
71
|
-
__napiInstance.exports['
|
72
|
-
__napiInstance.exports['
|
73
|
-
__napiInstance.exports['
|
74
|
-
__napiInstance.exports['
|
75
|
-
__napiInstance.exports['
|
76
|
-
__napiInstance.exports['
|
77
|
-
__napiInstance.exports['
|
78
|
-
__napiInstance.exports['
|
79
|
-
__napiInstance.exports['
|
80
|
-
__napiInstance.exports['
|
81
|
-
__napiInstance.exports['
|
82
|
-
__napiInstance.exports['
|
83
|
-
__napiInstance.exports['
|
84
|
-
__napiInstance.exports['
|
85
|
-
__napiInstance.exports['
|
86
|
-
__napiInstance.exports['
|
87
|
-
__napiInstance.exports['
|
88
|
-
__napiInstance.exports['
|
89
|
-
__napiInstance.exports['
|
90
|
-
__napiInstance.exports['
|
91
|
-
__napiInstance.exports['
|
92
|
-
__napiInstance.exports['
|
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
|
package/src/native/nx.wasi.cjs
CHANGED
@@ -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['
|
90
|
-
__napiInstance.exports['
|
91
|
-
__napiInstance.exports['
|
92
|
-
__napiInstance.exports['
|
93
|
-
__napiInstance.exports['
|
94
|
-
__napiInstance.exports['
|
95
|
-
__napiInstance.exports['
|
96
|
-
__napiInstance.exports['
|
97
|
-
__napiInstance.exports['
|
98
|
-
__napiInstance.exports['
|
99
|
-
__napiInstance.exports['
|
100
|
-
__napiInstance.exports['
|
101
|
-
__napiInstance.exports['
|
102
|
-
__napiInstance.exports['
|
103
|
-
__napiInstance.exports['
|
104
|
-
__napiInstance.exports['
|
105
|
-
__napiInstance.exports['
|
106
|
-
__napiInstance.exports['
|
107
|
-
__napiInstance.exports['
|
108
|
-
__napiInstance.exports['
|
109
|
-
__napiInstance.exports['
|
110
|
-
__napiInstance.exports['
|
111
|
-
__napiInstance.exports['
|
112
|
-
__napiInstance.exports['
|
113
|
-
__napiInstance.exports['
|
114
|
-
__napiInstance.exports['
|
115
|
-
__napiInstance.exports['
|
116
|
-
__napiInstance.exports['
|
117
|
-
__napiInstance.exports['
|
118
|
-
__napiInstance.exports['
|
119
|
-
__napiInstance.exports['
|
120
|
-
__napiInstance.exports['
|
121
|
-
__napiInstance.exports['
|
122
|
-
__napiInstance.exports['
|
123
|
-
__napiInstance.exports['
|
124
|
-
__napiInstance.exports['
|
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;
|