bumpp 9.10.1 → 9.11.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/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "bumpp",
3
- "version": "9.10.1",
3
+ "type": "module",
4
+ "version": "9.11.0",
4
5
  "packageManager": "pnpm@9.15.4",
5
6
  "description": "Bump version, commit changes, tag, and push to Git",
6
7
  "author": {
@@ -68,17 +69,18 @@
68
69
  "package-manager-detector": "^0.2.8",
69
70
  "prompts": "^2.4.2",
70
71
  "semver": "^7.6.3",
72
+ "tiny-conventional-commits-parser": "^0.0.1",
71
73
  "tinyexec": "^0.3.2",
72
74
  "tinyglobby": "^0.2.10"
73
75
  },
74
76
  "devDependencies": {
75
- "@antfu/eslint-config": "^3.14.0",
77
+ "@antfu/eslint-config": "^4.0.0",
76
78
  "@types/js-yaml": "^4.0.9",
77
- "@types/node": "^22.10.6",
79
+ "@types/node": "^22.10.10",
78
80
  "@types/prompts": "^2.4.9",
79
81
  "@types/semver": "^7.5.8",
80
82
  "args-tokenizer": "^0.3.0",
81
- "eslint": "^9.18.0",
83
+ "eslint": "^9.19.0",
82
84
  "esno": "^4.8.0",
83
85
  "log-symbols": "^7.0.0",
84
86
  "npm-check": "^6.0.1",
@@ -86,6 +88,6 @@
86
88
  "rimraf": "^6.0.1",
87
89
  "tsup": "^8.3.5",
88
90
  "typescript": "^5.7.3",
89
- "vitest": "^2.1.8"
91
+ "vitest": "^3.0.4"
90
92
  }
91
93
  }
@@ -1,153 +0,0 @@
1
- import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
2
- import {
3
- __objRest,
4
- __spreadProps,
5
- __spreadValues,
6
- __toESM,
7
- bumpConfigDefaults,
8
- isReleaseType,
9
- loadBumpConfig,
10
- require_picocolors,
11
- symbols_exports,
12
- versionBump
13
- } from "../chunk-HXP7VO25.mjs";
14
-
15
- // src/cli/index.ts
16
- import process2 from "node:process";
17
- import { x } from "tinyexec";
18
-
19
- // src/cli/parse-args.ts
20
- var import_picocolors = __toESM(require_picocolors());
21
- import process from "node:process";
22
- import cac from "cac";
23
- import { valid as isValidVersion } from "semver";
24
-
25
- // package.json
26
- var version = "9.10.1";
27
-
28
- // src/cli/parse-args.ts
29
- async function parseArgs() {
30
- var _a;
31
- try {
32
- const { args, resultArgs } = loadCliArgs();
33
- const parsedArgs = {
34
- help: args.help,
35
- version: args.version,
36
- quiet: args.quiet,
37
- options: await loadBumpConfig({
38
- preid: args.preid,
39
- commit: args.commit,
40
- tag: args.tag,
41
- sign: args.sign,
42
- push: args.push,
43
- all: args.all,
44
- noGitCheck: args.noGitCheck,
45
- confirm: !args.yes,
46
- noVerify: !args.verify,
47
- install: args.install,
48
- files: [...args["--"] || [], ...resultArgs],
49
- ignoreScripts: args.ignoreScripts,
50
- currentVersion: args.currentVersion,
51
- execute: args.execute,
52
- printCommits: args.printCommits,
53
- recursive: args.recursive
54
- })
55
- };
56
- if (parsedArgs.options.files && parsedArgs.options.files.length > 0) {
57
- const firstArg = parsedArgs.options.files[0];
58
- if (firstArg === "prompt" || isReleaseType(firstArg) || isValidVersion(firstArg)) {
59
- parsedArgs.options.release = firstArg;
60
- parsedArgs.options.files.shift();
61
- }
62
- }
63
- if (parsedArgs.options.recursive && ((_a = parsedArgs.options.files) == null ? void 0 : _a.length))
64
- console.log(import_picocolors.default.yellow("The --recursive option is ignored when files are specified"));
65
- return parsedArgs;
66
- } catch (error) {
67
- return errorHandler(error);
68
- }
69
- }
70
- function loadCliArgs(argv = process.argv) {
71
- const cli = cac("bumpp");
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();
73
- const result = cli.parse(argv);
74
- const rawArgs = cli.rawArgs;
75
- const args = result.options;
76
- const COMMIT_REG = /(?:-c|--commit|--no-commit)(?:=.*|$)/;
77
- const TAG_REG = /(?:-t|--tag|--no-tag)(?:=.*|$)/;
78
- const hasCommitFlag = rawArgs.some((arg) => COMMIT_REG.test(arg));
79
- const hasTagFlag = rawArgs.some((arg) => TAG_REG.test(arg));
80
- const _a = args, { tag, commit } = _a, rest = __objRest(_a, ["tag", "commit"]);
81
- return {
82
- args: __spreadProps(__spreadValues({}, rest), {
83
- commit: hasCommitFlag ? commit : void 0,
84
- tag: hasTagFlag ? tag : void 0
85
- }),
86
- resultArgs: result.args
87
- };
88
- }
89
- function errorHandler(error) {
90
- console.error(error.message);
91
- return process.exit(9 /* InvalidArgument */);
92
- }
93
-
94
- // src/cli/index.ts
95
- async function main() {
96
- try {
97
- process2.on("uncaughtException", errorHandler2);
98
- process2.on("unhandledRejection", errorHandler2);
99
- const { help, version: version2, quiet, options } = await parseArgs();
100
- if (help || version2) {
101
- process2.exit(0 /* Success */);
102
- } else {
103
- if (!options.all && !options.noGitCheck) {
104
- await checkGitStatus();
105
- }
106
- if (!quiet)
107
- options.progress = options.progress ? options.progress : progress;
108
- await versionBump(options);
109
- }
110
- } catch (error) {
111
- errorHandler2(error);
112
- }
113
- }
114
- async function checkGitStatus() {
115
- const { stdout } = await x("git", ["status", "--porcelain"]);
116
- if (stdout.trim()) {
117
- throw new Error(`Git working tree is not clean:
118
- ${stdout}`);
119
- }
120
- }
121
- function progress({ event, script, updatedFiles, skippedFiles, newVersion }) {
122
- switch (event) {
123
- case "file updated" /* FileUpdated */:
124
- console.log(symbols_exports.success, `Updated ${updatedFiles.pop()} to ${newVersion}`);
125
- break;
126
- case "file skipped" /* FileSkipped */:
127
- console.log(symbols_exports.info, `${skippedFiles.pop()} did not need to be updated`);
128
- break;
129
- case "git commit" /* GitCommit */:
130
- console.log(symbols_exports.success, "Git commit");
131
- break;
132
- case "git tag" /* GitTag */:
133
- console.log(symbols_exports.success, "Git tag");
134
- break;
135
- case "git push" /* GitPush */:
136
- console.log(symbols_exports.success, "Git push");
137
- break;
138
- case "npm script" /* NpmScript */:
139
- console.log(symbols_exports.success, `Npm run ${script}`);
140
- break;
141
- }
142
- }
143
- function errorHandler2(error) {
144
- let message = error.message || String(error);
145
- if (process2.env.DEBUG || process2.env.NODE_ENV === "development")
146
- message = error.stack || message;
147
- console.error(message);
148
- process2.exit(1 /* FatalError */);
149
- }
150
- export {
151
- checkGitStatus,
152
- main
153
- };
package/dist/index.mjs DELETED
@@ -1,23 +0,0 @@
1
- import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
2
- import {
3
- NpmScript,
4
- ProgressEvent,
5
- bumpConfigDefaults,
6
- defineConfig,
7
- loadBumpConfig,
8
- versionBump,
9
- versionBumpInfo
10
- } from "./chunk-HXP7VO25.mjs";
11
-
12
- // src/index.ts
13
- var src_default = versionBump;
14
- export {
15
- NpmScript,
16
- ProgressEvent,
17
- bumpConfigDefaults,
18
- src_default as default,
19
- defineConfig,
20
- loadBumpConfig,
21
- versionBump,
22
- versionBumpInfo
23
- };
File without changes