vibe-design-system 2.8.79 → 2.8.81
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/package.json
CHANGED
|
@@ -2207,6 +2207,21 @@ function extractVariantUsage(componentResults) {
|
|
|
2207
2207
|
}
|
|
2208
2208
|
}
|
|
2209
2209
|
|
|
2210
|
+
/**
|
|
2211
|
+
* Heuristic: detect complex page-level components that should not get individual stories.
|
|
2212
|
+
* Criteria: 500+ lines AND 4+ internal capitalized component definitions AND no cva()/forwardRef.
|
|
2213
|
+
* Examples: a 900-line MethodologyMap.tsx with 8 inline sub-components.
|
|
2214
|
+
*/
|
|
2215
|
+
function isComplexPageComponent(content) {
|
|
2216
|
+
const lines = content.split("\n").length;
|
|
2217
|
+
if (lines < 500) return false;
|
|
2218
|
+
const internalComps = (content.match(/\bconst\s+[A-Z][A-Za-z]+\s*[:=]\s*\(/g) || []).length;
|
|
2219
|
+
if (internalComps < 4) return false;
|
|
2220
|
+
// Don't flag UI primitives that use cva() or forwardRef — those are styled components
|
|
2221
|
+
if (content.includes("cva(") || content.includes("forwardRef")) return false;
|
|
2222
|
+
return true;
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2210
2225
|
function scan() {
|
|
2211
2226
|
const relativeFiles = COMPONENTS_DIR ? getAllComponentFiles(COMPONENTS_DIR) : [];
|
|
2212
2227
|
if (!COMPONENTS_DIR) {
|
|
@@ -2231,7 +2246,8 @@ function scan() {
|
|
|
2231
2246
|
description = "";
|
|
2232
2247
|
}
|
|
2233
2248
|
const tokens = extractTailwindTokens(content);
|
|
2234
|
-
|
|
2249
|
+
const isPageComponent = isComplexPageComponent(content);
|
|
2250
|
+
results.push({ file: rel, name, group, category, description, tokens, ...(isPageComponent ? { isPageComponent: true } : {}) });
|
|
2235
2251
|
}
|
|
2236
2252
|
if (PAGES_DIR && fs.existsSync(PAGES_DIR)) {
|
|
2237
2253
|
const pageFiles = getAllComponentFiles(PAGES_DIR);
|
|
@@ -2202,7 +2202,8 @@ function buildStoryFileContent(comp) {
|
|
|
2202
2202
|
// Strip opacity modifier (e.g. "muted/20" → "muted") as a fallback
|
|
2203
2203
|
const baseKey = key ? key.replace(/\/[\d.]+$/, "") : null;
|
|
2204
2204
|
const entry = key ? (foundColors[key] || (baseKey !== key ? foundColors[baseKey] : null)) : null;
|
|
2205
|
-
const
|
|
2205
|
+
const isValidCssColor = (v) => /^#[0-9a-fA-F]{3,8}$/.test(v) || /^(rgb|rgba|hsl|hsla|oklch|oklab|lch|lab|color)\s*\(/.test(v) || v === 'transparent';
|
|
2206
|
+
const hex = entry?.hex && isValidCssColor(entry.hex) ? entry.hex : null;
|
|
2206
2207
|
return { token, hex, label: baseKey || key };
|
|
2207
2208
|
});
|
|
2208
2209
|
|
|
@@ -4246,7 +4247,8 @@ function writeComponentInventoryStory(components, foundations) {
|
|
|
4246
4247
|
let key = m ? m[1] : null;
|
|
4247
4248
|
if (key) key = key.replace(/\/\d+$/, "");
|
|
4248
4249
|
const entry = key ? foundColors[key] : null;
|
|
4249
|
-
const
|
|
4250
|
+
const isValidCssColor = (v) => /^#[0-9a-fA-F]{3,8}$/.test(v) || /^(rgb|rgba|hsl|hsla|oklch|oklab|lch|lab|color)\s*\(/.test(v) || v === 'transparent';
|
|
4251
|
+
const hex = entry?.hex && isValidCssColor(entry.hex) ? entry.hex : null;
|
|
4250
4252
|
return { token, hex };
|
|
4251
4253
|
})
|
|
4252
4254
|
.filter(s => s.hex);
|
|
@@ -4906,6 +4908,11 @@ function main() {
|
|
|
4906
4908
|
const storyFileName = `${componentName}.stories.tsx`;
|
|
4907
4909
|
const storyPath = path.join(STORIES_DIR, storyFileName);
|
|
4908
4910
|
if (SKIP_LIST.includes(componentName)) continue;
|
|
4911
|
+
// Skip complex page-level components detected by scan (500+ lines, 4+ inline sub-components)
|
|
4912
|
+
if (comp.isPageComponent) {
|
|
4913
|
+
console.log(`[VDS] ${componentName} → skipped (complex page component — add to extraSkipList to suppress this message)`);
|
|
4914
|
+
continue;
|
|
4915
|
+
}
|
|
4909
4916
|
const requiredCount = Array.isArray(comp.props) ? comp.props.filter((p) => p.required === true).length : 0;
|
|
4910
4917
|
if (requiredCount > 3) {
|
|
4911
4918
|
console.log(`[VDS] ${componentName} → skipped (${requiredCount} required props — too complex to auto-generate)`);
|