@stacksjs/actions 0.70.87 → 0.70.90

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 (159) hide show
  1. package/dist/action.js +78 -2
  2. package/dist/actions.js +2 -2
  3. package/dist/add.js +20 -2
  4. package/dist/ai/request-model-access.js +10 -2
  5. package/dist/auth/client.js +44 -3
  6. package/dist/auth/prune.js +35 -2
  7. package/dist/auth/setup.js +152 -36
  8. package/dist/auth/token.js +10 -2
  9. package/dist/blog-admin.d.ts +55 -0
  10. package/dist/blog-admin.js +156 -0
  11. package/dist/blog.d.ts +11 -0
  12. package/dist/blog.js +306 -56
  13. package/dist/build/cli.js +6 -2
  14. package/dist/build/component-libs.js +7 -2
  15. package/dist/build/core.js +55 -2
  16. package/dist/build/desktop.js +5 -2
  17. package/dist/build/docs.js +5 -2
  18. package/dist/build/frontend-static.js +123 -8
  19. package/dist/build/server.js +6 -2
  20. package/dist/build/stacks.js +8 -2
  21. package/dist/build/views.js +11 -2
  22. package/dist/build.js +64 -2
  23. package/dist/bump.js +162 -7
  24. package/dist/cdn/invalidate-cache.js +0 -1
  25. package/dist/changelog.js +27 -3
  26. package/dist/check/ports.js +16 -2
  27. package/dist/clean.js +4 -2
  28. package/dist/commit.js +12 -2
  29. package/dist/copy-types.js +10 -3
  30. package/dist/database/seed.js +26 -2
  31. package/dist/deploy/create-receipt-rule.js +36 -2
  32. package/dist/deploy/index.js +1318 -44
  33. package/dist/dev/api.js +94 -6
  34. package/dist/dev/components.js +7 -2
  35. package/dist/dev/dashboard-globals.js +89 -3
  36. package/dist/dev/dashboard-utils.js +380 -2
  37. package/dist/dev/dashboard.js +435 -8
  38. package/dist/dev/desktop.js +5 -2
  39. package/dist/dev/docs.js +24 -2
  40. package/dist/dev/index.js +29 -2
  41. package/dist/dev/migrate-watcher.js +74 -2
  42. package/dist/dev/system-tray.js +5 -2
  43. package/dist/dev/views.js +147 -2
  44. package/dist/discover-packages.js +32 -2
  45. package/dist/domains/add.js +61 -2
  46. package/dist/domains/purchase.js +66 -2
  47. package/dist/domains/remove.js +24 -2
  48. package/dist/examples.js +34 -2
  49. package/dist/find-projects.js +16 -2
  50. package/dist/fresh.js +17 -2
  51. package/dist/generate/action-types.js +9 -4
  52. package/dist/generate/component-meta.js +9 -3
  53. package/dist/generate/custom-cli-file.js +20 -3
  54. package/dist/generate/env-files.js +46 -6
  55. package/dist/generate/ide-helpers.js +8 -3
  56. package/dist/generate/index.js +158 -2
  57. package/dist/generate/lib-entries.js +16 -3
  58. package/dist/generate/pantry-file.js +46 -2
  59. package/dist/generate/symlink-core.js +2 -2
  60. package/dist/generate/types.js +3 -2
  61. package/dist/generate/vscode-custom-data.js +9 -3
  62. package/dist/generate/web-types.js +0 -1
  63. package/dist/helpers/component-meta.js +295 -2
  64. package/dist/helpers/index.js +1 -2
  65. package/dist/helpers/lib-entries.js +73 -2
  66. package/dist/helpers/package-json.js +45 -14
  67. package/dist/helpers/utils.js +105 -2
  68. package/dist/helpers/vscode-custom-data.js +30 -2
  69. package/dist/index.d.ts +13 -0
  70. package/dist/index.js +50 -2
  71. package/dist/key-generate.js +24 -2
  72. package/dist/lint/fix.js +4 -3
  73. package/dist/lint/index.js +4 -3
  74. package/dist/lint/lint.js +34 -2
  75. package/dist/make-command.js +64 -14
  76. package/dist/make-job.js +41 -16
  77. package/dist/make-policy.js +74 -26
  78. package/dist/make-resource.js +50 -21
  79. package/dist/make.js +328 -2
  80. package/dist/migrate/database.js +16 -2
  81. package/dist/migrate/fresh.js +31 -2
  82. package/dist/orm/base.js +0 -2
  83. package/dist/orm/test.js +0 -1
  84. package/dist/prepublish.js +16 -2
  85. package/dist/queue/clear.js +42 -2
  86. package/dist/queue/dlq-purge.js +28 -2
  87. package/dist/queue/dlq-retry.js +35 -2
  88. package/dist/queue/dlq.js +55 -5
  89. package/dist/queue/failed.js +69 -5
  90. package/dist/queue/flush.js +49 -3
  91. package/dist/queue/inspect.js +154 -8
  92. package/dist/queue/list.js +69 -5
  93. package/dist/queue/monitor.js +94 -6
  94. package/dist/queue/pause.js +28 -2
  95. package/dist/queue/quarantine.js +42 -3
  96. package/dist/queue/resume.js +27 -2
  97. package/dist/queue/retry.js +41 -2
  98. package/dist/queue/schedule-list.js +33 -5
  99. package/dist/queue/schedule.js +12 -2
  100. package/dist/queue/status.js +68 -5
  101. package/dist/queue/table.js +10 -2
  102. package/dist/queue/unquarantine.js +27 -2
  103. package/dist/queue/work.js +57 -2
  104. package/dist/release.js +21 -3
  105. package/dist/route/list.js +78 -3
  106. package/dist/run-action.js +1 -2
  107. package/dist/saas/setup.js +9 -2
  108. package/dist/scaffold-crud.js +164 -40
  109. package/dist/schedule/run.js +7 -2
  110. package/dist/search/flush.js +10 -2
  111. package/dist/search/import.js +10 -2
  112. package/dist/search/settings-list.js +10 -2
  113. package/dist/search/settings.js +9 -2
  114. package/dist/serve/api.js +35 -2
  115. package/dist/setup/index.js +1 -2
  116. package/dist/setup/ssl.js +271 -2
  117. package/dist/stacks.js +265 -2
  118. package/dist/templates.js +301 -2
  119. package/dist/test/feature.js +11 -2
  120. package/dist/test/index.js +11 -2
  121. package/dist/test/ui.js +4 -2
  122. package/dist/test/unit.js +11 -2
  123. package/dist/typecheck.js +4 -2
  124. package/dist/types.js +16 -2
  125. package/dist/upgrade/binary.js +29 -2
  126. package/dist/upgrade/bun.js +0 -1
  127. package/dist/upgrade/dependencies.js +0 -2
  128. package/dist/upgrade/framework-utils.js +193 -2
  129. package/dist/upgrade/framework.js +310 -7
  130. package/dist/upgrade/index.js +17 -2
  131. package/dist/upgrade/packages.js +99 -12
  132. package/dist/upgrade/shell.js +40 -4
  133. package/dist/upgrade.js +38 -2
  134. package/package.json +16 -16
  135. package/dist/chunk-0c8sd1t6.js +0 -2
  136. package/dist/chunk-0g2nzhx9.js +0 -240
  137. package/dist/chunk-0gadhvn7.js +0 -3
  138. package/dist/chunk-0h27aa4r.js +0 -93
  139. package/dist/chunk-3peh8kqs.js +0 -851
  140. package/dist/chunk-62gdfav8.js +0 -3
  141. package/dist/chunk-6bk53y02.js +0 -3
  142. package/dist/chunk-78c5n3s2.js +0 -3
  143. package/dist/chunk-c74qv38e.js +0 -17
  144. package/dist/chunk-cdk2r2jd.js +0 -1
  145. package/dist/chunk-dbz9dp2h.js +0 -3
  146. package/dist/chunk-e142dheq.js +0 -3
  147. package/dist/chunk-ec4gky40.js +0 -3
  148. package/dist/chunk-h3d81wrg.js +0 -3
  149. package/dist/chunk-m3q0x4h0.js +0 -688
  150. package/dist/chunk-mqgbyhph.js +0 -5
  151. package/dist/chunk-n24m8prb.js +0 -3
  152. package/dist/chunk-n5eqwhck.js +0 -7
  153. package/dist/chunk-nsvnqv8y.js +0 -5
  154. package/dist/chunk-nty6mmx4.js +0 -283
  155. package/dist/chunk-s735m9mg.js +0 -1
  156. package/dist/chunk-tpb8jgsk.js +0 -7
  157. package/dist/chunk-tsbk5vne.js +0 -3
  158. package/dist/chunk-xg9xscqz.js +0 -1
  159. package/dist/chunk-y6e448he.js +0 -7
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{Ib as o}from"./chunk-0gadhvn7.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
- export{v as ib,s as jb,a as kb,n as lb,D as mb,p as nb,c as ob,m as pb,u as qb};
@@ -1,3 +0,0 @@
1
- // @bun
2
- class X{name;description;apiResponse;rate;tries;backoff;enabled;path;method;validations;requestFile;skipCsrf;csrf;authorize;before;handle;model;_dependenciesFactory;_resolvedDeps;_depsOverrides;constructor({name:j,description:A,apiResponse:B,validations:G,handle:H,rate:I,tries:J,backoff:K,enabled:L,path:M,method:N,requestFile:O,model:g,skipCsrf:Q,csrf:S,authorize:U,before:V,dependencies:W}){if(this.name=j,this.description=A,this.apiResponse=B,this.validations=G,this.rate=I,this.tries=J,this.backoff=K,this.enabled=L,this.path=M,this.method=N,this.handle=H,this.requestFile=O,this.skipCsrf=Q,this.csrf=S,this.authorize=U,this.before=V,this._dependenciesFactory=W,g&&typeof g==="object"&&"name"in g)this.model=g.name;else if(typeof g==="string")this.model=g}get deps(){if(!this._resolvedDeps)this._resolvedDeps=this._dependenciesFactory?.()??{};if(this._depsOverrides)return{...this._resolvedDeps,...this._depsOverrides};return this._resolvedDeps}overrideDependencies(j){this._depsOverrides={...this._depsOverrides??{},...j}}resetDependencies(){this._depsOverrides=void 0,this._resolvedDeps=void 0}}
3
- export{X as Hb};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{Eb as z}from"./chunk-tpb8jgsk.js";import{Ib as U}from"./chunk-0gadhvn7.js";import{Lb as O}from"./chunk-h3d81wrg.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
- export{T as rb,u as sb,V as tb,v as ub,y as vb,E as wb,N as xb,W as yb,c as zb,g as Ab,l as Bb,x as Cb,S as Db};
@@ -1,17 +0,0 @@
1
- // @bun
2
- import{S as O}from"./chunk-nty6mmx4.js";import{Ib as A}from"./chunk-0gadhvn7.js";import{Lb as w}from"./chunk-h3d81wrg.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
- `),H=G.slice(0,60).map((I)=>` ${I}`).join(`
4
- `),Q=G.length>60?`
5
- ${X(`\u2026 ${G.length-60} more lines elided`)}`:"";B.info(`[dry-run] would write ${z} (${G.length} lines)`),Y.stdout.write(`${H}${Q}
6
-
7
- `);return}await x({path:z,data:q})}async function $(z,q,...G){await W(z,E(q,...G))}async function C(z){if(z.component)await F(z);if(z.database)h(z);if(z.function)await l(z);if(z.language)await p(z);if(z.middleware)await a(z);if(z.notification)await d(z);if(z.page)await c(z);if(z.stack)await s(z)}async function Uq(z){return await C(z)}async function _q(z){try{let q=z.name;B.info("Creating your action..."),await N(z),B.success(`Created ${X(q)} action`)}catch(q){B.error("There was an error creating your action",q),Y.exit(Z.FatalError)}}async function F(z){try{let q=z.name;B.info("Creating your component..."),await k(z),B.success(`Created ${X(q)} component`)}catch(q){B.error("There was an error creating your component",q),Y.exit(Z.FatalError)}}async function N(z){let q=z.name,G=z,H=Boolean(G.withValidation||z["with-validation"]),Q=Boolean(G.withAuth||z["with-auth"]),I=H&&Q?"actionWithBoth":H?"actionWithValidation":Q?"actionWithAuth":"action";await $(J.userActionsPath(q),I,q)}async function k(z){let q=z.name;await $(J.userComponentsPath(`${q}.vue`),"component",q)}function h(z){try{let q=z.name;B.info(`Creating your ${X(q)} database...`),f(z),B.success(`Created ${X(q)} database`)}catch(q){B.error("There was an error creating your database",q),Y.exit(Z.FatalError)}}function f(z){B.debug("createDatabase options",z)}function Vq(z){try{let q=z.name;B.info(`Creating your ${X(q)} factory...`),f(z),B.success(`Created ${X(q)} factory`)}catch(q){B.error("There was an error creating your factory",q),Y.exit(Z.FatalError)}}async function Lq(z){let q=z.name||"MyFactory",G=q.endsWith("Factory")?q:`${q}Factory`;try{let{path:H}=await import("@stacksjs/path"),I=`${H.userDatabasePath("factories")}/${G}.ts`;if(await Bun.file(I).exists()){B.warn(`Factory ${G} already exists at ${I}`);return}let R=q.replace(/Factory$/,""),u=`import type { ${R}Model } from '@stacksjs/orm'
8
-
9
- export function ${G}(): Partial<${R}Model> {
10
- return {
11
- // Define your factory attributes here
12
- }
13
- }
14
-
15
- export default ${G}
16
- `;await W(I,u),B.success(`Created factory: ${I}`)}catch(H){throw B.error(`Failed to create factory ${G}`,H),H}}async function d(z){try{let q=z.name;B.info(`Creating your ${X(q)} notification...`),await i(z),B.success(`Created ${X(q)} notification`)}catch(q){B.error("There was an error creating your notification",q),Y.exit(Z.FatalError)}}async function g(z){let q=String(z.name||"").trim();if(!q)return B.error("A mail name is required (e.g. `buddy make:mail OrderShipped`)."),!1;let G=D(q),H=j(q),Q=J.userMailPath(`${G}.ts`),I=J.userEmailsPath(`${H}.stx`);if(!z.force){if(S(Q))return console.error(`${X(Q)} already exists \u2014 re-run with --force to overwrite.`),!1;if(S(I))return console.error(`${X(I)} already exists \u2014 re-run with --force to overwrite.`),!1}if(!_(J.userMailPath()))await U(J.userMailPath());if(!_(J.userEmailsPath()))await U(J.userEmailsPath());try{return await $(Q,"mail",G,H),await $(I,"mailTemplate",G,H),!0}catch(M){return v("Error creating mailable",M),!1}}async function Mq(z){try{let q=z.name;if(B.info(`Creating your ${X(q)} mailable...`),!await g(z))Y.exit(Z.FatalError);B.success(`Created ${X(D(q))} mailable + ${X(j(q))}.stx template`)}catch(q){B.error("There was an error creating your mailable",q),Y.exit(Z.FatalError)}}async function c(z){try{let q=z.name;B.info("Creating your page..."),await m(z),B.success(`Created ${q} page`)}catch(q){B.error("There was an error creating your page",q),Y.exit(Z.FatalError)}}async function m(z){let q=z.name;await $(J.userViewsPath(`${q}.vue`),"page",q)}async function l(z){try{let q=z.name;B.info("Creating your function..."),await r(z),B.success(`Created ${q} function`)}catch(q){B.error("There was an error creating your function",q),Y.exit(Z.FatalError)}}async function r(z){let q=z.name;await $(J.userFunctionsPath(`${q}.ts`),"function",q)}async function p(z){try{let q=z.name;B.info("Creating your translation file..."),await n(z),B.success(`Created ${q} translation file`)}catch(q){B.error("There was an error creating your language.",q),Y.exit(Z.FatalError)}}async function n(z){let q=z.name;await $(J.resourcesPath(`lang/${q}.yml`),"language",q)}async function s(z){try{let q=z.name;B.info(`Creating your ${q} stack...`);let G=V(Y.cwd(),q);if(_(G))B.error(`Directory "${q}" already exists`),Y.exit(Z.FatalError);await U(G);let H=["app/Actions","app/Models","config","database/migrations","resources/views","resources/components","resources/functions","routes","public"];for(let I of H)await U(V(G,I));let Q=q.replace(/^@[^/]+\//,"").replace(/-stack$/,"");await $(V(G,"package.json"),"stackPackageJson",q,Q),B.success(`Successfully scaffolded your "${q}" stack`),B.info(""),B.info(` cd ${q}`),B.info(" # Add your models, actions, views, etc."),B.info(" # Then publish: bun publish"),B.info(""),B.info(" Users install it with:"),B.info(` buddy stack:install ${q}`)}catch(q){B.error("There was an error creating your stack",q),Y.exit(Z.FatalError)}}async function i(z){let q=z.name;try{let G="EmailOptions";if(!_("notifications"))await U("./notifications");if(z.chat)G="ChatOptions";if(z.sms)G="SMSOptions";return await $(J.userNotificationsPath(`${q}.ts`),"notification",G),!0}catch(G){return v("Error creating notification",G),!1}}async function Rq(z){let q=z.name,G="dummy-name";if(!q[0])throw Error("options.name is required and cannot be empty");let H=q[0].toUpperCase()+q.slice(1),Q=b(`database/migrations/${H}.ts`);try{await $(Q,"migration","dummy-name"),B.success(`Successfully created your migration file at stacks/database/migrations/${H}.ts`)}catch(I){B.error(I)}}async function Sq(){await A(P.QueueTable)}async function Kq(){let z=await T();B.info("Creating SSL certificate..."),await K(`tlsx ${z}`,{cwd:J.storagePath("keys")}),B.success("Certificate created"),B.info("Installing SSL certificate..."),await K("tlsx -install",{cwd:J.storagePath("keys")}),B.success("Certificate installed")}async function Aq(z){let q=z.name;if(!q[0])throw Error("options.name is required and cannot be empty");let G=q[0].toUpperCase()+q.slice(1),H=G.replace(/([A-Z])/g,"_$1").toLowerCase().replace(/^_/,"").replace(/([^s])$/,"$1s"),Q=J.userModelsPath(`${G}.ts`);try{await $(Q,"model",G,H),B.success(`Model created: ${X(`app/Models/${G}.ts`)}`)}catch(I){B.error(I)}}async function a(z){let q=z.name;await $(J.userMiddlewarePath(`${q}.ts`),"middleware",q)}
17
- export{Zq as q,$q as r,C as s,Uq as t,_q as u,F as v,N as w,k as x,h as y,f as z,Vq as A,Lq as B,d as C,g as D,Mq as E,c as F,m as G,l as H,r as I,p as J,n as K,s as L,i as M,Rq as N,Sq as O,Kq as P,Aq as Q,a as R};
@@ -1 +0,0 @@
1
- // @bun
@@ -1,3 +0,0 @@
1
- // @bun
2
- function s(t){let a=t.replace(/\\/g,"/").split("/").filter(Boolean),e=a.lastIndexOf("layouts"),o=e>=0?a[e+1]:a.at(-1);if(!o)return"app";return o.replace(/\.stx$/i,"")||"app"}function u(t){let n=t.match(/<meta\b[^>]*name=["']stx-layout["'][^>]*content=["']([^"']+)["'][^>]*>/i),a=t.match(/<meta\b[^>]*name=["']stx-layout-group["'][^>]*content=["']([^"']+)["'][^>]*>/i),e=t.match(/<!--\s*stx-layout:\s*([^ ]+)\s*-->/i),o=n?.[1]||e?.[1]||"";return{layout:o,group:a?.[1]||s(o)}}
3
- export{s as a,u as b};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import E from"process";import{log as B}from"@stacksjs/cli";import{execSync as I}from"child_process";import{runFormat as J,runLint as M}from"pickier";var N=/\.(?:ts|js|json|md|yaml|yml)$/i,O=/(?:^|\/)(?:node_modules|dist|pantry|storage\/framework\/cache|\.git|\.stx|\.stx-serve)(?:\/|$)/;function G(q){try{return I("git ls-files -z",{cwd:q,encoding:"utf8"}).split("\x00").filter((z)=>N.test(z)&&!O.test(z))}catch{return[]}}async function Q(q={}){let z=q.cwd??E.cwd();B.info(q.fix?"Ensuring Code Style...":"Checking Code Style...");let A=G(z);if(!A.length)return B.success("Linted"),{ok:!0};let C=await M(A,{maxWarnings:9999,fix:q.fix})===0;if(C)B.success("Linted");return{ok:C}}function W(q={}){return Q({...q,fix:!0})}async function X(q={}){let z=q.cwd??E.cwd(),A=G(z);if(!A.length)return{ok:!0};return{ok:await J(A,{write:q.write,check:q.check})===0}}
3
- export{Q as Na,W as Oa,X as Pa};
@@ -1,3 +0,0 @@
1
- // @bun
2
- var{Glob:E}=globalThis.Bun;import G from"path";var U={user:"person.fill",team:"person.2.fill",subscriber:"envelope.open.fill",subscriberemail:"envelope.fill",post:"doc.text.fill",page:"doc.fill",product:"cube.box.fill",productvariant:"cube.fill",productunit:"scalemass.fill",order:"list.clipboard.fill",orderitem:"list.bullet.clipboard.fill",customer:"person.crop.circle.fill",payment:"creditcard.fill",paymentmethod:"creditcard.and.123",paymentproduct:"creditcard.fill",paymenttransaction:"creditcard.fill",category:"tag.fill",tag:"tag",comment:"bubble.left.fill",author:"person.text.rectangle.fill",notification:"bell.fill",job:"briefcase.fill",log:"list.bullet.rectangle.portrait.fill",campaign:"megaphone.fill",review:"star.fill",coupon:"ticket.fill",giftcard:"giftcard.fill",cart:"cart.fill",cartitem:"cart.badge.plus",taxrate:"percent",transaction:"arrow.left.arrow.right.circle.fill",subscription:"repeat.circle.fill",emaillist:"envelope.badge.person.crop",socialpost:"bubble.left.and.bubble.right.fill",manufacturer:"building.2.fill",shippingmethod:"shippingbox.fill",shippingzone:"map.fill",shippingrate:"dollarsign.circle.fill",deliveryroute:"map.fill",driver:"car.fill",digitaldelivery:"arrow.down.doc.fill",licensekey:"key.fill",loyaltypoint:"star.circle.fill",loyaltyreward:"gift.fill",printdevice:"printer.fill",receipt:"doc.text.fill",waitlistproduct:"clock.fill",waitlistrestaurant:"clock.badge.checkmark.fill",websocket:"antenna.radiowaves.left.and.right",default:"tablecells.fill"},W=new Set(["activity","request","error","failedjob"]),H=new Set(["user","team","subscriber","post","page","product","order","customer","payment","coupon","category","tag","comment","author","notification","job","campaign","review","gift-card"]),_={user:"data",team:"data",subscriber:"data",activity:"data",campaign:"marketing",emaillist:"marketing",socialpost:"marketing",subscriberemail:"marketing",comment:"content",tag:"content",paymentmethod:"commerce",paymentproduct:"commerce",paymenttransaction:"commerce",subscription:"commerce",deployment:"system",error:"system",failedjob:"system",job:"system",log:"system",notification:"system",release:"system",request:"system"};function A(j){return j.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^-/,"")}function D(j){return U[j.toLowerCase()]||U.default||"database"}function S(j,F,k){if(k)return k;let J=j.includes("/")?(j.split("/")[0]??"").toLowerCase():"";if(J==="commerce")return"commerce";if(J==="content")return"content";if(J==="realtime")return"system";return _[F.replace(/-/g,"")]??"data"}async function T(j){try{let F=await import(j);return(F.default??F).dashboard}catch{return}}async function V(j,F,k,J){try{let K=new E("**/*.ts");for await(let Q of K.scan({cwd:j})){if(Q.includes("README")||Q.includes(".d.ts"))continue;let $=Q.replace(/\.ts$/,"").split("/").pop()||"",Z=$.toLowerCase();if($&&!F.has(Z)&&!W.has(Z)){F.add(Z);let z=A($),X=G.join(j,Q),q=await T(X);k.push({name:$,icon:q?.icon??D($),id:z,category:S(Q,z,J),dashboard:q})}}}catch{}}async function N(j,F){let k=[],J=new Set;return await Promise.all([V(j,J,k,"userland"),V(F,J,k)]),k.sort((K,Q)=>K.name.localeCompare(Q.name))}function C(j){return j.map((F)=>{let k={id:F.id,name:F.name,icon:F.icon,hasDedicatedPage:H.has(F.id),category:F.category??"data"};if(F.dashboard)k.dashboard=F.dashboard;return k})}async function x(j){try{return Bun.serve({port:j,fetch:()=>new Response}).stop(!0),!0}catch{return!1}}async function I(j,F=20){for(let k=0;k<F;k++){let J=j+k;if(await x(J))return J}return j}async function P(j,F=500){let k=Date.now();while(Date.now()-k<F){try{let J=await fetch(`http://localhost:${j}/`,{method:"HEAD"});if(J.ok||J.status===404)return!0}catch{}await new Promise((J)=>setTimeout(J,25))}return!1}function Y(j){if(j.dashboard?.enabled===!1)return;if(j.dashboard?.section)return j.dashboard.section;return j.category??"data"}function B(j,F,k,J){return F.filter((K)=>Y(K)===k).filter((K)=>!H.has(K.id)&&!J.has(K.id)).map((K)=>({id:`model-${K.id}`,label:K.dashboard?.label??K.name,icon:K.icon,url:`${j}/models/${K.id}`,...K.dashboard?.roles&&K.dashboard.roles.length>0?{roles:K.dashboard.roles}:{}}))}function y(j,F,k={}){let J={library:k.library??!0,content:k.content??!0,commerce:k.commerce??!0,marketing:k.marketing??!0,analytics:k.analytics??!0,management:k.management??!0,utilities:k.utilities??!0},K={dashboard:k.data?.dashboard??!0,activity:k.data?.activity??!0,users:k.data?.users??!0,teams:k.data?.teams??!0,subscribers:k.data?.subscribers??!0,allModels:k.data?.allModels??!0},Q=[],$=[{id:"home",label:"Dashboard",icon:"house.fill",url:`${j}/`},{id:"dependencies",label:"Dependencies",icon:"shippingbox.fill",url:`${j}/dependencies`},{id:"health",label:"Health",icon:"heart.text.square.fill",url:`${j}/health`}];if(k.ci)$.push({id:"ci",label:"CI",icon:"checkmark.seal.fill",url:`${j}/ci`});if(Q.push({id:"home",title:"Home",items:$}),J.library)Q.push({id:"library",title:"Library",items:[{id:"functions",label:"Functions",icon:"function",url:`${j}/functions`},{id:"packages",label:"Packages",icon:"shippingbox.fill",url:`${j}/packages`}]});if(J.content)Q.push({id:"content",title:"Content",items:[{id:"content-dashboard",label:"Dashboard",icon:"gauge.with.dots.needle.33percent",url:`${j}/content/dashboard`},{id:"files",label:"Files",icon:"folder.fill",url:`${j}/content/files`},{id:"pages",label:"Pages",icon:"doc.fill",url:`${j}/content/pages`},{id:"posts",label:"Posts",icon:"text.bubble.fill",url:`${j}/content/posts`},{id:"categories",label:"Categories",icon:"tag.fill",url:`${j}/content/categories`},{id:"tags",label:"Tags",icon:"tag",url:`${j}/content/tags`},{id:"comments",label:"Comments",icon:"bubble.left.fill",url:`${j}/content/comments`},{id:"authors",label:"Authors",icon:"person.text.rectangle.fill",url:`${j}/content/authors`},{id:"seo",label:"SEO",icon:"magnifyingglass",url:`${j}/content/seo`},...B(j,F,"content",new Set(["page","post","category","tag","comment","author"]))]});Q.push({id:"app",title:"App",items:[{id:"deployments",label:"Deployments",icon:"rocket.fill",url:`${j}/deployments`},{id:"requests",label:"Requests",icon:"arrow.left.arrow.right",url:`${j}/requests`},{id:"realtime",label:"Realtime",icon:"link",url:`${j}/realtime`},{id:"actions",label:"Actions",icon:"bolt.fill",url:`${j}/actions`},{id:"commands",label:"Commands",icon:"terminal.fill",url:`${j}/commands`},{id:"queue",label:"Queue",icon:"list.bullet.rectangle.fill",url:`${j}/queue`},{id:"jobs",label:"Jobs",icon:"briefcase.fill",url:`${j}/jobs`},{id:"inbox",label:"Inbox",icon:"tray.full.fill",url:`${j}/inbox`},{id:"queries",label:"Queries",icon:"magnifyingglass.circle.fill",url:`${j}/queries`},{id:"notifications",label:"Notifications",icon:"bell.fill",url:`${j}/notifications/dashboard`},...B(j,F,"system",new Set)]});let Z=[];if(K.dashboard)Z.push({id:"data-dashboard",label:"Dashboard",icon:"gauge.with.dots.needle.33percent",url:`${j}/data/dashboard`});if(K.activity)Z.push({id:"activity",label:"Activity",icon:"waveform.path.ecg",url:`${j}/data/activity`});if(K.users)Z.push({id:"users",label:"Users",icon:"person.crop.circle.fill",url:`${j}/data/users`});if(K.teams)Z.push({id:"teams",label:"Teams",icon:"person.3.fill",url:`${j}/data/teams`});if(K.subscribers)Z.push({id:"subscribers",label:"Subscribers",icon:"envelope.fill",url:`${j}/data/subscribers`});if(K.allModels)Z.push({id:"data-models",label:"All Models",icon:"square.grid.2x2.fill",url:`${j}/models`});let z=F.filter((X)=>{let q=Y(X);return q==="userland"||q==="data"}).filter((X)=>!H.has(X.id)).map((X)=>({id:`model-${X.id}`,label:X.dashboard?.label??X.name,icon:X.icon,url:`${j}/models/${X.id}`,...X.dashboard?.roles&&X.dashboard.roles.length>0?{roles:X.dashboard.roles}:{}}));if(Q.push({id:"data",title:"Data",items:[...Z,...z]}),J.commerce)Q.push({id:"commerce",title:"Commerce",items:[{id:"commerce-dashboard",label:"Dashboard",icon:"gauge.with.dots.needle.33percent",url:`${j}/commerce/dashboard`},{id:"customers",label:"Customers",icon:"person.crop.circle.fill",url:`${j}/commerce/customers`},{id:"orders",label:"Orders",icon:"list.clipboard.fill",url:`${j}/commerce/orders`},{id:"products",label:"Products",icon:"cube.box.fill",url:`${j}/commerce/products`},{id:"coupons",label:"Coupons",icon:"ticket.fill",url:`${j}/commerce/coupons`},{id:"gift-cards",label:"Gift Cards",icon:"giftcard.fill",url:`${j}/commerce/gift-cards`},{id:"payments",label:"Payments",icon:"creditcard.fill",url:`${j}/commerce/payments`},{id:"delivery",label:"Delivery",icon:"truck.box.fill",url:`${j}/commerce/delivery`},{id:"taxes",label:"Taxes",icon:"percent",url:`${j}/commerce/taxes`},...B(j,F,"commerce",new Set(["customer","order","product","coupon","gift-card","payment","review","category"]))]});if(J.marketing)Q.push({id:"marketing",title:"Marketing",items:[{id:"lists",label:"Lists",icon:"list.bullet",url:`${j}/marketing/lists`},{id:"social-posts",label:"Social Posts",icon:"clock.fill",url:`${j}/marketing/social-posts`},{id:"campaigns",label:"Campaigns",icon:"megaphone.fill",url:`${j}/marketing/campaigns`},{id:"marketing-reviews",label:"Reviews",icon:"star.fill",url:`${j}/marketing/reviews`},...B(j,F,"marketing",new Set(["campaign"]))]});if(J.analytics)Q.push({id:"analytics",title:"Analytics",items:[{id:"analytics-web",label:"Web",icon:"globe",url:`${j}/analytics/web`},{id:"analytics-blog",label:"Blog",icon:"doc.text.fill",url:`${j}/analytics/blog`},{id:"analytics-commerce",label:"Commerce",icon:"cart.fill",url:`${j}/analytics/commerce/web`},{id:"analytics-marketing",label:"Marketing",icon:"megaphone.fill",url:`${j}/analytics/marketing`}]});if(J.management)Q.push({id:"management",title:"Management",items:[{id:"cloud",label:"Cloud",icon:"cloud.fill",url:`${j}/cloud`},{id:"servers",label:"Servers",icon:"server.rack",url:`${j}/servers`},{id:"serverless",label:"Serverless",icon:"bolt.horizontal.circle.fill",url:`${j}/serverless`},{id:"dns",label:"DNS",icon:"network",url:`${j}/dns`},{id:"mailboxes",label:"Mailboxes",icon:"tray.full.fill",url:`${j}/mailboxes`},{id:"logs",label:"Logs",icon:"list.bullet.rectangle.portrait.fill",url:`${j}/logs`},{id:"kanban",label:"Kanban",icon:"rectangle.stack.fill",url:`${j}/kanban`,roles:["admin","dev"]}]});if(J.utilities)Q.push({id:"utilities",title:"Utilities",items:[{id:"buddy",label:"AI Buddy",icon:"bubble.left.and.bubble.right.fill",url:`${j}/buddy`},{id:"environment",label:"Environment",icon:"key.fill",url:`${j}/environment`},{id:"access-tokens",label:"Access Tokens",icon:"key.horizontal.fill",url:`${j}/access-tokens`},{id:"settings",label:"Settings",icon:"gear",url:`${j}/settings/billing`}]});return{sections:Q,minWidth:200,maxWidth:280}}function v(j){return`http://localhost:${j}/?native-sidebar=1`}
3
- export{U as Xa,W as Ya,H as Za,A as _a,D as $a,V as ab,N as bb,C as cb,x as db,I as eb,P as fb,y as gb,v as hb};
@@ -1,3 +0,0 @@
1
- // @bun
2
- var a=import.meta.require;
3
- export{a as Lb};