@vinean/dependency-analyzer 0.1.0 → 0.1.2

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 CHANGED
@@ -1,10 +1,10 @@
1
1
  # 🛡️ @vinean/dependency-analyzer
2
2
 
3
- A high-performance CLI for analyzing the **Replaceability** of your project's dependencies. Supports both **NPM** and **Go Modules**.
3
+ A high-performance CLI for analyzing the **Replaceability**, **Maintenance**, and **Health** of your project's dependencies. Supports both **NPM** and **Go Modules**.
4
4
 
5
5
  ## 🚀 Usage
6
6
 
7
- Run it directly via `npx`:
7
+ Run it directly via `npx` in your project root directory:
8
8
 
9
9
  ```bash
10
10
  npx @vinean/dependency-analyzer
@@ -20,22 +20,48 @@ npm install -g @vinean/dependency-analyzer
20
20
  ## ⚙️ Options
21
21
 
22
22
  - `--project <path>`: Path to the project root (default: current directory).
23
+ - `--ecosystem <type>`: Force ecosystem detection (`npm` or `go`). Auto-detected by default.
23
24
  - `--open=false`: Disable auto-opening the generated HTML report.
24
25
  - `--json`: Print the raw analysis summary (JSON) to stdout.
25
26
 
26
- ## 📊 What is Replaceability?
27
+ ## 📊 Key Features
27
28
 
28
- `@vinean/dependency-analyzer` deep-dives into your project's `node_modules` or Go proxy source code to calculate a **Replaceability Score (0-100)** based on:
29
+ ### 1. Replaceability Score (0-100)
29
30
 
30
- 1. **Native Presence**: Detects C++/CGO/Unsafe code.
31
- 2. **Code Volume**: Measures physical size and SLOC.
32
- 3. **API Surface**: Evaluates the breadth and complexity of the public interface.
33
- 4. **Entanglement**: Tracks dependency chains and OS-level integrations.
34
- 5. **Logic Complexity**: Proxies cognitive load and concurrency features.
31
+ `@vinean/dependency-analyzer` deep-dives into your project's source code to calculate how difficult it would be to replace a dependency.
35
32
 
36
- ## 📑 Output
33
+ - **Easy (0-30)**: Minimal logic, easy to replace or implement yourself.
34
+ - **Medium (31-70)**: Moderate complexity and coupling.
35
+ - **Hard (71-100)**: Deeply integrated, native code, or massive API surface.
37
36
 
38
- Generates a `dep-report.html` interactive dashboard in your project directory, allowing you to explore the metrics, check maintenance status, and export results.
37
+ The score is derived from 5 critical metrics:
38
+
39
+ - **Native Presence**: Detects C++/CGO/Unsafe code.
40
+ - **Code Volume**: Measures physical size and SLOC.
41
+ - **API Surface**: Evaluates the breadth and complexity of the interface.
42
+ - **Entanglement**: Tracks dependency chains and OS-level integrations.
43
+ - **Logic Complexity**: Proxies cognitive load and concurrency features.
44
+
45
+ ### 2. Maintenance & Health
46
+
47
+ Identify abandoned or deprecated packages before they become a liability.
48
+
49
+ - **Maintenance Status**: Track if a package is active (Yes), stale (Unlikely), or deprecated (No).
50
+ - **Update Recency**: See exactly how long ago the last version was released.
51
+ - **Popularity**: Weekly download counts (NPM) provide context on package trust.
52
+
53
+ ### 3. Ecosystem Specifics
54
+
55
+ - **React Native**: Detects native module usage and "New Architecture" (TurboModule/Fabric) support.
56
+ - **Go Support**: Deep analysis of module internals and proxy metadata.
57
+
58
+ ## 📑 Interactive Dashboard
59
+
60
+ The tool generates a `dependency-report.html` interactive dashboard in your project directory:
61
+
62
+ - **Sortable Metrics**: Rank dependencies by complexity, downloads, or update age.
63
+ - **Export Capabilities**: Download the full analysis as a JSON for CI/CD or internal tools.
64
+ - **Offline First**: The report is self-contained and can be viewed without an internet connection.
39
65
 
40
66
  ---
41
67
 
@@ -35,6 +35,7 @@ async function ensureBinaryExecutable(targetPath) {
35
35
  function runBinary(targetPath) {
36
36
  const child = spawn(targetPath, process.argv.slice(2), {
37
37
  stdio: "inherit",
38
+ cwd: process.cwd(),
38
39
  });
39
40
  child.on("exit", (code) => process.exit(code ?? 1));
40
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vinean/dependency-analyzer",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Dependency Analyzer for npm and go packages with replaceability analysis",
5
5
  "type": "module",
6
6
  "bin": {