@monodog/backend 1.1.12 → 1.1.17
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 +1 -1
- package/dist/index.js +22 -12
- package/package.json +4 -5
- package/src/index.ts +14 -3
- package/tsconfig.json +2 -1
package/.turbo/turbo-build.log
CHANGED
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
10
10
|
const fs_1 = __importDefault(require("fs"));
|
|
11
11
|
// import { glob } from 'glob';
|
|
12
12
|
const body_parser_1 = require("body-parser");
|
|
13
|
-
const
|
|
13
|
+
const monorepo_scanner_1 = require("@monodog/monorepo-scanner");
|
|
14
14
|
const ci_status_1 = require("@monodog/ci-status");
|
|
15
15
|
const helpers_1 = require("@monodog/utils/helpers");
|
|
16
16
|
const helpers_2 = require("./utils/helpers");
|
|
@@ -166,8 +166,8 @@ function startServer(rootPath) {
|
|
|
166
166
|
? JSON.parse(pkg.peerDependencies)
|
|
167
167
|
: [];
|
|
168
168
|
// Get additional package information
|
|
169
|
-
const reports = await (0,
|
|
170
|
-
const packageReport = reports.find(r => r.package.name === name);
|
|
169
|
+
const reports = await (0, monorepo_scanner_1.generateReports)();
|
|
170
|
+
const packageReport = reports.find((r) => r.package.name === name);
|
|
171
171
|
const result = {
|
|
172
172
|
...transformedPkg,
|
|
173
173
|
report: packageReport,
|
|
@@ -349,9 +349,9 @@ function startServer(rootPath) {
|
|
|
349
349
|
try {
|
|
350
350
|
const { force } = _req.body;
|
|
351
351
|
if (force) {
|
|
352
|
-
|
|
352
|
+
monorepo_scanner_1.scanner.clearCache();
|
|
353
353
|
}
|
|
354
|
-
const result = await (0,
|
|
354
|
+
const result = await (0, monorepo_scanner_1.quickScan)();
|
|
355
355
|
res.json({
|
|
356
356
|
success: true,
|
|
357
357
|
message: 'Scan completed successfully',
|
|
@@ -368,7 +368,7 @@ function startServer(rootPath) {
|
|
|
368
368
|
// Get scan results
|
|
369
369
|
app.get('/api/scan/results', async (_req, res) => {
|
|
370
370
|
try {
|
|
371
|
-
const result = await (0,
|
|
371
|
+
const result = await (0, monorepo_scanner_1.quickScan)();
|
|
372
372
|
res.json(result);
|
|
373
373
|
}
|
|
374
374
|
catch (error) {
|
|
@@ -383,8 +383,8 @@ function startServer(rootPath) {
|
|
|
383
383
|
if (!['json', 'csv', 'html'].includes(format)) {
|
|
384
384
|
return res.status(400).json({ error: 'Invalid export format' });
|
|
385
385
|
}
|
|
386
|
-
const result = await (0,
|
|
387
|
-
const exportData =
|
|
386
|
+
const result = await (0, monorepo_scanner_1.quickScan)();
|
|
387
|
+
const exportData = monorepo_scanner_1.scanner.exportResults(result, format);
|
|
388
388
|
if (format === 'json') {
|
|
389
389
|
res.json(result);
|
|
390
390
|
}
|
|
@@ -534,10 +534,10 @@ function startServer(rootPath) {
|
|
|
534
534
|
const healthMetrics = await Promise.all(packages.map(async (pkg) => {
|
|
535
535
|
try {
|
|
536
536
|
// Await each health check function since they return promises
|
|
537
|
-
const buildStatus = await (0,
|
|
538
|
-
const testCoverage = await (0,
|
|
539
|
-
const lintStatus = await (0,
|
|
540
|
-
const securityAudit = await (0,
|
|
537
|
+
const buildStatus = await (0, monorepo_scanner_1.funCheckBuildStatus)(pkg);
|
|
538
|
+
const testCoverage = await (0, monorepo_scanner_1.funCheckTestCoverage)(pkg);
|
|
539
|
+
const lintStatus = await (0, monorepo_scanner_1.funCheckLintStatus)(pkg);
|
|
540
|
+
const securityAudit = await (0, monorepo_scanner_1.funCheckSecurityAudit)(pkg);
|
|
541
541
|
// Calculate overall health score
|
|
542
542
|
const overallScore = (0, helpers_1.calculatePackageHealth)(buildStatus, testCoverage, lintStatus, securityAudit);
|
|
543
543
|
const health = {
|
|
@@ -1126,6 +1126,16 @@ function startServer(rootPath) {
|
|
|
1126
1126
|
process.exit(1);
|
|
1127
1127
|
}
|
|
1128
1128
|
});
|
|
1129
|
+
const appD = (0, express_1.default)();
|
|
1130
|
+
// Serve static files from the 'dist' directory
|
|
1131
|
+
appD.use(express_1.default.static(rootPath + '/apps/dashboard/dist'));
|
|
1132
|
+
// For any other routes, serve the index.html
|
|
1133
|
+
appD.get('*', (req, res) => {
|
|
1134
|
+
res.sendFile(path_1.default.join(rootPath, '/apps/dashboard/dist', 'index.html'));
|
|
1135
|
+
});
|
|
1136
|
+
appD.listen(3000, () => {
|
|
1137
|
+
console.log(`dashboard Server listening at http://localhost:${3000}`);
|
|
1138
|
+
});
|
|
1129
1139
|
// export default app;
|
|
1130
1140
|
// const overallScore =
|
|
1131
1141
|
// healthMetrics.reduce((sum, h) => sum + h.health!.overallScore, 0) /
|
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monodog/backend",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.17",
|
|
4
4
|
"description": "Backend API server for monodog monorepo dashboard",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
6
|
"license": "MIT",
|
|
8
7
|
"bin": {
|
|
9
8
|
"monodog-cli": "dist/cli.js"
|
|
10
9
|
},
|
|
11
10
|
"dependencies": {
|
|
12
11
|
"@monodog/ci-status": "1.1.1",
|
|
13
|
-
"@monodog/monorepo-scanner": "1.0.
|
|
12
|
+
"@monodog/monorepo-scanner": "1.0.7",
|
|
14
13
|
"@monodog/utils": "1.0.0",
|
|
15
14
|
"@prisma/client": "^5.7.0",
|
|
16
15
|
"body-parser": "^1.20.2",
|
|
@@ -20,13 +19,13 @@
|
|
|
20
19
|
"prisma": "^5.22.0"
|
|
21
20
|
},
|
|
22
21
|
"devDependencies": {
|
|
22
|
+
"typescript": "^5.3.8",
|
|
23
23
|
"@types/body-parser": "^1.19.5",
|
|
24
24
|
"@types/cors": "^2.8.17",
|
|
25
25
|
"@types/dotenv": "^8.2.0",
|
|
26
26
|
"@types/express": "^4.17.21",
|
|
27
27
|
"@types/node": "^20.10.0",
|
|
28
|
-
"tsx": "^4.6.0"
|
|
29
|
-
"typescript": "^5.9.3"
|
|
28
|
+
"tsx": "^4.6.0"
|
|
30
29
|
},
|
|
31
30
|
"scripts": {
|
|
32
31
|
"dev": "tsx watch src/index.ts",
|
package/src/index.ts
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
funCheckTestCoverage,
|
|
13
13
|
funCheckLintStatus,
|
|
14
14
|
funCheckSecurityAudit,
|
|
15
|
-
} from '@monodog/monorepo-scanner
|
|
15
|
+
} from '@monodog/monorepo-scanner';
|
|
16
16
|
import { ciStatusManager, getMonorepoCIStatus } from '@monodog/ci-status';
|
|
17
17
|
import {
|
|
18
18
|
scanMonorepo,
|
|
@@ -202,8 +202,8 @@ app.get('/api/packages/:name', async (_req, res) => {
|
|
|
202
202
|
? JSON.parse(pkg.peerDependencies)
|
|
203
203
|
: [];
|
|
204
204
|
// Get additional package information
|
|
205
|
-
const reports = await generateReports();
|
|
206
|
-
const packageReport = reports.find(r => r.package.name === name);
|
|
205
|
+
const reports: any[] = await generateReports();
|
|
206
|
+
const packageReport = reports.find((r: any) => r.package.name === name);
|
|
207
207
|
|
|
208
208
|
const result = {
|
|
209
209
|
...transformedPkg,
|
|
@@ -1298,7 +1298,18 @@ app.listen(PORT, () => {
|
|
|
1298
1298
|
process.exit(1);
|
|
1299
1299
|
}
|
|
1300
1300
|
});
|
|
1301
|
+
const appD = express();
|
|
1302
|
+
// Serve static files from the 'dist' directory
|
|
1303
|
+
appD.use(express.static(rootPath + '/apps/dashboard/dist'));
|
|
1301
1304
|
|
|
1305
|
+
// For any other routes, serve the index.html
|
|
1306
|
+
appD.get('*', (req, res) => {
|
|
1307
|
+
res.sendFile(path.join(rootPath, '/apps/dashboard/dist', 'index.html'));
|
|
1308
|
+
});
|
|
1309
|
+
|
|
1310
|
+
appD.listen(3000, () => {
|
|
1311
|
+
console.log(`dashboard Server listening at http://localhost:${3000}`);
|
|
1312
|
+
});
|
|
1302
1313
|
// export default app;
|
|
1303
1314
|
|
|
1304
1315
|
// const overallScore =
|
package/tsconfig.json
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "es2020",
|
|
4
4
|
"module": "NodeNext",
|
|
5
|
-
"moduleResolution": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
6
|
"esModuleInterop": true,
|
|
7
7
|
"forceConsistentCasingInFileNames": true,
|
|
8
8
|
"strict": true,
|
|
9
9
|
"skipLibCheck": true,
|
|
10
10
|
"outDir": "./dist",
|
|
11
11
|
"rootDir": "./src",
|
|
12
|
+
"allowJs": true
|
|
12
13
|
|
|
13
14
|
},
|
|
14
15
|
"include": ["src/**/*"]
|