nx 22.0.0-beta.2 → 22.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/migrations.json +5 -0
- package/package.json +12 -12
- package/project.json +2 -1
- package/schemas/nx-schema.json +339 -246
- package/schemas/project-schema.json +72 -12
- package/src/adapter/angular-json.d.ts.map +1 -1
- package/src/adapter/angular-json.js +13 -17
- package/src/command-line/init/init-v2.js +1 -1
- package/src/command-line/release/changelog.d.ts.map +1 -1
- package/src/command-line/release/changelog.js +1 -3
- package/src/command-line/release/command-object.d.ts +0 -6
- package/src/command-line/release/command-object.d.ts.map +1 -1
- package/src/command-line/release/config/config.d.ts +1 -1
- package/src/command-line/release/config/config.d.ts.map +1 -1
- package/src/command-line/release/config/config.js +41 -133
- package/src/command-line/release/plan-check.d.ts.map +1 -1
- package/src/command-line/release/plan-check.js +1 -3
- package/src/command-line/release/plan.d.ts.map +1 -1
- package/src/command-line/release/plan.js +1 -3
- package/src/command-line/release/publish.d.ts.map +1 -1
- package/src/command-line/release/publish.js +1 -3
- package/src/command-line/release/release.d.ts.map +1 -1
- package/src/command-line/release/release.js +1 -3
- package/src/command-line/release/utils/git.d.ts.map +1 -1
- package/src/command-line/release/utils/git.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.d.ts.map +1 -1
- package/src/command-line/release/utils/semver.d.ts +15 -9
- package/src/command-line/release/utils/semver.d.ts.map +1 -1
- package/src/command-line/release/utils/semver.js +30 -24
- package/src/command-line/release/utils/shared.d.ts +4 -1
- package/src/command-line/release/utils/shared.d.ts.map +1 -1
- package/src/command-line/release/utils/shared.js +33 -11
- package/src/command-line/release/utils/test/test-utils.d.ts +20 -0
- package/src/command-line/release/utils/test/test-utils.d.ts.map +1 -0
- package/src/command-line/release/utils/test/test-utils.js +24 -0
- package/src/command-line/release/version/derive-specifier-from-conventional-commits.d.ts.map +1 -1
- package/src/command-line/release/version/derive-specifier-from-conventional-commits.js +10 -1
- package/src/command-line/release/version/release-group-processor.d.ts.map +1 -1
- package/src/command-line/release/version/release-group-processor.js +1 -2
- package/src/command-line/release/version/test-utils.d.ts.map +1 -1
- package/src/command-line/release/version/test-utils.js +0 -4
- package/src/command-line/release/version.d.ts.map +1 -1
- package/src/command-line/release/version.js +1 -8
- package/src/config/nx-json.d.ts +2 -31
- package/src/config/nx-json.d.ts.map +1 -1
- package/src/config/workspace-json-project-json.d.ts +2 -2
- package/src/config/workspace-json-project-json.d.ts.map +1 -1
- package/src/core/graph/main.js +1 -1
- package/src/devkit-exports.d.ts +1 -1
- package/src/devkit-exports.d.ts.map +1 -1
- package/src/migrations/update-21-0-0/release-changelog-config-changes.d.ts.map +1 -1
- package/src/migrations/update-21-0-0/release-version-config-changes.d.ts.map +1 -1
- package/src/migrations/update-21-0-0/release-version-config-changes.js +5 -15
- package/src/migrations/update-22-0-0/release-version-config-changes.d.ts +3 -0
- package/src/migrations/update-22-0-0/release-version-config-changes.d.ts.map +1 -0
- package/src/migrations/update-22-0-0/release-version-config-changes.js +101 -0
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/plugins/js/index.d.ts +1 -2
- package/src/plugins/js/index.d.ts.map +1 -1
- package/src/plugins/js/index.js +28 -32
- package/src/plugins/js/lock-file/lock-file.d.ts +2 -2
- package/src/plugins/js/lock-file/lock-file.d.ts.map +1 -1
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +1 -1
- package/src/project-graph/plugins/loaded-nx-plugin.d.ts.map +1 -1
- package/src/project-graph/plugins/loaded-nx-plugin.js +8 -6
- package/src/project-graph/plugins/public-api.d.ts +1 -36
- package/src/project-graph/plugins/public-api.d.ts.map +1 -1
- package/src/project-graph/plugins/utils.d.ts +4 -2
- package/src/project-graph/plugins/utils.d.ts.map +1 -1
- package/src/command-line/release/config/use-legacy-versioning.d.ts +0 -3
- package/src/command-line/release/config/use-legacy-versioning.d.ts.map +0 -1
- package/src/command-line/release/config/use-legacy-versioning.js +0 -9
- package/src/command-line/release/utils/batch-projects-by-generator-config.d.ts +0 -8
- package/src/command-line/release/utils/batch-projects-by-generator-config.d.ts.map +0 -1
- package/src/command-line/release/utils/batch-projects-by-generator-config.js +0 -39
- package/src/command-line/release/version-legacy.d.ts +0 -47
- package/src/command-line/release/version-legacy.d.ts.map +0 -1
- package/src/command-line/release/version-legacy.js +0 -453
package/src/devkit-exports.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type { WorkspaceJsonConfiguration, ProjectsConfigurations, TargetDependen
|
|
|
15
15
|
*/
|
|
16
16
|
export type { Generator, Migration, GeneratorCallback, PromiseExecutor, AsyncIteratorExecutor, Executor, ExecutorContext, TaskGraphExecutor, GeneratorsJson, ExecutorsJson, MigrationsJson, CustomHasher, HasherContext, } from './config/misc-interfaces';
|
|
17
17
|
export { workspaceLayout } from './config/configuration';
|
|
18
|
-
export type { NxPlugin, NxPluginV2,
|
|
18
|
+
export type { NxPlugin, NxPluginV2, CreateNodesResult, CreateNodesContextV2, CreateNodesFunctionV2, CreateNodesResultV2, CreateNodesV2, CreateDependencies, CreateDependenciesContext, CreateMetadata, CreateMetadataContext, ProjectsMetadata, PreTasksExecution, PreTasksExecutionContext, PostTasksExecution, PostTasksExecutionContext, } from './project-graph/plugins';
|
|
19
19
|
export { AggregateCreateNodesError, StaleProjectGraphCacheError, } from './project-graph/error-types';
|
|
20
20
|
export { createNodesFromFiles } from './project-graph/plugins';
|
|
21
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devkit-exports.d.ts","sourceRoot":"","sources":["../../../../packages/nx/src/devkit-exports.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;GAEG;AACH,YAAY,EACV,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,SAAS,GACV,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,YAAY,EACV,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,EACZ,aAAa,GACd,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,YAAY,EACV,QAAQ,EACR,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"devkit-exports.d.ts","sourceRoot":"","sources":["../../../../packages/nx/src/devkit-exports.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;GAEG;AACH,YAAY,EACV,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,SAAS,GACV,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,YAAY,EACV,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,EACZ,aAAa,GACd,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,YAAY,EACV,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,yBAAyB,EACzB,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OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD;;GAEG;AACH,OAAO,EAAE,qCAAqC,EAAE,MAAM,gCAAgC,CAAC;AAEvF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-changelog-config-changes.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/migrations/update-21-0-0/release-changelog-config-changes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"release-changelog-config-changes.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/migrations/update-21-0-0/release-changelog-config-changes.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAG7C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,iBA2C9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-version-config-changes.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/migrations/update-21-0-0/release-version-config-changes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"release-version-config-changes.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/migrations/update-21-0-0/release-version-config-changes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAKlD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,iBAoG9C"}
|
|
@@ -11,18 +11,8 @@ async function update(tree) {
|
|
|
11
11
|
if (!nxJson) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
//
|
|
15
|
-
if (nxJson.release?.version?.useLegacyVersioning === true) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
14
|
+
// Note: Any's have been used as LegacyVersioning Options have been removed
|
|
18
15
|
function updateProperties(versionConfig) {
|
|
19
|
-
// If the user is using a generator other than the @nx/js one, set useLegacyVersioning to true and nothing else
|
|
20
|
-
if ('generator' in versionConfig &&
|
|
21
|
-
versionConfig.generator !== '@nx/js:release-version') {
|
|
22
|
-
versionConfig.useLegacyVersioning =
|
|
23
|
-
true;
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
16
|
// These options used to live inside of generatorOptions, but are now like for like top-level nx core options
|
|
27
17
|
const coreOptionsToPromoteToTopLevel = [
|
|
28
18
|
'specifierSource',
|
|
@@ -48,8 +38,9 @@ async function update(tree) {
|
|
|
48
38
|
}
|
|
49
39
|
// packageRoot has been replaced by manifestRootsToUpdate
|
|
50
40
|
if (typeof versionConfig.generatorOptions.packageRoot === 'string') {
|
|
51
|
-
versionConfig.manifestRootsToUpdate =
|
|
52
|
-
|
|
41
|
+
versionConfig.manifestRootsToUpdate = [
|
|
42
|
+
versionConfig.generatorOptions.packageRoot,
|
|
43
|
+
];
|
|
53
44
|
delete versionConfig.generatorOptions.packageRoot;
|
|
54
45
|
}
|
|
55
46
|
// These options have been moved to versionActionsOptions
|
|
@@ -61,8 +52,7 @@ async function update(tree) {
|
|
|
61
52
|
for (const option of versionActionsOptions) {
|
|
62
53
|
if (versionConfig.generatorOptions[option]) {
|
|
63
54
|
versionConfig.versionActionsOptions =
|
|
64
|
-
versionConfig
|
|
65
|
-
.versionActionsOptions || {};
|
|
55
|
+
versionConfig.versionActionsOptions || {};
|
|
66
56
|
versionConfig.versionActionsOptions[option] =
|
|
67
57
|
versionConfig.generatorOptions[option];
|
|
68
58
|
delete versionConfig.generatorOptions[option];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-version-config-changes.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/migrations/update-22-0-0/release-version-config-changes.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAKlD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,iBA0G9C"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
|
|
6
|
+
const json_1 = require("../../generators/utils/json");
|
|
7
|
+
const nx_json_1 = require("../../generators/utils/nx-json");
|
|
8
|
+
const project_configuration_1 = require("../../generators/utils/project-configuration");
|
|
9
|
+
async function update(tree) {
|
|
10
|
+
const nxJson = (0, nx_json_1.readNxJson)(tree);
|
|
11
|
+
if (!nxJson) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
// Note: Any's have been used as LegacyVersioning Options have been removed
|
|
15
|
+
function updateProperties(versionConfig) {
|
|
16
|
+
// These options used to live inside of generatorOptions, but are now like for like top-level nx core options
|
|
17
|
+
const coreOptionsToPromoteToTopLevel = [
|
|
18
|
+
'specifierSource',
|
|
19
|
+
'currentVersionResolver',
|
|
20
|
+
'currentVersionResolverMetadata',
|
|
21
|
+
'fallbackCurrentVersionResolver',
|
|
22
|
+
'versionPrefix',
|
|
23
|
+
'updateDependents',
|
|
24
|
+
'logUnchangedProjects',
|
|
25
|
+
];
|
|
26
|
+
if ('generatorOptions' in versionConfig) {
|
|
27
|
+
for (const option of coreOptionsToPromoteToTopLevel) {
|
|
28
|
+
if (versionConfig.generatorOptions[option]) {
|
|
29
|
+
versionConfig[option] = versionConfig.generatorOptions[option];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// preserveLocalDependencyProtocols has changed to true by default, so remove it if explicitly true, otherwise set to false explicitly
|
|
33
|
+
if (versionConfig.generatorOptions.preserveLocalDependencyProtocols) {
|
|
34
|
+
delete versionConfig.generatorOptions.preserveLocalDependencyProtocols;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
versionConfig.preserveLocalDependencyProtocols = false;
|
|
38
|
+
}
|
|
39
|
+
// packageRoot has been replaced by manifestRootsToUpdate
|
|
40
|
+
if (typeof versionConfig.generatorOptions.packageRoot === 'string') {
|
|
41
|
+
versionConfig.manifestRootsToUpdate =
|
|
42
|
+
[versionConfig.generatorOptions.packageRoot];
|
|
43
|
+
delete versionConfig.generatorOptions.packageRoot;
|
|
44
|
+
}
|
|
45
|
+
// These options have been moved to versionActionsOptions
|
|
46
|
+
const versionActionsOptions = [
|
|
47
|
+
'skipLockFileUpdate',
|
|
48
|
+
'installArgs',
|
|
49
|
+
'installIgnoreScripts',
|
|
50
|
+
];
|
|
51
|
+
for (const option of versionActionsOptions) {
|
|
52
|
+
if (versionConfig.generatorOptions[option]) {
|
|
53
|
+
versionConfig.versionActionsOptions =
|
|
54
|
+
versionConfig
|
|
55
|
+
.versionActionsOptions || {};
|
|
56
|
+
versionConfig.versionActionsOptions[option] =
|
|
57
|
+
versionConfig.generatorOptions[option];
|
|
58
|
+
delete versionConfig.generatorOptions[option];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
delete versionConfig.generatorOptions;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// nx.json
|
|
65
|
+
if (nxJson.release) {
|
|
66
|
+
// Top level version config
|
|
67
|
+
if (nxJson.release.version) {
|
|
68
|
+
updateProperties(nxJson.release.version);
|
|
69
|
+
}
|
|
70
|
+
// Version config for each group
|
|
71
|
+
if (nxJson.release.groups) {
|
|
72
|
+
for (const group of Object.values(nxJson.release.groups)) {
|
|
73
|
+
if (group.version) {
|
|
74
|
+
updateProperties(group.version);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// project.json or package.json
|
|
80
|
+
const projects = (0, project_configuration_1.getProjects)(tree);
|
|
81
|
+
for (const project of projects.values()) {
|
|
82
|
+
const projectJsonPath = (0, node_path_1.join)(project.root, 'project.json');
|
|
83
|
+
if (tree.exists(projectJsonPath)) {
|
|
84
|
+
const projectJson = (0, json_1.readJson)(tree, projectJsonPath);
|
|
85
|
+
if (projectJson.release?.version) {
|
|
86
|
+
updateProperties(projectJson.release.version);
|
|
87
|
+
(0, json_1.writeJson)(tree, projectJsonPath, projectJson);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const packageJsonPath = (0, node_path_1.join)(project.root, 'package.json');
|
|
91
|
+
if (tree.exists(packageJsonPath)) {
|
|
92
|
+
const packageJson = (0, json_1.readJson)(tree, packageJsonPath);
|
|
93
|
+
if (packageJson.nx?.release?.version) {
|
|
94
|
+
updateProperties(packageJson.nx.release.version);
|
|
95
|
+
(0, json_1.writeJson)(tree, packageJsonPath, packageJson);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
(0, nx_json_1.updateNxJson)(tree, nxJson);
|
|
100
|
+
await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
|
|
101
|
+
}
|
|
Binary file
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { CreateDependencies,
|
|
1
|
+
import { CreateDependencies, CreateNodesV2 } from '../../project-graph/plugins';
|
|
2
2
|
export declare const name = "nx/js/dependencies-and-lockfile";
|
|
3
3
|
export declare const createNodesV2: CreateNodesV2;
|
|
4
|
-
export declare const createNodes: CreateNodes;
|
|
5
4
|
export declare const createDependencies: CreateDependencies;
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/plugins/js/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/plugins/js/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,kBAAkB,EAIlB,aAAa,EACd,MAAM,6BAA6B,CAAC;AAkBrC,eAAO,MAAM,IAAI,oCAAoC,CAAC;AAStD,eAAO,MAAM,aAAa,EAAE,aAK3B,CAAC;AA8CF,eAAO,MAAM,kBAAkB,EAAE,kBAkDhC,CAAC"}
|
package/src/plugins/js/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createDependencies = exports.
|
|
3
|
+
exports.createDependencies = exports.createNodesV2 = exports.name = void 0;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const perf_hooks_1 = require("perf_hooks");
|
|
@@ -20,41 +20,37 @@ let parsedLockFile = {};
|
|
|
20
20
|
exports.createNodesV2 = [
|
|
21
21
|
(0, globs_1.combineGlobPatterns)(lock_file_1.LOCKFILES),
|
|
22
22
|
(files, _, context) => {
|
|
23
|
-
return (0, plugins_1.createNodesFromFiles)(
|
|
23
|
+
return (0, plugins_1.createNodesFromFiles)(internalCreateNodes, files, _, context);
|
|
24
24
|
},
|
|
25
25
|
];
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (!lockFileNeedsReprocessing(lockFileHash)) {
|
|
45
|
-
const nodes = readCachedParsedLockFile().externalNodes;
|
|
46
|
-
parsedLockFile.externalNodes = nodes;
|
|
47
|
-
return {
|
|
48
|
-
externalNodes: nodes,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
const externalNodes = (0, lock_file_1.getLockFileNodes)(packageManager, lockFileContents, lockFileHash, context);
|
|
52
|
-
parsedLockFile.externalNodes = externalNodes;
|
|
26
|
+
function internalCreateNodes(lockFile, _, context) {
|
|
27
|
+
const pluginConfig = (0, config_1.jsPluginConfig)(context.nxJsonConfiguration);
|
|
28
|
+
if (!pluginConfig.analyzeLockfile) {
|
|
29
|
+
return {};
|
|
30
|
+
}
|
|
31
|
+
const packageManager = (0, package_manager_1.detectPackageManager)(workspace_root_1.workspaceRoot);
|
|
32
|
+
// Only process the correct lockfile
|
|
33
|
+
if (lockFile !== (0, lock_file_1.getLockFileName)(packageManager)) {
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
const lockFilePath = (0, path_1.join)(workspace_root_1.workspaceRoot, lockFile);
|
|
37
|
+
const lockFileContents = packageManager !== 'bun'
|
|
38
|
+
? (0, fs_1.readFileSync)(lockFilePath, 'utf-8')
|
|
39
|
+
: (0, bun_parser_1.readBunLockFile)(lockFilePath);
|
|
40
|
+
const lockFileHash = getLockFileHash(lockFileContents);
|
|
41
|
+
if (!lockFileNeedsReprocessing(lockFileHash)) {
|
|
42
|
+
const nodes = readCachedParsedLockFile().externalNodes;
|
|
43
|
+
parsedLockFile.externalNodes = nodes;
|
|
53
44
|
return {
|
|
54
|
-
externalNodes,
|
|
45
|
+
externalNodes: nodes,
|
|
55
46
|
};
|
|
56
|
-
}
|
|
57
|
-
|
|
47
|
+
}
|
|
48
|
+
const externalNodes = (0, lock_file_1.getLockFileNodes)(packageManager, lockFileContents, lockFileHash, context);
|
|
49
|
+
parsedLockFile.externalNodes = externalNodes;
|
|
50
|
+
return {
|
|
51
|
+
externalNodes,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
58
54
|
const createDependencies = (_, ctx) => {
|
|
59
55
|
const pluginConfig = (0, config_1.jsPluginConfig)(ctx.nxJsonConfiguration);
|
|
60
56
|
const packageManager = (0, package_manager_1.detectPackageManager)(workspace_root_1.workspaceRoot);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* It encapsulates the package manager specific logic and implementation details.
|
|
4
4
|
*/
|
|
5
5
|
import { ProjectGraph, ProjectGraphExternalNode } from '../../../config/project-graph';
|
|
6
|
-
import { CreateDependenciesContext,
|
|
6
|
+
import { CreateDependenciesContext, CreateNodesContextV2 } from '../../../project-graph/plugins';
|
|
7
7
|
import { RawProjectGraphDependency } from '../../../project-graph/project-graph-builder';
|
|
8
8
|
import { PackageJson } from '../../../utils/package-json';
|
|
9
9
|
import { PackageManager } from '../../../utils/package-manager';
|
|
@@ -11,7 +11,7 @@ export declare const LOCKFILES: string[];
|
|
|
11
11
|
/**
|
|
12
12
|
* Parses lock file and maps dependencies and metadata to {@link LockFileGraph}
|
|
13
13
|
*/
|
|
14
|
-
export declare function getLockFileNodes(packageManager: PackageManager, contents: string, lockFileHash: string, context:
|
|
14
|
+
export declare function getLockFileNodes(packageManager: PackageManager, contents: string, lockFileHash: string, context: CreateNodesContextV2): Record<string, ProjectGraphExternalNode>;
|
|
15
15
|
/**
|
|
16
16
|
* Parses lock file and maps dependencies and metadata to {@link LockFileGraph}
|
|
17
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock-file.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/plugins/js/lock-file/lock-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACL,YAAY,EACZ,wBAAwB,EACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,yBAAyB,EACzB,
|
|
1
|
+
{"version":3,"file":"lock-file.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/plugins/js/lock-file/lock-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACL,YAAY,EACZ,wBAAwB,EACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAGzF,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAEL,cAAc,EACf,MAAM,gCAAgC,CAAC;AA8BxC,eAAO,MAAM,SAAS,UAMrB,CAAC;AAQF;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,oBAAoB,GAC5B,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAqC1C;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,yBAAyB,GACjC,yBAAyB,EAAE,CA8B7B;AAED,wBAAgB,cAAc,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAgBtE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,cAAc,GAAG,MAAM,CAiBtE;AAED,wBAAgB,eAAe,CAAC,cAAc,EAAE,cAAc,GAAG,MAAM,CAgCtE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,YAAY,EACnB,cAAc,GAAE,cAAoD,GACnE,MAAM,CA8CR"}
|
|
@@ -227,7 +227,7 @@ class TargetProjectLocator {
|
|
|
227
227
|
this.packagesMetadata ??= (0, packages_1.getWorkspacePackagesMetadata)(this.nodes);
|
|
228
228
|
const maybeDep = this.packagesMetadata.packageToProjectMap[dep];
|
|
229
229
|
const maybeDepMetadata = maybeDep?.data.metadata.js;
|
|
230
|
-
if (!maybeDepMetadata
|
|
230
|
+
if (!maybeDepMetadata) {
|
|
231
231
|
return null;
|
|
232
232
|
}
|
|
233
233
|
const workspaceRegex = /^workspace:/;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loaded-nx-plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/project-graph/plugins/loaded-nx-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAKhE,OAA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AAkB,CAAC,EAAE,CAC5B,OAAO,EAAE,yBAAyB,KAC/B,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;gBAEhB,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,mBAAmB;CAqFtE"}
|
|
@@ -12,18 +12,20 @@ class LoadedNxPlugin {
|
|
|
12
12
|
this.include = pluginDefinition.include;
|
|
13
13
|
this.exclude = pluginDefinition.exclude;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
if (plugin.createNodesV2) {
|
|
15
|
+
const createNodesV2Impl = plugin.createNodesV2 ?? plugin.createNodes;
|
|
16
|
+
if (createNodesV2Impl) {
|
|
19
17
|
this.createNodes = [
|
|
20
|
-
|
|
18
|
+
createNodesV2Impl[0],
|
|
21
19
|
async (configFiles, context) => {
|
|
22
|
-
const result = await
|
|
20
|
+
const result = await createNodesV2Impl[1](configFiles, this.options, context);
|
|
23
21
|
return result.map((r) => [this.name, r[0], r[1]]);
|
|
24
22
|
},
|
|
25
23
|
];
|
|
26
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Wraps the plugin-provided createNodes function to provide performance
|
|
27
|
+
* measurement and error handling.
|
|
28
|
+
*/
|
|
27
29
|
if (this.createNodes) {
|
|
28
30
|
const inner = this.createNodes[1];
|
|
29
31
|
this.createNodes[1] = async (...args) => {
|
|
@@ -3,24 +3,10 @@ import type { ProjectConfiguration } from '../../config/workspace-json-project-j
|
|
|
3
3
|
import type { NxJsonConfiguration } from '../../config/nx-json';
|
|
4
4
|
import type { RawProjectGraphDependency } from '../project-graph-builder';
|
|
5
5
|
import type { TaskResults } from '../../tasks-runner/life-cycle';
|
|
6
|
-
/**
|
|
7
|
-
* Context for {@link CreateNodesFunction}
|
|
8
|
-
*/
|
|
9
|
-
export interface CreateNodesContext extends CreateNodesContextV2 {
|
|
10
|
-
/**
|
|
11
|
-
* The subset of configuration files which match the createNodes pattern
|
|
12
|
-
*/
|
|
13
|
-
readonly configFiles: readonly string[];
|
|
14
|
-
}
|
|
15
6
|
export interface CreateNodesContextV2 {
|
|
16
7
|
readonly nxJsonConfiguration: NxJsonConfiguration;
|
|
17
8
|
readonly workspaceRoot: string;
|
|
18
9
|
}
|
|
19
|
-
/**
|
|
20
|
-
* A function which parses a configuration file into a set of nodes.
|
|
21
|
-
* Used for creating nodes for the {@link ProjectGraph}
|
|
22
|
-
*/
|
|
23
|
-
export type CreateNodesFunction<T = unknown> = (projectConfigurationFile: string, options: T | undefined, context: CreateNodesContext) => CreateNodesResult | Promise<CreateNodesResult>;
|
|
24
10
|
export type CreateNodesResultV2 = Array<readonly [configFileSource: string, result: CreateNodesResult]>;
|
|
25
11
|
export type CreateNodesFunctionV2<T = unknown> = (projectConfigurationFiles: readonly string[], options: T | undefined, context: CreateNodesContextV2) => CreateNodesResultV2 | Promise<CreateNodesResultV2>;
|
|
26
12
|
export type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
@@ -34,23 +20,6 @@ export interface CreateNodesResult {
|
|
|
34
20
|
*/
|
|
35
21
|
externalNodes?: Record<string, ProjectGraphExternalNode>;
|
|
36
22
|
}
|
|
37
|
-
/**
|
|
38
|
-
* A pair of file patterns and {@link CreateNodesFunction}
|
|
39
|
-
*
|
|
40
|
-
* Nx 19.2+: Both original `CreateNodes` and `CreateNodesV2` are supported. Nx will only invoke `CreateNodesV2` if it is present.
|
|
41
|
-
* Nx 21.X : The `CreateNodesV2` will be the only supported API. This typing will still exist, but be identical to `CreateNodesV2`.
|
|
42
|
-
Nx **will not** invoke the original `plugin.createNodes` callback. This should give plugin authors a window to transition.
|
|
43
|
-
Plugin authors should update their plugin's `createNodes` function to align with `CreateNodesV2` / the updated `CreateNodes`.
|
|
44
|
-
The plugin should contain something like: `export createNodes = createNodesV2;` during this period. This will allow the plugin
|
|
45
|
-
to maintain compatibility with Nx 19.2 and up.
|
|
46
|
-
* Nx 22.X : The `CreateNodesV2` typing will be removed, as it has replaced `CreateNodes`.
|
|
47
|
-
*
|
|
48
|
-
* @deprecated Use {@link CreateNodesV2} instead. CreateNodesV2 will replace this API. Read more about the transition above.
|
|
49
|
-
*/
|
|
50
|
-
export type CreateNodes<T = unknown> = readonly [
|
|
51
|
-
projectFilePattern: string,
|
|
52
|
-
createNodesFunction: CreateNodesFunction<T>
|
|
53
|
-
];
|
|
54
23
|
/**
|
|
55
24
|
* A pair of file patterns and {@link CreateNodesFunctionV2}
|
|
56
25
|
* In Nx 21 {@link CreateNodes} will be replaced with this type. In Nx 22, this type will be removed.
|
|
@@ -104,15 +73,11 @@ export type NxPluginV2<TOptions = unknown> = {
|
|
|
104
73
|
/**
|
|
105
74
|
* Provides a file pattern and function that retrieves configuration info from
|
|
106
75
|
* those files. e.g. { '**\/*.csproj': buildProjectsFromCsProjFile }
|
|
107
|
-
*
|
|
108
|
-
* @deprecated Use {@link createNodesV2} instead. In Nx 21 support for calling createNodes with a single file for the first argument will be removed.
|
|
109
76
|
*/
|
|
110
|
-
createNodes?:
|
|
77
|
+
createNodes?: CreateNodesV2<TOptions>;
|
|
111
78
|
/**
|
|
112
79
|
* Provides a file pattern and function that retrieves configuration info from
|
|
113
80
|
* those files. e.g. { '**\/*.csproj': buildProjectsFromCsProjFiles }
|
|
114
|
-
*
|
|
115
|
-
* In Nx 21 {@link createNodes} will be replaced with this property. In Nx 22, this property will be removed.
|
|
116
81
|
*/
|
|
117
82
|
createNodesV2?: CreateNodesV2<TOptions>;
|
|
118
83
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/project-graph/plugins/public-api.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,OAA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,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAClD,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,QAAQ,GAAG,OAAO,IAAI,CAClD,OAAO,EAAE,QAAQ,GAAG,SAAS,EAC7B,OAAO,EAAE,wBAAwB,KAC9B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAC1B,MAAM,MAAM,kBAAkB,CAAC,QAAQ,GAAG,OAAO,IAAI,CACnD,OAAO,EAAE,QAAQ,GAAG,SAAS,EAC7B,OAAO,EAAE,yBAAyB,KAC/B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAC1B;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function createNodesFromFiles<T = unknown>(createNodes: (projectConfigurationFile: string, options: T | undefined, context:
|
|
1
|
+
import { CreateNodesContextV2, CreateNodesResult } from './public-api';
|
|
2
|
+
export declare function createNodesFromFiles<T = unknown>(createNodes: (projectConfigurationFile: string, options: T | undefined, context: CreateNodesContextV2 & {
|
|
3
|
+
configFiles: readonly string[];
|
|
4
|
+
}, idx: number) => CreateNodesResult | Promise<CreateNodesResult>, configFiles: readonly string[], options: T, context: CreateNodesContextV2): Promise<[file: string, value: CreateNodesResult][]>;
|
|
3
5
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/project-graph/plugins/utils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/project-graph/plugins/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEvE,wBAAsB,oBAAoB,CAAC,CAAC,GAAG,OAAO,EACpD,WAAW,EAAE,CACX,wBAAwB,EAAE,MAAM,EAChC,OAAO,EAAE,CAAC,GAAG,SAAS,EACtB,OAAO,EAAE,oBAAoB,GAAG;IAAE,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,EAClE,GAAG,EAAE,MAAM,KACR,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,EACnD,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,OAAO,EAAE,CAAC,EACV,OAAO,EAAE,oBAAoB,uDA8B9B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-legacy-versioning.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/config/use-legacy-versioning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGnE,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,mBAAmB,CAAC,SAAS,CAAC,GAAG,SAAS,WAK1D"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.shouldUseLegacyVersioning = shouldUseLegacyVersioning;
|
|
4
|
-
// TODO(v22): remove this function and entire concept of legacy versioning in v22
|
|
5
|
-
function shouldUseLegacyVersioning(releaseConfig) {
|
|
6
|
-
return process.env.NX_INTERNAL_USE_LEGACY_VERSIONING === 'true'
|
|
7
|
-
? true
|
|
8
|
-
: releaseConfig?.version?.useLegacyVersioning ?? false;
|
|
9
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ProjectGraph } from '../../../config/project-graph';
|
|
2
|
-
import { ReleaseGroupWithName } from '../config/filter-release-groups';
|
|
3
|
-
/**
|
|
4
|
-
* To be most efficient with our invocations of runVersionOnProjects, we want to batch projects by their generator and generator options
|
|
5
|
-
* within any given release group.
|
|
6
|
-
*/
|
|
7
|
-
export declare function batchProjectsByGeneratorConfig(projectGraph: ProjectGraph, releaseGroup: ReleaseGroupWithName, projectNamesToBatch: string[]): Map<string, string[]>;
|
|
8
|
-
//# sourceMappingURL=batch-projects-by-generator-config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"batch-projects-by-generator-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/batch-projects-by-generator-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,oBAAoB,EAClC,mBAAmB,EAAE,MAAM,EAAE,yBAoC9B"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.batchProjectsByGeneratorConfig = batchProjectsByGeneratorConfig;
|
|
4
|
-
const json_diff_1 = require("../../../utils/json-diff");
|
|
5
|
-
/**
|
|
6
|
-
* To be most efficient with our invocations of runVersionOnProjects, we want to batch projects by their generator and generator options
|
|
7
|
-
* within any given release group.
|
|
8
|
-
*/
|
|
9
|
-
function batchProjectsByGeneratorConfig(projectGraph, releaseGroup, projectNamesToBatch) {
|
|
10
|
-
const configBatches = new Map();
|
|
11
|
-
for (const projectName of projectNamesToBatch) {
|
|
12
|
-
const project = projectGraph.nodes[projectName];
|
|
13
|
-
const generator = project.data.release?.version
|
|
14
|
-
?.generator ||
|
|
15
|
-
releaseGroup.version.generator;
|
|
16
|
-
const generatorOptions = {
|
|
17
|
-
...releaseGroup.version
|
|
18
|
-
.generatorOptions,
|
|
19
|
-
...project.data.release?.version
|
|
20
|
-
?.generatorOptions,
|
|
21
|
-
};
|
|
22
|
-
let found = false;
|
|
23
|
-
for (const [key, projects] of configBatches) {
|
|
24
|
-
const [existingGenerator, existingOptions] = JSON.parse(key);
|
|
25
|
-
if (generator === existingGenerator &&
|
|
26
|
-
(0, json_diff_1.deepEquals)(generatorOptions, existingOptions)) {
|
|
27
|
-
projects.push(projectName);
|
|
28
|
-
found = true;
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if (!found) {
|
|
33
|
-
configBatches.set(JSON.stringify([generator, generatorOptions]), [
|
|
34
|
-
projectName,
|
|
35
|
-
]);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return configBatches;
|
|
39
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
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>;
|
|
47
|
-
//# sourceMappingURL=version-legacy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version-legacy.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src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