@fern-api/generator-cli 0.0.19 → 0.0.21
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/cli.cjs +1058 -208
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -2831,21 +2831,21 @@ var require_build3 = __commonJS({
|
|
|
2831
2831
|
}
|
|
2832
2832
|
});
|
|
2833
2833
|
|
|
2834
|
-
// ../../node_modules/.pnpm/escalade@3.
|
|
2834
|
+
// ../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.js
|
|
2835
2835
|
var require_sync = __commonJS({
|
|
2836
|
-
"../../node_modules/.pnpm/escalade@3.
|
|
2836
|
+
"../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.js"(exports2, module2) {
|
|
2837
2837
|
"use strict";
|
|
2838
|
-
var { dirname: dirname3, resolve:
|
|
2838
|
+
var { dirname: dirname3, resolve: resolve7 } = require("path");
|
|
2839
2839
|
var { readdirSync: readdirSync2, statSync: statSync3 } = require("fs");
|
|
2840
2840
|
module2.exports = function(start, callback) {
|
|
2841
|
-
let dir =
|
|
2841
|
+
let dir = resolve7(".", start);
|
|
2842
2842
|
let tmp2, stats = statSync3(dir);
|
|
2843
2843
|
if (!stats.isDirectory()) {
|
|
2844
2844
|
dir = dirname3(dir);
|
|
2845
2845
|
}
|
|
2846
2846
|
while (true) {
|
|
2847
2847
|
tmp2 = callback(dir, readdirSync2(dir));
|
|
2848
|
-
if (tmp2) return
|
|
2848
|
+
if (tmp2) return resolve7(dir, tmp2);
|
|
2849
2849
|
dir = dirname3(tmp2 = dir);
|
|
2850
2850
|
if (tmp2 === dir) break;
|
|
2851
2851
|
}
|
|
@@ -2883,7 +2883,7 @@ var require_require_directory = __commonJS({
|
|
|
2883
2883
|
"use strict";
|
|
2884
2884
|
var fs2 = require("fs");
|
|
2885
2885
|
var join = require("path").join;
|
|
2886
|
-
var
|
|
2886
|
+
var resolve7 = require("path").resolve;
|
|
2887
2887
|
var dirname3 = require("path").dirname;
|
|
2888
2888
|
var defaultOptions2 = {
|
|
2889
2889
|
extensions: ["js", "json", "coffee"],
|
|
@@ -2917,7 +2917,7 @@ var require_require_directory = __commonJS({
|
|
|
2917
2917
|
options[prop] = defaultOptions2[prop];
|
|
2918
2918
|
}
|
|
2919
2919
|
}
|
|
2920
|
-
path4 = !path4 ? dirname3(m.filename) :
|
|
2920
|
+
path4 = !path4 ? dirname3(m.filename) : resolve7(dirname3(m.filename), path4);
|
|
2921
2921
|
fs2.readdirSync(path4).forEach(function(filename) {
|
|
2922
2922
|
var joined = join(path4, filename), files, key, obj;
|
|
2923
2923
|
if (fs2.statSync(joined).isDirectory() && options.recurse) {
|
|
@@ -4918,8 +4918,826 @@ var require_tmp_promise = __commonJS({
|
|
|
4918
4918
|
}
|
|
4919
4919
|
});
|
|
4920
4920
|
|
|
4921
|
+
// ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
|
|
4922
|
+
var require_ms = __commonJS({
|
|
4923
|
+
"../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module2) {
|
|
4924
|
+
"use strict";
|
|
4925
|
+
var s = 1e3;
|
|
4926
|
+
var m = s * 60;
|
|
4927
|
+
var h = m * 60;
|
|
4928
|
+
var d = h * 24;
|
|
4929
|
+
var w = d * 7;
|
|
4930
|
+
var y = d * 365.25;
|
|
4931
|
+
module2.exports = function(val, options) {
|
|
4932
|
+
options = options || {};
|
|
4933
|
+
var type = typeof val;
|
|
4934
|
+
if (type === "string" && val.length > 0) {
|
|
4935
|
+
return parse(val);
|
|
4936
|
+
} else if (type === "number" && isFinite(val)) {
|
|
4937
|
+
return options.long ? fmtLong(val) : fmtShort(val);
|
|
4938
|
+
}
|
|
4939
|
+
throw new Error(
|
|
4940
|
+
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
4941
|
+
);
|
|
4942
|
+
};
|
|
4943
|
+
function parse(str) {
|
|
4944
|
+
str = String(str);
|
|
4945
|
+
if (str.length > 100) {
|
|
4946
|
+
return;
|
|
4947
|
+
}
|
|
4948
|
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
4949
|
+
str
|
|
4950
|
+
);
|
|
4951
|
+
if (!match) {
|
|
4952
|
+
return;
|
|
4953
|
+
}
|
|
4954
|
+
var n = parseFloat(match[1]);
|
|
4955
|
+
var type = (match[2] || "ms").toLowerCase();
|
|
4956
|
+
switch (type) {
|
|
4957
|
+
case "years":
|
|
4958
|
+
case "year":
|
|
4959
|
+
case "yrs":
|
|
4960
|
+
case "yr":
|
|
4961
|
+
case "y":
|
|
4962
|
+
return n * y;
|
|
4963
|
+
case "weeks":
|
|
4964
|
+
case "week":
|
|
4965
|
+
case "w":
|
|
4966
|
+
return n * w;
|
|
4967
|
+
case "days":
|
|
4968
|
+
case "day":
|
|
4969
|
+
case "d":
|
|
4970
|
+
return n * d;
|
|
4971
|
+
case "hours":
|
|
4972
|
+
case "hour":
|
|
4973
|
+
case "hrs":
|
|
4974
|
+
case "hr":
|
|
4975
|
+
case "h":
|
|
4976
|
+
return n * h;
|
|
4977
|
+
case "minutes":
|
|
4978
|
+
case "minute":
|
|
4979
|
+
case "mins":
|
|
4980
|
+
case "min":
|
|
4981
|
+
case "m":
|
|
4982
|
+
return n * m;
|
|
4983
|
+
case "seconds":
|
|
4984
|
+
case "second":
|
|
4985
|
+
case "secs":
|
|
4986
|
+
case "sec":
|
|
4987
|
+
case "s":
|
|
4988
|
+
return n * s;
|
|
4989
|
+
case "milliseconds":
|
|
4990
|
+
case "millisecond":
|
|
4991
|
+
case "msecs":
|
|
4992
|
+
case "msec":
|
|
4993
|
+
case "ms":
|
|
4994
|
+
return n;
|
|
4995
|
+
default:
|
|
4996
|
+
return void 0;
|
|
4997
|
+
}
|
|
4998
|
+
}
|
|
4999
|
+
function fmtShort(ms) {
|
|
5000
|
+
var msAbs = Math.abs(ms);
|
|
5001
|
+
if (msAbs >= d) {
|
|
5002
|
+
return Math.round(ms / d) + "d";
|
|
5003
|
+
}
|
|
5004
|
+
if (msAbs >= h) {
|
|
5005
|
+
return Math.round(ms / h) + "h";
|
|
5006
|
+
}
|
|
5007
|
+
if (msAbs >= m) {
|
|
5008
|
+
return Math.round(ms / m) + "m";
|
|
5009
|
+
}
|
|
5010
|
+
if (msAbs >= s) {
|
|
5011
|
+
return Math.round(ms / s) + "s";
|
|
5012
|
+
}
|
|
5013
|
+
return ms + "ms";
|
|
5014
|
+
}
|
|
5015
|
+
function fmtLong(ms) {
|
|
5016
|
+
var msAbs = Math.abs(ms);
|
|
5017
|
+
if (msAbs >= d) {
|
|
5018
|
+
return plural(ms, msAbs, d, "day");
|
|
5019
|
+
}
|
|
5020
|
+
if (msAbs >= h) {
|
|
5021
|
+
return plural(ms, msAbs, h, "hour");
|
|
5022
|
+
}
|
|
5023
|
+
if (msAbs >= m) {
|
|
5024
|
+
return plural(ms, msAbs, m, "minute");
|
|
5025
|
+
}
|
|
5026
|
+
if (msAbs >= s) {
|
|
5027
|
+
return plural(ms, msAbs, s, "second");
|
|
5028
|
+
}
|
|
5029
|
+
return ms + " ms";
|
|
5030
|
+
}
|
|
5031
|
+
function plural(ms, msAbs, n, name) {
|
|
5032
|
+
var isPlural = msAbs >= n * 1.5;
|
|
5033
|
+
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
|
5034
|
+
}
|
|
5035
|
+
}
|
|
5036
|
+
});
|
|
5037
|
+
|
|
5038
|
+
// ../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js
|
|
5039
|
+
var require_common = __commonJS({
|
|
5040
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js"(exports2, module2) {
|
|
5041
|
+
"use strict";
|
|
5042
|
+
function setup(env2) {
|
|
5043
|
+
createDebug.debug = createDebug;
|
|
5044
|
+
createDebug.default = createDebug;
|
|
5045
|
+
createDebug.coerce = coerce;
|
|
5046
|
+
createDebug.disable = disable;
|
|
5047
|
+
createDebug.enable = enable;
|
|
5048
|
+
createDebug.enabled = enabled;
|
|
5049
|
+
createDebug.humanize = require_ms();
|
|
5050
|
+
createDebug.destroy = destroy;
|
|
5051
|
+
Object.keys(env2).forEach((key) => {
|
|
5052
|
+
createDebug[key] = env2[key];
|
|
5053
|
+
});
|
|
5054
|
+
createDebug.names = [];
|
|
5055
|
+
createDebug.skips = [];
|
|
5056
|
+
createDebug.formatters = {};
|
|
5057
|
+
function selectColor(namespace) {
|
|
5058
|
+
let hash = 0;
|
|
5059
|
+
for (let i = 0; i < namespace.length; i++) {
|
|
5060
|
+
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
5061
|
+
hash |= 0;
|
|
5062
|
+
}
|
|
5063
|
+
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
5064
|
+
}
|
|
5065
|
+
createDebug.selectColor = selectColor;
|
|
5066
|
+
function createDebug(namespace) {
|
|
5067
|
+
let prevTime;
|
|
5068
|
+
let enableOverride = null;
|
|
5069
|
+
let namespacesCache;
|
|
5070
|
+
let enabledCache;
|
|
5071
|
+
function debug2(...args) {
|
|
5072
|
+
if (!debug2.enabled) {
|
|
5073
|
+
return;
|
|
5074
|
+
}
|
|
5075
|
+
const self = debug2;
|
|
5076
|
+
const curr = Number(/* @__PURE__ */ new Date());
|
|
5077
|
+
const ms = curr - (prevTime || curr);
|
|
5078
|
+
self.diff = ms;
|
|
5079
|
+
self.prev = prevTime;
|
|
5080
|
+
self.curr = curr;
|
|
5081
|
+
prevTime = curr;
|
|
5082
|
+
args[0] = createDebug.coerce(args[0]);
|
|
5083
|
+
if (typeof args[0] !== "string") {
|
|
5084
|
+
args.unshift("%O");
|
|
5085
|
+
}
|
|
5086
|
+
let index = 0;
|
|
5087
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format3) => {
|
|
5088
|
+
if (match === "%%") {
|
|
5089
|
+
return "%";
|
|
5090
|
+
}
|
|
5091
|
+
index++;
|
|
5092
|
+
const formatter = createDebug.formatters[format3];
|
|
5093
|
+
if (typeof formatter === "function") {
|
|
5094
|
+
const val = args[index];
|
|
5095
|
+
match = formatter.call(self, val);
|
|
5096
|
+
args.splice(index, 1);
|
|
5097
|
+
index--;
|
|
5098
|
+
}
|
|
5099
|
+
return match;
|
|
5100
|
+
});
|
|
5101
|
+
createDebug.formatArgs.call(self, args);
|
|
5102
|
+
const logFn = self.log || createDebug.log;
|
|
5103
|
+
logFn.apply(self, args);
|
|
5104
|
+
}
|
|
5105
|
+
debug2.namespace = namespace;
|
|
5106
|
+
debug2.useColors = createDebug.useColors();
|
|
5107
|
+
debug2.color = createDebug.selectColor(namespace);
|
|
5108
|
+
debug2.extend = extend;
|
|
5109
|
+
debug2.destroy = createDebug.destroy;
|
|
5110
|
+
Object.defineProperty(debug2, "enabled", {
|
|
5111
|
+
enumerable: true,
|
|
5112
|
+
configurable: false,
|
|
5113
|
+
get: () => {
|
|
5114
|
+
if (enableOverride !== null) {
|
|
5115
|
+
return enableOverride;
|
|
5116
|
+
}
|
|
5117
|
+
if (namespacesCache !== createDebug.namespaces) {
|
|
5118
|
+
namespacesCache = createDebug.namespaces;
|
|
5119
|
+
enabledCache = createDebug.enabled(namespace);
|
|
5120
|
+
}
|
|
5121
|
+
return enabledCache;
|
|
5122
|
+
},
|
|
5123
|
+
set: (v) => {
|
|
5124
|
+
enableOverride = v;
|
|
5125
|
+
}
|
|
5126
|
+
});
|
|
5127
|
+
if (typeof createDebug.init === "function") {
|
|
5128
|
+
createDebug.init(debug2);
|
|
5129
|
+
}
|
|
5130
|
+
return debug2;
|
|
5131
|
+
}
|
|
5132
|
+
function extend(namespace, delimiter) {
|
|
5133
|
+
const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
|
|
5134
|
+
newDebug.log = this.log;
|
|
5135
|
+
return newDebug;
|
|
5136
|
+
}
|
|
5137
|
+
function enable(namespaces) {
|
|
5138
|
+
createDebug.save(namespaces);
|
|
5139
|
+
createDebug.namespaces = namespaces;
|
|
5140
|
+
createDebug.names = [];
|
|
5141
|
+
createDebug.skips = [];
|
|
5142
|
+
const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
|
|
5143
|
+
for (const ns of split) {
|
|
5144
|
+
if (ns[0] === "-") {
|
|
5145
|
+
createDebug.skips.push(ns.slice(1));
|
|
5146
|
+
} else {
|
|
5147
|
+
createDebug.names.push(ns);
|
|
5148
|
+
}
|
|
5149
|
+
}
|
|
5150
|
+
}
|
|
5151
|
+
function matchesTemplate(search, template) {
|
|
5152
|
+
let searchIndex = 0;
|
|
5153
|
+
let templateIndex = 0;
|
|
5154
|
+
let starIndex = -1;
|
|
5155
|
+
let matchIndex = 0;
|
|
5156
|
+
while (searchIndex < search.length) {
|
|
5157
|
+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
5158
|
+
if (template[templateIndex] === "*") {
|
|
5159
|
+
starIndex = templateIndex;
|
|
5160
|
+
matchIndex = searchIndex;
|
|
5161
|
+
templateIndex++;
|
|
5162
|
+
} else {
|
|
5163
|
+
searchIndex++;
|
|
5164
|
+
templateIndex++;
|
|
5165
|
+
}
|
|
5166
|
+
} else if (starIndex !== -1) {
|
|
5167
|
+
templateIndex = starIndex + 1;
|
|
5168
|
+
matchIndex++;
|
|
5169
|
+
searchIndex = matchIndex;
|
|
5170
|
+
} else {
|
|
5171
|
+
return false;
|
|
5172
|
+
}
|
|
5173
|
+
}
|
|
5174
|
+
while (templateIndex < template.length && template[templateIndex] === "*") {
|
|
5175
|
+
templateIndex++;
|
|
5176
|
+
}
|
|
5177
|
+
return templateIndex === template.length;
|
|
5178
|
+
}
|
|
5179
|
+
function disable() {
|
|
5180
|
+
const namespaces = [
|
|
5181
|
+
...createDebug.names,
|
|
5182
|
+
...createDebug.skips.map((namespace) => "-" + namespace)
|
|
5183
|
+
].join(",");
|
|
5184
|
+
createDebug.enable("");
|
|
5185
|
+
return namespaces;
|
|
5186
|
+
}
|
|
5187
|
+
function enabled(name) {
|
|
5188
|
+
for (const skip of createDebug.skips) {
|
|
5189
|
+
if (matchesTemplate(name, skip)) {
|
|
5190
|
+
return false;
|
|
5191
|
+
}
|
|
5192
|
+
}
|
|
5193
|
+
for (const ns of createDebug.names) {
|
|
5194
|
+
if (matchesTemplate(name, ns)) {
|
|
5195
|
+
return true;
|
|
5196
|
+
}
|
|
5197
|
+
}
|
|
5198
|
+
return false;
|
|
5199
|
+
}
|
|
5200
|
+
function coerce(val) {
|
|
5201
|
+
if (val instanceof Error) {
|
|
5202
|
+
return val.stack || val.message;
|
|
5203
|
+
}
|
|
5204
|
+
return val;
|
|
5205
|
+
}
|
|
5206
|
+
function destroy() {
|
|
5207
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
5208
|
+
}
|
|
5209
|
+
createDebug.enable(createDebug.load());
|
|
5210
|
+
return createDebug;
|
|
5211
|
+
}
|
|
5212
|
+
module2.exports = setup;
|
|
5213
|
+
}
|
|
5214
|
+
});
|
|
5215
|
+
|
|
5216
|
+
// ../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js
|
|
5217
|
+
var require_browser = __commonJS({
|
|
5218
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js"(exports2, module2) {
|
|
5219
|
+
"use strict";
|
|
5220
|
+
exports2.formatArgs = formatArgs;
|
|
5221
|
+
exports2.save = save;
|
|
5222
|
+
exports2.load = load;
|
|
5223
|
+
exports2.useColors = useColors;
|
|
5224
|
+
exports2.storage = localstorage();
|
|
5225
|
+
exports2.destroy = /* @__PURE__ */ (() => {
|
|
5226
|
+
let warned = false;
|
|
5227
|
+
return () => {
|
|
5228
|
+
if (!warned) {
|
|
5229
|
+
warned = true;
|
|
5230
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
5231
|
+
}
|
|
5232
|
+
};
|
|
5233
|
+
})();
|
|
5234
|
+
exports2.colors = [
|
|
5235
|
+
"#0000CC",
|
|
5236
|
+
"#0000FF",
|
|
5237
|
+
"#0033CC",
|
|
5238
|
+
"#0033FF",
|
|
5239
|
+
"#0066CC",
|
|
5240
|
+
"#0066FF",
|
|
5241
|
+
"#0099CC",
|
|
5242
|
+
"#0099FF",
|
|
5243
|
+
"#00CC00",
|
|
5244
|
+
"#00CC33",
|
|
5245
|
+
"#00CC66",
|
|
5246
|
+
"#00CC99",
|
|
5247
|
+
"#00CCCC",
|
|
5248
|
+
"#00CCFF",
|
|
5249
|
+
"#3300CC",
|
|
5250
|
+
"#3300FF",
|
|
5251
|
+
"#3333CC",
|
|
5252
|
+
"#3333FF",
|
|
5253
|
+
"#3366CC",
|
|
5254
|
+
"#3366FF",
|
|
5255
|
+
"#3399CC",
|
|
5256
|
+
"#3399FF",
|
|
5257
|
+
"#33CC00",
|
|
5258
|
+
"#33CC33",
|
|
5259
|
+
"#33CC66",
|
|
5260
|
+
"#33CC99",
|
|
5261
|
+
"#33CCCC",
|
|
5262
|
+
"#33CCFF",
|
|
5263
|
+
"#6600CC",
|
|
5264
|
+
"#6600FF",
|
|
5265
|
+
"#6633CC",
|
|
5266
|
+
"#6633FF",
|
|
5267
|
+
"#66CC00",
|
|
5268
|
+
"#66CC33",
|
|
5269
|
+
"#9900CC",
|
|
5270
|
+
"#9900FF",
|
|
5271
|
+
"#9933CC",
|
|
5272
|
+
"#9933FF",
|
|
5273
|
+
"#99CC00",
|
|
5274
|
+
"#99CC33",
|
|
5275
|
+
"#CC0000",
|
|
5276
|
+
"#CC0033",
|
|
5277
|
+
"#CC0066",
|
|
5278
|
+
"#CC0099",
|
|
5279
|
+
"#CC00CC",
|
|
5280
|
+
"#CC00FF",
|
|
5281
|
+
"#CC3300",
|
|
5282
|
+
"#CC3333",
|
|
5283
|
+
"#CC3366",
|
|
5284
|
+
"#CC3399",
|
|
5285
|
+
"#CC33CC",
|
|
5286
|
+
"#CC33FF",
|
|
5287
|
+
"#CC6600",
|
|
5288
|
+
"#CC6633",
|
|
5289
|
+
"#CC9900",
|
|
5290
|
+
"#CC9933",
|
|
5291
|
+
"#CCCC00",
|
|
5292
|
+
"#CCCC33",
|
|
5293
|
+
"#FF0000",
|
|
5294
|
+
"#FF0033",
|
|
5295
|
+
"#FF0066",
|
|
5296
|
+
"#FF0099",
|
|
5297
|
+
"#FF00CC",
|
|
5298
|
+
"#FF00FF",
|
|
5299
|
+
"#FF3300",
|
|
5300
|
+
"#FF3333",
|
|
5301
|
+
"#FF3366",
|
|
5302
|
+
"#FF3399",
|
|
5303
|
+
"#FF33CC",
|
|
5304
|
+
"#FF33FF",
|
|
5305
|
+
"#FF6600",
|
|
5306
|
+
"#FF6633",
|
|
5307
|
+
"#FF9900",
|
|
5308
|
+
"#FF9933",
|
|
5309
|
+
"#FFCC00",
|
|
5310
|
+
"#FFCC33"
|
|
5311
|
+
];
|
|
5312
|
+
function useColors() {
|
|
5313
|
+
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
|
5314
|
+
return true;
|
|
5315
|
+
}
|
|
5316
|
+
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
5317
|
+
return false;
|
|
5318
|
+
}
|
|
5319
|
+
let m;
|
|
5320
|
+
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
5321
|
+
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
5322
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
5323
|
+
typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
|
5324
|
+
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
5325
|
+
}
|
|
5326
|
+
function formatArgs(args) {
|
|
5327
|
+
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
|
|
5328
|
+
if (!this.useColors) {
|
|
5329
|
+
return;
|
|
5330
|
+
}
|
|
5331
|
+
const c = "color: " + this.color;
|
|
5332
|
+
args.splice(1, 0, c, "color: inherit");
|
|
5333
|
+
let index = 0;
|
|
5334
|
+
let lastC = 0;
|
|
5335
|
+
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
5336
|
+
if (match === "%%") {
|
|
5337
|
+
return;
|
|
5338
|
+
}
|
|
5339
|
+
index++;
|
|
5340
|
+
if (match === "%c") {
|
|
5341
|
+
lastC = index;
|
|
5342
|
+
}
|
|
5343
|
+
});
|
|
5344
|
+
args.splice(lastC, 0, c);
|
|
5345
|
+
}
|
|
5346
|
+
exports2.log = console.debug || console.log || (() => {
|
|
5347
|
+
});
|
|
5348
|
+
function save(namespaces) {
|
|
5349
|
+
try {
|
|
5350
|
+
if (namespaces) {
|
|
5351
|
+
exports2.storage.setItem("debug", namespaces);
|
|
5352
|
+
} else {
|
|
5353
|
+
exports2.storage.removeItem("debug");
|
|
5354
|
+
}
|
|
5355
|
+
} catch (error) {
|
|
5356
|
+
}
|
|
5357
|
+
}
|
|
5358
|
+
function load() {
|
|
5359
|
+
let r;
|
|
5360
|
+
try {
|
|
5361
|
+
r = exports2.storage.getItem("debug");
|
|
5362
|
+
} catch (error) {
|
|
5363
|
+
}
|
|
5364
|
+
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
5365
|
+
r = process.env.DEBUG;
|
|
5366
|
+
}
|
|
5367
|
+
return r;
|
|
5368
|
+
}
|
|
5369
|
+
function localstorage() {
|
|
5370
|
+
try {
|
|
5371
|
+
return localStorage;
|
|
5372
|
+
} catch (error) {
|
|
5373
|
+
}
|
|
5374
|
+
}
|
|
5375
|
+
module2.exports = require_common()(exports2);
|
|
5376
|
+
var { formatters } = module2.exports;
|
|
5377
|
+
formatters.j = function(v) {
|
|
5378
|
+
try {
|
|
5379
|
+
return JSON.stringify(v);
|
|
5380
|
+
} catch (error) {
|
|
5381
|
+
return "[UnexpectedJSONParseError]: " + error.message;
|
|
5382
|
+
}
|
|
5383
|
+
};
|
|
5384
|
+
}
|
|
5385
|
+
});
|
|
5386
|
+
|
|
5387
|
+
// ../../node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js
|
|
5388
|
+
var require_has_flag = __commonJS({
|
|
5389
|
+
"../../node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js"(exports2, module2) {
|
|
5390
|
+
"use strict";
|
|
5391
|
+
module2.exports = (flag, argv) => {
|
|
5392
|
+
argv = argv || process.argv;
|
|
5393
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
5394
|
+
const pos = argv.indexOf(prefix + flag);
|
|
5395
|
+
const terminatorPos = argv.indexOf("--");
|
|
5396
|
+
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
5397
|
+
};
|
|
5398
|
+
}
|
|
5399
|
+
});
|
|
5400
|
+
|
|
5401
|
+
// ../../node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js
|
|
5402
|
+
var require_supports_color = __commonJS({
|
|
5403
|
+
"../../node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js"(exports2, module2) {
|
|
5404
|
+
"use strict";
|
|
5405
|
+
var os = require("os");
|
|
5406
|
+
var hasFlag = require_has_flag();
|
|
5407
|
+
var env2 = process.env;
|
|
5408
|
+
var forceColor;
|
|
5409
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
|
|
5410
|
+
forceColor = false;
|
|
5411
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
5412
|
+
forceColor = true;
|
|
5413
|
+
}
|
|
5414
|
+
if ("FORCE_COLOR" in env2) {
|
|
5415
|
+
forceColor = env2.FORCE_COLOR.length === 0 || parseInt(env2.FORCE_COLOR, 10) !== 0;
|
|
5416
|
+
}
|
|
5417
|
+
function translateLevel(level) {
|
|
5418
|
+
if (level === 0) {
|
|
5419
|
+
return false;
|
|
5420
|
+
}
|
|
5421
|
+
return {
|
|
5422
|
+
level,
|
|
5423
|
+
hasBasic: true,
|
|
5424
|
+
has256: level >= 2,
|
|
5425
|
+
has16m: level >= 3
|
|
5426
|
+
};
|
|
5427
|
+
}
|
|
5428
|
+
function supportsColor(stream) {
|
|
5429
|
+
if (forceColor === false) {
|
|
5430
|
+
return 0;
|
|
5431
|
+
}
|
|
5432
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
5433
|
+
return 3;
|
|
5434
|
+
}
|
|
5435
|
+
if (hasFlag("color=256")) {
|
|
5436
|
+
return 2;
|
|
5437
|
+
}
|
|
5438
|
+
if (stream && !stream.isTTY && forceColor !== true) {
|
|
5439
|
+
return 0;
|
|
5440
|
+
}
|
|
5441
|
+
const min = forceColor ? 1 : 0;
|
|
5442
|
+
if (process.platform === "win32") {
|
|
5443
|
+
const osRelease = os.release().split(".");
|
|
5444
|
+
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
5445
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
5446
|
+
}
|
|
5447
|
+
return 1;
|
|
5448
|
+
}
|
|
5449
|
+
if ("CI" in env2) {
|
|
5450
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
|
|
5451
|
+
return 1;
|
|
5452
|
+
}
|
|
5453
|
+
return min;
|
|
5454
|
+
}
|
|
5455
|
+
if ("TEAMCITY_VERSION" in env2) {
|
|
5456
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
|
|
5457
|
+
}
|
|
5458
|
+
if (env2.COLORTERM === "truecolor") {
|
|
5459
|
+
return 3;
|
|
5460
|
+
}
|
|
5461
|
+
if ("TERM_PROGRAM" in env2) {
|
|
5462
|
+
const version = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
5463
|
+
switch (env2.TERM_PROGRAM) {
|
|
5464
|
+
case "iTerm.app":
|
|
5465
|
+
return version >= 3 ? 3 : 2;
|
|
5466
|
+
case "Apple_Terminal":
|
|
5467
|
+
return 2;
|
|
5468
|
+
}
|
|
5469
|
+
}
|
|
5470
|
+
if (/-256(color)?$/i.test(env2.TERM)) {
|
|
5471
|
+
return 2;
|
|
5472
|
+
}
|
|
5473
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
|
|
5474
|
+
return 1;
|
|
5475
|
+
}
|
|
5476
|
+
if ("COLORTERM" in env2) {
|
|
5477
|
+
return 1;
|
|
5478
|
+
}
|
|
5479
|
+
if (env2.TERM === "dumb") {
|
|
5480
|
+
return min;
|
|
5481
|
+
}
|
|
5482
|
+
return min;
|
|
5483
|
+
}
|
|
5484
|
+
function getSupportLevel(stream) {
|
|
5485
|
+
const level = supportsColor(stream);
|
|
5486
|
+
return translateLevel(level);
|
|
5487
|
+
}
|
|
5488
|
+
module2.exports = {
|
|
5489
|
+
supportsColor: getSupportLevel,
|
|
5490
|
+
stdout: getSupportLevel(process.stdout),
|
|
5491
|
+
stderr: getSupportLevel(process.stderr)
|
|
5492
|
+
};
|
|
5493
|
+
}
|
|
5494
|
+
});
|
|
5495
|
+
|
|
5496
|
+
// ../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js
|
|
5497
|
+
var require_node = __commonJS({
|
|
5498
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js"(exports2, module2) {
|
|
5499
|
+
"use strict";
|
|
5500
|
+
var tty = require("tty");
|
|
5501
|
+
var util = require("util");
|
|
5502
|
+
exports2.init = init;
|
|
5503
|
+
exports2.log = log;
|
|
5504
|
+
exports2.formatArgs = formatArgs;
|
|
5505
|
+
exports2.save = save;
|
|
5506
|
+
exports2.load = load;
|
|
5507
|
+
exports2.useColors = useColors;
|
|
5508
|
+
exports2.destroy = util.deprecate(
|
|
5509
|
+
() => {
|
|
5510
|
+
},
|
|
5511
|
+
"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
|
|
5512
|
+
);
|
|
5513
|
+
exports2.colors = [6, 2, 3, 4, 5, 1];
|
|
5514
|
+
try {
|
|
5515
|
+
const supportsColor = require_supports_color();
|
|
5516
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
5517
|
+
exports2.colors = [
|
|
5518
|
+
20,
|
|
5519
|
+
21,
|
|
5520
|
+
26,
|
|
5521
|
+
27,
|
|
5522
|
+
32,
|
|
5523
|
+
33,
|
|
5524
|
+
38,
|
|
5525
|
+
39,
|
|
5526
|
+
40,
|
|
5527
|
+
41,
|
|
5528
|
+
42,
|
|
5529
|
+
43,
|
|
5530
|
+
44,
|
|
5531
|
+
45,
|
|
5532
|
+
56,
|
|
5533
|
+
57,
|
|
5534
|
+
62,
|
|
5535
|
+
63,
|
|
5536
|
+
68,
|
|
5537
|
+
69,
|
|
5538
|
+
74,
|
|
5539
|
+
75,
|
|
5540
|
+
76,
|
|
5541
|
+
77,
|
|
5542
|
+
78,
|
|
5543
|
+
79,
|
|
5544
|
+
80,
|
|
5545
|
+
81,
|
|
5546
|
+
92,
|
|
5547
|
+
93,
|
|
5548
|
+
98,
|
|
5549
|
+
99,
|
|
5550
|
+
112,
|
|
5551
|
+
113,
|
|
5552
|
+
128,
|
|
5553
|
+
129,
|
|
5554
|
+
134,
|
|
5555
|
+
135,
|
|
5556
|
+
148,
|
|
5557
|
+
149,
|
|
5558
|
+
160,
|
|
5559
|
+
161,
|
|
5560
|
+
162,
|
|
5561
|
+
163,
|
|
5562
|
+
164,
|
|
5563
|
+
165,
|
|
5564
|
+
166,
|
|
5565
|
+
167,
|
|
5566
|
+
168,
|
|
5567
|
+
169,
|
|
5568
|
+
170,
|
|
5569
|
+
171,
|
|
5570
|
+
172,
|
|
5571
|
+
173,
|
|
5572
|
+
178,
|
|
5573
|
+
179,
|
|
5574
|
+
184,
|
|
5575
|
+
185,
|
|
5576
|
+
196,
|
|
5577
|
+
197,
|
|
5578
|
+
198,
|
|
5579
|
+
199,
|
|
5580
|
+
200,
|
|
5581
|
+
201,
|
|
5582
|
+
202,
|
|
5583
|
+
203,
|
|
5584
|
+
204,
|
|
5585
|
+
205,
|
|
5586
|
+
206,
|
|
5587
|
+
207,
|
|
5588
|
+
208,
|
|
5589
|
+
209,
|
|
5590
|
+
214,
|
|
5591
|
+
215,
|
|
5592
|
+
220,
|
|
5593
|
+
221
|
|
5594
|
+
];
|
|
5595
|
+
}
|
|
5596
|
+
} catch (error) {
|
|
5597
|
+
}
|
|
5598
|
+
exports2.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
5599
|
+
return /^debug_/i.test(key);
|
|
5600
|
+
}).reduce((obj, key) => {
|
|
5601
|
+
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
|
|
5602
|
+
return k.toUpperCase();
|
|
5603
|
+
});
|
|
5604
|
+
let val = process.env[key];
|
|
5605
|
+
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
5606
|
+
val = true;
|
|
5607
|
+
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
5608
|
+
val = false;
|
|
5609
|
+
} else if (val === "null") {
|
|
5610
|
+
val = null;
|
|
5611
|
+
} else {
|
|
5612
|
+
val = Number(val);
|
|
5613
|
+
}
|
|
5614
|
+
obj[prop] = val;
|
|
5615
|
+
return obj;
|
|
5616
|
+
}, {});
|
|
5617
|
+
function useColors() {
|
|
5618
|
+
return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
5619
|
+
}
|
|
5620
|
+
function formatArgs(args) {
|
|
5621
|
+
const { namespace: name, useColors: useColors2 } = this;
|
|
5622
|
+
if (useColors2) {
|
|
5623
|
+
const c = this.color;
|
|
5624
|
+
const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
|
|
5625
|
+
const prefix = ` ${colorCode};1m${name} \x1B[0m`;
|
|
5626
|
+
args[0] = prefix + args[0].split("\n").join("\n" + prefix);
|
|
5627
|
+
args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
|
|
5628
|
+
} else {
|
|
5629
|
+
args[0] = getDate() + name + " " + args[0];
|
|
5630
|
+
}
|
|
5631
|
+
}
|
|
5632
|
+
function getDate() {
|
|
5633
|
+
if (exports2.inspectOpts.hideDate) {
|
|
5634
|
+
return "";
|
|
5635
|
+
}
|
|
5636
|
+
return (/* @__PURE__ */ new Date()).toISOString() + " ";
|
|
5637
|
+
}
|
|
5638
|
+
function log(...args) {
|
|
5639
|
+
return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
|
|
5640
|
+
}
|
|
5641
|
+
function save(namespaces) {
|
|
5642
|
+
if (namespaces) {
|
|
5643
|
+
process.env.DEBUG = namespaces;
|
|
5644
|
+
} else {
|
|
5645
|
+
delete process.env.DEBUG;
|
|
5646
|
+
}
|
|
5647
|
+
}
|
|
5648
|
+
function load() {
|
|
5649
|
+
return process.env.DEBUG;
|
|
5650
|
+
}
|
|
5651
|
+
function init(debug2) {
|
|
5652
|
+
debug2.inspectOpts = {};
|
|
5653
|
+
const keys = Object.keys(exports2.inspectOpts);
|
|
5654
|
+
for (let i = 0; i < keys.length; i++) {
|
|
5655
|
+
debug2.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
|
|
5656
|
+
}
|
|
5657
|
+
}
|
|
5658
|
+
module2.exports = require_common()(exports2);
|
|
5659
|
+
var { formatters } = module2.exports;
|
|
5660
|
+
formatters.o = function(v) {
|
|
5661
|
+
this.inspectOpts.colors = this.useColors;
|
|
5662
|
+
return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
|
|
5663
|
+
};
|
|
5664
|
+
formatters.O = function(v) {
|
|
5665
|
+
this.inspectOpts.colors = this.useColors;
|
|
5666
|
+
return util.inspect(v, this.inspectOpts);
|
|
5667
|
+
};
|
|
5668
|
+
}
|
|
5669
|
+
});
|
|
5670
|
+
|
|
5671
|
+
// ../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js
|
|
5672
|
+
var require_src = __commonJS({
|
|
5673
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"(exports2, module2) {
|
|
5674
|
+
"use strict";
|
|
5675
|
+
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
5676
|
+
module2.exports = require_browser();
|
|
5677
|
+
} else {
|
|
5678
|
+
module2.exports = require_node();
|
|
5679
|
+
}
|
|
5680
|
+
}
|
|
5681
|
+
});
|
|
5682
|
+
|
|
5683
|
+
// ../../node_modules/.pnpm/@kwsites+file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/src/index.js
|
|
5684
|
+
var require_src2 = __commonJS({
|
|
5685
|
+
"../../node_modules/.pnpm/@kwsites+file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/src/index.js"(exports2) {
|
|
5686
|
+
"use strict";
|
|
5687
|
+
var __importDefault = exports2 && exports2.__importDefault || function(mod) {
|
|
5688
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
5689
|
+
};
|
|
5690
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
5691
|
+
var fs_1 = require("fs");
|
|
5692
|
+
var debug_1 = __importDefault(require_src());
|
|
5693
|
+
var log = debug_1.default("@kwsites/file-exists");
|
|
5694
|
+
function check(path4, isFile, isDirectory) {
|
|
5695
|
+
log(`checking %s`, path4);
|
|
5696
|
+
try {
|
|
5697
|
+
const stat = fs_1.statSync(path4);
|
|
5698
|
+
if (stat.isFile() && isFile) {
|
|
5699
|
+
log(`[OK] path represents a file`);
|
|
5700
|
+
return true;
|
|
5701
|
+
}
|
|
5702
|
+
if (stat.isDirectory() && isDirectory) {
|
|
5703
|
+
log(`[OK] path represents a directory`);
|
|
5704
|
+
return true;
|
|
5705
|
+
}
|
|
5706
|
+
log(`[FAIL] path represents something other than a file or directory`);
|
|
5707
|
+
return false;
|
|
5708
|
+
} catch (e) {
|
|
5709
|
+
if (e.code === "ENOENT") {
|
|
5710
|
+
log(`[FAIL] path is not accessible: %o`, e);
|
|
5711
|
+
return false;
|
|
5712
|
+
}
|
|
5713
|
+
log(`[FATAL] %o`, e);
|
|
5714
|
+
throw e;
|
|
5715
|
+
}
|
|
5716
|
+
}
|
|
5717
|
+
function exists2(path4, type = exports2.READABLE) {
|
|
5718
|
+
return check(path4, (type & exports2.FILE) > 0, (type & exports2.FOLDER) > 0);
|
|
5719
|
+
}
|
|
5720
|
+
exports2.exists = exists2;
|
|
5721
|
+
exports2.FILE = 1;
|
|
5722
|
+
exports2.FOLDER = 2;
|
|
5723
|
+
exports2.READABLE = exports2.FILE + exports2.FOLDER;
|
|
5724
|
+
}
|
|
5725
|
+
});
|
|
5726
|
+
|
|
5727
|
+
// ../../node_modules/.pnpm/@kwsites+file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/index.js
|
|
5728
|
+
var require_dist = __commonJS({
|
|
5729
|
+
"../../node_modules/.pnpm/@kwsites+file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/index.js"(exports2) {
|
|
5730
|
+
"use strict";
|
|
5731
|
+
function __export3(m) {
|
|
5732
|
+
for (var p in m) if (!exports2.hasOwnProperty(p)) exports2[p] = m[p];
|
|
5733
|
+
}
|
|
5734
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
5735
|
+
__export3(require_src2());
|
|
5736
|
+
}
|
|
5737
|
+
});
|
|
5738
|
+
|
|
4921
5739
|
// ../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js
|
|
4922
|
-
var
|
|
5740
|
+
var require_ms2 = __commonJS({
|
|
4923
5741
|
"../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js"(exports2, module2) {
|
|
4924
5742
|
"use strict";
|
|
4925
5743
|
var s = 1e3;
|
|
@@ -5036,7 +5854,7 @@ var require_ms = __commonJS({
|
|
|
5036
5854
|
});
|
|
5037
5855
|
|
|
5038
5856
|
// ../../node_modules/.pnpm/debug@4.3.4_supports-color@5.5.0/node_modules/debug/src/common.js
|
|
5039
|
-
var
|
|
5857
|
+
var require_common2 = __commonJS({
|
|
5040
5858
|
"../../node_modules/.pnpm/debug@4.3.4_supports-color@5.5.0/node_modules/debug/src/common.js"(exports2, module2) {
|
|
5041
5859
|
"use strict";
|
|
5042
5860
|
function setup(env2) {
|
|
@@ -5046,7 +5864,7 @@ var require_common = __commonJS({
|
|
|
5046
5864
|
createDebug.disable = disable;
|
|
5047
5865
|
createDebug.enable = enable;
|
|
5048
5866
|
createDebug.enabled = enabled;
|
|
5049
|
-
createDebug.humanize =
|
|
5867
|
+
createDebug.humanize = require_ms2();
|
|
5050
5868
|
createDebug.destroy = destroy;
|
|
5051
5869
|
Object.keys(env2).forEach((key) => {
|
|
5052
5870
|
createDebug[key] = env2[key];
|
|
@@ -5200,7 +6018,7 @@ var require_common = __commonJS({
|
|
|
5200
6018
|
});
|
|
5201
6019
|
|
|
5202
6020
|
// ../../node_modules/.pnpm/debug@4.3.4_supports-color@5.5.0/node_modules/debug/src/browser.js
|
|
5203
|
-
var
|
|
6021
|
+
var require_browser2 = __commonJS({
|
|
5204
6022
|
"../../node_modules/.pnpm/debug@4.3.4_supports-color@5.5.0/node_modules/debug/src/browser.js"(exports2, module2) {
|
|
5205
6023
|
"use strict";
|
|
5206
6024
|
exports2.formatArgs = formatArgs;
|
|
@@ -5357,7 +6175,7 @@ var require_browser = __commonJS({
|
|
|
5357
6175
|
} catch (error) {
|
|
5358
6176
|
}
|
|
5359
6177
|
}
|
|
5360
|
-
module2.exports =
|
|
6178
|
+
module2.exports = require_common2()(exports2);
|
|
5361
6179
|
var { formatters } = module2.exports;
|
|
5362
6180
|
formatters.j = function(v) {
|
|
5363
6181
|
try {
|
|
@@ -5369,117 +6187,8 @@ var require_browser = __commonJS({
|
|
|
5369
6187
|
}
|
|
5370
6188
|
});
|
|
5371
6189
|
|
|
5372
|
-
// ../../node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js
|
|
5373
|
-
var require_has_flag = __commonJS({
|
|
5374
|
-
"../../node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js"(exports2, module2) {
|
|
5375
|
-
"use strict";
|
|
5376
|
-
module2.exports = (flag, argv) => {
|
|
5377
|
-
argv = argv || process.argv;
|
|
5378
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
5379
|
-
const pos = argv.indexOf(prefix + flag);
|
|
5380
|
-
const terminatorPos = argv.indexOf("--");
|
|
5381
|
-
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
5382
|
-
};
|
|
5383
|
-
}
|
|
5384
|
-
});
|
|
5385
|
-
|
|
5386
|
-
// ../../node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js
|
|
5387
|
-
var require_supports_color = __commonJS({
|
|
5388
|
-
"../../node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js"(exports2, module2) {
|
|
5389
|
-
"use strict";
|
|
5390
|
-
var os = require("os");
|
|
5391
|
-
var hasFlag = require_has_flag();
|
|
5392
|
-
var env2 = process.env;
|
|
5393
|
-
var forceColor;
|
|
5394
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
|
|
5395
|
-
forceColor = false;
|
|
5396
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
5397
|
-
forceColor = true;
|
|
5398
|
-
}
|
|
5399
|
-
if ("FORCE_COLOR" in env2) {
|
|
5400
|
-
forceColor = env2.FORCE_COLOR.length === 0 || parseInt(env2.FORCE_COLOR, 10) !== 0;
|
|
5401
|
-
}
|
|
5402
|
-
function translateLevel(level) {
|
|
5403
|
-
if (level === 0) {
|
|
5404
|
-
return false;
|
|
5405
|
-
}
|
|
5406
|
-
return {
|
|
5407
|
-
level,
|
|
5408
|
-
hasBasic: true,
|
|
5409
|
-
has256: level >= 2,
|
|
5410
|
-
has16m: level >= 3
|
|
5411
|
-
};
|
|
5412
|
-
}
|
|
5413
|
-
function supportsColor(stream) {
|
|
5414
|
-
if (forceColor === false) {
|
|
5415
|
-
return 0;
|
|
5416
|
-
}
|
|
5417
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
5418
|
-
return 3;
|
|
5419
|
-
}
|
|
5420
|
-
if (hasFlag("color=256")) {
|
|
5421
|
-
return 2;
|
|
5422
|
-
}
|
|
5423
|
-
if (stream && !stream.isTTY && forceColor !== true) {
|
|
5424
|
-
return 0;
|
|
5425
|
-
}
|
|
5426
|
-
const min = forceColor ? 1 : 0;
|
|
5427
|
-
if (process.platform === "win32") {
|
|
5428
|
-
const osRelease = os.release().split(".");
|
|
5429
|
-
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
5430
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
5431
|
-
}
|
|
5432
|
-
return 1;
|
|
5433
|
-
}
|
|
5434
|
-
if ("CI" in env2) {
|
|
5435
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
|
|
5436
|
-
return 1;
|
|
5437
|
-
}
|
|
5438
|
-
return min;
|
|
5439
|
-
}
|
|
5440
|
-
if ("TEAMCITY_VERSION" in env2) {
|
|
5441
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
|
|
5442
|
-
}
|
|
5443
|
-
if (env2.COLORTERM === "truecolor") {
|
|
5444
|
-
return 3;
|
|
5445
|
-
}
|
|
5446
|
-
if ("TERM_PROGRAM" in env2) {
|
|
5447
|
-
const version = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
5448
|
-
switch (env2.TERM_PROGRAM) {
|
|
5449
|
-
case "iTerm.app":
|
|
5450
|
-
return version >= 3 ? 3 : 2;
|
|
5451
|
-
case "Apple_Terminal":
|
|
5452
|
-
return 2;
|
|
5453
|
-
}
|
|
5454
|
-
}
|
|
5455
|
-
if (/-256(color)?$/i.test(env2.TERM)) {
|
|
5456
|
-
return 2;
|
|
5457
|
-
}
|
|
5458
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
|
|
5459
|
-
return 1;
|
|
5460
|
-
}
|
|
5461
|
-
if ("COLORTERM" in env2) {
|
|
5462
|
-
return 1;
|
|
5463
|
-
}
|
|
5464
|
-
if (env2.TERM === "dumb") {
|
|
5465
|
-
return min;
|
|
5466
|
-
}
|
|
5467
|
-
return min;
|
|
5468
|
-
}
|
|
5469
|
-
function getSupportLevel(stream) {
|
|
5470
|
-
const level = supportsColor(stream);
|
|
5471
|
-
return translateLevel(level);
|
|
5472
|
-
}
|
|
5473
|
-
module2.exports = {
|
|
5474
|
-
supportsColor: getSupportLevel,
|
|
5475
|
-
stdout: getSupportLevel(process.stdout),
|
|
5476
|
-
stderr: getSupportLevel(process.stderr)
|
|
5477
|
-
};
|
|
5478
|
-
}
|
|
5479
|
-
});
|
|
5480
|
-
|
|
5481
6190
|
// ../../node_modules/.pnpm/debug@4.3.4_supports-color@5.5.0/node_modules/debug/src/node.js
|
|
5482
|
-
var
|
|
6191
|
+
var require_node2 = __commonJS({
|
|
5483
6192
|
"../../node_modules/.pnpm/debug@4.3.4_supports-color@5.5.0/node_modules/debug/src/node.js"(exports2, module2) {
|
|
5484
6193
|
"use strict";
|
|
5485
6194
|
var tty = require("tty");
|
|
@@ -5640,7 +6349,7 @@ var require_node = __commonJS({
|
|
|
5640
6349
|
debug2.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
|
|
5641
6350
|
}
|
|
5642
6351
|
}
|
|
5643
|
-
module2.exports =
|
|
6352
|
+
module2.exports = require_common2()(exports2);
|
|
5644
6353
|
var { formatters } = module2.exports;
|
|
5645
6354
|
formatters.o = function(v) {
|
|
5646
6355
|
this.inspectOpts.colors = this.useColors;
|
|
@@ -5654,73 +6363,17 @@ var require_node = __commonJS({
|
|
|
5654
6363
|
});
|
|
5655
6364
|
|
|
5656
6365
|
// ../../node_modules/.pnpm/debug@4.3.4_supports-color@5.5.0/node_modules/debug/src/index.js
|
|
5657
|
-
var
|
|
6366
|
+
var require_src3 = __commonJS({
|
|
5658
6367
|
"../../node_modules/.pnpm/debug@4.3.4_supports-color@5.5.0/node_modules/debug/src/index.js"(exports2, module2) {
|
|
5659
6368
|
"use strict";
|
|
5660
6369
|
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
5661
|
-
module2.exports =
|
|
6370
|
+
module2.exports = require_browser2();
|
|
5662
6371
|
} else {
|
|
5663
|
-
module2.exports =
|
|
6372
|
+
module2.exports = require_node2();
|
|
5664
6373
|
}
|
|
5665
6374
|
}
|
|
5666
6375
|
});
|
|
5667
6376
|
|
|
5668
|
-
// ../../node_modules/.pnpm/@kwsites+file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/src/index.js
|
|
5669
|
-
var require_src2 = __commonJS({
|
|
5670
|
-
"../../node_modules/.pnpm/@kwsites+file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/src/index.js"(exports2) {
|
|
5671
|
-
"use strict";
|
|
5672
|
-
var __importDefault = exports2 && exports2.__importDefault || function(mod) {
|
|
5673
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
5674
|
-
};
|
|
5675
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
5676
|
-
var fs_1 = require("fs");
|
|
5677
|
-
var debug_1 = __importDefault(require_src());
|
|
5678
|
-
var log = debug_1.default("@kwsites/file-exists");
|
|
5679
|
-
function check(path4, isFile, isDirectory) {
|
|
5680
|
-
log(`checking %s`, path4);
|
|
5681
|
-
try {
|
|
5682
|
-
const stat = fs_1.statSync(path4);
|
|
5683
|
-
if (stat.isFile() && isFile) {
|
|
5684
|
-
log(`[OK] path represents a file`);
|
|
5685
|
-
return true;
|
|
5686
|
-
}
|
|
5687
|
-
if (stat.isDirectory() && isDirectory) {
|
|
5688
|
-
log(`[OK] path represents a directory`);
|
|
5689
|
-
return true;
|
|
5690
|
-
}
|
|
5691
|
-
log(`[FAIL] path represents something other than a file or directory`);
|
|
5692
|
-
return false;
|
|
5693
|
-
} catch (e) {
|
|
5694
|
-
if (e.code === "ENOENT") {
|
|
5695
|
-
log(`[FAIL] path is not accessible: %o`, e);
|
|
5696
|
-
return false;
|
|
5697
|
-
}
|
|
5698
|
-
log(`[FATAL] %o`, e);
|
|
5699
|
-
throw e;
|
|
5700
|
-
}
|
|
5701
|
-
}
|
|
5702
|
-
function exists2(path4, type = exports2.READABLE) {
|
|
5703
|
-
return check(path4, (type & exports2.FILE) > 0, (type & exports2.FOLDER) > 0);
|
|
5704
|
-
}
|
|
5705
|
-
exports2.exists = exists2;
|
|
5706
|
-
exports2.FILE = 1;
|
|
5707
|
-
exports2.FOLDER = 2;
|
|
5708
|
-
exports2.READABLE = exports2.FILE + exports2.FOLDER;
|
|
5709
|
-
}
|
|
5710
|
-
});
|
|
5711
|
-
|
|
5712
|
-
// ../../node_modules/.pnpm/@kwsites+file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/index.js
|
|
5713
|
-
var require_dist = __commonJS({
|
|
5714
|
-
"../../node_modules/.pnpm/@kwsites+file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/index.js"(exports2) {
|
|
5715
|
-
"use strict";
|
|
5716
|
-
function __export3(m) {
|
|
5717
|
-
for (var p in m) if (!exports2.hasOwnProperty(p)) exports2[p] = m[p];
|
|
5718
|
-
}
|
|
5719
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
5720
|
-
__export3(require_src2());
|
|
5721
|
-
}
|
|
5722
|
-
});
|
|
5723
|
-
|
|
5724
6377
|
// ../../node_modules/.pnpm/@kwsites+promise-deferred@1.1.1/node_modules/@kwsites/promise-deferred/dist/index.js
|
|
5725
6378
|
var require_dist2 = __commonJS({
|
|
5726
6379
|
"../../node_modules/.pnpm/@kwsites+promise-deferred@1.1.1/node_modules/@kwsites/promise-deferred/dist/index.js"(exports2) {
|
|
@@ -5765,7 +6418,7 @@ var require_dist2 = __commonJS({
|
|
|
5765
6418
|
|
|
5766
6419
|
// src/cli.ts
|
|
5767
6420
|
var import_fs5 = __toESM(require("fs"), 1);
|
|
5768
|
-
var
|
|
6421
|
+
var import_promises6 = require("fs/promises");
|
|
5769
6422
|
var import_path7 = __toESM(require("path"), 1);
|
|
5770
6423
|
|
|
5771
6424
|
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yerror.js
|
|
@@ -7074,7 +7727,7 @@ function ui(opts) {
|
|
|
7074
7727
|
});
|
|
7075
7728
|
}
|
|
7076
7729
|
|
|
7077
|
-
// ../../node_modules/.pnpm/escalade@3.
|
|
7730
|
+
// ../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.mjs
|
|
7078
7731
|
var import_path2 = require("path");
|
|
7079
7732
|
var import_fs2 = require("fs");
|
|
7080
7733
|
function sync_default(start, callback) {
|
|
@@ -7376,30 +8029,36 @@ function resolve5(...paths) {
|
|
|
7376
8029
|
return import_path5.default.resolve(...paths);
|
|
7377
8030
|
}
|
|
7378
8031
|
|
|
7379
|
-
// src/configuration/
|
|
8032
|
+
// src/configuration/loadGitHubConfig.ts
|
|
7380
8033
|
var import_promises2 = require("fs/promises");
|
|
7381
|
-
async function
|
|
8034
|
+
async function loadGitHubConfig({
|
|
7382
8035
|
absolutePathToConfig
|
|
7383
8036
|
}) {
|
|
7384
8037
|
const rawContents = await (0, import_promises2.readFile)(absolutePathToConfig, "utf8");
|
|
7385
8038
|
return JSON.parse(rawContents);
|
|
7386
8039
|
}
|
|
7387
8040
|
|
|
7388
|
-
// src/configuration/
|
|
8041
|
+
// src/configuration/loadReadmeConfig.ts
|
|
7389
8042
|
var import_promises3 = require("fs/promises");
|
|
7390
|
-
async function
|
|
8043
|
+
async function loadReadmeConfig({
|
|
7391
8044
|
absolutePathToConfig
|
|
7392
8045
|
}) {
|
|
7393
8046
|
const rawContents = await (0, import_promises3.readFile)(absolutePathToConfig, "utf8");
|
|
7394
8047
|
return JSON.parse(rawContents);
|
|
7395
8048
|
}
|
|
7396
8049
|
|
|
7397
|
-
// src/
|
|
7398
|
-
var
|
|
8050
|
+
// src/configuration/loadReferenceConfig.ts
|
|
8051
|
+
var import_promises4 = require("fs/promises");
|
|
8052
|
+
async function loadReferenceConfig({
|
|
8053
|
+
absolutePathToConfig
|
|
8054
|
+
}) {
|
|
8055
|
+
const rawContents = await (0, import_promises4.readFile)(absolutePathToConfig, "utf8");
|
|
8056
|
+
return JSON.parse(rawContents);
|
|
8057
|
+
}
|
|
7399
8058
|
|
|
7400
8059
|
// ../../node_modules/.pnpm/simple-git@3.24.0/node_modules/simple-git/dist/esm/index.js
|
|
7401
8060
|
var import_file_exists = __toESM(require_dist(), 1);
|
|
7402
|
-
var import_debug = __toESM(
|
|
8061
|
+
var import_debug = __toESM(require_src3(), 1);
|
|
7403
8062
|
var import_child_process = require("child_process");
|
|
7404
8063
|
var import_promise_deferred = __toESM(require_dist2(), 1);
|
|
7405
8064
|
var import_promise_deferred2 = __toESM(require_dist2(), 1);
|
|
@@ -7445,7 +8104,7 @@ var __copyProps2 = (to, from, except, desc) => {
|
|
|
7445
8104
|
};
|
|
7446
8105
|
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
7447
8106
|
var __async = (__this, __arguments, generator) => {
|
|
7448
|
-
return new Promise((
|
|
8107
|
+
return new Promise((resolve7, reject) => {
|
|
7449
8108
|
var fulfilled = (value) => {
|
|
7450
8109
|
try {
|
|
7451
8110
|
step(generator.next(value));
|
|
@@ -7460,7 +8119,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
7460
8119
|
reject(e);
|
|
7461
8120
|
}
|
|
7462
8121
|
};
|
|
7463
|
-
var step = (x) => x.done ?
|
|
8122
|
+
var step = (x) => x.done ? resolve7(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
7464
8123
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
7465
8124
|
});
|
|
7466
8125
|
};
|
|
@@ -11900,44 +12559,99 @@ function gitInstanceFactory(baseDir, options) {
|
|
|
11900
12559
|
init_git_response_error();
|
|
11901
12560
|
var esm_default2 = gitInstanceFactory;
|
|
11902
12561
|
|
|
11903
|
-
//
|
|
12562
|
+
// ../commons/github/dist/cloneRepository.js
|
|
11904
12563
|
var import_tmp_promise = __toESM(require_tmp_promise(), 1);
|
|
11905
12564
|
|
|
11906
|
-
//
|
|
11907
|
-
var
|
|
12565
|
+
// ../commons/github/dist/ClonedRepository.js
|
|
12566
|
+
var import_promises5 = require("fs/promises");
|
|
11908
12567
|
var import_path6 = __toESM(require("path"), 1);
|
|
11909
12568
|
|
|
11910
|
-
//
|
|
12569
|
+
// ../commons/github/dist/constants.js
|
|
11911
12570
|
var DEFAULT_REMOTE = "github.com";
|
|
11912
12571
|
var README_FILEPATH = "README.md";
|
|
11913
12572
|
|
|
11914
|
-
//
|
|
12573
|
+
// ../commons/github/dist/ClonedRepository.js
|
|
11915
12574
|
var ClonedRepository = class {
|
|
11916
12575
|
clonePath;
|
|
11917
|
-
|
|
12576
|
+
git;
|
|
12577
|
+
constructor({ clonePath, git }) {
|
|
11918
12578
|
this.clonePath = clonePath;
|
|
12579
|
+
this.git = git;
|
|
12580
|
+
}
|
|
12581
|
+
async getDefaultBranch() {
|
|
12582
|
+
await this.git.cwd(this.clonePath);
|
|
12583
|
+
const remoteInfo = await this.git.remote(["show", "origin"]);
|
|
12584
|
+
if (remoteInfo == null) {
|
|
12585
|
+
throw new Error("Could not determine default branch");
|
|
12586
|
+
}
|
|
12587
|
+
const match = remoteInfo.match(/HEAD branch: (.+)/);
|
|
12588
|
+
if (!match?.[1]) {
|
|
12589
|
+
throw new Error("Could not determine default branch");
|
|
12590
|
+
}
|
|
12591
|
+
return match[1].trim();
|
|
11919
12592
|
}
|
|
11920
12593
|
async getReadme() {
|
|
11921
12594
|
return await this.readFile({ relativeFilePath: README_FILEPATH });
|
|
11922
12595
|
}
|
|
12596
|
+
async add(files) {
|
|
12597
|
+
await this.git.cwd(this.clonePath);
|
|
12598
|
+
await this.git.add(files);
|
|
12599
|
+
}
|
|
12600
|
+
async commit(message) {
|
|
12601
|
+
await this.git.cwd(this.clonePath);
|
|
12602
|
+
await this.git.commit(message ?? `Automated commit message at ${(/* @__PURE__ */ new Date()).toISOString()}`);
|
|
12603
|
+
}
|
|
12604
|
+
async checkout(branch) {
|
|
12605
|
+
await this.git.cwd(this.clonePath);
|
|
12606
|
+
try {
|
|
12607
|
+
await this.git.checkout(branch);
|
|
12608
|
+
} catch (_error) {
|
|
12609
|
+
await this.git.checkoutLocalBranch(branch);
|
|
12610
|
+
await this.git.push("origin", branch, { "--set-upstream": null });
|
|
12611
|
+
}
|
|
12612
|
+
}
|
|
12613
|
+
async pull(branch) {
|
|
12614
|
+
await this.git.cwd(this.clonePath);
|
|
12615
|
+
await this.git.pull("origin", branch);
|
|
12616
|
+
}
|
|
12617
|
+
async push() {
|
|
12618
|
+
await this.git.cwd(this.clonePath);
|
|
12619
|
+
await this.git.push();
|
|
12620
|
+
}
|
|
12621
|
+
async overwriteLocalContents(sourceDirectoryPath) {
|
|
12622
|
+
const [sourceContents, destContents] = await Promise.all([
|
|
12623
|
+
(0, import_promises5.readdir)(sourceDirectoryPath),
|
|
12624
|
+
(0, import_promises5.readdir)(this.clonePath)
|
|
12625
|
+
]);
|
|
12626
|
+
await Promise.all(destContents.filter((content) => content !== ".git").map(async (content) => {
|
|
12627
|
+
await (0, import_promises5.rm)((0, import_path6.resolve)(this.clonePath, content), {
|
|
12628
|
+
recursive: true,
|
|
12629
|
+
force: true
|
|
12630
|
+
});
|
|
12631
|
+
}));
|
|
12632
|
+
await Promise.all(sourceContents.filter((content) => content !== ".git").map(async (content) => {
|
|
12633
|
+
const path4 = (0, import_path6.resolve)(sourceDirectoryPath, content);
|
|
12634
|
+
await (0, import_promises5.cp)(path4, (0, import_path6.resolve)(this.clonePath, content), { recursive: true });
|
|
12635
|
+
}));
|
|
12636
|
+
}
|
|
11923
12637
|
async readFile({ relativeFilePath }) {
|
|
11924
12638
|
const absoluteFilePath = import_path6.default.join(this.clonePath, relativeFilePath);
|
|
11925
12639
|
if (!await doesPathExist2(absoluteFilePath)) {
|
|
11926
12640
|
return void 0;
|
|
11927
12641
|
}
|
|
11928
|
-
return await (0,
|
|
12642
|
+
return await (0, import_promises5.readFile)(absoluteFilePath, "utf-8");
|
|
11929
12643
|
}
|
|
11930
12644
|
};
|
|
11931
12645
|
async function doesPathExist2(filepath) {
|
|
11932
12646
|
try {
|
|
11933
|
-
await (0,
|
|
12647
|
+
await (0, import_promises5.lstat)(filepath);
|
|
11934
12648
|
return true;
|
|
11935
12649
|
} catch {
|
|
11936
12650
|
return false;
|
|
11937
12651
|
}
|
|
11938
12652
|
}
|
|
11939
12653
|
|
|
11940
|
-
//
|
|
12654
|
+
// ../commons/github/dist/parseRepository.js
|
|
11941
12655
|
function parseRepository(githubRepository) {
|
|
11942
12656
|
const remote = DEFAULT_REMOTE;
|
|
11943
12657
|
let owner;
|
|
@@ -11979,7 +12693,7 @@ function getCloneUrl({ remote, owner, repo }) {
|
|
|
11979
12693
|
return `https://${remote}/${owner}/${repo}.git`;
|
|
11980
12694
|
}
|
|
11981
12695
|
|
|
11982
|
-
//
|
|
12696
|
+
// ../commons/github/dist/cloneRepository.js
|
|
11983
12697
|
async function cloneRepository({ githubRepository, installationToken }) {
|
|
11984
12698
|
const repositoryReference = parseRepository(githubRepository);
|
|
11985
12699
|
const cloneUrl = installationToken != null ? repositoryReference.getAuthedCloneUrl(installationToken) : repositoryReference.cloneUrl;
|
|
@@ -11988,10 +12702,50 @@ async function cloneRepository({ githubRepository, installationToken }) {
|
|
|
11988
12702
|
const git = esm_default2(clonePath);
|
|
11989
12703
|
await git.clone(cloneUrl, ".");
|
|
11990
12704
|
return new ClonedRepository({
|
|
11991
|
-
clonePath
|
|
12705
|
+
clonePath,
|
|
12706
|
+
git
|
|
11992
12707
|
});
|
|
11993
12708
|
}
|
|
11994
12709
|
|
|
12710
|
+
// src/github/GitHub.ts
|
|
12711
|
+
var GitHub = class {
|
|
12712
|
+
githubConfig;
|
|
12713
|
+
constructor({
|
|
12714
|
+
githubConfig
|
|
12715
|
+
}) {
|
|
12716
|
+
this.githubConfig = githubConfig;
|
|
12717
|
+
}
|
|
12718
|
+
async push() {
|
|
12719
|
+
try {
|
|
12720
|
+
const wd = cwd();
|
|
12721
|
+
const sourceDirectory = resolve5(wd, this.githubConfig.sourceDirectory);
|
|
12722
|
+
const repository = await cloneRepository({
|
|
12723
|
+
githubRepository: this.githubConfig.uri,
|
|
12724
|
+
installationToken: this.githubConfig.token
|
|
12725
|
+
});
|
|
12726
|
+
const branch = this.githubConfig.branch ?? await repository.getDefaultBranch();
|
|
12727
|
+
await repository.checkout(branch);
|
|
12728
|
+
await repository.pull(branch);
|
|
12729
|
+
await repository.overwriteLocalContents(sourceDirectory);
|
|
12730
|
+
await repository.add(".");
|
|
12731
|
+
await repository.commit();
|
|
12732
|
+
await repository.push();
|
|
12733
|
+
} catch (error) {
|
|
12734
|
+
console.error(error);
|
|
12735
|
+
throw error;
|
|
12736
|
+
}
|
|
12737
|
+
}
|
|
12738
|
+
async pr() {
|
|
12739
|
+
console.log("TODO: Implement PR");
|
|
12740
|
+
}
|
|
12741
|
+
async release() {
|
|
12742
|
+
console.log("TODO: Implement release");
|
|
12743
|
+
}
|
|
12744
|
+
};
|
|
12745
|
+
|
|
12746
|
+
// src/readme/ReadmeGenerator.ts
|
|
12747
|
+
var import_string = require("es-toolkit/string");
|
|
12748
|
+
|
|
11995
12749
|
// src/configuration/generated/api/index.ts
|
|
11996
12750
|
var api_exports = {};
|
|
11997
12751
|
__export(api_exports, {
|
|
@@ -12000,6 +12754,7 @@ __export(api_exports, {
|
|
|
12000
12754
|
Remote: () => Remote,
|
|
12001
12755
|
StructuredFeatureId: () => StructuredFeatureId,
|
|
12002
12756
|
feature: () => feature_exports,
|
|
12757
|
+
github: () => github_exports,
|
|
12003
12758
|
readme: () => readme_exports,
|
|
12004
12759
|
reference: () => reference_exports
|
|
12005
12760
|
});
|
|
@@ -12047,6 +12802,9 @@ var StructuredFeatureId = {
|
|
|
12047
12802
|
}
|
|
12048
12803
|
};
|
|
12049
12804
|
|
|
12805
|
+
// src/configuration/generated/api/resources/github/index.ts
|
|
12806
|
+
var github_exports = {};
|
|
12807
|
+
|
|
12050
12808
|
// src/configuration/generated/api/resources/readme/index.ts
|
|
12051
12809
|
var readme_exports = {};
|
|
12052
12810
|
__export(readme_exports, {
|
|
@@ -13107,7 +13865,7 @@ void yargs_default(hideBin(process.argv)).scriptName(process.env.CLI_NAME ?? "ge
|
|
|
13107
13865
|
const generator = new ReadmeGenerator({
|
|
13108
13866
|
readmeParser: new ReadmeParser(),
|
|
13109
13867
|
readmeConfig,
|
|
13110
|
-
originalReadme: argv.originalReadme != null ? await (0,
|
|
13868
|
+
originalReadme: argv.originalReadme != null ? await (0, import_promises6.readFile)(argv.originalReadme, "utf8") : void 0
|
|
13111
13869
|
});
|
|
13112
13870
|
await generator.generateReadme({
|
|
13113
13871
|
output: await createWriteStream(argv.output)
|
|
@@ -13143,13 +13901,105 @@ void yargs_default(hideBin(process.argv)).scriptName(process.env.CLI_NAME ?? "ge
|
|
|
13143
13901
|
});
|
|
13144
13902
|
process.exit(0);
|
|
13145
13903
|
}
|
|
13146
|
-
).
|
|
13904
|
+
).command("github", "GitHub operations", (yargs) => {
|
|
13905
|
+
return yargs.command(
|
|
13906
|
+
"push",
|
|
13907
|
+
"Push changes to GitHub",
|
|
13908
|
+
(subYargs) => {
|
|
13909
|
+
return subYargs.option("config", {
|
|
13910
|
+
string: true,
|
|
13911
|
+
required: true,
|
|
13912
|
+
description: "Path to configuration file"
|
|
13913
|
+
});
|
|
13914
|
+
},
|
|
13915
|
+
async (argv) => {
|
|
13916
|
+
if (argv.config == null) {
|
|
13917
|
+
process.stderr.write(
|
|
13918
|
+
"missing required arguments; please specify the --config flag\n"
|
|
13919
|
+
);
|
|
13920
|
+
process.exit(1);
|
|
13921
|
+
}
|
|
13922
|
+
const wd = cwd();
|
|
13923
|
+
const githubConfig = await loadGitHubConfig({
|
|
13924
|
+
absolutePathToConfig: resolve5(wd, argv.config)
|
|
13925
|
+
});
|
|
13926
|
+
const github = new GitHub({
|
|
13927
|
+
githubConfig
|
|
13928
|
+
});
|
|
13929
|
+
await github.push();
|
|
13930
|
+
process.exit(0);
|
|
13931
|
+
}
|
|
13932
|
+
).command(
|
|
13933
|
+
"pr",
|
|
13934
|
+
"Create a pull request on GitHub",
|
|
13935
|
+
(subYargs) => {
|
|
13936
|
+
return subYargs.option("config", {
|
|
13937
|
+
string: true,
|
|
13938
|
+
required: true,
|
|
13939
|
+
description: "Path to configuration file"
|
|
13940
|
+
});
|
|
13941
|
+
},
|
|
13942
|
+
async (argv) => {
|
|
13943
|
+
if (argv.config == null) {
|
|
13944
|
+
process.stderr.write(
|
|
13945
|
+
"missing required arguments; please specify the --config flag\n"
|
|
13946
|
+
);
|
|
13947
|
+
process.exit(1);
|
|
13948
|
+
}
|
|
13949
|
+
const wd = cwd();
|
|
13950
|
+
const githubConfig = await loadGitHubConfig({
|
|
13951
|
+
absolutePathToConfig: resolve5(wd, argv.config)
|
|
13952
|
+
});
|
|
13953
|
+
const github = new GitHub({
|
|
13954
|
+
githubConfig
|
|
13955
|
+
});
|
|
13956
|
+
await github.pr();
|
|
13957
|
+
process.stderr.write(
|
|
13958
|
+
`Creating PR on GitHub with config: ${resolve5(wd, argv.config)}
|
|
13959
|
+
`
|
|
13960
|
+
);
|
|
13961
|
+
process.exit(0);
|
|
13962
|
+
}
|
|
13963
|
+
).command(
|
|
13964
|
+
"release",
|
|
13965
|
+
"Create a release on GitHub",
|
|
13966
|
+
(subYargs) => {
|
|
13967
|
+
return subYargs.option("config", {
|
|
13968
|
+
string: true,
|
|
13969
|
+
required: true,
|
|
13970
|
+
description: "Path to configuration file"
|
|
13971
|
+
});
|
|
13972
|
+
},
|
|
13973
|
+
async (argv) => {
|
|
13974
|
+
if (argv.config == null) {
|
|
13975
|
+
process.stderr.write(
|
|
13976
|
+
"missing required arguments; please specify the --config flag\n"
|
|
13977
|
+
);
|
|
13978
|
+
const wd2 = cwd();
|
|
13979
|
+
const githubConfig = await loadGitHubConfig({
|
|
13980
|
+
absolutePathToConfig: resolve5(wd2, argv.config)
|
|
13981
|
+
});
|
|
13982
|
+
const github = new GitHub({
|
|
13983
|
+
githubConfig
|
|
13984
|
+
});
|
|
13985
|
+
await github.release();
|
|
13986
|
+
process.exit(1);
|
|
13987
|
+
}
|
|
13988
|
+
const wd = cwd();
|
|
13989
|
+
process.stderr.write(
|
|
13990
|
+
`Creating release on GitHub with config: ${resolve5(wd, argv.config)}
|
|
13991
|
+
`
|
|
13992
|
+
);
|
|
13993
|
+
process.exit(0);
|
|
13994
|
+
}
|
|
13995
|
+
).demandCommand();
|
|
13996
|
+
}).demandCommand().showHelpOnFail(true).parse();
|
|
13147
13997
|
async function createWriteStream(outputPath) {
|
|
13148
13998
|
return outputPath != null ? await createWriteStreamFromFile(resolve5(cwd(), outputPath)) : process.stdout;
|
|
13149
13999
|
}
|
|
13150
14000
|
async function createWriteStreamFromFile(filepath) {
|
|
13151
|
-
if (!doesPathExist(filepath)) {
|
|
13152
|
-
await (0,
|
|
14001
|
+
if (!await doesPathExist(filepath)) {
|
|
14002
|
+
await (0, import_promises6.mkdir)(import_path7.default.dirname(filepath), { recursive: true });
|
|
13153
14003
|
}
|
|
13154
14004
|
return import_fs5.default.createWriteStream(filepath);
|
|
13155
14005
|
}
|