bumpp 7.2.0 → 8.0.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.
@@ -5,7 +5,7 @@ import {
5
5
  isReleaseType,
6
6
  require_log_symbols,
7
7
  versionBump
8
- } from "../chunk-2TP63A7S.mjs";
8
+ } from "../chunk-HM6FRF4P.mjs";
9
9
 
10
10
  // src/cli/index.ts
11
11
  init_esm_shims();
@@ -13,7 +13,7 @@ var import_log_symbols = __toESM(require_log_symbols());
13
13
 
14
14
  // package.json
15
15
  var name = "bumpp";
16
- var version = "7.2.0";
16
+ var version = "8.0.0";
17
17
  var description = "Automatically (or with prompts) bump your version number, commit changes, tag, and push to Git";
18
18
 
19
19
  // src/cli/exit-code.ts
@@ -104,25 +104,14 @@ ${usageText}`;
104
104
 
105
105
  // src/cli/parse-args.ts
106
106
  init_esm_shims();
107
- import commandLineArgs from "command-line-args";
108
107
  import { valid as isValidVersion } from "semver";
108
+ import cac from "cac";
109
109
  function parseArgs(argv) {
110
110
  try {
111
- let args = commandLineArgs([
112
- { name: "preid", type: String },
113
- { name: "commit", alias: "c", type: String },
114
- { name: "tag", alias: "t", type: String },
115
- { name: "push", alias: "p", type: Boolean },
116
- { name: "all", alias: "a", type: Boolean },
117
- { name: "no-verify", type: Boolean },
118
- { name: "quiet", alias: "q", type: Boolean },
119
- { name: "version", alias: "v", type: Boolean },
120
- { name: "help", alias: "h", type: Boolean },
121
- { name: "ignore-scripts", type: Boolean },
122
- { name: "execute", alias: "x", type: String },
123
- { name: "files", type: String, multiple: true, defaultOption: true }
124
- ], { argv });
125
- let parsedArgs = {
111
+ const cli = cac("bumpp");
112
+ cli.version(version).usage("[...files]").option("--preid <preid>", "ID for prerelease").option("--all", "Include all files").option("-c, --commit [msg]", "Commit message", { default: true }).option("-t, --tag [tag]", "Tag name", { default: true }).option("-p, --push", "Push to remote", { default: true }).option("-y, --yes", "Skip confirmation").option("--no-verify", "Skip git verification").option("--ignore-scripts", "Ignore scripts", { default: false }).option("-q, --quiet", "Quiet mode").option("-v, --version <version>", "Tagert version").option("-x, --execute <command>", "Commands to execute after version bumps").help();
113
+ const args = cli.parse(argv).options;
114
+ const parsedArgs = {
126
115
  help: args.help,
127
116
  version: args.version,
128
117
  quiet: args.quiet,
@@ -132,23 +121,15 @@ function parseArgs(argv) {
132
121
  tag: args.tag,
133
122
  push: args.push,
134
123
  all: args.all,
135
- noVerify: args["no-verify"],
136
- files: args.files,
137
- ignoreScripts: args["ignore-scripts"],
124
+ confirm: !args.yes,
125
+ noVerify: !args.verify,
126
+ files: args["--"],
127
+ ignoreScripts: args.ignoreScripts,
138
128
  execute: args.execute
139
129
  }
140
130
  };
141
- if (args.preid === null) {
142
- throw new Error('The --preid option requires a value, such as "alpha", "beta", etc.');
143
- }
144
- if (args.commit === null) {
145
- parsedArgs.options.commit = true;
146
- }
147
- if (args.tag === null) {
148
- parsedArgs.options.tag = true;
149
- }
150
131
  if (parsedArgs.options.files && parsedArgs.options.files.length > 0) {
151
- let firstArg = parsedArgs.options.files[0];
132
+ const firstArg = parsedArgs.options.files[0];
152
133
  if (firstArg === "prompt" || isReleaseType(firstArg) || isValidVersion(firstArg)) {
153
134
  parsedArgs.options.release = firstArg;
154
135
  parsedArgs.options.files.shift();
@@ -170,7 +151,7 @@ async function main(args) {
170
151
  try {
171
152
  process.on("uncaughtException", errorHandler2);
172
153
  process.on("unhandledRejection", errorHandler2);
173
- let { help, version: version2, quiet, options } = parseArgs(args);
154
+ const { help, version: version2, quiet, options } = parseArgs(args);
174
155
  if (help) {
175
156
  console.log(helpText);
176
157
  process.exit(0 /* Success */);
@@ -178,9 +159,8 @@ async function main(args) {
178
159
  console.log(version);
179
160
  process.exit(0 /* Success */);
180
161
  } else {
181
- if (!quiet) {
162
+ if (!quiet)
182
163
  options.progress = progress;
183
- }
184
164
  await versionBump(options);
185
165
  }
186
166
  } catch (error) {
@@ -211,9 +191,8 @@ function progress({ event, script, updatedFiles, skippedFiles, newVersion }) {
211
191
  }
212
192
  function errorHandler2(error) {
213
193
  let message = error.message || String(error);
214
- if (process.env.DEBUG || process.env.NODE_ENV === "development") {
194
+ if (process.env.DEBUG || process.env.NODE_ENV === "development")
215
195
  message = error.stack || message;
216
- }
217
196
  console.error(message);
218
197
  process.exit(1 /* FatalError */);
219
198
  }
package/dist/index.d.ts CHANGED
@@ -119,6 +119,12 @@ interface VersionBumpOptions {
119
119
  * Defaults to `false`.
120
120
  */
121
121
  all?: boolean;
122
+ /**
123
+ * Prompt for confirmation
124
+ *
125
+ * @default false
126
+ */
127
+ confirm?: boolean;
122
128
  /**
123
129
  * Indicates whether to bypass git commit hooks (`git commit --no-verify`).
124
130
  *