bunup 0.1.6 → 0.1.9
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/build/cli.js +5 -931
- package/build/cli.mjs +5 -921
- package/build/dtsWorker.js +1 -1
- package/build/index.d.mts +135 -121
- package/build/index.d.ts +135 -121
- package/build/index.js +1 -8
- package/build/index.mjs +1 -6
- package/package.json +4 -5
package/build/dtsWorker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var C=require("node:module");var v=Object.create;var{getPrototypeOf:b,defineProperty:n,getOwnPropertyNames:u,getOwnPropertyDescriptor:E}=Object,h=Object.prototype.hasOwnProperty;var w=(r,e,s)=>{s=r!=null?v(b(r)):{};let o=e||!r||!r.__esModule?n(s,"default",{value:r,enumerable:!0}):s;for(let t of u(r))if(!h.call(o,t))n(o,t,{get:()=>r[t],enumerable:!0});return o},g=new WeakMap,y=(r)=>{var e=g.get(r),s;if(e)return e;if(e=n({},"__esModule",{value:!0}),r&&typeof r==="object"||typeof r==="function")u(r).map((o)=>!h.call(e,o)&&n(e,o,{get:()=>r[o],enumerable:!(s=E(r,o))||s.enumerable}));return g.set(r,e),e};var D=(r,e)=>{for(var s in e)n(r,s,{get:e[s],enumerable:!0,configurable:!0,set:(o)=>e[s]=()=>o})};var M={};D(M,{DtsWorker:()=>d});module.exports=y(M);var m=require("node:os"),f=w(require("node:path")),k=require("node:worker_threads");var c=(r)=>{if(r instanceof Error)return r.message;return String(r)};var a={MAX_LABEL_LENGTH:5,colors:{cli:"183",info:"240",warn:"221",error:"203",progress:{ESM:"214",CJS:"114",IIFE:"105",DTS:"75"},default:"255"},labels:{cli:"BUNUP",info:"INFO",warn:"WARN",error:"ERROR"},formatMessage(r,e,s){let o=" ".repeat(Math.max(0,this.MAX_LABEL_LENGTH-e.length));return`\x1B[38;5;${r}m[${e}]\x1B[0m ${o}${s}`},cli(r){let e=this.labels.cli;console.log(this.formatMessage(this.colors.cli,e,r))},info(r){let e=this.labels.info;console.log(this.formatMessage(this.colors.info,e,r))},warn(r){let e=this.labels.warn;console.warn(this.formatMessage(this.colors.warn,e,r))},error(r){let e=this.labels.error;console.error(this.formatMessage(this.colors.error,e,r))},progress(r,e){let s=String(r),o=this.colors.default;for(let[t,l]of Object.entries(this.colors.progress))if(s.includes(t)){o=l;break}console.log(this.formatMessage(o,s,e))}};function p(r,e){return`${e?`${e.replace(/-/g,"_")}_`:""}${r}`.toUpperCase()}var __dirname="/home/runner/work/bunup/bunup/src/dts";class d{workers=[];queue=[];maxWorkers;busyWorkers=new Set;isShuttingDown=!1;constructor(r=m.cpus().length||4){this.maxWorkers=r}async process(r){if(this.isShuttingDown)throw new Error("Worker pool is shutting down");return new Promise((e,s)=>{this.queue.push({task:r,resolve:e,reject:s}),this.processQueue()})}processQueue(){if(this.queue.length===0||this.isShuttingDown)return;if(this.workers.length<this.maxWorkers){let r=new k.Worker(f.default.join(__dirname,"./dtsWorker.js"));this.workers.push(r),this.assignTaskToWorker(r)}else{let r=this.workers.find((e)=>!this.busyWorkers.has(e));if(r)this.assignTaskToWorker(r)}}assignTaskToWorker(r){let e=this.queue.shift();if(!e)return;let{task:s,resolve:o,reject:t}=e;this.busyWorkers.add(r);let l=()=>{if(this.busyWorkers.delete(r),this.isShuttingDown&&this.busyWorkers.size===0)this.terminateAllWorkers();else this.processQueue()};r.on("message",(i)=>{if(i.success)a.progress(p("DTS",i.name),i.outputRelativePath),o();else a.error(`DTS generation failed: ${i.error}`),t(new Error(i.error));l()}),r.on("error",(i)=>{let W=c(i);a.error(`Worker error: ${W}`),t(i),l()}),r.postMessage(s)}terminateAllWorkers(){this.workers.forEach((r)=>{try{r.terminate()}catch(e){a.error(`Error terminating worker: ${c(e)}`)}}),this.workers=[],this.busyWorkers.clear()}async cleanup(){if(this.isShuttingDown=!0,this.busyWorkers.size===0){this.terminateAllWorkers();return}return new Promise((r)=>{let e=setInterval(()=>{if(this.busyWorkers.size===0)clearInterval(e),this.terminateAllWorkers(),r()},100);setTimeout(()=>{clearInterval(e),this.terminateAllWorkers(),r()},5000)})}}
|
package/build/index.d.mts
CHANGED
|
@@ -1,132 +1,146 @@
|
|
|
1
|
-
type WithOptional<
|
|
1
|
+
type WithOptional<
|
|
2
|
+
T,
|
|
3
|
+
K extends keyof T
|
|
4
|
+
> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
2
5
|
|
|
3
|
-
type Format =
|
|
4
|
-
type Target =
|
|
6
|
+
type Format = "esm" | "cjs" | "iife";
|
|
7
|
+
type Target = "bun" | "node" | "browser";
|
|
5
8
|
type External = string[];
|
|
6
9
|
type Entry = string[] | Record<string, string>;
|
|
7
10
|
type DtsOptions = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Entry point files for TypeScript declaration file generation
|
|
13
|
+
*
|
|
14
|
+
* This can be:
|
|
15
|
+
* - An array of file paths
|
|
16
|
+
* - An object where keys are output names and values are input file paths
|
|
17
|
+
*
|
|
18
|
+
* The key names are used for the generated declaration files.
|
|
19
|
+
* For example, {custom: './src/index.ts'} will generate custom.d.ts
|
|
20
|
+
*
|
|
21
|
+
* If not specified, the main entry points will be used for declaration file generation.
|
|
22
|
+
*
|
|
23
|
+
* If a string path is provided in an array, the file name (without extension)
|
|
24
|
+
* will be used as the name for the output declaration file.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // Using string paths in an array
|
|
28
|
+
* entry: ['./src/index.ts'] // Generates index.d.ts
|
|
29
|
+
*
|
|
30
|
+
* // Using named outputs as an object
|
|
31
|
+
* entry: { myModule: './src/index.ts', utils: './src/utility-functions.ts' } // Generates myModule.d.ts and utils.d.ts
|
|
32
|
+
*/
|
|
33
|
+
entry: Entry
|
|
34
|
+
/**
|
|
35
|
+
* Path to a preferred tsconfig.json file to use for declaration generation
|
|
36
|
+
*
|
|
37
|
+
* If not specified, the tsconfig.json in the project root will be used.
|
|
38
|
+
* This option allows you to use a different TypeScript configuration
|
|
39
|
+
* specifically for declaration file generation.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* preferredTsconfigPath: './tsconfig.build.json'
|
|
43
|
+
*/
|
|
44
|
+
preferredTsconfigPath?: string
|
|
31
45
|
};
|
|
32
46
|
interface BunupOptions {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Name of the build configuration
|
|
49
|
+
* Used for logging and identification purposes
|
|
50
|
+
*/
|
|
51
|
+
name?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Entry point files for the build
|
|
54
|
+
*
|
|
55
|
+
* This can be:
|
|
56
|
+
* - An array of file paths
|
|
57
|
+
* - An object where keys are output names and values are input file paths
|
|
58
|
+
*
|
|
59
|
+
* The key names are used for the generated output files.
|
|
60
|
+
* For example, {custom: './src/index.ts'} will generate custom.js
|
|
61
|
+
*
|
|
62
|
+
* If a string path is provided in an array, the file name (without extension)
|
|
63
|
+
* will be used as the name for the output file.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* // Using string paths in an array
|
|
67
|
+
* entry: ['./src/index.ts'] // Generates index.js
|
|
68
|
+
*
|
|
69
|
+
* // Using named outputs as an object
|
|
70
|
+
* entry: { myModule: './src/index.ts', utils: './src/utility-functions.ts' } // Generates myModule.js and utils.js
|
|
71
|
+
*/
|
|
72
|
+
entry: Entry;
|
|
73
|
+
/**
|
|
74
|
+
* Output directory for the bundled files
|
|
75
|
+
* Defaults to 'dist' if not specified
|
|
76
|
+
*/
|
|
77
|
+
outDir: string;
|
|
78
|
+
/**
|
|
79
|
+
* Output formats for the bundle
|
|
80
|
+
* Can include 'esm', 'cjs', and/or 'iife'
|
|
81
|
+
* Defaults to ['esm'] if not specified
|
|
82
|
+
*/
|
|
83
|
+
format: Format[];
|
|
84
|
+
/**
|
|
85
|
+
* Whether to enable all minification options
|
|
86
|
+
* When true, enables minifyWhitespace, minifyIdentifiers, and minifySyntax
|
|
87
|
+
*/
|
|
88
|
+
minify?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Whether to enable code splitting
|
|
91
|
+
* Defaults to true for ESM format, false for CJS format
|
|
92
|
+
*/
|
|
93
|
+
splitting?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Whether to minify whitespace in the output
|
|
96
|
+
* Removes unnecessary whitespace to reduce file size
|
|
97
|
+
*/
|
|
98
|
+
minifyWhitespace?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Whether to minify identifiers in the output
|
|
101
|
+
* Renames variables and functions to shorter names
|
|
102
|
+
*/
|
|
103
|
+
minifyIdentifiers?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Whether to minify syntax in the output
|
|
106
|
+
* Optimizes code structure for smaller file size
|
|
107
|
+
*/
|
|
108
|
+
minifySyntax?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Whether to watch for file changes and rebuild automatically
|
|
111
|
+
*/
|
|
112
|
+
watch?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Whether to generate TypeScript declaration files (.d.ts)
|
|
115
|
+
* When set to true, generates declaration files for all entry points
|
|
116
|
+
* Can also be configured with DtsOptions for more control
|
|
117
|
+
*/
|
|
118
|
+
dts?: boolean | DtsOptions;
|
|
119
|
+
/**
|
|
120
|
+
* External packages that should not be bundled
|
|
121
|
+
* Useful for dependencies that should be kept as external imports
|
|
122
|
+
*/
|
|
123
|
+
external?: External;
|
|
124
|
+
/**
|
|
125
|
+
* Packages that should be bundled even if they are in external
|
|
126
|
+
* Useful for dependencies that should be included in the bundle
|
|
127
|
+
*/
|
|
128
|
+
noExternal?: External;
|
|
129
|
+
/**
|
|
130
|
+
* The target environment for the bundle
|
|
131
|
+
* Can be 'browser', 'bun', 'node', etc.
|
|
132
|
+
* Defaults to 'node' if not specified
|
|
133
|
+
*/
|
|
134
|
+
target?: Target;
|
|
135
|
+
/**
|
|
136
|
+
* Whether to clean the output directory before building
|
|
137
|
+
* When true, removes all files in the outDir before starting a new build
|
|
138
|
+
* Defaults to true if not specified
|
|
139
|
+
*/
|
|
140
|
+
clean?: boolean;
|
|
127
141
|
}
|
|
128
142
|
|
|
129
|
-
type DefineConfigOption = WithOptional<BunupOptions,
|
|
143
|
+
type DefineConfigOption = WithOptional<BunupOptions, "outDir" | "format">;
|
|
130
144
|
type DefineConfigOptions = DefineConfigOption | DefineConfigOption[];
|
|
131
145
|
declare function defineConfig(options: DefineConfigOptions): DefineConfigOptions;
|
|
132
146
|
|
package/build/index.d.ts
CHANGED
|
@@ -1,132 +1,146 @@
|
|
|
1
|
-
type WithOptional<
|
|
1
|
+
type WithOptional<
|
|
2
|
+
T,
|
|
3
|
+
K extends keyof T
|
|
4
|
+
> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
2
5
|
|
|
3
|
-
type Format =
|
|
4
|
-
type Target =
|
|
6
|
+
type Format = "esm" | "cjs" | "iife";
|
|
7
|
+
type Target = "bun" | "node" | "browser";
|
|
5
8
|
type External = string[];
|
|
6
9
|
type Entry = string[] | Record<string, string>;
|
|
7
10
|
type DtsOptions = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Entry point files for TypeScript declaration file generation
|
|
13
|
+
*
|
|
14
|
+
* This can be:
|
|
15
|
+
* - An array of file paths
|
|
16
|
+
* - An object where keys are output names and values are input file paths
|
|
17
|
+
*
|
|
18
|
+
* The key names are used for the generated declaration files.
|
|
19
|
+
* For example, {custom: './src/index.ts'} will generate custom.d.ts
|
|
20
|
+
*
|
|
21
|
+
* If not specified, the main entry points will be used for declaration file generation.
|
|
22
|
+
*
|
|
23
|
+
* If a string path is provided in an array, the file name (without extension)
|
|
24
|
+
* will be used as the name for the output declaration file.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // Using string paths in an array
|
|
28
|
+
* entry: ['./src/index.ts'] // Generates index.d.ts
|
|
29
|
+
*
|
|
30
|
+
* // Using named outputs as an object
|
|
31
|
+
* entry: { myModule: './src/index.ts', utils: './src/utility-functions.ts' } // Generates myModule.d.ts and utils.d.ts
|
|
32
|
+
*/
|
|
33
|
+
entry: Entry
|
|
34
|
+
/**
|
|
35
|
+
* Path to a preferred tsconfig.json file to use for declaration generation
|
|
36
|
+
*
|
|
37
|
+
* If not specified, the tsconfig.json in the project root will be used.
|
|
38
|
+
* This option allows you to use a different TypeScript configuration
|
|
39
|
+
* specifically for declaration file generation.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* preferredTsconfigPath: './tsconfig.build.json'
|
|
43
|
+
*/
|
|
44
|
+
preferredTsconfigPath?: string
|
|
31
45
|
};
|
|
32
46
|
interface BunupOptions {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Name of the build configuration
|
|
49
|
+
* Used for logging and identification purposes
|
|
50
|
+
*/
|
|
51
|
+
name?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Entry point files for the build
|
|
54
|
+
*
|
|
55
|
+
* This can be:
|
|
56
|
+
* - An array of file paths
|
|
57
|
+
* - An object where keys are output names and values are input file paths
|
|
58
|
+
*
|
|
59
|
+
* The key names are used for the generated output files.
|
|
60
|
+
* For example, {custom: './src/index.ts'} will generate custom.js
|
|
61
|
+
*
|
|
62
|
+
* If a string path is provided in an array, the file name (without extension)
|
|
63
|
+
* will be used as the name for the output file.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* // Using string paths in an array
|
|
67
|
+
* entry: ['./src/index.ts'] // Generates index.js
|
|
68
|
+
*
|
|
69
|
+
* // Using named outputs as an object
|
|
70
|
+
* entry: { myModule: './src/index.ts', utils: './src/utility-functions.ts' } // Generates myModule.js and utils.js
|
|
71
|
+
*/
|
|
72
|
+
entry: Entry;
|
|
73
|
+
/**
|
|
74
|
+
* Output directory for the bundled files
|
|
75
|
+
* Defaults to 'dist' if not specified
|
|
76
|
+
*/
|
|
77
|
+
outDir: string;
|
|
78
|
+
/**
|
|
79
|
+
* Output formats for the bundle
|
|
80
|
+
* Can include 'esm', 'cjs', and/or 'iife'
|
|
81
|
+
* Defaults to ['esm'] if not specified
|
|
82
|
+
*/
|
|
83
|
+
format: Format[];
|
|
84
|
+
/**
|
|
85
|
+
* Whether to enable all minification options
|
|
86
|
+
* When true, enables minifyWhitespace, minifyIdentifiers, and minifySyntax
|
|
87
|
+
*/
|
|
88
|
+
minify?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Whether to enable code splitting
|
|
91
|
+
* Defaults to true for ESM format, false for CJS format
|
|
92
|
+
*/
|
|
93
|
+
splitting?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Whether to minify whitespace in the output
|
|
96
|
+
* Removes unnecessary whitespace to reduce file size
|
|
97
|
+
*/
|
|
98
|
+
minifyWhitespace?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Whether to minify identifiers in the output
|
|
101
|
+
* Renames variables and functions to shorter names
|
|
102
|
+
*/
|
|
103
|
+
minifyIdentifiers?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Whether to minify syntax in the output
|
|
106
|
+
* Optimizes code structure for smaller file size
|
|
107
|
+
*/
|
|
108
|
+
minifySyntax?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Whether to watch for file changes and rebuild automatically
|
|
111
|
+
*/
|
|
112
|
+
watch?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Whether to generate TypeScript declaration files (.d.ts)
|
|
115
|
+
* When set to true, generates declaration files for all entry points
|
|
116
|
+
* Can also be configured with DtsOptions for more control
|
|
117
|
+
*/
|
|
118
|
+
dts?: boolean | DtsOptions;
|
|
119
|
+
/**
|
|
120
|
+
* External packages that should not be bundled
|
|
121
|
+
* Useful for dependencies that should be kept as external imports
|
|
122
|
+
*/
|
|
123
|
+
external?: External;
|
|
124
|
+
/**
|
|
125
|
+
* Packages that should be bundled even if they are in external
|
|
126
|
+
* Useful for dependencies that should be included in the bundle
|
|
127
|
+
*/
|
|
128
|
+
noExternal?: External;
|
|
129
|
+
/**
|
|
130
|
+
* The target environment for the bundle
|
|
131
|
+
* Can be 'browser', 'bun', 'node', etc.
|
|
132
|
+
* Defaults to 'node' if not specified
|
|
133
|
+
*/
|
|
134
|
+
target?: Target;
|
|
135
|
+
/**
|
|
136
|
+
* Whether to clean the output directory before building
|
|
137
|
+
* When true, removes all files in the outDir before starting a new build
|
|
138
|
+
* Defaults to true if not specified
|
|
139
|
+
*/
|
|
140
|
+
clean?: boolean;
|
|
127
141
|
}
|
|
128
142
|
|
|
129
|
-
type DefineConfigOption = WithOptional<BunupOptions,
|
|
143
|
+
type DefineConfigOption = WithOptional<BunupOptions, "outDir" | "format">;
|
|
130
144
|
type DefineConfigOptions = DefineConfigOption | DefineConfigOption[];
|
|
131
145
|
declare function defineConfig(options: DefineConfigOptions): DefineConfigOptions;
|
|
132
146
|
|
package/build/index.js
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// src/define-config.ts
|
|
4
|
-
function defineConfig(options) {
|
|
5
|
-
return options;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
exports.defineConfig = defineConfig;
|
|
1
|
+
var D=require("node:module");var{defineProperty:e,getOwnPropertyNames:r,getOwnPropertyDescriptor:O}=Object,g=Object.prototype.hasOwnProperty;var f=new WeakMap,C=(i)=>{var n=f.get(i),o;if(n)return n;if(n=e({},"__esModule",{value:!0}),i&&typeof i==="object"||typeof i==="function")r(i).map((t)=>!g.call(n,t)&&e(n,t,{get:()=>i[t],enumerable:!(o=O(i,t))||o.enumerable}));return f.set(i,n),n};var u=(i,n)=>{for(var o in n)e(i,o,{get:n[o],enumerable:!0,configurable:!0,set:(t)=>n[o]=()=>t})};var m={};u(m,{defineConfig:()=>p});module.exports=C(m);function p(i){return i}
|
package/build/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bunup",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "A extremely fast, zero-config bundler for TypeScript & JavaScript, powered by Bun.",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -18,11 +18,10 @@
|
|
|
18
18
|
"@types/bun": "^1.2.5",
|
|
19
19
|
"@typescript-eslint/eslint-plugin": "^7.3.1",
|
|
20
20
|
"bumpp": "^10.1.0",
|
|
21
|
-
"bunup": "^0.1.
|
|
21
|
+
"bunup": "^0.1.6",
|
|
22
22
|
"eslint": "^8.57.0",
|
|
23
23
|
"husky": "^9.1.6",
|
|
24
24
|
"prettier": "^3.2.5",
|
|
25
|
-
"tsup": "^8.0.2",
|
|
26
25
|
"typescript": "^5.4.3",
|
|
27
26
|
"vitest": "^2.0.5"
|
|
28
27
|
},
|
|
@@ -59,8 +58,8 @@
|
|
|
59
58
|
"rollup-plugin-dts": "^6.1.1"
|
|
60
59
|
},
|
|
61
60
|
"scripts": {
|
|
62
|
-
"build": "
|
|
63
|
-
"dev": "
|
|
61
|
+
"build": "bunup",
|
|
62
|
+
"dev": "bunup --watch",
|
|
64
63
|
"test-build": "pnpm -C tests build",
|
|
65
64
|
"test": "vitest run",
|
|
66
65
|
"tsc": "tsc --noEmit",
|