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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Census } from './census.js';
|
|
2
|
+
export declare const BRIDGE_IMPORT = "basalt-ui/bridge.css";
|
|
3
|
+
export interface ClassUse {
|
|
4
|
+
/** The utility without variants (`rounded-lg`), or the variant (`sm:`). */
|
|
5
|
+
name: string;
|
|
6
|
+
count: number;
|
|
7
|
+
/** `file:line` places. */
|
|
8
|
+
at: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface LostClass extends ClassUse {
|
|
11
|
+
/** Whether `@import '${BRIDGE_IMPORT}'` makes it emit again. */
|
|
12
|
+
bridge: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface ClassReport {
|
|
15
|
+
lost: LostClass[];
|
|
16
|
+
/** `md:` and `xl:` uses: they emit, at the size classes instead of Tailwind's widths. */
|
|
17
|
+
moved: ClassUse[];
|
|
18
|
+
}
|
|
19
|
+
export declare function lostClasses(census: Census): ClassReport;
|
|
20
|
+
//# sourceMappingURL=lost-classes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lost-classes.d.ts","sourceRoot":"","sources":["../../../src/cli/migrate/lost-classes.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC,eAAO,MAAM,aAAa,yBAAyB,CAAA;AAEnD,MAAM,WAAW,QAAQ;IACvB,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,0BAA0B;IAC1B,EAAE,EAAE,MAAM,EAAE,CAAA;CACb;AAED,MAAM,WAAW,SAAU,SAAQ,QAAQ;IACzC,gEAAgE;IAChE,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,EAAE,CAAA;IACjB,yFAAyF;IACzF,KAAK,EAAE,QAAQ,EAAE,CAAA;CAClB;AA4HD,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CA6CvD"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BRIDGE_BREAKPOINTS,
|
|
3
|
+
BRIDGE_COLORS,
|
|
4
|
+
BRIDGE_RADII,
|
|
5
|
+
BRIDGE_SHADOWS,
|
|
6
|
+
BRIDGE_TYPE_STEPS
|
|
7
|
+
} from "../../tokens/bridge-sheet.js";
|
|
8
|
+
const BRIDGE_IMPORT = "basalt-ui/bridge.css";
|
|
9
|
+
const PALETTE = "slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose|mauve|olive|mist|taupe";
|
|
10
|
+
const COLOR_HEAD = "(?:bg|text|border(?:-[trblxyse])?|ring-offset|ring|outline|fill|stroke|from|via|to|divide|placeholder|decoration|accent|caret|inset-ring|inset-shadow|drop-shadow|shadow)";
|
|
11
|
+
const PALETTE_CLASS = new RegExp(`^${COLOR_HEAD}-((?:${PALETTE})-(?:50|[1-9]00|950)|white|black)$`);
|
|
12
|
+
const SHADCN_NAMES = Object.keys(BRIDGE_COLORS).filter((n) => !/^primary(?:-foreground)?$/.test(n));
|
|
13
|
+
const SHADCN_CLASS = new RegExp(`^${COLOR_HEAD}-(${SHADCN_NAMES.join("|")})$`);
|
|
14
|
+
const RADIUS_CLASS = /^rounded(?:-(?:t|r|b|l|s|e|tl|tr|br|bl|ss|se|ee|es))?(?:-(xs|sm|md|lg|xl|[234]xl))?$/;
|
|
15
|
+
const SHADOW_CLASS = /^shadow(?:-(2xs|xs|sm|md|lg|xl|2xl))?$/;
|
|
16
|
+
const TEXT_CLASS = /^text-(xl|[2-9]xl)$/;
|
|
17
|
+
const SCREEN_CLASS = /^(?:min-|max-)?w-screen-(sm|lg|2xl)$/;
|
|
18
|
+
const BREAKPOINT_VARIANT = /^(?:max-|min-)?(sm|md|lg|xl|2xl)$/;
|
|
19
|
+
function deadUtility(base) {
|
|
20
|
+
const radius = RADIUS_CLASS.exec(base);
|
|
21
|
+
if (radius !== null) {
|
|
22
|
+
const step = radius[1] ?? "";
|
|
23
|
+
return { theme: "radius", step, bridge: step in BRIDGE_RADII };
|
|
24
|
+
}
|
|
25
|
+
const shadow = SHADOW_CLASS.exec(base);
|
|
26
|
+
if (shadow !== null) {
|
|
27
|
+
const step = shadow[1] ?? "";
|
|
28
|
+
return { theme: "shadow", step, bridge: step in BRIDGE_SHADOWS };
|
|
29
|
+
}
|
|
30
|
+
const text = TEXT_CLASS.exec(base)?.[1];
|
|
31
|
+
if (text !== void 0) return { theme: "text", step: text, bridge: text in BRIDGE_TYPE_STEPS };
|
|
32
|
+
const screen = SCREEN_CLASS.exec(base)?.[1];
|
|
33
|
+
if (screen !== void 0) {
|
|
34
|
+
return { theme: "breakpoint", step: screen, bridge: screen in BRIDGE_BREAKPOINTS };
|
|
35
|
+
}
|
|
36
|
+
const palette = PALETTE_CLASS.exec(base)?.[1];
|
|
37
|
+
if (palette !== void 0) return { theme: "color", step: palette, bridge: false };
|
|
38
|
+
const shadcn = SHADCN_CLASS.exec(base)?.[1];
|
|
39
|
+
if (shadcn !== void 0) return { theme: "color", step: shadcn, bridge: true };
|
|
40
|
+
if (base === "font-heading") return { theme: "font", step: "heading", bridge: true };
|
|
41
|
+
return void 0;
|
|
42
|
+
}
|
|
43
|
+
function segments(token) {
|
|
44
|
+
const out = [];
|
|
45
|
+
let depth = 0;
|
|
46
|
+
let start = 0;
|
|
47
|
+
for (let i = 0; i < token.length; i++) {
|
|
48
|
+
const c = token[i];
|
|
49
|
+
if (c === "[" || c === "(") depth++;
|
|
50
|
+
else if (c === "]" || c === ")") depth--;
|
|
51
|
+
else if (c === ":" && depth === 0) {
|
|
52
|
+
out.push(token.slice(start, i));
|
|
53
|
+
start = i + 1;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
out.push(token.slice(start));
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
const STRING = /"([^"\\\n]*)"|'([^'\\\n]*)'|`([^`\\]*)`/g;
|
|
60
|
+
const APPLY = /@apply\s+([^;{}]+)/g;
|
|
61
|
+
const CLASS_CONTEXT = /class|\bcn\(|clsx|cva\(|\btv\(|@apply/;
|
|
62
|
+
const BARE_WORD = /^(?:rounded|shadow)$/;
|
|
63
|
+
function classLists(file, text) {
|
|
64
|
+
const css = file.endsWith(".css");
|
|
65
|
+
return [...text.matchAll(css ? APPLY : STRING)].map((m) => ({
|
|
66
|
+
// A template literal holds its branches' own quotes, so quotes split too.
|
|
67
|
+
tokens: (m[1] ?? m[2] ?? m[3] ?? "").split(m[3] === void 0 ? /\s+/ : /[\s'"]+/).filter(Boolean),
|
|
68
|
+
index: m.index
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
const DECLARED = /--(breakpoint|radius|shadow|text|color|font)(?:-([\w-]+))?\s*:/g;
|
|
72
|
+
const THEME_BLOCK = /@theme\b[^{;]*\{/g;
|
|
73
|
+
function themeBodies(css) {
|
|
74
|
+
return [...css.matchAll(THEME_BLOCK)].map((m) => {
|
|
75
|
+
const start = m.index + m[0].length;
|
|
76
|
+
let end = start;
|
|
77
|
+
for (let depth = 1; end < css.length; end++) {
|
|
78
|
+
if (css[end] === "{") depth++;
|
|
79
|
+
else if (css[end] === "}" && --depth === 0) break;
|
|
80
|
+
}
|
|
81
|
+
return css.slice(start, end);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function declared(census) {
|
|
85
|
+
const names = /* @__PURE__ */ new Set();
|
|
86
|
+
for (const [file, text] of census.text) {
|
|
87
|
+
if (!file.endsWith(".css")) continue;
|
|
88
|
+
for (const body of themeBodies(text)) {
|
|
89
|
+
for (const m of body.matchAll(DECLARED)) names.add(`${m[1]}-${m[2] ?? ""}`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return names;
|
|
93
|
+
}
|
|
94
|
+
function add(into, name, place) {
|
|
95
|
+
const use = into.get(name) ?? { name, count: 0, at: [] };
|
|
96
|
+
use.count++;
|
|
97
|
+
if (!use.at.includes(place)) use.at.push(place);
|
|
98
|
+
into.set(name, use);
|
|
99
|
+
return use;
|
|
100
|
+
}
|
|
101
|
+
const byCount = (a, b) => b.count - a.count || a.name.localeCompare(b.name);
|
|
102
|
+
function lostClasses(census) {
|
|
103
|
+
const own = declared(census);
|
|
104
|
+
const bridged = census.modules.has(BRIDGE_IMPORT);
|
|
105
|
+
const lost = /* @__PURE__ */ new Map();
|
|
106
|
+
const restorable = /* @__PURE__ */ new Set();
|
|
107
|
+
const moved = /* @__PURE__ */ new Map();
|
|
108
|
+
for (const [file, text] of census.text) {
|
|
109
|
+
const lines = text.split("\n");
|
|
110
|
+
let line = 1;
|
|
111
|
+
let seen = 0;
|
|
112
|
+
for (const { tokens, index } of classLists(file, text)) {
|
|
113
|
+
for (; seen < index; seen++) if (text[seen] === "\n") line++;
|
|
114
|
+
const place = `${file}:${line}`;
|
|
115
|
+
const listLike = tokens.some((t) => /[-:]/.test(t)) || CLASS_CONTEXT.test(lines[line - 1] ?? "");
|
|
116
|
+
const report = (name, theme, step, bridge) => {
|
|
117
|
+
if (own.has(`${theme}-${step}`) || bridge && bridged) return;
|
|
118
|
+
add(lost, name, place);
|
|
119
|
+
if (bridge) restorable.add(name);
|
|
120
|
+
};
|
|
121
|
+
for (const token of tokens) {
|
|
122
|
+
const parts = segments(token);
|
|
123
|
+
const base = (parts.pop() ?? "").replace(/^!|!$/g, "").replace(/^-/, "").replace(/\/[^\]]*$/, "");
|
|
124
|
+
if (base === "" || BARE_WORD.test(base) && !listLike) continue;
|
|
125
|
+
for (const variant of parts) {
|
|
126
|
+
const step = BREAKPOINT_VARIANT.exec(variant)?.[1];
|
|
127
|
+
if (step === void 0) continue;
|
|
128
|
+
if (step !== "md" && step !== "xl") {
|
|
129
|
+
report(`${variant}:`, "breakpoint", step, step in BRIDGE_BREAKPOINTS);
|
|
130
|
+
} else if (!own.has(`breakpoint-${step}`)) add(moved, `${variant}:`, place);
|
|
131
|
+
}
|
|
132
|
+
const dead = deadUtility(base);
|
|
133
|
+
if (dead !== void 0) report(base, dead.theme, dead.step, dead.bridge);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
lost: [...lost.values()].map((u) => ({ ...u, bridge: restorable.has(u.name) })).toSorted(byCount),
|
|
139
|
+
moved: [...moved.values()].toSorted(byCount)
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
export {
|
|
143
|
+
BRIDGE_IMPORT,
|
|
144
|
+
lostClasses
|
|
145
|
+
};
|
|
@@ -40,6 +40,11 @@ export type RowFrom =
|
|
|
40
40
|
verb: string;
|
|
41
41
|
words: string[];
|
|
42
42
|
}
|
|
43
|
+
/** `file:<path>`: the app has its own source file whose path ends in `<path>`. */
|
|
44
|
+
| {
|
|
45
|
+
form: 'file';
|
|
46
|
+
path: string;
|
|
47
|
+
}
|
|
43
48
|
/** `peer:<package>`: a package.json of the app declares it. */
|
|
44
49
|
| {
|
|
45
50
|
form: 'peer';
|
|
@@ -111,6 +116,11 @@ export declare function newerThan(since: string, from: string): boolean;
|
|
|
111
116
|
export declare function parseMigrationFile(source: string, text: string): MigrationFile;
|
|
112
117
|
/** Every rows file the package carries: `migrations/areas/*.json`. */
|
|
113
118
|
export declare function loadMigrationFiles(pkgRoot: string): MigrationFile[];
|
|
119
|
+
/**
|
|
120
|
+
* The app files a `file:` row replaces: file name without `.tsx` to the shipped import its `to`
|
|
121
|
+
* names.
|
|
122
|
+
*/
|
|
123
|
+
export declare function replacedFiles(pkgRoot: string): Map<string, string>;
|
|
114
124
|
/** Every entry of a file, across its lists. */
|
|
115
125
|
export declare function entriesOf(file: MigrationFile): Dated[];
|
|
116
126
|
/** Whether a file speaks to an app coming from `from`: its own `from` range holds it, or it has none. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../../src/cli/migrate/rows.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,QAAQ,uDAAwD,CAAA;AAC7E,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;AAE/C,gFAAgF;AAChF,eAAO,MAAM,UAAU,SAAS,CAAA;AAEhC,8CAA8C;AAC9C,MAAM,WAAW,KAAK;IACpB,sFAAsF;IACtF,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,YAAa,SAAQ,KAAK;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,kFAAkF;IAClF,OAAO,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;GAGG;AACH,MAAM,MAAM,OAAO;AACjB,mFAAmF;AACjF;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,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AAE,MAAM,GAAG,aAAa,EAAE,CAKnE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAQlE;AAED,+CAA+C;AAC/C,wBAAgB,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,KAAK,EAAE,CAUtD;AAED,yGAAyG;AACzG,eAAO,MAAM,OAAO,GAAI,MAAM,aAAa,EAAE,MAAM,MAAM,KAAG,OACL,CAAA;AAEvD,wGAAwG;AACxG,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,CAezF"}
|
package/dist/cli/migrate/rows.js
CHANGED
|
@@ -3,6 +3,7 @@ import { join } from "node:path";
|
|
|
3
3
|
const PROFILES = ["tokens", "site", "bridge", "parts", "app"];
|
|
4
4
|
const UNRELEASED = "next";
|
|
5
5
|
const PEER = /^peer:((?:@[a-z\d][\w.-]*\/)?[a-z\d][\w.-]*)$/;
|
|
6
|
+
const FILE = /^file:((?:[a-z\d][\w.-]*\/)*[a-z\d][\w.-]*\.tsx)$/;
|
|
6
7
|
const BASALT = /^basalt-ui(?=$|[/# ])/;
|
|
7
8
|
const COMMAND = /^basalt-ui ([a-z][a-z:-]*)((?: --[a-z][a-z-]*(?: [a-z][a-z-]*)?)*)$/;
|
|
8
9
|
const MODULE_NAME = /^(?:@[\w*.-]+\/)?[\w*.-]+(?:\/[\w*.-]+)*$/;
|
|
@@ -10,6 +11,10 @@ const SYMBOL_PATH = /^([A-Za-z_$][\w$]*|\*)((?:\.[A-Za-z_$][\w$-]*(?:\[\])?)*)$/
|
|
|
10
11
|
const WORD = /^[^\s,|]+$/;
|
|
11
12
|
const TEXT = /^[^*]+\*?$/;
|
|
12
13
|
function parseFrom(from) {
|
|
14
|
+
if (from.startsWith("file:")) {
|
|
15
|
+
const path2 = FILE.exec(from)?.[1];
|
|
16
|
+
return path2 === void 0 ? null : { form: "file", path: path2 };
|
|
17
|
+
}
|
|
13
18
|
if (from.startsWith("peer:")) {
|
|
14
19
|
const name = PEER.exec(from)?.[1];
|
|
15
20
|
return name === void 0 ? null : { form: "peer", name };
|
|
@@ -167,6 +172,15 @@ function loadMigrationFiles(pkgRoot) {
|
|
|
167
172
|
(name) => parseMigrationFile(`areas/${name}`, readFileSync(join(base, "areas", name), "utf8"))
|
|
168
173
|
);
|
|
169
174
|
}
|
|
175
|
+
function replacedFiles(pkgRoot) {
|
|
176
|
+
const found = /* @__PURE__ */ new Map();
|
|
177
|
+
for (const row of loadMigrationFiles(pkgRoot).flatMap((f) => f.rows)) {
|
|
178
|
+
const from = parseFrom(row.from);
|
|
179
|
+
if (from?.form !== "file" || row.to === void 0) continue;
|
|
180
|
+
found.set(from.path.slice(from.path.lastIndexOf("/") + 1, -".tsx".length), row.to);
|
|
181
|
+
}
|
|
182
|
+
return found;
|
|
183
|
+
}
|
|
170
184
|
function entriesOf(file) {
|
|
171
185
|
return [
|
|
172
186
|
...file.rows,
|
|
@@ -203,5 +217,6 @@ export {
|
|
|
203
217
|
parseFrom,
|
|
204
218
|
parseMigrationFile,
|
|
205
219
|
parseVersion,
|
|
220
|
+
replacedFiles,
|
|
206
221
|
satisfies
|
|
207
222
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../src/cli/package-manager.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAA;AAmB5D,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAE1D;AAED,oJAAoJ;AACpJ,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,GAAG,UAAO,EACV,KAAK,UAAO,GACX,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../src/cli/package-manager.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAA;AAmB5D,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAE1D;AAED,oJAAoJ;AACpJ,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,GAAG,UAAO,EACV,KAAK,UAAO,GACX,MAAM,EAAE,CAcV;AAED,gGAAgG;AAChG,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,KAAG,MAA0C,CAAA;AAE1F,4FAA4F;AAC5F,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED,wFAAwF;AACxF,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,KAAG,MACmD,CAAA"}
|
|
@@ -23,7 +23,8 @@ function addCommand(dir, specs, dev = true, exact = true) {
|
|
|
23
23
|
const [x, sx] = exact ? [["--exact"], ["--save-exact"]] : [[], []];
|
|
24
24
|
if (pm === "bun") return ["bun", "add", ...dev ? ["--dev"] : [], ...x, ...specs];
|
|
25
25
|
if (pm === "pnpm") {
|
|
26
|
-
const
|
|
26
|
+
const at = found?.at ?? dir;
|
|
27
|
+
const workspace = resolve(dir) === at && existsSync(resolve(at, "pnpm-workspace.yaml")) ? ["-w"] : [];
|
|
27
28
|
return ["pnpm", "add", ...dev ? ["--save-dev"] : [], ...sx, ...workspace, ...specs];
|
|
28
29
|
}
|
|
29
30
|
if (pm === "yarn") return ["yarn", "add", ...dev ? ["--dev"] : [], ...x, ...specs];
|
package/dist/cli/peers.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export declare const BUILD_PEERS: Readonly<Record<Profile, readonly string[]>>;
|
|
|
14
14
|
* table uses (exact, `^`, `~`, `>=a <b`, partial, `a || b`). A range it cannot read is not met.
|
|
15
15
|
*/
|
|
16
16
|
export declare function satisfiesRange(installed: string, range: string): boolean;
|
|
17
|
+
/** Whether `installed` is outside `range` on a newer major than any it allows from below. */
|
|
18
|
+
export declare function aboveRange(installed: string, range: string): boolean;
|
|
17
19
|
/** `name@spec`, shell-quoted when the spec holds a space, `|`, `<` or `>`. */
|
|
18
20
|
export declare function peerSpec(name: string, range: string | undefined): string;
|
|
19
21
|
/** The fix line that adds peers at their declared spec: a pin (or a bare name) saved exactly, a range saved as the range. */
|
package/dist/cli/peers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peers.d.ts","sourceRoot":"","sources":["../../src/cli/peers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAMzC,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC,CAMtE,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC,CAMpE,CAAA;AAiDD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAOxE;AAED,8EAA8E;AAC9E,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAIxE;AAKD,6HAA6H;AAC7H,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,EAAE,EACzD,GAAG,EAAE,OAAO,GACX,MAAM,CAQR"}
|
|
1
|
+
{"version":3,"file":"peers.d.ts","sourceRoot":"","sources":["../../src/cli/peers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAMzC,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC,CAMtE,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC,CAMpE,CAAA;AAiDD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAOxE;AAED,6FAA6F;AAC7F,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAQpE;AAED,8EAA8E;AAC9E,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAIxE;AAKD,6HAA6H;AAC7H,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,EAAE,EACzD,GAAG,EAAE,OAAO,GACX,MAAM,CAQR"}
|
package/dist/cli/peers.js
CHANGED
|
@@ -58,6 +58,12 @@ function satisfiesRange(installed, range) {
|
|
|
58
58
|
return comparators.length > 0 && comparators.every((c) => meetsComparator(version.base, c));
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
+
function aboveRange(installed, range) {
|
|
62
|
+
const version = parseBase(installed);
|
|
63
|
+
if (version === null || satisfiesRange(installed, range)) return false;
|
|
64
|
+
const majors = range.split(/\s+|\|\|/).filter((c) => c !== "" && !c.startsWith("<")).flatMap((c) => parseBase(c.replace(/^(?:\^|~|>=|>|=)/, ""))?.base[0] ?? []);
|
|
65
|
+
return majors.length > 0 && version.base[0] > Math.max(...majors);
|
|
66
|
+
}
|
|
61
67
|
function peerSpec(name, range) {
|
|
62
68
|
if (range === void 0) return name;
|
|
63
69
|
const spec = `${name}@${range}`;
|
|
@@ -74,6 +80,7 @@ function peerAddLine(dir, peers, dev) {
|
|
|
74
80
|
export {
|
|
75
81
|
BUILD_PEERS,
|
|
76
82
|
RUNTIME_PEERS,
|
|
83
|
+
aboveRange,
|
|
77
84
|
peerAddLine,
|
|
78
85
|
peerSpec,
|
|
79
86
|
satisfiesRange
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../src/cli/presets.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAQ,MAAM,eAAe,CAAA;AAEtD,eAAO,MAAM,qBAAqB,6BAA6B,CAAA;AAC/D,eAAO,MAAM,kBAAkB,0BAAc,CAAA;AAE7C,KAAK,MAAM,GAAG;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,EAAE,CAAA;IACjE,QAAQ,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;SAAE,CAAA;KAAE,CAAA;CAC1D,CAAA;AAED,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,MAAM,CAO9F;
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../src/cli/presets.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAQ,MAAM,eAAe,CAAA;AAEtD,eAAO,MAAM,qBAAqB,6BAA6B,CAAA;AAC/D,eAAO,MAAM,kBAAkB,0BAAc,CAAA;AAE7C,KAAK,MAAM,GAAG;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,EAAE,CAAA;IACjE,QAAQ,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;SAAE,CAAA;KAAE,CAAA;CAC1D,CAAA;AAED,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,MAAM,CAO9F;AAiED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,GACZ,MAAM,GAAG,IAAI,CAsCf;AAKD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAWhE;AAED,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,OAAO,GAAE,MAAsB,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAY1F;AAED,gFAAgF;AAChF,eAAO,MAAM,WAAW,EAAE,WAAsD,CAAA"}
|
package/dist/cli/presets.js
CHANGED
|
@@ -40,15 +40,18 @@ const posixRelative = (from, path) => {
|
|
|
40
40
|
const rel = relative(from, path).split(sep).join("/");
|
|
41
41
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
42
42
|
};
|
|
43
|
-
function appBase(pkgRoot, root) {
|
|
43
|
+
function appBase(pkgRoot, root, roots) {
|
|
44
44
|
if (root === void 0) return APP_BASE_PRESET;
|
|
45
45
|
const real = realpathSync(root);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
const starts = [real, ...roots.flatMap((r) => existsSync(join(real, r)) ? [join(real, r)] : [])];
|
|
47
|
+
for (const start of starts) {
|
|
48
|
+
for (let dir = start; ; dir = dirname(dir)) {
|
|
49
|
+
const link = join(dir, "node_modules/basalt-ui");
|
|
50
|
+
if (existsSync(`${link}/../basalt-config/oxlint.json`)) {
|
|
51
|
+
return `${posixRelative(real, link)}/../basalt-config/oxlint.json`;
|
|
52
|
+
}
|
|
53
|
+
if (dirname(dir) === dir) break;
|
|
50
54
|
}
|
|
51
|
-
if (dirname(dir) === dir) break;
|
|
52
55
|
}
|
|
53
56
|
for (let dir = realpathSync(pkgRoot); ; dir = dirname(dir)) {
|
|
54
57
|
const own = join(dir, "node_modules/basalt-config/oxlint.json");
|
|
@@ -63,9 +66,8 @@ function renderOxlintPreset(manifest, pkgRoot, root) {
|
|
|
63
66
|
const [base] = above;
|
|
64
67
|
if (base === void 0) return null;
|
|
65
68
|
const pins = readShippedPreset(pkgRoot, base).settings?.basalt?.pins;
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
);
|
|
69
|
+
const declared = rootsOf(manifest).filter(([, profile]) => profile !== "tokens");
|
|
70
|
+
const roots = Object.fromEntries(declared);
|
|
69
71
|
const preset = buildPreset({
|
|
70
72
|
table: tableOf(plugin),
|
|
71
73
|
pins: { oxlint: pins?.["oxlint"] ?? "", shadcnLint: pins?.["@shadcn/lint"] ?? "" },
|
|
@@ -74,17 +76,31 @@ function renderOxlintPreset(manifest, pkgRoot, root) {
|
|
|
74
76
|
profile: base,
|
|
75
77
|
roots,
|
|
76
78
|
ejected: ejectedPaths(manifest),
|
|
79
|
+
scoped: true,
|
|
77
80
|
classPrefixes: manifest.classPrefixes ?? [],
|
|
78
81
|
bespoke: manifest.bespoke ?? [],
|
|
79
|
-
translated: isTranslated(manifest)
|
|
82
|
+
translated: isTranslated(manifest),
|
|
83
|
+
wordModules: manifest.wordModules ?? []
|
|
80
84
|
});
|
|
81
|
-
return preset === void 0 ? null : `${JSON.stringify(
|
|
85
|
+
return preset === void 0 ? null : `${JSON.stringify(
|
|
86
|
+
overBase(
|
|
87
|
+
preset,
|
|
88
|
+
appBase(
|
|
89
|
+
pkgRoot,
|
|
90
|
+
root,
|
|
91
|
+
declared.map(([path]) => path)
|
|
92
|
+
)
|
|
93
|
+
),
|
|
94
|
+
null,
|
|
95
|
+
2
|
|
96
|
+
)}
|
|
82
97
|
`;
|
|
83
98
|
}
|
|
84
99
|
const scrolls = (profile) => profile !== "tokens" && profile !== "site" && profile !== "bridge";
|
|
85
100
|
function renderStylelintPreset(manifest) {
|
|
86
101
|
return renderStylelintConfig({
|
|
87
102
|
ignoreFiles: manifest.tokens.map((t) => t.out),
|
|
103
|
+
bespoke: manifest.bespoke ?? [],
|
|
88
104
|
scroll: {
|
|
89
105
|
base: scrolls(manifest.profile),
|
|
90
106
|
roots: Object.fromEntries(
|
package/dist/cli/resolver.d.ts
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import type { Manifest } from './manifest.js';
|
|
2
2
|
/** True when `dir` declares itself a sibling install below a repo root of its own. */
|
|
3
3
|
export declare const isSiblingApp: (dir: string) => boolean;
|
|
4
|
+
/**
|
|
5
|
+
* The package the peers belong in: a sibling install is its own package; else the workspace package
|
|
6
|
+
* that holds the first declared root (the nearest `package.json` between it and the install root),
|
|
7
|
+
* else the app `resolveAppDir` names, else the install root. A dependency declared at a workspace
|
|
8
|
+
* root is invisible to an app under an isolated linker, so it never lands there for a workspace app.
|
|
9
|
+
*/
|
|
10
|
+
export declare function peerHome(root: string, roots: readonly string[]): string;
|
|
11
|
+
/** Why the app of the workspace at `root` cannot be told, so no peer line may name the root; else null. */
|
|
12
|
+
export declare function unplacedPeers(root: string, home: string): string | null;
|
|
4
13
|
/** True when `rel` (below the install root) is, holds or sits inside a declared root. */
|
|
5
|
-
export declare const coveredByRoots: (manifest: Manifest, rel: string) => boolean;
|
|
14
|
+
export declare const coveredByRoots: (manifest: Pick<Manifest, "roots">, rel: string) => boolean;
|
|
6
15
|
/**
|
|
7
16
|
* The refusal for an undeclared second install in the workspace under `root`, or null. Candidates
|
|
8
17
|
* are workspace packages that depend on basalt-ui and have a Vite entry; a declared sibling is not
|
|
9
|
-
* one. The root-owned install
|
|
10
|
-
*
|
|
18
|
+
* one. The root-owned install holds what the manifest's roots cover, `basalt.app` and every package that
|
|
19
|
+
* takes only the tokens. A candidate outside it is the undeclared one.
|
|
11
20
|
*/
|
|
12
|
-
export declare function undeclaredInstall(root: string, manifest: Manifest): string | null;
|
|
21
|
+
export declare function undeclaredInstall(root: string, manifest: Pick<Manifest, 'roots'>): string | null;
|
|
13
22
|
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/cli/resolver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/cli/resolver.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAG1C,sFAAsF;AACtF,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,OAC0B,CAAA;AAErE;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CASvE;AAED,2GAA2G;AAC3G,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIvE;AAED,yFAAyF;AACzF,eAAO,MAAM,cAAc,GAAI,UAAU,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,KAAK,MAAM,KAAG,OAI5E,CAAA;AAmBJ;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,CAsBhG"}
|
package/dist/cli/resolver.js
CHANGED
|
@@ -1,25 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
3
|
+
import { filesUnder, readText } from "./doctor/types.js";
|
|
4
|
+
import {
|
|
5
|
+
collectWorkspacePackages,
|
|
6
|
+
findRepoRoot,
|
|
7
|
+
hasViteEntry,
|
|
8
|
+
readBasaltConfig,
|
|
9
|
+
resolveAppDir
|
|
10
|
+
} from "./index.js";
|
|
3
11
|
import { hasDependency } from "./source-text.js";
|
|
4
12
|
const isSiblingApp = (dir) => readBasaltConfig(dir).sibling === true && findRepoRoot(dir) !== dir;
|
|
13
|
+
function peerHome(root, roots) {
|
|
14
|
+
if (isSiblingApp(root)) return root;
|
|
15
|
+
const [first = "."] = roots;
|
|
16
|
+
for (let at = resolve(root, first); ; at = dirname(at)) {
|
|
17
|
+
if (at === root || relative(root, at).split(sep)[0] === "..") break;
|
|
18
|
+
if (existsSync(join(at, "package.json"))) return at;
|
|
19
|
+
}
|
|
20
|
+
const app = resolveAppDir(root);
|
|
21
|
+
return "error" in app ? root : app.dir;
|
|
22
|
+
}
|
|
23
|
+
function unplacedPeers(root, home) {
|
|
24
|
+
if (home !== root) return null;
|
|
25
|
+
const app = resolveAppDir(root);
|
|
26
|
+
return "error" in app && collectWorkspacePackages(root).hasWorkspacesField ? app.error : null;
|
|
27
|
+
}
|
|
5
28
|
const coveredByRoots = (manifest, rel) => Object.keys(manifest.roots).some((raw) => {
|
|
6
29
|
const root = raw.replace(/^(?:\.\/)+/, "").replace(/\/+$/, "");
|
|
7
30
|
return root === "." || rel === root || rel.startsWith(`${root}/`) || root.startsWith(`${rel}/`);
|
|
8
31
|
});
|
|
9
32
|
const posixRel = (root, dir) => relative(root, dir).replaceAll("\\", "/");
|
|
33
|
+
const TOKEN_SPECIFIERS = new Set(
|
|
34
|
+
["tokens", "tokens.css", "fonts.css", "theme-script"].map((sub) => `basalt-ui/${sub}`)
|
|
35
|
+
);
|
|
36
|
+
const BASALT_SPECIFIER = /(?:from\s*|import\s*\(?\s*|@import\s+(?:url\(\s*)?)['"](basalt-ui(?:\/[^'"]+)?)['"]/g;
|
|
37
|
+
const takesTokensOnly = (dir) => filesUnder(dir, ".", /\.(?:[cm]?[jt]sx?|css|astro|mdx)$/).every(
|
|
38
|
+
(file) => [...(readText(dir, file) ?? "").matchAll(BASALT_SPECIFIER)].every(
|
|
39
|
+
([, spec = ""]) => TOKEN_SPECIFIERS.has(spec)
|
|
40
|
+
)
|
|
41
|
+
);
|
|
10
42
|
function undeclaredInstall(root, manifest) {
|
|
11
43
|
const owned = collectWorkspacePackages(root).packages.filter(
|
|
12
44
|
(pkg) => pkg.dir !== root && hasDependency(pkg.dir, "basalt-ui") && hasViteEntry(pkg.dir) && readBasaltConfig(pkg.dir).sibling !== true
|
|
13
45
|
);
|
|
14
46
|
if (owned.length < 2) return null;
|
|
15
47
|
const named = readBasaltConfig(root).app;
|
|
16
|
-
const isOwner = (dir) =>
|
|
48
|
+
const isOwner = (dir) => coveredByRoots(manifest, posixRel(root, dir)) || named !== void 0 && dir === resolve(root, named) || takesTokensOnly(dir);
|
|
17
49
|
if (owned.filter((pkg) => isOwner(pkg.dir)).length === owned.length) return null;
|
|
18
50
|
const names = owned.map((pkg) => posixRel(root, pkg.dir)).join(", ");
|
|
19
|
-
return `${owned.length} workspace packages depend on basalt-ui and have a Vite entry (${names}) — cannot tell which is the app. Set \`basalt.app\` (e.g. \`"basalt": { "app": "apps/web" }\`) in the root package.json
|
|
51
|
+
return `${owned.length} workspace packages depend on basalt-ui and have a Vite entry (${names}) — cannot tell which is the app. Set \`basalt.app\` (e.g. \`"basalt": { "app": "apps/web" }\`) in the root package.json. Another app is then either a root of this install (\`basalt-ui init --profile <profile> --root <its source>\`) or an install of its own (\`"basalt": { "sibling": true }\` in its package.json).`;
|
|
20
52
|
}
|
|
21
53
|
export {
|
|
22
54
|
coveredByRoots,
|
|
23
55
|
isSiblingApp,
|
|
24
|
-
|
|
56
|
+
peerHome,
|
|
57
|
+
undeclaredInstall,
|
|
58
|
+
unplacedPeers
|
|
25
59
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { tokenize } from './source-text.js';
|
|
2
|
+
/** Every name Vite looks for, in the order it does: the first that exists is the config it loads. */
|
|
2
3
|
export declare const VITE_CONFIGS: string[];
|
|
3
4
|
/** True when `src` calls a binding imported from `@tanstack/router-plugin` after its `plugins` key (a textual proxy for "inside the array"). */
|
|
4
5
|
export declare function registersRouterPlugin(src: string): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-wiring.d.ts","sourceRoot":"","sources":["../../src/cli/router-wiring.ts"],"names":[],"mappings":"AAOA,OAAO,EAA+B,QAAQ,EAAE,MAAM,eAAe,CAAA;AAKrE,eAAO,MAAM,YAAY,UAA0E,CAAA;
|
|
1
|
+
{"version":3,"file":"router-wiring.d.ts","sourceRoot":"","sources":["../../src/cli/router-wiring.ts"],"names":[],"mappings":"AAOA,OAAO,EAA+B,QAAQ,EAAE,MAAM,eAAe,CAAA;AAKrE,qGAAqG;AACrG,eAAO,MAAM,YAAY,UAA0E,CAAA;AAmBnG,gJAAgJ;AAChJ,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAuB1D;AAwBD,oGAAoG;AACpG,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAEzC;;;;GAIG;AACH,wBAA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AACH,eAAO,MAAM,qBAAqB;;;;;;;CAO0C,CAAA;AAE5E,qGAAqG;AACrG,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAO,iBAAiB,GAAG,MAAM,CAE3F;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;CAGvB,CAAA;AACV,eAAO,MAAM,iBAAiB,mBAAmB,CAAA;AAEjD,6IAA6I;AAC7I,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAIxD;AAED,qFAAqF;AACrF,eAAO,MAAM,mBAAmB,wGACuE,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { existsSync } from "node:fs";
|
|
|
2
2
|
import { dirname, resolve } from "node:path";
|
|
3
3
|
import { hasDependency, readIfExists, tokenize } from "./source-text.js";
|
|
4
4
|
const IMPORT_DEPTH = 3;
|
|
5
|
-
const VITE_CONFIGS = ["
|
|
5
|
+
const VITE_CONFIGS = ["js", "mjs", "ts", "cjs", "mts", "cts"].map((e) => `vite.config.${e}`);
|
|
6
6
|
function htmlEntry(html) {
|
|
7
7
|
for (const [, attrs = ""] of html.replace(/<!--[\s\S]*?-->/g, "").matchAll(/<script\b([^>]*)>/gi)) {
|
|
8
8
|
const src = /\bsrc\s*=\s*["']?([^"'\s>]+)/i.exec(attrs)?.[1];
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { AGENTS_FILE } from '../manifest.js';
|
|
1
2
|
import type { Manifest } from '../manifest.js';
|
|
2
3
|
import type { Unit } from './render.js';
|
|
3
|
-
export
|
|
4
|
+
export { AGENTS_FILE };
|
|
4
5
|
export type State = 'current' | 'missing' | 'stale' | 'edited';
|
|
6
|
+
/** `shadows`: an edited file at a shipped path that basalt never placed (no ledger digest), a file of the consumer's own. */
|
|
5
7
|
export type Item = Unit & {
|
|
6
8
|
state: State;
|
|
9
|
+
shadows: boolean;
|
|
7
10
|
};
|
|
8
11
|
export type Retired = {
|
|
9
12
|
path: string;
|
|
@@ -12,6 +15,8 @@ export type Retired = {
|
|
|
12
15
|
export type Plan = {
|
|
13
16
|
items: Item[];
|
|
14
17
|
retired: Retired[];
|
|
18
|
+
/** The file the block lives in, relative to the install root (`manifest.agents`). */
|
|
19
|
+
agents: string;
|
|
15
20
|
/** Generated files no longer placed that are still on disk (the shim, a hook file basalt alone filled). */
|
|
16
21
|
drops: string[];
|
|
17
22
|
/** `text` is the whole host after the splice; `''` deletes a host the block alone filled. */
|
|
@@ -24,6 +29,8 @@ export type Plan = {
|
|
|
24
29
|
};
|
|
25
30
|
/** Reads the tree under `root`; writes nothing. A `null` block takes an existing one out. */
|
|
26
31
|
export declare function planSync(root: string, manifest: Manifest, units: Unit[], block: string | null, repo?: string, drops?: readonly string[]): Plan;
|
|
32
|
+
/** What `sync` and `doctor` say for a consumer's own file that sits at a shipped path: the name is taken by the shipped layer. */
|
|
33
|
+
export declare function shadowNote(path: string): string;
|
|
27
34
|
/** Every path a plan would change; `--check` is red on any, a locally edited file included. */
|
|
28
35
|
export declare function differences(plan: Plan): string[];
|
|
29
36
|
export type Applied = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../src/cli/sync/engine.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../src/cli/sync/engine.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,WAAW,EAAc,MAAM,aAAa,CAAA;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,OAAO,EAAE,WAAW,EAAE,CAAA;AAEtB,MAAM,MAAM,KAAK,GAAG,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