lula2 0.0.3 → 0.0.4-nightly.1

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
@@ -5,6 +5,8 @@
5
5
  [![Npm package version](https://badgen.net/npm/v/lula-next)](https://npmjs.com/package/lula-next)
6
6
  [![Npm package total downloads](https://badgen.net/npm/dt/lula-next)](https://npmjs.com/package/lula-next)
7
7
 
8
+ **Crawl Command**
9
+
8
10
  ```bash
9
11
  > OWNER=defenseunicorns REPO=on-demand-compliance PULL_NUMBER=24 GITHUB_TOKEN=$(gh auth token) npx lula2 crawl
10
12
  Commenting on file1.ts: **Compliance Alert**: `file1.ts` changed between lines 9–16.
@@ -12,3 +14,9 @@ UUID `123e4567-e89b-12d3-a456-426614174001` may be out of compliance. Please rev
12
14
  Commenting on file1.yaml: **Compliance Alert**: `file1.yaml` changed between lines 16–18.
13
15
  UUID `123e4567-e89b-12d3-a456-426614174000` may be out of compliance. Please review.
14
16
  ```
17
+
18
+ **Version Command**
19
+
20
+ ```bash
21
+ > npx lula2 --version
22
+ ```
package/dist/index.d.ts CHANGED
@@ -4,5 +4,5 @@
4
4
  *
5
5
  * @returns The current version
6
6
  */
7
- export declare function getVersion(): string;
7
+ export declare function getVersion(): any;
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AASA;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAInC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAYA;;;;GAIG;AACH,wBAAgB,UAAU,QAKzB"}
package/dist/index.js CHANGED
@@ -4,13 +4,16 @@ import crawl from "./crawl.js";
4
4
  import fs from "fs";
5
5
  import path from "path";
6
6
  const program = new Command();
7
+ import { fileURLToPath } from "url";
8
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
9
  /**
8
10
  * Get the current version from package.json
9
11
  *
10
12
  * @returns The current version
11
13
  */
12
14
  export function getVersion() {
13
- const packageJson = fs.readFileSync(path.resolve(process.cwd(), "./package.json"), "utf8");
15
+ const pkgPath = path.resolve(__dirname, "../package.json"); // adjust path if index.ts is in src/
16
+ const packageJson = fs.readFileSync(pkgPath, "utf8");
14
17
  const { version } = JSON.parse(packageJson);
15
18
  return version;
16
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lula2",
3
- "version": "0.0.3",
3
+ "version": "0.0.4-nightly.1",
4
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",
package/src/index.ts CHANGED
@@ -6,14 +6,18 @@ import fs from "fs";
6
6
  import path from "path";
7
7
 
8
8
  const program = new Command();
9
+ import { fileURLToPath } from "url";
10
+
11
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
12
 
10
13
  /**
11
14
  * Get the current version from package.json
12
15
  *
13
16
  * @returns The current version
14
17
  */
15
- export function getVersion(): string {
16
- const packageJson = fs.readFileSync(path.resolve(process.cwd(), "./package.json"), "utf8");
18
+ export function getVersion() {
19
+ const pkgPath = path.resolve(__dirname, "../package.json"); // adjust path if index.ts is in src/
20
+ const packageJson = fs.readFileSync(pkgPath, "utf8");
17
21
  const { version } = JSON.parse(packageJson);
18
22
  return version;
19
23
  }