Skip to content

Conversation

@stevez
Copy link
Owner

@stevez stevez commented Dec 27, 2025

….11.1)

Restructured entire codebase into focused domain folders and implemented TypeScript path aliases for better maintainability and scalability.

Phase 2-6 Modular Reorganization:

  • Organized utilities into utils/ folder (config, logger, constants, dev-mode-extractor)
  • Organized CLI into cli/ folder structure (commands/merge.ts, commands/init.ts)
  • Organized core processing modules into core/ folder (processor, v8-reader, reporter, sourcemap-loader)
  • Organized worker modules into worker/ folder (ast-worker, pool)
  • Organized merger module into merger/ folder (core, printer, utils)
  • Created centralized index.ts exports for all modules

Path Aliases Implementation:

  • Configured TypeScript path aliases with @/ prefix in tsconfig.json
  • Added tsc-alias to build script for path resolution in compiled JavaScript
  • Updated vitest.config.ts with resolve.alias configuration
  • Migrated 35+ files across all modules to use path aliases
  • Updated dynamic imports and vi.mock paths in CLI commands and tests

TypeScript Improvements:

  • Fixed type inference issues in test files with FileCoverageData casts
  • Fixed incorrect test assertions with extra parameters
  • Removed non-existent exports (setVerbose, WorkerResult)

Final Structure - 9 domain-focused folders:

  • cli/ - Command-line interface and commands
  • core/ - Core processing modules (processor, reporter, reader, source maps)
  • utils/ - Shared utilities (config, logger, constants, extractors)
  • worker/ - Worker thread parallelization
  • merger/ - Coverage merging logic
  • converter/ - V8-to-Istanbul conversion
  • parsers/ - Bundler-specific URL parsers
  • collector/ - Coverage collection (CDP, dev mode, production)
  • playwright/ - Playwright test fixtures

All 686 tests passing with full TypeScript type checking. No API changes - purely internal code organization improvement.

….11.1)

Restructured entire codebase into focused domain folders and implemented
TypeScript path aliases for better maintainability and scalability.

Phase 2-6 Modular Reorganization:
- Organized utilities into utils/ folder (config, logger, constants, dev-mode-extractor)
- Organized CLI into cli/ folder structure (commands/merge.ts, commands/init.ts)
- Organized core processing modules into core/ folder (processor, v8-reader, reporter, sourcemap-loader)
- Organized worker modules into worker/ folder (ast-worker, pool)
- Organized merger module into merger/ folder (core, printer, utils)
- Created centralized index.ts exports for all modules

Path Aliases Implementation:
- Configured TypeScript path aliases with @/ prefix in tsconfig.json
- Added tsc-alias to build script for path resolution in compiled JavaScript
- Updated vitest.config.ts with resolve.alias configuration
- Migrated 35+ files across all modules to use path aliases
- Updated dynamic imports and vi.mock paths in CLI commands and tests

TypeScript Improvements:
- Fixed type inference issues in test files with FileCoverageData casts
- Fixed incorrect test assertions with extra parameters
- Removed non-existent exports (setVerbose, WorkerResult)

Final Structure - 9 domain-focused folders:
- cli/ - Command-line interface and commands
- core/ - Core processing modules (processor, reporter, reader, source maps)
- utils/ - Shared utilities (config, logger, constants, extractors)
- worker/ - Worker thread parallelization
- merger/ - Coverage merging logic
- converter/ - V8-to-Istanbul conversion
- parsers/ - Bundler-specific URL parsers
- collector/ - Coverage collection (CDP, dev mode, production)
- playwright/ - Playwright test fixtures

All 686 tests passing with full TypeScript type checking.
No API changes - purely internal code organization improvement.
@stevez stevez force-pushed the refactroing-phase-2 branch from 9dee497 to 0905e32 Compare December 27, 2025 01:03
@stevez stevez merged commit efd9522 into main Dec 27, 2025
6 checks passed
@stevez stevez deleted the refactroing-phase-2 branch December 27, 2025 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants