@csszyx/mcp-server 0.13.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/dist/index.mjs +4 -3
- package/llms-full.txt +12 -9
- package/package.json +4 -4
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,
|
|
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';
|
|
@@ -350,7 +350,8 @@ const RUNTIME_HELPERS = [
|
|
|
350
350
|
["__szvPick1", "usesSzvPick1"],
|
|
351
351
|
["__szColorVar", "usesColorVar"],
|
|
352
352
|
["__szSpacingVar", "usesSpacingVar"],
|
|
353
|
-
["__szUnitVar", "usesUnitVar"]
|
|
353
|
+
["__szUnitVar", "usesUnitVar"],
|
|
354
|
+
["__szBoolClass", "usesBoolClass"]
|
|
354
355
|
];
|
|
355
356
|
function restoreEnv(name, value) {
|
|
356
357
|
if (value === void 0) {
|
|
@@ -370,7 +371,7 @@ function compileWithDiagnostics(source, filename) {
|
|
|
370
371
|
process.env.NODE_ENV = "development";
|
|
371
372
|
delete process.env.CSSZYX_QUIET_SZ_WARNINGS;
|
|
372
373
|
try {
|
|
373
|
-
return { result:
|
|
374
|
+
return { result: transformSource(source, filename), warnings };
|
|
374
375
|
} finally {
|
|
375
376
|
console.warn = originalWarn;
|
|
376
377
|
restoreEnv("NODE_ENV", originalNodeEnv);
|
package/llms-full.txt
CHANGED
|
@@ -3659,6 +3659,7 @@ sz={{ scale: shrunk ? 75 : 100 }} // inline prop ternary — both lit
|
|
|
3659
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
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()`
|
|
3661
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
|
|
3662
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
|
|
3663
3664
|
- `sz={{ ...(cond ? a : b), static: val }}` — conditional spread hoist: compiler resolves both branches at build time
|
|
3664
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
|
|
@@ -3905,15 +3906,17 @@ csszyx has two worlds; pick by "is the value set finite and known at build time?
|
|
|
3905
3906
|
- **Runtime (`dynamic()`):** unbounded values (CMS color, user `#hex`). CSS is
|
|
3906
3907
|
generated + injected in the browser via insertRule. Escape hatch only.
|
|
3907
3908
|
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
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
|
|
3917
3920
|
has no parser: `_sz`/`szr`/`szv`/`splitBox` are plain JS; `dynamic()` lowers an sz
|
|
3918
3921
|
OBJECT via `@csszyx/compiler/browser` (pure JS, no JSX parsing).
|
|
3919
3922
|
|
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/
|
|
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",
|