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
@@ -0,0 +1,183 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.VersionActions = void 0;
|
4
|
+
exports.resolveVersionActionsForProject = resolveVersionActionsForProject;
|
5
|
+
const node_path_1 = require("node:path");
|
6
|
+
const register_1 = require("../../../plugins/js/utils/register");
|
7
|
+
const typescript_1 = require("../../../plugins/js/utils/typescript");
|
8
|
+
const utils_1 = require("../../../tasks-runner/utils");
|
9
|
+
const workspace_root_1 = require("../../../utils/workspace-root");
|
10
|
+
const config_1 = require("../config/config");
|
11
|
+
const semver_1 = require("../utils/semver");
|
12
|
+
const release_group_processor_1 = require("./release-group-processor");
|
13
|
+
function resolveVersionActionsPath(path, projectGraphNode) {
|
14
|
+
try {
|
15
|
+
return require.resolve(path);
|
16
|
+
}
|
17
|
+
catch {
|
18
|
+
try {
|
19
|
+
return require.resolve((0, node_path_1.join)(workspace_root_1.workspaceRoot, path));
|
20
|
+
}
|
21
|
+
catch {
|
22
|
+
if (path === config_1.DEFAULT_VERSION_ACTIONS_PATH) {
|
23
|
+
throw new Error(`Unable to resolve the default "versionActions" implementation for project "${projectGraphNode.name}" at path: "${path}"
|
24
|
+
|
25
|
+
- If this is a JavaScript/TypeScript project, it is likely that you simply need to install the "@nx/js" plugin.
|
26
|
+
|
27
|
+
- If this not a JavaScript/TypeScript project, you can should provide an alternative "versionActions" implementation path via the "release.version.versionActions" configuration option.
|
28
|
+
`);
|
29
|
+
}
|
30
|
+
throw new Error(`Unable to resolve the "versionActions" implementation for project "${projectGraphNode.name}" at the configured path: "${path}"`);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
const versionActionsResolutionCache = new Map();
|
35
|
+
async function resolveVersionActionsForProject(tree, releaseGroup, projectGraphNode, finalConfigForProject) {
|
36
|
+
// Project level release version config takes priority, if set
|
37
|
+
const projectVersionConfig = projectGraphNode.data.release?.version;
|
38
|
+
const releaseGroupVersionConfig = releaseGroup.version;
|
39
|
+
const versionActionsPathConfig = projectVersionConfig?.versionActions ??
|
40
|
+
releaseGroupVersionConfig?.versionActions ??
|
41
|
+
null;
|
42
|
+
if (!versionActionsPathConfig) {
|
43
|
+
// Should be an impossible state, as we should have defaulted to the JS implementation during config processing
|
44
|
+
throw new Error(`No versionActions implementation found for project "${projectGraphNode.name}", please report this on https://github.com/nrwl/nx/issues`);
|
45
|
+
}
|
46
|
+
let cachedData = versionActionsResolutionCache.get(versionActionsPathConfig);
|
47
|
+
const versionActionsPath = resolveVersionActionsPath(versionActionsPathConfig, projectGraphNode);
|
48
|
+
let VersionActionsClass;
|
49
|
+
let afterAllProjectsVersioned;
|
50
|
+
if (cachedData) {
|
51
|
+
VersionActionsClass = cachedData.VersionActionsClass;
|
52
|
+
afterAllProjectsVersioned = cachedData.afterAllProjectsVersioned;
|
53
|
+
}
|
54
|
+
else {
|
55
|
+
let cleanupTranspiler;
|
56
|
+
if (versionActionsPath.endsWith('.ts')) {
|
57
|
+
cleanupTranspiler = (0, register_1.registerTsProject)((0, typescript_1.getRootTsConfigPath)());
|
58
|
+
}
|
59
|
+
const loaded = require(versionActionsPath);
|
60
|
+
cleanupTranspiler?.();
|
61
|
+
VersionActionsClass = loaded.default ?? loaded;
|
62
|
+
if (!VersionActionsClass) {
|
63
|
+
throw new Error(`For project "${projectGraphNode.name}" it was not possible to resolve the VersionActions implementation from: "${versionActionsPath}"`);
|
64
|
+
}
|
65
|
+
afterAllProjectsVersioned =
|
66
|
+
loaded.afterAllProjectsVersioned ??
|
67
|
+
// no-op fallback for ecosystems/use-cases where it is not applicable
|
68
|
+
(() => Promise.resolve({
|
69
|
+
changedFiles: [],
|
70
|
+
deletedFiles: [],
|
71
|
+
}));
|
72
|
+
versionActionsResolutionCache.set(versionActionsPath, {
|
73
|
+
VersionActionsClass,
|
74
|
+
afterAllProjectsVersioned,
|
75
|
+
});
|
76
|
+
}
|
77
|
+
const versionActions = new VersionActionsClass(releaseGroup, projectGraphNode, finalConfigForProject);
|
78
|
+
// Initialize the version actions with all the required manifest paths etc
|
79
|
+
await versionActions.init(tree);
|
80
|
+
return {
|
81
|
+
versionActionsPath,
|
82
|
+
versionActions,
|
83
|
+
afterAllProjectsVersioned,
|
84
|
+
};
|
85
|
+
}
|
86
|
+
class VersionActions {
|
87
|
+
constructor(releaseGroup, projectGraphNode, finalConfigForProject) {
|
88
|
+
this.releaseGroup = releaseGroup;
|
89
|
+
this.projectGraphNode = projectGraphNode;
|
90
|
+
this.finalConfigForProject = finalConfigForProject;
|
91
|
+
/**
|
92
|
+
* The interpolated manifest paths to update, if applicable based on the user's configuration, when new
|
93
|
+
* versions and dependencies are determined. If no manifest files should be updated based on the user's
|
94
|
+
* configuration, this will be an empty array.
|
95
|
+
*/
|
96
|
+
this.manifestsToUpdate = [];
|
97
|
+
}
|
98
|
+
/**
|
99
|
+
* Asynchronous initialization of the version actions and validation of certain configuration options.
|
100
|
+
*/
|
101
|
+
async init(tree) {
|
102
|
+
// Default to the first available source manifest root, if applicable, if no custom manifest roots are provided
|
103
|
+
if (this.validManifestFilenames?.length &&
|
104
|
+
this.finalConfigForProject.manifestRootsToUpdate.length === 0) {
|
105
|
+
for (const manifestFilename of this.validManifestFilenames) {
|
106
|
+
if (tree.exists((0, node_path_1.join)(this.projectGraphNode.data.root, manifestFilename))) {
|
107
|
+
this.finalConfigForProject.manifestRootsToUpdate.push(this.projectGraphNode.data.root);
|
108
|
+
break;
|
109
|
+
}
|
110
|
+
}
|
111
|
+
}
|
112
|
+
const interpolatedManifestRoots = this.finalConfigForProject.manifestRootsToUpdate.map((manifestRoot) => {
|
113
|
+
return (0, utils_1.interpolate)(manifestRoot, {
|
114
|
+
workspaceRoot: '',
|
115
|
+
projectRoot: this.projectGraphNode.data.root,
|
116
|
+
projectName: this.projectGraphNode.name,
|
117
|
+
});
|
118
|
+
});
|
119
|
+
for (const interpolatedManifestRoot of interpolatedManifestRoots) {
|
120
|
+
let hasValidManifest = false;
|
121
|
+
for (const manifestFilename of this.validManifestFilenames) {
|
122
|
+
const manifestPath = (0, node_path_1.join)(interpolatedManifestRoot, manifestFilename);
|
123
|
+
if (tree.exists(manifestPath)) {
|
124
|
+
this.manifestsToUpdate.push(manifestPath);
|
125
|
+
hasValidManifest = true;
|
126
|
+
break;
|
127
|
+
}
|
128
|
+
}
|
129
|
+
if (!hasValidManifest) {
|
130
|
+
const validManifestFilenames = this.validManifestFilenames?.join(' or ');
|
131
|
+
throw new Error(`The project "${this.projectGraphNode.name}" does not have a ${validManifestFilenames} file available in ./${interpolatedManifestRoot}.
|
132
|
+
|
133
|
+
To fix this you will either need to add a ${validManifestFilenames} file at that location, or configure "release" within your nx.json to exclude "${this.projectGraphNode.name}" from the current release group, or amend the "release.version.manifestRootsToUpdate" configuration to point to where the relevant manifest should be.`);
|
134
|
+
}
|
135
|
+
}
|
136
|
+
}
|
137
|
+
/**
|
138
|
+
* The default implementation will calculate the new version based on semver. If semver is not applicable to a
|
139
|
+
* particular versioning use-case, this method should be overridden with custom logic.
|
140
|
+
*
|
141
|
+
* @param {string | null} currentVersion - The current version of the project, or null if the current version resolver is set to 'none'
|
142
|
+
* @param {string} newVersionInput - The new version input provided by the user, such as a semver relative bump type, or an explicit version
|
143
|
+
* @param {string} newVersionInputReason - The reason for the new version input used to inform the log message to show to the user
|
144
|
+
* @param {Record<string, unknown>} newVersionInputReasonData - The data to interpolate into the new version input reason
|
145
|
+
* @param {string} preid - The preid to use for the new version, if applicable
|
146
|
+
*/
|
147
|
+
async calculateNewVersion(currentVersion, newVersionInput, newVersionInputReason, newVersionInputReasonData, preid) {
|
148
|
+
const isSemverRelativeBump = (0, semver_1.isRelativeVersionKeyword)(newVersionInput);
|
149
|
+
const newVersionReasonText = release_group_processor_1.BUMP_TYPE_REASON_TEXT[newVersionInputReason];
|
150
|
+
if (!newVersionReasonText) {
|
151
|
+
throw new Error(`Unhandled bump type reason for ${this.projectGraphNode.name} with newVersionInput ${newVersionInput} and newVersionInputReason ${newVersionInputReason}, please report this as a bug on https://github.com/nrwl/nx/issues`);
|
152
|
+
}
|
153
|
+
const interpolatedNewVersionInputReasonText = (0, utils_1.interpolate)(newVersionReasonText, newVersionInputReasonData);
|
154
|
+
if (isSemverRelativeBump && !currentVersion) {
|
155
|
+
throw new Error(`There was no current version resolved for project "${this.projectGraphNode.name}", but it was configured to be bumped via a semver relative keyword "${newVersionInput}"${interpolatedNewVersionInputReasonText}. This is not a valid combination, please review your release configuration and CLI arguments`);
|
156
|
+
}
|
157
|
+
const newVersion = (0, semver_1.deriveNewSemverVersion)(currentVersion, newVersionInput, preid);
|
158
|
+
const newVersionInputText = (0, semver_1.isRelativeVersionKeyword)(newVersionInput)
|
159
|
+
? `semver relative bump "${newVersionInput}"`
|
160
|
+
: `explicit semver value "${newVersionInput}"`;
|
161
|
+
return {
|
162
|
+
newVersion,
|
163
|
+
logText: `❓ Applied ${newVersionInputText}${interpolatedNewVersionInputReasonText}to get new version ${newVersion}`,
|
164
|
+
};
|
165
|
+
}
|
166
|
+
/**
|
167
|
+
* Implementation details of resolving the dependencies of a project.
|
168
|
+
*
|
169
|
+
* The default implementation will read dependencies from the Nx project graph. In many cases this will be sufficient,
|
170
|
+
* because the project graph will have been constructed using plugins from relevant ecosystems that should have applied
|
171
|
+
* any and all relevant metadata to the project nodes and dependency edges.
|
172
|
+
*
|
173
|
+
* If, however, the project graph cannot be used as the source of truth for whatever reason, then this default method
|
174
|
+
* can simply be overridden in the final version actions implementation.
|
175
|
+
*/
|
176
|
+
async readDependencies(tree, projectGraph) {
|
177
|
+
return (projectGraph.dependencies[this.projectGraphNode.name] ?? []).filter(
|
178
|
+
// Skip implicit dependencies for now to match legacy versioning behavior
|
179
|
+
// TODO: holistically figure out how to handle implicit dependencies with nx release
|
180
|
+
(dep) => dep.type !== 'implicit');
|
181
|
+
}
|
182
|
+
}
|
183
|
+
exports.VersionActions = VersionActions;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { NxJsonConfiguration, NxReleaseConfiguration } from '../../config/nx-json';
|
2
|
+
import { ProjectGraph, ProjectGraphProjectNode } from '../../config/project-graph';
|
3
|
+
import { VersionOptions } from './command-object';
|
4
|
+
import { NxReleaseConfig } from './config/config';
|
5
|
+
import { ReleaseGroupWithName } from './config/filter-release-groups';
|
6
|
+
import type { ReleaseVersionGeneratorResult, VersionData } from './utils/shared-legacy';
|
7
|
+
import { NxReleaseVersionResult } from './version';
|
8
|
+
export { deriveNewSemverVersion } from './utils/semver';
|
9
|
+
export type { ReleaseVersionGeneratorResult, VersionData };
|
10
|
+
export declare const validReleaseVersionPrefixes: readonly ["auto", "", "~", "^", "="];
|
11
|
+
export interface ReleaseVersionGeneratorSchema {
|
12
|
+
projects: ProjectGraphProjectNode[];
|
13
|
+
releaseGroup: ReleaseGroupWithName;
|
14
|
+
projectGraph: ProjectGraph;
|
15
|
+
specifier?: string;
|
16
|
+
specifierSource?: 'prompt' | 'conventional-commits' | 'version-plans';
|
17
|
+
preid?: string;
|
18
|
+
packageRoot?: string;
|
19
|
+
currentVersionResolver?: 'registry' | 'disk' | 'git-tag';
|
20
|
+
currentVersionResolverMetadata?: Record<string, unknown>;
|
21
|
+
fallbackCurrentVersionResolver?: 'disk';
|
22
|
+
firstRelease?: boolean;
|
23
|
+
versionPrefix?: (typeof validReleaseVersionPrefixes)[number];
|
24
|
+
skipLockFileUpdate?: boolean;
|
25
|
+
installArgs?: string;
|
26
|
+
installIgnoreScripts?: boolean;
|
27
|
+
conventionalCommitsConfig?: NxReleaseConfig['conventionalCommits'];
|
28
|
+
deleteVersionPlans?: boolean;
|
29
|
+
/**
|
30
|
+
* 'auto' is the default and will cause dependents to be updated (a patch version bump) when a dependency is versioned.
|
31
|
+
* This is only applicable to independently released projects. 'never' will cause dependents to not be updated.
|
32
|
+
*/
|
33
|
+
updateDependents?: 'auto' | 'never';
|
34
|
+
/**
|
35
|
+
* Whether or not to completely omit project logs when that project has no applicable changes. This can be useful for
|
36
|
+
* large monorepos which have a large number of projects, especially when only a subset are released together.
|
37
|
+
*/
|
38
|
+
logUnchangedProjects?: boolean;
|
39
|
+
/**
|
40
|
+
* Whether or not to keep local dependency protocols (e.g. file:, workspace:) when updating dependencies in
|
41
|
+
* package.json files. This is `false` by default as not all package managers support publishing with these protocols
|
42
|
+
* still present in the package.json.
|
43
|
+
*/
|
44
|
+
preserveLocalDependencyProtocols?: boolean;
|
45
|
+
}
|
46
|
+
export declare function releaseVersionLegacy(projectGraph: ProjectGraph, args: VersionOptions, nxJson: NxJsonConfiguration, nxReleaseConfig: NxReleaseConfig, userProvidedReleaseConfig: NxReleaseConfiguration): Promise<NxReleaseVersionResult>;
|