@featurevisor/core 2.12.0 → 2.13.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 +11 -0
- package/coverage/clover.xml +1184 -466
- package/coverage/coverage-final.json +21 -6
- package/coverage/lcov-report/builder/allocator.ts.html +1 -1
- package/coverage/lcov-report/builder/buildScopedConditions.ts.html +1 -1
- package/coverage/lcov-report/builder/buildScopedDatafile.ts.html +1 -1
- package/coverage/lcov-report/builder/buildScopedSegments.ts.html +1 -1
- package/coverage/lcov-report/builder/index.html +1 -1
- package/coverage/lcov-report/builder/revision.ts.html +1 -1
- package/coverage/lcov-report/builder/traffic.ts.html +1 -1
- package/coverage/lcov-report/config/index.html +116 -0
- package/coverage/lcov-report/config/projectConfig.ts.html +676 -0
- package/coverage/lcov-report/datasource/adapter.ts.html +235 -0
- package/coverage/lcov-report/datasource/datasource.ts.html +862 -0
- package/coverage/lcov-report/datasource/filesystemAdapter.ts.html +1354 -0
- package/coverage/lcov-report/datasource/index.html +161 -0
- package/coverage/lcov-report/datasource/index.ts.html +94 -0
- package/coverage/lcov-report/index.html +74 -29
- package/coverage/lcov-report/linter/attributeSchema.ts.html +175 -0
- package/coverage/lcov-report/linter/checkCircularDependency.ts.html +220 -0
- package/coverage/lcov-report/linter/checkPercentageExceedingSlot.ts.html +268 -0
- package/coverage/lcov-report/linter/conditionSchema.ts.html +38 -38
- package/coverage/lcov-report/linter/featureSchema.ts.html +363 -363
- package/coverage/lcov-report/linter/groupSchema.ts.html +226 -0
- package/coverage/lcov-report/linter/index.html +124 -19
- package/coverage/lcov-report/linter/lintProject.ts.html +1840 -0
- package/coverage/lcov-report/linter/printError.ts.html +238 -0
- package/coverage/lcov-report/linter/schema.ts.html +116 -116
- package/coverage/lcov-report/linter/segmentSchema.ts.html +5 -5
- package/coverage/lcov-report/linter/testSchema.ts.html +550 -0
- package/coverage/lcov-report/list/index.html +1 -1
- package/coverage/lcov-report/list/matrix.ts.html +1 -1
- package/coverage/lcov-report/parsers/index.html +20 -5
- package/coverage/lcov-report/parsers/index.ts.html +151 -0
- package/coverage/lcov-report/parsers/json.ts.html +2 -2
- package/coverage/lcov-report/parsers/yml.ts.html +6 -6
- package/coverage/lcov-report/tester/cliFormat.ts.html +103 -0
- package/coverage/lcov-report/tester/helpers.ts.html +1 -1
- package/coverage/lcov-report/tester/index.html +20 -5
- package/coverage/lcov-report/utils/git.ts.html +481 -0
- package/coverage/lcov-report/utils/index.html +116 -0
- package/coverage/lcov.info +2179 -859
- package/lib/linter/lintProject.d.ts +17 -1
- package/lib/linter/lintProject.js +191 -198
- package/lib/linter/lintProject.js.map +1 -1
- package/lib/linter/lintProject.spec.d.ts +1 -0
- package/lib/linter/lintProject.spec.js +86 -0
- package/lib/linter/lintProject.spec.js.map +1 -0
- package/lib/linter/printError.d.ts +7 -0
- package/lib/linter/printError.js +30 -15
- package/lib/linter/printError.js.map +1 -1
- package/package.json +2 -2
- package/src/linter/lintProject.spec.ts +115 -0
- package/src/linter/lintProject.ts +256 -254
- package/src/linter/printError.ts +40 -16
package/src/linter/printError.ts
CHANGED
|
@@ -2,26 +2,50 @@ import { ZodError } from "zod";
|
|
|
2
2
|
|
|
3
3
|
import { CLI_FORMAT_RED } from "../tester/cliFormat";
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
|
|
5
|
+
export interface LintIssueFromZod {
|
|
6
|
+
message: string;
|
|
7
|
+
path: (string | number)[];
|
|
8
|
+
code?: string;
|
|
9
|
+
value?: unknown;
|
|
10
|
+
}
|
|
7
11
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
export function getLintIssuesFromZodError(e: ZodError): LintIssueFromZod[] {
|
|
13
|
+
return e.issues
|
|
14
|
+
.map((issue) => {
|
|
15
|
+
if (
|
|
16
|
+
issue.code === "invalid_union" &&
|
|
17
|
+
issue.path.length === 0 &&
|
|
18
|
+
issue.unionErrors.length > 0
|
|
19
|
+
) {
|
|
20
|
+
const lastUnionError = issue.unionErrors[issue.unionErrors.length - 1];
|
|
21
|
+
const nestedIssue = lastUnionError.issues[0];
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
return {
|
|
24
|
+
message: nestedIssue.message,
|
|
25
|
+
path: nestedIssue.path,
|
|
26
|
+
code: nestedIssue.code,
|
|
27
|
+
value: (nestedIssue as any).received,
|
|
28
|
+
};
|
|
22
29
|
}
|
|
23
|
-
}
|
|
24
30
|
|
|
31
|
+
return {
|
|
32
|
+
message: issue.message,
|
|
33
|
+
path: issue.path,
|
|
34
|
+
code: issue.code,
|
|
35
|
+
value: (issue as any).received,
|
|
36
|
+
};
|
|
37
|
+
})
|
|
38
|
+
.filter(Boolean);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function printZodError(e: ZodError) {
|
|
42
|
+
const issues = getLintIssuesFromZodError(e);
|
|
43
|
+
issues.forEach((issue) => {
|
|
44
|
+
console.error(CLI_FORMAT_RED, ` => Error: ${issue.message}`);
|
|
45
|
+
console.error(" Path:", issue.path.join("."));
|
|
46
|
+
if (typeof issue.value !== "undefined" && issue.value !== "undefined") {
|
|
47
|
+
console.error(" Value:", issue.value);
|
|
48
|
+
}
|
|
25
49
|
console.error("");
|
|
26
50
|
});
|
|
27
51
|
}
|