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
package/dist/cli/index.js
CHANGED
|
@@ -63,8 +63,8 @@ var require_picocolors = __commonJS({
|
|
|
63
63
|
"node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports2, module2) {
|
|
64
64
|
var p = process || {};
|
|
65
65
|
var argv = p.argv || [];
|
|
66
|
-
var
|
|
67
|
-
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);
|
|
68
68
|
var formatter = (open, close, replace = open) => (input) => {
|
|
69
69
|
let string = "" + input, index = string.indexOf(close, open.length);
|
|
70
70
|
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
@@ -130,533 +130,317 @@ var require_picocolors = __commonJS({
|
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
-
//
|
|
134
|
-
var
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
color: {
|
|
162
|
-
black: [30, 39],
|
|
163
|
-
red: [31, 39],
|
|
164
|
-
green: [32, 39],
|
|
165
|
-
yellow: [33, 39],
|
|
166
|
-
blue: [34, 39],
|
|
167
|
-
magenta: [35, 39],
|
|
168
|
-
cyan: [36, 39],
|
|
169
|
-
white: [37, 39],
|
|
170
|
-
// Bright color
|
|
171
|
-
blackBright: [90, 39],
|
|
172
|
-
gray: [90, 39],
|
|
173
|
-
// Alias of `blackBright`
|
|
174
|
-
grey: [90, 39],
|
|
175
|
-
// Alias of `blackBright`
|
|
176
|
-
redBright: [91, 39],
|
|
177
|
-
greenBright: [92, 39],
|
|
178
|
-
yellowBright: [93, 39],
|
|
179
|
-
blueBright: [94, 39],
|
|
180
|
-
magentaBright: [95, 39],
|
|
181
|
-
cyanBright: [96, 39],
|
|
182
|
-
whiteBright: [97, 39]
|
|
183
|
-
},
|
|
184
|
-
bgColor: {
|
|
185
|
-
bgBlack: [40, 49],
|
|
186
|
-
bgRed: [41, 49],
|
|
187
|
-
bgGreen: [42, 49],
|
|
188
|
-
bgYellow: [43, 49],
|
|
189
|
-
bgBlue: [44, 49],
|
|
190
|
-
bgMagenta: [45, 49],
|
|
191
|
-
bgCyan: [46, 49],
|
|
192
|
-
bgWhite: [47, 49],
|
|
193
|
-
// Bright color
|
|
194
|
-
bgBlackBright: [100, 49],
|
|
195
|
-
bgGray: [100, 49],
|
|
196
|
-
// Alias of `bgBlackBright`
|
|
197
|
-
bgGrey: [100, 49],
|
|
198
|
-
// Alias of `bgBlackBright`
|
|
199
|
-
bgRedBright: [101, 49],
|
|
200
|
-
bgGreenBright: [102, 49],
|
|
201
|
-
bgYellowBright: [103, 49],
|
|
202
|
-
bgBlueBright: [104, 49],
|
|
203
|
-
bgMagentaBright: [105, 49],
|
|
204
|
-
bgCyanBright: [106, 49],
|
|
205
|
-
bgWhiteBright: [107, 49]
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
var modifierNames = Object.keys(styles.modifier);
|
|
209
|
-
var foregroundColorNames = Object.keys(styles.color);
|
|
210
|
-
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
211
|
-
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
212
|
-
function assembleStyles() {
|
|
213
|
-
const codes = /* @__PURE__ */ new Map();
|
|
214
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
215
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
216
|
-
styles[styleName] = {
|
|
217
|
-
open: `\x1B[${style[0]}m`,
|
|
218
|
-
close: `\x1B[${style[1]}m`
|
|
219
|
-
};
|
|
220
|
-
group[styleName] = styles[styleName];
|
|
221
|
-
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"(exports2, module2) {
|
|
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);
|
|
222
161
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
styles.bgColor.close = "\x1B[49m";
|
|
234
|
-
styles.color.ansi = wrapAnsi16();
|
|
235
|
-
styles.color.ansi256 = wrapAnsi256();
|
|
236
|
-
styles.color.ansi16m = wrapAnsi16m();
|
|
237
|
-
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
238
|
-
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
239
|
-
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
240
|
-
Object.defineProperties(styles, {
|
|
241
|
-
rgbToAnsi256: {
|
|
242
|
-
value(red, green, blue) {
|
|
243
|
-
if (red === green && green === blue) {
|
|
244
|
-
if (red < 8) {
|
|
245
|
-
return 16;
|
|
246
|
-
}
|
|
247
|
-
if (red > 248) {
|
|
248
|
-
return 231;
|
|
249
|
-
}
|
|
250
|
-
return Math.round((red - 8) / 247 * 24) + 232;
|
|
251
|
-
}
|
|
252
|
-
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
253
|
-
},
|
|
254
|
-
enumerable: false
|
|
255
|
-
},
|
|
256
|
-
hexToRgb: {
|
|
257
|
-
value(hex) {
|
|
258
|
-
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
259
|
-
if (!matches) {
|
|
260
|
-
return [0, 0, 0];
|
|
261
|
-
}
|
|
262
|
-
let [colorString] = matches;
|
|
263
|
-
if (colorString.length === 3) {
|
|
264
|
-
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;
|
|
265
172
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
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;
|
|
285
212
|
}
|
|
286
|
-
if (
|
|
287
|
-
return
|
|
213
|
+
if (controlRE.test(s)) {
|
|
214
|
+
return { op: s };
|
|
288
215
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
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);
|
|
302
252
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
253
|
+
for (i2 = 0; i2 < s.length; i2++) {
|
|
254
|
+
var c5 = s.charAt(i2);
|
|
255
|
+
isGlob = isGlob || !quote && (c5 === "*" || c5 === "?");
|
|
256
|
+
if (esc) {
|
|
257
|
+
out += c5;
|
|
258
|
+
esc = false;
|
|
259
|
+
} else if (quote) {
|
|
260
|
+
if (c5 === quote) {
|
|
261
|
+
quote = false;
|
|
262
|
+
} else if (quote == SQ) {
|
|
263
|
+
out += c5;
|
|
264
|
+
} else {
|
|
265
|
+
if (c5 === BS) {
|
|
266
|
+
i2 += 1;
|
|
267
|
+
c5 = s.charAt(i2);
|
|
268
|
+
if (c5 === DQ || c5 === BS || c5 === DS) {
|
|
269
|
+
out += c5;
|
|
270
|
+
} else {
|
|
271
|
+
out += BS + c5;
|
|
272
|
+
}
|
|
273
|
+
} else if (c5 === DS) {
|
|
274
|
+
out += parseEnvVar();
|
|
275
|
+
} else {
|
|
276
|
+
out += c5;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
} else if (c5 === DQ || c5 === SQ) {
|
|
280
|
+
quote = c5;
|
|
281
|
+
} else if (controlRE.test(c5)) {
|
|
282
|
+
return { op: s };
|
|
283
|
+
} else if (hash.test(c5)) {
|
|
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 (c5 === BS) {
|
|
291
|
+
esc = true;
|
|
292
|
+
} else if (c5 === DS) {
|
|
293
|
+
out += parseEnvVar();
|
|
294
|
+
} else {
|
|
295
|
+
out += c5;
|
|
296
|
+
}
|
|
306
297
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
result += 60;
|
|
298
|
+
if (isGlob) {
|
|
299
|
+
return { op: "glob", pattern: out };
|
|
310
300
|
}
|
|
311
|
-
return
|
|
312
|
-
},
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
rgbToAnsi: {
|
|
316
|
-
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
317
|
-
enumerable: false
|
|
318
|
-
},
|
|
319
|
-
hexToAnsi: {
|
|
320
|
-
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
321
|
-
enumerable: false
|
|
301
|
+
return out;
|
|
302
|
+
}).reduce(function(prev, arg) {
|
|
303
|
+
return typeof arg === "undefined" ? prev : prev.concat(arg);
|
|
304
|
+
}, []);
|
|
322
305
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
var ansi_styles_default = ansiStyles;
|
|
328
|
-
|
|
329
|
-
// node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js
|
|
330
|
-
var import_node_process = __toESM(require("process"), 1);
|
|
331
|
-
var import_node_os = __toESM(require("os"), 1);
|
|
332
|
-
var import_node_tty = __toESM(require("tty"), 1);
|
|
333
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
|
|
334
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
335
|
-
const position = argv.indexOf(prefix + flag);
|
|
336
|
-
const terminatorPosition = argv.indexOf("--");
|
|
337
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
338
|
-
}
|
|
339
|
-
var { env } = import_node_process.default;
|
|
340
|
-
var flagForceColor;
|
|
341
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
342
|
-
flagForceColor = 0;
|
|
343
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
344
|
-
flagForceColor = 1;
|
|
345
|
-
}
|
|
346
|
-
function envForceColor() {
|
|
347
|
-
if ("FORCE_COLOR" in env) {
|
|
348
|
-
if (env.FORCE_COLOR === "true") {
|
|
349
|
-
return 1;
|
|
350
|
-
}
|
|
351
|
-
if (env.FORCE_COLOR === "false") {
|
|
352
|
-
return 0;
|
|
353
|
-
}
|
|
354
|
-
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
function translateLevel(level) {
|
|
358
|
-
if (level === 0) {
|
|
359
|
-
return false;
|
|
360
|
-
}
|
|
361
|
-
return {
|
|
362
|
-
level,
|
|
363
|
-
hasBasic: true,
|
|
364
|
-
has256: level >= 2,
|
|
365
|
-
has16m: level >= 3
|
|
366
|
-
};
|
|
367
|
-
}
|
|
368
|
-
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
369
|
-
const noFlagForceColor = envForceColor();
|
|
370
|
-
if (noFlagForceColor !== void 0) {
|
|
371
|
-
flagForceColor = noFlagForceColor;
|
|
372
|
-
}
|
|
373
|
-
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
374
|
-
if (forceColor === 0) {
|
|
375
|
-
return 0;
|
|
376
|
-
}
|
|
377
|
-
if (sniffFlags) {
|
|
378
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
379
|
-
return 3;
|
|
380
|
-
}
|
|
381
|
-
if (hasFlag("color=256")) {
|
|
382
|
-
return 2;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
386
|
-
return 1;
|
|
387
|
-
}
|
|
388
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
389
|
-
return 0;
|
|
390
|
-
}
|
|
391
|
-
const min = forceColor || 0;
|
|
392
|
-
if (env.TERM === "dumb") {
|
|
393
|
-
return min;
|
|
394
|
-
}
|
|
395
|
-
if (import_node_process.default.platform === "win32") {
|
|
396
|
-
const osRelease = import_node_os.default.release().split(".");
|
|
397
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
398
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
399
|
-
}
|
|
400
|
-
return 1;
|
|
401
|
-
}
|
|
402
|
-
if ("CI" in env) {
|
|
403
|
-
if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
|
|
404
|
-
return 3;
|
|
405
|
-
}
|
|
406
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
407
|
-
return 1;
|
|
408
|
-
}
|
|
409
|
-
return min;
|
|
410
|
-
}
|
|
411
|
-
if ("TEAMCITY_VERSION" in env) {
|
|
412
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
413
|
-
}
|
|
414
|
-
if (env.COLORTERM === "truecolor") {
|
|
415
|
-
return 3;
|
|
416
|
-
}
|
|
417
|
-
if (env.TERM === "xterm-kitty") {
|
|
418
|
-
return 3;
|
|
419
|
-
}
|
|
420
|
-
if ("TERM_PROGRAM" in env) {
|
|
421
|
-
const version2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
422
|
-
switch (env.TERM_PROGRAM) {
|
|
423
|
-
case "iTerm.app": {
|
|
424
|
-
return version2 >= 3 ? 3 : 2;
|
|
425
|
-
}
|
|
426
|
-
case "Apple_Terminal": {
|
|
427
|
-
return 2;
|
|
306
|
+
module2.exports = function parse2(s, env, opts) {
|
|
307
|
+
var mapped = parseInternal(s, env, opts);
|
|
308
|
+
if (typeof env !== "function") {
|
|
309
|
+
return mapped;
|
|
428
310
|
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
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(x6) {
|
|
320
|
+
if (startsWithToken.test(x6)) {
|
|
321
|
+
return JSON.parse(x6.split(TOKEN)[1]);
|
|
322
|
+
}
|
|
323
|
+
return x6;
|
|
324
|
+
}));
|
|
325
|
+
}, []);
|
|
326
|
+
};
|
|
439
327
|
}
|
|
440
|
-
|
|
441
|
-
}
|
|
442
|
-
function createSupportsColor(stream, options = {}) {
|
|
443
|
-
const level = _supportsColor(stream, __spreadValues({
|
|
444
|
-
streamIsTTY: stream && stream.isTTY
|
|
445
|
-
}, options));
|
|
446
|
-
return translateLevel(level);
|
|
447
|
-
}
|
|
448
|
-
var supportsColor = {
|
|
449
|
-
stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }),
|
|
450
|
-
stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) })
|
|
451
|
-
};
|
|
452
|
-
var supports_color_default = supportsColor;
|
|
328
|
+
});
|
|
453
329
|
|
|
454
|
-
//
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
let returnValue = "";
|
|
463
|
-
do {
|
|
464
|
-
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
465
|
-
endIndex = index + substringLength;
|
|
466
|
-
index = string.indexOf(substring, endIndex);
|
|
467
|
-
} while (index !== -1);
|
|
468
|
-
returnValue += string.slice(endIndex);
|
|
469
|
-
return returnValue;
|
|
470
|
-
}
|
|
471
|
-
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
472
|
-
let endIndex = 0;
|
|
473
|
-
let returnValue = "";
|
|
474
|
-
do {
|
|
475
|
-
const gotCR = string[index - 1] === "\r";
|
|
476
|
-
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
477
|
-
endIndex = index + 1;
|
|
478
|
-
index = string.indexOf("\n", endIndex);
|
|
479
|
-
} while (index !== -1);
|
|
480
|
-
returnValue += string.slice(endIndex);
|
|
481
|
-
return returnValue;
|
|
482
|
-
}
|
|
330
|
+
// src/cli/index.ts
|
|
331
|
+
var cli_exports = {};
|
|
332
|
+
__export(cli_exports, {
|
|
333
|
+
checkGitStatus: () => checkGitStatus,
|
|
334
|
+
main: () => main
|
|
335
|
+
});
|
|
336
|
+
module.exports = __toCommonJS(cli_exports);
|
|
337
|
+
var import_node_process7 = __toESM(require("process"));
|
|
483
338
|
|
|
484
|
-
// node_modules/.pnpm/
|
|
485
|
-
var
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
var
|
|
496
|
-
var
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
};
|
|
509
|
-
function createChalk(options) {
|
|
510
|
-
return chalkFactory(options);
|
|
511
|
-
}
|
|
512
|
-
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
513
|
-
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
514
|
-
styles2[styleName] = {
|
|
515
|
-
get() {
|
|
516
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
517
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
518
|
-
return builder;
|
|
519
|
-
}
|
|
520
|
-
};
|
|
521
|
-
}
|
|
522
|
-
styles2.visible = {
|
|
523
|
-
get() {
|
|
524
|
-
const builder = createBuilder(this, this[STYLER], true);
|
|
525
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
526
|
-
return builder;
|
|
527
|
-
}
|
|
528
|
-
};
|
|
529
|
-
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
530
|
-
if (model === "rgb") {
|
|
531
|
-
if (level === "ansi16m") {
|
|
532
|
-
return ansi_styles_default[type].ansi16m(...arguments_);
|
|
533
|
-
}
|
|
534
|
-
if (level === "ansi256") {
|
|
535
|
-
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
536
|
-
}
|
|
537
|
-
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
538
|
-
}
|
|
539
|
-
if (model === "hex") {
|
|
540
|
-
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
541
|
-
}
|
|
542
|
-
return ansi_styles_default[type][model](...arguments_);
|
|
543
|
-
};
|
|
544
|
-
var usedModels = ["rgb", "hex", "ansi256"];
|
|
545
|
-
for (const model of usedModels) {
|
|
546
|
-
styles2[model] = {
|
|
547
|
-
get() {
|
|
548
|
-
const { level } = this;
|
|
549
|
-
return function(...arguments_) {
|
|
550
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
551
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
552
|
-
};
|
|
553
|
-
}
|
|
554
|
-
};
|
|
555
|
-
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
556
|
-
styles2[bgModel] = {
|
|
557
|
-
get() {
|
|
558
|
-
const { level } = this;
|
|
559
|
-
return function(...arguments_) {
|
|
560
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
561
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
562
|
-
};
|
|
339
|
+
// node_modules/.pnpm/log-symbols@7.0.0/node_modules/log-symbols/symbols.js
|
|
340
|
+
var symbols_exports = {};
|
|
341
|
+
__export(symbols_exports, {
|
|
342
|
+
error: () => error,
|
|
343
|
+
info: () => info,
|
|
344
|
+
success: () => success,
|
|
345
|
+
warning: () => warning
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
// node_modules/.pnpm/yoctocolors@2.1.1/node_modules/yoctocolors/base.js
|
|
349
|
+
var import_node_tty = __toESM(require("tty"), 1);
|
|
350
|
+
var _a, _b, _c, _d, _e;
|
|
351
|
+
var hasColors = (_e = (_d = (_c = (_b = (_a = import_node_tty.default) == null ? void 0 : _a.WriteStream) == null ? void 0 : _b.prototype) == null ? void 0 : _c.hasColors) == null ? void 0 : _d.call(_c)) != null ? _e : false;
|
|
352
|
+
var format = (open, close) => {
|
|
353
|
+
if (!hasColors) {
|
|
354
|
+
return (input) => input;
|
|
355
|
+
}
|
|
356
|
+
const openCode = `\x1B[${open}m`;
|
|
357
|
+
const closeCode = `\x1B[${close}m`;
|
|
358
|
+
return (input) => {
|
|
359
|
+
const string = input + "";
|
|
360
|
+
let index = string.indexOf(closeCode);
|
|
361
|
+
if (index === -1) {
|
|
362
|
+
return openCode + string + closeCode;
|
|
563
363
|
}
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
get() {
|
|
571
|
-
return this[GENERATOR].level;
|
|
572
|
-
},
|
|
573
|
-
set(level) {
|
|
574
|
-
this[GENERATOR].level = level;
|
|
364
|
+
let result = openCode;
|
|
365
|
+
let lastIndex = 0;
|
|
366
|
+
while (index !== -1) {
|
|
367
|
+
result += string.slice(lastIndex, index) + openCode;
|
|
368
|
+
lastIndex = index + closeCode.length;
|
|
369
|
+
index = string.indexOf(closeCode, lastIndex);
|
|
575
370
|
}
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
var createStyler = (open, close, parent) => {
|
|
579
|
-
let openAll;
|
|
580
|
-
let closeAll;
|
|
581
|
-
if (parent === void 0) {
|
|
582
|
-
openAll = open;
|
|
583
|
-
closeAll = close;
|
|
584
|
-
} else {
|
|
585
|
-
openAll = parent.openAll + open;
|
|
586
|
-
closeAll = close + parent.closeAll;
|
|
587
|
-
}
|
|
588
|
-
return {
|
|
589
|
-
open,
|
|
590
|
-
close,
|
|
591
|
-
openAll,
|
|
592
|
-
closeAll,
|
|
593
|
-
parent
|
|
371
|
+
result += string.slice(lastIndex) + closeCode;
|
|
372
|
+
return result;
|
|
594
373
|
};
|
|
595
374
|
};
|
|
596
|
-
var
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
var
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
var
|
|
627
|
-
var
|
|
628
|
-
var
|
|
375
|
+
var reset = format(0, 0);
|
|
376
|
+
var bold = format(1, 22);
|
|
377
|
+
var dim = format(2, 22);
|
|
378
|
+
var italic = format(3, 23);
|
|
379
|
+
var underline = format(4, 24);
|
|
380
|
+
var overline = format(53, 55);
|
|
381
|
+
var inverse = format(7, 27);
|
|
382
|
+
var hidden = format(8, 28);
|
|
383
|
+
var strikethrough = format(9, 29);
|
|
384
|
+
var black = format(30, 39);
|
|
385
|
+
var red = format(31, 39);
|
|
386
|
+
var green = format(32, 39);
|
|
387
|
+
var yellow = format(33, 39);
|
|
388
|
+
var blue = format(34, 39);
|
|
389
|
+
var magenta = format(35, 39);
|
|
390
|
+
var cyan = format(36, 39);
|
|
391
|
+
var white = format(37, 39);
|
|
392
|
+
var gray = format(90, 39);
|
|
393
|
+
var bgBlack = format(40, 49);
|
|
394
|
+
var bgRed = format(41, 49);
|
|
395
|
+
var bgGreen = format(42, 49);
|
|
396
|
+
var bgYellow = format(43, 49);
|
|
397
|
+
var bgBlue = format(44, 49);
|
|
398
|
+
var bgMagenta = format(45, 49);
|
|
399
|
+
var bgCyan = format(46, 49);
|
|
400
|
+
var bgWhite = format(47, 49);
|
|
401
|
+
var bgGray = format(100, 49);
|
|
402
|
+
var redBright = format(91, 39);
|
|
403
|
+
var greenBright = format(92, 39);
|
|
404
|
+
var yellowBright = format(93, 39);
|
|
405
|
+
var blueBright = format(94, 39);
|
|
406
|
+
var magentaBright = format(95, 39);
|
|
407
|
+
var cyanBright = format(96, 39);
|
|
408
|
+
var whiteBright = format(97, 39);
|
|
409
|
+
var bgRedBright = format(101, 49);
|
|
410
|
+
var bgGreenBright = format(102, 49);
|
|
411
|
+
var bgYellowBright = format(103, 49);
|
|
412
|
+
var bgBlueBright = format(104, 49);
|
|
413
|
+
var bgMagentaBright = format(105, 49);
|
|
414
|
+
var bgCyanBright = format(106, 49);
|
|
415
|
+
var bgWhiteBright = format(107, 49);
|
|
629
416
|
|
|
630
|
-
// node_modules/.pnpm/is-unicode-supported@1.
|
|
631
|
-
var
|
|
417
|
+
// node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
|
|
418
|
+
var import_node_process = __toESM(require("process"), 1);
|
|
632
419
|
function isUnicodeSupported() {
|
|
633
|
-
|
|
634
|
-
|
|
420
|
+
const { env } = import_node_process.default;
|
|
421
|
+
const { TERM, TERM_PROGRAM } = env;
|
|
422
|
+
if (import_node_process.default.platform !== "win32") {
|
|
423
|
+
return TERM !== "linux";
|
|
635
424
|
}
|
|
636
|
-
return Boolean(
|
|
425
|
+
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";
|
|
637
426
|
}
|
|
638
427
|
|
|
639
|
-
// node_modules/.pnpm/log-symbols@
|
|
640
|
-
var
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
success: source_default.green("\u221A"),
|
|
649
|
-
warning: source_default.yellow("\u203C"),
|
|
650
|
-
error: source_default.red("\xD7")
|
|
651
|
-
};
|
|
652
|
-
var logSymbols = isUnicodeSupported() ? main : fallback;
|
|
653
|
-
var log_symbols_default = logSymbols;
|
|
428
|
+
// node_modules/.pnpm/log-symbols@7.0.0/node_modules/log-symbols/symbols.js
|
|
429
|
+
var _isUnicodeSupported = isUnicodeSupported();
|
|
430
|
+
var info = blue(_isUnicodeSupported ? "\u2139" : "i");
|
|
431
|
+
var success = green(_isUnicodeSupported ? "\u2714" : "\u221A");
|
|
432
|
+
var warning = yellow(_isUnicodeSupported ? "\u26A0" : "\u203C");
|
|
433
|
+
var error = red(_isUnicodeSupported ? "\u2716\uFE0F" : "\xD7");
|
|
434
|
+
|
|
435
|
+
// src/cli/index.ts
|
|
436
|
+
var import_tinyexec5 = require("tinyexec");
|
|
654
437
|
|
|
655
438
|
// src/version-bump.ts
|
|
656
|
-
var
|
|
657
|
-
var ezSpawn4 = __toESM(require("@jsdevtools/ez-spawn"));
|
|
439
|
+
var import_node_process4 = __toESM(require("process"));
|
|
658
440
|
var import_picocolors3 = __toESM(require_picocolors());
|
|
659
441
|
var import_prompts2 = __toESM(require("prompts"));
|
|
442
|
+
var import_parse = __toESM(require_parse());
|
|
443
|
+
var import_tinyexec4 = require("tinyexec");
|
|
660
444
|
|
|
661
445
|
// src/get-current-version.ts
|
|
662
446
|
var import_semver = require("semver");
|
|
@@ -710,8 +494,8 @@ function isManifest(obj) {
|
|
|
710
494
|
return obj && typeof obj === "object" && isOptionalString(obj.name) && isOptionalString(obj.version) && isOptionalString(obj.description);
|
|
711
495
|
}
|
|
712
496
|
function isPackageLockManifest(manifest) {
|
|
713
|
-
var
|
|
714
|
-
return typeof ((
|
|
497
|
+
var _a2, _b2;
|
|
498
|
+
return typeof ((_b2 = (_a2 = manifest.packages) == null ? void 0 : _a2[""]) == null ? void 0 : _b2.version) === "string";
|
|
715
499
|
}
|
|
716
500
|
function isOptionalString(value) {
|
|
717
501
|
const type = typeof value;
|
|
@@ -756,14 +540,14 @@ async function readVersion(file, cwd) {
|
|
|
756
540
|
}
|
|
757
541
|
|
|
758
542
|
// src/get-new-version.ts
|
|
759
|
-
var
|
|
543
|
+
var import_node_process2 = __toESM(require("process"));
|
|
760
544
|
var import_picocolors2 = __toESM(require_picocolors());
|
|
761
545
|
var import_prompts = __toESM(require("prompts"));
|
|
762
546
|
var import_semver2 = __toESM(require("semver"));
|
|
763
547
|
|
|
764
548
|
// src/print-commits.ts
|
|
765
|
-
var ezSpawn = __toESM(require("@jsdevtools/ez-spawn"));
|
|
766
549
|
var import_picocolors = __toESM(require_picocolors());
|
|
550
|
+
var import_tinyexec = require("tinyexec");
|
|
767
551
|
var messageColorMap = {
|
|
768
552
|
chore: import_picocolors.default.gray,
|
|
769
553
|
fix: import_picocolors.default.yellow,
|
|
@@ -782,20 +566,21 @@ function parseCommits(raw) {
|
|
|
782
566
|
return lines.map((line) => {
|
|
783
567
|
const [hash, ...parts] = line.split(" ");
|
|
784
568
|
const message = parts.join(" ");
|
|
785
|
-
const match = message.match(/^(\w+)(!)?(\([^)]+\))?:(.*)$/);
|
|
569
|
+
const match = message.match(/^(\w+)(!)?(\([^)]+\))?(!)?:(.*)$/);
|
|
786
570
|
if (match) {
|
|
787
571
|
let color = messageColorMap[match[1].toLowerCase()] || ((c5) => c5);
|
|
788
|
-
|
|
572
|
+
const breaking = match[2] === "!" || match[4] === "!";
|
|
573
|
+
if (breaking) {
|
|
789
574
|
color = (s) => import_picocolors.default.inverse(import_picocolors.default.red(s));
|
|
790
575
|
}
|
|
791
|
-
const tag = [match[1], match[2]].filter(Boolean).join("");
|
|
576
|
+
const tag = [match[1], match[2], match[4]].filter(Boolean).join("");
|
|
792
577
|
const scope = match[3] || "";
|
|
793
578
|
return {
|
|
794
579
|
hash,
|
|
795
580
|
tag,
|
|
796
|
-
message: match[
|
|
581
|
+
message: match[5].trim(),
|
|
797
582
|
scope,
|
|
798
|
-
breaking
|
|
583
|
+
breaking,
|
|
799
584
|
color
|
|
800
585
|
};
|
|
801
586
|
}
|
|
@@ -830,23 +615,23 @@ function formatParsedCommits(commits) {
|
|
|
830
615
|
}
|
|
831
616
|
async function printRecentCommits(operation) {
|
|
832
617
|
let sha;
|
|
833
|
-
sha || (sha = await
|
|
618
|
+
sha || (sha = await (0, import_tinyexec.x)(
|
|
834
619
|
"git",
|
|
835
620
|
["rev-list", "-n", "1", `v${operation.state.currentVersion}`],
|
|
836
|
-
{ stdio: "pipe" }
|
|
837
|
-
).then((res) => res.stdout.trim())
|
|
838
|
-
sha || (sha = await
|
|
621
|
+
{ nodeOptions: { stdio: "pipe" }, throwOnError: false }
|
|
622
|
+
).then((res) => res.stdout.trim()));
|
|
623
|
+
sha || (sha = await (0, import_tinyexec.x)(
|
|
839
624
|
"git",
|
|
840
625
|
["rev-list", "-n", "1", operation.state.currentVersion],
|
|
841
|
-
{ stdio: "pipe" }
|
|
842
|
-
).then((res) => res.stdout.trim())
|
|
626
|
+
{ nodeOptions: { stdio: "pipe" }, throwOnError: false }
|
|
627
|
+
).then((res) => res.stdout.trim()));
|
|
843
628
|
if (!sha) {
|
|
844
629
|
console.log(
|
|
845
630
|
import_picocolors.default.blue(`i`) + import_picocolors.default.gray(` Failed to locate the previous tag ${import_picocolors.default.yellow(`v${operation.state.currentVersion}`)}`)
|
|
846
631
|
);
|
|
847
632
|
return;
|
|
848
633
|
}
|
|
849
|
-
const { stdout } = await
|
|
634
|
+
const { stdout } = await (0, import_tinyexec.x)(
|
|
850
635
|
"git",
|
|
851
636
|
[
|
|
852
637
|
"--no-pager",
|
|
@@ -854,7 +639,11 @@ async function printRecentCommits(operation) {
|
|
|
854
639
|
`${sha}..HEAD`,
|
|
855
640
|
"--oneline"
|
|
856
641
|
],
|
|
857
|
-
{
|
|
642
|
+
{
|
|
643
|
+
nodeOptions: {
|
|
644
|
+
stdio: "pipe"
|
|
645
|
+
}
|
|
646
|
+
}
|
|
858
647
|
);
|
|
859
648
|
const parsed = parseCommits(stdout.toString().trim());
|
|
860
649
|
const prettified = formatParsedCommits(parsed);
|
|
@@ -923,11 +712,11 @@ function getNextVersions(currentVersion, preid) {
|
|
|
923
712
|
return next;
|
|
924
713
|
}
|
|
925
714
|
async function promptForNewVersion(operation) {
|
|
926
|
-
var
|
|
715
|
+
var _a2, _b2;
|
|
927
716
|
const { currentVersion } = operation.state;
|
|
928
717
|
const release = operation.options.release;
|
|
929
718
|
const next = getNextVersions(currentVersion, release.preid);
|
|
930
|
-
const configCustomVersion = await ((
|
|
719
|
+
const configCustomVersion = await ((_b2 = (_a2 = operation.options).customVersion) == null ? void 0 : _b2.call(_a2, currentVersion, import_semver2.default));
|
|
931
720
|
if (operation.options.printCommits) {
|
|
932
721
|
await printRecentCommits(operation);
|
|
933
722
|
}
|
|
@@ -965,7 +754,7 @@ async function promptForNewVersion(operation) {
|
|
|
965
754
|
]);
|
|
966
755
|
const newVersion = answers.release === "none" ? currentVersion : answers.release === "custom" ? (0, import_semver2.clean)(answers.custom) : answers.release === "config" ? (0, import_semver2.clean)(configCustomVersion) : next[answers.release];
|
|
967
756
|
if (!newVersion)
|
|
968
|
-
|
|
757
|
+
import_node_process2.default.exit(1);
|
|
969
758
|
switch (answers.release) {
|
|
970
759
|
case "custom":
|
|
971
760
|
case "config":
|
|
@@ -978,7 +767,7 @@ async function promptForNewVersion(operation) {
|
|
|
978
767
|
}
|
|
979
768
|
|
|
980
769
|
// src/git.ts
|
|
981
|
-
var
|
|
770
|
+
var import_tinyexec2 = require("tinyexec");
|
|
982
771
|
async function gitCommit(operation) {
|
|
983
772
|
if (!operation.options.commit)
|
|
984
773
|
return operation;
|
|
@@ -998,7 +787,7 @@ async function gitCommit(operation) {
|
|
|
998
787
|
args.push("--message", commitMessage);
|
|
999
788
|
if (!all)
|
|
1000
789
|
args = args.concat(updatedFiles);
|
|
1001
|
-
await
|
|
790
|
+
await (0, import_tinyexec2.x)("git", ["commit", ...args]);
|
|
1002
791
|
return operation.update({ event: "git commit" /* GitCommit */, commitMessage });
|
|
1003
792
|
}
|
|
1004
793
|
async function gitTag(operation) {
|
|
@@ -1019,15 +808,15 @@ async function gitTag(operation) {
|
|
|
1019
808
|
if (operation.options.sign) {
|
|
1020
809
|
args.push("--sign");
|
|
1021
810
|
}
|
|
1022
|
-
await
|
|
811
|
+
await (0, import_tinyexec2.x)("git", ["tag", ...args]);
|
|
1023
812
|
return operation.update({ event: "git tag" /* GitTag */, tagName });
|
|
1024
813
|
}
|
|
1025
814
|
async function gitPush(operation) {
|
|
1026
815
|
if (!operation.options.push)
|
|
1027
816
|
return operation;
|
|
1028
|
-
await
|
|
817
|
+
await (0, import_tinyexec2.x)("git", ["push"]);
|
|
1029
818
|
if (operation.options.tag) {
|
|
1030
|
-
await
|
|
819
|
+
await (0, import_tinyexec2.x)("git", ["push", "--tags"]);
|
|
1031
820
|
}
|
|
1032
821
|
return operation.update({ event: "git push" /* GitPush */ });
|
|
1033
822
|
}
|
|
@@ -1041,17 +830,17 @@ function formatVersionString(template, newVersion) {
|
|
|
1041
830
|
// src/normalize-options.ts
|
|
1042
831
|
var import_node_fs2 = __toESM(require("fs"));
|
|
1043
832
|
var import_promises = __toESM(require("fs/promises"));
|
|
1044
|
-
var
|
|
833
|
+
var import_node_process3 = __toESM(require("process"));
|
|
1045
834
|
var import_js_yaml = __toESM(require("js-yaml"));
|
|
1046
835
|
var import_tinyglobby = require("tinyglobby");
|
|
1047
836
|
async function normalizeOptions(raw) {
|
|
1048
|
-
var
|
|
837
|
+
var _a2, _b2, _d2;
|
|
1049
838
|
const preid = typeof raw.preid === "string" ? raw.preid : "beta";
|
|
1050
839
|
const sign = Boolean(raw.sign);
|
|
1051
840
|
const push = Boolean(raw.push);
|
|
1052
841
|
const all = Boolean(raw.all);
|
|
1053
842
|
const noVerify = Boolean(raw.noVerify);
|
|
1054
|
-
const cwd = raw.cwd ||
|
|
843
|
+
const cwd = raw.cwd || import_node_process3.default.cwd();
|
|
1055
844
|
const ignoreScripts = Boolean(raw.ignoreScripts);
|
|
1056
845
|
const execute = raw.execute;
|
|
1057
846
|
const recursive = Boolean(raw.recursive);
|
|
@@ -1072,7 +861,7 @@ async function normalizeOptions(raw) {
|
|
|
1072
861
|
commit = { all, noVerify, message: raw.commit };
|
|
1073
862
|
else if (raw.commit || tag || push)
|
|
1074
863
|
commit = { all, noVerify, message: "chore: release v" };
|
|
1075
|
-
if (recursive && !((
|
|
864
|
+
if (recursive && !((_a2 = raw.files) == null ? void 0 : _a2.length)) {
|
|
1076
865
|
raw.files = [
|
|
1077
866
|
"package.json",
|
|
1078
867
|
"package-lock.json",
|
|
@@ -1087,13 +876,13 @@ async function normalizeOptions(raw) {
|
|
|
1087
876
|
const workspaces = import_js_yaml.default.load(pnpmWorkspace);
|
|
1088
877
|
const workspacesWithPackageJson = workspaces.packages.map((workspace) => `${workspace}/package.json`);
|
|
1089
878
|
const withoutExcludedWorkspaces = workspacesWithPackageJson.filter((workspace) => {
|
|
1090
|
-
var
|
|
1091
|
-
return !workspace.startsWith("!") && !((
|
|
879
|
+
var _a3;
|
|
880
|
+
return !workspace.startsWith("!") && !((_a3 = raw.files) == null ? void 0 : _a3.includes(workspace));
|
|
1092
881
|
});
|
|
1093
882
|
raw.files = raw.files.concat(withoutExcludedWorkspaces);
|
|
1094
883
|
}
|
|
1095
884
|
} else {
|
|
1096
|
-
raw.files = ((
|
|
885
|
+
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"];
|
|
1097
886
|
}
|
|
1098
887
|
const files = await (0, import_tinyglobby.glob)(
|
|
1099
888
|
raw.files,
|
|
@@ -1110,13 +899,13 @@ async function normalizeOptions(raw) {
|
|
|
1110
899
|
if (raw.interface === false) {
|
|
1111
900
|
ui = { input: false, output: false };
|
|
1112
901
|
} else if (raw.interface === true || !raw.interface) {
|
|
1113
|
-
ui = { input:
|
|
902
|
+
ui = { input: import_node_process3.default.stdin, output: import_node_process3.default.stdout };
|
|
1114
903
|
} else {
|
|
1115
|
-
let
|
|
904
|
+
let _c2 = raw.interface, { input, output } = _c2, other = __objRest(_c2, ["input", "output"]);
|
|
1116
905
|
if (input === true || input !== false && !input)
|
|
1117
|
-
input =
|
|
906
|
+
input = import_node_process3.default.stdin;
|
|
1118
907
|
if (output === true || output !== false && !output)
|
|
1119
|
-
output =
|
|
908
|
+
output = import_node_process3.default.stdout;
|
|
1120
909
|
ui = __spreadValues({ input, output }, other);
|
|
1121
910
|
}
|
|
1122
911
|
if (release.type === "prompt" && !(ui.input && ui.output))
|
|
@@ -1132,7 +921,7 @@ async function normalizeOptions(raw) {
|
|
|
1132
921
|
interface: ui,
|
|
1133
922
|
ignoreScripts,
|
|
1134
923
|
execute,
|
|
1135
|
-
printCommits: (
|
|
924
|
+
printCommits: (_d2 = raw.printCommits) != null ? _d2 : true,
|
|
1136
925
|
customVersion: raw.customVersion,
|
|
1137
926
|
currentVersion: raw.currentVersion
|
|
1138
927
|
};
|
|
@@ -1192,8 +981,8 @@ var Operation = class _Operation {
|
|
|
1192
981
|
/**
|
|
1193
982
|
* Updates the operation state and results, and reports the updated progress to the user.
|
|
1194
983
|
*/
|
|
1195
|
-
update(
|
|
1196
|
-
var
|
|
984
|
+
update(_a2) {
|
|
985
|
+
var _b2 = _a2, { event, script } = _b2, newState = __objRest(_b2, ["event", "script"]);
|
|
1197
986
|
Object.assign(this.state, newState);
|
|
1198
987
|
if (event && this._progress) {
|
|
1199
988
|
this._progress(__spreadValues({ event, script }, this.results));
|
|
@@ -1203,13 +992,15 @@ var Operation = class _Operation {
|
|
|
1203
992
|
};
|
|
1204
993
|
|
|
1205
994
|
// src/run-npm-script.ts
|
|
1206
|
-
var
|
|
995
|
+
var import_tinyexec3 = require("tinyexec");
|
|
1207
996
|
async function runNpmScript(script, operation) {
|
|
1208
997
|
const { cwd, ignoreScripts } = operation.options;
|
|
1209
998
|
if (!ignoreScripts) {
|
|
1210
999
|
const { data: manifest } = await readJsoncFile("package.json", cwd);
|
|
1211
1000
|
if (isManifest(manifest) && hasScript(manifest, script)) {
|
|
1212
|
-
await
|
|
1001
|
+
await (0, import_tinyexec3.x)("npm", ["run", script, "--silent"], {
|
|
1002
|
+
nodeOptions: { stdio: "inherit" }
|
|
1003
|
+
});
|
|
1213
1004
|
operation.update({ event: "npm script" /* NpmScript */, script });
|
|
1214
1005
|
}
|
|
1215
1006
|
}
|
|
@@ -1312,7 +1103,7 @@ async function versionBump(arg = {}) {
|
|
|
1312
1103
|
message: "Bump?",
|
|
1313
1104
|
initial: true
|
|
1314
1105
|
}).then((r) => r.yes)) {
|
|
1315
|
-
|
|
1106
|
+
import_node_process4.default.exit(1);
|
|
1316
1107
|
}
|
|
1317
1108
|
}
|
|
1318
1109
|
await runNpmScript("preversion" /* PreVersion */, operation);
|
|
@@ -1321,9 +1112,15 @@ async function versionBump(arg = {}) {
|
|
|
1321
1112
|
if (typeof operation.options.execute === "function") {
|
|
1322
1113
|
await operation.options.execute(operation);
|
|
1323
1114
|
} else {
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1115
|
+
const [command, ...args] = (0, import_parse.default)(operation.options.execute);
|
|
1116
|
+
console.log(symbols_exports.info, "Executing script", command, ...args);
|
|
1117
|
+
await (0, import_tinyexec4.x)(command, args, {
|
|
1118
|
+
nodeOptions: {
|
|
1119
|
+
stdio: "inherit",
|
|
1120
|
+
cwd: operation.options.cwd
|
|
1121
|
+
}
|
|
1122
|
+
});
|
|
1123
|
+
console.log(symbols_exports.success, "Script finished");
|
|
1327
1124
|
}
|
|
1328
1125
|
}
|
|
1329
1126
|
await runNpmScript("version" /* Version */, operation);
|
|
@@ -1351,17 +1148,17 @@ function printSummary(operation) {
|
|
|
1351
1148
|
}
|
|
1352
1149
|
|
|
1353
1150
|
// src/cli/parse-args.ts
|
|
1354
|
-
var
|
|
1151
|
+
var import_node_process6 = __toESM(require("process"));
|
|
1355
1152
|
var import_cac = __toESM(require("cac"));
|
|
1356
1153
|
var import_picocolors4 = __toESM(require_picocolors());
|
|
1357
1154
|
var import_semver3 = require("semver");
|
|
1358
1155
|
|
|
1359
1156
|
// package.json
|
|
1360
|
-
var version = "9.
|
|
1157
|
+
var version = "9.9.1";
|
|
1361
1158
|
|
|
1362
1159
|
// src/config.ts
|
|
1363
1160
|
var import_node_path2 = require("path");
|
|
1364
|
-
var
|
|
1161
|
+
var import_node_process5 = __toESM(require("process"));
|
|
1365
1162
|
var import_c12 = require("c12");
|
|
1366
1163
|
var import_sync = __toESM(require("escalade/sync"));
|
|
1367
1164
|
var bumpConfigDefaults = {
|
|
@@ -1377,7 +1174,7 @@ var bumpConfigDefaults = {
|
|
|
1377
1174
|
noGitCheck: true,
|
|
1378
1175
|
files: []
|
|
1379
1176
|
};
|
|
1380
|
-
async function loadBumpConfig(overrides, cwd =
|
|
1177
|
+
async function loadBumpConfig(overrides, cwd = import_node_process5.default.cwd()) {
|
|
1381
1178
|
const name = "bump";
|
|
1382
1179
|
const configFile = findConfigFile(name, cwd);
|
|
1383
1180
|
const { config } = await (0, import_c12.loadConfig)({
|
|
@@ -1407,16 +1204,16 @@ function findConfigFile(name, cwd) {
|
|
|
1407
1204
|
}
|
|
1408
1205
|
return false;
|
|
1409
1206
|
});
|
|
1410
|
-
} catch (
|
|
1207
|
+
} catch (error2) {
|
|
1411
1208
|
if (foundRepositoryRoot)
|
|
1412
1209
|
return null;
|
|
1413
|
-
throw
|
|
1210
|
+
throw error2;
|
|
1414
1211
|
}
|
|
1415
1212
|
}
|
|
1416
1213
|
|
|
1417
1214
|
// src/cli/parse-args.ts
|
|
1418
1215
|
async function parseArgs() {
|
|
1419
|
-
var
|
|
1216
|
+
var _a2;
|
|
1420
1217
|
try {
|
|
1421
1218
|
const { args, resultArgs } = loadCliArgs();
|
|
1422
1219
|
const parsedArgs = {
|
|
@@ -1448,14 +1245,14 @@ async function parseArgs() {
|
|
|
1448
1245
|
parsedArgs.options.files.shift();
|
|
1449
1246
|
}
|
|
1450
1247
|
}
|
|
1451
|
-
if (parsedArgs.options.recursive && ((
|
|
1248
|
+
if (parsedArgs.options.recursive && ((_a2 = parsedArgs.options.files) == null ? void 0 : _a2.length))
|
|
1452
1249
|
console.log(import_picocolors4.default.yellow("The --recursive option is ignored when files are specified"));
|
|
1453
1250
|
return parsedArgs;
|
|
1454
|
-
} catch (
|
|
1455
|
-
return errorHandler(
|
|
1251
|
+
} catch (error2) {
|
|
1252
|
+
return errorHandler(error2);
|
|
1456
1253
|
}
|
|
1457
1254
|
}
|
|
1458
|
-
function loadCliArgs(argv =
|
|
1255
|
+
function loadCliArgs(argv = import_node_process6.default.argv) {
|
|
1459
1256
|
const cli = (0, import_cac.default)("bumpp");
|
|
1460
1257
|
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("-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();
|
|
1461
1258
|
const result = cli.parse(argv);
|
|
@@ -1465,7 +1262,7 @@ function loadCliArgs(argv = import_node_process7.default.argv) {
|
|
|
1465
1262
|
const TAG_REG = /(?:-t|--tag|--no-tag)(?:=.*|$)/;
|
|
1466
1263
|
const hasCommitFlag = rawArgs.some((arg) => COMMIT_REG.test(arg));
|
|
1467
1264
|
const hasTagFlag = rawArgs.some((arg) => TAG_REG.test(arg));
|
|
1468
|
-
const
|
|
1265
|
+
const _a2 = args, { tag, commit } = _a2, rest = __objRest(_a2, ["tag", "commit"]);
|
|
1469
1266
|
return {
|
|
1470
1267
|
args: __spreadProps(__spreadValues({}, rest), {
|
|
1471
1268
|
commit: hasCommitFlag ? commit : void 0,
|
|
@@ -1474,33 +1271,33 @@ function loadCliArgs(argv = import_node_process7.default.argv) {
|
|
|
1474
1271
|
resultArgs: result.args
|
|
1475
1272
|
};
|
|
1476
1273
|
}
|
|
1477
|
-
function errorHandler(
|
|
1478
|
-
console.error(
|
|
1479
|
-
return
|
|
1274
|
+
function errorHandler(error2) {
|
|
1275
|
+
console.error(error2.message);
|
|
1276
|
+
return import_node_process6.default.exit(9 /* InvalidArgument */);
|
|
1480
1277
|
}
|
|
1481
1278
|
|
|
1482
1279
|
// src/cli/index.ts
|
|
1483
|
-
async function
|
|
1280
|
+
async function main() {
|
|
1484
1281
|
try {
|
|
1485
|
-
|
|
1486
|
-
|
|
1282
|
+
import_node_process7.default.on("uncaughtException", errorHandler2);
|
|
1283
|
+
import_node_process7.default.on("unhandledRejection", errorHandler2);
|
|
1487
1284
|
const { help, version: version2, quiet, options } = await parseArgs();
|
|
1488
1285
|
if (help || version2) {
|
|
1489
|
-
|
|
1286
|
+
import_node_process7.default.exit(0 /* Success */);
|
|
1490
1287
|
} else {
|
|
1491
1288
|
if (!options.all && !options.noGitCheck) {
|
|
1492
|
-
checkGitStatus();
|
|
1289
|
+
await checkGitStatus();
|
|
1493
1290
|
}
|
|
1494
1291
|
if (!quiet)
|
|
1495
1292
|
options.progress = options.progress ? options.progress : progress;
|
|
1496
1293
|
await versionBump(options);
|
|
1497
1294
|
}
|
|
1498
|
-
} catch (
|
|
1499
|
-
errorHandler2(
|
|
1295
|
+
} catch (error2) {
|
|
1296
|
+
errorHandler2(error2);
|
|
1500
1297
|
}
|
|
1501
1298
|
}
|
|
1502
|
-
function checkGitStatus() {
|
|
1503
|
-
const { stdout } =
|
|
1299
|
+
async function checkGitStatus() {
|
|
1300
|
+
const { stdout } = await (0, import_tinyexec5.x)("git", ["status", "--porcelain"]);
|
|
1504
1301
|
if (stdout.trim()) {
|
|
1505
1302
|
throw new Error(`Git working tree is not clean:
|
|
1506
1303
|
${stdout}`);
|
|
@@ -1509,31 +1306,31 @@ ${stdout}`);
|
|
|
1509
1306
|
function progress({ event, script, updatedFiles, skippedFiles, newVersion }) {
|
|
1510
1307
|
switch (event) {
|
|
1511
1308
|
case "file updated" /* FileUpdated */:
|
|
1512
|
-
console.log(
|
|
1309
|
+
console.log(symbols_exports.success, `Updated ${updatedFiles.pop()} to ${newVersion}`);
|
|
1513
1310
|
break;
|
|
1514
1311
|
case "file skipped" /* FileSkipped */:
|
|
1515
|
-
console.log(
|
|
1312
|
+
console.log(symbols_exports.info, `${skippedFiles.pop()} did not need to be updated`);
|
|
1516
1313
|
break;
|
|
1517
1314
|
case "git commit" /* GitCommit */:
|
|
1518
|
-
console.log(
|
|
1315
|
+
console.log(symbols_exports.success, "Git commit");
|
|
1519
1316
|
break;
|
|
1520
1317
|
case "git tag" /* GitTag */:
|
|
1521
|
-
console.log(
|
|
1318
|
+
console.log(symbols_exports.success, "Git tag");
|
|
1522
1319
|
break;
|
|
1523
1320
|
case "git push" /* GitPush */:
|
|
1524
|
-
console.log(
|
|
1321
|
+
console.log(symbols_exports.success, "Git push");
|
|
1525
1322
|
break;
|
|
1526
1323
|
case "npm script" /* NpmScript */:
|
|
1527
|
-
console.log(
|
|
1324
|
+
console.log(symbols_exports.success, `Npm run ${script}`);
|
|
1528
1325
|
break;
|
|
1529
1326
|
}
|
|
1530
1327
|
}
|
|
1531
|
-
function errorHandler2(
|
|
1532
|
-
let message =
|
|
1533
|
-
if (
|
|
1534
|
-
message =
|
|
1328
|
+
function errorHandler2(error2) {
|
|
1329
|
+
let message = error2.message || String(error2);
|
|
1330
|
+
if (import_node_process7.default.env.DEBUG || import_node_process7.default.env.NODE_ENV === "development")
|
|
1331
|
+
message = error2.stack || message;
|
|
1535
1332
|
console.error(message);
|
|
1536
|
-
|
|
1333
|
+
import_node_process7.default.exit(1 /* FatalError */);
|
|
1537
1334
|
}
|
|
1538
1335
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1539
1336
|
0 && (module.exports = {
|