@stacksjs/actions 0.70.73 → 0.70.75

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 (163) hide show
  1. package/dist/action.d.ts +8 -6
  2. package/dist/action.js +1 -1
  3. package/dist/actions.js +1 -1
  4. package/dist/add.js +1 -1
  5. package/dist/ai/request-model-access.d.ts +1 -1
  6. package/dist/ai/request-model-access.js +1 -1
  7. package/dist/auth/client.d.ts +1 -1
  8. package/dist/auth/prune.d.ts +1 -1
  9. package/dist/auth/setup.d.ts +1 -1
  10. package/dist/auth/token.d.ts +1 -1
  11. package/dist/blog.js +23 -23
  12. package/dist/build/cli.d.ts +1 -1
  13. package/dist/build/component-libs.d.ts +1 -1
  14. package/dist/build/core.d.ts +1 -1
  15. package/dist/build/desktop.d.ts +1 -1
  16. package/dist/build/docs.d.ts +1 -1
  17. package/dist/build/frontend-static.js +1 -1
  18. package/dist/build/server.d.ts +1 -1
  19. package/dist/build/stacks.d.ts +1 -1
  20. package/dist/build/views.d.ts +1 -1
  21. package/dist/build.js +1 -1
  22. package/dist/bump.d.ts +1 -1
  23. package/dist/bump.js +7 -2
  24. package/dist/changelog.d.ts +0 -1
  25. package/dist/changelog.js +2 -1
  26. package/dist/check/ports.d.ts +1 -1
  27. package/dist/{chunk-8tmc78d6.js → chunk-49ry9mgz.js} +1 -1
  28. package/dist/{chunk-qqth0x9w.js → chunk-73y0wp0s.js} +1 -1
  29. package/dist/{chunk-bbd6n9q2.js → chunk-8kvzjd10.js} +1 -1
  30. package/dist/{chunk-vn8sr2rt.js → chunk-dxvgx0r7.js} +1 -1
  31. package/dist/{chunk-jn81jcta.js → chunk-f8z1aft6.js} +1 -1
  32. package/dist/{chunk-29eg94q3.js → chunk-gcjrdkq7.js} +1 -1
  33. package/dist/{chunk-c0cs49hn.js → chunk-heh4x32p.js} +1 -1
  34. package/dist/{chunk-y5k9qbfd.js → chunk-hr9ndn21.js} +1 -1
  35. package/dist/{chunk-b10hy2vq.js → chunk-hv8tkjw2.js} +2 -2
  36. package/dist/{chunk-ckcjsw9a.js → chunk-n057zfgw.js} +1 -1
  37. package/dist/{chunk-j9vajggg.js → chunk-t5j470r2.js} +1 -1
  38. package/dist/chunk-v0hqskdk.js +3 -0
  39. package/dist/{chunk-r3t7shd4.js → chunk-v1dg1jp6.js} +1 -1
  40. package/dist/{chunk-prpycg7f.js → chunk-w4erevzw.js} +1 -1
  41. package/dist/{chunk-m0v346zb.js → chunk-x0cnhg3z.js} +1 -1
  42. package/dist/clean.d.ts +1 -1
  43. package/dist/commit.js +1 -1
  44. package/dist/copy-types.d.ts +1 -1
  45. package/dist/database/seed.d.ts +1 -1
  46. package/dist/deploy/create-receipt-rule.d.ts +1 -1
  47. package/dist/deploy/index.d.ts +1 -1
  48. package/dist/deploy/index.js +2 -2
  49. package/dist/dev/api.d.ts +1 -1
  50. package/dist/dev/api.js +1 -1
  51. package/dist/dev/components.d.ts +1 -1
  52. package/dist/dev/dashboard-globals.js +1 -1
  53. package/dist/dev/dashboard-utils.d.ts +59 -53
  54. package/dist/dev/dashboard-utils.js +1 -1
  55. package/dist/dev/dashboard.d.ts +10 -0
  56. package/dist/dev/dashboard.js +4 -4
  57. package/dist/dev/desktop.d.ts +1 -1
  58. package/dist/dev/docs.d.ts +1 -1
  59. package/dist/dev/docs.js +1 -1
  60. package/dist/dev/index.js +1 -1
  61. package/dist/dev/migrate-watcher.js +1 -1
  62. package/dist/dev/system-tray.d.ts +1 -1
  63. package/dist/dev/views.d.ts +1 -1
  64. package/dist/dev/views.js +1 -1
  65. package/dist/discover-packages.js +1 -1
  66. package/dist/domains/add.d.ts +1 -1
  67. package/dist/domains/remove.d.ts +1 -1
  68. package/dist/examples.js +1 -1
  69. package/dist/find-projects.d.ts +1 -1
  70. package/dist/fresh.d.ts +1 -1
  71. package/dist/generate/action-types.d.ts +1 -1
  72. package/dist/generate/component-meta.d.ts +1 -1
  73. package/dist/generate/component-meta.js +1 -1
  74. package/dist/generate/custom-cli-file.d.ts +1 -1
  75. package/dist/generate/env-files.d.ts +1 -1
  76. package/dist/generate/env-files.js +1 -1
  77. package/dist/generate/ide-helpers.d.ts +1 -1
  78. package/dist/generate/ide-helpers.js +1 -1
  79. package/dist/generate/index.js +1 -1
  80. package/dist/generate/lib-entries.js +1 -1
  81. package/dist/generate/pantry-file.d.ts +1 -1
  82. package/dist/generate/symlink-core.d.ts +1 -1
  83. package/dist/generate/types.d.ts +1 -1
  84. package/dist/generate/vscode-custom-data.d.ts +1 -1
  85. package/dist/generate/vscode-custom-data.js +1 -1
  86. package/dist/helpers/component-meta.js +1 -1
  87. package/dist/helpers/index.js +1 -1
  88. package/dist/helpers/lib-entries.js +1 -1
  89. package/dist/helpers/package-json.js +1 -1
  90. package/dist/helpers/utils.js +1 -1
  91. package/dist/helpers/vscode-custom-data.js +1 -1
  92. package/dist/index.js +1 -1
  93. package/dist/key-generate.d.ts +1 -1
  94. package/dist/lint/fix.d.ts +1 -1
  95. package/dist/lint/fix.js +1 -1
  96. package/dist/lint/index.d.ts +1 -1
  97. package/dist/lint/index.js +1 -1
  98. package/dist/lint/lint.js +1 -1
  99. package/dist/make-command.js +1 -1
  100. package/dist/make-job.js +1 -1
  101. package/dist/make-policy.js +1 -1
  102. package/dist/make-resource.js +1 -1
  103. package/dist/make.js +1 -1
  104. package/dist/migrate/database.d.ts +1 -1
  105. package/dist/migrate/fresh.d.ts +1 -1
  106. package/dist/orm/base.js +1 -1
  107. package/dist/prepublish.d.ts +1 -1
  108. package/dist/queue/clear.d.ts +1 -1
  109. package/dist/queue/dlq-purge.d.ts +1 -1
  110. package/dist/queue/dlq-retry.d.ts +1 -1
  111. package/dist/queue/dlq.d.ts +1 -1
  112. package/dist/queue/failed.d.ts +1 -1
  113. package/dist/queue/flush.d.ts +1 -1
  114. package/dist/queue/inspect.d.ts +1 -1
  115. package/dist/queue/list.d.ts +1 -1
  116. package/dist/queue/monitor.d.ts +1 -1
  117. package/dist/queue/pause.d.ts +1 -1
  118. package/dist/queue/quarantine.d.ts +1 -1
  119. package/dist/queue/resume.d.ts +1 -1
  120. package/dist/queue/retry.d.ts +1 -1
  121. package/dist/queue/schedule-list.d.ts +1 -1
  122. package/dist/queue/schedule.d.ts +1 -1
  123. package/dist/queue/status.d.ts +1 -1
  124. package/dist/queue/table.d.ts +1 -1
  125. package/dist/queue/unquarantine.d.ts +1 -1
  126. package/dist/queue/work.d.ts +1 -1
  127. package/dist/release.d.ts +1 -1
  128. package/dist/release.js +1 -1
  129. package/dist/route/list.d.ts +1 -1
  130. package/dist/run-action.js +1 -1
  131. package/dist/saas/setup.d.ts +1 -1
  132. package/dist/scaffold-crud.js +1 -1
  133. package/dist/schedule/run.d.ts +1 -1
  134. package/dist/search/flush.d.ts +1 -1
  135. package/dist/search/import.d.ts +1 -1
  136. package/dist/search/settings-list.d.ts +1 -1
  137. package/dist/search/settings.d.ts +1 -1
  138. package/dist/serve/api.d.ts +1 -1
  139. package/dist/setup/index.js +1 -1
  140. package/dist/setup/ssl.js +1 -1
  141. package/dist/stacks.js +1 -1
  142. package/dist/templates.d.ts +21 -1
  143. package/dist/templates.js +1 -1
  144. package/dist/test/feature.d.ts +1 -1
  145. package/dist/test/index.d.ts +1 -1
  146. package/dist/test/ui.d.ts +1 -1
  147. package/dist/test/unit.d.ts +1 -1
  148. package/dist/typecheck.d.ts +1 -1
  149. package/dist/types.js +1 -1
  150. package/dist/upgrade/binary.d.ts +1 -1
  151. package/dist/upgrade/dependencies.js +1 -1
  152. package/dist/upgrade/framework-utils.js +1 -1
  153. package/dist/upgrade/framework.d.ts +1 -1
  154. package/dist/upgrade/framework.js +1 -1
  155. package/dist/upgrade/index.d.ts +1 -1
  156. package/dist/upgrade/index.js +1 -1
  157. package/dist/upgrade/packages.js +8 -8
  158. package/dist/upgrade/shell.d.ts +1 -1
  159. package/dist/upgrade.js +1 -1
  160. package/package.json +26 -23
  161. package/dist/chunk-1ebgbeyr.js +0 -920
  162. package/dist/chunk-h3163h5z.js +0 -3
  163. package/dist/chunk-vntz6mtt.js +0 -16
package/dist/action.d.ts CHANGED
@@ -15,7 +15,7 @@ import type { ExtractParams, InferValidations, JobOptions, RequestInstance } fro
15
15
  */
16
16
  export declare interface ActionValidations {
17
17
  [key: string]: {
18
- rule: { validate: (value: unknown) => { valid: boolean, errors?: Array<{ message: string }> } }
18
+ rule: { validate: (value: any) => any }
19
19
  message?: string | Record<string, string>
20
20
  }
21
21
  }
@@ -49,9 +49,11 @@ declare interface ActionOptions<TModel = string, TValidations extends ActionVali
49
49
  before?: (
50
50
  request: InferRequest<TModel, TValidations, TPath>,
51
51
  ) => void | Response | Promise<void | Response>
52
- handle: (
53
- request: InferRequest<TModel, TValidations, TPath>,
54
- ) => ActionResult | Promise<ActionResult>
52
+ handle: {
53
+ bivarianceHack: (
54
+ request: InferRequest<TModel, TValidations, TPath>,
55
+ ) => ActionResult | Promise<ActionResult>
56
+ }['bivarianceHack']
55
57
  dependencies?: () => Record<string, unknown>
56
58
  }
57
59
  /**
@@ -101,7 +103,7 @@ export type ActionResult = | Response
101
103
  | string
102
104
  | number
103
105
  | boolean
104
- | Record<string, unknown>
106
+ | object
105
107
  | unknown[];
106
108
  export declare class Action<TModel = string, TValidations extends ActionValidations | undefined = undefined, TPath extends string = '',> {
107
109
  name?: string;
@@ -113,7 +115,7 @@ export declare class Action<TModel = string, TValidations extends ActionValidati
113
115
  enabled?: ActionOptions['enabled'];
114
116
  path?: ActionOptions<TModel, TValidations, TPath>['path'];
115
117
  method?: ActionOptions['method'];
116
- validations?: ActionOptions['validations'];
118
+ validations?: TValidations;
117
119
  requestFile?: string;
118
120
  skipCsrf?: boolean;
119
121
  csrf?: boolean;
package/dist/action.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{fb as a}from"./chunk-d5mbs5zz.js";import"./chunk-h3163h5z.js";export{a as Action};
2
+ import{fb as a}from"./chunk-d5mbs5zz.js";import"./chunk-v0hqskdk.js";export{a as Action};
package/dist/actions.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{gb as a,hb as e,ib as f,jb as o}from"./chunk-bbd6n9q2.js";import"./chunk-h3163h5z.js";export{e as runActions,a as runAction,f as hasAction,o as actions};
2
+ import{gb as a,hb as e,ib as f,jb as o}from"./chunk-8kvzjd10.js";import"./chunk-v0hqskdk.js";export{e as runActions,a as runAction,f as hasAction,o as actions};
package/dist/add.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{kb as a,lb as b,mb as c,nb as d,ob as e}from"./chunk-vv4nqhgg.js";import"./chunk-h3163h5z.js";export{a as invoke,e as installPackages,c as addTable,d as addCalendar,b as add};
2
+ import{kb as a,lb as b,mb as c,nb as d,ob as e}from"./chunk-vv4nqhgg.js";import"./chunk-v0hqskdk.js";export{a as invoke,e as installPackages,c as addTable,d as addCalendar,b as add};
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"../chunk-h3163h5z.js";import{requestModelAccess as e}from"@stacksjs/ai";async function o(){try{await e()}catch(r){console.error("Error requesting model access:",r)}}if(import.meta.main)o();
2
+ import"../chunk-v0hqskdk.js";import{requestModelAccess as e}from"@stacksjs/ai";async function o(){try{await e()}catch(r){console.error("Error requesting model access:",r)}}if(import.meta.main)o();
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1 +1 @@
1
-
1
+ export {};
package/dist/blog.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-h3163h5z.js";import{existsSync as x,mkdirSync as X,readdirSync as H,readFileSync as R,writeFileSync as h}from"fs";import{homedir as u}from"os";import{join as Z}from"path";var $=Z(process.cwd(),"content/blog"),F=Z($,".theme.css"),O=null;async function S(){if(!O)O=(async()=>{let z=[Z(u(),"Code/Tools/bunpress/packages/bunpress/dist/src/index.js"),Z(process.cwd(),"pantry/@stacksjs/bunpress/dist/src/index.js"),"@stacksjs/bunpress"];for(let A of z)try{if(A.startsWith("@")||x(A))return await import(A)}catch{}return null})();return O}function V(z){return String(z).replace(/[&<>"]/g,(A)=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[A])}function B(z){return String(z).replace(/[&<>"']/g,(A)=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;"})[A])}function D(z,A){return`${z.replace(/\/$/,"")}/blog/${A}`}function g(z){let A=new Date(z);return Number.isNaN(A.getTime())?z:A.toUTCString()}function c(z){let A=z||"https://stacksjs.com",Q=q().slice(0,50).map((K)=>{let W=D(A,K.slug);return` <item>
2
+ import"./chunk-v0hqskdk.js";import{existsSync as x,mkdirSync as X,readdirSync as H,readFileSync as R,writeFileSync as h}from"fs";import{homedir as u}from"os";import{join as Z}from"path";var $=Z(process.cwd(),"content/blog"),F=Z($,".theme.css"),O=null;async function S(){if(!O)O=(async()=>{let z=[Z(u(),"Code/Tools/bunpress/packages/bunpress/dist/src/index.js"),Z(process.cwd(),"pantry/@stacksjs/bunpress/dist/src/index.js"),"@stacksjs/bunpress"];for(let A of z)try{if(A.startsWith("@")||x(A))return await import(A)}catch{}return null})();return O}function Y(z){return String(z).replace(/[&<>"]/g,(A)=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[A])}function B(z){return String(z).replace(/[&<>"']/g,(A)=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;"})[A])}function D(z,A){return`${z.replace(/\/$/,"")}/blog/${A}`}function g(z){if(!z)return"";let A=new Date(z);return Number.isNaN(A.getTime())?z:A.toUTCString()}function c(z){let A=z||"https://stacksjs.com",Q=q().slice(0,50).map((K)=>{let W=D(A,K.slug);return` <item>
3
3
  <title>${B(K.fm.title||K.slug)}</title>
4
4
  <link>${B(W)}</link>
5
5
  <guid>${B(W)}</guid>
@@ -18,8 +18,8 @@ ${Q}
18
18
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
19
19
  ${[`${A}/blog`,...q().map((Q)=>D(A,Q.slug))].map((Q)=>` <url><loc>${B(Q)}</loc></url>`).join(`
20
20
  `)}
21
- </urlset>`}function d(z){let A=z.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!A)return{data:{},body:z};let J={};for(let Q of A[1].split(`
22
- `)){let K=Q.indexOf(":");if(K===-1)continue;let W=Q.slice(0,K).trim(),G=Q.slice(K+1).trim();if(G.startsWith('"')&&G.endsWith('"')||G.startsWith("'")&&G.endsWith("'"))G=G.slice(1,-1);J[W]=G}return{data:J,body:A[2]}}function E(z){if(!z)return"";let A=new Date(z);if(Number.isNaN(A.getTime()))return z;return`${["January","February","March","April","May","June","July","August","September","October","November","December"][A.getUTCMonth()]} ${A.getUTCDate()}, ${A.getUTCFullYear()}`}function I(){return`<script>
21
+ </urlset>`}function d(z){let A=z.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!A)return{data:{},body:z};let G={},Q=A[1]??"";for(let K of Q.split(`
22
+ `)){let W=K.indexOf(":");if(W===-1)continue;let J=K.slice(0,W).trim(),V=K.slice(W+1).trim();if(V.startsWith('"')&&V.endsWith('"')||V.startsWith("'")&&V.endsWith("'"))V=V.slice(1,-1);G[J]=V}return{data:G,body:A[2]??""}}function E(z){if(!z)return"";let A=new Date(z);if(Number.isNaN(A.getTime()))return z;return`${["January","February","March","April","May","June","July","August","September","October","November","December"][A.getUTCMonth()]} ${A.getUTCDate()}, ${A.getUTCFullYear()}`}function I(){return`<script>
23
23
  (function () {
24
24
  function ok(theme) {
25
25
  return theme === 'light' || theme === 'colored' || theme === 'dark'
@@ -56,47 +56,47 @@ ${[`${A}/blog`,...q().map((Q)=>D(A,Q.slug))].map((Q)=>` <url><loc>${B(Q)}</loc>
56
56
  <span class="ridge"></span>
57
57
  <span class="river"></span>
58
58
  <p class="colophon">Built with Stacks \xB7 TypeScript &amp; Bun \xB7 <a href="/blog/feed.xml">RSS</a></p>
59
- </div>`}function k(z,A){let J=x(F)?R(F,"utf-8"):"",Q=z.defaultConfig.markdown?.css||"";return{...z.defaultConfig,title:A.title||"Stacks Blog",description:A.description||"The official Stacks blog.",docsDir:$,theme:"vitepress",markdown:{...z.defaultConfig.markdown,css:`${Q}
60
- ${J}`},themeConfig:{siteTitle:"Stacks Blog",nav:[{text:"Blog",link:"/blog"},{text:"Docs",link:"/docs"},{text:"GitHub",link:"https://github.com/stacksjs/stacks"}]}}}function q(){if(!x($))return[];return H($).filter((z)=>z.endsWith(".md")).map((z)=>{let{data:A}=d(R(Z($,z),"utf-8"));return{slug:z.replace(/\.md$/,""),fm:A}}).filter((z)=>!!z.fm.title&&!!z.fm.date).sort((z,A)=>{let J=z.fm.featured==="true"?1:0,Q=A.fm.featured==="true"?1:0;if(J!==Q)return Q-J;return(A.fm.date||"").localeCompare(z.fm.date||"")})}async function n(z){return z.wrapInLayout(I()+`
59
+ </div>`}function k(z,A){let G=x(F)?R(F,"utf-8"):"",Q=z.defaultConfig.markdown?.css||"";return{...z.defaultConfig,title:A.title||"Stacks Blog",description:A.description||"The official Stacks blog.",docsDir:$,theme:"vitepress",markdown:{...z.defaultConfig.markdown,css:`${Q}
60
+ ${G}`},themeConfig:{siteTitle:"Stacks Blog",nav:[{text:"Blog",link:"/blog"},{text:"Docs",link:"/docs"},{text:"GitHub",link:"https://github.com/stacksjs/stacks"}]}}}function q(){if(!x($))return[];return H($).filter((z)=>z.endsWith(".md")).map((z)=>{let{data:A}=d(R(Z($,z),"utf-8"));return{slug:z.replace(/\.md$/,""),fm:A}}).filter((z)=>!!z.fm.title&&!!z.fm.date).sort((z,A)=>{let G=z.fm.featured==="true"?1:0,Q=A.fm.featured==="true"?1:0;if(G!==Q)return Q-G;return(A.fm.date||"").localeCompare(z.fm.date||"")})}async function n(z){return z.wrapInLayout(I()+`
61
61
  <a class="blog-back" href="/blog">\u2190 All posts</a>
62
62
  <div class="blog-404">
63
63
  <span class="blog-404-art" aria-hidden="true"></span>
64
64
  <h1>You've wandered off the trail</h1>
65
65
  <p>This post isn't on the map (or it moved camp). Head back to <a href="/blog">the trailhead</a>.</p>
66
- </div>`+P(),k(z,{title:"Not found"}),"/blog","page")}async function y(z,A,J){let Q=Z($,`${A}.md`);if(!x(Q))return null;let K=R(Q,"utf-8"),{html:W,frontmatter:G}=await z.markdownToHtml(K,$);if(!G.title||!G.date)return null;let Y=V((G.author||"S").charAt(0).toUpperCase()),L=`
66
+ </div>`+P(),k(z,{title:"Not found"}),"/blog","page")}async function y(z,A,G){let Q=Z($,`${A}.md`);if(!x(Q))return null;let K=R(Q,"utf-8"),{html:W,frontmatter:J}=await z.markdownToHtml(K,$);if(!J.title||!J.date)return null;let V=Y((J.author||"S").charAt(0).toUpperCase()),L=`
67
67
  <a class="blog-back" href="/blog">\u2190 All posts</a>
68
68
  <div class="blog-post-head">
69
- <h1>${V(G.title||A)}</h1>
69
+ <h1>${Y(J.title||A)}</h1>
70
70
  <p class="blog-post-meta">
71
- <span class="author">${V(G.author||"The Stacks Team")}</span>
71
+ <span class="author">${Y(J.author||"The Stacks Team")}</span>
72
72
  <span class="dot">\xB7</span>
73
- <time>${V(E(G.date))}</time>
73
+ <time>${Y(E(J.date))}</time>
74
74
  </p>
75
- ${G.poster?`<figure class="blog-post-poster"><img src="${V(G.poster)}" alt="${V(G.title||"")}"></figure>`:""}
76
- </div>`,w=G.authorBio?`<aside class="blog-author-card">
77
- <div class="avatar">${Y}</div>
78
- <div><span class="name">${V(G.author||"The Stacks Team")}</span><p class="bio">${V(G.authorBio)}</p></div>
79
- </aside>`:"",v=`${J}/blog/${A}`,j=`
75
+ ${J.poster?`<figure class="blog-post-poster"><img src="${Y(J.poster)}" alt="${Y(J.title||"")}"></figure>`:""}
76
+ </div>`,w=J.authorBio?`<aside class="blog-author-card">
77
+ <div class="avatar">${V}</div>
78
+ <div><span class="name">${Y(J.author||"The Stacks Team")}</span><p class="bio">${Y(J.authorBio)}</p></div>
79
+ </aside>`:"",v=`${G}/blog/${A}`,j=`
80
80
  <div class="blog-share">
81
81
  <span class="blog-share-label">Share</span>
82
- <a href="https://twitter.com/intent/tweet?url=${encodeURIComponent(v)}&text=${encodeURIComponent(G.title||"")}" target="_blank" rel="noreferrer">X / Twitter</a>
82
+ <a href="https://twitter.com/intent/tweet?url=${encodeURIComponent(v)}&text=${encodeURIComponent(J.title||"")}" target="_blank" rel="noreferrer">X / Twitter</a>
83
83
  <a href="https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(v)}" target="_blank" rel="noreferrer">LinkedIn</a>
84
84
  </div>`,_=q().filter((M)=>M.slug!==A).slice(0,3),U=_.length?`<nav class="blog-more">
85
85
  <h2>More from the blog</h2>
86
- <ul>${_.map((M)=>`<li><a href="/blog/${V(M.slug)}">${V(M.fm.title||M.slug)}</a></li>`).join("")}</ul>
87
- </nav>`:"";return z.wrapInLayout(I()+L+W+w+j+U+P(),k(z,G),`/blog/${A}`,"page")}async function N(z){let Q=`
86
+ <ul>${_.map((M)=>`<li><a href="/blog/${Y(M.slug)}">${Y(M.fm.title||M.slug)}</a></li>`).join("")}</ul>
87
+ </nav>`:"";return z.wrapInLayout(I()+L+W+w+j+U+P(),k(z,J),`/blog/${A}`,"page")}async function N(z){let Q=`
88
88
  <div class="blog-listing-head">
89
89
  <span class="sign" aria-hidden="true"></span>
90
90
  <h1>The Stacks Blog</h1>
91
91
  <p>Notes from building a full-stack TypeScript framework whose only dependencies are TypeScript and Bun.</p>
92
92
  </div>
93
- <div class="blog-cards">${q().map((K)=>{let W=K.fm.featured==="true",G=K.fm.poster?`<div class="blog-card-media"><img src="${V(K.fm.poster)}" alt="" loading="lazy"></div>`:"";return`<a class="blog-card${W?" is-featured":""}" href="/blog/${V(K.slug)}">
94
- ${G}
93
+ <div class="blog-cards">${q().map((K)=>{let W=K.fm.featured==="true",J=K.fm.poster?`<div class="blog-card-media"><img src="${Y(K.fm.poster)}" alt="" loading="lazy"></div>`:"";return`<a class="blog-card${W?" is-featured":""}" href="/blog/${Y(K.slug)}">
94
+ ${J}
95
95
  <div>
96
96
  ${W?'<span class="blog-card-flag">Featured</span>':""}
97
- <h2 class="blog-card-title">${V(K.fm.title||K.slug)}</h2>
98
- <p class="blog-card-excerpt">${V((K.fm.description||"").slice(0,180))}</p>
99
- <div class="blog-card-meta">${V(K.fm.author||"The Stacks Team")} \xB7 ${V(E(K.fm.date))}</div>
97
+ <h2 class="blog-card-title">${Y(K.fm.title||K.slug)}</h2>
98
+ <p class="blog-card-excerpt">${Y((K.fm.description||"").slice(0,180))}</p>
99
+ <div class="blog-card-meta">${Y(K.fm.author||"The Stacks Team")} \xB7 ${Y(E(K.fm.date))}</div>
100
100
  </div>
101
101
  </a>`}).join(`
102
- `)||"<p>No posts yet.</p>"}</div>`;return z.wrapInLayout(I()+Q+P(),k(z,{title:"Blog",description:"The official Stacks blog."}),"/blog","page")}function C(z,A){let J={...k(z,{title:"The Stacks Blog"}),sitemap:{enabled:!0,baseUrl:`${A}/blog`}};return typeof z.buildRssFeed==="function"?z.buildRssFeed($,J,{enabled:!0,title:"The Stacks Blog",description:"Notes from building a full-stack TypeScript framework whose only dependencies are TypeScript and Bun.",maxItems:50}):Promise.resolve(c(A))}function T(z,A){let J={...k(z,{title:"Blog"}),sitemap:{enabled:!0,baseUrl:`${A}/blog`}};return typeof z.buildSitemap==="function"?z.buildSitemap($,J):Promise.resolve(f(A))}async function m(z){if(z.method!=="GET"&&z.method!=="HEAD")return null;let A=new URL(z.url),{pathname:J}=A,Q=J==="/blog/feed.xml",K=J==="/blog/sitemap.xml",W=J==="/blog"||J==="/blog/"||/^\/blog\/[^/.]+$/.test(J);if(!Q&&!K&&!W)return null;let G=await S();if(!G)return null;let Y=(v,j=200)=>new Response(v,{status:j,headers:{"Content-Type":"text/html; charset=utf-8"}});if(Q)return new Response(await C(G,A.origin),{headers:{"Content-Type":"application/rss+xml; charset=utf-8"}});if(K)return new Response(await T(G,A.origin),{headers:{"Content-Type":"application/xml; charset=utf-8"}});if(J==="/blog"||J==="/blog/")return Y(await N(G));let L=J.replace(/^\/blog\//,"").replace(/\/$/,""),w=await y(G,L,A.origin);return w?Y(w):Y(await n(G),404)}async function r(z={outDir:"dist/blog"}){let A=z.outDir||"dist/blog",J=(z.baseUrl||"").replace(/\/$/,""),Q=await S();if(!Q)throw Error("[blog] BunPress not found \u2014 cannot build the blog.");X(A,{recursive:!0});let K=(G,Y)=>{let L=Z(A,G);X(Z(L,".."),{recursive:!0}),h(L,Y,"utf-8")};K("index.html",await N(Q));let W=q();for(let G of W){let Y=await y(Q,G.slug,J);if(Y)K(Z(G.slug,"index.html"),Y)}K("feed.xml",await C(Q,J)),K("sitemap.xml",await T(Q,J)),console.log(`[blog] built ${W.length} post(s) + listing, feed.xml, sitemap.xml \u2192 ${A}`)}export{m as renderBlog,r as buildBlog};
102
+ `)||"<p>No posts yet.</p>"}</div>`;return z.wrapInLayout(I()+Q+P(),k(z,{title:"Blog",description:"The official Stacks blog."}),"/blog","page")}function C(z,A){let G={...k(z,{title:"The Stacks Blog"}),sitemap:{enabled:!0,baseUrl:`${A}/blog`}};return typeof z.buildRssFeed==="function"?z.buildRssFeed($,G,{enabled:!0,title:"The Stacks Blog",description:"Notes from building a full-stack TypeScript framework whose only dependencies are TypeScript and Bun.",maxItems:50}):Promise.resolve(c(A))}function T(z,A){let G={...k(z,{title:"Blog"}),sitemap:{enabled:!0,baseUrl:`${A}/blog`}};return typeof z.buildSitemap==="function"?z.buildSitemap($,G):Promise.resolve(f(A))}async function m(z){if(z.method!=="GET"&&z.method!=="HEAD")return null;let A=new URL(z.url),{pathname:G}=A,Q=G==="/blog/feed.xml",K=G==="/blog/sitemap.xml",W=G==="/blog"||G==="/blog/"||/^\/blog\/[^/.]+$/.test(G);if(!Q&&!K&&!W)return null;let J=await S();if(!J)return null;let V=(v,j=200)=>new Response(v,{status:j,headers:{"Content-Type":"text/html; charset=utf-8"}});if(Q)return new Response(await C(J,A.origin),{headers:{"Content-Type":"application/rss+xml; charset=utf-8"}});if(K)return new Response(await T(J,A.origin),{headers:{"Content-Type":"application/xml; charset=utf-8"}});if(G==="/blog"||G==="/blog/")return V(await N(J));let L=G.replace(/^\/blog\//,"").replace(/\/$/,""),w=await y(J,L,A.origin);return w?V(w):V(await n(J),404)}async function r(z={outDir:"dist/blog"}){let A=z.outDir||"dist/blog",G=(z.baseUrl||"").replace(/\/$/,""),Q=await S();if(!Q)throw Error("[blog] BunPress not found \u2014 cannot build the blog.");X(A,{recursive:!0});let K=(J,V)=>{let L=Z(A,J);X(Z(L,".."),{recursive:!0}),h(L,V,"utf-8")};K("index.html",await N(Q));let W=q();for(let J of W){let V=await y(Q,J.slug,G);if(V)K(Z(J.slug,"index.html"),V)}K("feed.xml",await C(Q,G)),K("sitemap.xml",await T(Q,G)),console.log(`[blog] built ${W.length} post(s) + listing, feed.xml, sitemap.xml \u2192 ${A}`)}export{m as renderBlog,r as buildBlog};
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{sb as V}from"../chunk-h3163h5z.js";import{copyFileSync as j,existsSync as _,mkdirSync as w,readdirSync as D,readFileSync as g,rmSync as P,statSync as S,writeFileSync as N}from"fs";import{join as W}from"path";import F from"process";import{publicPath as C,resourcesPath as M,storagePath as v}from"@stacksjs/path";var y=F.argv.includes("--verbose")||F.argv.includes("-v");function Z(...J){if(y)console.log("\uD83D\uDD0D",...J)}async function b(){try{let{generateSignalsRuntime:J}=await import("@stacksjs/stx/signals");return`<script>
2
+ import{qb as V}from"../chunk-v0hqskdk.js";import{copyFileSync as j,existsSync as _,mkdirSync as w,readdirSync as D,readFileSync as g,rmSync as P,statSync as S,writeFileSync as N}from"fs";import{join as W}from"path";import F from"process";import{publicPath as C,resourcesPath as M,storagePath as v}from"@stacksjs/path";var y=F.argv.includes("--verbose")||F.argv.includes("-v");function Z(...J){if(y)console.log("\uD83D\uDD0D",...J)}async function b(){try{let{generateSignalsRuntime:J}=await import("@stacksjs/stx/signals");return`<script>
3
3
  ${J()}
4
4
  </script>`}catch{return console.warn("Could not load STX signals runtime"),""}}function A(J,z){if(!_(z))w(z,{recursive:!0});for(let Q of D(J)){if(Q===".DS_Store")continue;let T=W(J,Q),X=W(z,Q);if(S(T).isDirectory())A(T,X);else j(T,X)}}async function h(J={}){let z=J.outDir??v("framework/frontend-dist");if(_(z))P(z,{recursive:!0});w(z,{recursive:!0}),w(W(z,"assets"),{recursive:!0});let Q=M("views/index.stx");if(_(Q)){let q=g(Q,"utf-8"),f=q.match(/<script server>([\s\S]*?)<\/script>/),$={};if(f){let L=f[1]??"";try{let I=[...L.matchAll(/(?:const|let|var)\s+(\w+)\s*=/g)].map((K)=>K[1]).filter((K)=>Boolean(K));$=Function(`${L}
5
5
  return { ${I.join(", ")} }`)()}catch(I){Z(` Server block evaluation failed: ${I}, falling back to regex`);let G=L.matchAll(/const\s+(\w+)\s*=\s*(?:'([^']*)'|"([^"]*)"|([\d.]+))/g);for(let K of G){let U=K[1];if(U)$[U]=K[2]??K[3]??K[4]}}q=q.replace(/<script server>[\s\S]*?<\/script>\s*/,"")}q=q.replace(/\{\{\s*(\w+)\s*\}\}/g,(L,I)=>{let G=$[I];return G!==void 0&&G!==null?String(G):""});let R=/@foreach\s*\((\w+)\s+as\s+(\w+)\)([\s\S]*?)@endforeach/g;if(q=q.replace(R,(L,I,G,K)=>{let U=$[I];if(!Array.isArray(U)||U.length===0)return"";let B="";for(let H of U){let Y=K;Y=Y.replace(new RegExp(`\\{\\{\\s*${G}\\.(\\w+)\\s*\\}\\}`,"g"),(k,E)=>{let O=H[E];return O!==void 0&&O!==null?String(O):""}),Y=Y.replace(new RegExp(`\\{!!\\s*${G}\\.(\\w+)\\s*!!\\}`,"g"),(k,E)=>{let O=H[E];return O!==void 0&&O!==null?String(O):""}),B+=Y}return B}),q=q.replace(/^\s*@extends\([^)]+\)\s*$/gm,"").replace(/^\s*@include\([^)]+\)\s*$/gm,"").replace(/^\s*@section\('title',\s*['"][^'"]*['"]\)\s*$/gm,"").replace(/^\s*@section\('(?:content|footer)'\)\s*$/gm,"").replace(/^\s*@endsection\s*$/gm,""),/data-stx-scope|@model|@show|@text|@class|@style|@bind:|@if=|@for=/.test(q)){let L=await b();if(L){let I=q.match(/<body[^>]*>/);if(I){let G=(q.indexOf(I[0])??0)+I[0].length;q=q.slice(0,G)+`
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1 +1 @@
1
-
1
+ export {};
package/dist/build.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ya as B}from"./chunk-vn8sr2rt.js";import"./chunk-h10aj7jf.js";import"./chunk-wtnp31q5.js";import"./chunk-s735m9mg.js";import"./chunk-bbd6n9q2.js";import"./chunk-h3163h5z.js";import{NpmScript as z}from"@stacksjs/enums";import{log as x}from"@stacksjs/logging";import{hasComponents as D,hasFunctions as G}from"@stacksjs/storage";import{runNpmScript as A}from"@stacksjs/utils";async function H(q){if(q.components)await I(q);else if(q.webComponents||q.elements)await E(q);else if(q.functions)await O(q);else if(q.docs)await K(q);else if(q.stacks)await M(q);await B()}async function W(q){return await H(q)}async function I(q){await A(z.GenerateEntries,q),await J(q),await E(q)}async function J(q){if(D())x.info("Building your component library..."),await A(z.BuildComponents,q),x.success("Your component library was built successfully");else x.warn("No components found."),x.info("Before you can build components,"),x.info("you need to have created some in the ./components folder.")}async function E(q){if(x.info("Building your component library for production use & npm/CDN distribution..."),D())await A(z.BuildWebComponents,q),x.success("Your Web Component library was built successfully");else x.info("No components found.")}async function K(q){x.info("Building the documentation site..."),await A(z.BuildDocs,q),x.success("Docs built successfully")}async function M(q){x.info("Building the Stacks Framework..."),await A(z.BuildStacks,q),x.success("Stacks built successfully")}async function O(q){if(G())x.info("Building your functions library for production usages..."),x.info("Production usages include: manual npm distribution and/or CDN distribution"),await A(z.BuildFunctions,q),x.success("Functions library built successfully");else x.info("No functions found")}export{E as webComponentLibrary,J as vueComponentLibrary,M as stacks,H as invoke,O as functionsLibrary,K as docs,I as componentLibraries,W as build};
2
+ import{Ya as B}from"./chunk-dxvgx0r7.js";import"./chunk-h10aj7jf.js";import"./chunk-wtnp31q5.js";import"./chunk-s735m9mg.js";import"./chunk-8kvzjd10.js";import"./chunk-v0hqskdk.js";import{NpmScript as z}from"@stacksjs/enums";import{log as x}from"@stacksjs/logging";import{hasComponents as D,hasFunctions as G}from"@stacksjs/storage";import{runNpmScript as A}from"@stacksjs/utils";async function H(q){if(q.components)await I(q);else if(q.webComponents||q.elements)await E(q);else if(q.functions)await O(q);else if(q.docs)await K(q);else if(q.stacks)await M(q);await B()}async function W(q){return await H(q)}async function I(q){await A(z.GenerateEntries,q),await J(q),await E(q)}async function J(q){if(D())x.info("Building your component library..."),await A(z.BuildComponents,q),x.success("Your component library was built successfully");else x.warn("No components found."),x.info("Before you can build components,"),x.info("you need to have created some in the ./components folder.")}async function E(q){if(x.info("Building your component library for production use & npm/CDN distribution..."),D())await A(z.BuildWebComponents,q),x.success("Your Web Component library was built successfully");else x.info("No components found.")}async function K(q){x.info("Building the documentation site..."),await A(z.BuildDocs,q),x.success("Docs built successfully")}async function M(q){x.info("Building the Stacks Framework..."),await A(z.BuildStacks,q),x.success("Stacks built successfully")}async function O(q){if(G())x.info("Building your functions library for production usages..."),x.info("Production usages include: manual npm distribution and/or CDN distribution"),await A(z.BuildFunctions,q),x.success("Functions library built successfully");else x.info("No functions found")}export{E as webComponentLibrary,J as vueComponentLibrary,M as stacks,H as invoke,O as functionsLibrary,K as docs,I as componentLibraries,W as build};
package/dist/bump.d.ts CHANGED
@@ -1 +1 @@
1
-
1
+ export {};
package/dist/bump.js CHANGED
@@ -1,3 +1,8 @@
1
+ #!/usr/bin/env bun
1
2
  // @bun
2
- import{execSync as y,log as W,parseOptions as C,runCommand as h}from"@stacksjs/cli";import{path as I}from"@stacksjs/path";import{existsSync as x,readFileSync as O,writeFileSync as k}from"fs";import{join as v,relative as f}from"path";var $=C(),B=new Set(["patch","minor","major","prepatch","preminor","premajor","prerelease"]),N=$?.bump?.toString(),D=N?B.has(N)||/^\d+\.\d+\.\d+(?:-[\w.]+)?$/.test(N)?N:null:null;if(N&&!D)W.warn(`Ignoring invalid --bump "${N}"; expected one of patch|minor|major or x.y.z`);async function F(q){if(!q||/^\d+\.\d+\.\d+(?:-[\w.]+)?$/.test(q))return q;if(!["patch","minor","major"].includes(q))return q;let z=(await Bun.file(I.frameworkPath("core/package.json")).json()).version?.match(/^(\d+)\.(\d+)\.(\d+)$/);if(!z)return q;let[,G,H,K]=z.map(Number);if(q==="major")return`${G+1}.0.0`;if(q==="minor")return`${G}.${H+1}.0`;return`${G}.${H}.${K+1}`}var Q=await F(D),X=$?.dryRun===!0;async function S(q,E){let z=await h(q,E);if(z.isErr)throw z.error}async function L(q,E=I.projectPath()){return await y(["git",...q],{cwd:E,stdin:"inherit"})}async function w(){let q=await Bun.file(I.frameworkPath("core/package.json")).json();if(!q.version||!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(q.version))throw Error(`Invalid framework version in package.json: ${q.version??"<missing>"}`);return q.version}var R=I.projectPath("buddy"),J=I.frameworkPath("core");async function Z(q,E){let z=new Bun.Glob(q),G=[];for await(let H of z.scan({cwd:E,absolute:!0,onlyFiles:!0})){if(H.includes("/node_modules/")||H.includes("/dist/")||H.includes("/pantry/"))continue;G.push(`./${f(J,H)}`)}return G}async function c(q){let E=[];for(let z of q){let G=v(J,z);if(await Bun.file(G).exists())E.push(z)}return E}var b=new Set([...await Z("package.json",J),...await Z("*/package.json",J),...await Z("*/*/package.json",J),...await c(["../package.json","../defaults/ide/vscode/package.json","../api/package.json","../cloud/package.json","../docs/package.json","../orm/package.json","../server/package.json"]),...await Z("../libs/**/package.json",J)]),V=Array.from(b).join(","),_=["--no-commit","--no-tag","--no-push","--no-recursive","--no-changelog"];if(X)_.push("--dry-run");if(Q)_.push("--yes");if($?.verbose)_.push("--verbose");var P=`bunx --bun bumpx ${Q?`${Q} `:""}--files ${V} ${_.join(" ")}`;W.debug(`Running: ${P}`);W.debug(`Bumping ${V.split(",").filter(Boolean).length} package manifest(s)`);W.debug(`In frameworkPath: ${I.frameworkPath()}`);await S(P,{cwd:J,stdin:"inherit"});var j=(await L(["describe","--abbrev=0","--tags"])).trim(),U=X&&Q&&/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(Q)?Q:await w(),g=X?`${R} changelog --quiet --dry-run --from ${j} --to HEAD --version ${U}`:`${R} changelog --quiet --from ${j} --to HEAD --version ${U}`;await S(g,{cwd:I.projectPath(),stdin:"inherit"});if(!X)d(U);function d(q){let E=I.frameworkPath("core/package.json"),z=JSON.parse(O(E,"utf-8")),G=0;for(let H of["dependencies","devDependencies"]){let K=z[H];if(!K)continue;for(let Y of Object.keys(K)){if(!Y.startsWith("@stacksjs/"))continue;let A=Y.slice(10),M=I.frameworkPath(`core/${A}/package.json`);if(!x(M))continue;if(JSON.parse(O(M,"utf-8")).version!==q)continue;let T=`^${q}`;if(K[Y]!==T)K[Y]=T,G++}}if(G>0)k(E,`${JSON.stringify(z,null,2)}
3
- `),W.debug(`Pinned ${G} lockstep core dep(s) in the stacks meta to ^${q}`)}if(!X)await L(["add","--all"]),await L(["commit","-m",`chore: release v${U}`]),await L(["tag",`v${U}`]),await L(["push"]),await L(["push","origin",`v${U}`]);
3
+ import{execSync as y,log as Y,parseOptions as x}from"@stacksjs/cli";import{path as I}from"@stacksjs/path";import{versionBump as F}from"@stacksjs/bumpx";import{generateChangelog as h,loadLogsmithConfig as f}from"@stacksjs/logsmith";import{existsSync as L,readFileSync as O,writeFileSync as A}from"fs";import{join as k,relative as w}from"path";var T=x(),b=new Set(["patch","minor","major","prepatch","preminor","premajor","prerelease"]),U=T?.bump?.toString(),V=U?b.has(U)||/^\d+\.\d+\.\d+(?:-[\w.]+)?$/.test(U)?U:null:null;if(U&&!V)Y.warn(`Ignoring invalid --bump "${U}"; expected one of patch|minor|major or x.y.z`);var W=T?.dryRun===!0,R=T?.verbose===!0;async function M(q){if(!L(q))return;return await Bun.file(q).json()}var S=I.projectPath("package.json"),C=await M(S),Z=C?.name==="stacks"&&L(I.frameworkPath("core/package.json")),K=Z?I.frameworkPath("core"):I.projectPath(),B=Z?I.frameworkPath("core/package.json"):S;async function d(q){if(!q||/^\d+\.\d+\.\d+(?:-[\w.]+)?$/.test(q))return q;if(!["patch","minor","major"].includes(q))return q;let G=(await M(B))?.version?.match(/^(\d+)\.(\d+)\.(\d+)$/);if(!G)return q;let z=Number(G[1]),H=Number(G[2]),J=Number(G[3]);if(q==="major")return`${z+1}.0.0`;if(q==="minor")return`${z}.${H+1}.0`;return`${z}.${H}.${J+1}`}var X=await d(V);async function Q(q,E=I.projectPath()){return await y(["git",...q],{cwd:E,stdin:"inherit"})}async function c(q){let E=await M(q);if(!E?.version||!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(E.version))throw Error(`Invalid version in ${q}: ${E?.version??"<missing>"}`);return E.version}async function $(q,E){let G=new Bun.Glob(q),z=[];for await(let H of G.scan({cwd:E,absolute:!0,onlyFiles:!0})){if(H.includes("/node_modules/")||H.includes("/dist/")||H.includes("/pantry/"))continue;z.push(`./${w(K,H)}`)}return z}async function u(q){let E=[];for(let G of q){let z=k(K,G);if(await Bun.file(z).exists())E.push(G)}return E}async function g(){return Array.from(new Set([...await $("package.json",K),...await $("*/package.json",K),...await $("*/*/package.json",K),...await u(["../package.json","../defaults/ide/vscode/package.json","../api/package.json","../cloud/package.json","../docs/package.json","../orm/package.json","../server/package.json"]),...await $("../libs/**/package.json",K)]))}var v=Z?await g():["./package.json"];Y.debug(`Release mode: ${Z?"framework monorepo":"consumer app"} (${C?.name??"unknown"})`);Y.debug(`Bumping ${v.length} package manifest(s) in ${K}`);await F({release:X??void 0,files:v,cwd:K,recursive:!1,commit:!1,tag:!1,push:!1,changelog:!1,noGitCheck:!0,dryRun:W,yes:Boolean(X),verbose:R});var N=W&&X&&/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(X)?X:await c(B),l=(await Q(["describe","--abbrev=0","--tags"]).catch(()=>"")).trim();async function m(){let q=await f({dir:I.projectPath(),from:l||void 0,to:"HEAD",output:W?!1:"CHANGELOG.md",theme:"github",verbose:R}),E=await h(q);if(W){Y.info(E.content);return}let G=I.projectPath("CHANGELOG.md");if(!L(G))return;let z=O(G,"utf-8"),H=new RegExp(`\\bv?${N.replace(/\./g,"\\.")}\\b`);if(/\/compare\/[^)\s]+\.\.\.HEAD\)/.test(z))z=z.replace(/(\/compare\/[^)\s]+\.\.\.)HEAD(\))/,`$1v${N}$2`);else if(!H.test(z.split(`
4
+ `).slice(0,4).join(`
5
+ `)))z=z.replace(/^(#\s.*\n+)?/,(J)=>`${J??""}## v${N}
6
+
7
+ `);A(G,z)}await m();if(!W&&Z)p(N);function p(q){let E=I.frameworkPath("core/package.json"),G=JSON.parse(O(E,"utf-8")),z=0;for(let H of["dependencies","devDependencies"]){let J=G[H];if(!J)continue;for(let _ of Object.keys(J)){if(!_.startsWith("@stacksjs/"))continue;let P=_.slice(10),D=I.frameworkPath(`core/${P}/package.json`);if(!L(D))continue;if(JSON.parse(O(D,"utf-8")).version!==q)continue;let j=`^${q}`;if(J[_]!==j)J[_]=j,z++}}if(z>0)A(E,`${JSON.stringify(G,null,2)}
8
+ `),Y.debug(`Pinned ${z} lockstep core dep(s) in the stacks meta to ^${q}`)}if(!W)await Q(["add","--all"]),await Q(["commit","-m",`chore: release v${N}`]),await Q(["tag",`v${N}`]),await Q(["push"]),await Q(["push","origin",`v${N}`]);
@@ -1,4 +1,3 @@
1
- declare const version: unknown;
2
1
  type ChangelogOptions = {
3
2
  dryRun?: boolean
4
3
  quiet?: boolean
package/dist/changelog.js CHANGED
@@ -1,2 +1,3 @@
1
+ #!/usr/bin/env bun
1
2
  // @bun
2
- import{execSync as J,log as B,parseOptions as L,runCommand as M}from"@stacksjs/cli";import{projectPath as N}from"@stacksjs/path";var K=(D)=>{let A=D.trim();if(!/^[A-Za-z0-9._/-]+$/.test(A))throw Error(`Invalid git revision: ${A}`);return A},Q=(D)=>{let A=D.trim().replace(/^v/,"");if(!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(A))throw Error(`Invalid changelog version: ${A}`);return A};B.debug("Generating changelog");var q=L(),E=K(q?.from?.toString()??await J("git describe --abbrev=0 --tags HEAD^"));B.debug("FromRevision",E);var G=K(q?.to?.toString()??await J("git describe"));B.debug("ToRevision",G);B.debug("Changelog Options",q);var H=q?.version??q?.r,I=H?` -r ${Q(H.toString())}`:"",T=q?.dryRun?`bunx --bun changelogen --no-output --from ${E} --to ${G}${I}`:`bunx --bun changelogen --output CHANGELOG.md --from ${E} --to ${G}${I}`;await M(T,{cwd:N(),quiet:q?.quiet,verbose:q?.verbose});
3
+ import{execSync as I,log as q,parseOptions as J}from"@stacksjs/cli";import{projectPath as K}from"@stacksjs/path";import{generateChangelog as M,loadLogsmithConfig as N}from"@stacksjs/logsmith";var B=(H)=>{let A=H.trim();if(!/^[A-Za-z0-9._/-]+$/.test(A))throw Error(`Invalid git revision: ${A}`);return A};q.debug("Generating changelog");var b=J(),E=B(b?.from?.toString()??await I("git describe --abbrev=0 --tags HEAD^").catch(()=>""));q.debug("FromRevision",E);var F=B(b?.to?.toString()??"HEAD");q.debug("ToRevision",F);q.debug("Changelog Options",b);if(b?.version??b?.r)q.debug("Ignoring --version: logsmith headers the section from the from\u2026to range");var G=b?.dryRun===!0,Q=await N({dir:K(),from:E||void 0,to:F,output:G?!1:"CHANGELOG.md",theme:"github",verbose:b?.verbose===!0}),T=await M(Q);if(G&&!b?.quiet)q.info(T.content);
@@ -1 +1 @@
1
-
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{sb as L}from"./chunk-h3163h5z.js";import f from"process";import{log as N}from"@stacksjs/cli";import{getErrorMessage as E}from"@stacksjs/utils";async function C(){try{return(await import("./chunk-r3t7shd4.js")).tsCloud||null}catch{return null}}async function b(){let G=await C();return{name:G?.project?.name||"stacks",region:G?.project?.region||"us-east-1"}}async function v(G){try{let{AWSClient:Q}=await import("@stacksjs/ts-cloud"),J=new Q,_=new URLSearchParams({Action:"GetCallerIdentity",Version:"2011-06-15"}),K=await J.request({service:"sts",region:G,method:"POST",path:"/",body:_.toString()}),j=String(K).match(/<Account>(\d+)<\/Account>/);if(j&&j[1])return j[1];return f.env.AWS_ACCOUNT_ID||""}catch(Q){return f.env.AWS_ACCOUNT_ID||""}}async function p(G){let{environment:Q}=G,J=await C();if(!J)throw Error("Cloud configuration not found. Ensure config/cloud.ts exports tsCloud.");let{InfrastructureGenerator:_}=await import("@stacksjs/ts-cloud"),j=new _({config:J,environment:Q}).generate().getBuilder().build();return JSON.stringify(j)}function S(G){let Q={green:"\x1B[32m",yellow:"\x1B[33m",red:"\x1B[31m",cyan:"\x1B[36m",gray:"\x1B[90m",reset:"\x1B[0m"};if(G.includes("COMPLETE")&&!G.includes("ROLLBACK"))return`${Q.green}${G}${Q.reset}`;if(G.includes("IN_PROGRESS"))return`${Q.yellow}${G}${Q.reset}`;if(G.includes("FAILED")||G.includes("ROLLBACK"))return`${Q.red}${G}${Q.reset}`;if(G.includes("DELETE"))return`${Q.gray}${G}${Q.reset}`;return G}async function k(G){let{region:Q,domain:J,sslDomains:_,hostedZoneId:K,albDnsName:j,stackName:Y}=G;console.log(""),console.log("Setting up SSL certificate...");try{let{Route53Client:$,ACMClient:w,AWSClient:F}=await import("@stacksjs/ts-cloud"),P=new $(Q),V=new w(Q),W=new F;console.log(` Requesting SSL certificate for ${J}...`);let Z=await V.requestCertificate({DomainName:_[0]??J,SubjectAlternativeNames:_.length>1?_.slice(1):void 0,ValidationMethod:"DNS"});console.log(` Certificate ARN: ${Z.CertificateArn}`),await new Promise((R)=>setTimeout(R,5000));let U=await V.describeCertificate({CertificateArn:Z.CertificateArn});console.log(" Adding DNS validation records...");for(let R of U.DomainValidationOptions||[])if(R.ResourceRecord)await P.changeResourceRecordSets({HostedZoneId:K,ChangeBatch:{Changes:[{Action:"UPSERT",ResourceRecordSet:{Name:R.ResourceRecord.Name,Type:"CNAME",TTL:300,ResourceRecords:[{Value:R.ResourceRecord.Value}]}}]}});console.log("\u2713 Validation records added"),console.log(" Waiting for certificate validation (this may take 1-5 minutes)...");for(let R=0;R<30;R++){let M=await V.describeCertificate({CertificateArn:Z.CertificateArn});if(M.Status==="ISSUED"){console.log("\u2713 Certificate issued!");let{AWSCloudFormationClient:A}=await import("@stacksjs/ts-cloud"),B=await new A(Q).listStackResources(Y),I=B.StackResourceSummaries.find((O)=>O.LogicalResourceId==="ApplicationLoadBalancer")?.PhysicalResourceId,X=B.StackResourceSummaries.find((O)=>O.LogicalResourceId==="ECSTargetGroup")?.PhysicalResourceId||B.StackResourceSummaries.find((O)=>O.LogicalResourceId==="WebTargetGroup")?.PhysicalResourceId;if(I&&X){console.log(" Creating HTTPS listener...");let O=new URLSearchParams({Action:"CreateListener",LoadBalancerArn:I,Protocol:"HTTPS",Port:"443","Certificates.member.1.CertificateArn":Z.CertificateArn,"DefaultActions.member.1.Type":"forward","DefaultActions.member.1.TargetGroupArn":X,Version:"2015-12-01"});await W.request({service:"elasticloadbalancing",region:Q,method:"POST",path:"/",body:O.toString()}),console.log("\u2713 HTTPS listener created!"),console.log(" Configuring HTTP to HTTPS redirect...");let h=new URLSearchParams({Action:"DescribeListeners",LoadBalancerArn:I,Version:"2015-12-01"}),H=await W.request({service:"elasticloadbalancing",region:Q,method:"POST",path:"/",body:h.toString()}),x=H?.DescribeListenersResponse?.DescribeListenersResult?.Listeners?.member||H?.DescribeListenersResult?.Listeners?.member,T=(Array.isArray(x)?x:x?[x]:[]).find((D)=>D.Port==="80"||D.Port===80);if(T){let D=new URLSearchParams({Action:"ModifyListener",ListenerArn:T.ListenerArn,"DefaultActions.member.1.Type":"redirect","DefaultActions.member.1.RedirectConfig.Protocol":"HTTPS","DefaultActions.member.1.RedirectConfig.Port":"443","DefaultActions.member.1.RedirectConfig.StatusCode":"HTTP_301",Version:"2015-12-01"});await W.request({service:"elasticloadbalancing",region:Q,method:"POST",path:"/",body:D.toString()}),console.log("\u2713 HTTP to HTTPS redirect configured!")}}let z=B.StackResourceSummaries.find((O)=>O.LogicalResourceId==="CloudFrontDistribution")?.PhysicalResourceId;if(z){console.log(" Updating CloudFront distribution with SSL certificate...");let O=await W.request({service:"cloudfront",region:"us-east-1",method:"GET",path:`/2020-05-31/distribution/${z}/config`}),h=O._headers?.etag||O._headers?.ETag,H=O.DistributionConfig;if(H&&h){H.Aliases={Quantity:_.length,Items:_},H.ViewerCertificate={ACMCertificateArn:Z.CertificateArn,SSLSupportMethod:"sni-only",MinimumProtocolVersion:"TLSv1.2_2021",CloudFrontDefaultCertificate:!1};let x=`<?xml version="1.0" encoding="UTF-8"?>
2
+ import{qb as L}from"./chunk-v0hqskdk.js";import f from"process";import{log as N}from"@stacksjs/cli";import{getErrorMessage as E}from"@stacksjs/utils";async function C(){try{return(await import("./chunk-v1dg1jp6.js")).tsCloud||null}catch{return null}}async function b(){let G=await C();return{name:G?.project?.name||"stacks",region:G?.project?.region||"us-east-1"}}async function v(G){try{let{AWSClient:Q}=await import("@stacksjs/ts-cloud"),J=new Q,_=new URLSearchParams({Action:"GetCallerIdentity",Version:"2011-06-15"}),K=await J.request({service:"sts",region:G,method:"POST",path:"/",body:_.toString()}),j=String(K).match(/<Account>(\d+)<\/Account>/);if(j&&j[1])return j[1];return f.env.AWS_ACCOUNT_ID||""}catch(Q){return f.env.AWS_ACCOUNT_ID||""}}async function p(G){let{environment:Q}=G,J=await C();if(!J)throw Error("Cloud configuration not found. Ensure config/cloud.ts exports tsCloud.");let{InfrastructureGenerator:_}=await import("@stacksjs/ts-cloud"),j=new _({config:J,environment:Q}).generate().getBuilder().build();return JSON.stringify(j)}function S(G){let Q={green:"\x1B[32m",yellow:"\x1B[33m",red:"\x1B[31m",cyan:"\x1B[36m",gray:"\x1B[90m",reset:"\x1B[0m"};if(G.includes("COMPLETE")&&!G.includes("ROLLBACK"))return`${Q.green}${G}${Q.reset}`;if(G.includes("IN_PROGRESS"))return`${Q.yellow}${G}${Q.reset}`;if(G.includes("FAILED")||G.includes("ROLLBACK"))return`${Q.red}${G}${Q.reset}`;if(G.includes("DELETE"))return`${Q.gray}${G}${Q.reset}`;return G}async function k(G){let{region:Q,domain:J,sslDomains:_,hostedZoneId:K,albDnsName:j,stackName:Y}=G;console.log(""),console.log("Setting up SSL certificate...");try{let{Route53Client:$,ACMClient:w,AWSClient:F}=await import("@stacksjs/ts-cloud"),P=new $(Q),V=new w(Q),W=new F;console.log(` Requesting SSL certificate for ${J}...`);let Z=await V.requestCertificate({DomainName:_[0]??J,SubjectAlternativeNames:_.length>1?_.slice(1):void 0,ValidationMethod:"DNS"});console.log(` Certificate ARN: ${Z.CertificateArn}`),await new Promise((R)=>setTimeout(R,5000));let U=await V.describeCertificate({CertificateArn:Z.CertificateArn});console.log(" Adding DNS validation records...");for(let R of U.DomainValidationOptions||[])if(R.ResourceRecord)await P.changeResourceRecordSets({HostedZoneId:K,ChangeBatch:{Changes:[{Action:"UPSERT",ResourceRecordSet:{Name:R.ResourceRecord.Name,Type:"CNAME",TTL:300,ResourceRecords:[{Value:R.ResourceRecord.Value}]}}]}});console.log("\u2713 Validation records added"),console.log(" Waiting for certificate validation (this may take 1-5 minutes)...");for(let R=0;R<30;R++){let M=await V.describeCertificate({CertificateArn:Z.CertificateArn});if(M.Status==="ISSUED"){console.log("\u2713 Certificate issued!");let{AWSCloudFormationClient:A}=await import("@stacksjs/ts-cloud"),B=await new A(Q).listStackResources(Y),I=B.StackResourceSummaries.find((O)=>O.LogicalResourceId==="ApplicationLoadBalancer")?.PhysicalResourceId,X=B.StackResourceSummaries.find((O)=>O.LogicalResourceId==="ECSTargetGroup")?.PhysicalResourceId||B.StackResourceSummaries.find((O)=>O.LogicalResourceId==="WebTargetGroup")?.PhysicalResourceId;if(I&&X){console.log(" Creating HTTPS listener...");let O=new URLSearchParams({Action:"CreateListener",LoadBalancerArn:I,Protocol:"HTTPS",Port:"443","Certificates.member.1.CertificateArn":Z.CertificateArn,"DefaultActions.member.1.Type":"forward","DefaultActions.member.1.TargetGroupArn":X,Version:"2015-12-01"});await W.request({service:"elasticloadbalancing",region:Q,method:"POST",path:"/",body:O.toString()}),console.log("\u2713 HTTPS listener created!"),console.log(" Configuring HTTP to HTTPS redirect...");let h=new URLSearchParams({Action:"DescribeListeners",LoadBalancerArn:I,Version:"2015-12-01"}),H=await W.request({service:"elasticloadbalancing",region:Q,method:"POST",path:"/",body:h.toString()}),x=H?.DescribeListenersResponse?.DescribeListenersResult?.Listeners?.member||H?.DescribeListenersResult?.Listeners?.member,T=(Array.isArray(x)?x:x?[x]:[]).find((D)=>D.Port==="80"||D.Port===80);if(T){let D=new URLSearchParams({Action:"ModifyListener",ListenerArn:T.ListenerArn,"DefaultActions.member.1.Type":"redirect","DefaultActions.member.1.RedirectConfig.Protocol":"HTTPS","DefaultActions.member.1.RedirectConfig.Port":"443","DefaultActions.member.1.RedirectConfig.StatusCode":"HTTP_301",Version:"2015-12-01"});await W.request({service:"elasticloadbalancing",region:Q,method:"POST",path:"/",body:D.toString()}),console.log("\u2713 HTTP to HTTPS redirect configured!")}}let z=B.StackResourceSummaries.find((O)=>O.LogicalResourceId==="CloudFrontDistribution")?.PhysicalResourceId;if(z){console.log(" Updating CloudFront distribution with SSL certificate...");let O=await W.request({service:"cloudfront",region:"us-east-1",method:"GET",path:`/2020-05-31/distribution/${z}/config`}),h=O._headers?.etag||O._headers?.ETag,H=O.DistributionConfig;if(H&&h){H.Aliases={Quantity:_.length,Items:_},H.ViewerCertificate={ACMCertificateArn:Z.CertificateArn,SSLSupportMethod:"sni-only",MinimumProtocolVersion:"TLSv1.2_2021",CloudFrontDefaultCertificate:!1};let x=`<?xml version="1.0" encoding="UTF-8"?>
3
3
  <DistributionConfig xmlns="http://cloudfront.amazonaws.com/doc/2020-05-31/">
4
4
  <CallerReference>${H.CallerReference}</CallerReference>
5
5
  <Aliases>
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{gb as o}from"./chunk-bbd6n9q2.js";import{Action as r}from"@stacksjs/enums";async function v(e){await o(r.Dev,e)}async function s(e){await o(r.Dev,e)}async function a(e){await n(e)}async function n(e){await o(r.DevApi,e)}async function D(e){await o(r.DevComponents,e)}async function p(e){await o(r.DevDashboard,e)}async function c(e){await o(r.DevSystemTray,e)}async function m(e){await o(r.DevDesktop,e)}async function u(e){await o(r.DevDocs,e)}
2
+ import{gb as o}from"./chunk-8kvzjd10.js";import{Action as r}from"@stacksjs/enums";async function v(e){await o(r.Dev,e)}async function s(e){await o(r.Dev,e)}async function a(e){await n(e)}async function n(e){await o(r.DevApi,e)}async function D(e){await o(r.DevComponents,e)}async function p(e){await o(r.DevDashboard,e)}async function c(e){await o(r.DevSystemTray,e)}async function m(e){await o(r.DevDesktop,e)}async function u(e){await o(r.DevDocs,e)}
3
3
  export{v as Ga,s as Ha,a as Ia,n as Ja,D as Ka,p as La,c as Ma,m as Na,u as Oa};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{rb as j,sb as D}from"./chunk-h3163h5z.js";var u={};j(u,{runActions:()=>A,runAction:()=>v,hasAction:()=>S});import{existsSync as W}from"fs";import T from"process";import{buddyOptions as I,runCommand as F,runCommands as N}from"@stacksjs/cli";import{err as X}from"@stacksjs/error-handling";import{log as V}from"@stacksjs/logging";import*as B from"@stacksjs/path";async function x(q){let z=[];z.push(B.actionsPath(`src/${q}.ts`));try{let H=import.meta.resolve("@stacksjs/actions/package.json");if(H){let J=new URL(H).pathname,G=J.slice(0,J.lastIndexOf("/"));z.push(`${G}/dist/${q}.js`),z.push(`${G}/dist/src/${q}.js`),z.push(`${G}/src/${q}.ts`)}}catch{}for(let H of z)if(await Bun.file(H).exists())return H;return null}async function v(q,z){if(V.debug(`[action] Running: ${q}`),q==="dev/views")try{let K=B.projectPath("pantry");if(!T.env.NODE_PATH?.includes(K))T.env.NODE_PATH=T.env.NODE_PATH?`${K}:${T.env.NODE_PATH}`:K,D("module").Module._initPaths?.();let Z=[B.projectPath("storage/framework/core/actions/src/dev/views.ts"),B.frameworkPath("actions/src/dev/views.ts")];for(let Q of Z)if(W(Q))return await import(Q),{ok:!0,value:{}};return X("dev/views entry not found")}catch(K){return X(`Failed to start dev server: ${K}`)}if(!(q.includes("/")||["dev","build","install","upgrade","migrate"].some((K)=>q.startsWith(K)))){let K=new Bun.Glob("**/*.{ts,js}"),Z={cwd:B.userActionsPath(),onlyFiles:!0,absolute:!0},Q=[],b=B.userActionsPath();for await(let L of K.scan(Z)){if(L.replace(`${b}/`,"").replace(/\.(ts|js)$/,"")===q||L.endsWith(`${q}.ts`)||L.endsWith(`${q}.js`))return V.debug(`[action] Resolved: ${q} \u2192 ${L}`),await(await import(L)).default.handle(void 0);Q.push(L)}for(let L of Q)try{let Y=await import(L);if(Y.name===q)return V.debug(`[action] Resolved: ${q} \u2192 ${L}`),await Y.handle()}catch(Y){}}let J=await x(q);if(!J)return X(`Action '${q}' not found in storage/framework/core/actions/src or @stacksjs/actions`);V.debug(`[action] Resolved: ${q} \u2192 ${J}`);let G=q.startsWith("dev/"),M=G?"--watch":"",U=G?"":I(z)||"",w=`bun ${M} ${J} ${U}`.trimEnd(),_=B.projectPath("pantry"),$=T.env.NODE_PATH,C=$?`${_}:${$}`:_,E=z?.verbose||G&&!z?.quiet,O={cwd:z?.cwd||B.projectPath(),...z,stdout:E?"inherit":void 0,stderr:E?"inherit":void 0,env:{...z?.env,NODE_PATH:C,...G?{STACKS_DEV_SERVER:"1"}:{}}},R=await F(w,O);return V.debug(`[action] Completed: ${q}`),R}async function A(q,z){if(!q.length)return X("No actions were specified");for(let M of q)if(!S(M))return X(`The specified action "${M}" does not exist`);let H=I(z)||"",J={cwd:z?.cwd||B.projectPath(),...z},G=q.map((M)=>`bun ${B.relativeActionsPath(`src/${M}.ts`)} ${H}`);return await N(G,J)}function S(q){let z=[`${q}.ts`,`${q}`,`Dashboard/${q}.ts`,`Dashboard/${q}`,`Buddy/${q}.ts`,`Buddy/${q}`],H=[`src/${q}.ts`,`src/${q}`,`${q}.ts`,`${q}`];return[...z.map((G)=>B.userActionsPath(G)),...H.map((G)=>B.actionsPath(G))].some((G)=>W(G))}
2
+ import{pb as j,qb as D}from"./chunk-v0hqskdk.js";var u={};j(u,{runActions:()=>A,runAction:()=>v,hasAction:()=>S});import{existsSync as W}from"fs";import T from"process";import{buddyOptions as I,runCommand as F,runCommands as N}from"@stacksjs/cli";import{err as X}from"@stacksjs/error-handling";import{log as V}from"@stacksjs/logging";import*as B from"@stacksjs/path";async function x(q){let z=[];z.push(B.actionsPath(`src/${q}.ts`));try{let H=import.meta.resolve("@stacksjs/actions/package.json");if(H){let J=new URL(H).pathname,G=J.slice(0,J.lastIndexOf("/"));z.push(`${G}/dist/${q}.js`),z.push(`${G}/dist/src/${q}.js`),z.push(`${G}/src/${q}.ts`)}}catch{}for(let H of z)if(await Bun.file(H).exists())return H;return null}async function v(q,z){if(V.debug(`[action] Running: ${q}`),q==="dev/views")try{let K=B.projectPath("pantry");if(!T.env.NODE_PATH?.includes(K))T.env.NODE_PATH=T.env.NODE_PATH?`${K}:${T.env.NODE_PATH}`:K,D("module").Module._initPaths?.();let Z=[B.projectPath("storage/framework/core/actions/src/dev/views.ts"),B.frameworkPath("actions/src/dev/views.ts")];for(let Q of Z)if(W(Q))return await import(Q),{ok:!0,value:{}};return X("dev/views entry not found")}catch(K){return X(`Failed to start dev server: ${K}`)}if(!(q.includes("/")||["dev","build","install","upgrade","migrate"].some((K)=>q.startsWith(K)))){let K=new Bun.Glob("**/*.{ts,js}"),Z={cwd:B.userActionsPath(),onlyFiles:!0,absolute:!0},Q=[],b=B.userActionsPath();for await(let L of K.scan(Z)){if(L.replace(`${b}/`,"").replace(/\.(ts|js)$/,"")===q||L.endsWith(`${q}.ts`)||L.endsWith(`${q}.js`))return V.debug(`[action] Resolved: ${q} \u2192 ${L}`),await(await import(L)).default.handle(void 0);Q.push(L)}for(let L of Q)try{let Y=await import(L);if(Y.name===q)return V.debug(`[action] Resolved: ${q} \u2192 ${L}`),await Y.handle()}catch(Y){}}let J=await x(q);if(!J)return X(`Action '${q}' not found in storage/framework/core/actions/src or @stacksjs/actions`);V.debug(`[action] Resolved: ${q} \u2192 ${J}`);let G=q.startsWith("dev/"),M=G?"--watch":"",U=G?"":I(z)||"",w=`bun ${M} ${J} ${U}`.trimEnd(),_=B.projectPath("pantry"),$=T.env.NODE_PATH,C=$?`${_}:${$}`:_,E=z?.verbose||G&&!z?.quiet,O={cwd:z?.cwd||B.projectPath(),...z,stdout:E?"inherit":void 0,stderr:E?"inherit":void 0,env:{...z?.env,NODE_PATH:C,...G?{STACKS_DEV_SERVER:"1"}:{}}},R=await F(w,O);return V.debug(`[action] Completed: ${q}`),R}async function A(q,z){if(!q.length)return X("No actions were specified");for(let M of q)if(!S(M))return X(`The specified action "${M}" does not exist`);let H=I(z)||"",J={cwd:z?.cwd||B.projectPath(),...z},G=q.map((M)=>`bun ${B.relativeActionsPath(`src/${M}.ts`)} ${H}`);return await N(G,J)}function S(q){let z=[`${q}.ts`,`${q}`,`Dashboard/${q}.ts`,`Dashboard/${q}`,`Buddy/${q}.ts`,`Buddy/${q}`],H=[`src/${q}.ts`,`src/${q}`,`${q}.ts`,`${q}`];return[...z.map((G)=>B.userActionsPath(G)),...H.map((G)=>B.actionsPath(G))].some((G)=>W(G))}
3
3
  export{v as gb,A as hb,S as ib,u as jb};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{cb as z}from"./chunk-h10aj7jf.js";import{gb as U}from"./chunk-bbd6n9q2.js";import{sb as O}from"./chunk-h3163h5z.js";import*as Q from"fs";import R from"process";import{runCommand as b}from"@stacksjs/cli";import{Action as Y,NpmScript as H}from"@stacksjs/enums";import{log as B}from"@stacksjs/logging";import{frameworkPath as I,projectPath as K,storagePath as D}from"@stacksjs/path";import{ExitCode as X}from"@stacksjs/types";import{runNpmScript as M}from"@stacksjs/utils";async function T(q){if(q?.types)await W(q);else if(q?.entries)await V(q);else if(q?.webTypes)await v(q);else if(q?.customData)await y();else if(q?.ideHelpers)await E(q);else if(q?.componentMeta)await N();else if(q?.coreSymlink)await x();else if(q?.openApiSpec)await S()}function u(q){return T(q)}async function V(q){let F=await U(Y.GenerateLibraryEntries,{...q,cwd:K()});if(F.isErr)B.error("There was an error generating your library entry points",F.error),R.exit(X.FatalError);B.success("Library entry points generated successfully")}async function v(q){let F=await M(H.GenerateWebTypes,q);if(F.isErr)B.error("There was an error generating the web-types.json file.",F.error),R.exit(X.FatalError);B.success("Successfully generated the web-types.json file")}async function y(){let q=await z();if(q.isErr)B.error("There was an error generating the custom-elements.json file.",q.error),R.exit(X.FatalError);await U(Y.LintFix,{verbose:!0,cwd:K()}),B.success("Successfully generated the custom-elements.json file")}async function E(q){let F=await M(H.GenerateIdeHelpers,q);if(F.isErr)B.error("There was an error generating IDE helpers.",F.error),R.exit(X.FatalError);await U(Y.LintFix,{verbose:!0,cwd:K()}),B.success("Successfully generated IDE helpers")}async function N(){let q=await z();if(q.isErr)B.error("There was an error generating your component meta information.",q.error),R.exit(X.FatalError);await U(Y.LintFix,{verbose:!0,cwd:K()}),B.success("Successfully generated component meta information")}async function W(q){let F=await M(H.GenerateTypes,{cwd:I(),...q});if(F.isErr)throw B.error("There was an error generating your types.",F.error),F.error instanceof Error?F.error:Error(String(F.error));B.success("Types were generated successfully")}async function c(q){try{let G=`${I()}/package.json`,J=Q.existsSync(G)?Q.readFileSync(G,"utf-8"):"";if(!(J?JSON.parse(J):{})?.scripts?.["generate:types"]){B.warn("[generate:types --watch] no `generate:types` script in framework package.json \u2014 type regeneration disabled. dev:api will keep running, but type definitions won't auto-refresh on model/config changes.");return}}catch{}let F=[K("app/Models"),D("framework/defaults/app/Models"),K("config"),K("database/migrations")];B.info(`[generate:types --watch] watching ${F.length} directories`);let Z=null,_=!1,L=()=>{if(Z)clearTimeout(Z);Z=setTimeout(async()=>{if(_)return;_=!0;try{B.info("[generate:types --watch] change detected, regenerating\u2026"),await W(q),B.success("[generate:types --watch] types up to date")}catch(G){B.error("[generate:types --watch] regeneration failed:",G)}finally{_=!1}},200)},$=[];for(let G of F)try{if(!Q.existsSync(G))continue;let J=Q.watch(G,{recursive:!0},()=>L());$.push(J)}catch(J){B.warn(`[generate:types --watch] cannot watch ${G}: ${J}`)}if($.length===0){B.warn("[generate:types --watch] no directories to watch \u2014 exiting");return}await new Promise((G)=>{R.once("SIGINT",()=>{B.info("[generate:types --watch] stopping");for(let J of $)try{J.close()}catch{}G()})})}function g(){B.success("Successfully generated `./pantry.yaml` based on your config")}async function l(){}async function x(){await b(`ln -s ${I()} ${K(".stacks")}`)}async function S(){let{generateOpenApi:q}=await import("@stacksjs/api");await q(),B.success("Successfully generated Open API Spec")}
2
+ import{cb as z}from"./chunk-h10aj7jf.js";import{gb as U}from"./chunk-8kvzjd10.js";import{qb as O}from"./chunk-v0hqskdk.js";import*as Q from"fs";import R from"process";import{runCommand as b}from"@stacksjs/cli";import{Action as Y,NpmScript as H}from"@stacksjs/enums";import{log as B}from"@stacksjs/logging";import{frameworkPath as I,projectPath as K,storagePath as D}from"@stacksjs/path";import{ExitCode as X}from"@stacksjs/types";import{runNpmScript as M}from"@stacksjs/utils";async function T(q){if(q?.types)await W(q);else if(q?.entries)await V(q);else if(q?.webTypes)await v(q);else if(q?.customData)await y();else if(q?.ideHelpers)await E(q);else if(q?.componentMeta)await N();else if(q?.coreSymlink)await x();else if(q?.openApiSpec)await S()}function u(q){return T(q)}async function V(q){let F=await U(Y.GenerateLibraryEntries,{...q,cwd:K()});if(F.isErr)B.error("There was an error generating your library entry points",F.error),R.exit(X.FatalError);B.success("Library entry points generated successfully")}async function v(q){let F=await M(H.GenerateWebTypes,q);if(F.isErr)B.error("There was an error generating the web-types.json file.",F.error),R.exit(X.FatalError);B.success("Successfully generated the web-types.json file")}async function y(){let q=await z();if(q.isErr)B.error("There was an error generating the custom-elements.json file.",q.error),R.exit(X.FatalError);await U(Y.LintFix,{verbose:!0,cwd:K()}),B.success("Successfully generated the custom-elements.json file")}async function E(q){let F=await M(H.GenerateIdeHelpers,q);if(F.isErr)B.error("There was an error generating IDE helpers.",F.error),R.exit(X.FatalError);await U(Y.LintFix,{verbose:!0,cwd:K()}),B.success("Successfully generated IDE helpers")}async function N(){let q=await z();if(q.isErr)B.error("There was an error generating your component meta information.",q.error),R.exit(X.FatalError);await U(Y.LintFix,{verbose:!0,cwd:K()}),B.success("Successfully generated component meta information")}async function W(q){let F=await M(H.GenerateTypes,{cwd:I(),...q});if(F.isErr)throw B.error("There was an error generating your types.",F.error),F.error instanceof Error?F.error:Error(String(F.error));B.success("Types were generated successfully")}async function c(q){try{let G=`${I()}/package.json`,J=Q.existsSync(G)?Q.readFileSync(G,"utf-8"):"";if(!(J?JSON.parse(J):{})?.scripts?.["generate:types"]){B.warn("[generate:types --watch] no `generate:types` script in framework package.json \u2014 type regeneration disabled. dev:api will keep running, but type definitions won't auto-refresh on model/config changes.");return}}catch{}let F=[K("app/Models"),D("framework/defaults/app/Models"),K("config"),K("database/migrations")];B.info(`[generate:types --watch] watching ${F.length} directories`);let Z=null,_=!1,L=()=>{if(Z)clearTimeout(Z);Z=setTimeout(async()=>{if(_)return;_=!0;try{B.info("[generate:types --watch] change detected, regenerating\u2026"),await W(q),B.success("[generate:types --watch] types up to date")}catch(G){B.error("[generate:types --watch] regeneration failed:",G)}finally{_=!1}},200)},$=[];for(let G of F)try{if(!Q.existsSync(G))continue;let J=Q.watch(G,{recursive:!0},()=>L());$.push(J)}catch(J){B.warn(`[generate:types --watch] cannot watch ${G}: ${J}`)}if($.length===0){B.warn("[generate:types --watch] no directories to watch \u2014 exiting");return}await new Promise((G)=>{R.once("SIGINT",()=>{B.info("[generate:types --watch] stopping");for(let J of $)try{J.close()}catch{}G()})})}function g(){B.success("Successfully generated `./pantry.yaml` based on your config")}async function l(){}async function x(){await b(`ln -s ${I()} ${K(".stacks")}`)}async function S(){let{generateOpenApi:q}=await import("@stacksjs/api");await q(),B.success("Successfully generated Open API Spec")}
3
3
  export{T as Ra,u as Sa,V as Ta,v as Ua,y as Va,E as Wa,N as Xa,W as Ya,c as Za,g as _a,l as $a,x as ab,S as bb};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{a as b,b as v}from"./chunk-dbz9dp2h.js";import"./chunk-xg9xscqz.js";import"./chunk-h3163h5z.js";import T from"fs";import $ from"path";import _ from"fs";import G from"path";import q from"path";import x from"fs";import L from"path";import N from"fs";import C from"path";function w(I,B){let J=["// Auto-generated by STX - do not edit",'declare module "stx/routes" {'," interface RouteMap {"];for(let K of I){let O=[];for(let V of K.params){let Y=K.pattern.includes(`:${V}*`)?"string[]":"string";O.push(`${V}: ${Y}`)}let W=O.join("; ");J.push(` '${K.pattern}': { ${W} }`)}J.push(" }","}",""),_.mkdirSync(B,{recursive:!0}),_.writeFileSync(G.join(B,"route-types.d.ts"),J.join(`
2
+ import{a as b,b as v}from"./chunk-dbz9dp2h.js";import"./chunk-xg9xscqz.js";import"./chunk-v0hqskdk.js";import T from"fs";import $ from"path";import _ from"fs";import G from"path";import q from"path";import x from"fs";import L from"path";import N from"fs";import C from"path";function w(I,B){let J=["// Auto-generated by STX - do not edit",'declare module "stx/routes" {'," interface RouteMap {"];for(let K of I){let O=[];for(let V of K.params){let Y=K.pattern.includes(`:${V}*`)?"string[]":"string";O.push(`${V}: ${Y}`)}let W=O.join("; ");J.push(` '${K.pattern}': { ${W} }`)}J.push(" }","}",""),_.mkdirSync(B,{recursive:!0}),_.writeFileSync(G.join(B,"route-types.d.ts"),J.join(`
3
3
  `))}function D(I,B,J){let K=process.cwd(),O=G.relative(K,J),W=["components","layouts","partials"],V=I.filter((X)=>!W.some((Z)=>X.pattern.startsWith(`/${Z}/`)||X.pattern===`/${Z}`)),Y=["// Auto-generated by stx \u2014 do not edit",`// Source: ${O||"pages"}/`,"","export const routes = ["];for(let X of V){let Z=G.relative(K,X.filePath).replace(/\\/g,"/"),z=JSON.stringify(X.params),j=X.layout?`, layout: '${G.relative(K,X.layout).replace(/\\/g,"/")}'`:"";Y.push(` { pattern: '${X.pattern}', filePath: '${Z}', isDynamic: ${X.isDynamic}, params: ${z}${j} },`)}Y.push("] as const",""),Y.push("export type RouteName = typeof routes[number]['pattern']",""),_.mkdirSync(B,{recursive:!0}),_.writeFileSync(G.join(B,"routes.ts"),Y.join(`
4
4
  `))}function P(I,B){let K=q.relative(B,I).replace(/\.(stx|md)$/,"");if(K=K.split(q.sep).join("/"),K==="index")return"/";if(K.endsWith("/index"))K=K.slice(0,-6);return K=K.replace(/\[\[([^\]]+)\]\]/g,":$1?"),K=K.replace(/\[([^\]]+)\]/g,":$1"),K=K.replace(/:\.\.\.([^/]+)/g,":$1*"),`/${K}`}function k(I){let B=[],J=I.replace(/[.+^${}()|[\]\\]/g,"\\$&");return J=J.replace(/\/:([^/]+)\?/g,(K,O)=>{return B.push(O),"(?:/([^/]+))?"}),J=J.replace(/:([^/]+)\*/g,(K,O)=>{return B.push(O),"(.+)"}),J=J.replace(/:([^/]+)/g,(K,O)=>{return B.push(O),"([^/]+)"}),J=`^${J}$`,{regex:new RegExp(J),params:B}}function o(I,B){let J=I===""?"/":I;for(let K of B){let O=J.match(K.regex);if(O){let W={};return K.params.forEach((V,Y)=>{W[V]=O[Y+1]}),{route:K,params:W}}}return null}function y(I,B){let J=[],K=L.dirname(I);while(K.startsWith(B)||K===B){let O=L.join(K,"_layout.stx");if(x.existsSync(O))J.unshift(O);if(K===B)break;K=L.dirname(K)}return J}function R(I,B){let J=[];if(!T.existsSync(I))return J;let K=T.readdirSync(I,{withFileTypes:!0});for(let O of K){let W=$.join(I,O.name);if(O.isDirectory()){if(O.name.startsWith("."))continue;J.push(...R(W,B))}else if(O.isFile()){let V=$.extname(O.name);if(B.includes(V)){if(O.name.startsWith("_")&&O.name!=="_layout.stx")continue;if(O.name==="_layout.stx")continue;J.push(W)}}}return J}class S{routes;pagesDir;pagesDirs;config;constructor(I,B={}){this.config=B;let J=B.pagesDirs&&B.pagesDirs.length>0?B.pagesDirs:[B.pagesDir||"pages"];this.pagesDirs=J.map((V)=>$.resolve(I,V)),this.pagesDir=this.pagesDirs[0];let K=B.extensions||[".stx"],O=new Set;this.routes=[];for(let V of this.pagesDirs){let Y=R(V,K);for(let X of Y){let Z=P(X,V);if(O.has(Z))continue;O.add(Z);let{regex:z,params:j}=k(Z),F=B.layouts!==!1?y(X,V):[];this.routes.push({pattern:Z,regex:z,params:j,filePath:X,isDynamic:j.length>0,layout:F.length>0?F[F.length-1]:void 0})}}this.routes.sort((V,Y)=>{if(!V.isDynamic&&Y.isDynamic)return-1;if(V.isDynamic&&!Y.isDynamic)return 1;let X=V.pattern.split("/").length,Z=Y.pattern.split("/").length;if(X!==Z)return Z-X;return V.pattern.localeCompare(Y.pattern)});let W=$.join(I,".stx");w(this.routes,W),D(this.routes,W,this.pagesDir)}match(I){let B=I===""?"/":I;for(let J of this.routes){let K=B.match(J.regex);if(K){let O={};return J.params.forEach((W,V)=>{O[W]=K[V+1]}),{route:J,params:O}}}return null}resolve(I,B){let J=this.routes.find((O)=>O.pattern===I||O.filePath.includes(I));if(!J)return"#not-found";let K=J.pattern;if(B)for(let[O,W]of Object.entries(B))K=K.replace(`:${O}`,encodeURIComponent(W));return K}addRoute(I){this.routes.push(I),this.routes.sort((B,J)=>{if(!B.isDynamic&&J.isDynamic)return-1;if(B.isDynamic&&!J.isDynamic)return 1;return B.pattern.localeCompare(J.pattern)})}getLayout(I){return I.layout??null}}function a(I,B){return new S(I,B)}function e(I,B){let J=[`${B}.stx`,"error.stx"];for(let K of J){let O=$.join(I,K);if(T.existsSync(O))return O}return null}function BB(I,B){return I.map((J)=>{let K=$.relative(B,J.filePath),O=J.isDynamic?" (dynamic)":"";return`${J.pattern} \u2192 ${K}${O}`})}var A={},E="";function IB(I){E=I.replace(/\/$/,"")}function JB(I,B,J={}){A[I]={path:B,name:I,params:J}}function KB(I){for(let[B,J]of Object.entries(I))if(typeof J==="string")A[B]={path:J,name:B};else A[B]={...J,name:B}}function OB(I,B={},J=!1){let K=A[I];if(!K)return console.warn(`Route [${I}] not defined.`),"#undefined-route";let O={...K.params,...B},W=K.path;W=W.replace(/:(\w+)/g,(Y,X)=>{let Z=O[X];if(Z===void 0)return console.warn(`Missing parameter [${X}] for route [${I}].`),`:${X}`;return delete O[X],encodeURIComponent(String(Z))});let V=Object.entries(O);if(V.length>0){let Y=V.map(([X,Z])=>`${encodeURIComponent(X)}=${encodeURIComponent(String(Z))}`).join("&");W+=(W.includes("?")?"&":"?")+Y}return J&&E?`${E}${W}`:W}function VB(){for(let I of Object.keys(A))delete A[I];E=""}function YB(I,B={}){return{type:"redirect",path:I,options:{replace:B.replace??!1,external:B.external??!1,redirectCode:B.redirectCode??302}}}function ZB(I){return{type:"abort",error:typeof I==="string"?{statusCode:500,message:I}:I}}function $B(I,B={}){return{handler:I,mode:B.mode??"universal"}}function H(I){let B={};if(!I)return B;let J=I.split(";");for(let K of J){let[O,...W]=K.split("=");if(O){let V=O.trim(),Y=W.join("=").trim();if(V)B[V]=decodeURIComponent(Y)}}return B}function U(I,B,J={}){let K=`${encodeURIComponent(I)}=${encodeURIComponent(B)}`;if(J.expires){let O=typeof J.expires==="number"?new Date(Date.now()+J.expires*1000):J.expires;K+=`; Expires=${O.toUTCString()}`}if(J.path)K+=`; Path=${J.path}`;if(J.domain)K+=`; Domain=${J.domain}`;if(J.secure)K+="; Secure";if(J.httpOnly)K+="; HttpOnly";if(J.sameSite)K+=`; SameSite=${J.sameSite}`;return K}function f(I,B){let J=I.headers.get("cookie")||"",K=H(J);return{get(O){return K[O]},set(O,W,V={}){K[O]=W,B.append("Set-Cookie",U(O,W,V))},delete(O){delete K[O],B.append("Set-Cookie",U(O,"",{expires:new Date(0),path:"/"}))},getAll(){return{...K}}}}function g(){return{get(I){if(typeof document>"u")return;return H(document.cookie)[I]},set(I,B,J={}){if(typeof document>"u")return;document.cookie=U(I,B,J)},delete(I){if(typeof document>"u")return;document.cookie=U(I,"",{expires:new Date(0),path:"/"})},getAll(){if(typeof document>"u")return{};return H(document.cookie)}}}function h(){let I=typeof window<"u"&&typeof window.localStorage<"u";return{get(B){if(!I)return null;try{return window.localStorage.getItem(B)}catch{return null}},set(B,J){if(!I)return;try{window.localStorage.setItem(B,J)}catch{}},remove(B){if(!I)return;try{window.localStorage.removeItem(B)}catch{}},isAvailable(){return I}}}var Q=new Map;function M(I,B){Q.set(I,B)}function c(I){return Q.get(I)}function AB(I){return Q.has(I)}function GB(){Q.clear()}function QB(){return Array.from(Q.keys())}async function jB(I,B="middleware"){let J=C.resolve(I,B);if(!N.existsSync(J))return;let K=N.readdirSync(J);for(let O of K){if(!O.endsWith(".ts")&&!O.endsWith(".js"))continue;if(O.includes(".test.")||O.includes(".spec."))continue;let W=O.replace(/\.(ts|js)$/,""),V=C.join(J,O);try{let X=(await import(V)).default;if(X&&typeof X.handler==="function")M(W,X);else if(typeof X==="function")M(W,{handler:X,mode:"universal"})}catch(Y){console.warn(`Failed to load middleware '${W}' from ${V}:`,Y)}}}function d(I){let B={};if(!I)return B;let J=new URLSearchParams(I);for(let[K,O]of J)B[K]=O;return B}function _B(I,B,J,K=""){return{path:I,params:B,query:d(K),fullPath:K?`${I}?${K}`:I,meta:J}}function EB(I,B,J){let K=typeof window>"u",O=!K,W=new Headers;return{to:I,from:B,isClient:O,isServer:K,cookies:K&&J?f(J,W):g(),storage:h(),state:{},request:J,responseHeaders:W}}async function UB(I,B){let J=Array.isArray(I)?I:[I],K=B.isServer;for(let O of J){let W=c(O);if(!W){console.warn(`Middleware '${O}' not found`);continue}if(W.mode==="server"&&!K)continue;if(W.mode==="client"&&K)continue;try{let V=await W.handler(B);if(V){if(V.type==="redirect")return{passed:!1,redirect:V,state:B.state,responseHeaders:B.responseHeaders};if(V.type==="abort")return{passed:!1,abort:V,state:B.state,responseHeaders:B.responseHeaders}}}catch(V){return console.error(`Error in middleware '${O}':`,V),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:V instanceof Error?V.message:"Middleware error"}},state:B.state,responseHeaders:B.responseHeaders}}}return{passed:!0,state:B.state,responseHeaders:B.responseHeaders}}function zB(){return`
5
5
  ;(function(){
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{sb as O}from"./chunk-h3163h5z.js";import{log as B}from"@stacksjs/logging";import*as J from"@stacksjs/path";import{doesExist as Q,get as R,writeFile as L}from"@stacksjs/storage";async function X(q){let b=q.name;if(!b)return B.error("Policy name is required"),!1;let z=b.endsWith("Policy")?b:`${b}Policy`,v=q.model||z.replace("Policy",""),I=T(z,v),H=J.appPath(`Policies/${z}.ts`);try{let G=J.appPath("Policies");if(!Q(G)){let{mkdirSync:K}=await import("@stacksjs/storage");K(G,{recursive:!0})}if(await L(H,I),B.success(`Created policy: ${H}`),q.register!==!1)await U(v,z);return!0}catch(G){return B.error(`Failed to create policy: ${G.message}`),!1}}function T(q,b){return`import type _User from '../models/User'
2
+ import{qb as O}from"./chunk-v0hqskdk.js";import{log as B}from"@stacksjs/logging";import*as J from"@stacksjs/path";import{doesExist as Q,get as R,writeFile as L}from"@stacksjs/storage";async function X(q){let b=q.name;if(!b)return B.error("Policy name is required"),!1;let z=b.endsWith("Policy")?b:`${b}Policy`,v=q.model||z.replace("Policy",""),I=T(z,v),H=J.appPath(`Policies/${z}.ts`);try{let G=J.appPath("Policies");if(!Q(G)){let{mkdirSync:K}=await import("@stacksjs/storage");K(G,{recursive:!0})}if(await L(H,I),B.success(`Created policy: ${H}`),q.register!==!1)await U(v,z);return!0}catch(G){return B.error(`Failed to create policy: ${G.message}`),!1}}function T(q,b){return`import type _User from '../models/User'
3
3
  import { BasePolicy } from '@stacksjs/auth'
4
4
 
5
5
  type UserModel = _User
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{fa as O}from"./chunk-w363nwy3.js";import{gb as A}from"./chunk-bbd6n9q2.js";import{sb as w}from"./chunk-h3163h5z.js";import Y from"process";import{existsSync as S}from"fs";import{italic as X,runCommand as K}from"@stacksjs/cli";import{ExitCode as Z}from"@stacksjs/types";import{localUrl as T}from"@stacksjs/config";import{Action as P}from"@stacksjs/enums";import{handleError as v}from"@stacksjs/error-handling";import{log as B}from"@stacksjs/logging";import{frameworkPath as b,path as J,resolve as V}from"@stacksjs/path";import{createFolder as U,doesFolderExist as _,writeTextFile as x}from"@stacksjs/storage";import{kebabCase as j,pascalCase as D,template as y}from"@stacksjs/strings";var L=!1;function Zq(z){L=Boolean(z)}function $q(){return L}function E(z,...q){return y(O[z],...q)}async function W(z,q){if(L){let G=q.split(`
2
+ import{fa as O}from"./chunk-w363nwy3.js";import{gb as A}from"./chunk-8kvzjd10.js";import{qb as w}from"./chunk-v0hqskdk.js";import Y from"process";import{existsSync as S}from"fs";import{italic as X,runCommand as K}from"@stacksjs/cli";import{ExitCode as Z}from"@stacksjs/types";import{localUrl as T}from"@stacksjs/config";import{Action as P}from"@stacksjs/enums";import{handleError as v}from"@stacksjs/error-handling";import{log as B}from"@stacksjs/logging";import{frameworkPath as b,path as J,resolve as V}from"@stacksjs/path";import{createFolder as U,doesFolderExist as _,writeTextFile as x}from"@stacksjs/storage";import{kebabCase as j,pascalCase as D,template as y}from"@stacksjs/strings";var L=!1;function Zq(z){L=Boolean(z)}function $q(){return L}function E(z,...q){return y(O[z],...q)}async function W(z,q){if(L){let G=q.split(`
3
3
  `),H=G.slice(0,60).map((I)=>` ${I}`).join(`
4
4
  `),Q=G.length>60?`
5
5
  ${X(`\u2026 ${G.length-60} more lines elided`)}`:"";B.info(`[dry-run] would write ${z} (${G.length} lines)`),Y.stdout.write(`${H}${Q}