bumpp 9.8.1 → 9.9.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.
- package/dist/{chunk-UNJYHD4B.mjs → chunk-PU4CGCPI.mjs} +343 -544
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +381 -584
- package/dist/cli/index.mjs +13 -13
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +348 -553
- package/dist/index.mjs +1 -1
- package/package.json +11 -10
|
@@ -37,6 +37,10 @@ var __objRest = (source, exclude) => {
|
|
|
37
37
|
var __commonJS = (cb, mod) => function __require() {
|
|
38
38
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
39
39
|
};
|
|
40
|
+
var __export = (target, all) => {
|
|
41
|
+
for (var name in all)
|
|
42
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
43
|
+
};
|
|
40
44
|
var __copyProps = (to, from, except, desc) => {
|
|
41
45
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
42
46
|
for (let key of __getOwnPropNames(from))
|
|
@@ -59,8 +63,8 @@ var require_picocolors = __commonJS({
|
|
|
59
63
|
"node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports, module) {
|
|
60
64
|
var p = process || {};
|
|
61
65
|
var argv = p.argv || [];
|
|
62
|
-
var
|
|
63
|
-
var isColorSupported = !(!!
|
|
66
|
+
var env = p.env || {};
|
|
67
|
+
var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
64
68
|
var formatter = (open, close, replace = open) => (input) => {
|
|
65
69
|
let string = "" + input, index = string.indexOf(close, open.length);
|
|
66
70
|
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
@@ -126,517 +130,298 @@ var require_picocolors = __commonJS({
|
|
|
126
130
|
}
|
|
127
131
|
});
|
|
128
132
|
|
|
129
|
-
// node_modules/.pnpm/
|
|
130
|
-
var
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
blackBright: [90, 39],
|
|
158
|
-
gray: [90, 39],
|
|
159
|
-
// Alias of `blackBright`
|
|
160
|
-
grey: [90, 39],
|
|
161
|
-
// Alias of `blackBright`
|
|
162
|
-
redBright: [91, 39],
|
|
163
|
-
greenBright: [92, 39],
|
|
164
|
-
yellowBright: [93, 39],
|
|
165
|
-
blueBright: [94, 39],
|
|
166
|
-
magentaBright: [95, 39],
|
|
167
|
-
cyanBright: [96, 39],
|
|
168
|
-
whiteBright: [97, 39]
|
|
169
|
-
},
|
|
170
|
-
bgColor: {
|
|
171
|
-
bgBlack: [40, 49],
|
|
172
|
-
bgRed: [41, 49],
|
|
173
|
-
bgGreen: [42, 49],
|
|
174
|
-
bgYellow: [43, 49],
|
|
175
|
-
bgBlue: [44, 49],
|
|
176
|
-
bgMagenta: [45, 49],
|
|
177
|
-
bgCyan: [46, 49],
|
|
178
|
-
bgWhite: [47, 49],
|
|
179
|
-
// Bright color
|
|
180
|
-
bgBlackBright: [100, 49],
|
|
181
|
-
bgGray: [100, 49],
|
|
182
|
-
// Alias of `bgBlackBright`
|
|
183
|
-
bgGrey: [100, 49],
|
|
184
|
-
// Alias of `bgBlackBright`
|
|
185
|
-
bgRedBright: [101, 49],
|
|
186
|
-
bgGreenBright: [102, 49],
|
|
187
|
-
bgYellowBright: [103, 49],
|
|
188
|
-
bgBlueBright: [104, 49],
|
|
189
|
-
bgMagentaBright: [105, 49],
|
|
190
|
-
bgCyanBright: [106, 49],
|
|
191
|
-
bgWhiteBright: [107, 49]
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
var modifierNames = Object.keys(styles.modifier);
|
|
195
|
-
var foregroundColorNames = Object.keys(styles.color);
|
|
196
|
-
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
197
|
-
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
198
|
-
function assembleStyles() {
|
|
199
|
-
const codes = /* @__PURE__ */ new Map();
|
|
200
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
201
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
202
|
-
styles[styleName] = {
|
|
203
|
-
open: `\x1B[${style[0]}m`,
|
|
204
|
-
close: `\x1B[${style[1]}m`
|
|
205
|
-
};
|
|
206
|
-
group[styleName] = styles[styleName];
|
|
207
|
-
codes.set(style[0], style[1]);
|
|
133
|
+
// node_modules/.pnpm/shell-quote@1.8.2/node_modules/shell-quote/parse.js
|
|
134
|
+
var require_parse = __commonJS({
|
|
135
|
+
"node_modules/.pnpm/shell-quote@1.8.2/node_modules/shell-quote/parse.js"(exports, module) {
|
|
136
|
+
"use strict";
|
|
137
|
+
var CONTROL = "(?:" + [
|
|
138
|
+
"\\|\\|",
|
|
139
|
+
"\\&\\&",
|
|
140
|
+
";;",
|
|
141
|
+
"\\|\\&",
|
|
142
|
+
"\\<\\(",
|
|
143
|
+
"\\<\\<\\<",
|
|
144
|
+
">>",
|
|
145
|
+
">\\&",
|
|
146
|
+
"<\\&",
|
|
147
|
+
"[&;()|<>]"
|
|
148
|
+
].join("|") + ")";
|
|
149
|
+
var controlRE = new RegExp("^" + CONTROL + "$");
|
|
150
|
+
var META = "|&;()<> \\t";
|
|
151
|
+
var SINGLE_QUOTE = '"((\\\\"|[^"])*?)"';
|
|
152
|
+
var DOUBLE_QUOTE = "'((\\\\'|[^'])*?)'";
|
|
153
|
+
var hash = /^#$/;
|
|
154
|
+
var SQ = "'";
|
|
155
|
+
var DQ = '"';
|
|
156
|
+
var DS = "$";
|
|
157
|
+
var TOKEN = "";
|
|
158
|
+
var mult = 4294967296;
|
|
159
|
+
for (i = 0; i < 4; i++) {
|
|
160
|
+
TOKEN += (mult * Math.random()).toString(16);
|
|
208
161
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
styles.bgColor.close = "\x1B[49m";
|
|
220
|
-
styles.color.ansi = wrapAnsi16();
|
|
221
|
-
styles.color.ansi256 = wrapAnsi256();
|
|
222
|
-
styles.color.ansi16m = wrapAnsi16m();
|
|
223
|
-
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
224
|
-
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
225
|
-
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
226
|
-
Object.defineProperties(styles, {
|
|
227
|
-
rgbToAnsi256: {
|
|
228
|
-
value(red, green, blue) {
|
|
229
|
-
if (red === green && green === blue) {
|
|
230
|
-
if (red < 8) {
|
|
231
|
-
return 16;
|
|
232
|
-
}
|
|
233
|
-
if (red > 248) {
|
|
234
|
-
return 231;
|
|
235
|
-
}
|
|
236
|
-
return Math.round((red - 8) / 247 * 24) + 232;
|
|
237
|
-
}
|
|
238
|
-
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
239
|
-
},
|
|
240
|
-
enumerable: false
|
|
241
|
-
},
|
|
242
|
-
hexToRgb: {
|
|
243
|
-
value(hex) {
|
|
244
|
-
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
245
|
-
if (!matches) {
|
|
246
|
-
return [0, 0, 0];
|
|
247
|
-
}
|
|
248
|
-
let [colorString] = matches;
|
|
249
|
-
if (colorString.length === 3) {
|
|
250
|
-
colorString = [...colorString].map((character) => character + character).join("");
|
|
162
|
+
var i;
|
|
163
|
+
var startsWithToken = new RegExp("^" + TOKEN);
|
|
164
|
+
function matchAll(s, r) {
|
|
165
|
+
var origIndex = r.lastIndex;
|
|
166
|
+
var matches = [];
|
|
167
|
+
var matchObj;
|
|
168
|
+
while (matchObj = r.exec(s)) {
|
|
169
|
+
matches.push(matchObj);
|
|
170
|
+
if (r.lastIndex === matchObj.index) {
|
|
171
|
+
r.lastIndex += 1;
|
|
251
172
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
173
|
+
}
|
|
174
|
+
r.lastIndex = origIndex;
|
|
175
|
+
return matches;
|
|
176
|
+
}
|
|
177
|
+
function getVar(env, pre, key) {
|
|
178
|
+
var r = typeof env === "function" ? env(key) : env[key];
|
|
179
|
+
if (typeof r === "undefined" && key != "") {
|
|
180
|
+
r = "";
|
|
181
|
+
} else if (typeof r === "undefined") {
|
|
182
|
+
r = "$";
|
|
183
|
+
}
|
|
184
|
+
if (typeof r === "object") {
|
|
185
|
+
return pre + TOKEN + JSON.stringify(r) + TOKEN;
|
|
186
|
+
}
|
|
187
|
+
return pre + r;
|
|
188
|
+
}
|
|
189
|
+
function parseInternal(string, env, opts) {
|
|
190
|
+
if (!opts) {
|
|
191
|
+
opts = {};
|
|
192
|
+
}
|
|
193
|
+
var BS = opts.escape || "\\";
|
|
194
|
+
var BAREWORD = "(\\" + BS + `['"` + META + `]|[^\\s'"` + META + "])+";
|
|
195
|
+
var chunker = new RegExp([
|
|
196
|
+
"(" + CONTROL + ")",
|
|
197
|
+
// control chars
|
|
198
|
+
"(" + BAREWORD + "|" + SINGLE_QUOTE + "|" + DOUBLE_QUOTE + ")+"
|
|
199
|
+
].join("|"), "g");
|
|
200
|
+
var matches = matchAll(string, chunker);
|
|
201
|
+
if (matches.length === 0) {
|
|
202
|
+
return [];
|
|
203
|
+
}
|
|
204
|
+
if (!env) {
|
|
205
|
+
env = {};
|
|
206
|
+
}
|
|
207
|
+
var commented = false;
|
|
208
|
+
return matches.map(function(match) {
|
|
209
|
+
var s = match[0];
|
|
210
|
+
if (!s || commented) {
|
|
211
|
+
return void 0;
|
|
271
212
|
}
|
|
272
|
-
if (
|
|
273
|
-
return
|
|
213
|
+
if (controlRE.test(s)) {
|
|
214
|
+
return { op: s };
|
|
274
215
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
216
|
+
var quote = false;
|
|
217
|
+
var esc = false;
|
|
218
|
+
var out = "";
|
|
219
|
+
var isGlob = false;
|
|
220
|
+
var i2;
|
|
221
|
+
function parseEnvVar() {
|
|
222
|
+
i2 += 1;
|
|
223
|
+
var varend;
|
|
224
|
+
var varname;
|
|
225
|
+
var char = s.charAt(i2);
|
|
226
|
+
if (char === "{") {
|
|
227
|
+
i2 += 1;
|
|
228
|
+
if (s.charAt(i2) === "}") {
|
|
229
|
+
throw new Error("Bad substitution: " + s.slice(i2 - 2, i2 + 1));
|
|
230
|
+
}
|
|
231
|
+
varend = s.indexOf("}", i2);
|
|
232
|
+
if (varend < 0) {
|
|
233
|
+
throw new Error("Bad substitution: " + s.slice(i2));
|
|
234
|
+
}
|
|
235
|
+
varname = s.slice(i2, varend);
|
|
236
|
+
i2 = varend;
|
|
237
|
+
} else if (/[*@#?$!_-]/.test(char)) {
|
|
238
|
+
varname = char;
|
|
239
|
+
i2 += 1;
|
|
240
|
+
} else {
|
|
241
|
+
var slicedFromI = s.slice(i2);
|
|
242
|
+
varend = slicedFromI.match(/[^\w\d_]/);
|
|
243
|
+
if (!varend) {
|
|
244
|
+
varname = slicedFromI;
|
|
245
|
+
i2 = s.length;
|
|
246
|
+
} else {
|
|
247
|
+
varname = slicedFromI.slice(0, varend.index);
|
|
248
|
+
i2 += varend.index - 1;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return getVar(env, "", varname);
|
|
288
252
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
253
|
+
for (i2 = 0; i2 < s.length; i2++) {
|
|
254
|
+
var c4 = s.charAt(i2);
|
|
255
|
+
isGlob = isGlob || !quote && (c4 === "*" || c4 === "?");
|
|
256
|
+
if (esc) {
|
|
257
|
+
out += c4;
|
|
258
|
+
esc = false;
|
|
259
|
+
} else if (quote) {
|
|
260
|
+
if (c4 === quote) {
|
|
261
|
+
quote = false;
|
|
262
|
+
} else if (quote == SQ) {
|
|
263
|
+
out += c4;
|
|
264
|
+
} else {
|
|
265
|
+
if (c4 === BS) {
|
|
266
|
+
i2 += 1;
|
|
267
|
+
c4 = s.charAt(i2);
|
|
268
|
+
if (c4 === DQ || c4 === BS || c4 === DS) {
|
|
269
|
+
out += c4;
|
|
270
|
+
} else {
|
|
271
|
+
out += BS + c4;
|
|
272
|
+
}
|
|
273
|
+
} else if (c4 === DS) {
|
|
274
|
+
out += parseEnvVar();
|
|
275
|
+
} else {
|
|
276
|
+
out += c4;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
} else if (c4 === DQ || c4 === SQ) {
|
|
280
|
+
quote = c4;
|
|
281
|
+
} else if (controlRE.test(c4)) {
|
|
282
|
+
return { op: s };
|
|
283
|
+
} else if (hash.test(c4)) {
|
|
284
|
+
commented = true;
|
|
285
|
+
var commentObj = { comment: string.slice(match.index + i2 + 1) };
|
|
286
|
+
if (out.length) {
|
|
287
|
+
return [out, commentObj];
|
|
288
|
+
}
|
|
289
|
+
return [commentObj];
|
|
290
|
+
} else if (c4 === BS) {
|
|
291
|
+
esc = true;
|
|
292
|
+
} else if (c4 === DS) {
|
|
293
|
+
out += parseEnvVar();
|
|
294
|
+
} else {
|
|
295
|
+
out += c4;
|
|
296
|
+
}
|
|
292
297
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
result += 60;
|
|
298
|
+
if (isGlob) {
|
|
299
|
+
return { op: "glob", pattern: out };
|
|
296
300
|
}
|
|
297
|
-
return
|
|
298
|
-
},
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
rgbToAnsi: {
|
|
302
|
-
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
303
|
-
enumerable: false
|
|
304
|
-
},
|
|
305
|
-
hexToAnsi: {
|
|
306
|
-
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
307
|
-
enumerable: false
|
|
301
|
+
return out;
|
|
302
|
+
}).reduce(function(prev, arg) {
|
|
303
|
+
return typeof arg === "undefined" ? prev : prev.concat(arg);
|
|
304
|
+
}, []);
|
|
308
305
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
var ansi_styles_default = ansiStyles;
|
|
314
|
-
|
|
315
|
-
// node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js
|
|
316
|
-
import process2 from "node:process";
|
|
317
|
-
import os from "node:os";
|
|
318
|
-
import tty from "node:tty";
|
|
319
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
|
|
320
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
321
|
-
const position = argv.indexOf(prefix + flag);
|
|
322
|
-
const terminatorPosition = argv.indexOf("--");
|
|
323
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
324
|
-
}
|
|
325
|
-
var { env } = process2;
|
|
326
|
-
var flagForceColor;
|
|
327
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
328
|
-
flagForceColor = 0;
|
|
329
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
330
|
-
flagForceColor = 1;
|
|
331
|
-
}
|
|
332
|
-
function envForceColor() {
|
|
333
|
-
if ("FORCE_COLOR" in env) {
|
|
334
|
-
if (env.FORCE_COLOR === "true") {
|
|
335
|
-
return 1;
|
|
336
|
-
}
|
|
337
|
-
if (env.FORCE_COLOR === "false") {
|
|
338
|
-
return 0;
|
|
339
|
-
}
|
|
340
|
-
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
function translateLevel(level) {
|
|
344
|
-
if (level === 0) {
|
|
345
|
-
return false;
|
|
346
|
-
}
|
|
347
|
-
return {
|
|
348
|
-
level,
|
|
349
|
-
hasBasic: true,
|
|
350
|
-
has256: level >= 2,
|
|
351
|
-
has16m: level >= 3
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
355
|
-
const noFlagForceColor = envForceColor();
|
|
356
|
-
if (noFlagForceColor !== void 0) {
|
|
357
|
-
flagForceColor = noFlagForceColor;
|
|
358
|
-
}
|
|
359
|
-
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
360
|
-
if (forceColor === 0) {
|
|
361
|
-
return 0;
|
|
362
|
-
}
|
|
363
|
-
if (sniffFlags) {
|
|
364
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
365
|
-
return 3;
|
|
366
|
-
}
|
|
367
|
-
if (hasFlag("color=256")) {
|
|
368
|
-
return 2;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
372
|
-
return 1;
|
|
373
|
-
}
|
|
374
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
375
|
-
return 0;
|
|
376
|
-
}
|
|
377
|
-
const min = forceColor || 0;
|
|
378
|
-
if (env.TERM === "dumb") {
|
|
379
|
-
return min;
|
|
380
|
-
}
|
|
381
|
-
if (process2.platform === "win32") {
|
|
382
|
-
const osRelease = os.release().split(".");
|
|
383
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
384
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
385
|
-
}
|
|
386
|
-
return 1;
|
|
387
|
-
}
|
|
388
|
-
if ("CI" in env) {
|
|
389
|
-
if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
|
|
390
|
-
return 3;
|
|
391
|
-
}
|
|
392
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
393
|
-
return 1;
|
|
394
|
-
}
|
|
395
|
-
return min;
|
|
396
|
-
}
|
|
397
|
-
if ("TEAMCITY_VERSION" in env) {
|
|
398
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
399
|
-
}
|
|
400
|
-
if (env.COLORTERM === "truecolor") {
|
|
401
|
-
return 3;
|
|
402
|
-
}
|
|
403
|
-
if (env.TERM === "xterm-kitty") {
|
|
404
|
-
return 3;
|
|
405
|
-
}
|
|
406
|
-
if ("TERM_PROGRAM" in env) {
|
|
407
|
-
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
408
|
-
switch (env.TERM_PROGRAM) {
|
|
409
|
-
case "iTerm.app": {
|
|
410
|
-
return version >= 3 ? 3 : 2;
|
|
306
|
+
module.exports = function parse2(s, env, opts) {
|
|
307
|
+
var mapped = parseInternal(s, env, opts);
|
|
308
|
+
if (typeof env !== "function") {
|
|
309
|
+
return mapped;
|
|
411
310
|
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
311
|
+
return mapped.reduce(function(acc, s2) {
|
|
312
|
+
if (typeof s2 === "object") {
|
|
313
|
+
return acc.concat(s2);
|
|
314
|
+
}
|
|
315
|
+
var xs = s2.split(RegExp("(" + TOKEN + ".*?" + TOKEN + ")", "g"));
|
|
316
|
+
if (xs.length === 1) {
|
|
317
|
+
return acc.concat(xs[0]);
|
|
318
|
+
}
|
|
319
|
+
return acc.concat(xs.filter(Boolean).map(function(x5) {
|
|
320
|
+
if (startsWithToken.test(x5)) {
|
|
321
|
+
return JSON.parse(x5.split(TOKEN)[1]);
|
|
322
|
+
}
|
|
323
|
+
return x5;
|
|
324
|
+
}));
|
|
325
|
+
}, []);
|
|
326
|
+
};
|
|
425
327
|
}
|
|
426
|
-
|
|
427
|
-
}
|
|
428
|
-
function createSupportsColor(stream, options = {}) {
|
|
429
|
-
const level = _supportsColor(stream, __spreadValues({
|
|
430
|
-
streamIsTTY: stream && stream.isTTY
|
|
431
|
-
}, options));
|
|
432
|
-
return translateLevel(level);
|
|
433
|
-
}
|
|
434
|
-
var supportsColor = {
|
|
435
|
-
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
436
|
-
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
437
|
-
};
|
|
438
|
-
var supports_color_default = supportsColor;
|
|
328
|
+
});
|
|
439
329
|
|
|
440
|
-
// node_modules/.pnpm/
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
let returnValue = "";
|
|
449
|
-
do {
|
|
450
|
-
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
451
|
-
endIndex = index + substringLength;
|
|
452
|
-
index = string.indexOf(substring, endIndex);
|
|
453
|
-
} while (index !== -1);
|
|
454
|
-
returnValue += string.slice(endIndex);
|
|
455
|
-
return returnValue;
|
|
456
|
-
}
|
|
457
|
-
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
458
|
-
let endIndex = 0;
|
|
459
|
-
let returnValue = "";
|
|
460
|
-
do {
|
|
461
|
-
const gotCR = string[index - 1] === "\r";
|
|
462
|
-
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
463
|
-
endIndex = index + 1;
|
|
464
|
-
index = string.indexOf("\n", endIndex);
|
|
465
|
-
} while (index !== -1);
|
|
466
|
-
returnValue += string.slice(endIndex);
|
|
467
|
-
return returnValue;
|
|
468
|
-
}
|
|
330
|
+
// node_modules/.pnpm/log-symbols@7.0.0/node_modules/log-symbols/symbols.js
|
|
331
|
+
var symbols_exports = {};
|
|
332
|
+
__export(symbols_exports, {
|
|
333
|
+
error: () => error,
|
|
334
|
+
info: () => info,
|
|
335
|
+
success: () => success,
|
|
336
|
+
warning: () => warning
|
|
337
|
+
});
|
|
469
338
|
|
|
470
|
-
// node_modules/.pnpm/
|
|
471
|
-
|
|
472
|
-
var
|
|
473
|
-
var
|
|
474
|
-
var
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
}
|
|
486
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
487
|
-
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
488
|
-
};
|
|
489
|
-
var chalkFactory = (options) => {
|
|
490
|
-
const chalk2 = (...strings) => strings.join(" ");
|
|
491
|
-
applyOptions(chalk2, options);
|
|
492
|
-
Object.setPrototypeOf(chalk2, createChalk.prototype);
|
|
493
|
-
return chalk2;
|
|
494
|
-
};
|
|
495
|
-
function createChalk(options) {
|
|
496
|
-
return chalkFactory(options);
|
|
497
|
-
}
|
|
498
|
-
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
499
|
-
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
500
|
-
styles2[styleName] = {
|
|
501
|
-
get() {
|
|
502
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
503
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
504
|
-
return builder;
|
|
505
|
-
}
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
styles2.visible = {
|
|
509
|
-
get() {
|
|
510
|
-
const builder = createBuilder(this, this[STYLER], true);
|
|
511
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
512
|
-
return builder;
|
|
513
|
-
}
|
|
514
|
-
};
|
|
515
|
-
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
516
|
-
if (model === "rgb") {
|
|
517
|
-
if (level === "ansi16m") {
|
|
518
|
-
return ansi_styles_default[type].ansi16m(...arguments_);
|
|
519
|
-
}
|
|
520
|
-
if (level === "ansi256") {
|
|
521
|
-
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
522
|
-
}
|
|
523
|
-
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
524
|
-
}
|
|
525
|
-
if (model === "hex") {
|
|
526
|
-
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
527
|
-
}
|
|
528
|
-
return ansi_styles_default[type][model](...arguments_);
|
|
529
|
-
};
|
|
530
|
-
var usedModels = ["rgb", "hex", "ansi256"];
|
|
531
|
-
for (const model of usedModels) {
|
|
532
|
-
styles2[model] = {
|
|
533
|
-
get() {
|
|
534
|
-
const { level } = this;
|
|
535
|
-
return function(...arguments_) {
|
|
536
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
537
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
538
|
-
};
|
|
539
|
-
}
|
|
540
|
-
};
|
|
541
|
-
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
542
|
-
styles2[bgModel] = {
|
|
543
|
-
get() {
|
|
544
|
-
const { level } = this;
|
|
545
|
-
return function(...arguments_) {
|
|
546
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
547
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
548
|
-
};
|
|
339
|
+
// node_modules/.pnpm/yoctocolors@2.1.1/node_modules/yoctocolors/base.js
|
|
340
|
+
import tty from "node:tty";
|
|
341
|
+
var _a, _b, _c, _d, _e;
|
|
342
|
+
var hasColors = (_e = (_d = (_c = (_b = (_a = tty) == null ? void 0 : _a.WriteStream) == null ? void 0 : _b.prototype) == null ? void 0 : _c.hasColors) == null ? void 0 : _d.call(_c)) != null ? _e : false;
|
|
343
|
+
var format = (open, close) => {
|
|
344
|
+
if (!hasColors) {
|
|
345
|
+
return (input) => input;
|
|
346
|
+
}
|
|
347
|
+
const openCode = `\x1B[${open}m`;
|
|
348
|
+
const closeCode = `\x1B[${close}m`;
|
|
349
|
+
return (input) => {
|
|
350
|
+
const string = input + "";
|
|
351
|
+
let index = string.indexOf(closeCode);
|
|
352
|
+
if (index === -1) {
|
|
353
|
+
return openCode + string + closeCode;
|
|
549
354
|
}
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
get() {
|
|
557
|
-
return this[GENERATOR].level;
|
|
558
|
-
},
|
|
559
|
-
set(level) {
|
|
560
|
-
this[GENERATOR].level = level;
|
|
355
|
+
let result = openCode;
|
|
356
|
+
let lastIndex = 0;
|
|
357
|
+
while (index !== -1) {
|
|
358
|
+
result += string.slice(lastIndex, index) + openCode;
|
|
359
|
+
lastIndex = index + closeCode.length;
|
|
360
|
+
index = string.indexOf(closeCode, lastIndex);
|
|
561
361
|
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
var createStyler = (open, close, parent) => {
|
|
565
|
-
let openAll;
|
|
566
|
-
let closeAll;
|
|
567
|
-
if (parent === void 0) {
|
|
568
|
-
openAll = open;
|
|
569
|
-
closeAll = close;
|
|
570
|
-
} else {
|
|
571
|
-
openAll = parent.openAll + open;
|
|
572
|
-
closeAll = close + parent.closeAll;
|
|
573
|
-
}
|
|
574
|
-
return {
|
|
575
|
-
open,
|
|
576
|
-
close,
|
|
577
|
-
openAll,
|
|
578
|
-
closeAll,
|
|
579
|
-
parent
|
|
362
|
+
result += string.slice(lastIndex) + closeCode;
|
|
363
|
+
return result;
|
|
580
364
|
};
|
|
581
365
|
};
|
|
582
|
-
var
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
var
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
var
|
|
613
|
-
var
|
|
614
|
-
var
|
|
366
|
+
var reset = format(0, 0);
|
|
367
|
+
var bold = format(1, 22);
|
|
368
|
+
var dim = format(2, 22);
|
|
369
|
+
var italic = format(3, 23);
|
|
370
|
+
var underline = format(4, 24);
|
|
371
|
+
var overline = format(53, 55);
|
|
372
|
+
var inverse = format(7, 27);
|
|
373
|
+
var hidden = format(8, 28);
|
|
374
|
+
var strikethrough = format(9, 29);
|
|
375
|
+
var black = format(30, 39);
|
|
376
|
+
var red = format(31, 39);
|
|
377
|
+
var green = format(32, 39);
|
|
378
|
+
var yellow = format(33, 39);
|
|
379
|
+
var blue = format(34, 39);
|
|
380
|
+
var magenta = format(35, 39);
|
|
381
|
+
var cyan = format(36, 39);
|
|
382
|
+
var white = format(37, 39);
|
|
383
|
+
var gray = format(90, 39);
|
|
384
|
+
var bgBlack = format(40, 49);
|
|
385
|
+
var bgRed = format(41, 49);
|
|
386
|
+
var bgGreen = format(42, 49);
|
|
387
|
+
var bgYellow = format(43, 49);
|
|
388
|
+
var bgBlue = format(44, 49);
|
|
389
|
+
var bgMagenta = format(45, 49);
|
|
390
|
+
var bgCyan = format(46, 49);
|
|
391
|
+
var bgWhite = format(47, 49);
|
|
392
|
+
var bgGray = format(100, 49);
|
|
393
|
+
var redBright = format(91, 39);
|
|
394
|
+
var greenBright = format(92, 39);
|
|
395
|
+
var yellowBright = format(93, 39);
|
|
396
|
+
var blueBright = format(94, 39);
|
|
397
|
+
var magentaBright = format(95, 39);
|
|
398
|
+
var cyanBright = format(96, 39);
|
|
399
|
+
var whiteBright = format(97, 39);
|
|
400
|
+
var bgRedBright = format(101, 49);
|
|
401
|
+
var bgGreenBright = format(102, 49);
|
|
402
|
+
var bgYellowBright = format(103, 49);
|
|
403
|
+
var bgBlueBright = format(104, 49);
|
|
404
|
+
var bgMagentaBright = format(105, 49);
|
|
405
|
+
var bgCyanBright = format(106, 49);
|
|
406
|
+
var bgWhiteBright = format(107, 49);
|
|
615
407
|
|
|
616
|
-
// node_modules/.pnpm/is-unicode-supported@1.
|
|
617
|
-
import
|
|
408
|
+
// node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
|
|
409
|
+
import process2 from "node:process";
|
|
618
410
|
function isUnicodeSupported() {
|
|
619
|
-
|
|
620
|
-
|
|
411
|
+
const { env } = process2;
|
|
412
|
+
const { TERM, TERM_PROGRAM } = env;
|
|
413
|
+
if (process2.platform !== "win32") {
|
|
414
|
+
return TERM !== "linux";
|
|
621
415
|
}
|
|
622
|
-
return Boolean(
|
|
416
|
+
return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
623
417
|
}
|
|
624
418
|
|
|
625
|
-
// node_modules/.pnpm/log-symbols@
|
|
626
|
-
var
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
};
|
|
632
|
-
var fallback = {
|
|
633
|
-
info: source_default.blue("i"),
|
|
634
|
-
success: source_default.green("\u221A"),
|
|
635
|
-
warning: source_default.yellow("\u203C"),
|
|
636
|
-
error: source_default.red("\xD7")
|
|
637
|
-
};
|
|
638
|
-
var logSymbols = isUnicodeSupported() ? main : fallback;
|
|
639
|
-
var log_symbols_default = logSymbols;
|
|
419
|
+
// node_modules/.pnpm/log-symbols@7.0.0/node_modules/log-symbols/symbols.js
|
|
420
|
+
var _isUnicodeSupported = isUnicodeSupported();
|
|
421
|
+
var info = blue(_isUnicodeSupported ? "\u2139" : "i");
|
|
422
|
+
var success = green(_isUnicodeSupported ? "\u2714" : "\u221A");
|
|
423
|
+
var warning = yellow(_isUnicodeSupported ? "\u26A0" : "\u203C");
|
|
424
|
+
var error = red(_isUnicodeSupported ? "\u2716\uFE0F" : "\xD7");
|
|
640
425
|
|
|
641
426
|
// src/release-type.ts
|
|
642
427
|
var prereleaseTypes = ["premajor", "preminor", "prepatch", "prerelease"];
|
|
@@ -666,10 +451,11 @@ var NpmScript = /* @__PURE__ */ ((NpmScript2) => {
|
|
|
666
451
|
})(NpmScript || {});
|
|
667
452
|
|
|
668
453
|
// src/version-bump.ts
|
|
669
|
-
import
|
|
670
|
-
import * as ezSpawn4 from "@jsdevtools/ez-spawn";
|
|
454
|
+
import process5 from "node:process";
|
|
671
455
|
var import_picocolors3 = __toESM(require_picocolors());
|
|
456
|
+
var import_parse = __toESM(require_parse());
|
|
672
457
|
import prompts2 from "prompts";
|
|
458
|
+
import { x as x4 } from "tinyexec";
|
|
673
459
|
|
|
674
460
|
// src/get-current-version.ts
|
|
675
461
|
import { valid as isValidVersion } from "semver";
|
|
@@ -723,8 +509,8 @@ function isManifest(obj) {
|
|
|
723
509
|
return obj && typeof obj === "object" && isOptionalString(obj.name) && isOptionalString(obj.version) && isOptionalString(obj.description);
|
|
724
510
|
}
|
|
725
511
|
function isPackageLockManifest(manifest) {
|
|
726
|
-
var
|
|
727
|
-
return typeof ((
|
|
512
|
+
var _a2, _b2;
|
|
513
|
+
return typeof ((_b2 = (_a2 = manifest.packages) == null ? void 0 : _a2[""]) == null ? void 0 : _b2.version) === "string";
|
|
728
514
|
}
|
|
729
515
|
function isOptionalString(value) {
|
|
730
516
|
const type = typeof value;
|
|
@@ -770,13 +556,13 @@ async function readVersion(file, cwd) {
|
|
|
770
556
|
|
|
771
557
|
// src/get-new-version.ts
|
|
772
558
|
var import_picocolors2 = __toESM(require_picocolors());
|
|
773
|
-
import
|
|
559
|
+
import process3 from "node:process";
|
|
774
560
|
import prompts from "prompts";
|
|
775
561
|
import semver, { clean as cleanVersion, valid as isValidVersion2, SemVer } from "semver";
|
|
776
562
|
|
|
777
563
|
// src/print-commits.ts
|
|
778
564
|
var import_picocolors = __toESM(require_picocolors());
|
|
779
|
-
import
|
|
565
|
+
import { x } from "tinyexec";
|
|
780
566
|
var messageColorMap = {
|
|
781
567
|
chore: import_picocolors.default.gray,
|
|
782
568
|
fix: import_picocolors.default.yellow,
|
|
@@ -795,20 +581,21 @@ function parseCommits(raw) {
|
|
|
795
581
|
return lines.map((line) => {
|
|
796
582
|
const [hash, ...parts] = line.split(" ");
|
|
797
583
|
const message = parts.join(" ");
|
|
798
|
-
const match = message.match(/^(\w+)(!)?(\([^)]+\))?:(.*)$/);
|
|
584
|
+
const match = message.match(/^(\w+)(!)?(\([^)]+\))?(!)?:(.*)$/);
|
|
799
585
|
if (match) {
|
|
800
586
|
let color = messageColorMap[match[1].toLowerCase()] || ((c4) => c4);
|
|
801
|
-
|
|
587
|
+
const breaking = match[2] === "!" || match[4] === "!";
|
|
588
|
+
if (breaking) {
|
|
802
589
|
color = (s) => import_picocolors.default.inverse(import_picocolors.default.red(s));
|
|
803
590
|
}
|
|
804
|
-
const tag = [match[1], match[2]].filter(Boolean).join("");
|
|
591
|
+
const tag = [match[1], match[2], match[4]].filter(Boolean).join("");
|
|
805
592
|
const scope = match[3] || "";
|
|
806
593
|
return {
|
|
807
594
|
hash,
|
|
808
595
|
tag,
|
|
809
|
-
message: match[
|
|
596
|
+
message: match[5].trim(),
|
|
810
597
|
scope,
|
|
811
|
-
breaking
|
|
598
|
+
breaking,
|
|
812
599
|
color
|
|
813
600
|
};
|
|
814
601
|
}
|
|
@@ -843,23 +630,23 @@ function formatParsedCommits(commits) {
|
|
|
843
630
|
}
|
|
844
631
|
async function printRecentCommits(operation) {
|
|
845
632
|
let sha;
|
|
846
|
-
sha || (sha = await
|
|
633
|
+
sha || (sha = await x(
|
|
847
634
|
"git",
|
|
848
635
|
["rev-list", "-n", "1", `v${operation.state.currentVersion}`],
|
|
849
|
-
{ stdio: "pipe" }
|
|
850
|
-
).then((res) => res.stdout.trim())
|
|
851
|
-
sha || (sha = await
|
|
636
|
+
{ nodeOptions: { stdio: "pipe" }, throwOnError: false }
|
|
637
|
+
).then((res) => res.stdout.trim()));
|
|
638
|
+
sha || (sha = await x(
|
|
852
639
|
"git",
|
|
853
640
|
["rev-list", "-n", "1", operation.state.currentVersion],
|
|
854
|
-
{ stdio: "pipe" }
|
|
855
|
-
).then((res) => res.stdout.trim())
|
|
641
|
+
{ nodeOptions: { stdio: "pipe" }, throwOnError: false }
|
|
642
|
+
).then((res) => res.stdout.trim()));
|
|
856
643
|
if (!sha) {
|
|
857
644
|
console.log(
|
|
858
645
|
import_picocolors.default.blue(`i`) + import_picocolors.default.gray(` Failed to locate the previous tag ${import_picocolors.default.yellow(`v${operation.state.currentVersion}`)}`)
|
|
859
646
|
);
|
|
860
647
|
return;
|
|
861
648
|
}
|
|
862
|
-
const { stdout } = await
|
|
649
|
+
const { stdout } = await x(
|
|
863
650
|
"git",
|
|
864
651
|
[
|
|
865
652
|
"--no-pager",
|
|
@@ -867,7 +654,11 @@ async function printRecentCommits(operation) {
|
|
|
867
654
|
`${sha}..HEAD`,
|
|
868
655
|
"--oneline"
|
|
869
656
|
],
|
|
870
|
-
{
|
|
657
|
+
{
|
|
658
|
+
nodeOptions: {
|
|
659
|
+
stdio: "pipe"
|
|
660
|
+
}
|
|
661
|
+
}
|
|
871
662
|
);
|
|
872
663
|
const parsed = parseCommits(stdout.toString().trim());
|
|
873
664
|
const prettified = formatParsedCommits(parsed);
|
|
@@ -926,11 +717,11 @@ function getNextVersions(currentVersion, preid) {
|
|
|
926
717
|
return next;
|
|
927
718
|
}
|
|
928
719
|
async function promptForNewVersion(operation) {
|
|
929
|
-
var
|
|
720
|
+
var _a2, _b2;
|
|
930
721
|
const { currentVersion } = operation.state;
|
|
931
722
|
const release = operation.options.release;
|
|
932
723
|
const next = getNextVersions(currentVersion, release.preid);
|
|
933
|
-
const configCustomVersion = await ((
|
|
724
|
+
const configCustomVersion = await ((_b2 = (_a2 = operation.options).customVersion) == null ? void 0 : _b2.call(_a2, currentVersion, semver));
|
|
934
725
|
if (operation.options.printCommits) {
|
|
935
726
|
await printRecentCommits(operation);
|
|
936
727
|
}
|
|
@@ -968,7 +759,7 @@ async function promptForNewVersion(operation) {
|
|
|
968
759
|
]);
|
|
969
760
|
const newVersion = answers.release === "none" ? currentVersion : answers.release === "custom" ? cleanVersion(answers.custom) : answers.release === "config" ? cleanVersion(configCustomVersion) : next[answers.release];
|
|
970
761
|
if (!newVersion)
|
|
971
|
-
|
|
762
|
+
process3.exit(1);
|
|
972
763
|
switch (answers.release) {
|
|
973
764
|
case "custom":
|
|
974
765
|
case "config":
|
|
@@ -981,7 +772,7 @@ async function promptForNewVersion(operation) {
|
|
|
981
772
|
}
|
|
982
773
|
|
|
983
774
|
// src/git.ts
|
|
984
|
-
import
|
|
775
|
+
import { x as x2 } from "tinyexec";
|
|
985
776
|
async function gitCommit(operation) {
|
|
986
777
|
if (!operation.options.commit)
|
|
987
778
|
return operation;
|
|
@@ -1001,7 +792,7 @@ async function gitCommit(operation) {
|
|
|
1001
792
|
args.push("--message", commitMessage);
|
|
1002
793
|
if (!all)
|
|
1003
794
|
args = args.concat(updatedFiles);
|
|
1004
|
-
await
|
|
795
|
+
await x2("git", ["commit", ...args]);
|
|
1005
796
|
return operation.update({ event: "git commit" /* GitCommit */, commitMessage });
|
|
1006
797
|
}
|
|
1007
798
|
async function gitTag(operation) {
|
|
@@ -1022,15 +813,15 @@ async function gitTag(operation) {
|
|
|
1022
813
|
if (operation.options.sign) {
|
|
1023
814
|
args.push("--sign");
|
|
1024
815
|
}
|
|
1025
|
-
await
|
|
816
|
+
await x2("git", ["tag", ...args]);
|
|
1026
817
|
return operation.update({ event: "git tag" /* GitTag */, tagName });
|
|
1027
818
|
}
|
|
1028
819
|
async function gitPush(operation) {
|
|
1029
820
|
if (!operation.options.push)
|
|
1030
821
|
return operation;
|
|
1031
|
-
await
|
|
822
|
+
await x2("git", ["push"]);
|
|
1032
823
|
if (operation.options.tag) {
|
|
1033
|
-
await
|
|
824
|
+
await x2("git", ["push", "--tags"]);
|
|
1034
825
|
}
|
|
1035
826
|
return operation.update({ event: "git push" /* GitPush */ });
|
|
1036
827
|
}
|
|
@@ -1044,17 +835,17 @@ function formatVersionString(template, newVersion) {
|
|
|
1044
835
|
// src/normalize-options.ts
|
|
1045
836
|
import fsSync from "node:fs";
|
|
1046
837
|
import fs2 from "node:fs/promises";
|
|
1047
|
-
import
|
|
838
|
+
import process4 from "node:process";
|
|
1048
839
|
import yaml from "js-yaml";
|
|
1049
840
|
import { glob } from "tinyglobby";
|
|
1050
841
|
async function normalizeOptions(raw) {
|
|
1051
|
-
var
|
|
842
|
+
var _a2, _b2, _d2;
|
|
1052
843
|
const preid = typeof raw.preid === "string" ? raw.preid : "beta";
|
|
1053
844
|
const sign = Boolean(raw.sign);
|
|
1054
845
|
const push = Boolean(raw.push);
|
|
1055
846
|
const all = Boolean(raw.all);
|
|
1056
847
|
const noVerify = Boolean(raw.noVerify);
|
|
1057
|
-
const cwd = raw.cwd ||
|
|
848
|
+
const cwd = raw.cwd || process4.cwd();
|
|
1058
849
|
const ignoreScripts = Boolean(raw.ignoreScripts);
|
|
1059
850
|
const execute = raw.execute;
|
|
1060
851
|
const recursive = Boolean(raw.recursive);
|
|
@@ -1075,7 +866,7 @@ async function normalizeOptions(raw) {
|
|
|
1075
866
|
commit = { all, noVerify, message: raw.commit };
|
|
1076
867
|
else if (raw.commit || tag || push)
|
|
1077
868
|
commit = { all, noVerify, message: "chore: release v" };
|
|
1078
|
-
if (recursive && !((
|
|
869
|
+
if (recursive && !((_a2 = raw.files) == null ? void 0 : _a2.length)) {
|
|
1079
870
|
raw.files = [
|
|
1080
871
|
"package.json",
|
|
1081
872
|
"package-lock.json",
|
|
@@ -1090,13 +881,13 @@ async function normalizeOptions(raw) {
|
|
|
1090
881
|
const workspaces = yaml.load(pnpmWorkspace);
|
|
1091
882
|
const workspacesWithPackageJson = workspaces.packages.map((workspace) => `${workspace}/package.json`);
|
|
1092
883
|
const withoutExcludedWorkspaces = workspacesWithPackageJson.filter((workspace) => {
|
|
1093
|
-
var
|
|
1094
|
-
return !workspace.startsWith("!") && !((
|
|
884
|
+
var _a3;
|
|
885
|
+
return !workspace.startsWith("!") && !((_a3 = raw.files) == null ? void 0 : _a3.includes(workspace));
|
|
1095
886
|
});
|
|
1096
887
|
raw.files = raw.files.concat(withoutExcludedWorkspaces);
|
|
1097
888
|
}
|
|
1098
889
|
} else {
|
|
1099
|
-
raw.files = ((
|
|
890
|
+
raw.files = ((_b2 = raw.files) == null ? void 0 : _b2.length) ? raw.files : ["package.json", "package-lock.json", "jsr.json", "jsr.jsonc", "deno.json", "deno.jsonc"];
|
|
1100
891
|
}
|
|
1101
892
|
const files = await glob(
|
|
1102
893
|
raw.files,
|
|
@@ -1113,13 +904,13 @@ async function normalizeOptions(raw) {
|
|
|
1113
904
|
if (raw.interface === false) {
|
|
1114
905
|
ui = { input: false, output: false };
|
|
1115
906
|
} else if (raw.interface === true || !raw.interface) {
|
|
1116
|
-
ui = { input:
|
|
907
|
+
ui = { input: process4.stdin, output: process4.stdout };
|
|
1117
908
|
} else {
|
|
1118
|
-
let
|
|
909
|
+
let _c2 = raw.interface, { input, output } = _c2, other = __objRest(_c2, ["input", "output"]);
|
|
1119
910
|
if (input === true || input !== false && !input)
|
|
1120
|
-
input =
|
|
911
|
+
input = process4.stdin;
|
|
1121
912
|
if (output === true || output !== false && !output)
|
|
1122
|
-
output =
|
|
913
|
+
output = process4.stdout;
|
|
1123
914
|
ui = __spreadValues({ input, output }, other);
|
|
1124
915
|
}
|
|
1125
916
|
if (release.type === "prompt" && !(ui.input && ui.output))
|
|
@@ -1135,7 +926,7 @@ async function normalizeOptions(raw) {
|
|
|
1135
926
|
interface: ui,
|
|
1136
927
|
ignoreScripts,
|
|
1137
928
|
execute,
|
|
1138
|
-
printCommits: (
|
|
929
|
+
printCommits: (_d2 = raw.printCommits) != null ? _d2 : true,
|
|
1139
930
|
customVersion: raw.customVersion,
|
|
1140
931
|
currentVersion: raw.currentVersion
|
|
1141
932
|
};
|
|
@@ -1195,8 +986,8 @@ var Operation = class _Operation {
|
|
|
1195
986
|
/**
|
|
1196
987
|
* Updates the operation state and results, and reports the updated progress to the user.
|
|
1197
988
|
*/
|
|
1198
|
-
update(
|
|
1199
|
-
var
|
|
989
|
+
update(_a2) {
|
|
990
|
+
var _b2 = _a2, { event, script } = _b2, newState = __objRest(_b2, ["event", "script"]);
|
|
1200
991
|
Object.assign(this.state, newState);
|
|
1201
992
|
if (event && this._progress) {
|
|
1202
993
|
this._progress(__spreadValues({ event, script }, this.results));
|
|
@@ -1206,13 +997,15 @@ var Operation = class _Operation {
|
|
|
1206
997
|
};
|
|
1207
998
|
|
|
1208
999
|
// src/run-npm-script.ts
|
|
1209
|
-
import
|
|
1000
|
+
import { x as x3 } from "tinyexec";
|
|
1210
1001
|
async function runNpmScript(script, operation) {
|
|
1211
1002
|
const { cwd, ignoreScripts } = operation.options;
|
|
1212
1003
|
if (!ignoreScripts) {
|
|
1213
1004
|
const { data: manifest } = await readJsoncFile("package.json", cwd);
|
|
1214
1005
|
if (isManifest(manifest) && hasScript(manifest, script)) {
|
|
1215
|
-
await
|
|
1006
|
+
await x3("npm", ["run", script, "--silent"], {
|
|
1007
|
+
nodeOptions: { stdio: "inherit" }
|
|
1008
|
+
});
|
|
1216
1009
|
operation.update({ event: "npm script" /* NpmScript */, script });
|
|
1217
1010
|
}
|
|
1218
1011
|
}
|
|
@@ -1315,7 +1108,7 @@ async function versionBump(arg = {}) {
|
|
|
1315
1108
|
message: "Bump?",
|
|
1316
1109
|
initial: true
|
|
1317
1110
|
}).then((r) => r.yes)) {
|
|
1318
|
-
|
|
1111
|
+
process5.exit(1);
|
|
1319
1112
|
}
|
|
1320
1113
|
}
|
|
1321
1114
|
await runNpmScript("preversion" /* PreVersion */, operation);
|
|
@@ -1324,9 +1117,15 @@ async function versionBump(arg = {}) {
|
|
|
1324
1117
|
if (typeof operation.options.execute === "function") {
|
|
1325
1118
|
await operation.options.execute(operation);
|
|
1326
1119
|
} else {
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1120
|
+
const [command, ...args] = (0, import_parse.default)(operation.options.execute);
|
|
1121
|
+
console.log(symbols_exports.info, "Executing script", command, ...args);
|
|
1122
|
+
await x4(command, args, {
|
|
1123
|
+
nodeOptions: {
|
|
1124
|
+
stdio: "inherit",
|
|
1125
|
+
cwd: operation.options.cwd
|
|
1126
|
+
}
|
|
1127
|
+
});
|
|
1128
|
+
console.log(symbols_exports.success, "Script finished");
|
|
1330
1129
|
}
|
|
1331
1130
|
}
|
|
1332
1131
|
await runNpmScript("version" /* Version */, operation);
|
|
@@ -1363,7 +1162,7 @@ async function versionBumpInfo(arg = {}) {
|
|
|
1363
1162
|
|
|
1364
1163
|
// src/config.ts
|
|
1365
1164
|
import { dirname } from "node:path";
|
|
1366
|
-
import
|
|
1165
|
+
import process6 from "node:process";
|
|
1367
1166
|
import { loadConfig } from "c12";
|
|
1368
1167
|
import escalade from "escalade/sync";
|
|
1369
1168
|
var bumpConfigDefaults = {
|
|
@@ -1379,7 +1178,7 @@ var bumpConfigDefaults = {
|
|
|
1379
1178
|
noGitCheck: true,
|
|
1380
1179
|
files: []
|
|
1381
1180
|
};
|
|
1382
|
-
async function loadBumpConfig(overrides, cwd =
|
|
1181
|
+
async function loadBumpConfig(overrides, cwd = process6.cwd()) {
|
|
1383
1182
|
const name = "bump";
|
|
1384
1183
|
const configFile = findConfigFile(name, cwd);
|
|
1385
1184
|
const { config } = await loadConfig({
|
|
@@ -1409,10 +1208,10 @@ function findConfigFile(name, cwd) {
|
|
|
1409
1208
|
}
|
|
1410
1209
|
return false;
|
|
1411
1210
|
});
|
|
1412
|
-
} catch (
|
|
1211
|
+
} catch (error2) {
|
|
1413
1212
|
if (foundRepositoryRoot)
|
|
1414
1213
|
return null;
|
|
1415
|
-
throw
|
|
1214
|
+
throw error2;
|
|
1416
1215
|
}
|
|
1417
1216
|
}
|
|
1418
1217
|
function defineConfig(config) {
|
|
@@ -1424,7 +1223,7 @@ export {
|
|
|
1424
1223
|
__spreadProps,
|
|
1425
1224
|
__objRest,
|
|
1426
1225
|
__toESM,
|
|
1427
|
-
|
|
1226
|
+
symbols_exports,
|
|
1428
1227
|
require_picocolors,
|
|
1429
1228
|
isReleaseType,
|
|
1430
1229
|
ProgressEvent,
|