test(arch): layering + cycle guard (dependency-cruiser) with current-violation allowlist

Encode the feature-folder layering contract as a CI gate: lib is the floor,
store/ui must not import features/app, cross-feature only via the barrel, no
cycles. dependency-cruiser resolves the @/ alias via tsconfig; tests excluded.

Land as a ratchet: the 738 current violations are seeded into
.dependency-cruiser-known-violations.json and ignored via --ignore-known, so
HEAD is green and any NEW violation fails CI. Regenerate the baseline as the
drain removes an exception; the count is the tracked residual debt.

Wired via `npm run dep:check` into a new dependency-cruiser job in eslint.yml
and the ci-ok required-check aggregate.
This commit is contained in:
Psychotoxical
2026-07-01 11:14:48 +02:00
parent 57811f2b3f
commit 47f2883ca2
6 changed files with 55752 additions and 4 deletions
+2 -1
View File
@@ -4,7 +4,7 @@
*/
const FRONTEND_PATH_RE =
/^(src\/|package\.json$|package-lock\.json$|vitest\.config\.ts$|vite\.config\.ts$|tsconfig\.json$|eslint\.config\.mjs$|\.github\/workflows\/frontend-tests\.yml$|\.github\/workflows\/eslint\.yml$|\.github\/frontend-hot-path-files\.txt$|scripts\/check-frontend-hot-path-coverage\.sh$|scripts\/check-css-import-graph\.mjs$)/;
/^(src\/|package\.json$|package-lock\.json$|vitest\.config\.ts$|vite\.config\.ts$|tsconfig\.json$|eslint\.config\.mjs$|\.dependency-cruiser\.cjs$|\.dependency-cruiser-known-violations\.json$|\.github\/workflows\/frontend-tests\.yml$|\.github\/workflows\/eslint\.yml$|\.github\/frontend-hot-path-files\.txt$|scripts\/check-frontend-hot-path-coverage\.sh$|scripts\/check-css-import-graph\.mjs$)/;
const RUST_PATH_RE = /^(src-tauri\/|\.github\/workflows\/rust-tests\.yml$)/;
@@ -13,6 +13,7 @@ const FRONTEND_JOBS = [
'tsc --noEmit',
'vitest --coverage (baseline + hot-path file gate)',
'eslint',
'dependency-cruiser',
];
const RUST_JOBS = [
+17
View File
@@ -11,6 +11,8 @@ on:
- 'vite.config.ts'
- 'tsconfig.json'
- 'eslint.config.mjs'
- '.dependency-cruiser.cjs'
- '.dependency-cruiser-known-violations.json'
- '.github/workflows/eslint.yml'
- '.github/frontend-hot-path-files.txt'
- 'scripts/check-frontend-hot-path-coverage.sh'
@@ -25,6 +27,8 @@ on:
- 'vite.config.ts'
- 'tsconfig.json'
- 'eslint.config.mjs'
- '.dependency-cruiser.cjs'
- '.dependency-cruiser-known-violations.json'
- '.github/workflows/eslint.yml'
- '.github/frontend-hot-path-files.txt'
- 'scripts/check-frontend-hot-path-coverage.sh'
@@ -47,3 +51,16 @@ jobs:
- run: npm ci
- name: eslint
run: npm run lint
dependency-cruiser:
name: dependency-cruiser
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'npm'
- run: npm ci
- name: layering + cycle guard
run: npm run dep:check