rev-dep 2.14.0 → 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 +17 -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.8.schema.json?raw=true",
|
|
228
|
+
"nodeModulesResolution": "entry-package",
|
|
223
229
|
"rules": [
|
|
224
230
|
{
|
|
225
231
|
"path": ".",
|
|
@@ -254,10 +260,11 @@ 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": ".",
|
|
@@ -369,6 +376,7 @@ Here's a comprehensive example showing all available properties:
|
|
|
369
376
|
- **`customAssetExtensions`** (optional): Additional asset extensions treated as resolvable imports (e.g. `["glb", "mp3"]`). Default list covers common extensions for fonts, images, config files.
|
|
370
377
|
- **`ignoreFiles`** (optional): Global file patterns to ignore across all rules. Git ignored files are skipped by default.
|
|
371
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.
|
|
372
380
|
- **`rules`** (required): Array of rule objects
|
|
373
381
|
|
|
374
382
|
#### Rule Properties
|
|
@@ -999,6 +1007,7 @@ rev-dep unresolved [flags]
|
|
|
999
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 [])
|
|
1000
1008
|
--ignore-files strings File path glob patterns to ignore in unresolved output
|
|
1001
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")
|
|
1002
1011
|
--package-json string Path to package.json (default: ./package.json)
|
|
1003
1012
|
--process-ignored-files strings Glob patterns to process even if they are ignored by gitignore or exclude patterns
|
|
1004
1013
|
--tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
|
|
@@ -1153,6 +1162,7 @@ rev-dep node-modules missing --entry-points=src/main.ts
|
|
|
1153
1162
|
-h, --help help for missing
|
|
1154
1163
|
-t, --ignore-type-imports Exclude type imports from the analysis
|
|
1155
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")
|
|
1156
1166
|
--package-json string Path to package.json (default: ./package.json)
|
|
1157
1167
|
--pkg-fields-with-binaries strings Additional package.json fields to check for binary usages
|
|
1158
1168
|
--tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
|
|
@@ -1194,6 +1204,7 @@ rev-dep node-modules unused --exclude-modules=@types/*
|
|
|
1194
1204
|
-h, --help help for unused
|
|
1195
1205
|
-t, --ignore-type-imports Exclude type imports from the analysis
|
|
1196
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")
|
|
1197
1208
|
--package-json string Path to package.json (default: ./package.json)
|
|
1198
1209
|
--pkg-fields-with-binaries strings Additional package.json fields to check for binary usages
|
|
1199
1210
|
--tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
|
|
@@ -1242,6 +1253,7 @@ rev-dep node-modules used -p src/index.ts --group-by-module
|
|
|
1242
1253
|
-h, --help help for used
|
|
1243
1254
|
-t, --ignore-type-imports Exclude type imports from the analysis
|
|
1244
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")
|
|
1245
1257
|
--package-json string Path to package.json (default: ./package.json)
|
|
1246
1258
|
--pkg-fields-with-binaries strings Additional package.json fields to check for binary usages
|
|
1247
1259
|
--tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
|
|
@@ -1282,6 +1294,7 @@ rev-dep resolve -p src/index.ts -f src/utils/helpers.ts
|
|
|
1282
1294
|
-h, --help help for resolve
|
|
1283
1295
|
-t, --ignore-type-imports Exclude type imports from the analysis
|
|
1284
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")
|
|
1285
1298
|
--package-json string Path to package.json (default: ./package.json)
|
|
1286
1299
|
--process-ignored-files strings Glob patterns to process even if they are ignored by gitignore or exclude patterns
|
|
1287
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",
|