bumpp 8.1.0 → 8.2.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/bin/bumpp.js CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict'
3
3
  const { main } = require('../dist/cli')
4
- main(process.argv.slice(2))
4
+ main()
@@ -3,6 +3,6 @@
3
3
  *
4
4
  * @param args - The command-line arguments (e.g. ["major", "--preid=alpha", "-ctpa"])
5
5
  */
6
- declare function main(args: string[]): Promise<void>;
6
+ declare function main(): Promise<void>;
7
7
 
8
8
  export { main };
package/dist/cli/index.js CHANGED
@@ -41,8 +41,8 @@ var __commonJS = (cb, mod) => function __require() {
41
41
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
42
42
  };
43
43
  var __export = (target, all) => {
44
- for (var name2 in all)
45
- __defProp(target, name2, { get: all[name2], enumerable: true });
44
+ for (var name in all)
45
+ __defProp(target, name, { get: all[name], enumerable: true });
46
46
  };
47
47
  var __reExport = (target, module2, copyDefault, desc) => {
48
48
  if (module2 && typeof module2 === "object" || typeof module2 === "function") {
@@ -1070,11 +1070,11 @@ var require_ansi_styles = __commonJS({
1070
1070
  const offset = isBackground ? 10 : 0;
1071
1071
  const styles = {};
1072
1072
  for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
1073
- const name2 = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
1073
+ const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
1074
1074
  if (sourceSpace === targetSpace) {
1075
- styles[name2] = wrap(identity, offset);
1075
+ styles[name] = wrap(identity, offset);
1076
1076
  } else if (typeof suite === "object") {
1077
- styles[name2] = wrap(suite[targetSpace], offset);
1077
+ styles[name] = wrap(suite[targetSpace], offset);
1078
1078
  }
1079
1079
  }
1080
1080
  return styles;
@@ -1357,7 +1357,7 @@ var require_templates = __commonJS({
1357
1357
  }
1358
1358
  return ESCAPES.get(c) || c;
1359
1359
  }
1360
- function parseArguments(name2, arguments_) {
1360
+ function parseArguments(name, arguments_) {
1361
1361
  const results = [];
1362
1362
  const chunks = arguments_.trim().split(/\s*,\s*/g);
1363
1363
  let matches;
@@ -1368,7 +1368,7 @@ var require_templates = __commonJS({
1368
1368
  } else if (matches = chunk.match(STRING_REGEX)) {
1369
1369
  results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
1370
1370
  } else {
1371
- throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name2}')`);
1371
+ throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
1372
1372
  }
1373
1373
  }
1374
1374
  return results;
@@ -1378,12 +1378,12 @@ var require_templates = __commonJS({
1378
1378
  const results = [];
1379
1379
  let matches;
1380
1380
  while ((matches = STYLE_REGEX.exec(style)) !== null) {
1381
- const name2 = matches[1];
1381
+ const name = matches[1];
1382
1382
  if (matches[2]) {
1383
- const args = parseArguments(name2, matches[2]);
1384
- results.push([name2].concat(args));
1383
+ const args = parseArguments(name, matches[2]);
1384
+ results.push([name].concat(args));
1385
1385
  } else {
1386
- results.push([name2]);
1386
+ results.push([name]);
1387
1387
  }
1388
1388
  }
1389
1389
  return results;
@@ -1683,9 +1683,7 @@ init_cjs_shims();
1683
1683
  var import_log_symbols2 = __toESM(require_log_symbols());
1684
1684
 
1685
1685
  // package.json
1686
- var name = "bumpp";
1687
- var version = "8.1.0";
1688
- var description = "Bump version, commit changes, tag, and push to Git";
1686
+ var version = "8.2.0";
1689
1687
 
1690
1688
  // src/types/version-bump-progress.ts
1691
1689
  init_cjs_shims();
@@ -1923,8 +1921,8 @@ function detectIndent(string) {
1923
1921
 
1924
1922
  // src/fs.ts
1925
1923
  var import_detect_newline = __toESM(require_detect_newline());
1926
- async function readJsonFile(name2, cwd) {
1927
- const file = await readTextFile(name2, cwd);
1924
+ async function readJsonFile(name, cwd) {
1925
+ const file = await readTextFile(name, cwd);
1928
1926
  const data = JSON.parse(file.data);
1929
1927
  const indent = detectIndent(file.data).indent;
1930
1928
  const newline = (0, import_detect_newline.default)(file.data);
@@ -1936,9 +1934,9 @@ async function writeJsonFile(file) {
1936
1934
  json += file.newline;
1937
1935
  return writeTextFile(__spreadProps(__spreadValues({}, file), { data: json }));
1938
1936
  }
1939
- function readTextFile(name2, cwd) {
1937
+ function readTextFile(name, cwd) {
1940
1938
  return new Promise((resolve, reject) => {
1941
- const filePath = import_path.default.join(cwd, name2);
1939
+ const filePath = import_path.default.join(cwd, name);
1942
1940
  import_fs.default.readFile(filePath, "utf8", (err, text) => {
1943
1941
  if (err) {
1944
1942
  reject(err);
@@ -2191,8 +2189,8 @@ async function updateFiles(operation) {
2191
2189
  return operation;
2192
2190
  }
2193
2191
  async function updateFile(relPath, operation) {
2194
- const name2 = path2.basename(relPath).trim().toLowerCase();
2195
- switch (name2) {
2192
+ const name = path2.basename(relPath).trim().toLowerCase();
2193
+ switch (name) {
2196
2194
  case "package.json":
2197
2195
  case "package-lock.json":
2198
2196
  case "bower.json":
@@ -2286,92 +2284,16 @@ var ExitCode = /* @__PURE__ */ ((ExitCode2) => {
2286
2284
  return ExitCode2;
2287
2285
  })(ExitCode || {});
2288
2286
 
2289
- // src/cli/help.ts
2290
- init_cjs_shims();
2291
- var usageText = `
2292
- Usage: bumpp [release] [options] [files...]
2293
-
2294
- release:
2295
- The release version or type. Can be one of the following:
2296
- - A semver version number (ex: 1.23.456)
2297
- - prompt: Prompt for the version number (this is the default)
2298
- - major: Increase major version
2299
- - minor: Increase minor version
2300
- - patch: Increase patch version
2301
- - premajor: Increase major version, pre-release
2302
- - preminor: Increase preminor version, pre-release
2303
- - prepatch: Increase prepatch version, pre-release
2304
- - prerelease: Increase prerelease version
2305
-
2306
- options:
2307
- --preid <name> The identifier for prerelease versions.
2308
- Defaults to "beta".
2309
-
2310
- -c, --commit [message] Commit changed files to Git.
2311
- Defaults to "release vX.X.X".
2312
-
2313
- -t, --tag [tag] Tag the commit in Git.
2314
- The Default tag is "vX.X.X"
2315
-
2316
- -p, --push Push the Git commit.
2317
-
2318
- -a, --all Commit/tag/push ALL pending files,
2319
- not just the ones that were bumped.
2320
- (same as "git commit -a")
2321
-
2322
- --no-verify Bypass Git commit hooks
2323
- (same as "git commit --no-verify")
2324
-
2325
- -v, --version Show the version number
2326
-
2327
- -x, --execute Excute additional command after bumping and before commiting
2328
-
2329
- -q, --quiet Suppress unnecessary output
2330
-
2331
- -h, --help Show usage information
2332
-
2333
- --ignore-scripts Bypass version scripts
2334
-
2335
- files...
2336
- One or more files and/or globs to bump (ex: README.md *.txt docs/**/*).
2337
- Defaults to package.json and package-lock.json.
2338
-
2339
- Examples:
2340
-
2341
- bumpp patch
2342
-
2343
- Bumps the patch version number in package.json and package-lock.json.
2344
- Nothing is committed to git.
2345
-
2346
- bumpp major --commit
2347
-
2348
- Bumps the major version number in package.json and package-lock.json.
2349
- Commits package.json and package-lock.json to git, but does not tag the commit.
2350
-
2351
- bumpp -tpa README.md
2352
-
2353
- Prompts for the new version number and updates package.json, package-lock.json, and README.md.
2354
- Commits ALL modified files to git, tags the commit, and pushes the commit.
2355
-
2356
- bumpp 4.27.9934 --tag "Version " bower.json docs/**/*.md
2357
-
2358
- Sets the version number to 4.27.9934 in package.json, package-lock.json, bower.json,
2359
- and all markdown files in the "docs" directory. Commits the updated files to git,
2360
- and tags the commit as "Version 4.27.9934".
2361
- `;
2362
- var helpText = `
2363
- ${name} v${version} - ${description}
2364
- ${usageText}`;
2365
-
2366
2287
  // src/cli/parse-args.ts
2367
2288
  init_cjs_shims();
2368
2289
  var import_semver4 = require("semver");
2369
2290
  var import_cac = __toESM(require("cac"));
2370
- function parseArgs(argv) {
2291
+ function parseArgs() {
2371
2292
  try {
2372
2293
  const cli = (0, import_cac.default)("bumpp");
2373
2294
  cli.version(version).usage("[...files]").option("--preid <preid>", "ID for prerelease").option("--all", "Include all files").option("-c, --commit [msg]", "Commit message", { default: true }).option("-t, --tag [tag]", "Tag name", { default: true }).option("-p, --push", "Push to remote", { default: true }).option("-y, --yes", "Skip confirmation").option("--no-verify", "Skip git verification").option("--ignore-scripts", "Ignore scripts", { default: false }).option("-q, --quiet", "Quiet mode").option("-v, --version <version>", "Tagert version").option("-x, --execute <command>", "Commands to execute after version bumps").help();
2374
- const args = cli.parse(argv).options;
2295
+ const result = cli.parse();
2296
+ const args = result.options;
2375
2297
  const parsedArgs = {
2376
2298
  help: args.help,
2377
2299
  version: args.version,
@@ -2403,18 +2325,16 @@ function parseArgs(argv) {
2403
2325
  }
2404
2326
  function errorHandler(error) {
2405
2327
  console.error(error.message);
2406
- console.error(usageText);
2407
2328
  return process.exit(9 /* InvalidArgument */);
2408
2329
  }
2409
2330
 
2410
2331
  // src/cli/index.ts
2411
- async function main(args) {
2332
+ async function main() {
2412
2333
  try {
2413
2334
  process.on("uncaughtException", errorHandler2);
2414
2335
  process.on("unhandledRejection", errorHandler2);
2415
- const { help, version: version2, quiet, options } = parseArgs(args);
2336
+ const { help, version: version2, quiet, options } = parseArgs();
2416
2337
  if (help) {
2417
- console.log(helpText);
2418
2338
  process.exit(0 /* Success */);
2419
2339
  } else if (version2) {
2420
2340
  console.log(version);
@@ -12,9 +12,7 @@ init_esm_shims();
12
12
  var import_log_symbols = __toESM(require_log_symbols());
13
13
 
14
14
  // package.json
15
- var name = "bumpp";
16
- var version = "8.1.0";
17
- var description = "Bump version, commit changes, tag, and push to Git";
15
+ var version = "8.2.0";
18
16
 
19
17
  // src/cli/exit-code.ts
20
18
  init_esm_shims();
@@ -25,92 +23,16 @@ var ExitCode = /* @__PURE__ */ ((ExitCode2) => {
25
23
  return ExitCode2;
26
24
  })(ExitCode || {});
27
25
 
28
- // src/cli/help.ts
29
- init_esm_shims();
30
- var usageText = `
31
- Usage: bumpp [release] [options] [files...]
32
-
33
- release:
34
- The release version or type. Can be one of the following:
35
- - A semver version number (ex: 1.23.456)
36
- - prompt: Prompt for the version number (this is the default)
37
- - major: Increase major version
38
- - minor: Increase minor version
39
- - patch: Increase patch version
40
- - premajor: Increase major version, pre-release
41
- - preminor: Increase preminor version, pre-release
42
- - prepatch: Increase prepatch version, pre-release
43
- - prerelease: Increase prerelease version
44
-
45
- options:
46
- --preid <name> The identifier for prerelease versions.
47
- Defaults to "beta".
48
-
49
- -c, --commit [message] Commit changed files to Git.
50
- Defaults to "release vX.X.X".
51
-
52
- -t, --tag [tag] Tag the commit in Git.
53
- The Default tag is "vX.X.X"
54
-
55
- -p, --push Push the Git commit.
56
-
57
- -a, --all Commit/tag/push ALL pending files,
58
- not just the ones that were bumped.
59
- (same as "git commit -a")
60
-
61
- --no-verify Bypass Git commit hooks
62
- (same as "git commit --no-verify")
63
-
64
- -v, --version Show the version number
65
-
66
- -x, --execute Excute additional command after bumping and before commiting
67
-
68
- -q, --quiet Suppress unnecessary output
69
-
70
- -h, --help Show usage information
71
-
72
- --ignore-scripts Bypass version scripts
73
-
74
- files...
75
- One or more files and/or globs to bump (ex: README.md *.txt docs/**/*).
76
- Defaults to package.json and package-lock.json.
77
-
78
- Examples:
79
-
80
- bumpp patch
81
-
82
- Bumps the patch version number in package.json and package-lock.json.
83
- Nothing is committed to git.
84
-
85
- bumpp major --commit
86
-
87
- Bumps the major version number in package.json and package-lock.json.
88
- Commits package.json and package-lock.json to git, but does not tag the commit.
89
-
90
- bumpp -tpa README.md
91
-
92
- Prompts for the new version number and updates package.json, package-lock.json, and README.md.
93
- Commits ALL modified files to git, tags the commit, and pushes the commit.
94
-
95
- bumpp 4.27.9934 --tag "Version " bower.json docs/**/*.md
96
-
97
- Sets the version number to 4.27.9934 in package.json, package-lock.json, bower.json,
98
- and all markdown files in the "docs" directory. Commits the updated files to git,
99
- and tags the commit as "Version 4.27.9934".
100
- `;
101
- var helpText = `
102
- ${name} v${version} - ${description}
103
- ${usageText}`;
104
-
105
26
  // src/cli/parse-args.ts
106
27
  init_esm_shims();
107
28
  import { valid as isValidVersion } from "semver";
108
29
  import cac from "cac";
109
- function parseArgs(argv) {
30
+ function parseArgs() {
110
31
  try {
111
32
  const cli = cac("bumpp");
112
33
  cli.version(version).usage("[...files]").option("--preid <preid>", "ID for prerelease").option("--all", "Include all files").option("-c, --commit [msg]", "Commit message", { default: true }).option("-t, --tag [tag]", "Tag name", { default: true }).option("-p, --push", "Push to remote", { default: true }).option("-y, --yes", "Skip confirmation").option("--no-verify", "Skip git verification").option("--ignore-scripts", "Ignore scripts", { default: false }).option("-q, --quiet", "Quiet mode").option("-v, --version <version>", "Tagert version").option("-x, --execute <command>", "Commands to execute after version bumps").help();
113
- const args = cli.parse(argv).options;
34
+ const result = cli.parse();
35
+ const args = result.options;
114
36
  const parsedArgs = {
115
37
  help: args.help,
116
38
  version: args.version,
@@ -142,18 +64,16 @@ function parseArgs(argv) {
142
64
  }
143
65
  function errorHandler(error) {
144
66
  console.error(error.message);
145
- console.error(usageText);
146
67
  return process.exit(9 /* InvalidArgument */);
147
68
  }
148
69
 
149
70
  // src/cli/index.ts
150
- async function main(args) {
71
+ async function main() {
151
72
  try {
152
73
  process.on("uncaughtException", errorHandler2);
153
74
  process.on("unhandledRejection", errorHandler2);
154
- const { help, version: version2, quiet, options } = parseArgs(args);
75
+ const { help, version: version2, quiet, options } = parseArgs();
155
76
  if (help) {
156
- console.log(helpText);
157
77
  process.exit(0 /* Success */);
158
78
  } else if (version2) {
159
79
  console.log(version);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bumpp",
3
- "version": "8.1.0",
3
+ "version": "8.2.0",
4
4
  "packageManager": "pnpm@7.2.1",
5
5
  "description": "Bump version, commit changes, tag, and push to Git",
6
6
  "author": {