bunup 0.16.13 → 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-0rejsmya.js";
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.13";
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
- console.clear();
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,10 +344,9 @@ 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
- await Promise.all(configsToProcess.flatMap(({ options, rootDir }) => {
347
+ for (const { options, rootDir } of configsToProcess) {
353
348
  const optionsArray = ensureArray(options);
354
- return optionsArray.map(async (o) => {
349
+ await Promise.all(optionsArray.map(async (o) => {
355
350
  const userOptions = {
356
351
  ...o,
357
352
  ...removeCliOnlyOptions(cliOptions)
@@ -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
- buildResults.push(await build(userOptions, rootDir));
357
+ const result = await build(userOptions, rootDir);
358
+ if (!cliOptions.watch && !shouldSilent) {
359
+ await printBuildReport(result);
360
+ }
363
361
  }
364
- });
365
- }));
366
- const buildTimeMs = performance.now() - startTime;
367
- if (!cliOptions.watch && !shouldSilent) {
368
- await Promise.all(buildResults.map((o) => printBuildReport(o)));
362
+ }));
369
363
  }
364
+ const buildTimeMs = performance.now() - startTime;
370
365
  if (cliOptions.watch) {
371
366
  console.log(`
372
367
  ${pc4.bgMagentaBright(" WATCH ")} Watching for file changes...
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  build
4
- } from "./shared/bunup-0rejsmya.js";
4
+ } from "./shared/bunup-k3zaeaz3.js";
5
5
  import"./shared/bunup-qb65sm3k.js";
6
6
  // packages/bunup/src/define.ts
7
7
  function defineConfig(options) {
@@ -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
- logger.info(`entry: ${formatListWithAnd(entrypoints)}`, {
472
- identifier: options.name,
473
- once: options.name,
474
- muted: true
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);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bunup",
3
3
  "description": "⚡ A blazing-fast build tool for your libraries built with Bun.",
4
- "version": "0.16.13",
4
+ "version": "0.16.15",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"