@ovh-ux/manager-static-analysis-kit 0.7.1 → 0.9.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 +48 -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 +18 -16
- package/bin/perf-budgets-cli.js +120 -0
- package/bin/perf-budgets-tests-cli.js +72 -0
- package/bin/static-dynamic-quality-checks.js +138 -0
- package/bin/tests-coverage-cli-tests.js +67 -0
- package/bin/tests-coverage-cli.js +135 -0
- package/bin/types-coverage-cli.js +127 -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 +222 -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 +139 -0
- package/dist/adapters/code-duplication/helpers/code-duplication-analysis-helper.d.ts +6 -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 +240 -0
- package/dist/adapters/code-duplication/types/CodeDuplication.d.ts +60 -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-naming-conventions.d.ts.map +1 -1
- package/dist/adapters/eslint/rules/eslint-naming-conventions.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 +7 -0
- package/dist/adapters/perf-budgets/helpers/perfs-bundle-analysis-helper.d.ts.map +1 -0
- package/dist/adapters/perf-budgets/helpers/perfs-bundle-analysis-helper.js +191 -0
- package/dist/adapters/perf-budgets/rules/perfs-budgets-rules.d.ts +10 -0
- package/dist/adapters/perf-budgets/rules/perfs-budgets-rules.d.ts.map +1 -0
- package/dist/adapters/perf-budgets/rules/perfs-budgets-rules.js +20 -0
- package/dist/adapters/perf-budgets/rules/perfs-budgets-scoring.d.ts +5 -0
- package/dist/adapters/perf-budgets/rules/perfs-budgets-scoring.d.ts.map +1 -0
- package/dist/adapters/perf-budgets/rules/perfs-budgets-scoring.js +35 -0
- package/dist/adapters/perf-budgets/types/PerfBudget.d.ts +22 -0
- package/dist/adapters/perf-budgets/types/PerfBudget.d.ts.map +1 -0
- package/dist/adapters/perf-budgets/types/PerfBudget.js +1 -0
- package/dist/adapters/perf-budgets/types/PerfBudgetAssets.d.ts +13 -0
- package/dist/adapters/perf-budgets/types/PerfBudgetAssets.d.ts.map +1 -0
- package/dist/adapters/perf-budgets/types/PerfBudgetAssets.js +1 -0
- package/dist/adapters/perf-budgets/types/PerfBudgetScore.d.ts +13 -0
- package/dist/adapters/perf-budgets/types/PerfBudgetScore.d.ts.map +1 -0
- package/dist/adapters/perf-budgets/types/PerfBudgetScore.js +1 -0
- 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 +192 -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 +158 -0
- package/dist/adapters/types-coverage/types/TypesCoverage.d.ts +30 -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/assets-budgets-config.d.ts +28 -0
- package/dist/configs/assets-budgets-config.d.ts.map +1 -0
- package/dist/configs/assets-budgets-config.js +45 -0
- package/dist/configs/bundle-analysis-config.d.ts +8 -0
- package/dist/configs/bundle-analysis-config.d.ts.map +1 -0
- package/dist/configs/bundle-analysis-config.js +7 -0
- package/dist/configs/code-duplication-config.d.ts +21 -0
- package/dist/configs/code-duplication-config.d.ts.map +1 -0
- package/dist/configs/code-duplication-config.js +21 -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 +1 -4
- package/dist/configs/file-globs-config.d.ts.map +1 -1
- package/dist/configs/file-globs-config.js +1 -4
- 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.map +1 -1
- package/dist/configs/shared-exclusion-patterns.js +3 -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 +19 -0
- package/dist/configs/types-coverage-config.d.ts.map +1 -0
- package/dist/configs/types-coverage-config.js +27 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +35 -7
- 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,158 @@
|
|
|
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
|
+
export function collectTypesCoverage(reportOutputDir) {
|
|
26
|
+
const apps = {};
|
|
27
|
+
let totalCovered = 0;
|
|
28
|
+
let totalTypes = 0;
|
|
29
|
+
if (!fs.existsSync(reportOutputDir)) {
|
|
30
|
+
return { apps: {}, totalCovered: 0, totalTypes: 0, percentage: 0 };
|
|
31
|
+
}
|
|
32
|
+
const appDirs = fs
|
|
33
|
+
.readdirSync(reportOutputDir)
|
|
34
|
+
.filter((entry) => fs.statSync(path.join(reportOutputDir, entry)).isDirectory());
|
|
35
|
+
for (const appDirName of appDirs) {
|
|
36
|
+
const jsonPath = path.join(reportOutputDir, appDirName, 'typescript-coverage.json');
|
|
37
|
+
if (!fs.existsSync(jsonPath))
|
|
38
|
+
continue;
|
|
39
|
+
try {
|
|
40
|
+
const report = JSON.parse(fs.readFileSync(jsonPath, 'utf-8'));
|
|
41
|
+
const covered = report.covered ?? 0;
|
|
42
|
+
const total = report.total ?? 0;
|
|
43
|
+
const percentage = total > 0 ? (covered / total) * 100 : 0;
|
|
44
|
+
const appShortName = appDirName.replace(/^manager-/, '').replace(/-app$/, '');
|
|
45
|
+
apps[appShortName] = {
|
|
46
|
+
covered,
|
|
47
|
+
total,
|
|
48
|
+
percentage,
|
|
49
|
+
worstFiles: extractWorstFiles(report),
|
|
50
|
+
};
|
|
51
|
+
totalCovered += covered;
|
|
52
|
+
totalTypes += total;
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
apps[appDirName] = {
|
|
56
|
+
covered: 0,
|
|
57
|
+
total: 0,
|
|
58
|
+
percentage: 0,
|
|
59
|
+
error: err.message,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
apps,
|
|
65
|
+
totalCovered,
|
|
66
|
+
totalTypes,
|
|
67
|
+
percentage: totalTypes > 0 ? (totalCovered / totalTypes) * 100 : 0,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function getReportStatusColor(percentage) {
|
|
71
|
+
const { green, orange } = typesCoverageConfig.thresholds;
|
|
72
|
+
if (percentage >= green)
|
|
73
|
+
return 'green';
|
|
74
|
+
if (percentage >= orange)
|
|
75
|
+
return 'orange';
|
|
76
|
+
return 'red';
|
|
77
|
+
}
|
|
78
|
+
function renderWorstFiles(app, worstFiles = []) {
|
|
79
|
+
if (!worstFiles.length) {
|
|
80
|
+
return `
|
|
81
|
+
<details>
|
|
82
|
+
<summary>⚠️ Worst covered files</summary>
|
|
83
|
+
<p style="margin:0.5rem 0; color:#888;">No files below threshold 🎉</p>
|
|
84
|
+
</details>`;
|
|
85
|
+
}
|
|
86
|
+
const rows = worstFiles
|
|
87
|
+
.map(([file, f]) => `
|
|
88
|
+
<tr>
|
|
89
|
+
<td colspan="2">${file}</td>
|
|
90
|
+
<td>${f.covered}/${f.total}</td>
|
|
91
|
+
<td style="color:${getReportStatusColor(f.percentage)}">
|
|
92
|
+
${f.percentage.toFixed(2)}%
|
|
93
|
+
</td>
|
|
94
|
+
</tr>`)
|
|
95
|
+
.join('');
|
|
96
|
+
return `
|
|
97
|
+
<details>
|
|
98
|
+
<summary>⚠️ Worst covered files (below ${typesCoverageConfig.worstFiles.threshold}%)</summary>
|
|
99
|
+
<table style="margin:0.5rem 0; border:1px solid #ccc; width:95%;">
|
|
100
|
+
<tbody>${rows}</tbody>
|
|
101
|
+
</table>
|
|
102
|
+
</details>`;
|
|
103
|
+
}
|
|
104
|
+
function buildRows(apps) {
|
|
105
|
+
return Object.entries(apps)
|
|
106
|
+
.map(([app, stats]) => {
|
|
107
|
+
if (stats.error) {
|
|
108
|
+
return `<tr style="background:#ffe0e0">
|
|
109
|
+
<td>${app}</td>
|
|
110
|
+
<td colspan="3" style="color:red">${stats.error}</td>
|
|
111
|
+
</tr>`;
|
|
112
|
+
}
|
|
113
|
+
const status = getReportStatusColor(stats.percentage);
|
|
114
|
+
const statusBg = status === 'green' ? '#e6ffed' : status === 'orange' ? '#fff8e1' : '#ffe6e6';
|
|
115
|
+
return `
|
|
116
|
+
<tr style="background:${statusBg}">
|
|
117
|
+
<td>${app}</td>
|
|
118
|
+
<td>${stats.covered}</td>
|
|
119
|
+
<td>${stats.total}</td>
|
|
120
|
+
<td style="font-weight:bold;">${stats.percentage.toFixed(2)}%</td>
|
|
121
|
+
</tr>
|
|
122
|
+
<tr><td colspan="4">${renderWorstFiles(app, stats.worstFiles)}</td></tr>`;
|
|
123
|
+
})
|
|
124
|
+
.join('');
|
|
125
|
+
}
|
|
126
|
+
export function generateTypesCoverageHtml(summary) {
|
|
127
|
+
return `<!DOCTYPE html>
|
|
128
|
+
<html lang="en">
|
|
129
|
+
<head>
|
|
130
|
+
<meta charset="UTF-8"/>
|
|
131
|
+
<title>TypeScript Types Coverage Report</title>
|
|
132
|
+
<style>
|
|
133
|
+
body { font-family: Arial, sans-serif; margin: 2rem; }
|
|
134
|
+
h1 { margin-bottom: 1rem; }
|
|
135
|
+
table { border-collapse: collapse; width: 100%; margin-bottom: 2rem; }
|
|
136
|
+
th, td { border: 1px solid #ccc; padding: 0.5rem; text-align: left; vertical-align: top; }
|
|
137
|
+
th { background: #f0f0f0; }
|
|
138
|
+
details summary { cursor: pointer; font-weight: bold; }
|
|
139
|
+
</style>
|
|
140
|
+
</head>
|
|
141
|
+
<body>
|
|
142
|
+
<h1>TypeScript Types Coverage Report</h1>
|
|
143
|
+
<p>Total: ${summary.totalCovered} / ${summary.totalTypes}
|
|
144
|
+
(${summary.percentage.toFixed(2)}%)</p>
|
|
145
|
+
<table>
|
|
146
|
+
<thead>
|
|
147
|
+
<tr>
|
|
148
|
+
<th>App</th>
|
|
149
|
+
<th>Covered</th>
|
|
150
|
+
<th>Total</th>
|
|
151
|
+
<th>Coverage</th>
|
|
152
|
+
</tr>
|
|
153
|
+
</thead>
|
|
154
|
+
<tbody>${buildRows(summary.apps)}</tbody>
|
|
155
|
+
</table>
|
|
156
|
+
</body>
|
|
157
|
+
</html>`;
|
|
158
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 AppCoverageSummary {
|
|
18
|
+
covered: number;
|
|
19
|
+
total: number;
|
|
20
|
+
percentage: number;
|
|
21
|
+
error?: string;
|
|
22
|
+
worstFiles?: WorstFileEntry[];
|
|
23
|
+
}
|
|
24
|
+
export interface CoverageSummary {
|
|
25
|
+
apps: Record<string, AppCoverageSummary>;
|
|
26
|
+
totalCovered: number;
|
|
27
|
+
totalTypes: number;
|
|
28
|
+
percentage: number;
|
|
29
|
+
}
|
|
30
|
+
//# 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,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;CAC/B;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,28 @@
|
|
|
1
|
+
export declare const assetsBudgetsConfig: {
|
|
2
|
+
medians: {
|
|
3
|
+
jsKb: number;
|
|
4
|
+
cssKb: number;
|
|
5
|
+
imgKb: number;
|
|
6
|
+
htmlKb: number;
|
|
7
|
+
};
|
|
8
|
+
thresholds: {
|
|
9
|
+
nearFactor: number;
|
|
10
|
+
exceedFactor: number;
|
|
11
|
+
};
|
|
12
|
+
heavyAssetsCount: number;
|
|
13
|
+
links: {
|
|
14
|
+
httpArchive: {
|
|
15
|
+
label: string;
|
|
16
|
+
url: string;
|
|
17
|
+
}[];
|
|
18
|
+
optimization: {
|
|
19
|
+
label: string;
|
|
20
|
+
url: string;
|
|
21
|
+
}[];
|
|
22
|
+
tips: {
|
|
23
|
+
label: string;
|
|
24
|
+
desc: string;
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=assets-budgets-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets-budgets-config.d.ts","sourceRoot":"","sources":["../../src/configs/assets-budgets-config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;CA2D/B,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export const assetsBudgetsConfig = {
|
|
2
|
+
medians: {
|
|
3
|
+
jsKb: 747.5,
|
|
4
|
+
cssKb: 86.8,
|
|
5
|
+
imgKb: 1066.6,
|
|
6
|
+
htmlKb: 35.5,
|
|
7
|
+
},
|
|
8
|
+
thresholds: {
|
|
9
|
+
nearFactor: 0.7,
|
|
10
|
+
exceedFactor: 1.0,
|
|
11
|
+
},
|
|
12
|
+
heavyAssetsCount: 5,
|
|
13
|
+
links: {
|
|
14
|
+
httpArchive: [
|
|
15
|
+
{ label: 'JavaScript Median', url: 'https://httparchive.org/reports/page-weight#bytesJs' },
|
|
16
|
+
{ label: 'CSS Median', url: 'https://httparchive.org/reports/page-weight#bytesCss' },
|
|
17
|
+
{ label: 'HTML Median', url: 'https://httparchive.org/reports/page-weight#bytesHtml' },
|
|
18
|
+
{ label: 'Image Median', url: 'https://httparchive.org/reports/page-weight#bytesImg' },
|
|
19
|
+
],
|
|
20
|
+
optimization: [
|
|
21
|
+
{ label: 'Web.dev: Learn Performance', url: 'https://web.dev/learn/performance' },
|
|
22
|
+
{ label: 'Web.dev: Performance Guide', url: 'https://web.dev/performance' },
|
|
23
|
+
{ label: 'Bundle Splitting', url: 'https://www.patterns.dev/vanilla/bundle-splitting/' },
|
|
24
|
+
{ label: 'Dynamic Import', url: 'https://www.patterns.dev/vanilla/dynamic-import/' },
|
|
25
|
+
{
|
|
26
|
+
label: 'Import on Interaction',
|
|
27
|
+
url: 'https://www.patterns.dev/vanilla/import-on-interaction/',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: 'Import on Visibility',
|
|
31
|
+
url: 'https://www.patterns.dev/vanilla/import-on-visibility/',
|
|
32
|
+
},
|
|
33
|
+
{ label: 'Loading Sequence', url: 'https://www.patterns.dev/vanilla/loading-sequence/' },
|
|
34
|
+
{ label: 'Virtual Lists', url: 'https://www.patterns.dev/vanilla/virtual-lists/' },
|
|
35
|
+
{ label: 'Third-party Scripts', url: 'https://www.patterns.dev/vanilla/third-party/' },
|
|
36
|
+
],
|
|
37
|
+
tips: [
|
|
38
|
+
{ label: 'State Localization', desc: 'Minimize unnecessary re-renders by localizing state.' },
|
|
39
|
+
{ label: 'Memoization', desc: 'Use useMemo/useCallback for expensive calcs and functions.' },
|
|
40
|
+
{ label: 'Lazy Loading', desc: 'Load components/routes lazily to improve initial load.' },
|
|
41
|
+
{ label: 'Virtualization', desc: 'Use react-window/react-virtualized for large lists.' },
|
|
42
|
+
{ label: 'Profiling', desc: 'Use React Profiler and browser DevTools to spot bottlenecks.' },
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-analysis-config.d.ts","sourceRoot":"","sources":["../../src/configs/bundle-analysis-config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB;;;;;;CAMhC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
reporters: string[];
|
|
12
|
+
worstFiles: {
|
|
13
|
+
threshold: number;
|
|
14
|
+
count: number;
|
|
15
|
+
};
|
|
16
|
+
thresholds: {
|
|
17
|
+
green: number;
|
|
18
|
+
orange: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
//# 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;;;;;;;;;;;CAgCxB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
reporters: ['html', 'json', 'console'],
|
|
13
|
+
worstFiles: {
|
|
14
|
+
threshold: 5,
|
|
15
|
+
count: 10,
|
|
16
|
+
},
|
|
17
|
+
thresholds: {
|
|
18
|
+
green: 10,
|
|
19
|
+
orange: 20,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -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"}
|
|
@@ -8,8 +8,5 @@ export declare const cssFiles = "**/*.{scss,css}";
|
|
|
8
8
|
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
|
-
export declare const commonTextFiles = "**/*.{ts,tsx,js,jsx,json,yml,yaml,md}";
|
|
12
|
-
export declare const jsonFiles = "**/*.json";
|
|
13
|
-
export declare const yamlFiles = "**/*.{yml,yaml}";
|
|
14
|
-
export declare const markdownFiles = "**/*.md";
|
|
11
|
+
export declare const commonTextFiles = "**/*.{ts,tsx,mts,js,jsx,mjs,json,yml,yaml,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,
|
|
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"}
|
|
@@ -8,7 +8,4 @@ export const cssFiles = '**/*.{scss,css}';
|
|
|
8
8
|
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
|
-
export const commonTextFiles = '**/*.{ts,tsx,js,jsx,json,yml,yaml,md}';
|
|
12
|
-
export const jsonFiles = '**/*.json';
|
|
13
|
-
export const yamlFiles = '**/*.{yml,yaml}';
|
|
14
|
-
export const markdownFiles = '**/*.md';
|
|
11
|
+
export const commonTextFiles = '**/*.{ts,tsx,mts,js,jsx,mjs,json,yml,yaml,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,UAsCnC,CAAC"}
|
|
@@ -23,7 +23,7 @@ export const sharedExclusionPatterns = [
|
|
|
23
23
|
'**/test*/**',
|
|
24
24
|
'**/**test.*',
|
|
25
25
|
'**/**Test**',
|
|
26
|
-
'
|
|
26
|
+
'**/**spec*.*',
|
|
27
27
|
'**/mock*/**',
|
|
28
28
|
'**/mocks/**',
|
|
29
29
|
'**/_mock_/**',
|
|
@@ -34,4 +34,6 @@ export const sharedExclusionPatterns = [
|
|
|
34
34
|
'**/**hmr**',
|
|
35
35
|
'**/**config**',
|
|
36
36
|
'**/**cucumber**',
|
|
37
|
+
'**/Messages_*_*.json',
|
|
38
|
+
'**/**.md',
|
|
37
39
|
];
|
|
@@ -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,19 @@
|
|
|
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
|
+
worstFiles: {
|
|
15
|
+
count: number;
|
|
16
|
+
threshold: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
//# 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":"AAMA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;CAoD/B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const typesCoverageConfig = {
|
|
2
|
+
threshold: 80,
|
|
3
|
+
outputDir: 'coverage-ts',
|
|
4
|
+
strict: true,
|
|
5
|
+
debug: false,
|
|
6
|
+
cache: true,
|
|
7
|
+
project: 'tsconfig.json',
|
|
8
|
+
ignoreFiles: [
|
|
9
|
+
'**/*.stories.tsx',
|
|
10
|
+
'**/*.stories.ts',
|
|
11
|
+
'**/*.spec.ts',
|
|
12
|
+
'**/*.spec.tsx',
|
|
13
|
+
'**/jest.config.ts',
|
|
14
|
+
'**/vitest.config.*',
|
|
15
|
+
'**/dist/**',
|
|
16
|
+
'**/.generated/**',
|
|
17
|
+
],
|
|
18
|
+
ignoreUnread: true,
|
|
19
|
+
thresholds: {
|
|
20
|
+
green: 90,
|
|
21
|
+
orange: 70,
|
|
22
|
+
},
|
|
23
|
+
worstFiles: {
|
|
24
|
+
count: 10,
|
|
25
|
+
threshold: 80,
|
|
26
|
+
},
|
|
27
|
+
};
|