@staff0rd/assist 0.228.0 → 0.229.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/dist/index.js +32 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.229.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -5528,6 +5528,33 @@ function originDisplayName(origin) {
|
|
|
5528
5528
|
return origin.slice(firstSlash + 1);
|
|
5529
5529
|
}
|
|
5530
5530
|
|
|
5531
|
+
// src/commands/backlog/originDisplayLabels.ts
|
|
5532
|
+
function originDisplayLabels(origins) {
|
|
5533
|
+
const isLocal = (origin) => origin.startsWith("local:");
|
|
5534
|
+
const bareName = (origin) => {
|
|
5535
|
+
const full = originDisplayName(origin);
|
|
5536
|
+
const segments = full.split("/");
|
|
5537
|
+
return segments[segments.length - 1] ?? full;
|
|
5538
|
+
};
|
|
5539
|
+
const remoteCounts = /* @__PURE__ */ new Map();
|
|
5540
|
+
for (const origin of new Set(origins)) {
|
|
5541
|
+
if (isLocal(origin)) continue;
|
|
5542
|
+
const name = bareName(origin);
|
|
5543
|
+
remoteCounts.set(name, (remoteCounts.get(name) ?? 0) + 1);
|
|
5544
|
+
}
|
|
5545
|
+
const labels = /* @__PURE__ */ new Map();
|
|
5546
|
+
for (const origin of origins) {
|
|
5547
|
+
if (isLocal(origin)) {
|
|
5548
|
+
labels.set(origin, originDisplayName(origin));
|
|
5549
|
+
continue;
|
|
5550
|
+
}
|
|
5551
|
+
const name = bareName(origin);
|
|
5552
|
+
const collides = (remoteCounts.get(name) ?? 0) > 1;
|
|
5553
|
+
labels.set(origin, collides ? originDisplayName(origin) : name);
|
|
5554
|
+
}
|
|
5555
|
+
return labels;
|
|
5556
|
+
}
|
|
5557
|
+
|
|
5531
5558
|
// src/commands/backlog/list/index.ts
|
|
5532
5559
|
function filterItems(items2, options2) {
|
|
5533
5560
|
if (options2.status) return items2.filter((i) => i.status === options2.status);
|
|
@@ -5542,7 +5569,10 @@ async function list2(options2) {
|
|
|
5542
5569
|
console.log(chalk56.dim("Backlog is empty."));
|
|
5543
5570
|
return;
|
|
5544
5571
|
}
|
|
5545
|
-
const
|
|
5572
|
+
const labels = originDisplayLabels(
|
|
5573
|
+
items2.flatMap((i) => i.origin ? [i.origin] : [])
|
|
5574
|
+
);
|
|
5575
|
+
const repoNameOf = (item) => item.origin ? labels.get(item.origin) ?? "" : "";
|
|
5546
5576
|
const prefixWidth = options2.allRepos ? Math.max(0, ...items2.map((i) => repoNameOf(i).length)) : 0;
|
|
5547
5577
|
for (const item of items2) {
|
|
5548
5578
|
const repoPrefix2 = options2.allRepos ? `${chalk56.dim(repoNameOf(item).padEnd(prefixWidth))} ` : "";
|