nx 21.0.0-beta.1 → 21.0.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 +5 -1
- package/migrations.json +15 -35
- package/package.json +12 -12
- package/release/index.d.ts +1 -1
- package/release/index.js +2 -1
- package/schemas/nx-schema.json +187 -35
- package/schemas/project-schema.json +5 -0
- package/src/adapter/angular-json.js +11 -0
- package/src/adapter/compat.d.ts +1 -1
- package/src/adapter/compat.js +3 -0
- package/src/command-line/add/add.js +6 -16
- package/src/command-line/affected/command-object.js +6 -6
- package/src/command-line/examples.js +0 -4
- package/src/command-line/exec/command-object.js +1 -1
- package/src/command-line/generate/generator-utils.js +8 -3
- package/src/command-line/import/import.js +1 -1
- package/src/command-line/init/command-object.js +18 -6
- package/src/command-line/init/configure-plugins.d.ts +6 -7
- package/src/command-line/init/configure-plugins.js +52 -38
- package/src/command-line/init/implementation/add-nx-to-turborepo.d.ts +4 -0
- package/src/command-line/init/implementation/add-nx-to-turborepo.js +49 -0
- package/src/command-line/init/implementation/check-compatible-with-plugins.js +7 -1
- package/src/command-line/init/implementation/deduce-default-base.d.ts +1 -0
- package/src/command-line/init/implementation/deduce-default-base.js +53 -0
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.js +6 -4
- package/src/command-line/init/implementation/react/index.d.ts +1 -1
- package/src/command-line/init/implementation/react/index.js +32 -185
- package/src/command-line/init/implementation/react/write-vite-config.js +19 -3
- package/src/command-line/init/implementation/utils.d.ts +6 -2
- package/src/command-line/init/implementation/utils.js +110 -45
- package/src/command-line/init/init-v1.js +1 -1
- package/src/command-line/init/init-v2.d.ts +1 -0
- package/src/command-line/init/init-v2.js +70 -39
- package/src/command-line/migrate/migrate-ui-api.d.ts +58 -0
- package/src/command-line/migrate/migrate-ui-api.js +227 -0
- package/src/command-line/migrate/migrate.d.ts +23 -4
- package/src/command-line/migrate/migrate.js +138 -86
- package/src/command-line/nx-commands.js +19 -5
- package/src/command-line/register/command-object.d.ts +6 -0
- package/src/command-line/{activate-powerpack → register}/command-object.js +9 -9
- package/src/command-line/register/register.d.ts +2 -0
- package/src/command-line/register/register.js +9 -0
- package/src/command-line/release/changelog.js +18 -15
- package/src/command-line/release/command-object.d.ts +8 -0
- package/src/command-line/release/command-object.js +9 -0
- package/src/command-line/release/config/config.d.ts +8 -7
- package/src/command-line/release/config/config.js +139 -45
- package/src/command-line/release/config/use-legacy-versioning.d.ts +2 -0
- package/src/command-line/release/config/use-legacy-versioning.js +9 -0
- package/src/command-line/release/index.d.ts +4 -0
- package/src/command-line/release/index.js +6 -1
- package/src/command-line/release/plan-check.js +6 -3
- package/src/command-line/release/plan.js +7 -3
- package/src/command-line/release/publish.js +7 -3
- package/src/command-line/release/release.js +8 -3
- package/src/command-line/release/utils/batch-projects-by-generator-config.js +6 -3
- package/src/command-line/release/utils/git.d.ts +3 -2
- package/src/command-line/release/utils/git.js +65 -9
- package/src/command-line/release/utils/github.js +3 -1
- package/src/command-line/release/utils/resolve-semver-specifier.d.ts +2 -1
- package/src/command-line/release/utils/resolve-semver-specifier.js +2 -1
- package/src/command-line/release/utils/semver.d.ts +8 -0
- package/src/command-line/release/utils/semver.js +8 -0
- package/src/command-line/release/utils/shared-legacy.d.ts +25 -0
- package/src/command-line/release/utils/shared-legacy.js +2 -0
- package/src/command-line/release/utils/shared.d.ts +11 -17
- package/src/command-line/release/version/derive-specifier-from-conventional-commits.d.ts +7 -0
- package/src/command-line/release/version/derive-specifier-from-conventional-commits.js +47 -0
- package/src/command-line/release/version/deriver-specifier-from-version-plans.d.ts +8 -0
- package/src/command-line/release/version/deriver-specifier-from-version-plans.js +59 -0
- package/src/command-line/release/version/project-logger.d.ts +8 -0
- package/src/command-line/release/version/project-logger.js +45 -0
- package/src/command-line/release/version/release-group-processor.d.ts +252 -0
- package/src/command-line/release/version/release-group-processor.js +1057 -0
- package/src/command-line/release/version/resolve-current-version.d.ts +32 -0
- package/src/command-line/release/version/resolve-current-version.js +241 -0
- package/src/command-line/release/version/test-utils.d.ts +93 -0
- package/src/command-line/release/version/test-utils.js +415 -0
- package/src/command-line/release/version/topological-sort.d.ts +9 -0
- package/src/command-line/release/version/topological-sort.js +41 -0
- package/src/command-line/release/version/version-actions.d.ts +171 -0
- package/src/command-line/release/version/version-actions.js +195 -0
- package/src/command-line/release/version-legacy.d.ts +46 -0
- package/src/command-line/release/version-legacy.js +453 -0
- package/src/command-line/release/version.d.ts +0 -40
- package/src/command-line/release/version.js +84 -262
- package/src/command-line/repair/repair.js +8 -3
- package/src/command-line/report/report.d.ts +7 -3
- package/src/command-line/report/report.js +52 -18
- package/src/command-line/run/command-object.js +2 -2
- 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 +2 -2
- package/src/command-line/run-many/command-object.js +2 -2
- package/src/command-line/yargs-utils/shared-options.d.ts +4 -0
- package/src/command-line/yargs-utils/shared-options.js +20 -0
- package/src/config/misc-interfaces.d.ts +20 -2
- package/src/config/nx-json.d.ts +158 -18
- package/src/config/project-graph.d.ts +4 -2
- package/src/config/project-graph.js +8 -0
- package/src/config/workspace-json-project-json.d.ts +2 -2
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/runtime.js +1 -1
- package/src/core/graph/styles.css +2 -2
- package/src/core/graph/styles.js +1 -1
- package/src/daemon/client/client.d.ts +2 -0
- package/src/daemon/client/client.js +15 -0
- package/src/daemon/message-types/glob.d.ts +7 -0
- package/src/daemon/message-types/glob.js +9 -1
- package/src/daemon/message-types/hash-glob.d.ts +6 -0
- package/src/daemon/message-types/hash-glob.js +9 -1
- package/src/daemon/server/handle-glob.d.ts +1 -0
- package/src/daemon/server/handle-glob.js +8 -0
- package/src/daemon/server/handle-hash-glob.d.ts +1 -0
- package/src/daemon/server/handle-hash-glob.js +8 -0
- package/src/daemon/server/logger.js +2 -1
- package/src/daemon/server/server.js +7 -0
- package/src/devkit-exports.d.ts +1 -1
- package/src/devkit-internals.d.ts +3 -2
- package/src/devkit-internals.js +5 -1
- package/src/executors/run-commands/run-commands.impl.d.ts +2 -5
- package/src/executors/run-commands/run-commands.impl.js +14 -42
- package/src/executors/run-commands/running-tasks.d.ts +9 -4
- package/src/executors/run-commands/running-tasks.js +103 -30
- package/src/executors/run-script/run-script.impl.js +4 -3
- package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +8 -0
- package/src/generators/testing-utils/create-tree.js +5 -1
- package/src/migrations/update-21-0-0/release-version-config-changes.d.ts +2 -0
- package/src/migrations/update-21-0-0/release-version-config-changes.js +111 -0
- package/src/migrations/update-21-0-0/remove-custom-tasks-runner.d.ts +2 -0
- package/src/migrations/update-21-0-0/remove-custom-tasks-runner.js +38 -0
- package/src/migrations/{update-18-0-0/disable-crystal-for-existing-workspaces.js → update-21-0-0/remove-legacy-cache.js} +10 -4
- package/src/native/index.d.ts +98 -19
- package/src/native/index.js +16 -2
- package/src/native/native-bindings.js +7 -0
- package/src/native/nx.wasi-browser.js +20 -19
- package/src/native/nx.wasi.cjs +20 -19
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/nx-cloud-tasks-runner-shell.js +3 -3
- package/src/plugins/js/index.d.ts +2 -1
- package/src/plugins/js/index.js +8 -1
- package/src/plugins/js/lock-file/lock-file.js +28 -13
- package/src/plugins/js/lock-file/utils/package-json.d.ts +1 -1
- package/src/plugins/js/lock-file/utils/package-json.js +8 -6
- package/src/plugins/js/lock-file/utils/pnpm-normalizer.js +3 -3
- package/src/plugins/js/lock-file/yarn-parser.js +85 -39
- package/src/plugins/js/project-graph/affected/lock-file-changes.js +1 -0
- package/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.js +1 -1
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.d.ts +10 -1
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +59 -6
- package/src/plugins/js/utils/packages.js +22 -3
- package/src/plugins/js/utils/register.js +1 -0
- package/src/plugins/js/utils/typescript.js +3 -3
- package/src/plugins/package-json/create-nodes.d.ts +1 -1
- package/src/plugins/package-json/create-nodes.js +4 -2
- package/src/project-graph/affected/locators/project-glob-changes.js +2 -2
- package/src/project-graph/error-types.js +32 -2
- package/src/project-graph/file-utils.d.ts +1 -10
- package/src/project-graph/file-utils.js +2 -77
- package/src/project-graph/plugins/get-plugins.js +2 -1
- package/src/project-graph/plugins/in-process-loader.js +1 -1
- package/src/project-graph/plugins/isolation/plugin-worker.js +12 -6
- package/src/project-graph/plugins/loaded-nx-plugin.d.ts +2 -1
- package/src/project-graph/plugins/loaded-nx-plugin.js +1 -5
- package/src/project-graph/plugins/public-api.d.ts +1 -1
- package/src/project-graph/plugins/utils.d.ts +2 -2
- package/src/project-graph/plugins/utils.js +2 -2
- package/src/project-graph/project-graph.js +1 -1
- package/src/project-graph/utils/project-configuration-utils.d.ts +3 -3
- package/src/project-graph/utils/project-configuration-utils.js +54 -21
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +1 -1
- package/src/project-graph/utils/retrieve-workspace-files.js +14 -18
- package/src/tasks-runner/batch/batch-messages.d.ts +2 -0
- package/src/tasks-runner/batch/run-batch.js +4 -5
- package/src/tasks-runner/cache.d.ts +21 -8
- package/src/tasks-runner/cache.js +106 -38
- package/src/tasks-runner/create-task-graph.d.ts +0 -1
- package/src/tasks-runner/create-task-graph.js +11 -11
- package/src/tasks-runner/default-tasks-runner.js +5 -14
- package/src/tasks-runner/forked-process-task-runner.d.ts +8 -3
- package/src/tasks-runner/forked-process-task-runner.js +59 -46
- package/src/tasks-runner/init-tasks-runner.d.ts +15 -1
- package/src/tasks-runner/init-tasks-runner.js +62 -2
- package/src/tasks-runner/is-tui-enabled.d.ts +2 -0
- package/src/tasks-runner/is-tui-enabled.js +64 -0
- package/src/tasks-runner/life-cycle.d.ts +14 -3
- package/src/tasks-runner/life-cycle.js +37 -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 +15 -7
- 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 +35 -5
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.d.ts +18 -0
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +230 -0
- package/src/tasks-runner/pseudo-terminal.d.ts +11 -7
- package/src/tasks-runner/pseudo-terminal.js +47 -35
- package/src/tasks-runner/run-command.d.ts +4 -1
- package/src/tasks-runner/run-command.js +219 -63
- package/src/tasks-runner/running-tasks/node-child-process.js +4 -11
- package/src/tasks-runner/running-tasks/running-task.d.ts +3 -0
- package/src/tasks-runner/running-tasks/shared-running-task.d.ts +14 -0
- package/src/tasks-runner/running-tasks/shared-running-task.js +30 -0
- package/src/tasks-runner/task-env.d.ts +1 -4
- package/src/tasks-runner/task-env.js +2 -0
- package/src/tasks-runner/task-graph-utils.d.ts +3 -0
- package/src/tasks-runner/task-graph-utils.js +31 -2
- package/src/tasks-runner/task-orchestrator.d.ts +26 -10
- package/src/tasks-runner/task-orchestrator.js +221 -57
- package/src/tasks-runner/tasks-runner.d.ts +1 -0
- package/src/tasks-runner/tasks-schedule.d.ts +1 -0
- package/src/tasks-runner/tasks-schedule.js +9 -0
- package/src/tasks-runner/utils.d.ts +2 -2
- package/src/tasks-runner/utils.js +18 -12
- package/src/utils/child-process.d.ts +4 -0
- package/src/utils/child-process.js +23 -30
- package/src/utils/command-line-utils.d.ts +1 -1
- package/src/utils/find-matching-projects.js +2 -2
- package/src/utils/git-utils.d.ts +1 -1
- package/src/utils/git-utils.js +8 -3
- package/src/utils/handle-errors.js +15 -0
- package/src/utils/is-ci.js +4 -1
- package/src/utils/is-using-prettier.d.ts +3 -0
- package/src/utils/is-using-prettier.js +62 -0
- package/src/utils/nx-key.d.ts +7 -0
- package/src/utils/nx-key.js +52 -0
- package/src/utils/package-json.d.ts +1 -1
- package/src/utils/package-json.js +16 -2
- package/src/utils/package-manager.js +2 -2
- package/src/utils/path.js +1 -1
- package/src/utils/require-nx-key.d.ts +1 -0
- package/src/utils/require-nx-key.js +22 -0
- package/src/utils/workspace-context.d.ts +2 -0
- package/src/utils/workspace-context.js +16 -0
- package/src/command-line/activate-powerpack/activate-powerpack.d.ts +0 -2
- package/src/command-line/activate-powerpack/activate-powerpack.js +0 -34
- package/src/command-line/activate-powerpack/command-object.d.ts +0 -6
- package/src/command-line/init/implementation/react/write-craco-config.d.ts +0 -1
- package/src/command-line/init/implementation/react/write-craco-config.js +0 -61
- 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/utils/powerpack.d.ts +0 -5
- package/src/utils/powerpack.js +0 -33
- /package/src/migrations/{update-17-0-0/rm-default-collection-npm-scope.d.ts → update-21-0-0/remove-legacy-cache.d.ts} +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.defaultCreateReleaseProvider = exports.IMPLICIT_DEFAULT_RELEASE_GROUP = void 0;
|
3
|
+
exports.defaultCreateReleaseProvider = exports.DEFAULT_VERSION_ACTIONS_PATH = exports.IMPLICIT_DEFAULT_RELEASE_GROUP = void 0;
|
4
4
|
exports.createNxReleaseConfig = createNxReleaseConfig;
|
5
5
|
exports.handleNxReleaseConfigError = handleNxReleaseConfigError;
|
6
6
|
/**
|
@@ -21,12 +21,14 @@ const node_url_1 = require("node:url");
|
|
21
21
|
const fileutils_1 = require("../../../utils/fileutils");
|
22
22
|
const find_matching_projects_1 = require("../../../utils/find-matching-projects");
|
23
23
|
const output_1 = require("../../../utils/output");
|
24
|
-
const workspace_root_1 = require("../../../utils/workspace-root");
|
25
24
|
const path_1 = require("../../../utils/path");
|
25
|
+
const workspace_root_1 = require("../../../utils/workspace-root");
|
26
26
|
const resolve_changelog_renderer_1 = require("../utils/resolve-changelog-renderer");
|
27
27
|
const resolve_nx_json_error_message_1 = require("../utils/resolve-nx-json-error-message");
|
28
28
|
const conventional_commits_1 = require("./conventional-commits");
|
29
|
+
const use_legacy_versioning_1 = require("./use-legacy-versioning");
|
29
30
|
exports.IMPLICIT_DEFAULT_RELEASE_GROUP = '__default__';
|
31
|
+
exports.DEFAULT_VERSION_ACTIONS_PATH = '@nx/js/src/release/version-actions';
|
30
32
|
// Apply default configuration to any optional user configuration and handle known errors
|
31
33
|
async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig = {}) {
|
32
34
|
if (userConfig.projects && userConfig.groups) {
|
@@ -50,12 +52,13 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
50
52
|
if (hasInvalidConventionalCommitsConfig(userConfig)) {
|
51
53
|
return {
|
52
54
|
error: {
|
53
|
-
code: '
|
55
|
+
code: 'CONVENTIONAL_COMMITS_SHORTHAND_MIXED_WITH_OVERLAPPING_OPTIONS',
|
54
56
|
data: {},
|
55
57
|
},
|
56
58
|
nxReleaseConfig: null,
|
57
59
|
};
|
58
60
|
}
|
61
|
+
const USE_LEGACY_VERSIONING = (0, use_legacy_versioning_1.shouldUseLegacyVersioning)(userConfig);
|
59
62
|
const gitDefaults = {
|
60
63
|
commit: false,
|
61
64
|
commitMessage: 'chore(release): publish {version}',
|
@@ -65,6 +68,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
65
68
|
tagArgs: '',
|
66
69
|
stageChanges: false,
|
67
70
|
push: false,
|
71
|
+
pushArgs: '',
|
68
72
|
};
|
69
73
|
const versionGitDefaults = {
|
70
74
|
...gitDefaults,
|
@@ -133,11 +137,27 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
133
137
|
projectsRelationship: workspaceProjectsRelationship,
|
134
138
|
git: gitDefaults,
|
135
139
|
version: {
|
140
|
+
useLegacyVersioning: USE_LEGACY_VERSIONING,
|
136
141
|
git: versionGitDefaults,
|
137
142
|
conventionalCommits: userConfig.version?.conventionalCommits || false,
|
138
|
-
generator: '@nx/js:release-version',
|
139
|
-
generatorOptions: defaultGeneratorOptions,
|
140
143
|
preVersionCommand: userConfig.version?.preVersionCommand || '',
|
144
|
+
...(USE_LEGACY_VERSIONING
|
145
|
+
? {
|
146
|
+
generator: '@nx/js:release-version',
|
147
|
+
generatorOptions: defaultGeneratorOptions,
|
148
|
+
}
|
149
|
+
: {
|
150
|
+
versionActions: exports.DEFAULT_VERSION_ACTIONS_PATH,
|
151
|
+
versionActionsOptions: {},
|
152
|
+
currentVersionResolver: defaultGeneratorOptions.currentVersionResolver,
|
153
|
+
specifierSource: defaultGeneratorOptions.specifierSource,
|
154
|
+
preserveLocalDependencyProtocols: userConfig.version
|
155
|
+
?.preserveLocalDependencyProtocols ?? true,
|
156
|
+
logUnchangedProjects: userConfig.version
|
157
|
+
?.logUnchangedProjects ?? true,
|
158
|
+
updateDependents: userConfig.version
|
159
|
+
?.updateDependents ?? 'auto',
|
160
|
+
}),
|
141
161
|
},
|
142
162
|
changelog: {
|
143
163
|
git: changelogGitDefaults,
|
@@ -177,6 +197,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
177
197
|
(workspaceProjectsRelationship === 'independent'
|
178
198
|
? defaultIndependentReleaseTagPattern
|
179
199
|
: defaultFixedReleaseTagPattern),
|
200
|
+
releaseTagPatternCheckAllBranchesWhen: userConfig.releaseTagPatternCheckAllBranchesWhen ?? undefined,
|
180
201
|
conventionalCommits: conventional_commits_1.DEFAULT_CONVENTIONAL_COMMITS_CONFIG,
|
181
202
|
versionPlans: (userConfig.versionPlans ||
|
182
203
|
false),
|
@@ -184,12 +205,19 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
184
205
|
const groupProjectsRelationship = userConfig.projectsRelationship || WORKSPACE_DEFAULTS.projectsRelationship;
|
185
206
|
const GROUP_DEFAULTS = {
|
186
207
|
projectsRelationship: groupProjectsRelationship,
|
187
|
-
version:
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
208
|
+
version: USE_LEGACY_VERSIONING
|
209
|
+
? {
|
210
|
+
conventionalCommits: false,
|
211
|
+
generator: '@nx/js:release-version',
|
212
|
+
generatorOptions: {},
|
213
|
+
groupPreVersionCommand: '',
|
214
|
+
}
|
215
|
+
: {
|
216
|
+
conventionalCommits: false,
|
217
|
+
versionActions: exports.DEFAULT_VERSION_ACTIONS_PATH,
|
218
|
+
versionActionsOptions: {},
|
219
|
+
groupPreVersionCommand: '',
|
220
|
+
},
|
193
221
|
changelog: {
|
194
222
|
createRelease: false,
|
195
223
|
entryWhenNoChanges: 'This was a version bump only for {projectName} to align it with other projects, there were no code changes.',
|
@@ -207,6 +235,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
207
235
|
groupProjectsRelationship === 'independent'
|
208
236
|
? defaultIndependentReleaseTagPattern
|
209
237
|
: WORKSPACE_DEFAULTS.releaseTagPattern,
|
238
|
+
releaseTagPatternCheckAllBranchesWhen: userConfig.releaseTagPatternCheckAllBranchesWhen ?? undefined,
|
210
239
|
versionPlans: false,
|
211
240
|
};
|
212
241
|
/**
|
@@ -217,7 +246,9 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
217
246
|
const rootVersionConfig = deepMergeDefaults([
|
218
247
|
WORKSPACE_DEFAULTS.version,
|
219
248
|
// Merge in the git defaults from the top level
|
220
|
-
{
|
249
|
+
{
|
250
|
+
git: versionGitDefaults,
|
251
|
+
},
|
221
252
|
{
|
222
253
|
git: userConfig.git,
|
223
254
|
},
|
@@ -240,33 +271,50 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
240
271
|
WORKSPACE_DEFAULTS.versionPlans);
|
241
272
|
const rootConventionalCommitsConfig = deepMergeDefaults([WORKSPACE_DEFAULTS.conventionalCommits], fillUnspecifiedConventionalCommitsProperties(normalizeConventionalCommitsConfig(userConfig.conventionalCommits)));
|
242
273
|
// these options are not supported at the group level, only the root/command level
|
243
|
-
|
274
|
+
let rootVersionWithoutGlobalOptions = {
|
244
275
|
...rootVersionConfig,
|
245
276
|
};
|
246
277
|
delete rootVersionWithoutGlobalOptions.git;
|
247
278
|
delete rootVersionWithoutGlobalOptions.preVersionCommand;
|
248
279
|
// Apply conventionalCommits shorthand to the final group defaults if explicitly configured in the original user config
|
249
280
|
if (userConfig.version?.conventionalCommits === true) {
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
281
|
+
if (USE_LEGACY_VERSIONING) {
|
282
|
+
rootVersionWithoutGlobalOptions.generatorOptions = {
|
283
|
+
...rootVersionWithoutGlobalOptions.generatorOptions,
|
284
|
+
currentVersionResolver: 'git-tag',
|
285
|
+
specifierSource: 'conventional-commits',
|
286
|
+
};
|
287
|
+
}
|
288
|
+
else {
|
289
|
+
rootVersionWithoutGlobalOptions.currentVersionResolver = 'git-tag';
|
290
|
+
rootVersionWithoutGlobalOptions.specifierSource = 'conventional-commits';
|
291
|
+
}
|
255
292
|
}
|
256
293
|
if (userConfig.version?.conventionalCommits === false) {
|
257
294
|
delete rootVersionWithoutGlobalOptions.generatorOptions
|
258
295
|
.currentVersionResolver;
|
259
296
|
delete rootVersionWithoutGlobalOptions.generatorOptions.specifierSource;
|
297
|
+
delete rootVersionWithoutGlobalOptions
|
298
|
+
.currentVersionResolver;
|
299
|
+
delete rootVersionWithoutGlobalOptions
|
300
|
+
.specifierSource;
|
260
301
|
}
|
261
302
|
// Apply versionPlans shorthand to the final group defaults if explicitly configured in the original user config
|
262
303
|
if (userConfig.versionPlans) {
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
304
|
+
if (USE_LEGACY_VERSIONING) {
|
305
|
+
rootVersionWithoutGlobalOptions.generatorOptions = {
|
306
|
+
...rootVersionWithoutGlobalOptions.generatorOptions,
|
307
|
+
specifierSource: 'version-plans',
|
308
|
+
};
|
309
|
+
}
|
310
|
+
else {
|
311
|
+
rootVersionWithoutGlobalOptions.specifierSource = 'version-plans';
|
312
|
+
}
|
267
313
|
}
|
268
314
|
if (userConfig.versionPlans === false) {
|
269
315
|
delete rootVersionWithoutGlobalOptions.generatorOptions.specifierSource;
|
316
|
+
delete rootVersionWithoutGlobalOptions
|
317
|
+
.specifierSource;
|
270
318
|
}
|
271
319
|
const groups = userConfig.groups && Object.keys(userConfig.groups).length
|
272
320
|
? ensureProjectsConfigIsArray(userConfig.groups)
|
@@ -365,6 +413,9 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
365
413
|
(projectsRelationship === 'independent'
|
366
414
|
? defaultIndependentReleaseTagPattern
|
367
415
|
: userConfig.releaseTagPattern || defaultFixedReleaseTagPattern),
|
416
|
+
releaseTagPatternCheckAllBranchesWhen: releaseGroup.releaseTagPatternCheckAllBranchesWhen ??
|
417
|
+
userConfig.releaseTagPatternCheckAllBranchesWhen ??
|
418
|
+
undefined,
|
368
419
|
versionPlans: releaseGroup.versionPlans ?? rootVersionPlansConfig,
|
369
420
|
};
|
370
421
|
const finalReleaseGroup = deepMergeDefaults([groupDefaults], {
|
@@ -372,32 +423,56 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
372
423
|
// Ensure that the resolved project names take priority over the original user config (which could have contained unresolved globs etc)
|
373
424
|
projects: matchingProjects,
|
374
425
|
});
|
426
|
+
finalReleaseGroup.version =
|
427
|
+
finalReleaseGroup.version;
|
375
428
|
// Apply conventionalCommits shorthand to the final group if explicitly configured in the original group
|
376
429
|
if (releaseGroup.version?.conventionalCommits === true) {
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
430
|
+
if (USE_LEGACY_VERSIONING) {
|
431
|
+
finalReleaseGroup.version.generatorOptions = {
|
432
|
+
...finalReleaseGroup.version.generatorOptions,
|
433
|
+
currentVersionResolver: 'git-tag',
|
434
|
+
specifierSource: 'conventional-commits',
|
435
|
+
};
|
436
|
+
}
|
437
|
+
else {
|
438
|
+
finalReleaseGroup.version.currentVersionResolver = 'git-tag';
|
439
|
+
finalReleaseGroup.version.specifierSource = 'conventional-commits';
|
440
|
+
}
|
382
441
|
}
|
383
442
|
if (releaseGroup.version?.conventionalCommits === false &&
|
384
443
|
releaseGroupName !== exports.IMPLICIT_DEFAULT_RELEASE_GROUP) {
|
385
|
-
|
386
|
-
|
444
|
+
if (USE_LEGACY_VERSIONING) {
|
445
|
+
delete finalReleaseGroup.version.generatorOptions
|
446
|
+
?.currentVersionResolver;
|
447
|
+
delete finalReleaseGroup.version.generatorOptions?.specifierSource;
|
448
|
+
}
|
449
|
+
delete finalReleaseGroup.version
|
450
|
+
.currentVersionResolver;
|
451
|
+
delete finalReleaseGroup.version
|
452
|
+
.specifierSource;
|
387
453
|
}
|
388
454
|
// Apply versionPlans shorthand to the final group if explicitly configured in the original group
|
389
455
|
if (releaseGroup.versionPlans) {
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
456
|
+
if (USE_LEGACY_VERSIONING) {
|
457
|
+
finalReleaseGroup.version = {
|
458
|
+
...finalReleaseGroup.version,
|
459
|
+
generatorOptions: {
|
460
|
+
...finalReleaseGroup.version?.generatorOptions,
|
461
|
+
specifierSource: 'version-plans',
|
462
|
+
},
|
463
|
+
};
|
464
|
+
}
|
465
|
+
else {
|
466
|
+
finalReleaseGroup.version.specifierSource = 'version-plans';
|
467
|
+
}
|
397
468
|
}
|
398
469
|
if (releaseGroup.versionPlans === false &&
|
399
470
|
releaseGroupName !== exports.IMPLICIT_DEFAULT_RELEASE_GROUP) {
|
400
|
-
|
471
|
+
if (USE_LEGACY_VERSIONING) {
|
472
|
+
delete finalReleaseGroup.version.generatorOptions?.specifierSource;
|
473
|
+
}
|
474
|
+
delete finalReleaseGroup.version
|
475
|
+
.specifierSource;
|
401
476
|
}
|
402
477
|
releaseGroups[releaseGroupName] = finalReleaseGroup;
|
403
478
|
}
|
@@ -413,6 +488,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
413
488
|
nxReleaseConfig: {
|
414
489
|
projectsRelationship: WORKSPACE_DEFAULTS.projectsRelationship,
|
415
490
|
releaseTagPattern: WORKSPACE_DEFAULTS.releaseTagPattern,
|
491
|
+
releaseTagPatternCheckAllBranchesWhen: WORKSPACE_DEFAULTS.releaseTagPatternCheckAllBranchesWhen,
|
416
492
|
git: rootGitConfig,
|
417
493
|
version: rootVersionConfig,
|
418
494
|
changelog: rootChangelogConfig,
|
@@ -511,7 +587,7 @@ function fillUnspecifiedConventionalCommitsProperties(config) {
|
|
511
587
|
types,
|
512
588
|
};
|
513
589
|
}
|
514
|
-
async function handleNxReleaseConfigError(error) {
|
590
|
+
async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
515
591
|
switch (error.code) {
|
516
592
|
case 'PROJECTS_AND_GROUPS_DEFINED':
|
517
593
|
{
|
@@ -563,13 +639,16 @@ async function handleNxReleaseConfigError(error) {
|
|
563
639
|
});
|
564
640
|
}
|
565
641
|
break;
|
566
|
-
case '
|
642
|
+
case 'CONVENTIONAL_COMMITS_SHORTHAND_MIXED_WITH_OVERLAPPING_OPTIONS':
|
567
643
|
{
|
568
644
|
const nxJsonMessage = await (0, resolve_nx_json_error_message_1.resolveNxJsonConfigErrorMessage)([
|
569
645
|
'release',
|
570
646
|
]);
|
647
|
+
const text = useLegacyVersioning
|
648
|
+
? '"version.generatorOptions"'
|
649
|
+
: 'configuration options';
|
571
650
|
output_1.output.error({
|
572
|
-
title: `You have configured both the shorthand "version.conventionalCommits" and one or more of the related
|
651
|
+
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:`,
|
573
652
|
bodyLines: [nxJsonMessage],
|
574
653
|
});
|
575
654
|
}
|
@@ -592,6 +671,7 @@ async function handleNxReleaseConfigError(error) {
|
|
592
671
|
title: `There was an error when resolving the configured changelog renderer at path: ${error.data.workspaceRelativePath}`,
|
593
672
|
bodyLines: [nxJsonMessage],
|
594
673
|
});
|
674
|
+
break;
|
595
675
|
}
|
596
676
|
case 'INVALID_CHANGELOG_CREATE_RELEASE_PROVIDER':
|
597
677
|
{
|
@@ -716,21 +796,35 @@ function deepMergeDefaults(defaultConfigs, userConfig) {
|
|
716
796
|
}
|
717
797
|
/**
|
718
798
|
* We want to prevent users from setting both the conventionalCommits shorthand and any of the related
|
719
|
-
*
|
799
|
+
* configuration options at the same time, since it is at best redundant, and at worst invalid.
|
720
800
|
*/
|
721
801
|
function hasInvalidConventionalCommitsConfig(userConfig) {
|
722
802
|
// at the root
|
723
803
|
if (userConfig.version?.conventionalCommits === true &&
|
724
|
-
|
725
|
-
|
804
|
+
// v2 config - directly on version config
|
805
|
+
(userConfig.version
|
806
|
+
?.currentVersionResolver ||
|
807
|
+
userConfig.version?.specifierSource ||
|
808
|
+
// Legacy config - on generatorOptions
|
809
|
+
userConfig.version
|
810
|
+
?.generatorOptions?.currentVersionResolver ||
|
811
|
+
userConfig.version
|
812
|
+
?.generatorOptions?.specifierSource)) {
|
726
813
|
return true;
|
727
814
|
}
|
728
815
|
// within any groups
|
729
816
|
if (userConfig.groups) {
|
730
817
|
for (const group of Object.values(userConfig.groups)) {
|
731
818
|
if (group.version?.conventionalCommits === true &&
|
732
|
-
|
733
|
-
|
819
|
+
// v2 config - directly on version config
|
820
|
+
(group.version
|
821
|
+
?.currentVersionResolver ||
|
822
|
+
group.version?.specifierSource ||
|
823
|
+
// Legacy config - on generatorOptions
|
824
|
+
group.version
|
825
|
+
?.generatorOptions?.currentVersionResolver ||
|
826
|
+
group.version
|
827
|
+
?.generatorOptions?.specifierSource)) {
|
734
828
|
return true;
|
735
829
|
}
|
736
830
|
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.shouldUseLegacyVersioning = shouldUseLegacyVersioning;
|
4
|
+
// TODO(v22): remove this function and entire concept of legacy versioning in v22
|
5
|
+
function shouldUseLegacyVersioning(releaseConfig) {
|
6
|
+
return process.env.NX_INTERNAL_USE_LEGACY_VERSIONING === 'true'
|
7
|
+
? true
|
8
|
+
: releaseConfig?.version?.useLegacyVersioning ?? false;
|
9
|
+
}
|
@@ -31,3 +31,7 @@ export declare const releaseVersion: typeof defaultClient.releaseVersion;
|
|
31
31
|
* @public
|
32
32
|
*/
|
33
33
|
export declare const release: typeof defaultClient.release;
|
34
|
+
/**
|
35
|
+
* @public
|
36
|
+
*/
|
37
|
+
export { AfterAllProjectsVersioned, VersionActions, } from './version/version-actions';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.release = exports.releaseVersion = exports.releasePublish = exports.releaseChangelog = exports.ReleaseClient = void 0;
|
3
|
+
exports.VersionActions = exports.release = exports.releaseVersion = exports.releasePublish = exports.releaseChangelog = exports.ReleaseClient = void 0;
|
4
4
|
const changelog_1 = require("./changelog");
|
5
5
|
const publish_1 = require("./publish");
|
6
6
|
const release_1 = require("./release");
|
@@ -35,3 +35,8 @@ exports.releaseVersion = defaultClient.releaseVersion.bind(defaultClient);
|
|
35
35
|
* @public
|
36
36
|
*/
|
37
37
|
exports.release = defaultClient.release.bind(defaultClient);
|
38
|
+
/**
|
39
|
+
* @public
|
40
|
+
*/
|
41
|
+
var version_actions_1 = require("./version/version-actions");
|
42
|
+
Object.defineProperty(exports, "VersionActions", { enumerable: true, get: function () { return version_actions_1.VersionActions; } });
|
@@ -7,11 +7,12 @@ const file_map_utils_1 = require("../../project-graph/file-map-utils");
|
|
7
7
|
const project_graph_1 = require("../../project-graph/project-graph");
|
8
8
|
const all_file_data_1 = require("../../utils/all-file-data");
|
9
9
|
const command_line_utils_1 = require("../../utils/command-line-utils");
|
10
|
-
const output_1 = require("../../utils/output");
|
11
10
|
const handle_errors_1 = require("../../utils/handle-errors");
|
11
|
+
const output_1 = require("../../utils/output");
|
12
12
|
const config_1 = require("./config/config");
|
13
13
|
const deep_merge_json_1 = require("./config/deep-merge-json");
|
14
14
|
const filter_release_groups_1 = require("./config/filter-release-groups");
|
15
|
+
const use_legacy_versioning_1 = require("./config/use-legacy-versioning");
|
15
16
|
const version_plans_1 = require("./config/version-plans");
|
16
17
|
const get_touched_projects_for_group_1 = require("./utils/get-touched-projects-for-group");
|
17
18
|
const print_config_1 = require("./utils/print-config");
|
@@ -25,7 +26,8 @@ function createAPI(overrideReleaseConfig) {
|
|
25
26
|
// Apply default configuration to any optional user configuration
|
26
27
|
const { error: configError, nxReleaseConfig } = await (0, config_1.createNxReleaseConfig)(projectGraph, await (0, file_map_utils_1.createProjectFileMapUsingProjectGraph)(projectGraph), userProvidedReleaseConfig);
|
27
28
|
if (configError) {
|
28
|
-
|
29
|
+
const USE_LEGACY_VERSIONING = (0, use_legacy_versioning_1.shouldUseLegacyVersioning)(userProvidedReleaseConfig);
|
30
|
+
return await (0, config_1.handleNxReleaseConfigError)(configError, USE_LEGACY_VERSIONING);
|
29
31
|
}
|
30
32
|
// --print-config exits directly as it is not designed to be combined with any other programmatic operations
|
31
33
|
if (args.printConfig) {
|
@@ -47,7 +49,8 @@ function createAPI(overrideReleaseConfig) {
|
|
47
49
|
title: 'Version plans are not enabled',
|
48
50
|
bodyLines: [
|
49
51
|
'Please ensure at least one release group has version plans enabled in your Nx release configuration if you want to use this command.',
|
50
|
-
|
52
|
+
'',
|
53
|
+
'Learn more about version plans here: https://nx.dev/recipes/nx-release/file-based-versioning-version-plans',
|
51
54
|
],
|
52
55
|
});
|
53
56
|
return 1;
|
@@ -13,11 +13,12 @@ const file_map_utils_1 = require("../../project-graph/file-map-utils");
|
|
13
13
|
const project_graph_1 = require("../../project-graph/project-graph");
|
14
14
|
const all_file_data_1 = require("../../utils/all-file-data");
|
15
15
|
const command_line_utils_1 = require("../../utils/command-line-utils");
|
16
|
-
const output_1 = require("../../utils/output");
|
17
16
|
const handle_errors_1 = require("../../utils/handle-errors");
|
17
|
+
const output_1 = require("../../utils/output");
|
18
18
|
const config_1 = require("./config/config");
|
19
19
|
const deep_merge_json_1 = require("./config/deep-merge-json");
|
20
20
|
const filter_release_groups_1 = require("./config/filter-release-groups");
|
21
|
+
const use_legacy_versioning_1 = require("./config/use-legacy-versioning");
|
21
22
|
const version_plans_1 = require("./config/version-plans");
|
22
23
|
const generate_version_plan_content_1 = require("./utils/generate-version-plan-content");
|
23
24
|
const get_touched_projects_for_group_1 = require("./utils/get-touched-projects-for-group");
|
@@ -34,7 +35,8 @@ function createAPI(overrideReleaseConfig) {
|
|
34
35
|
// Apply default configuration to any optional user configuration
|
35
36
|
const { error: configError, nxReleaseConfig } = await (0, config_1.createNxReleaseConfig)(projectGraph, await (0, file_map_utils_1.createProjectFileMapUsingProjectGraph)(projectGraph), userProvidedReleaseConfig);
|
36
37
|
if (configError) {
|
37
|
-
|
38
|
+
const USE_LEGACY_VERSIONING = (0, use_legacy_versioning_1.shouldUseLegacyVersioning)(userProvidedReleaseConfig);
|
39
|
+
return await (0, config_1.handleNxReleaseConfigError)(configError, USE_LEGACY_VERSIONING);
|
38
40
|
}
|
39
41
|
// --print-config exits directly as it is not designed to be combined with any other programmatic operations
|
40
42
|
if (args.printConfig) {
|
@@ -210,10 +212,12 @@ async function promptForVersion(message) {
|
|
210
212
|
]);
|
211
213
|
return reply.version;
|
212
214
|
}
|
213
|
-
catch
|
215
|
+
catch {
|
214
216
|
output_1.output.log({
|
215
217
|
title: 'Cancelled version plan creation.',
|
216
218
|
});
|
219
|
+
// Ensure the cursor is always restored before exiting
|
220
|
+
process.stdout.write('\u001b[?25h');
|
217
221
|
process.exit(0);
|
218
222
|
}
|
219
223
|
}
|
@@ -4,19 +4,20 @@ exports.releasePublishCLIHandler = void 0;
|
|
4
4
|
exports.createAPI = createAPI;
|
5
5
|
const nx_json_1 = require("../../config/nx-json");
|
6
6
|
const file_map_utils_1 = require("../../project-graph/file-map-utils");
|
7
|
+
const tasks_execution_hooks_1 = require("../../project-graph/plugins/tasks-execution-hooks");
|
7
8
|
const project_graph_1 = require("../../project-graph/project-graph");
|
8
9
|
const run_command_1 = require("../../tasks-runner/run-command");
|
9
10
|
const command_line_utils_1 = require("../../utils/command-line-utils");
|
10
11
|
const handle_errors_1 = require("../../utils/handle-errors");
|
11
12
|
const output_1 = require("../../utils/output");
|
12
13
|
const project_graph_utils_1 = require("../../utils/project-graph-utils");
|
14
|
+
const workspace_root_1 = require("../../utils/workspace-root");
|
13
15
|
const graph_1 = require("../graph/graph");
|
14
16
|
const config_1 = require("./config/config");
|
15
17
|
const deep_merge_json_1 = require("./config/deep-merge-json");
|
16
18
|
const filter_release_groups_1 = require("./config/filter-release-groups");
|
19
|
+
const use_legacy_versioning_1 = require("./config/use-legacy-versioning");
|
17
20
|
const print_config_1 = require("./utils/print-config");
|
18
|
-
const workspace_root_1 = require("../../utils/workspace-root");
|
19
|
-
const tasks_execution_hooks_1 = require("../../project-graph/plugins/tasks-execution-hooks");
|
20
21
|
const releasePublishCLIHandler = (args) => (0, handle_errors_1.handleErrors)(args.verbose, async () => {
|
21
22
|
const publishProjectsResult = await createAPI({})(args);
|
22
23
|
// If all projects are published successfully, return 0, otherwise return 1
|
@@ -46,7 +47,8 @@ function createAPI(overrideReleaseConfig) {
|
|
46
47
|
// Apply default configuration to any optional user configuration
|
47
48
|
const { error: configError, nxReleaseConfig } = await (0, config_1.createNxReleaseConfig)(projectGraph, await (0, file_map_utils_1.createProjectFileMapUsingProjectGraph)(projectGraph), userProvidedReleaseConfig);
|
48
49
|
if (configError) {
|
49
|
-
|
50
|
+
const USE_LEGACY_VERSIONING = (0, use_legacy_versioning_1.shouldUseLegacyVersioning)(userProvidedReleaseConfig);
|
51
|
+
return await (0, config_1.handleNxReleaseConfigError)(configError, USE_LEGACY_VERSIONING);
|
50
52
|
}
|
51
53
|
// --print-config exits directly as it is not designed to be combined with any other programmatic operations
|
52
54
|
if (args.printConfig) {
|
@@ -162,7 +164,9 @@ async function runPublishOnProjects(args, projectGraph, nxJson, projectNames, ex
|
|
162
164
|
});
|
163
165
|
/**
|
164
166
|
* Run the relevant nx-release-publish executor on each of the selected projects.
|
167
|
+
* NOTE: Force TUI to be disabled for now.
|
165
168
|
*/
|
169
|
+
process.env.NX_TUI = 'false';
|
166
170
|
const commandResults = await (0, run_command_1.runCommandForTasks)(projectsWithTarget, projectGraph, { nxJson }, {
|
167
171
|
targets: [requiredTargetName],
|
168
172
|
outputStyle: 'static',
|
@@ -7,12 +7,13 @@ const node_fs_1 = require("node:fs");
|
|
7
7
|
const nx_json_1 = require("../../config/nx-json");
|
8
8
|
const file_map_utils_1 = require("../../project-graph/file-map-utils");
|
9
9
|
const project_graph_1 = require("../../project-graph/project-graph");
|
10
|
-
const output_1 = require("../../utils/output");
|
11
10
|
const handle_errors_1 = require("../../utils/handle-errors");
|
11
|
+
const output_1 = require("../../utils/output");
|
12
12
|
const changelog_1 = require("./changelog");
|
13
13
|
const config_1 = require("./config/config");
|
14
14
|
const deep_merge_json_1 = require("./config/deep-merge-json");
|
15
15
|
const filter_release_groups_1 = require("./config/filter-release-groups");
|
16
|
+
const use_legacy_versioning_1 = require("./config/use-legacy-versioning");
|
16
17
|
const version_plans_1 = require("./config/version-plans");
|
17
18
|
const publish_1 = require("./publish");
|
18
19
|
const git_1 = require("./utils/git");
|
@@ -47,7 +48,8 @@ function createAPI(overrideReleaseConfig) {
|
|
47
48
|
// Apply default configuration to any optional user configuration
|
48
49
|
const { error: configError, nxReleaseConfig } = await (0, config_1.createNxReleaseConfig)(projectGraph, await (0, file_map_utils_1.createProjectFileMapUsingProjectGraph)(projectGraph), userProvidedReleaseConfig);
|
49
50
|
if (configError) {
|
50
|
-
|
51
|
+
const USE_LEGACY_VERSIONING = (0, use_legacy_versioning_1.shouldUseLegacyVersioning)(userProvidedReleaseConfig);
|
52
|
+
return await (0, config_1.handleNxReleaseConfigError)(configError, USE_LEGACY_VERSIONING);
|
51
53
|
}
|
52
54
|
// --print-config exits directly as it is not designed to be combined with any other programmatic operations
|
53
55
|
if (args.printConfig) {
|
@@ -172,6 +174,7 @@ function createAPI(overrideReleaseConfig) {
|
|
172
174
|
await (0, git_1.gitPush)({
|
173
175
|
dryRun: args.dryRun,
|
174
176
|
verbose: args.verbose,
|
177
|
+
additionalArgs: nxReleaseConfig.git.pushArgs,
|
175
178
|
});
|
176
179
|
hasPushedChanges = true;
|
177
180
|
}
|
@@ -243,7 +246,9 @@ async function promptForPublish() {
|
|
243
246
|
]);
|
244
247
|
return reply.confirmation;
|
245
248
|
}
|
246
|
-
catch
|
249
|
+
catch {
|
250
|
+
// Ensure the cursor is always restored before exiting
|
251
|
+
process.stdout.write('\u001b[?25h');
|
247
252
|
// Handle the case where the user exits the prompt with ctrl+c
|
248
253
|
return false;
|
249
254
|
}
|
@@ -10,11 +10,14 @@ function batchProjectsByGeneratorConfig(projectGraph, releaseGroup, projectNames
|
|
10
10
|
const configBatches = new Map();
|
11
11
|
for (const projectName of projectNamesToBatch) {
|
12
12
|
const project = projectGraph.nodes[projectName];
|
13
|
-
const generator = project.data.release?.version
|
13
|
+
const generator = project.data.release?.version
|
14
|
+
?.generator ||
|
14
15
|
releaseGroup.version.generator;
|
15
16
|
const generatorOptions = {
|
16
|
-
...releaseGroup.version
|
17
|
-
|
17
|
+
...releaseGroup.version
|
18
|
+
.generatorOptions,
|
19
|
+
...project.data.release?.version
|
20
|
+
?.generatorOptions,
|
18
21
|
};
|
19
22
|
let found = false;
|
20
23
|
for (const [key, projects] of configBatches) {
|
@@ -22,7 +22,7 @@ export interface GitCommit extends RawGitCommit {
|
|
22
22
|
affectedFiles: string[];
|
23
23
|
revertedHashes: string[];
|
24
24
|
}
|
25
|
-
export declare function getLatestGitTagForPattern(releaseTagPattern: string, additionalInterpolationData?: {}): Promise<{
|
25
|
+
export declare function getLatestGitTagForPattern(releaseTagPattern: string, additionalInterpolationData?: {}, checkAllBranchesWhen?: boolean | string[]): Promise<{
|
26
26
|
tag: string;
|
27
27
|
extractedVersion: string;
|
28
28
|
} | null>;
|
@@ -50,10 +50,11 @@ export declare function gitTag({ tag, message, additionalArgs, dryRun, verbose,
|
|
50
50
|
verbose?: boolean;
|
51
51
|
logFn?: (message: string) => void;
|
52
52
|
}): Promise<string>;
|
53
|
-
export declare function gitPush({ gitRemote, dryRun, verbose, }: {
|
53
|
+
export declare function gitPush({ gitRemote, dryRun, verbose, additionalArgs, }: {
|
54
54
|
gitRemote?: string;
|
55
55
|
dryRun?: boolean;
|
56
56
|
verbose?: boolean;
|
57
|
+
additionalArgs?: string | string[];
|
57
58
|
}): Promise<void>;
|
58
59
|
export declare function parseCommits(commits: RawGitCommit[]): GitCommit[];
|
59
60
|
export declare function parseConventionalCommitsMessage(message: string): {
|