@monodog/backend 1.4.8 → 1.5.0
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/index.js +4 -2
- package/dist/utils/helpers.js +1 -6
- package/package.json +3 -3
- package/src/index.ts +3 -1
- package/src/types/monorepo-scanner.d.ts +33 -0
- package/src/utils/helpers.ts +2 -2
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/dist/utils/helpers.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getCommits = getCommits;
|
|
7
4
|
exports.storePackage = storePackage;
|
|
8
5
|
exports.storeCommits = storeCommits;
|
|
9
6
|
exports.getPackageDependenciesInfo = getPackageDependenciesInfo;
|
|
10
7
|
exports.storeDependencies = storeDependencies;
|
|
11
|
-
|
|
12
|
-
const path_1 = __importDefault(require("path"));
|
|
13
|
-
dotenv_1.default.config({ path: path_1.default.resolve(__dirname, '../.env') });
|
|
8
|
+
// dotenv.config({ path: path.resolve(__dirname, '../.env') });
|
|
14
9
|
const client_1 = require("@prisma/client");
|
|
15
10
|
const config_loader_1 = require("../config-loader");
|
|
16
11
|
const appConfig = (0, config_loader_1.loadConfig)();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monodog/backend",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
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/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
|
+
}
|
package/src/utils/helpers.ts
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
PackageInfo,
|
|
5
5
|
DependencyInfo,
|
|
6
6
|
} from '@monodog/utils/helpers'
|
|
7
|
-
import dotenv from 'dotenv';
|
|
7
|
+
// import dotenv from 'dotenv';
|
|
8
8
|
import path from 'path';
|
|
9
|
-
dotenv.config({ path: path.resolve(__dirname, '../.env') });
|
|
9
|
+
// dotenv.config({ path: path.resolve(__dirname, '../.env') });
|
|
10
10
|
import { PrismaClient, Prisma, Commit } from '@prisma/client';
|
|
11
11
|
import { loadConfig } from '../config-loader';
|
|
12
12
|
|