vibe-design-system 2.9.3 → 2.9.4
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 +16 -3
- package/package.json +1 -1
package/bin/init.js
CHANGED
|
@@ -399,12 +399,12 @@ const config: StorybookConfig = {
|
|
|
399
399
|
];
|
|
400
400
|
for (const tcp of tsConfigPaths) {
|
|
401
401
|
if (!fs.existsSync(tcp)) continue;
|
|
402
|
-
const raw = JSON.parse(fs.readFileSync(tcp, "utf-8").replace(
|
|
402
|
+
const raw = JSON.parse(fs.readFileSync(tcp, "utf-8").replace(/\\/\\/[^\\n]*/g, "").replace(/,(\\s*[}\\]])/g, "$1"));
|
|
403
403
|
const paths = raw?.compilerOptions?.paths || {};
|
|
404
404
|
const aliases: Record<string, string> = {};
|
|
405
405
|
for (const [alias, targets] of Object.entries(paths) as [string, string[]][]) {
|
|
406
|
-
const cleanAlias = alias.replace(
|
|
407
|
-
const target = targets[0]?.replace(
|
|
406
|
+
const cleanAlias = alias.replace(/\\/\\*$/, "");
|
|
407
|
+
const target = targets[0]?.replace(/\\/\\*$/, "") || "";
|
|
408
408
|
if (cleanAlias && target && cleanAlias !== "@") {
|
|
409
409
|
aliases[cleanAlias] = path.resolve(process.cwd(), target);
|
|
410
410
|
}
|
|
@@ -415,6 +415,19 @@ const config: StorybookConfig = {
|
|
|
415
415
|
return {};
|
|
416
416
|
})();
|
|
417
417
|
return mergeConfig(config, {
|
|
418
|
+
plugins: [
|
|
419
|
+
{
|
|
420
|
+
// Mock figma:asset/* imports — returns empty string so components render without crashing in Storybook
|
|
421
|
+
name: "vds-figma-asset-mock",
|
|
422
|
+
enforce: "pre" as const,
|
|
423
|
+
resolveId(id: string) {
|
|
424
|
+
if (id.startsWith("figma:asset")) return "\\0vds-figma-asset-mock";
|
|
425
|
+
},
|
|
426
|
+
load(id: string) {
|
|
427
|
+
if (id === "\\0vds-figma-asset-mock") return "export default '';";
|
|
428
|
+
},
|
|
429
|
+
},
|
|
430
|
+
],
|
|
418
431
|
resolve: {
|
|
419
432
|
alias: {
|
|
420
433
|
"@": path.resolve(process.cwd(), "${srcPrefix}"),
|