lula2 0.0.3 → 0.0.4-nightly.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/README.md +8 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/package.json +1 -1
- package/src/index.ts +6 -2
package/README.md
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
[](https://npmjs.com/package/lula-next)
|
|
6
6
|
[](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
package/dist/index.d.ts.map
CHANGED
|
@@ -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":";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
|
|
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
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()
|
|
16
|
-
const
|
|
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
|
}
|