bunup 0.8.29 → 0.8.30
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/bin/bunup.mjs +1 -1
- package/dist/cli/index.cjs +2030 -0
- package/dist/cli/index.d.cts +360 -0
- package/dist/cli/index.d.ts +360 -0
- package/dist/cli/index.js +2027 -0
- package/dist/index.cjs +1168 -0
- package/dist/index.d.cts +362 -0
- package/dist/index.d.ts +24 -126
- package/dist/index.js +552 -199
- package/dist/plugins.cjs +866 -0
- package/dist/plugins.d.cts +385 -0
- package/dist/plugins.d.ts +385 -0
- package/dist/plugins.js +846 -0
- package/package.json +11 -6
package/dist/plugins.cjs
ADDED
|
@@ -0,0 +1,866 @@
|
|
|
1
|
+
// @bun @bun-cjs
|
|
2
|
+
(function(exports, require, module, __filename, __dirname) {var __create = Object.create;
|
|
3
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
9
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
10
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
|
+
for (let key of __getOwnPropNames(mod))
|
|
12
|
+
if (!__hasOwnProp.call(to, key))
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: () => mod[key],
|
|
15
|
+
enumerable: true
|
|
16
|
+
});
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
20
|
+
var __toCommonJS = (from) => {
|
|
21
|
+
var entry = __moduleCache.get(from), desc;
|
|
22
|
+
if (entry)
|
|
23
|
+
return entry;
|
|
24
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
25
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
26
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
27
|
+
get: () => from[key],
|
|
28
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
29
|
+
}));
|
|
30
|
+
__moduleCache.set(from, entry);
|
|
31
|
+
return entry;
|
|
32
|
+
};
|
|
33
|
+
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
34
|
+
var __export = (target, all) => {
|
|
35
|
+
for (var name in all)
|
|
36
|
+
__defProp(target, name, {
|
|
37
|
+
get: all[name],
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
set: (newValue) => all[name] = () => newValue
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
44
|
+
|
|
45
|
+
// node_modules/picocolors/picocolors.js
|
|
46
|
+
var require_picocolors = __commonJS((exports2, module2) => {
|
|
47
|
+
var p = process || {};
|
|
48
|
+
var argv = p.argv || [];
|
|
49
|
+
var env = p.env || {};
|
|
50
|
+
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);
|
|
51
|
+
var formatter = (open, close, replace = open) => (input) => {
|
|
52
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
53
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
54
|
+
};
|
|
55
|
+
var replaceClose = (string, close, replace, index) => {
|
|
56
|
+
let result = "", cursor = 0;
|
|
57
|
+
do {
|
|
58
|
+
result += string.substring(cursor, index) + replace;
|
|
59
|
+
cursor = index + close.length;
|
|
60
|
+
index = string.indexOf(close, cursor);
|
|
61
|
+
} while (~index);
|
|
62
|
+
return result + string.substring(cursor);
|
|
63
|
+
};
|
|
64
|
+
var createColors = (enabled = isColorSupported) => {
|
|
65
|
+
let f = enabled ? formatter : () => String;
|
|
66
|
+
return {
|
|
67
|
+
isColorSupported: enabled,
|
|
68
|
+
reset: f("\x1B[0m", "\x1B[0m"),
|
|
69
|
+
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
70
|
+
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
71
|
+
italic: f("\x1B[3m", "\x1B[23m"),
|
|
72
|
+
underline: f("\x1B[4m", "\x1B[24m"),
|
|
73
|
+
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
74
|
+
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
75
|
+
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
76
|
+
black: f("\x1B[30m", "\x1B[39m"),
|
|
77
|
+
red: f("\x1B[31m", "\x1B[39m"),
|
|
78
|
+
green: f("\x1B[32m", "\x1B[39m"),
|
|
79
|
+
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
80
|
+
blue: f("\x1B[34m", "\x1B[39m"),
|
|
81
|
+
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
82
|
+
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
83
|
+
white: f("\x1B[37m", "\x1B[39m"),
|
|
84
|
+
gray: f("\x1B[90m", "\x1B[39m"),
|
|
85
|
+
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
86
|
+
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
87
|
+
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
88
|
+
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
89
|
+
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
90
|
+
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
91
|
+
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
92
|
+
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
93
|
+
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
94
|
+
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
95
|
+
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
96
|
+
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
97
|
+
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
98
|
+
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
99
|
+
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
100
|
+
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
101
|
+
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
102
|
+
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
103
|
+
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
104
|
+
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
105
|
+
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
106
|
+
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
107
|
+
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
108
|
+
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
module2.exports = createColors();
|
|
112
|
+
module2.exports.createColors = createColors;
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// src/logger.ts
|
|
116
|
+
function setSilent(value) {
|
|
117
|
+
silent = value ?? false;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
class Logger {
|
|
121
|
+
static instance;
|
|
122
|
+
loggedOnceMessages = new Set;
|
|
123
|
+
MAX_LABEL_LENGTH = 3;
|
|
124
|
+
cliColor = import_picocolors.default.blue;
|
|
125
|
+
mutedColor = import_picocolors.default.dim;
|
|
126
|
+
infoColor = import_picocolors.default.cyan;
|
|
127
|
+
warnColor = import_picocolors.default.yellow;
|
|
128
|
+
errorColor = import_picocolors.default.red;
|
|
129
|
+
defaultColor = import_picocolors.default.white;
|
|
130
|
+
progressFgColorMap = {
|
|
131
|
+
ESM: import_picocolors.default.yellow,
|
|
132
|
+
CJS: import_picocolors.default.green,
|
|
133
|
+
IIFE: import_picocolors.default.magenta,
|
|
134
|
+
DTS: import_picocolors.default.blue
|
|
135
|
+
};
|
|
136
|
+
progressIdentifierBgColorMap = {
|
|
137
|
+
ESM: import_picocolors.default.bgYellow,
|
|
138
|
+
CJS: import_picocolors.default.bgGreen,
|
|
139
|
+
IIFE: import_picocolors.default.bgMagenta,
|
|
140
|
+
DTS: import_picocolors.default.bgBlue
|
|
141
|
+
};
|
|
142
|
+
labels = {
|
|
143
|
+
cli: "CLI",
|
|
144
|
+
info: "INFO",
|
|
145
|
+
warn: "WARN",
|
|
146
|
+
error: "ERROR"
|
|
147
|
+
};
|
|
148
|
+
constructor() {}
|
|
149
|
+
static getInstance() {
|
|
150
|
+
if (!Logger.instance) {
|
|
151
|
+
Logger.instance = new Logger;
|
|
152
|
+
}
|
|
153
|
+
return Logger.instance;
|
|
154
|
+
}
|
|
155
|
+
dispose() {
|
|
156
|
+
this.loggedOnceMessages.clear();
|
|
157
|
+
}
|
|
158
|
+
shouldLog(options) {
|
|
159
|
+
if (!options?.once)
|
|
160
|
+
return true;
|
|
161
|
+
if (this.loggedOnceMessages.has(options.once))
|
|
162
|
+
return false;
|
|
163
|
+
this.loggedOnceMessages.add(options.once);
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
formatMessage({
|
|
167
|
+
fgColor,
|
|
168
|
+
bgColor,
|
|
169
|
+
label,
|
|
170
|
+
message,
|
|
171
|
+
identifier,
|
|
172
|
+
muted
|
|
173
|
+
}) {
|
|
174
|
+
const padding = " ".repeat(Math.max(0, this.MAX_LABEL_LENGTH - label.length));
|
|
175
|
+
const formattedMessage = muted ? this.mutedColor(message) : message;
|
|
176
|
+
const identifierPart = identifier ? ` ${bgColor(import_picocolors.default.black(` ${identifier} `))}` : "";
|
|
177
|
+
return `${fgColor(label)} ${padding}${formattedMessage}${identifierPart}`;
|
|
178
|
+
}
|
|
179
|
+
output(message, options = {}, logFn = console.log) {
|
|
180
|
+
if (silent || !this.shouldLog(options))
|
|
181
|
+
return;
|
|
182
|
+
if (options.verticalSpace)
|
|
183
|
+
logFn("");
|
|
184
|
+
logFn(message);
|
|
185
|
+
if (options.verticalSpace)
|
|
186
|
+
logFn("");
|
|
187
|
+
}
|
|
188
|
+
cli(message, options = {}) {
|
|
189
|
+
const formattedMessage = this.formatMessage({
|
|
190
|
+
fgColor: this.cliColor,
|
|
191
|
+
bgColor: import_picocolors.default.bgBlue,
|
|
192
|
+
label: this.labels.cli,
|
|
193
|
+
message,
|
|
194
|
+
identifier: options.identifier,
|
|
195
|
+
muted: options.muted
|
|
196
|
+
});
|
|
197
|
+
this.output(formattedMessage, options);
|
|
198
|
+
}
|
|
199
|
+
info(message, options = {}) {
|
|
200
|
+
const formattedMessage = this.formatMessage({
|
|
201
|
+
fgColor: this.infoColor,
|
|
202
|
+
bgColor: import_picocolors.default.bgCyan,
|
|
203
|
+
label: this.labels.info,
|
|
204
|
+
message,
|
|
205
|
+
identifier: options.identifier,
|
|
206
|
+
muted: options.muted
|
|
207
|
+
});
|
|
208
|
+
this.output(formattedMessage, options);
|
|
209
|
+
}
|
|
210
|
+
warn(message, options = {}) {
|
|
211
|
+
const formattedMessage = this.formatMessage({
|
|
212
|
+
fgColor: this.warnColor,
|
|
213
|
+
bgColor: import_picocolors.default.bgYellow,
|
|
214
|
+
label: this.labels.warn,
|
|
215
|
+
message,
|
|
216
|
+
identifier: options.identifier,
|
|
217
|
+
muted: options.muted
|
|
218
|
+
});
|
|
219
|
+
this.output(formattedMessage, options, console.warn);
|
|
220
|
+
}
|
|
221
|
+
error(message, options = {}) {
|
|
222
|
+
const formattedMessage = this.formatMessage({
|
|
223
|
+
fgColor: this.errorColor,
|
|
224
|
+
bgColor: import_picocolors.default.bgRed,
|
|
225
|
+
label: this.labels.error,
|
|
226
|
+
message,
|
|
227
|
+
identifier: options.identifier,
|
|
228
|
+
muted: options.muted
|
|
229
|
+
});
|
|
230
|
+
this.output(formattedMessage, options, console.error);
|
|
231
|
+
}
|
|
232
|
+
space() {
|
|
233
|
+
if (silent)
|
|
234
|
+
return;
|
|
235
|
+
console.log("");
|
|
236
|
+
}
|
|
237
|
+
getProgressFgColor(label) {
|
|
238
|
+
for (const [key, colorFn] of Object.entries(this.progressFgColorMap)) {
|
|
239
|
+
if (label.includes(key))
|
|
240
|
+
return colorFn;
|
|
241
|
+
}
|
|
242
|
+
return this.defaultColor;
|
|
243
|
+
}
|
|
244
|
+
getProgressBgColor(label) {
|
|
245
|
+
for (const [key, colorFn] of Object.entries(this.progressIdentifierBgColorMap)) {
|
|
246
|
+
if (label.includes(key))
|
|
247
|
+
return colorFn;
|
|
248
|
+
}
|
|
249
|
+
return import_picocolors.default.bgWhite;
|
|
250
|
+
}
|
|
251
|
+
progress(label, message, options = {}) {
|
|
252
|
+
const fgColor = this.getProgressFgColor(label);
|
|
253
|
+
const bgColor = this.getProgressBgColor(label);
|
|
254
|
+
const formattedMessage = this.formatMessage({
|
|
255
|
+
fgColor,
|
|
256
|
+
bgColor,
|
|
257
|
+
label,
|
|
258
|
+
message,
|
|
259
|
+
identifier: options.identifier,
|
|
260
|
+
muted: options.muted
|
|
261
|
+
});
|
|
262
|
+
this.output(formattedMessage, options);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
function logTable(columns, data, footer) {
|
|
266
|
+
if (silent)
|
|
267
|
+
return;
|
|
268
|
+
const widths = {};
|
|
269
|
+
for (const col of columns) {
|
|
270
|
+
const headerLength = col.header.length;
|
|
271
|
+
const dataLengths = data.map((row) => row[col.header]?.length || 0);
|
|
272
|
+
const footerLength = footer ? footer[col.header]?.length || 0 : 0;
|
|
273
|
+
widths[col.header] = Math.max(headerLength, ...dataLengths, footerLength);
|
|
274
|
+
}
|
|
275
|
+
const pad = (str, width, align) => {
|
|
276
|
+
return align === "left" ? str.padEnd(width) : str.padStart(width);
|
|
277
|
+
};
|
|
278
|
+
const headerRow = columns.map((col) => pad(col.header, widths[col.header], col.align)).join(import_picocolors.default.gray(" | "));
|
|
279
|
+
console.log(import_picocolors.default.gray(headerRow));
|
|
280
|
+
const separator = columns.map((col) => "-".repeat(widths[col.header])).join(" | ");
|
|
281
|
+
console.log(import_picocolors.default.gray(separator));
|
|
282
|
+
for (const row of data) {
|
|
283
|
+
const rowStr = columns.map((col) => {
|
|
284
|
+
const value = row[col.header] || "";
|
|
285
|
+
const padded = pad(value, widths[col.header], col.align);
|
|
286
|
+
return col.color ? col.color(padded) : padded;
|
|
287
|
+
}).join(import_picocolors.default.gray(" | "));
|
|
288
|
+
console.log(rowStr);
|
|
289
|
+
}
|
|
290
|
+
console.log(import_picocolors.default.gray(separator));
|
|
291
|
+
if (footer) {
|
|
292
|
+
const footerRow = columns.map((col) => {
|
|
293
|
+
const value = footer[col.header] || "";
|
|
294
|
+
const padded = pad(value, widths[col.header], col.align);
|
|
295
|
+
return padded;
|
|
296
|
+
}).join(import_picocolors.default.gray(" | "));
|
|
297
|
+
console.log(footerRow);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
var import_picocolors, silent = false, logger;
|
|
301
|
+
var init_logger = __esm(() => {
|
|
302
|
+
import_picocolors = __toESM(require_picocolors());
|
|
303
|
+
logger = Logger.getInstance();
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
// src/errors.ts
|
|
307
|
+
var import_picocolors2, BunupError, BunupBuildError, BunupDTSBuildError, BunupCLIError, BunupWatchError, BunupPluginError, parseErrorMessage = (error) => {
|
|
308
|
+
if (error instanceof Error) {
|
|
309
|
+
return error.message;
|
|
310
|
+
}
|
|
311
|
+
return String(error);
|
|
312
|
+
}, KNOWN_ERRORS, handleError = (error, context) => {
|
|
313
|
+
const errorMessage = parseErrorMessage(error);
|
|
314
|
+
const contextPrefix = context ? `[${context}] ` : "";
|
|
315
|
+
let errorType = "UNKNOWN ERROR";
|
|
316
|
+
if (error instanceof BunupBuildError) {
|
|
317
|
+
errorType = "BUILD ERROR";
|
|
318
|
+
} else if (error instanceof BunupDTSBuildError) {
|
|
319
|
+
errorType = "DTS ERROR";
|
|
320
|
+
} else if (error instanceof BunupCLIError) {
|
|
321
|
+
errorType = "CLI ERROR";
|
|
322
|
+
} else if (error instanceof BunupWatchError) {
|
|
323
|
+
errorType = "WATCH ERROR";
|
|
324
|
+
} else if (error instanceof BunupPluginError) {
|
|
325
|
+
errorType = "PLUGIN ERROR";
|
|
326
|
+
} else if (error instanceof BunupError) {
|
|
327
|
+
errorType = "BUNUP ERROR";
|
|
328
|
+
}
|
|
329
|
+
const knownError = KNOWN_ERRORS.find((error2) => error2.pattern.test(errorMessage) && (error2.errorType === errorType || !error2.errorType));
|
|
330
|
+
if (!knownError && errorType) {
|
|
331
|
+
console.error(`${import_picocolors2.default.red(errorType)} ${contextPrefix}${errorMessage}`);
|
|
332
|
+
}
|
|
333
|
+
if (knownError) {
|
|
334
|
+
console.log(`
|
|
335
|
+
`);
|
|
336
|
+
knownError.logSolution(errorMessage);
|
|
337
|
+
console.log(`
|
|
338
|
+
`);
|
|
339
|
+
} else {
|
|
340
|
+
console.error(import_picocolors2.default.dim(import_picocolors2.default.white("If you think this is a bug, please open an issue at: ") + import_picocolors2.default.cyan("https://github.com/arshad-yaseen/bunup/issues/new")));
|
|
341
|
+
}
|
|
342
|
+
}, handleErrorAndExit = (error, context) => {
|
|
343
|
+
handleError(error, context);
|
|
344
|
+
process.exit(1);
|
|
345
|
+
};
|
|
346
|
+
var init_errors = __esm(() => {
|
|
347
|
+
import_picocolors2 = __toESM(require_picocolors());
|
|
348
|
+
init_logger();
|
|
349
|
+
BunupError = class BunupError extends Error {
|
|
350
|
+
constructor(message) {
|
|
351
|
+
super(message);
|
|
352
|
+
this.name = "BunupError";
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
BunupBuildError = class BunupBuildError extends BunupError {
|
|
356
|
+
constructor(message) {
|
|
357
|
+
super(message);
|
|
358
|
+
this.name = "BunupBuildError";
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
BunupDTSBuildError = class BunupDTSBuildError extends BunupError {
|
|
362
|
+
constructor(message) {
|
|
363
|
+
super(message);
|
|
364
|
+
this.name = "BunupDTSBuildError";
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
BunupCLIError = class BunupCLIError extends BunupError {
|
|
368
|
+
constructor(message) {
|
|
369
|
+
super(message);
|
|
370
|
+
this.name = "BunupCLIError";
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
BunupWatchError = class BunupWatchError extends BunupError {
|
|
374
|
+
constructor(message) {
|
|
375
|
+
super(message);
|
|
376
|
+
this.name = "BunupWatchError";
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
BunupPluginError = class BunupPluginError extends BunupError {
|
|
380
|
+
constructor(message) {
|
|
381
|
+
super(message);
|
|
382
|
+
this.name = "BunupPluginError";
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
KNOWN_ERRORS = [
|
|
386
|
+
{
|
|
387
|
+
pattern: /Could not resolve: "bun"/i,
|
|
388
|
+
errorType: "BUILD ERROR",
|
|
389
|
+
logSolution: () => {
|
|
390
|
+
logger.error(import_picocolors2.default.white("You're trying to build a project that uses Bun. ") + import_picocolors2.default.white("Please set the target option to ") + import_picocolors2.default.cyan("`bun`") + import_picocolors2.default.white(`.
|
|
391
|
+
`) + import_picocolors2.default.white("Example: ") + import_picocolors2.default.green("`bunup --target bun`") + import_picocolors2.default.white(" or in config: ") + import_picocolors2.default.green("{ target: 'bun' }"));
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
];
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
// src/utils.ts
|
|
398
|
+
function ensureArray(value) {
|
|
399
|
+
return Array.isArray(value) ? value : [value];
|
|
400
|
+
}
|
|
401
|
+
function getDefaultJsOutputExtension(format, packageType) {
|
|
402
|
+
switch (format) {
|
|
403
|
+
case "esm":
|
|
404
|
+
return isModulePackage(packageType) ? ".js" : ".mjs";
|
|
405
|
+
case "cjs":
|
|
406
|
+
return isModulePackage(packageType) ? ".cjs" : ".js";
|
|
407
|
+
case "iife":
|
|
408
|
+
return ".global.js";
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function removeExtension(filePath) {
|
|
412
|
+
const basename = import_node_path.default.basename(filePath);
|
|
413
|
+
const firstDotIndex = basename.indexOf(".");
|
|
414
|
+
if (firstDotIndex === -1) {
|
|
415
|
+
return filePath;
|
|
416
|
+
}
|
|
417
|
+
const nameWithoutExtensions = basename.slice(0, firstDotIndex);
|
|
418
|
+
const directory = import_node_path.default.dirname(filePath);
|
|
419
|
+
return directory === "." ? nameWithoutExtensions : import_node_path.default.join(directory, nameWithoutExtensions);
|
|
420
|
+
}
|
|
421
|
+
function isModulePackage(packageType) {
|
|
422
|
+
return packageType === "module";
|
|
423
|
+
}
|
|
424
|
+
function formatTime(ms) {
|
|
425
|
+
return ms >= 1000 ? `${(ms / 1000).toFixed(2)}s` : `${Math.round(ms)}ms`;
|
|
426
|
+
}
|
|
427
|
+
function getPackageDeps(packageJson) {
|
|
428
|
+
if (!packageJson)
|
|
429
|
+
return [];
|
|
430
|
+
return Array.from(new Set([
|
|
431
|
+
...Object.keys(packageJson.dependencies || {}),
|
|
432
|
+
...Object.keys(packageJson.peerDependencies || {})
|
|
433
|
+
]));
|
|
434
|
+
}
|
|
435
|
+
function formatFileSize(bytes) {
|
|
436
|
+
if (bytes === 0)
|
|
437
|
+
return "0 B";
|
|
438
|
+
const units = ["B", "KB", "MB", "GB"];
|
|
439
|
+
const i = Math.floor(Math.log(bytes) / Math.log(1024));
|
|
440
|
+
if (i === 0)
|
|
441
|
+
return `${bytes} ${units[i]}`;
|
|
442
|
+
return `${(bytes / 1024 ** i).toFixed(2)} ${units[i]}`;
|
|
443
|
+
}
|
|
444
|
+
function getShortFilePath(filePath, maxLength = 3) {
|
|
445
|
+
const fileParts = filePath.split("/");
|
|
446
|
+
const shortPath = fileParts.slice(-maxLength).join("/");
|
|
447
|
+
return shortPath;
|
|
448
|
+
}
|
|
449
|
+
async function cleanOutDir(rootDir, outDir) {
|
|
450
|
+
const outDirPath = import_node_path.default.join(rootDir, outDir);
|
|
451
|
+
try {
|
|
452
|
+
await import_promises.default.rm(outDirPath, { recursive: true, force: true });
|
|
453
|
+
} catch (error) {
|
|
454
|
+
throw new BunupBuildError(`Failed to clean output directory: ${error}`);
|
|
455
|
+
}
|
|
456
|
+
await import_promises.default.mkdir(outDirPath, { recursive: true });
|
|
457
|
+
}
|
|
458
|
+
function cleanPath(path2) {
|
|
459
|
+
let cleaned = import_node_path.normalize(path2).replace(/\\/g, "/");
|
|
460
|
+
cleaned = cleaned.replace(/^[a-zA-Z]:\//, "");
|
|
461
|
+
cleaned = cleaned.replace(/^\/+/, "");
|
|
462
|
+
cleaned = cleaned.replace(/\/+/g, "/");
|
|
463
|
+
return cleaned;
|
|
464
|
+
}
|
|
465
|
+
function isDirectoryPath(filePath) {
|
|
466
|
+
return import_node_path.default.extname(filePath) === "";
|
|
467
|
+
}
|
|
468
|
+
function pathExistsSync(filePath) {
|
|
469
|
+
try {
|
|
470
|
+
import_node_fs.default.accessSync(filePath);
|
|
471
|
+
return true;
|
|
472
|
+
} catch (error) {
|
|
473
|
+
return false;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
function formatListWithAnd(arr) {
|
|
477
|
+
return new Intl.ListFormat("en", {
|
|
478
|
+
style: "long",
|
|
479
|
+
type: "conjunction"
|
|
480
|
+
}).format(arr);
|
|
481
|
+
}
|
|
482
|
+
async function getFilesFromGlobs(patterns, cwd) {
|
|
483
|
+
const includePatterns = patterns.filter((p) => !p.startsWith("!"));
|
|
484
|
+
const excludePatterns = patterns.filter((p) => p.startsWith("!")).map((p) => p.slice(1));
|
|
485
|
+
const includedFiles = new Set;
|
|
486
|
+
for (const pattern of includePatterns) {
|
|
487
|
+
const glob = new Bun.Glob(pattern);
|
|
488
|
+
for await (const file of glob.scan(cwd)) {
|
|
489
|
+
includedFiles.add(file);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
if (excludePatterns.length > 0) {
|
|
493
|
+
for (const pattern of excludePatterns) {
|
|
494
|
+
const glob = new Bun.Glob(pattern);
|
|
495
|
+
for await (const file of glob.scan(cwd)) {
|
|
496
|
+
includedFiles.delete(file);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
return Array.from(includedFiles);
|
|
501
|
+
}
|
|
502
|
+
var import_node_fs, import_promises, import_node_path;
|
|
503
|
+
var init_utils = __esm(() => {
|
|
504
|
+
import_node_fs = __toESM(require("fs"));
|
|
505
|
+
import_promises = __toESM(require("fs/promises"));
|
|
506
|
+
import_node_path = __toESM(require("path"));
|
|
507
|
+
init_errors();
|
|
508
|
+
});
|
|
509
|
+
|
|
510
|
+
// src/plugins.ts
|
|
511
|
+
var exports_plugins = {};
|
|
512
|
+
__export(exports_plugins, {
|
|
513
|
+
shims: () => shims,
|
|
514
|
+
report: () => report,
|
|
515
|
+
injectStyles: () => injectStyles,
|
|
516
|
+
exports: () => exports2,
|
|
517
|
+
copy: () => copy
|
|
518
|
+
});
|
|
519
|
+
module.exports = __toCommonJS(exports_plugins);
|
|
520
|
+
|
|
521
|
+
// src/constants/re.ts
|
|
522
|
+
var JS_RE = /\.(js|jsx|cjs|mjs)$/;
|
|
523
|
+
var TS_RE = /\.(ts|tsx|mts|cts)$/;
|
|
524
|
+
var DTS_RE = /\.(d\.(ts|mts|cts))$/;
|
|
525
|
+
var JS_TS_RE = new RegExp(`${JS_RE.source}|${TS_RE.source}`);
|
|
526
|
+
var JS_DTS_RE = new RegExp(`${JS_RE.source}|${DTS_RE.source}`);
|
|
527
|
+
var CSS_RE = /\.(css)$/;
|
|
528
|
+
|
|
529
|
+
// src/plugins/built-in/node/shims.ts
|
|
530
|
+
function shims() {
|
|
531
|
+
return {
|
|
532
|
+
type: "bun",
|
|
533
|
+
name: "shims",
|
|
534
|
+
plugin: {
|
|
535
|
+
name: "bunup:shims",
|
|
536
|
+
setup(build) {
|
|
537
|
+
const isNodeCompatibleTarget = build.config.target === "node" || build.config.target === "bun";
|
|
538
|
+
const isEsm = build.config.format === "esm";
|
|
539
|
+
const isCjs = build.config.format === "cjs";
|
|
540
|
+
if (!isNodeCompatibleTarget || !isEsm && !isCjs) {
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
build.config.define = {
|
|
544
|
+
...build.config.define,
|
|
545
|
+
...isCjs && {
|
|
546
|
+
"import.meta.url": "importMetaUrl"
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
build.onLoad({ filter: JS_TS_RE }, async ({ path }) => {
|
|
550
|
+
const content = await Bun.file(path).text();
|
|
551
|
+
let shimCode = "";
|
|
552
|
+
if (isEsm && (/\b__dirname\b/.test(content) || /\b__filename\b/.test(content))) {
|
|
553
|
+
shimCode = `import { fileURLToPath } from 'url';
|
|
554
|
+
import { dirname } from 'path';
|
|
555
|
+
|
|
556
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
557
|
+
const __dirname = dirname(__filename);
|
|
558
|
+
|
|
559
|
+
`;
|
|
560
|
+
}
|
|
561
|
+
if (isCjs && /\bimport\.meta\.url\b/.test(content)) {
|
|
562
|
+
shimCode = `import { pathToFileURL } from 'url';
|
|
563
|
+
|
|
564
|
+
const importMetaUrl = pathToFileURL(__filename).href;
|
|
565
|
+
|
|
566
|
+
`;
|
|
567
|
+
}
|
|
568
|
+
if (!shimCode)
|
|
569
|
+
return;
|
|
570
|
+
const lines = content.split(`
|
|
571
|
+
`);
|
|
572
|
+
const firstLine = lines[0];
|
|
573
|
+
const restLines = lines.slice(1);
|
|
574
|
+
return {
|
|
575
|
+
contents: [firstLine, shimCode, ...restLines].join(`
|
|
576
|
+
`)
|
|
577
|
+
};
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
// src/plugins/built-in/productivity/exports.ts
|
|
584
|
+
init_logger();
|
|
585
|
+
init_utils();
|
|
586
|
+
function exports2(options = {}) {
|
|
587
|
+
return {
|
|
588
|
+
type: "bunup",
|
|
589
|
+
name: "exports",
|
|
590
|
+
hooks: {
|
|
591
|
+
onBuildDone: async ({ output, options: buildOptions, meta }) => {
|
|
592
|
+
if (!meta.packageJson.path || !meta.packageJson.data) {
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
try {
|
|
596
|
+
const { exportsField, entryPoints } = generateExportsFields(output.files);
|
|
597
|
+
const files = Array.isArray(meta.packageJson.data.files) ? [
|
|
598
|
+
...new Set([
|
|
599
|
+
...meta.packageJson.data.files,
|
|
600
|
+
buildOptions.outDir
|
|
601
|
+
])
|
|
602
|
+
] : [buildOptions.outDir];
|
|
603
|
+
const mergedExports = { ...exportsField };
|
|
604
|
+
if (options.extraExports) {
|
|
605
|
+
for (const [key, value] of Object.entries(options.extraExports)) {
|
|
606
|
+
if (typeof value === "string") {
|
|
607
|
+
mergedExports[key] = value;
|
|
608
|
+
} else {
|
|
609
|
+
const existingExport = mergedExports[key];
|
|
610
|
+
if (typeof existingExport === "object" && existingExport !== null) {
|
|
611
|
+
mergedExports[key] = {
|
|
612
|
+
...existingExport,
|
|
613
|
+
...value
|
|
614
|
+
};
|
|
615
|
+
} else {
|
|
616
|
+
mergedExports[key] = value;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
const newPackageJson = {
|
|
622
|
+
name: meta.packageJson.data.name,
|
|
623
|
+
description: meta.packageJson.data.description,
|
|
624
|
+
version: meta.packageJson.data.version,
|
|
625
|
+
type: meta.packageJson.data.type,
|
|
626
|
+
private: meta.packageJson.data.private,
|
|
627
|
+
files,
|
|
628
|
+
...entryPoints,
|
|
629
|
+
exports: mergedExports
|
|
630
|
+
};
|
|
631
|
+
for (const key in meta.packageJson.data) {
|
|
632
|
+
if (Object.prototype.hasOwnProperty.call(meta.packageJson.data, key) && !Object.prototype.hasOwnProperty.call(newPackageJson, key)) {
|
|
633
|
+
newPackageJson[key] = meta.packageJson.data[key];
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
await Bun.write(meta.packageJson.path, JSON.stringify(newPackageJson, null, 2));
|
|
637
|
+
logger.cli("Updated package.json with exports");
|
|
638
|
+
} catch {
|
|
639
|
+
logger.error("Failed to update package.json");
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
function generateExportsFields(files) {
|
|
646
|
+
const exportsField = {};
|
|
647
|
+
const entryPoints = {};
|
|
648
|
+
const filteredFiles = filterFiles(files);
|
|
649
|
+
for (const file of filteredFiles) {
|
|
650
|
+
const exportType = formatToExportField(file.format, file.dts);
|
|
651
|
+
const relativePath = `./${cleanPath(file.relativePathToRootDir)}`;
|
|
652
|
+
const exportKey = getExportKey(cleanPath(file.relativePathToOutputDir));
|
|
653
|
+
exportsField[exportKey] = {
|
|
654
|
+
...exportsField[exportKey],
|
|
655
|
+
[exportType]: relativePath
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
for (const field of Object.keys(exportsField["."] ?? {})) {
|
|
659
|
+
const entryPoint = exportFieldToEntryPoint(field);
|
|
660
|
+
entryPoints[entryPoint] = exportsField["."][field];
|
|
661
|
+
}
|
|
662
|
+
return { exportsField, entryPoints };
|
|
663
|
+
}
|
|
664
|
+
function filterFiles(files) {
|
|
665
|
+
return files.filter((file) => JS_DTS_RE.test(file.fullPath) && file.kind === "entry-point");
|
|
666
|
+
}
|
|
667
|
+
function getExportKey(relativePathToOutputDir) {
|
|
668
|
+
const pathSegments = cleanPath(removeExtension(relativePathToOutputDir)).split("/");
|
|
669
|
+
if (pathSegments.length === 1 && pathSegments[0].startsWith("index")) {
|
|
670
|
+
return ".";
|
|
671
|
+
}
|
|
672
|
+
return `./${pathSegments.filter((p) => !p.startsWith("index")).join("/")}`;
|
|
673
|
+
}
|
|
674
|
+
function exportFieldToEntryPoint(exportField) {
|
|
675
|
+
return exportField === "types" ? "types" : exportField === "require" ? "main" : "module";
|
|
676
|
+
}
|
|
677
|
+
function formatToExportField(format, dts) {
|
|
678
|
+
return dts ? "types" : format === "esm" ? "import" : "require";
|
|
679
|
+
}
|
|
680
|
+
// src/plugins/built-in/css/inject-styles.ts
|
|
681
|
+
var import_node_path2 = __toESM(require("path"));
|
|
682
|
+
init_logger();
|
|
683
|
+
|
|
684
|
+
// src/plugins/utils.ts
|
|
685
|
+
var import_picocolors3 = __toESM(require_picocolors());
|
|
686
|
+
init_errors();
|
|
687
|
+
function filterBunupBunPlugins(plugins) {
|
|
688
|
+
if (!plugins)
|
|
689
|
+
return [];
|
|
690
|
+
return plugins.filter((p) => p.type === "bun");
|
|
691
|
+
}
|
|
692
|
+
function filterBunupPlugins(plugins) {
|
|
693
|
+
if (!plugins)
|
|
694
|
+
return [];
|
|
695
|
+
return plugins.filter((p) => p.type === "bunup");
|
|
696
|
+
}
|
|
697
|
+
async function runPluginBuildStartHooks(bunupPlugins, options) {
|
|
698
|
+
if (!bunupPlugins)
|
|
699
|
+
return;
|
|
700
|
+
for (const plugin of bunupPlugins) {
|
|
701
|
+
if (plugin.hooks.onBuildStart) {
|
|
702
|
+
await plugin.hooks.onBuildStart(options);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
async function runPluginBuildDoneHooks(bunupPlugins, options, output, meta) {
|
|
707
|
+
if (!bunupPlugins)
|
|
708
|
+
return;
|
|
709
|
+
for (const plugin of bunupPlugins) {
|
|
710
|
+
if (plugin.hooks.onBuildDone) {
|
|
711
|
+
await plugin.hooks.onBuildDone({ options, output, meta });
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
async function getPackageForPlugin(name, pluginName) {
|
|
716
|
+
let pkg;
|
|
717
|
+
try {
|
|
718
|
+
pkg = await import(name);
|
|
719
|
+
} catch {
|
|
720
|
+
throw new BunupPluginError(`[${import_picocolors3.default.cyan(name)}] is required for the ${pluginName} plugin. Please install it with: ${import_picocolors3.default.blue(`bun add ${name} --dev`)}`);
|
|
721
|
+
}
|
|
722
|
+
return pkg;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
// src/plugins/built-in/css/inject-styles.ts
|
|
726
|
+
function injectStyles(options) {
|
|
727
|
+
const { inject, ...transformOptions } = options ?? {};
|
|
728
|
+
return {
|
|
729
|
+
type: "bun",
|
|
730
|
+
name: "inject-styles",
|
|
731
|
+
plugin: {
|
|
732
|
+
name: "bunup:inject-styles",
|
|
733
|
+
async setup(build) {
|
|
734
|
+
const lightningcss = await getPackageForPlugin("lightningcss", "inject-styles");
|
|
735
|
+
build.onResolve({ filter: /^__inject-style$/ }, () => {
|
|
736
|
+
return {
|
|
737
|
+
path: "__inject-style",
|
|
738
|
+
namespace: "__inject-style"
|
|
739
|
+
};
|
|
740
|
+
});
|
|
741
|
+
build.onLoad({ filter: /^__inject-style$/, namespace: "__inject-style" }, () => {
|
|
742
|
+
return {
|
|
743
|
+
contents: `
|
|
744
|
+
export default function injectStyle(css) {
|
|
745
|
+
if (!css || typeof document === 'undefined') return
|
|
746
|
+
|
|
747
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
748
|
+
const style = document.createElement('style')
|
|
749
|
+
head.appendChild(style)
|
|
750
|
+
|
|
751
|
+
if (style.styleSheet) {
|
|
752
|
+
style.styleSheet.cssText = css
|
|
753
|
+
} else {
|
|
754
|
+
style.appendChild(document.createTextNode(css))
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
`,
|
|
758
|
+
loader: "js"
|
|
759
|
+
};
|
|
760
|
+
});
|
|
761
|
+
build.onLoad({ filter: CSS_RE }, async (args) => {
|
|
762
|
+
const source = await Bun.file(args.path).text();
|
|
763
|
+
const { code, warnings } = lightningcss.transform({
|
|
764
|
+
...transformOptions,
|
|
765
|
+
filename: import_node_path2.default.basename(args.path),
|
|
766
|
+
code: Buffer.from(source),
|
|
767
|
+
minify: transformOptions.minify ?? (build.config.minify === true || typeof build.config.minify === "object" && build.config.minify.whitespace)
|
|
768
|
+
});
|
|
769
|
+
for (const warning of warnings) {
|
|
770
|
+
logger.warn(warning.message);
|
|
771
|
+
}
|
|
772
|
+
const stringifiedCode = JSON.stringify(code.toString());
|
|
773
|
+
const js = inject ? await inject(stringifiedCode, args.path) : `import injectStyle from '__inject-style';injectStyle(${stringifiedCode})`;
|
|
774
|
+
return {
|
|
775
|
+
contents: js,
|
|
776
|
+
loader: "js"
|
|
777
|
+
};
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
// src/plugins/built-in/productivity/copy.ts
|
|
784
|
+
var import_node_path3 = require("path");
|
|
785
|
+
var import_node_path4 = require("path");
|
|
786
|
+
init_utils();
|
|
787
|
+
function copy(patterns, outPath) {
|
|
788
|
+
return {
|
|
789
|
+
type: "bunup",
|
|
790
|
+
name: "copy",
|
|
791
|
+
hooks: {
|
|
792
|
+
onBuildDone: async ({ options, meta }) => {
|
|
793
|
+
const destinationPath = outPath || options.outDir;
|
|
794
|
+
for (const pattern of patterns) {
|
|
795
|
+
const glob = new Bun.Glob(pattern);
|
|
796
|
+
for await (const filePath of glob.scan({
|
|
797
|
+
cwd: meta.rootDir,
|
|
798
|
+
dot: true
|
|
799
|
+
})) {
|
|
800
|
+
const sourceFile = Bun.file(import_node_path3.join(meta.rootDir, filePath));
|
|
801
|
+
await Bun.write(outPath && isDirectoryPath(outPath) ? import_node_path3.join(destinationPath, import_node_path4.basename(filePath)) : destinationPath, sourceFile);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
// src/plugins/internal/report.ts
|
|
809
|
+
var import_picocolors4 = __toESM(require_picocolors());
|
|
810
|
+
init_logger();
|
|
811
|
+
init_logger();
|
|
812
|
+
init_utils();
|
|
813
|
+
function report() {
|
|
814
|
+
return {
|
|
815
|
+
type: "bunup",
|
|
816
|
+
name: "report",
|
|
817
|
+
hooks: {
|
|
818
|
+
onBuildDone: async ({ options, output }) => {
|
|
819
|
+
if (options.watch)
|
|
820
|
+
return;
|
|
821
|
+
const files = await Promise.all(output.files.map(async (file) => {
|
|
822
|
+
const name = file.relativePathToRootDir;
|
|
823
|
+
const size = Bun.file(file.fullPath).size;
|
|
824
|
+
const gzipSize = Bun.gzipSync(new Uint8Array(await Bun.file(file.fullPath).arrayBuffer())).length;
|
|
825
|
+
const formattedGzipSize = formatFileSize(gzipSize);
|
|
826
|
+
return {
|
|
827
|
+
name,
|
|
828
|
+
size,
|
|
829
|
+
formattedSize: formatFileSize(size),
|
|
830
|
+
gzipSize,
|
|
831
|
+
formattedGzipSize
|
|
832
|
+
};
|
|
833
|
+
}));
|
|
834
|
+
const totalSize = files.reduce((sum, file) => sum + file.size, 0);
|
|
835
|
+
const formattedTotalSize = formatFileSize(totalSize);
|
|
836
|
+
const totalGzipSize = files.reduce((sum, file) => sum + (file.gzipSize || 0), 0);
|
|
837
|
+
const formattedTotalGzipSize = formatFileSize(totalGzipSize);
|
|
838
|
+
const columns = [
|
|
839
|
+
{ header: "File", align: "left", color: import_picocolors4.default.blue },
|
|
840
|
+
{ header: "Size", align: "right", color: import_picocolors4.default.green },
|
|
841
|
+
{
|
|
842
|
+
header: "Gzip",
|
|
843
|
+
align: "right",
|
|
844
|
+
color: import_picocolors4.default.magenta
|
|
845
|
+
}
|
|
846
|
+
];
|
|
847
|
+
const data = files.map((file) => {
|
|
848
|
+
return {
|
|
849
|
+
File: file.name,
|
|
850
|
+
Size: file.formattedSize,
|
|
851
|
+
Gzip: file.formattedGzipSize
|
|
852
|
+
};
|
|
853
|
+
});
|
|
854
|
+
const footer = {
|
|
855
|
+
File: "Total",
|
|
856
|
+
Size: formattedTotalSize,
|
|
857
|
+
Gzip: formattedTotalGzipSize
|
|
858
|
+
};
|
|
859
|
+
logger.space();
|
|
860
|
+
logTable(columns, data, footer);
|
|
861
|
+
logger.space();
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
})
|