@@ -19,113 +19,134 @@ const config: KnipConfig = {
1919 "scripts/docker/**" ,
2020 // Async rewriter3 has its own build system (Rust/WASM)
2121 "packages/async-rewriter3/**" ,
22- // Configuration files
22+ // Configuration files (from depcheck ignore-patterns)
2323 ".evergreen/**" ,
2424 "config/**" ,
2525 "configs/**" ,
26+ "**/.eslintrc.js" ,
2627 ] ,
2728
28- // Ignore dependencies that are used in build processes or special contexts
29+ // Global ignore dependencies ( used across multiple packages or in special contexts)
2930 ignoreDependencies : [
30- // Used in build scripts and webpack configs
31- "terser-webpack-plugin" ,
32- "webpack-bundle-analyzer" ,
33- "webpack-cli" ,
34- "webpack-merge" ,
35- // Used in special build contexts
36- "mongodb-runner" ,
37- "mongodb-crypt-library-dummy" ,
38- // Used in scripts
39- "mongodb-sbom-tools" ,
40- "@pkgjs/nv" ,
41- // Used for husky git hooks
42- "husky" ,
43- // CLI tool
44- "depcheck" ,
31+ // Common dev tooling that appears in .depcheckrc files (peer dependencies)
32+ "@mongodb-js/tsconfig-mongosh" ,
33+ "@mongodb-js/prettier-config-devtools" ,
4534 ] ,
4635
4736 // Ignore binaries that are used in scripts
48- ignoreBinaries : [ "depalign" , "monorepo-where" , "precommit" ] ,
49-
50- // Global entry files at root level
51- entry : [ "scripts/**/*.{js,ts,mjs}" , "testing/**/*.ts" ] ,
52-
53- // Project files to analyze at root level
54- project : [
55- "scripts/**/*.{js,ts,mjs}" ,
56- "testing/**/*.ts" ,
57- "configs/**/*.{js,ts}" ,
58- ] ,
37+ ignoreBinaries : [ "lerna" , "mongodb-sbom-tools" , "prettier" ] ,
5938
6039 // Workspace-specific configurations
6140 workspaces : {
41+ // Root package (monorepo root, no entry file needed)
6242 "." : {
63- // Root workspace configuration
64- entry : [ "scripts/**/*.{js,ts,mjs}" , "testing/**/*.ts" ] ,
43+ entry : [ ] ,
44+ project : [ ] ,
6545 } ,
6646
6747 // Config packages
6848 "configs/eslint-config-mongosh" : {
69- entry : [ "index.js" , " utils.js"] ,
49+ entry : [ "utils.js" ] ,
7050 } ,
7151
7252 "configs/tsconfig-mongosh" : {
7353 entry : [ "tsconfig.common.json" ] ,
7454 } ,
7555
76- // Main packages
77- "packages/*" : {
78- entry : [ "src/index.ts" , "src/index.tsx" , "lib/index.js" , "bin/**/*.js" ] ,
79- project : [ "src/**/*.{ts,tsx}" , "bin/**/*.js" ] ,
80- } ,
81-
8256 // Special cases for packages with different entry points
8357 "packages/cli-repl" : {
84- entry : [ "bin/mongosh.js" , "src/run.ts" , " dist/add-module-mapping.js"] ,
58+ entry : [ "dist/add-module-mapping.js" ] ,
8559 project : [ "src/**/*.ts" , "bin/**/*.js" ] ,
60+ ignoreDependencies : [
61+ // Eagerly loaded startup snapshot dependencies
62+ "@mongodb-js/saslprep" ,
63+ "socks" ,
64+ "emphasize" ,
65+ "ipv6-normalize" ,
66+ "bindings" ,
67+ "system-ca" ,
68+ // Used for monkey-patching our s390x fix
69+ "@tootallnate/quickjs-emscripten" ,
70+ ] ,
8671 } ,
8772
8873 "packages/shell-api" : {
8974 entry : [ "src/api.ts" ] ,
90- project : [ "src/**/*.ts" ] ,
9175 } ,
9276
93- "packages/build" : {
94- entry : [
95- "src/evergreen-release.ts" ,
96- "src/release.ts" ,
97- "src/update-cta.ts" ,
98- ] ,
99- project : [ "src/**/*.ts" ] ,
77+ "packages/mongosh" : {
78+ project : [ "bin/**/*.js" ] ,
10079 } ,
10180
10281 "packages/e2e-tests" : {
10382 entry : [ "test/**/*.ts" ] ,
10483 project : [ "test/**/*.ts" ] ,
10584 } ,
10685
86+ "packages/service-provider-node-driver" : {
87+ ignoreDependencies : [
88+ // Used for MONGODB-AWS auth
89+ // See: https://github.com/mongodb-js/mongosh/pull/1149
90+ // See: https://jira.mongodb.org/browse/NODE-5005
91+ "aws4" ,
92+ ] ,
93+ } ,
94+
95+ "packages/node-runtime-worker-thread" : {
96+ ignoreDependencies : [
97+ // Used in worker thread context
98+ "system-ca" ,
99+ ] ,
100+ ignoreFiles : [
101+ // Used in package.json
102+ "tests/register-worker.js" ,
103+ ] ,
104+ } ,
105+
107106 "packages/browser-repl" : {
108- entry : [ "src/index.tsx" ] ,
109107 project : [ "src/**/*.{ts,tsx}" ] ,
108+ ignoreDependencies : [
109+ // Babel plugins used by webpack config
110+ "@babel/plugin-proposal-class-properties" ,
111+ "@babel/preset-react" ,
112+ "@babel/preset-typescript" ,
113+ // Testing dependencies
114+ "@types/sinon-chai" ,
115+ "@wojtekmaj/enzyme-adapter-react-17" ,
116+ "enzyme" ,
117+ // Karma test runner plugins
118+ "karma-chrome-launcher" ,
119+ "karma-mocha" ,
120+ "karma-mocha-reporter" ,
121+ "karma-typescript" ,
122+ // Resolved as `<depname>/` so depcheck doesn't see it being used
123+ "buffer" ,
124+ "util" ,
125+ ] ,
110126 } ,
111127
112128 "packages/java-shell" : {
113- entry : [
114- "src/main/kotlin/**/*.kt" ,
115- "src/test/kotlin/**/*.kt" ,
116- "gen-doc/**/*.js" ,
117- "gen-kotlin/**/*.js" ,
118- ] ,
119- project : [
120- "src/main/kotlin/**/*.kt" ,
121- "gen-doc/**/*.js" ,
122- "gen-kotlin/**/*.js" ,
129+ project : [ "src/main/js/**/*" ] ,
130+ ignoreDependencies : [
131+ // Used in webpack and build scripts
132+ "bson" ,
133+ "tr46" ,
123134 ] ,
124135 } ,
125136
126137 "packages/connectivity-tests" : {
127- entry : [ "index.js" ] ,
128- project : [ "**/*.js" ] ,
138+ // This package only contains bash test scripts
139+ ignoreDependencies : [
140+ // Used by test scripts
141+ "mongosh" ,
142+ ] ,
143+ } ,
144+
145+ "packages/async-rewriter2" : {
146+ ignoreFiles : [
147+ // Used by make-runtime-support.js
148+ "src/runtime-support.nocov.js" ,
149+ ] ,
129150 } ,
130151
131152 testing : {
@@ -135,12 +156,11 @@ const config: KnipConfig = {
135156 "integration-testing-hooks.ts" ,
136157 "disable-dns-srv.js" ,
137158 ] ,
138- project : [ "**/*.{ts,js}" ] ,
139- } ,
140-
141- "scripts/docker" : {
142- entry : [ "**/*.js" ] ,
143- project : [ "**/*.js" ] ,
159+ ignoreDependencies : [
160+ // Used in testing infrastructure
161+ "mongodb-connection-string-url" ,
162+ "@mongosh/build" ,
163+ ] ,
144164 } ,
145165 } ,
146166
0 commit comments