basalt-ui 2.11.1 → 2.13.0
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 +1 -1
- package/CHANGELOG.md +39 -0
- package/MIGRATING.md +51 -12
- package/README.md +2 -0
- package/agent/rules/basalt-mantine.md +1 -1
- package/agent/rules/basalt-state.md +1 -1
- package/agent/skills/basalt-app/SKILL.md +2 -2
- package/agent/templates/main.tpl +1 -0
- package/dist/cli/basalt-install.d.ts +10 -0
- package/dist/cli/basalt-install.d.ts.map +1 -0
- package/dist/cli/basalt-install.js +0 -0
- package/dist/cli/check-theme.js +1 -1
- package/dist/cli/doctor-upgrade.d.ts +5 -6
- package/dist/cli/doctor-upgrade.d.ts.map +1 -1
- package/dist/cli/doctor-upgrade.js +85 -56
- package/dist/cli/doctor.js +3 -3
- package/dist/cli/index.d.ts +5 -27
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +12 -49
- package/dist/cli/provider-tags.d.ts +12 -0
- package/dist/cli/provider-tags.d.ts.map +1 -0
- package/dist/cli/provider-tags.js +28 -0
- package/dist/cli/render-imports.d.ts +24 -0
- package/dist/cli/render-imports.d.ts.map +1 -0
- package/dist/cli/render-imports.js +74 -0
- package/dist/cli/router-wiring.d.ts +12 -0
- package/dist/cli/router-wiring.d.ts.map +1 -1
- package/dist/cli/router-wiring.js +18 -0
- package/dist/cli/source-text.d.ts +7 -0
- package/dist/cli/source-text.d.ts.map +1 -1
- package/dist/cli/source-text.js +34 -0
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +19 -13
- package/dist/commands/command-stash.d.ts +15 -0
- package/dist/commands/command-stash.d.ts.map +1 -0
- package/dist/commands/command-stash.js +31 -0
- package/dist/commands/define-commands.d.ts +2 -3
- package/dist/commands/define-commands.d.ts.map +1 -1
- package/dist/commands/define-commands.js +9 -7
- package/dist/commands/define-overlays.d.ts +6 -12
- package/dist/commands/define-overlays.d.ts.map +1 -1
- package/dist/commands/define-overlays.js +28 -34
- package/dist/commands/projectors.js +1 -1
- package/dist/guard/fonts-hint.d.ts +3 -0
- package/dist/guard/fonts-hint.d.ts.map +1 -0
- package/dist/guard/fonts-hint.js +4 -0
- package/dist/guard/index.d.ts +1 -1
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +2 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/provider/create-router.d.ts +57 -10
- package/dist/provider/create-router.d.ts.map +1 -1
- package/dist/provider/create-router.js +28 -17
- package/dist/provider/hotkeys.d.ts +2 -6
- package/dist/provider/hotkeys.d.ts.map +1 -1
- package/dist/provider/hotkeys.js +10 -15
- package/dist/provider/index.d.ts +7 -5
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +35 -42
- package/dist/provider/modals-mount.d.ts +16 -0
- package/dist/provider/modals-mount.d.ts.map +1 -0
- package/dist/provider/modals-mount.js +42 -0
- package/dist/provider/notifier.d.ts +22 -0
- package/dist/provider/notifier.d.ts.map +1 -0
- package/dist/provider/notifier.js +36 -0
- package/dist/provider/route-transition.d.ts +1 -1
- package/dist/provider/route-transition.d.ts.map +1 -1
- package/dist/provider/route-transition.js +1 -1
- package/dist/provider/slots.d.ts +25 -0
- package/dist/provider/slots.d.ts.map +1 -0
- package/dist/provider/slots.js +29 -0
- package/dist/provider/spotlight-actions.d.ts +1 -1
- package/dist/provider/spotlight-actions.d.ts.map +1 -1
- package/dist/provider/spotlight-actions.js +2 -3
- package/dist/provider/spotlight-mount.d.ts +3 -0
- package/dist/provider/spotlight-mount.d.ts.map +1 -0
- package/dist/provider/spotlight-mount.js +26 -0
- package/dist/query-client.d.ts +2 -62
- package/dist/query-client.d.ts.map +1 -1
- package/dist/query-client.js +13 -18
- package/dist/router-tanstack/nav-stash.d.ts +24 -0
- package/dist/router-tanstack/nav-stash.d.ts.map +1 -0
- package/dist/router-tanstack/nav-stash.js +23 -0
- package/dist/router-tanstack/nav.d.ts +5 -15
- package/dist/router-tanstack/nav.d.ts.map +1 -1
- package/dist/router-tanstack/nav.js +6 -16
- package/dist/router-tanstack/search-store-warnings.d.ts +33 -0
- package/dist/router-tanstack/search-store-warnings.d.ts.map +1 -0
- package/dist/router-tanstack/search-store-warnings.js +77 -0
- package/dist/router-tanstack/search-store.d.ts +2 -5
- package/dist/router-tanstack/search-store.d.ts.map +1 -1
- package/dist/router-tanstack/search-store.js +111 -110
- package/dist/router-tanstack/use-nav.js +1 -1
- package/dist/surfaces.d.ts +1 -1
- package/dist/surfaces.js +1 -1
- package/dist/telemetry.d.ts +31 -2
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +32 -12
- package/dist/theme/ctl-theme.d.ts.map +1 -1
- package/dist/theme/ctl-theme.js +17 -30
- package/dist/theme/extend.d.ts +18 -0
- package/dist/theme/extend.d.ts.map +1 -0
- package/dist/theme/extend.js +6 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +44 -84
- package/dist/unwrap.d.ts +29 -0
- package/dist/unwrap.d.ts.map +1 -0
- package/dist/unwrap.js +18 -0
- package/llms.txt +11 -7
- package/package.json +2 -2
- package/src/cli/basalt-install.ts +9 -0
- package/src/cli/check-theme.ts +1 -1
- package/src/cli/doctor-upgrade.ts +117 -72
- package/src/cli/doctor.ts +3 -3
- package/src/cli/index.ts +15 -70
- package/src/cli/provider-tags.ts +38 -0
- package/src/cli/render-imports.ts +104 -0
- package/src/cli/router-wiring.ts +23 -0
- package/src/cli/source-text.ts +39 -0
- package/src/cli/sync.ts +28 -22
- package/src/commands/command-stash.ts +44 -0
- package/src/commands/define-commands.ts +10 -17
- package/src/commands/define-overlays.ts +40 -68
- package/src/commands/projectors.ts +1 -1
- package/src/guard/fonts-hint.ts +2 -0
- package/src/guard/index.ts +2 -2
- package/src/index.ts +4 -2
- package/src/provider/create-router.tsx +103 -39
- package/src/provider/hotkeys.ts +14 -22
- package/src/provider/index.tsx +55 -61
- package/src/provider/modals-mount.tsx +66 -0
- package/src/provider/notifier.ts +52 -0
- package/src/provider/route-transition.ts +1 -1
- package/src/provider/slots.ts +59 -0
- package/src/provider/spotlight-actions.tsx +3 -4
- package/src/provider/spotlight-mount.tsx +33 -0
- package/src/query-client.ts +20 -78
- package/src/router-tanstack/nav-stash.ts +41 -0
- package/src/router-tanstack/nav.ts +11 -31
- package/src/router-tanstack/search-store-warnings.ts +120 -0
- package/src/router-tanstack/search-store.ts +200 -206
- package/src/router-tanstack/use-nav.ts +1 -1
- package/src/surfaces.ts +1 -1
- package/src/telemetry.ts +71 -13
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +2354 -0
- package/src/theme/ctl-theme.tsx +20 -19
- package/src/theme/extend.ts +18 -0
- package/src/theme/index.ts +50 -49
- package/src/unwrap.ts +44 -0
package/AGENTS.md
CHANGED
|
@@ -21,7 +21,7 @@ and `./package.json` are **not exports** (`llms.txt` still ships in the tarball
|
|
|
21
21
|
| `basalt-ui/vite` | build-tooling | basaltViteConfig(opts) — Vite preset for basalt-ui consumer apps; basaltAppPlugin(opts) — PWA head, manifest, and icon metadata derived from the token palette |
|
|
22
22
|
| `basalt-ui/format` | headless | integer/money/percent/durationClock/relativeTime/weekday/km/kcal — Intl-backed, Mantine-free, React-free formatting; the chart layer formats through the same implementation |
|
|
23
23
|
| `basalt-ui/forms` | mantine-coupled | Mantine form layer: useBasaltForm + inputProps/fieldKey (two calls — a spread `key` is a React 19 warning), on @mantine/form |
|
|
24
|
-
| `basalt-ui/commands` | mantine-coupled | defineCommands (typed command bus), defineOverlays/overlays (a form dialog is a registered overlay opened with overlays.open), setColorScheme, toggleSidebar, ShortcutsHelp, defineNotifications/emit/NotificationBell (emit only accepts kinds registered in defineNotifications; folded in from ./notifications); BasaltProvider mounts Spotlight, Modals
|
|
24
|
+
| `basalt-ui/commands` | mantine-coupled | defineCommands (typed command bus), defineOverlays/overlays (a form dialog is a registered overlay opened with overlays.open), setColorScheme, toggleSidebar, ShortcutsHelp, defineNotifications/emit/NotificationBell (emit only accepts kinds registered in defineNotifications; folded in from ./notifications); BasaltProvider mounts Notifications; Spotlight mounts once defineNav/defineCommands ran, Modals once defineOverlays/overlays.confirm ran |
|
|
25
25
|
| `basalt-ui/table` | mantine-coupled | BasaltDataTable and createColumnHelper: a data table over TanStack Table v9, rendered with Mantine |
|
|
26
26
|
| `basalt-ui/agent` | mantine-coupled | Streaming-chat surface: aiSdkTransport, useAgentThreadRuns, parseAgentPart, the open part-registry types, the consumer-owned thread contracts (AgentThread/ThreadsStore/ChatMessage), and the Mantine chat UI folded in from ./agent-chat (ThreadFeed, ThreadFeedRow, Composer, ToolChip). motion is subpath-required: the chat UI imports it eagerly |
|
|
27
27
|
| `basalt-ui/content` | mantine-coupled | Prose (article/chat typography), Callout, TableOfContents (given a containerRef it collects the id-bearing h2/h3 under that one container — levels changes which — on mount and on every DOM childList change, so it reads the slug ids `Markdown` gives every heading; `Prose` sets no ids and an explicit items list replaces collection), Markdown (react-markdown + remark-gfm, optional peers; `streaming` is a rendering mode ONLY — `contentTrust` is the independent security input, and any surface rendering agent/model output must pin `contentTrust="untrusted"`, the sole input to the image-origin allowlist; `fenceRenderers` extends fenced-block rendering — settledOnly/FenceRenderer/FenceRenderers; `sanitizeSchema` is an additions-only SanitizeSchemaExtension merged over the default via mergeSanitizeSchema; shiki code blocks, beautiful-mermaid diagrams and the remend streaming repair load lazily from optional peers), ArticleLayout (docs-page frame), GuideLink (contextual-help link) — the content/prose surface |
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
1
|
+
# [2.13.0](https://github.com/jkrumm/basalt-ui/compare/v2.12.0...v2.13.0) (2026-10-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* adopt the mirror after hydration, gate linkSearch, report failed navigates ([0ca439b](https://github.com/jkrumm/basalt-ui/commit/0ca439b523f8733f0fcf2032dce2587fc0591e25))
|
|
7
|
+
* break the sync/doctor import cycle and harden the provider hop ([418496e](https://github.com/jkrumm/basalt-ui/commit/418496ec72314c656addbcf41715ba175819ae96))
|
|
8
|
+
* count the provider per render edge and make doctor a true leaf ([ad439c1](https://github.com/jkrumm/basalt-ui/commit/ad439c158395fa76e87b099787ebe186b53b6e64))
|
|
9
|
+
* doctor follows the provider one hop, sync judges a Start root by content ([f87d285](https://github.com/jkrumm/basalt-ui/commit/f87d285b3e586514a7dbfd523acfbed087ed6913))
|
|
10
|
+
* fold the SSR rule into the validateSearch line to hold the rule budget ([0e97e50](https://github.com/jkrumm/basalt-ui/commit/0e97e507bea0a7b4a1db8d81ad3d942dd5953892))
|
|
11
|
+
* hydration-safe validateSearch, per-route foreign-param warning ([a734fb6](https://github.com/jkrumm/basalt-ui/commit/a734fb66b3cd3be71d59e6200f5546f45dc3a113))
|
|
12
|
+
* pin resolver output in the theme snapshot ([14c0728](https://github.com/jkrumm/basalt-ui/commit/14c07286da1e4d99eaa83dbca74a38d49455d7c9))
|
|
13
|
+
* prove the theme refactor against the pre-change code and harden its guard ([317eb3e](https://github.com/jkrumm/basalt-ui/commit/317eb3ede5ed058750ab74d419bf7efade2435d1))
|
|
14
|
+
* pure validateSearch and search-store hygiene ([4481f55](https://github.com/jkrumm/basalt-ui/commit/4481f558fdc951f548f337cb0886481e4a447818))
|
|
15
|
+
* review round 1 on basaltRouterOptions ([b5bddb3](https://github.com/jkrumm/basalt-ui/commit/b5bddb379f986059f6a2c0c50ba90f8db79ad745))
|
|
16
|
+
* review round 2 on basaltRouterOptions ([251fa58](https://github.com/jkrumm/basalt-ui/commit/251fa5835a0d908ef23d2bafc08a769bf531d658))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* basaltRouterOptions factory, BasaltProviderProps, telemetry fixes ([6af03d4](https://github.com/jkrumm/basalt-ui/commit/6af03d496b0da63280f80a56700b66264b2db52d))
|
|
22
|
+
* the theme reaches no Mantine component it configures ([1b9c314](https://github.com/jkrumm/basalt-ui/commit/1b9c314fea9c961f15c72783f642cdcb20a71414))
|
|
23
|
+
|
|
24
|
+
# [2.12.0](https://github.com/jkrumm/basalt-ui/compare/v2.11.1...v2.12.0) (2026-10-16)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* accept a pathless-layout provider and read the router context from types ([a57f4f5](https://github.com/jkrumm/basalt-ui/commit/a57f4f549b82bad0981155baac0d6544d507fc56))
|
|
30
|
+
* close cancels pending overlays, live counters share one helper ([474712e](https://github.com/jkrumm/basalt-ui/commit/474712e71d8fb877cdb415163df0ad4e5725c1cd))
|
|
31
|
+
* count provider tags, not files, and share the Start provider hint ([2293494](https://github.com/jkrumm/basalt-ui/commit/2293494b46086f1142bcaa9e9e6918ee694089a4))
|
|
32
|
+
* slot review — nav stash leaf, shared notifier, late overlay open ([5ad739d](https://github.com/jkrumm/basalt-ui/commit/5ad739db8ff06e71eb3a66a49b6fc29e300ba051))
|
|
33
|
+
* tie the Start root-context check to the exported root route ([aefc446](https://github.com/jkrumm/basalt-ui/commit/aefc4465fbb2bee72f4d2ef4cd643d1e6c71dc5e))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* provider bundles Spotlight, modals, hotkeys only when defined ([37c3477](https://github.com/jkrumm/basalt-ui/commit/37c347743a83db4b291173cf0238f37d6aa2fb42))
|
|
39
|
+
|
|
1
40
|
## [2.11.1](https://github.com/jkrumm/basalt-ui/compare/v2.11.0...v2.11.1) (2026-10-15)
|
|
2
41
|
|
|
3
42
|
|
package/MIGRATING.md
CHANGED
|
@@ -66,18 +66,18 @@ There is one row per SURFACE, not per export, and a surface earns a row once any
|
|
|
66
66
|
shipped lefthook preset both changed in 1.30.0 with no row that owned them — which is how a
|
|
67
67
|
consumer read this index, found nothing, and diffed a KPI row that had silently gone 4-up → 2-up.
|
|
68
68
|
|
|
69
|
-
| Surface | 1.27.0 | 1.28.0 | 1.29.0 | 1.30.0 | 1.30.1 | 1.30.2 | 1.31.0 | 1.32.0 | 1.32.1 | 1.33.0 | 1.34.0 | 1.34.1 | 1.35.0 | 1.36.0 | 1.36.1 | 1.37.0 | 1.37.1 | 1.38.0 | 1.38.1 | 1.39.0 | 1.40.0 | 1.40.1 | 1.40.2 | 1.40.3 | 1.41.0 | 2.0.0 | 2.0.1 | 2.0.2 | 2.0.3 | 2.0.4 | 2.0.5 | 2.1.0 | 2.2.0 | 2.3.0 | 2.4.0 | 2.5.0 | 2.6.0 | 2.6.1 | 2.7.0 | 2.7.1 | 2.7.2 | 2.7.3 | 2.8.0 | 2.8.1 | 2.9.0 | 2.9.1 | 2.10.0 | 2.11.0 | 2.11.1 | Unreleased |
|
|
70
|
-
| ----------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------- | ------ | ------ | -------------------------------------------------------------------------------------------- | ------ | ------ | ------ | ------ | ------ | ----------------------------------------------- | ------ | ------ | ------ | ------ | ------------------------------------------------------------ | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
71
|
-
| **tokens** (`./tokens`) | — | `--vx-divider` → `rgba()` on both schemes (§ Shell) | `--vx-space-touch-target` added (§ Additions) | eight spacing numbers (§ Chrome) | — | — | `--vx-hit` replaces the touch vars; `SIZE_CLASSES` (§ 1.31.0) | — | `SIZE_CLASSES`/`CONTAINER_CLASSES` actually exported (§ Fixes) | `CONTAINER_GRID_BREAKPOINTS`; `raw-breakpoint` trusts it (§ 1.33.0) | `CONTAINER_KEYS` (§ 1.34.0) | — | — | — | — | — | — | — | | `appShellInset` 20 → 16 (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — |
|
|
72
|
-
| **charts** (`./charts`) | — | phone tier, `curve`, formatters, `state`, log axis (§ preamble) | `ChartState.empty: string`, `AxisBottomNumeric` (§ Additions) | responsive `height`, `legend.maxRows` (§ Charts) | `height` reaches the kinds; `maxRows` beats the `fill` fit (§ Charts) | — | container-class tier + `height` keys (§ 1.31.0) | — | `ResponsiveChartHeight` `sm` → key (§ Container recipes) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BandSpan.absentFraction` + `absentState` (§ 2.8.0) | — | — | — | — | — | — | — |
|
|
73
|
-
| **shell** (`.`) | — | scrollport, region seams, **the brand left the sidebar** (§§ scrollport, brand, Shell) | `PageTitle`, `BasaltDevDock`, `useBreakpoint` (§ Additions) | More popover, aside pill, the responsive gutter, `useBasaltSpacing` (§ Chrome) | — | — | `theme.breakpoints` derived, `useSizeClass`, `data-basalt-host`, `useBreakpoint` on notice (§ 1.31.0) | `useBreakpoint` removal → 1.33.0; `useSizeClass` is shell-only (§ 1.32.0) | shell-less `shell/` gutter, `AppShell` breakpoints, `useSizeClass` for overlays (§§ Shell-less, `useSizeClass`) | — | `useBreakpoint` removed (§ 1.34.0) | — | — | `useCoarsePointer()` (§ `useCoarsePointer()`) | — | — | — | — | | content gutter 16, block 8 from `sm` (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BasaltProvider` embedded mode, `spotlight` (§ 2.8.0) | — | — | — | — | — | — | — |
|
|
74
|
-
| **controls** (`./controls`) | `NumberFilter`, `field.number` (§ Controls) | sheet renders panel rows; `PanelRow`, `SliderControl` (§ `basalt-ui/controls`) | — | — | — | — | — | — | — | `NumberFilter clearable`; `createSearchStore` `resets` (§ State and controls) | — | — | — | `FormSection`/`FormRow`/`FormGroup`/`FormActions` move here (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
75
|
-
| **forms** (`./forms`) | — | `field` → `inputProps`, **`inputProps` drops `key`**, the layout tier (§ `inputProps`) | `field` DELETED — and the `--fix` recipe no longer works (§ Consolidation) | — | — | — | — | — | `FormGroup` row no longer stretches (§ Fixes) | — | — | — | — | the layout + `useForm`/`schemaResolver` deprecated, removed 1.37.0 (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — |
|
|
76
|
-
| **data** (`./data/table`) | — | root is a `<div>`, row selection, `getItemKey` required (§ `basalt-ui/data`) | `./data` + `./query` + `./connectivity` dropped (§ Consolidation) | — | — | — | — | — | `renderCard` documented (§ `renderCard`) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
77
|
-
| **dashboard** (`.`) | `StatCard`: `unit`, `breakdown`, delta format (§ `StatCard`) | `StatGroup`, `WidgetGrid`, query-aware `StatCard` — additive | — | **the column law keys on the CONTAINER; `cols={4}` is 2-up at `sm`** (§ Dashboard) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — |
|
|
78
|
-
| **toolchain** (`./configs/*`) | — | — | the shipped lefthook preset's `check-theme` BROKE — the CLI resolver stopped ascending (§ CLI) | the preset's default bin, and the `root:` recipe (§ Toolchain) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
79
|
-
| **CLI** (`basalt-ui`) | — | — | **resolver stops relocating; `doctor` loses 6 of 10 checks** (§ CLI) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | the managed block moves `CLAUDE.md` → `AGENTS.md` (§ 1.41.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `doctor`: CSS + forced dropped subpaths, `oxlint-floor`, Start wiring (§ 2.8.0) | — | § 1.x compatibility layer removed | — | — | — | — | — |
|
|
80
|
-
| **guards** | five rules → `error` (§ Guards) | six new ids at `warn` (§ preamble) | `query-dual-import` retired in 1.29.1 (§ Guards) | four rules → `error` (§ Guards) | — | — | — | `raw-breakpoint`: the container-grid answer, `error` at 1.33.0 (§ 1.32.0) | `FormRow`/`FormGroup` homes in both lanes; `basalt-main` dropped (§ Fixes) | C1 + breakpoint pairs → `error`; `unknown-vx-token` `warn` (§ Guards) | — | — | — | `unknown-vx-token` → `error`; the token factories throw (§ Guards) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — |
|
|
69
|
+
| Surface | 1.27.0 | 1.28.0 | 1.29.0 | 1.30.0 | 1.30.1 | 1.30.2 | 1.31.0 | 1.32.0 | 1.32.1 | 1.33.0 | 1.34.0 | 1.34.1 | 1.35.0 | 1.36.0 | 1.36.1 | 1.37.0 | 1.37.1 | 1.38.0 | 1.38.1 | 1.39.0 | 1.40.0 | 1.40.1 | 1.40.2 | 1.40.3 | 1.41.0 | 2.0.0 | 2.0.1 | 2.0.2 | 2.0.3 | 2.0.4 | 2.0.5 | 2.1.0 | 2.2.0 | 2.3.0 | 2.4.0 | 2.5.0 | 2.6.0 | 2.6.1 | 2.7.0 | 2.7.1 | 2.7.2 | 2.7.3 | 2.8.0 | 2.8.1 | 2.9.0 | 2.9.1 | 2.10.0 | 2.11.0 | 2.11.1 | 2.12.0 | 2.13.0 | Unreleased |
|
|
70
|
+
| ----------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------- | ------ | ------ | -------------------------------------------------------------------------------------------- | ------ | ------ | ------ | ------ | ------ | ----------------------------------------------- | ------ | ------ | ------ | ------ | ------------------------------------------------------------ | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
71
|
+
| **tokens** (`./tokens`) | — | `--vx-divider` → `rgba()` on both schemes (§ Shell) | `--vx-space-touch-target` added (§ Additions) | eight spacing numbers (§ Chrome) | — | — | `--vx-hit` replaces the touch vars; `SIZE_CLASSES` (§ 1.31.0) | — | `SIZE_CLASSES`/`CONTAINER_CLASSES` actually exported (§ Fixes) | `CONTAINER_GRID_BREAKPOINTS`; `raw-breakpoint` trusts it (§ 1.33.0) | `CONTAINER_KEYS` (§ 1.34.0) | — | — | — | — | — | — | — | | `appShellInset` 20 → 16 (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — |
|
|
72
|
+
| **charts** (`./charts`) | — | phone tier, `curve`, formatters, `state`, log axis (§ preamble) | `ChartState.empty: string`, `AxisBottomNumeric` (§ Additions) | responsive `height`, `legend.maxRows` (§ Charts) | `height` reaches the kinds; `maxRows` beats the `fill` fit (§ Charts) | — | container-class tier + `height` keys (§ 1.31.0) | — | `ResponsiveChartHeight` `sm` → key (§ Container recipes) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BandSpan.absentFraction` + `absentState` (§ 2.8.0) | — | — | — | — | — | — | — | — | — |
|
|
73
|
+
| **shell** (`.`) | — | scrollport, region seams, **the brand left the sidebar** (§§ scrollport, brand, Shell) | `PageTitle`, `BasaltDevDock`, `useBreakpoint` (§ Additions) | More popover, aside pill, the responsive gutter, `useBasaltSpacing` (§ Chrome) | — | — | `theme.breakpoints` derived, `useSizeClass`, `data-basalt-host`, `useBreakpoint` on notice (§ 1.31.0) | `useBreakpoint` removal → 1.33.0; `useSizeClass` is shell-only (§ 1.32.0) | shell-less `shell/` gutter, `AppShell` breakpoints, `useSizeClass` for overlays (§§ Shell-less, `useSizeClass`) | — | `useBreakpoint` removed (§ 1.34.0) | — | — | `useCoarsePointer()` (§ `useCoarsePointer()`) | — | — | — | — | | content gutter 16, block 8 from `sm` (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BasaltProvider` embedded mode, `spotlight` (§ 2.8.0) | — | — | — | — | — | — | — | — | — |
|
|
74
|
+
| **controls** (`./controls`) | `NumberFilter`, `field.number` (§ Controls) | sheet renders panel rows; `PanelRow`, `SliderControl` (§ `basalt-ui/controls`) | — | — | — | — | — | — | — | `NumberFilter clearable`; `createSearchStore` `resets` (§ State and controls) | — | — | — | `FormSection`/`FormRow`/`FormGroup`/`FormActions` move here (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
75
|
+
| **forms** (`./forms`) | — | `field` → `inputProps`, **`inputProps` drops `key`**, the layout tier (§ `inputProps`) | `field` DELETED — and the `--fix` recipe no longer works (§ Consolidation) | — | — | — | — | — | `FormGroup` row no longer stretches (§ Fixes) | — | — | — | — | the layout + `useForm`/`schemaResolver` deprecated, removed 1.37.0 (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — |
|
|
76
|
+
| **data** (`./data/table`) | — | root is a `<div>`, row selection, `getItemKey` required (§ `basalt-ui/data`) | `./data` + `./query` + `./connectivity` dropped (§ Consolidation) | — | — | — | — | — | `renderCard` documented (§ `renderCard`) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
77
|
+
| **dashboard** (`.`) | `StatCard`: `unit`, `breakdown`, delta format (§ `StatCard`) | `StatGroup`, `WidgetGrid`, query-aware `StatCard` — additive | — | **the column law keys on the CONTAINER; `cols={4}` is 2-up at `sm`** (§ Dashboard) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — |
|
|
78
|
+
| **toolchain** (`./configs/*`) | — | — | the shipped lefthook preset's `check-theme` BROKE — the CLI resolver stopped ascending (§ CLI) | the preset's default bin, and the `root:` recipe (§ Toolchain) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
79
|
+
| **CLI** (`basalt-ui`) | — | — | **resolver stops relocating; `doctor` loses 6 of 10 checks** (§ CLI) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | the managed block moves `CLAUDE.md` → `AGENTS.md` (§ 1.41.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `doctor`: CSS + forced dropped subpaths, `oxlint-floor`, Start wiring (§ 2.8.0) | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — |
|
|
80
|
+
| **guards** | five rules → `error` (§ Guards) | six new ids at `warn` (§ preamble) | `query-dual-import` retired in 1.29.1 (§ Guards) | four rules → `error` (§ Guards) | — | — | — | `raw-breakpoint`: the container-grid answer, `error` at 1.33.0 (§ 1.32.0) | `FormRow`/`FormGroup` homes in both lanes; `basalt-main` dropped (§ Fixes) | C1 + breakpoint pairs → `error`; `unknown-vx-token` `warn` (§ Guards) | — | — | — | `unknown-vx-token` → `error`; the token factories throw (§ Guards) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — |
|
|
81
81
|
|
|
82
82
|
---
|
|
83
83
|
|
|
@@ -1046,6 +1046,45 @@ The `basalt-ui/router-tanstack` subpath is **removed** in 2.x, not moved: an imp
|
|
|
1046
1046
|
_Nothing yet. Author the next section under this heading as `## Unreleased — <title>`; the
|
|
1047
1047
|
release renames it and opens a new one here._
|
|
1048
1048
|
|
|
1049
|
+
## 2.13.0 — router options, search stores, and a theme that reaches no component it configures
|
|
1050
|
+
|
|
1051
|
+
### `basaltRouterOptions`, router passthrough, telemetry correctness
|
|
1052
|
+
|
|
1053
|
+
- **New: `basaltRouterOptions({ query?, context? })`, and `type BasaltProviderProps`, from `basalt-ui`.** The factory returns everything `createBasaltRouter` set (context with `queryClient`, intent preloading with Query-owned freshness, scroll restoration, the pending/error/not-found components, `defaultOnCatch`, the route view transition); `createBasaltRouter` is now `createRouter({ routeTree, ...basaltRouterOptions(opts) })` plus the brand. A router you build yourself (TanStack Start's `getRouter()`) spreads it and the embedded provider gets `route.error` telemetry and the defaults it used to miss. Named consumer for the adopt-or-delete rule: weatherorb (`scripts/consumers.json`, `basaltRouterOptions`). `BasaltProviderProps` replaces weatherorb's re-declared `Readonly<{ children }>`. Symbol budget: +1 value, +1 type.
|
|
1054
|
+
- **`route.error` no longer needs `createBasaltRouter`.** The router-scoped hook lives on `context.__basalt` (optional on `BasaltRouterContext`); the provider points it at its emitter. Nothing to change.
|
|
1055
|
+
- **Compile break: `createBasaltRouter` requires `context` when your context type has required keys.** `context` was always optional and typed loosely; with `context: { auth }` in your root route's type, omitting it (or `basaltRouterOptions()` with no argument) now fails to compile instead of crashing at the first `context.auth` read. **Fix:** pass it, `createBasaltRouter({ routeTree, context: { auth } })`. `queryClient` in `context` is rejected too (basalt's replaces it). `type BasaltRouterOptions<TContext>` is the factory's return type, exported from `basalt-ui`.
|
|
1056
|
+
- **`createBasaltRouter` accepts `history` and `basepath`.** Every key it owns (`defaultPreload`, `defaultPreloadStaleTime`, `scrollRestoration`, the three default components, `defaultOnCatch`, `defaultViewTransition`) is typed `never`. Tests can pass `createMemoryHistory(...)`.
|
|
1057
|
+
- **Behaviour: `queries.retry` is now a predicate, and it skips a 4xx.** It was the number `2`; it is now a function: twice, never on a 4xx except the transient 408, 425 and 429 (read from a numeric `status` on the thrown error). Code that reads `client.getDefaultOptions().queries.retry` as a number breaks. **Opt-out:** `query: { defaultOptions: { queries: { retry: 2 } } }` restores the old behaviour.
|
|
1058
|
+
- **Behaviour: `basalt.query.hash` and `basalt.mutation.key` keep their names but change meaning.** Any dashboard, alert or query keyed on their old values (the raw query hash, the stringified mutation key) matches nothing after this release; group on the new value instead. `mutation.error`'s `basalt.mutation.key` (it was the raw `JSON.stringify` of the key, which embeds ids and slugs) and `query.error`'s `basalt.query.hash` (it was the raw query hash, the same stringified key) are now `groupingId(...)`: a 32-bit djb2 in hex. Events from one key still group together, but a dashboard that matched on key segments must group on the id instead. It is NOT a privacy guarantee: it is non-cryptographic, so a short or guessable key can be recovered by trying candidates. There is no opt-out; the contract says events carry ids and counts, not keys.
|
|
1059
|
+
- **Behaviour: an unset `telemetry` logs query and mutation failures to the console outside production** (`[basalt] query.error`, attributes only). Production is unchanged: no sink, no events. **Opt-out:** pass any `telemetry` sink; once one is passed the console default is off (a no-op `() => {}` silences it).
|
|
1060
|
+
- **Behaviour: `unwrap` takes any thenable, and any `error` other than `null`/`undefined` throws.** A non-native thenable (`PromiseLike`) is awaited instead of being read as an envelope, and the result is a real `Promise`. A falsy-but-present `error` (`false`, `0`, `''`) used to resolve with `data` and now throws that value. **Migration:** an envelope that signals success with `error: false` (or `0`, `''`) must map it to `null` first, e.g. `unwrap({ ...res, error: res.error || null })`. The function moved to its own module; the import path `basalt-ui` is unchanged.
|
|
1061
|
+
- **Behaviour: `route.error` is emitted once a provider has mounted.** The provider binds in an effect, so an error thrown before the first provider effect (a loader failing during the initial load) is not emitted; with no bound handler it falls back to `console.error` in every environment (one line, no event). A router built without `basaltRouterOptions()` or `createBasaltRouter` warns that `route.error` telemetry is off (every bind in dev, once per document in production). `context.__basalt` is the coupling between the factory and the provider; do not read or write it.
|
|
1062
|
+
- **`basaltRouterOptions` rejects a consumer `queryClient`.** `context` is typed so that `queryClient` and `__basalt` are `never` (basalt's `QueryClient` replaces anything passed at runtime), and `context` is required when your context type has required keys.
|
|
1063
|
+
- **Recipe, not an export: OTel.** `basalt-ui` has no OTel dependency and ships no adapter; the event-to-span mapping is the `BasaltEvent` JSDoc example, and `init`'s `main.tsx` points at it.
|
|
1064
|
+
|
|
1065
|
+
### search stores: a pure server `validateSearch`, an imperative `clear()`
|
|
1066
|
+
|
|
1067
|
+
- **`store.validateSearch` and `store.linkSearch` are pure URL ⊳ fallback on the server and while a dehydrated page hydrates.** They no longer merge the localStorage mirror when there is no `window`, or while the router's SSR bootstrap (`window.$_TSR`) is present and no reader has committed yet, so the client's first search equals the server's and a loader keyed on `search` runs with the same deps on hydration. Right after that commit, a reader whose URL still carries the fallback adopts the mirror with a replace-navigation (a deep link naming any other value is never overridden), and later client navigations resolve URL ⊳ mirror ⊳ fallback again. A client-only app (argo, rb: no `$_TSR`) is unchanged. **Visible difference:** on an SSR app the URL briefly holds the fallback before the replace; a loader keyed on `search` runs once more with the adopted value. **Opt-out:** pass the stored value explicitly in the link (`search: store.linkSearch`) — an href built after hydration already carries it.
|
|
1068
|
+
- **A URL-lane `field.clear()` navigates through the mounted router, not a closure a render left behind.** It works from any event handler while a `use()` of the store is mounted (with several routers mounted it navigates each one that owns the field), judges ownership against the location it is called at, and a discarded/StrictMode render can no longer register a stale closure. With no mounted reader it still clears the mirror only. **Opt-out: none.**
|
|
1069
|
+
- **`buildSearchStore` is gone.** It was an internal pass-through of `createSearchStore`, never exported from `basalt-ui/state`; nothing public changes. **Opt-out: none needed.**
|
|
1070
|
+
- **Dev warning:** a URL-lane field read on a route none of whose matched `validateSearch` runs this store (directly or composed) warns once per field — another store or a hand-rolled schema owns the param. **Opt-out: none; wire `validateSearch: store.validateSearch`, or spread it into your own.**
|
|
1071
|
+
|
|
1072
|
+
### the theme reaches no Mantine component it configures
|
|
1073
|
+
|
|
1074
|
+
- **`createBasaltTheme` no longer value-imports the ~45 Mantine components it configures.** No consumer change; the produced theme is byte-identical. An app stops shipping the components the theme only configured (`AppShell*`, `Pagination*`, `Stepper*`, `Timeline*`, `MultiSelect`, `PasswordInput`, `Chip`, `Progress*`, `NavLink`, `Breadcrumbs`, …) — Mantine's `X.extend()` is `identity`, but calling it pulled each component module into every bundle. **Measured:** an embedded `<BasaltProvider spotlight={false}>` with no defines, peers bundled and every chunk counted, dropped from 166959 B to 54735 B gzip; `createBasaltTheme()` alone is 14420 B (`scripts/check-budgets.ts` gates both; the embedded ceiling went 168500 → 55300). **Equivalence:** `createBasaltTheme` was compared against the pre-change tree (0c4aeb1a) across default, density −3/0/+3, radius −5/0/+5 and derive options, invoking every `vars` / `classNames` / `styles` / `variantColorResolver` over sizes × variants × states × schemes: 12 pass, and a one-key mutation of the baseline failed all 12. Re-run it by checking out that commit in a worktree, installing, and importing both `createBasaltTheme`s in one test; `src/theme/plain-theme.test.ts` now snapshots the same resolver outputs. **Opt-out: none.**
|
|
1075
|
+
|
|
1076
|
+
## 2.12.0 — the provider bundles only what the app defines; Start wiring accepts a pathless layout
|
|
1077
|
+
|
|
1078
|
+
- **`ModalsProvider` is a sibling of the router, not its wrapper, and mounts only once `defineOverlays`, `overlays.open` or `overlays.confirm` asked for it.** `BasaltProvider` no longer imports `@mantine/modals`; the define call registers the mount, so a late call (a lazily loaded route) mounts it beside the app without re-parenting or remounting the tree. `useModals()` / `openContextModal` context is therefore **no longer provided**: a component calling `useModals()` throws "outside of context". **Opt-out: use the imperative `modals.*` / `overlays.*` API. Do NOT mount a second `ModalsProvider` while `defineOverlays` / `overlays` are in use** — Mantine's modals ride a window event bus, so every mounted `ModalsProvider` answers one `modals.open`, and you get two dialogs (pinned in `slots.test.tsx`).
|
|
1079
|
+
- **`overlays.open` / `overlays.confirm` may wait for the mount.** The first call after the define registers the mount and waits for the provider to commit it: a tick normally, up to 5 s while a `BasaltProvider` is mounted and busy. With no `BasaltProvider` mounted, `confirm` rejects after 500 ms (as before, now delayed) and `open` warns in dev.
|
|
1080
|
+
- **Spotlight mounts only when the app calls `defineNav` or `defineCommands`.** Nav entries and commands are what the palette lists; an app defining neither ships none of `@mantine/spotlight`. `spotlight={false}` still suppresses the mount. The dev dock's three `dev.*` palette commands now appear only in an app that defines nav or commands. **Opt-out: call `defineNav` or `defineCommands` (even `defineCommands({})`).**
|
|
1081
|
+
- **Command shortcuts bind through `defineCommands`.** It registers the hotkey binder when any command has a `shortcut`, and rebinds if `defineCommands` runs again; `@tanstack/react-hotkeys` is no longer reachable from `BasaltProvider`, so an app with no shortcuts neither ships nor loads it (it was a ~15 KB gzip dynamic chunk that bundle-graph size bars counted). **Opt-out: none.**
|
|
1082
|
+
- **Measured:** an embedded `<BasaltProvider spotlight={false}>` with no defines, peers bundled and every chunk counted, dropped from 190544 B to 166834 B gzip (`scripts/check-budgets.ts` gates it).
|
|
1083
|
+
- **`doctor` accepts the Start provider in a pathless layout.** `<BasaltProvider>` may sit in `__root.tsx` or in `src/routes/_<name>.tsx` / `_<name>/route.tsx` at any depth (a landing kept at 0 JS mounts it in the layout). Exactly one `<BasaltProvider>` tag across the root and the layouts is allowed; a second one, even in the same file, fails naming the file. `router=` on the provider is rejected in a layout file too, as it was in the root. **Opt-out: none.**
|
|
1084
|
+
- **New `app-wiring` fail: an untyped Start root route.** A root that exports `Route = createRootRoute(` has no `queryClient` in its router context, which the embedded provider reads. Fix: `export const Route = createRootRouteWithContext<BasaltRouterContext>()({ … })` (`import type { BasaltRouterContext } from 'basalt-ui'`) and pass the `QueryClient` in `createRouter({ context })`. A re-export, wrapper or missing `Route` export is not judged. `doctor` exits non-zero on it. **Opt-out: none.**
|
|
1085
|
+
- **The `src/router.tsx` "never mentions queryClient" warning is gone.** The root route's declared type replaces the text heuristic; delete any `ignore if you build it elsewhere` note you kept for it.
|
|
1086
|
+
- **Docs: the `motion` peer is `^14.1.0`.** It was exact-pinned at `14.1.0`; any 14.x ≥ 14.1.0 now satisfies it. **Opt-out: none.**
|
|
1087
|
+
|
|
1049
1088
|
## 2.11.1 — lone points, end labels and axis ticks render cleanly
|
|
1050
1089
|
|
|
1051
1090
|
- **`Lines` draws a lone point.** A series with one finite value (a one-point window, or a value between nulls) drew nothing: a path of one point has no length. It now draws a dot in the series colour, at every isolated finite row (`gaps: 'connect'` bridges the nulls, so only a series with a single finite row is lone there). A point the series' own `getMarker` marks is not doubled. Delete any `getMarker` you added to make a single run visible. **Opt-out: none.**
|
package/README.md
CHANGED
|
@@ -705,6 +705,8 @@ strict flags), `react-app` (`base` + DOM/JSX libs) and `node` (`base` + Node typ
|
|
|
705
705
|
{ "extends": "basalt-ui/configs/tsconfig.react-app.json" }
|
|
706
706
|
```
|
|
707
707
|
|
|
708
|
+
`tsc` checks every file in the program with the program's options, so a workspace package imported from source is checked under the preset's flags and no compiler option excludes it. Give each package its own tsconfig and link them with TS project references (`references` + `composite: true`), or consume the package's built `.d.ts`.
|
|
709
|
+
|
|
708
710
|
`.oxfmtrc.json` has no `extends` of its own — copy `configs/oxfmt.json` verbatim (`basalt-ui init`
|
|
709
711
|
does this for you).
|
|
710
712
|
|
|
@@ -18,7 +18,7 @@ paths:
|
|
|
18
18
|
|
|
19
19
|
## Provider
|
|
20
20
|
|
|
21
|
-
- Mount once: `createBasaltRouter({ routeTree })`, then `<BasaltProvider router={router} />`; in a router you do not own (TanStack Start root route) pass `children` instead, with `context.queryClient`. `spotlight={false}` for an app with its own Cmd+K. It owns Mantine, Query,
|
|
21
|
+
- Mount once: `createBasaltRouter({ routeTree })`, then `<BasaltProvider router={router} />`; in a router you do not own (TanStack Start root route) pass `children` instead, with `context.queryClient`. `spotlight={false}` for an app with its own Cmd+K. It owns Mantine, Query and notifications; Spotlight mounts once `defineNav`/`defineCommands` ran, `ModalsProvider` (a sibling, no `useModals()` context) once `defineOverlays`/`overlays.confirm` ran. [type BasaltProvider]
|
|
22
22
|
- Never pass `cssVariablesResolver` to `BasaltProvider`; retune with `theme={createBasaltTheme(...)}`. [type BasaltProvider]
|
|
23
23
|
- Read and write the color scheme with `useMantineColorScheme()` only. [check-theme localstorage-theme]
|
|
24
24
|
|
|
@@ -22,7 +22,7 @@ State a control reads or writes is a field on a store; the URL wins over localSt
|
|
|
22
22
|
- Never `useState` for a filter, tab, range or view; a basalt control takes a `field` and has no `value` or `onChange`. A value another store owns (a zustand slice) binds as `externalField({ values, fallback, labels, store: { get, set, subscribe } })`, no lane, `clear()` writes the fallback. [check-theme raw-selection-control]
|
|
23
23
|
- Declare lanes once at definition: `{ url, persist, history }`; `url: false` is local-only, `persist: false` is URL-only. [type field]
|
|
24
24
|
- Option labels come from `.labels()` at definition, never a control prop. [type createSearchStore]
|
|
25
|
-
- Route `validateSearch` is `store.validateSearch`; a wider search shape spreads `...store.validateSearch(raw)`. [type createSearchStore]
|
|
25
|
+
- Route `validateSearch` is `store.validateSearch`; a wider search shape spreads `...store.validateSearch(raw)`. Under SSR it is URL ⊳ fallback until hydration commits (`window.$_TSR`), then readers adopt the mirror; never read a stored value in a server loader. [type createSearchStore]
|
|
26
26
|
- Read with `store.useValues()` or take the value as a prop; never `useSearch({ from: '<literal>' })`. [basalt/use-search-from-literal]
|
|
27
27
|
- A handle's `use()` returns `[value, setValue]`; the setter owns the navigate and the persist; on a `createLocalStore` field a prop-derived default is `store.field.x.withFallback(value)`, passed to `use()` and to any control as `field=` (unset only, never persisted, a reset returns to it, `isDefault` follows it; search stores lack it, a derived handle does not derive again), never a store rebuilt per prop. [type field]
|
|
28
28
|
- Count active filters and reset them with the store's `useActiveCount()` and `useReset()`; a reset unsets, it does not write the fallback. [type createSearchStore]
|
|
@@ -9,7 +9,7 @@ Procedure only; the law is `.claude/rules/basalt-*.md`.
|
|
|
9
9
|
## Scaffold
|
|
10
10
|
|
|
11
11
|
1. `bun add basalt-ui && bunx basalt-ui init` (the only `bunx` call; use `./node_modules/.bin/basalt-ui` after).
|
|
12
|
-
2. Check the seeded `src/main.tsx` (`init` writes it when absent; on a TanStack Start app it seeds none: render `<BasaltProvider><Outlet /></BasaltProvider>` with no `router` in the root route component, `context.queryClient` set in `getRouter()`); `spotlight={false}` drops Basalt's Cmd+K for an app with its own. `basalt-ui/styles.css` is the only stylesheet import:
|
|
12
|
+
2. Check the seeded `src/main.tsx` (`init` writes it when absent; on a TanStack Start app it seeds none: render `<BasaltProvider><Outlet /></BasaltProvider>` with no `router` in the root route component or a pathless layout, `context.queryClient` set in `getRouter()`); `spotlight={false}` drops Basalt's Cmd+K for an app with its own. `basalt-ui/styles.css` is the only stylesheet import:
|
|
13
13
|
|
|
14
14
|
```tsx
|
|
15
15
|
// @check
|
|
@@ -291,7 +291,7 @@ export function Chat() {
|
|
|
291
291
|
|
|
292
292
|
1. Be on `1.41.0` with its deprecations cleared and the gate green first (2.0 retires the deprecation lifecycle, so a consumer below 1.41 stalls on removed names). Then `bun add basalt-ui@latest`, the peers each imported subpath needs from its `Install:` line in `llms.txt` (exact pins: `bun add` accepts a mismatch silently, `doctor` `exact-peers` names it) and an `oxlint` the shipped preset supports; then `./node_modules/.bin/basalt-ui sync` (prunes retired managed files, rewrites the AGENTS.md block).
|
|
293
293
|
2. `./node_modules/.bin/basalt-ui doctor`; in a monorepo it targets the app package (`basalt.app` in the root `package.json` when two qualify). Fix each check: a tsconfig that does not extend the shipped base, retired `basalt/*` rule ids, dead `basalt` config keys, dropped subpaths.
|
|
294
|
-
3. Fix `tsc` in this order, because errors cascade: (a) specifier moves, mechanical, CSS imports included (`MIGRATING.md` § Subpaths, peers and gates; `basalt-ui/tokens.css` is gone and only `vite build` reports it: emit `basalt-ui tokens:css --out src/tokens.css` and import that file); (b) wiring: `createBasaltRouter` + `BasaltProvider` + `interface Register` (until `Register` exists every router and query-client use is `never`: dozens of unrelated errors); (c) removed root exports; (d) charts, one file at a time, not mechanical: hand-composed marks become `Lines`/`Bars`/`Sparkline`/`Heatmap` or `CartesianChart`.
|
|
294
|
+
3. Fix `tsc` in this order, because errors cascade: (a) specifier moves, mechanical, CSS imports included (`MIGRATING.md` § Subpaths, peers and gates; `basalt-ui/tokens.css` is gone and only `vite build` reports it: emit `basalt-ui tokens:css --out src/tokens.css` and import that file; a provider-free page also needs `basalt-ui fonts:css --out src/fonts.css`); (b) wiring: `createBasaltRouter` + `BasaltProvider` + `interface Register` (until `Register` exists every router and query-client use is `never`: dozens of unrelated errors); (c) removed root exports; (d) charts, one file at a time, not mechanical: hand-composed marks become `Lines`/`Bars`/`Sparkline`/`Heatmap` or `CartesianChart`.
|
|
295
295
|
4. Read what compiles clean but behaves differently (`MIGRATING.md` § Agent runtime: `runs.has(id)` no longer means live; § Table v9: closed sort registry, debounced search; § Transitions) and grep your code for each. Fix the preset's newly-`error` React rules (`react/refs`, `react/set-state-in-effect`, `react/immutability`, `react/globals`) at the source, never with a waiver. Then run the Verify steps above.
|
|
296
296
|
|
|
297
297
|
## Not a React app
|
package/agent/templates/main.tpl
CHANGED
|
@@ -10,6 +10,7 @@ import { createRoot } from 'react-dom/client'
|
|
|
10
10
|
import { BasaltProvider, createBasaltRouter } from 'basalt-ui'
|
|
11
11
|
import { routeTree } from './routeTree.gen'
|
|
12
12
|
|
|
13
|
+
// Telemetry: `<BasaltProvider telemetry={sink} />`; the `BasaltEvent` JSDoc has the OTel span mapping.
|
|
13
14
|
const router = createBasaltRouter({ routeTree })
|
|
14
15
|
|
|
15
16
|
declare module '@tanstack/react-router' {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The resolved `node_modules/basalt-ui` a command acts on — a type-only leaf shared by `index` and `doctor-upgrade`. */
|
|
2
|
+
export type BasaltInstall = {
|
|
3
|
+
/** Absolute path of the resolved `node_modules/basalt-ui` directory, or null when unresolvable. */
|
|
4
|
+
dir: string | null;
|
|
5
|
+
/** The resolved copy's own version, or null. */
|
|
6
|
+
version: string | null;
|
|
7
|
+
/** How it was found — `null` when unresolved. `'workspace'` is the isolated-linker case. */
|
|
8
|
+
how: 'cwd' | 'ancestor' | 'workspace' | null;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=basalt-install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basalt-install.d.ts","sourceRoot":"","sources":["../../src/cli/basalt-install.ts"],"names":[],"mappings":"AAAA,yHAAyH;AACzH,MAAM,MAAM,aAAa,GAAG;IAC1B,mGAAmG;IACnG,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,gDAAgD;IAChD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,4FAA4F;IAC5F,GAAG,EAAE,KAAK,GAAG,UAAU,GAAG,WAAW,GAAG,IAAI,CAAA;CAC7C,CAAA"}
|
|
File without changes
|
package/dist/cli/check-theme.js
CHANGED
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
OXLINT_NO_BIN,
|
|
22
22
|
oxlintBinResolves,
|
|
23
23
|
packageRoot,
|
|
24
|
-
parseJsonc,
|
|
25
24
|
readBasaltConfig,
|
|
26
25
|
readIfExists,
|
|
27
26
|
readSource,
|
|
@@ -31,6 +30,7 @@ import {
|
|
|
31
30
|
SERIES_MODULE_HINT_RE,
|
|
32
31
|
waiverHintFor
|
|
33
32
|
} from "./index.js";
|
|
33
|
+
import { parseJsonc } from "./source-text.js";
|
|
34
34
|
function oxlintLaneAt(dir) {
|
|
35
35
|
const raw = readIfExists(resolve(dir, ".oxlintrc.json"));
|
|
36
36
|
if (raw === null) return "absent";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BasaltConfig } from './config.js';
|
|
2
|
-
import type { BasaltInstall } from './
|
|
2
|
+
import type { BasaltInstall } from './basalt-install.js';
|
|
3
3
|
export type Check = {
|
|
4
4
|
fail: string;
|
|
5
5
|
} | {
|
|
@@ -12,7 +12,7 @@ export declare function tsconfigBaseCheck(cwd: string): Check;
|
|
|
12
12
|
/** `retired-lint-rules`: `basalt/<id>` entries the installed plugin no longer registers. */
|
|
13
13
|
export declare function retiredLintRulesCheck(cwd: string, install: BasaltInstall): Check;
|
|
14
14
|
/** `dropped-subpaths`: `basalt-ui/<subpath>` imports the installed `exports` map does not have. */
|
|
15
|
-
export declare function droppedSubpathsCheck(cwd: string,
|
|
15
|
+
export declare function droppedSubpathsCheck(cwd: string, scanned: string[], install: BasaltInstall): Check;
|
|
16
16
|
/**
|
|
17
17
|
* `oxlint-floor`: fails when the nearest installed oxlint is older than {@link OXLINT_FLOOR}, which
|
|
18
18
|
* cannot parse the preset. Reads `cwd`, as `oxlint-preset` does; a missing oxlint is that check's job.
|
|
@@ -26,9 +26,8 @@ export declare function oxlintFloorCheck(cwd: string): Check;
|
|
|
26
26
|
*/
|
|
27
27
|
export declare function seedTsconfigExtends(cwd: string): string | null;
|
|
28
28
|
/**
|
|
29
|
-
* Warnings for a Start app's embedded provider; heuristics, not proofs. A `{...spread}` on
|
|
30
|
-
* could carry a `router
|
|
31
|
-
* provider will find no `context.queryClient`. Empty when there is nothing to judge.
|
|
29
|
+
* Warnings for a Start app's embedded provider; heuristics, not proofs. A `{...spread}` on a tag
|
|
30
|
+
* could carry a `router`. Empty when there is nothing to judge.
|
|
32
31
|
*/
|
|
33
32
|
export declare function startWiringWarnings(cwd: string): string[];
|
|
34
33
|
/**
|
|
@@ -71,5 +70,5 @@ export declare const SUBPATH_REQUIRED_PEERS: Readonly<Record<string, readonly st
|
|
|
71
70
|
* `subpath-peers`: every `basalt-ui/<subpath>` the app imports has its required peers installed. A
|
|
72
71
|
* missing one still builds, then throws "Could not resolve" when the chunk loads.
|
|
73
72
|
*/
|
|
74
|
-
export declare function subpathPeersCheck(cwd: string,
|
|
73
|
+
export declare function subpathPeersCheck(cwd: string, scanned: string[], install: BasaltInstall): Check;
|
|
75
74
|
//# sourceMappingURL=doctor-upgrade.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor-upgrade.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-upgrade.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor-upgrade.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-upgrade.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAkBrD,MAAM,MAAM,KAAK,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAA;AA6B9D,wEAAwE;AACxE,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,KAAG,MACc,CAAA;AA+CvD,uFAAuF;AACvF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAqBpD;AA+CD,4FAA4F;AAC5F,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,KAAK,CAsBhF;AA2DD,mGAAmG;AACnG,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,aAAa,GACrB,KAAK,CAyBP;AAiBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAUnD;AAUD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAkC9D;AAkHD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAUzD;AAID;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,YAAY,GAChB;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAS7C;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CA8BjD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAczD;AAkBD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,KAAK,CAgB1E;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAQ9E,CAAA;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,aAAa,GAAG,KAAK,CAsB/F"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { writeFileSync } from "node:fs";
|
|
1
|
+
import { readdirSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { dirname, relative, resolve } from "node:path";
|
|
4
4
|
import { BASALT_CONFIG_KEYS, RETIRED_CONFIG_KEYS, shellConfigError } from "./config.js";
|
|
5
|
-
import { parseJsonc, routerSeedDest, scannableFiles } from "./index.js";
|
|
6
5
|
import {
|
|
7
6
|
appEntry,
|
|
8
7
|
callsIn,
|
|
@@ -10,9 +9,14 @@ import {
|
|
|
10
9
|
hasRouter,
|
|
11
10
|
isCodeRoutedApp,
|
|
12
11
|
isStartApp,
|
|
13
|
-
routeTreeDirs
|
|
12
|
+
routeTreeDirs,
|
|
13
|
+
routerSeedDest,
|
|
14
|
+
START_PROVIDER_HINT
|
|
14
15
|
} from "./router-wiring.js";
|
|
15
|
-
import {
|
|
16
|
+
import { FONTS_CSS_HINT } from "../guard/fonts-hint.js";
|
|
17
|
+
import { carriesRouter } from "./provider-tags.js";
|
|
18
|
+
import { followProviderHops, loadModule } from "./render-imports.js";
|
|
19
|
+
import { parseJsonc, readIfExists, readPackageJson, tokenize } from "./source-text.js";
|
|
16
20
|
const guarded = (id, run) => {
|
|
17
21
|
try {
|
|
18
22
|
return run();
|
|
@@ -153,7 +157,7 @@ function cssImports(src) {
|
|
|
153
157
|
code.slice(0, m.index + m[0].length).split("\n").length
|
|
154
158
|
]);
|
|
155
159
|
}
|
|
156
|
-
const appImports = (cwd,
|
|
160
|
+
const appImports = (cwd, scanned) => scanned.flatMap((rel) => {
|
|
157
161
|
const isCode = /\.(?:[cm]?[jt]sx?|vue|astro)$/.test(rel);
|
|
158
162
|
if (!isCode && !rel.endsWith(".css")) return [];
|
|
159
163
|
const src = readIfExists(resolve(cwd, rel)) ?? "";
|
|
@@ -164,14 +168,14 @@ const appImports = (cwd, cfg) => scannableFiles(cwd, cfg).flatMap((rel) => {
|
|
|
164
168
|
const DROPPED_FIXES = /* @__PURE__ */ new Map([
|
|
165
169
|
[
|
|
166
170
|
"tokens.css",
|
|
167
|
-
|
|
171
|
+
`commit the emit instead: \`basalt-ui tokens:css --out src/tokens.css\` and import that file (${FONTS_CSS_HINT})`
|
|
168
172
|
],
|
|
169
173
|
[
|
|
170
174
|
"router-tanstack",
|
|
171
175
|
"nav symbols (`defineNav`, `navTarget`, \u2026) now import from `basalt-ui`, stores (`createSearchStore`, `field`, \u2026) from `basalt-ui/state`"
|
|
172
176
|
]
|
|
173
177
|
]);
|
|
174
|
-
function droppedSubpathsCheck(cwd,
|
|
178
|
+
function droppedSubpathsCheck(cwd, scanned, install) {
|
|
175
179
|
const id = "dropped-subpaths";
|
|
176
180
|
return withInstall(id, install, "exports", (dir) => {
|
|
177
181
|
const pkg = readPackageJson(dir);
|
|
@@ -183,7 +187,7 @@ function droppedSubpathsCheck(cwd, cfg, install) {
|
|
|
183
187
|
(k) => k === `./${sub}` || k.endsWith("*") && `./${sub}`.startsWith(k.slice(0, -1))
|
|
184
188
|
);
|
|
185
189
|
const isDropped = (sub) => DROPPED_FIXES.has(sub) || !hasExport(sub);
|
|
186
|
-
const found = appImports(cwd,
|
|
190
|
+
const found = appImports(cwd, scanned).filter(([sub]) => isDropped(sub));
|
|
187
191
|
if (found.length === 0) return null;
|
|
188
192
|
const hits = found.map(([sub, rel, line]) => `${rel}:${line} imports basalt-ui/${sub}`);
|
|
189
193
|
const more = hits.length > 10 ? ` (+${hits.length - 10} more)` : "";
|
|
@@ -248,65 +252,90 @@ function seedTsconfigExtends(cwd) {
|
|
|
248
252
|
}
|
|
249
253
|
const SEED_HINT = "node_modules/basalt-ui/agent/templates/main.tpl";
|
|
250
254
|
const ROUTER_PLUGIN_FIX = "Fix: `bun add -D @tanstack/router-plugin`, add `tanstackRouter({ target: 'react', autoCodeSplitting: true })` from '@tanstack/router-plugin/vite' to `plugins` in vite.config.ts (before react()), then run vite once to generate src/routeTree.gen.ts \u2014 or define the tree in code (`createRootRoute` + `createRoute`), drop the routeTree.gen import and pass the tree to createBasaltRouter.";
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
+
const PATHLESS_LAYOUT = /(^|\/)(_[^_./][^./]*\.[jt]sx|_[^_./][^./]*\/route\.[jt]sx)$/;
|
|
256
|
+
function filesUnder(cwd, rel) {
|
|
257
|
+
let entries;
|
|
258
|
+
try {
|
|
259
|
+
entries = readdirSync(resolve(cwd, rel), { withFileTypes: true });
|
|
260
|
+
} catch {
|
|
261
|
+
return [];
|
|
262
|
+
}
|
|
263
|
+
return entries.flatMap(
|
|
264
|
+
(e) => e.isDirectory() ? filesUnder(cwd, `${rel}/${e.name}`) : [`${rel}/${e.name}`]
|
|
265
|
+
);
|
|
255
266
|
}
|
|
256
|
-
function
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
const ch = code[i];
|
|
263
|
-
if (inLiteral(i)) continue;
|
|
264
|
-
if (ch === "{") {
|
|
265
|
-
if (depth++ === 0 && isSpreadAt(code, i)) tag.spread = true;
|
|
266
|
-
} else if (ch === "}") depth--;
|
|
267
|
-
else if (ch === ">" && depth === 0) break;
|
|
268
|
-
else if (depth === 0) tag.attrs += ch;
|
|
269
|
-
}
|
|
270
|
-
return tag;
|
|
271
|
-
});
|
|
267
|
+
function startProviderFiles(cwd) {
|
|
268
|
+
const rootFile = routerSeedDest("", "root");
|
|
269
|
+
const routesDir = dirname(rootFile);
|
|
270
|
+
const root = loadModule(cwd, rootFile);
|
|
271
|
+
const layouts = filesUnder(cwd, routesDir).filter((f) => PATHLESS_LAYOUT.test(f.slice(routesDir.length + 1))).toSorted().map((f) => loadModule(cwd, f));
|
|
272
|
+
return { root, layouts, ...followProviderHops(cwd, [root, ...layouts]) };
|
|
272
273
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
if (!mounting && tags.length > 0) return null;
|
|
280
|
-
const problem = text === null ? "does not exist" : mounting ? "passes router= to BasaltProvider, which mounts a second router inside Start" : "does not render <BasaltProvider>";
|
|
281
|
-
return {
|
|
282
|
-
fail: `app-wiring: ${root} ${problem} (TanStack Start app). Fix: render <BasaltProvider><Outlet /></BasaltProvider> in the root route component.`
|
|
283
|
-
};
|
|
274
|
+
function rootRouteKind(src) {
|
|
275
|
+
const kind = /\bexport\s+const\s+Route\s*(?::[^=]+)?=\s*(createRootRouteWithContext|createRootRoute)\b/.exec(
|
|
276
|
+
tokenize(src).code
|
|
277
|
+
)?.[1];
|
|
278
|
+
if (kind === void 0) return null;
|
|
279
|
+
return kind === "createRootRoute" ? "untyped" : "typed";
|
|
284
280
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
281
|
+
const fail = (problem, fix) => ({
|
|
282
|
+
fail: `app-wiring: ${problem} (TanStack Start app). Fix: ${fix}.`
|
|
283
|
+
});
|
|
284
|
+
function startWiring(cwd) {
|
|
285
|
+
const { root, layouts, hops, far } = startProviderFiles(cwd);
|
|
286
|
+
const withTags = [root, ...layouts, ...hops].filter((f) => f.tags.length > 0);
|
|
287
|
+
const mounting = withTags.find((f) => f.tags.some(carriesRouter));
|
|
288
|
+
if (mounting) {
|
|
289
|
+
return fail(
|
|
290
|
+
`${mounting.file} passes router= to BasaltProvider, which mounts a second router inside Start`,
|
|
291
|
+
START_PROVIDER_HINT
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
const [first] = withTags;
|
|
295
|
+
if (first === void 0) {
|
|
296
|
+
const problem = root.text === null ? `${root.file} does not exist and no pathless layout renders <BasaltProvider>` : `neither ${root.file} nor a pathless layout (src/routes/_<name>.tsx, _<name>/route.tsx) renders <BasaltProvider>` + (far.length > 0 ? `, and the provider in ${far.join(", ")} is two imports away (doctor follows one import hop from a route file)` : "");
|
|
297
|
+
return fail(problem, START_PROVIDER_HINT);
|
|
298
|
+
}
|
|
299
|
+
if (far.length > 0) {
|
|
300
|
+
return fail(
|
|
301
|
+
`${first.file} renders a <BasaltProvider> and so does ${far.join(", ")}, two imports away (doctor follows one import hop from a route file); the extra one nests a duplicate Query/Mantine tree`,
|
|
302
|
+
"keep one"
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
const tagCount = withTags.reduce((n, f) => n + f.tags.length, 0);
|
|
306
|
+
if (tagCount > 1) {
|
|
307
|
+
return fail(
|
|
308
|
+
`${[...new Set(withTags.map((f) => f.file))].join(" and ")} render ${tagCount} <BasaltProvider> tags; the extra ones nest a duplicate Query/Mantine tree`,
|
|
309
|
+
"keep one"
|
|
292
310
|
);
|
|
293
311
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
"
|
|
312
|
+
if (root.text === null) {
|
|
313
|
+
return fail(
|
|
314
|
+
`${root.file} does not exist, so the provider in ${first.file} has no root route context`,
|
|
315
|
+
"create it with `export const Route = createRootRouteWithContext<BasaltRouterContext>()({ \u2026 })`"
|
|
298
316
|
);
|
|
299
317
|
}
|
|
300
|
-
return
|
|
318
|
+
if (rootRouteKind(root.text) !== "untyped") return null;
|
|
319
|
+
return fail(
|
|
320
|
+
`${root.file} exports a Route built with createRootRoute(), so its router context has no queryClient, which the embedded BasaltProvider reads from context.queryClient`,
|
|
321
|
+
"`createRootRouteWithContext<BasaltRouterContext>()({ \u2026 })` (import type { BasaltRouterContext } from 'basalt-ui') and pass the QueryClient in createRouter({ context })"
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
function startWiringWarnings(cwd) {
|
|
325
|
+
if (!isStartApp(cwd, "")) return [];
|
|
326
|
+
const { root, layouts, hops } = startProviderFiles(cwd);
|
|
327
|
+
return [.../* @__PURE__ */ new Set([root, ...layouts, ...hops])].filter((f) => f.tags.some((t) => t.spread)).map(
|
|
328
|
+
(f) => `app-wiring: <BasaltProvider {...spread}> in ${f.file} could pass router=, which mounts a second router inside Start (heuristic: the spread is not followed).`
|
|
329
|
+
);
|
|
301
330
|
}
|
|
302
331
|
const BASALT_SHELL_TAG = /<BasaltShell\b/g;
|
|
303
332
|
function shellDeclarationFindings(cwd, cfg) {
|
|
304
|
-
const
|
|
333
|
+
const fail2 = shellConfigError(cfg);
|
|
305
334
|
if (cfg.shell !== false || !callsIn(cwd, appEntry(cwd), BASALT_SHELL_TAG)) {
|
|
306
|
-
return { fail, warnings: [] };
|
|
335
|
+
return { fail: fail2, warnings: [] };
|
|
307
336
|
}
|
|
308
337
|
return {
|
|
309
|
-
fail,
|
|
338
|
+
fail: fail2,
|
|
310
339
|
warnings: ["declared basalt.shell: false but the app renders BasaltShell \u2014 drop the key."]
|
|
311
340
|
};
|
|
312
341
|
}
|
|
@@ -387,12 +416,12 @@ const SUBPATH_REQUIRED_PEERS = {
|
|
|
387
416
|
forms: ["@mantine/form"],
|
|
388
417
|
table: ["@tanstack/react-table"]
|
|
389
418
|
};
|
|
390
|
-
function subpathPeersCheck(cwd,
|
|
419
|
+
function subpathPeersCheck(cwd, scanned, install) {
|
|
391
420
|
const id = "subpath-peers";
|
|
392
421
|
return withInstall(id, install, "peers", (dir) => {
|
|
393
422
|
const missing = /* @__PURE__ */ new Map();
|
|
394
423
|
for (const [sub, file] of new Map(
|
|
395
|
-
appImports(cwd,
|
|
424
|
+
appImports(cwd, scanned).toReversed().map(([s, f]) => [s, f])
|
|
396
425
|
)) {
|
|
397
426
|
for (const peer of SUBPATH_REQUIRED_PEERS[sub] ?? []) {
|
|
398
427
|
if (installedVersion(cwd, peer) !== null) continue;
|
package/dist/cli/doctor.js
CHANGED
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
OXLINT_FILES,
|
|
17
17
|
OXLINT_NO_BIN,
|
|
18
18
|
oxlintBinResolves,
|
|
19
|
-
parseJsonc,
|
|
20
19
|
readBasaltConfig,
|
|
21
20
|
readIfExists,
|
|
22
21
|
readManifest,
|
|
@@ -28,6 +27,7 @@ import {
|
|
|
28
27
|
scannableFiles,
|
|
29
28
|
shippedAssetPath
|
|
30
29
|
} from "./index.js";
|
|
30
|
+
import { parseJsonc } from "./source-text.js";
|
|
31
31
|
import { resolveRoots } from "./config.js";
|
|
32
32
|
import {
|
|
33
33
|
appWiringCheck,
|
|
@@ -252,7 +252,7 @@ basalt-ui doctor \u2014 ${cwd}
|
|
|
252
252
|
}
|
|
253
253
|
const droppedCheck = [
|
|
254
254
|
"dropped-subpaths: no import of a basalt-ui subpath the install lacks",
|
|
255
|
-
droppedSubpathsCheck(appDir, cfg, install)
|
|
255
|
+
droppedSubpathsCheck(appDir, scannableFiles(appDir, cfg), install)
|
|
256
256
|
];
|
|
257
257
|
const runChecks = (checks) => {
|
|
258
258
|
for (const [ok, check] of checks) {
|
|
@@ -282,7 +282,7 @@ basalt-ui doctor \u2014 ${cwd}
|
|
|
282
282
|
["exact-peers: installed exact-pinned peers match basalt-ui", exactPeersCheck(cwd, install)],
|
|
283
283
|
[
|
|
284
284
|
"subpath-peers: every imported basalt-ui subpath has its required peers installed",
|
|
285
|
-
subpathPeersCheck(appDir, cfg, install)
|
|
285
|
+
subpathPeersCheck(appDir, scannableFiles(appDir, cfg), install)
|
|
286
286
|
],
|
|
287
287
|
[
|
|
288
288
|
"config-keys: the basalt config block sets only keys basalt-ui reads",
|