@stacksjs/stx 0.2.284 → 0.2.286
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/{chunk-x11dh3a3.js → chunk-2q630fj4.js} +1 -1
- package/dist/{chunk-0h7ty10c.js → chunk-3ehv1by2.js} +1 -1
- package/dist/{chunk-qccdz9t1.js → chunk-4cqgbcy7.js} +170 -170
- package/dist/{chunk-a95mf15m.js → chunk-56ywtaff.js} +1 -1
- package/dist/{chunk-ef5663vk.js → chunk-61sj52qh.js} +1 -1
- package/dist/{chunk-pmw28376.js → chunk-6cye5m9f.js} +1 -1
- package/dist/{chunk-mx8k7bwh.js → chunk-7ej1d910.js} +1 -1
- package/dist/{chunk-r5fp0bse.js → chunk-829pcte9.js} +1 -1
- package/dist/{chunk-crmgatrx.js → chunk-8emkx9ja.js} +1 -1
- package/dist/{chunk-5k3qb1am.js → chunk-9th1wd1d.js} +3 -3
- package/dist/{chunk-50mpsfpx.js → chunk-ah4e6e09.js} +1 -1
- package/dist/{chunk-1rcn9yfj.js → chunk-ajbfeey7.js} +1 -1
- package/dist/{chunk-7etzqabz.js → chunk-an2539bs.js} +1 -1
- package/dist/{chunk-s5ttqj6h.js → chunk-b7tjq91c.js} +1 -1
- package/dist/{chunk-vckr41zn.js → chunk-e2w23g2r.js} +8 -8
- package/dist/{chunk-7n45tcyf.js → chunk-e4akvata.js} +1 -1
- package/dist/{chunk-mrbw9vts.js → chunk-f4k2a7vs.js} +1 -1
- package/dist/{chunk-gn9q45yp.js → chunk-hs0387tm.js} +1 -1
- package/dist/{chunk-cvhyxt55.js → chunk-j9g11dzx.js} +1 -1
- package/dist/{chunk-se360fvh.js → chunk-jbfpc4z7.js} +1 -1
- package/dist/{chunk-zkzmxy32.js → chunk-jg0axas8.js} +1 -1
- package/dist/{chunk-sb7k89hq.js → chunk-jrk8rhwt.js} +1 -1
- package/dist/{chunk-ffqddern.js → chunk-kawk5ve9.js} +1 -1
- package/dist/{chunk-f16kkw9v.js → chunk-kmhr1z0m.js} +1 -1
- package/dist/chunk-m3yaa0v5.js +15 -0
- package/dist/{chunk-fxyrvwqw.js → chunk-m7xnzt2t.js} +1 -1
- package/dist/{chunk-sw16pkqg.js → chunk-mkn6qqc7.js} +1 -1
- package/dist/{chunk-822x6vhb.js → chunk-n3jyv9z6.js} +1 -1
- package/dist/{chunk-k4qx7jbk.js → chunk-nh21517m.js} +1 -1
- package/dist/{chunk-1a8e5xpf.js → chunk-qbeffw17.js} +1 -1
- package/dist/{chunk-w4eykv3z.js → chunk-qk8tbcwk.js} +1 -1
- package/dist/{chunk-x0zv8dt4.js → chunk-qsr3bqav.js} +1 -1
- package/dist/{chunk-abydddye.js → chunk-rhs51nmz.js} +2 -2
- package/dist/{chunk-e9nmf863.js → chunk-s7pc68jf.js} +1 -1
- package/dist/{chunk-3828z7q8.js → chunk-vb10qph4.js} +1 -1
- package/dist/{chunk-vhsrgtcg.js → chunk-vy8v5xdb.js} +1 -1
- package/dist/{chunk-jt4gqtag.js → chunk-w0sqz3cb.js} +1 -1
- package/dist/{chunk-5v6atbsr.js → chunk-w8smn72c.js} +1 -1
- package/dist/{chunk-s5y267vs.js → chunk-wxk2pbrh.js} +1 -1
- package/dist/{chunk-gp3s8020.js → chunk-x1nw1p8z.js} +1 -1
- package/dist/{chunk-9x4jejq0.js → chunk-xg57nax9.js} +1 -1
- package/dist/{chunk-gzxbnyde.js → chunk-xz55q3gr.js} +1 -1
- package/dist/{chunk-9236skjs.js → chunk-y8n174xq.js} +2 -2
- package/dist/cli.js +7 -7
- package/dist/client-script-bundler.js +35 -27
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/dev-server/ts-css.js +4 -2
- package/dist/import-rebase.d.ts +16 -0
- package/dist/import-rebase.js +16 -0
- package/dist/process.js +5 -2
- package/dist/pwa.js +1 -1
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-4ds1cmgq.js +0 -15
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.286",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -117,12 +117,12 @@
|
|
|
117
117
|
"dependencies": {
|
|
118
118
|
"@stacksjs/ts-css": "^0.3.2",
|
|
119
119
|
"@stacksjs/clapp": "^0.2.14",
|
|
120
|
-
"@stacksjs/desktop": "0.2.
|
|
121
|
-
"@stacksjs/sanitizer": "0.2.
|
|
120
|
+
"@stacksjs/desktop": "0.2.286",
|
|
121
|
+
"@stacksjs/sanitizer": "0.2.286",
|
|
122
122
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
123
|
-
"bun-plugin-stx": "0.2.
|
|
123
|
+
"bun-plugin-stx": "0.2.286",
|
|
124
124
|
"bunfig": "^0.15.17",
|
|
125
|
-
"stx-router": "0.2.
|
|
125
|
+
"stx-router": "0.2.286",
|
|
126
126
|
"ts-broadcasting": "^0.0.9",
|
|
127
127
|
"ts-images": "^0.2.17",
|
|
128
128
|
"ts-syntax-highlighter": "^0.2.1"
|
package/dist/chunk-4ds1cmgq.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Rl as d,dr as t}from"./chunk-qccdz9t1.js";import{_s as l,ct as P}from"./chunk-5k3qb1am.js";import{wt as g}from"./chunk-39f40yc4.js";import Y from"path";import O from"fs";function Gz(z){if(!z||typeof z!=="object")return!1;let G=z;return typeof G.message==="string"&&(G.name==="BuildMessage"||G.name==="ResolveMessage"||("position"in G))}function Jz(z){if(z&&typeof z==="object"&&Array.isArray(z.errors))return z.errors;return[z]}function B(z,G){let J=[];for(let $ of Jz(z)){if(Gz($)){let Q=$.position||void 0;J.push({file:G||Q?.file,line:Q?.line,column:Q?.column,message:$.message??"",lineText:Q?.lineText});continue}J.push({file:G,message:$ instanceof Error?$.message:String($)})}return J}function p(z,G){return B(z,G).map((J)=>{let $=J.file?`${J.file}${J.line?`:${J.line}${J.column?`:${J.column}`:""}`:""}`:"",Q=J.lineText?`
|
|
3
|
-
${J.lineText.trim()}`:"";return $?`${$}: ${J.message}${Q}`:`${J.message}${Q}`}).join(`
|
|
4
|
-
`)}var Kz=5,r=1,s=new Map,E=600,Zz=100,v=new Map;async function $z(z){let G=v.get(z)??0;if(G>0&&G<Zz){v.set(z,G+1);return}v.set(z,1);try{let J=(await O.promises.readdir(z)).filter((W)=>W.endsWith(".js"));if(J.length<=E)return;let Q=(await Promise.all(J.map(async(W)=>{try{return{name:W,at:(await O.promises.stat(Y.join(z,W))).mtimeMs}}catch{return null}}))).filter((W)=>W!==null);Q.sort((W,K)=>K.at-W.at);for(let W of Q.slice(E)){let K=W.name.slice(0,-3);await O.promises.rm(Y.join(z,`${K}.js`),{force:!0}),await O.promises.rm(Y.join(z,`${K}.deps.json`),{force:!0})}M("pruned bundle cache to",E,"entries")}catch{}}function Lz(z){return s.get(z)??[]}function b(z,G){if(z)s.set(z,G)}function Wz(z=process.env){return z.STX_DEBUG==="true"||z.STX_DEBUG==="1"}function M(...z){if(Wz())console.log("[stx:bundler]",...z)}var m=[];function h(z,G,J){m.push({filePath:z||"<inline>",message:G,details:J})}function Sz(){return m.slice()}function Cz(){m.length=0}var f;function Az(z){f=z}function c(){if(f)return f;try{let z=t.strict;return typeof z==="object"&&z!==null?z.bundlerFallback??"warn":"warn"}catch{return"warn"}}var o=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function Iz(z){let G=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,J;while((J=G.exec(z))!==null){let Q=J[1];if(!o.some((K)=>K.test(Q)))return M("detected user import:",Q),!0}let $=/^[ \t]*import[ \t]+['"]([^'"]+)['"]/gm;while((J=$.exec(z))!==null){let Q=J[1];if(/\.css(?:\?.*)?$/.test(Q))continue;if(!o.some((K)=>K.test(Q)))return M("detected side-effect import:",Q),!0}return!1}function Qz(z,G,J,$){let Q=(W,K)=>{let Z=W===J?G:Y.dirname(W),X=Y.resolve(Z,K),j=[X,`${X}.ts`,`${X}.tsx`,`${X}.js`,`${X}.mjs`,`${X}.jsx`,Y.join(X,"index.ts"),Y.join(X,"index.tsx"),Y.join(X,"index.js"),Y.join(X,"index.mjs")];for(let k of j)try{if(O.existsSync(k)&&O.statSync(k,{throwIfNoEntry:!1})?.isFile())return k}catch{}return X};return{name:"stx-client-bundle",setup(W){W.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(K)=>({path:K.path,external:!0})),W.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(K)=>({path:K.path,external:!0})),W.onResolve({filter:/^\//},(K)=>{if(O.existsSync(K.path))return{path:K.path};return{path:K.path,external:!0}}),W.onResolve({filter:/^\.\.?\//},(K)=>{let Z=Q(K.importer,K.path);return $.add(Z),{path:Z}}),W.onResolve({filter:/^[@~]\//},(K)=>{let Z=Y.resolve(z,K.path.slice(2)),X=[Z,`${Z}.ts`,`${Z}.tsx`,`${Z}.js`,`${Z}.mjs`,`${Z}.jsx`,Y.join(Z,"index.ts"),Y.join(Z,"index.tsx"),Y.join(Z,"index.js"),Y.join(Z,"index.mjs")];for(let j of X)if(O.existsSync(j)&&O.statSync(j,{throwIfNoEntry:!1})?.isFile())return M(`resolved ${K.path[0]}/ import:`,K.path,"\u2192",j),$.add(j),{path:j};return console.warn(`[stx:bundler] could not resolve ${K.path[0]}/ import:`,K.path),{path:Z}}),W.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(K)=>{let Z=Y.extname(K.path).toLowerCase(),X=Z===".json"?"json":Z===".tsx"?"tsx":Z===".jsx"?"jsx":Z===".ts"||Z===".mts"||Z===".cts"?"ts":"js";if(K.path!==J)$.add(K.path);return{contents:O.readFileSync(K.path,"utf8"),loader:X}})}}}var D=new Map,_=l(64),n=Symbol.for("stx.client-bundle-build-queue");function Xz(z){let G=globalThis,$=(G[n]??Promise.resolve()).then(z,z);return G[n]=$.then(()=>{return},()=>{return}),$}async function yz(z,G,J={}){let $=J.projectRoot||process.cwd(),Q=J.minify??!1,W=J.cacheDir||g($,"bundle-cache"),K=new Bun.CryptoHasher("md5");K.update(`${Kz}\x00${z}\x00${G}`);let Z=K.digest("hex").slice(0,12),X=Y.join(W,`${Z}.js`),j=_.get(X);if(j){if(P(j.files)){M("memo hit:",Z);let S=j.files.map((U)=>U.path);return b(G,S),J.collectInputs?.push(...S),j.code}_.delete(X),M("memo invalidated by dep change:",Z)}let k=Y.join(W,`${Z}.deps.json`),T=Bun.file(X);if(await T.exists()){let S=Bun.file(k),U=!0,H=null;if(await S.exists())try{let A=JSON.parse(await S.text());if(A.metadataVersion!==r||!Array.isArray(A.files))U=!1;else H=A.files;if(H&&!P(H))U=!1}catch{U=!1}if(U){if(M("cache hit:",Z),H)b(G,H.map((R)=>R.path)),J.collectInputs?.push(...H.map((R)=>R.path));let A=await T.text();if(H)_.set(X,{code:A,files:H});return A}M("cache invalidated by dep change:",Z)}let F=D.get(Z);if(F){let S=await F;if(J.collectInputs)J.collectInputs.push(...(_.get(X)?.files??[]).map((U)=>U.path));return S}let L=Xz(()=>Yz(z,G,{projectRoot:$,minify:Q,cacheDir:W,hash:Z,cachePath:X,depsPath:k,collectInputs:J.collectInputs}));D.set(Z,L);try{return await L}finally{D.delete(Z)}}async function Yz(z,G,J){let{projectRoot:$,minify:Q,cacheDir:W,hash:K,cachePath:Z,depsPath:X}=J,j=g($,"bundle-tmp"),k=Y.join(j,`${K}.ts`),T=Y.join(j,"out",K);O.mkdirSync(j,{recursive:!0}),O.mkdirSync(T,{recursive:!0});let F=Y.dirname(G),L=[],S=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,U=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,H;while((H=S.exec(z))!==null){if(H[1])continue;if(H[2])H[2].split(",").forEach((w)=>{let V=qz(w);if(V)L.push(V)});else if(H[3])L.push(H[3])}while((H=U.exec(z))!==null){if(H[1])continue;L.push(H[2])}let A=L.length>0?`
|
|
5
|
-
export { ${L.join(", ")} }`:"";await Bun.write(k,z+A),M("bundling:",K,"from:",Y.basename(G));let R=new Set;try{let w=await Bun.build({entrypoints:[k],outdir:T,target:"browser",format:"esm",minify:Q,plugins:[Qz($,F,k,R)],define:{"process.env.NODE_ENV":Q?'"production"':'"development"',...d()},root:$});if(!w.success){let I=w.logs.filter((y)=>y.level==="error").map((y)=>y.message).join(", ")||`Unable to bundle ${Y.basename(G)}`,x=B(w.logs,G||void 0);if(console.warn("[stx:bundler] build failed:",I),h(G||"",I,x),c()==="error")throw Error(I);return z}let V="";for(let q of w.outputs){V=await q.text();break}let C=[];for(let q of V.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let I of q[1].split(",")){let x=I.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(x){C.push([x[2],x[1]]);continue}let y=I.trim();if(/^[A-Za-z_$][\w$]*$/.test(y))C.push([y,y])}let i=V.match(/^\s*import\s+[^;]+;?\s*$/gm)||[];V=V.replace(/^\s*import\s+[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim();let u=`__stxBundle_${K}`,a=C.map(([q,I])=>`${JSON.stringify(q)}: ${I}`).join(", "),e=C.map(([q])=>`var ${q} = undefined;`).join(`
|
|
6
|
-
`),zz=C.map(([q])=>`${q} = ${u}[${JSON.stringify(q)}];`).join(`
|
|
7
|
-
`);if(V=`${i.join(`
|
|
8
|
-
`)}
|
|
9
|
-
${e}
|
|
10
|
-
var ${u} = (function() {
|
|
11
|
-
${V}
|
|
12
|
-
return { ${a} };
|
|
13
|
-
})();
|
|
14
|
-
${zz}`.trim(),M("bundled:",K,"output:",V.length,"bytes"),L.length>0&&C.length===0)return console.warn(`[stx:bundler] dropped every binding for ${Y.basename(G)} (${K}); serving the unbundled source and not caching this result`),z;O.mkdirSync(W,{recursive:!0}),await Bun.write(Z,V);let N=Array.from(R).map((q)=>{try{return{path:q,mtimeMs:O.statSync(q).mtimeMs}}catch{return null}}).filter((q)=>q!==null);return await Bun.write(X,JSON.stringify({metadataVersion:r,files:N})),b(G,N.map((q)=>q.path)),J.collectInputs?.push(...N.map((q)=>q.path)),_.set(Z,{code:V,files:N}),await $z(W),V}catch(w){let V=B(w,G||void 0),C=p(w,G||void 0);if(console.warn(`[stx:bundler] error: ${C}`),h(G||"",C,V),c()==="error")throw w;return z}finally{try{O.rmSync(k,{force:!0}),O.rmSync(T,{recursive:!0,force:!0})}catch{}}}function qz(z){let G=z.trim();if(!G)return null;let J=G.indexOf("=");if(J!==-1)G=G.slice(0,J).trim();let $=G.indexOf(":");if($!==-1)G=G.slice($+1).trim();if(G.startsWith("..."))G=G.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(G)?G:null}
|
|
15
|
-
export{p as _k,Lz as $k,Wz as al,h as bl,Sz as cl,Cz as dl,Az as el,c as fl,Iz as gl,Xz as hl,yz as il};
|