@monodog/utils 1.0.1 → 1.0.3
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/.turbo/turbo-build.log +4 -0
- package/CHANGELOG.md +7 -0
- package/LICENCE +21 -0
- package/dist/helpers.d.ts +93 -0
- package/dist/helpers.js +478 -0
- package/dist/helpers.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/helpers.d.ts +63 -48
- package/helpers.js +254 -248
- package/helpers.ts +1 -1
- package/package.json +6 -7
- package/tsconfig.json +2 -2
package/helpers.d.ts
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
export interface PackageInfo {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
name: string;
|
|
3
|
+
version: string;
|
|
4
|
+
type: string;
|
|
5
|
+
path: string;
|
|
6
|
+
dependencies: Record<string, string>;
|
|
7
|
+
devDependencies: Record<string, string>;
|
|
8
|
+
peerDependencies: Record<string, string>;
|
|
9
|
+
scripts: Record<string, string>;
|
|
10
|
+
maintainers: string[];
|
|
11
|
+
description?: string;
|
|
12
|
+
license?: string;
|
|
13
|
+
repository?: Record<string, string>;
|
|
14
14
|
}
|
|
15
15
|
export interface DependencyInfo {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
name: string;
|
|
17
|
+
version: string;
|
|
18
|
+
type: 'dependency' | 'devDependency' | 'peerDependency';
|
|
19
|
+
latest?: string;
|
|
20
|
+
status?: 'up-to-date' | 'outdated' | 'major-update' | 'unknown';
|
|
21
|
+
outdated?: boolean;
|
|
22
22
|
}
|
|
23
23
|
export interface PackageHealth {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
buildStatus: 'success' | 'failed' | 'running' | 'unknown';
|
|
25
|
+
testCoverage: number;
|
|
26
|
+
lintStatus: 'pass' | 'fail' | 'unknown';
|
|
27
|
+
securityAudit: 'pass' | 'fail' | 'unknown';
|
|
28
|
+
overallScore: number;
|
|
29
29
|
}
|
|
30
30
|
export interface MonorepoStats {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
totalPackages: number;
|
|
32
|
+
apps: number;
|
|
33
|
+
libraries: number;
|
|
34
|
+
tools: number;
|
|
35
|
+
healthyPackages: number;
|
|
36
|
+
warningPackages: number;
|
|
37
|
+
errorPackages: number;
|
|
38
|
+
outdatedDependencies: number;
|
|
39
|
+
totalDependencies: number;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Scans the monorepo and returns information about all packages
|
|
@@ -48,7 +48,12 @@ declare function scanMonorepo(rootDir: string): PackageInfo[];
|
|
|
48
48
|
/**
|
|
49
49
|
* Calculates package health score based on various metrics
|
|
50
50
|
*/
|
|
51
|
-
declare function calculatePackageHealth(
|
|
51
|
+
declare function calculatePackageHealth(
|
|
52
|
+
buildStatus: PackageHealth['buildStatus'],
|
|
53
|
+
testCoverage: number,
|
|
54
|
+
lintStatus: PackageHealth['lintStatus'],
|
|
55
|
+
securityAudit: PackageHealth['securityAudit']
|
|
56
|
+
): PackageHealth;
|
|
52
57
|
/**
|
|
53
58
|
* Generates comprehensive monorepo statistics
|
|
54
59
|
*/
|
|
@@ -61,27 +66,37 @@ declare function findCircularDependencies(packages: PackageInfo[]): string[][];
|
|
|
61
66
|
* Generates a dependency graph for visualization
|
|
62
67
|
*/
|
|
63
68
|
declare function generateDependencyGraph(packages: PackageInfo[]): {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
nodes: {
|
|
70
|
+
label: string;
|
|
71
|
+
type: string;
|
|
72
|
+
version: string;
|
|
73
|
+
dependencies: number;
|
|
74
|
+
}[];
|
|
75
|
+
edges: {
|
|
76
|
+
from: string;
|
|
77
|
+
to: string;
|
|
78
|
+
type: string;
|
|
79
|
+
}[];
|
|
75
80
|
};
|
|
76
81
|
/**
|
|
77
82
|
* Checks if a package has outdated dependencies
|
|
78
83
|
*/
|
|
79
|
-
declare function checkOutdatedDependencies(
|
|
84
|
+
declare function checkOutdatedDependencies(
|
|
85
|
+
packageInfo: PackageInfo
|
|
86
|
+
): DependencyInfo[];
|
|
80
87
|
/**
|
|
81
88
|
* Gets package size information
|
|
82
89
|
*/
|
|
83
90
|
declare function getPackageSize(packagePath: string): {
|
|
84
|
-
|
|
85
|
-
|
|
91
|
+
size: number;
|
|
92
|
+
files: number;
|
|
93
|
+
};
|
|
94
|
+
export {
|
|
95
|
+
scanMonorepo,
|
|
96
|
+
generateMonorepoStats,
|
|
97
|
+
findCircularDependencies,
|
|
98
|
+
generateDependencyGraph,
|
|
99
|
+
checkOutdatedDependencies,
|
|
100
|
+
getPackageSize,
|
|
101
|
+
calculatePackageHealth,
|
|
86
102
|
};
|
|
87
|
-
export { scanMonorepo, generateMonorepoStats, findCircularDependencies, generateDependencyGraph, checkOutdatedDependencies, getPackageSize, calculatePackageHealth, };
|