Skip to content

Commit c3008ad

Browse files
justin808claude
andcommitted
Fix knip configuration for new monorepo structure
Updates knip.ts to work with the new react_on_rails/spec/dummy path: 1. Ignore rescript-components.js to avoid unresolved import errors - ReScript compiles .res files to .res.js at build time - Knip can't find these files during static analysis 2. Restore all necessary ignoreDependencies for dummy app - @babel/runtime: Required by @babel/plugin-transform-runtime - mini-css-extract-plugin: Used in webpack server config - create-react-class, react-helmet, etc.: Used in dynamically loaded components - webpack-merge: Transitive dependency of shakapacker 3. Keep SWC packages in root ignoreDependencies - Used by Shakapacker in dummy apps - Clarified comment for accuracy This fixes the knip CI failure introduced by the monorepo restructuring. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 446f6db commit c3008ad

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

knip.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const config: KnipConfig = {
3737
// This is an optional peer dependency because users without RSC don't need it
3838
// but Knip doesn't like such dependencies to be referenced directly in code
3939
'react-on-rails-rsc',
40-
// SWC transpiler dependencies used in dummy apps
40+
// SWC transpiler dependencies used by Shakapacker in dummy apps
4141
'@swc/core',
4242
'swc-loader',
4343
],
@@ -154,6 +154,8 @@ const config: KnipConfig = {
154154
'client/app/routes/**',
155155
'client/app/startup/**',
156156
'client/app/store/**',
157+
// ReScript entry files that import compiled .res.js files (compiled at build time)
158+
'client/app/packs/rescript-components.js',
157159
],
158160
project: ['**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}!', 'config/webpack/*.js'],
159161
paths: {
@@ -186,14 +188,14 @@ const config: KnipConfig = {
186188
'sass-resources-loader',
187189
'style-loader',
188190
'url-loader',
189-
// Transitive dependency of shakapacker but listed as direct dependency
190-
'webpack-merge',
191191
// Used in ignored client/app components (dynamically loaded by React on Rails)
192192
'create-react-class',
193193
'react-helmet',
194194
'@types/react-helmet',
195195
'react-redux',
196196
'react-router-dom',
197+
// Transitive dependency of shakapacker but listed as direct dependency
198+
'webpack-merge',
197199
],
198200
},
199201
},

0 commit comments

Comments
 (0)