@allurereport/git 3.20.1 → 3.22.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/collectGitHead.d.ts +7 -0
- package/dist/collectGitHead.js +13 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +12 -7
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { runGit } from "./runGit.js";
|
|
2
|
+
export const collectGitHead = (options = {}) => {
|
|
3
|
+
const { cwd } = options;
|
|
4
|
+
if (runGit(["rev-parse", "--is-inside-work-tree"], cwd) !== "true") {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
const commit = runGit(["rev-parse", "HEAD"], cwd);
|
|
8
|
+
if (!commit) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
const branch = runGit(["rev-parse", "--abbrev-ref", "HEAD"], cwd);
|
|
12
|
+
return { commit, branch: branch && branch !== "HEAD" ? branch : undefined };
|
|
13
|
+
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/git",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.22.0",
|
|
4
4
|
"description": "Git metadata collection for Allure Git Flow",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -24,20 +24,25 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "run clean && tsc --project ./tsconfig.json",
|
|
26
26
|
"clean": "rimraf ./dist",
|
|
27
|
-
"test": "rimraf
|
|
28
|
-
"
|
|
29
|
-
"lint
|
|
27
|
+
"test": "rimraf out && vp test run",
|
|
28
|
+
"test:unit": "yarn test",
|
|
29
|
+
"lint": "vp lint --import-plugin src test",
|
|
30
|
+
"lint:fix": "vp lint --import-plugin --fix src test"
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
|
-
"@allurereport/core-api": "3.
|
|
33
|
+
"@allurereport/core-api": "3.22.0"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
36
|
+
"@allurereport/common-config": "3.22.0",
|
|
35
37
|
"@types/node": "^20",
|
|
38
|
+
"@vitest/coverage-istanbul": "5.0.4",
|
|
36
39
|
"@vitest/runner": "^2",
|
|
37
|
-
"@vitest/snapshot": "
|
|
40
|
+
"@vitest/snapshot": "5.0.4",
|
|
38
41
|
"allure-vitest": "^3",
|
|
39
42
|
"rimraf": "^6",
|
|
40
43
|
"typescript": "^5",
|
|
41
|
-
"
|
|
44
|
+
"vite": "@voidzero-dev/vite-plus-core@1.2.0",
|
|
45
|
+
"vite-plus": "1.2.0",
|
|
46
|
+
"vitest": "5.0.4"
|
|
42
47
|
}
|
|
43
48
|
}
|