gitverse-release 3.5.0 → 3.6.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
@@ -19,12 +19,52 @@ var __toESM = (mod, isNodeMode, target) => {
19
19
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
20
20
 
21
21
  // src/index.ts
22
- import { resolve as resolve2 } from "node:path";
22
+ import { resolve as resolve4 } from "node:path";
23
23
 
24
24
  // src/config.ts
25
- import { readFile } from "node:fs/promises";
25
+ import { access, readFile, writeFile } from "node:fs/promises";
26
26
  import { resolve } from "node:path";
27
+ import { parse as parseJsonc } from "jsonc-parser";
28
+ var DEFAULT_CONFIG_FILE_NAME = ".gitversereleaserc.jsonc";
29
+ var CONFIG_FILE_NAMES = [".gitversereleaserc.jsonc", ".gitversereleaserc.json"];
30
+ async function fileExists(path) {
31
+ try {
32
+ await access(path);
33
+ return true;
34
+ } catch {
35
+ return false;
36
+ }
37
+ }
38
+ async function findConfigFile(directory) {
39
+ for (const fileName of CONFIG_FILE_NAMES) {
40
+ const fullPath = resolve(directory, fileName);
41
+ if (await fileExists(fullPath)) {
42
+ return fullPath;
43
+ }
44
+ }
45
+ return null;
46
+ }
47
+ var DEFAULT_BINARY_PLATFORMS = [
48
+ "linux-x64",
49
+ "linux-arm64",
50
+ "darwin-x64",
51
+ "darwin-arm64",
52
+ "win32-x64"
53
+ ];
54
+ var DEFAULT_BINARIES_CONFIG = {
55
+ continueOnError: false,
56
+ distDir: "./dist",
57
+ enabled: false,
58
+ mainPackage: "./package.json",
59
+ name: "",
60
+ outDir: "./npm",
61
+ platforms: DEFAULT_BINARY_PLATFORMS,
62
+ publishCommand: "npm publish --access public",
63
+ retryAttempts: 3,
64
+ scope: ""
65
+ };
27
66
  var DEFAULT_CONFIG = {
67
+ binaries: DEFAULT_BINARIES_CONFIG,
28
68
  changelog: {
29
69
  showAuthor: true,
30
70
  showHash: true,
@@ -88,11 +128,18 @@ var DEFAULT_CONFIG = {
88
128
  }
89
129
  };
90
130
  async function loadConfig(configPath) {
91
- const path = configPath || ".gitversereleaserc.json";
92
- const fullPath = resolve(process.cwd(), path);
131
+ let fullPath;
132
+ if (configPath) {
133
+ fullPath = resolve(process.cwd(), configPath);
134
+ } else {
135
+ fullPath = await findConfigFile(process.cwd());
136
+ }
137
+ if (!fullPath) {
138
+ return DEFAULT_CONFIG;
139
+ }
93
140
  try {
94
141
  const content = await readFile(fullPath, "utf-8");
95
- const userConfig = JSON.parse(content);
142
+ const userConfig = parseJsonc(content);
96
143
  return mergeConfig(DEFAULT_CONFIG, userConfig);
97
144
  } catch (error) {
98
145
  if (error instanceof Error && "code" in error && error.code === "ENOENT") {
@@ -103,6 +150,10 @@ async function loadConfig(configPath) {
103
150
  }
104
151
  function mergeConfig(defaults, user) {
105
152
  return {
153
+ binaries: {
154
+ ...defaults.binaries,
155
+ ...user.binaries
156
+ },
106
157
  changelog: {
107
158
  ...defaults.changelog,
108
159
  ...user.changelog,
@@ -147,6 +198,141 @@ function validateConfig(config) {
147
198
  }
148
199
  }
149
200
  }
201
+ var SAFE_NAME_REGEX = /^[a-zA-Z0-9_.-]+$/;
202
+ var SAFE_SCOPE_REGEX = /^@?[a-zA-Z0-9_-]+$/;
203
+ function validateBinariesConfig(config) {
204
+ if (!config.enabled) {
205
+ return;
206
+ }
207
+ if (!config.scope) {
208
+ throw new Error("Binaries config: scope is required when enabled");
209
+ }
210
+ if (!SAFE_SCOPE_REGEX.test(config.scope)) {
211
+ throw new Error(`Binaries config: scope "${config.scope}" contains invalid characters. ` + "Only letters, numbers, underscore, hyphen are allowed.");
212
+ }
213
+ if (!config.name) {
214
+ throw new Error("Binaries config: name is required when enabled");
215
+ }
216
+ if (!SAFE_NAME_REGEX.test(config.name)) {
217
+ throw new Error(`Binaries config: name "${config.name}" contains invalid characters. ` + "Only letters, numbers, underscore, hyphen, dot are allowed.");
218
+ }
219
+ if (!config.platforms || config.platforms.length === 0) {
220
+ throw new Error("Binaries config: at least one platform is required");
221
+ }
222
+ const validPlatforms = [
223
+ "linux-x64",
224
+ "linux-arm64",
225
+ "darwin-x64",
226
+ "darwin-arm64",
227
+ "win32-x64",
228
+ "win32-arm64"
229
+ ];
230
+ for (const platform of config.platforms) {
231
+ if (!validPlatforms.includes(platform)) {
232
+ throw new Error(`Binaries config: invalid platform "${platform}". Valid: ${validPlatforms.join(", ")}`);
233
+ }
234
+ }
235
+ if (config.retryAttempts < 1 || config.retryAttempts > 10) {
236
+ throw new Error("Binaries config: retryAttempts must be between 1 and 10");
237
+ }
238
+ }
239
+ function configExists() {
240
+ return findConfigFile(process.cwd());
241
+ }
242
+ function generateConfigContent(options = {}) {
243
+ const lines = [];
244
+ lines.push("{");
245
+ lines.push(" // JSON Schema для автодополнения и валидации в IDE");
246
+ lines.push(' "$schema": "node_modules/gitverse-release/schema.json",');
247
+ lines.push("");
248
+ lines.push(" // Настройки генерации CHANGELOG");
249
+ lines.push(' "changelog": {');
250
+ lines.push(' "showAuthor": true,');
251
+ lines.push(' "showHash": true,');
252
+ lines.push(' "types": {');
253
+ lines.push(' "feat": "✨ Features",');
254
+ lines.push(' "fix": "\uD83D\uDC1B Bug Fixes",');
255
+ lines.push(' "docs": "\uD83D\uDCDD Documentation",');
256
+ lines.push(' "style": "\uD83D\uDC84 Styles",');
257
+ lines.push(' "refactor": "♻️ Refactoring",');
258
+ lines.push(' "perf": "⚡ Performance",');
259
+ lines.push(' "test": "✅ Tests",');
260
+ lines.push(' "build": "\uD83C\uDFD7️ Build System",');
261
+ lines.push(' "ci": "\uD83D\uDC77 CI/CD",');
262
+ lines.push(' "chore": "\uD83D\uDD27 Chores",');
263
+ lines.push(' "revert": "⏪ Reverts"');
264
+ lines.push(" }");
265
+ lines.push(" },");
266
+ lines.push("");
267
+ const scopes = options.scopes ?? ["deps", "ci", "docs"];
268
+ lines.push(" // Настройки генерации commitlint конфига");
269
+ lines.push(' "commitlint": {');
270
+ lines.push(` "scopes": ${JSON.stringify(scopes)},`);
271
+ lines.push(' "scopeRequired": false,');
272
+ lines.push(' "headerMaxLength": 100');
273
+ lines.push(" },");
274
+ lines.push("");
275
+ lines.push(" // Настройки Git операций");
276
+ lines.push(' "git": {');
277
+ lines.push(' "commitChanges": true,');
278
+ lines.push(' "commitMessage": "chore(release): v{{version}} [skip ci]",');
279
+ lines.push(' "push": true,');
280
+ lines.push(' "tagMessage": "v{{version}}"');
281
+ lines.push(' // beforeCommit: "bun run format" // Раскомментируйте для форматирования перед коммитом');
282
+ lines.push(" },");
283
+ lines.push("");
284
+ lines.push(" // Настройки GitVerse Release API");
285
+ lines.push(" // Требует переменную окружения GITVERSE_TOKEN");
286
+ lines.push(' "gitverse": {');
287
+ lines.push(' "enabled": true,');
288
+ lines.push(' "checkExisting": true,');
289
+ lines.push(' "failOnError": true');
290
+ lines.push(" },");
291
+ lines.push("");
292
+ lines.push(" // Настройки монорепо");
293
+ lines.push(' "monorepo": {');
294
+ lines.push(` "enabled": ${options.monorepo ?? false}`);
295
+ if (options.monorepo) {
296
+ lines.pop();
297
+ lines.push(` "enabled": true,`);
298
+ lines.push(' "packages": [');
299
+ lines.push(" // Пример конфигурации пакета:");
300
+ lines.push(" // {");
301
+ lines.push(' // "name": "sdk",');
302
+ lines.push(' // "path": "packages/sdk",');
303
+ lines.push(' // "packageName": "my-sdk",');
304
+ lines.push(' // "tagPrefix": "v"');
305
+ lines.push(" // }");
306
+ lines.push(" ]");
307
+ }
308
+ lines.push(" },");
309
+ lines.push("");
310
+ lines.push(" // Настройки версионирования");
311
+ lines.push(' "versioning": {');
312
+ lines.push(' "tagPrefix": "v",');
313
+ lines.push(' "prereleasePrefix": "beta"');
314
+ lines.push(" }");
315
+ lines.push("}");
316
+ return lines.join(`
317
+ `);
318
+ }
319
+ async function initConfig(options = {}) {
320
+ const existingConfig = await configExists();
321
+ if (existingConfig) {
322
+ throw new Error(`Config file already exists: ${existingConfig}`);
323
+ }
324
+ const content = generateConfigContent(options);
325
+ const filePath = resolve(process.cwd(), DEFAULT_CONFIG_FILE_NAME);
326
+ if (options.dryRun) {
327
+ console.log(`
328
+ \uD83D\uDD0D Dry-run mode - Would create: ${filePath}
329
+ `);
330
+ console.log(content);
331
+ return filePath;
332
+ }
333
+ await writeFile(filePath, content, "utf-8");
334
+ return filePath;
335
+ }
150
336
 
151
337
  // ../sdk/dist/errors.js
152
338
  class j extends Error {
@@ -277,44 +463,135 @@ class v {
277
463
  }
278
464
  }
279
465
 
280
- // ../sdk/dist/api/repositories.js
466
+ // ../sdk/dist/api/issues.js
281
467
  class E {
282
468
  client;
283
469
  constructor(k2) {
284
470
  this.client = k2;
285
471
  }
286
- get(k2, x, j2) {
287
- return this.client.get(`/repos/${k2}/${x}`, j2);
472
+ list(k2, A, b, f) {
473
+ let j2 = new URLSearchParams;
474
+ if (b?.state !== undefined)
475
+ j2.append("state", b.state);
476
+ if (b?.q !== undefined)
477
+ j2.append("q", b.q);
478
+ if (b?.labels !== undefined)
479
+ j2.append("labels", b.labels);
480
+ if (b?.milestones !== undefined)
481
+ j2.append("milestones", b.milestones);
482
+ if (b?.created_by !== undefined)
483
+ j2.append("created_by", b.created_by);
484
+ if (b?.assigned_by !== undefined)
485
+ j2.append("assigned_by", b.assigned_by);
486
+ if (b?.mentioned_by !== undefined)
487
+ j2.append("mentioned_by", b.mentioned_by);
488
+ if (b?.type !== undefined)
489
+ j2.append("type", b.type);
490
+ if (b?.since !== undefined)
491
+ j2.append("since", b.since);
492
+ if (b?.before !== undefined)
493
+ j2.append("before", b.before);
494
+ if (b?.page !== undefined)
495
+ j2.append("page", String(b.page));
496
+ if (b?.per_page !== undefined)
497
+ j2.append("per_page", String(b.per_page));
498
+ let z = j2.toString(), B = `/repos/${k2}/${A}/issues${z ? `?${z}` : ""}`;
499
+ return this.client.get(B, f);
500
+ }
501
+ getComment(k2, A, b, f) {
502
+ return this.client.get(`/repos/${k2}/${A}/issues/comments/${b}`, f);
503
+ }
504
+ get(k2, A, b, f) {
505
+ return this.client.get(`/repos/${k2}/${A}/issues/${b}`, f);
506
+ }
507
+ listComments(k2, A, b, f, j2) {
508
+ let z = new URLSearchParams;
509
+ if (f?.since !== undefined)
510
+ z.append("since", f.since);
511
+ if (f?.before !== undefined)
512
+ z.append("before", f.before);
513
+ let B = z.toString(), D = `/repos/${k2}/${A}/issues/${b}/comments${B ? `?${B}` : ""}`;
514
+ return this.client.get(D, j2);
515
+ }
516
+ listLabels(k2, A, b, f) {
517
+ return this.client.get(`/repos/${k2}/${A}/issues/${b}/labels`, f);
518
+ }
519
+ listTimeline(k2, A, b, f, j2) {
520
+ let z = new URLSearchParams;
521
+ if (f?.page !== undefined)
522
+ z.append("page", String(f.page));
523
+ if (f?.per_page !== undefined)
524
+ z.append("per_page", String(f.per_page));
525
+ if (f?.since !== undefined)
526
+ z.append("since", f.since);
527
+ if (f?.before !== undefined)
528
+ z.append("before", f.before);
529
+ let B = z.toString(), D = `/repos/${k2}/${A}/issues/${b}/timeline${B ? `?${B}` : ""}`;
530
+ return this.client.get(D, j2);
531
+ }
532
+ }
533
+
534
+ // ../sdk/dist/api/emails.js
535
+ class x {
536
+ client;
537
+ constructor(b) {
538
+ this.client = b;
539
+ }
540
+ list(b, f) {
541
+ let j2 = new URLSearchParams;
542
+ if (b?.page !== undefined)
543
+ j2.append("page", String(b.page));
544
+ if (b?.per_page !== undefined)
545
+ j2.append("per_page", String(b.per_page));
546
+ let k2 = j2.toString(), w = `/user/emails${k2 ? `?${k2}` : ""}`;
547
+ return this.client.get(w, f);
548
+ }
549
+ create(b, f) {
550
+ return this.client.post("/user/emails", b, f);
551
+ }
552
+ delete(b, f) {
553
+ return this.client.delete("/user/emails", b, f);
554
+ }
555
+ }
556
+
557
+ // ../sdk/dist/api/repositories.js
558
+ class E2 {
559
+ client;
560
+ constructor(k2) {
561
+ this.client = k2;
562
+ }
563
+ get(k2, x2, j2) {
564
+ return this.client.get(`/repos/${k2}/${x2}`, j2);
288
565
  }
289
- update(k2, x, j2, v2) {
290
- return this.client.patch(`/repos/${k2}/${x}`, j2, v2);
566
+ update(k2, x2, j2, v2) {
567
+ return this.client.patch(`/repos/${k2}/${x2}`, j2, v2);
291
568
  }
292
- delete(k2, x, j2) {
293
- return this.client.delete(`/repos/${k2}/${x}`, undefined, j2);
569
+ delete(k2, x2, j2) {
570
+ return this.client.delete(`/repos/${k2}/${x2}`, undefined, j2);
294
571
  }
295
- listRepoSecrets(k2, x, j2, v2) {
572
+ listRepoSecrets(k2, x2, j2, v2) {
296
573
  let z = new URLSearchParams;
297
574
  if (j2?.per_page !== undefined)
298
575
  z.append("per_page", j2.per_page);
299
576
  if (j2?.page !== undefined)
300
577
  z.append("page", j2.page);
301
- let A = z.toString(), B = `/repos/${k2}/${x}/actions/secrets${A ? `?${A}` : ""}`;
578
+ let A = z.toString(), B = `/repos/${k2}/${x2}/actions/secrets${A ? `?${A}` : ""}`;
302
579
  return this.client.get(B, v2);
303
580
  }
304
- getRepoSecret(k2, x, j2, v2) {
305
- return this.client.get(`/repos/${k2}/${x}/actions/secrets/${j2}`, v2);
581
+ getRepoSecret(k2, x2, j2, v2) {
582
+ return this.client.get(`/repos/${k2}/${x2}/actions/secrets/${j2}`, v2);
306
583
  }
307
- createOrUpdateRepoSecret(k2, x, j2, v2, z) {
584
+ createOrUpdateRepoSecret(k2, x2, j2, v2, z) {
308
585
  let A = new URLSearchParams;
309
586
  if (v2?.encrypted_value !== undefined)
310
587
  A.append("encrypted_value", v2.encrypted_value);
311
- let B = A.toString(), D = `/repos/${k2}/${x}/actions/secrets/${j2}${B ? `?${B}` : ""}`;
588
+ let B = A.toString(), D = `/repos/${k2}/${x2}/actions/secrets/${j2}${B ? `?${B}` : ""}`;
312
589
  return this.client.put(D, z);
313
590
  }
314
- deleteRepoSecret(k2, x, j2, v2) {
315
- return this.client.delete(`/repos/${k2}/${x}/actions/secrets/${j2}`, undefined, v2);
591
+ deleteRepoSecret(k2, x2, j2, v2) {
592
+ return this.client.delete(`/repos/${k2}/${x2}/actions/secrets/${j2}`, undefined, v2);
316
593
  }
317
- listBranches(k2, x, j2, v2) {
594
+ listBranches(k2, x2, j2, v2) {
318
595
  let z = new URLSearchParams;
319
596
  if (j2?.page !== undefined)
320
597
  z.append("page", String(j2.page));
@@ -322,10 +599,10 @@ class E {
322
599
  z.append("per_page", String(j2.per_page));
323
600
  if (j2?.q !== undefined)
324
601
  z.append("q", j2.q);
325
- let A = z.toString(), B = `/repos/${k2}/${x}/branches${A ? `?${A}` : ""}`;
602
+ let A = z.toString(), B = `/repos/${k2}/${x2}/branches${A ? `?${A}` : ""}`;
326
603
  return this.client.get(B, v2);
327
604
  }
328
- listCollaborators(k2, x, j2, v2) {
605
+ listCollaborators(k2, x2, j2, v2) {
329
606
  let z = new URLSearchParams;
330
607
  if (j2?.affiliation !== undefined)
331
608
  z.append("affiliation", j2.affiliation);
@@ -335,13 +612,13 @@ class E {
335
612
  z.append("page", String(j2.page));
336
613
  if (j2?.per_page !== undefined)
337
614
  z.append("per_page", String(j2.per_page));
338
- let A = z.toString(), B = `/repos/${k2}/${x}/collaborators${A ? `?${A}` : ""}`;
615
+ let A = z.toString(), B = `/repos/${k2}/${x2}/collaborators${A ? `?${A}` : ""}`;
339
616
  return this.client.get(B, v2);
340
617
  }
341
- addCollaborator(k2, x, j2, v2, z) {
342
- return this.client.put(`/repos/${k2}/${x}/collaborators/${j2}`, v2, z);
618
+ addCollaborator(k2, x2, j2, v2, z) {
619
+ return this.client.put(`/repos/${k2}/${x2}/collaborators/${j2}`, v2, z);
343
620
  }
344
- listCommits(k2, x, j2, v2) {
621
+ listCommits(k2, x2, j2, v2) {
345
622
  let z = new URLSearchParams;
346
623
  if (j2?.page !== undefined)
347
624
  z.append("page", String(j2.page));
@@ -361,49 +638,49 @@ class E {
361
638
  z.append("since", j2.since);
362
639
  if (j2?.until !== undefined)
363
640
  z.append("until", j2.until);
364
- let A = z.toString(), B = `/repos/${k2}/${x}/commits${A ? `?${A}` : ""}`;
641
+ let A = z.toString(), B = `/repos/${k2}/${x2}/commits${A ? `?${A}` : ""}`;
365
642
  return this.client.get(B, v2);
366
643
  }
367
- getCommit(k2, x, j2, v2) {
368
- return this.client.get(`/repos/${k2}/${x}/commits/${j2}`, v2);
644
+ getCommit(k2, x2, j2, v2) {
645
+ return this.client.get(`/repos/${k2}/${x2}/commits/${j2}`, v2);
369
646
  }
370
- compareCommits(k2, x, j2, v2, z) {
647
+ compareCommits(k2, x2, j2, v2, z) {
371
648
  let A = new URLSearchParams;
372
649
  if (v2?.page !== undefined)
373
650
  A.append("page", String(v2.page));
374
651
  if (v2?.per_page !== undefined)
375
652
  A.append("per_page", String(v2.per_page));
376
- let B = A.toString(), D = `/repos/${k2}/${x}/compare/${j2}${B ? `?${B}` : ""}`;
653
+ let B = A.toString(), D = `/repos/${k2}/${x2}/compare/${j2}${B ? `?${B}` : ""}`;
377
654
  return this.client.get(D, z);
378
655
  }
379
- getContent(k2, x, j2, v2, z) {
656
+ getContent(k2, x2, j2, v2, z) {
380
657
  let A = new URLSearchParams;
381
658
  if (v2?.ref !== undefined)
382
659
  A.append("ref", v2.ref);
383
660
  if (v2?.scope !== undefined)
384
661
  A.append("scope", v2.scope);
385
- let B = A.toString(), D = `/repos/${k2}/${x}/contents/${j2}${B ? `?${B}` : ""}`;
662
+ let B = A.toString(), D = `/repos/${k2}/${x2}/contents/${j2}${B ? `?${B}` : ""}`;
386
663
  return this.client.get(D, z);
387
664
  }
388
- createOrUpdateFile(k2, x, j2, v2, z) {
389
- return this.client.put(`/repos/${k2}/${x}/contents/${j2}`, v2, z);
665
+ createOrUpdateFile(k2, x2, j2, v2, z) {
666
+ return this.client.put(`/repos/${k2}/${x2}/contents/${j2}`, v2, z);
390
667
  }
391
- deleteFile(k2, x, j2, v2, z) {
392
- return this.client.delete(`/repos/${k2}/${x}/contents/${j2}`, v2, z);
668
+ deleteFile(k2, x2, j2, v2, z) {
669
+ return this.client.delete(`/repos/${k2}/${x2}/contents/${j2}`, v2, z);
393
670
  }
394
- createFork(k2, x, j2, v2) {
395
- return this.client.post(`/repos/${k2}/${x}/forks`, j2, v2);
671
+ createFork(k2, x2, j2, v2) {
672
+ return this.client.post(`/repos/${k2}/${x2}/forks`, j2, v2);
396
673
  }
397
- createCommit(k2, x, j2, v2) {
398
- return this.client.post(`/repos/${k2}/${x}/git/commits`, j2, v2);
674
+ createCommit(k2, x2, j2, v2) {
675
+ return this.client.post(`/repos/${k2}/${x2}/git/commits`, j2, v2);
399
676
  }
400
- createRef(k2, x, j2, v2) {
401
- return this.client.post(`/repos/${k2}/${x}/git/refs`, j2, v2);
677
+ createRef(k2, x2, j2, v2) {
678
+ return this.client.post(`/repos/${k2}/${x2}/git/refs`, j2, v2);
402
679
  }
403
- createTree(k2, x, j2, v2) {
404
- return this.client.post(`/repos/${k2}/${x}/git/trees`, j2, v2);
680
+ createTree(k2, x2, j2, v2) {
681
+ return this.client.post(`/repos/${k2}/${x2}/git/trees`, j2, v2);
405
682
  }
406
- getTree(k2, x, j2, v2, z) {
683
+ getTree(k2, x2, j2, v2, z) {
407
684
  let A = new URLSearchParams;
408
685
  if (v2?.page !== undefined)
409
686
  A.append("page", String(v2.page));
@@ -411,13 +688,13 @@ class E {
411
688
  A.append("per_page", String(v2.per_page));
412
689
  if (v2?.recursive !== undefined)
413
690
  A.append("recursive", String(v2.recursive));
414
- let B = A.toString(), D = `/repos/${k2}/${x}/git/trees/${j2}${B ? `?${B}` : ""}`;
691
+ let B = A.toString(), D = `/repos/${k2}/${x2}/git/trees/${j2}${B ? `?${B}` : ""}`;
415
692
  return this.client.get(D, z);
416
693
  }
417
- listLanguages(k2, x, j2) {
418
- return this.client.get(`/repos/${k2}/${x}/languages`, j2);
694
+ listLanguages(k2, x2, j2) {
695
+ return this.client.get(`/repos/${k2}/${x2}/languages`, j2);
419
696
  }
420
- listPulls(k2, x, j2, v2) {
697
+ listPulls(k2, x2, j2, v2) {
421
698
  let z = new URLSearchParams;
422
699
  if (j2?.state !== undefined)
423
700
  z.append("state", j2.state);
@@ -433,55 +710,55 @@ class E {
433
710
  z.append("page", String(j2.page));
434
711
  if (j2?.per_page !== undefined)
435
712
  z.append("per_page", String(j2.per_page));
436
- let A = z.toString(), B = `/repos/${k2}/${x}/pulls${A ? `?${A}` : ""}`;
713
+ let A = z.toString(), B = `/repos/${k2}/${x2}/pulls${A ? `?${A}` : ""}`;
437
714
  return this.client.get(B, v2);
438
715
  }
439
- getPull(k2, x, j2, v2) {
440
- return this.client.get(`/repos/${k2}/${x}/pulls/${j2}`, v2);
716
+ getPull(k2, x2, j2, v2) {
717
+ return this.client.get(`/repos/${k2}/${x2}/pulls/${j2}`, v2);
441
718
  }
442
- updatePull(k2, x, j2, v2, z) {
443
- return this.client.patch(`/repos/${k2}/${x}/pulls/${j2}`, v2, z);
719
+ updatePull(k2, x2, j2, v2, z) {
720
+ return this.client.patch(`/repos/${k2}/${x2}/pulls/${j2}`, v2, z);
444
721
  }
445
- listForAuthenticatedUser(k2, x) {
722
+ listForAuthenticatedUser(k2, x2) {
446
723
  let j2 = new URLSearchParams;
447
724
  if (k2?.page !== undefined)
448
725
  j2.append("page", String(k2.page));
449
726
  if (k2?.per_page !== undefined)
450
727
  j2.append("per_page", String(k2.per_page));
451
728
  let v2 = j2.toString(), z = `/user/repos${v2 ? `?${v2}` : ""}`;
452
- return this.client.get(z, x);
729
+ return this.client.get(z, x2);
453
730
  }
454
- createForAuthenticatedUser(k2, x) {
455
- return this.client.post("/user/repos", k2, x);
731
+ createForAuthenticatedUser(k2, x2) {
732
+ return this.client.post("/user/repos", k2, x2);
456
733
  }
457
734
  }
458
735
 
459
736
  // ../sdk/dist/api/teams.js
460
- class E2 {
737
+ class E3 {
461
738
  client;
462
- constructor(x) {
463
- this.client = x;
739
+ constructor(x2) {
740
+ this.client = x2;
464
741
  }
465
- list(x, b, j2) {
742
+ list(x2, b, j2) {
466
743
  let B = new URLSearchParams;
467
744
  if (b?.page !== undefined)
468
745
  B.append("page", String(b.page));
469
746
  if (b?.per_page !== undefined)
470
747
  B.append("per_page", String(b.per_page));
471
- let k2 = B.toString(), C = `/orgs/${x}/teams${k2 ? `?${k2}` : ""}`;
748
+ let k2 = B.toString(), C = `/orgs/${x2}/teams${k2 ? `?${k2}` : ""}`;
472
749
  return this.client.get(C, j2);
473
750
  }
474
- listMembers(x, b, j2, B) {
751
+ listMembers(x2, b, j2, B) {
475
752
  let k2 = new URLSearchParams;
476
753
  if (j2?.page !== undefined)
477
754
  k2.append("page", String(j2.page));
478
755
  if (j2?.per_page !== undefined)
479
756
  k2.append("per_page", String(j2.per_page));
480
- let C = k2.toString(), D = `/orgs/${x}/teams/${b}/members${C ? `?${C}` : ""}`;
757
+ let C = k2.toString(), D = `/orgs/${x2}/teams/${b}/members${C ? `?${C}` : ""}`;
481
758
  return this.client.get(D, B);
482
759
  }
483
- updateRepo(x, b, j2, B, k2, C) {
484
- return this.client.put(`/orgs/${x}/teams/${b}/repos/${j2}/${B}`, k2, C);
760
+ updateRepo(x2, b, j2, B, k2, C) {
761
+ return this.client.put(`/orgs/${x2}/teams/${b}/repos/${j2}/${B}`, k2, C);
485
762
  }
486
763
  }
487
764
 
@@ -501,8 +778,8 @@ class G {
501
778
  B.append("draft", String(b.draft));
502
779
  if (b?.pre_release !== undefined)
503
780
  B.append("pre_release", String(b.pre_release));
504
- let C = B.toString(), E3 = `/repos/${k2}/${A}/releases${C ? `?${C}` : ""}`;
505
- return this.client.get(E3, j2);
781
+ let C = B.toString(), E4 = `/repos/${k2}/${A}/releases${C ? `?${C}` : ""}`;
782
+ return this.client.get(E4, j2);
506
783
  }
507
784
  create(k2, A, b, j2) {
508
785
  return this.client.post(`/repos/${k2}/${A}/releases`, b, j2);
@@ -528,14 +805,14 @@ class G {
528
805
  C.append("page", String(j2.page));
529
806
  if (j2?.per_page !== undefined)
530
807
  C.append("per_page", String(j2.per_page));
531
- let E3 = C.toString(), F = `/repos/${k2}/${A}/releases/${b}/assets${E3 ? `?${E3}` : ""}`;
808
+ let E4 = C.toString(), F = `/repos/${k2}/${A}/releases/${b}/assets${E4 ? `?${E4}` : ""}`;
532
809
  return this.client.get(F, B);
533
810
  }
534
811
  uploadAsset(k2, A, b, j2, B) {
535
812
  let C = new URLSearchParams;
536
813
  if (j2?.name !== undefined)
537
814
  C.append("name", j2.name);
538
- let E3 = C.toString(), F = `/repos/${k2}/${A}/releases/${b}/assets${E3 ? `?${E3}` : ""}`;
815
+ let E4 = C.toString(), F = `/repos/${k2}/${A}/releases/${b}/assets${E4 ? `?${E4}` : ""}`;
539
816
  return this.client.post(F, B);
540
817
  }
541
818
  deleteAsset(k2, A, b, j2, B) {
@@ -584,79 +861,79 @@ class F {
584
861
  constructor(w) {
585
862
  this.client = w;
586
863
  }
587
- listOrgSecrets(w, j2, x) {
864
+ listOrgSecrets(w, j2, x2) {
588
865
  let A = new URLSearchParams;
589
866
  if (j2?.per_page !== undefined)
590
867
  A.append("per_page", j2.per_page);
591
868
  if (j2?.page !== undefined)
592
869
  A.append("page", j2.page);
593
870
  let B = A.toString(), D = `/orgs/${w}/actions/secrets${B ? `?${B}` : ""}`;
594
- return this.client.get(D, x);
871
+ return this.client.get(D, x2);
595
872
  }
596
- getOrgSecret(w, j2, x) {
597
- return this.client.get(`/orgs/${w}/actions/secrets/${j2}`, x);
873
+ getOrgSecret(w, j2, x2) {
874
+ return this.client.get(`/orgs/${w}/actions/secrets/${j2}`, x2);
598
875
  }
599
- createOrUpdateOrgSecret(w, j2, x, A) {
876
+ createOrUpdateOrgSecret(w, j2, x2, A) {
600
877
  let B = new URLSearchParams;
601
- if (x?.encrypted_value !== undefined)
602
- B.append("encrypted_value", x.encrypted_value);
603
- let D = B.toString(), E3 = `/orgs/${w}/actions/secrets/${j2}${D ? `?${D}` : ""}`;
604
- return this.client.put(E3, A);
878
+ if (x2?.encrypted_value !== undefined)
879
+ B.append("encrypted_value", x2.encrypted_value);
880
+ let D = B.toString(), E4 = `/orgs/${w}/actions/secrets/${j2}${D ? `?${D}` : ""}`;
881
+ return this.client.put(E4, A);
605
882
  }
606
- deleteOrgSecret(w, j2, x) {
607
- return this.client.delete(`/orgs/${w}/actions/secrets/${j2}`, undefined, x);
883
+ deleteOrgSecret(w, j2, x2) {
884
+ return this.client.delete(`/orgs/${w}/actions/secrets/${j2}`, undefined, x2);
608
885
  }
609
- isMember(w, j2, x) {
610
- return this.client.get(`/orgs/${w}/members/${j2}`, x);
886
+ isMember(w, j2, x2) {
887
+ return this.client.get(`/orgs/${w}/members/${j2}`, x2);
611
888
  }
612
889
  }
613
890
 
614
891
  // ../sdk/dist/api/actions.js
615
892
  class F2 {
616
893
  client;
617
- constructor(x) {
618
- this.client = x;
894
+ constructor(x2) {
895
+ this.client = x2;
619
896
  }
620
- listOrgRunners(x, j2, b) {
897
+ listOrgRunners(x2, j2, b) {
621
898
  let z = new URLSearchParams;
622
899
  if (j2?.page !== undefined)
623
900
  z.append("page", String(j2.page));
624
901
  if (j2?.per_page !== undefined)
625
902
  z.append("per_page", String(j2.per_page));
626
- let A = z.toString(), B = `/orgs/${x}/actions/runners${A ? `?${A}` : ""}`;
903
+ let A = z.toString(), B = `/orgs/${x2}/actions/runners${A ? `?${A}` : ""}`;
627
904
  return this.client.get(B, b);
628
905
  }
629
- createOrgRunnerRegistrationToken(x, j2) {
630
- return this.client.post(`/orgs/${x}/actions/runners/registration-token`, j2);
906
+ createOrgRunnerRegistrationToken(x2, j2) {
907
+ return this.client.post(`/orgs/${x2}/actions/runners/registration-token`, j2);
631
908
  }
632
- getOrgRunner(x, j2, b) {
633
- return this.client.get(`/orgs/${x}/actions/runners/${j2}`, b);
909
+ getOrgRunner(x2, j2, b) {
910
+ return this.client.get(`/orgs/${x2}/actions/runners/${j2}`, b);
634
911
  }
635
- deleteOrgRunner(x, j2, b) {
636
- return this.client.delete(`/orgs/${x}/actions/runners/${j2}`, undefined, b);
912
+ deleteOrgRunner(x2, j2, b) {
913
+ return this.client.delete(`/orgs/${x2}/actions/runners/${j2}`, undefined, b);
637
914
  }
638
- listOrgVariables(x, j2, b) {
915
+ listOrgVariables(x2, j2, b) {
639
916
  let z = new URLSearchParams;
640
917
  if (j2?.per_page !== undefined)
641
918
  z.append("per_page", String(j2.per_page));
642
919
  if (j2?.page !== undefined)
643
920
  z.append("page", String(j2.page));
644
- let A = z.toString(), B = `/orgs/${x}/actions/variables${A ? `?${A}` : ""}`;
921
+ let A = z.toString(), B = `/orgs/${x2}/actions/variables${A ? `?${A}` : ""}`;
645
922
  return this.client.get(B, b);
646
923
  }
647
- createOrgVariable(x, j2, b) {
648
- return this.client.post(`/orgs/${x}/actions/variables`, j2, b);
924
+ createOrgVariable(x2, j2, b) {
925
+ return this.client.post(`/orgs/${x2}/actions/variables`, j2, b);
649
926
  }
650
- getOrgVariable(x, j2, b) {
651
- return this.client.get(`/orgs/${x}/actions/variables/${j2}`, b);
927
+ getOrgVariable(x2, j2, b) {
928
+ return this.client.get(`/orgs/${x2}/actions/variables/${j2}`, b);
652
929
  }
653
- updateOrgVariable(x, j2, b, z) {
654
- return this.client.patch(`/orgs/${x}/actions/variables/${j2}`, b, z);
930
+ updateOrgVariable(x2, j2, b, z) {
931
+ return this.client.patch(`/orgs/${x2}/actions/variables/${j2}`, b, z);
655
932
  }
656
- deleteOrgVariable(x, j2, b) {
657
- return this.client.delete(`/orgs/${x}/actions/variables/${j2}`, undefined, b);
933
+ deleteOrgVariable(x2, j2, b) {
934
+ return this.client.delete(`/orgs/${x2}/actions/variables/${j2}`, undefined, b);
658
935
  }
659
- listArtifacts(x, j2, b, z) {
936
+ listArtifacts(x2, j2, b, z) {
660
937
  let A = new URLSearchParams;
661
938
  if (b?.page !== undefined)
662
939
  A.append("page", String(b.page));
@@ -664,77 +941,80 @@ class F2 {
664
941
  A.append("per_page", String(b.per_page));
665
942
  if (b?.name !== undefined)
666
943
  A.append("name", b.name);
667
- let B = A.toString(), C = `/repos/${x}/${j2}/actions/artifacts${B ? `?${B}` : ""}`;
944
+ let B = A.toString(), C = `/repos/${x2}/${j2}/actions/artifacts${B ? `?${B}` : ""}`;
668
945
  return this.client.get(C, z);
669
946
  }
670
- getArtifact(x, j2, b, z) {
671
- return this.client.get(`/repos/${x}/${j2}/actions/artifacts/${b}`, z);
947
+ getArtifact(x2, j2, b, z) {
948
+ return this.client.get(`/repos/${x2}/${j2}/actions/artifacts/${b}`, z);
672
949
  }
673
- deleteArtifact(x, j2, b, z) {
674
- return this.client.delete(`/repos/${x}/${j2}/actions/artifacts/${b}`, undefined, z);
950
+ deleteArtifact(x2, j2, b, z) {
951
+ return this.client.delete(`/repos/${x2}/${j2}/actions/artifacts/${b}`, undefined, z);
675
952
  }
676
- downloadArtifact(x, j2, b, z) {
677
- return this.client.get(`/repos/${x}/${j2}/actions/artifacts/${b}/zip`, z);
953
+ downloadArtifact(x2, j2, b, z) {
954
+ return this.client.get(`/repos/${x2}/${j2}/actions/artifacts/${b}/zip`, z);
678
955
  }
679
- downloadArtifactRaw(x, j2, b, z) {
680
- return this.client.get(`/repos/${x}/${j2}/actions/artifacts/${b}/zip/raw`, z);
956
+ downloadArtifactRaw(x2, j2, b, z) {
957
+ return this.client.get(`/repos/${x2}/${j2}/actions/artifacts/${b}/zip/raw`, z);
681
958
  }
682
- listRepoRunners(x, j2, b, z) {
959
+ createActionLink(x2, j2, b, z) {
960
+ return this.client.post(`/repos/${x2}/${j2}/actions/links`, b, z);
961
+ }
962
+ listRepoRunners(x2, j2, b, z) {
683
963
  let A = new URLSearchParams;
684
964
  if (b?.page !== undefined)
685
965
  A.append("page", String(b.page));
686
966
  if (b?.per_page !== undefined)
687
967
  A.append("per_page", String(b.per_page));
688
- let B = A.toString(), C = `/repos/${x}/${j2}/actions/runners${B ? `?${B}` : ""}`;
968
+ let B = A.toString(), C = `/repos/${x2}/${j2}/actions/runners${B ? `?${B}` : ""}`;
689
969
  return this.client.get(C, z);
690
970
  }
691
- createRepoRunnerRegistrationToken(x, j2, b) {
692
- return this.client.post(`/repos/${x}/${j2}/actions/runners/registration-token`, b);
971
+ createRepoRunnerRegistrationToken(x2, j2, b) {
972
+ return this.client.post(`/repos/${x2}/${j2}/actions/runners/registration-token`, b);
693
973
  }
694
- getRepoRunner(x, j2, b, z) {
695
- return this.client.get(`/repos/${x}/${j2}/actions/runners/${b}`, z);
974
+ getRepoRunner(x2, j2, b, z) {
975
+ return this.client.get(`/repos/${x2}/${j2}/actions/runners/${b}`, z);
696
976
  }
697
- deleteRepoRunner(x, j2, b, z) {
698
- return this.client.delete(`/repos/${x}/${j2}/actions/runners/${b}`, undefined, z);
977
+ deleteRepoRunner(x2, j2, b, z) {
978
+ return this.client.delete(`/repos/${x2}/${j2}/actions/runners/${b}`, undefined, z);
699
979
  }
700
- listRepoVariables(x, j2, b, z) {
980
+ listRepoVariables(x2, j2, b, z) {
701
981
  let A = new URLSearchParams;
702
982
  if (b?.per_page !== undefined)
703
983
  A.append("per_page", String(b.per_page));
704
984
  if (b?.page !== undefined)
705
985
  A.append("page", String(b.page));
706
- let B = A.toString(), C = `/repos/${x}/${j2}/actions/variables${B ? `?${B}` : ""}`;
986
+ let B = A.toString(), C = `/repos/${x2}/${j2}/actions/variables${B ? `?${B}` : ""}`;
707
987
  return this.client.get(C, z);
708
988
  }
709
- createRepoVariable(x, j2, b, z) {
710
- return this.client.post(`/repos/${x}/${j2}/actions/variables`, b, z);
989
+ createRepoVariable(x2, j2, b, z) {
990
+ return this.client.post(`/repos/${x2}/${j2}/actions/variables`, b, z);
711
991
  }
712
- getRepoVariable(x, j2, b, z) {
713
- return this.client.get(`/repos/${x}/${j2}/actions/variables/${b}`, z);
992
+ getRepoVariable(x2, j2, b, z) {
993
+ return this.client.get(`/repos/${x2}/${j2}/actions/variables/${b}`, z);
714
994
  }
715
- updateRepoVariable(x, j2, b, z, A) {
716
- return this.client.patch(`/repos/${x}/${j2}/actions/variables/${b}`, z, A);
995
+ updateRepoVariable(x2, j2, b, z, A) {
996
+ return this.client.patch(`/repos/${x2}/${j2}/actions/variables/${b}`, z, A);
717
997
  }
718
- deleteRepoVariable(x, j2, b, z) {
719
- return this.client.delete(`/repos/${x}/${j2}/actions/variables/${b}`, undefined, z);
998
+ deleteRepoVariable(x2, j2, b, z) {
999
+ return this.client.delete(`/repos/${x2}/${j2}/actions/variables/${b}`, undefined, z);
720
1000
  }
721
- getWorkflowDispatchInputs(x, j2, b, z, A) {
1001
+ getWorkflowDispatchInputs(x2, j2, b, z, A) {
722
1002
  let B = new URLSearchParams;
723
1003
  if (z?.branch !== undefined)
724
1004
  B.append("branch", z.branch);
725
1005
  if (z?.tag !== undefined)
726
1006
  B.append("tag", z.tag);
727
- let C = B.toString(), D = `/repos/${x}/${j2}/actions/workflows/${b}/dispatches${C ? `?${C}` : ""}`;
1007
+ let C = B.toString(), D = `/repos/${x2}/${j2}/actions/workflows/${b}/dispatches${C ? `?${C}` : ""}`;
728
1008
  return this.client.get(D, A);
729
1009
  }
730
- dispatchWorkflow(x, j2, b, z, A, B) {
1010
+ dispatchWorkflow(x2, j2, b, z, A, B) {
731
1011
  let C = new URLSearchParams;
732
1012
  if (A?.branch !== undefined)
733
1013
  C.append("branch", A.branch);
734
1014
  if (A?.tag !== undefined)
735
1015
  C.append("tag", A.tag);
736
- let D = C.toString(), E3 = `/repos/${x}/${j2}/actions/workflows/${b}/dispatches${D ? `?${D}` : ""}`;
737
- return this.client.post(E3, z, B);
1016
+ let D = C.toString(), E4 = `/repos/${x2}/${j2}/actions/workflows/${b}/dispatches${D ? `?${D}` : ""}`;
1017
+ return this.client.post(E4, z, B);
738
1018
  }
739
1019
  }
740
1020
 
@@ -754,7 +1034,7 @@ class A {
754
1034
  j2.append("sort", b.sort);
755
1035
  if (b?.direction !== undefined)
756
1036
  j2.append("direction", b.direction);
757
- let x = j2.toString(), z = `/user/starred${x ? `?${x}` : ""}`;
1037
+ let x2 = j2.toString(), z = `/user/starred${x2 ? `?${x2}` : ""}`;
758
1038
  return this.client.get(z, k2);
759
1039
  }
760
1040
  isStarred(b, k2, j2) {
@@ -768,74 +1048,6 @@ class A {
768
1048
  }
769
1049
  }
770
1050
 
771
- // ../sdk/dist/api/issues.js
772
- class E3 {
773
- client;
774
- constructor(k2) {
775
- this.client = k2;
776
- }
777
- list(k2, A2, b, f) {
778
- let j2 = new URLSearchParams;
779
- if (b?.state !== undefined)
780
- j2.append("state", b.state);
781
- if (b?.q !== undefined)
782
- j2.append("q", b.q);
783
- if (b?.labels !== undefined)
784
- j2.append("labels", b.labels);
785
- if (b?.milestones !== undefined)
786
- j2.append("milestones", b.milestones);
787
- if (b?.created_by !== undefined)
788
- j2.append("created_by", b.created_by);
789
- if (b?.assigned_by !== undefined)
790
- j2.append("assigned_by", b.assigned_by);
791
- if (b?.mentioned_by !== undefined)
792
- j2.append("mentioned_by", b.mentioned_by);
793
- if (b?.type !== undefined)
794
- j2.append("type", b.type);
795
- if (b?.since !== undefined)
796
- j2.append("since", b.since);
797
- if (b?.before !== undefined)
798
- j2.append("before", b.before);
799
- if (b?.page !== undefined)
800
- j2.append("page", String(b.page));
801
- if (b?.per_page !== undefined)
802
- j2.append("per_page", String(b.per_page));
803
- let z = j2.toString(), B = `/repos/${k2}/${A2}/issues${z ? `?${z}` : ""}`;
804
- return this.client.get(B, f);
805
- }
806
- getComment(k2, A2, b, f) {
807
- return this.client.get(`/repos/${k2}/${A2}/issues/comments/${b}`, f);
808
- }
809
- get(k2, A2, b, f) {
810
- return this.client.get(`/repos/${k2}/${A2}/issues/${b}`, f);
811
- }
812
- listComments(k2, A2, b, f, j2) {
813
- let z = new URLSearchParams;
814
- if (f?.since !== undefined)
815
- z.append("since", f.since);
816
- if (f?.before !== undefined)
817
- z.append("before", f.before);
818
- let B = z.toString(), D = `/repos/${k2}/${A2}/issues/${b}/comments${B ? `?${B}` : ""}`;
819
- return this.client.get(D, j2);
820
- }
821
- listLabels(k2, A2, b, f) {
822
- return this.client.get(`/repos/${k2}/${A2}/issues/${b}/labels`, f);
823
- }
824
- listTimeline(k2, A2, b, f, j2) {
825
- let z = new URLSearchParams;
826
- if (f?.page !== undefined)
827
- z.append("page", String(f.page));
828
- if (f?.per_page !== undefined)
829
- z.append("per_page", String(f.per_page));
830
- if (f?.since !== undefined)
831
- z.append("since", f.since);
832
- if (f?.before !== undefined)
833
- z.append("before", f.before);
834
- let B = z.toString(), D = `/repos/${k2}/${A2}/issues/${b}/timeline${B ? `?${B}` : ""}`;
835
- return this.client.get(D, j2);
836
- }
837
- }
838
-
839
1051
  // ../sdk/dist/api/users.js
840
1052
  class z {
841
1053
  client;
@@ -854,8 +1066,8 @@ class z {
854
1066
  k2.append("page", String(j2.page));
855
1067
  if (j2?.per_page !== undefined)
856
1068
  k2.append("per_page", String(j2.per_page));
857
- let w = k2.toString(), x = `/search/users${w ? `?${w}` : ""}`;
858
- return this.client.get(x, v2);
1069
+ let w = k2.toString(), x2 = `/search/users${w ? `?${w}` : ""}`;
1070
+ return this.client.get(x2, v2);
859
1071
  }
860
1072
  getAuthenticated(j2) {
861
1073
  return this.client.get("/user", j2);
@@ -868,44 +1080,36 @@ class z {
868
1080
  }
869
1081
  }
870
1082
 
871
- // ../sdk/dist/api/emails.js
872
- class x {
1083
+ // ../sdk/dist/api/pages.js
1084
+ class A2 {
873
1085
  client;
874
1086
  constructor(b) {
875
1087
  this.client = b;
876
1088
  }
877
- list(b, f) {
878
- let j2 = new URLSearchParams;
879
- if (b?.page !== undefined)
880
- j2.append("page", String(b.page));
881
- if (b?.per_page !== undefined)
882
- j2.append("per_page", String(b.per_page));
883
- let k2 = j2.toString(), w = `/user/emails${k2 ? `?${k2}` : ""}`;
884
- return this.client.get(w, f);
885
- }
886
- create(b, f) {
887
- return this.client.post("/user/emails", b, f);
1089
+ createDeployment(b, j2, k2, v2) {
1090
+ return this.client.post(`/repos/${b}/${j2}/pages/deployments`, k2, v2);
888
1091
  }
889
- delete(b, f) {
890
- return this.client.delete("/user/emails", b, f);
1092
+ getDeploymentStatus(b, j2, k2, v2) {
1093
+ return this.client.get(`/repos/${b}/${j2}/pages/deployments/${k2}`, v2);
891
1094
  }
892
1095
  }
893
1096
 
894
1097
  // ../sdk/dist/index.js
895
- class J {
1098
+ class K {
896
1099
  client;
897
1100
  actions;
898
1101
  orgs;
899
1102
  teams;
900
1103
  repos;
901
1104
  issues;
1105
+ pages;
902
1106
  pulls;
903
1107
  releases;
904
1108
  users;
905
1109
  emails;
906
1110
  stars;
907
1111
  constructor(b = {}) {
908
- this.client = new v(b), this.actions = new F2(this.client), this.orgs = new F(this.client), this.teams = new E2(this.client), this.repos = new E(this.client), this.issues = new E3(this.client), this.pulls = new I(this.client), this.releases = new G(this.client), this.users = new z(this.client), this.emails = new x(this.client), this.stars = new A(this.client);
1112
+ this.client = new v(b), this.actions = new F2(this.client), this.orgs = new F(this.client), this.teams = new E3(this.client), this.repos = new E2(this.client), this.issues = new E(this.client), this.pages = new A2(this.client), this.pulls = new I(this.client), this.releases = new G(this.client), this.users = new z(this.client), this.emails = new x(this.client), this.stars = new A(this.client);
909
1113
  }
910
1114
  setToken(b) {
911
1115
  return this.client.setToken(b), this;
@@ -918,7 +1122,7 @@ class GitVerseReleaseClient {
918
1122
  repoInfo;
919
1123
  retryFn;
920
1124
  constructor(token, repoInfo, retryFn) {
921
- this.client = new J({ token });
1125
+ this.client = new K({ token });
922
1126
  this.repoInfo = repoInfo;
923
1127
  this.retryFn = retryFn;
924
1128
  }
@@ -966,7 +1170,7 @@ function createGitVerseClient(repoInfo, retryFn) {
966
1170
  }
967
1171
 
968
1172
  // src/utils/changelog.ts
969
- import { readFile as readFile2, writeFile } from "node:fs/promises";
1173
+ import { readFile as readFile2, writeFile as writeFile2 } from "node:fs/promises";
970
1174
 
971
1175
  // src/utils/parser.ts
972
1176
  var COMMIT_REGEX = /^(?<type>\w+)(?:\((?<scope>[^)]+)\))?(?<breaking>!)?: (?<subject>.+)$/;
@@ -1128,7 +1332,7 @@ All notable changes to this project will be documented in this file.
1128
1332
  insertIndex = lines.length;
1129
1333
  }
1130
1334
  lines.splice(insertIndex, 0, newEntry);
1131
- await writeFile(changelogPath, lines.join(`
1335
+ await writeFile2(changelogPath, lines.join(`
1132
1336
  `));
1133
1337
  }
1134
1338
  function generateReleaseNotes(commits, config, repoUrl, packageName) {
@@ -1188,7 +1392,8 @@ async function runBeforeCommitHook(command) {
1188
1392
  }
1189
1393
  var GITVERSE_URL_REGEX_1 = /gitverse\.ru[:/]([^/]+)\/([^/.]+)(\.git)?$/;
1190
1394
  var GITVERSE_URL_REGEX_2 = /gitverse\.ru\/([^/]+)\/([^/.]+)(\.git)?$/;
1191
- async function git(command) {
1395
+ var GITVERSE_URL_REGEX_3 = /gitverse\.ru:\d+\/([^/]+)\/([^/.]+)(\.git)?$/;
1396
+ async function gitCommand(command) {
1192
1397
  const { stdout } = await execAsync(`git ${command}`);
1193
1398
  return stdout.trim();
1194
1399
  }
@@ -1209,14 +1414,14 @@ async function getRepoInfo() {
1209
1414
  };
1210
1415
  }
1211
1416
  }
1212
- const url = await git("remote get-url origin");
1213
- const match = url.match(GITVERSE_URL_REGEX_1) || url.match(GITVERSE_URL_REGEX_2);
1417
+ const url = await gitCommand("remote get-url origin");
1418
+ const match = url.match(GITVERSE_URL_REGEX_1) || url.match(GITVERSE_URL_REGEX_2) || url.match(GITVERSE_URL_REGEX_3);
1214
1419
  if (!(match?.[1] && match[2])) {
1215
1420
  throw new Error(`Unable to parse GitVerse repository from URL: ${url}`);
1216
1421
  }
1217
1422
  const owner = match[1];
1218
1423
  const repo = match[2];
1219
- const branch = await git("branch --show-current");
1424
+ const branch = await gitCommand("branch --show-current");
1220
1425
  return {
1221
1426
  branch,
1222
1427
  fullName: `${owner}/${repo}`,
@@ -1227,7 +1432,7 @@ async function getRepoInfo() {
1227
1432
  }
1228
1433
  async function getLatestTag(prefix) {
1229
1434
  try {
1230
- const tags = await git(`tag --sort=-v:refname --list "${prefix}*"`);
1435
+ const tags = await gitCommand(`tag --sort=-v:refname --list "${prefix}*"`);
1231
1436
  const tagList = tags.split(`
1232
1437
  `).filter((tag) => tag.length > 0);
1233
1438
  return tagList.length > 0 ? tagList[0] ?? null : null;
@@ -1245,7 +1450,7 @@ async function getCommitsSinceTag(tagPrefix, path) {
1245
1450
  }
1246
1451
  const format = "%H%n%h%n%an%n%ae%n%ai%n%B%n==END==";
1247
1452
  const pathFilter = path ? `-- ${path}` : "";
1248
- const log = await git(`log ${range} --format="${format}" ${pathFilter}`);
1453
+ const log = await gitCommand(`log ${range} --format="${format}" ${pathFilter}`);
1249
1454
  const commits = log.split(`
1250
1455
  ==END==`).map((commit) => commit.trim()).filter((commit) => commit.length > 0 && commit !== "==END==");
1251
1456
  return commits;
@@ -1279,33 +1484,33 @@ async function getPackageInfo(packagePath) {
1279
1484
  };
1280
1485
  }
1281
1486
  async function updatePackageVersion(packagePath, newVersion) {
1282
- const { readFile: readFile3, writeFile: writeFile2 } = await import("node:fs/promises");
1487
+ const { readFile: readFile3, writeFile: writeFile3 } = await import("node:fs/promises");
1283
1488
  const { resolve: resolve2 } = await import("node:path");
1284
1489
  const pkgJsonPath = resolve2(packagePath, "package.json");
1285
1490
  const content = await readFile3(pkgJsonPath, "utf-8");
1286
1491
  const pkgJson = JSON.parse(content);
1287
1492
  pkgJson.version = newVersion;
1288
- await writeFile2(pkgJsonPath, `${JSON.stringify(pkgJson, null, 2)}
1493
+ await writeFile3(pkgJsonPath, `${JSON.stringify(pkgJson, null, 2)}
1289
1494
  `);
1290
1495
  }
1291
1496
  async function createCommit(message, files) {
1292
1497
  for (const file of files) {
1293
- await git(`add "${file}"`);
1498
+ await gitCommand(`add "${file}"`);
1294
1499
  }
1295
- await git(`commit -m "${message}"`);
1500
+ await gitCommand(`commit -m "${message}"`);
1296
1501
  }
1297
1502
  async function createTag(tag, message) {
1298
- await git(`tag -a "${tag}" -m "${message}"`);
1503
+ await gitCommand(`tag -a "${tag}" -m "${message}"`);
1299
1504
  }
1300
1505
  async function pushChanges(tag) {
1301
- await git("push");
1506
+ await gitCommand("push");
1302
1507
  if (tag) {
1303
- await git(`push origin "${tag}"`);
1508
+ await gitCommand(`push origin "${tag}"`);
1304
1509
  }
1305
1510
  }
1306
1511
  async function isWorkingTreeClean() {
1307
1512
  try {
1308
- const status = await git("status --porcelain");
1513
+ const status = await gitCommand("status --porcelain");
1309
1514
  if (status.length === 0) {
1310
1515
  return true;
1311
1516
  }
@@ -1332,10 +1537,14 @@ async function isWorkingTreeClean() {
1332
1537
  }
1333
1538
  async function tagExists(tag) {
1334
1539
  try {
1335
- await git(`rev-parse "${tag}"`);
1540
+ await gitCommand(`rev-parse "${tag}"`);
1336
1541
  return true;
1337
- } catch {
1338
- return false;
1542
+ } catch (error) {
1543
+ const errorMessage = error instanceof Error ? error.message.toLowerCase() : String(error).toLowerCase();
1544
+ if (errorMessage.includes("not a valid object name") || errorMessage.includes("unknown revision")) {
1545
+ return false;
1546
+ }
1547
+ throw new Error(`Failed to check tag "${tag}": ${error instanceof Error ? error.message : String(error)}`);
1339
1548
  }
1340
1549
  }
1341
1550
 
@@ -1537,6 +1746,683 @@ function compareVersions(a, b) {
1537
1746
  return 0;
1538
1747
  }
1539
1748
 
1749
+ // src/binaries.ts
1750
+ import { mkdir as mkdir2, writeFile as writeFile5 } from "node:fs/promises";
1751
+ import { dirname, join as join3 } from "node:path";
1752
+
1753
+ // src/utils/binary-package-generator.ts
1754
+ import { copyFile, mkdir, writeFile as writeFile3 } from "node:fs/promises";
1755
+ import { join as join2 } from "node:path";
1756
+
1757
+ // src/utils/binary-platforms.ts
1758
+ import { access as access2 } from "node:fs/promises";
1759
+ import { join, resolve as resolve2 } from "node:path";
1760
+ var PLATFORM_MAPPINGS = {
1761
+ "darwin-arm64": { cpu: "arm64", extension: "", os: "darwin" },
1762
+ "darwin-x64": { cpu: "x64", extension: "", os: "darwin" },
1763
+ "linux-arm64": { cpu: "arm64", extension: "", os: "linux" },
1764
+ "linux-x64": { cpu: "x64", extension: "", os: "linux" },
1765
+ "win32-arm64": { cpu: "arm64", extension: ".exe", os: "win32" },
1766
+ "win32-x64": { cpu: "x64", extension: ".exe", os: "win32" }
1767
+ };
1768
+ var ALL_PLATFORMS = Object.keys(PLATFORM_MAPPINGS);
1769
+ function isValidPlatform(value) {
1770
+ return value in PLATFORM_MAPPINGS;
1771
+ }
1772
+ function parsePlatforms(value) {
1773
+ const platforms = value.split(",").map((p) => p.trim());
1774
+ const result = [];
1775
+ for (const platform of platforms) {
1776
+ if (!isValidPlatform(platform)) {
1777
+ throw new Error(`Invalid platform: ${platform}. Valid platforms: ${ALL_PLATFORMS.join(", ")}`);
1778
+ }
1779
+ result.push(platform);
1780
+ }
1781
+ return result;
1782
+ }
1783
+ function getBinaryPath(distDir, name, platform) {
1784
+ const mapping = PLATFORM_MAPPINGS[platform];
1785
+ const binaryName = `${name}${mapping.extension}`;
1786
+ const platformDir = `${name}-${platform}`;
1787
+ return resolve2(distDir, platformDir, binaryName);
1788
+ }
1789
+ function getPlatformDir(distDir, name, platform) {
1790
+ const platformDir = `${name}-${platform}`;
1791
+ return resolve2(distDir, platformDir);
1792
+ }
1793
+ async function validateBinaryExists(distDir, name, platform) {
1794
+ const binaryPath = getBinaryPath(distDir, name, platform);
1795
+ try {
1796
+ await access2(binaryPath);
1797
+ return true;
1798
+ } catch (error) {
1799
+ if (error instanceof Error && "code" in error && error.code === "ENOENT") {
1800
+ return false;
1801
+ }
1802
+ throw new Error(`Failed to check binary at ${binaryPath}: ${error instanceof Error ? error.message : String(error)}`);
1803
+ }
1804
+ }
1805
+ async function validateAllBinaries(distDir, name, platforms) {
1806
+ const missing = [];
1807
+ for (const platform of platforms) {
1808
+ const exists = await validateBinaryExists(distDir, name, platform);
1809
+ if (!exists) {
1810
+ missing.push(platform);
1811
+ }
1812
+ }
1813
+ return missing;
1814
+ }
1815
+ function getPackageName(scope, name, platform) {
1816
+ const cleanScope = scope.startsWith("@") ? scope : `@${scope}`;
1817
+ return `${cleanScope}/${name}-${platform}`;
1818
+ }
1819
+ function getPackageOutputPath(outDir, scope, name, platform) {
1820
+ const cleanScope = scope.startsWith("@") ? scope.slice(1) : scope;
1821
+ return join(outDir, `@${cleanScope}`, `${name}-${platform}`);
1822
+ }
1823
+ function expandPlaceholders(template, values) {
1824
+ let result = template;
1825
+ if (values.packageDir !== undefined) {
1826
+ result = result.replace(/\{\{packageDir\}\}/g, values.packageDir);
1827
+ }
1828
+ if (values.version !== undefined) {
1829
+ result = result.replace(/\{\{version\}\}/g, values.version);
1830
+ }
1831
+ if (values.platform !== undefined) {
1832
+ result = result.replace(/\{\{platform\}\}/g, values.platform);
1833
+ }
1834
+ if (values.scope !== undefined) {
1835
+ result = result.replace(/\{\{scope\}\}/g, values.scope);
1836
+ }
1837
+ if (values.name !== undefined) {
1838
+ result = result.replace(/\{\{name\}\}/g, values.name);
1839
+ }
1840
+ return result;
1841
+ }
1842
+ function platformToNodeValues(platform) {
1843
+ const parts = platform.split("-");
1844
+ return { arch: parts[1] ?? "", platform: parts[0] ?? "" };
1845
+ }
1846
+
1847
+ // src/utils/binary-package-generator.ts
1848
+ function generatePlatformPackageJson(config, platform, version) {
1849
+ const mapping = PLATFORM_MAPPINGS[platform];
1850
+ const packageName = getPackageName(config.scope, config.name, platform);
1851
+ const binName = config.binName ?? config.name;
1852
+ const binaryFileName = `${binName}${mapping.extension}`;
1853
+ const pkg = {
1854
+ bin: {
1855
+ [binName]: `bin/${binaryFileName}`
1856
+ },
1857
+ cpu: [mapping.cpu],
1858
+ description: `${config.name} binary for ${platform}`,
1859
+ files: ["bin"],
1860
+ license: "MIT",
1861
+ name: packageName,
1862
+ os: [mapping.os],
1863
+ preferUnplugged: true,
1864
+ version
1865
+ };
1866
+ return JSON.stringify(pkg, null, 2);
1867
+ }
1868
+ function generatePlatformReadme(config, platform, version) {
1869
+ const packageName = getPackageName(config.scope, config.name, platform);
1870
+ const mapping = PLATFORM_MAPPINGS[platform];
1871
+ const mainPackageName = `${config.scope.startsWith("@") ? config.scope : `@${config.scope}`}/${config.name}`;
1872
+ return `# ${packageName}
1873
+
1874
+ Platform-specific binary for \`${config.name}\` (${mapping.os} ${mapping.cpu}).
1875
+
1876
+ ## Installation
1877
+
1878
+ This package is not meant to be installed directly. Install the main package instead:
1879
+
1880
+ \`\`\`bash
1881
+ npm install ${mainPackageName}
1882
+ \`\`\`
1883
+
1884
+ The main package will automatically install the correct platform-specific binary as an optional dependency.
1885
+
1886
+ ## Version
1887
+
1888
+ ${version}
1889
+ `;
1890
+ }
1891
+ async function generatePlatformPackage(config, platform, version, dryRun = false) {
1892
+ const packageName = getPackageName(config.scope, config.name, platform);
1893
+ const packageDir = getPackageOutputPath(config.outDir, config.scope, config.name, platform);
1894
+ const binName = config.binName ?? config.name;
1895
+ const mapping = PLATFORM_MAPPINGS[platform];
1896
+ const baseResult = {
1897
+ packageDir,
1898
+ packageName,
1899
+ platform
1900
+ };
1901
+ try {
1902
+ const binaryExists = await validateBinaryExists(config.distDir, config.name, platform);
1903
+ if (!binaryExists) {
1904
+ const expectedPath = getBinaryPath(config.distDir, config.name, platform);
1905
+ return { ...baseResult, error: `Binary not found: ${expectedPath}`, success: false };
1906
+ }
1907
+ if (dryRun) {
1908
+ return { ...baseResult, success: true };
1909
+ }
1910
+ const binDir = join2(packageDir, "bin");
1911
+ await mkdir(binDir, { recursive: true });
1912
+ const packageJson = generatePlatformPackageJson(config, platform, version);
1913
+ await writeFile3(join2(packageDir, "package.json"), packageJson);
1914
+ const readme = generatePlatformReadme(config, platform, version);
1915
+ await writeFile3(join2(packageDir, "README.md"), readme);
1916
+ const sourceBinaryPath = getBinaryPath(config.distDir, config.name, platform);
1917
+ const binaryFileName = `${binName}${mapping.extension}`;
1918
+ const targetBinaryPath = join2(binDir, binaryFileName);
1919
+ await copyFile(sourceBinaryPath, targetBinaryPath);
1920
+ return { ...baseResult, success: true };
1921
+ } catch (error) {
1922
+ const errorMessage = error instanceof Error ? error.message : String(error);
1923
+ console.error(`❌ Failed to generate package ${packageName} for ${platform}: ${errorMessage}`);
1924
+ return { ...baseResult, error: `Failed to generate ${packageName}: ${errorMessage}`, success: false };
1925
+ }
1926
+ }
1927
+ async function generateAllPlatformPackages(config, version, platforms, dryRun = false) {
1928
+ const targetPlatforms = platforms ?? config.platforms;
1929
+ const results = [];
1930
+ for (const platform of targetPlatforms) {
1931
+ const result = await generatePlatformPackage(config, platform, version, dryRun);
1932
+ results.push(result);
1933
+ }
1934
+ return results;
1935
+ }
1936
+ function printGenerationDryRun(config, version, platforms) {
1937
+ console.log(`
1938
+ \uD83D\uDCE6 Binary Distribution:`);
1939
+ console.log(` Scope: ${config.scope}`);
1940
+ console.log(` Name: ${config.name}`);
1941
+ console.log(` Version: ${version}`);
1942
+ console.log(` Platforms: ${platforms.join(", ")}`);
1943
+ console.log(`
1944
+ \uD83D\uDCC1 Packages to generate:`);
1945
+ for (const platform of platforms) {
1946
+ const packageDir = getPackageOutputPath(config.outDir, config.scope, config.name, platform);
1947
+ console.log(` ${packageDir}/`);
1948
+ }
1949
+ }
1950
+
1951
+ // src/utils/binary-publisher.ts
1952
+ import { exec as exec2 } from "node:child_process";
1953
+ import { promisify as promisify2 } from "node:util";
1954
+ var execAsync2 = promisify2(exec2);
1955
+ function sleep2(ms) {
1956
+ return new Promise((resolve3) => setTimeout(resolve3, ms));
1957
+ }
1958
+ function calculateDelay2(attempt, initialDelay = 2000, maxDelay = 30000) {
1959
+ const delay = initialDelay * 2 ** attempt;
1960
+ return Math.min(delay, maxDelay);
1961
+ }
1962
+ function isRetriableError2(error) {
1963
+ if (!(error instanceof Error)) {
1964
+ return false;
1965
+ }
1966
+ const message = error.message.toLowerCase();
1967
+ if (message.includes("network") || message.includes("timeout") || message.includes("econnreset")) {
1968
+ return true;
1969
+ }
1970
+ if (message.includes("503") || message.includes("429") || message.includes("rate")) {
1971
+ return true;
1972
+ }
1973
+ if (message.includes("registry") || message.includes("etarget")) {
1974
+ return true;
1975
+ }
1976
+ return false;
1977
+ }
1978
+ async function publishPlatformPackage(config, platform, version, dryRun = false) {
1979
+ const packageName = getPackageName(config.scope, config.name, platform);
1980
+ const packageDir = getPackageOutputPath(config.outDir, config.scope, config.name, platform);
1981
+ const baseResult = {
1982
+ packageName,
1983
+ platform
1984
+ };
1985
+ const publishCommand = expandPlaceholders(config.publishCommand, {
1986
+ name: config.name,
1987
+ packageDir,
1988
+ platform,
1989
+ scope: config.scope,
1990
+ version
1991
+ });
1992
+ if (dryRun) {
1993
+ return { ...baseResult, attempts: 1, success: true };
1994
+ }
1995
+ let lastError;
1996
+ let attempts = 0;
1997
+ for (let attempt = 0;attempt < config.retryAttempts; attempt++) {
1998
+ attempts = attempt + 1;
1999
+ try {
2000
+ await execAsync2(publishCommand, {
2001
+ cwd: packageDir,
2002
+ env: process.env
2003
+ });
2004
+ return { ...baseResult, attempts, success: true };
2005
+ } catch (error) {
2006
+ lastError = error instanceof Error ? error : new Error(String(error));
2007
+ const canRetry = isRetriableError2(error);
2008
+ if (attempt === config.retryAttempts - 1 || !canRetry) {
2009
+ break;
2010
+ }
2011
+ const delay = calculateDelay2(attempt);
2012
+ console.warn(`⚠️ Publish failed for ${packageName} (attempt ${attempt + 1}/${config.retryAttempts})`);
2013
+ console.warn(` ${lastError.message}`);
2014
+ console.warn(` Retrying in ${delay}ms...`);
2015
+ await sleep2(delay);
2016
+ }
2017
+ }
2018
+ return {
2019
+ ...baseResult,
2020
+ attempts,
2021
+ error: lastError?.message ?? "Unknown error",
2022
+ success: false
2023
+ };
2024
+ }
2025
+ async function publishAllPlatformPackages(config, version, generatedPackages, dryRun = false, verbose = false) {
2026
+ const results = [];
2027
+ const successfulPackages = generatedPackages.filter((p) => p.success);
2028
+ if (successfulPackages.length === 0) {
2029
+ return results;
2030
+ }
2031
+ const batchSize = 3;
2032
+ for (let i = 0;i < successfulPackages.length; i += batchSize) {
2033
+ const batch = successfulPackages.slice(i, i + batchSize);
2034
+ const batchPromises = batch.map(async (pkg) => {
2035
+ if (verbose) {
2036
+ console.log(`\uD83D\uDCE4 Publishing ${pkg.packageName}...`);
2037
+ }
2038
+ const result = await publishPlatformPackage(config, pkg.platform, version, dryRun);
2039
+ if (result.success) {
2040
+ if (verbose) {
2041
+ console.log(`✅ Published ${pkg.packageName}`);
2042
+ }
2043
+ } else {
2044
+ console.error(`❌ Failed to publish ${pkg.packageName}: ${result.error}`);
2045
+ }
2046
+ return result;
2047
+ });
2048
+ const batchResults = await Promise.all(batchPromises);
2049
+ results.push(...batchResults);
2050
+ if (i + batchSize < successfulPackages.length) {
2051
+ await sleep2(500);
2052
+ }
2053
+ }
2054
+ return results;
2055
+ }
2056
+ function printPublishDryRun(config, generatedPackages) {
2057
+ const successfulPackages = generatedPackages.filter((p) => p.success);
2058
+ console.log(`
2059
+ \uD83D\uDE80 Packages to publish:`);
2060
+ for (const pkg of successfulPackages) {
2061
+ console.log(` ${pkg.packageName} (${pkg.packageDir})`);
2062
+ }
2063
+ console.log(`
2064
+ \uD83D\uDCE4 Publish command: ${config.publishCommand}`);
2065
+ }
2066
+ function printPublishSummary(results, _config) {
2067
+ const successful = results.filter((r) => r.success);
2068
+ const failed = results.filter((r) => !r.success);
2069
+ console.log(`
2070
+ \uD83D\uDCCA Publish Summary:`);
2071
+ console.log(` Total: ${results.length}`);
2072
+ console.log(` Successful: ${successful.length}`);
2073
+ console.log(` Failed: ${failed.length}`);
2074
+ if (failed.length > 0) {
2075
+ console.log(`
2076
+ ❌ Failed packages:`);
2077
+ for (const result of failed) {
2078
+ console.log(` ${result.packageName}: ${result.error}`);
2079
+ }
2080
+ }
2081
+ }
2082
+
2083
+ // src/utils/binary-wrapper-generator.ts
2084
+ import { readFile as readFile3, writeFile as writeFile4 } from "node:fs/promises";
2085
+ import { resolve as resolve3 } from "node:path";
2086
+ function generateBinaryWrapper(config) {
2087
+ const binName = config.binName ?? config.name;
2088
+ const scope = config.scope.startsWith("@") ? config.scope : `@${config.scope}`;
2089
+ const platformEntries = config.platforms.map((platform) => {
2090
+ const packageName = getPackageName(config.scope, config.name, platform);
2091
+ const parts = platform.split("-");
2092
+ return ` "${parts[0]}-${parts[1]}": "${packageName}"`;
2093
+ });
2094
+ return `#!/usr/bin/env node
2095
+ "use strict";
2096
+
2097
+ const { platform, arch } = process;
2098
+ const { execFileSync } = require("child_process");
2099
+ const { join } = require("path");
2100
+
2101
+ const PLATFORMS = {
2102
+ ${platformEntries.join(`,
2103
+ `)}
2104
+ };
2105
+
2106
+ const platformKey = \`\${platform}-\${arch}\`;
2107
+ const pkg = PLATFORMS[platformKey];
2108
+
2109
+ if (!pkg) {
2110
+ console.error(\`Unsupported platform: \${platformKey}\`);
2111
+ console.error(\`Supported platforms: \${Object.keys(PLATFORMS).join(", ")}\`);
2112
+ process.exit(1);
2113
+ }
2114
+
2115
+ let binPath;
2116
+ try {
2117
+ // Try to resolve the platform-specific package
2118
+ const pkgPath = require.resolve(\`\${pkg}/package.json\`);
2119
+ const pkgDir = join(pkgPath, "..");
2120
+ const pkgJson = require(pkgPath);
2121
+ const binEntry = pkgJson.bin && pkgJson.bin["${binName}"];
2122
+
2123
+ if (!binEntry) {
2124
+ throw new Error(\`Binary entry not found in \${pkg}\`);
2125
+ }
2126
+
2127
+ binPath = join(pkgDir, binEntry);
2128
+ } catch (resolveError) {
2129
+ console.error(\`Failed to find binary package: \${pkg}\`);
2130
+ console.error(\`Please install it: npm install \${pkg}\`);
2131
+ console.error(\`Or reinstall the main package: npm install ${scope}/${config.name}\`);
2132
+ process.exit(1);
2133
+ }
2134
+
2135
+ try {
2136
+ const result = execFileSync(binPath, process.argv.slice(2), {
2137
+ stdio: "inherit",
2138
+ env: process.env
2139
+ });
2140
+ } catch (error) {
2141
+ // execFileSync throws on non-zero exit codes, pass through the exit code
2142
+ if (error.status !== undefined) {
2143
+ process.exit(error.status);
2144
+ }
2145
+ throw error;
2146
+ }
2147
+ `;
2148
+ }
2149
+ function generateOptionalDependencies(config, version, platforms) {
2150
+ const targetPlatforms = platforms ?? config.platforms;
2151
+ const deps = {};
2152
+ for (const platform of targetPlatforms) {
2153
+ const packageName = getPackageName(config.scope, config.name, platform);
2154
+ deps[packageName] = version;
2155
+ }
2156
+ return deps;
2157
+ }
2158
+ function generateMainPackageUpdates(config, version, platforms) {
2159
+ const binName = config.binName ?? config.name;
2160
+ return {
2161
+ bin: {
2162
+ [binName]: `bin/${binName}.js`
2163
+ },
2164
+ optionalDependencies: generateOptionalDependencies(config, version, platforms)
2165
+ };
2166
+ }
2167
+ async function updateMainPackageJson(packagePath, config, version, platforms, dryRun = false) {
2168
+ const fullPath = resolve3(packagePath);
2169
+ const content = await readFile3(fullPath, "utf-8");
2170
+ let pkg;
2171
+ try {
2172
+ pkg = JSON.parse(content);
2173
+ } catch (parseError) {
2174
+ throw new Error(`Failed to parse ${fullPath}: ${parseError instanceof Error ? parseError.message : "Invalid JSON"}`);
2175
+ }
2176
+ const updates = generateMainPackageUpdates(config, version, platforms);
2177
+ pkg.optionalDependencies = {
2178
+ ...pkg.optionalDependencies || {},
2179
+ ...updates.optionalDependencies
2180
+ };
2181
+ if (updates.bin) {
2182
+ pkg.bin = {
2183
+ ...pkg.bin || {},
2184
+ ...updates.bin
2185
+ };
2186
+ }
2187
+ if (dryRun) {
2188
+ return;
2189
+ }
2190
+ await writeFile4(fullPath, `${JSON.stringify(pkg, null, 2)}
2191
+ `);
2192
+ }
2193
+ function printMainPackageUpdatesDryRun(config, version, platforms) {
2194
+ const updates = generateMainPackageUpdates(config, version, platforms);
2195
+ console.log(`
2196
+ \uD83D\uDCDD Main package updates:`);
2197
+ console.log(" optionalDependencies:");
2198
+ for (const [name, ver] of Object.entries(updates.optionalDependencies)) {
2199
+ console.log(` "${name}": "${ver}"`);
2200
+ }
2201
+ if (updates.bin) {
2202
+ console.log(" bin:");
2203
+ for (const [name, path] of Object.entries(updates.bin)) {
2204
+ console.log(` "${name}": "${path}"`);
2205
+ }
2206
+ }
2207
+ }
2208
+
2209
+ // src/binaries.ts
2210
+ async function generateBinaryPackages(options = {}) {
2211
+ const result = {
2212
+ errors: [],
2213
+ packages: [],
2214
+ published: [],
2215
+ success: false,
2216
+ version: "",
2217
+ warnings: []
2218
+ };
2219
+ try {
2220
+ const config = await loadConfig(options.config);
2221
+ if (!config.binaries?.enabled) {
2222
+ result.errors.push("Binary distribution is not enabled in config");
2223
+ return result;
2224
+ }
2225
+ validateBinariesConfig(config.binaries);
2226
+ const binariesConfig = config.binaries;
2227
+ const version = options.version ?? await getCurrentVersion(".");
2228
+ result.version = version;
2229
+ const platforms = options.platforms ?? binariesConfig.platforms;
2230
+ const missingBinaries = await validateAllBinaries(binariesConfig.distDir, binariesConfig.name, platforms);
2231
+ if (missingBinaries.length > 0) {
2232
+ for (const platform of missingBinaries) {
2233
+ console.warn(`⚠️ Binary not found for platform: ${platform}`);
2234
+ result.warnings.push(`Binary not found for platform: ${platform}`);
2235
+ }
2236
+ if (missingBinaries.length === platforms.length) {
2237
+ result.errors.push("No binaries found for any platform");
2238
+ return result;
2239
+ }
2240
+ const availableCount = platforms.length - missingBinaries.length;
2241
+ console.warn(`
2242
+ ⚠️ Only ${availableCount} of ${platforms.length} platforms will be processed`);
2243
+ console.warn(` Missing: ${missingBinaries.join(", ")}`);
2244
+ console.warn(` Use --platforms flag to explicitly specify which platforms to publish
2245
+ `);
2246
+ }
2247
+ const availablePlatforms = platforms.filter((p) => !missingBinaries.includes(p));
2248
+ if (options.dryRun) {
2249
+ console.log(`
2250
+ \uD83D\uDD0D DRY RUN MODE
2251
+ `);
2252
+ printGenerationDryRun(binariesConfig, version, availablePlatforms);
2253
+ printMainPackageUpdatesDryRun(binariesConfig, version, availablePlatforms);
2254
+ result.packages = availablePlatforms.map((platform) => ({
2255
+ packageDir: "",
2256
+ packageName: "",
2257
+ platform,
2258
+ success: true
2259
+ }));
2260
+ result.success = true;
2261
+ return result;
2262
+ }
2263
+ console.log(`
2264
+ \uD83D\uDCE6 Generating binary packages...
2265
+ `);
2266
+ result.packages = await generateAllPlatformPackages(binariesConfig, version, availablePlatforms, false);
2267
+ const successfulPackages = result.packages.filter((p) => p.success);
2268
+ const failedPackages = result.packages.filter((p) => !p.success);
2269
+ console.log(`✅ Generated ${successfulPackages.length} packages`);
2270
+ if (failedPackages.length > 0) {
2271
+ for (const pkg of failedPackages) {
2272
+ result.warnings.push(`Failed to generate package for ${pkg.platform}: ${pkg.error}`);
2273
+ console.warn(`⚠️ Failed: ${pkg.platform} - ${pkg.error}`);
2274
+ }
2275
+ }
2276
+ if (!options.skipMainPackage) {
2277
+ const wrapperScript = generateBinaryWrapper(binariesConfig);
2278
+ const binDir = join3(dirname(binariesConfig.mainPackage), "bin");
2279
+ const binName = binariesConfig.binName ?? binariesConfig.name;
2280
+ await mkdir2(binDir, { recursive: true });
2281
+ await writeFile5(join3(binDir, `${binName}.js`), wrapperScript);
2282
+ console.log(`✅ Generated wrapper: bin/${binName}.js`);
2283
+ }
2284
+ result.success = successfulPackages.length > 0;
2285
+ } catch (error) {
2286
+ result.errors.push(error instanceof Error ? error.message : String(error));
2287
+ console.error(`
2288
+ ❌ Generation failed:`);
2289
+ console.error(error);
2290
+ }
2291
+ return result;
2292
+ }
2293
+ async function publishBinaries(options = {}) {
2294
+ const result = {
2295
+ errors: [],
2296
+ packages: [],
2297
+ published: [],
2298
+ success: false,
2299
+ version: "",
2300
+ warnings: []
2301
+ };
2302
+ try {
2303
+ const config = await loadConfig(options.config);
2304
+ if (!config.binaries?.enabled) {
2305
+ result.errors.push("Binary distribution is not enabled in config");
2306
+ return result;
2307
+ }
2308
+ validateBinariesConfig(config.binaries);
2309
+ const binariesConfig = config.binaries;
2310
+ const version = options.version ?? await getCurrentVersion(".");
2311
+ result.version = version;
2312
+ const platforms = options.platforms ?? binariesConfig.platforms;
2313
+ const missingBinaries = await validateAllBinaries(binariesConfig.distDir, binariesConfig.name, platforms);
2314
+ if (missingBinaries.length > 0) {
2315
+ for (const platform of missingBinaries) {
2316
+ console.warn(`⚠️ Binary not found for platform: ${platform}`);
2317
+ result.warnings.push(`Binary not found for platform: ${platform}`);
2318
+ }
2319
+ if (missingBinaries.length === platforms.length) {
2320
+ result.errors.push("No binaries found for any platform");
2321
+ return result;
2322
+ }
2323
+ const availableCount = platforms.length - missingBinaries.length;
2324
+ console.warn(`
2325
+ ⚠️ Only ${availableCount} of ${platforms.length} platforms will be processed`);
2326
+ console.warn(` Missing: ${missingBinaries.join(", ")}`);
2327
+ console.warn(` Use --platforms flag to explicitly specify which platforms to publish
2328
+ `);
2329
+ }
2330
+ const availablePlatforms = platforms.filter((p) => !missingBinaries.includes(p));
2331
+ if (options.dryRun) {
2332
+ console.log(`
2333
+ \uD83D\uDD0D DRY RUN MODE
2334
+ `);
2335
+ printGenerationDryRun(binariesConfig, version, availablePlatforms);
2336
+ const dryRunPackages = availablePlatforms.map((platform) => ({
2337
+ packageDir: "",
2338
+ packageName: "",
2339
+ platform,
2340
+ success: true
2341
+ }));
2342
+ printPublishDryRun(binariesConfig, dryRunPackages);
2343
+ printMainPackageUpdatesDryRun(binariesConfig, version, availablePlatforms);
2344
+ result.packages = dryRunPackages;
2345
+ result.success = true;
2346
+ return result;
2347
+ }
2348
+ console.log(`
2349
+ \uD83D\uDCE6 Generating binary packages...
2350
+ `);
2351
+ result.packages = await generateAllPlatformPackages(binariesConfig, version, availablePlatforms, false);
2352
+ const successfulPackages = result.packages.filter((p) => p.success);
2353
+ const failedPackages = result.packages.filter((p) => !p.success);
2354
+ console.log(`✅ Generated ${successfulPackages.length} packages`);
2355
+ if (failedPackages.length > 0) {
2356
+ for (const pkg of failedPackages) {
2357
+ result.warnings.push(`Failed to generate package for ${pkg.platform}: ${pkg.error}`);
2358
+ console.warn(`⚠️ Failed: ${pkg.platform} - ${pkg.error}`);
2359
+ }
2360
+ if (!binariesConfig.continueOnError && failedPackages.length > 0) {
2361
+ result.errors.push("Some packages failed to generate");
2362
+ return result;
2363
+ }
2364
+ }
2365
+ if (successfulPackages.length === 0) {
2366
+ result.errors.push("No packages generated successfully");
2367
+ return result;
2368
+ }
2369
+ if (options.generateOnly) {
2370
+ if (!options.skipMainPackage) {
2371
+ const wrapperScript = generateBinaryWrapper(binariesConfig);
2372
+ const binDir = join3(dirname(binariesConfig.mainPackage), "bin");
2373
+ const binName = binariesConfig.binName ?? binariesConfig.name;
2374
+ await mkdir2(binDir, { recursive: true });
2375
+ await writeFile5(join3(binDir, `${binName}.js`), wrapperScript);
2376
+ console.log(`✅ Generated wrapper: bin/${binName}.js`);
2377
+ }
2378
+ result.success = true;
2379
+ return result;
2380
+ }
2381
+ console.log(`
2382
+ \uD83D\uDE80 Publishing platform packages...
2383
+ `);
2384
+ result.published = await publishAllPlatformPackages(binariesConfig, version, result.packages, false, options.verbose);
2385
+ const successfulPublishes = result.published.filter((p) => p.success);
2386
+ const failedPublishes = result.published.filter((p) => !p.success);
2387
+ printPublishSummary(result.published, binariesConfig);
2388
+ if (failedPublishes.length > 0) {
2389
+ for (const pub of failedPublishes) {
2390
+ result.warnings.push(`Failed to publish ${pub.packageName}: ${pub.error}`);
2391
+ }
2392
+ if (!binariesConfig.continueOnError) {
2393
+ result.errors.push("Some packages failed to publish");
2394
+ return result;
2395
+ }
2396
+ }
2397
+ if (!options.skipMainPackage) {
2398
+ console.log(`
2399
+ \uD83D\uDCDD Updating main package.json...
2400
+ `);
2401
+ const wrapperScript = generateBinaryWrapper(binariesConfig);
2402
+ const binDir = join3(dirname(binariesConfig.mainPackage), "bin");
2403
+ const binName = binariesConfig.binName ?? binariesConfig.name;
2404
+ await mkdir2(binDir, { recursive: true });
2405
+ await writeFile5(join3(binDir, `${binName}.js`), wrapperScript);
2406
+ const publishedPlatforms = successfulPublishes.map((p) => p.platform);
2407
+ await updateMainPackageJson(binariesConfig.mainPackage, binariesConfig, version, publishedPlatforms, false);
2408
+ console.log(`✅ Updated ${binariesConfig.mainPackage}`);
2409
+ console.log(`✅ Generated wrapper: bin/${binName}.js`);
2410
+ }
2411
+ result.success = successfulPublishes.length > 0;
2412
+ if (result.success) {
2413
+ console.log(`
2414
+ ✅ Binary distribution completed successfully!
2415
+ `);
2416
+ }
2417
+ } catch (error) {
2418
+ result.errors.push(error instanceof Error ? error.message : String(error));
2419
+ console.error(`
2420
+ ❌ Binary distribution failed:`);
2421
+ console.error(error);
2422
+ }
2423
+ return result;
2424
+ }
2425
+
1540
2426
  // src/index.ts
1541
2427
  function printDryRunInfo(pkg, currentVersion, versionBump, tag, commits, changelogEntry) {
1542
2428
  console.log(`
@@ -1565,7 +2451,7 @@ function printSuccessInfo(pkg, currentVersion, newVersion, tag, releaseUrl) {
1565
2451
  }
1566
2452
  async function updatePackageFiles(pkg, newVersion, changelogEntry) {
1567
2453
  await updatePackageVersion(pkg.path, newVersion);
1568
- const changelogPath = resolve2(pkg.path, pkg.changelog);
2454
+ const changelogPath = resolve4(pkg.path, pkg.changelog);
1569
2455
  await updateChangelogFile(changelogPath, changelogEntry);
1570
2456
  return changelogPath;
1571
2457
  }
@@ -1618,7 +2504,7 @@ async function performGitOperations(config, options, pkg, newVersion, tag, chang
1618
2504
  }
1619
2505
  }
1620
2506
  const commitMessage = config.git.commitMessage.replace("{{package}}", pkg.name).replace("{{version}}", newVersion);
1621
- await createCommit(commitMessage, [resolve2(pkg.path, "package.json"), changelogPath]);
2507
+ await createCommit(commitMessage, [resolve4(pkg.path, "package.json"), changelogPath]);
1622
2508
  }
1623
2509
  if (!options.noTag) {
1624
2510
  const tagMessage = config.git.tagMessage.replace("{{package}}", pkg.name).replace("{{version}}", newVersion);
@@ -1776,11 +2662,11 @@ async function createReleaseOnly(tag, packageName, configPath) {
1776
2662
  import { parseArgs } from "node:util";
1777
2663
 
1778
2664
  // src/utils/commitlint-generator.ts
1779
- import { writeFile as writeFile2 } from "node:fs/promises";
2665
+ import { writeFile as writeFile6 } from "node:fs/promises";
1780
2666
  async function generateCommitlint(config, options = {}) {
1781
2667
  const generatorOptions = parseGeneratorOptions(options);
1782
2668
  const rules = buildCommitlintRules(config, options);
1783
- const configContent = generateConfigContent(rules, generatorOptions.format, generatorOptions.comments);
2669
+ const configContent = generateConfigContent2(rules, generatorOptions.format, generatorOptions.comments);
1784
2670
  if (generatorOptions.verbose) {
1785
2671
  printVerboseOutput(rules, options);
1786
2672
  }
@@ -1788,7 +2674,7 @@ async function generateCommitlint(config, options = {}) {
1788
2674
  printDryRunOutput(configContent, generatorOptions.output);
1789
2675
  return;
1790
2676
  }
1791
- await writeFile2(generatorOptions.output, configContent);
2677
+ await writeFile6(generatorOptions.output, configContent);
1792
2678
  console.log(`✅ Generated commitlint config: ${generatorOptions.output}`);
1793
2679
  }
1794
2680
  function parseGeneratorOptions(options) {
@@ -1965,7 +2851,7 @@ function generateParserPreset(comments) {
1965
2851
  const comment = comments ? " // Support for feat(scope)!, fix! breaking change syntax" : "";
1966
2852
  return ` parserPreset: "conventional-changelog-conventionalcommits",${comment}`;
1967
2853
  }
1968
- function generateConfigContent(rules, format, comments) {
2854
+ function generateConfigContent2(rules, format, comments) {
1969
2855
  const rulesObject = buildRulesObject(rules);
1970
2856
  if (format === "json") {
1971
2857
  return generateJSONConfig(rulesObject);
@@ -2019,17 +2905,23 @@ gitverse-release - Release automation tool for GitVerse
2019
2905
 
2020
2906
  Usage:
2021
2907
  gitverse-release [package-name] [options]
2908
+ gitverse-release init [options]
2022
2909
  gitverse-release create-only --tag <tag> [options]
2023
2910
  gitverse-release generate-commitlint [options]
2911
+ gitverse-release publish-binaries [options]
2912
+ gitverse-release generate-binary-packages [options]
2024
2913
 
2025
2914
  Commands:
2026
- (default) Full release: update version, commit, tag, push, create release
2027
- create-only Create only GitVerse Release for existing tag (recovery mode)
2028
- generate-commitlint Generate commitlint config from release config
2915
+ (default) Full release: update version, commit, tag, push, create release
2916
+ init Initialize .gitversereleaserc.jsonc config file
2917
+ create-only Create only GitVerse Release for existing tag (recovery mode)
2918
+ generate-commitlint Generate commitlint config from release config
2919
+ publish-binaries Generate and publish platform-specific binary packages
2920
+ generate-binary-packages Generate platform-specific binary packages (without publishing)
2029
2921
 
2030
2922
  Options:
2031
2923
  --dry-run Test run without making changes
2032
- --config <path> Path to config file (default: .gitverereleaserc.json)
2924
+ --config <path> Path to config file (default: .gitversereleaserc.jsonc)
2033
2925
  --package <name> Package name to release (for monorepo)
2034
2926
  --version <version> Force specific version instead of auto-calculation
2035
2927
  --prerelease [tag] Create prerelease version (e.g., beta, alpha, rc)
@@ -2041,6 +2933,10 @@ Options:
2041
2933
  --verbose Verbose output
2042
2934
  --help Show this help message
2043
2935
 
2936
+ Init Options:
2937
+ --monorepo Initialize config for monorepo mode
2938
+ --scopes <scopes> Additional scopes for commitlint (comma-separated)
2939
+
2044
2940
  Generate Commitlint Options:
2045
2941
  --output <path> Output path for commitlint config (default: commitlint.config.ts)
2046
2942
  --format <format> Output format: ts, js, json (default: ts)
@@ -2049,7 +2945,17 @@ Generate Commitlint Options:
2049
2945
  --header-max-length <n> Maximum header length (default: 100)
2050
2946
  --no-comments Disable comments in generated config
2051
2947
 
2948
+ Binary Distribution Options:
2949
+ --platforms <list> Platforms to build (comma-separated: linux-x64,darwin-arm64,...)
2950
+ --generate-only Only generate packages, do not publish
2951
+ --skip-main-package Do not update main package.json
2952
+
2052
2953
  Examples:
2954
+ # Initialize config file
2955
+ gitverse-release init
2956
+ gitverse-release init --monorepo
2957
+ gitverse-release init --dry-run
2958
+
2053
2959
  # Auto-detect version and create release
2054
2960
  gitverse-release sdk
2055
2961
 
@@ -2063,7 +2969,7 @@ Examples:
2063
2969
  gitverse-release sdk --dry-run
2064
2970
 
2065
2971
  # Custom config
2066
- gitverse-release sdk --config ./my-config.json
2972
+ gitverse-release sdk --config ./my-config.jsonc
2067
2973
 
2068
2974
  # Create only release for existing tag (recovery)
2069
2975
  gitverse-release create-only --tag v1.2.3
@@ -2075,8 +2981,17 @@ Examples:
2075
2981
  gitverse-release generate-commitlint --format js --output .commitlintrc.js
2076
2982
  gitverse-release generate-commitlint --scopes deps,ci,docs --scope-required
2077
2983
 
2984
+ # Publish binary packages
2985
+ gitverse-release publish-binaries --dry-run
2986
+ gitverse-release publish-binaries --version 1.2.3
2987
+ gitverse-release publish-binaries --platforms linux-x64,darwin-arm64
2988
+
2989
+ # Generate binary packages only (without publishing)
2990
+ gitverse-release generate-binary-packages --dry-run
2991
+ gitverse-release generate-binary-packages --version 1.2.3
2992
+
2078
2993
  Environment Variables:
2079
- GITVERSE_TOKEN GitVerse API token (required)
2994
+ GITVERSE_TOKEN GitVerse API token (required for release creation)
2080
2995
 
2081
2996
  Documentation:
2082
2997
  https://gitverse.ru/rainypixel/gitverse-sdk
@@ -2089,8 +3004,10 @@ async function main() {
2089
3004
  config: { type: "string" },
2090
3005
  "dry-run": { type: "boolean" },
2091
3006
  format: { type: "string" },
3007
+ "generate-only": { type: "boolean" },
2092
3008
  "header-max-length": { type: "string" },
2093
3009
  help: { type: "boolean" },
3010
+ monorepo: { type: "boolean" },
2094
3011
  "no-comments": { type: "boolean" },
2095
3012
  "no-commit": { type: "boolean" },
2096
3013
  "no-push": { type: "boolean" },
@@ -2098,9 +3015,11 @@ async function main() {
2098
3015
  "no-tag": { type: "boolean" },
2099
3016
  output: { type: "string" },
2100
3017
  package: { type: "string" },
3018
+ platforms: { type: "string" },
2101
3019
  prerelease: { type: "string" },
2102
3020
  "scope-required": { type: "boolean" },
2103
3021
  scopes: { type: "string" },
3022
+ "skip-main-package": { type: "boolean" },
2104
3023
  tag: { type: "string" },
2105
3024
  verbose: { type: "boolean" },
2106
3025
  version: { type: "string" }
@@ -2111,6 +3030,32 @@ async function main() {
2111
3030
  process.exit(0);
2112
3031
  }
2113
3032
  const command = positionals[0];
3033
+ if (command === "init") {
3034
+ const scopes = values.scopes ? values.scopes.split(",").map((s) => s.trim()) : undefined;
3035
+ try {
3036
+ const filePath = await initConfig({
3037
+ dryRun: values["dry-run"],
3038
+ monorepo: values.monorepo,
3039
+ scopes
3040
+ });
3041
+ if (!values["dry-run"]) {
3042
+ console.log(`
3043
+ ✅ Created config file: ${filePath}
3044
+ `);
3045
+ console.log("Next steps:");
3046
+ console.log(" 1. Review and customize the config file");
3047
+ console.log(" 2. Run: gitverse-release generate-commitlint");
3048
+ console.log(` 3. Run: gitverse-release --dry-run
3049
+ `);
3050
+ }
3051
+ process.exit(0);
3052
+ } catch (error) {
3053
+ console.error(`
3054
+ ❌ ${error instanceof Error ? error.message : String(error)}
3055
+ `);
3056
+ process.exit(1);
3057
+ }
3058
+ }
2114
3059
  if (command === "generate-commitlint") {
2115
3060
  const config = await loadConfig(values.config);
2116
3061
  const scopesList = values.scopes ? values.scopes.split(",").map((s) => s.trim()) : config.commitlint.scopes;
@@ -2127,6 +3072,64 @@ async function main() {
2127
3072
  });
2128
3073
  process.exit(0);
2129
3074
  }
3075
+ if (command === "publish-binaries") {
3076
+ const binaryOptions = {
3077
+ config: values.config,
3078
+ dryRun: values["dry-run"],
3079
+ generateOnly: values["generate-only"],
3080
+ platforms: values.platforms ? parsePlatforms(values.platforms) : undefined,
3081
+ skipMainPackage: values["skip-main-package"],
3082
+ verbose: values.verbose,
3083
+ version: values.version
3084
+ };
3085
+ const result2 = await publishBinaries(binaryOptions);
3086
+ if (values.verbose) {
3087
+ console.log(`
3088
+ \uD83D\uDCCA Result:`);
3089
+ console.log(JSON.stringify(result2, null, 2));
3090
+ }
3091
+ if (result2.errors.length > 0) {
3092
+ console.error(`
3093
+ ❌ Errors:`);
3094
+ for (const error of result2.errors) {
3095
+ console.error(` - ${error}`);
3096
+ }
3097
+ process.exit(1);
3098
+ }
3099
+ if (!result2.success) {
3100
+ process.exit(1);
3101
+ }
3102
+ process.exit(0);
3103
+ }
3104
+ if (command === "generate-binary-packages") {
3105
+ const binaryOptions = {
3106
+ config: values.config,
3107
+ dryRun: values["dry-run"],
3108
+ generateOnly: true,
3109
+ platforms: values.platforms ? parsePlatforms(values.platforms) : undefined,
3110
+ skipMainPackage: values["skip-main-package"],
3111
+ verbose: values.verbose,
3112
+ version: values.version
3113
+ };
3114
+ const result2 = await generateBinaryPackages(binaryOptions);
3115
+ if (values.verbose) {
3116
+ console.log(`
3117
+ \uD83D\uDCCA Result:`);
3118
+ console.log(JSON.stringify(result2, null, 2));
3119
+ }
3120
+ if (result2.errors.length > 0) {
3121
+ console.error(`
3122
+ ❌ Errors:`);
3123
+ for (const error of result2.errors) {
3124
+ console.error(` - ${error}`);
3125
+ }
3126
+ process.exit(1);
3127
+ }
3128
+ if (!result2.success) {
3129
+ process.exit(1);
3130
+ }
3131
+ process.exit(0);
3132
+ }
2130
3133
  if (command === "create-only") {
2131
3134
  if (!values.tag) {
2132
3135
  console.error("❌ Error: --tag is required for create-only command");
@@ -2200,4 +3203,4 @@ Usage: gitverse-release create-only --tag <tag> [--package <name>]`);
2200
3203
  }
2201
3204
  main();
2202
3205
 
2203
- //# debugId=2DBE58B556C486E464756E2164756E21
3206
+ //# debugId=B4127DBA941A3A7264756E2164756E21