@manojkmfsi/monodog 1.0.19 → 1.0.21
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 -4
- package/CHANGELOG.md +12 -0
- package/dist/config-loader.js +5 -6
- package/dist/get-db-url.js +0 -1
- package/dist/index.js +219 -80
- package/dist/serve.js +7 -91
- package/dist/services/commitService.js +1 -1
- package/dist/{gitService.js → services/gitService.js} +0 -101
- package/dist/setup.js +0 -0
- package/dist/utils/utilities.js +92 -14
- package/{monodog-conf.json → monodog-config.json} +2 -4
- package/monodog-dashboard/README.md +58 -0
- package/monodog-dashboard/dist/assets/{index-dadb5f0d.js → index-1a6836e4.js} +2 -2
- package/monodog-dashboard/dist/index.html +1 -1
- package/package.json +19 -19
- package/src/config-loader.ts +5 -7
- package/src/get-db-url.ts +0 -2
- package/src/index.ts +227 -72
- package/src/serve.ts +6 -68
- package/src/services/commitService.ts +1 -1
- package/src/services/gitService.ts +165 -0
- package/src/utils/utilities.ts +105 -14
- package/.turbo/turbo-lint.log +0 -4
- package/.turbo/turbo-test.log +0 -828
- package/coverage/clover.xml +0 -2661
- package/coverage/coverage-final.json +0 -99
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/ci-status.ts.html +0 -2002
- package/coverage/lcov-report/components/configuration/Configuration.tsx.html +0 -358
- package/coverage/lcov-report/components/configuration/components/BrandingSettings.tsx.html +0 -472
- package/coverage/lcov-report/components/configuration/components/ConfigurationHeader.tsx.html +0 -199
- package/coverage/lcov-report/components/configuration/components/ConfigurationModal.tsx.html +0 -157
- package/coverage/lcov-report/components/configuration/components/ConfigurationTabs.tsx.html +0 -175
- package/coverage/lcov-report/components/configuration/components/FeatureToggles.tsx.html +0 -283
- package/coverage/lcov-report/components/configuration/components/GeneralSettings.tsx.html +0 -316
- package/coverage/lcov-report/components/configuration/components/MonorepoSettings.tsx.html +0 -625
- package/coverage/lcov-report/components/configuration/components/index.html +0 -221
- package/coverage/lcov-report/components/configuration/components/index.ts.html +0 -109
- package/coverage/lcov-report/components/configuration/index.html +0 -116
- package/coverage/lcov-report/components/configuration/utils/config.utils.ts.html +0 -427
- package/coverage/lcov-report/components/configuration/utils/index.html +0 -116
- package/coverage/lcov-report/components/main-dashboard/Dashboard.tsx.html +0 -769
- package/coverage/lcov-report/components/main-dashboard/components/Header.tsx.html +0 -226
- package/coverage/lcov-report/components/main-dashboard/components/PackageDistribution.tsx.html +0 -187
- package/coverage/lcov-report/components/main-dashboard/components/PackageSearchFilter.tsx.html +0 -226
- package/coverage/lcov-report/components/main-dashboard/components/PackageTable.tsx.html +0 -343
- package/coverage/lcov-report/components/main-dashboard/components/QuickActions.tsx.html +0 -265
- package/coverage/lcov-report/components/main-dashboard/components/StatsCards.tsx.html +0 -289
- package/coverage/lcov-report/components/main-dashboard/components/index.html +0 -206
- package/coverage/lcov-report/components/main-dashboard/components/index.ts.html +0 -106
- package/coverage/lcov-report/components/main-dashboard/index.html +0 -116
- package/coverage/lcov-report/components/main-dashboard/utils/dashboard.utils.ts.html +0 -292
- package/coverage/lcov-report/components/main-dashboard/utils/index.html +0 -116
- package/coverage/lcov-report/components/modules/ci-integration/CIIntegration.tsx.html +0 -913
- package/coverage/lcov-report/components/modules/ci-integration/components/BuildDetails.tsx.html +0 -769
- package/coverage/lcov-report/components/modules/ci-integration/components/BuildList.tsx.html +0 -721
- package/coverage/lcov-report/components/modules/ci-integration/components/BuildOverview.tsx.html +0 -559
- package/coverage/lcov-report/components/modules/ci-integration/components/CIIntegrationHeader.tsx.html +0 -199
- package/coverage/lcov-report/components/modules/ci-integration/components/ErrorState.tsx.html +0 -160
- package/coverage/lcov-report/components/modules/ci-integration/components/LoadingState.tsx.html +0 -139
- package/coverage/lcov-report/components/modules/ci-integration/components/PipelineStatus.tsx.html +0 -754
- package/coverage/lcov-report/components/modules/ci-integration/components/index.html +0 -221
- package/coverage/lcov-report/components/modules/ci-integration/components/index.ts.html +0 -109
- package/coverage/lcov-report/components/modules/ci-integration/index.html +0 -116
- package/coverage/lcov-report/components/modules/ci-integration/utils/ci.utils.ts.html +0 -871
- package/coverage/lcov-report/components/modules/ci-integration/utils/index.html +0 -116
- package/coverage/lcov-report/components/modules/config-inspector/ConfigInspector.tsx.html +0 -1054
- package/coverage/lcov-report/components/modules/config-inspector/components/ConfigEditor.tsx.html +0 -361
- package/coverage/lcov-report/components/modules/config-inspector/components/ConfigInspectorHeader.tsx.html +0 -193
- package/coverage/lcov-report/components/modules/config-inspector/components/ConfigPreview.tsx.html +0 -352
- package/coverage/lcov-report/components/modules/config-inspector/components/ConfigSidebar.tsx.html +0 -505
- package/coverage/lcov-report/components/modules/config-inspector/components/ConfigToolbar.tsx.html +0 -637
- package/coverage/lcov-report/components/modules/config-inspector/components/ErrorState.tsx.html +0 -160
- package/coverage/lcov-report/components/modules/config-inspector/components/LoadingState.tsx.html +0 -139
- package/coverage/lcov-report/components/modules/config-inspector/components/ValidationPanel.tsx.html +0 -550
- package/coverage/lcov-report/components/modules/config-inspector/components/index.html +0 -236
- package/coverage/lcov-report/components/modules/config-inspector/components/index.ts.html +0 -112
- package/coverage/lcov-report/components/modules/config-inspector/index.html +0 -116
- package/coverage/lcov-report/components/modules/config-inspector/utils/config.utils.ts.html +0 -2242
- package/coverage/lcov-report/components/modules/config-inspector/utils/index.html +0 -116
- package/coverage/lcov-report/components/modules/dependency-graph/DependencyGraph.tsx.html +0 -754
- package/coverage/lcov-report/components/modules/dependency-graph/components/CircularDependencies.tsx.html +0 -613
- package/coverage/lcov-report/components/modules/dependency-graph/components/DependencyDetails.tsx.html +0 -661
- package/coverage/lcov-report/components/modules/dependency-graph/components/DependencyGraphHeader.tsx.html +0 -187
- package/coverage/lcov-report/components/modules/dependency-graph/components/DependencyList.tsx.html +0 -613
- package/coverage/lcov-report/components/modules/dependency-graph/components/ErrorState.tsx.html +0 -160
- package/coverage/lcov-report/components/modules/dependency-graph/components/GraphLegend.tsx.html +0 -430
- package/coverage/lcov-report/components/modules/dependency-graph/components/GraphStats.tsx.html +0 -493
- package/coverage/lcov-report/components/modules/dependency-graph/components/GraphToolbar.tsx.html +0 -406
- package/coverage/lcov-report/components/modules/dependency-graph/components/GraphVisualization.tsx.html +0 -619
- package/coverage/lcov-report/components/modules/dependency-graph/components/LoadingState.tsx.html +0 -139
- package/coverage/lcov-report/components/modules/dependency-graph/components/index.html +0 -266
- package/coverage/lcov-report/components/modules/dependency-graph/components/index.ts.html +0 -118
- package/coverage/lcov-report/components/modules/dependency-graph/index.html +0 -116
- package/coverage/lcov-report/components/modules/dependency-graph/utils/dependency.utils.ts.html +0 -1393
- package/coverage/lcov-report/components/modules/dependency-graph/utils/index.html +0 -116
- package/coverage/lcov-report/components/modules/health-status/HealthStatus.tsx.html +0 -2305
- package/coverage/lcov-report/components/modules/health-status/index.html +0 -116
- package/coverage/lcov-report/components/modules/packages/PackageDetail.tsx.html +0 -850
- package/coverage/lcov-report/components/modules/packages/PackagesOverview.tsx.html +0 -580
- package/coverage/lcov-report/components/modules/packages/components/ConfigurationTab.tsx.html +0 -1027
- package/coverage/lcov-report/components/modules/packages/components/DependenciesTab.tsx.html +0 -556
- package/coverage/lcov-report/components/modules/packages/components/ErrorState.tsx.html +0 -148
- package/coverage/lcov-report/components/modules/packages/components/HealthMetricsTab.tsx.html +0 -910
- package/coverage/lcov-report/components/modules/packages/components/LoadingState.tsx.html +0 -127
- package/coverage/lcov-report/components/modules/packages/components/PackageDetailHeader.tsx.html +0 -592
- package/coverage/lcov-report/components/modules/packages/components/PackageDetailTabs.tsx.html +0 -232
- package/coverage/lcov-report/components/modules/packages/components/PackageStats.tsx.html +0 -301
- package/coverage/lcov-report/components/modules/packages/components/PackagesTable.tsx.html +0 -589
- package/coverage/lcov-report/components/modules/packages/components/RecentCommitsTab.tsx.html +0 -364
- package/coverage/lcov-report/components/modules/packages/components/SearchAndFilter.tsx.html +0 -301
- package/coverage/lcov-report/components/modules/packages/components/index.html +0 -281
- package/coverage/lcov-report/components/modules/packages/components/index.ts.html +0 -121
- package/coverage/lcov-report/components/modules/packages/index.html +0 -131
- package/coverage/lcov-report/components/modules/packages/utils/index.html +0 -116
- package/coverage/lcov-report/components/modules/packages/utils/packages.utils.ts.html +0 -613
- package/coverage/lcov-report/components/publish-control/PublishControl.tsx.html +0 -769
- package/coverage/lcov-report/components/publish-control/components/ChangelogViewer.tsx.html +0 -394
- package/coverage/lcov-report/components/publish-control/components/ErrorState.tsx.html +0 -154
- package/coverage/lcov-report/components/publish-control/components/LoadingState.tsx.html +0 -121
- package/coverage/lcov-report/components/publish-control/components/PackageReleaseTable.tsx.html +0 -505
- package/coverage/lcov-report/components/publish-control/components/PublishHeader.tsx.html +0 -175
- package/coverage/lcov-report/components/publish-control/components/QuickActionCards.tsx.html +0 -253
- package/coverage/lcov-report/components/publish-control/components/ReleaseSchedule.tsx.html +0 -397
- package/coverage/lcov-report/components/publish-control/components/index.html +0 -221
- package/coverage/lcov-report/components/publish-control/components/index.ts.html +0 -109
- package/coverage/lcov-report/components/publish-control/index.html +0 -116
- package/coverage/lcov-report/components/publish-control/utils/index.html +0 -116
- package/coverage/lcov-report/components/publish-control/utils/publish.utils.ts.html +0 -262
- package/coverage/lcov-report/components/setup-guide/SetupGuide.tsx.html +0 -373
- package/coverage/lcov-report/components/setup-guide/components/SetupHeader.tsx.html +0 -157
- package/coverage/lcov-report/components/setup-guide/components/SetupModal.tsx.html +0 -163
- package/coverage/lcov-report/components/setup-guide/components/SetupProgress.tsx.html +0 -172
- package/coverage/lcov-report/components/setup-guide/components/StepContent.tsx.html +0 -901
- package/coverage/lcov-report/components/setup-guide/components/StepNavigation.tsx.html +0 -271
- package/coverage/lcov-report/components/setup-guide/components/index.html +0 -191
- package/coverage/lcov-report/components/setup-guide/components/index.ts.html +0 -103
- package/coverage/lcov-report/components/setup-guide/index.html +0 -116
- package/coverage/lcov-report/components/setup-guide/utils/index.html +0 -116
- package/coverage/lcov-report/components/setup-guide/utils/setup.utils.ts.html +0 -322
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -536
- package/coverage/lcov-report/monodog-dashboard/src/components/configuration/Configuration.tsx.html +0 -358
- package/coverage/lcov-report/monodog-dashboard/src/components/configuration/components/BrandingSettings.tsx.html +0 -472
- package/coverage/lcov-report/monodog-dashboard/src/components/configuration/components/ConfigurationHeader.tsx.html +0 -199
- package/coverage/lcov-report/monodog-dashboard/src/components/configuration/components/ConfigurationModal.tsx.html +0 -157
- package/coverage/lcov-report/monodog-dashboard/src/components/configuration/components/ConfigurationTabs.tsx.html +0 -175
- package/coverage/lcov-report/monodog-dashboard/src/components/configuration/components/FeatureToggles.tsx.html +0 -283
- package/coverage/lcov-report/monodog-dashboard/src/components/configuration/components/GeneralSettings.tsx.html +0 -316
- package/coverage/lcov-report/monodog-dashboard/src/components/configuration/components/MonorepoSettings.tsx.html +0 -625
- package/coverage/lcov-report/monodog-dashboard/src/components/configuration/components/index.html +0 -221
- package/coverage/lcov-report/monodog-dashboard/src/components/configuration/components/index.ts.html +0 -109
- package/coverage/lcov-report/monodog-dashboard/src/components/configuration/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/components/configuration/utils/config.utils.ts.html +0 -427
- package/coverage/lcov-report/monodog-dashboard/src/components/configuration/utils/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/components/main-dashboard/Dashboard.tsx.html +0 -769
- package/coverage/lcov-report/monodog-dashboard/src/components/main-dashboard/components/Header.tsx.html +0 -226
- package/coverage/lcov-report/monodog-dashboard/src/components/main-dashboard/components/PackageDistribution.tsx.html +0 -187
- package/coverage/lcov-report/monodog-dashboard/src/components/main-dashboard/components/PackageSearchFilter.tsx.html +0 -226
- package/coverage/lcov-report/monodog-dashboard/src/components/main-dashboard/components/PackageTable.tsx.html +0 -343
- package/coverage/lcov-report/monodog-dashboard/src/components/main-dashboard/components/QuickActions.tsx.html +0 -265
- package/coverage/lcov-report/monodog-dashboard/src/components/main-dashboard/components/StatsCards.tsx.html +0 -289
- package/coverage/lcov-report/monodog-dashboard/src/components/main-dashboard/components/index.html +0 -206
- package/coverage/lcov-report/monodog-dashboard/src/components/main-dashboard/components/index.ts.html +0 -106
- package/coverage/lcov-report/monodog-dashboard/src/components/main-dashboard/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/components/main-dashboard/utils/dashboard.utils.ts.html +0 -292
- package/coverage/lcov-report/monodog-dashboard/src/components/main-dashboard/utils/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/ci-integration/CIIntegration.tsx.html +0 -913
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/ci-integration/components/BuildDetails.tsx.html +0 -769
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/ci-integration/components/BuildList.tsx.html +0 -721
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/ci-integration/components/BuildOverview.tsx.html +0 -559
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/ci-integration/components/CIIntegrationHeader.tsx.html +0 -199
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/ci-integration/components/ErrorState.tsx.html +0 -160
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/ci-integration/components/LoadingState.tsx.html +0 -139
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/ci-integration/components/PipelineStatus.tsx.html +0 -754
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/ci-integration/components/index.html +0 -221
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/ci-integration/components/index.ts.html +0 -109
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/ci-integration/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/ci-integration/utils/ci.utils.ts.html +0 -871
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/ci-integration/utils/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/config-inspector/ConfigInspector.tsx.html +0 -1054
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/config-inspector/components/ConfigEditor.tsx.html +0 -361
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/config-inspector/components/ConfigInspectorHeader.tsx.html +0 -193
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/config-inspector/components/ConfigPreview.tsx.html +0 -352
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/config-inspector/components/ConfigSidebar.tsx.html +0 -505
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/config-inspector/components/ConfigToolbar.tsx.html +0 -637
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/config-inspector/components/ErrorState.tsx.html +0 -160
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/config-inspector/components/LoadingState.tsx.html +0 -139
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/config-inspector/components/ValidationPanel.tsx.html +0 -550
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/config-inspector/components/index.html +0 -236
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/config-inspector/components/index.ts.html +0 -112
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/config-inspector/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/config-inspector/utils/config.utils.ts.html +0 -2242
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/config-inspector/utils/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/dependency-graph/DependencyGraph.tsx.html +0 -754
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/dependency-graph/components/CircularDependencies.tsx.html +0 -613
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/dependency-graph/components/DependencyDetails.tsx.html +0 -661
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/dependency-graph/components/DependencyGraphHeader.tsx.html +0 -187
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/dependency-graph/components/DependencyList.tsx.html +0 -613
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/dependency-graph/components/ErrorState.tsx.html +0 -160
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/dependency-graph/components/GraphLegend.tsx.html +0 -430
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/dependency-graph/components/GraphStats.tsx.html +0 -493
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/dependency-graph/components/GraphToolbar.tsx.html +0 -406
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/dependency-graph/components/GraphVisualization.tsx.html +0 -619
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/dependency-graph/components/LoadingState.tsx.html +0 -139
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/dependency-graph/components/index.html +0 -266
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/dependency-graph/components/index.ts.html +0 -118
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/dependency-graph/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/dependency-graph/utils/dependency.utils.ts.html +0 -1393
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/dependency-graph/utils/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/health-status/HealthStatus.tsx.html +0 -2296
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/health-status/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/PackageDetail.tsx.html +0 -850
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/PackagesOverview.tsx.html +0 -580
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/components/ConfigurationTab.tsx.html +0 -1027
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/components/DependenciesTab.tsx.html +0 -556
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/components/ErrorState.tsx.html +0 -148
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/components/HealthMetricsTab.tsx.html +0 -910
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/components/LoadingState.tsx.html +0 -127
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/components/PackageDetailHeader.tsx.html +0 -592
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/components/PackageDetailTabs.tsx.html +0 -232
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/components/PackageStats.tsx.html +0 -301
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/components/PackagesTable.tsx.html +0 -589
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/components/RecentCommitsTab.tsx.html +0 -364
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/components/SearchAndFilter.tsx.html +0 -301
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/components/index.html +0 -281
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/components/index.ts.html +0 -121
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/index.html +0 -131
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/utils/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/components/modules/packages/utils/packages.utils.ts.html +0 -613
- package/coverage/lcov-report/monodog-dashboard/src/components/publish-control/PublishControl.tsx.html +0 -769
- package/coverage/lcov-report/monodog-dashboard/src/components/publish-control/components/ChangelogViewer.tsx.html +0 -394
- package/coverage/lcov-report/monodog-dashboard/src/components/publish-control/components/ErrorState.tsx.html +0 -154
- package/coverage/lcov-report/monodog-dashboard/src/components/publish-control/components/LoadingState.tsx.html +0 -121
- package/coverage/lcov-report/monodog-dashboard/src/components/publish-control/components/PackageReleaseTable.tsx.html +0 -505
- package/coverage/lcov-report/monodog-dashboard/src/components/publish-control/components/PublishHeader.tsx.html +0 -175
- package/coverage/lcov-report/monodog-dashboard/src/components/publish-control/components/QuickActionCards.tsx.html +0 -253
- package/coverage/lcov-report/monodog-dashboard/src/components/publish-control/components/ReleaseSchedule.tsx.html +0 -397
- package/coverage/lcov-report/monodog-dashboard/src/components/publish-control/components/index.html +0 -221
- package/coverage/lcov-report/monodog-dashboard/src/components/publish-control/components/index.ts.html +0 -109
- package/coverage/lcov-report/monodog-dashboard/src/components/publish-control/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/components/publish-control/utils/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/components/publish-control/utils/publish.utils.ts.html +0 -262
- package/coverage/lcov-report/monodog-dashboard/src/components/setup-guide/SetupGuide.tsx.html +0 -373
- package/coverage/lcov-report/monodog-dashboard/src/components/setup-guide/components/SetupHeader.tsx.html +0 -157
- package/coverage/lcov-report/monodog-dashboard/src/components/setup-guide/components/SetupModal.tsx.html +0 -163
- package/coverage/lcov-report/monodog-dashboard/src/components/setup-guide/components/SetupProgress.tsx.html +0 -172
- package/coverage/lcov-report/monodog-dashboard/src/components/setup-guide/components/StepContent.tsx.html +0 -901
- package/coverage/lcov-report/monodog-dashboard/src/components/setup-guide/components/StepNavigation.tsx.html +0 -271
- package/coverage/lcov-report/monodog-dashboard/src/components/setup-guide/components/index.html +0 -191
- package/coverage/lcov-report/monodog-dashboard/src/components/setup-guide/components/index.ts.html +0 -103
- package/coverage/lcov-report/monodog-dashboard/src/components/setup-guide/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/components/setup-guide/utils/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/components/setup-guide/utils/setup.utils.ts.html +0 -322
- package/coverage/lcov-report/monodog-dashboard/src/pages/CIPage.tsx.html +0 -103
- package/coverage/lcov-report/monodog-dashboard/src/pages/ConfigPage.tsx.html +0 -103
- package/coverage/lcov-report/monodog-dashboard/src/pages/DashboardPage.tsx.html +0 -103
- package/coverage/lcov-report/monodog-dashboard/src/pages/HealthPage.tsx.html +0 -103
- package/coverage/lcov-report/monodog-dashboard/src/pages/PackageDetailPage.tsx.html +0 -103
- package/coverage/lcov-report/monodog-dashboard/src/pages/PackagesPage.tsx.html +0 -103
- package/coverage/lcov-report/monodog-dashboard/src/pages/PublishPage.tsx.html +0 -103
- package/coverage/lcov-report/monodog-dashboard/src/pages/index.html +0 -206
- package/coverage/lcov-report/monodog-dashboard/src/services/index.html +0 -116
- package/coverage/lcov-report/monodog-dashboard/src/services/monorepoService.ts.html +0 -3010
- package/coverage/lcov-report/pages/CIPage.tsx.html +0 -103
- package/coverage/lcov-report/pages/ConfigPage.tsx.html +0 -103
- package/coverage/lcov-report/pages/DashboardPage.tsx.html +0 -103
- package/coverage/lcov-report/pages/HealthPage.tsx.html +0 -103
- package/coverage/lcov-report/pages/PackageDetailPage.tsx.html +0 -103
- package/coverage/lcov-report/pages/PackagesPage.tsx.html +0 -103
- package/coverage/lcov-report/pages/PublishPage.tsx.html +0 -103
- package/coverage/lcov-report/pages/index.html +0 -206
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/services/index.html +0 -116
- package/coverage/lcov-report/services/monorepoService.ts.html +0 -3010
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov-report/src/config-loader.ts.html +0 -442
- package/coverage/lcov-report/src/index.html +0 -116
- package/coverage/lcov-report/src/utils/ci-status.ts.html +0 -2002
- package/coverage/lcov-report/src/utils/index.html +0 -131
- package/coverage/lcov-report/src/utils/utilities.ts.html +0 -1534
- package/coverage/lcov-report/utilities.ts.html +0 -1516
- package/coverage/lcov.info +0 -5870
- package/src/gitService.ts +0 -276
- /package/{monodog-conf.example.json → monodog-config.example.json} +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>MonoDog Dashboard</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-1a6836e4.js"></script>
|
|
8
8
|
<link rel="stylesheet" href="/assets/index-504dc418.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body class="bg-gray-100 text-gray-900">
|
package/package.json
CHANGED
|
@@ -1,32 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manojkmfsi/monodog",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"description": "App for monodog monorepo",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
7
7
|
"monodog": "dist/setup.js"
|
|
8
8
|
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"dev": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') tsx watch src/serve.js",
|
|
11
|
-
"serve": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') tsx dist/serve.js",
|
|
12
|
-
"prepublishOnly": "pnpm build",
|
|
13
|
-
"build": "rm -rf dist && tsc",
|
|
14
|
-
"test:coverage": "jest --coverage",
|
|
15
|
-
"prestart": "npm run build",
|
|
16
|
-
"clean": "rm -rf dist node_modules/.cache",
|
|
17
|
-
"lint": "eslint .",
|
|
18
|
-
"lint:fix": "eslint . --fix",
|
|
19
|
-
"db:url": "node dist/get-db-url.js",
|
|
20
|
-
"generate": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma generate",
|
|
21
|
-
"migrate": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma migrate dev",
|
|
22
|
-
"migrate:reset": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma migrate reset --force"
|
|
23
|
-
},
|
|
24
9
|
"dependencies": {
|
|
25
10
|
"@prisma/client": "^5.22.0",
|
|
26
11
|
"body-parser": "^1.20.4",
|
|
27
12
|
"cors": "^2.8.5",
|
|
28
13
|
"express": "^4.22.1",
|
|
14
|
+
"helmet": "^7.1.0",
|
|
29
15
|
"init": "^0.1.2",
|
|
16
|
+
"js-yaml": "^4.1.0",
|
|
30
17
|
"prisma": "^5.22.0"
|
|
31
18
|
},
|
|
32
19
|
"devDependencies": {
|
|
@@ -34,6 +21,7 @@
|
|
|
34
21
|
"@types/cors": "^2.8.19",
|
|
35
22
|
"@types/express": "^4.17.25",
|
|
36
23
|
"@types/jest": "^29.5.14",
|
|
24
|
+
"@types/js-yaml": "^4.0.9",
|
|
37
25
|
"@types/node": "^20.19.27",
|
|
38
26
|
"cross-env": "^10.1.0",
|
|
39
27
|
"jest": "^29.7.0",
|
|
@@ -43,6 +31,18 @@
|
|
|
43
31
|
"tsx": "^4.21.0",
|
|
44
32
|
"typescript": "^5.9.3"
|
|
45
33
|
},
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
"scripts": {
|
|
35
|
+
"dev": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') tsx watch src/serve.js",
|
|
36
|
+
"serve": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') tsx dist/serve.js",
|
|
37
|
+
"build": "rm -rf dist && tsc",
|
|
38
|
+
"test:coverage": "jest --coverage",
|
|
39
|
+
"prestart": "npm run build",
|
|
40
|
+
"clean": "rm -rf dist node_modules/.cache",
|
|
41
|
+
"lint": "eslint .",
|
|
42
|
+
"lint:fix": "eslint . --fix",
|
|
43
|
+
"db:url": "node dist/get-db-url.js",
|
|
44
|
+
"generate": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma generate",
|
|
45
|
+
"migrate": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma migrate dev",
|
|
46
|
+
"migrate:reset": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma migrate reset --force"
|
|
47
|
+
}
|
|
48
|
+
}
|
package/src/config-loader.ts
CHANGED
|
@@ -25,7 +25,7 @@ interface MonodogConfig {
|
|
|
25
25
|
let config: MonodogConfig | null = null;
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* Loads the monodog-
|
|
28
|
+
* Loads the monodog-config.json file from the monorepo root.
|
|
29
29
|
* This should be called only once during application startup.
|
|
30
30
|
* @returns The application configuration object.
|
|
31
31
|
*/
|
|
@@ -37,8 +37,8 @@ function loadConfig(): MonodogConfig {
|
|
|
37
37
|
// 1. Determine the path to the config file
|
|
38
38
|
// We assume the backend package is running from the monorepo root (cwd is root)
|
|
39
39
|
// or that we can navigate up to the root from the current file's location.
|
|
40
|
-
const rootPath = path.resolve(process.cwd());
|
|
41
|
-
const configPath = path.resolve(rootPath, 'monodog-
|
|
40
|
+
const rootPath = path.resolve(process.cwd());
|
|
41
|
+
const configPath = path.resolve(rootPath, 'monodog-config.json');
|
|
42
42
|
createConfigFileIfMissing(rootPath);
|
|
43
43
|
|
|
44
44
|
if (!fs.existsSync(configPath)) {
|
|
@@ -51,14 +51,12 @@ function loadConfig(): MonodogConfig {
|
|
|
51
51
|
const fileContent = fs.readFileSync(configPath, 'utf-8');
|
|
52
52
|
const parsedConfig = JSON.parse(fileContent) as MonodogConfig;
|
|
53
53
|
|
|
54
|
-
// 3. Optional: Add validation logic here (e.g., check if ports are numbers)
|
|
55
|
-
|
|
56
54
|
// Cache and return
|
|
57
55
|
config = parsedConfig;
|
|
58
56
|
process.stderr.write('[Config] Loaded configuration from: ...\n');
|
|
59
57
|
return config;
|
|
60
58
|
} catch (error) {
|
|
61
|
-
console.error('ERROR: Failed to read or parse monodog-
|
|
59
|
+
console.error('ERROR: Failed to read or parse monodog-config.json.');
|
|
62
60
|
console.error(error);
|
|
63
61
|
process.exit(1);
|
|
64
62
|
}
|
|
@@ -66,7 +64,7 @@ function loadConfig(): MonodogConfig {
|
|
|
66
64
|
|
|
67
65
|
function createConfigFileIfMissing(rootPath: string): void {
|
|
68
66
|
// --- CONFIGURATION ---
|
|
69
|
-
const configFileName = 'monodog-
|
|
67
|
+
const configFileName = 'monodog-config.json';
|
|
70
68
|
const configFilePath = path.resolve(rootPath, configFileName);
|
|
71
69
|
|
|
72
70
|
// The default content for the configuration file
|
package/src/get-db-url.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -2,10 +2,13 @@ import express, {
|
|
|
2
2
|
type Request,
|
|
3
3
|
type Response,
|
|
4
4
|
type NextFunction,
|
|
5
|
+
type ErrorRequestHandler,
|
|
5
6
|
} from 'express';
|
|
7
|
+
|
|
6
8
|
import cors from 'cors';
|
|
7
9
|
import path from 'path';
|
|
8
10
|
import { json } from 'body-parser';
|
|
11
|
+
import helmet from 'helmet';
|
|
9
12
|
|
|
10
13
|
import { appConfig } from './config-loader';
|
|
11
14
|
|
|
@@ -13,52 +16,116 @@ import packageRouter from './routes/packageRoutes';
|
|
|
13
16
|
import commitRouter from './routes/commitRoutes';
|
|
14
17
|
import healthRouter from './routes/healthRoutes';
|
|
15
18
|
import configRouter from './routes/configRoutes';
|
|
19
|
+
|
|
20
|
+
// Security constants
|
|
21
|
+
const PORT_MIN = 1024;
|
|
22
|
+
const PORT_MAX = 65535;
|
|
23
|
+
|
|
24
|
+
// Validate port number
|
|
25
|
+
function validatePort(port: string | number): number {
|
|
26
|
+
const portNum = typeof port === 'string' ? parseInt(port, 10) : port;
|
|
27
|
+
|
|
28
|
+
if (isNaN(portNum) || portNum < PORT_MIN || portNum > PORT_MAX) {
|
|
29
|
+
throw new Error(`Port must be between ${PORT_MIN} and ${PORT_MAX}`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return portNum;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Global error handler
|
|
36
|
+
const errorHandler: ErrorRequestHandler = (err: any, req: Request, res: Response, _next: NextFunction) => {
|
|
37
|
+
const status = err.status || err.statusCode || 500;
|
|
38
|
+
const message = process.env.NODE_ENV === 'production'
|
|
39
|
+
? 'Internal server error'
|
|
40
|
+
: err.message;
|
|
41
|
+
|
|
42
|
+
console.error('[ERROR]', {
|
|
43
|
+
status,
|
|
44
|
+
method: req.method,
|
|
45
|
+
path: req.path,
|
|
46
|
+
message: err.message,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
res.status(status).json({
|
|
50
|
+
error: 'Internal server error'
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
16
54
|
// The main function exported and called by the CLI
|
|
17
55
|
export function startServer(
|
|
18
|
-
rootPath: string
|
|
19
|
-
port: number | string,
|
|
20
|
-
host: string
|
|
56
|
+
rootPath: string
|
|
21
57
|
): void {
|
|
22
|
-
const app = express();
|
|
23
|
-
app.locals.rootPath = rootPath;
|
|
24
|
-
// --- Middleware ---
|
|
25
|
-
|
|
26
|
-
// 1. Logging Middleware
|
|
27
|
-
app.use((_req: Request, _res: Response, next: NextFunction) => {
|
|
28
|
-
console.log(`[SERVER] ${_req.method} ${_req.url} (Root: ${rootPath})`);
|
|
29
|
-
next();
|
|
30
|
-
});
|
|
31
|
-
app.use(cors());
|
|
32
|
-
app.use(json());
|
|
33
58
|
|
|
59
|
+
try {
|
|
60
|
+
const port = appConfig.server.port;
|
|
61
|
+
const host = appConfig.server.host;
|
|
62
|
+
const validatedPort = validatePort(port);
|
|
63
|
+
const app = express();
|
|
34
64
|
|
|
35
|
-
|
|
65
|
+
// Set request timeout (30 seconds)
|
|
66
|
+
app.use((req, res, next) => {
|
|
67
|
+
req.setTimeout(30000);
|
|
68
|
+
res.setTimeout(30000);
|
|
69
|
+
next();
|
|
70
|
+
});
|
|
36
71
|
|
|
72
|
+
app.locals.rootPath = rootPath;
|
|
37
73
|
|
|
38
|
-
|
|
39
|
-
|
|
74
|
+
// Security middleware with CSP allowing API calls
|
|
75
|
+
const apiHost = host === '0.0.0.0' ? 'localhost' : host;
|
|
76
|
+
const apiUrl = process.env.API_URL || `http://${apiHost}:${validatedPort}`;
|
|
77
|
+
const dashboardHost = appConfig.dashboard.host === '0.0.0.0' ? 'localhost' : appConfig.dashboard.host;
|
|
78
|
+
const dashboardUrl = `http://${dashboardHost}:${appConfig.dashboard.port}`;
|
|
40
79
|
|
|
41
|
-
|
|
80
|
+
app.use(helmet({
|
|
81
|
+
contentSecurityPolicy: {
|
|
82
|
+
directives: {
|
|
83
|
+
defaultSrc: ["'self'"],
|
|
84
|
+
connectSrc: ["'self'", apiUrl, 'http://localhost:*', 'http://127.0.0.1:*'],
|
|
85
|
+
scriptSrc: ["'self'"],
|
|
86
|
+
imgSrc: ["'self'", 'data:', 'https:'],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
}));
|
|
90
|
+
app.use(cors({
|
|
91
|
+
origin: process.env.CORS_ORIGIN || dashboardUrl,
|
|
92
|
+
credentials: true,
|
|
93
|
+
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
|
|
94
|
+
allowedHeaders: ['Content-Type', 'Authorization'],
|
|
95
|
+
}));
|
|
42
96
|
|
|
43
|
-
|
|
97
|
+
app.use(json({ limit: '1mb' }));
|
|
44
98
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
99
|
+
// Request logging middleware (safe version)
|
|
100
|
+
app.use((_req: Request, _res: Response, next: NextFunction) => {
|
|
101
|
+
console.log(`[${new Date().toISOString()}] ${_req.method} ${_req.path}`);
|
|
102
|
+
next();
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
app.use('/api/packages', packageRouter);
|
|
106
|
+
|
|
107
|
+
// Get commit details
|
|
108
|
+
app.use('/api/commits/', commitRouter);
|
|
48
109
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
110
|
+
// Health check endpoint
|
|
111
|
+
app.use('/api/health/', healthRouter);
|
|
112
|
+
|
|
113
|
+
// Configuration endpoint
|
|
114
|
+
app.use('/api/config/', configRouter);
|
|
115
|
+
|
|
116
|
+
// 404 handler
|
|
117
|
+
app.use('*', (_, res) => {
|
|
118
|
+
res.status(404).json({
|
|
119
|
+
error: 'Endpoint not found',
|
|
120
|
+
timestamp: Date.now(),
|
|
121
|
+
});
|
|
54
122
|
});
|
|
55
|
-
});
|
|
56
123
|
|
|
57
|
-
|
|
124
|
+
// Global error handler (must be last)
|
|
125
|
+
app.use(errorHandler);
|
|
58
126
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
console.log(`🚀 Backend server running on http://${host}:${PORT}`);
|
|
127
|
+
const server = app.listen(validatedPort, host, () => {
|
|
128
|
+
console.log(`🚀 Backend server running on http://${host}:${validatedPort}`);
|
|
62
129
|
console.log(`📊 API endpoints available:`);
|
|
63
130
|
console.log(` - GET /api/health`);
|
|
64
131
|
console.log(` - GET /api/packages/refresh`);
|
|
@@ -69,61 +136,149 @@ app.locals.rootPath = rootPath;
|
|
|
69
136
|
console.log(` - GET /api/health/packages`);
|
|
70
137
|
console.log(` - PUT /api/config/files/:id`);
|
|
71
138
|
console.log(` - GET /api/config/files`);
|
|
139
|
+
});
|
|
72
140
|
|
|
73
|
-
|
|
74
|
-
.on('error', err => {
|
|
141
|
+
server.on('error', (err: any) => {
|
|
75
142
|
// Handle common errors like EADDRINUSE (port already in use)
|
|
76
|
-
if (err.
|
|
143
|
+
if (err.code === 'EADDRINUSE') {
|
|
77
144
|
console.error(
|
|
78
|
-
`Error: Port ${
|
|
145
|
+
`Error: Port ${validatedPort} is already in use. Please specify a different port.`
|
|
146
|
+
);
|
|
147
|
+
process.exit(1);
|
|
148
|
+
} else if (err.code === 'EACCES') {
|
|
149
|
+
console.error(
|
|
150
|
+
`Error: Permission denied to listen on port ${validatedPort}. Use a port above 1024.`
|
|
79
151
|
);
|
|
80
152
|
process.exit(1);
|
|
81
153
|
} else {
|
|
82
|
-
console.error('Server failed to start:', err);
|
|
154
|
+
console.error('Server failed to start:', err.message);
|
|
83
155
|
process.exit(1);
|
|
84
156
|
}
|
|
85
157
|
});
|
|
158
|
+
|
|
159
|
+
// Graceful shutdown
|
|
160
|
+
process.on('SIGTERM', () => {
|
|
161
|
+
console.log('SIGTERM signal received: closing HTTP server');
|
|
162
|
+
server.close(() => {
|
|
163
|
+
console.log('HTTP server closed');
|
|
164
|
+
process.exit(0);
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
} catch (error: any) {
|
|
168
|
+
console.error('Failed to start server:', error.message);
|
|
169
|
+
process.exit(1);
|
|
170
|
+
}
|
|
86
171
|
}
|
|
87
172
|
|
|
88
173
|
export function serveDashboard(
|
|
89
|
-
rootPath: string
|
|
90
|
-
port: number | string,
|
|
91
|
-
host: string
|
|
174
|
+
rootPath: string
|
|
92
175
|
): void {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
176
|
+
try {
|
|
177
|
+
const port = appConfig.dashboard.port;
|
|
178
|
+
const host = appConfig.dashboard.host;
|
|
179
|
+
const validatedPort = validatePort(port);
|
|
180
|
+
const app = express();
|
|
181
|
+
|
|
182
|
+
// Security middleware
|
|
183
|
+
const serverHost = appConfig.server.host === '0.0.0.0' ? 'localhost' : appConfig.server.host;
|
|
184
|
+
const apiUrl = process.env.API_URL || `http://${serverHost}:${appConfig.server.port}`;
|
|
185
|
+
app.use(helmet({
|
|
186
|
+
contentSecurityPolicy: {
|
|
187
|
+
directives: {
|
|
188
|
+
defaultSrc: ["'self'"],
|
|
189
|
+
connectSrc: ["'self'", apiUrl, 'http://localhost:*', 'http://127.0.0.1:*'],
|
|
190
|
+
scriptSrc: ["'self'"],
|
|
191
|
+
imgSrc: ["'self'", 'data:', 'https:'],
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
}));
|
|
195
|
+
|
|
196
|
+
// Strict CORS for dashboard
|
|
197
|
+
app.use(cors({
|
|
198
|
+
origin: false, // Don't allow any origin for static assets
|
|
199
|
+
}));
|
|
100
200
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if (/(.ico|.js|.css|.jpg|.png|.map)$/i.test(req.path)) {
|
|
201
|
+
// Set request timeout
|
|
202
|
+
app.use((req, res, next) => {
|
|
203
|
+
req.setTimeout(30000);
|
|
204
|
+
res.setTimeout(30000);
|
|
106
205
|
next();
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
app.get('/env-config.js', (req, res) => {
|
|
209
|
+
res.setHeader('Content-Type', 'application/javascript');
|
|
210
|
+
res.setHeader('Cache-Control', 'private, no-cache, no-store, must-revalidate');
|
|
211
|
+
|
|
212
|
+
const serverHost = appConfig.server.host === '0.0.0.0' ? 'localhost' : appConfig.server.host;
|
|
213
|
+
const apiUrl = process.env.API_URL || `http://${serverHost}:${appConfig.server.port}`;
|
|
214
|
+
res.send(
|
|
215
|
+
`window.ENV = { API_URL: "${apiUrl}" };`
|
|
111
216
|
);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
// This code makes sure that any request that does not matches a static file
|
|
220
|
+
// in the build folder, will just serve index.html. Client side routing is
|
|
221
|
+
// going to make sure that the correct content will be loaded.
|
|
222
|
+
app.use((req, res, next) => {
|
|
223
|
+
if (/(.ico|.js|.css|.jpg|.png|.map|.woff|.woff2|.ttf)$/i.test(req.path)) {
|
|
224
|
+
next();
|
|
225
|
+
} else {
|
|
226
|
+
res.header(
|
|
227
|
+
'Cache-Control',
|
|
228
|
+
'private, no-cache, no-store, must-revalidate'
|
|
229
|
+
);
|
|
230
|
+
res.header('Expires', '-1');
|
|
231
|
+
res.header('Pragma', 'no-cache');
|
|
232
|
+
res.sendFile('index.html', {
|
|
233
|
+
root: path.resolve(__dirname, '..', 'monodog-dashboard', 'dist'),
|
|
234
|
+
}, (err) => {
|
|
235
|
+
if (err) {
|
|
236
|
+
console.error('Error serving index.html:', err.message);
|
|
237
|
+
res.status(500).json({ error: 'Internal server error' });
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
const staticPath = path.join(__dirname, '..', 'monodog-dashboard', 'dist');
|
|
244
|
+
console.log('Serving static files from:', staticPath);
|
|
245
|
+
app.use(express.static(staticPath, {
|
|
246
|
+
maxAge: '1d',
|
|
247
|
+
etag: false,
|
|
248
|
+
dotfiles: 'deny', // Don't serve dot files
|
|
249
|
+
}));
|
|
250
|
+
|
|
251
|
+
// Global error handler
|
|
252
|
+
app.use(errorHandler);
|
|
253
|
+
|
|
254
|
+
const server = app.listen(validatedPort, host, () => {
|
|
255
|
+
console.log(`✅ Dashboard listening on http://${host}:${validatedPort}`);
|
|
256
|
+
console.log('Press Ctrl+C to quit.');
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
server.on('error', (err: any) => {
|
|
260
|
+
if (err.code === 'EADDRINUSE') {
|
|
261
|
+
console.error(`Error: Port ${validatedPort} is already in use.`);
|
|
262
|
+
process.exit(1);
|
|
263
|
+
} else if (err.code === 'EACCES') {
|
|
264
|
+
console.error(`Error: Permission denied to listen on port ${validatedPort}.`);
|
|
265
|
+
process.exit(1);
|
|
266
|
+
} else {
|
|
267
|
+
console.error('Server failed to start:', err.message);
|
|
268
|
+
process.exit(1);
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
// Graceful shutdown
|
|
273
|
+
process.on('SIGTERM', () => {
|
|
274
|
+
console.log('SIGTERM signal received: closing dashboard server');
|
|
275
|
+
server.close(() => {
|
|
276
|
+
console.log('Dashboard server closed');
|
|
277
|
+
process.exit(0);
|
|
116
278
|
});
|
|
117
|
-
}
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
// Start the server
|
|
123
|
-
const PORT = parseInt(port ? port.toString() : '8999');
|
|
124
|
-
|
|
125
|
-
app.listen(PORT, host, () => {
|
|
126
|
-
console.log(`App listening on ${host}:${port}`);
|
|
127
|
-
console.log('Press Ctrl+C to quit.');
|
|
128
|
-
});
|
|
279
|
+
});
|
|
280
|
+
} catch (error: any) {
|
|
281
|
+
console.error('Failed to start dashboard:', error.message);
|
|
282
|
+
process.exit(1);
|
|
283
|
+
}
|
|
129
284
|
}
|
package/src/serve.ts
CHANGED
|
@@ -2,86 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* CLI Entry Point for serving Monodog.
|
|
5
|
-
*
|
|
5
|
+
* This script is executed when a user runs the serve command
|
|
6
6
|
* in their project. It handles command-line arguments to determine
|
|
7
7
|
* whether to:
|
|
8
8
|
* 1. Start the API server for the dashboard.
|
|
9
9
|
* 2. Start serving the dashboard frontend.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
12
|
+
import { startServer, serveDashboard } from './index';
|
|
13
|
+
import { findMonorepoRoot } from './utils/utilities';
|
|
14
14
|
|
|
15
|
-
import { appConfig } from './config-loader';
|
|
16
|
-
import fs from 'fs';
|
|
17
|
-
|
|
18
|
-
// --- Argument Parsing ---
|
|
19
|
-
|
|
20
|
-
// 1. Get arguments excluding the node executable and script name
|
|
21
|
-
const args = process.argv.slice(2);
|
|
22
|
-
|
|
23
|
-
// Default settings
|
|
24
|
-
const DEFAULT_PORT = 8999;
|
|
25
15
|
const rootPath = findMonorepoRoot();
|
|
26
|
-
const port = appConfig.server.port ?? DEFAULT_PORT; //Default port
|
|
27
|
-
const host = appConfig.server.host ?? 'localhost'; //Default host
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// --- Execution Logic ---
|
|
31
16
|
|
|
32
17
|
console.log(`Starting Monodog API server...`);
|
|
33
18
|
console.log(`Analyzing monorepo at root: ${rootPath}`);
|
|
34
|
-
// Start the Express server and begin analysis
|
|
35
|
-
startServer(rootPath, port, host);
|
|
36
|
-
serveDashboard(
|
|
37
|
-
path.join(rootPath),
|
|
38
|
-
appConfig.dashboard.port,
|
|
39
|
-
appConfig.dashboard.host
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Find the monorepo root by looking for package.json with workspaces or pnpm-workspace.yaml
|
|
44
|
-
*/
|
|
45
|
-
function findMonorepoRoot(): string {
|
|
46
|
-
let currentDir = __dirname;
|
|
47
|
-
|
|
48
|
-
while (currentDir !== path.parse(currentDir).root) {
|
|
49
|
-
const packageJsonPath = path.join(currentDir, 'package.json');
|
|
50
|
-
const pnpmWorkspacePath = path.join(currentDir, 'pnpm-workspace.yaml');
|
|
51
19
|
|
|
52
|
-
|
|
53
|
-
if (fs.existsSync(packageJsonPath)) {
|
|
54
|
-
try {
|
|
55
|
-
const packageJson = JSON.parse(
|
|
56
|
-
fs.readFileSync(packageJsonPath, 'utf8')
|
|
57
|
-
);
|
|
58
|
-
// If it has workspaces or is the root monorepo package
|
|
59
|
-
if (packageJson.workspaces || fs.existsSync(pnpmWorkspacePath)) {
|
|
60
|
-
console.log('✅ Found monorepo root:', currentDir);
|
|
61
|
-
return currentDir;
|
|
62
|
-
}
|
|
63
|
-
} catch (error) {
|
|
64
|
-
// Continue searching if package.json is invalid
|
|
65
|
-
}
|
|
66
|
-
}
|
|
20
|
+
// Start the Express server and dashboard
|
|
67
21
|
|
|
68
|
-
|
|
69
|
-
const gitPath = path.join(currentDir, '.git');
|
|
70
|
-
if (fs.existsSync(gitPath)) {
|
|
71
|
-
console.log('✅ Found git root (likely monorepo root):', currentDir);
|
|
72
|
-
return currentDir;
|
|
73
|
-
}
|
|
22
|
+
startServer(rootPath);
|
|
74
23
|
|
|
75
|
-
|
|
76
|
-
const parentDir = path.dirname(currentDir);
|
|
77
|
-
if (parentDir === currentDir) break; // Prevent infinite loop
|
|
78
|
-
currentDir = parentDir;
|
|
79
|
-
}
|
|
24
|
+
serveDashboard(rootPath);
|
|
80
25
|
|
|
81
|
-
// Fallback to process.cwd() if we can't find the root
|
|
82
|
-
console.log(
|
|
83
|
-
'⚠️ Could not find monorepo root, using process.cwd():',
|
|
84
|
-
process.cwd()
|
|
85
|
-
);
|
|
86
|
-
return process.cwd();
|
|
87
|
-
}
|