bunup 0.8.50 → 0.8.52

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
@@ -12,7 +12,9 @@
12
12
 
13
13
  [![NPM Downloads](https://img.shields.io/npm/dm/bunup?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTMyMCAyODAtNTIwbDU2LTU4IDEwNCAxMDR2LTMyNmg4MHYzMjZsMTA0LTEwNCA1NiA1OC0yMDAgMjAwWk0xNjAtMTYwdi0yMDBoODB2MTIwaDQ4MHYtMTIwaDgwdjIwMEgxNjBaIi8%2BPC9zdmc%2B&labelColor=ffc44e&color=212121)](https://www.npmjs.com/package/bunup) [![NPM Version](https://img.shields.io/npm/v/bunup?logo=npm&logoColor=212121&label=version&labelColor=ffc44e&color=212121)](https://npmjs.com/package/bunup) [![Built with Bun](https://img.shields.io/badge/Built_with-Bun-fbf0df?logo=bun&labelColor=212121)](https://bun.sh) [![sponsor](https://img.shields.io/badge/sponsor-EA4AAA?logo=githubsponsors&labelColor=FAFAFA)](https://github.com/sponsors/arshad-yaseen)
14
14
 
15
- Bunup is the **blazing-fast build tool** for TypeScript and JavaScript libraries, designed for flawless developer experience and speed, **powered by Bun**.
15
+ Bunup is the **blazing-fast build tool** for TypeScript and JavaScript libraries, designed for flawless developer experience and speed, **powered by Bun**.
16
+
17
+ It's the fastest library bundler out there - [see benchmarks](https://gugustinette.github.io/bundler-benchmark/).
16
18
 
17
19
  ![bunup-demo](/assets/demo.gif)
18
20
 
@@ -1,11 +1,11 @@
1
1
  // @bun
2
2
  import {
3
3
  displayBunupGradientArt
4
- } from "./chunk-qy8akfev.js";
4
+ } from "./chunk-mf58dgyw.js";
5
5
  import {
6
6
  link,
7
7
  pathExistsSync
8
- } from "./chunk-y0jgbvca.js";
8
+ } from "./chunk-kk5yc8cy.js";
9
9
 
10
10
  // src/cli/new.ts
11
11
  import { renameSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BunupPluginError
3
- } from "./chunk-y0jgbvca.js";
3
+ } from "./chunk-kk5yc8cy.js";
4
4
 
5
5
  // src/plugins/utils.ts
6
6
  import pc from "picocolors";
@@ -4,11 +4,11 @@ import {
4
4
  } from "./chunk-5v78yfze.js";
5
5
  import {
6
6
  displayBunupGradientArt
7
- } from "./chunk-qy8akfev.js";
7
+ } from "./chunk-mf58dgyw.js";
8
8
  import {
9
9
  formatListWithAnd,
10
10
  link
11
- } from "./chunk-y0jgbvca.js";
11
+ } from "./chunk-kk5yc8cy.js";
12
12
 
13
13
  // src/cli/init.ts
14
14
  import fs from "fs";
@@ -426,4 +426,4 @@ function returnPathIfExists(path2) {
426
426
  return pathExistsSync(path2) ? path2 : null;
427
427
  }
428
428
 
429
- export { __toESM, __require, JS_RE, JS_TS_RE, JS_DTS_RE, CSS_RE, setSilent, logTable, link, logger, BunupBuildError, BunupCLIError, BunupWatchError, BunupPluginError, parseErrorMessage, handleError, handleErrorAndExit, ensureArray, getDefaultOutputExtension, getDefaultDtsExtention, getDeclarationExtensionFromJsExtension, formatTime, getPackageDeps, formatFileSize, getShortFilePath, cleanOutDir, cleanPath, isDirectoryPath, pathExistsSync, formatListWithAnd, getFilesFromGlobs, isDev, generateRandomString, isNullOrUndefined, isTypeScriptFile, getExtension, replaceExtension, deleteExtension, returnPathIfExists };
429
+ export { __toESM, __require, setSilent, logTable, link, logger, JS_RE, JS_TS_RE, JS_DTS_RE, CSS_RE, BunupBuildError, BunupDTSBuildError, BunupCLIError, BunupWatchError, BunupPluginError, parseErrorMessage, handleError, handleErrorAndExit, ensureArray, getDefaultOutputExtension, getDefaultDtsExtention, getDeclarationExtensionFromJsExtension, formatTime, getPackageDeps, formatFileSize, getShortFilePath, cleanOutDir, cleanPath, isDirectoryPath, pathExistsSync, formatListWithAnd, getFilesFromGlobs, isDev, generateRandomString, isNullOrUndefined, isTypeScriptFile, getExtension, replaceExtension, deleteExtension, returnPathIfExists };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-y0jgbvca.js";
3
+ } from "./chunk-kk5yc8cy.js";
4
4
 
5
5
  // src/cli/utils.ts
6
6
  import pc from "picocolors";
@@ -3,13 +3,14 @@ import {
3
3
  filterBunupPlugins,
4
4
  runPluginBuildDoneHooks,
5
5
  runPluginBuildStartHooks
6
- } from "./chunk-t9xma3m6.js";
6
+ } from "./chunk-cv4z06x8.js";
7
7
  import {
8
8
  loadPackageJson,
9
9
  loadTsConfig
10
10
  } from "./chunk-5v78yfze.js";
11
11
  import {
12
12
  BunupBuildError,
13
+ BunupDTSBuildError,
13
14
  JS_RE,
14
15
  cleanOutDir,
15
16
  cleanPath,
@@ -30,10 +31,11 @@ import {
30
31
  link,
31
32
  logTable,
32
33
  logger,
34
+ parseErrorMessage,
33
35
  replaceExtension,
34
36
  returnPathIfExists,
35
37
  setSilent
36
- } from "./chunk-y0jgbvca.js";
38
+ } from "./chunk-kk5yc8cy.js";
37
39
 
38
40
  // src/build.ts
39
41
  import path2 from "path";
@@ -306,88 +308,79 @@ function handleNamespace(stmt) {
306
308
 
307
309
  // src/dts/logger.ts
308
310
  import pc from "picocolors";
309
-
310
- // src/constants/index.ts
311
- var BUNUP_DOCS_URL = "https://bunup.dev/docs";
312
- var UNDERSTANDING_ISOLATED_DECLARATIONS_URL = "https://github.com/arshad-yaseen/bunup/blob/main/docs/isolated-declarations.md";
313
-
314
- // src/dts/logger.ts
315
- function logIsolatedDeclarationErrors(errors) {
316
- let hasSeverityError = false;
317
- for (const error of errors) {
318
- if (error.error.severity === "Error") {
319
- hasSeverityError = true;
320
- }
321
- logSingle(error);
311
+ var SEVERITY_CONFIG = {
312
+ dev: {
313
+ Error: { color: pc.yellow, prefix: "WARN" },
314
+ Warning: { color: pc.yellow, prefix: "WARN" },
315
+ Advice: { color: pc.blue, prefix: "ADVICE" },
316
+ default: { color: pc.blue, prefix: "WARN" }
317
+ },
318
+ prod: {
319
+ Error: { color: pc.red, prefix: "Error" },
320
+ Warning: { color: pc.yellow, prefix: "Warning" },
321
+ Advice: { color: pc.blue, prefix: "Advice" },
322
+ default: { color: pc.red, prefix: "Error" }
322
323
  }
323
- if (hasSeverityError) {
324
- if (isDev()) {
325
- console.log(`
326
- ${pc.yellow("Please address the suggestions above before publishing your package.")}
327
- `);
328
- }
329
- console.log(`${pc.cyan("Why?")} ${pc.underline(UNDERSTANDING_ISOLATED_DECLARATIONS_URL)}
330
- `);
331
- if (!isDev()) {
324
+ };
325
+ var ISOLATED_DECLARATION_ERRORS = {
326
+ TS9007: `Function requires an explicit return type, e.g., \`function foo(): ${pc.green("string")} { ... }\`.`,
327
+ TS9008: `Method requires an explicit return type, e.g., \`myMethod(): ${pc.green("number")} { ... }\`.`,
328
+ TS9009: "Ensure at least one accessor (getter/setter) has an explicit return type.",
329
+ TS9010: `Variable requires an explicit type annotation, e.g., \`let name: ${pc.green("string")} = "Bob";\`.`,
330
+ TS9011: `Function parameter requires an explicit type, e.g., \`(param: ${pc.green("number")}) => {}\`.`,
331
+ TS9012: `Class property requires an explicit type, e.g., \`class MyClass { id: ${pc.green("number")}; }\`.`,
332
+ TS9013: "Expression type cannot be inferred. Add a type annotation where this expression is assigned or used.",
333
+ TS9014: "Computed property names must be simple (e.g., string/number literals or basic identifiers).",
334
+ TS9015: "Object spread properties prevent type inference. Either add an explicit type to the object or avoid spread.",
335
+ TS9016: "Object shorthand properties prevent type inference. Either add an explicit type to the object or use full `key: value` syntax.",
336
+ TS9017: `For array type inference, use \`as const\` (e.g., \`[1, 2, 3] ${pc.green("as const")}\`).`,
337
+ TS9018: "Array spread elements prevent type inference. Either add an explicit type to the array or avoid spread.",
338
+ TS9019: `Avoid direct export of destructured bindings. Instead, declare and then export, e.g., \`const { x } = obj; ${pc.green("export { x };")}\`.`,
339
+ TS9020: "Enum member initializers must be simple, constant values (like numbers or strings), not expressions or external references.",
340
+ TS9021: "The `extends` clause must refer to a direct class name, not an expression.",
341
+ TS9022: `Class expressions cannot infer types. Assign the class expression to an explicitly typed variable, e.g., \`const MyClass: ${pc.green("typeof OtherClass")} = class { ... };\`.`,
342
+ TS9023: `Properties assigned to functions must be explicitly declared on the function type/interface, e.g., \`interface MyFunc { (): void; ${pc.green("myProp: string;")} }\`.`,
343
+ TS9025: `Parameter can implicitly be \`undefined\`. Explicitly add \`| undefined\` to its type, e.g., \`param?: string\` becomes \`param: ${pc.green("string | undefined")}\`.`,
344
+ TS9037: `Default export requires an explicit type, e.g., \`const MyValue: ${pc.green("number")} = 42; export default MyValue;\`.`,
345
+ TS9038: "Computed property names in class/object literals must be simple (string/number literals or plain identifiers), not complex expressions.",
346
+ TS9039: "A type references a private class member (`{name}`). Private members cannot be part of publicly exposed types."
347
+ };
348
+ function logIsolatedDeclarationErrors(errors) {
349
+ if (!errors.length)
350
+ return;
351
+ const hasErrors = errors.some(({ error }) => error.severity === "Error");
352
+ errors.forEach(logSingle);
353
+ if (hasErrors) {
354
+ if (!isDev())
332
355
  process.exit(1);
333
- }
334
356
  }
335
357
  }
336
- function logSingle(error) {
337
- const label = error.error.labels[0];
338
- const position = label ? calculateDtsErrorLineAndColumn(error.content, label.start) : "";
339
- const shortPath = getShortFilePath(error.file);
340
- const errorMessage = `${shortPath}${position}: ${formatDtsErrorMessage(error.error.message)}`;
341
- const { color, prefix } = getSeverityFormatting(error.error.severity);
342
- const formattedMessage = `${color(prefix)} ${errorMessage}`;
343
- const codeFrame = label ? getCodeFrame(error.content, label.start, label.end) : error.error.codeframe ? error.error.codeframe : "";
344
- const helpMessage = error.error.helpMessage ? `
345
- ${pc.cyan("Help:")} ${error.error.helpMessage}` : "";
358
+ function logSingle({ error, file, content }) {
359
+ const label = error.labels?.[0];
360
+ const errorCode = extractErrorCode(error.message);
361
+ const errorMessage = ISOLATED_DECLARATION_ERRORS[errorCode];
362
+ if (!errorMessage)
363
+ return;
364
+ const position = label ? calculatePosition(content, label.start) : "";
365
+ const shortPath = getShortFilePath(file);
366
+ const { color, prefix } = getSeverityFormatting(error.severity);
367
+ const formattedMessage = `${color(prefix)} ${shortPath}${position}: ${errorCode} ${errorMessage}`;
368
+ const codeFrame = label ? generateOxcCodeFrame(content, label.start, label.end) : error.codeframe || "";
369
+ const helpMessage = error.helpMessage ? `
370
+ ${pc.cyan("Help:")} ${error.helpMessage}` : "";
346
371
  console.log(`
347
372
  ${formattedMessage}${helpMessage}
348
373
 
349
374
  ${pc.gray(codeFrame)}`);
350
375
  }
351
- function getSeverityFormatting(severity) {
352
- if (isDev()) {
353
- switch (severity) {
354
- case "Error":
355
- return {
356
- color: pc.blue,
357
- prefix: "Suggestion"
358
- };
359
- case "Warning":
360
- return { color: pc.yellow, prefix: "Suggestion" };
361
- case "Advice":
362
- return { color: pc.blue, prefix: "Advice" };
363
- default:
364
- return {
365
- color: pc.blue,
366
- prefix: "Suggestion"
367
- };
368
- }
369
- }
370
- switch (severity) {
371
- case "Error":
372
- return {
373
- color: pc.red,
374
- prefix: "ERROR"
375
- };
376
- case "Warning":
377
- return { color: pc.yellow, prefix: "WARNING" };
378
- case "Advice":
379
- return { color: pc.blue, prefix: "ADVICE" };
380
- default:
381
- return {
382
- color: pc.red,
383
- prefix: "ERROR"
384
- };
385
- }
376
+ function extractErrorCode(message) {
377
+ return message.split(":")[0];
386
378
  }
387
- function formatDtsErrorMessage(errorMessage) {
388
- return errorMessage.replace(" with --isolatedDeclarations", "").replace(" with --isolatedDeclaration", "");
379
+ function getSeverityFormatting(severity) {
380
+ const config = SEVERITY_CONFIG[isDev() ? "dev" : "prod"];
381
+ return config[severity] || config.default;
389
382
  }
390
- function calculateDtsErrorLineAndColumn(sourceText, labelStart) {
383
+ function calculatePosition(sourceText, labelStart) {
391
384
  if (labelStart === undefined)
392
385
  return "";
393
386
  const lines = sourceText.slice(0, labelStart).split(`
@@ -396,34 +389,21 @@ function calculateDtsErrorLineAndColumn(sourceText, labelStart) {
396
389
  const columnStart = lines[lines.length - 1].length + 1;
397
390
  return ` (${lineNumber}:${columnStart})`;
398
391
  }
399
- function getCodeFrame(sourceText, start, end) {
392
+ function generateOxcCodeFrame(sourceText, start, end) {
400
393
  const lines = sourceText.split(`
401
394
  `);
402
395
  const errorLine = sourceText.slice(0, start).split(`
403
396
  `).length;
404
397
  const lineContent = lines[errorLine - 1];
405
- const startCol = start - sourceText.slice(0, start).lastIndexOf(`
406
- `) - 1;
407
- const endCol = end ? Math.min(end - sourceText.slice(0, start).lastIndexOf(`
408
- `) - 1, lineContent.length) : startCol + 1;
409
- const arrowLine = " ".repeat(startCol) + pc[isDev() ? "blue" : "red"](pc.dim("\u23AF".repeat(Math.max(1, endCol - startCol))));
398
+ const lastNewlineIndex = sourceText.slice(0, start).lastIndexOf(`
399
+ `);
400
+ const startCol = start - lastNewlineIndex - 1;
401
+ const endCol = end ? Math.min(end - lastNewlineIndex - 1, lineContent.length) : startCol + 1;
402
+ const underlineLength = Math.max(1, endCol - startCol);
403
+ const arrowLine = " ".repeat(startCol) + pc.dim(pc.blue("\u23AF".repeat(underlineLength)));
410
404
  return `${lineContent}
411
405
  ${arrowLine}`;
412
406
  }
413
- function handleBunBuildLogs(logs) {
414
- for (const log of logs) {
415
- if (log.level === "error") {
416
- logger.error(`${log.message} in ${log.position?.file}`);
417
- throw new Error("Failed to generate declaration file");
418
- }
419
- if (log.level === "warning") {
420
- logger.warn(log.message);
421
- }
422
- if (log.level === "info") {
423
- logger.info(log.message);
424
- }
425
- }
426
- }
427
407
 
428
408
  // src/dts/resolver.ts
429
409
  import { dirname } from "path";
@@ -556,27 +536,41 @@ async function generateDts(entrypoints, options) {
556
536
  target: "node",
557
537
  splitting: options.splitting,
558
538
  plugins: [fakeJsPlugin],
559
- throw: false,
560
539
  packages: "external",
561
- minify: options.minify
540
+ minify: options.minify,
541
+ throw: false
562
542
  });
563
- handleBunBuildLogs(result.logs);
543
+ if (collectedErrors.length) {
544
+ logIsolatedDeclarationErrors(collectedErrors);
545
+ }
546
+ if (!result.success) {
547
+ throw new Error(`DTS bundling failed: ${result.logs}`);
548
+ }
564
549
  try {
565
550
  const outputs = result.outputs.filter((output) => output.kind === "chunk" || output.kind === "entry-point");
566
551
  const bundledFiles = [];
567
552
  for (const output of outputs) {
568
553
  const bundledFakeJsPath = output.path;
569
554
  const bundledFakeJsContent = await Bun.file(bundledFakeJsPath).text();
570
- const dtsContent = isolatedDeclaration("treeshake.d.ts", await fakeJsToDts(bundledFakeJsContent));
555
+ const dtsContent = await fakeJsToDts(bundledFakeJsContent);
571
556
  const entrypoint = output.kind === "entry-point" ? entrypoints[bundledFiles.length] : undefined;
572
557
  const chunkFileName = output.kind === "chunk" ? replaceExtension(path.basename(output.path), getDeclarationExtensionFromJsExtension(getExtension(output.path))) : undefined;
573
558
  const outputPath = cleanPath(replaceExtension(cleanPath(output.path).replace(`${cleanPath(tempOutDir)}/`, ""), getDeclarationExtensionFromJsExtension(getExtension(output.path))));
559
+ let dtsContentToWrite = dtsContent;
560
+ const treeshakedDts = isolatedDeclaration("treeshake.d.ts", dtsContent);
561
+ if (treeshakedDts.errors.length) {
562
+ logger.error(`DTS treeshaking failed for ${entrypoint || outputPath}:
563
+ `);
564
+ console.log(treeshakedDts.errors);
565
+ } else {
566
+ dtsContentToWrite = treeshakedDts.code;
567
+ }
574
568
  bundledFiles.push({
575
569
  kind: output.kind === "entry-point" ? "entry-point" : "chunk",
576
570
  entrypoint,
577
571
  chunkFileName,
578
572
  outputPath,
579
- dts: dtsContent.code,
573
+ dts: dtsContentToWrite,
580
574
  pathInfo: {
581
575
  outputPathWithoutExtension: deleteExtension(outputPath),
582
576
  ext: getExtension(outputPath)
@@ -584,14 +578,7 @@ async function generateDts(entrypoints, options) {
584
578
  });
585
579
  }
586
580
  return {
587
- files: bundledFiles,
588
- errors: collectedErrors
589
- };
590
- } catch (error) {
591
- console.error(error);
592
- return {
593
- files: [],
594
- errors: collectedErrors
581
+ files: bundledFiles
595
582
  };
596
583
  } finally {
597
584
  await fs.rm(tempOutDir, { recursive: true, force: true });
@@ -892,38 +879,41 @@ async function build(partialOptions, rootDir = process.cwd()) {
892
879
  });
893
880
  await Promise.all(buildPromises);
894
881
  if (options.dts) {
895
- const { entry, splitting, ...dtsOptions } = typeof options.dts === "object" ? options.dts : {};
896
- const dtsResult = await generateDts(ensureArray(entry ?? entrypoints), {
897
- cwd: rootDir,
898
- preferredTsConfigPath: options.preferredTsconfigPath,
899
- splitting: getResolvedDtsSplitting(splitting),
900
- ...dtsOptions
901
- });
902
- if (dtsResult.errors.length) {
903
- logIsolatedDeclarationErrors(dtsResult.errors);
904
- }
905
- for (const fmt of options.format) {
906
- for (const file of dtsResult.files) {
907
- const dtsExtension = getDefaultDtsExtention(fmt, packageType);
908
- const relativePathToOutputDir = cleanPath(`${file.pathInfo.outputPathWithoutExtension}${dtsExtension}`);
909
- const relativePathToRootDir = cleanPath(`${options.outDir}/${relativePathToOutputDir}`);
910
- if (file.kind === "entry-point") {
911
- logger.success(`${pc3.dim(`${options.outDir}/`)}${relativePathToOutputDir}`, {
912
- identifier: options.name
882
+ try {
883
+ const { entry, splitting, ...dtsOptions } = typeof options.dts === "object" ? options.dts : {};
884
+ const dtsResult = await generateDts(ensureArray(entry ?? entrypoints), {
885
+ cwd: rootDir,
886
+ preferredTsConfigPath: options.preferredTsconfigPath,
887
+ splitting: getResolvedDtsSplitting(splitting),
888
+ ...dtsOptions
889
+ });
890
+ for (const fmt of options.format) {
891
+ for (const file of dtsResult.files) {
892
+ const dtsExtension = getDefaultDtsExtention(fmt, packageType);
893
+ const relativePathToOutputDir = cleanPath(`${file.pathInfo.outputPathWithoutExtension}${dtsExtension}`);
894
+ const relativePathToRootDir = cleanPath(`${options.outDir}/${relativePathToOutputDir}`);
895
+ if (file.kind === "entry-point") {
896
+ logger.success(`${pc3.dim(`${options.outDir}/`)}${relativePathToOutputDir}`, {
897
+ identifier: options.name
898
+ });
899
+ }
900
+ const fullPath = path2.join(rootDir, relativePathToRootDir);
901
+ await Bun.write(fullPath, file.dts);
902
+ buildOutput.files.push({
903
+ fullPath,
904
+ relativePathToRootDir,
905
+ relativePathToOutputDir,
906
+ dts: true,
907
+ format: fmt,
908
+ kind: file.kind,
909
+ entrypoint: file.entrypoint ? cleanPath(file.entrypoint) : undefined
913
910
  });
914
911
  }
915
- const fullPath = path2.join(rootDir, relativePathToRootDir);
916
- await Bun.write(fullPath, file.dts);
917
- buildOutput.files.push({
918
- fullPath,
919
- relativePathToRootDir,
920
- relativePathToOutputDir,
921
- dts: true,
922
- format: fmt,
923
- kind: file.kind,
924
- entrypoint: file.entrypoint ? cleanPath(file.entrypoint) : undefined
925
- });
926
912
  }
913
+ } catch (error) {
914
+ throw new BunupDTSBuildError(parseErrorMessage(error));
915
+ } finally {
916
+ logger.space();
927
917
  }
928
918
  }
929
919
  await runPluginBuildDoneHooks(bunupPlugins, options, buildOutput, {
@@ -941,4 +931,4 @@ function getRelativePathToOutputDir(relativePathToRootDir, outDir) {
941
931
  return cleanPath(relativePathToRootDir).replace(`${cleanPath(outDir)}/`, "");
942
932
  }
943
933
 
944
- export { BUNUP_DOCS_URL, createBuildOptions, build };
934
+ export { createBuildOptions, build };
package/dist/cli/index.js CHANGED
@@ -1,11 +1,10 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
3
  import {
4
- BUNUP_DOCS_URL,
5
4
  build,
6
5
  createBuildOptions
7
- } from "../chunk-6ztk23xq.js";
8
- import"../chunk-t9xma3m6.js";
6
+ } from "../chunk-v3nkk11v.js";
7
+ import"../chunk-cv4z06x8.js";
9
8
  import {
10
9
  processLoadedConfigs
11
10
  } from "../chunk-5v78yfze.js";
@@ -22,14 +21,14 @@ import {
22
21
  logger,
23
22
  parseErrorMessage,
24
23
  setSilent
25
- } from "../chunk-y0jgbvca.js";
24
+ } from "../chunk-kk5yc8cy.js";
26
25
 
27
26
  // src/cli/index.ts
28
27
  import { loadConfig } from "coffi";
29
28
  import pc3 from "picocolors";
30
29
  import { exec } from "tinyexec";
31
30
  // package.json
32
- var version = "0.8.50";
31
+ var version = "0.8.52";
33
32
 
34
33
  // src/watch.ts
35
34
  import path from "path";
@@ -88,6 +87,11 @@ async function watch(partialOptions, rootDir) {
88
87
 
89
88
  // src/cli/options.ts
90
89
  import pc2 from "picocolors";
90
+
91
+ // src/constants/index.ts
92
+ var BUNUP_DOCS_URL = "https://bunup.dev/docs";
93
+
94
+ // src/cli/options.ts
91
95
  var createHandlers = () => ({
92
96
  boolean: (key) => (value, options) => {
93
97
  options[key] = value === true || value === "true";
@@ -481,12 +485,12 @@ var parseCliOptions = (argv) => {
481
485
  async function main(args = Bun.argv.slice(2)) {
482
486
  const cliOptions = parseCliOptions(args);
483
487
  if (cliOptions.new) {
484
- const { newProject } = await import("../chunk-63s8ht8p.js");
488
+ const { newProject } = await import("../chunk-8dm3xyd7.js");
485
489
  await newProject();
486
490
  return;
487
491
  }
488
492
  if (cliOptions.init) {
489
- const { init } = await import("../chunk-htbpffg4.js");
493
+ const { init } = await import("../chunk-ga9j5qp4.js");
490
494
  await init();
491
495
  return;
492
496
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Arrayable, BuildOptions, DefineConfigItem, DefineWorkspaceItem, Plugin } from "./chunk-5k44zc9k";
1
+ import { Arrayable, BuildOptions, DefineConfigItem, DefineWorkspaceItem, Plugin } from "./chunk-p2wczz52";
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: DefineWorkspaceItem[]): DefineWorkspaceItem[];
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  build
4
- } from "./chunk-6ztk23xq.js";
5
- import"./chunk-t9xma3m6.js";
4
+ } from "./chunk-v3nkk11v.js";
5
+ import"./chunk-cv4z06x8.js";
6
6
  import"./chunk-5v78yfze.js";
7
- import"./chunk-y0jgbvca.js";
7
+ import"./chunk-kk5yc8cy.js";
8
8
  // src/define.ts
9
9
  function defineConfig(options) {
10
10
  return options;
package/dist/plugins.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BuildContext, BunupPlugin, MaybePromise, Plugin } from "./chunk-5k44zc9k";
1
+ import { BuildContext, BunupPlugin, MaybePromise, Plugin } from "./chunk-p2wczz52";
2
2
  /**
3
3
  * A plugin that copies files and directories to the output directory.
4
4
  *
package/dist/plugins.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  getPackageForPlugin
4
- } from "./chunk-t9xma3m6.js";
4
+ } from "./chunk-cv4z06x8.js";
5
5
  import {
6
6
  CSS_RE,
7
7
  JS_DTS_RE,
@@ -9,7 +9,7 @@ import {
9
9
  cleanPath,
10
10
  isDirectoryPath,
11
11
  logger
12
- } from "./chunk-y0jgbvca.js";
12
+ } from "./chunk-kk5yc8cy.js";
13
13
 
14
14
  // src/plugins/built-in/copy.ts
15
15
  import { basename, join } from "path";
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.50",
4
+ "version": "0.8.52",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"