Conversation
Adds knip configuration modeled after resend/resend's setup: - Workspace-aware entry points for apps/demo emails, benchmarks, playground - Ignores dynamically loaded files (web components, illustrations, templates, test fixtures) - Ignores examples/ (not part of the pnpm workspace) - ignoreDependencies for CLI-only packages (@react-email/preview-server, react-email) - Excludes duplicates check https://claude.ai/code/session_01GfiVQQmYrTHoxDzPc4whk7
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
1 issue found across 3 files
Confidence score: 4/5
- This PR looks safe to merge overall, with a limited risk profile because the noted issue is in tooling configuration rather than runtime behavior.
- In
knip.json, usingignorecan mask findings in those paths while still keeping them in Knip’s graph, which may let dead code slip past detection when only examples/tests reference it. - The impact is mainly code-health and maintenance visibility (moderate severity), not an immediate functional regression for users.
- Pay close attention to
knip.json- adjust ignore behavior so unused-code reporting isn’t unintentionally suppressed.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="knip.json">
<violation number="1" location="knip.json:8">
P2: Using `ignore` here will hide findings in those paths without removing them from Knip's graph, so example/test-only usages can keep dead code from being reported.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Using `ignore` removes files from knip's graph entirely, which can mask dead code — if a test fixture or template is the only consumer of an export, that export stays alive and won't be reported as unused. Replace ignore entries for workspace-internal files (test fixtures, templates, seed data, e2e apps, dynamically-loaded components) with workspace-specific entry patterns, reserving `ignore` only for truly out-of-scope paths (examples/ and static public assets). As a side-effect, @vitejs/plugin-react is no longer reported as an unused devDependency because the e2e/vite workspace entry now resolves its usage in vite.config.ts. https://claude.ai/code/session_01GfiVQQmYrTHoxDzPc4whk7
**Deleted dead files (12):**
- apps/web/src/webgl/materials/MeshBannerMaterial.ts
- benchmarks/preview-server/src/utils/{run-server-and-fetch-preview-page,sleep}.ts
- packages/preview-server/src/components/icons/{icon-bug,icon-email,icon-image,icon-link,icon-phone,icon-stamp}.tsx
- packages/preview-server/src/components/toolbar/{checking-results,results-table}.tsx
- packages/tailwind/src/utils/compatibility/unescape-class.ts
**Removed unused dependencies across packages:**
- Root: @actions/http-client, @octokit/core, nypm, rollup, vite
- apps/demo: react-dom, next (devDep)
- apps/docs: zod
- apps/web: @babel/preset-typescript, @types/babel__core, webpack
- benchmarks/preview-server: tsconfig
- packages/code-block, code-inline: @react-email/render (devDep)
- packages/create-email: react (devDep)
- packages/preview-server: @babel/core, @radix-ui/colors,
@radix-ui/react-dropdown-menu, @types/babel__core, @types/fs-extra,
@types/mime-types, @types/normalize-path, @types/webpack, sharp
- packages/react-email: @types/babel__core, tsx
- packages/render: @edge-runtime/vm
**Added missing dependency:**
- apps/web: jsdom (required by vitest environment config)
**Fixed playground dependencies:**
- Replace unused @react-email/render + react-dom with @react-email/components
**Removed unused exports:**
- Made internal: getImportedComponent, TooltipRoot, PreviewContext,
writtenMemberExpressionTo, mapResult, isEmailTemplate,
ResendStatus, TooltipProps, MeshImageMaterial, GooglePlayPolicyUpdate*
- Removed unused default export from stripe-welcome-email test fixture
**Added @lintignore to public API exports:**
- packages/tailwind: inlineStyles, pixelBasedPreset, TailwindSetup
**Updated knip.json:**
- Add workspace ignoreDependencies for e2e/template unlisted deps
- Add packages/tsconfig workspace to ignore next peer dep
- Suppress optionalPeerDependencies section (tailwind's optional peers
are intentionally referenced in e2e tests)
**Removed unused catalog entries from pnpm-workspace.yaml:**
- @react-email/components, @scaleway/sdk, @types/babel__core
https://claude.ai/code/session_01GfiVQQmYrTHoxDzPc4whk7
@react-email/code-block
@react-email/code-inline
create-email
@react-email/preview-server
react-email
@react-email/render
@react-email/tailwind
commit: |
Description
This PR adds knip to the repository for detecting and managing unused files, dependencies, and exports across the monorepo.
Changes
knip.jsonconfiguration file with:knipscript topackage.jsonfor easy CLI accessknip(v5.75.2) as a dev dependencyConfiguration Highlights
The knip configuration is tailored for this monorepo with:
@react-email/preview-server,react-email) marked as ignored dependencies to avoid false positivesTest Plan
N/A - Configuration addition. Run
pnpm knipto verify the setup works correctly.https://claude.ai/code/session_01GfiVQQmYrTHoxDzPc4whk7
Summary by cubic
Adds
knipto detect unused files, exports, and dependencies across the monorepo, wires it into CI, and cleans up issues it flagged (dead files, unused deps, and stray exports).New Features
ignoreonly forexamples/**andapps/web/public/**.@react-email/preview-serverandreact-email.pnpm knip.knipscript and dev dependencyknip@5.75.2.Refactors
jsdomtoapps/web; simplified playground deps.getImportedComponent,TooltipRoot,PreviewContext,MeshImageMaterial, helper functions); dropped an unused default export in a test fixture.@lintignoreJSDoc to select public API exports inpackages/tailwind.pnpm-workspace.yaml.Written for commit f20eae2. Summary will update on new commits.