chore: introduce knip dead-code detection - #242
Merged
Conversation
✅ knip — no dead codeNo unused files, exports, types, or dependencies detected. |
iamfj
marked this pull request as ready for review
July 2, 2026 11:36
Add knip to detect unused files, exports, types, and dependencies, and remove the dead code it surfaced. - Add knip.json (ignore generated src/gql, semantic-release plugins used only in .releaserc.cjs) plus knip/knip:ci npm scripts. - Add a required "Detect Dead Code" PR job that posts a self-updating sticky comment and fails on findings. - Remove dead code: extractEmbeds/EmbedInfo/stripCodeContexts from embed-parser, and un-export extractDocumentIdFromUrl, PageInfo, and declaredVariableNames (used only within their own files). - Drop unused @graphql-codegen/introspection and schema-ast dev deps. - Document the workflow in AGENTS.md and docs, and fix the stale dependency table in docs/build-system.md.
iamfj
force-pushed
the
introduce-knip-dead-code
branch
from
July 2, 2026 11:39
fdf9a0b to
43a9e1b
Compare
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 does this PR do?
Introduces knip to detect unused files, exports, types, and dependencies, wires it in as a required PR check, and removes the dead code it surfaced. It adds
knip.jsonplusknip/knip:ciscripts, a "Detect Dead Code" CI job that posts a self-updating sticky comment and fails on findings, removes dead code (extractEmbeds/EmbedInfo/stripCodeContextsand now-internalextractDocumentIdFromUrl/PageInfo/declaredVariableNames), drops the unused@graphql-codegen/introspectionand@graphql-codegen/schema-astdev deps, and documents the workflow (fixing a stale dependency table indocs/build-system.md).Type of change
Checklist
npm run check:cipasses (lint + format)npx tsc --noEmitpasses (type check)npm testpasses (unit tests)Testing
Ran
npm run check:ci,npx tsc --noEmit,npm test(762 tests pass),npm run knip(exit 0, clean), andnpm run generate(exit 0, no drift insrc/gql/) to confirm the removed codegen plugins are genuinely unused across the build/codegen lifecycle.Notes for reviewers
The
knipjob runs on PRs only (needs a PR to comment on); the other checks run on every push and PR. No new runtime code was added, so no new tests were needed. No linked issue.