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/index.js CHANGED
@@ -41,16 +41,36 @@ var DEFAULT_CONFIG = {
41
41
  test: "✅ Tests"
42
42
  }
43
43
  },
44
+ commitlint: {
45
+ comments: true,
46
+ format: "ts",
47
+ headerMaxLength: 100,
48
+ output: "commitlint.config.ts",
49
+ scopeRequired: false,
50
+ scopes: ["deps", "ci", "docs"]
51
+ },
44
52
  git: {
45
53
  commitChanges: true,
46
54
  commitMessage: "chore(release): {{package}} v{{version}} [skip ci]",
47
55
  push: true,
48
56
  tagMessage: "Release {{package}} v{{version}}"
49
57
  },
58
+ gitverse: {
59
+ checkExisting: true,
60
+ enabled: true,
61
+ failOnError: true
62
+ },
50
63
  monorepo: {
51
64
  enabled: false,
52
65
  packages: []
53
66
  },
67
+ retry: {
68
+ enabled: true,
69
+ initialDelay: 2000,
70
+ maxAttempts: 5,
71
+ maxDelay: 30000,
72
+ operations: ["push", "createRelease"]
73
+ },
54
74
  versioning: {
55
75
  allowPrerelease: false,
56
76
  preMajorMode: "auto",
@@ -82,14 +102,26 @@ function mergeConfig(defaults, user) {
82
102
  ...user.changelog?.types
83
103
  }
84
104
  },
105
+ commitlint: {
106
+ ...defaults.commitlint,
107
+ ...user.commitlint
108
+ },
85
109
  git: {
86
110
  ...defaults.git,
87
111
  ...user.git
88
112
  },
113
+ gitverse: {
114
+ ...defaults.gitverse,
115
+ ...user.gitverse
116
+ },
89
117
  monorepo: {
90
118
  ...defaults.monorepo,
91
119
  ...user.monorepo
92
120
  },
121
+ retry: {
122
+ ...defaults.retry,
123
+ ...user.retry
124
+ },
93
125
  versioning: {
94
126
  ...defaults.versioning,
95
127
  ...user.versioning
@@ -108,14 +140,14 @@ function validateConfig(config) {
108
140
  }
109
141
 
110
142
  // ../sdk/dist/api/organizations.js
111
- class j {
143
+ class k {
112
144
  client;
113
145
  constructor(b) {
114
146
  this.client = b;
115
147
  }
116
- async checkMembership(b, h) {
148
+ async checkMembership(b, h, j) {
117
149
  try {
118
- return await this.client.get(`/orgs/${b}/members/${h}`), true;
150
+ return await this.client.get(`/orgs/${b}/members/${h}`, j), true;
119
151
  } catch (d) {
120
152
  if (d instanceof Error && d.message.includes("404"))
121
153
  return false;
@@ -125,126 +157,126 @@ class j {
125
157
  }
126
158
 
127
159
  // ../sdk/dist/api/commits.js
128
- class g {
160
+ class j {
129
161
  client;
130
162
  constructor(b) {
131
163
  this.client = b;
132
164
  }
133
- list(b, d) {
134
- return this.client.get(`/repos/${b}/${d}/commits`);
165
+ list(b, d, f) {
166
+ return this.client.get(`/repos/${b}/${d}/commits`, f);
135
167
  }
136
- get(b, d, f) {
137
- return this.client.get(`/repos/${b}/${d}/commits/${f}`);
168
+ get(b, d, f, g) {
169
+ return this.client.get(`/repos/${b}/${d}/commits/${f}`, g);
138
170
  }
139
- create(b, d, f) {
140
- return this.client.post(`/repos/${b}/${d}/git/commits`, f);
171
+ create(b, d, f, g) {
172
+ return this.client.post(`/repos/${b}/${d}/git/commits`, f, g);
141
173
  }
142
174
  }
143
175
 
144
176
  // ../sdk/dist/api/actions.js
145
- class v {
177
+ class x {
146
178
  client;
147
179
  constructor(b) {
148
180
  this.client = b;
149
181
  }
150
- listOrgRunners(b) {
151
- return this.client.get(`/orgs/${b}/actions/runners`);
182
+ listOrgRunners(b, h) {
183
+ return this.client.get(`/orgs/${b}/actions/runners`, h);
152
184
  }
153
- createOrgRegistrationToken(b) {
154
- return this.client.post(`/orgs/${b}/actions/runners/registration-token`, {});
185
+ createOrgRegistrationToken(b, h) {
186
+ return this.client.post(`/orgs/${b}/actions/runners/registration-token`, {}, h);
155
187
  }
156
- getOrgRunner(b, h) {
157
- return this.client.get(`/orgs/${b}/actions/runners/${h}`);
188
+ getOrgRunner(b, h, j2) {
189
+ return this.client.get(`/orgs/${b}/actions/runners/${h}`, j2);
158
190
  }
159
- deleteOrgRunner(b, h) {
160
- return this.client.delete(`/orgs/${b}/actions/runners/${h}`);
191
+ deleteOrgRunner(b, h, j2) {
192
+ return this.client.delete(`/orgs/${b}/actions/runners/${h}`, undefined, j2);
161
193
  }
162
- listRepoRunners(b, h) {
163
- return this.client.get(`/repos/${b}/${h}/actions/runners`);
194
+ listRepoRunners(b, h, j2) {
195
+ return this.client.get(`/repos/${b}/${h}/actions/runners`, j2);
164
196
  }
165
- createRepoRegistrationToken(b, h) {
166
- return this.client.post(`/repos/${b}/${h}/actions/runners/registration-token`, {});
197
+ createRepoRegistrationToken(b, h, j2) {
198
+ return this.client.post(`/repos/${b}/${h}/actions/runners/registration-token`, {}, j2);
167
199
  }
168
- getRepoRunner(b, h, j2) {
169
- return this.client.get(`/repos/${b}/${h}/actions/runners/${j2}`);
200
+ getRepoRunner(b, h, j2, q) {
201
+ return this.client.get(`/repos/${b}/${h}/actions/runners/${j2}`, q);
170
202
  }
171
- deleteRepoRunner(b, h, j2) {
172
- return this.client.delete(`/repos/${b}/${h}/actions/runners/${j2}`);
203
+ deleteRepoRunner(b, h, j2, q) {
204
+ return this.client.delete(`/repos/${b}/${h}/actions/runners/${j2}`, undefined, q);
173
205
  }
174
- listOrgSecrets(b) {
175
- return this.client.get(`/orgs/${b}/actions/secrets`);
206
+ listOrgSecrets(b, h) {
207
+ return this.client.get(`/orgs/${b}/actions/secrets`, h);
176
208
  }
177
- getOrgSecret(b, h) {
178
- return this.client.get(`/orgs/${b}/actions/secrets/${h}`);
209
+ getOrgSecret(b, h, j2) {
210
+ return this.client.get(`/orgs/${b}/actions/secrets/${h}`, j2);
179
211
  }
180
- createOrUpdateOrgSecret(b, h, j2) {
181
- return this.client.put(`/orgs/${b}/actions/secrets/${h}`, j2);
212
+ createOrUpdateOrgSecret(b, h, j2, q) {
213
+ return this.client.put(`/orgs/${b}/actions/secrets/${h}`, j2, q);
182
214
  }
183
- deleteOrgSecret(b, h) {
184
- return this.client.delete(`/orgs/${b}/actions/secrets/${h}`);
215
+ deleteOrgSecret(b, h, j2) {
216
+ return this.client.delete(`/orgs/${b}/actions/secrets/${h}`, undefined, j2);
185
217
  }
186
- listRepoSecrets(b, h) {
187
- return this.client.get(`/repos/${b}/${h}/actions/secrets`);
218
+ listRepoSecrets(b, h, j2) {
219
+ return this.client.get(`/repos/${b}/${h}/actions/secrets`, j2);
188
220
  }
189
- getRepoSecret(b, h, j2) {
190
- return this.client.get(`/repos/${b}/${h}/actions/secrets/${j2}`);
221
+ getRepoSecret(b, h, j2, q) {
222
+ return this.client.get(`/repos/${b}/${h}/actions/secrets/${j2}`, q);
191
223
  }
192
- createOrUpdateRepoSecret(b, h, j2, q) {
193
- return this.client.put(`/repos/${b}/${h}/actions/secrets/${j2}`, q);
224
+ createOrUpdateRepoSecret(b, h, j2, q, v) {
225
+ return this.client.put(`/repos/${b}/${h}/actions/secrets/${j2}`, q, v);
194
226
  }
195
- deleteRepoSecret(b, h, j2) {
196
- return this.client.delete(`/repos/${b}/${h}/actions/secrets/${j2}`);
227
+ deleteRepoSecret(b, h, j2, q) {
228
+ return this.client.delete(`/repos/${b}/${h}/actions/secrets/${j2}`, undefined, q);
197
229
  }
198
- listOrgVariables(b) {
199
- return this.client.get(`/orgs/${b}/actions/variables`);
230
+ listOrgVariables(b, h) {
231
+ return this.client.get(`/orgs/${b}/actions/variables`, h);
200
232
  }
201
- createOrgVariable(b, h) {
202
- return this.client.post(`/orgs/${b}/actions/variables`, h);
233
+ createOrgVariable(b, h, j2) {
234
+ return this.client.post(`/orgs/${b}/actions/variables`, h, j2);
203
235
  }
204
- getOrgVariable(b, h) {
205
- return this.client.get(`/orgs/${b}/actions/variables/${h}`);
236
+ getOrgVariable(b, h, j2) {
237
+ return this.client.get(`/orgs/${b}/actions/variables/${h}`, j2);
206
238
  }
207
- deleteOrgVariable(b, h) {
208
- return this.client.delete(`/orgs/${b}/actions/variables/${h}`);
239
+ deleteOrgVariable(b, h, j2) {
240
+ return this.client.delete(`/orgs/${b}/actions/variables/${h}`, undefined, j2);
209
241
  }
210
- updateOrgVariable(b, h, j2) {
211
- return this.client.patch(`/orgs/${b}/actions/variables/${h}`, j2);
242
+ updateOrgVariable(b, h, j2, q) {
243
+ return this.client.patch(`/orgs/${b}/actions/variables/${h}`, j2, q);
212
244
  }
213
- listRepoVariables(b, h) {
214
- return this.client.get(`/repos/${b}/${h}/actions/variables`);
245
+ listRepoVariables(b, h, j2) {
246
+ return this.client.get(`/repos/${b}/${h}/actions/variables`, j2);
215
247
  }
216
- createRepoVariable(b, h, j2) {
217
- return this.client.post(`/repos/${b}/${h}/actions/variables`, j2);
248
+ createRepoVariable(b, h, j2, q) {
249
+ return this.client.post(`/repos/${b}/${h}/actions/variables`, j2, q);
218
250
  }
219
- getRepoVariable(b, h, j2) {
220
- return this.client.get(`/repos/${b}/${h}/actions/variables/${j2}`);
251
+ getRepoVariable(b, h, j2, q) {
252
+ return this.client.get(`/repos/${b}/${h}/actions/variables/${j2}`, q);
221
253
  }
222
- deleteRepoVariable(b, h, j2) {
223
- return this.client.delete(`/repos/${b}/${h}/actions/variables/${j2}`);
254
+ deleteRepoVariable(b, h, j2, q) {
255
+ return this.client.delete(`/repos/${b}/${h}/actions/variables/${j2}`, undefined, q);
224
256
  }
225
- updateRepoVariable(b, h, j2, q) {
226
- return this.client.patch(`/repos/${b}/${h}/actions/variables/${j2}`, q);
257
+ updateRepoVariable(b, h, j2, q, v) {
258
+ return this.client.patch(`/repos/${b}/${h}/actions/variables/${j2}`, q, v);
227
259
  }
228
- listArtifacts(b, h) {
229
- return this.client.get(`/repos/${b}/${h}/actions/artifacts`);
260
+ listArtifacts(b, h, j2) {
261
+ return this.client.get(`/repos/${b}/${h}/actions/artifacts`, j2);
230
262
  }
231
- getArtifact(b, h, j2) {
232
- return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}`);
263
+ getArtifact(b, h, j2, q) {
264
+ return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}`, q);
233
265
  }
234
- deleteArtifact(b, h, j2) {
235
- return this.client.delete(`/repos/${b}/${h}/actions/artifacts/${j2}`);
266
+ deleteArtifact(b, h, j2, q) {
267
+ return this.client.delete(`/repos/${b}/${h}/actions/artifacts/${j2}`, undefined, q);
236
268
  }
237
- downloadArtifact(b, h, j2) {
238
- return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}/zip`);
269
+ downloadArtifact(b, h, j2, q) {
270
+ return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}/zip`, q);
239
271
  }
240
- downloadArtifactRaw(b, h, j2) {
241
- return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}/zip/raw`);
272
+ downloadArtifactRaw(b, h, j2, q) {
273
+ return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}/zip/raw`, q);
242
274
  }
243
- getWorkflowDispatchInputs(b, h, j2) {
244
- return this.client.get(`/repos/${b}/${h}/actions/workflows/${j2}/dispatches`);
275
+ getWorkflowDispatchInputs(b, h, j2, q) {
276
+ return this.client.get(`/repos/${b}/${h}/actions/workflows/${j2}/dispatches`, q);
245
277
  }
246
- dispatchWorkflow(b, h, j2, q) {
247
- return this.client.post(`/repos/${b}/${h}/actions/workflows/${j2}/dispatches`, q);
278
+ dispatchWorkflow(b, h, j2, q, v) {
279
+ return this.client.post(`/repos/${b}/${h}/actions/workflows/${j2}/dispatches`, q, v);
248
280
  }
249
281
  }
250
282
 
@@ -258,11 +290,11 @@ class j2 extends Error {
258
290
  }
259
291
  }
260
292
 
261
- class k extends j2 {
293
+ class k2 extends j2 {
262
294
  rateLimit;
263
295
  constructor(b, f, h) {
264
296
  super(429, b, h);
265
- this.name = "RateLimitError", this.rateLimit = f, Object.setPrototypeOf(this, k.prototype);
297
+ this.name = "RateLimitError", this.rateLimit = f, Object.setPrototypeOf(this, k2.prototype);
266
298
  }
267
299
  getRetryAfterSeconds() {
268
300
  return this.rateLimit.retryAfter;
@@ -288,389 +320,387 @@ class q {
288
320
  }
289
321
 
290
322
  // ../sdk/dist/api/stars.js
291
- class j3 {
323
+ class k3 {
292
324
  client;
293
325
  constructor(b) {
294
326
  this.client = b;
295
327
  }
296
- list() {
297
- return this.client.get("/user/starred");
328
+ list(b) {
329
+ return this.client.get("/user/starred", b);
298
330
  }
299
- async add(b, c) {
300
- await this.client.put(`/user/starred/${b}/${c}`);
331
+ async add(b, c, f) {
332
+ await this.client.put(`/user/starred/${b}/${c}`, undefined, f);
301
333
  }
302
- async check(b, c) {
334
+ async check(b, c, f) {
303
335
  try {
304
- return await this.client.get(`/user/starred/${b}/${c}`), true;
305
- } catch (f) {
306
- if (f instanceof j2 && f.status === 404)
336
+ return await this.client.get(`/user/starred/${b}/${c}`, f), true;
337
+ } catch (h) {
338
+ if (h instanceof j2 && h.status === 404)
307
339
  return false;
308
- throw f;
340
+ throw h;
309
341
  }
310
342
  }
311
- async remove(b, c) {
312
- await this.client.delete(`/user/starred/${b}/${c}`);
343
+ async remove(b, c, f) {
344
+ await this.client.delete(`/user/starred/${b}/${c}`, undefined, f);
313
345
  }
314
346
  }
315
347
 
316
348
  // ../sdk/dist/api/issues.js
317
- class A {
349
+ class B {
318
350
  client;
319
351
  constructor(c) {
320
352
  this.client = c;
321
353
  }
322
- list(c, h, f) {
323
- let j4 = new URLSearchParams;
354
+ list(c, h, f, j3) {
355
+ let k4 = new URLSearchParams;
324
356
  if (f)
325
- j4.append("state", f);
326
- let k2 = j4.toString(), z = `/repos/${c}/${h}/issues${k2 ? `?${k2}` : ""}`;
327
- return this.client.get(z);
357
+ k4.append("state", f);
358
+ let z = k4.toString(), A = `/repos/${c}/${h}/issues${z ? `?${z}` : ""}`;
359
+ return this.client.get(A, j3);
328
360
  }
329
- get(c, h, f) {
330
- return this.client.get(`/repos/${c}/${h}/issues/${f}`);
361
+ get(c, h, f, j3) {
362
+ return this.client.get(`/repos/${c}/${h}/issues/${f}`, j3);
331
363
  }
332
- getComment(c, h, f) {
333
- return this.client.get(`/repos/${c}/${h}/issues/comments/${f}`);
364
+ getComment(c, h, f, j3) {
365
+ return this.client.get(`/repos/${c}/${h}/issues/comments/${f}`, j3);
334
366
  }
335
- getComments(c, h, f) {
336
- return this.client.get(`/repos/${c}/${h}/issues/${f}/comments`);
367
+ getComments(c, h, f, j3) {
368
+ return this.client.get(`/repos/${c}/${h}/issues/${f}/comments`, j3);
337
369
  }
338
- getLabels(c, h, f) {
339
- return this.client.get(`/repos/${c}/${h}/issues/${f}/labels`);
370
+ getLabels(c, h, f, j3) {
371
+ return this.client.get(`/repos/${c}/${h}/issues/${f}/labels`, j3);
340
372
  }
341
- getTimeline(c, h, f) {
342
- return this.client.get(`/repos/${c}/${h}/issues/${f}/timeline`);
373
+ getTimeline(c, h, f, j3) {
374
+ return this.client.get(`/repos/${c}/${h}/issues/${f}/timeline`, j3);
343
375
  }
344
376
  }
345
377
 
346
378
  // ../sdk/dist/api/branches.js
347
- class f {
379
+ class g {
348
380
  client;
349
381
  constructor(b) {
350
382
  this.client = b;
351
383
  }
352
- list(b, d) {
353
- return this.client.get(`/repos/${b}/${d}/branches`);
384
+ list(b, d, f) {
385
+ return this.client.get(`/repos/${b}/${d}/branches`, f);
354
386
  }
355
387
  }
356
388
 
357
389
  // ../sdk/dist/utils.js
358
390
  var z = /^([a-z][a-z0-9+.-]*:\/\/[^/]+)\/([a-z][a-z0-9+.-]*:\/\/.+)$/i;
359
- function E(j4) {
360
- if (!j4)
361
- return j4;
362
- let k2 = j4.match(z);
363
- if (k2?.[1] && k2?.[2]) {
364
- let q2 = k2[1], v2 = k2[2];
365
- if (v2.startsWith(q2))
366
- return v2;
367
- }
368
- return j4;
369
- }
370
- function J(j4) {
371
- let k2 = ["clone_url", "html_url", "url", "git_url", "mirror_url"], q2 = { ...j4 };
372
- for (let v2 of k2)
373
- if (typeof q2[v2] === "string")
374
- q2[v2] = E(q2[v2]);
391
+ function E(j3) {
392
+ if (!j3)
393
+ return j3;
394
+ let k4 = j3.match(z);
395
+ if (k4?.[1] && k4?.[2]) {
396
+ let q2 = k4[1], v = k4[2];
397
+ if (v.startsWith(q2))
398
+ return v;
399
+ }
400
+ return j3;
401
+ }
402
+ function J(j3) {
403
+ let k4 = ["clone_url", "html_url", "url", "git_url", "mirror_url"], q2 = { ...j3 };
404
+ for (let v of k4)
405
+ if (typeof q2[v] === "string")
406
+ q2[v] = E(q2[v]);
375
407
  return q2;
376
408
  }
377
409
 
378
410
  // ../sdk/dist/api/repositories.js
379
- class z2 {
411
+ class A {
380
412
  client;
381
413
  constructor(g2) {
382
414
  this.client = g2;
383
415
  }
384
- async get(g2, j4) {
385
- let k2 = await this.client.get(`/repos/${g2}/${j4}`);
386
- return J(k2);
416
+ async get(g2, k4, j3) {
417
+ let q2 = await this.client.get(`/repos/${g2}/${k4}`, j3);
418
+ return J(q2);
387
419
  }
388
- delete(g2, j4) {
389
- return this.client.delete(`/repos/${g2}/${j4}`);
420
+ delete(g2, k4, j3) {
421
+ return this.client.delete(`/repos/${g2}/${k4}`, undefined, j3);
390
422
  }
391
- async update(g2, j4, k2) {
392
- let v2 = await this.client.patch(`/repos/${g2}/${j4}`, k2);
393
- return J(v2);
423
+ async update(g2, k4, j3, q2) {
424
+ let z2 = await this.client.patch(`/repos/${g2}/${k4}`, j3, q2);
425
+ return J(z2);
394
426
  }
395
- compare(g2, j4, k2) {
396
- return this.client.get(`/repos/${g2}/${j4}/compare/${k2}`);
427
+ compare(g2, k4, j3, q2) {
428
+ return this.client.get(`/repos/${g2}/${k4}/compare/${j3}`, q2);
397
429
  }
398
- getLanguages(g2, j4) {
399
- return this.client.get(`/repos/${g2}/${j4}/languages`);
430
+ getLanguages(g2, k4, j3) {
431
+ return this.client.get(`/repos/${g2}/${k4}/languages`, j3);
400
432
  }
401
- async listForAuthenticatedUser() {
402
- return (await this.client.get("/user/repos")).map((j4) => J(j4));
433
+ async listForAuthenticatedUser(g2) {
434
+ return (await this.client.get("/user/repos", g2)).map((j3) => J(j3));
403
435
  }
404
- async create(g2) {
405
- let j4 = await this.client.post("/user/repos", g2);
406
- return J(j4);
436
+ async create(g2, k4) {
437
+ let j3 = await this.client.post("/user/repos", g2, k4);
438
+ return J(j3);
407
439
  }
408
440
  }
409
441
 
410
442
  // ../sdk/dist/api/collaborators.js
411
- class h {
443
+ class j3 {
412
444
  client;
413
445
  constructor(d) {
414
446
  this.client = d;
415
447
  }
416
- list(d, f2) {
417
- return this.client.get(`/repos/${d}/${f2}/collaborators`);
448
+ list(d, f, g2) {
449
+ return this.client.get(`/repos/${d}/${f}/collaborators`, g2);
418
450
  }
419
- add(d, f2, g2) {
420
- return this.client.put(`/repos/${d}/${f2}/collaborators/${g2}`, {});
451
+ add(d, f, g2, h) {
452
+ return this.client.put(`/repos/${d}/${f}/collaborators/${g2}`, {}, h);
421
453
  }
422
454
  }
423
455
 
424
456
  // ../sdk/dist/api/contents.js
425
- class j4 {
457
+ class k4 {
426
458
  client;
427
459
  constructor(b) {
428
460
  this.client = b;
429
461
  }
430
- get(b, d, f2) {
431
- return this.client.get(`/repos/${b}/${d}/contents/${f2}`);
462
+ get(b, d, f, g2) {
463
+ return this.client.get(`/repos/${b}/${d}/contents/${f}`, g2);
432
464
  }
433
- createFile(b, d, f2, g2) {
434
- return this.client.put(`/repos/${b}/${d}/contents/${f2}`, g2);
465
+ createFile(b, d, f, g2, j4) {
466
+ return this.client.put(`/repos/${b}/${d}/contents/${f}`, g2, j4);
435
467
  }
436
- updateFile(b, d, f2, g2) {
437
- return this.client.put(`/repos/${b}/${d}/contents/${f2}`, g2);
468
+ updateFile(b, d, f, g2, j4) {
469
+ return this.client.put(`/repos/${b}/${d}/contents/${f}`, g2, j4);
438
470
  }
439
- deleteFile(b, d, f2, g2) {
440
- return this.client.delete(`/repos/${b}/${d}/contents/${f2}`, g2);
471
+ deleteFile(b, d, f, g2, j4) {
472
+ return this.client.delete(`/repos/${b}/${d}/contents/${f}`, g2, j4);
441
473
  }
442
474
  }
443
475
 
444
476
  // ../sdk/dist/api/teams.js
445
- class j5 {
477
+ class k5 {
446
478
  client;
447
479
  constructor(b) {
448
480
  this.client = b;
449
481
  }
450
- list(b) {
451
- return this.client.get(`/orgs/${b}/teams`);
482
+ list(b, d) {
483
+ return this.client.get(`/orgs/${b}/teams`, d);
452
484
  }
453
- getInvitations(b, d) {
454
- return this.client.get(`/orgs/${b}/teams/${d}/invitations`);
485
+ getInvitations(b, d, f) {
486
+ return this.client.get(`/orgs/${b}/teams/${d}/invitations`, f);
455
487
  }
456
- getMembers(b, d) {
457
- return this.client.get(`/orgs/${b}/teams/${d}/members`);
488
+ getMembers(b, d, f) {
489
+ return this.client.get(`/orgs/${b}/teams/${d}/members`, f);
458
490
  }
459
- addRepository(b, d, f2, h2) {
460
- return this.client.put(`/orgs/${b}/teams/${d}/repos/${f2}/${h2}`, {});
491
+ addRepository(b, d, f, h, j4) {
492
+ return this.client.put(`/orgs/${b}/teams/${d}/repos/${f}/${h}`, {}, j4);
461
493
  }
462
494
  }
463
495
 
464
496
  // ../sdk/dist/api/git.js
465
- class g2 {
497
+ class j4 {
466
498
  client;
467
499
  constructor(b) {
468
500
  this.client = b;
469
501
  }
470
- createRef(b, d, f2) {
471
- return this.client.post(`/repos/${b}/${d}/git/refs`, f2);
502
+ createRef(b, d, f, g2) {
503
+ return this.client.post(`/repos/${b}/${d}/git/refs`, f, g2);
472
504
  }
473
- createTree(b, d, f2) {
474
- return this.client.post(`/repos/${b}/${d}/git/trees`, f2);
505
+ createTree(b, d, f, g2) {
506
+ return this.client.post(`/repos/${b}/${d}/git/trees`, f, g2);
475
507
  }
476
- getTree(b, d, f2) {
477
- return this.client.get(`/repos/${b}/${d}/git/trees/${f2}`);
508
+ getTree(b, d, f, g2) {
509
+ return this.client.get(`/repos/${b}/${d}/git/trees/${f}`, g2);
478
510
  }
479
511
  }
480
512
 
481
513
  // ../sdk/dist/api/releases.js
482
- class k2 {
514
+ class q2 {
483
515
  client;
484
516
  constructor(b) {
485
517
  this.client = b;
486
518
  }
487
- list(b, f2) {
488
- return this.client.get(`/repos/${b}/${f2}/releases`);
519
+ list(b, f, h) {
520
+ return this.client.get(`/repos/${b}/${f}/releases`, h);
489
521
  }
490
- create(b, f2, h2) {
491
- return this.client.post(`/repos/${b}/${f2}/releases`, h2);
522
+ create(b, f, h, j5) {
523
+ return this.client.post(`/repos/${b}/${f}/releases`, h, j5);
492
524
  }
493
- getByTag(b, f2, h2) {
494
- return this.client.get(`/repos/${b}/${f2}/releases/tags/${h2}`);
525
+ getByTag(b, f, h, j5) {
526
+ return this.client.get(`/repos/${b}/${f}/releases/tags/${h}`, j5);
495
527
  }
496
- deleteByTag(b, f2, h2) {
497
- return this.client.delete(`/repos/${b}/${f2}/releases/tags/${h2}`);
528
+ deleteByTag(b, f, h, j5) {
529
+ return this.client.delete(`/repos/${b}/${f}/releases/tags/${h}`, undefined, j5);
498
530
  }
499
- get(b, f2, h2) {
500
- return this.client.get(`/repos/${b}/${f2}/releases/${h2}`);
531
+ get(b, f, h, j5) {
532
+ return this.client.get(`/repos/${b}/${f}/releases/${h}`, j5);
501
533
  }
502
- delete(b, f2, h2) {
503
- return this.client.delete(`/repos/${b}/${f2}/releases/${h2}`);
534
+ delete(b, f, h, j5) {
535
+ return this.client.delete(`/repos/${b}/${f}/releases/${h}`, undefined, j5);
504
536
  }
505
- update(b, f2, h2, j6) {
506
- return this.client.patch(`/repos/${b}/${f2}/releases/${h2}`, j6);
537
+ update(b, f, h, j5, k6) {
538
+ return this.client.patch(`/repos/${b}/${f}/releases/${h}`, j5, k6);
507
539
  }
508
- getAssets(b, f2, h2) {
509
- return this.client.get(`/repos/${b}/${f2}/releases/${h2}/assets`);
540
+ getAssets(b, f, h, j5) {
541
+ return this.client.get(`/repos/${b}/${f}/releases/${h}/assets`, j5);
510
542
  }
511
- uploadAsset(b, f2, h2, j6) {
512
- return this.client.post(`/repos/${b}/${f2}/releases/${h2}/assets`, j6);
543
+ uploadAsset(b, f, h, j5, k6) {
544
+ return this.client.post(`/repos/${b}/${f}/releases/${h}/assets`, j5, k6);
513
545
  }
514
- deleteAsset(b, f2, h2, j6) {
515
- return this.client.delete(`/repos/${b}/${f2}/releases/${h2}/assets/${j6}`);
546
+ deleteAsset(b, f, h, j5, k6) {
547
+ return this.client.delete(`/repos/${b}/${f}/releases/${h}/assets/${j5}`, undefined, k6);
516
548
  }
517
549
  }
518
550
 
519
551
  // ../sdk/dist/api/pulls.js
520
- class v2 {
552
+ class y {
521
553
  client;
522
554
  constructor(d) {
523
555
  this.client = d;
524
556
  }
525
- create(d, g3, f2) {
526
- return this.client.post(`/repos/${d}/${g3}/pulls`, f2);
557
+ create(d, f, g2, j5) {
558
+ return this.client.post(`/repos/${d}/${f}/pulls`, g2, j5);
527
559
  }
528
- get(d, g3, f2) {
529
- return this.client.get(`/repos/${d}/${g3}/pulls/${f2}`);
560
+ get(d, f, g2, j5) {
561
+ return this.client.get(`/repos/${d}/${f}/pulls/${g2}`, j5);
530
562
  }
531
- list(d, g3, f2) {
532
- let k3 = new URL(`/repos/${d}/${g3}/pulls`, "http://localhost");
533
- if (f2)
534
- k3.searchParams.set("state", f2);
535
- return this.client.get(k3.href.replace("http://localhost", ""));
563
+ list(d, f, g2, j5) {
564
+ let x2 = new URLSearchParams(Object.entries(g2 ?? {})), q3 = new URL(`/repos/${d}/${f}/pulls`, "http://localhost");
565
+ return q3.search = x2.toString(), this.client.get(q3.href.replace("http://localhost", ""), j5);
536
566
  }
537
- update(d, g3, f2, j6) {
538
- return this.client.patch(`/repos/${d}/${g3}/pulls/${f2}`, j6);
567
+ update(d, f, g2, j5, k6) {
568
+ return this.client.patch(`/repos/${d}/${f}/pulls/${g2}`, j5, k6);
539
569
  }
540
- getFiles(d, g3, f2) {
541
- return this.client.get(`/repos/${d}/${g3}/pulls/${f2}/files`);
570
+ getFiles(d, f, g2, j5) {
571
+ return this.client.get(`/repos/${d}/${f}/pulls/${g2}/files`, j5);
542
572
  }
543
- updateBranch(d, g3, f2) {
544
- return this.client.put(`/repos/${d}/${g3}/pulls/${f2}/update-branch`, {});
573
+ updateBranch(d, f, g2, j5) {
574
+ return this.client.put(`/repos/${d}/${f}/pulls/${g2}/update-branch`, {}, j5);
545
575
  }
546
- getCommits(d, g3, f2) {
547
- return this.client.get(`/repos/${d}/${g3}/pulls/${f2}/commits`);
576
+ getCommits(d, f, g2, j5) {
577
+ return this.client.get(`/repos/${d}/${f}/pulls/${g2}/commits`, j5);
548
578
  }
549
- async checkIfMerged(d, g3, f2) {
579
+ async checkIfMerged(d, f, g2, j5) {
550
580
  try {
551
- return await this.client.get(`/repos/${d}/${g3}/pulls/${f2}/merge`), true;
552
- } catch (j6) {
553
- if (j6 instanceof j2 && j6.status === 404)
581
+ return await this.client.get(`/repos/${d}/${f}/pulls/${g2}/merge`, j5), true;
582
+ } catch (k6) {
583
+ if (k6 instanceof j2 && k6.status === 404)
554
584
  return false;
555
- throw j6;
585
+ throw k6;
556
586
  }
557
587
  }
558
588
  }
559
589
 
560
590
  // ../sdk/dist/api/forks.js
561
- class k3 {
591
+ class q3 {
562
592
  client;
563
593
  constructor(b) {
564
594
  this.client = b;
565
595
  }
566
- async create(b, g3, h2) {
567
- let j6 = await this.client.post(`/repos/${b}/${g3}/forks`, h2);
568
- return J(j6);
596
+ async create(b, g2, h, j5) {
597
+ let k6 = await this.client.post(`/repos/${b}/${g2}/forks`, h, j5);
598
+ return J(k6);
569
599
  }
570
600
  }
571
601
 
572
602
  // ../sdk/dist/client.js
573
603
  var F = { DELETE: "DELETE", GET: "GET", PATCH: "PATCH", POST: "POST", PUT: "PUT" };
574
604
 
575
- class Y {
605
+ class _ {
576
606
  baseUrl;
577
607
  token;
578
608
  apiVersion;
579
609
  onApiVersionWarning;
580
- constructor(j6 = {}) {
581
- this.baseUrl = j6.baseUrl || "https://api.gitverse.ru", this.token = j6.token, this.apiVersion = j6.apiVersion || "1";
610
+ constructor(j5 = {}) {
611
+ this.baseUrl = j5.baseUrl || "https://api.gitverse.ru", this.token = j5.token, this.apiVersion = j5.apiVersion || "1";
582
612
  }
583
- setToken(j6) {
584
- this.token = j6;
613
+ setToken(j5) {
614
+ this.token = j5;
585
615
  }
586
- extractRateLimitInfo(j6) {
587
- 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");
588
- if (!(q2 && x && z3 && B))
616
+ extractRateLimitInfo(j5) {
617
+ 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");
618
+ if (!(x2 && q4 && z2 && B2))
589
619
  return;
590
- return { limit: Number.parseInt(q2, 10), remaining: Number.parseInt(x, 10), reset: Number.parseInt(B, 10), retryAfter: Number.parseInt(z3, 10) };
620
+ return { limit: Number.parseInt(x2, 10), remaining: Number.parseInt(q4, 10), reset: Number.parseInt(B2, 10), retryAfter: Number.parseInt(z2, 10) };
591
621
  }
592
- extractApiVersionInfo(j6) {
593
- 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");
594
- if (!(q2 && x))
622
+ extractApiVersionInfo(j5) {
623
+ 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");
624
+ if (!(x2 && q4))
595
625
  return;
596
- return { decommissioning: B || undefined, deprecated: z3, latestVersion: x, version: q2 };
626
+ return { decommissioning: B2 || undefined, deprecated: z2, latestVersion: q4, version: x2 };
597
627
  }
598
- extractMetadata(j6) {
599
- let q2 = this.extractRateLimitInfo(j6), x = this.extractApiVersionInfo(j6);
600
- if (x?.deprecated && this.onApiVersionWarning) {
601
- let z3 = new q(x.version, x.latestVersion, x.decommissioning);
602
- this.onApiVersionWarning(z3);
628
+ extractMetadata(j5) {
629
+ let x2 = this.extractRateLimitInfo(j5), q4 = this.extractApiVersionInfo(j5);
630
+ if (q4?.deprecated && this.onApiVersionWarning) {
631
+ let z2 = new q(q4.version, q4.latestVersion, q4.decommissioning);
632
+ this.onApiVersionWarning(z2);
603
633
  }
604
- return { apiVersion: x, rateLimit: q2 };
634
+ return { apiVersion: q4, rateLimit: x2 };
605
635
  }
606
- async request(j6, q2, x) {
607
- let z3 = j6.startsWith("/") ? j6.slice(1) : j6, B = `${this.baseUrl}/${z3}`, J2 = new Headers;
636
+ async request(j5, x2, q4, z2) {
637
+ let B2 = j5.startsWith("/") ? j5.slice(1) : j5, Y = `${this.baseUrl}/${B2}`, J2 = new Headers;
608
638
  if (J2.set("Content-Type", "application/json"), J2.set("Accept", `application/vnd.gitverse.object+json; version=${this.apiVersion}`), this.token)
609
639
  J2.set("Authorization", `Bearer ${this.token}`);
610
- let X = { body: x ? JSON.stringify(x) : undefined, headers: J2, method: q2 }, D = await fetch(B, X), K = this.extractMetadata(D.headers), N;
640
+ 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;
611
641
  try {
612
642
  N = await D.json();
613
643
  } catch {
614
644
  N = undefined;
615
645
  }
616
646
  if (!D.ok) {
617
- let O = N?.message || D.statusText;
647
+ let Q = N?.message || D.statusText;
618
648
  if (D.status === 429 && K.rateLimit)
619
- throw new k(O || "Превышен лимит запросов. Попробуйте позже.", K.rateLimit, K);
620
- throw new j2(D.status, O, K);
649
+ throw new k2(Q || "Превышен лимит запросов. Попробуйте позже.", K.rateLimit, K);
650
+ throw new j2(D.status, Q, K);
621
651
  }
622
652
  return N;
623
653
  }
624
- get(j6) {
625
- return this.request(j6, F.GET);
654
+ get(j5, x2) {
655
+ return this.request(j5, F.GET, undefined, x2);
626
656
  }
627
- post(j6, q2) {
628
- return this.request(j6, F.POST, q2);
657
+ post(j5, x2, q4) {
658
+ return this.request(j5, F.POST, x2, q4);
629
659
  }
630
- put(j6, q2) {
631
- return this.request(j6, F.PUT, q2);
660
+ put(j5, x2, q4) {
661
+ return this.request(j5, F.PUT, x2, q4);
632
662
  }
633
- delete(j6, q2) {
634
- return this.request(j6, F.DELETE, q2);
663
+ delete(j5, x2, q4) {
664
+ return this.request(j5, F.DELETE, x2, q4);
635
665
  }
636
- patch(j6, q2) {
637
- return this.request(j6, F.PATCH, q2);
666
+ patch(j5, x2, q4) {
667
+ return this.request(j5, F.PATCH, x2, q4);
638
668
  }
639
669
  }
640
670
 
641
671
  // ../sdk/dist/api/users.js
642
- class d {
672
+ class f {
643
673
  client;
644
674
  constructor(b) {
645
675
  this.client = b;
646
676
  }
647
- getCurrent() {
648
- return this.client.get("/user");
677
+ getCurrent(b) {
678
+ return this.client.get("/user", b);
649
679
  }
650
- getByUsername(b) {
651
- return this.client.get(`/users/${b}`);
680
+ getByUsername(b, d) {
681
+ return this.client.get(`/users/${b}`, d);
652
682
  }
653
683
  }
654
684
 
655
685
  // ../sdk/dist/api/emails.js
656
- class c {
686
+ class d {
657
687
  client;
658
688
  constructor(b) {
659
689
  this.client = b;
660
690
  }
661
- list() {
662
- return this.client.get("/user/emails");
691
+ list(b) {
692
+ return this.client.get("/user/emails", b);
663
693
  }
664
- add(b) {
665
- return this.client.post("/user/emails", b);
694
+ add(b, c) {
695
+ return this.client.post("/user/emails", b, c);
666
696
  }
667
- remove(b) {
668
- return this.client.delete("/user/emails", b);
697
+ remove(b, c) {
698
+ return this.client.delete("/user/emails", b, c);
669
699
  }
670
700
  }
671
701
 
672
702
  // ../sdk/dist/index.js
673
- class P {
703
+ class Z {
674
704
  client;
675
705
  users;
676
706
  repos;
@@ -689,7 +719,7 @@ class P {
689
719
  git;
690
720
  actions;
691
721
  constructor(d2 = {}) {
692
- 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);
722
+ 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);
693
723
  }
694
724
  setToken(d2) {
695
725
  return this.client.setToken(d2), this;
@@ -700,24 +730,32 @@ class P {
700
730
  class GitVerseReleaseClient {
701
731
  client;
702
732
  repoInfo;
703
- constructor(token, repoInfo) {
704
- this.client = new P({ token });
733
+ retryFn;
734
+ constructor(token, repoInfo, retryFn) {
735
+ this.client = new Z({ token });
705
736
  this.repoInfo = repoInfo;
737
+ this.retryFn = retryFn;
706
738
  }
707
739
  async createRelease(tag, name, body, options = {}) {
708
740
  const { owner, repo } = this.repoInfo;
709
- try {
710
- await this.client.releases.create(owner, repo, {
711
- body,
712
- draft: options.draft,
713
- name,
714
- prerelease: options.prerelease,
715
- tag_name: tag
716
- });
717
- return `${this.repoInfo.url}/releases/tag/${tag}`;
718
- } catch (error) {
719
- throw new Error(`Failed to create GitVerse release: ${error instanceof Error ? error.message : String(error)}`);
741
+ const createFn = async () => {
742
+ try {
743
+ await this.client.releases.create(owner, repo, {
744
+ body,
745
+ draft: options.draft,
746
+ name,
747
+ prerelease: options.prerelease,
748
+ tag_name: tag
749
+ });
750
+ return `${this.repoInfo.url}/releases/tag/${tag}`;
751
+ } catch (error) {
752
+ throw new Error(`Failed to create GitVerse release: ${error instanceof Error ? error.message : String(error)}`);
753
+ }
754
+ };
755
+ if (this.retryFn) {
756
+ return await this.retryFn(createFn, "Create GitVerse Release");
720
757
  }
758
+ return await createFn();
721
759
  }
722
760
  async releaseExists(tag) {
723
761
  const { owner, repo } = this.repoInfo;
@@ -733,12 +771,12 @@ class GitVerseReleaseClient {
733
771
  return await this.client.releases.getByTag(owner, repo, tag);
734
772
  }
735
773
  }
736
- function createGitVerseClient(repoInfo) {
774
+ function createGitVerseClient(repoInfo, retryFn) {
737
775
  const token = process.env.GITVERSE_TOKEN;
738
776
  if (!token) {
739
777
  throw new Error("GITVERSE_TOKEN environment variable is required for creating releases");
740
778
  }
741
- return new GitVerseReleaseClient(token, repoInfo);
779
+ return new GitVerseReleaseClient(token, repoInfo, retryFn);
742
780
  }
743
781
 
744
782
  // src/utils/changelog.ts
@@ -815,7 +853,7 @@ function hasFixes(commits) {
815
853
  }
816
854
 
817
855
  // src/utils/changelog.ts
818
- function generateChangelog(options, config) {
856
+ function generateChangelog(options, config, packageName) {
819
857
  const { version, commits, date = new Date, repoUrl } = options;
820
858
  const sections = [];
821
859
  const dateStr = date.toISOString().split("T")[0];
@@ -823,17 +861,17 @@ function generateChangelog(options, config) {
823
861
  sections.push("");
824
862
  const grouped = groupCommitsByType(commits);
825
863
  const typeOrder = ["feat", "fix", "perf", "refactor", "docs", "test", "build", "ci", "chore", "style", "revert"];
826
- const breakingCommits = commits.filter((c2) => c2.breaking);
864
+ const breakingCommits = commits.filter((c) => c.breaking);
827
865
  if (breakingCommits.length > 0) {
828
866
  sections.push("### ⚠️ BREAKING CHANGES");
829
867
  sections.push("");
830
868
  for (const commit of breakingCommits) {
831
- sections.push(formatCommit(commit, config, repoUrl));
869
+ sections.push(formatCommit(commit, config, repoUrl, packageName));
832
870
  }
833
871
  sections.push("");
834
872
  }
835
873
  for (const type of typeOrder) {
836
- const typeCommits = grouped[type]?.filter((c2) => !c2.breaking);
874
+ const typeCommits = grouped[type]?.filter((c) => !c.breaking);
837
875
  if (!typeCommits || typeCommits.length === 0) {
838
876
  continue;
839
877
  }
@@ -841,17 +879,17 @@ function generateChangelog(options, config) {
841
879
  sections.push(`### ${title}`);
842
880
  sections.push("");
843
881
  for (const commit of typeCommits) {
844
- sections.push(formatCommit(commit, config, repoUrl));
882
+ sections.push(formatCommit(commit, config, repoUrl, packageName));
845
883
  }
846
884
  sections.push("");
847
885
  }
848
886
  return sections.join(`
849
887
  `);
850
888
  }
851
- function formatCommit(commit, config, repoUrl) {
889
+ function formatCommit(commit, config, repoUrl, packageName) {
852
890
  const parts = [];
853
891
  let message = commit.subject;
854
- if (commit.scope) {
892
+ if (commit.scope && commit.scope !== packageName) {
855
893
  message = `**${commit.scope}:** ${message}`;
856
894
  }
857
895
  parts.push(`- ${message}`);
@@ -901,18 +939,18 @@ All notable changes to this project will be documented in this file.
901
939
  await writeFile(changelogPath, lines.join(`
902
940
  `));
903
941
  }
904
- function generateReleaseNotes(commits, config, repoUrl) {
942
+ function generateReleaseNotes(commits, config, repoUrl, packageName) {
905
943
  const sections = [];
906
- const breakingCommits = commits.filter((c2) => c2.breaking);
944
+ const breakingCommits = commits.filter((c) => c.breaking);
907
945
  if (breakingCommits.length > 0) {
908
946
  sections.push("⚠️ BREAKING CHANGES");
909
947
  sections.push("");
910
948
  for (const commit of breakingCommits) {
911
- sections.push(formatCommit(commit, config, repoUrl));
949
+ sections.push(formatCommit(commit, config, repoUrl, packageName));
912
950
  }
913
951
  sections.push("");
914
952
  }
915
- const grouped = groupCommitsByType(commits.filter((c2) => !c2.breaking));
953
+ const grouped = groupCommitsByType(commits.filter((c) => !c.breaking));
916
954
  const typeOrder = ["feat", "fix", "perf", "refactor", "docs", "test", "build", "ci", "chore", "style", "revert"];
917
955
  for (const type of typeOrder) {
918
956
  const typeCommits = grouped[type];
@@ -923,7 +961,7 @@ function generateReleaseNotes(commits, config, repoUrl) {
923
961
  sections.push(title);
924
962
  sections.push("");
925
963
  for (const commit of typeCommits) {
926
- sections.push(formatCommit(commit, config, repoUrl));
964
+ sections.push(formatCommit(commit, config, repoUrl, packageName));
927
965
  }
928
966
  sections.push("");
929
967
  }
@@ -935,6 +973,27 @@ function generateReleaseNotes(commits, config, repoUrl) {
935
973
  import { exec } from "node:child_process";
936
974
  import { promisify } from "node:util";
937
975
  var execAsync = promisify(exec);
976
+ async function executeCommand(command) {
977
+ const { stdout, stderr } = await execAsync(command);
978
+ if (stderr && !stderr.includes("warning")) {
979
+ console.warn(`Command stderr: ${stderr}`);
980
+ }
981
+ return stdout.trim();
982
+ }
983
+ async function runBeforeCommitHook(command) {
984
+ console.log(`
985
+ \uD83D\uDD27 Running before-commit hook: ${command}`);
986
+ try {
987
+ await executeCommand(command);
988
+ console.log(`✅ Before-commit hook completed successfully
989
+ `);
990
+ return true;
991
+ } catch (error) {
992
+ console.warn(`⚠️ Before-commit hook failed: ${error instanceof Error ? error.message : String(error)}
993
+ `);
994
+ return false;
995
+ }
996
+ }
938
997
  var GITVERSE_URL_REGEX_1 = /gitverse\.ru[:/]([^/]+)\/([^/.]+)(\.git)?$/;
939
998
  var GITVERSE_URL_REGEX_2 = /gitverse\.ru\/([^/]+)\/([^/.]+)(\.git)?$/;
940
999
  async function git(command) {
@@ -1055,11 +1114,36 @@ async function pushChanges(tag) {
1055
1114
  async function isWorkingTreeClean() {
1056
1115
  try {
1057
1116
  const status = await git("status --porcelain");
1058
- return status.length === 0;
1117
+ if (status.length === 0) {
1118
+ return true;
1119
+ }
1120
+ const lines = status.split(`
1121
+ `).filter((line) => line.length > 0);
1122
+ const unstagedChanges = lines.filter((line) => {
1123
+ const workingTreeStatus = line[1];
1124
+ return workingTreeStatus !== " ";
1125
+ });
1126
+ if (unstagedChanges.length > 0) {
1127
+ console.log(`
1128
+ ⚠️ Unstaged changes detected:`);
1129
+ for (const line of unstagedChanges) {
1130
+ console.log(` ${line}`);
1131
+ }
1132
+ console.log("");
1133
+ return false;
1134
+ }
1135
+ console.log("✓ Working tree clean (staged changes will be included in release commit)");
1136
+ return true;
1059
1137
  } catch {
1060
1138
  return false;
1061
1139
  }
1062
1140
  }
1141
+ async function addChangedFiles() {
1142
+ console.log("\uD83D\uDCE5 Adding changed files to staging area...");
1143
+ await git("add -A");
1144
+ console.log(`✅ Files added to staging area
1145
+ `);
1146
+ }
1063
1147
  async function tagExists(tag) {
1064
1148
  try {
1065
1149
  await git(`rev-parse "${tag}"`);
@@ -1069,12 +1153,77 @@ async function tagExists(tag) {
1069
1153
  }
1070
1154
  }
1071
1155
 
1156
+ // src/utils/retry.ts
1157
+ function sleep(ms) {
1158
+ return new Promise((resolve2) => setTimeout(resolve2, ms));
1159
+ }
1160
+ function calculateDelay(attempt, initialDelay, maxDelay) {
1161
+ const delay = initialDelay * 2 ** attempt;
1162
+ return Math.min(delay, maxDelay);
1163
+ }
1164
+ function isRetriableError(error) {
1165
+ if (!(error instanceof Error)) {
1166
+ return false;
1167
+ }
1168
+ const message = error.message.toLowerCase();
1169
+ if (message.includes("network") || message.includes("timeout") || message.includes("econnreset")) {
1170
+ return true;
1171
+ }
1172
+ if (message.includes("500") || message.includes("502") || message.includes("503") || message.includes("504")) {
1173
+ return true;
1174
+ }
1175
+ if (message.includes("rate limit") || message.includes("429")) {
1176
+ return true;
1177
+ }
1178
+ return false;
1179
+ }
1180
+ async function retry(fn, options) {
1181
+ const { maxAttempts, initialDelay, maxDelay, operationName = "Operation" } = options;
1182
+ let lastError;
1183
+ for (let attempt = 0;attempt < maxAttempts; attempt++) {
1184
+ try {
1185
+ return await fn();
1186
+ } catch (error) {
1187
+ lastError = error instanceof Error ? error : new Error(String(error));
1188
+ const canRetry = isRetriableError(error);
1189
+ if (attempt === maxAttempts - 1 || !canRetry) {
1190
+ if (!canRetry && attempt < maxAttempts - 1) {
1191
+ console.error(`
1192
+ ❌ ${operationName} failed with non-retriable error:`);
1193
+ console.error(lastError.message);
1194
+ }
1195
+ throw lastError;
1196
+ }
1197
+ const delay = calculateDelay(attempt, initialDelay, maxDelay);
1198
+ console.warn(`
1199
+ ⚠️ ${operationName} failed (attempt ${attempt + 1}/${maxAttempts}):`);
1200
+ console.warn(` ${lastError.message}`);
1201
+ console.warn(` Retrying in ${delay}ms...`);
1202
+ await sleep(delay);
1203
+ }
1204
+ }
1205
+ throw lastError || new Error(`${operationName} failed after ${maxAttempts} attempts`);
1206
+ }
1207
+ function createRetryFunction(config) {
1208
+ return async (fn, operationName) => {
1209
+ if (!config.enabled) {
1210
+ return await fn();
1211
+ }
1212
+ return await retry(fn, {
1213
+ initialDelay: config.initialDelay,
1214
+ maxAttempts: config.maxAttempts,
1215
+ maxDelay: config.maxDelay,
1216
+ operationName
1217
+ });
1218
+ };
1219
+ }
1220
+
1072
1221
  // src/utils/version.ts
1073
1222
  var VERSION_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/;
1074
1223
  var PRERELEASE_INCREMENT_REGEX = /^(.+)\.(\d+)$/;
1075
1224
  function parseVersion(version) {
1076
- const v3 = version.startsWith("v") ? version.slice(1) : version;
1077
- const match = v3.match(VERSION_REGEX);
1225
+ const v = version.startsWith("v") ? version.slice(1) : version;
1226
+ const match = v.match(VERSION_REGEX);
1078
1227
  if (!(match?.[1] && match[2] && match[3])) {
1079
1228
  throw new Error(`Invalid version format: ${version}`);
1080
1229
  }
@@ -1240,10 +1389,11 @@ async function collectCommits(pkg, options, warnings) {
1240
1389
  throw new Error(`No commits found since last release for ${pkg.packageName}`);
1241
1390
  }
1242
1391
  const commits = parseCommits(rawCommits);
1243
- if (commits.length === 0 && !options.version) {
1392
+ const filteredCommits = commits.filter((commit) => !commit.scope || commit.scope === pkg.name);
1393
+ if (filteredCommits.length === 0 && !options.version) {
1244
1394
  warnings.push("No conventional commits found, but will proceed with patch bump");
1245
1395
  }
1246
- return commits;
1396
+ return filteredCommits;
1247
1397
  }
1248
1398
  function resolvePrereleaseTag(options, config) {
1249
1399
  if (typeof options.prerelease === "string") {
@@ -1254,20 +1404,24 @@ function resolvePrereleaseTag(options, config) {
1254
1404
  }
1255
1405
  return;
1256
1406
  }
1257
- async function createGitVerseRelease(options, repoInfo, commits, config, pkg, versionBump, tag, warnings) {
1258
- if (options.noRelease) {
1407
+ async function createGitVerseRelease(options, repoInfo, commits, config, pkg, versionBump, tag, retryFn) {
1408
+ if (options.noRelease || !config.gitverse.enabled) {
1259
1409
  return;
1260
1410
  }
1261
- try {
1262
- const gitverseClient = createGitVerseClient(repoInfo);
1263
- const releaseNotes = generateReleaseNotes(commits, config.changelog, repoInfo.url);
1264
- return await gitverseClient.createRelease(tag, `${pkg.packageName} v${versionBump.newVersion}`, releaseNotes, {
1265
- prerelease: !!options.prerelease
1266
- });
1267
- } catch (error) {
1268
- warnings.push(`Failed to create GitVerse release: ${error instanceof Error ? error.message : String(error)}`);
1269
- return;
1411
+ const gitverseClient = createGitVerseClient(repoInfo, retryFn);
1412
+ if (config.gitverse.checkExisting) {
1413
+ const exists = await gitverseClient.releaseExists(tag);
1414
+ if (exists) {
1415
+ console.log(`
1416
+ ✅ Release ${tag} already exists, skipping creation
1417
+ `);
1418
+ return `${repoInfo.url}/releases/tag/${tag}`;
1419
+ }
1270
1420
  }
1421
+ const releaseNotes = generateReleaseNotes(commits, config.changelog, repoInfo.url, pkg.name);
1422
+ return await gitverseClient.createRelease(tag, `${pkg.packageName} v${versionBump.newVersion}`, releaseNotes, {
1423
+ prerelease: !!options.prerelease
1424
+ });
1271
1425
  }
1272
1426
  async function performGitOperations(config, options, pkg, newVersion, tag, changelogPath) {
1273
1427
  if (config.git.commitChanges && !options.noCommit) {
@@ -1297,6 +1451,12 @@ async function release(packageName, options = {}) {
1297
1451
  const repoInfo = await getRepoInfo();
1298
1452
  const pkg = await resolvePackage(config, packageName);
1299
1453
  result.packageName = pkg.packageName;
1454
+ if (!options.dryRun && config.git.beforeCommit) {
1455
+ const hookSuccess = await runBeforeCommitHook(config.git.beforeCommit);
1456
+ if (hookSuccess) {
1457
+ await addChangedFiles();
1458
+ }
1459
+ }
1300
1460
  if (!(options.dryRun || await isWorkingTreeClean())) {
1301
1461
  throw new Error("Working tree is not clean. Please commit or stash your changes.");
1302
1462
  }
@@ -1316,15 +1476,27 @@ async function release(packageName, options = {}) {
1316
1476
  date: new Date,
1317
1477
  repoUrl: repoInfo.url,
1318
1478
  version: versionBump.newVersion
1319
- }, config.changelog);
1479
+ }, config.changelog, pkg.name);
1320
1480
  if (options.dryRun) {
1321
1481
  printDryRunInfo(pkg, currentVersion, versionBump, tag, commits, changelogEntry);
1322
1482
  result.success = true;
1323
1483
  return result;
1324
1484
  }
1485
+ const retryFn = createRetryFunction(config.retry);
1325
1486
  const changelogPath = await updatePackageFiles(pkg, versionBump.newVersion, changelogEntry);
1326
1487
  await performGitOperations(config, options, pkg, versionBump.newVersion, tag, changelogPath);
1327
- result.releaseUrl = await createGitVerseRelease(options, repoInfo, commits, config, pkg, versionBump, tag, result.warnings);
1488
+ try {
1489
+ result.releaseUrl = await createGitVerseRelease(options, repoInfo, commits, config, pkg, versionBump, tag, retryFn);
1490
+ } catch (error) {
1491
+ const errorMessage = error instanceof Error ? error.message : String(error);
1492
+ if (config.gitverse.failOnError) {
1493
+ throw new Error(`GitVerse release creation failed: ${errorMessage}`);
1494
+ }
1495
+ result.warnings.push(`Failed to create GitVerse release: ${errorMessage}`);
1496
+ console.warn(`
1497
+ ⚠️ Warning: ${errorMessage}
1498
+ `);
1499
+ }
1328
1500
  result.success = true;
1329
1501
  printSuccessInfo(pkg, currentVersion, versionBump.newVersion, tag, result.releaseUrl);
1330
1502
  return result;
@@ -1359,11 +1531,66 @@ async function resolvePackage(config, packageName) {
1359
1531
  }
1360
1532
  return pkg;
1361
1533
  }
1534
+ async function createReleaseOnly(tag, packageName, configPath) {
1535
+ const result = {
1536
+ errors: [],
1537
+ newVersion: "",
1538
+ oldVersion: "",
1539
+ packageName: packageName || "unknown",
1540
+ success: false,
1541
+ tag,
1542
+ warnings: []
1543
+ };
1544
+ try {
1545
+ const config = await loadConfig(configPath);
1546
+ validateConfig(config);
1547
+ const repoInfo = await getRepoInfo();
1548
+ const pkg = await resolvePackage(config, packageName);
1549
+ result.packageName = pkg.packageName;
1550
+ const version = tag.replace(pkg.tagPrefix, "");
1551
+ result.newVersion = version;
1552
+ const rawCommits = await getCommitsSinceTag(pkg.tagPrefix, pkg.path);
1553
+ const commits = parseCommits(rawCommits);
1554
+ const retryFn = createRetryFunction(config.retry);
1555
+ const gitverseClient = createGitVerseClient(repoInfo, retryFn);
1556
+ if (config.gitverse.checkExisting) {
1557
+ const exists = await gitverseClient.releaseExists(tag);
1558
+ if (exists) {
1559
+ console.log(`
1560
+ ✅ Release ${tag} already exists
1561
+ `);
1562
+ result.releaseUrl = `${repoInfo.url}/releases/tag/${tag}`;
1563
+ result.success = true;
1564
+ return result;
1565
+ }
1566
+ }
1567
+ const releaseNotes = generateReleaseNotes(commits, config.changelog, repoInfo.url, pkg.name);
1568
+ result.releaseUrl = await gitverseClient.createRelease(tag, `${pkg.packageName} v${version}`, releaseNotes);
1569
+ result.success = true;
1570
+ console.log(`
1571
+ ✅ Release created successfully!`);
1572
+ console.log(`\uD83D\uDCE6 Package: ${pkg.packageName}`);
1573
+ console.log(`\uD83C\uDFF7️ Tag: ${tag}`);
1574
+ console.log(`\uD83C\uDF10 Release: ${result.releaseUrl}
1575
+ `);
1576
+ return result;
1577
+ } catch (error) {
1578
+ result.success = false;
1579
+ result.errors.push(error instanceof Error ? error.message : String(error));
1580
+ console.error(`
1581
+ ❌ Release creation failed:
1582
+ `);
1583
+ console.error(error);
1584
+ console.error("");
1585
+ return result;
1586
+ }
1587
+ }
1362
1588
  export {
1363
1589
  validateConfig,
1364
1590
  release,
1365
1591
  loadConfig,
1592
+ createReleaseOnly,
1366
1593
  createGitVerseClient
1367
1594
  };
1368
1595
 
1369
- //# debugId=A6483C192FAD37AF64756E2164756E21
1596
+ //# debugId=FFEDCCEDE0AB7D8364756E2164756E21