Skip to content

Config

Controls how specs are generated. See the feature guides for detailed explanations of each option.

processing

PropertyTypeDefaultDescription
subcomponentsobjectSubcomponent detection — scope (NESTED or PAGE), match patterns, exclude patterns. Absent = no detection
glyphNamePatternstringName prefix for identifying glyph/icon instances
codeOnlyPropsPatternstringName pattern for code-only prop containers
slotConstraintsbooleanfalseEmit minItems, maxItems, anyOf on slot props
variantDepth1 | 2 | 3 | 99999999Maximum variant nesting depth (9999 = unlimited)
details'FULL' | 'LAYERED''LAYERED'Output detail level
inferNumberPropsbooleanfalseInfer number-typed props from Figma variant values
instanceExamplesobjectPro. Instance example detection — scope (PAGE or FILE), match patterns, exclude patterns, parentNames filter. Absent = no detection. Ignored on the free tier

format

PropertyTypeDefaultDescription
output'JSON' | 'YAML''JSON'Output file format
keys'SAFE' | 'CAMEL' | 'SNAKE' | 'KEBAB' | 'PASCAL' | 'TRAIN''SAFE'Key casing style
layout'LAYOUT' | 'PARENT_CHILDREN' | 'BOTH''LAYOUT'Element hierarchy representation
tokens'TOKEN' | 'TOKEN_NAME' | 'TOKEN_FIGMA_EXTENSIONS' | 'FIGMA_NAME' | 'CUSTOM' | 'FIGMA_SYNTAX_WEB' | 'FIGMA_SYNTAX_IOS' | 'FIGMA_SYNTAX_ANDROID''TOKEN'Token reference output format — FIGMA_SYNTAX_* emit per-platform Figma code syntax, falling back to TOKEN
colorColorFormat'HEX'Color value output format — HEX, HEXA, RGB, RGBA, HSLA, HSB, OKLCH, OKLAB, or OBJECT

include

PropertyTypeDefaultDescription
invalidVariantsbooleanfalseInclude variants marked invalid
invalidCombinationsbooleantrueInclude invalidVariantCombinations list
emptyVariantsbooleanfalseInclude variants with no element overrides
defaultSlotContentbooleanfalsePro. Emit the component’s default slot content into Component.slotContentExamples (structurally detected slot fills). Ignored on the free tier

instanceExamples has no include flag — emitting it is driven by the presence of processing.instanceExamples (Pro only), like subcomponents.

DEFAULT_CONFIG

The only runtime export from @directededges/specs-schema. Provides defaults for all config properties that have a default value. Typed as ResolvedConfig — all defaulted properties are required:

const DEFAULT_CONFIG: ResolvedConfig = {
processing: {
slotConstraints: false,
variantDepth: 9999,
details: 'LAYERED',
inferNumberProps: false,
},
format: {
output: 'JSON',
keys: 'SAFE',
layout: 'LAYOUT',
tokens: 'TOKEN',
color: 'HEX',
},
include: {
invalidVariants: false,
invalidCombinations: true,
emptyVariants: false,
defaultSlotContent: false,
},
};

Feature-toggle properties (subcomponents, instanceExamples, glyphNamePattern, codeOnlyPropsPattern) are absent from DEFAULT_CONFIG — their absence means the feature is disabled. (The include.defaultSlotContent flag is a gate, not a detector, so it carries a false default.)