nx 19.5.1 → 19.5.3
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/nx-cloud.d.ts +2 -1
- package/bin/nx-cloud.js +9 -17
- package/bin/nx.js +1 -1
- package/package.json +12 -12
- package/src/adapter/ngcli-adapter.js +7 -4
- package/src/command-line/connect/command-object.js +6 -0
- package/src/command-line/connect/connect-to-nx-cloud.d.ts +1 -1
- package/src/command-line/connect/connect-to-nx-cloud.js +11 -4
- package/src/command-line/connect/view-logs.js +1 -1
- package/src/command-line/list/list.js +10 -14
- package/src/command-line/migrate/command-object.js +1 -0
- package/src/command-line/release/command-object.js +5 -21
- package/src/command-line/reset/command-object.d.ts +1 -0
- package/src/command-line/reset/command-object.js +4 -0
- package/src/command-line/reset/reset.js +13 -0
- package/src/command-line/run/executor-utils.js +14 -5
- package/src/command-line/run/run.js +2 -14
- package/src/command-line/watch/watch.js +1 -1
- package/src/core/graph/main.js +1 -1
- package/src/daemon/socket-utils.js +1 -1
- package/src/daemon/tmp-dir.d.ts +1 -1
- package/src/daemon/tmp-dir.js +3 -2
- package/src/migrations/update-16-0-0/update-nx-cloud-runner.js +2 -0
- package/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.d.ts +1 -1
- package/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.js +3 -1
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +4 -16
- package/src/nx-cloud/utilities/client.d.ts +10 -0
- package/src/nx-cloud/utilities/client.js +35 -0
- package/src/nx-cloud/utilities/get-cloud-options.d.ts +2 -0
- package/src/nx-cloud/utilities/get-cloud-options.js +8 -0
- package/src/nx-cloud/utilities/url-shorten.d.ts +2 -3
- package/src/nx-cloud/utilities/url-shorten.js +15 -11
- package/src/tasks-runner/run-command.d.ts +4 -4
- package/src/tasks-runner/run-command.js +22 -17
- package/src/tasks-runner/task-graph-utils.d.ts +3 -0
- package/src/tasks-runner/task-graph-utils.js +34 -0
- package/src/tasks-runner/utils.js +9 -6
- package/src/utils/ab-testing.d.ts +1 -1
- package/src/utils/ab-testing.js +2 -1
- package/src/utils/chunkify.d.ts +10 -0
- package/src/utils/chunkify.js +19 -12
- package/src/utils/command-line-utils.d.ts +3 -0
- package/src/utils/command-line-utils.js +11 -7
- package/src/utils/git-utils.js +14 -4
- package/src/utils/plugins/core-plugins.d.ts +6 -3
- package/src/utils/plugins/core-plugins.js +107 -115
- package/src/utils/plugins/index.d.ts +4 -4
- package/src/utils/plugins/index.js +7 -8
- package/src/utils/plugins/installed-plugins.d.ts +2 -3
- package/src/utils/plugins/installed-plugins.js +4 -31
- package/src/utils/plugins/local-plugins.d.ts +2 -3
- package/src/utils/plugins/local-plugins.js +2 -29
- package/src/utils/plugins/output.d.ts +5 -0
- package/src/utils/plugins/output.js +104 -0
- package/src/utils/plugins/plugin-capabilities.d.ts +12 -2
- package/src/utils/plugins/plugin-capabilities.js +2 -80
- package/src/utils/plugins/community-plugins.d.ts +0 -2
- package/src/utils/plugins/community-plugins.js +0 -28
- package/src/utils/plugins/models.d.ts +0 -22
- package/src/utils/plugins/models.js +0 -2
- package/src/utils/plugins/shared.d.ts +0 -1
- package/src/utils/plugins/shared.js +0 -7
package/bin/nx-cloud.d.ts
CHANGED
package/bin/nx-cloud.js
CHANGED
@@ -1,38 +1,30 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
"use strict";
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
|
4
|
+
exports.invokeCommandWithNxCloudClient = invokeCommandWithNxCloudClient;
|
5
5
|
const get_cloud_options_1 = require("../src/nx-cloud/utilities/get-cloud-options");
|
6
6
|
const update_manager_1 = require("../src/nx-cloud/update-manager");
|
7
7
|
const output_1 = require("../src/utils/output");
|
8
|
+
const client_1 = require("../src/nx-cloud/utilities/client");
|
8
9
|
const command = process.argv[2];
|
9
10
|
const options = (0, get_cloud_options_1.getCloudOptions)();
|
10
11
|
Promise.resolve().then(async () => invokeCommandWithNxCloudClient(options));
|
11
12
|
async function invokeCommandWithNxCloudClient(options) {
|
12
13
|
try {
|
13
|
-
const
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
.then(() => process.exit(0))
|
19
|
-
.catch((e) => {
|
20
|
-
console.error(e);
|
21
|
-
process.exit(1);
|
22
|
-
});
|
23
|
-
}
|
24
|
-
else {
|
14
|
+
const client = await (0, client_1.getCloudClient)(options);
|
15
|
+
client.invoke(command);
|
16
|
+
}
|
17
|
+
catch (e) {
|
18
|
+
if (e instanceof client_1.UnknownCommandError) {
|
25
19
|
output_1.output.error({
|
26
|
-
title: `Unknown Command "${command}"`,
|
20
|
+
title: `Unknown Command "${e.command}"`,
|
27
21
|
});
|
28
22
|
output_1.output.log({
|
29
23
|
title: 'Available Commands:',
|
30
|
-
bodyLines:
|
24
|
+
bodyLines: e.availableCommands.map((c) => `- ${c}`),
|
31
25
|
});
|
32
26
|
process.exit(1);
|
33
27
|
}
|
34
|
-
}
|
35
|
-
catch (e) {
|
36
28
|
const body = ['Cannot run commands from the `nx-cloud` CLI.'];
|
37
29
|
if (e instanceof update_manager_1.NxCloudEnterpriseOutdatedError) {
|
38
30
|
try {
|
package/bin/nx.js
CHANGED
@@ -167,7 +167,7 @@ function warnIfUsingOutdatedGlobalInstall(globalNxVersion, localNxVersion) {
|
|
167
167
|
: [];
|
168
168
|
bodyLines.push('For more information, see https://nx.dev/more-concepts/global-nx');
|
169
169
|
output_1.output.warn({
|
170
|
-
title: `
|
170
|
+
title: `It's time to update Nx 🎉`,
|
171
171
|
bodyLines,
|
172
172
|
});
|
173
173
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "19.5.
|
3
|
+
"version": "19.5.3",
|
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.5.
|
74
|
+
"@nrwl/tao": "19.5.3"
|
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.5.
|
90
|
-
"@nx/nx-darwin-arm64": "19.5.
|
91
|
-
"@nx/nx-linux-x64-gnu": "19.5.
|
92
|
-
"@nx/nx-linux-x64-musl": "19.5.
|
93
|
-
"@nx/nx-win32-x64-msvc": "19.5.
|
94
|
-
"@nx/nx-linux-arm64-gnu": "19.5.
|
95
|
-
"@nx/nx-linux-arm64-musl": "19.5.
|
96
|
-
"@nx/nx-linux-arm-gnueabihf": "19.5.
|
97
|
-
"@nx/nx-win32-arm64-msvc": "19.5.
|
98
|
-
"@nx/nx-freebsd-x64": "19.5.
|
89
|
+
"@nx/nx-darwin-x64": "19.5.3",
|
90
|
+
"@nx/nx-darwin-arm64": "19.5.3",
|
91
|
+
"@nx/nx-linux-x64-gnu": "19.5.3",
|
92
|
+
"@nx/nx-linux-x64-musl": "19.5.3",
|
93
|
+
"@nx/nx-win32-x64-msvc": "19.5.3",
|
94
|
+
"@nx/nx-linux-arm64-gnu": "19.5.3",
|
95
|
+
"@nx/nx-linux-arm64-musl": "19.5.3",
|
96
|
+
"@nx/nx-linux-arm-gnueabihf": "19.5.3",
|
97
|
+
"@nx/nx-win32-arm64-msvc": "19.5.3",
|
98
|
+
"@nx/nx-freebsd-x64": "19.5.3"
|
99
99
|
},
|
100
100
|
"nx-migrations": {
|
101
101
|
"migrations": "./migrations.json",
|
@@ -799,13 +799,16 @@ async function getWrappedWorkspaceNodeModulesArchitectHost(workspace, root, proj
|
|
799
799
|
import: (0, schema_utils_1.resolveImplementation)(executorConfig.implementation, (0, path_1.dirname)(executorsFilePath)),
|
800
800
|
};
|
801
801
|
}
|
802
|
-
readExecutorsJson(nodeModule, builder) {
|
803
|
-
const { json: packageJson, path: packageJsonPath } = (0, plugins_1.readPluginPackageJson)(nodeModule, this.projects, this.root
|
802
|
+
readExecutorsJson(nodeModule, builder, extraRequirePaths = []) {
|
803
|
+
const { json: packageJson, path: packageJsonPath } = (0, plugins_1.readPluginPackageJson)(nodeModule, this.projects, this.root
|
804
|
+
? [this.root, __dirname, ...extraRequirePaths]
|
805
|
+
: [__dirname, ...extraRequirePaths]);
|
804
806
|
const executorsFile = packageJson.executors ?? packageJson.builders;
|
805
807
|
if (!executorsFile) {
|
806
808
|
throw new Error(`The "${nodeModule}" package does not support Nx executors or Angular Devkit Builders.`);
|
807
809
|
}
|
808
|
-
const
|
810
|
+
const basePath = (0, path_1.dirname)(packageJsonPath);
|
811
|
+
const executorsFilePath = require.resolve((0, path_1.join)(basePath, executorsFile));
|
809
812
|
const executorsJson = (0, fileutils_1.readJsonFile)(executorsFilePath);
|
810
813
|
const executorConfig = executorsJson.builders?.[builder] ?? executorsJson.executors?.[builder];
|
811
814
|
if (!executorConfig) {
|
@@ -814,7 +817,7 @@ async function getWrappedWorkspaceNodeModulesArchitectHost(workspace, root, proj
|
|
814
817
|
if (typeof executorConfig === 'string') {
|
815
818
|
// Angular CLI can have a builder pointing to another package:builder
|
816
819
|
const [packageName, executorName] = executorConfig.split(':');
|
817
|
-
return this.readExecutorsJson(packageName, executorName);
|
820
|
+
return this.readExecutorsJson(packageName, executorName, [basePath]);
|
818
821
|
}
|
819
822
|
return { executorsFilePath, executorConfig, isNgCompat: true };
|
820
823
|
}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.yargsViewLogsCommand = exports.yargsConnectCommand = void 0;
|
4
4
|
const documentation_1 = require("../yargs-utils/documentation");
|
5
|
+
const versions_1 = require("../../utils/versions");
|
5
6
|
exports.yargsConnectCommand = {
|
6
7
|
command: 'connect',
|
7
8
|
aliases: ['connect-to-nx-cloud'],
|
@@ -9,6 +10,11 @@ exports.yargsConnectCommand = {
|
|
9
10
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)(yargs, 'connect-to-nx-cloud'),
|
10
11
|
handler: async () => {
|
11
12
|
await (await Promise.resolve().then(() => require('./connect-to-nx-cloud'))).connectToNxCloudCommand();
|
13
|
+
await (await Promise.resolve().then(() => require('../../utils/ab-testing'))).recordStat({
|
14
|
+
command: 'connect',
|
15
|
+
nxVersion: versions_1.nxVersion,
|
16
|
+
useCloud: true,
|
17
|
+
});
|
12
18
|
process.exit(0);
|
13
19
|
},
|
14
20
|
};
|
@@ -4,5 +4,5 @@ import { MessageKey } from '../../utils/ab-testing';
|
|
4
4
|
export declare function onlyDefaultRunnerIsUsed(nxJson: NxJsonConfiguration): boolean;
|
5
5
|
export declare function connectToNxCloudIfExplicitlyAsked(opts: NxArgs): Promise<void>;
|
6
6
|
export declare function connectToNxCloudCommand(command?: string): Promise<boolean>;
|
7
|
+
export declare function connectExistingRepoToNxCloudPrompt(command?: string, key?: MessageKey): Promise<boolean>;
|
7
8
|
export declare function connectToNxCloudWithPrompt(command: string): Promise<void>;
|
8
|
-
export declare function connectExistingRepoToNxCloudPrompt(key?: MessageKey): Promise<boolean>;
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.onlyDefaultRunnerIsUsed = onlyDefaultRunnerIsUsed;
|
4
4
|
exports.connectToNxCloudIfExplicitlyAsked = connectToNxCloudIfExplicitlyAsked;
|
5
5
|
exports.connectToNxCloudCommand = connectToNxCloudCommand;
|
6
|
-
exports.connectToNxCloudWithPrompt = connectToNxCloudWithPrompt;
|
7
6
|
exports.connectExistingRepoToNxCloudPrompt = connectExistingRepoToNxCloudPrompt;
|
7
|
+
exports.connectToNxCloudWithPrompt = connectToNxCloudWithPrompt;
|
8
8
|
const output_1 = require("../../utils/output");
|
9
9
|
const configuration_1 = require("../../config/configuration");
|
10
10
|
const tree_1 = require("../../generators/tree");
|
@@ -71,6 +71,16 @@ async function connectToNxCloudCommand(command) {
|
|
71
71
|
await callback();
|
72
72
|
return true;
|
73
73
|
}
|
74
|
+
async function connectExistingRepoToNxCloudPrompt(command = 'init', key = 'setupNxCloud') {
|
75
|
+
const res = await nxCloudPrompt(key).then((value) => value === 'yes');
|
76
|
+
await (0, ab_testing_1.recordStat)({
|
77
|
+
command,
|
78
|
+
nxVersion: versions_1.nxVersion,
|
79
|
+
useCloud: res,
|
80
|
+
meta: ab_testing_1.messages.codeOfSelectedPromptMessage(key),
|
81
|
+
});
|
82
|
+
return res;
|
83
|
+
}
|
74
84
|
async function connectToNxCloudWithPrompt(command) {
|
75
85
|
const setNxCloud = await nxCloudPrompt('setupNxCloud');
|
76
86
|
const useCloud = setNxCloud === 'yes' ? await connectToNxCloudCommand(command) : false;
|
@@ -81,9 +91,6 @@ async function connectToNxCloudWithPrompt(command) {
|
|
81
91
|
meta: ab_testing_1.messages.codeOfSelectedPromptMessage('setupNxCloud'),
|
82
92
|
});
|
83
93
|
}
|
84
|
-
async function connectExistingRepoToNxCloudPrompt(key = 'setupNxCloud') {
|
85
|
-
return nxCloudPrompt(key).then((value) => value === 'yes');
|
86
|
-
}
|
87
94
|
async function nxCloudPrompt(key) {
|
88
95
|
const { message, choices, initial, footer, hint } = ab_testing_1.messages.getPrompt(key);
|
89
96
|
const promptConfig = {
|
@@ -19,7 +19,7 @@ async function viewLogs() {
|
|
19
19
|
});
|
20
20
|
return 1;
|
21
21
|
}
|
22
|
-
const setupNxCloud = await (0, connect_to_nx_cloud_1.connectExistingRepoToNxCloudPrompt)('setupViewLogs');
|
22
|
+
const setupNxCloud = await (0, connect_to_nx_cloud_1.connectExistingRepoToNxCloudPrompt)('view-logs', 'setupViewLogs');
|
23
23
|
if (!setupNxCloud) {
|
24
24
|
return;
|
25
25
|
}
|
@@ -1,12 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.listHandler = listHandler;
|
4
|
-
const
|
4
|
+
const nx_json_1 = require("../../config/nx-json");
|
5
|
+
const project_graph_1 = require("../../project-graph/project-graph");
|
5
6
|
const output_1 = require("../../utils/output");
|
6
7
|
const plugins_1 = require("../../utils/plugins");
|
7
|
-
const
|
8
|
-
const project_graph_1 = require("../../project-graph/project-graph");
|
9
|
-
const nx_json_1 = require("../../config/nx-json");
|
8
|
+
const workspace_root_1 = require("../../utils/workspace-root");
|
10
9
|
/**
|
11
10
|
* List available plugins or capabilities within a specific plugin
|
12
11
|
*
|
@@ -16,31 +15,28 @@ const nx_json_1 = require("../../config/nx-json");
|
|
16
15
|
*
|
17
16
|
*/
|
18
17
|
async function listHandler(args) {
|
19
|
-
const nxJson = (0, nx_json_1.readNxJson)();
|
20
18
|
const projectGraph = await (0, project_graph_1.createProjectGraphAsync)({ exitOnError: true });
|
21
19
|
const projects = (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph);
|
22
20
|
if (args.plugin) {
|
23
21
|
await (0, plugins_1.listPluginCapabilities)(args.plugin, projects.projects);
|
24
22
|
}
|
25
23
|
else {
|
26
|
-
const
|
27
|
-
const localPlugins = await (0,
|
24
|
+
const nxJson = (0, nx_json_1.readNxJson)();
|
25
|
+
const localPlugins = await (0, plugins_1.getLocalWorkspacePlugins)(projects, nxJson);
|
28
26
|
const installedPlugins = await (0, plugins_1.getInstalledPluginsAndCapabilities)(workspace_root_1.workspaceRoot, projects.projects);
|
29
27
|
if (localPlugins.size) {
|
30
|
-
(0,
|
28
|
+
(0, plugins_1.listPlugins)(localPlugins, 'Local workspace plugins:');
|
31
29
|
}
|
32
|
-
(0, plugins_1.
|
33
|
-
(0, plugins_1.
|
30
|
+
(0, plugins_1.listPlugins)(installedPlugins, 'Installed plugins:');
|
31
|
+
(0, plugins_1.listAlsoAvailableCorePlugins)(installedPlugins);
|
34
32
|
output_1.output.note({
|
35
33
|
title: 'Community Plugins',
|
36
34
|
bodyLines: [
|
37
35
|
'Looking for a technology / framework not listed above?',
|
38
36
|
'There are many excellent plugins maintained by the Nx community.',
|
39
|
-
'Search for the one you need here: https://nx.dev/
|
37
|
+
'Search for the one you need here: https://nx.dev/plugin-registry.',
|
40
38
|
],
|
41
39
|
});
|
42
|
-
output_1.output.note({
|
43
|
-
title: `Use "nx list [plugin]" to find out more`,
|
44
|
-
});
|
40
|
+
output_1.output.note({ title: `Use "nx list [plugin]" to find out more` });
|
45
41
|
}
|
46
42
|
}
|
@@ -120,6 +120,7 @@ function nxCliPath() {
|
|
120
120
|
},
|
121
121
|
license: 'MIT',
|
122
122
|
});
|
123
|
+
(0, package_manager_1.copyPackageManagerConfigurationFiles)(workspace_root_1.workspaceRoot, tmpDir);
|
123
124
|
if (pmc.preInstall) {
|
124
125
|
// ensure package.json and repo in tmp folder is set to a proper package manager state
|
125
126
|
(0, child_process_2.execSync)(pmc.preInstall, {
|
@@ -5,6 +5,7 @@ const yargs_1 = require("yargs");
|
|
5
5
|
const nx_json_1 = require("../../config/nx-json");
|
6
6
|
const logger_1 = require("../../utils/logger");
|
7
7
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
8
|
+
const command_line_utils_1 = require("../../utils/command-line-utils");
|
8
9
|
exports.yargsReleaseCommand = {
|
9
10
|
command: 'release',
|
10
11
|
describe: 'Orchestrate versioning and publishing of applications and libraries',
|
@@ -223,27 +224,10 @@ const planCommand = {
|
|
223
224
|
},
|
224
225
|
};
|
225
226
|
function coerceParallelOption(args) {
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
};
|
231
|
-
}
|
232
|
-
else if (args['parallel'] === 'true' ||
|
233
|
-
args['parallel'] === true ||
|
234
|
-
args['parallel'] === '') {
|
235
|
-
return {
|
236
|
-
...args,
|
237
|
-
parallel: Number(args['maxParallel'] || args['max-parallel'] || 3),
|
238
|
-
};
|
239
|
-
}
|
240
|
-
else if (args['parallel'] !== undefined) {
|
241
|
-
return {
|
242
|
-
...args,
|
243
|
-
parallel: Number(args['parallel']),
|
244
|
-
};
|
245
|
-
}
|
246
|
-
return args;
|
227
|
+
return {
|
228
|
+
...args,
|
229
|
+
parallel: (0, command_line_utils_1.readParallelFromArgsAndEnv)(args),
|
230
|
+
};
|
247
231
|
}
|
248
232
|
function withGitCommitAndGitTagOptions(yargs) {
|
249
233
|
return yargs
|
@@ -13,6 +13,10 @@ exports.yargsResetCommand = {
|
|
13
13
|
.option('onlyDaemon', {
|
14
14
|
description: 'Stops the Nx Daemon, it will be restarted fresh when the next Nx command is run.',
|
15
15
|
type: 'boolean',
|
16
|
+
})
|
17
|
+
.option('onlyCloud', {
|
18
|
+
description: 'Resets the Nx Cloud client. NOTE: Does not clear the remote cache.',
|
19
|
+
type: 'boolean',
|
16
20
|
})
|
17
21
|
.option('onlyWorkspaceData', {
|
18
22
|
description: 'Clears the workspace data directory. Used by Nx to store cached data about the current workspace (e.g. partial results, incremental data, etc)',
|
@@ -6,6 +6,8 @@ const client_1 = require("../../daemon/client/client");
|
|
6
6
|
const cache_directory_1 = require("../../utils/cache-directory");
|
7
7
|
const output_1 = require("../../utils/output");
|
8
8
|
const native_file_cache_location_1 = require("../../native/native-file-cache-location");
|
9
|
+
const client_2 = require("../../nx-cloud/utilities/client");
|
10
|
+
const get_cloud_options_1 = require("../../nx-cloud/utilities/get-cloud-options");
|
9
11
|
// Wait at max 5 seconds before giving up on a failing operation.
|
10
12
|
const INCREMENTAL_BACKOFF_MAX_DURATION = 5000;
|
11
13
|
// If an operation fails, wait 100ms before first retry.
|
@@ -61,6 +63,9 @@ async function resetHandler(args) {
|
|
61
63
|
errors.push('Failed to clean up the workspace data directory.');
|
62
64
|
}
|
63
65
|
}
|
66
|
+
if (all || args.onlyCloud) {
|
67
|
+
await resetCloudClient();
|
68
|
+
}
|
64
69
|
if (errors.length > 0) {
|
65
70
|
output_1.output.error({
|
66
71
|
title: 'Failed to reset the Nx workspace.',
|
@@ -77,6 +82,14 @@ async function resetHandler(args) {
|
|
77
82
|
function killDaemon() {
|
78
83
|
return client_1.daemonClient.stop();
|
79
84
|
}
|
85
|
+
async function resetCloudClient() {
|
86
|
+
// Remove nx cloud marker files. This helps if the use happens to run `nx-cloud start-ci-run` or
|
87
|
+
// similar commands on their local machine.
|
88
|
+
try {
|
89
|
+
(await (0, client_2.getCloudClient)((0, get_cloud_options_1.getCloudOptions)())).invoke('cleanup');
|
90
|
+
}
|
91
|
+
catch { }
|
92
|
+
}
|
80
93
|
function cleanupCacheEntries() {
|
81
94
|
return incrementalBackoff(INCREMENTAL_BACKOFF_FIRST_DELAY, INCREMENTAL_BACKOFF_MAX_DURATION, () => {
|
82
95
|
(0, fs_extra_1.rmSync)(cache_directory_1.cacheDir, { recursive: true, force: true });
|
@@ -53,15 +53,22 @@ function getExecutorInformation(nodeModule, executor, root, projects) {
|
|
53
53
|
throw new Error(`Unable to resolve ${nodeModule}:${executor}.\n${e.message}`);
|
54
54
|
}
|
55
55
|
}
|
56
|
-
function readExecutorJson(nodeModule, executor, root, projects) {
|
56
|
+
function readExecutorJson(nodeModule, executor, root, projects, extraRequirePaths = []) {
|
57
57
|
const { json: packageJson, path: packageJsonPath } = (0, plugins_1.readPluginPackageJson)(nodeModule, projects, root
|
58
|
-
? [
|
59
|
-
|
58
|
+
? [
|
59
|
+
root,
|
60
|
+
__dirname,
|
61
|
+
process.cwd(),
|
62
|
+
...(0, installation_directory_1.getNxRequirePaths)(),
|
63
|
+
...extraRequirePaths,
|
64
|
+
]
|
65
|
+
: [__dirname, process.cwd(), ...(0, installation_directory_1.getNxRequirePaths)(), ...extraRequirePaths]);
|
60
66
|
const executorsFile = packageJson.executors ?? packageJson.builders;
|
61
67
|
if (!executorsFile) {
|
62
68
|
throw new Error(`The "${nodeModule}" package does not support Nx executors.`);
|
63
69
|
}
|
64
|
-
const
|
70
|
+
const basePath = (0, path_1.dirname)(packageJsonPath);
|
71
|
+
const executorsFilePath = require.resolve((0, path_1.join)(basePath, executorsFile));
|
65
72
|
const executorsJson = (0, fileutils_1.readJsonFile)(executorsFilePath);
|
66
73
|
const executorConfig = executorsJson.executors?.[executor] || executorsJson.builders?.[executor];
|
67
74
|
if (!executorConfig) {
|
@@ -70,7 +77,9 @@ function readExecutorJson(nodeModule, executor, root, projects) {
|
|
70
77
|
if (typeof executorConfig === 'string') {
|
71
78
|
// Angular CLI can have a builder pointing to another package:builder
|
72
79
|
const [packageName, executorName] = executorConfig.split(':');
|
73
|
-
return readExecutorJson(packageName, executorName, root, projects
|
80
|
+
return readExecutorJson(packageName, executorName, root, projects, [
|
81
|
+
basePath,
|
82
|
+
]);
|
74
83
|
}
|
75
84
|
const isNgCompat = !executorsJson.executors?.[executor];
|
76
85
|
return { executorsFilePath, executorConfig, isNgCompat };
|
@@ -35,20 +35,8 @@ async function* promiseToIterator(v) {
|
|
35
35
|
yield await v;
|
36
36
|
}
|
37
37
|
async function iteratorToProcessStatusCode(i) {
|
38
|
-
|
39
|
-
|
40
|
-
// on version 12.0.1, a SASS compilation implementation was
|
41
|
-
// introduced making use of workers and it's unref()-ing the worker
|
42
|
-
// too early, causing the process to exit early in environments
|
43
|
-
// like CI or when running Docker builds.
|
44
|
-
const keepProcessAliveInterval = setInterval(() => { }, 1000);
|
45
|
-
try {
|
46
|
-
const { success } = await (0, async_iterator_1.getLastValueFromAsyncIterableIterator)(i);
|
47
|
-
return success ? 0 : 1;
|
48
|
-
}
|
49
|
-
finally {
|
50
|
-
clearInterval(keepProcessAliveInterval);
|
51
|
-
}
|
38
|
+
const { success } = await (0, async_iterator_1.getLastValueFromAsyncIterableIterator)(i);
|
39
|
+
return success ? 0 : 1;
|
52
40
|
}
|
53
41
|
async function parseExecutorAndTarget({ project, target }, root, projectsConfigurations) {
|
54
42
|
const proj = projectsConfigurations.projects[project];
|
@@ -117,7 +117,7 @@ async function watch(args) {
|
|
117
117
|
if (args.verbose) {
|
118
118
|
process.env.NX_VERBOSE_LOGGING = 'true';
|
119
119
|
}
|
120
|
-
if (client_1.daemonClient.enabled()) {
|
120
|
+
if (!client_1.daemonClient.enabled()) {
|
121
121
|
output_1.output.error({
|
122
122
|
title: 'Daemon is not running. The watch command is not supported without the Nx Daemon.',
|
123
123
|
});
|