@csszyx/mcp-server 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -9
- package/dist/index.d.mts +38 -1
- package/dist/index.mjs +99 -2
- package/llms-full.txt +59 -26
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -53,15 +53,16 @@ The server speaks MCP over stdio, so any MCP-compatible client uses the same
|
|
|
53
53
|
|
|
54
54
|
## Tools
|
|
55
55
|
|
|
56
|
-
| Tool
|
|
57
|
-
|
|
|
58
|
-
| `csszyx_expand`
|
|
59
|
-
| `csszyx_batch`
|
|
60
|
-
| `csszyx_reverse`
|
|
61
|
-
| `csszyx_validate`
|
|
62
|
-
| `csszyx_lookup`
|
|
63
|
-
| `csszyx_migrate`
|
|
64
|
-
| `csszyx_theme`
|
|
56
|
+
| Tool | Purpose |
|
|
57
|
+
| ------------------------ | ----------------------------------------------------------------------------------------------- |
|
|
58
|
+
| `csszyx_expand` | Expand one `sz` object into a Tailwind class string |
|
|
59
|
+
| `csszyx_batch` | Expand many `sz` objects in one call |
|
|
60
|
+
| `csszyx_reverse` | Convert a Tailwind class string back into an `sz` object |
|
|
61
|
+
| `csszyx_validate` | Validate an `sz` object; reports unknown props and CSS-name mistakes |
|
|
62
|
+
| `csszyx_lookup` | Look up how a CSS property/keyword maps to an `sz` key |
|
|
63
|
+
| `csszyx_migrate` | Rewrite a JSX/TSX snippet's `className` attributes into `sz` props |
|
|
64
|
+
| `csszyx_theme` | Parse `@theme` CSS blocks and categorize design tokens |
|
|
65
|
+
| `csszyx_compile_preview` | Compile a whole source module and report the classes, diagnostics, and leftover runtime helpers |
|
|
65
66
|
|
|
66
67
|
## Resources
|
|
67
68
|
|
package/dist/index.d.mts
CHANGED
|
@@ -8,7 +8,7 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
8
8
|
* understand and generate csszyx sz props.
|
|
9
9
|
*
|
|
10
10
|
* Architecture follows Tier-1 Proxy patterns:
|
|
11
|
-
* -
|
|
11
|
+
* - 8 Stateless Sandbox tools (no destructive edits)
|
|
12
12
|
* - 3 Reference Data Endpoints
|
|
13
13
|
* - Unified Single Source of Truth via @csszyx/compiler and @csszyx/unplugin
|
|
14
14
|
*
|
|
@@ -33,6 +33,8 @@ declare const TOOLS: ({
|
|
|
33
33
|
injectTodos?: undefined;
|
|
34
34
|
items?: undefined;
|
|
35
35
|
css?: undefined;
|
|
36
|
+
source?: undefined;
|
|
37
|
+
filename?: undefined;
|
|
36
38
|
};
|
|
37
39
|
required: string[];
|
|
38
40
|
};
|
|
@@ -53,6 +55,8 @@ declare const TOOLS: ({
|
|
|
53
55
|
injectTodos?: undefined;
|
|
54
56
|
items?: undefined;
|
|
55
57
|
css?: undefined;
|
|
58
|
+
source?: undefined;
|
|
59
|
+
filename?: undefined;
|
|
56
60
|
};
|
|
57
61
|
required: string[];
|
|
58
62
|
};
|
|
@@ -73,6 +77,8 @@ declare const TOOLS: ({
|
|
|
73
77
|
injectTodos?: undefined;
|
|
74
78
|
items?: undefined;
|
|
75
79
|
css?: undefined;
|
|
80
|
+
source?: undefined;
|
|
81
|
+
filename?: undefined;
|
|
76
82
|
};
|
|
77
83
|
required: string[];
|
|
78
84
|
};
|
|
@@ -99,6 +105,8 @@ declare const TOOLS: ({
|
|
|
99
105
|
query?: undefined;
|
|
100
106
|
items?: undefined;
|
|
101
107
|
css?: undefined;
|
|
108
|
+
source?: undefined;
|
|
109
|
+
filename?: undefined;
|
|
102
110
|
};
|
|
103
111
|
required: string[];
|
|
104
112
|
};
|
|
@@ -122,6 +130,8 @@ declare const TOOLS: ({
|
|
|
122
130
|
customMap?: undefined;
|
|
123
131
|
injectTodos?: undefined;
|
|
124
132
|
css?: undefined;
|
|
133
|
+
source?: undefined;
|
|
134
|
+
filename?: undefined;
|
|
125
135
|
};
|
|
126
136
|
required: string[];
|
|
127
137
|
};
|
|
@@ -142,6 +152,33 @@ declare const TOOLS: ({
|
|
|
142
152
|
customMap?: undefined;
|
|
143
153
|
injectTodos?: undefined;
|
|
144
154
|
items?: undefined;
|
|
155
|
+
source?: undefined;
|
|
156
|
+
filename?: undefined;
|
|
157
|
+
};
|
|
158
|
+
required: string[];
|
|
159
|
+
};
|
|
160
|
+
} | {
|
|
161
|
+
name: string;
|
|
162
|
+
description: string;
|
|
163
|
+
inputSchema: {
|
|
164
|
+
type: "object";
|
|
165
|
+
properties: {
|
|
166
|
+
source: {
|
|
167
|
+
type: "string";
|
|
168
|
+
description: string;
|
|
169
|
+
};
|
|
170
|
+
filename: {
|
|
171
|
+
type: "string";
|
|
172
|
+
description: string;
|
|
173
|
+
};
|
|
174
|
+
sz?: undefined;
|
|
175
|
+
classes?: undefined;
|
|
176
|
+
query?: undefined;
|
|
177
|
+
code?: undefined;
|
|
178
|
+
customMap?: undefined;
|
|
179
|
+
injectTodos?: undefined;
|
|
180
|
+
items?: undefined;
|
|
181
|
+
css?: undefined;
|
|
145
182
|
};
|
|
146
183
|
required: string[];
|
|
147
184
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
6
6
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
7
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
8
8
|
import { ListToolsRequestSchema, CallToolRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
9
|
-
import { sortStrings, SPECIAL_VARIANTS, KNOWN_VARIANTS, PROPERTY_MAP, transform, SUGGESTION_MAP, BOOLEAN_SHORTHANDS, REMOVED_BOOLEAN_SUGAR } from '@csszyx/compiler';
|
|
9
|
+
import { sortStrings, SPECIAL_VARIANTS, KNOWN_VARIANTS, PROPERTY_MAP, transform, transformSource, SUGGESTION_MAP, BOOLEAN_SHORTHANDS, REMOVED_BOOLEAN_SUGAR } from '@csszyx/compiler';
|
|
10
10
|
import { z } from 'zod';
|
|
11
11
|
import { migrateSource, classNameToSzObject } from '@csszyx/cli';
|
|
12
12
|
import { parseThemeBlocks, hasTokens } from '@csszyx/unplugin';
|
|
@@ -333,6 +333,81 @@ function handleBatch(input) {
|
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
+
const compilePreviewSchema = z.object({
|
|
337
|
+
source: z.string().describe(
|
|
338
|
+
"A source module to compile. Include the code AROUND the sz prop \u2014 imports, the factory call, the component \u2014 since that is what decides whether csszyx can compile it."
|
|
339
|
+
),
|
|
340
|
+
filename: z.string().optional().describe(
|
|
341
|
+
"Filename to attribute diagnostics to. The extension selects the parser, so use .tsx for JSX. Defaults to preview.tsx."
|
|
342
|
+
)
|
|
343
|
+
});
|
|
344
|
+
const RUNTIME_HELPERS = [
|
|
345
|
+
["_sz", "usesRuntime"],
|
|
346
|
+
["_szMerge", "usesMerge"],
|
|
347
|
+
["_szPart", "usesSzPart"],
|
|
348
|
+
["szcn", "usesSzcn"],
|
|
349
|
+
["__szvPick", "usesSzvPick"],
|
|
350
|
+
["__szvPick1", "usesSzvPick1"],
|
|
351
|
+
["__szColorVar", "usesColorVar"],
|
|
352
|
+
["__szSpacingVar", "usesSpacingVar"],
|
|
353
|
+
["__szUnitVar", "usesUnitVar"],
|
|
354
|
+
["__szBoolClass", "usesBoolClass"]
|
|
355
|
+
];
|
|
356
|
+
function restoreEnv(name, value) {
|
|
357
|
+
if (value === void 0) {
|
|
358
|
+
delete process.env[name];
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
process.env[name] = value;
|
|
362
|
+
}
|
|
363
|
+
function compileWithDiagnostics(source, filename) {
|
|
364
|
+
const warnings = [];
|
|
365
|
+
const originalWarn = console.warn;
|
|
366
|
+
const originalNodeEnv = process.env.NODE_ENV;
|
|
367
|
+
const originalQuiet = process.env.CSSZYX_QUIET_SZ_WARNINGS;
|
|
368
|
+
console.warn = (...args) => {
|
|
369
|
+
warnings.push(args.map(String).join(" "));
|
|
370
|
+
};
|
|
371
|
+
process.env.NODE_ENV = "development";
|
|
372
|
+
delete process.env.CSSZYX_QUIET_SZ_WARNINGS;
|
|
373
|
+
try {
|
|
374
|
+
return { result: transformSource(source, filename), warnings };
|
|
375
|
+
} finally {
|
|
376
|
+
console.warn = originalWarn;
|
|
377
|
+
restoreEnv("NODE_ENV", originalNodeEnv);
|
|
378
|
+
restoreEnv("CSSZYX_QUIET_SZ_WARNINGS", originalQuiet);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
function handleCompilePreview(input) {
|
|
382
|
+
const { result, warnings } = compileWithDiagnostics(
|
|
383
|
+
input.source,
|
|
384
|
+
input.filename ?? "preview.tsx"
|
|
385
|
+
);
|
|
386
|
+
return {
|
|
387
|
+
content: [
|
|
388
|
+
{
|
|
389
|
+
type: "text",
|
|
390
|
+
text: JSON.stringify(
|
|
391
|
+
{
|
|
392
|
+
transformed: result.transformed,
|
|
393
|
+
code: result.code,
|
|
394
|
+
// Emission order, not sorted: this is the order the
|
|
395
|
+
// element actually carries, and reordering it would
|
|
396
|
+
// hide a cascade question the preview is asked about.
|
|
397
|
+
classes: [...result.classes],
|
|
398
|
+
diagnostics: [...result.diagnostics, ...warnings],
|
|
399
|
+
runtimeHelpers: RUNTIME_HELPERS.filter(
|
|
400
|
+
([, flag]) => result[flag] === true
|
|
401
|
+
).map(([name]) => name)
|
|
402
|
+
},
|
|
403
|
+
null,
|
|
404
|
+
2
|
|
405
|
+
)
|
|
406
|
+
}
|
|
407
|
+
]
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
|
|
336
411
|
const expandSchema = z.object({
|
|
337
412
|
sz: z.record(z.string(), z.any()).describe(
|
|
338
413
|
"The sz prop object to expand. Example: { p: 4, bg: 'blue-500', hover: { bg: 'blue-700' } }"
|
|
@@ -773,6 +848,24 @@ const TOOLS = [
|
|
|
773
848
|
},
|
|
774
849
|
required: ["css"]
|
|
775
850
|
}
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
name: "csszyx_compile_preview",
|
|
854
|
+
description: "Compile a whole SOURCE MODULE and report what csszyx made of it: the rewritten code, the classes, the diagnostics, and the runtime helpers left over. Use this when the question is about the code AROUND the sz prop \u2014 whether a szv factory precompiles, whether a value stays dynamic, whether a key is unknown. For a bare sz object, use csszyx_expand instead.",
|
|
855
|
+
inputSchema: {
|
|
856
|
+
type: "object",
|
|
857
|
+
properties: {
|
|
858
|
+
source: {
|
|
859
|
+
type: "string",
|
|
860
|
+
description: "A source module, including its imports and component. Example: export const A = () => <div sz={{ p: 4 }} />;"
|
|
861
|
+
},
|
|
862
|
+
filename: {
|
|
863
|
+
type: "string",
|
|
864
|
+
description: "Filename to attribute diagnostics to. The extension selects the parser, so use .tsx for JSX. Defaults to preview.tsx."
|
|
865
|
+
}
|
|
866
|
+
},
|
|
867
|
+
required: ["source"]
|
|
868
|
+
}
|
|
776
869
|
}
|
|
777
870
|
];
|
|
778
871
|
const TOOL_HANDLERS = {
|
|
@@ -782,7 +875,11 @@ const TOOL_HANDLERS = {
|
|
|
782
875
|
csszyx_lookup: { schema: lookupSchema, handler: handleLookup },
|
|
783
876
|
csszyx_migrate: { schema: migrateSchema, handler: handleMigrate },
|
|
784
877
|
csszyx_batch: { schema: batchSchema, handler: handleBatch },
|
|
785
|
-
csszyx_theme: { schema: themeSchema, handler: handleTheme }
|
|
878
|
+
csszyx_theme: { schema: themeSchema, handler: handleTheme },
|
|
879
|
+
csszyx_compile_preview: {
|
|
880
|
+
schema: compilePreviewSchema,
|
|
881
|
+
handler: handleCompilePreview
|
|
882
|
+
}
|
|
786
883
|
};
|
|
787
884
|
server.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
788
885
|
return { tools: TOOLS };
|
package/llms-full.txt
CHANGED
|
@@ -367,14 +367,15 @@ value position — `p`, `bg`, `m`, `w`, `text`, …, not just font-size):
|
|
|
367
367
|
|
|
368
368
|
Handling `group-*`, `peer-*`, and arbitrary variants.
|
|
369
369
|
|
|
370
|
-
| Concept
|
|
371
|
-
|
|
|
372
|
-
| **Group Hover**
|
|
373
|
-
| **Peer Focus**
|
|
374
|
-
| **Data Attribute**
|
|
375
|
-
| **ARIA Attribute**
|
|
376
|
-
| **Arbitrary Variant**
|
|
377
|
-
| **Important Modifier**
|
|
370
|
+
| Concept | CSS Rule | Tailwind v4 Class | `sz` Prop (Object Syntax) | Note |
|
|
371
|
+
| :------------------------------ | :------------------------------------ | :------------------------ | :------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
372
|
+
| **Group Hover** | `.group:hover .group-hover:text-blue` | `group-hover:text-blue` | `{ group: { hover: { color: 'blue' } } }` | **Sugar**: Nested `group` key acts as modifier scope. |
|
|
373
|
+
| **Peer Focus** | `.peer:focus ~ .peer-focus:text-blue` | `peer-focus:text-blue` | `{ peer: { focus: { color: 'blue' } } }` | **Sugar**: Nested `peer` key. |
|
|
374
|
+
| **Data Attribute** | `&[data-active] (etc)` | `data-[active]:text-blue` | `{ data: { active: { color: 'blue' } } }` | **Sugar**: Maps to `data-[key]`. |
|
|
375
|
+
| **ARIA Attribute** | `&[aria-expanded="true"] (etc)` | `aria-expanded:text-blue` | `{ aria: { expanded: { color: 'blue' } } }` | **Sugar**: Maps to `aria-[key]`. |
|
|
376
|
+
| **Arbitrary Variant** | `& > span` | `[&>span]:text-blue` | `{ '[& > span]': { color: 'blue' } }` | |
|
|
377
|
+
| **Important Modifier** | `color: red !important` | `text-red-500!` | `{ color: 'red-500!' }` | **New**: Trailing `!` in value maps to trailing `!` in class. |
|
|
378
|
+
| **Important + arbitrary value** | `font-size: 14px !important` | `text-[14px]!` | `{ text: '14px!' }` | The `!` sits **outside** the brackets. A value that needs brackets is decided without the `!` attached, so `14px` is still recognised as a length. |
|
|
378
379
|
|
|
379
380
|
## Style Conflict Management
|
|
380
381
|
|
|
@@ -3407,7 +3408,7 @@ Controlling the font weight.
|
|
|
3407
3408
|
| Concept | CSS Rule | Tailwind v4 Class | `sz` Prop (Object Syntax) | Note |
|
|
3408
3409
|
| :--------------- | :---------------------- | :--------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------- | :----------------------------------------------------------------- |
|
|
3409
3410
|
| **Keywords** | `font-weight: 100-900` | `font-thin`, `font-extralight`, `font-light`, `font-normal`, `font-medium`, `font-semibold`, `font-bold`, `font-extrabold`, `font-black` | `{ weight: 'thin' }`, `{ weight: 'extralight' }` etc. | |
|
|
3410
|
-
| **Number** | `font-weight: 100-900` | `font-100`, `font-200`, `font-300`, `font-400`, `font-500`, `font-600`, `font-700`, `font-800`, `font-900`
|
|
3411
|
+
| **Number** | `font-weight: 100-900` | `font-[100]`, `font-[200]`, `font-[300]`, `font-[400]`, `font-[500]`, `font-[600]`, `font-[700]`, `font-[800]`, `font-[900]` | `{ weight: 100 }`, `{ weight: 200 }` etc. | v4 spells weights through `--font-weight-*`, so a NUMBER brackets. |
|
|
3411
3412
|
| **Alias** | (Sugar) | `font-bold` | `{ weight: 'bold' }` | Sugar for `weight`. |
|
|
3412
3413
|
| **Arbitrary** | `font-weight: 550` | `font-[550]` | `{ weight: 550 }` | |
|
|
3413
3414
|
| **CSS Variable** | `font-weight: var(--w)` | `font-(weight:--w)` | `{ weight: '--w' }` | **Sugar**: Auto-detects `--`. Type hint disambiguates from family. |
|
|
@@ -3655,10 +3656,13 @@ sz={{ scale: shrunk ? 75 : 100 }} // inline prop ternary — both lit
|
|
|
3655
3656
|
- Use `sz={var}` when no override needed (simpler)
|
|
3656
3657
|
- Use `sz={{ ...var, key: val }}` only when overriding/adding
|
|
3657
3658
|
- Variables in array elements, ternary branches, and chained initializers all resolve at build time
|
|
3659
|
+
- `build.importedStaticSz` (default TRUE) compiles a static sz object imported from another module — v1 covers a direct `sz={binding}` from a NAMED import of an `export const` object literal, written relative or through a project alias (read from the bundler's `resolve.alias` and tsconfig `compilerOptions.paths`); barrels, package specifiers, absolute specifiers, namespace/default imports and nested positions keep the runtime fallback and report it; every lane defaults to on so nothing needs wiring, and turning it OFF must be done in all of them — `csszyxTurbopack({}, { importedStaticSz: false })` PLUS `csszyx next prebuild --no-imported-static-sz` PLUS `csszyx next watch --no-imported-static-sz` for dev — because a mismatch fails the production build on the config hash
|
|
3660
|
+
- A shared sz object is a build-time value: the compiler reads it where it is DECLARED. Reassigning the binding (`let s = {...}; s = {...}`) is detected and falls back to the runtime; a property write (`s.p = 8`) is NOT detected and the class still describes the declared value. Declare once, never write to it — vary with spread overrides or `szv()`
|
|
3658
3661
|
- `sz={{ key: cond ? a : b }}` — both literal branches compile to static classes; a runtime branch uses a CSS variable. An opposite `undefined`, `null`, `false`, or `''` branch omits the utility and variable value (`0` remains valid)
|
|
3662
|
+
- Keys whose value is a boolean — `border` and every side, `ring`, `outline`, `shadow`, `truncate` — never use a CSS variable: a runtime value on them compiles to `__szBoolClass(value, key, "border-b")`, which renders the bare class for `true`, nothing for `false`/`null`/`undefined`/`''`, and warns for any other type instead of emitting a utility that would style a different property. React discards booleans in `style`, so the variable form could never have applied
|
|
3659
3663
|
- When runtime `sz` values emit inline CSS variables beside one direct object-literal JSX spread, or one conditional whose branches are object literals, the compiler injects the variables into every spread branch's `style` so both authored and generated values survive. Keep unresolved or multiple spreads' style explicit; csszyx warns when it cannot prove a single-evaluation merge is safe
|
|
3660
3664
|
- `sz={{ ...(cond ? a : b), static: val }}` — conditional spread hoist: compiler resolves both branches at build time
|
|
3661
|
-
- Imported variables / function call results fall back to `_sz()` runtime —
|
|
3665
|
+
- Imported variables / function call results fall back to `_sz()` runtime — a build-time compiler warning explains the fallback reason and suggests `szv()` or `dynamic()`. An expression rooted in an IMPORT collects no classes at all, so that warning is kept in production builds and survives `quiet: 'nudges'`; every other unresolved shape — including a forwarded `sz` prop, whose classes the caller contributes — stays dev-only advice
|
|
3662
3666
|
|
|
3663
3667
|
Full guide: `/docs/reusing-styles`
|
|
3664
3668
|
|
|
@@ -3721,13 +3725,10 @@ unset"; same-file `const` references and `const` object spreads are followed.
|
|
|
3721
3725
|
For styles from JSON / API / CMS / form renderer schemas:
|
|
3722
3726
|
|
|
3723
3727
|
```tsx
|
|
3724
|
-
import { dynamic
|
|
3728
|
+
import { dynamic } from "@csszyx/dynamic";
|
|
3725
3729
|
// or: import { dynamic } from 'csszyx/dynamic';
|
|
3726
3730
|
|
|
3727
|
-
//
|
|
3728
|
-
await preloadManifest("/csszyx-manifest.json");
|
|
3729
|
-
|
|
3730
|
-
// Apply runtime sz object — CSS injected only for missing classes
|
|
3731
|
+
// Apply runtime sz object — CSS is injected for classes not already built
|
|
3731
3732
|
const cls = dynamic({
|
|
3732
3733
|
p: 4,
|
|
3733
3734
|
bg: "white",
|
|
@@ -3736,6 +3737,25 @@ const cls = dynamic({
|
|
|
3736
3737
|
});
|
|
3737
3738
|
```
|
|
3738
3739
|
|
|
3740
|
+
**The manifest is opt-in.** `csszyx-manifest.json` lets `dynamic()` skip injecting
|
|
3741
|
+
rules the built CSS already has, but it carries the WHOLE class census to answer
|
|
3742
|
+
questions about the few classes `dynamic()` renders — measured on a 668-class
|
|
3743
|
+
census it costs ~2 kB gz to spare a few hundred bytes of injection, and only wins
|
|
3744
|
+
once most of the app is styled at runtime. `build.emitManifest` defaults to
|
|
3745
|
+
`false`; a missing manifest is not an error, `dynamic()` just injects its own
|
|
3746
|
+
rules and the styles are identical.
|
|
3747
|
+
|
|
3748
|
+
If you enable it, preload it — `dynamic()` is synchronous and the fetch is not,
|
|
3749
|
+
so an unawaited manifest arrives after the first paint has already injected
|
|
3750
|
+
everything and the build pays both costs:
|
|
3751
|
+
|
|
3752
|
+
```tsx
|
|
3753
|
+
import { dynamicReport, preloadManifest } from "@csszyx/dynamic";
|
|
3754
|
+
|
|
3755
|
+
await preloadManifest(); // before the first render
|
|
3756
|
+
console.log(dynamicReport().summary); // development: did it pay off here?
|
|
3757
|
+
```
|
|
3758
|
+
|
|
3739
3759
|
**Build-time extraction (Layer-1 prescan):** When `dynamic()` receives a static literal or
|
|
3740
3760
|
module-level const, the compiler extracts classes at build time → Tailwind generates CSS
|
|
3741
3761
|
ahead of time → no runtime injection needed. Works in Astro SSR without `client:*`.
|
|
@@ -3886,15 +3906,17 @@ csszyx has two worlds; pick by "is the value set finite and known at build time?
|
|
|
3886
3906
|
- **Runtime (`dynamic()`):** unbounded values (CMS color, user `#hex`). CSS is
|
|
3887
3907
|
generated + injected in the browser via insertRule. Escape hatch only.
|
|
3888
3908
|
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3909
|
+
Engine (BUILD-TIME parse of JSX source only): ONE engine, two artifacts —
|
|
3910
|
+
`rust` (native addon, default) and `wasm` (the same engine compiled to
|
|
3911
|
+
WebAssembly, shipped inside `@csszyx/core`). Identical output by construction
|
|
3912
|
+
(same source, gate-pinned) — the artifact only affects build speed. The native
|
|
3913
|
+
binary ships as per-platform optional deps (`@csszyx/core-*`); if it's missing
|
|
3914
|
+
(unsupported arch, omitted optional deps, cross-platform frozen lockfile) the
|
|
3915
|
+
DEFAULT `rust` auto-degrades to `wasm` with a one-time warning — builds still
|
|
3916
|
+
succeed with identical classes. An EXPLICIT `parser:'rust'` (config or
|
|
3917
|
+
`CSSZYX_PARSER=rust`) hard-fails instead. Don't tell users a missing native
|
|
3918
|
+
binary breaks csszyx or changes classes; tell them to ignore the warning or set
|
|
3919
|
+
`build.parser:'wasm'`. The former `'oxc'`/`'babel'` values were removed. The RUNTIME
|
|
3898
3920
|
has no parser: `_sz`/`szr`/`szv`/`splitBox` are plain JS; `dynamic()` lowers an sz
|
|
3899
3921
|
OBJECT via `@csszyx/compiler/browser` (pure JS, no JSX parsing).
|
|
3900
3922
|
|
|
@@ -4071,8 +4093,19 @@ ignored unless a path points into them:
|
|
|
4071
4093
|
A non-`/packages/` lib INSIDE the build root needs no config (compiled + scanned
|
|
4072
4094
|
automatically); `compileSources` is for `/packages/` or sources OUTSIDE the root.
|
|
4073
4095
|
|
|
4074
|
-
|
|
4075
|
-
|
|
4096
|
+
The option used to be `compilePackages`, which took package NAMES. An old config
|
|
4097
|
+
still passing that name is never read, so every effect below silently does not
|
|
4098
|
+
happen. csszyx now warns on any plugin option it does not recognize, naming the
|
|
4099
|
+
replacement.
|
|
4100
|
+
|
|
4101
|
+
A `/packages/` file using csszyx that is not opted in is skipped (no CSS); csszyx
|
|
4102
|
+
warns at build end and lists those files.
|
|
4103
|
+
|
|
4104
|
+
Opting in is also what makes the cross-module `szv` precompile work inside the
|
|
4105
|
+
package: the prescan is what records a module's exported factories, so a skipped
|
|
4106
|
+
module keeps them out of the registry and every importer — its own siblings
|
|
4107
|
+
included — falls back to the runtime path. That case warns in production builds
|
|
4108
|
+
too; a skip affecting only one file's own classes stays development-only.
|
|
4076
4109
|
|
|
4077
4110
|
## Theme Auto-Scan (Custom Tokens → TypeScript Types)
|
|
4078
4111
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@csszyx/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Model Context Protocol (MCP) server for csszyx — enables AI agents to understand and generate sz props",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
32
32
|
"zod": "^4.4.3",
|
|
33
|
-
"@csszyx/cli": "0.
|
|
34
|
-
"@csszyx/
|
|
35
|
-
"@csszyx/
|
|
33
|
+
"@csszyx/cli": "0.14.0",
|
|
34
|
+
"@csszyx/unplugin": "0.14.0",
|
|
35
|
+
"@csszyx/compiler": "0.14.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^22.20.1",
|