@riturathinsharma/prism-guard 1.0.0 → 1.0.1
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 +253 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1 +1,253 @@
|
|
|
1
|
-
|
|
1
|
+
# Prism Guard
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
|
|
5
|
+
**Frontend Architecture Intelligence Platform for React & TypeScript**
|
|
6
|
+
|
|
7
|
+
Analyze architectural quality, React anti-patterns, performance bottlenecks and code health with a single command.
|
|
8
|
+
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- 🏗️ Frontend Architecture Analysis
|
|
16
|
+
- ⚛️ React Best Practices
|
|
17
|
+
- ⚡ Performance Anti-pattern Detection
|
|
18
|
+
- 📊 Architecture Quality Score (0–100)
|
|
19
|
+
- 📄 Interactive HTML Dashboard
|
|
20
|
+
- 📦 JSON Reporter
|
|
21
|
+
- 🛡️ SARIF Export
|
|
22
|
+
- 💻 Rich CLI Output
|
|
23
|
+
- 🚀 Zero Configuration
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install -D @riturathinsharma/prism-guard
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
or
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx @riturathinsharma/prism-guard analyze
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
# Quick Start
|
|
42
|
+
|
|
43
|
+
Analyze your project
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx prism-guard analyze
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Generate an interactive HTML report
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx prism-guard analyze --html
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Generate JSON
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx prism-guard analyze --json
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Generate SARIF
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npx prism-guard analyze --sarif
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
# Sample Output
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
═══════════════════════════════════════
|
|
73
|
+
Prism Guard
|
|
74
|
+
═══════════════════════════════════════
|
|
75
|
+
|
|
76
|
+
Score : 88/100
|
|
77
|
+
Files : 245
|
|
78
|
+
Rules : 21
|
|
79
|
+
Errors : 2
|
|
80
|
+
Warnings : 14
|
|
81
|
+
Info : 7
|
|
82
|
+
|
|
83
|
+
═══════════════════════════════════════
|
|
84
|
+
|
|
85
|
+
Top Rules
|
|
86
|
+
|
|
87
|
+
• no-inline-callback
|
|
88
|
+
• expensive-render
|
|
89
|
+
• circular-import
|
|
90
|
+
|
|
91
|
+
Worst Files
|
|
92
|
+
|
|
93
|
+
78/100 Dashboard.tsx
|
|
94
|
+
84/100 UserList.tsx
|
|
95
|
+
|
|
96
|
+
Recommendations
|
|
97
|
+
|
|
98
|
+
✔ Memoize expensive renders
|
|
99
|
+
✔ Break circular imports
|
|
100
|
+
✔ Replace array index keys
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
# Interactive HTML Report
|
|
106
|
+
|
|
107
|
+
Generate a beautiful interactive dashboard.
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npx prism-guard analyze --html
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Includes
|
|
114
|
+
|
|
115
|
+
- Architecture Score
|
|
116
|
+
- Rule Distribution
|
|
117
|
+
- Worst Files
|
|
118
|
+
- Searchable Issues
|
|
119
|
+
- Pagination
|
|
120
|
+
- Recommendations
|
|
121
|
+
- File Scores
|
|
122
|
+
- Dashboard Cards
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Interactive HTML Dashboard
|
|
127
|
+
|
|
128
|
+

|
|
129
|
+
|
|
130
|
+
## Search, Sort & Pagination
|
|
131
|
+
|
|
132
|
+

|
|
133
|
+
|
|
134
|
+
# Rules
|
|
135
|
+
|
|
136
|
+
## React
|
|
137
|
+
|
|
138
|
+
- No Inline Callback
|
|
139
|
+
- No Array Index Key
|
|
140
|
+
- Nested Components
|
|
141
|
+
- Excessive useEffect
|
|
142
|
+
- Large Components
|
|
143
|
+
- Anonymous Components
|
|
144
|
+
- Unstable Context
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Performance
|
|
149
|
+
|
|
150
|
+
- Blocking Imports
|
|
151
|
+
- Dynamic Import Suggestions
|
|
152
|
+
- Lazy Images
|
|
153
|
+
- Bundle Budget
|
|
154
|
+
- Expensive Render Detection
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Architecture
|
|
159
|
+
|
|
160
|
+
- Circular Imports
|
|
161
|
+
- Feature Boundaries
|
|
162
|
+
- Folder Boundaries
|
|
163
|
+
- Dependency Direction
|
|
164
|
+
- Component Complexity
|
|
165
|
+
- Excessive Props
|
|
166
|
+
- Duplicate Hooks
|
|
167
|
+
- Cognitive Complexity
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
# CLI
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
prism-guard analyze
|
|
175
|
+
|
|
176
|
+
Options
|
|
177
|
+
|
|
178
|
+
--html
|
|
179
|
+
--json
|
|
180
|
+
--sarif
|
|
181
|
+
--config
|
|
182
|
+
--output
|
|
183
|
+
--cwd
|
|
184
|
+
--verbose
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
# Example
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
npx prism-guard analyze --html
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Creates
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
prism-report.html
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
# Roadmap
|
|
204
|
+
|
|
205
|
+
- [x] React Rules
|
|
206
|
+
- [x] Performance Rules
|
|
207
|
+
- [x] Architecture Rules
|
|
208
|
+
- [x] HTML Dashboard
|
|
209
|
+
- [x] JSON Reporter
|
|
210
|
+
- [x] SARIF Reporter
|
|
211
|
+
- [x] Scoring Engine
|
|
212
|
+
- [ ] Auto Fixes
|
|
213
|
+
- [ ] VS Code Extension
|
|
214
|
+
- [ ] GitHub Action
|
|
215
|
+
- [ ] AI-Powered Fix Suggestions
|
|
216
|
+
- [ ] Custom Rule SDK
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
# Why Prism Guard?
|
|
221
|
+
|
|
222
|
+
Traditional linters answer:
|
|
223
|
+
|
|
224
|
+
> "Is this code syntactically correct?"
|
|
225
|
+
|
|
226
|
+
Prism Guard answers:
|
|
227
|
+
|
|
228
|
+
- Is this component becoming too complex?
|
|
229
|
+
- Are React best practices being followed?
|
|
230
|
+
- Are architectural boundaries respected?
|
|
231
|
+
- Which files are hurting maintainability?
|
|
232
|
+
- Where are performance bottlenecks?
|
|
233
|
+
- What should the team fix first?
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
# License
|
|
238
|
+
|
|
239
|
+
MIT
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
# Author
|
|
244
|
+
|
|
245
|
+
**Ritumoni Sarma**
|
|
246
|
+
|
|
247
|
+
GitHub
|
|
248
|
+
|
|
249
|
+
https://github.com/Riturathin
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
⭐ If Prism Guard helps improve your codebase, consider starring the repository.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riturathinsharma/prism-guard",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Frontend architecture intelligence platform for React and TypeScript",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ritumoni Sarma",
|
|
@@ -39,4 +39,4 @@
|
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
}
|
|
42
|
-
}
|
|
42
|
+
}
|