rev-dep 2.17.0 → 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.
Files changed (2) hide show
  1. package/bin.js +15 -0
  2. package/package.json +4 -4
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.17.0",
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.17.0",
21
- "@rev-dep/linux-x64": "2.17.0",
22
- "@rev-dep/win32-x64": "2.17.0"
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",