@fusion.dev/helix-docs 0.186.1 → 0.187.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/content/coding-agents.mdx +95 -41
- package/content/metrics.mdx +220 -220
- package/content/using-helix-with-an-agent.mdx +46 -39
- package/dist/index.d.ts +3 -4
- package/dist/index.js +2 -3
- package/dist/pages.generated.js +1 -1
- package/dist/reference.d.ts +12 -11
- package/dist/reference.js +13 -7
- package/dist/sources.generated.js +361 -300
- package/package.json +9 -9
- package/dist/catalog.d.ts +0 -194
- package/dist/catalog.js +0 -163
- package/dist/naming.d.ts +0 -14
- package/dist/naming.js +0 -8
|
@@ -45,15 +45,20 @@ type such as `ButtonEmphasis` sends you somewhere else to look.
|
|
|
45
45
|
## Markdown and JSON for each component family
|
|
46
46
|
|
|
47
47
|
```
|
|
48
|
-
/components/<family>.md
|
|
49
|
-
/components/<family>.json
|
|
48
|
+
https://fusion.dev/helix/components/<family>.md
|
|
49
|
+
https://fusion.dev/helix/components/<family>.json
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
These are static files.
|
|
52
|
+
These are static files, one pair for each family. Read the family you are
|
|
53
|
+
writing instead of the whole manifest. The manifest holds every family in one
|
|
54
|
+
file, and it is several megabytes.
|
|
55
|
+
|
|
56
|
+
The `.md` file has:
|
|
53
57
|
|
|
54
58
|
- the family's metadata
|
|
59
|
+
- a Usage block with the import lines for the family
|
|
55
60
|
- every element's description and API tables
|
|
56
|
-
- the examples
|
|
61
|
+
- the examples, each with the import lines it needs
|
|
57
62
|
|
|
58
63
|
The HTML page leaves the examples out on purpose. The page lists what a
|
|
59
64
|
component can do, and the sandbox beside it shows what the component looks
|
|
@@ -61,24 +66,49 @@ like. Keeping pictures out of the reference keeps it the one place you can trust
|
|
|
61
66
|
to be complete. An agent cannot use the sandbox, and it reads an example as
|
|
62
67
|
text, so the `.md` file includes the examples.
|
|
63
68
|
|
|
64
|
-
|
|
69
|
+
Each example the visual check pictures links its pictures under it: wide at
|
|
70
|
+
640 pixels, narrow at 390, and dark at 640, taken in the environment that
|
|
71
|
+
`examples.json` records. Compare a render of your own to them.
|
|
72
|
+
|
|
73
|
+
The `.json` file has the same family as structured data, and three fields an
|
|
74
|
+
agent uses most:
|
|
75
|
+
|
|
76
|
+
- `usage`, the import block for each tier
|
|
77
|
+
- `imports` on each example, an import line for every element it writes
|
|
78
|
+
- `specifier` and `words` on each element: the line that registers it, and the
|
|
79
|
+
properties `registerWords` translates
|
|
80
|
+
|
|
81
|
+
## Import every family you write
|
|
82
|
+
|
|
83
|
+
Each tag needs its family's entry imported. A family registers its own parts,
|
|
84
|
+
so `@fusion.dev/helix/tabs` registers Tab and Tab Panel. A family does not
|
|
85
|
+
register another family's elements that you write inside it:
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
import '@fusion.dev/helix/select'
|
|
89
|
+
import '@fusion.dev/helix/option'
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Without the Option import, the options are unknown elements and the Select
|
|
93
|
+
offers nothing. The same is true
|
|
94
|
+
of the layout around an example: a Button inside a Flex needs both imports.
|
|
95
|
+
Copy the import lines above an example together with its markup.
|
|
65
96
|
|
|
66
|
-
##
|
|
97
|
+
## Check the code you wrote
|
|
67
98
|
|
|
68
|
-
|
|
99
|
+
These checks run on your project, and each one prints JSON with `--json`:
|
|
69
100
|
|
|
70
|
-
|
|
|
101
|
+
| Command | What it finds |
|
|
71
102
|
|---|---|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
| A visual property draws from its axis | `helix component`'s `axes` |
|
|
76
|
-
| A form control styles with `:disabled` | `helix component --only disabled` |
|
|
77
|
-
| A component that animates supports reduced motion | `helix component --only motion` |
|
|
78
|
-
| No component reads a primitive token | `helix component`'s `tokens` |
|
|
103
|
+
| `helix scan` | Unknown tags, attributes, values, slots, parts, hooks, React event props, and tokens, a `--_helix-` primitive read, `[disabled]` on a form control, a selector on an attribute the element never writes back, and a tag whose entry nothing imports, each with its file and line |
|
|
104
|
+
| `helix theme audit` | Every foreground and background pair in your theme that misses its contrast target |
|
|
105
|
+
| `initDiagnostics()` from `@fusion.dev/helix-diagnostics` | The same findings on the running page, and what the library reports as it runs, such as an option nobody imported |
|
|
79
106
|
|
|
80
|
-
|
|
81
|
-
|
|
107
|
+
`helix scan` and `helix theme audit` exit 1 when they find an error and 0 when
|
|
108
|
+
they find none. Run them after you write Helix code, and fix each finding
|
|
109
|
+
before you finish. `helix scan --file <path>` reports one file's findings, and
|
|
110
|
+
`helix scan --stdin tsx` reads a snippet from stdin. Both still read the whole
|
|
111
|
+
project, so an import in another file counts.
|
|
82
112
|
|
|
83
113
|
## The index
|
|
84
114
|
|
|
@@ -106,28 +136,57 @@ Each family page has a menu beside its title with:
|
|
|
106
136
|
The links send the URL, because the URL stays current. A pasted copy starts to
|
|
107
137
|
go stale as soon as you paste it.
|
|
108
138
|
|
|
109
|
-
##
|
|
139
|
+
## The Helix MCP server
|
|
110
140
|
|
|
111
141
|
```sh
|
|
112
|
-
helix mcp
|
|
142
|
+
helix mcp init --client claude
|
|
113
143
|
```
|
|
114
144
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
145
|
+
`helix mcp` runs an MCP server over stdio. It answers from the Helix packages
|
|
146
|
+
your project installs, so every answer is for the version you build with, and
|
|
147
|
+
each one names that package and version. `helix mcp init` adds the server to
|
|
148
|
+
the file your client reads and keeps every other server in it:
|
|
119
149
|
|
|
120
|
-
|
|
150
|
+
| Client | File |
|
|
151
|
+
|---|---|
|
|
152
|
+
| `claude` | `.mcp.json` |
|
|
153
|
+
| `cursor` | `.cursor/mcp.json` |
|
|
154
|
+
| `vscode` | `.vscode/mcp.json` |
|
|
121
155
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
- `helix_derive_theme` returns the CSS.
|
|
156
|
+
The server runs `npx @fusion.dev/helix-cli mcp`, which is the copy in your
|
|
157
|
+
project. It has eight tools:
|
|
125
158
|
|
|
126
|
-
|
|
159
|
+
| Tool | What it returns |
|
|
160
|
+
|---|---|
|
|
161
|
+
| `helix_find` | The families that answer a name, an alias, a tag, or a purpose, best first |
|
|
162
|
+
| `helix_family` | One family's tags, properties and their unions, events and their React props, slots, parts, custom properties, words, and import lines |
|
|
163
|
+
| `helix_example` | One example as HTML and TSX, with its stylesheet, the import lines it needs, and links to its pictures |
|
|
164
|
+
| `helix_imports` | The import lines for a list of tags, and the closest tag to any unknown one |
|
|
165
|
+
| `helix_tokens` | The semantic tokens, by a word in the name or description and by category |
|
|
166
|
+
| `helix_check` | The findings `helix scan` reports for the files you name, or for a snippet before you write it |
|
|
167
|
+
| `helix_audit_theme` | Every foreground and background pair a brand color derives to, with its ratio and target |
|
|
168
|
+
| `helix_derive_theme` | The theme's CSS |
|
|
169
|
+
|
|
170
|
+
Each result is structured, with an output schema, and the same JSON as text.
|
|
171
|
+
A name that matches more than one family, such as `Dropdown`, returns an error
|
|
172
|
+
listing each family. The theme tools take the same JSON that a
|
|
173
|
+
`helix.theme.json` file holds.
|
|
174
|
+
|
|
175
|
+
Each lookup is also a command, for a script or a person:
|
|
127
176
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
177
|
+
```sh
|
|
178
|
+
helix api find dropdown
|
|
179
|
+
helix api family select
|
|
180
|
+
helix api example select
|
|
181
|
+
helix api imports helix-select helix-option
|
|
182
|
+
helix api tokens surface --category color
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
`--json` prints what the MCP tool returns.
|
|
186
|
+
|
|
187
|
+
**`helix_derive_theme` does not return a palette that fails its own targets**,
|
|
188
|
+
the same as `helix theme build`. A failing palette pasted into a stylesheet is
|
|
189
|
+
worse than a warning above it, and an agent does not read warnings.
|
|
131
190
|
|
|
132
191
|
You run `helix mcp` yourself, and we do not host it. A server we operated would
|
|
133
192
|
be one more service between you and your own tokens. `helix mcp` is a
|
|
@@ -136,14 +195,9 @@ no network requests.
|
|
|
136
195
|
|
|
137
196
|
## What we do not publish for agents
|
|
138
197
|
|
|
139
|
-
**`llms-full.txt`, or any other whole-library download.** A single
|
|
140
|
-
every page goes out of date as soon as anything changes. Each link in
|
|
141
|
-
can be cached on its own and stays current on its own.
|
|
142
|
-
|
|
143
|
-
The two sources already here cover what such a file would be for. `llms.txt` is
|
|
144
|
-
the index, in one request, and each family's `.md` file is its document. Fetch
|
|
145
|
-
the families you use.
|
|
198
|
+
**`llms-full.txt`, or any other whole-library download of the pages.** A single
|
|
199
|
+
file with every page goes out of date as soon as anything changes. Each link in
|
|
200
|
+
`llms.txt` can be cached on its own and stays current on its own.
|
|
146
201
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
work than learning most search APIs.
|
|
202
|
+
`llms.txt` is the index, in one request, and each family's `.md` file is its
|
|
203
|
+
document. Fetch the families you use, or ask `helix mcp`.
|