@tpitre/story-ui 3.10.6 → 3.10.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svelte-adapter.d.ts","sourceRoot":"","sources":["../../../story-generator/framework-adapters/svelte-adapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,aAAa,EACb,cAAc,EACd,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,qBAAa,aAAc,SAAQ,oBAAoB;IACrD,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAY;IACxC,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,wBAAwB,EAAE,cAAc,EAAE,CAGjD;IACF,QAAQ,CAAC,gBAAgB,iBAAiB;IAE1C,oBAAoB,CAClB,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE,sBAAsB,GAC/B,MAAM;IAmGT,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM;IAyI/C,mBAAmB,CACjB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,mBAAmB,EAAE,GAChC,MAAM;IA4CT,gBAAgB,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,MAAM;IAsB1D;;OAEG;IACH,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"svelte-adapter.d.ts","sourceRoot":"","sources":["../../../story-generator/framework-adapters/svelte-adapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,aAAa,EACb,cAAc,EACd,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,qBAAa,aAAc,SAAQ,oBAAoB;IACrD,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAY;IACxC,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,wBAAwB,EAAE,cAAc,EAAE,CAGjD;IACF,QAAQ,CAAC,gBAAgB,iBAAiB;IAE1C,oBAAoB,CAClB,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE,sBAAsB,GAC/B,MAAM;IAmGT,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM;IAyI/C,mBAAmB,CACjB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,mBAAmB,EAAE,GAChC,MAAM;IA4CT,gBAAgB,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,MAAM;IAsB1D;;OAEG;IACH,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAgEzC;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE;IAwBpE;;OAEG;IACH,eAAe,CACb,UAAU,EAAE,mBAAmB,EAAE,EACjC,MAAM,EAAE,aAAa,GACpB,MAAM;CAWV;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAEnD"}
|
|
@@ -317,13 +317,27 @@ export const Default: Story = {
|
|
|
317
317
|
// Remove React imports if present
|
|
318
318
|
processed = processed.replace(/import React from ['"]react['"];?\n?/g, '');
|
|
319
319
|
// Fix flowbite-svelte imports - convert deep path imports to named exports
|
|
320
|
+
// Handles both default and named imports with deep paths:
|
|
320
321
|
// e.g., import Card from 'flowbite-svelte/dist/card/Card.svelte' → import { Card } from 'flowbite-svelte'
|
|
321
|
-
|
|
322
|
+
// e.g., import { Card } from "flowbite-svelte/dist/card" → import { Card } from 'flowbite-svelte'
|
|
322
323
|
const flowbiteImports = [];
|
|
323
|
-
|
|
324
|
+
// Pattern 1: Default imports with deep paths
|
|
325
|
+
// e.g., import Card from 'flowbite-svelte/dist/card/Card.svelte'
|
|
326
|
+
const flowbiteDefaultImportPattern = /import\s+(\w+)\s+from\s+['"]flowbite-svelte\/[^'"]+['"];?\n?/g;
|
|
327
|
+
processed = processed.replace(flowbiteDefaultImportPattern, (match, componentName) => {
|
|
324
328
|
flowbiteImports.push(componentName);
|
|
325
329
|
return ''; // Remove the line, we'll add a consolidated import later
|
|
326
330
|
});
|
|
331
|
+
// Pattern 2: Named imports with deep paths
|
|
332
|
+
// e.g., import { Card } from "flowbite-svelte/dist/card"
|
|
333
|
+
// e.g., import { Card, Badge } from "flowbite-svelte/dist/components"
|
|
334
|
+
const flowbiteNamedImportPattern = /import\s*\{\s*([^}]+)\s*\}\s*from\s*['"]flowbite-svelte\/[^'"]+['"];?\n?/g;
|
|
335
|
+
processed = processed.replace(flowbiteNamedImportPattern, (match, namedImports) => {
|
|
336
|
+
// Extract individual component names from the named imports
|
|
337
|
+
const names = namedImports.split(',').map((name) => name.trim()).filter((name) => name);
|
|
338
|
+
flowbiteImports.push(...names);
|
|
339
|
+
return ''; // Remove the line, we'll add a consolidated import later
|
|
340
|
+
});
|
|
327
341
|
// If we found flowbite-svelte deep imports, add a consolidated named export import
|
|
328
342
|
if (flowbiteImports.length > 0) {
|
|
329
343
|
const uniqueImports = [...new Set(flowbiteImports)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storyValidator.d.ts","sourceRoot":"","sources":["../../story-generator/storyValidator.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"storyValidator.d.ts","sourceRoot":"","sources":["../../story-generator/storyValidator.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,EAAE,CAqDrE"}
|
|
@@ -17,6 +17,8 @@ export function validateStory(storyContent) {
|
|
|
17
17
|
{ pattern: /this\.\w+\s*=\s*\$?event\./i, message: 'Do not use "this.property = event.value" in Angular stories. This causes TS4111 errors. Use argTypes with action property for events and create separate stories for different states.' },
|
|
18
18
|
{ pattern: /this\.\w+\+\+/i, message: 'Do not use "this.property++" in Angular stories. This causes TS4111 errors. Use argTypes with action property for events instead of managing state.' },
|
|
19
19
|
{ pattern: /this\.\w+--/i, message: 'Do not use "this.property--" in Angular stories. This causes TS4111 errors. Use argTypes with action property for events instead of managing state.' },
|
|
20
|
+
// Catch flowbite-svelte deep path imports that break in production
|
|
21
|
+
{ pattern: /from\s+['"]flowbite-svelte\/[^'"]+['"]/i, message: 'Do not use deep path imports for flowbite-svelte. Use named exports from root: import { Component } from "flowbite-svelte"' },
|
|
20
22
|
];
|
|
21
23
|
lines.forEach((line, index) => {
|
|
22
24
|
for (const { pattern, message } of forbiddenPatterns) {
|