@manojkmfsi/monodog 1.1.37 โ 1.1.39
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 +12 -0
- package/monodog-dashboard/dist/assets/index-C08ciT3A.js +20 -0
- package/monodog-dashboard/dist/assets/index-C08ciT3A.js.map +1 -0
- package/monodog-dashboard/dist/assets/index-Dc2vaUOq.css +1 -0
- package/monodog-dashboard/{index.html โ dist/index.html} +2 -1
- package/monodog-dashboard/package.json +0 -3
- package/package.json +2 -2
- package/monodog-dashboard/THEME_SYSTEM.md +0 -309
- package/monodog-dashboard/__tests__/AuthCallbackPage.test.ts +0 -138
- package/monodog-dashboard/__tests__/ConfigInspector.test.ts +0 -33
- package/monodog-dashboard/__tests__/DependencyGraph.test.ts +0 -72
- package/monodog-dashboard/__tests__/HealthStatus.test.ts +0 -69
- package/monodog-dashboard/__tests__/LoginPage.test.ts +0 -79
- package/monodog-dashboard/__tests__/PackageDetail.test.ts +0 -22
- package/monodog-dashboard/__tests__/ReleaseManager.test.tsx +0 -510
- package/monodog-dashboard/__tests__/api-client.test.ts +0 -475
- package/monodog-dashboard/__tests__/components.test.ts +0 -117
- package/monodog-dashboard/__tests__/dashboard.utils.test.ts +0 -144
- package/monodog-dashboard/__tests__/dependency.utils.test.ts +0 -125
- package/monodog-dashboard/__tests__/monorepoService.unit.test.ts +0 -103
- package/monodog-dashboard/__tests__/packages.utils.test.ts +0 -37
- package/monodog-dashboard/__tests__/pages.test.ts +0 -103
- package/monodog-dashboard/package-lock.json +0 -4587
- package/monodog-dashboard/postcss.config.js +0 -6
- package/monodog-dashboard/src/components/App.tsx +0 -36
- package/monodog-dashboard/src/components/LoadingState.tsx +0 -18
- package/monodog-dashboard/src/components/PermissionGuard.tsx +0 -92
- package/monodog-dashboard/src/components/ProtectedRoute.tsx +0 -24
- package/monodog-dashboard/src/components/configuration/Configuration.tsx +0 -91
- package/monodog-dashboard/src/components/configuration/components/BrandingSettings.tsx +0 -128
- package/monodog-dashboard/src/components/configuration/components/ConfigurationHeader.tsx +0 -34
- package/monodog-dashboard/src/components/configuration/components/ConfigurationModal.tsx +0 -20
- package/monodog-dashboard/src/components/configuration/components/ConfigurationTabs.tsx +0 -30
- package/monodog-dashboard/src/components/configuration/components/FeatureToggles.tsx +0 -66
- package/monodog-dashboard/src/components/configuration/components/GeneralSettings.tsx +0 -77
- package/monodog-dashboard/src/components/configuration/components/MonorepoSettings.tsx +0 -179
- package/monodog-dashboard/src/components/configuration/components/index.ts +0 -8
- package/monodog-dashboard/src/components/configuration/types/config.types.ts +0 -52
- package/monodog-dashboard/src/components/configuration/utils/config.utils.tsx +0 -115
- package/monodog-dashboard/src/components/main-dashboard/Dashboard.tsx +0 -242
- package/monodog-dashboard/src/components/main-dashboard/Layout.tsx +0 -112
- package/monodog-dashboard/src/components/main-dashboard/components/Header.tsx +0 -47
- package/monodog-dashboard/src/components/main-dashboard/components/PackageDistribution.tsx +0 -35
- package/monodog-dashboard/src/components/main-dashboard/components/PackageSearchFilter.tsx +0 -47
- package/monodog-dashboard/src/components/main-dashboard/components/PackageTable.tsx +0 -87
- package/monodog-dashboard/src/components/main-dashboard/components/QuickActions.tsx +0 -60
- package/monodog-dashboard/src/components/main-dashboard/components/StatsCards.tsx +0 -73
- package/monodog-dashboard/src/components/main-dashboard/components/index.ts +0 -7
- package/monodog-dashboard/src/components/main-dashboard/types/dashboard.types.ts +0 -33
- package/monodog-dashboard/src/components/main-dashboard/utils/dashboard.utils.tsx +0 -70
- package/monodog-dashboard/src/components/modules/ci-integration/CIIntegration.tsx +0 -277
- package/monodog-dashboard/src/components/modules/ci-integration/components/BuildDetails.tsx +0 -228
- package/monodog-dashboard/src/components/modules/ci-integration/components/BuildList.tsx +0 -212
- package/monodog-dashboard/src/components/modules/ci-integration/components/BuildOverview.tsx +0 -158
- package/monodog-dashboard/src/components/modules/ci-integration/components/CIIntegrationHeader.tsx +0 -38
- package/monodog-dashboard/src/components/modules/ci-integration/components/ErrorState.tsx +0 -25
- package/monodog-dashboard/src/components/modules/ci-integration/components/LoadingState.tsx +0 -16
- package/monodog-dashboard/src/components/modules/ci-integration/components/PipelineStatus.tsx +0 -223
- package/monodog-dashboard/src/components/modules/ci-integration/components/index.ts +0 -8
- package/monodog-dashboard/src/components/modules/ci-integration/types/ci.types.ts +0 -97
- package/monodog-dashboard/src/components/modules/ci-integration/utils/ci.utils.tsx +0 -264
- package/monodog-dashboard/src/components/modules/config-inspector/ConfigInspector.tsx +0 -324
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigEditor.tsx +0 -93
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigInspectorHeader.tsx +0 -36
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigPreview.tsx +0 -89
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigSidebar.tsx +0 -141
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigToolbar.tsx +0 -184
- package/monodog-dashboard/src/components/modules/config-inspector/components/ErrorState.tsx +0 -25
- package/monodog-dashboard/src/components/modules/config-inspector/components/LoadingState.tsx +0 -16
- package/monodog-dashboard/src/components/modules/config-inspector/components/ValidationPanel.tsx +0 -155
- package/monodog-dashboard/src/components/modules/config-inspector/components/index.ts +0 -9
- package/monodog-dashboard/src/components/modules/config-inspector/types/config.types.ts +0 -100
- package/monodog-dashboard/src/components/modules/config-inspector/utils/config.utils.tsx +0 -704
- package/monodog-dashboard/src/components/modules/dependency-graph/DependencyGraph.tsx +0 -224
- package/monodog-dashboard/src/components/modules/dependency-graph/components/CircularDependencies.tsx +0 -177
- package/monodog-dashboard/src/components/modules/dependency-graph/components/DependencyDetails.tsx +0 -192
- package/monodog-dashboard/src/components/modules/dependency-graph/components/DependencyGraphHeader.tsx +0 -30
- package/monodog-dashboard/src/components/modules/dependency-graph/components/DependencyList.tsx +0 -177
- package/monodog-dashboard/src/components/modules/dependency-graph/components/ErrorState.tsx +0 -25
- package/monodog-dashboard/src/components/modules/dependency-graph/components/GraphLegend.tsx +0 -89
- package/monodog-dashboard/src/components/modules/dependency-graph/components/GraphStats.tsx +0 -141
- package/monodog-dashboard/src/components/modules/dependency-graph/components/GraphToolbar.tsx +0 -107
- package/monodog-dashboard/src/components/modules/dependency-graph/components/GraphVisualization.tsx +0 -179
- package/monodog-dashboard/src/components/modules/dependency-graph/components/LoadingState.tsx +0 -16
- package/monodog-dashboard/src/components/modules/dependency-graph/components/index.ts +0 -11
- package/monodog-dashboard/src/components/modules/dependency-graph/types/dependency.types.ts +0 -105
- package/monodog-dashboard/src/components/modules/dependency-graph/utils/dependency.utils.tsx +0 -433
- package/monodog-dashboard/src/components/modules/health-status/HealthStatus.tsx +0 -739
- package/monodog-dashboard/src/components/modules/health-status/components/ErrorState.tsx +0 -25
- package/monodog-dashboard/src/components/modules/health-status/components/HealthActions.tsx +0 -122
- package/monodog-dashboard/src/components/modules/health-status/components/HealthAlerts.tsx +0 -151
- package/monodog-dashboard/src/components/modules/health-status/components/HealthMetrics.tsx +0 -132
- package/monodog-dashboard/src/components/modules/health-status/components/HealthStatusHeader.tsx +0 -30
- package/monodog-dashboard/src/components/modules/health-status/components/LoadingState.tsx +0 -16
- package/monodog-dashboard/src/components/modules/health-status/components/OverallHealthScore.tsx +0 -122
- package/monodog-dashboard/src/components/modules/health-status/components/PackageHealthList.tsx +0 -195
- package/monodog-dashboard/src/components/modules/health-status/types/health.types.ts +0 -80
- package/monodog-dashboard/src/components/modules/health-status/utils/health.utils.tsx +0 -220
- package/monodog-dashboard/src/components/modules/packages/PackageDetail.tsx +0 -255
- package/monodog-dashboard/src/components/modules/packages/PackagesOverview.tsx +0 -166
- package/monodog-dashboard/src/components/modules/packages/components/ConfigurationTab.tsx +0 -311
- package/monodog-dashboard/src/components/modules/packages/components/DependenciesTab.tsx +0 -154
- package/monodog-dashboard/src/components/modules/packages/components/ErrorState.tsx +0 -21
- package/monodog-dashboard/src/components/modules/packages/components/HealthMetricsTab.tsx +0 -275
- package/monodog-dashboard/src/components/modules/packages/components/LoadingState.tsx +0 -14
- package/monodog-dashboard/src/components/modules/packages/components/PackageDetailHeader.tsx +0 -167
- package/monodog-dashboard/src/components/modules/packages/components/PackageDetailTabs.tsx +0 -49
- package/monodog-dashboard/src/components/modules/packages/components/PackageStats.tsx +0 -70
- package/monodog-dashboard/src/components/modules/packages/components/PackagesTable.tsx +0 -163
- package/monodog-dashboard/src/components/modules/packages/components/RecentCommitsTab.tsx +0 -90
- package/monodog-dashboard/src/components/modules/packages/components/SearchAndFilter.tsx +0 -66
- package/monodog-dashboard/src/components/modules/packages/components/index.ts +0 -12
- package/monodog-dashboard/src/components/modules/packages/types/packages.types.ts +0 -101
- package/monodog-dashboard/src/components/modules/packages/utils/packages.utils.tsx +0 -178
- package/monodog-dashboard/src/components/pipeline/JobsList.tsx +0 -83
- package/monodog-dashboard/src/components/pipeline/LogViewer.tsx +0 -392
- package/monodog-dashboard/src/components/pipeline/PipelineManager.tsx +0 -562
- package/monodog-dashboard/src/components/pipeline/WorkflowRunsList.tsx +0 -272
- package/monodog-dashboard/src/components/pipeline/WorkflowTrigger.tsx +0 -182
- package/monodog-dashboard/src/components/pipeline/utils/pipeline.utils.tsx +0 -11
- package/monodog-dashboard/src/components/publish-control/PublishControl.tsx +0 -229
- package/monodog-dashboard/src/components/publish-control/components/ChangelogViewer.tsx +0 -103
- package/monodog-dashboard/src/components/publish-control/components/ErrorState.tsx +0 -23
- package/monodog-dashboard/src/components/publish-control/components/LoadingState.tsx +0 -10
- package/monodog-dashboard/src/components/publish-control/components/PackageReleaseTable.tsx +0 -140
- package/monodog-dashboard/src/components/publish-control/components/PublishHeader.tsx +0 -30
- package/monodog-dashboard/src/components/publish-control/components/QuickActionCards.tsx +0 -56
- package/monodog-dashboard/src/components/publish-control/components/ReleaseSchedule.tsx +0 -104
- package/monodog-dashboard/src/components/publish-control/components/index.ts +0 -8
- package/monodog-dashboard/src/components/publish-control/types/publish.types.ts +0 -39
- package/monodog-dashboard/src/components/publish-control/utils/publish.utils.ts +0 -59
- package/monodog-dashboard/src/components/release-manager/ReleaseManager.tsx +0 -342
- package/monodog-dashboard/src/components/release-manager/components/ChangesetPreview.tsx +0 -123
- package/monodog-dashboard/src/components/release-manager/components/ErrorState.tsx +0 -38
- package/monodog-dashboard/src/components/release-manager/components/LoadingState.tsx +0 -18
- package/monodog-dashboard/src/components/release-manager/components/PackageSelector.tsx +0 -137
- package/monodog-dashboard/src/components/release-manager/components/PublishConfirmation.tsx +0 -150
- package/monodog-dashboard/src/components/release-manager/components/ReleaseValidation.tsx +0 -138
- package/monodog-dashboard/src/components/release-manager/components/VersionBumpSelector.tsx +0 -142
- package/monodog-dashboard/src/components/release-manager/types/index.ts +0 -9
- package/monodog-dashboard/src/components/release-manager/types/release-manager.types.ts +0 -29
- package/monodog-dashboard/src/components/setup-guide/SetupGuide.tsx +0 -96
- package/monodog-dashboard/src/components/setup-guide/components/SetupHeader.tsx +0 -24
- package/monodog-dashboard/src/components/setup-guide/components/SetupModal.tsx +0 -24
- package/monodog-dashboard/src/components/setup-guide/components/SetupProgress.tsx +0 -29
- package/monodog-dashboard/src/components/setup-guide/components/StepContent.tsx +0 -272
- package/monodog-dashboard/src/components/setup-guide/components/StepNavigation.tsx +0 -62
- package/monodog-dashboard/src/components/setup-guide/components/index.ts +0 -6
- package/monodog-dashboard/src/components/setup-guide/types/setup.types.ts +0 -38
- package/monodog-dashboard/src/components/setup-guide/utils/setup.utils.ts +0 -79
- package/monodog-dashboard/src/constants/api-config.ts +0 -81
- package/monodog-dashboard/src/constants/index.ts +0 -9
- package/monodog-dashboard/src/constants/messages.ts +0 -40
- package/monodog-dashboard/src/icons/heroicons.ts +0 -65
- package/monodog-dashboard/src/icons/index.tsx +0 -1788
- package/monodog-dashboard/src/index.css +0 -175
- package/monodog-dashboard/src/main.tsx +0 -9
- package/monodog-dashboard/src/pages/AuthCallbackPage.tsx +0 -103
- package/monodog-dashboard/src/pages/CIPage.tsx +0 -6
- package/monodog-dashboard/src/pages/ConfigPage.tsx +0 -6
- package/monodog-dashboard/src/pages/DashboardPage.tsx +0 -6
- package/monodog-dashboard/src/pages/DependenciesPage.tsx +0 -6
- package/monodog-dashboard/src/pages/HealthPage.tsx +0 -6
- package/monodog-dashboard/src/pages/LoginPage.tsx +0 -77
- package/monodog-dashboard/src/pages/PackageDetailPage.tsx +0 -6
- package/monodog-dashboard/src/pages/PackagesPage.tsx +0 -6
- package/monodog-dashboard/src/pages/PipelinePage.tsx +0 -22
- package/monodog-dashboard/src/pages/PublishPage.tsx +0 -6
- package/monodog-dashboard/src/pages/ReleaseManagerPage.tsx +0 -9
- package/monodog-dashboard/src/pages/index.ts +0 -28
- package/monodog-dashboard/src/routes/AppRouter.tsx +0 -89
- package/monodog-dashboard/src/routes/AppRouterPages.tsx +0 -56
- package/monodog-dashboard/src/routes/index.ts +0 -10
- package/monodog-dashboard/src/routes/routes.config.ts +0 -94
- package/monodog-dashboard/src/services/api/api-client.ts +0 -189
- package/monodog-dashboard/src/services/api/index.ts +0 -30
- package/monodog-dashboard/src/services/api/types/api.types.ts +0 -63
- package/monodog-dashboard/src/services/auth-context.tsx +0 -344
- package/monodog-dashboard/src/services/monorepoService.ts +0 -733
- package/monodog-dashboard/src/services/permission-context.tsx +0 -193
- package/monodog-dashboard/src/theme/COMPONENT_UPDATES.md +0 -273
- package/monodog-dashboard/src/theme/INTEGRATION.md +0 -381
- package/monodog-dashboard/src/theme/README.md +0 -239
- package/monodog-dashboard/src/theme/examples.tsx +0 -386
- package/monodog-dashboard/src/theme/index.ts +0 -402
- package/monodog-dashboard/src/theme/migration-guide.md +0 -335
- package/monodog-dashboard/src/types/auth-context.types.ts +0 -51
- package/monodog-dashboard/src/types/component.types.ts +0 -96
- package/monodog-dashboard/src/types/icons.types.ts +0 -13
- package/monodog-dashboard/src/types/index.ts +0 -68
- package/monodog-dashboard/src/types/monorepo-service.types.ts +0 -53
- package/monodog-dashboard/src/types/permission-context.types.ts +0 -49
- package/monodog-dashboard/src/types/pipeline.types.ts +0 -89
- package/monodog-dashboard/src/types/routes.types.ts +0 -12
- package/monodog-dashboard/src/utils/cookies.ts +0 -47
- package/monodog-dashboard/tailwind.config.js +0 -68
- package/monodog-dashboard/tsconfig.app.json +0 -14
- package/monodog-dashboard/tsconfig.json +0 -17
- package/monodog-dashboard/tsconfig.node.json +0 -10
- package/monodog-dashboard/vite.config.ts +0 -9
package/monodog-dashboard/src/components/modules/health-status/components/PackageHealthList.tsx
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CheckCircleIcon,
|
|
3
|
-
ExclamationTriangleIcon,
|
|
4
|
-
XCircleIcon,
|
|
5
|
-
ClockIcon,
|
|
6
|
-
BeakerIcon,
|
|
7
|
-
ShieldCheckIcon,
|
|
8
|
-
} from '../../../../icons/heroicons';
|
|
9
|
-
import { CubeIcon } from '../../../../icons/heroicons';
|
|
10
|
-
import { PackageHealthListProps } from '../types/health.types';
|
|
11
|
-
import {
|
|
12
|
-
getStatusColor,
|
|
13
|
-
getHealthScoreColor,
|
|
14
|
-
formatTimeAgo,
|
|
15
|
-
} from '../utils/health.utils';
|
|
16
|
-
|
|
17
|
-
export default function PackageHealthList({
|
|
18
|
-
packages,
|
|
19
|
-
onPackageSelect,
|
|
20
|
-
}: PackageHealthListProps) {
|
|
21
|
-
const getStatusIcon = (status: string) => {
|
|
22
|
-
switch (status) {
|
|
23
|
-
case 'success':
|
|
24
|
-
case 'pass':
|
|
25
|
-
case 'up-to-date':
|
|
26
|
-
return <CheckCircleIcon className="h-5 w-5 text-green-500" />;
|
|
27
|
-
case 'warn':
|
|
28
|
-
case 'outdated':
|
|
29
|
-
return <ExclamationTriangleIcon className="h-5 w-5 text-yellow-500" />;
|
|
30
|
-
case 'failed':
|
|
31
|
-
case 'fail':
|
|
32
|
-
case 'vulnerable':
|
|
33
|
-
return <XCircleIcon className="h-5 w-5 text-red-500" />;
|
|
34
|
-
case 'building':
|
|
35
|
-
return (
|
|
36
|
-
<div className="h-5 w-5 animate-spin rounded-full border-2 border-blue-500 border-t-transparent" />
|
|
37
|
-
);
|
|
38
|
-
default:
|
|
39
|
-
return <ClockIcon className="h-5 w-5 text-gray-500" />;
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const getBuildStatusColor = (status: string) => {
|
|
44
|
-
switch (status) {
|
|
45
|
-
case 'success':
|
|
46
|
-
return 'bg-green-100 text-green-800';
|
|
47
|
-
case 'failed':
|
|
48
|
-
return 'bg-red-100 text-red-800';
|
|
49
|
-
case 'building':
|
|
50
|
-
return 'bg-blue-100 text-blue-800';
|
|
51
|
-
default:
|
|
52
|
-
return 'bg-gray-100 text-gray-800';
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<div className="space-y-4">
|
|
58
|
-
<h3 className="text-lg font-medium text-gray-900">
|
|
59
|
-
Package Health Overview
|
|
60
|
-
</h3>
|
|
61
|
-
|
|
62
|
-
<div className="bg-white rounded-lg shadow border overflow-hidden">
|
|
63
|
-
<div className="overflow-x-auto">
|
|
64
|
-
<table className="w-full">
|
|
65
|
-
<thead className="bg-gray-50">
|
|
66
|
-
<tr>
|
|
67
|
-
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
68
|
-
Package
|
|
69
|
-
</th>
|
|
70
|
-
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
71
|
-
Health Score
|
|
72
|
-
</th>
|
|
73
|
-
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
74
|
-
Build Status
|
|
75
|
-
</th>
|
|
76
|
-
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
77
|
-
Test Coverage
|
|
78
|
-
</th>
|
|
79
|
-
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
80
|
-
Security
|
|
81
|
-
</th>
|
|
82
|
-
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
83
|
-
Dependencies
|
|
84
|
-
</th>
|
|
85
|
-
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
86
|
-
Last Build
|
|
87
|
-
</th>
|
|
88
|
-
</tr>
|
|
89
|
-
</thead>
|
|
90
|
-
<tbody className="bg-white divide-y divide-gray-200">
|
|
91
|
-
{packages.map(pkg => (
|
|
92
|
-
<tr
|
|
93
|
-
key={pkg.name}
|
|
94
|
-
className="hover:bg-gray-50 cursor-pointer"
|
|
95
|
-
onClick={() => onPackageSelect?.(pkg.name)}
|
|
96
|
-
>
|
|
97
|
-
<td className="px-6 py-4 whitespace-nowrap">
|
|
98
|
-
<div className="flex items-center">
|
|
99
|
-
<div className="text-2xl mr-3"><CubeIcon className="w-6 h-6 text-primary-600" /></div>
|
|
100
|
-
<div>
|
|
101
|
-
<div className="text-sm font-medium text-gray-900">
|
|
102
|
-
{pkg.name}
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
</td>
|
|
107
|
-
|
|
108
|
-
<td className="px-6 py-4 whitespace-nowrap">
|
|
109
|
-
<div className="flex items-center space-x-2">
|
|
110
|
-
<div
|
|
111
|
-
className={`text-lg font-semibold ${getHealthScoreColor(pkg.overallScore)}`}
|
|
112
|
-
>
|
|
113
|
-
{pkg.overallScore}%
|
|
114
|
-
</div>
|
|
115
|
-
<div className="w-16 bg-gray-200 rounded-full h-2">
|
|
116
|
-
<div
|
|
117
|
-
className={`h-2 rounded-full ${
|
|
118
|
-
pkg.overallScore >= 90
|
|
119
|
-
? 'bg-green-500'
|
|
120
|
-
: pkg.overallScore >= 80
|
|
121
|
-
? 'bg-yellow-500'
|
|
122
|
-
: 'bg-red-500'
|
|
123
|
-
}`}
|
|
124
|
-
style={{ width: `${pkg.overallScore}%` }}
|
|
125
|
-
/>
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
</td>
|
|
129
|
-
|
|
130
|
-
<td className="px-6 py-4 whitespace-nowrap">
|
|
131
|
-
<div className="flex items-center space-x-2">
|
|
132
|
-
{getStatusIcon(pkg.buildStatus)}
|
|
133
|
-
<span
|
|
134
|
-
className={`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${getBuildStatusColor(pkg.buildStatus)}`}
|
|
135
|
-
>
|
|
136
|
-
{pkg.buildStatus}
|
|
137
|
-
</span>
|
|
138
|
-
</div>
|
|
139
|
-
</td>
|
|
140
|
-
|
|
141
|
-
<td className="px-6 py-4 whitespace-nowrap">
|
|
142
|
-
<div className="flex items-center space-x-2">
|
|
143
|
-
<BeakerIcon className="h-4 w-4 text-gray-400" />
|
|
144
|
-
<span
|
|
145
|
-
className={`text-sm font-medium ${
|
|
146
|
-
pkg.testCoverage >= 80
|
|
147
|
-
? 'text-green-600'
|
|
148
|
-
: pkg.testCoverage >= 60
|
|
149
|
-
? 'text-yellow-600'
|
|
150
|
-
: 'text-red-600'
|
|
151
|
-
}`}
|
|
152
|
-
>
|
|
153
|
-
{pkg.testCoverage}%
|
|
154
|
-
</span>
|
|
155
|
-
</div>
|
|
156
|
-
</td>
|
|
157
|
-
|
|
158
|
-
<td className="px-6 py-4 whitespace-nowrap">
|
|
159
|
-
<div className="flex items-center space-x-2">
|
|
160
|
-
<ShieldCheckIcon className="h-4 w-4 text-gray-400" />
|
|
161
|
-
<span
|
|
162
|
-
className={`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${getStatusColor(pkg.securityAudit)}`}
|
|
163
|
-
>
|
|
164
|
-
{pkg.securityAudit}
|
|
165
|
-
</span>
|
|
166
|
-
</div>
|
|
167
|
-
</td>
|
|
168
|
-
|
|
169
|
-
<td className="px-6 py-4 whitespace-nowrap">
|
|
170
|
-
<span
|
|
171
|
-
className={`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${getStatusColor(pkg.dependencies)}`}
|
|
172
|
-
>
|
|
173
|
-
{pkg.dependencies}
|
|
174
|
-
</span>
|
|
175
|
-
</td>
|
|
176
|
-
|
|
177
|
-
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
|
178
|
-
{formatTimeAgo(pkg.lastBuild)}
|
|
179
|
-
</td>
|
|
180
|
-
</tr>
|
|
181
|
-
))}
|
|
182
|
-
</tbody>
|
|
183
|
-
</table>
|
|
184
|
-
</div>
|
|
185
|
-
</div>
|
|
186
|
-
|
|
187
|
-
{packages.length === 0 && (
|
|
188
|
-
<div className="text-center py-8">
|
|
189
|
-
<div className="text-gray-400 text-4xl mb-2"><CubeIcon className="w-6 h-6 text-primary-600" /></div>
|
|
190
|
-
<p className="text-gray-500">No package health data available</p>
|
|
191
|
-
</div>
|
|
192
|
-
)}
|
|
193
|
-
</div>
|
|
194
|
-
);
|
|
195
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// Shared types for health status module components
|
|
2
|
-
|
|
3
|
-
export interface HealthMetric {
|
|
4
|
-
name: string;
|
|
5
|
-
value: number;
|
|
6
|
-
unit: string;
|
|
7
|
-
status: 'healthy' | 'warning' | 'error';
|
|
8
|
-
trend: 'up' | 'down' | 'stable';
|
|
9
|
-
lastUpdated: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface PackageHealth {
|
|
13
|
-
name: string;
|
|
14
|
-
packageOverallScore: number;
|
|
15
|
-
buildStatus: 'success' | 'failed' | 'building' | 'unknown';
|
|
16
|
-
testCoverage: number;
|
|
17
|
-
lintStatus: 'pass' | 'warn' | 'fail';
|
|
18
|
-
securityAudit: 'pass' | 'warn' | 'fail';
|
|
19
|
-
dependencies: 'up-to-date' | 'outdated' | 'vulnerable';
|
|
20
|
-
lastBuild: string;
|
|
21
|
-
lastTest: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface HealthData {
|
|
25
|
-
overallScore: number;
|
|
26
|
-
metrics: HealthMetric[];
|
|
27
|
-
packageHealth: PackageHealth[];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface HealthAlert {
|
|
31
|
-
id: string;
|
|
32
|
-
type: 'error' | 'warning' | 'info';
|
|
33
|
-
title: string;
|
|
34
|
-
message: string;
|
|
35
|
-
packageName?: string;
|
|
36
|
-
timestamp: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface HealthTrend {
|
|
40
|
-
metric: string;
|
|
41
|
-
data: Array<{ date: string; value: number }>;
|
|
42
|
-
change: number;
|
|
43
|
-
changeType: 'positive' | 'negative' | 'neutral';
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface HealthStatusProps {
|
|
47
|
-
selectedMetric: string;
|
|
48
|
-
onMetricSelect: (metric: string) => void;
|
|
49
|
-
onRefresh: () => void;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface OverallHealthProps {
|
|
53
|
-
score: number;
|
|
54
|
-
trend: 'up' | 'down' | 'stable';
|
|
55
|
-
loading?: boolean;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface HealthMetricsProps {
|
|
59
|
-
metrics: HealthMetric[];
|
|
60
|
-
selectedMetric: string;
|
|
61
|
-
onMetricSelect: (metric: string) => void;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface PackageHealthListProps {
|
|
65
|
-
packages: PackageHealth[];
|
|
66
|
-
onPackageSelect?: (packageName: string) => void;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface HealthAlertsProps {
|
|
70
|
-
alerts: HealthAlert[];
|
|
71
|
-
onAlertDismiss?: (alertId: string) => void;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface HealthActionsProps {
|
|
75
|
-
onRefresh: () => void;
|
|
76
|
-
onRunAllTests?: () => void;
|
|
77
|
-
onRunSecurityAudit?: () => void;
|
|
78
|
-
onUpdateDependencies?: () => void;
|
|
79
|
-
loading?: boolean;
|
|
80
|
-
}
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
HealthMetric,
|
|
3
|
-
PackageHealth,
|
|
4
|
-
HealthAlert,
|
|
5
|
-
HealthTrend,
|
|
6
|
-
} from '../types/health.types';
|
|
7
|
-
import { CubeIcon } from '../../../../icons/heroicons';
|
|
8
|
-
// Get status color classes
|
|
9
|
-
export const getStatusColor = (status: string): string => {
|
|
10
|
-
switch (status) {
|
|
11
|
-
case 'healthy':
|
|
12
|
-
case 'success':
|
|
13
|
-
case 'pass':
|
|
14
|
-
case 'up-to-date':
|
|
15
|
-
return 'bg-green-100 text-green-800';
|
|
16
|
-
case 'warning':
|
|
17
|
-
case 'warn':
|
|
18
|
-
case 'outdated':
|
|
19
|
-
return 'bg-yellow-100 text-yellow-800';
|
|
20
|
-
case 'error':
|
|
21
|
-
case 'failed':
|
|
22
|
-
case 'fail':
|
|
23
|
-
case 'vulnerable':
|
|
24
|
-
return 'bg-red-100 text-red-800';
|
|
25
|
-
default:
|
|
26
|
-
return 'bg-gray-100 text-gray-800';
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
// Get health score color
|
|
31
|
-
export const getHealthScoreColor = (score: number): string => {
|
|
32
|
-
if (score >= 90) return 'text-green-600';
|
|
33
|
-
if (score >= 70) return 'text-yellow-600';
|
|
34
|
-
return 'text-red-600';
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// Get health score background color
|
|
38
|
-
export const getHealthScoreBgColor = (score: number): string => {
|
|
39
|
-
if (score >= 90) return 'bg-green-100';
|
|
40
|
-
if (score >= 70) return 'bg-yellow-100';
|
|
41
|
-
return 'bg-red-100';
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
// Calculate overall health from metrics
|
|
45
|
-
export const calculateOverallHealth = (metrics: HealthMetric[]): number => {
|
|
46
|
-
if (metrics.length === 0) return 0;
|
|
47
|
-
|
|
48
|
-
const totalScore = metrics.reduce((sum, metric) => {
|
|
49
|
-
// Convert percentage values to score (0-100)
|
|
50
|
-
let score = metric.value;
|
|
51
|
-
if (metric.unit === '%') {
|
|
52
|
-
score = metric.value;
|
|
53
|
-
} else if (metric.unit === '/100') {
|
|
54
|
-
score = metric.value;
|
|
55
|
-
}
|
|
56
|
-
return sum + score;
|
|
57
|
-
}, 0);
|
|
58
|
-
|
|
59
|
-
return Math.round(totalScore / metrics.length);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
// Get trending metrics
|
|
63
|
-
export const getTrendingMetrics = (
|
|
64
|
-
metrics: HealthMetric[]
|
|
65
|
-
): { improving: number; declining: number; stable: number } => {
|
|
66
|
-
const trends = metrics.reduce(
|
|
67
|
-
(acc, metric) => {
|
|
68
|
-
if (metric.trend === 'up') acc.improving++;
|
|
69
|
-
else if (metric.trend === 'down') acc.declining++;
|
|
70
|
-
else acc.stable++;
|
|
71
|
-
return acc;
|
|
72
|
-
},
|
|
73
|
-
{ improving: 0, declining: 0, stable: 0 }
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
return trends;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// Filter packages by health status
|
|
80
|
-
export const filterPackagesByHealth = (
|
|
81
|
-
packages: PackageHealth[],
|
|
82
|
-
threshold: number = 80
|
|
83
|
-
): {
|
|
84
|
-
healthy: PackageHealth[];
|
|
85
|
-
needsAttention: PackageHealth[];
|
|
86
|
-
critical: PackageHealth[];
|
|
87
|
-
} => {
|
|
88
|
-
return packages.reduce(
|
|
89
|
-
(acc, pkg) => {
|
|
90
|
-
if (pkg.overallScore >= 90) {
|
|
91
|
-
acc.healthy.push(pkg);
|
|
92
|
-
} else if (pkg.overallScore >= threshold) {
|
|
93
|
-
acc.needsAttention.push(pkg);
|
|
94
|
-
} else {
|
|
95
|
-
acc.critical.push(pkg);
|
|
96
|
-
}
|
|
97
|
-
return acc;
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
healthy: [] as PackageHealth[],
|
|
101
|
-
needsAttention: [] as PackageHealth[],
|
|
102
|
-
critical: [] as PackageHealth[],
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
// Generate health alerts from package data
|
|
108
|
-
export const generateHealthAlerts = (
|
|
109
|
-
packages: PackageHealth[]
|
|
110
|
-
): HealthAlert[] => {
|
|
111
|
-
const alerts: HealthAlert[] = [];
|
|
112
|
-
|
|
113
|
-
packages.forEach(pkg => {
|
|
114
|
-
// Build failures
|
|
115
|
-
if (pkg.buildStatus === 'failed') {
|
|
116
|
-
alerts.push({
|
|
117
|
-
id: `build-${pkg.name}`,
|
|
118
|
-
type: 'error',
|
|
119
|
-
title: 'Build Failed',
|
|
120
|
-
message: `Build failed for package ${pkg.name}`,
|
|
121
|
-
packageName: pkg.name,
|
|
122
|
-
timestamp: pkg.lastBuild,
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// Low test coverage
|
|
127
|
-
if (pkg.testCoverage < 70) {
|
|
128
|
-
alerts.push({
|
|
129
|
-
id: `coverage-${pkg.name}`,
|
|
130
|
-
type: 'warning',
|
|
131
|
-
title: 'Low Test Coverage',
|
|
132
|
-
message: `Test coverage is ${pkg.testCoverage}% for package ${pkg.name}`,
|
|
133
|
-
packageName: pkg.name,
|
|
134
|
-
timestamp: pkg.lastTest,
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// Security issues
|
|
139
|
-
if (pkg.securityAudit === 'fail') {
|
|
140
|
-
alerts.push({
|
|
141
|
-
id: `security-${pkg.name}`,
|
|
142
|
-
type: 'error',
|
|
143
|
-
title: 'Security Issues',
|
|
144
|
-
message: `Security audit failed for package ${pkg.name}`,
|
|
145
|
-
packageName: pkg.name,
|
|
146
|
-
timestamp: new Date().toISOString(),
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// Vulnerable dependencies
|
|
151
|
-
if (pkg.dependencies === 'vulnerable') {
|
|
152
|
-
alerts.push({
|
|
153
|
-
id: `deps-${pkg.name}`,
|
|
154
|
-
type: 'error',
|
|
155
|
-
title: 'Vulnerable Dependencies',
|
|
156
|
-
message: `Package ${pkg.name} has vulnerable dependencies`,
|
|
157
|
-
packageName: pkg.name,
|
|
158
|
-
timestamp: new Date().toISOString(),
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// Low overall score
|
|
163
|
-
if (pkg.overallScore < 60) {
|
|
164
|
-
alerts.push({
|
|
165
|
-
id: `score-${pkg.name}`,
|
|
166
|
-
type: 'warning',
|
|
167
|
-
title: 'Low Health Score',
|
|
168
|
-
message: `Package ${pkg.name} has a low health score of ${pkg.overallScore}%`,
|
|
169
|
-
packageName: pkg.name,
|
|
170
|
-
timestamp: new Date().toISOString(),
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
return alerts.sort(
|
|
176
|
-
(a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()
|
|
177
|
-
);
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
// Format time ago
|
|
181
|
-
export const formatTimeAgo = (dateString: string): string => {
|
|
182
|
-
const date = new Date(dateString);
|
|
183
|
-
const now = new Date();
|
|
184
|
-
const diffInMs = now.getTime() - date.getTime();
|
|
185
|
-
const diffInMinutes = Math.floor(diffInMs / (1000 * 60));
|
|
186
|
-
const diffInHours = Math.floor(diffInMinutes / 60);
|
|
187
|
-
const diffInDays = Math.floor(diffInHours / 24);
|
|
188
|
-
|
|
189
|
-
if (diffInMinutes < 60) {
|
|
190
|
-
return `${diffInMinutes} min ago`;
|
|
191
|
-
} else if (diffInHours < 24) {
|
|
192
|
-
return `${diffInHours} hour${diffInHours > 1 ? 's' : ''} ago`;
|
|
193
|
-
} else {
|
|
194
|
-
return `${diffInDays} day${diffInDays > 1 ? 's' : ''} ago`;
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
// Get metric icon
|
|
199
|
-
export const getMetricIcon = (metricName: string): string => {
|
|
200
|
-
const name = metricName.toLowerCase();
|
|
201
|
-
if (name.includes('build')) return '๐๏ธ';
|
|
202
|
-
if (name.includes('test') || name.includes('coverage')) return '๐งช';
|
|
203
|
-
if (name.includes('lint')) return 'โจ';
|
|
204
|
-
if (name.includes('security')) return '๐';
|
|
205
|
-
if (name.includes('dependency') || name.includes('dependencies')) return <CubeIcon className="w-6 h-6 text-primary-600" />;
|
|
206
|
-
if (name.includes('performance')) return 'โก';
|
|
207
|
-
return '๐';
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
// Sort packages by health score
|
|
211
|
-
export const sortPackagesByHealth = (
|
|
212
|
-
packages: PackageHealth[],
|
|
213
|
-
ascending: boolean = false
|
|
214
|
-
): PackageHealth[] => {
|
|
215
|
-
return [...packages].sort((a, b) => {
|
|
216
|
-
return ascending
|
|
217
|
-
? a.overallScore - b.overallScore
|
|
218
|
-
: b.overallScore - a.overallScore;
|
|
219
|
-
});
|
|
220
|
-
};
|