bumpp 9.4.0 → 9.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1012,9 +1012,12 @@ function formatVersionString(template, newVersion) {
1012
1012
 
1013
1013
  // src/normalize-options.ts
1014
1014
  import process5 from "process";
1015
+ import fs2 from "fs/promises";
1016
+ import fsSync from "fs";
1015
1017
  import fg from "fast-glob";
1018
+ import yaml from "js-yaml";
1016
1019
  async function normalizeOptions(raw) {
1017
- var _a;
1020
+ var _a, _b;
1018
1021
  const preid = typeof raw.preid === "string" ? raw.preid : "beta";
1019
1022
  const push = Boolean(raw.push);
1020
1023
  const all = Boolean(raw.all);
@@ -1022,6 +1025,7 @@ async function normalizeOptions(raw) {
1022
1025
  const cwd = raw.cwd || process5.cwd();
1023
1026
  const ignoreScripts = Boolean(raw.ignoreScripts);
1024
1027
  const execute = raw.execute;
1028
+ const recursive = Boolean(raw.recursive);
1025
1029
  let release;
1026
1030
  if (!raw.release || raw.release === "prompt")
1027
1031
  release = { type: "prompt", preid };
@@ -1039,8 +1043,29 @@ async function normalizeOptions(raw) {
1039
1043
  commit = { all, noVerify, message: raw.commit };
1040
1044
  else if (raw.commit || tag || push)
1041
1045
  commit = { all, noVerify, message: "chore: release v" };
1046
+ if (recursive && !((_a = raw.files) == null ? void 0 : _a.length)) {
1047
+ raw.files = [
1048
+ "package.json",
1049
+ "package-lock.json",
1050
+ "packages/**/package.json",
1051
+ "jsr.json",
1052
+ "jsr.jsonc"
1053
+ ];
1054
+ if (fsSync.existsSync("pnpm-workspace.yaml")) {
1055
+ const pnpmWorkspace = await fs2.readFile("pnpm-workspace.yaml", "utf8");
1056
+ const workspaces = yaml.load(pnpmWorkspace);
1057
+ const workspacesWithPackageJson = workspaces.packages.map((workspace) => `${workspace}/package.json`);
1058
+ const withoutExcludedWorkspaces = workspacesWithPackageJson.filter((workspace) => {
1059
+ var _a2;
1060
+ return !workspace.startsWith("!") && !((_a2 = raw.files) == null ? void 0 : _a2.includes(workspace));
1061
+ });
1062
+ raw.files = raw.files.concat(withoutExcludedWorkspaces);
1063
+ }
1064
+ } else {
1065
+ raw.files = ((_b = raw.files) == null ? void 0 : _b.length) ? raw.files : ["package.json", "package-lock.json", "jsr.json", "jsr.jsonc"];
1066
+ }
1042
1067
  const files = await fg(
1043
- ((_a = raw.files) == null ? void 0 : _a.length) ? raw.files : ["package.json", "package-lock.json", "jsr.json", "jsr.jsonc"],
1068
+ raw.files,
1044
1069
  {
1045
1070
  cwd,
1046
1071
  onlyFiles: true,
@@ -1055,7 +1080,7 @@ async function normalizeOptions(raw) {
1055
1080
  } else if (raw.interface === true || !raw.interface) {
1056
1081
  ui = { input: process5.stdin, output: process5.stdout };
1057
1082
  } else {
1058
- let _b = raw.interface, { input, output } = _b, other = __objRest(_b, ["input", "output"]);
1083
+ let _c = raw.interface, { input, output } = _c, other = __objRest(_c, ["input", "output"]);
1059
1084
  if (input === true || input !== false && !input)
1060
1085
  input = process5.stdin;
1061
1086
  if (output === true || output !== false && !output)
package/dist/cli/index.js CHANGED
@@ -628,7 +628,7 @@ var logSymbols = isUnicodeSupported() ? main : fallback;
628
628
  var log_symbols_default = logSymbols;
629
629
 
630
630
  // package.json
631
- var version = "9.4.0";
631
+ var version = "9.4.1";
632
632
 
633
633
  // src/version-bump.ts
634
634
  var import_node_process5 = __toESM(require("process"));
@@ -1005,9 +1005,12 @@ function formatVersionString(template, newVersion) {
1005
1005
 
1006
1006
  // src/normalize-options.ts
1007
1007
  var import_node_process4 = __toESM(require("process"));
1008
+ var import_promises = __toESM(require("fs/promises"));
1009
+ var import_node_fs2 = __toESM(require("fs"));
1008
1010
  var import_fast_glob = __toESM(require("fast-glob"));
1011
+ var import_js_yaml = __toESM(require("js-yaml"));
1009
1012
  async function normalizeOptions(raw) {
1010
- var _a;
1013
+ var _a, _b;
1011
1014
  const preid = typeof raw.preid === "string" ? raw.preid : "beta";
1012
1015
  const push = Boolean(raw.push);
1013
1016
  const all = Boolean(raw.all);
@@ -1015,6 +1018,7 @@ async function normalizeOptions(raw) {
1015
1018
  const cwd = raw.cwd || import_node_process4.default.cwd();
1016
1019
  const ignoreScripts = Boolean(raw.ignoreScripts);
1017
1020
  const execute = raw.execute;
1021
+ const recursive = Boolean(raw.recursive);
1018
1022
  let release;
1019
1023
  if (!raw.release || raw.release === "prompt")
1020
1024
  release = { type: "prompt", preid };
@@ -1032,8 +1036,29 @@ async function normalizeOptions(raw) {
1032
1036
  commit = { all, noVerify, message: raw.commit };
1033
1037
  else if (raw.commit || tag || push)
1034
1038
  commit = { all, noVerify, message: "chore: release v" };
1039
+ if (recursive && !((_a = raw.files) == null ? void 0 : _a.length)) {
1040
+ raw.files = [
1041
+ "package.json",
1042
+ "package-lock.json",
1043
+ "packages/**/package.json",
1044
+ "jsr.json",
1045
+ "jsr.jsonc"
1046
+ ];
1047
+ if (import_node_fs2.default.existsSync("pnpm-workspace.yaml")) {
1048
+ const pnpmWorkspace = await import_promises.default.readFile("pnpm-workspace.yaml", "utf8");
1049
+ const workspaces = import_js_yaml.default.load(pnpmWorkspace);
1050
+ const workspacesWithPackageJson = workspaces.packages.map((workspace) => `${workspace}/package.json`);
1051
+ const withoutExcludedWorkspaces = workspacesWithPackageJson.filter((workspace) => {
1052
+ var _a2;
1053
+ return !workspace.startsWith("!") && !((_a2 = raw.files) == null ? void 0 : _a2.includes(workspace));
1054
+ });
1055
+ raw.files = raw.files.concat(withoutExcludedWorkspaces);
1056
+ }
1057
+ } else {
1058
+ raw.files = ((_b = raw.files) == null ? void 0 : _b.length) ? raw.files : ["package.json", "package-lock.json", "jsr.json", "jsr.jsonc"];
1059
+ }
1035
1060
  const files = await (0, import_fast_glob.default)(
1036
- ((_a = raw.files) == null ? void 0 : _a.length) ? raw.files : ["package.json", "package-lock.json", "jsr.json", "jsr.jsonc"],
1061
+ raw.files,
1037
1062
  {
1038
1063
  cwd,
1039
1064
  onlyFiles: true,
@@ -1048,7 +1073,7 @@ async function normalizeOptions(raw) {
1048
1073
  } else if (raw.interface === true || !raw.interface) {
1049
1074
  ui = { input: import_node_process4.default.stdin, output: import_node_process4.default.stdout };
1050
1075
  } else {
1051
- let _b = raw.interface, { input, output } = _b, other = __objRest(_b, ["input", "output"]);
1076
+ let _c = raw.interface, { input, output } = _c, other = __objRest(_c, ["input", "output"]);
1052
1077
  if (input === true || input !== false && !input)
1053
1078
  input = import_node_process4.default.stdin;
1054
1079
  if (output === true || output !== false && !output)
@@ -1268,12 +1293,9 @@ function printSummary(operation) {
1268
1293
 
1269
1294
  // src/cli/parse-args.ts
1270
1295
  var import_node_process7 = __toESM(require("process"));
1271
- var import_promises = __toESM(require("fs/promises"));
1272
- var import_node_fs2 = __toESM(require("fs"));
1273
1296
  var import_semver3 = require("semver");
1274
1297
  var import_cac = __toESM(require("cac"));
1275
1298
  var import_picocolors3 = __toESM(require_picocolors());
1276
- var import_js_yaml = __toESM(require("js-yaml"));
1277
1299
 
1278
1300
  // src/config.ts
1279
1301
  var import_node_process6 = __toESM(require("process"));
@@ -1359,29 +1381,8 @@ async function parseArgs() {
1359
1381
  parsedArgs.options.files.shift();
1360
1382
  }
1361
1383
  }
1362
- if (parsedArgs.options.recursive) {
1363
- if ((_a = parsedArgs.options.files) == null ? void 0 : _a.length) {
1364
- console.log(import_picocolors3.default.yellow("The --recursive option is ignored when files are specified"));
1365
- } else {
1366
- parsedArgs.options.files = [
1367
- "package.json",
1368
- "package-lock.json",
1369
- "packages/**/package.json",
1370
- "jsr.json",
1371
- "jsr.jsonc"
1372
- ];
1373
- if (import_node_fs2.default.existsSync("pnpm-workspace.yaml")) {
1374
- const pnpmWorkspace = await import_promises.default.readFile("pnpm-workspace.yaml", "utf8");
1375
- const workspaces = import_js_yaml.default.load(pnpmWorkspace);
1376
- const workspacesWithPackageJson = workspaces.packages.map((workspace) => `${workspace}/package.json`);
1377
- const withoutExcludedWorkspaces = workspacesWithPackageJson.filter((workspace) => {
1378
- var _a2;
1379
- return !workspace.startsWith("!") && !((_a2 = parsedArgs.options.files) == null ? void 0 : _a2.includes(workspace));
1380
- });
1381
- parsedArgs.options.files = parsedArgs.options.files.concat(withoutExcludedWorkspaces);
1382
- }
1383
- }
1384
- }
1384
+ if (parsedArgs.options.recursive && ((_a = parsedArgs.options.files) == null ? void 0 : _a.length))
1385
+ console.log(import_picocolors3.default.yellow("The --recursive option is ignored when files are specified"));
1385
1386
  return parsedArgs;
1386
1387
  } catch (error) {
1387
1388
  return errorHandler(error);
@@ -1393,8 +1394,10 @@ function loadCliArgs(argv = import_node_process7.default.argv) {
1393
1394
  const result = cli.parse(argv);
1394
1395
  const rawArgs = cli.rawArgs;
1395
1396
  const args = result.options;
1396
- const hasCommitFlag = rawArgs.some((arg) => ["-c", "--commit", "--no-commit"].includes(arg));
1397
- const hasTagFlag = rawArgs.some((arg) => ["-t", "--tag", "--no-tag"].includes(arg));
1397
+ const COMMIT_REG = /(-c|--commit|--no-commit)(=.*|$)/;
1398
+ const TAG_REG = /(-t|--tag|--no-tag)(=.*|$)/;
1399
+ const hasCommitFlag = rawArgs.some((arg) => COMMIT_REG.test(arg));
1400
+ const hasTagFlag = rawArgs.some((arg) => TAG_REG.test(arg));
1398
1401
  const _a = args, { tag, commit } = _a, rest = __objRest(_a, ["tag", "commit"]);
1399
1402
  return {
1400
1403
  args: __spreadProps(__spreadValues({}, rest), {
@@ -10,22 +10,19 @@ import {
10
10
  log_symbols_default,
11
11
  require_picocolors,
12
12
  versionBump
13
- } from "../chunk-OMAU23UL.mjs";
13
+ } from "../chunk-ZH3O6GQ3.mjs";
14
14
 
15
15
  // src/cli/index.ts
16
16
  import process2 from "process";
17
17
 
18
18
  // package.json
19
- var version = "9.4.0";
19
+ var version = "9.4.1";
20
20
 
21
21
  // src/cli/parse-args.ts
22
22
  var import_picocolors = __toESM(require_picocolors());
23
23
  import process from "process";
24
- import fs from "fs/promises";
25
- import fsSync from "fs";
26
24
  import { valid as isValidVersion } from "semver";
27
25
  import cac from "cac";
28
- import yaml from "js-yaml";
29
26
  async function parseArgs() {
30
27
  var _a;
31
28
  try {
@@ -56,29 +53,8 @@ async function parseArgs() {
56
53
  parsedArgs.options.files.shift();
57
54
  }
58
55
  }
59
- if (parsedArgs.options.recursive) {
60
- if ((_a = parsedArgs.options.files) == null ? void 0 : _a.length) {
61
- console.log(import_picocolors.default.yellow("The --recursive option is ignored when files are specified"));
62
- } else {
63
- parsedArgs.options.files = [
64
- "package.json",
65
- "package-lock.json",
66
- "packages/**/package.json",
67
- "jsr.json",
68
- "jsr.jsonc"
69
- ];
70
- if (fsSync.existsSync("pnpm-workspace.yaml")) {
71
- const pnpmWorkspace = await fs.readFile("pnpm-workspace.yaml", "utf8");
72
- const workspaces = yaml.load(pnpmWorkspace);
73
- const workspacesWithPackageJson = workspaces.packages.map((workspace) => `${workspace}/package.json`);
74
- const withoutExcludedWorkspaces = workspacesWithPackageJson.filter((workspace) => {
75
- var _a2;
76
- return !workspace.startsWith("!") && !((_a2 = parsedArgs.options.files) == null ? void 0 : _a2.includes(workspace));
77
- });
78
- parsedArgs.options.files = parsedArgs.options.files.concat(withoutExcludedWorkspaces);
79
- }
80
- }
81
- }
56
+ if (parsedArgs.options.recursive && ((_a = parsedArgs.options.files) == null ? void 0 : _a.length))
57
+ console.log(import_picocolors.default.yellow("The --recursive option is ignored when files are specified"));
82
58
  return parsedArgs;
83
59
  } catch (error) {
84
60
  return errorHandler(error);
@@ -90,8 +66,10 @@ function loadCliArgs(argv = process.argv) {
90
66
  const result = cli.parse(argv);
91
67
  const rawArgs = cli.rawArgs;
92
68
  const args = result.options;
93
- const hasCommitFlag = rawArgs.some((arg) => ["-c", "--commit", "--no-commit"].includes(arg));
94
- const hasTagFlag = rawArgs.some((arg) => ["-t", "--tag", "--no-tag"].includes(arg));
69
+ const COMMIT_REG = /(-c|--commit|--no-commit)(=.*|$)/;
70
+ const TAG_REG = /(-t|--tag|--no-tag)(=.*|$)/;
71
+ const hasCommitFlag = rawArgs.some((arg) => COMMIT_REG.test(arg));
72
+ const hasTagFlag = rawArgs.some((arg) => TAG_REG.test(arg));
95
73
  const _a = args, { tag, commit } = _a, rest = __objRest(_a, ["tag", "commit"]);
96
74
  return {
97
75
  args: __spreadProps(__spreadValues({}, rest), {
package/dist/index.d.mts CHANGED
@@ -100,7 +100,7 @@ interface VersionBumpOptions {
100
100
  * with the new version number. If the message string does _not_ contain any `%s` placeholders,
101
101
  * then the new version number will be appended to the message.
102
102
  *
103
- * Defaults to `false`.
103
+ * Defaults to `true`.
104
104
  */
105
105
  commit?: boolean | string;
106
106
  /**
@@ -109,13 +109,13 @@ interface VersionBumpOptions {
109
109
  * with the new version number. If the tag string does _not_ contain any `%s` placeholders,
110
110
  * then the new version number will be appended to the tag.
111
111
  *
112
- * Defaults to `false`.
112
+ * Defaults to `true`.
113
113
  */
114
114
  tag?: boolean | string;
115
115
  /**
116
116
  * Indicates whether to push the git commit and tag.
117
117
  *
118
- * Defaults to `false`.
118
+ * Defaults to `true`.
119
119
  */
120
120
  push?: boolean;
121
121
  /**
@@ -128,7 +128,7 @@ interface VersionBumpOptions {
128
128
  /**
129
129
  * Prompt for confirmation
130
130
  *
131
- * @default false
131
+ * @default true
132
132
  */
133
133
  confirm?: boolean;
134
134
  /**
package/dist/index.d.ts CHANGED
@@ -100,7 +100,7 @@ interface VersionBumpOptions {
100
100
  * with the new version number. If the message string does _not_ contain any `%s` placeholders,
101
101
  * then the new version number will be appended to the message.
102
102
  *
103
- * Defaults to `false`.
103
+ * Defaults to `true`.
104
104
  */
105
105
  commit?: boolean | string;
106
106
  /**
@@ -109,13 +109,13 @@ interface VersionBumpOptions {
109
109
  * with the new version number. If the tag string does _not_ contain any `%s` placeholders,
110
110
  * then the new version number will be appended to the tag.
111
111
  *
112
- * Defaults to `false`.
112
+ * Defaults to `true`.
113
113
  */
114
114
  tag?: boolean | string;
115
115
  /**
116
116
  * Indicates whether to push the git commit and tag.
117
117
  *
118
- * Defaults to `false`.
118
+ * Defaults to `true`.
119
119
  */
120
120
  push?: boolean;
121
121
  /**
@@ -128,7 +128,7 @@ interface VersionBumpOptions {
128
128
  /**
129
129
  * Prompt for confirmation
130
130
  *
131
- * @default false
131
+ * @default true
132
132
  */
133
133
  confirm?: boolean;
134
134
  /**
package/dist/index.js CHANGED
@@ -1029,9 +1029,12 @@ function formatVersionString(template, newVersion) {
1029
1029
 
1030
1030
  // src/normalize-options.ts
1031
1031
  var import_node_process4 = __toESM(require("process"));
1032
+ var import_promises = __toESM(require("fs/promises"));
1033
+ var import_node_fs2 = __toESM(require("fs"));
1032
1034
  var import_fast_glob = __toESM(require("fast-glob"));
1035
+ var import_js_yaml = __toESM(require("js-yaml"));
1033
1036
  async function normalizeOptions(raw) {
1034
- var _a;
1037
+ var _a, _b;
1035
1038
  const preid = typeof raw.preid === "string" ? raw.preid : "beta";
1036
1039
  const push = Boolean(raw.push);
1037
1040
  const all = Boolean(raw.all);
@@ -1039,6 +1042,7 @@ async function normalizeOptions(raw) {
1039
1042
  const cwd = raw.cwd || import_node_process4.default.cwd();
1040
1043
  const ignoreScripts = Boolean(raw.ignoreScripts);
1041
1044
  const execute = raw.execute;
1045
+ const recursive = Boolean(raw.recursive);
1042
1046
  let release;
1043
1047
  if (!raw.release || raw.release === "prompt")
1044
1048
  release = { type: "prompt", preid };
@@ -1056,8 +1060,29 @@ async function normalizeOptions(raw) {
1056
1060
  commit = { all, noVerify, message: raw.commit };
1057
1061
  else if (raw.commit || tag || push)
1058
1062
  commit = { all, noVerify, message: "chore: release v" };
1063
+ if (recursive && !((_a = raw.files) == null ? void 0 : _a.length)) {
1064
+ raw.files = [
1065
+ "package.json",
1066
+ "package-lock.json",
1067
+ "packages/**/package.json",
1068
+ "jsr.json",
1069
+ "jsr.jsonc"
1070
+ ];
1071
+ if (import_node_fs2.default.existsSync("pnpm-workspace.yaml")) {
1072
+ const pnpmWorkspace = await import_promises.default.readFile("pnpm-workspace.yaml", "utf8");
1073
+ const workspaces = import_js_yaml.default.load(pnpmWorkspace);
1074
+ const workspacesWithPackageJson = workspaces.packages.map((workspace) => `${workspace}/package.json`);
1075
+ const withoutExcludedWorkspaces = workspacesWithPackageJson.filter((workspace) => {
1076
+ var _a2;
1077
+ return !workspace.startsWith("!") && !((_a2 = raw.files) == null ? void 0 : _a2.includes(workspace));
1078
+ });
1079
+ raw.files = raw.files.concat(withoutExcludedWorkspaces);
1080
+ }
1081
+ } else {
1082
+ raw.files = ((_b = raw.files) == null ? void 0 : _b.length) ? raw.files : ["package.json", "package-lock.json", "jsr.json", "jsr.jsonc"];
1083
+ }
1059
1084
  const files = await (0, import_fast_glob.default)(
1060
- ((_a = raw.files) == null ? void 0 : _a.length) ? raw.files : ["package.json", "package-lock.json", "jsr.json", "jsr.jsonc"],
1085
+ raw.files,
1061
1086
  {
1062
1087
  cwd,
1063
1088
  onlyFiles: true,
@@ -1072,7 +1097,7 @@ async function normalizeOptions(raw) {
1072
1097
  } else if (raw.interface === true || !raw.interface) {
1073
1098
  ui = { input: import_node_process4.default.stdin, output: import_node_process4.default.stdout };
1074
1099
  } else {
1075
- let _b = raw.interface, { input, output } = _b, other = __objRest(_b, ["input", "output"]);
1100
+ let _c = raw.interface, { input, output } = _c, other = __objRest(_c, ["input", "output"]);
1076
1101
  if (input === true || input !== false && !input)
1077
1102
  input = import_node_process4.default.stdin;
1078
1103
  if (output === true || output !== false && !output)
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  loadBumpConfig,
8
8
  versionBump,
9
9
  versionBumpInfo
10
- } from "./chunk-OMAU23UL.mjs";
10
+ } from "./chunk-ZH3O6GQ3.mjs";
11
11
 
12
12
  // src/index.ts
13
13
  var src_default = versionBump;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bumpp",
3
- "version": "9.4.0",
4
- "packageManager": "pnpm@8.15.4",
3
+ "version": "9.4.1",
4
+ "packageManager": "pnpm@9.0.6",
5
5
  "description": "Bump version, commit changes, tag, and push to Git",
6
6
  "author": {
7
7
  "name": "James Messinger",
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "@jsdevtools/ez-spawn": "^3.0.4",
63
- "c12": "^1.9.0",
63
+ "c12": "^1.10.0",
64
64
  "cac": "^6.7.14",
65
65
  "escalade": "^3.1.2",
66
66
  "fast-glob": "^3.3.2",
@@ -69,21 +69,21 @@
69
69
  "semver": "^7.6.0"
70
70
  },
71
71
  "devDependencies": {
72
- "@antfu/eslint-config": "^2.7.0",
72
+ "@antfu/eslint-config": "^2.16.0",
73
73
  "@types/js-yaml": "^4.0.9",
74
- "@types/node": "^20.11.24",
74
+ "@types/node": "^20.12.7",
75
75
  "@types/prompts": "^2.4.9",
76
76
  "@types/semver": "^7.5.8",
77
77
  "detect-indent": "^7.0.1",
78
78
  "detect-newline": "^4.0.1",
79
- "eslint": "^8.57.0",
79
+ "eslint": "^9.1.1",
80
80
  "esno": "^4.7.0",
81
81
  "log-symbols": "^6.0.0",
82
82
  "npm-check": "^6.0.1",
83
83
  "picocolors": "^1.0.0",
84
84
  "rimraf": "^5.0.5",
85
85
  "tsup": "^8.0.2",
86
- "typescript": "^5.3.3",
87
- "vitest": "^1.3.1"
86
+ "typescript": "^5.4.5",
87
+ "vitest": "^1.5.2"
88
88
  }
89
89
  }