ci: enforce unused runtime exports in the web app (#10228)

This commit is contained in:
Julius Marminge authored and GitHub committed 2026-09-05 22:07:29 -07:00
1 parent 1200f530bd
commit da2ba5b81f
3 files changed
+9 -2

No files matched your search

+4 -1
View File
@@ -72,10 +72,13 @@ Windows investigation while that suite is not a required gate.
### Unused code
`vp run knip:check` checks unused files and dependencies across the repo, then
unused runtime exports in every internal package under `packages/`. CI enforces both checks.
unused runtime exports in `apps/web` and every internal package under `packages/`.
CI enforces both checks.
Exported types and Effect schemas are allowed without consumers. The schema preprocessor
recognizes schema types, including aliases and schema classes; functions that create or decode
schemas remain checked. Completely unused files remain checked too.
Named exports in web UI component modules are kept as complete component sets. Knip ignores
unused exports in `apps/web/src/components/ui/*.tsx`, while still reporting an entire unused file.
Use `vp run knip --workspace apps/web` to audit one workspace, including exports,
or `vp run knip:production --workspace apps/web` to find code kept alive only by tests.
The full export audit still has findings and is not a repo-wide CI gate. Extend the
+4
View File
@@ -43,6 +43,10 @@
"apps/web": {
// Worktree setup invokes this directly from t3.json.
"entry": ["scripts/warm-dep-cache.ts"],
// UI component modules are copied and adapted as cohesive sets. Keep their
// named subcomponents even before they have callers; the file audit still
// reports an entire component module when nothing imports it.
"ignoreIssues": { "src/components/ui/*.tsx": ["exports", "nsExports", "duplicates"] },
},
"apps/mobile": {
// Expo loads local config plugins by string; Metro handles platform variants.
+1 -1
View File
@@ -26,7 +26,7 @@
"tc": "vp run -r --concurrency-limit 2 typecheck",
"lint": "vp lint --report-unused-disable-directives",
"knip": "knip --preprocessor ./scripts/knip-schemas.ts",
"knip:check": "knip --include files,dependencies --no-config-hints && knip --workspace packages/client-runtime --workspace packages/contracts --workspace packages/effect-acp --workspace packages/effect-codex-app-server --workspace packages/shared --workspace packages/ssh --workspace packages/tailscale --exports --preprocessor ./scripts/knip-schemas.ts --no-config-hints",
"knip:check": "knip --include files,dependencies --no-config-hints && knip --workspace apps/web --workspace packages/client-runtime --workspace packages/contracts --workspace packages/effect-acp --workspace packages/effect-codex-app-server --workspace packages/shared --workspace packages/ssh --workspace packages/tailscale --exports --preprocessor ./scripts/knip-schemas.ts --no-config-hints",
"knip:production": "knip --production --preprocessor ./scripts/knip-schemas.ts",
"lint:mobile": "node scripts/mobile-native-static-check.ts",
"test": "vp run -r test",