nx 21.4.0-beta.0 → 21.4.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +2 -0
- package/bin/nx.js +6 -6
- package/bin/post-install.js +8 -22
- package/package.json +12 -11
- package/schemas/nx-schema.json +99 -1
- package/src/adapter/compat.d.ts +2 -2
- package/src/adapter/compat.d.ts.map +1 -1
- package/src/adapter/compat.js +3 -0
- package/src/command-line/graph/graph.d.ts.map +1 -1
- package/src/command-line/graph/graph.js +152 -45
- package/src/command-line/index.d.ts +23 -0
- package/src/command-line/index.d.ts.map +1 -0
- package/src/command-line/index.js +26 -0
- package/src/command-line/init/implementation/add-nx-to-monorepo.d.ts +1 -1
- package/src/command-line/init/implementation/add-nx-to-monorepo.d.ts.map +1 -1
- package/src/command-line/init/implementation/add-nx-to-monorepo.js +2 -2
- package/src/command-line/init/implementation/add-nx-to-npm-repo.d.ts +1 -1
- package/src/command-line/init/implementation/add-nx-to-npm-repo.d.ts.map +1 -1
- package/src/command-line/init/implementation/add-nx-to-npm-repo.js +2 -2
- package/src/command-line/init/implementation/utils.d.ts.map +1 -1
- package/src/command-line/init/implementation/utils.js +2 -7
- package/src/command-line/init/init-v2.d.ts.map +1 -1
- package/src/command-line/init/init-v2.js +41 -23
- package/src/command-line/mcp/command-object.d.ts +3 -0
- package/src/command-line/mcp/command-object.d.ts.map +1 -0
- package/src/command-line/mcp/command-object.js +28 -0
- package/src/command-line/mcp/mcp.d.ts +3 -0
- package/src/command-line/mcp/mcp.d.ts.map +1 -0
- package/src/command-line/mcp/mcp.js +23 -0
- package/src/command-line/migrate/migrate-ui-api.d.ts.map +1 -1
- package/src/command-line/migrate/migrate-ui-api.js +18 -8
- package/src/command-line/nx-cloud/connect/command-object.d.ts.map +1 -1
- package/src/command-line/nx-cloud/connect/command-object.js +2 -1
- package/src/command-line/nx-cloud/connect/connect-to-nx-cloud.d.ts +1 -0
- package/src/command-line/nx-cloud/connect/connect-to-nx-cloud.d.ts.map +1 -1
- package/src/command-line/nx-cloud/connect/connect-to-nx-cloud.js +19 -5
- package/src/command-line/nx-cloud/connect/view-logs.d.ts.map +1 -1
- package/src/command-line/nx-cloud/connect/view-logs.js +3 -5
- package/src/command-line/nx-commands.d.ts.map +1 -1
- package/src/command-line/nx-commands.js +2 -0
- package/src/command-line/release/changelog.d.ts.map +1 -1
- package/src/command-line/release/changelog.js +7 -2
- package/src/command-line/release/command-object.d.ts +7 -2
- package/src/command-line/release/command-object.d.ts.map +1 -1
- package/src/command-line/release/command-object.js +22 -4
- package/src/command-line/release/config/config.d.ts +10 -3
- package/src/command-line/release/config/config.d.ts.map +1 -1
- package/src/command-line/release/config/config.js +127 -15
- package/src/command-line/release/config/filter-release-groups.d.ts +5 -1
- package/src/command-line/release/config/filter-release-groups.d.ts.map +1 -1
- package/src/command-line/release/publish.js +13 -1
- package/src/command-line/release/release.d.ts.map +1 -1
- package/src/command-line/release/release.js +10 -2
- package/src/command-line/release/utils/resolve-nx-json-error-message.js +1 -1
- package/src/command-line/release/utils/shared.d.ts +9 -0
- package/src/command-line/release/utils/shared.d.ts.map +1 -1
- package/src/command-line/release/utils/shared.js +25 -4
- package/src/command-line/release/version/project-logger.d.ts.map +1 -1
- package/src/command-line/release/version/project-logger.js +1 -0
- package/src/command-line/release/version/release-group-processor.d.ts +6 -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 +73 -3
- package/src/command-line/release/version/version-actions.d.ts +21 -0
- package/src/command-line/release/version/version-actions.d.ts.map +1 -1
- package/src/command-line/release/version/version-actions.js +32 -1
- package/src/command-line/release/version.d.ts.map +1 -1
- package/src/command-line/release/version.js +42 -11
- package/src/command-line/sync/sync.d.ts.map +1 -1
- package/src/command-line/sync/sync.js +8 -2
- package/src/config/nx-json.d.ts +58 -0
- package/src/config/nx-json.d.ts.map +1 -1
- package/src/config/workspace-json-project-json.d.ts +2 -1
- package/src/config/workspace-json-project-json.d.ts.map +1 -1
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.css +1 -1
- package/src/core/graph/styles.js +1 -1
- package/src/daemon/server/handle-get-sync-generator-changes.d.ts.map +1 -1
- package/src/daemon/server/handle-get-sync-generator-changes.js +1 -0
- package/src/native/index.d.ts +4 -0
- package/src/native/native-bindings.js +1 -0
- package/src/native/nx.wasi.cjs +12 -10
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts +1 -1
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts.map +1 -1
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +8 -10
- package/src/nx-cloud/utilities/onboarding.d.ts.map +1 -1
- package/src/nx-cloud/utilities/onboarding.js +1 -1
- package/src/nx-cloud/utilities/url-shorten.d.ts +1 -2
- package/src/nx-cloud/utilities/url-shorten.d.ts.map +1 -1
- package/src/nx-cloud/utilities/url-shorten.js +17 -21
- package/src/plugins/js/index.d.ts.map +1 -1
- package/src/plugins/js/index.js +10 -16
- package/src/plugins/js/lock-file/bun-parser.d.ts +15 -0
- package/src/plugins/js/lock-file/bun-parser.d.ts.map +1 -0
- package/src/plugins/js/lock-file/bun-parser.js +964 -0
- 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/lock-file/lock-file.js +40 -17
- package/src/plugins/js/lock-file/npm-parser.js +2 -2
- package/src/plugins/js/lock-file/pnpm-parser.js +2 -1
- package/src/plugins/js/lock-file/project-graph-pruning.d.ts.map +1 -1
- package/src/plugins/js/lock-file/project-graph-pruning.js +3 -1
- package/src/plugins/js/package-json/create-package-json.d.ts.map +1 -1
- package/src/plugins/js/package-json/create-package-json.js +6 -4
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.d.ts.map +1 -1
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +5 -1
- package/src/project-graph/plugins/public-api.d.ts +2 -0
- package/src/project-graph/plugins/public-api.d.ts.map +1 -1
- package/src/project-graph/utils/normalize-project-nodes.d.ts +5 -5
- package/src/project-graph/utils/normalize-project-nodes.d.ts.map +1 -1
- package/src/project-graph/utils/normalize-project-nodes.js +35 -6
- package/src/tasks-runner/is-tui-enabled.d.ts.map +1 -1
- package/src/tasks-runner/is-tui-enabled.js +2 -0
- package/src/tasks-runner/life-cycle.d.ts +2 -0
- package/src/tasks-runner/life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycle.js +7 -0
- package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +15 -6
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +10 -4
- package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.js +5 -2
- package/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +1 -1
- package/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts +1 -1
- package/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/task-history-life-cycle.js +7 -12
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +21 -9
- package/src/tasks-runner/run-command.d.ts.map +1 -1
- package/src/tasks-runner/run-command.js +4 -3
- package/src/tasks-runner/task-orchestrator.d.ts.map +1 -1
- package/src/tasks-runner/task-orchestrator.js +5 -0
- package/src/tasks-runner/tasks-schedule.d.ts +1 -0
- package/src/tasks-runner/tasks-schedule.d.ts.map +1 -1
- package/src/tasks-runner/tasks-schedule.js +3 -0
- package/src/utils/ab-testing.d.ts +4 -4
- package/src/utils/ab-testing.d.ts.map +1 -1
- package/src/utils/ab-testing.js +4 -4
- package/src/utils/git-utils.d.ts +6 -5
- package/src/utils/git-utils.d.ts.map +1 -1
- package/src/utils/git-utils.js +73 -41
- package/src/utils/nx-cloud-utils.d.ts.map +1 -1
- package/src/utils/nx-cloud-utils.js +5 -2
- package/src/utils/sync-generators.d.ts +3 -1
- package/src/utils/sync-generators.d.ts.map +1 -1
- package/src/utils/sync-generators.js +7 -1
@@ -139,9 +139,56 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
139
139
|
(userConfig.projectsRelationship === 'independent' &&
|
140
140
|
!userGroups.some((g) => g.projectsRelationship === 'fixed'));
|
141
141
|
const defaultRendererPath = (0, node_path_1.join)(__dirname, '../../../../release/changelog-renderer');
|
142
|
+
// Helper function to create meaningful docker defaults when user opts in
|
143
|
+
function createDockerDefaults(userDockerConfig) {
|
144
|
+
const defaultVersionSchemes = {
|
145
|
+
production: '{currentDate|YYMM.DD}.{shortCommitSha}',
|
146
|
+
hotfix: '{currentDate|YYMM.DD}.{shortCommitSha}-hotfix',
|
147
|
+
};
|
148
|
+
const defaultPreVersionCommand = 'npx nx run-many -t docker:build';
|
149
|
+
// If user explicitly sets docker: true, apply meaningful defaults
|
150
|
+
if (userDockerConfig === true) {
|
151
|
+
return {
|
152
|
+
preVersionCommand: defaultPreVersionCommand,
|
153
|
+
skipVersionActions: undefined,
|
154
|
+
versionSchemes: defaultVersionSchemes,
|
155
|
+
repositoryName: undefined,
|
156
|
+
registryUrl: undefined,
|
157
|
+
};
|
158
|
+
}
|
159
|
+
// If user provides docker configuration object, merge with base defaults
|
160
|
+
return {
|
161
|
+
preVersionCommand: userDockerConfig.preVersionCommand ?? defaultPreVersionCommand,
|
162
|
+
skipVersionActions: userDockerConfig.skipVersionActions
|
163
|
+
? Array.isArray(userDockerConfig.skipVersionActions)
|
164
|
+
? (0, find_matching_projects_1.findMatchingProjects)(userDockerConfig.skipVersionActions, projectGraph.nodes)
|
165
|
+
: userDockerConfig.skipVersionActions
|
166
|
+
: undefined,
|
167
|
+
versionSchemes: userDockerConfig.versionSchemes ?? defaultVersionSchemes,
|
168
|
+
repositoryName: userDockerConfig.repositoryName,
|
169
|
+
registryUrl: userDockerConfig.registryUrl,
|
170
|
+
};
|
171
|
+
}
|
172
|
+
// Helper function to normalize docker config at group level
|
173
|
+
function normalizeDockerConfig(dockerConfig) {
|
174
|
+
// If user explicitly sets docker: true at group level, apply meaningful defaults
|
175
|
+
if (dockerConfig === true) {
|
176
|
+
return createDockerDefaults(true);
|
177
|
+
}
|
178
|
+
// If user provides docker configuration object at group level, return it
|
179
|
+
if (dockerConfig && typeof dockerConfig === 'object') {
|
180
|
+
return createDockerDefaults(dockerConfig);
|
181
|
+
}
|
182
|
+
// No group-level docker config
|
183
|
+
return undefined;
|
184
|
+
}
|
142
185
|
const WORKSPACE_DEFAULTS = {
|
143
186
|
// By default all projects in all groups are released together
|
144
187
|
projectsRelationship: workspaceProjectsRelationship,
|
188
|
+
// Create docker defaults only if user has explicitly configured it, otherwise undefined
|
189
|
+
docker: userConfig.docker !== undefined
|
190
|
+
? createDockerDefaults(userConfig.docker)
|
191
|
+
: undefined,
|
145
192
|
git: gitDefaults,
|
146
193
|
version: {
|
147
194
|
useLegacyVersioning: USE_LEGACY_VERSIONING,
|
@@ -218,8 +265,16 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
218
265
|
WORKSPACE_DEFAULTS.releaseTagPatternRequireSemver;
|
219
266
|
const groupReleaseTagPatternStrictPreid = userConfig.releaseTagPatternStrictPreid ??
|
220
267
|
defaultReleaseTagPatternStrictPreid;
|
268
|
+
const groupDocker = normalizeDockerConfig(userConfig.docker ?? WORKSPACE_DEFAULTS.docker);
|
221
269
|
const GROUP_DEFAULTS = {
|
222
270
|
projectsRelationship: groupProjectsRelationship,
|
271
|
+
// Only include docker configuration if user has explicitly configured it
|
272
|
+
docker: groupDocker && Object.keys(groupDocker).length > 0
|
273
|
+
? {
|
274
|
+
...groupDocker,
|
275
|
+
groupPreVersionCommand: '',
|
276
|
+
}
|
277
|
+
: undefined,
|
223
278
|
version: USE_LEGACY_VERSIONING
|
224
279
|
? {
|
225
280
|
conventionalCommits: false,
|
@@ -248,7 +303,11 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
248
303
|
releaseTagPattern:
|
249
304
|
// The appropriate group default releaseTagPattern is dependent upon the projectRelationships
|
250
305
|
groupProjectsRelationship === 'independent'
|
251
|
-
?
|
306
|
+
? // If the default pattern contains {projectName} then it will create unique release tags for each project.
|
307
|
+
// Otherwise, use the default value to guarantee unique tags
|
308
|
+
WORKSPACE_DEFAULTS.releaseTagPattern?.includes('{projectName}')
|
309
|
+
? WORKSPACE_DEFAULTS.releaseTagPattern
|
310
|
+
: defaultIndependentReleaseTagPattern
|
252
311
|
: WORKSPACE_DEFAULTS.releaseTagPattern,
|
253
312
|
releaseTagPatternCheckAllBranchesWhen: userConfig.releaseTagPatternCheckAllBranchesWhen ?? undefined,
|
254
313
|
releaseTagPatternRequireSemver: groupReleaseTagPatternRequireSemver,
|
@@ -270,6 +329,10 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
270
329
|
git: userConfig.git,
|
271
330
|
},
|
272
331
|
], userConfig.version);
|
332
|
+
const rootDockerConfig = userConfig.docker && {
|
333
|
+
...normalizeDockerConfig(WORKSPACE_DEFAULTS.docker),
|
334
|
+
...normalizeDockerConfig(userConfig.docker),
|
335
|
+
};
|
273
336
|
if (userConfig.changelog?.workspaceChangelog) {
|
274
337
|
userConfig.changelog.workspaceChangelog = normalizeTrueToEmptyObject(userConfig.changelog.workspaceChangelog);
|
275
338
|
}
|
@@ -309,8 +372,8 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
309
372
|
}
|
310
373
|
if (userConfig.version?.conventionalCommits === false) {
|
311
374
|
delete rootVersionWithoutGlobalOptions.generatorOptions
|
312
|
-
|
313
|
-
delete rootVersionWithoutGlobalOptions.generatorOptions
|
375
|
+
?.currentVersionResolver;
|
376
|
+
delete rootVersionWithoutGlobalOptions.generatorOptions?.specifierSource;
|
314
377
|
delete rootVersionWithoutGlobalOptions
|
315
378
|
.currentVersionResolver;
|
316
379
|
delete rootVersionWithoutGlobalOptions
|
@@ -333,6 +396,8 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
333
396
|
delete rootVersionWithoutGlobalOptions
|
334
397
|
.specifierSource;
|
335
398
|
}
|
399
|
+
const rootDockerWithoutGlobalOptions = { ...rootDockerConfig };
|
400
|
+
delete rootDockerWithoutGlobalOptions.preVersionCommand;
|
336
401
|
const groups = userConfig.groups && Object.keys(userConfig.groups).length
|
337
402
|
? ensureProjectsConfigIsArray(userConfig.groups)
|
338
403
|
: /**
|
@@ -342,6 +407,10 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
342
407
|
{
|
343
408
|
[exports.IMPLICIT_DEFAULT_RELEASE_GROUP]: {
|
344
409
|
projectsRelationship: GROUP_DEFAULTS.projectsRelationship,
|
410
|
+
// Only include docker configuration if user has explicitly configured it
|
411
|
+
docker: Object.keys(rootDockerWithoutGlobalOptions).length > 0
|
412
|
+
? deepMergeDefaults([GROUP_DEFAULTS.docker], rootDockerWithoutGlobalOptions)
|
413
|
+
: undefined,
|
345
414
|
projects: userConfig.projects
|
346
415
|
? // user-defined top level "projects" config takes priority if set
|
347
416
|
(0, find_matching_projects_1.findMatchingProjects)(ensureArray(userConfig.projects), projectGraph.nodes)
|
@@ -414,8 +483,21 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
414
483
|
if (releaseGroup.changelog) {
|
415
484
|
releaseGroup.changelog = normalizeTrueToEmptyObject(releaseGroup.changelog);
|
416
485
|
}
|
486
|
+
const normalizedGroupDockerConfig = normalizeDockerConfig(releaseGroup.docker);
|
487
|
+
// Only include docker configuration if user has explicitly configured it at root or group level
|
488
|
+
const shouldIncludeDockerConfig = Object.keys(rootDockerWithoutGlobalOptions).length > 0 ||
|
489
|
+
normalizedGroupDockerConfig !== undefined;
|
417
490
|
const groupDefaults = {
|
418
491
|
projectsRelationship,
|
492
|
+
// Only include docker configuration if user has explicitly configured it
|
493
|
+
docker: shouldIncludeDockerConfig
|
494
|
+
? {
|
495
|
+
...GROUP_DEFAULTS.docker,
|
496
|
+
...rootDockerWithoutGlobalOptions,
|
497
|
+
groupPreVersionCommand: '',
|
498
|
+
...releaseGroup.docker,
|
499
|
+
}
|
500
|
+
: undefined,
|
419
501
|
projects: matchingProjects,
|
420
502
|
version: deepMergeDefaults(
|
421
503
|
// First apply any group level defaults, then apply actual root level config, then group level config
|
@@ -430,7 +512,11 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
430
512
|
releaseTagPattern: releaseGroup.releaseTagPattern ||
|
431
513
|
// The appropriate group default releaseTagPattern is dependent upon the projectRelationships
|
432
514
|
(projectsRelationship === 'independent'
|
433
|
-
?
|
515
|
+
? // If the default pattern contains {projectName} then it will create unique release tags for each project.
|
516
|
+
// Otherwise, use the default value to guarantee unique tags
|
517
|
+
userConfig.releaseTagPattern?.includes('{projectName}')
|
518
|
+
? userConfig.releaseTagPattern
|
519
|
+
: defaultIndependentReleaseTagPattern
|
434
520
|
: userConfig.releaseTagPattern || defaultFixedReleaseTagPattern),
|
435
521
|
releaseTagPatternCheckAllBranchesWhen: releaseGroup.releaseTagPatternCheckAllBranchesWhen ??
|
436
522
|
userConfig.releaseTagPatternCheckAllBranchesWhen ??
|
@@ -450,6 +536,10 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
450
536
|
});
|
451
537
|
finalReleaseGroup.version =
|
452
538
|
finalReleaseGroup.version;
|
539
|
+
// Clean up docker global options that are not supported at the group level
|
540
|
+
if (finalReleaseGroup.docker) {
|
541
|
+
delete finalReleaseGroup.docker.preVersionCommand;
|
542
|
+
}
|
453
543
|
// Apply conventionalCommits shorthand to the final group if explicitly configured in the original group
|
454
544
|
if (releaseGroup.version?.conventionalCommits === true) {
|
455
545
|
if (USE_LEGACY_VERSIONING) {
|
@@ -501,6 +591,22 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
501
591
|
}
|
502
592
|
releaseGroups[releaseGroupName] = finalReleaseGroup;
|
503
593
|
}
|
594
|
+
// Infer docker-related properties based on project configurations
|
595
|
+
for (const [releaseGroupName, releaseGroup] of Object.entries(releaseGroups)) {
|
596
|
+
const hasDockerProjects = releaseGroup.projects.some((projectName) => {
|
597
|
+
const projectNode = projectGraph.nodes[projectName];
|
598
|
+
// Check if project has meaningful docker config (not just undefined/empty values)
|
599
|
+
const projectDockerConfig = projectNode?.data.release?.docker;
|
600
|
+
const hasProjectDockerConfig = projectDockerConfig !== undefined;
|
601
|
+
// Check if release group has docker config at all (since we now only include it when explicitly configured)
|
602
|
+
const hasGroupDockerConfig = !!releaseGroup.docker;
|
603
|
+
return hasProjectDockerConfig || hasGroupDockerConfig;
|
604
|
+
});
|
605
|
+
if (hasDockerProjects) {
|
606
|
+
// If any project in the group has docker configuration, disable semver requirement
|
607
|
+
releaseGroup.releaseTagPatternRequireSemver = false;
|
608
|
+
}
|
609
|
+
}
|
504
610
|
const configError = validateChangelogConfig(releaseGroups, rootChangelogConfig);
|
505
611
|
if (configError) {
|
506
612
|
return {
|
@@ -512,11 +618,16 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
512
618
|
error: null,
|
513
619
|
nxReleaseConfig: {
|
514
620
|
projectsRelationship: WORKSPACE_DEFAULTS.projectsRelationship,
|
621
|
+
// Only include docker configuration if user has explicitly configured it
|
622
|
+
...(WORKSPACE_DEFAULTS.docker
|
623
|
+
? { docker: WORKSPACE_DEFAULTS.docker }
|
624
|
+
: {}),
|
515
625
|
releaseTagPattern: WORKSPACE_DEFAULTS.releaseTagPattern,
|
516
626
|
releaseTagPatternCheckAllBranchesWhen: WORKSPACE_DEFAULTS.releaseTagPatternCheckAllBranchesWhen,
|
517
627
|
releaseTagPatternRequireSemver: WORKSPACE_DEFAULTS.releaseTagPatternRequireSemver,
|
518
628
|
releaseTagPatternStrictPreid: WORKSPACE_DEFAULTS.releaseTagPatternStrictPreid,
|
519
629
|
git: rootGitConfig,
|
630
|
+
docker: rootDockerConfig,
|
520
631
|
version: rootVersionConfig,
|
521
632
|
changelog: rootChangelogConfig,
|
522
633
|
groups: releaseGroups,
|
@@ -615,6 +726,7 @@ function fillUnspecifiedConventionalCommitsProperties(config) {
|
|
615
726
|
};
|
616
727
|
}
|
617
728
|
async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
729
|
+
const linkMessage = `\nRead more about Nx Release at https://nx.dev/features/manage-releases.`;
|
618
730
|
switch (error.code) {
|
619
731
|
case 'PROJECTS_AND_GROUPS_DEFINED':
|
620
732
|
{
|
@@ -624,7 +736,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
624
736
|
]);
|
625
737
|
output_1.output.error({
|
626
738
|
title: `"projects" is not valid when explicitly defining release groups, and everything should be expressed within "groups" in that case. If you are using "groups" then you should remove the "projects" property`,
|
627
|
-
bodyLines: [nxJsonMessage],
|
739
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
628
740
|
});
|
629
741
|
}
|
630
742
|
break;
|
@@ -636,7 +748,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
636
748
|
]);
|
637
749
|
output_1.output.error({
|
638
750
|
title: `Release group "${error.data.releaseGroupName}" matches no projects. Please ensure all release groups match at least one project:`,
|
639
|
-
bodyLines: [nxJsonMessage],
|
751
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
640
752
|
});
|
641
753
|
}
|
642
754
|
break;
|
@@ -648,7 +760,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
648
760
|
]);
|
649
761
|
output_1.output.error({
|
650
762
|
title: `Project "${error.data.project}" matches multiple release groups. Please ensure all projects are part of only one release group:`,
|
651
|
-
bodyLines: [nxJsonMessage],
|
763
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
652
764
|
});
|
653
765
|
}
|
654
766
|
break;
|
@@ -662,7 +774,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
662
774
|
]);
|
663
775
|
output_1.output.error({
|
664
776
|
title: `Release group "${error.data.releaseGroupName}" has an invalid releaseTagPattern. Please ensure the pattern contains exactly one instance of the "{version}" placeholder`,
|
665
|
-
bodyLines: [nxJsonMessage],
|
777
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
666
778
|
});
|
667
779
|
}
|
668
780
|
break;
|
@@ -676,7 +788,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
676
788
|
: 'configuration options';
|
677
789
|
output_1.output.error({
|
678
790
|
title: `You have configured both the shorthand "version.conventionalCommits" and one or more of the related ${text} that it sets for you. Please use one or the other:`,
|
679
|
-
bodyLines: [nxJsonMessage],
|
791
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
680
792
|
});
|
681
793
|
}
|
682
794
|
break;
|
@@ -688,7 +800,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
688
800
|
]);
|
689
801
|
output_1.output.error({
|
690
802
|
title: `You have duplicate conflicting git configurations. If you are using the top level 'nx release' command, then remove the 'release.version.git' and 'release.changelog.git' properties in favor of 'release.git'. If you are using the subcommands or the programmatic API, then remove the 'release.git' property in favor of 'release.version.git' and 'release.changelog.git':`,
|
691
|
-
bodyLines: [nxJsonMessage],
|
803
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
692
804
|
});
|
693
805
|
}
|
694
806
|
break;
|
@@ -696,7 +808,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
696
808
|
const nxJsonMessage = await (0, resolve_nx_json_error_message_1.resolveNxJsonConfigErrorMessage)(['release']);
|
697
809
|
output_1.output.error({
|
698
810
|
title: `There was an error when resolving the configured changelog renderer at path: ${error.data.workspaceRelativePath}`,
|
699
|
-
bodyLines: [nxJsonMessage],
|
811
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
700
812
|
});
|
701
813
|
break;
|
702
814
|
}
|
@@ -709,7 +821,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
709
821
|
title: `Your "changelog.createRelease" config specifies an unsupported provider "${error.data.provider}". The supported providers are ${error.data.supportedProviders
|
710
822
|
.map((p) => `"${p}"`)
|
711
823
|
.join(', ')}`,
|
712
|
-
bodyLines: [nxJsonMessage],
|
824
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
713
825
|
});
|
714
826
|
}
|
715
827
|
break;
|
@@ -720,7 +832,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
720
832
|
]);
|
721
833
|
output_1.output.error({
|
722
834
|
title: `Your "changelog.createRelease" config specifies an invalid hostname "${error.data.hostname}". Please ensure you provide a valid hostname value, such as "example.com"`,
|
723
|
-
bodyLines: [nxJsonMessage],
|
835
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
724
836
|
});
|
725
837
|
}
|
726
838
|
break;
|
@@ -731,7 +843,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
731
843
|
]);
|
732
844
|
output_1.output.error({
|
733
845
|
title: `Your "changelog.createRelease" config specifies an invalid apiBaseUrl "${error.data.apiBaseUrl}". Please ensure you provide a valid URL value, such as "https://example.com"`,
|
734
|
-
bodyLines: [nxJsonMessage],
|
846
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
735
847
|
});
|
736
848
|
}
|
737
849
|
break;
|
@@ -742,7 +854,7 @@ async function handleNxReleaseConfigError(error, useLegacyVersioning) {
|
|
742
854
|
]);
|
743
855
|
output_1.output.error({
|
744
856
|
title: `The createRelease option for changelogs cannot be enabled when git push is explicitly disabled because the commit needs to be pushed to the remote in order to tie the release to it`,
|
745
|
-
bodyLines: [nxJsonMessage],
|
857
|
+
bodyLines: [nxJsonMessage, linkMessage],
|
746
858
|
});
|
747
859
|
}
|
748
860
|
break;
|
@@ -1,9 +1,13 @@
|
|
1
1
|
import { ProjectGraph } from '../../../config/project-graph';
|
2
2
|
import { NxReleaseConfig } from './config';
|
3
3
|
import { GroupVersionPlan, ProjectsVersionPlan } from './version-plans';
|
4
|
-
|
4
|
+
import { NxReleaseDockerConfiguration } from '../../../config/nx-json';
|
5
|
+
export type ReleaseGroupWithName = Omit<NxReleaseConfig['groups'][string], 'docker'> & {
|
5
6
|
name: string;
|
6
7
|
resolvedVersionPlans: (ProjectsVersionPlan | GroupVersionPlan)[] | false;
|
8
|
+
docker?: NxReleaseDockerConfiguration & {
|
9
|
+
groupPreVersionCommand?: string;
|
10
|
+
};
|
7
11
|
};
|
8
12
|
export declare function filterReleaseGroups(projectGraph: ProjectGraph, nxReleaseConfig: NxReleaseConfig, projectsFilter?: string[], groupsFilter?: string[]): {
|
9
13
|
error: null | {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"filter-release-groups.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/config/filter-release-groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EAAkC,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"filter-release-groups.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/config/filter-release-groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EAAkC,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAEvE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,eAAe,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,EACjC,QAAQ,CACT,GAAG;IACF,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB,EAAE,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,EAAE,GAAG,KAAK,CAAC;IACzE,MAAM,CAAC,EAAE,4BAA4B,GAAG;QAAE,sBAAsB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7E,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,EAChC,cAAc,CAAC,EAAE,MAAM,EAAE,EACzB,YAAY,CAAC,EAAE,MAAM,EAAE,GACtB;IACD,KAAK,EAAE,IAAI,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACtD,SAAS,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,EAAE,CAAC;KACrB,GAAG,IAAI,CAAC;IACT,aAAa,EAAE,oBAAoB,EAAE,CAAC;IACtC,8BAA8B,EAAE,GAAG,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;CACxE,CAgMA"}
|
@@ -133,6 +133,14 @@ async function runPublishOnProjects(args, projectGraph, nxJson, projectNames, ex
|
|
133
133
|
if (args.firstRelease) {
|
134
134
|
overrides.firstRelease = args.firstRelease;
|
135
135
|
}
|
136
|
+
/**
|
137
|
+
* If using the `nx release` command, or possibly via the programmatic API, versionData will be passed through from the version subcommand.
|
138
|
+
* Provide it automatically to the publish executor options with a clear namespace to avoid userland conflicts.
|
139
|
+
* It will be filtered out of the final terminal output lifecycle to avoid cluttering the terminal.
|
140
|
+
*/
|
141
|
+
if (args.versionData) {
|
142
|
+
overrides.nxReleaseVersionData = args.versionData;
|
143
|
+
}
|
136
144
|
const requiredTargetName = 'nx-release-publish';
|
137
145
|
if (args.graph) {
|
138
146
|
const file = (0, command_line_utils_1.readGraphFileFromGraphArg)(args);
|
@@ -155,12 +163,15 @@ async function runPublishOnProjects(args, projectGraph, nxJson, projectNames, ex
|
|
155
163
|
throw new Error(`Based on your config, the following projects were matched for publishing but do not have the "${requiredTargetName}" target specified:\n${[
|
156
164
|
...projectsToRun.map((p) => `- ${p.name}`),
|
157
165
|
'',
|
158
|
-
`This is usually caused by
|
166
|
+
`This is usually caused by either`,
|
167
|
+
`- not having an appropriate plugin, such as "@nx/js" installed, which will add the appropriate "${requiredTargetName}" target for you automatically`,
|
168
|
+
`- having "private": true set in your package.json, which prevents the target from being created`,
|
159
169
|
].join('\n')}\n`);
|
160
170
|
}
|
161
171
|
await (0, tasks_execution_hooks_1.runPreTasksExecution)({
|
162
172
|
workspaceRoot: workspace_root_1.workspaceRoot,
|
163
173
|
nxJsonConfiguration: nxJson,
|
174
|
+
argv: process.argv,
|
164
175
|
});
|
165
176
|
/**
|
166
177
|
* Run the relevant nx-release-publish executor on each of the selected projects.
|
@@ -184,6 +195,7 @@ async function runPublishOnProjects(args, projectGraph, nxJson, projectNames, ex
|
|
184
195
|
taskResults,
|
185
196
|
workspaceRoot: workspace_root_1.workspaceRoot,
|
186
197
|
nxJsonConfiguration: nxJson,
|
198
|
+
argv: process.argv,
|
187
199
|
});
|
188
200
|
return publishProjectsResult;
|
189
201
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/release.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AAM1E,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAyBlE,OAAO,EACL,sBAAsB,EAEvB,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,iBAAiB,GAAI,MAAM,cAAc,oBACC,CAAC;AAExD,wBAAgB,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,IAMnE,MAAM,cAAc,KACnB,OAAO,CAAC,sBAAsB,GAAG,MAAM,CAAC,
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/release.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AAM1E,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAyBlE,OAAO,EACL,sBAAsB,EAEvB,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,iBAAiB,GAAI,MAAM,cAAc,oBACC,CAAC;AAExD,wBAAgB,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,IAMnE,MAAM,cAAc,KACnB,OAAO,CAAC,sBAAsB,GAAG,MAAM,CAAC,CAqV5C"}
|
@@ -225,7 +225,12 @@ function createAPI(overrideReleaseConfig) {
|
|
225
225
|
let hasNewVersion = false;
|
226
226
|
// null means that all projects are versioned together but there were no changes
|
227
227
|
if (versionResult.workspaceVersion !== null) {
|
228
|
-
hasNewVersion = Object.values(versionResult.projectsVersionData).some((version) =>
|
228
|
+
hasNewVersion = Object.values(versionResult.projectsVersionData).some((version) =>
|
229
|
+
/**
|
230
|
+
* There is a scenario where applications will not have a newVersion created by VerisonActions,
|
231
|
+
* however, there will still be a dockerVersion created from the docker release.
|
232
|
+
*/
|
233
|
+
version.newVersion !== null || version.dockerVersion !== null);
|
229
234
|
}
|
230
235
|
let shouldPublish = !!args.yes && !args.skipPublish && hasNewVersion;
|
231
236
|
const shouldPromptPublishing = !args.yes && !args.skipPublish && !args.dryRun && hasNewVersion;
|
@@ -233,7 +238,10 @@ function createAPI(overrideReleaseConfig) {
|
|
233
238
|
shouldPublish = await promptForPublish();
|
234
239
|
}
|
235
240
|
if (shouldPublish) {
|
236
|
-
const publishResults = await releasePublish(
|
241
|
+
const publishResults = await releasePublish({
|
242
|
+
...args,
|
243
|
+
versionData: versionResult.projectsVersionData,
|
244
|
+
});
|
237
245
|
const allExitOk = Object.values(publishResults).every((result) => result.code === 0);
|
238
246
|
if (!allExitOk) {
|
239
247
|
// When a publish target fails, we want to fail the nx release CLI
|
@@ -14,7 +14,7 @@ async function resolveNxJsonConfigErrorMessage(propPath) {
|
|
14
14
|
? `, line ${errorLines.startLine}`
|
15
15
|
: `, lines ${errorLines.startLine}-${errorLines.endLine}`;
|
16
16
|
}
|
17
|
-
return nxJsonMessage;
|
17
|
+
return nxJsonMessage + '.';
|
18
18
|
}
|
19
19
|
async function getJsonConfigLinesForErrorMessage(rawConfig, jsonPath) {
|
20
20
|
try {
|
@@ -10,6 +10,11 @@ export interface VersionDataEntry {
|
|
10
10
|
* e.g. when using conventional commits
|
11
11
|
*/
|
12
12
|
newVersion: string | null;
|
13
|
+
/**
|
14
|
+
* dockerVersion will be populated if the project is a docker project and has been
|
15
|
+
* included within this release.
|
16
|
+
*/
|
17
|
+
dockerVersion?: string;
|
13
18
|
/**
|
14
19
|
* The list of projects which depend upon the current project.
|
15
20
|
*/
|
@@ -43,6 +48,10 @@ export declare function commitChanges({ changedFiles, deletedFiles, isDryRun, is
|
|
43
48
|
gitCommitArgs?: string | string[];
|
44
49
|
}): Promise<void>;
|
45
50
|
export declare function createCommitMessageValues(releaseGroups: ReleaseGroupWithName[], releaseGroupToFilteredProjects: Map<ReleaseGroupWithName, Set<string>>, versionData: VersionData, commitMessage: string): string[];
|
51
|
+
export declare function shouldPreferDockerVersionForReleaseGroup(releaseGroup: ReleaseGroupWithName): boolean;
|
52
|
+
export declare function shouldSkipVersionActions(dockerOptions: {
|
53
|
+
skipVersionActions?: string[] | boolean;
|
54
|
+
}, projectName: string): boolean;
|
46
55
|
export declare function createGitTagValues(releaseGroups: ReleaseGroupWithName[], releaseGroupToFilteredProjects: Map<ReleaseGroupWithName, Set<string>>, versionData: VersionData): string[];
|
47
56
|
export declare function handleDuplicateGitTags(gitTagValues: string[]): void;
|
48
57
|
export declare function getCommitsRelevantToProjects(projectGraph: ProjectGraph, commits: GitCommit[], projects: string[]): Promise<GitCommit[]>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/shared.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAI7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAErD,eAAO,MAAM,wBAAwB,QAEpC,CAAC;AAGF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;OAEG;IACH,iBAAiB,EAAE;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,oBAAoB,EAAE,MAAM,CAAC;QAC7B,cAAc,EAAE,MAAM,CAAC;KACxB,EAAE,CAAC;CACL;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED,qBAAa,cAAc;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;gBAEV,EACV,OAAO,EAAE,qEAAqE;IAC9E,iBAAiB,EAAE,8EAA8E;IACjG,WAAW,GACZ,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;CAQF;AAED,wBAAsB,aAAa,CAAC,EAClC,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,aAAa,GACd,EAAE;IACD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACnC,iBAsBA;AAED,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,oBAAoB,EAAE,EACrC,8BAA8B,EAAE,GAAG,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,EACtE,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,MAAM,GACpB,MAAM,EAAE,CA0GV;AAcD,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,oBAAoB,EAAE,EACrC,8BAA8B,EAAE,GAAG,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,EACtE,WAAW,EAAE,WAAW,GACvB,MAAM,EAAE,
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/shared.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAI7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAErD,eAAO,MAAM,wBAAwB,QAEpC,CAAC;AAGF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,iB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aAAa,EAAE;IAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;CAAE,EAC1D,WAAW,EAAE,MAAM,GAClB,OAAO,CAOT;AAED,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,oBAAoB,EAAE,EACrC,8BAA8B,EAAE,GAAG,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,EACtE,WAAW,EAAE,WAAW,GACvB,MAAM,EAAE,CAiDV;AAeD,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,CAcnE;AAED,wBAAsB,4BAA4B,CAChD,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,SAAS,EAAE,EACpB,QAAQ,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,SAAS,EAAE,CAAC,CAwBtB"}
|
@@ -4,6 +4,8 @@ exports.ReleaseVersion = exports.noDiffInChangelogMessage = void 0;
|
|
4
4
|
exports.isPrerelease = isPrerelease;
|
5
5
|
exports.commitChanges = commitChanges;
|
6
6
|
exports.createCommitMessageValues = createCommitMessageValues;
|
7
|
+
exports.shouldPreferDockerVersionForReleaseGroup = shouldPreferDockerVersionForReleaseGroup;
|
8
|
+
exports.shouldSkipVersionActions = shouldSkipVersionActions;
|
7
9
|
exports.createGitTagValues = createGitTagValues;
|
8
10
|
exports.handleDuplicateGitTags = handleDuplicateGitTags;
|
9
11
|
exports.getCommitsRelevantToProjects = getCommitsRelevantToProjects;
|
@@ -156,6 +158,17 @@ function stripPlaceholders(str, placeholders) {
|
|
156
158
|
}
|
157
159
|
return str;
|
158
160
|
}
|
161
|
+
function shouldPreferDockerVersionForReleaseGroup(releaseGroup) {
|
162
|
+
// The inference was already done in the config phase, so if docker projects exist,
|
163
|
+
// releaseTagPatternRequireSemver would be false
|
164
|
+
return !releaseGroup.releaseTagPatternRequireSemver;
|
165
|
+
}
|
166
|
+
function shouldSkipVersionActions(dockerOptions, projectName) {
|
167
|
+
return (dockerOptions.skipVersionActions === true ||
|
168
|
+
(Array.isArray(dockerOptions.skipVersionActions) &&
|
169
|
+
// skipVersionActions as string[] already normalized to matching projects in config.ts
|
170
|
+
dockerOptions.skipVersionActions.includes(projectName)));
|
171
|
+
}
|
159
172
|
function createGitTagValues(releaseGroups, releaseGroupToFilteredProjects, versionData) {
|
160
173
|
const tags = [];
|
161
174
|
for (const releaseGroup of releaseGroups) {
|
@@ -164,9 +177,13 @@ function createGitTagValues(releaseGroups, releaseGroupToFilteredProjects, versi
|
|
164
177
|
if (releaseGroup.projectsRelationship === 'independent') {
|
165
178
|
for (const project of releaseGroupProjectNames) {
|
166
179
|
const projectVersionData = versionData[project];
|
167
|
-
if (projectVersionData.newVersion !== null
|
180
|
+
if (projectVersionData.newVersion !== null ||
|
181
|
+
projectVersionData.dockerVersion !== null) {
|
182
|
+
const preferDockerVersion = shouldPreferDockerVersionForReleaseGroup(releaseGroup);
|
168
183
|
tags.push((0, utils_1.interpolate)(releaseGroup.releaseTagPattern, {
|
169
|
-
version:
|
184
|
+
version: preferDockerVersion
|
185
|
+
? projectVersionData.dockerVersion
|
186
|
+
: projectVersionData.newVersion,
|
170
187
|
projectName: project,
|
171
188
|
}));
|
172
189
|
}
|
@@ -175,9 +192,13 @@ function createGitTagValues(releaseGroups, releaseGroupToFilteredProjects, versi
|
|
175
192
|
}
|
176
193
|
// For fixed groups we want one tag for the overall group
|
177
194
|
const projectVersionData = versionData[releaseGroupProjectNames[0]]; // all at the same version, so we can just pick the first one
|
178
|
-
if (projectVersionData.newVersion !== null
|
195
|
+
if (projectVersionData.newVersion !== null ||
|
196
|
+
projectVersionData.dockerVersion !== null) {
|
197
|
+
const preferDockerVersion = shouldPreferDockerVersionForReleaseGroup(releaseGroup);
|
179
198
|
tags.push((0, utils_1.interpolate)(releaseGroup.releaseTagPattern, {
|
180
|
-
version:
|
199
|
+
version: preferDockerVersion
|
200
|
+
? projectVersionData.dockerVersion
|
201
|
+
: projectVersionData.newVersion,
|
181
202
|
releaseGroupName: releaseGroup.name,
|
182
203
|
}));
|
183
204
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"project-logger.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/version/project-logger.ts"],"names":[],"mappings":"AA0BA,qBAAa,aAAa;IAIZ,OAAO,CAAC,WAAW;IAH/B,OAAO,CAAC,IAAI,CAAgB;IAC5B,OAAO,CAAC,KAAK,CAA0B;gBAEnB,WAAW,EAAE,MAAM;IAIvC,MAAM,CAAC,GAAG,EAAE,MAAM;IAIlB,KAAK;
|
1
|
+
{"version":3,"file":"project-logger.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/version/project-logger.ts"],"names":[],"mappings":"AA0BA,qBAAa,aAAa;IAIZ,OAAO,CAAC,WAAW;IAH/B,OAAO,CAAC,IAAI,CAAgB;IAC5B,OAAO,CAAC,KAAK,CAA0B;gBAEnB,WAAW,EAAE,MAAM;IAIvC,MAAM,CAAC,GAAG,EAAE,MAAM;IAIlB,KAAK;CAcN"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ManifestRootToUpdate, NxReleaseVersionConfiguration } from '../../../config/nx-json';
|
1
|
+
import { ManifestRootToUpdate, NxReleaseDockerConfiguration, NxReleaseVersionConfiguration } from '../../../config/nx-json';
|
2
2
|
import { ProjectGraph } from '../../../config/project-graph';
|
3
3
|
import { Tree } from '../../../generators/tree';
|
4
4
|
import { type NxReleaseConfig } from '../config/config';
|
@@ -18,6 +18,9 @@ export interface FinalConfigForProject {
|
|
18
18
|
preserveLocalDependencyProtocols: NxReleaseVersionConfiguration['preserveLocalDependencyProtocols'];
|
19
19
|
versionActionsOptions: NxReleaseVersionConfiguration['versionActionsOptions'];
|
20
20
|
manifestRootsToUpdate: Array<Exclude<ManifestRootToUpdate, string>>;
|
21
|
+
dockerOptions: NxReleaseDockerConfiguration & {
|
22
|
+
groupPreVersionCommand?: string;
|
23
|
+
};
|
21
24
|
}
|
22
25
|
export declare const BUMP_TYPE_REASON_TEXT: {
|
23
26
|
readonly DEPENDENCY_WAS_BUMPED: ", because a dependency was bumped, ";
|
@@ -27,6 +30,7 @@ export declare const BUMP_TYPE_REASON_TEXT: {
|
|
27
30
|
readonly VERSION_PLANS: ", read from version plan {versionPlanPath}, ";
|
28
31
|
readonly DEPENDENCY_ACROSS_GROUPS_WAS_BUMPED: ", because a dependency project belonging to another release group was bumped, ";
|
29
32
|
readonly OTHER_PROJECT_IN_FIXED_GROUP_WAS_BUMPED_DUE_TO_DEPENDENCY: ", because of a dependency-only bump to another project in the same fixed release group, ";
|
33
|
+
readonly NOOP_VERSION_ACTIONS: ", because this project uses docker and has been configured to skip VersionActions, ";
|
30
34
|
};
|
31
35
|
interface ReleaseGroupProcessorOptions {
|
32
36
|
dryRun: boolean;
|
@@ -213,6 +217,7 @@ export declare class ReleaseGroupProcessor {
|
|
213
217
|
changedFiles: string[];
|
214
218
|
deletedFiles: string[];
|
215
219
|
}>;
|
220
|
+
processDockerProjects(dockerVersionScheme?: string, dockerVersion?: string): Promise<void>;
|
216
221
|
private processGroup;
|
217
222
|
private propagateChangesToDependentGroups;
|
218
223
|
private bumpVersions;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"release-group-processor.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/version/release-group-processor.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,6BAA6B,EAC9B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,YAAY,EAEb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;
|
1
|
+
{"version":3,"file":"release-group-processor.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/version/release-group-processor.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC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