rman 2.43.1 → 2.44.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.
package/constants.js CHANGED
@@ -1 +1 @@
1
- export const version = '2.43.1';
1
+ export const version = '2.44.1';
@@ -118,6 +118,8 @@ export declare abstract class VersionScheme {
118
118
  export declare class SemverScheme extends VersionScheme {
119
119
  readonly name = "semver";
120
120
  readonly bumpNames: readonly ["patch", "minor", "major"];
121
+ /** The counter a new prerelease line starts at: `1.0.0-beta.1`, then `beta.2`. `semver.inc` takes only `0` or `1`. */
122
+ protected readonly firstPrerelease: '0' | '1';
121
123
  bumpFor(kind: ChangeKind): string;
122
124
  isValid(version: string): boolean;
123
125
  compare(a: string, b: string): number;
@@ -96,6 +96,11 @@ export class VersionScheme {
96
96
  export class SemverScheme extends VersionScheme {
97
97
  name = 'semver';
98
98
  bumpNames = ['patch', 'minor', 'major'];
99
+ /** The counter a new prerelease line starts at: `1.0.0-beta.1`, then `beta.2`. `semver.inc` takes only `0` or `1`. */
100
+ /* **1, not semver's 0** - the user's choice (2026-11-24): the first beta is "beta 1". npm's own
101
+ * `npm version premajor --preid beta`, changesets and lerna start at `.0`, so this is a deliberate
102
+ * departure. An existing line keeps counting from wherever it is (`beta.0` -> `beta.1`). */
103
+ firstPrerelease = '1';
99
104
  bumpFor(kind) {
100
105
  switch (kind) {
101
106
  case 'breaking':
@@ -132,14 +137,14 @@ export class SemverScheme extends VersionScheme {
132
137
  return semver.inc(current, 'prerelease', preid) ?? current;
133
138
  /**
134
139
  * **A prerelease moving to another identifier keeps its version when that version already
135
- * holds the change** - `2.19.0-alpha.1` -> `2.19.0-beta.0` for a fix or a feature, since
140
+ * holds the change** - `2.19.0-alpha.1` -> `2.19.0-beta.1` for a fix or a feature, since
136
141
  * `2.19.0` is a minor's target already. It moves on only when the change needs more than the
137
- * target gives: a breaking change on `2.19.0-alpha.1` is `3.0.0-beta.0`.
142
+ * target gives: a breaking change on `2.19.0-alpha.1` is `3.0.0-beta.1`.
138
143
  */
139
144
  if (existing && this.coversBump(current, bump)) {
140
- return `${semver.major(current)}.${semver.minor(current)}.${semver.patch(current)}-${preid}.0`;
145
+ return `${semver.major(current)}.${semver.minor(current)}.${semver.patch(current)}-${preid}.${this.firstPrerelease}`;
141
146
  }
142
- return semver.inc(current, `pre${releaseType}`, preid) ?? current;
147
+ return semver.inc(current, `pre${releaseType}`, preid, this.firstPrerelease) ?? current;
143
148
  }
144
149
  isPrerelease(version) {
145
150
  return !!semver.prerelease(version);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rman",
3
3
  "description": "Repository manager",
4
- "version": "2.43.1",
4
+ "version": "2.44.1",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
7
7
  "dependencies": {
@@ -36,7 +36,7 @@ export declare namespace ChangeHashService {
36
36
  * ever documenting them, and the registry now reports 1.5.0 - starting from the tag alone would
37
37
  * silently skip everything the file never recorded. The boundary becomes the merge-base of the
38
38
  * two, so the result always covers at least as much as the file is missing. Has no effect when
39
- * the file doesn't exist. */
39
+ * the file doesn't exist, or when no tag was found (nothing released, so nothing to widen). */
40
40
  catchUpFile?: string;
41
41
  }
42
42
  /**
@@ -112,9 +112,10 @@ export declare namespace ChangeHashService {
112
112
  * real release history but no `rman`-created tags), whatever this package's **own ecosystem**
113
113
  * reports as its published version (`Plugin.publishedVersion`), mapped to a git tag via
114
114
  * `.rmanrc changelog.tagPattern` and used only if that tag actually exists. Either way, if
115
- * `catchUpFile` is given and exists, the result is widened to also cover anything that file
116
- * hasn't caught up on yet (see its doc comment). Returns `undefined` when nothing can be resolved
117
- * at all (never tagged *and* never published, no catch-up file - a genuinely first-ever release) -
115
+ * `catchUpFile` is given and exists, a tag found that way is widened to also cover anything that
116
+ * file hasn't caught up on yet (see its doc comment). Returns `undefined` when nothing can be
117
+ * resolved (never tagged *and* never published - a genuinely first-ever release, whatever files
118
+ * already exist) -
118
119
  * callers should fall back to their own default in that case (e.g. the whole history, since
119
120
  * nothing has ever been released).
120
121
  */
@@ -140,9 +140,10 @@ export var ChangeHashService;
140
140
  * real release history but no `rman`-created tags), whatever this package's **own ecosystem**
141
141
  * reports as its published version (`Plugin.publishedVersion`), mapped to a git tag via
142
142
  * `.rmanrc changelog.tagPattern` and used only if that tag actually exists. Either way, if
143
- * `catchUpFile` is given and exists, the result is widened to also cover anything that file
144
- * hasn't caught up on yet (see its doc comment). Returns `undefined` when nothing can be resolved
145
- * at all (never tagged *and* never published, no catch-up file - a genuinely first-ever release) -
143
+ * `catchUpFile` is given and exists, a tag found that way is widened to also cover anything that
144
+ * file hasn't caught up on yet (see its doc comment). Returns `undefined` when nothing can be
145
+ * resolved (never tagged *and* never published - a genuinely first-ever release, whatever files
146
+ * already exist) -
146
147
  * callers should fall back to their own default in that case (e.g. the whole history, since
147
148
  * nothing has ever been released).
148
149
  */
@@ -161,11 +162,16 @@ export var ChangeHashService;
161
162
  tagHash = (await git.tagExists(tag)) ? tag : undefined;
162
163
  }
163
164
  }
164
- const fileHash = options.catchUpFile ? await git.lastCommitTouching(options.catchUpFile) : undefined;
165
- if (!fileHash)
165
+ /** **The file only ever widens a tag's boundary.** With no tag there is nothing to widen: the
166
+ * package has never been released, so its whole history is unreleased (`undefined`). Taking
167
+ * the file's last commit there narrowed it instead - reported from panates/fhir: a CHANGELOG.md
168
+ * holding only `# Changelog`, committed while adopting rman, made the first release document
169
+ * only the commits after it, which was none, and `changelog` then said "No unreleased
170
+ * changes" for a repository that had never released. A hand-written history from before rman
171
+ * is what `changelog.startingAt` is for. */
172
+ const fileHash = tagHash && options.catchUpFile ? await git.lastCommitTouching(options.catchUpFile) : undefined;
173
+ if (!tagHash || !fileHash)
166
174
  return tagHash;
167
- if (!tagHash)
168
- return fileHash;
169
175
  return (await git.mergeBase(tagHash, fileHash)) ?? tagHash;
170
176
  }
171
177
  ChangeHashService.detect = detect;