nx 21.0.0-beta.0 → 21.0.0-beta.10
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 +5 -35
- package/package.json +12 -12
- package/release/index.d.ts +1 -1
- package/release/index.js +2 -1
- package/schemas/nx-schema.json +182 -35
- package/schemas/project-schema.json +5 -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 +16 -3
- package/src/command-line/migrate/migrate.js +134 -101
- 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 +0 -1
- 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 +11 -1
- package/src/config/nx-json.d.ts +160 -16
- 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-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-17-0-0/rm-default-collection-npm-scope.d.ts → update-21-0-0/release-version-config-changes.d.ts} +1 -1
- package/src/migrations/update-21-0-0/release-version-config-changes.js +111 -0
- 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/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/nx-deps-cache.js +7 -2
- 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 +3 -7
- 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 +5 -2
- 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 +3 -4
- package/src/tasks-runner/cache.d.ts +20 -6
- package/src/tasks-runner/cache.js +104 -20
- 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 +229 -0
- package/src/tasks-runner/pseudo-terminal.d.ts +10 -7
- package/src/tasks-runner/pseudo-terminal.js +37 -35
- package/src/tasks-runner/run-command.d.ts +4 -1
- package/src/tasks-runner/run-command.js +220 -42
- 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-orchestrator.d.ts +26 -10
- package/src/tasks-runner/task-orchestrator.js +212 -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/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.js +0 -11
- package/src/utils/powerpack.d.ts +0 -5
- package/src/utils/powerpack.js +0 -33
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.commandsObject = exports.parserConfiguration = void 0;
|
4
4
|
const chalk = require("chalk");
|
5
5
|
const yargs = require("yargs");
|
6
|
-
const command_object_1 = require("./
|
6
|
+
const command_object_1 = require("./register/command-object");
|
7
7
|
const command_object_2 = require("./affected/command-object");
|
8
8
|
const command_object_3 = require("./connect/command-object");
|
9
9
|
const command_object_4 = require("./daemon/command-object");
|
@@ -46,7 +46,7 @@ exports.commandsObject = yargs
|
|
46
46
|
.parserConfiguration(exports.parserConfiguration)
|
47
47
|
.usage(chalk.bold('Smart Monorepos · Fast CI'))
|
48
48
|
.demandCommand(1, '')
|
49
|
-
.command(command_object_1.
|
49
|
+
.command(command_object_1.yargsRegisterCommand)
|
50
50
|
.command(command_object_22.yargsAddCommand)
|
51
51
|
.command(command_object_2.yargsAffectedBuildCommand)
|
52
52
|
.command(command_object_2.yargsAffectedCommand)
|
@@ -99,7 +99,7 @@ function createMissingConformanceCommand(command) {
|
|
99
99
|
output_1.output.error({
|
100
100
|
title: `${command} is not available`,
|
101
101
|
bodyLines: [
|
102
|
-
`In order to use the \`nx ${command}\` command you must have an active
|
102
|
+
`In order to use the \`nx ${command}\` command you must have an active Nx key and the \`@nx/conformance\` plugin installed.`,
|
103
103
|
'',
|
104
104
|
'To learn more, visit https://nx.dev/nx-enterprise/powerpack/conformance',
|
105
105
|
],
|
@@ -110,7 +110,14 @@ function createMissingConformanceCommand(command) {
|
|
110
110
|
}
|
111
111
|
function resolveConformanceCommandObject() {
|
112
112
|
try {
|
113
|
-
const { yargsConformanceCommand } =
|
113
|
+
const { yargsConformanceCommand } = (() => {
|
114
|
+
try {
|
115
|
+
return require('@nx/powerpack-conformance');
|
116
|
+
}
|
117
|
+
catch {
|
118
|
+
return require('@nx/conformance');
|
119
|
+
}
|
120
|
+
})();
|
114
121
|
return yargsConformanceCommand;
|
115
122
|
}
|
116
123
|
catch {
|
@@ -119,7 +126,14 @@ function resolveConformanceCommandObject() {
|
|
119
126
|
}
|
120
127
|
function resolveConformanceCheckCommandObject() {
|
121
128
|
try {
|
122
|
-
const { yargsConformanceCheckCommand
|
129
|
+
const { yargsConformanceCheckCommand } = (() => {
|
130
|
+
try {
|
131
|
+
return require('@nx/powerpack-conformance');
|
132
|
+
}
|
133
|
+
catch {
|
134
|
+
return require('@nx/conformance');
|
135
|
+
}
|
136
|
+
})();
|
123
137
|
return yargsConformanceCheckCommand;
|
124
138
|
}
|
125
139
|
catch {
|
@@ -1,25 +1,25 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.yargsRegisterCommand = void 0;
|
4
4
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
5
5
|
const handle_errors_1 = require("../../utils/handle-errors");
|
6
|
-
exports.
|
7
|
-
command: '
|
6
|
+
exports.yargsRegisterCommand = {
|
7
|
+
command: 'register [key]',
|
8
|
+
aliases: ['activate-powerpack'],
|
8
9
|
describe: false,
|
9
|
-
// describe: 'Activate a Nx Powerpack license.',
|
10
10
|
builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
|
11
11
|
.parserConfiguration({
|
12
12
|
'strip-dashed': true,
|
13
13
|
'unknown-options-as-args': true,
|
14
14
|
})
|
15
|
-
.positional('
|
15
|
+
.positional('key', {
|
16
16
|
type: 'string',
|
17
|
-
description: 'This is a
|
17
|
+
description: 'This is a key for Nx.',
|
18
18
|
})
|
19
|
-
.example('$0
|
19
|
+
.example('$0 register <key>', 'Register a Nx key'),
|
20
20
|
handler: async (args) => {
|
21
|
-
const exitCode = await (0, handle_errors_1.handleErrors)(args.verbose, async () => {
|
22
|
-
return (await Promise.resolve().then(() => require('./
|
21
|
+
const exitCode = await (0, handle_errors_1.handleErrors)(args.verbose ?? false, async () => {
|
22
|
+
return (await Promise.resolve().then(() => require('./register'))).handleRegister(args);
|
23
23
|
});
|
24
24
|
process.exit(exitCode);
|
25
25
|
},
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.handleRegister = handleRegister;
|
4
|
+
const workspace_root_1 = require("../../utils/workspace-root");
|
5
|
+
const require_nx_key_1 = require("../../utils/require-nx-key");
|
6
|
+
async function handleRegister(options) {
|
7
|
+
const nxKey = await (0, require_nx_key_1.requireNxKey)();
|
8
|
+
return nxKey.registerNxKey(workspace_root_1.workspaceRoot, options.key);
|
9
|
+
}
|
@@ -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
|
-
|
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;
|
@@ -191,8 +193,7 @@ function createAPI(overrideReleaseConfig) {
|
|
191
193
|
}
|
192
194
|
else {
|
193
195
|
let workspaceChangelogFromRef = args.from ||
|
194
|
-
(await (0, git_1.getLatestGitTagForPattern)(nxReleaseConfig.releaseTagPattern))
|
195
|
-
?.tag;
|
196
|
+
(await (0, git_1.getLatestGitTagForPattern)(nxReleaseConfig.releaseTagPattern, {}, nxReleaseConfig.releaseTagPatternCheckAllBranchesWhen))?.tag;
|
196
197
|
if (!workspaceChangelogFromRef) {
|
197
198
|
if (useAutomaticFromRef) {
|
198
199
|
workspaceChangelogFromRef = await (0, git_1.getFirstGitCommit)();
|
@@ -229,7 +230,7 @@ function createAPI(overrideReleaseConfig) {
|
|
229
230
|
nxReleaseConfig,
|
230
231
|
workspaceChangelogVersion,
|
231
232
|
changes: workspaceChangelogChanges,
|
232
|
-
// 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
|
233
234
|
commits: filterHiddenCommits(workspaceChangelogCommits, nxReleaseConfig.conventionalCommits),
|
234
235
|
});
|
235
236
|
if (workspaceChangelog &&
|
@@ -260,7 +261,7 @@ function createAPI(overrideReleaseConfig) {
|
|
260
261
|
.map((dep) => {
|
261
262
|
return {
|
262
263
|
dependencyName: dep.source,
|
263
|
-
newVersion: projectsVersionData[dep.source]
|
264
|
+
newVersion: projectsVersionData[dep.source]?.newVersion ?? null,
|
264
265
|
};
|
265
266
|
})
|
266
267
|
.filter((b) => b.newVersion !== null);
|
@@ -297,7 +298,7 @@ function createAPI(overrideReleaseConfig) {
|
|
297
298
|
if (releaseGroup.projectsRelationship === 'independent') {
|
298
299
|
for (const project of projectNodes) {
|
299
300
|
let changes = null;
|
300
|
-
// 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
|
301
302
|
let commits;
|
302
303
|
if (releaseGroup.resolvedVersionPlans) {
|
303
304
|
changes = releaseGroup.resolvedVersionPlans
|
@@ -335,7 +336,7 @@ function createAPI(overrideReleaseConfig) {
|
|
335
336
|
(await (0, git_1.getLatestGitTagForPattern)(releaseGroup.releaseTagPattern, {
|
336
337
|
projectName: project.name,
|
337
338
|
releaseGroupName: releaseGroup.name,
|
338
|
-
}))?.tag;
|
339
|
+
}, releaseGroup.releaseTagPatternCheckAllBranchesWhen))?.tag;
|
339
340
|
if (!fromRef && useAutomaticFromRef) {
|
340
341
|
const firstCommit = await (0, git_1.getFirstGitCommit)();
|
341
342
|
const allCommits = await getCommits(firstCommit, toSHA);
|
@@ -396,7 +397,7 @@ function createAPI(overrideReleaseConfig) {
|
|
396
397
|
}
|
397
398
|
else {
|
398
399
|
let changes = [];
|
399
|
-
// 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
|
400
401
|
let commits = [];
|
401
402
|
if (releaseGroup.resolvedVersionPlans) {
|
402
403
|
changes = releaseGroup.resolvedVersionPlans
|
@@ -442,8 +443,7 @@ function createAPI(overrideReleaseConfig) {
|
|
442
443
|
}
|
443
444
|
else {
|
444
445
|
let fromRef = args.from ||
|
445
|
-
(await (0, git_1.getLatestGitTagForPattern)(releaseGroup.releaseTagPattern))
|
446
|
-
?.tag;
|
446
|
+
(await (0, git_1.getLatestGitTagForPattern)(releaseGroup.releaseTagPattern, {}, releaseGroup.releaseTagPatternCheckAllBranchesWhen))?.tag;
|
447
447
|
if (!fromRef) {
|
448
448
|
if (useAutomaticFromRef) {
|
449
449
|
fromRef = await (0, git_1.getFirstGitCommit)();
|
@@ -644,11 +644,12 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
|
|
644
644
|
}
|
645
645
|
}
|
646
646
|
if (args.gitPush ?? nxReleaseConfig.changelog.git.push) {
|
647
|
-
output_1.output.logSingleLine(`Pushing to git remote "${args.gitRemote}"`);
|
647
|
+
output_1.output.logSingleLine(`Pushing to git remote "${args.gitRemote ?? 'origin'}"`);
|
648
648
|
await (0, git_1.gitPush)({
|
649
649
|
gitRemote: args.gitRemote,
|
650
650
|
dryRun: args.dryRun,
|
651
651
|
verbose: args.verbose,
|
652
|
+
additionalArgs: args.gitPushArgs || nxReleaseConfig.changelog.git.pushArgs,
|
652
653
|
});
|
653
654
|
}
|
654
655
|
// Run any post-git tasks in series
|
@@ -902,7 +903,7 @@ function filterHiddenChanges(changes, conventionalCommitsConfig) {
|
|
902
903
|
return !typeConfig.changelog.hidden;
|
903
904
|
});
|
904
905
|
}
|
905
|
-
// 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
|
906
907
|
function filterHiddenCommits(commits, conventionalCommitsConfig) {
|
907
908
|
if (!commits) {
|
908
909
|
return [];
|
@@ -937,7 +938,9 @@ async function promptForGitHubRelease() {
|
|
937
938
|
]);
|
938
939
|
return result.confirmation;
|
939
940
|
}
|
940
|
-
catch
|
941
|
+
catch {
|
942
|
+
// Ensure the cursor is always restored
|
943
|
+
process.stdout.write('\u001b[?25h');
|
941
944
|
// Handle the case where the user exits the prompt with ctrl+c
|
942
945
|
return false;
|
943
946
|
}
|
@@ -19,13 +19,20 @@ 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 & {
|
25
26
|
specifier?: string;
|
26
27
|
preid?: string;
|
27
28
|
stageChanges?: boolean;
|
29
|
+
/**
|
30
|
+
* @deprecated Use versionActionsOptionsOverrides instead.
|
31
|
+
*
|
32
|
+
* Using generatorOptionsOverrides is only valid when release.version.useLegacyVersioning is set to true.
|
33
|
+
*/
|
28
34
|
generatorOptionsOverrides?: Record<string, unknown>;
|
35
|
+
versionActionsOptionsOverrides?: Record<string, unknown>;
|
29
36
|
};
|
30
37
|
export type ChangelogOptions = NxReleaseArgs & GitOptions & VersionPlanArgs & FirstReleaseArgs & {
|
31
38
|
version?: string | null;
|
@@ -58,6 +65,7 @@ export type PlanCheckOptions = BaseNxReleaseArgs & {
|
|
58
65
|
export type ReleaseOptions = NxReleaseArgs & FirstReleaseArgs & {
|
59
66
|
specifier?: string;
|
60
67
|
yes?: boolean;
|
68
|
+
preid?: VersionOptions['preid'];
|
61
69
|
skipPublish?: boolean;
|
62
70
|
};
|
63
71
|
export type VersionPlanArgs = {
|
@@ -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<
|
38
|
-
groups: DeepRequired<RemoveTrueFromPropertiesOnEach<EnsureProjectsArray<
|
39
|
-
changelog: RemoveTrueFromProperties<DeepRequired<
|
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<
|
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' | '
|
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 {};
|