@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.
- package/dist/action.js +78 -2
- package/dist/actions.js +2 -2
- package/dist/add.js +20 -2
- package/dist/ai/request-model-access.js +10 -2
- package/dist/auth/client.js +44 -3
- package/dist/auth/prune.js +35 -2
- package/dist/auth/setup.js +152 -36
- package/dist/auth/token.js +10 -2
- package/dist/blog-admin.d.ts +55 -0
- package/dist/blog-admin.js +156 -0
- package/dist/blog.d.ts +11 -0
- package/dist/blog.js +306 -56
- package/dist/build/cli.js +6 -2
- package/dist/build/component-libs.js +7 -2
- package/dist/build/core.js +55 -2
- package/dist/build/desktop.js +5 -2
- package/dist/build/docs.js +5 -2
- package/dist/build/frontend-static.js +123 -8
- package/dist/build/server.js +6 -2
- package/dist/build/stacks.js +8 -2
- package/dist/build/views.js +11 -2
- package/dist/build.js +64 -2
- package/dist/bump.js +162 -7
- package/dist/cdn/invalidate-cache.js +0 -1
- package/dist/changelog.js +27 -3
- package/dist/check/ports.js +16 -2
- package/dist/clean.js +4 -2
- package/dist/commit.js +12 -2
- package/dist/copy-types.js +10 -3
- package/dist/database/seed.js +26 -2
- package/dist/deploy/create-receipt-rule.js +36 -2
- package/dist/deploy/index.js +1318 -44
- package/dist/dev/api.js +94 -6
- package/dist/dev/components.js +7 -2
- package/dist/dev/dashboard-globals.js +89 -3
- package/dist/dev/dashboard-utils.js +380 -2
- package/dist/dev/dashboard.js +435 -8
- package/dist/dev/desktop.js +5 -2
- package/dist/dev/docs.js +24 -2
- package/dist/dev/index.js +29 -2
- package/dist/dev/migrate-watcher.js +74 -2
- package/dist/dev/system-tray.js +5 -2
- package/dist/dev/views.js +147 -2
- package/dist/discover-packages.js +32 -2
- package/dist/domains/add.js +61 -2
- package/dist/domains/purchase.js +66 -2
- package/dist/domains/remove.js +24 -2
- package/dist/examples.js +34 -2
- package/dist/find-projects.js +16 -2
- package/dist/fresh.js +17 -2
- package/dist/generate/action-types.js +9 -4
- package/dist/generate/component-meta.js +9 -3
- package/dist/generate/custom-cli-file.js +20 -3
- package/dist/generate/env-files.js +46 -6
- package/dist/generate/ide-helpers.js +8 -3
- package/dist/generate/index.js +158 -2
- package/dist/generate/lib-entries.js +16 -3
- package/dist/generate/pantry-file.js +46 -2
- package/dist/generate/symlink-core.js +2 -2
- package/dist/generate/types.js +3 -2
- package/dist/generate/vscode-custom-data.js +9 -3
- package/dist/generate/web-types.js +0 -1
- package/dist/helpers/component-meta.js +295 -2
- package/dist/helpers/index.js +1 -2
- package/dist/helpers/lib-entries.js +73 -2
- package/dist/helpers/package-json.js +45 -14
- package/dist/helpers/utils.js +105 -2
- package/dist/helpers/vscode-custom-data.js +30 -2
- package/dist/index.d.ts +13 -0
- package/dist/index.js +50 -2
- package/dist/key-generate.js +24 -2
- package/dist/lint/fix.js +4 -3
- package/dist/lint/index.js +4 -3
- package/dist/lint/lint.js +34 -2
- package/dist/make-command.js +64 -14
- package/dist/make-job.js +41 -16
- package/dist/make-policy.js +74 -26
- package/dist/make-resource.js +50 -21
- package/dist/make.js +328 -2
- package/dist/migrate/database.js +16 -2
- package/dist/migrate/fresh.js +31 -2
- package/dist/orm/base.js +0 -2
- package/dist/orm/test.js +0 -1
- package/dist/prepublish.js +16 -2
- package/dist/queue/clear.js +42 -2
- package/dist/queue/dlq-purge.js +28 -2
- package/dist/queue/dlq-retry.js +35 -2
- package/dist/queue/dlq.js +55 -5
- package/dist/queue/failed.js +69 -5
- package/dist/queue/flush.js +49 -3
- package/dist/queue/inspect.js +154 -8
- package/dist/queue/list.js +69 -5
- package/dist/queue/monitor.js +94 -6
- package/dist/queue/pause.js +28 -2
- package/dist/queue/quarantine.js +42 -3
- package/dist/queue/resume.js +27 -2
- package/dist/queue/retry.js +41 -2
- package/dist/queue/schedule-list.js +33 -5
- package/dist/queue/schedule.js +12 -2
- package/dist/queue/status.js +68 -5
- package/dist/queue/table.js +10 -2
- package/dist/queue/unquarantine.js +27 -2
- package/dist/queue/work.js +57 -2
- package/dist/release.js +21 -3
- package/dist/route/list.js +78 -3
- package/dist/run-action.js +1 -2
- package/dist/saas/setup.js +9 -2
- package/dist/scaffold-crud.js +164 -40
- package/dist/schedule/run.js +7 -2
- package/dist/search/flush.js +10 -2
- package/dist/search/import.js +10 -2
- package/dist/search/settings-list.js +10 -2
- package/dist/search/settings.js +9 -2
- package/dist/serve/api.js +35 -2
- package/dist/setup/index.js +1 -2
- package/dist/setup/ssl.js +271 -2
- package/dist/stacks.js +265 -2
- package/dist/templates.js +301 -2
- package/dist/test/feature.js +11 -2
- package/dist/test/index.js +11 -2
- package/dist/test/ui.js +4 -2
- package/dist/test/unit.js +11 -2
- package/dist/typecheck.js +4 -2
- package/dist/types.js +16 -2
- package/dist/upgrade/binary.js +29 -2
- package/dist/upgrade/bun.js +0 -1
- package/dist/upgrade/dependencies.js +0 -2
- package/dist/upgrade/framework-utils.js +193 -2
- package/dist/upgrade/framework.js +310 -7
- package/dist/upgrade/index.js +17 -2
- package/dist/upgrade/packages.js +99 -12
- package/dist/upgrade/shell.js +40 -4
- package/dist/upgrade.js +38 -2
- package/package.json +16 -16
- package/dist/chunk-0c8sd1t6.js +0 -2
- package/dist/chunk-0g2nzhx9.js +0 -240
- package/dist/chunk-0gadhvn7.js +0 -3
- package/dist/chunk-0h27aa4r.js +0 -93
- package/dist/chunk-3peh8kqs.js +0 -851
- package/dist/chunk-62gdfav8.js +0 -3
- package/dist/chunk-6bk53y02.js +0 -3
- package/dist/chunk-78c5n3s2.js +0 -3
- package/dist/chunk-c74qv38e.js +0 -17
- package/dist/chunk-cdk2r2jd.js +0 -1
- package/dist/chunk-dbz9dp2h.js +0 -3
- package/dist/chunk-e142dheq.js +0 -3
- package/dist/chunk-ec4gky40.js +0 -3
- package/dist/chunk-h3d81wrg.js +0 -3
- package/dist/chunk-m3q0x4h0.js +0 -688
- package/dist/chunk-mqgbyhph.js +0 -5
- package/dist/chunk-n24m8prb.js +0 -3
- package/dist/chunk-n5eqwhck.js +0 -7
- package/dist/chunk-nsvnqv8y.js +0 -5
- package/dist/chunk-nty6mmx4.js +0 -283
- package/dist/chunk-s735m9mg.js +0 -1
- package/dist/chunk-tpb8jgsk.js +0 -7
- package/dist/chunk-tsbk5vne.js +0 -3
- package/dist/chunk-xg9xscqz.js +0 -1
- package/dist/chunk-y6e448he.js +0 -7
package/dist/chunk-mqgbyhph.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import"./chunk-h3d81wrg.js";var q={type:"aws",useLoadBalancer:!0,app:{name:"app-server-1",domain:"stacksjs.com",region:"us-east-1",type:"app",size:"t3.micro",diskSize:20,serverOS:"ubuntu-20-lts-x86_64",bunVersion:"1.1.26",database:"sqlite",databaseName:"stacks"},app2:{name:"app-server-2",domain:"stacksjs.com",instanceType:"t3.micro",userData:`#!/bin/bash
|
|
3
|
-
echo "Hello World from App Server 2!" > /tmp/test.txt
|
|
4
|
-
chown ubuntu:ubuntu /tmp/test.txt
|
|
5
|
-
`},web:{name:"web-server",domain:"ow3.org",region:"us-east-1",type:"web",size:"t3.micro",diskSize:20,serverOS:"ubuntu-20-lts-x86_64",bunVersion:"1.1.26"},cache:{name:"cache-server",domain:"stacksjs.com",region:"us-east-1",type:"cache",size:"t3.micro",diskSize:20,serverOS:"ubuntu-20-lts-x86_64",bunVersion:"1.1.26"}};import{env as m}from"@stacksjs/env";var C={project:{name:"stacks",slug:"stacks",region:"us-east-1"},cloud:{provider:"hetzner"},mode:"server",environments:{production:{type:"production",deployBranch:"main",region:"us-east-1",variables:{NODE_ENV:"production",LOG_LEVEL:"info"}},staging:{type:"staging",deployBranch:"stage",domainPrefix:"staging",region:"us-east-1",variables:{NODE_ENV:"staging",LOG_LEVEL:"debug"}},development:{type:"development",deployBranch:"dev",domainPrefix:"dev",region:"us-east-1",variables:{NODE_ENV:"development",LOG_LEVEL:"debug"}}},infrastructure:{compute:{instances:1,size:"small",disk:{size:20,type:"ssd",encrypted:!0},webServer:"rpx",proxy:{engine:"rpx",onDemandTls:!0,onDemandTlsEmail:"hello@stacksjs.com"}},servers:{app:q.app},containers:{api:{cpu:512,memory:1024,port:3000,healthCheck:"/health",desiredCount:2,autoScaling:{min:1,max:10,targetCpuUtilization:70,targetMemoryUtilization:80}}},loadBalancer:{enabled:!0,type:"application",healthCheck:{path:"/health",interval:30,healthyThreshold:2,unhealthyThreshold:5}},ssl:{enabled:!0,provider:"acm",domains:m.SSL_DOMAINS?.split(",")||["stacksjs.com","www.stacksjs.com"],redirectHttp:!0,letsEncrypt:{email:m.LETSENCRYPT_EMAIL||"admin@stacksjs.com",staging:!1,autoRenew:!0}},dns:{domain:m.APP_DOMAIN||"stacksjs.com",hostedZoneId:m.AWS_HOSTED_ZONE_ID||"Z01455702Q7952O6RCY37"},storage:{public:{public:!0,encryption:!0,versioning:!0,website:{indexDocument:"index.html",errorDocument:"index.html"}},private:{encryption:!0,versioning:!0},docs:{public:!0,encryption:!0,versioning:!0,path:"/docs",pathRewriteStyle:"flat",website:{indexDocument:"index.html",errorDocument:"404.html"}},blog:{public:!0,encryption:!0,versioning:!0,path:"/blog",website:{indexDocument:"index.html",errorDocument:"404.html"}},logs:{encryption:!0,versioning:!1},backups:{encryption:!0,versioning:!0},email:{public:!1,encryption:!0,versioning:!1}},functions:{},queues:{jobs:{visibilityTimeout:120,deadLetterQueue:!0,maxReceiveCount:3}},databases:{},cdn:{},monitoring:{}},sites:{main:{root:".",path:"/",domain:m.APP_DOMAIN||"stacksjs.com",start:"bun --conditions development storage/framework/core/buddy/src/cli.ts serve",port:3000,preStart:["bun install","bun --conditions development storage/framework/core/buddy/src/cli.ts migrate"]},api:{root:".",start:"bun --conditions development storage/framework/core/actions/src/serve/api.ts",port:3008,preStart:["bun install"],env:{HOST:"127.0.0.1",APP_ENV:"production"}},docs:{deploy:"server",root:"dist/docs/.bunpress",path:"/docs",domain:m.APP_DOMAIN||"stacksjs.com",build:"bunx @stacksjs/bunpress build --dir ./docs --outdir ./dist/docs",pathRewriteStyle:"directory"},blog:{deploy:"server",root:"dist/blog",path:"/blog",domain:m.APP_DOMAIN||"stacksjs.com",build:`bun -e "const {buildBlog}=await import('./storage/framework/core/actions/src/blog'); await buildBlog({outDir:'./dist/blog', baseUrl: (process.env.APP_URL?(/^https?:/.test(process.env.APP_URL)?process.env.APP_URL:'https://'+process.env.APP_URL):'https://stacksjs.com')})"`,pathRewriteStyle:"directory"},wwwStacksjs:{domain:"www.stacksjs.com",redirect:"https://stacksjs.com"}}},w={},E=w;export{C as tsCloud,E as default};
|
package/dist/chunk-n24m8prb.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{existsSync as N,readdirSync as z,readFileSync as W,statSync as J,writeFileSync as Y}from"fs";import{homedir as T}from"os";import{join as Z,resolve as I}from"path";import A from"process";function y(q,D){let B=q.version;if(B)return{channel:"stable",ref:B.startsWith("v")?B:`v${B}`,targetVersion:B};if(q.canary)return{channel:"canary",ref:"main"};if(q.stable)return{channel:"stable",ref:"stable"};if(D==="canary")return{channel:"canary",ref:"main"};return{channel:"stable",ref:"stable"}}function S(q,D="storage/framework/core"){return`github:stacksjs/stacks#${q}/${D}`}function w(q){try{if(N(q))return JSON.parse(W(q,"utf-8")).version||null}catch{}return null}function g(q){try{if(N(q)){if(W(q,"utf-8").trim()==="canary")return"canary"}}catch{}return"stable"}function b(q,D){try{Y(q,D,"utf-8")}catch{}}function v(q){try{if(N(q)){let D=W(q,"utf-8").trim(),[B,E]=D.split(/\s+/);if((B==="stable"||B==="canary")&&E&&/^[0-9a-f]{40}$/i.test(E))return{channel:B,sha:E.toLowerCase()}}}catch{}return null}function F(q,D,B){try{Y(q,`${D} ${B}`,"utf-8")}catch{}}function P(q){let{force:D,targetVersion:B,remoteSha:E,synced:H,channel:G}=q;if(D||B)return!1;if(!E||!H)return!1;return H.channel===G&&H.sha===E.toLowerCase()}function x(q,D,B){if(q.targetVersion)return`Installing Stacks v${q.targetVersion.replace(/^v/,"")}...`;if(q.channel==="canary")return"Upgrading to the latest canary build...";if(B&&D==="canary")return"Switching back to the latest stable release...";return"Upgrading to the latest version..."}function f(q,D,B,E,H){if(q.targetVersion){let G=q.targetVersion.replace(/^v/,"");if(D===G&&!H)return`Stacks is already at v${G}`;if(D)return`Installed Stacks v${G} (was v${D})`;return`Installed Stacks v${G}`}if(D&&B&&D===B&&!H){if(q.channel==="canary")return`Stacks is already up to date (canary ${D})`;return`Stacks is already up to date (v${D})`}if(D&&B){let G=E==="canary"?`canary ${D}`:`v${D}`,K=q.channel==="canary"?`canary ${B}`:`v${B}`;return`Upgraded Stacks from ${G} to ${K}`}if(B)return`Upgraded Stacks to ${q.channel==="canary"?`canary ${B}`:`v${B}`}`;return`Upgraded Stacks to ${q.ref} (latest)`}var p=[{localPath:"storage/framework/core",subPath:"storage/framework/core",label:"core",skip:["node_modules","dist","bun.lock",".DS_Store"]},{localPath:"storage/framework/defaults",subPath:"storage/framework/defaults",label:"defaults",skip:["node_modules","dist",".DS_Store",".discovered-models.json"]},{localPath:"buddy",subPath:"buddy",label:"buddy",isFile:!0},{localPath:"bootstrap",subPath:"bootstrap",label:"bootstrap",isFile:!0}];function u(q){let D=[A.env.STACKS_LOCAL_PATH,I(q,"..","stacks"),I(q,"..","..","stacks"),I(T(),"Code","stacks"),I(T(),"code","stacks"),I(T(),"projects","stacks"),I(T(),"src","stacks")];for(let B of D){if(!B)continue;let E=Z(B,"storage","framework","core","buddy","package.json");try{if(N(E)&&I(B)!==I(q))return I(B)}catch{}}return null}async function V(q,D=[]){let B=new Map;if(!N(q))return B;let E=new Set(D),H=[{abs:q,rel:""}],G=[];while(H.length>0){let{abs:K,rel:M}=H.pop(),L;try{L=z(K)}catch{continue}for(let O of L){if(E.has(O))continue;let U=Z(K,O),X=M?`${M}/${O}`:O,Q;try{Q=J(U)}catch{continue}if(Q.isDirectory())H.push({abs:U,rel:X});else if(Q.isFile()){let _=Q.size;G.push((async()=>{let $=await C(U);B.set(X,{size:_,hash:$})})())}}}return await Promise.all(G),B}function d(q,D){let B=0,E=0,H=0;for(let[K,M]of D){let L=q.get(K);if(!L)B++;else if(L.size!==M.size||L.hash!==M.hash)E++;else H++}let G=0;for(let K of q.keys())if(!D.has(K))G++;return{added:B,changed:E,removed:G,unchanged:H}}async function C(q){try{let D=await Bun.file(q).arrayBuffer();return Bun.hash(D)}catch{return 0n}}
|
|
3
|
-
export{y as c,S as d,w as e,g as f,b as g,v as h,F as i,P as j,x as k,f as l,p as m,u as n,V as o,d as p};
|
package/dist/chunk-n5eqwhck.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Lb as H}from"./chunk-h3d81wrg.js";import{execSync as M,spawn as j}from"child_process";import Z from"fs";import E from"os";import $ from"path";import Y from"process";import{log as B}from"@stacksjs/cli";var q=Y.platform==="win32"?$.join(Y.env.windir||"C:\\Windows","System32","drivers","etc","hosts"):"/etc/hosts",X=$.join(E.homedir(),".stacks","ssl");function T(){return Y.stdin.isTTY===!0&&Y.stdout.isTTY===!0}function V(){return Y.env.SUDO_PASSWORD}function k(){return T()||!!V()}function F(z){try{let G=Z.readFileSync(q,"utf-8");return G.includes(`127.0.0.1 ${z}`)||G.includes(`::1 ${z}`)}catch{if(Y.platform!=="win32"){let G=V();if(G)try{let J=M(`echo '${G}' | sudo -S cat "${q}" 2>/dev/null`,{encoding:"utf-8"});return J.includes(`127.0.0.1 ${z}`)||J.includes(`::1 ${z}`)}catch{return!1}}return!1}}async function x(z,G){if(F(z)){if(G)B.info(`${z} already in hosts file`);return!0}let J=`
|
|
3
|
-
# Added by Stacks
|
|
4
|
-
127.0.0.1 ${z}
|
|
5
|
-
::1 ${z}
|
|
6
|
-
`;if(Y.platform==="win32")return B.warn("Please add this to your hosts file manually:"),B.warn(`127.0.0.1 ${z}`),B.warn(`::1 ${z}`),B.warn(`File location: ${q}`),!1;if(!k()){if(G)B.warn(`Cannot add ${z} to hosts file (non-interactive mode and no SUDO_PASSWORD set)`),B.info("Run `buddy setup:ssl` in a terminal or set SUDO_PASSWORD environment variable");return!1}let K=V();return new Promise((Q)=>{let N;if(K)N=j("sh",["-c",`echo '${K}' | sudo -S sh -c "echo '${J}' >> '${q}'"`],{stdio:["pipe","inherit","inherit"]});else N=j("sudo",["sh","-c",`echo '${J}' >> "${q}"`],{stdio:"inherit"});N.on("close",(U)=>{if(U===0){if(G)B.success(`Added ${z} to hosts file`);Q(!0)}else{if(G)B.error(`Failed to add ${z} to hosts file`),B.warn(`Manually add: 127.0.0.1 ${z}`);Q(!1)}}),N.on("error",()=>{B.error("Failed to run sudo command"),Q(!1)})})}function O(z){let G=$.join(X,`${z}.crt`),J=$.join(X,`${z}.key`),K=$.join(X,`${z}.ca.crt`);return Z.existsSync(G)&&Z.existsSync(J)&&Z.existsSync(K)}function y(z){if(Y.platform!=="darwin")return!0;let G=$.join(X,`${z}.crt`);if(!Z.existsSync(G))return!1;try{let J=M(`openssl x509 -noout -fingerprint -sha256 -in "${G}"`,{encoding:"utf-8"}),K=J.indexOf("="),Q=K>=0?J.slice(K+1).trim():"";if(!Q)return!1;return M("security find-certificate -a -Z -p | openssl x509 -noout -fingerprint -sha256 2>/dev/null || true",{encoding:"utf-8"}).includes(Q)}catch{return!1}}async function D(z,G){let J=$.join(X,`${z}.ca.crt`),K=$.join(X,`${z}.crt`);if(!Z.existsSync(J))return B.error(`CA certificate not found: ${J}`),!1;if(y(z)){if(G)B.info("Certificate is already trusted, skipping trust step");return!0}if(!k()){if(G)B.warn("Cannot trust certificate (non-interactive mode and no SUDO_PASSWORD set)"),B.info("Run `buddy setup:ssl` in a terminal or set SUDO_PASSWORD environment variable");return!1}let Q=V();if(Y.platform==="darwin")return new Promise((N)=>{let U=`security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain '${J}' && security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain '${K}'`,W;if(Q)W=j("sh",["-c",`echo '${Q}' | sudo -S sh -c "${U}"`],{stdio:["pipe","inherit","inherit"]});else W=j("sudo",["sh","-c",U],{stdio:"inherit"});W.on("close",(A)=>{if(A===0){try{M(`security add-trusted-cert -d -r trustRoot -k ~/Library/Keychains/login.keychain-db "${K}" 2>/dev/null || true`)}catch{}N(!0)}else{if(G)B.warn("Could not trust certificate automatically"),B.info(` sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain "${J}"`);N(!1)}}),W.on("error",()=>{B.error("Failed to run sudo command"),N(!1)})});else if(Y.platform==="linux")return new Promise((N)=>{let U=`mkdir -p /usr/local/share/ca-certificates/stacks && cp '${J}' /usr/local/share/ca-certificates/stacks/ && update-ca-certificates`,W;if(Q)W=j("sh",["-c",`echo '${Q}' | sudo -S sh -c "${U}"`],{stdio:["pipe","inherit","inherit"]});else W=j("sudo",["sh","-c",U],{stdio:"inherit"});W.on("close",(A)=>{if(A===0)B.success("Certificate trusted"),N(!0);else B.warn("Could not trust certificate automatically"),N(!1)}),W.on("error",()=>N(!1))});else if(Y.platform==="win32")return B.warn("Please manually trust the certificate in Windows:"),B.warn(` 1. Double-click: ${J}`),B.warn(' 2. Click "Install Certificate"'),B.warn(' 3. Select "Local Machine" and place in "Trusted Root Certification Authorities"'),!1;return!1}async function R(z,G){try{let J=await import("@stacksjs/tlsx"),{generateCertificate:K,createRootCA:Q}=J,N=J.httpsConfig;if(!Z.existsSync(X))Z.mkdirSync(X,{recursive:!0});let U={domain:z,hostCertCN:z,basePath:X,caCertPath:$.join(X,`${z}.ca.crt`),certPath:$.join(X,`${z}.crt`),keyPath:$.join(X,`${z}.key`),altNameIPs:["127.0.0.1","::1"],altNameURIs:["localhost",z],organizationName:"Stacks Development",countryName:"US",stateName:"California",localityName:"Playa Vista",commonName:z,validityDays:825,verbose:G||!1,subjectAltNames:[{type:2,value:z},{type:2,value:`*.${z.split(".").slice(1).join(".")}`},{type:2,value:"localhost"},{type:2,value:"*.localhost"}]};if(G)B.info("Generating Root CA certificate...");let W=await Q(U);if(G)B.info(`Generating host certificate for ${z}...`);let A=await K({...U,rootCA:{certificate:W.certificate,privateKey:W.privateKey}});if(Z.writeFileSync(U.caCertPath,W.certificate),Z.writeFileSync(U.certPath,A.certificate),Z.writeFileSync(U.keyPath,A.privateKey),G)B.success(`SSL certificates generated for ${z}`);return!0}catch(J){return B.error(`Failed to generate certificates: ${J}`),!1}}async function C(z={}){let G=z.domain||Y.env.APP_URL?.replace(/^https?:\/\//,"")||"stacks.localhost";if(G==="localhost"||G.startsWith("localhost:"))return B.info("Skipping SSL setup for localhost"),!0;let J=!0;if(!z.skipHosts){if(!await x(G,z.verbose)&&z.verbose)B.warn("Hosts file not updated - you may need to add the entry manually")}if(!O(G)){if(z.verbose)B.info("Generating SSL certificates...");if(!await R(G,z.verbose))return B.error("Failed to generate SSL certificates"),!1}if(!z.skipTrust&&!y(G)){if(!await D(G,z.verbose))B.warn("Certificate not trusted - you may see browser warnings"),J=!1}return J}function f(z){return F(z)&&O(z)}
|
|
7
|
-
export{F as Fa,x as Ga,O as Ha,y as Ia,D as Ja,R as Ka,C as La,f as Ma};
|
package/dist/chunk-nsvnqv8y.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Gb as z}from"./chunk-tsbk5vne.js";import A from"process";import{log as v}from"@stacksjs/logging";import{componentsPath as J,functionsPath as K,libraryEntryPath as N}from"@stacksjs/path";import{writeTextFile as O}from"@stacksjs/storage";import{kebabCase as M}from"@stacksjs/strings";import{ExitCode as B}from"@stacksjs/types";import{determineResetPreset as U}from"@stacksjs/utils";async function T(k){await V(k)}async function V(k){if(k==="web-components")await X();if(k==="functions")await Y()}async function X(k="web-components"){v.info("Ensuring Web Component Library Entry Point..."),await O({path:N(k),data:Q(k)}).catch((q)=>{v.error("There was an error generating the Web Component library entry point",q),A.exit(B.FatalError)}),v.success("Created Web Component Library Entry Point")}async function Y(k="functions"){v.info("Ensuring Function Library Entry Point..."),await O({path:N(k),data:Q(k)}).catch((q)=>{v.error("There was an error generating Function Library Entry Point",q),A.exit(B.FatalError)}),v.success("Created Functions Library Entry Point")}function Q(k){let q=[];if(k==="functions"){if(!z.functions?.files)v.error(Error("There are no functions defined to be built. Please check your config/library.ts file for potential adjustments")),A.exit(B.FatalError);for(let j of z.functions.files)if(Array.isArray(j))q.push(`export * as ${j[1]} from '${K(j[0])}'`);else q.push(`export * from '${K(j)}'`);return q.join(`\r
|
|
3
|
-
`)}q=U();let G=[...q,"import { defineCustomElement } from 'vue'"],H=[],I=[];if(!z.webComponents?.tags)v.error(Error("There are no components defined to be built. Please check your config/library.ts file for potential adjustments")),A.exit(B.FatalError);for(let j of z.webComponents.tags.map((S)=>S.name))if(Array.isArray(j))G.push(`import ${j[1]} from '${J(j[0])}.vue'`),H.push(`const ${j[1]}CustomElement = defineCustomElement(${j[1]})`),I.push(`customElements.define('${M(j[1])}', ${j[1]}CustomElement)`);else G.push(`import ${j} from '${J(j)}.vue'`),H.push(`const ${j}CustomElement = defineCustomElement(${j})`),I.push(`customElements.define('${M(j)}', ${j}CustomElement)`);return[...G,...H,...I].join(`\r
|
|
4
|
-
`)}
|
|
5
|
-
export{T as Sa,V as Ta,X as Ua,Y as Va,Q as Wa};
|
package/dist/chunk-nty6mmx4.js
DELETED
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var f={action:`import { Action } from '@stacksjs/actions'
|
|
3
|
-
|
|
4
|
-
export default new Action({
|
|
5
|
-
name: '{0}',
|
|
6
|
-
description: '{0} action',
|
|
7
|
-
|
|
8
|
-
handle() {
|
|
9
|
-
return 'Hello World action'
|
|
10
|
-
},
|
|
11
|
-
})`,actionWithValidation:`import { Action } from '@stacksjs/actions'
|
|
12
|
-
import { schema, validate } from '@stacksjs/validation'
|
|
13
|
-
|
|
14
|
-
export default new Action({
|
|
15
|
-
name: '{0}',
|
|
16
|
-
description: '{0} action',
|
|
17
|
-
|
|
18
|
-
async handle(request) {
|
|
19
|
-
// Replace these rules with whatever this action expects. The
|
|
20
|
-
// returned object is typed to the rule shape; type-narrow further
|
|
21
|
-
// by passing a generic to validate<Payload>().
|
|
22
|
-
const data = await validate(request, {
|
|
23
|
-
// example: title: schema.string().required().min(1),
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
return { ok: true, data }
|
|
27
|
-
},
|
|
28
|
-
})`,actionWithAuth:`import { Action } from '@stacksjs/actions'
|
|
29
|
-
|
|
30
|
-
export default new Action({
|
|
31
|
-
name: '{0}',
|
|
32
|
-
description: '{0} action (authenticated)',
|
|
33
|
-
|
|
34
|
-
async handle(request) {
|
|
35
|
-
const user = await request.user()
|
|
36
|
-
if (!user) {
|
|
37
|
-
return new Response('Unauthorized', { status: 401 })
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return { ok: true, userId: user.id }
|
|
41
|
-
},
|
|
42
|
-
})`,actionWithBoth:`import { Action } from '@stacksjs/actions'
|
|
43
|
-
import { schema, validate } from '@stacksjs/validation'
|
|
44
|
-
|
|
45
|
-
export default new Action({
|
|
46
|
-
name: '{0}',
|
|
47
|
-
description: '{0} action (authenticated + validated)',
|
|
48
|
-
|
|
49
|
-
async handle(request) {
|
|
50
|
-
const user = await request.user()
|
|
51
|
-
if (!user) {
|
|
52
|
-
return new Response('Unauthorized', { status: 401 })
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const data = await validate(request, {
|
|
56
|
-
// example: title: schema.string().required().min(1),
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
return { ok: true, userId: user.id, data }
|
|
60
|
-
},
|
|
61
|
-
})`,component:`<script setup lang="ts">
|
|
62
|
-
console.log('Hello World component created')
|
|
63
|
-
</script>
|
|
64
|
-
|
|
65
|
-
<template>
|
|
66
|
-
<div>
|
|
67
|
-
Some HTML block
|
|
68
|
-
</div>
|
|
69
|
-
</template>`,page:`<script setup lang="ts">
|
|
70
|
-
console.log('Hello World page created')
|
|
71
|
-
</script>
|
|
72
|
-
|
|
73
|
-
<template>
|
|
74
|
-
<div>
|
|
75
|
-
Visit http://127.0.0.1/{0}
|
|
76
|
-
</div>
|
|
77
|
-
</template>`,function:`// reactive state
|
|
78
|
-
const {0} = ref(0)
|
|
79
|
-
|
|
80
|
-
// functions that mutate state and trigger updates
|
|
81
|
-
function increment() {
|
|
82
|
-
{0}.value++
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export {
|
|
86
|
-
{0},
|
|
87
|
-
increment,
|
|
88
|
-
}`,language:`button:
|
|
89
|
-
text: Copy`,notification:`import type { {0} } from '@stacksjs/types'
|
|
90
|
-
|
|
91
|
-
function content(): string {
|
|
92
|
-
return 'example'
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function send(): {0} {
|
|
96
|
-
return {
|
|
97
|
-
content: content(),
|
|
98
|
-
}
|
|
99
|
-
}`,mail:`import { Mailable } from '@stacksjs/email'
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Props passed into the {0} email. Add the fields your template
|
|
103
|
-
* needs and they'll flow through to the stx template's \`props\` \u2014
|
|
104
|
-
* \`Mailable<{0}Props>\` ensures \`.template()\` and \`this.props\`
|
|
105
|
-
* type-check against this shape (stacksjs/stacks#1903).
|
|
106
|
-
*/
|
|
107
|
-
export interface {0}Props extends Record<string, unknown> {
|
|
108
|
-
/** Recipient email address. */
|
|
109
|
-
to: string
|
|
110
|
-
/** Display name for the greeting (falls back to 'there'). */
|
|
111
|
-
userName?: string
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* {0} mailable. Subclass of \`Mailable<{0}Props>\` \u2014 \`build()\` wires the
|
|
116
|
-
* recipient / subject / template (props typed against \`{0}Props\`),
|
|
117
|
-
* then \`send()\` (inherited) dispatches via the configured mail driver.
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* \`\`\`ts
|
|
121
|
-
* await new {0}({ to: 'user@example.com', userName: 'Ada' }).send()
|
|
122
|
-
* \`\`\`
|
|
123
|
-
*/
|
|
124
|
-
export class {0} extends Mailable<{0}Props> {
|
|
125
|
-
constructor(private readonly props: {0}Props) {
|
|
126
|
-
super()
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
build(): this {
|
|
130
|
-
return this
|
|
131
|
-
.to(this.props.to)
|
|
132
|
-
.subject('{0}')
|
|
133
|
-
.template('{1}', {
|
|
134
|
-
to: this.props.to,
|
|
135
|
-
userName: this.props.userName ?? 'there',
|
|
136
|
-
})
|
|
137
|
-
}
|
|
138
|
-
}`,mailTemplate:`<script server>
|
|
139
|
-
// Generated by \`buddy make:mail {0}\`. Edit freely \u2014 \`props\` is the
|
|
140
|
-
// object passed by the Mailable's \`build()\`.
|
|
141
|
-
const appName = props.appName || 'Stacks'
|
|
142
|
-
const appUrl = props.appUrl || 'https://stacksjs.com'
|
|
143
|
-
const userName = props.userName || 'there'
|
|
144
|
-
const primaryColor = props.primaryColor || '#3451b2'
|
|
145
|
-
const primaryColorDark = props.primaryColorDark || '#2a4198'
|
|
146
|
-
const subject = props.subject || '{0}'
|
|
147
|
-
const year = props.year || new Date().getFullYear()
|
|
148
|
-
</script>
|
|
149
|
-
|
|
150
|
-
<!DOCTYPE html>
|
|
151
|
-
<html lang="en">
|
|
152
|
-
<head>
|
|
153
|
-
<meta charset="UTF-8">
|
|
154
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
155
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
156
|
-
<title>{{ subject }}</title>
|
|
157
|
-
<style>
|
|
158
|
-
.button { display: inline-block; padding: 14px 32px; background-color: {{ primaryColor }}; color: #ffffff !important; text-decoration: none; border-radius: 6px; font-weight: 600; font-size: 16px; text-align: center; }
|
|
159
|
-
.button:hover { background-color: {{ primaryColorDark }}; }
|
|
160
|
-
@media only screen and (max-width: 600px) {
|
|
161
|
-
.container { width: 100% !important; padding: 20px !important; }
|
|
162
|
-
.content { padding: 24px !important; }
|
|
163
|
-
.button { display: block !important; width: 100% !important; }
|
|
164
|
-
}
|
|
165
|
-
</style>
|
|
166
|
-
</head>
|
|
167
|
-
<body style="margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background-color: #f4f4f5; line-height: 1.6;">
|
|
168
|
-
<table role="presentation" cellpadding="0" cellspacing="0" style="width: 100%; border-collapse: collapse;">
|
|
169
|
-
<tr>
|
|
170
|
-
<td style="padding: 40px 20px;">
|
|
171
|
-
<table role="presentation" cellpadding="0" cellspacing="0" class="container" style="max-width: 600px; margin: 0 auto; background-color: #ffffff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);">
|
|
172
|
-
<tr>
|
|
173
|
-
<td style="background-color: {{ primaryColor }}; padding: 30px 40px; text-align: center;">
|
|
174
|
-
<h1 style="margin: 0; color: #ffffff; font-size: 24px; font-weight: 600;">{{ appName }}</h1>
|
|
175
|
-
</td>
|
|
176
|
-
</tr>
|
|
177
|
-
<tr>
|
|
178
|
-
<td class="content" style="padding: 40px;">
|
|
179
|
-
<h2 style="margin: 0 0 20px; color: #111827; font-size: 20px; font-weight: 600;">{0}</h2>
|
|
180
|
-
<p style="margin: 0 0 20px; color: #4b5563; font-size: 16px;">Hi {{ userName }},</p>
|
|
181
|
-
<p style="margin: 0 0 20px; color: #4b5563; font-size: 16px;">Your message body goes here.</p>
|
|
182
|
-
<table role="presentation" cellpadding="0" cellspacing="0" style="margin: 30px 0;">
|
|
183
|
-
<tr><td><a href="{{ appUrl }}" class="button">Open {{ appName }}</a></td></tr>
|
|
184
|
-
</table>
|
|
185
|
-
</td>
|
|
186
|
-
</tr>
|
|
187
|
-
<tr>
|
|
188
|
-
<td style="padding: 20px 40px; background-color: #f9fafb; border-top: 1px solid #e5e7eb;">
|
|
189
|
-
<p style="margin: 0; color: #6b7280; font-size: 12px; text-align: center;">This is an automated message from {{ appName }}.</p>
|
|
190
|
-
<p style="margin: 10px 0 0; color: #9ca3af; font-size: 11px; text-align: center;">© {{ year }} {{ appName }}. All rights reserved.</p>
|
|
191
|
-
</td>
|
|
192
|
-
</tr>
|
|
193
|
-
</table>
|
|
194
|
-
</td>
|
|
195
|
-
</tr>
|
|
196
|
-
</table>
|
|
197
|
-
</body>
|
|
198
|
-
</html>`,middleware:`import type { Request } from '@stacksjs/router'
|
|
199
|
-
import { Middleware } from '@stacksjs/router'
|
|
200
|
-
|
|
201
|
-
export default new Middleware({
|
|
202
|
-
name: '{0}',
|
|
203
|
-
priority: 1,
|
|
204
|
-
async handle(request: Request) {
|
|
205
|
-
// Your middleware logic here
|
|
206
|
-
},
|
|
207
|
-
})`,model:`import { defineModel } from '@stacksjs/orm'
|
|
208
|
-
import { schema } from '@stacksjs/validation'
|
|
209
|
-
|
|
210
|
-
export default defineModel({
|
|
211
|
-
name: '{0}',
|
|
212
|
-
table: '{1}',
|
|
213
|
-
primaryKey: 'id',
|
|
214
|
-
autoIncrement: true,
|
|
215
|
-
|
|
216
|
-
traits: {
|
|
217
|
-
useTimestamps: true,
|
|
218
|
-
|
|
219
|
-
useSeeder: {
|
|
220
|
-
count: 10,
|
|
221
|
-
},
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
attributes: {
|
|
225
|
-
// your attributes here
|
|
226
|
-
},
|
|
227
|
-
} as const)`,migration:`import type { Database } from '@stacksjs/database'
|
|
228
|
-
|
|
229
|
-
export async function up(db: Database): Promise<void> {
|
|
230
|
-
await db.schema
|
|
231
|
-
.createTable('{0}')
|
|
232
|
-
.addColumn('id', 'integer', col => col.autoIncrement().primaryKey())
|
|
233
|
-
.execute()
|
|
234
|
-
}`,stackPackageJson:`{
|
|
235
|
-
"name": "{0}",
|
|
236
|
-
"version": "0.0.1",
|
|
237
|
-
"type": "module",
|
|
238
|
-
"stacks": {
|
|
239
|
-
"name": "{1}",
|
|
240
|
-
"description": "A Stacks extension"
|
|
241
|
-
}
|
|
242
|
-
}`,job:`import { Job } from '@stacksjs/jobs'
|
|
243
|
-
|
|
244
|
-
export default new Job({
|
|
245
|
-
name: '{0}',
|
|
246
|
-
description: '{0} job',
|
|
247
|
-
|
|
248
|
-
async handle() {
|
|
249
|
-
// Your job logic here
|
|
250
|
-
console.log('Job executed')
|
|
251
|
-
},
|
|
252
|
-
})`,event:`import { Event } from '@stacksjs/events'
|
|
253
|
-
|
|
254
|
-
export default new Event({
|
|
255
|
-
name: '{0}',
|
|
256
|
-
description: '{0} event',
|
|
257
|
-
|
|
258
|
-
async handle(data: any) {
|
|
259
|
-
// Your event handler logic here
|
|
260
|
-
console.log('Event handled:', data)
|
|
261
|
-
},
|
|
262
|
-
})`,listener:`import { Listener } from '@stacksjs/events'
|
|
263
|
-
|
|
264
|
-
export default new Listener({
|
|
265
|
-
name: '{0}',
|
|
266
|
-
description: '{0} listener',
|
|
267
|
-
|
|
268
|
-
async handle(data: any) {
|
|
269
|
-
// Your listener logic here
|
|
270
|
-
console.log('Listener triggered:', data)
|
|
271
|
-
},
|
|
272
|
-
})`,command:`import { Command } from '@stacksjs/cli'
|
|
273
|
-
|
|
274
|
-
export default new Command({
|
|
275
|
-
name: '{0}',
|
|
276
|
-
description: '{0} command',
|
|
277
|
-
|
|
278
|
-
async handle() {
|
|
279
|
-
// Your command logic here
|
|
280
|
-
console.log('Command executed')
|
|
281
|
-
},
|
|
282
|
-
})`};
|
|
283
|
-
export{f as S};
|
package/dist/chunk-s735m9mg.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// @bun
|
package/dist/chunk-tpb8jgsk.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Gb as z}from"./chunk-tsbk5vne.js";import{err as A,ok as B}from"@stacksjs/error-handling";import{log as q}from"@stacksjs/logging";import{customElementsDataPath as G}from"@stacksjs/path";import{writeTextFile as H}from"@stacksjs/storage";function J(){return`{
|
|
3
|
-
"version": 1.1,
|
|
4
|
-
"tags": ${JSON.stringify(z.webComponents?.tags)}
|
|
5
|
-
}
|
|
6
|
-
`}async function Q(){try{return q.info("Generating custom-elements.json..."),await H({path:G(),data:J()}),q.success("Generated custom-elements.json for IDEs."),B(void 0)}catch(v){return q.error("There was an error generating the custom-elements.json file.",v),A("There was an error generating the custom-elements.json file.")}}async function R(){q.info("Generating web-types.json..."),q.info("This feature is not yet implemented.")}
|
|
7
|
-
export{Q as Eb,R as Fb};
|
package/dist/chunk-tsbk5vne.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var b={name:"hello-world",owner:"@stacksjs",repository:"stacksjs/stacks",license:"MIT",author:"Chris Breuer",contributors:["Chris Breuer <chris@stacksjs.com>"],defaultLanguage:"en",releaseable:!0,webComponents:{name:"hello-world-elements",description:"Your framework agnostic web component library description.",keywords:["custom-elements","web-components","library","framework-agnostic","typescript","javascript"],tags:[{name:["HelloWorld","AppHelloWorld"],description:"The Hello World custom element, built via this framework.",attributes:[{name:"greeting",description:"The greeting."}]}]},functions:{name:"hello-world-fx",description:"Your function library description.",keywords:["functions","composables","library","typescript","javascript"],shouldGenerateSourcemap:!1,files:["counter","dark"]}};
|
|
3
|
-
export{b as Gb};
|
package/dist/chunk-xg9xscqz.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// @bun
|
package/dist/chunk-y6e448he.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Lb as U}from"./chunk-h3d81wrg.js";import{frameworkPath as E,join as W,path as R,projectPath as L}from"@stacksjs/path";import{existsSync as T,globSync as j,mkdirSync as I,writeFileSync as F}from"@stacksjs/storage";import{readFileSync as v}from"fs";var $=null;async function P(){if($)return $;try{$=(await import("@stacksjs/ts-md")).parseMarkdown}catch{$=(q)=>q}return $}function M(q){if(!q)return"";return $?$(q):q}async function p(){await P();let q=j(["components/*.stx","components/**/*.stx","resources/components/**/*.stx","storage/framework/defaults/resources/components/**/*.stx"],{cwd:L(),absolute:!0}),G=E("component-meta");if(!T(G))I(G,{recursive:!0});for(let X of q){let Q=R.parse(X).name,H=B(X),z=W(G,`${Q}.json`);F(z,JSON.stringify(H,null,2))}}function B(q){let G=v(q,"utf8"),X=b(G),Q=x(G),H=X?D(X):[],z=X?f(X):[],Z=h(Q);return{props:H,events:z,slots:Z}}function b(q){let G=/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i.exec(q);if(G?.[1])return G[1];return/<script\b[^>]*>([\s\S]*?)<\/script>/i.exec(q)?.[1]??null}function x(q){let G=/<template\b[^>]*>([\s\S]*?)<\/template>/i.exec(q);if(G?.[1])return G[1];return q.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"")}function D(q){let G=w(q),X=S(q,G);if(!X)return[];let Q=k(X,G),H=g(q);return Q.map((z)=>{return{name:z.required?z.name:`${z.name}?`,description:M(z.description),type:z.type,default:H[z.name]??z.default??"unknown",required:z.required}})}function w(q){let G=new Map,X=/(?:export\s+)?interface\s+([A-Z][\w$]*)\s*(?:extends\s+[\w$,\s]+)?\s*\{/g,Q;while((Q=X.exec(q))!==null){let z=Q[1];if(!z)continue;let Z=Q.index+Q[0].length,Y=K(q,Z-1,"{","}");if(Y!==null)G.set(z,Y)}let H=/(?:export\s+)?type\s+([A-Z][\w$]*)\s*=\s*\{/g;while((Q=H.exec(q))!==null){let z=Q[1];if(!z)continue;let Z=Q.index+Q[0].length,Y=K(q,Z-1,"{","}");if(Y!==null)G.set(z,Y)}return G}function S(q,G){let Q=/defineProps\s*<\s*([\s\S]+?)\s*>\s*\(/.exec(q),H=Q?.[1]?.trim();if(!Q||!H)return null;if(H.startsWith("{")){let Z=q.indexOf("{",Q.index);return K(q,Z,"{","}")}let z=H.replace(/[<>(].*$/,"").split("&")[0]?.trim();if(!z)return null;return G.get(z)??null}function k(q,G){let X=[],Q=N(q,[";",`
|
|
3
|
-
`]),H="";for(let z of Q){let Z=z.trim();if(!Z)continue;let Y=/^\/\*\*([\s\S]*?)\*\/\s*([\s\S]*)$/.exec(Z);if(Y){H=(Y[1]??"").split(`
|
|
4
|
-
`).map((A)=>A.replace(/^\s*\*\s?/,"")).join(`
|
|
5
|
-
`).trim();let C=(Y[2]??"").trim();if(!C)continue;let J=V(C,H,G);if(J)X.push(J);H="";continue}if(Z.startsWith("//")){H=Z.replace(/^\/\/\s?/,"");continue}let _=V(Z,H,G);if(_)X.push(_);H=""}return X}function V(q,G,X){if(/^[a-zA-Z_$][\w$]*\s*\(/.test(q.trimStart()))return null;let Q=/^([a-zA-Z_$][\w$]*)\s*(\??)\s*:\s*([\s\S]+?)\s*[;,]?\s*$/.exec(q);if(!Q)return null;let H=Q[1],z=Q[2]??"",Z=Q[3];if(!H||!Z)return null;return{name:H,type:O(Z),required:z!=="?",description:G}}function g(q){let G={},X=/const\s*\{\s*([\s\S]*?)\s*\}\s*=\s*(?:withDefaults\s*\(\s*)?defineProps/g,Q;while((Q=X.exec(q))!==null)if(Q[1])y(Q[1],G);let H=q.indexOf("withDefaults(");if(H>=0){let z=q.indexOf("defineProps",H);if(z>0){let Z=q.indexOf(">",z),Y=q.indexOf(")",Z>=0?Z:z);if(Y>0){let _=q.indexOf(",",Y),C=_>=0?q.indexOf("{",_):-1;if(C>0){let J=K(q,C,"{","}");if(J)u(J,G)}}}}return G}function y(q,G){for(let X of N(q,[","])){let Q=/^\s*([a-zA-Z_$][\w$]*)\s*=\s*([\s\S]+?)\s*$/.exec(X),H=Q?.[1],z=Q?.[2];if(H&&z)G[H]=O(z)}}function u(q,G){for(let X of N(q,[","])){let Q=/^\s*([a-zA-Z_$][\w$]*)\s*:\s*([\s\S]+?)\s*$/.exec(X.trim()),H=Q?.[1],z=Q?.[2];if(H&&z)G[H]=O(z)}}function f(q){let G=/defineEmits\s*<\s*\{([\s\S]*?)\}\s*>\s*\(/.exec(q);if(!G?.[1])return[];let X=[];for(let Q of N(G[1],[";",`
|
|
6
|
-
`])){let H=Q.trim();if(!H)continue;let z=/^['"]?([\w-]+)['"]?\s*:\s*\[(.*?)\]\s*$/.exec(H);if(z){let Y=z[1];if(!Y)continue;X.push({name:Y,type:z[2]?.trim()||"void",description:""});continue}let Z=/^([a-zA-Z_$][\w$]*)\s*\(([\s\S]*?)\)\s*:\s*([\s\S]+)$/.exec(H);if(Z){let Y=Z[1];if(!Y)continue;X.push({name:Y,type:Z[2]?.trim()||"void",description:""})}}return X}function h(q){let G=[],X=new Set,Q=/<slot\b([^>]*)>/g,H;while((H=Q.exec(q))!==null){let z=H[1]??"",Y=/\bname\s*=\s*["']([^"']+)["']/.exec(z)?.[1]??"default";if(X.has(Y))continue;X.add(Y),G.push({name:Y,description:""})}return G}function K(q,G,X,Q){if(q[G]!==X)return null;let H=0,z=G,Z=null;while(z<q.length){let Y=q[z];if(Y===void 0)break;if(Z){if(Y==="\\"){z+=2;continue}if(Y===Z)Z=null;z++;continue}if(Y==='"'||Y==="'"||Y==="`"){Z=Y,z++;continue}if(Y===X)H++;else if(Y===Q){if(H--,H===0)return q.slice(G+1,z)}z++}return null}function N(q,G){let X=[],Q=new Set(G),H=0,z=null,Z=0;for(let Y=0;Y<q.length;Y++){let _=q[Y];if(_===void 0)break;if(z){if(_==="\\"){Y++;continue}if(_===z)z=null;continue}if(_==='"'||_==="'"||_==="`"){z=_;continue}if(_==="{"||_==="["||_==="("||_==="<")H++;else if(_==="}"||_==="]"||_===")"||_===">")H--;else if(H===0&&Q.has(_))X.push(q.slice(Z,Y)),Z=Y+1}return X.push(q.slice(Z)),X}function O(q){return q.replace(/\s+/g," ").trim()}
|
|
7
|
-
export{p as Qa,B as Ra};
|