bitboss-ui 3.0.0-beta.68 → 3.0.0-beta.69

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 (915) hide show
  1. package/README.md +229 -90
  2. package/bin/bitboss-ui-mcp.mjs +284 -126
  3. package/bin/bitboss-ui.mjs +24 -2077
  4. package/bin/cli.mjs +1922 -0
  5. package/dist/ai/BbAccordion.md +1 -1
  6. package/dist/ai/BbAlert.md +1 -1
  7. package/dist/ai/BbAvatar.md +1 -1
  8. package/dist/ai/BbBadge.md +1 -1
  9. package/dist/ai/BbBadgeButton.md +1 -1
  10. package/dist/ai/BbBaseButton.md +1 -1
  11. package/dist/ai/BbBreadcrumbs.md +1 -1
  12. package/dist/ai/BbButton.md +1 -1
  13. package/dist/ai/BbCalendar.md +14 -1
  14. package/dist/ai/BbCarousel.md +1093 -0
  15. package/dist/ai/BbCheckbox.md +7 -5
  16. package/dist/ai/BbCheckboxGroup.md +15 -9
  17. package/dist/ai/BbColorInput.md +6 -4
  18. package/dist/ai/BbColorPalette.md +4 -1
  19. package/dist/ai/BbConfirm.md +1 -1
  20. package/dist/ai/BbDatePicker.md +8 -2
  21. package/dist/ai/BbDatePickerInput.md +14 -4
  22. package/dist/ai/BbDialog.md +1 -1
  23. package/dist/ai/BbDropdown.md +10 -13
  24. package/dist/ai/BbDropdownButton.md +3 -3
  25. package/dist/ai/BbDropzone.md +4 -15
  26. package/dist/ai/BbForm.md +8 -4
  27. package/dist/ai/BbHost.md +1 -1
  28. package/dist/ai/BbHoverCard.md +2 -2
  29. package/dist/ai/BbNumberInput.md +4 -4
  30. package/dist/ai/BbOffCanvas.md +12 -8
  31. package/dist/ai/BbPagination.md +6 -5
  32. package/dist/ai/BbPopover.md +11 -4
  33. package/dist/ai/BbRadio.md +9 -7
  34. package/dist/ai/BbRadioGroup.md +11 -7
  35. package/dist/ai/BbRating.md +10 -8
  36. package/dist/ai/BbSelect.md +11 -11
  37. package/dist/ai/BbSelectPopover.md +6 -6
  38. package/dist/ai/BbSlider.md +9 -6
  39. package/dist/ai/BbSpinner.md +1 -1
  40. package/dist/ai/BbSwitch.md +8 -7
  41. package/dist/ai/BbSwitchGroup.md +7 -7
  42. package/dist/ai/BbTable.md +19 -21
  43. package/dist/ai/BbTabs.md +23 -26
  44. package/dist/ai/BbTabsList.md +4 -4
  45. package/dist/ai/BbTabsRoot.md +1 -1
  46. package/dist/ai/BbTag.md +4 -4
  47. package/dist/ai/BbTextInput.md +8 -6
  48. package/dist/ai/BbTextarea.md +6 -5
  49. package/dist/ai/BbTimePicker.md +2 -2
  50. package/dist/ai/BbTimePickerInput.md +4 -4
  51. package/dist/ai/BbToast.md +8 -3
  52. package/dist/ai/BbTooltip.md +5 -4
  53. package/dist/ai/BbTree.md +1 -1
  54. package/dist/ai/ChipsBox.md +1 -1
  55. package/dist/ai/ClearableButton.md +1 -1
  56. package/dist/ai/CommonField.md +5 -5
  57. package/dist/ai/CommonFieldInput.md +1 -1
  58. package/dist/ai/CommonPopover.md +4 -4
  59. package/dist/ai/CommonTimeSelector.md +1 -1
  60. package/dist/ai/ErrorIcon.md +1 -1
  61. package/dist/ai/FlatListBox.md +1 -1
  62. package/dist/ai/GroupedListBox.md +1 -1
  63. package/dist/ai/ListBox.md +1 -1
  64. package/dist/ai/OptionsContainer.md +3 -3
  65. package/dist/ai/WarningIcon.md +1 -1
  66. package/dist/ai/changelog.json +526 -10
  67. package/dist/ai/components.json +95 -232
  68. package/dist/ai/composables/useToast.md +15 -15
  69. package/dist/ai/guides/agent-contract.md +7 -2
  70. package/dist/ai/guides/ai-router.md +14 -9
  71. package/dist/ai/guides/calendars-and-digits.md +123 -0
  72. package/dist/ai/guides/component-picker.md +1 -1
  73. package/dist/ai/guides/design-language.md +1 -1
  74. package/dist/ai/guides/design-tokens.md +4 -1
  75. package/dist/ai/guides/eslint-rules.md +18 -1
  76. package/dist/ai/guides/inertia-helpers.md +322 -41
  77. package/dist/ai/guides/installation-and-plugin-setup.md +166 -31
  78. package/dist/ai/guides/migration/components/bb-rating.md +1 -1
  79. package/dist/ai/guides/migration/components/bb-table.md +1 -0
  80. package/dist/ai/guides/migration/components/bb-tabs.md +32 -14
  81. package/dist/ai/guides/migration/components/bb-toast.md +4 -3
  82. package/dist/ai/guides/migration/v2-to-v3.md +158 -24
  83. package/dist/ai/guides/migration/v3-beta-css-classes.md +1 -0
  84. package/dist/ai/guides/migration/v3-beta-tooling.md +28 -11
  85. package/dist/ai/guides/options-items-playbook.md +5 -1
  86. package/dist/ai/guides/passthrough.md +12 -6
  87. package/dist/ai/guides/ssr-prefill.md +7 -1
  88. package/dist/ai/guides/validated-forms.md +9 -0
  89. package/dist/ai/helpers/inertia/manifest.json +23 -14
  90. package/dist/ai/helpers/inertia/useQuery.ts +74 -0
  91. package/dist/ai/helpers/inertia/useQueryObject.ts +33 -1
  92. package/dist/ai/helpers/inertia/useRouteQuery.ts +158 -30
  93. package/dist/ai/index.md +2 -0
  94. package/dist/ai/manifest/common.json +7 -7
  95. package/dist/ai/manifest/components/BbAccordion.tree.json +22 -4
  96. package/dist/ai/manifest/components/BbAlert.tree.json +26 -3
  97. package/dist/ai/manifest/components/BbAsterisk.tree.json +7 -1
  98. package/dist/ai/manifest/components/BbAvatar.tree.json +16 -2
  99. package/dist/ai/manifest/components/BbBadge.json +1 -1
  100. package/dist/ai/manifest/components/BbBadge.tree.json +39 -4
  101. package/dist/ai/manifest/components/BbBadgeButton.tree.json +2 -2
  102. package/dist/ai/manifest/components/BbBaseButton.tree.json +16 -1
  103. package/dist/ai/manifest/components/BbBaseCheckboxIcon.tree.json +18 -1
  104. package/dist/ai/manifest/components/BbBaseRadioIcon.tree.json +14 -1
  105. package/dist/ai/manifest/components/BbBaseSwitchIcon.tree.json +17 -1
  106. package/dist/ai/manifest/components/BbBreadcrumbs.json +1 -1
  107. package/dist/ai/manifest/components/BbBreadcrumbs.tree.json +34 -4
  108. package/dist/ai/manifest/components/BbButton.json +1 -1
  109. package/dist/ai/manifest/components/BbButton.tree.json +75 -4
  110. package/dist/ai/manifest/components/BbCalendar.json +2 -2
  111. package/dist/ai/manifest/components/BbCalendar.tree.json +81 -6
  112. package/dist/ai/manifest/components/BbCarousel.json +59 -0
  113. package/dist/ai/manifest/components/BbCarousel.tree.json +135 -0
  114. package/dist/ai/manifest/components/BbCheckbox.json +1 -1
  115. package/dist/ai/manifest/components/BbCheckbox.tree.json +31 -2
  116. package/dist/ai/manifest/components/BbCheckboxGroup.json +3 -3
  117. package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +65 -2
  118. package/dist/ai/manifest/components/BbCollapsible.tree.json +11 -1
  119. package/dist/ai/manifest/components/BbColorInput.json +2 -2
  120. package/dist/ai/manifest/components/BbColorInput.tree.json +47 -3
  121. package/dist/ai/manifest/components/BbColorPalette.json +2 -2
  122. package/dist/ai/manifest/components/BbColorPalette.tree.json +36 -3
  123. package/dist/ai/manifest/components/BbConfigScope.json +1 -1
  124. package/dist/ai/manifest/components/BbConfirm.json +1 -1
  125. package/dist/ai/manifest/components/BbConfirm.tree.json +27 -3
  126. package/dist/ai/manifest/components/BbDatePicker.json +5 -5
  127. package/dist/ai/manifest/components/BbDatePicker.tree.json +42 -3
  128. package/dist/ai/manifest/components/BbDatePickerInput.json +2 -2
  129. package/dist/ai/manifest/components/BbDatePickerInput.tree.json +83 -4
  130. package/dist/ai/manifest/components/BbDialog.tree.json +28 -3
  131. package/dist/ai/manifest/components/BbDropdown.json +8 -7
  132. package/dist/ai/manifest/components/BbDropdown.tree.json +80 -3
  133. package/dist/ai/manifest/components/BbDropdownButton.json +4 -4
  134. package/dist/ai/manifest/components/BbDropdownButton.tree.json +46 -3
  135. package/dist/ai/manifest/components/BbDropzone.json +1 -1
  136. package/dist/ai/manifest/components/BbDropzone.tree.json +27 -1
  137. package/dist/ai/manifest/components/BbForm.json +1 -1
  138. package/dist/ai/manifest/components/BbHost.tree.json +1 -1
  139. package/dist/ai/manifest/components/BbHoverCard.json +3 -3
  140. package/dist/ai/manifest/components/BbHoverCard.tree.json +18 -1
  141. package/dist/ai/manifest/components/BbIcon.tree.json +7 -1
  142. package/dist/ai/manifest/components/BbIndicator.tree.json +27 -1
  143. package/dist/ai/manifest/components/BbNumberInput.json +2 -2
  144. package/dist/ai/manifest/components/BbNumberInput.tree.json +38 -2
  145. package/dist/ai/manifest/components/BbOffCanvas.json +1 -1
  146. package/dist/ai/manifest/components/BbOffCanvas.tree.json +55 -2
  147. package/dist/ai/manifest/components/BbPagination.json +1 -1
  148. package/dist/ai/manifest/components/BbPagination.tree.json +22 -3
  149. package/dist/ai/manifest/components/BbPopover.json +3 -3
  150. package/dist/ai/manifest/components/BbPopover.tree.json +20 -2
  151. package/dist/ai/manifest/components/BbProgress.tree.json +9 -1
  152. package/dist/ai/manifest/components/BbRadio.tree.json +30 -2
  153. package/dist/ai/manifest/components/BbRadioGroup.json +3 -3
  154. package/dist/ai/manifest/components/BbRadioGroup.tree.json +64 -2
  155. package/dist/ai/manifest/components/BbRating.json +4 -4
  156. package/dist/ai/manifest/components/BbRating.removed.json +1 -0
  157. package/dist/ai/manifest/components/BbRating.tree.json +37 -2
  158. package/dist/ai/manifest/components/BbSelect.json +3 -3
  159. package/dist/ai/manifest/components/BbSelect.tree.json +65 -4
  160. package/dist/ai/manifest/components/BbSelectPopover.json +8 -6
  161. package/dist/ai/manifest/components/BbSelectPopover.tree.json +91 -8
  162. package/dist/ai/manifest/components/BbSlider.json +13 -12
  163. package/dist/ai/manifest/components/BbSlider.tree.json +44 -1
  164. package/dist/ai/manifest/components/BbSmoothHeight.tree.json +10 -1
  165. package/dist/ai/manifest/components/BbSpinner.tree.json +21 -2
  166. package/dist/ai/manifest/components/BbSwitch.json +2 -2
  167. package/dist/ai/manifest/components/BbSwitch.tree.json +31 -2
  168. package/dist/ai/manifest/components/BbSwitchGroup.json +4 -4
  169. package/dist/ai/manifest/components/BbSwitchGroup.tree.json +60 -2
  170. package/dist/ai/manifest/components/BbTable.json +8 -8
  171. package/dist/ai/manifest/components/BbTable.tree.json +142 -4
  172. package/dist/ai/manifest/components/BbTabs.json +4 -4
  173. package/dist/ai/manifest/components/BbTabs.removed.json +5 -1
  174. package/dist/ai/manifest/components/BbTabs.tree.json +34 -3
  175. package/dist/ai/manifest/components/BbTabsList.json +4 -4
  176. package/dist/ai/manifest/components/BbTabsList.removed.json +5 -1
  177. package/dist/ai/manifest/components/BbTabsList.tree.json +24 -2
  178. package/dist/ai/manifest/components/BbTabsPanels.tree.json +16 -1
  179. package/dist/ai/manifest/components/BbTabsRoot.json +1 -1
  180. package/dist/ai/manifest/components/BbTag.json +2 -2
  181. package/dist/ai/manifest/components/BbTag.tree.json +47 -3
  182. package/dist/ai/manifest/components/BbTextInput.json +2 -2
  183. package/dist/ai/manifest/components/BbTextInput.tree.json +41 -2
  184. package/dist/ai/manifest/components/BbTextarea.json +2 -2
  185. package/dist/ai/manifest/components/BbTextarea.tree.json +44 -2
  186. package/dist/ai/manifest/components/BbTimePicker.json +5 -5
  187. package/dist/ai/manifest/components/BbTimePicker.tree.json +30 -3
  188. package/dist/ai/manifest/components/BbTimePickerInput.json +2 -2
  189. package/dist/ai/manifest/components/BbTimePickerInput.tree.json +55 -5
  190. package/dist/ai/manifest/components/BbToast.json +1 -1
  191. package/dist/ai/manifest/components/BbToast.tree.json +41 -2
  192. package/dist/ai/manifest/components/BbTooltip.json +3 -3
  193. package/dist/ai/manifest/components/BbTooltip.tree.json +17 -1
  194. package/dist/ai/manifest/components/BbTree.tree.json +14 -1
  195. package/dist/ai/manifest/components/ChipsBox.tree.json +1 -1
  196. package/dist/ai/manifest/components/ClearableButton.tree.json +8 -2
  197. package/dist/ai/manifest/components/CommonField.json +2 -2
  198. package/dist/ai/manifest/components/CommonField.tree.json +68 -1
  199. package/dist/ai/manifest/components/CommonFieldInput.tree.json +36 -6
  200. package/dist/ai/manifest/components/CommonPopover.json +7 -5
  201. package/dist/ai/manifest/components/CommonPopover.tree.json +11 -1
  202. package/dist/ai/manifest/components/CommonTimeSelector.tree.json +18 -2
  203. package/dist/ai/manifest/components/ErrorIcon.tree.json +8 -2
  204. package/dist/ai/manifest/components/FlatListBox.tree.json +2 -2
  205. package/dist/ai/manifest/components/GroupedListBox.tree.json +2 -2
  206. package/dist/ai/manifest/components/ListBox.tree.json +2 -2
  207. package/dist/ai/manifest/components/OptionsContainer.json +2 -2
  208. package/dist/ai/manifest/components/WarningIcon.tree.json +8 -2
  209. package/dist/ai/manifest/index.json +5 -4
  210. package/dist/ai/manifest/meta.json +8 -147
  211. package/dist/ai/manifest/types.advanced.json +78 -76
  212. package/dist/ai/manifest/types.api.json +17 -16
  213. package/dist/ai/manifest/types.wrapper.json +115 -112
  214. package/dist/ai/recipes/inertia/approvals-inbox.md +8 -8
  215. package/dist/ai/recipes/inertia/inline-edit-workspace.md +11 -11
  216. package/dist/ai/recipes/inertia/onboarding.md +8 -8
  217. package/dist/ai/recipes/inertia/ownership-atlas.md +6 -6
  218. package/dist/ai/recipes/inertia/record-form.md +14 -14
  219. package/dist/ai/recipes/inertia/records-workspace.md +11 -10
  220. package/dist/ai/recipes/inertia/settings-workspace.md +11 -11
  221. package/dist/ai/recipes/inertia/upload-center.md +10 -10
  222. package/dist/ai/recipes/inertia/wizard-form.md +14 -14
  223. package/dist/ai/recipes/nuxt/approvals-inbox.md +11 -11
  224. package/dist/ai/recipes/nuxt/inline-edit-workspace.md +13 -13
  225. package/dist/ai/recipes/nuxt/onboarding.md +8 -8
  226. package/dist/ai/recipes/nuxt/ownership-atlas.md +10 -10
  227. package/dist/ai/recipes/nuxt/record-form.md +14 -14
  228. package/dist/ai/recipes/nuxt/records-workspace.md +14 -13
  229. package/dist/ai/recipes/nuxt/settings-workspace.md +10 -10
  230. package/dist/ai/recipes/nuxt/upload-center.md +11 -11
  231. package/dist/ai/recipes/nuxt/wizard-form.md +15 -15
  232. package/dist/ai/recipes/vue/approvals-inbox.md +13 -11
  233. package/dist/ai/recipes/vue/inline-edit-workspace.md +13 -13
  234. package/dist/ai/recipes/vue/onboarding.md +14 -9
  235. package/dist/ai/recipes/vue/ownership-atlas.md +10 -10
  236. package/dist/ai/recipes/vue/record-form.md +16 -14
  237. package/dist/ai/recipes/vue/records-workspace.md +16 -13
  238. package/dist/ai/recipes/vue/settings-workspace.md +13 -11
  239. package/dist/ai/recipes/vue/upload-center.md +11 -11
  240. package/dist/ai/recipes/vue/wizard-form.md +16 -14
  241. package/dist/ai/source/BbAccordion.md +11 -14
  242. package/dist/ai/source/BbAlert.md +95 -89
  243. package/dist/ai/source/BbAsterisk.md +6 -7
  244. package/dist/ai/source/BbAvatar.md +37 -37
  245. package/dist/ai/source/BbBadge.md +85 -81
  246. package/dist/ai/source/BbBadgeButton.md +80 -76
  247. package/dist/ai/source/BbBaseButton.md +284 -276
  248. package/dist/ai/source/BbBaseCheckboxIcon.md +69 -63
  249. package/dist/ai/source/BbBaseRadioIcon.md +63 -57
  250. package/dist/ai/source/BbBaseSwitchIcon.md +84 -65
  251. package/dist/ai/source/BbBreadcrumbs.md +76 -63
  252. package/dist/ai/source/BbButton.md +63 -55
  253. package/dist/ai/source/BbCalendar.md +161 -146
  254. package/dist/ai/source/BbCarousel.md +2897 -0
  255. package/dist/ai/source/BbCheckbox.md +211 -186
  256. package/dist/ai/source/BbCheckboxGroup.md +108 -54
  257. package/dist/ai/source/BbCollapsible.md +7 -10
  258. package/dist/ai/source/BbColorInput.md +233 -227
  259. package/dist/ai/source/BbColorPalette.md +218 -140
  260. package/dist/ai/source/BbConfirm.md +33 -29
  261. package/dist/ai/source/BbConfirmPortal.md +30 -26
  262. package/dist/ai/source/BbDatePicker.md +202 -181
  263. package/dist/ai/source/BbDatePickerInput.md +751 -407
  264. package/dist/ai/source/BbDialog.md +187 -181
  265. package/dist/ai/source/BbDropdown.md +274 -218
  266. package/dist/ai/source/BbDropdownButton.md +50 -45
  267. package/dist/ai/source/BbDropdownGroup.md +242 -210
  268. package/dist/ai/source/BbDropzone.md +101 -100
  269. package/dist/ai/source/BbForm.md +28 -28
  270. package/dist/ai/source/BbHost.md +2 -2
  271. package/dist/ai/source/BbHoverCard.md +28 -18
  272. package/dist/ai/source/BbHoverCardPortal.md +9 -12
  273. package/dist/ai/source/BbIcon.md +27 -26
  274. package/dist/ai/source/BbIndicator.md +76 -70
  275. package/dist/ai/source/BbNumberInput.md +300 -293
  276. package/dist/ai/source/BbOffCanvas.md +236 -214
  277. package/dist/ai/source/BbPagination.md +134 -98
  278. package/dist/ai/source/BbPopover.md +32 -22
  279. package/dist/ai/source/BbPopoverPortal.md +9 -12
  280. package/dist/ai/source/BbProgress.md +20 -12
  281. package/dist/ai/source/BbRadio.md +188 -175
  282. package/dist/ai/source/BbRadioGroup.md +407 -350
  283. package/dist/ai/source/BbRating.md +192 -167
  284. package/dist/ai/source/BbSelect.md +474 -461
  285. package/dist/ai/source/BbSelectPopover.md +426 -385
  286. package/dist/ai/source/BbSlider.md +333 -266
  287. package/dist/ai/source/BbSmoothHeight.md +8 -9
  288. package/dist/ai/source/BbSpinner.md +20 -20
  289. package/dist/ai/source/BbSwitch.md +25 -13
  290. package/dist/ai/source/BbSwitchGroup.md +88 -26
  291. package/dist/ai/source/BbTable.md +560 -501
  292. package/dist/ai/source/BbTabs.md +129 -114
  293. package/dist/ai/source/BbTabsList.md +163 -135
  294. package/dist/ai/source/BbTabsPanels.md +127 -112
  295. package/dist/ai/source/BbTabsRoot.md +124 -109
  296. package/dist/ai/source/BbTag.md +264 -266
  297. package/dist/ai/source/BbTextInput.md +31 -25
  298. package/dist/ai/source/BbTextarea.md +33 -27
  299. package/dist/ai/source/BbTimePicker.md +128 -121
  300. package/dist/ai/source/BbTimePickerInput.md +356 -302
  301. package/dist/ai/source/BbToast.md +80 -36
  302. package/dist/ai/source/BbToastPortal.md +42 -30
  303. package/dist/ai/source/BbTooltip.md +154 -128
  304. package/dist/ai/source/BbTree.md +16 -12
  305. package/dist/ai/source/CommonField.md +94 -59
  306. package/dist/ai/source/CommonFieldInput.md +9 -9
  307. package/dist/ai/source/CommonPopover.md +28 -9
  308. package/dist/ai/source/CommonTimeSelector.md +41 -8
  309. package/dist/ai/source/FlatListBox.md +5 -4
  310. package/dist/ai/source/GroupedListBox.md +6 -5
  311. package/dist/ai/source/ListBox.md +1 -0
  312. package/dist/ai/source/OptionsContainer.md +39 -8
  313. package/dist/assets/svgs/chevron_left.svg_raw.js +3 -0
  314. package/dist/assets/svgs/pause.svg_raw.js +3 -0
  315. package/dist/assets/svgs/play.svg_raw.js +3 -0
  316. package/dist/assets/svgs/star.svg_raw.js +1 -1
  317. package/dist/calendar-runtime.js +112 -0
  318. package/dist/calendars.js +83 -0
  319. package/dist/components/BbAccordion/BbAccordion.vue.d.ts +2 -2
  320. package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +4 -4
  321. package/dist/components/BbAccordion/ptKeys.generated.d.ts +44 -0
  322. package/dist/components/BbAccordion/types.d.ts +5 -6
  323. package/dist/components/BbAlert/BbAlert.vue.d.ts +4 -4
  324. package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +4 -4
  325. package/dist/components/BbAlert/ptKeys.generated.d.ts +104 -0
  326. package/dist/components/BbAlert/types.d.ts +15 -8
  327. package/dist/components/BbAsterisk/BbAsterisk.vue.d.ts +2 -2
  328. package/dist/components/BbAsterisk/ptKeys.generated.d.ts +8 -0
  329. package/dist/components/BbAsterisk/types.d.ts +4 -5
  330. package/dist/components/BbAvatar/BbAvatar.vue.d.ts +3 -3
  331. package/dist/components/BbAvatar/ptKeys.generated.d.ts +12 -0
  332. package/dist/components/BbAvatar/types.d.ts +5 -6
  333. package/dist/components/BbBadge/BbBadge.vue.d.ts +4 -4
  334. package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +15 -15
  335. package/dist/components/BbBadge/BbBadgeButton.vue.d.ts +2 -2
  336. package/dist/components/BbBadge/badgeButtonContext.d.ts +5 -5
  337. package/dist/components/BbBadge/ptKeys.generated.d.ts +160 -0
  338. package/dist/components/BbBadge/types.d.ts +16 -9
  339. package/dist/components/BbBaseButton/BbBaseButton.vue.d.ts +2 -2
  340. package/dist/components/BbBaseButton/ptKeys.generated.d.ts +20 -0
  341. package/dist/components/BbBaseButton/types.d.ts +13 -6
  342. package/dist/components/BbBaseButton/useLinkState.d.ts +1 -1
  343. package/dist/components/BbBaseCheckboxIcon/BbBaseCheckboxIcon.vue.d.ts +2 -2
  344. package/dist/components/BbBaseCheckboxIcon/BbBaseCheckboxIcon.vue_vue_type_script_setup_true_lang.js +4 -4
  345. package/dist/components/BbBaseCheckboxIcon/ptKeys.generated.d.ts +40 -0
  346. package/dist/components/BbBaseCheckboxIcon/types.d.ts +12 -6
  347. package/dist/components/BbBaseRadioIcon/BbBaseRadioIcon.vue.d.ts +2 -2
  348. package/dist/components/BbBaseRadioIcon/BbBaseRadioIcon.vue_vue_type_script_setup_true_lang.js +4 -4
  349. package/dist/components/BbBaseRadioIcon/ptKeys.generated.d.ts +36 -0
  350. package/dist/components/BbBaseRadioIcon/types.d.ts +12 -6
  351. package/dist/components/BbBaseSwitchIcon/BbBaseSwitchIcon.vue.d.ts +2 -2
  352. package/dist/components/BbBaseSwitchIcon/BbBaseSwitchIcon.vue_vue_type_script_setup_true_lang.js +4 -4
  353. package/dist/components/BbBaseSwitchIcon/ptKeys.generated.d.ts +40 -0
  354. package/dist/components/BbBaseSwitchIcon/types.d.ts +12 -6
  355. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue.d.ts +2 -2
  356. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +5 -5
  357. package/dist/components/BbBreadcrumbs/ptKeys.generated.d.ts +48 -0
  358. package/dist/components/BbBreadcrumbs/types.d.ts +15 -8
  359. package/dist/components/BbButton/BbButton.vue.d.ts +4 -4
  360. package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +20 -20
  361. package/dist/components/BbButton/ptKeys.generated.d.ts +196 -0
  362. package/dist/components/BbButton/toggleRoving.js +29 -28
  363. package/dist/components/BbButton/types.d.ts +17 -11
  364. package/dist/components/BbCalendar/BbCalendar.vue.d.ts +9 -71
  365. package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +34 -32
  366. package/dist/components/BbCalendar/CalendarMonthPanel.vue_vue_type_script_setup_true_lang.js +67 -65
  367. package/dist/components/BbCalendar/CalendarYearPanel.vue_vue_type_script_setup_true_lang.js +76 -67
  368. package/dist/components/BbCalendar/calendarHost.d.ts +1 -1
  369. package/dist/components/BbCalendar/calendarMath.d.ts +102 -0
  370. package/dist/components/BbCalendar/calendarMath.js +124 -0
  371. package/dist/components/BbCalendar/ptKeys.generated.d.ts +248 -0
  372. package/dist/components/BbCalendar/types.d.ts +15 -9
  373. package/dist/components/BbCalendar/useCalendarContext.d.ts +43 -17
  374. package/dist/components/BbCalendar/useCalendarGrid.d.ts +71 -4
  375. package/dist/components/BbCalendar/useCalendarGrid.js +264 -210
  376. package/dist/components/BbCalendar/useDayGrid.d.ts +26 -8
  377. package/dist/components/BbCalendar/useDayGrid.js +178 -172
  378. package/dist/components/BbCalendar/useDayjsLocale.d.ts +18 -3
  379. package/dist/components/BbCalendar/useDayjsLocale.js +28 -28
  380. package/dist/components/BbCalendar/useToday.d.ts +5 -3
  381. package/dist/components/BbCalendar/useToday.js +22 -12
  382. package/dist/components/BbCarousel/BbCarousel.vue.d.ts +51 -0
  383. package/dist/components/BbCarousel/BbCarousel.vue.js +5 -0
  384. package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +818 -0
  385. package/dist/components/BbCarousel/ptKeys.generated.d.ts +60 -0
  386. package/dist/components/BbCarousel/types.d.ts +213 -0
  387. package/dist/components/BbCarousel/types.js +27 -0
  388. package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +4 -4
  389. package/dist/components/BbCheckbox/BbCheckbox.vue_vue_type_script_setup_true_lang.js +30 -30
  390. package/dist/components/BbCheckbox/ptKeys.generated.d.ts +220 -0
  391. package/dist/components/BbCheckbox/types.d.ts +30 -14
  392. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +164 -326
  393. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +50 -50
  394. package/dist/components/BbCheckboxGroup/ptKeys.generated.d.ts +492 -0
  395. package/dist/components/BbCheckboxGroup/types.d.ts +32 -23
  396. package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +3 -3
  397. package/dist/components/BbCollapsible/BbCollapsible.vue_vue_type_script_setup_true_lang.js +1 -1
  398. package/dist/components/BbCollapsible/ptKeys.generated.d.ts +20 -0
  399. package/dist/components/BbCollapsible/types.d.ts +5 -6
  400. package/dist/components/BbColorInput/BbColorInput.vue.d.ts +3 -3
  401. package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +124 -124
  402. package/dist/components/BbColorInput/ptKeys.generated.d.ts +656 -0
  403. package/dist/components/BbColorInput/types.d.ts +24 -14
  404. package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +2 -2
  405. package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +324 -287
  406. package/dist/components/BbColorPalette/ptKeys.generated.d.ts +40 -0
  407. package/dist/components/BbColorPalette/types.d.ts +15 -8
  408. package/dist/components/BbConfigScope/BbConfigScope.vue.d.ts +1 -1
  409. package/dist/components/BbConfigScope/types.d.ts +1 -1
  410. package/dist/components/BbConfirm/BbConfirm.vue.d.ts +1 -1
  411. package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +24 -24
  412. package/dist/components/BbConfirm/BbConfirmPortal.vue.d.ts +1 -1
  413. package/dist/components/BbConfirm/confirmEntry.d.ts +2 -2
  414. package/dist/components/BbConfirm/ptKeys.generated.d.ts +184 -0
  415. package/dist/components/BbConfirm/types.d.ts +14 -7
  416. package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +16 -97
  417. package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +208 -205
  418. package/dist/components/BbDatePicker/ptKeys.generated.d.ts +324 -0
  419. package/dist/components/BbDatePicker/types.d.ts +20 -13
  420. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +17 -306
  421. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +696 -579
  422. package/dist/components/BbDatePickerInput/calendarFields.d.ts +91 -0
  423. package/dist/components/BbDatePickerInput/calendarFields.js +188 -0
  424. package/dist/components/BbDatePickerInput/dateFieldLayout.d.ts +6 -0
  425. package/dist/components/BbDatePickerInput/dateFieldLayout.js +11 -1
  426. package/dist/components/BbDatePickerInput/ptKeys.generated.d.ts +1156 -0
  427. package/dist/components/BbDatePickerInput/types.d.ts +30 -20
  428. package/dist/components/BbDialog/BbDialog.vue.d.ts +6 -6
  429. package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +7 -7
  430. package/dist/components/BbDialog/ptKeys.generated.d.ts +100 -0
  431. package/dist/components/BbDialog/types.d.ts +24 -18
  432. package/dist/components/BbDropdown/AdaptiveDropdown.vue.d.ts +1 -1
  433. package/dist/components/BbDropdown/BbDropdown.vue.d.ts +3 -3
  434. package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +333 -327
  435. package/dist/components/BbDropdown/BbDropdownGroup.vue.d.ts +2 -2
  436. package/dist/components/BbDropdown/BbDropdownList.vue.d.ts +1 -1
  437. package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +278 -277
  438. package/dist/components/BbDropdown/DropdownRow.vue.d.ts +2 -2
  439. package/dist/components/BbDropdown/normalizeGroups.d.ts +2 -2
  440. package/dist/components/BbDropdown/ptKeys.generated.d.ts +228 -0
  441. package/dist/components/BbDropdown/types.d.ts +40 -35
  442. package/dist/components/BbDropdown/useDropdownContext.d.ts +2 -2
  443. package/dist/components/BbDropdown/useDropdownGroupRegistry.d.ts +5 -5
  444. package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +4 -4
  445. package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +84 -84
  446. package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +616 -0
  447. package/dist/components/BbDropdownButton/types.d.ts +17 -10
  448. package/dist/components/BbDropzone/BbDropzone.vue.d.ts +6 -25
  449. package/dist/components/BbDropzone/BbDropzone.vue_vue_type_script_setup_true_lang.js +14 -14
  450. package/dist/components/BbDropzone/ptKeys.generated.d.ts +76 -0
  451. package/dist/components/BbDropzone/types.d.ts +15 -8
  452. package/dist/components/BbForm/BbForm.vue.d.ts +3 -3
  453. package/dist/components/BbForm/BbFormCustomField.d.ts +1 -1
  454. package/dist/components/BbForm/bindFormField.d.ts +4 -4
  455. package/dist/components/BbForm/formFields.d.ts +5 -5
  456. package/dist/components/BbForm/formSchema.d.ts +4 -4
  457. package/dist/components/BbHost/BbHost.vue.d.ts +1 -1
  458. package/dist/components/BbHost/BbHostOpening.d.ts +3 -3
  459. package/dist/components/BbHost/types.d.ts +1 -1
  460. package/dist/components/BbHoverCard/BbHoverCard.vue.d.ts +3 -3
  461. package/dist/components/BbHoverCard/BbHoverCard.vue_vue_type_script_setup_true_lang.js +150 -144
  462. package/dist/components/BbHoverCard/BbHoverCardPortal.vue.d.ts +1 -1
  463. package/dist/components/BbHoverCard/ptKeys.generated.d.ts +44 -0
  464. package/dist/components/BbHoverCard/types.d.ts +8 -9
  465. package/dist/components/BbIcon/BbIcon.vue.d.ts +3 -3
  466. package/dist/components/BbIcon/ptKeys.generated.d.ts +8 -0
  467. package/dist/components/BbIcon/types.d.ts +7 -8
  468. package/dist/components/BbIndicator/BbIndicator.vue.d.ts +4 -4
  469. package/dist/components/BbIndicator/BbIndicator.vue_vue_type_script_setup_true_lang.js +1 -1
  470. package/dist/components/BbIndicator/ptKeys.generated.d.ts +52 -0
  471. package/dist/components/BbIndicator/types.d.ts +14 -7
  472. package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +3 -3
  473. package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +79 -79
  474. package/dist/components/BbNumberInput/numberDisplay.d.ts +10 -11
  475. package/dist/components/BbNumberInput/ptKeys.generated.d.ts +476 -0
  476. package/dist/components/BbNumberInput/types.d.ts +23 -13
  477. package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +7 -7
  478. package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +407 -406
  479. package/dist/components/BbOffCanvas/ptKeys.generated.d.ts +88 -0
  480. package/dist/components/BbOffCanvas/sheetAttrs.d.ts +1 -1
  481. package/dist/components/BbOffCanvas/sheetSnap.d.ts +2 -2
  482. package/dist/components/BbOffCanvas/types.d.ts +30 -23
  483. package/dist/components/BbOffCanvas/useOffCanvasStack.d.ts +1 -1
  484. package/dist/components/BbPagination/BbPagination.vue.d.ts +3 -3
  485. package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +6 -6
  486. package/dist/components/BbPagination/paginationFit.d.ts +1 -1
  487. package/dist/components/BbPagination/ptKeys.generated.d.ts +48 -0
  488. package/dist/components/BbPagination/types.d.ts +16 -8
  489. package/dist/components/BbPopover/BbPopover.vue.d.ts +3 -3
  490. package/dist/components/BbPopover/BbPopover.vue_vue_type_script_setup_true_lang.js +119 -113
  491. package/dist/components/BbPopover/BbPopoverPortal.vue.d.ts +1 -1
  492. package/dist/components/BbPopover/ptKeys.generated.d.ts +52 -0
  493. package/dist/components/BbPopover/types.d.ts +8 -9
  494. package/dist/components/BbProgress/BbProgress.vue.d.ts +2 -2
  495. package/dist/components/BbProgress/BbProgress.vue_vue_type_script_setup_true_lang.js +1 -1
  496. package/dist/components/BbProgress/ptKeys.generated.d.ts +20 -0
  497. package/dist/components/BbProgress/types.d.ts +4 -5
  498. package/dist/components/BbRadio/BbRadio.vue.d.ts +4 -4
  499. package/dist/components/BbRadio/BbRadio.vue_vue_type_script_setup_true_lang.js +30 -30
  500. package/dist/components/BbRadio/ptKeys.generated.d.ts +196 -0
  501. package/dist/components/BbRadio/types.d.ts +24 -13
  502. package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +148 -267
  503. package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +44 -44
  504. package/dist/components/BbRadioGroup/ptKeys.generated.d.ts +492 -0
  505. package/dist/components/BbRadioGroup/types.d.ts +30 -19
  506. package/dist/components/BbRating/BbRating.vue.d.ts +3 -3
  507. package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +107 -107
  508. package/dist/components/BbRating/ptKeys.generated.d.ts +152 -0
  509. package/dist/components/BbRating/types.d.ts +31 -20
  510. package/dist/components/BbRating/types.js +1 -1
  511. package/dist/components/BbSelect/BbSelect.vue.d.ts +264 -497
  512. package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +190 -190
  513. package/dist/components/BbSelect/ptKeys.generated.d.ts +960 -0
  514. package/dist/components/BbSelect/types.d.ts +29 -20
  515. package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +19 -51
  516. package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +518 -512
  517. package/dist/components/BbSelectPopover/knownItems.d.ts +4 -4
  518. package/dist/components/BbSelectPopover/ptKeys.generated.d.ts +148 -0
  519. package/dist/components/BbSelectPopover/reclickClears.d.ts +1 -1
  520. package/dist/components/BbSelectPopover/sheetChipAttrs.d.ts +1 -1
  521. package/dist/components/BbSelectPopover/types.d.ts +23 -15
  522. package/dist/components/BbSlider/BbSlider.vue.d.ts +14 -80
  523. package/dist/components/BbSlider/BbSlider.vue_vue_type_script_setup_true_lang.js +286 -270
  524. package/dist/components/BbSlider/ptKeys.generated.d.ts +316 -0
  525. package/dist/components/BbSlider/types.d.ts +28 -16
  526. package/dist/components/BbSlider/types.js +2 -0
  527. package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +3 -3
  528. package/dist/components/BbSmoothHeight/ptKeys.generated.d.ts +8 -0
  529. package/dist/components/BbSmoothHeight/types.d.ts +5 -6
  530. package/dist/components/BbSpinner/BbSpinner.vue.d.ts +3 -3
  531. package/dist/components/BbSpinner/ptKeys.generated.d.ts +8 -0
  532. package/dist/components/BbSpinner/types.d.ts +5 -6
  533. package/dist/components/BbSwitch/BbSwitch.vue.d.ts +4 -4
  534. package/dist/components/BbSwitch/BbSwitch.vue_vue_type_script_setup_true_lang.js +30 -30
  535. package/dist/components/BbSwitch/ptKeys.generated.d.ts +220 -0
  536. package/dist/components/BbSwitch/types.d.ts +15 -5
  537. package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +35 -114
  538. package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +10 -10
  539. package/dist/components/BbSwitchGroup/ptKeys.generated.d.ts +332 -0
  540. package/dist/components/BbSwitchGroup/types.d.ts +14 -5
  541. package/dist/components/BbTable/BbTable.vue.d.ts +10 -10
  542. package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1274 -1273
  543. package/dist/components/BbTable/BbTableDataRow.d.ts +4 -4
  544. package/dist/components/BbTable/BbTableEdgeRow.d.ts +5 -5
  545. package/dist/components/BbTable/BbTableExpandRow.d.ts +2 -2
  546. package/dist/components/BbTable/BbTableSelectToggle.d.ts +2 -2
  547. package/dist/components/BbTable/estimatedFloors.golden.d.ts +1 -1
  548. package/dist/components/BbTable/gridWidgets.d.ts +1 -1
  549. package/dist/components/BbTable/measuredFloors.d.ts +1 -1
  550. package/dist/components/BbTable/measuredFloorsTestKit.d.ts +1 -1
  551. package/dist/components/BbTable/ptKeys.generated.d.ts +280 -0
  552. package/dist/components/BbTable/types.d.ts +30 -22
  553. package/dist/components/BbTable/utils.d.ts +5 -5
  554. package/dist/components/BbTable/utils.js +89 -88
  555. package/dist/components/BbTabs/BbTabs.vue.d.ts +41 -69
  556. package/dist/components/BbTabs/BbTabs.vue_vue_type_script_setup_true_lang.js +13 -13
  557. package/dist/components/BbTabs/BbTabsList.vue.d.ts +3 -3
  558. package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +121 -122
  559. package/dist/components/BbTabs/BbTabsPanels.vue.d.ts +3 -3
  560. package/dist/components/BbTabs/BbTabsPanels.vue_vue_type_script_setup_true_lang.js +1 -1
  561. package/dist/components/BbTabs/BbTabsRoot.vue.d.ts +2 -2
  562. package/dist/components/BbTabs/ptKeys.generated.d.ts +226 -0
  563. package/dist/components/BbTabs/types.d.ts +40 -22
  564. package/dist/components/BbTag/BbTag.vue.d.ts +3 -3
  565. package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +261 -262
  566. package/dist/components/BbTag/ptKeys.generated.d.ts +540 -0
  567. package/dist/components/BbTag/types.d.ts +23 -13
  568. package/dist/components/BbTextInput/BbTextInput.vue.d.ts +14 -166
  569. package/dist/components/BbTextInput/BbTextInput.vue_vue_type_script_setup_true_lang.js +110 -110
  570. package/dist/components/BbTextInput/ptKeys.generated.d.ts +608 -0
  571. package/dist/components/BbTextInput/types.d.ts +23 -14
  572. package/dist/components/BbTextarea/BbTextarea.vue.d.ts +14 -166
  573. package/dist/components/BbTextarea/BbTextarea.vue_vue_type_script_setup_true_lang.js +110 -110
  574. package/dist/components/BbTextarea/ptKeys.generated.d.ts +608 -0
  575. package/dist/components/BbTextarea/types.d.ts +23 -14
  576. package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +13 -33
  577. package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +6 -6
  578. package/dist/components/BbTimePicker/ptKeys.generated.d.ts +80 -0
  579. package/dist/components/BbTimePicker/types.d.ts +17 -11
  580. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +15 -198
  581. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +398 -387
  582. package/dist/components/BbTimePickerInput/ptKeys.generated.d.ts +732 -0
  583. package/dist/components/BbTimePickerInput/types.d.ts +29 -17
  584. package/dist/components/BbToast/BbToast.vue.d.ts +2 -2
  585. package/dist/components/BbToast/BbToast.vue_vue_type_script_setup_true_lang.js +59 -52
  586. package/dist/components/BbToast/BbToastMessage.vue.d.ts +2 -2
  587. package/dist/components/BbToast/BbToastPortal.vue.d.ts +1 -1
  588. package/dist/components/BbToast/BbToastRegion.vue.d.ts +5 -3
  589. package/dist/components/BbToast/ptKeys.generated.d.ts +232 -0
  590. package/dist/components/BbToast/types.d.ts +20 -11
  591. package/dist/components/BbTooltip/BbTooltip.vue.d.ts +4 -4
  592. package/dist/components/BbTooltip/BbTooltip.vue_vue_type_script_setup_true_lang.js +99 -88
  593. package/dist/components/BbTooltip/ptKeys.generated.d.ts +36 -0
  594. package/dist/components/BbTooltip/tooltipWarmup.d.ts +2 -2
  595. package/dist/components/BbTooltip/types.d.ts +15 -8
  596. package/dist/components/BbTree/BbTree.vue.d.ts +7 -11
  597. package/dist/components/BbTree/BbTreeLevel.vue.d.ts +1 -1
  598. package/dist/components/BbTree/context.d.ts +2 -2
  599. package/dist/components/BbTree/ptKeys.generated.d.ts +16 -0
  600. package/dist/components/BbTree/types.d.ts +5 -6
  601. package/dist/components/ChipsBox/ChipsBox.vue.d.ts +2 -2
  602. package/dist/components/ChipsBox/types.d.ts +2 -2
  603. package/dist/components/ClearableButton/ClearableButton.vue.d.ts +2 -2
  604. package/dist/components/CloseIcon/CloseButton.vue.d.ts +2 -2
  605. package/dist/components/CommaBox/CommaBox.vue.d.ts +2 -2
  606. package/dist/components/CommaBox/types.d.ts +2 -2
  607. package/dist/components/CommonField/CommonField.vue.d.ts +7 -7
  608. package/dist/components/CommonField/CommonField.vue_vue_type_script_setup_true_lang.js +9 -4
  609. package/dist/components/CommonField/messageHeightMatrix.d.ts +1 -1
  610. package/dist/components/CommonField/types.d.ts +18 -14
  611. package/dist/components/CommonFieldInput/CommonFieldInput.vue.d.ts +3 -3
  612. package/dist/components/CommonFieldInput/types.d.ts +3 -3
  613. package/dist/components/CommonPopover/CommonPopover.vue.d.ts +4 -4
  614. package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +56 -55
  615. package/dist/components/CommonPopover/resolvePlacement.d.ts +9 -0
  616. package/dist/components/CommonPopover/resolvePlacement.js +9 -0
  617. package/dist/components/CommonPopover/types.d.ts +5 -5
  618. package/dist/components/CommonTimeSelector/CommonTimeSelector.vue.d.ts +2 -2
  619. package/dist/components/CommonTimeSelector/CommonTimeSelector.vue_vue_type_script_setup_true_lang.js +110 -99
  620. package/dist/components/CommonTimeSelector/useMeridiem.d.ts +1 -1
  621. package/dist/components/ErrorIcon/ErrorIcon.vue.d.ts +2 -2
  622. package/dist/components/FlatListBox/FlatListBox.vue.d.ts +2 -2
  623. package/dist/components/FlatListBox/types.d.ts +2 -2
  624. package/dist/components/GroupedListBox/GroupedListBox.vue.d.ts +2 -2
  625. package/dist/components/GroupedListBox/types.d.ts +2 -2
  626. package/dist/components/ListBox/ListBox.vue.d.ts +2 -2
  627. package/dist/components/ListBox/types.d.ts +2 -2
  628. package/dist/components/OptionsContainer/OptionsContainer.vue.d.ts +1 -1
  629. package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +55 -41
  630. package/dist/components/OptionsContainer/types.d.ts +3 -3
  631. package/dist/components/Transitions/Slide.vue.d.ts +5 -3
  632. package/dist/components/Transitions/Slide.vue.js +1 -1
  633. package/dist/components/WarningIcon/WarningIcon.vue.d.ts +2 -2
  634. package/dist/composables/autoHost.d.ts +1 -1
  635. package/dist/composables/formSubmitLock.d.ts +5 -5
  636. package/dist/composables/hostOpenings.d.ts +6 -6
  637. package/dist/composables/hostRegistry.d.ts +2 -2
  638. package/dist/composables/overlayRegistry.d.ts +25 -25
  639. package/dist/composables/overlayRegistry.js +13 -7
  640. package/dist/composables/useBaseOptions.d.ts +2 -2
  641. package/dist/composables/useBbConfig.d.ts +5 -5
  642. package/dist/composables/useBbDialog.d.ts +17 -17
  643. package/dist/composables/useBbDialog.js +2 -1
  644. package/dist/composables/useBbDropdown.d.ts +1 -1
  645. package/dist/composables/useBbForm.d.ts +2 -2
  646. package/dist/composables/useBbFormField.d.ts +4 -4
  647. package/dist/composables/useBbOffCanvas.d.ts +6 -6
  648. package/dist/composables/useBbTable.d.ts +4 -4
  649. package/dist/composables/useBbTabs.d.ts +4 -4
  650. package/dist/composables/useBbTabs.js +44 -43
  651. package/dist/composables/useBreakpoint.d.ts +1 -1
  652. package/dist/composables/useCharacterCounter.d.ts +2 -2
  653. package/dist/composables/useChoiceIndicator.d.ts +2 -2
  654. package/dist/composables/useClosingInert.d.ts +1 -1
  655. package/dist/composables/useConfig.d.ts +3 -3
  656. package/dist/composables/useConfigDefaults.d.ts +3 -3
  657. package/dist/composables/useConfirm.d.ts +11 -11
  658. package/dist/composables/useDirection.d.ts +43 -0
  659. package/dist/composables/useDirection.js +12 -0
  660. package/dist/composables/useFormBinding.d.ts +4 -4
  661. package/dist/composables/useId.d.ts +1 -1
  662. package/dist/composables/useItemsGetter.d.ts +3 -3
  663. package/dist/composables/useKeyboardInset.d.ts +1 -1
  664. package/dist/composables/useListboxFocus.d.ts +1 -1
  665. package/dist/composables/useLocale.d.ts +2 -2
  666. package/dist/composables/useOnDemandOpener.d.ts +3 -3
  667. package/dist/composables/useOverlayNavigation.d.ts +1 -1
  668. package/dist/composables/useOverlayYield.d.ts +1 -1
  669. package/dist/composables/usePassthrough.d.ts +6 -6
  670. package/dist/composables/useQuery.d.ts +1 -1
  671. package/dist/composables/useRefusedCloseAnnouncement.d.ts +1 -1
  672. package/dist/composables/useSafeArea.d.ts +1 -1
  673. package/dist/composables/useSafeAreaInternal.d.ts +1 -1
  674. package/dist/composables/useSegmentedFields.d.ts +25 -0
  675. package/dist/composables/useSegmentedFields.js +165 -115
  676. package/dist/composables/useServerPrefetch.d.ts +2 -2
  677. package/dist/composables/useSheetSurface.d.ts +1 -1
  678. package/dist/composables/useSsrState.d.ts +2 -2
  679. package/dist/composables/useToast.d.ts +8 -1
  680. package/dist/composables/useToast.js +39 -35
  681. package/dist/composables/useTypeahead.js +22 -21
  682. package/dist/deprecation/ai-deprecations.json.d.ts +116 -0
  683. package/dist/deprecation/ai-deprecations.json.js +1 -1
  684. package/dist/deprecation/removedProps.d.ts +1 -1
  685. package/dist/directives/bbColor.d.ts +1 -1
  686. package/dist/directives/bbDate.d.ts +1 -1
  687. package/dist/directives/bbDialog.d.ts +3 -3
  688. package/dist/directives/bbDropdown.d.ts +1 -1
  689. package/dist/directives/bbHoverCard.d.ts +3 -3
  690. package/dist/directives/bbOffCanvas.d.ts +2 -2
  691. package/dist/directives/bbPopover.d.ts +3 -3
  692. package/dist/directives/bbTime.d.ts +1 -1
  693. package/dist/directives/bbTooltip.d.ts +4 -4
  694. package/dist/directives/directivePortal.d.ts +4 -4
  695. package/dist/directives/overlayTrigger.d.ts +4 -4
  696. package/dist/directives/overlayTrigger.js +2 -1
  697. package/dist/i18n/eraNames.d.ts +2 -0
  698. package/dist/i18n/eraNames.js +2013 -0
  699. package/dist/i18n/index.d.ts +9 -7
  700. package/dist/i18n/localeTags.d.ts +36 -0
  701. package/dist/i18n/locales/ar.json +176 -0
  702. package/dist/i18n/locales/cs.json +21 -2
  703. package/dist/i18n/locales/da.json +21 -2
  704. package/dist/i18n/locales/de-CH.json +21 -2
  705. package/dist/i18n/locales/de.json +21 -2
  706. package/dist/i18n/locales/el.json +21 -2
  707. package/dist/i18n/locales/en-GB.json +21 -2
  708. package/dist/i18n/locales/en.json +21 -2
  709. package/dist/i18n/locales/es-MX.json +21 -2
  710. package/dist/i18n/locales/es.json +21 -2
  711. package/dist/i18n/locales/fa.json +176 -0
  712. package/dist/i18n/locales/fi.json +21 -2
  713. package/dist/i18n/locales/fr.json +21 -2
  714. package/dist/i18n/locales/he.json +176 -0
  715. package/dist/i18n/locales/hu.json +21 -2
  716. package/dist/i18n/locales/it.json +21 -2
  717. package/dist/i18n/locales/ja.json +21 -2
  718. package/dist/i18n/locales/ko.json +21 -2
  719. package/dist/i18n/locales/nb.json +21 -2
  720. package/dist/i18n/locales/nl.json +21 -2
  721. package/dist/i18n/locales/pl.json +21 -2
  722. package/dist/i18n/locales/pt-BR.json +21 -2
  723. package/dist/i18n/locales/pt-PT.json +21 -2
  724. package/dist/i18n/locales/ro.json +21 -2
  725. package/dist/i18n/locales/ru.json +21 -2
  726. package/dist/i18n/locales/sv.json +21 -2
  727. package/dist/i18n/locales/tr.json +21 -2
  728. package/dist/i18n/locales/uk.json +21 -2
  729. package/dist/i18n/locales/zh-CN.json +21 -2
  730. package/dist/i18n/locales/zh-HK.json +21 -2
  731. package/dist/i18n/locales/zh-TW.json +21 -2
  732. package/dist/i18n/regionHints.js +22 -22
  733. package/dist/i18n/regions.d.ts +73 -24
  734. package/dist/i18n/regions.js +57 -12
  735. package/dist/index.d.ts +191 -189
  736. package/dist/index.js +55 -54
  737. package/dist/llms-full.txt +7025 -5079
  738. package/dist/llms-medium.txt +486 -340
  739. package/dist/llms.txt +4 -3
  740. package/dist/locale-blueprint.json +24 -2
  741. package/dist/locale-tags.js +81 -0
  742. package/dist/mcp-sdk.LICENSES.txt +210 -0
  743. package/dist/mcp-sdk.mjs +78 -0
  744. package/dist/nuxt-auto-imports.d.ts +1 -1
  745. package/dist/nuxt-auto-imports.js +1 -1
  746. package/dist/nuxt-module.d.ts +5 -5
  747. package/dist/nuxt.js +20 -17
  748. package/dist/plugin.d.ts +2 -2
  749. package/dist/project-dts.d.ts +4 -4
  750. package/dist/project-dts.js +68 -62
  751. package/dist/setup-kit.LICENSES.txt +23 -0
  752. package/dist/setup-kit.mjs +9 -0
  753. package/dist/styles.css +2 -2
  754. package/dist/types/ActionButton.d.ts +3 -3
  755. package/dist/types/AlertVariant.d.ts +1 -1
  756. package/dist/types/BadgeVariant.d.ts +1 -1
  757. package/dist/types/ButtonVariant.d.ts +1 -1
  758. package/dist/types/CheckboxVariant.d.ts +2 -2
  759. package/dist/types/ColumnName.d.ts +1 -1
  760. package/dist/types/CommonProps.d.ts +25 -3
  761. package/dist/types/Config.d.ts +9 -9
  762. package/dist/types/ConfigDefaults.d.ts +37 -37
  763. package/dist/types/ConfirmVariant.d.ts +1 -1
  764. package/dist/types/DatePickerType.d.ts +29 -2
  765. package/dist/types/DatePickerType.js +6 -2
  766. package/dist/types/DropdownItemVariant.d.ts +1 -1
  767. package/dist/types/IndicatorVariant.d.ts +1 -1
  768. package/dist/types/InputVariant.d.ts +1 -1
  769. package/dist/types/ItemAccessor.d.ts +7 -1
  770. package/dist/types/ItemProps.d.ts +3 -3
  771. package/dist/types/ItemsProvider.d.ts +2 -2
  772. package/dist/types/Placement.d.ts +7 -2
  773. package/dist/types/RadioVariant.d.ts +2 -2
  774. package/dist/types/ShapeErased.d.ts +1 -1
  775. package/dist/types/TabsVariant.d.ts +1 -1
  776. package/dist/types/ToastVariant.d.ts +1 -1
  777. package/dist/types/TooltipVariant.d.ts +1 -1
  778. package/dist/types/fallthrough.d.ts +1 -1
  779. package/dist/types/passthrough.d.ts +17 -17
  780. package/dist/types/ptComponentMap.d.ts +16 -15
  781. package/dist/utilities/calendar/canonicalParts.d.ts +29 -0
  782. package/dist/utilities/calendar/canonicalParts.js +12 -0
  783. package/dist/utilities/calendar/digits.d.ts +18 -0
  784. package/dist/utilities/calendar/digits.js +26 -0
  785. package/dist/utilities/calendar/gregorian.d.ts +2 -0
  786. package/dist/utilities/calendar/gregorian.js +36 -0
  787. package/dist/utilities/calendar/index.d.ts +3 -0
  788. package/dist/utilities/calendar/index.js +1 -0
  789. package/dist/utilities/calendar/international.d.ts +19 -0
  790. package/dist/utilities/calendar/resolve.d.ts +32 -0
  791. package/dist/utilities/calendar/resolve.js +12 -0
  792. package/dist/utilities/calendar/runtime.d.ts +49 -0
  793. package/dist/utilities/calendar/types.d.ts +140 -0
  794. package/dist/utilities/calendar/types.js +83 -0
  795. package/dist/utilities/functions/convertDateValue.d.ts +15 -2
  796. package/dist/utilities/functions/convertDateValue.js +22 -17
  797. package/dist/utilities/functions/elementLabel.d.ts +1 -1
  798. package/dist/utilities/functions/extractDomContainer.d.ts +1 -1
  799. package/dist/utilities/functions/isDateDisabled.d.ts +9 -1
  800. package/dist/utilities/functions/isDateDisabled.js +38 -21
  801. package/dist/utilities/functions/itemProps.d.ts +1 -1
  802. package/dist/utilities/functions/normalizeDateBound.d.ts +45 -2
  803. package/dist/utilities/functions/normalizeDateBound.js +52 -11
  804. package/dist/utilities/functions/parseSize.d.ts +2 -2
  805. package/dist/utilities/functions/readableValue.d.ts +1 -1
  806. package/dist/utilities/functions/responsiveDefault.d.ts +1 -1
  807. package/dist/utilities/functions/slotKey.d.ts +1 -1
  808. package/dist/utilities/functions/toggleInput.d.ts +1 -1
  809. package/dist/utilities/functions/warnRemovedAttrs.d.ts +3 -3
  810. package/dist/utilities/functions/when.d.ts +1 -1
  811. package/dist/utilities/misc/autofocus.d.ts +2 -2
  812. package/dist/utilities/misc/listboxMetrics.d.ts +1 -1
  813. package/dist/utilities/misc/maskaDataOptions.d.ts +1 -1
  814. package/dist/utilities/misc/ssrStateInjectionKey.d.ts +1 -1
  815. package/dist/utilities/misc/ssrValue.d.ts +1 -1
  816. package/dist/utils/configDefaults.d.ts +11 -1
  817. package/dist/utils/configDefaults.js +73 -43
  818. package/dist/utils/copyData.d.ts +2 -2
  819. package/dist/utils/cssLayers.d.ts +1 -1
  820. package/dist/utils/focusVisibility.d.ts +1 -1
  821. package/dist/utils/injectLibraryStyles.d.ts +1 -1
  822. package/dist/utils/overlayEscapeStack.d.ts +1 -1
  823. package/dist/utils/passthrough.d.ts +1 -1
  824. package/dist/utils/passthroughDeduper.d.ts +1 -1
  825. package/dist/utils/releasedActivator.d.ts +20 -0
  826. package/dist/utils/releasedActivator.js +11 -0
  827. package/dist/utils/versionCheck.d.ts +1 -1
  828. package/dist/utils/versionCheck.js +1 -1
  829. package/dist/vite-plugin.d.ts +90 -32
  830. package/dist/vite.js +416 -341
  831. package/llms.txt +4 -3
  832. package/package.json +51 -19
  833. package/scripts/README.md +2 -1
  834. package/scripts/lib/agent-manifest.mjs +105 -22
  835. package/scripts/lib/agent-refresh.mjs +151 -0
  836. package/scripts/lib/agent-setup.mjs +679 -0
  837. package/scripts/lib/carousel-items-without-slide.mjs +263 -0
  838. package/scripts/lib/carousel-prop-or-local.mjs +117 -0
  839. package/scripts/lib/check-fix.mjs +1 -1
  840. package/scripts/lib/collapsible-trigger-aria.mjs +1 -1
  841. package/scripts/lib/css-class-check.mjs +3 -3
  842. package/scripts/lib/css-local-check.mjs +25 -17
  843. package/scripts/lib/css-surface-answer.mjs +117 -0
  844. package/scripts/lib/define-preset-copy.mjs +1 -1
  845. package/scripts/lib/distributed-alias.mjs +81 -0
  846. package/scripts/lib/doc-sections.mjs +12 -4
  847. package/scripts/lib/dropdown-default-slot.mjs +1 -1
  848. package/scripts/lib/eslint-disable.mjs +58 -2
  849. package/scripts/lib/eslint-plugin.d.ts +10 -1
  850. package/scripts/lib/eslint-plugin.mjs +542 -64
  851. package/scripts/lib/form-v-model.mjs +1 -1
  852. package/scripts/lib/hand-imported-styles.mjs +2 -2
  853. package/scripts/lib/hand-roll-hints.mjs +25 -3
  854. package/scripts/lib/helper-canon.mjs +4 -4
  855. package/scripts/lib/helpers-add.mjs +39 -24
  856. package/scripts/lib/hidden-label-placeholder.mjs +1 -1
  857. package/scripts/lib/idiom-scan.mjs +4 -4
  858. package/scripts/lib/is-direct-run.mjs +20 -0
  859. package/scripts/lib/items-provider-context.mjs +1 -1
  860. package/scripts/lib/linked-target.mjs +26 -2
  861. package/scripts/lib/local-components.mjs +2 -2
  862. package/scripts/lib/locale-check.mjs +109 -13
  863. package/scripts/lib/mcp-config.mjs +140 -75
  864. package/scripts/lib/mcp-sdk.mjs +199 -0
  865. package/scripts/lib/migrate-fix.mjs +3 -3
  866. package/scripts/lib/plugin-options-check.mjs +170 -0
  867. package/scripts/lib/pnp.mjs +165 -0
  868. package/scripts/lib/portal-names.mjs +4 -4
  869. package/scripts/lib/prefer-v-bb-dialog.mjs +1 -1
  870. package/scripts/lib/project-variant-dts.mjs +80 -15
  871. package/scripts/lib/reactive-v-model.mjs +2 -2
  872. package/scripts/lib/redundant-item-accessor.mjs +1 -1
  873. package/scripts/lib/renamed-item-field.mjs +1 -1
  874. package/scripts/lib/renamed-slot-prop.mjs +524 -0
  875. package/scripts/lib/rule-registry.mjs +1 -1
  876. package/scripts/lib/setup-edits.mjs +1845 -0
  877. package/scripts/lib/setup.mjs +440 -0
  878. package/scripts/lib/slot-key.mjs +1 -1
  879. package/scripts/lib/slot-renames.mjs +3 -3
  880. package/scripts/lib/squashed-slot-words.mjs +1 -1
  881. package/scripts/lib/tab-links.mjs +2 -2
  882. package/scripts/lib/text-null-value.mjs +1 -1
  883. package/scripts/lib/toolchain-check.mjs +3 -3
  884. package/scripts/lib/tooling-options.mjs +87 -0
  885. package/scripts/lib/unimported-components.mjs +1 -1
  886. package/scripts/lib/unstyled-variants.mjs +1 -1
  887. package/scripts/lib/valid-locale.mjs +119 -0
  888. package/scripts/lib/validate-bb-markup.mjs +146 -102
  889. package/scripts/lib/wrapper-props.mjs +2 -2
  890. package/dist/components/BbNumberInput/warroom/corpus.d.ts +0 -58
  891. package/dist/components/BbNumberInput/warroom/currency-verify.rows.d.ts +0 -28
  892. package/dist/components/BbNumberInput/warroom/currency.rows.d.ts +0 -2
  893. package/dist/components/BbNumberInput/warroom/harness.d.ts +0 -217
  894. package/dist/components/BbNumberInput/warroom/oracle.d.ts +0 -150
  895. package/dist/components/BbTable/warroom/harness.d.ts +0 -260
  896. package/dist/utilities/functions/pipe.d.ts +0 -3
  897. package/dist/utilities/functions/range.js +0 -7
  898. package/scripts/lib/check-queue.mjs +0 -102
  899. package/scripts/lib/component-attr-targets.ts +0 -123
  900. package/scripts/lib/component-tree.ts +0 -648
  901. package/scripts/lib/consumer-install.mjs +0 -64
  902. package/scripts/lib/css-class-surface.mjs +0 -328
  903. package/scripts/lib/css-color-resolve.mjs +0 -296
  904. package/scripts/lib/css-comment-text.mjs +0 -16
  905. package/scripts/lib/design-token-manifest.mjs +0 -506
  906. package/scripts/lib/ensure-manifest.mjs +0 -135
  907. package/scripts/lib/example-checks.mjs +0 -337
  908. package/scripts/lib/guide-claims.mjs +0 -452
  909. package/scripts/lib/manifest-pointers.mjs +0 -71
  910. package/scripts/lib/pack.mjs +0 -55
  911. package/scripts/lib/public-type-exports.mjs +0 -273
  912. package/scripts/lib/quiet-gate.mjs +0 -385
  913. package/scripts/lib/recipe-excerpts.mjs +0 -98
  914. package/scripts/lib/swap-noun.mjs +0 -33
  915. package/scripts/lib/token-color-mix.mjs +0 -114
@@ -1,2080 +1,27 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * bitboss-ui CLI — AI-affordance utilities for consumer projects.
4
- *
5
- * Commands:
6
- * ai-init Inject bitboss-ui knowledge-base pointers into the current
7
- * project so coding agents discover and follow the library's
8
- * agent contract — harness-agnostic, not Claude-only. Writes:
9
- * - AGENTS.md fragment (Cursor, Codex, many others)
10
- * - .cursor/rules/bitboss-ui.mdc (Cursor)
11
- * - .github/copilot-instructions.md fragment (GitHub Copilot)
12
- * - .claude/skills/bitboss-ui/SKILL.md (Claude Code)
13
- * - .windsurf/rules/bitboss-ui.md (Windsurf)
14
- * - `vueCompilerOptions.checkUnknownComponents: true` in the
15
- * tsconfig (Q60.6), unless the project already names it
16
- * Also registers the `bitboss-ui mcp` server for Claude Code,
17
- * Cursor, VS Code and Zed and installs its optional peers
18
- * (`@modelcontextprotocol/sdk`, `zod`) with the project's package
19
- * manager; pass --no-mcp to skip both.
20
- * check Validate Bb* markup in .vue/.md files against the installed
21
- * components.json manifest (unknown props, removed props, bad
22
- * v-models, unknown `<template #slot>` names, `href`/`to`/
23
- * `method` on a component that doesn't declare them). Exits 1
24
- * on findings; supports --json output. Every finding carries the
25
- * source line. `--allow-component <Name>` (or package.json's
26
- * `bitboss-ui.allowComponents`) exempts an app-owned component
27
- * whose name happens to start with `Bb`.
28
- *
29
- * `--manifest <path>` judges against ANOTHER version's
30
- * components.json instead of the installed one — answers "what
31
- * breaks if I upgrade" BEFORE upgrading. A path, not a version:
32
- * no network call inside a CI validator.
33
- *
34
- * SCOPE: `check` knows the INSTALLED v3 API and nothing about v2.
35
- * "was removed from X" is a recorded v2→v3 break; "is not in X's
36
- * API" only says the prop is not a v3 prop of that component —
37
- * it may never have been one anywhere. `printFindingLegend` says
38
- * so in the output, because two migrating fleets each spent real
39
- * time discovering it the hard way.
40
- * add Copy Inertia helpers into the app as files it owns
41
- * (scripts/lib/helpers-add.mjs); `helpers list|diff|update`
42
- * reports on them and refreshes the ones the app has not edited.
43
- * changelog Breaking changes between two releases, then what they added —
44
- * `--since <version>` answers "what breaks if I bump", without MCP. Reads the
45
- * installed `dist/ai/changelog.json`.
46
- * mcp Start a stdio MCP server exposing the dist/ai knowledge base
47
- * (search_docs, search_components, get_component, get_composable,
48
- * list_tokens, list_guides, get_guide, list_changes, list_recipes,
49
- * get_recipe, validate) to MCP-capable agent harnesses.
50
- *
51
- * Plain ESM JavaScript on purpose: shipped as-is in the package, no build.
52
- */
53
-
54
- import { spawnSync } from 'node:child_process';
55
- // `globSync` is read off the namespace, not imported by name: it only exists
56
- // from Node 22, and a named import of a missing builtin export is a
57
- // SyntaxError at load time, which killed every command on Node 20 (Sail
58
- // images still ship it). Only quoted glob arguments need it (Q46.4).
59
- import * as fs from 'node:fs';
60
- import {
61
- existsSync,
62
- mkdirSync,
63
- readdirSync,
64
- readFileSync,
65
- statSync,
66
- writeFileSync,
67
- } from 'node:fs';
68
- import {
69
- findHandRollHints,
70
- loadKnownTokens,
71
- } from '../scripts/lib/hand-roll-hints.mjs';
72
- import {
73
- loadAdoptionRows,
74
- repeatedIdioms,
75
- repeatOccurrences,
76
- scanIdioms,
77
- } from '../scripts/lib/idiom-scan.mjs';
78
- import {
79
- disabledChecker,
80
- ruleForFinding,
81
- } from '../scripts/lib/eslint-disable.mjs';
82
- import {
83
- localBbImports,
84
- localBbWarning,
85
- projectLocalBbComponents,
86
- } from '../scripts/lib/local-components.mjs';
87
- import { applyBitbossFixes } from '../scripts/lib/check-fix.mjs';
88
- import { stringControlsFor } from '../scripts/lib/text-null-value.mjs';
89
- import { projectResolution } from '../scripts/lib/unimported-components.mjs';
90
- import {
91
- MAY_HAVE_PORTALS,
92
- portalFindings,
93
- projectPortalIndex,
94
- } from '../scripts/lib/portal-names.mjs';
95
- import {
96
- cssClassFindings,
97
- ownedClassBlocks,
98
- } from '../scripts/lib/css-class-check.mjs';
99
- import {
100
- cssLocalFindings,
101
- libraryTokens,
102
- localReads,
103
- } from '../scripts/lib/css-local-check.mjs';
104
- import {
105
- HAND_IMPORTED_STYLES_EXTENSIONS,
106
- handImportedStylesFindings,
107
- readPluginConfig,
108
- } from '../scripts/lib/hand-imported-styles.mjs';
109
- import { unstyledVariants } from '../scripts/lib/unstyled-variants.mjs';
110
- import { unknownLocaleFindings } from '../scripts/lib/locale-check.mjs';
111
- import {
112
- readShippedDefinePreset,
113
- staleDefinePresetFindings,
114
- } from '../scripts/lib/define-preset-copy.mjs';
115
- import {
116
- readOptionsApiOff,
117
- readRegisteredVariants,
118
- variantOptionLabel,
119
- syncNotice,
120
- syncProjectVariantDts,
121
- } from '../scripts/lib/project-variant-dts.mjs';
122
- import { refuseLinkedTarget } from '../scripts/lib/linked-target.mjs';
123
- import {
124
- ensureCheckUnknownComponents,
125
- strictTemplateSuggestion,
126
- toolchainWarnings,
127
- } from '../scripts/lib/toolchain-check.mjs';
128
- import { dirname, isAbsolute, join, relative, resolve } from 'node:path';
129
- import { fileURLToPath, pathToFileURL } from 'node:url';
130
- import { parseArgs } from 'node:util';
131
- import {
132
- detectPackageManager,
133
- devInstallCommand,
134
- ensureMcpConfigs,
135
- missingMcpPeers,
136
- MCP_BIN_PATH,
137
- MCP_PEERS,
138
- } from '../scripts/lib/mcp-config.mjs';
139
- import {
140
- addRegistrations,
141
- configuredRegisteredRules,
142
- ownedBy,
143
- packageRuleNames,
144
- } from '../scripts/lib/rule-registry.mjs';
145
- import {
146
- loadManifest,
147
- presetDefinitions,
148
- validateMarkdown,
149
- validateVueSnippet,
150
- REGISTERED_VARIANT_OPTIONS,
151
- } from '../scripts/lib/validate-bb-markup.mjs';
152
-
153
- const PACKAGE_ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
154
- const KNOWLEDGE_BASE = 'node_modules/bitboss-ui/dist/ai';
155
- const ROUTER = `${KNOWLEDGE_BASE}/guides/ai-router.md`;
156
- const CONTRACT = `${KNOWLEDGE_BASE}/guides/agent-contract.md`;
157
-
158
- const START_MARKER = '<!-- bitboss-ui:ai:start -->';
159
- const END_MARKER = '<!-- bitboss-ui:ai:end -->';
160
-
161
- function packageVersion() {
162
- try {
163
- const pkg = JSON.parse(
164
- readFileSync(join(PACKAGE_ROOT, 'package.json'), 'utf-8')
165
- );
166
- return pkg.version ?? 'unknown';
167
- } catch {
168
- return 'unknown';
169
- }
170
- }
171
-
172
- /** Shared rules body used by every harness (paths relative to project root). */
173
- function coreRules(version) {
174
- return `This project uses \`bitboss-ui\` (v${version}). Before writing any UI that uses it:
175
-
176
- **If the \`bitboss-ui\` MCP server is connected** (\`ai-init\` registers it), ask it first: \`search_docs\` for "how do I…", \`get_component\` for one component (then \`members\` / \`sections\` for detail), \`list_changes({ since })\` before an upgrade, \`validate\` after writing markup. It answers in small pieces; the files below are the fallback.
177
-
178
- 1. **Start at the AI Router**: \`${ROUTER}\` — which file to open next (do not dump the full catalogue into context).
179
- 2. **Obey the agent contract**: \`${CONTRACT}\`.
180
- 3. **Prefer \`Bb*\` consumer components**; never use entries marked "Reference Only - Internal" unless the user explicitly asks for internals. (\`BbBaseButton\` and the \`BbBase*Icon\` glyphs are consumer API; the \`Common*\` building blocks are not.)
181
- 4. **Never invent prop/event/slot names** — open \`${KNOWLEDGE_BASE}/<ComponentName>.md\` (Usage & Guidelines first) or its API file \`${KNOWLEDGE_BASE}/manifest/components/<ComponentName>.json\` (one member per line; a row marked \`common: true\` is whole in \`${KNOWLEDGE_BASE}/manifest/common.json\`; the list is \`${KNOWLEDGE_BASE}/manifest/index.json\`). Never read \`components.json\` whole: it is the 1.2 MB file the tools use.
182
- 5. **Icons**: discover names first; never invent them (\`${KNOWLEDGE_BASE}/guides/icons-policy.md\`).
183
- 6. **Item-driven components**: declarative \`items\` (an object row reads its own \`label\` and \`value\`; \`item-text\` / \`item-value\` only for other field names, never to restate those two), \`dependencies\`, \`enforce-coherence\` — no manual watchers for coherence.
184
- 7. **Whole pages**: one recipe under \`${KNOWLEDGE_BASE}/recipes/{vue|nuxt|inertia}/\` (see the router table).
185
- 8. **CSS near components**: \`${KNOWLEDGE_BASE}/guides/design-language.md\`. Paint as data is \`${KNOWLEDGE_BASE}/design-tokens.json\` and \`design-tokens.manifest.yaml\` (DESIGN.md-shaped). Grep \`--bb-*\`, not \`--color-*\` or \`--radius-*\`. A repo-root DESIGN.md is not this library. Two token tiers, and reaching for the wrong one is why apps end up re-skinning by class: \`--bb-*\` is the small GLOBAL theme tier (brand knobs, no numeric ramp — there is no \`--bb-primary-800\`), while each component declares its own **unprefixed** \`--*\` tokens for its look (\`.bb-table { --cell-h: 32px }\`). A missing \`--bb-*\` name is not a gap in the library — it means the knob you want is a component token. Set it on the element that DECLARES it (grep \`${KNOWLEDGE_BASE}/source/<ComponentName>.md\`); a value set further out is masked, not inherited. Prefer tokens, variants and \`pt\`; CSS on \`.bb-*__*\` internals is allowed for fine-tuning but unsupported: it can break on upgrade. \`.bb-common-*\` / \`.bb-field*\` internals: expect it to break. (\`.bb-base-button\` and the three \`.bb-base-*-icon\` glyph classes are consumer API — a supported hook, not an internal.) An override on an internal is a signal to check for a \`pt\` part or request one. A Tailwind utility on a \`Bb*\` component that does nothing is rule 9, not a library bug. One primary action per view region.
186
- 9. **Tailwind v4 app: turn on cascade layers when you set bitboss-ui up**, not later when a class "doesn't work". In the build plugin: \`import { bitbossUi, TAILWIND_V4_LAYERS } from 'bitboss-ui/vite'\` and \`bitbossUi({ cssLayers: TAILWIND_V4_LAYERS })\` (Nuxt: \`bitboss: { cssLayers: TAILWIND_V4_LAYERS }\`, same import). Tailwind v4 emits layered CSS; without this the library's CSS is unlayered and beats every utility you put on a \`Bb*\` component or a \`pt:*\` part, whatever the specificity. With it, your utilities win. You still need the runtime plugin (\`app.use(bitbossUiPlugin)\`; Nuxt does it for you): it is what injects the sheet, into that layer. **Do not also \`@import 'bitboss-ui/styles.css'\`**: a hand import adds a second, unlayered copy and undoes the setting. Tailwind v3 or plain CSS: leave it unset. Details: \`${KNOWLEDGE_BASE}/guides/installation-and-plugin-setup.md\` § Cascade layers.
187
- 10. **Set a \`font-family\` on \`body\`** (components inherit it; there is no font token), e.g. \`body { font-family: system-ui, sans-serif; }\`, or load the optional reset (\`resetCss: true\`), which sets that stack. Without either the whole app renders in the browser's default serif.
188
- 11. **Variants are yours to add**: the shipped \`variant\` names are a floor, not a ceiling. When the design needs a colour the library doesn't ship (soft status badges, a brand button tone), **register the name** in the build plugin's components map (\`components: { BbBadge: { variants: ['soft-green'] } }\`, also \`BbButton\`, \`BbAlert\`, …) and **style \`.bb-badge--<name>\`** (etc.) in a project stylesheet loaded after \`bitboss-ui/styles.css\`. Do both halves — a registered name with no CSS ships an unstyled pill, and CSS with no registration fails \`vue-tsc\`. After registering, run \`npx bitboss-ui check\`: it writes the project's \`bitboss-ui.d.ts\` so the new name type-checks before Vite has run. Never write an unregistered name, and never downgrade the design to a neutral shipped variant to avoid registering. Canonical palette + snippet: \`${KNOWLEDGE_BASE}/guides/design-language.md\` § Getting soft semantic badges.
189
- 12. **Never name your own components \`Bb…\`** — that prefix is bitboss-ui's. Use your app's prefix (\`App…\`, \`Acme…\`). \`check\` leaves an app's own \`Bb*\` component alone but warns: a future bitboss-ui component could take the name.
190
- 13. **Set \`locale\` explicitly** in the build plugin (\`bitbossUi({ locale: 'it' })\` / nuxt \`bitboss: { locale: 'it' }\`) for any app that is not English: the built-in strings default to English (\`'en'\`, since 3.0.0-beta.41; it was \`'it'\`).
191
- 14. **After writing bitboss-ui markup**, run \`npx bitboss-ui check\` — validates \`Bb*\` usage against the installed \`components.json\` and catches invented/removed props before review. In an edit loop, \`npx bitboss-ui check --changed\` checks only the files git sees changed; run the full check before you finish.
192
- 15. **Inertia apps: install the app-side helpers with \`npx bitboss-ui add <name>\`** (\`useQueryObject\`, \`usePromiseForm\`, \`useTableContext\`, …; \`npx bitboss-ui helpers list\` names them). Never paste them from the guide. If \`add\` or \`helpers update\` refuses, stop and show the user its output and \`npx bitboss-ui helpers diff <name>\`; never edit \`bitboss-ui.lock.json\`, and never delete a helper file to get past a refusal.
193
-
194
- After upgrading bitboss-ui, re-run: \`npx bitboss-ui ai-init\` (Inertia apps: then \`npx bitboss-ui helpers update\`)`;
195
- }
196
-
197
- // A blank line after the start marker and before the end marker: an HTML
198
- // comment butting against a heading or a paragraph is not Prettier-stable
199
- // markdown, and a consumer running `prettier --check` on their AGENTS.md
200
- // (as our own fixture does in CI) would fail on text we wrote.
201
- function agentsFragment(version) {
202
- return `${START_MARKER}
203
-
204
- ## bitboss-ui (v${version})
205
-
206
- ${coreRules(version)}
207
-
208
- ${END_MARKER}`;
209
- }
210
-
211
- function skillContent(version) {
212
- return `---
213
- name: bitboss-ui
214
- description: Use when writing, reviewing, or debugging Vue code that uses the bitboss-ui component library (Bb* components, useToast/useConfirm composables) — provides typed component contracts, agent rules, and usage playbooks.
215
- ---
216
-
217
- # bitboss-ui knowledge base (v${version})
218
-
219
- All paths are relative to the project root.
220
-
221
- ## Before writing any bitboss-ui code
222
-
223
- ${coreRules(version)}
224
-
225
- ## Deeper material
226
-
227
- - Playbooks and setup: \`${KNOWLEDGE_BASE}/guides/\`
228
- - Composables: \`${KNOWLEDGE_BASE}/composables/\`
229
- - Full index (last resort): \`${KNOWLEDGE_BASE}/index.md\`
230
- - Implementation source (rarely needed): \`${KNOWLEDGE_BASE}/source/<ComponentName>.md\`
231
- `;
232
- }
233
-
234
- function cursorRuleContent(version) {
235
- return `---
236
- description: bitboss-ui Vue component library — read AI router before generating Bb* usage
237
- globs: **/*.{vue,ts,tsx,js,jsx}
238
- alwaysApply: false
239
- ---
240
-
241
- # bitboss-ui (v${version})
242
-
243
- ${coreRules(version)}
244
- `;
245
- }
246
-
247
- function windsurfRuleContent(version) {
248
- return `# bitboss-ui (v${version})
249
-
250
- ${coreRules(version)}
251
- `;
252
- }
253
-
254
- function upsertMarkedFile(filePath, fragment, { createHeader } = {}) {
255
- refuseLinkedTarget(filePath);
256
- const existed = existsSync(filePath);
257
-
258
- if (!existed) {
259
- mkdirSync(dirname(filePath), { recursive: true });
260
- const header = createHeader ? `${createHeader}\n\n` : '';
261
- writeFileSync(filePath, `${header}${fragment}\n`, 'utf-8');
262
- return { path: filePath, action: 'created' };
263
- }
264
-
265
- const current = readFileSync(filePath, 'utf-8');
266
- const startIndex = current.indexOf(START_MARKER);
267
- const endIndex = current.indexOf(END_MARKER);
268
-
269
- if (startIndex !== -1 && endIndex !== -1 && endIndex > startIndex) {
270
- const updated =
271
- current.slice(0, startIndex) +
272
- fragment +
273
- current.slice(endIndex + END_MARKER.length);
274
- writeFileSync(filePath, updated, 'utf-8');
275
- return { path: filePath, action: 'updated' };
276
- }
277
-
278
- writeFileSync(filePath, `${current.trimEnd()}\n\n${fragment}\n`, 'utf-8');
279
- return { path: filePath, action: 'appended' };
280
- }
281
-
282
- function writeWholeFile(filePath, content) {
283
- refuseLinkedTarget(filePath);
284
- const existed = existsSync(filePath);
285
- mkdirSync(dirname(filePath), { recursive: true });
286
- writeFileSync(filePath, content, 'utf-8');
287
- return { path: filePath, action: existed ? 'updated' : 'created' };
288
- }
289
-
290
- function tryWrite(label, fn) {
291
- try {
292
- return fn();
293
- } catch (error) {
294
- const message = error instanceof Error ? error.message : String(error);
295
- console.error(`[bitboss-ui] skipped ${label}: ${message}`);
296
- return { path: label, action: 'skipped' };
297
- }
298
- }
299
-
300
- function aiInit({ mcp = true } = {}) {
301
- const projectRoot = process.cwd();
302
- const version = packageVersion();
303
-
304
- if (!existsSync(join(projectRoot, 'package.json'))) {
305
- console.error(
306
- '[bitboss-ui] No package.json found in the current directory — run ai-init from your project root.'
307
- );
308
- process.exit(1);
309
- }
310
-
311
- const results = [
312
- tryWrite('AGENTS.md', () =>
313
- upsertMarkedFile(
314
- join(projectRoot, 'AGENTS.md'),
315
- agentsFragment(version),
316
- {
317
- createHeader: '# Agent Instructions',
318
- }
319
- )
320
- ),
321
- tryWrite('.cursor/rules/bitboss-ui.mdc', () =>
322
- writeWholeFile(
323
- join(projectRoot, '.cursor', 'rules', 'bitboss-ui.mdc'),
324
- cursorRuleContent(version)
325
- )
326
- ),
327
- tryWrite('.github/copilot-instructions.md', () =>
328
- upsertMarkedFile(
329
- join(projectRoot, '.github', 'copilot-instructions.md'),
330
- agentsFragment(version),
331
- { createHeader: '# Copilot instructions' }
332
- )
333
- ),
334
- tryWrite('.claude/skills/bitboss-ui/SKILL.md', () =>
335
- writeWholeFile(
336
- join(projectRoot, '.claude', 'skills', 'bitboss-ui', 'SKILL.md'),
337
- skillContent(version)
338
- )
339
- ),
340
- tryWrite('.windsurf/rules/bitboss-ui.md', () =>
341
- writeWholeFile(
342
- join(projectRoot, '.windsurf', 'rules', 'bitboss-ui.md'),
343
- windsurfRuleContent(version)
344
- )
345
- ),
346
- ];
347
- // Q60.6: unknown-component checking is opt-in in Vue Language Tools 3.
348
- const flag = tryWrite('tsconfig checkUnknownComponents', () =>
349
- ensureCheckUnknownComponents(projectRoot)
350
- );
351
- if (flag)
352
- results.push({
353
- ...flag,
354
- path: flag.reason ? `${flag.path} (${flag.reason})` : flag.path,
355
- });
356
-
357
- if (mcp) {
358
- for (const result of ensureMcpConfigs(projectRoot)) {
359
- const suffix = result.reason ? ` (${result.reason})` : '';
360
- results.push({
361
- path: `${result.path} [${result.label}]${suffix}`,
362
- action: result.action,
363
- });
364
- }
365
-
366
- // The harness launches the server on demand, long after this command
367
- // ran — a missing peer would surface inside an agent as a server that
368
- // never starts. They are optional peers (~12 MB only the server loads),
369
- // so installing the library never adds them; registering the server is
370
- // the moment the project opts in, so install them here.
371
- const missing = missingMcpPeers(projectRoot);
372
- if (missing.length > 0) {
373
- const [cmd, ...args] = devInstallCommand(
374
- detectPackageManager(projectRoot),
375
- missing
376
- );
377
- const printed = [cmd, ...args].join(' ');
378
- console.log(`[bitboss-ui] installing the MCP server's peers: ${printed}`);
379
- const installed = spawnSync(cmd, args, {
380
- cwd: projectRoot,
381
- stdio: 'inherit',
382
- // npm/pnpm/yarn are .cmd shims on Windows, which only a shell runs.
383
- shell: process.platform === 'win32',
384
- });
385
- if (installed.status === 0) {
386
- results.push({ path: missing.join(', '), action: 'installed' });
387
- } else {
388
- console.warn(
389
- `[bitboss-ui] could not install ${missing.join(' and ')} — run it yourself:\n` +
390
- `\n ${printed}\n\n` +
391
- ' The harness entries are written either way; the server starts\n' +
392
- ' once the peers are installed.'
393
- );
394
- }
395
- }
396
- }
397
-
398
- console.log(`[bitboss-ui] ai-init complete (library v${version})`);
399
- for (const result of results) {
400
- console.log(` - ${result.action}: ${result.path}`);
401
- }
402
- console.log(
403
- '\nHarness-agnostic kickstart: AGENTS.md + Cursor / Copilot / Claude / Windsurf pointers.'
404
- );
405
- if (mcp) {
406
- console.log(
407
- 'MCP: registered the bitboss-ui server for Claude Code (.mcp.json), Cursor (.cursor/mcp.json), VS Code/Copilot (.vscode/mcp.json) and Zed (.zed/settings.json) — restart your harness to pick it up; Zed starts it once you trust the project. `--no-mcp` skips this.'
408
- );
409
- } else {
410
- console.log(
411
- 'MCP: skipped (--no-mcp). Re-run without it to let agents query the knowledge base through the bitboss-ui MCP server instead of reading files.'
412
- );
413
- }
414
- // L34: the guide's strict set, suggested only (see STRICT_TEMPLATE_SET).
415
- const strict = strictTemplateSuggestion(projectRoot);
416
- if (strict) console.log(strict);
417
- // Q82.15 (c): Muse skips project rules and skills in an untrusted
418
- // workspace and reads MCP servers from its user settings only.
419
- console.log(
420
- 'Muse: trust the workspace (its prompt, or `--trust-workspace`) so it loads AGENTS.md and the skill; for MCP, add `bitboss-ui` under `mcpServers` in ~/.config/muse/settings.json (or ask Muse to migrate it from .mcp.json).'
421
- );
422
- // Q61.7: Laravel's vue-starter-kit (and others) git-ignore these.
423
- console.log(
424
- "Some starters (Laravel's vue-starter-kit) git-ignore AGENTS.md, CLAUDE.md, .claude, .cursor and .mcp.json: teammates won't see these files until you un-ignore them."
425
- );
426
- console.log('Re-run after upgrading bitboss-ui to refresh the pointers.');
427
- console.log(
428
- 'Tip: `npx bitboss-ui ai-init --update` is the same command (idempotent).'
429
- );
430
-
431
- if (results.some((r) => r.action === 'skipped')) {
432
- process.exitCode = 1;
433
- }
434
- }
435
-
436
- // SNT-007: a bare-segment skip list of `node_modules`/`dist`/`.git` let a
437
- // default (no-glob) `check` sweep straight through a Laravel-style consumer's
438
- // `vendor/`, `storage/`, and `public/` trees — hundreds of vendored
439
- // `README.md`s outnumbering the app's own `.vue`/`.md` files 20:1. These are
440
- // all directories no project authors `Bb*` markup into, so they're safe
441
- // blanket exclusions; framework build caches (`.nuxt`, `.output`) get the
442
- // same treatment.
443
- const CHECK_SKIP_DIRS = new Set([
444
- 'node_modules',
445
- 'dist',
446
- '.git',
447
- 'vendor',
448
- 'storage',
449
- 'public',
450
- '.output',
451
- '.nuxt',
452
- ]);
453
- // Composite (multi-segment) skips: too narrow to earn a bare-segment entry —
454
- // skipping all of `bootstrap/` would also hide a project's own
455
- // `bootstrap/*.md` — but `bootstrap/cache` specifically is Laravel's compiled
456
- // config/routes cache, never hand-authored.
457
- const CHECK_SKIP_SUBPATHS = ['bootstrap/cache'];
458
- const CHECK_EXTENSIONS = ['.vue', '.md'];
459
-
460
- /** True when a path segment (by itself) is a directory `check` never descends into. */
461
- function isSkippedSegment(name) {
462
- return CHECK_SKIP_DIRS.has(name);
463
- }
464
-
465
- /** True when the relative path IS, or falls under, a skipped multi-segment subpath. */
466
- function isSkippedSubpath(relPath) {
467
- const normalized = relPath.split(/[\\/]/).join('/');
468
- return CHECK_SKIP_SUBPATHS.some(
469
- (sub) => normalized === sub || normalized.startsWith(`${sub}/`)
470
- );
471
- }
472
-
473
- /** True when any path segment (or composite subpath) is skipped. */
474
- function inSkippedDir(relPath) {
475
- return (
476
- relPath.split(/[\\/]/).some((segment) => isSkippedSegment(segment)) ||
477
- isSkippedSubpath(relPath)
478
- );
479
- }
480
-
481
- /**
482
- * Every `.vue`/`.md` file under `dir`, excluding the skip list (see
483
- * `CHECK_SKIP_DIRS`/`CHECK_SKIP_SUBPATHS`) at any depth. A hand-rolled
484
- * recursive walk rather than `globSync` because glob's `**` never traverses
485
- * dot-directories (and there is no `dot` option) — the sweep must keep
486
- * matching files like `.github/copilot-instructions.md`. Pruning skipped
487
- * directories BEFORE descending (rather than filtering after a flat
488
- * `recursive: true` readdir) is what keeps a multi-thousand-file `vendor/`
489
- * tree from being walked at all.
490
- */
491
- function collectCheckFiles(
492
- dir,
493
- relBase = dir,
494
- extensions = CHECK_EXTENSIONS,
495
- chain = []
496
- ) {
497
- let entries;
498
- try {
499
- entries = readdirSync(dir, { withFileTypes: true });
500
- } catch {
501
- return [];
502
- }
503
- // The `.gitignore` chain at this level (git semantics, shared with the
504
- // icon scan): build output a project ignores (`.vercel/output`, `.nuxt`,
505
- // `coverage`) is never swept.
506
- const own = gitignoreKit?.readGitignore(dir);
507
- const here = own ? [...chain, { dir, ig: own }] : chain;
508
- const ignored = (full, isDir) =>
509
- !!gitignoreKit && gitignoreKit.isGitignored(here, full, isDir);
510
- const out = [];
511
- for (const entry of entries) {
512
- const full = join(dir, entry.name);
513
- if (entry.isDirectory()) {
514
- if (isSkippedSegment(entry.name)) continue;
515
- if (isSkippedSubpath(relative(relBase, full))) continue;
516
- if (ignored(full, true)) continue;
517
- out.push(...collectCheckFiles(full, relBase, extensions, here));
518
- continue;
519
- }
520
- if (!entry.isFile()) continue;
521
- if (!extensions.some((ext) => entry.name.endsWith(ext))) continue;
522
- if (ignored(full, false)) continue;
523
- out.push(full);
524
- }
525
- return out;
526
- }
527
-
528
- /**
529
- * The icon scan's `.gitignore` reader, loaded once by `check` before its
530
- * sweep. In the library repo it loads from source (`src/icon-scan.ts`, Node
531
- * strips the types): `dist` may be absent (the release runs the node suite
532
- * before the build) or stale. In the package, which ships no `src`, it loads
533
- * from `dist/icon-scan.js`. Failing to load it is an error, never a sweep
534
- * without it: that would report a project's gitignored build output.
535
- * Returns the error, or null once loaded.
536
- */
537
- let gitignoreKit = null;
538
- async function loadGitignoreKit() {
539
- const source = join(PACKAGE_ROOT, 'src', 'icon-scan.ts');
540
- const file = existsSync(source)
541
- ? source
542
- : join(PACKAGE_ROOT, 'dist', 'icon-scan.js');
543
- const where = relative(PACKAGE_ROOT, file);
544
- let kit;
545
- try {
546
- kit = await import(pathToFileURL(file).href);
547
- } catch (error) {
548
- return `cannot load the .gitignore reader from ${where}: ${error.message}`;
549
- }
550
- if (!kit.readGitignore || !kit.isGitignored || !kit.ancestorGitignores)
551
- return `${where} does not export the .gitignore reader`;
552
- gitignoreKit = kit;
553
- return null;
554
- }
555
-
556
- /**
557
- * Resolve the file list for `check`: explicit globs/paths if given, otherwise
558
- * every `.vue`/`.md` file under `cwd` (excluding `CHECK_SKIP_DIRS`/
559
- * `CHECK_SKIP_SUBPATHS` — node_modules, dist, .git, vendor, storage, public,
560
- * .output, .nuxt, bootstrap/cache). Literal paths resolve directly: a literal
561
- * FILE is always included (even one that lives inside a skipped dir — asking
562
- * for it by name is the widen-the-scan escape hatch), a literal DIRECTORY is
563
- * swept recursively and only its descendants are checked against the skip
564
- * list (so `check vendor/some-pkg` still works even though a bare sweep would
565
- * never enter `vendor/` on its own). Glob patterns (`*`, `**`, `?`, `{a,b}`)
566
- * go through `node:fs` globSync, restricted to `.vue`/`.md` outside the
567
- * skipped dirs.
568
- */
569
- function resolveCheckFiles(cwd, patterns) {
570
- if (patterns.length === 0)
571
- return collectCheckFiles(
572
- cwd,
573
- cwd,
574
- CHECK_EXTENSIONS,
575
- gitignoreKit?.ancestorGitignores(cwd) ?? []
576
- ).sort();
577
-
578
- const matched = new Set();
579
- for (const pattern of patterns) {
580
- if (!/[*?{}[\]]/.test(pattern)) {
581
- const abs = isAbsolute(pattern) ? pattern : join(cwd, pattern);
582
- if (existsSync(abs)) {
583
- const stat = statSync(abs);
584
- if (stat.isDirectory()) {
585
- for (const file of collectCheckFiles(abs)) matched.add(file);
586
- } else if (stat.isFile()) {
587
- matched.add(abs);
588
- }
589
- continue;
590
- }
591
- }
592
- if (typeof fs.globSync !== 'function') {
593
- console.error(
594
- `[bitboss-ui] quoted glob patterns need Node >= 22 (this is ${process.version}): "${pattern}". Pass the directory, or leave the pattern unquoted so the shell expands it.`
595
- );
596
- process.exit(1);
597
- }
598
- const dirents = fs.globSync(pattern, {
599
- cwd,
600
- withFileTypes: true,
601
- // Pruning is a traversal shortcut; the inSkippedDir filter below is
602
- // what guarantees skip-dir parity. `entry` is a Dirent when
603
- // withFileTypes is set, but tolerate the string form too.
604
- exclude: (entry) =>
605
- CHECK_SKIP_DIRS.has(
606
- typeof entry === 'string' ? entry.split('/').pop() : entry.name
607
- ),
608
- });
609
- for (const dirent of dirents) {
610
- if (!dirent.isFile()) continue;
611
- if (!CHECK_EXTENSIONS.some((ext) => dirent.name.endsWith(ext))) continue;
612
- const joined = join(dirent.parentPath, dirent.name);
613
- const full = isAbsolute(joined) ? joined : join(cwd, joined);
614
- if (inSkippedDir(relative(cwd, full))) continue;
615
- matched.add(full);
616
- }
617
- }
618
-
619
- return [...matched].sort();
620
- }
621
-
622
- /**
623
- * `check --changed` (Q57.11): the files git reports changed against HEAD
624
- * (staged or not) plus the untracked ones, under `cwd`, minus the sweep's skip
625
- * list. `files` are the .vue/.md ones `check` validates; `all` (any extension)
626
- * feeds the stylesheet and styles-import scans, which read other files too.
627
- * @returns {{ files: string[], all: string[] } | { error: string }}
628
- */
629
- function changedCheckFiles(cwd) {
630
- const git = (args) =>
631
- spawnSync('git', args, {
632
- cwd,
633
- encoding: 'utf-8',
634
- maxBuffer: 64 * 1024 * 1024,
635
- });
636
- const diff = git(['diff', '--name-only', '--relative', '-z', 'HEAD', '--']);
637
- const untracked = git(['ls-files', '--others', '--exclude-standard', '-z']);
638
- const failed = [diff, untracked].find((r) => r.error || r.status !== 0);
639
- if (failed)
640
- return {
641
- error:
642
- 'check --changed: git could not list the changed files here (not a git repository, git missing, or no commit yet): ' +
643
- (failed.error?.message ?? failed.stderr.trim().split('\n')[0]),
644
- };
645
- const all = [
646
- ...new Set(`${diff.stdout}${untracked.stdout}`.split('\0').filter(Boolean)),
647
- ]
648
- .filter((rel) => !inSkippedDir(rel))
649
- .map((rel) => join(cwd, rel))
650
- // A deleted file is a change with nothing left to check.
651
- .filter((path) => existsSync(path) && statSync(path).isFile())
652
- .sort();
653
- return {
654
- files: all.filter((path) =>
655
- CHECK_EXTENSIONS.some((ext) => path.endsWith(ext))
656
- ),
657
- all,
658
- };
659
- }
660
-
661
- /**
662
- * `4 .vue + 8 .md` — a plain file count on its own ("715 file(s)") reads as
663
- * "715 files carefully checked" when SNT-007 showed it can just as easily be
664
- * "701 vendored READMEs + 14 real files"; splitting by extension makes the
665
- * number honest about what was actually covered. `.vue`/`.md` sort first
666
- * (the extensions `check` targets by default); any other extension a literal
667
- * path argument pulled in — see `resolveCheckFiles` — sorts after, A-Z.
668
- */
669
- function summarizeFileCounts(files) {
670
- const counts = new Map();
671
- for (const file of files) {
672
- const base = file.split(/[\\/]/).pop() ?? file;
673
- const dot = base.lastIndexOf('.');
674
- const ext = dot === -1 ? '(no extension)' : base.slice(dot);
675
- counts.set(ext, (counts.get(ext) ?? 0) + 1);
676
- }
677
- const priority = ['.vue', '.md'];
678
- const exts = [...counts.keys()].sort((a, b) => {
679
- const pa = priority.indexOf(a);
680
- const pb = priority.indexOf(b);
681
- if (pa !== -1 || pb !== -1) {
682
- return (
683
- (pa === -1 ? priority.length : pa) - (pb === -1 ? priority.length : pb)
684
- );
685
- }
686
- return a.localeCompare(b);
687
- });
688
- return exts.map((ext) => `${counts.get(ext)} ${ext}`).join(' + ');
689
- }
690
-
691
- /**
692
- * Component names the PROJECT owns despite the `Bb` prefix, read from disk so
693
- * CI, the editor and a local run agree without repeating a flag.
694
- *
695
- * Two sources, merged: `bitboss-ui.check.json`'s `allowComponents`, and
696
- * package.json's `bitboss-ui.allowComponents`. The package.json key is the one
697
- * to reach for — it sits next to the `eslint.config.js` that already carries
698
- * the same list for `no-unknown-attributes`, so the two gates stay in sync.
699
- * Unreadable/malformed files are ignored: a broken config must not turn into a
700
- * check failure about markup.
701
- * @returns {string[]}
702
- */
703
- function configuredAllowComponents(projectRoot) {
704
- const out = [];
705
- const readList = (path, pick) => {
706
- try {
707
- if (!existsSync(path)) return;
708
- const value = pick(JSON.parse(readFileSync(path, 'utf-8')));
709
- if (Array.isArray(value))
710
- for (const name of value) if (typeof name === 'string') out.push(name);
711
- } catch {
712
- /* malformed config — ignore, never fail the check on it */
713
- }
714
- };
715
- readList(
716
- join(projectRoot, 'bitboss-ui.check.json'),
717
- (cfg) => cfg?.allowComponents
718
- );
719
- readList(
720
- join(projectRoot, 'package.json'),
721
- (pkg) => pkg?.['bitboss-ui']?.allowComponents
722
- );
723
- return out;
724
- }
725
-
726
- /**
727
- * CHK-SINCE-V2 — the two unknown-prop message shapes mean OPPOSITE things and
728
- * nothing in the output said so. One migrating fleet filed two non-findings
729
- * against the library, and the other told the categories apart only by
730
- * installing v2 alongside and diffing by hand. Printed once per failing run,
731
- * and only for the kinds actually present.
732
- *
733
- * `check` is honest about its limits here: it validates against the INSTALLED
734
- * v3 manifest and holds no record of v2, so "is not in X's API" is a statement
735
- * about v3 alone. Deciding whether such a prop ever worked is the reader's job,
736
- * and the greps in the migration guide are how it is done.
737
- */
738
- function printFindingLegend(findings) {
739
- const kinds = new Set(findings.map((f) => f.kind));
740
- const rows = [];
741
- if (kinds.has('removed-prop'))
742
- rows.push(
743
- ' "was removed from X" a recorded break (v2→v3, or a v3 beta rename). X really\n' +
744
- ' / "was renamed on X" had this prop or pt key; `check --fix` rewrites the renames.'
745
- );
746
- if (kinds.has('renamed-slot'))
747
- rows.push(
748
- ' "slot … was renamed" a recorded slot rename; `check --fix` rewrites it.'
749
- );
750
- if (kinds.has('unknown-prop'))
751
- rows.push(
752
- ' "is not in X\'s API" X does not declare this prop in v3 — and `check` cannot\n' +
753
- ' say whether it ever did. It may be a v3 removal that\n' +
754
- ' predates the removal register, or a name that was never\n' +
755
- ' a prop at all and has always fallen through to the DOM\n' +
756
- ' as an inert attribute. Check the v2 source before\n' +
757
- ' "restoring" anything: the second case needs deleting,\n' +
758
- ' not porting.'
759
- );
760
- // A type written as a tag is its own category: the name IS ours, so neither
761
- // "check the spelling" nor the allowlist applies, and a reader who skims the
762
- // message alone would reach for one of them.
763
- if (
764
- findings.some((f) => / is a type export, not a component$/.test(f.message))
765
- )
766
- rows.push(
767
- ' "is a type export" a real export, but a TYPE — it types a prop, it does not\n' +
768
- ' render. Import it (`import type { … }`) and pass the\n' +
769
- ' value; never allowlist it, which would only silence\n' +
770
- ' every other check on that tag.'
771
- );
772
- if (findings.some((f) => f.fallthrough))
773
- rows.push(
774
- ' ⚠ (vs ✗) markup that is not a typo and may work today: an\n' +
775
- ' undeclared listener Vue binds to the root ELEMENT,\n' +
776
- ' so whether it fires depends on what that root is —\n' +
777
- " an internal detail, on the component's schedule or\n" +
778
- " the element's. `<BbDialog @close>` runs (that root is\n" +
779
- ' a native <dialog>); `<BbAlert @close>` does not.\n' +
780
- ' Still reported, because neither is the contract. In\n' +
781
- ' ESLint this is `no-unknown-event`, a warning.'
782
- );
783
- if (rows.length === 0) return;
784
- console.error('\nReading these findings:');
785
- for (const row of rows) console.error(row);
786
- console.error(
787
- ' `check` reads the installed v3 manifest only; the package carries no v2 API.'
788
- );
789
- }
790
-
791
- /**
792
- * `npx bitboss-ui check [glob…] [--json]` — validate `Bb*` markup (props,
793
- * v-models, and `<template #slot>` names) in `.vue` and `.md` files against
794
- * the installed components.json manifest.
795
- */
796
- /**
797
- * The version a components.json describes. `loadManifest` returns the indexed
798
- * component map, not the envelope, so read the field straight off the file.
799
- */
800
- /**
801
- * `changelog [--since <v>] [--until <v>] [--json]` — what breaks between two
802
- * releases, then what they added (Q74.4: one line per feature), for anyone not driving the MCP server (a human at a terminal, CI,
803
- * or an agent whose harness has no MCP). Same data and same range rules as the
804
- * `list_changes` tool; this is the transport-free path to it.
805
- */
806
- function changelogCommand({ since, until, json: jsonMode }) {
807
- const path = join(PACKAGE_ROOT, 'dist', 'ai', 'changelog.json');
808
- if (!existsSync(path)) {
809
- console.error(
810
- `[bitboss-ui] changelog: not found at ${path} — reinstall bitboss-ui (or run \`npm run build\` when working in the library repo).`
811
- );
812
- process.exit(1);
813
- }
814
- const doc = JSON.parse(readFileSync(path, 'utf-8'));
815
- const releases = doc.releases ?? [];
816
-
817
- for (const [label, value] of [
818
- ['--since', since],
819
- ['--until', until],
820
- ]) {
821
- if (value != null && !releases.includes(value)) {
822
- // A tagged-but-never-published version (beta.34): say where its
823
- // changes went instead of "unknown", which reads like a typo.
824
- const unpublished = (doc.unpublished ?? []).includes(value);
825
- const next = releases.find((r) => compareReleaseVersions(r, value) > 0);
826
- console.error(
827
- (unpublished
828
- ? `[bitboss-ui] changelog: ${label} ${value} was never published to npm; its changes shipped in ${next ?? 'the next release'}.\n`
829
- : `[bitboss-ui] changelog: unknown ${label} version '${value}'.\n`) +
830
- `Known releases: ${releases.join(', ')}`
831
- );
832
- process.exit(1);
833
- }
834
- }
835
-
836
- const ranged = since != null || until != null;
837
- const rows = (doc.breaking ?? []).filter((entry) => {
838
- if (!ranged) return true;
839
- const at = entry.firstReleasedIn;
840
- if (at == null) return until == null;
841
- if (since != null && compareReleaseVersions(at, since) <= 0) return false;
842
- if (until != null && compareReleaseVersions(at, until) > 0) return false;
843
- return true;
844
- });
845
- // Q74.4: what the range ADDED (feat commits, one line each), oldest first.
846
- const inRange = (at) => {
847
- if (!ranged) return true;
848
- if (at === 'unreleased') return until == null;
849
- if (since != null && compareReleaseVersions(at, since) <= 0) return false;
850
- if (until != null && compareReleaseVersions(at, until) > 0) return false;
851
- return true;
852
- };
853
- const added = Object.entries(doc.added ?? {})
854
- .filter(([at]) => inRange(at))
855
- .flatMap(([at, entries]) =>
856
- entries.map((entry) => ({
857
- at,
858
- line: typeof entry === 'string' ? entry : entry.text,
859
- }))
860
- );
861
-
862
- if (jsonMode) {
863
- console.log(
864
- JSON.stringify(
865
- {
866
- version: doc.version,
867
- since: since ?? null,
868
- until: until ?? doc.version,
869
- count: rows.length,
870
- breaking: rows,
871
- added: added.map(({ at, line }) => `[${at}] ${line}`),
872
- guide: doc.guide,
873
- },
874
- null,
875
- 2
876
- )
877
- );
878
- return;
879
- }
880
-
881
- const range = ranged
882
- ? `${since ?? 'the start of v3'} → ${until ?? doc.version}`
883
- : `the whole v2 → v3 upgrade`;
884
- const printAdded = () => {
885
- if (!added.length) return;
886
- // Compact by default: the whole v3 line is hundreds of lines.
887
- if (!ranged) {
888
- console.log(
889
- `\n${added.length} addition(s) over ${range}: list one hop with --since <your version>.`
890
- );
891
- return;
892
- }
893
- console.log(`\n${added.length} addition(s), ${range}:\n`);
894
- for (const { at, line } of added) console.log(` [${at}] ${line}`);
895
- };
896
- if (rows.length === 0) {
897
- // "Nothing breaks" and "I could not tell you" must not look alike.
898
- console.log(
899
- `[bitboss-ui] changelog: no BREAKING changes in ${range}.\n` +
900
- ' Fixes are not tracked here, so this means nothing\n' +
901
- ' breaks — not that nothing changed.'
902
- );
903
- printAdded();
904
- return;
905
- }
906
- console.log(
907
- `[bitboss-ui] changelog: ${rows.length} breaking change(s), ${range}\n`
908
- );
909
- for (const entry of rows) {
910
- const at = entry.firstReleasedIn ?? 'unreleased';
911
- if (entry.kind === 'rename') {
912
- // `surface` says what kind of name it is (Q51.19); a slot reads `#…`.
913
- const spell = (name) => (entry.surface === 'slot' ? `#${name}` : name);
914
- const surface =
915
- entry.surface && entry.surface !== 'prop' ? `${entry.surface} ` : '';
916
- console.log(
917
- ` [${at}] ${entry.components.join(', ')}: ${surface}\`${spell(entry.from)}\` → ` +
918
- (entry.to == null ? 'removed' : `\`${spell(entry.to)}\``) +
919
- (entry.note ? ` (${entry.note})` : '')
920
- );
921
- } else {
922
- console.log(` [${at}] ${entry.description}`);
923
- }
924
- if (entry.guide) console.log(` ${entry.guide}`);
925
- }
926
- printAdded();
927
- console.log(`\nFull migration guide: ${doc.guide}`);
928
- }
929
-
930
- /** Numeric, prerelease-aware ordering; the twin of the MCP server's copy. */
931
- function compareReleaseVersions(a, b) {
932
- const parse = (v) => {
933
- const [core, pre = ''] = String(v).split('-');
934
- const nums = core.split('.').map((n) => Number.parseInt(n, 10) || 0);
935
- const [tag = '', n = ''] = pre.split('.');
936
- return { nums, tag, n: Number.parseInt(n, 10) || 0 };
937
- };
938
- const x = parse(a);
939
- const y = parse(b);
940
- for (let i = 0; i < 3; i += 1) {
941
- if ((x.nums[i] ?? 0) !== (y.nums[i] ?? 0))
942
- return (x.nums[i] ?? 0) - (y.nums[i] ?? 0);
943
- }
944
- if (!x.tag && y.tag) return 1;
945
- if (x.tag && !y.tag) return -1;
946
- if (x.tag !== y.tag) return x.tag < y.tag ? -1 : 1;
947
- return x.n - y.n;
948
- }
949
-
950
- function manifestVersionOf(manifestPath) {
951
- try {
952
- return JSON.parse(readFileSync(manifestPath, 'utf-8')).version ?? 'unknown';
953
- } catch {
954
- return 'unknown';
955
- }
956
- }
957
-
958
- async function checkCommand(
959
- globs,
960
- {
961
- json: jsonMode,
962
- allowEmpty,
963
- allowComponents,
964
- manifest: manifestOverride,
965
- fix,
966
- changed: changedOnly,
967
- idioms: wantIdioms,
968
- }
969
- ) {
970
- const projectRoot = process.cwd();
971
- const kitError = await loadGitignoreKit();
972
- if (kitError) {
973
- console.error(`[bitboss-ui] check: ${kitError}`);
974
- process.exit(1);
975
- }
976
- if (changedOnly && globs.length) {
977
- console.error('[bitboss-ui] check: pass paths or `--changed`, not both.');
978
- process.exit(1);
979
- }
980
- const changed = changedOnly ? changedCheckFiles(projectRoot) : null;
981
- if (changed && 'error' in changed) {
982
- console.error(`[bitboss-ui] ${changed.error}`);
983
- process.exit(1);
984
- }
985
-
986
- /*
987
- * `--manifest` answers the question `check` could not: "which of my files
988
- * break in the version I am about to move to?" (reported 2026-09-09). By
989
- * default the manifest is the INSTALLED one, so the only way to see an
990
- * upgrade's damage was to perform the upgrade first — exactly backwards for
991
- * the one moment the answer is worth having.
992
- *
993
- * Deliberately a PATH, not a version: fetching a version would put a network
994
- * call inside a validator that consumers run in CI, with a registry outage
995
- * as a new failure mode. Getting the file is one documented command
996
- * (`npm pack bitboss-ui@<version>`, or the public CDN copy), and pointing at
997
- * it keeps this offline and reproducible.
998
- */
999
- const installedManifest = join(PACKAGE_ROOT, 'dist', 'ai', 'components.json');
1000
- const manifestPath = manifestOverride
1001
- ? resolve(projectRoot, manifestOverride)
1002
- : installedManifest;
1003
- if (!existsSync(manifestPath)) {
1004
- console.error(
1005
- manifestOverride
1006
- ? `[bitboss-ui] --manifest: no file at ${manifestPath}.\n` +
1007
- 'Point it at a components.json from the version you are moving to:\n' +
1008
- ' npm pack bitboss-ui@<version> && tar -xzf bitboss-ui-<version>.tgz\n' +
1009
- ' npx bitboss-ui check --manifest package/dist/ai/components.json'
1010
- : `[bitboss-ui] Manifest not found at ${manifestPath} — reinstall bitboss-ui (or run \`npm run build\` when working in the library repo).`
1011
- );
1012
- process.exit(1);
1013
- }
1014
- const manifest = loadManifest(manifestPath);
1015
-
1016
- /*
1017
- * Q53.23: write the project's `bitboss-ui.d.ts` from the build config, the
1018
- * file the Vite plugin writes when Vite starts. Agents run `vue-tsc` before
1019
- * any dev start, so a name registered in `badgeVariants` was a type error
1020
- * (and an `as any`) until then. Same generator as the plugin; a config it
1021
- * cannot read is left alone. Not under `--manifest` (an upgrade preview
1022
- * must not touch the project).
1023
- */
1024
- if (!manifestOverride) {
1025
- try {
1026
- const projectDts = await import(
1027
- pathToFileURL(join(PACKAGE_ROOT, 'dist', 'project-dts.js')).href
1028
- );
1029
- const synced = syncProjectVariantDts(projectRoot, projectDts);
1030
- const notice = syncNotice(synced);
1031
- // Q65.2: a skip is said too (stderr under `--json`, like `--fix`'s lines).
1032
- if (notice && !(jsonMode && synced.status === 'written'))
1033
- (jsonMode ? console.error : console.log)(notice);
1034
- } catch {
1035
- // No built `dist/project-dts.js` (the library repo before a build):
1036
- // nothing to write with, and nothing for `check` to fail over.
1037
- }
1038
- }
1039
-
1040
- /*
1041
- * Every `--bb-*` the INSTALLED package declares, read from the stylesheet
1042
- * the consumer actually ships. Read from disk rather than hardcoded so this
1043
- * can never claim a token is invented when their version does declare it.
1044
- * Absent stylesheet → an empty set → the unknown-token hint stays silent,
1045
- * which is the right failure: no data, no accusation.
1046
- */
1047
- // Under `--manifest`, take the sheet from beside THAT manifest
1048
- // (`<pkg>/dist/ai/components.json` → `<pkg>/dist/styles.css`). Reading the
1049
- // installed sheet while judging props against another version would mix two
1050
- // releases in one verdict — the exact confusion this flag exists to end.
1051
- const stylesPath = manifestOverride
1052
- ? join(dirname(dirname(manifestPath)), 'styles.css')
1053
- : join(PACKAGE_ROOT, 'dist', 'styles.css');
1054
- const knownTokens = loadKnownTokens(stylesPath);
1055
- const files = changed ? changed.files : resolveCheckFiles(projectRoot, globs);
1056
-
1057
- // CHK-ALLOWCOMPONENTS: `Bb` is a naming convention, not proof of ownership.
1058
- // An app component called `BbRichEditor` is not invalid library markup, and
1059
- // before this the only way to silence it was to rename the component.
1060
- const explicitlyAllowed = new Set([
1061
- ...configuredAllowComponents(projectRoot),
1062
- ...allowComponents,
1063
- ]);
1064
- // Q53.18: the app's own `Bb*` components (`.vue` files in its `components`
1065
- // dirs, Nuxt path-prefix names included) are skipped with zero config;
1066
- // imports from the app's own paths are handled per file by the validator.
1067
- const projectLocal = projectLocalBbComponents(projectRoot);
1068
- const allowedComponents = [...explicitlyAllowed, ...projectLocal.keys()];
1069
-
1070
- // Q46.8: `--fix` applies the ESLint plugin's fixes (the registered v2→v3
1071
- // migrations) with ONLY the bitboss rules, then the check below reports
1072
- // what is left, so one command migrates and verifies.
1073
- if (fix) {
1074
- const outcome = await applyBitbossFixes({
1075
- projectRoot,
1076
- files,
1077
- manifestPath: manifestOverride ? manifestPath : undefined,
1078
- allowComponents: allowedComponents,
1079
- });
1080
- if ('error' in outcome) {
1081
- console.error(`[bitboss-ui] ${outcome.error}`);
1082
- process.exit(1);
1083
- }
1084
- const log = jsonMode ? console.error : console.log;
1085
- log(
1086
- outcome.fixed.length
1087
- ? `[bitboss-ui] check --fix: fixed ${outcome.fixed.length} file(s):\n${outcome.fixed
1088
- .map((file) => ` ${relative(projectRoot, file)}`)
1089
- .join('\n')}`
1090
- : '[bitboss-ui] check --fix: nothing to fix.'
1091
- );
1092
- if (outcome.skipped?.length)
1093
- log(
1094
- `[bitboss-ui] check --fix: ESLint ignored ${outcome.skipped.length} file(s), not fixed:\n${outcome.skipped
1095
- .map((file) => ` ${relative(projectRoot, file)}`)
1096
- .join('\n')}`
1097
- );
1098
- }
1099
- // Q46.6: every `var(--x)` the project reads, from a whole-project sweep
1100
- // (explicit paths included): a local or token the app reads itself is its
1101
- // own, never "set and unread".
1102
- // Q57.11: one walk and one read per file serve every project-wide sweep
1103
- // below (reads, registered rules, the style scan) and the per-file loop.
1104
- const projectSources = collectCheckFiles(
1105
- projectRoot,
1106
- projectRoot,
1107
- HAND_IMPORTED_STYLES_EXTENSIONS,
1108
- gitignoreKit?.ancestorGitignores(projectRoot) ?? []
1109
- );
1110
- const texts = new Map();
1111
- const readText = (path) => {
1112
- if (!texts.has(path)) texts.set(path, readFileSync(path, 'utf-8'));
1113
- return texts.get(path);
1114
- };
1115
- const projectReads = new Set();
1116
- for (const path of projectSources)
1117
- try {
1118
- for (const name of localReads(readText(path))) projectReads.add(name);
1119
- } catch {
1120
- /* unreadable: its reads are unknown, which only means fewer passes */
1121
- }
1122
- // The tokens of the sheet `check` judges against (the installed one, or
1123
- // the one beside `--manifest`) — read AND declared names both count.
1124
- if (manifest.localSurface && existsSync(stylesPath))
1125
- manifest.localSurface.knownTokens = libraryTokens([
1126
- readFileSync(stylesPath, 'utf-8'),
1127
- ...[join(dirname(stylesPath), 'reset.css')]
1128
- .filter((path) => existsSync(path))
1129
- .map((path) => readFileSync(path, 'utf-8')),
1130
- ]);
1131
- // Q54.2: the rules the project registers with `defineRule`, from the same
1132
- // whole-project sweep, so a string rule nobody registered is caught. Q67.1:
1133
- // a call the sweep cannot read is kept by its place, never a silence.
1134
- const registeredRules = {
1135
- names: new Set(configuredRegisteredRules(projectRoot)),
1136
- unreadable: [],
1137
- stock: packageRuleNames(projectRoot),
1138
- };
1139
- const packageRules = registeredRules.stock;
1140
- const ownedRuleSource = ownedBy(projectRoot);
1141
- const presets = new Map();
1142
- const RULE_EXTENSIONS = ['.ts', '.js', '.mjs', '.cjs', '.vue'];
1143
- for (const path of projectSources.filter((file) =>
1144
- RULE_EXTENSIONS.some((ext) => file.endsWith(ext))
1145
- ))
1146
- try {
1147
- const text = readText(path);
1148
- // Q57.3: the project's `definePreset` wrappers, by name.
1149
- for (const [name, preset] of presetDefinitions(text))
1150
- presets.set(name, preset);
1151
- // A nested app (its own package.json) registers nothing for this one.
1152
- if (ownedRuleSource(path))
1153
- addRegistrations(
1154
- registeredRules,
1155
- text,
1156
- relative(projectRoot, path),
1157
- packageRules
1158
- );
1159
- } catch {
1160
- /* unreadable: its registrations are unknown, said where they would be */
1161
- if (ownedRuleSource(path))
1162
- registeredRules.unreadable.push(relative(projectRoot, path));
1163
- }
1164
- const validateOptions = {
1165
- allowComponents: allowedComponents,
1166
- projectReads,
1167
- registeredRules,
1168
- presets,
1169
- // A variant the build plugin registers is the project's own name.
1170
- registeredVariants: readRegisteredVariants(
1171
- projectRoot,
1172
- REGISTERED_VARIANT_OPTIONS
1173
- ),
1174
- optionsApiOff: readOptionsApiOff(projectRoot),
1175
- };
1176
-
1177
- const findings = [];
1178
- let suppressed = 0;
1179
- /** One warning per local `Bb*` component, unless allowlisted (Q53.18). */
1180
- const warnedLocal = new Set();
1181
- const warnLocal = (name, file, line) => {
1182
- if (explicitlyAllowed.has(name) || warnedLocal.has(name)) return;
1183
- warnedLocal.add(name);
1184
- warnings.push(localBbWarning(name, file, line));
1185
- };
1186
- /*
1187
- * Advisory only — see scripts/lib/hand-roll-hints.mjs. Hints never touch the
1188
- * exit code, so a guess can never fail a consumer's build. `--no-hints`
1189
- * silences them for anyone who finds them noisy.
1190
- */
1191
- const hints = [];
1192
- /** Findings graded `severity: 'warning'` — printed, never fatal. */
1193
- const warnings = [];
1194
- const wantHints = !process.argv.includes('--no-hints');
1195
- for (const file of files) {
1196
- const relPath = relative(projectRoot, file);
1197
- const content = readText(file);
1198
- const { findings: fileFindings } = file.endsWith('.md')
1199
- ? validateMarkdown(content, manifest, validateOptions)
1200
- : validateVueSnippet(content, manifest, {
1201
- ...validateOptions,
1202
- // The app's null-value policy, from the project bitboss-ui.d.ts.
1203
- stringControls: stringControlsFor(file),
1204
- // Q61.19: what the project registers globally.
1205
- unimported: { project: projectResolution(projectRoot) },
1206
- });
1207
- // Q46.9: a finding the author silenced for ESLint (`eslint-disable*`,
1208
- // usually with a reason) is silenced here too, or `check` cannot gate
1209
- // CI next to a lint step that passes. `.md` lines are fence-relative,
1210
- // and docs carry no directives, so only `.vue` files are filtered.
1211
- const isDisabled = file.endsWith('.vue')
1212
- ? disabledChecker(content)
1213
- : () => false;
1214
- if (file.endsWith('.vue'))
1215
- for (const [name, line] of localBbImports(content))
1216
- warnLocal(name, relPath, line);
1217
- for (const finding of fileFindings) {
1218
- if (isDisabled(finding.line, ruleForFinding(finding))) {
1219
- suppressed++;
1220
- continue;
1221
- }
1222
- // A `severity: 'warning'` finding (Q53.15 C9b: a slot spelled the
1223
- // pre-reset way) is shown and suppressible, but never fails the run.
1224
- if (finding.severity === 'warning')
1225
- warnings.push({ file: relPath, ...finding });
1226
- else findings.push({ file: relPath, ...finding });
1227
- }
1228
- // .md files are documentation ABOUT components; a round <img> in a doc
1229
- // example is illustrative, not a hand-roll.
1230
- if (wantHints && !file.endsWith('.md')) {
1231
- for (const hint of findHandRollHints(content, knownTokens)) {
1232
- hints.push({ file: relPath, ...hint });
1233
- }
1234
- }
1235
- }
1236
-
1237
- // Q82.20 (b): a variant the build plugin registers that nothing paints
1238
- // renders as the base plate (a solid primary badge). Read across the whole
1239
- // project whatever the file scope: the paint can live in any stylesheet.
1240
- {
1241
- const config = readPluginConfig(projectRoot)?.config ?? 'vite.config';
1242
- const sources = projectSources.flatMap((path) => {
1243
- try {
1244
- return [readText(path)];
1245
- } catch {
1246
- return [];
1247
- }
1248
- });
1249
- for (const { option, name, className } of unstyledVariants(
1250
- validateOptions.registeredVariants,
1251
- sources
1252
- ))
1253
- warnings.push({
1254
- file: config,
1255
- message: `\`${variantOptionLabel(option)}\` registers "${name}", but no project file paints \`.${className}\` (or a \`pt\` state for it): it renders as the default variant. Style it in a stylesheet loaded after bitboss-ui/styles.css (design-language guide § Getting soft semantic badges).`,
1256
- });
1257
- }
1258
-
1259
- // Q63.8: portal names, judged against the whole project's declarations
1260
- // and call sites (scripts too: `confirm({ portal })` lives there). A full
1261
- // run reads every source file; explicit paths / `--changed`, only those.
1262
- // Markdown fences are never read: a doc names portals it never declares.
1263
- {
1264
- const portalIndex = projectPortalIndex(projectRoot);
1265
- const PORTAL_SOURCE = /\.(?:vue|[cm]?[jt]sx?)$/;
1266
- const TEST_FILE = /\.(?:test|spec)(?:-d)?\.[cm]?[jt]sx?$/;
1267
- const portalScope = (
1268
- changed ? changed.all : globs.length ? files : projectSources
1269
- ).filter(
1270
- (path) =>
1271
- PORTAL_SOURCE.test(path) &&
1272
- !path.endsWith('.d.ts') &&
1273
- !TEST_FILE.test(path)
1274
- );
1275
- for (const path of portalScope) {
1276
- let content;
1277
- try {
1278
- content = readText(path);
1279
- } catch {
1280
- continue;
1281
- }
1282
- if (!MAY_HAVE_PORTALS.test(content)) continue;
1283
- const isDisabled = disabledChecker(content);
1284
- for (const finding of portalFindings(content, path, portalIndex)) {
1285
- if (isDisabled(finding.line, ruleForFinding(finding))) {
1286
- suppressed++;
1287
- continue;
1288
- }
1289
- const entry = { file: relative(projectRoot, path), ...finding };
1290
- if (finding.severity === 'warning') warnings.push(entry);
1291
- else findings.push(entry);
1292
- }
1293
- }
1294
- }
1295
-
1296
- // Q76.0: `--idioms`, the adoption checklist's patterns. Opt-in and
1297
- // report-only (scripts/lib/idiom-scan.mjs): never a finding, never the exit
1298
- // code. Same file scope as the portal names: scripts hold confirms and
1299
- // mobile checks too.
1300
- const idioms = [];
1301
- if (wantIdioms) {
1302
- const rows = loadAdoptionRows();
1303
- const exts = new Set(rows.flatMap((row) => row.ext));
1304
- const TEST_FILE = /\.(?:test|spec)(?:-d)?\.[cm]?[jt]sx?$/;
1305
- const scope = changed ? changed.all : globs.length ? files : projectSources;
1306
- // Q82.4: the repeats count across files, so they are judged at the end.
1307
- const repeats = [];
1308
- for (const path of scope) {
1309
- const ext = path.slice(path.lastIndexOf('.') + 1);
1310
- if (!exts.has(ext) || path.endsWith('.d.ts') || TEST_FILE.test(path))
1311
- continue;
1312
- let content;
1313
- try {
1314
- content = readText(path);
1315
- } catch {
1316
- continue;
1317
- }
1318
- const file = relative(projectRoot, path);
1319
- for (const hit of scanIdioms(content, ext, rows))
1320
- idioms.push({ file, ...hit });
1321
- for (const occurrence of repeatOccurrences(content, ext))
1322
- repeats.push({ file, ...occurrence });
1323
- }
1324
- idioms.push(...repeatedIdioms(repeats));
1325
- }
1326
-
1327
- for (const [name, file] of projectLocal) warnLocal(name, file);
1328
- // Q60.6: a `vue-tsc` below 3, read from package.json. One line, never
1329
- // fatal. (A missing `checkUnknownComponents` is no longer warned about:
1330
- // `unimported-component` covers it, Q61.19.)
1331
- warnings.push(...toolchainWarnings(projectRoot));
1332
-
1333
- // Q25: a hand import of `bitboss-ui/styles.css` while the runtime plugin
1334
- // injects it. Project-level — the answer needs the build config — so it
1335
- // reads the style and script files too; with explicit paths, only those.
1336
- // `--changed`: every changed file, stylesheets and scripts included.
1337
- const styleScan = changed
1338
- ? changed.all
1339
- : globs.length
1340
- ? files
1341
- : projectSources;
1342
- findings.push(
1343
- ...handImportedStylesFindings(
1344
- projectRoot,
1345
- styleScan.map((path) => ({ path, relPath: relative(projectRoot, path) })),
1346
- readText
1347
- )
1348
- );
1349
- // A locale the library does not ship, in the build config and in
1350
- // `setConfig({ locale })` (owner 2026-10-07: `en-UK` → `en-GB`).
1351
- findings.push(
1352
- ...unknownLocaleFindings(
1353
- projectRoot,
1354
- styleScan.map((path) => ({ path, relPath: relative(projectRoot, path) })),
1355
- manifest,
1356
- readText
1357
- )
1358
- );
1359
- // Q67.9: a project copy of the definePreset recipe older than the one
1360
- // shipped beside the manifest judged against (`<dist>/ai/helpers/`), or
1361
- // unstamped. Reads the stamp only: an edited copy is the app's own.
1362
- findings.push(
1363
- ...staleDefinePresetFindings(
1364
- styleScan.map((path) => ({ path, relPath: relative(projectRoot, path) })),
1365
- readText,
1366
- readShippedDefinePreset(dirname(manifestPath))
1367
- )
1368
- );
1369
- // Q46.5: `.bb-*` selectors in the app's stylesheets (the `.vue` `<style>`
1370
- // blocks are read by the validator above).
1371
- for (const path of styleScan) {
1372
- if (!/\.(?:css|scss|sass|less|pcss|postcss|styl)$/.test(path)) continue;
1373
- const relPath = relative(projectRoot, path);
1374
- const content = readText(path);
1375
- for (const finding of [
1376
- ...cssClassFindings(content, manifest.cssSurface, {
1377
- stylesheet: true,
1378
- ownedBlocks: ownedClassBlocks(allowedComponents, manifest.cssSurface),
1379
- }),
1380
- // Q46.6: custom properties set where nothing reads them.
1381
- ...cssLocalFindings(content, manifest.cssSurface, manifest.localSurface, {
1382
- stylesheet: true,
1383
- projectReads,
1384
- }),
1385
- ])
1386
- findings.push({ file: relPath, ...finding });
1387
- }
1388
-
1389
- /** One line, so a silenced finding is never invisible. */
1390
- const printSuppressed = () => {
1391
- if (suppressed === 0) return;
1392
- console.log(
1393
- `[bitboss-ui] ${suppressed} finding(s) silenced by eslint-disable comments.`
1394
- );
1395
- };
1396
-
1397
- /** Warning block, printed on success and on failure alike. Never fatal. */
1398
- const printWarnings = () => {
1399
- if (warnings.length === 0) return;
1400
- console.log(
1401
- `\n[bitboss-ui] ${warnings.length} warning(s) — not fatal, but likely wrong:`
1402
- );
1403
- for (const warning of warnings) {
1404
- const at = warning.line != null ? `:${warning.line}` : '';
1405
- console.log(` ⚠ ${warning.file}${at} ${warning.message}`);
1406
- }
1407
- };
1408
-
1409
- /** Advisory block, printed on success and on failure alike. Never fatal. */
1410
- const printHints = () => {
1411
- if (hints.length === 0) return;
1412
- console.log(
1413
- `\n[bitboss-ui] ${hints.length} hint(s) — advisory, not errors:`
1414
- );
1415
- for (const hint of hints) {
1416
- console.log(` ${hint.file}:${hint.line}`);
1417
- console.log(` → ${hint.message}`);
1418
- }
1419
- console.log(
1420
- ' Deliberate? Ignore these, record them in a HANDROLLED note, or pass --no-hints.'
1421
- );
1422
- };
1423
-
1424
- /** The adoption checklist's report (`--idioms`). Never fatal. */
1425
- const printIdioms = () => {
1426
- if (!wantIdioms) return;
1427
- if (idioms.length === 0) {
1428
- console.log(
1429
- '\n[bitboss-ui] idioms: no hand-rolled pattern from the adoption checklist found.'
1430
- );
1431
- return;
1432
- }
1433
- console.log(
1434
- `\n[bitboss-ui] ${idioms.length} idiom(s) — hand-rolled patterns the library ships, report-only:`
1435
- );
1436
- for (const idiom of idioms)
1437
- console.log(` ${idiom.file}:${idiom.line} [${idiom.id}] → ${idiom.use}`);
1438
- console.log(
1439
- ' Rows, replacements and the scope rule: node_modules/bitboss-ui/dist/ai/guides/migration/adoption-checklist.md.\n' +
1440
- ' Kept on purpose? Say why in one line of a HANDROLLED note.'
1441
- );
1442
- };
1443
-
1444
- /*
1445
- * Which API the verdict is against. Silent when it is the installed one —
1446
- * that is the assumption, and a banner on every run trains people to skip
1447
- * it. Loud under `--manifest`, because "12 findings" means something
1448
- * completely different when it describes a version you have not installed
1449
- * yet, and a scrollback with no marker is indistinguishable from a normal
1450
- * run.
1451
- */
1452
- const judgedAgainst = manifestOverride
1453
- ? manifestVersionOf(manifestPath)
1454
- : packageVersion();
1455
- if (changed && !jsonMode) {
1456
- console.log(
1457
- `[bitboss-ui] check --changed: ${files.length} .vue/.md file(s) changed vs HEAD (untracked included).\n` +
1458
- ' Unchanged files are not validated, and the styles-import scan reads only the\n' +
1459
- ' changed files; the project-wide context (var() reads, defineRule names, local\n' +
1460
- ' Bb* components) still comes from the whole project. Run a full `check` before merging.'
1461
- );
1462
- }
1463
- if (manifestOverride && !jsonMode) {
1464
- console.log(
1465
- `[bitboss-ui] check: judging against bitboss-ui ${judgedAgainst} (--manifest), NOT the installed ${packageVersion()}.\n` +
1466
- ' Findings describe the version you are moving TO.'
1467
- );
1468
- }
1469
-
1470
- if (jsonMode) {
1471
- console.log(
1472
- JSON.stringify(
1473
- {
1474
- findings,
1475
- warnings,
1476
- hints,
1477
- ...(wantIdioms ? { idioms } : {}),
1478
- suppressed,
1479
- files: files.length,
1480
- ...(changed ? { changed: true } : {}),
1481
- manifestVersion: judgedAgainst,
1482
- installedVersion: packageVersion(),
1483
- },
1484
- null,
1485
- 2
1486
- )
1487
- );
1488
- if (findings.length > 0) process.exit(1);
1489
- if (files.length === 0 && globs.length > 0 && !allowEmpty) process.exit(1);
1490
- return;
1491
- }
1492
-
1493
- if (files.length === 0) {
1494
- // An EXPLICIT pattern that matched nothing is almost always a typo'd or
1495
- // stale CI path, and answering it with exit 0 means the step goes green
1496
- // having validated nothing — the check that was meant to catch bad
1497
- // markup is itself the thing that broke, silently (SWP-016). A bare
1498
- // sweep finding nothing is a different, legitimate case (a package with
1499
- // no .vue files yet), so it still passes.
1500
- if (changed) {
1501
- console.log(
1502
- '[bitboss-ui] check --changed: no changed .vue/.md files — nothing to validate.'
1503
- );
1504
- return;
1505
- }
1506
- if (globs.length > 0 && !allowEmpty) {
1507
- console.error(
1508
- `[bitboss-ui] check: no .vue/.md files matched ${globs.map((g) => `\`${g}\``).join(', ')} — nothing was validated. ` +
1509
- 'Fix the path, or pass `--allow-empty` if an empty match is expected.'
1510
- );
1511
- process.exit(1);
1512
- }
1513
- console.log(
1514
- '[bitboss-ui] check: no .vue/.md files matched — nothing to do.'
1515
- );
1516
- printIdioms();
1517
- return;
1518
- }
1519
-
1520
- if (findings.length === 0) {
1521
- console.log(
1522
- `[bitboss-ui] check OK — ${summarizeFileCounts(files)} file(s), zero unknown Bb* props/v-models/slots/nav-attrs.`
1523
- );
1524
- printSuppressed();
1525
- printWarnings();
1526
- printHints();
1527
- printIdioms();
1528
- return;
1529
- }
1530
-
1531
- printSuppressed();
1532
- printWarnings();
1533
- const fileCount = new Set(findings.map((f) => f.file)).size;
1534
- console.error(
1535
- `[bitboss-ui] check FAILED — ${findings.length} finding(s) across ${fileCount} file(s):`
1536
- );
1537
- let lastFile = null;
1538
- for (const finding of findings) {
1539
- if (finding.file !== lastFile) {
1540
- console.error(`\n ${finding.file}`);
1541
- lastFile = finding.file;
1542
- }
1543
- const where =
1544
- finding.fenceInfo != null
1545
- ? `fence#${finding.fenceIndex}${finding.fenceInfo ? ` (${finding.fenceInfo})` : ''} `
1546
- : '';
1547
- // CHK-LINE: three identical `full-screen` findings under one filename
1548
- // were indistinguishable, so every automated fix had to re-parse the
1549
- // file to place them. The line comes straight off the template AST.
1550
- const at = finding.line != null ? `line ${finding.line}: ` : '';
1551
- // A `fallthrough` finding is not a typo and may be doing something
1552
- // today — a native listener reaching the root element. It still counts,
1553
- // but marking it `✗` alongside a genuinely broken prop is what let one
1554
- // migration report read a live `<BbDialog @close>` as dead code.
1555
- const mark = finding.fallthrough ? '⚠' : '✗';
1556
- console.error(
1557
- ` ${mark} ${at}${where ? `[${where.trim()}] ` : ''}${finding.message}`
1558
- );
1559
- if (finding.hint) console.error(` hint: ${finding.hint}`);
1560
- }
1561
- console.error(
1562
- '\nFix the markup (or the component API) so it stays copy-safe for agents.'
1563
- );
1564
- printFindingLegend(findings);
1565
- printHints();
1566
- printIdioms();
1567
- process.exit(1);
1568
- }
1569
-
1570
- function printHelp() {
1571
- console.log(`bitboss-ui CLI
1572
-
1573
- Usage:
1574
- npx bitboss-ui <command>
1575
-
1576
- Commands:
1577
- ai-init [--update] [--no-mcp]
1578
- Inject AI-agent knowledge-base pointers into the current
1579
- project (AGENTS.md, Cursor rules, Copilot instructions,
1580
- Claude skill, Windsurf rules), register the bitboss-ui MCP
1581
- server for Claude Code (.mcp.json), Cursor
1582
- (.cursor/mcp.json), VS Code/Copilot (.vscode/mcp.json) and
1583
- Zed (.zed/settings.json) —
1584
- merges, never overwrites other servers — and install its
1585
- optional peers with the project's package manager. Sets
1586
- \`vueCompilerOptions.checkUnknownComponents: true\` in the
1587
- tsconfig unless it is already named (Nuxt: says where),
1588
- and suggests (never writes) the install guide's strict
1589
- template set when \`strictTemplates\` is not on.
1590
- \`--no-mcp\` skips the server and the install. Idempotent —
1591
- safe to re-run after upgrades.
1592
- add <id…> | --all [--dir <path>] [--dry-run] [--json]
1593
- Copy Inertia helpers (\`helpers list\`; --all for every
1594
- one) into the app as
1595
- files it owns, with every file they import, and record
1596
- them in bitboss-ui.lock.json. Creates missing files and
1597
- adopts identical ones; never changes an existing file.
1598
- Prints the install line for missing npm packages; never
1599
- runs it. First run: --dir, else
1600
- resources/js/composables/inertia-helpers (Laravel) or
1601
- src/composables/inertia-helpers.
1602
- helpers [list] [--json]
1603
- Every helper id, what it does, its files and packages,
1604
- and its state in this app.
1605
- helpers diff [id…] [--json]
1606
- The state of every installed helper file; with ids, the
1607
- difference between your copy and this bitboss-ui's.
1608
- Exit 1 when something differs. Comments never count as
1609
- edits: a stale file's comments are replaced by update.
1610
- helpers update [id…] [--dry-run] [--json]
1611
- Replace helper files that hold an older bitboss-ui
1612
- version (formatting does not matter); keep the files
1613
- you edited; keep a file you edited that bitboss-ui also
1614
- changed, and the files that import it (exit 2), and
1615
- update the rest of its group. \`npm update bitboss-ui\`
1616
- does not touch your copies: run this after upgrading.
1617
- add/helpers exit codes: 0 done or nothing to do; 1 usage
1618
- error or diff found a difference; 2 refused (add wrote
1619
- nothing); 3 a precondition failed, nothing written; 4 a
1620
- write failed and was rolled back. No --force: to take
1621
- bitboss-ui's copy over your edit, delete the file and
1622
- run add again. --yes is accepted and does nothing (the
1623
- commands never prompt).
1624
- check [glob…] [--changed] [--json] [--allow-empty] [--allow-component <Name>]
1625
- [--no-hints] [--manifest <path>] [--fix] [--idioms]
1626
- Validate \`Bb*\` markup in .vue/.md files against the
1627
- installed components.json manifest (unknown/removed props,
1628
- bad v-models, unknown \`<template #slot>\` names,
1629
- \`href\`/\`to\`/\`method\` on a component that doesn't declare
1630
- them). Defaults to every .vue/.md file under the current directory
1631
- (node_modules, dist, .git, vendor,
1632
- storage, public, .output, .nuxt, bootstrap/cache
1633
- excluded — pass an explicit glob/path to widen the scan).
1634
- Exits 1 on findings, and on an explicit glob that matched
1635
- nothing (a typo'd CI path validates zero files silently) —
1636
- pass \`--allow-empty\` when an empty match is expected.
1637
-
1638
- \`--changed\` validates only the .vue/.md files git reports
1639
- changed against HEAD (staged or not) plus untracked ones —
1640
- the fast loop after an edit. Unchanged files are not
1641
- validated and the styles-import scan reads only the
1642
- changed files; what a finding depends on elsewhere (the
1643
- project's var() reads, defineRule names, local Bb*
1644
- components) is still read from the whole project. Nothing
1645
- changed → exit 0. Not with paths. Run a full \`check\`
1646
- before merging.
1647
-
1648
- It also writes your project's \`bitboss-ui.d.ts\` (the
1649
- file the Vite plugin writes on start) from the variant
1650
- options in vite.config / nuxt.config, so a newly
1651
- registered variant name type-checks before Vite runs.
1652
- Left alone when the options are not inline literals, and
1653
- under \`--manifest\`.
1654
-
1655
- \`--fix\` first applies the ESLint plugin's fixes (the
1656
- registered renames — v2→v3 and between 3.0 betas, item
1657
- fields included — polarity flips and value remaps) to the matched .vue files with ONLY the
1658
- bitboss-ui rules — your own ESLint config is not used —
1659
- then reports what is left. Needs \`eslint\` and
1660
- \`vue-eslint-parser\` in the project.
1661
-
1662
- \`--idioms\` also lists the hand-rolled controls still in
1663
- the app that the library ships (radio cards, segmented
1664
- controls, sortable headers, steppers, app sheets, app
1665
- confirms, …) with file:line and the replacement: the
1666
- adoption checklist's own rows, run over .vue and script
1667
- files, and two repeats across files: one \`icon\` literal
1668
- on 3+ BbAlert / toasts (→ a variant) and one \`pt:<part>\`
1669
- literal on 3+ instances of a component (→ the global
1670
- \`pt\` map). Report-only and opt-in: it never changes the
1671
- exit code, and plain \`check\` never runs it. Guide:
1672
- dist/ai/guides/migration/adoption-checklist.md.
1673
-
1674
- Honours ESLint disable comments in .vue files: a finding
1675
- silenced for the matching \`bitboss-ui/*\` rule (or by a
1676
- bare \`eslint-disable\`) is not reported, only counted:
1677
- <!-- eslint-disable-next-line bitboss-ui/require-table-slot-prop -- why -->
1678
-
1679
- \`--manifest <path>\` judges against another version's
1680
- components.json instead of the installed one — the answer
1681
- to "which of my files break if I upgrade", BEFORE you
1682
- upgrade. The banner names both versions so a findings list
1683
- is never mistaken for one about your current install.
1684
- npm pack bitboss-ui@3.0.0-beta.21
1685
- tar -xzf bitboss-ui-3.0.0-beta.21.tgz
1686
- npx bitboss-ui check --manifest package/dist/ai/components.json
1687
- A path, not a version, on purpose: fetching one would put
1688
- a registry call inside a validator people run in CI.
1689
-
1690
- \`--allow-component <Name>\` (repeatable) exempts a
1691
- component your APP owns whose name starts with \`Bb\` —
1692
- the prefix is a convention, not proof of provenance.
1693
- Persist the list instead of repeating the flag:
1694
- package.json { "bitboss-ui": { "allowComponents": ["BbRichEditor"] } }
1695
- or \`bitboss-ui.check.json\` \`{ "allowComponents": [...] }\`.
1696
- Same option name as the ESLint rules' \`allowComponents\`,
1697
- so both gates configure alike. An allowed or
1698
- project-local component owns its \`bb-<kebab>\` class
1699
- block, so CSS styling it is never \`unknown-class\`.
1700
-
1701
- \`--json\` prints \`{ findings: [...], warnings: [...], hints: [...],
1702
- suppressed, files, manifestVersion, installedVersion }\`
1703
- (plus \`changed: true\` under \`--changed\`, and
1704
- \`idioms: [{ file, line, id, use, count? }]\` under \`--idioms\`).
1705
- Each finding: \`{ file, line, component, attr, kind,
1706
- message, hint?, to? }\` (plus \`fenceIndex\`/\`fenceInfo\`
1707
- inside a markdown fence; \`line\` is absolute in the file).
1708
- \`kind\` is one of: \`removed-prop\` (a recorded break on a
1709
- prop or a \`pt\` key, v2→v3 or a v3 beta; \`to\` is the new
1710
- name when there is one and \`--fix\` writes it, else the
1711
- message says what to do), \`unknown-prop\` (not a v3 prop of that component;
1712
- may never have been one — see the legend the text output
1713
- prints), \`unknown-component\` (a \`Bb*\` tag the
1714
- manifest doesn't have; \`attr\` is the tag),
1715
- \`unknown-model\`, \`unknown-event\`, \`removed-event\`
1716
- (a listener for an event the component no longer emits,
1717
- e.g. BbColorPalette \`@update:open\`), \`unknown-slot\`,
1718
- \`unknown-pt-key\` (a key of the \`pt\` object form that
1719
- matches no part / state; \`to\` when the part was renamed),
1720
- \`no-default-slot\`, \`empty-dropzone\` (a warning: a
1721
- BbDropzone with nothing in its slot, the only surface
1722
- it has, renders 0px tall), \`inert-nav-attr\`,
1723
- \`nameless-control\` (an icon-only BbButton or BbBadge,
1724
- or a BbProgress, with no accessible name),
1725
- \`removed-css-local\` (a component CSS local the
1726
- library removed, e.g. \`--day-slot-allowance\`),
1727
- \`renamed-export\` (an import of a name bitboss-ui
1728
- renamed, e.g. \`useBbFormContext\` → \`useBbForm\`),
1729
- \`private-import\` (an import from inside the package's
1730
- \`dist/\`), \`not-exported-type\` (a \`Pt*\` pt type
1731
- imported from bitboss-ui: type pt through
1732
- \`<Component>Props['pt']\` instead),
1733
- \`missing-value\` / \`missing-id\` /
1734
- \`duplicate-row-label\` (a BbDropdown row in a
1735
- selectable group without a \`value\`, a selectable
1736
- group without an \`id\`, or two value-less rows with
1737
- the same \`label\` in one group; before
1738
- 3.0.0-beta.49 \`missing-key\` / \`duplicate-row-text\`),
1739
- \`renamed-item-field\` (a dropdown row \`key\` /
1740
- \`text\`, a dropdown group \`key\`, a tab \`key\` or a
1741
- crumb \`key\` / \`text\` in an inline or same-file
1742
- items array: rows and crumbs take \`value\` /
1743
- \`label\`, tabs \`value\`, groups \`id\`; \`--fix\`
1744
- rewrites it),
1745
- \`tab-link-navigation\` / \`tab-link-missing\` (a
1746
- BbTabs whose items have \`href\` / \`to\` is a nav of
1747
- links: \`navigation\` on it does nothing, and an item
1748
- with neither renders as a disabled link),
1749
- \`unknown-variant\` (a variant name from another
1750
- library, e.g. \`danger\` on BbAlert / BbBadge; the
1751
- message names ours),
1752
- \`duplicate-field-identity\` (two validated fields in
1753
- one \`BbForm\` on the same path: the same \`name\`,
1754
- or the same label with no \`name\`),
1755
- \`unimported-component\` (a \`.vue\` file uses a
1756
- bitboss-ui tag it never imports and the project never
1757
- registers globally: it renders as an empty element),
1758
- \`reactive-v-model\` (a \`v-model\` on a \`<script
1759
- setup>\` \`const x = reactive(…)\`: a production build
1760
- rejects the write-back; hold it in a \`ref()\`),
1761
- \`text-null-value\` (a \`v-model\` on BbTextInput /
1762
- BbTextarea bound to a ref typed \`string\` while the
1763
- field writes \`null\` once emptied: widen it to
1764
- \`ref<string | null>\`, or \`null-value="string"\`),
1765
- \`dropdown-default-slot\` (a trigger in a BbDropdown's
1766
- default slot, which holds BbDropdownGroup companions:
1767
- it opens nothing; use \`#activator="{ props }"\` with
1768
- \`v-bind="props"\`, or \`v-bb-dropdown\`),
1769
- \`collapsible-trigger-aria\` (an element whose
1770
- \`@click="open = !open"\` flips a BbCollapsible's
1771
- ref, with no \`aria-expanded\`: add
1772
- \`:aria-expanded="open"\` + \`aria-controls\`),
1773
- \`form-v-model\` (\`v-model\`, \`:model-value\` or an
1774
- \`@update:model-value\` listener on a \`BbForm\`: it
1775
- takes its object one way, \`:model="draft"\`),
1776
- \`bare-portal-name\` (\`v-bb-popover="user-card"\` /
1777
- \`v-bb-hover-card="user-card"\` without the inner
1778
- quotes: an expression, not a portal name; write
1779
- \`"'user-card'"\`),
1780
- \`unknown-portal\` (\`v-bb-hover-card\` /
1781
- \`v-bb-popover\` / \`confirm()\` names a portal no
1782
- \`<…Portal name>\` in the project declares; did-you-mean
1783
- in the message), \`portal-family-mismatch\` (a
1784
- hover-card portal opened by \`v-bb-popover\`, or the
1785
- other way round; literal names only, a \`:name\`
1786
- binding or a non-literal call site is never judged),
1787
- \`unknown-dialog\` (\`v-bb-dialog\` /
1788
- \`v-bb-off-canvas\` / \`useBbDialog()\` /
1789
- \`useBbOffCanvas()\` names an id no
1790
- \`<BbDialog | BbOffCanvas id>\` declares, or one of
1791
- the other family; literal ids only),
1792
- \`positional-provider\` (an \`items\` provider with
1793
- positional arguments: it receives one object,
1794
- \`({ query, reason, modelValue, signal })\`),
1795
- \`rules-ignored-by-schema\` (a validated field's
1796
- \`rules\` inside a \`BbForm\` that has a \`schema\`:
1797
- vee-validate reads only the schema),
1798
- \`row-without-name\` (a form control in a \`v-for\`
1799
- inside a \`BbForm\` with a bound label and no \`name\`),
1800
- \`field-without-name\` (a field with its own
1801
- \`v-model\` and no \`name\` in a \`BbForm\` with
1802
- \`field-errors\`: its errors never reach it; your
1803
- \`definePreset\` wrappers count as their Bb* control),
1804
- \`retired-entrypoint\` (an import from
1805
- \`bitboss-ui/validated\`, retired: everything is in
1806
- \`bitboss-ui\`; \`--fix\` rewrites it in .vue files),
1807
- \`unregistered-rule\` (a string or object rule no
1808
- \`defineRule\` in the project registers (in a .md
1809
- page, also one the page's own fences show); a
1810
- registration it cannot read is named, never skipped:
1811
- list such names under \`registeredRules\` in
1812
- bitboss-ui.check.json),
1813
- \`invalid-value\` (a static value outside a closed
1814
- union, e.g. \`placement="bottom-centre"\`; variants
1815
- and other registry-backed unions are not checked),
1816
- \`stale-define-preset\` (a copy of the definePreset
1817
- recipe whose \`// bitboss-ui definePreset rev N\` stamp
1818
- is older than the shipped one, or missing; update it
1819
- with \`cp node_modules/bitboss-ui/dist/ai/helpers/definePreset.ts <file>\`),
1820
- \`wrapper-drops-props\` (a wrapper whose
1821
- \`defineProps\` declares a \`Bb*Props\` type, bare,
1822
- \`Omit\` or \`Pick\`, and never binds or reads some
1823
- of those props: a caller's value is dropped),
1824
- \`renamed-slot\` (a slot the library renamed;
1825
- \`--fix\` rewrites it), \`missing-partner-prop\`,
1826
- \`conflicting-props\` (props that replace each
1827
- other set together, e.g. BbSlider \`items\` beside
1828
- \`step\` / \`min\` / \`max\`),
1829
- \`partner-prop\`,
1830
- \`validated-only-prop\`, \`object-items-without-text\`
1831
- (object \`items\` with neither a \`label\` nor a
1832
- \`text\` field and no \`item-text\`; reads only
1833
- an inline array, or a \`const\` array, \`ref([…])\` or
1834
- \`reactive([…])\` in the same file's
1835
- \`<script setup>\`), \`reserved-key\` (a column
1836
- \`key\` or item \`value\` whose slot name is one of
1837
- the component's own slots, e.g. a BbTable column keyed
1838
- \`actions\`; read from the manifest, same-file items
1839
- only), \`hand-imported-styles\`
1840
- (\`bitboss-ui/styles.css\` imported in CSS, a script or
1841
- Nuxt's \`css\` while \`injectStyles\` is on: delete it;
1842
- read only when vite.config / nuxt.config says so),
1843
- \`unknown-locale\` (a \`locale\` / \`enabledLocales\`
1844
- literal in vite.config / nuxt.config, or a
1845
- \`setConfig({ locale })\`, that bitboss-ui does not
1846
- ship; \`suggestion\` is the nearest one: en-UK →
1847
- en-GB), \`unknown-class\` (a selector on a \`.bb-*\` class the
1848
- library does not render, in a stylesheet or a
1849
- \`<style>\` block; \`suggestion\` is the nearest real
1850
- one), \`renamed-class\` (a class the library renamed;
1851
- \`to\` is its successor). Your own classes are never
1852
- read, nor a \`bb-*\` class the same file adds itself
1853
- (\`class\`, \`:class\`, \`pt:*\`), \`inert-token\` (a
1854
- \`--bb-*\` SET that the library neither declares nor
1855
- reads; \`suggestion\` = the nearest token),
1856
- \`inert-local\` (a local set on a \`.bb-*\` block, nested
1857
- rules included, or on a Bb* tag's \`style\` / \`:style\` /
1858
- \`[--x:…]\` class, whose component, and what it mounts,
1859
- never reads it; \`to\` when it was renamed). A local on your own ancestor
1860
- element, or one your CSS reads, is never judged.
1861
- \`warnings[]\` (never fail the run) use the same shape with
1862
- \`severity: "warning"\`: \`likely-squashed-slot\` (a slot
1863
- name that looks like a camelCase key squashed, e.g.
1864
- \`#createdat\`), \`computed-slot-key\` (a computed slot
1865
- name over keys \`check\` cannot see, not spelled
1866
- through \`slotKey(…)\`), \`local-bb-component\` (your own
1867
- component uses the \`Bb\` prefix; rename it),
1868
- \`single-reason\` (an \`items\` provider that tests
1869
- \`reason\` against one cause other than \`'search'\`;
1870
- check \`reason !== 'search'\`), \`unused-portal\` (a
1871
- \`<…Portal name>\` nothing opens: no call site and the
1872
- name in no string of the project), \`vue-tsc-major\`
1873
- (\`vue-tsc\` below 3 in package.json: the generic
1874
- components' props go unchecked), \`prefer-v-bb-dialog\`
1875
- (a \`ref(false)\` only a BbDialog / BbOffCanvas
1876
- \`v-model\` and \`@click="x = true"\` use: give the
1877
- dialog an \`id\` and put \`v-bb-dialog\` on the
1878
- trigger; ESLint's \`--fix\` rewrites it when nothing
1879
- else uses the ref), \`hidden-label-placeholder\` (a
1880
- field or select with \`hide-label\` and no
1881
- \`placeholder\`: an empty unlabelled box to a sighted
1882
- user; add a \`placeholder\`).
1883
- changelog [--since <version>] [--until <version>] [--json]
1884
- Breaking changes between two releases — "what breaks if I
1885
- bump". \`--since\` is the version you are ON, and is
1886
- exclusive. With no range, every break in the v2 → v3
1887
- upgrade. Then what the range added, one line per feature
1888
- (with no range, only their count). Fixes are not tracked,
1889
- so no breaking changes means nothing breaks, not that
1890
- nothing changed.
1891
- npx bitboss-ui changelog --since 3.0.0-beta.20
1892
- Pair it with \`check --manifest\` to turn the list into the
1893
- files in YOUR app that break.
1894
-
1895
- mcp Start a stdio MCP server exposing the dist/ai knowledge
1896
- base (search_docs, search_components, get_component,
1897
- get_composable, list_tokens, list_guides, get_guide,
1898
- list_changes, list_recipes, get_recipe, validate) to
1899
- MCP-capable agent harnesses.
1900
- help Show this help.
1901
- `);
1902
- }
1903
-
1904
- /**
1905
- * Strict `node:util` parseArgs wrapper: unknown flags/positionals become an
1906
- * actionable `[bitboss-ui] <command>: …` error + help + exit 1.
1907
- */
1908
- function parseCommandArgs(
1909
- command,
1910
- args,
1911
- options,
1912
- { allowPositionals = false } = {}
1913
- ) {
1914
- try {
1915
- return parseArgs({ args, options, allowPositionals, strict: true });
1916
- } catch (error) {
1917
- const message = error instanceof Error ? error.message : String(error);
1918
- console.error(`[bitboss-ui] ${command}: ${message}`);
1919
- printHelp();
1920
- process.exit(1);
1921
- }
1922
- }
1923
-
1924
- const [command, ...commandArgs] = process.argv.slice(2);
1925
-
1926
- switch (command) {
1927
- case 'ai-init': {
1928
- const { values } = parseCommandArgs(command, commandArgs, {
1929
- update: { type: 'boolean' },
1930
- // The MCP server is registered by default: people ran ai-init, got
1931
- // the pointers, and never learned the server existed.
1932
- 'no-mcp': { type: 'boolean' },
1933
- });
1934
- aiInit({ mcp: !values['no-mcp'] });
1935
- break;
1936
- }
1937
- case 'check': {
1938
- const { values, positionals } = parseCommandArgs(
1939
- command,
1940
- commandArgs,
1941
- {
1942
- json: { type: 'boolean' },
1943
- 'allow-empty': { type: 'boolean' },
1944
- 'allow-component': { type: 'string', multiple: true },
1945
- fix: { type: 'boolean' },
1946
- manifest: { type: 'string' },
1947
- changed: { type: 'boolean' },
1948
- idioms: { type: 'boolean' },
1949
- // Accepted and ignored here — read straight off argv inside
1950
- // checkCommand, but parseArgs is strict, so it must be declared.
1951
- 'no-hints': { type: 'boolean' },
1952
- },
1953
- { allowPositionals: true }
1954
- );
1955
- await checkCommand(positionals, {
1956
- fix: values.fix ?? false,
1957
- json: values.json ?? false,
1958
- allowEmpty: values['allow-empty'] ?? false,
1959
- allowComponents: values['allow-component'] ?? [],
1960
- manifest: values.manifest,
1961
- changed: values.changed ?? false,
1962
- idioms: values.idioms ?? false,
1963
- });
1964
- break;
1965
- }
1966
- case 'changelog': {
1967
- const { values } = parseCommandArgs(command, commandArgs, {
1968
- since: { type: 'string' },
1969
- until: { type: 'string' },
1970
- json: { type: 'boolean' },
1971
- });
1972
- changelogCommand({
1973
- since: values.since,
1974
- until: values.until,
1975
- json: values.json ?? false,
1976
- });
1977
- break;
1978
- }
1979
- case 'mcp': {
1980
- // `@modelcontextprotocol/sdk` + `zod` are OPTIONAL peers, not
1981
- // dependencies: together they weigh ~12 MB — more than every runtime
1982
- // dependency of the component library combined, and the SDK drags in a
1983
- // whole HTTP stack (express, hono, cors, jose). Only this subcommand
1984
- // needs them, so consumers who never run the MCP server do not pay for
1985
- // it. That makes the import failure a SUPPORTED path, and a bare
1986
- // ERR_MODULE_NOT_FOUND stack is not an answer — say what to install.
1987
- let main;
1988
- try {
1989
- ({ main } = await import('./bitboss-ui-mcp.mjs'));
1990
- } catch (error) {
1991
- if (error?.code !== 'ERR_MODULE_NOT_FOUND') throw error;
1992
- // Running from an npx cache is a DIFFERENT failure wearing the same
1993
- // error: the peers resolve relative to the package we were launched
1994
- // from, so a cached copy can never see the project's node_modules no
1995
- // matter what is installed there. Telling that user to install peers
1996
- // they already have is what sent a consumer down a dead end
1997
- // (2026-09-09). `ai-init` now writes the local binary instead
1998
- // of `npx`, so the fix is to rewrite the config.
1999
- const fromNpxCache = /[/\\]_npx[/\\]/.test(
2000
- fileURLToPath(import.meta.url)
2001
- );
2002
- const projectHasPeers = missingMcpPeers(process.cwd()).length === 0;
2003
- if (fromNpxCache && projectHasPeers) {
2004
- console.error(
2005
- 'bitboss-ui mcp was launched through `npx`, which runs it from the npx cache —\n' +
2006
- 'its optional peers resolve there, not in your project, so the server cannot start\n' +
2007
- `even though this project has them installed (${MCP_PEERS.join(', ')}).\n\n` +
2008
- 'Fix the harness config to invoke the installed binary:\n\n' +
2009
- ' npx bitboss-ui ai-init\n\n' +
2010
- `which writes \`node ${MCP_BIN_PATH} mcp\`. To run it right now:\n\n` +
2011
- ` node ${MCP_BIN_PATH} mcp\n\n` +
2012
- `Resolution failed with: ${error.message}`
2013
- );
2014
- process.exitCode = 1;
2015
- break;
2016
- }
2017
- console.error(
2018
- 'bitboss-ui mcp needs two optional peer dependencies that are not installed:\n' +
2019
- `\n npm i -D ${MCP_PEERS.join(' ')}\n\n` +
2020
- 'They are optional because they are ~12 MB and only this subcommand uses them.\n' +
2021
- `Resolution failed with: ${error.message}`
2022
- );
2023
- process.exitCode = 1;
2024
- break;
2025
- }
2026
- await main();
2027
- break;
2028
- }
2029
- case 'add':
2030
- case 'helpers': {
2031
- const { values, positionals } = parseCommandArgs(
2032
- command,
2033
- commandArgs,
2034
- {
2035
- json: { type: 'boolean' },
2036
- 'dry-run': { type: 'boolean' },
2037
- yes: { type: 'boolean', short: 'y' },
2038
- ...(command === 'add'
2039
- ? { dir: { type: 'string' }, all: { type: 'boolean' } }
2040
- : {}),
2041
- },
2042
- { allowPositionals: true }
2043
- );
2044
- const [sub, ...rest] =
2045
- command === 'add' ? ['add', ...positionals] : positionals;
2046
- const subcommand = command === 'add' ? 'add' : (sub ?? 'list');
2047
- if (subcommand === 'list' && values['dry-run']) {
2048
- console.error(
2049
- '[bitboss-ui] helpers list: --dry-run applies to add and update'
2050
- );
2051
- process.exit(1);
2052
- }
2053
- const { runHelpers } = await import('../scripts/lib/helpers-add.mjs');
2054
- const result = await runHelpers({
2055
- command: subcommand,
2056
- ids: command === 'add' ? positionals : rest,
2057
- options: {
2058
- dir: values.dir,
2059
- dryRun: values['dry-run'] ?? false,
2060
- all: values.all ?? false,
2061
- },
2062
- cwd: process.cwd(),
2063
- packageRoot: PACKAGE_ROOT,
2064
- });
2065
- if (values.json) console.log(JSON.stringify(result.report));
2066
- else (result.stderr ? console.error : console.log)(result.lines.join('\n'));
2067
- process.exitCode = result.code;
2068
- break;
2069
- }
2070
- case 'help':
2071
- case '--help':
2072
- case '-h':
2073
- case undefined:
2074
- printHelp();
2075
- break;
2076
- default:
2077
- console.error(`[bitboss-ui] Unknown command: ${command}`);
2078
- printHelp();
2079
- process.exit(1);
3
+ * bitboss-ui CLI entry. `setup` runs on a slim path: it is the one command
4
+ * that runs before the app has `vue` installed (`yarn dlx` / `pnpm dlx`
5
+ * install no peers), while the full CLI (bin/cli.mjs) loads Vue's template
6
+ * compiler at start-up for `check`. `update --no-install` (the app's
7
+ * postinstall) takes the same slim path, so an install never fails on it.
8
+ * Every other command is the full CLI.
9
+ */
10
+ const [command, ...args] = process.argv.slice(2);
11
+
12
+ const refreshOnly =
13
+ command === 'update' &&
14
+ args.every((a) => a === '--no-install' || a === '--all') &&
15
+ (args.includes('--no-install') ||
16
+ process.env.npm_lifecycle_event === 'postinstall');
17
+
18
+ if (command === 'setup') {
19
+ const { setupCli } = await import('../scripts/lib/setup.mjs');
20
+ process.exitCode = await setupCli(args);
21
+ } else if (refreshOnly) {
22
+ // The app's postinstall: the agent refresh alone, on the same slim path.
23
+ const { refreshCli } = await import('../scripts/lib/agent-refresh.mjs');
24
+ process.exitCode = await refreshCli(args);
25
+ } else {
26
+ await import('./cli.mjs');
2080
27
  }