authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-04 23:52:53-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-04 23:52:53-07:00
logd2c3e2e5d7360b5d87f7516bdbce46b5c5444ef4
tree8530ebf31ef76b985e111537d3e6006662568c6a
parent00d46188bedfae81a5d219c8eba4b63e8cf90036
signature Signed by PGP key B5690EEEBB952194

ci: reject unused files and dependencies with Knip (#9962)


3 files changed, 14 insertions(+), 0 deletions(-)

.github/workflows/ci.yml+4
...@@ -45,6 +45,10 @@ jobs:...@@ -45,6 +45,10 @@ 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.
49 - name: Check unused files and dependencies
50 run: vp run knip:check
51
48 - name: Check52 - name: Check
49 run: vp check53 run: vp check
5054
docs/operations/development.md+9
...@@ -69,6 +69,15 @@ Use `vp run lint:mobile` for native mobile changes. CI owns the full suite; see...@@ -69,6 +69,15 @@ Use `vp run lint:mobile` for native mobile changes. CI owns the full suite; see
69The [manual Windows lane](../../.github/workflows/windows-tests.yml) is available for focused69The [manual Windows lane](../../.github/workflows/windows-tests.yml) is available for focused
70Windows investigation while that suite is not a required gate.70Windows investigation while that suite is not a required gate.
7171
72### Unused code
73
74`vp run knip:check` runs the unused-file and dependency check enforced by CI.
75Use `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.
77The full export audit still has findings and is not a CI gate. Review callers before
78deleting code; production mode can also report development scripts and test fixtures.
79Runtime-discovered entrypoints and dependency exceptions belong in [knip.jsonc](../../knip.jsonc).
80
72## Desktop artifacts81## Desktop artifacts
7382
74Local artifact builds are unsigned by default and write to `release/`:83Local artifact builds are unsigned by default and write to `release/`:
package.json+1
...@@ -26,6 +26,7 @@...@@ -26,6 +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:production": "knip --production",30 "knip:production": "knip --production",
30 "lint:mobile": "node scripts/mobile-native-static-check.ts",31 "lint:mobile": "node scripts/mobile-native-static-check.ts",
31 "test": "vp run -r test",32 "test": "vp run -r test",