-
-
Notifications
You must be signed in to change notification settings - Fork 638
Fix Knip configuration after monorepo restructure #2041
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
After the monorepo restructure that moved packages to packages/react-on-rails and packages/react-on-rails-pro, Knip was detecting false positives for unused files and dependencies. Changes: - Add jest.config.base.js as entry point (used by both packages) - Remove 'nps' from ignoreBinaries (no longer in package.json scripts) - Add test dependencies to root ignoreDependencies (shared by child workspaces) - Add mock-fs dependencies to Pro package ignoreDependencies - Remove dependencies that are now properly detected (@babel/runtime, mini-css-extract-plugin, css-loader, sass, sass-loader) This fixes the failing "Detect dead code" CI job on master. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
WalkthroughKnip configuration updated to refine dependency and binary handling across multiple workspaces. Root workspace now includes additional config files and excludes test dependencies. React-on-Rails Pro workspace adds mock-fs exclusions. Build-time and CSS-related entries removed from spec/dummy workspace. nps removed from root ignoreBinaries. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (4)📓 Common learnings📚 Learning: 2025-01-23T18:20:45.824ZApplied to files:
📚 Learning: 2025-09-16T08:01:11.146ZApplied to files:
📚 Learning: 2025-02-13T19:09:15.991ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (3)
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. Comment |
Code ReviewSummaryThis PR fixes Knip configuration issues after the monorepo restructure. The changes look good overall and address the false positives in dead code detection. ✅ Strengths
|
Code Review FeedbackThank you for working on fixing the Knip configuration after the monorepo restructure! I've reviewed the PR and have some feedback. Critical Issue:
|
Code Review: Fix Knip configuration after monorepo restructureSummaryThis PR correctly fixes the Knip configuration to eliminate false positives after the monorepo restructure that moved packages to packages/react-on-rails and packages/react-on-rails-pro. The changes are well-reasoned and properly categorized. Code Quality & Best PracticesStrengths:
Monorepo Workspace Understanding:The changes demonstrate proper understanding of Yarn workspaces:
Potential IssuesMinor: nps Still Used But Removed from ignoreBinaries Recommendation: Verify that removing nps from ignoreBinaries does not cause CI failures. If CI passes, this is correct. Test CoverageThe PR correctly notes that CI will validate the fix by running yarn run knip --exclude binaries. Final VerdictAPPROVED with minor verification needed on nps removal from ignoreBinaries. This is a well-crafted fix that demonstrates:
The changes align perfectly with the repository standards documented in CLAUDE.md. Great work! Review powered by Claude Code |
…uard * origin/master: Fix Knip configuration after monorepo restructure (#2041) Fix Pro package RuboCop violations (#2038) Fix CI to always run full test suite on master branch (#2035) # Conflicts: # .github/workflows/examples.yml # .github/workflows/gem-tests.yml # .github/workflows/integration-tests.yml # .github/workflows/lint-js-and-ruby.yml # .github/workflows/package-js-tests.yml # .github/workflows/playwright.yml # .github/workflows/pro-integration-tests.yml # .github/workflows/pro-lint.yml # .github/workflows/pro-test-package-and-gem.yml
Summary
Fixes the failing "Detect dead code" CI job on master after the monorepo restructure.
Problem
After moving packages to
packages/react-on-railsandpackages/react-on-rails-pro, Knip was detecting false positives:jest.config.base.jsmarked as unused (but it's used by both packages)package.jsonmarked as unused (shared by child workspaces)mock-fsdependencies in Pro package marked as unusedChanges
jest.config.base.jsas entry point - This shared Jest config is imported by both packagesnpsfrom ignoreBinaries - No longer referenced in package.json scripts@testing-library/dom,@testing-library/jest-dom,@testing-library/react@types/react-dom,create-react-class,jest-fetch-mockprop-types,react,react-dom,redux@types/mock-fs,mock-fsTesting
CI will validate the fix by running
yarn run knip --exclude binaries.🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com
Summary by CodeRabbit