bunup 0.8.5 → 0.8.6

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 CHANGED
@@ -430,12 +430,12 @@ import {
430
430
  import { downloadTemplate } from "giget";
431
431
  import { replaceInFile } from "replace-in-file";
432
432
  async function newProject() {
433
- intro(import_picocolors5.default.bgCyan(import_picocolors5.default.black(" Scaffold a new project with Bunup ")));
433
+ intro(import_picocolors6.default.bgCyan(import_picocolors6.default.black(" Scaffold a new project with Bunup ")));
434
434
  const selectedTemplateDir = await select({
435
435
  message: "Select a template",
436
436
  options: TEMPLATES.map((template2) => ({
437
437
  value: template2.dir,
438
- label: import_picocolors5.default.blue(template2.name)
438
+ label: import_picocolors6.default.blue(template2.name)
439
439
  }))
440
440
  });
441
441
  const template = TEMPLATES.find((t) => t.dir === selectedTemplateDir);
@@ -521,23 +521,23 @@ async function newProject() {
521
521
  }
522
522
  ]);
523
523
  outro(`
524
- ${import_picocolors5.default.green("\u2728 Project scaffolded successfully! \u2728")}
524
+ ${import_picocolors6.default.green("\u2728 Project scaffolded successfully! \u2728")}
525
525
 
526
- ${import_picocolors5.default.bold("Ready to launch your awesome new project?")}
526
+ ${import_picocolors6.default.bold("Ready to launch your awesome new project?")}
527
527
 
528
- ${import_picocolors5.default.cyan("cd")} ${projectName}
529
- ${import_picocolors5.default.cyan("bun install")}
530
- ${import_picocolors5.default.cyan("bun run dev")}
528
+ ${import_picocolors6.default.cyan("cd")} ${projectName}
529
+ ${import_picocolors6.default.cyan("bun install")}
530
+ ${import_picocolors6.default.cyan("bun run dev")}
531
531
 
532
- ${import_picocolors5.default.yellow("Happy coding!")} \uD83D\uDE80
532
+ ${import_picocolors6.default.yellow("Happy coding!")} \uD83D\uDE80
533
533
  `);
534
534
  }
535
535
  function getProjectPath(projectName) {
536
536
  return path5.join(process.cwd(), projectName);
537
537
  }
538
- var import_picocolors5, TEMPLATE_OWNER = "arshad-yaseen", TEMPLATE_REPO = "bunup-new", GITHUB_USERNAME_PLACEHOLDER = "username", GITHUB_REPO_PLACEHOLDER = "repo-name", MONOREPO_FIRST_PACKAGE_NAME_PLACEHOLDER = "package-1", MONOREPO_PACKAGES_DIR = "packages", TEMPLATES;
538
+ var import_picocolors6, TEMPLATE_OWNER = "arshad-yaseen", TEMPLATE_REPO = "bunup-new", GITHUB_USERNAME_PLACEHOLDER = "username", GITHUB_REPO_PLACEHOLDER = "repo-name", MONOREPO_FIRST_PACKAGE_NAME_PLACEHOLDER = "package-1", MONOREPO_PACKAGES_DIR = "packages", TEMPLATES;
539
539
  var init_new = __esm(() => {
540
- import_picocolors5 = __toESM(require_picocolors(), 1);
540
+ import_picocolors6 = __toESM(require_picocolors(), 1);
541
541
  init_utils();
542
542
  TEMPLATES = [
543
543
  {
@@ -552,7 +552,7 @@ var init_new = __esm(() => {
552
552
  // src/cli/index.ts
553
553
  import { exec } from "tinyexec";
554
554
  // package.json
555
- var version = "0.8.5";
555
+ var version = "0.8.6";
556
556
 
557
557
  // src/cli/index.ts
558
558
  init_errors();
@@ -783,7 +783,7 @@ function parseCliOptions(argv) {
783
783
  }
784
784
 
785
785
  // src/cli/index.ts
786
- var import_picocolors6 = __toESM(require_picocolors(), 1);
786
+ var import_picocolors7 = __toESM(require_picocolors(), 1);
787
787
  import { loadConfig as loadConfig2 } from "coffi";
788
788
 
789
789
  // src/build.ts
@@ -969,6 +969,7 @@ function externalOptionPlugin(options, packageJson) {
969
969
  }
970
970
 
971
971
  // src/plugins/utils.ts
972
+ var import_picocolors4 = __toESM(require_picocolors(), 1);
972
973
  function filterBunupBunPlugins(plugins) {
973
974
  if (!plugins)
974
975
  return [];
@@ -1145,7 +1146,7 @@ function getRelativePathToRootDir(filePath, rootDir) {
1145
1146
  init_utils();
1146
1147
 
1147
1148
  // src/watch.ts
1148
- var import_picocolors4 = __toESM(require_picocolors(), 1);
1149
+ var import_picocolors5 = __toESM(require_picocolors(), 1);
1149
1150
  import path4 from "path";
1150
1151
  init_errors();
1151
1152
  init_logger();
@@ -1185,7 +1186,7 @@ async function watch(partialOptions, rootDir) {
1185
1186
  const start = performance.now();
1186
1187
  await build(options, rootDir);
1187
1188
  if (!initial) {
1188
- logger.cli(`\uD83D\uDCE6 Rebuild finished in ${import_picocolors4.default.green(formatTime(performance.now() - start))}`);
1189
+ logger.cli(`\uD83D\uDCE6 Rebuild finished in ${import_picocolors5.default.green(formatTime(performance.now() - start))}`);
1189
1190
  }
1190
1191
  } catch (error) {
1191
1192
  handleError(error);
@@ -1251,7 +1252,7 @@ async function main(args = Bun.argv.slice(2)) {
1251
1252
  }));
1252
1253
  const buildTimeMs = performance.now() - startTime;
1253
1254
  const timeDisplay = formatTime(buildTimeMs);
1254
- logger.cli(`\u26A1\uFE0F Build completed in ${import_picocolors6.default.green(timeDisplay)}`);
1255
+ logger.cli(`\u26A1\uFE0F Build completed in ${import_picocolors7.default.green(timeDisplay)}`);
1255
1256
  if (cliOptions.watch) {
1256
1257
  logger.cli("\uD83D\uDC40 Watching for file changes");
1257
1258
  }
package/dist/index.cjs CHANGED
@@ -511,6 +511,7 @@ function externalOptionPlugin(options, packageJson) {
511
511
  }
512
512
 
513
513
  // src/plugins/utils.ts
514
+ var import_picocolors3 = __toESM(require_picocolors());
514
515
  function filterBunupBunPlugins(plugins) {
515
516
  if (!plugins)
516
517
  return [];
package/dist/index.js CHANGED
@@ -478,6 +478,7 @@ function externalOptionPlugin(options, packageJson) {
478
478
  }
479
479
 
480
480
  // src/plugins/utils.ts
481
+ var import_picocolors3 = __toESM(require_picocolors(), 1);
481
482
  function filterBunupBunPlugins(plugins) {
482
483
  if (!plugins)
483
484
  return [];
package/dist/plugins.cjs CHANGED
@@ -552,7 +552,20 @@ function report(options = {}) {
552
552
  }
553
553
  // src/plugins/built-in/css/inject-styles.ts
554
554
  var import_node_path2 = __toESM(require("path"));
555
- var import_lightningcss = require("lightningcss");
555
+
556
+ // src/plugins/utils.ts
557
+ var import_picocolors4 = __toESM(require_picocolors());
558
+ async function getPackageForPlugin(name, pluginName) {
559
+ let pkg;
560
+ try {
561
+ pkg = await import(name);
562
+ } catch {
563
+ throw new Error(`[${import_picocolors4.default.cyan(name)}] is required for the ${pluginName} plugin. Please install it with: ${import_picocolors4.default.blue(`bun add ${name} --dev`)}`);
564
+ }
565
+ return pkg;
566
+ }
567
+
568
+ // src/plugins/built-in/css/inject-styles.ts
556
569
  function injectStyles(options) {
557
570
  const { inject, ...transformOptions } = options ?? {};
558
571
  return {
@@ -560,7 +573,8 @@ function injectStyles(options) {
560
573
  name: "inject-styles",
561
574
  plugin: {
562
575
  name: "bunup:inject-styles",
563
- setup(build) {
576
+ async setup(build) {
577
+ const lightningcss = await getPackageForPlugin("lightningcss", "inject-styles");
564
578
  build.onResolve({ filter: /^__inject-style$/ }, () => {
565
579
  return {
566
580
  path: "__inject-style",
@@ -589,7 +603,7 @@ function injectStyles(options) {
589
603
  });
590
604
  build.onLoad({ filter: CSS_RE }, async (args) => {
591
605
  const source = await Bun.file(args.path).text();
592
- const { code, warnings } = import_lightningcss.transform({
606
+ const { code, warnings } = lightningcss.transform({
593
607
  ...transformOptions,
594
608
  filename: import_node_path2.default.basename(args.path),
595
609
  code: Buffer.from(source),
@@ -401,8 +401,7 @@ type ReportPluginOptions = {
401
401
  * @param options - The options for the report plugin.
402
402
  */
403
403
  declare function report(options?: ReportPluginOptions): BunupPlugin;
404
- import { CustomAtRules, TransformOptions } from "lightningcss";
405
- type InjectStylesPluginOptions = Pick<TransformOptions<CustomAtRules>, "sourceMap" | "inputSourceMap" | "targets" | "nonStandard" | "minify" | "pseudoClasses" | "unusedSymbols" | "errorRecovery" | "visitor" | "customAtRules" | "include" | "exclude" | "drafts"> & {
404
+ type InjectStylesPluginOptions = Pick<import("lightningcss").TransformOptions<import("lightningcss").CustomAtRules>, "sourceMap" | "inputSourceMap" | "targets" | "nonStandard" | "minify" | "pseudoClasses" | "unusedSymbols" | "errorRecovery" | "visitor" | "customAtRules" | "include" | "exclude" | "drafts"> & {
406
405
  inject?: (css: string, filePath: string) => MaybePromise<string>
407
406
  };
408
407
  /**
package/dist/plugins.d.ts CHANGED
@@ -401,8 +401,7 @@ type ReportPluginOptions = {
401
401
  * @param options - The options for the report plugin.
402
402
  */
403
403
  declare function report(options?: ReportPluginOptions): BunupPlugin;
404
- import { CustomAtRules, TransformOptions } from "lightningcss";
405
- type InjectStylesPluginOptions = Pick<TransformOptions<CustomAtRules>, "sourceMap" | "inputSourceMap" | "targets" | "nonStandard" | "minify" | "pseudoClasses" | "unusedSymbols" | "errorRecovery" | "visitor" | "customAtRules" | "include" | "exclude" | "drafts"> & {
404
+ type InjectStylesPluginOptions = Pick<import("lightningcss").TransformOptions<import("lightningcss").CustomAtRules>, "sourceMap" | "inputSourceMap" | "targets" | "nonStandard" | "minify" | "pseudoClasses" | "unusedSymbols" | "errorRecovery" | "visitor" | "customAtRules" | "include" | "exclude" | "drafts"> & {
406
405
  inject?: (css: string, filePath: string) => MaybePromise<string>
407
406
  };
408
407
  /**
package/dist/plugins.js CHANGED
@@ -517,9 +517,20 @@ function report(options = {}) {
517
517
  }
518
518
  // src/plugins/built-in/css/inject-styles.ts
519
519
  import path2 from "path";
520
- import {
521
- transform
522
- } from "lightningcss";
520
+
521
+ // src/plugins/utils.ts
522
+ var import_picocolors4 = __toESM(require_picocolors(), 1);
523
+ async function getPackageForPlugin(name, pluginName) {
524
+ let pkg;
525
+ try {
526
+ pkg = await import(name);
527
+ } catch {
528
+ throw new Error(`[${import_picocolors4.default.cyan(name)}] is required for the ${pluginName} plugin. Please install it with: ${import_picocolors4.default.blue(`bun add ${name} --dev`)}`);
529
+ }
530
+ return pkg;
531
+ }
532
+
533
+ // src/plugins/built-in/css/inject-styles.ts
523
534
  function injectStyles(options) {
524
535
  const { inject, ...transformOptions } = options ?? {};
525
536
  return {
@@ -527,7 +538,8 @@ function injectStyles(options) {
527
538
  name: "inject-styles",
528
539
  plugin: {
529
540
  name: "bunup:inject-styles",
530
- setup(build) {
541
+ async setup(build) {
542
+ const lightningcss = await getPackageForPlugin("lightningcss", "inject-styles");
531
543
  build.onResolve({ filter: /^__inject-style$/ }, () => {
532
544
  return {
533
545
  path: "__inject-style",
@@ -556,7 +568,7 @@ function injectStyles(options) {
556
568
  });
557
569
  build.onLoad({ filter: CSS_RE }, async (args) => {
558
570
  const source = await Bun.file(args.path).text();
559
- const { code, warnings } = transform({
571
+ const { code, warnings } = lightningcss.transform({
560
572
  ...transformOptions,
561
573
  filename: path2.basename(args.path),
562
574
  code: Buffer.from(source),
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.5",
4
+ "version": "0.8.6",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -61,8 +61,7 @@
61
61
  "bumpp": "^10.1.0",
62
62
  "husky": "^9.1.7",
63
63
  "lint-staged": "^15.5.1",
64
- "typescript": "^5.8.3",
65
- "lightningcss": "^1.30.1"
64
+ "typescript": "^5.8.3"
66
65
  },
67
66
  "peerDependencies": {
68
67
  "typescript": ">=4.5.0",