@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.
Files changed (98) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/LICENSE +21 -0
  3. package/README.md +742 -0
  4. package/dist/analyzer/circular-dependency-detector.d.ts +94 -0
  5. package/dist/analyzer/circular-dependency-detector.js +203 -0
  6. package/dist/analyzer/circular-dependency-detector.js.map +1 -0
  7. package/dist/analyzer/module-depth-analyzer.d.ts +117 -0
  8. package/dist/analyzer/module-depth-analyzer.js +221 -0
  9. package/dist/analyzer/module-depth-analyzer.js.map +1 -0
  10. package/dist/analyzer/provider-scope-analyzer.d.ts +91 -0
  11. package/dist/analyzer/provider-scope-analyzer.js +137 -0
  12. package/dist/analyzer/provider-scope-analyzer.js.map +1 -0
  13. package/dist/analyzer/unused-provider-detector.d.ts +73 -0
  14. package/dist/analyzer/unused-provider-detector.js +147 -0
  15. package/dist/analyzer/unused-provider-detector.js.map +1 -0
  16. package/dist/cli.d.ts +2 -0
  17. package/dist/cli.js +537 -0
  18. package/dist/cli.js.map +1 -0
  19. package/dist/config/config-loader.d.ts +27 -0
  20. package/dist/config/config-loader.js +205 -0
  21. package/dist/config/config-loader.js.map +1 -0
  22. package/dist/config/config-schema.d.ts +83 -0
  23. package/dist/config/config-schema.js +97 -0
  24. package/dist/config/config-schema.js.map +1 -0
  25. package/dist/index.d.ts +41 -0
  26. package/dist/index.js +50 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/interfaces/graph-output.interface.d.ts +126 -0
  29. package/dist/interfaces/graph-output.interface.js +3 -0
  30. package/dist/interfaces/graph-output.interface.js.map +1 -0
  31. package/dist/interfaces/providers.interface.d.ts +10 -0
  32. package/dist/interfaces/providers.interface.js +3 -0
  33. package/dist/interfaces/providers.interface.js.map +1 -0
  34. package/dist/parser/dependency-extractor.d.ts +88 -0
  35. package/dist/parser/dependency-extractor.js +334 -0
  36. package/dist/parser/dependency-extractor.js.map +1 -0
  37. package/dist/parser/parse-entry-file.d.ts +15 -0
  38. package/dist/parser/parse-entry-file.js +46 -0
  39. package/dist/parser/parse-entry-file.js.map +1 -0
  40. package/dist/parser/parse-imports.d.ts +15 -0
  41. package/dist/parser/parse-imports.js +65 -0
  42. package/dist/parser/parse-imports.js.map +1 -0
  43. package/dist/parser/parse-ns-module.d.ts +39 -0
  44. package/dist/parser/parse-ns-module.js +122 -0
  45. package/dist/parser/parse-ns-module.js.map +1 -0
  46. package/dist/parser/parse-provider.d.ts +2 -0
  47. package/dist/parser/parse-provider.js +7 -0
  48. package/dist/parser/parse-provider.js.map +1 -0
  49. package/dist/parser/parse-ts-config.d.ts +10 -0
  50. package/dist/parser/parse-ts-config.js +40 -0
  51. package/dist/parser/parse-ts-config.js.map +1 -0
  52. package/dist/parser/parser-rec.d.ts +1 -0
  53. package/dist/parser/parser-rec.js +52 -0
  54. package/dist/parser/parser-rec.js.map +1 -0
  55. package/dist/parser/parser.d.ts +1 -0
  56. package/dist/parser/parser.js +61 -0
  57. package/dist/parser/parser.js.map +1 -0
  58. package/dist/parser/provider/class-parser.d.ts +20 -0
  59. package/dist/parser/provider/class-parser.js +137 -0
  60. package/dist/parser/provider/class-parser.js.map +1 -0
  61. package/dist/parser/provider/providers-parser.d.ts +9 -0
  62. package/dist/parser/provider/providers-parser.js +32 -0
  63. package/dist/parser/provider/providers-parser.js.map +1 -0
  64. package/dist/parser/provider/use-class-parser.d.ts +25 -0
  65. package/dist/parser/provider/use-class-parser.js +161 -0
  66. package/dist/parser/provider/use-class-parser.js.map +1 -0
  67. package/dist/parser/provider/use-factory-parser.d.ts +15 -0
  68. package/dist/parser/provider/use-factory-parser.js +53 -0
  69. package/dist/parser/provider/use-factory-parser.js.map +1 -0
  70. package/dist/parser/provider/use-value-parser.d.ts +13 -0
  71. package/dist/parser/provider/use-value-parser.js +41 -0
  72. package/dist/parser/provider/use-value-parser.js.map +1 -0
  73. package/dist/parser/rules.d.ts +10 -0
  74. package/dist/parser/rules.js +37 -0
  75. package/dist/parser/rules.js.map +1 -0
  76. package/dist/utils/error-formatter.d.ts +27 -0
  77. package/dist/utils/error-formatter.js +177 -0
  78. package/dist/utils/error-formatter.js.map +1 -0
  79. package/dist/utils/validator.d.ts +45 -0
  80. package/dist/utils/validator.js +252 -0
  81. package/dist/utils/validator.js.map +1 -0
  82. package/dist/visualize/generator.d.ts +26 -0
  83. package/dist/visualize/generator.js +75 -0
  84. package/dist/visualize/generator.js.map +1 -0
  85. package/dist/visualize/graph-analyzer.d.ts +126 -0
  86. package/dist/visualize/graph-analyzer.js +199 -0
  87. package/dist/visualize/graph-analyzer.js.map +1 -0
  88. package/dist/visualize/html-generator.d.ts +71 -0
  89. package/dist/visualize/html-generator.js +1312 -0
  90. package/dist/visualize/html-generator.js.map +1 -0
  91. package/dist/visualize/json-formatter.d.ts +106 -0
  92. package/dist/visualize/json-formatter.js +252 -0
  93. package/dist/visualize/json-formatter.js.map +1 -0
  94. package/docs/API_REFERENCE.md +747 -0
  95. package/docs/ARCHITECTURE.md +486 -0
  96. package/docs/CLI_GUIDE.md +576 -0
  97. package/docs/HTML_VISUALIZATION.md +365 -0
  98. package/package.json +85 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,112 @@
1
+ # Changelog
2
+
3
+ All notable changes to the @nexus-ioc/graph-analyzer package will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2025-01-18
9
+
10
+ **First public release of @nexus-ioc/graph-analyzer!**
11
+
12
+ This release represents a complete, production-ready static analysis tool for Nexus IoC dependency injection graphs.
13
+
14
+ ### Added
15
+ - **Circular Dependency Detection** - Detect circular imports and provider dependencies using DFS algorithm
16
+ - **Unused Provider Detection** - Find providers that are registered but never injected
17
+ - **Module Depth Analysis** - Analyze module hierarchy depth and complexity metrics using BFS algorithm
18
+ - **Provider Scope Analysis** - Detect scope mismatches (Singleton depending on Request-scoped providers)
19
+ - **Interactive HTML Visualization** - Modern, interactive graph visualization with Cytoscape.js
20
+ - Click nodes to explore dependencies
21
+ - Pan and zoom controls
22
+ - Search functionality
23
+ - View mode filtering (all, modules only, providers only)
24
+ - Dark theme support
25
+ - IDE integration (VSCode, WebStorm, IntelliJ IDEA)
26
+ - Visual error indicators for circular dependencies and missing decorators
27
+ - **Missing Decorator Detection** - Identify dependencies without explicit `@Inject` decorators
28
+ - **Factory Provider Support** - Full support for `useFactory` providers with `inject` arrays
29
+ - **Provider Scope Extraction** - Extract and analyze provider scopes (Singleton, Request)
30
+ - **CLI Analysis Flags** - `--check-circular`, `--check-unused`, `--check-depth`, `--check-scope`, `--check-ci`
31
+ - **Comprehensive Test Suite** - 443 tests across 26 test files
32
+ - **Complete Documentation** - README, API Reference, Architecture, CLI Guide, HTML Visualization docs
33
+
34
+ ### Fixed
35
+ - **Canvas Click/Drag UX** - Prevent unwanted panning on simple clicks in HTML visualization
36
+ - **Factory Provider Parsing** - Remove extra quotes from inject array tokens
37
+ - **Scope Detection** - Respect explicit scopes on all provider types (UseValue, UseFactory)
38
+ - **Quote Stripping** - Properly handle string tokens in dependency injection
39
+
40
+ ### Changed
41
+ - **Package Name** - Renamed to `@nexus-ioc/graph-analyzer` for npm publication
42
+ - **Output Format** - HTML is now the recommended default format (was PNG)
43
+ - **Test Coverage** - Increased from 35 to 443 tests
44
+ - **Documentation** - Complete rewrite with comprehensive examples and troubleshooting
45
+
46
+ ### Removed
47
+ - **Generated Files** - Removed all generated HTML/JSON files from repository
48
+ - **Outdated Documentation** - Removed implementation plan and roadmap (features complete)
49
+
50
+ ## [0.1.14](https://github.com/Isqanderm/ioc/compare/v0.1.13...v0.1.14) (2024-07-17)
51
+
52
+ ### [0.1.13](https://github.com/Isqanderm/ioc/compare/v0.1.11...v0.1.13) (2024-07-16)
53
+
54
+ ### [0.1.12](https://github.com/Isqanderm/ioc/compare/v0.1.11...v0.1.12) (2024-07-16)
55
+
56
+ ### [0.1.11](https://github.com/Isqanderm/ioc/compare/v0.1.10...v0.1.11) (2024-07-16)
57
+
58
+ ### [0.1.10](https://github.com/Isqanderm/ioc/compare/v0.1.9...v0.1.10) (2024-07-16)
59
+
60
+
61
+ ### Features
62
+
63
+ * **graph-visualizer:** add graph-visualizer package ([69bb005](https://github.com/Isqanderm/ioc/commit/69bb00585c395d7766675d1a4620320efed14736))
64
+ * **graph:** add container inheritance ([e5c0571](https://github.com/Isqanderm/ioc/commit/e5c05711f301314ec545881a6356db7c9f0de612)), closes [#21](https://github.com/Isqanderm/ioc/issues/21)
65
+
66
+ ### [0.1.9](https://github.com/Isqanderm/ioc/compare/v0.1.8...v0.1.9) (2024-07-07)
67
+
68
+
69
+ ### Features
70
+
71
+ * **graph:** add new graph hooks and api for container ([a082f3e](https://github.com/Isqanderm/ioc/commit/a082f3e48450995cdd8f4761e8a0e6a7330b05b1))
72
+
73
+ ### [0.1.8](https://github.com/Isqanderm/ioc/compare/v0.1.7...v0.1.8) (2024-07-03)
74
+
75
+ ### [0.1.7](https://github.com/Isqanderm/ioc/compare/v0.1.6...v0.1.7) (2024-07-02)
76
+
77
+
78
+ ### Features
79
+
80
+ * **container:** add forRoot/forRootAsync ([533c1c4](https://github.com/Isqanderm/ioc/commit/533c1c4a6bc99a611584574e5b4717416f86af0f))
81
+
82
+ ### [0.1.6](https://github.com/Isqanderm/ioc/compare/v0.1.5...v0.1.6) (2024-07-02)
83
+
84
+
85
+ ### Features
86
+
87
+ * **container:** add forFeature/forFeatureAsync ([427d2df](https://github.com/Isqanderm/ioc/commit/427d2dfaa1792746c68c6909ecec35a5805024ae))
88
+
89
+ ### [0.1.5](https://github.com/Isqanderm/ioc/compare/v0.1.4...v0.1.5) (2024-07-01)
90
+
91
+ ### [0.1.4](https://github.com/Isqanderm/ioc/compare/v0.1.3...v0.1.4) (2024-06-30)
92
+
93
+ ### 0.1.3 (2024-06-30)
94
+
95
+
96
+ ### Features
97
+
98
+ * **application:** create first version of app ([086e0ff](https://github.com/Isqanderm/ioc/commit/086e0ff1fad889c253b7bf25e134f0048976c1eb))
99
+
100
+ ### 0.1.2 (2024-06-30)
101
+
102
+
103
+ ### Features
104
+
105
+ * **application:** create first version of app ([086e0ff](https://github.com/Isqanderm/ioc/commit/086e0ff1fad889c253b7bf25e134f0048976c1eb))
106
+
107
+ ### 0.1.1 (2024-06-30)
108
+
109
+
110
+ ### Features
111
+
112
+ * **application:** create first version of app ([086e0ff](https://github.com/Isqanderm/ioc/commit/086e0ff1fad889c253b7bf25e134f0048976c1eb))
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Aleksandr Melnik
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.