bumpp 9.7.1 → 9.8.1

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/README.md CHANGED
@@ -7,14 +7,13 @@ Forked from [`version-bump-prompt`](https://github.com/JS-DevTools/version-bump-
7
7
  ###### Changes in this fork
8
8
 
9
9
  - Renamed to `bumpp` - so you can use `npx bumpp` directly.
10
- - Ships ESM and CJS bundles.
11
- - Add a new argument `--execute` to execute the command before committing.
12
10
  - Use the current version's `preid` when available.
13
11
  - Confirmation before bumping.
14
12
  - Enable `--commit` `--tag` `--push` by default. (opt-out by `--no-push`, etc.)
15
- - `--sign` to sign the commit and tag.
16
13
  - `-r` or `--recursive` to bump all packages in the monorepo.
14
+ - `--execute` to execute the command, or execute a function before committing.
17
15
  - Conventional Commits by default.
16
+ - Ships ESM and CJS bundles.
18
17
  - Supports config file `bump.config.ts`:
19
18
 
20
19
  ```ts
@@ -22,12 +22,6 @@ var __spreadValues = (a, b) => {
22
22
  return a;
23
23
  };
24
24
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
26
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
27
- }) : x)(function(x) {
28
- if (typeof require !== "undefined") return require.apply(this, arguments);
29
- throw Error('Dynamic require of "' + x + '" is not supported');
30
- });
31
25
  var __objRest = (source, exclude) => {
32
26
  var target = {};
33
27
  for (var prop in source)
@@ -40,7 +34,7 @@ var __objRest = (source, exclude) => {
40
34
  }
41
35
  return target;
42
36
  };
43
- var __commonJS = (cb, mod) => function __require2() {
37
+ var __commonJS = (cb, mod) => function __require() {
44
38
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
45
39
  };
46
40
  var __copyProps = (to, from, except, desc) => {
@@ -60,20 +54,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
60
54
  mod
61
55
  ));
62
56
 
63
- // node_modules/.pnpm/picocolors@1.1.0/node_modules/picocolors/picocolors.js
57
+ // node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
64
58
  var require_picocolors = __commonJS({
65
- "node_modules/.pnpm/picocolors@1.1.0/node_modules/picocolors/picocolors.js"(exports, module) {
66
- var argv = process.argv || [];
67
- var env2 = process.env;
68
- var isColorSupported = !("NO_COLOR" in env2 || argv.includes("--no-color")) && ("FORCE_COLOR" in env2 || argv.includes("--color") || process.platform === "win32" || __require != null && __require("tty").isatty(1) && env2.TERM !== "dumb" || "CI" in env2);
59
+ "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports, module) {
60
+ var p = process || {};
61
+ var argv = p.argv || [];
62
+ var env2 = p.env || {};
63
+ var isColorSupported = !(!!env2.NO_COLOR || argv.includes("--no-color")) && (!!env2.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env2.TERM !== "dumb" || !!env2.CI);
69
64
  var formatter = (open, close, replace = open) => (input) => {
70
- let string = "" + input;
71
- let index = string.indexOf(close, open.length);
65
+ let string = "" + input, index = string.indexOf(close, open.length);
72
66
  return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
73
67
  };
74
68
  var replaceClose = (string, close, replace, index) => {
75
- let result = "";
76
- let cursor = 0;
69
+ let result = "", cursor = 0;
77
70
  do {
78
71
  result += string.substring(cursor, index) + replace;
79
72
  cursor = index + close.length;
@@ -82,50 +75,50 @@ var require_picocolors = __commonJS({
82
75
  return result + string.substring(cursor);
83
76
  };
84
77
  var createColors = (enabled = isColorSupported) => {
85
- let init = enabled ? formatter : () => String;
78
+ let f = enabled ? formatter : () => String;
86
79
  return {
87
80
  isColorSupported: enabled,
88
- reset: init("\x1B[0m", "\x1B[0m"),
89
- bold: init("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
90
- dim: init("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
91
- italic: init("\x1B[3m", "\x1B[23m"),
92
- underline: init("\x1B[4m", "\x1B[24m"),
93
- inverse: init("\x1B[7m", "\x1B[27m"),
94
- hidden: init("\x1B[8m", "\x1B[28m"),
95
- strikethrough: init("\x1B[9m", "\x1B[29m"),
96
- black: init("\x1B[30m", "\x1B[39m"),
97
- red: init("\x1B[31m", "\x1B[39m"),
98
- green: init("\x1B[32m", "\x1B[39m"),
99
- yellow: init("\x1B[33m", "\x1B[39m"),
100
- blue: init("\x1B[34m", "\x1B[39m"),
101
- magenta: init("\x1B[35m", "\x1B[39m"),
102
- cyan: init("\x1B[36m", "\x1B[39m"),
103
- white: init("\x1B[37m", "\x1B[39m"),
104
- gray: init("\x1B[90m", "\x1B[39m"),
105
- bgBlack: init("\x1B[40m", "\x1B[49m"),
106
- bgRed: init("\x1B[41m", "\x1B[49m"),
107
- bgGreen: init("\x1B[42m", "\x1B[49m"),
108
- bgYellow: init("\x1B[43m", "\x1B[49m"),
109
- bgBlue: init("\x1B[44m", "\x1B[49m"),
110
- bgMagenta: init("\x1B[45m", "\x1B[49m"),
111
- bgCyan: init("\x1B[46m", "\x1B[49m"),
112
- bgWhite: init("\x1B[47m", "\x1B[49m"),
113
- blackBright: init("\x1B[90m", "\x1B[39m"),
114
- redBright: init("\x1B[91m", "\x1B[39m"),
115
- greenBright: init("\x1B[92m", "\x1B[39m"),
116
- yellowBright: init("\x1B[93m", "\x1B[39m"),
117
- blueBright: init("\x1B[94m", "\x1B[39m"),
118
- magentaBright: init("\x1B[95m", "\x1B[39m"),
119
- cyanBright: init("\x1B[96m", "\x1B[39m"),
120
- whiteBright: init("\x1B[97m", "\x1B[39m"),
121
- bgBlackBright: init("\x1B[100m", "\x1B[49m"),
122
- bgRedBright: init("\x1B[101m", "\x1B[49m"),
123
- bgGreenBright: init("\x1B[102m", "\x1B[49m"),
124
- bgYellowBright: init("\x1B[103m", "\x1B[49m"),
125
- bgBlueBright: init("\x1B[104m", "\x1B[49m"),
126
- bgMagentaBright: init("\x1B[105m", "\x1B[49m"),
127
- bgCyanBright: init("\x1B[106m", "\x1B[49m"),
128
- bgWhiteBright: init("\x1B[107m", "\x1B[49m")
81
+ reset: f("\x1B[0m", "\x1B[0m"),
82
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
83
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
84
+ italic: f("\x1B[3m", "\x1B[23m"),
85
+ underline: f("\x1B[4m", "\x1B[24m"),
86
+ inverse: f("\x1B[7m", "\x1B[27m"),
87
+ hidden: f("\x1B[8m", "\x1B[28m"),
88
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
89
+ black: f("\x1B[30m", "\x1B[39m"),
90
+ red: f("\x1B[31m", "\x1B[39m"),
91
+ green: f("\x1B[32m", "\x1B[39m"),
92
+ yellow: f("\x1B[33m", "\x1B[39m"),
93
+ blue: f("\x1B[34m", "\x1B[39m"),
94
+ magenta: f("\x1B[35m", "\x1B[39m"),
95
+ cyan: f("\x1B[36m", "\x1B[39m"),
96
+ white: f("\x1B[37m", "\x1B[39m"),
97
+ gray: f("\x1B[90m", "\x1B[39m"),
98
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
99
+ bgRed: f("\x1B[41m", "\x1B[49m"),
100
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
101
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
102
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
103
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
104
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
105
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
106
+ blackBright: f("\x1B[90m", "\x1B[39m"),
107
+ redBright: f("\x1B[91m", "\x1B[39m"),
108
+ greenBright: f("\x1B[92m", "\x1B[39m"),
109
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
110
+ blueBright: f("\x1B[94m", "\x1B[39m"),
111
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
112
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
113
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
114
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
115
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
116
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
117
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
118
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
119
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
120
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
121
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
129
122
  };
130
123
  };
131
124
  module.exports = createColors();
@@ -320,9 +313,9 @@ var ansiStyles = assembleStyles();
320
313
  var ansi_styles_default = ansiStyles;
321
314
 
322
315
  // node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js
323
- import process2 from "process";
324
- import os from "os";
325
- import tty from "tty";
316
+ import process2 from "node:process";
317
+ import os from "node:os";
318
+ import tty from "node:tty";
326
319
  function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
327
320
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
328
321
  const position = argv.indexOf(prefix + flag);
@@ -621,7 +614,7 @@ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
621
614
  var source_default = chalk;
622
615
 
623
616
  // node_modules/.pnpm/is-unicode-supported@1.3.0/node_modules/is-unicode-supported/index.js
624
- import process3 from "process";
617
+ import process3 from "node:process";
625
618
  function isUnicodeSupported() {
626
619
  if (process3.platform !== "win32") {
627
620
  return process3.env.TERM !== "linux";
@@ -673,7 +666,7 @@ var NpmScript = /* @__PURE__ */ ((NpmScript2) => {
673
666
  })(NpmScript || {});
674
667
 
675
668
  // src/version-bump.ts
676
- import process6 from "process";
669
+ import process6 from "node:process";
677
670
  import * as ezSpawn4 from "@jsdevtools/ez-spawn";
678
671
  var import_picocolors3 = __toESM(require_picocolors());
679
672
  import prompts2 from "prompts";
@@ -682,8 +675,8 @@ import prompts2 from "prompts";
682
675
  import { valid as isValidVersion } from "semver";
683
676
 
684
677
  // src/fs.ts
685
- import fs from "fs";
686
- import path from "path";
678
+ import fs from "node:fs";
679
+ import path from "node:path";
687
680
  import * as jsonc from "jsonc-parser";
688
681
  async function readJsoncFile(name, cwd) {
689
682
  const file = await readTextFile(name, cwd);
@@ -777,7 +770,7 @@ async function readVersion(file, cwd) {
777
770
 
778
771
  // src/get-new-version.ts
779
772
  var import_picocolors2 = __toESM(require_picocolors());
780
- import process4 from "process";
773
+ import process4 from "node:process";
781
774
  import prompts from "prompts";
782
775
  import semver, { clean as cleanVersion, valid as isValidVersion2, SemVer } from "semver";
783
776
 
@@ -1049,11 +1042,11 @@ function formatVersionString(template, newVersion) {
1049
1042
  }
1050
1043
 
1051
1044
  // src/normalize-options.ts
1052
- import fsSync from "fs";
1053
- import fs2 from "fs/promises";
1054
- import process5 from "process";
1055
- import fg from "fast-glob";
1045
+ import fsSync from "node:fs";
1046
+ import fs2 from "node:fs/promises";
1047
+ import process5 from "node:process";
1056
1048
  import yaml from "js-yaml";
1049
+ import { glob } from "tinyglobby";
1057
1050
  async function normalizeOptions(raw) {
1058
1051
  var _a, _b, _d;
1059
1052
  const preid = typeof raw.preid === "string" ? raw.preid : "beta";
@@ -1105,11 +1098,12 @@ async function normalizeOptions(raw) {
1105
1098
  } else {
1106
1099
  raw.files = ((_b = raw.files) == null ? void 0 : _b.length) ? raw.files : ["package.json", "package-lock.json", "jsr.json", "jsr.jsonc", "deno.json", "deno.jsonc"];
1107
1100
  }
1108
- const files = await fg(
1101
+ const files = await glob(
1109
1102
  raw.files,
1110
1103
  {
1111
1104
  cwd,
1112
1105
  onlyFiles: true,
1106
+ expandDirectories: false,
1113
1107
  ignore: [
1114
1108
  "**/{.git,node_modules,bower_components,__tests__,fixtures,fixture}/**"
1115
1109
  ]
@@ -1232,8 +1226,8 @@ function hasScript(manifest, script) {
1232
1226
  }
1233
1227
 
1234
1228
  // src/update-files.ts
1235
- import { existsSync } from "fs";
1236
- import * as path2 from "path";
1229
+ import { existsSync } from "node:fs";
1230
+ import * as path2 from "node:path";
1237
1231
  async function updateFiles(operation) {
1238
1232
  const { files } = operation.options;
1239
1233
  for (const relPath of files) {
@@ -1327,9 +1321,13 @@ async function versionBump(arg = {}) {
1327
1321
  await runNpmScript("preversion" /* PreVersion */, operation);
1328
1322
  await updateFiles(operation);
1329
1323
  if (operation.options.execute) {
1330
- console.log(log_symbols_default.info, "Executing script", operation.options.execute);
1331
- await ezSpawn4.async(operation.options.execute, { stdio: "inherit" });
1332
- console.log(log_symbols_default.success, "Script finished");
1324
+ if (typeof operation.options.execute === "function") {
1325
+ await operation.options.execute(operation);
1326
+ } else {
1327
+ console.log(log_symbols_default.info, "Executing script", operation.options.execute);
1328
+ await ezSpawn4.async(operation.options.execute, { stdio: "inherit" });
1329
+ console.log(log_symbols_default.success, "Script finished");
1330
+ }
1333
1331
  }
1334
1332
  await runNpmScript("version" /* Version */, operation);
1335
1333
  await gitCommit(operation);
@@ -1346,7 +1344,7 @@ function printSummary(operation) {
1346
1344
  if (operation.options.tag)
1347
1345
  console.log(` tag ${import_picocolors3.default.bold(formatVersionString(operation.options.tag.name, operation.state.newVersion))}`);
1348
1346
  if (operation.options.execute)
1349
- console.log(` execute ${import_picocolors3.default.bold(operation.options.execute)}`);
1347
+ console.log(` execute ${import_picocolors3.default.bold(typeof operation.options.execute === "function" ? "function" : operation.options.execute)}`);
1350
1348
  if (operation.options.push)
1351
1349
  console.log(` push ${import_picocolors3.default.cyan(import_picocolors3.default.bold("yes"))}`);
1352
1350
  console.log();
@@ -1364,8 +1362,8 @@ async function versionBumpInfo(arg = {}) {
1364
1362
  }
1365
1363
 
1366
1364
  // src/config.ts
1367
- import { dirname } from "path";
1368
- import process7 from "process";
1365
+ import { dirname } from "node:path";
1366
+ import process7 from "node:process";
1369
1367
  import { loadConfig } from "c12";
1370
1368
  import escalade from "escalade/sync";
1371
1369
  var bumpConfigDefaults = {
package/dist/cli/index.js CHANGED
@@ -58,20 +58,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
58
58
  ));
59
59
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
60
60
 
61
- // node_modules/.pnpm/picocolors@1.1.0/node_modules/picocolors/picocolors.js
61
+ // node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
62
62
  var require_picocolors = __commonJS({
63
- "node_modules/.pnpm/picocolors@1.1.0/node_modules/picocolors/picocolors.js"(exports2, module2) {
64
- var argv = process.argv || [];
65
- var env2 = process.env;
66
- var isColorSupported = !("NO_COLOR" in env2 || argv.includes("--no-color")) && ("FORCE_COLOR" in env2 || argv.includes("--color") || process.platform === "win32" || require != null && require("tty").isatty(1) && env2.TERM !== "dumb" || "CI" in env2);
63
+ "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports2, module2) {
64
+ var p = process || {};
65
+ var argv = p.argv || [];
66
+ var env2 = p.env || {};
67
+ var isColorSupported = !(!!env2.NO_COLOR || argv.includes("--no-color")) && (!!env2.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env2.TERM !== "dumb" || !!env2.CI);
67
68
  var formatter = (open, close, replace = open) => (input) => {
68
- let string = "" + input;
69
- let index = string.indexOf(close, open.length);
69
+ let string = "" + input, index = string.indexOf(close, open.length);
70
70
  return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
71
71
  };
72
72
  var replaceClose = (string, close, replace, index) => {
73
- let result = "";
74
- let cursor = 0;
73
+ let result = "", cursor = 0;
75
74
  do {
76
75
  result += string.substring(cursor, index) + replace;
77
76
  cursor = index + close.length;
@@ -80,50 +79,50 @@ var require_picocolors = __commonJS({
80
79
  return result + string.substring(cursor);
81
80
  };
82
81
  var createColors = (enabled = isColorSupported) => {
83
- let init = enabled ? formatter : () => String;
82
+ let f = enabled ? formatter : () => String;
84
83
  return {
85
84
  isColorSupported: enabled,
86
- reset: init("\x1B[0m", "\x1B[0m"),
87
- bold: init("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
88
- dim: init("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
89
- italic: init("\x1B[3m", "\x1B[23m"),
90
- underline: init("\x1B[4m", "\x1B[24m"),
91
- inverse: init("\x1B[7m", "\x1B[27m"),
92
- hidden: init("\x1B[8m", "\x1B[28m"),
93
- strikethrough: init("\x1B[9m", "\x1B[29m"),
94
- black: init("\x1B[30m", "\x1B[39m"),
95
- red: init("\x1B[31m", "\x1B[39m"),
96
- green: init("\x1B[32m", "\x1B[39m"),
97
- yellow: init("\x1B[33m", "\x1B[39m"),
98
- blue: init("\x1B[34m", "\x1B[39m"),
99
- magenta: init("\x1B[35m", "\x1B[39m"),
100
- cyan: init("\x1B[36m", "\x1B[39m"),
101
- white: init("\x1B[37m", "\x1B[39m"),
102
- gray: init("\x1B[90m", "\x1B[39m"),
103
- bgBlack: init("\x1B[40m", "\x1B[49m"),
104
- bgRed: init("\x1B[41m", "\x1B[49m"),
105
- bgGreen: init("\x1B[42m", "\x1B[49m"),
106
- bgYellow: init("\x1B[43m", "\x1B[49m"),
107
- bgBlue: init("\x1B[44m", "\x1B[49m"),
108
- bgMagenta: init("\x1B[45m", "\x1B[49m"),
109
- bgCyan: init("\x1B[46m", "\x1B[49m"),
110
- bgWhite: init("\x1B[47m", "\x1B[49m"),
111
- blackBright: init("\x1B[90m", "\x1B[39m"),
112
- redBright: init("\x1B[91m", "\x1B[39m"),
113
- greenBright: init("\x1B[92m", "\x1B[39m"),
114
- yellowBright: init("\x1B[93m", "\x1B[39m"),
115
- blueBright: init("\x1B[94m", "\x1B[39m"),
116
- magentaBright: init("\x1B[95m", "\x1B[39m"),
117
- cyanBright: init("\x1B[96m", "\x1B[39m"),
118
- whiteBright: init("\x1B[97m", "\x1B[39m"),
119
- bgBlackBright: init("\x1B[100m", "\x1B[49m"),
120
- bgRedBright: init("\x1B[101m", "\x1B[49m"),
121
- bgGreenBright: init("\x1B[102m", "\x1B[49m"),
122
- bgYellowBright: init("\x1B[103m", "\x1B[49m"),
123
- bgBlueBright: init("\x1B[104m", "\x1B[49m"),
124
- bgMagentaBright: init("\x1B[105m", "\x1B[49m"),
125
- bgCyanBright: init("\x1B[106m", "\x1B[49m"),
126
- bgWhiteBright: init("\x1B[107m", "\x1B[49m")
85
+ reset: f("\x1B[0m", "\x1B[0m"),
86
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
87
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
88
+ italic: f("\x1B[3m", "\x1B[23m"),
89
+ underline: f("\x1B[4m", "\x1B[24m"),
90
+ inverse: f("\x1B[7m", "\x1B[27m"),
91
+ hidden: f("\x1B[8m", "\x1B[28m"),
92
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
93
+ black: f("\x1B[30m", "\x1B[39m"),
94
+ red: f("\x1B[31m", "\x1B[39m"),
95
+ green: f("\x1B[32m", "\x1B[39m"),
96
+ yellow: f("\x1B[33m", "\x1B[39m"),
97
+ blue: f("\x1B[34m", "\x1B[39m"),
98
+ magenta: f("\x1B[35m", "\x1B[39m"),
99
+ cyan: f("\x1B[36m", "\x1B[39m"),
100
+ white: f("\x1B[37m", "\x1B[39m"),
101
+ gray: f("\x1B[90m", "\x1B[39m"),
102
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
103
+ bgRed: f("\x1B[41m", "\x1B[49m"),
104
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
105
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
106
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
107
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
108
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
109
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
110
+ blackBright: f("\x1B[90m", "\x1B[39m"),
111
+ redBright: f("\x1B[91m", "\x1B[39m"),
112
+ greenBright: f("\x1B[92m", "\x1B[39m"),
113
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
114
+ blueBright: f("\x1B[94m", "\x1B[39m"),
115
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
116
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
117
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
118
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
119
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
120
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
121
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
122
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
123
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
124
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
125
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
127
126
  };
128
127
  };
129
128
  module2.exports = createColors();
@@ -139,6 +138,7 @@ __export(cli_exports, {
139
138
  });
140
139
  module.exports = __toCommonJS(cli_exports);
141
140
  var import_node_process8 = __toESM(require("process"));
141
+ var ezSpawn5 = __toESM(require("@jsdevtools/ez-spawn"));
142
142
 
143
143
  // node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js
144
144
  var ANSI_BACKGROUND_OFFSET = 10;
@@ -652,12 +652,6 @@ var fallback = {
652
652
  var logSymbols = isUnicodeSupported() ? main : fallback;
653
653
  var log_symbols_default = logSymbols;
654
654
 
655
- // src/cli/index.ts
656
- var ezSpawn5 = __toESM(require("@jsdevtools/ez-spawn"));
657
-
658
- // package.json
659
- var version = "9.7.1";
660
-
661
655
  // src/version-bump.ts
662
656
  var import_node_process5 = __toESM(require("process"));
663
657
  var ezSpawn4 = __toESM(require("@jsdevtools/ez-spawn"));
@@ -1048,8 +1042,8 @@ function formatVersionString(template, newVersion) {
1048
1042
  var import_node_fs2 = __toESM(require("fs"));
1049
1043
  var import_promises = __toESM(require("fs/promises"));
1050
1044
  var import_node_process4 = __toESM(require("process"));
1051
- var import_fast_glob = __toESM(require("fast-glob"));
1052
1045
  var import_js_yaml = __toESM(require("js-yaml"));
1046
+ var import_tinyglobby = require("tinyglobby");
1053
1047
  async function normalizeOptions(raw) {
1054
1048
  var _a, _b, _d;
1055
1049
  const preid = typeof raw.preid === "string" ? raw.preid : "beta";
@@ -1101,11 +1095,12 @@ async function normalizeOptions(raw) {
1101
1095
  } else {
1102
1096
  raw.files = ((_b = raw.files) == null ? void 0 : _b.length) ? raw.files : ["package.json", "package-lock.json", "jsr.json", "jsr.jsonc", "deno.json", "deno.jsonc"];
1103
1097
  }
1104
- const files = await (0, import_fast_glob.default)(
1098
+ const files = await (0, import_tinyglobby.glob)(
1105
1099
  raw.files,
1106
1100
  {
1107
1101
  cwd,
1108
1102
  onlyFiles: true,
1103
+ expandDirectories: false,
1109
1104
  ignore: [
1110
1105
  "**/{.git,node_modules,bower_components,__tests__,fixtures,fixture}/**"
1111
1106
  ]
@@ -1323,9 +1318,13 @@ async function versionBump(arg = {}) {
1323
1318
  await runNpmScript("preversion" /* PreVersion */, operation);
1324
1319
  await updateFiles(operation);
1325
1320
  if (operation.options.execute) {
1326
- console.log(log_symbols_default.info, "Executing script", operation.options.execute);
1327
- await ezSpawn4.async(operation.options.execute, { stdio: "inherit" });
1328
- console.log(log_symbols_default.success, "Script finished");
1321
+ if (typeof operation.options.execute === "function") {
1322
+ await operation.options.execute(operation);
1323
+ } else {
1324
+ console.log(log_symbols_default.info, "Executing script", operation.options.execute);
1325
+ await ezSpawn4.async(operation.options.execute, { stdio: "inherit" });
1326
+ console.log(log_symbols_default.success, "Script finished");
1327
+ }
1329
1328
  }
1330
1329
  await runNpmScript("version" /* Version */, operation);
1331
1330
  await gitCommit(operation);
@@ -1342,7 +1341,7 @@ function printSummary(operation) {
1342
1341
  if (operation.options.tag)
1343
1342
  console.log(` tag ${import_picocolors3.default.bold(formatVersionString(operation.options.tag.name, operation.state.newVersion))}`);
1344
1343
  if (operation.options.execute)
1345
- console.log(` execute ${import_picocolors3.default.bold(operation.options.execute)}`);
1344
+ console.log(` execute ${import_picocolors3.default.bold(typeof operation.options.execute === "function" ? "function" : operation.options.execute)}`);
1346
1345
  if (operation.options.push)
1347
1346
  console.log(` push ${import_picocolors3.default.cyan(import_picocolors3.default.bold("yes"))}`);
1348
1347
  console.log();
@@ -1357,6 +1356,9 @@ var import_cac = __toESM(require("cac"));
1357
1356
  var import_picocolors4 = __toESM(require_picocolors());
1358
1357
  var import_semver3 = require("semver");
1359
1358
 
1359
+ // package.json
1360
+ var version = "9.8.1";
1361
+
1360
1362
  // src/config.ts
1361
1363
  var import_node_path2 = require("path");
1362
1364
  var import_node_process6 = __toESM(require("process"));
@@ -1435,6 +1437,7 @@ async function parseArgs() {
1435
1437
  ignoreScripts: args.ignoreScripts,
1436
1438
  currentVersion: args.currentVersion,
1437
1439
  execute: args.execute,
1440
+ printCommits: args.printCommits,
1438
1441
  recursive: args.recursive
1439
1442
  })
1440
1443
  };
@@ -1454,7 +1457,7 @@ async function parseArgs() {
1454
1457
  }
1455
1458
  function loadCliArgs(argv = import_node_process7.default.argv) {
1456
1459
  const cli = (0, import_cac.default)("bumpp");
1457
- cli.version(version).usage("[...files]").option("--preid <preid>", "ID for prerelease").option("--all", `Include all files (default: ${bumpConfigDefaults.all})`).option("--no-git-check", `Skip git check`, { default: bumpConfigDefaults.noGitCheck }).option("-c, --commit [msg]", "Commit message", { default: true }).option("--no-commit", "Skip commit", { default: false }).option("-t, --tag [tag]", "Tag name", { default: true }).option("--no-tag", "Skip tag", { default: false }).option("--sign", "Sign commit and tag").option("-p, --push", `Push to remote (default: ${bumpConfigDefaults.push})`).option("-y, --yes", `Skip confirmation (default: ${!bumpConfigDefaults.confirm})`).option("-r, --recursive", `Bump package.json files recursively (default: ${bumpConfigDefaults.recursive})`).option("--no-verify", "Skip git verification").option("--ignore-scripts", `Ignore scripts (default: ${bumpConfigDefaults.ignoreScripts})`).option("-q, --quiet", "Quiet mode").option("-v, --version <version>", "Target version").option("--current-version <version>", "Current version").option("--print-commits", "Print recent commits", { default: true }).option("-x, --execute <command>", "Commands to execute after version bumps").help();
1460
+ cli.version(version).usage("[...files]").option("--preid <preid>", "ID for prerelease").option("--all", `Include all files (default: ${bumpConfigDefaults.all})`).option("--no-git-check", `Skip git check`, { default: bumpConfigDefaults.noGitCheck }).option("-c, --commit [msg]", "Commit message", { default: true }).option("--no-commit", "Skip commit", { default: false }).option("-t, --tag [tag]", "Tag name", { default: true }).option("--no-tag", "Skip tag", { default: false }).option("--sign", "Sign commit and tag").option("-p, --push", `Push to remote (default: ${bumpConfigDefaults.push})`).option("-y, --yes", `Skip confirmation (default: ${!bumpConfigDefaults.confirm})`).option("-r, --recursive", `Bump package.json files recursively (default: ${bumpConfigDefaults.recursive})`).option("--no-verify", "Skip git verification").option("--ignore-scripts", `Ignore scripts (default: ${bumpConfigDefaults.ignoreScripts})`).option("-q, --quiet", "Quiet mode").option("--current-version <version>", "Current version").option("--print-commits", "Print recent commits").option("-x, --execute <command>", "Commands to execute after version bumps").help();
1458
1461
  const result = cli.parse(argv);
1459
1462
  const rawArgs = cli.rawArgs;
1460
1463
  const args = result.options;
@@ -1482,10 +1485,7 @@ async function main2() {
1482
1485
  import_node_process8.default.on("uncaughtException", errorHandler2);
1483
1486
  import_node_process8.default.on("unhandledRejection", errorHandler2);
1484
1487
  const { help, version: version2, quiet, options } = await parseArgs();
1485
- if (help) {
1486
- import_node_process8.default.exit(0 /* Success */);
1487
- } else if (version2) {
1488
- console.log(version);
1488
+ if (help || version2) {
1489
1489
  import_node_process8.default.exit(0 /* Success */);
1490
1490
  } else {
1491
1491
  if (!options.all && !options.noGitCheck) {
@@ -10,20 +10,22 @@ import {
10
10
  log_symbols_default,
11
11
  require_picocolors,
12
12
  versionBump
13
- } from "../chunk-7TCD6MWB.mjs";
13
+ } from "../chunk-UNJYHD4B.mjs";
14
14
 
15
15
  // src/cli/index.ts
16
- import process2 from "process";
16
+ import process2 from "node:process";
17
17
  import * as ezSpawn from "@jsdevtools/ez-spawn";
18
18
 
19
- // package.json
20
- var version = "9.7.1";
21
-
22
19
  // src/cli/parse-args.ts
23
20
  var import_picocolors = __toESM(require_picocolors());
24
- import process from "process";
21
+ import process from "node:process";
25
22
  import cac from "cac";
26
23
  import { valid as isValidVersion } from "semver";
24
+
25
+ // package.json
26
+ var version = "9.8.1";
27
+
28
+ // src/cli/parse-args.ts
27
29
  async function parseArgs() {
28
30
  var _a;
29
31
  try {
@@ -46,6 +48,7 @@ async function parseArgs() {
46
48
  ignoreScripts: args.ignoreScripts,
47
49
  currentVersion: args.currentVersion,
48
50
  execute: args.execute,
51
+ printCommits: args.printCommits,
49
52
  recursive: args.recursive
50
53
  })
51
54
  };
@@ -65,7 +68,7 @@ async function parseArgs() {
65
68
  }
66
69
  function loadCliArgs(argv = process.argv) {
67
70
  const cli = cac("bumpp");
68
- cli.version(version).usage("[...files]").option("--preid <preid>", "ID for prerelease").option("--all", `Include all files (default: ${bumpConfigDefaults.all})`).option("--no-git-check", `Skip git check`, { default: bumpConfigDefaults.noGitCheck }).option("-c, --commit [msg]", "Commit message", { default: true }).option("--no-commit", "Skip commit", { default: false }).option("-t, --tag [tag]", "Tag name", { default: true }).option("--no-tag", "Skip tag", { default: false }).option("--sign", "Sign commit and tag").option("-p, --push", `Push to remote (default: ${bumpConfigDefaults.push})`).option("-y, --yes", `Skip confirmation (default: ${!bumpConfigDefaults.confirm})`).option("-r, --recursive", `Bump package.json files recursively (default: ${bumpConfigDefaults.recursive})`).option("--no-verify", "Skip git verification").option("--ignore-scripts", `Ignore scripts (default: ${bumpConfigDefaults.ignoreScripts})`).option("-q, --quiet", "Quiet mode").option("-v, --version <version>", "Target version").option("--current-version <version>", "Current version").option("--print-commits", "Print recent commits", { default: true }).option("-x, --execute <command>", "Commands to execute after version bumps").help();
71
+ cli.version(version).usage("[...files]").option("--preid <preid>", "ID for prerelease").option("--all", `Include all files (default: ${bumpConfigDefaults.all})`).option("--no-git-check", `Skip git check`, { default: bumpConfigDefaults.noGitCheck }).option("-c, --commit [msg]", "Commit message", { default: true }).option("--no-commit", "Skip commit", { default: false }).option("-t, --tag [tag]", "Tag name", { default: true }).option("--no-tag", "Skip tag", { default: false }).option("--sign", "Sign commit and tag").option("-p, --push", `Push to remote (default: ${bumpConfigDefaults.push})`).option("-y, --yes", `Skip confirmation (default: ${!bumpConfigDefaults.confirm})`).option("-r, --recursive", `Bump package.json files recursively (default: ${bumpConfigDefaults.recursive})`).option("--no-verify", "Skip git verification").option("--ignore-scripts", `Ignore scripts (default: ${bumpConfigDefaults.ignoreScripts})`).option("-q, --quiet", "Quiet mode").option("--current-version <version>", "Current version").option("--print-commits", "Print recent commits").option("-x, --execute <command>", "Commands to execute after version bumps").help();
69
72
  const result = cli.parse(argv);
70
73
  const rawArgs = cli.rawArgs;
71
74
  const args = result.options;
@@ -93,10 +96,7 @@ async function main() {
93
96
  process2.on("uncaughtException", errorHandler2);
94
97
  process2.on("unhandledRejection", errorHandler2);
95
98
  const { help, version: version2, quiet, options } = await parseArgs();
96
- if (help) {
97
- process2.exit(0 /* Success */);
98
- } else if (version2) {
99
- console.log(version);
99
+ if (help || version2) {
100
100
  process2.exit(0 /* Success */);
101
101
  } else {
102
102
  if (!options.all && !options.noGitCheck) {
package/dist/index.d.mts CHANGED
@@ -2,6 +2,61 @@ import _semver, { ReleaseType as ReleaseType$1 } from 'semver';
2
2
 
3
3
  type ReleaseType = ReleaseType$1 | 'next';
4
4
 
5
+ interface Interface {
6
+ input?: NodeJS.ReadableStream | NodeJS.ReadStream | false;
7
+ output?: NodeJS.WritableStream | NodeJS.WriteStream | false;
8
+ [key: string]: unknown;
9
+ }
10
+ /**
11
+ * A specific version release.
12
+ */
13
+ interface VersionRelease {
14
+ type: 'version';
15
+ version: string;
16
+ }
17
+ /**
18
+ * Prompt the user for the release number.
19
+ */
20
+ interface PromptRelease {
21
+ type: 'prompt';
22
+ preid: string;
23
+ }
24
+ /**
25
+ * A bump release, relative to the current version number.
26
+ */
27
+ interface BumpRelease {
28
+ type: ReleaseType;
29
+ preid: string;
30
+ }
31
+ /**
32
+ * One of the possible Release types.
33
+ */
34
+ type Release = VersionRelease | PromptRelease | BumpRelease;
35
+ /**
36
+ * Normalized and sanitized options
37
+ */
38
+ interface NormalizedOptions {
39
+ release: Release;
40
+ commit?: {
41
+ message: string;
42
+ noVerify: boolean;
43
+ all: boolean;
44
+ };
45
+ tag?: {
46
+ name: string;
47
+ };
48
+ sign?: boolean;
49
+ push: boolean;
50
+ files: string[];
51
+ cwd: string;
52
+ interface: Interface;
53
+ ignoreScripts: boolean;
54
+ execute?: string | ((config?: Operation) => void | PromiseLike<void>);
55
+ printCommits?: boolean;
56
+ customVersion?: VersionBumpOptions['customVersion'];
57
+ currentVersion?: string;
58
+ }
59
+
5
60
  /**
6
61
  * Information about the work that was performed by the `versionBump()` function.
7
62
  */
@@ -69,6 +124,54 @@ interface VersionBumpProgress extends VersionBumpResults {
69
124
  script?: NpmScript;
70
125
  }
71
126
 
127
+ interface OperationState {
128
+ release: ReleaseType | undefined;
129
+ currentVersionSource: string;
130
+ currentVersion: string;
131
+ newVersion: string;
132
+ commitMessage: string;
133
+ tagName: string;
134
+ updatedFiles: string[];
135
+ skippedFiles: string[];
136
+ }
137
+ interface UpdateOperationState extends Partial<OperationState> {
138
+ event?: ProgressEvent;
139
+ script?: NpmScript;
140
+ }
141
+ /**
142
+ * All of the inputs, outputs, and state of a single `versionBump()` call.
143
+ */
144
+ declare class Operation {
145
+ /**
146
+ * The options for this operation.
147
+ */
148
+ options: NormalizedOptions;
149
+ /**
150
+ * The current state of the operation.
151
+ */
152
+ readonly state: Readonly<OperationState>;
153
+ /**
154
+ * The results of the operation.
155
+ */
156
+ get results(): VersionBumpResults;
157
+ /**
158
+ * The callback that's used to report the progress of the operation.
159
+ */
160
+ private readonly _progress?;
161
+ /**
162
+ * Private constructor. Use the `Operation.start()` static method instead.
163
+ */
164
+ private constructor();
165
+ /**
166
+ * Starts a new `versionBump()` operation.
167
+ */
168
+ static start(input: VersionBumpOptions): Promise<Operation>;
169
+ /**
170
+ * Updates the operation state and results, and reports the updated progress to the user.
171
+ */
172
+ update({ event, script, ...newState }: UpdateOperationState): this;
173
+ }
174
+
72
175
  /**
73
176
  * Options for the `versionBump()` function.
74
177
  */
@@ -187,7 +290,7 @@ interface VersionBumpOptions {
187
290
  /**
188
291
  * Excute additional command after bumping and before commiting
189
292
  */
190
- execute?: string;
293
+ execute?: string | ((config?: Operation) => void | PromiseLike<void>);
191
294
  /**
192
295
  * Bump the files recursively for monorepo. Only works without `files` option.
193
296
  *
@@ -235,109 +338,6 @@ interface InterfaceOptions {
235
338
  [key: string]: unknown;
236
339
  }
237
340
 
238
- interface Interface {
239
- input?: NodeJS.ReadableStream | NodeJS.ReadStream | false;
240
- output?: NodeJS.WritableStream | NodeJS.WriteStream | false;
241
- [key: string]: unknown;
242
- }
243
- /**
244
- * A specific version release.
245
- */
246
- interface VersionRelease {
247
- type: 'version';
248
- version: string;
249
- }
250
- /**
251
- * Prompt the user for the release number.
252
- */
253
- interface PromptRelease {
254
- type: 'prompt';
255
- preid: string;
256
- }
257
- /**
258
- * A bump release, relative to the current version number.
259
- */
260
- interface BumpRelease {
261
- type: ReleaseType;
262
- preid: string;
263
- }
264
- /**
265
- * One of the possible Release types.
266
- */
267
- type Release = VersionRelease | PromptRelease | BumpRelease;
268
- /**
269
- * Normalized and sanitized options
270
- */
271
- interface NormalizedOptions {
272
- release: Release;
273
- commit?: {
274
- message: string;
275
- noVerify: boolean;
276
- all: boolean;
277
- };
278
- tag?: {
279
- name: string;
280
- };
281
- sign?: boolean;
282
- push: boolean;
283
- files: string[];
284
- cwd: string;
285
- interface: Interface;
286
- ignoreScripts: boolean;
287
- execute?: string;
288
- printCommits?: boolean;
289
- customVersion?: VersionBumpOptions['customVersion'];
290
- currentVersion?: string;
291
- }
292
-
293
- interface OperationState {
294
- release: ReleaseType | undefined;
295
- currentVersionSource: string;
296
- currentVersion: string;
297
- newVersion: string;
298
- commitMessage: string;
299
- tagName: string;
300
- updatedFiles: string[];
301
- skippedFiles: string[];
302
- }
303
- interface UpdateOperationState extends Partial<OperationState> {
304
- event?: ProgressEvent;
305
- script?: NpmScript;
306
- }
307
- /**
308
- * All of the inputs, outputs, and state of a single `versionBump()` call.
309
- */
310
- declare class Operation {
311
- /**
312
- * The options for this operation.
313
- */
314
- options: NormalizedOptions;
315
- /**
316
- * The current state of the operation.
317
- */
318
- readonly state: Readonly<OperationState>;
319
- /**
320
- * The results of the operation.
321
- */
322
- get results(): VersionBumpResults;
323
- /**
324
- * The callback that's used to report the progress of the operation.
325
- */
326
- private readonly _progress?;
327
- /**
328
- * Private constructor. Use the `Operation.start()` static method instead.
329
- */
330
- private constructor();
331
- /**
332
- * Starts a new `versionBump()` operation.
333
- */
334
- static start(input: VersionBumpOptions): Promise<Operation>;
335
- /**
336
- * Updates the operation state and results, and reports the updated progress to the user.
337
- */
338
- update({ event, script, ...newState }: UpdateOperationState): this;
339
- }
340
-
341
341
  /**
342
342
  * Prompts the user for a version number and updates package.json and package-lock.json.
343
343
  *
package/dist/index.d.ts CHANGED
@@ -2,6 +2,61 @@ import _semver, { ReleaseType as ReleaseType$1 } from 'semver';
2
2
 
3
3
  type ReleaseType = ReleaseType$1 | 'next';
4
4
 
5
+ interface Interface {
6
+ input?: NodeJS.ReadableStream | NodeJS.ReadStream | false;
7
+ output?: NodeJS.WritableStream | NodeJS.WriteStream | false;
8
+ [key: string]: unknown;
9
+ }
10
+ /**
11
+ * A specific version release.
12
+ */
13
+ interface VersionRelease {
14
+ type: 'version';
15
+ version: string;
16
+ }
17
+ /**
18
+ * Prompt the user for the release number.
19
+ */
20
+ interface PromptRelease {
21
+ type: 'prompt';
22
+ preid: string;
23
+ }
24
+ /**
25
+ * A bump release, relative to the current version number.
26
+ */
27
+ interface BumpRelease {
28
+ type: ReleaseType;
29
+ preid: string;
30
+ }
31
+ /**
32
+ * One of the possible Release types.
33
+ */
34
+ type Release = VersionRelease | PromptRelease | BumpRelease;
35
+ /**
36
+ * Normalized and sanitized options
37
+ */
38
+ interface NormalizedOptions {
39
+ release: Release;
40
+ commit?: {
41
+ message: string;
42
+ noVerify: boolean;
43
+ all: boolean;
44
+ };
45
+ tag?: {
46
+ name: string;
47
+ };
48
+ sign?: boolean;
49
+ push: boolean;
50
+ files: string[];
51
+ cwd: string;
52
+ interface: Interface;
53
+ ignoreScripts: boolean;
54
+ execute?: string | ((config?: Operation) => void | PromiseLike<void>);
55
+ printCommits?: boolean;
56
+ customVersion?: VersionBumpOptions['customVersion'];
57
+ currentVersion?: string;
58
+ }
59
+
5
60
  /**
6
61
  * Information about the work that was performed by the `versionBump()` function.
7
62
  */
@@ -69,6 +124,54 @@ interface VersionBumpProgress extends VersionBumpResults {
69
124
  script?: NpmScript;
70
125
  }
71
126
 
127
+ interface OperationState {
128
+ release: ReleaseType | undefined;
129
+ currentVersionSource: string;
130
+ currentVersion: string;
131
+ newVersion: string;
132
+ commitMessage: string;
133
+ tagName: string;
134
+ updatedFiles: string[];
135
+ skippedFiles: string[];
136
+ }
137
+ interface UpdateOperationState extends Partial<OperationState> {
138
+ event?: ProgressEvent;
139
+ script?: NpmScript;
140
+ }
141
+ /**
142
+ * All of the inputs, outputs, and state of a single `versionBump()` call.
143
+ */
144
+ declare class Operation {
145
+ /**
146
+ * The options for this operation.
147
+ */
148
+ options: NormalizedOptions;
149
+ /**
150
+ * The current state of the operation.
151
+ */
152
+ readonly state: Readonly<OperationState>;
153
+ /**
154
+ * The results of the operation.
155
+ */
156
+ get results(): VersionBumpResults;
157
+ /**
158
+ * The callback that's used to report the progress of the operation.
159
+ */
160
+ private readonly _progress?;
161
+ /**
162
+ * Private constructor. Use the `Operation.start()` static method instead.
163
+ */
164
+ private constructor();
165
+ /**
166
+ * Starts a new `versionBump()` operation.
167
+ */
168
+ static start(input: VersionBumpOptions): Promise<Operation>;
169
+ /**
170
+ * Updates the operation state and results, and reports the updated progress to the user.
171
+ */
172
+ update({ event, script, ...newState }: UpdateOperationState): this;
173
+ }
174
+
72
175
  /**
73
176
  * Options for the `versionBump()` function.
74
177
  */
@@ -187,7 +290,7 @@ interface VersionBumpOptions {
187
290
  /**
188
291
  * Excute additional command after bumping and before commiting
189
292
  */
190
- execute?: string;
293
+ execute?: string | ((config?: Operation) => void | PromiseLike<void>);
191
294
  /**
192
295
  * Bump the files recursively for monorepo. Only works without `files` option.
193
296
  *
@@ -235,109 +338,6 @@ interface InterfaceOptions {
235
338
  [key: string]: unknown;
236
339
  }
237
340
 
238
- interface Interface {
239
- input?: NodeJS.ReadableStream | NodeJS.ReadStream | false;
240
- output?: NodeJS.WritableStream | NodeJS.WriteStream | false;
241
- [key: string]: unknown;
242
- }
243
- /**
244
- * A specific version release.
245
- */
246
- interface VersionRelease {
247
- type: 'version';
248
- version: string;
249
- }
250
- /**
251
- * Prompt the user for the release number.
252
- */
253
- interface PromptRelease {
254
- type: 'prompt';
255
- preid: string;
256
- }
257
- /**
258
- * A bump release, relative to the current version number.
259
- */
260
- interface BumpRelease {
261
- type: ReleaseType;
262
- preid: string;
263
- }
264
- /**
265
- * One of the possible Release types.
266
- */
267
- type Release = VersionRelease | PromptRelease | BumpRelease;
268
- /**
269
- * Normalized and sanitized options
270
- */
271
- interface NormalizedOptions {
272
- release: Release;
273
- commit?: {
274
- message: string;
275
- noVerify: boolean;
276
- all: boolean;
277
- };
278
- tag?: {
279
- name: string;
280
- };
281
- sign?: boolean;
282
- push: boolean;
283
- files: string[];
284
- cwd: string;
285
- interface: Interface;
286
- ignoreScripts: boolean;
287
- execute?: string;
288
- printCommits?: boolean;
289
- customVersion?: VersionBumpOptions['customVersion'];
290
- currentVersion?: string;
291
- }
292
-
293
- interface OperationState {
294
- release: ReleaseType | undefined;
295
- currentVersionSource: string;
296
- currentVersion: string;
297
- newVersion: string;
298
- commitMessage: string;
299
- tagName: string;
300
- updatedFiles: string[];
301
- skippedFiles: string[];
302
- }
303
- interface UpdateOperationState extends Partial<OperationState> {
304
- event?: ProgressEvent;
305
- script?: NpmScript;
306
- }
307
- /**
308
- * All of the inputs, outputs, and state of a single `versionBump()` call.
309
- */
310
- declare class Operation {
311
- /**
312
- * The options for this operation.
313
- */
314
- options: NormalizedOptions;
315
- /**
316
- * The current state of the operation.
317
- */
318
- readonly state: Readonly<OperationState>;
319
- /**
320
- * The results of the operation.
321
- */
322
- get results(): VersionBumpResults;
323
- /**
324
- * The callback that's used to report the progress of the operation.
325
- */
326
- private readonly _progress?;
327
- /**
328
- * Private constructor. Use the `Operation.start()` static method instead.
329
- */
330
- private constructor();
331
- /**
332
- * Starts a new `versionBump()` operation.
333
- */
334
- static start(input: VersionBumpOptions): Promise<Operation>;
335
- /**
336
- * Updates the operation state and results, and reports the updated progress to the user.
337
- */
338
- update({ event, script, ...newState }: UpdateOperationState): this;
339
- }
340
-
341
341
  /**
342
342
  * Prompts the user for a version number and updates package.json and package-lock.json.
343
343
  *
package/dist/index.js CHANGED
@@ -58,20 +58,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
58
58
  ));
59
59
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
60
60
 
61
- // node_modules/.pnpm/picocolors@1.1.0/node_modules/picocolors/picocolors.js
61
+ // node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
62
62
  var require_picocolors = __commonJS({
63
- "node_modules/.pnpm/picocolors@1.1.0/node_modules/picocolors/picocolors.js"(exports2, module2) {
64
- var argv = process.argv || [];
65
- var env2 = process.env;
66
- var isColorSupported = !("NO_COLOR" in env2 || argv.includes("--no-color")) && ("FORCE_COLOR" in env2 || argv.includes("--color") || process.platform === "win32" || require != null && require("tty").isatty(1) && env2.TERM !== "dumb" || "CI" in env2);
63
+ "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports2, module2) {
64
+ var p = process || {};
65
+ var argv = p.argv || [];
66
+ var env2 = p.env || {};
67
+ var isColorSupported = !(!!env2.NO_COLOR || argv.includes("--no-color")) && (!!env2.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env2.TERM !== "dumb" || !!env2.CI);
67
68
  var formatter = (open, close, replace = open) => (input) => {
68
- let string = "" + input;
69
- let index = string.indexOf(close, open.length);
69
+ let string = "" + input, index = string.indexOf(close, open.length);
70
70
  return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
71
71
  };
72
72
  var replaceClose = (string, close, replace, index) => {
73
- let result = "";
74
- let cursor = 0;
73
+ let result = "", cursor = 0;
75
74
  do {
76
75
  result += string.substring(cursor, index) + replace;
77
76
  cursor = index + close.length;
@@ -80,50 +79,50 @@ var require_picocolors = __commonJS({
80
79
  return result + string.substring(cursor);
81
80
  };
82
81
  var createColors = (enabled = isColorSupported) => {
83
- let init = enabled ? formatter : () => String;
82
+ let f = enabled ? formatter : () => String;
84
83
  return {
85
84
  isColorSupported: enabled,
86
- reset: init("\x1B[0m", "\x1B[0m"),
87
- bold: init("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
88
- dim: init("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
89
- italic: init("\x1B[3m", "\x1B[23m"),
90
- underline: init("\x1B[4m", "\x1B[24m"),
91
- inverse: init("\x1B[7m", "\x1B[27m"),
92
- hidden: init("\x1B[8m", "\x1B[28m"),
93
- strikethrough: init("\x1B[9m", "\x1B[29m"),
94
- black: init("\x1B[30m", "\x1B[39m"),
95
- red: init("\x1B[31m", "\x1B[39m"),
96
- green: init("\x1B[32m", "\x1B[39m"),
97
- yellow: init("\x1B[33m", "\x1B[39m"),
98
- blue: init("\x1B[34m", "\x1B[39m"),
99
- magenta: init("\x1B[35m", "\x1B[39m"),
100
- cyan: init("\x1B[36m", "\x1B[39m"),
101
- white: init("\x1B[37m", "\x1B[39m"),
102
- gray: init("\x1B[90m", "\x1B[39m"),
103
- bgBlack: init("\x1B[40m", "\x1B[49m"),
104
- bgRed: init("\x1B[41m", "\x1B[49m"),
105
- bgGreen: init("\x1B[42m", "\x1B[49m"),
106
- bgYellow: init("\x1B[43m", "\x1B[49m"),
107
- bgBlue: init("\x1B[44m", "\x1B[49m"),
108
- bgMagenta: init("\x1B[45m", "\x1B[49m"),
109
- bgCyan: init("\x1B[46m", "\x1B[49m"),
110
- bgWhite: init("\x1B[47m", "\x1B[49m"),
111
- blackBright: init("\x1B[90m", "\x1B[39m"),
112
- redBright: init("\x1B[91m", "\x1B[39m"),
113
- greenBright: init("\x1B[92m", "\x1B[39m"),
114
- yellowBright: init("\x1B[93m", "\x1B[39m"),
115
- blueBright: init("\x1B[94m", "\x1B[39m"),
116
- magentaBright: init("\x1B[95m", "\x1B[39m"),
117
- cyanBright: init("\x1B[96m", "\x1B[39m"),
118
- whiteBright: init("\x1B[97m", "\x1B[39m"),
119
- bgBlackBright: init("\x1B[100m", "\x1B[49m"),
120
- bgRedBright: init("\x1B[101m", "\x1B[49m"),
121
- bgGreenBright: init("\x1B[102m", "\x1B[49m"),
122
- bgYellowBright: init("\x1B[103m", "\x1B[49m"),
123
- bgBlueBright: init("\x1B[104m", "\x1B[49m"),
124
- bgMagentaBright: init("\x1B[105m", "\x1B[49m"),
125
- bgCyanBright: init("\x1B[106m", "\x1B[49m"),
126
- bgWhiteBright: init("\x1B[107m", "\x1B[49m")
85
+ reset: f("\x1B[0m", "\x1B[0m"),
86
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
87
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
88
+ italic: f("\x1B[3m", "\x1B[23m"),
89
+ underline: f("\x1B[4m", "\x1B[24m"),
90
+ inverse: f("\x1B[7m", "\x1B[27m"),
91
+ hidden: f("\x1B[8m", "\x1B[28m"),
92
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
93
+ black: f("\x1B[30m", "\x1B[39m"),
94
+ red: f("\x1B[31m", "\x1B[39m"),
95
+ green: f("\x1B[32m", "\x1B[39m"),
96
+ yellow: f("\x1B[33m", "\x1B[39m"),
97
+ blue: f("\x1B[34m", "\x1B[39m"),
98
+ magenta: f("\x1B[35m", "\x1B[39m"),
99
+ cyan: f("\x1B[36m", "\x1B[39m"),
100
+ white: f("\x1B[37m", "\x1B[39m"),
101
+ gray: f("\x1B[90m", "\x1B[39m"),
102
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
103
+ bgRed: f("\x1B[41m", "\x1B[49m"),
104
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
105
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
106
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
107
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
108
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
109
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
110
+ blackBright: f("\x1B[90m", "\x1B[39m"),
111
+ redBright: f("\x1B[91m", "\x1B[39m"),
112
+ greenBright: f("\x1B[92m", "\x1B[39m"),
113
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
114
+ blueBright: f("\x1B[94m", "\x1B[39m"),
115
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
116
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
117
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
118
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
119
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
120
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
121
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
122
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
123
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
124
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
125
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
127
126
  };
128
127
  };
129
128
  module2.exports = createColors();
@@ -1068,8 +1067,8 @@ function formatVersionString(template, newVersion) {
1068
1067
  var import_node_fs2 = __toESM(require("fs"));
1069
1068
  var import_promises = __toESM(require("fs/promises"));
1070
1069
  var import_node_process4 = __toESM(require("process"));
1071
- var import_fast_glob = __toESM(require("fast-glob"));
1072
1070
  var import_js_yaml = __toESM(require("js-yaml"));
1071
+ var import_tinyglobby = require("tinyglobby");
1073
1072
  async function normalizeOptions(raw) {
1074
1073
  var _a, _b, _d;
1075
1074
  const preid = typeof raw.preid === "string" ? raw.preid : "beta";
@@ -1121,11 +1120,12 @@ async function normalizeOptions(raw) {
1121
1120
  } else {
1122
1121
  raw.files = ((_b = raw.files) == null ? void 0 : _b.length) ? raw.files : ["package.json", "package-lock.json", "jsr.json", "jsr.jsonc", "deno.json", "deno.jsonc"];
1123
1122
  }
1124
- const files = await (0, import_fast_glob.default)(
1123
+ const files = await (0, import_tinyglobby.glob)(
1125
1124
  raw.files,
1126
1125
  {
1127
1126
  cwd,
1128
1127
  onlyFiles: true,
1128
+ expandDirectories: false,
1129
1129
  ignore: [
1130
1130
  "**/{.git,node_modules,bower_components,__tests__,fixtures,fixture}/**"
1131
1131
  ]
@@ -1343,9 +1343,13 @@ async function versionBump(arg = {}) {
1343
1343
  await runNpmScript("preversion" /* PreVersion */, operation);
1344
1344
  await updateFiles(operation);
1345
1345
  if (operation.options.execute) {
1346
- console.log(log_symbols_default.info, "Executing script", operation.options.execute);
1347
- await ezSpawn4.async(operation.options.execute, { stdio: "inherit" });
1348
- console.log(log_symbols_default.success, "Script finished");
1346
+ if (typeof operation.options.execute === "function") {
1347
+ await operation.options.execute(operation);
1348
+ } else {
1349
+ console.log(log_symbols_default.info, "Executing script", operation.options.execute);
1350
+ await ezSpawn4.async(operation.options.execute, { stdio: "inherit" });
1351
+ console.log(log_symbols_default.success, "Script finished");
1352
+ }
1349
1353
  }
1350
1354
  await runNpmScript("version" /* Version */, operation);
1351
1355
  await gitCommit(operation);
@@ -1362,7 +1366,7 @@ function printSummary(operation) {
1362
1366
  if (operation.options.tag)
1363
1367
  console.log(` tag ${import_picocolors3.default.bold(formatVersionString(operation.options.tag.name, operation.state.newVersion))}`);
1364
1368
  if (operation.options.execute)
1365
- console.log(` execute ${import_picocolors3.default.bold(operation.options.execute)}`);
1369
+ console.log(` execute ${import_picocolors3.default.bold(typeof operation.options.execute === "function" ? "function" : operation.options.execute)}`);
1366
1370
  if (operation.options.push)
1367
1371
  console.log(` push ${import_picocolors3.default.cyan(import_picocolors3.default.bold("yes"))}`);
1368
1372
  console.log();
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  loadBumpConfig,
8
8
  versionBump,
9
9
  versionBumpInfo
10
- } from "./chunk-7TCD6MWB.mjs";
10
+ } from "./chunk-UNJYHD4B.mjs";
11
11
 
12
12
  // src/index.ts
13
13
  var src_default = versionBump;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bumpp",
3
- "version": "9.7.1",
4
- "packageManager": "pnpm@9.12.1",
3
+ "version": "9.8.1",
4
+ "packageManager": "pnpm@9.12.3",
5
5
  "description": "Bump version, commit changes, tag, and push to Git",
6
6
  "author": {
7
7
  "name": "James Messinger",
@@ -64,26 +64,26 @@
64
64
  "c12": "^1.11.2",
65
65
  "cac": "^6.7.14",
66
66
  "escalade": "^3.2.0",
67
- "fast-glob": "^3.3.2",
68
67
  "js-yaml": "^4.1.0",
69
68
  "jsonc-parser": "^3.3.1",
70
69
  "prompts": "^2.4.2",
71
- "semver": "^7.6.3"
70
+ "semver": "^7.6.3",
71
+ "tinyglobby": "^0.2.10"
72
72
  },
73
73
  "devDependencies": {
74
- "@antfu/eslint-config": "^3.7.3",
74
+ "@antfu/eslint-config": "^3.8.0",
75
75
  "@types/js-yaml": "^4.0.9",
76
- "@types/node": "^22.7.5",
76
+ "@types/node": "^22.8.1",
77
77
  "@types/prompts": "^2.4.9",
78
78
  "@types/semver": "^7.5.8",
79
- "eslint": "^9.12.0",
79
+ "eslint": "^9.13.0",
80
80
  "esno": "^4.8.0",
81
81
  "log-symbols": "^6.0.0",
82
82
  "npm-check": "^6.0.1",
83
- "picocolors": "^1.1.0",
83
+ "picocolors": "^1.1.1",
84
84
  "rimraf": "^6.0.1",
85
- "tsup": "^8.3.0",
85
+ "tsup": "^8.3.5",
86
86
  "typescript": "^5.6.3",
87
- "vitest": "^2.1.2"
87
+ "vitest": "^2.1.4"
88
88
  }
89
89
  }