@mohamed_fadl/reactlens 1.2.0-beta.7 → 1.2.0-beta.9

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/README.md +33 -40
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,90 +1,83 @@
1
- # ReactLens: Advanced Architectural Analysis Engine
2
-
3
- [![npm version](https://img.shields.io/npm/v/@mohamed_fadl/reactlens?color=blue&style=flat-square)](https://www.npmjs.com/package/@mohamed_fadl/reactlens)
4
- [![build](https://img.shields.io/github/actions/workflow/status/react-lens/reactlens/ci.yml?style=flat-square)](https://github.com/react-lens/reactlens/actions)
5
- [![license](https://img.shields.io/npm/l/@mohamed_fadl/reactlens?style=flat-square)](LICENSE)
1
+ # ReactLens
6
2
 
7
3
  > [!WARNING]
8
- > **Beta Version:** This tool is currently in beta. Features are subject to change, and we are continuously refining our analysis algorithms.
4
+ > **Beta:** We're still refining the algorithms and adding features. Expect changes.
9
5
 
10
- ReactLens is a high-performance tool designed for deep architectural auditing of React and Next.js applications. It uses static AST analysis to give you a clear "X-ray" view of your project's health.
6
+ ReactLens is a CLI tool that gives you a deep "X-ray" view of your React and Next.js projects. We use AST analysis to find complexity, circular dependencies, and unused files so you can keep your architecture clean.
11
7
 
12
- ## 🚀 Quick Reference (TL;DR)
8
+ ## Quick Reference
13
9
 
14
- | Command | Description | Example |
10
+ | Command | What it does | Example |
15
11
  | :--- | :--- | :--- |
16
- | `analyze` | Full architectural health audit | `reactlens analyze ./src` |
17
- | `graph` | Visual dependency graph (SVG/PNG) | `reactlens graph ./src --output architecture.svg` |
12
+ | `analyze` | Full architectural audit | `reactlens analyze ./src` |
13
+ | `graph` | Visualizes your dependencies | `reactlens graph ./src --output arch.svg` |
18
14
 
19
- ## 📦 Installation
15
+ ## Installation
20
16
 
21
17
  ```bash
22
18
  npm install -g @mohamed_fadl/reactlens
23
19
  ```
24
20
 
25
- ## 🛠️ Usage Examples
21
+ ## How to use it
26
22
 
27
23
  ```bash
28
- # Basic health check
24
+ # Scan the current folder
29
25
  reactlens analyze
30
26
 
31
- # Enforce quality standards (fails if score < 80)
27
+ # Set a quality gate (fails if score is under 80)
32
28
  reactlens analyze ./src --fail-under 80
33
29
 
34
- # Export for CI/CD integration
30
+ # Export raw JSON for your CI/CD
35
31
  reactlens analyze --json report.json --silent
36
32
  ```
37
33
 
38
34
  ---
39
35
 
40
- ## 🔧 System Requirements (Graphviz)
36
+ ## System Requirements (Graphviz)
41
37
 
42
- To use the `graph` command, you need **Graphviz (2.40+)** installed:
38
+ If you want to use the `graph` command, you need **Graphviz (2.40+)**:
43
39
 
44
40
  - **Windows:** `winget install graphviz`
45
41
  - **macOS:** `brew install graphviz`
46
42
  - **Linux:** `sudo apt install graphviz`
47
43
 
48
44
  > [!TIP]
49
- > **Troubleshooting:** If the `graph` command fails, verify that the Graphviz `bin` folder is in your system's `PATH`.
45
+ > If `graph` fails, double-check that Graphviz is in your system's PATH.
50
46
 
51
47
  ---
52
48
 
53
- ## 📊 Detailed Commands
49
+ ## Command Details
54
50
 
55
51
  ### `reactlens analyze [path] [options]`
56
- Analyze architectural health, complexity, and dependencies.
52
+ Starts the architectural analysis.
57
53
 
58
54
  **Options:**
59
- - `-j, --json [file]` : Output report in JSON format.
60
- - `-s, --silent` : Suppress visual terminal report.
61
- - `--fail-under <score>` : Exit with error if score is below the limit.
55
+ - `-j, --json [file]` : Saves the report as JSON.
56
+ - `-s, --silent` : Hides the terminal UI (great for scripts).
57
+ - `--fail-under <score>` : Returns an error code if the score is too low.
62
58
 
63
- ### 🧩 JSON Structure
64
- When using `--json`, the output follows this schema:
65
- - `summary`: High-level counts (Modules, Components).
59
+ ### JSON Schema
60
+ If you're piping the JSON into other tools, here's what to look for:
61
+ - `summary`: Component and module counts.
66
62
  - `metrics`: Scores for Complexity, Coupling, and Zombies.
67
- - `insights`: Detailed findings and refactoring recommendations.
68
- - `score`: The final architectural integrity percentage.
63
+ - `insights`: Our suggestions for refactoring.
64
+ - `score`: The overall health percentage.
69
65
 
70
66
  ### `reactlens graph [path] --output <file>`
71
- Visualize module relationships. Supports `.svg`, `.png`, and `.dot` formats.
67
+ Creates a visual map of your modules. We support `.svg`, `.png`, and `.dot`.
72
68
 
73
69
  ---
74
70
 
75
- ## 🧠 Understanding the Score
71
+ ## How we calculate the Score
76
72
 
77
- We calculate project health based on three pillars:
73
+ We look at three main pillars:
78
74
 
79
- 1. **Complexity (40%)**: Analysis of component size and prop health.
80
- 2. **Coupling (40%)**: Detection of circular dependencies.
81
- 3. **Zombies (20%)**: Identification of unreachable/unused modules.
75
+ 1. **Complexity (40%)**: We check for massive components and "prop-heavy" code.
76
+ 2. **Coupling (40%)**: We look for circular dependencies that tangle your codebase.
77
+ 3. **Zombies (20%)**: We find files that aren't actually being used.
82
78
 
83
79
  ---
84
80
 
85
- ## 📖 Deep Dive
86
-
87
- For technical details on algorithms and scoring, visit the [Engineering Reference](ENGINEERING.md).
81
+ ## Technical Details
88
82
 
89
- ---
90
- *Maintained by the ReactLens Engineering Team.*
83
+ If you're curious about the math or how we use Babel AST, check out our [Engineering Reference](ENGINEERING.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohamed_fadl/reactlens",
3
- "version": "1.2.0-beta.7",
3
+ "version": "1.2.0-beta.9",
4
4
  "description": "Intelligent architectural analysis tool for React and Next.js applications.",
5
5
  "main": "./dist/cli/index.js",
6
6
  "bin": {