@fragments-sdk/cli 0.9.0 → 0.9.1
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/dist/bin.js +83 -33
- package/dist/bin.js.map +1 -1
- package/dist/{chunk-WI6SLMSO.js → chunk-5GT62FCB.js} +2 -2
- package/dist/{chunk-CJEGT3WD.js → chunk-BW3ZATBW.js} +20 -3
- package/dist/chunk-BW3ZATBW.js.map +1 -0
- package/dist/{chunk-2JIKCJX3.js → chunk-D7372LQX.js} +13 -6
- package/dist/chunk-D7372LQX.js.map +1 -0
- package/dist/chunk-EZYXYWNF.js +131 -0
- package/dist/chunk-EZYXYWNF.js.map +1 -0
- package/dist/{chunk-NGIMCIK2.js → chunk-GF6OVPIN.js} +2 -2
- package/dist/{chunk-GOVI6COW.js → chunk-NVSPGSKB.js} +12 -4
- package/dist/chunk-NVSPGSKB.js.map +1 -0
- package/dist/core/index.d.ts +105 -3
- package/dist/core/index.js +12 -2
- package/dist/{defineFragment-D0UTve-I.d.ts → defineFragment-CBMS7Bab.d.ts} +21 -1
- package/dist/generate-LQA2R7FN.js +461 -0
- package/dist/generate-LQA2R7FN.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/{init-KSAAS7X3.js → init-2GEGVIUQ.js} +13 -75
- package/dist/init-2GEGVIUQ.js.map +1 -0
- package/dist/mcp-bin.js +4 -3
- package/dist/mcp-bin.js.map +1 -1
- package/dist/{scan-65RH3QMM.js → scan-JGS65S7P.js} +6 -5
- package/dist/{service-A5GIGGGK.js → service-XP2EAJXD.js} +4 -3
- package/dist/{static-viewer-NSODM5VX.js → static-viewer-XCS7UJTO.js} +4 -3
- package/dist/storyFilters-3LUYAFZF.js +15 -0
- package/dist/storyFilters-3LUYAFZF.js.map +1 -0
- package/dist/{test-RPWZAYSJ.js → test-TD6TJNVY.js} +3 -3
- package/dist/{tokens-NIXSZRX7.js → tokens-2EXPCVP3.js} +5 -4
- package/dist/{tokens-NIXSZRX7.js.map → tokens-2EXPCVP3.js.map} +1 -1
- package/dist/{viewer-SBTJDMP7.js → viewer-RFA2KVBG.js} +243 -18
- package/dist/viewer-RFA2KVBG.js.map +1 -0
- package/package.json +1 -1
- package/src/build.ts +12 -2
- package/src/commands/build.ts +16 -2
- package/src/commands/generate.ts +383 -68
- package/src/commands/init.ts +9 -51
- package/src/core/config.ts +15 -2
- package/src/core/generators/typescript-extractor.ts +10 -0
- package/src/core/index.ts +15 -0
- package/src/core/schema.ts +10 -2
- package/src/core/storyFilters.test.ts +350 -0
- package/src/core/storyFilters.ts +253 -0
- package/src/core/types.ts +22 -0
- package/src/migrate/converter.ts +9 -1
- package/src/migrate/parser.ts +2 -0
- package/src/migrate/types.ts +2 -0
- package/src/setup.ts +69 -24
- package/src/viewer/__tests__/viewer-integration.test.ts +1 -1
- package/src/viewer/components/AccessibilityPanel.tsx +305 -312
- package/src/viewer/components/ActionsPanel.tsx +31 -29
- package/src/viewer/components/AllVariantsPreview.tsx +78 -0
- package/src/viewer/components/App.tsx +187 -740
- package/src/viewer/components/BottomPanel.tsx +228 -132
- package/src/viewer/components/CodePanel.tsx +1 -1
- package/src/viewer/components/CommandPalette.tsx +7 -10
- package/src/viewer/components/ComponentDocView.tsx +164 -0
- package/src/viewer/components/ComponentGraph.tsx +111 -142
- package/src/viewer/components/ContractPanel.tsx +6 -6
- package/src/viewer/components/EmptyVariantMessage.tsx +54 -0
- package/src/viewer/components/FigmaEmbed.tsx +20 -18
- package/src/viewer/components/FragmentEditor.tsx +92 -115
- package/src/viewer/components/HeaderSearch.tsx +24 -0
- package/src/viewer/components/HealthDashboard.tsx +16 -2
- package/src/viewer/components/Icons.tsx +9 -0
- package/src/viewer/components/InteractionsPanel.tsx +101 -117
- package/src/viewer/components/IsolatedPreviewFrame.tsx +1 -0
- package/src/viewer/components/LandingPage.tsx +3 -3
- package/src/viewer/components/LeftSidebar.tsx +141 -63
- package/src/viewer/components/LoadErrorMessage.tsx +102 -0
- package/src/viewer/components/MultiViewportPreview.tsx +61 -142
- package/src/viewer/components/NoVariantsMessage.tsx +59 -0
- package/src/viewer/components/PanelShell.tsx +161 -0
- package/src/viewer/components/PerformancePanel.tsx +31 -28
- package/src/viewer/components/PreviewArea.tsx +1 -1
- package/src/viewer/components/PreviewAside.tsx +168 -0
- package/src/viewer/components/PreviewFrameHost.tsx +3 -3
- package/src/viewer/components/PropsEditor.tsx +70 -156
- package/src/viewer/components/ResizablePanel.tsx +103 -263
- package/src/viewer/components/RightSidebar.tsx +3 -9
- package/src/viewer/components/SkeletonLoader.tsx +13 -13
- package/src/viewer/components/TokenStylePanel.tsx +182 -209
- package/src/viewer/components/TopToolbar.tsx +159 -0
- package/src/viewer/components/VariantMatrix.tsx +42 -86
- package/src/viewer/components/VariantTabs.tsx +3 -3
- package/src/viewer/components/ViewerHeader.tsx +69 -0
- package/src/viewer/components/WebMCPDevTools.tsx +17 -23
- package/src/viewer/components/viewer-utils.ts +16 -0
- package/src/viewer/entry.tsx +5 -0
- package/src/viewer/hooks/useAppState.ts +27 -4
- package/src/viewer/hooks/usePreviewBridge.ts +2 -2
- package/src/viewer/preview-frame.html +6 -12
- package/src/viewer/server.ts +169 -2
- package/src/viewer/vendor/shared/src/ComponentDocContent.module.scss +10 -0
- package/src/viewer/vendor/shared/src/ComponentDocContent.module.scss.d.ts +2 -0
- package/src/viewer/vendor/shared/src/ComponentDocContent.tsx +274 -0
- package/src/viewer/vendor/shared/src/DocsHeaderBar.tsx +6 -18
- package/src/viewer/vendor/shared/src/DocsPageShell.tsx +5 -0
- package/src/viewer/vendor/shared/src/DocsSidebarNav.tsx +5 -16
- package/src/viewer/vendor/shared/src/PropsTable.module.scss +68 -0
- package/src/viewer/vendor/shared/src/PropsTable.module.scss.d.ts +2 -0
- package/src/viewer/vendor/shared/src/PropsTable.tsx +76 -0
- package/src/viewer/vendor/shared/src/VariantPreviewCard.module.scss +122 -0
- package/src/viewer/vendor/shared/src/VariantPreviewCard.module.scss.d.ts +2 -0
- package/src/viewer/vendor/shared/src/VariantPreviewCard.tsx +134 -0
- package/src/viewer/vendor/shared/src/index.ts +8 -0
- package/src/viewer/vendor/shared/src/types.ts +12 -0
- package/src/viewer/vite-plugin.ts +109 -4
- package/dist/chunk-2JIKCJX3.js.map +0 -1
- package/dist/chunk-CJEGT3WD.js.map +0 -1
- package/dist/chunk-GOVI6COW.js.map +0 -1
- package/dist/generate-35OIMW4Y.js +0 -252
- package/dist/generate-35OIMW4Y.js.map +0 -1
- package/dist/init-KSAAS7X3.js.map +0 -1
- package/dist/viewer-SBTJDMP7.js.map +0 -1
- /package/dist/{chunk-WI6SLMSO.js.map → chunk-5GT62FCB.js.map} +0 -0
- /package/dist/{chunk-NGIMCIK2.js.map → chunk-GF6OVPIN.js.map} +0 -0
- /package/dist/{scan-65RH3QMM.js.map → scan-JGS65S7P.js.map} +0 -0
- /package/dist/{service-A5GIGGGK.js.map → service-XP2EAJXD.js.map} +0 -0
- /package/dist/{static-viewer-NSODM5VX.js.map → static-viewer-XCS7UJTO.js.map} +0 -0
- /package/dist/{test-RPWZAYSJ.js.map → test-TD6TJNVY.js.map} +0 -0
|
@@ -52,8 +52,8 @@ var fragmentMetaSchema = z.object({
|
|
|
52
52
|
figmaProps: z.record(figmaPropMappingSchema).optional()
|
|
53
53
|
});
|
|
54
54
|
var fragmentUsageSchema = z.object({
|
|
55
|
-
when: z.array(z.string())
|
|
56
|
-
whenNot: z.array(z.string())
|
|
55
|
+
when: z.array(z.string()),
|
|
56
|
+
whenNot: z.array(z.string()),
|
|
57
57
|
guidelines: z.array(z.string()).optional(),
|
|
58
58
|
accessibility: z.array(z.string()).optional()
|
|
59
59
|
});
|
|
@@ -172,7 +172,15 @@ var fragmentsConfigSchema = z.object({
|
|
|
172
172
|
bundleSize: z.number().positive().optional()
|
|
173
173
|
}).optional()
|
|
174
174
|
})
|
|
175
|
-
]).optional()
|
|
175
|
+
]).optional(),
|
|
176
|
+
storybook: z.object({
|
|
177
|
+
exclude: z.array(z.string()).optional(),
|
|
178
|
+
include: z.array(z.string()).optional(),
|
|
179
|
+
excludeDeprecated: z.boolean().optional(),
|
|
180
|
+
excludeTests: z.boolean().optional(),
|
|
181
|
+
excludeSvgIcons: z.boolean().optional(),
|
|
182
|
+
excludeSubComponents: z.boolean().optional()
|
|
183
|
+
}).optional()
|
|
176
184
|
});
|
|
177
185
|
var recipeDefinitionSchema = blockDefinitionSchema;
|
|
178
186
|
|
|
@@ -192,4 +200,4 @@ export {
|
|
|
192
200
|
fragmentsConfigSchema,
|
|
193
201
|
recipeDefinitionSchema
|
|
194
202
|
};
|
|
195
|
-
//# sourceMappingURL=chunk-
|
|
203
|
+
//# sourceMappingURL=chunk-NVSPGSKB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/schema.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Zod schemas for runtime validation of fragment definitions\n */\n\n// Figma property mapping schemas\nconst figmaStringMappingSchema = z.object({\n __type: z.literal('figma-string'),\n figmaProperty: z.string().min(1),\n});\n\nconst figmaBooleanMappingSchema = z.object({\n __type: z.literal('figma-boolean'),\n figmaProperty: z.string().min(1),\n valueMapping: z.object({ true: z.unknown(), false: z.unknown() }).optional(),\n});\n\nconst figmaEnumMappingSchema = z.object({\n __type: z.literal('figma-enum'),\n figmaProperty: z.string().min(1),\n valueMapping: z.record(z.unknown()),\n});\n\nconst figmaInstanceMappingSchema = z.object({\n __type: z.literal('figma-instance'),\n figmaProperty: z.string().min(1),\n});\n\nconst figmaChildrenMappingSchema = z.object({\n __type: z.literal('figma-children'),\n layers: z.array(z.string().min(1)),\n});\n\nconst figmaTextContentMappingSchema = z.object({\n __type: z.literal('figma-text-content'),\n layer: z.string().min(1),\n});\n\nexport const figmaPropMappingSchema = z.discriminatedUnion('__type', [\n figmaStringMappingSchema,\n figmaBooleanMappingSchema,\n figmaEnumMappingSchema,\n figmaInstanceMappingSchema,\n figmaChildrenMappingSchema,\n figmaTextContentMappingSchema,\n]);\n\nexport const fragmentMetaSchema = z.object({\n name: z.string().min(1),\n description: z.string().min(1),\n category: z.string().min(1),\n tags: z.array(z.string()).optional(),\n status: z.enum(['stable', 'beta', 'deprecated', 'experimental']).optional(),\n since: z.string().optional(),\n dependencies: z.array(z.object({\n name: z.string().min(1),\n version: z.string().min(1),\n reason: z.string().optional(),\n })).optional(),\n figma: z.string().url().optional(),\n figmaProps: z.record(figmaPropMappingSchema).optional(),\n});\n\nexport const fragmentUsageSchema = z.object({\n when: z.array(z.string()),\n whenNot: z.array(z.string()),\n guidelines: z.array(z.string()).optional(),\n accessibility: z.array(z.string()).optional(),\n});\n\nexport const propTypeSchema: z.ZodType<string> = z.enum([\n 'string',\n 'number',\n 'boolean',\n 'enum',\n 'function',\n 'node',\n 'element',\n 'object',\n 'array',\n 'union',\n 'custom',\n]);\n\nexport const propDefinitionSchema = z.object({\n type: propTypeSchema,\n values: z.array(z.string()).readonly().optional(),\n default: z.unknown().optional(),\n description: z.string().optional(),\n required: z.boolean().optional(),\n constraints: z.array(z.string()).optional(),\n typeDetails: z.record(z.unknown()).optional(),\n});\n\nexport const relationshipTypeSchema = z.enum([\n 'alternative',\n 'sibling',\n 'parent',\n 'child',\n 'composition',\n 'complementary',\n 'used-by',\n]);\n\nexport const componentRelationSchema = z.object({\n component: z.string().min(1),\n relationship: relationshipTypeSchema,\n note: z.string().min(1),\n});\n\nexport const fragmentVariantSchema = z.object({\n name: z.string().min(1),\n description: z.string().min(1),\n render: z.function().returns(z.unknown()),\n code: z.string().optional(),\n figma: z.string().url().optional(),\n});\n\n/**\n * Schema for banned patterns in codebase\n */\nexport const fragmentBanSchema = z.object({\n pattern: z.string().min(1),\n message: z.string().min(1),\n});\n\n/**\n * Schema for agent-optimized contract metadata\n */\nexport const fragmentContractSchema = z.object({\n propsSummary: z.array(z.string()).optional(),\n a11yRules: z.array(z.string()).optional(),\n bans: z.array(fragmentBanSchema).optional(),\n scenarioTags: z.array(z.string()).optional(),\n performanceBudget: z.number().positive().optional(),\n});\n\n/**\n * Schema for provenance tracking of generated fragments\n */\nexport const fragmentGeneratedSchema = z.object({\n source: z.enum(['storybook', 'manual', 'ai']),\n sourceFile: z.string().optional(),\n confidence: z.number().min(0).max(1).optional(),\n timestamp: z.string().datetime().optional(),\n});\n\n/**\n * Schema for AI-specific metadata for playground context generation\n */\nexport const aiMetadataSchema = z.object({\n compositionPattern: z.enum(['compound', 'simple', 'controlled', 'wrapper']).optional(),\n subComponents: z.array(z.string()).optional(),\n requiredChildren: z.array(z.string()).optional(),\n commonPatterns: z.array(z.string()).optional(),\n});\n\n/**\n * Schema for block definitions\n */\nexport const blockDefinitionSchema = z.object({\n name: z.string().min(1),\n description: z.string().min(1),\n category: z.string().min(1),\n components: z.array(z.string().min(1)).min(1),\n code: z.string().min(1),\n tags: z.array(z.string()).optional(),\n});\n\nexport const fragmentDefinitionSchema = z.object({\n component: z.any(), // Allow any component type (function, class, forwardRef, etc.)\n meta: fragmentMetaSchema,\n usage: fragmentUsageSchema,\n props: z.record(propDefinitionSchema),\n relations: z.array(componentRelationSchema).optional(),\n variants: z.array(fragmentVariantSchema), // Allow empty variants array\n contract: fragmentContractSchema.optional(),\n ai: aiMetadataSchema.optional(),\n _generated: fragmentGeneratedSchema.optional(),\n});\n\n/**\n * Config schema - validates required fields, passes through optional config objects.\n * Type definitions are in types.ts - schema just ensures basic structure.\n */\nexport const fragmentsConfigSchema = z.object({\n include: z.array(z.string()).min(1),\n exclude: z.array(z.string()).optional(),\n components: z.array(z.string()).optional(),\n outFile: z.string().optional(),\n framework: z.enum(['react', 'vue', 'svelte']).optional(),\n figmaFile: z.string().url().optional(),\n figmaToken: z.string().optional(),\n screenshots: z.object({}).passthrough().optional(),\n service: z.object({}).passthrough().optional(),\n registry: z.object({}).passthrough().optional(),\n tokens: z.object({\n include: z.array(z.string()).min(1),\n }).passthrough().optional(),\n snippets: z.object({\n mode: z.enum(['warn', 'error']).optional(),\n scope: z.enum(['snippet', 'snippet+render']).optional(),\n requireFullSnippet: z.boolean().optional(),\n allowedExternalModules: z.array(z.string().min(1)).optional(),\n }).optional(),\n performance: z.union([\n z.enum(['strict', 'standard', 'relaxed']),\n z.object({\n preset: z.enum(['strict', 'standard', 'relaxed']).optional(),\n budgets: z.object({\n bundleSize: z.number().positive().optional(),\n }).optional(),\n }),\n ]).optional(),\n storybook: z.object({\n exclude: z.array(z.string()).optional(),\n include: z.array(z.string()).optional(),\n excludeDeprecated: z.boolean().optional(),\n excludeTests: z.boolean().optional(),\n excludeSvgIcons: z.boolean().optional(),\n excludeSubComponents: z.boolean().optional(),\n }).optional(),\n});\n\n/**\n * @deprecated Use blockDefinitionSchema instead\n */\nexport const recipeDefinitionSchema = blockDefinitionSchema;\n"],"mappings":";;;AAAA,SAAS,SAAS;AAOlB,IAAM,2BAA2B,EAAE,OAAO;AAAA,EACxC,QAAQ,EAAE,QAAQ,cAAc;AAAA,EAChC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC;AACjC,CAAC;AAED,IAAM,4BAA4B,EAAE,OAAO;AAAA,EACzC,QAAQ,EAAE,QAAQ,eAAe;AAAA,EACjC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAC/B,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS;AAC7E,CAAC;AAED,IAAM,yBAAyB,EAAE,OAAO;AAAA,EACtC,QAAQ,EAAE,QAAQ,YAAY;AAAA,EAC9B,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAC/B,cAAc,EAAE,OAAO,EAAE,QAAQ,CAAC;AACpC,CAAC;AAED,IAAM,6BAA6B,EAAE,OAAO;AAAA,EAC1C,QAAQ,EAAE,QAAQ,gBAAgB;AAAA,EAClC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC;AACjC,CAAC;AAED,IAAM,6BA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core/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as FragmentDefinition, c as FigmaStringMapping, e as FigmaBooleanMapping, f as FigmaEnumMapping, g as FigmaInstanceMapping, h as FigmaChildrenMapping, i as FigmaTextContentMapping, R as RelationshipType, V as VariantLoader, j as VariantRenderOptions } from '../defineFragment-
|
|
2
|
-
export { A as AIMetadata,
|
|
1
|
+
import { b as FragmentDefinition, S as StorybookFilterConfig, c as FigmaStringMapping, e as FigmaBooleanMapping, f as FigmaEnumMapping, g as FigmaInstanceMapping, h as FigmaChildrenMapping, i as FigmaTextContentMapping, R as RelationshipType, V as VariantLoader, j as VariantRenderOptions } from '../defineFragment-CBMS7Bab.js';
|
|
2
|
+
export { A as AIMetadata, J as BaselineInfo, B as BlockDefinition, I as BoundingBox, v as CompiledRecipe, o as ComponentRelation, C as ControlType, D as DiffResult, N as FigmaPropMapping, k as FragmentComponent, w as FragmentContract, x as FragmentGenerated, l as FragmentMeta, m as FragmentUsage, r as FragmentVariant, F as FragmentsConfig, Y as InferProps, M as Manifest, p as PlayFunction, q as PlayFunctionContext, n as PropDefinition, P as PropType, u as RecipeDefinition, t as RegistryOptions, G as Screenshot, y as ScreenshotConfig, H as ScreenshotMetadata, z as ServiceConfig, s as SnippetPolicyConfig, T as Theme, O as TokenConfig, K as VerifyRequest, L as VerifyResult, E as Viewport, U as compileBlock, Q as compileFragment, X as compileRecipe, a as defineBlock, d as defineFragment, W as defineRecipe } from '../defineFragment-CBMS7Bab.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { ComponentType, ReactNode } from 'react';
|
|
5
5
|
export { ContextOptions, ContextResult, generateContext } from '@fragments-sdk/context/generate';
|
|
@@ -1719,10 +1719,40 @@ declare const fragmentsConfigSchema: z.ZodObject<{
|
|
|
1719
1719
|
bundleSize?: number | undefined;
|
|
1720
1720
|
} | undefined;
|
|
1721
1721
|
}>]>>;
|
|
1722
|
+
storybook: z.ZodOptional<z.ZodObject<{
|
|
1723
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1724
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1725
|
+
excludeDeprecated: z.ZodOptional<z.ZodBoolean>;
|
|
1726
|
+
excludeTests: z.ZodOptional<z.ZodBoolean>;
|
|
1727
|
+
excludeSvgIcons: z.ZodOptional<z.ZodBoolean>;
|
|
1728
|
+
excludeSubComponents: z.ZodOptional<z.ZodBoolean>;
|
|
1729
|
+
}, "strip", z.ZodTypeAny, {
|
|
1730
|
+
include?: string[] | undefined;
|
|
1731
|
+
exclude?: string[] | undefined;
|
|
1732
|
+
excludeDeprecated?: boolean | undefined;
|
|
1733
|
+
excludeTests?: boolean | undefined;
|
|
1734
|
+
excludeSvgIcons?: boolean | undefined;
|
|
1735
|
+
excludeSubComponents?: boolean | undefined;
|
|
1736
|
+
}, {
|
|
1737
|
+
include?: string[] | undefined;
|
|
1738
|
+
exclude?: string[] | undefined;
|
|
1739
|
+
excludeDeprecated?: boolean | undefined;
|
|
1740
|
+
excludeTests?: boolean | undefined;
|
|
1741
|
+
excludeSvgIcons?: boolean | undefined;
|
|
1742
|
+
excludeSubComponents?: boolean | undefined;
|
|
1743
|
+
}>>;
|
|
1722
1744
|
}, "strip", z.ZodTypeAny, {
|
|
1723
1745
|
include: string[];
|
|
1724
1746
|
components?: string[] | undefined;
|
|
1725
1747
|
screenshots?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1748
|
+
storybook?: {
|
|
1749
|
+
include?: string[] | undefined;
|
|
1750
|
+
exclude?: string[] | undefined;
|
|
1751
|
+
excludeDeprecated?: boolean | undefined;
|
|
1752
|
+
excludeTests?: boolean | undefined;
|
|
1753
|
+
excludeSvgIcons?: boolean | undefined;
|
|
1754
|
+
excludeSubComponents?: boolean | undefined;
|
|
1755
|
+
} | undefined;
|
|
1726
1756
|
tokens?: z.objectOutputType<{
|
|
1727
1757
|
include: z.ZodArray<z.ZodString, "many">;
|
|
1728
1758
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -1749,6 +1779,14 @@ declare const fragmentsConfigSchema: z.ZodObject<{
|
|
|
1749
1779
|
include: string[];
|
|
1750
1780
|
components?: string[] | undefined;
|
|
1751
1781
|
screenshots?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1782
|
+
storybook?: {
|
|
1783
|
+
include?: string[] | undefined;
|
|
1784
|
+
exclude?: string[] | undefined;
|
|
1785
|
+
excludeDeprecated?: boolean | undefined;
|
|
1786
|
+
excludeTests?: boolean | undefined;
|
|
1787
|
+
excludeSvgIcons?: boolean | undefined;
|
|
1788
|
+
excludeSubComponents?: boolean | undefined;
|
|
1789
|
+
} | undefined;
|
|
1752
1790
|
tokens?: z.objectInputType<{
|
|
1753
1791
|
include: z.ZodArray<z.ZodString, "many">;
|
|
1754
1792
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
@@ -1798,6 +1836,70 @@ declare const recipeDefinitionSchema: z.ZodObject<{
|
|
|
1798
1836
|
tags?: string[] | undefined;
|
|
1799
1837
|
}>;
|
|
1800
1838
|
|
|
1839
|
+
/**
|
|
1840
|
+
* Smart filtering for Storybook adapter.
|
|
1841
|
+
*
|
|
1842
|
+
* Two layers:
|
|
1843
|
+
* 1. Per-file heuristics — checkStoryExclusion() checks title, tags, component name, etc.
|
|
1844
|
+
* 2. Cross-file sub-component detection — detectSubComponentPaths() uses directory structure.
|
|
1845
|
+
*
|
|
1846
|
+
* All functions are pure (no I/O, no side effects) for easy testing.
|
|
1847
|
+
*/
|
|
1848
|
+
|
|
1849
|
+
type ExclusionReason = 'deprecated' | 'test-story' | 'svg-icon' | 'tag-excluded' | 'empty-variants' | 'sub-component' | 'config-excluded';
|
|
1850
|
+
interface ExclusionResult {
|
|
1851
|
+
excluded: boolean;
|
|
1852
|
+
reason?: ExclusionReason;
|
|
1853
|
+
detail?: string;
|
|
1854
|
+
}
|
|
1855
|
+
interface CheckStoryExclusionOpts {
|
|
1856
|
+
storybookTitle?: string;
|
|
1857
|
+
componentName: string;
|
|
1858
|
+
componentDisplayName?: string;
|
|
1859
|
+
componentFunctionName?: string;
|
|
1860
|
+
tags?: string[];
|
|
1861
|
+
variantCount: number;
|
|
1862
|
+
filePath: string;
|
|
1863
|
+
config: StorybookFilterConfig;
|
|
1864
|
+
}
|
|
1865
|
+
/**
|
|
1866
|
+
* Per-file exclusion check. Returns `{ excluded: true, reason, detail }` when
|
|
1867
|
+
* the fragment should be filtered out, or `{ excluded: false }` when it should
|
|
1868
|
+
* be kept.
|
|
1869
|
+
*
|
|
1870
|
+
* Config `include` trumps everything — if a name matches `include`, it is
|
|
1871
|
+
* never excluded by heuristics.
|
|
1872
|
+
*/
|
|
1873
|
+
declare function checkStoryExclusion(opts: CheckStoryExclusionOpts): ExclusionResult;
|
|
1874
|
+
/**
|
|
1875
|
+
* Given all story file relative paths, detect which ones are sub-components
|
|
1876
|
+
* based on directory structure.
|
|
1877
|
+
*
|
|
1878
|
+
* Heuristic: within a directory, if one story file's base name matches the
|
|
1879
|
+
* directory name, it is the "primary" component. All other story files in
|
|
1880
|
+
* the same directory are considered sub-components.
|
|
1881
|
+
*
|
|
1882
|
+
* Example:
|
|
1883
|
+
* src/components/Form/Form.stories.tsx → primary ("Form")
|
|
1884
|
+
* src/components/Form/Checkbox.stories.tsx → sub-component of "Form"
|
|
1885
|
+
* src/components/Form/RadioGroup.stories.tsx → sub-component of "Form"
|
|
1886
|
+
*
|
|
1887
|
+
* Returns a Map from relative path → parent component name.
|
|
1888
|
+
* Paths NOT in the map are standalone components.
|
|
1889
|
+
*/
|
|
1890
|
+
declare function detectSubComponentPaths(storyFiles: Array<{
|
|
1891
|
+
relativePath: string;
|
|
1892
|
+
}>): Map<string, string>;
|
|
1893
|
+
/**
|
|
1894
|
+
* Check if a component name matches the `storybook.include` patterns.
|
|
1895
|
+
* Include is a force-include that bypasses all heuristic filters.
|
|
1896
|
+
*/
|
|
1897
|
+
declare function isForceIncluded(name: string, config: StorybookFilterConfig): boolean;
|
|
1898
|
+
/**
|
|
1899
|
+
* Check if a component name matches the `storybook.exclude` patterns.
|
|
1900
|
+
*/
|
|
1901
|
+
declare function isConfigExcluded(name: string, config: StorybookFilterConfig): boolean;
|
|
1902
|
+
|
|
1801
1903
|
/**
|
|
1802
1904
|
* Figma property mapping DSL
|
|
1803
1905
|
*
|
|
@@ -2089,4 +2191,4 @@ interface PreviewVariantRuntimeProps extends PreviewRuntimeOptions {
|
|
|
2089
2191
|
*/
|
|
2090
2192
|
declare function PreviewVariantRuntime({ variant, loadedData, children, }: PreviewVariantRuntimeProps): react_jsx_runtime.JSX.Element;
|
|
2091
2193
|
|
|
2092
|
-
export { BRAND, type Brand, type CSF2Story, type ComplexityTier, type CompositionAnalysis, type CompositionGuideline, type CompositionSuggestion, type CompositionWarning, DEFAULTS, type Decorator, type Defaults, type DesignToken, type EnhancedStyleDiffItem, FigmaBooleanMapping, FigmaChildrenMapping, FigmaEnumMapping, FigmaInstanceMapping, FigmaStringMapping, FigmaTextContentMapping, type Fragment, type FragmentAccessibility, type FragmentContextOptions, FragmentDefinition, type FragmentDoNotItem, type FragmentFigma, type FragmentIndex, type FragmentMeta as FragmentJsonMeta, type FragmentUsage as FragmentJsonUsage, type FragmentPattern, type FragmentRegistry, type FragmentRelated, type Loader, PRESET_NAMES, type ParsedToken, type PerformanceData as PerfData, type PerformanceSummary as PerfSummary, type PerformanceBudgets, type PerformanceConfig, type PreviewConfig, type PreviewRuntimeOptions, type PreviewRuntimeState, type PreviewVariantLike, PreviewVariantRuntime, type RegistryComponentEntry, type RegistryPropEntry, RelationshipType, type Story, type StoryArgType, type StoryContext, type StoryMeta, type StoryModule, type TokenCategory, type TokenFix, type TokenMatchRequest, type TokenMatchResult, type TokenParseError, type TokenParseOutput, type TokenParseResult, type TokenRegistry, type TokenRegistryMeta, type TokenUsageSummary, VariantLoader, aiMetadataSchema, analyzeComposition, blockDefinitionSchema, budgetBar, classifyComplexity, componentRelationSchema, executeVariantLoaders, figma, figmaPropMappingSchema, formatBytes, fragmentBanSchema, fragmentContractSchema, fragmentDefinitionSchema, fragmentGeneratedSchema, fragmentMetaSchema, fragmentUsageSchema, fragmentVariantSchema, fragmentsConfigSchema, getPreviewConfig, isExportStory, isFigmaPropMapping, parseTokenFile, propDefinitionSchema, recipeDefinitionSchema, resolveFigmaMapping, resolvePerformanceConfig, resolvePreviewRuntimeState, setPreviewConfig, storyModuleToFragment, storyNameFromExport, toId, usePreviewVariantRuntime };
|
|
2194
|
+
export { BRAND, type Brand, type CSF2Story, type CheckStoryExclusionOpts, type ComplexityTier, type CompositionAnalysis, type CompositionGuideline, type CompositionSuggestion, type CompositionWarning, DEFAULTS, type Decorator, type Defaults, type DesignToken, type EnhancedStyleDiffItem, type ExclusionReason, type ExclusionResult, FigmaBooleanMapping, FigmaChildrenMapping, FigmaEnumMapping, FigmaInstanceMapping, FigmaStringMapping, FigmaTextContentMapping, type Fragment, type FragmentAccessibility, type FragmentContextOptions, FragmentDefinition, type FragmentDoNotItem, type FragmentFigma, type FragmentIndex, type FragmentMeta as FragmentJsonMeta, type FragmentUsage as FragmentJsonUsage, type FragmentPattern, type FragmentRegistry, type FragmentRelated, type Loader, PRESET_NAMES, type ParsedToken, type PerformanceData as PerfData, type PerformanceSummary as PerfSummary, type PerformanceBudgets, type PerformanceConfig, type PreviewConfig, type PreviewRuntimeOptions, type PreviewRuntimeState, type PreviewVariantLike, PreviewVariantRuntime, type RegistryComponentEntry, type RegistryPropEntry, RelationshipType, type Story, type StoryArgType, type StoryContext, type StoryMeta, type StoryModule, StorybookFilterConfig, type TokenCategory, type TokenFix, type TokenMatchRequest, type TokenMatchResult, type TokenParseError, type TokenParseOutput, type TokenParseResult, type TokenRegistry, type TokenRegistryMeta, type TokenUsageSummary, VariantLoader, aiMetadataSchema, analyzeComposition, blockDefinitionSchema, budgetBar, checkStoryExclusion, classifyComplexity, componentRelationSchema, detectSubComponentPaths, executeVariantLoaders, figma, figmaPropMappingSchema, formatBytes, fragmentBanSchema, fragmentContractSchema, fragmentDefinitionSchema, fragmentGeneratedSchema, fragmentMetaSchema, fragmentUsageSchema, fragmentVariantSchema, fragmentsConfigSchema, getPreviewConfig, isConfigExcluded, isExportStory, isFigmaPropMapping, isForceIncluded, parseTokenFile, propDefinitionSchema, recipeDefinitionSchema, resolveFigmaMapping, resolvePerformanceConfig, resolvePreviewRuntimeState, setPreviewConfig, storyModuleToFragment, storyNameFromExport, toId, usePreviewVariantRuntime };
|
package/dist/core/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
storyNameFromExport,
|
|
28
28
|
toId,
|
|
29
29
|
usePreviewVariantRuntime
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-GF6OVPIN.js";
|
|
31
31
|
import {
|
|
32
32
|
aiMetadataSchema,
|
|
33
33
|
blockDefinitionSchema,
|
|
@@ -43,7 +43,13 @@ import {
|
|
|
43
43
|
fragmentsConfigSchema,
|
|
44
44
|
propDefinitionSchema,
|
|
45
45
|
recipeDefinitionSchema
|
|
46
|
-
} from "../chunk-
|
|
46
|
+
} from "../chunk-NVSPGSKB.js";
|
|
47
|
+
import {
|
|
48
|
+
checkStoryExclusion,
|
|
49
|
+
detectSubComponentPaths,
|
|
50
|
+
isConfigExcluded,
|
|
51
|
+
isForceIncluded
|
|
52
|
+
} from "../chunk-EZYXYWNF.js";
|
|
47
53
|
import {
|
|
48
54
|
BRAND,
|
|
49
55
|
DEFAULTS
|
|
@@ -58,6 +64,7 @@ export {
|
|
|
58
64
|
analyzeComposition,
|
|
59
65
|
blockDefinitionSchema,
|
|
60
66
|
budgetBar,
|
|
67
|
+
checkStoryExclusion,
|
|
61
68
|
classifyComplexity,
|
|
62
69
|
compileBlock,
|
|
63
70
|
compileFragment,
|
|
@@ -66,6 +73,7 @@ export {
|
|
|
66
73
|
defineBlock,
|
|
67
74
|
defineFragment,
|
|
68
75
|
defineRecipe,
|
|
76
|
+
detectSubComponentPaths,
|
|
69
77
|
executeVariantLoaders,
|
|
70
78
|
figma,
|
|
71
79
|
figmaPropMappingSchema,
|
|
@@ -80,8 +88,10 @@ export {
|
|
|
80
88
|
fragmentsConfigSchema,
|
|
81
89
|
generateContext,
|
|
82
90
|
getPreviewConfig,
|
|
91
|
+
isConfigExcluded,
|
|
83
92
|
isExportStory,
|
|
84
93
|
isFigmaPropMapping,
|
|
94
|
+
isForceIncluded,
|
|
85
95
|
parseTokenFile,
|
|
86
96
|
propDefinitionSchema,
|
|
87
97
|
recipeDefinitionSchema,
|
|
@@ -359,6 +359,24 @@ interface SnippetPolicyConfig {
|
|
|
359
359
|
/** Allow these external modules for JSX components in snippets/renders. */
|
|
360
360
|
allowedExternalModules?: string[];
|
|
361
361
|
}
|
|
362
|
+
/**
|
|
363
|
+
* Storybook adapter filtering configuration.
|
|
364
|
+
* Controls which Storybook stories are included when generating fragments.
|
|
365
|
+
*/
|
|
366
|
+
interface StorybookFilterConfig {
|
|
367
|
+
/** Glob-style patterns for component names to explicitly exclude */
|
|
368
|
+
exclude?: string[];
|
|
369
|
+
/** Glob-style patterns for component names to force-include (bypasses all heuristic filters) */
|
|
370
|
+
include?: string[];
|
|
371
|
+
/** Exclude stories with "Deprecated" in the title (default: true) */
|
|
372
|
+
excludeDeprecated?: boolean;
|
|
373
|
+
/** Exclude test stories (title ending /test(s) or *.test.stories.* files) (default: true) */
|
|
374
|
+
excludeTests?: boolean;
|
|
375
|
+
/** Exclude SVG icon components (names matching Svg[A-Z]*) (default: true) */
|
|
376
|
+
excludeSvgIcons?: boolean;
|
|
377
|
+
/** Exclude sub-components detected by directory structure (default: true) */
|
|
378
|
+
excludeSubComponents?: boolean;
|
|
379
|
+
}
|
|
362
380
|
/**
|
|
363
381
|
* Config file structure
|
|
364
382
|
*/
|
|
@@ -396,6 +414,8 @@ interface FragmentsConfig {
|
|
|
396
414
|
bundleSize?: number;
|
|
397
415
|
};
|
|
398
416
|
};
|
|
417
|
+
/** Storybook adapter filtering configuration */
|
|
418
|
+
storybook?: StorybookFilterConfig;
|
|
399
419
|
}
|
|
400
420
|
/**
|
|
401
421
|
* Screenshot capture configuration
|
|
@@ -662,4 +682,4 @@ declare const compileRecipe: typeof compileBlock;
|
|
|
662
682
|
*/
|
|
663
683
|
type InferProps<T> = T extends FragmentComponent<infer P> ? P : never;
|
|
664
684
|
|
|
665
|
-
export { type AIMetadata as A, type BlockDefinition as B, type ControlType as C, type DiffResult as D, type
|
|
685
|
+
export { type AIMetadata as A, type BlockDefinition as B, type ControlType as C, type DiffResult as D, type Viewport as E, type FragmentsConfig as F, type Screenshot as G, type ScreenshotMetadata as H, type BoundingBox as I, type BaselineInfo as J, type VerifyRequest as K, type VerifyResult as L, type Manifest as M, type FigmaPropMapping as N, type TokenConfig as O, type PropType as P, compileFragment as Q, type RelationshipType as R, type StorybookFilterConfig as S, type Theme as T, compileBlock as U, type VariantLoader as V, defineRecipe as W, compileRecipe as X, type InferProps as Y, defineBlock as a, type FragmentDefinition as b, type FigmaStringMapping as c, defineFragment as d, type FigmaBooleanMapping as e, type FigmaEnumMapping as f, type FigmaInstanceMapping as g, type FigmaChildrenMapping as h, type FigmaTextContentMapping as i, type VariantRenderOptions as j, type FragmentComponent as k, type FragmentMeta as l, type FragmentUsage as m, type PropDefinition as n, type ComponentRelation as o, type PlayFunction as p, type PlayFunctionContext as q, type FragmentVariant as r, type SnippetPolicyConfig as s, type RegistryOptions as t, type RecipeDefinition as u, type CompiledRecipe as v, type FragmentContract as w, type FragmentGenerated as x, type ScreenshotConfig as y, type ServiceConfig as z };
|