bunup 0.16.14 → 0.16.15
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/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
build,
|
|
5
5
|
processLoadedConfigs,
|
|
6
6
|
resolveBuildOptions
|
|
7
|
-
} from "../shared/bunup-
|
|
7
|
+
} from "../shared/bunup-k3zaeaz3.js";
|
|
8
8
|
import {
|
|
9
9
|
BunupBuildError,
|
|
10
10
|
BunupCLIError,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
import { loadConfig } from "coffi";
|
|
28
28
|
import pc4 from "picocolors";
|
|
29
29
|
// packages/bunup/package.json
|
|
30
|
-
var version = "0.16.
|
|
30
|
+
var version = "0.16.15";
|
|
31
31
|
|
|
32
32
|
// packages/bunup/src/printer/print-build-report.ts
|
|
33
33
|
import { promisify } from "util";
|
|
@@ -93,12 +93,6 @@ async function printBuildReport(buildResult) {
|
|
|
93
93
|
const diff = width - str.length;
|
|
94
94
|
return align === "left" ? str + " ".repeat(Math.max(0, diff)) : " ".repeat(Math.max(0, diff)) + str;
|
|
95
95
|
};
|
|
96
|
-
console.log("");
|
|
97
|
-
if (options.name) {
|
|
98
|
-
console.log("");
|
|
99
|
-
console.log(` ${pc.bgBlueBright(` ${options.name} `)}`);
|
|
100
|
-
}
|
|
101
|
-
console.log("");
|
|
102
96
|
const headers = [
|
|
103
97
|
pad(" Output", pathWidth + labelWidth + 2),
|
|
104
98
|
pad("Raw", sizeWidth, "right")
|
|
@@ -197,7 +191,9 @@ async function watch(userOptions, rootDir, configFilePath) {
|
|
|
197
191
|
}
|
|
198
192
|
isRebuilding = true;
|
|
199
193
|
try {
|
|
200
|
-
|
|
194
|
+
if (buildCount > 0) {
|
|
195
|
+
console.clear();
|
|
196
|
+
}
|
|
201
197
|
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
202
198
|
if (lastChangedFile === changed) {
|
|
203
199
|
buildCount++;
|
|
@@ -348,7 +344,6 @@ async function main(args = Bun.argv.slice(2)) {
|
|
|
348
344
|
}
|
|
349
345
|
logger.info("Build started");
|
|
350
346
|
const startTime = performance.now();
|
|
351
|
-
const buildResults = [];
|
|
352
347
|
for (const { options, rootDir } of configsToProcess) {
|
|
353
348
|
const optionsArray = ensureArray(options);
|
|
354
349
|
await Promise.all(optionsArray.map(async (o) => {
|
|
@@ -359,14 +354,14 @@ async function main(args = Bun.argv.slice(2)) {
|
|
|
359
354
|
if (userOptions.watch) {
|
|
360
355
|
await watch(userOptions, rootDir, filepath);
|
|
361
356
|
} else {
|
|
362
|
-
|
|
357
|
+
const result = await build(userOptions, rootDir);
|
|
358
|
+
if (!cliOptions.watch && !shouldSilent) {
|
|
359
|
+
await printBuildReport(result);
|
|
360
|
+
}
|
|
363
361
|
}
|
|
364
362
|
}));
|
|
365
363
|
}
|
|
366
364
|
const buildTimeMs = performance.now() - startTime;
|
|
367
|
-
if (!cliOptions.watch && !shouldSilent) {
|
|
368
|
-
await Promise.all(buildResults.map((o) => printBuildReport(o)));
|
|
369
|
-
}
|
|
370
365
|
if (cliOptions.watch) {
|
|
371
366
|
console.log(`
|
|
372
367
|
${pc4.bgMagentaBright(" WATCH ")} Watching for file changes...
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
formatListWithAnd,
|
|
14
14
|
formatNoEntryPointsFoundError,
|
|
15
15
|
getFilesFromGlobs,
|
|
16
|
-
getShortFilePath,
|
|
17
16
|
injectStyles,
|
|
18
17
|
isJavascriptFile,
|
|
19
18
|
logger,
|
|
@@ -65,6 +64,7 @@ async function loadPackageJson(cwd = process.cwd()) {
|
|
|
65
64
|
// packages/bunup/src/build.ts
|
|
66
65
|
import path3 from "path";
|
|
67
66
|
import { generateDts, logIsolatedDeclarationErrors } from "@bunup/dts";
|
|
67
|
+
import pc2 from "picocolors";
|
|
68
68
|
|
|
69
69
|
// packages/bunup/src/ensure-bun-version.ts
|
|
70
70
|
import pc from "picocolors";
|
|
@@ -448,13 +448,6 @@ async function build(userOptions, rootDir = process.cwd()) {
|
|
|
448
448
|
cleanOutDir(rootDir, options.outDir);
|
|
449
449
|
}
|
|
450
450
|
const packageJson = await loadPackageJson(rootDir);
|
|
451
|
-
if (packageJson.data && packageJson.path) {
|
|
452
|
-
logger.info(`Using ${getShortFilePath(packageJson.path, 2)}`, {
|
|
453
|
-
muted: true,
|
|
454
|
-
identifier: options.name,
|
|
455
|
-
once: `${packageJson.path}:${options.name}`
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
451
|
const packageType = packageJson.data?.type;
|
|
459
452
|
const allPlugins = resolvePlugins(options, packageJson.data);
|
|
460
453
|
const bunupPlugins = filterBunupPlugins(allPlugins);
|
|
@@ -468,11 +461,15 @@ async function build(userOptions, rootDir = process.cwd()) {
|
|
|
468
461
|
}
|
|
469
462
|
throw new BunupBuildError(formatInvalidEntryPointsError(entryArray));
|
|
470
463
|
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
464
|
+
console.log("");
|
|
465
|
+
if (options.name) {
|
|
466
|
+
console.log(`${options.name ? ` ${pc2.bgBlueBright(` ${options.name} `)} ` : ""}${logger.formatMessage({
|
|
467
|
+
message: formatListWithAnd(entrypoints),
|
|
468
|
+
muted: true,
|
|
469
|
+
noIcon: true
|
|
470
|
+
})}`);
|
|
471
|
+
}
|
|
472
|
+
console.log("");
|
|
476
473
|
const buildOutputFiles = [];
|
|
477
474
|
const absoluteEntrypoints = entrypoints.map((file) => `${rootDir}/${file}`);
|
|
478
475
|
const resolvedDefine = getResolvedDefine(options.define, options.env);
|