rev-dep 2.13.2 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +19 -4
- package/package.json +4 -4
package/Readme.md
CHANGED
|
@@ -132,6 +132,13 @@ npm install -g rev-dep
|
|
|
132
132
|
pnpm global add rev-dep
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
+
### Step-by-step integration guides
|
|
136
|
+
|
|
137
|
+
Follow the guide that matches your project to get from zero to a working setup:
|
|
138
|
+
|
|
139
|
+
- [Monorepo integration guide](https://rev-dep.com/docs/monorepo-integration-guide) - for `pnpm`/`yarn`/`npm` workspaces.
|
|
140
|
+
- [Single-workspace integration guide](https://rev-dep.com/docs/single-workspace-integration-guide) - for single-package projects.
|
|
141
|
+
|
|
135
142
|
## **Quick Examples 💡**
|
|
136
143
|
|
|
137
144
|
A few instant-use examples to get a feel for the tool:
|
|
@@ -218,8 +225,7 @@ The configuration file (`rev-dep.config.json(c)` or `.rev-dep.config.json(c)`) a
|
|
|
218
225
|
|
|
219
226
|
```jsonc
|
|
220
227
|
{
|
|
221
|
-
"
|
|
222
|
-
"$schema": "https://github.com/jayu/rev-dep/blob/master/config-schema/1.7.schema.json?raw=true",
|
|
228
|
+
"nodeModulesResolution": "entry-package",
|
|
223
229
|
"rules": [
|
|
224
230
|
{
|
|
225
231
|
"path": ".",
|
|
@@ -254,16 +260,18 @@ Here's a comprehensive example showing all available properties:
|
|
|
254
260
|
|
|
255
261
|
```jsonc
|
|
256
262
|
{
|
|
257
|
-
"configVersion": "1.
|
|
258
|
-
"$schema": "https://github.com/jayu/rev-dep/blob/master/config-schema/1.
|
|
263
|
+
"configVersion": "1.9",
|
|
264
|
+
"$schema": "https://github.com/jayu/rev-dep/blob/master/config-schema/1.9.schema.json?raw=true", // enables json autocompletion
|
|
259
265
|
"conditionNames": ["import", "default"],
|
|
260
266
|
"ignoreFiles": ["**/*.test.*"],
|
|
267
|
+
"nodeModulesResolution": "entry-package",
|
|
261
268
|
"rules": [
|
|
262
269
|
{
|
|
263
270
|
"path": ".",
|
|
264
271
|
"followMonorepoPackages": true,
|
|
265
272
|
"prodEntryPoints": ["src/main.tsx", "src/pages/**/*.tsx", "src/server.ts"],
|
|
266
273
|
"devEntryPoints": ["scripts/**", "**/*.test.*"],
|
|
274
|
+
"ignoreEntryPoints": ["src/legacy/oldDashboard.tsx"],
|
|
267
275
|
"moduleBoundaries": [
|
|
268
276
|
{
|
|
269
277
|
"name": "ui-components",
|
|
@@ -368,6 +376,7 @@ Here's a comprehensive example showing all available properties:
|
|
|
368
376
|
- **`customAssetExtensions`** (optional): Additional asset extensions treated as resolvable imports (e.g. `["glb", "mp3"]`). Default list covers common extensions for fonts, images, config files.
|
|
369
377
|
- **`ignoreFiles`** (optional): Global file patterns to ignore across all rules. Git ignored files are skipped by default.
|
|
370
378
|
- **`processIgnoredFiles`** (optional): Global file patterns to process even if they match gitignore or `ignoreFiles`.
|
|
379
|
+
- **`nodeModulesResolution`** (optional): Which `package.json` each third-party import is validated against for the `missingNodeModules`, `unusedNodeModules`, and `unresolvedImports` checks. `"entry-package"` (default) validates against the rule's entry `package.json`; `"nearest-package"` validates against the `package.json` owning each file (use for pnpm's default layout, where each package resolves only its own dependencies). Applies to all rules.
|
|
371
380
|
- **`rules`** (required): Array of rule objects
|
|
372
381
|
|
|
373
382
|
#### Rule Properties
|
|
@@ -377,6 +386,7 @@ Each rule can contain the following properties:
|
|
|
377
386
|
- **`followMonorepoPackages`** (optional): Control monorepo package resolution. `true` follows all workspace packages (default), `false` disables it, array follows only selected package names.
|
|
378
387
|
- **`prodEntryPoints`** (optional): Rule-level production entry point patterns for detector defaults
|
|
379
388
|
- **`devEntryPoints`** (optional): Rule-level development entry point patterns for detector defaults
|
|
389
|
+
- **`ignoreEntryPoints`** (optional): Rule-level patterns for leftover entry points you no longer care about. Files matching these patterns are not processed as issues - they are never reported as orphan files, and their unused exports are not reported. Useful for files that must stay committed but are no longer wired into the app.
|
|
380
390
|
- **`moduleBoundaries`** (optional): Array of module boundary rules
|
|
381
391
|
- **`circularImportsDetection`** (optional): Circular import detection configuration (single object or array of objects)
|
|
382
392
|
- **`orphanFilesDetection`** (optional): Orphan files detection configuration (single object or array of objects)
|
|
@@ -997,6 +1007,7 @@ rev-dep unresolved [flags]
|
|
|
997
1007
|
--ignore stringToString Map of file path (relative to cwd) to exact import request to ignore (e.g. --ignore src/index.ts=some-module) (default [])
|
|
998
1008
|
--ignore-files strings File path glob patterns to ignore in unresolved output
|
|
999
1009
|
--ignore-imports strings Import requests to ignore globally in unresolved output
|
|
1010
|
+
--node-modules-resolution string Which package.json each import is validated against: 'entry-package' (the cwd package.json, default) or 'nearest-package' (each file's own nearest package.json) (default "entry-package")
|
|
1000
1011
|
--package-json string Path to package.json (default: ./package.json)
|
|
1001
1012
|
--process-ignored-files strings Glob patterns to process even if they are ignored by gitignore or exclude patterns
|
|
1002
1013
|
--tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
|
|
@@ -1151,6 +1162,7 @@ rev-dep node-modules missing --entry-points=src/main.ts
|
|
|
1151
1162
|
-h, --help help for missing
|
|
1152
1163
|
-t, --ignore-type-imports Exclude type imports from the analysis
|
|
1153
1164
|
-i, --include-modules strings list of modules to include in the output
|
|
1165
|
+
--node-modules-resolution string Which package.json each import is validated against: 'entry-package' (the cwd package.json, default) or 'nearest-package' (each file's own nearest package.json) (default "entry-package")
|
|
1154
1166
|
--package-json string Path to package.json (default: ./package.json)
|
|
1155
1167
|
--pkg-fields-with-binaries strings Additional package.json fields to check for binary usages
|
|
1156
1168
|
--tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
|
|
@@ -1192,6 +1204,7 @@ rev-dep node-modules unused --exclude-modules=@types/*
|
|
|
1192
1204
|
-h, --help help for unused
|
|
1193
1205
|
-t, --ignore-type-imports Exclude type imports from the analysis
|
|
1194
1206
|
-i, --include-modules strings list of modules to include in the output
|
|
1207
|
+
--node-modules-resolution string Which package.json each import is validated against: 'entry-package' (the cwd package.json, default) or 'nearest-package' (each file's own nearest package.json) (default "entry-package")
|
|
1195
1208
|
--package-json string Path to package.json (default: ./package.json)
|
|
1196
1209
|
--pkg-fields-with-binaries strings Additional package.json fields to check for binary usages
|
|
1197
1210
|
--tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
|
|
@@ -1240,6 +1253,7 @@ rev-dep node-modules used -p src/index.ts --group-by-module
|
|
|
1240
1253
|
-h, --help help for used
|
|
1241
1254
|
-t, --ignore-type-imports Exclude type imports from the analysis
|
|
1242
1255
|
-i, --include-modules strings list of modules to include in the output
|
|
1256
|
+
--node-modules-resolution string Which package.json each import is validated against: 'entry-package' (the cwd package.json, default) or 'nearest-package' (each file's own nearest package.json) (default "entry-package")
|
|
1243
1257
|
--package-json string Path to package.json (default: ./package.json)
|
|
1244
1258
|
--pkg-fields-with-binaries strings Additional package.json fields to check for binary usages
|
|
1245
1259
|
--tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
|
|
@@ -1280,6 +1294,7 @@ rev-dep resolve -p src/index.ts -f src/utils/helpers.ts
|
|
|
1280
1294
|
-h, --help help for resolve
|
|
1281
1295
|
-t, --ignore-type-imports Exclude type imports from the analysis
|
|
1282
1296
|
--module string Target node module name to check for dependencies
|
|
1297
|
+
--node-modules-resolution string Which package.json each import is validated against: 'entry-package' (the cwd package.json, default) or 'nearest-package' (each file's own nearest package.json) (default "entry-package")
|
|
1283
1298
|
--package-json string Path to package.json (default: ./package.json)
|
|
1284
1299
|
--process-ignored-files strings Glob patterns to process even if they are ignored by gitignore or exclude patterns
|
|
1285
1300
|
--tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rev-dep",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.0",
|
|
4
4
|
"description": "Trace imports, detect unused code, clean dependencies — all with a super-fast CLI",
|
|
5
5
|
"bin": "bin.js",
|
|
6
6
|
"files": [
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"node": ">=18"
|
|
18
18
|
},
|
|
19
19
|
"optionalDependencies": {
|
|
20
|
-
"@rev-dep/darwin-arm64": "2.
|
|
21
|
-
"@rev-dep/linux-x64": "2.
|
|
22
|
-
"@rev-dep/win32-x64": "2.
|
|
20
|
+
"@rev-dep/darwin-arm64": "2.15.0",
|
|
21
|
+
"@rev-dep/linux-x64": "2.15.0",
|
|
22
|
+
"@rev-dep/win32-x64": "2.15.0"
|
|
23
23
|
},
|
|
24
24
|
"keywords": [
|
|
25
25
|
"dependency-analysis",
|