Skip to content

Extraction Config

Configuration for extracting architectural components from source code

Format: JSON or YAML


Root Properties

FieldTypeRequiredDescription
$schemastringNoJSON Schema reference
modules(module | moduleRef)[]YesModule definitions for component extraction
connectionsconnectionsConfigNoGlobal connection detection patterns inherited by all modules

moduleRef

Reference to an external module definition file

Properties:

FieldTypeRequiredDescription
$refstringYesFile path to a module definition (relative to this config file)

module

A module defines extraction rules for a path pattern

Properties:

FieldTypeRequiredDescription
namestringYesModule name, used as the domain for extracted components
pathstringYesGlob pattern for files in this module
extendsstringNoPackage name or file path to inherit component rules from
apicomponentRuleNoDetection rule for API components
useCasecomponentRuleNoDetection rule for UseCase components
domainOpcomponentRuleNoDetection rule for DomainOp components
eventcomponentRuleNoDetection rule for Event components
eventHandlercomponentRuleNoDetection rule for EventHandler components
eventPublishercomponentRuleNoDetection rule for EventPublisher components
uicomponentRuleNoDetection rule for UI components
customTypesRecord<string, detectionRule>NoUser-defined component types with their detection rules
connectionsconnectionsConfigNoModule-level connection detection patterns additive to global

componentRule

One of:

  • notUsed — Marks this component type as not used in the module
  • detectionRule — Rule for detecting components of this type

notUsed

Marks this component type as not used in the module

Properties:

FieldTypeRequiredDescription
notUsedbooleanYes(no description)

detectionRule

Rule for detecting components of this type

Properties:

FieldTypeRequiredDescription
findfindTargetYes(no description)
wherepredicateYes(no description)
extractextractBlockNoExtraction rules for metadata fields

extractBlock

Extraction rules mapping field names to extraction rules


extractionRule

One of:

  • literalExtractionRule — Extracts a hardcoded literal value
  • fromClassNameExtractionRule — Extracts value from the class name
  • fromMethodNameExtractionRule — Extracts value from the method name
  • fromFilePathExtractionRule — Extracts value from the file path using regex capture
  • fromPropertyExtractionRule — Extracts value from a class property
  • fromDecoratorArgExtractionRule — Extracts value from decorator argument
  • fromDecoratorNameExtractionRule — Extracts value from the decorator name itself
  • fromGenericArgExtractionRule — Extracts value from generic type argument
  • fromMethodSignatureExtractionRule — Extracts method parameters and return type
  • fromConstructorParamsExtractionRule — Extracts constructor parameter names and types
  • fromParameterTypeExtractionRule — Extracts type name of parameter at position

fromMethodNameExtractionRule

Extracts value from the method name

Properties:

FieldTypeRequiredDescription
fromMethodNameboolean | objectYes(no description)

fromFilePathExtractionRule

Extracts value from the file path using regex capture

Properties:

FieldTypeRequiredDescription
fromFilePathobjectYes(no description)

fromPropertyExtractionRule

Extracts value from a class property

Properties:

FieldTypeRequiredDescription
fromPropertyobjectYes(no description)

fromDecoratorArgExtractionRule

Extracts value from decorator argument

Properties:

FieldTypeRequiredDescription
fromDecoratorArgobjectYes(no description)

fromDecoratorNameExtractionRule

Extracts value from the decorator name itself

Properties:

FieldTypeRequiredDescription
fromDecoratorNameboolean | objectYes(no description)

fromGenericArgExtractionRule

Extracts value from generic type argument

Properties:

FieldTypeRequiredDescription
fromGenericArgobjectYes(no description)

fromMethodSignatureExtractionRule

Extracts method parameters and return type

Properties:

FieldTypeRequiredDescription
fromMethodSignaturebooleanYes(no description)

fromConstructorParamsExtractionRule

Extracts constructor parameter names and types

Properties:

FieldTypeRequiredDescription
fromConstructorParamsbooleanYes(no description)

fromParameterTypeExtractionRule

Extracts type name of parameter at position

Properties:

FieldTypeRequiredDescription
fromParameterTypeobjectYes(no description)

fromClassNameExtractionRule

Extracts value from the class name

Properties:

FieldTypeRequiredDescription
fromClassNameboolean | objectYesExtract from class name, optionally with transform

transform

Transform operations to apply to extracted value

Properties:

FieldTypeRequiredDescription
stripSuffixstringNo(no description)
stripPrefixstringNo(no description)
toLowerCasebooleanNo(no description)
toUpperCasebooleanNo(no description)
kebabToPascalbooleanNo(no description)
pascalToKebabbooleanNo(no description)

literalExtractionRule

Extracts a hardcoded literal value

Properties:

FieldTypeRequiredDescription
literalstring | boolean | numberYesLiteral value to use for this field

findTarget

The code construct to search for

Values:

  • "classes"
  • "methods"
  • "functions"

connectionsConfig

Connection detection configuration with pattern definitions

Properties:

FieldTypeRequiredDescription
patternsconnectionPattern[]YesConnection detection patterns

connectionPattern

A pattern for detecting connections between components

Properties:

FieldTypeRequiredDescription
namestringYesPattern identifier
findconnectionFinderYes(no description)
whereconnectionWhereClauseYes(no description)
extractconnectionExtractBlockNoExtraction rules for connection metadata
linkType"sync" | "async"YesType of connection: sync or async

connectionFinder

The connection detection strategy

Values:

  • "methodCalls"

connectionWhereClause

Filters for matching method calls

Properties:

FieldTypeRequiredDescription
methodNamestringNoMethod name to match
receiverTypestringNoType of the object being called
callerHasDecoratorstring[]NoDecorators the calling class must have
calleeTypeobjectNoConstraints on the callee type

connectionExtractBlock

Extraction rules for connection metadata fields


connectionExtractRule

One of:

  • fromArgumentExtractionRule — Extracts static type of argument at position
  • fromReceiverTypeExtractionRule — Extracts the static type name of the receiver
  • fromCallerTypeExtractionRule — Extracts the static type name of the caller

fromArgumentExtractionRule

Extracts static type of argument at position

Properties:

FieldTypeRequiredDescription
fromArgumentintegerYesArgument position (zero-based)

fromReceiverTypeExtractionRule

Extracts the static type name of the receiver

Properties:

FieldTypeRequiredDescription
fromReceiverTypebooleanYes(no description)

fromCallerTypeExtractionRule

Extracts the static type name of the caller

Properties:

FieldTypeRequiredDescription
fromCallerTypebooleanYes(no description)

See Also