@ovh-ux/manager-static-analysis-kit 0.10.0 → 0.11.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 +14 -0
- package/README.md +166 -24
- package/bin/cli-path-config.js +41 -2
- package/bin/code-duplication-cli.js +14 -16
- package/bin/code-duplication-tests-cli.js +43 -6
- package/bin/perf-budgets-cli.js +15 -15
- package/bin/perf-budgets-tests-cli.js +36 -3
- package/bin/static-dynamic-quality-checks.js +2 -2
- package/bin/tests-coverage-cli-tests.js +44 -6
- package/bin/tests-coverage-cli.js +35 -27
- package/bin/types-coverage-cli.js +8 -11
- package/bin/types-coverage-tests-cli.js +44 -7
- package/bin/utils/args-parse-utils.js +69 -106
- package/bin/utils/module-utils.js +121 -0
- package/bin/utils/runner-utils.js +117 -22
- package/bin/utils/turbo-utils.js +1 -71
- 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 +8 -4
- package/dist/configs/shared-exclusion-patterns.d.ts.map +1 -1
- package/dist/configs/shared-exclusion-patterns.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/bin/utils/apps-utils.js +0 -64
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ovh-ux/manager-static-analysis-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "A modular, extensible, and future-ready toolkit for defining, adapting, and sharing static analysis rules across projects in the `manager` monorepo.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
package/bin/utils/apps-utils.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
|
|
4
|
-
import { readJsonSafe } from './file-utils.js';
|
|
5
|
-
import { logError, logWarn } from './log-utils.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Check if a given package.json belongs to a React app.
|
|
9
|
-
*/
|
|
10
|
-
export function isReactApp(pkgPath) {
|
|
11
|
-
try {
|
|
12
|
-
if (!fs.existsSync(pkgPath)) return false;
|
|
13
|
-
|
|
14
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
15
|
-
if (!pkg || typeof pkg !== 'object') return false;
|
|
16
|
-
|
|
17
|
-
const deps = { ...pkg.dependencies, ...pkg.devDependencies, ...pkg.peerDependencies };
|
|
18
|
-
return Boolean(deps.react);
|
|
19
|
-
} catch (err) {
|
|
20
|
-
logWarn(`Failed to read or parse ${pkgPath}: ${err.message}`);
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Resolve app short name from package.json (fallback to folder).
|
|
27
|
-
*/
|
|
28
|
-
export function getAppShortName(pkgPath, folder) {
|
|
29
|
-
const pkg = readJsonSafe(pkgPath) || {};
|
|
30
|
-
return (pkg.name && String(pkg.name).replace(/^@ovh-ux\//, '')) || folder;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Unified app info resolver.
|
|
35
|
-
* - Ensures folder exists
|
|
36
|
-
* - Ensures package.json exists
|
|
37
|
-
* - Optionally enforces React app
|
|
38
|
-
*/
|
|
39
|
-
export function resolveAppInfo(appsDir, appFolder, { requireReact = false } = {}) {
|
|
40
|
-
const appDir = path.join(appsDir, appFolder);
|
|
41
|
-
if (!fs.existsSync(appDir)) {
|
|
42
|
-
logError(`❌ App folder not found: ${appFolder} → skipping`);
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const pkgPath = path.join(appDir, 'package.json');
|
|
47
|
-
if (!fs.existsSync(pkgPath)) {
|
|
48
|
-
logWarn(`⚠️ No package.json for ${appFolder}, skipping`);
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (requireReact && !isReactApp(pkgPath)) {
|
|
53
|
-
logWarn(`⚠️ ${appFolder} is not a React app, skipping`);
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return {
|
|
58
|
-
appDir,
|
|
59
|
-
pkgPath,
|
|
60
|
-
appFolder,
|
|
61
|
-
appShortName: getAppShortName(pkgPath, appFolder),
|
|
62
|
-
pkg: readJsonSafe(pkgPath),
|
|
63
|
-
};
|
|
64
|
-
}
|