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

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''TOKEN'Token reference output format

include

PropertyTypeDefaultDescription
invalidVariantsbooleanfalseInclude variants marked invalid
invalidCombinationsbooleantrueInclude invalidVariantCombinations list
emptyVariantsbooleanfalseInclude variants with no element overrides

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',
},
include: {
invalidVariants: false,
invalidCombinations: true,
emptyVariants: false,
},
};

Feature-toggle properties (subcomponents, glyphNamePattern, codeOnlyPropsPattern) are absent from DEFAULT_CONFIG — their absence means the feature is disabled.