nx 21.0.0-beta.1 → 21.0.0-beta.3

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.
Files changed (200) hide show
  1. package/.eslintrc.json +5 -1
  2. package/package.json +12 -12
  3. package/release/index.d.ts +1 -1
  4. package/release/index.js +2 -1
  5. package/schemas/nx-schema.json +186 -35
  6. package/src/adapter/compat.d.ts +1 -1
  7. package/src/adapter/compat.js +3 -0
  8. package/src/command-line/add/add.js +6 -16
  9. package/src/command-line/affected/command-object.js +6 -6
  10. package/src/command-line/examples.js +0 -4
  11. package/src/command-line/exec/command-object.js +1 -1
  12. package/src/command-line/generate/generator-utils.js +8 -3
  13. package/src/command-line/import/import.js +1 -1
  14. package/src/command-line/init/command-object.js +18 -6
  15. package/src/command-line/init/configure-plugins.d.ts +6 -7
  16. package/src/command-line/init/configure-plugins.js +47 -35
  17. package/src/command-line/init/implementation/add-nx-to-turborepo.d.ts +4 -0
  18. package/src/command-line/init/implementation/add-nx-to-turborepo.js +49 -0
  19. package/src/command-line/init/implementation/check-compatible-with-plugins.js +7 -1
  20. package/src/command-line/init/implementation/deduce-default-base.d.ts +1 -0
  21. package/src/command-line/init/implementation/deduce-default-base.js +53 -0
  22. package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.js +6 -4
  23. package/src/command-line/init/implementation/react/index.d.ts +1 -1
  24. package/src/command-line/init/implementation/react/index.js +32 -185
  25. package/src/command-line/init/implementation/react/write-vite-config.js +19 -3
  26. package/src/command-line/init/implementation/utils.d.ts +4 -1
  27. package/src/command-line/init/implementation/utils.js +108 -44
  28. package/src/command-line/init/init-v1.js +1 -1
  29. package/src/command-line/init/init-v2.d.ts +1 -0
  30. package/src/command-line/init/init-v2.js +68 -38
  31. package/src/command-line/nx-commands.js +19 -5
  32. package/src/command-line/register/command-object.d.ts +6 -0
  33. package/src/command-line/{activate-powerpack → register}/command-object.js +9 -9
  34. package/src/command-line/register/register.d.ts +2 -0
  35. package/src/command-line/register/register.js +9 -0
  36. package/src/command-line/release/changelog.js +18 -15
  37. package/src/command-line/release/command-object.d.ts +2 -0
  38. package/src/command-line/release/command-object.js +9 -0
  39. package/src/command-line/release/config/config.d.ts +8 -7
  40. package/src/command-line/release/config/config.js +129 -42
  41. package/src/command-line/release/config/use-legacy-versioning.d.ts +2 -0
  42. package/src/command-line/release/config/use-legacy-versioning.js +9 -0
  43. package/src/command-line/release/index.d.ts +4 -0
  44. package/src/command-line/release/index.js +6 -1
  45. package/src/command-line/release/plan-check.js +6 -3
  46. package/src/command-line/release/plan.js +7 -3
  47. package/src/command-line/release/publish.js +7 -3
  48. package/src/command-line/release/release.js +8 -3
  49. package/src/command-line/release/utils/batch-projects-by-generator-config.js +6 -3
  50. package/src/command-line/release/utils/git.d.ts +3 -2
  51. package/src/command-line/release/utils/git.js +65 -9
  52. package/src/command-line/release/utils/github.js +3 -1
  53. package/src/command-line/release/utils/resolve-semver-specifier.d.ts +2 -1
  54. package/src/command-line/release/utils/resolve-semver-specifier.js +2 -1
  55. package/src/command-line/release/utils/semver.d.ts +8 -0
  56. package/src/command-line/release/utils/semver.js +8 -0
  57. package/src/command-line/release/utils/shared-legacy.d.ts +25 -0
  58. package/src/command-line/release/utils/shared-legacy.js +2 -0
  59. package/src/command-line/release/utils/shared.d.ts +11 -17
  60. package/src/command-line/release/version/derive-specifier-from-conventional-commits.d.ts +7 -0
  61. package/src/command-line/release/version/derive-specifier-from-conventional-commits.js +47 -0
  62. package/src/command-line/release/version/deriver-specifier-from-version-plans.d.ts +8 -0
  63. package/src/command-line/release/version/deriver-specifier-from-version-plans.js +59 -0
  64. package/src/command-line/release/version/project-logger.d.ts +8 -0
  65. package/src/command-line/release/version/project-logger.js +45 -0
  66. package/src/command-line/release/version/release-group-processor.d.ts +251 -0
  67. package/src/command-line/release/version/release-group-processor.js +1040 -0
  68. package/src/command-line/release/version/resolve-current-version.d.ts +32 -0
  69. package/src/command-line/release/version/resolve-current-version.js +241 -0
  70. package/src/command-line/release/version/test-utils.d.ts +95 -0
  71. package/src/command-line/release/version/test-utils.js +416 -0
  72. package/src/command-line/release/version/topological-sort.d.ts +9 -0
  73. package/src/command-line/release/version/topological-sort.js +41 -0
  74. package/src/command-line/release/version/version-actions.d.ts +170 -0
  75. package/src/command-line/release/version/version-actions.js +183 -0
  76. package/src/command-line/release/version-legacy.d.ts +46 -0
  77. package/src/command-line/release/version-legacy.js +453 -0
  78. package/src/command-line/release/version.d.ts +0 -40
  79. package/src/command-line/release/version.js +80 -262
  80. package/src/command-line/report/report.d.ts +7 -3
  81. package/src/command-line/report/report.js +52 -18
  82. package/src/command-line/run/command-object.js +2 -2
  83. package/src/command-line/run/run.js +1 -1
  84. package/src/command-line/run-many/command-object.js +2 -2
  85. package/src/command-line/yargs-utils/shared-options.d.ts +4 -0
  86. package/src/command-line/yargs-utils/shared-options.js +20 -0
  87. package/src/config/nx-json.d.ts +153 -15
  88. package/src/config/project-graph.d.ts +4 -2
  89. package/src/config/project-graph.js +8 -0
  90. package/src/config/workspace-json-project-json.d.ts +2 -2
  91. package/src/core/graph/main.js +1 -1
  92. package/src/core/graph/runtime.js +1 -1
  93. package/src/core/graph/styles.css +2 -2
  94. package/src/core/graph/styles.js +1 -1
  95. package/src/daemon/client/client.d.ts +2 -0
  96. package/src/daemon/client/client.js +15 -0
  97. package/src/daemon/message-types/glob.d.ts +7 -0
  98. package/src/daemon/message-types/glob.js +9 -1
  99. package/src/daemon/message-types/hash-glob.d.ts +6 -0
  100. package/src/daemon/message-types/hash-glob.js +9 -1
  101. package/src/daemon/server/handle-glob.d.ts +1 -0
  102. package/src/daemon/server/handle-glob.js +8 -0
  103. package/src/daemon/server/handle-hash-glob.d.ts +1 -0
  104. package/src/daemon/server/handle-hash-glob.js +8 -0
  105. package/src/daemon/server/logger.js +2 -1
  106. package/src/daemon/server/server.js +7 -0
  107. package/src/devkit-internals.d.ts +2 -1
  108. package/src/devkit-internals.js +4 -1
  109. package/src/executors/run-commands/run-commands.impl.d.ts +3 -5
  110. package/src/executors/run-commands/run-commands.impl.js +14 -42
  111. package/src/executors/run-commands/running-tasks.d.ts +7 -5
  112. package/src/executors/run-commands/running-tasks.js +64 -27
  113. package/src/executors/run-script/run-script.impl.js +4 -3
  114. package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +8 -0
  115. package/src/generators/testing-utils/create-tree.js +5 -1
  116. package/src/native/index.d.ts +93 -19
  117. package/src/native/index.js +16 -2
  118. package/src/native/native-bindings.js +6 -0
  119. package/src/native/nx.wasi-browser.js +20 -19
  120. package/src/native/nx.wasi.cjs +20 -19
  121. package/src/native/nx.wasm32-wasi.wasm +0 -0
  122. package/src/nx-cloud/nx-cloud-tasks-runner-shell.js +3 -3
  123. package/src/plugins/js/lock-file/lock-file.js +28 -13
  124. package/src/plugins/js/lock-file/utils/package-json.d.ts +1 -1
  125. package/src/plugins/js/lock-file/utils/package-json.js +2 -1
  126. package/src/plugins/js/lock-file/yarn-parser.js +85 -39
  127. package/src/plugins/js/project-graph/affected/lock-file-changes.js +1 -0
  128. package/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.js +1 -1
  129. package/src/plugins/js/project-graph/build-dependencies/target-project-locator.d.ts +10 -1
  130. package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +59 -6
  131. package/src/plugins/js/utils/packages.js +22 -3
  132. package/src/plugins/js/utils/register.js +1 -0
  133. package/src/plugins/js/utils/typescript.js +3 -3
  134. package/src/plugins/package-json/create-nodes.d.ts +1 -1
  135. package/src/plugins/package-json/create-nodes.js +3 -1
  136. package/src/project-graph/affected/locators/project-glob-changes.js +2 -2
  137. package/src/project-graph/error-types.js +32 -2
  138. package/src/project-graph/plugins/get-plugins.js +2 -1
  139. package/src/project-graph/plugins/in-process-loader.js +1 -1
  140. package/src/project-graph/plugins/isolation/plugin-worker.js +12 -6
  141. package/src/project-graph/plugins/loaded-nx-plugin.d.ts +2 -1
  142. package/src/project-graph/plugins/utils.d.ts +2 -2
  143. package/src/project-graph/plugins/utils.js +2 -2
  144. package/src/project-graph/project-graph.js +1 -1
  145. package/src/project-graph/utils/project-configuration-utils.d.ts +1 -1
  146. package/src/project-graph/utils/project-configuration-utils.js +25 -11
  147. package/src/project-graph/utils/retrieve-workspace-files.d.ts +1 -1
  148. package/src/project-graph/utils/retrieve-workspace-files.js +14 -18
  149. package/src/tasks-runner/batch/batch-messages.d.ts +2 -0
  150. package/src/tasks-runner/batch/run-batch.js +2 -3
  151. package/src/tasks-runner/cache.d.ts +20 -6
  152. package/src/tasks-runner/cache.js +104 -20
  153. package/src/tasks-runner/create-task-graph.d.ts +1 -1
  154. package/src/tasks-runner/create-task-graph.js +12 -11
  155. package/src/tasks-runner/default-tasks-runner.js +4 -13
  156. package/src/tasks-runner/forked-process-task-runner.d.ts +8 -3
  157. package/src/tasks-runner/forked-process-task-runner.js +56 -46
  158. package/src/tasks-runner/init-tasks-runner.d.ts +15 -1
  159. package/src/tasks-runner/init-tasks-runner.js +55 -2
  160. package/src/tasks-runner/is-tui-enabled.d.ts +2 -0
  161. package/src/tasks-runner/is-tui-enabled.js +58 -0
  162. package/src/tasks-runner/life-cycle.d.ts +10 -3
  163. package/src/tasks-runner/life-cycle.js +23 -2
  164. package/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +7 -2
  165. package/src/tasks-runner/life-cycles/task-history-life-cycle.js +6 -1
  166. package/src/tasks-runner/life-cycles/tui-summary-life-cycle.d.ts +17 -0
  167. package/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +221 -0
  168. package/src/tasks-runner/pseudo-terminal.d.ts +10 -7
  169. package/src/tasks-runner/pseudo-terminal.js +37 -35
  170. package/src/tasks-runner/run-command.d.ts +1 -0
  171. package/src/tasks-runner/run-command.js +180 -23
  172. package/src/tasks-runner/task-env.d.ts +1 -4
  173. package/src/tasks-runner/task-env.js +2 -0
  174. package/src/tasks-runner/task-orchestrator.d.ts +21 -9
  175. package/src/tasks-runner/task-orchestrator.js +127 -44
  176. package/src/tasks-runner/utils.d.ts +2 -2
  177. package/src/tasks-runner/utils.js +15 -11
  178. package/src/utils/child-process.d.ts +4 -0
  179. package/src/utils/child-process.js +23 -30
  180. package/src/utils/command-line-utils.d.ts +1 -1
  181. package/src/utils/find-matching-projects.js +2 -2
  182. package/src/utils/handle-errors.js +15 -0
  183. package/src/utils/is-ci.js +4 -1
  184. package/src/utils/is-using-prettier.d.ts +3 -0
  185. package/src/utils/is-using-prettier.js +62 -0
  186. package/src/utils/nx-key.d.ts +7 -0
  187. package/src/utils/nx-key.js +52 -0
  188. package/src/utils/package-manager.js +2 -2
  189. package/src/utils/path.js +1 -1
  190. package/src/utils/require-nx-key.d.ts +1 -0
  191. package/src/utils/require-nx-key.js +22 -0
  192. package/src/utils/workspace-context.d.ts +2 -0
  193. package/src/utils/workspace-context.js +16 -0
  194. package/src/command-line/activate-powerpack/activate-powerpack.d.ts +0 -2
  195. package/src/command-line/activate-powerpack/activate-powerpack.js +0 -34
  196. package/src/command-line/activate-powerpack/command-object.d.ts +0 -6
  197. package/src/command-line/init/implementation/react/write-craco-config.d.ts +0 -1
  198. package/src/command-line/init/implementation/react/write-craco-config.js +0 -61
  199. package/src/utils/powerpack.d.ts +0 -5
  200. package/src/utils/powerpack.js +0 -33
@@ -75,6 +75,11 @@ const releaseCommand = {
75
75
  .positional('specifier', {
76
76
  type: 'string',
77
77
  describe: 'Exact version or semver keyword to apply to the selected release group.',
78
+ })
79
+ .option('preid', {
80
+ type: 'string',
81
+ describe: 'The optional prerelease identifier to apply to the version. This will only be applied in the case that the specifier argument has been set to `prerelease` OR when conventional commits are enabled, in which case it will modify the resolved specifier from conventional commits to be its prerelease equivalent. E.g. minor -> preminor.',
82
+ default: '',
78
83
  })
79
84
  .option('yes', {
80
85
  type: 'boolean',
@@ -284,6 +289,10 @@ function withGitOptions(yargs) {
284
289
  .option('git-push', {
285
290
  describe: 'Whether or not to automatically push the changes made by this command to the remote git repository.',
286
291
  type: 'boolean',
292
+ })
293
+ .option('git-push-args', {
294
+ describe: 'Additional arguments to pass to the `git push` command invoked behind the scenes.',
295
+ type: 'string',
287
296
  })
288
297
  .option('git-remote', {
289
298
  type: 'string',
@@ -1,4 +1,4 @@
1
- import { NxJsonConfiguration } from '../../../config/nx-json';
1
+ import { NxJsonConfiguration, NxReleaseConfiguration } 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]>;
@@ -25,6 +25,7 @@ type RemoveBooleanFromPropertiesOnEach<T, K extends keyof T[keyof T]> = {
25
25
  [U in keyof T]: RemoveBooleanFromProperties<T[U], K>;
26
26
  };
27
27
  export declare const IMPLICIT_DEFAULT_RELEASE_GROUP = "__default__";
28
+ export declare const DEFAULT_VERSION_ACTIONS_PATH = "@nx/js/src/release/version-actions";
28
29
  /**
29
30
  * Our source of truth is a deeply required variant of the user-facing config interface, so that command
30
31
  * implementations can be sure that properties will exist and do not need to repeat the same checks over
@@ -34,21 +35,21 @@ export declare const IMPLICIT_DEFAULT_RELEASE_GROUP = "__default__";
34
35
  * it easier to work with (the user could be specifying a single string, and they can also use any valid matcher
35
36
  * pattern such as directories and globs).
36
37
  */
37
- export type NxReleaseConfig = Omit<DeepRequired<NxJsonConfiguration['release'] & {
38
- groups: DeepRequired<RemoveTrueFromPropertiesOnEach<EnsureProjectsArray<NxJsonConfiguration['release']['groups']>, 'changelog'>>;
39
- changelog: RemoveTrueFromProperties<DeepRequired<NxJsonConfiguration['release']['changelog']>, 'workspaceChangelog' | 'projectChangelogs'>;
38
+ export type NxReleaseConfig = Omit<DeepRequired<NxReleaseConfiguration & {
39
+ groups: DeepRequired<RemoveTrueFromPropertiesOnEach<EnsureProjectsArray<NxReleaseConfiguration['groups']>, 'changelog'>>;
40
+ changelog: RemoveTrueFromProperties<DeepRequired<NxReleaseConfiguration['changelog']>, 'workspaceChangelog' | 'projectChangelogs'>;
40
41
  conventionalCommits: {
41
- types: RemoveBooleanFromPropertiesOnEach<DeepRequired<RemoveBooleanFromProperties<DeepRequired<NxJsonConfiguration['release']['conventionalCommits']['types']>, string>>, 'changelog'>;
42
+ types: RemoveBooleanFromPropertiesOnEach<DeepRequired<RemoveBooleanFromProperties<DeepRequired<NxReleaseConfiguration['conventionalCommits']['types']>, string>>, 'changelog'>;
42
43
  };
43
44
  }>, 'projects'>;
44
45
  export interface CreateNxReleaseConfigError {
45
- 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_GENERATOR_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';
46
+ 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';
46
47
  data: Record<string, string | string[]>;
47
48
  }
48
49
  export declare function createNxReleaseConfig(projectGraph: ProjectGraph, projectFileMap: ProjectFileMap, userConfig?: NxJsonConfiguration['release']): Promise<{
49
50
  error: null | CreateNxReleaseConfigError;
50
51
  nxReleaseConfig: NxReleaseConfig | null;
51
52
  }>;
52
- export declare function handleNxReleaseConfigError(error: CreateNxReleaseConfigError): Promise<never>;
53
+ export declare function handleNxReleaseConfigError(error: CreateNxReleaseConfigError, useLegacyVersioning: boolean): Promise<never>;
53
54
  export declare const defaultCreateReleaseProvider: any;
54
55
  export {};
@@ -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: 'CONVENTIONAL_COMMITS_SHORTHAND_MIXED_WITH_OVERLAPPING_GENERATOR_OPTIONS',
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,24 @@ 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?.preserveLocalDependencyProtocols ?? true,
155
+ logUnchangedProjects: userConfig.version?.logUnchangedProjects ?? true,
156
+ updateDependents: userConfig.version?.updateDependents ?? 'auto',
157
+ }),
141
158
  },
142
159
  changelog: {
143
160
  git: changelogGitDefaults,
@@ -177,6 +194,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
177
194
  (workspaceProjectsRelationship === 'independent'
178
195
  ? defaultIndependentReleaseTagPattern
179
196
  : defaultFixedReleaseTagPattern),
197
+ releaseTagPatternCheckAllBranchesWhen: userConfig.releaseTagPatternCheckAllBranchesWhen ?? undefined,
180
198
  conventionalCommits: conventional_commits_1.DEFAULT_CONVENTIONAL_COMMITS_CONFIG,
181
199
  versionPlans: (userConfig.versionPlans ||
182
200
  false),
@@ -184,12 +202,19 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
184
202
  const groupProjectsRelationship = userConfig.projectsRelationship || WORKSPACE_DEFAULTS.projectsRelationship;
185
203
  const GROUP_DEFAULTS = {
186
204
  projectsRelationship: groupProjectsRelationship,
187
- version: {
188
- conventionalCommits: false,
189
- generator: '@nx/js:release-version',
190
- generatorOptions: {},
191
- groupPreVersionCommand: '',
192
- },
205
+ version: USE_LEGACY_VERSIONING
206
+ ? {
207
+ conventionalCommits: false,
208
+ generator: '@nx/js:release-version',
209
+ generatorOptions: {},
210
+ groupPreVersionCommand: '',
211
+ }
212
+ : {
213
+ conventionalCommits: false,
214
+ versionActions: exports.DEFAULT_VERSION_ACTIONS_PATH,
215
+ versionActionsOptions: {},
216
+ groupPreVersionCommand: '',
217
+ },
193
218
  changelog: {
194
219
  createRelease: false,
195
220
  entryWhenNoChanges: 'This was a version bump only for {projectName} to align it with other projects, there were no code changes.',
@@ -207,6 +232,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
207
232
  groupProjectsRelationship === 'independent'
208
233
  ? defaultIndependentReleaseTagPattern
209
234
  : WORKSPACE_DEFAULTS.releaseTagPattern,
235
+ releaseTagPatternCheckAllBranchesWhen: userConfig.releaseTagPatternCheckAllBranchesWhen ?? undefined,
210
236
  versionPlans: false,
211
237
  };
212
238
  /**
@@ -217,7 +243,9 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
217
243
  const rootVersionConfig = deepMergeDefaults([
218
244
  WORKSPACE_DEFAULTS.version,
219
245
  // Merge in the git defaults from the top level
220
- { git: versionGitDefaults },
246
+ {
247
+ git: versionGitDefaults,
248
+ },
221
249
  {
222
250
  git: userConfig.git,
223
251
  },
@@ -240,33 +268,50 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
240
268
  WORKSPACE_DEFAULTS.versionPlans);
241
269
  const rootConventionalCommitsConfig = deepMergeDefaults([WORKSPACE_DEFAULTS.conventionalCommits], fillUnspecifiedConventionalCommitsProperties(normalizeConventionalCommitsConfig(userConfig.conventionalCommits)));
242
270
  // these options are not supported at the group level, only the root/command level
243
- const rootVersionWithoutGlobalOptions = {
271
+ let rootVersionWithoutGlobalOptions = {
244
272
  ...rootVersionConfig,
245
273
  };
246
274
  delete rootVersionWithoutGlobalOptions.git;
247
275
  delete rootVersionWithoutGlobalOptions.preVersionCommand;
248
276
  // Apply conventionalCommits shorthand to the final group defaults if explicitly configured in the original user config
249
277
  if (userConfig.version?.conventionalCommits === true) {
250
- rootVersionWithoutGlobalOptions.generatorOptions = {
251
- ...rootVersionWithoutGlobalOptions.generatorOptions,
252
- currentVersionResolver: 'git-tag',
253
- specifierSource: 'conventional-commits',
254
- };
278
+ if (USE_LEGACY_VERSIONING) {
279
+ rootVersionWithoutGlobalOptions.generatorOptions = {
280
+ ...rootVersionWithoutGlobalOptions.generatorOptions,
281
+ currentVersionResolver: 'git-tag',
282
+ specifierSource: 'conventional-commits',
283
+ };
284
+ }
285
+ else {
286
+ rootVersionWithoutGlobalOptions.currentVersionResolver = 'git-tag';
287
+ rootVersionWithoutGlobalOptions.specifierSource = 'conventional-commits';
288
+ }
255
289
  }
256
290
  if (userConfig.version?.conventionalCommits === false) {
257
291
  delete rootVersionWithoutGlobalOptions.generatorOptions
258
292
  .currentVersionResolver;
259
293
  delete rootVersionWithoutGlobalOptions.generatorOptions.specifierSource;
294
+ delete rootVersionWithoutGlobalOptions
295
+ .currentVersionResolver;
296
+ delete rootVersionWithoutGlobalOptions
297
+ .specifierSource;
260
298
  }
261
299
  // Apply versionPlans shorthand to the final group defaults if explicitly configured in the original user config
262
300
  if (userConfig.versionPlans) {
263
- rootVersionWithoutGlobalOptions.generatorOptions = {
264
- ...rootVersionWithoutGlobalOptions.generatorOptions,
265
- specifierSource: 'version-plans',
266
- };
301
+ if (USE_LEGACY_VERSIONING) {
302
+ rootVersionWithoutGlobalOptions.generatorOptions = {
303
+ ...rootVersionWithoutGlobalOptions.generatorOptions,
304
+ specifierSource: 'version-plans',
305
+ };
306
+ }
307
+ else {
308
+ rootVersionWithoutGlobalOptions.specifierSource = 'version-plans';
309
+ }
267
310
  }
268
311
  if (userConfig.versionPlans === false) {
269
312
  delete rootVersionWithoutGlobalOptions.generatorOptions.specifierSource;
313
+ delete rootVersionWithoutGlobalOptions
314
+ .specifierSource;
270
315
  }
271
316
  const groups = userConfig.groups && Object.keys(userConfig.groups).length
272
317
  ? ensureProjectsConfigIsArray(userConfig.groups)
@@ -365,6 +410,9 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
365
410
  (projectsRelationship === 'independent'
366
411
  ? defaultIndependentReleaseTagPattern
367
412
  : userConfig.releaseTagPattern || defaultFixedReleaseTagPattern),
413
+ releaseTagPatternCheckAllBranchesWhen: releaseGroup.releaseTagPatternCheckAllBranchesWhen ??
414
+ userConfig.releaseTagPatternCheckAllBranchesWhen ??
415
+ undefined,
368
416
  versionPlans: releaseGroup.versionPlans ?? rootVersionPlansConfig,
369
417
  };
370
418
  const finalReleaseGroup = deepMergeDefaults([groupDefaults], {
@@ -372,32 +420,51 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
372
420
  // Ensure that the resolved project names take priority over the original user config (which could have contained unresolved globs etc)
373
421
  projects: matchingProjects,
374
422
  });
423
+ finalReleaseGroup.version =
424
+ finalReleaseGroup.version;
375
425
  // Apply conventionalCommits shorthand to the final group if explicitly configured in the original group
376
426
  if (releaseGroup.version?.conventionalCommits === true) {
377
- finalReleaseGroup.version.generatorOptions = {
378
- ...finalReleaseGroup.version.generatorOptions,
379
- currentVersionResolver: 'git-tag',
380
- specifierSource: 'conventional-commits',
381
- };
427
+ if (USE_LEGACY_VERSIONING) {
428
+ finalReleaseGroup.version.generatorOptions = {
429
+ ...finalReleaseGroup.version.generatorOptions,
430
+ currentVersionResolver: 'git-tag',
431
+ specifierSource: 'conventional-commits',
432
+ };
433
+ }
434
+ else {
435
+ finalReleaseGroup.version.currentVersionResolver = 'git-tag';
436
+ finalReleaseGroup.version.specifierSource = 'conventional-commits';
437
+ }
382
438
  }
383
439
  if (releaseGroup.version?.conventionalCommits === false &&
384
440
  releaseGroupName !== exports.IMPLICIT_DEFAULT_RELEASE_GROUP) {
385
441
  delete finalReleaseGroup.version.generatorOptions.currentVersionResolver;
386
442
  delete finalReleaseGroup.version.generatorOptions.specifierSource;
443
+ delete finalReleaseGroup.version
444
+ .currentVersionResolver;
445
+ delete finalReleaseGroup.version
446
+ .specifierSource;
387
447
  }
388
448
  // Apply versionPlans shorthand to the final group if explicitly configured in the original group
389
449
  if (releaseGroup.versionPlans) {
390
- finalReleaseGroup.version = {
391
- ...finalReleaseGroup.version,
392
- generatorOptions: {
393
- ...finalReleaseGroup.version?.generatorOptions,
394
- specifierSource: 'version-plans',
395
- },
396
- };
450
+ if (USE_LEGACY_VERSIONING) {
451
+ finalReleaseGroup.version = {
452
+ ...finalReleaseGroup.version,
453
+ generatorOptions: {
454
+ ...finalReleaseGroup.version?.generatorOptions,
455
+ specifierSource: 'version-plans',
456
+ },
457
+ };
458
+ }
459
+ else {
460
+ finalReleaseGroup.version.specifierSource = 'version-plans';
461
+ }
397
462
  }
398
463
  if (releaseGroup.versionPlans === false &&
399
464
  releaseGroupName !== exports.IMPLICIT_DEFAULT_RELEASE_GROUP) {
400
465
  delete finalReleaseGroup.version.generatorOptions.specifierSource;
466
+ delete finalReleaseGroup.version
467
+ .specifierSource;
401
468
  }
402
469
  releaseGroups[releaseGroupName] = finalReleaseGroup;
403
470
  }
@@ -413,6 +480,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
413
480
  nxReleaseConfig: {
414
481
  projectsRelationship: WORKSPACE_DEFAULTS.projectsRelationship,
415
482
  releaseTagPattern: WORKSPACE_DEFAULTS.releaseTagPattern,
483
+ releaseTagPatternCheckAllBranchesWhen: WORKSPACE_DEFAULTS.releaseTagPatternCheckAllBranchesWhen,
416
484
  git: rootGitConfig,
417
485
  version: rootVersionConfig,
418
486
  changelog: rootChangelogConfig,
@@ -511,7 +579,7 @@ function fillUnspecifiedConventionalCommitsProperties(config) {
511
579
  types,
512
580
  };
513
581
  }
514
- async function handleNxReleaseConfigError(error) {
582
+ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
515
583
  switch (error.code) {
516
584
  case 'PROJECTS_AND_GROUPS_DEFINED':
517
585
  {
@@ -563,13 +631,16 @@ async function handleNxReleaseConfigError(error) {
563
631
  });
564
632
  }
565
633
  break;
566
- case 'CONVENTIONAL_COMMITS_SHORTHAND_MIXED_WITH_OVERLAPPING_GENERATOR_OPTIONS':
634
+ case 'CONVENTIONAL_COMMITS_SHORTHAND_MIXED_WITH_OVERLAPPING_OPTIONS':
567
635
  {
568
636
  const nxJsonMessage = await (0, resolve_nx_json_error_message_1.resolveNxJsonConfigErrorMessage)([
569
637
  'release',
570
638
  ]);
639
+ const text = useLegacyVersioning
640
+ ? '"version.generatorOptions"'
641
+ : 'configuration options';
571
642
  output_1.output.error({
572
- title: `You have configured both the shorthand "version.conventionalCommits" and one or more of the related "version.generatorOptions" that it sets for you. Please use one or the other:`,
643
+ 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
644
  bodyLines: [nxJsonMessage],
574
645
  });
575
646
  }
@@ -592,6 +663,7 @@ async function handleNxReleaseConfigError(error) {
592
663
  title: `There was an error when resolving the configured changelog renderer at path: ${error.data.workspaceRelativePath}`,
593
664
  bodyLines: [nxJsonMessage],
594
665
  });
666
+ break;
595
667
  }
596
668
  case 'INVALID_CHANGELOG_CREATE_RELEASE_PROVIDER':
597
669
  {
@@ -716,21 +788,36 @@ function deepMergeDefaults(defaultConfigs, userConfig) {
716
788
  }
717
789
  /**
718
790
  * We want to prevent users from setting both the conventionalCommits shorthand and any of the related
719
- * generatorOptions at the same time, since it is at best redundant, and at worst invalid.
791
+ * configuration options at the same time, since it is at best redundant, and at worst invalid.
720
792
  */
721
793
  function hasInvalidConventionalCommitsConfig(userConfig) {
722
794
  // at the root
723
795
  if (userConfig.version?.conventionalCommits === true &&
724
- (userConfig.version?.generatorOptions?.currentVersionResolver ||
725
- userConfig.version?.generatorOptions?.specifierSource)) {
796
+ // v2 config - directly on version config
797
+ (userConfig.version
798
+ ?.currentVersionResolver ||
799
+ userConfig.version
800
+ ?.specifierSource ||
801
+ // Legacy config - on generatorOptions
802
+ userConfig.version
803
+ ?.generatorOptions?.currentVersionResolver ||
804
+ userConfig.version
805
+ ?.generatorOptions?.specifierSource)) {
726
806
  return true;
727
807
  }
728
808
  // within any groups
729
809
  if (userConfig.groups) {
730
810
  for (const group of Object.values(userConfig.groups)) {
731
811
  if (group.version?.conventionalCommits === true &&
732
- (group.version?.generatorOptions?.currentVersionResolver ||
733
- group.version?.generatorOptions?.specifierSource)) {
812
+ // v2 config - directly on version config
813
+ (group.version
814
+ ?.currentVersionResolver ||
815
+ group.version?.specifierSource ||
816
+ // Legacy config - on generatorOptions
817
+ group.version
818
+ ?.generatorOptions?.currentVersionResolver ||
819
+ group.version
820
+ ?.generatorOptions?.specifierSource)) {
734
821
  return true;
735
822
  }
736
823
  }
@@ -0,0 +1,2 @@
1
+ import type { NxJsonConfiguration } from '../../../config/nx-json';
2
+ export declare function shouldUseLegacyVersioning(releaseConfig: NxJsonConfiguration['release'] | undefined): boolean;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.shouldUseLegacyVersioning = shouldUseLegacyVersioning;
4
+ function shouldUseLegacyVersioning(releaseConfig) {
5
+ return process.env.NX_INTERNAL_USE_LEGACY_VERSIONING === 'false'
6
+ ? false
7
+ : // TODO(v21): switch this to false by default in Nx v21 and remove this function in v22
8
+ releaseConfig?.version?.useLegacyVersioning ?? true;
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
- return await (0, config_1.handleNxReleaseConfigError)(configError);
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
- // TODO: Add docs link here once it is available
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
- return await (0, config_1.handleNxReleaseConfigError)(configError);
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 (e) {
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
- return await (0, config_1.handleNxReleaseConfigError)(configError);
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
- return await (0, config_1.handleNxReleaseConfigError)(configError);
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 (e) {
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?.generator ||
13
+ const generator = project.data.release?.version
14
+ ?.generator ||
14
15
  releaseGroup.version.generator;
15
16
  const generatorOptions = {
16
- ...releaseGroup.version.generatorOptions,
17
- ...project.data.release?.version?.generatorOptions,
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) {