@ovh-ux/manager-static-analysis-kit 0.8.0 → 0.10.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 +37 -0
- package/README.md +59 -69
- package/bin/cli-path-config.js +31 -0
- package/bin/code-duplication-cli.js +96 -0
- package/bin/code-duplication-tests-cli.js +68 -0
- package/bin/lint-cli.js +1 -1
- package/bin/perf-budgets-cli.js +58 -297
- package/bin/perf-budgets-tests-cli.js +1 -3
- package/bin/static-dynamic-quality-checks.js +138 -0
- package/bin/tests-coverage-cli-tests.js +67 -0
- package/bin/tests-coverage-cli.js +137 -0
- package/bin/types-coverage-cli.js +195 -0
- package/bin/types-coverage-tests-cli.js +68 -0
- package/bin/utils/apps-utils.js +64 -0
- package/bin/utils/args-parse-utils.js +229 -0
- package/bin/utils/file-utils.js +52 -0
- package/bin/utils/log-utils.js +29 -0
- package/bin/utils/runner-utils.js +85 -0
- package/bin/utils/turbo-utils.js +150 -0
- package/dist/adapters/code-duplication/helpers/code-duplication-analysis-helper.d.ts +9 -0
- package/dist/adapters/code-duplication/helpers/code-duplication-analysis-helper.d.ts.map +1 -0
- package/dist/adapters/code-duplication/helpers/code-duplication-analysis-helper.js +294 -0
- package/dist/adapters/code-duplication/types/CodeDuplication.d.ts +63 -0
- package/dist/adapters/code-duplication/types/CodeDuplication.d.ts.map +1 -0
- package/dist/adapters/code-duplication/types/CodeDuplication.js +1 -0
- package/dist/adapters/eslint/rules/eslint-prettier.js +1 -1
- package/dist/adapters/html-a11y-validation/helpers/html-a11y-tests-setup.d.ts +62 -0
- package/dist/adapters/html-a11y-validation/helpers/html-a11y-tests-setup.d.ts.map +1 -0
- package/dist/adapters/html-a11y-validation/helpers/html-a11y-tests-setup.js +73 -0
- package/dist/adapters/html-w3c-validation/helpers/html-w3c-tests-setup.d.ts +19 -0
- package/dist/adapters/html-w3c-validation/helpers/html-w3c-tests-setup.d.ts.map +1 -0
- package/dist/adapters/html-w3c-validation/helpers/html-w3c-tests-setup.js +32 -0
- package/dist/adapters/html-w3c-validation/helpers/html-w3c-validator.d.ts +4 -0
- package/dist/adapters/html-w3c-validation/helpers/html-w3c-validator.d.ts.map +1 -0
- package/dist/adapters/html-w3c-validation/helpers/html-w3c-validator.js +89 -0
- package/dist/adapters/html-w3c-validation/types/HtmlW3CValidator.d.ts +6 -0
- package/dist/adapters/html-w3c-validation/types/HtmlW3CValidator.d.ts.map +1 -0
- package/dist/adapters/html-w3c-validation/types/HtmlW3CValidator.js +1 -0
- package/dist/adapters/html-w3c-validation/types/globals/vnu-jar.d.ts +5 -0
- package/dist/adapters/perf-budgets/helpers/perfs-bundle-analysis-helper.d.ts +1 -1
- package/dist/adapters/perf-budgets/helpers/perfs-bundle-analysis-helper.d.ts.map +1 -1
- package/dist/adapters/perf-budgets/helpers/perfs-bundle-analysis-helper.js +2 -3
- package/dist/adapters/tests-coverage/helpers/tests-coverage-analysis-helper.d.ts +4 -0
- package/dist/adapters/tests-coverage/helpers/tests-coverage-analysis-helper.d.ts.map +1 -0
- package/dist/adapters/tests-coverage/helpers/tests-coverage-analysis-helper.js +215 -0
- package/dist/adapters/tests-coverage/types/TestsCoverage.d.ts +36 -0
- package/dist/adapters/tests-coverage/types/TestsCoverage.d.ts.map +1 -0
- package/dist/adapters/tests-coverage/types/TestsCoverage.js +6 -0
- package/dist/adapters/types-coverage/helpers/types-coverage-analysis-helper.d.ts +4 -0
- package/dist/adapters/types-coverage/helpers/types-coverage-analysis-helper.d.ts.map +1 -0
- package/dist/adapters/types-coverage/helpers/types-coverage-analysis-helper.js +231 -0
- package/dist/adapters/types-coverage/types/TypesCoverage.d.ts +38 -0
- package/dist/adapters/types-coverage/types/TypesCoverage.d.ts.map +1 -0
- package/dist/adapters/types-coverage/types/TypesCoverage.js +1 -0
- package/dist/configs/architecture-analysis-config.d.ts +5 -0
- package/dist/configs/architecture-analysis-config.d.ts.map +1 -0
- package/dist/configs/{madge-config.js → architecture-analysis-config.js} +1 -1
- package/dist/configs/code-duplication-config.d.ts +22 -0
- package/dist/configs/code-duplication-config.d.ts.map +1 -0
- package/dist/configs/code-duplication-config.js +22 -0
- package/dist/configs/{prettier-config.d.ts → code-formatter-config.d.ts} +1 -1
- package/dist/configs/code-formatter-config.d.ts.map +1 -0
- package/dist/configs/file-globs-config.d.ts +0 -3
- package/dist/configs/file-globs-config.d.ts.map +1 -1
- package/dist/configs/file-globs-config.js +0 -3
- package/dist/configs/naming-conventions-config.d.ts.map +1 -1
- package/dist/configs/naming-conventions-config.js +2 -0
- package/dist/configs/shared-exclusion-patterns.d.ts +1 -0
- package/dist/configs/shared-exclusion-patterns.d.ts.map +1 -1
- package/dist/configs/shared-exclusion-patterns.js +23 -1
- package/dist/configs/tests-coverage-config.d.ts +12 -0
- package/dist/configs/tests-coverage-config.d.ts.map +1 -0
- package/dist/configs/tests-coverage-config.js +11 -0
- package/dist/configs/types-coverage-config.d.ts +33 -0
- package/dist/configs/types-coverage-config.d.ts.map +1 -0
- package/dist/configs/types-coverage-config.js +24 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +32 -7
- package/bin/cli-utils.js +0 -56
- package/dist/configs/jscpd-config.d.ts +0 -7
- package/dist/configs/jscpd-config.d.ts.map +0 -1
- package/dist/configs/jscpd-config.js +0 -7
- package/dist/configs/madge-config.d.ts +0 -5
- package/dist/configs/madge-config.d.ts.map +0 -1
- package/dist/configs/prettier-config.d.ts.map +0 -1
- /package/dist/configs/{prettier-config.js → code-formatter-config.js} +0 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { typesCoverageConfig } from '../../../configs/types-coverage-config.js';
|
|
4
|
+
function normalizeFileEntry(file, data) {
|
|
5
|
+
const covered = data.correctCount ?? 0;
|
|
6
|
+
const total = data.totalCount ?? 0;
|
|
7
|
+
return {
|
|
8
|
+
file,
|
|
9
|
+
covered,
|
|
10
|
+
total,
|
|
11
|
+
percentage: total > 0 ? (covered / total) * 100 : 0,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function extractWorstFiles(report) {
|
|
15
|
+
if (!report.fileCounts)
|
|
16
|
+
return [];
|
|
17
|
+
const { threshold, count } = typesCoverageConfig.worstFiles;
|
|
18
|
+
return Object.entries(report.fileCounts)
|
|
19
|
+
.map(([file, f]) => normalizeFileEntry(file, f))
|
|
20
|
+
.filter((f) => f.total > 0 && f.percentage < threshold)
|
|
21
|
+
.sort((a, b) => a.percentage - b.percentage)
|
|
22
|
+
.slice(0, count)
|
|
23
|
+
.map((f) => [f.file, { covered: f.covered, total: f.total, percentage: f.percentage }]);
|
|
24
|
+
}
|
|
25
|
+
function readLooseTypes(appReportDir) {
|
|
26
|
+
const file = path.join(appReportDir, 'loose-types.json');
|
|
27
|
+
if (!fs.existsSync(file))
|
|
28
|
+
return undefined;
|
|
29
|
+
try {
|
|
30
|
+
return JSON.parse(fs.readFileSync(file, 'utf-8'));
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function computeAppCoverage(report) {
|
|
37
|
+
const covered = report.covered ?? 0;
|
|
38
|
+
const total = report.total ?? 0;
|
|
39
|
+
const percentage = total > 0 ? (covered / total) * 100 : 0;
|
|
40
|
+
const fileEntries = Object.entries(report.fileCounts ?? {}).map(([file, f]) => normalizeFileEntry(file, f));
|
|
41
|
+
const percentages = fileEntries.filter((f) => f.total > 0).map((f) => f.percentage);
|
|
42
|
+
const minPercentage = percentages.length ? Math.min(...percentages) : percentage;
|
|
43
|
+
const maxPercentage = percentages.length ? Math.max(...percentages) : percentage;
|
|
44
|
+
return {
|
|
45
|
+
covered,
|
|
46
|
+
total,
|
|
47
|
+
percentage,
|
|
48
|
+
minPercentage,
|
|
49
|
+
maxPercentage,
|
|
50
|
+
worstFiles: extractWorstFiles(report),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export function collectTypesCoverage(reportOutputDir) {
|
|
54
|
+
const apps = {};
|
|
55
|
+
let totalCovered = 0;
|
|
56
|
+
let totalTypes = 0;
|
|
57
|
+
if (!fs.existsSync(reportOutputDir)) {
|
|
58
|
+
return { apps: {}, totalCovered: 0, totalTypes: 0, percentage: 0 };
|
|
59
|
+
}
|
|
60
|
+
const appDirs = fs
|
|
61
|
+
.readdirSync(reportOutputDir)
|
|
62
|
+
.filter((entry) => fs.statSync(path.join(reportOutputDir, entry)).isDirectory());
|
|
63
|
+
for (const appDirName of appDirs) {
|
|
64
|
+
const appReportDir = path.join(reportOutputDir, appDirName);
|
|
65
|
+
const jsonPath = path.join(appReportDir, 'typescript-coverage.json');
|
|
66
|
+
if (!fs.existsSync(jsonPath))
|
|
67
|
+
continue;
|
|
68
|
+
try {
|
|
69
|
+
const report = JSON.parse(fs.readFileSync(jsonPath, 'utf-8'));
|
|
70
|
+
const stats = computeAppCoverage(report);
|
|
71
|
+
stats.looseTypes = readLooseTypes(appReportDir);
|
|
72
|
+
apps[appDirName] = stats;
|
|
73
|
+
totalCovered += stats.covered;
|
|
74
|
+
totalTypes += stats.total;
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
apps[appDirName] = {
|
|
78
|
+
covered: 0,
|
|
79
|
+
total: 0,
|
|
80
|
+
percentage: 0,
|
|
81
|
+
error: err.message,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
apps,
|
|
87
|
+
totalCovered,
|
|
88
|
+
totalTypes,
|
|
89
|
+
percentage: totalTypes > 0 ? (totalCovered / totalTypes) * 100 : 0,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function getReportStatusColor(percentage) {
|
|
93
|
+
const { green, orange } = typesCoverageConfig.thresholds;
|
|
94
|
+
if (percentage >= green)
|
|
95
|
+
return 'green';
|
|
96
|
+
if (percentage >= orange)
|
|
97
|
+
return 'orange';
|
|
98
|
+
return 'red';
|
|
99
|
+
}
|
|
100
|
+
function getLooseStatusColor(value, thresholds) {
|
|
101
|
+
if (value <= thresholds.green)
|
|
102
|
+
return 'green';
|
|
103
|
+
if (value <= thresholds.orange)
|
|
104
|
+
return 'orange';
|
|
105
|
+
return 'red';
|
|
106
|
+
}
|
|
107
|
+
function renderColoredPercentage(value) {
|
|
108
|
+
return `<span style="color:${getReportStatusColor(value)};">${value.toFixed(2)}%</span>`;
|
|
109
|
+
}
|
|
110
|
+
function renderLooseCell(value, thresholds) {
|
|
111
|
+
const color = getLooseStatusColor(value, thresholds);
|
|
112
|
+
return `<td style="font-weight:bold;color:${color};">${value}</td>`;
|
|
113
|
+
}
|
|
114
|
+
function renderCoverageCell(stats) {
|
|
115
|
+
const min = stats.minPercentage ?? 0;
|
|
116
|
+
const max = stats.maxPercentage ?? 0;
|
|
117
|
+
return `
|
|
118
|
+
${stats.percentage.toFixed(2)}% (range:
|
|
119
|
+
${renderColoredPercentage(min)} – ${renderColoredPercentage(max)})
|
|
120
|
+
`;
|
|
121
|
+
}
|
|
122
|
+
function renderWorstFilesTable(worstFiles = []) {
|
|
123
|
+
if (!worstFiles.length) {
|
|
124
|
+
return `<p class="coverage-empty">No type coverage issues 🎉</p>`;
|
|
125
|
+
}
|
|
126
|
+
const rows = worstFiles
|
|
127
|
+
.map(([file, f]) => `
|
|
128
|
+
<tr>
|
|
129
|
+
<td>${file}</td>
|
|
130
|
+
<td>${f.covered}/${f.total}</td>
|
|
131
|
+
<td>${renderColoredPercentage(f.percentage)}</td>
|
|
132
|
+
</tr>`)
|
|
133
|
+
.join('');
|
|
134
|
+
return `
|
|
135
|
+
<table class="coverage-subtable">
|
|
136
|
+
<thead><tr><th>File</th><th>Covered/Total</th><th>%</th></tr></thead>
|
|
137
|
+
<tbody>${rows}</tbody>
|
|
138
|
+
</table>`;
|
|
139
|
+
}
|
|
140
|
+
function renderAppDetails(app, stats) {
|
|
141
|
+
return `
|
|
142
|
+
<details class="coverage-details">
|
|
143
|
+
<summary>📊 Type Coverage Overview for <strong>${app}</strong></summary>
|
|
144
|
+
<div class="coverage-card">
|
|
145
|
+
<h4>Type Coverage Worst Files</h4>
|
|
146
|
+
${renderWorstFilesTable(stats.worstFiles)}
|
|
147
|
+
</div>
|
|
148
|
+
</details>`;
|
|
149
|
+
}
|
|
150
|
+
function renderAppRow(app, stats) {
|
|
151
|
+
if (stats.error) {
|
|
152
|
+
return `<tr style="background:#ffe0e0">
|
|
153
|
+
<td>${app}</td>
|
|
154
|
+
<td colspan="7" style="color:red">${stats.error}</td>
|
|
155
|
+
</tr>`;
|
|
156
|
+
}
|
|
157
|
+
const loose = stats.looseTypes || { as: 0, any: 0, unknown: 0 };
|
|
158
|
+
return `
|
|
159
|
+
<tr style="background:#f0f0f0">
|
|
160
|
+
<td>${app}</td>
|
|
161
|
+
<td>${stats.covered}</td>
|
|
162
|
+
<td>${stats.total}</td>
|
|
163
|
+
<td style="font-weight:bold;">${renderCoverageCell(stats)}</td>
|
|
164
|
+
${renderLooseCell(loose.as, typesCoverageConfig.looseThresholds.as)}
|
|
165
|
+
${renderLooseCell(loose.any, typesCoverageConfig.looseThresholds.any)}
|
|
166
|
+
${renderLooseCell(loose.unknown, typesCoverageConfig.looseThresholds.unknown)}
|
|
167
|
+
</tr>
|
|
168
|
+
<tr><td colspan="7">${renderAppDetails(app, stats)}</td></tr>`;
|
|
169
|
+
}
|
|
170
|
+
function buildRows(apps) {
|
|
171
|
+
return Object.entries(apps)
|
|
172
|
+
.map(([app, stats]) => renderAppRow(app, stats))
|
|
173
|
+
.join('');
|
|
174
|
+
}
|
|
175
|
+
export function generateTypesCoverageHtml(summary) {
|
|
176
|
+
return `<!DOCTYPE html>
|
|
177
|
+
<html lang="en">
|
|
178
|
+
<head>
|
|
179
|
+
<meta charset="UTF-8"/>
|
|
180
|
+
<title>TypeScript Types Coverage Report</title>
|
|
181
|
+
<style>
|
|
182
|
+
body { font-family: Arial, sans-serif; margin: 2rem; }
|
|
183
|
+
h1 { margin-bottom: 1rem; }
|
|
184
|
+
table { border-collapse: collapse; width: 100%; margin-bottom: 2rem; }
|
|
185
|
+
th, td { border: 1px solid #ccc; padding: 0.5rem; text-align: left; vertical-align: top; }
|
|
186
|
+
th { background: #f0f0f0; }
|
|
187
|
+
.coverage-details {
|
|
188
|
+
margin: 0.3rem 0 0.8rem 1.5rem;
|
|
189
|
+
padding: 0.5rem;
|
|
190
|
+
border-left: 3px solid #ccc;
|
|
191
|
+
background: #fafafa;
|
|
192
|
+
border-radius: 4px;
|
|
193
|
+
}
|
|
194
|
+
.coverage-details summary {
|
|
195
|
+
font-weight: bold;
|
|
196
|
+
cursor: pointer;
|
|
197
|
+
}
|
|
198
|
+
.coverage-subtable {
|
|
199
|
+
margin-top: 0.5rem;
|
|
200
|
+
border: 1px solid #ddd;
|
|
201
|
+
width: 95%;
|
|
202
|
+
font-size: 0.9em;
|
|
203
|
+
}
|
|
204
|
+
.coverage-empty {
|
|
205
|
+
margin: 0.5rem 0;
|
|
206
|
+
color: #888;
|
|
207
|
+
font-style: italic;
|
|
208
|
+
}
|
|
209
|
+
</style>
|
|
210
|
+
</head>
|
|
211
|
+
<body>
|
|
212
|
+
<h1>TypeScript Types Coverage Report</h1>
|
|
213
|
+
<p>Total: ${summary.totalCovered} / ${summary.totalTypes}
|
|
214
|
+
(${summary.percentage.toFixed(2)}%)</p>
|
|
215
|
+
<table>
|
|
216
|
+
<thead>
|
|
217
|
+
<tr>
|
|
218
|
+
<th>App</th>
|
|
219
|
+
<th>Covered</th>
|
|
220
|
+
<th>Total</th>
|
|
221
|
+
<th>Coverage (range)</th>
|
|
222
|
+
<th>Number of as</th>
|
|
223
|
+
<th>Number of any</th>
|
|
224
|
+
<th>Number of unknown</th>
|
|
225
|
+
</tr>
|
|
226
|
+
</thead>
|
|
227
|
+
<tbody>${buildRows(summary.apps)}</tbody>
|
|
228
|
+
</table>
|
|
229
|
+
</body>
|
|
230
|
+
</html>`;
|
|
231
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface RawCoverageReport {
|
|
2
|
+
percentage?: number;
|
|
3
|
+
total?: number;
|
|
4
|
+
covered?: number;
|
|
5
|
+
uncovered?: number;
|
|
6
|
+
fileCounts?: Record<string, {
|
|
7
|
+
correctCount: number;
|
|
8
|
+
totalCount: number;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export interface FileCoverage {
|
|
12
|
+
covered: number;
|
|
13
|
+
total: number;
|
|
14
|
+
percentage: number;
|
|
15
|
+
}
|
|
16
|
+
export type WorstFileEntry = [string, FileCoverage];
|
|
17
|
+
export interface LooseTypesSummary {
|
|
18
|
+
as: number;
|
|
19
|
+
any: number;
|
|
20
|
+
unknown: number;
|
|
21
|
+
}
|
|
22
|
+
export interface AppCoverageSummary {
|
|
23
|
+
covered: number;
|
|
24
|
+
total: number;
|
|
25
|
+
percentage: number;
|
|
26
|
+
minPercentage?: number;
|
|
27
|
+
maxPercentage?: number;
|
|
28
|
+
error?: string;
|
|
29
|
+
worstFiles?: WorstFileEntry[];
|
|
30
|
+
looseTypes?: LooseTypesSummary;
|
|
31
|
+
}
|
|
32
|
+
export interface CoverageSummary {
|
|
33
|
+
apps: Record<string, AppCoverageSummary>;
|
|
34
|
+
totalCovered: number;
|
|
35
|
+
totalTypes: number;
|
|
36
|
+
percentage: number;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=TypesCoverage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypesCoverage.d.ts","sourceRoot":"","sources":["../../../../src/adapters/types-coverage/types/TypesCoverage.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CACjB,MAAM,EACN;QACE,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB,CACF,CAAC;CACH;AAKD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAKpD,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAKD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAG9B,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAKD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"architecture-analysis-config.d.ts","sourceRoot":"","sources":["../../src/configs/architecture-analysis-config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B;;;CAKtC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { sharedExclusionPatterns } from './shared-exclusion-patterns.js';
|
|
2
|
-
export const
|
|
2
|
+
export const architectureAnalysisConfig = {
|
|
3
3
|
fileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
|
4
4
|
excludeRegExp: sharedExclusionPatterns.map((glob) => glob.replace(/\*\*/g, '.*').replace(/\*/g, '.*')),
|
|
5
5
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const codeDuplicationConfig: {
|
|
2
|
+
minTokens: number;
|
|
3
|
+
minLines: number;
|
|
4
|
+
maxLines: number;
|
|
5
|
+
maxSize: string;
|
|
6
|
+
threshold: number | null;
|
|
7
|
+
mode: "weak" | "mild" | "strict";
|
|
8
|
+
absolute: boolean;
|
|
9
|
+
formats: string[];
|
|
10
|
+
ignore: string[];
|
|
11
|
+
ignorePatterns: string[];
|
|
12
|
+
reporters: string[];
|
|
13
|
+
worstFiles: {
|
|
14
|
+
threshold: number;
|
|
15
|
+
count: number;
|
|
16
|
+
};
|
|
17
|
+
thresholds: {
|
|
18
|
+
green: number;
|
|
19
|
+
orange: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=code-duplication-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-duplication-config.d.ts","sourceRoot":"","sources":["../../src/configs/code-duplication-config.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB;;;;;eAcb,MAAM,GAAG,IAAI;UAMhB,MAAM,GAAG,MAAM,GAAG,QAAQ;;aAW3B,MAAM,EAAE;;;;;;;;;;;;CA4CxB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { sharedExclusionPatterns } from './shared-exclusion-patterns.js';
|
|
2
|
+
export const codeDuplicationConfig = {
|
|
3
|
+
minTokens: 50,
|
|
4
|
+
minLines: 5,
|
|
5
|
+
maxLines: 2000,
|
|
6
|
+
maxSize: '500kb',
|
|
7
|
+
threshold: null,
|
|
8
|
+
mode: 'weak',
|
|
9
|
+
absolute: true,
|
|
10
|
+
formats: [],
|
|
11
|
+
ignore: sharedExclusionPatterns,
|
|
12
|
+
ignorePatterns: ["import .* from '.*';"],
|
|
13
|
+
reporters: ['html', 'json', 'console'],
|
|
14
|
+
worstFiles: {
|
|
15
|
+
threshold: 5,
|
|
16
|
+
count: 15,
|
|
17
|
+
},
|
|
18
|
+
thresholds: {
|
|
19
|
+
green: 10,
|
|
20
|
+
orange: 20,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-formatter-config.d.ts","sourceRoot":"","sources":["../../src/configs/code-formatter-config.ts"],"names":[],"mappings":"AAmDA,eAAO,MAAM,sBAAsB,UASlC,CAAC;AAsBF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;CAqB1B,CAAC"}
|
|
@@ -9,7 +9,4 @@ export declare const htmlFiles = "**/*.html";
|
|
|
9
9
|
export declare const storyFiles = "**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)";
|
|
10
10
|
export declare const testFiles: string[];
|
|
11
11
|
export declare const commonTextFiles = "**/*.{ts,tsx,mts,js,jsx,mjs,json,yml,yaml,md}";
|
|
12
|
-
export declare const jsonFiles = "**/*.json";
|
|
13
|
-
export declare const yamlFiles = "**/*.{yml,yaml}";
|
|
14
|
-
export declare const markdownFiles = "**/*.md";
|
|
15
12
|
//# sourceMappingURL=file-globs-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-globs-config.d.ts","sourceRoot":"","sources":["../../src/configs/file-globs-config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,mDAAmD,CAAC;AAE3E,eAAO,MAAM,OAAO,sBAAsB,CAAC;AAC3C,eAAO,MAAM,OAAO,kBAAkB,CAAC;AACvC,eAAO,MAAM,WAAW,mBAAmB,CAAC;AAC5C,eAAO,MAAM,SAAS,yBAAyB,CAAC;AAChD,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAE5C,eAAO,MAAM,QAAQ,oBAAoB,CAAC;AAC1C,eAAO,MAAM,SAAS,cAAc,CAAC;AAErC,eAAO,MAAM,UAAU,0CAA0C,CAAC;AAClE,eAAO,MAAM,SAAS,UAA4E,CAAC;AAEnG,eAAO,MAAM,eAAe,kDAAkD,CAAC
|
|
1
|
+
{"version":3,"file":"file-globs-config.d.ts","sourceRoot":"","sources":["../../src/configs/file-globs-config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,mDAAmD,CAAC;AAE3E,eAAO,MAAM,OAAO,sBAAsB,CAAC;AAC3C,eAAO,MAAM,OAAO,kBAAkB,CAAC;AACvC,eAAO,MAAM,WAAW,mBAAmB,CAAC;AAC5C,eAAO,MAAM,SAAS,yBAAyB,CAAC;AAChD,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAE5C,eAAO,MAAM,QAAQ,oBAAoB,CAAC;AAC1C,eAAO,MAAM,SAAS,cAAc,CAAC;AAErC,eAAO,MAAM,UAAU,0CAA0C,CAAC;AAClE,eAAO,MAAM,SAAS,UAA4E,CAAC;AAEnG,eAAO,MAAM,eAAe,kDAAkD,CAAC"}
|
|
@@ -9,6 +9,3 @@ export const htmlFiles = '**/*.html';
|
|
|
9
9
|
export const storyFiles = '**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)';
|
|
10
10
|
export const testFiles = ['**/*.{test,spec}.{ts,tsx,js,jsx}', '**/__tests__/**/*.{ts,tsx,js,jsx}'];
|
|
11
11
|
export const commonTextFiles = '**/*.{ts,tsx,mts,js,jsx,mjs,json,yml,yaml,md}';
|
|
12
|
-
export const jsonFiles = '**/*.json';
|
|
13
|
-
export const yamlFiles = '**/*.{yml,yaml}';
|
|
14
|
-
export const markdownFiles = '**/*.md';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"naming-conventions-config.d.ts","sourceRoot":"","sources":["../../src/configs/naming-conventions-config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAEpD,CAAC;AAMF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"naming-conventions-config.d.ts","sourceRoot":"","sources":["../../src/configs/naming-conventions-config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAEpD,CAAC;AAMF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAqCrD,CAAC;AAKF,KAAK,SAAS,GACV,aAAa,GACb,YAAY,GACZ,YAAY,GACZ,sBAAsB,GACtB,WAAW,GACX,YAAY,CAAC;AAMjB,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAiE9D,CAAC;AAMF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAE/D,CAAC"}
|
|
@@ -11,6 +11,8 @@ export const folderMatchWithFex = {
|
|
|
11
11
|
'src/data/hooks/**/use*.{ts}': 'src/data/hooks/**/',
|
|
12
12
|
'**/*.test.{ts,tsx}': '**/__tests__/',
|
|
13
13
|
'**/*.spec.{ts,tsx}': '**/__tests__/',
|
|
14
|
+
'**/*.w3c.spec.{ts,tsx}': '**/__tests__/',
|
|
15
|
+
'**/*.a11y.spec.{ts,tsx}': '**/__tests__/',
|
|
14
16
|
'**/*.constants.{ts,js}': 'src/**/',
|
|
15
17
|
'**/*.type.ts': 'src/**/',
|
|
16
18
|
'**/*.interface.ts': 'src/**/',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-exclusion-patterns.d.ts","sourceRoot":"","sources":["../../src/configs/shared-exclusion-patterns.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"shared-exclusion-patterns.d.ts","sourceRoot":"","sources":["../../src/configs/shared-exclusion-patterns.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,uBAAuB,UAuCnC,CAAC;AAyBF,eAAO,MAAM,4BAA4B,UAuBxC,CAAC"}
|
|
@@ -2,6 +2,7 @@ export const sharedExclusionPatterns = [
|
|
|
2
2
|
'**/node_modules/**',
|
|
3
3
|
'**/target/**',
|
|
4
4
|
'**/dist/**',
|
|
5
|
+
'**/coverage/**',
|
|
5
6
|
'**/.next/**',
|
|
6
7
|
'**/next*/**',
|
|
7
8
|
'**/.husky/**',
|
|
@@ -23,7 +24,7 @@ export const sharedExclusionPatterns = [
|
|
|
23
24
|
'**/test*/**',
|
|
24
25
|
'**/**test.*',
|
|
25
26
|
'**/**Test**',
|
|
26
|
-
'
|
|
27
|
+
'**/**spec*.*',
|
|
27
28
|
'**/mock*/**',
|
|
28
29
|
'**/mocks/**',
|
|
29
30
|
'**/_mock_/**',
|
|
@@ -34,4 +35,25 @@ export const sharedExclusionPatterns = [
|
|
|
34
35
|
'**/**hmr**',
|
|
35
36
|
'**/**config**',
|
|
36
37
|
'**/**cucumber**',
|
|
38
|
+
'**/Messages_*_*.json',
|
|
39
|
+
'**/**.md',
|
|
40
|
+
];
|
|
41
|
+
export const sharedTypesExclusionPatterns = [
|
|
42
|
+
'**/node_modules/**',
|
|
43
|
+
'**/dist/**',
|
|
44
|
+
'**/target/**',
|
|
45
|
+
'**/.next/**',
|
|
46
|
+
'**/.husky/**',
|
|
47
|
+
'**/.vscode/**',
|
|
48
|
+
'**/.idea/**',
|
|
49
|
+
'**/.gitlab/**',
|
|
50
|
+
'**/.github/**',
|
|
51
|
+
'**/webpack*.*',
|
|
52
|
+
'**/babel*.*',
|
|
53
|
+
'**/tailwind*.*',
|
|
54
|
+
'**/turbo.json',
|
|
55
|
+
'**/tsconfig.json',
|
|
56
|
+
'**/*.svg',
|
|
57
|
+
'**/**.md',
|
|
58
|
+
'**/Messages_*_*.json',
|
|
37
59
|
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tests-coverage-config.d.ts","sourceRoot":"","sources":["../../src/configs/tests-coverage-config.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB;;;;;;;;;;CA6B/B,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const typesCoverageConfig: {
|
|
2
|
+
threshold: number;
|
|
3
|
+
outputDir: string;
|
|
4
|
+
strict: boolean;
|
|
5
|
+
debug: boolean;
|
|
6
|
+
cache: boolean;
|
|
7
|
+
project: string;
|
|
8
|
+
ignoreFiles: string[];
|
|
9
|
+
ignoreUnread: boolean;
|
|
10
|
+
thresholds: {
|
|
11
|
+
green: number;
|
|
12
|
+
orange: number;
|
|
13
|
+
};
|
|
14
|
+
looseThresholds: {
|
|
15
|
+
as: {
|
|
16
|
+
green: number;
|
|
17
|
+
orange: number;
|
|
18
|
+
};
|
|
19
|
+
any: {
|
|
20
|
+
green: number;
|
|
21
|
+
orange: number;
|
|
22
|
+
};
|
|
23
|
+
unknown: {
|
|
24
|
+
green: number;
|
|
25
|
+
orange: number;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
worstFiles: {
|
|
29
|
+
count: number;
|
|
30
|
+
threshold: number;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=types-coverage-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-coverage-config.d.ts","sourceRoot":"","sources":["../../src/configs/types-coverage-config.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqD/B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { sharedTypesExclusionPatterns } from './shared-exclusion-patterns.js';
|
|
2
|
+
export const typesCoverageConfig = {
|
|
3
|
+
threshold: 60,
|
|
4
|
+
outputDir: 'coverage-ts',
|
|
5
|
+
strict: true,
|
|
6
|
+
debug: false,
|
|
7
|
+
cache: true,
|
|
8
|
+
project: 'tsconfig.json',
|
|
9
|
+
ignoreFiles: sharedTypesExclusionPatterns,
|
|
10
|
+
ignoreUnread: false,
|
|
11
|
+
thresholds: {
|
|
12
|
+
green: 80,
|
|
13
|
+
orange: 60,
|
|
14
|
+
},
|
|
15
|
+
looseThresholds: {
|
|
16
|
+
as: { green: 0, orange: 50 },
|
|
17
|
+
any: { green: 0, orange: 5 },
|
|
18
|
+
unknown: { green: 0, orange: 20 },
|
|
19
|
+
},
|
|
20
|
+
worstFiles: {
|
|
21
|
+
count: 15,
|
|
22
|
+
threshold: 100,
|
|
23
|
+
},
|
|
24
|
+
};
|