authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 00:42:26-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 00:42:26-07:00
logcd92a7e7ae68a9b0c01938e1f69c2044b6c455ac
treee9777dfbe0424bf48ceb0dca9e4e88dfe7610a91
parent1d58f2ecc4b2f6cea9897dcf46734af6210d053e
signature Signed by PGP key B5690EEEBB952194

ci: reject unused tailscale exports with Knip (#10012)


3 files changed, 7 insertions(+), 5 deletions(-)

.github/workflows/ci.yml+2-2
...@@ -45,8 +45,8 @@ jobs:...@@ -45,8 +45,8 @@ jobs:
45 - name: Ensure Electron runtime is installed45 - name: Ensure Electron runtime is installed
46 run: vp run --filter @t3tools/desktop ensure:electron46 run: vp run --filter @t3tools/desktop ensure:electron
4747
48 # Export cleanup is still a manual audit; files and dependencies have no baseline.48 # Files/dependencies are repo-wide; export checks cover clean workspaces only.
49 - name: Check unused files and dependencies49 - name: Check unused code
50 run: vp run knip:check50 run: vp run knip:check
5151
52 - name: Check52 - name: Check
docs/operations/development.md+4-2
...@@ -71,10 +71,12 @@ Windows investigation while that suite is not a required gate....@@ -71,10 +71,12 @@ Windows investigation while that suite is not a required gate.
7171
72### Unused code72### Unused code
7373
74`vp run knip:check` runs the unused-file and dependency check enforced by CI.74`vp run knip:check` checks unused files and dependencies across the repo, then
75unused exports and types in `packages/tailscale`. CI enforces both checks.
75Use `vp run knip --workspace apps/web` to audit one workspace, including exports,76Use `vp run knip --workspace apps/web` to audit one workspace, including exports,
76or `vp run knip:production --workspace apps/web` to find code kept alive only by tests.77or `vp run knip:production --workspace apps/web` to find code kept alive only by tests.
77The full export audit still has findings and is not a CI gate. Review callers before78The full export audit still has findings and is not a repo-wide CI gate. Extend the
79export check's workspace selectors as more workspaces become clean. Review callers before
78deleting code; production mode can also report development scripts and test fixtures.80deleting code; production mode can also report development scripts and test fixtures.
79Runtime-discovered entrypoints and dependency exceptions belong in [knip.jsonc](../../knip.jsonc).81Runtime-discovered entrypoints and dependency exceptions belong in [knip.jsonc](../../knip.jsonc).
8082
package.json+1-1
...@@ -26,7 +26,7 @@...@@ -26,7 +26,7 @@
26 "tc": "vp run -r --concurrency-limit 2 typecheck",26 "tc": "vp run -r --concurrency-limit 2 typecheck",
27 "lint": "vp lint --report-unused-disable-directives",27 "lint": "vp lint --report-unused-disable-directives",
28 "knip": "knip",28 "knip": "knip",
29 "knip:check": "knip --include files,dependencies --no-config-hints",29 "knip:check": "knip --include files,dependencies --no-config-hints && knip --workspace packages/tailscale --exports --no-config-hints",
30 "knip:production": "knip --production",30 "knip:production": "knip --production",
31 "lint:mobile": "node scripts/mobile-native-static-check.ts",31 "lint:mobile": "node scripts/mobile-native-static-check.ts",
32 "test": "vp run -r test",32 "test": "vp run -r test",