Skip to content

Monorepo Transition & Quality Gates Implementation

Summary

In this session, we elevated the project's maturity from a simple repository to a Monorepo structure. This prepares the foundation for multiple packages (Backend, Frontend, and Docs) to coexist under a unified quality governance system.

Changes Performed

1. Monorepo Structure (NPM Workspaces)

  • Migration: Moved all documentation files from docs/ to packages/docs/.
  • Orchestration: Configured the root package.json to manage the workspace via the workspaces property.
  • Independence: Created a specific package.json for the documentation package, allowing for isolated scripts and dependencies.

2. Quality Gates Implementation (Level 1)

  • Husky & lint-staged: Configured Git hooks to prevent commits that do not comply with linting rules.
  • ESLint & Prettier: Standardized global code style and basic static analysis for TypeScript across the entire workspace.
  • Pre-commit: Code is now automatically formatted and verified before every commit.

3. CI/CD Pipeline Update

  • GitHub Actions: Updated the deploy.yml workflow to support the new folder structure.
  • YAML Hotfixes: Resolved mapping and syntax errors in the GitHub Pages deployment pipeline.

4. Git Hygiene

  • Gitignore: Updated to ignore tool caches (Vitest, VitePress cache, Husky) across multiple folder levels.

5. Static Analysis with SonarQube

  • Integration: Added sonar-project.properties to the root for multi-package analysis.
  • Automation: Integrated SonarCloud Scan into the GitHub Actions pipeline.
  • Security: Established deep code scanning for vulnerabilities, code smells, and security hotspots.

Key Technical Decisions

  • Monorepo vs. Polyrepo: Opted for a Monorepo to maximize AI context and reduce maintenance overhead for a solo developer.
  • Fail Fast: Quality validation is now performed locally (pre-commit) instead of relying solely on the remote CI.