@ucdjs/release-scripts 0.1.0-beta.2 → 0.1.0-beta.3

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.d.mts CHANGED
@@ -99,6 +99,10 @@ interface ReleaseOptions {
99
99
  * GitHub token for authentication
100
100
  */
101
101
  githubToken: string;
102
+ pullRequest?: {
103
+ title: string;
104
+ body: string;
105
+ };
102
106
  }
103
107
  interface ReleaseResult {
104
108
  /**
package/dist/index.mjs CHANGED
@@ -407,34 +407,6 @@ async function pushBranch(branch, workspaceRoot, options) {
407
407
  else if (options?.force) args.push("--force");
408
408
  await run("git", args, { nodeOptions: { cwd: workspaceRoot } });
409
409
  }
410
- /**
411
- * Generate PR body from version updates
412
- * @param updates - Array of version updates to include in the PR body
413
- * @returns Formatted PR body as a string
414
- */
415
- function generatePRBody(updates) {
416
- const lines = [];
417
- lines.push("## Packages");
418
- lines.push("");
419
- const directChanges = updates.filter((u) => u.hasDirectChanges);
420
- const dependencyUpdates = updates.filter((u) => !u.hasDirectChanges);
421
- if (directChanges.length > 0) {
422
- lines.push("### Direct Changes");
423
- lines.push("");
424
- for (const update of directChanges) lines.push(`- **${update.package.name}**: ${update.currentVersion} → ${update.newVersion} (${update.bumpType})`);
425
- lines.push("");
426
- }
427
- if (dependencyUpdates.length > 0) {
428
- lines.push("### Dependency Updates");
429
- lines.push("");
430
- for (const update of dependencyUpdates) lines.push(`- **${update.package.name}**: ${update.currentVersion} → ${update.newVersion} (dependencies changed)`);
431
- lines.push("");
432
- }
433
- lines.push("---");
434
- lines.push("");
435
- lines.push("This release PR was automatically generated.");
436
- return lines.join("\n");
437
- }
438
410
 
439
411
  //#endregion
440
412
  //#region src/github.ts
@@ -502,6 +474,29 @@ async function upsertPullRequest({ owner, repo, title, body, head, base, pullNum
502
474
  throw err;
503
475
  }
504
476
  }
477
+ function generatePullRequestBody(updates, _body) {
478
+ const lines = [];
479
+ lines.push("## Packages");
480
+ lines.push("");
481
+ const directChanges = updates.filter((u) => u.hasDirectChanges);
482
+ const dependencyUpdates = updates.filter((u) => !u.hasDirectChanges);
483
+ if (directChanges.length > 0) {
484
+ lines.push("### Direct Changes");
485
+ lines.push("");
486
+ for (const update of directChanges) lines.push(`- **${update.package.name}**: ${update.currentVersion} → ${update.newVersion} (${update.bumpType})`);
487
+ lines.push("");
488
+ }
489
+ if (dependencyUpdates.length > 0) {
490
+ lines.push("### Dependency Updates");
491
+ lines.push("");
492
+ for (const update of dependencyUpdates) lines.push(`- **${update.package.name}**: ${update.currentVersion} → ${update.newVersion} (dependencies changed)`);
493
+ lines.push("");
494
+ }
495
+ lines.push("---");
496
+ lines.push("");
497
+ lines.push("This release PR was automatically generated.");
498
+ return lines.join("\n");
499
+ }
505
500
 
506
501
  //#endregion
507
502
  //#region src/prompts.ts
@@ -757,8 +752,8 @@ async function release(options) {
757
752
  }
758
753
  console.log("Pushing changes to remote");
759
754
  await pushBranch(releaseBranch, workspaceRoot, { forceWithLease: true });
760
- const prTitle = existingPullRequest?.title || "Release: Update package versions";
761
- const prBody = generatePRBody(allUpdates);
755
+ const prTitle = existingPullRequest?.title || options.pullRequest?.title || "chore: update package versions";
756
+ const prBody = generatePullRequestBody(allUpdates, options.pullRequest?.body);
762
757
  const pullRequest = await upsertPullRequest({
763
758
  owner,
764
759
  repo,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ucdjs/release-scripts",
3
- "version": "0.1.0-beta.2",
3
+ "version": "0.1.0-beta.3",
4
4
  "description": "@ucdjs release scripts",
5
5
  "type": "module",
6
6
  "license": "MIT",