TypeScript
ci: reject unused tailscale exports with Knip (#10012)
Julius Marmingecd92a7e7ae68
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex c6d07c65304..4bcb1e21ab9 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -45,8 +45,8 @@ jobs:- name: Ensure Electron runtime is installedrun: vp run --filter @t3tools/desktop ensure:electron- # Export cleanup is still a manual audit; files and dependencies have no baseline.- - name: Check unused files and dependencies+ # Files/dependencies are repo-wide; export checks cover clean workspaces only.+ - name: Check unused coderun: vp run knip:check- name: Checkdiff --git a/docs/operations/development.md b/docs/operations/development.mdindex d415badb61d..de5c6c64e3a 100644--- a/docs/operations/development.md+++ b/docs/operations/development.md@@ -71,10 +71,12 @@ Windows investigation while that suite is not a required gate.### Unused code-`vp run knip:check` runs the unused-file and dependency check enforced by CI.+`vp run knip:check` checks unused files and dependencies across the repo, then+unused exports and types in `packages/tailscale`. CI enforces both checks.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 CI gate. Review callers before+The full export audit still has findings and is not a repo-wide CI gate. Extend the+export check's workspace selectors as more workspaces become clean. Review callers beforedeleting code; production mode can also report development scripts and test fixtures.Runtime-discovered entrypoints and dependency exceptions belong in [knip.jsonc](../../knip.jsonc).diff --git a/package.json b/package.jsonindex 20f3f30837b..2882a1f9ab7 100644--- a/package.json+++ b/package.json@@ -26,7 +26,7 @@"tc": "vp run -r --concurrency-limit 2 typecheck","lint": "vp lint --report-unused-disable-directives","knip": "knip",- "knip:check": "knip --include files,dependencies --no-config-hints",+ "knip:check": "knip --include files,dependencies --no-config-hints && knip --workspace packages/tailscale --exports --no-config-hints","knip:production": "knip --production","lint:mobile": "node scripts/mobile-native-static-check.ts","test": "vp run -r test",