The repository is a large-scale monorepo utilizing pnpm (v9.12.2) for package management. It encompasses several application domains (apps/), shared libraries (packages/), and specialized logic modules (projects/).
- Package Management: Standardized on
pnpmwith a strictnode-linker=isolatedconfiguration (updated during this audit) to eliminate ghost dependencies. - TypeScript: A centralized
tsconfig.base.jsonprovides shared compiler options, with sub-packages extending it and using Project References for build graph integrity. - CI/CD: Centralized logic in
.github/workflows/main-pipeline.yml, executing build, lint, and test suites. Redundant workflows have been purged. - Deployment: Docker-based deployments for the core engine and a hardened VPS deployment script for rapid iteration.
The transition from shamefully-hoist=true to node-linker=isolated revealed several packages relying on undeclared dependencies:
@wasd/social: Fails type-checking due to missingeventemitter3.- UI Components: Several components fail to find
lucide-reactor@types/reactbecause they were previously hoisted from the root or other packages.
Significant version drift was observed before standardization:
- NestJS: Versions varied between
^10.xand^11.xacross different apps. - Type Definitions:
@types/nodeand@types/reactwere inconsistent, leading to potential runtime and build-time mismatches. - BabylonJS: Core rendering packages were drifting, which is critical for 3D engine stability.
Some packages (e.g., packages/types) were marked as noEmit: true, preventing them from generating artifacts required by other packages in the build graph when using Project References.
The current Dockerfile copies the entire repository before running pnpm install.
Improvement: Implement multi-stage builds that copy only pnpm-lock.yaml, pnpm-workspace.yaml, and package.json files first to maximize layer caching.
The main-pipeline.yml uses path-based filters for the entire job.
Improvement: Use pnpm --filter "...[origin/main]" more effectively to run tests only for changed packages and their dependents, rather than the entire workspace when possible.
The scripts/deploy-vps.sh handles credentials via environment variables.
Improvement: Transition to a more robust secret management system or use GitHub Environments with required reviewers for production deployments.
- Explicitly add
eventemitter3toprojects/social/package.json. - Audit all UI packages and add
lucide-react,framer-motion, andzustandwhere they are directly imported. - Run
pnpm -r exec tsc --noEmitto verify resolution.
- Refactor root
Dockerfileto use a "teleport" pattern forpackage.jsonfiles to optimizepnpm installcaching. - Ensure the
prod-serverdeployment usespnpm deploycorrectly to minimize image size.
- Ensure all
tsconfig.jsonfiles include"types": ["node"]where Node.js APIs are used (e.g.,eco-trader). - Maintain the root
pnpm.overridesto prevent future version drift of core libraries (React, Three.js, BabylonJS).
- Integrate a dependency graph visualizer (e.g.,
pnpm-dependency-graph) into the CI pipeline to catch circular dependencies early.