gitverse-release 3.2.0 → 3.3.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/dist/cli.js CHANGED
@@ -42,16 +42,36 @@ var DEFAULT_CONFIG = {
42
42
  test: "✅ Tests"
43
43
  }
44
44
  },
45
+ commitlint: {
46
+ comments: true,
47
+ format: "ts",
48
+ headerMaxLength: 100,
49
+ output: "commitlint.config.ts",
50
+ scopeRequired: false,
51
+ scopes: ["deps", "ci", "docs"]
52
+ },
45
53
  git: {
46
54
  commitChanges: true,
47
55
  commitMessage: "chore(release): {{package}} v{{version}} [skip ci]",
48
56
  push: true,
49
57
  tagMessage: "Release {{package}} v{{version}}"
50
58
  },
59
+ gitverse: {
60
+ checkExisting: true,
61
+ enabled: true,
62
+ failOnError: true
63
+ },
51
64
  monorepo: {
52
65
  enabled: false,
53
66
  packages: []
54
67
  },
68
+ retry: {
69
+ enabled: true,
70
+ initialDelay: 2000,
71
+ maxAttempts: 5,
72
+ maxDelay: 30000,
73
+ operations: ["push", "createRelease"]
74
+ },
55
75
  versioning: {
56
76
  allowPrerelease: false,
57
77
  preMajorMode: "auto",
@@ -83,14 +103,26 @@ function mergeConfig(defaults, user) {
83
103
  ...user.changelog?.types
84
104
  }
85
105
  },
106
+ commitlint: {
107
+ ...defaults.commitlint,
108
+ ...user.commitlint
109
+ },
86
110
  git: {
87
111
  ...defaults.git,
88
112
  ...user.git
89
113
  },
114
+ gitverse: {
115
+ ...defaults.gitverse,
116
+ ...user.gitverse
117
+ },
90
118
  monorepo: {
91
119
  ...defaults.monorepo,
92
120
  ...user.monorepo
93
121
  },
122
+ retry: {
123
+ ...defaults.retry,
124
+ ...user.retry
125
+ },
94
126
  versioning: {
95
127
  ...defaults.versioning,
96
128
  ...user.versioning
@@ -109,14 +141,14 @@ function validateConfig(config) {
109
141
  }
110
142
 
111
143
  // ../sdk/dist/api/organizations.js
112
- class j {
144
+ class k {
113
145
  client;
114
146
  constructor(b) {
115
147
  this.client = b;
116
148
  }
117
- async checkMembership(b, h) {
149
+ async checkMembership(b, h, j) {
118
150
  try {
119
- return await this.client.get(`/orgs/${b}/members/${h}`), true;
151
+ return await this.client.get(`/orgs/${b}/members/${h}`, j), true;
120
152
  } catch (d) {
121
153
  if (d instanceof Error && d.message.includes("404"))
122
154
  return false;
@@ -126,126 +158,126 @@ class j {
126
158
  }
127
159
 
128
160
  // ../sdk/dist/api/commits.js
129
- class g {
161
+ class j {
130
162
  client;
131
163
  constructor(b) {
132
164
  this.client = b;
133
165
  }
134
- list(b, d) {
135
- return this.client.get(`/repos/${b}/${d}/commits`);
166
+ list(b, d, f) {
167
+ return this.client.get(`/repos/${b}/${d}/commits`, f);
136
168
  }
137
- get(b, d, f) {
138
- return this.client.get(`/repos/${b}/${d}/commits/${f}`);
169
+ get(b, d, f, g) {
170
+ return this.client.get(`/repos/${b}/${d}/commits/${f}`, g);
139
171
  }
140
- create(b, d, f) {
141
- return this.client.post(`/repos/${b}/${d}/git/commits`, f);
172
+ create(b, d, f, g) {
173
+ return this.client.post(`/repos/${b}/${d}/git/commits`, f, g);
142
174
  }
143
175
  }
144
176
 
145
177
  // ../sdk/dist/api/actions.js
146
- class v {
178
+ class x {
147
179
  client;
148
180
  constructor(b) {
149
181
  this.client = b;
150
182
  }
151
- listOrgRunners(b) {
152
- return this.client.get(`/orgs/${b}/actions/runners`);
183
+ listOrgRunners(b, h) {
184
+ return this.client.get(`/orgs/${b}/actions/runners`, h);
153
185
  }
154
- createOrgRegistrationToken(b) {
155
- return this.client.post(`/orgs/${b}/actions/runners/registration-token`, {});
186
+ createOrgRegistrationToken(b, h) {
187
+ return this.client.post(`/orgs/${b}/actions/runners/registration-token`, {}, h);
156
188
  }
157
- getOrgRunner(b, h) {
158
- return this.client.get(`/orgs/${b}/actions/runners/${h}`);
189
+ getOrgRunner(b, h, j2) {
190
+ return this.client.get(`/orgs/${b}/actions/runners/${h}`, j2);
159
191
  }
160
- deleteOrgRunner(b, h) {
161
- return this.client.delete(`/orgs/${b}/actions/runners/${h}`);
192
+ deleteOrgRunner(b, h, j2) {
193
+ return this.client.delete(`/orgs/${b}/actions/runners/${h}`, undefined, j2);
162
194
  }
163
- listRepoRunners(b, h) {
164
- return this.client.get(`/repos/${b}/${h}/actions/runners`);
195
+ listRepoRunners(b, h, j2) {
196
+ return this.client.get(`/repos/${b}/${h}/actions/runners`, j2);
165
197
  }
166
- createRepoRegistrationToken(b, h) {
167
- return this.client.post(`/repos/${b}/${h}/actions/runners/registration-token`, {});
198
+ createRepoRegistrationToken(b, h, j2) {
199
+ return this.client.post(`/repos/${b}/${h}/actions/runners/registration-token`, {}, j2);
168
200
  }
169
- getRepoRunner(b, h, j2) {
170
- return this.client.get(`/repos/${b}/${h}/actions/runners/${j2}`);
201
+ getRepoRunner(b, h, j2, q) {
202
+ return this.client.get(`/repos/${b}/${h}/actions/runners/${j2}`, q);
171
203
  }
172
- deleteRepoRunner(b, h, j2) {
173
- return this.client.delete(`/repos/${b}/${h}/actions/runners/${j2}`);
204
+ deleteRepoRunner(b, h, j2, q) {
205
+ return this.client.delete(`/repos/${b}/${h}/actions/runners/${j2}`, undefined, q);
174
206
  }
175
- listOrgSecrets(b) {
176
- return this.client.get(`/orgs/${b}/actions/secrets`);
207
+ listOrgSecrets(b, h) {
208
+ return this.client.get(`/orgs/${b}/actions/secrets`, h);
177
209
  }
178
- getOrgSecret(b, h) {
179
- return this.client.get(`/orgs/${b}/actions/secrets/${h}`);
210
+ getOrgSecret(b, h, j2) {
211
+ return this.client.get(`/orgs/${b}/actions/secrets/${h}`, j2);
180
212
  }
181
- createOrUpdateOrgSecret(b, h, j2) {
182
- return this.client.put(`/orgs/${b}/actions/secrets/${h}`, j2);
213
+ createOrUpdateOrgSecret(b, h, j2, q) {
214
+ return this.client.put(`/orgs/${b}/actions/secrets/${h}`, j2, q);
183
215
  }
184
- deleteOrgSecret(b, h) {
185
- return this.client.delete(`/orgs/${b}/actions/secrets/${h}`);
216
+ deleteOrgSecret(b, h, j2) {
217
+ return this.client.delete(`/orgs/${b}/actions/secrets/${h}`, undefined, j2);
186
218
  }
187
- listRepoSecrets(b, h) {
188
- return this.client.get(`/repos/${b}/${h}/actions/secrets`);
219
+ listRepoSecrets(b, h, j2) {
220
+ return this.client.get(`/repos/${b}/${h}/actions/secrets`, j2);
189
221
  }
190
- getRepoSecret(b, h, j2) {
191
- return this.client.get(`/repos/${b}/${h}/actions/secrets/${j2}`);
222
+ getRepoSecret(b, h, j2, q) {
223
+ return this.client.get(`/repos/${b}/${h}/actions/secrets/${j2}`, q);
192
224
  }
193
- createOrUpdateRepoSecret(b, h, j2, q) {
194
- return this.client.put(`/repos/${b}/${h}/actions/secrets/${j2}`, q);
225
+ createOrUpdateRepoSecret(b, h, j2, q, v) {
226
+ return this.client.put(`/repos/${b}/${h}/actions/secrets/${j2}`, q, v);
195
227
  }
196
- deleteRepoSecret(b, h, j2) {
197
- return this.client.delete(`/repos/${b}/${h}/actions/secrets/${j2}`);
228
+ deleteRepoSecret(b, h, j2, q) {
229
+ return this.client.delete(`/repos/${b}/${h}/actions/secrets/${j2}`, undefined, q);
198
230
  }
199
- listOrgVariables(b) {
200
- return this.client.get(`/orgs/${b}/actions/variables`);
231
+ listOrgVariables(b, h) {
232
+ return this.client.get(`/orgs/${b}/actions/variables`, h);
201
233
  }
202
- createOrgVariable(b, h) {
203
- return this.client.post(`/orgs/${b}/actions/variables`, h);
234
+ createOrgVariable(b, h, j2) {
235
+ return this.client.post(`/orgs/${b}/actions/variables`, h, j2);
204
236
  }
205
- getOrgVariable(b, h) {
206
- return this.client.get(`/orgs/${b}/actions/variables/${h}`);
237
+ getOrgVariable(b, h, j2) {
238
+ return this.client.get(`/orgs/${b}/actions/variables/${h}`, j2);
207
239
  }
208
- deleteOrgVariable(b, h) {
209
- return this.client.delete(`/orgs/${b}/actions/variables/${h}`);
240
+ deleteOrgVariable(b, h, j2) {
241
+ return this.client.delete(`/orgs/${b}/actions/variables/${h}`, undefined, j2);
210
242
  }
211
- updateOrgVariable(b, h, j2) {
212
- return this.client.patch(`/orgs/${b}/actions/variables/${h}`, j2);
243
+ updateOrgVariable(b, h, j2, q) {
244
+ return this.client.patch(`/orgs/${b}/actions/variables/${h}`, j2, q);
213
245
  }
214
- listRepoVariables(b, h) {
215
- return this.client.get(`/repos/${b}/${h}/actions/variables`);
246
+ listRepoVariables(b, h, j2) {
247
+ return this.client.get(`/repos/${b}/${h}/actions/variables`, j2);
216
248
  }
217
- createRepoVariable(b, h, j2) {
218
- return this.client.post(`/repos/${b}/${h}/actions/variables`, j2);
249
+ createRepoVariable(b, h, j2, q) {
250
+ return this.client.post(`/repos/${b}/${h}/actions/variables`, j2, q);
219
251
  }
220
- getRepoVariable(b, h, j2) {
221
- return this.client.get(`/repos/${b}/${h}/actions/variables/${j2}`);
252
+ getRepoVariable(b, h, j2, q) {
253
+ return this.client.get(`/repos/${b}/${h}/actions/variables/${j2}`, q);
222
254
  }
223
- deleteRepoVariable(b, h, j2) {
224
- return this.client.delete(`/repos/${b}/${h}/actions/variables/${j2}`);
255
+ deleteRepoVariable(b, h, j2, q) {
256
+ return this.client.delete(`/repos/${b}/${h}/actions/variables/${j2}`, undefined, q);
225
257
  }
226
- updateRepoVariable(b, h, j2, q) {
227
- return this.client.patch(`/repos/${b}/${h}/actions/variables/${j2}`, q);
258
+ updateRepoVariable(b, h, j2, q, v) {
259
+ return this.client.patch(`/repos/${b}/${h}/actions/variables/${j2}`, q, v);
228
260
  }
229
- listArtifacts(b, h) {
230
- return this.client.get(`/repos/${b}/${h}/actions/artifacts`);
261
+ listArtifacts(b, h, j2) {
262
+ return this.client.get(`/repos/${b}/${h}/actions/artifacts`, j2);
231
263
  }
232
- getArtifact(b, h, j2) {
233
- return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}`);
264
+ getArtifact(b, h, j2, q) {
265
+ return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}`, q);
234
266
  }
235
- deleteArtifact(b, h, j2) {
236
- return this.client.delete(`/repos/${b}/${h}/actions/artifacts/${j2}`);
267
+ deleteArtifact(b, h, j2, q) {
268
+ return this.client.delete(`/repos/${b}/${h}/actions/artifacts/${j2}`, undefined, q);
237
269
  }
238
- downloadArtifact(b, h, j2) {
239
- return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}/zip`);
270
+ downloadArtifact(b, h, j2, q) {
271
+ return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}/zip`, q);
240
272
  }
241
- downloadArtifactRaw(b, h, j2) {
242
- return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}/zip/raw`);
273
+ downloadArtifactRaw(b, h, j2, q) {
274
+ return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}/zip/raw`, q);
243
275
  }
244
- getWorkflowDispatchInputs(b, h, j2) {
245
- return this.client.get(`/repos/${b}/${h}/actions/workflows/${j2}/dispatches`);
276
+ getWorkflowDispatchInputs(b, h, j2, q) {
277
+ return this.client.get(`/repos/${b}/${h}/actions/workflows/${j2}/dispatches`, q);
246
278
  }
247
- dispatchWorkflow(b, h, j2, q) {
248
- return this.client.post(`/repos/${b}/${h}/actions/workflows/${j2}/dispatches`, q);
279
+ dispatchWorkflow(b, h, j2, q, v) {
280
+ return this.client.post(`/repos/${b}/${h}/actions/workflows/${j2}/dispatches`, q, v);
249
281
  }
250
282
  }
251
283
 
@@ -259,11 +291,11 @@ class j2 extends Error {
259
291
  }
260
292
  }
261
293
 
262
- class k extends j2 {
294
+ class k2 extends j2 {
263
295
  rateLimit;
264
296
  constructor(b, f, h) {
265
297
  super(429, b, h);
266
- this.name = "RateLimitError", this.rateLimit = f, Object.setPrototypeOf(this, k.prototype);
298
+ this.name = "RateLimitError", this.rateLimit = f, Object.setPrototypeOf(this, k2.prototype);
267
299
  }
268
300
  getRetryAfterSeconds() {
269
301
  return this.rateLimit.retryAfter;
@@ -289,389 +321,387 @@ class q {
289
321
  }
290
322
 
291
323
  // ../sdk/dist/api/stars.js
292
- class j3 {
324
+ class k3 {
293
325
  client;
294
326
  constructor(b) {
295
327
  this.client = b;
296
328
  }
297
- list() {
298
- return this.client.get("/user/starred");
329
+ list(b) {
330
+ return this.client.get("/user/starred", b);
299
331
  }
300
- async add(b, c) {
301
- await this.client.put(`/user/starred/${b}/${c}`);
332
+ async add(b, c, f) {
333
+ await this.client.put(`/user/starred/${b}/${c}`, undefined, f);
302
334
  }
303
- async check(b, c) {
335
+ async check(b, c, f) {
304
336
  try {
305
- return await this.client.get(`/user/starred/${b}/${c}`), true;
306
- } catch (f) {
307
- if (f instanceof j2 && f.status === 404)
337
+ return await this.client.get(`/user/starred/${b}/${c}`, f), true;
338
+ } catch (h) {
339
+ if (h instanceof j2 && h.status === 404)
308
340
  return false;
309
- throw f;
341
+ throw h;
310
342
  }
311
343
  }
312
- async remove(b, c) {
313
- await this.client.delete(`/user/starred/${b}/${c}`);
344
+ async remove(b, c, f) {
345
+ await this.client.delete(`/user/starred/${b}/${c}`, undefined, f);
314
346
  }
315
347
  }
316
348
 
317
349
  // ../sdk/dist/api/issues.js
318
- class A {
350
+ class B {
319
351
  client;
320
352
  constructor(c) {
321
353
  this.client = c;
322
354
  }
323
- list(c, h, f) {
324
- let j4 = new URLSearchParams;
355
+ list(c, h, f, j3) {
356
+ let k4 = new URLSearchParams;
325
357
  if (f)
326
- j4.append("state", f);
327
- let k2 = j4.toString(), z = `/repos/${c}/${h}/issues${k2 ? `?${k2}` : ""}`;
328
- return this.client.get(z);
358
+ k4.append("state", f);
359
+ let z = k4.toString(), A = `/repos/${c}/${h}/issues${z ? `?${z}` : ""}`;
360
+ return this.client.get(A, j3);
329
361
  }
330
- get(c, h, f) {
331
- return this.client.get(`/repos/${c}/${h}/issues/${f}`);
362
+ get(c, h, f, j3) {
363
+ return this.client.get(`/repos/${c}/${h}/issues/${f}`, j3);
332
364
  }
333
- getComment(c, h, f) {
334
- return this.client.get(`/repos/${c}/${h}/issues/comments/${f}`);
365
+ getComment(c, h, f, j3) {
366
+ return this.client.get(`/repos/${c}/${h}/issues/comments/${f}`, j3);
335
367
  }
336
- getComments(c, h, f) {
337
- return this.client.get(`/repos/${c}/${h}/issues/${f}/comments`);
368
+ getComments(c, h, f, j3) {
369
+ return this.client.get(`/repos/${c}/${h}/issues/${f}/comments`, j3);
338
370
  }
339
- getLabels(c, h, f) {
340
- return this.client.get(`/repos/${c}/${h}/issues/${f}/labels`);
371
+ getLabels(c, h, f, j3) {
372
+ return this.client.get(`/repos/${c}/${h}/issues/${f}/labels`, j3);
341
373
  }
342
- getTimeline(c, h, f) {
343
- return this.client.get(`/repos/${c}/${h}/issues/${f}/timeline`);
374
+ getTimeline(c, h, f, j3) {
375
+ return this.client.get(`/repos/${c}/${h}/issues/${f}/timeline`, j3);
344
376
  }
345
377
  }
346
378
 
347
379
  // ../sdk/dist/api/branches.js
348
- class f {
380
+ class g {
349
381
  client;
350
382
  constructor(b) {
351
383
  this.client = b;
352
384
  }
353
- list(b, d) {
354
- return this.client.get(`/repos/${b}/${d}/branches`);
385
+ list(b, d, f) {
386
+ return this.client.get(`/repos/${b}/${d}/branches`, f);
355
387
  }
356
388
  }
357
389
 
358
390
  // ../sdk/dist/utils.js
359
391
  var z = /^([a-z][a-z0-9+.-]*:\/\/[^/]+)\/([a-z][a-z0-9+.-]*:\/\/.+)$/i;
360
- function E(j4) {
361
- if (!j4)
362
- return j4;
363
- let k2 = j4.match(z);
364
- if (k2?.[1] && k2?.[2]) {
365
- let q2 = k2[1], v2 = k2[2];
366
- if (v2.startsWith(q2))
367
- return v2;
368
- }
369
- return j4;
370
- }
371
- function J(j4) {
372
- let k2 = ["clone_url", "html_url", "url", "git_url", "mirror_url"], q2 = { ...j4 };
373
- for (let v2 of k2)
374
- if (typeof q2[v2] === "string")
375
- q2[v2] = E(q2[v2]);
392
+ function E(j3) {
393
+ if (!j3)
394
+ return j3;
395
+ let k4 = j3.match(z);
396
+ if (k4?.[1] && k4?.[2]) {
397
+ let q2 = k4[1], v = k4[2];
398
+ if (v.startsWith(q2))
399
+ return v;
400
+ }
401
+ return j3;
402
+ }
403
+ function J(j3) {
404
+ let k4 = ["clone_url", "html_url", "url", "git_url", "mirror_url"], q2 = { ...j3 };
405
+ for (let v of k4)
406
+ if (typeof q2[v] === "string")
407
+ q2[v] = E(q2[v]);
376
408
  return q2;
377
409
  }
378
410
 
379
411
  // ../sdk/dist/api/repositories.js
380
- class z2 {
412
+ class A {
381
413
  client;
382
414
  constructor(g2) {
383
415
  this.client = g2;
384
416
  }
385
- async get(g2, j4) {
386
- let k2 = await this.client.get(`/repos/${g2}/${j4}`);
387
- return J(k2);
417
+ async get(g2, k4, j3) {
418
+ let q2 = await this.client.get(`/repos/${g2}/${k4}`, j3);
419
+ return J(q2);
388
420
  }
389
- delete(g2, j4) {
390
- return this.client.delete(`/repos/${g2}/${j4}`);
421
+ delete(g2, k4, j3) {
422
+ return this.client.delete(`/repos/${g2}/${k4}`, undefined, j3);
391
423
  }
392
- async update(g2, j4, k2) {
393
- let v2 = await this.client.patch(`/repos/${g2}/${j4}`, k2);
394
- return J(v2);
424
+ async update(g2, k4, j3, q2) {
425
+ let z2 = await this.client.patch(`/repos/${g2}/${k4}`, j3, q2);
426
+ return J(z2);
395
427
  }
396
- compare(g2, j4, k2) {
397
- return this.client.get(`/repos/${g2}/${j4}/compare/${k2}`);
428
+ compare(g2, k4, j3, q2) {
429
+ return this.client.get(`/repos/${g2}/${k4}/compare/${j3}`, q2);
398
430
  }
399
- getLanguages(g2, j4) {
400
- return this.client.get(`/repos/${g2}/${j4}/languages`);
431
+ getLanguages(g2, k4, j3) {
432
+ return this.client.get(`/repos/${g2}/${k4}/languages`, j3);
401
433
  }
402
- async listForAuthenticatedUser() {
403
- return (await this.client.get("/user/repos")).map((j4) => J(j4));
434
+ async listForAuthenticatedUser(g2) {
435
+ return (await this.client.get("/user/repos", g2)).map((j3) => J(j3));
404
436
  }
405
- async create(g2) {
406
- let j4 = await this.client.post("/user/repos", g2);
407
- return J(j4);
437
+ async create(g2, k4) {
438
+ let j3 = await this.client.post("/user/repos", g2, k4);
439
+ return J(j3);
408
440
  }
409
441
  }
410
442
 
411
443
  // ../sdk/dist/api/collaborators.js
412
- class h {
444
+ class j3 {
413
445
  client;
414
446
  constructor(d) {
415
447
  this.client = d;
416
448
  }
417
- list(d, f2) {
418
- return this.client.get(`/repos/${d}/${f2}/collaborators`);
449
+ list(d, f, g2) {
450
+ return this.client.get(`/repos/${d}/${f}/collaborators`, g2);
419
451
  }
420
- add(d, f2, g2) {
421
- return this.client.put(`/repos/${d}/${f2}/collaborators/${g2}`, {});
452
+ add(d, f, g2, h) {
453
+ return this.client.put(`/repos/${d}/${f}/collaborators/${g2}`, {}, h);
422
454
  }
423
455
  }
424
456
 
425
457
  // ../sdk/dist/api/contents.js
426
- class j4 {
458
+ class k4 {
427
459
  client;
428
460
  constructor(b) {
429
461
  this.client = b;
430
462
  }
431
- get(b, d, f2) {
432
- return this.client.get(`/repos/${b}/${d}/contents/${f2}`);
463
+ get(b, d, f, g2) {
464
+ return this.client.get(`/repos/${b}/${d}/contents/${f}`, g2);
433
465
  }
434
- createFile(b, d, f2, g2) {
435
- return this.client.put(`/repos/${b}/${d}/contents/${f2}`, g2);
466
+ createFile(b, d, f, g2, j4) {
467
+ return this.client.put(`/repos/${b}/${d}/contents/${f}`, g2, j4);
436
468
  }
437
- updateFile(b, d, f2, g2) {
438
- return this.client.put(`/repos/${b}/${d}/contents/${f2}`, g2);
469
+ updateFile(b, d, f, g2, j4) {
470
+ return this.client.put(`/repos/${b}/${d}/contents/${f}`, g2, j4);
439
471
  }
440
- deleteFile(b, d, f2, g2) {
441
- return this.client.delete(`/repos/${b}/${d}/contents/${f2}`, g2);
472
+ deleteFile(b, d, f, g2, j4) {
473
+ return this.client.delete(`/repos/${b}/${d}/contents/${f}`, g2, j4);
442
474
  }
443
475
  }
444
476
 
445
477
  // ../sdk/dist/api/teams.js
446
- class j5 {
478
+ class k5 {
447
479
  client;
448
480
  constructor(b) {
449
481
  this.client = b;
450
482
  }
451
- list(b) {
452
- return this.client.get(`/orgs/${b}/teams`);
483
+ list(b, d) {
484
+ return this.client.get(`/orgs/${b}/teams`, d);
453
485
  }
454
- getInvitations(b, d) {
455
- return this.client.get(`/orgs/${b}/teams/${d}/invitations`);
486
+ getInvitations(b, d, f) {
487
+ return this.client.get(`/orgs/${b}/teams/${d}/invitations`, f);
456
488
  }
457
- getMembers(b, d) {
458
- return this.client.get(`/orgs/${b}/teams/${d}/members`);
489
+ getMembers(b, d, f) {
490
+ return this.client.get(`/orgs/${b}/teams/${d}/members`, f);
459
491
  }
460
- addRepository(b, d, f2, h2) {
461
- return this.client.put(`/orgs/${b}/teams/${d}/repos/${f2}/${h2}`, {});
492
+ addRepository(b, d, f, h, j4) {
493
+ return this.client.put(`/orgs/${b}/teams/${d}/repos/${f}/${h}`, {}, j4);
462
494
  }
463
495
  }
464
496
 
465
497
  // ../sdk/dist/api/git.js
466
- class g2 {
498
+ class j4 {
467
499
  client;
468
500
  constructor(b) {
469
501
  this.client = b;
470
502
  }
471
- createRef(b, d, f2) {
472
- return this.client.post(`/repos/${b}/${d}/git/refs`, f2);
503
+ createRef(b, d, f, g2) {
504
+ return this.client.post(`/repos/${b}/${d}/git/refs`, f, g2);
473
505
  }
474
- createTree(b, d, f2) {
475
- return this.client.post(`/repos/${b}/${d}/git/trees`, f2);
506
+ createTree(b, d, f, g2) {
507
+ return this.client.post(`/repos/${b}/${d}/git/trees`, f, g2);
476
508
  }
477
- getTree(b, d, f2) {
478
- return this.client.get(`/repos/${b}/${d}/git/trees/${f2}`);
509
+ getTree(b, d, f, g2) {
510
+ return this.client.get(`/repos/${b}/${d}/git/trees/${f}`, g2);
479
511
  }
480
512
  }
481
513
 
482
514
  // ../sdk/dist/api/releases.js
483
- class k2 {
515
+ class q2 {
484
516
  client;
485
517
  constructor(b) {
486
518
  this.client = b;
487
519
  }
488
- list(b, f2) {
489
- return this.client.get(`/repos/${b}/${f2}/releases`);
520
+ list(b, f, h) {
521
+ return this.client.get(`/repos/${b}/${f}/releases`, h);
490
522
  }
491
- create(b, f2, h2) {
492
- return this.client.post(`/repos/${b}/${f2}/releases`, h2);
523
+ create(b, f, h, j5) {
524
+ return this.client.post(`/repos/${b}/${f}/releases`, h, j5);
493
525
  }
494
- getByTag(b, f2, h2) {
495
- return this.client.get(`/repos/${b}/${f2}/releases/tags/${h2}`);
526
+ getByTag(b, f, h, j5) {
527
+ return this.client.get(`/repos/${b}/${f}/releases/tags/${h}`, j5);
496
528
  }
497
- deleteByTag(b, f2, h2) {
498
- return this.client.delete(`/repos/${b}/${f2}/releases/tags/${h2}`);
529
+ deleteByTag(b, f, h, j5) {
530
+ return this.client.delete(`/repos/${b}/${f}/releases/tags/${h}`, undefined, j5);
499
531
  }
500
- get(b, f2, h2) {
501
- return this.client.get(`/repos/${b}/${f2}/releases/${h2}`);
532
+ get(b, f, h, j5) {
533
+ return this.client.get(`/repos/${b}/${f}/releases/${h}`, j5);
502
534
  }
503
- delete(b, f2, h2) {
504
- return this.client.delete(`/repos/${b}/${f2}/releases/${h2}`);
535
+ delete(b, f, h, j5) {
536
+ return this.client.delete(`/repos/${b}/${f}/releases/${h}`, undefined, j5);
505
537
  }
506
- update(b, f2, h2, j6) {
507
- return this.client.patch(`/repos/${b}/${f2}/releases/${h2}`, j6);
538
+ update(b, f, h, j5, k6) {
539
+ return this.client.patch(`/repos/${b}/${f}/releases/${h}`, j5, k6);
508
540
  }
509
- getAssets(b, f2, h2) {
510
- return this.client.get(`/repos/${b}/${f2}/releases/${h2}/assets`);
541
+ getAssets(b, f, h, j5) {
542
+ return this.client.get(`/repos/${b}/${f}/releases/${h}/assets`, j5);
511
543
  }
512
- uploadAsset(b, f2, h2, j6) {
513
- return this.client.post(`/repos/${b}/${f2}/releases/${h2}/assets`, j6);
544
+ uploadAsset(b, f, h, j5, k6) {
545
+ return this.client.post(`/repos/${b}/${f}/releases/${h}/assets`, j5, k6);
514
546
  }
515
- deleteAsset(b, f2, h2, j6) {
516
- return this.client.delete(`/repos/${b}/${f2}/releases/${h2}/assets/${j6}`);
547
+ deleteAsset(b, f, h, j5, k6) {
548
+ return this.client.delete(`/repos/${b}/${f}/releases/${h}/assets/${j5}`, undefined, k6);
517
549
  }
518
550
  }
519
551
 
520
552
  // ../sdk/dist/api/pulls.js
521
- class v2 {
553
+ class y {
522
554
  client;
523
555
  constructor(d) {
524
556
  this.client = d;
525
557
  }
526
- create(d, g3, f2) {
527
- return this.client.post(`/repos/${d}/${g3}/pulls`, f2);
558
+ create(d, f, g2, j5) {
559
+ return this.client.post(`/repos/${d}/${f}/pulls`, g2, j5);
528
560
  }
529
- get(d, g3, f2) {
530
- return this.client.get(`/repos/${d}/${g3}/pulls/${f2}`);
561
+ get(d, f, g2, j5) {
562
+ return this.client.get(`/repos/${d}/${f}/pulls/${g2}`, j5);
531
563
  }
532
- list(d, g3, f2) {
533
- let k3 = new URL(`/repos/${d}/${g3}/pulls`, "http://localhost");
534
- if (f2)
535
- k3.searchParams.set("state", f2);
536
- return this.client.get(k3.href.replace("http://localhost", ""));
564
+ list(d, f, g2, j5) {
565
+ let x2 = new URLSearchParams(Object.entries(g2 ?? {})), q3 = new URL(`/repos/${d}/${f}/pulls`, "http://localhost");
566
+ return q3.search = x2.toString(), this.client.get(q3.href.replace("http://localhost", ""), j5);
537
567
  }
538
- update(d, g3, f2, j6) {
539
- return this.client.patch(`/repos/${d}/${g3}/pulls/${f2}`, j6);
568
+ update(d, f, g2, j5, k6) {
569
+ return this.client.patch(`/repos/${d}/${f}/pulls/${g2}`, j5, k6);
540
570
  }
541
- getFiles(d, g3, f2) {
542
- return this.client.get(`/repos/${d}/${g3}/pulls/${f2}/files`);
571
+ getFiles(d, f, g2, j5) {
572
+ return this.client.get(`/repos/${d}/${f}/pulls/${g2}/files`, j5);
543
573
  }
544
- updateBranch(d, g3, f2) {
545
- return this.client.put(`/repos/${d}/${g3}/pulls/${f2}/update-branch`, {});
574
+ updateBranch(d, f, g2, j5) {
575
+ return this.client.put(`/repos/${d}/${f}/pulls/${g2}/update-branch`, {}, j5);
546
576
  }
547
- getCommits(d, g3, f2) {
548
- return this.client.get(`/repos/${d}/${g3}/pulls/${f2}/commits`);
577
+ getCommits(d, f, g2, j5) {
578
+ return this.client.get(`/repos/${d}/${f}/pulls/${g2}/commits`, j5);
549
579
  }
550
- async checkIfMerged(d, g3, f2) {
580
+ async checkIfMerged(d, f, g2, j5) {
551
581
  try {
552
- return await this.client.get(`/repos/${d}/${g3}/pulls/${f2}/merge`), true;
553
- } catch (j6) {
554
- if (j6 instanceof j2 && j6.status === 404)
582
+ return await this.client.get(`/repos/${d}/${f}/pulls/${g2}/merge`, j5), true;
583
+ } catch (k6) {
584
+ if (k6 instanceof j2 && k6.status === 404)
555
585
  return false;
556
- throw j6;
586
+ throw k6;
557
587
  }
558
588
  }
559
589
  }
560
590
 
561
591
  // ../sdk/dist/api/forks.js
562
- class k3 {
592
+ class q3 {
563
593
  client;
564
594
  constructor(b) {
565
595
  this.client = b;
566
596
  }
567
- async create(b, g3, h2) {
568
- let j6 = await this.client.post(`/repos/${b}/${g3}/forks`, h2);
569
- return J(j6);
597
+ async create(b, g2, h, j5) {
598
+ let k6 = await this.client.post(`/repos/${b}/${g2}/forks`, h, j5);
599
+ return J(k6);
570
600
  }
571
601
  }
572
602
 
573
603
  // ../sdk/dist/client.js
574
604
  var F = { DELETE: "DELETE", GET: "GET", PATCH: "PATCH", POST: "POST", PUT: "PUT" };
575
605
 
576
- class Y {
606
+ class _ {
577
607
  baseUrl;
578
608
  token;
579
609
  apiVersion;
580
610
  onApiVersionWarning;
581
- constructor(j6 = {}) {
582
- this.baseUrl = j6.baseUrl || "https://api.gitverse.ru", this.token = j6.token, this.apiVersion = j6.apiVersion || "1";
611
+ constructor(j5 = {}) {
612
+ this.baseUrl = j5.baseUrl || "https://api.gitverse.ru", this.token = j5.token, this.apiVersion = j5.apiVersion || "1";
583
613
  }
584
- setToken(j6) {
585
- this.token = j6;
614
+ setToken(j5) {
615
+ this.token = j5;
586
616
  }
587
- extractRateLimitInfo(j6) {
588
- let q2 = j6.get("GitVerse-RateLimit-Limit"), x = j6.get("GitVerse-RateLimit-Remaining"), z3 = j6.get("GitVerse-RateLimit-Retry-After"), B = j6.get("Gitverse-Ratelimit-Reset");
589
- if (!(q2 && x && z3 && B))
617
+ extractRateLimitInfo(j5) {
618
+ let x2 = j5.get("GitVerse-RateLimit-Limit"), q4 = j5.get("GitVerse-RateLimit-Remaining"), z2 = j5.get("GitVerse-RateLimit-Retry-After"), B2 = j5.get("Gitverse-Ratelimit-Reset");
619
+ if (!(x2 && q4 && z2 && B2))
590
620
  return;
591
- return { limit: Number.parseInt(q2, 10), remaining: Number.parseInt(x, 10), reset: Number.parseInt(B, 10), retryAfter: Number.parseInt(z3, 10) };
621
+ return { limit: Number.parseInt(x2, 10), remaining: Number.parseInt(q4, 10), reset: Number.parseInt(B2, 10), retryAfter: Number.parseInt(z2, 10) };
592
622
  }
593
- extractApiVersionInfo(j6) {
594
- let q2 = j6.get("Gitverse-Api-Version"), x = j6.get("Gitverse-Api-Latest-Version"), z3 = j6.get("Gitverse-Api-Deprecation") === "true", B = j6.get("Gitverse-Api-Decommissioning");
595
- if (!(q2 && x))
623
+ extractApiVersionInfo(j5) {
624
+ let x2 = j5.get("Gitverse-Api-Version"), q4 = j5.get("Gitverse-Api-Latest-Version"), z2 = j5.get("Gitverse-Api-Deprecation") === "true", B2 = j5.get("Gitverse-Api-Decommissioning");
625
+ if (!(x2 && q4))
596
626
  return;
597
- return { decommissioning: B || undefined, deprecated: z3, latestVersion: x, version: q2 };
627
+ return { decommissioning: B2 || undefined, deprecated: z2, latestVersion: q4, version: x2 };
598
628
  }
599
- extractMetadata(j6) {
600
- let q2 = this.extractRateLimitInfo(j6), x = this.extractApiVersionInfo(j6);
601
- if (x?.deprecated && this.onApiVersionWarning) {
602
- let z3 = new q(x.version, x.latestVersion, x.decommissioning);
603
- this.onApiVersionWarning(z3);
629
+ extractMetadata(j5) {
630
+ let x2 = this.extractRateLimitInfo(j5), q4 = this.extractApiVersionInfo(j5);
631
+ if (q4?.deprecated && this.onApiVersionWarning) {
632
+ let z2 = new q(q4.version, q4.latestVersion, q4.decommissioning);
633
+ this.onApiVersionWarning(z2);
604
634
  }
605
- return { apiVersion: x, rateLimit: q2 };
635
+ return { apiVersion: q4, rateLimit: x2 };
606
636
  }
607
- async request(j6, q2, x) {
608
- let z3 = j6.startsWith("/") ? j6.slice(1) : j6, B = `${this.baseUrl}/${z3}`, J2 = new Headers;
637
+ async request(j5, x2, q4, z2) {
638
+ let B2 = j5.startsWith("/") ? j5.slice(1) : j5, Y = `${this.baseUrl}/${B2}`, J2 = new Headers;
609
639
  if (J2.set("Content-Type", "application/json"), J2.set("Accept", `application/vnd.gitverse.object+json; version=${this.apiVersion}`), this.token)
610
640
  J2.set("Authorization", `Bearer ${this.token}`);
611
- let X = { body: x ? JSON.stringify(x) : undefined, headers: J2, method: q2 }, D = await fetch(B, X), K = this.extractMetadata(D.headers), N;
641
+ let Z = { body: q4 ? JSON.stringify(q4) : undefined, headers: J2, method: x2, signal: z2?.signal }, D = await fetch(Y, Z), K = this.extractMetadata(D.headers), N;
612
642
  try {
613
643
  N = await D.json();
614
644
  } catch {
615
645
  N = undefined;
616
646
  }
617
647
  if (!D.ok) {
618
- let O = N?.message || D.statusText;
648
+ let Q = N?.message || D.statusText;
619
649
  if (D.status === 429 && K.rateLimit)
620
- throw new k(O || "Превышен лимит запросов. Попробуйте позже.", K.rateLimit, K);
621
- throw new j2(D.status, O, K);
650
+ throw new k2(Q || "Превышен лимит запросов. Попробуйте позже.", K.rateLimit, K);
651
+ throw new j2(D.status, Q, K);
622
652
  }
623
653
  return N;
624
654
  }
625
- get(j6) {
626
- return this.request(j6, F.GET);
655
+ get(j5, x2) {
656
+ return this.request(j5, F.GET, undefined, x2);
627
657
  }
628
- post(j6, q2) {
629
- return this.request(j6, F.POST, q2);
658
+ post(j5, x2, q4) {
659
+ return this.request(j5, F.POST, x2, q4);
630
660
  }
631
- put(j6, q2) {
632
- return this.request(j6, F.PUT, q2);
661
+ put(j5, x2, q4) {
662
+ return this.request(j5, F.PUT, x2, q4);
633
663
  }
634
- delete(j6, q2) {
635
- return this.request(j6, F.DELETE, q2);
664
+ delete(j5, x2, q4) {
665
+ return this.request(j5, F.DELETE, x2, q4);
636
666
  }
637
- patch(j6, q2) {
638
- return this.request(j6, F.PATCH, q2);
667
+ patch(j5, x2, q4) {
668
+ return this.request(j5, F.PATCH, x2, q4);
639
669
  }
640
670
  }
641
671
 
642
672
  // ../sdk/dist/api/users.js
643
- class d {
673
+ class f {
644
674
  client;
645
675
  constructor(b) {
646
676
  this.client = b;
647
677
  }
648
- getCurrent() {
649
- return this.client.get("/user");
678
+ getCurrent(b) {
679
+ return this.client.get("/user", b);
650
680
  }
651
- getByUsername(b) {
652
- return this.client.get(`/users/${b}`);
681
+ getByUsername(b, d) {
682
+ return this.client.get(`/users/${b}`, d);
653
683
  }
654
684
  }
655
685
 
656
686
  // ../sdk/dist/api/emails.js
657
- class c {
687
+ class d {
658
688
  client;
659
689
  constructor(b) {
660
690
  this.client = b;
661
691
  }
662
- list() {
663
- return this.client.get("/user/emails");
692
+ list(b) {
693
+ return this.client.get("/user/emails", b);
664
694
  }
665
- add(b) {
666
- return this.client.post("/user/emails", b);
695
+ add(b, c) {
696
+ return this.client.post("/user/emails", b, c);
667
697
  }
668
- remove(b) {
669
- return this.client.delete("/user/emails", b);
698
+ remove(b, c) {
699
+ return this.client.delete("/user/emails", b, c);
670
700
  }
671
701
  }
672
702
 
673
703
  // ../sdk/dist/index.js
674
- class P {
704
+ class Z {
675
705
  client;
676
706
  users;
677
707
  repos;
@@ -690,7 +720,7 @@ class P {
690
720
  git;
691
721
  actions;
692
722
  constructor(d2 = {}) {
693
- this.client = new Y(d2), this.users = new d(this.client), this.repos = new z2(this.client), this.contents = new j4(this.client), this.pulls = new v2(this.client), this.forks = new k3(this.client), this.emails = new c(this.client), this.issues = new A(this.client), this.stars = new j3(this.client), this.branches = new f(this.client), this.commits = new g(this.client), this.collaborators = new h(this.client), this.organizations = new j(this.client), this.teams = new j5(this.client), this.releases = new k2(this.client), this.git = new g2(this.client), this.actions = new v(this.client);
723
+ this.client = new _(d2), this.users = new f(this.client), this.repos = new A(this.client), this.contents = new k4(this.client), this.pulls = new y(this.client), this.forks = new q3(this.client), this.emails = new d(this.client), this.issues = new B(this.client), this.stars = new k3(this.client), this.branches = new g(this.client), this.commits = new j(this.client), this.collaborators = new j3(this.client), this.organizations = new k(this.client), this.teams = new k5(this.client), this.releases = new q2(this.client), this.git = new j4(this.client), this.actions = new x(this.client);
694
724
  }
695
725
  setToken(d2) {
696
726
  return this.client.setToken(d2), this;
@@ -701,24 +731,32 @@ class P {
701
731
  class GitVerseReleaseClient {
702
732
  client;
703
733
  repoInfo;
704
- constructor(token, repoInfo) {
705
- this.client = new P({ token });
734
+ retryFn;
735
+ constructor(token, repoInfo, retryFn) {
736
+ this.client = new Z({ token });
706
737
  this.repoInfo = repoInfo;
738
+ this.retryFn = retryFn;
707
739
  }
708
740
  async createRelease(tag, name, body, options = {}) {
709
741
  const { owner, repo } = this.repoInfo;
710
- try {
711
- await this.client.releases.create(owner, repo, {
712
- body,
713
- draft: options.draft,
714
- name,
715
- prerelease: options.prerelease,
716
- tag_name: tag
717
- });
718
- return `${this.repoInfo.url}/releases/tag/${tag}`;
719
- } catch (error) {
720
- throw new Error(`Failed to create GitVerse release: ${error instanceof Error ? error.message : String(error)}`);
742
+ const createFn = async () => {
743
+ try {
744
+ await this.client.releases.create(owner, repo, {
745
+ body,
746
+ draft: options.draft,
747
+ name,
748
+ prerelease: options.prerelease,
749
+ tag_name: tag
750
+ });
751
+ return `${this.repoInfo.url}/releases/tag/${tag}`;
752
+ } catch (error) {
753
+ throw new Error(`Failed to create GitVerse release: ${error instanceof Error ? error.message : String(error)}`);
754
+ }
755
+ };
756
+ if (this.retryFn) {
757
+ return await this.retryFn(createFn, "Create GitVerse Release");
721
758
  }
759
+ return await createFn();
722
760
  }
723
761
  async releaseExists(tag) {
724
762
  const { owner, repo } = this.repoInfo;
@@ -734,12 +772,12 @@ class GitVerseReleaseClient {
734
772
  return await this.client.releases.getByTag(owner, repo, tag);
735
773
  }
736
774
  }
737
- function createGitVerseClient(repoInfo) {
775
+ function createGitVerseClient(repoInfo, retryFn) {
738
776
  const token = process.env.GITVERSE_TOKEN;
739
777
  if (!token) {
740
778
  throw new Error("GITVERSE_TOKEN environment variable is required for creating releases");
741
779
  }
742
- return new GitVerseReleaseClient(token, repoInfo);
780
+ return new GitVerseReleaseClient(token, repoInfo, retryFn);
743
781
  }
744
782
 
745
783
  // src/utils/changelog.ts
@@ -816,7 +854,7 @@ function hasFixes(commits) {
816
854
  }
817
855
 
818
856
  // src/utils/changelog.ts
819
- function generateChangelog(options, config) {
857
+ function generateChangelog(options, config, packageName) {
820
858
  const { version, commits, date = new Date, repoUrl } = options;
821
859
  const sections = [];
822
860
  const dateStr = date.toISOString().split("T")[0];
@@ -824,17 +862,17 @@ function generateChangelog(options, config) {
824
862
  sections.push("");
825
863
  const grouped = groupCommitsByType(commits);
826
864
  const typeOrder = ["feat", "fix", "perf", "refactor", "docs", "test", "build", "ci", "chore", "style", "revert"];
827
- const breakingCommits = commits.filter((c2) => c2.breaking);
865
+ const breakingCommits = commits.filter((c) => c.breaking);
828
866
  if (breakingCommits.length > 0) {
829
867
  sections.push("### ⚠️ BREAKING CHANGES");
830
868
  sections.push("");
831
869
  for (const commit of breakingCommits) {
832
- sections.push(formatCommit(commit, config, repoUrl));
870
+ sections.push(formatCommit(commit, config, repoUrl, packageName));
833
871
  }
834
872
  sections.push("");
835
873
  }
836
874
  for (const type of typeOrder) {
837
- const typeCommits = grouped[type]?.filter((c2) => !c2.breaking);
875
+ const typeCommits = grouped[type]?.filter((c) => !c.breaking);
838
876
  if (!typeCommits || typeCommits.length === 0) {
839
877
  continue;
840
878
  }
@@ -842,17 +880,17 @@ function generateChangelog(options, config) {
842
880
  sections.push(`### ${title}`);
843
881
  sections.push("");
844
882
  for (const commit of typeCommits) {
845
- sections.push(formatCommit(commit, config, repoUrl));
883
+ sections.push(formatCommit(commit, config, repoUrl, packageName));
846
884
  }
847
885
  sections.push("");
848
886
  }
849
887
  return sections.join(`
850
888
  `);
851
889
  }
852
- function formatCommit(commit, config, repoUrl) {
890
+ function formatCommit(commit, config, repoUrl, packageName) {
853
891
  const parts = [];
854
892
  let message = commit.subject;
855
- if (commit.scope) {
893
+ if (commit.scope && commit.scope !== packageName) {
856
894
  message = `**${commit.scope}:** ${message}`;
857
895
  }
858
896
  parts.push(`- ${message}`);
@@ -902,18 +940,18 @@ All notable changes to this project will be documented in this file.
902
940
  await writeFile(changelogPath, lines.join(`
903
941
  `));
904
942
  }
905
- function generateReleaseNotes(commits, config, repoUrl) {
943
+ function generateReleaseNotes(commits, config, repoUrl, packageName) {
906
944
  const sections = [];
907
- const breakingCommits = commits.filter((c2) => c2.breaking);
945
+ const breakingCommits = commits.filter((c) => c.breaking);
908
946
  if (breakingCommits.length > 0) {
909
947
  sections.push("⚠️ BREAKING CHANGES");
910
948
  sections.push("");
911
949
  for (const commit of breakingCommits) {
912
- sections.push(formatCommit(commit, config, repoUrl));
950
+ sections.push(formatCommit(commit, config, repoUrl, packageName));
913
951
  }
914
952
  sections.push("");
915
953
  }
916
- const grouped = groupCommitsByType(commits.filter((c2) => !c2.breaking));
954
+ const grouped = groupCommitsByType(commits.filter((c) => !c.breaking));
917
955
  const typeOrder = ["feat", "fix", "perf", "refactor", "docs", "test", "build", "ci", "chore", "style", "revert"];
918
956
  for (const type of typeOrder) {
919
957
  const typeCommits = grouped[type];
@@ -924,7 +962,7 @@ function generateReleaseNotes(commits, config, repoUrl) {
924
962
  sections.push(title);
925
963
  sections.push("");
926
964
  for (const commit of typeCommits) {
927
- sections.push(formatCommit(commit, config, repoUrl));
965
+ sections.push(formatCommit(commit, config, repoUrl, packageName));
928
966
  }
929
967
  sections.push("");
930
968
  }
@@ -936,6 +974,27 @@ function generateReleaseNotes(commits, config, repoUrl) {
936
974
  import { exec } from "node:child_process";
937
975
  import { promisify } from "node:util";
938
976
  var execAsync = promisify(exec);
977
+ async function executeCommand(command) {
978
+ const { stdout, stderr } = await execAsync(command);
979
+ if (stderr && !stderr.includes("warning")) {
980
+ console.warn(`Command stderr: ${stderr}`);
981
+ }
982
+ return stdout.trim();
983
+ }
984
+ async function runBeforeCommitHook(command) {
985
+ console.log(`
986
+ \uD83D\uDD27 Running before-commit hook: ${command}`);
987
+ try {
988
+ await executeCommand(command);
989
+ console.log(`✅ Before-commit hook completed successfully
990
+ `);
991
+ return true;
992
+ } catch (error) {
993
+ console.warn(`⚠️ Before-commit hook failed: ${error instanceof Error ? error.message : String(error)}
994
+ `);
995
+ return false;
996
+ }
997
+ }
939
998
  var GITVERSE_URL_REGEX_1 = /gitverse\.ru[:/]([^/]+)\/([^/.]+)(\.git)?$/;
940
999
  var GITVERSE_URL_REGEX_2 = /gitverse\.ru\/([^/]+)\/([^/.]+)(\.git)?$/;
941
1000
  async function git(command) {
@@ -1056,11 +1115,36 @@ async function pushChanges(tag) {
1056
1115
  async function isWorkingTreeClean() {
1057
1116
  try {
1058
1117
  const status = await git("status --porcelain");
1059
- return status.length === 0;
1118
+ if (status.length === 0) {
1119
+ return true;
1120
+ }
1121
+ const lines = status.split(`
1122
+ `).filter((line) => line.length > 0);
1123
+ const unstagedChanges = lines.filter((line) => {
1124
+ const workingTreeStatus = line[1];
1125
+ return workingTreeStatus !== " ";
1126
+ });
1127
+ if (unstagedChanges.length > 0) {
1128
+ console.log(`
1129
+ ⚠️ Unstaged changes detected:`);
1130
+ for (const line of unstagedChanges) {
1131
+ console.log(` ${line}`);
1132
+ }
1133
+ console.log("");
1134
+ return false;
1135
+ }
1136
+ console.log("✓ Working tree clean (staged changes will be included in release commit)");
1137
+ return true;
1060
1138
  } catch {
1061
1139
  return false;
1062
1140
  }
1063
1141
  }
1142
+ async function addChangedFiles() {
1143
+ console.log("\uD83D\uDCE5 Adding changed files to staging area...");
1144
+ await git("add -A");
1145
+ console.log(`✅ Files added to staging area
1146
+ `);
1147
+ }
1064
1148
  async function tagExists(tag) {
1065
1149
  try {
1066
1150
  await git(`rev-parse "${tag}"`);
@@ -1070,12 +1154,77 @@ async function tagExists(tag) {
1070
1154
  }
1071
1155
  }
1072
1156
 
1157
+ // src/utils/retry.ts
1158
+ function sleep(ms) {
1159
+ return new Promise((resolve2) => setTimeout(resolve2, ms));
1160
+ }
1161
+ function calculateDelay(attempt, initialDelay, maxDelay) {
1162
+ const delay = initialDelay * 2 ** attempt;
1163
+ return Math.min(delay, maxDelay);
1164
+ }
1165
+ function isRetriableError(error) {
1166
+ if (!(error instanceof Error)) {
1167
+ return false;
1168
+ }
1169
+ const message = error.message.toLowerCase();
1170
+ if (message.includes("network") || message.includes("timeout") || message.includes("econnreset")) {
1171
+ return true;
1172
+ }
1173
+ if (message.includes("500") || message.includes("502") || message.includes("503") || message.includes("504")) {
1174
+ return true;
1175
+ }
1176
+ if (message.includes("rate limit") || message.includes("429")) {
1177
+ return true;
1178
+ }
1179
+ return false;
1180
+ }
1181
+ async function retry(fn, options) {
1182
+ const { maxAttempts, initialDelay, maxDelay, operationName = "Operation" } = options;
1183
+ let lastError;
1184
+ for (let attempt = 0;attempt < maxAttempts; attempt++) {
1185
+ try {
1186
+ return await fn();
1187
+ } catch (error) {
1188
+ lastError = error instanceof Error ? error : new Error(String(error));
1189
+ const canRetry = isRetriableError(error);
1190
+ if (attempt === maxAttempts - 1 || !canRetry) {
1191
+ if (!canRetry && attempt < maxAttempts - 1) {
1192
+ console.error(`
1193
+ ❌ ${operationName} failed with non-retriable error:`);
1194
+ console.error(lastError.message);
1195
+ }
1196
+ throw lastError;
1197
+ }
1198
+ const delay = calculateDelay(attempt, initialDelay, maxDelay);
1199
+ console.warn(`
1200
+ ⚠️ ${operationName} failed (attempt ${attempt + 1}/${maxAttempts}):`);
1201
+ console.warn(` ${lastError.message}`);
1202
+ console.warn(` Retrying in ${delay}ms...`);
1203
+ await sleep(delay);
1204
+ }
1205
+ }
1206
+ throw lastError || new Error(`${operationName} failed after ${maxAttempts} attempts`);
1207
+ }
1208
+ function createRetryFunction(config) {
1209
+ return async (fn, operationName) => {
1210
+ if (!config.enabled) {
1211
+ return await fn();
1212
+ }
1213
+ return await retry(fn, {
1214
+ initialDelay: config.initialDelay,
1215
+ maxAttempts: config.maxAttempts,
1216
+ maxDelay: config.maxDelay,
1217
+ operationName
1218
+ });
1219
+ };
1220
+ }
1221
+
1073
1222
  // src/utils/version.ts
1074
1223
  var VERSION_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/;
1075
1224
  var PRERELEASE_INCREMENT_REGEX = /^(.+)\.(\d+)$/;
1076
1225
  function parseVersion(version) {
1077
- const v3 = version.startsWith("v") ? version.slice(1) : version;
1078
- const match = v3.match(VERSION_REGEX);
1226
+ const v = version.startsWith("v") ? version.slice(1) : version;
1227
+ const match = v.match(VERSION_REGEX);
1079
1228
  if (!(match?.[1] && match[2] && match[3])) {
1080
1229
  throw new Error(`Invalid version format: ${version}`);
1081
1230
  }
@@ -1241,10 +1390,11 @@ async function collectCommits(pkg, options, warnings) {
1241
1390
  throw new Error(`No commits found since last release for ${pkg.packageName}`);
1242
1391
  }
1243
1392
  const commits = parseCommits(rawCommits);
1244
- if (commits.length === 0 && !options.version) {
1393
+ const filteredCommits = commits.filter((commit) => !commit.scope || commit.scope === pkg.name);
1394
+ if (filteredCommits.length === 0 && !options.version) {
1245
1395
  warnings.push("No conventional commits found, but will proceed with patch bump");
1246
1396
  }
1247
- return commits;
1397
+ return filteredCommits;
1248
1398
  }
1249
1399
  function resolvePrereleaseTag(options, config) {
1250
1400
  if (typeof options.prerelease === "string") {
@@ -1255,20 +1405,24 @@ function resolvePrereleaseTag(options, config) {
1255
1405
  }
1256
1406
  return;
1257
1407
  }
1258
- async function createGitVerseRelease(options, repoInfo, commits, config, pkg, versionBump, tag, warnings) {
1259
- if (options.noRelease) {
1408
+ async function createGitVerseRelease(options, repoInfo, commits, config, pkg, versionBump, tag, retryFn) {
1409
+ if (options.noRelease || !config.gitverse.enabled) {
1260
1410
  return;
1261
1411
  }
1262
- try {
1263
- const gitverseClient = createGitVerseClient(repoInfo);
1264
- const releaseNotes = generateReleaseNotes(commits, config.changelog, repoInfo.url);
1265
- return await gitverseClient.createRelease(tag, `${pkg.packageName} v${versionBump.newVersion}`, releaseNotes, {
1266
- prerelease: !!options.prerelease
1267
- });
1268
- } catch (error) {
1269
- warnings.push(`Failed to create GitVerse release: ${error instanceof Error ? error.message : String(error)}`);
1270
- return;
1412
+ const gitverseClient = createGitVerseClient(repoInfo, retryFn);
1413
+ if (config.gitverse.checkExisting) {
1414
+ const exists = await gitverseClient.releaseExists(tag);
1415
+ if (exists) {
1416
+ console.log(`
1417
+ ✅ Release ${tag} already exists, skipping creation
1418
+ `);
1419
+ return `${repoInfo.url}/releases/tag/${tag}`;
1420
+ }
1271
1421
  }
1422
+ const releaseNotes = generateReleaseNotes(commits, config.changelog, repoInfo.url, pkg.name);
1423
+ return await gitverseClient.createRelease(tag, `${pkg.packageName} v${versionBump.newVersion}`, releaseNotes, {
1424
+ prerelease: !!options.prerelease
1425
+ });
1272
1426
  }
1273
1427
  async function performGitOperations(config, options, pkg, newVersion, tag, changelogPath) {
1274
1428
  if (config.git.commitChanges && !options.noCommit) {
@@ -1298,6 +1452,12 @@ async function release(packageName, options = {}) {
1298
1452
  const repoInfo = await getRepoInfo();
1299
1453
  const pkg = await resolvePackage(config, packageName);
1300
1454
  result.packageName = pkg.packageName;
1455
+ if (!options.dryRun && config.git.beforeCommit) {
1456
+ const hookSuccess = await runBeforeCommitHook(config.git.beforeCommit);
1457
+ if (hookSuccess) {
1458
+ await addChangedFiles();
1459
+ }
1460
+ }
1301
1461
  if (!(options.dryRun || await isWorkingTreeClean())) {
1302
1462
  throw new Error("Working tree is not clean. Please commit or stash your changes.");
1303
1463
  }
@@ -1317,15 +1477,27 @@ async function release(packageName, options = {}) {
1317
1477
  date: new Date,
1318
1478
  repoUrl: repoInfo.url,
1319
1479
  version: versionBump.newVersion
1320
- }, config.changelog);
1480
+ }, config.changelog, pkg.name);
1321
1481
  if (options.dryRun) {
1322
1482
  printDryRunInfo(pkg, currentVersion, versionBump, tag, commits, changelogEntry);
1323
1483
  result.success = true;
1324
1484
  return result;
1325
1485
  }
1486
+ const retryFn = createRetryFunction(config.retry);
1326
1487
  const changelogPath = await updatePackageFiles(pkg, versionBump.newVersion, changelogEntry);
1327
1488
  await performGitOperations(config, options, pkg, versionBump.newVersion, tag, changelogPath);
1328
- result.releaseUrl = await createGitVerseRelease(options, repoInfo, commits, config, pkg, versionBump, tag, result.warnings);
1489
+ try {
1490
+ result.releaseUrl = await createGitVerseRelease(options, repoInfo, commits, config, pkg, versionBump, tag, retryFn);
1491
+ } catch (error) {
1492
+ const errorMessage = error instanceof Error ? error.message : String(error);
1493
+ if (config.gitverse.failOnError) {
1494
+ throw new Error(`GitVerse release creation failed: ${errorMessage}`);
1495
+ }
1496
+ result.warnings.push(`Failed to create GitVerse release: ${errorMessage}`);
1497
+ console.warn(`
1498
+ ⚠️ Warning: ${errorMessage}
1499
+ `);
1500
+ }
1329
1501
  result.success = true;
1330
1502
  printSuccessInfo(pkg, currentVersion, versionBump.newVersion, tag, result.releaseUrl);
1331
1503
  return result;
@@ -1360,14 +1532,187 @@ async function resolvePackage(config, packageName) {
1360
1532
  }
1361
1533
  return pkg;
1362
1534
  }
1535
+ async function createReleaseOnly(tag, packageName, configPath) {
1536
+ const result = {
1537
+ errors: [],
1538
+ newVersion: "",
1539
+ oldVersion: "",
1540
+ packageName: packageName || "unknown",
1541
+ success: false,
1542
+ tag,
1543
+ warnings: []
1544
+ };
1545
+ try {
1546
+ const config = await loadConfig(configPath);
1547
+ validateConfig(config);
1548
+ const repoInfo = await getRepoInfo();
1549
+ const pkg = await resolvePackage(config, packageName);
1550
+ result.packageName = pkg.packageName;
1551
+ const version = tag.replace(pkg.tagPrefix, "");
1552
+ result.newVersion = version;
1553
+ const rawCommits = await getCommitsSinceTag(pkg.tagPrefix, pkg.path);
1554
+ const commits = parseCommits(rawCommits);
1555
+ const retryFn = createRetryFunction(config.retry);
1556
+ const gitverseClient = createGitVerseClient(repoInfo, retryFn);
1557
+ if (config.gitverse.checkExisting) {
1558
+ const exists = await gitverseClient.releaseExists(tag);
1559
+ if (exists) {
1560
+ console.log(`
1561
+ ✅ Release ${tag} already exists
1562
+ `);
1563
+ result.releaseUrl = `${repoInfo.url}/releases/tag/${tag}`;
1564
+ result.success = true;
1565
+ return result;
1566
+ }
1567
+ }
1568
+ const releaseNotes = generateReleaseNotes(commits, config.changelog, repoInfo.url, pkg.name);
1569
+ result.releaseUrl = await gitverseClient.createRelease(tag, `${pkg.packageName} v${version}`, releaseNotes);
1570
+ result.success = true;
1571
+ console.log(`
1572
+ ✅ Release created successfully!`);
1573
+ console.log(`\uD83D\uDCE6 Package: ${pkg.packageName}`);
1574
+ console.log(`\uD83C\uDFF7️ Tag: ${tag}`);
1575
+ console.log(`\uD83C\uDF10 Release: ${result.releaseUrl}
1576
+ `);
1577
+ return result;
1578
+ } catch (error) {
1579
+ result.success = false;
1580
+ result.errors.push(error instanceof Error ? error.message : String(error));
1581
+ console.error(`
1582
+ ❌ Release creation failed:
1583
+ `);
1584
+ console.error(error);
1585
+ console.error("");
1586
+ return result;
1587
+ }
1588
+ }
1363
1589
 
1364
1590
  // src/cli.ts
1365
1591
  import { parseArgs } from "node:util";
1592
+
1593
+ // src/utils/commitlint-generator.ts
1594
+ import { writeFile as writeFile2 } from "node:fs/promises";
1595
+ async function generateCommitlint(config, options = {}) {
1596
+ const {
1597
+ output = "commitlint.config.ts",
1598
+ format = "ts",
1599
+ scopes,
1600
+ scopeRequired = false,
1601
+ headerMaxLength = 100,
1602
+ comments = true,
1603
+ dryRun = false,
1604
+ verbose = false
1605
+ } = options;
1606
+ const commitTypes = extractCommitTypes(config);
1607
+ const commitScopes = extractCommitScopes(config, scopes);
1608
+ const configContent = generateConfigContent(commitTypes, commitScopes, { headerMaxLength, scopeRequired }, format, comments);
1609
+ if (verbose) {
1610
+ console.log(`
1611
+ \uD83D\uDCCA Configuration:`);
1612
+ console.log(` Types: ${commitTypes.join(", ")}`);
1613
+ console.log(` Scopes: ${commitScopes.join(", ")}`);
1614
+ console.log(` Scope required: ${scopeRequired}`);
1615
+ console.log(` Header max length: ${headerMaxLength}`);
1616
+ }
1617
+ if (dryRun) {
1618
+ console.log(`
1619
+ \uD83D\uDD0D Dry-run mode - Preview of generated config:
1620
+ `);
1621
+ console.log(configContent);
1622
+ console.log(`
1623
+ \uD83D\uDCDD Would write to: ${output}`);
1624
+ return;
1625
+ }
1626
+ await writeFile2(output, configContent);
1627
+ console.log(`✅ Generated commitlint config: ${output}`);
1628
+ }
1629
+ function extractCommitTypes(config) {
1630
+ return Object.keys(config.changelog.types);
1631
+ }
1632
+ function extractCommitScopes(config, additionalScopes) {
1633
+ const scopes = [];
1634
+ if (config.monorepo?.enabled && config.monorepo.packages) {
1635
+ scopes.push(...config.monorepo.packages.map((p) => p.name));
1636
+ }
1637
+ const defaultScopes = ["deps", "ci", "docs"];
1638
+ scopes.push(...defaultScopes);
1639
+ if (additionalScopes) {
1640
+ scopes.push(...additionalScopes);
1641
+ }
1642
+ return [...new Set(scopes)].sort();
1643
+ }
1644
+ function generateConfigContent(types2, scopes, rules, format, comments) {
1645
+ if (format === "json") {
1646
+ return generateJSONConfig(types2, scopes, rules);
1647
+ }
1648
+ const isTS = format === "ts";
1649
+ const _ext = isTS ? "ts" : "js";
1650
+ const header = comments ? `// AUTO-GENERATED by gitverse-release
1651
+ // Run: gitverse-release generate-commitlint
1652
+ // DO NOT EDIT MANUALLY - Changes will be overwritten
1653
+
1654
+ ` : "";
1655
+ const typeImport = isTS ? `import type { UserConfig } from "@commitlint/types";
1656
+
1657
+ ` : "";
1658
+ const configDeclaration = isTS ? "const config: UserConfig = " : "const config = ";
1659
+ const typesComment = comments ? ` // Types from release config
1660
+ ` : "";
1661
+ const scopesComment = comments ? ` // Scopes from release config
1662
+ ` : "";
1663
+ const scopeEmptyRule = rules.scopeRequired ? ` "scope-empty": [2, "never"], // scope required
1664
+ ` : ` "scope-empty": [0], // scope optional
1665
+ `;
1666
+ const content = `${header}${typeImport}${configDeclaration}{
1667
+ extends: ["@commitlint/config-conventional"],
1668
+
1669
+ rules: {
1670
+ ${typesComment} "type-enum": [2, "always", ${JSON.stringify(types2)}],
1671
+
1672
+ ${scopesComment} "scope-enum": [2, "always", ${JSON.stringify(scopes)}],
1673
+ ${scopeEmptyRule}
1674
+ "subject-case": [2, "always", "lower-case"],
1675
+ "subject-empty": [2, "never"],
1676
+ "header-max-length": [2, "always", ${rules.headerMaxLength}],
1677
+ "body-leading-blank": [2, "always"],
1678
+ "footer-leading-blank": [2, "always"],
1679
+ },
1680
+ };
1681
+
1682
+ ${isTS ? "export default config;" : "module.exports = config;"}
1683
+ `;
1684
+ return content;
1685
+ }
1686
+ function generateJSONConfig(types2, scopes, rules) {
1687
+ const config = {
1688
+ extends: ["@commitlint/config-conventional"],
1689
+ rules: {
1690
+ "body-leading-blank": [2, "always"],
1691
+ "footer-leading-blank": [2, "always"],
1692
+ "header-max-length": [2, "always", rules.headerMaxLength],
1693
+ "scope-empty": rules.scopeRequired ? [2, "never"] : [0],
1694
+ "scope-enum": [2, "always", scopes],
1695
+ "subject-case": [2, "always", "lower-case"],
1696
+ "subject-empty": [2, "never"],
1697
+ "type-enum": [2, "always", types2]
1698
+ }
1699
+ };
1700
+ return JSON.stringify(config, null, 2);
1701
+ }
1702
+
1703
+ // src/cli.ts
1366
1704
  var HELP_TEXT = `
1367
1705
  gitverse-release - Release automation tool for GitVerse
1368
1706
 
1369
1707
  Usage:
1370
1708
  gitverse-release [package-name] [options]
1709
+ gitverse-release create-only --tag <tag> [options]
1710
+ gitverse-release generate-commitlint [options]
1711
+
1712
+ Commands:
1713
+ (default) Full release: update version, commit, tag, push, create release
1714
+ create-only Create only GitVerse Release for existing tag (recovery mode)
1715
+ generate-commitlint Generate commitlint config from release config
1371
1716
 
1372
1717
  Options:
1373
1718
  --dry-run Test run without making changes
@@ -1379,9 +1724,18 @@ Options:
1379
1724
  --no-tag Skip creating git tag
1380
1725
  --no-push Skip pushing to remote
1381
1726
  --no-release Skip creating GitVerse Release
1727
+ --tag <tag> Tag name (for create-only command)
1382
1728
  --verbose Verbose output
1383
1729
  --help Show this help message
1384
1730
 
1731
+ Generate Commitlint Options:
1732
+ --output <path> Output path for commitlint config (default: commitlint.config.ts)
1733
+ --format <format> Output format: ts, js, json (default: ts)
1734
+ --scopes <scopes> Additional scopes (comma-separated)
1735
+ --scope-required Make scope required in commits
1736
+ --header-max-length <n> Maximum header length (default: 100)
1737
+ --no-comments Disable comments in generated config
1738
+
1385
1739
  Examples:
1386
1740
  # Auto-detect version and create release
1387
1741
  gitverse-release sdk
@@ -1398,6 +1752,16 @@ Examples:
1398
1752
  # Custom config
1399
1753
  gitverse-release sdk --config ./my-config.json
1400
1754
 
1755
+ # Create only release for existing tag (recovery)
1756
+ gitverse-release create-only --tag v1.2.3
1757
+ gitverse-release create-only --tag sdk-v4.0.2 --package sdk
1758
+
1759
+ # Generate commitlint config
1760
+ gitverse-release generate-commitlint
1761
+ gitverse-release generate-commitlint --dry-run
1762
+ gitverse-release generate-commitlint --format js --output .commitlintrc.js
1763
+ gitverse-release generate-commitlint --scopes deps,ci,docs --scope-required
1764
+
1401
1765
  Environment Variables:
1402
1766
  GITVERSE_TOKEN GitVerse API token (required)
1403
1767
 
@@ -1411,13 +1775,20 @@ async function main() {
1411
1775
  options: {
1412
1776
  config: { type: "string" },
1413
1777
  "dry-run": { type: "boolean" },
1778
+ format: { type: "string" },
1779
+ "header-max-length": { type: "string" },
1414
1780
  help: { type: "boolean" },
1781
+ "no-comments": { type: "boolean" },
1415
1782
  "no-commit": { type: "boolean" },
1416
1783
  "no-push": { type: "boolean" },
1417
1784
  "no-release": { type: "boolean" },
1418
1785
  "no-tag": { type: "boolean" },
1786
+ output: { type: "string" },
1419
1787
  package: { type: "string" },
1420
1788
  prerelease: { type: "string" },
1789
+ "scope-required": { type: "boolean" },
1790
+ scopes: { type: "string" },
1791
+ tag: { type: "string" },
1421
1792
  verbose: { type: "boolean" },
1422
1793
  version: { type: "string" }
1423
1794
  }
@@ -1426,6 +1797,49 @@ async function main() {
1426
1797
  console.log(HELP_TEXT);
1427
1798
  process.exit(0);
1428
1799
  }
1800
+ const command = positionals[0];
1801
+ if (command === "generate-commitlint") {
1802
+ const config = await loadConfig(values.config);
1803
+ const scopesList = values.scopes ? values.scopes.split(",").map((s) => s.trim()) : config.commitlint.scopes;
1804
+ const headerMaxLength = values["header-max-length"] ? Number.parseInt(values["header-max-length"], 10) : config.commitlint.headerMaxLength;
1805
+ await generateCommitlint(config, {
1806
+ comments: values["no-comments"] !== undefined ? !values["no-comments"] : config.commitlint.comments,
1807
+ dryRun: values["dry-run"],
1808
+ format: values.format ?? config.commitlint.format,
1809
+ headerMaxLength,
1810
+ output: values.output ?? config.commitlint.output,
1811
+ scopeRequired: values["scope-required"] ?? config.commitlint.scopeRequired,
1812
+ scopes: scopesList,
1813
+ verbose: values.verbose
1814
+ });
1815
+ process.exit(0);
1816
+ }
1817
+ if (command === "create-only") {
1818
+ if (!values.tag) {
1819
+ console.error("❌ Error: --tag is required for create-only command");
1820
+ console.log(`
1821
+ Usage: gitverse-release create-only --tag <tag> [--package <name>]`);
1822
+ process.exit(1);
1823
+ }
1824
+ const result2 = await createReleaseOnly(values.tag, values.package, values.config);
1825
+ if (values.verbose) {
1826
+ console.log(`
1827
+ \uD83D\uDCCA Result:`);
1828
+ console.log(JSON.stringify(result2, null, 2));
1829
+ }
1830
+ if (result2.errors.length > 0) {
1831
+ console.error(`
1832
+ ❌ Errors:`);
1833
+ for (const error of result2.errors) {
1834
+ console.error(` - ${error}`);
1835
+ }
1836
+ process.exit(1);
1837
+ }
1838
+ if (!result2.success) {
1839
+ process.exit(1);
1840
+ }
1841
+ process.exit(0);
1842
+ }
1429
1843
  const options = {
1430
1844
  config: values.config,
1431
1845
  dryRun: values["dry-run"],
@@ -1438,7 +1852,7 @@ async function main() {
1438
1852
  verbose: values.verbose,
1439
1853
  version: values.version
1440
1854
  };
1441
- const packageName = positionals[0] || options.package;
1855
+ const packageName = command || options.package;
1442
1856
  const result = await release(packageName, options);
1443
1857
  if (options.verbose) {
1444
1858
  console.log(`
@@ -1473,4 +1887,4 @@ async function main() {
1473
1887
  }
1474
1888
  main();
1475
1889
 
1476
- //# debugId=C891F93BC32B0BA664756E2164756E21
1890
+ //# debugId=47967437F070163A64756E2164756E21