@manojkmfsi/monodog 1.0.18 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +4 -0
- package/CHANGELOG.md +6 -0
- package/dist/controllers/commitController.js +24 -0
- package/dist/controllers/configController.js +43 -0
- package/dist/controllers/healthController.js +27 -0
- package/dist/controllers/packageController.js +65 -0
- package/dist/index.js +12 -1280
- package/dist/routes/commitRoutes.js +12 -0
- package/dist/routes/configRoutes.js +15 -0
- package/dist/routes/healthRoutes.js +15 -0
- package/dist/routes/packageRoutes.js +21 -0
- package/dist/services/commitService.js +44 -0
- package/dist/services/configService.js +372 -0
- package/dist/services/healthService.js +166 -0
- package/dist/services/packageService.js +137 -0
- package/dist/setup.js +0 -0
- package/dist/utils/{helpers.js → db-utils.js} +1 -14
- package/dist/utils/health-utils.js +54 -0
- package/dist/utils/utilities.js +3 -89
- package/monodog-dashboard/README.md +58 -0
- package/monodog-dashboard/dist/assets/{index-2099b079.js → index-dadb5f0d.js} +1 -1
- package/monodog-dashboard/dist/index.html +1 -1
- package/package.json +18 -18
- package/src/controllers/commitController.ts +28 -0
- package/src/controllers/configController.ts +40 -0
- package/src/controllers/healthController.ts +22 -0
- package/src/controllers/packageController.ts +65 -0
- package/src/index.ts +14 -1439
- package/src/routes/commitRoutes.ts +10 -0
- package/src/routes/configRoutes.ts +14 -0
- package/src/routes/healthRoutes.ts +14 -0
- package/src/routes/packageRoutes.ts +22 -0
- package/src/services/commitService.ts +44 -0
- package/src/services/configService.ts +377 -0
- package/src/services/healthService.ts +155 -0
- package/src/services/packageService.ts +115 -0
- package/src/utils/{helpers.ts → db-utils.ts} +7 -20
- package/src/utils/health-utils.ts +73 -0
- package/src/utils/monorepo-scanner.ts +0 -1
- package/src/utils/utilities.ts +4 -120
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCommitsByPath = void 0;
|
|
4
|
+
const commitService_1 = require("../services/commitService");
|
|
5
|
+
const getCommitsByPath = async (_req, res) => {
|
|
6
|
+
try {
|
|
7
|
+
const { packagePath } = _req.params;
|
|
8
|
+
const decodedPath = decodeURIComponent(packagePath);
|
|
9
|
+
console.log('🔍 Fetching commits for path:', decodedPath);
|
|
10
|
+
console.log('📁 Current working directory:', process.cwd());
|
|
11
|
+
const commits = await (0, commitService_1.getCommitsByPathService)(decodedPath);
|
|
12
|
+
console.log(`✅ Successfully fetched ${commits.length} commits for ${decodedPath}`);
|
|
13
|
+
res.json(commits);
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
console.error('💥 Error fetching commit details:', error);
|
|
17
|
+
res.status(500).json({
|
|
18
|
+
error: 'Failed to fetch commit details',
|
|
19
|
+
message: error.message,
|
|
20
|
+
stack: process.env.NODE_ENV === 'development' ? error.stack : undefined,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.getCommitsByPath = getCommitsByPath;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateConfigFile = exports.getConfigurationFiles = void 0;
|
|
4
|
+
const configService_1 = require("../services/configService");
|
|
5
|
+
const getConfigurationFiles = async (_req, res) => {
|
|
6
|
+
try {
|
|
7
|
+
const rootDir = _req.app.locals.rootPath;
|
|
8
|
+
console.log('Monorepo root directory:', rootDir);
|
|
9
|
+
const configFiles = await (0, configService_1.getConfigurationFilesService)(rootDir);
|
|
10
|
+
res.json(configFiles);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
console.error('Error fetching configuration files:', error);
|
|
14
|
+
res.status(500).json({
|
|
15
|
+
success: false,
|
|
16
|
+
error: 'Failed to fetch configuration files',
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.getConfigurationFiles = getConfigurationFiles;
|
|
21
|
+
const updateConfigFile = async (_req, res) => {
|
|
22
|
+
try {
|
|
23
|
+
const { id } = _req.params;
|
|
24
|
+
const { content } = _req.body;
|
|
25
|
+
if (!content) {
|
|
26
|
+
return res.status(400).json({
|
|
27
|
+
success: false,
|
|
28
|
+
error: 'Content is required',
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const rootDir = _req.app.locals.rootPath;
|
|
32
|
+
const result = await (0, configService_1.updateConfigFileService)(id, rootDir, content);
|
|
33
|
+
res.json(result);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
console.error('Error saving configuration file:', error);
|
|
37
|
+
res.status(500).json({
|
|
38
|
+
success: false,
|
|
39
|
+
error: 'Failed to save configuration file',
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.updateConfigFile = updateConfigFile;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.refreshHealth = exports.getPackagesHealth = void 0;
|
|
4
|
+
const healthService_1 = require("../services/healthService");
|
|
5
|
+
const getPackagesHealth = async (_req, res) => {
|
|
6
|
+
try {
|
|
7
|
+
const health = await (0, healthService_1.getHealthSummaryService)();
|
|
8
|
+
res.json(health);
|
|
9
|
+
}
|
|
10
|
+
catch (error) {
|
|
11
|
+
console.error('Error fetching health data from database:', error);
|
|
12
|
+
res
|
|
13
|
+
.status(500)
|
|
14
|
+
.json({ error: 'Failed to fetch health data from database' });
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
exports.getPackagesHealth = getPackagesHealth;
|
|
18
|
+
const refreshHealth = async (_req, res) => {
|
|
19
|
+
try {
|
|
20
|
+
const health = await (0, healthService_1.healthRefreshService)(_req.app.locals.rootPath);
|
|
21
|
+
res.json(health);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
res.status(500).json({ error: 'Failed to fetch health metrics' });
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.refreshHealth = refreshHealth;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updatePackageConfig = exports.getPackageDetail = exports.refreshPackages = exports.getPackages = void 0;
|
|
4
|
+
const configService_1 = require("../services/configService");
|
|
5
|
+
const packageService_1 = require("../services/packageService");
|
|
6
|
+
const getPackages = async (_req, res) => {
|
|
7
|
+
try {
|
|
8
|
+
const transformedPackages = await (0, packageService_1.getPackagesService)(_req.app.locals.rootPath);
|
|
9
|
+
res.json(transformedPackages);
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
res.status(500).json({ error: 'Failed to fetch packages, ' + error });
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
exports.getPackages = getPackages;
|
|
16
|
+
const refreshPackages = async (_req, res) => {
|
|
17
|
+
console.log('Refreshing packages from source...' + _req.app.locals.rootPath);
|
|
18
|
+
try {
|
|
19
|
+
const packages = await (0, packageService_1.refreshPackagesService)(_req.app.locals.rootPath);
|
|
20
|
+
res.json(packages);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
res.status(500).json({ error: 'Failed to refresh packages' });
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.refreshPackages = refreshPackages;
|
|
27
|
+
const getPackageDetail = async (_req, res) => {
|
|
28
|
+
const { name } = _req.params;
|
|
29
|
+
try {
|
|
30
|
+
const packageDetail = await (0, packageService_1.getPackageDetailService)(name);
|
|
31
|
+
res.json(packageDetail);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
res.status(500).json({ error: 'Failed to fetch package details' });
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.getPackageDetail = getPackageDetail;
|
|
38
|
+
const updatePackageConfig = async (req, res) => {
|
|
39
|
+
try {
|
|
40
|
+
const { packageName, config, packagePath } = req.body;
|
|
41
|
+
if (!packageName || !config || !packagePath) {
|
|
42
|
+
return res.status(400).json({
|
|
43
|
+
success: false,
|
|
44
|
+
error: 'Package name, configuration, and package path are required',
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
console.log('💾 Updating package configuration for:', packageName);
|
|
48
|
+
console.log('📁 Package path:', packagePath);
|
|
49
|
+
const updatedPackage = await (0, configService_1.updatePackageConfigurationService)(packagePath, packageName, config);
|
|
50
|
+
return res.json({
|
|
51
|
+
success: true,
|
|
52
|
+
message: 'Package configuration updated successfully',
|
|
53
|
+
package: updatedPackage,
|
|
54
|
+
preservedFields: true,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
return res.status(500).json({
|
|
59
|
+
success: false,
|
|
60
|
+
error: 'Failed to update package configuration',
|
|
61
|
+
message: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
exports.updatePackageConfig = updatePackageConfig;
|