bunup 0.8.49 → 0.8.50

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.
@@ -1,37 +1,37 @@
1
1
  type Resolve = boolean | (string | RegExp)[];
2
2
  type GenerateDtsOptions = {
3
- preferredTsConfigPath?: string
4
- resolve?: Resolve
5
- cwd?: string
6
- splitting?: boolean
7
- minify?: boolean
3
+ preferredTsConfigPath?: string;
4
+ resolve?: Resolve;
5
+ cwd?: string;
6
+ splitting?: boolean;
7
+ minify?: boolean;
8
8
  };
9
9
  import { BunPlugin } from "bun";
10
10
  type PackageJson = {
11
11
  /** The parsed content of the package.json file */
12
- data: Record<string, any> | null
12
+ data: Record<string, any> | null;
13
13
  /** The path to the package.json file */
14
- path: string | null
14
+ path: string | null;
15
15
  };
16
16
  /**
17
17
  * Represents a Bun plugin that can be used with Bunup
18
18
  */
19
19
  type BunupBunPlugin = {
20
20
  /** Identifies this as a native Bun plugin */
21
- type: "bun"
21
+ type: "bun";
22
22
  /** Optional name for the plugin */
23
- name?: string
23
+ name?: string;
24
24
  /** The actual Bun plugin implementation */
25
- plugin: BunPlugin
25
+ plugin: BunPlugin;
26
26
  };
27
27
  /**
28
28
  * Represents the meta data of the build
29
29
  */
30
30
  type BuildMeta = {
31
31
  /** The package.json file */
32
- packageJson: PackageJson
32
+ packageJson: PackageJson;
33
33
  /** The root directory of the build */
34
- rootDir: string
34
+ rootDir: string;
35
35
  };
36
36
  type BuildOutputFile = {
37
37
  /**
@@ -39,37 +39,37 @@ type BuildOutputFile = {
39
39
  *
40
40
  * Undefined for non-entry point files (e.g., assets, sourcemaps, chunks)
41
41
  */
42
- entrypoint: string | undefined
42
+ entrypoint: string | undefined;
43
43
  /** The kind of the file */
44
- kind: "entry-point" | "chunk" | "asset" | "sourcemap" | "bytecode"
44
+ kind: "entry-point" | "chunk" | "asset" | "sourcemap" | "bytecode";
45
45
  /** Path to the generated file */
46
- fullPath: string
46
+ fullPath: string;
47
47
  /** Path to the generated file relative to the root directory */
48
- relativePathToRootDir: string
48
+ relativePathToRootDir: string;
49
49
  /** Path to the generated file relative to the output directory */
50
- relativePathToOutputDir: string
50
+ relativePathToOutputDir: string;
51
51
  /** Whether the file is a dts file */
52
- dts: boolean
52
+ dts: boolean;
53
53
  /** The format of the output file */
54
- format: Format
54
+ format: Format;
55
55
  };
56
56
  /**
57
57
  * Represents the output of a build operation
58
58
  */
59
59
  type BuildOutput = {
60
60
  /** Array of generated files with their paths and contents */
61
- files: BuildOutputFile[]
61
+ files: BuildOutputFile[];
62
62
  };
63
63
  /**
64
64
  * Context provided to build hooks
65
65
  */
66
66
  type BuildContext = {
67
67
  /** The build options that were used */
68
- options: BuildOptions
68
+ options: BuildOptions;
69
69
  /** The output of the build */
70
- output: BuildOutput
70
+ output: BuildOutput;
71
71
  /** The meta data of the build */
72
- meta: BuildMeta
72
+ meta: BuildMeta;
73
73
  };
74
74
  /**
75
75
  * Hooks that can be implemented by Bunup plugins
@@ -79,23 +79,23 @@ type BunupPluginHooks = {
79
79
  * Called when a build is successfully completed
80
80
  * @param ctx Build context containing options and output
81
81
  */
82
- onBuildDone?: (ctx: BuildContext) => MaybePromise<void>
82
+ onBuildDone?: (ctx: BuildContext) => MaybePromise<void>;
83
83
  /**
84
84
  * Called before a build starts
85
85
  * @param options Build options that will be used
86
86
  */
87
- onBuildStart?: (options: BuildOptions) => MaybePromise<void>
87
+ onBuildStart?: (options: BuildOptions) => MaybePromise<void>;
88
88
  };
89
89
  /**
90
90
  * Represents a Bunup-specific plugin
91
91
  */
92
92
  type BunupPlugin = {
93
93
  /** Identifies this as a Bunup-specific plugin */
94
- type: "bunup"
94
+ type: "bunup";
95
95
  /** Optional name for the plugin */
96
- name?: string
96
+ name?: string;
97
97
  /** The hooks implemented by this plugin */
98
- hooks: BunupPluginHooks
98
+ hooks: BunupPluginHooks;
99
99
  };
100
100
  /**
101
101
  * Union type representing all supported plugin types
@@ -170,7 +170,7 @@ interface BuildOptions {
170
170
  * Can also be configured with DtsOptions for more control
171
171
  */
172
172
  dts?: boolean | (Pick<GenerateDtsOptions, "resolve" | "splitting" | "minify"> & {
173
- entry?: string | string[]
173
+ entry?: string | string[];
174
174
  });
175
175
  /**
176
176
  * Path to a preferred tsconfig.json file to use for declaration generation
@@ -350,8 +350,8 @@ type WithOptional<
350
350
  type Arrayable<T> = T | T[];
351
351
  type DefineConfigItem = Omit<WithOptional<BuildOptions, "outDir" | "format">, "watch">;
352
352
  type DefineWorkspaceItem = {
353
- name: string
354
- root: string
355
- config: DefineConfigItem | DefineConfigItem[]
353
+ name: string;
354
+ root: string;
355
+ config: DefineConfigItem | DefineConfigItem[];
356
356
  };
357
357
  export { MaybePromise, Arrayable, DefineConfigItem, DefineWorkspaceItem, BuildContext, BunupPlugin, Plugin, BuildOptions };
@@ -106,13 +106,8 @@ function getName(node, source) {
106
106
  }
107
107
  break;
108
108
  case "TSModuleDeclaration":
109
- if (node.id) {
110
- if (node.id.type === "Identifier") {
111
- return node.id.name;
112
- }
113
- if (node.id.type === "StringLiteral" && typeof node.id.value === "string") {
114
- return node.id.value;
115
- }
109
+ if (node.id && node.id.type === "Identifier") {
110
+ return node.id.name;
116
111
  }
117
112
  break;
118
113
  case "VariableDeclaration": {
package/dist/cli/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  BUNUP_DOCS_URL,
5
5
  build,
6
6
  createBuildOptions
7
- } from "../chunk-b38k5sg1.js";
7
+ } from "../chunk-6ztk23xq.js";
8
8
  import"../chunk-t9xma3m6.js";
9
9
  import {
10
10
  processLoadedConfigs
@@ -29,7 +29,7 @@ import { loadConfig } from "coffi";
29
29
  import pc3 from "picocolors";
30
30
  import { exec } from "tinyexec";
31
31
  // package.json
32
- var version = "0.8.49";
32
+ var version = "0.8.50";
33
33
 
34
34
  // src/watch.ts
35
35
  import path from "path";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Arrayable, BuildOptions, DefineConfigItem, DefineWorkspaceItem, Plugin } from "./chunk-nsmdhpdd";
1
+ import { Arrayable, BuildOptions, DefineConfigItem, DefineWorkspaceItem, Plugin } from "./chunk-5k44zc9k";
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,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  build
4
- } from "./chunk-b38k5sg1.js";
4
+ } from "./chunk-6ztk23xq.js";
5
5
  import"./chunk-t9xma3m6.js";
6
6
  import"./chunk-5v78yfze.js";
7
7
  import"./chunk-y0jgbvca.js";
package/dist/plugins.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BuildContext, BunupPlugin, MaybePromise, Plugin } from "./chunk-nsmdhpdd";
1
+ import { BuildContext, BunupPlugin, MaybePromise, Plugin } from "./chunk-5k44zc9k";
2
2
  /**
3
3
  * A plugin that copies files and directories to the output directory.
4
4
  *
@@ -30,7 +30,7 @@ interface ExportsPluginOptions {
30
30
  */
31
31
  declare function exports(options?: ExportsPluginOptions): BunupPlugin;
32
32
  type InjectStylesPluginOptions = Pick<import("lightningcss").TransformOptions<import("lightningcss").CustomAtRules>, "sourceMap" | "inputSourceMap" | "targets" | "nonStandard" | "minify" | "pseudoClasses" | "unusedSymbols" | "errorRecovery" | "visitor" | "customAtRules" | "include" | "exclude" | "drafts"> & {
33
- inject?: (css: string, filePath: string) => MaybePromise<string>
33
+ inject?: (css: string, filePath: string) => MaybePromise<string>;
34
34
  };
35
35
  /**
36
36
  * A plugin that injects styles into the document head.
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.49",
4
+ "version": "0.8.50",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"