bunup 0.11.0 → 0.11.2

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
  createBuildOptions,
6
6
  processLoadedConfigs
7
- } from "../shared/chunk-55gvdg0x.js";
7
+ } from "../shared/bunup-qnygs651.js";
8
8
  import {
9
9
  BunupCLIError,
10
10
  BunupWatchError,
@@ -18,13 +18,13 @@ import {
18
18
  logger,
19
19
  parseErrorMessage,
20
20
  setSilent
21
- } from "../shared/chunk-hyatyqn5.js";
21
+ } from "../shared/bunup-q39v2kct.js";
22
22
 
23
23
  // src/cli/index.ts
24
24
  import { loadConfig } from "coffi";
25
25
  import pc3 from "picocolors";
26
26
  // package.json
27
- var version = "0.11.0";
27
+ var version = "0.11.2";
28
28
 
29
29
  // src/watch.ts
30
30
  import path from "path";
@@ -61,7 +61,8 @@ async function watch(partialOptions, rootDir) {
61
61
  await build({ ...options, silent: !initial }, rootDir);
62
62
  if (!initial) {
63
63
  console.clear();
64
- console.log(`${rebuildCount > 1 ? pc.magenta(`[x${rebuildCount}] `) : ""}${pc.green(`Rebuilt in ${logTime(performance.now() - start)}`)}: ${changed}`);
64
+ console.log("");
65
+ console.log(`${rebuildCount > 1 ? pc.magenta(`[x${rebuildCount}] `) : ""}${pc.green(`Rebuilt in ${logTime(performance.now() - start)}`)}: ${changed}${options.name ? ` ${pc.bgBlueBright(` ${options.name} `)}` : ""} `);
65
66
  }
66
67
  rebuildCount++;
67
68
  } catch (error) {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Arrayable, BuildOptions, DefineConfigItem, DefineWorkspaceItem, Plugin, WithOptional } from "./shared/chunk-d8x7sy99";
1
+ import { Arrayable, BuildOptions, DefineConfigItem, DefineWorkspaceItem, Plugin, WithOptional } from "./shared/bunup-rhnc0fq5";
2
2
  declare function build(partialOptions: Partial<BuildOptions>, rootDir?: string): Promise<void>;
3
3
  declare function defineConfig(options: Arrayable<DefineConfigItem>): Arrayable<DefineConfigItem>;
4
4
  declare function defineWorkspace(options: WithOptional<DefineWorkspaceItem, "config">[], sharedOptions?: Partial<DefineConfigItem>): DefineWorkspaceItem[];
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  build
4
- } from "./shared/chunk-55gvdg0x.js";
5
- import"./shared/chunk-hyatyqn5.js";
4
+ } from "./shared/bunup-qnygs651.js";
5
+ import"./shared/bunup-q39v2kct.js";
6
6
  // src/define.ts
7
7
  function defineConfig(options) {
8
8
  return options;
package/dist/plugins.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BuildContext, BunupPlugin, MaybePromise, Plugin } from "./shared/chunk-d8x7sy99";
1
+ import { BuildContext, BunupPlugin, MaybePromise, Plugin } from "./shared/bunup-rhnc0fq5";
2
2
  /**
3
3
  * A plugin that copies files and directories to the output directory.
4
4
  *
package/dist/plugins.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  getPackageForPlugin,
10
10
  isDirectoryPath,
11
11
  logger
12
- } from "./shared/chunk-hyatyqn5.js";
12
+ } from "./shared/bunup-q39v2kct.js";
13
13
 
14
14
  // src/plugins/built-in/copy.ts
15
15
  import { basename, join } from "path";
@@ -238,6 +238,19 @@ var KNOWN_ERRORS = [
238
238
  logSolution: () => {
239
239
  logger.log("An error occurred while bundling dts files. This issue occurs when dts splitting is enabled due to a bug in the Bun bundler. Please ping the GitHub issue to help get it fixed faster: " + link("https://github.com/oven-sh/bun/issues/5344") + ". To fix this issue for now, you can disable dts splitting by removing " + pc2.dim("dts: { splitting: true }") + " from your config." + " You can re-enable it once the issue is fixed.");
240
240
  }
241
+ },
242
+ {
243
+ pattern: /Multiple files share the same output path/i,
244
+ errorType: "BUILD ERROR",
245
+ logSolution: () => {
246
+ logger.log(pc2.yellow("CSS Import Detected") + `
247
+
248
+ You're importing CSS files in JavaScript. To bundle styles properly, use the ` + pc2.green("injectStyles()") + ` plugin.
249
+
250
+ ` + pc2.dim("This plugin transforms CSS imports into JavaScript that automatically ") + pc2.dim(`injects styles into the document head at runtime.
251
+
252
+ `) + "Learn more: " + pc2.blue("https://bunup.dev/docs/plugins/inject-styles"));
253
+ }
241
254
  }
242
255
  ];
243
256
  var handleError = (error, context) => {
@@ -20,7 +20,7 @@ import {
20
20
  runPluginBuildStartHooks,
21
21
  setSilent,
22
22
  silent
23
- } from "./chunk-hyatyqn5.js";
23
+ } from "./bunup-q39v2kct.js";
24
24
 
25
25
  // src/loaders.ts
26
26
  import path from "path";
@@ -225,7 +225,7 @@ interface BuildOptions {
225
225
  * without modification. However, bundling your server code can reduce startup times and
226
226
  * improve running performance.
227
227
  *
228
- * All bundles generated with `target: "bun"` are marked with a special `// @bun` pragma, which
228
+ * All bundles generated with \`target: "bun"\` are marked with a special \`// @bun\` pragma, which
229
229
  * indicates to the Bun runtime that there's no need to re-transpile the file before execution.
230
230
  */
231
231
  target?: Target;
@@ -250,7 +250,18 @@ interface BuildOptions {
250
250
  * sourcemap: true // equivalent to 'inline'
251
251
  */
252
252
  sourcemap?: Sourcemap;
253
- /**\\n\\t* Define global constants for the build\\n\\t* These values will be replaced at build time\\n\\t*\\n\\t* @see https://bun.sh/docs/bundler#define\\n\\t*\\n\\t* @example\\n\\t* define: {\\n\\t* 'process.env.NODE_ENV': '"production"',\\n\\t* 'PACKAGE_VERSION': '"1.0.0"'\\n\\t* }\\n\\t*/
253
+ /**
254
+ * Define global constants for the build
255
+ * These values will be replaced at build time
256
+ *
257
+ * @see https://bun.sh/docs/bundler#define
258
+ *
259
+ * @example
260
+ * define: {
261
+ * 'process.env.NODE_ENV': '"production"',
262
+ * 'PACKAGE_VERSION': '"1.0.0"'
263
+ * }
264
+ */
254
265
  define?: Define;
255
266
  /**
256
267
  * A callback or command to run after a successful build.
@@ -274,7 +285,14 @@ interface BuildOptions {
274
285
  * }
275
286
  */
276
287
  onSuccess?: OnSuccess;
277
- /**\\n\\t* A banner to be added to the final bundle, this can be a directive like "use client" for react or a comment block such as a license for the code.\\n\\t*\\n\\t* @see https://bun.sh/docs/bundler#banner\\n\\t*\\n\\t* @example\\n\\t* banner: '"use client";'\\n\\t*/
288
+ /**
289
+ * A banner to be added to the final bundle, this can be a directive like "use client" for react or a comment block such as a license for the code.
290
+ *
291
+ * @see https://bun.sh/docs/bundler#banner
292
+ *
293
+ * @example
294
+ * banner: '"use client";'
295
+ */
278
296
  banner?: string;
279
297
  /**
280
298
  * A footer to be added to the final bundle, this can be something like a comment block for a license or just a fun easter egg.
@@ -339,12 +357,12 @@ interface BuildOptions {
339
357
  * Controls how environment variables are handled during bundling.
340
358
  *
341
359
  * Can be one of:
342
- * - `"inline"`: Replaces all `process.env.FOO` references in your code with the actual values
360
+ * - \`"inline"\`: Replaces all \`process.env.FOO\` references in your code with the actual values
343
361
  * of those environment variables at the time the build runs.
344
- * - `"disable"`: Disables environment variable injection entirely, leaving `process.env.*` as-is.
345
- * - A string ending in `*`: Only inlines environment variables matching the given prefix.
346
- * For example, `"MY_PUBLIC_*"` will inline variables like `MY_PUBLIC_API_URL`.
347
- * - An object of key-value pairs: Replaces both `process.env.KEY` and `import.meta.env.KEY`
362
+ * - \`"disable"\`: Disables environment variable injection entirely, leaving \`process.env.*\` as-is.
363
+ * - A string ending in \`*\`: Only inlines environment variables matching the given prefix.
364
+ * For example, \`"MY_PUBLIC_*"\` will inline variables like \`MY_PUBLIC_API_URL\`.
365
+ * - An object of key-value pairs: Replaces both \`process.env.KEY\` and \`import.meta.env.KEY\`
348
366
  * with the provided values, regardless of the runtime environment.
349
367
  *
350
368
  * Note: Values are injected at build time. Secrets or private keys should be excluded
@@ -376,7 +394,39 @@ interface BuildOptions {
376
394
  * Force emitting @__PURE__ annotations even if minify.whitespace is true.
377
395
  */
378
396
  emitDCEAnnotations?: boolean;
379
- /**\\n\\t* Plugins to extend the build process functionality\\n\\t*\\n\\t* The Plugin type uses a discriminated union pattern with the 'type' field\\n\\t* to support different plugin systems. Both "bun" and "bunup" plugins are supported.\\n\\t*\\n\\t* Each plugin type has its own specific plugin implementation:\\n\\t* - "bun": Uses Bun's native plugin system (BunPlugin)\\n\\t* - "bunup": Uses bunup's own plugin system with lifecycle hooks\\n\\t*\\n\\t* This architecture allows for extensibility as more plugin systems are added.\\n\\t*\\n\\t* @see https://bunup.dev/docs/advanced/plugin-development for more information on plugins\\n\\t*\\n\\t* @example\\n\\t* plugins: [\\n\\t* {\\n\\t* type: "bun",\\n\\t* plugin: myBunPlugin()\\n\\t* },\\n\\t* {\\n\\t* type: "bunup",\\n\\t* hooks: {\\n\\t* onBuildStart: (options) => {\\n\\t* console.log('Build started with options:', options)\\n\\t* },\\n\\t* onBuildDone: ({ options, output }) => {\\n\\t* console.log('Build completed with output:', output)\\n\\t* }\\n\\t* }\\n\\t* }\\n\\t* ]\\n\\t*/
397
+ /**
398
+ * Plugins to extend the build process functionality
399
+ *
400
+ * The Plugin type uses a discriminated union pattern with the 'type' field
401
+ * to support different plugin systems. Both "bun" and "bunup" plugins are supported.
402
+ *
403
+ * Each plugin type has its own specific plugin implementation:
404
+ * - "bun": Uses Bun's native plugin system (BunPlugin)
405
+ * - "bunup": Uses bunup's own plugin system with lifecycle hooks
406
+ *
407
+ * This architecture allows for extensibility as more plugin systems are added.
408
+ *
409
+ * @see https://bunup.dev/docs/advanced/plugin-development for more information on plugins
410
+ *
411
+ * @example
412
+ * plugins: [
413
+ * {
414
+ * type: "bun",
415
+ * plugin: myBunPlugin()
416
+ * },
417
+ * {
418
+ * type: "bunup",
419
+ * hooks: {
420
+ * onBuildStart: (options) => {
421
+ * console.log('Build started with options:', options)
422
+ * },
423
+ * onBuildDone: ({ options, output }) => {
424
+ * console.log('Build completed with output:', output)
425
+ * }
426
+ * }
427
+ * }
428
+ * ]
429
+ */
380
430
  plugins?: Plugin[];
381
431
  }
382
432
  type MaybePromise<T> = Promise<T> | T;
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.11.0",
4
+ "version": "0.11.2",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -51,12 +51,12 @@
51
51
  "picocolors": "^1.1.1",
52
52
  "tinyexec": "^1.0.1",
53
53
  "tree-kill": "^1.2.2",
54
- "typeroll": "^0.6.22"
54
+ "typeroll": "^0.7.3"
55
55
  },
56
56
  "devDependencies": {
57
- "@biomejs/biome": "2.0.0",
57
+ "@biomejs/biome": "2.2.0",
58
58
  "@types/bun": "^1.2.20",
59
- "bumpp": "^10.2.2",
59
+ "bumpp": "^10.2.3",
60
60
  "lightningcss": "^1.30.1",
61
61
  "simple-git-hooks": "^2.13.1",
62
62
  "typescript": "^5.9.2"