@stacksjs/bun-router 0.0.27 → 0.1.0

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.
Files changed (102) hide show
  1. package/dist/chunk-0gjq8ttx.js +14 -0
  2. package/dist/chunk-0t5vz87j.js +35 -0
  3. package/dist/chunk-30rkn2ym.js +2 -0
  4. package/dist/chunk-38cmrard.js +2 -0
  5. package/dist/chunk-3qna6dwd.js +2 -0
  6. package/dist/chunk-4d5fmta0.js +2 -0
  7. package/dist/chunk-4x3b4b4q.js +2 -0
  8. package/dist/chunk-5be9x5cq.js +3 -0
  9. package/dist/chunk-5mxby3fd.js +1654 -0
  10. package/dist/chunk-5n0ckcmc.js +3 -0
  11. package/dist/chunk-5ncn73tp.js +3 -0
  12. package/dist/chunk-5s0pnsd6.js +12 -0
  13. package/dist/chunk-5s1pr62n.js +3 -0
  14. package/dist/chunk-67wgad4f.js +60 -0
  15. package/dist/chunk-6bbmkwng.js +3 -0
  16. package/dist/chunk-6s1kbajm.js +7851 -0
  17. package/dist/chunk-6sjvhy5f.js +3 -0
  18. package/dist/chunk-6xed4va1.js +2 -0
  19. package/dist/chunk-73k79n7q.js +15413 -0
  20. package/dist/chunk-748n6ydj.js +2 -0
  21. package/dist/chunk-7qnxdedn.js +321 -0
  22. package/dist/chunk-7rsf8tes.js +898 -0
  23. package/dist/chunk-8aspmtf1.js +2 -0
  24. package/dist/chunk-8wpj3fqe.js +351 -0
  25. package/dist/chunk-8yfdg595.js +2 -0
  26. package/dist/chunk-90eze7av.js +3 -0
  27. package/dist/chunk-9805tt8n.js +341 -0
  28. package/dist/chunk-9dvwyej7.js +2 -0
  29. package/dist/chunk-9ght4n4r.js +216 -0
  30. package/dist/chunk-a2w45krb.js +2 -0
  31. package/dist/chunk-a3wahyg7.js +3 -0
  32. package/dist/chunk-a547f2ab.js +48 -0
  33. package/dist/chunk-bqdycvtc.js +2 -0
  34. package/dist/chunk-brpgjyqg.js +3 -0
  35. package/dist/chunk-cd03rk3x.js +2 -0
  36. package/dist/chunk-csfrpsp7.js +185 -0
  37. package/dist/chunk-ct0m17q5.js +2 -0
  38. package/dist/chunk-dhbvvr5h.js +2 -0
  39. package/dist/chunk-dhptcsya.js +943 -0
  40. package/dist/chunk-dq93zag9.js +2 -0
  41. package/dist/chunk-dxg045wj.js +5 -0
  42. package/dist/chunk-e3qej0jr.js +4 -0
  43. package/dist/chunk-edrtesh7.js +2 -0
  44. package/dist/chunk-ejcws37w.js +2 -0
  45. package/dist/chunk-ex5fkjah.js +397 -0
  46. package/dist/chunk-ex890p45.js +51 -0
  47. package/dist/chunk-f69cpnhw.js +2 -0
  48. package/dist/chunk-fjf53b44.js +2 -0
  49. package/dist/chunk-fjzye4qj.js +2 -0
  50. package/dist/chunk-gfd23b6t.js +2 -0
  51. package/dist/chunk-habv0vef.js +12 -0
  52. package/dist/chunk-hmgedrmr.js +11 -0
  53. package/dist/chunk-hz6fc788.js +2 -0
  54. package/dist/chunk-jff6j9y3.js +10 -0
  55. package/dist/chunk-jmeb7n8k.js +70 -0
  56. package/dist/chunk-jrf5a2ap.js +2 -0
  57. package/dist/chunk-jy2jhcpy.js +246 -0
  58. package/dist/chunk-kc659vhx.js +4 -0
  59. package/dist/chunk-kjtjbcq4.js +71 -0
  60. package/dist/chunk-krkchy8v.js +4 -0
  61. package/dist/chunk-kxp888dn.js +4540 -0
  62. package/dist/chunk-m249t3je.js +3 -0
  63. package/dist/chunk-m9yabnjx.js +2 -0
  64. package/dist/chunk-mekrq9wd.js +2 -0
  65. package/dist/chunk-mmxv535f.js +82 -0
  66. package/dist/chunk-mypn7jss.js +2 -0
  67. package/dist/chunk-n18x1k3c.js +2 -0
  68. package/dist/chunk-nkddjzsa.js +2 -0
  69. package/dist/chunk-pjmhqmr9.js +2 -0
  70. package/dist/chunk-qyrnsaq1.js +2 -0
  71. package/dist/chunk-r19ff2qm.js +62 -0
  72. package/dist/chunk-r338fssq.js +2 -0
  73. package/dist/chunk-s36z58x2.js +29 -0
  74. package/dist/chunk-s3dn1kwx.js +231 -0
  75. package/dist/chunk-s79dd325.js +471 -0
  76. package/dist/chunk-sw0chtw4.js +4 -0
  77. package/dist/chunk-ta38j9em.js +2 -0
  78. package/dist/chunk-tpfgntwj.js +4211 -0
  79. package/dist/chunk-vr10sbbh.js +3 -0
  80. package/dist/chunk-vsh4390q.js +358 -0
  81. package/dist/chunk-vv3gb1m5.js +84 -0
  82. package/dist/chunk-vw8rwv6e.js +2 -0
  83. package/dist/chunk-w4r464v5.js +288 -0
  84. package/dist/chunk-wcrqs5z9.js +2 -0
  85. package/dist/chunk-x6d1rmwa.js +2 -0
  86. package/dist/chunk-x7ft15zz.js +2 -0
  87. package/dist/chunk-x8trwn7j.js +3 -0
  88. package/dist/chunk-xg9xscqz.js +1 -0
  89. package/dist/chunk-xhepdj1f.js +2 -0
  90. package/dist/chunk-xv2em0q4.js +4 -0
  91. package/dist/chunk-ypw6g0te.js +2 -0
  92. package/dist/chunk-z8szsm21.js +2 -0
  93. package/dist/chunk-zetqzgf3.js +194 -0
  94. package/dist/chunk-zfbh14qe.js +2 -0
  95. package/dist/chunk-zhx0hxdd.js +28 -0
  96. package/dist/cli.js +67 -3240
  97. package/dist/container/index.js +1 -321
  98. package/dist/index.js +80 -13987
  99. package/package.json +1 -1
  100. package/dist/chunk-1ahs68ys.js +0 -18
  101. package/dist/chunk-cgptvjdf.js +0 -18131
  102. package/dist/chunk-g3ybefhg.js +0 -1923
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ var f=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),w=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);function l(i){return i.replace(/[^\n]/g," ")}function $(i){let o=i.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,l).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,l).replace(/<!--[\s\S]*?-->/g,l).replace(/\{\{\{[\s\S]*?\}\}\}/g,l).replace(/\{\{[\s\S]*?\}\}/g,l).replace(/\{!![\s\S]*?!!\}/g,l),s=new Map,c=new Map,p=/<(\/?)([A-Za-z][\w-]*)\b(?:[^>"']|"[^"]*"|'[^']*')*?(\/?)>/g,n;while((n=p.exec(o))!==null){let e=n[1]==="/",t=n[2],a=n[3]==="/";if(f.has(t.toLowerCase()))continue;if(a)continue;if(e)c.set(t,(c.get(t)??0)+1);else{let d=s.get(t);if(d)d.count++;else{let u=o.slice(0,n.index).split(`
3
+ `).length;s.set(t,{count:1,firstLine:u})}}}let r=[];for(let e of new Set([...s.keys(),...c.keys()])){if(w.has(e.toLowerCase()))continue;let t=s.get(e)?.count??0,a=c.get(e)??0;if(t!==a)r.push({tag:e,opened:t,closed:a,firstOpenLine:s.get(e)?.firstLine??0})}return r}var g=new Set;function h(i,o){let s;try{s=$(i)}catch{return}if(s.length===0)return;let c=`${o}:${i.length}`;if(g.has(c))return;g.add(c);let p=o?o.split(/[/\\]/).pop()||o:"template";for(let{tag:n,opened:r,closed:e,firstOpenLine:t}of s)if(r>e){let a=t?` (first opened at line ${t})`:"";console.warn(`[stx] ${p}: <${n}> ${r} opened, ${e} closed \u2014 an unclosed <${n}>${a} may swallow the content that follows it.`)}else console.warn(`[stx] ${p}: <${n}> ${r} opened, ${e} closed \u2014 ${e-r} stray </${n}>.`)}
4
+ export{$ as Gp,h as Hp};
@@ -0,0 +1,71 @@
1
+ // @bun
2
+ var p=0;function f(){return`stx-teleport-${++p}`}function h(t){let e=t.split(",").map((r)=>r.trim()),i=e[0].replace(/['"]/g,""),n;for(let r=1;r<e.length;r++){let s=e[r].match(/disabled:\s*(.+)/);if(s)n=s[1].trim()}return{target:i,disabled:n}}function g(t,e){return`
3
+ <script>
4
+ (function() {
5
+ const source = document.getElementById('${t}');
6
+ if (!source) return;
7
+
8
+ // Get the content template up-front so we can hold a reference for the
9
+ // retry path. (template.content is moved out by cloneNode below.)
10
+ const template = source.querySelector('template');
11
+ if (!template) return;
12
+
13
+ function mount(targetEl) {
14
+ // Clone the template content and wrap it for tracking.
15
+ const content = template.content.cloneNode(true);
16
+ const wrapper = document.createElement('div');
17
+ wrapper.setAttribute('data-teleport-from', '${t}');
18
+ wrapper.appendChild(content);
19
+
20
+ targetEl.appendChild(wrapper);
21
+
22
+ // Remove the source placeholder
23
+ source.remove();
24
+
25
+ wrapper.dispatchEvent(new CustomEvent('teleport:mounted', {
26
+ bubbles: true,
27
+ detail: { sourceId: '${t}', target: '${e}' }
28
+ }));
29
+ }
30
+
31
+ // The teleport script runs inline at the position it's emitted. If the
32
+ // target is declared later in the same render pass (e.g. by a layout
33
+ // shell whose onMount creates the portal root), the first lookup
34
+ // misses. Pre-fix (stacksjs/stx#1728) the script bailed with a warning
35
+ // and never tried again. Now retry once via requestAnimationFrame so
36
+ // targets that land in the same paint cycle still work. A second
37
+ // miss is still a warning \u2014 we don't loop forever.
38
+ const firstEl = document.querySelector('${e}');
39
+ if (firstEl) { mount(firstEl); return; }
40
+
41
+ requestAnimationFrame(function() {
42
+ const retryEl = document.querySelector('${e}');
43
+ if (retryEl) { mount(retryEl); return; }
44
+ console.warn('[stx] Teleport target not found: ${e}');
45
+ });
46
+ })();
47
+ </script>
48
+ `}function y(t,e,i){p=0;let n=/@teleport\s*\(([^)]+)\)\s*([\s\S]*?)@endteleport/g;return t.replace(n,(r,s,d)=>{let a=f(),{target:u,disabled:o}=h(s),c=d.trim();if(o)try{let l=!1;if(o==="true")l=!0;else if(o==="false")l=!1;else if(o in e)l=Boolean(e[o]);if(l)return`<div class="stx-teleport-inline" data-teleport-disabled>${c}</div>`}catch{}let m=g(a,u);return`
49
+ <div id="${a}" class="stx-teleport-source" style="display: none;">
50
+ <template>${c}</template>
51
+ </div>
52
+ ${m}
53
+ `})}function w(){return`
54
+ <script>
55
+ (function() {
56
+ // Common teleport targets
57
+ const targets = ['#stx-modals', '#stx-tooltips', '#stx-notifications'];
58
+
59
+ targets.forEach(selector => {
60
+ const id = selector.slice(1); // Remove #
61
+ if (!document.getElementById(id)) {
62
+ const el = document.createElement('div');
63
+ el.id = id;
64
+ el.setAttribute('data-teleport-container', '');
65
+ document.body.appendChild(el);
66
+ }
67
+ });
68
+ })();
69
+ </script>
70
+ `}
71
+ export{y as xe,w as ye};
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ var p={},b=[],m={};function A(){return p}function _(){return m}function w(){p={},b.length=0,m={}}function h(t){p=c(p,t)}function c(t,e){return{title:e.title??t.title,titleTemplate:e.titleTemplate??t.titleTemplate,base:e.base??t.base,meta:[...t.meta||[],...e.meta||[]],link:[...t.link||[],...e.link||[]],script:[...t.script||[],...e.script||[]],style:[...t.style||[],...e.style||[]],htmlAttrs:{...t.htmlAttrs,...e.htmlAttrs},bodyAttrs:{...t.bodyAttrs,...e.bodyAttrs}}}function f(t){h($(t))}function $(t){let e=[];if(t.description)e.push({name:"description",content:t.description});if(t.keywords){let a=Array.isArray(t.keywords)?t.keywords.join(", "):t.keywords;e.push({name:"keywords",content:a})}if(t.author)e.push({name:"author",content:t.author});if(t.robots)e.push({name:"robots",content:t.robots});let r=t.ogTitle??t.title,i=t.ogDescription??t.description;if(r)e.push({property:"og:title",content:r});if(i)e.push({property:"og:description",content:i});if(t.ogImage)e.push({property:"og:image",content:t.ogImage});if(t.ogUrl)e.push({property:"og:url",content:t.ogUrl});if(t.ogType)e.push({property:"og:type",content:t.ogType});if(t.ogSiteName)e.push({property:"og:site_name",content:t.ogSiteName});if(t.ogLocale)e.push({property:"og:locale",content:t.ogLocale});let n=t.twitterTitle??t.title,s=t.twitterDescription??t.description,l=t.twitterImage??t.ogImage;if(t.twitterCard)e.push({name:"twitter:card",content:t.twitterCard});if(n)e.push({name:"twitter:title",content:n});if(s)e.push({name:"twitter:description",content:s});if(l)e.push({name:"twitter:image",content:l});if(t.twitterSite)e.push({name:"twitter:site",content:t.twitterSite});if(t.twitterCreator)e.push({name:"twitter:creator",content:t.twitterCreator});if(t.articleAuthor)e.push({property:"article:author",content:t.articleAuthor});if(t.articlePublishedTime)e.push({property:"article:published_time",content:t.articlePublishedTime});if(t.articleModifiedTime)e.push({property:"article:modified_time",content:t.articleModifiedTime});if(t.articleSection)e.push({property:"article:section",content:t.articleSection});if(t.articleTags)for(let a of t.articleTags)e.push({property:"article:tag",content:a});let o=[];if(t.canonical)o.push({rel:"canonical",href:t.canonical});return{title:t.title,titleTemplate:t.titleTemplate,meta:e,link:o}}function k(t){if(m={...m,...t},t.title||t.description)f({title:t.title,description:t.description})}function x(t){let e=typeof t==="function"?t():t;h({title:e})}function j(t=p){let e=[];if(t.title){let r=t.title;if(t.titleTemplate)r=typeof t.titleTemplate==="function"?t.titleTemplate(r):t.titleTemplate.replace("%s",r);e.push(`<title>${u(r)}</title>`)}if(t.base){let r=Object.entries(t.base).map(([i,n])=>`${i}="${u(n)}"`).join(" ");e.push(`<base ${r}>`)}for(let r of t.meta||[]){let i=Object.entries(r).filter(([n,s])=>s!==void 0).map(([n,s])=>{return`${n==="httpEquiv"?"http-equiv":n}="${u(String(s))}"`}).join(" ");e.push(`<meta ${i}>`)}for(let r of t.link||[]){let i=Object.entries(r).filter(([n,s])=>s!==void 0).map(([n,s])=>`${n}="${u(String(s))}"`).join(" ");e.push(`<link ${i}>`)}for(let r of t.script||[]){let{content:i,...n}=r,s=Object.entries(n).filter(([l,o])=>o!==void 0).map(([l,o])=>{if(typeof o==="boolean")return o?l:"";return`${l}="${u(String(o))}"`}).filter(Boolean).join(" ");if(i)e.push(`<script ${s}>${i}</script>`);else e.push(`<script ${s}></script>`)}for(let r of t.style||[]){let i=r.type?` type="${r.type}"`:"";e.push(`<style${i}>${r.content}</style>`)}return e.join(`
3
+ `)}function S(t=p){if(!t.htmlAttrs)return"";return Object.entries(t.htmlAttrs).map(([e,r])=>`${e}="${u(r)}"`).join(" ")}function H(t=p){if(!t.bodyAttrs)return"";return Object.entries(t.bodyAttrs).map(([e,r])=>`${e}="${u(r)}"`).join(" ")}function u(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function C(t=p){if(typeof document>"u")return;if(t.title){let e=t.title;if(t.titleTemplate)e=typeof t.titleTemplate==="function"?t.titleTemplate(e):t.titleTemplate.replace("%s",e);document.title=e}for(let e of t.meta||[]){let r=e.name?`meta[name="${e.name}"]`:e.property?`meta[property="${e.property}"]`:null;if(r){let i=document.querySelector(r);if(!i){if(i=document.createElement("meta"),e.name)i.setAttribute("name",e.name);if(e.property)i.setAttribute("property",e.property);document.head.appendChild(i)}i.setAttribute("content",e.content)}}for(let e of t.link||[]){let r=`link[rel="${e.rel}"]${e.href?`[href="${e.href}"]`:""}`,i=document.querySelector(r);if(!i)i=document.createElement("link"),document.head.appendChild(i);for(let[n,s]of Object.entries(e))if(s!==void 0)i.setAttribute(n,String(s))}if(t.htmlAttrs)for(let[e,r]of Object.entries(t.htmlAttrs))if(e==="class")for(let i of String(r).split(/\s+/).filter(Boolean))document.documentElement.classList.add(i);else document.documentElement.setAttribute(e,r);if(t.bodyAttrs)for(let[e,r]of Object.entries(t.bodyAttrs))document.body.setAttribute(e,r)}function O(t){let e="";return{content:t.replace(/@head\s*([\s\S]*?)@endhead/g,(r,i)=>{return e+=i.trim()+`
4
+ `,""}),headContent:e.trim()}}function M(t,e){return t.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(r,i,n,s)=>{let l=i?n:e[(s||"").trim()]??s,o=e.__stx_runtime_head??{};return e.__stx_runtime_head=c(o,{title:l}),""})}function D(t,e){return t.replace(/@meta\s*\(\s*(['"`])(.+?)\1\s*,\s*(?:(['"`])(.+?)\3|([^)]+))\s*\)/g,(r,i,n,s,l,o)=>{let a=s?l:o,d=s?a:e[(a||"").trim()]??a,y=n.includes(":")?{property:n,content:d}:{name:n,content:d},T=e.__stx_runtime_head??{};return e.__stx_runtime_head=c(T,{meta:[y]}),""})}export{A as En,_ as Fn,w as Gn,h as Hn,c as In,f as Jn,$ as Kn,k as Ln,x as Mn,j as Nn,S as On,H as Pn,C as Qn,O as Rn,M as Sn,D as Tn};