vibe-design-system 2.8.42 → 2.8.44
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
|
@@ -449,6 +449,9 @@ function extractBrandAssets() {
|
|
|
449
449
|
const assets = [];
|
|
450
450
|
const dirs = [
|
|
451
451
|
path.join(PROJECT_ROOT, "public"),
|
|
452
|
+
path.join(PROJECT_ROOT, "client", "public"),
|
|
453
|
+
path.join(PROJECT_ROOT, "frontend", "public"),
|
|
454
|
+
path.join(PROJECT_ROOT, "web", "public"),
|
|
452
455
|
path.join(PROJECT_ROOT, "src", "assets"),
|
|
453
456
|
path.join(PROJECT_ROOT, "src", "images"),
|
|
454
457
|
path.join(PROJECT_ROOT, "client", "src", "assets"),
|
|
@@ -466,6 +469,38 @@ function extractBrandAssets() {
|
|
|
466
469
|
assets.push({ path: filePath, name: baseName, type });
|
|
467
470
|
}
|
|
468
471
|
}
|
|
472
|
+
// Detect inline/component-based logos (SVG in JSX, brand components, text-gradient brand names)
|
|
473
|
+
const logoKeywordRe = /(?:logo|brand|emblem)\s*[=:]/i;
|
|
474
|
+
const svgLogoRe = /<svg[^>]*(?:logo|brand|emblem)/i;
|
|
475
|
+
const brandTextRe = /text-gradient[^"]*"[^>]*>([^<]+)</;
|
|
476
|
+
const headerSidebarRe = /(?:header|sidebar|navbar|nav|topbar|layout)/i;
|
|
477
|
+
const allTsx = getAllTsxJsxInDir(SRC_DIR);
|
|
478
|
+
for (const rel of allTsx) {
|
|
479
|
+
try {
|
|
480
|
+
const content = fs.readFileSync(path.join(SRC_DIR, rel), "utf-8");
|
|
481
|
+
let brandName = null;
|
|
482
|
+
// Direct logo/brand keyword in code
|
|
483
|
+
if (logoKeywordRe.test(content) || svgLogoRe.test(content)) {
|
|
484
|
+
const m = content.match(brandTextRe);
|
|
485
|
+
brandName = m ? m[1].trim() : path.basename(rel, path.extname(rel));
|
|
486
|
+
}
|
|
487
|
+
// Brand name via text-gradient in header/sidebar/navbar components
|
|
488
|
+
if (!brandName && headerSidebarRe.test(rel)) {
|
|
489
|
+
const m = content.match(brandTextRe);
|
|
490
|
+
if (m) brandName = m[1].trim();
|
|
491
|
+
}
|
|
492
|
+
if (brandName && brandName.length > 1 && brandName.length < 30) {
|
|
493
|
+
assets.push({
|
|
494
|
+
type: "logo",
|
|
495
|
+
path: path.relative(PROJECT_ROOT, path.join(SRC_DIR, rel)).replace(/\\/g, "/"),
|
|
496
|
+
name: brandName,
|
|
497
|
+
inline: true,
|
|
498
|
+
description: `Inline logo in ${rel}`,
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
} catch (_) {}
|
|
502
|
+
}
|
|
503
|
+
|
|
469
504
|
// Fallback: if no branded assets found by keyword, include all image files from SRC_DIR/assets
|
|
470
505
|
if (assets.length === 0 || assets.every((r) => r.type === "asset")) {
|
|
471
506
|
const assetsDir = path.join(SRC_DIR, "assets");
|
|
@@ -1108,6 +1108,7 @@ function buildSpecialStories(componentName, variants) {
|
|
|
1108
1108
|
|
|
1109
1109
|
function buildRecipeStoryContent(comp, componentName, importPath, title, source, exportStyle, recipe, defaultArgLines = [], lucideImports = [], iconPropNames = [], needReact = false) {
|
|
1110
1110
|
const lines = [];
|
|
1111
|
+
lines.push(`// @vds-regenerate — VDS auto-generated. Remove this line to prevent overwrite.`);
|
|
1111
1112
|
lines.push(`import type { Meta, StoryObj } from "@storybook/react";`);
|
|
1112
1113
|
if (needReact) {
|
|
1113
1114
|
lines.push(`import React from "react";`);
|
|
@@ -1387,6 +1388,7 @@ function buildStoryFileContent(comp) {
|
|
|
1387
1388
|
}
|
|
1388
1389
|
|
|
1389
1390
|
const lines = [];
|
|
1391
|
+
lines.push(`// @vds-regenerate — VDS auto-generated. Remove this line to prevent overwrite.`);
|
|
1390
1392
|
lines.push(`import type { Meta, StoryObj } from "@storybook/react";`);
|
|
1391
1393
|
lines.push(`import React from "react";`);
|
|
1392
1394
|
if (lucideImports.length > 0) {
|
|
@@ -3057,6 +3059,17 @@ function main() {
|
|
|
3057
3059
|
const requiredCount = Array.isArray(comp.props) ? comp.props.filter((p) => p.required === true).length : 0;
|
|
3058
3060
|
if (requiredCount > 3) continue;
|
|
3059
3061
|
|
|
3062
|
+
// Never overwrite manually edited story files
|
|
3063
|
+
if (fs.existsSync(storyPath)) {
|
|
3064
|
+
try {
|
|
3065
|
+
const existing = fs.readFileSync(storyPath, "utf-8");
|
|
3066
|
+
// If file was manually edited (different from VDS auto-gen pattern), skip it
|
|
3067
|
+
if (!existing.includes("@vds-regenerate")) {
|
|
3068
|
+
continue;
|
|
3069
|
+
}
|
|
3070
|
+
} catch (_) {}
|
|
3071
|
+
}
|
|
3072
|
+
|
|
3060
3073
|
const content = buildStoryFileContent(comp);
|
|
3061
3074
|
if (content == null) continue;
|
|
3062
3075
|
fs.writeFileSync(storyPath, content, "utf-8");
|