commitizen 4.3.2 → 5.0.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/.github/workflows/release.yml +8 -5
- package/.husky/pre-commit +1 -0
- package/CONTRIBUTING.md +72 -21
- package/README.md +6 -6
- package/babel.config.js +21 -10
- package/bin/git-cz.js +1 -1
- package/dist/cli/parsers/commitizen.js +7 -1
- package/dist/cli/parsers.js +2 -1
- package/dist/cli/strategies/git-cz.js +3 -3
- package/dist/cli/strategies/git.js +2 -2
- package/dist/commitizen/adapter.js +52 -1411
- package/dist/commitizen/cache.js +6 -237
- package/dist/commitizen/commit.js +14 -562
- package/dist/commitizen/configLoader.js +1 -84
- package/dist/commitizen/init.js +30 -976
- package/dist/commitizen/staging.js +3 -255
- package/dist/commitizen.js +2 -1
- package/dist/common/util.js +49 -444
- package/dist/configLoader/findup.js +7 -312
- package/dist/configLoader/getContent.js +17 -644
- package/dist/configLoader/getNormalizedConfig.js +9 -382
- package/dist/configLoader/loader.js +4 -371
- package/dist/git/add.js +3 -113
- package/dist/git/commit.js +19 -801
- package/dist/git/init.js +2 -74
- package/dist/git/log.js +2 -175
- package/dist/git/whatChanged.js +2 -175
- package/dist/index.js +1 -56
- package/dist/npm.js +1 -32
- package/jobs/build.yml +17 -16
- package/package.json +63 -46
- package/pnpm-workspace.yaml +7 -0
package/dist/commitizen/init.js
CHANGED
|
@@ -4,934 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var _nodeChild_process = _interopRequireDefault(require("node:child_process"));
|
|
8
|
+
var _nodePath = _interopRequireDefault(require("node:path"));
|
|
9
9
|
var configLoader = _interopRequireWildcard(require("./configLoader"));
|
|
10
10
|
var adapter = _interopRequireWildcard(require("./adapter"));
|
|
11
|
-
|
|
11
|
+
var e;
|
|
12
|
+
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; }
|
|
12
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
function cov_1ss29zpusr() {
|
|
14
|
-
var path = "/home/runner/work/cz-cli/cz-cli/src/commitizen/init.js";
|
|
15
|
-
var hash = "efe77f0db628ee432080465bad4470b265b5f217";
|
|
16
|
-
var global = new Function("return this")();
|
|
17
|
-
var gcv = "__coverage__";
|
|
18
|
-
var coverageData = {
|
|
19
|
-
path: "/home/runner/work/cz-cli/cz-cli/src/commitizen/init.js",
|
|
20
|
-
statementMap: {
|
|
21
|
-
"0": {
|
|
22
|
-
start: {
|
|
23
|
-
line: 10,
|
|
24
|
-
column: 4
|
|
25
|
-
},
|
|
26
|
-
end: {
|
|
27
|
-
line: 10,
|
|
28
|
-
column: 11
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"1": {
|
|
32
|
-
start: {
|
|
33
|
-
line: 14,
|
|
34
|
-
column: 17
|
|
35
|
-
},
|
|
36
|
-
end: {
|
|
37
|
-
line: 14,
|
|
38
|
-
column: 63
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
"2": {
|
|
42
|
-
start: {
|
|
43
|
-
line: 33,
|
|
44
|
-
column: 27
|
|
45
|
-
},
|
|
46
|
-
end: {
|
|
47
|
-
line: 46,
|
|
48
|
-
column: 1
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"3": {
|
|
52
|
-
start: {
|
|
53
|
-
line: 64,
|
|
54
|
-
column: 2
|
|
55
|
-
},
|
|
56
|
-
end: {
|
|
57
|
-
line: 64,
|
|
58
|
-
column: 51
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
"4": {
|
|
62
|
-
start: {
|
|
63
|
-
line: 67,
|
|
64
|
-
column: 22
|
|
65
|
-
},
|
|
66
|
-
end: {
|
|
67
|
-
line: 67,
|
|
68
|
-
column: 49
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
"5": {
|
|
72
|
-
start: {
|
|
73
|
-
line: 69,
|
|
74
|
-
column: 25
|
|
75
|
-
},
|
|
76
|
-
end: {
|
|
77
|
-
line: 69,
|
|
78
|
-
column: 62
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
"6": {
|
|
82
|
-
start: {
|
|
83
|
-
line: 72,
|
|
84
|
-
column: 25
|
|
85
|
-
},
|
|
86
|
-
end: {
|
|
87
|
-
line: 72,
|
|
88
|
-
column: 107
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
"7": {
|
|
92
|
-
start: {
|
|
93
|
-
line: 75,
|
|
94
|
-
column: 32
|
|
95
|
-
},
|
|
96
|
-
end: {
|
|
97
|
-
line: 75,
|
|
98
|
-
column: 109
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
"8": {
|
|
102
|
-
start: {
|
|
103
|
-
line: 77,
|
|
104
|
-
column: 35
|
|
105
|
-
},
|
|
106
|
-
end: {
|
|
107
|
-
line: 77,
|
|
108
|
-
column: 110
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
"9": {
|
|
112
|
-
start: {
|
|
113
|
-
line: 80,
|
|
114
|
-
column: 2
|
|
115
|
-
},
|
|
116
|
-
end: {
|
|
117
|
-
line: 88,
|
|
118
|
-
column: 3
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
"10": {
|
|
122
|
-
start: {
|
|
123
|
-
line: 81,
|
|
124
|
-
column: 4
|
|
125
|
-
},
|
|
126
|
-
end: {
|
|
127
|
-
line: 87,
|
|
128
|
-
column: 7
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
"11": {
|
|
132
|
-
start: {
|
|
133
|
-
line: 90,
|
|
134
|
-
column: 2
|
|
135
|
-
},
|
|
136
|
-
end: {
|
|
137
|
-
line: 98,
|
|
138
|
-
column: 3
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
"12": {
|
|
142
|
-
start: {
|
|
143
|
-
line: 91,
|
|
144
|
-
column: 4
|
|
145
|
-
},
|
|
146
|
-
end: {
|
|
147
|
-
line: 91,
|
|
148
|
-
column: 68
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
"13": {
|
|
152
|
-
start: {
|
|
153
|
-
line: 92,
|
|
154
|
-
column: 4
|
|
155
|
-
},
|
|
156
|
-
end: {
|
|
157
|
-
line: 94,
|
|
158
|
-
column: 5
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
"14": {
|
|
162
|
-
start: {
|
|
163
|
-
line: 93,
|
|
164
|
-
column: 6
|
|
165
|
-
},
|
|
166
|
-
end: {
|
|
167
|
-
line: 93,
|
|
168
|
-
column: 73
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
"15": {
|
|
172
|
-
start: {
|
|
173
|
-
line: 95,
|
|
174
|
-
column: 4
|
|
175
|
-
},
|
|
176
|
-
end: {
|
|
177
|
-
line: 95,
|
|
178
|
-
column: 63
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
"16": {
|
|
182
|
-
start: {
|
|
183
|
-
line: 97,
|
|
184
|
-
column: 4
|
|
185
|
-
},
|
|
186
|
-
end: {
|
|
187
|
-
line: 97,
|
|
188
|
-
column: 21
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
"17": {
|
|
192
|
-
start: {
|
|
193
|
-
line: 106,
|
|
194
|
-
column: 2
|
|
195
|
-
},
|
|
196
|
-
end: {
|
|
197
|
-
line: 108,
|
|
198
|
-
column: 3
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
"18": {
|
|
202
|
-
start: {
|
|
203
|
-
line: 107,
|
|
204
|
-
column: 4
|
|
205
|
-
},
|
|
206
|
-
end: {
|
|
207
|
-
line: 107,
|
|
208
|
-
column: 59
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
"19": {
|
|
212
|
-
start: {
|
|
213
|
-
line: 109,
|
|
214
|
-
column: 2
|
|
215
|
-
},
|
|
216
|
-
end: {
|
|
217
|
-
line: 111,
|
|
218
|
-
column: 3
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
"20": {
|
|
222
|
-
start: {
|
|
223
|
-
line: 110,
|
|
224
|
-
column: 4
|
|
225
|
-
},
|
|
226
|
-
end: {
|
|
227
|
-
line: 110,
|
|
228
|
-
column: 77
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
"21": {
|
|
232
|
-
start: {
|
|
233
|
-
line: 119,
|
|
234
|
-
column: 15
|
|
235
|
-
},
|
|
236
|
-
end: {
|
|
237
|
-
line: 119,
|
|
238
|
-
column: 43
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
"22": {
|
|
242
|
-
start: {
|
|
243
|
-
line: 120,
|
|
244
|
-
column: 2
|
|
245
|
-
},
|
|
246
|
-
end: {
|
|
247
|
-
line: 124,
|
|
248
|
-
column: 3
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
"23": {
|
|
252
|
-
start: {
|
|
253
|
-
line: 121,
|
|
254
|
-
column: 4
|
|
255
|
-
},
|
|
256
|
-
end: {
|
|
257
|
-
line: 121,
|
|
258
|
-
column: 18
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
},
|
|
262
|
-
fnMap: {
|
|
263
|
-
"0": {
|
|
264
|
-
name: "init",
|
|
265
|
-
decl: {
|
|
266
|
-
start: {
|
|
267
|
-
line: 51,
|
|
268
|
-
column: 9
|
|
269
|
-
},
|
|
270
|
-
end: {
|
|
271
|
-
line: 51,
|
|
272
|
-
column: 13
|
|
273
|
-
}
|
|
274
|
-
},
|
|
275
|
-
loc: {
|
|
276
|
-
start: {
|
|
277
|
-
line: 61,
|
|
278
|
-
column: 24
|
|
279
|
-
},
|
|
280
|
-
end: {
|
|
281
|
-
line: 99,
|
|
282
|
-
column: 1
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
line: 61
|
|
286
|
-
},
|
|
287
|
-
"1": {
|
|
288
|
-
name: "checkRequiredArguments",
|
|
289
|
-
decl: {
|
|
290
|
-
start: {
|
|
291
|
-
line: 105,
|
|
292
|
-
column: 9
|
|
293
|
-
},
|
|
294
|
-
end: {
|
|
295
|
-
line: 105,
|
|
296
|
-
column: 31
|
|
297
|
-
}
|
|
298
|
-
},
|
|
299
|
-
loc: {
|
|
300
|
-
start: {
|
|
301
|
-
line: 105,
|
|
302
|
-
column: 55
|
|
303
|
-
},
|
|
304
|
-
end: {
|
|
305
|
-
line: 112,
|
|
306
|
-
column: 1
|
|
307
|
-
}
|
|
308
|
-
},
|
|
309
|
-
line: 105
|
|
310
|
-
},
|
|
311
|
-
"2": {
|
|
312
|
-
name: "loadAdapterConfig",
|
|
313
|
-
decl: {
|
|
314
|
-
start: {
|
|
315
|
-
line: 118,
|
|
316
|
-
column: 9
|
|
317
|
-
},
|
|
318
|
-
end: {
|
|
319
|
-
line: 118,
|
|
320
|
-
column: 26
|
|
321
|
-
}
|
|
322
|
-
},
|
|
323
|
-
loc: {
|
|
324
|
-
start: {
|
|
325
|
-
line: 118,
|
|
326
|
-
column: 33
|
|
327
|
-
},
|
|
328
|
-
end: {
|
|
329
|
-
line: 125,
|
|
330
|
-
column: 1
|
|
331
|
-
}
|
|
332
|
-
},
|
|
333
|
-
line: 118
|
|
334
|
-
}
|
|
335
|
-
},
|
|
336
|
-
branchMap: {
|
|
337
|
-
"0": {
|
|
338
|
-
loc: {
|
|
339
|
-
start: {
|
|
340
|
-
line: 51,
|
|
341
|
-
column: 41
|
|
342
|
-
},
|
|
343
|
-
end: {
|
|
344
|
-
line: 61,
|
|
345
|
-
column: 22
|
|
346
|
-
}
|
|
347
|
-
},
|
|
348
|
-
type: "default-arg",
|
|
349
|
-
locations: [{
|
|
350
|
-
start: {
|
|
351
|
-
line: 61,
|
|
352
|
-
column: 4
|
|
353
|
-
},
|
|
354
|
-
end: {
|
|
355
|
-
line: 61,
|
|
356
|
-
column: 22
|
|
357
|
-
}
|
|
358
|
-
}],
|
|
359
|
-
line: 51
|
|
360
|
-
},
|
|
361
|
-
"1": {
|
|
362
|
-
loc: {
|
|
363
|
-
start: {
|
|
364
|
-
line: 52,
|
|
365
|
-
column: 2
|
|
366
|
-
},
|
|
367
|
-
end: {
|
|
368
|
-
line: 52,
|
|
369
|
-
column: 14
|
|
370
|
-
}
|
|
371
|
-
},
|
|
372
|
-
type: "default-arg",
|
|
373
|
-
locations: [{
|
|
374
|
-
start: {
|
|
375
|
-
line: 52,
|
|
376
|
-
column: 9
|
|
377
|
-
},
|
|
378
|
-
end: {
|
|
379
|
-
line: 52,
|
|
380
|
-
column: 14
|
|
381
|
-
}
|
|
382
|
-
}],
|
|
383
|
-
line: 52
|
|
384
|
-
},
|
|
385
|
-
"2": {
|
|
386
|
-
loc: {
|
|
387
|
-
start: {
|
|
388
|
-
line: 53,
|
|
389
|
-
column: 2
|
|
390
|
-
},
|
|
391
|
-
end: {
|
|
392
|
-
line: 53,
|
|
393
|
-
column: 16
|
|
394
|
-
}
|
|
395
|
-
},
|
|
396
|
-
type: "default-arg",
|
|
397
|
-
locations: [{
|
|
398
|
-
start: {
|
|
399
|
-
line: 53,
|
|
400
|
-
column: 12
|
|
401
|
-
},
|
|
402
|
-
end: {
|
|
403
|
-
line: 53,
|
|
404
|
-
column: 16
|
|
405
|
-
}
|
|
406
|
-
}],
|
|
407
|
-
line: 53
|
|
408
|
-
},
|
|
409
|
-
"3": {
|
|
410
|
-
loc: {
|
|
411
|
-
start: {
|
|
412
|
-
line: 54,
|
|
413
|
-
column: 2
|
|
414
|
-
},
|
|
415
|
-
end: {
|
|
416
|
-
line: 54,
|
|
417
|
-
column: 19
|
|
418
|
-
}
|
|
419
|
-
},
|
|
420
|
-
type: "default-arg",
|
|
421
|
-
locations: [{
|
|
422
|
-
start: {
|
|
423
|
-
line: 54,
|
|
424
|
-
column: 14
|
|
425
|
-
},
|
|
426
|
-
end: {
|
|
427
|
-
line: 54,
|
|
428
|
-
column: 19
|
|
429
|
-
}
|
|
430
|
-
}],
|
|
431
|
-
line: 54
|
|
432
|
-
},
|
|
433
|
-
"4": {
|
|
434
|
-
loc: {
|
|
435
|
-
start: {
|
|
436
|
-
line: 55,
|
|
437
|
-
column: 2
|
|
438
|
-
},
|
|
439
|
-
end: {
|
|
440
|
-
line: 55,
|
|
441
|
-
column: 15
|
|
442
|
-
}
|
|
443
|
-
},
|
|
444
|
-
type: "default-arg",
|
|
445
|
-
locations: [{
|
|
446
|
-
start: {
|
|
447
|
-
line: 55,
|
|
448
|
-
column: 10
|
|
449
|
-
},
|
|
450
|
-
end: {
|
|
451
|
-
line: 55,
|
|
452
|
-
column: 15
|
|
453
|
-
}
|
|
454
|
-
}],
|
|
455
|
-
line: 55
|
|
456
|
-
},
|
|
457
|
-
"5": {
|
|
458
|
-
loc: {
|
|
459
|
-
start: {
|
|
460
|
-
line: 56,
|
|
461
|
-
column: 2
|
|
462
|
-
},
|
|
463
|
-
end: {
|
|
464
|
-
line: 56,
|
|
465
|
-
column: 14
|
|
466
|
-
}
|
|
467
|
-
},
|
|
468
|
-
type: "default-arg",
|
|
469
|
-
locations: [{
|
|
470
|
-
start: {
|
|
471
|
-
line: 56,
|
|
472
|
-
column: 9
|
|
473
|
-
},
|
|
474
|
-
end: {
|
|
475
|
-
line: 56,
|
|
476
|
-
column: 14
|
|
477
|
-
}
|
|
478
|
-
}],
|
|
479
|
-
line: 56
|
|
480
|
-
},
|
|
481
|
-
"6": {
|
|
482
|
-
loc: {
|
|
483
|
-
start: {
|
|
484
|
-
line: 57,
|
|
485
|
-
column: 2
|
|
486
|
-
},
|
|
487
|
-
end: {
|
|
488
|
-
line: 57,
|
|
489
|
-
column: 13
|
|
490
|
-
}
|
|
491
|
-
},
|
|
492
|
-
type: "default-arg",
|
|
493
|
-
locations: [{
|
|
494
|
-
start: {
|
|
495
|
-
line: 57,
|
|
496
|
-
column: 8
|
|
497
|
-
},
|
|
498
|
-
end: {
|
|
499
|
-
line: 57,
|
|
500
|
-
column: 13
|
|
501
|
-
}
|
|
502
|
-
}],
|
|
503
|
-
line: 57
|
|
504
|
-
},
|
|
505
|
-
"7": {
|
|
506
|
-
loc: {
|
|
507
|
-
start: {
|
|
508
|
-
line: 58,
|
|
509
|
-
column: 2
|
|
510
|
-
},
|
|
511
|
-
end: {
|
|
512
|
-
line: 58,
|
|
513
|
-
column: 15
|
|
514
|
-
}
|
|
515
|
-
},
|
|
516
|
-
type: "default-arg",
|
|
517
|
-
locations: [{
|
|
518
|
-
start: {
|
|
519
|
-
line: 58,
|
|
520
|
-
column: 10
|
|
521
|
-
},
|
|
522
|
-
end: {
|
|
523
|
-
line: 58,
|
|
524
|
-
column: 15
|
|
525
|
-
}
|
|
526
|
-
}],
|
|
527
|
-
line: 58
|
|
528
|
-
},
|
|
529
|
-
"8": {
|
|
530
|
-
loc: {
|
|
531
|
-
start: {
|
|
532
|
-
line: 59,
|
|
533
|
-
column: 2
|
|
534
|
-
},
|
|
535
|
-
end: {
|
|
536
|
-
line: 59,
|
|
537
|
-
column: 14
|
|
538
|
-
}
|
|
539
|
-
},
|
|
540
|
-
type: "default-arg",
|
|
541
|
-
locations: [{
|
|
542
|
-
start: {
|
|
543
|
-
line: 59,
|
|
544
|
-
column: 9
|
|
545
|
-
},
|
|
546
|
-
end: {
|
|
547
|
-
line: 59,
|
|
548
|
-
column: 14
|
|
549
|
-
}
|
|
550
|
-
}],
|
|
551
|
-
line: 59
|
|
552
|
-
},
|
|
553
|
-
"9": {
|
|
554
|
-
loc: {
|
|
555
|
-
start: {
|
|
556
|
-
line: 60,
|
|
557
|
-
column: 2
|
|
558
|
-
},
|
|
559
|
-
end: {
|
|
560
|
-
line: 60,
|
|
561
|
-
column: 27
|
|
562
|
-
}
|
|
563
|
-
},
|
|
564
|
-
type: "default-arg",
|
|
565
|
-
locations: [{
|
|
566
|
-
start: {
|
|
567
|
-
line: 60,
|
|
568
|
-
column: 22
|
|
569
|
-
},
|
|
570
|
-
end: {
|
|
571
|
-
line: 60,
|
|
572
|
-
column: 27
|
|
573
|
-
}
|
|
574
|
-
}],
|
|
575
|
-
line: 60
|
|
576
|
-
},
|
|
577
|
-
"10": {
|
|
578
|
-
loc: {
|
|
579
|
-
start: {
|
|
580
|
-
line: 69,
|
|
581
|
-
column: 25
|
|
582
|
-
},
|
|
583
|
-
end: {
|
|
584
|
-
line: 69,
|
|
585
|
-
column: 62
|
|
586
|
-
}
|
|
587
|
-
},
|
|
588
|
-
type: "cond-expr",
|
|
589
|
-
locations: [{
|
|
590
|
-
start: {
|
|
591
|
-
line: 69,
|
|
592
|
-
column: 32
|
|
593
|
-
},
|
|
594
|
-
end: {
|
|
595
|
-
line: 69,
|
|
596
|
-
column: 38
|
|
597
|
-
}
|
|
598
|
-
}, {
|
|
599
|
-
start: {
|
|
600
|
-
line: 69,
|
|
601
|
-
column: 41
|
|
602
|
-
},
|
|
603
|
-
end: {
|
|
604
|
-
line: 69,
|
|
605
|
-
column: 62
|
|
606
|
-
}
|
|
607
|
-
}],
|
|
608
|
-
line: 69
|
|
609
|
-
},
|
|
610
|
-
"11": {
|
|
611
|
-
loc: {
|
|
612
|
-
start: {
|
|
613
|
-
line: 69,
|
|
614
|
-
column: 41
|
|
615
|
-
},
|
|
616
|
-
end: {
|
|
617
|
-
line: 69,
|
|
618
|
-
column: 62
|
|
619
|
-
}
|
|
620
|
-
},
|
|
621
|
-
type: "cond-expr",
|
|
622
|
-
locations: [{
|
|
623
|
-
start: {
|
|
624
|
-
line: 69,
|
|
625
|
-
column: 48
|
|
626
|
-
},
|
|
627
|
-
end: {
|
|
628
|
-
line: 69,
|
|
629
|
-
column: 54
|
|
630
|
-
}
|
|
631
|
-
}, {
|
|
632
|
-
start: {
|
|
633
|
-
line: 69,
|
|
634
|
-
column: 57
|
|
635
|
-
},
|
|
636
|
-
end: {
|
|
637
|
-
line: 69,
|
|
638
|
-
column: 62
|
|
639
|
-
}
|
|
640
|
-
}],
|
|
641
|
-
line: 69
|
|
642
|
-
},
|
|
643
|
-
"12": {
|
|
644
|
-
loc: {
|
|
645
|
-
start: {
|
|
646
|
-
line: 80,
|
|
647
|
-
column: 2
|
|
648
|
-
},
|
|
649
|
-
end: {
|
|
650
|
-
line: 88,
|
|
651
|
-
column: 3
|
|
652
|
-
}
|
|
653
|
-
},
|
|
654
|
-
type: "if",
|
|
655
|
-
locations: [{
|
|
656
|
-
start: {
|
|
657
|
-
line: 80,
|
|
658
|
-
column: 2
|
|
659
|
-
},
|
|
660
|
-
end: {
|
|
661
|
-
line: 88,
|
|
662
|
-
column: 3
|
|
663
|
-
}
|
|
664
|
-
}, {
|
|
665
|
-
start: {
|
|
666
|
-
line: undefined,
|
|
667
|
-
column: undefined
|
|
668
|
-
},
|
|
669
|
-
end: {
|
|
670
|
-
line: undefined,
|
|
671
|
-
column: undefined
|
|
672
|
-
}
|
|
673
|
-
}],
|
|
674
|
-
line: 80
|
|
675
|
-
},
|
|
676
|
-
"13": {
|
|
677
|
-
loc: {
|
|
678
|
-
start: {
|
|
679
|
-
line: 80,
|
|
680
|
-
column: 6
|
|
681
|
-
},
|
|
682
|
-
end: {
|
|
683
|
-
line: 80,
|
|
684
|
-
column: 84
|
|
685
|
-
}
|
|
686
|
-
},
|
|
687
|
-
type: "binary-expr",
|
|
688
|
-
locations: [{
|
|
689
|
-
start: {
|
|
690
|
-
line: 80,
|
|
691
|
-
column: 6
|
|
692
|
-
},
|
|
693
|
-
end: {
|
|
694
|
-
line: 80,
|
|
695
|
-
column: 19
|
|
696
|
-
}
|
|
697
|
-
}, {
|
|
698
|
-
start: {
|
|
699
|
-
line: 80,
|
|
700
|
-
column: 23
|
|
701
|
-
},
|
|
702
|
-
end: {
|
|
703
|
-
line: 80,
|
|
704
|
-
column: 41
|
|
705
|
-
}
|
|
706
|
-
}, {
|
|
707
|
-
start: {
|
|
708
|
-
line: 80,
|
|
709
|
-
column: 45
|
|
710
|
-
},
|
|
711
|
-
end: {
|
|
712
|
-
line: 80,
|
|
713
|
-
column: 74
|
|
714
|
-
}
|
|
715
|
-
}, {
|
|
716
|
-
start: {
|
|
717
|
-
line: 80,
|
|
718
|
-
column: 78
|
|
719
|
-
},
|
|
720
|
-
end: {
|
|
721
|
-
line: 80,
|
|
722
|
-
column: 84
|
|
723
|
-
}
|
|
724
|
-
}],
|
|
725
|
-
line: 80
|
|
726
|
-
},
|
|
727
|
-
"14": {
|
|
728
|
-
loc: {
|
|
729
|
-
start: {
|
|
730
|
-
line: 92,
|
|
731
|
-
column: 4
|
|
732
|
-
},
|
|
733
|
-
end: {
|
|
734
|
-
line: 94,
|
|
735
|
-
column: 5
|
|
736
|
-
}
|
|
737
|
-
},
|
|
738
|
-
type: "if",
|
|
739
|
-
locations: [{
|
|
740
|
-
start: {
|
|
741
|
-
line: 92,
|
|
742
|
-
column: 4
|
|
743
|
-
},
|
|
744
|
-
end: {
|
|
745
|
-
line: 94,
|
|
746
|
-
column: 5
|
|
747
|
-
}
|
|
748
|
-
}, {
|
|
749
|
-
start: {
|
|
750
|
-
line: undefined,
|
|
751
|
-
column: undefined
|
|
752
|
-
},
|
|
753
|
-
end: {
|
|
754
|
-
line: undefined,
|
|
755
|
-
column: undefined
|
|
756
|
-
}
|
|
757
|
-
}],
|
|
758
|
-
line: 92
|
|
759
|
-
},
|
|
760
|
-
"15": {
|
|
761
|
-
loc: {
|
|
762
|
-
start: {
|
|
763
|
-
line: 106,
|
|
764
|
-
column: 2
|
|
765
|
-
},
|
|
766
|
-
end: {
|
|
767
|
-
line: 108,
|
|
768
|
-
column: 3
|
|
769
|
-
}
|
|
770
|
-
},
|
|
771
|
-
type: "if",
|
|
772
|
-
locations: [{
|
|
773
|
-
start: {
|
|
774
|
-
line: 106,
|
|
775
|
-
column: 2
|
|
776
|
-
},
|
|
777
|
-
end: {
|
|
778
|
-
line: 108,
|
|
779
|
-
column: 3
|
|
780
|
-
}
|
|
781
|
-
}, {
|
|
782
|
-
start: {
|
|
783
|
-
line: undefined,
|
|
784
|
-
column: undefined
|
|
785
|
-
},
|
|
786
|
-
end: {
|
|
787
|
-
line: undefined,
|
|
788
|
-
column: undefined
|
|
789
|
-
}
|
|
790
|
-
}],
|
|
791
|
-
line: 106
|
|
792
|
-
},
|
|
793
|
-
"16": {
|
|
794
|
-
loc: {
|
|
795
|
-
start: {
|
|
796
|
-
line: 109,
|
|
797
|
-
column: 2
|
|
798
|
-
},
|
|
799
|
-
end: {
|
|
800
|
-
line: 111,
|
|
801
|
-
column: 3
|
|
802
|
-
}
|
|
803
|
-
},
|
|
804
|
-
type: "if",
|
|
805
|
-
locations: [{
|
|
806
|
-
start: {
|
|
807
|
-
line: 109,
|
|
808
|
-
column: 2
|
|
809
|
-
},
|
|
810
|
-
end: {
|
|
811
|
-
line: 111,
|
|
812
|
-
column: 3
|
|
813
|
-
}
|
|
814
|
-
}, {
|
|
815
|
-
start: {
|
|
816
|
-
line: undefined,
|
|
817
|
-
column: undefined
|
|
818
|
-
},
|
|
819
|
-
end: {
|
|
820
|
-
line: undefined,
|
|
821
|
-
column: undefined
|
|
822
|
-
}
|
|
823
|
-
}],
|
|
824
|
-
line: 109
|
|
825
|
-
},
|
|
826
|
-
"17": {
|
|
827
|
-
loc: {
|
|
828
|
-
start: {
|
|
829
|
-
line: 120,
|
|
830
|
-
column: 2
|
|
831
|
-
},
|
|
832
|
-
end: {
|
|
833
|
-
line: 124,
|
|
834
|
-
column: 3
|
|
835
|
-
}
|
|
836
|
-
},
|
|
837
|
-
type: "if",
|
|
838
|
-
locations: [{
|
|
839
|
-
start: {
|
|
840
|
-
line: 120,
|
|
841
|
-
column: 2
|
|
842
|
-
},
|
|
843
|
-
end: {
|
|
844
|
-
line: 124,
|
|
845
|
-
column: 3
|
|
846
|
-
}
|
|
847
|
-
}, {
|
|
848
|
-
start: {
|
|
849
|
-
line: 122,
|
|
850
|
-
column: 9
|
|
851
|
-
},
|
|
852
|
-
end: {
|
|
853
|
-
line: 124,
|
|
854
|
-
column: 3
|
|
855
|
-
}
|
|
856
|
-
}],
|
|
857
|
-
line: 120
|
|
858
|
-
}
|
|
859
|
-
},
|
|
860
|
-
s: {
|
|
861
|
-
"0": 0,
|
|
862
|
-
"1": 0,
|
|
863
|
-
"2": 0,
|
|
864
|
-
"3": 0,
|
|
865
|
-
"4": 0,
|
|
866
|
-
"5": 0,
|
|
867
|
-
"6": 0,
|
|
868
|
-
"7": 0,
|
|
869
|
-
"8": 0,
|
|
870
|
-
"9": 0,
|
|
871
|
-
"10": 0,
|
|
872
|
-
"11": 0,
|
|
873
|
-
"12": 0,
|
|
874
|
-
"13": 0,
|
|
875
|
-
"14": 0,
|
|
876
|
-
"15": 0,
|
|
877
|
-
"16": 0,
|
|
878
|
-
"17": 0,
|
|
879
|
-
"18": 0,
|
|
880
|
-
"19": 0,
|
|
881
|
-
"20": 0,
|
|
882
|
-
"21": 0,
|
|
883
|
-
"22": 0,
|
|
884
|
-
"23": 0
|
|
885
|
-
},
|
|
886
|
-
f: {
|
|
887
|
-
"0": 0,
|
|
888
|
-
"1": 0,
|
|
889
|
-
"2": 0
|
|
890
|
-
},
|
|
891
|
-
b: {
|
|
892
|
-
"0": [0],
|
|
893
|
-
"1": [0],
|
|
894
|
-
"2": [0],
|
|
895
|
-
"3": [0],
|
|
896
|
-
"4": [0],
|
|
897
|
-
"5": [0],
|
|
898
|
-
"6": [0],
|
|
899
|
-
"7": [0],
|
|
900
|
-
"8": [0],
|
|
901
|
-
"9": [0],
|
|
902
|
-
"10": [0, 0],
|
|
903
|
-
"11": [0, 0],
|
|
904
|
-
"12": [0, 0],
|
|
905
|
-
"13": [0, 0, 0, 0],
|
|
906
|
-
"14": [0, 0],
|
|
907
|
-
"15": [0, 0],
|
|
908
|
-
"16": [0, 0],
|
|
909
|
-
"17": [0, 0]
|
|
910
|
-
},
|
|
911
|
-
_coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
|
|
912
|
-
hash: "efe77f0db628ee432080465bad4470b265b5f217"
|
|
913
|
-
};
|
|
914
|
-
var coverage = global[gcv] || (global[gcv] = {});
|
|
915
|
-
if (!coverage[path] || coverage[path].hash !== hash) {
|
|
916
|
-
coverage[path] = coverageData;
|
|
917
|
-
}
|
|
918
|
-
var actualCoverage = coverage[path];
|
|
919
|
-
{
|
|
920
|
-
// @ts-ignore
|
|
921
|
-
cov_1ss29zpusr = function () {
|
|
922
|
-
return actualCoverage;
|
|
923
|
-
};
|
|
924
|
-
}
|
|
925
|
-
return actualCoverage;
|
|
926
|
-
}
|
|
927
|
-
cov_1ss29zpusr();
|
|
928
14
|
let {
|
|
929
15
|
addPathToAdapterConfig,
|
|
930
16
|
generateInstallAdapterCommand,
|
|
931
17
|
getInstallStringMappings
|
|
932
|
-
} =
|
|
18
|
+
} = adapter;
|
|
933
19
|
var _default = exports.default = init;
|
|
934
|
-
const CLI_PATH =
|
|
20
|
+
const CLI_PATH = _nodePath.default.normalize(_nodePath.default.join(__dirname, '../../'));
|
|
935
21
|
|
|
936
22
|
/**
|
|
937
23
|
* CZ INIT
|
|
@@ -950,7 +36,7 @@ const CLI_PATH = (cov_1ss29zpusr().s[1]++, _path.default.normalize(_path.default
|
|
|
950
36
|
/**
|
|
951
37
|
* The defaults for init
|
|
952
38
|
*/
|
|
953
|
-
const defaultInitOptions =
|
|
39
|
+
const defaultInitOptions = {
|
|
954
40
|
save: false,
|
|
955
41
|
saveDev: true,
|
|
956
42
|
saveExact: false,
|
|
@@ -963,49 +49,45 @@ const defaultInitOptions = (cov_1ss29zpusr().s[2]++, {
|
|
|
963
49
|
// should add trailing comma, thus next developer doesn't got blamed for this line
|
|
964
50
|
|
|
965
51
|
pnpm: false // reuses `save`, `saveDev`, `saveExact`
|
|
966
|
-
}
|
|
52
|
+
};
|
|
967
53
|
|
|
968
54
|
/**
|
|
969
55
|
* Runs npm install for the adapter then modifies the config.commitizen as needed
|
|
970
56
|
*/
|
|
971
57
|
function init(repoPath, adapterNpmName, {
|
|
972
|
-
save =
|
|
973
|
-
saveDev =
|
|
974
|
-
saveExact =
|
|
975
|
-
force =
|
|
976
|
-
yarn =
|
|
977
|
-
dev =
|
|
978
|
-
exact =
|
|
979
|
-
pnpm =
|
|
980
|
-
includeCommitizen =
|
|
981
|
-
} =
|
|
982
|
-
cov_1ss29zpusr().f[0]++;
|
|
983
|
-
cov_1ss29zpusr().s[3]++;
|
|
58
|
+
save = false,
|
|
59
|
+
saveDev = !save,
|
|
60
|
+
saveExact = false,
|
|
61
|
+
force = false,
|
|
62
|
+
yarn = false,
|
|
63
|
+
dev = false,
|
|
64
|
+
exact = false,
|
|
65
|
+
pnpm = false,
|
|
66
|
+
includeCommitizen = false
|
|
67
|
+
} = defaultInitOptions) {
|
|
984
68
|
// Don't let things move forward if required args are missing
|
|
985
69
|
checkRequiredArguments(repoPath, adapterNpmName);
|
|
986
70
|
|
|
987
71
|
// Load the current adapter config
|
|
988
|
-
let adapterConfig =
|
|
989
|
-
const packageManager =
|
|
72
|
+
let adapterConfig = loadAdapterConfig(repoPath);
|
|
73
|
+
const packageManager = yarn ? 'yarn' : pnpm ? 'pnpm' : 'npm';
|
|
990
74
|
|
|
991
75
|
// Get the npm string mappings based on the arguments provided
|
|
992
|
-
const stringMappings =
|
|
76
|
+
const stringMappings = getInstallStringMappings({
|
|
993
77
|
save,
|
|
994
78
|
dev,
|
|
995
79
|
saveDev,
|
|
80
|
+
exact,
|
|
996
81
|
saveExact,
|
|
997
82
|
force
|
|
998
|
-
}, packageManager)
|
|
83
|
+
}, packageManager);
|
|
999
84
|
|
|
1000
85
|
// Generate a string that represents the npm install command
|
|
1001
|
-
const installAdapterCommand =
|
|
1002
|
-
const installCommitizenCommand =
|
|
86
|
+
const installAdapterCommand = generateInstallAdapterCommand(stringMappings, adapterNpmName, packageManager);
|
|
87
|
+
const installCommitizenCommand = generateInstallAdapterCommand(stringMappings, 'commitizen', packageManager);
|
|
1003
88
|
|
|
1004
89
|
// Check for previously installed adapters
|
|
1005
|
-
|
|
1006
|
-
if ((cov_1ss29zpusr().b[13][0]++, adapterConfig) && (cov_1ss29zpusr().b[13][1]++, adapterConfig.path) && (cov_1ss29zpusr().b[13][2]++, adapterConfig.path.length > 0) && (cov_1ss29zpusr().b[13][3]++, !force)) {
|
|
1007
|
-
cov_1ss29zpusr().b[12][0]++;
|
|
1008
|
-
cov_1ss29zpusr().s[10]++;
|
|
90
|
+
if (adapterConfig && adapterConfig.path && adapterConfig.path.length > 0 && !force) {
|
|
1009
91
|
throw new Error(`A previous adapter is already configured. Use --force to override
|
|
1010
92
|
adapterConfig.path: ${adapterConfig.path}
|
|
1011
93
|
repoPath: ${repoPath}
|
|
@@ -1013,29 +95,18 @@ function init(repoPath, adapterNpmName, {
|
|
|
1013
95
|
installAdapterCommand: ${installAdapterCommand}
|
|
1014
96
|
adapterNpmName: ${adapterNpmName}
|
|
1015
97
|
`);
|
|
1016
|
-
} else {
|
|
1017
|
-
cov_1ss29zpusr().b[12][1]++;
|
|
1018
98
|
}
|
|
1019
|
-
cov_1ss29zpusr().s[11]++;
|
|
1020
99
|
try {
|
|
1021
|
-
|
|
1022
|
-
_child_process.default.execSync(installAdapterCommand, {
|
|
100
|
+
_nodeChild_process.default.execSync(installAdapterCommand, {
|
|
1023
101
|
cwd: repoPath
|
|
1024
102
|
});
|
|
1025
|
-
cov_1ss29zpusr().s[13]++;
|
|
1026
103
|
if (includeCommitizen) {
|
|
1027
|
-
|
|
1028
|
-
cov_1ss29zpusr().s[14]++;
|
|
1029
|
-
_child_process.default.execSync(installCommitizenCommand, {
|
|
104
|
+
_nodeChild_process.default.execSync(installCommitizenCommand, {
|
|
1030
105
|
cwd: repoPath
|
|
1031
106
|
});
|
|
1032
|
-
} else {
|
|
1033
|
-
cov_1ss29zpusr().b[14][1]++;
|
|
1034
107
|
}
|
|
1035
|
-
cov_1ss29zpusr().s[15]++;
|
|
1036
108
|
addPathToAdapterConfig(CLI_PATH, repoPath, adapterNpmName);
|
|
1037
109
|
} catch (e) {
|
|
1038
|
-
cov_1ss29zpusr().s[16]++;
|
|
1039
110
|
console.error(e);
|
|
1040
111
|
}
|
|
1041
112
|
}
|
|
@@ -1045,22 +116,11 @@ function init(repoPath, adapterNpmName, {
|
|
|
1045
116
|
* Throws an exception if any are not.
|
|
1046
117
|
*/
|
|
1047
118
|
function checkRequiredArguments(path, adapterNpmName) {
|
|
1048
|
-
cov_1ss29zpusr().f[1]++;
|
|
1049
|
-
cov_1ss29zpusr().s[17]++;
|
|
1050
119
|
if (!path) {
|
|
1051
|
-
cov_1ss29zpusr().b[15][0]++;
|
|
1052
|
-
cov_1ss29zpusr().s[18]++;
|
|
1053
120
|
throw new Error("Path is required when running init.");
|
|
1054
|
-
} else {
|
|
1055
|
-
cov_1ss29zpusr().b[15][1]++;
|
|
1056
121
|
}
|
|
1057
|
-
cov_1ss29zpusr().s[19]++;
|
|
1058
122
|
if (!adapterNpmName) {
|
|
1059
|
-
cov_1ss29zpusr().b[16][0]++;
|
|
1060
|
-
cov_1ss29zpusr().s[20]++;
|
|
1061
123
|
throw new Error("The adapter's npm name is required when running init.");
|
|
1062
|
-
} else {
|
|
1063
|
-
cov_1ss29zpusr().b[16][1]++;
|
|
1064
124
|
}
|
|
1065
125
|
}
|
|
1066
126
|
|
|
@@ -1069,14 +129,8 @@ function checkRequiredArguments(path, adapterNpmName) {
|
|
|
1069
129
|
* Loads and returns the adapter config at key config.commitizen, if it exists
|
|
1070
130
|
*/
|
|
1071
131
|
function loadAdapterConfig(cwd) {
|
|
1072
|
-
|
|
1073
|
-
let config = (cov_1ss29zpusr().s[21]++, configLoader.load(null, cwd));
|
|
1074
|
-
cov_1ss29zpusr().s[22]++;
|
|
132
|
+
let config = configLoader.load(null, cwd);
|
|
1075
133
|
if (config) {
|
|
1076
|
-
cov_1ss29zpusr().b[17][0]++;
|
|
1077
|
-
cov_1ss29zpusr().s[23]++;
|
|
1078
134
|
return config;
|
|
1079
|
-
} else {
|
|
1080
|
-
cov_1ss29zpusr().b[17][1]++;
|
|
1081
|
-
}
|
|
135
|
+
} else {}
|
|
1082
136
|
}
|