nx 20.0.0-canary.20241002-1d10a19 → 20.0.0-rc.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.json +12 -2
- package/bin/init-local.js +0 -39
- package/bin/nx.js +3 -13
- package/migrations.json +5 -37
- package/package.json +11 -11
- package/release/changelog-renderer/index.d.ts +60 -38
- package/release/changelog-renderer/index.js +260 -236
- package/src/adapter/compat.d.ts +1 -1
- package/src/adapter/compat.js +1 -1
- package/src/command-line/add/add.js +2 -2
- package/src/command-line/affected/affected.js +0 -2
- package/src/command-line/nx-commands.js +31 -10
- package/src/command-line/release/changelog.d.ts +2 -2
- package/src/command-line/release/changelog.js +28 -29
- package/src/command-line/release/index.d.ts +5 -2
- package/src/command-line/release/publish.d.ts +6 -1
- package/src/command-line/release/publish.js +31 -25
- package/src/command-line/release/utils/git.js +2 -2
- package/src/command-line/release/utils/print-changes.js +6 -4
- package/src/command-line/release/utils/resolve-changelog-renderer.d.ts +2 -2
- package/src/command-line/release/utils/resolve-changelog-renderer.js +3 -3
- package/src/command-line/release/utils/resolve-nx-json-error-message.js +4 -3
- package/src/command-line/release/version.d.ts +3 -3
- package/src/command-line/run/run-one.js +0 -2
- package/src/command-line/run/run.js +0 -1
- package/src/command-line/run-many/run-many.js +1 -4
- package/src/command-line/yargs-utils/shared-options.js +2 -2
- package/src/config/misc-interfaces.d.ts +3 -15
- package/src/config/nx-json.d.ts +4 -3
- package/src/config/project-graph.d.ts +0 -2
- package/src/core/graph/main.js +1 -1
- package/src/daemon/client/client.js +1 -3
- package/src/devkit-exports.d.ts +3 -4
- package/src/devkit-exports.js +3 -6
- package/src/executors/utils/convert-nx-executor.js +0 -1
- package/src/generators/utils/nx-json.d.ts +1 -1
- package/src/migrations/update-20-0-0/move-use-daemon-process.d.ts +2 -0
- package/src/migrations/update-20-0-0/move-use-daemon-process.js +25 -0
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +54 -6
- package/src/nx-cloud/utilities/axios.js +1 -2
- package/src/nx-cloud/utilities/onboarding.js +2 -2
- package/src/nx-cloud/utilities/url-shorten.js +5 -5
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +2 -12
- package/src/project-graph/build-project-graph.js +3 -41
- package/src/project-graph/error-types.d.ts +4 -10
- package/src/project-graph/error-types.js +1 -12
- package/src/project-graph/file-utils.d.ts +2 -2
- package/src/project-graph/file-utils.js +3 -3
- package/src/project-graph/nx-deps-cache.d.ts +0 -1
- package/src/project-graph/nx-deps-cache.js +0 -1
- package/src/project-graph/plugins/internal-api.d.ts +2 -5
- package/src/project-graph/plugins/internal-api.js +0 -1
- package/src/project-graph/plugins/isolation/messaging.d.ts +3 -23
- package/src/project-graph/plugins/isolation/plugin-pool.js +0 -23
- package/src/project-graph/plugins/isolation/plugin-worker.js +0 -19
- package/src/project-graph/plugins/loader.js +2 -3
- package/src/project-graph/plugins/public-api.d.ts +6 -7
- package/src/project-graph/plugins/utils.d.ts +1 -7
- package/src/project-graph/plugins/utils.js +0 -37
- package/src/project-graph/utils/project-configuration-utils.js +1 -1
- package/src/tasks-runner/batch/run-batch.js +0 -1
- package/src/tasks-runner/cache.d.ts +2 -1
- package/src/tasks-runner/cache.js +11 -6
- package/src/tasks-runner/create-task-graph.d.ts +2 -0
- package/src/tasks-runner/create-task-graph.js +39 -5
- package/src/tasks-runner/init-tasks-runner.js +0 -2
- package/src/tasks-runner/run-command.js +15 -2
- package/src/tasks-runner/task-orchestrator.js +1 -1
- package/src/utils/command-line-utils.d.ts +3 -0
- package/src/utils/command-line-utils.js +24 -33
- package/src/utils/git-utils.js +2 -2
- package/src/utils/plugins/plugin-capabilities.js +2 -3
- package/src/migrations/update-15-0-0/prefix-outputs.d.ts +0 -2
- package/src/migrations/update-15-0-0/prefix-outputs.js +0 -49
- package/src/migrations/update-16-0-0/remove-nrwl-cli.d.ts +0 -2
- package/src/migrations/update-16-0-0/remove-nrwl-cli.js +0 -16
- package/src/migrations/update-16-0-0/update-depends-on-to-tokens.d.ts +0 -2
- package/src/migrations/update-16-0-0/update-depends-on-to-tokens.js +0 -97
- package/src/migrations/update-16-0-0/update-nx-cloud-runner.d.ts +0 -2
- package/src/migrations/update-16-0-0/update-nx-cloud-runner.js +0 -29
- package/src/migrations/update-16-2-0/remove-run-commands-output-path.d.ts +0 -2
- package/src/migrations/update-16-2-0/remove-run-commands-output-path.js +0 -45
- package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.d.ts +0 -12
- package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.js +0 -67
- package/src/utils/app-root.d.ts +0 -8
- package/src/utils/app-root.js +0 -12
- package/src/utils/nx-plugin.deprecated.d.ts +0 -31
- package/src/utils/nx-plugin.deprecated.js +0 -20
- package/src/utils/workspace-configuration-check.d.ts +0 -1
- package/src/utils/workspace-configuration-check.js +0 -36
package/.eslintrc.json
CHANGED
@@ -9,8 +9,18 @@
|
|
9
9
|
"no-restricted-imports": [
|
10
10
|
"error",
|
11
11
|
{
|
12
|
-
"
|
13
|
-
|
12
|
+
"paths": [
|
13
|
+
{
|
14
|
+
"name": "fs-extra",
|
15
|
+
"message": "Please use equivalent utilities from `node:fs` instead."
|
16
|
+
}
|
17
|
+
],
|
18
|
+
"patterns": [
|
19
|
+
{
|
20
|
+
"group": ["**/devkit-exports"],
|
21
|
+
"message": "Do not import from devkit-exports from the nx package"
|
22
|
+
}
|
23
|
+
]
|
14
24
|
}
|
15
25
|
]
|
16
26
|
}
|
package/bin/init-local.js
CHANGED
@@ -5,7 +5,6 @@ exports.rewriteTargetsAndProjects = rewriteTargetsAndProjects;
|
|
5
5
|
const perf_hooks_1 = require("perf_hooks");
|
6
6
|
const nx_commands_1 = require("../src/command-line/nx-commands");
|
7
7
|
const strip_indents_1 = require("../src/utils/strip-indents");
|
8
|
-
const Mod = require("module");
|
9
8
|
/**
|
10
9
|
* Nx is being run inside a workspace.
|
11
10
|
*
|
@@ -15,7 +14,6 @@ function initLocal(workspace) {
|
|
15
14
|
process.env.NX_CLI_SET = 'true';
|
16
15
|
try {
|
17
16
|
perf_hooks_1.performance.mark('init-local');
|
18
|
-
monkeyPatchRequire();
|
19
17
|
if (workspace.type !== 'nx' && shouldDelegateToAngularCLI()) {
|
20
18
|
console.warn((0, strip_indents_1.stripIndents) `Using Nx to run Angular CLI commands is deprecated and will be removed in a future version.
|
21
19
|
To run Angular CLI commands, use \`ng\`.`);
|
@@ -144,40 +142,3 @@ To update the cache configuration, you can directly update the relevant options
|
|
144
142
|
}
|
145
143
|
}
|
146
144
|
}
|
147
|
-
// TODO(v17): Remove this once the @nrwl/* packages are not
|
148
|
-
function monkeyPatchRequire() {
|
149
|
-
const originalRequire = Mod.prototype.require;
|
150
|
-
Mod.prototype.require = function (...args) {
|
151
|
-
const modulePath = args[0];
|
152
|
-
if (!modulePath.startsWith('@nrwl/')) {
|
153
|
-
return originalRequire.apply(this, args);
|
154
|
-
}
|
155
|
-
else {
|
156
|
-
try {
|
157
|
-
// Try the original require
|
158
|
-
return originalRequire.apply(this, args);
|
159
|
-
}
|
160
|
-
catch (e) {
|
161
|
-
if (e.code !== 'MODULE_NOT_FOUND') {
|
162
|
-
throw e;
|
163
|
-
}
|
164
|
-
try {
|
165
|
-
// Retry the require with the @nx package
|
166
|
-
return originalRequire.apply(this, args.map((value, i) => {
|
167
|
-
if (i !== 0) {
|
168
|
-
return value;
|
169
|
-
}
|
170
|
-
else {
|
171
|
-
return value.replace('@nrwl/', '@nx/');
|
172
|
-
}
|
173
|
-
}));
|
174
|
-
}
|
175
|
-
catch {
|
176
|
-
// Throw the original error
|
177
|
-
throw e;
|
178
|
-
}
|
179
|
-
}
|
180
|
-
}
|
181
|
-
// do some side-effect of your own
|
182
|
-
};
|
183
|
-
}
|
package/bin/nx.js
CHANGED
@@ -127,19 +127,9 @@ function resolveNx(workspace) {
|
|
127
127
|
}
|
128
128
|
catch { }
|
129
129
|
// check for root install
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
});
|
134
|
-
}
|
135
|
-
catch {
|
136
|
-
// TODO(v17): Remove this
|
137
|
-
// fallback for old CLI install setup
|
138
|
-
// nx-ignore-next-line
|
139
|
-
return require.resolve('@nrwl/cli/bin/nx.js', {
|
140
|
-
paths: [workspace ? workspace.dir : globalsRoot],
|
141
|
-
});
|
142
|
-
}
|
130
|
+
return require.resolve('nx/bin/nx.js', {
|
131
|
+
paths: [workspace ? workspace.dir : globalsRoot],
|
132
|
+
});
|
143
133
|
}
|
144
134
|
function handleMissingLocalInstallation() {
|
145
135
|
output_1.output.error({
|
package/migrations.json
CHANGED
@@ -1,42 +1,5 @@
|
|
1
1
|
{
|
2
2
|
"generators": {
|
3
|
-
"16.0.0-remove-nrwl-cli": {
|
4
|
-
"cli": "nx",
|
5
|
-
"version": "16.0.0-beta.0",
|
6
|
-
"description": "Remove @nrwl/cli.",
|
7
|
-
"implementation": "./src/migrations/update-16-0-0/remove-nrwl-cli"
|
8
|
-
},
|
9
|
-
"16.0.0-tokens-for-depends-on": {
|
10
|
-
"cli": "nx",
|
11
|
-
"version": "16.0.0-beta.9",
|
12
|
-
"description": "Replace `dependsOn.projects` and `inputs` definitions with new configuration format.",
|
13
|
-
"implementation": "./src/migrations/update-16-0-0/update-depends-on-to-tokens"
|
14
|
-
},
|
15
|
-
"16.0.0-update-nx-cloud-runner": {
|
16
|
-
"cli": "nx",
|
17
|
-
"version": "16.0.0-beta.0",
|
18
|
-
"description": "Replace @nrwl/nx-cloud with nx-cloud",
|
19
|
-
"implementation": "./src/migrations/update-16-0-0/update-nx-cloud-runner"
|
20
|
-
},
|
21
|
-
"16.2.0-remove-output-path-from-run-commands": {
|
22
|
-
"cli": "nx",
|
23
|
-
"version": "16.2.0-beta.0",
|
24
|
-
"description": "Remove outputPath from run commands",
|
25
|
-
"implementation": "./src/migrations/update-16-2-0/remove-run-commands-output-path"
|
26
|
-
},
|
27
|
-
"16.6.0-prefix-outputs": {
|
28
|
-
"cli": "nx",
|
29
|
-
"version": "16.6.0-beta.6",
|
30
|
-
"description": "Prefix outputs with {workspaceRoot}/{projectRoot} if needed",
|
31
|
-
"implementation": "./src/migrations/update-15-0-0/prefix-outputs"
|
32
|
-
},
|
33
|
-
"16.8.0-escape-dollar-sign-env": {
|
34
|
-
"cli": "nx",
|
35
|
-
"version": "16.8.0-beta.3",
|
36
|
-
"description": "Escape $ in env variables",
|
37
|
-
"implementation": "./src/migrations/update-16-8-0/escape-dollar-sign-env-variables",
|
38
|
-
"x-repair-skip": true
|
39
|
-
},
|
40
3
|
"17.0.0-move-cache-directory": {
|
41
4
|
"cli": "nx",
|
42
5
|
"version": "17.0.0-beta.1",
|
@@ -89,6 +52,11 @@
|
|
89
52
|
"description": "Set project name in nx.json explicitly",
|
90
53
|
"implementation": "./src/migrations/update-19-2-4/set-project-name",
|
91
54
|
"x-repair-skip": true
|
55
|
+
},
|
56
|
+
"move-use-daemon-process": {
|
57
|
+
"version": "20.0.0-beta.7",
|
58
|
+
"description": "Migration for v20.0.0-beta.7",
|
59
|
+
"implementation": "./src/migrations/update-20-0-0/move-use-daemon-process"
|
92
60
|
}
|
93
61
|
}
|
94
62
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "20.0.0-
|
3
|
+
"version": "20.0.0-rc.0",
|
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": {
|
@@ -80,16 +80,16 @@
|
|
80
80
|
}
|
81
81
|
},
|
82
82
|
"optionalDependencies": {
|
83
|
-
"@nx/nx-darwin-x64": "20.0.0-
|
84
|
-
"@nx/nx-darwin-arm64": "20.0.0-
|
85
|
-
"@nx/nx-linux-x64-gnu": "20.0.0-
|
86
|
-
"@nx/nx-linux-x64-musl": "20.0.0-
|
87
|
-
"@nx/nx-win32-x64-msvc": "20.0.0-
|
88
|
-
"@nx/nx-linux-arm64-gnu": "20.0.0-
|
89
|
-
"@nx/nx-linux-arm64-musl": "20.0.0-
|
90
|
-
"@nx/nx-linux-arm-gnueabihf": "20.0.0-
|
91
|
-
"@nx/nx-win32-arm64-msvc": "20.0.0-
|
92
|
-
"@nx/nx-freebsd-x64": "20.0.0-
|
83
|
+
"@nx/nx-darwin-x64": "20.0.0-rc.0",
|
84
|
+
"@nx/nx-darwin-arm64": "20.0.0-rc.0",
|
85
|
+
"@nx/nx-linux-x64-gnu": "20.0.0-rc.0",
|
86
|
+
"@nx/nx-linux-x64-musl": "20.0.0-rc.0",
|
87
|
+
"@nx/nx-win32-x64-msvc": "20.0.0-rc.0",
|
88
|
+
"@nx/nx-linux-arm64-gnu": "20.0.0-rc.0",
|
89
|
+
"@nx/nx-linux-arm64-musl": "20.0.0-rc.0",
|
90
|
+
"@nx/nx-linux-arm-gnueabihf": "20.0.0-rc.0",
|
91
|
+
"@nx/nx-win32-arm64-msvc": "20.0.0-rc.0",
|
92
|
+
"@nx/nx-freebsd-x64": "20.0.0-rc.0"
|
93
93
|
},
|
94
94
|
"nx-migrations": {
|
95
95
|
"migrations": "./migrations.json",
|
@@ -1,15 +1,13 @@
|
|
1
1
|
import { ChangelogChange } from '../../src/command-line/release/changelog';
|
2
2
|
import { NxReleaseConfig } from '../../src/command-line/release/config/config';
|
3
|
-
import {
|
4
|
-
import { GithubRepoData, RepoSlug } from '../../src/command-line/release/utils/github';
|
5
|
-
import type { ProjectGraph } from '../../src/config/project-graph';
|
3
|
+
import { GithubRepoData } from '../../src/command-line/release/utils/github';
|
6
4
|
/**
|
7
5
|
* The ChangelogRenderOptions are specific to each ChangelogRenderer implementation, and are taken
|
8
6
|
* from the user's nx.json configuration and passed as is into the ChangelogRenderer function.
|
9
7
|
*/
|
10
8
|
export type ChangelogRenderOptions = Record<string, unknown>;
|
11
9
|
/**
|
12
|
-
* When versioning projects independently and enabling `"updateDependents": "
|
10
|
+
* When versioning projects independently and enabling `"updateDependents": "auto"`, there could
|
13
11
|
* be additional dependency bump information that is not captured in the commit data, but that nevertheless
|
14
12
|
* should be included in the rendered changelog.
|
15
13
|
*/
|
@@ -17,34 +15,6 @@ export type DependencyBump = {
|
|
17
15
|
dependencyName: string;
|
18
16
|
newVersion: string;
|
19
17
|
};
|
20
|
-
/**
|
21
|
-
* A ChangelogRenderer function takes in the extracted commits and other relevant metadata
|
22
|
-
* and returns a string, or a Promise of a string of changelog contents (usually markdown).
|
23
|
-
*
|
24
|
-
* @param {Object} config The configuration object for the ChangelogRenderer
|
25
|
-
* @param {ProjectGraph} config.projectGraph The project graph for the workspace
|
26
|
-
* @param {GitCommit[]} config.commits DEPRECATED [Use 'config.changes' instead] - The collection of extracted commits to generate a changelog for
|
27
|
-
* @param {ChangelogChange[]} config.changes The collection of changes to show in the changelog
|
28
|
-
* @param {string} config.releaseVersion The version that is being released
|
29
|
-
* @param {string | null} config.project The name of specific project to generate a changelog for, or `null` if the overall workspace changelog
|
30
|
-
* @param {string | false} config.entryWhenNoChanges The (already interpolated) string to use as the changelog entry when there are no changes, or `false` if no entry should be generated
|
31
|
-
* @param {ChangelogRenderOptions} config.changelogRenderOptions The options specific to the ChangelogRenderer implementation
|
32
|
-
* @param {DependencyBump[]} config.dependencyBumps Optional list of additional dependency bumps that occurred as part of the release, outside of the commit data
|
33
|
-
* @param {GithubRepoData} config.repoData Resolved data for the current GitHub repository
|
34
|
-
*/
|
35
|
-
export type ChangelogRenderer = (config: {
|
36
|
-
projectGraph: ProjectGraph;
|
37
|
-
commits?: GitCommit[];
|
38
|
-
changes?: ChangelogChange[];
|
39
|
-
releaseVersion: string;
|
40
|
-
project: string | null;
|
41
|
-
entryWhenNoChanges: string | false;
|
42
|
-
changelogRenderOptions: DefaultChangelogRenderOptions;
|
43
|
-
dependencyBumps?: DependencyBump[];
|
44
|
-
repoSlug?: RepoSlug;
|
45
|
-
repoData?: GithubRepoData;
|
46
|
-
conventionalCommitsConfig: NxReleaseConfig['conventionalCommits'] | null;
|
47
|
-
}) => Promise<string> | string;
|
48
18
|
/**
|
49
19
|
* The specific options available to the default implementation of the ChangelogRenderer that nx exports
|
50
20
|
* for the common case.
|
@@ -72,9 +42,61 @@ export interface DefaultChangelogRenderOptions extends ChangelogRenderOptions {
|
|
72
42
|
*/
|
73
43
|
versionTitleDate?: boolean;
|
74
44
|
}
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
45
|
+
export default class DefaultChangelogRenderer {
|
46
|
+
protected changes: ChangelogChange[];
|
47
|
+
protected changelogEntryVersion: string;
|
48
|
+
protected project: string | null;
|
49
|
+
protected entryWhenNoChanges: string | false;
|
50
|
+
protected changelogRenderOptions: DefaultChangelogRenderOptions;
|
51
|
+
protected isVersionPlans: boolean;
|
52
|
+
protected dependencyBumps?: DependencyBump[];
|
53
|
+
protected repoData?: GithubRepoData;
|
54
|
+
protected conventionalCommitsConfig: NxReleaseConfig['conventionalCommits'] | null;
|
55
|
+
protected relevantChanges: ChangelogChange[];
|
56
|
+
protected breakingChanges: string[];
|
57
|
+
protected additionalChangesForAuthorsSection: ChangelogChange[];
|
58
|
+
/**
|
59
|
+
* A ChangelogRenderer class takes in the determined changes and other relevant metadata
|
60
|
+
* and returns a string, or a Promise of a string of changelog contents (usually markdown).
|
61
|
+
*
|
62
|
+
* @param {Object} config The configuration object for the ChangelogRenderer
|
63
|
+
* @param {ChangelogChange[]} config.changes The collection of changes to show in the changelog
|
64
|
+
* @param {string} config.changelogEntryVersion The version for which we are rendering the current changelog entry
|
65
|
+
* @param {string | null} config.project The name of specific project to generate a changelog entry for, or `null` if the overall workspace changelog
|
66
|
+
* @param {string | false} config.entryWhenNoChanges The (already interpolated) string to use as the changelog entry when there are no changes, or `false` if no entry should be generated
|
67
|
+
* @param {boolean} config.isVersionPlans Whether or not Nx release version plans are the source of truth for the changelog entry
|
68
|
+
* @param {ChangelogRenderOptions} config.changelogRenderOptions The options specific to the ChangelogRenderer implementation
|
69
|
+
* @param {DependencyBump[]} config.dependencyBumps Optional list of additional dependency bumps that occurred as part of the release, outside of the change data
|
70
|
+
* @param {GithubRepoData} config.repoData Resolved data for the current GitHub repository
|
71
|
+
* @param {NxReleaseConfig['conventionalCommits'] | null} config.conventionalCommitsConfig The configuration for conventional commits, or null if version plans are being used
|
72
|
+
*/
|
73
|
+
constructor(config: {
|
74
|
+
changes: ChangelogChange[];
|
75
|
+
changelogEntryVersion: string;
|
76
|
+
project: string | null;
|
77
|
+
entryWhenNoChanges: string | false;
|
78
|
+
isVersionPlans: boolean;
|
79
|
+
changelogRenderOptions: DefaultChangelogRenderOptions;
|
80
|
+
dependencyBumps?: DependencyBump[];
|
81
|
+
repoData?: GithubRepoData;
|
82
|
+
conventionalCommitsConfig: NxReleaseConfig['conventionalCommits'] | null;
|
83
|
+
});
|
84
|
+
protected filterChanges(changes: ChangelogChange[], project: string | null): ChangelogChange[];
|
85
|
+
render(): Promise<string>;
|
86
|
+
protected preprocessChanges(): void;
|
87
|
+
protected shouldRenderEmptyEntry(): boolean;
|
88
|
+
protected renderEmptyEntry(): string;
|
89
|
+
protected renderVersionTitle(): string;
|
90
|
+
protected renderChangesByType(): string[];
|
91
|
+
protected hasBreakingChanges(): boolean;
|
92
|
+
protected renderBreakingChanges(): string[];
|
93
|
+
protected hasDependencyBumps(): boolean;
|
94
|
+
protected renderDependencyBumps(): string[];
|
95
|
+
protected shouldRenderAuthors(): boolean;
|
96
|
+
protected renderAuthors(): Promise<string[]>;
|
97
|
+
protected formatChange(change: ChangelogChange): string;
|
98
|
+
protected groupChangesByType(): Record<string, ChangelogChange[]>;
|
99
|
+
protected groupChangesByScope(changes: ChangelogChange[]): Record<string, ChangelogChange[]>;
|
100
|
+
protected extractBreakingChangeExplanation(message: string): string | null;
|
101
|
+
protected formatName(name?: string): string;
|
102
|
+
}
|