rev-dep 2.15.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 +16 -5
- package/package.json +4 -4
package/Readme.md
CHANGED
|
@@ -225,7 +225,7 @@ The configuration file (`rev-dep.config.json(c)` or `.rev-dep.config.json(c)`) a
|
|
|
225
225
|
|
|
226
226
|
```jsonc
|
|
227
227
|
{
|
|
228
|
-
"nodeModulesResolution": "entry-package",
|
|
228
|
+
"nodeModulesResolution": { "resolutionType": "entry-package", "includeDevDepsFromRoot": false },
|
|
229
229
|
"rules": [
|
|
230
230
|
{
|
|
231
231
|
"path": ".",
|
|
@@ -260,11 +260,11 @@ Here's a comprehensive example showing all available properties:
|
|
|
260
260
|
|
|
261
261
|
```jsonc
|
|
262
262
|
{
|
|
263
|
-
"configVersion": "1.
|
|
264
|
-
"$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
|
|
265
265
|
"conditionNames": ["import", "default"],
|
|
266
266
|
"ignoreFiles": ["**/*.test.*"],
|
|
267
|
-
"nodeModulesResolution": "entry-package",
|
|
267
|
+
"nodeModulesResolution": { "resolutionType": "entry-package", "includeDevDepsFromRoot": false },
|
|
268
268
|
"rules": [
|
|
269
269
|
{
|
|
270
270
|
"path": ".",
|
|
@@ -376,7 +376,7 @@ Here's a comprehensive example showing all available properties:
|
|
|
376
376
|
- **`customAssetExtensions`** (optional): Additional asset extensions treated as resolvable imports (e.g. `["glb", "mp3"]`). Default list covers common extensions for fonts, images, config files.
|
|
377
377
|
- **`ignoreFiles`** (optional): Global file patterns to ignore across all rules. Git ignored files are skipped by default.
|
|
378
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
|
|
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).
|
|
380
380
|
- **`rules`** (required): Array of rule objects
|
|
381
381
|
|
|
382
382
|
#### Rule Properties
|
|
@@ -1007,6 +1007,7 @@ rev-dep unresolved [flags]
|
|
|
1007
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 [])
|
|
1008
1008
|
--ignore-files strings File path glob patterns to ignore in unresolved output
|
|
1009
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
|
|
1010
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")
|
|
1011
1012
|
--package-json string Path to package.json (default: ./package.json)
|
|
1012
1013
|
--process-ignored-files strings Glob patterns to process even if they are ignored by gitignore or exclude patterns
|
|
@@ -1161,6 +1162,7 @@ rev-dep node-modules missing --entry-points=src/main.ts
|
|
|
1161
1162
|
--group-by-module-files-count Organize output by npm package name and show count of files using it
|
|
1162
1163
|
-h, --help help for missing
|
|
1163
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
|
|
1164
1166
|
-i, --include-modules strings list of modules to include in the output
|
|
1165
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")
|
|
1166
1168
|
--package-json string Path to package.json (default: ./package.json)
|
|
@@ -1203,6 +1205,7 @@ rev-dep node-modules unused --exclude-modules=@types/*
|
|
|
1203
1205
|
--follow-monorepo-packages strings Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names
|
|
1204
1206
|
-h, --help help for unused
|
|
1205
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
|
|
1206
1209
|
-i, --include-modules strings list of modules to include in the output
|
|
1207
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")
|
|
1208
1211
|
--package-json string Path to package.json (default: ./package.json)
|
|
@@ -1252,6 +1255,7 @@ rev-dep node-modules used -p src/index.ts --group-by-module
|
|
|
1252
1255
|
--group-by-module-show-entry-points Organize output by npm package name and list entry points using it
|
|
1253
1256
|
-h, --help help for used
|
|
1254
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
|
|
1255
1259
|
-i, --include-modules strings list of modules to include in the output
|
|
1256
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")
|
|
1257
1261
|
--package-json string Path to package.json (default: ./package.json)
|
|
@@ -1293,6 +1297,7 @@ rev-dep resolve -p src/index.ts -f src/utils/helpers.ts
|
|
|
1293
1297
|
--graph-exclude strings Glob patterns to exclude files from dependency analysis
|
|
1294
1298
|
-h, --help help for resolve
|
|
1295
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
|
|
1296
1301
|
--module string Target node module name to check for dependencies
|
|
1297
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")
|
|
1298
1303
|
--package-json string Path to package.json (default: ./package.json)
|
|
@@ -1366,6 +1371,12 @@ A dependency listed in **package.json** that is **never imported** in the source
|
|
|
1366
1371
|
|
|
1367
1372
|
The top-level directory used as the starting point for dependency analysis.
|
|
1368
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
|
+
|
|
1369
1380
|
## Made in 🇵🇱 and 🇯🇵 with 🧠 by [@jayu](https://github.com/jayu)
|
|
1370
1381
|
|
|
1371
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",
|