bunup 0.3.3 → 0.3.4
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.mjs +7 -7
- package/package.json +9 -8
package/build/cli.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
import{loadTsConfig as
|
|
3
|
+
import{loadTsConfig as jn}from"load-tsconfig";class v extends Error{constructor(n){super(n);this.name="BunupError"}}class x extends v{constructor(n){super(n);this.name="BunupBuildError"}}class d extends v{constructor(n){super(n);this.name="BunupDTSBuildError"}}class h extends v{constructor(n){super(n);this.name="BunupCLIError"}}class R extends v{constructor(n){super(n);this.name="BunupWatchError"}}var p=(n)=>{if(n instanceof Error)return n.message;return String(n)},Tn=(n,t)=>{let e=p(n),r=t?`[${t}] `:"",s="ERROR";if(n instanceof x)s="BUILD ERROR";else if(n instanceof d)s="DTS ERROR";else if(n instanceof h)s="CLI ERROR";else if(n instanceof R)s="WATCH ERROR";else if(n instanceof v)s="BUNUP ERROR";if(console.error(`\x1B[31m${s}\x1B[0m ${r}${e}`),n instanceof Error&&n.stack)console.error("\x1B[2m"+n.stack.split(`
|
|
4
4
|
`).slice(1).join(`
|
|
5
|
-
`)+"\x1B[0m")},
|
|
6
|
-
`);let a=o.labels[0],c=a?zn(s,a.start):"",
|
|
5
|
+
`)+"\x1B[0m")},X=(n,t)=>{Tn(n,t),process.exit(1)};var l={MAX_LABEL_LENGTH:3,MAX_MESSAGE_LENGTH:25,colors:{cli:"147",info:"245",warn:"179",error:"174",progress:{ESM:"172",CJS:"108",IIFE:"146",DTS:"110"},default:"252",size:"65"},labels:{cli:"CLI",info:"INFO",warn:"WARN",error:"ERROR"},formatMessage({colorCode:n,label:t,message:e,size:r,identifier:s,muted:i}){let o=" ".repeat(Math.max(0,this.MAX_LABEL_LENGTH-t.length)),a=i?`\x1B[38;5;${this.colors.info}m${e}\x1B[0m`:e;if(r){let[u,...m]=a.split(" "),f=" ".repeat(Math.max(0,this.MAX_MESSAGE_LENGTH-u.length)),g=s?` \x1B[48;5;${n};38;5;0m ${s} \x1B[0m`:"";return`\x1B[38;5;${n}m${t}\x1B[0m ${o}${u}${f} \x1B[38;5;${this.colors.size}m${r}\x1B[0m ${m.join(" ")}${g}`}let c=s?` \x1B[48;5;${n};38;5;0m ${s} \x1B[0m`:"";return`\x1B[38;5;${n}m${t}\x1B[0m ${o}${a}${c}`},output(n,t={},e=console.log){if(t.verticalSpace)console.log("");if(e(n),t.verticalSpace)console.log("")},cli(n,t={}){let e=this.formatMessage({colorCode:this.colors.cli,label:this.labels.cli,message:n,identifier:t.identifier,muted:t.muted});this.output(e,t)},info(n,t={}){let e=this.formatMessage({colorCode:this.colors.info,label:this.labels.info,message:n,identifier:t.identifier,muted:t.muted});this.output(e,t)},warn(n,t={}){let e=this.formatMessage({colorCode:this.colors.warn,label:this.labels.warn,message:n,identifier:t.identifier,muted:t.muted});this.output(e,t,console.warn)},error(n,t={}){let e=this.formatMessage({colorCode:this.colors.error,label:this.labels.error,message:n,identifier:t.identifier,muted:t.muted});this.output(e,t,console.error)},progress(n,t,e,r){let s=String(n),i=this.colors.default,o,a,c={};if(typeof e==="string")o=e,a=r;else if(e)o=e.size,a=e.identifier,c=e;for(let[m,f]of Object.entries(this.colors.progress))if(s.includes(m)){i=f;break}let u=this.formatMessage({colorCode:i,label:s,message:t,size:o,identifier:a,muted:c.muted});this.output(u,c)}};function V(n){try{return jn(".",n)}catch(t){return l.warn(`Failed to load tsconfig: ${p(t)}`),{path:n,data:{},files:[]}}}import{rollup as _n}from"rollup";import Gn from"rollup-plugin-dts";import Q from"typescript";import I from"node:fs";import An from"node:path";var C={entry:[],format:["cjs"],outDir:"dist",minify:!1,watch:!1,dts:!1,target:"node",external:[],clean:!0,sourcemap:"none"};function nn(n,t){return{outdir:`${t}/${n.outDir}`,minify:Nn(n),target:n.target,splitting:n.splitting,sourcemap:n.sourcemap,define:n.define}}function Nn(n){let{minify:t,minifyWhitespace:e,minifyIdentifiers:r,minifySyntax:s}=n,i=t===!0;return{whitespace:e??i,identifiers:r??i,syntax:s??i}}function P(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tn(n=8){return Math.random().toString(36).substring(2,2+n)}function en(n,t){switch(n){case"esm":return".mjs";case"cjs":return j(t)?".cjs":".js";case"iife":return".global.js"}}function rn(n,t){switch(n){case"esm":return".d.mts";case"cjs":return j(t)?".d.cts":".d.ts";case"iife":return".d.ts"}}function j(n){return n==="module"}function N(n){return n>=1000?`${(n/1000).toFixed(2)}s`:`${Math.round(n)}ms`}function sn(n){if(!n)return[];return Array.from(new Set([...Object.keys(n.dependencies||{}),...Object.keys(n.peerDependencies||{})]))}function on(n,t){return n===void 0?t==="esm":n}function J(n){if(n===0)return"0 B";let t=["B","KB","MB","GB"],e=Math.floor(Math.log(n)/Math.log(1024));if(e===0)return`${n} ${t[e]}`;return`${(n/Math.pow(1024,e)).toFixed(2)} ${t[e]}`}function O(n,t=3){return n.split("/").slice(-t).join("/")}function Y(n,t){let e=An.join(n,t);if(I.existsSync(e))try{I.rmSync(e,{recursive:!0,force:!0})}catch(r){throw new x(`Failed to clean output directory: ${r}`)}I.mkdirSync(e,{recursive:!0})}function F(n){return n||C.outDir}function an(n){return n===void 0?C.clean:n}function cn(n){return n.map((t)=>typeof t==="string"?new RegExp(`^${P(t)}($|\\/|\\\\)`):t)}function A(n,t){return cn(n.external||[]).concat(sn(t).map((e)=>new RegExp(`^${P(e)}($|\\/|\\\\)`)))}function M(n){return cn(n.noExternal||[])}import k from"node:fs";import K from"node:path";async function ln(n){let t=[".ts",".js",".mjs",".cjs",".mts",".cts",".json",".jsonc"];for(let e of t){let r=K.join(n,`bunup.config${e}`);try{if(!k.existsSync(r))continue;let s=await Mn(r,e);if(!s)continue;return{configs:Un(s,n),configFilePath:r}}catch(s){throw new x(`Failed to load config from ${r}: ${p(s)}`)}}return{configs:[],configFilePath:""}}async function Mn(n,t){if(t===".json"||t===".jsonc")return kn(n);return Ln(n)}function kn(n){try{let t=k.readFileSync(n,"utf8"),e=JSON.parse(t);return e.bunup||e}catch(t){throw new Error(`Invalid JSON in config file. ${p(t)}`)}}async function Ln(n){try{let t=await import(`file://${n}`),e=t.default||t;if(!e)return l.warn(`No export found in ${n}. Make sure you're exporting your configuration.`),{};return e}catch(t){throw new Error(`Failed to import config file. ${p(t)}`)}}function Un(n,t){let e=[];if(Hn(n))Dn(n,t,e);else if(Array.isArray(n))Wn(n,t,e);else if(n&&typeof n==="object")e.push({options:n,rootDir:t});else throw new Error("Invalid configuration format. Expected an object, array, or workspace configuration.");return e}function Hn(n){return Array.isArray(n)&&n.length>0&&n.every((t)=>typeof t==="object"&&t!==null&&("name"in t)&&("root"in t)&&("config"in t))}function Dn(n,t,e){for(let r of n){let s=K.resolve(t,r.root);if(Array.isArray(r.config))for(let i of r.config)e.push({options:{name:r.name,...i},rootDir:s});else e.push({options:{name:r.name,...r.config},rootDir:s})}}function Wn(n,t,e){for(let r of n){if(!r||typeof r!=="object")throw new Error("Invalid configuration item. Expected an object.");e.push({options:r,rootDir:t})}}function L(n){let t=K.join(n,"package.json");try{if(!k.existsSync(t))return null;let e=k.readFileSync(t,"utf8");return JSON.parse(e)}catch(e){return l.warn(`Failed to load package.json at ${t}: ${p(e)}`),null}}import E from"path";var y="\x00virtual:",fn=(n)=>{return{name:"bunup:virtual-dts",resolveId(t,e){if(t.startsWith(y))return t;if(!e?.startsWith(y)||!t.startsWith("."))return null;let r=e.slice(y.length),s=E.resolve(E.dirname(r),t);if(t==="."){let o=E.join(E.dirname(r),"index.d.ts");if(n.has(o))return`${y}${o}`;s=E.dirname(r)}if(n.has(s))return`${y}${s}`;let i=`${s}.d.ts`;if(n.has(i))return`${y}${i}`;if(t.startsWith(".")){let o=E.join(s,"index.d.ts");if(n.has(o))return`${y}${o}`}return null},load(t){if(t.startsWith(y)){let e=t.slice(y.length),r=n.get(e);if(r)return B.add(e),r}return null}}};async function un(n,t,e,r,s){let i=n.replace(/\.tsx?$/,".d.ts"),o=`${y}${i}`,a=s.data?.compilerOptions,c=L(r),u=A(e,c),m=M(e),f;try{f=await _n({input:o,onwarn(b,$){if(["UNRESOLVED_IMPORT","CIRCULAR_DEPENDENCY","EMPTY_BUNDLE"].includes(b.code??""))return;$(b)},plugins:[fn(t),Gn({tsconfig:s.path,compilerOptions:{...a?Q.parseJsonConfigFileContent({compilerOptions:a},Q.sys,"./").options:{},declaration:!0,noEmit:!1,emitDeclarationOnly:!0,noEmitOnError:!0,checkJs:!1,declarationMap:!1,skipLibCheck:!0,preserveSymlinks:!1,target:Q.ScriptTarget.ESNext}})],external:(b)=>u.some(($)=>$.test(b))&&!m.some(($)=>$.test(b))});let{output:g}=await f.generate({});if(!g[0]?.code)throw new d("Generated bundle is empty");return g[0].code}catch(g){throw new d(`DTS bundling failed: ${p(g)}`)}finally{if(f)await f.close()}}import pn from"node:fs";import S from"node:path";var qn=/(?:import|export)(?:[\s\n]*(?:type[\s\n]+)?(?:\*|\{[^}]*\}|[\w$]+)[\s\n]+from[\s\n]*|[\s\n]+)(["'`])([^'"]+)\1/g,In=/import\s*\(\s*(["'`])([^'"]+)\1\s*\)/g;async function mn(n,t){let e=new Set([n]),r=[n],s=Yn(t),i=gn(t);while(r.length){let o=r.pop();if(!o)continue;try{let a=await pn.promises.readFile(o,"utf8"),c=Pn(a);for(let u of c){let m=u.startsWith(".")?S.resolve(S.dirname(o),u):Fn(u,s,i);if(!m)continue;let f=Jn(m);if(f&&!e.has(f))e.add(f),r.push(f)}}catch(a){l.warn(`Error processing ${o}: ${p(a)}`)}}return e}function Pn(n){let t=new Set;for(let e of[qn,In]){let r;while((r=e.exec(n))!==null)t.add(r[2])}return Array.from(t)}function Jn(n){let t=["",".ts",".tsx","/index.ts","/index.tsx"];for(let e of t){let r=`${n}${e}`;if(pn.existsSync(r)&&(r.endsWith(".ts")||r.endsWith(".tsx")))return r}return null}function gn(n){let t=S.dirname(n.path||"");return n.data?.compilerOptions?.baseUrl?S.resolve(t,n.data.compilerOptions.baseUrl):t}function Yn(n){let t=new Map,e=n.data?.compilerOptions?.paths;if(!e)return t;let r=gn(n);for(let[s,i]of Object.entries(e))if(Array.isArray(i)&&i.length){let o=s.replace(/\*/g,"(.*)"),a=i[0].replace(/\*/g,"$1");t.set(`^${o}$`,S.join(r,a))}return t}function Fn(n,t,e){for(let[r,s]of t){let i=new RegExp(r),o=n.match(i);if(o)return s.replace("$1",o[1]||"")}return e?S.join(e,n):null}import Kn from"node:fs";import{isolatedDeclaration as Qn}from"oxc-transform";async function dn(n){let t=new Map;return await Promise.all([...n].map(async(e)=>{try{let r=e.replace(/\.tsx?$/,".d.ts"),s=await Kn.promises.readFile(e,"utf8"),{code:i}=Qn(e,s);if(i)t.set(r,i)}catch(r){l.warn(`Failed to generate declaration for ${e}: ${p(r)}`)}})),t}import z from"node:fs";import Z from"node:path";import{isolatedDeclaration as Zn}from"oxc-transform";function hn(n,t){let e=Z.resolve(n),r=Z.resolve(e,t);if(!z.existsSync(e))throw new d(`Root directory does not exist: ${e}`);if(!z.existsSync(r))throw new d(`Entry file does not exist: ${r}`);if(!r.endsWith(".ts"))throw new d(`Entry file must be a TypeScript file (.ts): ${r}`);if(Z.relative(e,r).startsWith(".."))throw new d(`Entry file must be within rootDir: ${r}`);return{absoluteRootDir:e,absoluteEntry:r}}async function yn(n){let t=!1;if(await Promise.all([...n].map(async(e)=>{try{let r=e.replace(/\.d\.ts$/,".ts"),s=await z.promises.readFile(r,"utf8"),{errors:i}=Zn(r,s);i.forEach((o)=>{if(!t)console.log(`
|
|
6
|
+
`);let a=o.labels[0],c=a?zn(s,a.start):"",m=`${O(r)}${c}: ${Xn(o.message)}`;l.warn(m),t=!0})}catch{}})),t)l.info(`
|
|
7
7
|
You may have noticed some TypeScript warnings above related to missing type annotations. This is because Bunup uses TypeScript's "isolatedDeclarations" approach for generating declaration files. This modern approach requires explicit type annotations on exports for better, more accurate type declarations. Other bundlers might not show these warnings because they use different, potentially less precise methods. Adding the suggested type annotations will not only silence these warnings but also improve the quality of your published type definitions, making your library more reliable for consumers.
|
|
8
8
|
`)}function zn(n,t){if(t===void 0)return"";let e=n.slice(0,t).split(`
|
|
9
|
-
`),r=e.length,s=e[e.length-1].length+1;return` (${r}:${s})`}function Xn(n){return n.replace(" with --isolatedDeclarations","").replace(" with --isolatedDeclaration","")}async function
|
|
9
|
+
`),r=e.length,s=e[e.length-1].length+1;return` (${r}:${s})`}function Xn(n){return n.replace(" with --isolatedDeclarations","").replace(" with --isolatedDeclaration","")}async function xn(n,t,e){let{absoluteRootDir:r,absoluteEntry:s}=hn(n,t),i=V(e.preferredTsconfigPath),o=await mn(s,i),a=await dn(o);return un(s,a,e,r,i)}function U(n){return n.split("/").pop()?.split(".").slice(0,-1).join(".")||""}function T(n){let t=[],e=new Set,r={};function s(i,o){if(e.has(i)){let a=tn(),c=`${i}_${a}`;l.warn(`Output name conflict: "${i}" is used by multiple files.
|
|
10
10
|
Bunup uses filenames without extensions as output names by default.
|
|
11
11
|
|
|
12
12
|
${r[i]} -> ${i}.js
|
|
@@ -20,8 +20,8 @@ To fix this, use named entries in your configuration:
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
See: https://bunup.arshadyaseen.com/#using-a-configuration-file-with-named-entries`,{muted:!0,verticalSpace:!0}),t.push({name:c,path:o})}else t.push({name:i,path:o}),e.add(i),r[i]=o}if(Array.isArray(n))for(let i of n){let o=
|
|
23
|
+
See: https://bunup.arshadyaseen.com/#using-a-configuration-file-with-named-entries`,{muted:!0,verticalSpace:!0}),t.push({name:c,path:o})}else t.push({name:i,path:o}),e.add(i),r[i]=o}if(Array.isArray(n))for(let i of n){let o=U(i);s(o,i)}else Object.entries(n).forEach(([i,o])=>{s(i,o)});return t}function wn(n,t){return`[dir]/${n}${t}`}function bn(n,t){return{name:"bunup:external-plugin",setup(e){e.onResolve({filter:/.*/},(r)=>{let s=r.path;if(n.some((o)=>o.test(s))&&!t.some((o)=>o.test(s)))return{path:s,external:!0};return null})}}}var B=new Set;async function H(n,t){if(!n.entry||n.entry.length===0||!n.outDir)throw new x("Nothing to build. Please make sure you have provided a proper bunup configuration or cli arguments.");let e=L(t),r=e?.type,s=A(n,e),i=M(n),o=[bn(s,i)],a=T(n.entry),c=nn(n,t),u=n.format.flatMap((m)=>a.map((f)=>{return Vn(n,t,f,m,r,o,c)}));try{await Promise.all(u)}catch(m){throw console.error(m),new x("Build process encountered errors")}if(n.dts){let m=n.format.filter((g)=>{if(g==="iife"&&!j(r)&&n.format.includes("cjs"))return!1;return!0}),f=n.dts===!0?a:T(n.dts.entry);try{await Promise.all(f.map(async(g)=>{let b=await xn(t,g.path,n);await Promise.all(m.map(async($)=>{let Sn=rn($,r),q=`${t}/${n.outDir}/${g.name}${Sn}`;await Bun.write(q,b);let Rn=Bun.file(q).size||0;l.progress("DTS",O(q),J(Rn),n.name)}))}))}catch(g){throw new d(`DTS build process encountered errors: ${p(g)}`)}}}async function Vn(n,t,e,r,s,i,o){let a=en(r,s),c=await Bun.build({...o,entrypoints:[`${t}/${e.path}`],format:r,naming:{entry:wn(e.name,a)},splitting:on(n.splitting,r),plugins:i,throw:!1});if(!c.success)throw c.logs.forEach((f)=>{if(f.level==="error")l.error(f.message);else if(f.level==="warning")l.warn(f.message);else if(f.level==="info")l.info(f.message)}),new x(`Build failed for ${e.path} (${r})`);let u=`${t}/${n.outDir}/${e.name}${a}`,m=Bun.file(u).size||0;l.progress(r.toUpperCase(),O(u),J(m),n.name)}var D="0.3.4";var $n="https://bun.sh/docs/installation",On="https://bunup.arshadyaseen.com/#cli-options";function w(n){return(t,e)=>{e[n]=t===!0?!0:t==="true"}}function W(n){return(t,e)=>{if(typeof t==="string")e[n]=t;else throw new h(`Option --${n} requires a string value`)}}function vn(n){return(t,e)=>{if(typeof t==="string")e[n]=t.split(",");else throw new h(`Option --${n} requires a string value`)}}function tt(){console.log(`
|
|
24
24
|
Bunup - An extremely fast, zero-config bundler for JavaScript and TypeScript, powered by Bun.
|
|
25
25
|
`),console.log("For more information on available options, visit:"),console.log(`\x1B[36m\x1B[4m${On}\x1B[0m
|
|
26
|
-
`),process.exit(0)}function et(){console.log(
|
|
27
|
-
To install Bun, visit `+$n)})();import
|
|
26
|
+
`),process.exit(0)}function et(){console.log(D),process.exit(0)}var rt={name:{flags:["n","name"],handler:W("name")},format:{flags:["f","format"],handler:(n,t)=>{if(typeof n==="string")t.format=n.split(",");else throw new h("Option --format requires a string value")}},outDir:{flags:["o","out-dir"],handler:W("outDir")},minify:{flags:["m","minify"],handler:w("minify")},watch:{flags:["w","watch"],handler:w("watch")},dts:{flags:["d","dts"],handler:w("dts")},external:{flags:["e","external"],handler:vn("external")},sourcemap:{flags:["sm","sourcemap"],handler:W("sourcemap")},target:{flags:["t","target"],handler:W("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:vn("noExternal")}},st={help:{flags:["h","help"],handler:()=>tt()},version:{flags:["v","version"],handler:()=>et()}},_={};for(let n of Object.values(rt))if(n)for(let t of n.flags)_[t]=n.handler;for(let n of Object.values(st))for(let t of n.flags)_[t]=n.handler;function Cn(n){let t={},e={},r=0;while(r<n.length){let s=n[r];if(s.startsWith("--")){let i,o;if(s.includes("=")){let[a,c]=s.slice(2).split("=",2);i=a,o=c}else{i=s.slice(2);let a=n[r+1];if(o=a&&!a.startsWith("-")?a:!0,typeof o==="string")r++}if(i==="entry")if(typeof o==="string"){let a=U(o);if(e[a])l.warn(`Duplicate entry name '${a}' derived from '${o}'. Overwriting previous entry.`);e[a]=o}else throw new h("Option --entry requires a string value");else if(i.startsWith("entry.")){let a=i.slice(6);if(typeof o==="string"){if(e[a])l.warn(`Duplicate entry name '${a}' provided via --entry.${a}. Overwriting previous entry.`);e[a]=o}else throw new h(`Option --entry.${a} requires a string value`)}else{let a=_[i];if(a)a(o,t);else throw new h(`Unknown option: --${i}`)}}else if(s.startsWith("-")){let i=s.slice(1),o=n[r+1],a=o&&!o.startsWith("-")?o:!0;if(typeof a==="string")r++;let c=_[i];if(c)c(a,t);else throw new h(`Unknown option: -${i}`)}else{let i=U(s);if(e[i])l.warn(`Duplicate entry name '${i}' derived from positional argument '${s}'. Overwriting previous entry.`);e[i]=s}r++}if(Object.keys(e).length>0)t.entry=e;return t}(()=>{if(typeof Bun==="undefined")throw new h(`Bunup requires Bun to run.
|
|
27
|
+
To install Bun, visit `+$n)})();import G from"node:path";import it from"chokidar";async function En(n,t){let e=new Set,r=T(n.entry);r.forEach((a)=>{let c=G.resolve(t,a.path),u=G.dirname(c);e.add(u)});let s=it.watch(Array.from(e),{persistent:!0,awaitWriteFinish:{stabilityThreshold:100,pollInterval:50},ignoreInitial:!0,atomic:!0,ignorePermissionErrors:!0,ignored:[/[\\/]\.git[\\/]/,/[\\/]node_modules[\\/]/,G.join(t,n.outDir)]}),i=!1,o=async(a=!1)=>{if(i)return;i=!0;try{let c=performance.now();if(await H({...n,entry:r.map((u)=>u.path),clean:!1},t),n.onBuildSuccess?.(),!a)l.cli(`\uD83D\uDCE6 Rebuild finished in ${N(performance.now()-c)}`)}catch(c){throw new R(`Build failed: ${p(c)}`)}finally{i=!1}};s.on("change",(a)=>{let c=G.relative(t,a);l.cli(`File changed: ${c}`),o()}),s.on("error",(a)=>{throw new R(`Watcher error: ${p(a)}`)}),await o(!0)}async function ot(n=Bun.argv.slice(2)){let t=Cn(n),{configs:e,configFilePath:r}=await ln(process.cwd());if(l.cli(`Using bunup v${D} and bun v${Bun.version}`,{muted:!0}),r)l.cli(`Using config file: ${O(r,2)}`,{muted:!0});let s=performance.now();if(l.cli("Build started"),e.length===0){let a={...C,...t},c=process.cwd();if(a.clean)Y(c,F(a.outDir));await Bn(a,c)}else{for(let{options:a,rootDir:c}of e)if(an(a.clean))Y(c,F(a.outDir));await Promise.all(e.map(async({options:a,rootDir:c})=>{let u={...C,...a,...t};await Bn(u,c)}))}let i=performance.now()-s,o=N(i);if(l.cli(`\u26A1\uFE0F Build completed in ${o}`),B.size>0)await yn(B),B.clear();if(t.watch)l.cli("\uD83D\uDC40 Watching for file changes");if(!t.watch)process.exit(0)}async function Bn(n,t){if(n.watch)await En(n,t);else await H(n,t),n.onBuildSuccess?.()}ot().catch((n)=>X(n));export{ot as main};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bunup",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "An 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,12 +18,12 @@
|
|
|
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.3.
|
|
22
|
-
"eslint": "^8.57.
|
|
23
|
-
"husky": "^9.1.
|
|
24
|
-
"prettier": "^3.
|
|
25
|
-
"typescript": "^5.
|
|
26
|
-
"vitest": "^2.
|
|
21
|
+
"bunup": "^0.3.3",
|
|
22
|
+
"eslint": "^8.57.1",
|
|
23
|
+
"husky": "^9.1.7",
|
|
24
|
+
"prettier": "^3.5.3",
|
|
25
|
+
"typescript": "^5.8.2",
|
|
26
|
+
"vitest": "^2.1.9"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"typescript": ">=4.5.0"
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"format": "prettier --write .",
|
|
73
73
|
"release": "bumpp",
|
|
74
74
|
"publish:ci": "pnpm publish --access public --no-git-checks",
|
|
75
|
-
"benchmark": "pnpm -C benchmarks benchmark"
|
|
75
|
+
"benchmark": "pnpm -C benchmarks benchmark",
|
|
76
|
+
"fresh-deps": "pnpx taze -r -w"
|
|
76
77
|
}
|
|
77
78
|
}
|