authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 22:07:29-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 22:07:29-07:00
logda2ba5b81f8be6afc6d54e728bf4ac8781f3ab1c
tree9f1cc754f8d1dbad274fb46d3e6e4bf432cf1f3b
parent1200f530bdc8be25ca1c85affa42b6d9c259601c
signature Signed by PGP key B5690EEEBB952194

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


3 files changed, 9 insertions(+), 2 deletions(-)

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