bunup 0.11.2 → 0.11.3

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/bunup-qnygs651.js";
7
+ } from "../shared/bunup-t24y24aw.js";
8
8
  import {
9
9
  BunupCLIError,
10
10
  BunupWatchError,
@@ -24,7 +24,7 @@ import {
24
24
  import { loadConfig } from "coffi";
25
25
  import pc3 from "picocolors";
26
26
  // package.json
27
- var version = "0.11.2";
27
+ var version = "0.11.3";
28
28
 
29
29
  // src/watch.ts
30
30
  import path from "path";
@@ -61,7 +61,6 @@ async function watch(partialOptions, rootDir) {
61
61
  await build({ ...options, silent: !initial }, rootDir);
62
62
  if (!initial) {
63
63
  console.clear();
64
- console.log("");
65
64
  console.log(`${rebuildCount > 1 ? pc.magenta(`[x${rebuildCount}] `) : ""}${pc.green(`Rebuilt in ${logTime(performance.now() - start)}`)}: ${changed}${options.name ? ` ${pc.bgBlueBright(` ${options.name} `)}` : ""} `);
66
65
  }
67
66
  rebuildCount++;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Arrayable, BuildOptions, DefineConfigItem, DefineWorkspaceItem, Plugin, WithOptional } from "./shared/bunup-rhnc0fq5";
1
+ import { Arrayable, BuildOptions, DefineConfigItem, DefineWorkspaceItem, Plugin, WithOptional } from "./shared/bunup-111qyyn0";
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,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  build
4
- } from "./shared/bunup-qnygs651.js";
4
+ } from "./shared/bunup-t24y24aw.js";
5
5
  import"./shared/bunup-q39v2kct.js";
6
6
  // src/define.ts
7
7
  function defineConfig(options) {
package/dist/plugins.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BuildContext, BunupPlugin, MaybePromise, Plugin } from "./shared/bunup-rhnc0fq5";
1
+ import { BuildContext, BunupPlugin, MaybePromise, Plugin } from "./shared/bunup-111qyyn0";
2
2
  /**
3
3
  * A plugin that copies files and directories to the output directory.
4
4
  *
@@ -44,7 +44,7 @@ type BuildOutputFile = {
44
44
  /** Whether the file is a dts file */
45
45
  dts: boolean
46
46
  /** The format of the output file */
47
- format: Format
47
+ format: Format | Format[]
48
48
  };
49
49
  /**
50
50
  * Represents the output of a build operation
@@ -143,7 +143,7 @@ interface BuildOptions {
143
143
  * - A string path to a file
144
144
  * - An array of file paths
145
145
  *
146
- * @see https://bunup.dev/docs/#entry-points
146
+ * @see https://bunup.dev/docs/guide/options#entry-points
147
147
  */
148
148
  entry: string | string[];
149
149
  /**
@@ -156,7 +156,7 @@ interface BuildOptions {
156
156
  * Can include 'esm', 'cjs', and/or 'iife'
157
157
  * Defaults to ['esm'] if not specified
158
158
  */
159
- format: Format[];
159
+ format: Format | Format[];
160
160
  /**
161
161
  * Whether to enable all minification options
162
162
  * When true, enables minifyWhitespace, minifyIdentifiers, and minifySyntax
@@ -187,6 +187,14 @@ interface BuildOptions {
187
187
  */
188
188
  watch?: boolean;
189
189
  /**
190
+ * package.json `exports` conditions used when resolving imports
191
+ *
192
+ * Equivalent to `--conditions` in `bun build` or `bun run`.
193
+ *
194
+ * https://nodejs.org/api/packages.html#exports
195
+ */
196
+ conditions?: string | string[];
197
+ /**
190
198
  * Whether to generate TypeScript declaration files (.d.ts)
191
199
  * When set to true, generates declaration files for all entry points
192
200
  * Can also be configured with DtsOptions for more control
@@ -347,7 +355,7 @@ interface BuildOptions {
347
355
  *
348
356
  * Used for assets, external modules, and chunk files when splitting is enabled
349
357
  *
350
- * @see https://bunup.dev/docs#public-path for more information
358
+ * @see https://bunup.dev/docs/guide/options#public-path for more information
351
359
  *
352
360
  * @example
353
361
  * publicPath: 'https://cdn.example.com/'
@@ -180,8 +180,8 @@ ${text}`;
180
180
 
181
181
  // src/options.ts
182
182
  var DEFAULT_OPTIONS = {
183
- entry: ["src/index.ts"],
184
- format: ["esm"],
183
+ entry: "src/index.ts",
184
+ format: "esm",
185
185
  outDir: "dist",
186
186
  target: "node",
187
187
  clean: true
@@ -316,7 +316,7 @@ async function build(partialOptions, rootDir = process.cwd()) {
316
316
  if (!entrypoints.length) {
317
317
  throw new BunupBuildError(`One or more of the entrypoints you provided do not exist. Please check that each entrypoint points to a valid file.`);
318
318
  }
319
- const buildPromises = options.format.flatMap(async (fmt) => {
319
+ const buildPromises = ensureArray(options.format).flatMap(async (fmt) => {
320
320
  const result = await Bun.build({
321
321
  entrypoints: entrypoints.map((file) => `${rootDir}/${file}`),
322
322
  format: fmt,
@@ -330,6 +330,7 @@ async function build(partialOptions, rootDir = process.cwd()) {
330
330
  sourcemap: getResolvedSourcemap(options.sourcemap),
331
331
  loader: options.loader,
332
332
  drop: options.drop,
333
+ conditions: options.conditions,
333
334
  banner: options.banner,
334
335
  footer: options.footer,
335
336
  publicPath: options.publicPath,
@@ -387,7 +388,7 @@ async function build(partialOptions, rootDir = process.cwd()) {
387
388
  if (dtsResult.errors.length && !silent) {
388
389
  logIsolatedDeclarationErrors(dtsResult.errors);
389
390
  }
390
- for (const fmt of options.format) {
391
+ for (const fmt of ensureArray(options.format)) {
391
392
  for (const file of dtsResult.files) {
392
393
  const dtsExtension = getDefaultDtsExtention(fmt, packageType, file.kind);
393
394
  const relativePathToOutputDir = cleanPath(`${file.pathInfo.outputPathWithoutExtension}${dtsExtension}`);
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.2",
4
+ "version": "0.11.3",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"