vibe-design-system 2.8.33 → 2.8.35

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/bin/init.js CHANGED
@@ -323,10 +323,10 @@ export default preview;
323
323
  // ADIM 1 — Bağımlılık kontrolü
324
324
  function needsStorybook(projectRoot, framework) {
325
325
  const pkg = readPackageJson(projectRoot);
326
- if (!pkg) return false;
327
- const dev = pkg.devDependencies || {};
326
+ if (!pkg) return true; // package.json yok → yükle (main guard zaten önce hata verecek)
327
+ const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
328
328
  const fwPkg = storybookFrameworkPackage(framework);
329
- return !(dev.storybook && dev[fwPkg]);
329
+ return !(allDeps.storybook && allDeps[fwPkg]);
330
330
  }
331
331
 
332
332
  // Storybook 8.6.x — aynı minor sürümde tutarak addon uyumluluk uyarısını önler
@@ -335,25 +335,25 @@ const STORYBOOK_VERSION = "8.6.17";
335
335
  function installStorybook(projectRoot, framework) {
336
336
  const fwPkg = storybookFrameworkPackage(framework);
337
337
  console.log(`📚 Storybook v8 (${fwPkg}) kuruluyor...`);
338
- const extraDeps = framework === "vite" ? ["@tailwindcss/vite"] : [];
339
338
  const r = spawnSync(
340
339
  "npm",
341
340
  [
342
341
  "install",
343
342
  "--save-dev",
344
343
  "--save-exact",
344
+ "--legacy-peer-deps",
345
345
  `storybook@${STORYBOOK_VERSION}`,
346
346
  `${fwPkg}@${STORYBOOK_VERSION}`,
347
347
  `@storybook/react@${STORYBOOK_VERSION}`,
348
348
  `@storybook/addon-essentials@${STORYBOOK_VERSION}`,
349
349
  `@storybook/addon-a11y@${STORYBOOK_VERSION}`,
350
350
  `@storybook/blocks@${STORYBOOK_VERSION}`,
351
- ...extraDeps,
352
351
  ],
353
- { cwd: projectRoot, stdio: "inherit", shell: false }
352
+ { cwd: projectRoot, stdio: "inherit", shell: true }
354
353
  );
355
354
  if (r.status !== 0) {
356
- console.warn("⚠️ npm install storybook tamamlanamadı.");
355
+ console.error(" npm install storybook başarısız oldu. VDS kurulumu durduruluyor.");
356
+ process.exit(1);
357
357
  }
358
358
  }
359
359
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-design-system",
3
- "version": "2.8.33",
3
+ "version": "2.8.35",
4
4
  "description": "Auto-generate design systems for vibe coding projects",
5
5
  "homepage": "https://vibedesign.tech",
6
6
  "repository": {
@@ -385,6 +385,10 @@ function classifyByPath(rel) {
385
385
  // ui/ → always "UI" (shadcn primitives)
386
386
  if (firstSegment === "ui") return { group: "UI", category: null };
387
387
 
388
+ // Root-level file (no subdirectory): firstSegment is a filename like "NavLink.tsx"
389
+ // Use "Components" instead of the filename as the group
390
+ if (firstSegment.includes(".")) return { group: "Components", category: null };
391
+
388
392
  // Convert kebab-case folder to Title Case (time-resources → Time Resources)
389
393
  const group = firstSegment
390
394
  .split("-")
@@ -974,7 +974,13 @@ function getExampleItemForArrayType(itemType) {
974
974
 
975
975
  function capitalize(str) {
976
976
  if (!str) return "";
977
- return str.charAt(0).toUpperCase() + str.slice(1);
977
+ // Convert to valid JS identifier: remove invalid chars, camelCase hyphens, prefix digit-starts
978
+ const safe = str
979
+ .replace(/[:\s]+([a-z])/g, (_, c) => c.toUpperCase()) // sm:full → smFull
980
+ .replace(/-+([a-zA-Z0-9])/g, (_, c) => c.toUpperCase()) // outline-ghost → outlineGhost
981
+ .replace(/[^a-zA-Z0-9_$]/g, "") // strip remaining invalid chars
982
+ .replace(/^([0-9])/, "_$1"); // 2xl → _2xl
983
+ return safe.charAt(0).toUpperCase() + safe.slice(1);
978
984
  }
979
985
 
980
986
  function detectExportStyle(source, componentName) {
@@ -1304,9 +1310,11 @@ function buildStoryFileContent(comp) {
1304
1310
  }
1305
1311
  if (!importPath.startsWith(".")) importPath = "./" + importPath;
1306
1312
 
1307
- // Normalize legacy "shadcn" group → "UI", everything else kept as-is
1313
+ // Normalize legacy "shadcn" group → "UI"; filename groups (e.g. "NavLink.tsx") → "Components"
1308
1314
  const rawGroup = comp.group || "Components";
1309
- const group = rawGroup === "shadcn" ? "UI" : rawGroup;
1315
+ const group = rawGroup === "shadcn" ? "UI"
1316
+ : rawGroup.includes(".") ? "Components" // root-level file without subdirectory
1317
+ : rawGroup;
1310
1318
  // Title: "Module/ComponentName" (category intentionally dropped — folder is the context)
1311
1319
  const title = `${group}/${componentName}`;
1312
1320
 
@@ -213,7 +213,8 @@ function injectDedupe(projectRoot) {
213
213
  if (content.includes("dedupe")) return; // idempotent
214
214
  // Match: alias block + its trailing comma + whitespace/newline + resolve closing }
215
215
  // e.g. alias: { "@": path.resolve(...) },\n },
216
- const pattern = /(\balias\s*:\s*\{[^}]*\}),(\s*\})/;
216
+ // [^{}]* ensures we skip injection if alias has nested object values (safe fallback)
217
+ const pattern = /(\balias\s*:\s*\{[^{}]*\}),(\s*\})/;
217
218
  if (!pattern.test(content)) return;
218
219
  content = content.replace(pattern, (_, aliasBlock, resolveClose) =>
219
220
  `${aliasBlock},\n dedupe: ["react", "react-dom", "react-router-dom"],${resolveClose}`