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.
- package/.eslintrc.json +5 -1
- package/package.json +12 -12
- package/release/index.d.ts +1 -1
- package/release/index.js +2 -1
- package/schemas/nx-schema.json +186 -35
- 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 +47 -35
- 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 +4 -1
- package/src/command-line/init/implementation/utils.js +108 -44
- 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 +68 -38
- 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 +2 -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 +129 -42
- 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 +251 -0
- package/src/command-line/release/version/release-group-processor.js +1040 -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 +95 -0
- package/src/command-line/release/version/test-utils.js +416 -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 +170 -0
- package/src/command-line/release/version/version-actions.js +183 -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 +80 -262
- 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/run.js +1 -1
- 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/nx-json.d.ts +153 -15
- 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 +2 -1
- package/src/devkit-internals.js +4 -1
- package/src/executors/run-commands/run-commands.impl.d.ts +3 -5
- package/src/executors/run-commands/run-commands.impl.js +14 -42
- package/src/executors/run-commands/running-tasks.d.ts +7 -5
- package/src/executors/run-commands/running-tasks.js +64 -27
- 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/native/index.d.ts +93 -19
- package/src/native/index.js +16 -2
- package/src/native/native-bindings.js +6 -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 +2 -1
- 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 +3 -1
- 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/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/utils.d.ts +2 -2
- package/src/project-graph/plugins/utils.js +2 -2
- package/src/project-graph/project-graph.js +1 -1
- package/src/project-graph/utils/project-configuration-utils.d.ts +1 -1
- package/src/project-graph/utils/project-configuration-utils.js +25 -11
- 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 +2 -3
- 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 +1 -1
- package/src/tasks-runner/create-task-graph.js +12 -11
- package/src/tasks-runner/default-tasks-runner.js +4 -13
- package/src/tasks-runner/forked-process-task-runner.d.ts +8 -3
- package/src/tasks-runner/forked-process-task-runner.js +56 -46
- package/src/tasks-runner/init-tasks-runner.d.ts +15 -1
- package/src/tasks-runner/init-tasks-runner.js +55 -2
- package/src/tasks-runner/is-tui-enabled.d.ts +2 -0
- package/src/tasks-runner/is-tui-enabled.js +58 -0
- package/src/tasks-runner/life-cycle.d.ts +10 -3
- package/src/tasks-runner/life-cycle.js +23 -2
- package/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +7 -2
- package/src/tasks-runner/life-cycles/task-history-life-cycle.js +6 -1
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.d.ts +17 -0
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +221 -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 +1 -0
- package/src/tasks-runner/run-command.js +180 -23
- 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 +21 -9
- package/src/tasks-runner/task-orchestrator.js +127 -44
- package/src/tasks-runner/utils.d.ts +2 -2
- package/src/tasks-runner/utils.js +15 -11
- 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/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-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/utils/powerpack.d.ts +0 -5
- package/src/utils/powerpack.js +0 -33
@@ -1,36 +1,33 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.releaseVersionCLIHandler = exports.validReleaseVersionPrefixes =
|
3
|
+
exports.releaseVersionCLIHandler = exports.validReleaseVersionPrefixes = void 0;
|
4
4
|
exports.createAPI = createAPI;
|
5
5
|
const chalk = require("chalk");
|
6
6
|
const node_child_process_1 = require("node:child_process");
|
7
7
|
const node_fs_1 = require("node:fs");
|
8
|
-
const node_path_1 = require("node:path");
|
9
8
|
const nx_json_1 = require("../../config/nx-json");
|
9
|
+
const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
|
10
10
|
const tree_1 = require("../../generators/tree");
|
11
11
|
const file_map_utils_1 = require("../../project-graph/file-map-utils");
|
12
12
|
const project_graph_1 = require("../../project-graph/project-graph");
|
13
|
+
const handle_errors_1 = require("../../utils/handle-errors");
|
13
14
|
const output_1 = require("../../utils/output");
|
14
|
-
const params_1 = require("../../utils/params");
|
15
15
|
const path_1 = require("../../utils/path");
|
16
16
|
const workspace_root_1 = require("../../utils/workspace-root");
|
17
|
-
const generate_1 = require("../generate/generate");
|
18
|
-
const generator_utils_1 = require("../generate/generator-utils");
|
19
17
|
const config_1 = require("./config/config");
|
20
18
|
const deep_merge_json_1 = require("./config/deep-merge-json");
|
21
19
|
const filter_release_groups_1 = require("./config/filter-release-groups");
|
22
20
|
const version_plans_1 = require("./config/version-plans");
|
23
|
-
const batch_projects_by_generator_config_1 = require("./utils/batch-projects-by-generator-config");
|
24
21
|
const git_1 = require("./utils/git");
|
25
22
|
const print_changes_1 = require("./utils/print-changes");
|
26
23
|
const print_config_1 = require("./utils/print-config");
|
27
24
|
const resolve_nx_json_error_message_1 = require("./utils/resolve-nx-json-error-message");
|
28
25
|
const shared_1 = require("./utils/shared");
|
29
|
-
const
|
26
|
+
const version_legacy_1 = require("./version-legacy");
|
27
|
+
const release_group_processor_1 = require("./version/release-group-processor");
|
28
|
+
const use_legacy_versioning_1 = require("./config/use-legacy-versioning");
|
30
29
|
const LARGE_BUFFER = 1024 * 1000000;
|
31
30
|
// Reexport some utils for use in plugin release-version generator implementations
|
32
|
-
var semver_1 = require("./utils/semver");
|
33
|
-
Object.defineProperty(exports, "deriveNewSemverVersion", { enumerable: true, get: function () { return semver_1.deriveNewSemverVersion; } });
|
34
31
|
exports.validReleaseVersionPrefixes = ['auto', '', '~', '^', '='];
|
35
32
|
const releaseVersionCLIHandler = (args) => (0, handle_errors_1.handleErrors)(args.verbose, () => createAPI({})(args));
|
36
33
|
exports.releaseVersionCLIHandler = releaseVersionCLIHandler;
|
@@ -42,13 +39,13 @@ function createAPI(overrideReleaseConfig) {
|
|
42
39
|
*/
|
43
40
|
return async function releaseVersion(args) {
|
44
41
|
const projectGraph = await (0, project_graph_1.createProjectGraphAsync)({ exitOnError: true });
|
45
|
-
const { projects } = (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph);
|
46
42
|
const nxJson = (0, nx_json_1.readNxJson)();
|
47
43
|
const userProvidedReleaseConfig = (0, deep_merge_json_1.deepMergeJson)(nxJson.release ?? {}, overrideReleaseConfig ?? {});
|
44
|
+
const USE_LEGACY_VERSIONING = (0, use_legacy_versioning_1.shouldUseLegacyVersioning)(userProvidedReleaseConfig);
|
48
45
|
// Apply default configuration to any optional user configuration
|
49
46
|
const { error: configError, nxReleaseConfig } = await (0, config_1.createNxReleaseConfig)(projectGraph, await (0, file_map_utils_1.createProjectFileMapUsingProjectGraph)(projectGraph), userProvidedReleaseConfig);
|
50
47
|
if (configError) {
|
51
|
-
return await (0, config_1.handleNxReleaseConfigError)(configError);
|
48
|
+
return await (0, config_1.handleNxReleaseConfigError)(configError, USE_LEGACY_VERSIONING);
|
52
49
|
}
|
53
50
|
// --print-config exits directly as it is not designed to be combined with any other programmatic operations
|
54
51
|
if (args.printConfig) {
|
@@ -58,6 +55,10 @@ function createAPI(overrideReleaseConfig) {
|
|
58
55
|
isDebug: args.printConfig === 'debug',
|
59
56
|
});
|
60
57
|
}
|
58
|
+
// TODO(v22): Remove support for the legacy versioning implementation in Nx v22
|
59
|
+
if (USE_LEGACY_VERSIONING) {
|
60
|
+
return await (0, version_legacy_1.releaseVersionLegacy)(projectGraph, args, nxJson, nxReleaseConfig, userProvidedReleaseConfig);
|
61
|
+
}
|
61
62
|
// The nx release top level command will always override these three git args. This is how we can tell
|
62
63
|
// if the top level release command was used or if the user is using the changelog subcommand.
|
63
64
|
// If the user explicitly overrides these args, then it doesn't matter if the top level config is set,
|
@@ -98,169 +99,71 @@ function createAPI(overrideReleaseConfig) {
|
|
98
99
|
// default to not delete version plans after versioning as they may be needed for changelog generation
|
99
100
|
args.deleteVersionPlans = false;
|
100
101
|
}
|
102
|
+
/**
|
103
|
+
* Run any configured top level pre-version command
|
104
|
+
*/
|
101
105
|
runPreVersionCommand(nxReleaseConfig.version.preVersionCommand, {
|
102
106
|
dryRun: args.dryRun,
|
103
107
|
verbose: args.verbose,
|
104
108
|
});
|
109
|
+
/**
|
110
|
+
* Run any configured pre-version command for the selected release groups
|
111
|
+
*/
|
112
|
+
for (const releaseGroup of releaseGroups) {
|
113
|
+
runPreVersionCommand(releaseGroup.version.groupPreVersionCommand, {
|
114
|
+
dryRun: args.dryRun,
|
115
|
+
verbose: args.verbose,
|
116
|
+
}, releaseGroup);
|
117
|
+
}
|
105
118
|
const tree = new tree_1.FsTree(workspace_root_1.workspaceRoot, args.verbose);
|
106
|
-
const versionData = {};
|
107
119
|
const commitMessage = args.gitCommitMessage || nxReleaseConfig.version.git.commitMessage;
|
108
|
-
const generatorCallbacks = [];
|
109
120
|
/**
|
110
121
|
* additionalChangedFiles are files which need to be updated as a side-effect of versioning (such as package manager lock files),
|
111
122
|
* and need to get staged and committed as part of the existing commit, if applicable.
|
112
123
|
*/
|
113
124
|
const additionalChangedFiles = new Set();
|
114
125
|
const additionalDeletedFiles = new Set();
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
projects,
|
133
|
-
});
|
134
|
-
const generatorCallback = await runVersionOnProjects(projectGraph, nxJson, args, tree, generatorData, args.generatorOptionsOverrides, projectNames, releaseGroup, versionData, nxReleaseConfig.conventionalCommits);
|
135
|
-
// Capture the callback so that we can run it after flushing the changes to disk
|
136
|
-
generatorCallbacks.push(async () => {
|
137
|
-
const result = await generatorCallback(tree, {
|
138
|
-
dryRun: !!args.dryRun,
|
139
|
-
verbose: !!args.verbose,
|
140
|
-
generatorOptions: {
|
141
|
-
...generatorOptions,
|
142
|
-
...args.generatorOptionsOverrides,
|
143
|
-
},
|
144
|
-
});
|
145
|
-
const { changedFiles, deletedFiles } = parseGeneratorCallbackResult(result);
|
146
|
-
changedFiles.forEach((f) => additionalChangedFiles.add(f));
|
147
|
-
deletedFiles.forEach((f) => additionalDeletedFiles.add(f));
|
148
|
-
});
|
149
|
-
}
|
150
|
-
}
|
151
|
-
// Resolve any git tags as early as possible so that we can hard error in case of any duplicates before reaching the actual git command
|
152
|
-
const gitTagValues = args.gitTag ?? nxReleaseConfig.version.git.tag
|
153
|
-
? (0, shared_1.createGitTagValues)(releaseGroups, releaseGroupToFilteredProjects, versionData)
|
154
|
-
: [];
|
155
|
-
(0, shared_1.handleDuplicateGitTags)(gitTagValues);
|
156
|
-
printAndFlushChanges(tree, !!args.dryRun);
|
157
|
-
for (const generatorCallback of generatorCallbacks) {
|
158
|
-
await generatorCallback();
|
159
|
-
}
|
160
|
-
const changedFiles = [
|
161
|
-
...tree.listChanges().map((f) => f.path),
|
162
|
-
...additionalChangedFiles,
|
163
|
-
];
|
164
|
-
// No further actions are necessary in this scenario (e.g. if conventional commits detected no changes)
|
165
|
-
if (!changedFiles.length) {
|
166
|
-
return {
|
167
|
-
// An overall workspace version cannot be relevant when filtering to independent projects
|
168
|
-
workspaceVersion: undefined,
|
169
|
-
projectsVersionData: versionData,
|
170
|
-
};
|
171
|
-
}
|
172
|
-
if (args.gitCommit ?? nxReleaseConfig.version.git.commit) {
|
173
|
-
await (0, shared_1.commitChanges)({
|
174
|
-
changedFiles,
|
175
|
-
deletedFiles: Array.from(additionalDeletedFiles),
|
176
|
-
isDryRun: !!args.dryRun,
|
177
|
-
isVerbose: !!args.verbose,
|
178
|
-
gitCommitMessages: (0, shared_1.createCommitMessageValues)(releaseGroups, releaseGroupToFilteredProjects, versionData, commitMessage),
|
179
|
-
gitCommitArgs: args.gitCommitArgs || nxReleaseConfig.version.git.commitArgs,
|
180
|
-
});
|
181
|
-
}
|
182
|
-
else if (args.stageChanges ??
|
183
|
-
nxReleaseConfig.version.git.stageChanges) {
|
184
|
-
output_1.output.logSingleLine(`Staging changed files with git`);
|
185
|
-
await (0, git_1.gitAdd)({
|
186
|
-
changedFiles,
|
187
|
-
dryRun: args.dryRun,
|
188
|
-
verbose: args.verbose,
|
189
|
-
});
|
190
|
-
}
|
191
|
-
if (args.gitTag ?? nxReleaseConfig.version.git.tag) {
|
192
|
-
output_1.output.logSingleLine(`Tagging commit with git`);
|
193
|
-
for (const tag of gitTagValues) {
|
194
|
-
await (0, git_1.gitTag)({
|
195
|
-
tag,
|
196
|
-
message: args.gitTagMessage || nxReleaseConfig.version.git.tagMessage,
|
197
|
-
additionalArgs: args.gitTagArgs || nxReleaseConfig.version.git.tagArgs,
|
198
|
-
dryRun: args.dryRun,
|
199
|
-
verbose: args.verbose,
|
200
|
-
});
|
201
|
-
}
|
202
|
-
}
|
203
|
-
if (args.gitPush ?? nxReleaseConfig.version.git.push) {
|
204
|
-
output_1.output.logSingleLine(`Pushing to git remote "${args.gitRemote}"`);
|
205
|
-
await (0, git_1.gitPush)({
|
206
|
-
gitRemote: args.gitRemote,
|
207
|
-
dryRun: args.dryRun,
|
208
|
-
verbose: args.verbose,
|
209
|
-
});
|
126
|
+
const processor = new release_group_processor_1.ReleaseGroupProcessor(tree, projectGraph, nxReleaseConfig, releaseGroups, releaseGroupToFilteredProjects, {
|
127
|
+
dryRun: args.dryRun,
|
128
|
+
verbose: args.verbose,
|
129
|
+
firstRelease: args.firstRelease,
|
130
|
+
preid: args.preid ?? '',
|
131
|
+
userGivenSpecifier: args.specifier,
|
132
|
+
filters: {
|
133
|
+
projects: args.projects,
|
134
|
+
groups: args.groups,
|
135
|
+
},
|
136
|
+
});
|
137
|
+
try {
|
138
|
+
await processor.init();
|
139
|
+
await processor.processGroups();
|
140
|
+
// Delete processed version plan files if applicable
|
141
|
+
if (args.deleteVersionPlans) {
|
142
|
+
processor.deleteProcessedVersionPlanFiles();
|
210
143
|
}
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
144
|
+
}
|
145
|
+
catch (err) {
|
146
|
+
// Flush any pending project logs before printing the error to make troubleshooting easier
|
147
|
+
processor.flushAllProjectLoggers();
|
148
|
+
// Bubble up the error so that the CLI can print the error and exit, or the programmatic API can handle it
|
149
|
+
throw err;
|
216
150
|
}
|
217
151
|
/**
|
218
|
-
*
|
152
|
+
* Ensure that formatting is applied so that version bump diffs are as minimal as possible
|
153
|
+
* within the context of the user's workspace.
|
219
154
|
*/
|
220
|
-
|
221
|
-
|
222
|
-
runPreVersionCommand(releaseGroup.version.groupPreVersionCommand, {
|
223
|
-
dryRun: args.dryRun,
|
224
|
-
verbose: args.verbose,
|
225
|
-
}, releaseGroup);
|
226
|
-
const projectBatches = (0, batch_projects_by_generator_config_1.batchProjectsByGeneratorConfig)(projectGraph, releaseGroup,
|
227
|
-
// Batch based on all projects within the release group
|
228
|
-
releaseGroup.projects);
|
229
|
-
for (const [generatorConfigString, projectNames,] of projectBatches.entries()) {
|
230
|
-
const [generatorName, generatorOptions] = JSON.parse(generatorConfigString);
|
231
|
-
// Resolve the generator for the batch and run versioning on the projects within the batch
|
232
|
-
const generatorData = resolveGeneratorData({
|
233
|
-
...extractGeneratorCollectionAndName(`batch "${JSON.stringify(projectNames)}" for release-group "${releaseGroupName}"`, generatorName),
|
234
|
-
configGeneratorOptions: generatorOptions,
|
235
|
-
// all project data from the project graph (not to be confused with projectNamesToRunVersionOn)
|
236
|
-
projects,
|
237
|
-
});
|
238
|
-
const generatorCallback = await runVersionOnProjects(projectGraph, nxJson, args, tree, generatorData, args.generatorOptionsOverrides, projectNames, releaseGroup, versionData, nxReleaseConfig.conventionalCommits);
|
239
|
-
// Capture the callback so that we can run it after flushing the changes to disk
|
240
|
-
generatorCallbacks.push(async () => {
|
241
|
-
const result = await generatorCallback(tree, {
|
242
|
-
dryRun: !!args.dryRun,
|
243
|
-
verbose: !!args.verbose,
|
244
|
-
generatorOptions: {
|
245
|
-
...generatorOptions,
|
246
|
-
...args.generatorOptionsOverrides,
|
247
|
-
},
|
248
|
-
});
|
249
|
-
const { changedFiles, deletedFiles } = parseGeneratorCallbackResult(result);
|
250
|
-
changedFiles.forEach((f) => additionalChangedFiles.add(f));
|
251
|
-
deletedFiles.forEach((f) => additionalDeletedFiles.add(f));
|
252
|
-
});
|
253
|
-
}
|
254
|
-
}
|
155
|
+
await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree, { silent: true });
|
156
|
+
const versionData = processor.getVersionData();
|
255
157
|
// Resolve any git tags as early as possible so that we can hard error in case of any duplicates before reaching the actual git command
|
256
158
|
const gitTagValues = args.gitTag ?? nxReleaseConfig.version.git.tag
|
257
159
|
? (0, shared_1.createGitTagValues)(releaseGroups, releaseGroupToFilteredProjects, versionData)
|
258
160
|
: [];
|
259
161
|
(0, shared_1.handleDuplicateGitTags)(gitTagValues);
|
260
162
|
printAndFlushChanges(tree, !!args.dryRun);
|
261
|
-
|
262
|
-
|
263
|
-
|
163
|
+
const { changedFiles: changed, deletedFiles: deleted } = await processor.afterAllProjectsVersioned(nxReleaseConfig.version
|
164
|
+
.versionActionsOptions);
|
165
|
+
changed.forEach((f) => additionalChangedFiles.add(f));
|
166
|
+
deleted.forEach((f) => additionalDeletedFiles.add(f));
|
264
167
|
// Only applicable when there is a single release group with a fixed relationship
|
265
168
|
let workspaceVersion = undefined;
|
266
169
|
if (releaseGroups.length === 1) {
|
@@ -314,11 +217,12 @@ function createAPI(overrideReleaseConfig) {
|
|
314
217
|
}
|
315
218
|
}
|
316
219
|
if (args.gitPush ?? nxReleaseConfig.version.git.push) {
|
317
|
-
output_1.output.logSingleLine(`Pushing to git remote "${args.gitRemote}"`);
|
220
|
+
output_1.output.logSingleLine(`Pushing to git remote "${args.gitRemote ?? 'origin'}"`);
|
318
221
|
await (0, git_1.gitPush)({
|
319
222
|
gitRemote: args.gitRemote,
|
320
223
|
dryRun: args.dryRun,
|
321
224
|
verbose: args.verbose,
|
225
|
+
additionalArgs: args.gitPushArgs || nxReleaseConfig.version.git.pushArgs,
|
322
226
|
});
|
323
227
|
}
|
324
228
|
return {
|
@@ -327,109 +231,34 @@ function createAPI(overrideReleaseConfig) {
|
|
327
231
|
};
|
328
232
|
};
|
329
233
|
}
|
330
|
-
function appendVersionData(existingVersionData, newVersionData) {
|
331
|
-
// Mutate the existing version data
|
332
|
-
for (const [key, value] of Object.entries(newVersionData)) {
|
333
|
-
if (existingVersionData[key]) {
|
334
|
-
throw new Error(`Version data key "${key}" already exists in version data. This is likely a bug, please report your use-case on https://github.com/nrwl/nx`);
|
335
|
-
}
|
336
|
-
existingVersionData[key] = value;
|
337
|
-
}
|
338
|
-
return existingVersionData;
|
339
|
-
}
|
340
|
-
async function runVersionOnProjects(projectGraph, nxJson, args, tree, generatorData, generatorOverrides, projectNames, releaseGroup, versionData, conventionalCommitsConfig) {
|
341
|
-
const generatorOptions = {
|
342
|
-
// Always ensure a string to avoid generator schema validation errors
|
343
|
-
specifier: args.specifier ?? '',
|
344
|
-
preid: args.preid ?? '',
|
345
|
-
...generatorData.configGeneratorOptions,
|
346
|
-
...(generatorOverrides ?? {}),
|
347
|
-
// The following are not overridable by user config
|
348
|
-
projects: projectNames.map((p) => projectGraph.nodes[p]),
|
349
|
-
projectGraph,
|
350
|
-
releaseGroup,
|
351
|
-
firstRelease: args.firstRelease ?? false,
|
352
|
-
conventionalCommitsConfig,
|
353
|
-
deleteVersionPlans: args.deleteVersionPlans,
|
354
|
-
};
|
355
|
-
// Apply generator defaults from schema.json file etc
|
356
|
-
const combinedOpts = await (0, params_1.combineOptionsForGenerator)(generatorOptions, generatorData.collectionName, generatorData.normalizedGeneratorName, (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph), nxJson, generatorData.schema, false, null, (0, node_path_1.relative)(process.cwd(), workspace_root_1.workspaceRoot), args.verbose);
|
357
|
-
const releaseVersionGenerator = generatorData.implementationFactory();
|
358
|
-
// We expect all version generator implementations to return a ReleaseVersionGeneratorResult object, rather than a GeneratorCallback
|
359
|
-
const versionResult = (await releaseVersionGenerator(tree, combinedOpts));
|
360
|
-
if (typeof versionResult === 'function') {
|
361
|
-
throw new Error(`The version generator ${generatorData.collectionName}:${generatorData.normalizedGeneratorName} returned a function instead of an expected ReleaseVersionGeneratorResult`);
|
362
|
-
}
|
363
|
-
// Merge the extra version data into the existing
|
364
|
-
appendVersionData(versionData, versionResult.data);
|
365
|
-
return versionResult.callback;
|
366
|
-
}
|
367
234
|
function printAndFlushChanges(tree, isDryRun) {
|
368
235
|
const changes = tree.listChanges();
|
369
236
|
console.log('');
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
else if (f.type === 'UPDATE') {
|
377
|
-
console.error(`${chalk.white('UPDATE')} ${f.path}${isDryRun ? chalk.keyword('orange')(' [dry-run]') : ''}`);
|
378
|
-
const currentContentsOnDisk = (0, node_fs_1.readFileSync)((0, path_1.joinPathFragments)(tree.root, f.path)).toString();
|
379
|
-
(0, print_changes_1.printDiff)(currentContentsOnDisk, f.content?.toString() || '');
|
380
|
-
}
|
381
|
-
else if (f.type === 'DELETE' && !f.path.includes('.nx')) {
|
382
|
-
throw new Error('Unexpected DELETE change, please report this as an issue');
|
383
|
-
}
|
384
|
-
});
|
385
|
-
if (!isDryRun) {
|
386
|
-
(0, tree_1.flushChanges)(workspace_root_1.workspaceRoot, changes);
|
387
|
-
}
|
388
|
-
}
|
389
|
-
function extractGeneratorCollectionAndName(description, generatorString) {
|
390
|
-
let collectionName;
|
391
|
-
let generatorName;
|
392
|
-
const parsedGeneratorString = (0, generate_1.parseGeneratorString)(generatorString);
|
393
|
-
collectionName = parsedGeneratorString.collection;
|
394
|
-
generatorName = parsedGeneratorString.generator;
|
395
|
-
if (!collectionName || !generatorName) {
|
396
|
-
throw new Error(`Invalid generator string: ${generatorString} used for ${description}. Must be in the format of [collectionName]:[generatorName]`);
|
397
|
-
}
|
398
|
-
return { collectionName, generatorName };
|
399
|
-
}
|
400
|
-
function resolveGeneratorData({ collectionName, generatorName, configGeneratorOptions, projects, }) {
|
401
|
-
try {
|
402
|
-
const { normalizedGeneratorName, schema, implementationFactory } = (0, generator_utils_1.getGeneratorInformation)(collectionName, generatorName, workspace_root_1.workspaceRoot, projects);
|
403
|
-
return {
|
404
|
-
collectionName,
|
405
|
-
generatorName,
|
406
|
-
configGeneratorOptions,
|
407
|
-
normalizedGeneratorName,
|
408
|
-
schema,
|
409
|
-
implementationFactory,
|
410
|
-
};
|
411
|
-
}
|
412
|
-
catch (err) {
|
413
|
-
if (err.message.startsWith('Unable to resolve')) {
|
414
|
-
// See if it is because the plugin is not installed
|
415
|
-
try {
|
416
|
-
require.resolve(collectionName);
|
417
|
-
// is installed
|
418
|
-
throw new Error(`Unable to resolve the generator called "${generatorName}" within the "${collectionName}" package`);
|
237
|
+
if (changes.length > 0) {
|
238
|
+
// Print the changes
|
239
|
+
changes.forEach((f) => {
|
240
|
+
if (f.type === 'CREATE') {
|
241
|
+
console.error(`${chalk.green('CREATE')} ${f.path}${isDryRun ? chalk.keyword('orange')(' [dry-run]') : ''}`);
|
242
|
+
(0, print_changes_1.printDiff)('', f.content?.toString() || '');
|
419
243
|
}
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
*/
|
425
|
-
if (collectionName === '@nx/js') {
|
426
|
-
throw new Error('The @nx/js plugin is required in order to version your JavaScript packages. Run "nx add @nx/js" to add it to your workspace.');
|
427
|
-
}
|
428
|
-
throw new Error(`Unable to resolve the package ${collectionName} in order to load the generator called ${generatorName}. Is the package installed?`);
|
244
|
+
else if (f.type === 'UPDATE') {
|
245
|
+
console.error(`${chalk.white('UPDATE')} ${f.path}${isDryRun ? chalk.keyword('orange')(' [dry-run]') : ''}`);
|
246
|
+
const currentContentsOnDisk = (0, node_fs_1.readFileSync)((0, path_1.joinPathFragments)(tree.root, f.path)).toString();
|
247
|
+
(0, print_changes_1.printDiff)(currentContentsOnDisk, f.content?.toString() || '');
|
429
248
|
}
|
430
|
-
|
431
|
-
|
432
|
-
|
249
|
+
else if (f.type === 'DELETE' && !f.path.includes('.nx')) {
|
250
|
+
throw new Error('Unexpected DELETE change, please report this as an issue');
|
251
|
+
}
|
252
|
+
});
|
253
|
+
}
|
254
|
+
else {
|
255
|
+
let text = isDryRun ? ' would be ' : ' ';
|
256
|
+
output_1.output.warn({
|
257
|
+
title: `No files${text}changed as a result of running versioning`,
|
258
|
+
});
|
259
|
+
}
|
260
|
+
if (!isDryRun) {
|
261
|
+
(0, tree_1.flushChanges)(workspace_root_1.workspaceRoot, changes);
|
433
262
|
}
|
434
263
|
}
|
435
264
|
function runPreVersionCommand(preVersionCommand, { dryRun, verbose }, releaseGroup) {
|
@@ -470,14 +299,3 @@ function runPreVersionCommand(preVersionCommand, { dryRun, verbose }, releaseGro
|
|
470
299
|
process.exit(1);
|
471
300
|
}
|
472
301
|
}
|
473
|
-
function parseGeneratorCallbackResult(result) {
|
474
|
-
if (Array.isArray(result)) {
|
475
|
-
return {
|
476
|
-
changedFiles: result,
|
477
|
-
deletedFiles: [],
|
478
|
-
};
|
479
|
-
}
|
480
|
-
else {
|
481
|
-
return result;
|
482
|
-
}
|
483
|
-
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { PackageManager } from '../../utils/package-manager';
|
2
2
|
import { PackageJson } from '../../utils/package-json';
|
3
3
|
import { NxJsonConfiguration } from '../../config/nx-json';
|
4
|
-
import type
|
4
|
+
import { type NxKey } from '@nx/key';
|
5
5
|
export declare const packagesWeCareAbout: string[];
|
6
6
|
export declare const patternsWeIgnoreInCommunityReport: Array<string | RegExp>;
|
7
7
|
/**
|
@@ -16,8 +16,8 @@ export declare function reportHandler(): Promise<void>;
|
|
16
16
|
export interface ReportData {
|
17
17
|
pm: PackageManager;
|
18
18
|
pmVersion: string;
|
19
|
-
|
20
|
-
|
19
|
+
nxKey: NxKey | null;
|
20
|
+
nxKeyError: Error | null;
|
21
21
|
powerpackPlugins: PackageJson[];
|
22
22
|
localPlugins: string[];
|
23
23
|
communityPlugins: PackageJson[];
|
@@ -36,6 +36,10 @@ export interface ReportData {
|
|
36
36
|
};
|
37
37
|
projectGraphError?: Error | null;
|
38
38
|
nativeTarget: string | null;
|
39
|
+
cache: {
|
40
|
+
max: number;
|
41
|
+
used: number;
|
42
|
+
} | null;
|
39
43
|
}
|
40
44
|
export declare function getReportData(): Promise<ReportData>;
|
41
45
|
interface OutOfSyncPackageGroup {
|
@@ -21,7 +21,10 @@ const installed_plugins_1 = require("../../utils/plugins/installed-plugins");
|
|
21
21
|
const installation_directory_1 = require("../../utils/installation-directory");
|
22
22
|
const nx_json_1 = require("../../config/nx-json");
|
23
23
|
const error_types_1 = require("../../project-graph/error-types");
|
24
|
-
const
|
24
|
+
const nx_key_1 = require("../../utils/nx-key");
|
25
|
+
const cache_1 = require("../../tasks-runner/cache");
|
26
|
+
const native_1 = require("../../native");
|
27
|
+
const cache_directory_1 = require("../../utils/cache-directory");
|
25
28
|
const nxPackageJson = (0, fileutils_1.readJsonFile)((0, path_1.join)(__dirname, '../../../package.json'));
|
26
29
|
exports.packagesWeCareAbout = [
|
27
30
|
'lerna',
|
@@ -46,7 +49,7 @@ const LINE_SEPARATOR = '---------------------------------------';
|
|
46
49
|
*
|
47
50
|
*/
|
48
51
|
async function reportHandler() {
|
49
|
-
const { pm, pmVersion,
|
52
|
+
const { pm, pmVersion, nxKey, nxKeyError, localPlugins, powerpackPlugins, communityPlugins, registeredPlugins, packageVersionsWeCareAbout, outOfSyncPackageGroup, projectGraphError, nativeTarget, cache, } = await getReportData();
|
50
53
|
const fields = [
|
51
54
|
['Node', process.versions.node],
|
52
55
|
['OS', `${process.platform}-${process.arch}`],
|
@@ -61,13 +64,31 @@ async function reportHandler() {
|
|
61
64
|
packageVersionsWeCareAbout.forEach((p) => {
|
62
65
|
bodyLines.push(`${chalk.green(p.package.padEnd(padding))} : ${chalk.bold(p.version)}`);
|
63
66
|
});
|
64
|
-
if (
|
67
|
+
if (nxKey) {
|
65
68
|
bodyLines.push('');
|
66
69
|
bodyLines.push(LINE_SEPARATOR);
|
67
|
-
bodyLines.push(chalk.green('Nx
|
68
|
-
bodyLines.push(
|
69
|
-
|
70
|
-
|
70
|
+
bodyLines.push(chalk.green('Nx key licensed packages'));
|
71
|
+
bodyLines.push((0, nx_key_1.createNxKeyLicenseeInformation)(nxKey));
|
72
|
+
if (nxKey.realExpiresAt || nxKey.expiresAt) {
|
73
|
+
const licenseExpiryDate = new Date((nxKey.realExpiresAt ?? nxKey.expiresAt) * 1000);
|
74
|
+
// license is not expired
|
75
|
+
if (licenseExpiryDate.getTime() >= Date.now()) {
|
76
|
+
if ('perpetualNxVersion' in nxKey) {
|
77
|
+
bodyLines.push(`License expires on ${licenseExpiryDate.toLocaleDateString()}, but will continue to work with Nx ${nxKey.perpetualNxVersion} and below.`);
|
78
|
+
}
|
79
|
+
else {
|
80
|
+
bodyLines.push(`License expires on ${licenseExpiryDate.toLocaleDateString()}.`);
|
81
|
+
}
|
82
|
+
}
|
83
|
+
else {
|
84
|
+
if ('perpetualNxVersion' in nxKey) {
|
85
|
+
bodyLines.push(`License expired on ${licenseExpiryDate.toLocaleDateString()}, but will continue to work with Nx ${nxKey.perpetualNxVersion} and below.`);
|
86
|
+
}
|
87
|
+
else {
|
88
|
+
bodyLines.push(`License expired on ${licenseExpiryDate.toLocaleDateString()}.`);
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
71
92
|
bodyLines.push('');
|
72
93
|
padding =
|
73
94
|
Math.max(...powerpackPlugins.map((powerpackPlugin) => powerpackPlugin.name.length)) + 1;
|
@@ -76,11 +97,11 @@ async function reportHandler() {
|
|
76
97
|
}
|
77
98
|
bodyLines.push('');
|
78
99
|
}
|
79
|
-
else if (
|
100
|
+
else if (nxKeyError) {
|
80
101
|
bodyLines.push('');
|
81
|
-
bodyLines.push(chalk.red('Nx
|
102
|
+
bodyLines.push(chalk.red('Nx key'));
|
82
103
|
bodyLines.push(LINE_SEPARATOR);
|
83
|
-
bodyLines.push(
|
104
|
+
bodyLines.push(nxKeyError.message);
|
84
105
|
bodyLines.push('');
|
85
106
|
}
|
86
107
|
if (registeredPlugins.length) {
|
@@ -105,6 +126,10 @@ async function reportHandler() {
|
|
105
126
|
bodyLines.push(`\t ${chalk.green(plugin)}`);
|
106
127
|
}
|
107
128
|
}
|
129
|
+
if (cache) {
|
130
|
+
bodyLines.push(LINE_SEPARATOR);
|
131
|
+
bodyLines.push(`Cache Usage: ${(0, cache_1.formatCacheSize)(cache.used)} / ${cache.max === 0 ? '∞' : (0, cache_1.formatCacheSize)(cache.max)}`);
|
132
|
+
}
|
108
133
|
if (outOfSyncPackageGroup) {
|
109
134
|
bodyLines.push(LINE_SEPARATOR);
|
110
135
|
bodyLines.push(`The following packages should match the installed version of ${outOfSyncPackageGroup.basePackage}`);
|
@@ -147,20 +172,28 @@ async function getReportData() {
|
|
147
172
|
}
|
148
173
|
const outOfSyncPackageGroup = findMisalignedPackagesForPackage(nxPackageJson);
|
149
174
|
const native = isNativeAvailable();
|
150
|
-
let
|
151
|
-
let
|
175
|
+
let nxKey = null;
|
176
|
+
let nxKeyError = null;
|
152
177
|
try {
|
153
|
-
|
178
|
+
nxKey = await (0, nx_key_1.getNxKeyInformation)();
|
154
179
|
}
|
155
180
|
catch (e) {
|
156
|
-
if (!(e instanceof
|
157
|
-
|
181
|
+
if (!(e instanceof nx_key_1.NxKeyNotInstalledError)) {
|
182
|
+
nxKeyError = e;
|
158
183
|
}
|
159
184
|
}
|
185
|
+
let cache = (0, cache_1.dbCacheEnabled)(nxJson)
|
186
|
+
? {
|
187
|
+
max: nxJson.maxCacheSize !== undefined
|
188
|
+
? (0, cache_1.parseMaxCacheSize)(nxJson.maxCacheSize)
|
189
|
+
: (0, native_1.getDefaultMaxCacheSize)(cache_directory_1.cacheDir),
|
190
|
+
used: new cache_1.DbCache({ nxCloudRemoteCache: null }).getUsedCacheSpace(),
|
191
|
+
}
|
192
|
+
: null;
|
160
193
|
return {
|
161
194
|
pm,
|
162
|
-
|
163
|
-
|
195
|
+
nxKey,
|
196
|
+
nxKeyError,
|
164
197
|
powerpackPlugins,
|
165
198
|
pmVersion,
|
166
199
|
localPlugins,
|
@@ -170,6 +203,7 @@ async function getReportData() {
|
|
170
203
|
outOfSyncPackageGroup,
|
171
204
|
projectGraphError,
|
172
205
|
nativeTarget: native ? native.getBinaryTarget() : null,
|
206
|
+
cache,
|
173
207
|
};
|
174
208
|
}
|
175
209
|
async function tryGetProjectGraph() {
|
@@ -238,7 +272,7 @@ function findMisalignedPackagesForPackage(base) {
|
|
238
272
|
}
|
239
273
|
function findInstalledPowerpackPlugins() {
|
240
274
|
const installedPlugins = (0, installed_plugins_1.findInstalledPlugins)();
|
241
|
-
return installedPlugins.filter((dep) => new RegExp('@nx/powerpack*').test(dep.name));
|
275
|
+
return installedPlugins.filter((dep) => new RegExp('@nx/powerpack*|@nx/(.+)-cache|@nx/(conformance|owners|enterprise*)').test(dep.name));
|
242
276
|
}
|
243
277
|
function findInstalledCommunityPlugins() {
|
244
278
|
const installedPlugins = (0, installed_plugins_1.findInstalledPlugins)();
|
@@ -2,8 +2,8 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.yargsNxInfixCommand = exports.yargsRunCommand = void 0;
|
4
4
|
const yargs_1 = require("yargs");
|
5
|
-
const shared_options_1 = require("../yargs-utils/shared-options");
|
6
5
|
const handle_errors_1 = require("../../utils/handle-errors");
|
6
|
+
const shared_options_1 = require("../yargs-utils/shared-options");
|
7
7
|
exports.yargsRunCommand = {
|
8
8
|
command: 'run [project][:target][:configuration] [_..]',
|
9
9
|
describe: `Run a target for a project
|
@@ -13,7 +13,7 @@ exports.yargsRunCommand = {
|
|
13
13
|
(e.g., nx serve myapp --configuration=production)
|
14
14
|
|
15
15
|
You can skip the use of Nx cache by using the --skip-nx-cache option.`,
|
16
|
-
builder: (yargs) => (0, shared_options_1.withRunOneOptions)((0, shared_options_1.withBatch)(yargs)),
|
16
|
+
builder: (yargs) => (0, shared_options_1.withTuiOptions)((0, shared_options_1.withRunOneOptions)((0, shared_options_1.withBatch)(yargs))),
|
17
17
|
handler: async (args) => {
|
18
18
|
const exitCode = await (0, handle_errors_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
|
19
19
|
await Promise.resolve().then(() => require('./run-one')).then((m) => m.runOne(process.cwd(), (0, shared_options_1.withOverrides)(args)));
|
@@ -66,7 +66,7 @@ async function printTargetRunHelpInternal({ project, target }, root, projectsCon
|
|
66
66
|
...localEnv,
|
67
67
|
};
|
68
68
|
if (pseudo_terminal_1.PseudoTerminal.isSupported()) {
|
69
|
-
const terminal = (0, pseudo_terminal_1.
|
69
|
+
const terminal = (0, pseudo_terminal_1.createPseudoTerminal)();
|
70
70
|
await new Promise(() => {
|
71
71
|
const cp = terminal.runCommand(helpCommand, { jsEnv: env });
|
72
72
|
cp.onExit((code) => {
|