git-semver-tagger 2.5.0 → 2.5.2

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.
@@ -0,0 +1,12 @@
1
+ Calculate the next semantic version from Git history and commit annotations.
2
+
3
+ When `calculate-version` outputs a version ending in `-SNAPSHOT`, one or more conditions prevent a release version:
4
+
5
+ | Reason | Remediation |
6
+ |---------------------------------------------------------|------------------------------------------------------------------------|
7
+ | `FORCED` — Snapshot forced via `--force-snapshot` flag | Remove `--force-snapshot` flag when ready for release |
8
+ | `DIRTY` — Uncommitted changes in working directory | Commit or stash changes before tagging |
9
+ | `AHEAD` — Local branch ahead of remote | Push changes before tagging |
10
+ | `BEHIND` — Local branch behind remote | Pull changes before tagging |
11
+ | `NOT_RELEASE_BRANCH` — Not on configured release branch | Switch to release branch before tagging (default: main) |
12
+ | `NO_NEW_VERSION` — No new commits since last tag | Add commits with version annotations (`[major]`, `[minor]`, `[patch]`) |
@@ -0,0 +1,12 @@
1
+ Create and push an annotated Git tag at the specified version.
2
+
3
+ Tagger uses a two-step workflow to separate version calculation from tagging:
4
+
5
+ 1. Run `tagger calculate-version` to compute the next version and check snapshot conditions.
6
+ 2. Review the output. If it's a release version (no -SNAPSHOT suffix), use that version here.
7
+
8
+ The `--version` flag is **required**. Typically, you pass the version from calculate-version output.
9
+
10
+ You can manually override the calculated version when needed (for example, to correct a versioning mistake or handle an
11
+ exceptional release). When overriding, ensure the version adheres to semantic versioning and follows your project's
12
+ tagging policy.
@@ -0,0 +1,35 @@
1
+ Display the Tagger fit assessment and workflow guide.
2
+
3
+ ## Use Tagger when:
4
+
5
+ - You want deterministic versioning behavior from Git history
6
+ - You're willing to use Git tags as version source-of-truth
7
+ - You can enforce CI prerequisites consistently (full history, tags, branch context)
8
+
9
+ ## Do not use Tagger when:
10
+
11
+ - You want version truth from an artifact repository or build metadata instead of Git tags
12
+ - You need multi-stream version lines as a first-class workflow
13
+ - You want a single atomic command to orchestrate the entire release lifecycle
14
+ - You are not willing to enforce Git/CI prerequisites
15
+
16
+ ## Best Practices
17
+
18
+ **Do:** Keep version decisions explicit and reversible. Calculate first, review output, then tag.
19
+
20
+ **Don't:** Override calculated versions casually without understanding why the calculation differs.
21
+
22
+ **Don't:** Skip CI prerequisites (full history, branch context) to "make it work" in your pipeline.
23
+
24
+ ## Workflow Philosophy
25
+
26
+ - Version numbers live on annotated Git tags.
27
+ - Commit content determines the next version.
28
+ - Releases should be created on a release branch.
29
+ - Version calculation happens separately from release (`calculate-version` → review → `tag`).
30
+ - Configuration lives in code and is governed the same way.
31
+
32
+ ---
33
+
34
+ For more details on Tagger principles, tradeoffs, and evaluation criteria:
35
+ <https://github.com/robertfmurdock/ze-great-tools/blob/main/docs/why-tagger.md>
@@ -0,0 +1,13 @@
1
+ Tagger calculates semantic versions from Git history and enforces the tagging policy.
2
+ Version numbers live on Git tags. Commit content determines the next version.
3
+
4
+ Typical CI/build script usage:
5
+
6
+ ```bash
7
+ VERSION=$(tagger calculate-version)
8
+ ./your-build-script.sh version=$VERSION
9
+ tagger tag --version $VERSION
10
+ ```
11
+
12
+ Use `--format=json` for machine-readable output. Build with the calculated version before tagging.
13
+ For fit assessment and philosophy: tagger guide
@@ -58,12 +58,6 @@ if (typeof Math.log10 === 'undefined') {
58
58
  return Math.log(x) * Math.LOG10E;
59
59
  };
60
60
  }
61
- if (typeof String.prototype.startsWith === 'undefined') {
62
- Object.defineProperty(String.prototype, 'startsWith', {value: function (searchString, position) {
63
- position = position || 0;
64
- return this.lastIndexOf(searchString, position) === position;
65
- }});
66
- }
67
61
  if (typeof String.prototype.endsWith === 'undefined') {
68
62
  Object.defineProperty(String.prototype, 'endsWith', {value: function (searchString, position) {
69
63
  var subjectString = this.toString();
@@ -75,6 +69,12 @@ if (typeof String.prototype.endsWith === 'undefined') {
75
69
  return lastIndex !== -1 && lastIndex === position;
76
70
  }});
77
71
  }
72
+ if (typeof String.prototype.startsWith === 'undefined') {
73
+ Object.defineProperty(String.prototype, 'startsWith', {value: function (searchString, position) {
74
+ position = position || 0;
75
+ return this.lastIndexOf(searchString, position) === position;
76
+ }});
77
+ }
78
78
  //endregion
79
79
  (function (_) {
80
80
  'use strict';
@@ -100,8 +100,8 @@ if (typeof String.prototype.endsWith === 'undefined') {
100
100
  initMetadataForInterface(KtSet, 'Set', VOID, VOID, [Collection]);
101
101
  initMetadataForInterface(KtMutableMap, 'MutableMap', VOID, VOID, [KtMap]);
102
102
  initMetadataForInterface(MutableIterable, 'MutableIterable');
103
- initMetadataForInterface(KtMutableList, 'MutableList', VOID, VOID, [KtList, MutableIterable, Collection]);
104
- initMetadataForInterface(KtMutableSet, 'MutableSet', VOID, VOID, [KtSet, MutableIterable, Collection]);
103
+ initMetadataForInterface(KtMutableList, 'MutableList', VOID, VOID, [KtList, Collection, MutableIterable]);
104
+ initMetadataForInterface(KtMutableSet, 'MutableSet', VOID, VOID, [KtSet, Collection, MutableIterable]);
105
105
  initMetadataForCompanion(Companion_0);
106
106
  initMetadataForClass(Enum, 'Enum', VOID, VOID, [Comparable]);
107
107
  initMetadataForCompanion(Companion_1);
@@ -119,7 +119,7 @@ if (typeof String.prototype.endsWith === 'undefined') {
119
119
  initMetadataForInterface(Comparator, 'Comparator');
120
120
  initMetadataForObject(Unit, 'Unit');
121
121
  initMetadataForClass(AbstractCollection, 'AbstractCollection', VOID, VOID, [Collection]);
122
- initMetadataForClass(AbstractMutableCollection, 'AbstractMutableCollection', VOID, AbstractCollection, [MutableIterable, Collection]);
122
+ initMetadataForClass(AbstractMutableCollection, 'AbstractMutableCollection', VOID, AbstractCollection, [Collection, MutableIterable]);
123
123
  initMetadataForClass(IteratorImpl, 'IteratorImpl');
124
124
  initMetadataForClass(ListIteratorImpl, 'ListIteratorImpl', VOID, IteratorImpl);
125
125
  initMetadataForClass(AbstractMutableList, 'AbstractMutableList', VOID, AbstractMutableCollection, [KtMutableList]);
@@ -132,7 +132,7 @@ if (typeof String.prototype.endsWith === 'undefined') {
132
132
  initMetadataForClass(ArrayList, 'ArrayList', ArrayList_init_$Create$, AbstractMutableList, [KtMutableList, RandomAccess]);
133
133
  initMetadataForClass(HashMap, 'HashMap', HashMap_init_$Create$, AbstractMutableMap, [KtMutableMap]);
134
134
  initMetadataForClass(HashMapKeys, 'HashMapKeys', VOID, AbstractMutableSet, [KtMutableSet]);
135
- initMetadataForClass(HashMapValues, 'HashMapValues', VOID, AbstractMutableCollection, [MutableIterable, Collection]);
135
+ initMetadataForClass(HashMapValues, 'HashMapValues', VOID, AbstractMutableCollection, [Collection, MutableIterable]);
136
136
  initMetadataForClass(HashMapEntrySetBase, 'HashMapEntrySetBase', VOID, AbstractMutableSet, [KtMutableSet]);
137
137
  initMetadataForClass(HashMapEntrySet, 'HashMapEntrySet', VOID, HashMapEntrySetBase);
138
138
  initMetadataForClass(HashMapKeysDefault$iterator$1);
@@ -10215,6 +10215,29 @@ if (typeof String.prototype.endsWith === 'undefined') {
10215
10215
  }
10216
10216
  return tmp;
10217
10217
  }
10218
+ function trim(_this__u8e3s4) {
10219
+ // Inline function 'kotlin.text.trim' call
10220
+ var startIndex = 0;
10221
+ var endIndex = charSequenceLength(_this__u8e3s4) - 1 | 0;
10222
+ var startFound = false;
10223
+ $l$loop: while (startIndex <= endIndex) {
10224
+ var index = !startFound ? startIndex : endIndex;
10225
+ var p0 = charSequenceGet(_this__u8e3s4, index);
10226
+ var match = isWhitespace(p0);
10227
+ if (!startFound) {
10228
+ if (!match)
10229
+ startFound = true;
10230
+ else
10231
+ startIndex = startIndex + 1 | 0;
10232
+ } else {
10233
+ if (!match)
10234
+ break $l$loop;
10235
+ else
10236
+ endIndex = endIndex - 1 | 0;
10237
+ }
10238
+ }
10239
+ return charSequenceSubSequence(_this__u8e3s4, startIndex, endIndex + 1 | 0);
10240
+ }
10218
10241
  function calcNext_1($this) {
10219
10242
  if ($this.og_1 < 0) {
10220
10243
  $this.mg_1 = 0;
@@ -10425,29 +10448,6 @@ if (typeof String.prototype.endsWith === 'undefined') {
10425
10448
  return null;
10426
10449
  }
10427
10450
  }
10428
- function trim(_this__u8e3s4) {
10429
- // Inline function 'kotlin.text.trim' call
10430
- var startIndex = 0;
10431
- var endIndex = charSequenceLength(_this__u8e3s4) - 1 | 0;
10432
- var startFound = false;
10433
- $l$loop: while (startIndex <= endIndex) {
10434
- var index = !startFound ? startIndex : endIndex;
10435
- var p0 = charSequenceGet(_this__u8e3s4, index);
10436
- var match = isWhitespace(p0);
10437
- if (!startFound) {
10438
- if (!match)
10439
- startFound = true;
10440
- else
10441
- startIndex = startIndex + 1 | 0;
10442
- } else {
10443
- if (!match)
10444
- break $l$loop;
10445
- else
10446
- endIndex = endIndex - 1 | 0;
10447
- }
10448
- }
10449
- return charSequenceSubSequence(_this__u8e3s4, startIndex, endIndex + 1 | 0);
10450
- }
10451
10451
  function removeSurrounding(_this__u8e3s4, prefix, suffix) {
10452
10452
  if (_this__u8e3s4.length >= (charSequenceLength(prefix) + charSequenceLength(suffix) | 0) && startsWith_2(_this__u8e3s4, prefix) && endsWith_1(_this__u8e3s4, suffix)) {
10453
10453
  return substring(_this__u8e3s4, charSequenceLength(prefix), _this__u8e3s4.length - charSequenceLength(suffix) | 0);