vibe-design-system 2.4.6 → 2.4.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/bin/init.js +25 -13
- package/package.json +1 -1
package/bin/init.js
CHANGED
|
@@ -22,6 +22,8 @@ const INSTALLER_ROOT = path.join(__dirname, "..");
|
|
|
22
22
|
const TEMPLATE_DIR = path.join(INSTALLER_ROOT, "vds-core-template");
|
|
23
23
|
|
|
24
24
|
const STORYBOOK_MAIN_TS = `import type { StorybookConfig } from "@storybook/react-vite";
|
|
25
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
26
|
+
|
|
25
27
|
const config: StorybookConfig = {
|
|
26
28
|
stories: ["../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
|
|
27
29
|
addons: ["@storybook/addon-essentials"],
|
|
@@ -29,7 +31,13 @@ const config: StorybookConfig = {
|
|
|
29
31
|
name: "@storybook/react-vite",
|
|
30
32
|
options: {},
|
|
31
33
|
},
|
|
34
|
+
viteFinal: async (config) => {
|
|
35
|
+
config.plugins = config.plugins || [];
|
|
36
|
+
config.plugins.push(tailwindcss());
|
|
37
|
+
return config;
|
|
38
|
+
},
|
|
32
39
|
};
|
|
40
|
+
|
|
33
41
|
export default config;
|
|
34
42
|
`;
|
|
35
43
|
|
|
@@ -49,7 +57,6 @@ const preview: Preview = {
|
|
|
49
57
|
},
|
|
50
58
|
decorators: [
|
|
51
59
|
(Story) => {
|
|
52
|
-
// Force dark mode for Lovable/shadcn CSS token resolution
|
|
53
60
|
document.documentElement.classList.add("dark");
|
|
54
61
|
return React.createElement(Story, null);
|
|
55
62
|
},
|
|
@@ -134,19 +141,28 @@ function readPackageJson(projectRoot) {
|
|
|
134
141
|
}
|
|
135
142
|
}
|
|
136
143
|
|
|
137
|
-
// ADIM 1 — Bağımlılık kontrolü
|
|
144
|
+
// ADIM 1 — Bağımlılık kontrolü (Storybook v8 + Tailwind v4 Vite)
|
|
138
145
|
function needsStorybook(projectRoot) {
|
|
139
146
|
const pkg = readPackageJson(projectRoot);
|
|
140
147
|
if (!pkg) return false;
|
|
141
148
|
const dev = pkg.devDependencies || {};
|
|
142
|
-
return !(dev.storybook && dev["@storybook/react-vite"]);
|
|
149
|
+
return !(dev.storybook && dev["@storybook/react-vite"] && dev["@tailwindcss/vite"]);
|
|
143
150
|
}
|
|
144
151
|
|
|
145
152
|
function installStorybook(projectRoot) {
|
|
146
|
-
console.log("📚 Storybook
|
|
153
|
+
console.log("📚 Storybook v8 ve @tailwindcss/vite kuruluyor...");
|
|
147
154
|
const r = spawnSync(
|
|
148
155
|
"npm",
|
|
149
|
-
[
|
|
156
|
+
[
|
|
157
|
+
"install",
|
|
158
|
+
"--save-dev",
|
|
159
|
+
"storybook@8",
|
|
160
|
+
"@storybook/react-vite@8",
|
|
161
|
+
"@storybook/react@8",
|
|
162
|
+
"@storybook/addon-essentials@8",
|
|
163
|
+
"@storybook/blocks@8",
|
|
164
|
+
"@tailwindcss/vite",
|
|
165
|
+
],
|
|
150
166
|
{ cwd: projectRoot, stdio: "inherit" }
|
|
151
167
|
);
|
|
152
168
|
if (r.status !== 0) {
|
|
@@ -163,16 +179,12 @@ function ensureStorybook(projectRoot) {
|
|
|
163
179
|
}
|
|
164
180
|
|
|
165
181
|
const mainPath = path.join(storybookDir, "main.ts");
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
console.log("📝 .storybook/main.ts yazıldı.");
|
|
169
|
-
}
|
|
182
|
+
fs.writeFileSync(mainPath, STORYBOOK_MAIN_TS, "utf-8");
|
|
183
|
+
console.log("📝 .storybook/main.ts yazıldı.");
|
|
170
184
|
|
|
171
185
|
const previewPath = path.join(storybookDir, "preview.ts");
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
console.log("📝 .storybook/preview.ts yazıldı.");
|
|
175
|
-
}
|
|
186
|
+
fs.writeFileSync(previewPath, STORYBOOK_PREVIEW_TS, "utf-8");
|
|
187
|
+
console.log("📝 .storybook/preview.ts yazıldı.");
|
|
176
188
|
}
|
|
177
189
|
|
|
178
190
|
// ADIM 3 — vds-core/ kopyala
|