bunup 0.6.0 → 0.6.1
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/README.md +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.d.cts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/plugins.d.cts +22 -0
- package/dist/plugins.d.ts +22 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
[](https://www.npmjs.com/package/bunup) [](https://npmjs.com/package/bunup) [](https://bun.sh) [](https://github.com/sponsors/arshad-yaseen)
|
|
14
14
|
|
|
15
|
-
Bunup is the **blazing-fast build tool** for TypeScript and JavaScript libraries, designed for flawless developer experience and speed, **powered by Bun's native bundler** — up to **~
|
|
15
|
+
Bunup is the **blazing-fast build tool** for TypeScript and JavaScript libraries, designed for flawless developer experience and speed, **powered by Bun's native bundler** — up to **~100× faster than Tsup**.
|
|
16
16
|
|
|
17
17
|
| Bundler | Format | Build Time | Build Time (with dts) |
|
|
18
18
|
| --------- | ------------ | -------------- | --------------------- |
|
package/dist/cli.js
CHANGED
|
@@ -62,7 +62,7 @@ export default defineWorkspace([
|
|
|
62
62
|
${p}
|
|
63
63
|
]);
|
|
64
64
|
`;await S.writeFile(s,d)}function ct(e,t){return t.filter((n)=>e.includes(n.value)).map((n)=>n.configGenerator?n.configGenerator():`${n.value}()`).join(", ")}async function Kt(e,t){let n=e.scripts||{},i=!1;for(let[r,o]of[["build","bunup"],["dev","bunup --watch"]])if(!n[r]||await j({message:`Script '${r}' exists. Replace with '${o}'?`,initialValue:!0}))n[r]=o,i=!0;if(i)e.scripts=n,await S.writeFile(t,JSON.stringify(e,null,2))}async function Xt(e,t){if(e.dependencies?.bunup||e.devDependencies?.bunup){C.info(`Bunup is already installed
|
|
65
|
-
`);return}let i={bun:"-d",npm:"-D",pnpm:"-D",yarn:"-D"},r=fe(t.agent,"add",[i[t.agent]||"-D","bunup"]);if(!r)throw new Error("Failed to resolve install command");await zt(be(r),[],{nodeOptions:{shell:!0,stdio:"pipe"}})}function be(e){if(!e)return"";return`${e.command} ${e.args.join(" ")}`}async function lt(){let e={},t=!1,n=T.join(process.cwd(),"tsconfig.json");try{let{config:r,filepath:o}=await he({name:"tsconfig",cwd:process.cwd(),extensions:[".json"]});if(r&&o)e=r,t=!0,n=o}catch{}if(e.compilerOptions?.isolatedDeclarations!==!0){C.info(`${f.default.cyan("About isolatedDeclarations:")} ${f.default.gray(`A ${f.default.bold("modern TypeScript feature")} for library authors`)}`),C.info(f.default.gray(`Benefits: ${f.default.bold("faster builds")}, ${f.default.bold("more reliable API types")}, and ${f.default.bold("better editor support")} to catch issues during development`));let r=await j({message:"Enable isolatedDeclarations in tsconfig.json? (recommended but optional)",initialValue:!0});if(x(r))return;if(r){if(e.compilerOptions=e.compilerOptions||{},e.compilerOptions.isolatedDeclarations=!0,e.compilerOptions.declaration=!0,"allowJs"in e.compilerOptions)e.compilerOptions.allowJs=null;if(e.exclude=e.exclude||[],!e.exclude.includes("bunup.config.ts"))e.exclude.push("bunup.config.ts");await S.writeFile(n,JSON.stringify(e,null,2)),C.success("Updated tsconfig.json with isolatedDeclarations")}}else if(t){if(e.exclude=e.exclude||[],!e.exclude.includes("bunup.config.ts"))e.exclude.push("bunup.config.ts"),await S.writeFile(n,JSON.stringify(e,null,2))}}var f;var pt=P(()=>{f=I(v(),1)});import{exec as Qt}from"tinyexec";var Y="0.6.
|
|
65
|
+
`);return}let i={bun:"-d",npm:"-D",pnpm:"-D",yarn:"-D"},r=fe(t.agent,"add",[i[t.agent]||"-D","bunup"]);if(!r)throw new Error("Failed to resolve install command");await zt(be(r),[],{nodeOptions:{shell:!0,stdio:"pipe"}})}function be(e){if(!e)return"";return`${e.command} ${e.args.join(" ")}`}async function lt(){let e={},t=!1,n=T.join(process.cwd(),"tsconfig.json");try{let{config:r,filepath:o}=await he({name:"tsconfig",cwd:process.cwd(),extensions:[".json"]});if(r&&o)e=r,t=!0,n=o}catch{}if(e.compilerOptions?.isolatedDeclarations!==!0){C.info(`${f.default.cyan("About isolatedDeclarations:")} ${f.default.gray(`A ${f.default.bold("modern TypeScript feature")} for library authors`)}`),C.info(f.default.gray(`Benefits: ${f.default.bold("faster builds")}, ${f.default.bold("more reliable API types")}, and ${f.default.bold("better editor support")} to catch issues during development`));let r=await j({message:"Enable isolatedDeclarations in tsconfig.json? (recommended but optional)",initialValue:!0});if(x(r))return;if(r){if(e.compilerOptions=e.compilerOptions||{},e.compilerOptions.isolatedDeclarations=!0,e.compilerOptions.declaration=!0,"allowJs"in e.compilerOptions)e.compilerOptions.allowJs=null;if(e.exclude=e.exclude||[],!e.exclude.includes("bunup.config.ts"))e.exclude.push("bunup.config.ts");await S.writeFile(n,JSON.stringify(e,null,2)),C.success("Updated tsconfig.json with isolatedDeclarations")}}else if(t){if(e.exclude=e.exclude||[],!e.exclude.includes("bunup.config.ts"))e.exclude.push("bunup.config.ts"),await S.writeFile(n,JSON.stringify(e,null,2))}}var f;var pt=P(()=>{f=I(v(),1)});import{exec as Qt}from"tinyexec";var Y="0.6.1";J();L();var le=I(v(),1);var ke="https://bunup.dev/docs/guide/cli-options";J();Q();L();function w(e){return(t,n)=>{n[e]=t===!0||t==="true"}}function E(e){return(t,n)=>{if(typeof t==="string")n[e]=t;else throw new k(`Option --${e} requires a string value`)}}function Z(e){return(t,n)=>{if(typeof t==="string")n[e]=t.split(",");else throw new k(`Option --${e} requires a string value`)}}function Et(e){return(t,n)=>{if(typeof t==="boolean")n[e]=t;else if(typeof t==="string")if(t.toLowerCase()==="true"||t.toLowerCase()==="false")n[e]=t.toLowerCase()==="true";else n[e]=t;else throw new k(`Option --${e} requires a boolean or string value`)}}function St(){console.log(`
|
|
66
66
|
Bunup - \u26A1\uFE0F A blazing-fast build tool for your libraries built with Bun.
|
|
67
67
|
`),console.log("For more information on available options, visit:"),console.log(`${le.default.cyan(le.default.underline(ke))}
|
|
68
68
|
`),process.exit(0)}function Rt(){console.log(Y),process.exit(0)}var Re={name:{flags:["n","name"],handler:E("name")},format:{flags:["f","format"],handler:Z("format")},outDir:{flags:["o","out-dir"],handler:E("outDir")},minify:{flags:["m","minify"],handler:w("minify")},watch:{flags:["w","watch"],handler:w("watch")},dts:{flags:["d","dts"],handler:w("dts")},banner:{flags:["bn","banner"],handler:E("banner")},footer:{flags:["ft","footer"],handler:E("footer")},external:{flags:["e","external"],handler:Z("external")},sourcemap:{flags:["sm","sourcemap"],handler:Et("sourcemap")},target:{flags:["t","target"],handler:E("target")},minifyWhitespace:{flags:["mw","minify-whitespace"],handler:w("minifyWhitespace")},minifyIdentifiers:{flags:["mi","minify-identifiers"],handler:w("minifyIdentifiers")},minifySyntax:{flags:["ms","minify-syntax"],handler:w("minifySyntax")},clean:{flags:["c","clean"],handler:w("clean")},splitting:{flags:["s","splitting"],handler:w("splitting")},noExternal:{flags:["ne","no-external"],handler:Z("noExternal")},preferredTsconfigPath:{flags:["tsconfig","preferred-tsconfig-path"],handler:E("preferredTsconfigPath")},bytecode:{flags:["bc","bytecode"],handler:w("bytecode")},silent:{flags:["silent"],handler:w("silent")},config:{flags:["config"],handler:E("config")},publicPath:{flags:["pp","public-path"],handler:E("publicPath")},env:{flags:["env"],handler:E("env")},shims:{flags:["shims"],handler:w("shims")},onSuccess:{flags:["onSuccess"],handler:E("onSuccess")},filter:{flags:["filter"],handler:Z("filter")},init:{flags:["init"],handler:w("init")},entry:{flags:["entry"],handler:(e,t,n)=>{if(typeof e!=="string")throw new k(`Entry${n?` --entry.${n}`:""} requires a string value`);let i=t.entry||{};if(n){if(i[n])m.warn(`Duplicate entry name '${n}' provided via --entry.${n}. Overwriting previous entry.`);i[n]=e}else{let r=Ee(e);if(i[r])m.warn(`Duplicate entry name '${r}' derived from '${e}'. Overwriting previous entry.`);i[r]=e}t.entry=i}},resolveDts:{flags:["rd","resolve-dts"],handler:(e,t)=>{if(!t.dts)t.dts={};if(typeof t.dts==="boolean")t.dts={};if(typeof e==="string")if(e==="true"||e==="false")t.dts.resolve=e==="true";else t.dts.resolve=e.split(",");else t.dts.resolve=!0}},help:{flags:["h","help"],handler:()=>St()},version:{flags:["v","version"],handler:()=>Rt()}},H={};for(let e of Object.values(Re))for(let t of e.flags)H[t]=e.handler;function je(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];if(i.startsWith("--")){let r,o;if(i.includes("=")){let[s,a]=i.slice(2).split("=",2);r=s,o=a}else{r=i.slice(2);let s=e[n+1];if(o=s&&!s.startsWith("-")?s:!0,typeof o==="string")n++}if(r.includes(".")){let[s,a]=r.split(".",2),p=H[s];if(p)p(o,t,a);else throw new k(`Unknown option: --${r}`)}else{let s=H[r];if(s)s(o,t);else throw new k(`Unknown option: --${r}`)}}else if(i.startsWith("-")){let r=i.slice(1),o=e[n+1],s=o&&!o.startsWith("-")?o:!0;if(typeof s==="string")n++;let a=H[r];if(a)a(s,t);else throw new k(`Unknown option: -${r}`)}else Re.entry.handler(i,t,void 0)}return t}var dt=I(v(),1);ue();M();import{loadConfig as Zt}from"coffi";me();J();Q();L();pe();M();import ie from"path";async function ot(e,t){let n=new Set,i=ne(e),r=X(i);for(let d of r){let l=ie.resolve(t,d.path),h=ie.dirname(l);n.add(h)}let s=(await import("chokidar")).watch(Array.from(n),{persistent:!0,ignoreInitial:!0,atomic:!0,ignorePermissionErrors:!0,ignored:[/[\\/]\.git[\\/]/,/[\\/]node_modules[\\/]/,ie.join(t,i.outDir)]}),a=!1,p=async(d=!1)=>{if(a)return;a=!0;try{let l=performance.now();if(await ge(i,t),!d)m.cli(`\uD83D\uDCE6 Rebuild finished in ${ee(performance.now()-l)}`)}catch(l){ae(l)}finally{a=!1}};s.on("change",(d)=>{let l=ie.relative(t,d);m.cli(`File changed: ${l}`,{muted:!0,once:l}),p()}),s.on("error",(d)=>{throw new K(`Watcher error: ${se(d)}`)}),await p(!0)}async function Ht(e=Bun.argv.slice(2)){let t=je(e);if(t.init){let{init:l}=await Promise.resolve().then(() => (pt(),ut));await l();return}N(t.silent);let n=process.cwd(),{config:i,filepath:r}=await Zt({name:"bunup.config",extensions:[".ts",".js",".mjs",".cjs"],maxDepth:1,preferredPath:t.config,packageJsonProperty:"bunup"}),o=!i?[{rootDir:n,options:t}]:await Le(i,n,t.filter);if(m.cli(`Using bunup v${Y} and bun v${Bun.version}`,{muted:!0}),r)m.cli(`Using ${te(r,2)}`,{muted:!0});let s=performance.now();m.cli("Build started");let{build:a}=await Promise.resolve().then(() => (me(),rt));await Promise.all(o.flatMap(({options:l,rootDir:h})=>{return Fe(l).map(async(O)=>{let D={...O,...en(t)};if(D.watch)await ot(D,h);else await a(D,h)})}));let p=performance.now()-s,d=ee(p);if(m.cli(`\u26A1\uFE0F Build completed in ${dt.default.green(d)}`),t.watch)m.cli("\uD83D\uDC40 Watching for file changes");if(t.onSuccess)m.cli(`Running command: ${t.onSuccess}`,{muted:!0}),await Qt(t.onSuccess,[],{nodeOptions:{shell:!0,stdio:"inherit"}});if(!t.watch)process.exit(process.exitCode??0)}function en(e){return{...e,onSuccess:void 0,config:void 0,filter:void 0,init:void 0}}Ht().catch((e)=>$e(e));
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import _Bun from "bun";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a Bun plugin that can be used with Bunup
|
|
4
|
+
*/
|
|
2
5
|
type BunupBunPlugin = {
|
|
3
6
|
/** Identifies this as a native Bun plugin */
|
|
4
7
|
type: "bun"
|
|
@@ -7,6 +10,9 @@ type BunupBunPlugin = {
|
|
|
7
10
|
/** The actual Bun plugin implementation */
|
|
8
11
|
plugin: BunPlugin
|
|
9
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Represents the output of a build operation
|
|
15
|
+
*/
|
|
10
16
|
type BuildOutput = {
|
|
11
17
|
/** Array of generated files with their paths and contents */
|
|
12
18
|
files: Array<{
|
|
@@ -16,12 +22,18 @@ type BuildOutput = {
|
|
|
16
22
|
relativePathToRootDir: string
|
|
17
23
|
}>
|
|
18
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Context provided to build hooks
|
|
27
|
+
*/
|
|
19
28
|
type BuildContext = {
|
|
20
29
|
/** The build options that were used */
|
|
21
30
|
options: BuildOptions
|
|
22
31
|
/** The output of the build */
|
|
23
32
|
output: BuildOutput
|
|
24
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Hooks that can be implemented by Bunup plugins
|
|
36
|
+
*/
|
|
25
37
|
type BunupPluginHooks = {
|
|
26
38
|
/**
|
|
27
39
|
* Called when a build is successfully completed
|
|
@@ -34,6 +46,9 @@ type BunupPluginHooks = {
|
|
|
34
46
|
*/
|
|
35
47
|
onBuildStart?: (options: BuildOptions) => MaybePromise<void>
|
|
36
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* Represents a Bunup-specific plugin
|
|
51
|
+
*/
|
|
37
52
|
type BunupPlugin = {
|
|
38
53
|
/** Identifies this as a Bunup-specific plugin */
|
|
39
54
|
type: "bunup"
|
|
@@ -42,6 +57,9 @@ type BunupPlugin = {
|
|
|
42
57
|
/** The hooks implemented by this plugin */
|
|
43
58
|
hooks: BunupPluginHooks
|
|
44
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Union type representing all supported plugin types
|
|
62
|
+
*/
|
|
45
63
|
type Plugin = BunupBunPlugin | BunupPlugin;
|
|
46
64
|
type Loader = NonNullable<BunBuildOptions["loader"]>[string];
|
|
47
65
|
type Define = BunBuildOptions["define"];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import _Bun from "bun";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a Bun plugin that can be used with Bunup
|
|
4
|
+
*/
|
|
2
5
|
type BunupBunPlugin = {
|
|
3
6
|
/** Identifies this as a native Bun plugin */
|
|
4
7
|
type: "bun"
|
|
@@ -7,6 +10,9 @@ type BunupBunPlugin = {
|
|
|
7
10
|
/** The actual Bun plugin implementation */
|
|
8
11
|
plugin: BunPlugin
|
|
9
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Represents the output of a build operation
|
|
15
|
+
*/
|
|
10
16
|
type BuildOutput = {
|
|
11
17
|
/** Array of generated files with their paths and contents */
|
|
12
18
|
files: Array<{
|
|
@@ -16,12 +22,18 @@ type BuildOutput = {
|
|
|
16
22
|
relativePathToRootDir: string
|
|
17
23
|
}>
|
|
18
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Context provided to build hooks
|
|
27
|
+
*/
|
|
19
28
|
type BuildContext = {
|
|
20
29
|
/** The build options that were used */
|
|
21
30
|
options: BuildOptions
|
|
22
31
|
/** The output of the build */
|
|
23
32
|
output: BuildOutput
|
|
24
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Hooks that can be implemented by Bunup plugins
|
|
36
|
+
*/
|
|
25
37
|
type BunupPluginHooks = {
|
|
26
38
|
/**
|
|
27
39
|
* Called when a build is successfully completed
|
|
@@ -34,6 +46,9 @@ type BunupPluginHooks = {
|
|
|
34
46
|
*/
|
|
35
47
|
onBuildStart?: (options: BuildOptions) => MaybePromise<void>
|
|
36
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* Represents a Bunup-specific plugin
|
|
51
|
+
*/
|
|
37
52
|
type BunupPlugin = {
|
|
38
53
|
/** Identifies this as a Bunup-specific plugin */
|
|
39
54
|
type: "bunup"
|
|
@@ -42,6 +57,9 @@ type BunupPlugin = {
|
|
|
42
57
|
/** The hooks implemented by this plugin */
|
|
43
58
|
hooks: BunupPluginHooks
|
|
44
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Union type representing all supported plugin types
|
|
62
|
+
*/
|
|
45
63
|
type Plugin = BunupBunPlugin | BunupPlugin;
|
|
46
64
|
type Loader = NonNullable<BunBuildOptions["loader"]>[string];
|
|
47
65
|
type Define = BunBuildOptions["define"];
|
package/dist/plugins.d.cts
CHANGED
|
@@ -309,6 +309,9 @@ interface BuildOptions {
|
|
|
309
309
|
js: string
|
|
310
310
|
};
|
|
311
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Represents a Bun plugin that can be used with Bunup
|
|
314
|
+
*/
|
|
312
315
|
type BunupBunPlugin = {
|
|
313
316
|
/** Identifies this as a native Bun plugin */
|
|
314
317
|
type: "bun"
|
|
@@ -317,6 +320,9 @@ type BunupBunPlugin = {
|
|
|
317
320
|
/** The actual Bun plugin implementation */
|
|
318
321
|
plugin: BunPlugin
|
|
319
322
|
};
|
|
323
|
+
/**
|
|
324
|
+
* Represents the output of a build operation
|
|
325
|
+
*/
|
|
320
326
|
type BuildOutput = {
|
|
321
327
|
/** Array of generated files with their paths and contents */
|
|
322
328
|
files: Array<{
|
|
@@ -326,12 +332,18 @@ type BuildOutput = {
|
|
|
326
332
|
relativePathToRootDir: string
|
|
327
333
|
}>
|
|
328
334
|
};
|
|
335
|
+
/**
|
|
336
|
+
* Context provided to build hooks
|
|
337
|
+
*/
|
|
329
338
|
type BuildContext = {
|
|
330
339
|
/** The build options that were used */
|
|
331
340
|
options: BuildOptions
|
|
332
341
|
/** The output of the build */
|
|
333
342
|
output: BuildOutput
|
|
334
343
|
};
|
|
344
|
+
/**
|
|
345
|
+
* Hooks that can be implemented by Bunup plugins
|
|
346
|
+
*/
|
|
335
347
|
type BunupPluginHooks = {
|
|
336
348
|
/**
|
|
337
349
|
* Called when a build is successfully completed
|
|
@@ -344,6 +356,9 @@ type BunupPluginHooks = {
|
|
|
344
356
|
*/
|
|
345
357
|
onBuildStart?: (options: BuildOptions) => MaybePromise<void>
|
|
346
358
|
};
|
|
359
|
+
/**
|
|
360
|
+
* Represents a Bunup-specific plugin
|
|
361
|
+
*/
|
|
347
362
|
type BunupPlugin = {
|
|
348
363
|
/** Identifies this as a Bunup-specific plugin */
|
|
349
364
|
type: "bunup"
|
|
@@ -352,6 +367,9 @@ type BunupPlugin = {
|
|
|
352
367
|
/** The hooks implemented by this plugin */
|
|
353
368
|
hooks: BunupPluginHooks
|
|
354
369
|
};
|
|
370
|
+
/**
|
|
371
|
+
* Union type representing all supported plugin types
|
|
372
|
+
*/
|
|
355
373
|
type Plugin = BunupBunPlugin | BunupPlugin;
|
|
356
374
|
type ReportPluginOptions = {
|
|
357
375
|
/**
|
|
@@ -366,5 +384,9 @@ type ReportPluginOptions = {
|
|
|
366
384
|
*/
|
|
367
385
|
gzip?: boolean
|
|
368
386
|
};
|
|
387
|
+
/**
|
|
388
|
+
* A plugin that logs a report of the bundle size.
|
|
389
|
+
* @param options - The options for the report plugin.
|
|
390
|
+
*/
|
|
369
391
|
declare function report(options?: ReportPluginOptions): BunupPlugin;
|
|
370
392
|
export { report };
|
package/dist/plugins.d.ts
CHANGED
|
@@ -309,6 +309,9 @@ interface BuildOptions {
|
|
|
309
309
|
js: string
|
|
310
310
|
};
|
|
311
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Represents a Bun plugin that can be used with Bunup
|
|
314
|
+
*/
|
|
312
315
|
type BunupBunPlugin = {
|
|
313
316
|
/** Identifies this as a native Bun plugin */
|
|
314
317
|
type: "bun"
|
|
@@ -317,6 +320,9 @@ type BunupBunPlugin = {
|
|
|
317
320
|
/** The actual Bun plugin implementation */
|
|
318
321
|
plugin: BunPlugin
|
|
319
322
|
};
|
|
323
|
+
/**
|
|
324
|
+
* Represents the output of a build operation
|
|
325
|
+
*/
|
|
320
326
|
type BuildOutput = {
|
|
321
327
|
/** Array of generated files with their paths and contents */
|
|
322
328
|
files: Array<{
|
|
@@ -326,12 +332,18 @@ type BuildOutput = {
|
|
|
326
332
|
relativePathToRootDir: string
|
|
327
333
|
}>
|
|
328
334
|
};
|
|
335
|
+
/**
|
|
336
|
+
* Context provided to build hooks
|
|
337
|
+
*/
|
|
329
338
|
type BuildContext = {
|
|
330
339
|
/** The build options that were used */
|
|
331
340
|
options: BuildOptions
|
|
332
341
|
/** The output of the build */
|
|
333
342
|
output: BuildOutput
|
|
334
343
|
};
|
|
344
|
+
/**
|
|
345
|
+
* Hooks that can be implemented by Bunup plugins
|
|
346
|
+
*/
|
|
335
347
|
type BunupPluginHooks = {
|
|
336
348
|
/**
|
|
337
349
|
* Called when a build is successfully completed
|
|
@@ -344,6 +356,9 @@ type BunupPluginHooks = {
|
|
|
344
356
|
*/
|
|
345
357
|
onBuildStart?: (options: BuildOptions) => MaybePromise<void>
|
|
346
358
|
};
|
|
359
|
+
/**
|
|
360
|
+
* Represents a Bunup-specific plugin
|
|
361
|
+
*/
|
|
347
362
|
type BunupPlugin = {
|
|
348
363
|
/** Identifies this as a Bunup-specific plugin */
|
|
349
364
|
type: "bunup"
|
|
@@ -352,6 +367,9 @@ type BunupPlugin = {
|
|
|
352
367
|
/** The hooks implemented by this plugin */
|
|
353
368
|
hooks: BunupPluginHooks
|
|
354
369
|
};
|
|
370
|
+
/**
|
|
371
|
+
* Union type representing all supported plugin types
|
|
372
|
+
*/
|
|
355
373
|
type Plugin = BunupBunPlugin | BunupPlugin;
|
|
356
374
|
type ReportPluginOptions = {
|
|
357
375
|
/**
|
|
@@ -366,5 +384,9 @@ type ReportPluginOptions = {
|
|
|
366
384
|
*/
|
|
367
385
|
gzip?: boolean
|
|
368
386
|
};
|
|
387
|
+
/**
|
|
388
|
+
* A plugin that logs a report of the bundle size.
|
|
389
|
+
* @param options - The options for the report plugin.
|
|
390
|
+
*/
|
|
369
391
|
declare function report(options?: ReportPluginOptions): BunupPlugin;
|
|
370
392
|
export { report };
|
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.6.
|
|
4
|
+
"version": "0.6.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Arshad Yaseen <m@arshadyaseen.com> (https://arshadyaseen.com)",
|
|
7
7
|
"maintainers": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@clack/prompts": "^0.10.1",
|
|
43
|
-
"bun-dts": "^0.1.
|
|
43
|
+
"bun-dts": "^0.1.22",
|
|
44
44
|
"chokidar": "^4.0.3",
|
|
45
45
|
"coffi": "^0.1.28",
|
|
46
46
|
"package-manager-detector": "^1.2.0",
|