@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
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DocumentTextIcon,
|
|
3
|
-
ClipboardIcon,
|
|
4
|
-
ClipboardDocumentCheckIcon,
|
|
5
|
-
} from '../../../../icons/heroicons';
|
|
6
|
-
import { type PackageDetail } from '../types/packages.types';
|
|
7
|
-
import type { ConfigurationTabProps } from '../../../../types';
|
|
8
|
-
import { useState } from 'react';
|
|
9
|
-
import { monorepoService } from '../../../../services/monorepoService';
|
|
10
|
-
|
|
11
|
-
export default function ConfigurationTab({
|
|
12
|
-
packageData,
|
|
13
|
-
}: ConfigurationTabProps) {
|
|
14
|
-
const [isEditing, setIsEditing] = useState(false);
|
|
15
|
-
const [editedConfig, setEditedConfig] = useState('');
|
|
16
|
-
const [isSaving, setIsSaving] = useState(false);
|
|
17
|
-
const [saveMessage, setSaveMessage] = useState('');
|
|
18
|
-
const [copiedScript, setCopiedScript] = useState<string | null>(null); // Track which script was copied
|
|
19
|
-
const [isConfigCopied, setIsConfigCopied] = useState(false);
|
|
20
|
-
|
|
21
|
-
// console.log('Package Data:', packageData);
|
|
22
|
-
const generatePackageJson = () => {
|
|
23
|
-
// Create a proper JavaScript object
|
|
24
|
-
const configObject = {
|
|
25
|
-
name: packageData.name,
|
|
26
|
-
version: packageData.version,
|
|
27
|
-
description: packageData.description || '',
|
|
28
|
-
license: packageData.license || '',
|
|
29
|
-
repository: packageData.repository || {},
|
|
30
|
-
scripts: packageData.scripts || {},
|
|
31
|
-
dependencies: packageData.dependencies || {},
|
|
32
|
-
devDependencies: packageData.devDependencies || {},
|
|
33
|
-
peerDependencies: packageData.peerDependencies || {},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
// Convert to properly formatted JSON string
|
|
37
|
-
return JSON.stringify(configObject, null, 2);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
// Initialize editedConfig when component mounts or packageData changes
|
|
41
|
-
useState(() => {
|
|
42
|
-
setEditedConfig(generatePackageJson());
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
const handleEditClick = () => {
|
|
46
|
-
setIsEditing(true);
|
|
47
|
-
setEditedConfig(generatePackageJson());
|
|
48
|
-
setSaveMessage('');
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const handleCancelClick = () => {
|
|
52
|
-
setIsEditing(false);
|
|
53
|
-
setEditedConfig(generatePackageJson());
|
|
54
|
-
setSaveMessage('');
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const handleSaveClick = async () => {
|
|
58
|
-
if (!editedConfig.trim()) {
|
|
59
|
-
setSaveMessage('Configuration cannot be empty');
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
setIsSaving(true);
|
|
64
|
-
setSaveMessage('');
|
|
65
|
-
|
|
66
|
-
try {
|
|
67
|
-
// console.log('Saving package configuration...');
|
|
68
|
-
|
|
69
|
-
// Use the MonorepoService to update the package configuration
|
|
70
|
-
const result = await monorepoService.updatePackageConfiguration(
|
|
71
|
-
packageData.name,
|
|
72
|
-
editedConfig,
|
|
73
|
-
packageData.path as string
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
if (result.success) {
|
|
77
|
-
setSaveMessage('Configuration updated successfully!');
|
|
78
|
-
setIsEditing(false);
|
|
79
|
-
// console.log('Update successful:', result);
|
|
80
|
-
|
|
81
|
-
// Optionally trigger a refresh of package data
|
|
82
|
-
// You might want to call a callback prop here to refresh parent state
|
|
83
|
-
} else {
|
|
84
|
-
throw new Error(result.message || 'Update failed');
|
|
85
|
-
}
|
|
86
|
-
} catch (error) {
|
|
87
|
-
console.error('Error saving configuration:', error);
|
|
88
|
-
setSaveMessage(
|
|
89
|
-
error instanceof Error
|
|
90
|
-
? error.message
|
|
91
|
-
: 'Failed to save configuration. Please try again.'
|
|
92
|
-
);
|
|
93
|
-
} finally {
|
|
94
|
-
setIsSaving(false);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const handleConfigChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
|
99
|
-
setEditedConfig(e.target.value);
|
|
100
|
-
// Clear message when user starts typing again
|
|
101
|
-
if (saveMessage) setSaveMessage('');
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
const handleCopyToClipboard = async (
|
|
105
|
-
content: string,
|
|
106
|
-
type: 'config' | 'script',
|
|
107
|
-
scriptName?: string
|
|
108
|
-
) => {
|
|
109
|
-
try {
|
|
110
|
-
await navigator.clipboard.writeText(content);
|
|
111
|
-
|
|
112
|
-
if (type === 'config') {
|
|
113
|
-
setIsConfigCopied(true);
|
|
114
|
-
setTimeout(() => setIsConfigCopied(false), 4000);
|
|
115
|
-
} else if (type === 'script' && scriptName) {
|
|
116
|
-
setCopiedScript(scriptName);
|
|
117
|
-
setTimeout(() => setCopiedScript(null), 4000);
|
|
118
|
-
}
|
|
119
|
-
} catch (error) {
|
|
120
|
-
console.error('Failed to copy to clipboard:', error);
|
|
121
|
-
// Fallback for older browsers
|
|
122
|
-
const textArea = document.createElement('textarea');
|
|
123
|
-
textArea.value = content;
|
|
124
|
-
document.body.appendChild(textArea);
|
|
125
|
-
textArea.select();
|
|
126
|
-
try {
|
|
127
|
-
document.execCommand('copy');
|
|
128
|
-
|
|
129
|
-
if (type === 'config') {
|
|
130
|
-
setIsConfigCopied(true);
|
|
131
|
-
setTimeout(() => setIsConfigCopied(false), 2000);
|
|
132
|
-
} else if (type === 'script' && scriptName) {
|
|
133
|
-
setCopiedScript(scriptName);
|
|
134
|
-
setTimeout(() => setCopiedScript(null), 2000);
|
|
135
|
-
}
|
|
136
|
-
} catch (fallbackError) {
|
|
137
|
-
console.error('Fallback copy failed:', fallbackError);
|
|
138
|
-
if (type === 'config') {
|
|
139
|
-
setSaveMessage('Failed to copy to clipboard');
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
document.body.removeChild(textArea);
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
return (
|
|
147
|
-
<div className="py-6">
|
|
148
|
-
{/* Scripts Section - Unchanged */}
|
|
149
|
-
<div className="bg-white border rounded-lg p-6 mb-6">
|
|
150
|
-
<div className="flex items-center space-x-2 mb-4">
|
|
151
|
-
<DocumentTextIcon className="w-5 h-5 text-gray-600" />
|
|
152
|
-
<h3 className="text-lg font-medium text-gray-900">Package Scripts</h3>
|
|
153
|
-
</div>
|
|
154
|
-
|
|
155
|
-
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
156
|
-
{Object.entries(packageData.scripts).map(([scriptName, command]) => (
|
|
157
|
-
<div
|
|
158
|
-
key={scriptName}
|
|
159
|
-
className="border border-gray-200 rounded-lg p-4"
|
|
160
|
-
>
|
|
161
|
-
<div className="flex items-center justify-between mb-2">
|
|
162
|
-
<h4 className="text-sm font-medium text-gray-900">
|
|
163
|
-
{scriptName}
|
|
164
|
-
</h4>
|
|
165
|
-
|
|
166
|
-
<div className="flex items-center space-x-2">
|
|
167
|
-
<button
|
|
168
|
-
onClick={() =>
|
|
169
|
-
handleCopyToClipboard(command, 'script', scriptName)
|
|
170
|
-
}
|
|
171
|
-
className={`text-sm flex items-center space-x-1 ${
|
|
172
|
-
copiedScript === scriptName
|
|
173
|
-
? 'text-green-600'
|
|
174
|
-
: 'text-gray-600 hover:text-gray-700'
|
|
175
|
-
}`}
|
|
176
|
-
title="Copy command to clipboard"
|
|
177
|
-
>
|
|
178
|
-
{copiedScript === scriptName ? (
|
|
179
|
-
<>
|
|
180
|
-
<ClipboardDocumentCheckIcon className="w-4 h-4" />
|
|
181
|
-
<span>Copied!</span>
|
|
182
|
-
</>
|
|
183
|
-
) : (
|
|
184
|
-
<>
|
|
185
|
-
<ClipboardIcon className="w-4 h-4" />
|
|
186
|
-
<span>Copy</span>
|
|
187
|
-
</>
|
|
188
|
-
)}
|
|
189
|
-
</button>
|
|
190
|
-
<button className="hidden text-blue-600 hover:text-blue-500 text-sm">
|
|
191
|
-
Run
|
|
192
|
-
</button>
|
|
193
|
-
</div>
|
|
194
|
-
</div>
|
|
195
|
-
<code className="text-xs text-gray-600 bg-gray-100 p-2 rounded block overflow-x-auto">
|
|
196
|
-
{command}
|
|
197
|
-
</code>
|
|
198
|
-
</div>
|
|
199
|
-
))}
|
|
200
|
-
</div>
|
|
201
|
-
|
|
202
|
-
{Object.keys(packageData.scripts).length === 0 && (
|
|
203
|
-
<div className="text-center py-8">
|
|
204
|
-
<div className="text-gray-400 text-4xl mb-2">📝</div>
|
|
205
|
-
<p className="text-gray-500">No scripts configured</p>
|
|
206
|
-
</div>
|
|
207
|
-
)}
|
|
208
|
-
</div>
|
|
209
|
-
|
|
210
|
-
{/* Package.json Preview/Editor */}
|
|
211
|
-
<div className="bg-white border rounded-lg p-6">
|
|
212
|
-
<div className="flex items-center justify-between mb-4">
|
|
213
|
-
<h3 className="text-lg font-medium text-gray-900">
|
|
214
|
-
Package Configuration
|
|
215
|
-
</h3>
|
|
216
|
-
{!isEditing && (
|
|
217
|
-
<div className="text-sm text-gray-500">Read-only preview</div>
|
|
218
|
-
)}
|
|
219
|
-
</div>
|
|
220
|
-
|
|
221
|
-
{isEditing ? (
|
|
222
|
-
// Editable Textarea
|
|
223
|
-
<div className="space-y-4">
|
|
224
|
-
<div className="bg-gray-900 text-gray-100 p-4 rounded-lg">
|
|
225
|
-
<textarea
|
|
226
|
-
value={editedConfig}
|
|
227
|
-
onChange={handleConfigChange}
|
|
228
|
-
className="w-full h-96 bg-gray-900 text-gray-100 text-sm font-mono resize-none focus:outline-none focus:ring-2 focus:ring-blue-500 rounded"
|
|
229
|
-
spellCheck="false"
|
|
230
|
-
/>
|
|
231
|
-
</div>
|
|
232
|
-
|
|
233
|
-
{/* Save Message */}
|
|
234
|
-
{saveMessage && (
|
|
235
|
-
<div
|
|
236
|
-
className={`p-3 rounded-lg text-sm ${
|
|
237
|
-
saveMessage.includes('successfully')
|
|
238
|
-
? 'bg-green-50 text-green-700 border border-green-200'
|
|
239
|
-
: 'bg-red-50 text-red-700 border border-red-200'
|
|
240
|
-
}`}
|
|
241
|
-
>
|
|
242
|
-
{saveMessage}
|
|
243
|
-
</div>
|
|
244
|
-
)}
|
|
245
|
-
|
|
246
|
-
{/* Action Buttons */}
|
|
247
|
-
<div className="flex space-x-3">
|
|
248
|
-
<button
|
|
249
|
-
onClick={handleSaveClick}
|
|
250
|
-
disabled={isSaving}
|
|
251
|
-
className="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed text-sm flex items-center space-x-2"
|
|
252
|
-
>
|
|
253
|
-
{isSaving ? (
|
|
254
|
-
<>
|
|
255
|
-
<div className="w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"></div>
|
|
256
|
-
<span>Saving...</span>
|
|
257
|
-
</>
|
|
258
|
-
) : (
|
|
259
|
-
<span>Save Changes</span>
|
|
260
|
-
)}
|
|
261
|
-
</button>
|
|
262
|
-
<button
|
|
263
|
-
onClick={handleCancelClick}
|
|
264
|
-
disabled={isSaving}
|
|
265
|
-
className="border border-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed text-sm"
|
|
266
|
-
>
|
|
267
|
-
Cancel
|
|
268
|
-
</button>
|
|
269
|
-
</div>
|
|
270
|
-
</div>
|
|
271
|
-
) : (
|
|
272
|
-
<>
|
|
273
|
-
<div className="bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto">
|
|
274
|
-
<pre className="text-sm">{editedConfig}</pre>
|
|
275
|
-
</div>
|
|
276
|
-
|
|
277
|
-
<div className="mt-4 flex space-x-3">
|
|
278
|
-
<button
|
|
279
|
-
onClick={handleEditClick}
|
|
280
|
-
className="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 text-sm"
|
|
281
|
-
>
|
|
282
|
-
Edit Configuration
|
|
283
|
-
</button>
|
|
284
|
-
<button
|
|
285
|
-
onClick={() =>
|
|
286
|
-
handleCopyToClipboard(
|
|
287
|
-
isEditing ? editedConfig : generatePackageJson(),
|
|
288
|
-
'config'
|
|
289
|
-
)
|
|
290
|
-
}
|
|
291
|
-
className="border border-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-50 text-sm flex items-center space-x-2"
|
|
292
|
-
>
|
|
293
|
-
{isConfigCopied ? (
|
|
294
|
-
<>
|
|
295
|
-
<ClipboardDocumentCheckIcon className="w-4 h-4 text-green-600" />
|
|
296
|
-
<span>Copied!</span>
|
|
297
|
-
</>
|
|
298
|
-
) : (
|
|
299
|
-
<>
|
|
300
|
-
<ClipboardIcon className="w-4 h-4" />
|
|
301
|
-
<span>Copy</span>
|
|
302
|
-
</>
|
|
303
|
-
)}
|
|
304
|
-
</button>
|
|
305
|
-
</div>
|
|
306
|
-
</>
|
|
307
|
-
)}
|
|
308
|
-
</div>
|
|
309
|
-
</div>
|
|
310
|
-
);
|
|
311
|
-
}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { ArrowUpIcon } from '../../../../icons/heroicons';
|
|
2
|
-
import { PackageDetail } from '../types/packages.types';
|
|
3
|
-
import type { DependenciesTabProps } from '../../../../types';
|
|
4
|
-
import { getDependencyStatusColor } from '../utils/packages.utils';
|
|
5
|
-
|
|
6
|
-
export default function DependenciesTab({ packageData }: DependenciesTabProps) {
|
|
7
|
-
if (!packageData.dependenciesInfo.length) {
|
|
8
|
-
return <p className="py-6 text-gray-600">No dependency found.</p>;
|
|
9
|
-
}
|
|
10
|
-
const renderDependencyTable = (
|
|
11
|
-
dependencies: PackageDetail['dependenciesInfo'],
|
|
12
|
-
title: string
|
|
13
|
-
) => (
|
|
14
|
-
<div className="mb-8">
|
|
15
|
-
<h3 className="text-lg font-medium text-gray-900 mb-4">{title}</h3>
|
|
16
|
-
<div className="bg-white border rounded-lg overflow-hidden">
|
|
17
|
-
<table className="w-full">
|
|
18
|
-
<thead className="bg-gray-50">
|
|
19
|
-
<tr>
|
|
20
|
-
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
21
|
-
Package
|
|
22
|
-
</th>
|
|
23
|
-
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
24
|
-
Current
|
|
25
|
-
</th>
|
|
26
|
-
<th className="hidden px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
27
|
-
Latest
|
|
28
|
-
</th>
|
|
29
|
-
<th className="hidden px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
30
|
-
Status
|
|
31
|
-
</th>
|
|
32
|
-
<th className="hidden px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
33
|
-
Actions
|
|
34
|
-
</th>
|
|
35
|
-
</tr>
|
|
36
|
-
</thead>
|
|
37
|
-
<tbody className="bg-white divide-y divide-gray-200">
|
|
38
|
-
{dependencies.map(dep => (
|
|
39
|
-
<tr key={dep.name} className="hover:bg-gray-50">
|
|
40
|
-
<td className="px-6 py-4 whitespace-nowrap">
|
|
41
|
-
<div className="text-sm font-medium text-gray-900">
|
|
42
|
-
{dep.name}
|
|
43
|
-
</div>
|
|
44
|
-
</td>
|
|
45
|
-
<td className="px-6 py-4 whitespace-nowrap">
|
|
46
|
-
<span className="text-sm font-mono text-gray-700">
|
|
47
|
-
{dep.version}
|
|
48
|
-
</span>
|
|
49
|
-
</td>
|
|
50
|
-
<td className="hidden px-6 py-4 whitespace-nowrap">
|
|
51
|
-
<span className="text-sm font-mono text-gray-700">
|
|
52
|
-
{dep.latest}
|
|
53
|
-
</span>
|
|
54
|
-
</td>
|
|
55
|
-
<td className="hidden px-6 py-4 whitespace-nowrap">
|
|
56
|
-
<span
|
|
57
|
-
className={`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${getDependencyStatusColor(dep.status)}`}
|
|
58
|
-
>
|
|
59
|
-
{dep.status.replace('-', ' ')}
|
|
60
|
-
</span>
|
|
61
|
-
</td>
|
|
62
|
-
<td className="hidden px-6 py-4 whitespace-nowrap text-sm">
|
|
63
|
-
{dep.status !== 'up-to-date' && (
|
|
64
|
-
<button className="text-blue-600 hover:text-blue-500 flex items-center space-x-1">
|
|
65
|
-
<ArrowUpIcon className="w-4 h-4" />
|
|
66
|
-
<span>Update</span>
|
|
67
|
-
</button>
|
|
68
|
-
)}
|
|
69
|
-
</td>
|
|
70
|
-
</tr>
|
|
71
|
-
))}
|
|
72
|
-
</tbody>
|
|
73
|
-
</table>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
return (
|
|
79
|
-
<div className="py-6">
|
|
80
|
-
{renderDependencyTable(
|
|
81
|
-
packageData.dependenciesInfo.filter(d => d.type == 'dependency'),
|
|
82
|
-
'Dependencies'
|
|
83
|
-
)}
|
|
84
|
-
{renderDependencyTable(
|
|
85
|
-
packageData.dependenciesInfo.filter(d => d.type == 'devDependency'),
|
|
86
|
-
'Dev Dependencies'
|
|
87
|
-
)}
|
|
88
|
-
{renderDependencyTable(
|
|
89
|
-
packageData.dependenciesInfo.filter(d => d.type == 'peerDependency'),
|
|
90
|
-
'Peer Dependencies'
|
|
91
|
-
)}
|
|
92
|
-
|
|
93
|
-
{/* Dependency Summary */}
|
|
94
|
-
<div className="bg-blue-50 border border-blue-200 rounded-lg p-4">
|
|
95
|
-
<h4 className="font-medium text-blue-900 mb-2">Dependency Summary</h4>
|
|
96
|
-
<div className="grid grid-cols-2 md:grid-cols-4 gap-4 text-sm">
|
|
97
|
-
<div>
|
|
98
|
-
<span className="font-medium text-blue-800">
|
|
99
|
-
Total Dependencies:
|
|
100
|
-
</span>
|
|
101
|
-
<span className="ml-2 text-blue-700">
|
|
102
|
-
{
|
|
103
|
-
packageData.dependenciesInfo.filter(d => d.type == 'dependency')
|
|
104
|
-
.length
|
|
105
|
-
}
|
|
106
|
-
</span>
|
|
107
|
-
</div>
|
|
108
|
-
<div>
|
|
109
|
-
<span className="font-medium text-blue-800">Dev Dependencies:</span>
|
|
110
|
-
<span className="ml-2 text-blue-700">
|
|
111
|
-
{
|
|
112
|
-
packageData.dependenciesInfo.filter(
|
|
113
|
-
d => d.type == 'devDependency'
|
|
114
|
-
).length
|
|
115
|
-
}
|
|
116
|
-
</span>
|
|
117
|
-
</div>
|
|
118
|
-
<div>
|
|
119
|
-
<span className="font-medium text-blue-800">
|
|
120
|
-
Peer Dependencies:
|
|
121
|
-
</span>
|
|
122
|
-
<span className="ml-2 text-blue-700">
|
|
123
|
-
{
|
|
124
|
-
packageData.dependenciesInfo.filter(
|
|
125
|
-
d => d.type == 'peerDependency'
|
|
126
|
-
).length
|
|
127
|
-
}
|
|
128
|
-
</span>
|
|
129
|
-
</div>
|
|
130
|
-
<div>
|
|
131
|
-
<span className="font-medium text-blue-800">Outdated:</span>
|
|
132
|
-
<span className="ml-2 text-blue-700">
|
|
133
|
-
{
|
|
134
|
-
packageData.dependenciesInfo.filter(
|
|
135
|
-
d => d.status === 'outdated'
|
|
136
|
-
).length
|
|
137
|
-
}
|
|
138
|
-
</span>
|
|
139
|
-
</div>
|
|
140
|
-
<div>
|
|
141
|
-
<span className="font-medium text-blue-800">Major Updates:</span>
|
|
142
|
-
<span className="ml-2 text-blue-700">
|
|
143
|
-
{
|
|
144
|
-
packageData.dependenciesInfo.filter(
|
|
145
|
-
d => d.status === 'major-update'
|
|
146
|
-
).length
|
|
147
|
-
}
|
|
148
|
-
</span>
|
|
149
|
-
</div>
|
|
150
|
-
</div>
|
|
151
|
-
</div>
|
|
152
|
-
</div>
|
|
153
|
-
);
|
|
154
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ExclamationTriangleIcon } from '../../../../icons/heroicons';
|
|
2
|
-
import { ErrorStateProps } from '../types/packages.types';
|
|
3
|
-
|
|
4
|
-
export default function ErrorState({ error, onRetry }: ErrorStateProps) {
|
|
5
|
-
return (
|
|
6
|
-
<div className="flex items-center justify-center h-64">
|
|
7
|
-
<div className="text-center">
|
|
8
|
-
<ExclamationTriangleIcon className="w-12 h-12 text-red-500 mx-auto" />
|
|
9
|
-
<p className="mt-4 text-red-600">{error}</p>
|
|
10
|
-
{onRetry && (
|
|
11
|
-
<button
|
|
12
|
-
onClick={onRetry}
|
|
13
|
-
className="mt-4 bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors"
|
|
14
|
-
>
|
|
15
|
-
Retry
|
|
16
|
-
</button>
|
|
17
|
-
)}
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
);
|
|
21
|
-
}
|