bunup 0.16.20 → 0.16.22

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
@@ -5,15 +5,17 @@
5
5
  <div align="center">
6
6
 
7
7
  <!-- markdownlint-disable-next-line no-alt-text -->
8
- ![Logo](/docs/public/logo.svg)
9
8
 
10
- ![Bunup](/assets/bunup-title.svg)
9
+ ![Logo](/docs/public/logo.svg)
11
10
 
12
- [![NPM Version](https://img.shields.io/npm/v/bunup?logo=npm&logoColor=212121&label=version&labelColor=ffc44e&color=212121)](https://npmjs.com/package/bunup)
13
- [![Built with Bun](https://img.shields.io/badge/Built_with-Bun-fbf0df?logo=bun&labelColor=212121)](https://bun.com)
14
- [![sponsor](https://img.shields.io/badge/sponsor-EA4AAA?logo=githubsponsors&labelColor=FAFAFA)](https://github.com/sponsors/arshad-yaseen)
11
+ ![Bunup](/assets/bunup-title.svg)
12
+
13
+ [![NPM Version](https://img.shields.io/npm/v/bunup?logo=npm&logoColor=212121&label=version&labelColor=ffc44e&color=212121)](https://npmjs.com/package/bunup)
14
+ [![Built with Bun](https://img.shields.io/badge/Built_with-Bun-fbf0df?logo=bun&labelColor=212121)](https://bun.com)
15
+ [![sponsor](https://img.shields.io/badge/sponsor-EA4AAA?logo=githubsponsors&labelColor=FAFAFA)](https://github.com/sponsors/arshad-yaseen)
16
+
17
+ Bunup helps you ship TypeScript/React libraries faster with great DX — built on [Bun](https://bun.com)'s native bundler.
15
18
 
16
- Bunup helps you ship TypeScript/React libraries faster with great DX — built on [Bun](https://bun.com)'s native bundler.
17
19
  </div>
18
20
  <!-- markdownlint-restore -->
19
21
 
@@ -28,7 +30,7 @@ Create a TypeScript file:
28
30
  ```ts
29
31
  // src/index.ts
30
32
  export function greet(name: string): string {
31
- return `Hello, ${name}!`;
33
+ return `Hello, ${name}!`;
32
34
  }
33
35
  ```
34
36
 
@@ -93,7 +95,7 @@ We welcome contributions! Please read the [contributing guide](CONTRIBUTING.md).
93
95
 
94
96
  <img src="https://cdn.jsdelivr.net/gh/arshad-yaseen/static/sponsors.svg" alt="Sponsors" />
95
97
 
96
- <br /><br />
98
+ <br /><br />
97
99
 
98
100
  <img src="assets/cat-footer.svg" alt="______ 🐈‍⬛ _____________" />
99
101
 
package/dist/cli/index.js CHANGED
@@ -4,13 +4,12 @@ import {
4
4
  build,
5
5
  processLoadedConfigs,
6
6
  resolveBuildOptions
7
- } from "../shared/bunup-dcmzg54s.js";
7
+ } from "../shared/bunup-v98vwe9z.js";
8
8
  import {
9
9
  BunupBuildError,
10
10
  BunupCLIError,
11
11
  BunupWatchError,
12
12
  __require,
13
- __toESM,
14
13
  ensureArray,
15
14
  formatFileSize,
16
15
  getShortFilePath,
@@ -21,13 +20,13 @@ import {
21
20
  logTime,
22
21
  logger,
23
22
  parseErrorMessage
24
- } from "../shared/bunup-t32tjrqy.js";
23
+ } from "../shared/bunup-4epc480j.js";
25
24
 
26
25
  // packages/bunup/src/cli/index.ts
27
26
  import { loadConfig } from "coffi";
28
27
  import pc4 from "picocolors";
29
28
  // packages/bunup/package.json
30
- var version = "0.16.20";
29
+ var version = "0.16.22";
31
30
 
32
31
  // packages/bunup/src/printer/print-build-report.ts
33
32
  import { promisify } from "util";
@@ -36,11 +35,7 @@ import pc from "picocolors";
36
35
  var brotliAsync = promisify(brotliCompress);
37
36
  async function printBuildReport(buildResult) {
38
37
  const options = buildResult.build.options;
39
- const {
40
- gzip = !options.compile,
41
- brotli = false,
42
- maxBundleSize
43
- } = options.report ?? {};
38
+ const { gzip = !options.compile, brotli = false, maxBundleSize } = options.report ?? {};
44
39
  if (options.compile && (brotli || gzip)) {
45
40
  throw new BunupBuildError("Brotli or Gzip size report is not available when the compile option is enabled.");
46
41
  }
@@ -79,10 +74,7 @@ async function printBuildReport(buildResult) {
79
74
  const totalGzipSize = files.reduce((sum, file) => sum + (file.gzipSize || 0), 0);
80
75
  const totalBrotliSize = files.reduce((sum, file) => sum + (file.brotliSize || 0), 0);
81
76
  const hasExecutable = files.some((f) => f.isExecutable);
82
- const labels = [
83
- ...ensureArray(options.format),
84
- ...hasExecutable ? ["executable"] : []
85
- ];
77
+ const labels = [...ensureArray(options.format), ...hasExecutable ? ["executable"] : []];
86
78
  const showLabel = labels.length > 1 || labels[0] === "cjs" || hasExecutable;
87
79
  const labelWidth = showLabel ? Math.max(...labels.map((f) => `[${f}] `.length)) : 0;
88
80
  const pathWidth = Math.max(...files.map((f) => f.fullPath.length), "Output".length);
@@ -93,10 +85,7 @@ async function printBuildReport(buildResult) {
93
85
  const diff = width - str.length;
94
86
  return align === "left" ? str + " ".repeat(Math.max(0, diff)) : " ".repeat(Math.max(0, diff)) + str;
95
87
  };
96
- const headers = [
97
- pad(" Output", pathWidth + labelWidth + 2),
98
- pad("Raw", sizeWidth, "right")
99
- ];
88
+ const headers = [pad(" Output", pathWidth + labelWidth + 2), pad("Raw", sizeWidth, "right")];
100
89
  if (gzip)
101
90
  headers.push(pad("Gzip", gzipWidth, "right"));
102
91
  if (brotli)
@@ -120,10 +109,7 @@ async function printBuildReport(buildResult) {
120
109
  const styledPath = `${pc.dim(outDirWithSlash)}${fileName}`;
121
110
  const plainPath = `${outDirWithSlash}${file.path}`;
122
111
  const filePathColumn = ` ${label}${styledPath}${" ".repeat(Math.max(0, pathWidth - plainPath.length))}`;
123
- const fileRow = [
124
- filePathColumn,
125
- pad(formatFileSize(file.size), sizeWidth, "right")
126
- ];
112
+ const fileRow = [filePathColumn, pad(formatFileSize(file.size), sizeWidth, "right")];
127
113
  if (gzip) {
128
114
  const gzipStr = file.gzipSize ? formatFileSize(file.gzipSize) : pc.dim("-");
129
115
  fileRow.push(pad(gzipStr, gzipWidth, "right"));
@@ -176,11 +162,7 @@ async function watch(userOptions, rootDir, configFilePath) {
176
162
  const watcher = chokidar.watch(Array.from(watchPaths), {
177
163
  ignoreInitial: true,
178
164
  ignorePermissionErrors: true,
179
- ignored: [
180
- /[\\/]\.git[\\/]/,
181
- /[\\/]node_modules[\\/]/,
182
- path.resolve(rootDir, options.outDir)
183
- ]
165
+ ignored: [/[\\/]\.git[\\/]/, /[\\/]node_modules[\\/]/, path.resolve(rootDir, options.outDir)]
184
166
  });
185
167
  let isRebuilding = false;
186
168
  let buildCount = 0;
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  build
4
- } from "./shared/bunup-dcmzg54s.js";
5
- import"./shared/bunup-t32tjrqy.js";
4
+ } from "./shared/bunup-v98vwe9z.js";
5
+ import"./shared/bunup-4epc480j.js";
6
6
  // packages/bunup/src/define.ts
7
7
  function defineConfig(options) {
8
8
  return options;
package/dist/plugins.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  logger,
8
8
  shims,
9
9
  unused
10
- } from "./shared/bunup-t32tjrqy.js";
10
+ } from "./shared/bunup-4epc480j.js";
11
11
 
12
12
  // packages/bunup/src/plugins/copy.ts
13
13
  import fs from "fs";
@@ -1,20 +1,4 @@
1
1
  // @bun
2
- var __create = Object.create;
3
- var __getProtoOf = Object.getPrototypeOf;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __toESM = (mod, isNodeMode, target) => {
8
- target = mod != null ? __create(__getProtoOf(mod)) : {};
9
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
- for (let key of __getOwnPropNames(mod))
11
- if (!__hasOwnProp.call(to, key))
12
- __defProp(to, key, {
13
- get: () => mod[key],
14
- enumerable: true
15
- });
16
- return to;
17
- };
18
2
  var __require = import.meta.require;
19
3
 
20
4
  // packages/bunup/src/printer/logger.ts
@@ -308,7 +292,10 @@ var handleError = (error, context) => {
308
292
  logger.error(`
309
293
  ${pc2.bgRed(` ${errorType} `)}
310
294
 
311
- ${contextPrefix}${errorMessage}`, { noIcon: true, leftPadding: true });
295
+ ${contextPrefix}${errorMessage}`, {
296
+ noIcon: true,
297
+ leftPadding: true
298
+ });
312
299
  }
313
300
  if (knownError) {
314
301
  logger.space();
@@ -939,10 +926,7 @@ function unused(options = {}) {
939
926
  }
940
927
  async function collectUsedDependencies(files, buildOptions) {
941
928
  const transpiler = new Bun.Transpiler({ loader: "ts" });
942
- const externals = [
943
- ...buildOptions.external ?? [],
944
- ...buildOptions.noExternal ?? []
945
- ];
929
+ const externals = [...buildOptions.external ?? [], ...buildOptions.noExternal ?? []];
946
930
  const usedDeps = new Set;
947
931
  const jsFiles = files.filter((f) => isJavascriptFile(f.fullPath) || isTypeScriptFile(f.fullPath));
948
932
  for (const file of jsFiles) {
@@ -1021,4 +1005,4 @@ function ensureObject(value) {
1021
1005
  return typeof value === "object" && value !== null ? value : {};
1022
1006
  }
1023
1007
 
1024
- export { __toESM, __require, logTime, logger, formatFileSize, formatListWithAnd, getShortFilePath, cleanPath, BunupBuildError, BunupDTSBuildError, BunupCLIError, BunupWatchError, BunupVersionError, parseErrorMessage, handleError, formatNoEntryPointsFoundError, formatInvalidEntryPointsError, formatBunBuildError, handleErrorAndExit, cleanOutDir, getFilesFromGlobs, isTypeScriptFile, isJavascriptFile, isGlobPattern, exports, injectStyles, shims, unused, ensureArray, ensureObject };
1008
+ export { __require, logTime, logger, formatFileSize, formatListWithAnd, getShortFilePath, cleanPath, BunupBuildError, BunupDTSBuildError, BunupCLIError, BunupWatchError, BunupVersionError, parseErrorMessage, handleError, formatNoEntryPointsFoundError, formatInvalidEntryPointsError, formatBunBuildError, handleErrorAndExit, cleanOutDir, getFilesFromGlobs, isTypeScriptFile, isJavascriptFile, isGlobPattern, exports, injectStyles, shims, unused, ensureArray, ensureObject };
@@ -19,7 +19,7 @@ import {
19
19
  parseErrorMessage,
20
20
  shims,
21
21
  unused
22
- } from "./bunup-t32tjrqy.js";
22
+ } from "./bunup-4epc480j.js";
23
23
 
24
24
  // packages/bunup/src/loaders.ts
25
25
  import path from "path";
package/package.json CHANGED
@@ -1,11 +1,34 @@
1
1
  {
2
2
  "name": "bunup",
3
+ "version": "0.16.22",
3
4
  "description": "⚡ A blazing-fast build tool for your libraries built with Bun.",
4
- "version": "0.16.20",
5
- "type": "module",
5
+ "keywords": [
6
+ "bun",
7
+ "bun-bundler",
8
+ "bunup"
9
+ ],
10
+ "homepage": "https://bunup.dev",
11
+ "license": "MIT",
12
+ "author": "Arshad Yaseen <arshadpyaseen@gmail.com> (https://arshad.fyi)",
13
+ "maintainers": [
14
+ {
15
+ "name": "Arshad Yaseen",
16
+ "email": "arshadpyaseen@gmail.com",
17
+ "url": "https://arshad.fyi"
18
+ }
19
+ ],
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/bunup/bunup.git"
23
+ },
24
+ "funding": "https://github.com/sponsors/arshad-yaseen",
25
+ "bin": {
26
+ "bunup": "dist/cli/index.js"
27
+ },
6
28
  "files": [
7
29
  "dist"
8
30
  ],
31
+ "type": "module",
9
32
  "module": "./dist/index.js",
10
33
  "types": "./dist/index.d.ts",
11
34
  "exports": {
@@ -23,35 +46,12 @@
23
46
  },
24
47
  "./package.json": "./package.json"
25
48
  },
26
- "license": "MIT",
27
- "author": "Arshad Yaseen <arshadpyaseen@gmail.com> (https://arshad.fyi)",
28
- "maintainers": [
29
- {
30
- "name": "Arshad Yaseen",
31
- "email": "arshadpyaseen@gmail.com",
32
- "url": "https://arshad.fyi"
33
- }
34
- ],
35
- "repository": {
36
- "type": "git",
37
- "url": "git+https://github.com/bunup/bunup.git"
38
- },
39
- "funding": "https://github.com/sponsors/arshad-yaseen",
40
- "homepage": "https://bunup.dev",
41
- "keywords": [
42
- "bun",
43
- "bunup",
44
- "bun-bundler"
45
- ],
46
- "bin": {
47
- "bunup": "dist/cli/index.js"
48
- },
49
49
  "scripts": {
50
50
  "type-check": "tsc --noEmit"
51
51
  },
52
52
  "dependencies": {
53
- "@bunup/dts": "^0.14.49",
54
- "@bunup/shared": "0.16.19",
53
+ "@bunup/dts": "^0.14.50",
54
+ "@bunup/shared": "0.16.20",
55
55
  "chokidar": "^5.0.0",
56
56
  "coffi": "^0.1.37",
57
57
  "lightningcss": "^1.30.2",
@@ -60,6 +60,9 @@
60
60
  "tree-kill": "^1.2.2",
61
61
  "zlye": "^0.4.4"
62
62
  },
63
+ "devDependencies": {
64
+ "@types/bun": "^1.3.6"
65
+ },
63
66
  "peerDependencies": {
64
67
  "typescript": "latest"
65
68
  },
@@ -67,8 +70,5 @@
67
70
  "typescript": {
68
71
  "optional": true
69
72
  }
70
- },
71
- "devDependencies": {
72
- "@types/bun": "^1.3.6"
73
73
  }
74
74
  }