bunup 0.12.0 → 0.13.0

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/plugins.d.ts CHANGED
@@ -1,25 +1,46 @@
1
- import { BuildContext, BunupPlugin, MaybePromise } from "./shared/bunup-5f54ngsb";
1
+ import { BuildContext, BunupPlugin, BunupPluginHooks, MaybePromise } from "./shared/bunup-s6gfzz2v";
2
+ type CopyOptions = {
3
+ /** Whether to follow symbolic links when copying files. */
4
+ followSymlinks?: boolean
5
+ /** Whether to exclude dotfiles (files starting with a dot) from being copied. */
6
+ excludeDotfiles?: boolean
7
+ };
2
8
  /**
3
9
  * A plugin that copies files and directories to the output directory.
4
10
  *
5
- * @param pattern - String or array of glob patterns to match files for copying. Patterns starting with '!' exclude matching files.
6
- * @param outPath - Optional output path. If not provided, uses the build output directory
7
- * @see https://bunup.dev/docs/plugins/copy
11
+ * @see https://bunup.dev/docs/builtin-plugins/copy
8
12
  */
9
- declare function copy(pattern: string | string[], outPath?: string): BunupPlugin;
13
+ declare function copy(pattern: string | string[]): BunupPlugin & CopyBuilder;
14
+ declare class CopyBuilder {
15
+ private _patterns;
16
+ private _destination?;
17
+ private _options?;
18
+ constructor(pattern: string | string[]);
19
+ /**
20
+ * Sets the destination directory or file path where files will be copied.
21
+ * Relative to the output directory.
22
+ */
23
+ to(destination: string): this;
24
+ /**
25
+ * Sets additional options for the copy operation.
26
+ */
27
+ with(options: CopyOptions): this;
28
+ get name(): string;
29
+ get hooks(): BunupPluginHooks;
30
+ }
10
31
  type CustomExports = Record<string, string | Record<string, string | Record<string, string>>>;
11
32
  type Exclude = ((ctx: BuildContext) => string[] | undefined) | string[];
12
33
  interface ExportsPluginOptions {
13
34
  /**
14
35
  * Additional export fields to preserve alongside automatically generated exports
15
36
  *
16
- * @see https://bunup.dev/docs/plugins/exports#customexports
37
+ * @see https://bunup.dev/docs/builtin-plugins/exports#customexports
17
38
  */
18
39
  customExports?: (ctx: BuildContext) => CustomExports | undefined;
19
40
  /**
20
41
  * Entry points to exclude from the exports field
21
42
  *
22
- * @see https://bunup.dev/docs/plugins/exports#exclude
43
+ * @see https://bunup.dev/docs/builtin-plugins/exports#exclude
23
44
  */
24
45
  exclude?: Exclude;
25
46
  /**
@@ -32,14 +53,24 @@ interface ExportsPluginOptions {
32
53
  * Whether to include "./package.json": "./package.json" in the exports field
33
54
  *
34
55
  * @default true
35
- * @see https://bunup.dev/docs/plugins/exports#includepackagejson
56
+ * @see https://bunup.dev/docs/builtin-plugins/exports#includepackagejson
36
57
  */
37
58
  includePackageJson?: boolean;
59
+ /**
60
+ * Whether to add a wildcard export that allows deep imports
61
+ *
62
+ * When true, adds "./*": "./*" to exports, making all files accessible
63
+ * When false (default), only explicit exports are accessible
64
+ *
65
+ * @default false
66
+ * @see https://bunup.dev/docs/builtin-plugins/exports#all
67
+ */
68
+ all?: boolean;
38
69
  }
39
70
  /**
40
71
  * A plugin that generates the exports field in the package.json file automatically.
41
72
  *
42
- * @see https://bunup.dev/docs/plugins/exports
73
+ * @see https://bunup.dev/docs/builtin-plugins/exports
43
74
  */
44
75
  declare function exports(options?: ExportsPluginOptions): BunupPlugin;
45
76
  import { BunPlugin } from "bun";
@@ -82,14 +113,12 @@ type InjectStylesPluginOptions = {
82
113
  /**
83
114
  * A plugin that injects styles into the document head at runtime instead of bundling them to the build output.
84
115
  *
85
- * @see https://bunup.dev/docs/plugins/inject-styles
116
+ * @see https://bunup.dev/docs/builtin-plugins/inject-styles
86
117
  */
87
118
  declare function injectStyles(options?: InjectStylesPluginOptions): BunPlugin;
88
119
  import { BunPlugin as BunPlugin2 } from "bun";
89
120
  /**
90
121
  * A plugin that provides shims for Node.js globals and ESM/CJS interoperability.
91
- *
92
- * @see https://bunup.dev/docs/plugins/shims
93
122
  */
94
123
  declare function shims(): BunPlugin2;
95
124
  interface UnusedOptions {
@@ -107,7 +136,7 @@ interface UnusedOptions {
107
136
  /**
108
137
  * A plugin that detects and reports unused dependencies.
109
138
  *
110
- * @see https://bunup.dev/docs/plugins/unused
139
+ * @see https://bunup.dev/docs/builtin-plugins/unused
111
140
  */
112
141
  declare function unused(options?: UnusedOptions): BunupPlugin;
113
142
  export { unused, shims, injectStyles, exports, copy };