bumpp 9.9.3 → 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.
@@ -699,6 +699,7 @@ async function normalizeOptions(raw) {
699
699
  const sign = Boolean(raw.sign);
700
700
  const push = Boolean(raw.push);
701
701
  const all = Boolean(raw.all);
702
+ const install = Boolean(raw.install);
702
703
  const noVerify = Boolean(raw.noVerify);
703
704
  const cwd = raw.cwd || process4.cwd();
704
705
  const ignoreScripts = Boolean(raw.ignoreScripts);
@@ -778,6 +779,7 @@ async function normalizeOptions(raw) {
778
779
  push,
779
780
  files,
780
781
  cwd,
782
+ install,
781
783
  interface: ui,
782
784
  ignoreScripts,
783
785
  execute,
@@ -968,6 +970,27 @@ async function versionBump(arg = {}) {
968
970
  }
969
971
  await runNpmScript("preversion" /* PreVersion */, operation);
970
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
+ }
971
994
  if (operation.options.execute) {
972
995
  if (typeof operation.options.execute === "function") {
973
996
  await operation.options.execute(operation);
@@ -1002,6 +1025,8 @@ function printSummary(operation) {
1002
1025
  console.log(` execute ${import_picocolors3.default.bold(typeof operation.options.execute === "function" ? "function" : operation.options.execute)}`);
1003
1026
  if (operation.options.push)
1004
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"))}`);
1005
1030
  console.log();
1006
1031
  console.log(` from ${import_picocolors3.default.bold(operation.state.currentVersion)}`);
1007
1032
  console.log(` to ${import_picocolors3.default.green(import_picocolors3.default.bold(operation.state.newVersion))}`);
@@ -1026,6 +1051,7 @@ var bumpConfigDefaults = {
1026
1051
  push: true,
1027
1052
  tag: true,
1028
1053
  sign: false,
1054
+ install: false,
1029
1055
  recursive: false,
1030
1056
  noVerify: false,
1031
1057
  confirm: true,
package/dist/cli/index.js CHANGED
@@ -694,6 +694,7 @@ async function normalizeOptions(raw) {
694
694
  const sign = Boolean(raw.sign);
695
695
  const push = Boolean(raw.push);
696
696
  const all = Boolean(raw.all);
697
+ const install = Boolean(raw.install);
697
698
  const noVerify = Boolean(raw.noVerify);
698
699
  const cwd = raw.cwd || import_node_process3.default.cwd();
699
700
  const ignoreScripts = Boolean(raw.ignoreScripts);
@@ -773,6 +774,7 @@ async function normalizeOptions(raw) {
773
774
  push,
774
775
  files,
775
776
  cwd,
777
+ install,
776
778
  interface: ui,
777
779
  ignoreScripts,
778
780
  execute,
@@ -963,6 +965,27 @@ async function versionBump(arg = {}) {
963
965
  }
964
966
  await runNpmScript("preversion" /* PreVersion */, operation);
965
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
+ }
966
989
  if (operation.options.execute) {
967
990
  if (typeof operation.options.execute === "function") {
968
991
  await operation.options.execute(operation);
@@ -997,6 +1020,8 @@ function printSummary(operation) {
997
1020
  console.log(` execute ${import_picocolors3.default.bold(typeof operation.options.execute === "function" ? "function" : operation.options.execute)}`);
998
1021
  if (operation.options.push)
999
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"))}`);
1000
1025
  console.log();
1001
1026
  console.log(` from ${import_picocolors3.default.bold(operation.state.currentVersion)}`);
1002
1027
  console.log(` to ${import_picocolors3.default.green(import_picocolors3.default.bold(operation.state.newVersion))}`);
@@ -1010,7 +1035,7 @@ var import_picocolors4 = __toESM(require_picocolors());
1010
1035
  var import_semver3 = require("semver");
1011
1036
 
1012
1037
  // package.json
1013
- var version = "9.9.3";
1038
+ var version = "9.10.0";
1014
1039
 
1015
1040
  // src/config.ts
1016
1041
  var import_node_path2 = require("path");
@@ -1022,6 +1047,7 @@ var bumpConfigDefaults = {
1022
1047
  push: true,
1023
1048
  tag: true,
1024
1049
  sign: false,
1050
+ install: false,
1025
1051
  recursive: false,
1026
1052
  noVerify: false,
1027
1053
  confirm: true,
@@ -1086,6 +1112,7 @@ async function parseArgs() {
1086
1112
  noGitCheck: args.noGitCheck,
1087
1113
  confirm: !args.yes,
1088
1114
  noVerify: !args.verify,
1115
+ install: args.install,
1089
1116
  files: [...args["--"] || [], ...resultArgs],
1090
1117
  ignoreScripts: args.ignoreScripts,
1091
1118
  currentVersion: args.currentVersion,
@@ -1110,7 +1137,7 @@ async function parseArgs() {
1110
1137
  }
1111
1138
  function loadCliArgs(argv = import_node_process6.default.argv) {
1112
1139
  const cli = (0, import_cac.default)("bumpp");
1113
- 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();
1114
1141
  const result = cli.parse(argv);
1115
1142
  const rawArgs = cli.rawArgs;
1116
1143
  const args = result.options;
@@ -10,7 +10,7 @@ import {
10
10
  require_picocolors,
11
11
  symbols_exports,
12
12
  versionBump
13
- } from "../chunk-H7UXDA7O.mjs";
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.9.3";
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
@@ -715,6 +715,7 @@ async function normalizeOptions(raw) {
715
715
  const sign = Boolean(raw.sign);
716
716
  const push = Boolean(raw.push);
717
717
  const all = Boolean(raw.all);
718
+ const install = Boolean(raw.install);
718
719
  const noVerify = Boolean(raw.noVerify);
719
720
  const cwd = raw.cwd || import_node_process3.default.cwd();
720
721
  const ignoreScripts = Boolean(raw.ignoreScripts);
@@ -794,6 +795,7 @@ async function normalizeOptions(raw) {
794
795
  push,
795
796
  files,
796
797
  cwd,
798
+ install,
797
799
  interface: ui,
798
800
  ignoreScripts,
799
801
  execute,
@@ -984,6 +986,27 @@ async function versionBump(arg = {}) {
984
986
  }
985
987
  await runNpmScript("preversion" /* PreVersion */, operation);
986
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
+ }
987
1010
  if (operation.options.execute) {
988
1011
  if (typeof operation.options.execute === "function") {
989
1012
  await operation.options.execute(operation);
@@ -1018,6 +1041,8 @@ function printSummary(operation) {
1018
1041
  console.log(` execute ${import_picocolors3.default.bold(typeof operation.options.execute === "function" ? "function" : operation.options.execute)}`);
1019
1042
  if (operation.options.push)
1020
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"))}`);
1021
1046
  console.log();
1022
1047
  console.log(` from ${import_picocolors3.default.bold(operation.state.currentVersion)}`);
1023
1048
  console.log(` to ${import_picocolors3.default.green(import_picocolors3.default.bold(operation.state.newVersion))}`);
@@ -1042,6 +1067,7 @@ var bumpConfigDefaults = {
1042
1067
  push: true,
1043
1068
  tag: true,
1044
1069
  sign: false,
1070
+ install: false,
1045
1071
  recursive: false,
1046
1072
  noVerify: false,
1047
1073
  confirm: true,
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  loadBumpConfig,
8
8
  versionBump,
9
9
  versionBumpInfo
10
- } from "./chunk-H7UXDA7O.mjs";
10
+ } from "./chunk-QXSKCVPH.mjs";
11
11
 
12
12
  // src/index.ts
13
13
  var src_default = versionBump;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bumpp",
3
- "version": "9.9.3",
3
+ "version": "9.10.0",
4
4
  "packageManager": "pnpm@9.15.3",
5
5
  "description": "Bump version, commit changes, tag, and push to Git",
6
6
  "author": {
@@ -65,13 +65,14 @@
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
71
  "tinyexec": "^0.3.2",
71
72
  "tinyglobby": "^0.2.10"
72
73
  },
73
74
  "devDependencies": {
74
- "@antfu/eslint-config": "^3.12.1",
75
+ "@antfu/eslint-config": "^3.12.2",
75
76
  "@types/js-yaml": "^4.0.9",
76
77
  "@types/node": "^22.10.5",
77
78
  "@types/prompts": "^2.4.9",
@@ -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.2",
88
+ "typescript": "^5.7.3",
88
89
  "vitest": "^2.1.8"
89
90
  }
90
91
  }