A modular, extensible, and future-ready toolkit for defining, adapting, and sharing static analysis rules across projects in the `manager` monorepo.
npm install @ovh-ux/manager-static-analysis-kitA modular, extensible, and future-ready toolkit for defining, adapting, and sharing static and dynamic analysis rules across projects in the Manager monorepo.
---
@ovh-ux/manager-static-analysis-kit provides a unified framework for code quality automation across all applications, libraries, and modules โ covering both static (lint, duplication, type coverage) and dynamic (tests, performance) checks.
It separates semantic rule definitions from tool-specific adapters to ensure configurability, reusability, and long-term consistency across the monorepo.
---
The kit currently provides:
- ESLint (flat config, adapters for React, TS, a11y, imports, naming, Storybook, Tailwind, TanStack, Vitest)
- Code Duplication Reports (manager-code-duplication)
- Performance Budgets (manager-perf-budgets)
- Tests Coverage Reports (manager-tests-coverage)
- Types Coverage Reports (manager-types-coverage)
- W3C & A11Y Unit Tests Matchers (expect(container).toBeAccessible(), await expect(html).toBeValidHtml())
Coming soon:
- Madge (dependency graph & circular analysis)
- Code Health Meter (complexity, Halstead, maintainability, SLOC)
> Each tool has its own README inside the kit with full usage & configuration details.
> See:
> - Code Duplication
> - Performance Budgets
> - Tests Coverage
> - Types Coverage
> - HTML Validation
> - Accessibility Validation
---
The kit also provides a single entrypoint for running all static & dynamic quality checks:
``bashRun all quality checks
yarn manager-static-dynamic-quality-checks
---
๐ง Launch Modes
Each CLI (e.g.
manager-code-duplication, manager-types-coverage) supports flexible launch modes for targeting different scopes within the monorepo.| Flag | Target | Path Resolution |
|------|---------|----------------|
|
--apps / --app | Manager applications | manager/apps/* |
| --packages / --package | Package-level analysis | Resolves via package.json |
| --libraries / --library | Internal libraries | packages/manager/core, packages/manager/modules, packages/components |---
$3
`bash
yarn manager-types-coverage --apps zimbra,container
`or single app:
`bash
yarn manager-types-coverage --app zimbra
`> Here you provide app folders located under
manager/apps.---
$3
`bash
yarn manager-types-coverage --packages @ovh-ux/manager-container-app,@ovh-ux/manager-zimbra-app
`or single package:
`bash
yarn manager-types-coverage --package @ovh-ux/manager-container-app
`> In this mode:
> - The CLI resolves the package names to their corresponding apps.
> - Reports are generated per app folder.
---
$3
`bash
yarn manager-types-coverage --libraries @ovh-ux/manager-wiki,@ovh-ux/muk
`or single library:
`bash
yarn manager-types-coverage --library @ovh-ux/muk
`> In this mode:
> - The CLI resolves the library names to their corresponding folders inside configured library roots:
> -
packages/manager-react-components/*
> - packages/manager-wiki/*
> - Reports are generated per library folder.---
โ ๏ธ Important Requirements
โ ๏ธ Important:
These analysis tools only process React-based applications and libraries โ Angular or legacy frameworks are not supported.
Each analysis type has specific requirements to run successfully:
| Analysis Type | Required Configuration | Description |
|----------------|-------------------------|--------------|
| Type Coverage |
tsconfig.json | The tool analyzes only TypeScript projects with a valid configuration file. |
| Tests Coverage | Vitest or Jest setup | Requires test files (.test.ts[x], .spec.ts[x]) and a working Vitest/Jest config. |
| Performance Budgets | vite.config.ts or vite.config.js | Requires a Vite-based build configuration to extract bundle metrics. |
| Code Duplication | React source files (.js, .ts, .tsx) | Automatically skips non-React or invalid modules. |> Modules that don't meet these conditions are skipped automatically with a warning, but the CLI will still analyze all valid React apps and libraries to ensure partial success in mixed environments.
---
๐งฑ Structure Overview
`
static-analysis-kit/
โโโ src/
โ โโโ code-analysis.ts # Central export point
โ โโโ configs/ # Tool-agnostic rule definitions
โ โโโ adapters/ # Tool integrations
โ โโโ eslint/
โ โโโ code-duplication/
โ โโโ perf-budgets/
โ โโโ tests-coverage/
โ โโโ types-coverage/
โ โโโ ts-config/
โ โโโ html-a11y-validation/
โ โโโ html-w3c-validation/
โ โโโ architecture-analysis/ # Coming soon
โโโ bin/
โ โโโ utils/ # Shared CLI utilities
โ โ โโโ args-parse-utils.js # CLI flags parsing (apps/libs/packages)
โ โ โโโ module-utils.js # Discovery and resolution logic
โ โ โโโ file-utils.js # JSON read/write helpers
โ โ โโโ log-utils.js # Colored CLI logging
โ โโโ cli-path-config.js # Centralized base paths & root dirs
โโโ README.md
`---
๐ง Design Principles
- Composable: Adapters are modular, rules are grouped by category.
- Decoupled: Semantic configs live separately from tool logic.
- Pluggable: Easy to add new tools (e.g., Biome, Oxlint).
- CI/CD Ready: All tools produce JSON + HTML reports for pipelines.
---
๐งช Validation & CLI Testing
Each CLI in the Static Analysis Kit (e.g.,
manager-code-duplication, manager-perf-budgets, manager-tests-coverage, manager-types-coverage) includes automated validation suites that ensure correct argument parsing, module discovery, and exit-code semantics.These tests simulate real-world usage across apps, packages, and libraries โ both valid and invalid โ to guarantee stability and predictable CLI behavior.
To execute these tests, from the root run:
`bash
yarn static-dynamic-quality-check-tests
`---
$3
| Category | Example Command | Expected Exit |
|-----------|----------------|----------------|
| Single app |
yarn manager-code-duplication --app zimbra | โ
0 |
| Multiple apps | yarn manager-code-duplication --apps container,zimbra | โ
0 |
| Single package | yarn manager-code-duplication --package @ovh-ux/manager-container-app | โ
0 |
| Multiple packages | yarn manager-code-duplication --packages @ovh-ux/manager-zimbra-app,@ovh-ux/manager-pci-workflow-app | โ
0 |
| Single library (static) | yarn manager-code-duplication --library manager-react-components | โ
0 |
| Single library (dynamic) | yarn manager-code-duplication --library shell-client | โ
0 |
| Multiple libraries | yarn manager-code-duplication --libraries manager-wiki,manager-react-components,shell-client | โ
0 |
| Mixed valid + invalid apps | yarn manager-code-duplication --apps zimbra,unknown-app,container | โ
0 |
| All invalid apps | yarn manager-code-duplication --apps doesnotexist1,doesnotexist2 | โ 1 |
| Turbo build simulation | yarn manager-code-duplication --app pci-ai-tools | โ
0 |> ๐งฉ Each case asserts CLI correctness, exit codes, and resilience against unknown modules.
---
$3
| CLI | Purpose |
|-----|----------|
|
manager-code-duplication | Detects duplicated code across apps and libs |
| manager-perf-budgets | Evaluates bundle and asset sizes |
| manager-tests-coverage | Aggregates Jest/Vitest coverage reports |
| manager-types-coverage | Reports TypeScript type coverage |Each CLI supports:
-
--apps / --app
- --packages / --package
- --libraries / --library`---
The Static Analysis Kit aims to become the central standard for static and dynamic quality assurance across all OVHcloud Manager projects.
We welcome contributions that:
- Add new analyzers or integrations
- Improve performance or modularity
- Enhance developer experience or CI/CD compatibility
๐ก Goal: A composable, maintainable, and organization-wide framework for modern code quality governance.
---
ยฉ 2025 OVHcloud โ Manager Engineering Team