nx 21.4.0-beta.1 → 21.4.0-beta.11
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/.eslintrc.json +2 -0
- package/bin/nx.js +6 -6
- package/bin/post-install.js +8 -22
- package/package.json +12 -11
- package/schemas/nx-schema.json +99 -1
- package/src/adapter/compat.d.ts +2 -2
- package/src/adapter/compat.d.ts.map +1 -1
- package/src/adapter/compat.js +3 -0
- package/src/command-line/graph/graph.d.ts.map +1 -1
- package/src/command-line/graph/graph.js +152 -45
- package/src/command-line/init/implementation/utils.d.ts.map +1 -1
- package/src/command-line/init/implementation/utils.js +1 -2
- package/src/command-line/mcp/command-object.d.ts +3 -0
- package/src/command-line/mcp/command-object.d.ts.map +1 -0
- package/src/command-line/mcp/command-object.js +28 -0
- package/src/command-line/mcp/mcp.d.ts +3 -0
- package/src/command-line/mcp/mcp.d.ts.map +1 -0
- package/src/command-line/mcp/mcp.js +23 -0
- package/src/command-line/migrate/migrate-ui-api.d.ts.map +1 -1
- package/src/command-line/migrate/migrate-ui-api.js +18 -8
- package/src/command-line/nx-cloud/connect/command-object.d.ts.map +1 -1
- package/src/command-line/nx-cloud/connect/command-object.js +2 -1
- package/src/command-line/nx-cloud/connect/connect-to-nx-cloud.d.ts +1 -0
- package/src/command-line/nx-cloud/connect/connect-to-nx-cloud.d.ts.map +1 -1
- package/src/command-line/nx-cloud/connect/connect-to-nx-cloud.js +19 -5
- package/src/command-line/nx-cloud/connect/view-logs.d.ts.map +1 -1
- package/src/command-line/nx-cloud/connect/view-logs.js +3 -5
- package/src/command-line/nx-commands.d.ts.map +1 -1
- package/src/command-line/nx-commands.js +2 -0
- package/src/command-line/release/changelog.d.ts.map +1 -1
- package/src/command-line/release/changelog.js +7 -2
- package/src/command-line/release/command-object.d.ts +7 -2
- package/src/command-line/release/command-object.d.ts.map +1 -1
- package/src/command-line/release/command-object.js +22 -4
- package/src/command-line/release/config/config.d.ts +10 -3
- package/src/command-line/release/config/config.d.ts.map +1 -1
- package/src/command-line/release/config/config.js +127 -15
- package/src/command-line/release/config/filter-release-groups.d.ts +5 -1
- package/src/command-line/release/config/filter-release-groups.d.ts.map +1 -1
- package/src/command-line/release/publish.js +13 -1
- package/src/command-line/release/release.d.ts.map +1 -1
- package/src/command-line/release/release.js +10 -2
- package/src/command-line/release/utils/resolve-nx-json-error-message.js +1 -1
- package/src/command-line/release/utils/shared.d.ts +9 -0
- package/src/command-line/release/utils/shared.d.ts.map +1 -1
- package/src/command-line/release/utils/shared.js +25 -4
- package/src/command-line/release/version/project-logger.d.ts.map +1 -1
- package/src/command-line/release/version/project-logger.js +1 -0
- package/src/command-line/release/version/release-group-processor.d.ts +6 -1
- package/src/command-line/release/version/release-group-processor.d.ts.map +1 -1
- package/src/command-line/release/version/release-group-processor.js +73 -3
- package/src/command-line/release/version/version-actions.d.ts +21 -0
- package/src/command-line/release/version/version-actions.d.ts.map +1 -1
- package/src/command-line/release/version/version-actions.js +32 -1
- package/src/command-line/release/version.d.ts.map +1 -1
- package/src/command-line/release/version.js +42 -11
- package/src/config/nx-json.d.ts +58 -0
- package/src/config/nx-json.d.ts.map +1 -1
- package/src/config/workspace-json-project-json.d.ts +2 -1
- package/src/config/workspace-json-project-json.d.ts.map +1 -1
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.css +1 -1
- package/src/core/graph/styles.js +1 -1
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts +1 -1
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts.map +1 -1
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +5 -3
- package/src/nx-cloud/utilities/onboarding.d.ts.map +1 -1
- package/src/nx-cloud/utilities/onboarding.js +1 -1
- package/src/nx-cloud/utilities/url-shorten.d.ts +1 -2
- package/src/nx-cloud/utilities/url-shorten.d.ts.map +1 -1
- package/src/nx-cloud/utilities/url-shorten.js +17 -21
- package/src/plugins/js/index.d.ts.map +1 -1
- package/src/plugins/js/index.js +10 -16
- package/src/plugins/js/lock-file/bun-parser.d.ts +15 -0
- package/src/plugins/js/lock-file/bun-parser.d.ts.map +1 -0
- package/src/plugins/js/lock-file/bun-parser.js +964 -0
- package/src/plugins/js/lock-file/lock-file.d.ts +2 -2
- package/src/plugins/js/lock-file/lock-file.d.ts.map +1 -1
- package/src/plugins/js/lock-file/lock-file.js +40 -17
- package/src/plugins/js/lock-file/project-graph-pruning.d.ts.map +1 -1
- package/src/plugins/js/lock-file/project-graph-pruning.js +3 -1
- package/src/plugins/js/package-json/create-package-json.d.ts.map +1 -1
- package/src/plugins/js/package-json/create-package-json.js +6 -4
- package/src/project-graph/plugins/public-api.d.ts +2 -0
- package/src/project-graph/plugins/public-api.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +15 -6
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +10 -4
- package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.js +5 -2
- package/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +1 -1
- package/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts +1 -1
- package/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/task-history-life-cycle.js +7 -12
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +21 -9
- package/src/tasks-runner/run-command.d.ts.map +1 -1
- package/src/tasks-runner/run-command.js +4 -3
- package/src/utils/ab-testing.d.ts +1 -1
- package/src/utils/ab-testing.d.ts.map +1 -1
- package/src/utils/ab-testing.js +1 -1
- package/src/utils/git-utils.d.ts +6 -5
- package/src/utils/git-utils.d.ts.map +1 -1
- package/src/utils/git-utils.js +73 -41
- package/src/utils/nx-cloud-utils.d.ts.map +1 -1
- package/src/utils/nx-cloud-utils.js +5 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nx-commands.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/command-line/nx-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"nx-commands.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/command-line/nx-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuD/B,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAEzE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,qBAmDf,CAAC"}
|
@@ -33,6 +33,7 @@ const command_object_27 = require("./nx-cloud/fix-ci/command-object");
|
|
33
33
|
const command_objects_1 = require("./deprecated/command-objects");
|
34
34
|
const command_object_28 = require("./sync/command-object");
|
35
35
|
const output_1 = require("../utils/output");
|
36
|
+
const command_object_29 = require("./mcp/command-object");
|
36
37
|
// Ensure that the output takes up the available width of the terminal.
|
37
38
|
yargs.wrap(yargs.terminalWidth());
|
38
39
|
exports.parserConfiguration = {
|
@@ -88,6 +89,7 @@ exports.commandsObject = yargs
|
|
88
89
|
.command(command_object_25.yargsRecordCommand)
|
89
90
|
.command(command_object_26.yargsStartCiRunCommand)
|
90
91
|
.command(command_object_27.yargsFixCiCommand)
|
92
|
+
.command(command_object_29.yargsMcpCommand)
|
91
93
|
.command(resolveConformanceCommandObject())
|
92
94
|
.command(resolveConformanceCheckCommandObject())
|
93
95
|
.scriptName('nx')
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/changelog.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AAkB1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAmBpD,OAAO,EAEL,SAAS,EAUV,MAAM,aAAa,CAAC;AAQrB,OAAO,EACL,cAAc,
|
1
|
+
{"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/changelog.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AAkB1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAmBpD,OAAO,EAEL,SAAS,EAUV,MAAM,aAAa,CAAC;AAQrB,OAAO,EACL,cAAc,EASf,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,wBAAwB;IACvC,kBAAkB,CAAC,EAAE;QACnB,cAAc,EAAE,cAAc,CAAC;QAC/B,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;KACjC,CAAC;IACF,iBAAiB,CAAC,EAAE;QAClB,CAAC,WAAW,EAAE,MAAM,GAAG;YACrB,cAAc,EAAE,cAAc,CAAC;YAC/B,QAAQ,EAAE,MAAM,CAAC;YACjB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;SACjC,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAElE,eAAO,MAAM,0BAA0B,GAAI,MAAM,gBAAgB,oBACV,CAAC;AAExD,wBAAgB,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,IAOnE,MAAM,gBAAgB,KACrB,OAAO,CAAC,wBAAwB,CAAC,CAqrBrC"}
|
@@ -534,6 +534,7 @@ function resolveChangelogVersions(args, releaseGroups, releaseGroupToFilteredPro
|
|
534
534
|
for (const projectName of releaseGroupProjectNames) {
|
535
535
|
if (!args.versionData) {
|
536
536
|
versionData[projectName] = {
|
537
|
+
dockerVersion: args.version,
|
537
538
|
newVersion: args.version,
|
538
539
|
currentVersion: '', // not relevant within changelog/commit generation
|
539
540
|
dependentProjects: [], // not relevant within changelog/commit generation
|
@@ -827,11 +828,15 @@ async function generateChangelogForProjects({ tree, args, changes, projectsVersi
|
|
827
828
|
* no changelog entry is relevant in that case.
|
828
829
|
*/
|
829
830
|
if (!projectsVersionData[project.name] ||
|
830
|
-
projectsVersionData[project.name].newVersion === null
|
831
|
+
(projectsVersionData[project.name].newVersion === null &&
|
832
|
+
!projectsVersionData[project.name].dockerVersion)) {
|
831
833
|
continue;
|
832
834
|
}
|
835
|
+
const preferDockerVersion = (0, shared_1.shouldPreferDockerVersionForReleaseGroup)(releaseGroup);
|
833
836
|
const releaseVersion = new shared_1.ReleaseVersion({
|
834
|
-
version: projectsVersionData[project.name].
|
837
|
+
version: preferDockerVersion && projectsVersionData[project.name].dockerVersion
|
838
|
+
? projectsVersionData[project.name].dockerVersion
|
839
|
+
: projectsVersionData[project.name].newVersion,
|
835
840
|
releaseTagPattern: releaseGroup.releaseTagPattern,
|
836
841
|
projectName: project.name,
|
837
842
|
});
|
@@ -22,7 +22,11 @@ interface GitOptions {
|
|
22
22
|
gitPushArgs?: string | string[];
|
23
23
|
gitRemote?: string;
|
24
24
|
}
|
25
|
-
export type
|
25
|
+
export type DockerVersionSchemeArgs = {
|
26
|
+
dockerVersionScheme?: string;
|
27
|
+
dockerVersion?: string;
|
28
|
+
};
|
29
|
+
export type VersionOptions = NxReleaseArgs & GitOptions & VersionPlanArgs & FirstReleaseArgs & DockerVersionSchemeArgs & {
|
26
30
|
specifier?: string;
|
27
31
|
preid?: string;
|
28
32
|
stageChanges?: boolean;
|
@@ -49,6 +53,7 @@ export type PublishOptions = NxReleaseArgs & Partial<RunManyOptions> & {
|
|
49
53
|
tag?: string;
|
50
54
|
access?: string;
|
51
55
|
otp?: number;
|
56
|
+
versionData?: VersionData;
|
52
57
|
};
|
53
58
|
export type PlanOptions = NxReleaseArgs & {
|
54
59
|
bump?: string;
|
@@ -62,7 +67,7 @@ export type PlanCheckOptions = BaseNxReleaseArgs & {
|
|
62
67
|
uncommitted?: boolean;
|
63
68
|
untracked?: boolean;
|
64
69
|
};
|
65
|
-
export type ReleaseOptions = NxReleaseArgs & FirstReleaseArgs & {
|
70
|
+
export type ReleaseOptions = NxReleaseArgs & FirstReleaseArgs & DockerVersionSchemeArgs & {
|
66
71
|
specifier?: string;
|
67
72
|
yes?: boolean;
|
68
73
|
preid?: VersionOptions['preid'];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,aAAa,EAAY,MAAM,OAAO,CAAC;AAEtD,OAAO,EACL,WAAW,EACX,cAAc,EAQf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,UAAU;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,cAAc,GAAG,aAAa,GACxC,UAAU,GACV,eAAe,GACf,gBAAgB,GAAG;
|
1
|
+
{"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,aAAa,EAAY,MAAM,OAAO,CAAC;AAEtD,OAAO,EACL,WAAW,EACX,cAAc,EAQf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EA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CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAC7C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvB,aAAa,CA0Ed,CAAC"}
|
@@ -71,7 +71,7 @@ exports.yargsReleaseCommand = {
|
|
71
71
|
const releaseCommand = {
|
72
72
|
command: '$0 [specifier]',
|
73
73
|
describe: 'Create a version and release for the workspace, generate a changelog, and optionally publish the packages.',
|
74
|
-
builder: (yargs) => withFirstReleaseOptions(yargs
|
74
|
+
builder: (yargs) => withFirstReleaseOptions(withDockerVersionSchemeOptions(yargs
|
75
75
|
.positional('specifier', {
|
76
76
|
type: 'string',
|
77
77
|
describe: 'Exact version or semver keyword to apply to the selected release group.',
|
@@ -95,7 +95,7 @@ const releaseCommand = {
|
|
95
95
|
throw new Error('The --yes and --skip-publish options are mutually exclusive, please use one or the other.');
|
96
96
|
}
|
97
97
|
return true;
|
98
|
-
}),
|
98
|
+
}))),
|
99
99
|
handler: async (args) => {
|
100
100
|
const release = await Promise.resolve().then(() => require('./release'));
|
101
101
|
const result = await release.releaseCLIHandler(args);
|
@@ -109,7 +109,7 @@ const versionCommand = {
|
|
109
109
|
command: 'version [specifier]',
|
110
110
|
aliases: ['v'],
|
111
111
|
describe: 'Create a version and release for one or more applications and libraries.',
|
112
|
-
builder: (yargs) => withFirstReleaseOptions(withGitOptions(yargs
|
112
|
+
builder: (yargs) => withFirstReleaseOptions(withGitOptions(withDockerVersionSchemeOptions(yargs
|
113
113
|
.positional('specifier', {
|
114
114
|
type: 'string',
|
115
115
|
describe: 'Exact version or semver keyword to apply to the selected release group.',
|
@@ -122,7 +122,7 @@ const versionCommand = {
|
|
122
122
|
.option('stage-changes', {
|
123
123
|
type: 'boolean',
|
124
124
|
describe: 'Whether or not to stage the changes made by this command. Useful when combining this command with changelog generation.',
|
125
|
-
}))),
|
125
|
+
})))),
|
126
126
|
handler: async (args) => {
|
127
127
|
const release = await Promise.resolve().then(() => require('./version'));
|
128
128
|
const result = await release.releaseVersionCLIHandler(args);
|
@@ -306,3 +306,21 @@ function withFirstReleaseOptions(yargs) {
|
|
306
306
|
description: 'Indicates that this is the first release for the selected release group. If the current version cannot be determined as usual, the version on disk will be used as a fallback. This is useful when using git or the registry to determine the current version of packages, since those sources are only available after the first release. Also indicates that changelog generation should not assume a previous git tag exists and that publishing should not check for the existence of the package before running.',
|
307
307
|
});
|
308
308
|
}
|
309
|
+
function withDockerVersionSchemeOptions(yargs) {
|
310
|
+
return yargs
|
311
|
+
.option('dockerVersionScheme', {
|
312
|
+
type: 'string',
|
313
|
+
describe: 'Exact docker version scheme to apply to the selected release group. Warning: Docker support is experimental. Breaking changes may occur and not adhere to semver versioning.',
|
314
|
+
})
|
315
|
+
.option('dockerVersion', {
|
316
|
+
type: 'string',
|
317
|
+
describe: 'Exact docker version to use, bypassing the version scheme logic. Warning: Docker support is experimental. Breaking changes may occur and not adhere to semver versioning.',
|
318
|
+
})
|
319
|
+
.check((argv) => {
|
320
|
+
if (argv.dockerVersionScheme !== undefined &&
|
321
|
+
argv.dockerVersion !== undefined) {
|
322
|
+
throw new Error('The --dockerVersionScheme and --dockerVersion options are mutually exclusive, please use one or the other.');
|
323
|
+
}
|
324
|
+
return true;
|
325
|
+
});
|
326
|
+
}
|
@@ -1,8 +1,13 @@
|
|
1
|
-
import { NxJsonConfiguration, NxReleaseConfiguration } from '../../../config/nx-json';
|
1
|
+
import { NxJsonConfiguration, NxReleaseConfiguration, NxReleaseDockerConfiguration } from '../../../config/nx-json';
|
2
2
|
import { ProjectFileMap, ProjectGraph } from '../../../config/project-graph';
|
3
3
|
type DeepRequired<T> = Required<{
|
4
4
|
[K in keyof T]: T[K] extends Required<T[K]> ? T[K] : DeepRequired<T[K]>;
|
5
5
|
}>;
|
6
|
+
type EnsureDockerOptional<T> = {
|
7
|
+
[K in keyof T]: Omit<T[K], 'docker'> & {
|
8
|
+
docker: DeepRequired<NxReleaseDockerConfiguration> | undefined;
|
9
|
+
};
|
10
|
+
};
|
6
11
|
type EnsureProjectsArray<T> = {
|
7
12
|
[K in keyof T]: T[K] extends {
|
8
13
|
projects: any;
|
@@ -36,12 +41,14 @@ export declare const DEFAULT_VERSION_ACTIONS_PATH = "@nx/js/src/release/version-
|
|
36
41
|
* pattern such as directories and globs).
|
37
42
|
*/
|
38
43
|
export type NxReleaseConfig = Omit<DeepRequired<NxReleaseConfiguration & {
|
39
|
-
groups: DeepRequired<RemoveTrueFromPropertiesOnEach<EnsureProjectsArray<NxReleaseConfiguration['groups']>, 'changelog'
|
44
|
+
groups: EnsureDockerOptional<DeepRequired<RemoveTrueFromPropertiesOnEach<EnsureProjectsArray<NxReleaseConfiguration['groups']>, 'changelog' | 'docker'>>>;
|
40
45
|
changelog: RemoveTrueFromProperties<DeepRequired<NxReleaseConfiguration['changelog']>, 'workspaceChangelog' | 'projectChangelogs'>;
|
41
46
|
conventionalCommits: {
|
42
47
|
types: RemoveBooleanFromPropertiesOnEach<DeepRequired<RemoveBooleanFromProperties<DeepRequired<NxReleaseConfiguration['conventionalCommits']['types']>, string>>, 'changelog'>;
|
43
48
|
};
|
44
|
-
}>, 'projects'
|
49
|
+
}>, 'projects' | 'docker'> & {
|
50
|
+
docker: DeepRequired<NxReleaseDockerConfiguration> | undefined;
|
51
|
+
};
|
45
52
|
export interface CreateNxReleaseConfigError {
|
46
53
|
code: 'PROJECTS_AND_GROUPS_DEFINED' | 'RELEASE_GROUP_MATCHES_NO_PROJECTS' | 'RELEASE_GROUP_RELEASE_TAG_PATTERN_VERSION_PLACEHOLDER_MISSING_OR_EXCESSIVE' | 'PROJECT_MATCHES_MULTIPLE_GROUPS' | 'CONVENTIONAL_COMMITS_SHORTHAND_MIXED_WITH_OVERLAPPING_OPTIONS' | 'GLOBAL_GIT_CONFIG_MIXED_WITH_GRANULAR_GIT_CONFIG' | 'CANNOT_RESOLVE_CHANGELOG_RENDERER' | 'INVALID_CHANGELOG_CREATE_RELEASE_PROVIDER' | 'INVALID_CHANGELOG_CREATE_RELEASE_HOSTNAME' | 'INVALID_CHANGELOG_CREATE_RELEASE_API_BASE_URL' | 'GIT_PUSH_FALSE_WITH_CREATE_RELEASE';
|
47
54
|
data: Record<string, string | string[]>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/config/config.ts"],"names":[],"mappings":"AAeA,OAAO,EAEL,mBAAmB,EAEnB,sBAAsB,
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/config/config.ts"],"names":[],"mappings":"AAeA,OAAO,EAEL,mBAAmB,EAEnB,sBAAsB,EACtB,4BAA4B,EAG7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAc7E,KAAK,YAAY,CAAC,CAAC,IAAI,QAAQ,CAAC;KAC7B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACxE,CAAC,CAAC;AAEH,KAAK,oBAAoB,CAAC,CAAC,IAAI;KAC5B,CAAC,IAAI,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG;QACrC,MAAM,EAAE,YAAY,CAAC,4BAA4B,CAAC,GAAG,SAAS,CAAC;KAChE;CACF,CAAC;AAEF,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;QAAE,QAAQ,EAAE,GAAG,CAAA;KAAE,GAC1C,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG;QAAE,QAAQ,EAAE,MA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C,CA8IhB;AAyRD;;GAEG;AACH,MAAM,WAAW,mCAAmC;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
@@ -139,9 +139,56 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
139
139
|
(userConfig.projectsRelationship === 'independent' &&
|
140
140
|
!userGroups.some((g) => g.projectsRelationship === 'fixed'));
|
141
141
|
const defaultRendererPath = (0, node_path_1.join)(__dirname, '../../../../release/changelog-renderer');
|
142
|
+
// Helper function to create meaningful docker defaults when user opts in
|
143
|
+
function createDockerDefaults(userDockerConfig) {
|
144
|
+
const defaultVersionSchemes = {
|
145
|
+
production: '{currentDate|YYMM.DD}.{shortCommitSha}',
|
146
|
+
hotfix: '{currentDate|YYMM.DD}.{shortCommitSha}-hotfix',
|
147
|
+
};
|
148
|
+
const defaultPreVersionCommand = 'npx nx run-many -t docker:build';
|
149
|
+
// If user explicitly sets docker: true, apply meaningful defaults
|
150
|
+
if (userDockerConfig === true) {
|
151
|
+
return {
|
152
|
+
preVersionCommand: defaultPreVersionCommand,
|
153
|
+
skipVersionActions: undefined,
|
154
|
+
versionSchemes: defaultVersionSchemes,
|
155
|
+
repositoryName: undefined,
|
156
|
+
registryUrl: undefined,
|
157
|
+
};
|
158
|
+
}
|
159
|
+
// If user provides docker configuration object, merge with base defaults
|
160
|
+
return {
|
161
|
+
preVersionCommand: userDockerConfig.preVersionCommand ?? defaultPreVersionCommand,
|
162
|
+
skipVersionActions: userDockerConfig.skipVersionActions
|
163
|
+
? Array.isArray(userDockerConfig.skipVersionActions)
|
164
|
+
? (0, find_matching_projects_1.findMatchingProjects)(userDockerConfig.skipVersionActions, projectGraph.nodes)
|
165
|
+
: userDockerConfig.skipVersionActions
|
166
|
+
: undefined,
|
167
|
+
versionSchemes: userDockerConfig.versionSchemes ?? defaultVersionSchemes,
|
168
|
+
repositoryName: userDockerConfig.repositoryName,
|
169
|
+
registryUrl: userDockerConfig.registryUrl,
|
170
|
+
};
|
171
|
+
}
|
172
|
+
// Helper function to normalize docker config at group level
|
173
|
+
function normalizeDockerConfig(dockerConfig) {
|
174
|
+
// If user explicitly sets docker: true at group level, apply meaningful defaults
|
175
|
+
if (dockerConfig === true) {
|
176
|
+
return createDockerDefaults(true);
|
177
|
+
}
|
178
|
+
// If user provides docker configuration object at group level, return it
|
179
|
+
if (dockerConfig && typeof dockerConfig === 'object') {
|
180
|
+
return createDockerDefaults(dockerConfig);
|
181
|
+
}
|
182
|
+
// No group-level docker config
|
183
|
+
return undefined;
|
184
|
+
}
|
142
185
|
const WORKSPACE_DEFAULTS = {
|
143
186
|
// By default all projects in all groups are released together
|
144
187
|
projectsRelationship: workspaceProjectsRelationship,
|
188
|
+
// Create docker defaults only if user has explicitly configured it, otherwise undefined
|
189
|
+
docker: userConfig.docker !== undefined
|
190
|
+
? createDockerDefaults(userConfig.docker)
|
191
|
+
: undefined,
|
145
192
|
git: gitDefaults,
|
146
193
|
version: {
|
147
194
|
useLegacyVersioning: USE_LEGACY_VERSIONING,
|
@@ -218,8 +265,16 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
218
265
|
WORKSPACE_DEFAULTS.releaseTagPatternRequireSemver;
|
219
266
|
const groupReleaseTagPatternStrictPreid = userConfig.releaseTagPatternStrictPreid ??
|
220
267
|
defaultReleaseTagPatternStrictPreid;
|
268
|
+
const groupDocker = normalizeDockerConfig(userConfig.docker ?? WORKSPACE_DEFAULTS.docker);
|
221
269
|
const GROUP_DEFAULTS = {
|
222
270
|
projectsRelationship: groupProjectsRelationship,
|
271
|
+
// Only include docker configuration if user has explicitly configured it
|
272
|
+
docker: groupDocker && Object.keys(groupDocker).length > 0
|
273
|
+
? {
|
274
|
+
...groupDocker,
|
275
|
+
groupPreVersionCommand: '',
|
276
|
+
}
|
277
|
+
: undefined,
|
223
278
|
version: USE_LEGACY_VERSIONING
|
224
279
|
? {
|
225
280
|
conventionalCommits: false,
|
@@ -248,7 +303,11 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
248
303
|
releaseTagPattern:
|
249
304
|
// The appropriate group default releaseTagPattern is dependent upon the projectRelationships
|
250
305
|
groupProjectsRelationship === 'independent'
|
251
|
-
?
|
306
|
+
? // If the default pattern contains {projectName} then it will create unique release tags for each project.
|
307
|
+
// Otherwise, use the default value to guarantee unique tags
|
308
|
+
WORKSPACE_DEFAULTS.releaseTagPattern?.includes('{projectName}')
|
309
|
+
? WORKSPACE_DEFAULTS.releaseTagPattern
|
310
|
+
: defaultIndependentReleaseTagPattern
|
252
311
|
: WORKSPACE_DEFAULTS.releaseTagPattern,
|
253
312
|
releaseTagPatternCheckAllBranchesWhen: userConfig.releaseTagPatternCheckAllBranchesWhen ?? undefined,
|
254
313
|
releaseTagPatternRequireSemver: groupReleaseTagPatternRequireSemver,
|
@@ -270,6 +329,10 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
270
329
|
git: userConfig.git,
|
271
330
|
},
|
272
331
|
], userConfig.version);
|
332
|
+
const rootDockerConfig = userConfig.docker && {
|
333
|
+
...normalizeDockerConfig(WORKSPACE_DEFAULTS.docker),
|
334
|
+
...normalizeDockerConfig(userConfig.docker),
|
335
|
+
};
|
273
336
|
if (userConfig.changelog?.workspaceChangelog) {
|
274
337
|
userConfig.changelog.workspaceChangelog = normalizeTrueToEmptyObject(userConfig.changelog.workspaceChangelog);
|
275
338
|
}
|
@@ -309,8 +372,8 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
309
372
|
}
|
310
373
|
if (userConfig.version?.conventionalCommits === false) {
|
311
374
|
delete rootVersionWithoutGlobalOptions.generatorOptions
|
312
|
-
|
313
|
-
delete rootVersionWithoutGlobalOptions.generatorOptions
|
375
|
+
?.currentVersionResolver;
|
376
|
+
delete rootVersionWithoutGlobalOptions.generatorOptions?.specifierSource;
|
314
377
|
delete rootVersionWithoutGlobalOptions
|
315
378
|
.currentVersionResolver;
|
316
379
|
delete rootVersionWithoutGlobalOptions
|
@@ -333,6 +396,8 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
333
396
|
delete rootVersionWithoutGlobalOptions
|
334
397
|
.specifierSource;
|
335
398
|
}
|
399
|
+
const rootDockerWithoutGlobalOptions = { ...rootDockerConfig };
|
400
|
+
delete rootDockerWithoutGlobalOptions.preVersionCommand;
|
336
401
|
const groups = userConfig.groups && Object.keys(userConfig.groups).length
|
337
402
|
? ensureProjectsConfigIsArray(userConfig.groups)
|
338
403
|
: /**
|
@@ -342,6 +407,10 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
342
407
|
{
|
343
408
|
[exports.IMPLICIT_DEFAULT_RELEASE_GROUP]: {
|
344
409
|
projectsRelationship: GROUP_DEFAULTS.projectsRelationship,
|
410
|
+
// Only include docker configuration if user has explicitly configured it
|
411
|
+
docker: Object.keys(rootDockerWithoutGlobalOptions).length > 0
|
412
|
+
? deepMergeDefaults([GROUP_DEFAULTS.docker], rootDockerWithoutGlobalOptions)
|
413
|
+
: undefined,
|
345
414
|
projects: userConfig.projects
|
346
415
|
? // user-defined top level "projects" config takes priority if set
|
347
416
|
(0, find_matching_projects_1.findMatchingProjects)(ensureArray(userConfig.projects), projectGraph.nodes)
|
@@ -414,8 +483,21 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
414
483
|
if (releaseGroup.changelog) {
|
415
484
|
releaseGroup.changelog = normalizeTrueToEmptyObject(releaseGroup.changelog);
|
416
485
|
}
|
486
|
+
const normalizedGroupDockerConfig = normalizeDockerConfig(releaseGroup.docker);
|
487
|
+
// Only include docker configuration if user has explicitly configured it at root or group level
|
488
|
+
const shouldIncludeDockerConfig = Object.keys(rootDockerWithoutGlobalOptions).length > 0 ||
|
489
|
+
normalizedGroupDockerConfig !== undefined;
|
417
490
|
const groupDefaults = {
|
418
491
|
projectsRelationship,
|
492
|
+
// Only include docker configuration if user has explicitly configured it
|
493
|
+
docker: shouldIncludeDockerConfig
|
494
|
+
? {
|
495
|
+
...GROUP_DEFAULTS.docker,
|
496
|
+
...rootDockerWithoutGlobalOptions,
|
497
|
+
groupPreVersionCommand: '',
|
498
|
+
...releaseGroup.docker,
|
499
|
+
}
|
500
|
+
: undefined,
|
419
501
|
projects: matchingProjects,
|
420
502
|
version: deepMergeDefaults(
|
421
503
|
// First apply any group level defaults, then apply actual root level config, then group level config
|
@@ -430,7 +512,11 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
430
512
|
releaseTagPattern: releaseGroup.releaseTagPattern ||
|
431
513
|
// The appropriate group default releaseTagPattern is dependent upon the projectRelationships
|
432
514
|
(projectsRelationship === 'independent'
|
433
|
-
?
|
515
|
+
? // If the default pattern contains {projectName} then it will create unique release tags for each project.
|
516
|
+
// Otherwise, use the default value to guarantee unique tags
|
517
|
+
userConfig.releaseTagPattern?.includes('{projectName}')
|
518
|
+
? userConfig.releaseTagPattern
|
519
|
+
: defaultIndependentReleaseTagPattern
|
434
520
|
: userConfig.releaseTagPattern || defaultFixedReleaseTagPattern),
|
435
521
|
releaseTagPatternCheckAllBranchesWhen: releaseGroup.releaseTagPatternCheckAllBranchesWhen ??
|
436
522
|
userConfig.releaseTagPatternCheckAllBranchesWhen ??
|
@@ -450,6 +536,10 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
450
536
|
});
|
451
537
|
finalReleaseGroup.version =
|
452
538
|
finalReleaseGroup.version;
|
539
|
+
// Clean up docker global options that are not supported at the group level
|
540
|
+
if (finalReleaseGroup.docker) {
|
541
|
+
delete finalReleaseGroup.docker.preVersionCommand;
|
542
|
+
}
|
453
543
|
// Apply conventionalCommits shorthand to the final group if explicitly configured in the original group
|
454
544
|
if (releaseGroup.version?.conventionalCommits === true) {
|
455
545
|
if (USE_LEGACY_VERSIONING) {
|
@@ -501,6 +591,22 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
501
591
|
}
|
502
592
|
releaseGroups[releaseGroupName] = finalReleaseGroup;
|
503
593
|
}
|
594
|
+
// Infer docker-related properties based on project configurations
|
595
|
+
for (const [releaseGroupName, releaseGroup] of Object.entries(releaseGroups)) {
|
596
|
+
const hasDockerProjects = releaseGroup.projects.some((projectName) => {
|
597
|
+
const projectNode = projectGraph.nodes[projectName];
|
598
|
+
// Check if project has meaningful docker config (not just undefined/empty values)
|
599
|
+
const projectDockerConfig = projectNode?.data.release?.docker;
|
600
|
+
const hasProjectDockerConfig = projectDockerConfig !== undefined;
|
601
|
+
// Check if release group has docker config at all (since we now only include it when explicitly configured)
|
602
|
+
const hasGroupDockerConfig = !!releaseGroup.docker;
|
603
|
+
return hasProjectDockerConfig || hasGroupDockerConfig;
|
604
|
+
});
|
605
|
+
if (hasDockerProjects) {
|
606
|
+
// If any project in the group has docker configuration, disable semver requirement
|
607
|
+
releaseGroup.releaseTagPatternRequireSemver = false;
|
608
|
+
}
|
609
|
+
}
|
504
610
|
const configError = validateChangelogConfig(releaseGroups, rootChangelogConfig);
|
505
611
|
if (configError) {
|
506
612
|
return {
|
@@ -512,11 +618,16 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
512
618
|
error: null,
|
513
619
|
nxReleaseConfig: {
|
514
620
|
projectsRelationship: WORKSPACE_DEFAULTS.projectsRelationship,
|
621
|
+
// Only include docker configuration if user has explicitly configured it
|
622
|
+
...(WORKSPACE_DEFAULTS.docker
|
623
|
+
? { docker: WORKSPACE_DEFAULTS.docker }
|
624
|
+
: {}),
|
515
625
|
releaseTagPattern: WORKSPACE_DEFAULTS.releaseTagPattern,
|
516
626
|
releaseTagPatternCheckAllBranchesWhen: WORKSPACE_DEFAULTS.releaseTagPatternCheckAllBranchesWhen,
|
517
627
|
releaseTagPatternRequireSemver: WORKSPACE_DEFAULTS.releaseTagPatternRequireSemver,
|
518
628
|
releaseTagPatternStrictPreid: WORKSPACE_DEFAULTS.releaseTagPatternStrictPreid,
|
519
629
|
git: rootGitConfig,
|
630
|
+
docker: rootDockerConfig,
|
520
631
|
version: rootVersionConfig,
|
521
632
|
changelog: rootChangelogConfig,
|
522
633
|
groups: releaseGroups,
|
@@ -615,6 +726,7 @@ function fillUnspecifiedConventionalCommitsProperties(config) {
|
|
615
726
|
};
|
616
727
|
}
|
617
728
|
async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
729
|
+
const linkMessage = `\nRead more about Nx Release at https://nx.dev/features/manage-releases.`;
|
618
730
|
switch (error.code) {
|
619
731
|
case 'PROJECTS_AND_GROUPS_DEFINED':
|
620
732
|
{
|
@@ -624,7 +736,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
624
736
|
]);
|
625
737
|
output_1.output.error({
|
626
738
|
title: `"projects" is not valid when explicitly defining release groups, and everything should be expressed within "groups" in that case. If you are using "groups" then you should remove the "projects" property`,
|
627
|
-
bodyLines: [nxJsonMessage],
|
739
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
628
740
|
});
|
629
741
|
}
|
630
742
|
break;
|
@@ -636,7 +748,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
636
748
|
]);
|
637
749
|
output_1.output.error({
|
638
750
|
title: `Release group "${error.data.releaseGroupName}" matches no projects. Please ensure all release groups match at least one project:`,
|
639
|
-
bodyLines: [nxJsonMessage],
|
751
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
640
752
|
});
|
641
753
|
}
|
642
754
|
break;
|
@@ -648,7 +760,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
648
760
|
]);
|
649
761
|
output_1.output.error({
|
650
762
|
title: `Project "${error.data.project}" matches multiple release groups. Please ensure all projects are part of only one release group:`,
|
651
|
-
bodyLines: [nxJsonMessage],
|
763
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
652
764
|
});
|
653
765
|
}
|
654
766
|
break;
|
@@ -662,7 +774,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
662
774
|
]);
|
663
775
|
output_1.output.error({
|
664
776
|
title: `Release group "${error.data.releaseGroupName}" has an invalid releaseTagPattern. Please ensure the pattern contains exactly one instance of the "{version}" placeholder`,
|
665
|
-
bodyLines: [nxJsonMessage],
|
777
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
666
778
|
});
|
667
779
|
}
|
668
780
|
break;
|
@@ -676,7 +788,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
676
788
|
: 'configuration options';
|
677
789
|
output_1.output.error({
|
678
790
|
title: `You have configured both the shorthand "version.conventionalCommits" and one or more of the related ${text} that it sets for you. Please use one or the other:`,
|
679
|
-
bodyLines: [nxJsonMessage],
|
791
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
680
792
|
});
|
681
793
|
}
|
682
794
|
break;
|
@@ -688,7 +800,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
688
800
|
]);
|
689
801
|
output_1.output.error({
|
690
802
|
title: `You have duplicate conflicting git configurations. If you are using the top level 'nx release' command, then remove the 'release.version.git' and 'release.changelog.git' properties in favor of 'release.git'. If you are using the subcommands or the programmatic API, then remove the 'release.git' property in favor of 'release.version.git' and 'release.changelog.git':`,
|
691
|
-
bodyLines: [nxJsonMessage],
|
803
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
692
804
|
});
|
693
805
|
}
|
694
806
|
break;
|
@@ -696,7 +808,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
696
808
|
const nxJsonMessage = await (0, resolve_nx_json_error_message_1.resolveNxJsonConfigErrorMessage)(['release']);
|
697
809
|
output_1.output.error({
|
698
810
|
title: `There was an error when resolving the configured changelog renderer at path: ${error.data.workspaceRelativePath}`,
|
699
|
-
bodyLines: [nxJsonMessage],
|
811
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
700
812
|
});
|
701
813
|
break;
|
702
814
|
}
|
@@ -709,7 +821,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
709
821
|
title: `Your "changelog.createRelease" config specifies an unsupported provider "${error.data.provider}". The supported providers are ${error.data.supportedProviders
|
710
822
|
.map((p) => `"${p}"`)
|
711
823
|
.join(', ')}`,
|
712
|
-
bodyLines: [nxJsonMessage],
|
824
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
713
825
|
});
|
714
826
|
}
|
715
827
|
break;
|
@@ -720,7 +832,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
720
832
|
]);
|
721
833
|
output_1.output.error({
|
722
834
|
title: `Your "changelog.createRelease" config specifies an invalid hostname "${error.data.hostname}". Please ensure you provide a valid hostname value, such as "example.com"`,
|
723
|
-
bodyLines: [nxJsonMessage],
|
835
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
724
836
|
});
|
725
837
|
}
|
726
838
|
break;
|
@@ -731,7 +843,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
731
843
|
]);
|
732
844
|
output_1.output.error({
|
733
845
|
title: `Your "changelog.createRelease" config specifies an invalid apiBaseUrl "${error.data.apiBaseUrl}". Please ensure you provide a valid URL value, such as "https://example.com"`,
|
734
|
-
bodyLines: [nxJsonMessage],
|
846
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
735
847
|
});
|
736
848
|
}
|
737
849
|
break;
|
@@ -742,7 +854,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
742
854
|
]);
|
743
855
|
output_1.output.error({
|
744
856
|
title: `The createRelease option for changelogs cannot be enabled when git push is explicitly disabled because the commit needs to be pushed to the remote in order to tie the release to it`,
|
745
|
-
bodyLines: [nxJsonMessage],
|
857
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
746
858
|
});
|
747
859
|
}
|
748
860
|
break;
|
@@ -1,9 +1,13 @@
|
|
1
1
|
import { ProjectGraph } from '../../../config/project-graph';
|
2
2
|
import { NxReleaseConfig } from './config';
|
3
3
|
import { GroupVersionPlan, ProjectsVersionPlan } from './version-plans';
|
4
|
-
|
4
|
+
import { NxReleaseDockerConfiguration } from '../../../config/nx-json';
|
5
|
+
export type ReleaseGroupWithName = Omit<NxReleaseConfig['groups'][string], 'docker'> & {
|
5
6
|
name: string;
|
6
7
|
resolvedVersionPlans: (ProjectsVersionPlan | GroupVersionPlan)[] | false;
|
8
|
+
docker?: NxReleaseDockerConfiguration & {
|
9
|
+
groupPreVersionCommand?: string;
|
10
|
+
};
|
7
11
|
};
|
8
12
|
export declare function filterReleaseGroups(projectGraph: ProjectGraph, nxReleaseConfig: NxReleaseConfig, projectsFilter?: string[], groupsFilter?: string[]): {
|
9
13
|
error: null | {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"filter-release-groups.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/config/filter-release-groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EAAkC,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"filter-release-groups.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/config/filter-release-groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EAAkC,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAEvE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,eAAe,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,EACjC,QAAQ,CACT,GAAG;IACF,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB,EAAE,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,EAAE,GAAG,KAAK,CAAC;IACzE,MAAM,CAAC,EAAE,4BAA4B,GAAG;QAAE,sBAAsB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7E,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,EAChC,cAAc,CAAC,EAAE,MAAM,EAAE,EACzB,YAAY,CAAC,EAAE,MAAM,EAAE,GACtB;IACD,KAAK,EAAE,IAAI,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACtD,SAAS,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,EAAE,CAAC;KACrB,GAAG,IAAI,CAAC;IACT,aAAa,EAAE,oBAAoB,EAAE,CAAC;IACtC,8BAA8B,EAAE,GAAG,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;CACxE,CAgMA"}
|
@@ -133,6 +133,14 @@ async function runPublishOnProjects(args, projectGraph, nxJson, projectNames, ex
|
|
133
133
|
if (args.firstRelease) {
|
134
134
|
overrides.firstRelease = args.firstRelease;
|
135
135
|
}
|
136
|
+
/**
|
137
|
+
* If using the `nx release` command, or possibly via the programmatic API, versionData will be passed through from the version subcommand.
|
138
|
+
* Provide it automatically to the publish executor options with a clear namespace to avoid userland conflicts.
|
139
|
+
* It will be filtered out of the final terminal output lifecycle to avoid cluttering the terminal.
|
140
|
+
*/
|
141
|
+
if (args.versionData) {
|
142
|
+
overrides.nxReleaseVersionData = args.versionData;
|
143
|
+
}
|
136
144
|
const requiredTargetName = 'nx-release-publish';
|
137
145
|
if (args.graph) {
|
138
146
|
const file = (0, command_line_utils_1.readGraphFileFromGraphArg)(args);
|
@@ -155,12 +163,15 @@ async function runPublishOnProjects(args, projectGraph, nxJson, projectNames, ex
|
|
155
163
|
throw new Error(`Based on your config, the following projects were matched for publishing but do not have the "${requiredTargetName}" target specified:\n${[
|
156
164
|
...projectsToRun.map((p) => `- ${p.name}`),
|
157
165
|
'',
|
158
|
-
`This is usually caused by
|
166
|
+
`This is usually caused by either`,
|
167
|
+
`- not having an appropriate plugin, such as "@nx/js" installed, which will add the appropriate "${requiredTargetName}" target for you automatically`,
|
168
|
+
`- having "private": true set in your package.json, which prevents the target from being created`,
|
159
169
|
].join('\n')}\n`);
|
160
170
|
}
|
161
171
|
await (0, tasks_execution_hooks_1.runPreTasksExecution)({
|
162
172
|
workspaceRoot: workspace_root_1.workspaceRoot,
|
163
173
|
nxJsonConfiguration: nxJson,
|
174
|
+
argv: process.argv,
|
164
175
|
});
|
165
176
|
/**
|
166
177
|
* Run the relevant nx-release-publish executor on each of the selected projects.
|
@@ -184,6 +195,7 @@ async function runPublishOnProjects(args, projectGraph, nxJson, projectNames, ex
|
|
184
195
|
taskResults,
|
185
196
|
workspaceRoot: workspace_root_1.workspaceRoot,
|
186
197
|
nxJsonConfiguration: nxJson,
|
198
|
+
argv: process.argv,
|
187
199
|
});
|
188
200
|
return publishProjectsResult;
|
189
201
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/release.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AAM1E,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAyBlE,OAAO,EACL,sBAAsB,EAEvB,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,iBAAiB,GAAI,MAAM,cAAc,oBACC,CAAC;AAExD,wBAAgB,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,IAMnE,MAAM,cAAc,KACnB,OAAO,CAAC,sBAAsB,GAAG,MAAM,CAAC,
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/release.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AAM1E,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAyBlE,OAAO,EACL,sBAAsB,EAEvB,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,iBAAiB,GAAI,MAAM,cAAc,oBACC,CAAC;AAExD,wBAAgB,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,IAMnE,MAAM,cAAc,KACnB,OAAO,CAAC,sBAAsB,GAAG,MAAM,CAAC,CAqV5C"}
|
@@ -225,7 +225,12 @@ function createAPI(overrideReleaseConfig) {
|
|
225
225
|
let hasNewVersion = false;
|
226
226
|
// null means that all projects are versioned together but there were no changes
|
227
227
|
if (versionResult.workspaceVersion !== null) {
|
228
|
-
hasNewVersion = Object.values(versionResult.projectsVersionData).some((version) =>
|
228
|
+
hasNewVersion = Object.values(versionResult.projectsVersionData).some((version) =>
|
229
|
+
/**
|
230
|
+
* There is a scenario where applications will not have a newVersion created by VerisonActions,
|
231
|
+
* however, there will still be a dockerVersion created from the docker release.
|
232
|
+
*/
|
233
|
+
version.newVersion !== null || version.dockerVersion !== null);
|
229
234
|
}
|
230
235
|
let shouldPublish = !!args.yes && !args.skipPublish && hasNewVersion;
|
231
236
|
const shouldPromptPublishing = !args.yes && !args.skipPublish && !args.dryRun && hasNewVersion;
|
@@ -233,7 +238,10 @@ function createAPI(overrideReleaseConfig) {
|
|
233
238
|
shouldPublish = await promptForPublish();
|
234
239
|
}
|
235
240
|
if (shouldPublish) {
|
236
|
-
const publishResults = await releasePublish(
|
241
|
+
const publishResults = await releasePublish({
|
242
|
+
...args,
|
243
|
+
versionData: versionResult.projectsVersionData,
|
244
|
+
});
|
237
245
|
const allExitOk = Object.values(publishResults).every((result) => result.code === 0);
|
238
246
|
if (!allExitOk) {
|
239
247
|
// When a publish target fails, we want to fail the nx release CLI
|
@@ -14,7 +14,7 @@ async function resolveNxJsonConfigErrorMessage(propPath) {
|
|
14
14
|
? `, line ${errorLines.startLine}`
|
15
15
|
: `, lines ${errorLines.startLine}-${errorLines.endLine}`;
|
16
16
|
}
|
17
|
-
return nxJsonMessage;
|
17
|
+
return nxJsonMessage + '.';
|
18
18
|
}
|
19
19
|
async function getJsonConfigLinesForErrorMessage(rawConfig, jsonPath) {
|
20
20
|
try {
|