@axe-core/watcher 3.19.1-next.3c67028f → 3.19.1-next.51b9d728
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/git.js +50 -11
- package/dist/git.js.map +1 -1
- package/extension/background.js +1 -1
- package/extension/content.js +1 -1
- package/package.json +2 -2
package/dist/git.js
CHANGED
@@ -1,43 +1,63 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
6
|
exports.getTag = exports.isDirty = exports.getCommitInfo = exports.getRemoteURL = exports.parseDefaultFromShowRemoteOutput = exports.getDefaultBranchName = exports.getBranchName = exports.isRepository = void 0;
|
4
7
|
const child_process_1 = require("child_process");
|
8
|
+
const createDebugger_1 = __importDefault(require("./createDebugger"));
|
9
|
+
const debugLogger = (0, createDebugger_1.default)('git');
|
5
10
|
const isRepository = (dir = process.cwd()) => {
|
6
11
|
try {
|
12
|
+
debugLogger('Checking if directory is a Git repository:', dir);
|
7
13
|
(0, child_process_1.execSync)('git rev-parse --is-inside-work-tree', {
|
8
14
|
cwd: dir,
|
9
15
|
stdio: 'ignore'
|
10
16
|
});
|
17
|
+
debugLogger('Directory is a Git repository');
|
11
18
|
return true;
|
12
19
|
}
|
13
|
-
catch {
|
20
|
+
catch (e) {
|
21
|
+
if (e instanceof Error)
|
22
|
+
debugLogger('Error while checking if directory is a Git repository:', {
|
23
|
+
message: e.message,
|
24
|
+
stack: e.stack
|
25
|
+
});
|
14
26
|
return false;
|
15
27
|
}
|
16
28
|
};
|
17
29
|
exports.isRepository = isRepository;
|
18
30
|
const getBranchName = (dir = process.cwd()) => {
|
19
31
|
try {
|
20
|
-
|
32
|
+
debugLogger('Getting current branch name for directory:', dir);
|
33
|
+
const branchName = (0, child_process_1.execSync)('git rev-parse --abbrev-ref HEAD', {
|
21
34
|
cwd: dir,
|
22
35
|
stdio: ['ignore', 'pipe', 'ignore']
|
23
36
|
})
|
24
37
|
.toString()
|
25
38
|
.trim();
|
39
|
+
debugLogger('Current branch name:', branchName);
|
40
|
+
return branchName;
|
26
41
|
}
|
27
|
-
catch {
|
42
|
+
catch (e) {
|
43
|
+
debugLogger('Error while getting current branch name:', e);
|
28
44
|
return null;
|
29
45
|
}
|
30
46
|
};
|
31
47
|
exports.getBranchName = getBranchName;
|
32
48
|
const getDefaultBranchName = (dir = process.cwd()) => {
|
33
49
|
try {
|
50
|
+
debugLogger('Getting default branch name for directory:', dir);
|
34
51
|
const stdout = (0, child_process_1.execSync)('git symbolic-ref --short refs/remotes/origin/HEAD', {
|
35
52
|
cwd: dir,
|
36
53
|
stdio: ['ignore', 'pipe', 'ignore']
|
37
54
|
}).toString();
|
38
|
-
|
55
|
+
const remoteOutput = (0, exports.parseDefaultFromShowRemoteOutput)(stdout);
|
56
|
+
debugLogger('Default branch name:', remoteOutput);
|
57
|
+
return remoteOutput;
|
39
58
|
}
|
40
|
-
catch {
|
59
|
+
catch (e) {
|
60
|
+
debugLogger('Error while getting default branch name:', e);
|
41
61
|
return null;
|
42
62
|
}
|
43
63
|
};
|
@@ -49,55 +69,74 @@ const parseDefaultFromShowRemoteOutput = (output) => {
|
|
49
69
|
exports.parseDefaultFromShowRemoteOutput = parseDefaultFromShowRemoteOutput;
|
50
70
|
const getRemoteURL = (dir = process.cwd()) => {
|
51
71
|
try {
|
52
|
-
|
72
|
+
debugLogger('Getting remote URL for directory:', dir);
|
73
|
+
const remoteUrl = (0, child_process_1.execSync)('git config --get remote.origin.url', {
|
53
74
|
cwd: dir,
|
54
75
|
stdio: ['ignore', 'pipe', 'ignore']
|
55
76
|
})
|
56
77
|
.toString()
|
57
78
|
.trim();
|
79
|
+
debugLogger('Remote URL:', remoteUrl);
|
80
|
+
return remoteUrl;
|
58
81
|
}
|
59
|
-
catch {
|
82
|
+
catch (e) {
|
83
|
+
debugLogger('Error while getting remote URL:', e);
|
60
84
|
return null;
|
61
85
|
}
|
62
86
|
};
|
63
87
|
exports.getRemoteURL = getRemoteURL;
|
64
88
|
const getCommitInfo = (dir = process.cwd()) => {
|
65
89
|
try {
|
90
|
+
debugLogger('Getting most recent commit info for directory:', dir);
|
66
91
|
const stdout = (0, child_process_1.execSync)('git show --no-patch --format="%s%n%H%n%an%n%ae"', {
|
67
92
|
cwd: dir,
|
68
93
|
stdio: ['ignore', 'pipe', 'ignore']
|
69
94
|
});
|
70
95
|
const [message, hash, author, email] = stdout.toString().trim().split('\n');
|
96
|
+
debugLogger('Most recent commit info:', {
|
97
|
+
message,
|
98
|
+
hash,
|
99
|
+
author,
|
100
|
+
email
|
101
|
+
});
|
71
102
|
return { message, hash, author, email };
|
72
103
|
}
|
73
|
-
catch {
|
104
|
+
catch (e) {
|
105
|
+
debugLogger('Error while getting most recent commit info:', e);
|
74
106
|
return null;
|
75
107
|
}
|
76
108
|
};
|
77
109
|
exports.getCommitInfo = getCommitInfo;
|
78
110
|
const isDirty = (dir = process.cwd()) => {
|
79
111
|
try {
|
112
|
+
debugLogger('Checking if repository contains unstaged changes for directory:', dir);
|
80
113
|
const stdout = (0, child_process_1.execSync)('git status --short', {
|
81
114
|
cwd: dir,
|
82
115
|
stdio: ['ignore', 'pipe', 'ignore']
|
83
116
|
});
|
117
|
+
debugLogger('Repository contains unstaged changes:', stdout.length > 0);
|
84
118
|
return stdout.length > 0;
|
85
119
|
}
|
86
|
-
catch {
|
120
|
+
catch (e) {
|
121
|
+
debugLogger('Error while checking if repository contains unstaged changes:', e);
|
87
122
|
return false;
|
88
123
|
}
|
89
124
|
};
|
90
125
|
exports.isDirty = isDirty;
|
91
126
|
const getTag = (dir = process.cwd()) => {
|
92
127
|
try {
|
93
|
-
|
128
|
+
debugLogger('Getting tag name for directory:', dir);
|
129
|
+
const tag = (0, child_process_1.execSync)('git describe --tags --exact', {
|
94
130
|
cwd: dir,
|
95
131
|
stdio: ['ignore', 'pipe', 'ignore']
|
96
132
|
})
|
97
133
|
.toString()
|
98
134
|
.trim();
|
135
|
+
debugLogger('Current tag name:', tag);
|
136
|
+
return tag;
|
99
137
|
}
|
100
|
-
catch {
|
138
|
+
catch (e) {
|
139
|
+
debugLogger('Error while getting tag name:', e);
|
101
140
|
return null;
|
102
141
|
}
|
103
142
|
};
|
package/dist/git.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":";;;;;;AAAA,iDAAwC;AACxC,sEAA6C;AAE7C,MAAM,WAAW,GAAG,IAAA,wBAAc,EAAC,KAAK,CAAC,CAAA;AAGlC,MAAM,YAAY,GAAG,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EAAW,EAAE;IAC3D,IAAI,CAAC;QACH,WAAW,CAAC,4CAA4C,EAAE,GAAG,CAAC,CAAA;QAC9D,IAAA,wBAAQ,EAAC,qCAAqC,EAAE;YAC9C,GAAG,EAAE,GAAG;YAER,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAA;QACF,WAAW,CAAC,+BAA+B,CAAC,CAAA;QAC5C,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QACpB,IAAI,CAAC,YAAY,KAAK;YACpB,WAAW,CAAC,wDAAwD,EAAE;gBACpE,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,KAAK,EAAE,CAAC,CAAC,KAAK;aACf,CAAC,CAAA;QACJ,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC,CAAA;AAlBY,QAAA,YAAY,gBAkBxB;AAGM,MAAM,aAAa,GAAG,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EAAiB,EAAE;IAClE,IAAI,CAAC;QACH,WAAW,CAAC,4CAA4C,EAAE,GAAG,CA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