Repository navigation
chore: typecheck incrementally and cache Knip results - #232
Merged
Merged
Conversation
tsc keeps its build info in node_modules/.cache/tsc and Knip runs with --cache (node_modules/.cache/knip). A repeat run checks only what changed: locally, `bun run typecheck` takes 0.7 s instead of 3.4 s and `bun run check:knip` 0.6 s instead of 1.8 s. The pre-commit hook runs the typecheck on every commit. With a warm state, a type error and an unused file still fail the checks. CI doesn't change. Fresh runners start empty, and filling the state costs nothing measurable. On GitHub-hosted runners an actions/cache restore (1.0-1.5 s) costs more than these steps take, so none is added. The self-hosted runner would gain about 5 s per main run if devkit's ci-bun kept these two dirs between runs; that is proposed to devkit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Sergey asked for caches wherever simply turning one on helps. I measured every candidate on real CI runs. The only one that pays today is local, so this PR turns on just that one:
tsconfig.json:incrementalwith the build info innode_modules/.cache/tsc.check:knip:knip --cache(state innode_modules/.cache/knip).A repeat run checks only what changed. Locally, best of 3 at load ~30:
bun run typecheckbun run check:knipThe pre-commit hook runs the typecheck on every commit. With warm state, an added type error still fails
typecheck, and an added unused file still failscheck:knip.CI doesn't change. Fresh runners start empty, and filling the state costs nothing measurable. These were measured and rejected:
actions/cacheon GitHub-hosted runners: a restore costs 1.0–1.5 s even for 52 KB, more than the steps it would shorten.bun install.mainthe self-hosted runner already keeps both between runs. On PRs the transpiler cache warms within the run, so carrying it over saves nothing measurable.mainrun (tsc 3–4 s, Knip 2 s) if devkit'sci-bunkept these two dirs between runs. That is proposed to devkit separately.How I checked it
bun run check, and the error checks above.Tests pass locally and use made-up data only
README, docs and affected demos follow the product content standard
Title follows the repo's commit style: Conventional Commits (
feat: …,fix: …) unlessAGENTS.mdsays otherwise🤖 Generated with Claude Code