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.
- package/AGENTS.md +1 -0
- package/CHANGELOG.md +72 -39
- package/MIGRATING.md +44 -2
- package/README.md +39 -12
- package/agent/rules/basalt-tokens.md +1 -1
- package/agent/rules/basalt-ui.md +3 -3
- package/agent/skills/basalt-app/references/live.md +4 -4
- package/agent/skills/basalt-app/references/migrate.md +2 -2
- package/agent/skills/basalt-app/references/setup.md +17 -8
- package/agent/skills/basalt-app/references/testing.md +8 -6
- package/agent/skills/basalt-design/SKILL.md +2 -1
- package/agent/skills/basalt-design/references/controls.md +1 -0
- package/agent/skills/basalt-design/references/parts.md +5 -1
- package/agent/templates/AGENTS-block.md.tpl +6 -23
- package/agent/templates/AGENTS-block.site.md.tpl +5 -18
- package/agent/templates/AGENTS-block.tokens.md.tpl +3 -7
- package/agent/templates/DESIGN.md.tpl +1 -1
- package/agent/templates/_app-error.i18n.tpl +8 -32
- package/agent/templates/_app-error.tpl +8 -32
- package/agent/templates/_app-pending.i18n.tpl +5 -3
- package/agent/templates/_app-pending.tpl +5 -4
- package/agent/templates/main.i18n.tpl +8 -3
- package/agent/templates/main.tpl +8 -3
- package/agent/templates/router.start.tpl +8 -3
- package/agent/templates/seed-messages.json +0 -30
- package/configs/oxlint-app.json +9 -1
- package/configs/oxlint-bridge.json +3 -1
- package/configs/oxlint-parts.json +9 -1
- package/configs/oxlint-site.json +3 -1
- package/dist/astro/shiki.d.ts +3 -2
- package/dist/astro/shiki.d.ts.map +1 -1
- package/dist/cards/bar-list.d.ts.map +1 -1
- package/dist/cards/bar-list.js +2 -1
- package/dist/cards/chain-view.d.ts +37 -8
- package/dist/cards/chain-view.d.ts.map +1 -1
- package/dist/cards/chain-view.js +105 -38
- package/dist/cards/contract.d.ts +8 -1
- package/dist/cards/contract.d.ts.map +1 -1
- package/dist/cards/data-panel.d.ts.map +1 -1
- package/dist/cards/data-panel.js +1 -0
- package/dist/cards/event-list.d.ts.map +1 -1
- package/dist/cards/event-list.js +3 -2
- package/dist/cards/index.d.ts +1 -1
- package/dist/cards/index.d.ts.map +1 -1
- package/dist/cards/row-list.d.ts.map +1 -1
- package/dist/cards/row-list.js +2 -1
- package/dist/cards/stat-card-parts.d.ts +3 -3
- package/dist/cards/stat-card-parts.d.ts.map +1 -1
- package/dist/cards/stat-card-parts.js +8 -2
- package/dist/cards/stat-card.d.ts.map +1 -1
- package/dist/cards/stat-card.js +34 -9
- package/dist/charts/core/compile.d.ts +2 -0
- package/dist/charts/core/compile.d.ts.map +1 -1
- package/dist/charts/core/compile.js +16 -8
- package/dist/charts/core/cursor.d.ts +2 -1
- package/dist/charts/core/cursor.d.ts.map +1 -1
- package/dist/charts/core/cursor.js +8 -1
- package/dist/charts/core/tooltip-said.d.ts +16 -0
- package/dist/charts/core/tooltip-said.d.ts.map +1 -0
- package/dist/charts/core/tooltip-said.js +39 -0
- package/dist/charts/focus.d.ts.map +1 -1
- package/dist/charts/focus.js +1 -1
- package/dist/charts/parts/chart-card.d.ts.map +1 -1
- package/dist/charts/parts/chart-card.js +1 -0
- package/dist/cli/agent-note.d.ts +3 -3
- package/dist/cli/agent-note.d.ts.map +1 -1
- package/dist/cli/agent-note.js +5 -5
- package/dist/cli/budget/index.d.ts +7 -0
- package/dist/cli/budget/index.d.ts.map +1 -1
- package/dist/cli/budget/index.js +11 -5
- package/dist/cli/config.d.ts +1 -1
- package/dist/cli/doctor/app.d.ts.map +1 -1
- package/dist/cli/doctor/app.js +53 -24
- package/dist/cli/doctor/eject.d.ts.map +1 -1
- package/dist/cli/doctor/eject.js +16 -9
- package/dist/cli/doctor/guards.d.ts.map +1 -1
- package/dist/cli/doctor/guards.js +11 -8
- package/dist/cli/doctor/hook.js +1 -1
- package/dist/cli/doctor/install.d.ts.map +1 -1
- package/dist/cli/doctor/install.js +46 -22
- package/dist/cli/doctor/translations.d.ts.map +1 -1
- package/dist/cli/doctor/translations.js +11 -4
- package/dist/cli/doctor/types.d.ts +2 -2
- package/dist/cli/doctor/types.d.ts.map +1 -1
- package/dist/cli/doctor/types.js +1 -1
- package/dist/cli/doctor/wiring.d.ts.map +1 -1
- package/dist/cli/doctor/wiring.js +26 -15
- package/dist/cli/eject/dropped-slots.d.ts +6 -0
- package/dist/cli/eject/dropped-slots.d.ts.map +1 -0
- package/dist/cli/eject/dropped-slots.js +9 -0
- package/dist/cli/eject/index.d.ts.map +1 -1
- package/dist/cli/eject/index.js +9 -8
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +7 -2
- package/dist/cli/index.d.ts +6 -5
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +38 -7
- package/dist/cli/init/index.d.ts +10 -0
- package/dist/cli/init/index.d.ts.map +1 -1
- package/dist/cli/init/index.js +61 -10
- package/dist/cli/init/locales.d.ts +7 -0
- package/dist/cli/init/locales.d.ts.map +1 -1
- package/dist/cli/init/locales.js +21 -6
- package/dist/cli/init/router-seeds.d.ts.map +1 -1
- package/dist/cli/init/router-seeds.js +16 -3
- package/dist/cli/init/steps.d.ts +36 -3
- package/dist/cli/init/steps.d.ts.map +1 -1
- package/dist/cli/init/steps.js +201 -34
- package/dist/cli/lint/baseline.d.ts +27 -0
- package/dist/cli/lint/baseline.d.ts.map +1 -0
- package/dist/cli/lint/baseline.js +96 -0
- package/dist/cli/lint/engine.d.ts +2 -0
- package/dist/cli/lint/engine.d.ts.map +1 -1
- package/dist/cli/lint/engine.js +18 -8
- package/dist/cli/lint/hook.d.ts.map +1 -1
- package/dist/cli/lint/hook.js +8 -3
- package/dist/cli/lint/index.d.ts +3 -0
- package/dist/cli/lint/index.d.ts.map +1 -1
- package/dist/cli/lint/index.js +67 -8
- package/dist/cli/manifest.d.ts +46 -3
- package/dist/cli/manifest.d.ts.map +1 -1
- package/dist/cli/manifest.js +71 -1
- package/dist/cli/migrate/census.d.ts +6 -0
- package/dist/cli/migrate/census.d.ts.map +1 -1
- package/dist/cli/migrate/census.js +22 -1
- package/dist/cli/migrate/index.d.ts +5 -0
- package/dist/cli/migrate/index.d.ts.map +1 -1
- package/dist/cli/migrate/index.js +36 -3
- package/dist/cli/migrate/lost-classes.d.ts +20 -0
- package/dist/cli/migrate/lost-classes.d.ts.map +1 -0
- package/dist/cli/migrate/lost-classes.js +145 -0
- package/dist/cli/migrate/rows.d.ts +10 -0
- package/dist/cli/migrate/rows.d.ts.map +1 -1
- package/dist/cli/migrate/rows.js +15 -0
- package/dist/cli/package-manager.d.ts.map +1 -1
- package/dist/cli/package-manager.js +2 -1
- package/dist/cli/peers.d.ts +2 -0
- package/dist/cli/peers.d.ts.map +1 -1
- package/dist/cli/peers.js +7 -0
- package/dist/cli/presets.d.ts.map +1 -1
- package/dist/cli/presets.js +27 -11
- package/dist/cli/resolver.d.ts +13 -4
- package/dist/cli/resolver.d.ts.map +1 -1
- package/dist/cli/resolver.js +39 -5
- package/dist/cli/router-wiring.d.ts +1 -0
- package/dist/cli/router-wiring.d.ts.map +1 -1
- package/dist/cli/router-wiring.js +1 -1
- package/dist/cli/sync/engine.d.ts +8 -1
- package/dist/cli/sync/engine.d.ts.map +1 -1
- package/dist/cli/sync/engine.js +25 -14
- package/dist/cli/sync/index.d.ts.map +1 -1
- package/dist/cli/sync/index.js +7 -4
- package/dist/cli/sync/render.d.ts.map +1 -1
- package/dist/cli/sync/render.js +21 -28
- package/dist/cli/tokens-css.d.ts +2 -0
- package/dist/cli/tokens-css.d.ts.map +1 -1
- package/dist/cli/tokens-css.js +28 -6
- package/dist/controls/contract.d.ts +2 -1
- package/dist/controls/contract.d.ts.map +1 -1
- package/dist/controls/control-home.d.ts +4 -1
- package/dist/controls/control-home.d.ts.map +1 -1
- package/dist/controls/control-home.js +5 -3
- package/dist/controls/local-control.d.ts +28 -1
- package/dist/controls/local-control.d.ts.map +1 -1
- package/dist/controls/local-control.js +14 -2
- package/dist/core/cn.d.ts.map +1 -1
- package/dist/core/cn.js +6 -5
- package/dist/core/frame-figure.d.ts +2 -0
- package/dist/core/frame-figure.d.ts.map +1 -1
- package/dist/core/frame-figure.js +5 -2
- package/dist/core/frame-head.d.ts +3 -1
- package/dist/core/frame-head.d.ts.map +1 -1
- package/dist/core/frame-head.js +28 -7
- package/dist/core/frame-regions.d.ts +1 -1
- package/dist/core/frame-regions.d.ts.map +1 -1
- package/dist/core/frame-regions.js +18 -8
- package/dist/core/info-hint.d.ts +5 -0
- package/dist/core/info-hint.d.ts.map +1 -1
- package/dist/core/info-hint.js +22 -1
- package/dist/core/mark-tone.d.ts +6 -2
- package/dist/core/mark-tone.d.ts.map +1 -1
- package/dist/core/mark-tone.js +1 -1
- package/dist/core/mark-types.d.ts +4 -2
- package/dist/core/mark-types.d.ts.map +1 -1
- package/dist/core/messages/chain.d.ts +2 -1
- package/dist/core/messages/chain.d.ts.map +1 -1
- package/dist/core/messages/chain.js +1 -0
- package/dist/core/messages/index.d.ts +2 -1
- package/dist/core/messages/index.d.ts.map +1 -1
- package/dist/core/messages/index.js +2 -0
- package/dist/core/messages/runs.d.ts +20 -0
- package/dist/core/messages/runs.d.ts.map +1 -0
- package/dist/core/messages/runs.js +18 -0
- package/dist/core/phase.d.ts +25 -2
- package/dist/core/phase.d.ts.map +1 -1
- package/dist/core/ports.d.ts +4 -1
- package/dist/core/ports.d.ts.map +1 -1
- package/dist/core/provider.d.ts +3 -1
- package/dist/core/provider.d.ts.map +1 -1
- package/dist/core/provider.js +5 -3
- package/dist/core/scheme.d.ts +2 -1
- package/dist/core/scheme.d.ts.map +1 -1
- package/dist/core/scheme.js +1 -0
- package/dist/core/spark/mini-bars.d.ts +6 -4
- package/dist/core/spark/mini-bars.d.ts.map +1 -1
- package/dist/core/spark/mini-bars.js +36 -11
- package/dist/core/spark/sparkline.d.ts +2 -2
- package/dist/core/spark/sparkline.d.ts.map +1 -1
- package/dist/core/spark/sparkline.js +21 -2
- package/dist/css/bridge.css +63 -0
- package/dist/css/generate.d.ts +2 -2
- package/dist/css/generate.d.ts.map +1 -1
- package/dist/css/generate.js +25 -0
- package/dist/data/live/live-query.d.ts +2 -2
- package/dist/data/live/live-query.d.ts.map +1 -1
- package/dist/data/live/live-query.js +2 -1
- package/dist/lint/preset.d.ts +12 -3
- package/dist/lint/preset.d.ts.map +1 -1
- package/dist/lint/preset.js +30 -10
- package/dist/lint/rules/class/table.d.ts.map +1 -1
- package/dist/lint/rules/class/table.js +3 -1
- package/dist/lint/rules/structure/control-home.js +1 -1
- package/dist/lint/rules/structure/import-boundary.d.ts.map +1 -1
- package/dist/lint/rules/structure/import-boundary.js +2 -0
- package/dist/lint/rules/structure/label-literal.d.ts.map +1 -1
- package/dist/lint/rules/structure/label-literal.js +1 -1
- package/dist/lint/shadcn.d.ts +562 -0
- package/dist/lint/shadcn.d.ts.map +1 -0
- package/dist/lint/shadcn.js +52 -0
- package/dist/lint/stylelint/render.d.ts +3 -1
- package/dist/lint/stylelint/render.d.ts.map +1 -1
- package/dist/lint/stylelint/render.js +23 -2
- package/dist/lint/stylelint/rules.d.ts +3 -2
- package/dist/lint/stylelint/rules.d.ts.map +1 -1
- package/dist/lint/stylelint/rules.js +11 -6
- package/dist/lint/weakened.d.ts +8 -0
- package/dist/lint/weakened.d.ts.map +1 -1
- package/dist/lint/weakened.js +44 -1
- package/dist/messages/de.d.ts.map +1 -1
- package/dist/messages/de.js +15 -0
- package/dist/messages/es.d.ts.map +1 -1
- package/dist/messages/es.js +15 -0
- package/dist/messages/fr.d.ts.map +1 -1
- package/dist/messages/fr.js +15 -0
- package/dist/messages/zh-hans.d.ts.map +1 -1
- package/dist/messages/zh-hans.js +15 -0
- package/dist/page/bar-title.d.ts +25 -0
- package/dist/page/bar-title.d.ts.map +1 -0
- package/dist/page/bar-title.js +10 -0
- package/dist/page/contract.d.ts +11 -1
- package/dist/page/contract.d.ts.map +1 -1
- package/dist/page/empty-state.d.ts +5 -2
- package/dist/page/empty-state.d.ts.map +1 -1
- package/dist/page/empty-state.js +14 -3
- package/dist/page/facts.d.ts +19 -2
- package/dist/page/facts.d.ts.map +1 -1
- package/dist/page/facts.js +26 -5
- package/dist/page/index.d.ts +8 -0
- package/dist/page/index.d.ts.map +1 -1
- package/dist/page/index.js +9 -0
- package/dist/page/page-bar.d.ts.map +1 -1
- package/dist/page/page-bar.js +2 -7
- package/dist/page/page-summary.d.ts +2 -1
- package/dist/page/page-summary.d.ts.map +1 -1
- package/dist/page/page-summary.js +1 -1
- package/dist/page/run-button.d.ts +26 -0
- package/dist/page/run-button.d.ts.map +1 -0
- package/dist/page/run-button.js +31 -0
- package/dist/page/run-list.d.ts +28 -0
- package/dist/page/run-list.d.ts.map +1 -0
- package/dist/page/run-list.js +88 -0
- package/dist/page/run-queue.d.ts +78 -0
- package/dist/page/run-queue.d.ts.map +1 -0
- package/dist/page/run-queue.js +93 -0
- package/dist/page/section.d.ts +6 -1
- package/dist/page/section.d.ts.map +1 -1
- package/dist/page/section.js +34 -16
- package/dist/shell/commands/command-palette.d.ts.map +1 -1
- package/dist/shell/commands/command-palette.js +5 -1
- package/dist/shell/parts/header.js +1 -1
- package/dist/surfaces.d.ts +15 -1
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +19 -2
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +3 -0
- package/dist/testing/pseudo-locale.d.ts +41 -0
- package/dist/testing/pseudo-locale.d.ts.map +1 -0
- package/dist/testing/pseudo-locale.js +74 -0
- package/dist/testing/quality.d.ts +6 -0
- package/dist/testing/quality.d.ts.map +1 -1
- package/dist/testing/quality.js +139 -1
- package/dist/tokens/bridge-sheet.d.ts +21 -0
- package/dist/tokens/bridge-sheet.d.ts.map +1 -0
- package/dist/tokens/bridge-sheet.js +68 -0
- package/dist/tokens/emit.d.ts +6 -1
- package/dist/tokens/emit.d.ts.map +1 -1
- package/dist/tokens/emit.js +26 -1
- package/dist/ui/accordion.js +1 -1
- package/dist/ui/card.d.ts +32 -4
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +26 -3
- package/dist/ui/collapsible.d.ts +4 -2
- package/dist/ui/collapsible.d.ts.map +1 -1
- package/dist/ui/collapsible.js +1 -1
- package/dist/ui/combobox.js +1 -1
- package/dist/ui/meter.d.ts +34 -3
- package/dist/ui/meter.d.ts.map +1 -1
- package/dist/ui/meter.guard.d.ts +2 -0
- package/dist/ui/meter.guard.d.ts.map +1 -1
- package/dist/ui/meter.guard.js +20 -0
- package/dist/ui/meter.js +23 -7
- package/dist/ui/primitive.contract.d.ts.map +1 -1
- package/dist/ui/primitive.contract.js +7 -0
- package/dist/ui/remote-pad.d.ts +62 -0
- package/dist/ui/remote-pad.d.ts.map +1 -0
- package/dist/ui/remote-pad.guard.d.ts +21 -0
- package/dist/ui/remote-pad.guard.d.ts.map +1 -0
- package/dist/ui/remote-pad.guard.js +6 -0
- package/dist/ui/remote-pad.js +148 -0
- package/dist/ui/segmented.d.ts.map +1 -1
- package/dist/ui/segmented.js +4 -0
- package/dist/ui/skeleton.d.ts +9 -4
- package/dist/ui/skeleton.d.ts.map +1 -1
- package/dist/ui/skeleton.guard.d.ts +6 -2
- package/dist/ui/skeleton.guard.d.ts.map +1 -1
- package/dist/ui/skeleton.guard.js +4 -0
- package/dist/ui/skeleton.js +2 -1
- package/dist/ui/slots.d.ts +2 -1
- package/dist/ui/slots.d.ts.map +1 -1
- package/dist/ui/slots.js +2 -1
- package/dist/vite/allotment.d.ts +1 -1
- package/dist/vite/allotment.d.ts.map +1 -1
- package/dist/vite/allotment.js +15 -1
- package/dist/vite/doc.d.ts +1 -1
- package/dist/vite/doc.d.ts.map +1 -1
- package/dist/vite/doc.js +12 -2
- package/dist/vite/head.d.ts +4 -3
- package/dist/vite/head.d.ts.map +1 -1
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +4 -1
- package/dist/vite/shell-worker.d.ts +6 -0
- package/dist/vite/shell-worker.d.ts.map +1 -0
- package/dist/vite/shell-worker.js +92 -0
- package/docs/astro.md +19 -4
- package/docs/bar-list.md +3 -2
- package/docs/bar-title.md +33 -0
- package/docs/basalt-provider.md +2 -1
- package/docs/card.md +24 -4
- package/docs/chain-view.md +12 -7
- package/docs/chart-card.md +3 -2
- package/docs/collapsible.md +4 -2
- package/docs/control-home.md +4 -2
- package/docs/create-run-queue.md +40 -0
- package/docs/data-panel.md +3 -2
- package/docs/de.md +1 -1
- package/docs/empty-state.md +3 -1
- package/docs/es.md +1 -1
- package/docs/event-list.md +3 -2
- package/docs/fact.md +6 -1
- package/docs/facts.md +5 -1
- package/docs/fr.md +1 -1
- package/docs/live-query.md +1 -1
- package/docs/meter.md +17 -13
- package/docs/mini-bars.md +7 -5
- package/docs/pseudo-basalt-messages.md +30 -0
- package/docs/pseudo-messages.md +27 -0
- package/docs/quality.md +2 -1
- package/docs/recipes/localise-app.md +2 -2
- package/docs/remote-pad.md +40 -0
- package/docs/row-list.md +3 -2
- package/docs/run-button.md +45 -0
- package/docs/run-list.md +71 -0
- package/docs/section.md +7 -1
- package/docs/set-scheme.md +2 -2
- package/docs/skeleton.md +4 -3
- package/docs/slots.md +1 -1
- package/docs/sparkline.md +5 -2
- package/docs/stat-card.md +6 -4
- package/docs/testing.md +64 -0
- package/docs/use-local-control.md +8 -1
- package/docs/use-runs.md +32 -0
- package/docs/vite.md +12 -2
- package/docs/zh-hans.md +1 -1
- package/llms.txt +88 -21
- package/migrations/areas/shadcn.json +338 -0
- package/package.json +9 -2
- package/src/astro/shiki.ts +3 -1
- package/src/cards/bar-list.tsx +2 -1
- package/src/cards/chain-view.tsx +167 -55
- package/src/cards/contract.ts +8 -1
- package/src/cards/data-panel.tsx +1 -0
- package/src/cards/event-list.tsx +2 -1
- package/src/cards/index.ts +1 -0
- package/src/cards/row-list.tsx +2 -1
- package/src/cards/stat-card-parts.tsx +9 -7
- package/src/cards/stat-card.tsx +39 -12
- package/src/charts/core/compile.ts +31 -19
- package/src/charts/core/cursor.ts +11 -3
- package/src/charts/core/tooltip-said.ts +55 -0
- package/src/charts/focus.tsx +4 -1
- package/src/charts/parts/chart-card.tsx +1 -0
- package/src/cli/agent-note.ts +12 -5
- package/src/cli/budget/index.ts +22 -5
- package/src/cli/config.ts +1 -1
- package/src/cli/doctor/app.ts +75 -23
- package/src/cli/doctor/eject.ts +30 -10
- package/src/cli/doctor/guards.ts +11 -8
- package/src/cli/doctor/hook.ts +1 -1
- package/src/cli/doctor/install.ts +61 -24
- package/src/cli/doctor/translations.ts +13 -4
- package/src/cli/doctor/types.ts +2 -3
- package/src/cli/doctor/wiring.ts +30 -16
- package/src/cli/eject/dropped-slots.ts +11 -0
- package/src/cli/eject/index.ts +13 -9
- package/src/cli/help.ts +34 -10
- package/src/cli/index.ts +56 -14
- package/src/cli/init/index.ts +64 -5
- package/src/cli/init/locales.ts +41 -8
- package/src/cli/init/router-seeds.ts +17 -3
- package/src/cli/init/steps.ts +308 -41
- package/src/cli/lint/baseline.ts +141 -0
- package/src/cli/lint/engine.ts +33 -10
- package/src/cli/lint/hook.ts +11 -3
- package/src/cli/lint/index.ts +77 -12
- package/src/cli/manifest.ts +132 -4
- package/src/cli/migrate/census.ts +35 -1
- package/src/cli/migrate/index.ts +46 -3
- package/src/cli/migrate/lost-classes.ts +203 -0
- package/src/cli/migrate/rows.ts +21 -0
- package/src/cli/package-manager.ts +4 -1
- package/src/cli/peers.ts +11 -0
- package/src/cli/presets.ts +32 -11
- package/src/cli/resolver.ts +58 -10
- package/src/cli/router-wiring.ts +3 -1
- package/src/cli/sync/engine.ts +30 -14
- package/src/cli/sync/index.ts +7 -4
- package/src/cli/sync/render.ts +29 -37
- package/src/cli/tokens-css.ts +42 -5
- package/src/controls/contract.ts +2 -0
- package/src/controls/control-home.tsx +15 -4
- package/src/controls/local-control.ts +49 -3
- package/src/core/cn.ts +9 -5
- package/src/core/frame-figure.tsx +7 -1
- package/src/core/frame-head.tsx +32 -6
- package/src/core/frame-regions.tsx +18 -8
- package/src/core/info-hint.tsx +26 -0
- package/src/core/mark-tone.ts +10 -3
- package/src/core/mark-types.ts +4 -2
- package/src/core/messages/chain.ts +2 -1
- package/src/core/messages/index.ts +4 -0
- package/src/core/messages/runs.ts +40 -0
- package/src/core/phase.ts +22 -2
- package/src/core/ports.ts +13 -1
- package/src/core/provider.tsx +7 -3
- package/src/core/scheme.ts +6 -2
- package/src/core/spark/mini-bars.tsx +59 -15
- package/src/core/spark/sparkline.tsx +26 -4
- package/src/css/bridge.css +63 -0
- package/src/css/generate.ts +40 -3
- package/src/data/live/live-query.ts +4 -3
- package/src/lint/preset.ts +52 -13
- package/src/lint/rules/class/table.ts +3 -1
- package/src/lint/rules/structure/control-home.ts +1 -1
- package/src/lint/rules/structure/import-boundary.ts +2 -0
- package/src/lint/rules/structure/label-literal.ts +3 -1
- package/src/lint/shadcn.ts +91 -0
- package/src/lint/stylelint/render.ts +31 -1
- package/src/lint/stylelint/rules.ts +19 -7
- package/src/lint/weakened.ts +59 -1
- package/src/messages/de.ts +20 -0
- package/src/messages/es.ts +20 -0
- package/src/messages/fr.ts +20 -0
- package/src/messages/zh-hans.ts +20 -0
- package/src/page/bar-title.tsx +35 -0
- package/src/page/contract.ts +11 -1
- package/src/page/empty-state.tsx +18 -8
- package/src/page/facts.tsx +43 -5
- package/src/page/index.ts +8 -0
- package/src/page/page-bar.tsx +2 -9
- package/src/page/page-summary.tsx +4 -3
- package/src/page/run-button.tsx +52 -0
- package/src/page/run-list.tsx +151 -0
- package/src/page/run-queue.ts +185 -0
- package/src/page/section.tsx +30 -5
- package/src/shell/commands/command-palette.tsx +10 -1
- package/src/shell/parts/header.tsx +1 -1
- package/src/surfaces.ts +18 -1
- package/src/testing/index.ts +1 -0
- package/src/testing/pseudo-locale.ts +149 -0
- package/src/testing/quality.ts +188 -0
- package/src/tokens/bridge-sheet.ts +80 -0
- package/src/tokens/emit.ts +45 -6
- package/src/ui/accordion.tsx +1 -1
- package/src/ui/card.tsx +56 -6
- package/src/ui/collapsible.tsx +5 -3
- package/src/ui/combobox.tsx +1 -1
- package/src/ui/meter.guard.ts +23 -0
- package/src/ui/meter.tsx +76 -27
- package/src/ui/no-restyle.generated.json +8 -0
- package/src/ui/primitive.contract.ts +7 -0
- package/src/ui/remote-pad.guard.ts +24 -0
- package/src/ui/remote-pad.tsx +249 -0
- package/src/ui/segmented.tsx +6 -0
- package/src/ui/skeleton.guard.ts +7 -2
- package/src/ui/skeleton.tsx +10 -4
- package/src/ui/slots.ts +2 -1
- package/src/vite/allotment.ts +15 -1
- package/src/vite/doc.ts +12 -2
- package/src/vite/head.ts +4 -3
- package/src/vite/index.ts +4 -1
- package/src/vite/shell-worker.ts +115 -0
|
@@ -103,7 +103,7 @@ const named = (ids) => {
|
|
|
103
103
|
const shown = ids.slice(0, SHOWN).map((id) => JSON.stringify(id.length > 40 ? `${id.slice(0, 39)}…` : id));
|
|
104
104
|
return `${shown.join(", ")}${ids.length > SHOWN ? ` and ${ids.length - SHOWN} more` : ""}`;
|
|
105
105
|
};
|
|
106
|
-
function catalogFindings(ctx, patterns, locales) {
|
|
106
|
+
function catalogFindings(ctx, patterns, locales, partial) {
|
|
107
107
|
const findings = [];
|
|
108
108
|
for (const pattern of patterns) {
|
|
109
109
|
const files = locales.map((locale) => [locale, matchesOf(ctx.root, pattern, locale)]);
|
|
@@ -133,7 +133,8 @@ function catalogFindings(ctx, patterns, locales) {
|
|
|
133
133
|
if (read.length > 0 && ids.length === 0) {
|
|
134
134
|
findings.push(`${read.map((c) => c.file).join(", ")}: no message at all ${STEP}`);
|
|
135
135
|
}
|
|
136
|
-
for (const { file, messages } of read) {
|
|
136
|
+
for (const { locale, file, messages } of read) {
|
|
137
|
+
if (partial.has(locale)) continue;
|
|
137
138
|
const missing = ids.filter((id) => messages.get(id) !== true);
|
|
138
139
|
if (missing.length > 0) {
|
|
139
140
|
findings.push(
|
|
@@ -226,12 +227,18 @@ const translationChecks = [
|
|
|
226
227
|
if (!isTranslated(manifest)) {
|
|
227
228
|
return pass("fewer than two `locales` declared: no catalogue to hold");
|
|
228
229
|
}
|
|
230
|
+
const partial = new Set(manifest.partialLocales);
|
|
229
231
|
const findings = [
|
|
230
|
-
...catalogFindings(ctx, manifest.catalogs ?? DEFAULT_CATALOGS, locales),
|
|
232
|
+
...catalogFindings(ctx, manifest.catalogs ?? DEFAULT_CATALOGS, locales, partial),
|
|
231
233
|
...gateFindings(gateScripts(ctx)),
|
|
232
234
|
...providerFindings(ctx, manifest)
|
|
233
235
|
];
|
|
234
|
-
|
|
236
|
+
const complete = locales.filter((locale) => !partial.has(locale));
|
|
237
|
+
const rest = partial.size === 0 ? "" : `; ${[...partial].join(", ")} may be partial`;
|
|
238
|
+
return verdictOf(
|
|
239
|
+
findings,
|
|
240
|
+
`${complete.join(", ")}: every catalogue complete and wired${rest}`
|
|
241
|
+
);
|
|
235
242
|
}
|
|
236
243
|
}
|
|
237
244
|
];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cleanRoot } from '../manifest.js';
|
|
1
2
|
import type { Manifest, Profile } from '../manifest.js';
|
|
2
3
|
import type { RunLint } from '../../lint/weakened.js';
|
|
3
4
|
export type Status = 'pass' | 'fail' | 'skipped';
|
|
@@ -43,8 +44,7 @@ export declare const verdictOf: (findings: readonly string[], ok: string) => Out
|
|
|
43
44
|
/** The manifest, or a SKIPPED check: nothing past check 1 can run without one. */
|
|
44
45
|
export declare function need(ctx: Ctx): Manifest;
|
|
45
46
|
export declare const PROFILE_RANK: Readonly<Record<Profile, number>>;
|
|
46
|
-
|
|
47
|
-
export declare const cleanRoot: (raw: string) => string;
|
|
47
|
+
export { cleanRoot };
|
|
48
48
|
/** Declared roots with their profile, `src` at the manifest profile when none are declared. */
|
|
49
49
|
export declare function rootsOf(manifest: Manifest): [string, Profile][];
|
|
50
50
|
/** Roots that run the oxlint preset: every one above `tokens`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cli/doctor/types.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;AAChD,MAAM,MAAM,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AACxD,MAAM,MAAM,MAAM,GAAG,OAAO,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3D,mDAAmD;AACnD,MAAM,MAAM,aAAa,GAAG;IAC1B,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,sEAAsE;IACtE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,GAAG,GAAG;IAChB,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,0FAA0F;IAC1F,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAA;IACzB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,OAAO,EAAE,aAAa,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,KAAK,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAAE,CAAA;AAE/F,0EAA0E;AAC1E,qBAAa,IAAK,SAAQ,KAAK;CAAG;AAElC,eAAO,MAAM,IAAI,GAAI,QAAQ,MAAM,KAAG,OAAuC,CAAA;AAC7E,eAAO,MAAM,IAAI,GAAI,QAAQ,MAAM,KAAG,OAAuC,CAAA;AAE7E,yEAAyE;AACzE,eAAO,MAAM,SAAS,GAAI,UAAU,SAAS,MAAM,EAAE,EAAE,IAAI,MAAM,KAAG,OACN,CAAA;AAE9D,kFAAkF;AAClF,wBAAgB,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,QAAQ,CAKvC;AAED,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAM1D,CAAA;AAED,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cli/doctor/types.ts"],"names":[],"mappings":"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"}
|
package/dist/cli/doctor/types.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readdirSync, readFileSync } from "node:fs";
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
|
+
import { cleanRoot } from "../manifest.js";
|
|
3
4
|
class Skip extends Error {
|
|
4
5
|
}
|
|
5
6
|
const pass = (detail) => ({ status: "pass", detail });
|
|
@@ -18,7 +19,6 @@ const PROFILE_RANK = {
|
|
|
18
19
|
parts: 3,
|
|
19
20
|
app: 4
|
|
20
21
|
};
|
|
21
|
-
const cleanRoot = (raw) => raw.replace(/^(?:\.\/)+/, "").replace(/\/+$/, "") || ".";
|
|
22
22
|
function rootsOf(manifest) {
|
|
23
23
|
const declared = Object.entries(manifest.roots).map(([r, p]) => [
|
|
24
24
|
cleanRoot(r),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../../src/cli/doctor/wiring.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../../src/cli/doctor/wiring.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAEzC,eAAO,MAAM,aAAa,0BAAc,CAAA;AACxC,eAAO,MAAM,gBAAgB,6BAA6B,CAAA;AA4D1D,gFAAgF;AAChF,eAAO,MAAM,QAAQ,UAUpB,CAAA;AACD,eAAO,MAAM,eAAe,QAAuB,CAAA;AA+BnD,8FAA8F;AAC9F,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAMzE;AAiGD,eAAO,MAAM,YAAY,EAAE,KAAK,EAK/B,CAAA"}
|
|
@@ -5,7 +5,8 @@ import { lintSettingsUnits } from "../lint-settings.js";
|
|
|
5
5
|
import { renderStylelintPreset } from "../presets.js";
|
|
6
6
|
import { readFrameworkVersion, resolveAppDir } from "../index.js";
|
|
7
7
|
import { scanBlock } from "../sync/block.js";
|
|
8
|
-
import { AGENTS_FILE, differences, planSync } from "../sync/engine.js";
|
|
8
|
+
import { AGENTS_FILE, differences, planSync, shadowNote } from "../sync/engine.js";
|
|
9
|
+
import { agentsPath } from "../manifest.js";
|
|
9
10
|
import { siblingOf, siblingName, unitPath } from "../sync/sibling.js";
|
|
10
11
|
import { harnessesOf } from "../harness.js";
|
|
11
12
|
import { placesBlock, renderBlock, renderManaged } from "../sync/render.js";
|
|
@@ -44,8 +45,11 @@ const check4 = (name) => ({
|
|
|
44
45
|
sibling?.repoRoot
|
|
45
46
|
);
|
|
46
47
|
if ("error" in plan.block) return fail(plan.block.error);
|
|
48
|
+
const shadows = new Set(
|
|
49
|
+
plan.items.filter((i) => i.shadows).map((i) => `${i.path}: ${shadowNote(i.path)}`)
|
|
50
|
+
);
|
|
47
51
|
const findings = differences(plan).map(
|
|
48
|
-
(line) => `${line} (\`basalt-ui init\` places it, \`sync\` refreshes it)`
|
|
52
|
+
(line) => shadows.has(line) ? line : `${line} (\`basalt-ui init\` places it, \`sync\` refreshes it)`
|
|
49
53
|
);
|
|
50
54
|
if (lintRoots(manifest).length > 0) {
|
|
51
55
|
const oxlint = readJson(ctx.root, OXLINT_PRESET);
|
|
@@ -140,21 +144,27 @@ const check6 = (name) => ({
|
|
|
140
144
|
const manifest = need(ctx);
|
|
141
145
|
if (!placesBlock(manifest)) return pass("no block: `harnesses` is empty (`basalt-ui remove`)");
|
|
142
146
|
const findings = [];
|
|
143
|
-
const
|
|
144
|
-
|
|
147
|
+
const file = agentsPath(manifest);
|
|
148
|
+
const agents = readText(ctx.root, file);
|
|
149
|
+
if (agents === null) findings.push(`${file} is missing: run \`basalt-ui sync\``);
|
|
145
150
|
else {
|
|
146
|
-
const scan = scanBlock(agents,
|
|
147
|
-
if (scan === "absent")
|
|
148
|
-
findings.push(`${AGENTS_FILE} has no basalt block: run \`basalt-ui sync\``);
|
|
151
|
+
const scan = scanBlock(agents, file);
|
|
152
|
+
if (scan === "absent") findings.push(`${file} has no basalt block: run \`basalt-ui sync\``);
|
|
149
153
|
else if ("error" in scan) findings.push(scan.error);
|
|
150
154
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
if (file !== AGENTS_FILE) {
|
|
156
|
+
const old = readText(ctx.root, AGENTS_FILE);
|
|
157
|
+
if (old !== null && scanBlock(old, AGENTS_FILE) !== "absent") {
|
|
158
|
+
findings.push(
|
|
159
|
+
`${AGENTS_FILE} still holds a basalt block, but \`agents\` places it in ${file}: delete the lines from \`<!-- basalt:begin\` to \`<!-- basalt:end -->\``
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
const shadows = harnessesOf(manifest).includes("claude-code") ? claudeMdAbove(resolve(ctx.root, dirname(file))) : [];
|
|
164
|
+
for (const shadow of shadows) {
|
|
165
|
+
findings.push(`${shadow} exists and shadows ${file}; move its content into ${file}`);
|
|
156
166
|
}
|
|
157
|
-
return verdictOf(findings, `${
|
|
167
|
+
return verdictOf(findings, `${file} carries the block; no CLAUDE.md in or above`);
|
|
158
168
|
}
|
|
159
169
|
});
|
|
160
170
|
const ENTRY_SKILLS = ["basalt-design", "basalt-app", "basalt-site"];
|
|
@@ -171,8 +181,9 @@ const check7 = (name) => ({
|
|
|
171
181
|
);
|
|
172
182
|
}
|
|
173
183
|
const findings = units.filter((u) => !existsSync(unitPath(ctx.root, sibling?.repoRoot ?? ctx.root, u.path))).map((u) => `${u.path} is missing at the install root: run \`basalt-ui sync\``);
|
|
174
|
-
const
|
|
175
|
-
const
|
|
184
|
+
const file = agentsPath(manifest);
|
|
185
|
+
const agents = readText(ctx.root, file) ?? "";
|
|
186
|
+
const scan = scanBlock(agents, file);
|
|
176
187
|
const block = typeof scan === "object" && "start" in scan ? agents.slice(scan.start, scan.end) : "";
|
|
177
188
|
const placed = new Set(
|
|
178
189
|
units.flatMap(
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slots of the shipped primitive `name` the text never names as a string outside its own
|
|
3
|
+
* `<name>Parts` list. Empty for a name basalt does not ship.
|
|
4
|
+
*/
|
|
5
|
+
export declare function droppedSlots(name: string, text: string): string[];
|
|
6
|
+
//# sourceMappingURL=dropped-slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropped-slots.d.ts","sourceRoot":"","sources":["../../../src/cli/eject/dropped-slots.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAIjE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SLOTS } from "../../ui/slots.js";
|
|
2
|
+
function droppedSlots(name, text) {
|
|
3
|
+
const slots = SLOTS[name] ?? [];
|
|
4
|
+
const body = text.replace(/export const [A-Za-z]+Parts = \[[^\]]*\] as const/, "");
|
|
5
|
+
return slots.filter((slot) => !body.includes(`'${slot}'`) && !body.includes(`"${slot}"`));
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
droppedSlots
|
|
9
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/eject/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/eject/index.ts"],"names":[],"mappings":"AA8CA,MAAM,MAAM,YAAY,GAAG;IACzB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAqcD,wBAAgB,KAAK,CACnB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,aAAa,GAAE,MAAsB,EACrC,IAAI,GAAE,YAAiB,GACtB,MAAM,CAgCR"}
|
package/dist/cli/eject/index.js
CHANGED
|
@@ -18,7 +18,9 @@ import { OXLINT_PRESET_FILE, renderOxlintPreset } from "../presets.js";
|
|
|
18
18
|
import { ejectHeader, stripHeader, withHeader } from "../merge/header.js";
|
|
19
19
|
import { ejectedGuard, ejectedSource, readSeed, seedNames } from "../merge/seed.js";
|
|
20
20
|
import { peerAddLine } from "../peers.js";
|
|
21
|
+
import { VITE_CONFIGS } from "../router-wiring.js";
|
|
21
22
|
import { hasDependency, importedPackageNames, readPackageJson, tokenize } from "../source-text.js";
|
|
23
|
+
import { droppedSlots } from "./dropped-slots.js";
|
|
22
24
|
import { isClean, onMergeBase } from "./git.js";
|
|
23
25
|
import { EJECT_HELP } from "./help.js";
|
|
24
26
|
import {
|
|
@@ -47,14 +49,6 @@ class Refusal extends Error {
|
|
|
47
49
|
const refuse = (why) => {
|
|
48
50
|
throw new Refusal(why);
|
|
49
51
|
};
|
|
50
|
-
const VITE_CONFIGS = [
|
|
51
|
-
"vite.config.ts",
|
|
52
|
-
"vite.config.mts",
|
|
53
|
-
"vite.config.js",
|
|
54
|
-
"vite.config.mjs",
|
|
55
|
-
"vite.config.cts",
|
|
56
|
-
"vite.config.cjs"
|
|
57
|
-
];
|
|
58
52
|
function oneLine(flag, value) {
|
|
59
53
|
if (value === void 0) return void 0;
|
|
60
54
|
const trimmed = value.trim();
|
|
@@ -348,10 +342,17 @@ function planAdopt(ctx, args) {
|
|
|
348
342
|
...raised === void 0 ? {} : { budget: raised },
|
|
349
343
|
report: [
|
|
350
344
|
`basalt-ui eject: adopted ${rel} as origin "${origin}"${origin === "local" ? " (no base, no guard, no merge)" : ` (base ${basePath(root, name)} = seed)`}.`,
|
|
345
|
+
...droppedSlotsReport(name, rel, body),
|
|
351
346
|
...ceilingReport(root, counts, raised ?? budget)
|
|
352
347
|
]
|
|
353
348
|
};
|
|
354
349
|
}
|
|
350
|
+
function droppedSlotsReport(name, rel, body) {
|
|
351
|
+
const dropped = droppedSlots(name, body);
|
|
352
|
+
return dropped.length === 0 ? [] : [
|
|
353
|
+
`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).`
|
|
354
|
+
];
|
|
355
|
+
}
|
|
355
356
|
function planUndo(ctx, args) {
|
|
356
357
|
const root = pickRoot(ctx, args.app);
|
|
357
358
|
const name = args.names[0];
|
package/dist/cli/help.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,MAAM,EACN,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,MAAM,EACN,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAiFnE,CAAA;AAED;yCACyC;AACzC,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAgBhF;AAED,0GAA0G;AAC1G,eAAO,MAAM,KAAK,QAuK0E,CAAA"}
|
package/dist/cli/help.js
CHANGED
|
@@ -13,7 +13,10 @@ const COMMAND_OPTIONS = {
|
|
|
13
13
|
"no-install": { type: "boolean" },
|
|
14
14
|
start: { type: "boolean" },
|
|
15
15
|
harness: { type: "string" },
|
|
16
|
-
locales: { type: "string" }
|
|
16
|
+
locales: { type: "string" },
|
|
17
|
+
agents: { type: "string" },
|
|
18
|
+
design: { type: "string" },
|
|
19
|
+
catalogs: { type: "string", multiple: true }
|
|
17
20
|
},
|
|
18
21
|
sync: {
|
|
19
22
|
force: { type: "boolean" },
|
|
@@ -36,6 +39,7 @@ const COMMAND_OPTIONS = {
|
|
|
36
39
|
agent: { type: "boolean" },
|
|
37
40
|
changed: { type: "boolean" },
|
|
38
41
|
stats: { type: "boolean" },
|
|
42
|
+
baseline: { type: "boolean" },
|
|
39
43
|
hook: { type: "string" }
|
|
40
44
|
},
|
|
41
45
|
"tokens:css": {
|
|
@@ -46,6 +50,7 @@ const COMMAND_OPTIONS = {
|
|
|
46
50
|
vibrancy: { type: "string" },
|
|
47
51
|
selector: { type: "string" },
|
|
48
52
|
accents: { type: "string" },
|
|
53
|
+
pick: { type: "string" },
|
|
49
54
|
extra: { type: "string" },
|
|
50
55
|
format: { type: "string" },
|
|
51
56
|
// The 2.x flags stay PARSEABLE so `tokensCss` can exit 1 naming `--selector`, their successor,
|
|
@@ -92,7 +97,7 @@ function unknownFlag(cmd, flags) {
|
|
|
92
97
|
return match?.[1] ?? flags.find((f) => f.startsWith("-")) ?? flags[0] ?? null;
|
|
93
98
|
}
|
|
94
99
|
}
|
|
95
|
-
const USAGE = "Usage: basalt-ui <--version | init --profile <tokens|site|bridge|parts|app> [--root <path>]… [--no-install] |\n sync [--check] [--force] | remove [--force] |\n doctor | migrate --from <x.y.z> --profile <p> [--json] [--check] |\n lint [--file <p>… | --changed | --stats] | tokens:css | fonts:css |\n eject <name | --all | --adopt <path>> --reason <why> | add <block>… [--dir <path>] | add --list |\n docs <name> | parts [--json] |\n shot <route…> | shot detect | help>\n\ntokens:css [--accent <#hex>] [--neutral <zinc|neutral|stone|slate>] [--vibrancy <-4..5>]\n [--selector <:root[attr]> | --accents <name,…>] [--extra <file>] [--format <css|json>] [--out <path>] [--check]\n Emit the --basalt-* stylesheet (stdout unless --out). Defaults emit the stock identity; commit the output as your tokens file.\n --format json emits the resolved #hex per opaque role and scheme, for manifests, theme-color metas and email.\n --selector scopes a tenant sheet (only the roles that differ from the default) to a `:root[…]` selector.\n --accents emits the accent sheet instead: one :root[data-accent=<name>] block per named accent (blue, violet, rose,\n orange, green, teal) against the base the other flags set; import it after tokens.css. Without it no accent ships.\n --extra emits your app-owned tokens (src/basalt.tokens.ts) to --out.\n --check writes nothing and exits 1 when --out differs from what would be emitted (a CI gate).\n Negative values take the = form: --vibrancy=-2.\n\nfonts:css [--out <path>] [--check]\n Emit the shipped --basalt-font-* stacks as plain CSS, for an app that changes them. The faces\n are basalt-ui/fonts.css.\n\ndocs <name>\n Prints one part's doc from this package's docs/: its frontmatter name (StatCard, useControl), its file\n stem (stat-card), or recipes/<stem> (a recipe stem alone too). An exact name wins over a case-insensitive\n one. Exits 1 and names the nearest matches when nothing matches.\n\nparts [--json]\n One line per part: name, import specifier, use when. --json prints an array of\n {name, useWhen, neverWhen, instead, import, doc}.\n\nshot <route…> (--base <url> | --dist <dir>) --out <dir> [--states <list>]\n Render routes in Chromium (Playwright from YOUR project, a dev dependency) and write\n board.html, metrics.json and png/* — every anchor × light/dark × the manifest viewports ×\n rest, hover, focus, keys, tooltip, empty, loading, error. `keys` focuses a chart or row host, presses its\n arrow key twice, shoots the frame and logs the live text and focus; a page error is a named defect, under a URL state too (the state and the stack). An anchor is a data-shot element, else the\n outermost stat-card, chart-card, data-table, section, card or board data-slot, plus each open dialog-content,\n alert-dialog-content, sheet-content or peek panel; a hover, focus, keys or tooltip step under an open overlay is absent. Viewports come from\n .basalt/manifest.json (default 1800x1200 and 390x844). --dist serves a built SPA dir itself.\n A manifest whose every root is a `site` anchors each page's article, each section outside an article and each landing block with no data-shot (main when\n there are none), and writes rubric \"content\" to metrics.json: detect then reads it with no text-size cap and no empty-region rule.\n --out must resolve inside the project (the app dir in a monorepo, not the repo root); routes are\n separate arguments (zsh does not word-split $ROUTES).\n --out is required and must not exist yet: every round writes a fresh dir (shots-1, shots-2, …).\n .basalt/last-shot.json records the latest round (at, out, round).\n empty, loading and error reload the route with ?shot-state=<state>; the page obeys only when its query result goes through\n shotState() from basalt-ui/data (it acts under the runner, never on a production URL; its empty keeps the loaded data's shape). A state crop equal to rest is `states-ignored`.\n A real, signed-in app: [--local-storage <key>=<@env:NAME|@file:path>]… seeds localStorage (app origin\n only) before any page script; [--api <prefix>=<origin>]… (with --dist) proxies GET/HEAD under that\n prefix to the origin (other methods get 405 unless --api-allow-writes); [--header <name>=@env:NAME]… is\n added to every proxied request, to EVERY --api origin (never on a navigation; https required);\n [--wait <ms|networkidle>] adds ms of settle after the anchors render (a page goes to load, waits up to 3 s for its first anchor, then settles 300 ms), or\n `networkidle` to also wait up to 5 s for the network (a page with an open stream never idles and shoots anyway); [--auto-anchors] crops\n each card and table over 120×60 px (else main, section, header, form) on a page with no anchor. Values are never printed or\n written; a redirect, 401/403/404, 5xx or dead API fails every shot of that page. Shots of real data go to the\n reviewer subagent and so to its model provider: point --api at staging or synthetic data when the\n app holds other people's data. Example:\n basalt-ui shot /overview --dist dist --api /api=https://app.example.com \\\n --local-storage auth-token=@env:APP_TOKEN --header authorization=@env:APP_BEARER --auto-anchors\n\nshot detect [--out <dir>] [--lint <oxlint-json-file>] [--facts <dir|file.tsx>]\n The deterministic second review pass, no browser and no model: reads <out>/metrics.json (default: the\n out dir in .basalt/last-shot.json) and, with --lint, the basalt/* diagnostics of `oxlint --format json`\n output saved to a file. Writes <out>/detect.json and a findings table, content, then layout, then style:\n off-scale inset/gap/radius, nested radius step under 3 px, over 3 text or 2 figure sizes, an empty region of\n 40 % or more (a site round has neither size cap nor empty region), overlap, a touch target under the hit floor, document overflow, a state crop identical\n to rest, error shots, a missing scale or no anchors. Contrast is not read: axe owns it.\n --facts <dir|file.tsx> reads the .tsx files under <dir> (not *.test.tsx), or that one route file, and lists the words, phrases and constants\n the page says in several places (communication-5, P2). Without --out it is the whole run: no shot round,\n no score, no detect.json; with --out the facts join that round. --lint needs --out.\n Exit codes: 0 clean (P2/P3 findings are listed, not failing), 2 a P0 or P1 finding, 1 scan failure (missing\n or unreadable metrics.json or lint file, or detect.json cannot be written).\n P0 fails: broken or unreadable: an error shot; no anchors\n P1 fails: a rubric item fails (off-scale value, font sizes, empty region, nested radius, overlap, hit floor, document overflow, an ignored state, lint error)\n P2 noted, not failing: degraded: a lint warning\n P3 noted, not failing: polish: an off-scale value within 1 px of a step\n score = 100 - (25 per P0 + 10 per P1 + 3 per P2 + 1 per P3). A score can go below 0. No anchor\n measured: \"nothing measured\", no score.\n detect takes --out <dir>, never a positional.\n A component can declare a rest anchor absent in a URL state with data-shot-absent=\"empty error\": that\n cell is recorded `absent`, not `error`.\n\nlint [--file <path>… | --changed | --stats] [--agent]\n oxlint, stylelint and the --basalt-* name check over the declared roots, then the eject ceiling of\n .basalt/budget.json. A finding is \"<file>:<line> <rule>: <message and fix>\"; exit 1 on a finding or\n a ceiling breach, and on a scan of zero files. --file lints the named files, --changed what git\n reports changed (nothing changed is clean). --agent is terse and exits 2 on a finding so a hook\n blocks. --stats prints findings, waivers per rule, seams per kind and ejects, and writes the\n record .basalt/record.txt: one line per waived rule and per seam use (own cell, custom marks or\n series, own frame content, hand-built card frame, custom field, filter slot, shell entry,\n declared control kind, form control, a Tree row's own icon, badge or trailing). Commit it; sync --check and\n doctor fail while it is stale. Nothing caps it: a new line shows in the diff. --stats exits 0\n with findings and 1 above the eject ceiling (raised by eject --raise).\n --hook <post-edit|stop|pre-edit> reads the event\n JSON on stdin and is called only by .basalt/hook.mjs; it is exempt from the unknown-flag exit 1\n because every hook failure exits 2.\n\ndoctor\n Fourteen checks on THIS install: manifest, version drift, peers, presets, lint scan, AGENTS block,\n skills and rules, the hook (run from a subdirectory on a seeded offender), the formatter fence,\n token sheets, the eject ceiling with the record, app wiring, what a 2.x install left and, with two or\n more locales, the translations (catalogues, strict compile, provider locale). Each is pass, fail or\n SKIPPED; SKIPPED exits non-zero. Every failure names the command or setup step that fixes it.\n\nmigrate --from <x.y.z> --profile <tokens|site|bridge|parts|app> [--json] [--check]\n The upgrade worklist: reads the app's imports and prints each migration row newer than --from that\n touches them (renames, removals, token and storage keys), with file:line. Writes nothing. --check\n exits 1 while a removed symbol is still imported; --json prints the report. Read MIGRATING.md beside it.\n\ninit --profile <tokens|site|bridge|parts|app> [--root <path>]… [--tokens-out <css>] [--tokens-json-out <json>]\n [--extra <file>] [--accent <#hex>] [--neutral <name>] [--vibrancy <n>] [--selector <sel>] [--no-install]\n [--start] [--harness <claude-code,codex,opencode,pi>] [--locales <en,de,…>]\n The one door into an install. The profile is declared, never inferred (exit 1 without it); each --root\n (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 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 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 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 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 create-vite or create-astro file, recognised by hash, and then replaces it whole; any other file is kept as it is and doctor names the fix.\n --start (with --profile app) makes the app a TanStack Start host: tanstackStart() before the React plugin,\n src/router.tsx (getRouter), a root route with the document shell and the pre-paint scheme script, no main.tsx.\n The app owns @tanstack/react-start; init installs nothing for it.\n A site (static pages on Astro) writes no router scaffold; a stock astro.config is rewritten with basaltAstro(), any other is kept.\n On a 2.x install it reads the old manifest: removes each agent file 2.x placed that nobody edited,\n the .oxlintrc.json it seeded and its guard-hook entry, then writes the 3.x manifest (--root\n defaults to the 2.x basalt.roots). It leaves anything else, and doctor names it.\n\n --locales names the languages the app ships, the source one first; it writes `locales` in the manifest. With two or\n more, lint refuses literal text and doctor checks that every catalogue is complete (docs/recipes/localise-app.md).\n At app it also wires that catalogue: Lingui at a pinned version, lingui.config.ts, the Vite plugin, the .po module\n declaration, a catalogue per language (the seeds' words translated where the package ships the language), a\n LocalizedProvider, seeds that take their words from it, and a check script that runs `lingui extract --clean &&\n lingui compile --strict` first. The compiled catalogues are ignored by git, the linter and the formatter.\n\n --harness names the agent harnesses the layer is placed for (default: the ones whose directory\n is in the repo, else claude-code); it writes `harnesses` in .basalt/manifest.json, which sync reads.\n\nsync [--check] [--force]\n Renders every managed file (the basalt-* rules, skills and reviewer for each harness in `harnesses`,\n the AGENTS.md block, the preset files, the hook shim .basalt/hook.mjs and its entries in each\n harness's hook file (none with `hook: false`), every token\n sheet the manifest records) and compares bytes; it rewrites a ledger file of an older format; it refreshes an EXISTING install and never creates one (that\n is init). --check writes nothing and exits 1 on any difference. A managed file you edited is\n left and reported; --force overwrites it. A retired file is deleted if untouched, else left.\n An ejected primitive is three-way merged with the new seed (adopted: base advanced, file kept);\n a conflict leaves diff3 markers, advances the base and exits 1. An added block (add) is merged\n the same way, file by file.\n\nremove [--force]\n Takes the agent layer out: every file of the ledger, the AGENTS.md block, the hook entries and the\n shim, and writes `harnesses: []` so sync places nothing back. A file you edited stays (exit 1)\n unless --force. .basalt/, the token sheets and the presets stay: the app still imports basalt-ui.\n\ndoctor / sync / lint all resolve their project the same way: BASALT_CWD, else the\ninvocation cwd — nothing inferred, nothing descended into (sync alone looks UP for the manifest\nthat declares the directory).\n\nEvery subcommand accepts --help / -h to print this message and exit without running; `eject --help` and `add --help`\nprint their own flags and exit codes.\n--version / -v prints the resolved package version and exits 0 — the one command that proves\nWHICH basalt-ui ran, which a `bunx` cache can otherwise make a lie. An unknown command or an\nunrecognized flag exits 1 and names what it did not understand; neither is ever ignored.";
|
|
100
|
+
const USAGE = "Usage: basalt-ui <--version | init --profile <tokens|site|bridge|parts|app> [--root <path>]… [--no-install] |\n sync [--check] [--force] | remove [--force] |\n doctor | migrate --from <x.y.z> --profile <p> [--json] [--check] |\n lint [--file <p>… | --changed | --stats | --baseline] | tokens:css | fonts:css |\n eject <name | --all | --adopt <path>> --reason <why> | add <block>… [--dir <path>] | add --list |\n docs <name> | parts [--json] |\n shot <route…> | shot detect | help>\n\ntokens:css [--accent <#hex>] [--neutral <zinc|neutral|stone|slate>] [--vibrancy <-4..5>]\n [--selector <:root[attr]> | --accents <name,…> | --pick <token,…>] [--extra <file>] [--format <css|json>] [--out <path>] [--check]\n Emit the --basalt-* stylesheet (stdout unless --out). Defaults emit the stock identity; commit the output as your tokens file.\n --format json emits the resolved #hex per opaque role and scheme, for manifests, theme-color metas and email.\n --selector scopes a tenant sheet (only the roles that differ from the default) to a `:root[…]` selector.\n --accents emits the accent sheet instead: one :root[data-accent=<name>] block per named accent (blue, violet, rose,\n orange, green, teal) against the base the other flags set; import it after tokens.css. Without it no accent ships.\n --pick canvas,ink,good emits only those tokens and the ones their values reference, with the same light,\n dark and OS-dark blocks: for a standalone HTML document that loads no basalt sheet.\n --extra emits your app-owned tokens (src/basalt.tokens.ts) to --out.\n --check writes nothing and exits 1 when --out differs from what would be emitted (a CI gate).\n Negative values take the = form: --vibrancy=-2.\n\nfonts:css [--out <path>] [--check]\n Emit the shipped --basalt-font-* stacks as plain CSS, for an app that changes them. The faces\n are basalt-ui/fonts.css.\n\ndocs <name>\n Prints one part's doc from this package's docs/: its frontmatter name (StatCard, useControl), its file\n stem (stat-card), or recipes/<stem> (a recipe stem alone too). An exact name wins over a case-insensitive\n one. Exits 1 and names the nearest matches when nothing matches.\n\nparts [--json]\n One line per part: name, import specifier, use when. --json prints an array of\n {name, useWhen, neverWhen, instead, import, doc}.\n\nshot <route…> (--base <url> | --dist <dir>) --out <dir> [--states <list>]\n Render routes in Chromium (Playwright from YOUR project, a dev dependency) and write\n board.html, metrics.json and png/* — every anchor × light/dark × the manifest viewports ×\n rest, hover, focus, keys, tooltip, empty, loading, error. `keys` focuses a chart or row host, presses its\n arrow key twice, shoots the frame and logs the live text and focus; a page error is a named defect, under a URL state too (the state and the stack). An anchor is a data-shot element, else the\n outermost stat-card, chart-card, data-table, section, card or board data-slot, plus each open dialog-content,\n alert-dialog-content, sheet-content or peek panel; a hover, focus, keys or tooltip step under an open overlay is absent. Viewports come from\n .basalt/manifest.json (default 1800x1200 and 390x844). --dist serves a built SPA dir itself.\n A manifest whose every root is a `site` anchors each page's article, each section outside an article and each landing block with no data-shot (main when\n there are none), and writes rubric \"content\" to metrics.json: detect then reads it with no text-size cap and no empty-region rule.\n --out must resolve inside the project (the app dir in a monorepo, not the repo root); routes are\n separate arguments (zsh does not word-split $ROUTES).\n --out is required and must not exist yet: every round writes a fresh dir (shots-1, shots-2, …).\n .basalt/last-shot.json records the latest round (at, out, round).\n empty, loading and error reload the route with ?shot-state=<state>; the page obeys only when its query result goes through\n shotState() from basalt-ui/data (it acts under the runner, never on a production URL; its empty keeps the loaded data's shape). A state crop equal to rest is `states-ignored`.\n A real, signed-in app: [--local-storage <key>=<@env:NAME|@file:path>]… seeds localStorage (app origin\n only) before any page script; [--api <prefix>=<origin>]… (with --dist) proxies GET/HEAD under that\n prefix to the origin (other methods get 405 unless --api-allow-writes); [--header <name>=@env:NAME]… is\n added to every proxied request, to EVERY --api origin (never on a navigation; https required);\n [--wait <ms|networkidle>] adds ms of settle after the anchors render (a page goes to load, waits up to 3 s for its first anchor, then settles 300 ms), or\n `networkidle` to also wait up to 5 s for the network (a page with an open stream never idles and shoots anyway); [--auto-anchors] crops\n each card and table over 120×60 px (else main, section, header, form) on a page with no anchor. Values are never printed or\n written; a redirect, 401/403/404, 5xx or dead API fails every shot of that page. Shots of real data go to the\n reviewer subagent and so to its model provider: point --api at staging or synthetic data when the\n app holds other people's data. Example:\n basalt-ui shot /overview --dist dist --api /api=https://app.example.com \\\n --local-storage auth-token=@env:APP_TOKEN --header authorization=@env:APP_BEARER --auto-anchors\n\nshot detect [--out <dir>] [--lint <oxlint-json-file>] [--facts <dir|file.tsx>]\n The deterministic second review pass, no browser and no model: reads <out>/metrics.json (default: the\n out dir in .basalt/last-shot.json) and, with --lint, the basalt/* diagnostics of `oxlint --format json`\n output saved to a file. Writes <out>/detect.json and a findings table, content, then layout, then style:\n off-scale inset/gap/radius, nested radius step under 3 px, over 3 text or 2 figure sizes, an empty region of\n 40 % or more (a site round has neither size cap nor empty region), overlap, a touch target under the hit floor, document overflow, a state crop identical\n to rest, error shots, a missing scale or no anchors. Contrast is not read: axe owns it.\n --facts <dir|file.tsx> reads the .tsx files under <dir> (not *.test.tsx), or that one route file, and lists the words, phrases and constants\n the page says in several places (communication-5, P2). Without --out it is the whole run: no shot round,\n no score, no detect.json; with --out the facts join that round. --lint needs --out.\n Exit codes: 0 clean (P2/P3 findings are listed, not failing), 2 a P0 or P1 finding, 1 scan failure (missing\n or unreadable metrics.json or lint file, or detect.json cannot be written).\n P0 fails: broken or unreadable: an error shot; no anchors\n P1 fails: a rubric item fails (off-scale value, font sizes, empty region, nested radius, overlap, hit floor, document overflow, an ignored state, lint error)\n P2 noted, not failing: degraded: a lint warning\n P3 noted, not failing: polish: an off-scale value within 1 px of a step\n score = 100 - (25 per P0 + 10 per P1 + 3 per P2 + 1 per P3). A score can go below 0. No anchor\n measured: \"nothing measured\", no score.\n detect takes --out <dir>, never a positional.\n A component can declare a rest anchor absent in a URL state with data-shot-absent=\"empty error\": that\n cell is recorded `absent`, not `error`.\n\nlint [--file <path>… | --changed | --stats | --baseline] [--agent]\n oxlint, stylelint and the --basalt-* name check over the declared roots, then the eject ceiling of\n .basalt/budget.json. A finding is \"<file>:<line> <rule>: <message and fix>\"; exit 1 on a finding or\n a ceiling breach, and on a scan of zero files. --file lints the named files, --changed what git\n reports changed (nothing changed is clean). --agent is terse and exits 2 on a finding so a hook\n blocks. --stats prints findings, waivers per rule, seams per kind and ejects, and writes the\n record .basalt/record.txt: one line per waived rule and per seam use (own cell, custom marks or\n series, own frame content, hand-built card frame, custom field, filter slot, shell entry,\n declared control kind, form control, a Tree row's own icon, badge or trailing). Commit it; sync --check and\n doctor fail while it is stale. Nothing caps it: a new line shows in the diff. --stats exits 0\n with findings and 1 above the eject ceiling (raised by eject --raise).\n --baseline is for an app that takes the guards on with screens already written: it writes\n .basalt/baseline.json, the findings of a full scan counted per file and rule (parse errors and\n unused or reasonless directives never), and is refused while the file exists. Every lint run, the edit hooks\n included, then passes a file's rule at or under its count and reports all of it above. --stats\n lowers the counts, never raises them, and a full lint fails while the file holds more than is left.\n --hook <post-edit|stop|pre-edit> reads the event\n JSON on stdin and is called only by .basalt/hook.mjs; it is exempt from the unknown-flag exit 1\n because every hook failure exits 2.\n\ndoctor\n Fourteen checks on THIS install: manifest, version drift, peers, presets, lint scan, AGENTS block,\n skills and rules, the hook (run from a subdirectory on a seeded offender), the formatter fence,\n token sheets, the eject ceiling with the record, app wiring, what a 2.x install left and, with two or\n more locales, the translations (catalogues, strict compile, provider locale). Each is pass, fail or\n SKIPPED; SKIPPED exits non-zero. Every failure names the command or setup step that fixes it.\n\nmigrate --from <x.y.z> --profile <tokens|site|bridge|parts|app> [--json] [--check]\n The upgrade worklist: reads the app's imports and prints each migration row newer than --from that\n touches them (renames, removals, token and storage keys), with file:line, and at any --from each row\n for a source file the app holds (components/ui/<name>.tsx). Writes nothing. --check exits 1 while a\n removed symbol is still imported; --json prints the report. Read MIGRATING.md beside it.\n\ninit --profile <tokens|site|bridge|parts|app> [--root <path>]… [--tokens-out <css>] [--tokens-json-out <json>]\n [--extra <file>] [--accent <#hex>] [--neutral <name>] [--vibrancy <n>] [--selector <sel>] [--no-install]\n [--start] [--harness <claude-code,codex,opencode,pi>] [--locales <en,de,…>] [--catalogs <pattern>]…\n [--agents <path.md>] [--design <path.md>]\n The one door into an install. The profile is declared, never inferred (exit 1 without it); each --root\n (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 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 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 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 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 create-vite or create-astro file, recognised by hash, and then replaces it whole; any other file is kept as it is and doctor names the fix.\n --start (with --profile app) makes the app a TanStack Start host: tanstackStart() before the React plugin,\n src/router.tsx (getRouter), a root route with the document shell and the pre-paint scheme script, no main.tsx.\n The app owns @tanstack/react-start; init installs nothing for it.\n 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 `\"basalt\": { \"sibling\": true }`, which makes it an install of its own (references/migrate.md, \"The sibling app\").\n A site (static pages on Astro) writes no router scaffold; a stock astro.config is rewritten with basaltAstro(), any other is kept.\n On a 2.x install it reads the old manifest: removes each agent file 2.x placed that nobody edited,\n the .oxlintrc.json it seeded and its guard-hook entry, then writes the 3.x manifest (--root\n defaults to the 2.x basalt.roots). It leaves anything else, and doctor names it.\n\n --locales names the languages the app ships, the source one first; it writes `locales` in the manifest. With two or\n more, lint refuses literal text and doctor checks that every catalogue is complete, a language in the\n manifest's `partialLocales` excepted (docs/recipes/localise-app.md).\n At app it also wires that catalogue: Lingui at a pinned version, lingui.config.ts, the Vite plugin, the .po module\n declaration, a catalogue per language (the seeds' words translated where the package ships the language), a\n LocalizedProvider, seeds that take their words from it, and a check script that runs `lingui extract --clean &&\n lingui compile --strict` first. The compiled catalogues are ignored by git, the linter and the formatter.\n --catalogs (repeatable, quoted: 'packages/i18n/locales/*/{locale}.po') writes `catalogs` in the manifest. When none\n of them is the app's own src/locales/{locale}.po, the app keeps its catalogue elsewhere: init writes no catalogue,\n no wiring of one and no router seed, installs no Lingui and leaves the check script's catalogue step to the app.\n\n --harness names the agent harnesses the layer is placed for (default: the ones whose directory\n is in the repo, else claude-code); it writes `harnesses` in .basalt/manifest.json, which sync reads.\n\n --agents and --design name where an app in a monorepo keeps its AGENTS block and its DESIGN.md\n (apps/console/AGENTS.md, apps/console/DESIGN.md); they write `agents` and `design` in the manifest,\n which sync and doctor read. Default: AGENTS.md and DESIGN.md at the install root. The manifest key\n `report` replaces the block's one sentence on where a defect in basalt-ui goes.\n\nsync [--check] [--force]\n Renders every managed file (the basalt-* rules, skills and reviewer for each harness in `harnesses`,\n the AGENTS.md block, the preset files, the hook shim .basalt/hook.mjs and its entries in each\n harness's hook file (none with `hook: false`), every token\n sheet the manifest records) and compares bytes; it rewrites a ledger file of an older format; it refreshes an EXISTING install and never creates one (that\n is init). --check writes nothing and exits 1 on any difference. A managed file you edited is\n left and reported; --force overwrites it. A retired file is deleted if untouched, else left.\n An ejected primitive is three-way merged with the new seed (adopted: base advanced, file kept);\n a conflict leaves diff3 markers, advances the base and exits 1. An added block (add) is merged\n the same way, file by file.\n\nremove [--force]\n Takes the agent layer out: every file of the ledger, the AGENTS.md block, the hook entries and the\n shim, and writes `harnesses: []` so sync places nothing back. A file you edited stays (exit 1)\n unless --force. .basalt/, the token sheets and the presets stay: the app still imports basalt-ui.\n\ndoctor / sync / lint all resolve their project the same way: BASALT_CWD, else the\ninvocation cwd — nothing inferred, nothing descended into (sync alone looks UP for the manifest\nthat declares the directory).\n\nEvery subcommand accepts --help / -h to print this message and exit without running; `init --help`, `eject --help` and `add --help`\nprint their own flags and exit codes.\n--version / -v prints the resolved package version and exits 0 — the one command that proves\nWHICH basalt-ui ran, which a `bunx` cache can otherwise make a lie. An unknown command or an\nunrecognized flag exits 1 and names what it did not understand; neither is ever ignored.";
|
|
96
101
|
export {
|
|
97
102
|
COMMAND_OPTIONS,
|
|
98
103
|
USAGE,
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -59,7 +59,8 @@ export declare const hasViteEntry: (dir: string) => boolean;
|
|
|
59
59
|
* Where the Vite app lives relative to the install root `root` (manifest, `.claude/`, AGENTS block).
|
|
60
60
|
* ONE resolution for `doctor`, `sync` and `init`, in order: `basalt.app` in the root package.json;
|
|
61
61
|
* else the single workspace package that depends on basalt-ui AND has a Vite entry; else `root`
|
|
62
|
-
* itself (a single-package app).
|
|
62
|
+
* itself (a single-package app). Among two such packages the one the manifest declares an app root in
|
|
63
|
+
* is it; else the choice is not inferable, an error. A
|
|
63
64
|
* package declaring `basalt.sibling` is a declared second install and never a candidate.
|
|
64
65
|
*/
|
|
65
66
|
export declare function resolveAppDir(root: string): AppResolution;
|
|
@@ -76,16 +77,16 @@ export type WorkspacePackage = {
|
|
|
76
77
|
readonly name: string;
|
|
77
78
|
readonly dir: string;
|
|
78
79
|
};
|
|
79
|
-
/** {@link collectWorkspacePackages}'s return: the packages plus whether a
|
|
80
|
+
/** {@link collectWorkspacePackages}'s return: the packages plus whether a workspace list existed. */
|
|
80
81
|
export type WorkspaceWalk = {
|
|
81
82
|
readonly packages: readonly WorkspacePackage[];
|
|
82
83
|
readonly hasWorkspacesField: boolean;
|
|
83
84
|
};
|
|
84
85
|
/**
|
|
85
|
-
* Every workspace package declared by `cwd`'s root `package.json` (array or `{ packages }` form)
|
|
86
|
-
* PLUS the root manifest itself, labelled `"{name} (root)"` (it commonly carries a hoisted `ai`
|
|
86
|
+
* Every workspace package declared by `cwd`'s root `package.json` (array or `{ packages }` form)
|
|
87
|
+
* or its `pnpm-workspace.yaml`, PLUS the root manifest itself, labelled `"{name} (root)"` (it commonly carries a hoisted `ai`
|
|
87
88
|
* dev dependency that can skew against a package's major). `hasWorkspacesField` is `false` when
|
|
88
|
-
* there is no `package.json`,
|
|
89
|
+
* there is no `package.json`, or neither file holds a list this recognizes; never throws.
|
|
89
90
|
*/
|
|
90
91
|
export declare function collectWorkspacePackages(cwd: string): WorkspaceWalk;
|
|
91
92
|
/** Narrows to a string array — shared by `collectWorkspacePackages`'s two `workspaces` shapes. */
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"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"}
|
package/dist/cli/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { existsSync, readdirSync, statSync } from "node:fs";
|
|
3
3
|
import { dirname, isAbsolute, relative, resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { parse as parseYaml } from "yaml";
|
|
5
6
|
import { RULE_NAMES, SKILL_NAMES } from "../surfaces.js";
|
|
6
7
|
import { docs, parts } from "./docs/index.js";
|
|
7
8
|
import { doctor } from "./doctor/index.js";
|
|
@@ -11,6 +12,7 @@ import { eject } from "./eject/index.js";
|
|
|
11
12
|
import { EJECT_HELP } from "./eject/help.js";
|
|
12
13
|
import { COMMAND_OPTIONS, USAGE, unknownFlag } from "./help.js";
|
|
13
14
|
import { init } from "./init/index.js";
|
|
15
|
+
import { readManifest } from "./manifest.js";
|
|
14
16
|
import { isHookCall, lint } from "./lint/index.js";
|
|
15
17
|
import { migrate } from "./migrate/index.js";
|
|
16
18
|
import { shot } from "./shot/index.js";
|
|
@@ -104,6 +106,11 @@ ${items.join("\n")}
|
|
|
104
106
|
}
|
|
105
107
|
const appRelative = (root, dir) => relativePosix(root, dir).replace(/^\.\/?/, "");
|
|
106
108
|
const hasViteEntry = (dir) => existsSync(resolve(dir, "src/main.tsx")) || existsSync(resolve(dir, "index.html"));
|
|
109
|
+
function declaredAppRoots(root) {
|
|
110
|
+
const read = readManifest(root);
|
|
111
|
+
if (read === null || "error" in read) return [];
|
|
112
|
+
return Object.entries(read.manifest.roots).filter(([, profile]) => profile !== "tokens" && profile !== "site").map(([dir]) => dir.replace(/^(?:\.\/)+/, "").replace(/\/+$/, ""));
|
|
113
|
+
}
|
|
107
114
|
function resolveAppDir(root) {
|
|
108
115
|
const self = { dir: root, rel: "" };
|
|
109
116
|
const explicit = readBasaltConfig(root).app;
|
|
@@ -121,8 +128,13 @@ function resolveAppDir(root) {
|
|
|
121
128
|
(pkg) => pkg.dir !== root && hasDependency(pkg.dir, "basalt-ui") && hasViteEntry(pkg.dir) && readBasaltConfig(pkg.dir).sibling !== true
|
|
122
129
|
);
|
|
123
130
|
if (candidates.length === 0) return self;
|
|
124
|
-
const
|
|
125
|
-
|
|
131
|
+
const appRoots = declaredAppRoots(root);
|
|
132
|
+
const declared = candidates.filter((pkg) => {
|
|
133
|
+
const rel = appRelative(root, pkg.dir);
|
|
134
|
+
return appRoots.some((r) => r === rel || r.startsWith(`${rel}/`));
|
|
135
|
+
});
|
|
136
|
+
const [only] = declared.length === 1 ? declared : candidates;
|
|
137
|
+
if ((declared.length === 1 || candidates.length === 1) && only !== void 0) {
|
|
126
138
|
return { dir: only.dir, rel: appRelative(root, only.dir) };
|
|
127
139
|
}
|
|
128
140
|
const names = candidates.map((pkg) => appRelative(root, pkg.dir)).join(", ");
|
|
@@ -175,7 +187,7 @@ function expandPatternSegments(baseDir, segments) {
|
|
|
175
187
|
function expandWorkspaceGlobs(cwd, patterns) {
|
|
176
188
|
const expand = (pattern) => expandPatternSegments(
|
|
177
189
|
cwd,
|
|
178
|
-
pattern.split("/").filter((s) => s.length > 0)
|
|
190
|
+
pattern.split("/").filter((s) => s.length > 0 && s !== ".")
|
|
179
191
|
);
|
|
180
192
|
const excluded = new Set(
|
|
181
193
|
patterns.filter((pattern) => pattern.startsWith("!")).flatMap((pattern) => expand(pattern.replace(/^!+/, "")))
|
|
@@ -188,13 +200,25 @@ function expandWorkspaceGlobs(cwd, patterns) {
|
|
|
188
200
|
if (existsSync(resolve(abs, "package.json"))) dirs.push(abs);
|
|
189
201
|
}
|
|
190
202
|
}
|
|
191
|
-
return dirs;
|
|
203
|
+
return [...new Set(dirs)];
|
|
204
|
+
}
|
|
205
|
+
function pnpmWorkspacePatterns(cwd) {
|
|
206
|
+
const text = readIfExists(resolve(cwd, "pnpm-workspace.yaml"));
|
|
207
|
+
if (text === null) return [];
|
|
208
|
+
try {
|
|
209
|
+
const packages = parseYaml(text)?.packages;
|
|
210
|
+
return isStringArray(packages) ? packages : [];
|
|
211
|
+
} catch {
|
|
212
|
+
return [];
|
|
213
|
+
}
|
|
192
214
|
}
|
|
193
215
|
function collectWorkspacePackages(cwd) {
|
|
194
216
|
const parsed = readPackageJson(cwd);
|
|
195
217
|
if (parsed === null) return { packages: [], hasWorkspacesField: false };
|
|
196
|
-
const
|
|
197
|
-
|
|
218
|
+
const declared = isStringArray(parsed.workspaces) ? parsed.workspaces : parsed.workspaces !== null && typeof parsed.workspaces === "object" && isStringArray(parsed.workspaces.packages) ? parsed.workspaces.packages : null;
|
|
219
|
+
const pnpm = pnpmWorkspacePatterns(cwd);
|
|
220
|
+
if (declared === null && pnpm.length === 0) return { packages: [], hasWorkspacesField: false };
|
|
221
|
+
const patterns = [...declared ?? [], ...pnpm];
|
|
198
222
|
const rootName = parsed.name && parsed.name.length > 0 ? `${parsed.name} (root)` : "(root)";
|
|
199
223
|
const workspacePackages = expandWorkspaceGlobs(cwd, patterns).map((dir) => ({
|
|
200
224
|
name: readPackageName(dir),
|
|
@@ -211,7 +235,14 @@ function isStringArray(value) {
|
|
|
211
235
|
function run(argv, cwd = process.cwd()) {
|
|
212
236
|
const [cmd, ...flags] = argv;
|
|
213
237
|
if (cmd === "help" || cmd === "--help" || cmd === "-h" || flags.includes("--help") || flags.includes("-h")) {
|
|
214
|
-
|
|
238
|
+
const start = USAGE.indexOf("\n\ninit --profile");
|
|
239
|
+
const initHelp = USAGE.slice(start, USAGE.indexOf("\n\nsync [--check]", start)).trim();
|
|
240
|
+
const own = {
|
|
241
|
+
add: ADD_HELP,
|
|
242
|
+
eject: EJECT_HELP,
|
|
243
|
+
init: initHelp
|
|
244
|
+
};
|
|
245
|
+
console.log(own[cmd ?? ""] ?? USAGE);
|
|
215
246
|
return 0;
|
|
216
247
|
}
|
|
217
248
|
if (cmd === "--version" || cmd === "-v" || cmd === "version") {
|
package/dist/cli/init/index.d.ts
CHANGED
|
@@ -50,6 +50,16 @@ export declare const FLAGS: {
|
|
|
50
50
|
readonly locales: {
|
|
51
51
|
readonly type: "string";
|
|
52
52
|
};
|
|
53
|
+
readonly agents: {
|
|
54
|
+
readonly type: "string";
|
|
55
|
+
};
|
|
56
|
+
readonly design: {
|
|
57
|
+
readonly type: "string";
|
|
58
|
+
};
|
|
59
|
+
readonly catalogs: {
|
|
60
|
+
readonly type: "string";
|
|
61
|
+
readonly multiple: true;
|
|
62
|
+
};
|
|
53
63
|
};
|
|
54
64
|
/** The flags as `Args`, or the first reason they are not a legal call. */
|
|
55
65
|
export declare function parseInit(argv: readonly string[]): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/init/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/init/index.ts"],"names":[],"mappings":"AAgEA,OAAO,KAAK,EAAE,IAAI,EAAO,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhD,MAAM,MAAM,QAAQ,GAAG;IACrB,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gDAAgD;IAChD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAC1C,0GAA0G;IAC1G,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;CACvD,CAAA;AAaD,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBR,CAAA;AAmBV,0EAA0E;AAC1E,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAkGrF;AA0BD,wBAAsB,IAAI,CACxB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,QAAa,GAClB,OAAO,CAAC,MAAM,CAAC,CAgIjB"}
|