@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
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: live-tokens-fix-findings
|
|
3
|
-
description: Fix every finding of check-page and check-component in an existing @motion-proto/live-tokens project until both exit 0. Called with the fix list by live-tokens-check-compliance. Use when the user asks to fix the project. Edits the files the checkers name. Updates tokens.css only through the migration command.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Fixing the findings of check-page and check-component
|
|
7
|
-
|
|
8
|
-
Fix every finding of `check-page` and `check-component` until both exit 0. `check-page` checks pages. Every component comes from the catalogue, every prop is declared, and every value in page CSS is a design token. `check-component` checks authored components. Every token names a semantic property, and its default is the design token that property reads. Update `tokens.css` only through the migration command. That command also heals the data tree, and with `--write` rewrites the route references it lists. When live-tokens-check-compliance hands over a fix list, the user's choices in it stand.
|
|
9
|
-
|
|
10
|
-
## Workflow
|
|
11
|
-
|
|
12
|
-
When `check-page` is an unknown command, upgrade `@motion-proto/live-tokens` first.
|
|
13
|
-
|
|
14
|
-
1. Run `npx live-tokens migrate --check` to see the plan, then `npx live-tokens migrate` to apply it. `--tokens <path>` names a tokens.css in an unusual place.
|
|
15
|
-
2. Run both checkers with `--json`. Each finding carries a `rule`, a file, and a line.
|
|
16
|
-
```sh
|
|
17
|
-
npx live-tokens check-page --json
|
|
18
|
-
npx live-tokens check-component --json
|
|
19
|
-
```
|
|
20
|
-
3. Group the findings by rule.
|
|
21
|
-
4. Take the largest error group first, then the remaining errors. Take warnings only when the repair scope includes warnings.
|
|
22
|
-
5. Fix every finding in the group with its section: Color by role, Geometry by scale, or The remaining rules.
|
|
23
|
-
6. Run both checkers again. When repairable findings remain in scope, return to step 3. When no token fits a remaining finding, leave it and continue to the reply with its reason.
|
|
24
|
-
7. When the errors are clear, run both checkers with `--strict`. Report what `--strict` adds. Clear warnings within the existing request. Otherwise ask whether to clear the warnings now.
|
|
25
|
-
8. When the repair scope includes warnings, return to step 3 with `--strict`. When strict checks pass or the user defers warnings, continue to the reply.
|
|
26
|
-
9. Reply with:
|
|
27
|
-
- the changes by rule, each with its count and any visible shift
|
|
28
|
-
- the findings left, each with its reason and any config entry the user chose
|
|
29
|
-
- both checker commands with their exit codes
|
|
30
|
-
|
|
31
|
-
`check-page <path>` scopes a run to one page. `check-component <id>` scopes a run to one component: its runtime, its editor, and its registration. The checkers read tokens.css from its default location.
|
|
32
|
-
|
|
33
|
-
When `package.json` has no `check:design` script, add `"check:design": "live-tokens check-page && live-tokens check-component"`. When both checkers exit 0, prepend `npm run check:design &&` to the existing build command. Preserve its other build steps.
|
|
34
|
-
|
|
35
|
-
## Scope
|
|
36
|
-
|
|
37
|
-
- Add no token to `tokens.css`. Map a literal with no matching token to the nearest existing token by role. When no token fits, leave the finding and say so.
|
|
38
|
-
- When the user has chosen to lower a rule's severity, record it in `live-tokens.config.json` under `"checks": { "rules": { "<rule>": "warn" } }`. `--off=<rule>` silences a rule for one run only.
|
|
39
|
-
- When the nearest token differs from the literal, use the token and name the shift in the report, such as `14px` to `--space-16`.
|
|
40
|
-
|
|
41
|
-
## Color by role
|
|
42
|
-
|
|
43
|
-
`color-literal` is a judgement finding. The replacement is the token for the role the color plays. The theme moves every role together. `npx live-tokens tokens --scale <name>` prints a scale's names and values, with `--json` for data.
|
|
44
|
-
|
|
45
|
-
| Literal | Token | Notes |
|
|
46
|
-
| --- | --- | --- |
|
|
47
|
-
| Text on a surface | `--text-primary` through `--text-disabled` | The neutral text scale. `--text-<family>` for a family color. |
|
|
48
|
-
| Light text on a dark chip | `--text-inverted` | No AA guarantee. |
|
|
49
|
-
| A surface fill | `--surface-<family>-<level>` | The role names the family: `neutral` for chrome, `brand` for emphasis, `danger` for status. |
|
|
50
|
-
| A stroke | `--border-<family>-<level>` | Levels run `faint` to `strong`. |
|
|
51
|
-
| A translucent layer that dims what is behind it | `--scrim-low`, `--scrim`, `--scrim-high` | Behind a modal. |
|
|
52
|
-
| A translucent wash on a surface | `--tint-low`, `--tint`, `--tint-high` | A hover state. |
|
|
53
|
-
| Any other translucent color | The role's token at an opacity: `color-mix(in srgb, var(--surface-brand) 80%, transparent)` | The editor reads that form. |
|
|
54
|
-
| Fully transparent | `--color-transparent` | |
|
|
55
|
-
| A gradient | `--gradient-*` | Or compose one from surface tokens. |
|
|
56
|
-
|
|
57
|
-
## Geometry by scale
|
|
58
|
-
|
|
59
|
-
`dimension-literal` is a mechanical finding. A size, such as a hero's height, is layout. Leave it.
|
|
60
|
-
|
|
61
|
-
| Literal | Token | Notes |
|
|
62
|
-
| --- | --- | --- |
|
|
63
|
-
| Spacing | `--space-<px>` | `npx live-tokens tokens --scale space` prints the steps. Round to the nearest step. |
|
|
64
|
-
| A stroke width | `--border-width-1`, `-2`, `-4` | Also for `outline`. |
|
|
65
|
-
| A corner | `--radius-sm` through `--radius-4xl`, or `--radius-full` | |
|
|
66
|
-
| A shadow | `--shadow-sm` through `--shadow-xl` | Replace the whole value. |
|
|
67
|
-
| Part of a `calc()` | The token inside the calc | `calc(var(--space-64) * -2 + var(--space-8))` |
|
|
68
|
-
| A duration or easing | `--duration-*`, `--ease-*` | No rule reports it. Fix it while in the file. |
|
|
69
|
-
| A `blur()` | `--blur-*` | No rule reports it. Fix it while in the file. |
|
|
70
|
-
|
|
71
|
-
## The remaining rules
|
|
72
|
-
|
|
73
|
-
| Rule | Fix |
|
|
74
|
-
| --- | --- |
|
|
75
|
-
| `unknown-token` | Search `tokens.css` for the stem. When a contract-family name is gone, `npx live-tokens migrate --check` lists the migration that adds the current name. |
|
|
76
|
-
| `raw-text-axis` | Set every axis from one text style, `-font-family` through `-letter-spacing`. `npx live-tokens tokens --scale heading` prints one text style. The text styles are `heading`, `body`, `editorial`, and `code`. Rewrite a `font:` shorthand the same way. |
|
|
77
|
-
| `unknown-component` | Read **live-tokens-pick-component** for the shipped component that fits. When none fits, author one with **live-tokens-create-component**. |
|
|
78
|
-
| `unknown-prop` | `npx live-tokens components <id>` prints the declared props and their values. Map the prop to one of them, or delete it. |
|
|
79
|
-
| `unknown-prop-value` | Use a value from the union the message lists. |
|
|
80
|
-
| `control-size` | Delete the `size` prop. The shipped default is the page's size. When that default is wrong for the project, retune the component in `/live-tokens/components`. |
|
|
81
|
-
| `multiple-primary` | Keep the action that completes the main task `primary`. A Button with no `variant` counts as `primary`. Use `secondary` for supporting or related actions and `outline` for unrelated or informational actions. |
|
|
82
|
-
| `danger-without-dialog` | Open a `Dialog` from the danger Button or IconButton and run the action from the Dialog's confirm. The rule fires once per page, when the page imports no Dialog. For other actions, assign emphasis by the action's relationship to the main task. |
|
|
83
|
-
| `hardcoded-columns` | `repeat(var(--columns-count), 1fr)` for the page grid. `calc(var(--columns-count) - 2)` for a sub-grid spanning fewer columns. |
|
|
84
|
-
| `site-css-in-main` | Delete the import from `main.ts`. Add it to each page's `<script>`. Page CSS then stays off the editor routes. |
|
|
85
|
-
| `missing-source` | Add `source: 'src/...'` to the route entry. |
|
|
86
|
-
| `reserved-route` | Move the route out of `/live-tokens/*`. |
|
|
87
|
-
| `deep-import` | Import from `@motion-proto/live-tokens`, `/component-editor`, or `/components/<Name>.svelte`. |
|
|
88
|
-
| `fix: property-name` | Rename the token to the name a shipped component uses for the same role. The vocabulary and the state model are in **live-tokens-create-component**. |
|
|
89
|
-
| `fix: property-token` | Make the `:global(:root)` default read a design token, composed when needed. Declare a structural keyword, such as `start`, in the editor's `intrinsics`. |
|
|
90
|
-
| `fix: runtime` | Wire the component as the recipe in **live-tokens-create-component** wires it. |
|
|
91
|
-
| `fix: runtime-defaults` | Make the `:global(:root)` default the value Reset should restore, per the Runtime component section of **live-tokens-create-component**. |
|
|
92
|
-
| `fix: editor` | The editor names a token the runtime never declares, or a property targets the wrong part. Fix the editor's schema, states, or preview props by the Component editor section of **live-tokens-create-component**. |
|
|
93
|
-
| `fix: registration` | Register the component in the shared module the Registration section of **live-tokens-create-component** wires up, importable by the app and by `check-component --tests`. |
|
|
94
|
-
| `fix: sketch` | Add the missing Sketch part or marker, per the Sketch mode and overlays section of **live-tokens-create-component**. |
|
|
95
|
-
| `fix: tooling` | Install the named package (`@playwright/test`, `vitest`, or `happy-dom`) as a devDependency, then `npx playwright install chromium` for a missing browser. A bad path or config is named in the message; fix it and rerun `check-component <id> --tests`. |
|
|
96
|
-
| `fix: coverage` | A contract obligation never ran to a result. Add the missing contract, or find why the suite skipped it, then rerun. |
|
|
97
|
-
|
|
98
|
-
A `tests-*` finding names a problem with the run itself: the tool, the path, or a missing contract. Fix what the message names and rerun `check-component <id> --tests --json` until every applicable rule passes with no rule left `--off`.
|
|
@@ -1,469 +0,0 @@
|
|
|
1
|
-
import type { SkillTree } from '../types';
|
|
2
|
-
|
|
3
|
-
export const fixFindings: SkillTree = {
|
|
4
|
-
"id": "live-tokens-fix-findings",
|
|
5
|
-
"digest": "sha256:2c39f9f00b03b5ad",
|
|
6
|
-
"title": "fix-findings",
|
|
7
|
-
"tagline": "Repair Deviations from the Design System",
|
|
8
|
-
"nodes": [
|
|
9
|
-
{
|
|
10
|
-
"id": "ff-trig",
|
|
11
|
-
"row": 0,
|
|
12
|
-
"kind": "trigger",
|
|
13
|
-
"title": "Fix design-system findings",
|
|
14
|
-
"desc": "Repairs every finding the two checkers report, mapping each literal to the token for its role or scale, until both exit 0.",
|
|
15
|
-
"lines": [3, 3],
|
|
16
|
-
"anchor": "description: Fix every finding of check-page and check-compo"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"id": "ff-migrate",
|
|
20
|
-
"row": 1,
|
|
21
|
-
"kind": "step",
|
|
22
|
-
"title": "Run the token migration",
|
|
23
|
-
"desc": "Bring tokens.css up to the installed package first. A stale file shows as unknown tokens.",
|
|
24
|
-
"lines": [14, 14],
|
|
25
|
-
"anchor": "Run `npx live-tokens migrate --check` to see the plan, then "
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"id": "ff-run",
|
|
29
|
-
"row": 2,
|
|
30
|
-
"kind": "cli",
|
|
31
|
-
"title": "Run both checkers",
|
|
32
|
-
"desc": "Each finding names a rule, a file, and a line.",
|
|
33
|
-
"lines": [15, 19],
|
|
34
|
-
"anchor": "Run both checkers with `--json`. Each finding carries a `rul",
|
|
35
|
-
"anchorEnd": "```"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"id": "ff-clean",
|
|
39
|
-
"row": 3,
|
|
40
|
-
"kind": "ok",
|
|
41
|
-
"title": "Default checks pass",
|
|
42
|
-
"desc": "Both checkers exit 0.",
|
|
43
|
-
"lines": [24, 24],
|
|
44
|
-
"anchor": "When the errors are clear, run both checkers with `--strict`"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"id": "ff-group",
|
|
48
|
-
"row": 5,
|
|
49
|
-
"kind": "step",
|
|
50
|
-
"title": "Group findings by rule",
|
|
51
|
-
"desc": "Findings of one rule share one fix.",
|
|
52
|
-
"lines": [20, 20],
|
|
53
|
-
"anchor": "Group the findings by rule."
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"id": "ff-order",
|
|
57
|
-
"row": 6,
|
|
58
|
-
"kind": "chipset",
|
|
59
|
-
"title": "Repair order",
|
|
60
|
-
"desc": "Errors first, largest group first. Warnings only when the repair scope includes them.",
|
|
61
|
-
"lines": [21, 21],
|
|
62
|
-
"anchor": "Take the largest error group first, then the remaining error"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"id": "ff-recipe",
|
|
66
|
-
"row": 7,
|
|
67
|
-
"kind": "decide",
|
|
68
|
-
"title": "Rule family",
|
|
69
|
-
"desc": "Each rule belongs to one section, and that section gives the fix.",
|
|
70
|
-
"lines": [22, 22],
|
|
71
|
-
"anchor": "Fix every finding in the group with its section: Color by ro",
|
|
72
|
-
"chips": [
|
|
73
|
-
{
|
|
74
|
-
"label": "Color by role",
|
|
75
|
-
"lines": [41, 41],
|
|
76
|
-
"anchor": "## Color by role"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"label": "Geometry by scale",
|
|
80
|
-
"lines": [57, 57],
|
|
81
|
-
"anchor": "## Geometry by scale"
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"label": "The remaining rules",
|
|
85
|
-
"lines": [71, 71],
|
|
86
|
-
"anchor": "## The remaining rules"
|
|
87
|
-
}
|
|
88
|
-
]
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"id": "ff-color",
|
|
92
|
-
"row": 8,
|
|
93
|
-
"kind": "chipset",
|
|
94
|
-
"title": "Color by role",
|
|
95
|
-
"desc": "A color literal becomes the token for the role it plays.",
|
|
96
|
-
"lines": [41, 55],
|
|
97
|
-
"anchor": "## Color by role",
|
|
98
|
-
"anchorEnd": "| A gradient | `--gradient-*` | Or compose one from surface ",
|
|
99
|
-
"chips": [
|
|
100
|
-
{
|
|
101
|
-
"label": "Text on a surface",
|
|
102
|
-
"lines": [47, 47],
|
|
103
|
-
"anchor": "| Text on a surface | `--text-primary` through `--text-disab"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"label": "Light text on a dark chip",
|
|
107
|
-
"lines": [48, 48],
|
|
108
|
-
"anchor": "| Light text on a dark chip | `--text-inverted` | No AA guar"
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"label": "A surface fill",
|
|
112
|
-
"lines": [49, 49],
|
|
113
|
-
"anchor": "| A surface fill | `--surface-<family>-<level>` | The role n"
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"label": "A stroke",
|
|
117
|
-
"lines": [50, 50],
|
|
118
|
-
"anchor": "| A stroke | `--border-<family>-<level>` | Levels run `faint"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"label": "A translucent layer that dims what is behind it",
|
|
122
|
-
"lines": [51, 51],
|
|
123
|
-
"anchor": "| A translucent layer that dims what is behind it | `--scrim"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"label": "A translucent wash on a surface",
|
|
127
|
-
"lines": [52, 52],
|
|
128
|
-
"anchor": "| A translucent wash on a surface | `--tint-low`, `--tint`, "
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"label": "Any other translucent color",
|
|
132
|
-
"lines": [53, 53],
|
|
133
|
-
"anchor": "| Any other translucent color | The role's token at an opaci"
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
"label": "Fully transparent",
|
|
137
|
-
"lines": [54, 54],
|
|
138
|
-
"anchor": "| Fully transparent | `--color-transparent` | |"
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
"label": "A gradient",
|
|
142
|
-
"lines": [55, 55],
|
|
143
|
-
"anchor": "| A gradient | `--gradient-*` | Or compose one from surface "
|
|
144
|
-
}
|
|
145
|
-
]
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
"id": "ff-geometry",
|
|
149
|
-
"row": 8,
|
|
150
|
-
"kind": "chipset",
|
|
151
|
-
"title": "Geometry by scale",
|
|
152
|
-
"desc": "A dimension literal moves to the nearest step of its scale. A layout size stays.",
|
|
153
|
-
"lines": [57, 69],
|
|
154
|
-
"anchor": "## Geometry by scale",
|
|
155
|
-
"anchorEnd": "| A `blur()` | `--blur-*` | No rule reports it. Fix it while"
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
"id": "ff-remaining",
|
|
159
|
-
"row": 8,
|
|
160
|
-
"kind": "chipset",
|
|
161
|
-
"title": "The remaining rules",
|
|
162
|
-
"desc": "Every other rule has its fix in the table.",
|
|
163
|
-
"lines": [71, 90],
|
|
164
|
-
"anchor": "## The remaining rules",
|
|
165
|
-
"anchorEnd": "| `fix: runtime` | Wire the component as the recipe in **liv",
|
|
166
|
-
"chips": [
|
|
167
|
-
{
|
|
168
|
-
"label": "unknown-token",
|
|
169
|
-
"lines": [75, 75],
|
|
170
|
-
"anchor": "| `unknown-token` | Search `tokens.css` for the stem. When a"
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
"label": "raw-text-axis",
|
|
174
|
-
"lines": [76, 76],
|
|
175
|
-
"anchor": "| `raw-text-axis` | Set every axis from one text style, `-fo"
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
"label": "unknown-component",
|
|
179
|
-
"lines": [77, 77],
|
|
180
|
-
"anchor": "| `unknown-component` | Read **live-tokens-pick-component** "
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
"label": "unknown-prop",
|
|
184
|
-
"lines": [78, 78],
|
|
185
|
-
"anchor": "| `unknown-prop` | `npx live-tokens components <id>` prints "
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
"label": "unknown-prop-value",
|
|
189
|
-
"lines": [79, 79],
|
|
190
|
-
"anchor": "| `unknown-prop-value` | Use a value from the union the mess"
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
"label": "control-size",
|
|
194
|
-
"lines": [80, 80],
|
|
195
|
-
"anchor": "| `control-size` | Delete the `size` prop. The shipped defau"
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
"label": "multiple-primary",
|
|
199
|
-
"lines": [81, 81],
|
|
200
|
-
"anchor": "| `multiple-primary` | Keep the action that completes the ma"
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
"label": "danger-without-dialog",
|
|
204
|
-
"lines": [82, 82],
|
|
205
|
-
"anchor": "| `danger-without-dialog` | Open a `Dialog` from the danger "
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
"label": "hardcoded-columns",
|
|
209
|
-
"lines": [83, 83],
|
|
210
|
-
"anchor": "| `hardcoded-columns` | `repeat(var(--columns-count), 1fr)` "
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
"label": "site-css-in-main",
|
|
214
|
-
"lines": [84, 84],
|
|
215
|
-
"anchor": "| `site-css-in-main` | Delete the import from `main.ts`. Add"
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
"label": "missing-source",
|
|
219
|
-
"lines": [85, 85],
|
|
220
|
-
"anchor": "| `missing-source` | Add `source: 'src/...'` to the route en"
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
"label": "reserved-route",
|
|
224
|
-
"lines": [86, 86],
|
|
225
|
-
"anchor": "| `reserved-route` | Move the route out of `/live-tokens/*`."
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
"label": "deep-import",
|
|
229
|
-
"lines": [87, 87],
|
|
230
|
-
"anchor": "| `deep-import` | Import from `@motion-proto/live-tokens`, `"
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
"label": "Component name rules",
|
|
234
|
-
"lines": [88, 88],
|
|
235
|
-
"anchor": "| `fix: property-name` | Rename the token to the name a ship"
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
"label": "Component token rules",
|
|
239
|
-
"lines": [89, 89],
|
|
240
|
-
"anchor": "| `fix: property-token` | Make the `:global(:root)` default "
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
"label": "Component editor rules",
|
|
244
|
-
"lines": [92, 92],
|
|
245
|
-
"anchor": "| `fix: editor` | The editor names a token the runtime never"
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
"label": "Component wiring rules",
|
|
249
|
-
"lines": [90, 90],
|
|
250
|
-
"anchor": "| `fix: runtime` | Wire the component as the recipe in **liv"
|
|
251
|
-
}
|
|
252
|
-
]
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
"id": "ff-rerun",
|
|
256
|
-
"row": 11,
|
|
257
|
-
"kind": "cli",
|
|
258
|
-
"title": "Rerun both checkers",
|
|
259
|
-
"desc": "Run both checkers again to see what remains.",
|
|
260
|
-
"lines": [23, 23],
|
|
261
|
-
"anchor": "Run both checkers again. When repairable findings remain in "
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
"id": "ff-repeat",
|
|
265
|
-
"row": 12,
|
|
266
|
-
"kind": "gate",
|
|
267
|
-
"title": "Regroup the remaining findings",
|
|
268
|
-
"desc": "Findings a token can fix go back through grouping.",
|
|
269
|
-
"lines": [23, 23],
|
|
270
|
-
"anchor": "Run both checkers again. When repairable findings remain in "
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
"id": "ff-unresolved",
|
|
274
|
-
"row": 12,
|
|
275
|
-
"kind": "step",
|
|
276
|
-
"title": "Record the unresolved findings",
|
|
277
|
-
"desc": "A finding no token fits stays, and the reply says why.",
|
|
278
|
-
"lines": [37, 37],
|
|
279
|
-
"anchor": "Add no token to `tokens.css`. Map a literal with no matching"
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
"id": "ff-strict",
|
|
283
|
-
"row": 14,
|
|
284
|
-
"kind": "cli",
|
|
285
|
-
"title": "Run strict checks",
|
|
286
|
-
"desc": "Strict mode counts every warning as an error.",
|
|
287
|
-
"lines": [24, 24],
|
|
288
|
-
"anchor": "When the errors are clear, run both checkers with `--strict`"
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
"id": "ff-warnings",
|
|
292
|
-
"row": 15,
|
|
293
|
-
"kind": "decide",
|
|
294
|
-
"title": "Warning scope",
|
|
295
|
-
"desc": "Warnings are cleared when the request includes them. Otherwise the user chooses.",
|
|
296
|
-
"lines": [24, 25],
|
|
297
|
-
"anchor": "When the errors are clear, run both checkers with `--strict`",
|
|
298
|
-
"anchorEnd": "When the repair scope includes warnings, return to step 3 wi",
|
|
299
|
-
"chips": [
|
|
300
|
-
{
|
|
301
|
-
"label": "repair scope includes warnings",
|
|
302
|
-
"lines": [25, 25],
|
|
303
|
-
"anchor": "When the repair scope includes warnings, return to step 3 wi"
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
"label": "user defers warnings",
|
|
307
|
-
"lines": [25, 25],
|
|
308
|
-
"anchor": "When the repair scope includes warnings, return to step 3 wi"
|
|
309
|
-
}
|
|
310
|
-
]
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
"id": "ff-warning-loop",
|
|
314
|
-
"row": 16,
|
|
315
|
-
"kind": "gate",
|
|
316
|
-
"title": "Include warnings in the repair scope",
|
|
317
|
-
"desc": "The warnings go back through grouping, with --strict on every run.",
|
|
318
|
-
"lines": [25, 25],
|
|
319
|
-
"anchor": "When the repair scope includes warnings, return to step 3 wi"
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
"id": "ff-build",
|
|
323
|
-
"row": 17,
|
|
324
|
-
"kind": "step",
|
|
325
|
-
"title": "Gate the existing build",
|
|
326
|
-
"desc": "The build runs check:design first, so findings fail the build from now on.",
|
|
327
|
-
"lines": [33, 33],
|
|
328
|
-
"anchor": "When `package.json` has no `check:design` script, add `\"chec"
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
"id": "ff-reply",
|
|
332
|
-
"row": 18,
|
|
333
|
-
"kind": "chipset",
|
|
334
|
-
"title": "Reply with the repair results",
|
|
335
|
-
"desc": "Report the changes by rule, the findings left with their reasons, and both exit codes.",
|
|
336
|
-
"lines": [26, 29],
|
|
337
|
-
"anchor": "Reply with:",
|
|
338
|
-
"anchorEnd": "both checker commands with their exit codes"
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
"id": "ff-done",
|
|
342
|
-
"row": 19,
|
|
343
|
-
"kind": "done",
|
|
344
|
-
"title": "Repair results complete",
|
|
345
|
-
"desc": "Both checkers pass, or every finding left has a reason.",
|
|
346
|
-
"lines": [26, 29],
|
|
347
|
-
"anchor": "Reply with:",
|
|
348
|
-
"anchorEnd": "both checker commands with their exit codes"
|
|
349
|
-
}
|
|
350
|
-
],
|
|
351
|
-
"edges": [
|
|
352
|
-
{
|
|
353
|
-
"to": "ff-migrate",
|
|
354
|
-
"from": "ff-trig"
|
|
355
|
-
},
|
|
356
|
-
{
|
|
357
|
-
"to": "ff-run",
|
|
358
|
-
"from": "ff-migrate"
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
"to": "ff-group",
|
|
362
|
-
"from": "ff-run",
|
|
363
|
-
"label": "findings"
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
"to": "ff-clean",
|
|
367
|
-
"from": "ff-run",
|
|
368
|
-
"label": "exit 0"
|
|
369
|
-
},
|
|
370
|
-
{
|
|
371
|
-
"to": "ff-strict",
|
|
372
|
-
"from": "ff-clean"
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
"to": "ff-order",
|
|
376
|
-
"from": "ff-group"
|
|
377
|
-
},
|
|
378
|
-
{
|
|
379
|
-
"to": "ff-color",
|
|
380
|
-
"from": "ff-recipe",
|
|
381
|
-
"label": "Color by role"
|
|
382
|
-
},
|
|
383
|
-
{
|
|
384
|
-
"to": "ff-rerun",
|
|
385
|
-
"from": "ff-color"
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
"to": "ff-geometry",
|
|
389
|
-
"from": "ff-recipe",
|
|
390
|
-
"label": "Geometry by scale"
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
"to": "ff-rerun",
|
|
394
|
-
"from": "ff-geometry"
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
"to": "ff-remaining",
|
|
398
|
-
"from": "ff-recipe",
|
|
399
|
-
"label": "The remaining rules"
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
"to": "ff-rerun",
|
|
403
|
-
"from": "ff-remaining"
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
"to": "ff-repeat",
|
|
407
|
-
"from": "ff-rerun",
|
|
408
|
-
"label": "repairable findings"
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
"to": "ff-group",
|
|
412
|
-
"from": "ff-repeat",
|
|
413
|
-
"label": "return to step 3",
|
|
414
|
-
"back": true
|
|
415
|
-
},
|
|
416
|
-
{
|
|
417
|
-
"to": "ff-unresolved",
|
|
418
|
-
"from": "ff-rerun",
|
|
419
|
-
"label": "no token fits"
|
|
420
|
-
},
|
|
421
|
-
{
|
|
422
|
-
"to": "ff-reply",
|
|
423
|
-
"from": "ff-unresolved"
|
|
424
|
-
},
|
|
425
|
-
{
|
|
426
|
-
"to": "ff-strict",
|
|
427
|
-
"from": "ff-rerun",
|
|
428
|
-
"label": "errors clear"
|
|
429
|
-
},
|
|
430
|
-
{
|
|
431
|
-
"to": "ff-warnings",
|
|
432
|
-
"from": "ff-strict",
|
|
433
|
-
"label": "warnings"
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
"to": "ff-build",
|
|
437
|
-
"from": "ff-strict",
|
|
438
|
-
"label": "strict checks pass"
|
|
439
|
-
},
|
|
440
|
-
{
|
|
441
|
-
"to": "ff-warning-loop",
|
|
442
|
-
"from": "ff-warnings",
|
|
443
|
-
"label": "repair scope includes warnings"
|
|
444
|
-
},
|
|
445
|
-
{
|
|
446
|
-
"to": "ff-build",
|
|
447
|
-
"from": "ff-warnings",
|
|
448
|
-
"label": "user defers warnings"
|
|
449
|
-
},
|
|
450
|
-
{
|
|
451
|
-
"to": "ff-group",
|
|
452
|
-
"from": "ff-warning-loop",
|
|
453
|
-
"label": "use --strict",
|
|
454
|
-
"back": true
|
|
455
|
-
},
|
|
456
|
-
{
|
|
457
|
-
"to": "ff-reply",
|
|
458
|
-
"from": "ff-build"
|
|
459
|
-
},
|
|
460
|
-
{
|
|
461
|
-
"to": "ff-done",
|
|
462
|
-
"from": "ff-reply"
|
|
463
|
-
},
|
|
464
|
-
{
|
|
465
|
-
"to": "ff-recipe",
|
|
466
|
-
"from": "ff-order"
|
|
467
|
-
}
|
|
468
|
-
]
|
|
469
|
-
};
|