nx 19.8.0-canary.20240920-999abe9 → 19.8.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.json +2 -1
- package/bin/nx.js +10 -2
- package/package.json +12 -12
- package/release/changelog-renderer/index.d.ts +3 -1
- package/release/changelog-renderer/index.js +8 -8
- package/schemas/nx-schema.json +47 -21
- package/src/adapter/compat.d.ts +1 -1
- package/src/adapter/compat.js +1 -0
- package/src/command-line/activate-powerpack/activate-powerpack.js +3 -1
- package/src/command-line/add/add.js +4 -2
- package/src/command-line/connect/view-logs.js +1 -0
- package/src/command-line/exec/exec.js +6 -1
- package/src/command-line/format/format.js +3 -1
- package/src/command-line/graph/graph.js +1 -0
- package/src/command-line/init/implementation/angular/integrated-workspace.js +4 -1
- package/src/command-line/init/implementation/angular/legacy-angular-versions.js +5 -2
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +3 -1
- package/src/command-line/init/implementation/dot-nx/nxw.js +1 -0
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.js +3 -1
- package/src/command-line/init/implementation/react/index.js +17 -5
- package/src/command-line/init/implementation/utils.js +5 -1
- package/src/command-line/init/init-v1.js +1 -0
- package/src/command-line/init/init-v2.js +2 -1
- package/src/command-line/migrate/command-object.js +4 -0
- package/src/command-line/migrate/migrate.js +1 -1
- package/src/command-line/release/changelog.js +16 -10
- package/src/command-line/release/config/config.d.ts +2 -1
- package/src/command-line/release/config/config.js +165 -20
- package/src/command-line/release/config/version-plans.js +3 -1
- package/src/command-line/release/release.js +6 -2
- package/src/command-line/release/utils/exec-command.js +1 -0
- package/src/command-line/release/utils/github.d.ts +14 -6
- package/src/command-line/release/utils/github.js +50 -24
- package/src/command-line/release/utils/launch-editor.js +6 -1
- package/src/command-line/release/version.js +6 -3
- package/src/command-line/report/report.d.ts +3 -1
- package/src/command-line/report/report.js +17 -2
- package/src/command-line/run/run.js +1 -0
- package/src/command-line/sync/sync.js +5 -4
- package/src/command-line/watch/watch.js +1 -0
- package/src/config/nx-json.d.ts +12 -1
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.js +1 -1
- package/src/daemon/client/client.d.ts +4 -1
- package/src/daemon/client/generate-help-output.js +1 -0
- package/src/daemon/server/sync-generators.d.ts +4 -1
- package/src/daemon/server/sync-generators.js +33 -15
- package/src/executors/run-commands/run-commands.impl.js +1 -0
- package/src/executors/run-script/run-script.impl.js +1 -0
- package/src/native/index.d.ts +1 -1
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +1 -1
- package/src/project-graph/file-utils.js +1 -0
- package/src/tasks-runner/cache.d.ts +3 -1
- package/src/tasks-runner/cache.js +12 -13
- package/src/tasks-runner/default-tasks-runner.js +1 -1
- package/src/tasks-runner/life-cycles/formatting-utils.d.ts +1 -1
- package/src/tasks-runner/life-cycles/formatting-utils.js +27 -15
- package/src/tasks-runner/life-cycles/task-history-life-cycle.js +3 -0
- package/src/tasks-runner/task-orchestrator.d.ts +3 -1
- package/src/tasks-runner/task-orchestrator.js +3 -2
- package/src/tasks-runner/tasks-schedule.js +1 -1
- package/src/utils/ab-testing.js +4 -1
- package/src/utils/child-process.js +5 -3
- package/src/utils/command-line-utils.js +7 -1
- package/src/utils/default-base.js +5 -2
- package/src/utils/git-utils.index-filter.js +2 -1
- package/src/utils/git-utils.js +4 -0
- package/src/utils/git-utils.tree-filter.js +3 -1
- package/src/utils/powerpack.d.ts +1 -1
- package/src/utils/powerpack.js +3 -8
- package/src/utils/sync-generators.d.ts +13 -3
- package/src/utils/sync-generators.js +99 -25
- package/src/utils/task-history.d.ts +2 -2
- package/src/utils/task-history.js +4 -1
@@ -46,7 +46,7 @@ const LINE_SEPARATOR = '---------------------------------------';
|
|
46
46
|
*
|
47
47
|
*/
|
48
48
|
async function reportHandler() {
|
49
|
-
const { pm, pmVersion, powerpackLicense, localPlugins, powerpackPlugins, communityPlugins, registeredPlugins, packageVersionsWeCareAbout, outOfSyncPackageGroup, projectGraphError, nativeTarget, } = await getReportData();
|
49
|
+
const { pm, pmVersion, powerpackLicense, powerpackError, localPlugins, powerpackPlugins, communityPlugins, registeredPlugins, packageVersionsWeCareAbout, outOfSyncPackageGroup, projectGraphError, nativeTarget, } = await getReportData();
|
50
50
|
const fields = [
|
51
51
|
['Node', process.versions.node],
|
52
52
|
['OS', `${process.platform}-${process.arch}`],
|
@@ -62,6 +62,7 @@ async function reportHandler() {
|
|
62
62
|
bodyLines.push(`${chalk.green(p.package.padEnd(padding))} : ${chalk.bold(p.version)}`);
|
63
63
|
});
|
64
64
|
if (powerpackLicense) {
|
65
|
+
bodyLines.push('');
|
65
66
|
bodyLines.push(LINE_SEPARATOR);
|
66
67
|
bodyLines.push(chalk.green('Nx Powerpack'));
|
67
68
|
bodyLines.push(`Licensed to ${powerpackLicense.organizationName} for ${powerpackLicense.seatCount} user${powerpackLicense.seatCount > 1 ? 's' : ''} in ${powerpackLicense.workspaceCount} workspace${powerpackLicense.workspaceCount > 1 ? 's' : ''} until ${new Date(powerpackLicense.expiresAt * 1000).toLocaleDateString()}`);
|
@@ -71,6 +72,14 @@ async function reportHandler() {
|
|
71
72
|
for (const powerpackPlugin of powerpackPlugins) {
|
72
73
|
bodyLines.push(`${chalk.green(powerpackPlugin.name.padEnd(padding))} : ${chalk.bold(powerpackPlugin.version)}`);
|
73
74
|
}
|
75
|
+
bodyLines.push('');
|
76
|
+
}
|
77
|
+
else if (powerpackError) {
|
78
|
+
bodyLines.push('');
|
79
|
+
bodyLines.push(chalk.red('Nx Powerpack'));
|
80
|
+
bodyLines.push(LINE_SEPARATOR);
|
81
|
+
bodyLines.push(powerpackError.message);
|
82
|
+
bodyLines.push('');
|
74
83
|
}
|
75
84
|
if (registeredPlugins.length) {
|
76
85
|
bodyLines.push(LINE_SEPARATOR);
|
@@ -137,13 +146,19 @@ async function getReportData() {
|
|
137
146
|
const outOfSyncPackageGroup = findMisalignedPackagesForPackage(nxPackageJson);
|
138
147
|
const native = isNativeAvailable();
|
139
148
|
let powerpackLicense = null;
|
149
|
+
let powerpackError = null;
|
140
150
|
try {
|
141
151
|
powerpackLicense = await (0, powerpack_1.getPowerpackLicenseInformation)();
|
142
152
|
}
|
143
|
-
catch {
|
153
|
+
catch (e) {
|
154
|
+
if (!(e instanceof powerpack_1.NxPowerpackNotInstalledError)) {
|
155
|
+
powerpackError = e;
|
156
|
+
}
|
157
|
+
}
|
144
158
|
return {
|
145
159
|
pm,
|
146
160
|
powerpackLicense,
|
161
|
+
powerpackError,
|
147
162
|
powerpackPlugins,
|
148
163
|
pmVersion,
|
149
164
|
localPlugins,
|
@@ -12,8 +12,8 @@ function syncHandler(options) {
|
|
12
12
|
return (0, handle_errors_1.handleErrors)(options.verbose, async () => {
|
13
13
|
const projectGraph = await (0, project_graph_1.createProjectGraphAsync)();
|
14
14
|
const nxJson = (0, nx_json_1.readNxJson)();
|
15
|
-
const
|
16
|
-
if (!
|
15
|
+
const { globalGenerators, taskGenerators } = await (0, sync_generators_1.collectAllRegisteredSyncGenerators)(projectGraph, nxJson);
|
16
|
+
if (!globalGenerators.length && !taskGenerators.length) {
|
17
17
|
output_1.output.success({
|
18
18
|
title: options.check
|
19
19
|
? 'The workspace is up to date'
|
@@ -22,6 +22,7 @@ function syncHandler(options) {
|
|
22
22
|
});
|
23
23
|
return 0;
|
24
24
|
}
|
25
|
+
const syncGenerators = Array.from(new Set([...globalGenerators, ...taskGenerators]));
|
25
26
|
const results = await (0, sync_generators_1.getSyncGeneratorChanges)(syncGenerators);
|
26
27
|
if (!results.length) {
|
27
28
|
output_1.output.success({
|
@@ -33,7 +34,7 @@ function syncHandler(options) {
|
|
33
34
|
return 0;
|
34
35
|
}
|
35
36
|
const { failedGeneratorsCount, areAllResultsFailures, anySyncGeneratorsFailed, } = (0, sync_generators_1.processSyncGeneratorResultErrors)(results);
|
36
|
-
const failedSyncGeneratorsFixMessageLines = (0, sync_generators_1.getFailedSyncGeneratorsFixMessageLines)(results, options.verbose);
|
37
|
+
const failedSyncGeneratorsFixMessageLines = (0, sync_generators_1.getFailedSyncGeneratorsFixMessageLines)(results, options.verbose, new Set(globalGenerators));
|
37
38
|
if (areAllResultsFailures) {
|
38
39
|
output_1.output.error({
|
39
40
|
title: `The workspace is probably out of sync because ${failedGeneratorsCount === 1
|
@@ -71,7 +72,7 @@ function syncHandler(options) {
|
|
71
72
|
spinner.fail();
|
72
73
|
output_1.output.error({
|
73
74
|
title: 'Failed to sync the workspace',
|
74
|
-
bodyLines: (0, sync_generators_1.getFlushFailureMessageLines)(flushResult, options.verbose),
|
75
|
+
bodyLines: (0, sync_generators_1.getFlushFailureMessageLines)(flushResult, options.verbose, new Set(globalGenerators)),
|
75
76
|
});
|
76
77
|
return 1;
|
77
78
|
}
|
package/src/config/nx-json.d.ts
CHANGED
@@ -58,7 +58,14 @@ export interface NxReleaseChangelogConfiguration {
|
|
58
58
|
* NOTE: if createRelease is set on a group of projects, it will cause the default releaseTagPattern of
|
59
59
|
* "{projectName}@{version}" to be used for those projects, even when versioning everything together.
|
60
60
|
*/
|
61
|
-
createRelease?: 'github' |
|
61
|
+
createRelease?: false | 'github' | {
|
62
|
+
provider: 'github-enterprise-server';
|
63
|
+
hostname: string;
|
64
|
+
/**
|
65
|
+
* If not set, this will default to `https://${hostname}/api/v3`
|
66
|
+
*/
|
67
|
+
apiBaseUrl?: string;
|
68
|
+
};
|
62
69
|
/**
|
63
70
|
* This can either be set to a string value that will be written to the changelog file(s)
|
64
71
|
* at the workspace root and/or within project directories, or set to `false` to specify
|
@@ -455,6 +462,10 @@ export interface NxJsonConfiguration<T = '*' | string[]> {
|
|
455
462
|
* Configuration for the `nx sync` command.
|
456
463
|
*/
|
457
464
|
sync?: NxSyncConfiguration;
|
465
|
+
/**
|
466
|
+
* Enable the new experimental db based cache
|
467
|
+
*/
|
468
|
+
enableDbCache?: boolean;
|
458
469
|
}
|
459
470
|
export type PluginConfiguration = string | ExpandedPluginConfiguration;
|
460
471
|
export type ExpandedPluginConfiguration<T = unknown> = {
|