bunset 1.0.12 → 1.0.13

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.13
4
+
5
+ ### Bug Fixes
6
+
7
+ - show version and notes in commit message
8
+
9
+ ### Refactors
10
+
11
+ - update buildReleaseNotes to accept iterable entries
12
+
13
+ ### Chores
14
+
15
+ - update deps
16
+
17
+ ### Updated Dependencies
18
+
19
+ - `@types/bun`: 1.3.14
20
+
3
21
  ## 1.0.12
4
22
 
5
23
  ### Bug Fixes
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "bunset",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "module": "src/index.ts",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "bunset": "src/index.ts"
8
8
  },
9
9
  "devDependencies": {
10
- "@types/bun": "1.3.13"
10
+ "@types/bun": "1.3.14"
11
11
  },
12
12
  "peerDependencies": {
13
13
  "typescript": "^6.0.3"
package/src/changelog.ts CHANGED
@@ -85,10 +85,10 @@ export function buildChangelogEntry(
85
85
  }
86
86
 
87
87
  export function buildReleaseNotes(
88
- entries: { pkgName: string; entry: string }[],
88
+ entries: Iterable<{ pkgName: string; entry: string }>,
89
89
  ): string {
90
90
  const stripVersion = (e: string) => e.replace(/^## [^\n]*\n+/, "");
91
- const nonEmpty = entries.filter(({ entry }) => stripVersion(entry).trim() !== "");
91
+ const nonEmpty = [...entries].filter(({ entry }) => stripVersion(entry).trim() !== "");
92
92
  if (nonEmpty.length === 0) return "";
93
93
  if (nonEmpty.length === 1) return stripVersion(nonEmpty[0]!.entry);
94
94
  return nonEmpty
package/src/index.ts CHANGED
@@ -268,8 +268,10 @@ if (options.dryRun) {
268
268
  const msg =
269
269
  packages.length === 1
270
270
  ? `chore: release ${packages[0]!.name}@${releaseVersion}`
271
- : `chore: release ${packages.length} packages`;
272
- console.log(`Would commit: ${msg}`);
271
+ : `chore: release ${releaseVersion} for ${packages.length} packages`;
272
+
273
+ const notes = buildReleaseNotes([...tagEntries.values()].flat());
274
+ console.log(`Would commit: ${msg}\n\n${notes}`);
273
275
  } else {
274
276
  console.log("Will not commit (--commit not set).");
275
277
  }
@@ -367,12 +369,14 @@ changedFiles.push(`${cwd}/bun.lock`);
367
369
  debug("updated bun.lock");
368
370
 
369
371
  if (options.commit) {
372
+ const releaseVersion = (await Bun.file(packages[0]!.packageJsonPath).json()).version;
370
373
  const msg =
371
374
  packages.length === 1
372
- ? `chore: release ${packages[0]!.name}@${(await Bun.file(packages[0]!.packageJsonPath).json()).version}`
373
- : `chore: release ${packages.length} packages`;
374
- await commitAndTag(cwd, msg, options.tag ? uniqueTags : [], changedFiles);
375
- console.log(`Committed: ${msg}`);
375
+ ? `chore: release ${packages[0]!.name}@${releaseVersion}`
376
+ : `chore: release ${releaseVersion} for ${packages.length} packages`;
377
+ const notes = buildReleaseNotes([...tagEntries.values()].flat());
378
+ await commitAndTag(cwd, msg + "\n\n" + notes, options.tag ? uniqueTags : [], changedFiles);
379
+ console.log(`Committed: ${msg}\n\n${notes}`);
376
380
  if (uniqueTags.length > 0) {
377
381
  console.log(`Tagged: ${uniqueTags.join(", ")}`);
378
382
  }