rev-dep 2.14.0 → 2.16.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 +28 -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": { "resolutionType": "entry-package", "includeDevDepsFromRoot": false },
|
|
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.10",
|
|
264
|
+
"$schema": "https://github.com/jayu/rev-dep/blob/master/config-schema/1.10.schema.json?raw=true", // enables json autocompletion
|
|
259
265
|
"conditionNames": ["import", "default"],
|
|
260
266
|
"ignoreFiles": ["**/*.test.*"],
|
|
267
|
+
"nodeModulesResolution": { "resolutionType": "entry-package", "includeDevDepsFromRoot": false },
|
|
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. Configure it as an object `{ "resolutionType": ..., "includeDevDepsFromRoot": ... }` - the form `rev-dep config init` generates. `resolutionType` is `"entry-package"` (default, validates against the rule's entry `package.json`) or `"nearest-package"` (validates against the `package.json` owning each file - use for pnpm's default layout, where each package resolves only its own dependencies). `includeDevDepsFromRoot` (default `false`) lets package code use dev dependencies declared only at the monorepo root without `missingNodeModules` or `unresolvedImports` flagging them. A bare string (e.g. `"nearest-package"`) is also accepted as a backward-compatible shorthand for `resolutionType`. Applies to all rules. See the [docs](https://rev-dep.com/docs/other-concepts-and-features/node-modules-resolution).
|
|
372
380
|
- **`rules`** (required): Array of rule objects
|
|
373
381
|
|
|
374
382
|
#### Rule Properties
|
|
@@ -999,6 +1007,8 @@ 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
|
+
--include-dev-deps-from-root Treat the monorepo root package.json devDependencies as available to package code, so they are not reported as missing or unresolved. Mirrors config nodeModulesResolution.includeDevDepsFromRoot
|
|
1011
|
+
--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
1012
|
--package-json string Path to package.json (default: ./package.json)
|
|
1003
1013
|
--process-ignored-files strings Glob patterns to process even if they are ignored by gitignore or exclude patterns
|
|
1004
1014
|
--tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
|
|
@@ -1152,7 +1162,9 @@ rev-dep node-modules missing --entry-points=src/main.ts
|
|
|
1152
1162
|
--group-by-module-files-count Organize output by npm package name and show count of files using it
|
|
1153
1163
|
-h, --help help for missing
|
|
1154
1164
|
-t, --ignore-type-imports Exclude type imports from the analysis
|
|
1165
|
+
--include-dev-deps-from-root Treat the monorepo root package.json devDependencies as available to package code, so they are not reported as missing or unresolved. Mirrors config nodeModulesResolution.includeDevDepsFromRoot
|
|
1155
1166
|
-i, --include-modules strings list of modules to include in the output
|
|
1167
|
+
--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
1168
|
--package-json string Path to package.json (default: ./package.json)
|
|
1157
1169
|
--pkg-fields-with-binaries strings Additional package.json fields to check for binary usages
|
|
1158
1170
|
--tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
|
|
@@ -1193,7 +1205,9 @@ rev-dep node-modules unused --exclude-modules=@types/*
|
|
|
1193
1205
|
--follow-monorepo-packages strings Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names
|
|
1194
1206
|
-h, --help help for unused
|
|
1195
1207
|
-t, --ignore-type-imports Exclude type imports from the analysis
|
|
1208
|
+
--include-dev-deps-from-root Treat the monorepo root package.json devDependencies as available to package code, so they are not reported as missing or unresolved. Mirrors config nodeModulesResolution.includeDevDepsFromRoot
|
|
1196
1209
|
-i, --include-modules strings list of modules to include in the output
|
|
1210
|
+
--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
1211
|
--package-json string Path to package.json (default: ./package.json)
|
|
1198
1212
|
--pkg-fields-with-binaries strings Additional package.json fields to check for binary usages
|
|
1199
1213
|
--tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
|
|
@@ -1241,7 +1255,9 @@ rev-dep node-modules used -p src/index.ts --group-by-module
|
|
|
1241
1255
|
--group-by-module-show-entry-points Organize output by npm package name and list entry points using it
|
|
1242
1256
|
-h, --help help for used
|
|
1243
1257
|
-t, --ignore-type-imports Exclude type imports from the analysis
|
|
1258
|
+
--include-dev-deps-from-root Treat the monorepo root package.json devDependencies as available to package code, so they are not reported as missing or unresolved. Mirrors config nodeModulesResolution.includeDevDepsFromRoot
|
|
1244
1259
|
-i, --include-modules strings list of modules to include in the output
|
|
1260
|
+
--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
1261
|
--package-json string Path to package.json (default: ./package.json)
|
|
1246
1262
|
--pkg-fields-with-binaries strings Additional package.json fields to check for binary usages
|
|
1247
1263
|
--tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
|
|
@@ -1281,7 +1297,9 @@ rev-dep resolve -p src/index.ts -f src/utils/helpers.ts
|
|
|
1281
1297
|
--graph-exclude strings Glob patterns to exclude files from dependency analysis
|
|
1282
1298
|
-h, --help help for resolve
|
|
1283
1299
|
-t, --ignore-type-imports Exclude type imports from the analysis
|
|
1300
|
+
--include-dev-deps-from-root Treat the monorepo root package.json devDependencies as available to package code, so they are not reported as missing or unresolved. Mirrors config nodeModulesResolution.includeDevDepsFromRoot
|
|
1284
1301
|
--module string Target node module name to check for dependencies
|
|
1302
|
+
--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
1303
|
--package-json string Path to package.json (default: ./package.json)
|
|
1286
1304
|
--process-ignored-files strings Glob patterns to process even if they are ignored by gitignore or exclude patterns
|
|
1287
1305
|
--tsconfig-json string Path to tsconfig.json (default: ./tsconfig.json)
|
|
@@ -1353,6 +1371,12 @@ A dependency listed in **package.json** that is **never imported** in the source
|
|
|
1353
1371
|
|
|
1354
1372
|
The top-level directory used as the starting point for dependency analysis.
|
|
1355
1373
|
|
|
1374
|
+
## Telemetry
|
|
1375
|
+
|
|
1376
|
+
Rev-Dep collects a single **anonymous** event, only during `rev-dep config run`. Read more in [Telemetry docs](https://rev-dep.com/docs/telemetry).
|
|
1377
|
+
|
|
1378
|
+
Opt out completely by setting `REV_DEP_TELEMETRY_OFF=true`.
|
|
1379
|
+
|
|
1356
1380
|
## Made in 🇵🇱 and 🇯🇵 with 🧠 by [@jayu](https://github.com/jayu)
|
|
1357
1381
|
|
|
1358
1382
|
I hope that this small piece of software will help you discover and understood complexity of your project hence make you more confident while refactoring. If this tool was useful, don't hesitate to give it a ⭐!
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rev-dep",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.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.16.0",
|
|
21
|
+
"@rev-dep/linux-x64": "2.16.0",
|
|
22
|
+
"@rev-dep/win32-x64": "2.16.0"
|
|
23
23
|
},
|
|
24
24
|
"keywords": [
|
|
25
25
|
"dependency-analysis",
|