feat: spread logic from main.ts #21

Merged
blas merged 3 commits from feat/spread-logic into main 2026-03-24 10:41:53 +00:00
Collaborator

🏗️ Refactor: De-coupling main.ts & Architectural Cleanup

Description

This PR addresses the "God Object" anti-pattern in main.ts by segmenting its logic into specialized modules. This restructuring focuses on long-term scalability and adheres to Clean Code principles.

Key Changes

  • Modularization: Decoupled main.ts by extracting logic into separate, dedicated files (services, configurations, and entry points).
  • Improved Maintainability: Reduced file complexity, making it significantly easier to navigate, debug, and extend specific functionalities.
  • Documentation & Standards: Enhanced inline documentation and updated JSDoc/TSDoc comments across the newly created modules.

Future-Proofing

  • Scalability: New features can now be added to specific modules without bloating the main entry point.
  • Testing: Modular code allows for more granular unit testing of isolated logic.
  • Readability: Clearer separation of concerns for faster onboarding of new developers.

Resolves: #13

## 🏗️ Refactor: De-coupling main.ts & Architectural Cleanup ### Description This PR addresses the "God Object" anti-pattern in `main.ts` by segmenting its logic into specialized modules. This restructuring focuses on long-term scalability and adheres to Clean Code principles. ### Key Changes * **Modularization:** Decoupled `main.ts` by extracting logic into separate, dedicated files (services, configurations, and entry points). * **Improved Maintainability:** Reduced file complexity, making it significantly easier to navigate, debug, and extend specific functionalities. * **Documentation & Standards:** Enhanced inline documentation and updated JSDoc/TSDoc comments across the newly created modules. ### Future-Proofing - **Scalability:** New features can now be added to specific modules without bloating the main entry point. - **Testing:** Modular code allows for more granular unit testing of isolated logic. - **Readability:** Clearer separation of concerns for faster onboarding of new developers. Resolves: #13
didavila added the enhancement label 2026-03-24 10:21:09 +00:00
didavila self-assigned this 2026-03-24 10:21:09 +00:00
didavila added 3 commits 2026-03-24 10:21:13 +00:00
- Added `clean-arch.generator.ts` for generating models, mappers, repositories, use cases, and providers based on OpenAPI specs.
- Introduced `dto.generator.ts` to invoke `openapi-generator-cli` for generating DTOs and organizing them.
- Created `report.generator.ts` to generate a JSON report of the generation process.
- Implemented `analyzer.ts` for parsing OpenAPI/Swagger files and extracting relevant data.
- Defined new types in `cli.types.ts`, `generation.types.ts`, `openapi.types.ts`, and `swagger.types.ts` for better type safety.
- Added utility functions in `filesystem.ts` for creating directory structures and cleaning up temporary files.
- Developed logging utilities in `logger.ts` for better console output.
- Included OpenAPI generator checks and installation in `openapi-generator.ts`.
- Added type mapping utility in `type-mapper.ts` for converting OpenAPI types to TypeScript types.
- Updated `package.json` scripts to lint all TypeScript files.
- Modified `tsconfig.json` to include all TypeScript files in the project.
didavila requested review from blas 2026-03-24 10:21:13 +00:00
blas approved these changes 2026-03-24 10:41:45 +00:00
blas merged commit 0bf42f2910 into main 2026-03-24 10:41:53 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blas/openapi-clean-arch-gen#21