bumpp 9.9.2 → 9.10.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/dist/{chunk-MJWNLIUB.mjs → chunk-QXSKCVPH.mjs} +39 -6
- package/dist/cli/index.js +42 -8
- package/dist/cli/index.mjs +4 -3
- package/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +39 -6
- package/dist/index.mjs +1 -1
- package/package.json +8 -7
|
@@ -256,9 +256,9 @@ var NpmScript = /* @__PURE__ */ ((NpmScript2) => {
|
|
|
256
256
|
// src/version-bump.ts
|
|
257
257
|
import process5 from "node:process";
|
|
258
258
|
|
|
259
|
-
// node_modules/.pnpm/args-tokenizer@0.
|
|
259
|
+
// node_modules/.pnpm/args-tokenizer@0.3.0/node_modules/args-tokenizer/dist/args-tokenizer.js
|
|
260
260
|
var spaceRegex = /\s/;
|
|
261
|
-
var tokenizeArgs = (argsString) => {
|
|
261
|
+
var tokenizeArgs = (argsString, options) => {
|
|
262
262
|
const tokens = [];
|
|
263
263
|
let currentToken = "";
|
|
264
264
|
let openningQuote;
|
|
@@ -298,6 +298,12 @@ var tokenizeArgs = (argsString) => {
|
|
|
298
298
|
if (currentToken.length > 0) {
|
|
299
299
|
tokens.push(currentToken);
|
|
300
300
|
}
|
|
301
|
+
if (options == null ? void 0 : options.loose) {
|
|
302
|
+
return tokens;
|
|
303
|
+
}
|
|
304
|
+
if (openningQuote) {
|
|
305
|
+
throw Error("Unexpected end of string. Closing quote is missing.");
|
|
306
|
+
}
|
|
301
307
|
return tokens;
|
|
302
308
|
};
|
|
303
309
|
|
|
@@ -641,7 +647,7 @@ async function gitCommit(operation) {
|
|
|
641
647
|
args.push("--message", commitMessage);
|
|
642
648
|
if (!all)
|
|
643
649
|
args = args.concat(updatedFiles);
|
|
644
|
-
await x2("git", ["commit", ...args]);
|
|
650
|
+
await x2("git", ["commit", ...args], { throwOnError: true });
|
|
645
651
|
return operation.update({ event: "git commit" /* GitCommit */, commitMessage });
|
|
646
652
|
}
|
|
647
653
|
async function gitTag(operation) {
|
|
@@ -662,15 +668,15 @@ async function gitTag(operation) {
|
|
|
662
668
|
if (operation.options.sign) {
|
|
663
669
|
args.push("--sign");
|
|
664
670
|
}
|
|
665
|
-
await x2("git", ["tag", ...args]);
|
|
671
|
+
await x2("git", ["tag", ...args], { throwOnError: true });
|
|
666
672
|
return operation.update({ event: "git tag" /* GitTag */, tagName });
|
|
667
673
|
}
|
|
668
674
|
async function gitPush(operation) {
|
|
669
675
|
if (!operation.options.push)
|
|
670
676
|
return operation;
|
|
671
|
-
await x2("git", ["push"]);
|
|
677
|
+
await x2("git", ["push"], { throwOnError: true });
|
|
672
678
|
if (operation.options.tag) {
|
|
673
|
-
await x2("git", ["push", "--tags"]);
|
|
679
|
+
await x2("git", ["push", "--tags"], { throwOnError: true });
|
|
674
680
|
}
|
|
675
681
|
return operation.update({ event: "git push" /* GitPush */ });
|
|
676
682
|
}
|
|
@@ -693,6 +699,7 @@ async function normalizeOptions(raw) {
|
|
|
693
699
|
const sign = Boolean(raw.sign);
|
|
694
700
|
const push = Boolean(raw.push);
|
|
695
701
|
const all = Boolean(raw.all);
|
|
702
|
+
const install = Boolean(raw.install);
|
|
696
703
|
const noVerify = Boolean(raw.noVerify);
|
|
697
704
|
const cwd = raw.cwd || process4.cwd();
|
|
698
705
|
const ignoreScripts = Boolean(raw.ignoreScripts);
|
|
@@ -772,6 +779,7 @@ async function normalizeOptions(raw) {
|
|
|
772
779
|
push,
|
|
773
780
|
files,
|
|
774
781
|
cwd,
|
|
782
|
+
install,
|
|
775
783
|
interface: ui,
|
|
776
784
|
ignoreScripts,
|
|
777
785
|
execute,
|
|
@@ -962,6 +970,27 @@ async function versionBump(arg = {}) {
|
|
|
962
970
|
}
|
|
963
971
|
await runNpmScript("preversion" /* PreVersion */, operation);
|
|
964
972
|
await updateFiles(operation);
|
|
973
|
+
if (operation.options.install) {
|
|
974
|
+
const { detect } = await import("package-manager-detector/detect");
|
|
975
|
+
const pm = await detect();
|
|
976
|
+
if (!(pm == null ? void 0 : pm.name)) {
|
|
977
|
+
throw new Error("Could not detect package manager, failed to run npm install");
|
|
978
|
+
}
|
|
979
|
+
const { COMMANDS, constructCommand } = await import("package-manager-detector/commands");
|
|
980
|
+
const command = constructCommand(COMMANDS[pm.name].install, []);
|
|
981
|
+
if (!command) {
|
|
982
|
+
throw new Error("Could not find install command for package manager");
|
|
983
|
+
}
|
|
984
|
+
console.log(symbols_exports.info, "Installing dependencies with", `${command.command} ${command.args.join(" ")}`);
|
|
985
|
+
await x4(command.command, command.args, {
|
|
986
|
+
throwOnError: true,
|
|
987
|
+
nodeOptions: {
|
|
988
|
+
stdio: "inherit",
|
|
989
|
+
cwd: operation.options.cwd
|
|
990
|
+
}
|
|
991
|
+
});
|
|
992
|
+
console.log(symbols_exports.success, "Dependencies installed");
|
|
993
|
+
}
|
|
965
994
|
if (operation.options.execute) {
|
|
966
995
|
if (typeof operation.options.execute === "function") {
|
|
967
996
|
await operation.options.execute(operation);
|
|
@@ -969,6 +998,7 @@ async function versionBump(arg = {}) {
|
|
|
969
998
|
const [command, ...args] = tokenizeArgs(operation.options.execute);
|
|
970
999
|
console.log(symbols_exports.info, "Executing script", command, ...args);
|
|
971
1000
|
await x4(command, args, {
|
|
1001
|
+
throwOnError: true,
|
|
972
1002
|
nodeOptions: {
|
|
973
1003
|
stdio: "inherit",
|
|
974
1004
|
cwd: operation.options.cwd
|
|
@@ -995,6 +1025,8 @@ function printSummary(operation) {
|
|
|
995
1025
|
console.log(` execute ${import_picocolors3.default.bold(typeof operation.options.execute === "function" ? "function" : operation.options.execute)}`);
|
|
996
1026
|
if (operation.options.push)
|
|
997
1027
|
console.log(` push ${import_picocolors3.default.cyan(import_picocolors3.default.bold("yes"))}`);
|
|
1028
|
+
if (operation.options.install)
|
|
1029
|
+
console.log(` install ${import_picocolors3.default.cyan(import_picocolors3.default.bold("yes"))}`);
|
|
998
1030
|
console.log();
|
|
999
1031
|
console.log(` from ${import_picocolors3.default.bold(operation.state.currentVersion)}`);
|
|
1000
1032
|
console.log(` to ${import_picocolors3.default.green(import_picocolors3.default.bold(operation.state.newVersion))}`);
|
|
@@ -1019,6 +1051,7 @@ var bumpConfigDefaults = {
|
|
|
1019
1051
|
push: true,
|
|
1020
1052
|
tag: true,
|
|
1021
1053
|
sign: false,
|
|
1054
|
+
install: false,
|
|
1022
1055
|
recursive: false,
|
|
1023
1056
|
noVerify: false,
|
|
1024
1057
|
confirm: true,
|
package/dist/cli/index.js
CHANGED
|
@@ -241,9 +241,9 @@ var import_tinyexec5 = require("tinyexec");
|
|
|
241
241
|
// src/version-bump.ts
|
|
242
242
|
var import_node_process4 = __toESM(require("process"));
|
|
243
243
|
|
|
244
|
-
// node_modules/.pnpm/args-tokenizer@0.
|
|
244
|
+
// node_modules/.pnpm/args-tokenizer@0.3.0/node_modules/args-tokenizer/dist/args-tokenizer.js
|
|
245
245
|
var spaceRegex = /\s/;
|
|
246
|
-
var tokenizeArgs = (argsString) => {
|
|
246
|
+
var tokenizeArgs = (argsString, options) => {
|
|
247
247
|
const tokens = [];
|
|
248
248
|
let currentToken = "";
|
|
249
249
|
let openningQuote;
|
|
@@ -283,6 +283,12 @@ var tokenizeArgs = (argsString) => {
|
|
|
283
283
|
if (currentToken.length > 0) {
|
|
284
284
|
tokens.push(currentToken);
|
|
285
285
|
}
|
|
286
|
+
if (options == null ? void 0 : options.loose) {
|
|
287
|
+
return tokens;
|
|
288
|
+
}
|
|
289
|
+
if (openningQuote) {
|
|
290
|
+
throw Error("Unexpected end of string. Closing quote is missing.");
|
|
291
|
+
}
|
|
286
292
|
return tokens;
|
|
287
293
|
};
|
|
288
294
|
|
|
@@ -636,7 +642,7 @@ async function gitCommit(operation) {
|
|
|
636
642
|
args.push("--message", commitMessage);
|
|
637
643
|
if (!all)
|
|
638
644
|
args = args.concat(updatedFiles);
|
|
639
|
-
await (0, import_tinyexec2.x)("git", ["commit", ...args]);
|
|
645
|
+
await (0, import_tinyexec2.x)("git", ["commit", ...args], { throwOnError: true });
|
|
640
646
|
return operation.update({ event: "git commit" /* GitCommit */, commitMessage });
|
|
641
647
|
}
|
|
642
648
|
async function gitTag(operation) {
|
|
@@ -657,15 +663,15 @@ async function gitTag(operation) {
|
|
|
657
663
|
if (operation.options.sign) {
|
|
658
664
|
args.push("--sign");
|
|
659
665
|
}
|
|
660
|
-
await (0, import_tinyexec2.x)("git", ["tag", ...args]);
|
|
666
|
+
await (0, import_tinyexec2.x)("git", ["tag", ...args], { throwOnError: true });
|
|
661
667
|
return operation.update({ event: "git tag" /* GitTag */, tagName });
|
|
662
668
|
}
|
|
663
669
|
async function gitPush(operation) {
|
|
664
670
|
if (!operation.options.push)
|
|
665
671
|
return operation;
|
|
666
|
-
await (0, import_tinyexec2.x)("git", ["push"]);
|
|
672
|
+
await (0, import_tinyexec2.x)("git", ["push"], { throwOnError: true });
|
|
667
673
|
if (operation.options.tag) {
|
|
668
|
-
await (0, import_tinyexec2.x)("git", ["push", "--tags"]);
|
|
674
|
+
await (0, import_tinyexec2.x)("git", ["push", "--tags"], { throwOnError: true });
|
|
669
675
|
}
|
|
670
676
|
return operation.update({ event: "git push" /* GitPush */ });
|
|
671
677
|
}
|
|
@@ -688,6 +694,7 @@ async function normalizeOptions(raw) {
|
|
|
688
694
|
const sign = Boolean(raw.sign);
|
|
689
695
|
const push = Boolean(raw.push);
|
|
690
696
|
const all = Boolean(raw.all);
|
|
697
|
+
const install = Boolean(raw.install);
|
|
691
698
|
const noVerify = Boolean(raw.noVerify);
|
|
692
699
|
const cwd = raw.cwd || import_node_process3.default.cwd();
|
|
693
700
|
const ignoreScripts = Boolean(raw.ignoreScripts);
|
|
@@ -767,6 +774,7 @@ async function normalizeOptions(raw) {
|
|
|
767
774
|
push,
|
|
768
775
|
files,
|
|
769
776
|
cwd,
|
|
777
|
+
install,
|
|
770
778
|
interface: ui,
|
|
771
779
|
ignoreScripts,
|
|
772
780
|
execute,
|
|
@@ -957,6 +965,27 @@ async function versionBump(arg = {}) {
|
|
|
957
965
|
}
|
|
958
966
|
await runNpmScript("preversion" /* PreVersion */, operation);
|
|
959
967
|
await updateFiles(operation);
|
|
968
|
+
if (operation.options.install) {
|
|
969
|
+
const { detect } = await import("package-manager-detector/detect");
|
|
970
|
+
const pm = await detect();
|
|
971
|
+
if (!(pm == null ? void 0 : pm.name)) {
|
|
972
|
+
throw new Error("Could not detect package manager, failed to run npm install");
|
|
973
|
+
}
|
|
974
|
+
const { COMMANDS, constructCommand } = await import("package-manager-detector/commands");
|
|
975
|
+
const command = constructCommand(COMMANDS[pm.name].install, []);
|
|
976
|
+
if (!command) {
|
|
977
|
+
throw new Error("Could not find install command for package manager");
|
|
978
|
+
}
|
|
979
|
+
console.log(symbols_exports.info, "Installing dependencies with", `${command.command} ${command.args.join(" ")}`);
|
|
980
|
+
await (0, import_tinyexec4.x)(command.command, command.args, {
|
|
981
|
+
throwOnError: true,
|
|
982
|
+
nodeOptions: {
|
|
983
|
+
stdio: "inherit",
|
|
984
|
+
cwd: operation.options.cwd
|
|
985
|
+
}
|
|
986
|
+
});
|
|
987
|
+
console.log(symbols_exports.success, "Dependencies installed");
|
|
988
|
+
}
|
|
960
989
|
if (operation.options.execute) {
|
|
961
990
|
if (typeof operation.options.execute === "function") {
|
|
962
991
|
await operation.options.execute(operation);
|
|
@@ -964,6 +993,7 @@ async function versionBump(arg = {}) {
|
|
|
964
993
|
const [command, ...args] = tokenizeArgs(operation.options.execute);
|
|
965
994
|
console.log(symbols_exports.info, "Executing script", command, ...args);
|
|
966
995
|
await (0, import_tinyexec4.x)(command, args, {
|
|
996
|
+
throwOnError: true,
|
|
967
997
|
nodeOptions: {
|
|
968
998
|
stdio: "inherit",
|
|
969
999
|
cwd: operation.options.cwd
|
|
@@ -990,6 +1020,8 @@ function printSummary(operation) {
|
|
|
990
1020
|
console.log(` execute ${import_picocolors3.default.bold(typeof operation.options.execute === "function" ? "function" : operation.options.execute)}`);
|
|
991
1021
|
if (operation.options.push)
|
|
992
1022
|
console.log(` push ${import_picocolors3.default.cyan(import_picocolors3.default.bold("yes"))}`);
|
|
1023
|
+
if (operation.options.install)
|
|
1024
|
+
console.log(` install ${import_picocolors3.default.cyan(import_picocolors3.default.bold("yes"))}`);
|
|
993
1025
|
console.log();
|
|
994
1026
|
console.log(` from ${import_picocolors3.default.bold(operation.state.currentVersion)}`);
|
|
995
1027
|
console.log(` to ${import_picocolors3.default.green(import_picocolors3.default.bold(operation.state.newVersion))}`);
|
|
@@ -1003,7 +1035,7 @@ var import_picocolors4 = __toESM(require_picocolors());
|
|
|
1003
1035
|
var import_semver3 = require("semver");
|
|
1004
1036
|
|
|
1005
1037
|
// package.json
|
|
1006
|
-
var version = "9.
|
|
1038
|
+
var version = "9.10.0";
|
|
1007
1039
|
|
|
1008
1040
|
// src/config.ts
|
|
1009
1041
|
var import_node_path2 = require("path");
|
|
@@ -1015,6 +1047,7 @@ var bumpConfigDefaults = {
|
|
|
1015
1047
|
push: true,
|
|
1016
1048
|
tag: true,
|
|
1017
1049
|
sign: false,
|
|
1050
|
+
install: false,
|
|
1018
1051
|
recursive: false,
|
|
1019
1052
|
noVerify: false,
|
|
1020
1053
|
confirm: true,
|
|
@@ -1079,6 +1112,7 @@ async function parseArgs() {
|
|
|
1079
1112
|
noGitCheck: args.noGitCheck,
|
|
1080
1113
|
confirm: !args.yes,
|
|
1081
1114
|
noVerify: !args.verify,
|
|
1115
|
+
install: args.install,
|
|
1082
1116
|
files: [...args["--"] || [], ...resultArgs],
|
|
1083
1117
|
ignoreScripts: args.ignoreScripts,
|
|
1084
1118
|
currentVersion: args.currentVersion,
|
|
@@ -1103,7 +1137,7 @@ async function parseArgs() {
|
|
|
1103
1137
|
}
|
|
1104
1138
|
function loadCliArgs(argv = import_node_process6.default.argv) {
|
|
1105
1139
|
const cli = (0, import_cac.default)("bumpp");
|
|
1106
|
-
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();
|
|
1140
|
+
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("--install", `Run 'npm install' after bumping version (default: ${bumpConfigDefaults.install})`, { default: false }).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();
|
|
1107
1141
|
const result = cli.parse(argv);
|
|
1108
1142
|
const rawArgs = cli.rawArgs;
|
|
1109
1143
|
const args = result.options;
|
package/dist/cli/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
require_picocolors,
|
|
11
11
|
symbols_exports,
|
|
12
12
|
versionBump
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-QXSKCVPH.mjs";
|
|
14
14
|
|
|
15
15
|
// src/cli/index.ts
|
|
16
16
|
import process2 from "node:process";
|
|
@@ -23,7 +23,7 @@ import cac from "cac";
|
|
|
23
23
|
import { valid as isValidVersion } from "semver";
|
|
24
24
|
|
|
25
25
|
// package.json
|
|
26
|
-
var version = "9.
|
|
26
|
+
var version = "9.10.0";
|
|
27
27
|
|
|
28
28
|
// src/cli/parse-args.ts
|
|
29
29
|
async function parseArgs() {
|
|
@@ -44,6 +44,7 @@ async function parseArgs() {
|
|
|
44
44
|
noGitCheck: args.noGitCheck,
|
|
45
45
|
confirm: !args.yes,
|
|
46
46
|
noVerify: !args.verify,
|
|
47
|
+
install: args.install,
|
|
47
48
|
files: [...args["--"] || [], ...resultArgs],
|
|
48
49
|
ignoreScripts: args.ignoreScripts,
|
|
49
50
|
currentVersion: args.currentVersion,
|
|
@@ -68,7 +69,7 @@ async function parseArgs() {
|
|
|
68
69
|
}
|
|
69
70
|
function loadCliArgs(argv = process.argv) {
|
|
70
71
|
const cli = cac("bumpp");
|
|
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();
|
|
72
|
+
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("--install", `Run 'npm install' after bumping version (default: ${bumpConfigDefaults.install})`, { default: false }).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();
|
|
72
73
|
const result = cli.parse(argv);
|
|
73
74
|
const rawArgs = cli.rawArgs;
|
|
74
75
|
const args = result.options;
|
package/dist/index.d.mts
CHANGED
|
@@ -49,6 +49,7 @@ interface NormalizedOptions {
|
|
|
49
49
|
push: boolean;
|
|
50
50
|
files: string[];
|
|
51
51
|
cwd: string;
|
|
52
|
+
install: boolean;
|
|
52
53
|
interface: Interface;
|
|
53
54
|
ignoreScripts: boolean;
|
|
54
55
|
execute?: string | ((config: Operation) => void | PromiseLike<void>);
|
|
@@ -227,6 +228,12 @@ interface VersionBumpOptions {
|
|
|
227
228
|
* Defaults to `true`.
|
|
228
229
|
*/
|
|
229
230
|
push?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Run `npm install` after bumping the version number.
|
|
233
|
+
*
|
|
234
|
+
* Defaults to `false`.
|
|
235
|
+
*/
|
|
236
|
+
install?: boolean;
|
|
230
237
|
/**
|
|
231
238
|
* Indicates whether the git commit should include ALL files (`git commit --all`)
|
|
232
239
|
* rather than just the files that were modified by `versionBump()`.
|
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ interface NormalizedOptions {
|
|
|
49
49
|
push: boolean;
|
|
50
50
|
files: string[];
|
|
51
51
|
cwd: string;
|
|
52
|
+
install: boolean;
|
|
52
53
|
interface: Interface;
|
|
53
54
|
ignoreScripts: boolean;
|
|
54
55
|
execute?: string | ((config: Operation) => void | PromiseLike<void>);
|
|
@@ -227,6 +228,12 @@ interface VersionBumpOptions {
|
|
|
227
228
|
* Defaults to `true`.
|
|
228
229
|
*/
|
|
229
230
|
push?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Run `npm install` after bumping the version number.
|
|
233
|
+
*
|
|
234
|
+
* Defaults to `false`.
|
|
235
|
+
*/
|
|
236
|
+
install?: boolean;
|
|
230
237
|
/**
|
|
231
238
|
* Indicates whether the git commit should include ALL files (`git commit --all`)
|
|
232
239
|
* rather than just the files that were modified by `versionBump()`.
|
package/dist/index.js
CHANGED
|
@@ -147,9 +147,9 @@ module.exports = __toCommonJS(src_exports);
|
|
|
147
147
|
// src/version-bump.ts
|
|
148
148
|
var import_node_process4 = __toESM(require("process"));
|
|
149
149
|
|
|
150
|
-
// node_modules/.pnpm/args-tokenizer@0.
|
|
150
|
+
// node_modules/.pnpm/args-tokenizer@0.3.0/node_modules/args-tokenizer/dist/args-tokenizer.js
|
|
151
151
|
var spaceRegex = /\s/;
|
|
152
|
-
var tokenizeArgs = (argsString) => {
|
|
152
|
+
var tokenizeArgs = (argsString, options) => {
|
|
153
153
|
const tokens = [];
|
|
154
154
|
let currentToken = "";
|
|
155
155
|
let openningQuote;
|
|
@@ -189,6 +189,12 @@ var tokenizeArgs = (argsString) => {
|
|
|
189
189
|
if (currentToken.length > 0) {
|
|
190
190
|
tokens.push(currentToken);
|
|
191
191
|
}
|
|
192
|
+
if (options == null ? void 0 : options.loose) {
|
|
193
|
+
return tokens;
|
|
194
|
+
}
|
|
195
|
+
if (openningQuote) {
|
|
196
|
+
throw Error("Unexpected end of string. Closing quote is missing.");
|
|
197
|
+
}
|
|
192
198
|
return tokens;
|
|
193
199
|
};
|
|
194
200
|
|
|
@@ -657,7 +663,7 @@ async function gitCommit(operation) {
|
|
|
657
663
|
args.push("--message", commitMessage);
|
|
658
664
|
if (!all)
|
|
659
665
|
args = args.concat(updatedFiles);
|
|
660
|
-
await (0, import_tinyexec2.x)("git", ["commit", ...args]);
|
|
666
|
+
await (0, import_tinyexec2.x)("git", ["commit", ...args], { throwOnError: true });
|
|
661
667
|
return operation.update({ event: "git commit" /* GitCommit */, commitMessage });
|
|
662
668
|
}
|
|
663
669
|
async function gitTag(operation) {
|
|
@@ -678,15 +684,15 @@ async function gitTag(operation) {
|
|
|
678
684
|
if (operation.options.sign) {
|
|
679
685
|
args.push("--sign");
|
|
680
686
|
}
|
|
681
|
-
await (0, import_tinyexec2.x)("git", ["tag", ...args]);
|
|
687
|
+
await (0, import_tinyexec2.x)("git", ["tag", ...args], { throwOnError: true });
|
|
682
688
|
return operation.update({ event: "git tag" /* GitTag */, tagName });
|
|
683
689
|
}
|
|
684
690
|
async function gitPush(operation) {
|
|
685
691
|
if (!operation.options.push)
|
|
686
692
|
return operation;
|
|
687
|
-
await (0, import_tinyexec2.x)("git", ["push"]);
|
|
693
|
+
await (0, import_tinyexec2.x)("git", ["push"], { throwOnError: true });
|
|
688
694
|
if (operation.options.tag) {
|
|
689
|
-
await (0, import_tinyexec2.x)("git", ["push", "--tags"]);
|
|
695
|
+
await (0, import_tinyexec2.x)("git", ["push", "--tags"], { throwOnError: true });
|
|
690
696
|
}
|
|
691
697
|
return operation.update({ event: "git push" /* GitPush */ });
|
|
692
698
|
}
|
|
@@ -709,6 +715,7 @@ async function normalizeOptions(raw) {
|
|
|
709
715
|
const sign = Boolean(raw.sign);
|
|
710
716
|
const push = Boolean(raw.push);
|
|
711
717
|
const all = Boolean(raw.all);
|
|
718
|
+
const install = Boolean(raw.install);
|
|
712
719
|
const noVerify = Boolean(raw.noVerify);
|
|
713
720
|
const cwd = raw.cwd || import_node_process3.default.cwd();
|
|
714
721
|
const ignoreScripts = Boolean(raw.ignoreScripts);
|
|
@@ -788,6 +795,7 @@ async function normalizeOptions(raw) {
|
|
|
788
795
|
push,
|
|
789
796
|
files,
|
|
790
797
|
cwd,
|
|
798
|
+
install,
|
|
791
799
|
interface: ui,
|
|
792
800
|
ignoreScripts,
|
|
793
801
|
execute,
|
|
@@ -978,6 +986,27 @@ async function versionBump(arg = {}) {
|
|
|
978
986
|
}
|
|
979
987
|
await runNpmScript("preversion" /* PreVersion */, operation);
|
|
980
988
|
await updateFiles(operation);
|
|
989
|
+
if (operation.options.install) {
|
|
990
|
+
const { detect } = await import("package-manager-detector/detect");
|
|
991
|
+
const pm = await detect();
|
|
992
|
+
if (!(pm == null ? void 0 : pm.name)) {
|
|
993
|
+
throw new Error("Could not detect package manager, failed to run npm install");
|
|
994
|
+
}
|
|
995
|
+
const { COMMANDS, constructCommand } = await import("package-manager-detector/commands");
|
|
996
|
+
const command = constructCommand(COMMANDS[pm.name].install, []);
|
|
997
|
+
if (!command) {
|
|
998
|
+
throw new Error("Could not find install command for package manager");
|
|
999
|
+
}
|
|
1000
|
+
console.log(symbols_exports.info, "Installing dependencies with", `${command.command} ${command.args.join(" ")}`);
|
|
1001
|
+
await (0, import_tinyexec4.x)(command.command, command.args, {
|
|
1002
|
+
throwOnError: true,
|
|
1003
|
+
nodeOptions: {
|
|
1004
|
+
stdio: "inherit",
|
|
1005
|
+
cwd: operation.options.cwd
|
|
1006
|
+
}
|
|
1007
|
+
});
|
|
1008
|
+
console.log(symbols_exports.success, "Dependencies installed");
|
|
1009
|
+
}
|
|
981
1010
|
if (operation.options.execute) {
|
|
982
1011
|
if (typeof operation.options.execute === "function") {
|
|
983
1012
|
await operation.options.execute(operation);
|
|
@@ -985,6 +1014,7 @@ async function versionBump(arg = {}) {
|
|
|
985
1014
|
const [command, ...args] = tokenizeArgs(operation.options.execute);
|
|
986
1015
|
console.log(symbols_exports.info, "Executing script", command, ...args);
|
|
987
1016
|
await (0, import_tinyexec4.x)(command, args, {
|
|
1017
|
+
throwOnError: true,
|
|
988
1018
|
nodeOptions: {
|
|
989
1019
|
stdio: "inherit",
|
|
990
1020
|
cwd: operation.options.cwd
|
|
@@ -1011,6 +1041,8 @@ function printSummary(operation) {
|
|
|
1011
1041
|
console.log(` execute ${import_picocolors3.default.bold(typeof operation.options.execute === "function" ? "function" : operation.options.execute)}`);
|
|
1012
1042
|
if (operation.options.push)
|
|
1013
1043
|
console.log(` push ${import_picocolors3.default.cyan(import_picocolors3.default.bold("yes"))}`);
|
|
1044
|
+
if (operation.options.install)
|
|
1045
|
+
console.log(` install ${import_picocolors3.default.cyan(import_picocolors3.default.bold("yes"))}`);
|
|
1014
1046
|
console.log();
|
|
1015
1047
|
console.log(` from ${import_picocolors3.default.bold(operation.state.currentVersion)}`);
|
|
1016
1048
|
console.log(` to ${import_picocolors3.default.green(import_picocolors3.default.bold(operation.state.newVersion))}`);
|
|
@@ -1035,6 +1067,7 @@ var bumpConfigDefaults = {
|
|
|
1035
1067
|
push: true,
|
|
1036
1068
|
tag: true,
|
|
1037
1069
|
sign: false,
|
|
1070
|
+
install: false,
|
|
1038
1071
|
recursive: false,
|
|
1039
1072
|
noVerify: false,
|
|
1040
1073
|
confirm: true,
|
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.15.
|
|
3
|
+
"version": "9.10.0",
|
|
4
|
+
"packageManager": "pnpm@9.15.3",
|
|
5
5
|
"description": "Bump version, commit changes, tag, and push to Git",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "James Messinger",
|
|
@@ -65,18 +65,19 @@
|
|
|
65
65
|
"escalade": "^3.2.0",
|
|
66
66
|
"js-yaml": "^4.1.0",
|
|
67
67
|
"jsonc-parser": "^3.3.1",
|
|
68
|
+
"package-manager-detector": "^0.2.8",
|
|
68
69
|
"prompts": "^2.4.2",
|
|
69
70
|
"semver": "^7.6.3",
|
|
70
|
-
"tinyexec": "^0.3.
|
|
71
|
+
"tinyexec": "^0.3.2",
|
|
71
72
|
"tinyglobby": "^0.2.10"
|
|
72
73
|
},
|
|
73
74
|
"devDependencies": {
|
|
74
|
-
"@antfu/eslint-config": "^3.12.
|
|
75
|
+
"@antfu/eslint-config": "^3.12.2",
|
|
75
76
|
"@types/js-yaml": "^4.0.9",
|
|
76
|
-
"@types/node": "^22.10.
|
|
77
|
+
"@types/node": "^22.10.5",
|
|
77
78
|
"@types/prompts": "^2.4.9",
|
|
78
79
|
"@types/semver": "^7.5.8",
|
|
79
|
-
"args-tokenizer": "^0.
|
|
80
|
+
"args-tokenizer": "^0.3.0",
|
|
80
81
|
"eslint": "^9.17.0",
|
|
81
82
|
"esno": "^4.8.0",
|
|
82
83
|
"log-symbols": "^7.0.0",
|
|
@@ -84,7 +85,7 @@
|
|
|
84
85
|
"picocolors": "^1.1.1",
|
|
85
86
|
"rimraf": "^6.0.1",
|
|
86
87
|
"tsup": "^8.3.5",
|
|
87
|
-
"typescript": "^5.7.
|
|
88
|
+
"typescript": "^5.7.3",
|
|
88
89
|
"vitest": "^2.1.8"
|
|
89
90
|
}
|
|
90
91
|
}
|