nx 21.0.0-beta.7 → 21.0.0-beta.9
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/migrations.json +5 -35
- package/package.json +11 -11
- package/schemas/nx-schema.json +34 -38
- package/schemas/project-schema.json +5 -0
- package/src/command-line/migrate/migrate-ui-api.d.ts +2 -0
- package/src/command-line/migrate/migrate-ui-api.js +39 -0
- package/src/command-line/migrate/migrate.d.ts +0 -4
- package/src/command-line/migrate/migrate.js +8 -21
- package/src/command-line/release/command-object.d.ts +6 -0
- package/src/command-line/release/config/config.js +15 -8
- package/src/command-line/release/config/use-legacy-versioning.js +4 -4
- package/src/command-line/release/version/release-group-processor.d.ts +10 -9
- package/src/command-line/release/version/release-group-processor.js +25 -8
- package/src/command-line/release/version/test-utils.d.ts +2 -4
- package/src/command-line/release/version/test-utils.js +13 -14
- package/src/command-line/release/version/version-actions.d.ts +9 -8
- package/src/command-line/release/version/version-actions.js +21 -9
- package/src/command-line/release/version.js +6 -2
- package/src/command-line/repair/repair.js +0 -1
- package/src/command-line/run/executor-utils.d.ts +6 -1
- package/src/command-line/run/executor-utils.js +10 -1
- package/src/command-line/run/run.js +1 -1
- package/src/config/misc-interfaces.d.ts +1 -1
- package/src/config/nx-json.d.ts +15 -9
- package/src/config/workspace-json-project-json.d.ts +2 -2
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.css +1 -1
- package/src/devkit-internals.d.ts +1 -1
- package/src/devkit-internals.js +2 -1
- package/src/migrations/{update-17-0-0/rm-default-collection-npm-scope.d.ts → update-21-0-0/release-version-config-changes.d.ts} +1 -1
- package/src/migrations/update-21-0-0/release-version-config-changes.js +111 -0
- package/src/native/index.d.ts +2 -0
- package/src/native/native-bindings.js +1 -0
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/plugins/js/lock-file/utils/package-json.js +6 -5
- package/src/plugins/js/lock-file/utils/pnpm-normalizer.js +3 -3
- package/src/plugins/package-json/create-nodes.js +1 -1
- package/src/project-graph/file-utils.d.ts +1 -10
- package/src/project-graph/file-utils.js +2 -77
- package/src/project-graph/plugins/public-api.d.ts +1 -1
- package/src/project-graph/utils/project-configuration-utils.d.ts +2 -2
- package/src/project-graph/utils/project-configuration-utils.js +29 -10
- package/src/tasks-runner/batch/run-batch.js +1 -1
- package/src/tasks-runner/create-task-graph.d.ts +0 -1
- package/src/tasks-runner/create-task-graph.js +0 -1
- package/src/tasks-runner/init-tasks-runner.d.ts +1 -1
- package/src/tasks-runner/init-tasks-runner.js +8 -2
- package/src/tasks-runner/life-cycles/task-history-life-cycle-old.d.ts +2 -0
- package/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +8 -5
- package/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts +5 -0
- package/src/tasks-runner/life-cycles/task-history-life-cycle.js +29 -4
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +2 -0
- package/src/tasks-runner/run-command.d.ts +1 -0
- package/src/tasks-runner/run-command.js +4 -6
- package/src/tasks-runner/task-orchestrator.d.ts +2 -1
- package/src/tasks-runner/task-orchestrator.js +12 -6
- package/src/tasks-runner/utils.js +1 -1
- package/src/utils/package-json.d.ts +1 -1
- package/src/utils/package-json.js +16 -2
- package/src/migrations/update-17-0-0/move-cache-directory.d.ts +0 -2
- package/src/migrations/update-17-0-0/move-cache-directory.js +0 -35
- package/src/migrations/update-17-0-0/rm-default-collection-npm-scope.js +0 -72
- package/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.d.ts +0 -2
- package/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +0 -122
- package/src/migrations/update-17-2-0/move-default-base.d.ts +0 -5
- package/src/migrations/update-17-2-0/move-default-base.js +0 -21
- package/src/migrations/update-17-3-0/nx-release-path.d.ts +0 -3
- package/src/migrations/update-17-3-0/nx-release-path.js +0 -47
- package/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.d.ts +0 -2
- package/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.js +0 -11
@@ -1,122 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.default = migrate;
|
4
|
-
const json_1 = require("../../generators/utils/json");
|
5
|
-
const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
|
6
|
-
const nx_json_1 = require("../../generators/utils/nx-json");
|
7
|
-
const update_manager_1 = require("../../nx-cloud/update-manager");
|
8
|
-
const run_command_1 = require("../../tasks-runner/run-command");
|
9
|
-
const output_1 = require("../../utils/output");
|
10
|
-
async function migrate(tree) {
|
11
|
-
if (!tree.exists('nx.json')) {
|
12
|
-
return;
|
13
|
-
}
|
14
|
-
const nxJson = (0, nx_json_1.readNxJson)(tree);
|
15
|
-
// Already migrated
|
16
|
-
if (!nxJson.tasksRunnerOptions?.default) {
|
17
|
-
return;
|
18
|
-
}
|
19
|
-
const nxCloudClientSupported = await isNxCloudClientSupported(nxJson);
|
20
|
-
(0, json_1.updateJson)(tree, 'nx.json', (nxJson) => {
|
21
|
-
const { runner, options } = nxJson.tasksRunnerOptions.default;
|
22
|
-
// This property shouldn't ever be part of tasks runner options.
|
23
|
-
if (options.useDaemonProcess !== undefined) {
|
24
|
-
nxJson.useDaemonProcess = options.useDaemonProcess;
|
25
|
-
delete options.useDaemonProcess;
|
26
|
-
}
|
27
|
-
// Remaining keys may be specific to a given runner, so leave them alone if there are multiple runners.
|
28
|
-
if (Object.keys(nxJson.tasksRunnerOptions ?? {}).length > 1) {
|
29
|
-
return nxJson;
|
30
|
-
}
|
31
|
-
// These options can only be moved for nx-cloud.
|
32
|
-
if (runner === 'nx-cloud' || runner === '@nrwl/nx-cloud') {
|
33
|
-
nxJson.nxCloudAccessToken = options.accessToken;
|
34
|
-
delete options.accessToken;
|
35
|
-
if (options.url) {
|
36
|
-
nxJson.nxCloudUrl = options.url;
|
37
|
-
delete options.url;
|
38
|
-
}
|
39
|
-
if (nxCloudClientSupported) {
|
40
|
-
removeNxCloudDependency(tree);
|
41
|
-
}
|
42
|
-
else {
|
43
|
-
options.useLightClient = false;
|
44
|
-
}
|
45
|
-
if (options.encryptionKey) {
|
46
|
-
nxJson.nxCloudEncryptionKey = options.encryptionKey;
|
47
|
-
delete options.encryptionKey;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
// These options should be safe to move for all tasks runners:
|
51
|
-
if (options.parallel !== undefined) {
|
52
|
-
nxJson.parallel = options.parallel;
|
53
|
-
delete options.parallel;
|
54
|
-
}
|
55
|
-
if (options.cacheDirectory !== undefined) {
|
56
|
-
nxJson.cacheDirectory = options.cacheDirectory;
|
57
|
-
delete options.cacheDirectory;
|
58
|
-
}
|
59
|
-
if (Array.isArray(options.cacheableOperations)) {
|
60
|
-
nxJson.targetDefaults ??= {};
|
61
|
-
for (const target of options.cacheableOperations) {
|
62
|
-
nxJson.targetDefaults[target] ??= {};
|
63
|
-
nxJson.targetDefaults[target].cache ??= true;
|
64
|
-
}
|
65
|
-
delete options.cacheableOperations;
|
66
|
-
}
|
67
|
-
if (['nx-cloud', '@nrwl/nx-cloud', 'nx/tasks-runners/default'].includes(runner)) {
|
68
|
-
delete nxJson.tasksRunnerOptions.default.runner;
|
69
|
-
if (Object.values(options).length === 0) {
|
70
|
-
delete nxJson.tasksRunnerOptions;
|
71
|
-
}
|
72
|
-
}
|
73
|
-
return nxJson;
|
74
|
-
});
|
75
|
-
await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
|
76
|
-
}
|
77
|
-
async function isNxCloudClientSupported(nxJson) {
|
78
|
-
const nxCloudOptions = (0, run_command_1.getRunnerOptions)('default', nxJson, {}, true);
|
79
|
-
// Non enterprise workspaces support the Nx Cloud Client
|
80
|
-
if (!isNxCloudEnterpriseWorkspace(nxJson)) {
|
81
|
-
return true;
|
82
|
-
}
|
83
|
-
// If we can get the nx cloud client, it's supported
|
84
|
-
try {
|
85
|
-
await (0, update_manager_1.verifyOrUpdateNxCloudClient)(nxCloudOptions);
|
86
|
-
return true;
|
87
|
-
}
|
88
|
-
catch (e) {
|
89
|
-
if (e instanceof update_manager_1.NxCloudEnterpriseOutdatedError) {
|
90
|
-
output_1.output.warn({
|
91
|
-
title: 'Nx Cloud Instance is outdated.',
|
92
|
-
bodyLines: [
|
93
|
-
'If you are an Nx Enterprise customer, please reach out to your assigned Developer Productivity Engineer.',
|
94
|
-
'If you are NOT an Nx Enterprise customer but are seeing this message, please reach out to cloud-support@nrwl.io.',
|
95
|
-
],
|
96
|
-
});
|
97
|
-
}
|
98
|
-
return false;
|
99
|
-
}
|
100
|
-
}
|
101
|
-
function isNxCloudEnterpriseWorkspace(nxJson) {
|
102
|
-
const { runner, options } = nxJson.tasksRunnerOptions.default;
|
103
|
-
return ((runner === 'nx-cloud' || runner === '@nrwl/nx-cloud') &&
|
104
|
-
options.url &&
|
105
|
-
![
|
106
|
-
'https://nx.app',
|
107
|
-
'https://cloud.nx.app',
|
108
|
-
'https://staging.nx.app',
|
109
|
-
'https://snapshot.nx.app',
|
110
|
-
].includes(options.url));
|
111
|
-
}
|
112
|
-
function removeNxCloudDependency(tree) {
|
113
|
-
if (tree.exists('package.json')) {
|
114
|
-
(0, json_1.updateJson)(tree, 'package.json', (packageJson) => {
|
115
|
-
delete packageJson.dependencies?.['nx-cloud'];
|
116
|
-
delete packageJson.devDependencies?.['nx-cloud'];
|
117
|
-
delete packageJson.dependencies?.['@nrwl/nx-cloud'];
|
118
|
-
delete packageJson.devDependencies?.['@nrwl/nx-cloud'];
|
119
|
-
return packageJson;
|
120
|
-
});
|
121
|
-
}
|
122
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.default = update;
|
4
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
5
|
-
const nx_json_1 = require("../../generators/utils/nx-json");
|
6
|
-
const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
|
7
|
-
/**
|
8
|
-
* Updates existing workspaces to move nx.json's affected.defaultBase to nx.json's base.
|
9
|
-
*/
|
10
|
-
async function update(host) {
|
11
|
-
const nxJson = (0, nx_json_1.readNxJson)(host);
|
12
|
-
if (nxJson?.affected?.defaultBase) {
|
13
|
-
nxJson.defaultBase = nxJson.affected.defaultBase;
|
14
|
-
delete nxJson.affected.defaultBase;
|
15
|
-
if (Object.keys(nxJson.affected).length === 0) {
|
16
|
-
delete nxJson.affected;
|
17
|
-
}
|
18
|
-
(0, nx_json_1.updateNxJson)(host, nxJson);
|
19
|
-
}
|
20
|
-
await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(host);
|
21
|
-
}
|
@@ -1,47 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.default = nxReleasePath;
|
4
|
-
exports.visitNotIgnoredFiles = visitNotIgnoredFiles;
|
5
|
-
const node_path_1 = require("node:path");
|
6
|
-
const ignore_1 = require("../../utils/ignore");
|
7
|
-
function nxReleasePath(tree) {
|
8
|
-
visitNotIgnoredFiles(tree, '', (file) => {
|
9
|
-
const contents = tree.read(file).toString('utf-8');
|
10
|
-
if (
|
11
|
-
// the deep import usage should be replaced by the new location
|
12
|
-
contents.includes('nx/src/command-line/release') ||
|
13
|
-
// changelog-renderer has moved into nx/release
|
14
|
-
contents.includes('nx/changelog-renderer')) {
|
15
|
-
const finalContents = contents
|
16
|
-
// replace instances of old changelog renderer location
|
17
|
-
.replace(/nx\/changelog-renderer/g, 'nx/release/changelog-renderer')
|
18
|
-
// replace instances of deep import for programmatic API (only perform the replacement if an actual import by checking for trailing ' or ")
|
19
|
-
.replace(/nx\/src\/command-line\/release(['"])/g, 'nx/release$1');
|
20
|
-
tree.write(file, finalContents);
|
21
|
-
}
|
22
|
-
});
|
23
|
-
}
|
24
|
-
// Adapted from devkit
|
25
|
-
function visitNotIgnoredFiles(tree, dirPath = tree.root, visitor) {
|
26
|
-
const ig = (0, ignore_1.getIgnoreObject)();
|
27
|
-
dirPath = normalizePathRelativeToRoot(dirPath, tree.root);
|
28
|
-
if (dirPath !== '' && ig?.ignores(dirPath)) {
|
29
|
-
return;
|
30
|
-
}
|
31
|
-
for (const child of tree.children(dirPath)) {
|
32
|
-
const fullPath = (0, node_path_1.join)(dirPath, child);
|
33
|
-
if (ig?.ignores(fullPath)) {
|
34
|
-
continue;
|
35
|
-
}
|
36
|
-
if (tree.isFile(fullPath)) {
|
37
|
-
visitor(fullPath);
|
38
|
-
}
|
39
|
-
else {
|
40
|
-
visitNotIgnoredFiles(tree, fullPath, visitor);
|
41
|
-
}
|
42
|
-
}
|
43
|
-
}
|
44
|
-
// Copied from devkit
|
45
|
-
function normalizePathRelativeToRoot(path, root) {
|
46
|
-
return (0, node_path_1.relative)(root, (0, node_path_1.join)(root, path)).split(node_path_1.sep).join('/');
|
47
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.default = migrate;
|
4
|
-
const nx_json_1 = require("../../generators/utils/nx-json");
|
5
|
-
const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
|
6
|
-
async function migrate(tree) {
|
7
|
-
const nxJson = (0, nx_json_1.readNxJson)(tree);
|
8
|
-
nxJson.useInferencePlugins = false;
|
9
|
-
(0, nx_json_1.updateNxJson)(tree, nxJson);
|
10
|
-
await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
|
11
|
-
}
|