prebundle 1.1.0 → 1.2.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/README.md +11 -0
- package/compiled/fast-glob/index.js +5496 -7063
- package/compiled/fs-extra/index.d.ts +1063 -1
- package/compiled/fs-extra/index.js +2114 -2780
- package/compiled/rslog/index.js +375 -404
- package/dist/compiled/fast-glob/index.d.ts +2 -0
- package/dist/compiled/fast-glob/index.js +5332 -0
- package/dist/helper.d.ts +1 -1
- package/dist/helper.js +3 -1
- package/dist/index.js +1 -1
- package/dist/prebundle.js +19 -4
- package/dist/src/constant.d.ts +8 -0
- package/dist/src/constant.js +48 -0
- package/dist/src/helper.d.ts +6 -0
- package/dist/src/helper.js +87 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +9 -0
- package/dist/src/prebundle.d.ts +2 -0
- package/dist/src/prebundle.js +197 -0
- package/dist/src/types.d.ts +50 -0
- package/dist/src/types.js +1 -0
- package/dist/types.d.ts +5 -0
- package/package.json +9 -8
package/compiled/rslog/index.js
CHANGED
|
@@ -1,410 +1,381 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
));
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const terminatorPosition = argv.indexOf("--");
|
|
74
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
75
|
-
}
|
|
76
|
-
var { env } = import_node_process.default;
|
|
77
|
-
var flagForceColor;
|
|
78
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
79
|
-
flagForceColor = 0;
|
|
80
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
81
|
-
flagForceColor = 1;
|
|
82
|
-
}
|
|
83
|
-
function envForceColor() {
|
|
84
|
-
if ("FORCE_COLOR" in env) {
|
|
85
|
-
if (env.FORCE_COLOR === "true") {
|
|
86
|
-
return 1;
|
|
87
|
-
}
|
|
88
|
-
if (env.FORCE_COLOR === "false") {
|
|
89
|
-
return 0;
|
|
90
|
-
}
|
|
91
|
-
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
function translateLevel(level) {
|
|
95
|
-
if (level === 0) {
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
level,
|
|
100
|
-
hasBasic: true,
|
|
101
|
-
has256: level >= 2,
|
|
102
|
-
has16m: level >= 3
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
106
|
-
const noFlagForceColor = envForceColor();
|
|
107
|
-
if (noFlagForceColor !== void 0) {
|
|
108
|
-
flagForceColor = noFlagForceColor;
|
|
109
|
-
}
|
|
110
|
-
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
111
|
-
if (forceColor === 0) {
|
|
112
|
-
return 0;
|
|
113
|
-
}
|
|
114
|
-
if (sniffFlags) {
|
|
115
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
116
|
-
return 3;
|
|
117
|
-
}
|
|
118
|
-
if (hasFlag("color=256")) {
|
|
119
|
-
return 2;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
123
|
-
return 1;
|
|
124
|
-
}
|
|
125
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
126
|
-
return 0;
|
|
127
|
-
}
|
|
128
|
-
const min = forceColor || 0;
|
|
129
|
-
if (env.TERM === "dumb") {
|
|
130
|
-
return min;
|
|
131
|
-
}
|
|
132
|
-
if (import_node_process.default.platform === "win32") {
|
|
133
|
-
const osRelease = import_node_os.default.release().split(".");
|
|
134
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
135
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
136
|
-
}
|
|
137
|
-
return 1;
|
|
138
|
-
}
|
|
139
|
-
if ("CI" in env) {
|
|
140
|
-
if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
|
|
141
|
-
return 3;
|
|
142
|
-
}
|
|
143
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
144
|
-
return 1;
|
|
145
|
-
}
|
|
146
|
-
return min;
|
|
147
|
-
}
|
|
148
|
-
if ("TEAMCITY_VERSION" in env) {
|
|
149
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
150
|
-
}
|
|
151
|
-
if (env.COLORTERM === "truecolor") {
|
|
152
|
-
return 3;
|
|
153
|
-
}
|
|
154
|
-
if (env.TERM === "xterm-kitty") {
|
|
155
|
-
return 3;
|
|
156
|
-
}
|
|
157
|
-
if ("TERM_PROGRAM" in env) {
|
|
158
|
-
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
159
|
-
switch (env.TERM_PROGRAM) {
|
|
160
|
-
case "iTerm.app": {
|
|
161
|
-
return version >= 3 ? 3 : 2;
|
|
1
|
+
(() => {
|
|
2
|
+
"use strict";
|
|
3
|
+
var __webpack_modules__ = {
|
|
4
|
+
37: (module1) => {
|
|
5
|
+
module1.exports = require("os");
|
|
6
|
+
},
|
|
7
|
+
282: (module1) => {
|
|
8
|
+
module1.exports = require("process");
|
|
9
|
+
},
|
|
10
|
+
224: (module1) => {
|
|
11
|
+
module1.exports = require("tty");
|
|
12
|
+
},
|
|
13
|
+
103: (module1, __unused_webpack_exports, __nccwpck_require__) => {
|
|
14
|
+
var __create = Object.create;
|
|
15
|
+
var __defProp = Object.defineProperty;
|
|
16
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
17
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
18
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
19
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
20
|
+
var __export = (target, all) => {
|
|
21
|
+
for (var name in all)
|
|
22
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
23
|
+
};
|
|
24
|
+
var __copyProps = (to, from, except, desc) => {
|
|
25
|
+
if ((from && typeof from === "object") || typeof from === "function") {
|
|
26
|
+
for (let key of __getOwnPropNames(from))
|
|
27
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
28
|
+
__defProp(to, key, {
|
|
29
|
+
get: () => from[key],
|
|
30
|
+
enumerable:
|
|
31
|
+
!(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return to;
|
|
35
|
+
};
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (
|
|
37
|
+
(target = mod != null ? __create(__getProtoOf(mod)) : {}),
|
|
38
|
+
__copyProps(
|
|
39
|
+
isNodeMode || !mod || !mod.__esModule
|
|
40
|
+
? __defProp(target, "default", { value: mod, enumerable: true })
|
|
41
|
+
: target,
|
|
42
|
+
mod,
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
var __toCommonJS = (mod) =>
|
|
46
|
+
__copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
47
|
+
var src_exports = {};
|
|
48
|
+
__export(src_exports, {
|
|
49
|
+
createLogger: () => createLogger,
|
|
50
|
+
logger: () => logger,
|
|
51
|
+
});
|
|
52
|
+
module1.exports = __toCommonJS(src_exports);
|
|
53
|
+
var import_node_process = __toESM(__nccwpck_require__(282));
|
|
54
|
+
var import_node_os = __toESM(__nccwpck_require__(37));
|
|
55
|
+
var import_node_tty = __toESM(__nccwpck_require__(224));
|
|
56
|
+
function hasFlag(
|
|
57
|
+
flag,
|
|
58
|
+
argv = globalThis.Deno
|
|
59
|
+
? globalThis.Deno.args
|
|
60
|
+
: import_node_process.default.argv,
|
|
61
|
+
) {
|
|
62
|
+
const prefix = flag.startsWith("-")
|
|
63
|
+
? ""
|
|
64
|
+
: flag.length === 1
|
|
65
|
+
? "-"
|
|
66
|
+
: "--";
|
|
67
|
+
const position = argv.indexOf(prefix + flag);
|
|
68
|
+
const terminatorPosition = argv.indexOf("--");
|
|
69
|
+
return (
|
|
70
|
+
position !== -1 &&
|
|
71
|
+
(terminatorPosition === -1 || position < terminatorPosition)
|
|
72
|
+
);
|
|
162
73
|
}
|
|
163
|
-
|
|
164
|
-
|
|
74
|
+
var { env } = import_node_process.default;
|
|
75
|
+
var flagForceColor;
|
|
76
|
+
if (
|
|
77
|
+
hasFlag("no-color") ||
|
|
78
|
+
hasFlag("no-colors") ||
|
|
79
|
+
hasFlag("color=false") ||
|
|
80
|
+
hasFlag("color=never")
|
|
81
|
+
) {
|
|
82
|
+
flagForceColor = 0;
|
|
83
|
+
} else if (
|
|
84
|
+
hasFlag("color") ||
|
|
85
|
+
hasFlag("colors") ||
|
|
86
|
+
hasFlag("color=true") ||
|
|
87
|
+
hasFlag("color=always")
|
|
88
|
+
) {
|
|
89
|
+
flagForceColor = 1;
|
|
165
90
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
return min;
|
|
178
|
-
}
|
|
179
|
-
function createSupportsColor(stream, options = {}) {
|
|
180
|
-
const level = _supportsColor(stream, {
|
|
181
|
-
streamIsTTY: stream && stream.isTTY,
|
|
182
|
-
...options
|
|
183
|
-
});
|
|
184
|
-
return translateLevel(level);
|
|
185
|
-
}
|
|
186
|
-
var supportsColor = {
|
|
187
|
-
stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }),
|
|
188
|
-
stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) })
|
|
189
|
-
};
|
|
190
|
-
var supports_color_default = supportsColor;
|
|
191
|
-
|
|
192
|
-
// src/utils.ts
|
|
193
|
-
var colorLevel = supports_color_default.stdout ? supports_color_default.stdout.level : 0;
|
|
194
|
-
var errorStackRegExp = /at\s.*:\d+:\d+[\s\)]*$/;
|
|
195
|
-
var anonymousErrorStackRegExp = /^\s*at\s.*\(<anonymous>\)$/;
|
|
196
|
-
var isErrorStackMessage = (message) => errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message);
|
|
197
|
-
|
|
198
|
-
// src/color.ts
|
|
199
|
-
var formatter = (open, close, replace = open) => colorLevel >= 2 ? (input) => {
|
|
200
|
-
let string = "" + input;
|
|
201
|
-
let index = string.indexOf(close, open.length);
|
|
202
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
203
|
-
} : String;
|
|
204
|
-
var replaceClose = (string, close, replace, index) => {
|
|
205
|
-
let start = string.substring(0, index) + replace;
|
|
206
|
-
let end = string.substring(index + close.length);
|
|
207
|
-
let nextIndex = end.indexOf(close);
|
|
208
|
-
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
|
|
209
|
-
};
|
|
210
|
-
var bold = formatter("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m");
|
|
211
|
-
var red = formatter("\x1B[31m", "\x1B[39m");
|
|
212
|
-
var green = formatter("\x1B[32m", "\x1B[39m");
|
|
213
|
-
var yellow = formatter("\x1B[33m", "\x1B[39m");
|
|
214
|
-
var magenta = formatter("\x1B[35m", "\x1B[39m");
|
|
215
|
-
var cyan = formatter("\x1B[36m", "\x1B[39m");
|
|
216
|
-
var gray = formatter("\x1B[90m", "\x1B[39m");
|
|
217
|
-
|
|
218
|
-
// src/gradient.ts
|
|
219
|
-
var startColor = [189, 255, 243];
|
|
220
|
-
var endColor = [74, 194, 154];
|
|
221
|
-
var isWord = (char) => !/[\s\n]/.test(char);
|
|
222
|
-
var gradient = (message) => {
|
|
223
|
-
if (colorLevel < 3) {
|
|
224
|
-
return colorLevel === 2 ? bold(cyan(message)) : message;
|
|
225
|
-
}
|
|
226
|
-
let chars = [...message];
|
|
227
|
-
let steps = chars.filter(isWord).length;
|
|
228
|
-
let r = startColor[0];
|
|
229
|
-
let g = startColor[1];
|
|
230
|
-
let b = startColor[2];
|
|
231
|
-
let rStep = (endColor[0] - r) / steps;
|
|
232
|
-
let gStep = (endColor[1] - g) / steps;
|
|
233
|
-
let bStep = (endColor[2] - b) / steps;
|
|
234
|
-
let output = "";
|
|
235
|
-
for (let char of chars) {
|
|
236
|
-
if (isWord(char)) {
|
|
237
|
-
r += rStep;
|
|
238
|
-
g += gStep;
|
|
239
|
-
b += bStep;
|
|
240
|
-
}
|
|
241
|
-
output += `\x1B[38;2;${Math.round(r)};${Math.round(g)};${Math.round(
|
|
242
|
-
b
|
|
243
|
-
)}m${char}\x1B[39m`;
|
|
244
|
-
}
|
|
245
|
-
return bold(output);
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
// src/constants.ts
|
|
249
|
-
var LOG_LEVEL = {
|
|
250
|
-
error: 0,
|
|
251
|
-
warn: 1,
|
|
252
|
-
info: 2,
|
|
253
|
-
log: 3,
|
|
254
|
-
verbose: 4
|
|
255
|
-
};
|
|
256
|
-
var LOG_TYPES = {
|
|
257
|
-
// Level error
|
|
258
|
-
error: {
|
|
259
|
-
label: "error",
|
|
260
|
-
level: "error",
|
|
261
|
-
color: red
|
|
262
|
-
},
|
|
263
|
-
// Level warn
|
|
264
|
-
warn: {
|
|
265
|
-
label: "warn",
|
|
266
|
-
level: "warn",
|
|
267
|
-
color: yellow
|
|
268
|
-
},
|
|
269
|
-
// Level info
|
|
270
|
-
info: {
|
|
271
|
-
label: "info",
|
|
272
|
-
level: "info",
|
|
273
|
-
color: cyan
|
|
274
|
-
},
|
|
275
|
-
start: {
|
|
276
|
-
label: "start",
|
|
277
|
-
level: "info",
|
|
278
|
-
color: cyan
|
|
279
|
-
},
|
|
280
|
-
ready: {
|
|
281
|
-
label: "ready",
|
|
282
|
-
level: "info",
|
|
283
|
-
color: green
|
|
284
|
-
},
|
|
285
|
-
success: {
|
|
286
|
-
label: "success",
|
|
287
|
-
level: "info",
|
|
288
|
-
color: green
|
|
289
|
-
},
|
|
290
|
-
// Level log
|
|
291
|
-
log: {
|
|
292
|
-
level: "log"
|
|
293
|
-
},
|
|
294
|
-
// Level debug
|
|
295
|
-
debug: {
|
|
296
|
-
label: "debug",
|
|
297
|
-
level: "verbose",
|
|
298
|
-
color: magenta
|
|
299
|
-
}
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
// src/createLogger.ts
|
|
303
|
-
var createLogger = (options = {}) => {
|
|
304
|
-
let maxLevel = options.level || "log";
|
|
305
|
-
let log = (type, message, ...args) => {
|
|
306
|
-
if (LOG_LEVEL[LOG_TYPES[type].level] > LOG_LEVEL[maxLevel]) {
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
if (message === void 0 || message === null) {
|
|
310
|
-
return console.log();
|
|
311
|
-
}
|
|
312
|
-
let logType = LOG_TYPES[type];
|
|
313
|
-
let label = "";
|
|
314
|
-
let text = "";
|
|
315
|
-
if ("label" in logType) {
|
|
316
|
-
label = (logType.label || "").padEnd(7);
|
|
317
|
-
label = bold(logType.color ? logType.color(label) : label);
|
|
318
|
-
}
|
|
319
|
-
if (message instanceof Error) {
|
|
320
|
-
if (message.stack) {
|
|
321
|
-
let [name, ...rest] = message.stack.split("\n");
|
|
322
|
-
if (name.startsWith("Error: ")) {
|
|
323
|
-
name = name.slice(7);
|
|
91
|
+
function envForceColor() {
|
|
92
|
+
if ("FORCE_COLOR" in env) {
|
|
93
|
+
if (env.FORCE_COLOR === "true") {
|
|
94
|
+
return 1;
|
|
95
|
+
}
|
|
96
|
+
if (env.FORCE_COLOR === "false") {
|
|
97
|
+
return 0;
|
|
98
|
+
}
|
|
99
|
+
return env.FORCE_COLOR.length === 0
|
|
100
|
+
? 1
|
|
101
|
+
: Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
324
102
|
}
|
|
325
|
-
text = `${name}
|
|
326
|
-
${gray(rest.join("\n"))}`;
|
|
327
|
-
} else {
|
|
328
|
-
text = message.message;
|
|
329
103
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
104
|
+
function translateLevel(level) {
|
|
105
|
+
if (level === 0) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
level,
|
|
110
|
+
hasBasic: true,
|
|
111
|
+
has256: level >= 2,
|
|
112
|
+
has16m: level >= 3,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function _supportsColor(
|
|
116
|
+
haveStream,
|
|
117
|
+
{ streamIsTTY, sniffFlags = true } = {},
|
|
118
|
+
) {
|
|
119
|
+
const noFlagForceColor = envForceColor();
|
|
120
|
+
if (noFlagForceColor !== void 0) {
|
|
121
|
+
flagForceColor = noFlagForceColor;
|
|
122
|
+
}
|
|
123
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
124
|
+
if (forceColor === 0) {
|
|
125
|
+
return 0;
|
|
126
|
+
}
|
|
127
|
+
if (sniffFlags) {
|
|
128
|
+
if (
|
|
129
|
+
hasFlag("color=16m") ||
|
|
130
|
+
hasFlag("color=full") ||
|
|
131
|
+
hasFlag("color=truecolor")
|
|
132
|
+
) {
|
|
133
|
+
return 3;
|
|
134
|
+
}
|
|
135
|
+
if (hasFlag("color=256")) {
|
|
136
|
+
return 2;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
140
|
+
return 1;
|
|
141
|
+
}
|
|
142
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
143
|
+
return 0;
|
|
144
|
+
}
|
|
145
|
+
const min = forceColor || 0;
|
|
146
|
+
if (env.TERM === "dumb") {
|
|
147
|
+
return min;
|
|
148
|
+
}
|
|
149
|
+
if (import_node_process.default.platform === "win32") {
|
|
150
|
+
const osRelease = import_node_os.default.release().split(".");
|
|
151
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
152
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
153
|
+
}
|
|
154
|
+
return 1;
|
|
155
|
+
}
|
|
156
|
+
if ("CI" in env) {
|
|
157
|
+
if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
|
|
158
|
+
return 3;
|
|
159
|
+
}
|
|
160
|
+
if (
|
|
161
|
+
[
|
|
162
|
+
"TRAVIS",
|
|
163
|
+
"CIRCLECI",
|
|
164
|
+
"APPVEYOR",
|
|
165
|
+
"GITLAB_CI",
|
|
166
|
+
"BUILDKITE",
|
|
167
|
+
"DRONE",
|
|
168
|
+
].some((sign) => sign in env) ||
|
|
169
|
+
env.CI_NAME === "codeship"
|
|
170
|
+
) {
|
|
171
|
+
return 1;
|
|
172
|
+
}
|
|
173
|
+
return min;
|
|
174
|
+
}
|
|
175
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
176
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION)
|
|
177
|
+
? 1
|
|
178
|
+
: 0;
|
|
179
|
+
}
|
|
180
|
+
if (env.COLORTERM === "truecolor") {
|
|
181
|
+
return 3;
|
|
182
|
+
}
|
|
183
|
+
if (env.TERM === "xterm-kitty") {
|
|
184
|
+
return 3;
|
|
185
|
+
}
|
|
186
|
+
if ("TERM_PROGRAM" in env) {
|
|
187
|
+
const version = Number.parseInt(
|
|
188
|
+
(env.TERM_PROGRAM_VERSION || "").split(".")[0],
|
|
189
|
+
10,
|
|
190
|
+
);
|
|
191
|
+
switch (env.TERM_PROGRAM) {
|
|
192
|
+
case "iTerm.app": {
|
|
193
|
+
return version >= 3 ? 3 : 2;
|
|
194
|
+
}
|
|
195
|
+
case "Apple_Terminal": {
|
|
196
|
+
return 2;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
201
|
+
return 2;
|
|
202
|
+
}
|
|
203
|
+
if (
|
|
204
|
+
/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(
|
|
205
|
+
env.TERM,
|
|
206
|
+
)
|
|
207
|
+
) {
|
|
208
|
+
return 1;
|
|
209
|
+
}
|
|
210
|
+
if ("COLORTERM" in env) {
|
|
211
|
+
return 1;
|
|
212
|
+
}
|
|
213
|
+
return min;
|
|
214
|
+
}
|
|
215
|
+
function createSupportsColor(stream, options = {}) {
|
|
216
|
+
const level = _supportsColor(stream, {
|
|
217
|
+
streamIsTTY: stream && stream.isTTY,
|
|
218
|
+
...options,
|
|
219
|
+
});
|
|
220
|
+
return translateLevel(level);
|
|
221
|
+
}
|
|
222
|
+
var supportsColor = {
|
|
223
|
+
stdout: createSupportsColor({
|
|
224
|
+
isTTY: import_node_tty.default.isatty(1),
|
|
225
|
+
}),
|
|
226
|
+
stderr: createSupportsColor({
|
|
227
|
+
isTTY: import_node_tty.default.isatty(2),
|
|
228
|
+
}),
|
|
229
|
+
};
|
|
230
|
+
var supports_color_default = supportsColor;
|
|
231
|
+
var colorLevel = supports_color_default.stdout
|
|
232
|
+
? supports_color_default.stdout.level
|
|
233
|
+
: 0;
|
|
234
|
+
var errorStackRegExp = /at\s.*:\d+:\d+[\s\)]*$/;
|
|
235
|
+
var anonymousErrorStackRegExp = /^\s*at\s.*\(<anonymous>\)$/;
|
|
236
|
+
var isErrorStackMessage = (message) =>
|
|
237
|
+
errorStackRegExp.test(message) ||
|
|
238
|
+
anonymousErrorStackRegExp.test(message);
|
|
239
|
+
var formatter = (open, close, replace = open) =>
|
|
240
|
+
colorLevel >= 2
|
|
241
|
+
? (input) => {
|
|
242
|
+
let string = "" + input;
|
|
243
|
+
let index = string.indexOf(close, open.length);
|
|
244
|
+
return ~index
|
|
245
|
+
? open + replaceClose(string, close, replace, index) + close
|
|
246
|
+
: open + string + close;
|
|
247
|
+
}
|
|
248
|
+
: String;
|
|
249
|
+
var replaceClose = (string, close, replace, index) => {
|
|
250
|
+
let start = string.substring(0, index) + replace;
|
|
251
|
+
let end = string.substring(index + close.length);
|
|
252
|
+
let nextIndex = end.indexOf(close);
|
|
253
|
+
return ~nextIndex
|
|
254
|
+
? start + replaceClose(end, close, replace, nextIndex)
|
|
255
|
+
: start + end;
|
|
256
|
+
};
|
|
257
|
+
var bold = formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m");
|
|
258
|
+
var red = formatter("\x1b[31m", "\x1b[39m");
|
|
259
|
+
var green = formatter("\x1b[32m", "\x1b[39m");
|
|
260
|
+
var yellow = formatter("\x1b[33m", "\x1b[39m");
|
|
261
|
+
var magenta = formatter("\x1b[35m", "\x1b[39m");
|
|
262
|
+
var cyan = formatter("\x1b[36m", "\x1b[39m");
|
|
263
|
+
var gray = formatter("\x1b[90m", "\x1b[39m");
|
|
264
|
+
var startColor = [189, 255, 243];
|
|
265
|
+
var endColor = [74, 194, 154];
|
|
266
|
+
var isWord = (char) => !/[\s\n]/.test(char);
|
|
267
|
+
var gradient = (message) => {
|
|
268
|
+
if (colorLevel < 3) {
|
|
269
|
+
return colorLevel === 2 ? bold(cyan(message)) : message;
|
|
270
|
+
}
|
|
271
|
+
let chars = [...message];
|
|
272
|
+
let steps = chars.filter(isWord).length;
|
|
273
|
+
let r = startColor[0];
|
|
274
|
+
let g = startColor[1];
|
|
275
|
+
let b = startColor[2];
|
|
276
|
+
let rStep = (endColor[0] - r) / steps;
|
|
277
|
+
let gStep = (endColor[1] - g) / steps;
|
|
278
|
+
let bStep = (endColor[2] - b) / steps;
|
|
279
|
+
let output = "";
|
|
280
|
+
for (let char of chars) {
|
|
281
|
+
if (isWord(char)) {
|
|
282
|
+
r += rStep;
|
|
283
|
+
g += gStep;
|
|
284
|
+
b += bStep;
|
|
285
|
+
}
|
|
286
|
+
output += `\x1b[38;2;${Math.round(r)};${Math.round(g)};${Math.round(b)}m${char}\x1b[39m`;
|
|
287
|
+
}
|
|
288
|
+
return bold(output);
|
|
289
|
+
};
|
|
290
|
+
var LOG_LEVEL = { error: 0, warn: 1, info: 2, log: 3, verbose: 4 };
|
|
291
|
+
var LOG_TYPES = {
|
|
292
|
+
error: { label: "error", level: "error", color: red },
|
|
293
|
+
warn: { label: "warn", level: "warn", color: yellow },
|
|
294
|
+
info: { label: "info", level: "info", color: cyan },
|
|
295
|
+
start: { label: "start", level: "info", color: cyan },
|
|
296
|
+
ready: { label: "ready", level: "info", color: green },
|
|
297
|
+
success: { label: "success", level: "info", color: green },
|
|
298
|
+
log: { level: "log" },
|
|
299
|
+
debug: { label: "debug", level: "verbose", color: magenta },
|
|
300
|
+
};
|
|
301
|
+
var createLogger = (options = {}) => {
|
|
302
|
+
let maxLevel = options.level || "log";
|
|
303
|
+
let log = (type, message, ...args) => {
|
|
304
|
+
if (LOG_LEVEL[LOG_TYPES[type].level] > LOG_LEVEL[maxLevel]) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
if (message === void 0 || message === null) {
|
|
308
|
+
return console.log();
|
|
309
|
+
}
|
|
310
|
+
let logType = LOG_TYPES[type];
|
|
311
|
+
let label = "";
|
|
312
|
+
let text = "";
|
|
313
|
+
if ("label" in logType) {
|
|
314
|
+
label = (logType.label || "").padEnd(7);
|
|
315
|
+
label = bold(logType.color ? logType.color(label) : label);
|
|
316
|
+
}
|
|
317
|
+
if (message instanceof Error) {
|
|
318
|
+
if (message.stack) {
|
|
319
|
+
let [name, ...rest] = message.stack.split("\n");
|
|
320
|
+
if (name.startsWith("Error: ")) {
|
|
321
|
+
name = name.slice(7);
|
|
322
|
+
}
|
|
323
|
+
text = `${name}
|
|
324
|
+
${gray(rest.join("\n"))}`;
|
|
325
|
+
} else {
|
|
326
|
+
text = message.message;
|
|
327
|
+
}
|
|
328
|
+
} else if (logType.level === "error" && typeof message === "string") {
|
|
329
|
+
let lines = message.split("\n");
|
|
330
|
+
text = lines
|
|
331
|
+
.map((line) => (isErrorStackMessage(line) ? gray(line) : line))
|
|
332
|
+
.join("\n");
|
|
333
|
+
} else {
|
|
334
|
+
text = `${message}`;
|
|
335
|
+
}
|
|
336
|
+
console.log(label.length ? `${label} ${text}` : text, ...args);
|
|
337
|
+
};
|
|
338
|
+
let logger2 = { greet: (message) => log("log", gradient(message)) };
|
|
339
|
+
Object.keys(LOG_TYPES).forEach((key) => {
|
|
340
|
+
logger2[key] = (...args) => log(key, ...args);
|
|
341
|
+
});
|
|
342
|
+
Object.defineProperty(logger2, "level", {
|
|
343
|
+
get: () => maxLevel,
|
|
344
|
+
set(val) {
|
|
345
|
+
maxLevel = val;
|
|
346
|
+
},
|
|
347
|
+
});
|
|
348
|
+
logger2.override = (customLogger) => {
|
|
349
|
+
Object.assign(logger2, customLogger);
|
|
350
|
+
};
|
|
351
|
+
return logger2;
|
|
352
|
+
};
|
|
353
|
+
var logger = createLogger();
|
|
354
|
+
0 && 0;
|
|
355
|
+
},
|
|
340
356
|
};
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
set(val) {
|
|
347
|
-
maxLevel = val;
|
|
357
|
+
var __webpack_module_cache__ = {};
|
|
358
|
+
function __nccwpck_require__(moduleId) {
|
|
359
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
360
|
+
if (cachedModule !== undefined) {
|
|
361
|
+
return cachedModule.exports;
|
|
348
362
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
/******/
|
|
369
|
-
/******/ // The require function
|
|
370
|
-
/******/ function __nccwpck_require__(moduleId) {
|
|
371
|
-
/******/ // Check if module is in cache
|
|
372
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
373
|
-
/******/ if (cachedModule !== undefined) {
|
|
374
|
-
/******/ return cachedModule.exports;
|
|
375
|
-
/******/ }
|
|
376
|
-
/******/ // Create a new module (and put it into the cache)
|
|
377
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
378
|
-
/******/ // no module.id needed
|
|
379
|
-
/******/ // no module.loaded needed
|
|
380
|
-
/******/ exports: {}
|
|
381
|
-
/******/ };
|
|
382
|
-
/******/
|
|
383
|
-
/******/ // Execute the module function
|
|
384
|
-
/******/ var threw = true;
|
|
385
|
-
/******/ try {
|
|
386
|
-
/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
|
|
387
|
-
/******/ threw = false;
|
|
388
|
-
/******/ } finally {
|
|
389
|
-
/******/ if(threw) delete __webpack_module_cache__[moduleId];
|
|
390
|
-
/******/ }
|
|
391
|
-
/******/
|
|
392
|
-
/******/ // Return the exports of the module
|
|
393
|
-
/******/ return module.exports;
|
|
394
|
-
/******/ }
|
|
395
|
-
/******/
|
|
396
|
-
/************************************************************************/
|
|
397
|
-
/******/ /* webpack/runtime/compat */
|
|
398
|
-
/******/
|
|
399
|
-
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
|
400
|
-
/******/
|
|
401
|
-
/************************************************************************/
|
|
402
|
-
/******/
|
|
403
|
-
/******/ // startup
|
|
404
|
-
/******/ // Load entry module and return exports
|
|
405
|
-
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
406
|
-
/******/ var __webpack_exports__ = __nccwpck_require__(103);
|
|
407
|
-
/******/ module.exports = __webpack_exports__;
|
|
408
|
-
/******/
|
|
409
|
-
/******/ })()
|
|
410
|
-
;
|
|
363
|
+
var module1 = (__webpack_module_cache__[moduleId] = { exports: {} });
|
|
364
|
+
var threw = true;
|
|
365
|
+
try {
|
|
366
|
+
__webpack_modules__[moduleId](
|
|
367
|
+
module1,
|
|
368
|
+
module1.exports,
|
|
369
|
+
__nccwpck_require__,
|
|
370
|
+
);
|
|
371
|
+
threw = false;
|
|
372
|
+
} finally {
|
|
373
|
+
if (threw) delete __webpack_module_cache__[moduleId];
|
|
374
|
+
}
|
|
375
|
+
return module1.exports;
|
|
376
|
+
}
|
|
377
|
+
if (typeof __nccwpck_require__ !== "undefined")
|
|
378
|
+
__nccwpck_require__.ab = __dirname + "/";
|
|
379
|
+
var __webpack_exports__ = __nccwpck_require__(103);
|
|
380
|
+
module.exports = __webpack_exports__;
|
|
381
|
+
})();
|