@@ -2,25 +2,56 @@ import type { KnipConfig } from 'knip';
22
33const config : KnipConfig = {
44 // ! at the end means files are used in production
5- entry : [ 'node_package/src/ReactOnRails.ts!' , 'node_package/src/ReactOnRails.node.ts!' ] ,
6- project : [ 'node_package/src/**/*.[jt]s!' , 'node_package/tests/**/*.[jt]s' ] ,
7- ignoreBinaries : [
8- // Knip fails to detect it's declared in devDependencies
9- 'nps' ,
10- // local scripts
11- 'node_package/scripts/.*' ,
12- ] ,
13- ignoreDependencies : [
14- // Required for TypeScript compilation, but we don't depend on Turbolinks itself.
15- '@types/turbolinks' ,
16- // used in package-scripts.yml
17- 'concurrently' ,
18- // The Knip ESLint plugin fails to detect it's transitively required by a config,
19- // though we don't actually use its rules anywhere.
20- 'eslint-plugin-jsx-a11y' ,
21- ] ,
22- babel : {
23- config : [ 'node_package/babel.config.js' , 'package.json' ] ,
5+ workspaces : {
6+ '.' : {
7+ entry : [ 'node_package/src/ReactOnRails.ts!' , 'node_package/src/ReactOnRails.node.ts!' ] ,
8+ project : [ 'node_package/src/**/*.[jt]s!' , 'node_package/tests/**/*.[jt]s' ] ,
9+ ignoreBinaries : [
10+ // Knip fails to detect it's declared in devDependencies
11+ 'nps' ,
12+ // local scripts
13+ 'node_package/scripts/.*' ,
14+ ] ,
15+ ignoreDependencies : [
16+ // Required for TypeScript compilation, but we don't depend on Turbolinks itself.
17+ '@types/turbolinks' ,
18+ // used in package-scripts.yml
19+ 'concurrently' ,
20+ // The Knip ESLint plugin fails to detect it's transitively required by a config,
21+ // though we don't actually use its rules anywhere.
22+ 'eslint-plugin-jsx-a11y' ,
23+ ] ,
24+ babel : {
25+ config : [ 'node_package/babel.config.js' ] ,
26+ } ,
27+ } ,
28+ 'spec/dummy' : {
29+ entry : [
30+ 'app/assets/config/manifest.js!' ,
31+ 'client/app/packs/**/*.js!' ,
32+ // Not sure why this isn't detected as a dependency of client/app/packs/server-bundle.js
33+ 'client/app/generated/server-bundle-generated.js!' ,
34+ 'spec/fixtures/automated_packs_generation/**/*.js{x,}' ,
35+ 'config/webpack/{production,development,test}.js' ,
36+ // Declaring this as webpack.config instead doesn't work correctly
37+ 'config/webpack/webpack.config.js' ,
38+ ] ,
39+ paths : {
40+ 'Assets/*' : [ 'client/app/assets/*' ] ,
41+ } ,
42+ ignoreBinaries : [
43+ // Has to be installed globally
44+ 'yalc' ,
45+ // Local binaries
46+ 'bin/.*' ,
47+ ] ,
48+ ignoreDependencies : [
49+ // There's no ReScript plugin for Knip
50+ '@rescript/react' ,
51+ // The Babel plugin fails to detect it
52+ 'babel-plugin-transform-react-remove-prop-types' ,
53+ ] ,
54+ } ,
2455 } ,
2556} ;
2657
0 commit comments