basalt-ui 2.8.0 → 2.8.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +186 -190
  2. package/MIGRATING.md +52 -13
  3. package/dist/cli/doctor-upgrade.d.ts +5 -4
  4. package/dist/cli/doctor-upgrade.d.ts.map +1 -1
  5. package/dist/cli/doctor-upgrade.js +23 -99
  6. package/dist/cli/doctor.d.ts +2 -1
  7. package/dist/cli/doctor.d.ts.map +1 -1
  8. package/dist/cli/doctor.js +17 -13
  9. package/dist/cli/index.d.ts +15 -6
  10. package/dist/cli/index.d.ts.map +1 -1
  11. package/dist/cli/index.js +16 -27
  12. package/dist/cli/init.d.ts.map +1 -1
  13. package/dist/cli/init.js +9 -6
  14. package/dist/cli/router-wiring.d.ts +37 -0
  15. package/dist/cli/router-wiring.d.ts.map +1 -0
  16. package/dist/cli/router-wiring.js +116 -0
  17. package/dist/cli/source-text.d.ts +12 -0
  18. package/dist/cli/source-text.d.ts.map +1 -0
  19. package/dist/cli/source-text.js +46 -0
  20. package/dist/cli/sync.d.ts.map +1 -1
  21. package/dist/cli/sync.js +15 -10
  22. package/dist/content/code-block.d.ts.map +1 -1
  23. package/dist/content/code-block.js +36 -27
  24. package/dist/content/code-block.module.css +19 -1
  25. package/dist/content/mermaid-sanitize.d.ts +15 -0
  26. package/dist/content/mermaid-sanitize.d.ts.map +1 -0
  27. package/dist/content/mermaid-sanitize.js +28 -0
  28. package/dist/content/mermaid.d.ts +6 -0
  29. package/dist/content/mermaid.d.ts.map +1 -1
  30. package/dist/content/mermaid.js +3 -1
  31. package/dist/provider/index.d.ts.map +1 -1
  32. package/dist/provider/index.js +3 -2
  33. package/dist/vite-boot.d.ts +25 -0
  34. package/dist/vite-boot.d.ts.map +1 -0
  35. package/dist/vite-boot.js +36 -0
  36. package/dist/vite.d.ts +24 -3
  37. package/dist/vite.d.ts.map +1 -1
  38. package/dist/vite.js +7 -16
  39. package/llms.txt +4 -3
  40. package/package.json +1 -1
  41. package/src/cli/doctor-upgrade.ts +29 -145
  42. package/src/cli/doctor.ts +19 -14
  43. package/src/cli/index.ts +26 -41
  44. package/src/cli/init.ts +9 -6
  45. package/src/cli/router-wiring.ts +185 -0
  46. package/src/cli/source-text.ts +62 -0
  47. package/src/cli/sync.ts +17 -10
  48. package/src/content/code-block.module.css +19 -1
  49. package/src/content/code-block.tsx +7 -2
  50. package/src/content/mermaid-sanitize.ts +49 -0
  51. package/src/content/mermaid.tsx +3 -2
  52. package/src/provider/index.tsx +6 -3
  53. package/src/vite-boot.ts +109 -0
  54. package/src/vite.ts +32 -61
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 | 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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
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) | — |
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
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 | 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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
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) | — | — |
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
81
81
 
82
82
  ---
83
83
 
@@ -1046,6 +1046,37 @@ 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.8.1 — boot paint follows the stored scheme
1050
+
1051
+ `basaltAppPlugin` now injects a tiny inline head script that reads Mantine's stored color scheme
1052
+ (`mantine-color-scheme-value`; `auto` via `prefers-color-scheme`) and keys the anti-FOUC paint off
1053
+ it, so a user who chose light no longer sees a dark flash on cold load. Nothing to change. A stored
1054
+ value wins over the build-time `colorScheme` (an app that removes its scheme toggle should clear the
1055
+ key). Pass `bootScript: false` under a CSP that forbids inline scripts without a nonce
1056
+ (`html.cspNonce` covers both boot tags) or with a custom `colorSchemeManager` key.
1057
+
1058
+ **Mermaid diagrams.** `MermaidDiagram` no longer ships beautiful-mermaid's Google Fonts `@import`
1059
+ inside the SVG (a broken `family=var(--basalt-font-sans)` request per diagram), and its
1060
+ `font-family` is the unquoted `var(--basalt-font-sans)` instead of an invalid quoted `'var(…)'`
1061
+ family. Behaviour fix; nothing to migrate.
1062
+
1063
+ **Dev chunks.** A production build no longer emits (or lets a PWA service worker precache) the dev-dock, theme-lab and devtools chunks: `BasaltProvider`'s dock `import()` is now dead code under a literal `process.env.NODE_ENV` read. Nothing to migrate; `check-budgets` gates it.
1064
+
1065
+ **Code-routed apps and tokens-only `doctor` (CLI).** An app that calls `createBasaltRouter` (in the
1066
+ entry or a module it imports, statically or via `import()`) but has no TanStack router plugin, no
1067
+ `routeTree.gen.*` and an entry that does not import one is code-routed. `init`, `sync` and `doctor`
1068
+ share that one test: `init` places no `main.tsx`, `nav.tsx` or `__root.tsx` seed, `sync` drops their
1069
+ manifest entries (the files stay yours) with a one-line notice, and `doctor` `app-wiring` accepts the
1070
+ tree. `dropped-subpaths` now also runs for `tokens-only` consumers, so a removed
1071
+ `@import 'basalt-ui/tokens.css'` fails there too. Fix: `basalt-ui tokens:css --out src/tokens.css`
1072
+ and import that file.
1073
+
1074
+ **Code block copy button.** A `CodeBlock` without a `title` now reserves the floating copy button's box above its first line:
1075
+ `padding-top` goes 10 → 28px (title-less fences are +18px tall), so the button no longer covers line
1076
+ one on touch or hover. The reserve is `--vx-space-code-block-floating-copy-offset` + the 22px button;
1077
+ titled fences are unchanged. The inner `pre` margin reset also outranks Prose's block margin now, so
1078
+ the unhighlighted fallback and the highlighted fence measure the same.
1079
+
1049
1080
  ## 2.8.0 — the fleet probe fixes
1050
1081
 
1051
1082
  Ledger rows 61-67 (`docs/waves/argo-friction.md`), found while the rest of the fleet probed 1.x → 2.x.
@@ -1348,7 +1379,15 @@ suppresses `AGENTS.md` — or still carries a basalt block.
1348
1379
 
1349
1380
  ## 1.40.3
1350
1381
 
1351
- _Nothing to migrate in this release._
1382
+ No API change, but light-scheme colours moved to clear WCAG AA. A consumer that commits an emitted
1383
+ token file (`basalt-ui tokens:css`) or pins screenshots sees a diff:
1384
+
1385
+ - `--vx-faint` (light) `#737376` → `#69696c`.
1386
+ - `--mantine-color-anchor` now resolves to `--vx-accent-hover`.
1387
+ - `--mantine-color-error` reads the `bad` solid pulled toward ink.
1388
+ - `Badge` light/outline text and inactive `SegmentedControl` labels read darker.
1389
+
1390
+ Re-emit the token file and accept the diff; nothing to change in code.
1352
1391
 
1353
1392
  ## 1.40.2
1354
1393
 
@@ -33,10 +33,11 @@ export declare function seedTsconfigExtends(cwd: string): string | null;
33
33
  export declare function startWiringWarnings(cwd: string): string[];
34
34
  /**
35
35
  * `app-wiring`: the entry module `index.html` loads (default src/main.tsx) mounts `BasaltProvider`
36
- * on a `createBasaltRouter` router (called in the entry or a module it imports), and the router tree is generated: the vite config calls a
37
- * binding imported from `@tanstack/router-plugin` in `plugins`, or a `routeTree.gen.*` already sits
38
- * beside the entry (or in src/). `basaltViteConfig` does not register that plugin, so naming it
39
- * proves nothing.
36
+ * on a `createBasaltRouter` router (called in the entry or a module it imports), and the router tree
37
+ * exists: the vite config calls a binding imported from `@tanstack/router-plugin` (after its
38
+ * `plugins` key), a `routeTree.gen.*` sits beside the entry (or in src/), or the app is code-routed
39
+ * (`isCodeRoutedApp`, the same predicate `init` and `sync` use). `basaltViteConfig` does not
40
+ * register the plugin, so naming it proves nothing.
40
41
  */
41
42
  export declare function appWiringCheck(cwd: string): Check;
42
43
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"doctor-upgrade.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-upgrade.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAS5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C,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;AAqFD,mGAAmG;AACnG,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,YAAY,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;AA0JD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,M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O,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;AAkED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAkBzD;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,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,GAAG,KAAK,CAsB/F"}
@@ -1,15 +1,17 @@
1
- import { existsSync, writeFileSync } from "node:fs";
1
+ import { 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 } from "./config.js";
5
+ import { parseJsonc, routerSeedDest, scannableFiles } from "./index.js";
5
6
  import {
7
+ appEntry,
8
+ hasRouteTree,
9
+ hasRouter,
10
+ isCodeRoutedApp,
6
11
  isStartApp,
7
- parseJsonc,
8
- readIfExists,
9
- readPackageJson,
10
- routerSeedDest,
11
- scannableFiles
12
- } from "./index.js";
12
+ routeTreeDirs
13
+ } from "./router-wiring.js";
14
+ import { readIfExists, readPackageJson, tokenize } from "./source-text.js";
13
15
  const guarded = (id, run) => {
14
16
  try {
15
17
  return run();
@@ -133,23 +135,7 @@ function retiredLintRulesCheck(cwd, install) {
133
135
  };
134
136
  });
135
137
  }
136
- const TOKEN = /("(?:\\.|[^"\\\n])*"|'(?:\\.|[^'\\\n])*'|`(?:\\.|[^`\\])*`)|\/\/[^\n]*|\/\*[\s\S]*?\*\//g;
137
138
  const SUBPATH_IMPORT = /(?:(?:^|;)[ \t]*(?:(?:import|export)\b[^'"`;]*?\bfrom|import)\s*|(?<![.\w$])(?:import|require)\s*\(\s*)(['"])basalt-ui\/([^'"]+)\1/gm;
138
- function tokenize(src) {
139
- const literals = [];
140
- const code = src.replace(TOKEN, (m, literal, at) => {
141
- if (literal === void 0) return m.replace(/[^\n]/g, " ");
142
- if (!literal.startsWith("`")) {
143
- literals.push([at, at + m.length]);
144
- return m;
145
- }
146
- return m.replace(
147
- /(\$\{[^}]*\})|[^\n`]/g,
148
- (c, interpolation) => interpolation ?? " "
149
- );
150
- });
151
- return { code, inLiteral: (at) => literals.some(([from, to]) => at >= from && at < to) };
152
- }
153
139
  function basaltImports(src) {
154
140
  const { code, inLiteral } = tokenize(src);
155
141
  return [...code.matchAll(SUBPATH_IMPORT)].filter((m) => !inLiteral(m.index)).map((m) => [m[2], code.slice(0, m.index + m[0].length).split("\n").length]);
@@ -259,70 +245,8 @@ function seedTsconfigExtends(cwd) {
259
245
  writeFileSync(target, `${text.slice(0, at)}${key}${text.slice(at)}`);
260
246
  return `added "extends": "${TSCONFIG_PRESET_ID}" to ${name}.`;
261
247
  }
262
- const VITE_CONFIGS = ["ts", "mts", "cts", "js", "mjs", "cjs"].map((e) => `vite.config.${e}`);
263
248
  const SEED_HINT = "node_modules/basalt-ui/agent/templates/main.tpl";
264
- 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.";
265
- function htmlEntry(html) {
266
- for (const [, attrs = ""] of html.replace(/<!--[\s\S]*?-->/g, "").matchAll(/<script\b([^>]*)>/gi)) {
267
- const src = /\bsrc\s*=\s*["']?([^"'\s>]+)/i.exec(attrs)?.[1];
268
- if (/\btype\s*=\s*["']?module\b/i.test(attrs) && src !== void 0 && !/^(?:[a-z][a-z0-9+.-]*:)?\/\//i.test(src)) {
269
- return src;
270
- }
271
- }
272
- return void 0;
273
- }
274
- function registersRouterPlugin(src) {
275
- const { code, inLiteral } = tokenize(src);
276
- const pluginsAt = [...code.matchAll(/\bplugins\b/g)].find((m) => !inLiteral(m.index))?.index;
277
- if (pluginsAt === void 0) return false;
278
- const imports = code.matchAll(
279
- /(?:^|;)[ \t]*import\s+(?:type\s+)?([^'"`;]*?)\s*from\s*(['"])@tanstack\/router-plugin(?:\/[^'"]*)?\2/gm
280
- );
281
- return [...imports].some((m) => {
282
- if (inLiteral(m.index)) return false;
283
- const names = (m[1] ?? "").replace(/[{}]/g, "").split(",").map((part) => part.trim()).filter((part) => part !== "" && !/^type\s/.test(part)).map((part) => part.split(/\s+as\s+/).pop());
284
- return names.some(
285
- (name) => [
286
- ...code.matchAll(
287
- new RegExp(`(?<![.\\w$])${name.replace(/\$/g, "\\$")}(?:\\.\\w+)?\\s*\\(`, "g")
288
- )
289
- ].some((call) => call.index > pluginsAt && !inLiteral(call.index))
290
- );
291
- });
292
- }
293
- const RELATIVE_IMPORT = /(?:\b(?:import|export)\b[^'";]*?\bfrom|\bimport)\s*['"](\.{1,2}\/[^'"]+)['"]/g;
294
- function resolveRelative(from, spec) {
295
- const base = resolve(dirname(from), spec.replace(/\.[jt]sx?$/, ""));
296
- return [
297
- resolve(dirname(from), spec),
298
- `${base}.ts`,
299
- `${base}.tsx`,
300
- `${base}/index.ts`,
301
- `${base}/index.tsx`
302
- ].find((f) => /\.[jt]sx?$/.test(f) && existsSync(f)) ?? null;
303
- }
304
- function routerCreatedInImports(cwd, entry) {
305
- const seen = /* @__PURE__ */ new Set([resolve(cwd, entry)]);
306
- let frontier = [...seen];
307
- for (let depth = 0; depth < 3 && frontier.length > 0; depth++) {
308
- const next = [];
309
- for (const file of frontier) {
310
- for (const m of (readIfExists(file) ?? "").matchAll(RELATIVE_IMPORT)) {
311
- const dep = resolveRelative(file, m[1] ?? "");
312
- if (dep === null || seen.has(dep)) continue;
313
- seen.add(dep);
314
- const { code, inLiteral } = tokenize(readIfExists(dep) ?? "");
315
- const called = [...code.matchAll(/\bcreateBasaltRouter\b/g)].some(
316
- (c) => !inLiteral(c.index)
317
- );
318
- if (called) return true;
319
- next.push(dep);
320
- }
321
- }
322
- frontier = next;
323
- }
324
- return false;
325
- }
249
+ 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.";
326
250
  function isSpreadAt(code, i) {
327
251
  const spread = /\{\s*\.\.\./y;
328
252
  spread.lastIndex = i;
@@ -377,29 +301,29 @@ function startWiringWarnings(cwd) {
377
301
  function appWiringCheck(cwd) {
378
302
  return guarded("app-wiring", () => {
379
303
  if (isStartApp(cwd, "")) return startWiring(cwd);
380
- const entry = (htmlEntry(readIfExists(resolve(cwd, "index.html")) ?? "") ?? "src/main.tsx").replace(/^\//, "");
304
+ const entry = appEntry(cwd);
381
305
  const text = readIfExists(resolve(cwd, entry));
382
306
  if (text === null) {
383
307
  return { fail: `app-wiring: ${entry} does not exist. Fix: make it match ${SEED_HINT}.` };
384
308
  }
385
- const { code, inLiteral } = tokenize(text);
386
- const used = (name) => [...code.matchAll(new RegExp(`\\b${name}\\b`, "g"))].some((m) => !inLiteral(m.index));
387
- const missing = ["BasaltProvider", "createBasaltRouter"].filter(
388
- (name) => !used(name) && !(name === "createBasaltRouter" && routerCreatedInImports(cwd, entry))
389
- );
309
+ const tokens = tokenize(text);
310
+ const { code, inLiteral } = tokens;
311
+ const wired = [
312
+ [
313
+ "BasaltProvider",
314
+ [...code.matchAll(/\bBasaltProvider\b/g)].some((m) => !inLiteral(m.index))
315
+ ],
316
+ ["createBasaltRouter", hasRouter(cwd, entry, tokens)]
317
+ ];
318
+ const missing = wired.filter(([, present]) => !present).map(([name]) => name);
390
319
  if (missing.length > 0) {
391
320
  return {
392
321
  fail: `app-wiring: ${entry} does not use ${missing.join(" or ")}. Fix: make it match ${SEED_HINT} (\`init\` seeds it only when the file is absent).`
393
322
  };
394
323
  }
395
- const vite = VITE_CONFIGS.map((f) => readIfExists(resolve(cwd, f))).find((t) => t !== null) ?? "";
396
- const dirs = [.../* @__PURE__ */ new Set([dirname(entry), "src"])];
397
- const generated = dirs.some(
398
- (d) => ["ts", "tsx", "js"].some((e) => existsSync(resolve(cwd, d, `routeTree.gen.${e}`)))
399
- );
400
- if (generated || registersRouterPlugin(vite)) return null;
324
+ if (hasRouteTree(cwd, entry) || isCodeRoutedApp(cwd, "")) return null;
401
325
  return {
402
- fail: `app-wiring: no vite.config calls the TanStack router plugin and ${dirs.join(" or ")}/routeTree.gen.ts does not exist. ${ROUTER_PLUGIN_FIX}`
326
+ fail: `app-wiring: the entry imports a generated route tree but no vite.config calls the TanStack router plugin and ${routeTreeDirs(entry).join(" or ")}/routeTree.gen.ts does not exist. ${ROUTER_PLUGIN_FIX}`
403
327
  };
404
328
  });
405
329
  }
@@ -23,7 +23,8 @@ export type DoctorResult = {
23
23
  * 7. `ai-major-parity`: the `ai` major agrees across this package.json's dependency fields
24
24
  * (exempt via `basalt.aiMajorSkewReason`; a stale reason warns).
25
25
  * 8-14. `tsconfig-base`, `retired-lint-rules`, `dropped-subpaths`, `app-wiring`, `exact-peers`,
26
- * `subpath-peers`, `config-keys` (./doctor-upgrade);
26
+ * `subpath-peers`, `config-keys` (./doctor-upgrade; a tokens-only consumer runs only
27
+ * `dropped-subpaths` of these — it imports CSS subpaths, where `tokens.css` was);
27
28
  * a check that cannot run is SKIPPED and exits non-zero.
28
29
  *
29
30
  * Warning (non-fatal):
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AA4DA,MAAM,MAAM,YAAY,GAAG;IACzB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAA;IACpB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AA2BD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,aAAa,GAAE,MAAsB,EAAE,KAAK,GAAE,MAAM,EAAO,GAAG,MAAM,CAoU1F"}
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AA4DA,MAAM,MAAM,YAAY,GAAG;IACzB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAA;IACpB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AA2BD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,MAAM,CAAC,aAAa,GAAE,MAAsB,EAAE,KAAK,GAAE,MAAM,EAAO,GAAG,MAAM,CAwU1F"}
@@ -255,24 +255,33 @@ basalt-ui doctor \u2014 ${cwd}
255
255
  } else {
256
256
  pass("ai-major-parity: this package.json declares no ai dependency \u2014 nothing to compare");
257
257
  }
258
+ const droppedCheck = [
259
+ "dropped-subpaths: no import of a basalt-ui subpath the install lacks",
260
+ droppedSubpathsCheck(appDir, cfg, install)
261
+ ];
262
+ const runChecks = (checks) => {
263
+ for (const [ok, check] of checks) {
264
+ if (check === null) pass(ok);
265
+ else if ("fail" in check) fail(check.fail);
266
+ else skip(check.skip);
267
+ }
268
+ };
258
269
  if (profile === "tokens-only") {
259
270
  pass(
260
- "tsconfig-base / retired-lint-rules / dropped-subpaths / app-wiring: n/a \u2014 a tokens-only consumer"
271
+ "tsconfig-base / retired-lint-rules / oxlint-floor / app-wiring / exact-peers / subpath-peers / config-keys: n/a \u2014 a tokens-only consumer"
261
272
  );
273
+ runChecks([droppedCheck]);
262
274
  } else {
263
- const upgrade = [
275
+ runChecks([
264
276
  ["tsconfig-base: tsconfig.json extends the shipped preset", tsconfigBaseCheck(appDir)],
265
277
  [
266
278
  "retired-lint-rules: .oxlintrc.json sets no retired basalt/* rule",
267
279
  retiredLintRulesCheck(cwd, install)
268
280
  ],
269
- [
270
- "dropped-subpaths: no import of a basalt-ui subpath the install lacks",
271
- droppedSubpathsCheck(appDir, cfg, install)
272
- ],
281
+ droppedCheck,
273
282
  ["oxlint-floor: the installed oxlint parses the shipped preset", oxlintFloorCheck(cwd)],
274
283
  [
275
- "app-wiring: the entry mounts BasaltProvider and the router tree is generated",
284
+ "app-wiring: the entry mounts BasaltProvider and the router tree exists",
276
285
  appWiringCheck(appDir)
277
286
  ],
278
287
  ["exact-peers: installed exact-pinned peers match basalt-ui", exactPeersCheck(cwd, install)],
@@ -284,12 +293,7 @@ basalt-ui doctor \u2014 ${cwd}
284
293
  "config-keys: the basalt config block sets only keys basalt-ui reads",
285
294
  unknownConfigKeysCheck(cwd)
286
295
  ]
287
- ];
288
- for (const [ok, check] of upgrade) {
289
- if (check === null) pass(ok);
290
- else if ("fail" in check) fail(check.fail);
291
- else skip(check.skip);
292
- }
296
+ ]);
293
297
  for (const line of startWiringWarnings(appDir)) warn(line);
294
298
  }
295
299
  lines.push("");
@@ -5,6 +5,7 @@ import { doctor } from './doctor.js';
5
5
  import { guardHook } from './guard-hook.js';
6
6
  import { init } from './init.js';
7
7
  import { sync } from './sync.js';
8
+ import type { RouterSeedSkip } from './router-wiring.js';
8
9
  import { fontsCss, normalizeColorFunctions, tokensCss } from './tokens-css.js';
9
10
  import type { BasaltConfig } from './config.js';
10
11
  export declare function resolveGuardConfig(cfg: BasaltConfig, profile: DoctorProfile): GuardConfig;
@@ -161,9 +162,6 @@ export declare const AGENTS_MD = "AGENTS.md";
161
162
  /** A `CLAUDE.md` shadows {@link AGENTS_MD} unless it imports it — `doctor` warns on one. */
162
163
  export declare const LEGACY_BLOCK_HOST = "CLAUDE.md";
163
164
  export declare function sha256(text: string): string;
164
- export declare function readIfExists(abs: string): string | null;
165
- /** `<dir>/package.json` parsed as `T`; null when absent or not JSON. */
166
- export declare function readPackageJson<T>(dir: string): T | null;
167
165
  /** Read a shipped source asset from the package root; null if the sibling hasn't authored it yet. */
168
166
  export declare function readSource(pkgRoot: string, source: string): string | null;
169
167
  /** The framework's own published version, read from the package root package.json. */
@@ -213,9 +211,17 @@ export declare const ROUTER_SEED_DESTS: {
213
211
  export declare function routerSeedDest(appRel: string, seed: keyof typeof ROUTER_SEED_DESTS): string;
214
212
  /** The router seeds' dests for an app dir (`main.tsx`, `nav.tsx`, `__root.tsx`). */
215
213
  export declare function routerSeedDests(appRel: string): string[];
216
- /** A TanStack Start app owns its router, so its router seeds give way to an in-tree `<BasaltProvider>`. */
217
- export declare function isStartApp(cwd: string, appRel: string): boolean;
218
214
  export declare const START_APP_NOTE: string;
215
+ /**
216
+ * The router seeds an app does not get, for `init` and `sync`: why (`start` | `code-routed` | null)
217
+ * and which dests. A tokens-only consumer gets none of them either.
218
+ */
219
+ export declare function routerSeedPlan(cwd: string, appRel: string, tokensOnly?: boolean): {
220
+ skip: RouterSeedSkip;
221
+ skipped: Set<string>;
222
+ };
223
+ /** The note `init` prints for a router-seed skip, or null when nothing was skipped. */
224
+ export declare function seedSkipNote(skip: RouterSeedSkip): string | null;
219
225
  /** The app directory a command's app-scoped half targets: `rel` is '' when it is the install root. */
220
226
  export type AppResolution = {
221
227
  dir: string;
@@ -348,7 +354,8 @@ export declare function writeUnit(file: ManagedFile, cwd: string, desired: strin
348
354
  * - missing : absent on disk → recreate.
349
355
  * - current : on disk == desired → nothing to do.
350
356
  * - unchanged: on disk matches a KNOWN-SHIPPED rendering (raw manifest hash, normalized manifest
351
- * hash, or normalized == normalized desired when no entry exists) → safe overwrite.
357
+ * hash, or — with or without a manifest entry — normalized == normalized desired,
358
+ * the format-only difference a formatter pass leaves) → safe overwrite.
352
359
  * - drifted : matches none of them (a real local edit) → skip unless --force.
353
360
  */
354
361
  export declare function classify(state: UnitState, manifestHash: string | undefined): Classification;
@@ -463,6 +470,8 @@ export declare function isStringArray(value: unknown): value is string[];
463
470
  * The `guard-hook` subcommand is async (reads stdin); all others are synchronous.
464
471
  */
465
472
  export declare function run(argv: string[], cwd?: string): number | Promise<number>;
473
+ export { isStartApp } from './router-wiring.js';
474
+ export { readIfExists, readPackageJson } from './source-text.js';
466
475
  export { RULE_NAMES, SKILL_NAMES };
467
476
  export type { ManagedFile };
468
477
  export { checkTheme, doctor, guardHook, init, sync, fontsCss, normalizeColorFunctions, tokensCss };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,WAAW,EAA4B,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,QAAQ,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;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9
8
  statSync,
10
9
  realpathSync,
@@ -21,6 +20,8 @@ import { guardHook } from "./guard-hook.js";
21
20
  import { COMMAND_OPTIONS, USAGE, unknownFlag } from "./help.js";
22
21
  import { init } from "./init.js";
23
22
  import { sync } from "./sync.js";
23
+ import { CODE_ROUTED_NOTE, routerSeedSkip } from "./router-wiring.js";
24
+ import { hasDependency, readIfExists, readPackageJson } from "./source-text.js";
24
25
  import { fontsCss, normalizeColorFunctions, tokensCss } from "./tokens-css.js";
25
26
  import { DEFAULT_ROOT, exemptRulePaths, resolveRoots } from "./config.js";
26
27
  const GUARD_PASSTHROUGH = {
@@ -224,21 +225,6 @@ const LEGACY_BLOCK_HOST = "CLAUDE.md";
224
225
  function sha256(text) {
225
226
  return createHash("sha256").update(text, "utf8").digest("hex");
226
227
  }
227
- function readIfExists(abs) {
228
- try {
229
- return readFileSync(abs, "utf8");
230
- } catch {
231
- return null;
232
- }
233
- }
234
- function readPackageJson(dir) {
235
- const raw = readIfExists(resolve(dir, "package.json"));
236
- try {
237
- return raw === null ? null : JSON.parse(raw);
238
- } catch {
239
- return null;
240
- }
241
- }
242
228
  function readSource(pkgRoot, source) {
243
229
  return readIfExists(resolve(pkgRoot, source));
244
230
  }
@@ -360,10 +346,15 @@ function routerSeedDests(appRel) {
360
346
  (seed) => routerSeedDest(appRel, seed)
361
347
  );
362
348
  }
363
- function isStartApp(cwd, appRel) {
364
- return hasDependency(resolve(cwd, appRel), "@tanstack/react-start");
365
- }
366
349
  const START_APP_NOTE = "TanStack Start app \u2014 no main.tsx/nav.tsx/__root.tsx seeded (Start owns the router); render <BasaltProvider><Outlet /></BasaltProvider> in your root route component.";
350
+ function routerSeedPlan(cwd, appRel, tokensOnly = false) {
351
+ const skip = tokensOnly ? null : routerSeedSkip(cwd, appRel);
352
+ return { skip, skipped: new Set(tokensOnly || skip !== null ? routerSeedDests(appRel) : []) };
353
+ }
354
+ function seedSkipNote(skip) {
355
+ if (skip === "start") return START_APP_NOTE;
356
+ return skip === "code-routed" ? CODE_ROUTED_NOTE : null;
357
+ }
367
358
  const appRelative = (root, dir) => relativePosix(root, dir).replace(/^\.\/?/, "");
368
359
  const hasViteEntry = (dir) => existsSync(resolve(dir, "src/main.tsx")) || existsSync(resolve(dir, "index.html"));
369
360
  function resolveAppDir(root) {
@@ -392,12 +383,6 @@ function resolveAppDir(root) {
392
383
  error: `${candidates.length} workspace packages depend on basalt-ui and have a Vite entry (${names}) \u2014 cannot tell which is the app. Set \`basalt.app\` (e.g. \`"basalt": { "app": "apps/web" }\`) in the root package.json.`
393
384
  };
394
385
  }
395
- function hasDependency(cwd, pkgName) {
396
- const pkg = readPackageJson(cwd);
397
- return Boolean(
398
- pkg?.dependencies?.[pkgName] ?? pkg?.devDependencies?.[pkgName] ?? pkg?.peerDependencies?.[pkgName]
399
- );
400
- }
401
386
  const ROOT_PLACEMENT = {
402
387
  isPackageRepoRoot: true,
403
388
  repoRoot: "",
@@ -979,6 +964,8 @@ function run(argv, cwd = process.cwd()) {
979
964
  return 1;
980
965
  }
981
966
  }
967
+ import { isStartApp } from "./router-wiring.js";
968
+ import { readIfExists as readIfExists2, readPackageJson as readPackageJson2 } from "./source-text.js";
982
969
  export {
983
970
  AGENTS_MD,
984
971
  LEGACY_BLOCK_HOST,
@@ -1028,9 +1015,9 @@ export {
1028
1015
  pruneRetiredManagedFiles,
1029
1016
  readBasaltConfig,
1030
1017
  readFrameworkVersion,
1031
- readIfExists,
1018
+ readIfExists2 as readIfExists,
1032
1019
  readManifest,
1033
- readPackageJson,
1020
+ readPackageJson2 as readPackageJson,
1034
1021
  readSource,
1035
1022
  reconcileRoots,
1036
1023
  relativePosix,
@@ -1044,10 +1031,12 @@ export {
1044
1031
  rootsNotices,
1045
1032
  routerSeedDest,
1046
1033
  routerSeedDests,
1034
+ routerSeedPlan,
1047
1035
  run,
1048
1036
  sameFile,
1049
1037
  scanBlock,
1050
1038
  scannableFiles,
1039
+ seedSkipNote,
1051
1040
  sha256,
1052
1041
  shippedAssetPath,
1053
1042
  sync,
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,SAAS,CAAA;AA8D7D,yGAAyG;AACzG,wBAAgB,IAAI,CAAC,GAAG,GAAE,MAAsB,EAAE,aAAa,GAAE,aAAkB,GAAG,MAAM,CA0L3F"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,SAAS,CAAA;AA6D7D,yGAAyG;AACzG,wBAAgB,IAAI,CAAC,GAAG,GAAE,MAAsB,EAAE,aAAa,GAAE,aAAkB,GAAG,MAAM,CA8L3F"}
package/dist/cli/init.js CHANGED
@@ -4,9 +4,8 @@ import { deriveSpacing } from "../tokens/core.js";
4
4
  import {
5
5
  MANIFEST_PATH,
6
6
  declaredProfile,
7
- isStartApp,
8
- routerSeedDests,
9
- START_APP_NOTE,
7
+ routerSeedPlan,
8
+ seedSkipNote,
10
9
  readBasaltConfig,
11
10
  findBasaltInstall,
12
11
  managedFiles,
@@ -81,8 +80,11 @@ function init(cwd = process.cwd(), scaffoldFlags = {}) {
81
80
  const manifest = readManifest(cwd);
82
81
  const placement = resolvePlacement(cwd);
83
82
  const tokensOnly = declaredProfile(readBasaltConfig(cwd), []) === "tokens-only";
84
- const startApp = isStartApp(cwd, placement.appRel);
85
- const skippedSeeds = new Set(tokensOnly || startApp ? routerSeedDests(placement.appRel) : []);
83
+ const { skip: seedSkip, skipped: skippedSeeds } = routerSeedPlan(
84
+ cwd,
85
+ placement.appRel,
86
+ tokensOnly
87
+ );
86
88
  const files = managedFiles(placement).filter((f) => !skippedSeeds.has(f.dest));
87
89
  const writtenFiles = [];
88
90
  const keptFiles = [];
@@ -136,7 +138,8 @@ Kept (already present \u2014 basalt did not touch them):`);
136
138
  const tsconfigLine = tokensOnly ? null : seedTsconfigExtends(cwd);
137
139
  if (tsconfigLine !== null) console.log(`basalt-ui init: ${tsconfigLine}`);
138
140
  if (buildNote !== null) console.log(`basalt-ui init: ${buildNote}`);
139
- if (startApp && !tokensOnly) console.log(`basalt-ui init: ${START_APP_NOTE}`);
141
+ const skipNote = seedSkipNote(seedSkip);
142
+ if (skipNote !== null) console.log(`basalt-ui init: ${skipNote}`);
140
143
  const rootsMessages = rootsNotices(rootsState);
141
144
  for (const line of rootsMessages.log) console.log(`basalt-ui init: ${line}`);
142
145
  for (const line of rootsMessages.error) console.error(`\u26A0 basalt-ui init: ${line}`);