nx 19.8.0-canary.20240912-b6140d4 → 19.8.0-canary.20240913-5bbaffb
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +12 -12
- package/src/command-line/add/add.js +2 -2
- package/src/command-line/affected/command-object.js +6 -6
- package/src/command-line/deprecated/command-objects.js +3 -3
- package/src/command-line/generate/generate.js +2 -1
- package/src/command-line/generate/generator-utils.d.ts +2 -1
- package/src/command-line/import/command-object.js +3 -3
- package/src/command-line/login/login.js +2 -2
- package/src/command-line/logout/logout.js +2 -2
- package/src/command-line/migrate/migrate.js +2 -2
- package/src/command-line/new/new.js +2 -1
- package/src/command-line/release/changelog.js +2 -2
- package/src/command-line/release/plan-check.js +2 -2
- package/src/command-line/release/plan.js +2 -2
- package/src/command-line/release/publish.js +2 -2
- package/src/command-line/release/release.js +2 -2
- package/src/command-line/release/version.js +2 -1
- package/src/command-line/repair/repair.js +2 -2
- package/src/command-line/run/command-object.js +3 -3
- package/src/command-line/run/run.js +3 -2
- package/src/command-line/run-many/command-object.js +2 -2
- package/src/command-line/show/command-object.js +3 -3
- package/src/command-line/sync/command-object.js +2 -2
- package/src/command-line/sync/sync.js +2 -2
- package/src/daemon/client/client.d.ts +2 -1
- package/src/daemon/client/client.js +7 -0
- package/src/daemon/message-types/task-history.d.ts +9 -3
- package/src/daemon/message-types/task-history.js +10 -2
- package/src/daemon/server/handle-task-history.d.ts +5 -1
- package/src/daemon/server/handle-task-history.js +11 -9
- package/src/daemon/server/server.js +5 -2
- package/src/native/index.d.ts +1 -0
- package/src/native/nx.wasi.cjs +20 -20
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +0 -1
- package/src/nx-cloud/utilities/get-cloud-options.d.ts +1 -0
- package/src/nx-cloud/utilities/get-cloud-options.js +4 -0
- package/src/nx-cloud/utilities/is-workspace-claimed.d.ts +1 -1
- package/src/nx-cloud/utilities/is-workspace-claimed.js +6 -5
- package/src/nx-cloud/utilities/onboarding.js +2 -2
- package/src/plugins/js/utils/register.js +7 -0
- package/src/project-graph/error-types.d.ts +1 -1
- package/src/project-graph/error-types.js +19 -5
- package/src/tasks-runner/life-cycles/task-history-life-cycle.js +1 -1
- package/src/tasks-runner/run-command.js +2 -2
- package/src/tasks-runner/task-orchestrator.js +4 -1
- package/src/tasks-runner/tasks-schedule.d.ts +3 -0
- package/src/tasks-runner/tasks-schedule.js +22 -4
- package/src/utils/handle-errors.d.ts +1 -0
- package/src/utils/handle-errors.js +71 -0
- package/src/utils/nx-cloud-utils.d.ts +0 -1
- package/src/utils/nx-cloud-utils.js +0 -10
- package/src/utils/params.d.ts +0 -1
- package/src/utils/params.js +0 -50
- package/src/utils/plugins/plugin-capabilities.js +4 -1
- package/src/utils/task-history.d.ts +12 -1
- package/src/utils/task-history.js +23 -0
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.TaskHistory = void 0;
|
4
|
+
exports.getTaskHistory = getTaskHistory;
|
4
5
|
const client_1 = require("../daemon/client/client");
|
5
6
|
const is_on_daemon_1 = require("../daemon/is-on-daemon");
|
6
7
|
const native_1 = require("../native");
|
@@ -9,6 +10,17 @@ class TaskHistory {
|
|
9
10
|
constructor() {
|
10
11
|
this.taskHistory = new native_1.NxTaskHistory((0, db_connection_1.getDbConnection)());
|
11
12
|
}
|
13
|
+
/**
|
14
|
+
* This function returns estimated timings per task
|
15
|
+
* @param targets
|
16
|
+
* @returns a map where key is task id (project:target:configuration), value is average time of historical runs
|
17
|
+
*/
|
18
|
+
async getEstimatedTaskTimings(targets) {
|
19
|
+
if ((0, is_on_daemon_1.isOnDaemon)() || !client_1.daemonClient.enabled()) {
|
20
|
+
return this.taskHistory.getEstimatedTaskTimings(targets);
|
21
|
+
}
|
22
|
+
return await client_1.daemonClient.getEstimatedTaskTimings(targets);
|
23
|
+
}
|
12
24
|
async getFlakyTasks(hashes) {
|
13
25
|
if ((0, is_on_daemon_1.isOnDaemon)() || !client_1.daemonClient.enabled()) {
|
14
26
|
return this.taskHistory.getFlakyTasks(hashes);
|
@@ -23,3 +35,14 @@ class TaskHistory {
|
|
23
35
|
}
|
24
36
|
}
|
25
37
|
exports.TaskHistory = TaskHistory;
|
38
|
+
let taskHistory;
|
39
|
+
/**
|
40
|
+
* This function returns the singleton instance of TaskHistory
|
41
|
+
* @returns singleton instance of TaskHistory
|
42
|
+
*/
|
43
|
+
function getTaskHistory() {
|
44
|
+
if (!taskHistory) {
|
45
|
+
taskHistory = new TaskHistory();
|
46
|
+
}
|
47
|
+
return taskHistory;
|
48
|
+
}
|