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/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,6 +130,203 @@ var require_picocolors = __commonJS({
|
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
|
|
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);
|
|
161
|
+
}
|
|
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;
|
|
172
|
+
}
|
|
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;
|
|
212
|
+
}
|
|
213
|
+
if (controlRE.test(s)) {
|
|
214
|
+
return { op: s };
|
|
215
|
+
}
|
|
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);
|
|
252
|
+
}
|
|
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
|
+
}
|
|
297
|
+
}
|
|
298
|
+
if (isGlob) {
|
|
299
|
+
return { op: "glob", pattern: out };
|
|
300
|
+
}
|
|
301
|
+
return out;
|
|
302
|
+
}).reduce(function(prev, arg) {
|
|
303
|
+
return typeof arg === "undefined" ? prev : prev.concat(arg);
|
|
304
|
+
}, []);
|
|
305
|
+
}
|
|
306
|
+
module2.exports = function parse2(s, env, opts) {
|
|
307
|
+
var mapped = parseInternal(s, env, opts);
|
|
308
|
+
if (typeof env !== "function") {
|
|
309
|
+
return mapped;
|
|
310
|
+
}
|
|
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
|
+
};
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
|
|
133
330
|
// src/index.ts
|
|
134
331
|
var src_exports = {};
|
|
135
332
|
__export(src_exports, {
|
|
@@ -145,524 +342,109 @@ __export(src_exports, {
|
|
|
145
342
|
module.exports = __toCommonJS(src_exports);
|
|
146
343
|
|
|
147
344
|
// src/version-bump.ts
|
|
148
|
-
var
|
|
149
|
-
var ezSpawn4 = __toESM(require("@jsdevtools/ez-spawn"));
|
|
345
|
+
var import_node_process4 = __toESM(require("process"));
|
|
150
346
|
|
|
151
|
-
// node_modules/.pnpm/
|
|
152
|
-
var
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
160
|
-
bold: [1, 22],
|
|
161
|
-
dim: [2, 22],
|
|
162
|
-
italic: [3, 23],
|
|
163
|
-
underline: [4, 24],
|
|
164
|
-
overline: [53, 55],
|
|
165
|
-
inverse: [7, 27],
|
|
166
|
-
hidden: [8, 28],
|
|
167
|
-
strikethrough: [9, 29]
|
|
168
|
-
},
|
|
169
|
-
color: {
|
|
170
|
-
black: [30, 39],
|
|
171
|
-
red: [31, 39],
|
|
172
|
-
green: [32, 39],
|
|
173
|
-
yellow: [33, 39],
|
|
174
|
-
blue: [34, 39],
|
|
175
|
-
magenta: [35, 39],
|
|
176
|
-
cyan: [36, 39],
|
|
177
|
-
white: [37, 39],
|
|
178
|
-
// Bright color
|
|
179
|
-
blackBright: [90, 39],
|
|
180
|
-
gray: [90, 39],
|
|
181
|
-
// Alias of `blackBright`
|
|
182
|
-
grey: [90, 39],
|
|
183
|
-
// Alias of `blackBright`
|
|
184
|
-
redBright: [91, 39],
|
|
185
|
-
greenBright: [92, 39],
|
|
186
|
-
yellowBright: [93, 39],
|
|
187
|
-
blueBright: [94, 39],
|
|
188
|
-
magentaBright: [95, 39],
|
|
189
|
-
cyanBright: [96, 39],
|
|
190
|
-
whiteBright: [97, 39]
|
|
191
|
-
},
|
|
192
|
-
bgColor: {
|
|
193
|
-
bgBlack: [40, 49],
|
|
194
|
-
bgRed: [41, 49],
|
|
195
|
-
bgGreen: [42, 49],
|
|
196
|
-
bgYellow: [43, 49],
|
|
197
|
-
bgBlue: [44, 49],
|
|
198
|
-
bgMagenta: [45, 49],
|
|
199
|
-
bgCyan: [46, 49],
|
|
200
|
-
bgWhite: [47, 49],
|
|
201
|
-
// Bright color
|
|
202
|
-
bgBlackBright: [100, 49],
|
|
203
|
-
bgGray: [100, 49],
|
|
204
|
-
// Alias of `bgBlackBright`
|
|
205
|
-
bgGrey: [100, 49],
|
|
206
|
-
// Alias of `bgBlackBright`
|
|
207
|
-
bgRedBright: [101, 49],
|
|
208
|
-
bgGreenBright: [102, 49],
|
|
209
|
-
bgYellowBright: [103, 49],
|
|
210
|
-
bgBlueBright: [104, 49],
|
|
211
|
-
bgMagentaBright: [105, 49],
|
|
212
|
-
bgCyanBright: [106, 49],
|
|
213
|
-
bgWhiteBright: [107, 49]
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
var modifierNames = Object.keys(styles.modifier);
|
|
217
|
-
var foregroundColorNames = Object.keys(styles.color);
|
|
218
|
-
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
219
|
-
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
220
|
-
function assembleStyles() {
|
|
221
|
-
const codes = /* @__PURE__ */ new Map();
|
|
222
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
223
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
224
|
-
styles[styleName] = {
|
|
225
|
-
open: `\x1B[${style[0]}m`,
|
|
226
|
-
close: `\x1B[${style[1]}m`
|
|
227
|
-
};
|
|
228
|
-
group[styleName] = styles[styleName];
|
|
229
|
-
codes.set(style[0], style[1]);
|
|
230
|
-
}
|
|
231
|
-
Object.defineProperty(styles, groupName, {
|
|
232
|
-
value: group,
|
|
233
|
-
enumerable: false
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
Object.defineProperty(styles, "codes", {
|
|
237
|
-
value: codes,
|
|
238
|
-
enumerable: false
|
|
239
|
-
});
|
|
240
|
-
styles.color.close = "\x1B[39m";
|
|
241
|
-
styles.bgColor.close = "\x1B[49m";
|
|
242
|
-
styles.color.ansi = wrapAnsi16();
|
|
243
|
-
styles.color.ansi256 = wrapAnsi256();
|
|
244
|
-
styles.color.ansi16m = wrapAnsi16m();
|
|
245
|
-
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
246
|
-
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
247
|
-
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
248
|
-
Object.defineProperties(styles, {
|
|
249
|
-
rgbToAnsi256: {
|
|
250
|
-
value(red, green, blue) {
|
|
251
|
-
if (red === green && green === blue) {
|
|
252
|
-
if (red < 8) {
|
|
253
|
-
return 16;
|
|
254
|
-
}
|
|
255
|
-
if (red > 248) {
|
|
256
|
-
return 231;
|
|
257
|
-
}
|
|
258
|
-
return Math.round((red - 8) / 247 * 24) + 232;
|
|
259
|
-
}
|
|
260
|
-
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
261
|
-
},
|
|
262
|
-
enumerable: false
|
|
263
|
-
},
|
|
264
|
-
hexToRgb: {
|
|
265
|
-
value(hex) {
|
|
266
|
-
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
267
|
-
if (!matches) {
|
|
268
|
-
return [0, 0, 0];
|
|
269
|
-
}
|
|
270
|
-
let [colorString] = matches;
|
|
271
|
-
if (colorString.length === 3) {
|
|
272
|
-
colorString = [...colorString].map((character) => character + character).join("");
|
|
273
|
-
}
|
|
274
|
-
const integer = Number.parseInt(colorString, 16);
|
|
275
|
-
return [
|
|
276
|
-
/* eslint-disable no-bitwise */
|
|
277
|
-
integer >> 16 & 255,
|
|
278
|
-
integer >> 8 & 255,
|
|
279
|
-
integer & 255
|
|
280
|
-
/* eslint-enable no-bitwise */
|
|
281
|
-
];
|
|
282
|
-
},
|
|
283
|
-
enumerable: false
|
|
284
|
-
},
|
|
285
|
-
hexToAnsi256: {
|
|
286
|
-
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
287
|
-
enumerable: false
|
|
288
|
-
},
|
|
289
|
-
ansi256ToAnsi: {
|
|
290
|
-
value(code) {
|
|
291
|
-
if (code < 8) {
|
|
292
|
-
return 30 + code;
|
|
293
|
-
}
|
|
294
|
-
if (code < 16) {
|
|
295
|
-
return 90 + (code - 8);
|
|
296
|
-
}
|
|
297
|
-
let red;
|
|
298
|
-
let green;
|
|
299
|
-
let blue;
|
|
300
|
-
if (code >= 232) {
|
|
301
|
-
red = ((code - 232) * 10 + 8) / 255;
|
|
302
|
-
green = red;
|
|
303
|
-
blue = red;
|
|
304
|
-
} else {
|
|
305
|
-
code -= 16;
|
|
306
|
-
const remainder = code % 36;
|
|
307
|
-
red = Math.floor(code / 36) / 5;
|
|
308
|
-
green = Math.floor(remainder / 6) / 5;
|
|
309
|
-
blue = remainder % 6 / 5;
|
|
310
|
-
}
|
|
311
|
-
const value = Math.max(red, green, blue) * 2;
|
|
312
|
-
if (value === 0) {
|
|
313
|
-
return 30;
|
|
314
|
-
}
|
|
315
|
-
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
316
|
-
if (value === 2) {
|
|
317
|
-
result += 60;
|
|
318
|
-
}
|
|
319
|
-
return result;
|
|
320
|
-
},
|
|
321
|
-
enumerable: false
|
|
322
|
-
},
|
|
323
|
-
rgbToAnsi: {
|
|
324
|
-
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
325
|
-
enumerable: false
|
|
326
|
-
},
|
|
327
|
-
hexToAnsi: {
|
|
328
|
-
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
329
|
-
enumerable: false
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
return styles;
|
|
333
|
-
}
|
|
334
|
-
var ansiStyles = assembleStyles();
|
|
335
|
-
var ansi_styles_default = ansiStyles;
|
|
347
|
+
// node_modules/.pnpm/log-symbols@7.0.0/node_modules/log-symbols/symbols.js
|
|
348
|
+
var symbols_exports = {};
|
|
349
|
+
__export(symbols_exports, {
|
|
350
|
+
error: () => error,
|
|
351
|
+
info: () => info,
|
|
352
|
+
success: () => success,
|
|
353
|
+
warning: () => warning
|
|
354
|
+
});
|
|
336
355
|
|
|
337
|
-
// node_modules/.pnpm/
|
|
338
|
-
var import_node_process = __toESM(require("process"), 1);
|
|
339
|
-
var import_node_os = __toESM(require("os"), 1);
|
|
356
|
+
// node_modules/.pnpm/yoctocolors@2.1.1/node_modules/yoctocolors/base.js
|
|
340
357
|
var import_node_tty = __toESM(require("tty"), 1);
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
function envForceColor() {
|
|
355
|
-
if ("FORCE_COLOR" in env) {
|
|
356
|
-
if (env.FORCE_COLOR === "true") {
|
|
357
|
-
return 1;
|
|
358
|
-
}
|
|
359
|
-
if (env.FORCE_COLOR === "false") {
|
|
360
|
-
return 0;
|
|
361
|
-
}
|
|
362
|
-
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
function translateLevel(level) {
|
|
366
|
-
if (level === 0) {
|
|
367
|
-
return false;
|
|
368
|
-
}
|
|
369
|
-
return {
|
|
370
|
-
level,
|
|
371
|
-
hasBasic: true,
|
|
372
|
-
has256: level >= 2,
|
|
373
|
-
has16m: level >= 3
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
377
|
-
const noFlagForceColor = envForceColor();
|
|
378
|
-
if (noFlagForceColor !== void 0) {
|
|
379
|
-
flagForceColor = noFlagForceColor;
|
|
380
|
-
}
|
|
381
|
-
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
382
|
-
if (forceColor === 0) {
|
|
383
|
-
return 0;
|
|
384
|
-
}
|
|
385
|
-
if (sniffFlags) {
|
|
386
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
387
|
-
return 3;
|
|
388
|
-
}
|
|
389
|
-
if (hasFlag("color=256")) {
|
|
390
|
-
return 2;
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
394
|
-
return 1;
|
|
395
|
-
}
|
|
396
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
397
|
-
return 0;
|
|
398
|
-
}
|
|
399
|
-
const min = forceColor || 0;
|
|
400
|
-
if (env.TERM === "dumb") {
|
|
401
|
-
return min;
|
|
402
|
-
}
|
|
403
|
-
if (import_node_process.default.platform === "win32") {
|
|
404
|
-
const osRelease = import_node_os.default.release().split(".");
|
|
405
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
406
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
407
|
-
}
|
|
408
|
-
return 1;
|
|
409
|
-
}
|
|
410
|
-
if ("CI" in env) {
|
|
411
|
-
if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
|
|
412
|
-
return 3;
|
|
413
|
-
}
|
|
414
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
415
|
-
return 1;
|
|
416
|
-
}
|
|
417
|
-
return min;
|
|
418
|
-
}
|
|
419
|
-
if ("TEAMCITY_VERSION" in env) {
|
|
420
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
421
|
-
}
|
|
422
|
-
if (env.COLORTERM === "truecolor") {
|
|
423
|
-
return 3;
|
|
424
|
-
}
|
|
425
|
-
if (env.TERM === "xterm-kitty") {
|
|
426
|
-
return 3;
|
|
427
|
-
}
|
|
428
|
-
if ("TERM_PROGRAM" in env) {
|
|
429
|
-
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
430
|
-
switch (env.TERM_PROGRAM) {
|
|
431
|
-
case "iTerm.app": {
|
|
432
|
-
return version >= 3 ? 3 : 2;
|
|
433
|
-
}
|
|
434
|
-
case "Apple_Terminal": {
|
|
435
|
-
return 2;
|
|
436
|
-
}
|
|
358
|
+
var _a, _b, _c, _d, _e;
|
|
359
|
+
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;
|
|
360
|
+
var format = (open, close) => {
|
|
361
|
+
if (!hasColors) {
|
|
362
|
+
return (input) => input;
|
|
363
|
+
}
|
|
364
|
+
const openCode = `\x1B[${open}m`;
|
|
365
|
+
const closeCode = `\x1B[${close}m`;
|
|
366
|
+
return (input) => {
|
|
367
|
+
const string = input + "";
|
|
368
|
+
let index = string.indexOf(closeCode);
|
|
369
|
+
if (index === -1) {
|
|
370
|
+
return openCode + string + closeCode;
|
|
437
371
|
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}
|
|
445
|
-
if ("COLORTERM" in env) {
|
|
446
|
-
return 1;
|
|
447
|
-
}
|
|
448
|
-
return min;
|
|
449
|
-
}
|
|
450
|
-
function createSupportsColor(stream, options = {}) {
|
|
451
|
-
const level = _supportsColor(stream, __spreadValues({
|
|
452
|
-
streamIsTTY: stream && stream.isTTY
|
|
453
|
-
}, options));
|
|
454
|
-
return translateLevel(level);
|
|
455
|
-
}
|
|
456
|
-
var supportsColor = {
|
|
457
|
-
stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }),
|
|
458
|
-
stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) })
|
|
459
|
-
};
|
|
460
|
-
var supports_color_default = supportsColor;
|
|
461
|
-
|
|
462
|
-
// node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js
|
|
463
|
-
function stringReplaceAll(string, substring, replacer) {
|
|
464
|
-
let index = string.indexOf(substring);
|
|
465
|
-
if (index === -1) {
|
|
466
|
-
return string;
|
|
467
|
-
}
|
|
468
|
-
const substringLength = substring.length;
|
|
469
|
-
let endIndex = 0;
|
|
470
|
-
let returnValue = "";
|
|
471
|
-
do {
|
|
472
|
-
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
473
|
-
endIndex = index + substringLength;
|
|
474
|
-
index = string.indexOf(substring, endIndex);
|
|
475
|
-
} while (index !== -1);
|
|
476
|
-
returnValue += string.slice(endIndex);
|
|
477
|
-
return returnValue;
|
|
478
|
-
}
|
|
479
|
-
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
480
|
-
let endIndex = 0;
|
|
481
|
-
let returnValue = "";
|
|
482
|
-
do {
|
|
483
|
-
const gotCR = string[index - 1] === "\r";
|
|
484
|
-
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
485
|
-
endIndex = index + 1;
|
|
486
|
-
index = string.indexOf("\n", endIndex);
|
|
487
|
-
} while (index !== -1);
|
|
488
|
-
returnValue += string.slice(endIndex);
|
|
489
|
-
return returnValue;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
// node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js
|
|
493
|
-
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
494
|
-
var GENERATOR = Symbol("GENERATOR");
|
|
495
|
-
var STYLER = Symbol("STYLER");
|
|
496
|
-
var IS_EMPTY = Symbol("IS_EMPTY");
|
|
497
|
-
var levelMapping = [
|
|
498
|
-
"ansi",
|
|
499
|
-
"ansi",
|
|
500
|
-
"ansi256",
|
|
501
|
-
"ansi16m"
|
|
502
|
-
];
|
|
503
|
-
var styles2 = /* @__PURE__ */ Object.create(null);
|
|
504
|
-
var applyOptions = (object, options = {}) => {
|
|
505
|
-
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
506
|
-
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
507
|
-
}
|
|
508
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
509
|
-
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
510
|
-
};
|
|
511
|
-
var chalkFactory = (options) => {
|
|
512
|
-
const chalk2 = (...strings) => strings.join(" ");
|
|
513
|
-
applyOptions(chalk2, options);
|
|
514
|
-
Object.setPrototypeOf(chalk2, createChalk.prototype);
|
|
515
|
-
return chalk2;
|
|
516
|
-
};
|
|
517
|
-
function createChalk(options) {
|
|
518
|
-
return chalkFactory(options);
|
|
519
|
-
}
|
|
520
|
-
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
521
|
-
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
522
|
-
styles2[styleName] = {
|
|
523
|
-
get() {
|
|
524
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
525
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
526
|
-
return builder;
|
|
372
|
+
let result = openCode;
|
|
373
|
+
let lastIndex = 0;
|
|
374
|
+
while (index !== -1) {
|
|
375
|
+
result += string.slice(lastIndex, index) + openCode;
|
|
376
|
+
lastIndex = index + closeCode.length;
|
|
377
|
+
index = string.indexOf(closeCode, lastIndex);
|
|
527
378
|
}
|
|
379
|
+
result += string.slice(lastIndex) + closeCode;
|
|
380
|
+
return result;
|
|
528
381
|
};
|
|
529
|
-
}
|
|
530
|
-
styles2.visible = {
|
|
531
|
-
get() {
|
|
532
|
-
const builder = createBuilder(this, this[STYLER], true);
|
|
533
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
534
|
-
return builder;
|
|
535
|
-
}
|
|
536
|
-
};
|
|
537
|
-
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
538
|
-
if (model === "rgb") {
|
|
539
|
-
if (level === "ansi16m") {
|
|
540
|
-
return ansi_styles_default[type].ansi16m(...arguments_);
|
|
541
|
-
}
|
|
542
|
-
if (level === "ansi256") {
|
|
543
|
-
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
544
|
-
}
|
|
545
|
-
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
546
|
-
}
|
|
547
|
-
if (model === "hex") {
|
|
548
|
-
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
549
|
-
}
|
|
550
|
-
return ansi_styles_default[type][model](...arguments_);
|
|
551
382
|
};
|
|
552
|
-
var
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
var
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
var
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
openAll = parent.openAll + open;
|
|
594
|
-
closeAll = close + parent.closeAll;
|
|
595
|
-
}
|
|
596
|
-
return {
|
|
597
|
-
open,
|
|
598
|
-
close,
|
|
599
|
-
openAll,
|
|
600
|
-
closeAll,
|
|
601
|
-
parent
|
|
602
|
-
};
|
|
603
|
-
};
|
|
604
|
-
var createBuilder = (self, _styler, _isEmpty) => {
|
|
605
|
-
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
606
|
-
Object.setPrototypeOf(builder, proto);
|
|
607
|
-
builder[GENERATOR] = self;
|
|
608
|
-
builder[STYLER] = _styler;
|
|
609
|
-
builder[IS_EMPTY] = _isEmpty;
|
|
610
|
-
return builder;
|
|
611
|
-
};
|
|
612
|
-
var applyStyle = (self, string) => {
|
|
613
|
-
if (self.level <= 0 || !string) {
|
|
614
|
-
return self[IS_EMPTY] ? "" : string;
|
|
615
|
-
}
|
|
616
|
-
let styler = self[STYLER];
|
|
617
|
-
if (styler === void 0) {
|
|
618
|
-
return string;
|
|
619
|
-
}
|
|
620
|
-
const { openAll, closeAll } = styler;
|
|
621
|
-
if (string.includes("\x1B")) {
|
|
622
|
-
while (styler !== void 0) {
|
|
623
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
624
|
-
styler = styler.parent;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
const lfIndex = string.indexOf("\n");
|
|
628
|
-
if (lfIndex !== -1) {
|
|
629
|
-
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
630
|
-
}
|
|
631
|
-
return openAll + string + closeAll;
|
|
632
|
-
};
|
|
633
|
-
Object.defineProperties(createChalk.prototype, styles2);
|
|
634
|
-
var chalk = createChalk();
|
|
635
|
-
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
636
|
-
var source_default = chalk;
|
|
383
|
+
var reset = format(0, 0);
|
|
384
|
+
var bold = format(1, 22);
|
|
385
|
+
var dim = format(2, 22);
|
|
386
|
+
var italic = format(3, 23);
|
|
387
|
+
var underline = format(4, 24);
|
|
388
|
+
var overline = format(53, 55);
|
|
389
|
+
var inverse = format(7, 27);
|
|
390
|
+
var hidden = format(8, 28);
|
|
391
|
+
var strikethrough = format(9, 29);
|
|
392
|
+
var black = format(30, 39);
|
|
393
|
+
var red = format(31, 39);
|
|
394
|
+
var green = format(32, 39);
|
|
395
|
+
var yellow = format(33, 39);
|
|
396
|
+
var blue = format(34, 39);
|
|
397
|
+
var magenta = format(35, 39);
|
|
398
|
+
var cyan = format(36, 39);
|
|
399
|
+
var white = format(37, 39);
|
|
400
|
+
var gray = format(90, 39);
|
|
401
|
+
var bgBlack = format(40, 49);
|
|
402
|
+
var bgRed = format(41, 49);
|
|
403
|
+
var bgGreen = format(42, 49);
|
|
404
|
+
var bgYellow = format(43, 49);
|
|
405
|
+
var bgBlue = format(44, 49);
|
|
406
|
+
var bgMagenta = format(45, 49);
|
|
407
|
+
var bgCyan = format(46, 49);
|
|
408
|
+
var bgWhite = format(47, 49);
|
|
409
|
+
var bgGray = format(100, 49);
|
|
410
|
+
var redBright = format(91, 39);
|
|
411
|
+
var greenBright = format(92, 39);
|
|
412
|
+
var yellowBright = format(93, 39);
|
|
413
|
+
var blueBright = format(94, 39);
|
|
414
|
+
var magentaBright = format(95, 39);
|
|
415
|
+
var cyanBright = format(96, 39);
|
|
416
|
+
var whiteBright = format(97, 39);
|
|
417
|
+
var bgRedBright = format(101, 49);
|
|
418
|
+
var bgGreenBright = format(102, 49);
|
|
419
|
+
var bgYellowBright = format(103, 49);
|
|
420
|
+
var bgBlueBright = format(104, 49);
|
|
421
|
+
var bgMagentaBright = format(105, 49);
|
|
422
|
+
var bgCyanBright = format(106, 49);
|
|
423
|
+
var bgWhiteBright = format(107, 49);
|
|
637
424
|
|
|
638
|
-
// node_modules/.pnpm/is-unicode-supported@1.
|
|
639
|
-
var
|
|
425
|
+
// node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
|
|
426
|
+
var import_node_process = __toESM(require("process"), 1);
|
|
640
427
|
function isUnicodeSupported() {
|
|
641
|
-
|
|
642
|
-
|
|
428
|
+
const { env } = import_node_process.default;
|
|
429
|
+
const { TERM, TERM_PROGRAM } = env;
|
|
430
|
+
if (import_node_process.default.platform !== "win32") {
|
|
431
|
+
return TERM !== "linux";
|
|
643
432
|
}
|
|
644
|
-
return Boolean(
|
|
433
|
+
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";
|
|
645
434
|
}
|
|
646
435
|
|
|
647
|
-
// node_modules/.pnpm/log-symbols@
|
|
648
|
-
var
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
};
|
|
654
|
-
var fallback = {
|
|
655
|
-
info: source_default.blue("i"),
|
|
656
|
-
success: source_default.green("\u221A"),
|
|
657
|
-
warning: source_default.yellow("\u203C"),
|
|
658
|
-
error: source_default.red("\xD7")
|
|
659
|
-
};
|
|
660
|
-
var logSymbols = isUnicodeSupported() ? main : fallback;
|
|
661
|
-
var log_symbols_default = logSymbols;
|
|
436
|
+
// node_modules/.pnpm/log-symbols@7.0.0/node_modules/log-symbols/symbols.js
|
|
437
|
+
var _isUnicodeSupported = isUnicodeSupported();
|
|
438
|
+
var info = blue(_isUnicodeSupported ? "\u2139" : "i");
|
|
439
|
+
var success = green(_isUnicodeSupported ? "\u2714" : "\u221A");
|
|
440
|
+
var warning = yellow(_isUnicodeSupported ? "\u26A0" : "\u203C");
|
|
441
|
+
var error = red(_isUnicodeSupported ? "\u2716\uFE0F" : "\xD7");
|
|
662
442
|
|
|
663
443
|
// src/version-bump.ts
|
|
664
444
|
var import_picocolors3 = __toESM(require_picocolors());
|
|
665
445
|
var import_prompts2 = __toESM(require("prompts"));
|
|
446
|
+
var import_parse = __toESM(require_parse());
|
|
447
|
+
var import_tinyexec4 = require("tinyexec");
|
|
666
448
|
|
|
667
449
|
// src/get-current-version.ts
|
|
668
450
|
var import_semver = require("semver");
|
|
@@ -716,8 +498,8 @@ function isManifest(obj) {
|
|
|
716
498
|
return obj && typeof obj === "object" && isOptionalString(obj.name) && isOptionalString(obj.version) && isOptionalString(obj.description);
|
|
717
499
|
}
|
|
718
500
|
function isPackageLockManifest(manifest) {
|
|
719
|
-
var
|
|
720
|
-
return typeof ((
|
|
501
|
+
var _a2, _b2;
|
|
502
|
+
return typeof ((_b2 = (_a2 = manifest.packages) == null ? void 0 : _a2[""]) == null ? void 0 : _b2.version) === "string";
|
|
721
503
|
}
|
|
722
504
|
function isOptionalString(value) {
|
|
723
505
|
const type = typeof value;
|
|
@@ -762,14 +544,14 @@ async function readVersion(file, cwd) {
|
|
|
762
544
|
}
|
|
763
545
|
|
|
764
546
|
// src/get-new-version.ts
|
|
765
|
-
var
|
|
547
|
+
var import_node_process2 = __toESM(require("process"));
|
|
766
548
|
var import_picocolors2 = __toESM(require_picocolors());
|
|
767
549
|
var import_prompts = __toESM(require("prompts"));
|
|
768
550
|
var import_semver2 = __toESM(require("semver"));
|
|
769
551
|
|
|
770
552
|
// src/print-commits.ts
|
|
771
|
-
var ezSpawn = __toESM(require("@jsdevtools/ez-spawn"));
|
|
772
553
|
var import_picocolors = __toESM(require_picocolors());
|
|
554
|
+
var import_tinyexec = require("tinyexec");
|
|
773
555
|
var messageColorMap = {
|
|
774
556
|
chore: import_picocolors.default.gray,
|
|
775
557
|
fix: import_picocolors.default.yellow,
|
|
@@ -788,20 +570,21 @@ function parseCommits(raw) {
|
|
|
788
570
|
return lines.map((line) => {
|
|
789
571
|
const [hash, ...parts] = line.split(" ");
|
|
790
572
|
const message = parts.join(" ");
|
|
791
|
-
const match = message.match(/^(\w+)(!)?(\([^)]+\))?:(.*)$/);
|
|
573
|
+
const match = message.match(/^(\w+)(!)?(\([^)]+\))?(!)?:(.*)$/);
|
|
792
574
|
if (match) {
|
|
793
575
|
let color = messageColorMap[match[1].toLowerCase()] || ((c4) => c4);
|
|
794
|
-
|
|
576
|
+
const breaking = match[2] === "!" || match[4] === "!";
|
|
577
|
+
if (breaking) {
|
|
795
578
|
color = (s) => import_picocolors.default.inverse(import_picocolors.default.red(s));
|
|
796
579
|
}
|
|
797
|
-
const tag = [match[1], match[2]].filter(Boolean).join("");
|
|
580
|
+
const tag = [match[1], match[2], match[4]].filter(Boolean).join("");
|
|
798
581
|
const scope = match[3] || "";
|
|
799
582
|
return {
|
|
800
583
|
hash,
|
|
801
584
|
tag,
|
|
802
|
-
message: match[
|
|
585
|
+
message: match[5].trim(),
|
|
803
586
|
scope,
|
|
804
|
-
breaking
|
|
587
|
+
breaking,
|
|
805
588
|
color
|
|
806
589
|
};
|
|
807
590
|
}
|
|
@@ -836,23 +619,23 @@ function formatParsedCommits(commits) {
|
|
|
836
619
|
}
|
|
837
620
|
async function printRecentCommits(operation) {
|
|
838
621
|
let sha;
|
|
839
|
-
sha || (sha = await
|
|
622
|
+
sha || (sha = await (0, import_tinyexec.x)(
|
|
840
623
|
"git",
|
|
841
624
|
["rev-list", "-n", "1", `v${operation.state.currentVersion}`],
|
|
842
|
-
{ stdio: "pipe" }
|
|
843
|
-
).then((res) => res.stdout.trim())
|
|
844
|
-
sha || (sha = await
|
|
625
|
+
{ nodeOptions: { stdio: "pipe" }, throwOnError: false }
|
|
626
|
+
).then((res) => res.stdout.trim()));
|
|
627
|
+
sha || (sha = await (0, import_tinyexec.x)(
|
|
845
628
|
"git",
|
|
846
629
|
["rev-list", "-n", "1", operation.state.currentVersion],
|
|
847
|
-
{ stdio: "pipe" }
|
|
848
|
-
).then((res) => res.stdout.trim())
|
|
630
|
+
{ nodeOptions: { stdio: "pipe" }, throwOnError: false }
|
|
631
|
+
).then((res) => res.stdout.trim()));
|
|
849
632
|
if (!sha) {
|
|
850
633
|
console.log(
|
|
851
634
|
import_picocolors.default.blue(`i`) + import_picocolors.default.gray(` Failed to locate the previous tag ${import_picocolors.default.yellow(`v${operation.state.currentVersion}`)}`)
|
|
852
635
|
);
|
|
853
636
|
return;
|
|
854
637
|
}
|
|
855
|
-
const { stdout } = await
|
|
638
|
+
const { stdout } = await (0, import_tinyexec.x)(
|
|
856
639
|
"git",
|
|
857
640
|
[
|
|
858
641
|
"--no-pager",
|
|
@@ -860,7 +643,11 @@ async function printRecentCommits(operation) {
|
|
|
860
643
|
`${sha}..HEAD`,
|
|
861
644
|
"--oneline"
|
|
862
645
|
],
|
|
863
|
-
{
|
|
646
|
+
{
|
|
647
|
+
nodeOptions: {
|
|
648
|
+
stdio: "pipe"
|
|
649
|
+
}
|
|
650
|
+
}
|
|
864
651
|
);
|
|
865
652
|
const parsed = parseCommits(stdout.toString().trim());
|
|
866
653
|
const prettified = formatParsedCommits(parsed);
|
|
@@ -929,11 +716,11 @@ function getNextVersions(currentVersion, preid) {
|
|
|
929
716
|
return next;
|
|
930
717
|
}
|
|
931
718
|
async function promptForNewVersion(operation) {
|
|
932
|
-
var
|
|
719
|
+
var _a2, _b2;
|
|
933
720
|
const { currentVersion } = operation.state;
|
|
934
721
|
const release = operation.options.release;
|
|
935
722
|
const next = getNextVersions(currentVersion, release.preid);
|
|
936
|
-
const configCustomVersion = await ((
|
|
723
|
+
const configCustomVersion = await ((_b2 = (_a2 = operation.options).customVersion) == null ? void 0 : _b2.call(_a2, currentVersion, import_semver2.default));
|
|
937
724
|
if (operation.options.printCommits) {
|
|
938
725
|
await printRecentCommits(operation);
|
|
939
726
|
}
|
|
@@ -971,7 +758,7 @@ async function promptForNewVersion(operation) {
|
|
|
971
758
|
]);
|
|
972
759
|
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];
|
|
973
760
|
if (!newVersion)
|
|
974
|
-
|
|
761
|
+
import_node_process2.default.exit(1);
|
|
975
762
|
switch (answers.release) {
|
|
976
763
|
case "custom":
|
|
977
764
|
case "config":
|
|
@@ -984,7 +771,7 @@ async function promptForNewVersion(operation) {
|
|
|
984
771
|
}
|
|
985
772
|
|
|
986
773
|
// src/git.ts
|
|
987
|
-
var
|
|
774
|
+
var import_tinyexec2 = require("tinyexec");
|
|
988
775
|
|
|
989
776
|
// src/types/version-bump-progress.ts
|
|
990
777
|
var ProgressEvent = /* @__PURE__ */ ((ProgressEvent2) => {
|
|
@@ -1023,7 +810,7 @@ async function gitCommit(operation) {
|
|
|
1023
810
|
args.push("--message", commitMessage);
|
|
1024
811
|
if (!all)
|
|
1025
812
|
args = args.concat(updatedFiles);
|
|
1026
|
-
await
|
|
813
|
+
await (0, import_tinyexec2.x)("git", ["commit", ...args]);
|
|
1027
814
|
return operation.update({ event: "git commit" /* GitCommit */, commitMessage });
|
|
1028
815
|
}
|
|
1029
816
|
async function gitTag(operation) {
|
|
@@ -1044,15 +831,15 @@ async function gitTag(operation) {
|
|
|
1044
831
|
if (operation.options.sign) {
|
|
1045
832
|
args.push("--sign");
|
|
1046
833
|
}
|
|
1047
|
-
await
|
|
834
|
+
await (0, import_tinyexec2.x)("git", ["tag", ...args]);
|
|
1048
835
|
return operation.update({ event: "git tag" /* GitTag */, tagName });
|
|
1049
836
|
}
|
|
1050
837
|
async function gitPush(operation) {
|
|
1051
838
|
if (!operation.options.push)
|
|
1052
839
|
return operation;
|
|
1053
|
-
await
|
|
840
|
+
await (0, import_tinyexec2.x)("git", ["push"]);
|
|
1054
841
|
if (operation.options.tag) {
|
|
1055
|
-
await
|
|
842
|
+
await (0, import_tinyexec2.x)("git", ["push", "--tags"]);
|
|
1056
843
|
}
|
|
1057
844
|
return operation.update({ event: "git push" /* GitPush */ });
|
|
1058
845
|
}
|
|
@@ -1066,17 +853,17 @@ function formatVersionString(template, newVersion) {
|
|
|
1066
853
|
// src/normalize-options.ts
|
|
1067
854
|
var import_node_fs2 = __toESM(require("fs"));
|
|
1068
855
|
var import_promises = __toESM(require("fs/promises"));
|
|
1069
|
-
var
|
|
856
|
+
var import_node_process3 = __toESM(require("process"));
|
|
1070
857
|
var import_js_yaml = __toESM(require("js-yaml"));
|
|
1071
858
|
var import_tinyglobby = require("tinyglobby");
|
|
1072
859
|
async function normalizeOptions(raw) {
|
|
1073
|
-
var
|
|
860
|
+
var _a2, _b2, _d2;
|
|
1074
861
|
const preid = typeof raw.preid === "string" ? raw.preid : "beta";
|
|
1075
862
|
const sign = Boolean(raw.sign);
|
|
1076
863
|
const push = Boolean(raw.push);
|
|
1077
864
|
const all = Boolean(raw.all);
|
|
1078
865
|
const noVerify = Boolean(raw.noVerify);
|
|
1079
|
-
const cwd = raw.cwd ||
|
|
866
|
+
const cwd = raw.cwd || import_node_process3.default.cwd();
|
|
1080
867
|
const ignoreScripts = Boolean(raw.ignoreScripts);
|
|
1081
868
|
const execute = raw.execute;
|
|
1082
869
|
const recursive = Boolean(raw.recursive);
|
|
@@ -1097,7 +884,7 @@ async function normalizeOptions(raw) {
|
|
|
1097
884
|
commit = { all, noVerify, message: raw.commit };
|
|
1098
885
|
else if (raw.commit || tag || push)
|
|
1099
886
|
commit = { all, noVerify, message: "chore: release v" };
|
|
1100
|
-
if (recursive && !((
|
|
887
|
+
if (recursive && !((_a2 = raw.files) == null ? void 0 : _a2.length)) {
|
|
1101
888
|
raw.files = [
|
|
1102
889
|
"package.json",
|
|
1103
890
|
"package-lock.json",
|
|
@@ -1112,13 +899,13 @@ async function normalizeOptions(raw) {
|
|
|
1112
899
|
const workspaces = import_js_yaml.default.load(pnpmWorkspace);
|
|
1113
900
|
const workspacesWithPackageJson = workspaces.packages.map((workspace) => `${workspace}/package.json`);
|
|
1114
901
|
const withoutExcludedWorkspaces = workspacesWithPackageJson.filter((workspace) => {
|
|
1115
|
-
var
|
|
1116
|
-
return !workspace.startsWith("!") && !((
|
|
902
|
+
var _a3;
|
|
903
|
+
return !workspace.startsWith("!") && !((_a3 = raw.files) == null ? void 0 : _a3.includes(workspace));
|
|
1117
904
|
});
|
|
1118
905
|
raw.files = raw.files.concat(withoutExcludedWorkspaces);
|
|
1119
906
|
}
|
|
1120
907
|
} else {
|
|
1121
|
-
raw.files = ((
|
|
908
|
+
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"];
|
|
1122
909
|
}
|
|
1123
910
|
const files = await (0, import_tinyglobby.glob)(
|
|
1124
911
|
raw.files,
|
|
@@ -1135,13 +922,13 @@ async function normalizeOptions(raw) {
|
|
|
1135
922
|
if (raw.interface === false) {
|
|
1136
923
|
ui = { input: false, output: false };
|
|
1137
924
|
} else if (raw.interface === true || !raw.interface) {
|
|
1138
|
-
ui = { input:
|
|
925
|
+
ui = { input: import_node_process3.default.stdin, output: import_node_process3.default.stdout };
|
|
1139
926
|
} else {
|
|
1140
|
-
let
|
|
927
|
+
let _c2 = raw.interface, { input, output } = _c2, other = __objRest(_c2, ["input", "output"]);
|
|
1141
928
|
if (input === true || input !== false && !input)
|
|
1142
|
-
input =
|
|
929
|
+
input = import_node_process3.default.stdin;
|
|
1143
930
|
if (output === true || output !== false && !output)
|
|
1144
|
-
output =
|
|
931
|
+
output = import_node_process3.default.stdout;
|
|
1145
932
|
ui = __spreadValues({ input, output }, other);
|
|
1146
933
|
}
|
|
1147
934
|
if (release.type === "prompt" && !(ui.input && ui.output))
|
|
@@ -1157,7 +944,7 @@ async function normalizeOptions(raw) {
|
|
|
1157
944
|
interface: ui,
|
|
1158
945
|
ignoreScripts,
|
|
1159
946
|
execute,
|
|
1160
|
-
printCommits: (
|
|
947
|
+
printCommits: (_d2 = raw.printCommits) != null ? _d2 : true,
|
|
1161
948
|
customVersion: raw.customVersion,
|
|
1162
949
|
currentVersion: raw.currentVersion
|
|
1163
950
|
};
|
|
@@ -1217,8 +1004,8 @@ var Operation = class _Operation {
|
|
|
1217
1004
|
/**
|
|
1218
1005
|
* Updates the operation state and results, and reports the updated progress to the user.
|
|
1219
1006
|
*/
|
|
1220
|
-
update(
|
|
1221
|
-
var
|
|
1007
|
+
update(_a2) {
|
|
1008
|
+
var _b2 = _a2, { event, script } = _b2, newState = __objRest(_b2, ["event", "script"]);
|
|
1222
1009
|
Object.assign(this.state, newState);
|
|
1223
1010
|
if (event && this._progress) {
|
|
1224
1011
|
this._progress(__spreadValues({ event, script }, this.results));
|
|
@@ -1228,13 +1015,15 @@ var Operation = class _Operation {
|
|
|
1228
1015
|
};
|
|
1229
1016
|
|
|
1230
1017
|
// src/run-npm-script.ts
|
|
1231
|
-
var
|
|
1018
|
+
var import_tinyexec3 = require("tinyexec");
|
|
1232
1019
|
async function runNpmScript(script, operation) {
|
|
1233
1020
|
const { cwd, ignoreScripts } = operation.options;
|
|
1234
1021
|
if (!ignoreScripts) {
|
|
1235
1022
|
const { data: manifest } = await readJsoncFile("package.json", cwd);
|
|
1236
1023
|
if (isManifest(manifest) && hasScript(manifest, script)) {
|
|
1237
|
-
await
|
|
1024
|
+
await (0, import_tinyexec3.x)("npm", ["run", script, "--silent"], {
|
|
1025
|
+
nodeOptions: { stdio: "inherit" }
|
|
1026
|
+
});
|
|
1238
1027
|
operation.update({ event: "npm script" /* NpmScript */, script });
|
|
1239
1028
|
}
|
|
1240
1029
|
}
|
|
@@ -1337,7 +1126,7 @@ async function versionBump(arg = {}) {
|
|
|
1337
1126
|
message: "Bump?",
|
|
1338
1127
|
initial: true
|
|
1339
1128
|
}).then((r) => r.yes)) {
|
|
1340
|
-
|
|
1129
|
+
import_node_process4.default.exit(1);
|
|
1341
1130
|
}
|
|
1342
1131
|
}
|
|
1343
1132
|
await runNpmScript("preversion" /* PreVersion */, operation);
|
|
@@ -1346,9 +1135,15 @@ async function versionBump(arg = {}) {
|
|
|
1346
1135
|
if (typeof operation.options.execute === "function") {
|
|
1347
1136
|
await operation.options.execute(operation);
|
|
1348
1137
|
} else {
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1138
|
+
const [command, ...args] = (0, import_parse.default)(operation.options.execute);
|
|
1139
|
+
console.log(symbols_exports.info, "Executing script", command, ...args);
|
|
1140
|
+
await (0, import_tinyexec4.x)(command, args, {
|
|
1141
|
+
nodeOptions: {
|
|
1142
|
+
stdio: "inherit",
|
|
1143
|
+
cwd: operation.options.cwd
|
|
1144
|
+
}
|
|
1145
|
+
});
|
|
1146
|
+
console.log(symbols_exports.success, "Script finished");
|
|
1352
1147
|
}
|
|
1353
1148
|
}
|
|
1354
1149
|
await runNpmScript("version" /* Version */, operation);
|
|
@@ -1385,7 +1180,7 @@ async function versionBumpInfo(arg = {}) {
|
|
|
1385
1180
|
|
|
1386
1181
|
// src/config.ts
|
|
1387
1182
|
var import_node_path2 = require("path");
|
|
1388
|
-
var
|
|
1183
|
+
var import_node_process5 = __toESM(require("process"));
|
|
1389
1184
|
var import_c12 = require("c12");
|
|
1390
1185
|
var import_sync = __toESM(require("escalade/sync"));
|
|
1391
1186
|
var bumpConfigDefaults = {
|
|
@@ -1401,7 +1196,7 @@ var bumpConfigDefaults = {
|
|
|
1401
1196
|
noGitCheck: true,
|
|
1402
1197
|
files: []
|
|
1403
1198
|
};
|
|
1404
|
-
async function loadBumpConfig(overrides, cwd =
|
|
1199
|
+
async function loadBumpConfig(overrides, cwd = import_node_process5.default.cwd()) {
|
|
1405
1200
|
const name = "bump";
|
|
1406
1201
|
const configFile = findConfigFile(name, cwd);
|
|
1407
1202
|
const { config } = await (0, import_c12.loadConfig)({
|
|
@@ -1431,10 +1226,10 @@ function findConfigFile(name, cwd) {
|
|
|
1431
1226
|
}
|
|
1432
1227
|
return false;
|
|
1433
1228
|
});
|
|
1434
|
-
} catch (
|
|
1229
|
+
} catch (error2) {
|
|
1435
1230
|
if (foundRepositoryRoot)
|
|
1436
1231
|
return null;
|
|
1437
|
-
throw
|
|
1232
|
+
throw error2;
|
|
1438
1233
|
}
|
|
1439
1234
|
}
|
|
1440
1235
|
function defineConfig(config) {
|