@csszyx/mcp-server 0.14.1 → 0.14.2

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/dist/index.mjs CHANGED
@@ -201,11 +201,12 @@ Without it: \`Property 'sz' does not exist on type 'DetailedHTMLProps<...>'\`.
201
201
  - **"No prebuilt native binary" warning / \`native engine unavailable\`**: the
202
202
  default \`rust\` parser's native binary is missing (unsupported arch, optional
203
203
  deps omitted, or a cross-platform frozen lockfile). It is NOT broken and classes
204
- are UNCHANGED \u2014 all three engines (rust/oxc/babel) emit identical output
205
- (parity-gated). If you only use the default, csszyx auto-falls back to \`oxc\` and
206
- the build succeeds; ignore the warning or set \`build.parser: 'oxc'\` to silence
207
- it. Only an EXPLICIT \`parser:'rust'\` hard-fails. Do NOT tell the user to debug
208
- their styles over this.
204
+ are UNCHANGED \u2014 there is ONE engine shipped in two builds, native and wasm, and
205
+ they are parity-gated to emit identical output. csszyx auto-falls back to the
206
+ wasm build and the build succeeds; only parse speed differs. Ignore the warning,
207
+ or install the matching \`@csszyx/core-<platform>\` package, or set
208
+ \`build.parser\` explicitly to silence it. Only an EXPLICIT \`parser:'rust'\`
209
+ hard-fails. Do NOT tell the user to debug their styles over this.
209
210
  - **A class generates no CSS**: it wasn't safelisted. The file must contain a
210
211
  statically analyzable \`sz=\` or \`szv(\` (the prescan qualifies files by those
211
212
  tokens). Arbitrary values (\`m:'20px'\`\u2192\`m-[20px]\`) and large numbers
package/llms-full.txt CHANGED
@@ -681,16 +681,17 @@ Strategy for static analysis vs runtime generation.
681
681
 
682
682
  **Core Decision**: `CSSzyx` uses **AST Parsing**, not Regex Scanning. This allows for smarter static extraction and shake-tree logic.
683
683
 
684
- | Concept | Tailwind Scanner (Regex) | `sz` Compiler (AST) | Note |
685
- | :---------------------------- | :----------------------- | :----------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
686
- | **String Interpolation** | ❌ Fails `bg-${color}` | ✅ **Runtime Support** | Compiler marks as dynamic, handled at runtime via variable injection. |
687
- | **Conditionals** | ❌ Fails logic | ✅ **Static Extraction** | `{ bg: active ? 'blue' : 'gray' }` and `{ scale: shrunk ? 75 : 100 }` → both branches compiled to static Tailwind classes at build time. A runtime branch uses a CSS variable; an opposite `undefined`, `null`, `false`, or empty-string branch omits both the utility and variable value. Numeric `0` remains valid. |
688
- | **Variable reference** | ❌ Not applicable | ✅ **Build time** | `sz={myVar}` — pass variable directly when no override needed. Compiler resolves the binding to its object literal initializer (incl. `as const`, `satisfies`, explicit type annotation). |
689
- | **Object Spread** | ❌ Fails spread | ✅ **Static Analysis** | `sz={{ ...baseProps, key: val }}` — use spread only when overriding/adding; last key wins. Resolved at build time for local literals. Multiple/nested spreads supported. Imported vars fall back to `_sz()` — no crash. When runtime `sz` emits CSS variables beside one direct object-literal JSX prop spread, or one conditional with object-literal branches, generated variables merge into every branch's `style`; unresolved/multiple JSX spreads retain a collision diagnostic. |
690
- | **Array variable items** | ❌ Not applicable | ✅ **Build time** | `sz={[varA, varB]}` and `sz={[varA, cond && varB]}` — LATER WINS composition. All-static-object arrays deep-merge at build (later leaf wins per key path, sibling keys survive) into one className; arrays with strings/conditions/dynamic elements emit `_szcn(...)` — a compiler-injected helper (`_` = generated code, never hand-authored; the unmemoized twin of `szcn`) applying the same later-wins rule per property group at runtime. Finite ternary elements and finite conditional object properties compile to conditional class strings; only truly dynamic elements (e.g. a forwarded `szsc` slot) pass through `_szPart` (string passthrough / sz-object compile). |
691
- | **Ternary variable branches** | ❌ Not applicable | ✅ **Build time** | `sz={cond ? varA : varB}` — both branches compiled to static strings when variables are local literals. |
692
- | **Chained variables** | ❌ Not applicable | ✅ **Build time** | `const b = { ...a, key: val }; <div sz={b} />` compiler resolves the chain recursively. |
693
- | **Safelist** | Required for dynamic | **Not Required** | Auto-detected for static logic; Auto-injected for runtime values. |
684
+ | Concept | Tailwind Scanner (Regex) | `sz` Compiler (AST) | Note |
685
+ | :---------------------------- | :----------------------- | :----------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
686
+ | **String Interpolation** | ❌ Fails `bg-${color}` | ✅ **Runtime Support** | Compiler marks as dynamic, handled at runtime via variable injection. |
687
+ | **Conditionals** | ❌ Fails logic | ✅ **Static Extraction** | `{ bg: active ? 'blue' : 'gray' }` and `{ scale: shrunk ? 75 : 100 }` → both branches compiled to static Tailwind classes at build time. A runtime branch uses a CSS variable; an opposite `undefined`, `null`, `false`, or empty-string branch omits both the utility and variable value. Numeric `0` remains valid. A runtime value on a KEYWORD-valued key — `display`, `position`, `items`, `textAlign`, `borderStyle`, `bgSize` and their neighbours — takes no CSS variable at all: Tailwind's `<prefix>-(--var)` form for these either matches no utility or resolves to a different CSS property, so the class and the variable are dropped and the build reports it. Use `szv()` to name the values. Static values on the same keys are unaffected, as is the runtime lowering. |
688
+ | **Variable reference** | ❌ Not applicable | ✅ **Build time** | `sz={myVar}` — pass variable directly when no override needed. Compiler resolves the binding to its object literal initializer (incl. `as const`, `satisfies`, explicit type annotation). |
689
+ | **Object Spread** | ❌ Fails spread | ✅ **Static Analysis** | `sz={{ ...baseProps, key: val }}` — use spread only when overriding/adding; last key wins. Resolved at build time for local literals. Multiple/nested spreads supported. Imported vars fall back to `_sz()` — no crash. When runtime `sz` emits CSS variables beside one direct object-literal JSX prop spread, or one conditional with object-literal branches, generated variables merge into every branch's `style`; unresolved/multiple JSX spreads retain a collision diagnostic. |
690
+ | **Array variable items** | ❌ Not applicable | ✅ **Build time** | `sz={[varA, varB]}` and `sz={[varA, cond && varB]}` — LATER WINS composition. All-static-object arrays deep-merge at build (later leaf wins per key path, sibling keys survive) into one className; arrays with strings/conditions/dynamic elements emit `_szcn(...)` — a compiler-injected helper (`_` = generated code, never hand-authored; the unmemoized twin of `szcn`) applying the same later-wins rule per property group at runtime. Finite ternary elements and finite conditional object properties compile to conditional class strings; only truly dynamic elements (e.g. a forwarded `szsc` slot) pass through `_szPart` (string passthrough / sz-object compile). |
691
+ | **Ternary variable branches** | ❌ Not applicable | ✅ **Build time** | `sz={cond ? varA : varB}` — both branches compiled to static strings when variables are local literals. A branch spelled `undefined`, `null`, `false`, or `{}` is the EMPTY style and compiles to no classes, so `sz={cond ? varA : undefined}` folds just like `: {}`. A chain — `a ? x : b ? y : z` — compiles too, up to 8 tests; the emitted expression keeps the same nesting, so each test is only reached when every test before it was falsy. Past 8 the attribute keeps the runtime path. |
692
+ | **Guarded style (`&&`)** | ❌ Not applicable | ✅ **Build time** | `sz={cond && varA}` compiles to the ternary it already is, because a falsy left operand is the empty style. `sz={a \|\| varA}` does NOT compile: `\|\|` yields its LEFT operand when the test passes, and that value can be a style the fold would drop. |
693
+ | **Chained variables** | Not applicable | **Build time** | `const b = { ...a, key: val }; <div sz={b} />` — compiler resolves the chain recursively. |
694
+ | **Safelist** | Required for dynamic | **Not Required** | Auto-detected for static logic; Auto-injected for runtime values. |
694
695
 
695
696
  **Performance Rule**: Prefer **Static Strings** in `sz` objects.
696
697
 
@@ -1082,6 +1083,22 @@ Controlling the style of an element's borders.
1082
1083
  | **Hidden** | `border-style: hidden` | `border-hidden` | `{ borderStyle: 'hidden' }` | |
1083
1084
  | **None** | `border-style: none` | `border-none` | `{ borderStyle: 'none' }` | |
1084
1085
 
1086
+ The style applies to **every side**. Tailwind has no per-side border-style
1087
+ utility, so a style keyword on a side key (`{ borderB: 'none' }`) generates no
1088
+ CSS — csszyx drops the class and reports it. Use `borderStyle` for the style, and
1089
+ a number on the side key for its width:
1090
+
1091
+ ```jsx
1092
+ // ❌ border-b-none — Tailwind serves no rule, so the border stays
1093
+ <div sz={{ borderB: 'none' }} />
1094
+
1095
+ // ✅ remove the style on every side
1096
+ <div sz={{ borderStyle: 'none' }} />
1097
+
1098
+ // ✅ or take the bottom border to zero width
1099
+ <div sz={{ borderB: 0 }} />
1100
+ ```
1101
+
1085
1102
  ## Divide Width
1086
1103
 
1087
1104
  Utilities for controlling the border width between elements.
@@ -3675,7 +3692,7 @@ sz={{ scale: shrunk ? 75 : 100 }} // inline prop ternary — both lit
3675
3692
  - Use `sz={var}` when no override needed (simpler)
3676
3693
  - Use `sz={{ ...var, key: val }}` only when overriding/adding
3677
3694
  - Variables in array elements, ternary branches, and chained initializers all resolve at build time
3678
- - `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
3695
+ - `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`); a named re-export through a barrel is followed to the module that declares the value, up to eight modules deep; `export *`, package specifiers, absolute specifiers 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
3679
3696
  - 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()`
3680
3697
  - `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)
3681
3698
  - 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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/mcp-server",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
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.14.1",
34
- "@csszyx/compiler": "0.14.1",
35
- "@csszyx/unplugin": "0.14.1"
33
+ "@csszyx/cli": "0.14.2",
34
+ "@csszyx/unplugin": "0.14.2",
35
+ "@csszyx/compiler": "0.14.2"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "^22.20.1",