@manojkmfsi/monodog 1.1.35 → 1.1.37
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/THEME_SYSTEM.md +309 -0
- package/monodog-dashboard/__tests__/AuthCallbackPage.test.ts +138 -0
- package/monodog-dashboard/__tests__/ConfigInspector.test.ts +33 -0
- package/monodog-dashboard/__tests__/DependencyGraph.test.ts +72 -0
- package/monodog-dashboard/__tests__/HealthStatus.test.ts +69 -0
- package/monodog-dashboard/__tests__/LoginPage.test.ts +79 -0
- package/monodog-dashboard/__tests__/PackageDetail.test.ts +22 -0
- package/monodog-dashboard/__tests__/ReleaseManager.test.tsx +510 -0
- package/monodog-dashboard/__tests__/api-client.test.ts +475 -0
- package/monodog-dashboard/__tests__/components.test.ts +117 -0
- package/monodog-dashboard/__tests__/dashboard.utils.test.ts +144 -0
- package/monodog-dashboard/__tests__/dependency.utils.test.ts +125 -0
- package/monodog-dashboard/__tests__/monorepoService.unit.test.ts +103 -0
- package/monodog-dashboard/__tests__/packages.utils.test.ts +37 -0
- package/monodog-dashboard/__tests__/pages.test.ts +103 -0
- package/monodog-dashboard/index.html +13 -0
- package/monodog-dashboard/package-lock.json +4587 -0
- package/monodog-dashboard/package.json +3 -0
- package/monodog-dashboard/postcss.config.js +6 -0
- package/monodog-dashboard/src/components/App.tsx +36 -0
- package/monodog-dashboard/src/components/LoadingState.tsx +18 -0
- package/monodog-dashboard/src/components/PermissionGuard.tsx +92 -0
- package/monodog-dashboard/src/components/ProtectedRoute.tsx +24 -0
- package/monodog-dashboard/src/components/configuration/Configuration.tsx +91 -0
- package/monodog-dashboard/src/components/configuration/components/BrandingSettings.tsx +128 -0
- package/monodog-dashboard/src/components/configuration/components/ConfigurationHeader.tsx +34 -0
- package/monodog-dashboard/src/components/configuration/components/ConfigurationModal.tsx +20 -0
- package/monodog-dashboard/src/components/configuration/components/ConfigurationTabs.tsx +30 -0
- package/monodog-dashboard/src/components/configuration/components/FeatureToggles.tsx +66 -0
- package/monodog-dashboard/src/components/configuration/components/GeneralSettings.tsx +77 -0
- package/monodog-dashboard/src/components/configuration/components/MonorepoSettings.tsx +179 -0
- package/monodog-dashboard/src/components/configuration/components/index.ts +8 -0
- package/monodog-dashboard/src/components/configuration/types/config.types.ts +52 -0
- package/monodog-dashboard/src/components/configuration/utils/config.utils.tsx +115 -0
- package/monodog-dashboard/src/components/main-dashboard/Dashboard.tsx +242 -0
- package/monodog-dashboard/src/components/main-dashboard/Layout.tsx +112 -0
- package/monodog-dashboard/src/components/main-dashboard/components/Header.tsx +47 -0
- package/monodog-dashboard/src/components/main-dashboard/components/PackageDistribution.tsx +35 -0
- package/monodog-dashboard/src/components/main-dashboard/components/PackageSearchFilter.tsx +47 -0
- package/monodog-dashboard/src/components/main-dashboard/components/PackageTable.tsx +87 -0
- package/monodog-dashboard/src/components/main-dashboard/components/QuickActions.tsx +60 -0
- package/monodog-dashboard/src/components/main-dashboard/components/StatsCards.tsx +73 -0
- package/monodog-dashboard/src/components/main-dashboard/components/index.ts +7 -0
- package/monodog-dashboard/src/components/main-dashboard/types/dashboard.types.ts +33 -0
- package/monodog-dashboard/src/components/main-dashboard/utils/dashboard.utils.tsx +70 -0
- package/monodog-dashboard/src/components/modules/ci-integration/CIIntegration.tsx +277 -0
- package/monodog-dashboard/src/components/modules/ci-integration/components/BuildDetails.tsx +228 -0
- package/monodog-dashboard/src/components/modules/ci-integration/components/BuildList.tsx +212 -0
- package/monodog-dashboard/src/components/modules/ci-integration/components/BuildOverview.tsx +158 -0
- package/monodog-dashboard/src/components/modules/ci-integration/components/CIIntegrationHeader.tsx +38 -0
- package/monodog-dashboard/src/components/modules/ci-integration/components/ErrorState.tsx +25 -0
- package/monodog-dashboard/src/components/modules/ci-integration/components/LoadingState.tsx +16 -0
- package/monodog-dashboard/src/components/modules/ci-integration/components/PipelineStatus.tsx +223 -0
- package/monodog-dashboard/src/components/modules/ci-integration/components/index.ts +8 -0
- package/monodog-dashboard/src/components/modules/ci-integration/types/ci.types.ts +97 -0
- package/monodog-dashboard/src/components/modules/ci-integration/utils/ci.utils.tsx +264 -0
- package/monodog-dashboard/src/components/modules/config-inspector/ConfigInspector.tsx +324 -0
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigEditor.tsx +93 -0
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigInspectorHeader.tsx +36 -0
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigPreview.tsx +89 -0
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigSidebar.tsx +141 -0
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigToolbar.tsx +184 -0
- package/monodog-dashboard/src/components/modules/config-inspector/components/ErrorState.tsx +25 -0
- package/monodog-dashboard/src/components/modules/config-inspector/components/LoadingState.tsx +16 -0
- package/monodog-dashboard/src/components/modules/config-inspector/components/ValidationPanel.tsx +155 -0
- package/monodog-dashboard/src/components/modules/config-inspector/components/index.ts +9 -0
- package/monodog-dashboard/src/components/modules/config-inspector/types/config.types.ts +100 -0
- package/monodog-dashboard/src/components/modules/config-inspector/utils/config.utils.tsx +704 -0
- package/monodog-dashboard/src/components/modules/dependency-graph/DependencyGraph.tsx +224 -0
- package/monodog-dashboard/src/components/modules/dependency-graph/components/CircularDependencies.tsx +177 -0
- package/monodog-dashboard/src/components/modules/dependency-graph/components/DependencyDetails.tsx +192 -0
- package/monodog-dashboard/src/components/modules/dependency-graph/components/DependencyGraphHeader.tsx +30 -0
- package/monodog-dashboard/src/components/modules/dependency-graph/components/DependencyList.tsx +177 -0
- package/monodog-dashboard/src/components/modules/dependency-graph/components/ErrorState.tsx +25 -0
- package/monodog-dashboard/src/components/modules/dependency-graph/components/GraphLegend.tsx +89 -0
- package/monodog-dashboard/src/components/modules/dependency-graph/components/GraphStats.tsx +141 -0
- package/monodog-dashboard/src/components/modules/dependency-graph/components/GraphToolbar.tsx +107 -0
- package/monodog-dashboard/src/components/modules/dependency-graph/components/GraphVisualization.tsx +179 -0
- package/monodog-dashboard/src/components/modules/dependency-graph/components/LoadingState.tsx +16 -0
- package/monodog-dashboard/src/components/modules/dependency-graph/components/index.ts +11 -0
- package/monodog-dashboard/src/components/modules/dependency-graph/types/dependency.types.ts +105 -0
- package/monodog-dashboard/src/components/modules/dependency-graph/utils/dependency.utils.tsx +433 -0
- package/monodog-dashboard/src/components/modules/health-status/HealthStatus.tsx +739 -0
- package/monodog-dashboard/src/components/modules/health-status/components/ErrorState.tsx +25 -0
- package/monodog-dashboard/src/components/modules/health-status/components/HealthActions.tsx +122 -0
- package/monodog-dashboard/src/components/modules/health-status/components/HealthAlerts.tsx +151 -0
- package/monodog-dashboard/src/components/modules/health-status/components/HealthMetrics.tsx +132 -0
- package/monodog-dashboard/src/components/modules/health-status/components/HealthStatusHeader.tsx +30 -0
- package/monodog-dashboard/src/components/modules/health-status/components/LoadingState.tsx +16 -0
- package/monodog-dashboard/src/components/modules/health-status/components/OverallHealthScore.tsx +122 -0
- package/monodog-dashboard/src/components/modules/health-status/components/PackageHealthList.tsx +195 -0
- package/monodog-dashboard/src/components/modules/health-status/types/health.types.ts +80 -0
- package/monodog-dashboard/src/components/modules/health-status/utils/health.utils.tsx +220 -0
- package/monodog-dashboard/src/components/modules/packages/PackageDetail.tsx +255 -0
- package/monodog-dashboard/src/components/modules/packages/PackagesOverview.tsx +166 -0
- package/monodog-dashboard/src/components/modules/packages/components/ConfigurationTab.tsx +311 -0
- package/monodog-dashboard/src/components/modules/packages/components/DependenciesTab.tsx +154 -0
- package/monodog-dashboard/src/components/modules/packages/components/ErrorState.tsx +21 -0
- package/monodog-dashboard/src/components/modules/packages/components/HealthMetricsTab.tsx +275 -0
- package/monodog-dashboard/src/components/modules/packages/components/LoadingState.tsx +14 -0
- package/monodog-dashboard/src/components/modules/packages/components/PackageDetailHeader.tsx +167 -0
- package/monodog-dashboard/src/components/modules/packages/components/PackageDetailTabs.tsx +49 -0
- package/monodog-dashboard/src/components/modules/packages/components/PackageStats.tsx +70 -0
- package/monodog-dashboard/src/components/modules/packages/components/PackagesTable.tsx +163 -0
- package/monodog-dashboard/src/components/modules/packages/components/RecentCommitsTab.tsx +90 -0
- package/monodog-dashboard/src/components/modules/packages/components/SearchAndFilter.tsx +66 -0
- package/monodog-dashboard/src/components/modules/packages/components/index.ts +12 -0
- package/monodog-dashboard/src/components/modules/packages/types/packages.types.ts +101 -0
- package/monodog-dashboard/src/components/modules/packages/utils/packages.utils.tsx +178 -0
- package/monodog-dashboard/src/components/pipeline/JobsList.tsx +83 -0
- package/monodog-dashboard/src/components/pipeline/LogViewer.tsx +392 -0
- package/monodog-dashboard/src/components/pipeline/PipelineManager.tsx +562 -0
- package/monodog-dashboard/src/components/pipeline/WorkflowRunsList.tsx +272 -0
- package/monodog-dashboard/src/components/pipeline/WorkflowTrigger.tsx +182 -0
- package/monodog-dashboard/src/components/pipeline/utils/pipeline.utils.tsx +11 -0
- package/monodog-dashboard/src/components/publish-control/PublishControl.tsx +229 -0
- package/monodog-dashboard/src/components/publish-control/components/ChangelogViewer.tsx +103 -0
- package/monodog-dashboard/src/components/publish-control/components/ErrorState.tsx +23 -0
- package/monodog-dashboard/src/components/publish-control/components/LoadingState.tsx +10 -0
- package/monodog-dashboard/src/components/publish-control/components/PackageReleaseTable.tsx +140 -0
- package/monodog-dashboard/src/components/publish-control/components/PublishHeader.tsx +30 -0
- package/monodog-dashboard/src/components/publish-control/components/QuickActionCards.tsx +56 -0
- package/monodog-dashboard/src/components/publish-control/components/ReleaseSchedule.tsx +104 -0
- package/monodog-dashboard/src/components/publish-control/components/index.ts +8 -0
- package/monodog-dashboard/src/components/publish-control/types/publish.types.ts +39 -0
- package/monodog-dashboard/src/components/publish-control/utils/publish.utils.ts +59 -0
- package/monodog-dashboard/src/components/release-manager/ReleaseManager.tsx +342 -0
- package/monodog-dashboard/src/components/release-manager/components/ChangesetPreview.tsx +123 -0
- package/monodog-dashboard/src/components/release-manager/components/ErrorState.tsx +38 -0
- package/monodog-dashboard/src/components/release-manager/components/LoadingState.tsx +18 -0
- package/monodog-dashboard/src/components/release-manager/components/PackageSelector.tsx +137 -0
- package/monodog-dashboard/src/components/release-manager/components/PublishConfirmation.tsx +150 -0
- package/monodog-dashboard/src/components/release-manager/components/ReleaseValidation.tsx +138 -0
- package/monodog-dashboard/src/components/release-manager/components/VersionBumpSelector.tsx +142 -0
- package/monodog-dashboard/src/components/release-manager/types/index.ts +9 -0
- package/monodog-dashboard/src/components/release-manager/types/release-manager.types.ts +29 -0
- package/monodog-dashboard/src/components/setup-guide/SetupGuide.tsx +96 -0
- package/monodog-dashboard/src/components/setup-guide/components/SetupHeader.tsx +24 -0
- package/monodog-dashboard/src/components/setup-guide/components/SetupModal.tsx +24 -0
- package/monodog-dashboard/src/components/setup-guide/components/SetupProgress.tsx +29 -0
- package/monodog-dashboard/src/components/setup-guide/components/StepContent.tsx +272 -0
- package/monodog-dashboard/src/components/setup-guide/components/StepNavigation.tsx +62 -0
- package/monodog-dashboard/src/components/setup-guide/components/index.ts +6 -0
- package/monodog-dashboard/src/components/setup-guide/types/setup.types.ts +38 -0
- package/monodog-dashboard/src/components/setup-guide/utils/setup.utils.ts +79 -0
- package/monodog-dashboard/src/constants/api-config.ts +81 -0
- package/monodog-dashboard/src/constants/index.ts +9 -0
- package/monodog-dashboard/src/constants/messages.ts +40 -0
- package/monodog-dashboard/src/icons/heroicons.ts +65 -0
- package/monodog-dashboard/src/icons/index.tsx +1788 -0
- package/monodog-dashboard/src/index.css +175 -0
- package/monodog-dashboard/src/main.tsx +9 -0
- package/monodog-dashboard/src/pages/AuthCallbackPage.tsx +103 -0
- package/monodog-dashboard/src/pages/CIPage.tsx +6 -0
- package/monodog-dashboard/src/pages/ConfigPage.tsx +6 -0
- package/monodog-dashboard/src/pages/DashboardPage.tsx +6 -0
- package/monodog-dashboard/src/pages/DependenciesPage.tsx +6 -0
- package/monodog-dashboard/src/pages/HealthPage.tsx +6 -0
- package/monodog-dashboard/src/pages/LoginPage.tsx +77 -0
- package/monodog-dashboard/src/pages/PackageDetailPage.tsx +6 -0
- package/monodog-dashboard/src/pages/PackagesPage.tsx +6 -0
- package/monodog-dashboard/src/pages/PipelinePage.tsx +22 -0
- package/monodog-dashboard/src/pages/PublishPage.tsx +6 -0
- package/monodog-dashboard/src/pages/ReleaseManagerPage.tsx +9 -0
- package/monodog-dashboard/src/pages/index.ts +28 -0
- package/monodog-dashboard/src/routes/AppRouter.tsx +89 -0
- package/monodog-dashboard/src/routes/AppRouterPages.tsx +56 -0
- package/monodog-dashboard/src/routes/index.ts +10 -0
- package/monodog-dashboard/src/routes/routes.config.ts +94 -0
- package/monodog-dashboard/src/services/api/api-client.ts +189 -0
- package/monodog-dashboard/src/services/api/index.ts +30 -0
- package/monodog-dashboard/src/services/api/types/api.types.ts +63 -0
- package/monodog-dashboard/src/services/auth-context.tsx +344 -0
- package/monodog-dashboard/src/services/monorepoService.ts +733 -0
- package/monodog-dashboard/src/services/permission-context.tsx +193 -0
- package/monodog-dashboard/src/theme/COMPONENT_UPDATES.md +273 -0
- package/monodog-dashboard/src/theme/INTEGRATION.md +381 -0
- package/monodog-dashboard/src/theme/README.md +239 -0
- package/monodog-dashboard/src/theme/examples.tsx +386 -0
- package/monodog-dashboard/src/theme/index.ts +402 -0
- package/monodog-dashboard/src/theme/migration-guide.md +335 -0
- package/monodog-dashboard/src/types/auth-context.types.ts +51 -0
- package/monodog-dashboard/src/types/component.types.ts +96 -0
- package/monodog-dashboard/src/types/icons.types.ts +13 -0
- package/monodog-dashboard/src/types/index.ts +68 -0
- package/monodog-dashboard/src/types/monorepo-service.types.ts +53 -0
- package/monodog-dashboard/src/types/permission-context.types.ts +49 -0
- package/monodog-dashboard/src/types/pipeline.types.ts +89 -0
- package/monodog-dashboard/src/types/routes.types.ts +12 -0
- package/monodog-dashboard/src/utils/cookies.ts +47 -0
- package/monodog-dashboard/tailwind.config.js +68 -0
- package/monodog-dashboard/tsconfig.app.json +14 -0
- package/monodog-dashboard/tsconfig.json +17 -0
- package/monodog-dashboard/tsconfig.node.json +10 -0
- package/monodog-dashboard/vite.config.ts +9 -0
- package/package.json +2 -2
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { SettingsComponentProps } from '../types/config.types';
|
|
2
|
+
import { stringToArray, arrayToString } from '../utils/config.utils';
|
|
3
|
+
|
|
4
|
+
export default function MonorepoSettings({
|
|
5
|
+
config,
|
|
6
|
+
onConfigChange,
|
|
7
|
+
}: SettingsComponentProps) {
|
|
8
|
+
const handleMonorepoChange = (field: string, value: any) => {
|
|
9
|
+
onConfigChange({
|
|
10
|
+
monorepo: { ...config.monorepo, [field]: value },
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div className="space-y-6">
|
|
16
|
+
<div>
|
|
17
|
+
<h3 className="text-lg font-medium text-gray-900 mb-4">
|
|
18
|
+
Monorepo Configuration
|
|
19
|
+
</h3>
|
|
20
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
21
|
+
<div>
|
|
22
|
+
<label className="block text-sm font-medium text-gray-700 mb-2">
|
|
23
|
+
Structure Type
|
|
24
|
+
</label>
|
|
25
|
+
<select
|
|
26
|
+
value={config.monorepo?.structure || 'standard'}
|
|
27
|
+
onChange={e => handleMonorepoChange('structure', e.target.value)}
|
|
28
|
+
className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
|
29
|
+
>
|
|
30
|
+
<option value="standard">Standard (apps/packages/libs)</option>
|
|
31
|
+
<option value="custom">Custom Structure</option>
|
|
32
|
+
</select>
|
|
33
|
+
<p className="text-xs text-gray-500 mt-1">
|
|
34
|
+
Choose your monorepo directory structure
|
|
35
|
+
</p>
|
|
36
|
+
</div>
|
|
37
|
+
<div>
|
|
38
|
+
<label className="block text-sm font-medium text-gray-700 mb-2">
|
|
39
|
+
Package Manager
|
|
40
|
+
</label>
|
|
41
|
+
<select
|
|
42
|
+
value={config.monorepo?.packageManager || 'pnpm'}
|
|
43
|
+
onChange={e =>
|
|
44
|
+
handleMonorepoChange('packageManager', e.target.value)
|
|
45
|
+
}
|
|
46
|
+
className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
|
47
|
+
>
|
|
48
|
+
<option value="pnpm">pnpm</option>
|
|
49
|
+
<option value="npm">npm</option>
|
|
50
|
+
<option value="yarn">Yarn</option>
|
|
51
|
+
<option value="lerna">Lerna</option>
|
|
52
|
+
<option value="nx">Nx</option>
|
|
53
|
+
</select>
|
|
54
|
+
<p className="text-xs text-gray-500 mt-1">
|
|
55
|
+
Package manager used in your monorepo
|
|
56
|
+
</p>
|
|
57
|
+
</div>
|
|
58
|
+
<div>
|
|
59
|
+
<label className="block text-sm font-medium text-gray-700 mb-2">
|
|
60
|
+
Package Directories
|
|
61
|
+
</label>
|
|
62
|
+
<input
|
|
63
|
+
type="text"
|
|
64
|
+
value={arrayToString(config.monorepo?.directories)}
|
|
65
|
+
onChange={e =>
|
|
66
|
+
handleMonorepoChange(
|
|
67
|
+
'directories',
|
|
68
|
+
stringToArray(e.target.value)
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
|
72
|
+
placeholder="apps, packages, libs, services"
|
|
73
|
+
/>
|
|
74
|
+
<p className="text-xs text-gray-500 mt-1">
|
|
75
|
+
Directories containing packages
|
|
76
|
+
</p>
|
|
77
|
+
</div>
|
|
78
|
+
<div>
|
|
79
|
+
<label className="block text-sm font-medium text-gray-700 mb-2">
|
|
80
|
+
Ignore Patterns
|
|
81
|
+
</label>
|
|
82
|
+
<input
|
|
83
|
+
type="text"
|
|
84
|
+
value={arrayToString(config.monorepo?.ignorePatterns)}
|
|
85
|
+
onChange={e =>
|
|
86
|
+
handleMonorepoChange(
|
|
87
|
+
'ignorePatterns',
|
|
88
|
+
stringToArray(e.target.value)
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
|
92
|
+
placeholder="node_modules, dist, .git"
|
|
93
|
+
/>
|
|
94
|
+
<p className="text-xs text-gray-500 mt-1">
|
|
95
|
+
Patterns to ignore when scanning
|
|
96
|
+
</p>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
{/* Configuration Preview */}
|
|
101
|
+
<div className="mt-6 p-4 bg-gray-50 border border-gray-200 rounded-lg">
|
|
102
|
+
<h4 className="text-sm font-medium text-gray-900 mb-3">
|
|
103
|
+
Configuration Preview
|
|
104
|
+
</h4>
|
|
105
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 text-sm">
|
|
106
|
+
<div>
|
|
107
|
+
<span className="font-medium text-gray-700">Structure:</span>
|
|
108
|
+
<span className="ml-2 text-gray-600 capitalize">
|
|
109
|
+
{config.monorepo?.structure || 'standard'}
|
|
110
|
+
</span>
|
|
111
|
+
</div>
|
|
112
|
+
<div>
|
|
113
|
+
<span className="font-medium text-gray-700">
|
|
114
|
+
Package Manager:
|
|
115
|
+
</span>
|
|
116
|
+
<span className="ml-2 text-gray-600">
|
|
117
|
+
{config.monorepo?.packageManager || 'pnpm'}
|
|
118
|
+
</span>
|
|
119
|
+
</div>
|
|
120
|
+
<div>
|
|
121
|
+
<span className="font-medium text-gray-700">Directories:</span>
|
|
122
|
+
<span className="ml-2 text-gray-600">
|
|
123
|
+
{config.monorepo?.directories?.length || 0} configured
|
|
124
|
+
</span>
|
|
125
|
+
</div>
|
|
126
|
+
<div>
|
|
127
|
+
<span className="font-medium text-gray-700">
|
|
128
|
+
Ignore Patterns:
|
|
129
|
+
</span>
|
|
130
|
+
<span className="ml-2 text-gray-600">
|
|
131
|
+
{config.monorepo?.ignorePatterns?.length || 0} patterns
|
|
132
|
+
</span>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
{/* Package Manager Specific Tips */}
|
|
138
|
+
{config.monorepo?.packageManager && (
|
|
139
|
+
<div className="mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg">
|
|
140
|
+
<h4 className="text-sm font-medium text-blue-900 mb-2">
|
|
141
|
+
{config.monorepo.packageManager.toUpperCase()} Configuration Tips
|
|
142
|
+
</h4>
|
|
143
|
+
<div className="text-xs text-blue-800">
|
|
144
|
+
{config.monorepo.packageManager === 'pnpm' && (
|
|
145
|
+
<p>
|
|
146
|
+
Make sure you have a pnpm-workspace.yaml file in your root
|
|
147
|
+
directory.
|
|
148
|
+
</p>
|
|
149
|
+
)}
|
|
150
|
+
{config.monorepo.packageManager === 'npm' && (
|
|
151
|
+
<p>
|
|
152
|
+
Configure workspaces in your package.json with the
|
|
153
|
+
"workspaces" field.
|
|
154
|
+
</p>
|
|
155
|
+
)}
|
|
156
|
+
{config.monorepo.packageManager === 'yarn' && (
|
|
157
|
+
<p>
|
|
158
|
+
Ensure you have workspaces configured in your package.json.
|
|
159
|
+
</p>
|
|
160
|
+
)}
|
|
161
|
+
{config.monorepo.packageManager === 'lerna' && (
|
|
162
|
+
<p>
|
|
163
|
+
Make sure you have a lerna.json configuration file in your
|
|
164
|
+
root.
|
|
165
|
+
</p>
|
|
166
|
+
)}
|
|
167
|
+
{config.monorepo.packageManager === 'nx' && (
|
|
168
|
+
<p>
|
|
169
|
+
Ensure you have an nx.json configuration file in your
|
|
170
|
+
workspace root.
|
|
171
|
+
</p>
|
|
172
|
+
)}
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
)}
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
);
|
|
179
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Export all configuration components for easier imports
|
|
2
|
+
export { default as ConfigurationModal } from './ConfigurationModal';
|
|
3
|
+
export { default as ConfigurationHeader } from './ConfigurationHeader';
|
|
4
|
+
export { default as ConfigurationTabs } from './ConfigurationTabs';
|
|
5
|
+
export { default as GeneralSettings } from './GeneralSettings';
|
|
6
|
+
export { default as FeatureToggles } from './FeatureToggles';
|
|
7
|
+
export { default as BrandingSettings } from './BrandingSettings';
|
|
8
|
+
export { default as MonorepoSettings } from './MonorepoSettings';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Shared types for configuration components
|
|
2
|
+
|
|
3
|
+
export interface DashboardConfig {
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
packageTypes?: string[];
|
|
7
|
+
customFields?: string[];
|
|
8
|
+
features?: {
|
|
9
|
+
healthChecks?: boolean;
|
|
10
|
+
ciIntegration?: boolean;
|
|
11
|
+
dependencyGraph?: boolean;
|
|
12
|
+
publishControl?: boolean;
|
|
13
|
+
searchAndFilter?: boolean;
|
|
14
|
+
configurationInspector?: boolean;
|
|
15
|
+
};
|
|
16
|
+
branding?: {
|
|
17
|
+
logo?: string;
|
|
18
|
+
primaryColor?: string;
|
|
19
|
+
secondaryColor?: string;
|
|
20
|
+
};
|
|
21
|
+
monorepo?: {
|
|
22
|
+
structure?: 'standard' | 'custom';
|
|
23
|
+
packageManager?: 'pnpm' | 'npm' | 'yarn' | 'lerna' | 'nx';
|
|
24
|
+
directories?: string[];
|
|
25
|
+
ignorePatterns?: string[];
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ConfigurationProps {
|
|
30
|
+
isOpen: boolean;
|
|
31
|
+
onClose: () => void;
|
|
32
|
+
onSave: (config: DashboardConfig) => void;
|
|
33
|
+
currentConfig: DashboardConfig;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type ConfigurationTab = 'general' | 'features' | 'branding' | 'monorepo';
|
|
37
|
+
|
|
38
|
+
export interface TabDefinition {
|
|
39
|
+
id: ConfigurationTab;
|
|
40
|
+
label: string;
|
|
41
|
+
icon: string|React.ReactNode;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface ConfigurationTabsProps {
|
|
45
|
+
activeTab: ConfigurationTab;
|
|
46
|
+
onTabChange: (tab: ConfigurationTab) => void;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface SettingsComponentProps {
|
|
50
|
+
config: DashboardConfig;
|
|
51
|
+
onConfigChange: (updates: Partial<DashboardConfig>) => void;
|
|
52
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
DashboardConfig,
|
|
3
|
+
TabDefinition,
|
|
4
|
+
ConfigurationTab,
|
|
5
|
+
} from '../types/config.types';
|
|
6
|
+
import { RocketLaunchIcon, CubeIcon, Cog6ToothIcon } from '../../../icons/heroicons';
|
|
7
|
+
|
|
8
|
+
// Get tab definitions
|
|
9
|
+
export const getTabDefinitions = (): TabDefinition[] => [
|
|
10
|
+
{ id: 'general', label: 'General', icon: <Cog6ToothIcon className="w-6 h-6 text-primary-600" /> },
|
|
11
|
+
{ id: 'features', label: 'Features', icon: <RocketLaunchIcon className="w-6 h-6 text-primary-600" /> },
|
|
12
|
+
{ id: 'branding', label: 'Branding', icon: '🎨' },
|
|
13
|
+
{ id: 'monorepo', label: 'Monorepo', icon: <CubeIcon className="w-6 h-6 text-primary-600" /> },
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
// Get default configuration
|
|
17
|
+
export const getDefaultConfig = (): DashboardConfig => ({
|
|
18
|
+
title: 'monodog Dashboard',
|
|
19
|
+
description: 'Visual management of our monorepo packages',
|
|
20
|
+
packageTypes: ['app', 'lib', 'tool', 'service'],
|
|
21
|
+
customFields: ['team', 'priority', 'environment'],
|
|
22
|
+
features: {
|
|
23
|
+
healthChecks: true,
|
|
24
|
+
ciIntegration: true,
|
|
25
|
+
dependencyGraph: true,
|
|
26
|
+
publishControl: true,
|
|
27
|
+
searchAndFilter: true,
|
|
28
|
+
configurationInspector: true,
|
|
29
|
+
},
|
|
30
|
+
branding: {
|
|
31
|
+
logo: '',
|
|
32
|
+
primaryColor: '#3B82F6',
|
|
33
|
+
secondaryColor: '#1E40AF',
|
|
34
|
+
},
|
|
35
|
+
monorepo: {
|
|
36
|
+
structure: 'standard',
|
|
37
|
+
packageManager: 'pnpm',
|
|
38
|
+
directories: ['apps', 'packages', 'libs'],
|
|
39
|
+
ignorePatterns: ['node_modules', 'dist', '.git'],
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// Merge configurations with defaults
|
|
44
|
+
export const mergeWithDefaults = (
|
|
45
|
+
config: Partial<DashboardConfig>
|
|
46
|
+
): DashboardConfig => {
|
|
47
|
+
const defaults = getDefaultConfig();
|
|
48
|
+
return {
|
|
49
|
+
...defaults,
|
|
50
|
+
...config,
|
|
51
|
+
features: { ...defaults.features, ...config.features },
|
|
52
|
+
branding: { ...defaults.branding, ...config.branding },
|
|
53
|
+
monorepo: { ...defaults.monorepo, ...config.monorepo },
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// Validate configuration
|
|
58
|
+
export const validateConfig = (
|
|
59
|
+
config: DashboardConfig
|
|
60
|
+
): { isValid: boolean; errors: string[] } => {
|
|
61
|
+
const errors: string[] = [];
|
|
62
|
+
|
|
63
|
+
if (!config.title || config.title.trim() === '') {
|
|
64
|
+
errors.push('Dashboard title is required');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (
|
|
68
|
+
config.monorepo?.directories &&
|
|
69
|
+
config.monorepo.directories.length === 0
|
|
70
|
+
) {
|
|
71
|
+
errors.push('At least one package directory is required');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (
|
|
75
|
+
config.branding?.primaryColor &&
|
|
76
|
+
!isValidHexColor(config.branding.primaryColor)
|
|
77
|
+
) {
|
|
78
|
+
errors.push('Primary color must be a valid hex color');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (
|
|
82
|
+
config.branding?.secondaryColor &&
|
|
83
|
+
!isValidHexColor(config.branding.secondaryColor)
|
|
84
|
+
) {
|
|
85
|
+
errors.push('Secondary color must be a valid hex color');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
isValid: errors.length === 0,
|
|
90
|
+
errors,
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// Helper function to validate hex colors
|
|
95
|
+
const isValidHexColor = (color: string): boolean => {
|
|
96
|
+
return /^#[0-9A-F]{6}$/i.test(color);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
// Convert comma-separated string to array
|
|
100
|
+
export const stringToArray = (value: string): string[] => {
|
|
101
|
+
return value
|
|
102
|
+
.split(',')
|
|
103
|
+
.map(s => s.trim())
|
|
104
|
+
.filter(s => s.length > 0);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// Convert array to comma-separated string
|
|
108
|
+
export const arrayToString = (arr: string[] | undefined): string => {
|
|
109
|
+
return arr ? arr.join(', ') : '';
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
// Format feature key for display
|
|
113
|
+
export const formatFeatureKey = (key: string): string => {
|
|
114
|
+
return key.replace(/([A-Z])/g, ' $1').trim();
|
|
115
|
+
};
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import Configuration, { DashboardConfig } from '../configuration/Configuration';
|
|
3
|
+
import SetupGuide from '../setup-guide/SetupGuide';
|
|
4
|
+
import { DASHBOARD_ERROR_MESSAGES } from '../../constants/messages';
|
|
5
|
+
import { cookieUtils } from '../../utils/cookies';
|
|
6
|
+
|
|
7
|
+
// Import sub-components
|
|
8
|
+
import {
|
|
9
|
+
Header,
|
|
10
|
+
StatsCards,
|
|
11
|
+
PackageDistribution,
|
|
12
|
+
QuickActions,
|
|
13
|
+
PackageSearchFilter,
|
|
14
|
+
PackageTable,
|
|
15
|
+
} from './components';
|
|
16
|
+
import { monorepoService } from '../../services/monorepoService';
|
|
17
|
+
// Import types and utilities
|
|
18
|
+
import { Package, PackageStats } from './types/dashboard.types';
|
|
19
|
+
import {
|
|
20
|
+
calculatePackageStats,
|
|
21
|
+
getUniquePackageTypes,
|
|
22
|
+
filterPackages,
|
|
23
|
+
getStatusColor,
|
|
24
|
+
getTypeIcon,
|
|
25
|
+
} from './utils/dashboard.utils';
|
|
26
|
+
import { LoadingState, ErrorState } from '../modules/packages/components';
|
|
27
|
+
|
|
28
|
+
// Configuration interface for customization - imported from Configuration component
|
|
29
|
+
|
|
30
|
+
// Default configuration that can be overridden
|
|
31
|
+
const defaultConfig: DashboardConfig = {
|
|
32
|
+
title: 'Monorepo Dashboard',
|
|
33
|
+
description: 'Visual management and monitoring of your monorepo packages',
|
|
34
|
+
packageTypes: ['app', 'lib', 'tool'],
|
|
35
|
+
features: {
|
|
36
|
+
healthChecks: true,
|
|
37
|
+
ciIntegration: true,
|
|
38
|
+
dependencyGraph: true,
|
|
39
|
+
publishControl: true,
|
|
40
|
+
searchAndFilter: true,
|
|
41
|
+
configurationInspector: true,
|
|
42
|
+
},
|
|
43
|
+
branding: {
|
|
44
|
+
primaryColor: '#3B82F6',
|
|
45
|
+
secondaryColor: '#1E40AF',
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// Mock data - this would be replaced by actual monorepo scanning
|
|
50
|
+
// const mockPackages: Package[] = [
|
|
51
|
+
// {
|
|
52
|
+
// name: 'dashboard',
|
|
53
|
+
// version: '1.0.0',
|
|
54
|
+
// type: 'app',
|
|
55
|
+
// path: 'apps/dashboard',
|
|
56
|
+
// dependencies: { react: '^18.0.0', utils: 'workspace:*' },
|
|
57
|
+
// devDependencies: { typescript: '^5.0.0' },
|
|
58
|
+
// scripts: { dev: 'vite', build: 'tsc', test: 'jest' },
|
|
59
|
+
// description: 'Main dashboard application',
|
|
60
|
+
// license: 'MIT',
|
|
61
|
+
// maintainers: ['team@company.com'],
|
|
62
|
+
// },
|
|
63
|
+
// {
|
|
64
|
+
// name: 'utils',
|
|
65
|
+
// version: '1.0.0',
|
|
66
|
+
// type: 'lib',
|
|
67
|
+
// path: 'libs/utils',
|
|
68
|
+
// dependencies: {},
|
|
69
|
+
// devDependencies: { typescript: '^5.0.0' },
|
|
70
|
+
// scripts: { build: 'tsc', test: 'jest' },
|
|
71
|
+
// description: 'Shared utility functions',
|
|
72
|
+
// license: 'MIT',
|
|
73
|
+
// maintainers: ['team@company.com'],
|
|
74
|
+
// },
|
|
75
|
+
// {
|
|
76
|
+
// name: 'backend',
|
|
77
|
+
// version: '1.0.0',
|
|
78
|
+
// type: 'app',
|
|
79
|
+
// path: 'packages/backend',
|
|
80
|
+
// dependencies: { express: '^4.18.0', utils: 'workspace:*' },
|
|
81
|
+
// devDependencies: { typescript: '^5.0.0' },
|
|
82
|
+
// scripts: { dev: 'tsx watch', start: 'tsx', build: 'tsc' },
|
|
83
|
+
// description: 'Backend API server',
|
|
84
|
+
// license: 'MIT',
|
|
85
|
+
// maintainers: ['team@company.com'],
|
|
86
|
+
// },
|
|
87
|
+
// ];
|
|
88
|
+
|
|
89
|
+
export default function Dashboard() {
|
|
90
|
+
const [packages, setPackages] = useState<Package[]>();
|
|
91
|
+
const [searchTerm, setSearchTerm] = useState('');
|
|
92
|
+
const [selectedType, setSelectedType] = useState<string>('all');
|
|
93
|
+
const [config, setConfig] = useState<DashboardConfig>(defaultConfig);
|
|
94
|
+
const [showConfig, setShowConfig] = useState(false);
|
|
95
|
+
const [showSetupGuide, setShowSetupGuide] = useState(false);
|
|
96
|
+
const [loading, setLoading] = useState(true);
|
|
97
|
+
const [error, setError] = useState<string | null>(null);
|
|
98
|
+
const [refreshing, setRefreshing] = useState(false);
|
|
99
|
+
|
|
100
|
+
// Fetch packages
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
const fetchPackages = async () => {
|
|
103
|
+
try {
|
|
104
|
+
setLoading(true);
|
|
105
|
+
const data = await monorepoService.getPackages();
|
|
106
|
+
setPackages(data);
|
|
107
|
+
setError(null);
|
|
108
|
+
} catch (err) {
|
|
109
|
+
setError(DASHBOARD_ERROR_MESSAGES.FAILED_TO_FETCH_PACKAGES);
|
|
110
|
+
console.error('Error fetching packages:', err);
|
|
111
|
+
} finally {
|
|
112
|
+
setLoading(false);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
fetchPackages();
|
|
117
|
+
}, []);
|
|
118
|
+
|
|
119
|
+
// Load configuration from cookies or environment
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
const savedConfig = cookieUtils.get('monodog-config');
|
|
122
|
+
if (savedConfig) {
|
|
123
|
+
setConfig({ ...defaultConfig, ...JSON.parse(savedConfig) });
|
|
124
|
+
}
|
|
125
|
+
}, []);
|
|
126
|
+
|
|
127
|
+
// Save configuration to cookies
|
|
128
|
+
const handleConfigSave = (newConfig: DashboardConfig) => {
|
|
129
|
+
setConfig(newConfig);
|
|
130
|
+
cookieUtils.set('monodog-config', JSON.stringify(newConfig));
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
// Handle refresh action
|
|
134
|
+
const handleRefresh = async () => {
|
|
135
|
+
try {
|
|
136
|
+
setRefreshing(true);
|
|
137
|
+
setError(null);
|
|
138
|
+
setLoading(true);
|
|
139
|
+
try {
|
|
140
|
+
const data = await monorepoService.refreshPackages();
|
|
141
|
+
// console.log('package data:', data);
|
|
142
|
+
setPackages(data);
|
|
143
|
+
setError(null);
|
|
144
|
+
} catch (err) {
|
|
145
|
+
setError(DASHBOARD_ERROR_MESSAGES.FAILED_TO_FETCH_PACKAGES);
|
|
146
|
+
console.error('Error fetching package data:', err);
|
|
147
|
+
} finally {
|
|
148
|
+
setLoading(false);
|
|
149
|
+
}
|
|
150
|
+
} catch (err) {
|
|
151
|
+
setError(DASHBOARD_ERROR_MESSAGES.FAILED_TO_FETCH_PACKAGES);
|
|
152
|
+
console.error('Error refreshing package data:', err);
|
|
153
|
+
} finally {
|
|
154
|
+
setRefreshing(false);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// Loading state
|
|
159
|
+
if (loading && !packages) {
|
|
160
|
+
return <LoadingState />;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Error state
|
|
164
|
+
if (error) {
|
|
165
|
+
return <ErrorState error={error} onRetry={handleRefresh} />;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Calculate derived data using utility functions
|
|
169
|
+
const filteredPackages = filterPackages(
|
|
170
|
+
packages ?? [],
|
|
171
|
+
searchTerm,
|
|
172
|
+
selectedType
|
|
173
|
+
);
|
|
174
|
+
const packageTypes = getUniquePackageTypes(packages ?? []);
|
|
175
|
+
const stats = calculatePackageStats(packages ?? []);
|
|
176
|
+
|
|
177
|
+
return (
|
|
178
|
+
<div className="p-6 space-y-6">
|
|
179
|
+
{/* Show refreshing overlay when refreshing with existing data */}
|
|
180
|
+
{refreshing && packages && (
|
|
181
|
+
<div className="fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50">
|
|
182
|
+
<div className="bg-white p-6 rounded-lg shadow-lg text-center">
|
|
183
|
+
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"></div>
|
|
184
|
+
<p className="mt-4 text-gray-700">Refreshing packages...</p>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
)}
|
|
188
|
+
{/* Header Section */}
|
|
189
|
+
<Header
|
|
190
|
+
config={config}
|
|
191
|
+
onShowSetupGuide={() => setShowSetupGuide(true)}
|
|
192
|
+
onShowConfig={() => setShowConfig(true)}
|
|
193
|
+
onRefresh={handleRefresh}
|
|
194
|
+
/>
|
|
195
|
+
|
|
196
|
+
{/* Statistics Cards */}
|
|
197
|
+
<StatsCards stats={stats} />
|
|
198
|
+
|
|
199
|
+
{/* Package Type Distribution */}
|
|
200
|
+
{/* <PackageDistribution
|
|
201
|
+
packages={packages ?? []}
|
|
202
|
+
packageTypes={packageTypes}
|
|
203
|
+
getTypeIcon={getTypeIcon}
|
|
204
|
+
/> */}
|
|
205
|
+
|
|
206
|
+
{/* Quick Actions */}
|
|
207
|
+
<QuickActions />
|
|
208
|
+
|
|
209
|
+
{/* Search, Filter and Package Table */}
|
|
210
|
+
<div className="bg-white p-6 rounded-lg shadow border">
|
|
211
|
+
<PackageSearchFilter
|
|
212
|
+
searchTerm={searchTerm}
|
|
213
|
+
selectedType={selectedType}
|
|
214
|
+
packageTypes={packageTypes}
|
|
215
|
+
onSearchChange={setSearchTerm}
|
|
216
|
+
onTypeChange={setSelectedType}
|
|
217
|
+
/>
|
|
218
|
+
|
|
219
|
+
<PackageTable
|
|
220
|
+
packages={filteredPackages}
|
|
221
|
+
getTypeIcon={getTypeIcon}
|
|
222
|
+
getStatusColor={getStatusColor}
|
|
223
|
+
/>
|
|
224
|
+
</div>
|
|
225
|
+
|
|
226
|
+
{/* Configuration Modal */}
|
|
227
|
+
<Configuration
|
|
228
|
+
isOpen={showConfig}
|
|
229
|
+
onClose={() => setShowConfig(false)}
|
|
230
|
+
onSave={handleConfigSave}
|
|
231
|
+
currentConfig={config}
|
|
232
|
+
/>
|
|
233
|
+
|
|
234
|
+
{/* Setup Guide Modal */}
|
|
235
|
+
<SetupGuide
|
|
236
|
+
isOpen={showSetupGuide}
|
|
237
|
+
onClose={() => setShowSetupGuide(false)}
|
|
238
|
+
onComplete={() => setShowSetupGuide(false)}
|
|
239
|
+
/>
|
|
240
|
+
</div>
|
|
241
|
+
);
|
|
242
|
+
}
|