nx 20.7.2 → 20.8.0-beta.1

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 (67) hide show
  1. package/.eslintrc.json +3 -1
  2. package/package.json +11 -11
  3. package/release/index.d.ts +1 -1
  4. package/release/index.js +2 -1
  5. package/schemas/nx-schema.json +133 -33
  6. package/src/command-line/release/changelog.js +15 -10
  7. package/src/command-line/release/command-object.d.ts +1 -0
  8. package/src/command-line/release/command-object.js +4 -0
  9. package/src/command-line/release/config/config.d.ts +8 -7
  10. package/src/command-line/release/config/config.js +122 -42
  11. package/src/command-line/release/config/use-legacy-versioning.d.ts +2 -0
  12. package/src/command-line/release/config/use-legacy-versioning.js +9 -0
  13. package/src/command-line/release/index.d.ts +4 -0
  14. package/src/command-line/release/index.js +6 -1
  15. package/src/command-line/release/plan-check.js +6 -3
  16. package/src/command-line/release/plan.js +7 -3
  17. package/src/command-line/release/publish.js +5 -3
  18. package/src/command-line/release/release.js +8 -3
  19. package/src/command-line/release/utils/batch-projects-by-generator-config.js +6 -3
  20. package/src/command-line/release/utils/git.d.ts +2 -1
  21. package/src/command-line/release/utils/git.js +10 -2
  22. package/src/command-line/release/utils/github.js +3 -1
  23. package/src/command-line/release/utils/resolve-semver-specifier.d.ts +2 -1
  24. package/src/command-line/release/utils/resolve-semver-specifier.js +2 -1
  25. package/src/command-line/release/utils/semver.d.ts +8 -0
  26. package/src/command-line/release/utils/semver.js +8 -0
  27. package/src/command-line/release/utils/shared-legacy.d.ts +25 -0
  28. package/src/command-line/release/utils/shared-legacy.js +2 -0
  29. package/src/command-line/release/utils/shared.d.ts +11 -17
  30. package/src/command-line/release/version/derive-specifier-from-conventional-commits.d.ts +7 -0
  31. package/src/command-line/release/version/derive-specifier-from-conventional-commits.js +47 -0
  32. package/src/command-line/release/version/deriver-specifier-from-version-plans.d.ts +8 -0
  33. package/src/command-line/release/version/deriver-specifier-from-version-plans.js +59 -0
  34. package/src/command-line/release/version/project-logger.d.ts +8 -0
  35. package/src/command-line/release/version/project-logger.js +45 -0
  36. package/src/command-line/release/version/release-group-processor.d.ts +251 -0
  37. package/src/command-line/release/version/release-group-processor.js +1040 -0
  38. package/src/command-line/release/version/resolve-current-version.d.ts +32 -0
  39. package/src/command-line/release/version/resolve-current-version.js +241 -0
  40. package/src/command-line/release/version/test-utils.d.ts +95 -0
  41. package/src/command-line/release/version/test-utils.js +416 -0
  42. package/src/command-line/release/version/topological-sort.d.ts +9 -0
  43. package/src/command-line/release/version/topological-sort.js +41 -0
  44. package/src/command-line/release/version/version-actions.d.ts +170 -0
  45. package/src/command-line/release/version/version-actions.js +183 -0
  46. package/src/command-line/release/version-legacy.d.ts +46 -0
  47. package/src/command-line/release/version-legacy.js +453 -0
  48. package/src/command-line/release/version.d.ts +0 -40
  49. package/src/command-line/release/version.js +80 -262
  50. package/src/config/nx-json.d.ts +110 -12
  51. package/src/config/workspace-json-project-json.d.ts +2 -2
  52. package/src/core/graph/main.js +1 -1
  53. package/src/core/graph/styles.css +1 -1
  54. package/src/native/index.d.ts +6 -0
  55. package/src/native/native-bindings.js +1 -0
  56. package/src/native/nx.wasi-browser.js +7 -7
  57. package/src/native/nx.wasm32-wasi.wasm +0 -0
  58. package/src/plugins/js/lock-file/utils/package-json.d.ts +1 -1
  59. package/src/plugins/js/lock-file/utils/package-json.js +2 -1
  60. package/src/plugins/js/lock-file/yarn-parser.js +75 -29
  61. package/src/plugins/js/project-graph/build-dependencies/target-project-locator.d.ts +10 -1
  62. package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +59 -6
  63. package/src/project-graph/error-types.js +28 -1
  64. package/src/project-graph/utils/project-configuration-utils.js +14 -2
  65. package/src/tasks-runner/cache.d.ts +1 -0
  66. package/src/tasks-runner/cache.js +11 -0
  67. package/src/utils/handle-errors.js +15 -0
package/.eslintrc.json CHANGED
@@ -134,7 +134,9 @@
134
134
  "@nx/key",
135
135
  // Powerpack plugin conditionally available dynamically at runtime
136
136
  "@nx/powerpack-conformance",
137
- "@nx/conformance"
137
+ "@nx/conformance",
138
+ // Only used in test-utils at the time of writing
139
+ "@ltd/j-toml"
138
140
  ]
139
141
  }
140
142
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "20.7.2",
3
+ "version": "20.8.0-beta.1",
4
4
  "private": false,
5
5
  "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
6
6
  "repository": {
@@ -82,16 +82,16 @@
82
82
  }
83
83
  },
84
84
  "optionalDependencies": {
85
- "@nx/nx-darwin-arm64": "20.7.2",
86
- "@nx/nx-darwin-x64": "20.7.2",
87
- "@nx/nx-freebsd-x64": "20.7.2",
88
- "@nx/nx-linux-arm-gnueabihf": "20.7.2",
89
- "@nx/nx-linux-arm64-gnu": "20.7.2",
90
- "@nx/nx-linux-arm64-musl": "20.7.2",
91
- "@nx/nx-linux-x64-gnu": "20.7.2",
92
- "@nx/nx-linux-x64-musl": "20.7.2",
93
- "@nx/nx-win32-arm64-msvc": "20.7.2",
94
- "@nx/nx-win32-x64-msvc": "20.7.2"
85
+ "@nx/nx-darwin-arm64": "20.8.0-beta.1",
86
+ "@nx/nx-darwin-x64": "20.8.0-beta.1",
87
+ "@nx/nx-freebsd-x64": "20.8.0-beta.1",
88
+ "@nx/nx-linux-arm-gnueabihf": "20.8.0-beta.1",
89
+ "@nx/nx-linux-arm64-gnu": "20.8.0-beta.1",
90
+ "@nx/nx-linux-arm64-musl": "20.8.0-beta.1",
91
+ "@nx/nx-linux-x64-gnu": "20.8.0-beta.1",
92
+ "@nx/nx-linux-x64-musl": "20.8.0-beta.1",
93
+ "@nx/nx-win32-arm64-msvc": "20.8.0-beta.1",
94
+ "@nx/nx-win32-x64-msvc": "20.8.0-beta.1"
95
95
  },
96
96
  "nx-migrations": {
97
97
  "migrations": "./migrations.json",
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * @public Programmatic API for nx release
3
3
  */
4
- export { ReleaseClient, release, releaseChangelog, releasePublish, releaseVersion, } from '../src/command-line/release';
4
+ export { ReleaseClient, release, releaseChangelog, releasePublish, releaseVersion, VersionActions, AfterAllProjectsVersioned, } from '../src/command-line/release';
package/release/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.releaseVersion = exports.releasePublish = exports.releaseChangelog = exports.release = exports.ReleaseClient = void 0;
3
+ exports.VersionActions = exports.releaseVersion = exports.releasePublish = exports.releaseChangelog = exports.release = exports.ReleaseClient = void 0;
4
4
  /**
5
5
  * @public Programmatic API for nx release
6
6
  */
@@ -10,3 +10,4 @@ Object.defineProperty(exports, "release", { enumerable: true, get: function () {
10
10
  Object.defineProperty(exports, "releaseChangelog", { enumerable: true, get: function () { return release_1.releaseChangelog; } });
11
11
  Object.defineProperty(exports, "releasePublish", { enumerable: true, get: function () { return release_1.releasePublish; } });
12
12
  Object.defineProperty(exports, "releaseVersion", { enumerable: true, get: function () { return release_1.releaseVersion; } });
13
+ Object.defineProperty(exports, "VersionActions", { enumerable: true, get: function () { return release_1.VersionActions; } });
@@ -684,50 +684,150 @@
684
684
  },
685
685
  "NxReleaseVersionConfiguration": {
686
686
  "type": "object",
687
- "properties": {
688
- "conventionalCommits": {
689
- "type": "boolean",
690
- "description": "Shorthand for enabling the current version of projects to be resolved from git tags, and the next version to be determined by analyzing commit messages according to the Conventional Commits specification.",
691
- "default": false
692
- },
693
- "generator": {
694
- "type": "string"
695
- },
696
- "generatorOptions": {
697
- "type": "object",
698
- "additionalProperties": true
699
- },
700
- "git": {
701
- "$ref": "#/definitions/NxReleaseGitConfiguration"
702
- },
703
- "preVersionCommand": {
704
- "type": "string",
705
- "description": "A command to run after validation of nx release configuration, but before versioning begins. Useful for preparing build artifacts. If --dry-run is passed, the command is still executed, but with the NX_DRY_RUN environment variable set to 'true'."
687
+ "$comment": "The configuration for versioning is dynamic depending on the value of the useLegacyVersioning property. Through trial and error the best in editor DX seems to come from having the if/else at the top level and explicitly include all possible properties and apply additionalProperties false in each case.",
688
+ "description": "Configuration for the versioning phase of releases.",
689
+ "if": {
690
+ "$comment": "When using the latest versioning implementation a lot of configuration has been able to move directly onto the version property.",
691
+ "properties": {
692
+ "useLegacyVersioning": {
693
+ "const": true
694
+ }
706
695
  }
707
696
  },
708
- "additionalProperties": false
697
+ "then": {
698
+ "properties": {
699
+ "useLegacyVersioning": {
700
+ "type": "boolean",
701
+ "description": "Whether to use the legacy versioning strategy. This value will be true in Nx v20 and false in Nx v21. The legacy versioning implementation will be removed in Nx v22, as will this flag.",
702
+ "default": true
703
+ },
704
+ "conventionalCommits": {
705
+ "type": "boolean",
706
+ "description": "Shorthand for enabling the current version of projects to be resolved from git tags, and the next version to be determined by analyzing commit messages according to the Conventional Commits specification.",
707
+ "default": false
708
+ },
709
+ "git": {
710
+ "$ref": "#/definitions/NxReleaseGitConfiguration"
711
+ },
712
+ "preVersionCommand": {
713
+ "type": "string",
714
+ "description": "A command to run after validation of nx release configuration, but before versioning begins. Useful for preparing build artifacts. If --dry-run is passed, the command is still executed, but with the NX_DRY_RUN environment variable set to 'true'."
715
+ },
716
+ "generator": {
717
+ "type": "string",
718
+ "description": "The generator implementation to use for versioning.",
719
+ "default": "@nx/js:release-version"
720
+ },
721
+ "generatorOptions": {
722
+ "type": "object",
723
+ "description": "These options will be passed to the configured \"release.version.generator\" (which will be \"@nx/js:release-version\" if not set explicitly).",
724
+ "additionalProperties": true
725
+ }
726
+ },
727
+ "additionalProperties": false
728
+ },
729
+ "else": {
730
+ "additionalProperties": false,
731
+ "properties": {
732
+ "useLegacyVersioning": {
733
+ "type": "boolean",
734
+ "description": "Whether to use the legacy versioning strategy. This value will be true in Nx v20 and false in Nx v21. The legacy versioning implementation will be removed in Nx v22, as will this flag.",
735
+ "default": true
736
+ },
737
+ "conventionalCommits": {
738
+ "type": "boolean",
739
+ "description": "Shorthand for enabling the current version of projects to be resolved from git tags, and the next version to be determined by analyzing commit messages according to the Conventional Commits specification.",
740
+ "default": false
741
+ },
742
+ "git": {
743
+ "$ref": "#/definitions/NxReleaseGitConfiguration"
744
+ },
745
+ "preVersionCommand": {
746
+ "type": "string",
747
+ "description": "A command to run after validation of nx release configuration, but before versioning begins. Useful for preparing build artifacts. If --dry-run is passed, the command is still executed, but with the NX_DRY_RUN environment variable set to 'true'."
748
+ },
749
+ "specifierSource": {
750
+ "type": "string",
751
+ "enum": ["prompt", "conventional-commits", "version-plans"],
752
+ "default": "prompt",
753
+ "description": "The source to use for determining the specifier to use when versioning. 'prompt' is the default and will interactively prompt the user for an explicit/imperative specifier. 'conventional-commits' will attempt determine a specifier from commit messages conforming to the Conventional Commits specification. 'version-plans' will determine the specifier from the version plan files available on disk."
754
+ },
755
+ "manifestRootsToUpdate": {
756
+ "type": "array",
757
+ "items": {
758
+ "type": "string"
759
+ },
760
+ "description": "A list of directories containing manifest files (such as package.json) to apply updates to when versioning. By default, only the project root will be used, but you could customize this to only version a manifest in a dist directory, or even version multiple manifests in different directories, such as both source and dist."
761
+ },
762
+ "currentVersionResolver": {
763
+ "type": "string",
764
+ "enum": ["registry", "disk", "git-tag", "none"],
765
+ "description": "The resolver to use for determining the current version of a project during versioning. This is needed for versioning approaches which involve relatively modifying a current version to arrive at a new version, such as semver bumps like 'patch', 'minor' etc. Using 'none' explicitly declares that the current version is not needed to compute the new version, and should only be used with appropriate version actions implementations that support it."
766
+ },
767
+ "currentVersionResolverMetadata": {
768
+ "type": "object",
769
+ "additionalProperties": true,
770
+ "description": "Metadata to provide to the configured currentVersionResolver to help it in determining the current version. What to pass here is specific to each resolver."
771
+ },
772
+ "fallbackCurrentVersionResolver": {
773
+ "type": "string",
774
+ "enum": ["disk"],
775
+ "description": "The fallback version resolver to use when the configured currentVersionResolver fails to resolve the current version."
776
+ },
777
+ "firstRelease": {
778
+ "type": "boolean",
779
+ "description": "Whether or not this is the first release of one of more projects. This removes certain validation checks that are not possible to enforce if the project has never been released before."
780
+ },
781
+ "versionPrefix": {
782
+ "type": "string",
783
+ "enum": ["auto", "", "~", "^", "="],
784
+ "default": "auto",
785
+ "description": "The prefix to use when versioning dependencies. This can be one of the following: auto, '', '~', '^', '=', where auto means the existing prefix will be preserved."
786
+ },
787
+ "deleteVersionPlans": {
788
+ "type": "boolean",
789
+ "description": "Whether to delete the processed version plans file after versioning is complete. This is false by default because the version plans are also needed for changelog generation.",
790
+ "default": false
791
+ },
792
+ "updateDependents": {
793
+ "type": "string",
794
+ "enum": ["never", "auto"],
795
+ "default": "auto",
796
+ "description": "When versioning independent projects, this controls whether to update their dependents (i.e. the things that depend on them). 'never' means no dependents will be updated (unless they happen to be versioned directly as well). 'auto' is the default and will cause dependents to be updated (a patch version bump) when a dependency is versioned."
797
+ },
798
+ "logUnchangedProjects": {
799
+ "type": "boolean",
800
+ "description": "Whether to log projects that have not changed during versioning.",
801
+ "default": true
802
+ },
803
+ "preserveLocalDependencyProtocols": {
804
+ "type": "boolean",
805
+ "description": "Whether to preserve local dependency protocols (e.g. file references, or the `workspace:` protocol in package.json files) of local dependencies when updating them during versioning. This was false by default in legacy versioning, but is true by default now.",
806
+ "default": true
807
+ },
808
+ "versionActions": {
809
+ "type": "string",
810
+ "description": "The path to the version actions implementation to use for releasing all projects by default. This can also be overridden on the release group and project levels.",
811
+ "default": "@nx/js/src/release"
812
+ },
813
+ "versionActionsOptions": {
814
+ "type": "object",
815
+ "description": "The specific options that are defined by each version actions implementation. They will be passed to the version actions implementation when running a release.",
816
+ "additionalProperties": true
817
+ }
818
+ }
819
+ }
709
820
  },
710
821
  "NxReleaseGroupVersionConfiguration": {
711
822
  "type": "object",
823
+ "$comment": "We need to improve this configuration definition to be more precise once legacy versioning is removed. Right now it needs to be left open and runtime validation will ensure correct behavior.",
712
824
  "properties": {
713
- "conventionalCommits": {
714
- "type": "boolean",
715
- "description": "Shorthand for enabling the current version of projects to be resolved from git tags, and the next version to be determined by analyzing commit messages according to the Conventional Commits specification.",
716
- "default": false
717
- },
718
- "generator": {
719
- "type": "string"
720
- },
721
- "generatorOptions": {
722
- "type": "object",
723
- "additionalProperties": true
724
- },
725
825
  "groupPreVersionCommand": {
726
826
  "type": "string",
727
827
  "description": "A command to run after validation of nx release configuration AND after the release.version.preVersionCommand (if any), but before versioning begins for this specific group. Useful for preparing build artifacts for the group. If --dry-run is passed, the command is still executed, but with the NX_DRY_RUN environment variable set to 'true'."
728
828
  }
729
829
  },
730
- "additionalProperties": false
830
+ "additionalProperties": true
731
831
  },
732
832
  "NxReleaseChangelogConfiguration": {
733
833
  "type": "object",
@@ -13,14 +13,15 @@ const tree_1 = require("../../generators/tree");
13
13
  const file_map_utils_1 = require("../../project-graph/file-map-utils");
14
14
  const project_graph_1 = require("../../project-graph/project-graph");
15
15
  const utils_1 = require("../../tasks-runner/utils");
16
+ const handle_errors_1 = require("../../utils/handle-errors");
16
17
  const is_ci_1 = require("../../utils/is-ci");
17
18
  const output_1 = require("../../utils/output");
18
- const handle_errors_1 = require("../../utils/handle-errors");
19
19
  const path_1 = require("../../utils/path");
20
20
  const workspace_root_1 = require("../../utils/workspace-root");
21
21
  const config_1 = require("./config/config");
22
22
  const deep_merge_json_1 = require("./config/deep-merge-json");
23
23
  const filter_release_groups_1 = require("./config/filter-release-groups");
24
+ const use_legacy_versioning_1 = require("./config/use-legacy-versioning");
24
25
  const version_plans_1 = require("./config/version-plans");
25
26
  const git_1 = require("./utils/git");
26
27
  const github_1 = require("./utils/github");
@@ -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) {
@@ -137,7 +139,7 @@ function createAPI(overrideReleaseConfig) {
137
139
  (0, shared_1.handleDuplicateGitTags)(gitTagValues);
138
140
  const postGitTasks = [];
139
141
  let workspaceChangelogChanges = [];
140
- // TODO: remove this after the changelog renderer is refactored to remove coupling with git commits
142
+ // TODO(v22): remove this after the changelog renderer is refactored to remove coupling with git commits
141
143
  let workspaceChangelogCommits = [];
142
144
  // If there are multiple release groups, we'll just skip the workspace changelog anyway.
143
145
  const versionPlansEnabledForWorkspaceChangelog = releaseGroups[0].resolvedVersionPlans;
@@ -228,7 +230,7 @@ function createAPI(overrideReleaseConfig) {
228
230
  nxReleaseConfig,
229
231
  workspaceChangelogVersion,
230
232
  changes: workspaceChangelogChanges,
231
- // TODO: remove this after the changelog renderer is refactored to remove coupling with git commits
233
+ // TODO(v22): remove this after the changelog renderer is refactored to remove coupling with git commits
232
234
  commits: filterHiddenCommits(workspaceChangelogCommits, nxReleaseConfig.conventionalCommits),
233
235
  });
234
236
  if (workspaceChangelog &&
@@ -259,7 +261,7 @@ function createAPI(overrideReleaseConfig) {
259
261
  .map((dep) => {
260
262
  return {
261
263
  dependencyName: dep.source,
262
- newVersion: projectsVersionData[dep.source].newVersion,
264
+ newVersion: projectsVersionData[dep.source]?.newVersion ?? null,
263
265
  };
264
266
  })
265
267
  .filter((b) => b.newVersion !== null);
@@ -296,7 +298,7 @@ function createAPI(overrideReleaseConfig) {
296
298
  if (releaseGroup.projectsRelationship === 'independent') {
297
299
  for (const project of projectNodes) {
298
300
  let changes = null;
299
- // TODO: remove this after the changelog renderer is refactored to remove coupling with git commits
301
+ // TODO(v22): remove this after the changelog renderer is refactored to remove coupling with git commits
300
302
  let commits;
301
303
  if (releaseGroup.resolvedVersionPlans) {
302
304
  changes = releaseGroup.resolvedVersionPlans
@@ -395,7 +397,7 @@ function createAPI(overrideReleaseConfig) {
395
397
  }
396
398
  else {
397
399
  let changes = [];
398
- // TODO: remove this after the changelog renderer is refactored to remove coupling with git commits
400
+ // TODO(v22): remove this after the changelog renderer is refactored to remove coupling with git commits
399
401
  let commits = [];
400
402
  if (releaseGroup.resolvedVersionPlans) {
401
403
  changes = releaseGroup.resolvedVersionPlans
@@ -642,11 +644,12 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
642
644
  }
643
645
  }
644
646
  if (args.gitPush ?? nxReleaseConfig.changelog.git.push) {
645
- output_1.output.logSingleLine(`Pushing to git remote "${args.gitRemote}"`);
647
+ output_1.output.logSingleLine(`Pushing to git remote "${args.gitRemote ?? 'origin'}"`);
646
648
  await (0, git_1.gitPush)({
647
649
  gitRemote: args.gitRemote,
648
650
  dryRun: args.dryRun,
649
651
  verbose: args.verbose,
652
+ additionalArgs: args.gitPushArgs || nxReleaseConfig.changelog.git.pushArgs,
650
653
  });
651
654
  }
652
655
  // Run any post-git tasks in series
@@ -900,7 +903,7 @@ function filterHiddenChanges(changes, conventionalCommitsConfig) {
900
903
  return !typeConfig.changelog.hidden;
901
904
  });
902
905
  }
903
- // TODO: remove this after the changelog renderer is refactored to remove coupling with git commits
906
+ // TODO(v22): remove this after the changelog renderer is refactored to remove coupling with git commits
904
907
  function filterHiddenCommits(commits, conventionalCommitsConfig) {
905
908
  if (!commits) {
906
909
  return [];
@@ -935,7 +938,9 @@ async function promptForGitHubRelease() {
935
938
  ]);
936
939
  return result.confirmation;
937
940
  }
938
- catch (e) {
941
+ catch {
942
+ // Ensure the cursor is always restored
943
+ process.stdout.write('\u001b[?25h');
939
944
  // Handle the case where the user exits the prompt with ctrl+c
940
945
  return false;
941
946
  }
@@ -19,6 +19,7 @@ interface GitOptions {
19
19
  gitTagMessage?: string;
20
20
  gitTagArgs?: string | string[];
21
21
  gitPush?: boolean;
22
+ gitPushArgs?: string | string[];
22
23
  gitRemote?: string;
23
24
  }
24
25
  export type VersionOptions = NxReleaseArgs & GitOptions & VersionPlanArgs & FirstReleaseArgs & {
@@ -289,6 +289,10 @@ function withGitOptions(yargs) {
289
289
  .option('git-push', {
290
290
  describe: 'Whether or not to automatically push the changes made by this command to the remote git repository.',
291
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',
292
296
  })
293
297
  .option('git-remote', {
294
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 {};