rev-dep 2.16.1 → 2.18.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 +6 -0
- package/bin.js +15 -0
- package/package.json +4 -4
package/Readme.md
CHANGED
|
@@ -80,6 +80,8 @@ Available checks:
|
|
|
80
80
|
- `circularImportsDetection` - detect circular imports.
|
|
81
81
|
- `devDepsUsageOnProdDetection` - detect dev dependencies used in production code.
|
|
82
82
|
- `restrictedImportsDetection` - block importing denied files/modules from selected entry points.
|
|
83
|
+
- `restrictedImportersDetection` - whitelist which entry points may transitively reach a set of files/modules.
|
|
84
|
+
- `restrictedDirectImportersDetection` - constrain which files may directly import a set of files/modules (non-transitive).
|
|
83
85
|
|
|
84
86
|
### Exploratory analysis (CLI-based) 🔍
|
|
85
87
|
|
|
@@ -180,6 +182,8 @@ Available checks are:
|
|
|
180
182
|
- `circularImportsDetection` - detect circular imports.
|
|
181
183
|
- `devDepsUsageOnProdDetection` - detect dev dependencies used in production code.
|
|
182
184
|
- `restrictedImportsDetection` - block importing denied files/modules from selected entry points.
|
|
185
|
+
- `restrictedImportersDetection` - whitelist which entry points may transitively reach a set of files/modules.
|
|
186
|
+
- `restrictedDirectImportersDetection` - constrain which files may directly import a set of files/modules (non-transitive).
|
|
183
187
|
|
|
184
188
|
Checks are grouped in rules. You can have multiple rules, eg. for each monorepo package.
|
|
185
189
|
|
|
@@ -396,6 +400,8 @@ Each rule can contain the following properties:
|
|
|
396
400
|
- **`unresolvedImportsDetection`** (optional): Unresolved imports detection configuration (single object or array of objects)
|
|
397
401
|
- **`devDepsUsageOnProdDetection`** (optional): Restricted dev dependencies usage detection configuration (single object or array of objects)
|
|
398
402
|
- **`restrictedImportsDetection`** (optional): Restrict importing denied files/modules from selected entry points (single object or array of objects)
|
|
403
|
+
- **`restrictedImportersDetection`** (optional): Whitelist which entry points may transitively reach a set of files/modules (single object or array of objects)
|
|
404
|
+
- **`restrictedDirectImportersDetection`** (optional): Constrain which files may directly import a set of files/modules; non-transitive (single object or array of objects)
|
|
399
405
|
- **`importConventions`** (optional): Array of import convention rules
|
|
400
406
|
|
|
401
407
|
#### Module Boundary Properties
|
package/bin.js
CHANGED
|
@@ -54,6 +54,21 @@ if (!fs.existsSync(binary)) {
|
|
|
54
54
|
process.exit(1)
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
// config init needs interactive terminal
|
|
58
|
+
const positionalArgs = binaryArgs.filter((arg) => !arg.startsWith('-'))
|
|
59
|
+
const isConfigInit = positionalArgs[0] === 'config' && positionalArgs[1] === 'init'
|
|
60
|
+
const isInteractiveTerminal = Boolean(process.stdin.isTTY && process.stdout.isTTY)
|
|
61
|
+
|
|
62
|
+
if (isConfigInit && isInteractiveTerminal) {
|
|
63
|
+
const interactive = cp.spawnSync(binary, binaryArgs, { stdio: 'inherit' })
|
|
64
|
+
if (interactive.error) {
|
|
65
|
+
console.error(interactive.error.message)
|
|
66
|
+
process.exit(1)
|
|
67
|
+
}
|
|
68
|
+
// status is null when the child was killed by a signal; treat that as a failure.
|
|
69
|
+
process.exit(interactive.status === null ? 1 : interactive.status)
|
|
70
|
+
}
|
|
71
|
+
|
|
57
72
|
try {
|
|
58
73
|
const binaryArgsWrapped = binaryArgs.map((arg) => `"${arg}"`)
|
|
59
74
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rev-dep",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.18.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.18.0",
|
|
21
|
+
"@rev-dep/linux-x64": "2.18.0",
|
|
22
|
+
"@rev-dep/win32-x64": "2.18.0"
|
|
23
23
|
},
|
|
24
24
|
"keywords": [
|
|
25
25
|
"dependency-analysis",
|