bumpp 9.2.1 → 9.3.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/README.md +3 -2
- package/dist/{chunk-D4MB64LD.mjs → chunk-ZY4OVS4D.mjs} +2 -3
- package/dist/cli/index.js +32 -19
- package/dist/cli/index.mjs +20 -5
- package/dist/index.js +12 -15
- package/dist/index.mjs +2 -3
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -9,14 +9,15 @@ Forked from [`version-bump-prompt`](https://github.com/JS-DevTools/version-bump-
|
|
|
9
9
|
- Renamed to `bumpp` - so you can use `npx bumpp` directly.
|
|
10
10
|
- Ships ESM and CJS bundles.
|
|
11
11
|
- Add a new argument `--execute` to execute the command before committing.
|
|
12
|
-
- Use current version's `preid` when
|
|
12
|
+
- Use the current version's `preid` when available.
|
|
13
13
|
- Confirmation before bumping.
|
|
14
14
|
- Enable `--commit` `--tag` `--push` by default. (opt-out by `--no-push`, etc.)
|
|
15
15
|
- `-r` or `--recursive` to bump all packages in the monorepo.
|
|
16
16
|
- Conventional Commits by default.
|
|
17
|
-
- Supports config file `
|
|
17
|
+
- Supports config file `bump.config.ts`:
|
|
18
18
|
|
|
19
19
|
```ts
|
|
20
|
+
// bump.config.ts
|
|
20
21
|
import { defineConfig } from 'bumpp'
|
|
21
22
|
|
|
22
23
|
export default defineConfig({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __defProps = Object.defineProperties;
|
|
@@ -622,7 +623,6 @@ var logSymbols = isUnicodeSupported() ? main : fallback;
|
|
|
622
623
|
var log_symbols_default = logSymbols;
|
|
623
624
|
|
|
624
625
|
// src/release-type.ts
|
|
625
|
-
import { ReleaseType } from "semver";
|
|
626
626
|
var prereleaseTypes = ["premajor", "preminor", "prepatch", "prerelease"];
|
|
627
627
|
var releaseTypes = prereleaseTypes.concat(["major", "minor", "patch"]);
|
|
628
628
|
function isPrerelease(value) {
|
|
@@ -957,7 +957,7 @@ async function gitCommit(operation) {
|
|
|
957
957
|
return operation;
|
|
958
958
|
const { all, noVerify, message } = operation.options.commit;
|
|
959
959
|
const { updatedFiles, newVersion } = operation.state;
|
|
960
|
-
let args = [];
|
|
960
|
+
let args = ["--allow-empty"];
|
|
961
961
|
if (all) {
|
|
962
962
|
args.push("--all");
|
|
963
963
|
}
|
|
@@ -1297,7 +1297,6 @@ export {
|
|
|
1297
1297
|
__toESM,
|
|
1298
1298
|
require_picocolors,
|
|
1299
1299
|
log_symbols_default,
|
|
1300
|
-
ReleaseType,
|
|
1301
1300
|
isReleaseType,
|
|
1302
1301
|
ProgressEvent,
|
|
1303
1302
|
NpmScript,
|
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.
|
|
631
|
+
var version = "9.3.0";
|
|
632
632
|
|
|
633
633
|
// src/version-bump.ts
|
|
634
634
|
var import_node_process5 = __toESM(require("process"));
|
|
@@ -640,10 +640,9 @@ var import_prompts2 = __toESM(require("prompts"));
|
|
|
640
640
|
var import_node_process3 = __toESM(require("process"));
|
|
641
641
|
var import_picocolors = __toESM(require_picocolors());
|
|
642
642
|
var import_prompts = __toESM(require("prompts"));
|
|
643
|
-
var
|
|
643
|
+
var import_semver = __toESM(require("semver"));
|
|
644
644
|
|
|
645
645
|
// src/release-type.ts
|
|
646
|
-
var import_semver = require("semver");
|
|
647
646
|
var prereleaseTypes = ["premajor", "preminor", "prepatch", "prerelease"];
|
|
648
647
|
var releaseTypes = prereleaseTypes.concat(["major", "minor", "patch"]);
|
|
649
648
|
function isPrerelease(value) {
|
|
@@ -662,7 +661,7 @@ async function getNewVersion(operation) {
|
|
|
662
661
|
return promptForNewVersion(operation);
|
|
663
662
|
case "version":
|
|
664
663
|
return operation.update({
|
|
665
|
-
newVersion: new
|
|
664
|
+
newVersion: new import_semver.SemVer(release.version, true).version
|
|
666
665
|
});
|
|
667
666
|
default:
|
|
668
667
|
return operation.update({
|
|
@@ -672,7 +671,7 @@ async function getNewVersion(operation) {
|
|
|
672
671
|
}
|
|
673
672
|
}
|
|
674
673
|
function getNextVersion(oldVersion, bump) {
|
|
675
|
-
const oldSemVer = new
|
|
674
|
+
const oldSemVer = new import_semver.SemVer(oldVersion);
|
|
676
675
|
const newSemVer = oldSemVer.inc(bump.type, bump.preid);
|
|
677
676
|
if (isPrerelease(bump.type) && newSemVer.prerelease.length === 2 && newSemVer.prerelease[0] === bump.preid && String(newSemVer.prerelease[1]) === "0") {
|
|
678
677
|
newSemVer.prerelease[1] = "1";
|
|
@@ -683,12 +682,12 @@ function getNextVersion(oldVersion, bump) {
|
|
|
683
682
|
function getNextVersions(oldVersion, preid) {
|
|
684
683
|
var _a;
|
|
685
684
|
const next = {};
|
|
686
|
-
const parse =
|
|
685
|
+
const parse = import_semver.default.parse(oldVersion);
|
|
687
686
|
if (typeof (parse == null ? void 0 : parse.prerelease[0]) === "string")
|
|
688
687
|
preid = (parse == null ? void 0 : parse.prerelease[0]) || "preid";
|
|
689
688
|
for (const type of releaseTypes)
|
|
690
|
-
next[type] =
|
|
691
|
-
next.next = ((_a = parse == null ? void 0 : parse.prerelease) == null ? void 0 : _a.length) ?
|
|
689
|
+
next[type] = import_semver.default.inc(oldVersion, type, preid);
|
|
690
|
+
next.next = ((_a = parse == null ? void 0 : parse.prerelease) == null ? void 0 : _a.length) ? import_semver.default.inc(oldVersion, "prerelease", preid) : import_semver.default.inc(oldVersion, "patch");
|
|
692
691
|
return next;
|
|
693
692
|
}
|
|
694
693
|
async function promptForNewVersion(operation) {
|
|
@@ -696,7 +695,7 @@ async function promptForNewVersion(operation) {
|
|
|
696
695
|
const { oldVersion } = operation.state;
|
|
697
696
|
const release = operation.options.release;
|
|
698
697
|
const next = getNextVersions(oldVersion, release.preid);
|
|
699
|
-
const configCustomVersion = await ((_b = (_a = operation.options).customVersion) == null ? void 0 : _b.call(_a, oldVersion,
|
|
698
|
+
const configCustomVersion = await ((_b = (_a = operation.options).customVersion) == null ? void 0 : _b.call(_a, oldVersion, import_semver.default));
|
|
700
699
|
const PADDING = 13;
|
|
701
700
|
const answers = await (0, import_prompts.default)([
|
|
702
701
|
{
|
|
@@ -725,11 +724,11 @@ async function promptForNewVersion(operation) {
|
|
|
725
724
|
message: "Enter the new version number:",
|
|
726
725
|
initial: oldVersion,
|
|
727
726
|
validate: (custom) => {
|
|
728
|
-
return (0,
|
|
727
|
+
return (0, import_semver.valid)(custom) ? true : "That's not a valid version number";
|
|
729
728
|
}
|
|
730
729
|
}
|
|
731
730
|
]);
|
|
732
|
-
const newVersion = answers.release === "none" ? oldVersion : answers.release === "custom" ? (0,
|
|
731
|
+
const newVersion = answers.release === "none" ? oldVersion : answers.release === "custom" ? (0, import_semver.clean)(answers.custom) : answers.release === "config" ? (0, import_semver.clean)(configCustomVersion) : next[answers.release];
|
|
733
732
|
if (!newVersion)
|
|
734
733
|
import_node_process3.default.exit(1);
|
|
735
734
|
switch (answers.release) {
|
|
@@ -744,7 +743,7 @@ async function promptForNewVersion(operation) {
|
|
|
744
743
|
}
|
|
745
744
|
|
|
746
745
|
// src/get-old-version.ts
|
|
747
|
-
var
|
|
746
|
+
var import_semver2 = require("semver");
|
|
748
747
|
|
|
749
748
|
// src/fs.ts
|
|
750
749
|
var import_node_fs = __toESM(require("fs"));
|
|
@@ -936,7 +935,7 @@ async function readVersion(file, cwd) {
|
|
|
936
935
|
try {
|
|
937
936
|
const { data: manifest } = await readJsonFile(file, cwd);
|
|
938
937
|
if (isManifest(manifest)) {
|
|
939
|
-
if ((0,
|
|
938
|
+
if ((0, import_semver2.valid)(manifest.version))
|
|
940
939
|
return manifest.version;
|
|
941
940
|
}
|
|
942
941
|
} catch (error) {
|
|
@@ -951,7 +950,7 @@ async function gitCommit(operation) {
|
|
|
951
950
|
return operation;
|
|
952
951
|
const { all, noVerify, message } = operation.options.commit;
|
|
953
952
|
const { updatedFiles, newVersion } = operation.state;
|
|
954
|
-
let args = [];
|
|
953
|
+
let args = ["--allow-empty"];
|
|
955
954
|
if (all) {
|
|
956
955
|
args.push("--all");
|
|
957
956
|
}
|
|
@@ -1254,9 +1253,12 @@ function printSummary(operation) {
|
|
|
1254
1253
|
|
|
1255
1254
|
// src/cli/parse-args.ts
|
|
1256
1255
|
var import_node_process7 = __toESM(require("process"));
|
|
1257
|
-
var
|
|
1256
|
+
var import_promises = __toESM(require("fs/promises"));
|
|
1257
|
+
var import_node_fs2 = __toESM(require("fs"));
|
|
1258
|
+
var import_semver3 = require("semver");
|
|
1258
1259
|
var import_cac = __toESM(require("cac"));
|
|
1259
1260
|
var import_picocolors3 = __toESM(require_picocolors());
|
|
1261
|
+
var import_js_yaml = __toESM(require("js-yaml"));
|
|
1260
1262
|
|
|
1261
1263
|
// src/config.ts
|
|
1262
1264
|
var import_node_process6 = __toESM(require("process"));
|
|
@@ -1287,7 +1289,7 @@ async function parseArgs() {
|
|
|
1287
1289
|
var _a;
|
|
1288
1290
|
try {
|
|
1289
1291
|
const cli = (0, import_cac.default)("bumpp");
|
|
1290
|
-
cli.version(version).usage("[...files]").option("--preid <preid>", "ID for prerelease").option("--all", `Include all files (default: ${bumpConfigDefaults.all})`).option("-c, --commit [msg]", `Commit message (default: ${bumpConfigDefaults.commit})`).option("--no-commit", "Skip commit").option("-t, --tag [tag]", `Tag name (default: ${bumpConfigDefaults.tag})`).option("--no-tag", "Skip 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("-v, --version <version>", "
|
|
1292
|
+
cli.version(version).usage("[...files]").option("--preid <preid>", "ID for prerelease").option("--all", `Include all files (default: ${bumpConfigDefaults.all})`).option("-c, --commit [msg]", `Commit message (default: ${bumpConfigDefaults.commit})`).option("--no-commit", "Skip commit").option("-t, --tag [tag]", `Tag name (default: ${bumpConfigDefaults.tag})`).option("--no-tag", "Skip 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("-v, --version <version>", "Target version").option("-x, --execute <command>", "Commands to execute after version bumps").help();
|
|
1291
1293
|
const result = cli.parse();
|
|
1292
1294
|
const args = result.options;
|
|
1293
1295
|
const parsedArgs = {
|
|
@@ -1310,16 +1312,27 @@ async function parseArgs() {
|
|
|
1310
1312
|
};
|
|
1311
1313
|
if (parsedArgs.options.files && parsedArgs.options.files.length > 0) {
|
|
1312
1314
|
const firstArg = parsedArgs.options.files[0];
|
|
1313
|
-
if (firstArg === "prompt" || isReleaseType(firstArg) || (0,
|
|
1315
|
+
if (firstArg === "prompt" || isReleaseType(firstArg) || (0, import_semver3.valid)(firstArg)) {
|
|
1314
1316
|
parsedArgs.options.release = firstArg;
|
|
1315
1317
|
parsedArgs.options.files.shift();
|
|
1316
1318
|
}
|
|
1317
1319
|
}
|
|
1318
1320
|
if (parsedArgs.options.recursive) {
|
|
1319
|
-
if ((_a = parsedArgs.options.files) == null ? void 0 : _a.length)
|
|
1321
|
+
if ((_a = parsedArgs.options.files) == null ? void 0 : _a.length) {
|
|
1320
1322
|
console.log(import_picocolors3.default.yellow("The --recursive option is ignored when files are specified"));
|
|
1321
|
-
else
|
|
1323
|
+
} else {
|
|
1322
1324
|
parsedArgs.options.files = ["package.json", "package-lock.json", "packages/**/package.json"];
|
|
1325
|
+
if (import_node_fs2.default.existsSync("pnpm-workspace.yaml")) {
|
|
1326
|
+
const pnpmWorkspace = await import_promises.default.readFile("pnpm-workspace.yaml", "utf8");
|
|
1327
|
+
const workspaces = import_js_yaml.default.load(pnpmWorkspace);
|
|
1328
|
+
const workspacesWithPackageJson = workspaces.packages.map((workspace) => `${workspace}/package.json`);
|
|
1329
|
+
const withoutExcludedWorkspaces = workspacesWithPackageJson.filter((workspace) => {
|
|
1330
|
+
var _a2;
|
|
1331
|
+
return !workspace.startsWith("!") && !((_a2 = parsedArgs.options.files) == null ? void 0 : _a2.includes(workspace));
|
|
1332
|
+
});
|
|
1333
|
+
parsedArgs.options.files = parsedArgs.options.files.concat(withoutExcludedWorkspaces);
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1323
1336
|
}
|
|
1324
1337
|
return parsedArgs;
|
|
1325
1338
|
} catch (error) {
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
|
|
1
2
|
import {
|
|
2
3
|
__toESM,
|
|
3
4
|
bumpConfigDefaults,
|
|
@@ -6,24 +7,27 @@ import {
|
|
|
6
7
|
log_symbols_default,
|
|
7
8
|
require_picocolors,
|
|
8
9
|
versionBump
|
|
9
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-ZY4OVS4D.mjs";
|
|
10
11
|
|
|
11
12
|
// src/cli/index.ts
|
|
12
13
|
import process2 from "process";
|
|
13
14
|
|
|
14
15
|
// package.json
|
|
15
|
-
var version = "9.
|
|
16
|
+
var version = "9.3.0";
|
|
16
17
|
|
|
17
18
|
// src/cli/parse-args.ts
|
|
18
19
|
var import_picocolors = __toESM(require_picocolors());
|
|
19
20
|
import process from "process";
|
|
21
|
+
import fs from "fs/promises";
|
|
22
|
+
import fsSync from "fs";
|
|
20
23
|
import { valid as isValidVersion } from "semver";
|
|
21
24
|
import cac from "cac";
|
|
25
|
+
import yaml from "js-yaml";
|
|
22
26
|
async function parseArgs() {
|
|
23
27
|
var _a;
|
|
24
28
|
try {
|
|
25
29
|
const cli = cac("bumpp");
|
|
26
|
-
cli.version(version).usage("[...files]").option("--preid <preid>", "ID for prerelease").option("--all", `Include all files (default: ${bumpConfigDefaults.all})`).option("-c, --commit [msg]", `Commit message (default: ${bumpConfigDefaults.commit})`).option("--no-commit", "Skip commit").option("-t, --tag [tag]", `Tag name (default: ${bumpConfigDefaults.tag})`).option("--no-tag", "Skip 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("-v, --version <version>", "
|
|
30
|
+
cli.version(version).usage("[...files]").option("--preid <preid>", "ID for prerelease").option("--all", `Include all files (default: ${bumpConfigDefaults.all})`).option("-c, --commit [msg]", `Commit message (default: ${bumpConfigDefaults.commit})`).option("--no-commit", "Skip commit").option("-t, --tag [tag]", `Tag name (default: ${bumpConfigDefaults.tag})`).option("--no-tag", "Skip 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("-v, --version <version>", "Target version").option("-x, --execute <command>", "Commands to execute after version bumps").help();
|
|
27
31
|
const result = cli.parse();
|
|
28
32
|
const args = result.options;
|
|
29
33
|
const parsedArgs = {
|
|
@@ -52,10 +56,21 @@ async function parseArgs() {
|
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
if (parsedArgs.options.recursive) {
|
|
55
|
-
if ((_a = parsedArgs.options.files) == null ? void 0 : _a.length)
|
|
59
|
+
if ((_a = parsedArgs.options.files) == null ? void 0 : _a.length) {
|
|
56
60
|
console.log(import_picocolors.default.yellow("The --recursive option is ignored when files are specified"));
|
|
57
|
-
else
|
|
61
|
+
} else {
|
|
58
62
|
parsedArgs.options.files = ["package.json", "package-lock.json", "packages/**/package.json"];
|
|
63
|
+
if (fsSync.existsSync("pnpm-workspace.yaml")) {
|
|
64
|
+
const pnpmWorkspace = await fs.readFile("pnpm-workspace.yaml", "utf8");
|
|
65
|
+
const workspaces = yaml.load(pnpmWorkspace);
|
|
66
|
+
const workspacesWithPackageJson = workspaces.packages.map((workspace) => `${workspace}/package.json`);
|
|
67
|
+
const withoutExcludedWorkspaces = workspacesWithPackageJson.filter((workspace) => {
|
|
68
|
+
var _a2;
|
|
69
|
+
return !workspace.startsWith("!") && !((_a2 = parsedArgs.options.files) == null ? void 0 : _a2.includes(workspace));
|
|
70
|
+
});
|
|
71
|
+
parsedArgs.options.files = parsedArgs.options.files.concat(withoutExcludedWorkspaces);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
59
74
|
}
|
|
60
75
|
return parsedArgs;
|
|
61
76
|
} catch (error) {
|
package/dist/index.js
CHANGED
|
@@ -112,7 +112,6 @@ var src_exports = {};
|
|
|
112
112
|
__export(src_exports, {
|
|
113
113
|
NpmScript: () => NpmScript,
|
|
114
114
|
ProgressEvent: () => ProgressEvent,
|
|
115
|
-
ReleaseType: () => import_semver.ReleaseType,
|
|
116
115
|
bumpConfigDefaults: () => bumpConfigDefaults,
|
|
117
116
|
default: () => src_default,
|
|
118
117
|
defineConfig: () => defineConfig,
|
|
@@ -646,10 +645,9 @@ var import_prompts2 = __toESM(require("prompts"));
|
|
|
646
645
|
var import_node_process3 = __toESM(require("process"));
|
|
647
646
|
var import_picocolors = __toESM(require_picocolors());
|
|
648
647
|
var import_prompts = __toESM(require("prompts"));
|
|
649
|
-
var
|
|
648
|
+
var import_semver = __toESM(require("semver"));
|
|
650
649
|
|
|
651
650
|
// src/release-type.ts
|
|
652
|
-
var import_semver = require("semver");
|
|
653
651
|
var prereleaseTypes = ["premajor", "preminor", "prepatch", "prerelease"];
|
|
654
652
|
var releaseTypes = prereleaseTypes.concat(["major", "minor", "patch"]);
|
|
655
653
|
function isPrerelease(value) {
|
|
@@ -668,7 +666,7 @@ async function getNewVersion(operation) {
|
|
|
668
666
|
return promptForNewVersion(operation);
|
|
669
667
|
case "version":
|
|
670
668
|
return operation.update({
|
|
671
|
-
newVersion: new
|
|
669
|
+
newVersion: new import_semver.SemVer(release.version, true).version
|
|
672
670
|
});
|
|
673
671
|
default:
|
|
674
672
|
return operation.update({
|
|
@@ -678,7 +676,7 @@ async function getNewVersion(operation) {
|
|
|
678
676
|
}
|
|
679
677
|
}
|
|
680
678
|
function getNextVersion(oldVersion, bump) {
|
|
681
|
-
const oldSemVer = new
|
|
679
|
+
const oldSemVer = new import_semver.SemVer(oldVersion);
|
|
682
680
|
const newSemVer = oldSemVer.inc(bump.type, bump.preid);
|
|
683
681
|
if (isPrerelease(bump.type) && newSemVer.prerelease.length === 2 && newSemVer.prerelease[0] === bump.preid && String(newSemVer.prerelease[1]) === "0") {
|
|
684
682
|
newSemVer.prerelease[1] = "1";
|
|
@@ -689,12 +687,12 @@ function getNextVersion(oldVersion, bump) {
|
|
|
689
687
|
function getNextVersions(oldVersion, preid) {
|
|
690
688
|
var _a;
|
|
691
689
|
const next = {};
|
|
692
|
-
const parse =
|
|
690
|
+
const parse = import_semver.default.parse(oldVersion);
|
|
693
691
|
if (typeof (parse == null ? void 0 : parse.prerelease[0]) === "string")
|
|
694
692
|
preid = (parse == null ? void 0 : parse.prerelease[0]) || "preid";
|
|
695
693
|
for (const type of releaseTypes)
|
|
696
|
-
next[type] =
|
|
697
|
-
next.next = ((_a = parse == null ? void 0 : parse.prerelease) == null ? void 0 : _a.length) ?
|
|
694
|
+
next[type] = import_semver.default.inc(oldVersion, type, preid);
|
|
695
|
+
next.next = ((_a = parse == null ? void 0 : parse.prerelease) == null ? void 0 : _a.length) ? import_semver.default.inc(oldVersion, "prerelease", preid) : import_semver.default.inc(oldVersion, "patch");
|
|
698
696
|
return next;
|
|
699
697
|
}
|
|
700
698
|
async function promptForNewVersion(operation) {
|
|
@@ -702,7 +700,7 @@ async function promptForNewVersion(operation) {
|
|
|
702
700
|
const { oldVersion } = operation.state;
|
|
703
701
|
const release = operation.options.release;
|
|
704
702
|
const next = getNextVersions(oldVersion, release.preid);
|
|
705
|
-
const configCustomVersion = await ((_b = (_a = operation.options).customVersion) == null ? void 0 : _b.call(_a, oldVersion,
|
|
703
|
+
const configCustomVersion = await ((_b = (_a = operation.options).customVersion) == null ? void 0 : _b.call(_a, oldVersion, import_semver.default));
|
|
706
704
|
const PADDING = 13;
|
|
707
705
|
const answers = await (0, import_prompts.default)([
|
|
708
706
|
{
|
|
@@ -731,11 +729,11 @@ async function promptForNewVersion(operation) {
|
|
|
731
729
|
message: "Enter the new version number:",
|
|
732
730
|
initial: oldVersion,
|
|
733
731
|
validate: (custom) => {
|
|
734
|
-
return (0,
|
|
732
|
+
return (0, import_semver.valid)(custom) ? true : "That's not a valid version number";
|
|
735
733
|
}
|
|
736
734
|
}
|
|
737
735
|
]);
|
|
738
|
-
const newVersion = answers.release === "none" ? oldVersion : answers.release === "custom" ? (0,
|
|
736
|
+
const newVersion = answers.release === "none" ? oldVersion : answers.release === "custom" ? (0, import_semver.clean)(answers.custom) : answers.release === "config" ? (0, import_semver.clean)(configCustomVersion) : next[answers.release];
|
|
739
737
|
if (!newVersion)
|
|
740
738
|
import_node_process3.default.exit(1);
|
|
741
739
|
switch (answers.release) {
|
|
@@ -750,7 +748,7 @@ async function promptForNewVersion(operation) {
|
|
|
750
748
|
}
|
|
751
749
|
|
|
752
750
|
// src/get-old-version.ts
|
|
753
|
-
var
|
|
751
|
+
var import_semver2 = require("semver");
|
|
754
752
|
|
|
755
753
|
// src/fs.ts
|
|
756
754
|
var import_node_fs = __toESM(require("fs"));
|
|
@@ -942,7 +940,7 @@ async function readVersion(file, cwd) {
|
|
|
942
940
|
try {
|
|
943
941
|
const { data: manifest } = await readJsonFile(file, cwd);
|
|
944
942
|
if (isManifest(manifest)) {
|
|
945
|
-
if ((0,
|
|
943
|
+
if ((0, import_semver2.valid)(manifest.version))
|
|
946
944
|
return manifest.version;
|
|
947
945
|
}
|
|
948
946
|
} catch (error) {
|
|
@@ -976,7 +974,7 @@ async function gitCommit(operation) {
|
|
|
976
974
|
return operation;
|
|
977
975
|
const { all, noVerify, message } = operation.options.commit;
|
|
978
976
|
const { updatedFiles, newVersion } = operation.state;
|
|
979
|
-
let args = [];
|
|
977
|
+
let args = ["--allow-empty"];
|
|
980
978
|
if (all) {
|
|
981
979
|
args.push("--all");
|
|
982
980
|
}
|
|
@@ -1318,7 +1316,6 @@ var src_default = versionBump;
|
|
|
1318
1316
|
0 && (module.exports = {
|
|
1319
1317
|
NpmScript,
|
|
1320
1318
|
ProgressEvent,
|
|
1321
|
-
ReleaseType,
|
|
1322
1319
|
bumpConfigDefaults,
|
|
1323
1320
|
defineConfig,
|
|
1324
1321
|
loadBumpConfig,
|
package/dist/index.mjs
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
+
import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
|
|
1
2
|
import {
|
|
2
3
|
NpmScript,
|
|
3
4
|
ProgressEvent,
|
|
4
|
-
ReleaseType,
|
|
5
5
|
bumpConfigDefaults,
|
|
6
6
|
defineConfig,
|
|
7
7
|
loadBumpConfig,
|
|
8
8
|
versionBump,
|
|
9
9
|
versionBumpInfo
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZY4OVS4D.mjs";
|
|
11
11
|
|
|
12
12
|
// src/index.ts
|
|
13
13
|
var src_default = versionBump;
|
|
14
14
|
export {
|
|
15
15
|
NpmScript,
|
|
16
16
|
ProgressEvent,
|
|
17
|
-
ReleaseType,
|
|
18
17
|
bumpConfigDefaults,
|
|
19
18
|
src_default as default,
|
|
20
19
|
defineConfig,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bumpp",
|
|
3
|
-
"version": "9.
|
|
4
|
-
"packageManager": "pnpm@8.
|
|
3
|
+
"version": "9.3.0",
|
|
4
|
+
"packageManager": "pnpm@8.14.1",
|
|
5
5
|
"description": "Bump version, commit changes, tag, and push to Git",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "James Messinger",
|
|
@@ -58,20 +58,22 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@jsdevtools/ez-spawn": "^3.0.4",
|
|
61
|
-
"c12": "^1.
|
|
61
|
+
"c12": "^1.6.1",
|
|
62
62
|
"cac": "^6.7.14",
|
|
63
63
|
"fast-glob": "^3.3.2",
|
|
64
|
+
"js-yaml": "^4.1.0",
|
|
64
65
|
"prompts": "^2.4.2",
|
|
65
66
|
"semver": "^7.5.4"
|
|
66
67
|
},
|
|
67
68
|
"devDependencies": {
|
|
68
|
-
"@antfu/eslint-config": "^2.
|
|
69
|
-
"@types/
|
|
69
|
+
"@antfu/eslint-config": "^2.6.2",
|
|
70
|
+
"@types/js-yaml": "^4.0.9",
|
|
71
|
+
"@types/node": "^20.11.5",
|
|
70
72
|
"@types/prompts": "^2.4.9",
|
|
71
73
|
"@types/semver": "^7.5.6",
|
|
72
74
|
"detect-indent": "^7.0.1",
|
|
73
75
|
"detect-newline": "^4.0.1",
|
|
74
|
-
"eslint": "^8.
|
|
76
|
+
"eslint": "^8.56.0",
|
|
75
77
|
"esno": "^4.0.0",
|
|
76
78
|
"log-symbols": "^6.0.0",
|
|
77
79
|
"npm-check": "^6.0.1",
|