@csszyx/mcp-server 0.11.6 → 0.11.7
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 +27 -26
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -577,36 +577,37 @@ function handleTheme(input) {
|
|
|
577
577
|
const validateSchema = z.object({
|
|
578
578
|
sz: z.record(z.any()).describe('The sz prop object to validate. Example: { padding: 4, bg: "blue-500" }')
|
|
579
579
|
});
|
|
580
|
+
function validateEntry(key, value) {
|
|
581
|
+
const suggestion = SUGGESTION_MAP[key];
|
|
582
|
+
if (suggestion) {
|
|
583
|
+
return {
|
|
584
|
+
key,
|
|
585
|
+
message: `Unknown prop '${key}'. This is a CSS property name, not an sz key.`,
|
|
586
|
+
suggestion: `Use '${suggestion}' instead. Example: { ${suggestion.split(/[\s/(]/)[0]}: ${JSON.stringify(value)} }`
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
const removed = REMOVED_BOOLEAN_SUGAR[key];
|
|
590
|
+
if (removed && value === true) {
|
|
591
|
+
return {
|
|
592
|
+
key,
|
|
593
|
+
message: `'${key}: true' boolean sugar was removed; it emits no class.`,
|
|
594
|
+
suggestion: `Use { ${removed.key}: ${JSON.stringify(removed.value)} } instead.`
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
const isSpecial = ["css", "@container", "*"].includes(key) || key.startsWith("@") || key.startsWith("[");
|
|
598
|
+
const isKnown = key in PROPERTY_MAP || BOOLEAN_SHORTHANDS.has(key) || KNOWN_VARIANTS.has(key) || isSpecial;
|
|
599
|
+
return isKnown ? void 0 : {
|
|
600
|
+
key,
|
|
601
|
+
message: `Unknown prop '${key}'. Not a valid sz key, variant, or special prop.`
|
|
602
|
+
};
|
|
603
|
+
}
|
|
580
604
|
function handleValidate(input) {
|
|
581
605
|
const errors = [];
|
|
582
606
|
const warnings = [];
|
|
583
607
|
for (const key of Object.keys(input.sz)) {
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
message: `Unknown prop '${key}'. This is a CSS property name, not an sz key.`,
|
|
588
|
-
suggestion: `Use '${SUGGESTION_MAP[key]}' instead. Example: { ${SUGGESTION_MAP[key].split(/[\s/(]/)[0]}: ${JSON.stringify(input.sz[key])} }`
|
|
589
|
-
});
|
|
590
|
-
continue;
|
|
591
|
-
}
|
|
592
|
-
const removed = REMOVED_BOOLEAN_SUGAR[key];
|
|
593
|
-
if (removed && input.sz[key] === true) {
|
|
594
|
-
errors.push({
|
|
595
|
-
key,
|
|
596
|
-
message: `'${key}: true' boolean sugar was removed; it emits no class.`,
|
|
597
|
-
suggestion: `Use { ${removed.key}: ${JSON.stringify(removed.value)} } instead.`
|
|
598
|
-
});
|
|
599
|
-
continue;
|
|
600
|
-
}
|
|
601
|
-
const isProperty = key in PROPERTY_MAP;
|
|
602
|
-
const isBoolean = BOOLEAN_SHORTHANDS.has(key);
|
|
603
|
-
const isVariant = KNOWN_VARIANTS.has(key);
|
|
604
|
-
const isSpecial = ["css", "@container", "*"].includes(key) || key.startsWith("@") || key.startsWith("[");
|
|
605
|
-
if (!isProperty && !isBoolean && !isVariant && !isSpecial) {
|
|
606
|
-
errors.push({
|
|
607
|
-
key,
|
|
608
|
-
message: `Unknown prop '${key}'. Not a valid sz key, variant, or special prop.`
|
|
609
|
-
});
|
|
608
|
+
const error = validateEntry(key, input.sz[key]);
|
|
609
|
+
if (error) {
|
|
610
|
+
errors.push(error);
|
|
610
611
|
}
|
|
611
612
|
}
|
|
612
613
|
let transformResult = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@csszyx/mcp-server",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.7",
|
|
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": "^3.23.8",
|
|
33
|
-
"@csszyx/compiler": "0.11.
|
|
34
|
-
"@csszyx/
|
|
35
|
-
"@csszyx/
|
|
33
|
+
"@csszyx/compiler": "0.11.7",
|
|
34
|
+
"@csszyx/unplugin": "0.11.7",
|
|
35
|
+
"@csszyx/cli": "0.11.7"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"typescript": "^6.0.3",
|