basalt-ui 3.0.0 → 3.1.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.
Files changed (512) hide show
  1. package/AGENTS.md +1 -0
  2. package/CHANGELOG.md +72 -39
  3. package/MIGRATING.md +44 -2
  4. package/README.md +39 -12
  5. package/agent/rules/basalt-tokens.md +1 -1
  6. package/agent/rules/basalt-ui.md +3 -3
  7. package/agent/skills/basalt-app/references/live.md +4 -4
  8. package/agent/skills/basalt-app/references/migrate.md +2 -2
  9. package/agent/skills/basalt-app/references/setup.md +17 -8
  10. package/agent/skills/basalt-app/references/testing.md +8 -6
  11. package/agent/skills/basalt-design/SKILL.md +2 -1
  12. package/agent/skills/basalt-design/references/controls.md +1 -0
  13. package/agent/skills/basalt-design/references/parts.md +5 -1
  14. package/agent/templates/AGENTS-block.md.tpl +6 -23
  15. package/agent/templates/AGENTS-block.site.md.tpl +5 -18
  16. package/agent/templates/AGENTS-block.tokens.md.tpl +3 -7
  17. package/agent/templates/DESIGN.md.tpl +1 -1
  18. package/agent/templates/_app-error.i18n.tpl +8 -32
  19. package/agent/templates/_app-error.tpl +8 -32
  20. package/agent/templates/_app-pending.i18n.tpl +5 -3
  21. package/agent/templates/_app-pending.tpl +5 -4
  22. package/agent/templates/main.i18n.tpl +8 -3
  23. package/agent/templates/main.tpl +8 -3
  24. package/agent/templates/router.start.tpl +8 -3
  25. package/agent/templates/seed-messages.json +0 -30
  26. package/configs/oxlint-app.json +9 -1
  27. package/configs/oxlint-bridge.json +3 -1
  28. package/configs/oxlint-parts.json +9 -1
  29. package/configs/oxlint-site.json +3 -1
  30. package/dist/astro/shiki.d.ts +3 -2
  31. package/dist/astro/shiki.d.ts.map +1 -1
  32. package/dist/cards/bar-list.d.ts.map +1 -1
  33. package/dist/cards/bar-list.js +2 -1
  34. package/dist/cards/chain-view.d.ts +37 -8
  35. package/dist/cards/chain-view.d.ts.map +1 -1
  36. package/dist/cards/chain-view.js +105 -38
  37. package/dist/cards/contract.d.ts +8 -1
  38. package/dist/cards/contract.d.ts.map +1 -1
  39. package/dist/cards/data-panel.d.ts.map +1 -1
  40. package/dist/cards/data-panel.js +1 -0
  41. package/dist/cards/event-list.d.ts.map +1 -1
  42. package/dist/cards/event-list.js +3 -2
  43. package/dist/cards/index.d.ts +1 -1
  44. package/dist/cards/index.d.ts.map +1 -1
  45. package/dist/cards/row-list.d.ts.map +1 -1
  46. package/dist/cards/row-list.js +2 -1
  47. package/dist/cards/stat-card-parts.d.ts +3 -3
  48. package/dist/cards/stat-card-parts.d.ts.map +1 -1
  49. package/dist/cards/stat-card-parts.js +8 -2
  50. package/dist/cards/stat-card.d.ts.map +1 -1
  51. package/dist/cards/stat-card.js +34 -9
  52. package/dist/charts/core/compile.d.ts +2 -0
  53. package/dist/charts/core/compile.d.ts.map +1 -1
  54. package/dist/charts/core/compile.js +16 -8
  55. package/dist/charts/core/cursor.d.ts +2 -1
  56. package/dist/charts/core/cursor.d.ts.map +1 -1
  57. package/dist/charts/core/cursor.js +8 -1
  58. package/dist/charts/core/tooltip-said.d.ts +16 -0
  59. package/dist/charts/core/tooltip-said.d.ts.map +1 -0
  60. package/dist/charts/core/tooltip-said.js +39 -0
  61. package/dist/charts/focus.d.ts.map +1 -1
  62. package/dist/charts/focus.js +1 -1
  63. package/dist/charts/parts/chart-card.d.ts.map +1 -1
  64. package/dist/charts/parts/chart-card.js +1 -0
  65. package/dist/cli/agent-note.d.ts +3 -3
  66. package/dist/cli/agent-note.d.ts.map +1 -1
  67. package/dist/cli/agent-note.js +5 -5
  68. package/dist/cli/budget/index.d.ts +7 -0
  69. package/dist/cli/budget/index.d.ts.map +1 -1
  70. package/dist/cli/budget/index.js +11 -5
  71. package/dist/cli/config.d.ts +1 -1
  72. package/dist/cli/doctor/app.d.ts.map +1 -1
  73. package/dist/cli/doctor/app.js +53 -24
  74. package/dist/cli/doctor/eject.d.ts.map +1 -1
  75. package/dist/cli/doctor/eject.js +16 -9
  76. package/dist/cli/doctor/guards.d.ts.map +1 -1
  77. package/dist/cli/doctor/guards.js +11 -8
  78. package/dist/cli/doctor/hook.js +1 -1
  79. package/dist/cli/doctor/install.d.ts.map +1 -1
  80. package/dist/cli/doctor/install.js +46 -22
  81. package/dist/cli/doctor/translations.d.ts.map +1 -1
  82. package/dist/cli/doctor/translations.js +11 -4
  83. package/dist/cli/doctor/types.d.ts +2 -2
  84. package/dist/cli/doctor/types.d.ts.map +1 -1
  85. package/dist/cli/doctor/types.js +1 -1
  86. package/dist/cli/doctor/wiring.d.ts.map +1 -1
  87. package/dist/cli/doctor/wiring.js +26 -15
  88. package/dist/cli/eject/dropped-slots.d.ts +6 -0
  89. package/dist/cli/eject/dropped-slots.d.ts.map +1 -0
  90. package/dist/cli/eject/dropped-slots.js +9 -0
  91. package/dist/cli/eject/index.d.ts.map +1 -1
  92. package/dist/cli/eject/index.js +9 -8
  93. package/dist/cli/help.d.ts.map +1 -1
  94. package/dist/cli/help.js +7 -2
  95. package/dist/cli/index.d.ts +6 -5
  96. package/dist/cli/index.d.ts.map +1 -1
  97. package/dist/cli/index.js +38 -7
  98. package/dist/cli/init/index.d.ts +10 -0
  99. package/dist/cli/init/index.d.ts.map +1 -1
  100. package/dist/cli/init/index.js +61 -10
  101. package/dist/cli/init/locales.d.ts +7 -0
  102. package/dist/cli/init/locales.d.ts.map +1 -1
  103. package/dist/cli/init/locales.js +21 -6
  104. package/dist/cli/init/router-seeds.d.ts.map +1 -1
  105. package/dist/cli/init/router-seeds.js +16 -3
  106. package/dist/cli/init/steps.d.ts +36 -3
  107. package/dist/cli/init/steps.d.ts.map +1 -1
  108. package/dist/cli/init/steps.js +201 -34
  109. package/dist/cli/lint/baseline.d.ts +27 -0
  110. package/dist/cli/lint/baseline.d.ts.map +1 -0
  111. package/dist/cli/lint/baseline.js +96 -0
  112. package/dist/cli/lint/engine.d.ts +2 -0
  113. package/dist/cli/lint/engine.d.ts.map +1 -1
  114. package/dist/cli/lint/engine.js +18 -8
  115. package/dist/cli/lint/hook.d.ts.map +1 -1
  116. package/dist/cli/lint/hook.js +8 -3
  117. package/dist/cli/lint/index.d.ts +3 -0
  118. package/dist/cli/lint/index.d.ts.map +1 -1
  119. package/dist/cli/lint/index.js +67 -8
  120. package/dist/cli/manifest.d.ts +46 -3
  121. package/dist/cli/manifest.d.ts.map +1 -1
  122. package/dist/cli/manifest.js +71 -1
  123. package/dist/cli/migrate/census.d.ts +6 -0
  124. package/dist/cli/migrate/census.d.ts.map +1 -1
  125. package/dist/cli/migrate/census.js +22 -1
  126. package/dist/cli/migrate/index.d.ts +5 -0
  127. package/dist/cli/migrate/index.d.ts.map +1 -1
  128. package/dist/cli/migrate/index.js +36 -3
  129. package/dist/cli/migrate/lost-classes.d.ts +20 -0
  130. package/dist/cli/migrate/lost-classes.d.ts.map +1 -0
  131. package/dist/cli/migrate/lost-classes.js +145 -0
  132. package/dist/cli/migrate/rows.d.ts +10 -0
  133. package/dist/cli/migrate/rows.d.ts.map +1 -1
  134. package/dist/cli/migrate/rows.js +15 -0
  135. package/dist/cli/package-manager.d.ts.map +1 -1
  136. package/dist/cli/package-manager.js +2 -1
  137. package/dist/cli/peers.d.ts +2 -0
  138. package/dist/cli/peers.d.ts.map +1 -1
  139. package/dist/cli/peers.js +7 -0
  140. package/dist/cli/presets.d.ts.map +1 -1
  141. package/dist/cli/presets.js +27 -11
  142. package/dist/cli/resolver.d.ts +13 -4
  143. package/dist/cli/resolver.d.ts.map +1 -1
  144. package/dist/cli/resolver.js +39 -5
  145. package/dist/cli/router-wiring.d.ts +1 -0
  146. package/dist/cli/router-wiring.d.ts.map +1 -1
  147. package/dist/cli/router-wiring.js +1 -1
  148. package/dist/cli/sync/engine.d.ts +8 -1
  149. package/dist/cli/sync/engine.d.ts.map +1 -1
  150. package/dist/cli/sync/engine.js +25 -14
  151. package/dist/cli/sync/index.d.ts.map +1 -1
  152. package/dist/cli/sync/index.js +7 -4
  153. package/dist/cli/sync/render.d.ts.map +1 -1
  154. package/dist/cli/sync/render.js +21 -28
  155. package/dist/cli/tokens-css.d.ts +2 -0
  156. package/dist/cli/tokens-css.d.ts.map +1 -1
  157. package/dist/cli/tokens-css.js +28 -6
  158. package/dist/controls/contract.d.ts +2 -1
  159. package/dist/controls/contract.d.ts.map +1 -1
  160. package/dist/controls/control-home.d.ts +4 -1
  161. package/dist/controls/control-home.d.ts.map +1 -1
  162. package/dist/controls/control-home.js +5 -3
  163. package/dist/controls/local-control.d.ts +28 -1
  164. package/dist/controls/local-control.d.ts.map +1 -1
  165. package/dist/controls/local-control.js +14 -2
  166. package/dist/core/cn.d.ts.map +1 -1
  167. package/dist/core/cn.js +6 -5
  168. package/dist/core/frame-figure.d.ts +2 -0
  169. package/dist/core/frame-figure.d.ts.map +1 -1
  170. package/dist/core/frame-figure.js +5 -2
  171. package/dist/core/frame-head.d.ts +3 -1
  172. package/dist/core/frame-head.d.ts.map +1 -1
  173. package/dist/core/frame-head.js +28 -7
  174. package/dist/core/frame-regions.d.ts +1 -1
  175. package/dist/core/frame-regions.d.ts.map +1 -1
  176. package/dist/core/frame-regions.js +18 -8
  177. package/dist/core/info-hint.d.ts +5 -0
  178. package/dist/core/info-hint.d.ts.map +1 -1
  179. package/dist/core/info-hint.js +22 -1
  180. package/dist/core/mark-tone.d.ts +6 -2
  181. package/dist/core/mark-tone.d.ts.map +1 -1
  182. package/dist/core/mark-tone.js +1 -1
  183. package/dist/core/mark-types.d.ts +4 -2
  184. package/dist/core/mark-types.d.ts.map +1 -1
  185. package/dist/core/messages/chain.d.ts +2 -1
  186. package/dist/core/messages/chain.d.ts.map +1 -1
  187. package/dist/core/messages/chain.js +1 -0
  188. package/dist/core/messages/index.d.ts +2 -1
  189. package/dist/core/messages/index.d.ts.map +1 -1
  190. package/dist/core/messages/index.js +2 -0
  191. package/dist/core/messages/runs.d.ts +20 -0
  192. package/dist/core/messages/runs.d.ts.map +1 -0
  193. package/dist/core/messages/runs.js +18 -0
  194. package/dist/core/phase.d.ts +25 -2
  195. package/dist/core/phase.d.ts.map +1 -1
  196. package/dist/core/ports.d.ts +4 -1
  197. package/dist/core/ports.d.ts.map +1 -1
  198. package/dist/core/provider.d.ts +3 -1
  199. package/dist/core/provider.d.ts.map +1 -1
  200. package/dist/core/provider.js +5 -3
  201. package/dist/core/scheme.d.ts +2 -1
  202. package/dist/core/scheme.d.ts.map +1 -1
  203. package/dist/core/scheme.js +1 -0
  204. package/dist/core/spark/mini-bars.d.ts +6 -4
  205. package/dist/core/spark/mini-bars.d.ts.map +1 -1
  206. package/dist/core/spark/mini-bars.js +36 -11
  207. package/dist/core/spark/sparkline.d.ts +2 -2
  208. package/dist/core/spark/sparkline.d.ts.map +1 -1
  209. package/dist/core/spark/sparkline.js +21 -2
  210. package/dist/css/bridge.css +63 -0
  211. package/dist/css/generate.d.ts +2 -2
  212. package/dist/css/generate.d.ts.map +1 -1
  213. package/dist/css/generate.js +25 -0
  214. package/dist/data/live/live-query.d.ts +2 -2
  215. package/dist/data/live/live-query.d.ts.map +1 -1
  216. package/dist/data/live/live-query.js +2 -1
  217. package/dist/lint/preset.d.ts +12 -3
  218. package/dist/lint/preset.d.ts.map +1 -1
  219. package/dist/lint/preset.js +30 -10
  220. package/dist/lint/rules/class/table.d.ts.map +1 -1
  221. package/dist/lint/rules/class/table.js +3 -1
  222. package/dist/lint/rules/structure/control-home.js +1 -1
  223. package/dist/lint/rules/structure/import-boundary.d.ts.map +1 -1
  224. package/dist/lint/rules/structure/import-boundary.js +2 -0
  225. package/dist/lint/rules/structure/label-literal.d.ts.map +1 -1
  226. package/dist/lint/rules/structure/label-literal.js +1 -1
  227. package/dist/lint/shadcn.d.ts +562 -0
  228. package/dist/lint/shadcn.d.ts.map +1 -0
  229. package/dist/lint/shadcn.js +52 -0
  230. package/dist/lint/stylelint/render.d.ts +3 -1
  231. package/dist/lint/stylelint/render.d.ts.map +1 -1
  232. package/dist/lint/stylelint/render.js +23 -2
  233. package/dist/lint/stylelint/rules.d.ts +3 -2
  234. package/dist/lint/stylelint/rules.d.ts.map +1 -1
  235. package/dist/lint/stylelint/rules.js +11 -6
  236. package/dist/lint/weakened.d.ts +8 -0
  237. package/dist/lint/weakened.d.ts.map +1 -1
  238. package/dist/lint/weakened.js +44 -1
  239. package/dist/messages/de.d.ts.map +1 -1
  240. package/dist/messages/de.js +15 -0
  241. package/dist/messages/es.d.ts.map +1 -1
  242. package/dist/messages/es.js +15 -0
  243. package/dist/messages/fr.d.ts.map +1 -1
  244. package/dist/messages/fr.js +15 -0
  245. package/dist/messages/zh-hans.d.ts.map +1 -1
  246. package/dist/messages/zh-hans.js +15 -0
  247. package/dist/page/bar-title.d.ts +25 -0
  248. package/dist/page/bar-title.d.ts.map +1 -0
  249. package/dist/page/bar-title.js +10 -0
  250. package/dist/page/contract.d.ts +11 -1
  251. package/dist/page/contract.d.ts.map +1 -1
  252. package/dist/page/empty-state.d.ts +5 -2
  253. package/dist/page/empty-state.d.ts.map +1 -1
  254. package/dist/page/empty-state.js +14 -3
  255. package/dist/page/facts.d.ts +19 -2
  256. package/dist/page/facts.d.ts.map +1 -1
  257. package/dist/page/facts.js +26 -5
  258. package/dist/page/index.d.ts +8 -0
  259. package/dist/page/index.d.ts.map +1 -1
  260. package/dist/page/index.js +9 -0
  261. package/dist/page/page-bar.d.ts.map +1 -1
  262. package/dist/page/page-bar.js +2 -7
  263. package/dist/page/page-summary.d.ts +2 -1
  264. package/dist/page/page-summary.d.ts.map +1 -1
  265. package/dist/page/page-summary.js +1 -1
  266. package/dist/page/run-button.d.ts +26 -0
  267. package/dist/page/run-button.d.ts.map +1 -0
  268. package/dist/page/run-button.js +31 -0
  269. package/dist/page/run-list.d.ts +28 -0
  270. package/dist/page/run-list.d.ts.map +1 -0
  271. package/dist/page/run-list.js +88 -0
  272. package/dist/page/run-queue.d.ts +78 -0
  273. package/dist/page/run-queue.d.ts.map +1 -0
  274. package/dist/page/run-queue.js +93 -0
  275. package/dist/page/section.d.ts +6 -1
  276. package/dist/page/section.d.ts.map +1 -1
  277. package/dist/page/section.js +34 -16
  278. package/dist/shell/commands/command-palette.d.ts.map +1 -1
  279. package/dist/shell/commands/command-palette.js +5 -1
  280. package/dist/shell/parts/header.js +1 -1
  281. package/dist/surfaces.d.ts +15 -1
  282. package/dist/surfaces.d.ts.map +1 -1
  283. package/dist/surfaces.js +19 -2
  284. package/dist/testing/index.d.ts +1 -0
  285. package/dist/testing/index.d.ts.map +1 -1
  286. package/dist/testing/index.js +3 -0
  287. package/dist/testing/pseudo-locale.d.ts +41 -0
  288. package/dist/testing/pseudo-locale.d.ts.map +1 -0
  289. package/dist/testing/pseudo-locale.js +74 -0
  290. package/dist/testing/quality.d.ts +6 -0
  291. package/dist/testing/quality.d.ts.map +1 -1
  292. package/dist/testing/quality.js +139 -1
  293. package/dist/tokens/bridge-sheet.d.ts +21 -0
  294. package/dist/tokens/bridge-sheet.d.ts.map +1 -0
  295. package/dist/tokens/bridge-sheet.js +68 -0
  296. package/dist/tokens/emit.d.ts +6 -1
  297. package/dist/tokens/emit.d.ts.map +1 -1
  298. package/dist/tokens/emit.js +26 -1
  299. package/dist/ui/accordion.js +1 -1
  300. package/dist/ui/card.d.ts +32 -4
  301. package/dist/ui/card.d.ts.map +1 -1
  302. package/dist/ui/card.js +26 -3
  303. package/dist/ui/collapsible.d.ts +4 -2
  304. package/dist/ui/collapsible.d.ts.map +1 -1
  305. package/dist/ui/collapsible.js +1 -1
  306. package/dist/ui/combobox.js +1 -1
  307. package/dist/ui/meter.d.ts +34 -3
  308. package/dist/ui/meter.d.ts.map +1 -1
  309. package/dist/ui/meter.guard.d.ts +2 -0
  310. package/dist/ui/meter.guard.d.ts.map +1 -1
  311. package/dist/ui/meter.guard.js +20 -0
  312. package/dist/ui/meter.js +23 -7
  313. package/dist/ui/primitive.contract.d.ts.map +1 -1
  314. package/dist/ui/primitive.contract.js +7 -0
  315. package/dist/ui/remote-pad.d.ts +62 -0
  316. package/dist/ui/remote-pad.d.ts.map +1 -0
  317. package/dist/ui/remote-pad.guard.d.ts +21 -0
  318. package/dist/ui/remote-pad.guard.d.ts.map +1 -0
  319. package/dist/ui/remote-pad.guard.js +6 -0
  320. package/dist/ui/remote-pad.js +148 -0
  321. package/dist/ui/segmented.d.ts.map +1 -1
  322. package/dist/ui/segmented.js +4 -0
  323. package/dist/ui/skeleton.d.ts +9 -4
  324. package/dist/ui/skeleton.d.ts.map +1 -1
  325. package/dist/ui/skeleton.guard.d.ts +6 -2
  326. package/dist/ui/skeleton.guard.d.ts.map +1 -1
  327. package/dist/ui/skeleton.guard.js +4 -0
  328. package/dist/ui/skeleton.js +2 -1
  329. package/dist/ui/slots.d.ts +2 -1
  330. package/dist/ui/slots.d.ts.map +1 -1
  331. package/dist/ui/slots.js +2 -1
  332. package/dist/vite/allotment.d.ts +1 -1
  333. package/dist/vite/allotment.d.ts.map +1 -1
  334. package/dist/vite/allotment.js +15 -1
  335. package/dist/vite/doc.d.ts +1 -1
  336. package/dist/vite/doc.d.ts.map +1 -1
  337. package/dist/vite/doc.js +12 -2
  338. package/dist/vite/head.d.ts +4 -3
  339. package/dist/vite/head.d.ts.map +1 -1
  340. package/dist/vite/index.d.ts.map +1 -1
  341. package/dist/vite/index.js +4 -1
  342. package/dist/vite/shell-worker.d.ts +6 -0
  343. package/dist/vite/shell-worker.d.ts.map +1 -0
  344. package/dist/vite/shell-worker.js +92 -0
  345. package/docs/astro.md +19 -4
  346. package/docs/bar-list.md +3 -2
  347. package/docs/bar-title.md +33 -0
  348. package/docs/basalt-provider.md +2 -1
  349. package/docs/card.md +24 -4
  350. package/docs/chain-view.md +12 -7
  351. package/docs/chart-card.md +3 -2
  352. package/docs/collapsible.md +4 -2
  353. package/docs/control-home.md +4 -2
  354. package/docs/create-run-queue.md +40 -0
  355. package/docs/data-panel.md +3 -2
  356. package/docs/de.md +1 -1
  357. package/docs/empty-state.md +3 -1
  358. package/docs/es.md +1 -1
  359. package/docs/event-list.md +3 -2
  360. package/docs/fact.md +6 -1
  361. package/docs/facts.md +5 -1
  362. package/docs/fr.md +1 -1
  363. package/docs/live-query.md +1 -1
  364. package/docs/meter.md +17 -13
  365. package/docs/mini-bars.md +7 -5
  366. package/docs/pseudo-basalt-messages.md +30 -0
  367. package/docs/pseudo-messages.md +27 -0
  368. package/docs/quality.md +2 -1
  369. package/docs/recipes/localise-app.md +2 -2
  370. package/docs/remote-pad.md +40 -0
  371. package/docs/row-list.md +3 -2
  372. package/docs/run-button.md +45 -0
  373. package/docs/run-list.md +71 -0
  374. package/docs/section.md +7 -1
  375. package/docs/set-scheme.md +2 -2
  376. package/docs/skeleton.md +4 -3
  377. package/docs/slots.md +1 -1
  378. package/docs/sparkline.md +5 -2
  379. package/docs/stat-card.md +6 -4
  380. package/docs/testing.md +64 -0
  381. package/docs/use-local-control.md +8 -1
  382. package/docs/use-runs.md +32 -0
  383. package/docs/vite.md +12 -2
  384. package/docs/zh-hans.md +1 -1
  385. package/llms.txt +88 -21
  386. package/migrations/areas/shadcn.json +338 -0
  387. package/package.json +9 -2
  388. package/src/astro/shiki.ts +3 -1
  389. package/src/cards/bar-list.tsx +2 -1
  390. package/src/cards/chain-view.tsx +167 -55
  391. package/src/cards/contract.ts +8 -1
  392. package/src/cards/data-panel.tsx +1 -0
  393. package/src/cards/event-list.tsx +2 -1
  394. package/src/cards/index.ts +1 -0
  395. package/src/cards/row-list.tsx +2 -1
  396. package/src/cards/stat-card-parts.tsx +9 -7
  397. package/src/cards/stat-card.tsx +39 -12
  398. package/src/charts/core/compile.ts +31 -19
  399. package/src/charts/core/cursor.ts +11 -3
  400. package/src/charts/core/tooltip-said.ts +55 -0
  401. package/src/charts/focus.tsx +4 -1
  402. package/src/charts/parts/chart-card.tsx +1 -0
  403. package/src/cli/agent-note.ts +12 -5
  404. package/src/cli/budget/index.ts +22 -5
  405. package/src/cli/config.ts +1 -1
  406. package/src/cli/doctor/app.ts +75 -23
  407. package/src/cli/doctor/eject.ts +30 -10
  408. package/src/cli/doctor/guards.ts +11 -8
  409. package/src/cli/doctor/hook.ts +1 -1
  410. package/src/cli/doctor/install.ts +61 -24
  411. package/src/cli/doctor/translations.ts +13 -4
  412. package/src/cli/doctor/types.ts +2 -3
  413. package/src/cli/doctor/wiring.ts +30 -16
  414. package/src/cli/eject/dropped-slots.ts +11 -0
  415. package/src/cli/eject/index.ts +13 -9
  416. package/src/cli/help.ts +34 -10
  417. package/src/cli/index.ts +56 -14
  418. package/src/cli/init/index.ts +64 -5
  419. package/src/cli/init/locales.ts +41 -8
  420. package/src/cli/init/router-seeds.ts +17 -3
  421. package/src/cli/init/steps.ts +308 -41
  422. package/src/cli/lint/baseline.ts +141 -0
  423. package/src/cli/lint/engine.ts +33 -10
  424. package/src/cli/lint/hook.ts +11 -3
  425. package/src/cli/lint/index.ts +77 -12
  426. package/src/cli/manifest.ts +132 -4
  427. package/src/cli/migrate/census.ts +35 -1
  428. package/src/cli/migrate/index.ts +46 -3
  429. package/src/cli/migrate/lost-classes.ts +203 -0
  430. package/src/cli/migrate/rows.ts +21 -0
  431. package/src/cli/package-manager.ts +4 -1
  432. package/src/cli/peers.ts +11 -0
  433. package/src/cli/presets.ts +32 -11
  434. package/src/cli/resolver.ts +58 -10
  435. package/src/cli/router-wiring.ts +3 -1
  436. package/src/cli/sync/engine.ts +30 -14
  437. package/src/cli/sync/index.ts +7 -4
  438. package/src/cli/sync/render.ts +29 -37
  439. package/src/cli/tokens-css.ts +42 -5
  440. package/src/controls/contract.ts +2 -0
  441. package/src/controls/control-home.tsx +15 -4
  442. package/src/controls/local-control.ts +49 -3
  443. package/src/core/cn.ts +9 -5
  444. package/src/core/frame-figure.tsx +7 -1
  445. package/src/core/frame-head.tsx +32 -6
  446. package/src/core/frame-regions.tsx +18 -8
  447. package/src/core/info-hint.tsx +26 -0
  448. package/src/core/mark-tone.ts +10 -3
  449. package/src/core/mark-types.ts +4 -2
  450. package/src/core/messages/chain.ts +2 -1
  451. package/src/core/messages/index.ts +4 -0
  452. package/src/core/messages/runs.ts +40 -0
  453. package/src/core/phase.ts +22 -2
  454. package/src/core/ports.ts +13 -1
  455. package/src/core/provider.tsx +7 -3
  456. package/src/core/scheme.ts +6 -2
  457. package/src/core/spark/mini-bars.tsx +59 -15
  458. package/src/core/spark/sparkline.tsx +26 -4
  459. package/src/css/bridge.css +63 -0
  460. package/src/css/generate.ts +40 -3
  461. package/src/data/live/live-query.ts +4 -3
  462. package/src/lint/preset.ts +52 -13
  463. package/src/lint/rules/class/table.ts +3 -1
  464. package/src/lint/rules/structure/control-home.ts +1 -1
  465. package/src/lint/rules/structure/import-boundary.ts +2 -0
  466. package/src/lint/rules/structure/label-literal.ts +3 -1
  467. package/src/lint/shadcn.ts +91 -0
  468. package/src/lint/stylelint/render.ts +31 -1
  469. package/src/lint/stylelint/rules.ts +19 -7
  470. package/src/lint/weakened.ts +59 -1
  471. package/src/messages/de.ts +20 -0
  472. package/src/messages/es.ts +20 -0
  473. package/src/messages/fr.ts +20 -0
  474. package/src/messages/zh-hans.ts +20 -0
  475. package/src/page/bar-title.tsx +35 -0
  476. package/src/page/contract.ts +11 -1
  477. package/src/page/empty-state.tsx +18 -8
  478. package/src/page/facts.tsx +43 -5
  479. package/src/page/index.ts +8 -0
  480. package/src/page/page-bar.tsx +2 -9
  481. package/src/page/page-summary.tsx +4 -3
  482. package/src/page/run-button.tsx +52 -0
  483. package/src/page/run-list.tsx +151 -0
  484. package/src/page/run-queue.ts +185 -0
  485. package/src/page/section.tsx +30 -5
  486. package/src/shell/commands/command-palette.tsx +10 -1
  487. package/src/shell/parts/header.tsx +1 -1
  488. package/src/surfaces.ts +18 -1
  489. package/src/testing/index.ts +1 -0
  490. package/src/testing/pseudo-locale.ts +149 -0
  491. package/src/testing/quality.ts +188 -0
  492. package/src/tokens/bridge-sheet.ts +80 -0
  493. package/src/tokens/emit.ts +45 -6
  494. package/src/ui/accordion.tsx +1 -1
  495. package/src/ui/card.tsx +56 -6
  496. package/src/ui/collapsible.tsx +5 -3
  497. package/src/ui/combobox.tsx +1 -1
  498. package/src/ui/meter.guard.ts +23 -0
  499. package/src/ui/meter.tsx +76 -27
  500. package/src/ui/no-restyle.generated.json +8 -0
  501. package/src/ui/primitive.contract.ts +7 -0
  502. package/src/ui/remote-pad.guard.ts +24 -0
  503. package/src/ui/remote-pad.tsx +249 -0
  504. package/src/ui/segmented.tsx +6 -0
  505. package/src/ui/skeleton.guard.ts +7 -2
  506. package/src/ui/skeleton.tsx +10 -4
  507. package/src/ui/slots.ts +2 -1
  508. package/src/vite/allotment.ts +15 -1
  509. package/src/vite/doc.ts +12 -2
  510. package/src/vite/head.ts +4 -3
  511. package/src/vite/index.ts +4 -1
  512. package/src/vite/shell-worker.ts +115 -0
@@ -9,7 +9,7 @@ import type { WeakenedResult } from '../../lint/weakened'
9
9
  import { readBudget } from '../budget'
10
10
  import { staleRecord } from '../lint/record'
11
11
  import { readFrameworkVersion } from '../index'
12
- import { MANIFEST_PATH } from '../manifest'
12
+ import { MANIFEST_PATH, designPath } from '../manifest'
13
13
  import { renderTokens } from '../tokens-css'
14
14
  import { ejectFindings } from './eject'
15
15
  import { OXLINT_PRESET } from './wiring'
@@ -47,30 +47,33 @@ const DESIGN_MAX_LINES = 150
47
47
 
48
48
  function designFindings(ctx: Ctx): string[] {
49
49
  const manifest = need(ctx)
50
- const text = readText(ctx.root, 'DESIGN.md')
50
+ const design = designPath(manifest)
51
+ const text = readText(ctx.root, design)
51
52
  if (text === null) {
52
53
  return manifest.profile === 'tokens' &&
53
54
  Object.values(manifest.roots).every((p) => p === 'tokens')
54
55
  ? []
55
- : ['DESIGN.md is missing: `basalt-ui init` seeds it']
56
+ : [
57
+ `${design} is missing: \`basalt-ui init\` seeds it (\`design\` in ${MANIFEST_PATH} says where it lives)`,
58
+ ]
56
59
  }
57
60
  const findings: string[] = []
58
61
  const lines = text.replace(/\n$/, '').split('\n')
59
62
  if (lines.length > DESIGN_MAX_LINES)
60
- findings.push(`DESIGN.md has ${lines.length} lines (max ${DESIGN_MAX_LINES})`)
63
+ findings.push(`${design} has ${lines.length} lines (max ${DESIGN_MAX_LINES})`)
61
64
  if (HEX_LITERAL.test(text))
62
65
  findings.push(
63
- 'DESIGN.md holds a hex literal: the palette is derived, name no value (basalt-app setup: DESIGN.md)',
66
+ `${design} holds a hex literal: the palette is derived, name no value (basalt-app setup: DESIGN.md)`,
64
67
  )
65
68
  if (/mantine/i.test(text))
66
- findings.push('DESIGN.md mentions Mantine (basalt-app setup: DESIGN.md)')
69
+ findings.push(`${design} mentions Mantine (basalt-app setup: DESIGN.md)`)
67
70
  const at = lines.findIndex((l) => /^##\s+Deviations\b/.test(l))
68
71
  if (at !== -1) {
69
72
  const section = lines.slice(at + 1)
70
73
  const end = section.findIndex((l) => /^##\s/.test(l))
71
74
  for (const line of end === -1 ? section : section.slice(0, end)) {
72
75
  if (/^\s*[-*]\s/.test(line) && !/none yet/i.test(line) && !REASONED.test(line)) {
73
- findings.push(`DESIGN.md deviation without a reason: "${line.trim().slice(0, 60)}"`)
76
+ findings.push(`${design} deviation without a reason: "${line.trim().slice(0, 60)}"`)
74
77
  }
75
78
  }
76
79
  }
@@ -128,7 +131,7 @@ const check11 = (name: string): Check => ({
128
131
  // A check that cannot run is not a pass: the whole check is SKIPPED, and SKIPPED fails.
129
132
  if (weak.skipped.length > 0) return { status: 'skipped', detail: weak.skipped.join('; ') }
130
133
  return pass(
131
- 'the eject ceiling holds, the record is current, ejects are intact, no guard is weakened, DESIGN.md is within bounds',
134
+ 'the eject ceiling holds, the record is current, ejects are intact, no guard is weakened, the design record is within bounds',
132
135
  )
133
136
  },
134
137
  })
@@ -366,7 +366,7 @@ const check9 = (name: string): Check => ({
366
366
  }
367
367
  }
368
368
  return verdictOf(
369
- findings.map((f) => `${f}: add it to ignorePatterns in .oxfmtrc.json (or .prettierignore)`),
369
+ findings.map((f) => `${f}: add it to ignorePatterns in the oxfmt config or .prettierignore`),
370
370
  'oxfmt skips .basalt/, the presets and the managed agent paths',
371
371
  )
372
372
  },
@@ -3,15 +3,16 @@
3
3
  * the installed version against the declared one, and the peers the profile needs.
4
4
  */
5
5
  import { existsSync } from 'node:fs'
6
- import { dirname, resolve } from 'node:path'
6
+ import { dirname, relative, resolve } from 'node:path'
7
7
 
8
8
  import { readBudget } from '../budget'
9
9
  import { findBasaltInstall } from '../index'
10
10
  import { ASTRO_PARTS } from '../../astro/parts'
11
11
  import { defaultBaseRef, rootFindings } from '../../lint/weakened'
12
- import type { Profile } from '../manifest'
12
+ import type { Manifest, Profile } from '../manifest'
13
13
  import { installAllCommand } from '../package-manager'
14
14
  import { BUILD_PEERS, peerAddLine, RUNTIME_PEERS, satisfiesRange } from '../peers'
15
+ import { peerHome, unplacedPeers } from '../resolver'
15
16
  import { importedPackageNames } from '../source-text'
16
17
  import {
17
18
  compareVersions,
@@ -76,8 +77,9 @@ const check1 = (name: string): Check => ({
76
77
  }
77
78
 
78
79
  const budget = readBudget(ctx.root)
79
- const floor = 'budget' in budget ? budget.budget.profileFloor : null
80
80
  for (const [root, profile] of rootsOf(manifest)) {
81
+ const floor =
82
+ 'budget' in budget ? (budget.budget.rootFloors?.[root] ?? budget.budget.profileFloor) : null
81
83
  if (floor !== null && PROFILE_RANK[profile] < PROFILE_RANK[floor]) {
82
84
  findings.push(`${root} declares ${profile}, below the profileFloor ${floor}`)
83
85
  }
@@ -133,9 +135,9 @@ const DEP_FIELDS = ['dependencies', 'devDependencies', 'peerDependencies'] as co
133
135
 
134
136
  type Declared = { dir: string; deps: Record<string, string> }
135
137
 
136
- /** The `package.json` at the install root and at the package of every declared root. */
137
- function declaredDeps(root: string, roots: readonly string[]): Declared[] {
138
- const dirs = new Set<string>([root])
138
+ /** The `package.json` at the install root, at the peers' home and at every declared root's package. */
139
+ function declaredDeps(root: string, roots: readonly string[], home: string): Declared[] {
140
+ const dirs = new Set<string>([root, home])
139
141
  for (const rel of roots) {
140
142
  for (let dir = resolve(root, rel); dir.startsWith(root) && dir !== root; dir = dirname(dir)) {
141
143
  if (existsSync(resolve(dir, 'package.json'))) {
@@ -213,7 +215,12 @@ function aiParity(packages: readonly Declared[]): string[] {
213
215
  }
214
216
 
215
217
  /** Shipped dependencies that are no engine: a second copy of one costs bytes and breaks nothing. */
216
- const STATELESS_HELPERS = new Set(['class-variance-authority', 'clsx', 'eventsource-parser'])
218
+ const STATELESS_HELPERS = new Set([
219
+ 'class-variance-authority',
220
+ 'clsx',
221
+ 'eventsource-parser',
222
+ 'yaml',
223
+ ])
217
224
 
218
225
  const ENGINE_SOURCES = /\.(?:[cm]?[jt]sx?|astro|mdx|css)$/
219
226
 
@@ -234,7 +241,7 @@ function importedPackages(root: string): Set<string> {
234
241
  function engineLines(
235
242
  ctx: Ctx,
236
243
  packages: readonly Declared[],
237
- add: (engine: string, range: string) => string,
244
+ add: (engine: string, range: string, dir: string) => string,
238
245
  ): { findings: string[]; removable: string[] } {
239
246
  const engines = (readJson(ctx.pkgRoot, 'package.json')?.['dependencies'] ?? {}) as Record<
240
247
  string,
@@ -254,41 +261,71 @@ function engineLines(
254
261
  }
255
262
  const owner = packages.find((p) => name in p.deps)
256
263
  const installed = owner === undefined ? null : installedVersion(owner.dir, name)
257
- if (installed !== null && !satisfiesRange(installed, range)) {
264
+ if (owner !== undefined && installed !== null && !satisfiesRange(installed, range)) {
258
265
  findings.push(
259
- `${name} ${installed} is installed but basalt-ui ships ${range}, so there are two copies: run ${add(name, range)}`,
266
+ `${name} ${installed} is installed but basalt-ui ships ${range}, so there are two copies: run ${add(name, range, owner.dir)}`,
260
267
  )
261
268
  }
262
269
  }
263
270
  return { findings, removable }
264
271
  }
265
272
 
273
+ const neededBy = (
274
+ profiles: readonly Exclude<Profile, 'tokens'>[],
275
+ peer: string,
276
+ fallback: Profile,
277
+ ): Profile =>
278
+ profiles.find((p) => RUNTIME_PEERS[p].includes(peer) || BUILD_PEERS[p].includes(peer)) ?? fallback
279
+
280
+ /** A site's gate runs `astro check`, which needs the compiler API TypeScript 7 lacks. */
281
+ function siteTypescript(ctx: Ctx, manifest: Manifest): string[] {
282
+ const sites = rootsOf(manifest).filter(([, profile]) => profile === 'site')
283
+ return sites.flatMap(([root]) => {
284
+ const version = installedVersion(resolve(ctx.root, root), 'typescript')
285
+ return version !== null && (majorOf(version) ?? 0) > 6
286
+ ? [
287
+ `typescript ${version} resolves for the site root ${root}, and \`astro check\` needs 5 or 6: ` +
288
+ `declare typescript 6 in that site's package.json`,
289
+ ]
290
+ : []
291
+ })
292
+ }
293
+
266
294
  const check3 = (name: string): Check => ({
267
295
  id: 3,
268
296
  name,
269
297
  run: (ctx) => {
270
298
  const manifest = need(ctx)
271
- const packages = declaredDeps(
272
- ctx.root,
273
- rootsOf(manifest).map(([r]) => r),
274
- )
299
+ const roots = rootsOf(manifest).map(([r]) => r)
300
+ const home = peerHome(ctx.root, roots)
301
+ const packages = declaredDeps(ctx.root, roots, home)
275
302
  const findings: string[] = []
276
- const add = (peer: string, range: string | undefined): string =>
277
- peerAddLine(
278
- ctx.root,
303
+ // A mixed install needs the peers of every profile it declares.
304
+ const profiles = [
305
+ ...new Set([manifest.profile, ...rootsOf(manifest).map(([, p]) => p)]),
306
+ ].filter((p) => p !== 'tokens')
307
+ // The line names the package it runs in: a declared peer's own, a missing one's `init` home.
308
+ const add = (peer: string, range: string | undefined, declaredIn?: string): string => {
309
+ const dir = declaredIn ?? home
310
+ const line = peerAddLine(
311
+ dir,
279
312
  [[peer, range]],
280
- manifest.profile !== 'tokens' && BUILD_PEERS[manifest.profile].includes(peer),
313
+ profiles.some((p) => BUILD_PEERS[p].includes(peer)),
281
314
  )
315
+ const unplaced = declaredIn === undefined ? unplacedPeers(ctx.root, home) : null
316
+ if (unplaced !== null) return `in the app package: ${line.replace(' -w ', ' ')} (${unplaced})`
317
+ const at = relative(ctx.root, dir)
318
+ return at === '' ? line : `in ${at}: ${line}`
319
+ }
282
320
 
283
- if (manifest.profile !== 'tokens') {
321
+ if (profiles.length > 0) {
284
322
  const ranges = readJson(ctx.pkgRoot, 'package.json')?.['peerDependencies'] as
285
323
  | Record<string, string>
286
324
  | undefined
287
325
  const required = [
288
326
  ...new Set([
289
327
  ...REACT_PEERS,
290
- ...RUNTIME_PEERS[manifest.profile],
291
- ...BUILD_PEERS[manifest.profile],
328
+ ...profiles.flatMap((p) => [...RUNTIME_PEERS[p], ...BUILD_PEERS[p]]),
292
329
  ]),
293
330
  ]
294
331
  // The profile's peers must be declared; any other peer the app declares (an optional one
@@ -301,7 +338,7 @@ const check3 = (name: string): Check => ({
301
338
  const range = ranges?.[peer]
302
339
  if (declared === undefined) {
303
340
  findings.push(
304
- `${peer} is not declared (needed by profile ${manifest.profile}): run ${add(peer, range)}`,
341
+ `${peer} is not declared (needed by profile ${neededBy(profiles, peer, manifest.profile)}): run ${add(peer, range)}`,
305
342
  )
306
343
  continue
307
344
  }
@@ -315,14 +352,14 @@ const check3 = (name: string): Check => ({
315
352
  }
316
353
  } else if (range !== undefined && !satisfiesRange(installed, range)) {
317
354
  findings.push(
318
- `${peer} ${installed} is installed but basalt-ui declares ${range}: run ${add(peer, range)}`,
355
+ `${peer} ${installed} is installed but basalt-ui declares ${range}: run ${add(peer, range, declared.dir)}`,
319
356
  )
320
357
  }
321
358
  }
322
359
  }
323
360
 
324
361
  const engines = engineLines(ctx, packages, add)
325
- findings.push(...engines.findings, ...aiParity(packages))
362
+ findings.push(...siteTypescript(ctx, manifest), ...engines.findings, ...aiParity(packages))
326
363
  const outcome = verdictOf(
327
364
  findings,
328
365
  `peers for profile ${manifest.profile} resolve; ai majors agree`,
@@ -3,7 +3,8 @@
3
3
  * without binding a catalogue library:
4
4
  *
5
5
  * - every language has each catalogue the others have, and no message in it is absent or empty
6
- * (`.po` and flat or Lingui-minimal `.json`; the paths are the manifest's `catalogs`);
6
+ * (`.po` and flat or Lingui-minimal `.json`; the paths are the manifest's `catalogs`). A language
7
+ * of the manifest's `partialLocales` needs its catalogues but may miss messages in them;
7
8
  * - the app's `check` script runs the catalogue tool's extract and then its strict compile
8
9
  * (`lingui extract --clean && lingui compile --strict`): the extract puts a new or changed message
9
10
  * into every catalogue empty, and the compile fails the gate on it before `doctor` runs;
@@ -142,6 +143,7 @@ function catalogFindings(
142
143
  ctx: Ctx,
143
144
  patterns: readonly string[],
144
145
  locales: readonly string[],
146
+ partial: ReadonlySet<string>,
145
147
  ): string[] {
146
148
  const findings: string[] = []
147
149
  for (const pattern of patterns) {
@@ -178,7 +180,8 @@ function catalogFindings(
178
180
  if (read.length > 0 && ids.length === 0) {
179
181
  findings.push(`${read.map((c) => c.file).join(', ')}: no message at all ${STEP}`)
180
182
  }
181
- for (const { file, messages } of read) {
183
+ for (const { locale, file, messages } of read) {
184
+ if (partial.has(locale)) continue
182
185
  const missing = ids.filter((id) => messages.get(id) !== true)
183
186
  if (missing.length > 0) {
184
187
  findings.push(
@@ -299,12 +302,18 @@ export const translationChecks: Check[] = [
299
302
  if (!isTranslated(manifest)) {
300
303
  return pass('fewer than two `locales` declared: no catalogue to hold')
301
304
  }
305
+ const partial = new Set(manifest.partialLocales)
302
306
  const findings = [
303
- ...catalogFindings(ctx, manifest.catalogs ?? DEFAULT_CATALOGS, locales),
307
+ ...catalogFindings(ctx, manifest.catalogs ?? DEFAULT_CATALOGS, locales, partial),
304
308
  ...gateFindings(gateScripts(ctx)),
305
309
  ...providerFindings(ctx, manifest),
306
310
  ]
307
- return verdictOf(findings, `${locales.join(', ')}: every catalogue complete and wired`)
311
+ const complete = locales.filter((locale) => !partial.has(locale))
312
+ const rest = partial.size === 0 ? '' : `; ${[...partial].join(', ')} may be partial`
313
+ return verdictOf(
314
+ findings,
315
+ `${complete.join(', ')}: every catalogue complete and wired${rest}`,
316
+ )
308
317
  },
309
318
  },
310
319
  ]
@@ -7,6 +7,7 @@ import { readdirSync, readFileSync } from 'node:fs'
7
7
  import type { Dirent } from 'node:fs'
8
8
  import { resolve } from 'node:path'
9
9
 
10
+ import { cleanRoot } from '../manifest'
10
11
  import type { Manifest, Profile } from '../manifest'
11
12
  import type { RunLint } from '../../lint/weakened'
12
13
 
@@ -63,9 +64,7 @@ export const PROFILE_RANK: Readonly<Record<Profile, number>> = {
63
64
  app: 4,
64
65
  }
65
66
 
66
- /** A declared root as a clean relative path (`./src/` -> `src`, the root itself -> `.`). */
67
- export const cleanRoot = (raw: string): string =>
68
- raw.replace(/^(?:\.\/)+/, '').replace(/\/+$/, '') || '.'
67
+ export { cleanRoot }
69
68
 
70
69
  /** Declared roots with their profile, `src` at the manifest profile when none are declared. */
71
70
  export function rootsOf(manifest: Manifest): [string, Profile][] {
@@ -10,7 +10,8 @@ import { lintSettingsUnits } from '../lint-settings'
10
10
  import { renderStylelintPreset } from '../presets'
11
11
  import { readFrameworkVersion, resolveAppDir } from '../index'
12
12
  import { scanBlock } from '../sync/block'
13
- import { AGENTS_FILE, differences, planSync } from '../sync/engine'
13
+ import { AGENTS_FILE, differences, planSync, shadowNote } from '../sync/engine'
14
+ import { agentsPath } from '../manifest'
14
15
  import { siblingOf, siblingName, unitPath } from '../sync/sibling'
15
16
  import { harnessesOf } from '../harness'
16
17
  import { placesBlock, renderBlock, renderManaged } from '../sync/render'
@@ -55,8 +56,11 @@ const check4 = (name: string): Check => ({
55
56
  sibling?.repoRoot,
56
57
  )
57
58
  if ('error' in plan.block) return fail(plan.block.error)
58
- const findings = differences(plan).map(
59
- (line) => `${line} (\`basalt-ui init\` places it, \`sync\` refreshes it)`,
59
+ const shadows = new Set(
60
+ plan.items.filter((i) => i.shadows).map((i) => `${i.path}: ${shadowNote(i.path)}`),
61
+ )
62
+ const findings = differences(plan).map((line) =>
63
+ shadows.has(line) ? line : `${line} (\`basalt-ui init\` places it, \`sync\` refreshes it)`,
60
64
  )
61
65
 
62
66
  if (lintRoots(manifest).length > 0) {
@@ -167,22 +171,31 @@ const check6 = (name: string): Check => ({
167
171
  const manifest = need(ctx)
168
172
  if (!placesBlock(manifest)) return pass('no block: `harnesses` is empty (`basalt-ui remove`)')
169
173
  const findings: string[] = []
170
- const agents = readText(ctx.root, AGENTS_FILE)
171
- if (agents === null) findings.push(`${AGENTS_FILE} is missing: run \`basalt-ui sync\``)
174
+ const file = agentsPath(manifest)
175
+ const agents = readText(ctx.root, file)
176
+ if (agents === null) findings.push(`${file} is missing: run \`basalt-ui sync\``)
172
177
  else {
173
- const scan = scanBlock(agents, AGENTS_FILE)
174
- if (scan === 'absent')
175
- findings.push(`${AGENTS_FILE} has no basalt block: run \`basalt-ui sync\``)
178
+ const scan = scanBlock(agents, file)
179
+ if (scan === 'absent') findings.push(`${file} has no basalt block: run \`basalt-ui sync\``)
176
180
  else if ('error' in scan) findings.push(scan.error)
177
181
  }
182
+ // `agents` moved the block: the one the default file still holds is stale.
183
+ if (file !== AGENTS_FILE) {
184
+ const old = readText(ctx.root, AGENTS_FILE)
185
+ if (old !== null && scanBlock(old, AGENTS_FILE) !== 'absent') {
186
+ findings.push(
187
+ `${AGENTS_FILE} still holds a basalt block, but \`agents\` places it in ${file}: delete the lines from \`<!-- basalt:begin\` to \`<!-- basalt:end -->\``,
188
+ )
189
+ }
190
+ }
178
191
  // Only Claude Code lets a CLAUDE.md shadow AGENTS.md; OpenCode prefers AGENTS.md, Codex never reads it.
179
- const shadows = harnessesOf(manifest).includes('claude-code') ? claudeMdAbove(ctx.root) : []
180
- for (const file of shadows) {
181
- findings.push(
182
- `${file} exists and shadows ${AGENTS_FILE}; move its content into ${AGENTS_FILE}`,
183
- )
192
+ const shadows = harnessesOf(manifest).includes('claude-code')
193
+ ? claudeMdAbove(resolve(ctx.root, dirname(file)))
194
+ : []
195
+ for (const shadow of shadows) {
196
+ findings.push(`${shadow} exists and shadows ${file}; move its content into ${file}`)
184
197
  }
185
- return verdictOf(findings, `${AGENTS_FILE} carries the block; no CLAUDE.md in or above`)
198
+ return verdictOf(findings, `${file} carries the block; no CLAUDE.md in or above`)
186
199
  },
187
200
  })
188
201
 
@@ -206,8 +219,9 @@ const check7 = (name: string): Check => ({
206
219
  const findings = units
207
220
  .filter((u) => !existsSync(unitPath(ctx.root, sibling?.repoRoot ?? ctx.root, u.path)))
208
221
  .map((u) => `${u.path} is missing at the install root: run \`basalt-ui sync\``)
209
- const agents = readText(ctx.root, AGENTS_FILE) ?? ''
210
- const scan = scanBlock(agents, AGENTS_FILE)
222
+ const file = agentsPath(manifest)
223
+ const agents = readText(ctx.root, file) ?? ''
224
+ const scan = scanBlock(agents, file)
211
225
  const block =
212
226
  typeof scan === 'object' && 'start' in scan ? agents.slice(scan.start, scan.end) : ''
213
227
  const placed = new Set(
@@ -0,0 +1,11 @@
1
+ import { SLOTS } from '../../ui/slots'
2
+
3
+ /**
4
+ * Slots of the shipped primitive `name` the text never names as a string outside its own
5
+ * `<name>Parts` list. Empty for a name basalt does not ship.
6
+ */
7
+ export function droppedSlots(name: string, text: string): string[] {
8
+ const slots = (SLOTS as Record<string, readonly string[]>)[name] ?? []
9
+ const body = text.replace(/export const [A-Za-z]+Parts = \[[^\]]*\] as const/, '')
10
+ return slots.filter((slot) => !body.includes(`'${slot}'`) && !body.includes(`"${slot}"`))
11
+ }
@@ -25,7 +25,9 @@ import type { Manifest } from '../manifest'
25
25
  import { ejectHeader, stripHeader, withHeader } from '../merge/header'
26
26
  import { ejectedGuard, ejectedSource, readSeed, seedNames } from '../merge/seed'
27
27
  import { peerAddLine } from '../peers'
28
+ import { VITE_CONFIGS } from '../router-wiring'
28
29
  import { hasDependency, importedPackageNames, readPackageJson, tokenize } from '../source-text'
30
+ import { droppedSlots } from './dropped-slots'
29
31
  import { isClean, onMergeBase } from './git'
30
32
  import { EJECT_HELP } from './help'
31
33
  import {
@@ -72,15 +74,6 @@ const refuse = (why: string): never => {
72
74
  throw new Refusal(why)
73
75
  }
74
76
 
75
- const VITE_CONFIGS = [
76
- 'vite.config.ts',
77
- 'vite.config.mts',
78
- 'vite.config.js',
79
- 'vite.config.mjs',
80
- 'vite.config.cts',
81
- 'vite.config.cjs',
82
- ]
83
-
84
77
  /** One line, non-empty: it lands in a header comment and a JSON row. */
85
78
  function oneLine(flag: string, value: string | undefined): string | undefined {
86
79
  if (value === undefined) return undefined
@@ -451,11 +444,22 @@ function planAdopt(ctx: Context, args: Args): Plan {
451
444
  ...(raised === undefined ? {} : { budget: raised }),
452
445
  report: [
453
446
  `basalt-ui eject: adopted ${rel} as origin "${origin}"${origin === 'local' ? ' (no base, no guard, no merge)' : ` (base ${basePath(root, name)} = seed)`}.`,
447
+ ...droppedSlotsReport(name, rel, body),
454
448
  ...ceilingReport(root, counts, raised ?? budget),
455
449
  ],
456
450
  }
457
451
  }
458
452
 
453
+ /** Adopting does not add slots, so say now what `doctor` will refuse. */
454
+ function droppedSlotsReport(name: string, rel: string, body: string): string[] {
455
+ const dropped = droppedSlots(name, body)
456
+ return dropped.length === 0
457
+ ? []
458
+ : [
459
+ `basalt-ui eject: ${rel} does not render the data-slot ${dropped.map((s) => `"${s}"`).join(', ')}, so doctor fails until it does. A shadcn copy is deleted and basalt-ui/ui/${name} imported instead (\`basalt-ui migrate\` maps the props).`,
460
+ ]
461
+ }
462
+
459
463
  function planUndo(ctx: Context, args: Args): Plan {
460
464
  const root = pickRoot(ctx, args.app)
461
465
  const name = args.names[0] as string
package/src/cli/help.ts CHANGED
@@ -30,6 +30,9 @@ export const COMMAND_OPTIONS: Record<
30
30
  start: { type: 'boolean' },
31
31
  harness: { type: 'string' },
32
32
  locales: { type: 'string' },
33
+ agents: { type: 'string' },
34
+ design: { type: 'string' },
35
+ catalogs: { type: 'string', multiple: true },
33
36
  },
34
37
  sync: {
35
38
  force: { type: 'boolean' },
@@ -52,6 +55,7 @@ export const COMMAND_OPTIONS: Record<
52
55
  agent: { type: 'boolean' },
53
56
  changed: { type: 'boolean' },
54
57
  stats: { type: 'boolean' },
58
+ baseline: { type: 'boolean' },
55
59
  hook: { type: 'string' },
56
60
  },
57
61
  'tokens:css': {
@@ -62,6 +66,7 @@ export const COMMAND_OPTIONS: Record<
62
66
  vibrancy: { type: 'string' },
63
67
  selector: { type: 'string' },
64
68
  accents: { type: 'string' },
69
+ pick: { type: 'string' },
65
70
  extra: { type: 'string' },
66
71
  format: { type: 'string' },
67
72
  // The 2.x flags stay PARSEABLE so `tokensCss` can exit 1 naming `--selector`, their successor,
@@ -117,16 +122,18 @@ export const USAGE =
117
122
  'Usage: basalt-ui <--version | init --profile <tokens|site|bridge|parts|app> [--root <path>]… [--no-install] |\n' +
118
123
  ' sync [--check] [--force] | remove [--force] |\n' +
119
124
  ' doctor | migrate --from <x.y.z> --profile <p> [--json] [--check] |\n' +
120
- ' lint [--file <p>… | --changed | --stats] | tokens:css | fonts:css |\n' +
125
+ ' lint [--file <p>… | --changed | --stats | --baseline] | tokens:css | fonts:css |\n' +
121
126
  ' eject <name | --all | --adopt <path>> --reason <why> | add <block>… [--dir <path>] | add --list |\n' +
122
127
  ' docs <name> | parts [--json] |\n shot <route…> | shot detect | help>\n\n' +
123
128
  'tokens:css [--accent <#hex>] [--neutral <zinc|neutral|stone|slate>] [--vibrancy <-4..5>]\n' +
124
- ' [--selector <:root[attr]> | --accents <name,…>] [--extra <file>] [--format <css|json>] [--out <path>] [--check]\n' +
129
+ ' [--selector <:root[attr]> | --accents <name,…> | --pick <token,…>] [--extra <file>] [--format <css|json>] [--out <path>] [--check]\n' +
125
130
  ' Emit the --basalt-* stylesheet (stdout unless --out). Defaults emit the stock identity; commit the output as your tokens file.\n' +
126
131
  ' --format json emits the resolved #hex per opaque role and scheme, for manifests, theme-color metas and email.\n' +
127
132
  ' --selector scopes a tenant sheet (only the roles that differ from the default) to a `:root[…]` selector.\n' +
128
133
  ' --accents emits the accent sheet instead: one :root[data-accent=<name>] block per named accent (blue, violet, rose,\n' +
129
134
  ' orange, green, teal) against the base the other flags set; import it after tokens.css. Without it no accent ships.\n' +
135
+ ' --pick canvas,ink,good emits only those tokens and the ones their values reference, with the same light,\n' +
136
+ ' dark and OS-dark blocks: for a standalone HTML document that loads no basalt sheet.\n' +
130
137
  ' --extra emits your app-owned tokens (src/basalt.tokens.ts) to --out.\n' +
131
138
  ' --check writes nothing and exits 1 when --out differs from what would be emitted (a CI gate).\n' +
132
139
  ' Negative values take the = form: --vibrancy=-2.\n' +
@@ -190,7 +197,7 @@ export const USAGE =
190
197
  ' detect takes --out <dir>, never a positional.\n' +
191
198
  ' A component can declare a rest anchor absent in a URL state with data-shot-absent="empty error": that\n' +
192
199
  ' cell is recorded `absent`, not `error`.\n\n' +
193
- 'lint [--file <path>… | --changed | --stats] [--agent]\n' +
200
+ 'lint [--file <path>… | --changed | --stats | --baseline] [--agent]\n' +
194
201
  ' oxlint, stylelint and the --basalt-* name check over the declared roots, then the eject ceiling of\n' +
195
202
  ' .basalt/budget.json. A finding is "<file>:<line> <rule>: <message and fix>"; exit 1 on a finding or\n' +
196
203
  ' a ceiling breach, and on a scan of zero files. --file lints the named files, --changed what git\n' +
@@ -201,6 +208,11 @@ export const USAGE =
201
208
  " declared control kind, form control, a Tree row's own icon, badge or trailing). Commit it; sync --check and\n" +
202
209
  ' doctor fail while it is stale. Nothing caps it: a new line shows in the diff. --stats exits 0\n' +
203
210
  ' with findings and 1 above the eject ceiling (raised by eject --raise).\n' +
211
+ ' --baseline is for an app that takes the guards on with screens already written: it writes\n' +
212
+ ' .basalt/baseline.json, the findings of a full scan counted per file and rule (parse errors and\n' +
213
+ ' unused or reasonless directives never), and is refused while the file exists. Every lint run, the edit hooks\n' +
214
+ " included, then passes a file's rule at or under its count and reports all of it above. --stats\n" +
215
+ ' lowers the counts, never raises them, and a full lint fails while the file holds more than is left.\n' +
204
216
  ' --hook <post-edit|stop|pre-edit> reads the event\n' +
205
217
  ' JSON on stdin and is called only by .basalt/hook.mjs; it is exempt from the unknown-flag exit 1\n' +
206
218
  ' because every hook failure exits 2.\n\n' +
@@ -212,14 +224,16 @@ export const USAGE =
212
224
  ' SKIPPED; SKIPPED exits non-zero. Every failure names the command or setup step that fixes it.\n\n' +
213
225
  'migrate --from <x.y.z> --profile <tokens|site|bridge|parts|app> [--json] [--check]\n' +
214
226
  " The upgrade worklist: reads the app's imports and prints each migration row newer than --from that\n" +
215
- ' touches them (renames, removals, token and storage keys), with file:line. Writes nothing. --check\n' +
216
- ' exits 1 while a removed symbol is still imported; --json prints the report. Read MIGRATING.md beside it.\n\n' +
227
+ ' touches them (renames, removals, token and storage keys), with file:line, and at any --from each row\n' +
228
+ ' for a source file the app holds (components/ui/<name>.tsx). Writes nothing. --check exits 1 while a\n' +
229
+ ' removed symbol is still imported; --json prints the report. Read MIGRATING.md beside it.\n\n' +
217
230
  'init --profile <tokens|site|bridge|parts|app> [--root <path>]… [--tokens-out <css>] [--tokens-json-out <json>]\n' +
218
231
  ' [--extra <file>] [--accent <#hex>] [--neutral <name>] [--vibrancy <n>] [--selector <sel>] [--no-install]\n' +
219
- ' [--start] [--harness <claude-code,codex,opencode,pi>] [--locales <en,de,…>]\n' +
232
+ ' [--start] [--harness <claude-code,codex,opencode,pi>] [--locales <en,de,…>] [--catalogs <pattern>]…\n' +
233
+ ' [--agents <path.md>] [--design <path.md>]\n' +
220
234
  ' The one door into an install. The profile is declared, never inferred (exit 1 without it); each --root\n' +
221
235
  ' (default: the roots already recorded at that profile, else .) is declared with it. Paths are relative to the repo root. Writes .basalt/manifest.json and the\n' +
222
- " token outputs, installs the profile's peers within their declared ranges (a pin saved exactly, a range as the range) with the lockfile's package manager, places the\n" +
236
+ " token outputs, installs the profile's peers within their declared ranges (a pin saved exactly, a range as the range, or as its resolved version where bunfig.toml or .npmrc saves exact) into the workspace package that holds the declared root, with the lockfile's package manager, places the\n" +
223
237
  ' managed files and presets through sync, seeds .basalt/budget.json and DESIGN.md, at app writes the router scaffold (main.tsx, routes, nav) once, writes the formatter\n' +
224
238
  ' ignore, and ends in doctor, then the session note when its run wrote agent-read files. --no-install prints the install command instead of running it. Running it\n' +
225
239
  ' twice changes nothing. It edits an app-owned file (Vite config, stylesheet entry, index.html, main.tsx, astro config) only when it is the untouched\n' +
@@ -227,18 +241,28 @@ export const USAGE =
227
241
  ' --start (with --profile app) makes the app a TanStack Start host: tanstackStart() before the React plugin,\n' +
228
242
  ' src/router.tsx (getRouter), a root route with the document shell and the pre-paint scheme script, no main.tsx.\n' +
229
243
  ' The app owns @tanstack/react-start; init installs nothing for it.\n' +
244
+ ' Run it at the repo root, or in a workspace package of it. A package below the root that is no workspace package is refused before anything is written, unless its package.json declares\n' +
245
+ ' `"basalt": { "sibling": true }`, which makes it an install of its own (references/migrate.md, "The sibling app").\n' +
230
246
  ' A site (static pages on Astro) writes no router scaffold; a stock astro.config is rewritten with basaltAstro(), any other is kept.\n' +
231
247
  ' On a 2.x install it reads the old manifest: removes each agent file 2.x placed that nobody edited,\n' +
232
248
  ' the .oxlintrc.json it seeded and its guard-hook entry, then writes the 3.x manifest (--root\n' +
233
249
  ' defaults to the 2.x basalt.roots). It leaves anything else, and doctor names it.\n\n' +
234
250
  ' --locales names the languages the app ships, the source one first; it writes `locales` in the manifest. With two or\n' +
235
- ' more, lint refuses literal text and doctor checks that every catalogue is complete (docs/recipes/localise-app.md).\n' +
251
+ ' more, lint refuses literal text and doctor checks that every catalogue is complete, a language in the\n' +
252
+ " manifest's `partialLocales` excepted (docs/recipes/localise-app.md).\n" +
236
253
  ' At app it also wires that catalogue: Lingui at a pinned version, lingui.config.ts, the Vite plugin, the .po module\n' +
237
254
  " declaration, a catalogue per language (the seeds' words translated where the package ships the language), a\n" +
238
255
  ' LocalizedProvider, seeds that take their words from it, and a check script that runs `lingui extract --clean &&\n' +
239
- ' lingui compile --strict` first. The compiled catalogues are ignored by git, the linter and the formatter.\n\n' +
256
+ ' lingui compile --strict` first. The compiled catalogues are ignored by git, the linter and the formatter.\n' +
257
+ " --catalogs (repeatable, quoted: 'packages/i18n/locales/*/{locale}.po') writes `catalogs` in the manifest. When none\n" +
258
+ " of them is the app's own src/locales/{locale}.po, the app keeps its catalogue elsewhere: init writes no catalogue,\n" +
259
+ " no wiring of one and no router seed, installs no Lingui and leaves the check script's catalogue step to the app.\n\n" +
240
260
  ' --harness names the agent harnesses the layer is placed for (default: the ones whose directory\n' +
241
261
  ' is in the repo, else claude-code); it writes `harnesses` in .basalt/manifest.json, which sync reads.\n\n' +
262
+ ' --agents and --design name where an app in a monorepo keeps its AGENTS block and its DESIGN.md\n' +
263
+ ' (apps/console/AGENTS.md, apps/console/DESIGN.md); they write `agents` and `design` in the manifest,\n' +
264
+ ' which sync and doctor read. Default: AGENTS.md and DESIGN.md at the install root. The manifest key\n' +
265
+ " `report` replaces the block's one sentence on where a defect in basalt-ui goes.\n\n" +
242
266
  'sync [--check] [--force]\n' +
243
267
  ' Renders every managed file (the basalt-* rules, skills and reviewer for each harness in `harnesses`,\n' +
244
268
  ' the AGENTS.md block, the preset files, the hook shim .basalt/hook.mjs and its entries in each\n' +
@@ -257,7 +281,7 @@ export const USAGE =
257
281
  'invocation cwd — nothing inferred, nothing descended into (sync alone looks UP for the manifest\n' +
258
282
  'that declares the directory).\n' +
259
283
  '\n' +
260
- 'Every subcommand accepts --help / -h to print this message and exit without running; `eject --help` and `add --help`\n' +
284
+ 'Every subcommand accepts --help / -h to print this message and exit without running; `init --help`, `eject --help` and `add --help`\n' +
261
285
  'print their own flags and exit codes.\n' +
262
286
  '--version / -v prints the resolved package version and exits 0 — the one command that proves\n' +
263
287
  'WHICH basalt-ui ran, which a `bunx` cache can otherwise make a lie. An unknown command or an\n' +