@nexus-ioc/graph-analyzer 0.1.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/CHANGELOG.md +112 -0
- package/LICENSE +21 -0
- package/README.md +742 -0
- package/dist/analyzer/circular-dependency-detector.d.ts +94 -0
- package/dist/analyzer/circular-dependency-detector.js +203 -0
- package/dist/analyzer/circular-dependency-detector.js.map +1 -0
- package/dist/analyzer/module-depth-analyzer.d.ts +117 -0
- package/dist/analyzer/module-depth-analyzer.js +221 -0
- package/dist/analyzer/module-depth-analyzer.js.map +1 -0
- package/dist/analyzer/provider-scope-analyzer.d.ts +91 -0
- package/dist/analyzer/provider-scope-analyzer.js +137 -0
- package/dist/analyzer/provider-scope-analyzer.js.map +1 -0
- package/dist/analyzer/unused-provider-detector.d.ts +73 -0
- package/dist/analyzer/unused-provider-detector.js +147 -0
- package/dist/analyzer/unused-provider-detector.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +537 -0
- package/dist/cli.js.map +1 -0
- package/dist/config/config-loader.d.ts +27 -0
- package/dist/config/config-loader.js +205 -0
- package/dist/config/config-loader.js.map +1 -0
- package/dist/config/config-schema.d.ts +83 -0
- package/dist/config/config-schema.js +97 -0
- package/dist/config/config-schema.js.map +1 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +50 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/graph-output.interface.d.ts +126 -0
- package/dist/interfaces/graph-output.interface.js +3 -0
- package/dist/interfaces/graph-output.interface.js.map +1 -0
- package/dist/interfaces/providers.interface.d.ts +10 -0
- package/dist/interfaces/providers.interface.js +3 -0
- package/dist/interfaces/providers.interface.js.map +1 -0
- package/dist/parser/dependency-extractor.d.ts +88 -0
- package/dist/parser/dependency-extractor.js +334 -0
- package/dist/parser/dependency-extractor.js.map +1 -0
- package/dist/parser/parse-entry-file.d.ts +15 -0
- package/dist/parser/parse-entry-file.js +46 -0
- package/dist/parser/parse-entry-file.js.map +1 -0
- package/dist/parser/parse-imports.d.ts +15 -0
- package/dist/parser/parse-imports.js +65 -0
- package/dist/parser/parse-imports.js.map +1 -0
- package/dist/parser/parse-ns-module.d.ts +39 -0
- package/dist/parser/parse-ns-module.js +122 -0
- package/dist/parser/parse-ns-module.js.map +1 -0
- package/dist/parser/parse-provider.d.ts +2 -0
- package/dist/parser/parse-provider.js +7 -0
- package/dist/parser/parse-provider.js.map +1 -0
- package/dist/parser/parse-ts-config.d.ts +10 -0
- package/dist/parser/parse-ts-config.js +40 -0
- package/dist/parser/parse-ts-config.js.map +1 -0
- package/dist/parser/parser-rec.d.ts +1 -0
- package/dist/parser/parser-rec.js +52 -0
- package/dist/parser/parser-rec.js.map +1 -0
- package/dist/parser/parser.d.ts +1 -0
- package/dist/parser/parser.js +61 -0
- package/dist/parser/parser.js.map +1 -0
- package/dist/parser/provider/class-parser.d.ts +20 -0
- package/dist/parser/provider/class-parser.js +137 -0
- package/dist/parser/provider/class-parser.js.map +1 -0
- package/dist/parser/provider/providers-parser.d.ts +9 -0
- package/dist/parser/provider/providers-parser.js +32 -0
- package/dist/parser/provider/providers-parser.js.map +1 -0
- package/dist/parser/provider/use-class-parser.d.ts +25 -0
- package/dist/parser/provider/use-class-parser.js +161 -0
- package/dist/parser/provider/use-class-parser.js.map +1 -0
- package/dist/parser/provider/use-factory-parser.d.ts +15 -0
- package/dist/parser/provider/use-factory-parser.js +53 -0
- package/dist/parser/provider/use-factory-parser.js.map +1 -0
- package/dist/parser/provider/use-value-parser.d.ts +13 -0
- package/dist/parser/provider/use-value-parser.js +41 -0
- package/dist/parser/provider/use-value-parser.js.map +1 -0
- package/dist/parser/rules.d.ts +10 -0
- package/dist/parser/rules.js +37 -0
- package/dist/parser/rules.js.map +1 -0
- package/dist/utils/error-formatter.d.ts +27 -0
- package/dist/utils/error-formatter.js +177 -0
- package/dist/utils/error-formatter.js.map +1 -0
- package/dist/utils/validator.d.ts +45 -0
- package/dist/utils/validator.js +252 -0
- package/dist/utils/validator.js.map +1 -0
- package/dist/visualize/generator.d.ts +26 -0
- package/dist/visualize/generator.js +75 -0
- package/dist/visualize/generator.js.map +1 -0
- package/dist/visualize/graph-analyzer.d.ts +126 -0
- package/dist/visualize/graph-analyzer.js +199 -0
- package/dist/visualize/graph-analyzer.js.map +1 -0
- package/dist/visualize/html-generator.d.ts +71 -0
- package/dist/visualize/html-generator.js +1312 -0
- package/dist/visualize/html-generator.js.map +1 -0
- package/dist/visualize/json-formatter.d.ts +106 -0
- package/dist/visualize/json-formatter.js +252 -0
- package/dist/visualize/json-formatter.js.map +1 -0
- package/docs/API_REFERENCE.md +747 -0
- package/docs/ARCHITECTURE.md +486 -0
- package/docs/CLI_GUIDE.md +576 -0
- package/docs/HTML_VISUALIZATION.md +365 -0
- package/package.json +85 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
# Interactive HTML Visualization
|
|
2
|
+
|
|
3
|
+
The Graph Analyzer now supports generating interactive HTML visualizations of your dependency injection graphs. This provides a more user-friendly way to explore and understand your application's dependency structure compared to static PNG images.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
### Visual Grouping
|
|
8
|
+
- **Compound Nodes**: Providers are visually grouped inside their parent modules using Cytoscape.js compound nodes
|
|
9
|
+
- **Clear Module Boundaries**: Each module is displayed as a container with a semi-transparent background and border
|
|
10
|
+
- **Hierarchical Layout**: The COSE layout algorithm respects parent-child relationships, keeping providers close to their modules
|
|
11
|
+
- **Easy Identification**: At a glance, you can see which providers belong to which module
|
|
12
|
+
- **Global Module Highlighting**: Global modules are displayed with a purple background to distinguish them from regular modules
|
|
13
|
+
|
|
14
|
+
### Interactive Graph
|
|
15
|
+
- **Zoom and Pan**: Navigate large dependency graphs with ease
|
|
16
|
+
- **Click to Explore**: Click on any node to see detailed information
|
|
17
|
+
- **Hover Effects**: Visual feedback when hovering over nodes
|
|
18
|
+
- **Search**: Quickly find specific modules or providers
|
|
19
|
+
- **View Modes**: Toggle between different views (all, modules only, providers only)
|
|
20
|
+
- **Clickable Relationships**: Navigate between related nodes by clicking on imports, providers, exports, and dependencies in the info panel
|
|
21
|
+
|
|
22
|
+
### Node Information
|
|
23
|
+
When you click on a node, you'll see:
|
|
24
|
+
- **For Modules**:
|
|
25
|
+
- Module name and type
|
|
26
|
+
- File path (clickable to open in your IDE)
|
|
27
|
+
- Imported modules (clickable to navigate to that module)
|
|
28
|
+
- Registered providers (clickable to navigate to that provider)
|
|
29
|
+
- Exported providers (clickable to navigate to that provider)
|
|
30
|
+
- Global status
|
|
31
|
+
|
|
32
|
+
- **For Providers**:
|
|
33
|
+
- Provider token and type (Class, UseValue, UseFactory, UseClass)
|
|
34
|
+
- Module that registers the provider (clickable to navigate to that module)
|
|
35
|
+
- Lifecycle scope (Singleton, Request, Transient)
|
|
36
|
+
- Dependencies (clickable to navigate to that dependency)
|
|
37
|
+
- Type-specific information (value, factory function, implementation class)
|
|
38
|
+
|
|
39
|
+
### Interactive Navigation
|
|
40
|
+
The info panel makes it easy to explore your dependency graph:
|
|
41
|
+
- **Click on any import** in a module's "Imports" list to navigate to that module
|
|
42
|
+
- **Click on any provider** in a module's "Providers" or "Exports" list to navigate to that provider
|
|
43
|
+
- **Click on any dependency** in a provider's "Dependencies" list to navigate to that dependency
|
|
44
|
+
- **Click on the module name** in a provider's details to navigate back to the module
|
|
45
|
+
|
|
46
|
+
When you click on a relationship:
|
|
47
|
+
1. The graph automatically pans and zooms to center on the target node
|
|
48
|
+
2. The target node is highlighted with a visual indicator
|
|
49
|
+
3. The info panel updates to show the details of the newly selected node
|
|
50
|
+
4. The animation is smooth and takes 500ms with an ease-in-out-cubic easing function
|
|
51
|
+
|
|
52
|
+
### IDE Integration
|
|
53
|
+
File paths are clickable and will open directly in your IDE:
|
|
54
|
+
- **VS Code**: `vscode://file/{path}:{line}:{column}`
|
|
55
|
+
- **WebStorm/IntelliJ IDEA**: `idea://open?file={path}&line={line}`
|
|
56
|
+
- **Custom**: Define your own URL template
|
|
57
|
+
|
|
58
|
+
### Themes
|
|
59
|
+
- **Light Theme**: Default, suitable for bright environments
|
|
60
|
+
- **Dark Theme**: Easy on the eyes for dark mode users
|
|
61
|
+
|
|
62
|
+
## Usage
|
|
63
|
+
|
|
64
|
+
### CLI
|
|
65
|
+
|
|
66
|
+
#### Generate HTML Only
|
|
67
|
+
```bash
|
|
68
|
+
# Basic usage
|
|
69
|
+
graph-analyzer -f html src/main.ts
|
|
70
|
+
|
|
71
|
+
# With custom output path
|
|
72
|
+
graph-analyzer -f html -o output/graph.html src/main.ts
|
|
73
|
+
|
|
74
|
+
# With dark theme
|
|
75
|
+
graph-analyzer -f html --dark src/main.ts
|
|
76
|
+
|
|
77
|
+
# With WebStorm IDE integration
|
|
78
|
+
graph-analyzer -f html --ide webstorm src/main.ts
|
|
79
|
+
|
|
80
|
+
# All options combined
|
|
81
|
+
graph-analyzer -f html -o docs/dependencies.html --ide vscode --dark src/main.ts
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
#### Generate Multiple Formats
|
|
85
|
+
```bash
|
|
86
|
+
# Generate JSON, PNG, and HTML
|
|
87
|
+
graph-analyzer -f both src/main.ts # Generates JSON and PNG (default)
|
|
88
|
+
|
|
89
|
+
# To generate HTML alongside other formats, run multiple commands:
|
|
90
|
+
graph-analyzer -f json -o output/graph.json src/main.ts
|
|
91
|
+
graph-analyzer -f png -o output/graph.png src/main.ts
|
|
92
|
+
graph-analyzer -f html -o output/graph.html src/main.ts
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Programmatic Usage
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import { GraphAnalyzer } from '@nexus-ioc/graph-analyzer';
|
|
99
|
+
import * as fs from 'fs';
|
|
100
|
+
|
|
101
|
+
// ... build your module graph ...
|
|
102
|
+
|
|
103
|
+
// Generate HTML with default options
|
|
104
|
+
const analyzer = new GraphAnalyzer(modulesGraph, 'src/main.ts', {
|
|
105
|
+
outputFormat: 'html',
|
|
106
|
+
htmlOutputPath: './graph.html'
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
analyzer.parse();
|
|
110
|
+
|
|
111
|
+
// Generate HTML with custom options
|
|
112
|
+
const analyzerWithOptions = new GraphAnalyzer(modulesGraph, 'src/main.ts', {
|
|
113
|
+
outputFormat: 'html',
|
|
114
|
+
htmlOutputPath: './graph.html',
|
|
115
|
+
htmlOptions: {
|
|
116
|
+
ideProtocol: 'vscode',
|
|
117
|
+
darkTheme: true,
|
|
118
|
+
title: 'My Application Dependencies'
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
analyzerWithOptions.parse();
|
|
123
|
+
|
|
124
|
+
// Or use the generateHtml method directly
|
|
125
|
+
analyzer.generateHtml();
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Using HtmlGenerator Directly
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
import { HtmlGenerator } from '@nexus-ioc/graph-analyzer';
|
|
132
|
+
|
|
133
|
+
const generator = new HtmlGenerator(modulesGraph, 'src/main.ts', {
|
|
134
|
+
ideProtocol: 'webstorm',
|
|
135
|
+
darkTheme: false,
|
|
136
|
+
title: 'Production Dependencies',
|
|
137
|
+
customIdeUrl: 'custom://open/{path}:{line}:{column}'
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const html = generator.generate();
|
|
141
|
+
fs.writeFileSync('graph.html', html);
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Configuration Options
|
|
145
|
+
|
|
146
|
+
### GraphAnalyzerOptions
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
interface GraphAnalyzerOptions {
|
|
150
|
+
outputFormat?: 'json' | 'png' | 'html' | 'both';
|
|
151
|
+
outputPath?: string;
|
|
152
|
+
htmlOutputPath?: string;
|
|
153
|
+
htmlOptions?: HtmlGeneratorOptions;
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### HtmlGeneratorOptions
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
interface HtmlGeneratorOptions {
|
|
161
|
+
/** IDE protocol for clickable file links (default: 'vscode') */
|
|
162
|
+
ideProtocol?: 'vscode' | 'webstorm' | 'idea' | 'custom';
|
|
163
|
+
|
|
164
|
+
/** Custom IDE URL template (e.g., 'vscode://file/{path}:{line}:{column}') */
|
|
165
|
+
customIdeUrl?: string;
|
|
166
|
+
|
|
167
|
+
/** Title for the HTML page (default: 'Dependency Graph') */
|
|
168
|
+
title?: string;
|
|
169
|
+
|
|
170
|
+
/** Whether to use dark theme (default: false) */
|
|
171
|
+
darkTheme?: boolean;
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## IDE Protocol Setup
|
|
176
|
+
|
|
177
|
+
### VS Code
|
|
178
|
+
VS Code supports the `vscode://` protocol out of the box. No additional setup required.
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
graph-analyzer -f html --ide vscode src/main.ts
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### WebStorm / IntelliJ IDEA
|
|
185
|
+
WebStorm and IntelliJ IDEA support the `idea://` protocol. You may need to enable it in your IDE settings.
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
graph-analyzer -f html --ide webstorm src/main.ts
|
|
189
|
+
# or
|
|
190
|
+
graph-analyzer -f html --ide idea src/main.ts
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Custom Protocol
|
|
194
|
+
If you're using a different IDE or want a custom URL format:
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
const analyzer = new GraphAnalyzer(modulesGraph, 'src/main.ts', {
|
|
198
|
+
outputFormat: 'html',
|
|
199
|
+
htmlOptions: {
|
|
200
|
+
ideProtocol: 'custom',
|
|
201
|
+
customIdeUrl: 'atom://open?file={path}&line={line}&column={column}'
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Graph Visualization Details
|
|
207
|
+
|
|
208
|
+
### Visual Grouping with Compound Nodes
|
|
209
|
+
|
|
210
|
+
The visualization uses **Cytoscape.js compound nodes** to create a clear hierarchical structure:
|
|
211
|
+
|
|
212
|
+
#### Module Containers (Parent Nodes)
|
|
213
|
+
- **Appearance**: Semi-transparent rounded rectangles with borders
|
|
214
|
+
- **Background**: Light blue (#90caf9) at 15% opacity
|
|
215
|
+
- **Border**: 3px solid border (#42a5f5) at 80% opacity
|
|
216
|
+
- **Padding**: 20px around child nodes
|
|
217
|
+
- **Label Position**: Top center, above the container
|
|
218
|
+
- **Global Modules**: Purple background (#ce93d8) with 4px border (#ab47bc)
|
|
219
|
+
|
|
220
|
+
#### Provider Nodes (Child Nodes)
|
|
221
|
+
- **Shape**: Ellipse
|
|
222
|
+
- **Size**: 80px × 80px
|
|
223
|
+
- **Position**: Inside their parent module container
|
|
224
|
+
- **Colors by Type**:
|
|
225
|
+
- Class: Light green (#a5d6a7)
|
|
226
|
+
- UseValue: Light green (#a5d6a7)
|
|
227
|
+
- UseFactory: Light coral (#ffab91)
|
|
228
|
+
- UseClass: Light yellow (#fff59d)
|
|
229
|
+
|
|
230
|
+
#### Benefits of Compound Nodes
|
|
231
|
+
1. **Clear Ownership**: Immediately see which providers belong to which module
|
|
232
|
+
2. **Reduced Visual Clutter**: No need for "provides" edges since containment shows the relationship
|
|
233
|
+
3. **Better Layout**: The COSE algorithm keeps related nodes together
|
|
234
|
+
4. **Scalability**: Works well with large graphs (25+ modules, 60+ providers)
|
|
235
|
+
5. **Contextual Filtering**: View modes preserve module containers for context
|
|
236
|
+
|
|
237
|
+
### Edge Types
|
|
238
|
+
|
|
239
|
+
#### Import Edges
|
|
240
|
+
- **Color**: Gray (#666)
|
|
241
|
+
- **Style**: Solid line
|
|
242
|
+
- **Direction**: From importing module to imported module
|
|
243
|
+
- **Purpose**: Shows module-to-module dependencies
|
|
244
|
+
|
|
245
|
+
#### Dependency Edges
|
|
246
|
+
- **Color**: Orange (#ff9800)
|
|
247
|
+
- **Style**: Solid line (dotted for optional dependencies)
|
|
248
|
+
- **Direction**: From provider to its dependencies
|
|
249
|
+
- **Purpose**: Shows provider-to-provider dependencies
|
|
250
|
+
|
|
251
|
+
## Interactive Controls
|
|
252
|
+
|
|
253
|
+
### View Modes
|
|
254
|
+
- **All**: Shows both modules (with their provider children) and all connections
|
|
255
|
+
- **Modules Only**: Shows module containers and import edges, hides provider nodes and dependency edges
|
|
256
|
+
- **Providers Only**: Shows module containers (for context) with provider nodes and dependency edges, hides import edges
|
|
257
|
+
|
|
258
|
+
Note: Module containers are always visible in "Providers Only" mode to maintain visual context and grouping.
|
|
259
|
+
|
|
260
|
+
### Search
|
|
261
|
+
Type in the search box to highlight matching nodes. The graph will automatically zoom to fit the highlighted nodes.
|
|
262
|
+
|
|
263
|
+
### Zoom Controls
|
|
264
|
+
- **Reset View**: Resets zoom to 100% and centers the graph
|
|
265
|
+
- **Fit to Screen**: Adjusts zoom to fit all visible nodes in the viewport
|
|
266
|
+
|
|
267
|
+
### Navigation
|
|
268
|
+
- **Click on nodes**: Select a node to view its details in the info panel
|
|
269
|
+
- **Click on relationships**: Click on any import, provider, export, or dependency in the info panel to navigate to that node
|
|
270
|
+
- **Smooth animations**: All navigation includes smooth pan and zoom animations for better user experience
|
|
271
|
+
|
|
272
|
+
## Browser Compatibility
|
|
273
|
+
|
|
274
|
+
The HTML visualization uses modern web technologies:
|
|
275
|
+
- **Cytoscape.js**: For graph rendering
|
|
276
|
+
- **ES6+**: Modern JavaScript features
|
|
277
|
+
- **CSS Grid/Flexbox**: For layout
|
|
278
|
+
|
|
279
|
+
Supported browsers:
|
|
280
|
+
- Chrome/Edge 90+
|
|
281
|
+
- Firefox 88+
|
|
282
|
+
- Safari 14+
|
|
283
|
+
|
|
284
|
+
## Examples
|
|
285
|
+
|
|
286
|
+
### Example 1: Simple Application
|
|
287
|
+
```bash
|
|
288
|
+
graph-analyzer -f html -o docs/dependencies.html src/main.ts
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
This generates a simple HTML file at `docs/dependencies.html` with default settings.
|
|
292
|
+
|
|
293
|
+
### Example 2: Dark Theme for Documentation
|
|
294
|
+
```bash
|
|
295
|
+
graph-analyzer -f html -o docs/architecture.html --dark --ide vscode src/main.ts
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Perfect for including in your project documentation with a dark theme.
|
|
299
|
+
|
|
300
|
+
### Example 3: CI/CD Integration
|
|
301
|
+
```bash
|
|
302
|
+
# In your CI/CD pipeline
|
|
303
|
+
npm run build
|
|
304
|
+
graph-analyzer -f html -o dist/docs/dependencies.html src/main.ts
|
|
305
|
+
|
|
306
|
+
# Deploy the HTML file with your documentation
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Example 4: Multiple Outputs
|
|
310
|
+
```bash
|
|
311
|
+
# Generate all formats for different use cases
|
|
312
|
+
graph-analyzer -f json -o output/graph.json src/main.ts # For programmatic analysis
|
|
313
|
+
graph-analyzer -f png -o output/graph.png src/main.ts # For static documentation
|
|
314
|
+
graph-analyzer -f html -o output/graph.html src/main.ts # For interactive exploration
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## Tips and Best Practices
|
|
318
|
+
|
|
319
|
+
1. **Use Dark Theme for Presentations**: The dark theme is easier on the eyes during presentations
|
|
320
|
+
2. **Include in Documentation**: Add the HTML file to your project documentation for easy reference
|
|
321
|
+
3. **CI/CD Integration**: Generate the HTML file in your CI/CD pipeline to keep it up-to-date
|
|
322
|
+
4. **Share with Team**: The HTML file is self-contained and can be easily shared with team members
|
|
323
|
+
5. **Use Search**: For large graphs, use the search feature to quickly find specific modules or providers
|
|
324
|
+
6. **View Modes**: Use view modes to focus on specific aspects of your dependency graph
|
|
325
|
+
|
|
326
|
+
## Troubleshooting
|
|
327
|
+
|
|
328
|
+
### IDE Links Not Working
|
|
329
|
+
|
|
330
|
+
**Problem**: Clicking on file paths doesn't open the IDE.
|
|
331
|
+
|
|
332
|
+
**Solution**:
|
|
333
|
+
- Make sure your IDE supports the protocol (VS Code, WebStorm, IntelliJ IDEA)
|
|
334
|
+
- Check if the protocol handler is registered in your system
|
|
335
|
+
- Try using a different IDE protocol option
|
|
336
|
+
|
|
337
|
+
### Graph Too Large
|
|
338
|
+
|
|
339
|
+
**Problem**: The graph is too large and difficult to navigate.
|
|
340
|
+
|
|
341
|
+
**Solution**:
|
|
342
|
+
- Use the search feature to find specific nodes
|
|
343
|
+
- Use view modes to focus on modules or providers only
|
|
344
|
+
- Use the zoom controls to navigate
|
|
345
|
+
- Consider breaking down your application into smaller modules
|
|
346
|
+
|
|
347
|
+
### Styling Issues
|
|
348
|
+
|
|
349
|
+
**Problem**: The HTML doesn't look right in your browser.
|
|
350
|
+
|
|
351
|
+
**Solution**:
|
|
352
|
+
- Make sure you're using a modern browser (Chrome 90+, Firefox 88+, Safari 14+)
|
|
353
|
+
- Check if JavaScript is enabled
|
|
354
|
+
- Try opening the file in a different browser
|
|
355
|
+
|
|
356
|
+
## Future Enhancements
|
|
357
|
+
|
|
358
|
+
Planned features for future releases:
|
|
359
|
+
- Export graph as image from the HTML page
|
|
360
|
+
- Filter by module or provider type
|
|
361
|
+
- Highlight circular dependencies
|
|
362
|
+
- Show dependency depth
|
|
363
|
+
- Collapsible module groups
|
|
364
|
+
- Performance metrics overlay
|
|
365
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nexus-ioc/graph-analyzer",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Static analysis and visualization tool for Nexus IoC dependency injection graphs. Detect circular dependencies, unused providers, scope mismatches, and visualize your architecture with interactive HTML graphs.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"nexus-ioc",
|
|
7
|
+
"dependency-injection",
|
|
8
|
+
"static-analysis",
|
|
9
|
+
"graph-visualization",
|
|
10
|
+
"typescript",
|
|
11
|
+
"ast-parser",
|
|
12
|
+
"di-container",
|
|
13
|
+
"dependency-graph",
|
|
14
|
+
"code-analysis",
|
|
15
|
+
"graphviz"
|
|
16
|
+
],
|
|
17
|
+
"author": "IsqanderM <aleksandr.melnik.personal@gmail.com>",
|
|
18
|
+
"homepage": "https://github.com/Isqanderm/ioc/tree/main/packages/graph-analyzer#readme",
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"module": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"bin": {
|
|
23
|
+
"graph-analyzer": "./dist/cli.js"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"directories": {
|
|
27
|
+
"lib": "src",
|
|
28
|
+
"test": "__test__"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist/**/*.js",
|
|
32
|
+
"dist/**/*.d.ts",
|
|
33
|
+
"dist/**/*.js.map",
|
|
34
|
+
"!dist/**/__tests__",
|
|
35
|
+
"!dist/**/*.spec.*",
|
|
36
|
+
"!dist/**/*.test.*",
|
|
37
|
+
"docs/API_REFERENCE.md",
|
|
38
|
+
"docs/ARCHITECTURE.md",
|
|
39
|
+
"docs/CLI_GUIDE.md",
|
|
40
|
+
"docs/HTML_VISUALIZATION.md",
|
|
41
|
+
"LICENSE",
|
|
42
|
+
"README.md",
|
|
43
|
+
"CHANGELOG.md"
|
|
44
|
+
],
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "git+https://github.com/Isqanderm/ioc.git",
|
|
48
|
+
"directory": "packages/graph-analyzer"
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
55
|
+
"nexus-ioc": "^0.2.0",
|
|
56
|
+
"reflect-metadata": "^0.1.12 || ^0.2.0",
|
|
57
|
+
"sinon": "^18.0.0",
|
|
58
|
+
"ts-node": "^10.9.2",
|
|
59
|
+
"vitest": "^2.1.8"
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"build": "tsc",
|
|
63
|
+
"test": "vitest run",
|
|
64
|
+
"clean": "rm -rf ./dist && rm tsconfig.tsbuildinfo",
|
|
65
|
+
"test:watch": "vitest",
|
|
66
|
+
"test:coverage": "vitest run --coverage",
|
|
67
|
+
"prepublishOnly": "npm run clean && npm run build && npm test",
|
|
68
|
+
"code:format": "npx @biomejs/biome format --write",
|
|
69
|
+
"code:lint": "npx @biomejs/biome lint --write",
|
|
70
|
+
"code:check": "npx @biomejs/biome check",
|
|
71
|
+
"code:check:ci": "npx @biomejs/biome ci",
|
|
72
|
+
"code:check:apply": "npx @biomejs/biome check --write"
|
|
73
|
+
},
|
|
74
|
+
"engines": {
|
|
75
|
+
"node": ">=14.0.0",
|
|
76
|
+
"npm": ">=6.0.0"
|
|
77
|
+
},
|
|
78
|
+
"bugs": {
|
|
79
|
+
"url": "https://github.com/Isqanderm/ioc/issues"
|
|
80
|
+
},
|
|
81
|
+
"dependencies": {
|
|
82
|
+
"@phenomnomnominal/tsquery": "^6.1.3",
|
|
83
|
+
"cli-spinners": "^2.9.2"
|
|
84
|
+
}
|
|
85
|
+
}
|