bumpp 9.11.0 → 10.0.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.mjs ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ 'use strict'
3
+ import('../dist/cli.mjs')
4
+ .then(r => r.main())
@@ -1,28 +1,28 @@
1
- import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
2
- import {
3
- __toESM,
4
- bumpConfigDefaults,
5
- isReleaseType,
6
- loadBumpConfig,
7
- require_picocolors,
8
- symbols_exports,
9
- versionBump
10
- } from "../chunk-BEM77VRK.js";
1
+ import process from 'node:process';
2
+ import { x } from 'tinyexec';
3
+ import { l as loadBumpConfig, i as isReleaseType, c, b as bumpConfigDefaults, v as versionBump, P as ProgressEvent, s as success, e as info } from './shared/bumpp.DE3hJRX3.mjs';
4
+ import cac from 'cac';
5
+ import { valid } from 'semver';
6
+ import 'prompts';
7
+ import 'node:child_process';
8
+ import 'node:fs';
9
+ import 'node:path';
10
+ import 'jsonc-parser';
11
+ import 'node:fs/promises';
12
+ import 'js-yaml';
13
+ import 'tinyglobby';
14
+ import 'c12';
15
+ import 'escalade/sync';
11
16
 
12
- // src/cli/index.ts
13
- import process2 from "node:process";
14
- import { x } from "tinyexec";
17
+ var ExitCode = /* @__PURE__ */ ((ExitCode2) => {
18
+ ExitCode2[ExitCode2["Success"] = 0] = "Success";
19
+ ExitCode2[ExitCode2["FatalError"] = 1] = "FatalError";
20
+ ExitCode2[ExitCode2["InvalidArgument"] = 9] = "InvalidArgument";
21
+ return ExitCode2;
22
+ })(ExitCode || {});
15
23
 
16
- // src/cli/parse-args.ts
17
- var import_picocolors = __toESM(require_picocolors(), 1);
18
- import process from "node:process";
19
- import cac from "cac";
20
- import { valid as isValidVersion } from "semver";
24
+ const version = "10.0.0";
21
25
 
22
- // package.json
23
- var version = "9.11.0";
24
-
25
- // src/cli/parse-args.ts
26
26
  async function parseArgs() {
27
27
  try {
28
28
  const { args, resultArgs } = loadCliArgs();
@@ -51,16 +51,16 @@ async function parseArgs() {
51
51
  };
52
52
  if (parsedArgs.options.files && parsedArgs.options.files.length > 0) {
53
53
  const firstArg = parsedArgs.options.files[0];
54
- if (firstArg === "prompt" || isReleaseType(firstArg) || isValidVersion(firstArg)) {
54
+ if (firstArg === "prompt" || isReleaseType(firstArg) || valid(firstArg)) {
55
55
  parsedArgs.options.release = firstArg;
56
56
  parsedArgs.options.files.shift();
57
57
  }
58
58
  }
59
59
  if (parsedArgs.options.recursive && parsedArgs.options.files?.length)
60
- console.log(import_picocolors.default.yellow("The --recursive option is ignored when files are specified"));
60
+ console.log(c.yellow("The --recursive option is ignored when files are specified"));
61
61
  return parsedArgs;
62
62
  } catch (error) {
63
- return errorHandler(error);
63
+ return errorHandler$1(error);
64
64
  }
65
65
  }
66
66
  function loadCliArgs(argv = process.argv) {
@@ -77,25 +77,24 @@ function loadCliArgs(argv = process.argv) {
77
77
  return {
78
78
  args: {
79
79
  ...rest,
80
- commit: hasCommitFlag ? commit : void 0,
81
- tag: hasTagFlag ? tag : void 0
80
+ commit: hasCommitFlag ? commit : undefined,
81
+ tag: hasTagFlag ? tag : undefined
82
82
  },
83
83
  resultArgs: result.args
84
84
  };
85
85
  }
86
- function errorHandler(error) {
86
+ function errorHandler$1(error) {
87
87
  console.error(error.message);
88
- return process.exit(9 /* InvalidArgument */);
88
+ return process.exit(ExitCode.InvalidArgument);
89
89
  }
90
90
 
91
- // src/cli/index.ts
92
91
  async function main() {
93
92
  try {
94
- process2.on("uncaughtException", errorHandler2);
95
- process2.on("unhandledRejection", errorHandler2);
96
- const { help, version: version2, quiet, options } = await parseArgs();
97
- if (help || version2) {
98
- process2.exit(0 /* Success */);
93
+ process.on("uncaughtException", errorHandler);
94
+ process.on("unhandledRejection", errorHandler);
95
+ const { help, version, quiet, options } = await parseArgs();
96
+ if (help || version) {
97
+ process.exit(ExitCode.Success);
99
98
  } else {
100
99
  if (!options.all && !options.noGitCheck) {
101
100
  await checkGitStatus();
@@ -105,7 +104,7 @@ async function main() {
105
104
  await versionBump(options);
106
105
  }
107
106
  } catch (error) {
108
- errorHandler2(error);
107
+ errorHandler(error);
109
108
  }
110
109
  }
111
110
  async function checkGitStatus() {
@@ -117,34 +116,32 @@ ${stdout}`);
117
116
  }
118
117
  function progress({ event, script, updatedFiles, skippedFiles, newVersion }) {
119
118
  switch (event) {
120
- case "file updated" /* FileUpdated */:
121
- console.log(symbols_exports.success, `Updated ${updatedFiles.pop()} to ${newVersion}`);
119
+ case ProgressEvent.FileUpdated:
120
+ console.log(success, `Updated ${updatedFiles.pop()} to ${newVersion}`);
122
121
  break;
123
- case "file skipped" /* FileSkipped */:
124
- console.log(symbols_exports.info, `${skippedFiles.pop()} did not need to be updated`);
122
+ case ProgressEvent.FileSkipped:
123
+ console.log(info, `${skippedFiles.pop()} did not need to be updated`);
125
124
  break;
126
- case "git commit" /* GitCommit */:
127
- console.log(symbols_exports.success, "Git commit");
125
+ case ProgressEvent.GitCommit:
126
+ console.log(success, "Git commit");
128
127
  break;
129
- case "git tag" /* GitTag */:
130
- console.log(symbols_exports.success, "Git tag");
128
+ case ProgressEvent.GitTag:
129
+ console.log(success, "Git tag");
131
130
  break;
132
- case "git push" /* GitPush */:
133
- console.log(symbols_exports.success, "Git push");
131
+ case ProgressEvent.GitPush:
132
+ console.log(success, "Git push");
134
133
  break;
135
- case "npm script" /* NpmScript */:
136
- console.log(symbols_exports.success, `Npm run ${script}`);
134
+ case ProgressEvent.NpmScript:
135
+ console.log(success, `Npm run ${script}`);
137
136
  break;
138
137
  }
139
138
  }
140
- function errorHandler2(error) {
139
+ function errorHandler(error) {
141
140
  let message = error.message || String(error);
142
- if (process2.env.DEBUG || process2.env.NODE_ENV === "development")
141
+ if (process.env.DEBUG || process.env.NODE_ENV === "development")
143
142
  message = error.stack || message;
144
143
  console.error(message);
145
- process2.exit(1 /* FatalError */);
144
+ process.exit(ExitCode.FatalError);
146
145
  }
147
- export {
148
- checkGitStatus,
149
- main
150
- };
146
+
147
+ export { checkGitStatus, main };
package/dist/index.mjs ADDED
@@ -0,0 +1,19 @@
1
+ import { v as versionBump } from './shared/bumpp.DE3hJRX3.mjs';
2
+ export { N as NpmScript, P as ProgressEvent, b as bumpConfigDefaults, d as defineConfig, l as loadBumpConfig, a as versionBumpInfo } from './shared/bumpp.DE3hJRX3.mjs';
3
+ import 'node:process';
4
+ import 'prompts';
5
+ import 'node:child_process';
6
+ import 'tinyexec';
7
+ import 'semver';
8
+ import 'node:fs';
9
+ import 'node:path';
10
+ import 'jsonc-parser';
11
+ import 'node:fs/promises';
12
+ import 'js-yaml';
13
+ import 'tinyglobby';
14
+ import 'c12';
15
+ import 'escalade/sync';
16
+
17
+
18
+
19
+ export { versionBump as default, versionBump };