Arise type-safe IoC containers from your code. Zero overhead, zero coupling.
A powerful TypeScript IoC container generator CLI tool that automatically creates type-safe dependency injection containers from your existing code. No decorators, no annotations, no manual wiring required.
- π Zero Configuration - No decorators, annotations, or manual wiring required
- π 100% Type Safe - Generated containers are fully typed with compile-time validation
- β‘ Blazing Fast - Powered by AST-grep (built with Rust) for lightning-fast analysis
- π― Smart Dependency Analysis - Automatically detects circular dependencies and missing implementations
- ποΈ Modular Architecture - Organize code into logical modules with cross-module dependency support
- π Zero Coupling - Your business logic stays clean and framework-agnostic
- π Advanced Features - Supports scopes (singleton/transient), name collision handling, and more
# Install globally
npm install -g @notjustcoders/ioc-arise
# Or use with your package manager
pnpm add -D @notjustcoders/ioc-arise
- Create your interfaces and classes:
// IUserService.ts
export interface IUserService {
createUser(name: string, email: string): Promise<User>;
}
// UserService.ts
export class UserService implements IUserService {
constructor(private userRepository: IUserRepository) {}
async createUser(name: string, email: string): Promise<User> {
// Implementation
}
}
- Generate your container:
npx ioc-arise generate
- Use the generated container:
import { container } from './container.gen';
const userService = container.coreModule.UserService;
const user = await userService.createUser('John Doe', 'john@example.com');
For comprehensive documentation, examples, and advanced usage patterns, visit:
π ioc-arise.notjustcoders.com
- Getting Started - Quick setup guide
- Examples - Real-world usage patterns
- CLI Reference - Complete command reference
- Configuration - Advanced configuration options
This is a monorepo containing:
ioc-maker/
βββ apps/
β βββ docs/ # Documentation website (Astro + Starlight)
β βββ ioc-maker-cli/ # CLI tool package
βββ packages/
β βββ eslint-config/ # Shared ESLint configuration
β βββ typescript-config/ # Shared TypeScript configuration
βββ examples/ # Example projects
- Node.js >= 18
- pnpm (recommended package manager)
# Clone the repository
git clone https://github.com/spithacode/ioc-maker.git
cd ioc-maker
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Start development
pnpm dev
pnpm build
- Build all packagespnpm dev
- Start development modepnpm lint
- Run lintingpnpm format
- Format code with Prettierpnpm check-types
- Type checking
# Navigate to CLI package
cd apps/ioc-maker-cli
# Build the CLI
pnpm build
# Test with examples
pnpm test1:generate # Clean architecture example
pnpm test2:generate # Circular dependencies example
pnpm test3:generate # Simple modules example
# ... more test scripts available
# Navigate to docs
cd apps/docs
# Start development server
pnpm dev
# Build for production
pnpm build
The repository includes comprehensive examples demonstrating various patterns:
- Minimal Todo - Basic repository pattern
- Simple Modules - Cross-module dependencies
- Clean Architecture - Advanced architectural patterns
- Use Cases - Classes without interfaces
- Name Collision - Handling duplicate class names
- Circular Dependencies - Error detection and handling
- Scope Management - Singleton vs Transient lifecycles
We welcome contributions! Please see our Contributing Guide for details.
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: ioc-arise.notjustcoders.com
- npm Package: @notjustcoders/ioc-arise
- GitHub: spithacode/ioc-maker
- Website: NotJustCoders
- Built with AST-grep for fast TypeScript parsing
- Documentation powered by Astro and Starlight
- Monorepo managed with Turbo
Made with β€οΈ by the NotJustCoders team