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
package/dist/cli/lint/hook.js
CHANGED
|
@@ -9,6 +9,7 @@ import { CLI_OWNED_KEYS, MANIFEST_PATH, parseManifest } from "../manifest.js";
|
|
|
9
9
|
import { OXLINT_PRESET_FILE, STYLELINT_PRESET_FILE } from "../presets.js";
|
|
10
10
|
import { parseJsonc } from "../source-text.js";
|
|
11
11
|
import { changedFiles, isScanned, scan } from "./engine.js";
|
|
12
|
+
import { applyBaseline, BASELINE_PATH, readBaseline } from "./baseline.js";
|
|
12
13
|
import { RECORD_COMMAND, RECORD_PATH } from "./record.js";
|
|
13
14
|
import { HOOK_ADAPTERS, HOOK_TARGETS, MANAGED_DIRS, harnessesOf } from "../harness.js";
|
|
14
15
|
import { SHIM } from "./settings.js";
|
|
@@ -90,10 +91,11 @@ function editedFiles(project, input) {
|
|
|
90
91
|
if (typeof command !== "string" || !command.includes("*** Begin Patch")) return [];
|
|
91
92
|
return patchFiles(command).flatMap((p) => inside(p.path, p));
|
|
92
93
|
}
|
|
94
|
+
const unheld = (project, files) => applyBaseline(scan(project, files), readBaseline(project.root)).reported;
|
|
93
95
|
function postEdit(project, input) {
|
|
94
96
|
const scanned = editedFiles(project, input).filter((e) => existsSync(e.abs) && isScanned(project, e.rel)).map((e) => e.rel);
|
|
95
97
|
if (scanned.length === 0) return 0;
|
|
96
|
-
const findings =
|
|
98
|
+
const findings = unheld(project, [...new Set(scanned)]);
|
|
97
99
|
return report(hasStopEvent(project) ? findings.filter((f) => !HELD_TO_STOP.has(f.id)) : findings);
|
|
98
100
|
}
|
|
99
101
|
function stopCounter(project, session) {
|
|
@@ -105,7 +107,7 @@ function stop(project, input) {
|
|
|
105
107
|
if (input.stop_hook_active === true || typeof session !== "string" || session === "") return 0;
|
|
106
108
|
const counter = stopCounter(project, session);
|
|
107
109
|
if (existsSync(counter)) return 0;
|
|
108
|
-
const findings =
|
|
110
|
+
const findings = unheld(project, changedFiles(project));
|
|
109
111
|
if (findings.length === 0) return 0;
|
|
110
112
|
writeFileSync(counter, "1");
|
|
111
113
|
return report(findings);
|
|
@@ -153,7 +155,7 @@ function manifestDenial(current, next) {
|
|
|
153
155
|
if ("error" in was || !isTranslated(was.manifest) || isTranslated(read.manifest)) return null;
|
|
154
156
|
return `this edit takes ${MANIFEST_PATH} from two or more \`locales\` to fewer, which switches the literal-text guards off; keep every language the app ships, and waive a single line with a reasoned directive.`;
|
|
155
157
|
}
|
|
156
|
-
return `${MANIFEST_PATH} keys ${changed.join(", ")} are written by basalt-ui (\`init\`, \`sync\`, \`eject <name> --reason\`); edit only the consumer keys (profile, roots, locales, catalogs, bespoke, deepRender, authoredContent, viewports, classPrefixes, harnesses, hook, tokens, extra), then run \`basalt-ui sync\`.`;
|
|
158
|
+
return `${MANIFEST_PATH} keys ${changed.join(", ")} are written by basalt-ui (\`init\`, \`sync\`, \`eject <name> --reason\`); edit only the consumer keys (profile, roots, locales, partialLocales, catalogs, wordModules, bespoke, deepRender, authoredContent, viewports, classPrefixes, harnesses, hook, tokens, extra), then run \`basalt-ui sync\`.`;
|
|
157
159
|
}
|
|
158
160
|
const MANAGED_AGENT_FILE = new RegExp(
|
|
159
161
|
`^(?:${MANAGED_DIRS.map((d) => d.replaceAll(".", "\\.")).join("|")})/basalt-`
|
|
@@ -167,6 +169,9 @@ function denial(project, rel, next, current) {
|
|
|
167
169
|
if (rel === RECORD_PATH) {
|
|
168
170
|
return `${RECORD_PATH} is the count of this app's waivers and seams; ${RECORD_COMMAND} writes it, never edit it by hand.`;
|
|
169
171
|
}
|
|
172
|
+
if (rel === BASELINE_PATH) {
|
|
173
|
+
return `${BASELINE_PATH} is the adoption baseline, which only goes down: fix the finding at its source; \`basalt-ui lint --stats\` lowers it.`;
|
|
174
|
+
}
|
|
170
175
|
if (rel === MANIFEST_PATH) return manifestDenial(current, next);
|
|
171
176
|
if (rel === ".basalt" || rel.startsWith(".basalt/")) {
|
|
172
177
|
return ".basalt/** is basalt-ui's ledger and shim; `basalt-ui init`, `sync` and `eject <name> --reason` write it, never edit it by hand. The consumer keys of .basalt/manifest.json are the one exception.";
|
package/dist/cli/lint/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/lint/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/lint/index.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;CAOf,CAAA;AAIV,6DAA6D;AAC7D,eAAO,MAAM,UAAU,GAAI,OAAO,SAAS,MAAM,EAAE,KAAG,OACQ,CAAA;AA+E9D,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAsH5E"}
|
package/dist/cli/lint/index.js
CHANGED
|
@@ -4,8 +4,17 @@ import { parseArgs } from "node:util";
|
|
|
4
4
|
import { BUDGET_PATH, countedFigure, RAISE_COMMAND, readBudget } from "../budget/index.js";
|
|
5
5
|
import { noteRelocation, resolveProjectDir } from "../index.js";
|
|
6
6
|
import { installAllCommand } from "../package-manager.js";
|
|
7
|
-
import {
|
|
8
|
-
|
|
7
|
+
import {
|
|
8
|
+
applyBaseline,
|
|
9
|
+
BASELINE_PATH,
|
|
10
|
+
baselineSize,
|
|
11
|
+
countFindings,
|
|
12
|
+
lowerBaseline,
|
|
13
|
+
readBaseline,
|
|
14
|
+
writeBaseline
|
|
15
|
+
} from "./baseline.js";
|
|
16
|
+
import { changedFiles, inRoots, loadProject, presetProblems, rootFiles, scan } from "./engine.js";
|
|
17
|
+
import { capFindings, findingLine, HOOK_EVENTS, runHookEvent } from "./hook.js";
|
|
9
18
|
import { RECORD_PATH, writeRecord } from "./record.js";
|
|
10
19
|
import { countEjects, countSource, formatStats, tally } from "./stats.js";
|
|
11
20
|
const LINT_OPTIONS = {
|
|
@@ -13,6 +22,7 @@ const LINT_OPTIONS = {
|
|
|
13
22
|
agent: { type: "boolean" },
|
|
14
23
|
changed: { type: "boolean" },
|
|
15
24
|
stats: { type: "boolean" },
|
|
25
|
+
baseline: { type: "boolean" },
|
|
16
26
|
hook: { type: "string" }
|
|
17
27
|
};
|
|
18
28
|
const plural = (n, word) => `${n} ${word}${n === 1 ? "" : "s"}`;
|
|
@@ -64,6 +74,22 @@ function countAll(project, files, findings) {
|
|
|
64
74
|
};
|
|
65
75
|
return { stats, source };
|
|
66
76
|
}
|
|
77
|
+
function writeFirstBaseline(project, findings) {
|
|
78
|
+
const counts = countFindings(findings);
|
|
79
|
+
const { reported } = applyBaseline(findings, counts);
|
|
80
|
+
if (reported.length > 0) {
|
|
81
|
+
console.log(reported.map(findingLine).join("\n"));
|
|
82
|
+
}
|
|
83
|
+
const size = baselineSize(counts);
|
|
84
|
+
if (size === 0) console.log(`nothing to baseline; ${BASELINE_PATH} not written`);
|
|
85
|
+
else {
|
|
86
|
+
writeBaseline(project.root, counts);
|
|
87
|
+
console.log(
|
|
88
|
+
`${BASELINE_PATH}: ${plural(size, "finding")} in ${plural(Object.keys(counts).length, "file")} baselined; commit it`
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
return reported.length > 0 ? 1 : 0;
|
|
92
|
+
}
|
|
67
93
|
function lint(flags, invocationCwd) {
|
|
68
94
|
if (isHookCall(flags)) return lintHook(flags, invocationCwd);
|
|
69
95
|
const fail = (why) => (console.error(`✖ basalt-ui lint: ${why}`), 1);
|
|
@@ -75,10 +101,28 @@ function lint(flags, invocationCwd) {
|
|
|
75
101
|
}
|
|
76
102
|
if (files.length > 0 && values.changed === true)
|
|
77
103
|
return fail("--file and --changed are alternatives");
|
|
104
|
+
const wantsBaseline = values.baseline === true;
|
|
105
|
+
if (wantsBaseline && (files.length > 0 || values.changed === true || wantsStats || values.agent === true)) {
|
|
106
|
+
return fail("--baseline counts the whole install; drop every other flag");
|
|
107
|
+
}
|
|
78
108
|
const resolved = resolveProjectDir(invocationCwd);
|
|
79
109
|
noteRelocation("lint", resolved);
|
|
80
110
|
const project = loadProject(resolved.dir);
|
|
81
111
|
if ("error" in project) return fail(project.error);
|
|
112
|
+
let baseline;
|
|
113
|
+
try {
|
|
114
|
+
baseline = readBaseline(project.root);
|
|
115
|
+
} catch (error) {
|
|
116
|
+
return fail(error.message);
|
|
117
|
+
}
|
|
118
|
+
if (wantsBaseline) {
|
|
119
|
+
if (project.manifest === null) return fail("--baseline needs an install: run `basalt-ui init`");
|
|
120
|
+
if (baseline !== null) {
|
|
121
|
+
return fail(
|
|
122
|
+
`${BASELINE_PATH} exists and only goes down (\`basalt-ui lint --stats\`); fix new findings at their source`
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
82
126
|
const partial = files.length > 0 || values.changed === true;
|
|
83
127
|
let targets;
|
|
84
128
|
if (files.length > 0) {
|
|
@@ -102,16 +146,18 @@ function lint(flags, invocationCwd) {
|
|
|
102
146
|
`scanned 0 files: declare the source roots (\`roots\` in .basalt/manifest.json, or "basalt": { "roots": [...] } in package.json) and check they hold code`
|
|
103
147
|
);
|
|
104
148
|
}
|
|
105
|
-
|
|
149
|
+
const unloaded = project.manifest === null ? [] : presetProblems(project, targets);
|
|
150
|
+
if (unloaded.length > 0) return fail(unloaded.join("; "));
|
|
151
|
+
let scanned;
|
|
106
152
|
try {
|
|
107
|
-
|
|
153
|
+
scanned = scan(project, targets);
|
|
108
154
|
} catch (error) {
|
|
109
155
|
return fail(`${error.message}`);
|
|
110
156
|
}
|
|
111
|
-
if (
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
157
|
+
if (wantsBaseline) return writeFirstBaseline(project, scanned);
|
|
158
|
+
const { reported: findings, held } = applyBaseline(scanned, baseline);
|
|
159
|
+
if (findings.length > 0) say(agent ? capFindings(findings) : findings.map(findingLine).join("\n"));
|
|
160
|
+
if (held > 0 && !agent) say(`${plural(held, "finding")} held by ${BASELINE_PATH}`);
|
|
115
161
|
const code = findings.length > 0 ? agent ? 2 : 1 : 0;
|
|
116
162
|
if (partial) return code;
|
|
117
163
|
const budget = project.manifest === null ? null : readBudget(project.root);
|
|
@@ -125,6 +171,10 @@ function lint(flags, invocationCwd) {
|
|
|
125
171
|
`${RECORD_PATH}: ${writeRecord(project.root, source) ? "written; commit it" : "unchanged"}`
|
|
126
172
|
);
|
|
127
173
|
}
|
|
174
|
+
if (baseline !== null) {
|
|
175
|
+
const lowered = writeBaseline(project.root, lowerBaseline(baseline, scanned));
|
|
176
|
+
say(`${BASELINE_PATH}: ${lowered ? "lowered; commit it" : "unchanged"}`);
|
|
177
|
+
}
|
|
128
178
|
ejects = stats.counts.ejects;
|
|
129
179
|
} else ejects = countEjects(project);
|
|
130
180
|
if (budget !== null && "error" in budget) return fail(budget.error);
|
|
@@ -135,6 +185,15 @@ function lint(flags, invocationCwd) {
|
|
|
135
185
|
return 1;
|
|
136
186
|
}
|
|
137
187
|
if (wantsStats) return 0;
|
|
188
|
+
if (baseline !== null) {
|
|
189
|
+
const slack = baselineSize(baseline) - baselineSize(lowerBaseline(baseline, scanned));
|
|
190
|
+
if (slack > 0) {
|
|
191
|
+
say(
|
|
192
|
+
`${BASELINE_PATH} holds ${plural(slack, "finding")} more than is left; run \`basalt-ui lint --stats\` and commit it`
|
|
193
|
+
);
|
|
194
|
+
return agent ? 2 : 1;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
138
197
|
if (code === 0 && !agent)
|
|
139
198
|
say(`✓ basalt-ui lint: no findings in ${plural(targets.length, "file")}.`);
|
|
140
199
|
return code;
|
package/dist/cli/manifest.d.ts
CHANGED
|
@@ -2,6 +2,15 @@ import type { Harness } from './harness.js';
|
|
|
2
2
|
export declare const MANIFEST_PATH = ".basalt/manifest.json";
|
|
3
3
|
export declare const PROFILES: readonly ["tokens", "site", "bridge", "parts", "app"];
|
|
4
4
|
export type Profile = (typeof PROFILES)[number];
|
|
5
|
+
/** Where the block and the design record live unless the manifest says otherwise. */
|
|
6
|
+
export declare const AGENTS_FILE = "AGENTS.md";
|
|
7
|
+
export declare const DESIGN_FILE = "DESIGN.md";
|
|
8
|
+
/** The block's sentence on a defect in basalt-ui when the manifest sets no `report`. */
|
|
9
|
+
export declare const DEFAULT_REPORT = "send it with a minimal reproduction (file, command, output) to the tracker in `bugs.url` of `node_modules/basalt-ui/package.json`.";
|
|
10
|
+
/** The file the block is spliced into, relative to the install root. */
|
|
11
|
+
export declare const agentsPath: (manifest: Pick<Manifest, "agents">) => string;
|
|
12
|
+
/** The design record, relative to the install root. */
|
|
13
|
+
export declare const designPath: (manifest: Pick<Manifest, "design">) => string;
|
|
5
14
|
/**
|
|
6
15
|
* Whether every root that takes code is a `site`: the declared roots above `tokens` (a token sheet beside a site does not
|
|
7
16
|
* make it an app), else the manifest's own profile. The one reading sync, doctor and shot share.
|
|
@@ -32,6 +41,12 @@ export type Manifest = {
|
|
|
32
41
|
* every language's catalogue is complete.
|
|
33
42
|
*/
|
|
34
43
|
locales?: string[];
|
|
44
|
+
/**
|
|
45
|
+
* Languages of `locales`, never the source one, whose catalogue is still being translated: the app
|
|
46
|
+
* ships them and its catalogue tool falls back to the source language, so `doctor` requires their
|
|
47
|
+
* catalogue files but not every message in them.
|
|
48
|
+
*/
|
|
49
|
+
partialLocales?: string[];
|
|
35
50
|
/**
|
|
36
51
|
* Where a language's message catalogues live, relative to the install root: paths with
|
|
37
52
|
* `{locale}`, where `*` stands for one directory or file name. Absent reads as
|
|
@@ -40,9 +55,16 @@ export type Manifest = {
|
|
|
40
55
|
catalogs?: string[];
|
|
41
56
|
/**
|
|
42
57
|
* Directories (relative to the install root) that draw their own surface, a game table or a
|
|
43
|
-
* seating plan: `primitive-bypass` lets positioned geometry and hand-drawn marks through there
|
|
58
|
+
* seating plan: `primitive-bypass` lets positioned geometry and hand-drawn marks through there,
|
|
59
|
+
* and stylelint lets status, chart and brand color paint a surface and a grid track be a length.
|
|
44
60
|
*/
|
|
45
61
|
bespoke?: string[];
|
|
62
|
+
/**
|
|
63
|
+
* A `site` root's words modules (globs relative to the install root, each naming `.ts` files): a
|
|
64
|
+
* site keeps a language's words in a module instead of a message catalogue, so the literal-text
|
|
65
|
+
* guards are off in them. Pages and parts stay checked.
|
|
66
|
+
*/
|
|
67
|
+
wordModules?: string[];
|
|
46
68
|
/** The agent harnesses the layer is placed for; absent reads as Claude Code alone, `[]` places none. */
|
|
47
69
|
harnesses?: Harness[];
|
|
48
70
|
/** `false` wires no edit hook in any harness; absent is true. */
|
|
@@ -50,6 +72,22 @@ export type Manifest = {
|
|
|
50
72
|
tokens: TokenOutput[];
|
|
51
73
|
/** The `--extra` file `tokens:css` reads. */
|
|
52
74
|
extra?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Where the managed block lives, relative to the install root: the AGENTS file of the app this
|
|
77
|
+
* install serves (`apps/console/AGENTS.md`), so the repo's root file stays about the repo.
|
|
78
|
+
* Absent reads as `AGENTS.md`.
|
|
79
|
+
*/
|
|
80
|
+
agents?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Where the design record lives, relative to the install root (`apps/console/DESIGN.md`): `doctor`
|
|
83
|
+
* reads it there, `init` seeds it there and the block names it. Absent reads as `DESIGN.md`.
|
|
84
|
+
*/
|
|
85
|
+
design?: string;
|
|
86
|
+
/**
|
|
87
|
+
* The block's one sentence on a defect in basalt-ui (where to send it): a repo whose agents file
|
|
88
|
+
* issues through another channel names it here. Absent reads as `DEFAULT_REPORT`.
|
|
89
|
+
*/
|
|
90
|
+
report?: string;
|
|
53
91
|
/** A sibling install's name prefix for its repo-root rules and skills (`basalt-v3-`, `basalt-v3-<dir>-`). */
|
|
54
92
|
sibling?: string;
|
|
55
93
|
/** Fields this version does not know, kept so a newer manifest survives an older `sync`. */
|
|
@@ -67,12 +105,17 @@ export type ManifestRead = {
|
|
|
67
105
|
/**
|
|
68
106
|
* The keys the CLI writes: `init`, `sync` and `eject` own them, and the pre-edit guard refuses a
|
|
69
107
|
* hand edit that changes one. Every other key is the consumer's to edit: `profile`, `roots`,
|
|
70
|
-
* `locales`, `catalogs`, `bespoke`, `deepRender`, `authoredContent`, `viewports`, `classPrefixes`, `harnesses`, `hook`,
|
|
71
|
-
* `tokens`, `extra`.
|
|
108
|
+
* `locales`, `partialLocales`, `catalogs`, `wordModules`, `bespoke`, `deepRender`, `authoredContent`, `viewports`, `classPrefixes`, `harnesses`, `hook`,
|
|
109
|
+
* `agents`, `design`, `report`, `tokens`, `extra`.
|
|
72
110
|
*/
|
|
73
111
|
export declare const CLI_OWNED_KEYS: readonly ["format", "version", "managed", "ejected", "sibling"];
|
|
74
112
|
/** A well-formed BCP 47 tag (`en`, `de-CH`, `zh-Hans`). */
|
|
75
113
|
export declare const isLocaleTag: (tag: string) => boolean;
|
|
114
|
+
export declare const isCatalogPattern: (pattern: string) => boolean;
|
|
115
|
+
/** A markdown file below the install root: relative, no glob, not a directory. */
|
|
116
|
+
export declare const isMarkdownFile: (path: string) => boolean;
|
|
117
|
+
/** A declared root as a clean relative path (`./src/` -> `src`, the root itself -> `.`). */
|
|
118
|
+
export declare const cleanRoot: (raw: string) => string;
|
|
76
119
|
/** Parses manifest text; an `error` names the first thing wrong. */
|
|
77
120
|
export declare function parseManifest(text: string): ManifestRead;
|
|
78
121
|
/** The canonical bytes: fixed key order, sorted maps, two-space indent, one trailing newline. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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K,MAAM,KAAG,OAMzC,CAAA;AACD,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,KAAG,OAC4C,CAAA;AAS/F,kFAAkF;AAClF,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,OACgD,CAAA;AAM9F,4FAA4F;AAC5F,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,KAAG,MACkB,CAAA;AAgC1D,oEAAoE;AACpE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAyJxD;AAKD,iGAAiG;AACjG,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,QAAQ,GAAG,MAAM,CA8BrD;AAED,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAM7D;AAED,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAMnE"}
|
package/dist/cli/manifest.js
CHANGED
|
@@ -4,6 +4,11 @@ import { isHarness } from "./harness.js";
|
|
|
4
4
|
import { parseLegacyLedger } from "./legacy-2x.js";
|
|
5
5
|
const MANIFEST_PATH = ".basalt/manifest.json";
|
|
6
6
|
const PROFILES = ["tokens", "site", "bridge", "parts", "app"];
|
|
7
|
+
const AGENTS_FILE = "AGENTS.md";
|
|
8
|
+
const DESIGN_FILE = "DESIGN.md";
|
|
9
|
+
const DEFAULT_REPORT = "send it with a minimal reproduction (file, command, output) to the tracker in `bugs.url` of `node_modules/basalt-ui/package.json`.";
|
|
10
|
+
const agentsPath = (manifest) => manifest.agents ?? AGENTS_FILE;
|
|
11
|
+
const designPath = (manifest) => manifest.design ?? DESIGN_FILE;
|
|
7
12
|
function isSiteManifest(manifest) {
|
|
8
13
|
const declared = Object.values(manifest.roots).filter((profile) => profile !== "tokens");
|
|
9
14
|
return (declared.length > 0 ? declared : [manifest.profile]).every(
|
|
@@ -26,10 +31,15 @@ const KNOWN = [
|
|
|
26
31
|
"tokens",
|
|
27
32
|
"extra",
|
|
28
33
|
"sibling",
|
|
34
|
+
"agents",
|
|
35
|
+
"design",
|
|
36
|
+
"report",
|
|
29
37
|
"harnesses",
|
|
30
38
|
"hook",
|
|
31
39
|
"locales",
|
|
40
|
+
"partialLocales",
|
|
32
41
|
"catalogs",
|
|
42
|
+
"wordModules",
|
|
33
43
|
...LISTS
|
|
34
44
|
];
|
|
35
45
|
const isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
@@ -44,7 +54,23 @@ const isCatalogPattern = (pattern) => pattern.includes("{locale}") && !/^([/\\]|
|
|
|
44
54
|
const isProfile = (v) => PROFILES.includes(v);
|
|
45
55
|
const isStrings = (v) => Array.isArray(v) && v.every((s) => typeof s === "string");
|
|
46
56
|
const isRelative = (root) => root !== "" && !/^([/\\]|[a-zA-Z]:)/.test(root) && !/\n|\r/.test(root) && !root.split("/").includes("..");
|
|
57
|
+
const isMarkdownFile = (path) => isRelative(path) && !path.startsWith("./") && /\.md$/i.test(path) && !/[*?[\]{}]/.test(path);
|
|
47
58
|
const isBespokeDir = (dir) => isRelative(dir) && dir.split("/").some((segment) => segment !== "" && segment !== ".") && !/[*?[\]{}]/.test(dir);
|
|
59
|
+
const cleanRoot = (raw) => raw.replace(/^(?:\.\/)+/, "").replace(/\/+$/, "") || ".";
|
|
60
|
+
const within = (path, root) => root === "" || path === root || path.startsWith(`${root}/`);
|
|
61
|
+
function isWordModule(glob, profile, roots) {
|
|
62
|
+
if (!isRelative(glob) || /^(?:\.\/|!)/.test(glob) || !/\.[cm]?ts$/.test(glob)) return false;
|
|
63
|
+
const segments = glob.split("/");
|
|
64
|
+
if (segments.some((segment) => segment === "" || segment === ".")) return false;
|
|
65
|
+
const wild = segments.findIndex((segment) => /[*?[\]{}]/.test(segment));
|
|
66
|
+
const dir = segments.slice(0, wild === -1 ? -1 : wild).join("/");
|
|
67
|
+
const declared = Object.entries(roots).map(
|
|
68
|
+
([root, of]) => [cleanRoot(root).replace(/^\.$/, ""), of]
|
|
69
|
+
);
|
|
70
|
+
const owner = declared.filter(([root]) => within(dir, root)).toSorted(([a], [b]) => b.length - a.length)[0];
|
|
71
|
+
const own = declared.length === 0 ? profile : owner?.[1];
|
|
72
|
+
return own === "site" && declared.every(([root, of]) => of === "site" || !within(root, dir));
|
|
73
|
+
}
|
|
48
74
|
const isTokenOutput = (v) => isRecord(v) && typeof v["out"] === "string" && (v["format"] === "css" || v["format"] === "json") && isStrings(v["flags"]);
|
|
49
75
|
function parseManifest(text) {
|
|
50
76
|
const bad = (why) => ({ error: `${MANIFEST_PATH}: ${why}` });
|
|
@@ -75,10 +101,15 @@ function parseManifest(text) {
|
|
|
75
101
|
tokens = [],
|
|
76
102
|
extra,
|
|
77
103
|
sibling,
|
|
104
|
+
agents,
|
|
105
|
+
design,
|
|
106
|
+
report,
|
|
78
107
|
harnesses,
|
|
79
108
|
hook,
|
|
80
109
|
locales,
|
|
81
|
-
|
|
110
|
+
partialLocales,
|
|
111
|
+
catalogs,
|
|
112
|
+
wordModules
|
|
82
113
|
} = raw;
|
|
83
114
|
if (!isProfile(profile)) {
|
|
84
115
|
const door = `run \`basalt-ui init --profile <${PROFILES.join("|")}>\``;
|
|
@@ -103,6 +134,17 @@ function parseManifest(text) {
|
|
|
103
134
|
if (sibling !== void 0 && (typeof sibling !== "string" || !/^basalt-v3-[\w-]*$/.test(sibling))) {
|
|
104
135
|
return bad("`sibling` must be a name prefix starting `basalt-v3-`");
|
|
105
136
|
}
|
|
137
|
+
for (const [key, value] of [
|
|
138
|
+
["agents", agents],
|
|
139
|
+
["design", design]
|
|
140
|
+
]) {
|
|
141
|
+
if (value !== void 0 && !(typeof value === "string" && isMarkdownFile(value))) {
|
|
142
|
+
return bad(`\`${key}\` must be a relative path to a .md file below the install root`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (report !== void 0 && !(typeof report === "string" && /^[^\n\r]+$/.test(report.trim()))) {
|
|
146
|
+
return bad("`report` must be one line of text");
|
|
147
|
+
}
|
|
106
148
|
if (harnesses !== void 0 && !(Array.isArray(harnesses) && harnesses.every(isHarness))) {
|
|
107
149
|
return bad("`harnesses` must list claude-code, codex, opencode or pi");
|
|
108
150
|
}
|
|
@@ -110,11 +152,21 @@ function parseManifest(text) {
|
|
|
110
152
|
if (locales !== void 0 && !(isStrings(locales) && locales.every(isLocaleTag) && new Set(locales).size === locales.length)) {
|
|
111
153
|
return bad("`locales` must list distinct language tags (en, de, zh-Hans), the source one first");
|
|
112
154
|
}
|
|
155
|
+
if (partialLocales !== void 0 && !(isStrings(partialLocales) && new Set(partialLocales).size === partialLocales.length && partialLocales.every((tag) => (locales ?? []).indexOf(tag) > 0))) {
|
|
156
|
+
return bad(
|
|
157
|
+
"`partialLocales` must list distinct languages of `locales`, never the source (first) one"
|
|
158
|
+
);
|
|
159
|
+
}
|
|
113
160
|
if (catalogs !== void 0 && !(isStrings(catalogs) && catalogs.every(isCatalogPattern))) {
|
|
114
161
|
return bad(
|
|
115
162
|
"`catalogs` must list relative paths that name {locale}, like src/locales/{locale}.po"
|
|
116
163
|
);
|
|
117
164
|
}
|
|
165
|
+
if (wordModules !== void 0 && !(isStrings(wordModules) && wordModules.every((glob) => isWordModule(glob, profile, roots)))) {
|
|
166
|
+
return bad(
|
|
167
|
+
"`wordModules` must list `.ts` globs below a `site` root, like apps/site/src/strings.*.ts"
|
|
168
|
+
);
|
|
169
|
+
}
|
|
118
170
|
const lists = LISTS.map((key) => raw[key] ?? []);
|
|
119
171
|
if (!lists.every(isStrings)) return bad(`${LISTS.join(", ")} must be arrays of strings`);
|
|
120
172
|
if (!lists[4].every(isBespokeDir)) {
|
|
@@ -136,10 +188,15 @@ function parseManifest(text) {
|
|
|
136
188
|
...harnesses === void 0 ? {} : { harnesses: [...new Set(harnesses)] },
|
|
137
189
|
...hook === void 0 ? {} : { hook },
|
|
138
190
|
...locales === void 0 ? {} : { locales },
|
|
191
|
+
...partialLocales === void 0 ? {} : { partialLocales },
|
|
139
192
|
...catalogs === void 0 ? {} : { catalogs },
|
|
193
|
+
...wordModules === void 0 ? {} : { wordModules },
|
|
140
194
|
tokens,
|
|
141
195
|
...extra === void 0 ? {} : { extra },
|
|
142
196
|
...typeof sibling === "string" ? { sibling } : {},
|
|
197
|
+
...typeof agents === "string" ? { agents } : {},
|
|
198
|
+
...typeof design === "string" ? { design } : {},
|
|
199
|
+
...typeof report === "string" ? { report: report.trim() } : {},
|
|
143
200
|
rest: Object.fromEntries(Object.entries(raw).filter(([key]) => !KNOWN.includes(key)))
|
|
144
201
|
}
|
|
145
202
|
};
|
|
@@ -162,10 +219,15 @@ function serializeManifest(m) {
|
|
|
162
219
|
...m.harnesses === void 0 ? {} : { harnesses: m.harnesses },
|
|
163
220
|
...m.hook === void 0 ? {} : { hook: m.hook },
|
|
164
221
|
...m.locales === void 0 ? {} : { locales: m.locales },
|
|
222
|
+
...m.partialLocales?.length ? { partialLocales: m.partialLocales } : {},
|
|
165
223
|
...m.catalogs === void 0 ? {} : { catalogs: m.catalogs },
|
|
224
|
+
...m.wordModules?.length ? { wordModules: m.wordModules } : {},
|
|
166
225
|
tokens,
|
|
167
226
|
...extra === void 0 ? {} : { extra },
|
|
168
227
|
...sibling === void 0 ? {} : { sibling },
|
|
228
|
+
...m.agents === void 0 ? {} : { agents: m.agents },
|
|
229
|
+
...m.design === void 0 ? {} : { design: m.design },
|
|
230
|
+
...m.report === void 0 ? {} : { report: m.report },
|
|
169
231
|
...rest
|
|
170
232
|
};
|
|
171
233
|
return `${JSON.stringify(body, null, 2)}
|
|
@@ -186,11 +248,19 @@ function writeManifest(dir, manifest) {
|
|
|
186
248
|
writeFileSync(abs, next);
|
|
187
249
|
}
|
|
188
250
|
export {
|
|
251
|
+
AGENTS_FILE,
|
|
189
252
|
CLI_OWNED_KEYS,
|
|
253
|
+
DEFAULT_REPORT,
|
|
254
|
+
DESIGN_FILE,
|
|
190
255
|
MANIFEST_FORMAT,
|
|
191
256
|
MANIFEST_PATH,
|
|
192
257
|
PROFILES,
|
|
258
|
+
agentsPath,
|
|
259
|
+
cleanRoot,
|
|
260
|
+
designPath,
|
|
261
|
+
isCatalogPattern,
|
|
193
262
|
isLocaleTag,
|
|
263
|
+
isMarkdownFile,
|
|
194
264
|
isSiteManifest,
|
|
195
265
|
parseManifest,
|
|
196
266
|
readManifest,
|
|
@@ -23,6 +23,12 @@ export declare const LEGACY_KEY_PREFIX: RegExp;
|
|
|
23
23
|
export declare function takeCensus(root: string): Census;
|
|
24
24
|
/** `file:line` of every line, source or config, that runs `basalt-ui <verb>` with each of `words` after it. */
|
|
25
25
|
export declare function findCommand(census: Census, verb: string, words: readonly string[]): string[];
|
|
26
|
+
/**
|
|
27
|
+
* The app's own files ending in `path`, then every `file:line` importing one, by a relative
|
|
28
|
+
* specifier or an alias ending in `path`. A file under a `basalt:ejected` header is not the app's
|
|
29
|
+
* copy: it is owned through the manifest.
|
|
30
|
+
*/
|
|
31
|
+
export declare function findFile(census: Census, path: string): string[];
|
|
26
32
|
/** `file:line` of every occurrence of `needle` in the scanned sources. */
|
|
27
33
|
export declare function findText(census: Census, needle: string): string[];
|
|
28
34
|
//# sourceMappingURL=census.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"census.d.ts","sourceRoot":"","sources":["../../../src/cli/migrate/census.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"census.d.ts","sourceRoot":"","sources":["../../../src/cli/migrate/census.ts"],"names":[],"mappings":"AAyCA,uHAAuH;AACvH,MAAM,WAAW,MAAM;IACrB,kEAAkE;IAClE,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACzB,kGAAkG;IAClG,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAC9B,kGAAkG;IAClG,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAC9B,8DAA8D;IAC9D,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC3B,kEAAkE;IAClE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAC5B,wEAAwE;IACxE,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAC3C,sEAAsE;IACtE,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAClC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;CAC/B;AAyCD,qGAAqG;AACrG,eAAO,MAAM,iBAAiB,QAAwB,CAAA;AA4FtD,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA+B/C;AAYD,+GAA+G;AAC/G,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAc5F;AAOD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAoB/D;AAED,0EAA0E;AAC1E,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAQjE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readFileSync, readdirSync, statSync } from "node:fs";
|
|
2
|
-
import { join, relative, sep } from "node:path";
|
|
2
|
+
import { join, posix, relative, sep } from "node:path";
|
|
3
|
+
import { parseHeader } from "../merge/header.js";
|
|
3
4
|
const EXTENSIONS = [".ts", ".tsx", ".astro", ".css"];
|
|
4
5
|
const SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
5
6
|
"node_modules",
|
|
@@ -192,6 +193,25 @@ function findCommand(census, verb, words) {
|
|
|
192
193
|
}
|
|
193
194
|
return places;
|
|
194
195
|
}
|
|
196
|
+
const SPECIFIER = /\b(?:from|import)\s*\(?\s*(['"])([^'"\n]+)\1/g;
|
|
197
|
+
const bare = (name) => name.replace(/\.tsx$/, "");
|
|
198
|
+
function findFile(census, path) {
|
|
199
|
+
const own = census.files.filter(
|
|
200
|
+
(file) => (file === path || file.endsWith(`/${path}`)) && parseHeader((census.text.get(file) ?? "").split("\n", 1)[0] ?? "") === null
|
|
201
|
+
);
|
|
202
|
+
if (own.length === 0) return [];
|
|
203
|
+
const targets = new Set(own.map(bare));
|
|
204
|
+
const alias = bare(path);
|
|
205
|
+
const imports = [];
|
|
206
|
+
for (const [file, text] of census.text) {
|
|
207
|
+
for (const m of text.matchAll(SPECIFIER)) {
|
|
208
|
+
const spec = bare(m[2] ?? "");
|
|
209
|
+
const hit = spec.startsWith(".") ? targets.has(posix.join(posix.dirname(file), spec)) : spec === alias || spec.endsWith(`/${alias}`);
|
|
210
|
+
if (hit) imports.push(`${file}:${lineOf(text, m.index)}`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return [...own.map((file) => `${file}:1`), ...imports];
|
|
214
|
+
}
|
|
195
215
|
function findText(census, needle) {
|
|
196
216
|
const places = [];
|
|
197
217
|
for (const [file, text] of census.text) {
|
|
@@ -204,6 +224,7 @@ function findText(census, needle) {
|
|
|
204
224
|
export {
|
|
205
225
|
LEGACY_KEY_PREFIX,
|
|
206
226
|
findCommand,
|
|
227
|
+
findFile,
|
|
207
228
|
findText,
|
|
208
229
|
takeCensus
|
|
209
230
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassUse, LostClass } from './lost-classes.js';
|
|
1
2
|
import type { AttrRow, MigrationRow, Profile, RuleRow, StorageRow, TokenRename, TokenShift, UrlRow } from './rows.js';
|
|
2
3
|
export { PROFILES } from './rows.js';
|
|
3
4
|
/** A symbol the migration removes from the old name: importing it still is a failure under `--check`. */
|
|
@@ -46,6 +47,10 @@ export interface MigrateReport {
|
|
|
46
47
|
})[];
|
|
47
48
|
/** Passed through: a lint rule row has no import to census. */
|
|
48
49
|
rules: RuleRow[];
|
|
50
|
+
/** Class names the app writes that the 3.x theme does not emit; empty at `tokens`. */
|
|
51
|
+
lostClasses: LostClass[];
|
|
52
|
+
/** `md:` and `xl:` uses, which emit at other widths than Tailwind's; empty at `tokens`. */
|
|
53
|
+
movedBreakpoints: ClassUse[];
|
|
49
54
|
/** Imported basalt-ui symbols (`module#name`) that no row of any version mentions. */
|
|
50
55
|
unmapped: {
|
|
51
56
|
symbol: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/migrate/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,OAAO,EAEP,YAAY,EACZ,OAAO,EAEP,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EACV,MAAM,EACP,MAAM,QAAQ,CAAA;AAEf,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AASjC,yGAAyG;AACzG,eAAO,MAAM,QAAQ,aAA2C,CAAA;AAChE,eAAO,MAAM,aAAa,aAA4C,CAAA;AAItE,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAA;IACd,wFAAwF;IACxF,EAAE,EAAE,MAAM,EAAE,CAAA;CACb;AAED,4GAA4G;AAC5G,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAExE,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,gBAAgB,GAAG,iBAAiB,GAAG,qBAAqB,GAAG,iBAAiB,CAAA;IACxF,MAAM,EAAE,MAAM,CAAA;IACd,EAAE,EAAE,MAAM,EAAE,CAA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findFile, findText, takeCensus } from "./census.js";
|
|
3
|
+
import { BRIDGE_IMPORT, lostClasses } from "./lost-classes.js";
|
|
3
4
|
import { PROFILES, inRange, loadMigrationFiles, newerFiles, parseFrom, parseVersion } from "./rows.js";
|
|
4
5
|
import { PROFILES as PROFILES2 } from "./rows.js";
|
|
5
6
|
const OPTIONS = {
|
|
@@ -43,6 +44,7 @@ function memberStillUsed(census, key, member, kind) {
|
|
|
43
44
|
}
|
|
44
45
|
function matchRow(row, census) {
|
|
45
46
|
const from = parseFrom(row.from) ?? { form: "text", needle: row.from };
|
|
47
|
+
if (from.form === "file") return { at: findFile(census, from.path), removed: false };
|
|
46
48
|
if (from.form === "peer") return { at: census.peers.get(from.name) ?? [], removed: false };
|
|
47
49
|
if (from.form === "command") {
|
|
48
50
|
return { at: findCommand(census, from.verb, from.words), removed: false };
|
|
@@ -75,6 +77,7 @@ function mapped(key, rows) {
|
|
|
75
77
|
return from.symbol === void 0 || from.symbol === "*" || from.symbol === key.slice(hash + 1);
|
|
76
78
|
});
|
|
77
79
|
}
|
|
80
|
+
const standing = (row) => parseFrom(row.from)?.form === "file";
|
|
78
81
|
function buildReport(input, cwd, pkgRoot) {
|
|
79
82
|
const census = takeCensus(cwd);
|
|
80
83
|
if (census.files.length === 0) {
|
|
@@ -86,8 +89,13 @@ function buildReport(input, cwd, pkgRoot) {
|
|
|
86
89
|
(f) => rowApplies(input.profile, f.profiles) && inRange(f, input.from)
|
|
87
90
|
);
|
|
88
91
|
const files = newerFiles(known, input.from);
|
|
89
|
-
const allRows = files.flatMap((f) => f.rows.map((r) => ({ ...r, source: f.source })));
|
|
90
92
|
const knownRows = known.flatMap((f) => f.rows);
|
|
93
|
+
const allRows = [
|
|
94
|
+
...files.flatMap(
|
|
95
|
+
(f) => f.rows.filter((r) => !standing(r)).map((r) => ({ ...r, source: f.source }))
|
|
96
|
+
),
|
|
97
|
+
...known.flatMap((f) => f.rows.filter(standing).map((r) => ({ ...r, source: f.source })))
|
|
98
|
+
];
|
|
91
99
|
const failures = [];
|
|
92
100
|
const rows = [];
|
|
93
101
|
for (const row of allRows) {
|
|
@@ -147,6 +155,7 @@ function buildReport(input, cwd, pkgRoot) {
|
|
|
147
155
|
});
|
|
148
156
|
}
|
|
149
157
|
const unmapped = [...census.symbols].filter(([key]) => isBasalt(key) && !mapped(key, knownRows)).map(([symbol, at]) => ({ symbol, at })).toSorted((a, b) => a.symbol.localeCompare(b.symbol));
|
|
158
|
+
const classes = input.profile === "tokens" ? { lost: [], moved: [] } : lostClasses(census);
|
|
150
159
|
return {
|
|
151
160
|
schema: 1,
|
|
152
161
|
from: input.from,
|
|
@@ -170,8 +179,31 @@ function buildReport(input, cwd, pkgRoot) {
|
|
|
170
179
|
rules: files.flatMap((f) => f.rules),
|
|
171
180
|
unmapped,
|
|
172
181
|
unknownKeys,
|
|
173
|
-
failures
|
|
182
|
+
failures,
|
|
183
|
+
lostClasses: classes.lost,
|
|
184
|
+
movedBreakpoints: classes.moved
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
function classLines(report) {
|
|
188
|
+
const lines = [];
|
|
189
|
+
const section = (title, uses) => {
|
|
190
|
+
if (uses.length === 0) return;
|
|
191
|
+
lines.push(title);
|
|
192
|
+
for (const u of uses) lines.push(` ${u.name} ${u.count} at ${u.at[0] ?? ""}`);
|
|
174
193
|
};
|
|
194
|
+
section(
|
|
195
|
+
`classes that no longer emit, restored by @import '${BRIDGE_IMPORT}' after tailwind.css:`,
|
|
196
|
+
report.lostClasses.filter((c) => c.bridge)
|
|
197
|
+
);
|
|
198
|
+
section(
|
|
199
|
+
"classes that no longer emit, rewrite each on a basalt theme name:",
|
|
200
|
+
report.lostClasses.filter((c) => !c.bridge)
|
|
201
|
+
);
|
|
202
|
+
section(
|
|
203
|
+
"breakpoints that moved (md is 840px, not 768px; xl is 1200px, not 1280px):",
|
|
204
|
+
report.movedBreakpoints
|
|
205
|
+
);
|
|
206
|
+
return lines;
|
|
175
207
|
}
|
|
176
208
|
function formatReport(report) {
|
|
177
209
|
const lines = [
|
|
@@ -206,6 +238,7 @@ function formatReport(report) {
|
|
|
206
238
|
lines.push(
|
|
207
239
|
` selector ${a.from}]${a.to === void 0 ? "" : ` -> ${a.to}`} at ${a.at[0] ?? ""}`
|
|
208
240
|
);
|
|
241
|
+
lines.push(...classLines(report));
|
|
209
242
|
if (report.unmapped.length > 0) {
|
|
210
243
|
lines.push(`unmapped (imported, no row): ${report.unmapped.map((u) => u.symbol).join(", ")}`);
|
|
211
244
|
}
|