wdwh 1.7.2 → 1.7.3

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/main.js CHANGED
@@ -17,7 +17,7 @@ const server = Bun.serve({
17
17
  console.log(\`> Server running at \${server.url}\`)
18
18
  `};switch(process.argv.at(2)){case"dev":await C();break;case"build":await B();break;default:console.log(`wrong command: "${process.argv.at(2)}"
19
19
  try "dev" | "build"`),process.exit()}async function C(){await _();let z="bun node_modules/.cache/wdwh/server.ts",G=Bun.file("./bunfig.toml");if(await G.exists()){let Q=await G.text();if(!Q.includes("bun-plugin-tailwind"))Q+=`${Q===""?"":`
20
- `}${R}`,G.write(Q),z="wdwh dev"}else{G.write(R);async function Q(){let U=Bun.file("bunfig.toml");try{if(await U.exists())await U.delete()}catch{}}process.on("SIGINT",Q),setTimeout(Q,250),z="wdwh dev"}let[K,...N]=z.split(" ");M.spawnSync(K,N,{stdio:"inherit"})}async function B(){let{config:z}=await J();await _();let G={entrypoints:[`${$}/index.html`],outdir:z.outdir,plugins:[A],minify:!0,target:"browser",sourcemap:"none",define:{"process.env.NODE_ENV":'"production"'},external:z.external,naming:z.hashFiles?{chunk:"[name].[ext]",asset:"[name].[ext]"}:void 0};console.log("Building..."),k(z.outdir,{recursive:!0,force:!0});let K=performance.now(),N=await Bun.build(G),Q=Bun.file(`${z.outdir}/index.html`),U=I(await Q.text());if(z.bundleCss){let W=N.outputs.find((Y)=>Y.path.endsWith(".css"));if(W?.path){let Y=Bun.file(W.path),L=U.indexOf('<link rel="stylesheet"'),Z=L;for(;Z<U.length;Z++)if(["/>",'">'].includes(U.slice(Z,Z+2))){Z+=2;break}let O=U.slice(L,Z),j=`<style>${I(await Y.text())}</style>`;U=U.replace(O,j),Y.delete(),N.outputs.splice(N.outputs.indexOf(W),1)}}Q.write(U);let D=(performance.now()-K).toFixed(2),V=N.outputs.reduce((W,Y)=>W+` ${v(process.cwd(),Y.path)}
20
+ `}${R}`,G.write(Q),z="wdwh dev"}else{G.write(R);async function Q(){let U=Bun.file("bunfig.toml");try{if(await U.exists())await U.delete()}catch{}}process.on("SIGINT",Q),setTimeout(Q,250),z="wdwh dev"}let[K,...N]=z.split(" ");M.spawnSync(K,N,{stdio:"inherit"})}async function B(){let{config:z}=await J();await _();let G={entrypoints:[`${$}/index.html`],outdir:z.outdir,plugins:[A],minify:!0,target:"browser",sourcemap:"none",define:{"process.env.NODE_ENV":'"production"'},external:z.external,naming:!z.hashFiles?{chunk:"[name].[ext]",asset:"[name].[ext]"}:void 0};console.log("Building..."),k(z.outdir,{recursive:!0,force:!0});let K=performance.now(),N=await Bun.build(G),Q=Bun.file(`${z.outdir}/index.html`),U=I(await Q.text());if(z.bundleCss){let W=N.outputs.find((Y)=>Y.path.endsWith(".css"));if(W?.path){let Y=Bun.file(W.path),L=U.indexOf('<link rel="stylesheet"'),Z=L;for(;Z<U.length;Z++)if(["/>",'">'].includes(U.slice(Z,Z+2))){Z+=2;break}let O=U.slice(L,Z),j=`<style>${I(await Y.text())}</style>`;U=U.replace(O,j),Y.delete(),N.outputs.splice(N.outputs.indexOf(W),1)}}Q.write(U);let D=(performance.now()-K).toFixed(2),V=N.outputs.reduce((W,Y)=>W+` ${v(process.cwd(),Y.path)}
21
21
  `,"");console.log(`
22
22
  Output:
23
23
  ${V}
package/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  type WdwhConfig = {
2
2
  outdir: string
3
3
  bundleCss: boolean
4
- external: string[]
5
4
  hashFiles: boolean
5
+ external: string[]
6
6
  }
7
7
 
8
8
  type Metadata = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wdwh",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "author": "kubashh",
5
5
  "description": "The Bun framework. Easyer web dev without html",
6
6
  "license": "MIT",