lula2 0.0.2 → 0.0.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/README.md CHANGED
@@ -6,7 +6,9 @@
6
6
  [![Npm package total downloads](https://badgen.net/npm/dt/lula-next)](https://npmjs.com/package/lula-next)
7
7
 
8
8
  ```bash
9
- > OWNER=defenseunicorns REPO=on-demand-compliance PULL_NUMBER=24 GITHUB_TOKEN=asdf npx tsx src/index.ts crawl
9
+ > OWNER=defenseunicorns REPO=on-demand-compliance PULL_NUMBER=24 GITHUB_TOKEN=$(gh auth token) npx lula2 crawl
10
10
  Commenting on file1.ts: **Compliance Alert**: `file1.ts` changed between lines 9–16.
11
11
  UUID `123e4567-e89b-12d3-a456-426614174001` may be out of compliance. Please review.
12
+ Commenting on file1.yaml: **Compliance Alert**: `file1.yaml` changed between lines 16–18.
13
+ UUID `123e4567-e89b-12d3-a456-426614174000` may be out of compliance. Please review.
12
14
  ```
package/dist/index.d.ts CHANGED
@@ -1,3 +1,8 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ /**
3
+ * Get the current version from package.json
4
+ *
5
+ * @returns The current version
6
+ */
7
+ export declare function getVersion(): string;
3
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AASA;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAInC"}
package/dist/index.js CHANGED
@@ -1,12 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from "commander";
3
3
  import crawl from "./crawl.js";
4
- // Define the program
4
+ import fs from "fs";
5
+ import path from "path";
5
6
  const program = new Command();
6
- // Set basic information
7
+ /**
8
+ * Get the current version from package.json
9
+ *
10
+ * @returns The current version
11
+ */
12
+ export function getVersion() {
13
+ const packageJson = fs.readFileSync(path.resolve(process.cwd(), "./package.json"), "utf8");
14
+ const { version } = JSON.parse(packageJson);
15
+ return version;
16
+ }
7
17
  program
8
18
  .name("lula2")
9
19
  .description("Reports and exports compliance status for defined controls")
20
+ .version(getVersion(), "-v, --version", "output the current version")
10
21
  .option("-c, --config <path>", "path to config file", "compliance.json")
11
22
  .addCommand(crawl())
12
23
  .action(options => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lula2",
3
- "version": "0.0.2",
4
- "description": "Reports Reports and exports compliance status for defined controls.",
3
+ "version": "0.0.3",
4
+ "description": "A tool for managing compliance as code in your GitHub repositories.",
5
5
  "bin": "./dist/index.js",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -50,8 +50,8 @@
50
50
  "@commitlint/cli": "^19.8.0",
51
51
  "@commitlint/config-conventional": "^19.8.0",
52
52
  "@eslint/js": "^9.23.0",
53
- "@typescript-eslint/eslint-plugin": "^8.33.0",
54
- "@typescript-eslint/parser": "^8.33.0",
53
+ "@typescript-eslint/eslint-plugin": "^8.41.0",
54
+ "@typescript-eslint/parser": "^8.41.0",
55
55
  "@vitest/coverage-v8": "^3.2.4",
56
56
  "esbuild": "^0.25.1",
57
57
  "eslint": "^9.26.0",
@@ -59,10 +59,10 @@
59
59
  "eslint-plugin-jsdoc": "^54.1.1",
60
60
  "globals": "^16.0.0",
61
61
  "husky": "^9.1.7",
62
- "prettier": "3.5.3",
62
+ "prettier": "3.6.2",
63
63
  "semantic-release": "^24.2.3",
64
- "typescript": "5.8.3",
65
- "typescript-eslint": "^8.28.0",
64
+ "typescript": "5.9.2",
65
+ "typescript-eslint": "^8.41.0",
66
66
  "vitest": "^3.2.4"
67
67
  },
68
68
  "release": {
package/src/index.ts CHANGED
@@ -2,13 +2,26 @@
2
2
 
3
3
  import { Command } from "commander";
4
4
  import crawl from "./crawl.js";
5
- // Define the program
5
+ import fs from "fs";
6
+ import path from "path";
7
+
6
8
  const program = new Command();
7
9
 
8
- // Set basic information
10
+ /**
11
+ * Get the current version from package.json
12
+ *
13
+ * @returns The current version
14
+ */
15
+ export function getVersion(): string {
16
+ const packageJson = fs.readFileSync(path.resolve(process.cwd(), "./package.json"), "utf8");
17
+ const { version } = JSON.parse(packageJson);
18
+ return version;
19
+ }
20
+
9
21
  program
10
22
  .name("lula2")
11
23
  .description("Reports and exports compliance status for defined controls")
24
+ .version(getVersion(), "-v, --version", "output the current version")
12
25
  .option("-c, --config <path>", "path to config file", "compliance.json")
13
26
  .addCommand(crawl())
14
27
  .action(options => {