bitboss-ui 3.0.0-beta.70 → 3.0.0-beta.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/cli.mjs +6 -1
- package/dist/ai/BbAccordion.md +38 -19
- package/dist/ai/BbBadge.md +25 -22
- package/dist/ai/BbBreadcrumbs.md +4 -1
- package/dist/ai/BbButton.md +32 -27
- package/dist/ai/BbCalendar.md +1 -0
- package/dist/ai/BbCarousel.md +6 -4
- package/dist/ai/BbCheckbox.md +5 -6
- package/dist/ai/BbCheckboxGroup.md +27 -27
- package/dist/ai/BbColorInput.md +4 -5
- package/dist/ai/BbConfirm.md +65 -81
- package/dist/ai/BbConfirmPortal.md +2 -2
- package/dist/ai/BbDatePicker.md +1 -6
- package/dist/ai/BbDatePickerInput.md +5 -6
- package/dist/ai/BbDialog.md +230 -164
- package/dist/ai/BbDropdown.md +87 -17
- package/dist/ai/BbDropdownButton.md +15 -15
- package/dist/ai/BbDropzone.md +12 -8
- package/dist/ai/BbForm.md +93 -7
- package/dist/ai/BbHost.md +2 -2
- package/dist/ai/BbHoverCardPortal.md +1 -1
- package/dist/ai/BbIcon.md +1 -1
- package/dist/ai/BbIndicator.md +17 -15
- package/dist/ai/BbNumberInput.md +10 -9
- package/dist/ai/BbOffCanvas.md +29 -7
- package/dist/ai/BbPagination.md +2 -2
- package/dist/ai/BbPopover.md +15 -9
- package/dist/ai/BbPopoverPortal.md +1 -1
- package/dist/ai/BbRadio.md +5 -6
- package/dist/ai/BbRadioGroup.md +53 -37
- package/dist/ai/BbRating.md +11 -16
- package/dist/ai/BbSelect.md +25 -5
- package/dist/ai/BbSelectPopover.md +9 -3
- package/dist/ai/BbSlider.md +15 -17
- package/dist/ai/BbSpinner.md +3 -2
- package/dist/ai/BbSwitch.md +9 -9
- package/dist/ai/BbSwitchGroup.md +11 -13
- package/dist/ai/BbTable.md +205 -82
- package/dist/ai/BbTabs.md +29 -4
- package/dist/ai/BbTag.md +4 -5
- package/dist/ai/BbTextInput.md +18 -16
- package/dist/ai/BbTextarea.md +12 -11
- package/dist/ai/BbTimePickerInput.md +4 -5
- package/dist/ai/BbToast.md +3 -2
- package/dist/ai/BbTooltip.md +39 -30
- package/dist/ai/BbTree.md +49 -24
- package/dist/ai/CommonField.md +2 -10
- package/dist/ai/CommonFieldInput.md +1 -1
- package/dist/ai/OptionsContainer.md +5 -13
- package/dist/ai/changelog.json +278 -10
- package/dist/ai/components.json +59 -58
- package/dist/ai/composables/useBbDialog.md +5 -8
- package/dist/ai/composables/useBbForm.md +3 -0
- package/dist/ai/composables/useConfirm.md +65 -56
- package/dist/ai/composables/useToast.md +2 -1
- package/dist/ai/guides/agent-contract.md +3 -3
- package/dist/ai/guides/app-layout.md +3 -2
- package/dist/ai/guides/eslint-rules.md +3 -1
- package/dist/ai/guides/fetch-items-playbook.md +1 -1
- package/dist/ai/guides/floating-bottom-panel.md +3 -2
- package/dist/ai/guides/icons-policy.md +7 -5
- package/dist/ai/guides/inertia-helpers.md +35 -30
- package/dist/ai/guides/installation-and-plugin-setup.md +17 -14
- package/dist/ai/guides/migration/adoption-checklist.md +2 -2
- package/dist/ai/guides/migration/components/bb-badge.md +12 -1
- package/dist/ai/guides/migration/components/bb-button.md +24 -0
- package/dist/ai/guides/migration/components/bb-dropdown-button.md +11 -0
- package/dist/ai/guides/migration/components/bb-tabs.md +2 -2
- package/dist/ai/guides/migration/components/bb-toast.md +11 -0
- package/dist/ai/guides/migration/components/use-confirm.md +69 -26
- package/dist/ai/guides/migration/v2-to-v3.md +78 -12
- package/dist/ai/guides/migration/v3-beta-css-classes.md +1 -1
- package/dist/ai/guides/options-items-playbook.md +4 -3
- package/dist/ai/guides/passthrough.md +2 -2
- package/dist/ai/guides/preset-components.md +35 -10
- package/dist/ai/helpers/definePreset.json +8 -1
- package/dist/ai/helpers/definePreset.ts +35 -10
- package/dist/ai/helpers/inertia/manifest.json +28 -15
- package/dist/ai/helpers/inertia/messages.ts +3 -3
- package/dist/ai/helpers/inertia/useConfirmOnRouteLeave.ts +10 -10
- package/dist/ai/helpers/inertia/usePromiseForm.ts +1 -1
- package/dist/ai/helpers/inertia/usePromiseRouter.ts +7 -2
- package/dist/ai/index.md +3 -3
- package/dist/ai/manifest/common.json +5 -5
- package/dist/ai/manifest/components/BbAccordion.json +8 -5
- package/dist/ai/manifest/components/BbAccordion.tree.json +1 -0
- package/dist/ai/manifest/components/BbBadge.json +8 -7
- package/dist/ai/manifest/components/BbBadge.removed.json +3 -1
- package/dist/ai/manifest/components/BbBadge.tree.json +73 -0
- package/dist/ai/manifest/components/BbBreadcrumbs.json +2 -2
- package/dist/ai/manifest/components/BbButton.json +5 -6
- package/dist/ai/manifest/components/BbButton.removed.json +3 -1
- package/dist/ai/manifest/components/BbButton.tree.json +24 -7
- package/dist/ai/manifest/components/BbCalendar.json +2 -1
- package/dist/ai/manifest/components/BbCheckbox.json +2 -2
- package/dist/ai/manifest/components/BbCheckbox.tree.json +1 -1
- package/dist/ai/manifest/components/BbCheckboxGroup.json +2 -2
- package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +9 -19
- package/dist/ai/manifest/components/BbColorInput.json +3 -3
- package/dist/ai/manifest/components/BbColorInput.tree.json +2 -2
- package/dist/ai/manifest/components/BbConfirm.json +2 -2
- package/dist/ai/manifest/components/BbConfirm.removed.json +9 -0
- package/dist/ai/manifest/components/BbConfirm.tree.json +4 -5
- package/dist/ai/manifest/components/BbConfirmPortal.json +3 -3
- package/dist/ai/manifest/components/BbConfirmPortal.removed.json +7 -0
- package/dist/ai/manifest/components/BbDatePicker.json +2 -1
- package/dist/ai/manifest/components/BbDatePicker.tree.json +0 -6
- package/dist/ai/manifest/components/BbDatePickerInput.json +2 -2
- package/dist/ai/manifest/components/BbDatePickerInput.tree.json +2 -2
- package/dist/ai/manifest/components/BbDialog.json +6 -1
- package/dist/ai/manifest/components/BbDialog.tree.json +41 -1
- package/dist/ai/manifest/components/BbDropdown.json +10 -9
- package/dist/ai/manifest/components/BbDropdown.tree.json +4 -0
- package/dist/ai/manifest/components/BbDropdownButton.json +9 -10
- package/dist/ai/manifest/components/BbDropdownButton.removed.json +3 -1
- package/dist/ai/manifest/components/BbForm.json +3 -1
- package/dist/ai/manifest/components/BbNumberInput.json +1 -1
- package/dist/ai/manifest/components/BbNumberInput.tree.json +2 -2
- package/dist/ai/manifest/components/BbOffCanvas.json +6 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +40 -0
- package/dist/ai/manifest/components/BbPagination.json +1 -1
- package/dist/ai/manifest/components/BbRadio.tree.json +1 -1
- package/dist/ai/manifest/components/BbRadioGroup.json +4 -3
- package/dist/ai/manifest/components/BbRadioGroup.tree.json +8 -18
- package/dist/ai/manifest/components/BbRating.json +2 -2
- package/dist/ai/manifest/components/BbRating.tree.json +1 -1
- package/dist/ai/manifest/components/BbSelect.json +2 -1
- package/dist/ai/manifest/components/BbSelect.tree.json +2 -2
- package/dist/ai/manifest/components/BbSelectPopover.json +1 -0
- package/dist/ai/manifest/components/BbSlider.tree.json +1 -1
- package/dist/ai/manifest/components/BbSwitch.json +4 -4
- package/dist/ai/manifest/components/BbSwitch.tree.json +1 -1
- package/dist/ai/manifest/components/BbSwitchGroup.json +7 -7
- package/dist/ai/manifest/components/BbSwitchGroup.tree.json +2 -2
- package/dist/ai/manifest/components/BbTable.json +15 -14
- package/dist/ai/manifest/components/BbTable.tree.json +2 -0
- package/dist/ai/manifest/components/BbTabs.json +3 -3
- package/dist/ai/manifest/components/BbTabsList.json +1 -1
- package/dist/ai/manifest/components/BbTabsRoot.json +1 -1
- package/dist/ai/manifest/components/BbTag.json +1 -1
- package/dist/ai/manifest/components/BbTag.tree.json +2 -2
- package/dist/ai/manifest/components/BbTextInput.json +1 -1
- package/dist/ai/manifest/components/BbTextInput.tree.json +2 -2
- package/dist/ai/manifest/components/BbTextarea.json +1 -1
- package/dist/ai/manifest/components/BbTextarea.tree.json +2 -2
- package/dist/ai/manifest/components/BbTimePicker.json +1 -1
- package/dist/ai/manifest/components/BbTimePickerInput.json +1 -1
- package/dist/ai/manifest/components/BbTimePickerInput.tree.json +2 -2
- package/dist/ai/manifest/components/BbToast.removed.json +2 -1
- package/dist/ai/manifest/components/BbTooltip.json +1 -1
- package/dist/ai/manifest/components/BbTooltip.tree.json +2 -2
- package/dist/ai/manifest/components/BbTree.json +2 -2
- package/dist/ai/manifest/components/CommonField.tree.json +5 -10
- package/dist/ai/manifest/components/CommonFieldInput.tree.json +3 -3
- package/dist/ai/manifest/components/OptionsContainer.tree.json +5 -13
- package/dist/ai/manifest/index.json +4 -4
- package/dist/ai/manifest/meta.json +5 -1
- package/dist/ai/manifest/types.advanced.json +9 -9
- package/dist/ai/manifest/types.api.json +7 -6
- package/dist/ai/recipes/inertia/approvals-inbox.md +23 -16
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +12 -5
- package/dist/ai/recipes/inertia/layout-scaffold.md +5 -3
- package/dist/ai/recipes/inertia/onboarding.md +23 -12
- package/dist/ai/recipes/inertia/ownership-atlas.md +34 -18
- package/dist/ai/recipes/inertia/record-form.md +12 -8
- package/dist/ai/recipes/inertia/records-workspace.md +14 -7
- package/dist/ai/recipes/inertia/settings-workspace.md +75 -60
- package/dist/ai/recipes/inertia/upload-center.md +17 -9
- package/dist/ai/recipes/inertia/wizard-form.md +2 -2
- package/dist/ai/recipes/nuxt/approvals-inbox.md +23 -16
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +12 -5
- package/dist/ai/recipes/nuxt/layout-scaffold.md +5 -3
- package/dist/ai/recipes/nuxt/onboarding.md +5 -4
- package/dist/ai/recipes/nuxt/ownership-atlas.md +34 -18
- package/dist/ai/recipes/nuxt/record-form.md +14 -10
- package/dist/ai/recipes/nuxt/records-workspace.md +14 -7
- package/dist/ai/recipes/nuxt/settings-workspace.md +70 -60
- package/dist/ai/recipes/nuxt/upload-center.md +17 -9
- package/dist/ai/recipes/nuxt/wizard-form.md +4 -4
- package/dist/ai/recipes/vue/approvals-inbox.md +23 -16
- package/dist/ai/recipes/vue/inline-edit-workspace.md +12 -5
- package/dist/ai/recipes/vue/layout-scaffold.md +5 -3
- package/dist/ai/recipes/vue/onboarding.md +5 -4
- package/dist/ai/recipes/vue/ownership-atlas.md +34 -18
- package/dist/ai/recipes/vue/record-form.md +14 -10
- package/dist/ai/recipes/vue/records-workspace.md +14 -7
- package/dist/ai/recipes/vue/settings-workspace.md +70 -60
- package/dist/ai/recipes/vue/upload-center.md +17 -9
- package/dist/ai/recipes/vue/wizard-form.md +4 -4
- package/dist/ai/source/BbAccordion.md +50 -16
- package/dist/ai/source/BbBadge.md +420 -26
- package/dist/ai/source/BbBadgeButton.md +378 -12
- package/dist/ai/source/BbBreadcrumbs.md +31 -12
- package/dist/ai/source/BbButton.md +205 -55
- package/dist/ai/source/BbCalendar.md +5 -0
- package/dist/ai/source/BbCheckbox.md +36 -42
- package/dist/ai/source/BbCheckboxGroup.md +40 -17
- package/dist/ai/source/BbColorInput.md +2 -4
- package/dist/ai/source/BbConfigScope.md +19 -2
- package/dist/ai/source/BbConfirm.md +74 -80
- package/dist/ai/source/BbConfirmPortal.md +6 -6
- package/dist/ai/source/BbDatePicker.md +9 -2
- package/dist/ai/source/BbDatePickerInput.md +5 -5
- package/dist/ai/source/BbDialog.md +53 -2
- package/dist/ai/source/BbDropdown.md +360 -99
- package/dist/ai/source/BbDropdownButton.md +24 -13
- package/dist/ai/source/BbDropdownGroup.md +145 -60
- package/dist/ai/source/BbForm.md +144 -10
- package/dist/ai/source/BbNumberInput.md +2 -4
- package/dist/ai/source/BbOffCanvas.md +53 -2
- package/dist/ai/source/BbPagination.md +1 -1
- package/dist/ai/source/BbRadio.md +36 -42
- package/dist/ai/source/BbRadioGroup.md +74 -14
- package/dist/ai/source/BbRating.md +32 -36
- package/dist/ai/source/BbSelect.md +40 -13
- package/dist/ai/source/BbSelectPopover.md +105 -34
- package/dist/ai/source/BbSlider.md +2 -4
- package/dist/ai/source/BbSwitch.md +57 -46
- package/dist/ai/source/BbSwitchGroup.md +67 -21
- package/dist/ai/source/BbTable.md +363 -49
- package/dist/ai/source/BbTabs.md +6 -0
- package/dist/ai/source/BbTabsList.md +10 -0
- package/dist/ai/source/BbTabsPanels.md +6 -0
- package/dist/ai/source/BbTabsRoot.md +6 -0
- package/dist/ai/source/BbTag.md +2 -4
- package/dist/ai/source/BbTextInput.md +2 -4
- package/dist/ai/source/BbTextarea.md +2 -4
- package/dist/ai/source/BbTimePickerInput.md +2 -4
- package/dist/ai/source/BbTooltip.md +9 -3
- package/dist/ai/source/BbTree.md +14 -4
- package/dist/ai/source/CommonField.md +17 -106
- package/dist/ai/source/CommonFieldInput.md +2 -1
- package/dist/ai/source/GuidesComponent.md +3 -0
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +7 -3
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +52 -38
- package/dist/components/BbAccordion/ptKeys.generated.d.ts +20 -0
- package/dist/components/BbAccordion/types.d.ts +21 -7
- package/dist/components/BbAccordion/types.js +1 -1
- package/dist/components/BbAlert/BbAlert.vue.d.ts +1 -1
- package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/BbBadge/BbBadge.vue.d.ts +1 -1
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +65 -42
- package/dist/components/BbBadge/types.d.ts +15 -12
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +106 -106
- package/dist/components/BbBreadcrumbs/types.d.ts +6 -0
- package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +79 -73
- package/dist/components/BbButton/types.d.ts +7 -6
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +2 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/BbCalendar/types.d.ts +5 -0
- package/dist/components/BbCalendar/useCalendarGrid.js +1 -1
- package/dist/components/BbCalendar/useDayGrid.js +1 -1
- package/dist/components/BbCheckbox/types.d.ts +2 -4
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +10 -4
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/BbCheckboxGroup/types.d.ts +4 -6
- package/dist/components/BbColorInput/types.d.ts +2 -4
- package/dist/components/BbConfigScope/BbConfigScope.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +71 -132
- package/dist/components/BbConfirm/ptKeys.generated.d.ts +5 -5
- package/dist/components/BbConfirm/types.d.ts +5 -5
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +2 -1
- package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +3 -0
- package/dist/components/BbDatePicker/types.d.ts +5 -0
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +1 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/components/BbDatePickerInput/types.d.ts +4 -5
- package/dist/components/BbDialog/BbDialog.vue.d.ts +3 -0
- package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +263 -235
- package/dist/components/BbDialog/overlayActions.js +94 -0
- package/dist/components/BbDialog/types.d.ts +24 -0
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +384 -332
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +121 -120
- package/dist/components/BbDropdown/dropdownHandle.js +6 -0
- package/dist/components/BbDropdown/normalizeGroups.js +58 -44
- package/dist/components/BbDropdown/types.d.ts +116 -50
- package/dist/components/BbDropdown/types.js +2 -2
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +105 -104
- package/dist/components/BbDropdownButton/types.d.ts +2 -4
- package/dist/components/BbForm/BbForm.vue.d.ts +2 -1
- package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +240 -198
- package/dist/components/BbForm/recognizeValidation.d.ts +9 -0
- package/dist/components/BbForm/recognizeValidation.js +55 -0
- package/dist/components/BbForm/validationError.d.ts +10 -0
- package/dist/components/BbForm/validationError.js +11 -0
- package/dist/components/BbNumberInput/types.d.ts +2 -4
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +3 -0
- package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +414 -389
- package/dist/components/BbOffCanvas/sheetAttrs.js +5 -5
- package/dist/components/BbOffCanvas/types.d.ts +24 -0
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/BbRadio/types.d.ts +2 -4
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +10 -4
- package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +173 -157
- package/dist/components/BbRadioGroup/types.d.ts +11 -7
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +126 -119
- package/dist/components/BbRating/types.d.ts +5 -6
- package/dist/components/BbSelect/BbSelect.vue.d.ts +17 -10
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/BbSelect/types.d.ts +12 -6
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +11 -4
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +513 -502
- package/dist/components/BbSelectPopover/types.d.ts +10 -2
- package/dist/components/BbSlider/types.d.ts +2 -4
- package/dist/components/BbSwitch/BbSwitch.vue.d.ts +2 -0
- package/dist/components/BbSwitch/BbSwitch.vue_vue_type_script_setup_true_lang.js +85 -73
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +10 -4
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +171 -152
- package/dist/components/BbSwitchGroup/types.d.ts +1 -1
- package/dist/components/BbTable/BbTable.vue.d.ts +36 -25
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1338 -1215
- package/dist/components/BbTable/BbTableDataRow.js +2 -1
- package/dist/components/BbTable/BbTableRowMenu.js +36 -0
- package/dist/components/BbTable/types.d.ts +33 -18
- package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/BbTabs/types.d.ts +6 -0
- package/dist/components/BbTag/types.d.ts +2 -4
- package/dist/components/BbTextInput/BbTextInput.vue.d.ts +1 -1
- package/dist/components/BbTextInput/types.d.ts +2 -4
- package/dist/components/BbTextarea/BbTextarea.vue.d.ts +1 -1
- package/dist/components/BbTextarea/types.d.ts +2 -4
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +1 -1
- package/dist/components/BbTimePickerInput/types.d.ts +2 -4
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +88 -94
- package/dist/components/BbTooltip/ptKeys.generated.d.ts +4 -4
- package/dist/components/BbTooltip/types.d.ts +3 -1
- package/dist/components/BbTree/BbTree.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/components/BbTree/types.d.ts +8 -2
- package/dist/components/CommonField/types.d.ts +2 -4
- package/dist/components/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +39 -39
- package/dist/composables/formSubmitLock.js +15 -8
- package/dist/composables/overlayRegistry.d.ts +5 -0
- package/dist/composables/overlayRegistry.js +154 -148
- package/dist/composables/useBbDropdown.d.ts +8 -0
- package/dist/composables/useBbDropdown.js +3 -1
- package/dist/composables/useBbTabs.js +138 -138
- package/dist/composables/useChoiceIndicator.js +67 -64
- package/dist/composables/useConfirm.d.ts +63 -52
- package/dist/composables/useConfirm.js +22 -18
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/directives/bbDropdown.d.ts +7 -7
- package/dist/directives/bbDropdown.js +22 -15
- package/dist/directives/bbTooltip.d.ts +3 -3
- package/dist/directives/createPopoverDirective.js +57 -35
- package/dist/i18n/locales/ar.json +5 -1
- package/dist/i18n/locales/cs.json +5 -1
- package/dist/i18n/locales/da.json +5 -1
- package/dist/i18n/locales/de-CH.json +5 -1
- package/dist/i18n/locales/de.json +5 -1
- package/dist/i18n/locales/el.json +5 -1
- package/dist/i18n/locales/en-GB.json +5 -1
- package/dist/i18n/locales/en.json +5 -1
- package/dist/i18n/locales/es-MX.json +5 -1
- package/dist/i18n/locales/es.json +5 -1
- package/dist/i18n/locales/fa.json +5 -1
- package/dist/i18n/locales/fi.json +5 -1
- package/dist/i18n/locales/fr.json +5 -1
- package/dist/i18n/locales/he.json +5 -1
- package/dist/i18n/locales/hu.json +5 -1
- package/dist/i18n/locales/it.json +5 -1
- package/dist/i18n/locales/ja.json +5 -1
- package/dist/i18n/locales/ko.json +5 -1
- package/dist/i18n/locales/nb.json +5 -1
- package/dist/i18n/locales/nl.json +5 -1
- package/dist/i18n/locales/pl.json +5 -1
- package/dist/i18n/locales/pt-BR.json +5 -1
- package/dist/i18n/locales/pt-PT.json +5 -1
- package/dist/i18n/locales/ro.json +5 -1
- package/dist/i18n/locales/ru.json +5 -1
- package/dist/i18n/locales/sv.json +5 -1
- package/dist/i18n/locales/tr.json +5 -1
- package/dist/i18n/locales/uk.json +5 -1
- package/dist/i18n/locales/zh-CN.json +5 -1
- package/dist/i18n/locales/zh-HK.json +5 -1
- package/dist/i18n/locales/zh-TW.json +5 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -3
- package/dist/llms-full.txt +2216 -1332
- package/dist/llms-medium.txt +21 -18
- package/dist/llms.txt +2 -2
- package/dist/locale-blueprint.json +5 -1
- package/dist/plugin.js +17 -40
- package/dist/pluginCore.js +30 -0
- package/dist/styles.css +2 -2
- package/dist/types/ActionButton.d.ts +26 -5
- package/dist/types/ActionButton.js +11 -0
- package/dist/types/ConfigDefaults.d.ts +34 -3
- package/dist/types/ConfigDefaults.js +14 -8
- package/dist/types/FieldLayout.d.ts +4 -1
- package/dist/types/ItemAccessor.d.ts +3 -1
- package/dist/types/ItemPath.d.ts +62 -0
- package/dist/types/ptComponentMap.d.ts +1 -1
- package/dist/utilities/functions/clickCount.js +14 -0
- package/dist/utils/versionCheck.js +1 -1
- package/llms.txt +2 -2
- package/package.json +16 -4
- package/scripts/README.md +35 -29
- package/scripts/lib/adoption-checklist.json +2 -2
- package/scripts/lib/define-preset-copy.mjs +1 -1
- package/scripts/lib/eslint-disable.mjs +5 -3
- package/scripts/lib/eslint-plugin.d.ts +2 -0
- package/scripts/lib/eslint-plugin.mjs +213 -1
- package/scripts/lib/redundant-item-accessor.mjs +4 -1
- package/scripts/lib/release-results.mjs +32 -1
- package/scripts/lib/renamed-item-field.mjs +4 -1
- package/scripts/lib/setup.mjs +8 -0
- package/scripts/lib/tab-links.mjs +4 -1
- package/scripts/lib/toolchain-check.mjs +125 -7
- package/scripts/lib/tree-default-expandable.mjs +53 -0
- package/scripts/lib/validate-bb-markup.mjs +537 -53
|
@@ -59,6 +59,7 @@ export type BitbossUiRuleName =
|
|
|
59
59
|
| 'no-dialog-in-panel'
|
|
60
60
|
| 'no-conflicting-props'
|
|
61
61
|
| 'valid-locale'
|
|
62
|
+
| 'table-columns-satisfies'
|
|
62
63
|
| 'static-plugin-options';
|
|
63
64
|
|
|
64
65
|
/** Options accepted by `bitboss-ui/no-unknown-token`. */
|
|
@@ -177,6 +178,7 @@ export const noDialogInPanel: Rule.RuleModule;
|
|
|
177
178
|
export const noConflictingProps: Rule.RuleModule;
|
|
178
179
|
export const validLocale: Rule.RuleModule;
|
|
179
180
|
export const staticPluginOptions: Rule.RuleModule;
|
|
181
|
+
export const tableColumnsSatisfies: Rule.RuleModule;
|
|
180
182
|
|
|
181
183
|
/**
|
|
182
184
|
* Resolves the optional `@typescript-eslint/parser` peer, or `null` when it is
|
|
@@ -4248,6 +4248,210 @@ function reportFromStartTag(create) {
|
|
|
4248
4248
|
};
|
|
4249
4249
|
}
|
|
4250
4250
|
|
|
4251
|
+
/**
|
|
4252
|
+
* `bitboss-ui/table-columns-satisfies`: columns declared in
|
|
4253
|
+
* script with an annotation (`const columns: BbTableColumn<Row>[] = [...]`)
|
|
4254
|
+
* widen every `key` to `string`, so BbTable cannot check them when they are
|
|
4255
|
+
* bound: a typo'd nested path, the reserved `actions`, a formatter written for
|
|
4256
|
+
* the wrong type and the slot names all go unchecked. `[...] satisfies
|
|
4257
|
+
* Array<BbTableColumn<Row>>` keeps the literal keys and the per-key check.
|
|
4258
|
+
*
|
|
4259
|
+
* `--fix` rewrites only a `const` array the script never touches and the
|
|
4260
|
+
* template never mutates (`push`, `splice`, an index or `length` write): the
|
|
4261
|
+
* literal element type then reaches nothing but the bindings. A script use
|
|
4262
|
+
* may carry it on (`columns.map((c) => c.key)` becomes an array of key
|
|
4263
|
+
* literals, and a later `push(key: string)` stops type-checking), so any
|
|
4264
|
+
* script use, a `let`, a mutated array, `ref<BbTableColumn<Row>[]>([...])` /
|
|
4265
|
+
* `computed<…>(() => [...])` (whose `Ref` type the rewrite changes) and an
|
|
4266
|
+
* arrow's `(): BbTableColumn<Row>[] => [...]` return type get the same
|
|
4267
|
+
* rewrite as a suggestion only: apply it, then type-check.
|
|
4268
|
+
* @type {import('eslint').Rule.RuleModule}
|
|
4269
|
+
*/
|
|
4270
|
+
const MUTATING_METHODS = new Set([
|
|
4271
|
+
'push',
|
|
4272
|
+
'pop',
|
|
4273
|
+
'shift',
|
|
4274
|
+
'unshift',
|
|
4275
|
+
'splice',
|
|
4276
|
+
'sort',
|
|
4277
|
+
'reverse',
|
|
4278
|
+
'fill',
|
|
4279
|
+
'copyWithin',
|
|
4280
|
+
]);
|
|
4281
|
+
const tableColumnsSatisfies = {
|
|
4282
|
+
meta: {
|
|
4283
|
+
type: 'suggestion',
|
|
4284
|
+
fixable: 'code',
|
|
4285
|
+
hasSuggestions: true,
|
|
4286
|
+
docs: {
|
|
4287
|
+
description:
|
|
4288
|
+
'Declare BbTable columns with `satisfies Array<BbTableColumn<Row>>`, not an annotation: the literal keys keep the per-key check (nested paths, reserved keys, formatter types, slot names).',
|
|
4289
|
+
recommended: true,
|
|
4290
|
+
},
|
|
4291
|
+
messages: {
|
|
4292
|
+
annotation:
|
|
4293
|
+
'`{{name}}` is annotated `{{type}}`, which widens every column `key` to `string`: BbTable cannot check them. Write `[...] satisfies Array<{{element}}>` instead.',
|
|
4294
|
+
refArgument:
|
|
4295
|
+
'`{{callee}}<{{type}}>(…)` widens every column `key` to `string`: BbTable cannot check them. Put `satisfies Array<{{element}}>` on the array instead.',
|
|
4296
|
+
returnType:
|
|
4297
|
+
'A `{{type}}` return type widens every column `key` to `string`: BbTable cannot check them. Put `satisfies Array<{{element}}>` on the array instead.',
|
|
4298
|
+
useSatisfies: 'Use `satisfies Array<{{element}}>`.',
|
|
4299
|
+
},
|
|
4300
|
+
schema: [],
|
|
4301
|
+
},
|
|
4302
|
+
create(context) {
|
|
4303
|
+
const sourceCode = context.sourceCode ?? context.getSourceCode();
|
|
4304
|
+
/** The column element type of `BbTableColumn<…>[]` / `Array<BbTableColumn<…>>`, or null. */
|
|
4305
|
+
const columnElement = (type) => {
|
|
4306
|
+
if (!type) return null;
|
|
4307
|
+
const isColumn = (t) =>
|
|
4308
|
+
t?.type === 'TSTypeReference' &&
|
|
4309
|
+
t.typeName?.type === 'Identifier' &&
|
|
4310
|
+
t.typeName.name === 'BbTableColumn';
|
|
4311
|
+
if (type.type === 'TSArrayType' && isColumn(type.elementType))
|
|
4312
|
+
return type.elementType;
|
|
4313
|
+
const args = (type.typeArguments ?? type.typeParameters)?.params;
|
|
4314
|
+
if (
|
|
4315
|
+
type.type === 'TSTypeReference' &&
|
|
4316
|
+
type.typeName?.type === 'Identifier' &&
|
|
4317
|
+
type.typeName.name === 'Array' &&
|
|
4318
|
+
args?.length === 1 &&
|
|
4319
|
+
isColumn(args[0])
|
|
4320
|
+
)
|
|
4321
|
+
return args[0];
|
|
4322
|
+
return null;
|
|
4323
|
+
};
|
|
4324
|
+
/** Any script use of the array, or a template write into it. */
|
|
4325
|
+
const touched = (declarator) => {
|
|
4326
|
+
const name = declarator.id.name;
|
|
4327
|
+
const variable = sourceCode
|
|
4328
|
+
.getDeclaredVariables(declarator)
|
|
4329
|
+
.find((v) => v.name === name);
|
|
4330
|
+
// vue-eslint-parser records a template use of a `<script setup>`
|
|
4331
|
+
// binding as a reference ON the declaration's own identifier: only
|
|
4332
|
+
// the other references are script uses.
|
|
4333
|
+
if (
|
|
4334
|
+
(variable?.references ?? []).some(
|
|
4335
|
+
(ref) => !ref.init && ref.identifier !== declarator.id
|
|
4336
|
+
)
|
|
4337
|
+
)
|
|
4338
|
+
return true;
|
|
4339
|
+
// The template is not in the scope manager: read it as text.
|
|
4340
|
+
const escaped = name.replace(/[$]/g, '\\$');
|
|
4341
|
+
const template = /<template[\s>][\s\S]*<\/template>/.exec(
|
|
4342
|
+
sourceCode.text
|
|
4343
|
+
)?.[0];
|
|
4344
|
+
return Boolean(
|
|
4345
|
+
template &&
|
|
4346
|
+
new RegExp(
|
|
4347
|
+
`(?<![\\w$.])${escaped}\\s*(?:\\.\\s*(?:${[...MUTATING_METHODS].join('|')})\\s*\\(|\\[[^\\]]*\\]\\s*=(?!=)|\\.length\\s*=(?!=))`
|
|
4348
|
+
).test(template)
|
|
4349
|
+
);
|
|
4350
|
+
};
|
|
4351
|
+
return {
|
|
4352
|
+
VariableDeclarator(node) {
|
|
4353
|
+
const annotation = node.id.typeAnnotation;
|
|
4354
|
+
const element = columnElement(annotation?.typeAnnotation);
|
|
4355
|
+
if (
|
|
4356
|
+
!element ||
|
|
4357
|
+
node.id.type !== 'Identifier' ||
|
|
4358
|
+
node.init?.type !== 'ArrayExpression'
|
|
4359
|
+
)
|
|
4360
|
+
return;
|
|
4361
|
+
const elementText = sourceCode.getText(element);
|
|
4362
|
+
const fix = (fixer) => [
|
|
4363
|
+
fixer.remove(annotation),
|
|
4364
|
+
fixer.insertTextAfter(node.init, ` satisfies Array<${elementText}>`),
|
|
4365
|
+
];
|
|
4366
|
+
const safe = node.parent.kind === 'const' && !touched(node);
|
|
4367
|
+
context.report({
|
|
4368
|
+
node: annotation,
|
|
4369
|
+
messageId: 'annotation',
|
|
4370
|
+
data: {
|
|
4371
|
+
name: node.id.name,
|
|
4372
|
+
type: sourceCode.getText(annotation.typeAnnotation),
|
|
4373
|
+
element: elementText,
|
|
4374
|
+
},
|
|
4375
|
+
...(safe ? { fix } : {}),
|
|
4376
|
+
suggest: [
|
|
4377
|
+
{ messageId: 'useSatisfies', data: { element: elementText }, fix },
|
|
4378
|
+
],
|
|
4379
|
+
});
|
|
4380
|
+
},
|
|
4381
|
+
CallExpression(node) {
|
|
4382
|
+
if (
|
|
4383
|
+
node.callee.type !== 'Identifier' ||
|
|
4384
|
+
!['ref', 'shallowRef', 'computed'].includes(node.callee.name)
|
|
4385
|
+
)
|
|
4386
|
+
return;
|
|
4387
|
+
const typeArgs = node.typeArguments ?? node.typeParameters;
|
|
4388
|
+
const element =
|
|
4389
|
+
typeArgs?.params.length === 1 && columnElement(typeArgs.params[0]);
|
|
4390
|
+
const [arg] = node.arguments;
|
|
4391
|
+
// `ref([...])`, or `computed(() => [...])`.
|
|
4392
|
+
const array =
|
|
4393
|
+
node.callee.name === 'computed'
|
|
4394
|
+
? arg?.type === 'ArrowFunctionExpression' &&
|
|
4395
|
+
!arg.returnType &&
|
|
4396
|
+
arg.body.type === 'ArrayExpression' &&
|
|
4397
|
+
arg.body
|
|
4398
|
+
: arg?.type === 'ArrayExpression' && arg;
|
|
4399
|
+
if (!element || !array) return;
|
|
4400
|
+
const elementText = sourceCode.getText(element);
|
|
4401
|
+
context.report({
|
|
4402
|
+
node: typeArgs,
|
|
4403
|
+
messageId: 'refArgument',
|
|
4404
|
+
data: {
|
|
4405
|
+
callee: node.callee.name,
|
|
4406
|
+
type: sourceCode.getText(typeArgs.params[0]),
|
|
4407
|
+
element: elementText,
|
|
4408
|
+
},
|
|
4409
|
+
suggest: [
|
|
4410
|
+
{
|
|
4411
|
+
messageId: 'useSatisfies',
|
|
4412
|
+
data: { element: elementText },
|
|
4413
|
+
fix: (fixer) => [
|
|
4414
|
+
fixer.remove(typeArgs),
|
|
4415
|
+
fixer.insertTextAfter(
|
|
4416
|
+
array,
|
|
4417
|
+
` satisfies Array<${elementText}>`
|
|
4418
|
+
),
|
|
4419
|
+
],
|
|
4420
|
+
},
|
|
4421
|
+
],
|
|
4422
|
+
});
|
|
4423
|
+
},
|
|
4424
|
+
// `(): BbTableColumn<Row>[] => [...]`, as in `computed((): … => [...])`.
|
|
4425
|
+
ArrowFunctionExpression(node) {
|
|
4426
|
+
const element = columnElement(node.returnType?.typeAnnotation);
|
|
4427
|
+
if (!element || node.body.type !== 'ArrayExpression') return;
|
|
4428
|
+
const elementText = sourceCode.getText(element);
|
|
4429
|
+
context.report({
|
|
4430
|
+
node: node.returnType,
|
|
4431
|
+
messageId: 'returnType',
|
|
4432
|
+
data: {
|
|
4433
|
+
type: sourceCode.getText(node.returnType.typeAnnotation),
|
|
4434
|
+
element: elementText,
|
|
4435
|
+
},
|
|
4436
|
+
suggest: [
|
|
4437
|
+
{
|
|
4438
|
+
messageId: 'useSatisfies',
|
|
4439
|
+
data: { element: elementText },
|
|
4440
|
+
fix: (fixer) => [
|
|
4441
|
+
fixer.remove(node.returnType),
|
|
4442
|
+
fixer.insertTextAfter(
|
|
4443
|
+
node.body,
|
|
4444
|
+
` satisfies Array<${elementText}>`
|
|
4445
|
+
),
|
|
4446
|
+
],
|
|
4447
|
+
},
|
|
4448
|
+
],
|
|
4449
|
+
});
|
|
4450
|
+
},
|
|
4451
|
+
};
|
|
4452
|
+
},
|
|
4453
|
+
};
|
|
4454
|
+
|
|
4251
4455
|
const plugin = {
|
|
4252
4456
|
meta: { name: 'bitboss-ui', version: PACKAGE_VERSION },
|
|
4253
4457
|
rules: {
|
|
@@ -4289,6 +4493,7 @@ const plugin = {
|
|
|
4289
4493
|
'no-conflicting-props': noConflictingProps,
|
|
4290
4494
|
'valid-locale': validLocale,
|
|
4291
4495
|
'static-plugin-options': staticPluginOptions,
|
|
4496
|
+
'table-columns-satisfies': tableColumnsSatisfies,
|
|
4292
4497
|
},
|
|
4293
4498
|
};
|
|
4294
4499
|
// In place, so `plugin.rules[name]` stays the exported rule object.
|
|
@@ -4459,6 +4664,9 @@ plugin.configs = {
|
|
|
4459
4664
|
'bitboss-ui/no-conflicting-props': 'error',
|
|
4460
4665
|
// `warn`, as the build plugin warns: the locale still builds.
|
|
4461
4666
|
'bitboss-ui/valid-locale': 'warn',
|
|
4667
|
+
// `warn`: the table works as written; the
|
|
4668
|
+
// rewrite only lets BbTable check the keys.
|
|
4669
|
+
'bitboss-ui/table-columns-satisfies': 'warn',
|
|
4462
4670
|
},
|
|
4463
4671
|
},
|
|
4464
4672
|
// Where a build config or a `setConfig` sits in a script: the locale
|
|
@@ -4475,7 +4683,10 @@ plugin.configs = {
|
|
|
4475
4683
|
files: ['**/*.{ts,mts,cts}'],
|
|
4476
4684
|
plugins: { 'bitboss-ui': plugin },
|
|
4477
4685
|
languageOptions: { parser: tsParser },
|
|
4478
|
-
rules: {
|
|
4686
|
+
rules: {
|
|
4687
|
+
'bitboss-ui/valid-locale': 'warn',
|
|
4688
|
+
'bitboss-ui/table-columns-satisfies': 'warn',
|
|
4689
|
+
},
|
|
4479
4690
|
},
|
|
4480
4691
|
]
|
|
4481
4692
|
: []),
|
|
@@ -4538,5 +4749,6 @@ export {
|
|
|
4538
4749
|
noConflictingProps,
|
|
4539
4750
|
validLocale,
|
|
4540
4751
|
staticPluginOptions,
|
|
4752
|
+
tableColumnsSatisfies,
|
|
4541
4753
|
resolveOptionalTsParser,
|
|
4542
4754
|
};
|
|
@@ -152,7 +152,10 @@ export function restatesDefault(accessor, field, shape) {
|
|
|
152
152
|
const arrayOf = (node, arrays) => {
|
|
153
153
|
const value = unwrap(node);
|
|
154
154
|
if (value?.type === 'ArrayExpression') return value;
|
|
155
|
-
|
|
155
|
+
// "Every item has the field" needs the final data: a sealed same-file
|
|
156
|
+
// array, never a `ref` seed, a typed or cast array, or one the file
|
|
157
|
+
// changes or hands off.
|
|
158
|
+
if (value?.type === 'Identifier' && arrays?.sealed?.has(value.name))
|
|
156
159
|
return arrays?.get(value.name) ?? null;
|
|
157
160
|
return null;
|
|
158
161
|
};
|
|
@@ -109,6 +109,33 @@ export function foldEvents(events) {
|
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Why a red step failed, kept in its record so the history can say what
|
|
114
|
+
* the time went on: `exit` (the code, or null), `signal` when one killed
|
|
115
|
+
* it, and `cause`:
|
|
116
|
+
* 'killed' a signal ended it (a timeout, a kill, an out-of-memory)
|
|
117
|
+
* 'check' an in-process check said no (its message is the note)
|
|
118
|
+
* 'tests' the runners named every file that failed
|
|
119
|
+
* 'crash' a test step failed without naming a file (crash, hang)
|
|
120
|
+
* 'exit' any other non-zero exit: the step's own name is the cause
|
|
121
|
+
* `run` is { exit, signal, inProcess }; `folded` is foldEvents' result.
|
|
122
|
+
*/
|
|
123
|
+
export function failureFields(
|
|
124
|
+
{ exit = null, signal = null, inProcess = false },
|
|
125
|
+
folded = {}
|
|
126
|
+
) {
|
|
127
|
+
const cause = signal
|
|
128
|
+
? 'killed'
|
|
129
|
+
: inProcess
|
|
130
|
+
? 'check'
|
|
131
|
+
: folded.whole
|
|
132
|
+
? 'crash'
|
|
133
|
+
: folded.failedFiles?.length
|
|
134
|
+
? 'tests'
|
|
135
|
+
: 'exit';
|
|
136
|
+
return { exit, ...(signal ? { signal } : {}), cause };
|
|
137
|
+
}
|
|
138
|
+
|
|
112
139
|
// ---------------------------------------------------------------------------
|
|
113
140
|
// The record on disk.
|
|
114
141
|
// ---------------------------------------------------------------------------
|
|
@@ -155,9 +182,13 @@ export function collectWarn(steps) {
|
|
|
155
182
|
// The rerun plan.
|
|
156
183
|
// ---------------------------------------------------------------------------
|
|
157
184
|
|
|
158
|
-
/**
|
|
185
|
+
/**
|
|
186
|
+
* Still owed: anything that did not pass (a declared skip is not owed, nor
|
|
187
|
+
* a step a scoped release carried from its full base).
|
|
188
|
+
*/
|
|
159
189
|
export const owed = (step) =>
|
|
160
190
|
step.status !== 'pass' &&
|
|
191
|
+
step.status !== 'carried' &&
|
|
161
192
|
!(step.status === 'skipped' && !step.note?.startsWith('build failed'));
|
|
162
193
|
|
|
163
194
|
/** Steps whose rerun can be narrowed to their failed files. */
|
|
@@ -138,7 +138,10 @@ const isTrue = (node) => {
|
|
|
138
138
|
const arrayOf = (node, arrays) => {
|
|
139
139
|
const value = unwrap(node);
|
|
140
140
|
if (value?.type === 'ArrayExpression') return value;
|
|
141
|
-
|
|
141
|
+
// A same-file array the file changes may be relabelled or rekeyed by
|
|
142
|
+
// that write: out of reach.
|
|
143
|
+
if (value?.type === 'Identifier' && !arrays?.mutated?.has(value.name))
|
|
144
|
+
return arrays?.get(value.name) ?? null;
|
|
142
145
|
return null;
|
|
143
146
|
};
|
|
144
147
|
|
package/scripts/lib/setup.mjs
CHANGED
|
@@ -19,6 +19,7 @@ import { spawnSync } from 'node:child_process';
|
|
|
19
19
|
import { parseArgs } from 'node:util';
|
|
20
20
|
import { fileURLToPath } from 'node:url';
|
|
21
21
|
import { refreshAgentSetup } from './agent-refresh.mjs';
|
|
22
|
+
import { ensureStrictVModel, isNewProject } from './toolchain-check.mjs';
|
|
22
23
|
import { refuseLinkedTarget } from './linked-target.mjs';
|
|
23
24
|
import { createRequire } from 'node:module';
|
|
24
25
|
import { detectPackageManager, mcpLaunch } from './mcp-config.mjs';
|
|
@@ -352,6 +353,8 @@ export async function setupCommand(options) {
|
|
|
352
353
|
app.framework === 'nuxt'
|
|
353
354
|
? /['"]bitboss-ui\/nuxt['"]/.test(configCode)
|
|
354
355
|
: /\bbitbossUi\s*\(/.test(configCode);
|
|
356
|
+
// Read before anything here commits or wires: the project as it was found.
|
|
357
|
+
const newProject = isNewProject(root, { alreadyWired });
|
|
355
358
|
const pluginOptions = pluginOptionsFor({
|
|
356
359
|
locale,
|
|
357
360
|
tailwind,
|
|
@@ -423,6 +426,11 @@ export async function setupCommand(options) {
|
|
|
423
426
|
done.push(['package.json', 'updated (postinstall)']);
|
|
424
427
|
}
|
|
425
428
|
|
|
429
|
+
// Before the agent refresh, whose strict-set suggestion reads the result.
|
|
430
|
+
if (newProject) {
|
|
431
|
+
const strict = ensureStrictVModel(root);
|
|
432
|
+
if (strict?.action === 'updated') done.push([strict.path, 'updated']);
|
|
433
|
+
}
|
|
426
434
|
console.log('\n[bitboss-ui] setup:');
|
|
427
435
|
for (const [file, action] of done) console.log(` - ${action}: ${file}`);
|
|
428
436
|
await runInstalledRefresh(root, version);
|
|
@@ -75,7 +75,10 @@ const stringValue = (object, key) => {
|
|
|
75
75
|
const arrayOf = (node, arrays) => {
|
|
76
76
|
const value = unwrap(node);
|
|
77
77
|
if (value?.type === 'ArrayExpression') return value;
|
|
78
|
-
|
|
78
|
+
// A same-file array the file changes may be relabelled or rekeyed by
|
|
79
|
+
// that write: out of reach.
|
|
80
|
+
if (value?.type === 'Identifier' && !arrays?.mutated?.has(value.name))
|
|
81
|
+
return arrays?.get(value.name) ?? null;
|
|
79
82
|
return null;
|
|
80
83
|
};
|
|
81
84
|
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
* themselves. The agent refresh (`update --no-install`, the app's
|
|
12
12
|
* postinstall) still writes the flag (`ensureCheckUnknownComponents`).
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
14
|
+
import { spawnSync } from 'node:child_process';
|
|
15
|
+
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
15
16
|
import { writeFileAtomicSync } from './atomic-write.mjs';
|
|
16
17
|
import { dirname, join, relative, resolve } from 'node:path';
|
|
17
18
|
import { refuseLinkedTarget } from './linked-target.mjs';
|
|
@@ -50,7 +51,11 @@ export function strictTemplateSuggestion(root) {
|
|
|
50
51
|
existsSync(join(root, name))
|
|
51
52
|
);
|
|
52
53
|
if (!target) return null;
|
|
53
|
-
|
|
54
|
+
// An option the project already sets, either way, is its choice: name only the rest.
|
|
55
|
+
const set = flagSet(root, STRICT_V_MODEL_CHOSEN)
|
|
56
|
+
? STRICT_TEMPLATE_SET.replace(' "strictVModel": true,', '')
|
|
57
|
+
: STRICT_TEMPLATE_SET;
|
|
58
|
+
return `Recommended: \`"vueCompilerOptions": ${set}\` in ${target}, so vue-tsc checks every template attribute and event (installation guide, checklist). Not written: it can surface errors in your own templates to fix first.`;
|
|
54
59
|
}
|
|
55
60
|
|
|
56
61
|
/**
|
|
@@ -102,9 +107,20 @@ function readText(path) {
|
|
|
102
107
|
}
|
|
103
108
|
}
|
|
104
109
|
|
|
110
|
+
/** A package `extends` (`@vue/tsconfig/tsconfig.dom.json`) → its file in the nearest node_modules. */
|
|
111
|
+
function packageConfig(from, ref) {
|
|
112
|
+
for (let dir = dirname(from); ; dir = dirname(dir)) {
|
|
113
|
+
const base = join(dir, 'node_modules', ref);
|
|
114
|
+
for (const path of [base, `${base}.json`, join(base, 'tsconfig.json')])
|
|
115
|
+
if (existsSync(path) && statSync(path).isFile()) return path;
|
|
116
|
+
if (dirname(dir) === dir) return undefined;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
105
120
|
/** A local `extends` / `references` path → the config file it names. */
|
|
106
121
|
function localConfig(from, ref) {
|
|
107
|
-
if (typeof ref !== 'string'
|
|
122
|
+
if (typeof ref !== 'string') return undefined;
|
|
123
|
+
if (!ref.startsWith('.')) return packageConfig(from, ref);
|
|
108
124
|
const path = resolve(dirname(from), ref);
|
|
109
125
|
try {
|
|
110
126
|
if (statSync(path).isDirectory()) return join(path, 'tsconfig.json');
|
|
@@ -226,19 +242,30 @@ export function ensureCheckUnknownComponents(root) {
|
|
|
226
242
|
return { path, action: 'skipped', reason: error.message };
|
|
227
243
|
}
|
|
228
244
|
|
|
245
|
+
return insertVueCompilerFlag(target, path, 'checkUnknownComponents');
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/** `"flag": true` into the config's `vueCompilerOptions`, as text: comments, layout and line endings stay. */
|
|
249
|
+
function insertVueCompilerFlag(target, path, flag) {
|
|
229
250
|
const text = readFileSync(target, 'utf-8');
|
|
230
251
|
const bare = blankJsonComments(text);
|
|
231
252
|
const unit = indentUnit(text);
|
|
253
|
+
const eol = text.includes('\r\n') ? '\r\n' : '\n';
|
|
232
254
|
const nested = /"vueCompilerOptions"\s*:\s*\{/.exec(bare);
|
|
233
255
|
const open = nested ? nested.index + nested[0].length : bare.search(/\S/) + 1;
|
|
234
256
|
if (!nested && bare[open - 1] !== '{')
|
|
235
257
|
return { path, action: 'skipped', reason: 'not a JSON object' };
|
|
236
|
-
const
|
|
258
|
+
const rest = bare.slice(open);
|
|
259
|
+
const empty = /^\s*\}/.test(rest);
|
|
260
|
+
const oneLine =
|
|
261
|
+
nested && !empty && !rest.slice(0, rest.indexOf('}')).includes('\n');
|
|
237
262
|
const indent = nested ? lineIndent(text, nested.index) + unit : unit;
|
|
238
263
|
const entry = nested
|
|
239
|
-
?
|
|
240
|
-
:
|
|
241
|
-
const updated =
|
|
264
|
+
? `"${flag}": true`
|
|
265
|
+
: `"vueCompilerOptions": { "${flag}": true }`;
|
|
266
|
+
const updated = oneLine
|
|
267
|
+
? `${text.slice(0, open)} ${entry},${text.slice(open)}`
|
|
268
|
+
: `${text.slice(0, open)}${eol}${indent}${entry}${empty ? eol + (nested ? lineIndent(text, nested.index) : '') : ','}${text.slice(open)}`;
|
|
242
269
|
if (parseJsonc(text) !== undefined && parseJsonc(updated) === undefined)
|
|
243
270
|
return {
|
|
244
271
|
path,
|
|
@@ -248,3 +275,94 @@ export function ensureCheckUnknownComponents(root) {
|
|
|
248
275
|
writeFileAtomicSync(target, updated, 'utf-8');
|
|
249
276
|
return { path, action: 'updated' };
|
|
250
277
|
}
|
|
278
|
+
|
|
279
|
+
const STRICT_V_MODEL_CHOSEN = /["']?(?:strictVModel|strictTemplates)["']?\s*:/;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Turn `strictVModel` on in a new project's tsconfig. `setup` alone calls it,
|
|
283
|
+
* after `isNewProject`: a running project's templates are its own to migrate.
|
|
284
|
+
* Any existing `strictVModel` or `strictTemplates`, either value, in the config
|
|
285
|
+
* or what it extends, stays the answer. Nuxt generates its tsconfig: not written.
|
|
286
|
+
*
|
|
287
|
+
* @param {string} root
|
|
288
|
+
* @returns {{ path: string, action: string, reason?: string } | null}
|
|
289
|
+
*/
|
|
290
|
+
export function ensureStrictVModel(root) {
|
|
291
|
+
if (nuxtConfig(root)) return null;
|
|
292
|
+
const target = ['tsconfig.app.json', 'tsconfig.json']
|
|
293
|
+
.map((name) => join(root, name))
|
|
294
|
+
.find((path) => existsSync(path));
|
|
295
|
+
if (!target) return null;
|
|
296
|
+
const path = `${relative(root, target)} [vueCompilerOptions.strictVModel]`;
|
|
297
|
+
if (flagSet(root, STRICT_V_MODEL_CHOSEN))
|
|
298
|
+
return { path, action: 'unchanged' };
|
|
299
|
+
try {
|
|
300
|
+
refuseLinkedTarget(target);
|
|
301
|
+
} catch (error) {
|
|
302
|
+
return { path, action: 'skipped', reason: error.message };
|
|
303
|
+
}
|
|
304
|
+
return insertVueCompilerFlag(target, path, 'strictVModel');
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
const NOT_SOURCE = new Set([
|
|
308
|
+
'node_modules',
|
|
309
|
+
'dist',
|
|
310
|
+
'build',
|
|
311
|
+
'vendor',
|
|
312
|
+
'.git',
|
|
313
|
+
'.nuxt',
|
|
314
|
+
'.output',
|
|
315
|
+
'storage',
|
|
316
|
+
'public',
|
|
317
|
+
]);
|
|
318
|
+
/** Above any scaffold's own count (create-vue with examples has about 11). */
|
|
319
|
+
const NEW_PROJECT_MAX_SFCS = 15;
|
|
320
|
+
|
|
321
|
+
/** `true` while the count stays within the limit; an unreadable folder counts as over it. */
|
|
322
|
+
function sfcsWithin(dir, limit) {
|
|
323
|
+
let count = 0;
|
|
324
|
+
const walk = (at) => {
|
|
325
|
+
for (const entry of readdirSync(at, { withFileTypes: true })) {
|
|
326
|
+
if (entry.isDirectory()) {
|
|
327
|
+
if (!NOT_SOURCE.has(entry.name)) walk(join(at, entry.name));
|
|
328
|
+
} else if (entry.name.endsWith('.vue')) count++;
|
|
329
|
+
if (count > limit) return;
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
try {
|
|
333
|
+
walk(dir);
|
|
334
|
+
} catch {
|
|
335
|
+
return false;
|
|
336
|
+
}
|
|
337
|
+
return count <= limit;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/** Commits reachable from HEAD: 0 outside a repository or before the first commit, `undefined` when git cannot say. */
|
|
341
|
+
function commitCount(root) {
|
|
342
|
+
const result = spawnSync('git', ['rev-list', '--count', 'HEAD'], {
|
|
343
|
+
cwd: root,
|
|
344
|
+
encoding: 'utf-8',
|
|
345
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
346
|
+
});
|
|
347
|
+
if (result.error) return undefined;
|
|
348
|
+
if (result.status === 0) return Number(result.stdout.trim());
|
|
349
|
+
return /not a git repository|bad revision 'HEAD'|ambiguous argument 'HEAD'/i.test(
|
|
350
|
+
result.stderr
|
|
351
|
+
)
|
|
352
|
+
? 0
|
|
353
|
+
: undefined;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Is this demonstrably a project that has just been scaffolded? Every signal
|
|
358
|
+
* must say so; any doubt means running.
|
|
359
|
+
*
|
|
360
|
+
* @param {string} root
|
|
361
|
+
* @param {{ alreadyWired: boolean }} options
|
|
362
|
+
*/
|
|
363
|
+
export function isNewProject(root, { alreadyWired }) {
|
|
364
|
+
if (alreadyWired) return false;
|
|
365
|
+
const commits = commitCount(root);
|
|
366
|
+
if (commits === undefined || commits > 1) return false;
|
|
367
|
+
return sfcsWithin(root, NEW_PROJECT_MAX_SFCS);
|
|
368
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `redundant-tree-expandable`: `:expandable="(n) => !!n.children?.length"`
|
|
3
|
+
* on a BbTree. With `expandable` unset a node already gets a toggle when it
|
|
4
|
+
* has a child to show, so the function only restates the default, and worse:
|
|
5
|
+
* it still gives a toggle to a branch whose children are all `hidden`.
|
|
6
|
+
*
|
|
7
|
+
* Judged: a bound `expandable` on a library BbTree whose expression is an
|
|
8
|
+
* arrow over one parameter returning `!!p.children?.length` (or
|
|
9
|
+
* `p.children?.length > 0`). Check-only, no ESLint twin; an
|
|
10
|
+
* `eslint-disable` for `no-unknown-attributes` silences it.
|
|
11
|
+
*/
|
|
12
|
+
import { libraryTagOf } from './dropdown-default-slot.mjs';
|
|
13
|
+
|
|
14
|
+
export const REDUNDANT_TREE_EXPANDABLE_MESSAGE =
|
|
15
|
+
'`:expandable="(n) => !!n.children?.length"` restates BbTree\'s default and still gives a toggle to a branch whose children are all `hidden` — remove it';
|
|
16
|
+
|
|
17
|
+
const NODE_ELEMENT = 1;
|
|
18
|
+
const PROP_DIRECTIVE = 7;
|
|
19
|
+
|
|
20
|
+
/** `(n) => !!n.children?.length`, `n => n.children?.length > 0`, a typed `(n: T)`. */
|
|
21
|
+
const RESTATES_DEFAULT =
|
|
22
|
+
/^\(?\s*([A-Za-z_$][\w$]*)\s*(?::[^)=]*)?\)?\s*=>\s*(?:!!\s*\1\s*\.\s*children\s*\?\.\s*length|\1\s*\.\s*children\s*\?\.\s*length\s*>\s*0)\s*$/;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @param {any} ast compiled template AST
|
|
26
|
+
* @param {{ aliases?: Map<string, string>, own?: Set<string> }} [scope]
|
|
27
|
+
*/
|
|
28
|
+
export function redundantTreeExpandableFindings(ast, scope = {}) {
|
|
29
|
+
const findings = [];
|
|
30
|
+
const walk = (node) => {
|
|
31
|
+
if (!node || typeof node !== 'object') return;
|
|
32
|
+
if (
|
|
33
|
+
node.type === NODE_ELEMENT &&
|
|
34
|
+
libraryTagOf(node.tag, scope) === 'BbTree'
|
|
35
|
+
)
|
|
36
|
+
for (const prop of node.props ?? []) {
|
|
37
|
+
if (prop.type !== PROP_DIRECTIVE || prop.name !== 'bind') continue;
|
|
38
|
+
if (prop.arg?.content !== 'expandable') continue;
|
|
39
|
+
if (!RESTATES_DEFAULT.test(prop.exp?.content?.trim() ?? '')) continue;
|
|
40
|
+
findings.push({
|
|
41
|
+
component: 'BbTree',
|
|
42
|
+
attr: ':expandable',
|
|
43
|
+
kind: 'redundant-tree-expandable',
|
|
44
|
+
line: prop.loc?.start?.line,
|
|
45
|
+
message: REDUNDANT_TREE_EXPANDABLE_MESSAGE,
|
|
46
|
+
hint: 'Pass `:expandable="false"` for no toggles; a function only for another rule (a depth, a field of `meta`).',
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
for (const child of node.children ?? []) walk(child);
|
|
50
|
+
};
|
|
51
|
+
walk(ast);
|
|
52
|
+
return findings;
|
|
53
|
+
}
|