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
connectionsconnectionsConfigNoConnection detection configuration

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
namestringYesExtraction config module identifier
domainstringYesRiviere graph domain this module belongs to
pathstringYesModule root directory relative to config file
modulesstringNoPath pattern with {module} placeholder for resolving module names from file paths
globstringYesGlob pattern for source files within the module directory
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
uicomponentRuleNoDetection rule for UI components
customTypesRecord<string, detectionRule>NoUser-defined component types with their detection rules

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
  • fromClassDecoratorArgExtractionRule — Extracts value from decorator argument on the containing class
  • 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)

fromClassDecoratorArgExtractionRule

Extracts value from decorator argument on the containing class

Properties:

FieldTypeRequiredDescription
fromClassDecoratorArgany | anyYes(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

Properties:

FieldTypeRequiredDescription
eventPublisherseventPublisherConfig[]NoDeclares which custom component types publish events and how to detect the connections
httpLinkshttpLinkConfig[]NoDeclares how to resolve HTTP client calls into cross-domain Links

httpLinkConfig

Declares how to resolve HTTP client calls into cross-domain Links

Properties:

FieldTypeRequiredDescription
fromCustomTypestringYesCustom component type name for HTTP clients — must be defined in customTypes in at least one module
matchDomainBystringYesMetadata key whose value identifies the target domain
matchApiBystring[]YesMetadata keys used to match the target API component

eventPublisherConfig

Declares a custom component type as an event publisher

Properties:

FieldTypeRequiredDescription
fromTypestringYesThe custom component type name — must be defined in customTypes in at least one module
metadataKeystringYesThe metadata key on this component type that holds the published event type name

See Also