@stacksjs/actions 0.70.44 → 0.70.53
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/LICENSE.md +21 -0
- package/dist/action.d.ts +104 -17
- package/dist/blog.d.ts +12 -0
- package/dist/build/frontend-static.d.ts +16 -0
- package/dist/chunk-00qp27jy.js +93 -0
- package/dist/{chunk-jd1yzkq5.js → chunk-23thftnv.js} +1 -1
- package/dist/chunk-4qzb8g3z.js +3 -0
- package/dist/chunk-5dfz9en9.js +920 -0
- package/dist/{chunk-3beht8ja.js → chunk-5hwp0frq.js} +1 -1
- package/dist/{chunk-aw6d8zr3.js → chunk-5pwpk005.js} +2 -2
- package/dist/chunk-604jy79b.js +5 -0
- package/dist/{chunk-wnrgcx3d.js → chunk-63swek9d.js} +2 -2
- package/dist/chunk-67am4dae.js +688 -0
- package/dist/{chunk-gt77jmb5.js → chunk-8gbewxns.js} +1 -1
- package/dist/chunk-8r76qydb.js +240 -0
- package/dist/{chunk-schcaf73.js → chunk-9x17v4x2.js} +2 -2
- package/dist/chunk-aazd6qpv.js +3 -0
- package/dist/{chunk-n2fd1d0m.js → chunk-ag4fy7cx.js} +1 -1
- package/dist/{chunk-2qchdrf9.js → chunk-badehrwa.js} +1 -1
- package/dist/chunk-dbz9dp2h.js +3 -0
- package/dist/{chunk-v0wnrnaa.js → chunk-e8505qz8.js} +2 -2
- package/dist/chunk-jv7ry09n.js +3 -0
- package/dist/{chunk-w418anbq.js → chunk-jve1p4dz.js} +2 -2
- package/dist/chunk-mcwfmqzb.js +283 -0
- package/dist/chunk-n24m8prb.js +3 -0
- package/dist/{chunk-h93n2j40.js → chunk-nm9h5rye.js} +2 -2
- package/dist/{chunk-60qjz7zb.js → chunk-ny1racy0.js} +2 -2
- package/dist/{chunk-2gh7kgpc.js → chunk-p601xr03.js} +1 -1
- package/dist/{chunk-x471rxrn.js → chunk-pqnzp7x8.js} +2 -2
- package/dist/chunk-rj1cbghx.js +17 -0
- package/dist/chunk-rzhs51h1.js +3 -0
- package/dist/{chunk-7bpdkc40.js → chunk-sp5cjdhd.js} +213 -76
- package/dist/chunk-tqax3gbq.js +16 -0
- package/dist/{chunk-c8qt2xst.js → chunk-vsj8ns4p.js} +1 -1
- package/dist/{chunk-rdajkt2s.js → chunk-x8nrbsk1.js} +2 -2
- package/dist/dev/dashboard-utils.d.ts +19 -1
- package/dist/dev/migrate-watcher.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/make.d.ts +19 -0
- package/dist/queue/dlq-purge.d.ts +1 -0
- package/dist/queue/dlq-retry.d.ts +1 -0
- package/dist/queue/dlq.d.ts +1 -0
- package/dist/queue/list.d.ts +1 -0
- package/dist/queue/pause.d.ts +1 -0
- package/dist/queue/quarantine.d.ts +1 -0
- package/dist/queue/resume.d.ts +1 -0
- package/dist/queue/unquarantine.d.ts +1 -0
- package/dist/src/action.js +1 -1
- package/dist/src/actions.js +1 -1
- package/dist/src/add.js +1 -1
- package/dist/src/ai/request-model-access.js +1 -1
- package/dist/src/auth/setup.js +82 -24
- package/dist/src/blog.js +102 -0
- package/dist/src/build/core.js +1 -1
- package/dist/src/build/frontend-static.js +9 -0
- package/dist/src/build/views.js +1 -1
- package/dist/src/build.js +1 -1
- package/dist/src/commit.js +1 -1
- package/dist/src/database/seed.js +1 -1
- package/dist/src/deploy/index.js +38 -45
- package/dist/src/dev/api.js +4 -4
- package/dist/src/dev/dashboard-globals.js +1 -1
- package/dist/src/dev/dashboard-utils.js +1 -1
- package/dist/src/dev/dashboard.js +6 -6
- package/dist/src/dev/docs.js +1 -1
- package/dist/src/dev/index.js +1 -1
- package/dist/src/dev/migrate-watcher.js +2 -0
- package/dist/src/dev/views.js +1 -1
- package/dist/src/discover-packages.js +1 -1
- package/dist/src/examples.js +1 -1
- package/dist/src/generate/component-meta.js +1 -1
- package/dist/src/generate/env-files.js +1 -1
- package/dist/src/generate/ide-helpers.js +1 -1
- package/dist/src/generate/index.js +1 -1
- package/dist/src/generate/lib-entries.js +1 -1
- package/dist/src/generate/vscode-custom-data.js +1 -1
- package/dist/src/helpers/component-meta.js +1 -1
- package/dist/src/helpers/index.js +1 -1
- package/dist/src/helpers/lib-entries.js +1 -1
- package/dist/src/helpers/package-json.js +1 -1
- package/dist/src/helpers/utils.js +1 -1
- package/dist/src/helpers/vscode-custom-data.js +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/key-generate.js +1 -1
- package/dist/src/make-command.js +1 -1
- package/dist/src/make-job.js +1 -1
- package/dist/src/make-policy.js +1 -1
- package/dist/src/make-resource.js +1 -1
- package/dist/src/make.js +1 -1
- package/dist/src/migrate/fresh.js +1 -1
- package/dist/src/orm/base.js +1 -1
- package/dist/src/queue/dlq-purge.js +2 -0
- package/dist/src/queue/dlq-retry.js +2 -0
- package/dist/src/queue/dlq.js +5 -0
- package/dist/src/queue/failed.js +4 -4
- package/dist/src/queue/list.js +5 -0
- package/dist/src/queue/pause.js +2 -0
- package/dist/src/queue/quarantine.js +3 -0
- package/dist/src/queue/resume.js +2 -0
- package/dist/src/queue/unquarantine.js +2 -0
- package/dist/src/release.js +1 -1
- package/dist/src/run-action.js +1 -1
- package/dist/src/scaffold-crud.js +1 -1
- package/dist/src/serve/api.js +1 -1
- package/dist/src/setup/index.js +1 -1
- package/dist/src/setup/ssl.js +1 -1
- package/dist/src/stacks.js +1 -1
- package/dist/src/templates.js +1 -1
- package/dist/src/types.js +1 -1
- package/dist/src/upgrade/dependencies.js +1 -1
- package/dist/src/upgrade/framework-utils.js +1 -1
- package/dist/src/upgrade/framework.js +5 -5
- package/dist/src/upgrade/index.js +1 -1
- package/dist/src/upgrade.js +1 -1
- package/dist/upgrade/framework-utils.d.ts +48 -0
- package/package.json +18 -18
- package/dist/chunk-2kaj93p5.js +0 -3
- package/dist/chunk-3086k7zk.js +0 -184
- package/dist/chunk-67y94dzt.js +0 -658
- package/dist/chunk-6x1m5rkr.js +0 -17
- package/dist/chunk-96b7fcmd.js +0 -3
- package/dist/chunk-d4srk6ma.js +0 -3
- package/dist/chunk-kzhgexj4.js +0 -3
- package/dist/chunk-n1y0gpv6.js +0 -3
- package/dist/chunk-n2x7v39b.js +0 -5
- package/dist/chunk-tc935b45.js +0 -93
- package/dist/chunk-wv5yb5wb.js +0 -101
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{pb as U}from"./chunk-4qzb8g3z.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
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
4
|
`).map((A)=>A.replace(/^\s*\*\s?/,"")).join(`
|
|
5
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
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
|
|
7
|
+
export{p as ia,B as ja};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-4qzb8g3z.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:"./buddy serve",port:3000,preStart:["bun install"]},api:{root:".",start:"./buddy serve:api",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};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{pb as G}from"./chunk-4qzb8g3z.js";import{log as x}from"@stacksjs/logging";import*as z from"@stacksjs/path";import{doesExist as H,writeFile as I}from"@stacksjs/storage";async function O(q){let j=q.name;if(!j)return x.error("Resource name is required"),!1;let v=j.endsWith("Resource")?j:`${j}Resource`,A=q.model||v.replace("Resource",""),F=q.collection?K(v,A):J(v,A),B=z.appPath("Resources");if(!H(B)){let{mkdirSync:w}=await import("@stacksjs/storage");w(B,{recursive:!0})}let E=z.appPath(`Resources/${v}.ts`);try{return await I(E,F),x.success(`Created resource: ${E}`),!0}catch(w){return x.error(`Failed to create resource: ${w.message}`),!1}}function J(q,j){return`import type { Request } from '@stacksjs/router'
|
|
3
3
|
import { JsonResource } from '@stacksjs/api'
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -111,4 +111,4 @@ export default class ${q} extends ResourceCollection<${j}, ${v}> {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
`}
|
|
114
|
-
export{O as
|
|
114
|
+
export{O as D};
|