bumpp 8.2.0 → 9.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.
@@ -1,36 +1,23 @@
1
1
  import {
2
- ProgressEvent,
3
2
  __toESM,
4
- init_esm_shims,
5
3
  isReleaseType,
6
- require_log_symbols,
4
+ log_symbols_default,
5
+ require_picocolors,
7
6
  versionBump
8
- } from "../chunk-DW6HTJ47.mjs";
9
-
10
- // src/cli/index.ts
11
- init_esm_shims();
12
- var import_log_symbols = __toESM(require_log_symbols());
7
+ } from "../chunk-3GMLM6MJ.mjs";
13
8
 
14
9
  // package.json
15
- var version = "8.2.0";
16
-
17
- // src/cli/exit-code.ts
18
- init_esm_shims();
19
- var ExitCode = /* @__PURE__ */ ((ExitCode2) => {
20
- ExitCode2[ExitCode2["Success"] = 0] = "Success";
21
- ExitCode2[ExitCode2["FatalError"] = 1] = "FatalError";
22
- ExitCode2[ExitCode2["InvalidArgument"] = 9] = "InvalidArgument";
23
- return ExitCode2;
24
- })(ExitCode || {});
10
+ var version = "9.0.0";
25
11
 
26
12
  // src/cli/parse-args.ts
27
- init_esm_shims();
13
+ var import_picocolors = __toESM(require_picocolors());
28
14
  import { valid as isValidVersion } from "semver";
29
15
  import cac from "cac";
30
16
  function parseArgs() {
17
+ var _a;
31
18
  try {
32
19
  const cli = cac("bumpp");
33
- 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();
20
+ 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("-r, --recursive", "Bump package.json files recursively", { default: false }).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();
34
21
  const result = cli.parse();
35
22
  const args = result.options;
36
23
  const parsedArgs = {
@@ -45,9 +32,10 @@ function parseArgs() {
45
32
  all: args.all,
46
33
  confirm: !args.yes,
47
34
  noVerify: !args.verify,
48
- files: args["--"],
35
+ files: [...args["--"] || [], ...result.args],
49
36
  ignoreScripts: args.ignoreScripts,
50
- execute: args.execute
37
+ execute: args.execute,
38
+ recursive: !!args.recursive
51
39
  }
52
40
  };
53
41
  if (parsedArgs.options.files && parsedArgs.options.files.length > 0) {
@@ -57,6 +45,12 @@ function parseArgs() {
57
45
  parsedArgs.options.files.shift();
58
46
  }
59
47
  }
48
+ if (parsedArgs.options.recursive) {
49
+ if ((_a = parsedArgs.options.files) == null ? void 0 : _a.length)
50
+ console.log(import_picocolors.default.yellow("The --recursive option is ignored when files are specified"));
51
+ else
52
+ parsedArgs.options.files = ["package.json", "package-lock.json", "packages/**/package.json"];
53
+ }
60
54
  return parsedArgs;
61
55
  } catch (error) {
62
56
  return errorHandler(error);
@@ -90,22 +84,22 @@ async function main() {
90
84
  function progress({ event, script, updatedFiles, skippedFiles, newVersion }) {
91
85
  switch (event) {
92
86
  case "file updated" /* FileUpdated */:
93
- console.log(import_log_symbols.success, `Updated ${updatedFiles.pop()} to ${newVersion}`);
87
+ console.log(log_symbols_default.success, `Updated ${updatedFiles.pop()} to ${newVersion}`);
94
88
  break;
95
89
  case "file skipped" /* FileSkipped */:
96
- console.log(import_log_symbols.info, `${skippedFiles.pop()} did not need to be updated`);
90
+ console.log(log_symbols_default.info, `${skippedFiles.pop()} did not need to be updated`);
97
91
  break;
98
92
  case "git commit" /* GitCommit */:
99
- console.log(import_log_symbols.success, "Git commit");
93
+ console.log(log_symbols_default.success, "Git commit");
100
94
  break;
101
95
  case "git tag" /* GitTag */:
102
- console.log(import_log_symbols.success, "Git tag");
96
+ console.log(log_symbols_default.success, "Git tag");
103
97
  break;
104
98
  case "git push" /* GitPush */:
105
- console.log(import_log_symbols.success, "Git push");
99
+ console.log(log_symbols_default.success, "Git push");
106
100
  break;
107
101
  case "npm script" /* NpmScript */:
108
- console.log(import_log_symbols.success, `Npm run ${script}`);
102
+ console.log(log_symbols_default.success, `Npm run ${script}`);
109
103
  break;
110
104
  }
111
105
  }
package/dist/index.d.ts CHANGED
@@ -170,6 +170,12 @@ interface VersionBumpOptions {
170
170
  * Excute additional command after bumping and before commiting
171
171
  */
172
172
  execute?: string;
173
+ /**
174
+ * Bump the files recursively for monorepo. Only works without `files` option.
175
+ *
176
+ * @default false
177
+ */
178
+ recursive?: boolean;
173
179
  }
174
180
  /**
175
181
  * Options for the command-line interface.
@@ -232,7 +238,7 @@ interface BumpRelease {
232
238
  /**
233
239
  * One of the possible Release types.
234
240
  */
235
- declare type Release = VersionRelease | PromptRelease | BumpRelease;
241
+ type Release = VersionRelease | PromptRelease | BumpRelease;
236
242
  /**
237
243
  * Normalized and sanitized options
238
244
  */