Skip to content

Commit 7818afc

Browse files
justin808claude
andcommitted
Fix knip unused dependencies and package reference issues
- Fix incorrect devDependency path in node-renderer package.json - Change from "./packages/react-on-rails" to "file:../react-on-rails" - Ensures proper workspace resolution - Add missing dependencies to knip ignoreDependencies for spec/dummy - @babel/runtime: Required by @babel/plugin-transform-runtime - mini-css-extract-plugin: Used in webpack server config - create-react-class, react-helmet, @types/react-helmet, react-redux, react-router-dom: Used in dynamically loaded components - Fix knip unused export warning for resetRailsContext - Add src/context.ts as entry point for react-on-rails package - This export is used by the Pro package - Remove unnecessary eslint-disable comment in Pro jest.config.js All changes verified: - yarn run knip --exclude binaries: passes - yarn run knip --production --exclude binaries: passes - bundle exec rubocop: no offenses - yarn run yalc:publish: all packages publish successfully 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent bb0f90a commit 7818afc

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

knip.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ const config: KnipConfig = {
4545

4646
// React on Rails core package workspace
4747
'packages/react-on-rails': {
48-
entry: ['src/ReactOnRails.full.ts!', 'src/ReactOnRails.client.ts!', 'src/base/full.rsc.ts!'],
48+
entry: [
49+
'src/ReactOnRails.full.ts!',
50+
'src/ReactOnRails.client.ts!',
51+
'src/base/full.rsc.ts!',
52+
'src/context.ts!',
53+
],
4954
project: ['src/**/*.[jt]s{x,}!', 'tests/**/*.[jt]s{x,}', '!lib/**'],
5055
ignore: [
5156
// Jest setup and test utilities - not detected by Jest plugin in workspace setup
@@ -159,6 +164,10 @@ const config: KnipConfig = {
159164
'@rescript/react',
160165
// The Babel plugin fails to detect it
161166
'babel-plugin-transform-react-remove-prop-types',
167+
// Required by @babel/plugin-transform-runtime for polyfills
168+
'@babel/runtime',
169+
// Used in webpack server config to filter out MiniCssExtractPlugin
170+
'mini-css-extract-plugin',
162171
// This one is weird. It's long-deprecated and shouldn't be necessary.
163172
// Probably need to update the Webpack config.
164173
'node-libs-browser',
@@ -173,6 +182,12 @@ const config: KnipConfig = {
173182
'url-loader',
174183
// Transitive dependency of shakapacker but listed as direct dependency
175184
'webpack-merge',
185+
// Used in ignored client/app components (dynamically loaded by React on Rails)
186+
'create-react-class',
187+
'react-helmet',
188+
'@types/react-helmet',
189+
'react-redux',
190+
'react-router-dom',
176191
],
177192
},
178193
},

packages/react-on-rails-pro-node-renderer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"node-html-parser": "^7.0.1",
5252
"nps": "^5.9.12",
5353
"pino-pretty": "^13.0.0",
54-
"react-on-rails": "./packages/react-on-rails",
54+
"react-on-rails": "file:../react-on-rails",
5555
"redis": "^5.0.1",
5656
"sentry-testkit": "^5.0.6",
5757
"touch": "^3.1.0",

packages/react-on-rails-pro/jest.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// eslint-disable-next-line import/no-relative-packages
21
import rootConfig from '../../jest.config.base.js';
32

43
const nodeVersion = parseInt(process.version.slice(1), 10);

0 commit comments

Comments
 (0)