commitizen 4.3.1 → 5.0.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/.github/workflows/release.yml +14 -7
- package/.husky/pre-commit +1 -0
- package/CONTRIBUTING.md +53 -21
- package/README.md +5 -6
- package/babel.config.js +21 -10
- package/bin/git-cz.js +1 -1
- package/dist/cli/parsers/commitizen.js +8 -2
- package/dist/cli/parsers.js +2 -2
- package/dist/cli/strategies/git-cz.js +5 -7
- package/dist/cli/strategies/git.js +4 -5
- package/dist/cli/strategies.js +1 -1
- package/dist/commitizen/adapter.js +53 -1412
- package/dist/commitizen/cache.js +7 -238
- package/dist/commitizen/commit.js +16 -566
- package/dist/commitizen/configLoader.js +1 -84
- package/dist/commitizen/init.js +32 -980
- package/dist/commitizen/staging.js +3 -255
- package/dist/commitizen.js +3 -3
- package/dist/common/util.js +50 -445
- package/dist/configLoader/findup.js +9 -315
- package/dist/configLoader/getContent.js +19 -647
- package/dist/configLoader/getNormalizedConfig.js +10 -384
- package/dist/configLoader/loader.js +6 -374
- package/dist/configLoader.js +1 -1
- package/dist/git/add.js +4 -114
- package/dist/git/commit.js +20 -802
- package/dist/git/init.js +3 -75
- package/dist/git/log.js +2 -175
- package/dist/git/whatChanged.js +4 -176
- package/dist/index.js +1 -56
- package/dist/npm.js +1 -32
- package/jobs/build.yml +19 -19
- package/package.json +39 -47
- package/pnpm-workspace.yaml +7 -0
|
@@ -4,271 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.isClean = isClean;
|
|
7
|
-
var
|
|
8
|
-
function cov_jkd4cxdc9() {
|
|
9
|
-
var path = "/home/runner/work/cz-cli/cz-cli/src/commitizen/staging.js";
|
|
10
|
-
var hash = "30be7fb393c788ad4e85c71340438cb0aaa50d35";
|
|
11
|
-
var global = new Function("return this")();
|
|
12
|
-
var gcv = "__coverage__";
|
|
13
|
-
var coverageData = {
|
|
14
|
-
path: "/home/runner/work/cz-cli/cz-cli/src/commitizen/staging.js",
|
|
15
|
-
statementMap: {
|
|
16
|
-
"0": {
|
|
17
|
-
start: {
|
|
18
|
-
line: 9,
|
|
19
|
-
column: 2
|
|
20
|
-
},
|
|
21
|
-
end: {
|
|
22
|
-
line: 18,
|
|
23
|
-
column: 5
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"1": {
|
|
27
|
-
start: {
|
|
28
|
-
line: 13,
|
|
29
|
-
column: 4
|
|
30
|
-
},
|
|
31
|
-
end: {
|
|
32
|
-
line: 15,
|
|
33
|
-
column: 5
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"2": {
|
|
37
|
-
start: {
|
|
38
|
-
line: 14,
|
|
39
|
-
column: 6
|
|
40
|
-
},
|
|
41
|
-
end: {
|
|
42
|
-
line: 14,
|
|
43
|
-
column: 25
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
"3": {
|
|
47
|
-
start: {
|
|
48
|
-
line: 16,
|
|
49
|
-
column: 17
|
|
50
|
-
},
|
|
51
|
-
end: {
|
|
52
|
-
line: 16,
|
|
53
|
-
column: 29
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"4": {
|
|
57
|
-
start: {
|
|
58
|
-
line: 17,
|
|
59
|
-
column: 4
|
|
60
|
-
},
|
|
61
|
-
end: {
|
|
62
|
-
line: 17,
|
|
63
|
-
column: 43
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
fnMap: {
|
|
68
|
-
"0": {
|
|
69
|
-
name: "isClean",
|
|
70
|
-
decl: {
|
|
71
|
-
start: {
|
|
72
|
-
line: 8,
|
|
73
|
-
column: 9
|
|
74
|
-
},
|
|
75
|
-
end: {
|
|
76
|
-
line: 8,
|
|
77
|
-
column: 16
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
loc: {
|
|
81
|
-
start: {
|
|
82
|
-
line: 8,
|
|
83
|
-
column: 49
|
|
84
|
-
},
|
|
85
|
-
end: {
|
|
86
|
-
line: 19,
|
|
87
|
-
column: 1
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
line: 8
|
|
91
|
-
},
|
|
92
|
-
"1": {
|
|
93
|
-
name: "(anonymous_1)",
|
|
94
|
-
decl: {
|
|
95
|
-
start: {
|
|
96
|
-
line: 12,
|
|
97
|
-
column: 5
|
|
98
|
-
},
|
|
99
|
-
end: {
|
|
100
|
-
line: 12,
|
|
101
|
-
column: 6
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
loc: {
|
|
105
|
-
start: {
|
|
106
|
-
line: 12,
|
|
107
|
-
column: 30
|
|
108
|
-
},
|
|
109
|
-
end: {
|
|
110
|
-
line: 18,
|
|
111
|
-
column: 3
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
line: 12
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
branchMap: {
|
|
118
|
-
"0": {
|
|
119
|
-
loc: {
|
|
120
|
-
start: {
|
|
121
|
-
line: 9,
|
|
122
|
-
column: 54
|
|
123
|
-
},
|
|
124
|
-
end: {
|
|
125
|
-
line: 9,
|
|
126
|
-
column: 116
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
type: "cond-expr",
|
|
130
|
-
locations: [{
|
|
131
|
-
start: {
|
|
132
|
-
line: 9,
|
|
133
|
-
column: 72
|
|
134
|
-
},
|
|
135
|
-
end: {
|
|
136
|
-
line: 9,
|
|
137
|
-
column: 111
|
|
138
|
-
}
|
|
139
|
-
}, {
|
|
140
|
-
start: {
|
|
141
|
-
line: 9,
|
|
142
|
-
column: 114
|
|
143
|
-
},
|
|
144
|
-
end: {
|
|
145
|
-
line: 9,
|
|
146
|
-
column: 116
|
|
147
|
-
}
|
|
148
|
-
}],
|
|
149
|
-
line: 9
|
|
150
|
-
},
|
|
151
|
-
"1": {
|
|
152
|
-
loc: {
|
|
153
|
-
start: {
|
|
154
|
-
line: 13,
|
|
155
|
-
column: 4
|
|
156
|
-
},
|
|
157
|
-
end: {
|
|
158
|
-
line: 15,
|
|
159
|
-
column: 5
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
type: "if",
|
|
163
|
-
locations: [{
|
|
164
|
-
start: {
|
|
165
|
-
line: 13,
|
|
166
|
-
column: 4
|
|
167
|
-
},
|
|
168
|
-
end: {
|
|
169
|
-
line: 15,
|
|
170
|
-
column: 5
|
|
171
|
-
}
|
|
172
|
-
}, {
|
|
173
|
-
start: {
|
|
174
|
-
line: undefined,
|
|
175
|
-
column: undefined
|
|
176
|
-
},
|
|
177
|
-
end: {
|
|
178
|
-
line: undefined,
|
|
179
|
-
column: undefined
|
|
180
|
-
}
|
|
181
|
-
}],
|
|
182
|
-
line: 13
|
|
183
|
-
},
|
|
184
|
-
"2": {
|
|
185
|
-
loc: {
|
|
186
|
-
start: {
|
|
187
|
-
line: 16,
|
|
188
|
-
column: 17
|
|
189
|
-
},
|
|
190
|
-
end: {
|
|
191
|
-
line: 16,
|
|
192
|
-
column: 29
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
type: "binary-expr",
|
|
196
|
-
locations: [{
|
|
197
|
-
start: {
|
|
198
|
-
line: 16,
|
|
199
|
-
column: 17
|
|
200
|
-
},
|
|
201
|
-
end: {
|
|
202
|
-
line: 16,
|
|
203
|
-
column: 23
|
|
204
|
-
}
|
|
205
|
-
}, {
|
|
206
|
-
start: {
|
|
207
|
-
line: 16,
|
|
208
|
-
column: 27
|
|
209
|
-
},
|
|
210
|
-
end: {
|
|
211
|
-
line: 16,
|
|
212
|
-
column: 29
|
|
213
|
-
}
|
|
214
|
-
}],
|
|
215
|
-
line: 16
|
|
216
|
-
}
|
|
217
|
-
},
|
|
218
|
-
s: {
|
|
219
|
-
"0": 0,
|
|
220
|
-
"1": 0,
|
|
221
|
-
"2": 0,
|
|
222
|
-
"3": 0,
|
|
223
|
-
"4": 0
|
|
224
|
-
},
|
|
225
|
-
f: {
|
|
226
|
-
"0": 0,
|
|
227
|
-
"1": 0
|
|
228
|
-
},
|
|
229
|
-
b: {
|
|
230
|
-
"0": [0, 0],
|
|
231
|
-
"1": [0, 0],
|
|
232
|
-
"2": [0, 0]
|
|
233
|
-
},
|
|
234
|
-
_coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
|
|
235
|
-
hash: "30be7fb393c788ad4e85c71340438cb0aaa50d35"
|
|
236
|
-
};
|
|
237
|
-
var coverage = global[gcv] || (global[gcv] = {});
|
|
238
|
-
if (!coverage[path] || coverage[path].hash !== hash) {
|
|
239
|
-
coverage[path] = coverageData;
|
|
240
|
-
}
|
|
241
|
-
var actualCoverage = coverage[path];
|
|
242
|
-
{
|
|
243
|
-
// @ts-ignore
|
|
244
|
-
cov_jkd4cxdc9 = function () {
|
|
245
|
-
return actualCoverage;
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
return actualCoverage;
|
|
249
|
-
}
|
|
250
|
-
cov_jkd4cxdc9();
|
|
7
|
+
var _nodeChild_process = require("node:child_process");
|
|
251
8
|
/**
|
|
252
9
|
* Asynchrounously determines if the staging area is clean
|
|
253
10
|
*/
|
|
254
11
|
function isClean(repoPath, done, stageAllFiles) {
|
|
255
|
-
|
|
256
|
-
cov_jkd4cxdc9().s[0]++;
|
|
257
|
-
(0, _child_process.exec)(`git diff --cached --no-ext-diff --name-only ${!!stageAllFiles ? (cov_jkd4cxdc9().b[0][0]++, '&& git diff --no-ext-diff --name-only') : (cov_jkd4cxdc9().b[0][1]++, '')}`, {
|
|
12
|
+
(0, _nodeChild_process.exec)(`git diff --cached --no-ext-diff --name-only ${!!stageAllFiles ? '&& git diff --no-ext-diff --name-only' : ''}`, {
|
|
258
13
|
maxBuffer: Infinity,
|
|
259
14
|
cwd: repoPath
|
|
260
15
|
}, function (error, stdout) {
|
|
261
|
-
cov_jkd4cxdc9().f[1]++;
|
|
262
|
-
cov_jkd4cxdc9().s[1]++;
|
|
263
16
|
if (error) {
|
|
264
|
-
cov_jkd4cxdc9().b[1][0]++;
|
|
265
|
-
cov_jkd4cxdc9().s[2]++;
|
|
266
17
|
return done(error);
|
|
267
|
-
} else {
|
|
268
|
-
cov_jkd4cxdc9().b[1][1]++;
|
|
269
18
|
}
|
|
270
|
-
let output =
|
|
271
|
-
cov_jkd4cxdc9().s[4]++;
|
|
19
|
+
let output = stdout || '';
|
|
272
20
|
done(null, output.trim().length === 0);
|
|
273
21
|
});
|
|
274
22
|
}
|
package/dist/commitizen.js
CHANGED
|
@@ -28,6 +28,6 @@ exports.configLoader = configLoader;
|
|
|
28
28
|
var _init = _interopRequireDefault(require("./commitizen/init"));
|
|
29
29
|
var staging = _interopRequireWildcard(require("./commitizen/staging"));
|
|
30
30
|
exports.staging = staging;
|
|
31
|
-
function _interopRequireDefault(
|
|
32
|
-
|
|
33
|
-
function _interopRequireWildcard(
|
|
31
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
32
|
+
var e;
|
|
33
|
+
function _interopRequireWildcard(t, r) { if (!r && t && t.__esModule) return t; var n, a, o = Object.defineProperty, f = { __proto__: null, default: t }; if (Object(t) !== t) return f; if (e || "function" != typeof WeakMap || (e = new WeakMap()), e) { if (e.has(t)) return e.get(t); e.set(t, f); } for (a in t) "default" !== a && {}.hasOwnProperty.call(t, a) && ((n = o && Object.getOwnPropertyDescriptor(t, a)) && (n.get || n.set) ? o(f, a, n) : f[a] = t[a]); return f; }
|