Add Knip config and initial dead-code cleanup - #4293
Merged
Conversation
Collaborator
📊 Performance Test ResultsComparing c86dd49 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
# Conflicts: # apps/studio/src/modules/add-site/components/blueprints.tsx # apps/studio/src/modules/add-site/components/import-backup.tsx
epeicher
approved these changes
Jul 23, 2026
epeicher
left a comment
Contributor
There was a problem hiding this comment.
Thanks for adding this @wojtekn! The CI passes as expected, and the knip report is generated fine. I have tested adding a site, importing from a backup, and adding a site using a blueprint and I have not found any issues. LGTM!
1 task
wojtekn
added a commit
that referenced
this pull request
Jul 27, 2026
## Related issues - N/A ## How AI was used in this PR Follow-up to #4293. Used Claude Code with [Knip](https://knip.dev) to identify unused UI code, then manually verified each finding had no references (including dynamic/string references and test mocks) before removing it. The Rive removal footprint (asset, test mock, dependency, and Vite bundling) was traced by hand. ## Proposed Changes Removes two pieces of dead UI code and their supporting infrastructure. No user-visible impact — neither was rendered anywhere. This trims an unused animation dependency and its WASM bundling, slightly reducing install and build surface. - Removes an unused SVG icon component that nothing referenced. - Removes the unused animated AI icon hook along with its Rive animation asset, its test mock, the `@rive-app/react-canvas` dependency, and the Rive-specific WASM copying in the Electron Vite config. ## Testing Instructions - `npm run typecheck` passes across all workspaces. - `npm test -- apps/studio` passes (684 tests) — confirms removing the `use-ai-icon` test mock had no fallout. - `npx knip` no longer reports the two icons, and `@rive-app/*` is fully gone from the dependency graph. - Smoke-test the app (especially the AI/assistant surfaces) to confirm no missing-icon regression ## Pre-merge Checklist - [x] Have you checked for TypeScript, React or other console errors?
1 task
wojtekn
added a commit
that referenced
this pull request
Jul 31, 2026
## Related issues - N/A ## How AI was used in this PR Third follow-up in the Knip dead-code cleanup series (after #4293 and #4313). Used Claude Code with [Knip](https://knip.dev) to surface unused files, then manually verified each one had no live references — carefully distinguishing genuinely-dead files from same-named symbols in other modules (e.g. a CLI `wordpress.ts` with identical export names, and a `SitesListContent` that lives in the non-classic selector). Only files with zero real importers were removed. ## Proposed Changes Removes the last batch of unused files Knip flagged. No user-visible impact — none of these were reachable. This clears the dead-code backlog so Knip now reports zero unused files. - Removes a sync-sites re-export barrel that nothing imported (its underlying hooks are imported directly and stay). - Removes an unused chain of WordPress download/version/setup helpers in the desktop app that only referenced each other; the CLI has its own equivalent implementations that are unaffected. - Removes a stale "classic" variant of the sync-sites modal selector that was superseded by the current selector. - Removes an unused Spinner component from the agentic UI. - Cleans up the now-orphaned test mocks that referenced the removed setup helper. ## Testing Instructions - `npm run typecheck` passes for both `studio-app` and `@studio/ui`. - `npm test -- apps/studio/src/tests/site-server.test.ts apps/studio/src/tests/ipc-handlers.test.ts apps/studio/src/modules/sync` passes (63 tests) — covers the areas whose test mocks were touched. - `npx knip` now reports zero unused files. - Smoke-test site creation and the sync "pull remote site" flow to confirm no regression. ## Pre-merge Checklist - [x] Have you checked for TypeScript, React or other console errors?
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.
Related issues
How AI was used in this PR
Used Claude Code with Knip to detect dead code and unused dependencies across the monorepo, then manually verified each finding (checking for dynamic/string-based references, deeplink handlers, and Navigator wiring) before removing anything. Only high-confidence, independently-verified removals are included here.
Proposed Changes
Introduces Knip as a dead-code and unused-dependency analysis tool for the monorepo, and lands the first, highest-confidence cleanup it surfaced. This has no user-visible impact — it removes code that was already unreachable — but it reduces maintenance surface and gives us a repeatable way to catch dead code going forward.
knip.jsontuned to this repo's non-standard entry points (Electron's main/preload builds, the CLI child-process daemons, theapps/uihosted/local Vite targets, migrations, and the buildscripts/), so runs produce a trustworthy signal rather than false positives.05-set-cli-user-uninstalled) that was byte-identical to the live06-set-cli-user-uninstalledand referenced by nothing.Further cleanups Knip surfaced will follow in separate, focused PRs.
Testing Instructions
npm run typecheckpasses.npm test -- apps/studio/src/lib/deeplink apps/studio/src/migrationspasses (44 tests) — covers the migration and add-site/deeplink areas adjacent to the removed code.npm run knipto see the current dead-code/dependency report.Pre-merge Checklist