rman 2.10.0 → 2.10.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.
@@ -5,6 +5,7 @@ import { registerCommand } from '../interfaces/rman-config.interface.js';
5
5
  import { VersionPlanService } from '../services/version-plan.service.js';
6
6
  import { assertAllowedBranch, branchGuardOptions, readBranchGuardOptions } from '../utils/branch-guard.js';
7
7
  import { packageFilterOptions, readPackageFilterOptions } from '../utils/package-filter.js';
8
+ import { isSoloGroupKey } from '../utils/version-group.js';
8
9
  /**
9
10
  * Hoisted out of the metadata literal so the handler can be annotated against them - see
10
11
  * `RmanConfig.ArgsOf` for why an inferred `argv` and the metadata's own typo checking cannot both
@@ -344,13 +345,21 @@ function planBlocks(entries) {
344
345
  else
345
346
  byGroup.set(e.groupKey, [e]);
346
347
  }
348
+ /**
349
+ * **Classified by the key, not by how many members a group has.** This was `group.length > 1`,
350
+ * which stands in for "is this a group" and is wrong in exactly one case: a group the repository
351
+ * *named* that happens to have a single member. Reported on a real repository - a package alone in
352
+ * `group: "abisena-iomt"` landed among the ungrouped and printed an empty Group cell, reading
353
+ * exactly like a package that had opted out. Its name decides its changelog file and its tag, so
354
+ * it is a line of its own whatever its size.
355
+ */
347
356
  const shared = [];
348
357
  const solo = [];
349
- for (const group of byGroup.values()) {
350
- if (group.length > 1)
351
- shared.push({ members: group, shared: true });
358
+ for (const [key, group] of byGroup) {
359
+ if (isSoloGroupKey(key))
360
+ solo.push(...group);
352
361
  else
353
- solo.push(group[0]);
362
+ shared.push({ members: group, shared: true });
354
363
  }
355
364
  return [
356
365
  ...(root.length ? [{ members: root, shared: false }] : []),
package/constants.js CHANGED
@@ -1 +1 @@
1
- export const version = '2.10.0';
1
+ export const version = '2.10.1';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rman",
3
3
  "description": "Repository manager",
4
- "version": "2.10.0",
4
+ "version": "2.10.1",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
7
7
  "dependencies": {
@@ -16,6 +16,16 @@ import type { Package } from '../core/classes/package.js';
16
16
  * batching; what it cannot do is leave the tag pattern behind, which is the point.
17
17
  */
18
18
  export declare function groupKeyOf(pkg: Package): string;
19
+ /**
20
+ * Whether a group key belongs to a package that is in **no** group - `group: false`, a line of its
21
+ * own that nobody named.
22
+ *
23
+ * Here beside `groupKeyOf` so the key's shape is known in one place. The plan table asks it to decide
24
+ * whether the Group column is worth printing, and it has to ask *this* rather than count members: a
25
+ * group the repository named is a version line of its own whatever its size, while a package that
26
+ * opted out of grouping has no group to name.
27
+ */
28
+ export declare function isSoloGroupKey(key: string): boolean;
19
29
  /**
20
30
  * How many distinct version lines this package's repository releases along - 1 when every package
21
31
  * moves together, more once anything is grouped apart.
@@ -22,6 +22,18 @@ export function groupKeyOf(pkg) {
22
22
  return `named:${assertGroupName(g, pkg)}`;
23
23
  return 'default';
24
24
  }
25
+ /**
26
+ * Whether a group key belongs to a package that is in **no** group - `group: false`, a line of its
27
+ * own that nobody named.
28
+ *
29
+ * Here beside `groupKeyOf` so the key's shape is known in one place. The plan table asks it to decide
30
+ * whether the Group column is worth printing, and it has to ask *this* rather than count members: a
31
+ * group the repository named is a version line of its own whatever its size, while a package that
32
+ * opted out of grouping has no group to name.
33
+ */
34
+ export function isSoloGroupKey(key) {
35
+ return key.startsWith('solo:');
36
+ }
25
37
  /**
26
38
  * How many distinct version lines this package's repository releases along - 1 when every package
27
39
  * moves together, more once anything is grouped apart.