bunup 0.8.21 → 0.8.23

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 CHANGED
@@ -14,13 +14,9 @@
14
14
 
15
15
  Bunup is the **blazing-fast build tool** for TypeScript and JavaScript libraries, designed for flawless developer experience and speed, **powered by Bun**.
16
16
 
17
- | Bundler | Format | Build Time | Build Time (with dts) |
18
- | --------- | ------------ | -------------- | --------------------- |
19
- | **bunup** | **esm, cjs** | **3.42ms ⚡️** | **8.28ms ⚡️** |
20
- | tsdown | esm, cjs | 21.37ms | 87.48ms |
21
- | unbuild | esm, cjs | 63.22ms | 386.65ms |
22
- | bunchee | esm, cjs | 94.98ms | 427.38ms |
23
- | tsup | esm, cjs | 82.59ms | 1035.61ms |
17
+ Bundles faster than you can say "bundle" 100x faster than tsup and 10x faster than tsdown.
18
+
19
+ https://github.com/user-attachments/assets/f25d643c-b637-4f8f-9cf4-bc9251a14030
24
20
 
25
21
  </div>
26
22
  <!-- markdownlint-restore -->
package/dist/cli.js CHANGED
@@ -1028,7 +1028,7 @@ var init_init = __esm(() => {
1028
1028
  // src/cli/index.ts
1029
1029
  import { exec as exec2 } from "tinyexec";
1030
1030
  // package.json
1031
- var version = "0.8.21";
1031
+ var version = "0.8.23";
1032
1032
 
1033
1033
  // src/cli/index.ts
1034
1034
  init_errors();
@@ -1266,7 +1266,10 @@ import { loadConfig as loadConfig2 } from "coffi";
1266
1266
  // src/build.ts
1267
1267
  init_errors();
1268
1268
  import path3 from "path";
1269
- import { generateDts, logIsolatedDeclarationErrors } from "bun-dts";
1269
+ import {
1270
+ generateDts,
1271
+ logIsolatedDeclarationErrors
1272
+ } from "bun-dts";
1270
1273
 
1271
1274
  // src/helpers/entry.ts
1272
1275
  init_utils();
@@ -1615,11 +1618,16 @@ async function build(partialOptions, rootDir = process.cwd()) {
1615
1618
  const dtsEntry = typeof options.dts === "object" && "entry" in options.dts ? options.dts.entry : undefined;
1616
1619
  const processableDtsEntries = dtsEntry ? getProcessableEntries(dtsEntry) : processableEntries;
1617
1620
  const dtsPromises = processableDtsEntries.map(async ({ entry, outputBasePath }) => {
1618
- const result = await generateDts(entry, {
1619
- cwd: rootDir,
1620
- preferredTsConfigPath: options.preferredTsconfigPath,
1621
- resolve: dtsResolve
1622
- });
1621
+ let result;
1622
+ try {
1623
+ result = await generateDts(entry, {
1624
+ cwd: rootDir,
1625
+ preferredTsConfigPath: options.preferredTsconfigPath,
1626
+ resolve: dtsResolve
1627
+ });
1628
+ } catch (error) {
1629
+ throw new BunupDTSBuildError(parseErrorMessage(error));
1630
+ }
1623
1631
  for (const fmt of options.format) {
1624
1632
  const extension = options.outputExtension?.({
1625
1633
  format: fmt,
package/dist/index.cjs CHANGED
@@ -338,6 +338,19 @@ class BunupBuildError extends BunupError {
338
338
  }
339
339
  }
340
340
 
341
+ class BunupDTSBuildError extends BunupError {
342
+ constructor(message) {
343
+ super(message);
344
+ this.name = "BunupDTSBuildError";
345
+ }
346
+ }
347
+ var parseErrorMessage = (error) => {
348
+ if (error instanceof Error) {
349
+ return error.message;
350
+ }
351
+ return String(error);
352
+ };
353
+
341
354
  // src/utils.ts
342
355
  var import_promises = __toESM(require("fs/promises"));
343
356
  var import_node_path = __toESM(require("path"));
@@ -744,11 +757,16 @@ async function build(partialOptions, rootDir = process.cwd()) {
744
757
  const dtsEntry = typeof options.dts === "object" && "entry" in options.dts ? options.dts.entry : undefined;
745
758
  const processableDtsEntries = dtsEntry ? getProcessableEntries(dtsEntry) : processableEntries;
746
759
  const dtsPromises = processableDtsEntries.map(async ({ entry, outputBasePath }) => {
747
- const result = await import_bun_dts.generateDts(entry, {
748
- cwd: rootDir,
749
- preferredTsConfigPath: options.preferredTsconfigPath,
750
- resolve: dtsResolve
751
- });
760
+ let result;
761
+ try {
762
+ result = await import_bun_dts.generateDts(entry, {
763
+ cwd: rootDir,
764
+ preferredTsConfigPath: options.preferredTsconfigPath,
765
+ resolve: dtsResolve
766
+ });
767
+ } catch (error) {
768
+ throw new BunupDTSBuildError(parseErrorMessage(error));
769
+ }
752
770
  for (const fmt of options.format) {
753
771
  const extension = options.outputExtension?.({
754
772
  format: fmt,
package/dist/index.js CHANGED
@@ -96,7 +96,10 @@ function defineWorkspace(options) {
96
96
  }
97
97
  // src/build.ts
98
98
  import path2 from "path";
99
- import { generateDts, logIsolatedDeclarationErrors } from "bun-dts";
99
+ import {
100
+ generateDts,
101
+ logIsolatedDeclarationErrors
102
+ } from "bun-dts";
100
103
 
101
104
  // src/errors.ts
102
105
  var import_picocolors2 = __toESM(require_picocolors(), 1);
@@ -305,6 +308,19 @@ class BunupBuildError extends BunupError {
305
308
  }
306
309
  }
307
310
 
311
+ class BunupDTSBuildError extends BunupError {
312
+ constructor(message) {
313
+ super(message);
314
+ this.name = "BunupDTSBuildError";
315
+ }
316
+ }
317
+ var parseErrorMessage = (error) => {
318
+ if (error instanceof Error) {
319
+ return error.message;
320
+ }
321
+ return String(error);
322
+ };
323
+
308
324
  // src/utils.ts
309
325
  import fs from "fs/promises";
310
326
  import path, { normalize } from "path";
@@ -711,11 +727,16 @@ async function build(partialOptions, rootDir = process.cwd()) {
711
727
  const dtsEntry = typeof options.dts === "object" && "entry" in options.dts ? options.dts.entry : undefined;
712
728
  const processableDtsEntries = dtsEntry ? getProcessableEntries(dtsEntry) : processableEntries;
713
729
  const dtsPromises = processableDtsEntries.map(async ({ entry, outputBasePath }) => {
714
- const result = await generateDts(entry, {
715
- cwd: rootDir,
716
- preferredTsConfigPath: options.preferredTsconfigPath,
717
- resolve: dtsResolve
718
- });
730
+ let result;
731
+ try {
732
+ result = await generateDts(entry, {
733
+ cwd: rootDir,
734
+ preferredTsConfigPath: options.preferredTsconfigPath,
735
+ resolve: dtsResolve
736
+ });
737
+ } catch (error) {
738
+ throw new BunupDTSBuildError(parseErrorMessage(error));
739
+ }
719
740
  for (const fmt of options.format) {
720
741
  const extension = options.outputExtension?.({
721
742
  format: fmt,
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.8.21",
4
+ "version": "0.8.23",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@clack/prompts": "^0.10.1",
50
- "bun-dts": "^0.1.37",
50
+ "bun-dts": "^0.1.40",
51
51
  "chokidar": "^4.0.3",
52
52
  "coffi": "^0.1.31",
53
53
  "giget": "^2.0.0",