nx 21.3.0-rc.0 → 21.3.1

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.
@@ -198,7 +198,12 @@ class ReleaseGroupProcessor {
198
198
  if (finalConfigForProject.currentVersionResolver === 'git-tag') {
199
199
  latestMatchingGitTag = await (0, git_1.getLatestGitTagForPattern)(releaseTagPattern, {
200
200
  projectName: projectGraphNode.name,
201
- }, releaseGroupNode.group.releaseTagPatternCheckAllBranchesWhen, releaseGroupNode.group.releaseTagPatternRequireSemver);
201
+ }, {
202
+ checkAllBranchesWhen: releaseGroupNode.group.releaseTagPatternCheckAllBranchesWhen,
203
+ preid: this.options.preid,
204
+ releaseTagPatternRequireSemver: releaseGroupNode.group.releaseTagPatternRequireSemver,
205
+ releaseTagPatternStrictPreid: releaseGroupNode.group.releaseTagPatternStrictPreid,
206
+ });
202
207
  this.cachedLatestMatchingGitTag.set(projectName, latestMatchingGitTag);
203
208
  }
204
209
  // Cache the current version for the project
@@ -349,6 +349,26 @@ export interface NxReleaseConfiguration {
349
349
  * - Setting this to false will cause us to not use semver to match the version allowing for non-semver versions
350
350
  */
351
351
  releaseTagPatternRequireSemver?: boolean;
352
+ /**
353
+ * When set to true and multiple tags match your configured "releaseTagPattern", the git tag matching logic will strictly prefer the tag which contain a semver preid which matches the one
354
+ * given to the nx release invocation.
355
+ *
356
+ * For example, let's say your "releaseTagPattern" is "{projectName}@{version}" and you have the following tags for project "my-lib", which uses semver:
357
+ * - my-lib@1.2.4-beta.1
358
+ * - my-lib@1.2.4-alpha.1
359
+ * - my-lib@1.2.3
360
+ *
361
+ * If "releaseTagPatternStrictPreid" is set to true and you run:
362
+ * - `nx release --preid beta`, the git tag "my-lib@1.2.4-beta.1" will be resolved.
363
+ * - `nx release --preid alpha`, the git tag "my-lib@1.2.4-alpha.1" will be resolved.
364
+ * - `nx release` (no preid), the git tag "my-lib@1.2.3" will be resolved.
365
+ *
366
+ * If "releaseTagPatternStrictPreid" is set to false, the git tag "my-lib@1.2.4-beta.1" will always be resolved as the latest tag that matches the pattern,
367
+ * regardless of any preid which gets passed to nx release.
368
+ *
369
+ * NOTE: This feature was added in a minor version and is therefore set to false by default, but this may change in a future major version.
370
+ */
371
+ releaseTagPatternStrictPreid?: boolean;
352
372
  /**
353
373
  * Enables using version plans as a specifier source for versioning and
354
374
  * to determine changes for changelog generation.
@@ -424,6 +444,26 @@ export interface NxReleaseConfiguration {
424
444
  * - Setting this to false will cause us to not use semver to match the version allowing for non-semver versions
425
445
  */
426
446
  releaseTagPatternRequireSemver?: boolean;
447
+ /**
448
+ * When set to true and multiple tags match your configured "releaseTagPattern", the git tag matching logic will strictly prefer the tag which contain a semver preid which matches the one
449
+ * given to the nx release invocation.
450
+ *
451
+ * For example, let's say your "releaseTagPattern" is "{projectName}@{version}" and you have the following tags for project "my-lib", which uses semver:
452
+ * - my-lib@1.2.4-beta.1
453
+ * - my-lib@1.2.4-alpha.1
454
+ * - my-lib@1.2.3
455
+ *
456
+ * If "releaseTagPatternStrictPreid" is set to true and you run:
457
+ * - `nx release --preid beta`, the git tag "my-lib@1.2.4-beta.1" will be resolved.
458
+ * - `nx release --preid alpha`, the git tag "my-lib@1.2.4-alpha.1" will be resolved.
459
+ * - `nx release` (no preid), the git tag "my-lib@1.2.3" will be resolved.
460
+ *
461
+ * If "releaseTagPatternStrictPreid" is set to false, the git tag "my-lib@1.2.4-beta.1" will always be resolved as the latest tag that matches the pattern,
462
+ * regardless of any preid which gets passed to nx release.
463
+ *
464
+ * NOTE: This feature was added in a minor version and is therefore set to false by default, but this may change in a future major version.
465
+ */
466
+ releaseTagPatternStrictPreid?: boolean;
427
467
  /**
428
468
  * Enable and configure automatic git operations as part of the release
429
469
  */