Skip to content

Check unused files and dependencies with Knip - #1546

Merged
manudeli merged 3 commits into
mainfrom
chore/add-knip-ci
Nov 22, 2026
Merged

manudeli merged 3 commits into
mainfrom
chore/add-knip-ci

Conversation

@manudeli

@manudeli manudeli commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add pnpm knip and run it after dependency installation in the PR workflow.
  • Configure the site, Cloudflare Workers, and Electron entry points. Record existing findings so CI can fail when new unused files or dependencies appear.
  • Keep the two findings tracked in Remove unused ShopHero3D and direct maath dependency #1541 in the initial baseline while that cleanup is open.

Verification

  • pnpm knip and frozen lockfile validation passed locally.
  • An unreferenced component and the direct dependency it alone imported caused Knip to report both and exit with code 1.
  • With the two Remove unused ShopHero3D and direct maath dependency #1541 baseline entries removed locally, Knip reported both ShopHero3D.tsx and maath.

Summary by CodeRabbit

  • Chores
    • Pull request checks now include an additional codebase analysis step, helping identify unused files and dependencies before changes are merged.
    • Added configuration for analyzing the application and desktop project, along with a command for running the analysis locally.

@manudeli
manudeli requested a review from a team November 22, 2026 16:01
@changeset-bot

changeset-bot Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 935d0c4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request adds Knip configuration for root and desktop workspaces, adds a package script and development dependency, and runs Knip in the pull request workflow before the build.

Changes: Knip CI Check

Layer / File(s) Summary
Knip configuration and command
knip.jsonc, package.json
Adds root and desktop workspace analysis settings, file and dependency exclusions, a Knip script, and the Knip development dependency.
Pull request workflow check
.github/workflows/pr.yml
Runs Knip after tool setup and before the build.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: tannerlinsley

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@socket-security

socket-security Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedknip@​6.32.0991009596100

View full report

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Asset Main PR merge build Change
JavaScript 19611.48 KiB 19611.48 KiB 0.00 KiB (0.00%)
JavaScript (gzip) 6451.84 KiB 6451.42 KiB 🟢 -0.42 KiB (-0.01%)
CSS 795.12 KiB 795.12 KiB 0.00 KiB (0.00%)
CSS (gzip) 121.73 KiB 121.73 KiB 0.00 KiB (0.00%)
Page Main (gzip) PR merge build (gzip) Change
/ 594.12 KiB 594.12 KiB 🟢 -0.00 KiB (-0.00%)
/libraries 536.79 KiB 536.81 KiB 🔴 +0.02 KiB (+0.00%)
/start/latest 561.58 KiB 561.58 KiB 🔴 +0.00 KiB (+0.00%)
/router/latest 561.88 KiB 561.88 KiB 🟢 -0.00 KiB (-0.00%)
/query/latest 560.33 KiB 560.34 KiB 🔴 +0.02 KiB (+0.00%)
/table/latest 593.14 KiB 593.15 KiB 🔴 +0.01 KiB (+0.00%)
/charts/latest 642.44 KiB 642.46 KiB 🔴 +0.01 KiB (+0.00%)
/ai/latest 587.26 KiB 587.26 KiB 🟢 -0.00 KiB (-0.00%)
Docs article 547.84 KiB 547.87 KiB 🔴 +0.02 KiB (+0.00%)
Framework docs article 547.85 KiB 547.87 KiB 🔴 +0.03 KiB (+0.00%)
/blog 541.00 KiB 541.01 KiB 🔴 +0.01 KiB (+0.00%)
/maintainers 540.08 KiB 540.10 KiB 🔴 +0.02 KiB (+0.00%)
/showcase 538.04 KiB 538.07 KiB 🔴 +0.02 KiB (+0.00%)
/chat 536.85 KiB 536.88 KiB 🔴 +0.02 KiB (+0.00%)
/chat/c/:conversationId 536.99 KiB 537.02 KiB 🔴 +0.02 KiB (+0.00%)

Page sizes sum the JS and CSS in the TanStack Start manifest for each route and its layouts. Shared files count once per page.

Compared with main at 03a41f0. Gzip sizes are summed per file. Build run

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
🔵 In progress
View logs
tanstack-com 5f9f571 Nov 22 2026, 04:02 PM

@manudeli
manudeli merged commit 0a7d36b into main Nov 22, 2026
9 of 10 checks passed
@manudeli
manudeli deleted the chore/add-knip-ci branch November 22, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants