@greenarmor/ges 1.1.1 → 1.1.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025–2026 greenarmor
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/cli.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greenarmor/ges",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Green Engineering Standard Framework - Compliance-as-Code CLI",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -11,26 +11,20 @@
11
11
  "files": [
12
12
  "dist"
13
13
  ],
14
- "scripts": {
15
- "build": "tsc",
16
- "clean": "rm -rf dist tsconfig.tsbuildinfo",
17
- "prepublishOnly": "pnpm -r run build",
18
- "test": "vitest run"
19
- },
20
14
  "dependencies": {
21
- "@greenarmor/ges-audit-engine": "1.1.1",
22
- "@greenarmor/ges-cicd-generator": "1.1.1",
23
- "@greenarmor/ges-compliance-engine": "1.1.1",
24
- "@greenarmor/ges-core": "1.1.1",
25
- "@greenarmor/ges-doc-generator": "1.1.1",
26
- "@greenarmor/ges-policy-engine": "1.1.1",
27
- "@greenarmor/ges-report-generator": "1.1.1",
28
- "@greenarmor/ges-rules-engine": "1.1.1",
29
- "@greenarmor/ges-scanner-integration": "1.1.1",
30
- "@greenarmor/ges-scoring-engine": "1.1.1",
31
- "@greenarmor/ges-mcp-server": "1.1.1",
32
- "@greenarmor/ges-git-hooks": "1.1.1",
33
- "@greenarmor/ges-web-dashboard": "1.1.1",
15
+ "@greenarmor/ges-audit-engine": "1.1.2",
16
+ "@greenarmor/ges-cicd-generator": "1.1.2",
17
+ "@greenarmor/ges-compliance-engine": "1.1.2",
18
+ "@greenarmor/ges-core": "1.1.2",
19
+ "@greenarmor/ges-doc-generator": "1.1.2",
20
+ "@greenarmor/ges-policy-engine": "1.1.2",
21
+ "@greenarmor/ges-report-generator": "1.1.2",
22
+ "@greenarmor/ges-rules-engine": "1.1.2",
23
+ "@greenarmor/ges-scanner-integration": "1.1.2",
24
+ "@greenarmor/ges-scoring-engine": "1.1.2",
25
+ "@greenarmor/ges-mcp-server": "1.1.2",
26
+ "@greenarmor/ges-git-hooks": "1.1.2",
27
+ "@greenarmor/ges-web-dashboard": "1.1.2",
34
28
  "commander": "^13.0.0"
35
29
  },
36
30
  "devDependencies": {
@@ -57,5 +51,10 @@
57
51
  "type": "git",
58
52
  "url": "https://github.com/greenarmor/gesf"
59
53
  },
60
- "homepage": "https://github.com/greenarmor/gesf"
61
- }
54
+ "homepage": "https://github.com/greenarmor/gesf",
55
+ "scripts": {
56
+ "build": "tsc",
57
+ "clean": "rm -rf dist tsconfig.tsbuildinfo",
58
+ "test": "vitest run"
59
+ }
60
+ }
@@ -1 +0,0 @@
1
- export {};
@@ -1,88 +0,0 @@
1
- import { describe, it, expect, beforeEach, afterEach } from "vitest";
2
- import * as fs from "node:fs";
3
- import * as path from "node:path";
4
- import * as os from "node:os";
5
- import { findProjectRoot, readJsonFile, writeJsonFile, writeFileSync, GES_DIR, } from "./project.js";
6
- let tmpDir;
7
- let origCwd;
8
- beforeEach(() => {
9
- tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "gesf-cli-test-"));
10
- origCwd = process.cwd();
11
- });
12
- afterEach(() => {
13
- process.chdir(origCwd);
14
- fs.rmSync(tmpDir, { recursive: true, force: true });
15
- });
16
- describe("findProjectRoot", () => {
17
- it("finds root with config.json", () => {
18
- fs.mkdirSync(path.join(tmpDir, GES_DIR));
19
- fs.writeFileSync(path.join(tmpDir, GES_DIR, "config.json"), "{}");
20
- expect(findProjectRoot(tmpDir)).toBe(tmpDir);
21
- });
22
- it("finds root with config.yaml (backwards compat)", () => {
23
- fs.mkdirSync(path.join(tmpDir, GES_DIR));
24
- fs.writeFileSync(path.join(tmpDir, GES_DIR, "config.yaml"), "name: test");
25
- expect(findProjectRoot(tmpDir)).toBe(tmpDir);
26
- });
27
- it("returns null when no config found", () => {
28
- expect(findProjectRoot(tmpDir)).toBeNull();
29
- });
30
- it("finds root from nested subdirectory", () => {
31
- fs.mkdirSync(path.join(tmpDir, GES_DIR));
32
- fs.writeFileSync(path.join(tmpDir, GES_DIR, "config.json"), "{}");
33
- const nested = path.join(tmpDir, "src", "deep", "path");
34
- fs.mkdirSync(nested, { recursive: true });
35
- expect(findProjectRoot(nested)).toBe(tmpDir);
36
- });
37
- });
38
- describe("readJsonFile", () => {
39
- it("reads valid JSON", () => {
40
- const filePath = path.join(tmpDir, "test.json");
41
- fs.writeFileSync(filePath, '{"name":"test","value":42}');
42
- const result = readJsonFile(filePath);
43
- expect(result).not.toBeNull();
44
- expect(result.name).toBe("test");
45
- expect(result.value).toBe(42);
46
- });
47
- it("returns null for missing file", () => {
48
- expect(readJsonFile(path.join(tmpDir, "nonexistent.json"))).toBeNull();
49
- });
50
- it("returns null for invalid JSON", () => {
51
- const filePath = path.join(tmpDir, "bad.json");
52
- fs.writeFileSync(filePath, "{not valid json}");
53
- expect(readJsonFile(filePath)).toBeNull();
54
- });
55
- });
56
- describe("writeJsonFile", () => {
57
- it("writes JSON to file", () => {
58
- const filePath = path.join(tmpDir, "output.json");
59
- writeJsonFile(filePath, { name: "test", items: [1, 2, 3] });
60
- const content = fs.readFileSync(filePath, "utf-8");
61
- const parsed = JSON.parse(content);
62
- expect(parsed.name).toBe("test");
63
- expect(parsed.items).toEqual([1, 2, 3]);
64
- });
65
- it("creates parent directories", () => {
66
- const filePath = path.join(tmpDir, "nested", "dir", "output.json");
67
- writeJsonFile(filePath, { ok: true });
68
- expect(fs.existsSync(filePath)).toBe(true);
69
- });
70
- });
71
- describe("writeFileSync", () => {
72
- it("writes content to file", () => {
73
- const filePath = path.join(tmpDir, "test.txt");
74
- writeFileSync(filePath, "hello world");
75
- expect(fs.readFileSync(filePath, "utf-8")).toBe("hello world");
76
- });
77
- it("creates parent directories if needed", () => {
78
- const filePath = path.join(tmpDir, "a", "b", "c", "file.txt");
79
- writeFileSync(filePath, "nested");
80
- expect(fs.existsSync(filePath)).toBe(true);
81
- });
82
- it("overwrites existing file", () => {
83
- const filePath = path.join(tmpDir, "overwrite.txt");
84
- writeFileSync(filePath, "first");
85
- writeFileSync(filePath, "second");
86
- expect(fs.readFileSync(filePath, "utf-8")).toBe("second");
87
- });
88
- });