hermex 1.1.2 → 1.3.0-beta.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/LICENSE.md CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Gal Levy
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Gal Levy
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.
package/README.md CHANGED
@@ -1,59 +1,59 @@
1
- # hermex
2
-
3
- SWC-based AST parser for analyzing code and React component usage patterns across entire codebases
4
-
5
- ## Quick Start
6
-
7
- ```bash
8
- # No installation required - use npx (scans current directory)
9
- npx hermex scan
10
-
11
- # Or install globally
12
- npm install -g hermex
13
- hermex scan
14
-
15
- # Scan specific directory
16
- npx hermex scan "src/**/*.tsx"
17
- ```
18
-
19
- ## Requirements
20
-
21
- - Node.js 20+
22
-
23
- ## Key Features
24
-
25
- - **Fast SWC-based Parsing**: Lightning-fast static analysis using SWC's Rust-based parser
26
- - **Comprehensive Pattern Detection**: Identifies 10+ React usage patterns including:
27
- - Direct imports (default, named, namespace, aliased)
28
- - JSX element usage
29
- - Variable assignments and destructuring
30
- - Conditional usage (ternary operators)
31
- - Collection mappings (arrays and objects)
32
- - Lazy and dynamic imports
33
- - Advanced patterns (HOC, memo, forwardRef, portals)
34
- - **Version Tracking**: Components reported with exact package versions from lockfiles
35
- - **Multi-Lockfile Support**: Parses package-lock.json, yarn.lock, and pnpm-lock.yaml
36
- - **Flexible Output**: Table and chart visualization formats
37
- - **Zero Configuration**: Works out of the box with sensible defaults
38
-
39
- ## Installation
40
-
41
- ```bash
42
- # Global installation
43
- npm install -g hermex
44
-
45
- # Or with pnpm
46
- pnpm add -g hermex
47
-
48
- # Or with yarn
49
- yarn global add hermex
50
- ```
51
-
52
- ## CLI Usage
53
-
54
- ### Main CLI
55
-
56
- ```bash
1
+ # hermex
2
+
3
+ SWC-based AST parser for analyzing code and React component usage patterns across entire codebases
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ # No installation required - use npx (scans current directory)
9
+ npx hermex scan
10
+
11
+ # Or install globally
12
+ npm install -g hermex
13
+ hermex scan
14
+
15
+ # Scan specific directory
16
+ npx hermex scan "src/**/*.tsx"
17
+ ```
18
+
19
+ ## Requirements
20
+
21
+ - Node.js 20+
22
+
23
+ ## Key Features
24
+
25
+ - **Fast SWC-based Parsing**: Lightning-fast static analysis using SWC's Rust-based parser
26
+ - **Comprehensive Pattern Detection**: Identifies 10+ React usage patterns including:
27
+ - Direct imports (default, named, namespace, aliased)
28
+ - JSX element usage
29
+ - Variable assignments and destructuring
30
+ - Conditional usage (ternary operators)
31
+ - Collection mappings (arrays and objects)
32
+ - Lazy and dynamic imports
33
+ - Advanced patterns (HOC, memo, forwardRef, portals)
34
+ - **Version Tracking**: Components reported with exact package versions from lockfiles
35
+ - **Multi-Lockfile Support**: Parses package-lock.json, yarn.lock, and pnpm-lock.yaml
36
+ - **Flexible Output**: Table and chart visualization formats
37
+ - **Zero Configuration**: Works out of the box with sensible defaults
38
+
39
+ ## Installation
40
+
41
+ ```bash
42
+ # Global installation
43
+ npm install -g hermex
44
+
45
+ # Or with pnpm
46
+ pnpm add -g hermex
47
+
48
+ # Or with yarn
49
+ yarn global add hermex
50
+ ```
51
+
52
+ ## CLI Usage
53
+
54
+ ### Main CLI
55
+
56
+ ```bash
57
57
  Usage: hermex [options] [command]
58
58
 
59
59
  Analyze React component usage patterns in your codebase
@@ -64,14 +64,14 @@ Options:
64
64
 
65
65
  Commands:
66
66
  scan [options] [pattern] Scan and analyze local files
67
- help [command] display help for command
68
- ```
69
-
70
- ### Scan Command
71
-
72
- The `scan` command analyzes local files for React component usage patterns.
73
-
74
- ```bash
67
+ help [command] display help for command
68
+ ```
69
+
70
+ ### Scan Command
71
+
72
+ The `scan` command analyzes local files for React component usage patterns.
73
+
74
+ ```bash
75
75
  Usage: hermex scan [options] [pattern]
76
76
 
77
77
  Scan and analyze local files
@@ -97,14 +97,16 @@ Options:
97
97
  --patterns [mode] Show patterns table/chart (table, chart)
98
98
  (default: "table")
99
99
  --no-patterns Do not show patterns
100
- -h, --help display help for command
101
- ```
102
-
103
- ## Example Output
104
-
105
- Running a basic scan (uses default pattern `**/*.{tsx,jsx,ts,js}`):
106
-
107
- ```bash
100
+ --ignore-errors Continue scanning even if some files fail to
101
+ parse
102
+ -h, --help display help for command
103
+ ```
104
+
105
+ ## Example Output
106
+
107
+ Running a basic scan (uses default pattern `**/*.{tsx,jsx,ts,js}`):
108
+
109
+ ```bash
108
110
  📦 Packages
109
111
 
110
112
  No packages found
@@ -118,9 +120,9 @@ Running a basic scan (uses default pattern `**/*.{tsx,jsx,ts,js}`):
118
120
  ┌──────────────────────┬───────┐
119
121
  │ Pattern │ Count │
120
122
  ├──────────────────────┼───────┤
121
- │ Named Imports │ 126
123
+ │ Named Imports │ 130
122
124
  ├──────────────────────┼───────┤
123
- │ Default Imports │ 49
125
+ │ Default Imports │ 51
124
126
  ├──────────────────────┼───────┤
125
127
  │ JSX Usage │ 45 │
126
128
  ├──────────────────────┼───────┤
@@ -139,59 +141,59 @@ Running a basic scan (uses default pattern `**/*.{tsx,jsx,ts,js}`):
139
141
  │ Portal Usage │ 1 │
140
142
  └──────────────────────┴───────┘
141
143
 
142
- Total: 266 patterns detected
144
+ Total: 272 patterns detected
143
145
 
144
146
  📊 Summary
145
147
 
146
148
  ┌─────────────────────┬───────┐
147
149
  │ Metric │ Count │
148
150
  ├─────────────────────┼───────┤
149
- │ Files Analyzed │ 45
151
+ │ Files Analyzed │ 46
150
152
  ├─────────────────────┼───────┤
151
153
  │ External Packages │ 0 │
152
154
  ├─────────────────────┼───────┤
153
155
  │ External Components │ 0 │
154
156
  ├─────────────────────┼───────┤
155
157
  │ Total Usages │ 0 │
156
- └─────────────────────┴───────┘
157
- ```
158
-
159
- ## Use Cases
160
-
161
- 1. **Dependency Audits** - Understand library usage before migrations
162
- 2. **Version Tracking** - Know exactly which component versions are in use
163
- 3. **Migration Planning** - Identify components that need updating when migrating UI libraries
164
- 4. **Component Analytics** - Track most-used components and usage patterns
165
- 5. **Code Quality** - Identify complex usage patterns that may need refactoring
166
- 6. **Team Insights** - Understand how your team uses component libraries
167
- 7. **Documentation** - Generate usage reports for component library documentation
168
-
169
- ## Documentation
170
-
171
- - **[Examples](./docs/examples.md)** - Comprehensive examples and command usage
172
- - **[Patterns Guide](./docs/patterns.md)** - All detectable React usage patterns
173
-
174
- ## Tech Stack
175
-
176
- - **Runtime**: Node.js 24
177
- - **Parser**: [@swc/core](https://swc.rs/)
178
- - **CLI**: [Commander.js](https://github.com/tj/commander.js)
179
- - **Build**: [tsup](https://tsup.egoist.dev/)
180
- - **Language**: [TypeScript](https://www.typescriptlang.org/)
181
- - **Formatter**: [Biome](https://biomejs.dev/)
182
- - **Linter**: [oxlint](https://oxc-project.github.io/)
183
- - **Tests**: [Vitest](https://vitest.dev/)
184
-
185
- ## Contributing
186
-
187
- Contributions are welcome! Please read our [Contributing Guide](./CONTRIBUTING.md) for details.
188
-
189
- ## License
190
-
191
- MIT License - see [LICENSE.md](./LICENSE.md)
192
-
193
- ## Links
194
-
195
- - [GitHub Repository](https://github.com/Gallevy/hermex.git)
196
- - [npm Package](https://www.npmjs.com/package/hermex)
197
- - [Report Issues](https://github.com/Gallevy/hermex.git/issues)
158
+ └─────────────────────┴───────┘
159
+ ```
160
+
161
+ ## Use Cases
162
+
163
+ 1. **Dependency Audits** - Understand library usage before migrations
164
+ 2. **Version Tracking** - Know exactly which component versions are in use
165
+ 3. **Migration Planning** - Identify components that need updating when migrating UI libraries
166
+ 4. **Component Analytics** - Track most-used components and usage patterns
167
+ 5. **Code Quality** - Identify complex usage patterns that may need refactoring
168
+ 6. **Team Insights** - Understand how your team uses component libraries
169
+ 7. **Documentation** - Generate usage reports for component library documentation
170
+
171
+ ## Documentation
172
+
173
+ - **[Examples](./docs/examples.md)** - Comprehensive examples and command usage
174
+ - **[Patterns Guide](./docs/patterns.md)** - All detectable React usage patterns
175
+
176
+ ## Tech Stack
177
+
178
+ - **Runtime**: Node.js 24
179
+ - **Parser**: [@swc/core](https://swc.rs/)
180
+ - **CLI**: [Commander.js](https://github.com/tj/commander.js)
181
+ - **Build**: [tsup](https://tsup.egoist.dev/)
182
+ - **Language**: [TypeScript](https://www.typescriptlang.org/)
183
+ - **Formatter**: [Biome](https://biomejs.dev/)
184
+ - **Linter**: [oxlint](https://oxc-project.github.io/)
185
+ - **Tests**: [Vitest](https://vitest.dev/)
186
+
187
+ ## Contributing
188
+
189
+ Contributions are welcome! Please read our [Contributing Guide](./CONTRIBUTING.md) for details.
190
+
191
+ ## License
192
+
193
+ MIT License - see [LICENSE.md](./LICENSE.md)
194
+
195
+ ## Links
196
+
197
+ - [GitHub Repository](https://github.com/Gallevy/hermex.git)
198
+ - [npm Package](https://www.npmjs.com/package/hermex)
199
+ - [Report Issues](https://github.com/Gallevy/hermex.git/issues)