@motion-proto/live-tokens 0.77.0 → 0.79.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/.claude/skills/live-tokens-check-compliance/SKILL.md +60 -29
- package/.claude/skills/live-tokens-create-component/SKILL.md +23 -28
- package/.claude/skills/live-tokens-create-component/references/contract-tests.md +61 -0
- package/.claude/skills/live-tokens-create-component/references/sketch-mode.md +2 -2
- package/.claude/skills/live-tokens-create-component/references/token-naming.md +6 -15
- package/.claude/skills/live-tokens-create-page/SKILL.md +9 -6
- package/.claude/skills/live-tokens-create-theme/references/design-directions.md +1 -1
- package/.claude/skills/live-tokens-pick-component/SKILL.md +3 -3
- package/.claude/skills/live-tokens-set-colors/references/color-anchors.md +1 -1
- package/.claude/skills/live-tokens-set-geometry/SKILL.md +1 -1
- package/.claude/skills/live-tokens-set-geometry/references/geometry-anchors.md +1 -1
- package/CHANGELOG.md +284 -0
- package/README.md +9 -15
- package/bin/check-component.mjs +152 -551
- package/bin/check-page.mjs +56 -420
- package/bin/cli.mjs +83 -15
- package/bin/contractRunner.mjs +380 -120
- package/bin/lib/catalogue.mjs +161 -34
- package/bin/lib/componentSource.mjs +152 -0
- package/bin/lib/cssValues.mjs +9 -0
- package/bin/lib/dataDir.mjs +126 -0
- package/bin/lib/findings.mjs +103 -12
- package/bin/lib/fixers.mjs +64 -0
- package/bin/lib/geometry.mjs +92 -0
- package/bin/lib/pageRoutes.mjs +309 -0
- package/bin/lib/pageSource.mjs +230 -0
- package/bin/lib/report.mjs +57 -59
- package/bin/lib/tokenVocabulary.mjs +104 -34
- package/bin/rules/componentStructure.mjs +344 -0
- package/bin/rules/componentUse.mjs +313 -0
- package/bin/rules/importsAndRoutes.mjs +136 -0
- package/bin/rules/testRuns.mjs +122 -0
- package/bin/rules/tokens.mjs +363 -0
- package/bin/setup-claude.mjs +1 -2
- package/dist-plugin/{chunk-PDNL4NC5.js → chunk-D4WRIKEZ.js} +7 -2
- package/dist-plugin/{chunk-SWXRVZKT.js → chunk-REBHE3ZM.js} +414 -1
- package/dist-plugin/index.cjs +432 -15
- package/dist-plugin/index.js +8 -9
- package/dist-plugin/migrateData/index.cjs +422 -4
- package/dist-plugin/migrateData/index.js +2 -2
- package/dist-plugin/setColors/index.cjs +414 -1
- package/dist-plugin/setColors/index.d.cts +1 -1
- package/dist-plugin/setColors/index.d.ts +1 -1
- package/dist-plugin/setColors/index.js +1 -1
- package/dist-plugin/setGeometry/index.cjs +423 -13
- package/dist-plugin/setGeometry/index.d.cts +3 -3
- package/dist-plugin/setGeometry/index.d.ts +3 -3
- package/dist-plugin/setGeometry/index.js +10 -13
- package/dist-plugin/setType/index.d.cts +1 -1
- package/dist-plugin/setType/index.d.ts +1 -1
- package/dist-plugin/{themeTypes-BxRtuN5V.d.cts → themeTypes-B8_Idrp4.d.cts} +2 -2
- package/dist-plugin/{themeTypes-BxRtuN5V.d.ts → themeTypes-B8_Idrp4.d.ts} +2 -2
- package/package.json +6 -4
- package/src/editor/component-editor/CalloutEditor.svelte +2 -2
- package/src/editor/component-editor/CollapsibleSectionEditor.svelte +14 -15
- package/src/editor/component-editor/CornerBadgeEditor.svelte +14 -14
- package/src/editor/component-editor/DialogEditor.svelte +5 -5
- package/src/editor/component-editor/InlineEditActionsEditor.svelte +2 -2
- package/src/editor/component-editor/RadioButtonEditor.svelte +21 -21
- package/src/editor/component-editor/SectionDividerEditor.svelte +7 -7
- package/src/editor/component-editor/SegmentedControlEditor.svelte +5 -5
- package/src/editor/component-editor/SideNavigationEditor.svelte +25 -25
- package/src/editor/component-editor/TabBarEditor.svelte +6 -6
- package/src/editor/component-editor/TableEditor.svelte +6 -6
- package/src/editor/component-editor/ToggleEditor.svelte +2 -2
- package/src/editor/component-editor/index.ts +3 -0
- package/src/editor/component-editor/registry.ts +57 -1
- package/src/editor/component-editor/scaffolding/TokenLayout.svelte +14 -14
- package/src/editor/component-editor/scaffolding/VariantGroup.svelte +3 -0
- package/src/editor/component-editor/scaffolding/types.ts +15 -0
- package/src/editor/core/components/adjustAliases.ts +4 -4
- package/src/editor/core/components/aliasKinds.ts +20 -19
- package/src/editor/core/sketch/sketchLayer.ts +3 -3
- package/src/editor/core/themes/migrateComponentConfig.ts +14 -6
- package/src/editor/core/themes/migrations/2026-09-13-badge-brand.ts +42 -0
- package/src/editor/core/themes/migrations/2026-09-13-collapsiblesection-open.ts +33 -0
- package/src/editor/core/themes/migrations/2026-09-13-cornerbadge-prefix.ts +70 -0
- package/src/editor/core/themes/migrations/2026-09-13-hairline.ts +92 -0
- package/src/editor/core/themes/migrations/2026-09-13-indicator.ts +54 -0
- package/src/editor/core/themes/migrations/2026-09-13-sectiondivider-surface.ts +36 -0
- package/src/editor/core/themes/migrations/2026-09-13-selected-state.ts +124 -0
- package/src/editor/core/themes/migrations/2026-09-13-toggle-label.ts +31 -0
- package/src/editor/core/themes/migrations/index.ts +16 -0
- package/src/editor/core/themes/themeService.ts +3 -3
- package/src/editor/core/themes/themeTypes.ts +13 -15
- package/src/editor/docs/Docs.svelte +1 -1
- package/src/editor/docs/content/light-and-dark.md +3 -3
- package/src/editor/docs/content.generated.ts +1 -1
- package/src/editor/index.ts +1 -0
- package/src/editor/overlay/ColumnsOverlay.svelte +1 -1
- package/src/editor/overlay/LiveEditorOverlay.svelte +16 -0
- package/src/editor/overlay/LiveTokensRouter.svelte +1 -0
- package/src/editor/skill-atlas/SkillAtlas.svelte +4 -4
- package/src/editor/skill-atlas/TreeNodeCard.svelte +4 -4
- package/src/editor/skill-atlas/skillSources.generated.ts +11 -14
- package/src/editor/skill-atlas/skillTrees.ts +1 -3
- package/src/editor/skill-atlas/trees/check-compliance.ts +258 -93
- package/src/editor/skill-atlas/trees/create-component.ts +73 -62
- package/src/editor/skill-atlas/trees/create-page.ts +54 -33
- package/src/editor/skill-atlas/trees/pick-component.ts +3 -3
- package/src/editor/skill-atlas/trees/set-geometry.ts +1 -1
- package/src/editor/ui/UIPaletteSelector.svelte +11 -15
- package/src/editor/ui/variantScales.ts +8 -8
- package/src/live-tokens/data/themes/autumn.json +188 -188
- package/src/live-tokens/data/themes/halloween.json +188 -188
- package/src/live-tokens/data/themes/midnight-study.json +245 -245
- package/src/live-tokens/data/themes/ocean.json +188 -188
- package/src/live-tokens/data/themes/royal-velvet.json +188 -188
- package/src/live-tokens/data/themes/sketchy.json +188 -188
- package/src/live-tokens/data/themes/spring-meadow.json +188 -188
- package/src/live-tokens/data/themes/sunset.json +188 -188
- package/src/system/components/Badge.svelte +27 -23
- package/src/system/components/Button.svelte +13 -7
- package/src/system/components/Callout.svelte +16 -11
- package/src/system/components/Card.svelte +22 -15
- package/src/system/components/CodeSnippet.svelte +10 -6
- package/src/system/components/CollapsibleSection.svelte +68 -63
- package/src/system/components/CornerBadge.svelte +78 -72
- package/src/system/components/Dialog.svelte +21 -18
- package/src/system/components/IconButton.svelte +13 -9
- package/src/system/components/Image.svelte +14 -8
- package/src/system/components/ImageLightbox.svelte +10 -6
- package/src/system/components/InlineEditActions.svelte +17 -14
- package/src/system/components/Input.svelte +13 -7
- package/src/system/components/MenuSelect.svelte +13 -7
- package/src/system/components/Notification.svelte +17 -11
- package/src/system/components/Panel.svelte +13 -6
- package/src/system/components/ProgressBar.svelte +10 -5
- package/src/system/components/RadioButton.svelte +33 -30
- package/src/system/components/SectionDivider.svelte +28 -21
- package/src/system/components/SegmentedControl.svelte +27 -23
- package/src/system/components/SideNavigation.svelte +175 -171
- package/src/system/components/Slider.svelte +11 -7
- package/src/system/components/TabBar.svelte +53 -49
- package/src/system/components/Table.svelte +20 -15
- package/src/system/components/Toggle.svelte +14 -10
- package/src/system/components/Tooltip.svelte +10 -6
- package/src/system/styles/CONVENTIONS.md +3 -4
- package/src/testing-js/chunk-3UKGXCDL.js +48 -0
- package/src/testing-js/chunk-3UKGXCDL.js.map +1 -0
- package/src/testing-js/{chunk-ZMSX6CXR.js → chunk-NB3NZRBM.js} +13 -2
- package/src/testing-js/chunk-NB3NZRBM.js.map +1 -0
- package/src/testing-js/{chunk-FAFOAWYL.js → chunk-Q3YIAAG3.js} +17 -3
- package/src/testing-js/chunk-Q3YIAAG3.js.map +1 -0
- package/src/testing-js/{chunk-7TI7Z6Y6.js → chunk-U7OJE5DU.js} +19 -19
- package/src/testing-js/chunk-U7OJE5DU.js.map +1 -0
- package/src/testing-js/{chunk-L73N4NSO.js → chunk-WIZ6W7UT.js} +2 -2
- package/src/testing-js/{chunk-4JQX6WWL.js → chunk-ZMZQZ33J.js} +474 -166
- package/src/testing-js/chunk-ZMZQZ33J.js.map +1 -0
- package/src/testing-js/component-alias.contract.js +2 -2
- package/src/testing-js/component-behavior.contract.js +155 -0
- package/src/testing-js/component-behavior.contract.js.map +1 -0
- package/src/testing-js/component-editor.contract.js +7 -5
- package/src/testing-js/component-editor.contract.js.map +1 -1
- package/src/testing-js/component-render.contract.js +15 -11
- package/src/testing-js/component-render.contract.js.map +1 -1
- package/src/testing-js/index.d.ts +50 -4
- package/src/testing-js/index.js +32 -8
- package/src/testing-js/index.js.map +1 -1
- package/src/testing-js/page-compliance.contract.js +867 -0
- package/src/testing-js/page-compliance.contract.js.map +1 -0
- package/src/testing-js/registry.contract.js +5 -3
- package/src/testing-js/registry.contract.js.map +1 -1
- package/src/testing-js/{vitest-BE6uGF31.d.ts → vitest-BMLIbDs2.d.ts} +29 -3
- package/src/testing-js/vitest.d.ts +1 -1
- package/src/testing-js/vitest.js +3 -2
- package/template/README.md +16 -9
- package/template/package.json +2 -2
- package/template/src/pages/Home.svelte +13 -0
- package/.claude/skills/live-tokens-create-component/SKILL copy.md +0 -196
- package/.claude/skills/live-tokens-fix-findings/SKILL.md +0 -98
- package/src/editor/skill-atlas/trees/fix-findings.ts +0 -469
- package/src/testing-js/chunk-4JQX6WWL.js.map +0 -1
- package/src/testing-js/chunk-7TI7Z6Y6.js.map +0 -1
- package/src/testing-js/chunk-FAFOAWYL.js.map +0 -1
- package/src/testing-js/chunk-ZMSX6CXR.js.map +0 -1
- /package/src/testing-js/{chunk-L73N4NSO.js.map → chunk-WIZ6W7UT.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,289 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.79.0 — Checks fix what they find
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **Every finding carries its own repair.** `report --json` and both
|
|
8
|
+
checkers' `--json` now put `guidance`, `repair`, and `exception` on every
|
|
9
|
+
finding, alongside `rule`, `severity`, `file`, `line`, and `message`.
|
|
10
|
+
`guidance` is the rule's repair instruction in plain sentences, such as the
|
|
11
|
+
design token each color role takes for a `color-literal`.
|
|
12
|
+
`repair` is `auto` (code can apply the patch), `choice` (a role or a tie
|
|
13
|
+
needs the user, and `details` lists the candidates), or `authored` (the
|
|
14
|
+
user's own words are the fix). `exception` is the narrower
|
|
15
|
+
`live-tokens.config.json` entry that steps the rule down one level to
|
|
16
|
+
record a deliberate decision to leave the finding as it is.
|
|
17
|
+
- **`check-page` and `check-component` fix what they can.** Both apply every
|
|
18
|
+
`auto` finding's patch before they report: a deep import rewritten to its
|
|
19
|
+
public path, a spacing, radius, or stroke-width literal replaced by its one
|
|
20
|
+
nearest design token, a page's `size` prop deleted, a semantic property
|
|
21
|
+
override deleted. They then recheck and list each fix beside the findings
|
|
22
|
+
that remain, in `--json` as `fix.applied`. With `--tests`, the fixes land
|
|
23
|
+
before the tests run. A second run applies nothing. `--no-fix` reports
|
|
24
|
+
without editing, for a build or CI; the template's `check:design` passes it.
|
|
25
|
+
- **Three findings that used to be report-only facts.** `unread-token`
|
|
26
|
+
(warn): a runtime declares a property in `:global(:root)` and reads it
|
|
27
|
+
nowhere in its own CSS. `missing-description` (warn): a runtime file has no
|
|
28
|
+
`catalogue` export, or a required field in it is not a string literal. `config-token`: an alias in
|
|
29
|
+
`component-configs/<id>/default.json` names something the vocabulary
|
|
30
|
+
lacks, or a bare literal stands on a property the editor declares no
|
|
31
|
+
intrinsic for.
|
|
32
|
+
- **`ComponentContract` gains `behavior`.** A Vitest suite mounts the
|
|
33
|
+
runtime under happy-dom by its registration and drives each declared case
|
|
34
|
+
with a real DOM event: a callback fires with its documented argument,
|
|
35
|
+
stays silent under `disabled`, or a controlled prop drives its attribute
|
|
36
|
+
while an action leaves it alone. A failure reports `contract-behavior`,
|
|
37
|
+
naming the case. `behavior` is a required field; a component with no
|
|
38
|
+
callback prop declares it `{ applicable: false, reason: '...' }`.
|
|
39
|
+
- **A stroke's width has its own token scale**, `border-width`, so a
|
|
40
|
+
`dimension-literal` on a border, divider, or accent resolves to a stroke
|
|
41
|
+
step instead of a colour scale with nothing to offer it. 26 scales in
|
|
42
|
+
total; `tokens --scale border-width` resolves the name.
|
|
43
|
+
- **One component inventory.** `componentDirs` in `live-tokens.config.json`
|
|
44
|
+
is honoured everywhere a component is discovered, checked, or run under
|
|
45
|
+
`--tests`, not only by `report`. A registered id with no runtime, or a
|
|
46
|
+
runtime with no editor, now surfaces as a `missing-file` finding rather
|
|
47
|
+
than silently dropping out of the batch.
|
|
48
|
+
- **`CatalogueEntry` and the `catalogue` export.** A runtime file's
|
|
49
|
+
`<script module>` block exports `catalogue`, typed `CatalogueEntry`, with
|
|
50
|
+
`description`, `useFor`, `notFor`, and an optional `props` map keyed by
|
|
51
|
+
prop name. `CatalogueEntry` is exported from `@motion-proto/live-tokens`
|
|
52
|
+
and from `@motion-proto/live-tokens/component-editor`. `catalogueOf` reads
|
|
53
|
+
the export statically, the way the CLI already reads `component` and
|
|
54
|
+
`allTokens` from editor files, and `components <id>` prints its fields.
|
|
55
|
+
|
|
56
|
+
### Changed (breaking)
|
|
57
|
+
|
|
58
|
+
- **`check-page` and `check-component` edit files by default.** `--fix` is
|
|
59
|
+
gone; every run applies the `auto` patches. A build or CI script that runs
|
|
60
|
+
either checker must pass `--no-fix` to stay report-only, as the template's
|
|
61
|
+
`check:design` does.
|
|
62
|
+
- **`behavior` is a required `ComponentContract` field.** A consumer's
|
|
63
|
+
`tests/contracts.ts` stops compiling until each contract declares a
|
|
64
|
+
behavior or marks it inapplicable with a reason. `references/contract-tests.md`
|
|
65
|
+
in the create-component skill carries the Toggle-shaped example and the
|
|
66
|
+
one-line inapplicable form.
|
|
67
|
+
- **`RegistryEntry.catalogue` is required, with no default.** A
|
|
68
|
+
`registerComponent` call now passes `catalogue`, imported from the
|
|
69
|
+
runtime file beside its editor import. The runtime file's leading comment
|
|
70
|
+
is deleted; the CLI never falls back to it. A consumer's registration
|
|
71
|
+
stops compiling until it imports and passes `catalogue`.
|
|
72
|
+
- **Selection says `selected`.** RadioButton's `active` prop is `selected`
|
|
73
|
+
and SideNavigation's `forceActivePart` is `forceSelectedPart`. The
|
|
74
|
+
`-active-` segment reads `-selected-` across RadioButton's nine, TabBar's
|
|
75
|
+
fourteen, and SideNavigation's forty semantic properties, and the `.active`
|
|
76
|
+
class on a radio row, a tab, and a rail part is `.selected`. A saved theme
|
|
77
|
+
or component config is renamed on load. `active` stays the pressed state,
|
|
78
|
+
so Button's and IconButton's `--*-outline-active-*` are untouched.
|
|
79
|
+
- **One hairline.** The line a component draws between its parts is
|
|
80
|
+
`-hairline-color` and its width is `-hairline-width` everywhere. Dialog's,
|
|
81
|
+
Table's, and TabBar's `-divider` and `-divider-width`, SegmentedControl's
|
|
82
|
+
`-divider-color`, `-divider-thickness`, and `-divider-inset`,
|
|
83
|
+
CollapsibleSection's twenty-three `--collapsiblesection-divider-*`, and
|
|
84
|
+
SectionDivider's three `-hairline-thickness` are renamed on load.
|
|
85
|
+
CollapsibleSection's `variant="divider"` is `variant="hairline"`, and its
|
|
86
|
+
class is `.variant-hairline`. `check-component` no longer accepts the
|
|
87
|
+
suffixes `-thickness`, `-divider`, `-divider-width`, `-divider-thickness`,
|
|
88
|
+
`-hairline-thickness`, `-divider-height`, `-divider-inset`, or `-inset`; a
|
|
89
|
+
property carrying one is a naming finding. The `set-geometry` op kind
|
|
90
|
+
`divider-width` is `hairline-width`, and an ops file naming the old kind is
|
|
91
|
+
rejected.
|
|
92
|
+
- **One indicator.** The bar beside SideNavigation's current item and the
|
|
93
|
+
stripe on Callout's leading edge are indicators, the word MenuSelect and
|
|
94
|
+
TabBar already use. SideNavigation's twelve `-accent` and twelve
|
|
95
|
+
`-accent-width` properties and Callout's four `-accent-width` are
|
|
96
|
+
`-indicator` and `-indicator-width`, renamed on load. `check-component` no
|
|
97
|
+
longer accepts the suffixes `-accent` or `-accent-width`; a property
|
|
98
|
+
carrying one is a naming finding. The `set-geometry` op kind `accent-width`
|
|
99
|
+
is `indicator-width`, and an ops file naming the old kind is rejected.
|
|
100
|
+
`accent` now names the color family only, so Badge's and CornerBadge's
|
|
101
|
+
`--*-accent-*` are untouched.
|
|
102
|
+
- **SectionDivider's fill reads `-surface`.** Its three `-background`
|
|
103
|
+
properties are `-surface`, matching every other component's fill name,
|
|
104
|
+
renamed on load. `check-component` no longer accepts the suffix
|
|
105
|
+
`-background`; a property carrying one is a naming finding.
|
|
106
|
+
- **A property's prefix is the component's id, with no exception.**
|
|
107
|
+
CornerBadge's forty `--corner-badge-*` properties are `--cornerbadge-*`,
|
|
108
|
+
renamed on load. `check-component` no longer accepts a hyphenated prefix
|
|
109
|
+
for any component; a property that carries one is a naming finding.
|
|
110
|
+
- **A text part's color is its bare name.** Toggle's `--toggle-label-text`
|
|
111
|
+
and `--toggle-disabled-label-text` are `--toggle-label` and
|
|
112
|
+
`--toggle-disabled-label`, renamed on load, matching every other
|
|
113
|
+
component's bare-part color.
|
|
114
|
+
- **A callback prop is `on` followed by the event name, all lowercase.**
|
|
115
|
+
TabBar's `ontabChange` is `onchange`. InlineEditActions' `onSave` and
|
|
116
|
+
`onCancel` are `onsave` and `oncancel`. A consumer passing the old prop
|
|
117
|
+
name stops compiling; there is no runtime migration for a prop.
|
|
118
|
+
- **`open` everywhere.** Dialog's `show` prop is `open`, still `$bindable`.
|
|
119
|
+
CollapsibleSection's `expanded` prop is `open`, and its four
|
|
120
|
+
`-expanded-` properties are `-open-`, renamed on load. A consumer passing
|
|
121
|
+
the old prop name stops compiling; there is no runtime migration for a
|
|
122
|
+
prop.
|
|
123
|
+
- **Size values are `default` and `small`.** Card's `size="compact"` is
|
|
124
|
+
`size="small"`. Notification's `size="normal"` is `size="default"` and
|
|
125
|
+
`size="compact"` is `size="small"`. A consumer passing the old value
|
|
126
|
+
stops compiling; there is no runtime migration for a prop.
|
|
127
|
+
- **TabBar's `selectedTab` is `value`; SideNavigation's `titleLabel` is
|
|
128
|
+
`title`.** Both now hold the same kind of value SegmentedControl's and
|
|
129
|
+
MenuSelect's `value` props do. `titleHref` is unchanged. A consumer
|
|
130
|
+
passing the old prop name stops compiling; there is no runtime migration
|
|
131
|
+
for a prop.
|
|
132
|
+
- **Badge's and CornerBadge's `primary` variant is `brand`.** The variant
|
|
133
|
+
paints the brand color family, which its tokens already name
|
|
134
|
+
(`--surface-brand`), so `variant="primary"` on either component is
|
|
135
|
+
`variant="brand"` and the rendered class is `badge-brand`. Badge's
|
|
136
|
+
thirteen `--badge-primary-*` and CornerBadge's three
|
|
137
|
+
`--cornerbadge-primary-*` properties are `--badge-brand-*` and
|
|
138
|
+
`--cornerbadge-brand-*`, renamed on load. Button's and IconButton's
|
|
139
|
+
`primary`, the one primary action a page carries, is unchanged. A consumer
|
|
140
|
+
passing the old value stops compiling; there is no runtime migration for a
|
|
141
|
+
prop.
|
|
142
|
+
|
|
143
|
+
### Changed
|
|
144
|
+
|
|
145
|
+
- **Every shipped catalogue entry explains the props that carry a choice.**
|
|
146
|
+
`props.variant` on Badge, CornerBadge, Callout, Notification, Card, and
|
|
147
|
+
Slider, `props.anchor` on CornerBadge, `props.type` on Input,
|
|
148
|
+
`props.role` on MenuSelect, and `props.minHeight` on Panel, which used to
|
|
149
|
+
sit inside `useFor`. SectionDivider's entry keys its size guidance under
|
|
150
|
+
`variant`, the prop's real name, instead of `level`, and adds `eyebrow`
|
|
151
|
+
and `description`. The registry contract test now fails on a `props` key
|
|
152
|
+
that names no declared prop.
|
|
153
|
+
- **`components` prints only the catalogue fields a file has.** A file whose
|
|
154
|
+
export lacks a field no longer prints `Use for: undefined`; the
|
|
155
|
+
`missing-description` finding already names the field.
|
|
156
|
+
- **"section" replaces "band" and "range" replaces "band"** in the catalogue,
|
|
157
|
+
the skills, the docs, and the README, following the design vocabulary in
|
|
158
|
+
`docs/terminology.md`.
|
|
159
|
+
- **`contract-preview` is retired.** The harness throws `contract-states`
|
|
160
|
+
from its state assertions and `contract-interaction` from its interaction
|
|
161
|
+
assertions directly, so a failure the CLI used to report under
|
|
162
|
+
`contract-preview` now reports under the rule that actually failed.
|
|
163
|
+
- **`report --json`'s `components[]` facts are narrower.** No `name`,
|
|
164
|
+
`unread`, or `described`; a component's unread tokens and missing
|
|
165
|
+
description are now the `unread-token` and `missing-description` findings
|
|
166
|
+
under `findings.components`. `usage` drops `customUnregistered`; an
|
|
167
|
+
unregistered project component is now `missing-registration`.
|
|
168
|
+
- **The catalogue reads "views" for what TabBar switches, "a note" for
|
|
169
|
+
Tooltip, "section" for what Panel frames, and "a modal window" for
|
|
170
|
+
Dialog.**
|
|
171
|
+
- **`docs/terminology.md` and the create-component skill record the
|
|
172
|
+
component naming rules**: which word names a prop or a semantic property,
|
|
173
|
+
and the retired spellings each replaces.
|
|
174
|
+
|
|
175
|
+
### Removed
|
|
176
|
+
|
|
177
|
+
- **`live-tokens-fix-findings` is gone.** `live-tokens-check-compliance`
|
|
178
|
+
now checks and fixes the whole project: it reads the report, runs the
|
|
179
|
+
token migrations, runs both checkers, repairs each remaining finding from
|
|
180
|
+
its `guidance`, and adds `check:design` to the build. "Make check:design
|
|
181
|
+
pass" and "fix the project" now reach it. `npx live-tokens setup-claude
|
|
182
|
+
--force` deletes a project's old copy, because it prunes every
|
|
183
|
+
`live-tokens-` skill a release no longer ships.
|
|
184
|
+
|
|
185
|
+
### Fixed
|
|
186
|
+
|
|
187
|
+
- **The overlay's collapsed pill no longer covers the pinned variant strip on
|
|
188
|
+
the components page.** While the pill rests in the top band the overlay
|
|
189
|
+
publishes its right inset as `--lt-pill-inset`, and the pinned preview header
|
|
190
|
+
wraps its tabs clear of it. The contract harness's tab clicks are forced
|
|
191
|
+
clicks again, so chrome over a tab fails the run.
|
|
192
|
+
- **The component inventory discovers a runtime nested below a
|
|
193
|
+
`componentDirs` entry**, not only one directly inside it. `componentInventory`
|
|
194
|
+
now walks each directory recursively, the way the discovery it replaced did.
|
|
195
|
+
- **`config-token` reads `component-configs/<id>/default.json` from the
|
|
196
|
+
project's actual data directory** — `dataDir` in `live-tokens.testing.ts` or
|
|
197
|
+
`live-tokens.config.json`, same resolution `check-component --tests`
|
|
198
|
+
already isolates — instead of the literal `src/live-tokens/data`.
|
|
199
|
+
- **`config-token` checks an alias against its own component's properties**,
|
|
200
|
+
not the union across every component's. An alias that names a sibling
|
|
201
|
+
component's property now fires, where it used to pass silently.
|
|
202
|
+
- **A component with neither a runtime nor an editor reports both
|
|
203
|
+
`missing-file` findings**, not only the runtime's. The editor check runs
|
|
204
|
+
before the runtime check returns.
|
|
205
|
+
- **`check-page`'s attribute parser reads an attribute a newline separates
|
|
206
|
+
from the tag name**, and reads `size = "small"` — spaces around `=` — as
|
|
207
|
+
Svelte does, as one attribute rather than a stray `=` that stopped the scan.
|
|
208
|
+
- **One broken alias is one finding.** `check-component <id> --tests` used to
|
|
209
|
+
report a `default.json` alias naming an unknown token twice: once as
|
|
210
|
+
`config-token` from the static read, once as `contract-alias` from the
|
|
211
|
+
browser watching the same property resolve to nothing. The merge now drops
|
|
212
|
+
the browser's copy when every property it names already carries a
|
|
213
|
+
`config-token` finding for that component. A `contract-alias` naming a token
|
|
214
|
+
the vocabulary knows, declared and still unresolved, is a different defect
|
|
215
|
+
and stays.
|
|
216
|
+
- **A missing runtime is the registry rule's finding.** The behavior suite
|
|
217
|
+
skips a component's cases, with the reason, when the file its registration
|
|
218
|
+
names does not exist, instead of failing every declared case on the same
|
|
219
|
+
unresolved import. `contract-behavior` then reads `incomplete` in coverage,
|
|
220
|
+
explained by the `contract-registry` failure beside it.
|
|
221
|
+
- **Every registry assertion names its component.** "Every authored component
|
|
222
|
+
is registered" is now one assertion per authored id, so an unregistered
|
|
223
|
+
component reports `contract-registry` naming itself. It used to reach the
|
|
224
|
+
CLI as `tests-setup`, which means the tooling never ran.
|
|
225
|
+
- **A page obligation measures a page that has stopped moving.** `PageHarness`
|
|
226
|
+
waited on `--body-md-font-size`, which `tokens.css` sets on its own, then on
|
|
227
|
+
two animation frames. A page whose theme values, route stylesheet, or fonts
|
|
228
|
+
were still arriving could be measured mid-flight, and a rule reading its
|
|
229
|
+
geometry would report a finding on one run and none on the next. The harness
|
|
230
|
+
now waits for a quiet window over the page's geometry, its projected root
|
|
231
|
+
style, and its font set, bounded so a page that never settles is still
|
|
232
|
+
measured.
|
|
233
|
+
|
|
234
|
+
## 0.78.0 — A page proves compliance as rendered
|
|
235
|
+
|
|
236
|
+
### Added
|
|
237
|
+
|
|
238
|
+
- **A page proves compliance as rendered, not just in source.** `check-page
|
|
239
|
+
--tests` opens each page's own route in a Playwright browser, against the
|
|
240
|
+
consumer's own app, and reports five rule ids no static read of the source
|
|
241
|
+
could: `page-component-paint` (every shipped component instance paints its
|
|
242
|
+
contracted parts from its semantic properties, never from a page-wide or
|
|
243
|
+
`site.css` rule that reaches past them), `page-text-style` (every run of
|
|
244
|
+
text sits in one shipped text style, never inherited from a container typed
|
|
245
|
+
for a different role), `page-contrast` (every text and surface pair the
|
|
246
|
+
page composes meets AA), `page-grid` (every section's edges land on the
|
|
247
|
+
page's own column lines), and `page-overflow` (nothing overflows its
|
|
248
|
+
container, at either viewport). Coverage is reported by page, rule, and
|
|
249
|
+
viewport; a rule that observed nothing on a page reports `inapplicable`
|
|
250
|
+
with a reason, never a silent pass. `live-tokens.testing.ts` gains two
|
|
251
|
+
settings: `pageRoutes`, for a route the app's own route table cannot
|
|
252
|
+
express, and `pageViewports`, to replace the two sizes every rule runs at.
|
|
253
|
+
- **Two static rules close source-level gaps `check-page` left open.**
|
|
254
|
+
`native-control` flags a raw `<button>`, `<input>`, `<select>`, or
|
|
255
|
+
`<textarea>` where a shipped component belongs. `property-override` flags a
|
|
256
|
+
page that declares or sets a component token's name directly, in a style
|
|
257
|
+
block, an inline `style`, a `style:` directive, or `setProperty`, rather
|
|
258
|
+
than retuning the component for the whole project at
|
|
259
|
+
`/live-tokens/components`.
|
|
260
|
+
- **The consumer acceptance gate now covers a page.** `check:smoke-page-tests`
|
|
261
|
+
packs the built package into a fresh project outside the repository,
|
|
262
|
+
scaffolds it with `create`, and proves the documented command against the
|
|
263
|
+
template's own clean page and against the same page under a deliberate
|
|
264
|
+
`site.css` override: the clean page passes, the override fails
|
|
265
|
+
`page-component-paint` at the page file, and source-tree hashes prove the
|
|
266
|
+
isolated run never touched the project's own data. Wired into
|
|
267
|
+
`prepublishOnly` beside the existing component gate. Both gates now carry a
|
|
268
|
+
twenty-minute deadline of their own, naming the step that did not finish.
|
|
269
|
+
|
|
270
|
+
### Changed
|
|
271
|
+
|
|
272
|
+
- **The `create` template's `test:design` runs both suites:**
|
|
273
|
+
`live-tokens check-component --tests && live-tokens check-page --tests`.
|
|
274
|
+
- **The live-tokens-create-page skill's Verify step runs the rendered check.**
|
|
275
|
+
After live-tokens-check-compliance, it runs `check-page --tests --strict`
|
|
276
|
+
on the page it built. The manual line "every control stays inside its
|
|
277
|
+
wrapper" moves to the automated `page-overflow` rule; every other
|
|
278
|
+
editorial line stays.
|
|
279
|
+
- **The `create` template's own Home page collapses to one column below
|
|
280
|
+
768px.** Its `.stub` held a fixed twelve-column span with no phone
|
|
281
|
+
breakpoint, so `page-overflow` failed at 390x844, the defect
|
|
282
|
+
`check:smoke-page-tests` now catches on any page written to that shape.
|
|
283
|
+
The template ships no exclusion mechanism, so the fix is the page's own
|
|
284
|
+
`@media (max-width: 767px)` rule, the same shape every page-defects
|
|
285
|
+
fixture already takes.
|
|
286
|
+
|
|
3
287
|
## 0.77.0 — A consumer component runs the same suites
|
|
4
288
|
|
|
5
289
|
### Added
|
package/README.md
CHANGED
|
@@ -338,7 +338,7 @@ Once installed in a project, the same commands are available as `npx live-tokens
|
|
|
338
338
|
|
|
339
339
|
## Claude Code skills
|
|
340
340
|
|
|
341
|
-
The package bundles
|
|
341
|
+
The package bundles eight Claude Code skills. They encode the conventions this README cannot carry in full: which component fits a need, how a page is wired, how one request becomes a whole look, what a valid theme looks like in OKLCH, how two typefaces sit together, how geometry moves along the token scales, how a project is checked against all of that, and how an existing page or component is brought back into line. Each triggers from an ordinary request, so there are no slash commands to learn.
|
|
342
342
|
|
|
343
343
|
### Install
|
|
344
344
|
|
|
@@ -390,7 +390,7 @@ Ask for color: "a cooler palette", "warmer", "more contrast", "calmer", "make th
|
|
|
390
390
|
|
|
391
391
|
The skill translates the color intent into ten OKLCH base colors (Brand, Accent, Special, Canvas, Neutral, Alternate, Info, Success, Warning, Danger) plus a light or dark scheme, then runs `npx live-tokens set-colors <base-colors.json>`. The CLI assembles the curves, enforces AA contrast on derived text tokens and auto-corrects where it can, writes the result to the unsaved colors-and-type buffer, and prints a contrast report. Exit 1 means the base colors themselves are unworkable, and each failure line names the base color to change.
|
|
392
392
|
|
|
393
|
-
Most of the skill is the judgment the generator cannot supply: a chroma budget scaled to how much screen area each palette covers, per-role lightness and hue
|
|
393
|
+
Most of the skill is the judgment the generator cannot supply: a chroma budget scaled to how much screen area each palette covers, per-role lightness and hue ranges for each scheme, three levels of canvas commitment, gamut guardrails against impossible base colors, harmony modes, and the optional canvas gradient. OKLCH anchors for every named feeling, idiom, and occasion live in a reference file the skill reads on demand.
|
|
394
394
|
|
|
395
395
|
Color is the one dimension every look fixes, so it runs first and never skips. `--dry-run` prints the report without writing. Saving the open theme in the editor, or running `save-theme`, keeps the result; Adopt ships it. A re-run replaces the buffer's whole color state, including palette edits made in the editor since the last run, and carries the type and geometry buffers forward.
|
|
396
396
|
|
|
@@ -420,25 +420,19 @@ Ask for something the catalogue lacks: "author a Rating component", "make my Chi
|
|
|
420
420
|
|
|
421
421
|
The skill covers the recipe: the runtime `.svelte` file with its `:global(:root)` token block, the editor `.svelte` file exporting `allTokens` and its variant groups, the `registerComponent()` call, and the catalogue entry that keeps `live-tokens-pick-component` current. It carries the naming scheme, the token suffix vocabulary, the state model (component states such as selected and disabled are separate from interaction states such as hover), and the public-imports rule, and points at the shipped `Toggle` in `node_modules` as the worked example. Linked siblings, intrinsics, and the fixed-overlay portal rule sit in reference files the skill reads only when a component needs them.
|
|
422
422
|
|
|
423
|
-
### `live-tokens-check-compliance`
|
|
424
|
-
|
|
425
|
-
Ask how things stand: "check this project against the design system", "audit the pricing page", "what would it take to make the build pass?", "review this before I upgrade".
|
|
426
|
-
|
|
427
|
-
The skill runs `npx live-tokens report --json`, which is the project as facts: pending `tokens.css` migrations, the tokens each component declares and reads, which page renders which component, and both checkers' findings by rule under the project's severities and under `--strict`. It presents the report, says what each rule holds, marks each recommended fix as mechanical or a judgement call, names any visible shift, and flags a finding that looks deliberate together with the config entry that would record the decision. It edits nothing and ends by handing the list to `live-tokens-fix-findings`.
|
|
428
|
-
|
|
429
|
-
### `live-tokens-fix-findings`
|
|
430
|
-
|
|
431
|
-
Ask for the existing code to catch up: "make check:design pass", "fix the design-system warnings", "replace the hex and pixel values with tokens", "why is check-page failing on the pricing page?".
|
|
432
|
-
|
|
433
|
-
The two checkers report a stable rule id per finding. The skill runs them with `--json`, groups the findings by rule, and carries one fix recipe per rule: a colour literal becomes the token for its role rather than the nearest hue, a spacing literal moves to the nearest `--space-*` step with the shift named, a raw `font-size` becomes a whole text style, a prop the component does not declare is mapped or dropped, and `site.css` moves out of `main.ts` into each page. It re-runs after every rule and stops at exit 0, then reports what changed, what it left and why, and what `--strict` would add. It never silences a rule to pass and never adds a token to `tokens.css` to match a value a page happened to use.
|
|
434
|
-
|
|
435
423
|
Verify the result:
|
|
436
424
|
|
|
437
425
|
```bash
|
|
438
426
|
npx @motion-proto/live-tokens check-component <id>
|
|
439
427
|
```
|
|
440
428
|
|
|
441
|
-
The validator checks the file layout, the `:global(:root)` block, the token-suffix vocabulary, the state-before-property rule, the public-imports rule, the `registerComponent({ id })` call, and that every default resolves to a
|
|
429
|
+
The validator checks the file layout, the `:global(:root)` block, the token-suffix vocabulary, the state-before-property rule, the public-imports rule, the `registerComponent({ id })` call, and that every default resolves to a design token rather than a literal. Exit code 0 means the static contract is met. A project scaffolded by `create` runs it, with `check-page`, as `npm run check:design` before every `vite build`, so a component or page that opts out of the theme cannot ship by accident.
|
|
430
|
+
|
|
431
|
+
### `live-tokens-check-compliance`
|
|
432
|
+
|
|
433
|
+
Ask how things stand, or ask for the code to catch up: "check this project against the design system and fix it", "audit the pricing page", "make check:design pass", "fix the design-system warnings", "replace the hex and pixel values with tokens", "review this before I upgrade".
|
|
434
|
+
|
|
435
|
+
The skill runs `npx live-tokens report --json`, which is the project as facts: pending `tokens.css` migrations, the tokens each component declares and reads, which page renders which component, and both checkers' findings by rule under the project's severities and under `--strict`. It then runs `npx live-tokens migrate` and both checkers, which apply every `auto` repair themselves and return each remaining finding with its own `guidance`. The skill groups what remains by rule, largest error group first, makes each repair from its guidance, and re-runs until both checkers exit 0. It reports what `--strict` adds, clears the warnings when the request covers them, and adds `check:design` to the build with `--no-fix`. The reply names the fixes the checkers applied, the changes by rule with any visible shift, and each finding left with its reason. It never silences a rule to pass and never adds a token to `tokens.css` to match a value a page happened to use. A finding the user chooses to keep goes into the config entry its `exception` field names.
|
|
442
436
|
|
|
443
437
|
## From edit to production
|
|
444
438
|
|