stillwind 0.10.1 → 0.12.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_TEMPLATE.md +3 -2
- package/CHANGELOG.md +36 -0
- package/README.md +2 -2
- package/dist/{class-object-BaK8uudd.d.ts → class-object-CXvJOi2z.d.ts} +2 -2
- package/dist/class-object-CzD1oMD_.js +6 -0
- package/dist/{class-object-DNcjzcfH.js.map → class-object-CzD1oMD_.js.map} +1 -1
- package/dist/class-string-CrQnTRvI.js +6 -0
- package/dist/{class-string-KnYInbiw.js.map → class-string-CrQnTRvI.js.map} +1 -1
- package/dist/{class-string-C5YFtXQn.d.ts → class-string-DQmH4PZX.d.ts} +2 -2
- package/dist/frameworks/alpine.d.ts +2 -2
- package/dist/frameworks/alpine.js +1 -1
- package/dist/frameworks/astro.d.ts +2 -2
- package/dist/frameworks/astro.js +1 -1
- package/dist/frameworks/lit.d.ts +2 -2
- package/dist/frameworks/lit.js +1 -1
- package/dist/frameworks/preact.d.ts +2 -2
- package/dist/frameworks/preact.js +1 -1
- package/dist/frameworks/qwik.d.ts +2 -2
- package/dist/frameworks/qwik.js +1 -1
- package/dist/frameworks/react.d.ts +1 -1
- package/dist/frameworks/react.js +1 -1
- package/dist/frameworks/solid.d.ts +2 -2
- package/dist/frameworks/solid.js +1 -1
- package/dist/frameworks/svelte.d.ts +2 -2
- package/dist/frameworks/svelte.js +1 -1
- package/dist/frameworks/vanilla.d.ts +2 -2
- package/dist/frameworks/vanilla.js +1 -1
- package/dist/frameworks/vue.d.ts +2 -2
- package/dist/frameworks/vue.js +1 -1
- package/dist/{index-DBpgaaD7.d.ts → index-uw1R9t_P.d.ts} +11 -11
- package/dist/macro/index.d.ts +1 -1
- package/dist/macro/index.js +1 -1
- package/dist/style-Bzuux32Y.js +47 -0
- package/dist/{style-BE8vuLiO.js.map → style-Bzuux32Y.js.map} +1 -1
- package/docs/agents.md +1 -0
- package/docs/at-rules/apply.md +1 -1
- package/docs/at-rules/custom-variant.md +1 -1
- package/docs/at-rules/slot.md +1 -1
- package/docs/at-rules/stillwind-property.md +1 -1
- package/docs/at-rules/stillwind-registry.md +1 -1
- package/docs/at-rules/stillwind-require-properties.md +1 -1
- package/docs/at-rules/stillwind-undef-arbitrary-property.md +1 -1
- package/docs/at-rules/stillwind-undef-utility.md +1 -1
- package/docs/at-rules/stillwind-undef-variant.md +1 -1
- package/docs/at-rules/theme.md +5 -5
- package/docs/at-rules/utility.md +4 -4
- package/docs/at-rules/variant.md +1 -1
- package/docs/cli.md +146 -51
- package/docs/configuration.md +63 -4
- package/docs/errors/SW01001.md +1 -1
- package/docs/errors/SW03001.md +1 -1
- package/docs/errors/SW10004.md +1 -1
- package/docs/errors/SW10005.md +1 -1
- package/docs/errors/SW11001.md +1 -1
- package/docs/errors/SW12001.md +1 -1
- package/docs/errors/SW12002.md +1 -1
- package/docs/errors/SW13002.md +1 -1
- package/docs/errors/SW14001.md +1 -1
- package/docs/errors/SW14002.md +1 -1
- package/docs/errors/SW14003.md +1 -1
- package/docs/errors/SW14004.md +1 -1
- package/docs/errors/SW14007.md +1 -1
- package/docs/errors/SW32003.md +1 -1
- package/docs/errors/SW32005.md +1 -1
- package/docs/formatters.md +34 -2
- package/docs/guides/lint-adoption.md +2 -0
- package/docs/guides/migrating-from-tailwind.md +8 -0
- package/docs/guides/recommended-practices.md +18 -0
- package/docs/guides/tailwind-compatibility.md +8 -0
- package/docs/index.md +4 -5
- package/docs/integrations.md +295 -79
- package/docs/lints/index.md +12 -0
- package/docs/lints/invalid-cva-input.md +1 -1
- package/docs/lints/invalid-rule-group-input.md +1 -1
- package/docs/lints/missing-view-transition-name.md +1 -1
- package/docs/lints/prefer-direct-styling.md +1 -1
- package/docs/lints/suspending-macro-argument.md +1 -1
- package/docs/llms.txt +233 -0
- package/docs/macros/style.md +10 -0
- package/docs/plugins/iconify.md +2 -0
- package/docs/utilities-and-variants.md +2 -0
- package/package.json +4 -4
- package/skills/setup-stillwind/SKILL.md +1 -2
- package/skills/stillwind/SKILL.md +18 -11
- package/dist/class-object-DNcjzcfH.js +0 -6
- package/dist/class-string-KnYInbiw.js +0 -6
- package/dist/style-BE8vuLiO.js +0 -44
package/docs/at-rules/theme.md
CHANGED
|
@@ -44,7 +44,7 @@ export const card = {className:"sw_4rosj"};
|
|
|
44
44
|
### Generated stylesheet without preflight
|
|
45
45
|
|
|
46
46
|
```css
|
|
47
|
-
/*! stillwind v0.
|
|
47
|
+
/*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
|
|
48
48
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
49
49
|
@layer properties, theme, base, components, utilities;
|
|
50
50
|
|
|
@@ -110,7 +110,7 @@ export const label = {className:"sw_cum60"};
|
|
|
110
110
|
### Generated stylesheet without preflight
|
|
111
111
|
|
|
112
112
|
```css
|
|
113
|
-
/*! stillwind v0.
|
|
113
|
+
/*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
|
|
114
114
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
115
115
|
@layer properties, theme, base, components, utilities;
|
|
116
116
|
|
|
@@ -163,7 +163,7 @@ export const title = {className:"sw_suzvk"};
|
|
|
163
163
|
### Generated stylesheet without preflight
|
|
164
164
|
|
|
165
165
|
```css
|
|
166
|
-
/*! stillwind v0.
|
|
166
|
+
/*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
|
|
167
167
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
168
168
|
@layer properties, theme, base, components, utilities;
|
|
169
169
|
|
|
@@ -216,7 +216,7 @@ export const done = {className:"sw_wpj78"};
|
|
|
216
216
|
### Generated stylesheet without preflight
|
|
217
217
|
|
|
218
218
|
```css
|
|
219
|
-
/*! stillwind v0.
|
|
219
|
+
/*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
|
|
220
220
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
221
221
|
@layer properties, theme, base, components, utilities;
|
|
222
222
|
|
|
@@ -269,7 +269,7 @@ export const page = {className:"sw_6kn82"};
|
|
|
269
269
|
### Generated stylesheet without preflight
|
|
270
270
|
|
|
271
271
|
```css
|
|
272
|
-
/*! stillwind v0.
|
|
272
|
+
/*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
|
|
273
273
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
274
274
|
@layer properties, theme, base, components, utilities;
|
|
275
275
|
|
package/docs/at-rules/utility.md
CHANGED
|
@@ -51,7 +51,7 @@ export const list = {className:"sw_l0qhr"};
|
|
|
51
51
|
### Generated stylesheet without preflight
|
|
52
52
|
|
|
53
53
|
```css
|
|
54
|
-
/*! stillwind v0.
|
|
54
|
+
/*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
|
|
55
55
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
56
56
|
@layer properties, theme, base, components, utilities;
|
|
57
57
|
|
|
@@ -116,7 +116,7 @@ export const code = {className:"sw_vqs03"};
|
|
|
116
116
|
### Generated stylesheet without preflight
|
|
117
117
|
|
|
118
118
|
```css
|
|
119
|
-
/*! stillwind v0.
|
|
119
|
+
/*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
|
|
120
120
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
121
121
|
@layer properties, theme, base, components, utilities;
|
|
122
122
|
|
|
@@ -172,7 +172,7 @@ export const page = {className:"sw_z5acf"};
|
|
|
172
172
|
### Generated stylesheet without preflight
|
|
173
173
|
|
|
174
174
|
```css
|
|
175
|
-
/*! stillwind v0.
|
|
175
|
+
/*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
|
|
176
176
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
177
177
|
@layer properties, theme, base, components, utilities;
|
|
178
178
|
|
|
@@ -268,7 +268,7 @@ export const icon = {className:"sw_xg0pi"};
|
|
|
268
268
|
### Generated stylesheet without preflight
|
|
269
269
|
|
|
270
270
|
```css
|
|
271
|
-
/*! stillwind v0.
|
|
271
|
+
/*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
|
|
272
272
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
273
273
|
@layer properties, theme, base, components, utilities;
|
|
274
274
|
|
package/docs/at-rules/variant.md
CHANGED
|
@@ -39,7 +39,7 @@ body, that element is the one that uses the utility.
|
|
|
39
39
|
### Generated stylesheet without preflight
|
|
40
40
|
|
|
41
41
|
```css
|
|
42
|
-
/*! stillwind v0.
|
|
42
|
+
/*! stillwind v0.12.0 | MIT License | https://stillwind.dev */
|
|
43
43
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
44
44
|
@layer properties, theme, base, components, utilities;
|
|
45
45
|
|
package/docs/cli.md
CHANGED
|
@@ -5,6 +5,8 @@ description: "Commands, options, file selection, exit codes, and output formats
|
|
|
5
5
|
|
|
6
6
|
# CLI
|
|
7
7
|
|
|
8
|
+
> Command examples use `vp` (Vite+); substitute your project's package manager (such as `pnpm`, `npm`, or `bun`).
|
|
9
|
+
|
|
8
10
|
`@stillwind/cli` sorts utilities, reports lint findings, applies automatic fixes,
|
|
9
11
|
shows generated CSS, lists the project's design system, and starts the language server. It reads the same `stillwind.config.ts` as the
|
|
10
12
|
build integration and the editor.
|
|
@@ -15,22 +17,72 @@ vp i -D @stillwind/cli
|
|
|
15
17
|
|
|
16
18
|
To run the CLI in CI, see [Checks in the editor and CI](https://stillwind.dev/docs/guides/lint-adoption).
|
|
17
19
|
|
|
20
|
+
## Contents
|
|
21
|
+
|
|
22
|
+
- [Commands](#commands)
|
|
23
|
+
- [stillwind check](#stillwind-check)
|
|
24
|
+
- [stillwind fmt](#stillwind-fmt)
|
|
25
|
+
- [stillwind lint](#stillwind-lint)
|
|
26
|
+
- [stillwind info](#stillwind-info)
|
|
27
|
+
- [stillwind inspect](#stillwind-inspect)
|
|
28
|
+
- [stillwind theme](#stillwind-theme)
|
|
29
|
+
- [stillwind utilities](#stillwind-utilities)
|
|
30
|
+
- [stillwind variants](#stillwind-variants)
|
|
31
|
+
- [stillwind lsp](#stillwind-lsp)
|
|
32
|
+
- [Shared options](#shared-options)
|
|
33
|
+
- [Select files](#select-files)
|
|
34
|
+
- [Saving files](#saving-files)
|
|
35
|
+
- [Exit codes](#exit-codes)
|
|
36
|
+
- [Output formats](#output-formats)
|
|
37
|
+
- [Colors and links](#colors-and-links)
|
|
38
|
+
- [JSON output](#json-output)
|
|
39
|
+
|
|
18
40
|
## Commands
|
|
19
41
|
|
|
20
|
-
| Command | Action
|
|
21
|
-
| --------------------- |
|
|
22
|
-
| `stillwind
|
|
23
|
-
| `stillwind
|
|
24
|
-
| `stillwind
|
|
25
|
-
| `stillwind
|
|
26
|
-
| `stillwind
|
|
27
|
-
| `stillwind
|
|
28
|
-
| `stillwind
|
|
42
|
+
| Command | Action |
|
|
43
|
+
| --------------------- | ---------------------------------------------------------------------- |
|
|
44
|
+
| `stillwind check` | Runs lint and utility sorting checks, and can fix and sort in one pass |
|
|
45
|
+
| `stillwind fmt` | Sorts utilities |
|
|
46
|
+
| `stillwind lint` | Reports lint findings, and can apply automatic fixes |
|
|
47
|
+
| `stillwind info` | Shows the resolved project configuration |
|
|
48
|
+
| `stillwind inspect` | Shows the CSS that source code generates |
|
|
49
|
+
| `stillwind theme` | Lists the theme tokens of the project |
|
|
50
|
+
| `stillwind utilities` | Checks or searches utilities |
|
|
51
|
+
| `stillwind variants` | Checks or searches variants |
|
|
52
|
+
| `stillwind lsp` | Starts the language server |
|
|
29
53
|
|
|
30
54
|
`stillwind --help` lists the commands, and `stillwind <command> --help` lists the
|
|
31
55
|
options of a command. `stillwind --version` prints the package version. The short
|
|
32
56
|
forms of these options are `-h` and `-v`.
|
|
33
57
|
|
|
58
|
+
## stillwind check
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
vp exec stillwind check
|
|
62
|
+
vp exec stillwind check --fix
|
|
63
|
+
vp exec stillwind check --max-warnings 0
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`check` runs lint checks and utility sorting checks in a single analysis pass,
|
|
67
|
+
and saves no files. It reports both lint findings and files whose utilities need
|
|
68
|
+
sorting, even when [prefer-sorted-utilities](https://stillwind.dev/docs/lints/prefer-sorted-utilities)
|
|
69
|
+
is disabled.
|
|
70
|
+
|
|
71
|
+
| Option | Effect |
|
|
72
|
+
| -------------------- | ----------------------------------------------------------------------- |
|
|
73
|
+
| `--fix` | Applies the enabled automatic fixes, sorts utilities, and saves changes |
|
|
74
|
+
| `--quiet` | Hides warnings, and keeps their count in the summary |
|
|
75
|
+
| `--max-warnings <n>` | Fails when the number of warnings exceeds `n`, a non-negative integer |
|
|
76
|
+
| `--limit <n>` | Shows at most `n` diagnostics (`0` prints only the summary) |
|
|
77
|
+
|
|
78
|
+
`check` also accepts the [shared options](#shared-options) and
|
|
79
|
+
[globs](#select-files). The `files` format is not available.
|
|
80
|
+
|
|
81
|
+
`--fix` repeats automatic fixes until the file stops changing (up to ten passes per file, respecting
|
|
82
|
+
suppression comments), sorts utilities with the configured
|
|
83
|
+
[`sort` options](https://stillwind.dev/docs/configuration#sorting), saves only changed files, and
|
|
84
|
+
reports findings for the final files.
|
|
85
|
+
|
|
34
86
|
## stillwind fmt
|
|
35
87
|
|
|
36
88
|
```sh
|
|
@@ -74,6 +126,7 @@ this website.
|
|
|
74
126
|
| `--fix` | Applies the enabled automatic fixes, and saves the changed files |
|
|
75
127
|
| `--quiet` | Hides warnings, and keeps their count in the summary |
|
|
76
128
|
| `--max-warnings <n>` | Fails when the number of warnings exceeds `n`, a non-negative integer |
|
|
129
|
+
| `--limit <n>` | Shows at most `n` diagnostics (`0` prints only the summary) |
|
|
77
130
|
|
|
78
131
|
`lint` also accepts the [shared options](#shared-options) and
|
|
79
132
|
[globs](#select-files).
|
|
@@ -87,6 +140,20 @@ Findings and the exit code describe the files after the last pass.
|
|
|
87
140
|
`--quiet` hides. When hidden warnings exceed the limit, the CLI still prints the
|
|
88
141
|
reason for the failure.
|
|
89
142
|
|
|
143
|
+
## stillwind info
|
|
144
|
+
|
|
145
|
+
```sh
|
|
146
|
+
vp exec stillwind info
|
|
147
|
+
vp exec stillwind info --format json
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
`info` evaluates `stillwind.config.*` and reports each project's resolved root,
|
|
151
|
+
stylesheet path, target and exclude globs, matched file count, registered plugins,
|
|
152
|
+
sorting and `typeFacts` settings, and active lint rules (omitting rules set to `off`).
|
|
153
|
+
It compiles no source files and accepts no positional arguments.
|
|
154
|
+
|
|
155
|
+
`info` accepts the [shared options](#shared-options). The `files` format is not available.
|
|
156
|
+
|
|
90
157
|
## stillwind inspect
|
|
91
158
|
|
|
92
159
|
```sh
|
|
@@ -149,36 +216,44 @@ leading `--`, because the CLI reads `--color-*` as an option.
|
|
|
149
216
|
`project` tokens come from an ordinary [`@theme`](https://stillwind.dev/docs/at-rules/theme). `default` tokens
|
|
150
217
|
come from `@theme default` or from a plugin, and an ordinary `@theme` can override them.
|
|
151
218
|
|
|
152
|
-
Each token shows its value as written, including references to other tokens.
|
|
219
|
+
Each token shows its value as written, including references to other tokens. When
|
|
220
|
+
the value references known theme tokens, text output appends the resolved value in
|
|
221
|
+
a comment and JSON output includes `resolvedValue`.
|
|
153
222
|
|
|
154
223
|
## stillwind utilities
|
|
155
224
|
|
|
156
225
|
```sh
|
|
157
226
|
vp exec stillwind utilities p-4 hover:bg-accent
|
|
158
227
|
vp exec stillwind utilities 'bg-*' '*-panel'
|
|
228
|
+
vp exec stillwind utilities 'p-*' --names-only
|
|
159
229
|
```
|
|
160
230
|
|
|
161
231
|
`utilities` shows the CSS of each utility. It reads no source files.
|
|
162
232
|
|
|
233
|
+
| Option | Effect |
|
|
234
|
+
| -------------- | ----------------------------------------- |
|
|
235
|
+
| `--names-only` | Lists matching names without CSS previews |
|
|
236
|
+
|
|
163
237
|
An argument without `*` is an exact check, and it can include variants, numeric values, and
|
|
164
238
|
arbitrary values. An unknown name shows the closest spelling when one is close enough. A valid
|
|
165
239
|
name also shows its canonical spelling when a different spelling produces the same CSS, so
|
|
166
240
|
`[padding:16px]` shows `p-4`. The `canonical` field of the JSON output contains that spelling.
|
|
167
241
|
|
|
168
242
|
An argument with `*` searches the names that editors complete, and a `*` inside brackets or
|
|
169
|
-
parentheses does not count.
|
|
170
|
-
`p
|
|
171
|
-
|
|
243
|
+
parentheses does not count. A search also includes placeholder patterns for functional
|
|
244
|
+
utilities' non-enumerable domains, such as `p-<number>` and `p-[<length-percentage>]` (`kind: "pattern"`
|
|
245
|
+
in JSON), so you can see which numeric or arbitrary values a family accepts before checking an
|
|
246
|
+
exact name. Without an argument, `utilities` lists every name.
|
|
172
247
|
|
|
173
248
|
## stillwind variants
|
|
174
249
|
|
|
175
250
|
```sh
|
|
176
251
|
vp exec stillwind variants hover
|
|
177
|
-
vp exec stillwind variants 'group-*'
|
|
252
|
+
vp exec stillwind variants 'group-*' --names-only
|
|
178
253
|
```
|
|
179
254
|
|
|
180
|
-
`variants` shows the selectors and at-rules that each variant adds. Its arguments
|
|
181
|
-
`utilities`. Write a variant name without the trailing `:`.
|
|
255
|
+
`variants` shows the selectors and at-rules that each variant adds. Its arguments and
|
|
256
|
+
`--names-only` option work as in `utilities`. Write a variant name without the trailing `:`.
|
|
182
257
|
|
|
183
258
|
## stillwind lsp
|
|
184
259
|
|
|
@@ -192,7 +267,7 @@ accepts `--config`, but no globs.
|
|
|
192
267
|
|
|
193
268
|
## Shared options
|
|
194
269
|
|
|
195
|
-
`fmt`, `lint`, `inspect`, `theme`, `utilities`, and `variants` accept these options:
|
|
270
|
+
`check`, `fmt`, `lint`, `info`, `inspect`, `theme`, `utilities`, and `variants` accept these options:
|
|
196
271
|
|
|
197
272
|
| Option | Effect |
|
|
198
273
|
| ----------------------- | --------------------------------------------------- |
|
|
@@ -225,7 +300,7 @@ it. When nothing matches, the CLI returns exit code `2`.
|
|
|
225
300
|
|
|
226
301
|
## Saving files
|
|
227
302
|
|
|
228
|
-
`fmt
|
|
303
|
+
`check --fix`, `fmt`, and `lint --fix` work out the changes for all selected files before they save
|
|
229
304
|
the first file. The CLI then saves only the files whose content changed, so
|
|
230
305
|
modification times of other files stay the same.
|
|
231
306
|
|
|
@@ -246,11 +321,11 @@ The CLI reports all failures and all saved files, and it returns exit code `2`.
|
|
|
246
321
|
|
|
247
322
|
## Exit codes
|
|
248
323
|
|
|
249
|
-
| Code | Meaning
|
|
250
|
-
| ---- |
|
|
251
|
-
| `0` | The command succeeded. `lint` may still report warnings when you set no `--max-warnings` limit
|
|
252
|
-
| `1` | `fmt --check` found files to sort, `lint` found errors, the warnings exceeded `--max-warnings`, `inspect` found a failed occurrence or no occurrence, or `theme`, `utilities`, or `variants` found an unknown name or a target without a match |
|
|
253
|
-
| `2` | The options were invalid, no files matched, or configuration, analysis, or file access failed
|
|
324
|
+
| Code | Meaning |
|
|
325
|
+
| ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
326
|
+
| `0` | The command succeeded. `check` and `lint` may still report warnings when you set no `--max-warnings` limit |
|
|
327
|
+
| `1` | `check` or `fmt --check` found files to sort, `check` or `lint` found errors, the warnings exceeded `--max-warnings`, `inspect` found a failed occurrence or no occurrence, or `theme`, `utilities`, or `variants` found an unknown name or a target without a match |
|
|
328
|
+
| `2` | The options were invalid, no files matched, or configuration, analysis, or file access failed |
|
|
254
329
|
|
|
255
330
|
Code `2` takes priority over code `1`.
|
|
256
331
|
|
|
@@ -312,6 +387,7 @@ failures:
|
|
|
312
387
|
"failures": [],
|
|
313
388
|
"changed": [],
|
|
314
389
|
"previews": [],
|
|
390
|
+
"projects": [],
|
|
315
391
|
"tokens": [],
|
|
316
392
|
"candidates": [],
|
|
317
393
|
"unmatched": [],
|
|
@@ -323,33 +399,49 @@ failures:
|
|
|
323
399
|
"changed": 0,
|
|
324
400
|
"previews": 0,
|
|
325
401
|
"invalidPreviews": 0,
|
|
402
|
+
"projects": 0,
|
|
326
403
|
"tokens": 0,
|
|
327
404
|
"candidates": 0,
|
|
328
405
|
"invalidCandidates": 0,
|
|
329
406
|
"unmatched": 0,
|
|
407
|
+
"autofixable": 0,
|
|
330
408
|
"suggestions": 0,
|
|
409
|
+
"omittedDiagnostics": 0,
|
|
410
|
+
"byCode": {},
|
|
331
411
|
"warningLimitExceeded": false
|
|
332
412
|
},
|
|
333
413
|
"exitCode": 0
|
|
334
414
|
}
|
|
335
415
|
```
|
|
336
416
|
|
|
337
|
-
| Field | Value
|
|
338
|
-
| ------------- |
|
|
339
|
-
| `command` | The command name, or `null` when the CLI failed before it selected a command
|
|
340
|
-
| `config` | The configuration path, or `null` when the CLI failed before the analysis
|
|
341
|
-
| `diagnostics` | The findings; `--quiet` removes warnings
|
|
342
|
-
| `failures` | The execution failures
|
|
343
|
-
| `changed` | The files that the command changed; with `--check`, the files that
|
|
344
|
-
| `previews` | The generated CSS that `inspect` selected; empty for other commands
|
|
345
|
-
| `
|
|
346
|
-
| `
|
|
347
|
-
| `
|
|
348
|
-
| `
|
|
349
|
-
| `
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
417
|
+
| Field | Value |
|
|
418
|
+
| ------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
419
|
+
| `command` | The command name, or `null` when the CLI failed before it selected a command |
|
|
420
|
+
| `config` | The configuration path, or `null` when the CLI failed before the analysis |
|
|
421
|
+
| `diagnostics` | The findings; `--quiet` removes warnings and `--limit` truncates this list |
|
|
422
|
+
| `failures` | The execution failures |
|
|
423
|
+
| `changed` | The files that the command changed; with `check` (without `--fix`) or `fmt --check`, the files that need sorting |
|
|
424
|
+
| `previews` | The generated CSS that `inspect` selected; empty for other commands |
|
|
425
|
+
| `projects` | The resolved project configurations that `info` reported; empty for other commands |
|
|
426
|
+
| `tokens` | The tokens that `theme` selected; empty for other commands |
|
|
427
|
+
| `candidates` | The names that `utilities` or `variants` selected; empty for other commands |
|
|
428
|
+
| `unmatched` | The arguments of `theme`, `utilities`, or `variants` without a match in any project |
|
|
429
|
+
| `summary` | Counts for the fields above; includes full `errors`, `warnings`, `byCode`, and `omittedDiagnostics` counts |
|
|
430
|
+
| `exitCode` | The [exit code](#exit-codes) |
|
|
431
|
+
|
|
432
|
+
Each diagnostic contains `project`, a zero-based project index, `file` (a slash-separated path
|
|
433
|
+
relative to the working directory, or absolute on another filesystem volume), 1-based `line` and
|
|
434
|
+
`column` for range diagnostics (omitted for document-level diagnostics), and `report`. The
|
|
435
|
+
report contains the message, its zero-based locations, notes, and suggested edits (`actions`).
|
|
436
|
+
Each action has an `autofix` boolean: `true` when `--fix` applies it automatically,
|
|
437
|
+
and `false` for manual suggestions. `summary.autofixable` counts diagnostics with an
|
|
438
|
+
automatic fix, `summary.suggestions` counts diagnostics with manual suggestions,
|
|
439
|
+
`summary.omittedDiagnostics` counts diagnostics omitted by `--limit`, and `summary.byCode`
|
|
440
|
+
aggregates `{ errors, warnings, autofixable, docs? }` per diagnostic code across all findings
|
|
441
|
+
before `--quiet` or `--limit` filtering.
|
|
442
|
+
|
|
443
|
+
When `inspect` returns no previews and no execution failures, `emptyReason` explains why:
|
|
444
|
+
`"no-styles"`, `"line-out-of-range"`, `"column-out-of-range"`, or `"no-match-at-position"`.
|
|
353
445
|
|
|
354
446
|
`docs` names the page that explains the report code. It is the absolute path of the page in
|
|
355
447
|
the installed `stillwind` package, which matches that version. When the package has no such
|
|
@@ -359,20 +451,23 @@ Findings in `previews` contain `docs` in the same way.
|
|
|
359
451
|
Each failure contains `message` and `details`, and it can contain `project` and
|
|
360
452
|
`file`. `details` lists the dependency problems that caused the failure.
|
|
361
453
|
|
|
362
|
-
Each preview contains `project`, `
|
|
363
|
-
`location` contains the range of the occurrence,
|
|
364
|
-
range. `diagnostics` lists the `severity`, `code`, and
|
|
365
|
-
range. `valid` is `false` when the list contains an error or
|
|
366
|
-
occurrence requires failed. `css` can be empty for an occurrence with
|
|
367
|
-
is empty when `documentation` describes a marker class. `runtimeNames` lists
|
|
368
|
-
expressions that supply view-transition names, and it is absent when there are none.
|
|
454
|
+
Each preview contains `project`, `file`, 1-based `line` and `column`, `location`, `source`,
|
|
455
|
+
`css`, `valid`, and `diagnostics`. `location` contains the zero-based range of the occurrence,
|
|
456
|
+
and `source` contains the text of that range. `diagnostics` lists the `severity`, `code`, and
|
|
457
|
+
`message` of each finding in the range. `valid` is `false` when the list contains an error or
|
|
458
|
+
when a style that the occurrence requires failed. `css` can be empty for an occurrence with
|
|
459
|
+
findings, and it is empty when `documentation` describes a marker class. `runtimeNames` lists
|
|
460
|
+
the runtime expressions that supply view-transition names, and it is absent when there are none.
|
|
369
461
|
|
|
370
|
-
Each token contains `project`, `name`, `value`, `source`, and `inline
|
|
462
|
+
Each token contains `project`, `name`, `value`, `source`, and `inline`, and
|
|
463
|
+
`resolvedValue` when `value` references known theme tokens. `inline` is `true`
|
|
371
464
|
when utilities write the value of the token instead of a reference to it.
|
|
372
465
|
|
|
373
466
|
Each candidate contains `project`, `name`, `kind`, `valid`, and `css`. `kind` is `"utility"`,
|
|
374
|
-
`"variant"`, or `"
|
|
375
|
-
without CSS
|
|
467
|
+
`"variant"`, `"marker"`, or `"pattern"`, and `css` is empty for an unknown name, a pattern,
|
|
468
|
+
a marker class without CSS, or `--names-only`. An unknown name can contain `suggestion`, the
|
|
469
|
+
closest valid spelling.
|
|
376
470
|
|
|
377
|
-
|
|
378
|
-
|
|
471
|
+
Paths in `config`, `changed`, and `failures` are absolute; `file` on diagnostics and previews is
|
|
472
|
+
relative to the working directory with `/` separators. Nested `location` objects in reports and
|
|
473
|
+
previews use URIs and zero-based UTF-16 positions, and their ends are exclusive.
|
package/docs/configuration.md
CHANGED
|
@@ -26,6 +26,18 @@ Most applications need one project. A monorepo can list one project for each
|
|
|
26
26
|
application, or keep a configuration file in each package and reference those
|
|
27
27
|
files.
|
|
28
28
|
|
|
29
|
+
## Contents
|
|
30
|
+
|
|
31
|
+
- [Reference other configuration files](#reference-other-configuration-files)
|
|
32
|
+
- [Where Stillwind finds the file](#where-stillwind-finds-the-file)
|
|
33
|
+
- [Project fields](#project-fields)
|
|
34
|
+
- [Lint](#lint)
|
|
35
|
+
- [Suppression comments](#suppression-comments)
|
|
36
|
+
- [Sorting](#sorting)
|
|
37
|
+
- [Hooks](#hooks)
|
|
38
|
+
- [Several projects](#several-projects)
|
|
39
|
+
- [Override settings in the integration](#override-settings-in-the-integration)
|
|
40
|
+
|
|
29
41
|
## Reference other configuration files
|
|
30
42
|
|
|
31
43
|
A string in `projects` references other configuration files, relative to the
|
|
@@ -96,10 +108,11 @@ Paths in `css`, `files`, `exclude`, and `tsconfig` are relative to `root`.
|
|
|
96
108
|
|
|
97
109
|
### Checks and sorting
|
|
98
110
|
|
|
99
|
-
| Field
|
|
100
|
-
|
|
|
101
|
-
| `lint`
|
|
102
|
-
| `sort`
|
|
111
|
+
| Field | Value |
|
|
112
|
+
| ------- | ------------------------------------------------------------------------------------------ |
|
|
113
|
+
| `lint` | Presets and rules; see [Lint](#lint) |
|
|
114
|
+
| `sort` | Where `stillwind fmt` sorts utilities, or `false` to disable them; see [Sorting](#sorting) |
|
|
115
|
+
| `hooks` | Project hooks for in-memory formatting in the CLI; see [Hooks](#hooks) |
|
|
103
116
|
|
|
104
117
|
### Generated CSS
|
|
105
118
|
|
|
@@ -310,6 +323,52 @@ only that rule keeps `stillwind fmt` working.
|
|
|
310
323
|
The CLI checks the files that `files` selects. File patterns on the command line
|
|
311
324
|
narrow that set; they cannot add files outside it.
|
|
312
325
|
|
|
326
|
+
## Hooks
|
|
327
|
+
|
|
328
|
+
Each project may define a `hooks` array of `AnalysisHook` objects for the CLI
|
|
329
|
+
`fmt` and `check` commands. Hooks run in array order and operate on in-memory
|
|
330
|
+
buffers, so `--check` compares the final formatted text without writing to disk.
|
|
331
|
+
Build integrations, the language server, `stillwind lint`, and
|
|
332
|
+
`prettier-plugin-stillwind` do not run project hooks.
|
|
333
|
+
|
|
334
|
+
```ts title="stillwind.config.ts"
|
|
335
|
+
import { format as oxfmt } from "oxfmt";
|
|
336
|
+
import { defineConfig, defineHook } from "stillwind/config";
|
|
337
|
+
|
|
338
|
+
const oxfmtHook = defineHook({
|
|
339
|
+
name: "oxfmt",
|
|
340
|
+
async format(file) {
|
|
341
|
+
const result = await oxfmt(file.path, file.code);
|
|
342
|
+
if (result.errors.length) {
|
|
343
|
+
throw new Error(result.errors.map((error) => error.message).join("\n"));
|
|
344
|
+
}
|
|
345
|
+
return result.code;
|
|
346
|
+
},
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
export default defineConfig({
|
|
350
|
+
projects: [
|
|
351
|
+
{
|
|
352
|
+
css: "./src/stillwind.css",
|
|
353
|
+
files: ["src/**/*.{ts,tsx,vue,svelte,astro}"],
|
|
354
|
+
hooks: [oxfmtHook],
|
|
355
|
+
},
|
|
356
|
+
],
|
|
357
|
+
});
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
| Callback | Runs on | Role |
|
|
361
|
+
| ---------- | -------------------------------------------- | --------------------------------------------------------------------------------- |
|
|
362
|
+
| `setup` | Hooks before `format` callbacks run | Initializes per-project resources once for the command |
|
|
363
|
+
| `teardown` | Initialized hooks in reverse order | Releases resources after callbacks finish, including when an earlier step fails |
|
|
364
|
+
| `format` | `fmt`, `fmt --check`, `check`, `check --fix` | Transforms one buffer `(file, context) => string \| void` after Stillwind sorting |
|
|
365
|
+
|
|
366
|
+
In a monorepo, import shared hooks into each project so running the CLI from the
|
|
367
|
+
workspace root or from a package directory produces the same result. When a file
|
|
368
|
+
belongs to overlapping projects that share the same `format` hook references in
|
|
369
|
+
the same order, the pipeline runs once; conflicting outputs from different hooks
|
|
370
|
+
fail that target.
|
|
371
|
+
|
|
313
372
|
## Several projects
|
|
314
373
|
|
|
315
374
|
When the file has several projects, each integration selects one:
|
package/docs/errors/SW01001.md
CHANGED
package/docs/errors/SW03001.md
CHANGED
package/docs/errors/SW10004.md
CHANGED
|
@@ -16,7 +16,7 @@ const card = style.ref("card");
|
|
|
16
16
|
const container = card.asContainer("inline-size");
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
> SW10004: asContainer(...) must be
|
|
19
|
+
> SW10004: asContainer(...) must be used as an input to style(); it cannot be used as a standalone runtime value
|
|
20
20
|
|
|
21
21
|
## Fixed
|
|
22
22
|
|
package/docs/errors/SW10005.md
CHANGED
|
@@ -19,7 +19,7 @@ const macro = style;
|
|
|
19
19
|
macro("p-4");
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
> SW10005: macro binding `style` has a reference that
|
|
22
|
+
> SW10005: macro binding `style` has a reference that could not be transformed
|
|
23
23
|
|
|
24
24
|
## Fixed
|
|
25
25
|
|
package/docs/errors/SW11001.md
CHANGED
package/docs/errors/SW12001.md
CHANGED
|
@@ -18,7 +18,7 @@ current = style.ref("panel");
|
|
|
18
18
|
style({ [current("hover")]: "underline" });
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
> SW12001:
|
|
21
|
+
> SW12001: reassignment changes the Stillwind declaration identity: TS2322: Type 'StyleRef<string>' is not assignable to type 'StyleRef<"stillwind-identity/v2:eyJraW5kIjoicmVmIiwibW9kdWxlSWQiOiJSZWZlcmVuY2UudHN4IiwicGF0aCI6W10sIm9yZGluYWwiOjAsImJpbmRpbmdOYW1lIjoiY3VycmVudCJ9">'.
|
|
22
22
|
> Type 'string' is not assignable to type '"stillwind-identity/v2:eyJraW5kIjoicmVmIiwibW9kdWxlSWQiOiJSZWZlcmVuY2UudHN4IiwicGF0aCI6W10sIm9yZGluYWwiOjAsImJpbmRpbmdOYW1lIjoiY3VycmVudCJ9"'. Preserve declaration candidates with an explicit union or a generic parameter.
|
|
23
23
|
>
|
|
24
24
|
> Source format: Jsx
|
package/docs/errors/SW12002.md
CHANGED
|
@@ -18,7 +18,7 @@ const current: ReturnType<typeof style.ref> = card;
|
|
|
18
18
|
style({ [current("hover")]: "underline" });
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
> SW12002: cannot determine
|
|
21
|
+
> SW12002: cannot statically determine Stillwind declaration identity: Cannot determine a finite set of declaration identities. Preserve the value's inferred type, use an explicit union, or use a generic parameter.
|
|
22
22
|
>
|
|
23
23
|
> Source format: Jsx
|
|
24
24
|
|
package/docs/errors/SW13002.md
CHANGED
package/docs/errors/SW14001.md
CHANGED
|
@@ -21,7 +21,7 @@ imports only some parts of Stillwind.
|
|
|
21
21
|
style("p-4");
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
> SW14001: generated utilities require
|
|
24
|
+
> SW14001: generated utilities require `@stillwind-slot utilities;` in the CSS entry graph
|
|
25
25
|
|
|
26
26
|
## Fixed
|
|
27
27
|
|
package/docs/errors/SW14002.md
CHANGED
|
@@ -24,7 +24,7 @@ const fade = style.keyframes({
|
|
|
24
24
|
style(fade(""));
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
> SW14002: generated support requires
|
|
27
|
+
> SW14002: generated support requires `@stillwind-slot keyframes;` in the CSS entry graph
|
|
28
28
|
|
|
29
29
|
## Fixed
|
|
30
30
|
|
package/docs/errors/SW14003.md
CHANGED
package/docs/errors/SW14004.md
CHANGED
package/docs/errors/SW14007.md
CHANGED
package/docs/errors/SW32003.md
CHANGED
|
@@ -19,7 +19,7 @@ loader.provide(0, "root.css", '@import "./tokens.css";');
|
|
|
19
19
|
loader.provide(99, "tokens.css", "@theme { --color-brand: red; }");
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
> SW32003: unknown or duplicate request ID 99
|
|
22
|
+
> SW32003: unknown or duplicate request ID 99 (in root.css)
|
|
23
23
|
|
|
24
24
|
## Fixed
|
|
25
25
|
|