bitboss-ui 3.0.0-beta.72 → 3.0.0-beta.74

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 (185) hide show
  1. package/README.md +4 -2
  2. package/bin/bitboss-ui-mcp.mjs +101 -3
  3. package/bin/bitboss-ui.mjs +6 -1
  4. package/bin/cli.mjs +34 -7
  5. package/dist/ai/BbBadge.md +4 -4
  6. package/dist/ai/BbCalendar.md +4 -3
  7. package/dist/ai/BbColorPalette.md +8 -9
  8. package/dist/ai/BbConfirmPortal.md +1 -1
  9. package/dist/ai/BbDatePicker.md +4 -3
  10. package/dist/ai/BbDialog.md +17 -4
  11. package/dist/ai/BbDropdown.md +23 -10
  12. package/dist/ai/BbDropdownButton.md +2 -2
  13. package/dist/ai/BbForm.md +11 -7
  14. package/dist/ai/BbHoverCardPortal.md +1 -1
  15. package/dist/ai/BbNumberInput.md +5 -3
  16. package/dist/ai/BbPopoverPortal.md +1 -1
  17. package/dist/ai/BbTable.md +43 -19
  18. package/dist/ai/BbTimePicker.md +4 -3
  19. package/dist/ai/BbToastPortal.md +1 -1
  20. package/dist/ai/changelog.json +60 -4
  21. package/dist/ai/components.json +56 -20
  22. package/dist/ai/guides/design-tokens.md +20 -0
  23. package/dist/ai/guides/eslint-rules.md +1 -1
  24. package/dist/ai/guides/inertia-helpers.md +613 -53
  25. package/dist/ai/guides/migration/adoption-checklist.md +5 -5
  26. package/dist/ai/guides/migration/components/use-confirm.md +4 -1
  27. package/dist/ai/guides/migration/v2-to-v3.md +24 -0
  28. package/dist/ai/guides/migration/v3-beta-tooling.md +3 -0
  29. package/dist/ai/guides/preset-components.md +15 -2
  30. package/dist/ai/guides/reporting.md +49 -0
  31. package/dist/ai/helpers/inertia/manifest.json +33 -38
  32. package/dist/ai/helpers/inertia/useHasChanged.ts +25 -37
  33. package/dist/ai/helpers/inertia/useQuery.ts +24 -6
  34. package/dist/ai/helpers/inertia/utils.ts +552 -3
  35. package/dist/ai/index.md +1 -0
  36. package/dist/ai/manifest/components/BbAlert.tree.json +1 -1
  37. package/dist/ai/manifest/components/BbCalendar.json +2 -2
  38. package/dist/ai/manifest/components/BbColorPalette.json +3 -3
  39. package/dist/ai/manifest/components/BbConfirm.removed.json +4 -4
  40. package/dist/ai/manifest/components/BbConfirmPortal.json +1 -1
  41. package/dist/ai/manifest/components/BbConfirmPortal.removed.json +2 -2
  42. package/dist/ai/manifest/components/BbDatePicker.json +3 -3
  43. package/dist/ai/manifest/components/BbDialog.tree.json +5 -1
  44. package/dist/ai/manifest/components/BbDropdown.json +3 -3
  45. package/dist/ai/manifest/components/BbDropdown.tree.json +3 -2
  46. package/dist/ai/manifest/components/BbDropdownButton.json +2 -2
  47. package/dist/ai/manifest/components/BbForm.json +1 -1
  48. package/dist/ai/manifest/components/BbHoverCard.json +1 -1
  49. package/dist/ai/manifest/components/BbHoverCardPortal.json +1 -1
  50. package/dist/ai/manifest/components/BbNumberInput.json +1 -1
  51. package/dist/ai/manifest/components/BbPopover.json +1 -1
  52. package/dist/ai/manifest/components/BbPopoverPortal.json +1 -1
  53. package/dist/ai/manifest/components/BbSelectPopover.json +1 -1
  54. package/dist/ai/manifest/components/BbTable.tree.json +12 -6
  55. package/dist/ai/manifest/components/BbTimePicker.json +3 -3
  56. package/dist/ai/manifest/components/BbToast.removed.json +1 -1
  57. package/dist/ai/manifest/components/BbToastPortal.json +1 -1
  58. package/dist/ai/manifest/components/CommonPopover.json +1 -1
  59. package/dist/ai/manifest/index.json +2 -2
  60. package/dist/ai/manifest/meta.json +36 -0
  61. package/dist/ai/manifest/types.advanced.json +81 -80
  62. package/dist/ai/manifest/types.api.json +66 -65
  63. package/dist/ai/manifest/types.wrapper.json +155 -118
  64. package/dist/ai/recipes/inertia/layout-scaffold.md +3 -1
  65. package/dist/ai/recipes/nuxt/layout-scaffold.md +3 -1
  66. package/dist/ai/recipes/vue/layout-scaffold.md +3 -1
  67. package/dist/ai/source/BbAlert.md +16 -4
  68. package/dist/ai/source/BbAvatar.md +2 -0
  69. package/dist/ai/source/BbBreadcrumbs.md +4 -1
  70. package/dist/ai/source/BbCalendar.md +22 -12
  71. package/dist/ai/source/BbColorPalette.md +41 -12
  72. package/dist/ai/source/BbConfirm.md +7 -0
  73. package/dist/ai/source/BbConfirmPortal.md +9 -4
  74. package/dist/ai/source/BbDatePicker.md +53 -22
  75. package/dist/ai/source/BbDatePickerInput.md +32 -8
  76. package/dist/ai/source/BbDialog.md +31 -1
  77. package/dist/ai/source/BbDropdown.md +52 -24
  78. package/dist/ai/source/BbDropdownGroup.md +17 -21
  79. package/dist/ai/source/BbForm.md +80 -6
  80. package/dist/ai/source/BbHoverCard.md +7 -0
  81. package/dist/ai/source/BbHoverCardPortal.md +9 -5
  82. package/dist/ai/source/BbNumberInput.md +5 -6
  83. package/dist/ai/source/BbOffCanvas.md +34 -1
  84. package/dist/ai/source/BbPopover.md +7 -0
  85. package/dist/ai/source/BbPopoverPortal.md +9 -5
  86. package/dist/ai/source/BbRadio.md +4 -3
  87. package/dist/ai/source/BbRadioGroup.md +7 -5
  88. package/dist/ai/source/BbTable.md +54 -6
  89. package/dist/ai/source/BbTag.md +10 -3
  90. package/dist/ai/source/BbTimePicker.md +50 -15
  91. package/dist/ai/source/BbTimePickerInput.md +30 -7
  92. package/dist/ai/source/BbToast.md +14 -0
  93. package/dist/ai/source/BbToastPortal.md +16 -4
  94. package/dist/ai/source/CommonFieldInput.md +11 -5
  95. package/dist/ai/source/CommonPopover.md +4 -1
  96. package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +31 -26
  97. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +1 -1
  98. package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
  99. package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +235 -234
  100. package/dist/components/BbCalendar/types.d.ts +2 -2
  101. package/dist/components/BbCalendar/useDayjsLocale.js +11 -8
  102. package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +197 -192
  103. package/dist/components/BbColorPalette/types.d.ts +1 -1
  104. package/dist/components/BbConfirm/BbConfirmPortal.vue.d.ts +2 -4
  105. package/dist/components/BbConfirm/types.d.ts +5 -0
  106. package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +1 -1
  107. package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +145 -139
  108. package/dist/components/BbDatePicker/types.d.ts +2 -2
  109. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +337 -335
  110. package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +253 -245
  111. package/dist/components/BbDialog/leaveGhost.js +33 -0
  112. package/dist/components/BbDialog/overlayActions.js +34 -20
  113. package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +11 -3
  114. package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +4 -4
  115. package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +119 -120
  116. package/dist/components/BbDropdown/types.d.ts +8 -17
  117. package/dist/components/BbForm/BbForm.vue.d.ts +2 -21
  118. package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +229 -227
  119. package/dist/components/BbForm/types.d.ts +31 -0
  120. package/dist/components/BbHoverCard/BbHoverCardPortal.vue.d.ts +2 -5
  121. package/dist/components/BbHoverCard/types.d.ts +5 -0
  122. package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +1 -1
  123. package/dist/components/BbNumberInput/numberDisplay.js +102 -106
  124. package/dist/components/BbNumberInput/types.d.ts +4 -3
  125. package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +385 -377
  126. package/dist/components/BbPopover/BbPopoverPortal.vue.d.ts +2 -5
  127. package/dist/components/BbPopover/types.d.ts +5 -0
  128. package/dist/components/BbRadio/types.d.ts +4 -3
  129. package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +10 -12
  130. package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +231 -231
  131. package/dist/components/BbTable/BbTableDataRow.js +96 -96
  132. package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +9 -3
  133. package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +1 -1
  134. package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +106 -100
  135. package/dist/components/BbTimePicker/types.d.ts +2 -2
  136. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +214 -213
  137. package/dist/components/BbToast/BbToastPortal.vue.d.ts +2 -4
  138. package/dist/components/BbToast/types.d.ts +5 -0
  139. package/dist/components/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +36 -36
  140. package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +1 -1
  141. package/dist/components/CommonTimeSelector/useMeridiem.js +6 -6
  142. package/dist/composables/formSubmitLock.js +2 -1
  143. package/dist/composables/overlayRegistry.js +52 -42
  144. package/dist/composables/useActiveInactiveState.js +8 -4
  145. package/dist/composables/useBbDialog.js +5 -5
  146. package/dist/composables/useOwnModel.js +16 -0
  147. package/dist/composables/useSegmentedFields.js +31 -20
  148. package/dist/deprecation/ai-deprecations.json.js +1 -1
  149. package/dist/i18n/currencyDigits.js +58 -0
  150. package/dist/i18n/regionDates.js +250 -0
  151. package/dist/i18n/regionHints.js +30 -41
  152. package/dist/index.d.ts +34 -30
  153. package/dist/llms-full.txt +874 -136
  154. package/dist/llms.txt +3 -1
  155. package/dist/styles.css +2 -2
  156. package/dist/types/ActionButton.d.ts +3 -1
  157. package/dist/types/CommonProps.d.ts +8 -0
  158. package/dist/utilities/functions/hash.js +123 -3
  159. package/dist/utilities/functions/isEqual.js +69 -3
  160. package/dist/utils/versionCheck.js +1 -1
  161. package/dist/vite-plugin.d.ts +2 -1
  162. package/dist/vite.js +8 -5
  163. package/llms.txt +3 -1
  164. package/package.json +2 -3
  165. package/scripts/README.md +43 -43
  166. package/scripts/lib/adoption-checklist.json +6 -5
  167. package/scripts/lib/agent-manifest.mjs +33 -6
  168. package/scripts/lib/agent-setup.mjs +54 -6
  169. package/scripts/lib/cldr-pins.ts +182 -0
  170. package/scripts/lib/engines-include.d.mts +5 -0
  171. package/scripts/lib/engines-include.mjs +40 -0
  172. package/scripts/lib/eslint-plugin.mjs +8 -2
  173. package/scripts/lib/helpers-add.mjs +21 -2
  174. package/scripts/lib/hidden-label-placeholder.mjs +25 -5
  175. package/scripts/lib/idiom-scan.mjs +30 -3
  176. package/scripts/lib/legacy-agent-files.json +152 -0
  177. package/scripts/lib/mcp-config.mjs +74 -7
  178. package/scripts/lib/portal-names.mjs +78 -8
  179. package/scripts/lib/release-results.mjs +153 -6
  180. package/scripts/lib/report.mjs +340 -0
  181. package/scripts/lib/run-beat.mjs +14 -0
  182. package/scripts/lib/run-records.mjs +313 -0
  183. package/scripts/lib/selector-log.mjs +98 -0
  184. package/scripts/lib/ticket-beat.mjs +30 -0
  185. package/scripts/lib/validate-bb-markup.mjs +17 -2
@@ -0,0 +1,152 @@
1
+ {
2
+ ".cursor/rules/bitboss-ui.mdc": [
3
+ "0177c933cdbfde7f449bb95f5f008ea9",
4
+ "0269ed679ae31111d53a00836388bcda",
5
+ "02cd2d1be5d3c155b86be0b689e3f6c8",
6
+ "02e9357653359801619709c8a6454b4b",
7
+ "041f36da1d6a4596a69ba864c5aeda4b",
8
+ "05f39484fdba93f0fd93967c18667542",
9
+ "0bacb3fc98806d412979cb0412ce5c38",
10
+ "0cd8a2f6a52ab5602e29347f2ee66925",
11
+ "0d2075540ed90867ebb3722970d577c5",
12
+ "134fb8c5cb04bb7881fb23737cc7d82f",
13
+ "16635cfcebcecf66913c5a14935d46ce",
14
+ "1e29c6e5c5526da19fe417d29f725e8a",
15
+ "1f1532870c30e7ef3cffec3a30104fa4",
16
+ "26bfb29f229c5c0800eebc11bd14b48e",
17
+ "287b6103dc3c7a52d16f3e4a3cd5d57f",
18
+ "2d2a0369108d02ec2fc1fcad4759e9b9",
19
+ "2f45a5596bba256a9b5e8ffcb83c9b6a",
20
+ "3352195f1ab6da13234afe21778030d2",
21
+ "34243dd6e3f9d6b20b30275de8be028d",
22
+ "36181bdd970701c6808052ba8dd3fa21",
23
+ "38a03c237159a6a59730265e0f54e032",
24
+ "3adcd6b8f856e157c8e90f5fb31b0d45",
25
+ "3b0a930bb113e4a7e01241d91ebc5271",
26
+ "3e1b59c2ed6a35fedc31c325a065f6d5",
27
+ "44f9fc95833ca29bb5f98dc61ae454e4",
28
+ "49cf94fe6785e7683c1a324d91914688",
29
+ "4bbf3e3450ebcc9e6567979b7575b608",
30
+ "5815afef780258bf0c830f4e31f0767d",
31
+ "5d7004c4a2b414166eb3429676960f55",
32
+ "6268e7ed461c6f12cb3cd4d7df3374ec",
33
+ "631b89abb71135086fa2370b377f3f7c",
34
+ "64cc2d17598ddb6b9f4680f22a0003f9",
35
+ "6e77e4571467ab105daad1cf8f261220",
36
+ "77a39a95b83aef79cc44e2753b218624",
37
+ "8160bbd83de2395e00bc4645cbbdbeda",
38
+ "8448de091d95ce58eb706447c89daa10",
39
+ "8f435d940eba6d97734227f2aa8e55e8",
40
+ "8f973f6ca72328e65b9715202fb14dfd",
41
+ "9106d584757aceb54274fa33309ff059",
42
+ "99debfd332a6eb04168188092661a8a7",
43
+ "9d723fd2b7fd68c65e24882b0d19c839",
44
+ "a05a61de3942591e7b524bdc884f28ba",
45
+ "a1053e6f891c3fe871cb60bc7f986f95",
46
+ "a88d2f58c790083f8f3b0a6b9b7fba05",
47
+ "af7de1f49f5b94cf2207698d9d5fecfd",
48
+ "b04016d359bf35f5058c8ce00de5dc62",
49
+ "b21aa85e398ab6c4452f21efc7d0cd83",
50
+ "b5f25fb23600b4fd3193c6df266f150e",
51
+ "b9c541b029037bc43a1671ad8b11081a",
52
+ "b9ee3a8d00c5507fe8e5086f2e31a556",
53
+ "c0a6c26d27dc4e8db5fdff3404d7acfb",
54
+ "c0b67d088f8e9aafdb82290260ed3a7d",
55
+ "c1af18d82b0ab45e12c17c686d89e308",
56
+ "ca2dbb23c247e57d416f3421add1a78e",
57
+ "d2ad099ceb4a5b05ae2a3cd362294eaf",
58
+ "d30e786ee2739465c5709ca308e50e39",
59
+ "d4dce4d045286addff82068fdbb13bb0",
60
+ "d5167f7c6d51a37b152c8487b39c6296",
61
+ "d5bc7208c04d30f67b2b622b3ad58c4f",
62
+ "d76bfb74f8b8719e6462bf1b45c89aa2",
63
+ "d8d93aec1563ecf5792fb4ba67201fce",
64
+ "d94c898dff454064e1883a4ca4df27eb",
65
+ "db370d7775a754b1f2822ec698391243",
66
+ "e615ef983790462f20ccd036a6eb72a0",
67
+ "e6d3ca00fa635fb5e085f77cb4f6e1f5",
68
+ "e9975682872583659709bb43579e028b",
69
+ "e9bd885cb28dd6d377d3837bed8aa98a",
70
+ "eaf435b837a6abdb18a31d4b26e9a28c",
71
+ "ee48ffaa932920fa814b3a39138d386b",
72
+ "f467fe146e8e0eda487ef18164dd0e9c",
73
+ "f48d82cf7988e28f0aa06502373ad3a4",
74
+ "fc9e241cc3f3f64b8d028291b46c8012",
75
+ "fcd917bb419fae802b935718b68c89b6"
76
+ ],
77
+ ".windsurf/rules/bitboss-ui.md": [
78
+ "04eec4c9f4c43e0144a3c0ec475d7a68",
79
+ "06f394653af0313c0186885f3f12a8e8",
80
+ "08de468969ff87dd037375d2fb916652",
81
+ "0d5c4739e60a9c2ea2df5094d8604eee",
82
+ "11a02f433cdcb0af94ef69a18b34aa6b",
83
+ "1331350f890c3b6d7da8aedd245a3a64",
84
+ "14c838633d77dbc3618196b9d3d6a46d",
85
+ "1570cb63917e5a8d3e9bedae095fa58d",
86
+ "15787842cc626f4aabb5e81e74685176",
87
+ "17481ea8828116a6e7d4ab2b518b5de0",
88
+ "1b8567e79ae2cf39fa19d09700cf9362",
89
+ "226e8bb4cc5238ca082c643742106934",
90
+ "227c55dcc5b3268c0c5901a2f9f745d2",
91
+ "22b17cdaa6d7042021d9e877b63d8368",
92
+ "2441019ee6645e9cc70a338ac12a8541",
93
+ "2548a6bcadd4be695e2028e4e3b57620",
94
+ "267b27ab429b525bc082da8255061555",
95
+ "30ed6dd7f454817693bc74568eca39ec",
96
+ "31149c1caa275eaa429d5f972a8e656f",
97
+ "35413335703ac020587c498f34b47207",
98
+ "35c851ef80670fb99dd70240aeff0c5f",
99
+ "397f8db7a5787157d0b186b1ec31ee06",
100
+ "3ceae7cc73824a8ff02da66e29654cb1",
101
+ "401f9ad515334a0958740c7d88eac1fe",
102
+ "48cd644a738c13ce0bef4fcde49dc25e",
103
+ "493b47aa13e8887a76c11dba6e09d98a",
104
+ "515ba8f5277ed570d8a9d2afca7ca23b",
105
+ "53c47519c325c91014006345d923a294",
106
+ "6269ad8181786cd8af292d2a6a8cbcd3",
107
+ "64b72af0733bd48663c52f90ca09de84",
108
+ "68d7980313c3ede4df4352f4780945ec",
109
+ "6b42eea311205f4bba2272435e23a451",
110
+ "738c931c51219a36da4da9f349bb68ac",
111
+ "7baad5190d35cbf168c5aeac7fb49425",
112
+ "7bd541c512d8fdf834d5dd02a8262009",
113
+ "8431533ed91c1dfa238dc611bd47d46d",
114
+ "889f571bd5507a07ffc6c4bdc2caffd9",
115
+ "8b028ca4f3ee29187e724ddec3612e17",
116
+ "8cd81c1503b796284d917f582052f602",
117
+ "8d2d30382c0e3f21ee14c233f5b04037",
118
+ "8d395475769a4bf4d13e6c868cbb527a",
119
+ "8fbaad1a3fab1e65214d51c981421aac",
120
+ "8ff5b3a86e62fee66174ccd8aba7fe12",
121
+ "9357361e5252b9731b01df5f9708a115",
122
+ "9450e2eb7e9b3bceb94b67a3cc7facdc",
123
+ "94a16c117e2ee5e1b4e14b6fcad82db8",
124
+ "9cc403e3fb6bb7257abe402d75da6182",
125
+ "9d7e2e032bc8fa1c6db2719a9a72069d",
126
+ "a5a8541f338bf6d6f2c1f5b348fde36e",
127
+ "bab6bf09af174f423896b4dc4b4f731a",
128
+ "bb2084a9c7e7e864e766bcb5642e3369",
129
+ "bb9658c2146d6e01143ecbccd3fb4f03",
130
+ "bbb1fac6a38ecc7159c441daa0011d57",
131
+ "c08b476e230c159a6e1d49338d68aa00",
132
+ "c16e0487cc53825b124a4936f22c4936",
133
+ "c2a91ecc8ce22cb2d2e8d9b903f1bebb",
134
+ "c33efd6aaf4ee19de004f857cf49c604",
135
+ "c645f65b9fdba6a063fe53f7ab92a79e",
136
+ "cc25631969e35788d25f6e86a634ccbd",
137
+ "cee59cc39b5a87f3a88f4b3b52b01f1e",
138
+ "d04f98c855b6280e6e5187e7e0c4c269",
139
+ "d2a10f9896c95ce18f088af6993f5455",
140
+ "d56cbab2abb36855c50f0076860aaaaf",
141
+ "d7e2b3990e032b03bddeba81e618c225",
142
+ "d9c9f3cd6b3937195a895cf1d954fca3",
143
+ "ddf0037bb4831d9885ba9ad2a9dec155",
144
+ "e0e0b10effbd672b809d2027cec58cd8",
145
+ "e1b1eb6a3b760614c1e1b72392ce12ce",
146
+ "e55e503d0a06b8c8e89d454578b3af29",
147
+ "ec6842466d35b1bd6fb0984ec6cfaa75",
148
+ "f9fd8c2e2bb25159a6f437fb43698386",
149
+ "fb9fe635980dda64c2fde9aa28338c34",
150
+ "fd2238f6e532e0c297ffd5b9471c4402"
151
+ ]
152
+ }
@@ -106,9 +106,70 @@ export const stdioEntry = (root) => {
106
106
  };
107
107
  export const vscodeEntry = (root) => ({ type: 'stdio', ...stdioEntry(root) });
108
108
 
109
- function writeJson(path, data) {
109
+ /*
110
+ * JSON the way Prettier (and oxfmt, Biome) print it, so a
111
+ * file we write passes the app's `format --check` untouched: objects
112
+ * expanded, an array of scalars on one line when it fits in 80 columns
113
+ * (`"args": ["bitboss-ui", "mcp"]`), the indent unit the app uses.
114
+ */
115
+ const PRINT_WIDTH = 80;
116
+ const columns = (text) => text.replace(/\t/g, ' ').length;
117
+
118
+ /**
119
+ * @param {unknown} value
120
+ * @param {string} unit one indent step (`'\t'`, `' '`, `' '`)
121
+ * @param {string} [indent] the indent of the line the value starts on
122
+ * @param {number} [column] where on that line the value starts
123
+ * @param {string} [eol]
124
+ */
125
+ export function formatJson(value, unit, indent = '', column = 0, eol = '\n') {
126
+ if (Array.isArray(value)) {
127
+ if (value.length === 0) return '[]';
128
+ if (value.every((v) => v === null || typeof v !== 'object')) {
129
+ const flat = `[${value.map((v) => JSON.stringify(v ?? null)).join(', ')}]`;
130
+ // + 1: the comma after it.
131
+ if (column + flat.length + 1 <= PRINT_WIDTH) return flat;
132
+ }
133
+ const inner = indent + unit;
134
+ return `[${eol}${value
135
+ .map(
136
+ (v) =>
137
+ `${inner}${formatJson(v ?? null, unit, inner, columns(inner), eol)}`
138
+ )
139
+ .join(`,${eol}`)}${eol}${indent}]`;
140
+ }
141
+ if (value && typeof value === 'object') {
142
+ const entries = Object.entries(value).filter(
143
+ ([, v]) => v !== undefined && typeof v !== 'function'
144
+ );
145
+ if (entries.length === 0) return '{}';
146
+ const inner = indent + unit;
147
+ return `{${eol}${entries
148
+ .map(([key, v]) => {
149
+ const head = `${inner}${JSON.stringify(key)}: `;
150
+ return head + formatJson(v, unit, inner, columns(head), eol);
151
+ })
152
+ .join(`,${eol}`)}${eol}${indent}}`;
153
+ }
154
+ return JSON.stringify(value);
155
+ }
156
+
157
+ /** The app's indent step, read off its package.json; two spaces by default. */
158
+ export function projectIndent(root) {
159
+ try {
160
+ return (
161
+ readFileSync(join(root, 'package.json'), 'utf-8').match(
162
+ /^([ \t]+)\S/m
163
+ )?.[1] ?? ' '
164
+ );
165
+ } catch {
166
+ return ' ';
167
+ }
168
+ }
169
+
170
+ function writeJson(path, data, unit) {
110
171
  mkdirSync(dirname(path), { recursive: true });
111
- writeFileAtomicSync(path, `${JSON.stringify(data, null, '\t')}\n`, 'utf-8');
172
+ writeFileAtomicSync(path, `${formatJson(data, unit)}\n`, 'utf-8');
112
173
  }
113
174
 
114
175
  /**
@@ -210,11 +271,17 @@ function spliceEntry(raw, containerKey, entry) {
210
271
  const eol = raw.includes('\r\n') ? '\r\n' : '\n';
211
272
  const indentAt = (offset) =>
212
273
  raw.slice(raw.lastIndexOf('\n', offset) + 1).match(/^[ \t]*/)[0];
213
- const format = (value, indent) =>
214
- JSON.stringify(value, null, unit).replace(/\n/g, `${eol}${indent}`);
274
+ const lineBefore = (offset) =>
275
+ raw.slice(raw.lastIndexOf('\n', offset - 1) + 1, offset);
276
+ const format = (value, indent, column) =>
277
+ formatJson(value, unit, indent, column, eol);
215
278
  const replace = (member, value) =>
216
279
  raw.slice(0, member.valueStart) +
217
- format(value, indentAt(member.valueStart)) +
280
+ format(
281
+ value,
282
+ indentAt(member.valueStart),
283
+ columns(lineBefore(member.valueStart))
284
+ ) +
218
285
  raw.slice(member.valueEnd);
219
286
  // A new first member, right after the object's `{` — unless the rest of
220
287
  // that line is only a comment (`{ // header`), in which case after the
@@ -265,7 +332,7 @@ function spliceEntry(raw, containerKey, entry) {
265
332
  }
266
333
  return (
267
334
  raw.slice(0, at) +
268
- `${eol}${indent}${JSON.stringify(key)}: ${format(value, indent)}${tail}` +
335
+ `${eol}${indent}${JSON.stringify(key)}: ${format(value, indent, columns(`${indent}${JSON.stringify(key)}: `))}${tail}` +
269
336
  raw.slice(at)
270
337
  );
271
338
  };
@@ -374,7 +441,7 @@ export function ensureEntry(path, containerKey, entry, label, root) {
374
441
  config[containerKey][MCP_SERVER_NAME] = entry;
375
442
  try {
376
443
  if (raw === null) {
377
- writeJson(path, config);
444
+ writeJson(path, config, projectIndent(root ?? dirname(path)));
378
445
  } else {
379
446
  const next = spliceEntry(raw, containerKey, entry);
380
447
  // The splice must read back as exactly the merged config, or the
@@ -17,7 +17,8 @@
17
17
  * Dialog ids ride the same scan as two more families: `v-bb-dialog`
18
18
  * / `v-bb-off-canvas` with `"'id'"` or `{ id: 'id' }`, and
19
19
  * `useBbDialog('id')` / `useBbOffCanvas('id')` in a script,
20
- * against `<BbDialog | BbOffCanvas id="x">`. One finding, `unknown-dialog`
20
+ * against `<BbDialog | BbOffCanvas id="x">`, or the same on a
21
+ * `definePreset(BbDialog, …)` wrapper. One finding, `unknown-dialog`
21
22
  * (error): the id is declared nowhere, or by the other family. Never an
22
23
  * unused one: a dialog driven by its `v-model` legitimately has an id
23
24
  * nothing opens. A `:id` with a static head (`` `row-${n}` ``, `'row-' + n`)
@@ -91,6 +92,53 @@ export const PORTAL_FAMILIES = {
91
92
  const FAMILY_BY_COMPONENT = new Map(
92
93
  Object.entries(PORTAL_FAMILIES).map(([family, f]) => [f.component, family])
93
94
  );
95
+
96
+ /**
97
+ * the `definePreset(BbDialog, …)` wrappers a file defines,
98
+ * as tag → base, for the families this scan judges: a named `const X =
99
+ * definePreset(Bb…)`, and an anonymous `export default definePreset(Bb…)`,
100
+ * whose tag is the file's name (`AppSeparatedDialog.ts`), as an import or an
101
+ * auto-import names it.
102
+ * @param {string} code
103
+ * @param {string} path
104
+ */
105
+ export function familyPresets(code, path) {
106
+ const out = new Map();
107
+ if (!code.includes('definePreset')) return out;
108
+ const keep = (tag, base) => {
109
+ if (FAMILY_BY_COMPONENT.has(base)) out.set(tag, base);
110
+ };
111
+ for (const [, tag, base] of code.matchAll(
112
+ /\b(?:const|let|var)\s+([A-Z][\w$]*)\s*(?::[^=]+)?=\s*definePreset\s*(?:<[^>()]*>)?\s*\(\s*(Bb[A-Za-z]+)\b/g
113
+ ))
114
+ keep(tag, base);
115
+ const anonymous =
116
+ /\bexport\s+default\s+definePreset\s*(?:<[^>()]*>)?\s*\(\s*(Bb[A-Za-z]+)\b/.exec(
117
+ code
118
+ );
119
+ if (anonymous) {
120
+ const file = /([^/\\]+?)(?:\.[cm]?[jt]sx?|\.vue)$/.exec(path)?.[1];
121
+ if (file) keep(pascal(file), anonymous[1]);
122
+ }
123
+ return out;
124
+ }
125
+
126
+ /**
127
+ * The preset tags a `.vue` file can use: the project's, plus a default
128
+ * import renamed on the way in (`import Edit from './AppSeparatedDialog'`).
129
+ */
130
+ const presetsIn = (scripts, presets) => {
131
+ if (!presets?.size) return presets;
132
+ const out = new Map(presets);
133
+ for (const [, local, from] of scripts.matchAll(
134
+ /\bimport\s+([A-Z][\w$]*)\s+from\s+['"]([^'"]+)['"]/g
135
+ )) {
136
+ const file = /([^/\\]+?)(?:\.[cm]?[jt]sx?|\.vue)?$/.exec(from)?.[1];
137
+ const base = file && presets.get(pascal(file));
138
+ if (base) out.set(local, base);
139
+ }
140
+ return out;
141
+ };
94
142
  const FAMILY_BY_DIRECTIVE = new Map(
95
143
  Object.entries(PORTAL_FAMILIES)
96
144
  .filter(([, f]) => f.directive)
@@ -365,8 +413,9 @@ const declarationName = (node, attr = 'name', optional = false) => {
365
413
  * The portal sites of one file.
366
414
  * @param {string} code
367
415
  * @param {string} [path] decides `.vue` vs a script file
416
+ * @param {Map<string, string>} [presets] preset tag → base
368
417
  */
369
- export function fileSites(code, path = 'x.vue') {
418
+ export function fileSites(code, path = 'x.vue', presets = new Map()) {
370
419
  const sites = {
371
420
  declarations: [],
372
421
  calls: [],
@@ -388,11 +437,19 @@ export function fileSites(code, path = 'x.vue') {
388
437
  }
389
438
  for (const block of [descriptor.script, descriptor.scriptSetup])
390
439
  if (block) scriptSites(block.content, block.loc.start.line, code, sites);
440
+ const tags = presetsIn(
441
+ [descriptor.script, descriptor.scriptSetup]
442
+ .map((block) => block?.content ?? '')
443
+ .join('\n'),
444
+ new Map([...presets, ...familyPresets(code, path)])
445
+ );
391
446
 
392
447
  const walkTemplate = (node) => {
393
448
  if (!node || typeof node !== 'object') return;
394
449
  if (node.type === NODE_ELEMENT) {
395
- const family = FAMILY_BY_COMPONENT.get(pascal(node.tag));
450
+ const tag = pascal(node.tag);
451
+ const family =
452
+ FAMILY_BY_COMPONENT.get(tag) ?? FAMILY_BY_COMPONENT.get(tags.get(tag));
396
453
  if (family) {
397
454
  const f = PORTAL_FAMILIES[family];
398
455
  const declared = declarationName(node, f.attr, !!f.ids);
@@ -452,22 +509,28 @@ const cache = new Map();
452
509
  export function projectPortalIndex(projectRoot) {
453
510
  if (cache.has(projectRoot)) return cache.get(projectRoot);
454
511
  const index = emptyIndex();
512
+ const sources = [];
455
513
  for (const path of walk(projectRoot)) {
456
514
  if (path.endsWith('.d.ts') || !SOURCE.test(path)) continue;
457
- let code;
458
515
  try {
459
- code = readFileSync(path, 'utf-8');
516
+ sources.push([path, readFileSync(path, 'utf-8')]);
460
517
  } catch {
461
518
  continue;
462
519
  }
463
- if (!MAY_HAVE_PORTALS.test(code)) {
520
+ }
521
+ // a `definePreset(BbDialog, …)` tag declares ids too.
522
+ for (const [path, code] of sources)
523
+ for (const [tag, base] of familyPresets(code, path))
524
+ index.presets.set(tag, base);
525
+ for (const [path, code] of sources) {
526
+ if (!MAY_HAVE_PORTALS.test(code) && !hasPresetTag(code, index.presets)) {
464
527
  // Still a source of string literals for `unused-portal`.
465
528
  literalsIn(code, index.literals);
466
529
  for (const [, value] of code.matchAll(/`([^`$\\\n]{1,120})`/g))
467
530
  index.literals.add(value);
468
531
  continue;
469
532
  }
470
- addSites(index, fileSites(code, path), path);
533
+ addSites(index, fileSites(code, path, index.presets), path);
471
534
  }
472
535
  for (const name of configuredExternalDialogIds(projectRoot))
473
536
  for (const family of Object.keys(PORTAL_FAMILIES))
@@ -519,9 +582,16 @@ function emptyIndex() {
519
582
  literals: new Set(),
520
583
  /** family → id prefixes a template-literal `:id` covers */
521
584
  prefixes: new Map(),
585
+ /** preset tag → its Bb* base */
586
+ presets: new Map(),
522
587
  };
523
588
  }
524
589
 
590
+ const hasPresetTag = (code, presets) => {
591
+ for (const tag of presets.keys()) if (code.includes(tag)) return true;
592
+ return false;
593
+ };
594
+
525
595
  function addSites(index, sites, path) {
526
596
  for (const { family, name } of sites.declarations) {
527
597
  const byName = index.declared.get(family);
@@ -561,7 +631,7 @@ const declaration = (family, name) =>
561
631
  * @param {ReturnType<typeof projectPortalIndex> | null} index
562
632
  */
563
633
  export function portalFindings(code, path, index) {
564
- const sites = fileSites(code, path);
634
+ const sites = fileSites(code, path, index?.presets);
565
635
  if (!sites.calls.length && !sites.declarations.length) return [];
566
636
  const merged = emptyIndex();
567
637
  if (index) {
@@ -310,17 +310,20 @@ function mergeStep(next) {
310
310
  * (release:check --plan says so and passes), so they cannot stay owed.
311
311
  * `base` keeps the full run the reruns started from, and `warn` is
312
312
  * re-derived from the merged steps, not the rerun's alone.
313
+ * A step kept from `previous` is marked `kept: true`: the rerun did not run
314
+ * it, so `gate --stats` (wall-stats.mjs) does not count its seconds again.
313
315
  */
314
316
  export function mergeRerun(previous, rerun) {
315
317
  const byName = new Map(rerun.steps.map((s) => [s.name, s]));
318
+ const kept = (s) => ({ ...s, kept: true });
316
319
  const steps = previous.steps.map((prev) => {
317
320
  const next = byName.get(prev.name);
318
- if (!next) return prev;
321
+ if (!next) return kept(prev);
319
322
  if (WALL_RECORD_STEPS.has(prev.name) && next.sub?.length && prev.sub) {
320
323
  const subNext = new Map(next.sub.map((s) => [s.name, s]));
321
324
  const known = new Set(prev.sub.map((p) => p.name));
322
325
  const sub = prev.sub.map((p) =>
323
- subNext.has(p.name) ? mergeStep(subNext.get(p.name)) : p
326
+ subNext.has(p.name) ? mergeStep(subNext.get(p.name)) : kept(p)
324
327
  );
325
328
  for (const s of next.sub) if (!known.has(s.name)) sub.push(mergeStep(s));
326
329
  const status = sub.some(owed) ? 'FAIL' : 'pass';
@@ -336,10 +339,107 @@ export function mergeRerun(previous, rerun) {
336
339
  steps,
337
340
  ok: steps.every((s) => !owed(s)),
338
341
  warn: collectWarn(steps),
339
- base: previous.base ?? {
340
- sha: previous.sha,
341
- finishedAt: previous.finishedAt,
342
- },
342
+ base: previous.base ?? runEvidence(previous),
343
+ };
344
+ }
345
+
346
+ // ---------------------------------------------------------------------------
347
+ // A rerun that earns the release pass.
348
+ // ---------------------------------------------------------------------------
349
+
350
+ const stepEvidence = (s) => ({
351
+ name: s.name,
352
+ status: s.status,
353
+ ...(s.failedFiles?.length ? { failedFiles: s.failedFiles } : {}),
354
+ ...(s.whole ? { whole: true } : {}),
355
+ ...(s.sub ? { sub: s.sub.map(stepEvidence) } : {}),
356
+ });
357
+
358
+ /**
359
+ * What a rerun may lean on from the last FULL release:local run: its
360
+ * commit, time, dist/ hash, rule versions and each step's outcome (with the
361
+ * wall's steps inside release:check). A record that is not a full run gives
362
+ * only `{ sha, finishedAt }`, which no rerun can earn a pass from.
363
+ */
364
+ export function runEvidence(record) {
365
+ if (record?.mode !== 'full')
366
+ return { sha: record?.sha, finishedAt: record?.finishedAt };
367
+ return {
368
+ sha: record.sha,
369
+ finishedAt: record.finishedAt,
370
+ distHash: record.distHash ?? null,
371
+ scopeVersion: record.scopeVersion ?? null,
372
+ gateVersion: record.gateVersion ?? null,
373
+ steps: record.steps.filter(Boolean).map(stepEvidence),
374
+ };
375
+ }
376
+
377
+ /** The full run a rerun starts from: the record itself, or the base it kept. */
378
+ export const rerunBase = (previous) =>
379
+ previous?.mode === 'full' ? runEvidence(previous) : (previous?.base ?? null);
380
+
381
+ /**
382
+ * Why a rerun on `sha` cannot earn the pass from `base` (first match), or
383
+ * null. `isAncestor(a, b)` and the versions come from the caller.
384
+ */
385
+ export function rerunRefusal(
386
+ base,
387
+ { sha, isAncestor, gateVersion, scopeVersion, now = Date.now(), maxAgeDays }
388
+ ) {
389
+ if (!base?.steps)
390
+ return 'the last full run has no step record a rerun can lean on (it ran before reruns could earn the pass)';
391
+ if (!base.distHash)
392
+ return base.scopeVersion == null
393
+ ? `the last full run (${String(base.sha).slice(0, 10)}) was recorded before reruns could earn the pass (no dist/ hash in it)`
394
+ : `the last full run (${String(base.sha).slice(0, 10)}) recorded no dist/ hash (its build did not finish green)`;
395
+ if (!isAncestor(base.sha, sha))
396
+ return `the last full run (${String(base.sha).slice(0, 10)}) is not an ancestor of ${sha.slice(0, 10)}`;
397
+ const days = (now - Date.parse(base.finishedAt)) / 86_400_000;
398
+ if (!(days <= maxAgeDays))
399
+ return `the last full run is ${Math.floor(days)} days old (more than ${maxAgeDays})`;
400
+ if (base.gateVersion !== gateVersion)
401
+ return `the last full run used gate version ${base.gateVersion}, this commit ${gateVersion}`;
402
+ if (base.scopeVersion !== scopeVersion)
403
+ return `the last full run used scope rule version ${base.scopeVersion}, this commit ${scopeVersion}`;
404
+ return null;
405
+ }
406
+
407
+ /** A step's outcome on the base run, inside release:check's wall too. */
408
+ export function baseStatus(base, name, sub = null) {
409
+ const step = base?.steps?.find((s) => s.name === name);
410
+ if (!sub) return step ?? null;
411
+ return step?.sub?.find((s) => s.name === sub) ?? null;
412
+ }
413
+
414
+ const BROWSER_CHUNKED = 'test: browser (chunked)';
415
+ const GREGORIAN = 'test: browser (Gregorian-only build)';
416
+
417
+ /**
418
+ * The scope a pass-earning rerun hands release:check: the change's scope
419
+ * (scope.mjs, A..HEAD) plus every chunked file A failed, and the Gregorian
420
+ * tier when A's was not green. `null` = run the browser tier whole (A never
421
+ * ran it, or a chunked red there named no files).
422
+ */
423
+ export function rerunScope(scope, base) {
424
+ const wall = baseStatus(base, 'release:check:browser');
425
+ const chunked = baseStatus(base, 'release:check:browser', BROWSER_CHUNKED);
426
+ if (!wall || wall.status === 'not run' || !wall.sub || !chunked) return null;
427
+ if (chunked.status !== 'pass' && (chunked.whole || !chunked.failedFiles))
428
+ return null;
429
+ const failed = chunked.status === 'pass' ? [] : chunked.failedFiles;
430
+ const affected = [...new Set([...(scope.affected ?? []), ...failed])].sort();
431
+ const gregorianStep = baseStatus(base, 'release:check:browser', GREGORIAN);
432
+ const gregorian =
433
+ Boolean(scope.gregorian) || gregorianStep?.status !== 'pass';
434
+ return {
435
+ ...scope,
436
+ // A `none` scope runs no browser tier at all: anything A still owes
437
+ // there makes it `scoped` (an empty list then runs every chunk, which
438
+ // the chunked runner does to fail closed).
439
+ kind: affected.length || gregorian ? 'scoped' : scope.kind,
440
+ affected,
441
+ gregorian,
442
+ baseFailed: failed,
343
443
  };
344
444
  }
345
445
 
@@ -360,3 +460,50 @@ export function owedLines(steps, indent = ' ') {
360
460
  export function existingFiles(files, root, exists = existsSync) {
361
461
  return files.filter((f) => exists(path.join(root, f)));
362
462
  }
463
+
464
+ /**
465
+ * The fixture, consumer and eval steps: they test the packed dist/, so a
466
+ * byte-identical dist/ may carry their result (scope-plan.mjs carryOver).
467
+ */
468
+ export const DIST_CONSUMERS = new Set([
469
+ 'fixtures:install',
470
+ 'eval:prepare',
471
+ 'consumer:strict',
472
+ 'consumer:typecheck',
473
+ 'consumer:build',
474
+ 'test:fixtures',
475
+ 'eval:references',
476
+ ]);
477
+
478
+ /**
479
+ * Whether a scoped release step rides over from its base, for `--scoped`
480
+ * (a full release pass: every step passed) and for a pass-earning rerun
481
+ * (`run`: the full run A's evidence, where only the steps it PASSED may
482
+ * carry). `carry()` is the dist/ verdict (carryOver), asked only for a
483
+ * dist consumer. Returns `{ carried: note }`, `{ files }` (test:engines red
484
+ * on A and unaffected since: only A's failed files), `{ runs: why }` for a
485
+ * dist consumer that must run, or null (the step runs as usual).
486
+ */
487
+ export function carryDecision(name, { run = null, scope, carry, label }) {
488
+ const green = !run || baseStatus(run, name)?.status === 'pass';
489
+ if (DIST_CONSUMERS.has(name)) {
490
+ const verdict = carry();
491
+ if (verdict.carry && green)
492
+ return { carried: `carried from ${label}: ${verdict.reason}` };
493
+ return { runs: green ? verdict.reason : `it did not pass on ${label}` };
494
+ }
495
+ if (name === 'test:engines' && !scope.engines) {
496
+ if (green)
497
+ return {
498
+ carried: `carried from ${label}: no affected file is in the engines set`,
499
+ };
500
+ const onRun = baseStatus(run, name);
501
+ if (onRun?.status === 'FAIL' && !onRun.whole && onRun.failedFiles?.length)
502
+ return { files: onRun.failedFiles };
503
+ }
504
+ if (name === 'test:dates' && !scope.gregorian && green)
505
+ return {
506
+ carried: `carried from ${label}: no date-family file is affected`,
507
+ };
508
+ return null;
509
+ }