hermex 2.0.0-beta.6 → 2.0.0-beta.8
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/dist/cli.mjs +199 -37
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +53 -2
- package/package.json +6 -1
package/dist/index.d.mts
CHANGED
|
@@ -15,6 +15,16 @@ declare const RuleConfigSchema: z.ZodObject<{
|
|
|
15
15
|
patterns: z.ZodArray<z.ZodString>;
|
|
16
16
|
message: z.ZodOptional<z.ZodString>;
|
|
17
17
|
}, z.core.$strip>;
|
|
18
|
+
declare const PackageFieldRuleSchema: z.ZodObject<{
|
|
19
|
+
severity: z.ZodEnum<{
|
|
20
|
+
error: "error";
|
|
21
|
+
info: "info";
|
|
22
|
+
warn: "warn";
|
|
23
|
+
}>;
|
|
24
|
+
patterns: z.ZodArray<z.ZodString>;
|
|
25
|
+
message: z.ZodOptional<z.ZodString>;
|
|
26
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
27
|
+
}, z.core.$strip>;
|
|
18
28
|
declare const EngineVersionRuleSchema: z.ZodObject<{
|
|
19
29
|
severity: z.ZodEnum<{
|
|
20
30
|
error: "error";
|
|
@@ -24,6 +34,14 @@ declare const EngineVersionRuleSchema: z.ZodObject<{
|
|
|
24
34
|
range: z.ZodString;
|
|
25
35
|
message: z.ZodOptional<z.ZodString>;
|
|
26
36
|
}, z.core.$strip>;
|
|
37
|
+
declare const CodeownersRuleSchema: z.ZodObject<{
|
|
38
|
+
severity: z.ZodEnum<{
|
|
39
|
+
error: "error";
|
|
40
|
+
info: "info";
|
|
41
|
+
warn: "warn";
|
|
42
|
+
}>;
|
|
43
|
+
message: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.core.$strip>;
|
|
27
45
|
declare const HermexConfigSchema: z.ZodObject<{
|
|
28
46
|
includes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
29
47
|
excludes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -129,6 +147,26 @@ declare const HermexConfigSchema: z.ZodObject<{
|
|
|
129
147
|
}>;
|
|
130
148
|
patterns: z.ZodArray<z.ZodString>;
|
|
131
149
|
message: z.ZodOptional<z.ZodString>;
|
|
150
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
151
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
152
|
+
severity: z.ZodEnum<{
|
|
153
|
+
error: "error";
|
|
154
|
+
info: "info";
|
|
155
|
+
warn: "warn";
|
|
156
|
+
}>;
|
|
157
|
+
patterns: z.ZodArray<z.ZodString>;
|
|
158
|
+
message: z.ZodOptional<z.ZodString>;
|
|
159
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
160
|
+
}, z.core.$strip>>]>>;
|
|
161
|
+
forbid_package_fields: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
162
|
+
severity: z.ZodEnum<{
|
|
163
|
+
error: "error";
|
|
164
|
+
info: "info";
|
|
165
|
+
warn: "warn";
|
|
166
|
+
}>;
|
|
167
|
+
patterns: z.ZodArray<z.ZodString>;
|
|
168
|
+
message: z.ZodOptional<z.ZodString>;
|
|
169
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
132
170
|
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
133
171
|
severity: z.ZodEnum<{
|
|
134
172
|
error: "error";
|
|
@@ -137,6 +175,7 @@ declare const HermexConfigSchema: z.ZodObject<{
|
|
|
137
175
|
}>;
|
|
138
176
|
patterns: z.ZodArray<z.ZodString>;
|
|
139
177
|
message: z.ZodOptional<z.ZodString>;
|
|
178
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
140
179
|
}, z.core.$strip>>]>>;
|
|
141
180
|
engine_version: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
142
181
|
severity: z.ZodEnum<{
|
|
@@ -155,6 +194,14 @@ declare const HermexConfigSchema: z.ZodObject<{
|
|
|
155
194
|
range: z.ZodString;
|
|
156
195
|
message: z.ZodOptional<z.ZodString>;
|
|
157
196
|
}, z.core.$strip>>]>>;
|
|
197
|
+
codeowners: z.ZodOptional<z.ZodObject<{
|
|
198
|
+
severity: z.ZodEnum<{
|
|
199
|
+
error: "error";
|
|
200
|
+
info: "info";
|
|
201
|
+
warn: "warn";
|
|
202
|
+
}>;
|
|
203
|
+
message: z.ZodOptional<z.ZodString>;
|
|
204
|
+
}, z.core.$strip>>;
|
|
158
205
|
}, z.core.$strip>>;
|
|
159
206
|
output: z.ZodDefault<z.ZodObject<{
|
|
160
207
|
summary: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"log">, z.ZodLiteral<false>]>>;
|
|
@@ -198,7 +245,9 @@ type HermexConfig = z.infer<typeof HermexConfigSchema>;
|
|
|
198
245
|
type HermexConfigInput = z.input<typeof HermexConfigSchema>;
|
|
199
246
|
type RuleSeverity = z.infer<typeof RuleSeveritySchema>;
|
|
200
247
|
type RuleConfig = z.infer<typeof RuleConfigSchema>;
|
|
248
|
+
type PackageFieldRule = z.infer<typeof PackageFieldRuleSchema>;
|
|
201
249
|
type EngineVersionRule = z.infer<typeof EngineVersionRuleSchema>;
|
|
250
|
+
type CodeownersRule = z.infer<typeof CodeownersRuleSchema>;
|
|
202
251
|
type PackagesConfig = HermexConfig['packages'];
|
|
203
252
|
type VersusConfig = HermexConfig['versus'][number];
|
|
204
253
|
type RulesConfig = HermexConfig['rules'];
|
|
@@ -271,13 +320,15 @@ interface VersusResult {
|
|
|
271
320
|
//#endregion
|
|
272
321
|
//#region src/rules/shared.d.ts
|
|
273
322
|
interface RuleViolation {
|
|
274
|
-
type: 'detect_files' | 'require_files' | 'forbid_packages' | 'require_packages' | 'require_scripts' | 'require_package_fields' | 'engine_version';
|
|
323
|
+
type: 'detect_files' | 'require_files' | 'forbid_packages' | 'require_packages' | 'require_scripts' | 'require_package_fields' | 'forbid_package_fields' | 'engine_version' | 'codeowners';
|
|
275
324
|
severity: 'error' | 'warn' | 'info';
|
|
276
325
|
patterns: string[];
|
|
277
326
|
message?: string;
|
|
278
327
|
matchedFiles: string[];
|
|
279
328
|
installedRange?: string;
|
|
280
329
|
requiredRange?: string;
|
|
330
|
+
fieldPath?: string;
|
|
331
|
+
actualValue?: string;
|
|
281
332
|
}
|
|
282
333
|
//#endregion
|
|
283
334
|
//#region src/utils/package-rules.d.ts
|
|
@@ -309,4 +360,4 @@ interface HermexScanResult {
|
|
|
309
360
|
bannedPackageViolations: BannedPackageViolation[];
|
|
310
361
|
}
|
|
311
362
|
//#endregion
|
|
312
|
-
export { type BannedPackageViolation, type ComponentUsage, type EngineVersionRule, type HermexConfig, type HermexConfigInput, HermexScanComponent, HermexScanResult, type OutputConfig, type PackageDistribution, type PackagesConfig, type PatternCount, type ReleaseAgeConfig, type ReleaseAgeThresholds, type RuleConfig, type RuleSeverity, type RuleViolation, type RulesConfig, type VersusConfig, type VersusEntry, type VersusResult };
|
|
363
|
+
export { type BannedPackageViolation, type CodeownersRule, type ComponentUsage, type EngineVersionRule, type HermexConfig, type HermexConfigInput, HermexScanComponent, HermexScanResult, type OutputConfig, type PackageDistribution, type PackageFieldRule, type PackagesConfig, type PatternCount, type ReleaseAgeConfig, type ReleaseAgeThresholds, type RuleConfig, type RuleSeverity, type RuleViolation, type RulesConfig, type VersusConfig, type VersusEntry, type VersusResult };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hermex",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.8",
|
|
4
4
|
"description": "SWC-based AST parser for analyzing code and React component usage patterns across entire codebases",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"analysis",
|
|
@@ -84,5 +84,10 @@
|
|
|
84
84
|
},
|
|
85
85
|
"engines": {
|
|
86
86
|
"node": ">=24.11.1"
|
|
87
|
+
},
|
|
88
|
+
"pnpm": {
|
|
89
|
+
"overrides": {
|
|
90
|
+
"micromatch>picomatch": "^2.3.2"
|
|
91
|
+
}
|
|
87
92
|
}
|
|
88
93
|
}
|