Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/operations/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions knip.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading