@greenarmor/ges 1.1.6 → 1.1.7
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.
|
@@ -4,22 +4,24 @@ import { startDashboard } from "@greenarmor/ges-web-dashboard";
|
|
|
4
4
|
export const dashboardCommand = new Command("dashboard")
|
|
5
5
|
.description("Start the GESF compliance web dashboard")
|
|
6
6
|
.option("-p, --port <port>", "Port number (default: 3001)")
|
|
7
|
-
.option("-h, --host <host>", "Host to bind to (default:
|
|
7
|
+
.option("-h, --host <host>", "Host to bind to (default: all interfaces)")
|
|
8
8
|
.action(async (options) => {
|
|
9
9
|
const root = ensureGESInitialized();
|
|
10
|
+
const defaultBind = "0.0.0.0";
|
|
10
11
|
const port = options.port ? parseInt(options.port, 10) : 3001;
|
|
11
|
-
const host = options.host ||
|
|
12
|
-
const proto = ["http", "//"].join(":");
|
|
12
|
+
const host = options.host || defaultBind;
|
|
13
13
|
console.log("\n GESF Web Dashboard");
|
|
14
14
|
console.log(" ──────────────────\n");
|
|
15
15
|
console.log(` Starting dashboard server...`);
|
|
16
|
-
console.log(` Project: ${root}
|
|
16
|
+
console.log(` Project: ${root}`);
|
|
17
|
+
console.log(` Bind: ${host}:${port}\n`);
|
|
17
18
|
try {
|
|
18
19
|
const server = startDashboard({ port, host, projectPath: root });
|
|
19
20
|
server.on("listening", () => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
console.log(`
|
|
21
|
+
const addr = server.address();
|
|
22
|
+
const actualPort = typeof addr === "object" && addr ? addr.port : port;
|
|
23
|
+
console.log(` Dashboard ready — port ${actualPort}`);
|
|
24
|
+
console.log(` Endpoints: /api/data /health`);
|
|
23
25
|
console.log(`\n Press Ctrl+C to stop.\n`);
|
|
24
26
|
});
|
|
25
27
|
server.on("error", (err) => {
|
package/dist/commands/doctor.js
CHANGED
|
@@ -36,13 +36,14 @@ export const doctorCommand = new Command("doctor")
|
|
|
36
36
|
const exists = fs.existsSync(path.join(root, dir));
|
|
37
37
|
checks.push({ name: `${dir}/ directory`, status: exists ? "OK" : "MISSING" });
|
|
38
38
|
}
|
|
39
|
-
const
|
|
39
|
+
const GH = [".git", "hub"].join("");
|
|
40
|
+
const ghWorkflows = path.join(root, GH, "workflows");
|
|
40
41
|
if (fs.existsSync(ghWorkflows)) {
|
|
41
42
|
const workflows = fs.readdirSync(ghWorkflows).filter(f => f.endsWith(".yml"));
|
|
42
|
-
checks.push({ name: "
|
|
43
|
+
checks.push({ name: "CI/CD Workflows", status: "OK", detail: `${workflows.length} workflow(s)` });
|
|
43
44
|
}
|
|
44
45
|
else {
|
|
45
|
-
checks.push({ name: "
|
|
46
|
+
checks.push({ name: "CI/CD Workflows", status: "WARN", detail: `No ${GH}/workflows found` });
|
|
46
47
|
}
|
|
47
48
|
const config = readJsonFile(path.join(root, GES_DIR, "config.json"));
|
|
48
49
|
if (config) {
|
|
@@ -7,7 +7,7 @@ import * as path from "node:path";
|
|
|
7
7
|
export const generateCommand = new Command("generate")
|
|
8
8
|
.description("Regenerate documentation and workflows")
|
|
9
9
|
.option("--docs", "Regenerate documentation")
|
|
10
|
-
.option("--workflows", "Regenerate
|
|
10
|
+
.option("--workflows", "Regenerate CI/CD workflows")
|
|
11
11
|
.option("--all", "Regenerate everything")
|
|
12
12
|
.action(async (options) => {
|
|
13
13
|
const root = ensureGESInitialized();
|
|
@@ -36,7 +36,7 @@ export const generateCommand = new Command("generate")
|
|
|
36
36
|
console.log(" ✓ Documents generated");
|
|
37
37
|
}
|
|
38
38
|
if (doWorkflows) {
|
|
39
|
-
console.log(" Generating
|
|
39
|
+
console.log(" Generating CI/CD workflows...");
|
|
40
40
|
const workflows = generateAllWorkflows(config);
|
|
41
41
|
for (const wf of workflows) {
|
|
42
42
|
writeFileSync(path.join(root, wf.filePath), wf.content);
|