bumpp 9.7.0 → 9.8.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.
- package/README.md +4 -1
- package/dist/{chunk-EGVMKV3X.mjs → chunk-UNJYHD4B.mjs} +77 -80
- package/dist/cli/index.js +62 -59
- package/dist/cli/index.mjs +4 -4
- package/dist/index.d.mts +104 -104
- package/dist/index.d.ts +104 -104
- package/dist/index.js +61 -58
- package/dist/index.mjs +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Forked from [`version-bump-prompt`](https://github.com/JS-DevTools/version-bump-
|
|
|
8
8
|
|
|
9
9
|
- Renamed to `bumpp` - so you can use `npx bumpp` directly.
|
|
10
10
|
- Ships ESM and CJS bundles.
|
|
11
|
-
- Add a new argument `--execute` to execute the command before committing.
|
|
11
|
+
- Add a new argument `--execute` to execute the command, or execute a function before committing.
|
|
12
12
|
- Use the current version's `preid` when available.
|
|
13
13
|
- Confirmation before bumping.
|
|
14
14
|
- Enable `--commit` `--tag` `--push` by default. (opt-out by `--no-push`, etc.)
|
|
@@ -23,5 +23,8 @@ import { defineConfig } from 'bumpp'
|
|
|
23
23
|
|
|
24
24
|
export default defineConfig({
|
|
25
25
|
// ...options
|
|
26
|
+
execute(config) {
|
|
27
|
+
// ...`execute` could receive a function here
|
|
28
|
+
}
|
|
26
29
|
})
|
|
27
30
|
```
|
|
@@ -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
|
|
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.
|
|
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.
|
|
66
|
-
var
|
|
67
|
-
var
|
|
68
|
-
var
|
|
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
|
|
78
|
+
let f = enabled ? formatter : () => String;
|
|
86
79
|
return {
|
|
87
80
|
isColorSupported: enabled,
|
|
88
|
-
reset:
|
|
89
|
-
bold:
|
|
90
|
-
dim:
|
|
91
|
-
italic:
|
|
92
|
-
underline:
|
|
93
|
-
inverse:
|
|
94
|
-
hidden:
|
|
95
|
-
strikethrough:
|
|
96
|
-
black:
|
|
97
|
-
red:
|
|
98
|
-
green:
|
|
99
|
-
yellow:
|
|
100
|
-
blue:
|
|
101
|
-
magenta:
|
|
102
|
-
cyan:
|
|
103
|
-
white:
|
|
104
|
-
gray:
|
|
105
|
-
bgBlack:
|
|
106
|
-
bgRed:
|
|
107
|
-
bgGreen:
|
|
108
|
-
bgYellow:
|
|
109
|
-
bgBlue:
|
|
110
|
-
bgMagenta:
|
|
111
|
-
bgCyan:
|
|
112
|
-
bgWhite:
|
|
113
|
-
blackBright:
|
|
114
|
-
redBright:
|
|
115
|
-
greenBright:
|
|
116
|
-
yellowBright:
|
|
117
|
-
blueBright:
|
|
118
|
-
magentaBright:
|
|
119
|
-
cyanBright:
|
|
120
|
-
whiteBright:
|
|
121
|
-
bgBlackBright:
|
|
122
|
-
bgRedBright:
|
|
123
|
-
bgGreenBright:
|
|
124
|
-
bgYellowBright:
|
|
125
|
-
bgBlueBright:
|
|
126
|
-
bgMagentaBright:
|
|
127
|
-
bgCyanBright:
|
|
128
|
-
bgWhiteBright:
|
|
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
|
|
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
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
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 = {
|
|
@@ -1390,7 +1388,6 @@ async function loadBumpConfig(overrides, cwd = process7.cwd()) {
|
|
|
1390
1388
|
overrides: __spreadValues({}, overrides),
|
|
1391
1389
|
cwd: configFile ? dirname(configFile) : cwd
|
|
1392
1390
|
});
|
|
1393
|
-
console.log(config);
|
|
1394
1391
|
return config;
|
|
1395
1392
|
}
|
|
1396
1393
|
function findConfigFile(name, cwd) {
|
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.
|
|
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.
|
|
64
|
-
var
|
|
65
|
-
var
|
|
66
|
-
var
|
|
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
|
|
82
|
+
let f = enabled ? formatter : () => String;
|
|
84
83
|
return {
|
|
85
84
|
isColorSupported: enabled,
|
|
86
|
-
reset:
|
|
87
|
-
bold:
|
|
88
|
-
dim:
|
|
89
|
-
italic:
|
|
90
|
-
underline:
|
|
91
|
-
inverse:
|
|
92
|
-
hidden:
|
|
93
|
-
strikethrough:
|
|
94
|
-
black:
|
|
95
|
-
red:
|
|
96
|
-
green:
|
|
97
|
-
yellow:
|
|
98
|
-
blue:
|
|
99
|
-
magenta:
|
|
100
|
-
cyan:
|
|
101
|
-
white:
|
|
102
|
-
gray:
|
|
103
|
-
bgBlack:
|
|
104
|
-
bgRed:
|
|
105
|
-
bgGreen:
|
|
106
|
-
bgYellow:
|
|
107
|
-
bgBlue:
|
|
108
|
-
bgMagenta:
|
|
109
|
-
bgCyan:
|
|
110
|
-
bgWhite:
|
|
111
|
-
blackBright:
|
|
112
|
-
redBright:
|
|
113
|
-
greenBright:
|
|
114
|
-
yellowBright:
|
|
115
|
-
blueBright:
|
|
116
|
-
magentaBright:
|
|
117
|
-
cyanBright:
|
|
118
|
-
whiteBright:
|
|
119
|
-
bgBlackBright:
|
|
120
|
-
bgRedBright:
|
|
121
|
-
bgGreenBright:
|
|
122
|
-
bgYellowBright:
|
|
123
|
-
bgBlueBright:
|
|
124
|
-
bgMagentaBright:
|
|
125
|
-
bgCyanBright:
|
|
126
|
-
bgWhiteBright:
|
|
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();
|
|
@@ -656,7 +655,7 @@ var log_symbols_default = logSymbols;
|
|
|
656
655
|
var ezSpawn5 = __toESM(require("@jsdevtools/ez-spawn"));
|
|
657
656
|
|
|
658
657
|
// package.json
|
|
659
|
-
var version = "9.
|
|
658
|
+
var version = "9.8.0";
|
|
660
659
|
|
|
661
660
|
// src/version-bump.ts
|
|
662
661
|
var import_node_process5 = __toESM(require("process"));
|
|
@@ -1048,8 +1047,8 @@ function formatVersionString(template, newVersion) {
|
|
|
1048
1047
|
var import_node_fs2 = __toESM(require("fs"));
|
|
1049
1048
|
var import_promises = __toESM(require("fs/promises"));
|
|
1050
1049
|
var import_node_process4 = __toESM(require("process"));
|
|
1051
|
-
var import_fast_glob = __toESM(require("fast-glob"));
|
|
1052
1050
|
var import_js_yaml = __toESM(require("js-yaml"));
|
|
1051
|
+
var import_tinyglobby = require("tinyglobby");
|
|
1053
1052
|
async function normalizeOptions(raw) {
|
|
1054
1053
|
var _a, _b, _d;
|
|
1055
1054
|
const preid = typeof raw.preid === "string" ? raw.preid : "beta";
|
|
@@ -1101,11 +1100,12 @@ async function normalizeOptions(raw) {
|
|
|
1101
1100
|
} else {
|
|
1102
1101
|
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
1102
|
}
|
|
1104
|
-
const files = await (0,
|
|
1103
|
+
const files = await (0, import_tinyglobby.glob)(
|
|
1105
1104
|
raw.files,
|
|
1106
1105
|
{
|
|
1107
1106
|
cwd,
|
|
1108
1107
|
onlyFiles: true,
|
|
1108
|
+
expandDirectories: false,
|
|
1109
1109
|
ignore: [
|
|
1110
1110
|
"**/{.git,node_modules,bower_components,__tests__,fixtures,fixture}/**"
|
|
1111
1111
|
]
|
|
@@ -1323,9 +1323,13 @@ async function versionBump(arg = {}) {
|
|
|
1323
1323
|
await runNpmScript("preversion" /* PreVersion */, operation);
|
|
1324
1324
|
await updateFiles(operation);
|
|
1325
1325
|
if (operation.options.execute) {
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1326
|
+
if (typeof operation.options.execute === "function") {
|
|
1327
|
+
await operation.options.execute(operation);
|
|
1328
|
+
} else {
|
|
1329
|
+
console.log(log_symbols_default.info, "Executing script", operation.options.execute);
|
|
1330
|
+
await ezSpawn4.async(operation.options.execute, { stdio: "inherit" });
|
|
1331
|
+
console.log(log_symbols_default.success, "Script finished");
|
|
1332
|
+
}
|
|
1329
1333
|
}
|
|
1330
1334
|
await runNpmScript("version" /* Version */, operation);
|
|
1331
1335
|
await gitCommit(operation);
|
|
@@ -1342,7 +1346,7 @@ function printSummary(operation) {
|
|
|
1342
1346
|
if (operation.options.tag)
|
|
1343
1347
|
console.log(` tag ${import_picocolors3.default.bold(formatVersionString(operation.options.tag.name, operation.state.newVersion))}`);
|
|
1344
1348
|
if (operation.options.execute)
|
|
1345
|
-
console.log(` execute ${import_picocolors3.default.bold(operation.options.execute)}`);
|
|
1349
|
+
console.log(` execute ${import_picocolors3.default.bold(typeof operation.options.execute === "function" ? "function" : operation.options.execute)}`);
|
|
1346
1350
|
if (operation.options.push)
|
|
1347
1351
|
console.log(` push ${import_picocolors3.default.cyan(import_picocolors3.default.bold("yes"))}`);
|
|
1348
1352
|
console.log();
|
|
@@ -1384,7 +1388,6 @@ async function loadBumpConfig(overrides, cwd = import_node_process6.default.cwd(
|
|
|
1384
1388
|
overrides: __spreadValues({}, overrides),
|
|
1385
1389
|
cwd: configFile ? (0, import_node_path2.dirname)(configFile) : cwd
|
|
1386
1390
|
});
|
|
1387
|
-
console.log(config);
|
|
1388
1391
|
return config;
|
|
1389
1392
|
}
|
|
1390
1393
|
function findConfigFile(name, cwd) {
|
package/dist/cli/index.mjs
CHANGED
|
@@ -10,18 +10,18 @@ import {
|
|
|
10
10
|
log_symbols_default,
|
|
11
11
|
require_picocolors,
|
|
12
12
|
versionBump
|
|
13
|
-
} from "../chunk-
|
|
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
19
|
// package.json
|
|
20
|
-
var version = "9.
|
|
20
|
+
var version = "9.8.0";
|
|
21
21
|
|
|
22
22
|
// src/cli/parse-args.ts
|
|
23
23
|
var import_picocolors = __toESM(require_picocolors());
|
|
24
|
-
import process from "process";
|
|
24
|
+
import process from "node:process";
|
|
25
25
|
import cac from "cac";
|
|
26
26
|
import { valid as isValidVersion } from "semver";
|
|
27
27
|
async function parseArgs() {
|
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.
|
|
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.
|
|
64
|
-
var
|
|
65
|
-
var
|
|
66
|
-
var
|
|
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
|
|
82
|
+
let f = enabled ? formatter : () => String;
|
|
84
83
|
return {
|
|
85
84
|
isColorSupported: enabled,
|
|
86
|
-
reset:
|
|
87
|
-
bold:
|
|
88
|
-
dim:
|
|
89
|
-
italic:
|
|
90
|
-
underline:
|
|
91
|
-
inverse:
|
|
92
|
-
hidden:
|
|
93
|
-
strikethrough:
|
|
94
|
-
black:
|
|
95
|
-
red:
|
|
96
|
-
green:
|
|
97
|
-
yellow:
|
|
98
|
-
blue:
|
|
99
|
-
magenta:
|
|
100
|
-
cyan:
|
|
101
|
-
white:
|
|
102
|
-
gray:
|
|
103
|
-
bgBlack:
|
|
104
|
-
bgRed:
|
|
105
|
-
bgGreen:
|
|
106
|
-
bgYellow:
|
|
107
|
-
bgBlue:
|
|
108
|
-
bgMagenta:
|
|
109
|
-
bgCyan:
|
|
110
|
-
bgWhite:
|
|
111
|
-
blackBright:
|
|
112
|
-
redBright:
|
|
113
|
-
greenBright:
|
|
114
|
-
yellowBright:
|
|
115
|
-
blueBright:
|
|
116
|
-
magentaBright:
|
|
117
|
-
cyanBright:
|
|
118
|
-
whiteBright:
|
|
119
|
-
bgBlackBright:
|
|
120
|
-
bgRedBright:
|
|
121
|
-
bgGreenBright:
|
|
122
|
-
bgYellowBright:
|
|
123
|
-
bgBlueBright:
|
|
124
|
-
bgMagentaBright:
|
|
125
|
-
bgCyanBright:
|
|
126
|
-
bgWhiteBright:
|
|
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,
|
|
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
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
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();
|
|
@@ -1406,7 +1410,6 @@ async function loadBumpConfig(overrides, cwd = import_node_process6.default.cwd(
|
|
|
1406
1410
|
overrides: __spreadValues({}, overrides),
|
|
1407
1411
|
cwd: configFile ? (0, import_node_path2.dirname)(configFile) : cwd
|
|
1408
1412
|
});
|
|
1409
|
-
console.log(config);
|
|
1410
1413
|
return config;
|
|
1411
1414
|
}
|
|
1412
1415
|
function findConfigFile(name, cwd) {
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bumpp",
|
|
3
|
-
"version": "9.
|
|
4
|
-
"packageManager": "pnpm@9.12.
|
|
3
|
+
"version": "9.8.0",
|
|
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.
|
|
74
|
+
"@antfu/eslint-config": "^3.8.0",
|
|
75
75
|
"@types/js-yaml": "^4.0.9",
|
|
76
|
-
"@types/node": "^22.
|
|
76
|
+
"@types/node": "^22.8.1",
|
|
77
77
|
"@types/prompts": "^2.4.9",
|
|
78
78
|
"@types/semver": "^7.5.8",
|
|
79
|
-
"eslint": "^9.
|
|
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.
|
|
83
|
+
"picocolors": "^1.1.1",
|
|
84
84
|
"rimraf": "^6.0.1",
|
|
85
|
-
"tsup": "^8.3.
|
|
85
|
+
"tsup": "^8.3.5",
|
|
86
86
|
"typescript": "^5.6.3",
|
|
87
|
-
"vitest": "^2.1.
|
|
87
|
+
"vitest": "^2.1.4"
|
|
88
88
|
}
|
|
89
89
|
}
|