bitboss-ui 3.0.0-beta.69 → 3.0.0-beta.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -11
- package/bin/bitboss-ui-mcp.mjs +7 -4
- package/bin/bitboss-ui.mjs +0 -0
- package/bin/cli.mjs +47 -28
- package/dist/ai/BbBaseButton.md +4 -4
- package/dist/ai/BbBreadcrumbs.md +3 -0
- package/dist/ai/BbCarousel.md +32 -29
- package/dist/ai/BbCheckbox.md +5 -6
- package/dist/ai/BbCheckboxGroup.md +28 -26
- package/dist/ai/BbColorInput.md +9 -14
- package/dist/ai/BbDatePickerInput.md +3 -4
- package/dist/ai/BbDropdown.md +35 -1
- package/dist/ai/BbDropdownButton.md +4 -3
- package/dist/ai/BbDropzone.md +3 -3
- package/dist/ai/BbGallery.md +2034 -0
- package/dist/ai/BbNumberInput.md +3 -4
- package/dist/ai/BbPopover.md +12 -6
- package/dist/ai/BbRadio.md +5 -6
- package/dist/ai/BbRadioGroup.md +28 -31
- package/dist/ai/BbRating.md +6 -16
- package/dist/ai/BbSelect.md +10 -11
- package/dist/ai/BbSlider.md +3 -9
- package/dist/ai/BbSwitch.md +6 -6
- package/dist/ai/BbSwitchGroup.md +4 -7
- package/dist/ai/BbTag.md +3 -4
- package/dist/ai/BbTextInput.md +19 -19
- package/dist/ai/BbTextarea.md +8 -8
- package/dist/ai/BbTimePickerInput.md +3 -4
- package/dist/ai/BbTooltip.md +17 -13
- package/dist/ai/CommonField.md +2 -10
- package/dist/ai/OptionsContainer.md +7 -12
- package/dist/ai/changelog.json +119 -4
- package/dist/ai/components.json +37 -32
- package/dist/ai/guides/ai-router.md +3 -2
- package/dist/ai/guides/component-picker.md +1 -0
- package/dist/ai/guides/eslint-rules.md +3 -3
- package/dist/ai/guides/installation-and-plugin-setup.md +5 -5
- package/dist/ai/guides/migration/v2-to-v3.md +53 -1
- package/dist/ai/guides/migration/v3-beta-tooling.md +25 -15
- package/dist/ai/guides/passthrough.md +2 -1
- package/dist/ai/guides/preset-components.md +53 -19
- package/dist/ai/helpers/definePreset.json +8 -1
- package/dist/ai/helpers/definePreset.ts +42 -13
- package/dist/ai/helpers/inertia/manifest.json +1 -1
- package/dist/ai/index.md +2 -1
- package/dist/ai/manifest/common.json +2 -2
- package/dist/ai/manifest/components/BbBreadcrumbs.json +1 -1
- package/dist/ai/manifest/components/BbCarousel.json +3 -2
- package/dist/ai/manifest/components/BbCarousel.tree.json +7 -0
- 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.tree.json +10 -18
- package/dist/ai/manifest/components/BbColorInput.json +2 -2
- package/dist/ai/manifest/components/BbColorInput.tree.json +1 -1
- package/dist/ai/manifest/components/BbConfigScope.json +1 -1
- package/dist/ai/manifest/components/BbDatePickerInput.tree.json +1 -1
- package/dist/ai/manifest/components/BbDropdown.json +2 -2
- package/dist/ai/manifest/components/BbDropdownButton.json +2 -2
- package/dist/ai/manifest/components/BbGallery.json +54 -0
- package/dist/ai/manifest/components/BbGallery.tree.json +139 -0
- package/dist/ai/manifest/components/BbNumberInput.tree.json +1 -1
- package/dist/ai/manifest/components/BbRadio.tree.json +1 -1
- package/dist/ai/manifest/components/BbRadioGroup.tree.json +9 -17
- package/dist/ai/manifest/components/BbRating.removed.json +1 -1
- package/dist/ai/manifest/components/BbRating.tree.json +1 -1
- package/dist/ai/manifest/components/BbSelect.json +15 -15
- package/dist/ai/manifest/components/BbSelect.tree.json +1 -1
- package/dist/ai/manifest/components/BbSlider.json +1 -1
- package/dist/ai/manifest/components/BbSlider.tree.json +1 -1
- package/dist/ai/manifest/components/BbSwitch.tree.json +1 -1
- package/dist/ai/manifest/components/BbSwitchGroup.tree.json +2 -2
- package/dist/ai/manifest/components/BbTabs.removed.json +4 -4
- package/dist/ai/manifest/components/BbTabsList.removed.json +4 -4
- package/dist/ai/manifest/components/BbTag.tree.json +1 -1
- package/dist/ai/manifest/components/BbTextInput.tree.json +1 -1
- package/dist/ai/manifest/components/BbTextarea.tree.json +1 -1
- package/dist/ai/manifest/components/BbTimePickerInput.tree.json +1 -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/CommonField.tree.json +5 -10
- package/dist/ai/manifest/components/OptionsContainer.tree.json +7 -12
- package/dist/ai/manifest/index.json +4 -3
- package/dist/ai/manifest/meta.json +5 -1
- package/dist/ai/manifest/types.advanced.json +4 -2
- package/dist/ai/manifest/types.api.json +3 -3
- package/dist/ai/manifest/types.wrapper.json +1 -0
- package/dist/ai/recipes/inertia/onboarding.md +5 -8
- package/dist/ai/recipes/inertia/record-form.md +33 -12
- package/dist/ai/recipes/nuxt/onboarding.md +5 -8
- package/dist/ai/recipes/nuxt/record-form.md +27 -11
- package/dist/ai/recipes/vue/onboarding.md +5 -8
- package/dist/ai/recipes/vue/record-form.md +25 -11
- package/dist/ai/source/BbBreadcrumbs.md +31 -12
- package/dist/ai/source/BbCalendar.md +2 -0
- package/dist/ai/source/BbCarousel.md +135 -32
- package/dist/ai/source/BbCheckbox.md +36 -42
- package/dist/ai/source/BbCheckboxGroup.md +2 -4
- package/dist/ai/source/BbColorInput.md +2 -4
- package/dist/ai/source/BbDatePickerInput.md +2 -4
- package/dist/ai/source/BbDropdown.md +13 -2
- package/dist/ai/source/BbDropdownButton.md +4 -1
- package/dist/ai/source/BbDropdownGroup.md +11 -2
- package/dist/ai/source/BbGallery.md +2027 -0
- package/dist/ai/source/BbNumberInput.md +2 -4
- package/dist/ai/source/BbRadio.md +36 -42
- package/dist/ai/source/BbRadioGroup.md +4 -6
- package/dist/ai/source/BbRating.md +2 -14
- package/dist/ai/source/BbSelect.md +30 -13
- package/dist/ai/source/BbSelectPopover.md +1 -0
- package/dist/ai/source/BbSlider.md +2 -4
- package/dist/ai/source/BbSwitch.md +34 -38
- package/dist/ai/source/BbSwitchGroup.md +1 -0
- package/dist/ai/source/BbTable.md +15 -8
- 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 +7 -3
- package/dist/ai/source/CommonField.md +17 -106
- package/dist/ai/source/CommonPopover.md +13 -3
- package/dist/ai/source/FlatListBox.md +3 -3
- package/dist/ai/source/GroupedListBox.md +3 -3
- package/dist/ai/source/GuidesComponent.md +3 -0
- package/dist/ai/source/ListBox.md +4 -4
- package/dist/ai/source/OptionsContainer.md +4 -4
- 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/BbCalendar/useDayjsLocale.js +5 -3
- package/dist/components/BbCarousel/BbCarousel.vue.d.ts +1 -1
- package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +506 -481
- package/dist/components/BbCarousel/dragRelease.js +14 -0
- package/dist/components/BbCarousel/ptKeys.generated.d.ts +4 -0
- package/dist/components/BbCarousel/types.d.ts +11 -6
- package/dist/components/BbCarousel/types.js +1 -0
- package/dist/components/BbCheckbox/types.d.ts +2 -4
- package/dist/components/BbCheckboxGroup/types.d.ts +2 -4
- package/dist/components/BbColorInput/types.d.ts +2 -4
- package/dist/components/BbDatePickerInput/types.d.ts +2 -4
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +121 -120
- package/dist/components/BbDropdown/normalizeGroups.js +37 -33
- package/dist/components/BbDropdown/types.d.ts +9 -2
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +95 -94
- package/dist/components/BbGallery/BbGallery.vue.d.ts +50 -0
- package/dist/components/BbGallery/BbGallery.vue.js +5 -0
- package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +587 -0
- package/dist/components/BbGallery/findItem.js +41 -0
- package/dist/components/BbGallery/ptKeys.generated.d.ts +112 -0
- package/dist/components/BbGallery/types.d.ts +177 -0
- package/dist/components/BbGallery/types.js +29 -0
- package/dist/components/BbNumberInput/types.d.ts +2 -4
- package/dist/components/BbOffCanvas/sheetSnap.d.ts +2 -0
- package/dist/components/BbOffCanvas/sheetSnap.js +5 -5
- package/dist/components/BbRadio/types.d.ts +2 -4
- package/dist/components/BbRadioGroup/types.d.ts +4 -6
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +116 -118
- package/dist/components/BbRating/types.d.ts +2 -4
- package/dist/components/BbSelect/BbSelect.vue.d.ts +10 -4
- package/dist/components/BbSelect/types.d.ts +4 -6
- package/dist/components/BbSlider/types.d.ts +2 -4
- package/dist/components/BbTable/types.d.ts +8 -8
- package/dist/components/BbTag/types.d.ts +2 -4
- package/dist/components/BbTextInput/types.d.ts +2 -4
- package/dist/components/BbTextarea/types.d.ts +2 -4
- package/dist/components/BbTimePickerInput/types.d.ts +2 -4
- package/dist/components/BbTooltip/ptKeys.generated.d.ts +4 -4
- package/dist/components/BbTooltip/types.d.ts +3 -1
- package/dist/components/BbTree/types.d.ts +3 -3
- package/dist/components/CommonField/types.d.ts +2 -4
- package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +28 -26
- package/dist/composables/overlayRegistry.d.ts +17 -0
- package/dist/composables/overlayRegistry.js +16 -9
- package/dist/composables/useChoiceIndicator.js +66 -63
- package/dist/deprecation/ai-deprecations.json.js +1 -1
- package/dist/directives/bbDropdown.js +1 -1
- package/dist/directives/bbGallery.d.ts +64 -0
- package/dist/directives/bbGallery.js +38 -0
- package/dist/i18n/locales/ar.json +3 -1
- package/dist/i18n/locales/cs.json +3 -1
- package/dist/i18n/locales/da.json +3 -1
- package/dist/i18n/locales/de-CH.json +3 -1
- package/dist/i18n/locales/de.json +3 -1
- package/dist/i18n/locales/el.json +3 -1
- package/dist/i18n/locales/en-GB.json +3 -1
- package/dist/i18n/locales/en.json +3 -1
- package/dist/i18n/locales/es-MX.json +3 -1
- package/dist/i18n/locales/es.json +3 -1
- package/dist/i18n/locales/fa.json +3 -1
- package/dist/i18n/locales/fi.json +3 -1
- package/dist/i18n/locales/fr.json +3 -1
- package/dist/i18n/locales/he.json +3 -1
- package/dist/i18n/locales/hu.json +3 -1
- package/dist/i18n/locales/it.json +3 -1
- package/dist/i18n/locales/ja.json +3 -1
- package/dist/i18n/locales/ko.json +3 -1
- package/dist/i18n/locales/nb.json +3 -1
- package/dist/i18n/locales/nl.json +3 -1
- package/dist/i18n/locales/pl.json +3 -1
- package/dist/i18n/locales/pt-BR.json +3 -1
- package/dist/i18n/locales/pt-PT.json +3 -1
- package/dist/i18n/locales/ro.json +3 -1
- package/dist/i18n/locales/ru.json +3 -1
- package/dist/i18n/locales/sv.json +3 -1
- package/dist/i18n/locales/tr.json +3 -1
- package/dist/i18n/locales/uk.json +3 -1
- package/dist/i18n/locales/zh-CN.json +3 -1
- package/dist/i18n/locales/zh-HK.json +3 -1
- package/dist/i18n/locales/zh-TW.json +3 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +38 -36
- package/dist/llms-full.txt +2534 -346
- package/dist/llms-medium.txt +10 -7
- package/dist/llms.txt +1 -1
- package/dist/locale-blueprint.json +3 -1
- package/dist/nuxt-auto-imports.js +1 -1
- package/dist/plugin.js +18 -17
- package/dist/project-dts.js +17 -16
- package/dist/runtime/nuxt-plugin.js +22 -21
- package/dist/scripts/lib/atomic-write.js +42 -0
- package/dist/styles.css +2 -2
- package/dist/types/FieldLayout.d.ts +4 -1
- package/dist/types/ItemAccessor.d.ts +3 -1
- package/dist/types/ItemPath.d.ts +33 -0
- package/dist/types/passthrough.d.ts +2 -2
- package/dist/types/ptComponentMap.d.ts +2 -1
- package/dist/utilities/calendar/canonicalParts.js +10 -2
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite.js +361 -331
- package/llms.txt +2 -2
- package/package.json +7 -4
- package/scripts/README.md +31 -29
- package/scripts/lib/agent-refresh.mjs +15 -9
- package/scripts/lib/agent-setup.mjs +46 -15
- package/scripts/lib/atomic-write.d.mts +6 -0
- package/scripts/lib/atomic-write.mjs +85 -0
- package/scripts/lib/define-preset-copy.mjs +24 -4
- package/scripts/lib/eslint-plugin.mjs +74 -36
- package/scripts/lib/hand-imported-styles.mjs +44 -99
- package/scripts/lib/helpers-add.mjs +3 -1
- package/scripts/lib/linked-target.mjs +1 -1
- package/scripts/lib/locale-check.mjs +41 -25
- package/scripts/lib/mcp-config.mjs +250 -133
- package/scripts/lib/mcp-sdk.mjs +24 -0
- package/scripts/lib/plugin-options-check.mjs +22 -15
- package/scripts/lib/pnp.mjs +1 -1
- package/scripts/lib/project-variant-dts.mjs +80 -136
- package/scripts/lib/release-results.mjs +331 -0
- package/scripts/lib/setup.mjs +61 -3
- package/scripts/lib/toolchain-check.mjs +134 -14
- package/scripts/lib/tooling-options.mjs +357 -38
- package/scripts/lib/validate-bb-markup.mjs +1 -1
- package/dist/components/BbBadge/BadgeBodyContent.vue.d.ts +0 -15
- package/dist/components/BbBadge/badgeButtonContext.d.ts +0 -55
- package/dist/components/BbBaseButton/RouterComponent.vue.d.ts +0 -18
- package/dist/components/BbBaseButton/useLinkState.d.ts +0 -43
- package/dist/components/BbBreadcrumbs/estimateBreadcrumbItemWidth.d.ts +0 -18
- package/dist/components/BbButton/toggleRoving.d.ts +0 -6
- package/dist/components/BbCalendar/CalendarMonthPanel.vue.d.ts +0 -5
- package/dist/components/BbCalendar/CalendarYearPanel.vue.d.ts +0 -5
- package/dist/components/BbCalendar/calendarHost.d.ts +0 -29
- package/dist/components/BbCalendar/calendarMath.d.ts +0 -102
- package/dist/components/BbCalendar/useCalendarContext.d.ts +0 -116
- package/dist/components/BbCalendar/useCalendarGrid.d.ts +0 -411
- package/dist/components/BbCalendar/useDayGrid.d.ts +0 -122
- package/dist/components/BbCalendar/useDayjsLocale.d.ts +0 -93
- package/dist/components/BbCalendar/useToday.d.ts +0 -25
- package/dist/components/BbConfirm/BbConfirm.vue.d.ts +0 -4
- package/dist/components/BbConfirm/BbConfirmHost.d.ts +0 -10
- package/dist/components/BbConfirm/confirmEntry.d.ts +0 -4
- package/dist/components/BbDatePickerInput/calendarFields.d.ts +0 -91
- package/dist/components/BbDatePickerInput/dateFieldLayout.d.ts +0 -29
- package/dist/components/BbDialog/useDialogStack.d.ts +0 -19
- package/dist/components/BbDropdown/AdaptiveDropdown.vue.d.ts +0 -26
- package/dist/components/BbDropdown/BbDropdownList.vue.d.ts +0 -38
- package/dist/components/BbDropdown/DropdownPipelineResolver.vue.d.ts +0 -16
- package/dist/components/BbDropdown/DropdownRow.vue.d.ts +0 -41
- package/dist/components/BbDropdown/normalizeGroups.d.ts +0 -39
- package/dist/components/BbDropdown/pointerTrail.d.ts +0 -5
- package/dist/components/BbDropdown/useDropdownContext.d.ts +0 -131
- package/dist/components/BbDropdown/useDropdownGroupRegistry.d.ts +0 -170
- package/dist/components/BbForm/BbFormCustomField.d.ts +0 -14
- package/dist/components/BbForm/bindFormField.d.ts +0 -56
- package/dist/components/BbForm/formFields.d.ts +0 -77
- package/dist/components/BbHost/BbHostOpening.d.ts +0 -27
- package/dist/components/BbHoverCard/hoverCardFocus.d.ts +0 -29
- package/dist/components/BbIcon/iconCache.d.ts +0 -63
- package/dist/components/BbNumberInput/numberDisplay.d.ts +0 -255
- package/dist/components/BbNumberInput/platform.d.ts +0 -7
- package/dist/components/BbOffCanvas/hostCloseLabel.d.ts +0 -3
- package/dist/components/BbOffCanvas/sheetAttrs.d.ts +0 -9
- package/dist/components/BbOffCanvas/useOffCanvasStack.d.ts +0 -37
- package/dist/components/BbPagination/paginationFit.d.ts +0 -38
- package/dist/components/BbSelectPopover/knownItems.d.ts +0 -65
- package/dist/components/BbSelectPopover/reclickClears.d.ts +0 -17
- package/dist/components/BbSelectPopover/sheetChipAttrs.d.ts +0 -18
- package/dist/components/BbTable/BbTableDataRow.d.ts +0 -204
- package/dist/components/BbTable/BbTableEdgeRow.d.ts +0 -112
- package/dist/components/BbTable/BbTableExpandRow.d.ts +0 -84
- package/dist/components/BbTable/BbTableSelectToggle.d.ts +0 -128
- package/dist/components/BbTable/estimatedFloors.golden.d.ts +0 -25
- package/dist/components/BbTable/gridWidgets.d.ts +0 -30
- package/dist/components/BbTable/measuredFloors.d.ts +0 -46
- package/dist/components/BbTable/measuredFloorsTestKit.d.ts +0 -27
- package/dist/components/BbTable/textRuler.d.ts +0 -73
- package/dist/components/BbTable/useRowReorder.d.ts +0 -60
- package/dist/components/BbTable/utils.d.ts +0 -375
- package/dist/components/BbTabs/tablistName.d.ts +0 -4
- package/dist/components/BbToast/BbToast.vue.d.ts +0 -5
- package/dist/components/BbToast/BbToastMessage.vue.d.ts +0 -22
- package/dist/components/BbToast/BbToastRegion.vue.d.ts +0 -15
- package/dist/components/BbTooltip/tooltipWarmup.d.ts +0 -23
- package/dist/components/BbTree/BbTreeLevel.vue.d.ts +0 -19
- package/dist/components/BbTree/context.d.ts +0 -25
- package/dist/components/ChipsBox/ChipsBox.vue.d.ts +0 -21
- package/dist/components/ChipsBox/types.d.ts +0 -28
- package/dist/components/ClearableButton/ClearableButton.vue.d.ts +0 -6
- package/dist/components/ClearableButton/types.d.ts +0 -9
- package/dist/components/CloseIcon/CloseButton.vue.d.ts +0 -7
- package/dist/components/CloseIcon/types.d.ts +0 -2
- package/dist/components/CommaBox/CommaBox.vue.d.ts +0 -21
- package/dist/components/CommaBox/types.d.ts +0 -20
- package/dist/components/CommonField/CommonField.vue.d.ts +0 -20
- package/dist/components/CommonField/messageHeightMatrix.d.ts +0 -2
- package/dist/components/CommonFieldInput/CommonFieldInput.vue.d.ts +0 -22
- package/dist/components/CommonFieldInput/boxBorderMatrix.d.ts +0 -10
- package/dist/components/CommonFieldInput/types.d.ts +0 -114
- package/dist/components/CommonPopover/CommonPopover.vue.d.ts +0 -42
- package/dist/components/CommonPopover/resolvePlacement.d.ts +0 -9
- package/dist/components/CommonPopover/types.d.ts +0 -120
- package/dist/components/CommonTimeSelector/CommonTimeSelector.vue.d.ts +0 -48
- package/dist/components/CommonTimeSelector/useMeridiem.d.ts +0 -19
- package/dist/components/ErrorIcon/ErrorIcon.vue.d.ts +0 -7
- package/dist/components/ErrorIcon/types.d.ts +0 -3
- package/dist/components/FlatListBox/FlatListBox.vue.d.ts +0 -39
- package/dist/components/FlatListBox/types.d.ts +0 -140
- package/dist/components/GroupedListBox/GroupedListBox.vue.d.ts +0 -39
- package/dist/components/GroupedListBox/types.d.ts +0 -163
- package/dist/components/ListBox/ListBox.vue.d.ts +0 -39
- package/dist/components/ListBox/types.d.ts +0 -180
- package/dist/components/OptionsContainer/OptionsContainer.vue.d.ts +0 -20
- package/dist/components/OptionsContainer/types.d.ts +0 -168
- package/dist/components/Transitions/ScaleFade.vue.d.ts +0 -28
- package/dist/components/Transitions/Slide.vue.d.ts +0 -39
- package/dist/components/WarningIcon/WarningIcon.vue.d.ts +0 -7
- package/dist/components/WarningIcon/types.d.ts +0 -3
- package/dist/composables/__testResets.d.ts +0 -1
- package/dist/composables/autoHost.d.ts +0 -22
- package/dist/composables/formSubmitLock.d.ts +0 -48
- package/dist/composables/hostOpenings.d.ts +0 -88
- package/dist/composables/hostRegistry.d.ts +0 -47
- package/dist/composables/ssrMarker.d.ts +0 -15
- package/dist/composables/useActiveInactiveState.d.ts +0 -4
- package/dist/composables/useArray.d.ts +0 -7
- package/dist/composables/useBaseOptions.d.ts +0 -51
- package/dist/composables/useBodyScrollLock.d.ts +0 -4
- package/dist/composables/useBreakpoint.d.ts +0 -13
- package/dist/composables/useCancelableFunction.d.ts +0 -17
- package/dist/composables/useChoiceIndicator.d.ts +0 -58
- package/dist/composables/useClosingInert.d.ts +0 -28
- package/dist/composables/useCoarsePointer.d.ts +0 -9
- package/dist/composables/useCoherence.d.ts +0 -21
- package/dist/composables/useConfig.d.ts +0 -59
- package/dist/composables/useConfigDefaults.d.ts +0 -54
- package/dist/composables/useDirection.d.ts +0 -43
- package/dist/composables/useEscapeStackEntry.d.ts +0 -13
- package/dist/composables/useFrameworkDetection.d.ts +0 -12
- package/dist/composables/useHashedWatcher.d.ts +0 -19
- package/dist/composables/useHydrated.d.ts +0 -37
- package/dist/composables/useImeDismissBlur.d.ts +0 -103
- package/dist/composables/useIndexById.d.ts +0 -11
- package/dist/composables/useInertiaPage.d.ts +0 -10
- package/dist/composables/useItemText.d.ts +0 -17
- package/dist/composables/useItemValue.d.ts +0 -7
- package/dist/composables/useItemsGetter.d.ts +0 -83
- package/dist/composables/useKeyboardInset.d.ts +0 -28
- package/dist/composables/useListboxFocus.d.ts +0 -21
- package/dist/composables/useLocale.d.ts +0 -5
- package/dist/composables/useLogger.d.ts +0 -5
- package/dist/composables/useMinimalQueue.d.ts +0 -9
- package/dist/composables/useOnFalsy.d.ts +0 -2
- package/dist/composables/useOnTruthy.d.ts +0 -7
- package/dist/composables/useOverlayNavigation.d.ts +0 -37
- package/dist/composables/useOverlayYield.d.ts +0 -23
- package/dist/composables/usePrefill.d.ts +0 -44
- package/dist/composables/useQuery.d.ts +0 -39
- package/dist/composables/useRefusedCloseAnnouncement.d.ts +0 -13
- package/dist/composables/useRoute.d.ts +0 -3
- package/dist/composables/useRouter.d.ts +0 -2
- package/dist/composables/useSegmentedFields.d.ts +0 -129
- package/dist/composables/useServerPrefetch.d.ts +0 -28
- package/dist/composables/useSheetSurface.d.ts +0 -39
- package/dist/composables/useSsrState.d.ts +0 -28
- package/dist/composables/useTableWidthContext.d.ts +0 -73
- package/dist/composables/useToggleInput.d.ts +0 -44
- package/dist/composables/useTopLayer.d.ts +0 -9
- package/dist/composables/useTypeahead.d.ts +0 -112
- package/dist/composables/useUntil.d.ts +0 -7
- package/dist/composables/useUrlQueryParam.d.ts +0 -21
- package/dist/composables/useViewportWidth.d.ts +0 -14
- package/dist/deprecation/ai-deprecations.json.d.ts +0 -2984
- package/dist/deprecation/removedProps.d.ts +0 -3
- package/dist/directives/createPopoverDirective.d.ts +0 -111
- package/dist/directives/renderingInstance.d.ts +0 -2
- package/dist/i18n/eraNames.d.ts +0 -2
- package/dist/i18n/regionHints.d.ts +0 -16
- package/dist/icons-whitelist.d.ts +0 -9
- package/dist/reset.d.ts +0 -0
- package/dist/runtime/nuxt-plugin.d.ts +0 -2
- package/dist/styles.d.ts +0 -0
- package/dist/types/ExtractGenericFromComputedRef.d.ts +0 -2
- package/dist/types/ExtractGenericFromRef.d.ts +0 -2
- package/dist/types/NestedKeyOf.d.ts +0 -3
- package/dist/types/PrefixWith.d.ts +0 -1
- package/dist/types/ShapeErased.d.ts +0 -15
- package/dist/types/Simplify.d.ts +0 -6
- package/dist/utilities/calendar/canonicalParts.d.ts +0 -29
- package/dist/utilities/calendar/digits.d.ts +0 -18
- package/dist/utilities/calendar/gregorian.d.ts +0 -2
- package/dist/utilities/calendar/index.d.ts +0 -3
- package/dist/utilities/calendar/international.d.ts +0 -19
- package/dist/utilities/calendar/resolve.d.ts +0 -32
- package/dist/utilities/calendar/runtime.d.ts +0 -49
- package/dist/utilities/functions/animationsSettled.d.ts +0 -7
- package/dist/utilities/functions/bytesToUnit.d.ts +0 -2
- package/dist/utilities/functions/chunk.d.ts +0 -1
- package/dist/utilities/functions/clamp.d.ts +0 -9
- package/dist/utilities/functions/clampPrecision.d.ts +0 -1
- package/dist/utilities/functions/convertDateValue.d.ts +0 -57
- package/dist/utilities/functions/curry.d.ts +0 -6
- package/dist/utilities/functions/deburr.d.ts +0 -1
- package/dist/utilities/functions/elementLabel.d.ts +0 -8
- package/dist/utilities/functions/empty.d.ts +0 -1
- package/dist/utilities/functions/extractDomContainer.d.ts +0 -20
- package/dist/utilities/functions/findInTree.d.ts +0 -4
- package/dist/utilities/functions/flattenTree.d.ts +0 -1
- package/dist/utilities/functions/get.d.ts +0 -3
- package/dist/utilities/functions/hasVnodeListener.d.ts +0 -16
- package/dist/utilities/functions/hash.d.ts +0 -1
- package/dist/utilities/functions/head.d.ts +0 -2
- package/dist/utilities/functions/identity.d.ts +0 -1
- package/dist/utilities/functions/indexBy.d.ts +0 -11
- package/dist/utilities/functions/isDateDisabled.d.ts +0 -25
- package/dist/utilities/functions/isEqual.d.ts +0 -1
- package/dist/utilities/functions/isHex.d.ts +0 -1
- package/dist/utilities/functions/isImeComposing.d.ts +0 -7
- package/dist/utilities/functions/isNil.d.ts +0 -6
- package/dist/utilities/functions/isNotEmpty.d.ts +0 -1
- package/dist/utilities/functions/isNotNil.d.ts +0 -6
- package/dist/utilities/functions/isTextEntry.d.ts +0 -5
- package/dist/utilities/functions/isoWeek.d.ts +0 -36
- package/dist/utilities/functions/itemProps.d.ts +0 -46
- package/dist/utilities/functions/last.d.ts +0 -2
- package/dist/utilities/functions/negative.d.ts +0 -1
- package/dist/utilities/functions/noop.d.ts +0 -1
- package/dist/utilities/functions/normalizeDateBound.d.ts +0 -69
- package/dist/utilities/functions/parsePaginationNumber.d.ts +0 -22
- package/dist/utilities/functions/parseSize.d.ts +0 -3
- package/dist/utilities/functions/parseWidthString.d.ts +0 -6
- package/dist/utilities/functions/percentage.d.ts +0 -26
- package/dist/utilities/functions/pickBy.d.ts +0 -1
- package/dist/utilities/functions/range.d.ts +0 -1
- package/dist/utilities/functions/readableValue.d.ts +0 -6
- package/dist/utilities/functions/reject.d.ts +0 -25
- package/dist/utilities/functions/resolveEnumProp.d.ts +0 -19
- package/dist/utilities/functions/responsiveDefault.d.ts +0 -7
- package/dist/utilities/functions/searchRank.d.ts +0 -19
- package/dist/utilities/functions/settlesVisible.d.ts +0 -20
- package/dist/utilities/functions/snapToStep.d.ts +0 -1
- package/dist/utilities/functions/sort.d.ts +0 -6
- package/dist/utilities/functions/throttle.d.ts +0 -1
- package/dist/utilities/functions/toggleInput.d.ts +0 -114
- package/dist/utilities/functions/transpose.d.ts +0 -1
- package/dist/utilities/functions/validateDateFormat.d.ts +0 -8
- package/dist/utilities/functions/wait.d.ts +0 -2
- package/dist/utilities/functions/waitFor.d.ts +0 -9
- package/dist/utilities/functions/warnRemovedAttrs.d.ts +0 -49
- package/dist/utilities/functions/when.d.ts +0 -9
- package/dist/utilities/misc/autofocus.d.ts +0 -20
- package/dist/utilities/misc/iconsInjectionKey.d.ts +0 -15
- package/dist/utilities/misc/listboxMetrics.d.ts +0 -47
- package/dist/utilities/misc/maskaDataOptions.d.ts +0 -12
- package/dist/utilities/misc/pageText.d.ts +0 -16
- package/dist/utilities/misc/ssrValue.d.ts +0 -20
- package/dist/utilities/misc/transitions.d.ts +0 -5
- package/dist/utils/configDefaults.d.ts +0 -43
- package/dist/utils/configScope.d.ts +0 -43
- package/dist/utils/copyData.d.ts +0 -13
- package/dist/utils/focusVisibility.d.ts +0 -15
- package/dist/utils/injectLibraryStyles.d.ts +0 -8
- package/dist/utils/overlayEscapeStack.d.ts +0 -52
- package/dist/utils/overlaySurfaceIsolation.d.ts +0 -1
- package/dist/utils/passthroughDeduper.d.ts +0 -16
- package/dist/utils/releasedActivator.d.ts +0 -20
- package/dist/utils/versionCheck.d.ts +0 -19
package/llms.txt
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
> Vue 3 component library by BitBoss: forms, selects, layout, overlays, and more.
|
|
4
4
|
|
|
5
|
-
Note: the `dist/` paths below resolve inside the installed
|
|
5
|
+
Note: the `dist/` paths below resolve inside the installed `bitboss-ui` package (under `node_modules/` in a plain install, its `.yarn/unplugged` copy under Yarn PnP) and, when this file is fetched over HTTP, against https://llms-bitboss-ui.bitboss.it. `dist/` is generated and not committed, so when browsing the repository the sources are `ai/` (guides, recipes, composables) and `src/components/<Name>/<Name>.guide.md` (per-component guides).
|
|
6
6
|
|
|
7
7
|
## AI Knowledge Base
|
|
8
8
|
|
|
9
9
|
- [Core knowledge base](https://llms-bitboss-ui.bitboss.it/dist/llms-medium.txt): **Fetch this if you can only fetch one file** — hard rules, setup, component picker, design language, and the full component catalogue in ~240 KB.
|
|
10
|
-
- [Complete knowledge base](https://llms-bitboss-ui.bitboss.it/dist/llms-full.txt): Everything concatenated (~6.
|
|
10
|
+
- [Complete knowledge base](https://llms-bitboss-ui.bitboss.it/dist/llms-full.txt): Everything concatenated (~6.2 MB). Bulk ingestion only — too large to prompt with.
|
|
11
11
|
- [AI Router](dist/ai/guides/ai-router.md): **Start here** — tiny hop map for any coding agent (which file to open next).
|
|
12
12
|
- [Component index](dist/ai/index.md): Full component catalogue with agent rules, grouped by category. Each entry links a typed contract (props/events/slots/v-model).
|
|
13
13
|
- [Component API files](dist/ai/manifest/index.json): Machine-readable API, one JSON file per component (`manifest/components/<Name>.json`: every prop, event, slot, v-model and pt part, one per line, plus the public types it uses; a row marked `common: true` is whole in `manifest/common.json`) — open the index, then the one component. The same data in one ~1.2 MB file for tools is [components.json](dist/ai/components.json); its `types` array lists the public TYPE exports with a `usage` tier (`api` = the ones you reach for) and, on the `api` ones, a `usedBy` array naming the component and prop or event each is the type OF — `BbTableColumn` is `usedBy` `BbTable.columns`, a value you pass, not a tag you write. This file is props and events, not paint.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bitboss-ui",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.71",
|
|
4
4
|
"description": "Vue 3 component library by BitBoss: forms, selects, layout, overlays, and more.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -59,12 +59,15 @@
|
|
|
59
59
|
"census": "node scripts/boilerplate-census.mjs",
|
|
60
60
|
"release:check": "node scripts/release-check.mjs",
|
|
61
61
|
"release:local": "node scripts/release-local.mjs",
|
|
62
|
+
"gate": "node scripts/gate.mjs",
|
|
63
|
+
"land": "node scripts/land.mjs",
|
|
62
64
|
"push:check": "node scripts/hooks-install.mjs --repair && node scripts/pre-push-gate.mjs --sha HEAD",
|
|
63
65
|
"hooks:install": "node scripts/hooks-install.mjs",
|
|
64
66
|
"hooks:check": "node scripts/hooks-install.mjs --check",
|
|
65
67
|
"test:pre-push-gate": "bash scripts/test-pre-push-gate.sh",
|
|
66
68
|
"pack:release": "node scripts/pack.mjs",
|
|
67
69
|
"test:release-yml": "node scripts/test-release-yml.mjs",
|
|
70
|
+
"test:land": "bash scripts/test-land.sh",
|
|
68
71
|
"check:pins": "node scripts/check-pins.mjs",
|
|
69
72
|
"check:provenance": "node scripts/check-provenance.mjs",
|
|
70
73
|
"check:queue": "node scripts/check-queue.mjs",
|
|
@@ -98,7 +101,6 @@
|
|
|
98
101
|
"prepack": "node scripts/pack-guard.mjs && npm run build && npm run check:pack && npm pkg delete scripts.prepare",
|
|
99
102
|
"preview": "vite preview",
|
|
100
103
|
"storybook": "storybook dev -p 6006",
|
|
101
|
-
"test": "node scripts/ensure-manifest.mjs && npm run check:pt-keys && vitest run && node scripts/check-guide-types.mjs && node scripts/score-eval.mjs --all --offline && npm run check:test-types && node scripts/check-fixture-types.mjs && node scripts/check-recipes.mjs && node scripts/check-examples.mjs && node scripts/recipes.mjs --check && node scripts/check-doc-drift.mjs && node scripts/check-doc-ts.mjs && node scripts/run-ai-evals.mjs && node scripts/check-mcp.mjs && node scripts/check-search-coverage.mjs && node scripts/check-tokens.mjs && node scripts/check-pins.mjs && node scripts/check-deprecation-register.mjs && node scripts/check-inertia-link-props.mjs && node --experimental-strip-types scripts/check-api-consistency.ts --strict && node --experimental-strip-types scripts/check-default-docs.ts && node --experimental-strip-types scripts/generate-component-docs.ts --strict && node scripts/check-doc-links.mjs && node scripts/generate-css-migration.mjs --check && node scripts/generate-adoption-checklist.mjs --check && node --experimental-strip-types scripts/generate-config-table.ts --check",
|
|
102
104
|
"test:fixtures": "npm run build && node scripts/check-nuxt-types.mjs && node scripts/run-ssr-fixture.mjs && node scripts/invalidate-fixture-caches.mjs && FIXTURE_TARGET=dist node scripts/run-e2es.mjs fixtures/inertia/e2e && FIXTURE_TARGET=dist node scripts/run-e2es.mjs fixtures/vue/e2e && npm run test:nuxt && npm run test:nuxt:prod && node scripts/test-add.mjs",
|
|
103
105
|
"test:fixtures:src": "npm run test:inertia && npm run test:vue && npm run test:nuxt",
|
|
104
106
|
"test:inertia": "node scripts/invalidate-fixture-caches.mjs && node scripts/run-e2es.mjs fixtures/inertia/e2e",
|
|
@@ -113,8 +115,6 @@
|
|
|
113
115
|
"test:engines": "node scripts/ensure-manifest.mjs && node scripts/run-engines.mjs",
|
|
114
116
|
"test:ci:node": "node scripts/ensure-manifest.mjs && vitest run --project node --project types --project ssr",
|
|
115
117
|
"test:ci:browser": "node scripts/ensure-manifest.mjs && node scripts/run-browser-chunked.mjs 12",
|
|
116
|
-
"test:ci:gates": "npm run check:pt-keys && node scripts/check-guide-types.mjs && node scripts/score-eval.mjs --all --offline && npm run check:test-types && node scripts/check-fixture-types.mjs && node scripts/check-recipes.mjs && node scripts/check-examples.mjs && node scripts/recipes.mjs --check && node scripts/check-doc-drift.mjs && node scripts/check-doc-ts.mjs && node scripts/run-ai-evals.mjs && node scripts/check-pins.mjs && node scripts/check-deprecation-register.mjs && node scripts/check-inertia-link-props.mjs && node --experimental-strip-types scripts/check-default-docs.ts && node scripts/check-doc-links.mjs && node scripts/generate-css-migration.mjs --check && node scripts/generate-adoption-checklist.mjs --check && node --experimental-strip-types scripts/generate-config-table.ts --check && npm run check:helpers-lint && node scripts/check-provenance.mjs --strict",
|
|
117
|
-
"test:ci": "npm run test:ci:node && npm run test:ci:browser && npm run test:gregorian && npm run test:ci:gates",
|
|
118
118
|
"test:gregorian": "node scripts/test-gregorian-only.mjs",
|
|
119
119
|
"postpack": "npm pkg set \"scripts.prepare=node scripts/hooks-install.mjs\"",
|
|
120
120
|
"test:ssr": "npm run build && node scripts/run-ssr-fixture.mjs",
|
|
@@ -254,6 +254,8 @@
|
|
|
254
254
|
"!scripts/lib/boilerplate-census.mjs",
|
|
255
255
|
"!scripts/lib/fixture-library.mjs",
|
|
256
256
|
"!scripts/lib/gate.mjs",
|
|
257
|
+
"!scripts/lib/wall-steps.mjs",
|
|
258
|
+
"!scripts/lib/gate-plan.mjs",
|
|
257
259
|
"!scripts/lib/inertia-helpers.mjs",
|
|
258
260
|
"!scripts/lib/provenance.mjs",
|
|
259
261
|
"!scripts/lib/internal-notes.mjs",
|
|
@@ -271,6 +273,7 @@
|
|
|
271
273
|
"!scripts/lib/css-comment-text.mjs",
|
|
272
274
|
"!scripts/lib/css-surface.ts",
|
|
273
275
|
"!scripts/lib/design-token-manifest.mjs",
|
|
276
|
+
"!scripts/lib/dts-budget.mjs",
|
|
274
277
|
"!scripts/lib/ensure-manifest.mjs",
|
|
275
278
|
"!scripts/lib/example-checks.mjs",
|
|
276
279
|
"!scripts/lib/guide-claims.mjs",
|
package/scripts/README.md
CHANGED
|
@@ -2,42 +2,44 @@
|
|
|
2
2
|
|
|
3
3
|
Every file here is either a **gate** (fails the build when an invariant breaks)
|
|
4
4
|
or a **generator** (writes something the package ships). Nothing here is
|
|
5
|
-
optional tooling: `npm
|
|
5
|
+
optional tooling: `npm run gate` runs the wall's gates, and CI runs the same list.
|
|
6
6
|
|
|
7
7
|
The reason this file exists: a failing `check:*` tells you _what_ broke, never
|
|
8
8
|
_why anyone cared_. Read the row before you "fix" a gate by loosening it —
|
|
9
9
|
several of them exist because the thing they now catch already shipped once.
|
|
10
10
|
|
|
11
|
-
## Gates — wired into `npm
|
|
11
|
+
## Gates — wired into `npm run gate` and CI
|
|
12
12
|
|
|
13
|
-
| Command | Script | Guards
|
|
14
|
-
| --------------------- | -------------------------------- |
|
|
15
|
-
| `check:docs` | `generate-component-docs.ts` | The generated contract docs are in sync with source. `--strict` fails on any prop/event/slot the docs claim and the component does not have.
|
|
16
|
-
| `check:default-docs` | `check-default-docs.ts` | Every prop with a runtime default carries an `@defaultValue` tag, so the docs never state a default the code disagrees with.
|
|
17
|
-
| `check:doc-drift` | `check-doc-drift.mjs` | API names in prose **outside** code fences — tables and inline claims — still exist. Catches the half of doc rot the fence validator cannot see.
|
|
18
|
-
| `check:doc-ts` | `check-doc-ts.mjs` | Every `ts` fence and every `<script>` inside a `vue` fence parses, and every `bitboss-ui` import resolves to a real export via the `exports` map.
|
|
19
|
-
| `check:doc-links` | `check-doc-links.mjs` | Relative links inside the shipped `dist/ai` knowledge base resolve. A dangling link in an agent's router is a dead end.
|
|
20
|
-
| `check:recipes` | `check-recipes.mjs` | Whole-page recipes use real component APIs — same checker as the ESLint rule, so a recipe cannot teach a prop that does not exist.
|
|
21
|
-
| `check:examples` | `check-examples.mjs` | Every example (companion SFC or live guide fence) is copy-safe: imports only `vue`, `bitboss-ui` and declared packages; every provider icon name exists in its installed set, and `local:` appears only in BbIcon's guide; no `setInterval`, no mount hook, no timer that starts without a user action (Q18.21).
|
|
22
|
-
| `check:guide-types` | `check-guide-types.mjs` | The companion example SFCs on disk, and every doc code fence that uses the library (given the imports it implies), type-check against the real components.
|
|
23
|
-
| `check:fixture-types` | `check-fixture-types.mjs` | The platform fixtures type-check against the built package.
|
|
24
|
-
| `check:tokens` | `check-tokens.mjs` | Only declared `--bb-*` tokens are used, colour mixing happens `in oklab`, and percentages stay on the emphasis ladder.
|
|
25
|
-
| `check:pins` | `check-pins.mjs` | Every pin-the-bug / skipped test cites a ledger ID that exists. A pinned bug with no ledger entry quietly becomes the spec.
|
|
26
|
-
| `check:register` | `check-deprecation-register.mjs` | Every §F breaking-rename row is wired to `ai-deprecations.json`, so the runtime warner, the CLI and the ESLint autofix all know about the rename.
|
|
27
|
-
| `check:mcp` | `check-mcp.mjs` | Spawns the real MCP server and speaks JSON-RPC over stdio: all 8 tools, their schemas, refusal paths, and 8 path-traversal attempts.
|
|
28
|
-
| `check:ai-evals` | `run-ai-evals.mjs` | The golden validator tasks still pass — the regression suite for "would an agent be told the right thing?"
|
|
29
|
-
| `check-api` | `check-api-consistency.ts` | Cross-component API divergence, diffed against an accepted baseline. A NEW divergence fails; accept one with `-- --update-baseline`.
|
|
30
|
-
| `check:inertia-props` | `check-inertia-link-props.mjs` | Every prop Inertia's `Link` accepts is forwarded by BbButton. The list is hand-written because `@inertiajs/vue3` is an optional peer our public types may not import — so nothing but this gate notices when Inertia adds one.
|
|
31
|
-
| `release:check` | `release-check.mjs` | THE quality wall (lint,
|
|
32
|
-
| `hooks:install` | `hooks-install.mjs` | Installs the git hooks and the gate into `.git/bb-hooks` (checkout-independent) and sets `core.hooksPath`; `prepare` runs it. Reads the hooks from `origin/v3`, not the checkout (`--from-checkout` to try a change); `--repair` fixes a reset path first (`push:check`, Claude Code PreToolUse). `hooks:check` (`--check`) reports every broken state.
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
13
|
+
| Command | Script | Guards |
|
|
14
|
+
| --------------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| `check:docs` | `generate-component-docs.ts` | The generated contract docs are in sync with source. `--strict` fails on any prop/event/slot the docs claim and the component does not have. |
|
|
16
|
+
| `check:default-docs` | `check-default-docs.ts` | Every prop with a runtime default carries an `@defaultValue` tag, so the docs never state a default the code disagrees with. |
|
|
17
|
+
| `check:doc-drift` | `check-doc-drift.mjs` | API names in prose **outside** code fences — tables and inline claims — still exist. Catches the half of doc rot the fence validator cannot see. |
|
|
18
|
+
| `check:doc-ts` | `check-doc-ts.mjs` | Every `ts` fence and every `<script>` inside a `vue` fence parses, and every `bitboss-ui` import resolves to a real export via the `exports` map. |
|
|
19
|
+
| `check:doc-links` | `check-doc-links.mjs` | Relative links inside the shipped `dist/ai` knowledge base resolve. A dangling link in an agent's router is a dead end. |
|
|
20
|
+
| `check:recipes` | `check-recipes.mjs` | Whole-page recipes use real component APIs — same checker as the ESLint rule, so a recipe cannot teach a prop that does not exist. |
|
|
21
|
+
| `check:examples` | `check-examples.mjs` | Every example (companion SFC or live guide fence) is copy-safe: imports only `vue`, `bitboss-ui` and declared packages; every provider icon name exists in its installed set, and `local:` appears only in BbIcon's guide; no `setInterval`, no mount hook, no timer that starts without a user action (Q18.21). |
|
|
22
|
+
| `check:guide-types` | `check-guide-types.mjs` | The companion example SFCs on disk, and every doc code fence that uses the library (given the imports it implies), type-check against the real components. |
|
|
23
|
+
| `check:fixture-types` | `check-fixture-types.mjs` | The platform fixtures type-check against the built package. |
|
|
24
|
+
| `check:tokens` | `check-tokens.mjs` | Only declared `--bb-*` tokens are used, colour mixing happens `in oklab`, and percentages stay on the emphasis ladder. |
|
|
25
|
+
| `check:pins` | `check-pins.mjs` | Every pin-the-bug / skipped test cites a ledger ID that exists. A pinned bug with no ledger entry quietly becomes the spec. |
|
|
26
|
+
| `check:register` | `check-deprecation-register.mjs` | Every §F breaking-rename row is wired to `ai-deprecations.json`, so the runtime warner, the CLI and the ESLint autofix all know about the rename. |
|
|
27
|
+
| `check:mcp` | `check-mcp.mjs` | Spawns the real MCP server and speaks JSON-RPC over stdio: all 8 tools, their schemas, refusal paths, and 8 path-traversal attempts. |
|
|
28
|
+
| `check:ai-evals` | `run-ai-evals.mjs` | The golden validator tasks still pass — the regression suite for "would an agent be told the right thing?" |
|
|
29
|
+
| `check-api` | `check-api-consistency.ts` | Cross-component API divergence, diffed against an accepted baseline. A NEW divergence fails; accept one with `-- --update-baseline`. |
|
|
30
|
+
| `check:inertia-props` | `check-inertia-link-props.mjs` | Every prop Inertia's `Link` accepts is forwarded by BbButton. The list is hand-written because `@inertiajs/vue3` is an optional peer our public types may not import — so nothing but this gate notices when Inertia adds one. |
|
|
31
|
+
| `release:check` | `release-check.mjs` | THE quality wall: every static check first (build, lint, gates, dist checks, node tests), then the browser tiers, which a static red skips. Prints all results; reruns a failed vitest file once and reports it FLAKY. Writes a results record (failed files + WARN passed-only-alone); `--plan` runs a rerun's steps/files. The pre-push gate runs it on every v3 push. |
|
|
32
|
+
| `hooks:install` | `hooks-install.mjs` | Installs the git hooks and the gate into `.git/bb-hooks` (checkout-independent) and sets `core.hooksPath`; `prepare` runs it. Reads the hooks from `origin/v3`, not the checkout (`--from-checkout` to try a change); `--repair` fixes a reset path first (`push:check`, Claude Code PreToolUse). `hooks:check` (`--check`) reports every broken state. |
|
|
33
|
+
| `gate` | `gate.mjs` | The lane gate (Q96.3): build + every static check of the wall (one list, `lib/wall-steps.mjs`), then the tests touching what changed since `v3` (`-- --all` for the full suite as the wall runs it, `-- --tests=none` for static only). Every step runs; one table of exit codes + durations. Runs in your checkout before reporting; `push:check` stays the commit-exact gate. |
|
|
34
|
+
| `land` | `land.mjs` | Lands a lane branch on local `v3` (Q96.4): merge in a clean worktree of `v3` (reinstalling deps there when the merge changes `package.json`/the lockfile), `npm run gate -- --base <merge-base>` there, verify the gated tree is still exactly the merge commit, then fast-forward the main checkout only on green. Every refusal (dirty/wrong-branch main, missing or landed branch, conflict, red or tree-dirtying gate) says why and leaves `v3` untouched. Never pushes. Tested end-to-end by `test-land.sh` (`npm run test:land`). |
|
|
35
|
+
| `push:check` | `pre-push-gate.mjs --sha HEAD` | Runs the pre-push gate for HEAD without pushing, in a clean worktree, and records the pass, so the push that follows is instant. |
|
|
36
|
+
| `release:local` | `release-local.mjs` | Everything owed before a tag, in a clean short-path worktree of HEAD: the static half of release:check, fixtures:install, eval:prepare and the consumer checks, then the browser tiers, test:fixtures and test:engines. Writes a results record too and prints the tag commands on green. Red? Fix, commit, `-- --rerun-failed` (only failed steps/files, never a pass/tag); rerun green still owes one full run. |
|
|
37
|
+
| `test:pre-push-gate` | `test-pre-push-gate.sh` | End-to-end test of the pre-push hook: real `git push` calls to throwaway bare remotes, with a stub wall. |
|
|
38
|
+
| `check:pack` | `check-pack.mjs` | The tarball: required files, byte/count floors, **the manifest covers every component `src/index.ts` exports**, and the shipped + tracked variant/locale registries list built-in defaults ONLY. |
|
|
39
|
+
| `check:commit` | `check-commit-msg.mjs` | Commit message shape (the commit-msg hook). |
|
|
38
40
|
|
|
39
|
-
`check:pack` runs in CI and at `prepack
|
|
40
|
-
`dist
|
|
41
|
+
`check:pack` runs in `npm run gate`, CI and at `prepack` — it needs a built
|
|
42
|
+
`dist/`, which the gate builds first.
|
|
41
43
|
|
|
42
44
|
## Generators — they write what ships
|
|
43
45
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The agent setup with the `ai` option read from the build config, printed.
|
|
3
|
-
* Shared by the full CLI (`update
|
|
4
|
-
*
|
|
5
|
-
* `setup` runs before the app has it
|
|
6
|
-
* peers).
|
|
3
|
+
* Shared by the full CLI (`update`) and the slim entry
|
|
4
|
+
* (`setup`; the app's postinstall `update --no-install`), so it imports
|
|
5
|
+
* nothing that needs the app's `vue`: `setup` runs before the app has it
|
|
6
|
+
* (`yarn dlx` / `pnpm dlx` install no peers).
|
|
7
7
|
*/
|
|
8
8
|
import { syncAgentSetup } from './agent-setup.mjs';
|
|
9
9
|
import { syncNotice, syncProjectVariantDts } from './project-variant-dts.mjs';
|
|
@@ -11,7 +11,11 @@ import {
|
|
|
11
11
|
ensureCheckUnknownComponents,
|
|
12
12
|
strictTemplateSuggestion,
|
|
13
13
|
} from './toolchain-check.mjs';
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
agentFilesAi,
|
|
16
|
+
readToolingOptions,
|
|
17
|
+
toolingNotice,
|
|
18
|
+
} from './tooling-options.mjs';
|
|
15
19
|
|
|
16
20
|
/**
|
|
17
21
|
* The agent setup (scripts/lib/agent-setup.mjs), with the
|
|
@@ -43,9 +47,11 @@ export async function refreshAgentSetup({
|
|
|
43
47
|
const options = readToolingOptions(projectRoot);
|
|
44
48
|
const notice = toolingNotice(options);
|
|
45
49
|
if (notice) console.warn(notice);
|
|
46
|
-
// A computed `ai` cannot be read here: touch nothing
|
|
47
|
-
//
|
|
48
|
-
|
|
50
|
+
// A computed `ai` cannot be read here: touch nothing. The dev server
|
|
51
|
+
// applies the same shared answer (`agentFilesAi`), so an install and a
|
|
52
|
+
// dev start never flip-flop the files.
|
|
53
|
+
const ai = agentFilesAi(options, true);
|
|
54
|
+
if (ai === undefined)
|
|
49
55
|
return {
|
|
50
56
|
skipped: 'unreadable `ai` option',
|
|
51
57
|
results: [],
|
|
@@ -53,7 +59,7 @@ export async function refreshAgentSetup({
|
|
|
53
59
|
harnesses: [],
|
|
54
60
|
};
|
|
55
61
|
const sync = syncAgentSetup(projectRoot, {
|
|
56
|
-
ai
|
|
62
|
+
ai,
|
|
57
63
|
automatic,
|
|
58
64
|
all,
|
|
59
65
|
});
|
|
@@ -36,12 +36,12 @@ import {
|
|
|
36
36
|
readFileSync,
|
|
37
37
|
realpathSync,
|
|
38
38
|
rmSync,
|
|
39
|
-
writeFileSync,
|
|
40
39
|
} from 'node:fs';
|
|
40
|
+
import { writeFileAtomicSync } from './atomic-write.mjs';
|
|
41
41
|
import { homedir } from 'node:os';
|
|
42
42
|
import { dirname, join } from 'node:path';
|
|
43
43
|
import { fileURLToPath } from 'node:url';
|
|
44
|
-
import { agentPaths } from './pnp.mjs';
|
|
44
|
+
import { agentPaths, findYarnPnpRoot } from './pnp.mjs';
|
|
45
45
|
import { refuseLinkedTarget } from './linked-target.mjs';
|
|
46
46
|
import {
|
|
47
47
|
ensureEntry,
|
|
@@ -64,12 +64,39 @@ const DEFAULT_PATHS = {
|
|
|
64
64
|
cli: 'npx bitboss-ui',
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
+
/**
|
|
68
|
+
* How a global-only harness (Cline, Muse, JetBrains AI Assistant, the
|
|
69
|
+
* Copilot coding agent) registers the server for the project at `root`,
|
|
70
|
+
* as a sentence fragment for the agent files. Spelled out, never deferred
|
|
71
|
+
* to this project's `.mcp.json`: a Cline-only user has none (that file is
|
|
72
|
+
* written only for detected harnesses), so the agent would have to invent
|
|
73
|
+
* the entry — and the invented form is `node <project>/node_modules/…`,
|
|
74
|
+
* which does not exist under Yarn PnP. Under PnP the launch is Yarn's
|
|
75
|
+
* (`mcpLaunch`), and Yarn must find the project: the working-directory
|
|
76
|
+
* note is part of the launch, not decoration.
|
|
77
|
+
*/
|
|
78
|
+
export function globalMcpRegistration(root) {
|
|
79
|
+
const { command, args } = mcpLaunch(root);
|
|
80
|
+
const rendered = `command \`${command}\`, args \`[${args.map((a) => JSON.stringify(a)).join(', ')}]\``;
|
|
81
|
+
const pnpRoot = root ? findYarnPnpRoot(root) : null;
|
|
82
|
+
if (!pnpRoot)
|
|
83
|
+
return `${rendered} with the path made absolute (this project's folder)`;
|
|
84
|
+
const viaYarn =
|
|
85
|
+
'this project uses Yarn PnP, so there is no `node_modules` copy to run: Yarn launches the installed bin';
|
|
86
|
+
return command === 'yarn'
|
|
87
|
+
? `${rendered} with, where the harness lets you set it, the working directory set to this project's folder (${viaYarn} from inside the project)`
|
|
88
|
+
: `${rendered} with the path made absolute (this project's folder) and, where the harness lets you set it, the working directory set to this project's folder (${viaYarn})`;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const DEFAULT_MCP = globalMcpRegistration();
|
|
92
|
+
|
|
67
93
|
/* ── Content ──────────────────────────────────────────────────────────── */
|
|
68
94
|
|
|
69
95
|
/** The shared rules (paths relative to the project root). No version: see the header. */
|
|
70
96
|
export function coreRules({
|
|
71
97
|
knowledgeBase: KNOWLEDGE_BASE,
|
|
72
98
|
cli: CLI,
|
|
99
|
+
mcp: MCP = DEFAULT_MCP,
|
|
73
100
|
} = DEFAULT_PATHS) {
|
|
74
101
|
const ROUTER = `${KNOWLEDGE_BASE}/guides/ai-router.md`;
|
|
75
102
|
const CONTRACT = `${KNOWLEDGE_BASE}/guides/agent-contract.md`;
|
|
@@ -87,14 +114,14 @@ export function coreRules({
|
|
|
87
114
|
8. **Whole pages**: one recipe under \`${KNOWLEDGE_BASE}/recipes/{vue|nuxt|inertia}/\` (see the router table).
|
|
88
115
|
9. **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 10, not a library bug. One primary action per view region.
|
|
89
116
|
10. **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.
|
|
90
|
-
11. **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.
|
|
117
|
+
11. **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. A starter or default global stylesheet (element rules on \`h1\`, \`button\`, \`body\`, a centred \`#app\`) can override bitboss-ui's look, so check it if components or headings look wrong.
|
|
91
118
|
12. **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 (the runtime plugin injects the library's sheet; never import it yourself). Do both halves — a registered name with no CSS ships an unstyled pill, and CSS with no registration fails \`vue-tsc\`. After registering, run \`${CLI} 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.
|
|
92
119
|
13. **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.
|
|
93
120
|
14. **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.
|
|
94
121
|
15. **After writing bitboss-ui markup**, run \`${CLI} check\` — validates \`Bb*\` usage against the installed \`components.json\` and catches invented/removed props before review. In an edit loop, \`${CLI} check --changed\` checks only the files git sees changed; run the full check before you finish.
|
|
95
122
|
16. **Inertia apps: install the app-side helpers with \`${CLI} add <name>\`** (\`useQueryObject\`, \`usePromiseForm\`, \`useTableContext\`, …; \`${CLI} helpers list\` names them). Never paste them from the guide. If \`add\` or \`helpers update\` refuses, stop and show the user its output and \`${CLI} helpers diff <name>\`; never edit \`bitboss-ui.lock.json\`, and never delete a helper file to get past a refusal.
|
|
96
123
|
|
|
97
|
-
**MCP in a harness with no project config file** (Cline, Muse, JetBrains AI Assistant, the GitHub Copilot coding agent): if the \`bitboss-ui\` tools are not available, ask the user before registering the server in that harness's own settings: name \`${MCP_SERVER_NAME}\`,
|
|
124
|
+
**MCP in a harness with no project config file** (Cline, Muse, JetBrains AI Assistant, the GitHub Copilot coding agent): if the \`bitboss-ui\` tools are not available, ask the user before registering the server in that harness's own settings: name \`${MCP_SERVER_NAME}\`, ${MCP} (the same launch this project's \`.mcp.json\` entry carries when it has one). Cline: \`~/.cline/data/settings/cline_mcp_settings.json\` (\`mcpServers\`). Muse: \`~/.config/muse/settings.json\`. JetBrains AI Assistant: Settings → Tools → AI Assistant → Model Context Protocol. Copilot coding agent: the repository's Settings → Copilot → Coding agent → MCP configuration (\`mcpServers\`, with \`"tools": ["*"]\`).
|
|
98
125
|
|
|
99
126
|
Never upgrade bitboss-ui on your own. When the user asks for it, run \`${CLI} update\`: it installs the newest release on the app's channel, refreshes these files and lists the breaking changes to fix. Installs refresh these files too (the app's \`postinstall\`).`;
|
|
100
127
|
}
|
|
@@ -254,7 +281,7 @@ export const HARNESSES = [
|
|
|
254
281
|
},
|
|
255
282
|
];
|
|
256
283
|
|
|
257
|
-
/** Files
|
|
284
|
+
/** Files the retired `ai-init` wrote that AGENTS.md now covers. */
|
|
258
285
|
const LEGACY_FILES = [
|
|
259
286
|
// Whole files, ours when they carry our heading.
|
|
260
287
|
{ path: '.cursor/rules/bitboss-ui.mdc', ours: /^# bitboss-ui \(v/m },
|
|
@@ -323,7 +350,7 @@ function upsertBlock(path, fragment, header) {
|
|
|
323
350
|
refuseLinkedTarget(path, ROOT_CTX.root);
|
|
324
351
|
if (!existsSync(path)) {
|
|
325
352
|
mkdirSync(dirname(path), { recursive: true });
|
|
326
|
-
|
|
353
|
+
writeFileAtomicSync(
|
|
327
354
|
path,
|
|
328
355
|
`${header ? `${header}\n\n` : ''}${fragment}\n`,
|
|
329
356
|
'utf-8'
|
|
@@ -338,7 +365,7 @@ function upsertBlock(path, fragment, header) {
|
|
|
338
365
|
? current.slice(0, range[0]) + fragment + current.slice(range[1])
|
|
339
366
|
: `${current.trimEnd()}\n\n${fragment}\n`;
|
|
340
367
|
if (next === current) return 'unchanged';
|
|
341
|
-
|
|
368
|
+
writeFileAtomicSync(path, next, 'utf-8');
|
|
342
369
|
return range ? 'updated' : 'appended';
|
|
343
370
|
}
|
|
344
371
|
|
|
@@ -355,11 +382,11 @@ function removeBlock(path, header) {
|
|
|
355
382
|
rmSync(path);
|
|
356
383
|
return 'deleted';
|
|
357
384
|
}
|
|
358
|
-
|
|
385
|
+
writeFileAtomicSync(path, `${rest}\n`, 'utf-8');
|
|
359
386
|
return 'removed';
|
|
360
387
|
}
|
|
361
388
|
|
|
362
|
-
/** A skill file this package wrote (now or by
|
|
389
|
+
/** A skill file this package wrote (now or by the retired `ai-init`). */
|
|
363
390
|
const OUR_SKILL = /<!-- Written by bitboss-ui|^# bitboss-ui knowledge base\b/m;
|
|
364
391
|
|
|
365
392
|
function writeWhole(path, content) {
|
|
@@ -373,7 +400,7 @@ function writeWhole(path, content) {
|
|
|
373
400
|
}
|
|
374
401
|
const existed = existsSync(path);
|
|
375
402
|
mkdirSync(dirname(path), { recursive: true });
|
|
376
|
-
|
|
403
|
+
writeFileAtomicSync(path, content, 'utf-8');
|
|
377
404
|
return existed ? 'updated' : 'created';
|
|
378
405
|
}
|
|
379
406
|
|
|
@@ -394,7 +421,7 @@ function ensureToml(path, root) {
|
|
|
394
421
|
const current = existsSync(path) ? readFileSync(path, 'utf-8') : null;
|
|
395
422
|
if (current === null) {
|
|
396
423
|
mkdirSync(dirname(path), { recursive: true });
|
|
397
|
-
|
|
424
|
+
writeFileAtomicSync(path, `${TOML_BLOCK}\n`, 'utf-8');
|
|
398
425
|
return { action: 'created' };
|
|
399
426
|
}
|
|
400
427
|
const range = tomlRange(current);
|
|
@@ -416,7 +443,7 @@ function ensureToml(path, root) {
|
|
|
416
443
|
? current.slice(0, range[0]) + TOML_BLOCK + current.slice(range[1])
|
|
417
444
|
: `${current.trimEnd()}\n\n${TOML_BLOCK}\n`;
|
|
418
445
|
if (next === current) return { action: 'unchanged' };
|
|
419
|
-
|
|
446
|
+
writeFileAtomicSync(path, next, 'utf-8');
|
|
420
447
|
return { action: 'updated' };
|
|
421
448
|
}
|
|
422
449
|
|
|
@@ -431,7 +458,7 @@ function removeToml(path) {
|
|
|
431
458
|
rmSync(path);
|
|
432
459
|
return 'deleted';
|
|
433
460
|
}
|
|
434
|
-
|
|
461
|
+
writeFileAtomicSync(path, `${rest}\n`, 'utf-8');
|
|
435
462
|
return 'removed';
|
|
436
463
|
}
|
|
437
464
|
|
|
@@ -599,8 +626,12 @@ export function syncAgentSetup(root, options = {}) {
|
|
|
599
626
|
}
|
|
600
627
|
|
|
601
628
|
const used = all ? HARNESSES : detectHarnesses(root, { home, env });
|
|
602
|
-
// A Yarn PnP app reads the knowledge base from its unplugged copy
|
|
603
|
-
|
|
629
|
+
// A Yarn PnP app reads the knowledge base from its unplugged copy, and
|
|
630
|
+
// its global-only harnesses launch the server through Yarn.
|
|
631
|
+
const paths = {
|
|
632
|
+
...agentPaths(root, PACKAGE_ROOT),
|
|
633
|
+
mcp: globalMcpRegistration(root),
|
|
634
|
+
};
|
|
604
635
|
if (agentsInClaude) {
|
|
605
636
|
// One file, two names: the whole block goes in it, never an import of
|
|
606
637
|
// itself.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `writeFileSync` that never shows a torn file: the content lands whole, or
|
|
3
|
+
* the old content stays. The setup writers (`setup`, the agent refresh a
|
|
4
|
+
* postinstall runs, the dev server's catch-up sync) rewrite files other
|
|
5
|
+
* processes read at unpredictable moments — a dev server starting, an MCP
|
|
6
|
+
* host loading its config — and an in-place write truncates first, so a
|
|
7
|
+
* reader in that window sees an empty or half-written `package.json`; a
|
|
8
|
+
* crash in the same window leaves it that way.
|
|
9
|
+
*
|
|
10
|
+
* Write to a dot-prefixed temp file in the SAME directory, then rename over
|
|
11
|
+
* the target: rename is atomic, so every reader sees one whole version or
|
|
12
|
+
* the other. The renamed file keeps the replaced file's mode, and a
|
|
13
|
+
* symlinked target is written through (the link survives; its target is
|
|
14
|
+
* replaced). The temp file is removed on failure. When the directory
|
|
15
|
+
* refuses the temp file or the rename (`EACCES`/`EPERM` — a read-only
|
|
16
|
+
* directory around a writable file), fall back to the in-place write the
|
|
17
|
+
* callers had before: degraded, but no worse than not trying.
|
|
18
|
+
*/
|
|
19
|
+
import {
|
|
20
|
+
chmodSync,
|
|
21
|
+
lstatSync,
|
|
22
|
+
readlinkSync,
|
|
23
|
+
realpathSync,
|
|
24
|
+
renameSync,
|
|
25
|
+
rmSync,
|
|
26
|
+
statSync,
|
|
27
|
+
writeFileSync,
|
|
28
|
+
} from 'node:fs';
|
|
29
|
+
import { basename, dirname, join, resolve } from 'node:path';
|
|
30
|
+
|
|
31
|
+
let counter = 0;
|
|
32
|
+
|
|
33
|
+
/** `path` itself, or where it points when it is a symbolic link. */
|
|
34
|
+
function targetOf(path) {
|
|
35
|
+
try {
|
|
36
|
+
if (!lstatSync(path).isSymbolicLink()) return path;
|
|
37
|
+
} catch {
|
|
38
|
+
return path;
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
return realpathSync(path);
|
|
42
|
+
} catch {
|
|
43
|
+
// A dangling link: still write where it points.
|
|
44
|
+
try {
|
|
45
|
+
return resolve(dirname(path), readlinkSync(path));
|
|
46
|
+
} catch {
|
|
47
|
+
return path;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @param {string} path
|
|
54
|
+
* @param {string | Buffer | Uint8Array} data
|
|
55
|
+
* @param {BufferEncoding} [encoding]
|
|
56
|
+
*/
|
|
57
|
+
export function writeFileAtomicSync(path, data, encoding = 'utf-8') {
|
|
58
|
+
const target = targetOf(path);
|
|
59
|
+
let mode;
|
|
60
|
+
try {
|
|
61
|
+
mode = statSync(target).mode & 0o7777;
|
|
62
|
+
} catch {
|
|
63
|
+
mode = undefined;
|
|
64
|
+
}
|
|
65
|
+
const tmp = join(
|
|
66
|
+
dirname(target),
|
|
67
|
+
`.${basename(target)}.tmp-${process.pid}-${counter++}-${Math.random().toString(36).slice(2, 10)}`
|
|
68
|
+
);
|
|
69
|
+
try {
|
|
70
|
+
writeFileSync(tmp, data, encoding);
|
|
71
|
+
if (mode !== undefined) chmodSync(tmp, mode);
|
|
72
|
+
renameSync(tmp, target);
|
|
73
|
+
} catch (error) {
|
|
74
|
+
try {
|
|
75
|
+
rmSync(tmp, { force: true });
|
|
76
|
+
} catch {
|
|
77
|
+
/* the original error is the one that matters */
|
|
78
|
+
}
|
|
79
|
+
if (error?.code === 'EACCES' || error?.code === 'EPERM') {
|
|
80
|
+
writeFileSync(target, data, encoding);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
throw error;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
* stamp is silent.
|
|
10
10
|
*
|
|
11
11
|
* The revisions and their reasons: ai/helpers/define-preset.json. A code change
|
|
12
|
-
* to the bench file without a new revision fails
|
|
12
|
+
* to the bench file without a new revision fails the node tier
|
|
13
13
|
* (define-preset-copy.node.test.mjs).
|
|
14
14
|
*/
|
|
15
15
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
16
16
|
import { dirname, join } from 'node:path';
|
|
17
|
+
import { findYarnPnpRoot, relativePosix } from './pnp.mjs';
|
|
17
18
|
|
|
18
19
|
export const STALE_DEFINE_PRESET_KIND = 'stale-define-preset';
|
|
19
20
|
/** The checked copy, the file the build ships. */
|
|
@@ -26,6 +27,19 @@ export const DEFINE_PRESET_DIST_LEDGER = 'helpers/definePreset.json';
|
|
|
26
27
|
/** What an app runs to copy or update it. */
|
|
27
28
|
export const DEFINE_PRESET_CP_SOURCE = `node_modules/bitboss-ui/dist/ai/${DEFINE_PRESET_DIST}`;
|
|
28
29
|
|
|
30
|
+
/**
|
|
31
|
+
* The `cp` source naming the shipped file for the project at
|
|
32
|
+
* `projectRoot` (the copy beside `aiDir`, the `<dist>/ai` being judged
|
|
33
|
+
* against): today's `node_modules` string in a plain install, and under
|
|
34
|
+
* Yarn PnP that file's real on-disk (unplugged) path from the project
|
|
35
|
+
* root — a PnP project has no `node_modules` folder to copy from.
|
|
36
|
+
*/
|
|
37
|
+
export function definePresetCpSource(aiDir, projectRoot) {
|
|
38
|
+
if (!aiDir || !projectRoot || !findYarnPnpRoot(projectRoot))
|
|
39
|
+
return DEFINE_PRESET_CP_SOURCE;
|
|
40
|
+
return relativePosix(projectRoot, join(aiDir, DEFINE_PRESET_DIST));
|
|
41
|
+
}
|
|
42
|
+
|
|
29
43
|
const STAMP = /\/\/\s*bitboss-ui definePreset rev (\d+)\b/;
|
|
30
44
|
const EXPORTS_DEFINE_PRESET =
|
|
31
45
|
/\bexport\s+(?:(?:async\s+)?function\s*\*?\s*|(?:const|let|var)\s+)definePreset\b/;
|
|
@@ -78,9 +92,15 @@ const SOURCE_FILE = /\.(?:[cm]?[jt]sx?|vue)$/;
|
|
|
78
92
|
|
|
79
93
|
/**
|
|
80
94
|
* One finding per project copy older than `shipped` or unstamped.
|
|
81
|
-
* `files` are `{ path, relPath }`; `readText` reads a path.
|
|
95
|
+
* `files` are `{ path, relPath }`; `readText` reads a path. `cpSource`
|
|
96
|
+
* names the shipped file for this project (`definePresetCpSource`).
|
|
82
97
|
*/
|
|
83
|
-
export function staleDefinePresetFindings(
|
|
98
|
+
export function staleDefinePresetFindings(
|
|
99
|
+
files,
|
|
100
|
+
readText,
|
|
101
|
+
shipped,
|
|
102
|
+
cpSource = DEFINE_PRESET_CP_SOURCE
|
|
103
|
+
) {
|
|
84
104
|
if (!shipped) return [];
|
|
85
105
|
const findings = [];
|
|
86
106
|
const ships = `bitboss-ui ships rev ${shipped.rev}${shipped.reason ? ` (${shipped.reason})` : ''}`;
|
|
@@ -104,7 +124,7 @@ export function staleDefinePresetFindings(files, readText, shipped) {
|
|
|
104
124
|
message: stamp
|
|
105
125
|
? `this definePreset copy is rev ${stamp.rev}; ${ships}.`
|
|
106
126
|
: `this definePreset copy has no revision stamp, so it predates rev 3; ${ships}.`,
|
|
107
|
-
hint: `update it: cp ${
|
|
127
|
+
hint: `update it: cp ${cpSource} ${relPath}`,
|
|
108
128
|
});
|
|
109
129
|
}
|
|
110
130
|
return findings;
|