@monodog/backend 1.4.7 → 1.4.9
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/dist/cli.js +1 -1
- package/dist/index.js +4 -2
- package/package.json +3 -3
- package/src/cli.ts +1 -1
- package/src/index.ts +3 -1
- package/src/types/monorepo-scanner.d.ts +33 -0
package/dist/cli.js
CHANGED
|
@@ -132,7 +132,7 @@ function copyPackageToWorkspace(rootDir) {
|
|
|
132
132
|
console.error("Error: Please provide the package name as an argument if you want to setup dashboard.");
|
|
133
133
|
console.log("Usage: pnpm monodog-cli @monodog/dashboard --serve --root .");
|
|
134
134
|
}
|
|
135
|
-
if (packageName
|
|
135
|
+
if (!(packageName == '@monodog/backend' || packageName == '@monodog/dashboard')) {
|
|
136
136
|
console.log("\n--- Skipping workspace setup for @monodog/backend to avoid self-copying. ---");
|
|
137
137
|
return;
|
|
138
138
|
}
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.scanner = void 0;
|
|
6
7
|
exports.startServer = startServer;
|
|
7
8
|
const express_1 = __importDefault(require("express"));
|
|
8
9
|
const cors_1 = __importDefault(require("cors"));
|
|
@@ -10,6 +11,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
10
11
|
const fs_1 = __importDefault(require("fs"));
|
|
11
12
|
const body_parser_1 = require("body-parser");
|
|
12
13
|
const monorepo_scanner_1 = require("@monodog/monorepo-scanner");
|
|
14
|
+
exports.scanner = new monorepo_scanner_1.MonorepoScanner();
|
|
13
15
|
const ci_status_1 = require("@monodog/ci-status");
|
|
14
16
|
const helpers_1 = require("@monodog/utils/helpers");
|
|
15
17
|
const helpers_2 = require("./utils/helpers");
|
|
@@ -334,7 +336,7 @@ function startServer(rootPath, port, host) {
|
|
|
334
336
|
try {
|
|
335
337
|
const { force } = _req.body;
|
|
336
338
|
if (force) {
|
|
337
|
-
|
|
339
|
+
exports.scanner.clearCache();
|
|
338
340
|
}
|
|
339
341
|
const result = await (0, monorepo_scanner_1.quickScan)();
|
|
340
342
|
res.json({
|
|
@@ -369,7 +371,7 @@ function startServer(rootPath, port, host) {
|
|
|
369
371
|
return res.status(400).json({ error: 'Invalid export format' });
|
|
370
372
|
}
|
|
371
373
|
const result = await (0, monorepo_scanner_1.quickScan)();
|
|
372
|
-
const exportData =
|
|
374
|
+
const exportData = exports.scanner.exportResults(result, format);
|
|
373
375
|
if (format === 'json') {
|
|
374
376
|
res.json(result);
|
|
375
377
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monodog/backend",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.9",
|
|
4
4
|
"description": "Backend API server for monodog monorepo dashboard",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"migrate": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') prisma migrate dev",
|
|
22
22
|
"serve": "DATABASE_URL=$(npm run db:url --silent 2>/dev/null | tr -d '\\n') node dist/cli.js --serve --root ../../" },
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@monodog/ci-status": "1.1.
|
|
24
|
+
"@monodog/ci-status": "1.1.2",
|
|
25
25
|
"@monodog/monorepo-scanner": "1.0.7",
|
|
26
|
-
"@monodog/utils": "1.0.
|
|
26
|
+
"@monodog/utils": "1.0.1",
|
|
27
27
|
"@prisma/client": "^5.7.0",
|
|
28
28
|
"body-parser": "^1.20.2",
|
|
29
29
|
"cors": "^2.8.5",
|
package/src/cli.ts
CHANGED
|
@@ -108,7 +108,7 @@ function copyPackageToWorkspace(rootDir: string): void {
|
|
|
108
108
|
console.error("Error: Please provide the package name as an argument if you want to setup dashboard.");
|
|
109
109
|
console.log("Usage: pnpm monodog-cli @monodog/dashboard --serve --root .");
|
|
110
110
|
}
|
|
111
|
-
if(packageName
|
|
111
|
+
if(!(packageName == '@monodog/backend' || packageName == '@monodog/dashboard')){
|
|
112
112
|
console.log("\n--- Skipping workspace setup for @monodog/backend to avoid self-copying. ---");
|
|
113
113
|
return;
|
|
114
114
|
}
|
package/src/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ import path from 'path';
|
|
|
4
4
|
import fs from 'fs';
|
|
5
5
|
import { json } from 'body-parser';
|
|
6
6
|
import {
|
|
7
|
-
|
|
7
|
+
MonorepoScanner,
|
|
8
8
|
quickScan,
|
|
9
9
|
generateReports,
|
|
10
10
|
funCheckBuildStatus,
|
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
funCheckLintStatus,
|
|
13
13
|
funCheckSecurityAudit,
|
|
14
14
|
} from '@monodog/monorepo-scanner';
|
|
15
|
+
export const scanner = new MonorepoScanner();
|
|
16
|
+
|
|
15
17
|
import { ciStatusManager, getMonorepoCIStatus } from '@monodog/ci-status';
|
|
16
18
|
import {
|
|
17
19
|
scanMonorepo,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// This declaration explicitly tells TypeScript about the specific functions
|
|
2
|
+
// exported by the '@monodog/monorepo-scanner' package, bypassing TS7016 errors.
|
|
3
|
+
|
|
4
|
+
declare module '@monodog/monorepo-scanner' {
|
|
5
|
+
/**
|
|
6
|
+
* Declares the exported function 'funCheckSecurityAudit'.
|
|
7
|
+
* The actual implementation and return type reside in the source package.
|
|
8
|
+
*/
|
|
9
|
+
export function funCheckSecurityAudit(options?: any): any;
|
|
10
|
+
export function funCheckTestCoverage(options?: any): any;
|
|
11
|
+
export function funCheckLintStatus(options?: any): any;
|
|
12
|
+
export function funCheckBuildStatus(options?: any): any;
|
|
13
|
+
export function generateReports(options?: any): any;
|
|
14
|
+
export function quickScan(options?: any): any;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Defines the exported class structure, including the constructor
|
|
18
|
+
* and the methods used in the backend.
|
|
19
|
+
*/
|
|
20
|
+
export class MonorepoScanner {
|
|
21
|
+
// Constructor (when called with `new`)
|
|
22
|
+
constructor(options?: any);
|
|
23
|
+
|
|
24
|
+
/** * Resets any internal cache state for the scanner.
|
|
25
|
+
*/
|
|
26
|
+
clearCache(): void;
|
|
27
|
+
|
|
28
|
+
/** * Retrieves the processed results from the scan.
|
|
29
|
+
*/
|
|
30
|
+
exportResults(result: any, format: 'json' | 'csv' | 'html'): any;
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
}
|