@biffo/cli 0.279.1 → 0.280.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 CHANGED
@@ -8287,6 +8287,13 @@ import { Command as Command14 } from "commander";
8287
8287
 
8288
8288
  // src/adapters/registry/index.ts
8289
8289
  import { z as z8 } from "zod";
8290
+ var UiComponentEntrySchema = z8.object({
8291
+ type: z8.enum(["nav-link", "page", "dashboard-widget", "modal", "dialog"]),
8292
+ label: z8.string(),
8293
+ path: z8.string(),
8294
+ icon: z8.string().optional(),
8295
+ requires_auth: z8.boolean().optional()
8296
+ });
8290
8297
  var RegistryPluginEntrySchema = z8.object({
8291
8298
  name: z8.string().regex(/^[a-z][a-z0-9-]*$/),
8292
8299
  version: z8.string().regex(/^\d+\.\d+\.\d+$/),
@@ -8298,7 +8305,7 @@ var RegistryPluginEntrySchema = z8.object({
8298
8305
  required_core_version: z8.string().optional(),
8299
8306
  infra_modules: z8.array(z8.string()).optional(),
8300
8307
  api_routes: z8.array(z8.string()).optional(),
8301
- ui_components: z8.array(z8.string()).optional(),
8308
+ ui_components: z8.array(UiComponentEntrySchema).optional(),
8302
8309
  status: z8.enum(["active", "disabled"])
8303
8310
  });
8304
8311
  var PluginRegistrySchema = z8.object({
@@ -8414,7 +8421,8 @@ function printEntry(entry) {
8414
8421
  console.log(` API routes: ${entry.api_routes.join(", ")}`);
8415
8422
  }
8416
8423
  if (entry.ui_components?.length) {
8417
- console.log(` UI components: ${entry.ui_components.join(", ")}`);
8424
+ const summary = entry.ui_components.map((c) => `${c.label} (${c.type})`).join(", ");
8425
+ console.log(` UI components: ${summary}`);
8418
8426
  }
8419
8427
  console.log("");
8420
8428
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biffo/cli",
3
- "version": "0.279.1",
3
+ "version": "0.280.0",
4
4
  "description": "Biffo project scaffolding CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -218,17 +218,49 @@ while :; do
218
218
  exit 2
219
219
  fi
220
220
 
221
+ # Two things this filter has to get right, and the second one bit us (#1552).
222
+ #
223
+ # 1. `when` must not be keyed on `.completedAt` alone. A check run that is
224
+ # STILL RUNNING carries `completedAt: "0001-01-01T00:00:00Z"` — GitHub sends
225
+ # the zero-value timestamp rather than omitting the field or sending null.
226
+ # `//` only falls through on null/false, so a plain
227
+ # `.completedAt // .startedAt` returns that zero date and the FRESHEST run
228
+ # sorts as the oldest value there is. `max_by(.when)` then discarded the
229
+ # running run in favour of the superseded one, and this script reported
230
+ # "All checks concluded, none failed" while `Release Guards` was mid-flight
231
+ # on PR #1548 — GitHub had the PR BLOCKED and was right. So the candidate
232
+ # timestamps are filtered before the first non-empty one is taken.
233
+ #
234
+ # 2. Recency must not be the thing that decides it. Even with the timestamp
235
+ # fixed, "newest wins" answers a proxy question; the real one is "is ANY run
236
+ # for this context still in flight?". So an unfinished entry outranks every
237
+ # concluded one for the same name explicitly, and only a group with nothing
238
+ # unfinished falls back to newest-wins (which is what #1333 needs, so a
239
+ # re-run's SUCCESS supersedes the earlier FAILURE).
240
+ #
241
+ # `seen` carries the pre-collapse count per context so the report can state its
242
+ # denominator instead of implying one (#1363).
221
243
  rollup=$(gh_pr view "$PR" --json statusCheckRollup --jq '
222
244
  [ .statusCheckRollup[]?
223
245
  | { name: (.name // .context),
224
246
  state: (.conclusion // .state // (if .status == "COMPLETED" then "" else null end)),
225
- when: (.completedAt // .startedAt // .updatedAt // .createdAt // "")
247
+ when: ([ .completedAt, .startedAt, .updatedAt, .createdAt ]
248
+ | map(select(. != null and . != "" and . != "0001-01-01T00:00:00Z"))
249
+ | first // "")
226
250
  }
227
251
  ]
228
252
  | group_by(.name)
229
- | map(max_by(.when))
253
+ | map(
254
+ ([ .[] | select(.state == null or .state == "" or .state == "PENDING"
255
+ or .state == "IN_PROGRESS" or .state == "QUEUED"
256
+ or .state == "WAITING") ]) as $unfinished
257
+ | (if ($unfinished | length) > 0
258
+ then ($unfinished | max_by(.when))
259
+ else max_by(.when) end)
260
+ + { seen: length }
261
+ )
230
262
  | .[]
231
- | "\(.name)\t\(.state // "")"') || rollup=""
263
+ | "\(.name)\t\(.state // "")\t\(.seen)"') || rollup=""
232
264
 
233
265
  count=0
234
266
  [ -n "$rollup" ] && count=$(printf '%s\n' "$rollup" | grep -c .)
@@ -305,5 +337,11 @@ fi
305
337
 
306
338
  [ -n "$cancelled" ] && exit 1
307
339
 
308
- echo "${GREEN}All checks concluded, none failed.${OFF}"
340
+ # State the denominator rather than implying one (#1363). A green that does not
341
+ # say what it looked at cannot be told apart from a green that looked at less
342
+ # than it should have — and this script spent months collapsing a running run out
343
+ # of its own input without ever mentioning that it had collapsed anything.
344
+ runs_seen=$(printf '%s\n' "$rollup" | awk -F'\t' 'NF { s += ($3 == "" ? 1 : $3) } END { print s + 0 }')
345
+ echo "${GREEN}All checks concluded, none failed.${OFF} ${DIM}($count context(s), $runs_seen run(s)).${OFF}"
346
+ printf '%s\n' "$rollup" | awk -F'\t' 'NF && $3 > 1 { print " " $1 ": " $3 " runs, newest used" }'
309
347
  exit 0