rman 2.44.0 → 2.45.0

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.44.0';
1
+ export const version = '2.45.0';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rman",
3
3
  "description": "Repository manager",
4
- "version": "2.44.0",
4
+ "version": "2.45.0",
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;
@@ -201,6 +201,12 @@ export declare abstract class VersionPlanService {
201
201
  * owns. A planner for a repository writing them differently overrides this.
202
202
  */
203
203
  protected detectBump(commits: CommitInfo[], scheme: VersionScheme): string;
204
+ /**
205
+ * Whether `commit` releases every package although it changes none of them: a `Release-As:`
206
+ * footer `scheme` recognizes, on a commit that touches no file under any package in
207
+ * `packageDirs` - an empty commit, or one changing only root files.
208
+ */
209
+ protected releasesEveryPackage(commit: CommitInfo, scheme: VersionScheme, packageDirs: readonly string[]): boolean;
204
210
  /** `.rmanrc group` (cascaded): `true` (the default - see `resolveConfig`'s cascade, this is what a
205
211
  * package inherits when nobody sets it at all) puts a package in the one implicit repo-wide
206
212
  * group; a non-empty string joins exactly the other packages sharing that string, regardless of
@@ -160,6 +160,13 @@ export class VersionPlanService {
160
160
  });
161
161
  }
162
162
  const commitMessage = repository.rootPackage.config?.version?.commitMessage;
163
+ /** Every package's directory, the root excluded - what `releasesEveryPackage` checks a commit
164
+ * against. All of the repository's, not this run's filtered ones: a commit under a package the
165
+ * run left out still belongs to that package. */
166
+ const packageDirs = repository
167
+ .getPackages()
168
+ .filter(pkg => pkg !== repository.rootPackage)
169
+ .map(pkg => pkg.dirname);
163
170
  const changeByPackage = new Map();
164
171
  await Promise.all(eligible.map(async (pkg) => {
165
172
  if (explicitVersion) {
@@ -170,7 +177,8 @@ export class VersionPlanService {
170
177
  const commits = since ? await git.listCommits({ hash: since }) : await git.listAllCommits();
171
178
  const homes = homesOf(pkg);
172
179
  const under = (dir, f) => !path.relative(dir, f).startsWith('..');
173
- const belongsToPkg = (c) => c.files.some(f => homes.some(dir => under(dir, f)));
180
+ const belongsToPkg = (c) => c.files.some(f => homes.some(dir => under(dir, f))) ||
181
+ this.releasesEveryPackage(c, pkg.versionScheme, packageDirs);
174
182
  const real = commits.filter(c => belongsToPkg(c) && !ConventionalCommitsService.isReleaseCommit(c.subject, commitMessage));
175
183
  if (!real.length)
176
184
  return;
@@ -509,6 +517,28 @@ export class VersionPlanService {
509
517
  }
510
518
  return scheme.highestBump(asked);
511
519
  }
520
+ /**
521
+ * Whether `commit` releases every package although it changes none of them: a `Release-As:`
522
+ * footer `scheme` recognizes, on a commit that touches no file under any package in
523
+ * `packageDirs` - an empty commit, or one changing only root files.
524
+ */
525
+ /* **A footer on such a commit used to be silently ignored.** A commit counted for a package only
526
+ * when it changed files under it, so the common `git commit --allow-empty -m "chore: release" -m
527
+ * "Release-As: major"` reached no package and the release came out sized by the other commits.
528
+ * Found while reproducing panates/fhir's first-release report: 0.1.0-beta.1 instead of
529
+ * 1.0.0-beta.1. The user's choice (2026-11-24): such a commit counts for every package, so in a
530
+ * repository with several groups it releases all of them - it names no group, and dropping it
531
+ * with a warning was the alternative turned down.
532
+ *
533
+ * Only with a footer the scheme recognizes: an unknown word (another tool's `Release-As: 1.2.3`)
534
+ * would otherwise turn a root-only commit into a patch release of every package, since
535
+ * `detectBump` reads an unrecognized footer as no footer and falls back to the commit's type. */
536
+ releasesEveryPackage(commit, scheme, packageDirs) {
537
+ const override = ConventionalCommitsService.parseReleaseAs(commit.body);
538
+ if (!override || !scheme.bumpNames.includes(override))
539
+ return false;
540
+ return !commit.files.some(f => packageDirs.some(dir => !path.relative(dir, f).startsWith('..')));
541
+ }
512
542
  /** `.rmanrc group` (cascaded): `true` (the default - see `resolveConfig`'s cascade, this is what a
513
543
  * package inherits when nobody sets it at all) puts a package in the one implicit repo-wide
514
544
  * group; a non-empty string joins exactly the other packages sharing that string, regardless of