Skip to content

Configuration Reference

Create an ioc.config.json file in your project root:

{
"sourceDir": "./src",
"outputPath": "./src/container.gen.ts",
"interface": "I*.ts",
"exclude": [
"node_modules",
"dist",
"**/*.test.ts",
"**/*.spec.ts"
],
"modules": {
"UserModule": ["user/**", "auth/**"],
"TodoModule": ["todo/**"],
"CoreModule": ["core/**"]
}
}
OptionTypeDefaultDescription
sourceDirstring"./src"Source directory to analyze
outputPathstring"container.gen.ts"Output file path for generated code
interfacestring"I*.ts"Interface file pattern (glob)
excludestring[][]File patterns to exclude from analysis
modulesRecord<string, string[]>undefinedModule groupings (optional)
  • "I*.ts" - Files starting with ‘I’ (default)
  • "*Interface.ts" - Files ending with ‘Interface’
  • "*Service.ts" - Files ending with ‘Service’
  • "I*.ts|*Repository.ts" - Multiple patterns
{
"exclude": [
"**/*.test.ts",
"**/*.spec.ts",
"**/mocks/**",
"**/*.d.ts"
]
}
{
"modules": {
"UserModule": ["user/**", "auth/**"],
"TodoModule": ["todo/**", "!todo/**/*.test.ts"],
"InfrastructureModule": ["infrastructure/**", "repositories/**"]
}
}
Terminal window
npx @notjustcoders/ioc-arise generate --source lib --output custom.ts --verbose
npx @notjustcoders/ioc-arise generate --config ioc.dev.json
# or, if installed globally:
ioc-arise generate --source lib --output custom.ts --verbose

Priority: CLI arguments > Configuration file > Defaults

Monorepo:

{
"sourceDir": "./packages",
"outputPath": "./packages/container.gen.ts",
"modules": {
"CoreModule": ["core/**"],
"UIModule": ["ui/**"]
}
}

Clean Architecture:

{
"sourceDir": "./src",
"outputPath": "./src/container.gen.ts",
"interface": "I*.ts",
"modules": {
"DomainModule": ["domain/**"],
"ApplicationModule": ["application/**"],
"InfrastructureModule": ["infrastructure/**"]
}
}