bunup 0.8.6 → 0.8.7
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.js +13 -8
- package/dist/index.cjs +1 -6
- package/dist/index.js +1 -6
- package/dist/plugins.cjs +13 -1
- package/dist/plugins.d.cts +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +13 -1
- package/package.json +2 -3
package/dist/cli.js
CHANGED
|
@@ -251,7 +251,7 @@ var init_logger = __esm(() => {
|
|
|
251
251
|
});
|
|
252
252
|
|
|
253
253
|
// src/errors.ts
|
|
254
|
-
var import_picocolors2, BunupError, BunupBuildError, BunupDTSBuildError, BunupCLIError, BunupWatchError, parseErrorMessage = (error) => {
|
|
254
|
+
var import_picocolors2, BunupError, BunupBuildError, BunupDTSBuildError, BunupCLIError, BunupWatchError, BunupPluginError, parseErrorMessage = (error) => {
|
|
255
255
|
if (error instanceof Error) {
|
|
256
256
|
return error.message;
|
|
257
257
|
}
|
|
@@ -268,6 +268,8 @@ var import_picocolors2, BunupError, BunupBuildError, BunupDTSBuildError, BunupCL
|
|
|
268
268
|
errorType = "CLI ERROR";
|
|
269
269
|
} else if (error instanceof BunupWatchError) {
|
|
270
270
|
errorType = "WATCH ERROR";
|
|
271
|
+
} else if (error instanceof BunupPluginError) {
|
|
272
|
+
errorType = "PLUGIN ERROR";
|
|
271
273
|
} else if (error instanceof BunupError) {
|
|
272
274
|
errorType = "BUNUP ERROR";
|
|
273
275
|
}
|
|
@@ -321,6 +323,12 @@ var init_errors = __esm(() => {
|
|
|
321
323
|
this.name = "BunupWatchError";
|
|
322
324
|
}
|
|
323
325
|
};
|
|
326
|
+
BunupPluginError = class BunupPluginError extends BunupError {
|
|
327
|
+
constructor(message) {
|
|
328
|
+
super(message);
|
|
329
|
+
this.name = "BunupPluginError";
|
|
330
|
+
}
|
|
331
|
+
};
|
|
324
332
|
KNOWN_ERRORS = [
|
|
325
333
|
{
|
|
326
334
|
pattern: /Could not resolve: "bun"/i,
|
|
@@ -552,7 +560,7 @@ var init_new = __esm(() => {
|
|
|
552
560
|
// src/cli/index.ts
|
|
553
561
|
import { exec } from "tinyexec";
|
|
554
562
|
// package.json
|
|
555
|
-
var version = "0.8.
|
|
563
|
+
var version = "0.8.7";
|
|
556
564
|
|
|
557
565
|
// src/cli/index.ts
|
|
558
566
|
init_errors();
|
|
@@ -970,6 +978,7 @@ function externalOptionPlugin(options, packageJson) {
|
|
|
970
978
|
|
|
971
979
|
// src/plugins/utils.ts
|
|
972
980
|
var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
981
|
+
init_errors();
|
|
973
982
|
function filterBunupBunPlugins(plugins) {
|
|
974
983
|
if (!plugins)
|
|
975
984
|
return [];
|
|
@@ -1059,12 +1068,7 @@ async function build(partialOptions, rootDir = process.cwd()) {
|
|
|
1059
1068
|
});
|
|
1060
1069
|
for (const log of result.logs) {
|
|
1061
1070
|
if (log.level === "error") {
|
|
1062
|
-
|
|
1063
|
-
`);
|
|
1064
|
-
console.log(log);
|
|
1065
|
-
console.log(`
|
|
1066
|
-
`);
|
|
1067
|
-
throw new Error;
|
|
1071
|
+
throw new BunupBuildError(log.message);
|
|
1068
1072
|
}
|
|
1069
1073
|
if (log.level === "warning")
|
|
1070
1074
|
logger.warn(log.message);
|
|
@@ -1183,6 +1187,7 @@ async function watch(partialOptions, rootDir) {
|
|
|
1183
1187
|
}
|
|
1184
1188
|
isRebuilding = true;
|
|
1185
1189
|
try {
|
|
1190
|
+
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
1186
1191
|
const start = performance.now();
|
|
1187
1192
|
await build(options, rootDir);
|
|
1188
1193
|
if (!initial) {
|
package/dist/index.cjs
CHANGED
|
@@ -600,12 +600,7 @@ async function build(partialOptions, rootDir = process.cwd()) {
|
|
|
600
600
|
});
|
|
601
601
|
for (const log of result.logs) {
|
|
602
602
|
if (log.level === "error") {
|
|
603
|
-
|
|
604
|
-
`);
|
|
605
|
-
console.log(log);
|
|
606
|
-
console.log(`
|
|
607
|
-
`);
|
|
608
|
-
throw new Error;
|
|
603
|
+
throw new BunupBuildError(log.message);
|
|
609
604
|
}
|
|
610
605
|
if (log.level === "warning")
|
|
611
606
|
logger.warn(log.message);
|
package/dist/index.js
CHANGED
|
@@ -567,12 +567,7 @@ async function build(partialOptions, rootDir = process.cwd()) {
|
|
|
567
567
|
});
|
|
568
568
|
for (const log of result.logs) {
|
|
569
569
|
if (log.level === "error") {
|
|
570
|
-
|
|
571
|
-
`);
|
|
572
|
-
console.log(log);
|
|
573
|
-
console.log(`
|
|
574
|
-
`);
|
|
575
|
-
throw new Error;
|
|
570
|
+
throw new BunupBuildError(log.message);
|
|
576
571
|
}
|
|
577
572
|
if (log.level === "warning")
|
|
578
573
|
logger.warn(log.message);
|
package/dist/plugins.cjs
CHANGED
|
@@ -367,6 +367,18 @@ var import_node_path = __toESM(require("path"));
|
|
|
367
367
|
|
|
368
368
|
// src/errors.ts
|
|
369
369
|
var import_picocolors2 = __toESM(require_picocolors());
|
|
370
|
+
class BunupError extends Error {
|
|
371
|
+
constructor(message) {
|
|
372
|
+
super(message);
|
|
373
|
+
this.name = "BunupError";
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
class BunupPluginError extends BunupError {
|
|
377
|
+
constructor(message) {
|
|
378
|
+
super(message);
|
|
379
|
+
this.name = "BunupPluginError";
|
|
380
|
+
}
|
|
381
|
+
}
|
|
370
382
|
|
|
371
383
|
// src/utils.ts
|
|
372
384
|
function getJsonSpaceCount(fileContent) {
|
|
@@ -560,7 +572,7 @@ async function getPackageForPlugin(name, pluginName) {
|
|
|
560
572
|
try {
|
|
561
573
|
pkg = await import(name);
|
|
562
574
|
} catch {
|
|
563
|
-
throw new
|
|
575
|
+
throw new BunupPluginError(`[${import_picocolors4.default.cyan(name)}] is required for the ${pluginName} plugin. Please install it with: ${import_picocolors4.default.blue(`bun add ${name} --dev`)}`);
|
|
564
576
|
}
|
|
565
577
|
return pkg;
|
|
566
578
|
}
|
package/dist/plugins.d.cts
CHANGED
|
@@ -407,7 +407,7 @@ type InjectStylesPluginOptions = Pick<import("lightningcss").TransformOptions<im
|
|
|
407
407
|
/**
|
|
408
408
|
* A plugin that injects styles into the document head.
|
|
409
409
|
*
|
|
410
|
-
* @see https://bunup.dev/docs/plugins/css#
|
|
410
|
+
* @see https://bunup.dev/docs/plugins/css#injectstyles
|
|
411
411
|
*/
|
|
412
412
|
declare function injectStyles(options?: InjectStylesPluginOptions): Plugin;
|
|
413
413
|
export { shims, report, injectStyles, filterJsDtsFiles, exports };
|
package/dist/plugins.d.ts
CHANGED
|
@@ -407,7 +407,7 @@ type InjectStylesPluginOptions = Pick<import("lightningcss").TransformOptions<im
|
|
|
407
407
|
/**
|
|
408
408
|
* A plugin that injects styles into the document head.
|
|
409
409
|
*
|
|
410
|
-
* @see https://bunup.dev/docs/plugins/css#
|
|
410
|
+
* @see https://bunup.dev/docs/plugins/css#injectstyles
|
|
411
411
|
*/
|
|
412
412
|
declare function injectStyles(options?: InjectStylesPluginOptions): Plugin;
|
|
413
413
|
export { shims, report, injectStyles, filterJsDtsFiles, exports };
|
package/dist/plugins.js
CHANGED
|
@@ -332,6 +332,18 @@ import path, { normalize } from "path";
|
|
|
332
332
|
|
|
333
333
|
// src/errors.ts
|
|
334
334
|
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
335
|
+
class BunupError extends Error {
|
|
336
|
+
constructor(message) {
|
|
337
|
+
super(message);
|
|
338
|
+
this.name = "BunupError";
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
class BunupPluginError extends BunupError {
|
|
342
|
+
constructor(message) {
|
|
343
|
+
super(message);
|
|
344
|
+
this.name = "BunupPluginError";
|
|
345
|
+
}
|
|
346
|
+
}
|
|
335
347
|
|
|
336
348
|
// src/utils.ts
|
|
337
349
|
function getJsonSpaceCount(fileContent) {
|
|
@@ -525,7 +537,7 @@ async function getPackageForPlugin(name, pluginName) {
|
|
|
525
537
|
try {
|
|
526
538
|
pkg = await import(name);
|
|
527
539
|
} catch {
|
|
528
|
-
throw new
|
|
540
|
+
throw new BunupPluginError(`[${import_picocolors4.default.cyan(name)}] is required for the ${pluginName} plugin. Please install it with: ${import_picocolors4.default.blue(`bun add ${name} --dev`)}`);
|
|
529
541
|
}
|
|
530
542
|
return pkg;
|
|
531
543
|
}
|
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.
|
|
4
|
+
"version": "0.8.7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -47,11 +47,10 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@clack/prompts": "^0.10.1",
|
|
50
|
-
"bun-dts": "^0.1.
|
|
50
|
+
"bun-dts": "^0.1.28",
|
|
51
51
|
"chokidar": "^4.0.3",
|
|
52
52
|
"coffi": "^0.1.29",
|
|
53
53
|
"giget": "^2.0.0",
|
|
54
|
-
"package-manager-detector": "^1.2.0",
|
|
55
54
|
"replace-in-file": "^8.3.0",
|
|
56
55
|
"tinyexec": "^1.0.1"
|
|
57
56
|
},
|