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