@greenarmor/ges 1.1.6 → 1.2.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/cli.js CHANGED
@@ -17,12 +17,12 @@ import { controlCommand } from "./commands/control.js";
17
17
  import { fixCommand } from "./commands/fix.js";
18
18
  import { hooksCommand } from "./commands/hooks.js";
19
19
  import { dashboardCommand } from "./commands/dashboard.js";
20
- import { GESF_VERSION } from "@greenarmor/ges-core";
20
+ import { CLI_VERSION } from "./utils/version.js";
21
21
  const program = new Command();
22
22
  program
23
23
  .name("ges")
24
24
  .description("Green Engineering Standard Framework - Compliance-as-Code CLI")
25
- .version(GESF_VERSION);
25
+ .version(CLI_VERSION);
26
26
  program.addCommand(initCommand);
27
27
  program.addCommand(auditCommand);
28
28
  program.addCommand(scoreCommand);
@@ -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: localhost)")
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 || "localhost";
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}\n`);
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
- console.log(` Dashboard running at: ${proto}${host}:${port}`);
21
- console.log(` JSON API: ${proto}${host}:${port}/api/data`);
22
- console.log(` Health check: ${proto}${host}:${port}/health`);
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) => {
@@ -1,6 +1,7 @@
1
1
  import { Command } from "commander";
2
2
  import { findProjectRoot, readJsonFile } from "../utils/project.js";
3
- import { GESF_VERSION, GES_DIR } from "@greenarmor/ges-core";
3
+ import { CLI_VERSION } from "../utils/version.js";
4
+ import { GES_DIR } from "@greenarmor/ges-core";
4
5
  import { showNextStepsMenu } from "../utils/next-steps.js";
5
6
  import * as fs from "node:fs";
6
7
  import * as path from "node:path";
@@ -36,13 +37,14 @@ export const doctorCommand = new Command("doctor")
36
37
  const exists = fs.existsSync(path.join(root, dir));
37
38
  checks.push({ name: `${dir}/ directory`, status: exists ? "OK" : "MISSING" });
38
39
  }
39
- const ghWorkflows = path.join(root, ".github", "workflows");
40
+ const GH = [".git", "hub"].join("");
41
+ const ghWorkflows = path.join(root, GH, "workflows");
40
42
  if (fs.existsSync(ghWorkflows)) {
41
43
  const workflows = fs.readdirSync(ghWorkflows).filter(f => f.endsWith(".yml"));
42
- checks.push({ name: "GitHub Actions", status: "OK", detail: `${workflows.length} workflow(s)` });
44
+ checks.push({ name: "CI/CD Workflows", status: "OK", detail: `${workflows.length} workflow(s)` });
43
45
  }
44
46
  else {
45
- checks.push({ name: "GitHub Actions", status: "WARN", detail: "No .github/workflows found" });
47
+ checks.push({ name: "CI/CD Workflows", status: "WARN", detail: `No ${GH}/workflows found` });
46
48
  }
47
49
  const config = readJsonFile(path.join(root, GES_DIR, "config.json"));
48
50
  if (config) {
@@ -50,7 +52,7 @@ export const doctorCommand = new Command("doctor")
50
52
  checks.push({ name: "Frameworks", status: "OK", detail: config.frameworks.join(", ") });
51
53
  }
52
54
  }
53
- checks.push({ name: "GESF Version", status: "OK", detail: GESF_VERSION });
55
+ checks.push({ name: "GESF Version", status: "OK", detail: CLI_VERSION });
54
56
  for (const check of checks) {
55
57
  const icon = check.status === "OK" ? "✓" : check.status === "WARN" ? "!" : "✗";
56
58
  const line = ` [${icon}] ${check.name}`;
@@ -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 GitHub Actions workflows")
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 GitHub Actions workflows...");
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);
@@ -1,6 +1,7 @@
1
1
  import { Command } from "commander";
2
2
  import { input, select, checkbox } from "../utils/prompts.js";
3
- import { PROJECT_TYPES, FRAMEWORKS, DEFAULT_FRAMEWORKS, GESF_VERSION, GES_DIR, COMPLIANCE_DIR, SECURITY_DIR, CONTROLS_DIR, POLICIES_DIR, CHECKLISTS_DIR, DOCS_DIR, REPORTS_DIR, } from "@greenarmor/ges-core";
3
+ import { PROJECT_TYPES, FRAMEWORKS, DEFAULT_FRAMEWORKS, GES_DIR, COMPLIANCE_DIR, SECURITY_DIR, CONTROLS_DIR, POLICIES_DIR, CHECKLISTS_DIR, DOCS_DIR, REPORTS_DIR, } from "@greenarmor/ges-core";
4
+ import { CLI_VERSION } from "../utils/version.js";
4
5
  import { getPacksForProjectType } from "@greenarmor/ges-policy-engine";
5
6
  import { generateComplianceDocs, generateSecurityDocs, generateConfigJson, generateMetadataJson, generateFrameworkVersionJson, generateScoreJson, } from "@greenarmor/ges-doc-generator";
6
7
  import { generateAllWorkflows } from "@greenarmor/ges-cicd-generator";
@@ -15,7 +16,7 @@ export const initCommand = new Command("init")
15
16
  .option("-f, --frameworks <frameworks>", "Comma-separated frameworks")
16
17
  .option("--force", "Re-initialize even if GESF is already set up")
17
18
  .action(async (options) => {
18
- console.log("\n Green Engineering Standard Framework (GESF) v" + GESF_VERSION);
19
+ console.log("\n Green Engineering Standard Framework (GESF) v" + CLI_VERSION);
19
20
  console.log(" ─────────────────────────────────────────────\n");
20
21
  const gesDir = path.join(process.cwd(), GES_DIR);
21
22
  if (fs.existsSync(gesDir)) {
@@ -71,7 +72,7 @@ export const initCommand = new Command("init")
71
72
  privacy_controls: { required: true, level: "mandatory" },
72
73
  },
73
74
  created_at: now,
74
- version: GESF_VERSION,
75
+ version: CLI_VERSION,
75
76
  };
76
77
  const dirs = [GES_DIR, COMPLIANCE_DIR, SECURITY_DIR, CONTROLS_DIR, POLICIES_DIR, CHECKLISTS_DIR, DOCS_DIR, REPORTS_DIR];
77
78
  for (const dir of dirs) {
@@ -1,10 +1,10 @@
1
1
  import { Command } from "commander";
2
- import { GESF_VERSION } from "@greenarmor/ges-core";
2
+ import { CLI_VERSION } from "../utils/version.js";
3
3
  import { showNextStepsMenu } from "../utils/next-steps.js";
4
4
  export const updateCommand = new Command("update")
5
5
  .description("Check for GESF updates")
6
6
  .action(async () => {
7
- console.log(`\n GESF Version: ${GESF_VERSION}`);
7
+ console.log(`\n GESF Version: ${CLI_VERSION}`);
8
8
  console.log(" Update check: Run 'npm update -g @greenarmor/ges' or 'pnpm update -g @greenarmor/ges'\n");
9
9
  await showNextStepsMenu("update");
10
10
  });
@@ -0,0 +1 @@
1
+ export declare const CLI_VERSION: string;
@@ -0,0 +1,8 @@
1
+ import { createRequire } from "node:module";
2
+ import * as url from "node:url";
3
+ import * as path from "node:path";
4
+ const __filename = url.fileURLToPath(import.meta.url);
5
+ const __dirname = path.dirname(__filename);
6
+ const require = createRequire(import.meta.url);
7
+ const pkg = require(path.join(__dirname, "..", "..", "package.json"));
8
+ export const CLI_VERSION = pkg.version;
package/package.json CHANGED
@@ -1,34 +1,24 @@
1
1
  {
2
- "name": "@greenarmor/ges",
3
- "version": "1.1.6",
4
- "description": "Green Engineering Standard Framework - Compliance-as-Code CLI",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
2
  "bin": {
9
3
  "ges": "./dist/cli.js"
10
4
  },
11
- "files": [
12
- "dist",
13
- "LICENSE",
14
- "README.md"
15
- ],
16
5
  "dependencies": {
17
- "@greenarmor/ges-audit-engine": "1.1.5",
18
- "@greenarmor/ges-cicd-generator": "1.1.5",
19
- "@greenarmor/ges-compliance-engine": "1.1.5",
20
- "@greenarmor/ges-core": "1.1.5",
21
- "@greenarmor/ges-doc-generator": "1.1.5",
22
- "@greenarmor/ges-policy-engine": "1.1.5",
23
- "@greenarmor/ges-report-generator": "1.1.5",
24
- "@greenarmor/ges-rules-engine": "1.1.5",
25
- "@greenarmor/ges-scanner-integration": "1.1.5",
26
- "@greenarmor/ges-scoring-engine": "1.1.5",
27
- "@greenarmor/ges-mcp-server": "1.1.5",
28
- "@greenarmor/ges-git-hooks": "1.1.5",
29
- "@greenarmor/ges-web-dashboard": "1.1.5",
6
+ "@greenarmor/ges-audit-engine": "1.2.0",
7
+ "@greenarmor/ges-cicd-generator": "1.2.0",
8
+ "@greenarmor/ges-compliance-engine": "1.2.0",
9
+ "@greenarmor/ges-core": "1.2.0",
10
+ "@greenarmor/ges-doc-generator": "1.2.0",
11
+ "@greenarmor/ges-git-hooks": "1.2.0",
12
+ "@greenarmor/ges-mcp-server": "1.2.0",
13
+ "@greenarmor/ges-policy-engine": "1.2.0",
14
+ "@greenarmor/ges-report-generator": "1.2.0",
15
+ "@greenarmor/ges-rules-engine": "1.2.0",
16
+ "@greenarmor/ges-scanner-integration": "1.2.0",
17
+ "@greenarmor/ges-scoring-engine": "1.2.0",
18
+ "@greenarmor/ges-web-dashboard": "1.2.0",
30
19
  "commander": "^13.0.0"
31
20
  },
21
+ "description": "Green Engineering Standard Framework - Compliance-as-Code CLI",
32
22
  "devDependencies": {
33
23
  "@types/node": "^22.0.0",
34
24
  "typescript": "^6.0.0",
@@ -37,6 +27,12 @@
37
27
  "engines": {
38
28
  "node": ">=20.0.0"
39
29
  },
30
+ "files": [
31
+ "dist",
32
+ "LICENSE",
33
+ "README.md"
34
+ ],
35
+ "homepage": "https://github.com/greenarmor/gesf",
40
36
  "keywords": [
41
37
  "compliance",
42
38
  "gdpr",
@@ -49,11 +45,15 @@
49
45
  "compliance-as-code"
50
46
  ],
51
47
  "license": "MIT",
48
+ "main": "./dist/index.js",
49
+ "name": "@greenarmor/ges",
52
50
  "repository": {
53
51
  "type": "git",
54
52
  "url": "https://github.com/greenarmor/gesf"
55
53
  },
56
- "homepage": "https://github.com/greenarmor/gesf",
54
+ "type": "module",
55
+ "types": "./dist/index.d.ts",
56
+ "version": "1.2.0",
57
57
  "scripts": {
58
58
  "build": "tsc",
59
59
  "clean": "rm -rf dist tsconfig.tsbuildinfo",