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:

  1. Only checkDynamicDependenciesExceptions (and/or global app.config off)
  2. Split storage-system into two Nx libraries
  3. 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


🔗 Related


Auto-generated by MCP Smart Consolidation