Skip to content

Commit 78ed671

Browse files
ci: enforce unused runtime exports in the web app
1 parent ce43c55 commit 78ed671

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎docs/operations/development.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,13 @@ Windows investigation while that suite is not a required gate.
7272
### Unused code
7373

7474
`vp run knip:check` checks unused files and dependencies across the repo, then
75-
unused runtime exports in every internal package under `packages/`. CI enforces both checks.
75+
unused runtime exports in `apps/web` and every internal package under `packages/`.
76+
CI enforces both checks.
7677
Exported types and Effect schemas are allowed without consumers. The schema preprocessor
7778
recognizes schema types, including aliases and schema classes; functions that create or decode
7879
schemas remain checked. Completely unused files remain checked too.
80+
Named exports in web UI component modules are kept as complete component sets. Knip ignores
81+
unused exports in `apps/web/src/components/ui/*.tsx`, while still reporting an entire unused file.
7982
Use `vp run knip --workspace apps/web` to audit one workspace, including exports,
8083
or `vp run knip:production --workspace apps/web` to find code kept alive only by tests.
8184
The full export audit still has findings and is not a repo-wide CI gate. Extend the

‎knip.jsonc‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
"apps/web": {
4444
// Worktree setup invokes this directly from t3.json.
4545
"entry": ["scripts/warm-dep-cache.ts"],
46+
// UI component modules are copied and adapted as cohesive sets. Keep their
47+
// named subcomponents even before they have callers; the file audit still
48+
// reports an entire component module when nothing imports it.
49+
"ignoreIssues": { "src/components/ui/*.tsx": ["exports", "nsExports", "duplicates"] },
4650
},
4751
"apps/mobile": {
4852
// Expo loads local config plugins by string; Metro handles platform variants.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"tc": "vp run -r --concurrency-limit 2 typecheck",
2727
"lint": "vp lint --report-unused-disable-directives",
2828
"knip": "knip --preprocessor ./scripts/knip-schemas.ts",
29-
"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",
29+
"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",
3030
"knip:production": "knip --production --preprocessor ./scripts/knip-schemas.ts",
3131
"lint:mobile": "node scripts/mobile-native-static-check.ts",
3232
"test": "vp run -r test",

0 commit comments

Comments
 (0)