basalt-ui 1.28.0 → 1.29.1
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/AGENTS.md +12 -19
- package/CHANGELOG.md +23 -0
- package/MIGRATING.md +171 -7
- package/README.md +66 -105
- package/agent/rules/basalt-batteries.md +60 -183
- package/agent/rules/basalt-charts.md +56 -75
- package/agent/rules/basalt-controls.md +38 -69
- package/agent/rules/basalt-mantine.md +58 -103
- package/agent/rules/basalt-state.md +42 -60
- package/agent/rules/basalt-tokens.md +46 -67
- package/agent/skills/basalt-app/SKILL.md +2 -0
- package/agent/templates/CLAUDE-block.md.tpl +14 -14
- package/agent/templates/query-client.ts.tpl +1 -1
- package/configs/oxlint-plugin.js +84 -254
- package/configs/oxlint-plugin.test.ts +23 -266
- package/configs/oxlint.json +0 -2
- package/dist/agent/ai-sdk-transport.d.ts.map +1 -1
- package/dist/agent/ai-sdk-transport.js +7 -4
- package/dist/agent/coalesce.js +1 -1
- package/dist/agent/merge.js +1 -1
- package/dist/agent/transport.d.ts +13 -2
- package/dist/agent/transport.d.ts.map +1 -1
- package/dist/agent/use-agent-thread-runs.d.ts +12 -1
- package/dist/agent/use-agent-thread-runs.d.ts.map +1 -1
- package/dist/agent/use-agent-thread-runs.js +20 -6
- package/dist/agent-chat/index.d.ts +1 -1
- package/dist/agent-chat/index.d.ts.map +1 -1
- package/dist/agent-chat/relative-time.js +1 -1
- package/dist/agent-chat/thread-detail-panel.js +1 -1
- package/dist/agent-chat/thread-feed-row.d.ts +32 -7
- package/dist/agent-chat/thread-feed-row.d.ts.map +1 -1
- package/dist/agent-chat/thread-feed-row.js +121 -86
- package/dist/agent-chat/thread-feed.d.ts +11 -1
- package/dist/agent-chat/thread-feed.d.ts.map +1 -1
- package/dist/agent-chat/thread-feed.js +10 -6
- package/dist/agent-chat/thread-message.js +1 -1
- package/dist/agent-chat/virtualize.d.ts +39 -0
- package/dist/agent-chat/virtualize.d.ts.map +1 -1
- package/dist/agent-chat/virtualize.js +15 -0
- package/dist/charts/index.d.ts +3 -3
- package/dist/charts/index.d.ts.map +1 -1
- package/dist/charts/index.js +8 -4
- package/dist/charts/kinds/BandStrip.js +1 -1
- package/dist/charts/kinds/Bars.d.ts +1 -3
- package/dist/charts/kinds/Bars.d.ts.map +1 -1
- package/dist/charts/kinds/Bars.js +1 -1
- package/dist/charts/kinds/DualPanel.d.ts +3 -1
- package/dist/charts/kinds/DualPanel.d.ts.map +1 -1
- package/dist/charts/kinds/DualPanel.js +1 -1
- package/dist/charts/kinds/StackedArea.js +1 -1
- package/dist/charts/kinds/ZonedLine.d.ts +1 -3
- package/dist/charts/kinds/ZonedLine.d.ts.map +1 -1
- package/dist/charts/primitives/Axes.d.ts +21 -2
- package/dist/charts/primitives/Axes.d.ts.map +1 -1
- package/dist/charts/primitives/Axes.js +34 -2
- package/dist/charts/primitives/ChartCard.d.ts +20 -4
- package/dist/charts/primitives/ChartCard.d.ts.map +1 -1
- package/dist/charts/primitives/ChartCard.js +62 -33
- package/dist/charts/primitives/ChartFrame.d.ts.map +1 -1
- package/dist/charts/primitives/ChartFrame.js +8 -1
- package/dist/charts/primitives/ChartPending.d.ts +12 -6
- package/dist/charts/primitives/ChartPending.d.ts.map +1 -1
- package/dist/charts/primitives/ChartPending.js +1 -1
- package/dist/charts/utils/format.d.ts +5 -92
- package/dist/charts/utils/format.d.ts.map +1 -1
- package/dist/charts/utils/format.js +10 -80
- package/dist/cli/audit-allows.d.ts +24 -0
- package/dist/cli/audit-allows.d.ts.map +1 -0
- package/dist/cli/audit-allows.js +240 -0
- package/dist/cli/check-theme.d.ts +10 -0
- package/dist/cli/check-theme.d.ts.map +1 -0
- package/dist/cli/check-theme.js +139 -0
- package/dist/cli/doctor.d.ts +47 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +197 -0
- package/dist/cli/guard-hook.d.ts +9 -0
- package/dist/cli/guard-hook.d.ts.map +1 -0
- package/dist/cli/guard-hook.js +93 -0
- package/dist/cli/help.d.ts +9 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +53 -0
- package/dist/cli/index.d.ts +360 -270
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +85 -1901
- package/dist/cli/init.d.ts +4 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +165 -0
- package/dist/cli/sync.d.ts +43 -0
- package/dist/cli/sync.d.ts.map +1 -0
- package/dist/cli/sync.js +206 -0
- package/dist/cli/tokens-css.d.ts +51 -0
- package/dist/cli/tokens-css.d.ts.map +1 -0
- package/dist/cli/tokens-css.js +165 -0
- package/dist/commands/define-commands.js +1 -1
- package/dist/commands/define-overlays.js +1 -1
- package/dist/commands/index.d.ts +2 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +6 -0
- package/dist/commands/overlays-mount.d.ts +7 -9
- package/dist/commands/overlays-mount.d.ts.map +1 -1
- package/dist/commands/shell-bridge.d.ts +57 -0
- package/dist/commands/shell-bridge.d.ts.map +1 -0
- package/dist/commands/shell-bridge.js +32 -0
- package/dist/common/errors.d.ts +35 -0
- package/dist/common/errors.d.ts.map +1 -1
- package/dist/common/errors.js +29 -1
- package/dist/common/index.d.ts +2 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +6 -0
- package/dist/common/is-dev.d.ts.map +1 -0
- package/dist/{motion/index.d.ts → common/motion.d.ts} +1 -1
- package/dist/common/motion.d.ts.map +1 -0
- package/dist/common/props.d.ts +1 -1
- package/dist/common/props.d.ts.map +1 -1
- package/dist/common/validate.js +1 -1
- package/dist/content/markdown.d.ts +3 -4
- package/dist/content/markdown.d.ts.map +1 -1
- package/dist/content/markdown.js +1 -4
- package/dist/controls/actions.d.ts +1 -1
- package/dist/controls/actions.d.ts.map +1 -1
- package/dist/controls/panel-row.js +1 -1
- package/dist/controls/range-filter.js +1 -1
- package/dist/dashboard/delta-badge.d.ts +18 -10
- package/dist/dashboard/delta-badge.d.ts.map +1 -1
- package/dist/dashboard/delta-badge.js +33 -1
- package/dist/dashboard/empty-state.d.ts +1 -4
- package/dist/dashboard/empty-state.d.ts.map +1 -1
- package/dist/dashboard/empty-state.js +1 -2
- package/dist/dashboard/index.d.ts +4 -2
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +7 -1
- package/dist/dashboard/query-state.d.ts +4 -13
- package/dist/dashboard/query-state.d.ts.map +1 -1
- package/dist/dashboard/query-state.js +4 -7
- package/dist/{section → dashboard}/section.d.ts +2 -2
- package/dist/{section → dashboard}/section.d.ts.map +1 -1
- package/dist/{section → dashboard}/section.js +2 -2
- package/dist/dashboard/settings-section.d.ts +1 -1
- package/dist/dashboard/settings-section.d.ts.map +1 -1
- package/dist/dashboard/settings-section.js +1 -1
- package/dist/dashboard/stat-card.d.ts +1 -1
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +1 -1
- package/dist/dashboard/widget-header.d.ts.map +1 -0
- package/dist/data/data-table.js +2 -2
- package/dist/data/table.d.ts +1 -1
- package/dist/data/table.d.ts.map +1 -1
- package/dist/data/table.js +2 -16
- package/dist/data/virtual.d.ts +3 -3
- package/dist/dev-dock.d.ts +26 -0
- package/dist/dev-dock.d.ts.map +1 -0
- package/dist/dev-dock.js +85 -0
- package/dist/format/date.d.ts +62 -0
- package/dist/format/date.d.ts.map +1 -0
- package/dist/format/date.js +106 -0
- package/dist/format/index.d.ts +39 -0
- package/dist/format/index.d.ts.map +1 -0
- package/dist/format/index.js +54 -0
- package/dist/format/measure.d.ts +15 -0
- package/dist/format/measure.d.ts.map +1 -0
- package/dist/format/measure.js +16 -0
- package/dist/format/number.d.ts +69 -0
- package/dist/format/number.d.ts.map +1 -0
- package/dist/format/number.js +62 -0
- package/dist/format/shared.d.ts +27 -0
- package/dist/format/shared.d.ts.map +1 -0
- package/dist/format/shared.js +29 -0
- package/dist/forms/field.d.ts +4 -20
- package/dist/forms/field.d.ts.map +1 -1
- package/dist/forms/field.js +0 -4
- package/dist/forms/form-layout.d.ts +1 -1
- package/dist/forms/form-layout.d.ts.map +1 -1
- package/dist/forms/form-layout.js +1 -1
- package/dist/forms/index.d.ts +1 -1
- package/dist/forms/index.d.ts.map +1 -1
- package/dist/forms/index.js +1 -2
- package/dist/forms/use-form-submit.d.ts +1 -1
- package/dist/forms/use-form-submit.js +1 -1
- package/dist/guard/index.d.ts +2 -9
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +53 -32
- package/dist/guard/types.d.ts +8 -10
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/index.d.ts +16 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -29
- package/dist/notifications/index.d.ts +5 -5
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +0 -2
- package/dist/notifications/mount-guard.d.ts.map +1 -1
- package/dist/notifications/mount-guard.js +2 -2
- package/dist/provider/connectivity-indicator.d.ts.map +1 -0
- package/dist/{connectivity → provider}/connectivity-provider.d.ts +1 -1
- package/dist/provider/connectivity-provider.d.ts.map +1 -0
- package/dist/{connectivity/types.d.ts → provider/connectivity-types.d.ts} +1 -1
- package/dist/provider/connectivity-types.d.ts.map +1 -0
- package/dist/provider/error-fallback.module.css +21 -0
- package/dist/provider/error-fallback.module.css.d.ts +9 -0
- package/dist/provider/index.d.ts +20 -36
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +42 -32
- package/dist/provider/lab-theme.js +1 -1
- package/dist/provider/use-connectivity.d.ts +3 -0
- package/dist/provider/use-connectivity.d.ts.map +1 -0
- package/dist/query-client.d.ts +67 -0
- package/dist/query-client.d.ts.map +1 -0
- package/dist/query-client.js +35 -0
- package/dist/{query/devtools.d.ts → query-devtools.d.ts} +2 -2
- package/dist/query-devtools.d.ts.map +1 -0
- package/dist/register.d.ts +17 -3
- package/dist/register.d.ts.map +1 -1
- package/dist/router-tanstack/index.d.ts +4 -7
- package/dist/router-tanstack/index.d.ts.map +1 -1
- package/dist/router-tanstack/index.js +1 -9
- package/dist/router-tanstack/nav.d.ts +1 -1
- package/dist/router-tanstack/nav.d.ts.map +1 -1
- package/dist/router-tanstack/search-store.d.ts +3 -6
- package/dist/router-tanstack/search-store.d.ts.map +1 -1
- package/dist/router-tanstack/use-nav.d.ts +1 -1
- package/dist/router-tanstack/use-nav.d.ts.map +1 -1
- package/dist/shell/app-breadcrumbs.d.ts +1 -1
- package/dist/shell/app-breadcrumbs.d.ts.map +1 -1
- package/dist/shell/app-main.module.css +11 -0
- package/dist/shell/app-mobile-nav.d.ts +1 -1
- package/dist/shell/app-mobile-nav.d.ts.map +1 -1
- package/dist/shell/app-mobile-nav.js +24 -2
- package/dist/shell/app-sidebar.d.ts +1 -1
- package/dist/shell/app-sidebar.d.ts.map +1 -1
- package/dist/shell/app-sidebar.js +31 -2
- package/dist/shell/app-sidebar.module.css +10 -0
- package/dist/shell/index.d.ts +10 -4
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +13 -17
- package/dist/shell/mobile-nav-model.d.ts +1 -1
- package/dist/shell/mobile-nav-model.d.ts.map +1 -1
- package/dist/{nav/types.d.ts → shell/nav-types.d.ts} +1 -1
- package/dist/shell/nav-types.d.ts.map +1 -0
- package/dist/shell/page-aside.d.ts.map +1 -1
- package/dist/shell/page-aside.js +2 -29
- package/dist/shell/page-title.d.ts +14 -0
- package/dist/shell/page-title.d.ts.map +1 -0
- package/dist/shell/page-title.js +25 -0
- package/dist/shell/page-title.module.css +33 -0
- package/dist/shell/page-title.module.css.d.ts +11 -0
- package/dist/shell/sidebar-block-model.d.ts +1 -1
- package/dist/shell/sidebar-block-model.d.ts.map +1 -1
- package/dist/shell/sidebar-blocks.d.ts +1 -1
- package/dist/shell/sidebar-blocks.d.ts.map +1 -1
- package/dist/shell/use-breakpoint.d.ts +11 -0
- package/dist/shell/use-breakpoint.d.ts.map +1 -0
- package/dist/shell/use-breakpoint.js +33 -0
- package/dist/state/fields.d.ts +3 -19
- package/dist/state/fields.d.ts.map +1 -1
- package/dist/state/fields.js +6 -16
- package/dist/styles.css +36 -0
- package/dist/surfaces.d.ts +18 -41
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +48 -60
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/{theme-toggle/index.d.ts → theme/theme-toggle.d.ts} +1 -1
- package/dist/theme/theme-toggle.d.ts.map +1 -0
- package/dist/{theme-toggle/index.js → theme/theme-toggle.js} +1 -1
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +10 -0
- package/dist/tokens/palette.d.ts +12 -0
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +13 -1
- package/dist/tokens.css +1 -0
- package/llms.txt +9 -24
- package/package.json +12 -16
- package/src/agent/ai-sdk-transport.ts +11 -4
- package/src/agent/coalesce.ts +1 -1
- package/src/agent/merge.ts +1 -1
- package/src/agent/transport.ts +15 -2
- package/src/agent/use-agent-thread-runs.ts +65 -15
- package/src/agent-chat/index.ts +6 -4
- package/src/agent-chat/relative-time.ts +1 -1
- package/src/agent-chat/thread-detail-panel.tsx +1 -1
- package/src/agent-chat/thread-feed-row.tsx +105 -30
- package/src/agent-chat/thread-feed.tsx +51 -25
- package/src/agent-chat/thread-message.tsx +1 -1
- package/src/agent-chat/virtualize.ts +48 -0
- package/src/charts/index.ts +7 -10
- package/src/charts/kinds/BandStrip.tsx +1 -1
- package/src/charts/kinds/Bars.tsx +2 -5
- package/src/charts/kinds/DualPanel.tsx +4 -3
- package/src/charts/kinds/StackedArea.tsx +1 -1
- package/src/charts/kinds/ZonedLine.tsx +1 -4
- package/src/charts/primitives/Axes.tsx +49 -0
- package/src/charts/primitives/ChartCard.tsx +49 -6
- package/src/charts/primitives/ChartFrame.tsx +5 -1
- package/src/charts/primitives/ChartPending.tsx +14 -8
- package/src/charts/utils/format.ts +17 -186
- package/src/cli/audit-allows.ts +371 -0
- package/src/cli/check-theme.ts +197 -0
- package/src/cli/doctor.ts +331 -0
- package/src/cli/guard-hook.ts +115 -0
- package/src/cli/help.ts +101 -0
- package/src/cli/index.ts +269 -3439
- package/src/cli/init.ts +247 -0
- package/src/cli/sync.ts +324 -0
- package/src/cli/tokens-css.ts +252 -0
- package/src/commands/define-commands.ts +1 -1
- package/src/commands/define-overlays.ts +1 -1
- package/src/commands/index.ts +10 -1
- package/src/commands/overlays-mount.tsx +8 -10
- package/src/commands/shell-bridge.ts +86 -0
- package/src/common/errors.ts +70 -0
- package/src/common/index.ts +2 -0
- package/src/common/props.ts +1 -1
- package/src/common/validate.ts +1 -1
- package/src/content/markdown.tsx +4 -8
- package/src/controls/actions.tsx +1 -1
- package/src/controls/panel-row.tsx +1 -1
- package/src/controls/range-filter.tsx +1 -1
- package/src/dashboard/delta-badge.tsx +74 -7
- package/src/dashboard/empty-state.tsx +2 -6
- package/src/dashboard/index.ts +11 -2
- package/src/dashboard/query-state.tsx +5 -18
- package/src/{section → dashboard}/section.tsx +4 -4
- package/src/dashboard/settings-section.tsx +2 -2
- package/src/dashboard/stat-card.tsx +2 -2
- package/src/data/data-table.tsx +3 -3
- package/src/data/table.ts +6 -25
- package/src/data/virtual-list.tsx +1 -1
- package/src/data/virtual.ts +3 -3
- package/src/dev-dock.tsx +162 -0
- package/src/format/date.ts +184 -0
- package/src/format/index.ts +69 -0
- package/src/format/measure.ts +31 -0
- package/src/format/number.ts +129 -0
- package/src/format/shared.ts +63 -0
- package/src/forms/field.ts +4 -24
- package/src/forms/form-layout.tsx +2 -2
- package/src/forms/index.ts +1 -2
- package/src/forms/use-form-submit.ts +2 -2
- package/src/guard/index.ts +80 -69
- package/src/guard/types.ts +7 -10
- package/src/index.ts +38 -29
- package/src/notifications/index.ts +5 -7
- package/src/notifications/mount-guard.ts +7 -9
- package/src/{connectivity → provider}/connectivity-indicator.tsx +1 -1
- package/src/{connectivity → provider}/connectivity-provider.tsx +1 -1
- package/src/provider/error-fallback.module.css +21 -0
- package/src/provider/error-fallback.module.css.d.ts +9 -0
- package/src/provider/index.tsx +71 -71
- package/src/provider/lab-theme.ts +1 -1
- package/src/{connectivity → provider}/use-connectivity.ts +3 -3
- package/src/query-client.ts +105 -0
- package/src/{query/devtools.tsx → query-devtools.tsx} +5 -4
- package/src/register.ts +20 -4
- package/src/router-tanstack/index.ts +4 -15
- package/src/router-tanstack/nav.ts +1 -1
- package/src/router-tanstack/search-store.ts +3 -4
- package/src/router-tanstack/use-nav.ts +1 -1
- package/src/shell/app-breadcrumbs.tsx +1 -1
- package/src/shell/app-main.module.css +11 -0
- package/src/shell/app-mobile-nav.tsx +28 -1
- package/src/shell/app-sidebar.module.css +10 -0
- package/src/shell/app-sidebar.tsx +31 -2
- package/src/shell/index.tsx +23 -28
- package/src/shell/mobile-nav-model.ts +1 -1
- package/src/shell/page-aside.tsx +2 -52
- package/src/shell/page-title.module.css +33 -0
- package/src/shell/page-title.module.css.d.ts +11 -0
- package/src/shell/page-title.tsx +57 -0
- package/src/shell/sidebar-block-model.ts +1 -1
- package/src/shell/sidebar-blocks.tsx +1 -1
- package/src/shell/use-breakpoint.ts +73 -0
- package/src/state/fields.ts +7 -43
- package/src/styles.css +36 -0
- package/src/surfaces.ts +47 -61
- package/src/theme/index.ts +7 -0
- package/src/{theme-toggle/index.tsx → theme/theme-toggle.tsx} +1 -1
- package/src/tokens/index.ts +10 -0
- package/src/tokens/palette.ts +12 -0
- package/dist/connectivity/connectivity-indicator.d.ts.map +0 -1
- package/dist/connectivity/connectivity-provider.d.ts.map +0 -1
- package/dist/connectivity/index.d.ts +0 -14
- package/dist/connectivity/index.d.ts.map +0 -1
- package/dist/connectivity/index.js +0 -8
- package/dist/connectivity/types.d.ts.map +0 -1
- package/dist/connectivity/use-connectivity.d.ts +0 -3
- package/dist/connectivity/use-connectivity.d.ts.map +0 -1
- package/dist/data/index.d.ts +0 -38
- package/dist/data/index.d.ts.map +0 -1
- package/dist/data/index.js +0 -24
- package/dist/motion/index.d.ts.map +0 -1
- package/dist/nav/types.d.ts.map +0 -1
- package/dist/notifications/overlay.d.ts +0 -20
- package/dist/notifications/overlay.d.ts.map +0 -1
- package/dist/notifications/overlay.js +0 -14
- package/dist/query/devtools.d.ts.map +0 -1
- package/dist/query/error-message.d.ts +0 -41
- package/dist/query/error-message.d.ts.map +0 -1
- package/dist/query/error-message.js +0 -30
- package/dist/query/index.d.ts +0 -47
- package/dist/query/index.d.ts.map +0 -1
- package/dist/query/index.js +0 -56
- package/dist/router-tanstack/field.d.ts +0 -14
- package/dist/router-tanstack/field.d.ts.map +0 -1
- package/dist/router-tanstack/field.js +0 -4
- package/dist/router-tanstack/multi-search-param-store.d.ts +0 -43
- package/dist/router-tanstack/multi-search-param-store.d.ts.map +0 -1
- package/dist/router-tanstack/multi-search-param-store.js +0 -30
- package/dist/router-tanstack/search-param-store.d.ts +0 -42
- package/dist/router-tanstack/search-param-store.d.ts.map +0 -1
- package/dist/router-tanstack/search-param-store.js +0 -25
- package/dist/section/index.d.ts +0 -2
- package/dist/section/index.d.ts.map +0 -1
- package/dist/section/index.js +0 -4
- package/dist/theme-toggle/index.d.ts.map +0 -1
- package/dist/utils/is-dev.d.ts.map +0 -1
- package/dist/widget-header/delta-badge.d.ts +0 -19
- package/dist/widget-header/delta-badge.d.ts.map +0 -1
- package/dist/widget-header/delta-badge.js +0 -36
- package/dist/widget-header/index.d.ts +0 -3
- package/dist/widget-header/index.d.ts.map +0 -1
- package/dist/widget-header/index.js +0 -8
- package/dist/widget-header/widget-header.d.ts.map +0 -1
- package/src/connectivity/index.ts +0 -19
- package/src/data/index.ts +0 -69
- package/src/notifications/overlay.tsx +0 -66
- package/src/query/error-message.ts +0 -70
- package/src/query/index.ts +0 -97
- package/src/router-tanstack/field.ts +0 -36
- package/src/router-tanstack/multi-search-param-store.ts +0 -106
- package/src/router-tanstack/search-param-store.ts +0 -100
- package/src/section/index.ts +0 -1
- package/src/widget-header/delta-badge.tsx +0 -77
- package/src/widget-header/index.ts +0 -10
- /package/dist/{utils → common}/is-dev.d.ts +0 -0
- /package/dist/{utils → common}/is-dev.js +0 -0
- /package/dist/{motion/index.js → common/motion.js} +0 -0
- /package/dist/{section → dashboard}/section.module.css +0 -0
- /package/dist/{section → dashboard}/section.module.css.d.ts +0 -0
- /package/dist/{widget-header → dashboard}/widget-header.d.ts +0 -0
- /package/dist/{widget-header → dashboard}/widget-header.js +0 -0
- /package/dist/{widget-header → dashboard}/widget-header.module.css +0 -0
- /package/dist/{widget-header → dashboard}/widget-header.module.css.d.ts +0 -0
- /package/dist/{connectivity → provider}/connectivity-indicator.d.ts +0 -0
- /package/dist/{connectivity → provider}/connectivity-indicator.js +0 -0
- /package/dist/{connectivity → provider}/connectivity-provider.js +0 -0
- /package/dist/{connectivity/types.js → provider/connectivity-types.js} +0 -0
- /package/dist/{connectivity → provider}/use-connectivity.js +0 -0
- /package/dist/{query/devtools.js → query-devtools.js} +0 -0
- /package/dist/{nav/types.js → shell/nav-types.js} +0 -0
- /package/src/{utils → common}/is-dev.ts +0 -0
- /package/src/{motion/index.ts → common/motion.ts} +0 -0
- /package/src/{section → dashboard}/section.module.css +0 -0
- /package/src/{section → dashboard}/section.module.css.d.ts +0 -0
- /package/src/{widget-header → dashboard}/widget-header.module.css +0 -0
- /package/src/{widget-header → dashboard}/widget-header.module.css.d.ts +0 -0
- /package/src/{widget-header → dashboard}/widget-header.tsx +0 -0
- /package/src/{connectivity/types.ts → provider/connectivity-types.ts} +0 -0
- /package/src/{nav/types.ts → shell/nav-types.ts} +0 -0
package/configs/oxlint-plugin.js
CHANGED
|
@@ -80,16 +80,38 @@ import { fileURLToPath } from 'node:url'
|
|
|
80
80
|
|
|
81
81
|
// ── Shared helpers ──────────────────────────────────────────────────────────────────────────────
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Guard kinds and plugin rules RETIRED — kept recognized by `KNOWN_RULE_IDS` (below) and the
|
|
85
|
+
* guard's own `PLUGIN_RULE_IDS` copy so an existing `theme-allow <id>` reads as a dead waiver via
|
|
86
|
+
* `check-theme --audit-allows`, never as a typo.
|
|
87
|
+
*
|
|
88
|
+
* - `unframed-chart` (regex: a `<ChartLegend items={[...]}>` array literal) →
|
|
89
|
+
* `basalt/chart-legend-literal`, which also catches the `.map()`-over-a-non-series form the
|
|
90
|
+
* regex never could reach.
|
|
91
|
+
* - `duplicate-notifications-mount` — its only case, `<BasaltNotifications />` mounted beside
|
|
92
|
+
* `<BasaltOverlays notifications>`, is unreachable now that `BasaltNotifications` no longer
|
|
93
|
+
* exists as a standalone export; the rule had nothing left to fire on.
|
|
94
|
+
* - `query-dual-import` — its whole premise (a raw `@tanstack/react-query` import beside
|
|
95
|
+
* `basalt-ui/query`) is unreachable now that C1 (1.29.0) dropped the `./query` subpath: a
|
|
96
|
+
* consumer MUST import `@tanstack/react-query` directly, so the rule warned on every such
|
|
97
|
+
* import instead of the drift it was written to catch.
|
|
98
|
+
*/
|
|
99
|
+
export const RETIRED_RULE_IDS = new Set([
|
|
100
|
+
'unframed-chart',
|
|
101
|
+
'duplicate-notifications-mount',
|
|
102
|
+
'query-dual-import',
|
|
103
|
+
])
|
|
104
|
+
|
|
83
105
|
/**
|
|
84
106
|
* Rule ids a `theme-allow` may name — this plugin's own rules plus `src/guard`'s kinds. Duplicated
|
|
85
107
|
* by hand for the same reason `majorOf` is: this file loads standalone out of a consumer's
|
|
86
108
|
* node_modules and must not import from the package.
|
|
87
109
|
*
|
|
88
110
|
* Exported, and `oxlint-plugin.test.ts` asserts it is EXACTLY the plugin's own rule ids plus
|
|
89
|
-
* `GUARD_RULES`'s keys
|
|
90
|
-
* not know is treated as a typo, so the annotation naming it waives
|
|
91
|
-
* {@link parseThemeAllow}); before the fail-closed change it was worse still, silently
|
|
92
|
-
* a blanket waiver.
|
|
111
|
+
* `GUARD_RULES`'s keys plus `RETIRED_RULE_IDS`. Forgetting an entry here is not a cosmetic
|
|
112
|
+
* omission — an id this set does not know is treated as a typo, so the annotation naming it waives
|
|
113
|
+
* nothing (see {@link parseThemeAllow}); before the fail-closed change it was worse still, silently
|
|
114
|
+
* widening to a blanket waiver.
|
|
93
115
|
*/
|
|
94
116
|
export const KNOWN_RULE_IDS = new Set([
|
|
95
117
|
// this plugin
|
|
@@ -111,7 +133,6 @@ export const KNOWN_RULE_IDS = new Set([
|
|
|
111
133
|
'search-literal-link',
|
|
112
134
|
'use-search-from-literal',
|
|
113
135
|
'provider-above-router',
|
|
114
|
-
'duplicate-notifications-mount',
|
|
115
136
|
'query-dual-import',
|
|
116
137
|
'query-fn-unwrap',
|
|
117
138
|
'deprecated-export',
|
|
@@ -121,6 +142,7 @@ export const KNOWN_RULE_IDS = new Set([
|
|
|
121
142
|
'visx-boundary',
|
|
122
143
|
'visx-tooltip',
|
|
123
144
|
'token-layer-boundary',
|
|
145
|
+
'no-import-meta-env',
|
|
124
146
|
// These three honour `basalt-agent-allow`, never `theme-allow` — but they are real ids, so an
|
|
125
147
|
// annotation naming one must parse as a (useless) scoped annotation rather than as prose.
|
|
126
148
|
'agent-resume-guard',
|
|
@@ -142,7 +164,6 @@ export const KNOWN_RULE_IDS = new Set([
|
|
|
142
164
|
'inline-display',
|
|
143
165
|
'raw-visx-axis',
|
|
144
166
|
'raw-motion-value',
|
|
145
|
-
'unframed-chart',
|
|
146
167
|
'chart-missing-aria-label',
|
|
147
168
|
'raw-form-control',
|
|
148
169
|
'sub-16-input-font',
|
|
@@ -154,6 +175,9 @@ export const KNOWN_RULE_IDS = new Set([
|
|
|
154
175
|
'hidden-inline-style',
|
|
155
176
|
'in-body-page-title',
|
|
156
177
|
'raw-selection-control',
|
|
178
|
+
// Retired guard kinds — no longer in GUARD_RULES, but a `theme-allow` naming one must still
|
|
179
|
+
// parse as a real (dead) waiver rather than an unknown-id typo. See RETIRED_RULE_IDS above.
|
|
180
|
+
...RETIRED_RULE_IDS,
|
|
157
181
|
])
|
|
158
182
|
|
|
159
183
|
const ALLOW_RULE_TOKEN = /^(?:basalt\/)?([a-z][a-z0-9-]*)(?=$|[\s,:—–])/
|
|
@@ -3338,202 +3362,15 @@ const providerAboveRouter = {
|
|
|
3338
3362
|
},
|
|
3339
3363
|
}
|
|
3340
3364
|
|
|
3341
|
-
//
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
'the notifications layer; drop the standalone mount, or pass `notifications={false}` to ' +
|
|
3347
|
-
'BasaltOverlays if the standalone one is the mount you want. ' +
|
|
3348
|
-
'(basalt/duplicate-notifications-mount)'
|
|
3349
|
-
|
|
3350
|
-
/**
|
|
3351
|
-
* The ancestor chain from `node` up to its `Program`, OUTERMOST first — captured during the visit,
|
|
3352
|
-
* because `node.parent` is only walkable then, and compared at `Program:exit`. Unlike
|
|
3353
|
-
* {@link ancestorTagBindings} it keeps the NODES, which is what makes a nearest-common-ancestor
|
|
3354
|
-
* question answerable at all.
|
|
3355
|
-
*/
|
|
3356
|
-
function ancestorChain(node) {
|
|
3357
|
-
const chain = []
|
|
3358
|
-
let current = node
|
|
3359
|
-
for (let depth = 0; current !== null && current !== undefined; depth++) {
|
|
3360
|
-
if (depth > ANCESTRY_MAX_DEPTH) break
|
|
3361
|
-
chain.push(current)
|
|
3362
|
-
if (current.type === 'Program') break
|
|
3363
|
-
current = current.parent
|
|
3364
|
-
}
|
|
3365
|
-
return chain.toReversed()
|
|
3366
|
-
}
|
|
3367
|
-
|
|
3368
|
-
/**
|
|
3369
|
-
* True when two nodes sit in DIFFERENT branches of ONE conditional — `a ? <X/> : <Y/>`, or the two
|
|
3370
|
-
* operands of one `&&`/`||`. Exactly one of the pair ever renders, so a double-mount rule firing on
|
|
3371
|
-
* them would be reporting a mount that cannot happen.
|
|
3372
|
-
*
|
|
3373
|
-
* Deliberately the NEAREST common ancestor only, and deliberately expression-level: two separate
|
|
3374
|
-
* `cond && <X/>` expressions under one parent are NOT exclusive (both conditions can hold), and an
|
|
3375
|
-
* `if`/`return` split across statements is a control-flow question this does not pretend to answer.
|
|
3376
|
-
* The runtime guard in `src/commands/overlays-mount.tsx` is the lane that counts real mounts.
|
|
3377
|
-
*/
|
|
3378
|
-
function mutuallyExclusive(chainA, chainB) {
|
|
3379
|
-
let i = 0
|
|
3380
|
-
while (i < chainA.length && i < chainB.length && chainA[i] === chainB[i]) i++
|
|
3381
|
-
const ancestor = chainA[i - 1]
|
|
3382
|
-
const branchA = chainA[i]
|
|
3383
|
-
const branchB = chainB[i]
|
|
3384
|
-
if (ancestor === undefined || branchA === undefined || branchB === undefined) return false
|
|
3385
|
-
const [first, second] =
|
|
3386
|
-
ancestor.type === 'ConditionalExpression'
|
|
3387
|
-
? [ancestor.consequent, ancestor.alternate]
|
|
3388
|
-
: ancestor.type === 'LogicalExpression'
|
|
3389
|
-
? [ancestor.left, ancestor.right]
|
|
3390
|
-
: [undefined, undefined]
|
|
3391
|
-
if (first === undefined || second === undefined) return false
|
|
3392
|
-
return (branchA === first && branchB === second) || (branchA === second && branchB === first)
|
|
3393
|
-
}
|
|
3394
|
-
|
|
3395
|
-
/**
|
|
3396
|
-
* `<BasaltOverlays notifications>` and `<BasaltNotifications />` in ONE file — F5, the second
|
|
3397
|
-
* `basalt-mantine.md` law with no guard, and the static half of a warning that already exists at
|
|
3398
|
-
* runtime (`src/commands/overlays-mount.tsx` warns in dev when both mount).
|
|
3399
|
-
*
|
|
3400
|
-
* A pair split across the two branches of one conditional is EXEMPT: `a ? <BasaltNotifications/> :
|
|
3401
|
-
* <BasaltOverlays/>` is a file with two mounts written and one mount rendered, and reporting it
|
|
3402
|
-
* taught a consumer to reach for a waiver over code that was already right.
|
|
3403
|
-
*
|
|
3404
|
-
* `notifications` DEFAULTS to true on `BasaltOverlays`, so the absence of the attribute counts as
|
|
3405
|
-
* enabled and only an explicit `notifications={false}` clears it — the same polarity the component
|
|
3406
|
-
* itself reads. Both tags are provenance-gated through {@link collectBasaltImportMap}.
|
|
3407
|
-
*
|
|
3408
|
-
* Same-FILE only, and deliberately so: the runtime warning is the lane that sees a cross-file
|
|
3409
|
-
* double mount, because it counts real mounts rather than JSX. This is the cheap half that catches
|
|
3410
|
-
* it before the app runs, which is the whole reason a static twin is worth having.
|
|
3411
|
-
*/
|
|
3412
|
-
// Ships: warn (grace → 1.30.0)
|
|
3413
|
-
const duplicateNotificationsMount = {
|
|
3414
|
-
meta: {
|
|
3415
|
-
type: 'suggestion',
|
|
3416
|
-
docs: {
|
|
3417
|
-
description: 'Warn when BasaltOverlays and a standalone BasaltNotifications both mount.',
|
|
3418
|
-
},
|
|
3419
|
-
schema: [],
|
|
3420
|
-
},
|
|
3421
|
-
create(context) {
|
|
3422
|
-
if (isTestFile(context)) return {}
|
|
3423
|
-
const ownTree = isBasaltOwnSource(getFilename(context))
|
|
3424
|
-
const basalt = new Map()
|
|
3425
|
-
const mounts = []
|
|
3426
|
-
|
|
3427
|
-
return {
|
|
3428
|
-
ImportDeclaration(node) {
|
|
3429
|
-
collectBasaltImportMap(node, basalt, ownTree)
|
|
3430
|
-
},
|
|
3431
|
-
JSXOpeningElement(node) {
|
|
3432
|
-
const root = jsxRootName(node.name)
|
|
3433
|
-
if (root === undefined || !basalt.has(root)) return
|
|
3434
|
-
// `notifications` DEFAULTS to true, so only an explicit `={false}` clears the layer.
|
|
3435
|
-
const disabled = (node.attributes ?? []).some(
|
|
3436
|
-
(attr) =>
|
|
3437
|
-
attr.type === 'JSXAttribute' &&
|
|
3438
|
-
attr.name?.name === 'notifications' &&
|
|
3439
|
-
unwrapExpressionContainer(attr.value)?.value === false,
|
|
3440
|
-
)
|
|
3441
|
-
mounts.push({ node, root, disabled, chain: ancestorChain(node) })
|
|
3442
|
-
},
|
|
3443
|
-
'Program:exit'() {
|
|
3444
|
-
const overlays = mounts.filter(
|
|
3445
|
-
({ root, disabled }) => basalt.get(root) === 'BasaltOverlays' && !disabled,
|
|
3446
|
-
)
|
|
3447
|
-
if (overlays.length === 0) return
|
|
3448
|
-
for (const { node, root, chain } of mounts) {
|
|
3449
|
-
if (basalt.get(root) !== 'BasaltNotifications') continue
|
|
3450
|
-
// Every enabled overlays mount on the other branch of one conditional → nothing to report.
|
|
3451
|
-
if (overlays.every((overlay) => mutuallyExclusive(overlay.chain, chain))) continue
|
|
3452
|
-
if (hasThemeAllow(context, node, 'duplicate-notifications-mount')) continue
|
|
3453
|
-
context.report({ node, message: DUPLICATE_NOTIFICATIONS_MOUNT_MESSAGE })
|
|
3454
|
-
}
|
|
3455
|
-
},
|
|
3456
|
-
}
|
|
3457
|
-
},
|
|
3458
|
-
}
|
|
3459
|
-
|
|
3460
|
-
// ── Rule 27 — query-dual-import ─────────────────────────────────────────────────────────────────
|
|
3461
|
-
|
|
3462
|
-
/** `@tanstack/react-query` and its subpaths — never `@tanstack/react-query-devtools`. */
|
|
3463
|
-
const TANSTACK_QUERY_SOURCE = /^@tanstack\/react-query(?:\/|$)/
|
|
3365
|
+
// Rule 27 — query-dual-import — RETIRED. 1.29.0 dropped every raw TanStack re-export from
|
|
3366
|
+
// `basalt-ui/query` (the subpath itself is gone), so "dual-importing `@tanstack/react-query`
|
|
3367
|
+
// beside `basalt-ui/query`" is no longer a thing a consumer can even do — a consumer MUST import
|
|
3368
|
+
// `@tanstack/react-query` directly now, and this rule warned on every such import (90+ false
|
|
3369
|
+
// positives on argo alone). See `RETIRED_RULE_IDS` below.
|
|
3464
3370
|
|
|
3465
|
-
/** The `basalt-ui/query` subpath, exactly —
|
|
3371
|
+
/** The `basalt-ui/query` subpath, exactly — kept for `query-fn-unwrap`'s own gate below. */
|
|
3466
3372
|
const BASALT_QUERY_SOURCE = 'basalt-ui/query'
|
|
3467
3373
|
|
|
3468
|
-
/** The root barrel — where `QueryState` and the dashboard composites live. */
|
|
3469
|
-
const BASALT_ROOT_SOURCE = 'basalt-ui'
|
|
3470
|
-
|
|
3471
|
-
const QUERY_DUAL_IMPORT_MESSAGE =
|
|
3472
|
-
'Dual query import — this file imports from @tanstack/react-query AND from basalt-ui/query. ' +
|
|
3473
|
-
'Take the hooks, the client factory and `unwrap` from basalt-ui/query only: two entry points to ' +
|
|
3474
|
-
'one library is how a second QueryClient, a second devtools bundle and a duplicated ' +
|
|
3475
|
-
'`toErrorMessage` reach an app (agent/rules/basalt-batteries.md). ' +
|
|
3476
|
-
'(basalt/query-dual-import)'
|
|
3477
|
-
|
|
3478
|
-
const QUERY_ROOT_IMPORT_MESSAGE =
|
|
3479
|
-
'Raw @tanstack/react-query import in a basalt file — the hooks come through basalt-ui/query, ' +
|
|
3480
|
-
'which re-exports them beside `createBasaltQueryClient`, `unwrap`, `toErrorMessage` and the lazy ' +
|
|
3481
|
-
'devtools (agent/rules/basalt-batteries.md). Import from basalt-ui/query instead. ' +
|
|
3482
|
-
'(basalt/query-dual-import)'
|
|
3483
|
-
|
|
3484
|
-
/**
|
|
3485
|
-
* The `basalt-batteries.md` law "import query hooks from `basalt-ui/query`, never dual-import
|
|
3486
|
-
* `@tanstack/react-query`" — F5, and one of the two `./query` surfaces that shipped advisory.
|
|
3487
|
-
*
|
|
3488
|
-
* TWO forms, one id, because they are one law read at two strengths. The DUAL form (both
|
|
3489
|
-
* specifiers present) is the law verbatim. The softer form — a raw `@tanstack/react-query` import
|
|
3490
|
-
* in a file that also imports the basalt root barrel — is a heuristic: it says "this file is
|
|
3491
|
-
* already a basalt file, so the query seam is right there", and it is the form that actually
|
|
3492
|
-
* catches the drift, since a file that has never heard of `basalt-ui/query` cannot dual-import.
|
|
3493
|
-
* The softer form is why the whole rule lands at `warn` rather than `error`.
|
|
3494
|
-
*
|
|
3495
|
-
* Gated on the LITERAL specifier, never on `ownTree` relative resolution: basalt's own
|
|
3496
|
-
* `src/query/**` and `src/dashboard/query-state.tsx` import `@tanstack/react-query` because they
|
|
3497
|
-
* ARE the seam, and they reach their siblings relatively. A file that writes `basalt-ui/query` is
|
|
3498
|
-
* by definition a consumer of the published surface.
|
|
3499
|
-
*/
|
|
3500
|
-
// Ships: warn (grace → 1.30.0)
|
|
3501
|
-
const queryDualImport = {
|
|
3502
|
-
meta: {
|
|
3503
|
-
type: 'suggestion',
|
|
3504
|
-
docs: { description: 'Warn on a raw @tanstack/react-query import beside a basalt import.' },
|
|
3505
|
-
schema: [],
|
|
3506
|
-
},
|
|
3507
|
-
create(context) {
|
|
3508
|
-
if (isTestFile(context)) return {}
|
|
3509
|
-
const raw = []
|
|
3510
|
-
let basaltQuery = false
|
|
3511
|
-
let basaltRoot = false
|
|
3512
|
-
|
|
3513
|
-
return {
|
|
3514
|
-
ImportDeclaration(node) {
|
|
3515
|
-
const source = node.source?.value
|
|
3516
|
-
if (typeof source !== 'string') return
|
|
3517
|
-
if (source === BASALT_QUERY_SOURCE) basaltQuery = true
|
|
3518
|
-
else if (source === BASALT_ROOT_SOURCE) basaltRoot = true
|
|
3519
|
-
// `import type { UseQueryResult } from '@tanstack/react-query'` is erased at compile time
|
|
3520
|
-
// — there is no runtime import to route through the seam, and typing against the library's
|
|
3521
|
-
// own result type is exactly what `QueryStateLike` documents as legitimate. Same skip
|
|
3522
|
-
// `agent-no-raw-usechat` and `ai-sdk-major` take.
|
|
3523
|
-
else if (TANSTACK_QUERY_SOURCE.test(source) && node.importKind !== 'type') raw.push(node)
|
|
3524
|
-
},
|
|
3525
|
-
'Program:exit'() {
|
|
3526
|
-
if (!basaltQuery && !basaltRoot) return
|
|
3527
|
-
const message = basaltQuery ? QUERY_DUAL_IMPORT_MESSAGE : QUERY_ROOT_IMPORT_MESSAGE
|
|
3528
|
-
for (const node of raw) {
|
|
3529
|
-
if (hasThemeAllow(context, node, 'query-dual-import')) continue
|
|
3530
|
-
context.report({ node, message })
|
|
3531
|
-
}
|
|
3532
|
-
},
|
|
3533
|
-
}
|
|
3534
|
-
},
|
|
3535
|
-
}
|
|
3536
|
-
|
|
3537
3374
|
// ── Rule 28 — query-fn-unwrap ───────────────────────────────────────────────────────────────────
|
|
3538
3375
|
|
|
3539
3376
|
const QUERY_FN_UNWRAP_MESSAGE =
|
|
@@ -3643,36 +3480,8 @@ const queryFnUnwrap = {
|
|
|
3643
3480
|
* @type {readonly DeprecatedExport[]}
|
|
3644
3481
|
*/
|
|
3645
3482
|
export const DEPRECATED_EXPORTS = [
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
name: 'field',
|
|
3649
|
-
replacement: 'inputProps',
|
|
3650
|
-
removeIn: '1.29.0',
|
|
3651
|
-
// Not a drop-in: `inputProps` no longer returns `key`, so a rename alone would silently drop
|
|
3652
|
-
// the reconciler key. The nudge stays; the rewrite is `basalt/forms-field-key`'s job.
|
|
3653
|
-
fix: false,
|
|
3654
|
-
},
|
|
3655
|
-
{
|
|
3656
|
-
subpath: 'basalt-ui',
|
|
3657
|
-
name: 'BasaltProvider',
|
|
3658
|
-
prop: 'sseUrl',
|
|
3659
|
-
replacement: 'connectivity={{ sseUrl }}',
|
|
3660
|
-
removeIn: '1.29.0',
|
|
3661
|
-
},
|
|
3662
|
-
{
|
|
3663
|
-
subpath: 'basalt-ui',
|
|
3664
|
-
name: 'BasaltProvider',
|
|
3665
|
-
prop: 'healthUrl',
|
|
3666
|
-
replacement: 'connectivity={{ healthUrl }}',
|
|
3667
|
-
removeIn: '1.29.0',
|
|
3668
|
-
},
|
|
3669
|
-
{
|
|
3670
|
-
subpath: 'basalt-ui',
|
|
3671
|
-
name: 'BasaltProvider',
|
|
3672
|
-
prop: 'healthIntervalMs',
|
|
3673
|
-
replacement: 'connectivity={{ healthIntervalMs }}',
|
|
3674
|
-
removeIn: '1.29.0',
|
|
3675
|
-
},
|
|
3483
|
+
// Empty since 1.29.0: every 1.28.x deprecation was removed on schedule. The next
|
|
3484
|
+
// deprecation adds a row here in the same commit as its @deprecated JSDoc and MIGRATING entry.
|
|
3676
3485
|
]
|
|
3677
3486
|
|
|
3678
3487
|
function deprecatedExportMessage(row) {
|
|
@@ -3914,6 +3723,51 @@ const formsFieldKey = {
|
|
|
3914
3723
|
},
|
|
3915
3724
|
}
|
|
3916
3725
|
|
|
3726
|
+
// ── Rule 31 — no-import-meta-env ────────────────────────────────────────────────────────────────
|
|
3727
|
+
|
|
3728
|
+
const NO_IMPORT_META_ENV_MESSAGE =
|
|
3729
|
+
'import.meta.env is banned in shipped basalt-ui source — this package is consumed both as a ' +
|
|
3730
|
+
'Vite-bundled dep AND resolved directly by a consumer whose own bundler may define no ' +
|
|
3731
|
+
'import.meta.env at all (basaltViteConfig defines process.env.NODE_ENV precisely so basalt ' +
|
|
3732
|
+
'code never needs it). Use process.env.NODE_ENV instead. (basalt/no-import-meta-env)'
|
|
3733
|
+
|
|
3734
|
+
/**
|
|
3735
|
+
* `import.meta.env` — a MemberExpression whose object is the `import.meta` MetaProperty and whose
|
|
3736
|
+
* property is `env`. Repo-local only: a CONSUMER's own app code legitimately uses
|
|
3737
|
+
* `import.meta.env.VITE_*` for its own config, so this must never reach the shipped preset — only
|
|
3738
|
+
* `/.oxlintrc.json` wires it, scoped to `packages/basalt-ui/src/**` the same way the Mantine-free
|
|
3739
|
+
* boundaries above are scoped, rather than through path logic in the rule itself (unlike
|
|
3740
|
+
* `token-layer-boundary`, which every package resolves the plugin from and so has to self-scope).
|
|
3741
|
+
*/
|
|
3742
|
+
// Ships: repo-local only
|
|
3743
|
+
const noImportMetaEnv = {
|
|
3744
|
+
meta: {
|
|
3745
|
+
type: 'suggestion',
|
|
3746
|
+
docs: {
|
|
3747
|
+
description: 'Disallow import.meta.env — basalt-ui source must use process.env.NODE_ENV.',
|
|
3748
|
+
},
|
|
3749
|
+
schema: [],
|
|
3750
|
+
},
|
|
3751
|
+
create(context) {
|
|
3752
|
+
if (isTestFile(context)) return {}
|
|
3753
|
+
|
|
3754
|
+
return {
|
|
3755
|
+
MemberExpression(node) {
|
|
3756
|
+
const object = node.object
|
|
3757
|
+
if (
|
|
3758
|
+
object?.type !== 'MetaProperty' ||
|
|
3759
|
+
object.meta?.name !== 'import' ||
|
|
3760
|
+
object.property?.name !== 'meta'
|
|
3761
|
+
)
|
|
3762
|
+
return
|
|
3763
|
+
if (node.computed || node.property?.name !== 'env') return
|
|
3764
|
+
if (hasThemeAllow(context, node, 'no-import-meta-env')) return
|
|
3765
|
+
context.report({ node, message: NO_IMPORT_META_ENV_MESSAGE })
|
|
3766
|
+
},
|
|
3767
|
+
}
|
|
3768
|
+
},
|
|
3769
|
+
}
|
|
3770
|
+
|
|
3917
3771
|
// ── Grace ledger ────────────────────────────────────────────────────────────────────────────────
|
|
3918
3772
|
|
|
3919
3773
|
/**
|
|
@@ -3990,29 +3844,6 @@ export const PLUGIN_RULE_GRACE = {
|
|
|
3990
3844
|
'image-gen and the playground is measured — every one of them mounts a router, so the ' +
|
|
3991
3845
|
'false-positive question has a real sample.',
|
|
3992
3846
|
},
|
|
3993
|
-
'duplicate-notifications-mount': {
|
|
3994
|
-
since: '1.28.0',
|
|
3995
|
-
promote: '1.30.0',
|
|
3996
|
-
why:
|
|
3997
|
-
'F5 — the static half of a double-mount the runtime already warns about in dev ' +
|
|
3998
|
-
'(`src/commands/overlays-mount.tsx`). Same-file only, so like its sibling it guards a ' +
|
|
3999
|
-
'fraction of the law and cannot claim `error`. It also reads a prop DEFAULT (`notifications` ' +
|
|
4000
|
-
'is true when unwritten), which is the kind of polarity a consumer disagrees with exactly ' +
|
|
4001
|
-
'once before it is worth knowing about — a minor at `warn` is how that disagreement arrives ' +
|
|
4002
|
-
'as feedback rather than as a broken build.',
|
|
4003
|
-
},
|
|
4004
|
-
'query-dual-import': {
|
|
4005
|
-
since: '1.28.0',
|
|
4006
|
-
promote: '1.30.0',
|
|
4007
|
-
why:
|
|
4008
|
-
'F5 — the basalt-batteries.md law with no guard. TWO forms under one id: the dual import ' +
|
|
4009
|
-
'(both `@tanstack/react-query` and `basalt-ui/query` in one file) is the law verbatim, and ' +
|
|
4010
|
-
'the softer form — a raw `@tanstack/react-query` import in a file that also imports the ' +
|
|
4011
|
-
'basalt root barrel — is the heuristic that actually catches the drift, since a file that ' +
|
|
4012
|
-
'never names `basalt-ui/query` cannot dual-import. The soft form is what holds the whole ' +
|
|
4013
|
-
'rule at `warn`: "this file is already a basalt file" is a claim about intent. 1.30.0 is ' +
|
|
4014
|
-
'when the consumer count is measured and the soft form is either kept or split off.',
|
|
4015
|
-
},
|
|
4016
3847
|
'forms-field-key': {
|
|
4017
3848
|
since: '1.28.0',
|
|
4018
3849
|
promote: '1.30.0',
|
|
@@ -4097,8 +3928,6 @@ export default {
|
|
|
4097
3928
|
'search-literal-link': searchLiteralLink,
|
|
4098
3929
|
'use-search-from-literal': useSearchFromLiteral,
|
|
4099
3930
|
'provider-above-router': providerAboveRouter,
|
|
4100
|
-
'duplicate-notifications-mount': duplicateNotificationsMount,
|
|
4101
|
-
'query-dual-import': queryDualImport,
|
|
4102
3931
|
'query-fn-unwrap': queryFnUnwrap,
|
|
4103
3932
|
'deprecated-export': deprecatedExport,
|
|
4104
3933
|
'forms-field-key': formsFieldKey,
|
|
@@ -4108,5 +3937,6 @@ export default {
|
|
|
4108
3937
|
'agent-resume-guard': agentResumeGuard,
|
|
4109
3938
|
'agent-no-raw-usechat': agentNoRawUseChat,
|
|
4110
3939
|
'ai-sdk-major': aiSdkMajor,
|
|
3940
|
+
'no-import-meta-env': noImportMetaEnv,
|
|
4111
3941
|
},
|
|
4112
3942
|
}
|