@stillwind/cli 0.1.0 → 0.4.1
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/README.md +13 -10
- package/dist/main.js +297 -70
- package/dist/main.js.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
# Stillwind CLI
|
|
2
2
|
|
|
3
|
-
Stillwind compiles Tailwind CSS v4 utilities into component props and static CSS.
|
|
4
|
-
It uses theme rules and compiler checks to keep styling code in order, even when
|
|
5
|
-
AI agents write much of it.
|
|
3
|
+
[Stillwind](https://stillwind.dev/) compiles Tailwind CSS v4 utilities into component props and static CSS.
|
|
4
|
+
It uses theme rules and compiler checks to keep styling code in order, even when AI agents write much of it.
|
|
6
5
|
|
|
7
|
-
`@stillwind/cli` is Stillwind's command-line interface for sorting, linting,
|
|
8
|
-
|
|
9
|
-
build integration and editor.
|
|
6
|
+
`@stillwind/cli` is Stillwind's command-line interface for sorting, linting, automatic fixes, CSS inspection, design-system lookups, and CI checks.
|
|
7
|
+
It uses the same project configuration as the build integration and editor.
|
|
10
8
|
|
|
11
9
|
## Install
|
|
12
10
|
|
|
@@ -24,13 +22,18 @@ before running commands. The CLI searches upward from the working directory for
|
|
|
24
22
|
stillwind fmt
|
|
25
23
|
stillwind lint
|
|
26
24
|
stillwind lint --fix
|
|
25
|
+
stillwind inspect src/Button.tsx:12
|
|
26
|
+
stillwind theme 'color-*'
|
|
27
|
+
stillwind utilities p-4 'bg-*'
|
|
28
|
+
stillwind variants 'group-*'
|
|
27
29
|
```
|
|
28
30
|
|
|
29
31
|
`fmt` sorts utility inputs and preserves source layout and token spellings. Run a
|
|
30
32
|
general formatter afterward, or use
|
|
31
|
-
[prettier-plugin-stillwind](https://
|
|
33
|
+
[prettier-plugin-stillwind](https://stillwind.dev/docs/formatters).
|
|
32
34
|
`lint` reports findings; `lint --fix` applies enabled automatic fixes. Only changed
|
|
33
|
-
files are saved.
|
|
35
|
+
files are saved. `inspect` shows the CSS that a file, line, or position generates.
|
|
36
|
+
`theme`, `utilities`, and `variants` read the project's design system.
|
|
34
37
|
|
|
35
38
|
Optional file patterns narrow the configured project scopes:
|
|
36
39
|
|
|
@@ -52,12 +55,12 @@ configuration logs use stderr. GitHub annotations are the default in GitHub Acti
|
|
|
52
55
|
| Exit code | Meaning |
|
|
53
56
|
| --------- | -------------------------------------------------------------------------------------------------------------------- |
|
|
54
57
|
| `0` | Formatting succeeded, formatting check found no changes, or lint found no errors and stayed within any warning limit |
|
|
55
|
-
| `1` | Formatting changes are required, lint found errors,
|
|
58
|
+
| `1` | Formatting changes are required, lint found errors, the warning limit was exceeded, or a lookup found no CSS or name |
|
|
56
59
|
| `2` | Invalid options, failed configuration/analysis/planning/I/O, or no matching targets |
|
|
57
60
|
|
|
58
61
|
Warnings alone return `0` when no limit is set. `stillwind --help` lists commands;
|
|
59
62
|
`stillwind <command> --help` lists options. `stillwind lsp --stdio` starts the
|
|
60
63
|
language server for clients using the Language Server Protocol.
|
|
61
64
|
|
|
62
|
-
See the [CLI reference](https://
|
|
65
|
+
See the [CLI reference](https://stillwind.dev/docs/cli)
|
|
63
66
|
for configuration discovery, saving guarantees, output formats, and the JSON schema.
|
package/dist/main.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from "node:module";
|
|
2
3
|
import process from "node:process";
|
|
3
4
|
import { parseArgs, stripVTControlCharacters, styleText } from "node:util";
|
|
4
5
|
import { defineCittyPlugin, defineCommand, parseArgs as parseArgs$1, renderUsage, runCommand } from "citty";
|
|
5
6
|
import path from "node:path";
|
|
6
7
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
8
|
import { lintReports } from "@stillwind/analysis";
|
|
9
|
+
import { existsSync } from "node:fs";
|
|
8
10
|
// package.json
|
|
9
|
-
var version = "0.1
|
|
11
|
+
var version = "0.4.1";
|
|
10
12
|
// src/arguments.ts
|
|
11
13
|
const configArgs = { config: {
|
|
12
14
|
type: "string",
|
|
@@ -141,6 +143,137 @@ function parseInvocation(rawArgs, definitions) {
|
|
|
141
143
|
version: flags.version
|
|
142
144
|
};
|
|
143
145
|
}
|
|
146
|
+
// src/documentation.ts
|
|
147
|
+
/**
|
|
148
|
+
* Finds the documentation page of a report code.
|
|
149
|
+
*
|
|
150
|
+
* @param code - Compiler code, such as `SW01001`, or lint rule name.
|
|
151
|
+
* @param root - Root directory of the installed `stillwind` package, when one resolves.
|
|
152
|
+
* @returns The absolute path of the page in that package, which matches the installed version.
|
|
153
|
+
* Otherwise, the page on the website. Codes without a page return undefined.
|
|
154
|
+
*/
|
|
155
|
+
function documentationPage(code, root) {
|
|
156
|
+
const section = /^SW\d+$/.test(code) ? "errors" : /^[a-z][a-z-]*$/.test(code) ? "lints" : null;
|
|
157
|
+
if (!section) return;
|
|
158
|
+
const file = root && path.join(root, "docs", section, `${code}.md`);
|
|
159
|
+
return file && existsSync(file) ? file : `https://stillwind.dev/docs/${section}/${code}`;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Finds the `stillwind` package that a configuration file resolves.
|
|
163
|
+
*
|
|
164
|
+
* @param config - Absolute configuration path.
|
|
165
|
+
* @returns The package root, or undefined when no package resolves.
|
|
166
|
+
*/
|
|
167
|
+
function stillwindRoot(config) {
|
|
168
|
+
try {
|
|
169
|
+
return config ? path.dirname(createRequire(config).resolve("stillwind/package.json")) : void 0;
|
|
170
|
+
} catch {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
// src/result.ts
|
|
175
|
+
/**
|
|
176
|
+
* Tests whether a command reads a design system and no source files.
|
|
177
|
+
*/
|
|
178
|
+
function isDesignCommand(command) {
|
|
179
|
+
return command === "theme" || command === "utilities" || command === "variants";
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Projects analysis into CLI data before visibility filtering and rendering.
|
|
183
|
+
*/
|
|
184
|
+
function cliResult(command, result, policy = {}) {
|
|
185
|
+
const failedFiles = new Set(result.failures?.map((failure) => failure.file));
|
|
186
|
+
const root = stillwindRoot(result.config);
|
|
187
|
+
const docs = (code) => {
|
|
188
|
+
const page = documentationPage(code, root);
|
|
189
|
+
return page ? { docs: page } : {};
|
|
190
|
+
};
|
|
191
|
+
const previews = (result.previews ?? []).map((preview) => ({
|
|
192
|
+
...preview,
|
|
193
|
+
diagnostics: preview.diagnostics.map((diagnostic) => ({
|
|
194
|
+
...diagnostic,
|
|
195
|
+
...docs(diagnostic.code)
|
|
196
|
+
}))
|
|
197
|
+
}));
|
|
198
|
+
const invalid = previews.filter(({ valid }) => !valid).length;
|
|
199
|
+
const { tokens = [], candidates = [], unmatched = [] } = result;
|
|
200
|
+
const invalidCandidates = candidates.filter(({ valid }) => !valid).length;
|
|
201
|
+
const diagnostics = lintReports(command !== "lint" ? result.results.filter(({ result }) => result.status !== "complete" || failedFiles.has(result.entry)) : result.results).map((diagnostic) => ({
|
|
202
|
+
...diagnostic,
|
|
203
|
+
...docs(diagnostic.report.code)
|
|
204
|
+
}));
|
|
205
|
+
const failures = result.results.flatMap(({ project, result }) => result.status === "complete" ? [] : [{
|
|
206
|
+
project,
|
|
207
|
+
file: result.entry,
|
|
208
|
+
message: `Incomplete analysis${result.error ? `: ${result.error}` : ""}`,
|
|
209
|
+
details: [...(result.graph?.dependencies ?? []).flatMap((dependency) => dependency.status === "unresolved" || dependency.status === "unsupported" ? [{
|
|
210
|
+
file: dependency.importer,
|
|
211
|
+
message: `${dependency.status}: ${dependency.specifier}`
|
|
212
|
+
}] : []), ...(result.graph?.unverified ?? []).map((range) => ({
|
|
213
|
+
file: range.moduleId,
|
|
214
|
+
message: `unverified${range.start === void 0 ? "" : ` bytes ${range.start}-${range.end}`}: ${range.reason}`
|
|
215
|
+
}))]
|
|
216
|
+
}]);
|
|
217
|
+
for (const failure of result.failures ?? []) if (!failures.some((existing) => existing.file === failure.file)) failures.push({
|
|
218
|
+
file: failure.file,
|
|
219
|
+
message: failure.message,
|
|
220
|
+
details: []
|
|
221
|
+
});
|
|
222
|
+
if (!result.results.length && !failures.length && !isDesignCommand(command)) failures.push({
|
|
223
|
+
message: "No analysis targets matched the configured scopes",
|
|
224
|
+
details: []
|
|
225
|
+
});
|
|
226
|
+
const changed = [...new Set(result.changed ?? [])].sort();
|
|
227
|
+
const errors = diagnostics.filter(({ report }) => report.severity === "error").length;
|
|
228
|
+
const warnings = diagnostics.length - errors;
|
|
229
|
+
const warningLimitExceeded = policy.maxWarnings !== void 0 && warnings > policy.maxWarnings;
|
|
230
|
+
return {
|
|
231
|
+
command,
|
|
232
|
+
config: result.config,
|
|
233
|
+
diagnostics: policy.quiet ? diagnostics.filter(({ report }) => report.severity === "error") : diagnostics,
|
|
234
|
+
failures,
|
|
235
|
+
changed,
|
|
236
|
+
previews,
|
|
237
|
+
tokens,
|
|
238
|
+
candidates,
|
|
239
|
+
unmatched,
|
|
240
|
+
summary: {
|
|
241
|
+
files: (/* @__PURE__ */ new Set([...result.results.map(({ result }) => result.entry), ...(result.failures ?? []).map((failure) => failure.file)])).size,
|
|
242
|
+
errors,
|
|
243
|
+
warnings,
|
|
244
|
+
failures: failures.length,
|
|
245
|
+
changed: changed.length,
|
|
246
|
+
previews: previews.length,
|
|
247
|
+
invalidPreviews: invalid,
|
|
248
|
+
tokens: tokens.length,
|
|
249
|
+
candidates: candidates.length,
|
|
250
|
+
invalidCandidates,
|
|
251
|
+
unmatched: unmatched.length,
|
|
252
|
+
suggestions: diagnostics.filter(({ report }) => report.actions.length > 0).length,
|
|
253
|
+
warningLimitExceeded
|
|
254
|
+
},
|
|
255
|
+
exitCode: failures.length ? 2 : errors || warningLimitExceeded || policy.check && changed.length || command === "inspect" && (invalid || !previews.length) || invalidCandidates || unmatched.length ? 1 : 0
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Retains reports carried by failed rewrite planning in the same CLI envelope.
|
|
260
|
+
*/
|
|
261
|
+
function failureResult(command, error, policy = {}) {
|
|
262
|
+
const results = error instanceof Error && "results" in error && Array.isArray(error.results) ? error.results : [];
|
|
263
|
+
const result = cliResult("lint", {
|
|
264
|
+
config: results[0]?.config ?? "",
|
|
265
|
+
results
|
|
266
|
+
}, policy);
|
|
267
|
+
result.command = command;
|
|
268
|
+
result.config = results[0]?.config ?? null;
|
|
269
|
+
if (!results.length || !result.failures.length) result.failures = [{
|
|
270
|
+
message: error instanceof Error ? error.message : String(error),
|
|
271
|
+
details: []
|
|
272
|
+
}];
|
|
273
|
+
result.summary.failures = result.failures.length;
|
|
274
|
+
result.exitCode = 2;
|
|
275
|
+
return result;
|
|
276
|
+
}
|
|
144
277
|
// src/output.ts
|
|
145
278
|
function displayEnabled(mode, kind, tty, env) {
|
|
146
279
|
if (mode !== "auto") return mode === "always";
|
|
@@ -220,6 +353,39 @@ function renderResult(result, options, stderr = false, frames) {
|
|
|
220
353
|
};
|
|
221
354
|
lines.push(`${link(file(changed), location, hyperlinks)}${options.format === "text" ? options.check ? ": needs formatting" : ": formatted" : ""}`);
|
|
222
355
|
}
|
|
356
|
+
if (result.command === "inspect") {
|
|
357
|
+
for (const { project, location, css, valid, diagnostics, documentation } of result.previews) {
|
|
358
|
+
const label = {
|
|
359
|
+
scope: "range",
|
|
360
|
+
location
|
|
361
|
+
};
|
|
362
|
+
lines.push(`${linked(label)} [project ${project + 1}]`);
|
|
363
|
+
const failure = valid || diagnostics.length ? [] : ["error: CSS generation failed."];
|
|
364
|
+
lines.push(...clean([
|
|
365
|
+
...failure,
|
|
366
|
+
...diagnostics.map(({ severity, code, message }) => `${severity} ${code}: ${message}`),
|
|
367
|
+
css,
|
|
368
|
+
documentation
|
|
369
|
+
].filter(Boolean).join("\n")).trimEnd().split("\n").map((line) => line ? ` ${line}` : ""));
|
|
370
|
+
lines.push("");
|
|
371
|
+
}
|
|
372
|
+
if (!result.summary.previews && !result.summary.failures) lines.push("The selected source has no generated CSS.");
|
|
373
|
+
}
|
|
374
|
+
const projects = new Set([...result.tokens, ...result.candidates].map(({ project }) => project));
|
|
375
|
+
const tag = (project) => projects.size > 1 ? ` [project ${project + 1}]` : "";
|
|
376
|
+
for (const { project, name, value, source } of result.tokens) lines.push(`${clean(name)}: ${clean(value)}${source === "default" ? " (default)" : ""}${tag(project)}`);
|
|
377
|
+
for (const { project, name, kind, valid, css, suggestion, canonical } of result.candidates) {
|
|
378
|
+
if (valid) {
|
|
379
|
+
lines.push(`${clean(name)}${kind === "marker" ? " (marker)" : ""}${tag(project)}`);
|
|
380
|
+
lines.push(...clean(css).trimEnd().split("\n").map((line) => line ? ` ${line}` : ""));
|
|
381
|
+
if (canonical) lines.push(` help: The canonical spelling is ${clean(canonical)}.`);
|
|
382
|
+
} else {
|
|
383
|
+
lines.push(`${clean(name)}${tag(project)}: ${paint(`unknown ${kind}`, "red", color)}`);
|
|
384
|
+
if (suggestion) lines.push(` help: Did you mean ${clean(suggestion)}?`);
|
|
385
|
+
}
|
|
386
|
+
lines.push("");
|
|
387
|
+
}
|
|
388
|
+
for (const target of result.unmatched) lines.push(`${clean(target)}: ${paint("no match", "red", color)}`);
|
|
223
389
|
if (result.summary.warningLimitExceeded) {
|
|
224
390
|
const message = `Warning count (${result.summary.warnings}) exceeds --max-warnings${options.maxWarnings === void 0 ? "" : ` (${options.maxWarnings})`}.`;
|
|
225
391
|
lines.push(options.format === "github" ? annotation("error", { title: "Stillwind warnings" }, message) : `error: ${message}`);
|
|
@@ -227,7 +393,7 @@ function renderResult(result, options, stderr = false, frames) {
|
|
|
227
393
|
if (options.format === "text") {
|
|
228
394
|
if (lines.length && lines.at(-1) !== "") lines.push("");
|
|
229
395
|
const { summary } = result;
|
|
230
|
-
lines.push(result.command === "fmt" && !summary.failures ? options.check ? summary.changed ? `${count(summary.changed, "file")} ${summary.changed === 1 ? "needs" : "need"} formatting.` : `All selected files are formatted (${summary.files} checked).` : `Formatted ${count(summary.changed, "file")} (${summary.files} checked).` : `${count(summary.errors, "error")}, ${count(summary.warnings, "warning")} in ${count(summary.files, "file")}${summary.failures ? `; ${count(summary.failures, "execution failure")}` : ""}.`);
|
|
396
|
+
lines.push(isDesignCommand(result.command) ? `${result.command === "theme" ? count(summary.tokens, "token") : count(summary.candidates, result.command === "variants" ? "variant" : "utility").replace("utilitys", "utilities")}${summary.invalidCandidates ? `; ${summary.invalidCandidates} unknown` : ""}${summary.unmatched ? `; ${count(summary.unmatched, "unmatched target")}` : ""}${summary.failures ? `; ${count(summary.failures, "execution failure")}` : ""}.` : result.command === "inspect" ? `${count(summary.previews, "preview")} in ${count(summary.files, "file")}${summary.invalidPreviews ? `; ${summary.invalidPreviews} failed to generate CSS` : ""}${summary.failures ? `; ${count(summary.failures, "execution failure")}` : ""}.` : result.command === "fmt" && !summary.failures ? options.check ? summary.changed ? `${count(summary.changed, "file")} ${summary.changed === 1 ? "needs" : "need"} formatting.` : `All selected files are formatted (${summary.files} checked).` : `Formatted ${count(summary.changed, "file")} (${summary.files} checked).` : `${count(summary.errors, "error")}, ${count(summary.warnings, "warning")} in ${count(summary.files, "file")}${summary.failures ? `; ${count(summary.failures, "execution failure")}` : ""}.`);
|
|
231
397
|
const suggestions = result.diagnostics.filter(({ report }) => report.actions.length > 0).length;
|
|
232
398
|
if (result.command === "lint" && suggestions) lines.push(`help: Suggested edits are available for ${count(suggestions, "diagnostic")}. Run stillwind lint --fix to apply automatic fixes.`);
|
|
233
399
|
}
|
|
@@ -279,71 +445,6 @@ function annotation(level, properties, message) {
|
|
|
279
445
|
const fields = Object.entries(properties).map(([key, value]) => `${key}=${escapeData(String(value)).replace(/:/g, "%3A").replace(/,/g, "%2C")}`).join(",");
|
|
280
446
|
return `::${level}${fields ? ` ${fields}` : ""}::${escapeData(message)}`;
|
|
281
447
|
}
|
|
282
|
-
// src/result.ts
|
|
283
|
-
/** Projects analysis into CLI data before visibility filtering and rendering. */
|
|
284
|
-
function cliResult(command, result, policy = {}) {
|
|
285
|
-
const failedFiles = new Set(result.failures?.map((failure) => failure.file));
|
|
286
|
-
const diagnostics = lintReports(command === "fmt" ? result.results.filter(({ result }) => result.status !== "complete" || failedFiles.has(result.entry)) : result.results);
|
|
287
|
-
const failures = result.results.flatMap(({ project, result }) => result.status === "complete" ? [] : [{
|
|
288
|
-
project,
|
|
289
|
-
file: result.entry,
|
|
290
|
-
message: `Incomplete analysis${result.error ? `: ${result.error}` : ""}`,
|
|
291
|
-
details: [...(result.graph?.dependencies ?? []).flatMap((dependency) => dependency.status === "unresolved" || dependency.status === "unsupported" ? [{
|
|
292
|
-
file: dependency.importer,
|
|
293
|
-
message: `${dependency.status}: ${dependency.specifier}`
|
|
294
|
-
}] : []), ...(result.graph?.unverified ?? []).map((range) => ({
|
|
295
|
-
file: range.moduleId,
|
|
296
|
-
message: `unverified${range.start === void 0 ? "" : ` bytes ${range.start}-${range.end}`}: ${range.reason}`
|
|
297
|
-
}))]
|
|
298
|
-
}]);
|
|
299
|
-
for (const failure of result.failures ?? []) if (!failures.some((existing) => existing.file === failure.file)) failures.push({
|
|
300
|
-
file: failure.file,
|
|
301
|
-
message: failure.message,
|
|
302
|
-
details: []
|
|
303
|
-
});
|
|
304
|
-
if (!result.results.length && !failures.length) failures.push({
|
|
305
|
-
message: "No analysis targets matched the configured scopes",
|
|
306
|
-
details: []
|
|
307
|
-
});
|
|
308
|
-
const changed = [...new Set(result.changed ?? [])].sort();
|
|
309
|
-
const errors = diagnostics.filter(({ report }) => report.severity === "error").length;
|
|
310
|
-
const warnings = diagnostics.length - errors;
|
|
311
|
-
const warningLimitExceeded = policy.maxWarnings !== void 0 && warnings > policy.maxWarnings;
|
|
312
|
-
return {
|
|
313
|
-
command,
|
|
314
|
-
config: result.config,
|
|
315
|
-
diagnostics: policy.quiet ? diagnostics.filter(({ report }) => report.severity === "error") : diagnostics,
|
|
316
|
-
failures,
|
|
317
|
-
changed,
|
|
318
|
-
summary: {
|
|
319
|
-
files: (/* @__PURE__ */ new Set([...result.results.map(({ result }) => result.entry), ...(result.failures ?? []).map((failure) => failure.file)])).size,
|
|
320
|
-
errors,
|
|
321
|
-
warnings,
|
|
322
|
-
failures: failures.length,
|
|
323
|
-
changed: changed.length,
|
|
324
|
-
suggestions: diagnostics.filter(({ report }) => report.actions.length > 0).length,
|
|
325
|
-
warningLimitExceeded
|
|
326
|
-
},
|
|
327
|
-
exitCode: failures.length ? 2 : errors || warningLimitExceeded || policy.check && changed.length ? 1 : 0
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
/** Retains reports carried by failed rewrite planning in the same CLI envelope. */
|
|
331
|
-
function failureResult(command, error, policy = {}) {
|
|
332
|
-
const results = error instanceof Error && "results" in error && Array.isArray(error.results) ? error.results : [];
|
|
333
|
-
const result = cliResult("lint", {
|
|
334
|
-
config: results[0]?.config ?? "",
|
|
335
|
-
results
|
|
336
|
-
}, policy);
|
|
337
|
-
result.command = command;
|
|
338
|
-
result.config = results[0]?.config ?? null;
|
|
339
|
-
if (!results.length || !result.failures.length) result.failures = [{
|
|
340
|
-
message: error instanceof Error ? error.message : String(error),
|
|
341
|
-
details: []
|
|
342
|
-
}];
|
|
343
|
-
result.summary.failures = result.failures.length;
|
|
344
|
-
result.exitCode = 2;
|
|
345
|
-
return result;
|
|
346
|
-
}
|
|
347
448
|
// src/commands.ts
|
|
348
449
|
const fmtArgs = {
|
|
349
450
|
...targetArgs,
|
|
@@ -368,6 +469,55 @@ const lintArgs = {
|
|
|
368
469
|
description: "Apply converged automatic fixes"
|
|
369
470
|
}
|
|
370
471
|
};
|
|
472
|
+
const inspectArgs = {
|
|
473
|
+
...targetArgs,
|
|
474
|
+
format: {
|
|
475
|
+
...outputArgs.format,
|
|
476
|
+
options: [
|
|
477
|
+
"text",
|
|
478
|
+
"json",
|
|
479
|
+
"github"
|
|
480
|
+
]
|
|
481
|
+
},
|
|
482
|
+
globs: {
|
|
483
|
+
...targetArgs.globs,
|
|
484
|
+
description: "Select files with paths or globs, optionally followed by :line or :line:column"
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
const designArgs = {
|
|
488
|
+
...configArgs,
|
|
489
|
+
format: {
|
|
490
|
+
...outputArgs.format,
|
|
491
|
+
options: [
|
|
492
|
+
"text",
|
|
493
|
+
"json",
|
|
494
|
+
"github"
|
|
495
|
+
]
|
|
496
|
+
},
|
|
497
|
+
color: outputArgs.color,
|
|
498
|
+
hyperlinks: outputArgs.hyperlinks
|
|
499
|
+
};
|
|
500
|
+
const themeArgs = {
|
|
501
|
+
...designArgs,
|
|
502
|
+
names: {
|
|
503
|
+
type: "positional",
|
|
504
|
+
required: false,
|
|
505
|
+
description: "Select tokens by name without the leading --, where * matches any text"
|
|
506
|
+
},
|
|
507
|
+
source: {
|
|
508
|
+
type: "enum",
|
|
509
|
+
options: ["project", "default"],
|
|
510
|
+
description: "Show only the tokens with this origin"
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
const candidateArgs = {
|
|
514
|
+
...designArgs,
|
|
515
|
+
names: {
|
|
516
|
+
type: "positional",
|
|
517
|
+
required: false,
|
|
518
|
+
description: "Check exact names, or search with * patterns"
|
|
519
|
+
}
|
|
520
|
+
};
|
|
371
521
|
const lspArgs = {
|
|
372
522
|
...configArgs,
|
|
373
523
|
stdio: {
|
|
@@ -424,6 +574,68 @@ const subCommands = {
|
|
|
424
574
|
process.exitCode = result.exitCode;
|
|
425
575
|
}
|
|
426
576
|
}),
|
|
577
|
+
inspect: defineCommand({
|
|
578
|
+
meta: {
|
|
579
|
+
name: "inspect",
|
|
580
|
+
description: "Show the CSS that Stillwind generates for source code"
|
|
581
|
+
},
|
|
582
|
+
args: inspectArgs,
|
|
583
|
+
plugins: [strictArguments],
|
|
584
|
+
async run({ args, data }) {
|
|
585
|
+
const options = data;
|
|
586
|
+
const { inspect } = await import("@stillwind/analysis/node");
|
|
587
|
+
const result = cliResult("inspect", await inspect({
|
|
588
|
+
config: args.config,
|
|
589
|
+
cwd: options.cwd,
|
|
590
|
+
targets: args._
|
|
591
|
+
}));
|
|
592
|
+
await writeResult(result, options);
|
|
593
|
+
process.exitCode = result.exitCode;
|
|
594
|
+
}
|
|
595
|
+
}),
|
|
596
|
+
theme: defineCommand({
|
|
597
|
+
meta: {
|
|
598
|
+
name: "theme",
|
|
599
|
+
description: "List the theme tokens of the project"
|
|
600
|
+
},
|
|
601
|
+
args: themeArgs,
|
|
602
|
+
plugins: [strictArguments],
|
|
603
|
+
async run({ args, data }) {
|
|
604
|
+
await runDesignCommand("theme", data, args.config, {
|
|
605
|
+
kind: "theme",
|
|
606
|
+
targets: args._,
|
|
607
|
+
source: args.source
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
}),
|
|
611
|
+
utilities: defineCommand({
|
|
612
|
+
meta: {
|
|
613
|
+
name: "utilities",
|
|
614
|
+
description: "Check or search the utilities of the project"
|
|
615
|
+
},
|
|
616
|
+
args: candidateArgs,
|
|
617
|
+
plugins: [strictArguments],
|
|
618
|
+
async run({ args, data }) {
|
|
619
|
+
await runDesignCommand("utilities", data, args.config, {
|
|
620
|
+
kind: "utilities",
|
|
621
|
+
targets: args._
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
}),
|
|
625
|
+
variants: defineCommand({
|
|
626
|
+
meta: {
|
|
627
|
+
name: "variants",
|
|
628
|
+
description: "Check or search the variants of the project"
|
|
629
|
+
},
|
|
630
|
+
args: candidateArgs,
|
|
631
|
+
plugins: [strictArguments],
|
|
632
|
+
async run({ args, data }) {
|
|
633
|
+
await runDesignCommand("variants", data, args.config, {
|
|
634
|
+
kind: "variants",
|
|
635
|
+
targets: args._
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
}),
|
|
427
639
|
lsp: defineCommand({
|
|
428
640
|
meta: {
|
|
429
641
|
name: "lsp",
|
|
@@ -438,11 +650,23 @@ const subCommands = {
|
|
|
438
650
|
}
|
|
439
651
|
})
|
|
440
652
|
};
|
|
653
|
+
async function runDesignCommand(name, options, config, request) {
|
|
654
|
+
const { designSystem } = await import("@stillwind/analysis/node");
|
|
655
|
+
const result = cliResult(name, {
|
|
656
|
+
...await designSystem({
|
|
657
|
+
config,
|
|
658
|
+
cwd: options.cwd
|
|
659
|
+
}, request),
|
|
660
|
+
results: []
|
|
661
|
+
});
|
|
662
|
+
await writeResult(result, options);
|
|
663
|
+
process.exitCode = result.exitCode;
|
|
664
|
+
}
|
|
441
665
|
const command = defineCommand({
|
|
442
666
|
meta: {
|
|
443
667
|
name: "stillwind",
|
|
444
668
|
version,
|
|
445
|
-
description: "Sort and
|
|
669
|
+
description: "Sort, check, and inspect Stillwind styles"
|
|
446
670
|
},
|
|
447
671
|
args: {
|
|
448
672
|
...configArgs,
|
|
@@ -463,9 +687,12 @@ async function runCli(rawArgs = process.argv.slice(2)) {
|
|
|
463
687
|
const invocation = parseInvocation(rawArgs, {
|
|
464
688
|
...fmtArgs,
|
|
465
689
|
...lintArgs,
|
|
690
|
+
...inspectArgs,
|
|
691
|
+
...themeArgs,
|
|
692
|
+
...candidateArgs,
|
|
466
693
|
...lspArgs
|
|
467
694
|
});
|
|
468
|
-
name = invocation.name === "fmt" || invocation.name === "lint" ? invocation.name : null;
|
|
695
|
+
name = invocation.name === "fmt" || invocation.name === "lint" || invocation.name === "inspect" || invocation.name === "theme" || invocation.name === "utilities" || invocation.name === "variants" ? invocation.name : null;
|
|
469
696
|
if (invocation.name === "lsp") options.format = "text";
|
|
470
697
|
else readOutputOptions(rawArgs, options);
|
|
471
698
|
if (invocation.name && !Object.hasOwn(subCommands, invocation.name)) throw new Error(`Unknown command: ${invocation.name}`);
|
|
@@ -480,7 +707,7 @@ async function runCli(rawArgs = process.argv.slice(2)) {
|
|
|
480
707
|
} else if (rawArgs.length === 1 && invocation.version) write(version);
|
|
481
708
|
else {
|
|
482
709
|
if (invocation.version) throw new Error("--version must be used without a command");
|
|
483
|
-
if (!invocation.name) throw new Error("A command is required: fmt, lint, or lsp");
|
|
710
|
+
if (!invocation.name) throw new Error("A command is required: fmt, lint, inspect, theme, utilities, variants, or lsp");
|
|
484
711
|
await runCommand(subCommands[invocation.name], {
|
|
485
712
|
rawArgs: invocation.rawArgs,
|
|
486
713
|
data: options
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","names":["parseArgs","tokenizeArgs","packageJson.version"],"sources":["../package.json","../src/arguments.ts","../src/output.ts","../src/result.ts","../src/commands.ts","../src/main.ts"],"sourcesContent":["","import process from \"node:process\";\nimport { parseArgs as tokenizeArgs } from \"node:util\";\n\nimport { defineCittyPlugin, parseArgs, type ArgsDef } from \"citty\";\n\nimport type { DisplayMode, OutputFormat, OutputOptions } from \"./output.ts\";\n\nexport const configArgs = {\n config: {\n type: \"string\",\n alias: \"c\",\n description: \"Use this configuration file\",\n valueHint: \"path\",\n },\n} as const;\n\nexport const outputArgs = {\n format: {\n type: \"enum\",\n options: [\"text\", \"json\", \"github\", \"files\"] as OutputFormat[],\n default: process.env.GITHUB_ACTIONS === \"true\" ? \"github\" : \"text\",\n description: \"Output format\",\n },\n color: {\n type: \"enum\",\n options: [\"auto\", \"always\", \"never\"] as DisplayMode[],\n default: \"auto\",\n description: \"Control terminal colors\",\n },\n hyperlinks: {\n type: \"enum\",\n options: [\"auto\", \"always\", \"never\"] as DisplayMode[],\n default: \"auto\",\n description: \"Control links to source locations\",\n },\n} as const;\n\nexport const targetArgs = {\n ...configArgs,\n ...outputArgs,\n globs: {\n type: \"positional\",\n required: false,\n description: \"Filter configured targets with one or more globs\",\n },\n} as const;\n\nexport const warningArgs = {\n quiet: {\n type: \"boolean\",\n description: \"Hide lint warnings while retaining their counts\",\n },\n \"max-warnings\": {\n type: \"string\",\n description: \"Fail when the warning count exceeds this non-negative integer\",\n valueHint: \"count\",\n },\n} as const;\n\nexport function warningLimit(value: string | undefined): number | undefined {\n if (value === undefined) {\n return undefined;\n }\n if (!/^\\d+$/.test(value) || !Number.isSafeInteger(Number(value))) {\n throw new Error(\"Invalid value for --max-warnings: expected a non-negative integer\");\n }\n return Number(value);\n}\n\nexport const builtinArgs = {\n help: {\n type: \"boolean\",\n alias: \"h\",\n description: \"Show usage\",\n },\n version: {\n type: \"boolean\",\n alias: \"v\",\n description: \"Show version\",\n },\n} as const;\n\n/**\n * Updates display options using citty's enum validation and defaults.\n * A valid format is retained if a later display option fails, so the error uses the requested format.\n */\nexport function readOutputOptions(rawArgs: string[], options: OutputOptions): void {\n options.format = parseArgs<{\n format: typeof outputArgs.format;\n }>(rawArgs, {\n format: outputArgs.format,\n }).format;\n const { color, hyperlinks } = parseArgs<typeof outputArgs>(rawArgs, outputArgs);\n options.color = color;\n options.hyperlinks = hyperlinks;\n}\n\n/** Rejects unknown named options and empty string options that citty otherwise accepts. */\nexport const strictArguments = defineCittyPlugin({\n name: \"strict-arguments\",\n async setup({ args, cmd }) {\n const definitions: ArgsDef =\n (await (typeof cmd.args === \"function\" ? cmd.args() : cmd.args)) ?? {};\n const names = new Set([\n \"_\",\n ...Object.keys(definitions).flatMap((name) => [\n name,\n name.replace(/-([a-z])/g, (_, letter: string) => letter.toUpperCase()),\n ]),\n ]);\n for (const definition of Object.values(definitions)) {\n if (\"alias\" in definition) {\n for (const alias of [definition.alias ?? []].flat()) {\n names.add(alias);\n }\n }\n }\n for (const name of Object.keys(args)) {\n if (!names.has(name)) {\n throw new Error(`Unknown option: --${name}`);\n }\n }\n for (const [name, definition] of Object.entries(definitions)) {\n if (\n definition.type === \"string\" &&\n args[name] !== undefined &&\n (typeof args[name] !== \"string\" || args[name] === \"\")\n ) {\n throw new Error(`Missing or invalid value for --${name}`);\n }\n }\n },\n});\n\n/**\n * Locates the command without mistaking an option's value for it.\n * Keeps options before the command and removes help/version flags handled by the entrypoint.\n */\nexport function parseInvocation(rawArgs: string[], definitions: ArgsDef) {\n const combined: ArgsDef = { ...definitions, ...builtinArgs };\n const options: Record<string, { type: \"boolean\" | \"string\"; short?: string }> = {};\n for (const [name, definition] of Object.entries(combined)) {\n if (definition.type === \"positional\") {\n continue;\n }\n const option = {\n type: definition.type === \"boolean\" ? (\"boolean\" as const) : (\"string\" as const),\n };\n options[name] = option;\n if (\"alias\" in definition && typeof definition.alias === \"string\") {\n options[name].short = definition.alias;\n }\n }\n const { tokens } = tokenizeArgs({\n args: rawArgs,\n options,\n strict: false,\n allowPositionals: true,\n allowNegative: true,\n tokens: true,\n });\n const first = tokens.find(\n (token) => token.kind === \"positional\" || token.kind === \"option-terminator\",\n );\n const commandIndex = first?.kind === \"positional\" ? first.index : undefined;\n const builtinTokens = tokens.filter(\n (token) => token.kind === \"option\" && [\"help\", \"version\"].includes(token.name),\n );\n const flags = parseArgs<typeof builtinArgs>(\n builtinTokens.map((token) => rawArgs[token.index]),\n builtinArgs,\n );\n const omitted = new Set(builtinTokens.map((token) => token.index));\n if (commandIndex !== undefined) {\n omitted.add(commandIndex);\n }\n\n return {\n name: commandIndex === undefined ? undefined : rawArgs[commandIndex],\n rawArgs: rawArgs.filter((_, index) => !omitted.has(index)),\n help: flags.help,\n version: flags.version,\n };\n}\n","import path from \"node:path\";\nimport process from \"node:process\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { stripVTControlCharacters, styleText } from \"node:util\";\n\nimport type { CliDiagnostic, CliFailure, CliResult, ResultPolicy } from \"./result.ts\";\nimport type { SourceFrames } from \"./source-frame.ts\";\n\nexport type OutputFormat = \"text\" | \"json\" | \"github\" | \"files\";\n\nexport type DisplayMode = \"auto\" | \"always\" | \"never\";\n\nexport interface OutputOptions extends ResultPolicy {\n format: OutputFormat;\n color: DisplayMode;\n hyperlinks: DisplayMode;\n cwd?: string;\n}\n\ntype Label = CliDiagnostic[\"report\"][\"primary\"];\n\ntype Location = Label[\"location\"];\n\nexport function displayEnabled(\n mode: DisplayMode,\n kind: \"color\" | \"hyperlinks\",\n tty: boolean,\n env: NodeJS.ProcessEnv,\n): boolean {\n if (mode !== \"auto\") {\n return mode === \"always\";\n }\n if (kind === \"color\") {\n if (env.NO_COLOR !== undefined || env.FORCE_COLOR === \"0\") {\n return false;\n }\n if (env.FORCE_COLOR !== undefined) {\n return true;\n }\n return (\n env.TERM !== \"dumb\" && (tty || env.GITHUB_ACTIONS === \"true\" || env.GITLAB_CI === \"true\")\n );\n }\n return (\n tty &&\n !env.CI &&\n env.TERM !== \"dumb\" &&\n (env.TERM_PROGRAM === \"vscode\" ||\n env.TERM_PROGRAM === \"iTerm.app\" ||\n env.WT_SESSION !== undefined ||\n env.VTE_VERSION !== undefined ||\n env.TERM === \"xterm-kitty\")\n );\n}\n\n/** Renders one CLI result independently of the original analysis graph. */\nexport function renderResult(\n result: CliResult,\n options: OutputOptions,\n stderr = false,\n frames?: SourceFrames,\n): string {\n if (options.format === \"json\") {\n return JSON.stringify(result);\n }\n const root =\n options.format === \"github\"\n ? (process.env.GITHUB_WORKSPACE ?? options.cwd ?? process.cwd())\n : (options.cwd ?? process.cwd());\n const file = (uri: string) => {\n const displayed = displayPath(uri, root);\n return options.format === \"github\" ? displayed.replaceAll(\"\\\\\", \"/\") : displayed;\n };\n if (options.format === \"files\") {\n return result.changed.map(file).join(\"\\n\");\n }\n const tty = !!(stderr ? process.stderr : process.stdout).isTTY;\n const color =\n options.format === \"text\" && displayEnabled(options.color, \"color\", tty, process.env);\n const hyperlinks =\n options.format === \"text\" && displayEnabled(options.hyperlinks, \"hyperlinks\", tty, process.env);\n const at = (label: Label) =>\n label.scope === \"document\"\n ? file(label.location.uri)\n : `${file(label.location.uri)}:${label.location.startLine + 1}:${label.location.startColumn + 1}`;\n const linked = (label: Label) => link(at(label), label.location, hyperlinks);\n const addFrame = (label: Label) => {\n const frame = frames?.render(label);\n if (frame) {\n lines.push(...frame.split(\"\\n\").map((line) => ` ${line}`));\n }\n };\n const lines: string[] = [];\n for (const { project, report } of result.diagnostics) {\n const message = clean(report.message);\n const details = [\n ...(report.primary.message ? [`note: ${clean(report.primary.message)}`] : []),\n ...report.related.map(\n (label) => `related: ${at(label)}${label.message ? `: ${clean(label.message)}` : \"\"}`,\n ),\n ...report.notes.map((note) => `note: ${clean(note)}`),\n ...report.actions.map((action) => `help: ${clean(action.title)}`),\n ];\n if (options.format === \"github\") {\n const location = report.primary.location;\n const properties: Record<string, string | number> = {\n file: file(location.uri),\n title: `project ${project + 1}: ${clean(report.code)}`,\n };\n if (report.primary.scope === \"range\") {\n properties.line = location.startLine + 1;\n properties.col = location.startColumn + 1;\n // GitHub annotation ends are inclusive; report ranges are exclusive.\n if (\n location.endColumn > 0 &&\n (location.endLine > location.startLine || location.endColumn > location.startColumn)\n ) {\n properties.endLine = location.endLine + 1;\n properties.endColumn = location.endColumn;\n } else if (location.endLine > location.startLine) {\n properties.endLine = location.endLine;\n }\n }\n lines.push(\n annotation(\n report.severity === \"error\" ? \"error\" : \"warning\",\n properties,\n [message, ...details].join(\"\\n\"),\n ),\n );\n } else {\n const severity = paint(\n report.severity,\n report.severity === \"error\" ? \"red\" : \"yellow\",\n color,\n );\n lines.push(\n `${linked(report.primary)}: ${severity} ${clean(report.code)} [project ${project + 1}]: ${message}`,\n );\n addFrame(report.primary);\n if (report.primary.message) {\n lines.push(` note: ${clean(report.primary.message)}`);\n }\n for (const related of report.related) {\n lines.push(\n ` related: ${linked(related)}${related.message ? `: ${clean(related.message)}` : \"\"}`,\n );\n addFrame(related);\n }\n lines.push(...report.notes.map((note) => ` note: ${clean(note)}`));\n lines.push(...report.actions.map((action) => ` help: ${clean(action.title)}`));\n lines.push(\"\");\n }\n }\n for (const failure of result.failures) {\n lines.push(renderFailure(failure, options.format === \"github\", file, color));\n }\n if (result.command === \"fmt\") {\n for (const changed of result.changed) {\n if (options.format === \"github\" && options.check) {\n lines.push(\n annotation(\n \"error\",\n { file: file(changed), title: \"Stillwind formatting\" },\n \"Stillwind utilities need sorting. Run stillwind fmt.\",\n ),\n );\n } else {\n const location = { uri: changed, startLine: 0, startColumn: 0 };\n lines.push(\n `${link(file(changed), location, hyperlinks)}${options.format === \"text\" ? (options.check ? \": needs formatting\" : \": formatted\") : \"\"}`,\n );\n }\n }\n }\n if (result.summary.warningLimitExceeded) {\n const message = `Warning count (${result.summary.warnings}) exceeds --max-warnings${options.maxWarnings === undefined ? \"\" : ` (${options.maxWarnings})`}.`;\n lines.push(\n options.format === \"github\"\n ? annotation(\"error\", { title: \"Stillwind warnings\" }, message)\n : `error: ${message}`,\n );\n }\n if (options.format === \"text\") {\n if (lines.length && lines.at(-1) !== \"\") {\n lines.push(\"\");\n }\n const { summary } = result;\n lines.push(\n result.command === \"fmt\" && !summary.failures\n ? options.check\n ? summary.changed\n ? `${count(summary.changed, \"file\")} ${summary.changed === 1 ? \"needs\" : \"need\"} formatting.`\n : `All selected files are formatted (${summary.files} checked).`\n : `Formatted ${count(summary.changed, \"file\")} (${summary.files} checked).`\n : `${count(summary.errors, \"error\")}, ${count(summary.warnings, \"warning\")} in ${count(summary.files, \"file\")}${summary.failures ? `; ${count(summary.failures, \"execution failure\")}` : \"\"}.`,\n );\n const suggestions = result.diagnostics.filter(({ report }) => report.actions.length > 0).length;\n if (result.command === \"lint\" && suggestions) {\n lines.push(\n `help: Suggested edits are available for ${count(suggestions, \"diagnostic\")}. Run stillwind lint --fix to apply automatic fixes.`,\n );\n }\n }\n return lines.join(\"\\n\");\n}\n\n/** Writes text execution failures to stderr and command results to stdout. */\nexport async function writeResult(result: CliResult, options: OutputOptions): Promise<void> {\n const stderr = options.format === \"text\" && result.failures.length > 0;\n const frames =\n options.format === \"text\" && result.diagnostics.length\n ? new (await import(\"./source-frame.ts\")).SourceFrames()\n : undefined;\n const output = renderResult(result, options, stderr, frames);\n if (output) {\n (stderr ? process.stderr : process.stdout).write(output + \"\\n\");\n }\n}\n\nfunction renderFailure(\n failure: CliFailure,\n github: boolean,\n file: (uri: string) => string,\n color: boolean,\n): string {\n const details = failure.details.map((detail) => `${file(detail.file)}: ${clean(detail.message)}`);\n const project = failure.project === undefined ? \"\" : ` [project ${failure.project + 1}]`;\n return github\n ? annotation(\n \"error\",\n { ...(failure.file ? { file: file(failure.file) } : {}), title: `Stillwind${project}` },\n [clean(failure.message), ...details].join(\"\\n\"),\n )\n : `${failure.file ? `${file(failure.file)}: ` : \"\"}${paint(\"error\", \"red\", color)}${project}: ${clean(failure.message)}${details.length ? `\\n ${details.join(\"\\n \")}` : \"\"}`;\n}\n\nfunction count(value: number, noun: string): string {\n return `${value} ${noun}${value === 1 ? \"\" : \"s\"}`;\n}\n\nfunction paint(text: string, color: \"red\" | \"yellow\", enabled: boolean): string {\n return enabled ? styleText(color, text, { validateStream: false }) : text;\n}\n\nfunction clean(text: string): string {\n return stripVTControlCharacters(text).replace(/\\p{Cc}/gu, (character) =>\n character === \"\\n\" || character === \"\\r\" || character === \"\\t\" ? character : \"\",\n );\n}\n\nfunction sourcePath(uri: string): string {\n try {\n return uri.startsWith(\"file:\") ? fileURLToPath(uri) : uri;\n } catch {\n return uri;\n }\n}\n\nexport function displayPath(uri: string, cwd: string): string {\n const file = sourcePath(uri);\n return clean(path.isAbsolute(file) ? path.relative(cwd, file) || \".\" : file);\n}\n\nfunction link(\n label: string,\n location: Pick<Location, \"uri\" | \"startLine\" | \"startColumn\">,\n enabled: boolean,\n): string {\n const file = sourcePath(location.uri);\n if (!enabled || !path.isAbsolute(file)) {\n return label;\n }\n const url = pathToFileURL(file);\n url.hash = `L${location.startLine + 1}:${location.startColumn + 1}`;\n return `\\u001b]8;;${url.href}\\u001b\\\\${label}\\u001b]8;;\\u001b\\\\`;\n}\n\nexport function annotation(\n level: \"error\" | \"warning\",\n properties: Record<string, string | number>,\n message: string,\n): string {\n const escapeData = (value: string): string =>\n clean(value).replace(/%/g, \"%25\").replace(/\\r/g, \"%0D\").replace(/\\n/g, \"%0A\");\n const fields = Object.entries(properties)\n .map(\n ([key, value]) =>\n `${key}=${escapeData(String(value)).replace(/:/g, \"%3A\").replace(/,/g, \"%2C\")}`,\n )\n .join(\",\");\n return `::${level}${fields ? ` ${fields}` : \"\"}::${escapeData(message)}`;\n}\n","import { lintReports } from \"@stillwind/analysis\";\nimport type { LintResult } from \"@stillwind/analysis/node\";\n\nexport type CliCommand = \"lint\" | \"fmt\" | null;\n\nexport type CliDiagnostic = ReturnType<typeof lintReports>[number];\n\nexport interface CliFailure {\n project?: number;\n file?: string;\n message: string;\n details: {\n file: string;\n message: string;\n }[];\n}\n\nexport interface CliResult {\n command: CliCommand;\n config: string | null;\n diagnostics: CliDiagnostic[];\n failures: CliFailure[];\n changed: string[];\n summary: {\n files: number;\n errors: number;\n warnings: number;\n failures: number;\n changed: number;\n suggestions: number;\n warningLimitExceeded: boolean;\n };\n exitCode: 0 | 1 | 2;\n}\n\nexport interface ResultPolicy {\n check?: boolean;\n quiet?: boolean;\n maxWarnings?: number;\n}\n\n/** Projects analysis into CLI data before visibility filtering and rendering. */\nexport function cliResult(\n command: CliCommand,\n result: Pick<LintResult, \"config\" | \"results\" | \"changed\" | \"failures\">,\n policy: ResultPolicy = {},\n): CliResult {\n const failedFiles = new Set(result.failures?.map((failure) => failure.file));\n const diagnostics = lintReports(\n command === \"fmt\"\n ? result.results.filter(\n ({ result }) => result.status !== \"complete\" || failedFiles.has(result.entry),\n )\n : result.results,\n );\n const failures: CliFailure[] = result.results.flatMap(({ project, result }) =>\n result.status === \"complete\"\n ? []\n : [\n {\n project,\n file: result.entry,\n message: `Incomplete analysis${result.error ? `: ${result.error}` : \"\"}`,\n details: [\n ...(result.graph?.dependencies ?? []).flatMap((dependency) =>\n dependency.status === \"unresolved\" || dependency.status === \"unsupported\"\n ? [\n {\n file: dependency.importer,\n message: `${dependency.status}: ${dependency.specifier}`,\n },\n ]\n : [],\n ),\n ...(result.graph?.unverified ?? []).map((range) => ({\n file: range.moduleId,\n message: `unverified${range.start === undefined ? \"\" : ` bytes ${range.start}-${range.end}`}: ${range.reason}`,\n })),\n ],\n },\n ],\n );\n for (const failure of result.failures ?? []) {\n if (!failures.some((existing) => existing.file === failure.file)) {\n failures.push({\n file: failure.file,\n message: failure.message,\n details: [],\n });\n }\n }\n if (!result.results.length && !failures.length) {\n failures.push({\n message: \"No analysis targets matched the configured scopes\",\n details: [],\n });\n }\n const changed = [...new Set(result.changed ?? [])].sort();\n const errors = diagnostics.filter(({ report }) => report.severity === \"error\").length;\n const warnings = diagnostics.length - errors;\n const warningLimitExceeded = policy.maxWarnings !== undefined && warnings > policy.maxWarnings;\n return {\n command,\n config: result.config,\n diagnostics: policy.quiet\n ? diagnostics.filter(({ report }) => report.severity === \"error\")\n : diagnostics,\n failures,\n changed,\n summary: {\n files: new Set([\n ...result.results.map(({ result }) => result.entry),\n ...(result.failures ?? []).map((failure) => failure.file),\n ]).size,\n errors,\n warnings,\n failures: failures.length,\n changed: changed.length,\n suggestions: diagnostics.filter(({ report }) => report.actions.length > 0).length,\n warningLimitExceeded,\n },\n exitCode: failures.length\n ? 2\n : errors || warningLimitExceeded || (policy.check && changed.length)\n ? 1\n : 0,\n };\n}\n\n/** Retains reports carried by failed rewrite planning in the same CLI envelope. */\nexport function failureResult(\n command: CliCommand,\n error: unknown,\n policy: ResultPolicy = {},\n): CliResult {\n const results =\n error instanceof Error && \"results\" in error && Array.isArray(error.results)\n ? (error.results as LintResult[\"results\"])\n : [];\n const result = cliResult(\n \"lint\",\n {\n config: results[0]?.config ?? \"\",\n results,\n },\n policy,\n );\n result.command = command;\n result.config = results[0]?.config ?? null;\n if (!results.length || !result.failures.length) {\n result.failures = [\n {\n message: error instanceof Error ? error.message : String(error),\n details: [],\n },\n ];\n }\n result.summary.failures = result.failures.length;\n result.exitCode = 2;\n return result;\n}\n","import process from \"node:process\";\nimport { stripVTControlCharacters, styleText } from \"node:util\";\n\nimport { defineCommand, renderUsage, runCommand, type ArgsDef, type CommandDef } from \"citty\";\n\nimport packageJson from \"../package.json\" with { type: \"json\" };\nimport {\n builtinArgs,\n configArgs,\n outputArgs,\n parseInvocation,\n readOutputOptions,\n strictArguments,\n targetArgs,\n warningArgs,\n warningLimit,\n} from \"./arguments.ts\";\nimport { displayEnabled, writeResult, type OutputOptions } from \"./output.ts\";\nimport { cliResult, failureResult, type CliCommand } from \"./result.ts\";\n\nconst fmtArgs = {\n ...targetArgs,\n check: {\n type: \"boolean\",\n description: \"Check formatting without saving files\",\n },\n} as const;\n\nconst lintArgs = {\n ...targetArgs,\n ...warningArgs,\n format: {\n ...outputArgs.format,\n options: [\"text\", \"json\", \"github\"] as (\"text\" | \"json\" | \"github\")[],\n },\n fix: {\n type: \"boolean\",\n description: \"Apply converged automatic fixes\",\n },\n} as const;\n\nconst lspArgs = {\n ...configArgs,\n stdio: {\n type: \"boolean\",\n required: true,\n description: \"Use the Language Server Protocol over stdin/stdout\",\n },\n} as const;\n\nconst subCommands = {\n fmt: defineCommand({\n meta: {\n name: \"fmt\",\n description: \"Sort Stillwind utilities\",\n },\n args: fmtArgs,\n plugins: [strictArguments],\n async run({ args, data }) {\n const options = data as OutputOptions;\n options.check = args.check;\n const { format } = await import(\"@stillwind/analysis/node\");\n const analysis = await format({\n config: args.config,\n cwd: options.cwd,\n patterns: args._,\n check: args.check,\n });\n const result = cliResult(\"fmt\", analysis, {\n check: args.check,\n });\n await writeResult(result, options);\n process.exitCode = result.exitCode;\n },\n }),\n lint: defineCommand({\n meta: {\n name: \"lint\",\n description: \"Check Stillwind styles\",\n },\n args: lintArgs,\n plugins: [strictArguments],\n async run({ args, data }) {\n const options = data as OutputOptions;\n const maxWarnings = warningLimit(args[\"max-warnings\"]);\n options.quiet = args.quiet;\n options.maxWarnings = maxWarnings;\n const { lint } = await import(\"@stillwind/analysis/node\");\n const analysis = await lint({\n config: args.config,\n cwd: options.cwd,\n patterns: args._,\n fix: args.fix,\n });\n const result = cliResult(\"lint\", analysis, {\n quiet: args.quiet,\n maxWarnings,\n });\n await writeResult(result, options);\n process.exitCode = result.exitCode;\n },\n }),\n lsp: defineCommand({\n meta: {\n name: \"lsp\",\n description: \"Start the language server\",\n },\n args: lspArgs,\n plugins: [strictArguments],\n async run({ args }) {\n if (!args.stdio || args._.length) {\n throw new Error(\"lsp requires --stdio and accepts no globs\");\n }\n const { startLanguageServer } = await import(\"@stillwind/language-server/node\");\n startLanguageServer(args.config);\n },\n }),\n};\n\nexport const command = defineCommand({\n meta: {\n name: \"stillwind\",\n version: packageJson.version,\n description: \"Sort and check Stillwind styles\",\n },\n args: {\n ...configArgs,\n ...outputArgs,\n ...builtinArgs,\n },\n subCommands,\n});\n\nexport async function runCli(rawArgs = process.argv.slice(2)): Promise<void> {\n const options: OutputOptions = {\n format: outputArgs.format.default,\n color: \"auto\",\n hyperlinks: \"auto\",\n cwd: process.cwd(),\n };\n let name: CliCommand = null;\n\n try {\n const invocation = parseInvocation(rawArgs, {\n ...fmtArgs,\n ...lintArgs,\n ...lspArgs,\n });\n name = invocation.name === \"fmt\" || invocation.name === \"lint\" ? invocation.name : null;\n if (invocation.name === \"lsp\") {\n options.format = \"text\";\n } else {\n readOutputOptions(rawArgs, options);\n }\n if (invocation.name && !Object.hasOwn(subCommands, invocation.name)) {\n throw new Error(`Unknown command: ${invocation.name}`);\n }\n\n if (!rawArgs.length || invocation.help) {\n const sub = subCommands[invocation.name as keyof typeof subCommands];\n const subject = sub ?? command;\n const usage = await renderUsage<ArgsDef>(\n {\n meta: subject.meta,\n args: subject.args,\n subCommands: subject.subCommands,\n },\n sub\n ? {\n meta: command.meta,\n }\n : undefined,\n );\n write(displayUsage(usage, options));\n } else if (rawArgs.length === 1 && invocation.version) {\n write(packageJson.version);\n } else {\n if (invocation.version) {\n throw new Error(\"--version must be used without a command\");\n }\n if (!invocation.name) {\n throw new Error(\"A command is required: fmt, lint, or lsp\");\n }\n await runCommand(subCommands[invocation.name as keyof typeof subCommands] as CommandDef, {\n rawArgs: invocation.rawArgs,\n data: options,\n });\n }\n } catch (error) {\n const result = failureResult(name, error, options);\n await writeResult(\n result,\n options.format === \"files\" ? { ...options, format: \"text\" } : options,\n );\n process.exitCode = 2;\n }\n}\n\nfunction write(output: string): void {\n if (output) {\n process.stdout.write(output + \"\\n\");\n }\n}\n\nfunction displayUsage(usage: string, options: OutputOptions): string {\n const plain = stripVTControlCharacters(usage);\n return displayEnabled(options.color, \"color\", !!process.stdout.isTTY, process.env)\n ? styleText(\"cyan\", plain, {\n validateStream: false,\n })\n : plain;\n}\n","#!/usr/bin/env node\n\nimport { runCli } from \"./commands.ts\";\n\nawait runCli();\n"],"mappings":";;;;;;;;;;ACOA,MAAa,aAAa,EACxB,QAAQ;CACN,MAAM;CACN,OAAO;CACP,aAAa;CACb,WAAW;AACb,EACF;AAEA,MAAa,aAAa;CACxB,QAAQ;EACN,MAAM;EACN,SAAS;GAAC;GAAQ;GAAQ;GAAU;EAAO;EAC3C,SAAS,QAAQ,IAAI,mBAAmB,SAAS,WAAW;EAC5D,aAAa;CACf;CACA,OAAO;EACL,MAAM;EACN,SAAS;GAAC;GAAQ;GAAU;EAAO;EACnC,SAAS;EACT,aAAa;CACf;CACA,YAAY;EACV,MAAM;EACN,SAAS;GAAC;GAAQ;GAAU;EAAO;EACnC,SAAS;EACT,aAAa;CACf;AACF;AAEA,MAAa,aAAa;CACxB,GAAG;CACH,GAAG;CACH,OAAO;EACL,MAAM;EACN,UAAU;EACV,aAAa;CACf;AACF;AAEA,MAAa,cAAc;CACzB,OAAO;EACL,MAAM;EACN,aAAa;CACf;CACA,gBAAgB;EACd,MAAM;EACN,aAAa;EACb,WAAW;CACb;AACF;AAEA,SAAgB,aAAa,OAA+C;CAC1E,IAAI,UAAU,KAAA,GACZ;CAEF,IAAI,CAAC,QAAQ,KAAK,KAAK,KAAK,CAAC,OAAO,cAAc,OAAO,KAAK,CAAC,GAC7D,MAAM,IAAI,MAAM,mEAAmE;CAErF,OAAO,OAAO,KAAK;AACrB;AAEA,MAAa,cAAc;CACzB,MAAM;EACJ,MAAM;EACN,OAAO;EACP,aAAa;CACf;CACA,SAAS;EACP,MAAM;EACN,OAAO;EACP,aAAa;CACf;AACF;;;;;AAMA,SAAgB,kBAAkB,SAAmB,SAA8B;CACjF,QAAQ,SAASA,YAEd,SAAS,EACV,QAAQ,WAAW,OACrB,CAAC,CAAC,CAAC;CACH,MAAM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,CAAC,QAAQ,UAAU,WAAW,MAAM;GACtC,MAAM,MAAM,YAAY,WAAW;GACnC,MAAM,UAAU,OAAO;GAavB,MAAM,aAAa,MAZC,YAClB;IACE,MAAM,QAAQ;IACd,MAAM,QAAQ;IACd,aAAa,QAAQ;GACvB,GACA,MACI,EACE,MAAM,QAAQ,KAChB,IACA,KAAA,CACN,GAC0B,OAAO,CAAC;EACpC,OAAO,IAAI,QAAQ,WAAW,KAAK,WAAW,SAC5C,MAAMA,OAAmB;OACpB;GACL,IAAI,WAAW,SACb,MAAM,IAAI,MAAM,0CAA0C;GAE5D,IAAI,CAAC,WAAW,MACd,MAAM,IAAI,MAAM,0CAA0C;GAE5D,MAAM,WAAW,YAAY,WAAW,OAAiD;IACvF,SAAS,WAAW;IACpB,MAAM;GACR,CAAC;EACH;CACF,SAAS,OAAO;EAEd,MAAM,YADS,cAAc,MAAM,OAAO,OAExC,GACA,QAAQ,WAAW,UAAU;GAAE,GAAG;GAAS,QAAQ;EAAO,IAAI,OAChE;EACA,QAAQ,WAAW;CACrB;AACF;AAEA,SAAS,MAAM,QAAsB;CACnC,IAAI,QACF,QAAQ,OAAO,MAAM,SAAS,IAAI;AAEtC;AAEA,SAAS,aAAa,OAAe,SAAgC;CACnE,MAAM,QAAQ,yBAAyB,KAAK;CAC5C,OAAO,eAAe,QAAQ,OAAO,SAAS,CAAC,CAAC,QAAQ,OAAO,OAAO,QAAQ,GAAG,IAC7E,UAAU,QAAQ,OAAO,EACvB,gBAAgB,MAClB,CAAC,IACD;AACN;;AC/MA,MAAM,OAAO"}
|
|
1
|
+
{"version":3,"file":"main.js","names":["parseArgs","tokenizeArgs","packageJson.version"],"sources":["../package.json","../src/arguments.ts","../src/documentation.ts","../src/result.ts","../src/output.ts","../src/commands.ts","../src/main.ts"],"sourcesContent":["","import process from \"node:process\";\nimport { parseArgs as tokenizeArgs } from \"node:util\";\n\nimport { defineCittyPlugin, parseArgs, type ArgsDef } from \"citty\";\n\nimport type { DisplayMode, OutputFormat, OutputOptions } from \"./output.ts\";\n\nexport const configArgs = {\n config: {\n type: \"string\",\n alias: \"c\",\n description: \"Use this configuration file\",\n valueHint: \"path\",\n },\n} as const;\n\nexport const outputArgs = {\n format: {\n type: \"enum\",\n options: [\"text\", \"json\", \"github\", \"files\"] as OutputFormat[],\n default: process.env.GITHUB_ACTIONS === \"true\" ? \"github\" : \"text\",\n description: \"Output format\",\n },\n color: {\n type: \"enum\",\n options: [\"auto\", \"always\", \"never\"] as DisplayMode[],\n default: \"auto\",\n description: \"Control terminal colors\",\n },\n hyperlinks: {\n type: \"enum\",\n options: [\"auto\", \"always\", \"never\"] as DisplayMode[],\n default: \"auto\",\n description: \"Control links to source locations\",\n },\n} as const;\n\nexport const targetArgs = {\n ...configArgs,\n ...outputArgs,\n globs: {\n type: \"positional\",\n required: false,\n description: \"Filter configured targets with one or more globs\",\n },\n} as const;\n\nexport const warningArgs = {\n quiet: {\n type: \"boolean\",\n description: \"Hide lint warnings while retaining their counts\",\n },\n \"max-warnings\": {\n type: \"string\",\n description: \"Fail when the warning count exceeds this non-negative integer\",\n valueHint: \"count\",\n },\n} as const;\n\nexport function warningLimit(value: string | undefined): number | undefined {\n if (value === undefined) {\n return undefined;\n }\n if (!/^\\d+$/.test(value) || !Number.isSafeInteger(Number(value))) {\n throw new Error(\"Invalid value for --max-warnings: expected a non-negative integer\");\n }\n return Number(value);\n}\n\nexport const builtinArgs = {\n help: {\n type: \"boolean\",\n alias: \"h\",\n description: \"Show usage\",\n },\n version: {\n type: \"boolean\",\n alias: \"v\",\n description: \"Show version\",\n },\n} as const;\n\n/**\n * Updates display options using citty's enum validation and defaults.\n * A valid format is retained if a later display option fails, so the error uses the requested format.\n */\nexport function readOutputOptions(rawArgs: string[], options: OutputOptions): void {\n options.format = parseArgs<{\n format: typeof outputArgs.format;\n }>(rawArgs, {\n format: outputArgs.format,\n }).format;\n const { color, hyperlinks } = parseArgs<typeof outputArgs>(rawArgs, outputArgs);\n options.color = color;\n options.hyperlinks = hyperlinks;\n}\n\n/** Rejects unknown named options and empty string options that citty otherwise accepts. */\nexport const strictArguments = defineCittyPlugin({\n name: \"strict-arguments\",\n async setup({ args, cmd }) {\n const definitions: ArgsDef =\n (await (typeof cmd.args === \"function\" ? cmd.args() : cmd.args)) ?? {};\n const names = new Set([\n \"_\",\n ...Object.keys(definitions).flatMap((name) => [\n name,\n name.replace(/-([a-z])/g, (_, letter: string) => letter.toUpperCase()),\n ]),\n ]);\n for (const definition of Object.values(definitions)) {\n if (\"alias\" in definition) {\n for (const alias of [definition.alias ?? []].flat()) {\n names.add(alias);\n }\n }\n }\n for (const name of Object.keys(args)) {\n if (!names.has(name)) {\n throw new Error(`Unknown option: --${name}`);\n }\n }\n for (const [name, definition] of Object.entries(definitions)) {\n if (\n definition.type === \"string\" &&\n args[name] !== undefined &&\n (typeof args[name] !== \"string\" || args[name] === \"\")\n ) {\n throw new Error(`Missing or invalid value for --${name}`);\n }\n }\n },\n});\n\n/**\n * Locates the command without mistaking an option's value for it.\n * Keeps options before the command and removes help/version flags handled by the entrypoint.\n */\nexport function parseInvocation(rawArgs: string[], definitions: ArgsDef) {\n const combined: ArgsDef = { ...definitions, ...builtinArgs };\n const options: Record<string, { type: \"boolean\" | \"string\"; short?: string }> = {};\n for (const [name, definition] of Object.entries(combined)) {\n if (definition.type === \"positional\") {\n continue;\n }\n const option = {\n type: definition.type === \"boolean\" ? (\"boolean\" as const) : (\"string\" as const),\n };\n options[name] = option;\n if (\"alias\" in definition && typeof definition.alias === \"string\") {\n options[name].short = definition.alias;\n }\n }\n const { tokens } = tokenizeArgs({\n args: rawArgs,\n options,\n strict: false,\n allowPositionals: true,\n allowNegative: true,\n tokens: true,\n });\n const first = tokens.find(\n (token) => token.kind === \"positional\" || token.kind === \"option-terminator\",\n );\n const commandIndex = first?.kind === \"positional\" ? first.index : undefined;\n const builtinTokens = tokens.filter(\n (token) => token.kind === \"option\" && [\"help\", \"version\"].includes(token.name),\n );\n const flags = parseArgs<typeof builtinArgs>(\n builtinTokens.map((token) => rawArgs[token.index]),\n builtinArgs,\n );\n const omitted = new Set(builtinTokens.map((token) => token.index));\n if (commandIndex !== undefined) {\n omitted.add(commandIndex);\n }\n\n return {\n name: commandIndex === undefined ? undefined : rawArgs[commandIndex],\n rawArgs: rawArgs.filter((_, index) => !omitted.has(index)),\n help: flags.help,\n version: flags.version,\n };\n}\n","import { existsSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\n\n/**\n * Finds the documentation page of a report code.\n *\n * @param code - Compiler code, such as `SW01001`, or lint rule name.\n * @param root - Root directory of the installed `stillwind` package, when one resolves.\n * @returns The absolute path of the page in that package, which matches the installed version.\n * Otherwise, the page on the website. Codes without a page return undefined.\n */\nexport function documentationPage(code: string, root: string | undefined): string | undefined {\n const section = /^SW\\d+$/.test(code) ? \"errors\" : /^[a-z][a-z-]*$/.test(code) ? \"lints\" : null;\n if (!section) {\n return undefined;\n }\n const file = root && path.join(root, \"docs\", section, `${code}.md`);\n return file && existsSync(file) ? file : `https://stillwind.dev/docs/${section}/${code}`;\n}\n\n/**\n * Finds the `stillwind` package that a configuration file resolves.\n *\n * @param config - Absolute configuration path.\n * @returns The package root, or undefined when no package resolves.\n */\nexport function stillwindRoot(config: string | null): string | undefined {\n try {\n return config\n ? path.dirname(createRequire(config).resolve(\"stillwind/package.json\"))\n : undefined;\n } catch {\n return undefined;\n }\n}\n","import { lintReports } from \"@stillwind/analysis\";\nimport type { DesignSystemAnswer, InspectPreview, LintResult } from \"@stillwind/analysis/node\";\n\nimport { documentationPage, stillwindRoot } from \"./documentation.ts\";\n\n/**\n * A command that reads a design system and no source files.\n */\nexport type DesignCommand = \"theme\" | \"utilities\" | \"variants\";\n\nexport type CliCommand = \"lint\" | \"fmt\" | \"inspect\" | DesignCommand | null;\n\nexport type CliDiagnostic = ReturnType<typeof lintReports>[number] & {\n /** Absolute path or URL of the page that explains the report code. */\n docs?: string;\n};\n\n/** A preview whose findings link to the pages that explain their codes. */\nexport type CliPreview = Omit<InspectPreview, \"diagnostics\"> & {\n diagnostics: (InspectPreview[\"diagnostics\"][number] & {\n /** Absolute path or URL of the page that explains the code. */\n docs?: string;\n })[];\n};\n\nexport interface CliFailure {\n project?: number;\n file?: string;\n message: string;\n details: {\n file: string;\n message: string;\n }[];\n}\n\nexport interface CliResult {\n command: CliCommand;\n config: string | null;\n diagnostics: CliDiagnostic[];\n failures: CliFailure[];\n changed: string[];\n previews: CliPreview[];\n tokens: DesignSystemAnswer[\"tokens\"];\n candidates: DesignSystemAnswer[\"candidates\"];\n unmatched: string[];\n summary: {\n files: number;\n errors: number;\n warnings: number;\n failures: number;\n changed: number;\n previews: number;\n invalidPreviews: number;\n tokens: number;\n candidates: number;\n invalidCandidates: number;\n unmatched: number;\n suggestions: number;\n warningLimitExceeded: boolean;\n };\n exitCode: 0 | 1 | 2;\n}\n\nexport interface ResultPolicy {\n check?: boolean;\n quiet?: boolean;\n maxWarnings?: number;\n}\n\n/**\n * Tests whether a command reads a design system and no source files.\n */\nexport function isDesignCommand(command: CliCommand): command is DesignCommand {\n return command === \"theme\" || command === \"utilities\" || command === \"variants\";\n}\n\n/**\n * Projects analysis into CLI data before visibility filtering and rendering.\n */\nexport function cliResult(\n command: CliCommand,\n result: Pick<LintResult, \"config\" | \"results\" | \"changed\"> & {\n failures?: readonly Pick<NonNullable<LintResult[\"failures\"]>[number], \"file\" | \"message\">[];\n previews?: InspectPreview[];\n } & Partial<Pick<DesignSystemAnswer, \"tokens\" | \"candidates\" | \"unmatched\">>,\n policy: ResultPolicy = {},\n): CliResult {\n const failedFiles = new Set(result.failures?.map((failure) => failure.file));\n const root = stillwindRoot(result.config);\n const docs = (code: string) => {\n const page = documentationPage(code, root);\n return page ? { docs: page } : {};\n };\n const previews = (result.previews ?? []).map((preview) => ({\n ...preview,\n diagnostics: preview.diagnostics.map((diagnostic) => ({\n ...diagnostic,\n ...docs(diagnostic.code),\n })),\n }));\n const invalid = previews.filter(({ valid }) => !valid).length;\n const { tokens = [], candidates = [], unmatched = [] } = result;\n const invalidCandidates = candidates.filter(({ valid }) => !valid).length;\n const diagnostics: CliDiagnostic[] = lintReports(\n command !== \"lint\"\n ? result.results.filter(\n ({ result }) => result.status !== \"complete\" || failedFiles.has(result.entry),\n )\n : result.results,\n ).map((diagnostic) => ({ ...diagnostic, ...docs(diagnostic.report.code) }));\n const failures: CliFailure[] = result.results.flatMap(({ project, result }) =>\n result.status === \"complete\"\n ? []\n : [\n {\n project,\n file: result.entry,\n message: `Incomplete analysis${result.error ? `: ${result.error}` : \"\"}`,\n details: [\n ...(result.graph?.dependencies ?? []).flatMap((dependency) =>\n dependency.status === \"unresolved\" || dependency.status === \"unsupported\"\n ? [\n {\n file: dependency.importer,\n message: `${dependency.status}: ${dependency.specifier}`,\n },\n ]\n : [],\n ),\n ...(result.graph?.unverified ?? []).map((range) => ({\n file: range.moduleId,\n message: `unverified${range.start === undefined ? \"\" : ` bytes ${range.start}-${range.end}`}: ${range.reason}`,\n })),\n ],\n },\n ],\n );\n for (const failure of result.failures ?? []) {\n if (!failures.some((existing) => existing.file === failure.file)) {\n failures.push({\n file: failure.file,\n message: failure.message,\n details: [],\n });\n }\n }\n if (!result.results.length && !failures.length && !isDesignCommand(command)) {\n failures.push({\n message: \"No analysis targets matched the configured scopes\",\n details: [],\n });\n }\n const changed = [...new Set(result.changed ?? [])].sort();\n const errors = diagnostics.filter(({ report }) => report.severity === \"error\").length;\n const warnings = diagnostics.length - errors;\n const warningLimitExceeded = policy.maxWarnings !== undefined && warnings > policy.maxWarnings;\n return {\n command,\n config: result.config,\n diagnostics: policy.quiet\n ? diagnostics.filter(({ report }) => report.severity === \"error\")\n : diagnostics,\n failures,\n changed,\n previews,\n tokens,\n candidates,\n unmatched,\n summary: {\n files: new Set([\n ...result.results.map(({ result }) => result.entry),\n ...(result.failures ?? []).map((failure) => failure.file),\n ]).size,\n errors,\n warnings,\n failures: failures.length,\n changed: changed.length,\n previews: previews.length,\n invalidPreviews: invalid,\n tokens: tokens.length,\n candidates: candidates.length,\n invalidCandidates,\n unmatched: unmatched.length,\n suggestions: diagnostics.filter(({ report }) => report.actions.length > 0).length,\n warningLimitExceeded,\n },\n exitCode: failures.length\n ? 2\n : errors ||\n warningLimitExceeded ||\n (policy.check && changed.length) ||\n (command === \"inspect\" && (invalid || !previews.length)) ||\n invalidCandidates ||\n unmatched.length\n ? 1\n : 0,\n };\n}\n\n/**\n * Retains reports carried by failed rewrite planning in the same CLI envelope.\n */\nexport function failureResult(\n command: CliCommand,\n error: unknown,\n policy: ResultPolicy = {},\n): CliResult {\n const results =\n error instanceof Error && \"results\" in error && Array.isArray(error.results)\n ? (error.results as LintResult[\"results\"])\n : [];\n const result = cliResult(\n \"lint\",\n {\n config: results[0]?.config ?? \"\",\n results,\n },\n policy,\n );\n result.command = command;\n result.config = results[0]?.config ?? null;\n if (!results.length || !result.failures.length) {\n result.failures = [\n {\n message: error instanceof Error ? error.message : String(error),\n details: [],\n },\n ];\n }\n result.summary.failures = result.failures.length;\n result.exitCode = 2;\n return result;\n}\n","import path from \"node:path\";\nimport process from \"node:process\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { stripVTControlCharacters, styleText } from \"node:util\";\n\nimport {\n isDesignCommand,\n type CliDiagnostic,\n type CliFailure,\n type CliResult,\n type ResultPolicy,\n} from \"./result.ts\";\nimport type { SourceFrames } from \"./source-frame.ts\";\n\nexport type OutputFormat = \"text\" | \"json\" | \"github\" | \"files\";\n\nexport type DisplayMode = \"auto\" | \"always\" | \"never\";\n\nexport interface OutputOptions extends ResultPolicy {\n format: OutputFormat;\n color: DisplayMode;\n hyperlinks: DisplayMode;\n cwd?: string;\n}\n\ntype Label = CliDiagnostic[\"report\"][\"primary\"];\n\ntype Location = Label[\"location\"];\n\nexport function displayEnabled(\n mode: DisplayMode,\n kind: \"color\" | \"hyperlinks\",\n tty: boolean,\n env: NodeJS.ProcessEnv,\n): boolean {\n if (mode !== \"auto\") {\n return mode === \"always\";\n }\n if (kind === \"color\") {\n if (env.NO_COLOR !== undefined || env.FORCE_COLOR === \"0\") {\n return false;\n }\n if (env.FORCE_COLOR !== undefined) {\n return true;\n }\n return (\n env.TERM !== \"dumb\" && (tty || env.GITHUB_ACTIONS === \"true\" || env.GITLAB_CI === \"true\")\n );\n }\n return (\n tty &&\n !env.CI &&\n env.TERM !== \"dumb\" &&\n (env.TERM_PROGRAM === \"vscode\" ||\n env.TERM_PROGRAM === \"iTerm.app\" ||\n env.WT_SESSION !== undefined ||\n env.VTE_VERSION !== undefined ||\n env.TERM === \"xterm-kitty\")\n );\n}\n\n/** Renders one CLI result independently of the original analysis graph. */\nexport function renderResult(\n result: CliResult,\n options: OutputOptions,\n stderr = false,\n frames?: SourceFrames,\n): string {\n if (options.format === \"json\") {\n return JSON.stringify(result);\n }\n const root =\n options.format === \"github\"\n ? (process.env.GITHUB_WORKSPACE ?? options.cwd ?? process.cwd())\n : (options.cwd ?? process.cwd());\n const file = (uri: string) => {\n const displayed = displayPath(uri, root);\n return options.format === \"github\" ? displayed.replaceAll(\"\\\\\", \"/\") : displayed;\n };\n if (options.format === \"files\") {\n return result.changed.map(file).join(\"\\n\");\n }\n const tty = !!(stderr ? process.stderr : process.stdout).isTTY;\n const color =\n options.format === \"text\" && displayEnabled(options.color, \"color\", tty, process.env);\n const hyperlinks =\n options.format === \"text\" && displayEnabled(options.hyperlinks, \"hyperlinks\", tty, process.env);\n const at = (label: Label) =>\n label.scope === \"document\"\n ? file(label.location.uri)\n : `${file(label.location.uri)}:${label.location.startLine + 1}:${label.location.startColumn + 1}`;\n const linked = (label: Label) => link(at(label), label.location, hyperlinks);\n const addFrame = (label: Label) => {\n const frame = frames?.render(label);\n if (frame) {\n lines.push(...frame.split(\"\\n\").map((line) => ` ${line}`));\n }\n };\n const lines: string[] = [];\n for (const { project, report } of result.diagnostics) {\n const message = clean(report.message);\n const details = [\n ...(report.primary.message ? [`note: ${clean(report.primary.message)}`] : []),\n ...report.related.map(\n (label) => `related: ${at(label)}${label.message ? `: ${clean(label.message)}` : \"\"}`,\n ),\n ...report.notes.map((note) => `note: ${clean(note)}`),\n ...report.actions.map((action) => `help: ${clean(action.title)}`),\n ];\n if (options.format === \"github\") {\n const location = report.primary.location;\n const properties: Record<string, string | number> = {\n file: file(location.uri),\n title: `project ${project + 1}: ${clean(report.code)}`,\n };\n if (report.primary.scope === \"range\") {\n properties.line = location.startLine + 1;\n properties.col = location.startColumn + 1;\n // GitHub annotation ends are inclusive; report ranges are exclusive.\n if (\n location.endColumn > 0 &&\n (location.endLine > location.startLine || location.endColumn > location.startColumn)\n ) {\n properties.endLine = location.endLine + 1;\n properties.endColumn = location.endColumn;\n } else if (location.endLine > location.startLine) {\n properties.endLine = location.endLine;\n }\n }\n lines.push(\n annotation(\n report.severity === \"error\" ? \"error\" : \"warning\",\n properties,\n [message, ...details].join(\"\\n\"),\n ),\n );\n } else {\n const severity = paint(\n report.severity,\n report.severity === \"error\" ? \"red\" : \"yellow\",\n color,\n );\n lines.push(\n `${linked(report.primary)}: ${severity} ${clean(report.code)} [project ${project + 1}]: ${message}`,\n );\n addFrame(report.primary);\n if (report.primary.message) {\n lines.push(` note: ${clean(report.primary.message)}`);\n }\n for (const related of report.related) {\n lines.push(\n ` related: ${linked(related)}${related.message ? `: ${clean(related.message)}` : \"\"}`,\n );\n addFrame(related);\n }\n lines.push(...report.notes.map((note) => ` note: ${clean(note)}`));\n lines.push(...report.actions.map((action) => ` help: ${clean(action.title)}`));\n lines.push(\"\");\n }\n }\n for (const failure of result.failures) {\n lines.push(renderFailure(failure, options.format === \"github\", file, color));\n }\n if (result.command === \"fmt\") {\n for (const changed of result.changed) {\n if (options.format === \"github\" && options.check) {\n lines.push(\n annotation(\n \"error\",\n { file: file(changed), title: \"Stillwind formatting\" },\n \"Stillwind utilities need sorting. Run stillwind fmt.\",\n ),\n );\n } else {\n const location = { uri: changed, startLine: 0, startColumn: 0 };\n lines.push(\n `${link(file(changed), location, hyperlinks)}${options.format === \"text\" ? (options.check ? \": needs formatting\" : \": formatted\") : \"\"}`,\n );\n }\n }\n }\n if (result.command === \"inspect\") {\n for (const { project, location, css, valid, diagnostics, documentation } of result.previews) {\n const label = {\n scope: \"range\",\n location,\n } as Label;\n lines.push(`${linked(label)} [project ${project + 1}]`);\n const failure = valid || diagnostics.length ? [] : [\"error: CSS generation failed.\"];\n lines.push(\n ...clean(\n [\n ...failure,\n ...diagnostics.map(({ severity, code, message }) => `${severity} ${code}: ${message}`),\n css,\n documentation,\n ]\n .filter(Boolean)\n .join(\"\\n\"),\n )\n .trimEnd()\n .split(\"\\n\")\n .map((line) => (line ? ` ${line}` : \"\")),\n );\n lines.push(\"\");\n }\n if (!result.summary.previews && !result.summary.failures) {\n lines.push(\"The selected source has no generated CSS.\");\n }\n }\n const projects = new Set([...result.tokens, ...result.candidates].map(({ project }) => project));\n const tag = (project: number) => (projects.size > 1 ? ` [project ${project + 1}]` : \"\");\n for (const { project, name, value, source } of result.tokens) {\n lines.push(\n `${clean(name)}: ${clean(value)}${source === \"default\" ? \" (default)\" : \"\"}${tag(project)}`,\n );\n }\n for (const { project, name, kind, valid, css, suggestion, canonical } of result.candidates) {\n if (valid) {\n lines.push(`${clean(name)}${kind === \"marker\" ? \" (marker)\" : \"\"}${tag(project)}`);\n lines.push(\n ...clean(css)\n .trimEnd()\n .split(\"\\n\")\n .map((line) => (line ? ` ${line}` : \"\")),\n );\n if (canonical) {\n lines.push(` help: The canonical spelling is ${clean(canonical)}.`);\n }\n } else {\n lines.push(`${clean(name)}${tag(project)}: ${paint(`unknown ${kind}`, \"red\", color)}`);\n if (suggestion) {\n lines.push(` help: Did you mean ${clean(suggestion)}?`);\n }\n }\n lines.push(\"\");\n }\n for (const target of result.unmatched) {\n lines.push(`${clean(target)}: ${paint(\"no match\", \"red\", color)}`);\n }\n if (result.summary.warningLimitExceeded) {\n const message = `Warning count (${result.summary.warnings}) exceeds --max-warnings${options.maxWarnings === undefined ? \"\" : ` (${options.maxWarnings})`}.`;\n lines.push(\n options.format === \"github\"\n ? annotation(\"error\", { title: \"Stillwind warnings\" }, message)\n : `error: ${message}`,\n );\n }\n if (options.format === \"text\") {\n if (lines.length && lines.at(-1) !== \"\") {\n lines.push(\"\");\n }\n const { summary } = result;\n lines.push(\n isDesignCommand(result.command)\n ? `${result.command === \"theme\" ? count(summary.tokens, \"token\") : count(summary.candidates, result.command === \"variants\" ? \"variant\" : \"utility\").replace(\"utilitys\", \"utilities\")}${summary.invalidCandidates ? `; ${summary.invalidCandidates} unknown` : \"\"}${summary.unmatched ? `; ${count(summary.unmatched, \"unmatched target\")}` : \"\"}${summary.failures ? `; ${count(summary.failures, \"execution failure\")}` : \"\"}.`\n : result.command === \"inspect\"\n ? `${count(summary.previews, \"preview\")} in ${count(summary.files, \"file\")}${summary.invalidPreviews ? `; ${summary.invalidPreviews} failed to generate CSS` : \"\"}${summary.failures ? `; ${count(summary.failures, \"execution failure\")}` : \"\"}.`\n : result.command === \"fmt\" && !summary.failures\n ? options.check\n ? summary.changed\n ? `${count(summary.changed, \"file\")} ${summary.changed === 1 ? \"needs\" : \"need\"} formatting.`\n : `All selected files are formatted (${summary.files} checked).`\n : `Formatted ${count(summary.changed, \"file\")} (${summary.files} checked).`\n : `${count(summary.errors, \"error\")}, ${count(summary.warnings, \"warning\")} in ${count(summary.files, \"file\")}${summary.failures ? `; ${count(summary.failures, \"execution failure\")}` : \"\"}.`,\n );\n const suggestions = result.diagnostics.filter(({ report }) => report.actions.length > 0).length;\n if (result.command === \"lint\" && suggestions) {\n lines.push(\n `help: Suggested edits are available for ${count(suggestions, \"diagnostic\")}. Run stillwind lint --fix to apply automatic fixes.`,\n );\n }\n }\n return lines.join(\"\\n\");\n}\n\n/** Writes text execution failures to stderr and command results to stdout. */\nexport async function writeResult(result: CliResult, options: OutputOptions): Promise<void> {\n const stderr = options.format === \"text\" && result.failures.length > 0;\n const frames =\n options.format === \"text\" && result.diagnostics.length\n ? new (await import(\"./source-frame.ts\")).SourceFrames()\n : undefined;\n const output = renderResult(result, options, stderr, frames);\n if (output) {\n (stderr ? process.stderr : process.stdout).write(output + \"\\n\");\n }\n}\n\nfunction renderFailure(\n failure: CliFailure,\n github: boolean,\n file: (uri: string) => string,\n color: boolean,\n): string {\n const details = failure.details.map((detail) => `${file(detail.file)}: ${clean(detail.message)}`);\n const project = failure.project === undefined ? \"\" : ` [project ${failure.project + 1}]`;\n return github\n ? annotation(\n \"error\",\n { ...(failure.file ? { file: file(failure.file) } : {}), title: `Stillwind${project}` },\n [clean(failure.message), ...details].join(\"\\n\"),\n )\n : `${failure.file ? `${file(failure.file)}: ` : \"\"}${paint(\"error\", \"red\", color)}${project}: ${clean(failure.message)}${details.length ? `\\n ${details.join(\"\\n \")}` : \"\"}`;\n}\n\nfunction count(value: number, noun: string): string {\n return `${value} ${noun}${value === 1 ? \"\" : \"s\"}`;\n}\n\nfunction paint(text: string, color: \"red\" | \"yellow\", enabled: boolean): string {\n return enabled ? styleText(color, text, { validateStream: false }) : text;\n}\n\nfunction clean(text: string): string {\n return stripVTControlCharacters(text).replace(/\\p{Cc}/gu, (character) =>\n character === \"\\n\" || character === \"\\r\" || character === \"\\t\" ? character : \"\",\n );\n}\n\nfunction sourcePath(uri: string): string {\n try {\n return uri.startsWith(\"file:\") ? fileURLToPath(uri) : uri;\n } catch {\n return uri;\n }\n}\n\nexport function displayPath(uri: string, cwd: string): string {\n const file = sourcePath(uri);\n return clean(path.isAbsolute(file) ? path.relative(cwd, file) || \".\" : file);\n}\n\nfunction link(\n label: string,\n location: Pick<Location, \"uri\" | \"startLine\" | \"startColumn\">,\n enabled: boolean,\n): string {\n const file = sourcePath(location.uri);\n if (!enabled || !path.isAbsolute(file)) {\n return label;\n }\n const url = pathToFileURL(file);\n url.hash = `L${location.startLine + 1}:${location.startColumn + 1}`;\n return `\\u001b]8;;${url.href}\\u001b\\\\${label}\\u001b]8;;\\u001b\\\\`;\n}\n\nexport function annotation(\n level: \"error\" | \"warning\",\n properties: Record<string, string | number>,\n message: string,\n): string {\n const escapeData = (value: string): string =>\n clean(value).replace(/%/g, \"%25\").replace(/\\r/g, \"%0D\").replace(/\\n/g, \"%0A\");\n const fields = Object.entries(properties)\n .map(\n ([key, value]) =>\n `${key}=${escapeData(String(value)).replace(/:/g, \"%3A\").replace(/,/g, \"%2C\")}`,\n )\n .join(\",\");\n return `::${level}${fields ? ` ${fields}` : \"\"}::${escapeData(message)}`;\n}\n","import process from \"node:process\";\nimport { stripVTControlCharacters, styleText } from \"node:util\";\n\nimport type { DesignSystemRequest, DesignTokenSource } from \"@stillwind/analysis\";\nimport { defineCommand, renderUsage, runCommand, type ArgsDef, type CommandDef } from \"citty\";\n\nimport packageJson from \"../package.json\" with { type: \"json\" };\nimport {\n builtinArgs,\n configArgs,\n outputArgs,\n parseInvocation,\n readOutputOptions,\n strictArguments,\n targetArgs,\n warningArgs,\n warningLimit,\n} from \"./arguments.ts\";\nimport { displayEnabled, writeResult, type OutputOptions } from \"./output.ts\";\nimport { cliResult, failureResult, type CliCommand, type DesignCommand } from \"./result.ts\";\n\nconst fmtArgs = {\n ...targetArgs,\n check: {\n type: \"boolean\",\n description: \"Check formatting without saving files\",\n },\n} as const;\n\nconst lintArgs = {\n ...targetArgs,\n ...warningArgs,\n format: {\n ...outputArgs.format,\n options: [\"text\", \"json\", \"github\"] as (\"text\" | \"json\" | \"github\")[],\n },\n fix: {\n type: \"boolean\",\n description: \"Apply converged automatic fixes\",\n },\n} as const;\n\nconst inspectArgs = {\n ...targetArgs,\n format: {\n ...outputArgs.format,\n options: [\"text\", \"json\", \"github\"] as (\"text\" | \"json\" | \"github\")[],\n },\n globs: {\n ...targetArgs.globs,\n description: \"Select files with paths or globs, optionally followed by :line or :line:column\",\n },\n} as const;\n\nconst designArgs = {\n ...configArgs,\n format: {\n ...outputArgs.format,\n options: [\"text\", \"json\", \"github\"] as (\"text\" | \"json\" | \"github\")[],\n },\n color: outputArgs.color,\n hyperlinks: outputArgs.hyperlinks,\n} as const;\n\nconst themeArgs = {\n ...designArgs,\n names: {\n type: \"positional\",\n required: false,\n description: \"Select tokens by name without the leading --, where * matches any text\",\n },\n source: {\n type: \"enum\",\n options: [\"project\", \"default\"] as DesignTokenSource[],\n description: \"Show only the tokens with this origin\",\n },\n} as const;\n\nconst candidateArgs = {\n ...designArgs,\n names: {\n type: \"positional\",\n required: false,\n description: \"Check exact names, or search with * patterns\",\n },\n} as const;\n\nconst lspArgs = {\n ...configArgs,\n stdio: {\n type: \"boolean\",\n required: true,\n description: \"Use the Language Server Protocol over stdin/stdout\",\n },\n} as const;\n\nconst subCommands = {\n fmt: defineCommand({\n meta: {\n name: \"fmt\",\n description: \"Sort Stillwind utilities\",\n },\n args: fmtArgs,\n plugins: [strictArguments],\n async run({ args, data }) {\n const options = data as OutputOptions;\n options.check = args.check;\n const { format } = await import(\"@stillwind/analysis/node\");\n const analysis = await format({\n config: args.config,\n cwd: options.cwd,\n patterns: args._,\n check: args.check,\n });\n const result = cliResult(\"fmt\", analysis, {\n check: args.check,\n });\n await writeResult(result, options);\n process.exitCode = result.exitCode;\n },\n }),\n lint: defineCommand({\n meta: {\n name: \"lint\",\n description: \"Check Stillwind styles\",\n },\n args: lintArgs,\n plugins: [strictArguments],\n async run({ args, data }) {\n const options = data as OutputOptions;\n const maxWarnings = warningLimit(args[\"max-warnings\"]);\n options.quiet = args.quiet;\n options.maxWarnings = maxWarnings;\n const { lint } = await import(\"@stillwind/analysis/node\");\n const analysis = await lint({\n config: args.config,\n cwd: options.cwd,\n patterns: args._,\n fix: args.fix,\n });\n const result = cliResult(\"lint\", analysis, {\n quiet: args.quiet,\n maxWarnings,\n });\n await writeResult(result, options);\n process.exitCode = result.exitCode;\n },\n }),\n inspect: defineCommand({\n meta: {\n name: \"inspect\",\n description: \"Show the CSS that Stillwind generates for source code\",\n },\n args: inspectArgs,\n plugins: [strictArguments],\n async run({ args, data }) {\n const options = data as OutputOptions;\n const { inspect } = await import(\"@stillwind/analysis/node\");\n const analysis = await inspect({\n config: args.config,\n cwd: options.cwd,\n targets: args._,\n });\n const result = cliResult(\"inspect\", analysis);\n await writeResult(result, options);\n process.exitCode = result.exitCode;\n },\n }),\n theme: defineCommand({\n meta: {\n name: \"theme\",\n description: \"List the theme tokens of the project\",\n },\n args: themeArgs,\n plugins: [strictArguments],\n async run({ args, data }) {\n await runDesignCommand(\"theme\", data as OutputOptions, args.config, {\n kind: \"theme\",\n targets: args._,\n source: args.source,\n });\n },\n }),\n utilities: defineCommand({\n meta: {\n name: \"utilities\",\n description: \"Check or search the utilities of the project\",\n },\n args: candidateArgs,\n plugins: [strictArguments],\n async run({ args, data }) {\n await runDesignCommand(\"utilities\", data as OutputOptions, args.config, {\n kind: \"utilities\",\n targets: args._,\n });\n },\n }),\n variants: defineCommand({\n meta: {\n name: \"variants\",\n description: \"Check or search the variants of the project\",\n },\n args: candidateArgs,\n plugins: [strictArguments],\n async run({ args, data }) {\n await runDesignCommand(\"variants\", data as OutputOptions, args.config, {\n kind: \"variants\",\n targets: args._,\n });\n },\n }),\n lsp: defineCommand({\n meta: {\n name: \"lsp\",\n description: \"Start the language server\",\n },\n args: lspArgs,\n plugins: [strictArguments],\n async run({ args }) {\n if (!args.stdio || args._.length) {\n throw new Error(\"lsp requires --stdio and accepts no globs\");\n }\n const { startLanguageServer } = await import(\"@stillwind/language-server/node\");\n startLanguageServer(args.config);\n },\n }),\n};\n\nasync function runDesignCommand(\n name: DesignCommand,\n options: OutputOptions,\n config: string | undefined,\n request: DesignSystemRequest,\n): Promise<void> {\n const { designSystem } = await import(\"@stillwind/analysis/node\");\n const answer = await designSystem({ config, cwd: options.cwd }, request);\n const result = cliResult(name, { ...answer, results: [] });\n await writeResult(result, options);\n process.exitCode = result.exitCode;\n}\n\nexport const command = defineCommand({\n meta: {\n name: \"stillwind\",\n version: packageJson.version,\n description: \"Sort, check, and inspect Stillwind styles\",\n },\n args: {\n ...configArgs,\n ...outputArgs,\n ...builtinArgs,\n },\n subCommands,\n});\n\nexport async function runCli(rawArgs = process.argv.slice(2)): Promise<void> {\n const options: OutputOptions = {\n format: outputArgs.format.default,\n color: \"auto\",\n hyperlinks: \"auto\",\n cwd: process.cwd(),\n };\n let name: CliCommand = null;\n\n try {\n const invocation = parseInvocation(rawArgs, {\n ...fmtArgs,\n ...lintArgs,\n ...inspectArgs,\n ...themeArgs,\n ...candidateArgs,\n ...lspArgs,\n });\n name =\n invocation.name === \"fmt\" ||\n invocation.name === \"lint\" ||\n invocation.name === \"inspect\" ||\n invocation.name === \"theme\" ||\n invocation.name === \"utilities\" ||\n invocation.name === \"variants\"\n ? invocation.name\n : null;\n if (invocation.name === \"lsp\") {\n options.format = \"text\";\n } else {\n readOutputOptions(rawArgs, options);\n }\n if (invocation.name && !Object.hasOwn(subCommands, invocation.name)) {\n throw new Error(`Unknown command: ${invocation.name}`);\n }\n\n if (!rawArgs.length || invocation.help) {\n const sub = subCommands[invocation.name as keyof typeof subCommands];\n const subject = sub ?? command;\n const usage = await renderUsage<ArgsDef>(\n {\n meta: subject.meta,\n args: subject.args,\n subCommands: subject.subCommands,\n },\n sub\n ? {\n meta: command.meta,\n }\n : undefined,\n );\n write(displayUsage(usage, options));\n } else if (rawArgs.length === 1 && invocation.version) {\n write(packageJson.version);\n } else {\n if (invocation.version) {\n throw new Error(\"--version must be used without a command\");\n }\n if (!invocation.name) {\n throw new Error(\n \"A command is required: fmt, lint, inspect, theme, utilities, variants, or lsp\",\n );\n }\n await runCommand(subCommands[invocation.name as keyof typeof subCommands] as CommandDef, {\n rawArgs: invocation.rawArgs,\n data: options,\n });\n }\n } catch (error) {\n const result = failureResult(name, error, options);\n await writeResult(\n result,\n options.format === \"files\" ? { ...options, format: \"text\" } : options,\n );\n process.exitCode = 2;\n }\n}\n\nfunction write(output: string): void {\n if (output) {\n process.stdout.write(output + \"\\n\");\n }\n}\n\nfunction displayUsage(usage: string, options: OutputOptions): string {\n const plain = stripVTControlCharacters(usage);\n return displayEnabled(options.color, \"color\", !!process.stdout.isTTY, process.env)\n ? styleText(\"cyan\", plain, {\n validateStream: false,\n })\n : plain;\n}\n","#!/usr/bin/env node\n\nimport { runCli } from \"./commands.ts\";\n\nawait runCli();\n"],"mappings":";;;;;;;;;;;;ACOA,MAAa,aAAa,EACxB,QAAQ;CACN,MAAM;CACN,OAAO;CACP,aAAa;CACb,WAAW;AACb,EACF;AAEA,MAAa,aAAa;CACxB,QAAQ;EACN,MAAM;EACN,SAAS;GAAC;GAAQ;GAAQ;GAAU;EAAO;EAC3C,SAAS,QAAQ,IAAI,mBAAmB,SAAS,WAAW;EAC5D,aAAa;CACf;CACA,OAAO;EACL,MAAM;EACN,SAAS;GAAC;GAAQ;GAAU;EAAO;EACnC,SAAS;EACT,aAAa;CACf;CACA,YAAY;EACV,MAAM;EACN,SAAS;GAAC;GAAQ;GAAU;EAAO;EACnC,SAAS;EACT,aAAa;CACf;AACF;AAEA,MAAa,aAAa;CACxB,GAAG;CACH,GAAG;CACH,OAAO;EACL,MAAM;EACN,UAAU;EACV,aAAa;CACf;AACF;AAEA,MAAa,cAAc;CACzB,OAAO;EACL,MAAM;EACN,aAAa;CACf;CACA,gBAAgB;EACd,MAAM;EACN,aAAa;EACb,WAAW;CACb;AACF;AAEA,SAAgB,aAAa,OAA+C;CAC1E,IAAI,UAAU,KAAA,GACZ;CAEF,IAAI,CAAC,QAAQ,KAAK,KAAK,KAAK,CAAC,OAAO,cAAc,OAAO,KAAK,CAAC,GAC7D,MAAM,IAAI,MAAM,mEAAmE;CAErF,OAAO,OAAO,KAAK;AACrB;AAEA,MAAa,cAAc;CACzB,MAAM;EACJ,MAAM;EACN,OAAO;EACP,aAAa;CACf;CACA,SAAS;EACP,MAAM;EACN,OAAO;EACP,aAAa;CACf;AACF;;;;;AAMA,SAAgB,kBAAkB,SAAmB,SAA8B;CACjF,QAAQ,SAASA,YAEd,SAAS,EACV,QAAQ,WAAW,OACrB,CAAC,CAAC,CAAC;CACH,MAAM,EAAE,OAAO,eAAeA,YAA6B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QAAQ,WAAW,UAAU;GAAE,GAAG;GAAS,QAAQ;EAAO,IAAI,OAChE;EACA,QAAQ,WAAW;CACrB;AACF;AAEA,SAAS,MAAM,QAAsB;CACnC,IAAI,QACF,QAAQ,OAAO,MAAM,SAAS,IAAI;AAEtC;AAEA,SAAS,aAAa,OAAe,SAAgC;CACnE,MAAM,QAAQ,yBAAyB,KAAK;CAC5C,OAAO,eAAe,QAAQ,OAAO,SAAS,CAAC,CAAC,QAAQ,OAAO,OAAO,QAAQ,GAAG,IAC7E,UAAU,QAAQ,OAAO,EACvB,gBAAgB,MAClB,CAAC,IACD;AACN;;ACtVA,MAAM,OAAO"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stillwind/cli",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Command wrappers for Stillwind tools",
|
|
5
|
-
"homepage": "https://stillwind.dev
|
|
5
|
+
"homepage": "https://stillwind.dev",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/SegaraRai/stillwind/issues"
|
|
8
8
|
},
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/code-frame": "^8.0.6",
|
|
34
|
-
"@stillwind/analysis": "0.1
|
|
35
|
-
"@stillwind/language-server": "0.1
|
|
36
|
-
"@stillwind/native": "0.1
|
|
34
|
+
"@stillwind/analysis": "0.4.1",
|
|
35
|
+
"@stillwind/language-server": "0.4.1",
|
|
36
|
+
"@stillwind/native": "0.4.1",
|
|
37
37
|
"citty": "^0.2.2",
|
|
38
38
|
"string-width": "^8.3.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@stillwind-internal/tools-workspace": "0.0.0",
|
|
42
42
|
"@types/babel__code-frame": "^7.27.0",
|
|
43
|
-
"@types/node": "^26.6.
|
|
43
|
+
"@types/node": "^26.6.6",
|
|
44
44
|
"typescript": "^6.0.3",
|
|
45
45
|
"vite-plus": "1.4.0"
|
|
46
46
|
}
|