bunset 1.0.7 → 1.0.8

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,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.8
4
+
5
+ ### Features
6
+
7
+ - add --push option and proceed with empty changelog entries
8
+
3
9
  ## 1.0.7
4
10
 
5
11
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunset",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "module": "src/index.ts",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.ts CHANGED
@@ -18,6 +18,7 @@ Options:
18
18
  --per-package-tags Use package-scoped tags (pkg@version) instead of prefixed
19
19
  --tag-prefix <str> Tag prefix (auto-detected from last tag, or "v" if no tags)
20
20
  --sections <list> Comma-separated changelog sections (default: feat,fix,perf)
21
+ --push Push commit and tags to remote after tagging
21
22
  --dry-run Preview changes without writing files, committing, or tagging
22
23
  --debug Show detailed inclusion/exclusion reasoning (implies --dry-run)
23
24
  --no-filter-by-package
@@ -73,6 +74,7 @@ Config file (.bunset.toml):
73
74
  per-package-tags = false # pkg@version tags (monorepo)
74
75
  tag-prefix = "v" # tag prefix (default: auto-detect)
75
76
  sections = ["feat", "fix", "perf"] # changelog sections and order
77
+ push = false # push after tagging (default: false)
76
78
  dry-run = false # preview without writing
77
79
  debug = false # detailed reasoning (implies dry-run)
78
80
  filter-by-package = true # per-package filtering (monorepo)`);
@@ -96,6 +98,7 @@ export function resolveOptions(
96
98
  tag: { type: "boolean" },
97
99
  "per-package-tags": { type: "boolean", default: false },
98
100
  sections: { type: "string" },
101
+ push: { type: "boolean", default: false },
99
102
  "dry-run": { type: "boolean", default: false },
100
103
  "filter-by-package": { type: "boolean", default: true },
101
104
  "tag-prefix": { type: "string" },
@@ -134,6 +137,7 @@ export function resolveOptions(
134
137
  ?? config.sections
135
138
  ?? DEFAULT_SECTIONS;
136
139
 
140
+ const push = values.push ? true : (config.push ?? false);
137
141
  const debug = values.debug ? true : (config.debug ?? false);
138
142
  const dryRun = debug || values["dry-run"] ? true : (config.dryRun ?? false);
139
143
 
@@ -146,11 +150,11 @@ export function resolveOptions(
146
150
  ?? null;
147
151
 
148
152
  if (bump && scope && commit !== null && tag !== null) {
149
- return { scope, bump, commit, tag, perPackageTags, sections, dryRun, filterByPackage, tagPrefix, debug };
153
+ return { scope, bump, commit, tag, perPackageTags, sections, dryRun, filterByPackage, tagPrefix, push, debug };
150
154
  }
151
155
 
152
156
  return promptForMissing(
153
- { commit, tag, perPackageTags, sections, dryRun, filterByPackage, tagPrefix, debug },
157
+ { commit, tag, perPackageTags, sections, dryRun, filterByPackage, tagPrefix, push, debug },
154
158
  bump,
155
159
  scope,
156
160
  isWs,
@@ -192,6 +196,7 @@ interface MergedDefaults {
192
196
  dryRun: boolean;
193
197
  filterByPackage: boolean;
194
198
  tagPrefix: string | null;
199
+ push: boolean;
195
200
  debug: boolean;
196
201
  }
197
202
 
package/src/config.ts CHANGED
@@ -49,6 +49,10 @@ export async function loadConfig(
49
49
  config.tagPrefix = raw["tag-prefix"];
50
50
  }
51
51
 
52
+ if (typeof raw.push === "boolean") {
53
+ config.push = raw.push;
54
+ }
55
+
52
56
  if (typeof raw.debug === "boolean") {
53
57
  config.debug = raw.debug;
54
58
  }
package/src/git.ts CHANGED
@@ -79,3 +79,13 @@ export async function commitAndTag(
79
79
  console.warn(`⚠ Skipped existing tags: ${skipped.join(", ")}`);
80
80
  }
81
81
  }
82
+
83
+ export async function gitPush(
84
+ cwd: string,
85
+ tags: string[] = [],
86
+ ): Promise<void> {
87
+ await $`git -C ${cwd} push`.quiet();
88
+ if (tags.length > 0) {
89
+ await $`git -C ${cwd} push --tags`.quiet();
90
+ }
91
+ }
package/src/index.ts CHANGED
@@ -14,6 +14,7 @@ import {
14
14
  getCommitsSince,
15
15
  getCommitFiles,
16
16
  commitAndTag,
17
+ gitPush,
17
18
  } from "./git.ts";
18
19
  import { getUpdatedDependencies } from "./deps.ts";
19
20
  import {
@@ -115,11 +116,6 @@ if (shouldFilter) {
115
116
 
116
117
  const globalGroups = groupCommits(parsed);
117
118
 
118
- if (options.sections.every((type) => globalGroups[type].length === 0)) {
119
- console.log("No categorized commits found. Nothing to do.");
120
- process.exit(0);
121
- }
122
-
123
119
  let packages =
124
120
  options.scope === "changed"
125
121
  ? await getChangedPackages(cwd, allPackages, lastTag)
@@ -244,6 +240,10 @@ if (options.dryRun) {
244
240
  console.log("Will not tag (--tag not set).");
245
241
  }
246
242
 
243
+ if (options.push) {
244
+ console.log("Would push commit and tags to remote.");
245
+ }
246
+
247
247
  console.log(`\nFiles that would be modified (${filesToCommit.length}):`);
248
248
  for (const f of filesToCommit) {
249
249
  console.log(` ${f}`);
@@ -315,6 +315,11 @@ if (options.commit) {
315
315
  if (uniqueTags.length > 0) {
316
316
  console.log(`Tagged: ${uniqueTags.join(", ")}`);
317
317
  }
318
+
319
+ if (options.push) {
320
+ await gitPush(cwd, uniqueTags);
321
+ console.log("Pushed to remote.");
322
+ }
318
323
  }
319
324
 
320
325
  console.log("Done.");
package/src/types.ts CHANGED
@@ -23,6 +23,7 @@ export interface CliOptions {
23
23
  dryRun: boolean;
24
24
  filterByPackage: boolean;
25
25
  tagPrefix: string | null;
26
+ push: boolean;
26
27
  debug: boolean;
27
28
  }
28
29