mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-28 15:26:53 +05:00
chore: refactor hardcoded values to constants (v0.5.1)
Major internal refactoring to eliminate hardcoded values and improve maintainability. Guardian now fully passes its own quality checks! Changes: - Extract all RepositoryViolation messages to domain constants - Extract all framework leak template strings to centralized constants - Extract all layer paths to infrastructure constants - Extract all regex patterns to IMPORT_PATTERNS constant - Add 30+ new constants for better maintainability New files: - src/infrastructure/constants/paths.ts (layer paths, patterns) - src/domain/constants/Messages.ts (25+ repository messages) - src/domain/constants/FrameworkCategories.ts (framework categories) - src/shared/constants/layers.ts (layer names) Impact: - Reduced hardcoded values from 37 to 1 (97% improvement) - Guardian passes its own src/ directory checks with 0 violations - All 292 tests still passing (100% pass rate) - No breaking changes - fully backwards compatible Test results: - 292 tests passing (100% pass rate) - 96.77% statement coverage - 83.82% branch coverage
This commit is contained in:
15
packages/guardian/src/shared/constants/layers.ts
Normal file
15
packages/guardian/src/shared/constants/layers.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export const LAYER_DOMAIN = "domain"
|
||||
export const LAYER_APPLICATION = "application"
|
||||
export const LAYER_INFRASTRUCTURE = "infrastructure"
|
||||
export const LAYER_SHARED = "shared"
|
||||
export const LAYER_CLI = "cli"
|
||||
|
||||
export const LAYERS = [
|
||||
LAYER_DOMAIN,
|
||||
LAYER_APPLICATION,
|
||||
LAYER_INFRASTRUCTURE,
|
||||
LAYER_SHARED,
|
||||
LAYER_CLI,
|
||||
] as const
|
||||
|
||||
export type Layer = (typeof LAYERS)[number]
|
||||
Reference in New Issue
Block a user