Architecture: Nx @nx/enforce-module-boundaries reports static import of la...
Documentation for Sessions
🏗️ Architecture: Nx @nx/enforce-module-boundaries reports static import of la...
Date: 2026-03-21
Time: 17:53:36 UTC
Session: gspace1-253.3
Agent: storage
Confidence: 88%
Status: ✅ Documented
📋 Decision Context
Question:
Nx @nx/enforce-module-boundaries reports static import of lazy-loaded libs (storage-system, demos-lib) from gograb-dev app.config.ts while app.routes.ts lazy-loads those projects — how should we resolve without blanket ESLint disables?
Task: Nx lazy/static boundary gograb-dev app shell
🎯 Decision Made
Chosen:
Move cross-cutting bootstrap surface to always-eager libs: DEMOS_EXTRA_ROUTES InjectionToken defined in @libs-foundational/core-angular and re-exported from demos-lib.routes; provideIntelligentStorage/provideUserScopedStorage re-exported from @auth-core (storage-bootstrap.providers.ts). gograb-dev app.config imports only @auth-core and @libs-foundational/core-angular for those concerns. Keep checkDynamicDependenciesExceptions for @storage-system for other apps that still import storage directly.
Options Considered:
- Only checkDynamicDependenciesExceptions (and/or global app.config off)
- Split storage-system into two Nx libraries
- Re-export tokens/providers from eager libs (chosen)
💭 Reasoning
Root cause: Nx flags the same project graph node reached both via static ES import (shell) and dynamic import (lazy route) from the same app. Exceptions-only fixes symptoms; global app.config ESLint off hid unrelated violations. Architectural fix preserves rule signal for app.config while matching intended layering: auth stack owns storage bootstrap contract; demo extension token lives in foundational core so shells need not static-import demos-lib.
📁 Files Involved
apps/gograb-dev/src/app/app.config.tslibs/libs-foundational/core-angular/src/lib/tokens/demos-extra-routes.token.tslibs/libs-foundational/auth-core/src/lib/storage-bootstrap.providers.tslibs/libs-private/demos-lib/src/demos-lib.routes.tseslint.base.config.mjs
🔗 Related
- Decision ID:
dev_1774115616469_y5kz1nr - Session: 253
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation