@bensandee/tooling 0.99.0 → 0.99.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/dist/bin.mjs +69 -34
- package/package.json +1 -1
package/dist/bin.mjs
CHANGED
|
@@ -175,7 +175,7 @@ function loadEnvFileForBin(rawArgs, bin, io = processIo) {
|
|
|
175
175
|
//#region src/env-file-preload.ts
|
|
176
176
|
const envFileLoad = loadEnvFileForBin(process.argv.slice(2), {
|
|
177
177
|
name: "bst",
|
|
178
|
-
version: "0.99.
|
|
178
|
+
version: "0.99.1"
|
|
179
179
|
});
|
|
180
180
|
//#endregion
|
|
181
181
|
//#region ../cli-kit/src/logger.ts
|
|
@@ -5701,9 +5701,9 @@ function buildManagedDevDeps(ctx) {
|
|
|
5701
5701
|
const devDeps = { ...rootDevDeps(ctx.config) };
|
|
5702
5702
|
if (!isMonorepo) Object.assign(devDeps, perPackageDevDeps(ctx.config));
|
|
5703
5703
|
if (ctx.config.stack !== "none") devDeps["@bensandee/config"] = isWorkspacePackage(ctx, "@bensandee/config") ? "workspace:*" : "0.15.0";
|
|
5704
|
-
if (!isWorkspacePackage(ctx, "@bensandee/tooling")) devDeps["@bensandee/tooling"] = "0.99.
|
|
5704
|
+
if (!isWorkspacePackage(ctx, "@bensandee/tooling")) devDeps["@bensandee/tooling"] = "0.99.1";
|
|
5705
5705
|
if (ctx.config.useEslintPlugin && ctx.config.stack !== "none") devDeps["@bensandee/eslint-plugin"] = isWorkspacePackage(ctx, "@bensandee/eslint-plugin") ? "workspace:*" : "0.17.0";
|
|
5706
|
-
if (wantsAgentCli(ctx)) devDeps[AGENT_CLI_PACKAGE] = "0.
|
|
5706
|
+
if (wantsAgentCli(ctx)) devDeps[AGENT_CLI_PACKAGE] = "0.3.0";
|
|
5707
5707
|
if (ctx.config.formatter === "oxfmt") devDeps["oxfmt"] = {
|
|
5708
5708
|
"@changesets/cli": "3.0.3",
|
|
5709
5709
|
"@release-it/bumper": "8.0.1",
|
|
@@ -10341,7 +10341,7 @@ function reportFailures(failed, command) {
|
|
|
10341
10341
|
function generateMigratePrompt(results, config, detected) {
|
|
10342
10342
|
const sections = [];
|
|
10343
10343
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
10344
|
-
sections.push(`# Migration Prompt\n\n_Generated by \`@bensandee/tooling@0.99.
|
|
10344
|
+
sections.push(`# Migration Prompt\n\n_Generated by \`@bensandee/tooling@0.99.1 repo:sync\` on ${timestamp}_\n`);
|
|
10345
10345
|
const changed = results.filter((r) => r.action === "created" || r.action === "updated" || r.action === "archived");
|
|
10346
10346
|
if (changed.length > 0) {
|
|
10347
10347
|
const items = changed.map((r) => {
|
|
@@ -18262,49 +18262,79 @@ function planTask(headingText, label) {
|
|
|
18262
18262
|
title: unwrapped.slice(unwrapped.indexOf(label) + label.length).replace(AFTER_LABEL, "").trim()
|
|
18263
18263
|
};
|
|
18264
18264
|
}
|
|
18265
|
-
function
|
|
18265
|
+
function walkUnits(text, boxes) {
|
|
18266
18266
|
const lines = text.split("\n");
|
|
18267
18267
|
const fenced = fencedLines(lines);
|
|
18268
18268
|
const boxAtLine = /* @__PURE__ */ new Map();
|
|
18269
18269
|
for (const box of boxes) boxAtLine.set(box.line, box);
|
|
18270
18270
|
const units = [];
|
|
18271
18271
|
const open = [];
|
|
18272
|
+
const unitAtLine = lines.map(() => null);
|
|
18273
|
+
let loneBoxUnit = null;
|
|
18274
|
+
const inEffect = () => {
|
|
18275
|
+
const section = open[open.length - 1];
|
|
18276
|
+
if (section !== void 0) return section.index;
|
|
18277
|
+
return loneBoxUnit;
|
|
18278
|
+
};
|
|
18272
18279
|
for (const [index, rawLine] of lines.entries()) {
|
|
18273
|
-
if (fenced[index] === true) continue;
|
|
18274
18280
|
const line = rawLine ?? "";
|
|
18281
|
+
if (fenced[index] === true) {
|
|
18282
|
+
unitAtLine[index] = inEffect();
|
|
18283
|
+
continue;
|
|
18284
|
+
}
|
|
18275
18285
|
const heading = HEADING.exec(line);
|
|
18276
18286
|
if (heading !== null) {
|
|
18277
18287
|
const level = (heading[1] ?? "").length;
|
|
18278
18288
|
while (open.length > 0 && (open[open.length - 1]?.level ?? 0) >= level) open.pop();
|
|
18289
|
+
loneBoxUnit = null;
|
|
18279
18290
|
const headingText = (heading[2] ?? "").trim();
|
|
18280
18291
|
const label = taskLabelId(headingText);
|
|
18281
|
-
if (label === null)
|
|
18292
|
+
if (label === null) {
|
|
18293
|
+
unitAtLine[index] = inEffect();
|
|
18294
|
+
continue;
|
|
18295
|
+
}
|
|
18282
18296
|
const unit = {
|
|
18283
18297
|
key: headingText,
|
|
18284
18298
|
task: planTask(headingText, label),
|
|
18285
18299
|
boxes: []
|
|
18286
18300
|
};
|
|
18301
|
+
const unitIndex = units.length;
|
|
18287
18302
|
units.push(unit);
|
|
18288
18303
|
open.push({
|
|
18289
18304
|
level,
|
|
18290
|
-
unit
|
|
18305
|
+
unit,
|
|
18306
|
+
index: unitIndex
|
|
18291
18307
|
});
|
|
18308
|
+
unitAtLine[index] = unitIndex;
|
|
18292
18309
|
continue;
|
|
18293
18310
|
}
|
|
18294
18311
|
const box = boxAtLine.get(index);
|
|
18295
|
-
if (box === void 0)
|
|
18312
|
+
if (box === void 0) {
|
|
18313
|
+
unitAtLine[index] = inEffect();
|
|
18314
|
+
continue;
|
|
18315
|
+
}
|
|
18296
18316
|
const section = open[open.length - 1];
|
|
18297
18317
|
if (section !== void 0) {
|
|
18298
18318
|
section.unit.boxes.push(box);
|
|
18319
|
+
unitAtLine[index] = section.index;
|
|
18299
18320
|
continue;
|
|
18300
18321
|
}
|
|
18322
|
+
const unitIndex = units.length;
|
|
18301
18323
|
units.push({
|
|
18302
18324
|
key: box.title,
|
|
18303
18325
|
task: null,
|
|
18304
18326
|
boxes: [box]
|
|
18305
18327
|
});
|
|
18328
|
+
unitAtLine[index] = unitIndex;
|
|
18329
|
+
loneBoxUnit = unitIndex;
|
|
18306
18330
|
}
|
|
18307
|
-
return
|
|
18331
|
+
return {
|
|
18332
|
+
units,
|
|
18333
|
+
unitAtLine
|
|
18334
|
+
};
|
|
18335
|
+
}
|
|
18336
|
+
function groupPlanUnits(text, boxes) {
|
|
18337
|
+
return walkUnits(text, boxes).units;
|
|
18308
18338
|
}
|
|
18309
18339
|
//#endregion
|
|
18310
18340
|
//#region src/plan-workspace/plan-boxes.ts
|
|
@@ -18375,7 +18405,7 @@ function deferredLineOf(lines, fenced, start, blockEnd) {
|
|
|
18375
18405
|
if (fenced[index] === true) continue;
|
|
18376
18406
|
const match = DEFERRED_LINE_REGEX.exec(lines[index] ?? "");
|
|
18377
18407
|
if (match === null) continue;
|
|
18378
|
-
return (match[1] ?? "").trim();
|
|
18408
|
+
return boxParagraph(lines, fenced, index, blockEnd, (match[1] ?? "").trim());
|
|
18379
18409
|
}
|
|
18380
18410
|
return null;
|
|
18381
18411
|
}
|
|
@@ -18509,7 +18539,7 @@ function parsePlanBoxes(planText) {
|
|
|
18509
18539
|
if (fenced[index] === true) continue;
|
|
18510
18540
|
const noteMatch = NOTE_LINE_REGEX.exec(lines[index] ?? "");
|
|
18511
18541
|
if (noteMatch === null) continue;
|
|
18512
|
-
const text = (noteMatch[2] ?? "").trim();
|
|
18542
|
+
const text = boxParagraph(lines, fenced, index, blockEnd, (noteMatch[2] ?? "").trim());
|
|
18513
18543
|
if (text !== "") notes.push({
|
|
18514
18544
|
kind: noteKind(noteMatch[1] ?? ""),
|
|
18515
18545
|
text
|
|
@@ -18520,7 +18550,7 @@ function parsePlanBoxes(planText) {
|
|
|
18520
18550
|
if (fenced[index] === true) continue;
|
|
18521
18551
|
const declinedMatch = DECLINED_LINE_REGEX.exec(lines[index] ?? "");
|
|
18522
18552
|
if (declinedMatch === null) continue;
|
|
18523
|
-
const remainder = (declinedMatch[1] ?? "").trim();
|
|
18553
|
+
const remainder = boxParagraph(lines, fenced, index, blockEnd, (declinedMatch[1] ?? "").trim());
|
|
18524
18554
|
if (remainder !== "") {
|
|
18525
18555
|
reason = remainder;
|
|
18526
18556
|
break;
|
|
@@ -24274,6 +24304,30 @@ function formatExplain(details) {
|
|
|
24274
24304
|
}
|
|
24275
24305
|
return lines.join("\n");
|
|
24276
24306
|
}
|
|
24307
|
+
function outlierAttributionLines(attribution, failedKeys) {
|
|
24308
|
+
const lines = [];
|
|
24309
|
+
let printedAttribution = false;
|
|
24310
|
+
for (const o of attribution.newOutliers) {
|
|
24311
|
+
if (!failedKeys.has(o.key)) continue;
|
|
24312
|
+
lines.push(` ${CEILING_LABELS[o.key]}: ${o.module} -- -> ${o.current} (new)`);
|
|
24313
|
+
printedAttribution = true;
|
|
24314
|
+
}
|
|
24315
|
+
for (const o of attribution.baseOutliers) {
|
|
24316
|
+
if (!failedKeys.has(o.key)) continue;
|
|
24317
|
+
lines.push(` ${CEILING_LABELS[o.key]}: ${o.module} ${o.base} -> ${o.current} (on base)`);
|
|
24318
|
+
printedAttribution = true;
|
|
24319
|
+
}
|
|
24320
|
+
for (const o of attribution.unattributedOutliers) {
|
|
24321
|
+
if (!failedKeys.has(o.key)) continue;
|
|
24322
|
+
lines.push(` ${CEILING_LABELS[o.key]}: ${o.module} -- -> ${o.current} (no ceiling)`);
|
|
24323
|
+
printedAttribution = true;
|
|
24324
|
+
}
|
|
24325
|
+
if (printedAttribution) {
|
|
24326
|
+
if (attribution.outlierBase.status === "measured") lines.push(` outliers attributed against the merge base ${attribution.outlierBase.mergeBase}`);
|
|
24327
|
+
else if (attribution.outlierBase.status === "unavailable") lines.push(` outliers not attributed: the merge base ${attribution.outlierBase.mergeBase} could not be measured (${attribution.outlierBase.reason})`);
|
|
24328
|
+
}
|
|
24329
|
+
return lines;
|
|
24330
|
+
}
|
|
24277
24331
|
function formatCompareDiff(result, details, attribution) {
|
|
24278
24332
|
const lines = [];
|
|
24279
24333
|
for (const m of result.metrics) {
|
|
@@ -24301,26 +24355,7 @@ function formatCompareDiff(result, details, attribution) {
|
|
|
24301
24355
|
if (s.measurerChanged === true) lines.push(` size: ${s.id} measured by code this branch changed`);
|
|
24302
24356
|
}
|
|
24303
24357
|
const failedKeys = new Set(result.metrics.filter((m) => m.pass === false).map((m) => m.key));
|
|
24304
|
-
|
|
24305
|
-
for (const o of attribution.newOutliers) {
|
|
24306
|
-
if (!failedKeys.has(o.key)) continue;
|
|
24307
|
-
lines.push(` ${CEILING_LABELS[o.key]}: ${o.module} -- -> ${o.current} (new)`);
|
|
24308
|
-
printedAttribution = true;
|
|
24309
|
-
}
|
|
24310
|
-
for (const o of attribution.baseOutliers) {
|
|
24311
|
-
if (!failedKeys.has(o.key)) continue;
|
|
24312
|
-
lines.push(` ${CEILING_LABELS[o.key]}: ${o.module} ${o.base} -> ${o.current} (on base)`);
|
|
24313
|
-
printedAttribution = true;
|
|
24314
|
-
}
|
|
24315
|
-
for (const o of attribution.unattributedOutliers) {
|
|
24316
|
-
if (!failedKeys.has(o.key)) continue;
|
|
24317
|
-
lines.push(` ${CEILING_LABELS[o.key]}: ${o.module} -- -> ${o.current} (no ceiling)`);
|
|
24318
|
-
printedAttribution = true;
|
|
24319
|
-
}
|
|
24320
|
-
if (printedAttribution) {
|
|
24321
|
-
if (attribution.outlierBase.status === "measured") lines.push(` outliers attributed against the merge base ${attribution.outlierBase.mergeBase}`);
|
|
24322
|
-
else if (attribution.outlierBase.status === "unavailable") lines.push(` outliers not attributed: the merge base ${attribution.outlierBase.mergeBase} could not be measured (${attribution.outlierBase.reason})`);
|
|
24323
|
-
}
|
|
24358
|
+
lines.push(...outlierAttributionLines(attribution, failedKeys));
|
|
24324
24359
|
lines.push(result.pass ? "health: PASS" : "health: FAIL");
|
|
24325
24360
|
return lines.join("\n");
|
|
24326
24361
|
}
|
|
@@ -29344,7 +29379,7 @@ async function runCli(config) {
|
|
|
29344
29379
|
//#region src/cli-main.ts
|
|
29345
29380
|
setLogLevel(resolveLogLevel({}));
|
|
29346
29381
|
setForgejoLogger(log$1);
|
|
29347
|
-
const displayVersion = "0.99.
|
|
29382
|
+
const displayVersion = "0.99.1";
|
|
29348
29383
|
const bstSubCommands = {
|
|
29349
29384
|
"repo:sync": syncCommand,
|
|
29350
29385
|
"checks:run": runChecksCommand,
|