@theholocron/cli 5.0.0-alpha.486 → 5.0.0-alpha.488
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/README.md +3 -2
- package/dist/cli.mjs +314 -58
- package/dist/cli.mjs.map +1 -1
- package/dist/{index-CTidqzKv.d.mts → index-BmhgIDmN.d.mts} +17 -2
- package/dist/index.d.mts +2 -2
- package/dist/plugin/capabilities.d.mts +2 -2
- package/dist/presets.d.mts +1 -1
- package/package.json +13 -13
package/dist/cli.mjs
CHANGED
|
@@ -93,6 +93,7 @@ const COMMAND_CONTEXTS = {
|
|
|
93
93
|
"new project": "workspace",
|
|
94
94
|
"close project": "workspace",
|
|
95
95
|
"setup project": "workspace",
|
|
96
|
+
"project status": "workspace",
|
|
96
97
|
dev: "workspace",
|
|
97
98
|
"dev serve": "repo-aware",
|
|
98
99
|
"new channel": "workspace",
|
|
@@ -1133,6 +1134,27 @@ const projectSetupEntry = {
|
|
|
1133
1134
|
positionals: [],
|
|
1134
1135
|
supportsDryRun: true
|
|
1135
1136
|
};
|
|
1137
|
+
// src/commands/project/project-status/project-status.entry.ts
|
|
1138
|
+
const projectStatusEntry = {
|
|
1139
|
+
name: "project status",
|
|
1140
|
+
description: "Set the status of an issue on the project board, by the issue's key",
|
|
1141
|
+
positionals: [{
|
|
1142
|
+
key: "issue",
|
|
1143
|
+
message: "Issue (#1234, owner/repo#1234 or the tracker's key):",
|
|
1144
|
+
type: "input"
|
|
1145
|
+
}, {
|
|
1146
|
+
key: "status",
|
|
1147
|
+
message: "Status (a name from the board's template):",
|
|
1148
|
+
type: "input"
|
|
1149
|
+
}],
|
|
1150
|
+
options: [{
|
|
1151
|
+
key: "board",
|
|
1152
|
+
flag: "--board",
|
|
1153
|
+
type: "input",
|
|
1154
|
+
message: "Board name (blank = the first declared):"
|
|
1155
|
+
}],
|
|
1156
|
+
supportsDryRun: true
|
|
1157
|
+
};
|
|
1136
1158
|
// src/commands/project/reconcile/reconcile.entry.ts
|
|
1137
1159
|
const projectReconcileEntry = {
|
|
1138
1160
|
name: "reconcile project",
|
|
@@ -1677,6 +1699,7 @@ const registry = createCommandRegistry([
|
|
|
1677
1699
|
projectCreateEntry,
|
|
1678
1700
|
projectCloseEntry,
|
|
1679
1701
|
projectSetupEntry,
|
|
1702
|
+
projectStatusEntry,
|
|
1680
1703
|
projectReconcileEntry
|
|
1681
1704
|
], "interactive-menu");
|
|
1682
1705
|
/** Every Holocron command, in menu order: what {@link launchMenu} lists and what a leaf handler's prompt reads. */
|
|
@@ -5426,17 +5449,17 @@ function terminalPrompt() {
|
|
|
5426
5449
|
* `holocron close project <number-or-name> [--yes]` — close an open board. Reversible (the provider can reopen it).
|
|
5427
5450
|
* Asks first in a terminal; without one it needs `--yes` and is a {@link NonInteractiveError} otherwise.
|
|
5428
5451
|
*/
|
|
5429
|
-
const COMMAND$
|
|
5452
|
+
const COMMAND$9 = "close project";
|
|
5430
5453
|
async function runProjectClose(input) {
|
|
5431
5454
|
const print = input.print ?? ((line) => console.log(line));
|
|
5432
5455
|
const rows = createProjectRows(print, input.logger ?? getLogger());
|
|
5433
5456
|
const prompt = input.prompt ?? terminalPrompt();
|
|
5434
5457
|
const dryRun = input.context.dryRun ?? false;
|
|
5435
5458
|
const done = (closed) => ({
|
|
5436
|
-
...rows.finish(COMMAND$
|
|
5459
|
+
...rows.finish(COMMAND$9),
|
|
5437
5460
|
closed
|
|
5438
5461
|
});
|
|
5439
|
-
const { projects, options } = await openProjects(input, COMMAND$
|
|
5462
|
+
const { projects, options } = await openProjects(input, COMMAND$9);
|
|
5440
5463
|
print(style.header(`Holocron close project — ${options.owner}${dryRun ? " (dry-run)" : ""}`));
|
|
5441
5464
|
print("");
|
|
5442
5465
|
try {
|
|
@@ -6493,7 +6516,7 @@ function runCloudflared(token, spawnImpl = spawn) {
|
|
|
6493
6516
|
* hostname at it. Both are idempotent, so a second run changes nothing. With `run`, the connector is started in the
|
|
6494
6517
|
* foreground with the token in its environment. The token is never printed.
|
|
6495
6518
|
*/
|
|
6496
|
-
const COMMAND$
|
|
6519
|
+
const COMMAND$8 = "new tunnel";
|
|
6497
6520
|
/** Why a provider is missing: its own load error when it failed to load, else how to configure it. */
|
|
6498
6521
|
function missing(loader, key, hint) {
|
|
6499
6522
|
const failure = loader.loadFailures().find((f) => f.key === key);
|
|
@@ -6518,7 +6541,7 @@ async function runTunnelUp(input) {
|
|
|
6518
6541
|
logger[status === "ok" ? "info" : "warn"]({
|
|
6519
6542
|
status,
|
|
6520
6543
|
...summary
|
|
6521
|
-
}, COMMAND$
|
|
6544
|
+
}, COMMAND$8);
|
|
6522
6545
|
return {
|
|
6523
6546
|
status,
|
|
6524
6547
|
summary,
|
|
@@ -6527,7 +6550,7 @@ async function runTunnelUp(input) {
|
|
|
6527
6550
|
};
|
|
6528
6551
|
const loader = input.loader ?? new PluginLoader(input.loaded.resolved, input.context);
|
|
6529
6552
|
await withSpinner("Loading plugins…", () => loader.load());
|
|
6530
|
-
assertPluginsResolvable(loader, COMMAND$
|
|
6553
|
+
assertPluginsResolvable(loader, COMMAND$8);
|
|
6531
6554
|
const dryRun = input.context.dryRun ?? false;
|
|
6532
6555
|
print(style.header(`Holocron new tunnel — ${input.hostname}${dryRun ? " (dry-run)" : ""}`));
|
|
6533
6556
|
print("");
|
|
@@ -6651,7 +6674,7 @@ const tunnelUpCommand = {
|
|
|
6651
6674
|
* disk or printed (only how many there are). The tunnel and its DNS record are set up the way `holocron new tunnel`
|
|
6652
6675
|
* does, and the tunnel's connector runs beside the application; Ctrl-C stops both.
|
|
6653
6676
|
*/
|
|
6654
|
-
const COMMAND$
|
|
6677
|
+
const COMMAND$7 = "dev";
|
|
6655
6678
|
/** The environment the application is told it runs in, which its logger tags every line with. */
|
|
6656
6679
|
const APP_ENVIRONMENT = "development";
|
|
6657
6680
|
async function runDev(input) {
|
|
@@ -6673,7 +6696,7 @@ async function runDev(input) {
|
|
|
6673
6696
|
logger[status === "ok" ? "info" : "warn"]({
|
|
6674
6697
|
status,
|
|
6675
6698
|
...summary
|
|
6676
|
-
}, COMMAND$
|
|
6699
|
+
}, COMMAND$7);
|
|
6677
6700
|
return {
|
|
6678
6701
|
status,
|
|
6679
6702
|
summary,
|
|
@@ -6682,7 +6705,7 @@ async function runDev(input) {
|
|
|
6682
6705
|
};
|
|
6683
6706
|
const loader = input.loader ?? new PluginLoader(input.loaded.resolved, input.context);
|
|
6684
6707
|
await withSpinner("Loading plugins…", () => loader.load());
|
|
6685
|
-
assertPluginsResolvable(loader, COMMAND$
|
|
6708
|
+
assertPluginsResolvable(loader, COMMAND$7);
|
|
6686
6709
|
const dryRun = input.context.dryRun ?? false;
|
|
6687
6710
|
const [program, ...args] = input.command;
|
|
6688
6711
|
const shown = input.command.join(" ");
|
|
@@ -11088,6 +11111,12 @@ const BUILTIN_TEMPLATES = {
|
|
|
11088
11111
|
color: "YELLOW",
|
|
11089
11112
|
description: "Currently being worked on"
|
|
11090
11113
|
},
|
|
11114
|
+
{
|
|
11115
|
+
name: "In Review",
|
|
11116
|
+
category: "review",
|
|
11117
|
+
color: "ORANGE",
|
|
11118
|
+
description: "Pull request is green and waiting on review"
|
|
11119
|
+
},
|
|
11091
11120
|
{
|
|
11092
11121
|
name: "Blocked",
|
|
11093
11122
|
category: "blocked",
|
|
@@ -11143,6 +11172,11 @@ const BUILTIN_TEMPLATES = {
|
|
|
11143
11172
|
category: "active",
|
|
11144
11173
|
color: "YELLOW"
|
|
11145
11174
|
},
|
|
11175
|
+
{
|
|
11176
|
+
name: "In Review",
|
|
11177
|
+
category: "review",
|
|
11178
|
+
color: "ORANGE"
|
|
11179
|
+
},
|
|
11146
11180
|
{
|
|
11147
11181
|
name: "Blocked",
|
|
11148
11182
|
category: "blocked",
|
|
@@ -11232,6 +11266,7 @@ const CATEGORIES = [
|
|
|
11232
11266
|
"backlog",
|
|
11233
11267
|
"planned",
|
|
11234
11268
|
"active",
|
|
11269
|
+
"review",
|
|
11235
11270
|
"blocked",
|
|
11236
11271
|
"done"
|
|
11237
11272
|
];
|
|
@@ -16213,7 +16248,7 @@ function resolveCredentialsFile(base, file, makeDir = (dir) => void mkdirSync(di
|
|
|
16213
16248
|
* printed to a screen or left in scrollback; to the clipboard when asked. A regular file as stdout (`> file`) is
|
|
16214
16249
|
* refused, because it would leave plaintext tokens on disk without any of those protections.
|
|
16215
16250
|
*/
|
|
16216
|
-
const COMMAND$
|
|
16251
|
+
const COMMAND$6 = "export tokens";
|
|
16217
16252
|
/** Plain code-unit order: the same on every machine, whatever its locale. The names it sorts are all different. */
|
|
16218
16253
|
const compare = (a, b) => a < b ? -1 : 1;
|
|
16219
16254
|
/** What a variable can be called in a dotenv file and in a shell. */
|
|
@@ -16226,7 +16261,7 @@ async function runAuthExport(input) {
|
|
|
16226
16261
|
logger.warn({
|
|
16227
16262
|
status: "fail",
|
|
16228
16263
|
reason
|
|
16229
|
-
}, COMMAND$
|
|
16264
|
+
}, COMMAND$6);
|
|
16230
16265
|
return {
|
|
16231
16266
|
status: "fail",
|
|
16232
16267
|
exported: [],
|
|
@@ -16277,7 +16312,7 @@ async function runAuthExport(input) {
|
|
|
16277
16312
|
});
|
|
16278
16313
|
}
|
|
16279
16314
|
}
|
|
16280
|
-
if (packages.length > 0 && unavailable.length === packages.length) throw new WorkspaceContextError(COMMAND$
|
|
16315
|
+
if (packages.length > 0 && unavailable.length === packages.length) throw new WorkspaceContextError(COMMAND$6, unavailable);
|
|
16281
16316
|
const literals = /* @__PURE__ */ new Map();
|
|
16282
16317
|
const placeholders = [];
|
|
16283
16318
|
if (input.only?.length) {
|
|
@@ -16415,7 +16450,7 @@ async function runAuthExport(input) {
|
|
|
16415
16450
|
unavailable: unavailable.length,
|
|
16416
16451
|
status,
|
|
16417
16452
|
destination
|
|
16418
|
-
}, COMMAND$
|
|
16453
|
+
}, COMMAND$6);
|
|
16419
16454
|
return {
|
|
16420
16455
|
status,
|
|
16421
16456
|
exported,
|
|
@@ -19362,18 +19397,18 @@ const authListCommand = {
|
|
|
19362
19397
|
* `holocron list projects` — the owner's boards, newest first, with their number, name and state. Read-only, so
|
|
19363
19398
|
* `--dry-run` changes nothing here.
|
|
19364
19399
|
*/
|
|
19365
|
-
const COMMAND$
|
|
19400
|
+
const COMMAND$5 = "list projects";
|
|
19366
19401
|
async function runProjectList(input) {
|
|
19367
19402
|
const print = input.print ?? ((line) => console.log(line));
|
|
19368
19403
|
const rows = createProjectRows(print, input.logger ?? getLogger());
|
|
19369
|
-
const { projects, options } = await openProjects(input, COMMAND$
|
|
19404
|
+
const { projects, options } = await openProjects(input, COMMAND$5);
|
|
19370
19405
|
print(style.header(`Holocron list projects — ${options.owner}`));
|
|
19371
19406
|
print("");
|
|
19372
19407
|
try {
|
|
19373
19408
|
const boards = (await projects.list(options.owner)).toSorted((a, b) => (b.number ?? 0) - (a.number ?? 0));
|
|
19374
19409
|
if (boards.length === 0) {
|
|
19375
19410
|
rows.skip("no boards", options.owner);
|
|
19376
|
-
return rows.finish(COMMAND$
|
|
19411
|
+
return rows.finish(COMMAND$5);
|
|
19377
19412
|
}
|
|
19378
19413
|
const width = Math.max(1, ...boards.map((b) => String(b.number ?? "").length));
|
|
19379
19414
|
print(style.dim(` ${"#".padEnd(width)} ${"Name".padEnd(32)} State`));
|
|
@@ -19383,7 +19418,7 @@ async function runProjectList(input) {
|
|
|
19383
19418
|
} catch (err) {
|
|
19384
19419
|
rows.fail("list", errorMessage(err));
|
|
19385
19420
|
}
|
|
19386
|
-
return rows.finish(COMMAND$
|
|
19421
|
+
return rows.finish(COMMAND$5);
|
|
19387
19422
|
}
|
|
19388
19423
|
// src/commands/project/project-list/project-list.command.ts
|
|
19389
19424
|
const projectListCommand = {
|
|
@@ -19585,6 +19620,7 @@ const CATEGORY = {
|
|
|
19585
19620
|
backlog: "open",
|
|
19586
19621
|
planned: "open",
|
|
19587
19622
|
active: "in-progress",
|
|
19623
|
+
review: "in-review",
|
|
19588
19624
|
blocked: "in-progress",
|
|
19589
19625
|
done: "done"
|
|
19590
19626
|
};
|
|
@@ -20303,7 +20339,7 @@ const authSetCommand = {
|
|
|
20303
20339
|
* file is checked (git ignores it, it is not there already) before the browser opens. Nothing but names and paths is
|
|
20304
20340
|
* ever printed.
|
|
20305
20341
|
*/
|
|
20306
|
-
const COMMAND$
|
|
20342
|
+
const COMMAND$4 = "new github-app";
|
|
20307
20343
|
const DEFAULT_WEBHOOK_SECRET_VAR = "SENTINEL_WEBHOOK_SECRET";
|
|
20308
20344
|
async function runGithubAppCreate(input) {
|
|
20309
20345
|
const print = input.print ?? ((line) => console.error(line));
|
|
@@ -20313,7 +20349,7 @@ async function runGithubAppCreate(input) {
|
|
|
20313
20349
|
logger.warn({
|
|
20314
20350
|
status: "fail",
|
|
20315
20351
|
reason
|
|
20316
|
-
}, COMMAND$
|
|
20352
|
+
}, COMMAND$4);
|
|
20317
20353
|
return { status: "fail" };
|
|
20318
20354
|
};
|
|
20319
20355
|
if ((input.platform ?? process.platform) === "win32") return refuse("windows", "cannot make the credentials file private on Windows: its mode bits are not enforced");
|
|
@@ -20374,7 +20410,7 @@ async function runGithubAppCreate(input) {
|
|
|
20374
20410
|
status: "fail",
|
|
20375
20411
|
reason: "write",
|
|
20376
20412
|
slug: app.slug
|
|
20377
|
-
}, COMMAND$
|
|
20413
|
+
}, COMMAND$4);
|
|
20378
20414
|
for (const line of [`created ${app.slug}, but could not keep its credentials: ${errorMessage(err)}`, `they are shown once: delete the App (${settings}) and run this again`]) print(line);
|
|
20379
20415
|
return {
|
|
20380
20416
|
status: "fail",
|
|
@@ -20399,7 +20435,7 @@ async function runGithubAppCreate(input) {
|
|
|
20399
20435
|
logger.info({
|
|
20400
20436
|
status,
|
|
20401
20437
|
slug: app.slug
|
|
20402
|
-
}, COMMAND$
|
|
20438
|
+
}, COMMAND$4);
|
|
20403
20439
|
return {
|
|
20404
20440
|
status,
|
|
20405
20441
|
slug: app.slug,
|
|
@@ -22490,18 +22526,18 @@ const pluginCreateCommand = {
|
|
|
22490
22526
|
* templates directory). Idempotent on the title: an open board that has it is not made again; a terminal is asked
|
|
22491
22527
|
* whether to open the existing one, `--yes` prints its address, and anything else is a {@link NonInteractiveError}.
|
|
22492
22528
|
*/
|
|
22493
|
-
const COMMAND$
|
|
22529
|
+
const COMMAND$3 = "new project";
|
|
22494
22530
|
async function runProjectCreate(input) {
|
|
22495
22531
|
const print = input.print ?? ((line) => console.log(line));
|
|
22496
22532
|
const rows = createProjectRows(print, input.logger ?? getLogger());
|
|
22497
22533
|
const prompt = input.prompt ?? terminalPrompt();
|
|
22498
22534
|
const dryRun = input.context.dryRun ?? false;
|
|
22499
22535
|
const done = (extra = {}) => ({
|
|
22500
|
-
...rows.finish(COMMAND$
|
|
22536
|
+
...rows.finish(COMMAND$3),
|
|
22501
22537
|
created: false,
|
|
22502
22538
|
...extra
|
|
22503
22539
|
});
|
|
22504
|
-
const { projects, options } = await openProjects(input, COMMAND$
|
|
22540
|
+
const { projects, options } = await openProjects(input, COMMAND$3);
|
|
22505
22541
|
const loaded = await loadTemplates(options.templatesDir, input.io ?? createFsTemplatesIo(input.context.repoRoot));
|
|
22506
22542
|
print(style.header(`Holocron new project — ${options.owner}${dryRun ? " (dry-run)" : ""}`));
|
|
22507
22543
|
print("");
|
|
@@ -25862,7 +25898,7 @@ function findReserved(file) {
|
|
|
25862
25898
|
}
|
|
25863
25899
|
// src/commands/probe/tasks/find-leftovers.ts
|
|
25864
25900
|
/** The commands that take a task name as their next word: `holocron run`, `turbo run`, `pnpm run`, `pnpm`, ... */
|
|
25865
|
-
const COMMAND$
|
|
25901
|
+
const COMMAND$2 = String.raw`(?:holocron run|turbo run|pnpm run|npm run|pnpm|yarn)\s+`;
|
|
25866
25902
|
/** A regex alternation of `names`, escaped; matches nothing for an empty list. */
|
|
25867
25903
|
function alternation(names) {
|
|
25868
25904
|
return names.length === 0 ? "(?!)" : names.map((n) => n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
@@ -25889,7 +25925,7 @@ function findLeftovers(files, names, options = {}) {
|
|
|
25889
25925
|
const bare = Object.keys(names).filter((n) => !n.includes("."));
|
|
25890
25926
|
const tail = options.files ? String.raw`(?![\w-])` : String.raw`(?![\w-]|\.ya?ml\b)`;
|
|
25891
25927
|
const dottedPattern = new RegExp(`(?<![\\w.-])(${alternation(dotted)})${tail}`, "g");
|
|
25892
|
-
const barePattern = new RegExp(`(?<![\\w.-])${COMMAND$
|
|
25928
|
+
const barePattern = new RegExp(`(?<![\\w.-])${COMMAND$2}(${alternation(bare)})(?![\\w:-]|\\.\\w)`, "g");
|
|
25893
25929
|
return files.flatMap((file) => {
|
|
25894
25930
|
const lines = file.text.split("\n");
|
|
25895
25931
|
const field = taskField(file.path);
|
|
@@ -26216,6 +26252,120 @@ const probeCommand = {
|
|
|
26216
26252
|
})).status === "fail") process.exitCode = 1;
|
|
26217
26253
|
}
|
|
26218
26254
|
};
|
|
26255
|
+
// src/commands/project/project-status/project-status.ts
|
|
26256
|
+
/**
|
|
26257
|
+
* `holocron project status <issue> <status>` — set one item's status on a declared board by the issue's key, so nobody
|
|
26258
|
+
* looks up a project item id. The status is a name from the board's template (any case). Only the status changes, and
|
|
26259
|
+
* the item must already be on the board: it is never added here. It asks nothing (a status is easy to set back);
|
|
26260
|
+
* `--dry-run` prints the change and calls no mutator. Prints one line, `<key> <from> → <to>`.
|
|
26261
|
+
*/
|
|
26262
|
+
const COMMAND$1 = "project status";
|
|
26263
|
+
/** `#12`, `12`, `o/r#12` as a repository (or none) and a number; anything else (a Linear key) is undefined. */
|
|
26264
|
+
const parseKey = (key) => {
|
|
26265
|
+
const m = /^(?:([^#\s]+)#|#)?(\d+)$/.exec(key.trim());
|
|
26266
|
+
return m ? {
|
|
26267
|
+
repo: m[1],
|
|
26268
|
+
number: Number(m[2])
|
|
26269
|
+
} : void 0;
|
|
26270
|
+
};
|
|
26271
|
+
async function runProjectStatus(input) {
|
|
26272
|
+
const print = input.print ?? ((line) => console.log(line));
|
|
26273
|
+
const rows = createProjectRows(print, input.logger ?? getLogger());
|
|
26274
|
+
const dryRun = input.context.dryRun ?? false;
|
|
26275
|
+
const failed = (label, detail) => {
|
|
26276
|
+
rows.fail(label, detail);
|
|
26277
|
+
return rows.finish(COMMAND$1);
|
|
26278
|
+
};
|
|
26279
|
+
const { projects, options } = await openProjects(input, COMMAND$1);
|
|
26280
|
+
if (!projects.items || !projects.setStatus) return failed(COMMAND$1, `the \`${projects.providerName}\` provider cannot list items or set a status`);
|
|
26281
|
+
const declared = input.board === void 0 ? options.boards[0] : options.boards.find((b) => b.name === input.board);
|
|
26282
|
+
if (!declared) return failed(input.board === void 0 ? "no boards" : `board ${input.board}`, options.boards.length === 0 ? "declare them in providers.projects: boards: [{ template, name }]" : `not declared; declared boards: ${options.boards.map((b) => b.name).join(", ")}`);
|
|
26283
|
+
try {
|
|
26284
|
+
const template = (await loadTemplates(join(input.context.repoRoot, options.templatesDir), input.io ?? createFsTemplatesIo(input.context.repoRoot))).templates[declared.template];
|
|
26285
|
+
if (!template) return failed(`board ${declared.name}`, `there is no template named "${declared.template}"`);
|
|
26286
|
+
const status = template.statuses.find((s) => s.name.toLowerCase() === input.status.trim().toLowerCase());
|
|
26287
|
+
if (!status) return failed(`status ${input.status}`, `not in template ${template.name}; valid: ${template.statuses.map((s) => s.name).join(", ")}`);
|
|
26288
|
+
const board = await projects.find(options.owner, declared.name);
|
|
26289
|
+
if (!board) return failed(`board ${declared.name}`, "the board does not exist or is closed; run `holocron setup project`");
|
|
26290
|
+
const wanted = input.issue.trim();
|
|
26291
|
+
const parsed = parseKey(wanted);
|
|
26292
|
+
const own = `${input.loaded.resolved.org ?? input.context.org ?? ""}/${input.loaded.resolved.name}`.toLowerCase();
|
|
26293
|
+
const item = (await projects.items(options.owner, board, template)).find((i) => {
|
|
26294
|
+
if (!parsed) return i.key.toLowerCase() === wanted.toLowerCase();
|
|
26295
|
+
const have = parseKey(i.key);
|
|
26296
|
+
if (have?.number !== parsed.number) return false;
|
|
26297
|
+
if (parsed.repo === void 0) return have.repo === void 0;
|
|
26298
|
+
return (have.repo ?? own).toLowerCase() === parsed.repo.toLowerCase();
|
|
26299
|
+
});
|
|
26300
|
+
if (!item) return failed(`${wanted} on board ${declared.name}`, `not on the board; add it first (\`gh project item-add ${board.number ?? "<number>"} --owner ${options.owner} --url <issue url>\`, or turn on the board's auto-add rule)`);
|
|
26301
|
+
const change = `${item.key} ${item.status ?? "no status"} → ${status.name}`;
|
|
26302
|
+
const done = {
|
|
26303
|
+
status: "ok",
|
|
26304
|
+
summary: {
|
|
26305
|
+
ok: 1,
|
|
26306
|
+
fail: 0,
|
|
26307
|
+
skip: 0
|
|
26308
|
+
},
|
|
26309
|
+
key: item.key,
|
|
26310
|
+
...item.status ? { from: item.status } : {},
|
|
26311
|
+
to: status.name
|
|
26312
|
+
};
|
|
26313
|
+
if (dryRun) {
|
|
26314
|
+
print(style.skip(`would set ${change}`));
|
|
26315
|
+
return done;
|
|
26316
|
+
}
|
|
26317
|
+
const result = await projects.setStatus(options.owner, board, item.key, status.name);
|
|
26318
|
+
if (result.status !== status.name) return failed(item.key, `refused: still ${result.status}${result.via ? ` (${result.via})` : ""}`);
|
|
26319
|
+
print(result.transitioned ? change : `${change} (already)`);
|
|
26320
|
+
return done;
|
|
26321
|
+
} catch (err) {
|
|
26322
|
+
return failed(COMMAND$1, errorMessage(err));
|
|
26323
|
+
}
|
|
26324
|
+
}
|
|
26325
|
+
// src/commands/project/project-status/project-status.command.ts
|
|
26326
|
+
const projectStatusArgs = (y) => y.positional("issue", {
|
|
26327
|
+
type: "string",
|
|
26328
|
+
demandOption: true,
|
|
26329
|
+
describe: "The issue: #1234, 1234, owner/repo#1234, or the tracker's own key"
|
|
26330
|
+
}).positional("status", {
|
|
26331
|
+
type: "string",
|
|
26332
|
+
demandOption: true,
|
|
26333
|
+
describe: "A status of the board's template, such as 'In Progress'"
|
|
26334
|
+
}).option("board", {
|
|
26335
|
+
type: "string",
|
|
26336
|
+
describe: "The declared board's name (default: the first one declared)"
|
|
26337
|
+
});
|
|
26338
|
+
const projectStatusCommand = {
|
|
26339
|
+
command: "status <issue> <status>",
|
|
26340
|
+
describe: "Set the status of an issue on the project board, by the issue's key",
|
|
26341
|
+
builder: projectStatusArgs,
|
|
26342
|
+
handler: async (argv) => {
|
|
26343
|
+
const tokens = tokenContext(argv.token);
|
|
26344
|
+
if (!tokens) return;
|
|
26345
|
+
const loaded = await loadConfig(argv.cwd);
|
|
26346
|
+
applyResolvedConfig(argv, loaded.resolved);
|
|
26347
|
+
if ((await runProjectStatus({
|
|
26348
|
+
loaded,
|
|
26349
|
+
context: {
|
|
26350
|
+
repoRoot: argv.cwd,
|
|
26351
|
+
dryRun: argv.dryRun,
|
|
26352
|
+
...tokens,
|
|
26353
|
+
org: resolveOrg(argv, loaded.resolved)
|
|
26354
|
+
},
|
|
26355
|
+
owner: argv.org,
|
|
26356
|
+
issue: String(argv.issue),
|
|
26357
|
+
status: String(argv.status),
|
|
26358
|
+
...argv.board ? { board: argv.board } : {}
|
|
26359
|
+
})).status === "fail") process.exitCode = 1;
|
|
26360
|
+
}
|
|
26361
|
+
};
|
|
26362
|
+
// src/commands/project/project.command.ts
|
|
26363
|
+
const projectCommand = {
|
|
26364
|
+
command: "project",
|
|
26365
|
+
describe: "Work with the items of a project board",
|
|
26366
|
+
builder: (y) => y.command(projectStatusCommand).command(groupMenu("project")),
|
|
26367
|
+
handler: () => {}
|
|
26368
|
+
};
|
|
26219
26369
|
// src/commands/provider/provider.ts
|
|
26220
26370
|
/**
|
|
26221
26371
|
* `holocron provider [<name> [setup|doctor]]` — what only one provider has. With nothing it lists the providers that
|
|
@@ -26998,6 +27148,101 @@ async function runPublish(input = {}) {
|
|
|
26998
27148
|
packageNames
|
|
26999
27149
|
};
|
|
27000
27150
|
}
|
|
27151
|
+
// src/commands/publish/publish-failures/publish-failures.ts
|
|
27152
|
+
/** The command that publishes what is still missing for the version the checkout is on. */
|
|
27153
|
+
const REPUBLISH_COMMAND = "holocron publish package --skip-already-published";
|
|
27154
|
+
function advice(failures) {
|
|
27155
|
+
const out = [];
|
|
27156
|
+
if (failures.some((f) => f.kind === "tlog-conflict")) out.push("A sigstore 409 that survives retries means the tarball is identical to one already in the transparency log (an earlier publish of the same bytes). Retrying cannot fix it: change the package's contents and release again.");
|
|
27157
|
+
if (failures.some((f) => f.kind === "failed")) out.push(`For any other failure, fix the cause and run \`${REPUBLISH_COMMAND}\` (add \`--group <folder>\` for a version group) at the tag it happened on; it publishes only what npm lacks. \`holocron doctor releases\` names a tag npm never received.`);
|
|
27158
|
+
return out;
|
|
27159
|
+
}
|
|
27160
|
+
/** Plain lines printed at the end of a run that left packages unpublished, all failures together. */
|
|
27161
|
+
function formatPublishFailures(failures) {
|
|
27162
|
+
const lines = [` ✗ ${failures.length} package(s) not published:`];
|
|
27163
|
+
for (const f of failures) lines.push(f.kind === "tlog-conflict" ? ` - ${f.name}@${f.version}: sigstore 409, identical tarball already in the transparency log` : ` - ${f.message}`);
|
|
27164
|
+
for (const line of advice(failures)) lines.push(` → ${line}`);
|
|
27165
|
+
return lines;
|
|
27166
|
+
}
|
|
27167
|
+
/** The same report as Markdown for the job summary. */
|
|
27168
|
+
function publishFailuresMarkdown(failures) {
|
|
27169
|
+
return [
|
|
27170
|
+
"## Packages not published",
|
|
27171
|
+
"",
|
|
27172
|
+
"| Package | Reason |",
|
|
27173
|
+
"| --- | --- |",
|
|
27174
|
+
...failures.map((f) => `| \`${f.name}@${f.version}\` | ${f.kind === "tlog-conflict" ? "sigstore 409 (identical tarball already logged)" : "failed"} |`),
|
|
27175
|
+
"",
|
|
27176
|
+
...advice(failures).flatMap((a) => [a, ""])
|
|
27177
|
+
].join("\n").trimEnd();
|
|
27178
|
+
}
|
|
27179
|
+
// src/commands/publish/is-tlog-conflict.ts
|
|
27180
|
+
/**
|
|
27181
|
+
* Whether a failed `pnpm publish` was npm's sigstore step answering 409
|
|
27182
|
+
* (`TLOG_CREATE_ENTRY_ERROR`, "an equivalent entry already exists in the
|
|
27183
|
+
* transparency log"): the only failure class `publish package` retries (#1387).
|
|
27184
|
+
* A bare registry `E409` (the version already exists) is not this class; the
|
|
27185
|
+
* view check after every failure settles that one.
|
|
27186
|
+
*/
|
|
27187
|
+
function isTlogConflict(output) {
|
|
27188
|
+
return /TLOG_CREATE_ENTRY_ERROR|equivalent entry already exists in the transparency log/i.test(output);
|
|
27189
|
+
}
|
|
27190
|
+
// src/commands/publish/publish-one-package/publish-one-package.ts
|
|
27191
|
+
/** Default waits before the two retries of a sigstore 409. */
|
|
27192
|
+
const DEFAULT_BACKOFF_MS = [5e3, 15e3];
|
|
27193
|
+
const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
27194
|
+
/**
|
|
27195
|
+
* Publishes one package and settles what a failure means (#1387). After every failed call it asks the registry
|
|
27196
|
+
* (`npm view <name>@<version>`): a version that is there counts as published (another run made it). Only a sigstore 409
|
|
27197
|
+
* (`TLOG_CREATE_ENTRY_ERROR`) is tried again, after a short backoff; any other failure ends the package at once. A 409
|
|
27198
|
+
* that survives every retry is reported as `tlog-conflict`: the same bytes are already in the transparency log, which a
|
|
27199
|
+
* retry cannot change.
|
|
27200
|
+
*/
|
|
27201
|
+
async function publishOnePackage(input) {
|
|
27202
|
+
const { entry, exec, cwd, print } = input;
|
|
27203
|
+
const sleep = input.sleep ?? defaultSleep;
|
|
27204
|
+
const backoff = input.backoffMs ?? DEFAULT_BACKOFF_MS;
|
|
27205
|
+
const label = `${entry.name}@${entry.version}`;
|
|
27206
|
+
for (let attempt = 0;; attempt += 1) {
|
|
27207
|
+
const publish = await exec("pnpm", [...input.publishArgs], { cwd });
|
|
27208
|
+
if (publish.exitCode === 0) return { outcome: "published" };
|
|
27209
|
+
const view = await exec("npm", [
|
|
27210
|
+
"view",
|
|
27211
|
+
label,
|
|
27212
|
+
"version"
|
|
27213
|
+
], { cwd });
|
|
27214
|
+
if (view.exitCode === 0 && view.stdout.trim()) return { outcome: "concurrent" };
|
|
27215
|
+
const output = `${publish.stderr}\n${publish.stdout}`;
|
|
27216
|
+
const message = `publish failed for ${label} (exit ${publish.exitCode}): ${publish.stderr.trim() || publish.stdout.trim() || "no output"}`;
|
|
27217
|
+
if (!isTlogConflict(output)) return {
|
|
27218
|
+
outcome: "failed",
|
|
27219
|
+
message
|
|
27220
|
+
};
|
|
27221
|
+
const wait = backoff[attempt];
|
|
27222
|
+
if (wait === void 0) return {
|
|
27223
|
+
outcome: "tlog-conflict",
|
|
27224
|
+
message
|
|
27225
|
+
};
|
|
27226
|
+
print(` … ${label} hit a sigstore 409; retrying in ${wait / 1e3}s (${attempt + 1} of ${backoff.length})`);
|
|
27227
|
+
await sleep(wait);
|
|
27228
|
+
}
|
|
27229
|
+
}
|
|
27230
|
+
// src/commands/publish/write-job-summary/write-job-summary.ts
|
|
27231
|
+
/**
|
|
27232
|
+
* Appends Markdown to the file GitHub Actions names in `GITHUB_STEP_SUMMARY`, so the job's page says what happened.
|
|
27233
|
+
* Does nothing outside Actions (the variable is unset) and never throws: a summary that cannot be written must not
|
|
27234
|
+
* fail a publish. Returns whether the text was written.
|
|
27235
|
+
*/
|
|
27236
|
+
function writeJobSummary(markdown, env = createEnvLookup(), append = appendFileSync) {
|
|
27237
|
+
const file = env.get("GITHUB_STEP_SUMMARY");
|
|
27238
|
+
if (file === void 0) return false;
|
|
27239
|
+
try {
|
|
27240
|
+
append(file, `${markdown}\n`);
|
|
27241
|
+
return true;
|
|
27242
|
+
} catch {
|
|
27243
|
+
return false;
|
|
27244
|
+
}
|
|
27245
|
+
}
|
|
27001
27246
|
// src/commands/publish/run-steady-publish/run-steady-publish.ts
|
|
27002
27247
|
/**
|
|
27003
27248
|
* `holocron publish package` (no `--initial`) — the steady-state publish
|
|
@@ -27086,6 +27331,7 @@ async function runSteadyPublish(input = {}) {
|
|
|
27086
27331
|
}
|
|
27087
27332
|
if (skipAlreadyPublished) {
|
|
27088
27333
|
print(" → publishing packages not already on npm…");
|
|
27334
|
+
const failures = [];
|
|
27089
27335
|
for (const entry of entries) {
|
|
27090
27336
|
const view = await exec("npm", [
|
|
27091
27337
|
"view",
|
|
@@ -27096,37 +27342,46 @@ async function runSteadyPublish(input = {}) {
|
|
|
27096
27342
|
print(` skip ${entry.name}@${entry.version} (already published)`);
|
|
27097
27343
|
continue;
|
|
27098
27344
|
}
|
|
27099
|
-
const
|
|
27100
|
-
|
|
27101
|
-
|
|
27102
|
-
|
|
27103
|
-
|
|
27104
|
-
|
|
27105
|
-
|
|
27106
|
-
|
|
27107
|
-
|
|
27108
|
-
|
|
27109
|
-
|
|
27110
|
-
|
|
27111
|
-
|
|
27112
|
-
|
|
27113
|
-
|
|
27114
|
-
|
|
27115
|
-
}
|
|
27116
|
-
|
|
27117
|
-
|
|
27118
|
-
|
|
27119
|
-
|
|
27120
|
-
|
|
27121
|
-
|
|
27122
|
-
|
|
27123
|
-
|
|
27124
|
-
|
|
27125
|
-
|
|
27126
|
-
|
|
27127
|
-
|
|
27128
|
-
}
|
|
27129
|
-
|
|
27345
|
+
const result = await publishOnePackage({
|
|
27346
|
+
entry,
|
|
27347
|
+
publishArgs: [
|
|
27348
|
+
"--filter",
|
|
27349
|
+
entry.dir,
|
|
27350
|
+
"publish",
|
|
27351
|
+
...baseFlags,
|
|
27352
|
+
...otpFlags
|
|
27353
|
+
],
|
|
27354
|
+
cwd,
|
|
27355
|
+
exec,
|
|
27356
|
+
print,
|
|
27357
|
+
...input.sleep ? { sleep: input.sleep } : {},
|
|
27358
|
+
...input.backoffMs ? { backoffMs: input.backoffMs } : {}
|
|
27359
|
+
});
|
|
27360
|
+
if ("message" in result) {
|
|
27361
|
+
print(` ✗ ${result.message}`);
|
|
27362
|
+
failures.push({
|
|
27363
|
+
name: entry.name,
|
|
27364
|
+
version: entry.version,
|
|
27365
|
+
kind: result.outcome,
|
|
27366
|
+
message: result.message
|
|
27367
|
+
});
|
|
27368
|
+
} else if (result.outcome === "concurrent") print(` skip ${entry.name}@${entry.version} (published concurrently by another run)`);
|
|
27369
|
+
else print(` ✓ ${entry.name}@${entry.version}`);
|
|
27370
|
+
}
|
|
27371
|
+
if (failures.length > 0) {
|
|
27372
|
+
for (const line of formatPublishFailures(failures)) print(line);
|
|
27373
|
+
writeJobSummary(publishFailuresMarkdown(failures), input.envLookup);
|
|
27374
|
+
const message = `${failures.length} of ${entries.length} package(s) not published: ${failures.map((f) => `${f.name}@${f.version}`).join(", ")}`;
|
|
27375
|
+
logger.warn({
|
|
27376
|
+
tag,
|
|
27377
|
+
failed: failures.map((f) => f.name),
|
|
27378
|
+
reason: message
|
|
27379
|
+
}, "publish: done");
|
|
27380
|
+
return {
|
|
27381
|
+
status: "fail",
|
|
27382
|
+
message,
|
|
27383
|
+
packageNames
|
|
27384
|
+
};
|
|
27130
27385
|
}
|
|
27131
27386
|
logger.info({
|
|
27132
27387
|
tag,
|
|
@@ -31923,7 +32178,8 @@ const COMMAND_MODULES = [
|
|
|
31923
32178
|
publishCommand,
|
|
31924
32179
|
deployCommand,
|
|
31925
32180
|
resolveCommand,
|
|
31926
|
-
reconcileCommand
|
|
32181
|
+
reconcileCommand,
|
|
32182
|
+
projectCommand
|
|
31927
32183
|
];
|
|
31928
32184
|
// src/cli/own-package-json.ts
|
|
31929
32185
|
/**
|