bitboss-ui 3.0.0-beta.70 → 3.0.0-beta.71

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.
Files changed (123) hide show
  1. package/dist/ai/BbBreadcrumbs.md +3 -0
  2. package/dist/ai/BbCheckbox.md +5 -6
  3. package/dist/ai/BbCheckboxGroup.md +25 -26
  4. package/dist/ai/BbColorInput.md +3 -4
  5. package/dist/ai/BbDatePickerInput.md +3 -4
  6. package/dist/ai/BbDropdown.md +35 -1
  7. package/dist/ai/BbDropdownButton.md +4 -3
  8. package/dist/ai/BbNumberInput.md +3 -4
  9. package/dist/ai/BbRadio.md +5 -6
  10. package/dist/ai/BbRadioGroup.md +24 -30
  11. package/dist/ai/BbRating.md +3 -9
  12. package/dist/ai/BbSelect.md +10 -11
  13. package/dist/ai/BbSlider.md +3 -9
  14. package/dist/ai/BbSwitch.md +6 -6
  15. package/dist/ai/BbSwitchGroup.md +4 -7
  16. package/dist/ai/BbTag.md +3 -4
  17. package/dist/ai/BbTextInput.md +11 -11
  18. package/dist/ai/BbTextarea.md +8 -8
  19. package/dist/ai/BbTimePickerInput.md +3 -4
  20. package/dist/ai/BbTooltip.md +17 -13
  21. package/dist/ai/CommonField.md +2 -10
  22. package/dist/ai/OptionsContainer.md +5 -13
  23. package/dist/ai/changelog.json +44 -5
  24. package/dist/ai/components.json +26 -26
  25. package/dist/ai/guides/migration/v2-to-v3.md +26 -2
  26. package/dist/ai/guides/preset-components.md +35 -10
  27. package/dist/ai/helpers/definePreset.json +8 -1
  28. package/dist/ai/helpers/definePreset.ts +35 -10
  29. package/dist/ai/helpers/inertia/manifest.json +1 -1
  30. package/dist/ai/manifest/common.json +2 -2
  31. package/dist/ai/manifest/components/BbBreadcrumbs.json +1 -1
  32. package/dist/ai/manifest/components/BbCheckbox.json +2 -2
  33. package/dist/ai/manifest/components/BbCheckbox.tree.json +1 -1
  34. package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +9 -19
  35. package/dist/ai/manifest/components/BbColorInput.json +2 -2
  36. package/dist/ai/manifest/components/BbColorInput.tree.json +1 -1
  37. package/dist/ai/manifest/components/BbDatePickerInput.tree.json +1 -1
  38. package/dist/ai/manifest/components/BbDropdown.json +2 -2
  39. package/dist/ai/manifest/components/BbDropdownButton.json +2 -2
  40. package/dist/ai/manifest/components/BbNumberInput.tree.json +1 -1
  41. package/dist/ai/manifest/components/BbRadio.tree.json +1 -1
  42. package/dist/ai/manifest/components/BbRadioGroup.tree.json +8 -18
  43. package/dist/ai/manifest/components/BbRating.tree.json +1 -1
  44. package/dist/ai/manifest/components/BbSelect.json +15 -15
  45. package/dist/ai/manifest/components/BbSelect.tree.json +1 -1
  46. package/dist/ai/manifest/components/BbSlider.tree.json +1 -1
  47. package/dist/ai/manifest/components/BbSwitch.tree.json +1 -1
  48. package/dist/ai/manifest/components/BbSwitchGroup.tree.json +2 -2
  49. package/dist/ai/manifest/components/BbTag.tree.json +1 -1
  50. package/dist/ai/manifest/components/BbTextInput.tree.json +1 -1
  51. package/dist/ai/manifest/components/BbTextarea.tree.json +1 -1
  52. package/dist/ai/manifest/components/BbTimePickerInput.tree.json +1 -1
  53. package/dist/ai/manifest/components/BbTooltip.json +1 -1
  54. package/dist/ai/manifest/components/BbTooltip.tree.json +2 -2
  55. package/dist/ai/manifest/components/CommonField.tree.json +5 -10
  56. package/dist/ai/manifest/components/OptionsContainer.tree.json +5 -13
  57. package/dist/ai/manifest/index.json +2 -2
  58. package/dist/ai/manifest/types.advanced.json +1 -1
  59. package/dist/ai/manifest/types.api.json +2 -2
  60. package/dist/ai/source/BbBreadcrumbs.md +31 -12
  61. package/dist/ai/source/BbCheckbox.md +36 -42
  62. package/dist/ai/source/BbCheckboxGroup.md +2 -4
  63. package/dist/ai/source/BbColorInput.md +2 -4
  64. package/dist/ai/source/BbDatePickerInput.md +2 -4
  65. package/dist/ai/source/BbDropdown.md +11 -2
  66. package/dist/ai/source/BbDropdownButton.md +4 -1
  67. package/dist/ai/source/BbDropdownGroup.md +9 -2
  68. package/dist/ai/source/BbNumberInput.md +2 -4
  69. package/dist/ai/source/BbRadio.md +36 -42
  70. package/dist/ai/source/BbRadioGroup.md +2 -4
  71. package/dist/ai/source/BbRating.md +2 -14
  72. package/dist/ai/source/BbSelect.md +30 -13
  73. package/dist/ai/source/BbSlider.md +2 -4
  74. package/dist/ai/source/BbSwitch.md +34 -38
  75. package/dist/ai/source/BbTable.md +4 -1
  76. package/dist/ai/source/BbTag.md +2 -4
  77. package/dist/ai/source/BbTextInput.md +2 -4
  78. package/dist/ai/source/BbTextarea.md +2 -4
  79. package/dist/ai/source/BbTimePickerInput.md +2 -4
  80. package/dist/ai/source/BbTooltip.md +9 -3
  81. package/dist/ai/source/CommonField.md +17 -106
  82. package/dist/ai/source/GuidesComponent.md +3 -0
  83. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +106 -106
  84. package/dist/components/BbBreadcrumbs/types.d.ts +6 -0
  85. package/dist/components/BbCheckbox/types.d.ts +2 -4
  86. package/dist/components/BbCheckboxGroup/types.d.ts +2 -4
  87. package/dist/components/BbColorInput/types.d.ts +2 -4
  88. package/dist/components/BbDatePickerInput/types.d.ts +2 -4
  89. package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +2 -0
  90. package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +121 -120
  91. package/dist/components/BbDropdown/normalizeGroups.js +37 -33
  92. package/dist/components/BbDropdown/types.d.ts +9 -2
  93. package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +95 -94
  94. package/dist/components/BbNumberInput/types.d.ts +2 -4
  95. package/dist/components/BbRadio/types.d.ts +2 -4
  96. package/dist/components/BbRadioGroup/types.d.ts +2 -4
  97. package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +116 -118
  98. package/dist/components/BbRating/types.d.ts +2 -4
  99. package/dist/components/BbSelect/BbSelect.vue.d.ts +10 -4
  100. package/dist/components/BbSelect/types.d.ts +4 -6
  101. package/dist/components/BbSlider/types.d.ts +2 -4
  102. package/dist/components/BbTable/types.d.ts +1 -1
  103. package/dist/components/BbTag/types.d.ts +2 -4
  104. package/dist/components/BbTextInput/types.d.ts +2 -4
  105. package/dist/components/BbTextarea/types.d.ts +2 -4
  106. package/dist/components/BbTimePickerInput/types.d.ts +2 -4
  107. package/dist/components/BbTooltip/ptKeys.generated.d.ts +4 -4
  108. package/dist/components/BbTooltip/types.d.ts +3 -1
  109. package/dist/components/CommonField/types.d.ts +2 -4
  110. package/dist/composables/useChoiceIndicator.js +67 -64
  111. package/dist/directives/bbDropdown.js +1 -1
  112. package/dist/llms-full.txt +246 -201
  113. package/dist/styles.css +2 -2
  114. package/dist/types/FieldLayout.d.ts +4 -1
  115. package/dist/types/ItemAccessor.d.ts +3 -1
  116. package/dist/types/ItemPath.d.ts +33 -0
  117. package/dist/utils/versionCheck.js +1 -1
  118. package/package.json +6 -4
  119. package/scripts/README.md +31 -29
  120. package/scripts/lib/define-preset-copy.mjs +1 -1
  121. package/scripts/lib/setup.mjs +8 -0
  122. package/scripts/lib/toolchain-check.mjs +125 -7
  123. package/scripts/lib/validate-bb-markup.mjs +1 -1
@@ -22,7 +22,10 @@
22
22
  export type FieldLayout = 'auto' | 'horizontal' | 'vertical' | 'label-fill' | 'input-fill' | `${string} ${string}`;
23
23
  /**
24
24
  * Where a column sits vertically in a side-by-side row (`labelAlign`,
25
- * `inputAlign`, `itemLabelAlign`, `itemInputAlign`).
25
+ * `inputAlign`, `itemLabelAlign`, `itemInputAlign`). A field's
26
+ * `labelAlign` / `inputAlign` default to `'top'` when omitted; a group's
27
+ * `itemLabelAlign` / `itemInputAlign` omitted keep the row's own
28
+ * alignment (the glyph centred on the label's first line).
26
29
  */
27
30
  export type FieldCrossAlign = 'top' | 'center' | 'bottom';
28
31
  /** @internal the accepted values; anything else is unset. */
@@ -24,4 +24,6 @@ import { PtNoInfer } from './passthrough.js';
24
24
  * `{ name: any } & { id: any }`, and the pt functions and slots that read the
25
25
  * item rejected every other field. `PtNoInfer` is the pre-5.4 `NoInfer`.
26
26
  */
27
- export type ItemAccessor<T, R = any> = (keyof PtNoInfer<T> & string) | (string & {}) | ((item: T) => R);
27
+ export type ItemAccessor<T, R = any> = (keyof PtNoInfer<T> & string) | (string & {}) | ItemGetter<T, R>;
28
+ /** One named type, so an intersection of two accessors keeps one signature. */
29
+ export type ItemGetter<T, R> = (item: T) => R;
@@ -0,0 +1,33 @@
1
+ import { PtNoInfer } from './passthrough.js';
2
+ import { NestedPaths } from '../components/BbTable/types.js';
3
+ type Present<V> = Exclude<V, null | undefined>;
4
+ type Nullish<V> = Extract<V, null | undefined>;
5
+ type KeysOf<V> = Present<V> extends readonly unknown[] ? `${number}` : Present<V> extends object ? keyof Present<V> & string : never;
6
+ type StepInto<V, K extends string> = Present<V> extends ReadonlyArray<infer E> ? E | undefined : K extends keyof Present<V> ? Present<V>[K] : never;
7
+ /**
8
+ * A few levels of paths to list before the first dot; the walk below takes
9
+ * over. Only keys every member of a union has.
10
+ */
11
+ type PreviewPaths<T> = 0 extends 1 & T ? string : Extract<NestedPaths<Present<T>>, keyof Present<T> | `${keyof Present<T> & string}.${string}`>;
12
+ /** The paths valid at the segment `P` has reached: only that path is walked. */
13
+ export type ItemPath<T, P extends string> = P extends `${infer H}.${infer R}` ? H extends KeysOf<T> ? `${H}.${ItemPath<StepInto<T, H>, R>}` : KeysOf<T> : KeysOf<T>;
14
+ type PathValue<T, P extends string> = P extends `${infer H}.${infer R}` ? PathValue<StepInto<T, H>, R> | Nullish<T> : StepInto<T, P> | Nullish<T>;
15
+ type IsAny<T> = 0 extends 1 & T ? true : false;
16
+ type Primitive = string | number | boolean | bigint | symbol | null | undefined;
17
+ /**
18
+ * What an item key prop accepts given what was written. A dotless key stays
19
+ * non-conditional on `T`, so a generic wrapper's `T extends { id: number }`
20
+ * can still pass `item-value="id"`.
21
+ */
22
+ export type ItemKeyInput<T, A> = [A] extends [undefined] ? string : [string] extends [A] ? A : A extends string ? A extends `${string}.${string}` ? ItemPath<PtNoInfer<T>, A> : ((keyof PtNoInfer<T> | keyof Present<PtNoInfer<T>>) & string) | PreviewPaths<PtNoInfer<T>> : A | string;
23
+ type DefaultOptionValue<T> = T extends {
24
+ value: infer V;
25
+ } ? V : T;
26
+ /** The value an option yields: the same chain as the runtime's. */
27
+ /** The value an option yields: the same chain as the runtime's. */
28
+ export type OptionValueOf<T, A> = [string] extends [A] ? any : IsAny<T> extends true ? any : [A] extends [undefined] ? DefaultOptionValue<T> : A extends (...args: never[]) => infer R ? R : A extends string ? T extends Primitive ? T : PathValue<T, A> : never;
29
+ /** `boolean` when not inferred, so a preset can still set `multiple`. */
30
+ export type MultipleInput<M> = [M] extends [false] ? boolean : M;
31
+ /** A `multiple` only known at run time leaves the model untyped. */
32
+ export type SelectModelOf<V, M> = [boolean] extends [M] ? any : [M] extends [true] ? V[] : V;
33
+ export {};
@@ -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.70", getComputedStyle(document.documentElement).getPropertyValue(e));
12
+ let n = t("3.0.0-beta.71", 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitboss-ui",
3
- "version": "3.0.0-beta.70",
3
+ "version": "3.0.0-beta.71",
4
4
  "description": "Vue 3 component library by BitBoss: forms, selects, layout, overlays, and more.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -59,12 +59,15 @@
59
59
  "census": "node scripts/boilerplate-census.mjs",
60
60
  "release:check": "node scripts/release-check.mjs",
61
61
  "release:local": "node scripts/release-local.mjs",
62
+ "gate": "node scripts/gate.mjs",
63
+ "land": "node scripts/land.mjs",
62
64
  "push:check": "node scripts/hooks-install.mjs --repair && node scripts/pre-push-gate.mjs --sha HEAD",
63
65
  "hooks:install": "node scripts/hooks-install.mjs",
64
66
  "hooks:check": "node scripts/hooks-install.mjs --check",
65
67
  "test:pre-push-gate": "bash scripts/test-pre-push-gate.sh",
66
68
  "pack:release": "node scripts/pack.mjs",
67
69
  "test:release-yml": "node scripts/test-release-yml.mjs",
70
+ "test:land": "bash scripts/test-land.sh",
68
71
  "check:pins": "node scripts/check-pins.mjs",
69
72
  "check:provenance": "node scripts/check-provenance.mjs",
70
73
  "check:queue": "node scripts/check-queue.mjs",
@@ -98,7 +101,6 @@
98
101
  "prepack": "node scripts/pack-guard.mjs && npm run build && npm run check:pack && npm pkg delete scripts.prepare",
99
102
  "preview": "vite preview",
100
103
  "storybook": "storybook dev -p 6006",
101
- "test": "node scripts/ensure-manifest.mjs && npm run check:pt-keys && vitest run && node scripts/check-guide-types.mjs && node scripts/score-eval.mjs --all --offline && npm run check:test-types && node scripts/check-fixture-types.mjs && node scripts/check-recipes.mjs && node scripts/check-examples.mjs && node scripts/recipes.mjs --check && node scripts/check-doc-drift.mjs && node scripts/check-doc-ts.mjs && node scripts/run-ai-evals.mjs && node scripts/check-mcp.mjs && node scripts/check-search-coverage.mjs && node scripts/check-tokens.mjs && node scripts/check-pins.mjs && node scripts/check-deprecation-register.mjs && node scripts/check-inertia-link-props.mjs && node --experimental-strip-types scripts/check-api-consistency.ts --strict && node --experimental-strip-types scripts/check-default-docs.ts && node --experimental-strip-types scripts/generate-component-docs.ts --strict && node scripts/check-doc-links.mjs && node scripts/generate-css-migration.mjs --check && node scripts/generate-adoption-checklist.mjs --check && node --experimental-strip-types scripts/generate-config-table.ts --check",
102
104
  "test:fixtures": "npm run build && node scripts/check-nuxt-types.mjs && node scripts/run-ssr-fixture.mjs && node scripts/invalidate-fixture-caches.mjs && FIXTURE_TARGET=dist node scripts/run-e2es.mjs fixtures/inertia/e2e && FIXTURE_TARGET=dist node scripts/run-e2es.mjs fixtures/vue/e2e && npm run test:nuxt && npm run test:nuxt:prod && node scripts/test-add.mjs",
103
105
  "test:fixtures:src": "npm run test:inertia && npm run test:vue && npm run test:nuxt",
104
106
  "test:inertia": "node scripts/invalidate-fixture-caches.mjs && node scripts/run-e2es.mjs fixtures/inertia/e2e",
@@ -113,8 +115,6 @@
113
115
  "test:engines": "node scripts/ensure-manifest.mjs && node scripts/run-engines.mjs",
114
116
  "test:ci:node": "node scripts/ensure-manifest.mjs && vitest run --project node --project types --project ssr",
115
117
  "test:ci:browser": "node scripts/ensure-manifest.mjs && node scripts/run-browser-chunked.mjs 12",
116
- "test:ci:gates": "npm run check:pt-keys && node scripts/check-guide-types.mjs && node scripts/score-eval.mjs --all --offline && npm run check:test-types && node scripts/check-fixture-types.mjs && node scripts/check-recipes.mjs && node scripts/check-examples.mjs && node scripts/recipes.mjs --check && node scripts/check-doc-drift.mjs && node scripts/check-doc-ts.mjs && node scripts/run-ai-evals.mjs && node scripts/check-pins.mjs && node scripts/check-deprecation-register.mjs && node scripts/check-inertia-link-props.mjs && node --experimental-strip-types scripts/check-default-docs.ts && node scripts/check-doc-links.mjs && node scripts/generate-css-migration.mjs --check && node scripts/generate-adoption-checklist.mjs --check && node --experimental-strip-types scripts/generate-config-table.ts --check && npm run check:helpers-lint && node scripts/check-provenance.mjs --strict",
117
- "test:ci": "npm run test:ci:node && npm run test:ci:browser && npm run test:gregorian && npm run test:ci:gates",
118
118
  "test:gregorian": "node scripts/test-gregorian-only.mjs",
119
119
  "postpack": "npm pkg set \"scripts.prepare=node scripts/hooks-install.mjs\"",
120
120
  "test:ssr": "npm run build && node scripts/run-ssr-fixture.mjs",
@@ -254,6 +254,8 @@
254
254
  "!scripts/lib/boilerplate-census.mjs",
255
255
  "!scripts/lib/fixture-library.mjs",
256
256
  "!scripts/lib/gate.mjs",
257
+ "!scripts/lib/wall-steps.mjs",
258
+ "!scripts/lib/gate-plan.mjs",
257
259
  "!scripts/lib/inertia-helpers.mjs",
258
260
  "!scripts/lib/provenance.mjs",
259
261
  "!scripts/lib/internal-notes.mjs",
package/scripts/README.md CHANGED
@@ -2,42 +2,44 @@
2
2
 
3
3
  Every file here is either a **gate** (fails the build when an invariant breaks)
4
4
  or a **generator** (writes something the package ships). Nothing here is
5
- optional tooling: `npm test` runs sixteen of these, and CI runs the same list.
5
+ optional tooling: `npm run gate` runs the wall's gates, and CI runs the same list.
6
6
 
7
7
  The reason this file exists: a failing `check:*` tells you _what_ broke, never
8
8
  _why anyone cared_. Read the row before you "fix" a gate by loosening it —
9
9
  several of them exist because the thing they now catch already shipped once.
10
10
 
11
- ## Gates — wired into `npm test` and CI
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
- | `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. |
32
- | `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. |
33
- | `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. |
34
- | `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` (only failed steps/files, never a pass/tag); rerun green still owes one full run. |
35
- | `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. |
36
- | `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. |
37
- | `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
+ | `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. |
32
+ | `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. |
33
+ | `gate` | `gate.mjs` | The lane gate (Q96.3): build + every static check of the wall (one list, `lib/wall-steps.mjs`), then the tests touching what changed since `v3` (`-- --all` for the full suite as the wall runs it, `-- --tests=none` for static only). Every step runs; one table of exit codes + durations. Runs in your checkout before reporting; `push:check` stays the commit-exact gate. |
34
+ | `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 -- --base <merge-base>` there, verify the gated tree is still exactly the merge commit, then fast-forward the main checkout only on green. Every refusal (dirty/wrong-branch main, 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`). |
35
+ | `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. |
36
+ | `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` (only failed steps/files, never a pass/tag); rerun green still owes one full run. |
37
+ | `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. |
38
+ | `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. |
39
+ | `check:commit` | `check-commit-msg.mjs` | Commit message shape (the commit-msg hook). |
38
40
 
39
- `check:pack` runs in CI and at `prepack`, not in `npm test` — it needs a built
40
- `dist/`.
41
+ `check:pack` runs in `npm run gate`, CI and at `prepack` — it needs a built
42
+ `dist/`, which the gate builds first.
41
43
 
42
44
  ## Generators — they write what ships
43
45
 
@@ -9,7 +9,7 @@
9
9
  * stamp is silent.
10
10
  *
11
11
  * The revisions and their reasons: ai/helpers/define-preset.json. A code change
12
- * to the bench file without a new revision fails `npm test`
12
+ * to the bench file without a new revision fails the node tier
13
13
  * (define-preset-copy.node.test.mjs).
14
14
  */
15
15
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
@@ -19,6 +19,7 @@ import { spawnSync } from 'node:child_process';
19
19
  import { parseArgs } from 'node:util';
20
20
  import { fileURLToPath } from 'node:url';
21
21
  import { refreshAgentSetup } from './agent-refresh.mjs';
22
+ import { ensureStrictVModel, isNewProject } from './toolchain-check.mjs';
22
23
  import { refuseLinkedTarget } from './linked-target.mjs';
23
24
  import { createRequire } from 'node:module';
24
25
  import { detectPackageManager, mcpLaunch } from './mcp-config.mjs';
@@ -352,6 +353,8 @@ export async function setupCommand(options) {
352
353
  app.framework === 'nuxt'
353
354
  ? /['"]bitboss-ui\/nuxt['"]/.test(configCode)
354
355
  : /\bbitbossUi\s*\(/.test(configCode);
356
+ // Read before anything here commits or wires: the project as it was found.
357
+ const newProject = isNewProject(root, { alreadyWired });
355
358
  const pluginOptions = pluginOptionsFor({
356
359
  locale,
357
360
  tailwind,
@@ -423,6 +426,11 @@ export async function setupCommand(options) {
423
426
  done.push(['package.json', 'updated (postinstall)']);
424
427
  }
425
428
 
429
+ // Before the agent refresh, whose strict-set suggestion reads the result.
430
+ if (newProject) {
431
+ const strict = ensureStrictVModel(root);
432
+ if (strict?.action === 'updated') done.push([strict.path, 'updated']);
433
+ }
426
434
  console.log('\n[bitboss-ui] setup:');
427
435
  for (const [file, action] of done) console.log(` - ${action}: ${file}`);
428
436
  await runInstalledRefresh(root, version);
@@ -11,7 +11,8 @@
11
11
  * themselves. The agent refresh (`update --no-install`, the app's
12
12
  * postinstall) still writes the flag (`ensureCheckUnknownComponents`).
13
13
  */
14
- import { existsSync, readFileSync, statSync } from 'node:fs';
14
+ import { spawnSync } from 'node:child_process';
15
+ import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
15
16
  import { writeFileAtomicSync } from './atomic-write.mjs';
16
17
  import { dirname, join, relative, resolve } from 'node:path';
17
18
  import { refuseLinkedTarget } from './linked-target.mjs';
@@ -50,7 +51,11 @@ export function strictTemplateSuggestion(root) {
50
51
  existsSync(join(root, name))
51
52
  );
52
53
  if (!target) return null;
53
- return `Recommended: \`"vueCompilerOptions": ${STRICT_TEMPLATE_SET}\` in ${target}, so vue-tsc checks every template attribute and event (installation guide, checklist). Not written: it can surface errors in your own templates to fix first.`;
54
+ // An option the project already sets, either way, is its choice: name only the rest.
55
+ const set = flagSet(root, STRICT_V_MODEL_CHOSEN)
56
+ ? STRICT_TEMPLATE_SET.replace(' "strictVModel": true,', '')
57
+ : STRICT_TEMPLATE_SET;
58
+ return `Recommended: \`"vueCompilerOptions": ${set}\` in ${target}, so vue-tsc checks every template attribute and event (installation guide, checklist). Not written: it can surface errors in your own templates to fix first.`;
54
59
  }
55
60
 
56
61
  /**
@@ -102,9 +107,20 @@ function readText(path) {
102
107
  }
103
108
  }
104
109
 
110
+ /** A package `extends` (`@vue/tsconfig/tsconfig.dom.json`) → its file in the nearest node_modules. */
111
+ function packageConfig(from, ref) {
112
+ for (let dir = dirname(from); ; dir = dirname(dir)) {
113
+ const base = join(dir, 'node_modules', ref);
114
+ for (const path of [base, `${base}.json`, join(base, 'tsconfig.json')])
115
+ if (existsSync(path) && statSync(path).isFile()) return path;
116
+ if (dirname(dir) === dir) return undefined;
117
+ }
118
+ }
119
+
105
120
  /** A local `extends` / `references` path → the config file it names. */
106
121
  function localConfig(from, ref) {
107
- if (typeof ref !== 'string' || !ref.startsWith('.')) return undefined;
122
+ if (typeof ref !== 'string') return undefined;
123
+ if (!ref.startsWith('.')) return packageConfig(from, ref);
108
124
  const path = resolve(dirname(from), ref);
109
125
  try {
110
126
  if (statSync(path).isDirectory()) return join(path, 'tsconfig.json');
@@ -226,19 +242,30 @@ export function ensureCheckUnknownComponents(root) {
226
242
  return { path, action: 'skipped', reason: error.message };
227
243
  }
228
244
 
245
+ return insertVueCompilerFlag(target, path, 'checkUnknownComponents');
246
+ }
247
+
248
+ /** `"flag": true` into the config's `vueCompilerOptions`, as text: comments, layout and line endings stay. */
249
+ function insertVueCompilerFlag(target, path, flag) {
229
250
  const text = readFileSync(target, 'utf-8');
230
251
  const bare = blankJsonComments(text);
231
252
  const unit = indentUnit(text);
253
+ const eol = text.includes('\r\n') ? '\r\n' : '\n';
232
254
  const nested = /"vueCompilerOptions"\s*:\s*\{/.exec(bare);
233
255
  const open = nested ? nested.index + nested[0].length : bare.search(/\S/) + 1;
234
256
  if (!nested && bare[open - 1] !== '{')
235
257
  return { path, action: 'skipped', reason: 'not a JSON object' };
236
- const empty = /^\s*\}/.test(bare.slice(open));
258
+ const rest = bare.slice(open);
259
+ const empty = /^\s*\}/.test(rest);
260
+ const oneLine =
261
+ nested && !empty && !rest.slice(0, rest.indexOf('}')).includes('\n');
237
262
  const indent = nested ? lineIndent(text, nested.index) + unit : unit;
238
263
  const entry = nested
239
- ? '"checkUnknownComponents": true'
240
- : '"vueCompilerOptions": { "checkUnknownComponents": true }';
241
- const updated = `${text.slice(0, open)}\n${indent}${entry}${empty ? '\n' + (nested ? lineIndent(text, nested.index) : '') : ','}${text.slice(open)}`;
264
+ ? `"${flag}": true`
265
+ : `"vueCompilerOptions": { "${flag}": true }`;
266
+ const updated = oneLine
267
+ ? `${text.slice(0, open)} ${entry},${text.slice(open)}`
268
+ : `${text.slice(0, open)}${eol}${indent}${entry}${empty ? eol + (nested ? lineIndent(text, nested.index) : '') : ','}${text.slice(open)}`;
242
269
  if (parseJsonc(text) !== undefined && parseJsonc(updated) === undefined)
243
270
  return {
244
271
  path,
@@ -248,3 +275,94 @@ export function ensureCheckUnknownComponents(root) {
248
275
  writeFileAtomicSync(target, updated, 'utf-8');
249
276
  return { path, action: 'updated' };
250
277
  }
278
+
279
+ const STRICT_V_MODEL_CHOSEN = /["']?(?:strictVModel|strictTemplates)["']?\s*:/;
280
+
281
+ /**
282
+ * Turn `strictVModel` on in a new project's tsconfig. `setup` alone calls it,
283
+ * after `isNewProject`: a running project's templates are its own to migrate.
284
+ * Any existing `strictVModel` or `strictTemplates`, either value, in the config
285
+ * or what it extends, stays the answer. Nuxt generates its tsconfig: not written.
286
+ *
287
+ * @param {string} root
288
+ * @returns {{ path: string, action: string, reason?: string } | null}
289
+ */
290
+ export function ensureStrictVModel(root) {
291
+ if (nuxtConfig(root)) return null;
292
+ const target = ['tsconfig.app.json', 'tsconfig.json']
293
+ .map((name) => join(root, name))
294
+ .find((path) => existsSync(path));
295
+ if (!target) return null;
296
+ const path = `${relative(root, target)} [vueCompilerOptions.strictVModel]`;
297
+ if (flagSet(root, STRICT_V_MODEL_CHOSEN))
298
+ return { path, action: 'unchanged' };
299
+ try {
300
+ refuseLinkedTarget(target);
301
+ } catch (error) {
302
+ return { path, action: 'skipped', reason: error.message };
303
+ }
304
+ return insertVueCompilerFlag(target, path, 'strictVModel');
305
+ }
306
+
307
+ const NOT_SOURCE = new Set([
308
+ 'node_modules',
309
+ 'dist',
310
+ 'build',
311
+ 'vendor',
312
+ '.git',
313
+ '.nuxt',
314
+ '.output',
315
+ 'storage',
316
+ 'public',
317
+ ]);
318
+ /** Above any scaffold's own count (create-vue with examples has about 11). */
319
+ const NEW_PROJECT_MAX_SFCS = 15;
320
+
321
+ /** `true` while the count stays within the limit; an unreadable folder counts as over it. */
322
+ function sfcsWithin(dir, limit) {
323
+ let count = 0;
324
+ const walk = (at) => {
325
+ for (const entry of readdirSync(at, { withFileTypes: true })) {
326
+ if (entry.isDirectory()) {
327
+ if (!NOT_SOURCE.has(entry.name)) walk(join(at, entry.name));
328
+ } else if (entry.name.endsWith('.vue')) count++;
329
+ if (count > limit) return;
330
+ }
331
+ };
332
+ try {
333
+ walk(dir);
334
+ } catch {
335
+ return false;
336
+ }
337
+ return count <= limit;
338
+ }
339
+
340
+ /** Commits reachable from HEAD: 0 outside a repository or before the first commit, `undefined` when git cannot say. */
341
+ function commitCount(root) {
342
+ const result = spawnSync('git', ['rev-list', '--count', 'HEAD'], {
343
+ cwd: root,
344
+ encoding: 'utf-8',
345
+ stdio: ['ignore', 'pipe', 'pipe'],
346
+ });
347
+ if (result.error) return undefined;
348
+ if (result.status === 0) return Number(result.stdout.trim());
349
+ return /not a git repository|bad revision 'HEAD'|ambiguous argument 'HEAD'/i.test(
350
+ result.stderr
351
+ )
352
+ ? 0
353
+ : undefined;
354
+ }
355
+
356
+ /**
357
+ * Is this demonstrably a project that has just been scaffolded? Every signal
358
+ * must say so; any doubt means running.
359
+ *
360
+ * @param {string} root
361
+ * @param {{ alreadyWired: boolean }} options
362
+ */
363
+ export function isNewProject(root, { alreadyWired }) {
364
+ if (alreadyWired) return false;
365
+ const commits = commitCount(root);
366
+ if (commits === undefined || commits > 1) return false;
367
+ return sfcsWithin(root, NEW_PROJECT_MAX_SFCS);
368
+ }
@@ -4209,7 +4209,7 @@ export function unknownComponentFinding(name, manifest) {
4209
4209
  if (existsSync(join(HERE, '../../src/components', name, `${name}.vue`))) {
4210
4210
  return {
4211
4211
  message: `component \`${name}\` is in this checkout's source but not in dist/ai/components.json: the manifest is stale`,
4212
- hint: 'Run `npm run generate-docs` (or any `npm test` / build). The ESLint server picks the new manifest up without a restart. Do not allowlist it.',
4212
+ hint: 'Run `npm run generate-docs` (or any `npm run gate` / build). The ESLint server picks the new manifest up without a restart. Do not allowlist it.',
4213
4213
  };
4214
4214
  }
4215
4215