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,400 +4,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var path = "/home/runner/work/cz-cli/cz-cli/src/configLoader/getNormalizedConfig.js";
|
|
9
|
-
var hash = "4f6f52b87cc201f346900b4ddb8d92d48fe58a78";
|
|
10
|
-
var global = new Function("return this")();
|
|
11
|
-
var gcv = "__coverage__";
|
|
12
|
-
var coverageData = {
|
|
13
|
-
path: "/home/runner/work/cz-cli/cz-cli/src/configLoader/getNormalizedConfig.js",
|
|
14
|
-
statementMap: {
|
|
15
|
-
"0": {
|
|
16
|
-
start: {
|
|
17
|
-
line: 7,
|
|
18
|
-
column: 2
|
|
19
|
-
},
|
|
20
|
-
end: {
|
|
21
|
-
line: 26,
|
|
22
|
-
column: 3
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"1": {
|
|
26
|
-
start: {
|
|
27
|
-
line: 12,
|
|
28
|
-
column: 4
|
|
29
|
-
},
|
|
30
|
-
end: {
|
|
31
|
-
line: 22,
|
|
32
|
-
column: 5
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
"2": {
|
|
36
|
-
start: {
|
|
37
|
-
line: 13,
|
|
38
|
-
column: 6
|
|
39
|
-
},
|
|
40
|
-
end: {
|
|
41
|
-
line: 13,
|
|
42
|
-
column: 39
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"3": {
|
|
46
|
-
start: {
|
|
47
|
-
line: 14,
|
|
48
|
-
column: 11
|
|
49
|
-
},
|
|
50
|
-
end: {
|
|
51
|
-
line: 22,
|
|
52
|
-
column: 5
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
"4": {
|
|
56
|
-
start: {
|
|
57
|
-
line: 17,
|
|
58
|
-
column: 6
|
|
59
|
-
},
|
|
60
|
-
end: {
|
|
61
|
-
line: 20,
|
|
62
|
-
column: 7
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
"5": {
|
|
66
|
-
start: {
|
|
67
|
-
line: 19,
|
|
68
|
-
column: 8
|
|
69
|
-
},
|
|
70
|
-
end: {
|
|
71
|
-
line: 19,
|
|
72
|
-
column: 341
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
"6": {
|
|
76
|
-
start: {
|
|
77
|
-
line: 21,
|
|
78
|
-
column: 6
|
|
79
|
-
},
|
|
80
|
-
end: {
|
|
81
|
-
line: 21,
|
|
82
|
-
column: 30
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
"7": {
|
|
86
|
-
start: {
|
|
87
|
-
line: 25,
|
|
88
|
-
column: 4
|
|
89
|
-
},
|
|
90
|
-
end: {
|
|
91
|
-
line: 25,
|
|
92
|
-
column: 19
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
fnMap: {
|
|
97
|
-
"0": {
|
|
98
|
-
name: "getNormalizedConfig",
|
|
99
|
-
decl: {
|
|
100
|
-
start: {
|
|
101
|
-
line: 5,
|
|
102
|
-
column: 9
|
|
103
|
-
},
|
|
104
|
-
end: {
|
|
105
|
-
line: 5,
|
|
106
|
-
column: 28
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
loc: {
|
|
110
|
-
start: {
|
|
111
|
-
line: 5,
|
|
112
|
-
column: 47
|
|
113
|
-
},
|
|
114
|
-
end: {
|
|
115
|
-
line: 28,
|
|
116
|
-
column: 1
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
line: 5
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
branchMap: {
|
|
123
|
-
"0": {
|
|
124
|
-
loc: {
|
|
125
|
-
start: {
|
|
126
|
-
line: 7,
|
|
127
|
-
column: 2
|
|
128
|
-
},
|
|
129
|
-
end: {
|
|
130
|
-
line: 26,
|
|
131
|
-
column: 3
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
type: "if",
|
|
135
|
-
locations: [{
|
|
136
|
-
start: {
|
|
137
|
-
line: 7,
|
|
138
|
-
column: 2
|
|
139
|
-
},
|
|
140
|
-
end: {
|
|
141
|
-
line: 26,
|
|
142
|
-
column: 3
|
|
143
|
-
}
|
|
144
|
-
}, {
|
|
145
|
-
start: {
|
|
146
|
-
line: 23,
|
|
147
|
-
column: 9
|
|
148
|
-
},
|
|
149
|
-
end: {
|
|
150
|
-
line: 26,
|
|
151
|
-
column: 3
|
|
152
|
-
}
|
|
153
|
-
}],
|
|
154
|
-
line: 7
|
|
155
|
-
},
|
|
156
|
-
"1": {
|
|
157
|
-
loc: {
|
|
158
|
-
start: {
|
|
159
|
-
line: 7,
|
|
160
|
-
column: 6
|
|
161
|
-
},
|
|
162
|
-
end: {
|
|
163
|
-
line: 7,
|
|
164
|
-
column: 44
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
type: "binary-expr",
|
|
168
|
-
locations: [{
|
|
169
|
-
start: {
|
|
170
|
-
line: 7,
|
|
171
|
-
column: 6
|
|
172
|
-
},
|
|
173
|
-
end: {
|
|
174
|
-
line: 7,
|
|
175
|
-
column: 13
|
|
176
|
-
}
|
|
177
|
-
}, {
|
|
178
|
-
start: {
|
|
179
|
-
line: 7,
|
|
180
|
-
column: 18
|
|
181
|
-
},
|
|
182
|
-
end: {
|
|
183
|
-
line: 7,
|
|
184
|
-
column: 43
|
|
185
|
-
}
|
|
186
|
-
}],
|
|
187
|
-
line: 7
|
|
188
|
-
},
|
|
189
|
-
"2": {
|
|
190
|
-
loc: {
|
|
191
|
-
start: {
|
|
192
|
-
line: 12,
|
|
193
|
-
column: 4
|
|
194
|
-
},
|
|
195
|
-
end: {
|
|
196
|
-
line: 22,
|
|
197
|
-
column: 5
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
type: "if",
|
|
201
|
-
locations: [{
|
|
202
|
-
start: {
|
|
203
|
-
line: 12,
|
|
204
|
-
column: 4
|
|
205
|
-
},
|
|
206
|
-
end: {
|
|
207
|
-
line: 22,
|
|
208
|
-
column: 5
|
|
209
|
-
}
|
|
210
|
-
}, {
|
|
211
|
-
start: {
|
|
212
|
-
line: 14,
|
|
213
|
-
column: 11
|
|
214
|
-
},
|
|
215
|
-
end: {
|
|
216
|
-
line: 22,
|
|
217
|
-
column: 5
|
|
218
|
-
}
|
|
219
|
-
}],
|
|
220
|
-
line: 12
|
|
221
|
-
},
|
|
222
|
-
"3": {
|
|
223
|
-
loc: {
|
|
224
|
-
start: {
|
|
225
|
-
line: 12,
|
|
226
|
-
column: 8
|
|
227
|
-
},
|
|
228
|
-
end: {
|
|
229
|
-
line: 12,
|
|
230
|
-
column: 51
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
type: "binary-expr",
|
|
234
|
-
locations: [{
|
|
235
|
-
start: {
|
|
236
|
-
line: 12,
|
|
237
|
-
column: 8
|
|
238
|
-
},
|
|
239
|
-
end: {
|
|
240
|
-
line: 12,
|
|
241
|
-
column: 22
|
|
242
|
-
}
|
|
243
|
-
}, {
|
|
244
|
-
start: {
|
|
245
|
-
line: 12,
|
|
246
|
-
column: 26
|
|
247
|
-
},
|
|
248
|
-
end: {
|
|
249
|
-
line: 12,
|
|
250
|
-
column: 51
|
|
251
|
-
}
|
|
252
|
-
}],
|
|
253
|
-
line: 12
|
|
254
|
-
},
|
|
255
|
-
"4": {
|
|
256
|
-
loc: {
|
|
257
|
-
start: {
|
|
258
|
-
line: 14,
|
|
259
|
-
column: 11
|
|
260
|
-
},
|
|
261
|
-
end: {
|
|
262
|
-
line: 22,
|
|
263
|
-
column: 5
|
|
264
|
-
}
|
|
265
|
-
},
|
|
266
|
-
type: "if",
|
|
267
|
-
locations: [{
|
|
268
|
-
start: {
|
|
269
|
-
line: 14,
|
|
270
|
-
column: 11
|
|
271
|
-
},
|
|
272
|
-
end: {
|
|
273
|
-
line: 22,
|
|
274
|
-
column: 5
|
|
275
|
-
}
|
|
276
|
-
}, {
|
|
277
|
-
start: {
|
|
278
|
-
line: undefined,
|
|
279
|
-
column: undefined
|
|
280
|
-
},
|
|
281
|
-
end: {
|
|
282
|
-
line: undefined,
|
|
283
|
-
column: undefined
|
|
284
|
-
}
|
|
285
|
-
}],
|
|
286
|
-
line: 14
|
|
287
|
-
},
|
|
288
|
-
"5": {
|
|
289
|
-
loc: {
|
|
290
|
-
start: {
|
|
291
|
-
line: 17,
|
|
292
|
-
column: 6
|
|
293
|
-
},
|
|
294
|
-
end: {
|
|
295
|
-
line: 20,
|
|
296
|
-
column: 7
|
|
297
|
-
}
|
|
298
|
-
},
|
|
299
|
-
type: "if",
|
|
300
|
-
locations: [{
|
|
301
|
-
start: {
|
|
302
|
-
line: 17,
|
|
303
|
-
column: 6
|
|
304
|
-
},
|
|
305
|
-
end: {
|
|
306
|
-
line: 20,
|
|
307
|
-
column: 7
|
|
308
|
-
}
|
|
309
|
-
}, {
|
|
310
|
-
start: {
|
|
311
|
-
line: undefined,
|
|
312
|
-
column: undefined
|
|
313
|
-
},
|
|
314
|
-
end: {
|
|
315
|
-
line: undefined,
|
|
316
|
-
column: undefined
|
|
317
|
-
}
|
|
318
|
-
}],
|
|
319
|
-
line: 17
|
|
320
|
-
}
|
|
321
|
-
},
|
|
322
|
-
s: {
|
|
323
|
-
"0": 0,
|
|
324
|
-
"1": 0,
|
|
325
|
-
"2": 0,
|
|
326
|
-
"3": 0,
|
|
327
|
-
"4": 0,
|
|
328
|
-
"5": 0,
|
|
329
|
-
"6": 0,
|
|
330
|
-
"7": 0
|
|
331
|
-
},
|
|
332
|
-
f: {
|
|
333
|
-
"0": 0
|
|
334
|
-
},
|
|
335
|
-
b: {
|
|
336
|
-
"0": [0, 0],
|
|
337
|
-
"1": [0, 0],
|
|
338
|
-
"2": [0, 0],
|
|
339
|
-
"3": [0, 0],
|
|
340
|
-
"4": [0, 0],
|
|
341
|
-
"5": [0, 0]
|
|
342
|
-
},
|
|
343
|
-
_coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
|
|
344
|
-
hash: "4f6f52b87cc201f346900b4ddb8d92d48fe58a78"
|
|
345
|
-
};
|
|
346
|
-
var coverage = global[gcv] || (global[gcv] = {});
|
|
347
|
-
if (!coverage[path] || coverage[path].hash !== hash) {
|
|
348
|
-
coverage[path] = coverageData;
|
|
349
|
-
}
|
|
350
|
-
var actualCoverage = coverage[path];
|
|
351
|
-
{
|
|
352
|
-
// @ts-ignore
|
|
353
|
-
cov_27tktivjps = function () {
|
|
354
|
-
return actualCoverage;
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
return actualCoverage;
|
|
358
|
-
}
|
|
359
|
-
cov_27tktivjps();
|
|
360
|
-
var _default = getNormalizedConfig; // Given a config and content, plucks the actual
|
|
7
|
+
var _default = exports.default = getNormalizedConfig; // Given a config and content, plucks the actual
|
|
361
8
|
// settings that we're interested in
|
|
362
|
-
exports.default = _default;
|
|
363
9
|
function getNormalizedConfig(config, content) {
|
|
364
|
-
|
|
365
|
-
cov_27tktivjps().s[0]++;
|
|
366
|
-
if ((cov_27tktivjps().b[1][0]++, content) && (cov_27tktivjps().b[1][1]++, config === 'package.json')) {
|
|
367
|
-
cov_27tktivjps().b[0][0]++;
|
|
368
|
-
cov_27tktivjps().s[1]++;
|
|
10
|
+
if (content && config === 'package.json') {
|
|
369
11
|
// PACKAGE.JSON
|
|
370
12
|
|
|
371
13
|
// Use the npm config key, be good citizens
|
|
372
|
-
if (
|
|
373
|
-
cov_27tktivjps().b[2][0]++;
|
|
374
|
-
cov_27tktivjps().s[2]++;
|
|
14
|
+
if (content.config && content.config.commitizen) {
|
|
375
15
|
return content.config.commitizen;
|
|
376
|
-
} else {
|
|
377
|
-
|
|
378
|
-
cov_27tktivjps().s[3]++;
|
|
379
|
-
if (content.czConfig) {
|
|
380
|
-
cov_27tktivjps().b[4][0]++;
|
|
381
|
-
cov_27tktivjps().s[4]++;
|
|
382
|
-
// Old method, will be deprecated in 3.0.0
|
|
16
|
+
} else if (content.czConfig) {
|
|
17
|
+
// Old method, will be deprecated in 3.0.0
|
|
383
18
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
console.error("\n********\nWARNING: This repository's package.json is using czConfig. czConfig will be deprecated in Commitizen 3. \nPlease use this instead:\n{\n \"config\": {\n \"commitizen\": {\n \"path\": \"./path/to/adapter\"\n }\n }\n}\nFor more information, see: http://commitizen.github.io/cz-cli/\n********\n");
|
|
389
|
-
} else {
|
|
390
|
-
cov_27tktivjps().b[5][1]++;
|
|
391
|
-
}
|
|
392
|
-
cov_27tktivjps().s[6]++;
|
|
393
|
-
return content.czConfig;
|
|
394
|
-
} else {
|
|
395
|
-
cov_27tktivjps().b[4][1]++;
|
|
19
|
+
// Suppress during test
|
|
20
|
+
/* istanbul ignore if */
|
|
21
|
+
if (typeof global.it !== 'function') {
|
|
22
|
+
console.error("\n********\nWARNING: This repository's package.json is using czConfig. czConfig will be deprecated in Commitizen 3. \nPlease use this instead:\n{\n \"config\": {\n \"commitizen\": {\n \"path\": \"./path/to/adapter\"\n }\n }\n}\nFor more information, see: http://commitizen.github.io/cz-cli/\n********\n");
|
|
396
23
|
}
|
|
24
|
+
return content.czConfig;
|
|
397
25
|
}
|
|
398
26
|
} else {
|
|
399
|
-
cov_27tktivjps().b[0][1]++;
|
|
400
|
-
cov_27tktivjps().s[7]++;
|
|
401
27
|
// .cz.json or .czrc
|
|
402
28
|
return content;
|
|
403
29
|
}
|