@ggui-ai/ui-gen 0.11.0 → 0.13.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/adapters/generation-dispatch.js +180 -18
- package/dist/adapters/generation-dispatch.js.map +1 -1
- package/dist/advanced/index.d.ts +1 -1
- package/dist/advanced/index.js +180 -18
- package/dist/advanced/index.js.map +1 -1
- package/dist/blueprint-validator.js +146 -0
- package/dist/blueprint-validator.js.map +1 -1
- package/dist/boilerplate.js +7 -7
- package/dist/boilerplate.js.map +1 -1
- package/dist/check/index.js +27 -11
- package/dist/check/index.js.map +1 -1
- package/dist/harness/check/runtime-render/index.d.ts +1 -1
- package/dist/harness/check/runtime-render/index.js +146 -0
- package/dist/harness/check/runtime-render/index.js.map +1 -1
- package/dist/harness/check/runtime-render/render-check-worker.js +126 -0
- package/dist/harness/check/runtime-render/render-check-worker.js.map +1 -1
- package/dist/harness/index.js +7 -7
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/runtime.js +7 -7
- package/dist/harness/runtime.js.map +1 -1
- package/dist/harness/types-public.js +7 -7
- package/dist/harness/types-public.js.map +1 -1
- package/dist/index.js +180 -18
- package/dist/index.js.map +1 -1
- package/dist/provider-adapter-contract.js +1161 -387
- package/dist/provider-adapter-contract.js.map +1 -1
- package/dist/{render-check-BZoIE8-u.d.ts → render-check-WfOVO9kU.d.ts} +1 -1
- package/package.json +13 -13
- package/src/boilerplate/system-prompt.ts +7 -7
- package/src/check/run-tier0.ts +35 -16
- package/src/harness/check/runtime-render/adapter.ts +28 -0
- package/src/harness/check/runtime-render/render-check.ts +224 -1
package/dist/check/index.js
CHANGED
|
@@ -1130,17 +1130,33 @@ ${errorDetail}`,
|
|
|
1130
1130
|
}
|
|
1131
1131
|
}
|
|
1132
1132
|
const hexMatch = line.match(/#[0-9a-fA-F]{3,8}\b/);
|
|
1133
|
-
if (hexMatch && !
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1133
|
+
if (hexMatch && !assetEscapedLines.has(lineNum)) {
|
|
1134
|
+
const fallbackVarMatch = line.match(
|
|
1135
|
+
/var\((--ggui-[a-zA-Z0-9-]+)\s*,[^)]*#[0-9a-fA-F]{3,8}/
|
|
1136
|
+
);
|
|
1137
|
+
if (fallbackVarMatch) {
|
|
1138
|
+
issues.push({
|
|
1139
|
+
tier: 0,
|
|
1140
|
+
result: "fail",
|
|
1141
|
+
category: "tokens",
|
|
1142
|
+
subcategory: "token-fallback",
|
|
1143
|
+
severity: "critical",
|
|
1144
|
+
description: `Literal fallback "${hexMatch[0]}" inside a token reference \u2014 the runtime injects every token, and the fallback paints the wrong brand exactly when the theme matters most.`,
|
|
1145
|
+
fix: `Drop the fallback: write var(${fallbackVarMatch[1]}) bare. If the token might not exist, that is a vocabulary problem to fix by choosing a token from the design-system docs, never by a literal.`,
|
|
1146
|
+
line: lineNum
|
|
1147
|
+
});
|
|
1148
|
+
} else if (!line.includes("// fallback")) {
|
|
1149
|
+
issues.push({
|
|
1150
|
+
tier: 0,
|
|
1151
|
+
result: "fail",
|
|
1152
|
+
category: "tokens",
|
|
1153
|
+
subcategory: "hex-color",
|
|
1154
|
+
severity: "critical",
|
|
1155
|
+
description: `Hardcoded color "${hexMatch[0]}" breaks theme switching \u2014 use design tokens.`,
|
|
1156
|
+
fix: `Replace with a primitive variant (Button variant="primary"|Badge variant="success"|...) OR a bare token reference like var(--ggui-color-primary-500) \u2014 never a literal fallback. Hardcoded colors mean the operator's theme has no effect on this surface.`,
|
|
1157
|
+
line: lineNum
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1144
1160
|
}
|
|
1145
1161
|
const colorFnMatch = line.match(/\b(rgba?|hsla?)\s*\(/);
|
|
1146
1162
|
if (colorFnMatch && !line.includes("var(--ggui-") && !line.includes("// fallback") && !line.includes("$value") && !assetEscapedLines.has(lineNum)) {
|