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 +5 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +1 -1
- package/dist/shared/{chunk-hyatyqn5.js → bunup-q39v2kct.js} +13 -0
- package/dist/shared/{chunk-55gvdg0x.js → bunup-qnygs651.js} +1 -1
- package/dist/shared/{chunk-d8x7sy99.d.ts → bunup-rhnc0fq5.d.ts} +59 -9
- package/package.json +4 -4
package/dist/cli/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
build,
|
|
5
5
|
createBuildOptions,
|
|
6
6
|
processLoadedConfigs
|
|
7
|
-
} from "../shared/
|
|
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/
|
|
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.
|
|
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(
|
|
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/
|
|
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
package/dist/plugins.d.ts
CHANGED
package/dist/plugins.js
CHANGED
|
@@ -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) => {
|
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
* -
|
|
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
|
-
* -
|
|
345
|
-
* - A string ending in
|
|
346
|
-
* For example,
|
|
347
|
-
* - An object of key-value pairs: Replaces both
|
|
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
|
-
|
|
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.
|
|
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.
|
|
54
|
+
"typeroll": "^0.7.3"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@biomejs/biome": "2.
|
|
57
|
+
"@biomejs/biome": "2.2.0",
|
|
58
58
|
"@types/bun": "^1.2.20",
|
|
59
|
-
"bumpp": "^10.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"
|