bitboss-ui 3.0.0-beta.72 → 3.0.0-beta.73
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/bin/cli.mjs +3 -2
- package/dist/ai/BbDialog.md +3 -0
- package/dist/ai/BbForm.md +7 -6
- package/dist/ai/changelog.json +7 -3
- package/dist/ai/components.json +5 -5
- package/dist/ai/guides/migration/components/use-confirm.md +4 -1
- package/dist/ai/helpers/inertia/manifest.json +1 -1
- package/dist/ai/manifest/components/BbConfirm.removed.json +4 -4
- package/dist/ai/manifest/components/BbConfirmPortal.removed.json +2 -2
- package/dist/ai/manifest/components/BbToast.removed.json +1 -1
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/source/BbForm.md +9 -2
- package/dist/components/BbDialog/overlayActions.js +5 -5
- package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +33 -33
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/llms-full.txt +14 -7
- package/dist/styles.css +1 -1
- package/dist/utilities/functions/hash.js +90 -3
- package/dist/utilities/functions/isEqual.js +61 -3
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite.js +0 -1
- package/package.json +2 -2
- package/scripts/README.md +43 -43
- package/scripts/lib/helpers-add.mjs +21 -2
- package/scripts/lib/release-results.mjs +148 -4
|
@@ -1,4 +1,91 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toRaw as e } from "vue";
|
|
2
2
|
// src/utilities/functions/hash.ts
|
|
3
|
-
var t = (
|
|
4
|
-
|
|
3
|
+
var t = () => [
|
|
4
|
+
1083885398,
|
|
5
|
+
-537806866,
|
|
6
|
+
1531344004,
|
|
7
|
+
-1003682756
|
|
8
|
+
], n = (e, t) => {
|
|
9
|
+
let [n, r, i, a] = e;
|
|
10
|
+
for (let e = 0; e < t.length; e++) {
|
|
11
|
+
let o = t.charCodeAt(e);
|
|
12
|
+
n = Math.imul(n ^ o, 2654435761), r = Math.imul(r ^ o, 1597334677), i = Math.imul(i ^ o, 2246822519), a = Math.imul(a ^ o, 3266489917);
|
|
13
|
+
}
|
|
14
|
+
e[0] = n, e[1] = r, e[2] = i, e[3] = a;
|
|
15
|
+
}, r = (e, t) => (e = Math.imul(e ^ e >>> 16, 2246822507), e ^= Math.imul(t ^ t >>> 13, 3266489909), t = Math.imul(t ^ t >>> 16, 2246822507), t ^= Math.imul(e ^ e >>> 13, 3266489909), 4294967296 * (2097151 & t) + (e >>> 0)), i = (e) => e.toString(36).padStart(11, "0"), a = (e) => e === null || Object.getPrototypeOf(e) === null, o = (e) => Object.keys(e).sort(), s = (e) => {
|
|
16
|
+
let t = e.valueOf;
|
|
17
|
+
if (typeof t == "function" && t !== Object.prototype.valueOf) try {
|
|
18
|
+
let n = t.call(e);
|
|
19
|
+
if (n !== e && (typeof n != "object" || !n)) return { value: n };
|
|
20
|
+
} catch {}
|
|
21
|
+
}, c = (e) => typeof e.toString == "function" && e.toString !== Object.prototype.toString, l = (t, r, i) => {
|
|
22
|
+
switch (typeof r) {
|
|
23
|
+
case "undefined": return n(t, "u");
|
|
24
|
+
case "boolean": return n(t, r ? "t" : "f");
|
|
25
|
+
case "number": return n(t, `d${Object.is(r, -0) ? "-0" : String(r)};`);
|
|
26
|
+
case "bigint": return n(t, `g${String(r)};`);
|
|
27
|
+
case "string": return n(t, `s${r.length}:`), n(t, r);
|
|
28
|
+
case "symbol": {
|
|
29
|
+
let e = String(r.description);
|
|
30
|
+
return n(t, `y${e.length}:${e}`);
|
|
31
|
+
}
|
|
32
|
+
case "function": {
|
|
33
|
+
let e = String(r);
|
|
34
|
+
return n(t, `F${e.length}:${e}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (r === null) return n(t, "n");
|
|
38
|
+
let a = e(r), o = i.indexOf(a);
|
|
39
|
+
if (o !== -1) return n(t, `R${o};`);
|
|
40
|
+
i.push(a);
|
|
41
|
+
try {
|
|
42
|
+
f(t, a, i);
|
|
43
|
+
} finally {
|
|
44
|
+
i.pop();
|
|
45
|
+
}
|
|
46
|
+
}, u = (e, t) => n(e, `${t.length}:${t}`), d = (e, t) => [...e].map((e) => m(e, t)).sort(), f = (e, t, r) => {
|
|
47
|
+
if (Array.isArray(t)) {
|
|
48
|
+
n(e, `A${t.length}[`);
|
|
49
|
+
for (let n of t) l(e, n, r);
|
|
50
|
+
return n(e, "]");
|
|
51
|
+
}
|
|
52
|
+
if (t instanceof Date) return n(e, `D${t.getTime()};`);
|
|
53
|
+
if (t instanceof Map) {
|
|
54
|
+
let i = [...t.entries()].map(([e, t]) => `${m(e, r)}=${m(t, r)}`).sort();
|
|
55
|
+
return n(e, `M${i.length}{${i.join(",")}}`);
|
|
56
|
+
}
|
|
57
|
+
if (t instanceof Set) {
|
|
58
|
+
let i = d(t, r);
|
|
59
|
+
return n(e, `S${i.length}{${i.join(",")}}`);
|
|
60
|
+
}
|
|
61
|
+
if (typeof Blob < "u" && t instanceof Blob) return n(e, "B"), l(e, t.name ?? null, r), n(e, `${t.size};`), l(e, t.type, r), n(e, `${t.lastModified ?? ""};`);
|
|
62
|
+
if (a(Object.getPrototypeOf(t))) return p(e, t, r);
|
|
63
|
+
n(e, "C"), u(e, String(t.constructor?.name ?? ""));
|
|
64
|
+
let i = s(t);
|
|
65
|
+
return i ? (n(e, "v"), l(e, i.value, r)) : o(t).length === 0 && c(t) ? (n(e, "x"), l(e, String(t), r)) : p(e, t, r);
|
|
66
|
+
}, p = (e, t, r) => {
|
|
67
|
+
let i = o(t);
|
|
68
|
+
n(e, `O${i.length}{`);
|
|
69
|
+
for (let n of i) l(e, n, r), l(e, t[n], r);
|
|
70
|
+
n(e, "}");
|
|
71
|
+
}, m = (e, n) => {
|
|
72
|
+
let a = t();
|
|
73
|
+
return l(a, e, n), i(r(a[0], a[1])) + i(r(a[2], a[3]));
|
|
74
|
+
}, h = /^[A-Za-z0-9_-]{0,64}$/, g = (e) => {
|
|
75
|
+
if (Object.is(e, -0)) return "m0";
|
|
76
|
+
let t = String(e);
|
|
77
|
+
return /[.+-]/.test(t) ? t.replace(/[.+-]/g, (e) => e === "." ? "p" : e === "-" ? "m" : "") : t;
|
|
78
|
+
}, _ = (e, t = "bb") => {
|
|
79
|
+
switch (typeof e) {
|
|
80
|
+
case "number": return `${t}n${g(e)}`;
|
|
81
|
+
case "boolean": return `${t}${e ? "t" : "f"}`;
|
|
82
|
+
case "undefined": return `${t}u`;
|
|
83
|
+
case "bigint": return `${t}g${String(e).replace("-", "m")}`;
|
|
84
|
+
case "string":
|
|
85
|
+
if (h.test(e)) return `${t}s${e}`;
|
|
86
|
+
break;
|
|
87
|
+
default: if (e === null) return `${t}z`;
|
|
88
|
+
}
|
|
89
|
+
return `${t}h${m(e, [])}`;
|
|
90
|
+
};
|
|
91
|
+
export { c as hasCustomToString, _ as hash, s as primitiveValueOf };
|
|
@@ -1,4 +1,62 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { hasCustomToString as e, primitiveValueOf as t } from "./hash.js";
|
|
2
|
+
import { toRaw as n } from "vue";
|
|
2
3
|
// src/utilities/functions/isEqual.ts
|
|
3
|
-
var
|
|
4
|
-
|
|
4
|
+
var r = (e) => e === null || Object.getPrototypeOf(e) === null, i = (e, t) => a(e, t, []), a = (e, t, r) => {
|
|
5
|
+
if (Object.is(e, t)) return !0;
|
|
6
|
+
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
7
|
+
let i = n(e), a = n(t);
|
|
8
|
+
if (i === a) return !0;
|
|
9
|
+
for (let [e, t] of r) if (e === i && t === a) return !0;
|
|
10
|
+
r.push([i, a]);
|
|
11
|
+
try {
|
|
12
|
+
return o(i, a, r);
|
|
13
|
+
} finally {
|
|
14
|
+
r.pop();
|
|
15
|
+
}
|
|
16
|
+
}, o = (n, i, o) => {
|
|
17
|
+
if (Object.getPrototypeOf(n) !== Object.getPrototypeOf(i)) return !r(Object.getPrototypeOf(n)) || !r(Object.getPrototypeOf(i)) ? !1 : s(n, i, o);
|
|
18
|
+
if (Array.isArray(n)) {
|
|
19
|
+
let e = i;
|
|
20
|
+
if (n.length !== e.length) return !1;
|
|
21
|
+
for (let t = 0; t < n.length; t++) if (!a(n[t], e[t], o)) return !1;
|
|
22
|
+
return !0;
|
|
23
|
+
}
|
|
24
|
+
if (n instanceof Date) return Object.is(n.getTime(), i.getTime());
|
|
25
|
+
if (n instanceof Map) return c(n, i, o);
|
|
26
|
+
if (n instanceof Set) return l(n, i, o);
|
|
27
|
+
if (typeof Blob < "u" && n instanceof Blob) {
|
|
28
|
+
let e = n, t = i;
|
|
29
|
+
return e.name === t.name && e.size === t.size && e.type === t.type && e.lastModified === t.lastModified;
|
|
30
|
+
}
|
|
31
|
+
if (r(Object.getPrototypeOf(n))) return s(n, i, o);
|
|
32
|
+
let u = t(n);
|
|
33
|
+
if (u) {
|
|
34
|
+
let e = t(i);
|
|
35
|
+
return !!e && Object.is(u.value, e.value);
|
|
36
|
+
}
|
|
37
|
+
return Object.keys(n).length === 0 && Object.keys(i).length === 0 && e(n) ? String(n) === String(i) : s(n, i, o);
|
|
38
|
+
}, s = (e, t, n) => {
|
|
39
|
+
let r = Object.keys(e);
|
|
40
|
+
if (r.length !== Object.keys(t).length) return !1;
|
|
41
|
+
for (let i of r) if (!Object.prototype.hasOwnProperty.call(t, i) || !a(e[i], t[i], n)) return !1;
|
|
42
|
+
return !0;
|
|
43
|
+
}, c = (e, t, n) => {
|
|
44
|
+
if (e.size !== t.size) return !1;
|
|
45
|
+
let r = [...t.entries()];
|
|
46
|
+
for (let [i, o] of e) {
|
|
47
|
+
let e = t.has(i) ? r.findIndex(([e]) => e === i || Object.is(e, i)) : r.findIndex(([e]) => a(e, i, n));
|
|
48
|
+
if (e === -1 || !a(o, r[e][1], n)) return !1;
|
|
49
|
+
r.splice(e, 1);
|
|
50
|
+
}
|
|
51
|
+
return !0;
|
|
52
|
+
}, l = (e, t, n) => {
|
|
53
|
+
if (e.size !== t.size) return !1;
|
|
54
|
+
let r = [...t];
|
|
55
|
+
for (let i of e) {
|
|
56
|
+
let e = t.has(i) ? r.findIndex((e) => e === i || Object.is(e, i)) : r.findIndex((e) => a(e, i, n));
|
|
57
|
+
if (e === -1) return !1;
|
|
58
|
+
r.splice(e, 1);
|
|
59
|
+
}
|
|
60
|
+
return !0;
|
|
61
|
+
};
|
|
62
|
+
export { i as isEqual };
|
|
@@ -9,7 +9,7 @@ function r() {
|
|
|
9
9
|
if (process.env.NODE_ENV === "production" || n || typeof window > "u") return;
|
|
10
10
|
n = !0;
|
|
11
11
|
let r = () => {
|
|
12
|
-
let n = t("3.0.0-beta.
|
|
12
|
+
let n = t("3.0.0-beta.73", getComputedStyle(document.documentElement).getPropertyValue(e));
|
|
13
13
|
n && console.warn(n);
|
|
14
14
|
};
|
|
15
15
|
document.readyState === "complete" ? setTimeout(r, 0) : window.addEventListener("load", r, { once: !0 });
|
package/dist/vite.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bitboss-ui",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.73",
|
|
4
4
|
"description": "Vue 3 component library by BitBoss: forms, selects, layout, overlays, and more.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
"heroicons": "^2.2.0",
|
|
209
209
|
"husky": "^9.1.7",
|
|
210
210
|
"inertia2-vue3": "npm:@inertiajs/vue3@^2.3.10",
|
|
211
|
-
"joi": "^18.2
|
|
211
|
+
"joi": "^18.3.2",
|
|
212
212
|
"lightningcss": "^1.32.0",
|
|
213
213
|
"lint-staged": "^17.0.4",
|
|
214
214
|
"nuxt": "^4.6.3",
|
package/scripts/README.md
CHANGED
|
@@ -10,37 +10,37 @@ several of them exist because the thing they now catch already shipped once.
|
|
|
10
10
|
|
|
11
11
|
## Gates — wired into `npm run gate` and CI
|
|
12
12
|
|
|
13
|
-
| Command | Script | Guards
|
|
14
|
-
| ----------------------- | -------------------------------- |
|
|
15
|
-
| `check:docs` | `generate-component-docs.ts` | The generated contract docs are in sync with source. `--strict` fails on any prop/event/slot the docs claim and the component does not have.
|
|
16
|
-
| `check:default-docs` | `check-default-docs.ts` | Every prop with a runtime default carries an `@defaultValue` tag, so the docs never state a default the code disagrees with.
|
|
17
|
-
| `check:doc-drift` | `check-doc-drift.mjs` | API names in prose **outside** code fences — tables and inline claims — still exist. Catches the half of doc rot the fence validator cannot see.
|
|
18
|
-
| `check:doc-ts` | `check-doc-ts.mjs` | Every `ts` fence and every `<script>` inside a `vue` fence parses, and every `bitboss-ui` import resolves to a real export via the `exports` map.
|
|
19
|
-
| `check:doc-links` | `check-doc-links.mjs` | Relative links inside the shipped `dist/ai` knowledge base resolve. A dangling link in an agent's router is a dead end.
|
|
20
|
-
| `check:recipes` | `check-recipes.mjs` | Whole-page recipes use real component APIs — same checker as the ESLint rule, so a recipe cannot teach a prop that does not exist.
|
|
21
|
-
| `check:examples` | `check-examples.mjs` | Every example (companion SFC or live guide fence) is copy-safe: imports only `vue`, `bitboss-ui` and declared packages; every provider icon name exists in its installed set, and `local:` appears only in BbIcon's guide; no `setInterval`, no mount hook, no timer that starts without a user action (Q18.21).
|
|
22
|
-
| `check:guide-types` | `check-guide-types.mjs` | The companion example SFCs on disk, and every doc code fence that uses the library (given the imports it implies), type-check against the real components.
|
|
23
|
-
| `check:fixture-types` | `check-fixture-types.mjs` | The platform fixtures type-check against the built package.
|
|
24
|
-
| `check:tokens` | `check-tokens.mjs` | Only declared `--bb-*` tokens are used, colour mixing happens `in oklab`, and percentages stay on the emphasis ladder.
|
|
25
|
-
| `check:pins` | `check-pins.mjs` | Every pin-the-bug / skipped test cites a ledger ID that exists. A pinned bug with no ledger entry quietly becomes the spec.
|
|
26
|
-
| `check:register` | `check-deprecation-register.mjs` | Every §F breaking-rename row is wired to `ai-deprecations.json`, so the runtime warner, the CLI and the ESLint autofix all know about the rename.
|
|
27
|
-
| `check:mcp` | `check-mcp.mjs` | Spawns the real MCP server and speaks JSON-RPC over stdio: all 8 tools, their schemas, refusal paths, and 8 path-traversal attempts.
|
|
28
|
-
| `check:ai-evals` | `run-ai-evals.mjs` | The golden validator tasks still pass — the regression suite for "would an agent be told the right thing?"
|
|
29
|
-
| `check-api` | `check-api-consistency.ts` | Cross-component API divergence, diffed against an accepted baseline. A NEW divergence fails; accept one with `-- --update-baseline`.
|
|
30
|
-
| `check:inertia-props` | `check-inertia-link-props.mjs` | Every prop Inertia's `Link` accepts is forwarded by BbButton. The list is hand-written because `@inertiajs/vue3` is an optional peer our public types may not import — so nothing but this gate notices when Inertia adds one.
|
|
31
|
-
| `check:virtual-modules` | `check-virtual-modules.mjs` | Every `virtual:` id `src/vite-plugin.ts` or `src/nuxt-module.ts` declares is known to the scoped gate (`lib/scope-plan.mjs` VIRTUAL_MODULES): the module graph drops edges through virtual ids, so a new one is a decision, never a silent hole in the scope.
|
|
32
|
-
| `release:check` | `release-check.mjs` | THE quality wall: every static check first (build, lint, gates, dist checks, node tests), then the browser tiers, which a static red skips. Prints all results; reruns a failed vitest file once and reports it FLAKY. Writes a results record (failed files + WARN passed-only-alone); `--plan` runs a rerun's steps/files. The pre-push gate runs it on every v3 push.
|
|
33
|
-
| `hooks:install` | `hooks-install.mjs` | Installs the git hooks and the gate into `.git/bb-hooks` (checkout-independent) and sets `core.hooksPath`; `prepare` runs it. Reads the hooks from `origin/v3`, not the checkout (`--from-checkout` to try a change); `--repair` fixes a reset path first (`push:check`, Claude Code PreToolUse). `hooks:check` (`--check`) reports every broken state.
|
|
34
|
-
| `gate` | `gate.mjs` | The lane gate (Q96.3): build + every static check of the wall (one list, `lib/wall-steps.mjs`) and the node/types/ssr projects, then the browser tiers SCOPED to the change since the last full pass (Q96.1, `scope.mjs`; anything the module graph cannot see runs them in full). `-- --all` for the full suite as the wall runs it, `-- --tests=none` for static only, `-- --shadow` to also run the full tiers and log the comparison, `-- --shadow-report` to sum the log up, `-- --stats [--days N]` for what the walls spend their time on (Q96.6, `lib/wall-stats.mjs`). Every step runs; one table of exit codes + durations. Runs in your checkout before reporting; `push:check` stays the commit-exact gate.
|
|
35
|
-
| — | `spotlight.mjs` | The wall step before the browser chunks (Q96.2): a component or directive this change publishes (new runtime exports in `src/index.ts` since the last full pass) runs its own tests on Chromium, Firefox and WebKit first; red stops the queue. `--list` prints what it would run.
|
|
36
|
-
| — | `self-tests.mjs` | The wall step `gate self-tests`: runs `test:land`, `test:pre-push-gate` and `test:release-yml` when the change since the last full pass touches the gate code they cover (map: `lib/self-tests.mjs`; an unmapped gate path runs all three). `--list` prints the plan.
|
|
37
|
-
| `land` | `land.mjs` | Lands a lane branch on local `v3` (Q96.4): merge in a clean worktree of `v3` (reinstalling deps there when the merge changes `package.json`/the lockfile), `npm run gate` there (scoped from the last full pass below the merge, so it covers what either side changed), verify the gated tree is still exactly the merge commit, then fast-forward the main checkout only on green. Prints the browser files the scoped gate selected. Uncommitted work in main never blocks unless it overlaps the merge. Every refusal (wrong branch in main, an edit to a path the merge changes or an untracked file at a path it adds, missing or landed branch, conflict, red or tree-dirtying gate) says why and leaves `v3` untouched. Never pushes. Tested end-to-end by `test-land.sh` (`npm run test:land`).
|
|
38
|
-
| `push:check` | `pre-push-gate.mjs --sha HEAD` | Runs the pre-push gate for HEAD without pushing, in a clean worktree, and records the pass, so the push that follows is instant.
|
|
39
|
-
| `release:local` | `release-local.mjs` | Everything owed before a tag, in a clean short-path worktree of HEAD: the static half of release:check, fixtures:install, eval:prepare and the consumer checks, then the browser tiers, test:fixtures and test:engines. Writes a results record too and prints the tag commands on green. Red? Fix, commit, `-- --rerun-failed
|
|
40
|
-
| `scope` | `scope.mjs` | The scoped rule (Q96.1, `lib/scope-plan.mjs`): what the browser tiers must rerun since the last full pass — the Vitest module graph at the base (a throwaway snapshot) and at HEAD (`lib/scope-graph.mjs`), the code the build plugin generates for its virtual modules, guide tests naming a changed component, widened to whole chunks (`lib/browser-chunks.mjs
|
|
41
|
-
| `test:pre-push-gate` | `test-pre-push-gate.sh` | End-to-end test of the pre-push hook: real `git push` calls to throwaway bare remotes, with a stub wall.
|
|
42
|
-
| `check:pack` | `check-pack.mjs` | The tarball: required files, byte/count floors, **the manifest covers every component `src/index.ts` exports**, and the shipped + tracked variant/locale registries list built-in defaults ONLY.
|
|
43
|
-
| `check:commit` | `check-commit-msg.mjs` | Commit message shape (the commit-msg hook).
|
|
13
|
+
| Command | Script | Guards |
|
|
14
|
+
| ----------------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| `check:docs` | `generate-component-docs.ts` | The generated contract docs are in sync with source. `--strict` fails on any prop/event/slot the docs claim and the component does not have. |
|
|
16
|
+
| `check:default-docs` | `check-default-docs.ts` | Every prop with a runtime default carries an `@defaultValue` tag, so the docs never state a default the code disagrees with. |
|
|
17
|
+
| `check:doc-drift` | `check-doc-drift.mjs` | API names in prose **outside** code fences — tables and inline claims — still exist. Catches the half of doc rot the fence validator cannot see. |
|
|
18
|
+
| `check:doc-ts` | `check-doc-ts.mjs` | Every `ts` fence and every `<script>` inside a `vue` fence parses, and every `bitboss-ui` import resolves to a real export via the `exports` map. |
|
|
19
|
+
| `check:doc-links` | `check-doc-links.mjs` | Relative links inside the shipped `dist/ai` knowledge base resolve. A dangling link in an agent's router is a dead end. |
|
|
20
|
+
| `check:recipes` | `check-recipes.mjs` | Whole-page recipes use real component APIs — same checker as the ESLint rule, so a recipe cannot teach a prop that does not exist. |
|
|
21
|
+
| `check:examples` | `check-examples.mjs` | Every example (companion SFC or live guide fence) is copy-safe: imports only `vue`, `bitboss-ui` and declared packages; every provider icon name exists in its installed set, and `local:` appears only in BbIcon's guide; no `setInterval`, no mount hook, no timer that starts without a user action (Q18.21). |
|
|
22
|
+
| `check:guide-types` | `check-guide-types.mjs` | The companion example SFCs on disk, and every doc code fence that uses the library (given the imports it implies), type-check against the real components. |
|
|
23
|
+
| `check:fixture-types` | `check-fixture-types.mjs` | The platform fixtures type-check against the built package. |
|
|
24
|
+
| `check:tokens` | `check-tokens.mjs` | Only declared `--bb-*` tokens are used, colour mixing happens `in oklab`, and percentages stay on the emphasis ladder. |
|
|
25
|
+
| `check:pins` | `check-pins.mjs` | Every pin-the-bug / skipped test cites a ledger ID that exists. A pinned bug with no ledger entry quietly becomes the spec. |
|
|
26
|
+
| `check:register` | `check-deprecation-register.mjs` | Every §F breaking-rename row is wired to `ai-deprecations.json`, so the runtime warner, the CLI and the ESLint autofix all know about the rename. |
|
|
27
|
+
| `check:mcp` | `check-mcp.mjs` | Spawns the real MCP server and speaks JSON-RPC over stdio: all 8 tools, their schemas, refusal paths, and 8 path-traversal attempts. |
|
|
28
|
+
| `check:ai-evals` | `run-ai-evals.mjs` | The golden validator tasks still pass — the regression suite for "would an agent be told the right thing?" |
|
|
29
|
+
| `check-api` | `check-api-consistency.ts` | Cross-component API divergence, diffed against an accepted baseline. A NEW divergence fails; accept one with `-- --update-baseline`. |
|
|
30
|
+
| `check:inertia-props` | `check-inertia-link-props.mjs` | Every prop Inertia's `Link` accepts is forwarded by BbButton. The list is hand-written because `@inertiajs/vue3` is an optional peer our public types may not import — so nothing but this gate notices when Inertia adds one. |
|
|
31
|
+
| `check:virtual-modules` | `check-virtual-modules.mjs` | Every `virtual:` id `src/vite-plugin.ts` or `src/nuxt-module.ts` declares is known to the scoped gate (`lib/scope-plan.mjs` VIRTUAL_MODULES): the module graph drops edges through virtual ids, so a new one is a decision, never a silent hole in the scope. |
|
|
32
|
+
| `release:check` | `release-check.mjs` | THE quality wall: every static check first (build, lint, gates, dist checks, node tests), then the browser tiers, which a static red skips. Prints all results; reruns a failed vitest file once and reports it FLAKY. Writes a results record (failed files + WARN passed-only-alone); `--plan` runs a rerun's steps/files. The pre-push gate runs it on every v3 push. |
|
|
33
|
+
| `hooks:install` | `hooks-install.mjs` | Installs the git hooks and the gate into `.git/bb-hooks` (checkout-independent) and sets `core.hooksPath`; `prepare` runs it. Reads the hooks from `origin/v3`, not the checkout (`--from-checkout` to try a change); `--repair` fixes a reset path first (`push:check`, Claude Code PreToolUse). `hooks:check` (`--check`) reports every broken state. |
|
|
34
|
+
| `gate` | `gate.mjs` | The lane gate (Q96.3): build + every static check of the wall (one list, `lib/wall-steps.mjs`) and the node/types/ssr projects, then the browser tiers SCOPED to the change since the last full pass (Q96.1, `scope.mjs`; anything the module graph cannot see runs them in full). `-- --all` for the full suite as the wall runs it, `-- --tests=none` for static only, `-- --shadow` to also run the full tiers and log the comparison, `-- --shadow-report` to sum the log up, `-- --stats [--days N]` for what the walls spend their time on (Q96.6, `lib/wall-stats.mjs`). Every step runs; one table of exit codes + durations. Runs in your checkout before reporting; `push:check` stays the commit-exact gate. |
|
|
35
|
+
| — | `spotlight.mjs` | The wall step before the browser chunks (Q96.2): a component or directive this change publishes (new runtime exports in `src/index.ts` since the last full pass) runs its own tests on Chromium, Firefox and WebKit first; red stops the queue. `--list` prints what it would run. |
|
|
36
|
+
| — | `self-tests.mjs` | The wall step `gate self-tests`: runs `test:land`, `test:pre-push-gate` and `test:release-yml` when the change since the last full pass touches the gate code they cover (map: `lib/self-tests.mjs`; an unmapped gate path runs all three). `--list` prints the plan. |
|
|
37
|
+
| `land` | `land.mjs` | Lands a lane branch on local `v3` (Q96.4): merge in a clean worktree of `v3` (reinstalling deps there when the merge changes `package.json`/the lockfile), `npm run gate` there (scoped from the last full pass below the merge, so it covers what either side changed), verify the gated tree is still exactly the merge commit, then fast-forward the main checkout only on green. Prints the browser files the scoped gate selected. Uncommitted work in main never blocks unless it overlaps the merge. Every refusal (wrong branch in main, an edit to a path the merge changes or an untracked file at a path it adds, missing or landed branch, conflict, red or tree-dirtying gate) says why and leaves `v3` untouched. Never pushes. Tested end-to-end by `test-land.sh` (`npm run test:land`). |
|
|
38
|
+
| `push:check` | `pre-push-gate.mjs --sha HEAD` | Runs the pre-push gate for HEAD without pushing, in a clean worktree, and records the pass, so the push that follows is instant. |
|
|
39
|
+
| `release:local` | `release-local.mjs` | Everything owed before a tag, in a clean short-path worktree of HEAD: the static half of release:check, fixtures:install, eval:prepare and the consumer checks, then the browser tiers, test:fixtures and test:engines. Writes a results record too and prints the tag commands on green. Red? Fix, commit, `-- --rerun-failed`: measured from the last full run, it reruns the static phase whole, the browser scope plus the run's failed files, carries only what passed there (dist consumers on an identical `dist/`), and green writes a `scoped` pass on a `release-run` base and a `rerun+…` tag line; when it cannot (first line says why) it reruns only what is owed, no pass — or `-- --scoped` (Q96.1): a fix on top of a full release pass reruns the static phase whole, the browser tiers on the scope, and carries the fixture/consumer/eval results when the rebuilt `dist/` is byte-identical; it writes a `scoped` pass and a `scoped+…` tag line. |
|
|
40
|
+
| `scope` | `scope.mjs` | The scoped rule (Q96.1, `lib/scope-plan.mjs`): what the browser tiers must rerun since the last full pass — the Vitest module graph at the base (a throwaway snapshot) and at HEAD (`lib/scope-graph.mjs`), the code the build plugin generates for its virtual modules, guide tests naming a changed component or one whose graph reaches the change (the guide machinery's string-resolution edges dropped), widened to whole chunks (`lib/browser-chunks.mjs`, packed by component folder). Fails closed to the full tiers on CSS, global files, virtual-module reach, unclassifiable files, mocking tests, an empty scope with `src/` changed, too many files, an old base. `--verify <rev>` recomputes a `scoped` pass record's scope. |
|
|
41
|
+
| `test:pre-push-gate` | `test-pre-push-gate.sh` | End-to-end test of the pre-push hook: real `git push` calls to throwaway bare remotes, with a stub wall. |
|
|
42
|
+
| `check:pack` | `check-pack.mjs` | The tarball: required files, byte/count floors, **the manifest covers every component `src/index.ts` exports**, and the shipped + tracked variant/locale registries list built-in defaults ONLY. |
|
|
43
|
+
| `check:commit` | `check-commit-msg.mjs` | Commit message shape (the commit-msg hook). |
|
|
44
44
|
|
|
45
45
|
`check:pack` runs in `npm run gate`, CI and at `prepack` — it needs a built
|
|
46
46
|
`dist/`, which the gate builds first.
|
|
@@ -61,15 +61,15 @@ several of them exist because the thing they now catch already shipped once.
|
|
|
61
61
|
|
|
62
62
|
## Test and eval runners
|
|
63
63
|
|
|
64
|
-
| Script | Does
|
|
65
|
-
| ------------------------------- |
|
|
66
|
-
| `run-browser-chunked.mjs` | Runs the browser suite in byte-budgeted chunks (a single Chromium cannot hold it). `--shard k/N` for the CI matrix.
|
|
67
|
-
| `run-e2es.mjs` | The platform fixture e2e suites.
|
|
68
|
-
| `eval-prepare.mjs` | Packs the library and installs the **tarball** into `fixtures/consumer` — the only test of the published artifact.
|
|
69
|
-
| `eval-staleness.mjs` | The two staleness gates that refuse to score a stale `dist/`. A benchmark on a stale artifact is worse than no number.
|
|
70
|
-
| `eval-sandbox.mjs` | Builds the contamination-proof sandboxed knowledge-base copy a solver agent is allowed to read.
|
|
71
|
-
| `run-eval-local.mjs` | Drives a local eval round and writes the brief.
|
|
72
|
-
| `run-eval-agent.mjs` | Drives a solver agent through a task.
|
|
73
|
-
| `score-eval.mjs` | Scores a solution across the four dimensions. Deliberately agent-agnostic.
|
|
74
|
-
| `invalidate-fixture-caches.mjs` | Clears the fixtures' Vite dep caches — a stale one has faked an "SSR bug" more than once.
|
|
75
|
-
| `doc-corpus.mjs` | Shared doc-file collection used by the doc gates.
|
|
64
|
+
| Script | Does |
|
|
65
|
+
| ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
66
|
+
| `run-browser-chunked.mjs` | Runs the browser suite in byte-budgeted chunks packed by component folder (a single Chromium cannot hold it). `--shard k/N` for the CI matrix. |
|
|
67
|
+
| `run-e2es.mjs` | The platform fixture e2e suites. |
|
|
68
|
+
| `eval-prepare.mjs` | Packs the library and installs the **tarball** into `fixtures/consumer` — the only test of the published artifact. |
|
|
69
|
+
| `eval-staleness.mjs` | The two staleness gates that refuse to score a stale `dist/`. A benchmark on a stale artifact is worse than no number. |
|
|
70
|
+
| `eval-sandbox.mjs` | Builds the contamination-proof sandboxed knowledge-base copy a solver agent is allowed to read. |
|
|
71
|
+
| `run-eval-local.mjs` | Drives a local eval round and writes the brief. |
|
|
72
|
+
| `run-eval-agent.mjs` | Drives a solver agent through a task. |
|
|
73
|
+
| `score-eval.mjs` | Scores a solution across the four dimensions. Deliberately agent-agnostic. |
|
|
74
|
+
| `invalidate-fixture-caches.mjs` | Clears the fixtures' Vite dep caches — a stale one has faked an "SSR bug" more than once. |
|
|
75
|
+
| `doc-corpus.mjs` | Shared doc-file collection used by the doc gates. |
|
|
@@ -1252,8 +1252,27 @@ function update(ctx, canon, ids, options, testHooks) {
|
|
|
1252
1252
|
};
|
|
1253
1253
|
}
|
|
1254
1254
|
|
|
1255
|
+
/**
|
|
1256
|
+
* `helpers diff`'s names: a helper id (its whole closure), or a shared
|
|
1257
|
+
* file's name (`utils`, `messages`), as `add` / `update` print them in
|
|
1258
|
+
* their `next` command.
|
|
1259
|
+
*/
|
|
1260
|
+
function diffNames(manifest, ids) {
|
|
1261
|
+
const files = (id) =>
|
|
1262
|
+
Object.hasOwn(manifest.helpers, id)
|
|
1263
|
+
? closureOf(manifest, id)
|
|
1264
|
+
: Object.hasOwn(manifest.files, `${id}.ts`)
|
|
1265
|
+
? [`${id}.ts`]
|
|
1266
|
+
: null;
|
|
1267
|
+
checkIds(
|
|
1268
|
+
manifest,
|
|
1269
|
+
ids.filter((id) => !/^[A-Za-z][A-Za-z0-9]*$/.test(id) || !files(id))
|
|
1270
|
+
);
|
|
1271
|
+
return [...new Set(ids.flatMap(files))].sort();
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1255
1274
|
function diff(ctx, canon, ids) {
|
|
1256
|
-
|
|
1275
|
+
const named = diffNames(ctx.manifest, ids);
|
|
1257
1276
|
if (!ctx.lock?.dir && !ids.length)
|
|
1258
1277
|
return {
|
|
1259
1278
|
code: 0,
|
|
@@ -1265,7 +1284,7 @@ function diff(ctx, canon, ids) {
|
|
|
1265
1284
|
const dir = resolveDir(ctx, {}, { required: true });
|
|
1266
1285
|
checkDirPath(ctx.root, dir.dir);
|
|
1267
1286
|
const names = ids.length
|
|
1268
|
-
?
|
|
1287
|
+
? named
|
|
1269
1288
|
: Object.keys(ctx.lock.files)
|
|
1270
1289
|
.filter((n) => Object.hasOwn(ctx.manifest.files, n))
|
|
1271
1290
|
.sort();
|
|
@@ -336,10 +336,107 @@ export function mergeRerun(previous, rerun) {
|
|
|
336
336
|
steps,
|
|
337
337
|
ok: steps.every((s) => !owed(s)),
|
|
338
338
|
warn: collectWarn(steps),
|
|
339
|
-
base: previous.base ??
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
339
|
+
base: previous.base ?? runEvidence(previous),
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// ---------------------------------------------------------------------------
|
|
344
|
+
// A rerun that earns the release pass.
|
|
345
|
+
// ---------------------------------------------------------------------------
|
|
346
|
+
|
|
347
|
+
const stepEvidence = (s) => ({
|
|
348
|
+
name: s.name,
|
|
349
|
+
status: s.status,
|
|
350
|
+
...(s.failedFiles?.length ? { failedFiles: s.failedFiles } : {}),
|
|
351
|
+
...(s.whole ? { whole: true } : {}),
|
|
352
|
+
...(s.sub ? { sub: s.sub.map(stepEvidence) } : {}),
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* What a rerun may lean on from the last FULL release:local run: its
|
|
357
|
+
* commit, time, dist/ hash, rule versions and each step's outcome (with the
|
|
358
|
+
* wall's steps inside release:check). A record that is not a full run gives
|
|
359
|
+
* only `{ sha, finishedAt }`, which no rerun can earn a pass from.
|
|
360
|
+
*/
|
|
361
|
+
export function runEvidence(record) {
|
|
362
|
+
if (record?.mode !== 'full')
|
|
363
|
+
return { sha: record?.sha, finishedAt: record?.finishedAt };
|
|
364
|
+
return {
|
|
365
|
+
sha: record.sha,
|
|
366
|
+
finishedAt: record.finishedAt,
|
|
367
|
+
distHash: record.distHash ?? null,
|
|
368
|
+
scopeVersion: record.scopeVersion ?? null,
|
|
369
|
+
gateVersion: record.gateVersion ?? null,
|
|
370
|
+
steps: record.steps.filter(Boolean).map(stepEvidence),
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/** The full run a rerun starts from: the record itself, or the base it kept. */
|
|
375
|
+
export const rerunBase = (previous) =>
|
|
376
|
+
previous?.mode === 'full' ? runEvidence(previous) : (previous?.base ?? null);
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Why a rerun on `sha` cannot earn the pass from `base` (first match), or
|
|
380
|
+
* null. `isAncestor(a, b)` and the versions come from the caller.
|
|
381
|
+
*/
|
|
382
|
+
export function rerunRefusal(
|
|
383
|
+
base,
|
|
384
|
+
{ sha, isAncestor, gateVersion, scopeVersion, now = Date.now(), maxAgeDays }
|
|
385
|
+
) {
|
|
386
|
+
if (!base?.steps)
|
|
387
|
+
return 'the last full run has no step record a rerun can lean on (it ran before reruns could earn the pass)';
|
|
388
|
+
if (!base.distHash)
|
|
389
|
+
return base.scopeVersion == null
|
|
390
|
+
? `the last full run (${String(base.sha).slice(0, 10)}) was recorded before reruns could earn the pass (no dist/ hash in it)`
|
|
391
|
+
: `the last full run (${String(base.sha).slice(0, 10)}) recorded no dist/ hash (its build did not finish green)`;
|
|
392
|
+
if (!isAncestor(base.sha, sha))
|
|
393
|
+
return `the last full run (${String(base.sha).slice(0, 10)}) is not an ancestor of ${sha.slice(0, 10)}`;
|
|
394
|
+
const days = (now - Date.parse(base.finishedAt)) / 86_400_000;
|
|
395
|
+
if (!(days <= maxAgeDays))
|
|
396
|
+
return `the last full run is ${Math.floor(days)} days old (more than ${maxAgeDays})`;
|
|
397
|
+
if (base.gateVersion !== gateVersion)
|
|
398
|
+
return `the last full run used gate version ${base.gateVersion}, this commit ${gateVersion}`;
|
|
399
|
+
if (base.scopeVersion !== scopeVersion)
|
|
400
|
+
return `the last full run used scope rule version ${base.scopeVersion}, this commit ${scopeVersion}`;
|
|
401
|
+
return null;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/** A step's outcome on the base run, inside release:check's wall too. */
|
|
405
|
+
export function baseStatus(base, name, sub = null) {
|
|
406
|
+
const step = base?.steps?.find((s) => s.name === name);
|
|
407
|
+
if (!sub) return step ?? null;
|
|
408
|
+
return step?.sub?.find((s) => s.name === sub) ?? null;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
const BROWSER_CHUNKED = 'test: browser (chunked)';
|
|
412
|
+
const GREGORIAN = 'test: browser (Gregorian-only build)';
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* The scope a pass-earning rerun hands release:check: the change's scope
|
|
416
|
+
* (scope.mjs, A..HEAD) plus every chunked file A failed, and the Gregorian
|
|
417
|
+
* tier when A's was not green. `null` = run the browser tier whole (A never
|
|
418
|
+
* ran it, or a chunked red there named no files).
|
|
419
|
+
*/
|
|
420
|
+
export function rerunScope(scope, base) {
|
|
421
|
+
const wall = baseStatus(base, 'release:check:browser');
|
|
422
|
+
const chunked = baseStatus(base, 'release:check:browser', BROWSER_CHUNKED);
|
|
423
|
+
if (!wall || wall.status === 'not run' || !wall.sub || !chunked) return null;
|
|
424
|
+
if (chunked.status !== 'pass' && (chunked.whole || !chunked.failedFiles))
|
|
425
|
+
return null;
|
|
426
|
+
const failed = chunked.status === 'pass' ? [] : chunked.failedFiles;
|
|
427
|
+
const affected = [...new Set([...(scope.affected ?? []), ...failed])].sort();
|
|
428
|
+
const gregorianStep = baseStatus(base, 'release:check:browser', GREGORIAN);
|
|
429
|
+
const gregorian =
|
|
430
|
+
Boolean(scope.gregorian) || gregorianStep?.status !== 'pass';
|
|
431
|
+
return {
|
|
432
|
+
...scope,
|
|
433
|
+
// A `none` scope runs no browser tier at all: anything A still owes
|
|
434
|
+
// there makes it `scoped` (an empty list then runs every chunk, which
|
|
435
|
+
// the chunked runner does to fail closed).
|
|
436
|
+
kind: affected.length || gregorian ? 'scoped' : scope.kind,
|
|
437
|
+
affected,
|
|
438
|
+
gregorian,
|
|
439
|
+
baseFailed: failed,
|
|
343
440
|
};
|
|
344
441
|
}
|
|
345
442
|
|
|
@@ -360,3 +457,50 @@ export function owedLines(steps, indent = ' ') {
|
|
|
360
457
|
export function existingFiles(files, root, exists = existsSync) {
|
|
361
458
|
return files.filter((f) => exists(path.join(root, f)));
|
|
362
459
|
}
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* The fixture, consumer and eval steps: they test the packed dist/, so a
|
|
463
|
+
* byte-identical dist/ may carry their result (scope-plan.mjs carryOver).
|
|
464
|
+
*/
|
|
465
|
+
export const DIST_CONSUMERS = new Set([
|
|
466
|
+
'fixtures:install',
|
|
467
|
+
'eval:prepare',
|
|
468
|
+
'consumer:strict',
|
|
469
|
+
'consumer:typecheck',
|
|
470
|
+
'consumer:build',
|
|
471
|
+
'test:fixtures',
|
|
472
|
+
'eval:references',
|
|
473
|
+
]);
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Whether a scoped release step rides over from its base, for `--scoped`
|
|
477
|
+
* (a full release pass: every step passed) and for a pass-earning rerun
|
|
478
|
+
* (`run`: the full run A's evidence, where only the steps it PASSED may
|
|
479
|
+
* carry). `carry()` is the dist/ verdict (carryOver), asked only for a
|
|
480
|
+
* dist consumer. Returns `{ carried: note }`, `{ files }` (test:engines red
|
|
481
|
+
* on A and unaffected since: only A's failed files), `{ runs: why }` for a
|
|
482
|
+
* dist consumer that must run, or null (the step runs as usual).
|
|
483
|
+
*/
|
|
484
|
+
export function carryDecision(name, { run = null, scope, carry, label }) {
|
|
485
|
+
const green = !run || baseStatus(run, name)?.status === 'pass';
|
|
486
|
+
if (DIST_CONSUMERS.has(name)) {
|
|
487
|
+
const verdict = carry();
|
|
488
|
+
if (verdict.carry && green)
|
|
489
|
+
return { carried: `carried from ${label}: ${verdict.reason}` };
|
|
490
|
+
return { runs: green ? verdict.reason : `it did not pass on ${label}` };
|
|
491
|
+
}
|
|
492
|
+
if (name === 'test:engines' && !scope.engines) {
|
|
493
|
+
if (green)
|
|
494
|
+
return {
|
|
495
|
+
carried: `carried from ${label}: no affected file is in the engines set`,
|
|
496
|
+
};
|
|
497
|
+
const onRun = baseStatus(run, name);
|
|
498
|
+
if (onRun?.status === 'FAIL' && !onRun.whole && onRun.failedFiles?.length)
|
|
499
|
+
return { files: onRun.failedFiles };
|
|
500
|
+
}
|
|
501
|
+
if (name === 'test:dates' && !scope.gregorian && green)
|
|
502
|
+
return {
|
|
503
|
+
carried: `carried from ${label}: no date-family file is affected`,
|
|
504
|
+
};
|
|
505
|
+
return null;
|
|
506
|
+
}
|