@stacksjs/buddy 0.64.5 → 0.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-1bcxd9nx.js +5 -0
- package/dist/chunk-1bcxd9nx.js.map +17 -0
- package/dist/chunk-3gvx3tap.js +5 -0
- package/dist/{chunk-wmfxrbxe.js.map → chunk-3gvx3tap.js.map} +1 -1
- package/dist/chunk-5mkzknp4.js +5 -0
- package/dist/{chunk-4b0aba5k.js.map → chunk-5mkzknp4.js.map} +13 -13
- package/dist/chunk-a3d48jzd.js +15 -0
- package/dist/chunk-a3d48jzd.js.map +164 -0
- package/dist/chunk-a6ba4vgs.js +5 -0
- package/dist/{chunk-6qhap62a.js.map → chunk-a6ba4vgs.js.map} +3 -3
- package/dist/{chunk-5eg9jpdw.js → chunk-agapayce.js} +3 -3
- package/dist/{chunk-5eg9jpdw.js.map → chunk-agapayce.js.map} +1 -1
- package/dist/chunk-b9d377d9.js +5 -0
- package/dist/{chunk-qkk1z4t3.js.map → chunk-b9d377d9.js.map} +9 -9
- package/dist/chunk-bh61bx6h.js +4 -0
- package/dist/{chunk-89jmvbwz.js.map → chunk-bh61bx6h.js.map} +2 -2
- package/dist/chunk-fqrjh7j8.js +5 -0
- package/dist/chunk-fqrjh7j8.js.map +10 -0
- package/dist/chunk-jkt9jxar.js +9 -0
- package/dist/{chunk-9f43d1kt.js.map → chunk-jkt9jxar.js.map} +3 -3
- package/dist/chunk-k1q2z202.js +4 -0
- package/dist/chunk-k1q2z202.js.map +16 -0
- package/dist/chunk-mmjggjd5.js +849 -0
- package/dist/chunk-mmjggjd5.js.map +240 -0
- package/dist/chunk-mxwvrbdh.js +6 -0
- package/dist/{chunk-a365bfhw.js.map → chunk-mxwvrbdh.js.map} +20 -17
- package/dist/chunk-n55kahn5.js +5 -0
- package/dist/{chunk-6a30kt0n.js.map → chunk-n55kahn5.js.map} +3 -3
- package/dist/chunk-pbpgcz3v.js +5 -0
- package/dist/{chunk-1f6t66bt.js.map → chunk-pbpgcz3v.js.map} +4 -4
- package/dist/chunk-sadghty0.js +5 -0
- package/dist/{chunk-0aqj22dq.js.map → chunk-sadghty0.js.map} +4 -4
- package/dist/chunk-smzpmhmp.js +11 -0
- package/dist/chunk-smzpmhmp.js.map +10 -0
- package/dist/chunk-w4zypt02.js +5 -0
- package/dist/{chunk-yxrf386g.js.map → chunk-w4zypt02.js.map} +4 -4
- package/dist/chunk-ywfsnx7v.js +5 -0
- package/dist/chunk-ywfsnx7v.js.map +22 -0
- package/dist/chunk-yxs8vtg9.js +5 -0
- package/dist/{chunk-b6hb11ta.js.map → chunk-yxs8vtg9.js.map} +2 -2
- package/dist/chunk-z7609s4h.js +12 -0
- package/dist/{chunk-knp3sj60.js.map → chunk-z7609s4h.js.map} +2 -2
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +3 -3
- package/dist/commands/add.d.ts +2 -0
- package/dist/commands/build.d.ts +2 -0
- package/dist/commands/changelog.d.ts +2 -0
- package/dist/commands/clean.d.ts +2 -0
- package/dist/commands/cloud.d.ts +2 -0
- package/dist/commands/commit.d.ts +2 -0
- package/dist/commands/configure.d.ts +2 -0
- package/dist/commands/create.d.ts +2 -0
- package/dist/commands/deploy.d.ts +2 -0
- package/dist/commands/dev.d.ts +3 -0
- package/dist/commands/dns.d.ts +2 -0
- package/dist/commands/domains.d.ts +2 -0
- package/dist/commands/fresh.d.ts +2 -0
- package/dist/commands/generate.d.ts +2 -0
- package/dist/commands/http.d.ts +2 -0
- package/dist/commands/index.d.ts +33 -0
- package/dist/commands/install.d.ts +2 -0
- package/dist/commands/key.d.ts +2 -0
- package/dist/commands/lint.d.ts +2 -0
- package/dist/commands/list.d.ts +2 -0
- package/dist/commands/make.d.ts +2 -0
- package/dist/commands/migrate.d.ts +2 -0
- package/dist/commands/outdated.d.ts +2 -0
- package/dist/commands/ports.d.ts +2 -0
- package/dist/commands/prepublish.d.ts +2 -0
- package/dist/commands/projects.d.ts +2 -0
- package/dist/commands/release.d.ts +2 -0
- package/dist/commands/route.d.ts +2 -0
- package/dist/commands/seed.d.ts +2 -0
- package/dist/commands/setup.d.ts +4 -0
- package/dist/commands/test.d.ts +2 -0
- package/dist/commands/tinker.d.ts +2 -0
- package/dist/commands/types.d.ts +2 -0
- package/dist/commands/upgrade.d.ts +2 -0
- package/dist/commands/version.d.ts +2 -0
- package/dist/custom-cli.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/stacks +0 -0
- package/package.json +50 -56
- package/src/cli.ts +10 -7
- package/src/commands/add.ts +2 -2
- package/src/commands/build.ts +50 -32
- package/src/commands/changelog.ts +2 -2
- package/src/commands/clean.ts +2 -2
- package/src/commands/cloud.ts +31 -12
- package/src/commands/commit.ts +2 -2
- package/src/commands/configure.ts +4 -3
- package/src/commands/create.ts +3 -3
- package/src/commands/deploy.ts +21 -10
- package/src/commands/dev.ts +38 -25
- package/src/commands/dns.ts +2 -2
- package/src/commands/domains.ts +2 -2
- package/src/commands/fresh.ts +2 -2
- package/src/commands/generate.ts +27 -3
- package/src/commands/http.ts +2 -2
- package/src/commands/index.ts +3 -3
- package/src/commands/install.ts +2 -2
- package/src/commands/key.ts +2 -2
- package/src/commands/lint.ts +7 -10
- package/src/commands/list.ts +2 -2
- package/src/commands/make.ts +12 -12
- package/src/commands/migrate.ts +2 -2
- package/src/commands/outdated.ts +3 -3
- package/src/commands/ports.ts +26 -16
- package/src/commands/prepublish.ts +2 -2
- package/src/commands/projects.ts +6 -4
- package/src/commands/release.ts +4 -3
- package/src/commands/route.ts +2 -2
- package/src/commands/seed.ts +2 -2
- package/src/commands/setup.ts +11 -7
- package/src/commands/test.ts +77 -54
- package/src/commands/tinker.ts +2 -2
- package/src/commands/types.ts +2 -2
- package/src/commands/upgrade.ts +20 -13
- package/src/commands/version.ts +2 -2
- package/src/custom-cli.ts +3 -2
- package/dist/chunk-0aqj22dq.js +0 -5
- package/dist/chunk-1f6t66bt.js +0 -5
- package/dist/chunk-4b0aba5k.js +0 -5
- package/dist/chunk-6a30kt0n.js +0 -5
- package/dist/chunk-6qhap62a.js +0 -5
- package/dist/chunk-89jmvbwz.js +0 -4
- package/dist/chunk-953dm442.js +0 -5
- package/dist/chunk-953dm442.js.map +0 -17
- package/dist/chunk-9f43d1kt.js +0 -9
- package/dist/chunk-a365bfhw.js +0 -6
- package/dist/chunk-b6hb11ta.js +0 -5
- package/dist/chunk-gc8bvwm2.js +0 -5
- package/dist/chunk-gc8bvwm2.js.map +0 -22
- package/dist/chunk-kkb03h19.js +0 -5
- package/dist/chunk-kkb03h19.js.map +0 -10
- package/dist/chunk-knp3sj60.js +0 -12
- package/dist/chunk-p9n9dek4.js +0 -21
- package/dist/chunk-p9n9dek4.js.map +0 -170
- package/dist/chunk-pe71p33y.js +0 -5
- package/dist/chunk-pe71p33y.js.map +0 -16
- package/dist/chunk-qkk1z4t3.js +0 -5
- package/dist/chunk-s03s5x4g.js +0 -7
- package/dist/chunk-s03s5x4g.js.map +0 -60
- package/dist/chunk-wmfxrbxe.js +0 -5
- package/dist/chunk-yxrf386g.js +0 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./commands";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import
|
|
2
|
+
import{A as C,B as D,C as E,D as F,E as G,F as H,G as I,H as J,I as K,J as L,a as e,b as f,c as m,d as p,e as t,f as x,g as a,h as b,i as c,j as d,k as g,l as h,m as i,n as j,o as k,p as l,q as n,r as q,s,t as u,u as v,v as w,w as y,x as z,y as A,z as B}from"./chunk-mmjggjd5.js";import"./chunk-z7609s4h.js";import"./chunk-a3d48jzd.js";import"./chunk-k1q2z202.js";import"./chunk-mxwvrbdh.js";import"./chunk-bh61bx6h.js";import"./chunk-yxs8vtg9.js";import"./chunk-fqrjh7j8.js";import"./chunk-smzpmhmp.js";import"./chunk-agapayce.js";import"./chunk-3gvx3tap.js";export{L as version,K as upgrade,J as types,I as tinker,H as test,d as startDevelopmentServer,E as setup,D as seed,C as route,B as release,A as projects,z as prepublish,y as ports,w as outdated,F as optimizePkgxDeps,v as migrate,u as make,s as list,q as lint,n as key,l as install,k as http,j as generate,i as fresh,G as ensureEnvIsSet,h as domains,g as dns,c as dev,b as deploy,a as create,x as configure,t as commit,p as cloud,m as clean,f as changelog,e as build};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=82A1EEF47F56914E64756E2164756E21
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
package/dist/stacks
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/buddy",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.65.0",
|
|
5
5
|
"description": "Meet Buddy. The Stacks runtime.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
|
+
"contributors": ["Chris Breuer <chris@stacksjs.org>"],
|
|
7
8
|
"license": "MIT",
|
|
8
9
|
"funding": "https://github.com/sponsors/chrisbbreuer",
|
|
9
10
|
"homepage": "https://github.com/stacksjs/stacks/tree/main/stacks#readme",
|
|
@@ -50,23 +51,16 @@
|
|
|
50
51
|
},
|
|
51
52
|
"module": "dist/index.js",
|
|
52
53
|
"types": "dist/index.d.ts",
|
|
53
|
-
"contributors": [
|
|
54
|
-
"Chris Breuer <chris@stacksjs.org>"
|
|
55
|
-
],
|
|
56
54
|
"bin": {
|
|
57
55
|
"stacks": "dist/cli.mjs",
|
|
58
56
|
"stx": "dist/cli.mjs",
|
|
59
57
|
"buddy": "dist/cli.mjs",
|
|
60
58
|
"bud": "dist/cli.mjs"
|
|
61
59
|
},
|
|
62
|
-
"files": [
|
|
63
|
-
"README.md",
|
|
64
|
-
"dist",
|
|
65
|
-
"src"
|
|
66
|
-
],
|
|
60
|
+
"files": ["README.md", "dist", "src"],
|
|
67
61
|
"scripts": {
|
|
68
|
-
"buddy": "bunx ./src/cli.ts",
|
|
69
|
-
"build": "bun
|
|
62
|
+
"buddy": "bunx --bun ./src/cli.ts",
|
|
63
|
+
"build": "bun build.ts && bun run compile",
|
|
70
64
|
"compile": "bun build ./bin/cli.ts --compile --minify --sourcemap --outfile dist/stacks",
|
|
71
65
|
"compile:linux:x64-modern": "bun build ./bin/cli.ts --compile --target=bun-linux-x64-modern --minify --sourcemap --outfile dist/stacks",
|
|
72
66
|
"compile:linux:x64-baseline": "bun build ./bin/cli.ts --compile --target=bun-linux-x64-baseline --minify --sourcemap --outfile dist/stacks",
|
|
@@ -75,56 +69,56 @@
|
|
|
75
69
|
"compile:windows:x64-baseline": "bun build ./bin/cli.ts --compile --target=bun-windows-x64-baseline --minify --sourcemap --outfile dist/stacks",
|
|
76
70
|
"compile:mac:arm64": "bun build ./bin/cli.ts --compile --target=bun-darwin-arm64 --minify --sourcemap --outfile dist/stacks",
|
|
77
71
|
"compile:mac:x64": "bun build ./bin/cli.ts --compile --target=bun-darwin-x64 --minify --sourcemap --outfile dist/stacks",
|
|
78
|
-
"typecheck": "bun
|
|
72
|
+
"typecheck": "bun tsc --noEmit",
|
|
79
73
|
"prepublishOnly": "bun run build"
|
|
80
74
|
},
|
|
81
75
|
"dependencies": {
|
|
82
|
-
"@stacksjs/actions": "
|
|
83
|
-
"@stacksjs/ai": "
|
|
84
|
-
"@stacksjs/alias": "
|
|
85
|
-
"@stacksjs/arrays": "
|
|
86
|
-
"@stacksjs/auth": "
|
|
87
|
-
"@stacksjs/build": "
|
|
88
|
-
"@stacksjs/cache": "
|
|
89
|
-
"@stacksjs/cli": "
|
|
90
|
-
"@stacksjs/cloud": "
|
|
91
|
-
"@stacksjs/collections": "
|
|
92
|
-
"@stacksjs/config": "
|
|
93
|
-
"@stacksjs/database": "
|
|
94
|
-
"@stacksjs/desktop": "
|
|
95
|
-
"@stacksjs/development": "
|
|
96
|
-
"@stacksjs/dns": "
|
|
97
|
-
"@stacksjs/docs": "
|
|
98
|
-
"@stacksjs/email": "
|
|
99
|
-
"@stacksjs/enums": "
|
|
100
|
-
"@stacksjs/error-handling": "
|
|
101
|
-
"@stacksjs/events": "
|
|
102
|
-
"@stacksjs/faker": "
|
|
103
|
-
"@stacksjs/git": "
|
|
104
|
-
"@stacksjs/health": "
|
|
105
|
-
"@stacksjs/lint": "
|
|
106
|
-
"@stacksjs/logging": "
|
|
107
|
-
"@stacksjs/notifications": "
|
|
108
|
-
"@stacksjs/objects": "
|
|
109
|
-
"@stacksjs/orm": "
|
|
110
|
-
"@stacksjs/path": "
|
|
111
|
-
"@stacksjs/payments": "
|
|
112
|
-
"@stacksjs/realtime": "
|
|
113
|
-
"@stacksjs/router": "
|
|
114
|
-
"@stacksjs/search-engine": "
|
|
115
|
-
"@stacksjs/security": "
|
|
116
|
-
"@stacksjs/server": "
|
|
117
|
-
"@stacksjs/storage": "
|
|
118
|
-
"@stacksjs/strings": "
|
|
119
|
-
"@stacksjs/testing": "
|
|
120
|
-
"@stacksjs/tunnel": "
|
|
121
|
-
"@stacksjs/types": "
|
|
122
|
-
"@stacksjs/ui": "
|
|
123
|
-
"@stacksjs/utils": "
|
|
124
|
-
"@stacksjs/validation": "
|
|
76
|
+
"@stacksjs/actions": "0.64.6",
|
|
77
|
+
"@stacksjs/ai": "0.64.6",
|
|
78
|
+
"@stacksjs/alias": "0.64.6",
|
|
79
|
+
"@stacksjs/arrays": "0.64.6",
|
|
80
|
+
"@stacksjs/auth": "0.64.6",
|
|
81
|
+
"@stacksjs/build": "0.64.6",
|
|
82
|
+
"@stacksjs/cache": "0.64.6",
|
|
83
|
+
"@stacksjs/cli": "0.64.6",
|
|
84
|
+
"@stacksjs/cloud": "0.64.6",
|
|
85
|
+
"@stacksjs/collections": "0.64.6",
|
|
86
|
+
"@stacksjs/config": "0.64.6",
|
|
87
|
+
"@stacksjs/database": "0.64.6",
|
|
88
|
+
"@stacksjs/desktop": "0.64.6",
|
|
89
|
+
"@stacksjs/development": "0.64.6",
|
|
90
|
+
"@stacksjs/dns": "0.64.6",
|
|
91
|
+
"@stacksjs/docs": "0.64.6",
|
|
92
|
+
"@stacksjs/email": "0.64.6",
|
|
93
|
+
"@stacksjs/enums": "0.64.6",
|
|
94
|
+
"@stacksjs/error-handling": "0.64.6",
|
|
95
|
+
"@stacksjs/events": "0.64.6",
|
|
96
|
+
"@stacksjs/faker": "0.64.6",
|
|
97
|
+
"@stacksjs/git": "0.64.6",
|
|
98
|
+
"@stacksjs/health": "0.64.6",
|
|
99
|
+
"@stacksjs/lint": "0.64.6",
|
|
100
|
+
"@stacksjs/logging": "0.64.6",
|
|
101
|
+
"@stacksjs/notifications": "0.64.6",
|
|
102
|
+
"@stacksjs/objects": "0.64.6",
|
|
103
|
+
"@stacksjs/orm": "0.64.6",
|
|
104
|
+
"@stacksjs/path": "0.64.6",
|
|
105
|
+
"@stacksjs/payments": "0.64.6",
|
|
106
|
+
"@stacksjs/realtime": "0.64.6",
|
|
107
|
+
"@stacksjs/router": "0.64.6",
|
|
108
|
+
"@stacksjs/search-engine": "0.64.6",
|
|
109
|
+
"@stacksjs/security": "0.64.6",
|
|
110
|
+
"@stacksjs/server": "0.64.6",
|
|
111
|
+
"@stacksjs/storage": "0.64.6",
|
|
112
|
+
"@stacksjs/strings": "0.64.6",
|
|
113
|
+
"@stacksjs/testing": "0.64.6",
|
|
114
|
+
"@stacksjs/tunnel": "0.64.6",
|
|
115
|
+
"@stacksjs/types": "0.64.6",
|
|
116
|
+
"@stacksjs/ui": "0.64.6",
|
|
117
|
+
"@stacksjs/utils": "0.64.6",
|
|
118
|
+
"@stacksjs/validation": "0.64.6"
|
|
125
119
|
},
|
|
126
120
|
"devDependencies": {
|
|
127
|
-
"@stacksjs/development": "
|
|
121
|
+
"@stacksjs/development": "0.64.6"
|
|
128
122
|
},
|
|
129
123
|
"config": {
|
|
130
124
|
"commitizen": {
|
package/src/cli.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { CAC } from '@stacksjs/cli'
|
|
1
2
|
import process from 'node:process'
|
|
2
3
|
import { runAction } from '@stacksjs/actions'
|
|
3
|
-
import type { CAC } from '@stacksjs/cli'
|
|
4
4
|
import { cli, log } from '@stacksjs/cli'
|
|
5
5
|
import { Action } from '@stacksjs/enums'
|
|
6
6
|
import { path as p } from '@stacksjs/path'
|
|
@@ -10,13 +10,13 @@ import * as cmd from './commands'
|
|
|
10
10
|
|
|
11
11
|
// setup global error handlers
|
|
12
12
|
process.on('uncaughtException', (error: Error) => {
|
|
13
|
-
log.debug('uncaughtException')
|
|
13
|
+
log.debug('Buddy uncaughtException')
|
|
14
14
|
log.error(error)
|
|
15
15
|
process.exit(1)
|
|
16
16
|
})
|
|
17
17
|
|
|
18
18
|
process.on('unhandledRejection', (error: Error) => {
|
|
19
|
-
log.debug('unhandledRejection'
|
|
19
|
+
log.debug('Buddy unhandledRejection')
|
|
20
20
|
log.error(error)
|
|
21
21
|
process.exit(1)
|
|
22
22
|
})
|
|
@@ -32,7 +32,8 @@ async function main() {
|
|
|
32
32
|
const isAppKeySet = await ensureProjectIsInitialized()
|
|
33
33
|
if (isAppKeySet) {
|
|
34
34
|
log.debug('Project is initialized')
|
|
35
|
-
}
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
36
37
|
log.info('Your `APP_KEY` is not yet set')
|
|
37
38
|
log.info('Generating application key...')
|
|
38
39
|
const result = await runAction(Action.KeyGenerate)
|
|
@@ -86,17 +87,19 @@ await main()
|
|
|
86
87
|
async function dynamicImports(buddy: CAC) {
|
|
87
88
|
// dynamically import and register commands from ./app/Commands/*
|
|
88
89
|
const commandsDir = p.appPath('Commands')
|
|
89
|
-
const commandFiles = fs.readdirSync(commandsDir).filter((file) => file.endsWith('.ts'))
|
|
90
|
+
const commandFiles = fs.readdirSync(commandsDir).filter((file: string) => file.endsWith('.ts'))
|
|
90
91
|
|
|
91
92
|
for (const file of commandFiles) {
|
|
92
93
|
const commandPath = `${commandsDir}/${file}`
|
|
93
94
|
const dynamicImport = await import(commandPath)
|
|
94
95
|
|
|
95
96
|
// Correctly use the default export function
|
|
96
|
-
if (typeof dynamicImport.default === 'function')
|
|
97
|
+
if (typeof dynamicImport.default === 'function')
|
|
98
|
+
dynamicImport.default(buddy)
|
|
97
99
|
else console.error(`Expected a default export function in ${file}, but got:`, dynamicImport.default)
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
const listenerImport = await import(p.listenersPath('Console.ts'))
|
|
101
|
-
if (typeof listenerImport.default === 'function')
|
|
103
|
+
if (typeof listenerImport.default === 'function')
|
|
104
|
+
listenerImport.default(buddy)
|
|
102
105
|
}
|
package/src/commands/add.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { AddOptions, BuildOptions, CLI } from '@stacksjs/types'
|
|
1
2
|
import process from 'node:process'
|
|
2
3
|
import { runAdd } from '@stacksjs/actions'
|
|
3
4
|
import { log } from '@stacksjs/logging'
|
|
4
|
-
import type { AddOptions, BuildOptions, CLI } from '@stacksjs/types'
|
|
5
5
|
import { ExitCode } from '@stacksjs/types'
|
|
6
6
|
|
|
7
|
-
export function add(buddy: CLI) {
|
|
7
|
+
export function add(buddy: CLI): void {
|
|
8
8
|
const descriptions = {
|
|
9
9
|
add: 'Add a stack to your project (coming soon)',
|
|
10
10
|
table: 'Add the Table Stack to your project',
|
package/src/commands/build.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
+
import type { BuildOptions, CLI } from '@stacksjs/types'
|
|
1
2
|
import process from 'node:process'
|
|
2
3
|
import { runAction } from '@stacksjs/actions'
|
|
3
|
-
import { intro, log, outro } from '@stacksjs/cli'
|
|
4
|
+
import { intro, log, outro, prompts } from '@stacksjs/cli'
|
|
4
5
|
import { Action } from '@stacksjs/enums'
|
|
5
|
-
import type { BuildOptions, CLI } from '@stacksjs/types'
|
|
6
6
|
import { ExitCode } from '@stacksjs/types'
|
|
7
|
-
import { isString } from '@stacksjs/validation'
|
|
8
7
|
|
|
9
|
-
export function build(buddy: CLI) {
|
|
8
|
+
export function build(buddy: CLI): void {
|
|
10
9
|
const descriptions = {
|
|
11
10
|
build: 'Build any of your libraries (packages) for production use',
|
|
12
11
|
components: 'Build your component library',
|
|
@@ -73,38 +72,57 @@ export function build(buddy: CLI) {
|
|
|
73
72
|
options.stacks = true
|
|
74
73
|
break
|
|
75
74
|
case 'server':
|
|
76
|
-
options.
|
|
75
|
+
options.server = true
|
|
77
76
|
break
|
|
78
77
|
default:
|
|
79
78
|
break
|
|
80
79
|
}
|
|
81
80
|
|
|
81
|
+
console.log('server', server, options)
|
|
82
|
+
|
|
82
83
|
// TODO: uncomment this when prompt is available
|
|
83
84
|
if (hasNoOptions(options)) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
console.log('has no')
|
|
86
|
+
const answers = await prompts({
|
|
87
|
+
type: 'multiselect',
|
|
88
|
+
name: 'build',
|
|
89
|
+
message: descriptions.select,
|
|
90
|
+
choices: [
|
|
91
|
+
{ title: 'Components', value: 'components' },
|
|
87
92
|
// { label: 'Vue Components', value: 'vue-components' },
|
|
88
|
-
{
|
|
89
|
-
{
|
|
90
|
-
{
|
|
91
|
-
{
|
|
93
|
+
{ title: 'Web Components', value: 'web-components' },
|
|
94
|
+
{ title: 'Functions', value: 'functions' },
|
|
95
|
+
{ title: 'Views', value: 'views' },
|
|
96
|
+
{ title: 'Documentation', value: 'docs' },
|
|
92
97
|
],
|
|
93
98
|
})
|
|
94
99
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
a[v] = true
|
|
102
|
-
return a
|
|
103
|
-
}, {})
|
|
100
|
+
console.log('answers', answers)
|
|
101
|
+
if (answers !== null)
|
|
102
|
+
process.exit(ExitCode.InvalidArgument)
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
console.log('has op')
|
|
104
106
|
}
|
|
105
107
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
if (options.docs)
|
|
109
|
+
await runAction(Action.BuildDocs)
|
|
110
|
+
if (options.components)
|
|
111
|
+
await runAction(Action.BuildComponentLibs)
|
|
112
|
+
if (options.vueComponents)
|
|
113
|
+
await runAction(Action.BuildVueComponentLib)
|
|
114
|
+
if (options.webComponents)
|
|
115
|
+
await runAction(Action.BuildWebComponentLib)
|
|
116
|
+
if (options.functions)
|
|
117
|
+
await runAction(Action.BuildFunctionLib)
|
|
118
|
+
if (options.views)
|
|
119
|
+
await runAction(Action.BuildViews)
|
|
120
|
+
if (options.stacks)
|
|
121
|
+
await runAction(Action.BuildStacks)
|
|
122
|
+
if (options.buddy)
|
|
123
|
+
await runAction(Action.BuildCli)
|
|
124
|
+
if (options.server)
|
|
125
|
+
await runAction(Action.BuildServer)
|
|
108
126
|
process.exit(ExitCode.Success)
|
|
109
127
|
})
|
|
110
128
|
|
|
@@ -268,14 +286,14 @@ export function build(buddy: CLI) {
|
|
|
268
286
|
|
|
269
287
|
function hasNoOptions(options: BuildOptions) {
|
|
270
288
|
return (
|
|
271
|
-
!options.components
|
|
272
|
-
!options.vueComponents
|
|
273
|
-
!options.webComponents
|
|
274
|
-
!options.elements
|
|
275
|
-
!options.functions
|
|
276
|
-
!options.views
|
|
277
|
-
!options.docs
|
|
278
|
-
!options.stacks
|
|
279
|
-
!options.buddy
|
|
289
|
+
!options.components
|
|
290
|
+
&& !options.vueComponents
|
|
291
|
+
&& !options.webComponents
|
|
292
|
+
&& !options.elements
|
|
293
|
+
&& !options.functions
|
|
294
|
+
&& !options.views
|
|
295
|
+
&& !options.docs
|
|
296
|
+
&& !options.stacks
|
|
297
|
+
&& !options.buddy
|
|
280
298
|
)
|
|
281
299
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { CLI, FreshOptions } from '@stacksjs/types'
|
|
1
2
|
import process from 'node:process'
|
|
2
3
|
import { runAction } from '@stacksjs/actions'
|
|
3
4
|
import { intro, log, outro } from '@stacksjs/cli'
|
|
4
5
|
import { Action } from '@stacksjs/enums'
|
|
5
|
-
import type { CLI, FreshOptions } from '@stacksjs/types'
|
|
6
6
|
|
|
7
|
-
export function changelog(buddy: CLI) {
|
|
7
|
+
export function changelog(buddy: CLI): void {
|
|
8
8
|
const descriptions = {
|
|
9
9
|
changelog: 'Create a CHANGELOG.md file',
|
|
10
10
|
quiet: 'Minimal output',
|
package/src/commands/clean.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import type { CleanOptions, CLI } from '@stacksjs/types'
|
|
1
2
|
import process from 'node:process'
|
|
2
3
|
import { runAction } from '@stacksjs/actions'
|
|
3
4
|
import { intro, log, outro } from '@stacksjs/cli'
|
|
4
5
|
import { Action } from '@stacksjs/enums'
|
|
5
6
|
import { ExitCode } from '@stacksjs/types'
|
|
6
|
-
import type { CLI, CleanOptions } from '@stacksjs/types'
|
|
7
7
|
|
|
8
|
-
export function clean(buddy: CLI) {
|
|
8
|
+
export function clean(buddy: CLI): void {
|
|
9
9
|
const descriptions = {
|
|
10
10
|
clean: 'Removes all node_modules & lock files',
|
|
11
11
|
project: 'Target a specific project',
|
package/src/commands/cloud.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CLI, CloudCliOptions } from '@stacksjs/types'
|
|
1
2
|
import process from 'node:process'
|
|
2
3
|
import { CloudFrontClient, CreateInvalidationCommand } from '@aws-sdk/client-cloudfront'
|
|
3
4
|
import { intro, italic, log, outro, prompts, runCommand, underline } from '@stacksjs/cli'
|
|
@@ -10,15 +11,16 @@ import {
|
|
|
10
11
|
deleteParameterStore,
|
|
11
12
|
deleteStacksBuckets,
|
|
12
13
|
deleteStacksFunctions,
|
|
14
|
+
deleteSubnets,
|
|
15
|
+
deleteVpcs,
|
|
13
16
|
getCloudFrontDistributionId,
|
|
14
17
|
getJumpBoxInstanceId,
|
|
15
18
|
} from '@stacksjs/cloud'
|
|
16
19
|
import { path as p } from '@stacksjs/path'
|
|
17
|
-
import type { CLI, CloudCliOptions } from '@stacksjs/types'
|
|
18
20
|
import { ExitCode } from '@stacksjs/types'
|
|
19
21
|
import { loop } from '@stacksjs/utils'
|
|
20
22
|
|
|
21
|
-
export function cloud(buddy: CLI) {
|
|
23
|
+
export function cloud(buddy: CLI): void {
|
|
22
24
|
const descriptions = {
|
|
23
25
|
cloud: 'Interact with the Stacks Cloud',
|
|
24
26
|
ssh: 'SSH into the Stacks Cloud',
|
|
@@ -101,8 +103,8 @@ export function cloud(buddy: CLI) {
|
|
|
101
103
|
const command = new CreateInvalidationCommand(params)
|
|
102
104
|
|
|
103
105
|
cloudfront.send(command).then(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
data => console.log(data),
|
|
107
|
+
err => console.log(err, err.stack),
|
|
106
108
|
)
|
|
107
109
|
|
|
108
110
|
await outro('Exited', { startTime, useSeconds: true })
|
|
@@ -110,7 +112,7 @@ export function cloud(buddy: CLI) {
|
|
|
110
112
|
}
|
|
111
113
|
|
|
112
114
|
if (options.diff) {
|
|
113
|
-
const result = await runCommand('
|
|
115
|
+
const result = await runCommand('bunx --bun cdk diff', {
|
|
114
116
|
cwd: p.frameworkCloudPath(),
|
|
115
117
|
stdin: 'pipe',
|
|
116
118
|
})
|
|
@@ -158,7 +160,7 @@ export function cloud(buddy: CLI) {
|
|
|
158
160
|
log.info('The jump-box is getting added to your cloud resources...')
|
|
159
161
|
log.info('This takes a few moments, please be patient.')
|
|
160
162
|
// sleep for 2 seconds to get the user to read the message
|
|
161
|
-
await new Promise(
|
|
163
|
+
await new Promise(resolve => setTimeout(resolve, 2000))
|
|
162
164
|
|
|
163
165
|
const result = await addJumpBox()
|
|
164
166
|
|
|
@@ -236,9 +238,9 @@ export function cloud(buddy: CLI) {
|
|
|
236
238
|
console.log(` ${italic('Backups are scheduled to delete themselves in 30 days.')}`)
|
|
237
239
|
|
|
238
240
|
// sleep for 2 seconds to get the user to read the message
|
|
239
|
-
await new Promise(
|
|
241
|
+
await new Promise(resolve => setTimeout(resolve, 2000))
|
|
240
242
|
|
|
241
|
-
const result = await runCommand(`
|
|
243
|
+
const result = await runCommand(`bunx --bun cdk destroy`, {
|
|
242
244
|
...options,
|
|
243
245
|
cwd: p.frameworkCloudPath(),
|
|
244
246
|
stdin: 'inherit',
|
|
@@ -280,7 +282,8 @@ export function cloud(buddy: CLI) {
|
|
|
280
282
|
useSeconds: true,
|
|
281
283
|
})
|
|
282
284
|
process.exit(ExitCode.Success)
|
|
283
|
-
}
|
|
285
|
+
}
|
|
286
|
+
catch (error) {
|
|
284
287
|
await outro('While cleaning up the cloud, there was an issue', { startTime, useSeconds: true }, error as Error)
|
|
285
288
|
process.exit(ExitCode.FatalError)
|
|
286
289
|
}
|
|
@@ -337,7 +340,7 @@ export function cloud(buddy: CLI) {
|
|
|
337
340
|
log.info(`Cleaning up your cloud resources will take a while to complete. Please be patient.`)
|
|
338
341
|
|
|
339
342
|
// sleep for 2 seconds to get the user to read the message
|
|
340
|
-
await new Promise(
|
|
343
|
+
await new Promise(resolve => setTimeout(resolve, 2000))
|
|
341
344
|
|
|
342
345
|
log.info('Removing any jump-boxes...')
|
|
343
346
|
const result = await deleteJumpBox()
|
|
@@ -365,12 +368,13 @@ export function cloud(buddy: CLI) {
|
|
|
365
368
|
const result3 = await deleteStacksFunctions()
|
|
366
369
|
|
|
367
370
|
if (result3.isErr()) {
|
|
368
|
-
if (result3.error !== 'No stacks functions found')
|
|
371
|
+
if (result3.error !== 'No stacks functions found') {
|
|
369
372
|
await outro(
|
|
370
373
|
'While deleting the Origin Request Lambda function, there was an issue',
|
|
371
374
|
{ startTime, useSeconds: true },
|
|
372
375
|
result3.error,
|
|
373
376
|
)
|
|
377
|
+
}
|
|
374
378
|
|
|
375
379
|
process.exit(ExitCode.FatalError)
|
|
376
380
|
}
|
|
@@ -410,6 +414,21 @@ export function cloud(buddy: CLI) {
|
|
|
410
414
|
process.exit(ExitCode.FatalError)
|
|
411
415
|
}
|
|
412
416
|
|
|
417
|
+
// delete all vpcs & subnets & internet gateways
|
|
418
|
+
const result9 = await deleteVpcs()
|
|
419
|
+
|
|
420
|
+
if (result9.isErr()) {
|
|
421
|
+
await outro('While deleting the VPCs, there was an issue', { startTime, useSeconds: true }, result9.error)
|
|
422
|
+
process.exit(ExitCode.FatalError)
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
const result10 = await deleteSubnets()
|
|
426
|
+
|
|
427
|
+
if (result10.isErr()) {
|
|
428
|
+
await outro('While deleting the Subnets, there was an issue', { startTime, useSeconds: true }, result10.error)
|
|
429
|
+
process.exit(ExitCode.FatalError)
|
|
430
|
+
}
|
|
431
|
+
|
|
413
432
|
log.info('Removing any CDK remnants...')
|
|
414
433
|
const result6 = await deleteCdkRemnants()
|
|
415
434
|
|
|
@@ -508,7 +527,7 @@ export function cloud(buddy: CLI) {
|
|
|
508
527
|
|
|
509
528
|
const startTime = await intro('buddy cloud:diff')
|
|
510
529
|
|
|
511
|
-
const result = await runCommand('
|
|
530
|
+
const result = await runCommand('bunx --bun cdk diff', {
|
|
512
531
|
cwd: p.frameworkCloudPath(),
|
|
513
532
|
stdin: 'pipe',
|
|
514
533
|
})
|
package/src/commands/commit.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { CLI, FreshOptions } from '@stacksjs/types'
|
|
1
2
|
import process from 'node:process'
|
|
2
3
|
import { runCommit } from '@stacksjs/actions'
|
|
3
4
|
import { log } from '@stacksjs/logging'
|
|
4
|
-
import type { CLI, FreshOptions } from '@stacksjs/types'
|
|
5
5
|
|
|
6
|
-
export function commit(buddy: CLI) {
|
|
6
|
+
export function commit(buddy: CLI): void {
|
|
7
7
|
const descriptions = {
|
|
8
8
|
commit: 'Commit your stashed changes',
|
|
9
9
|
project: 'Target a specific project',
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { CLI, ConfigureOptions } from '@stacksjs/types'
|
|
1
2
|
import process from 'node:process'
|
|
2
3
|
import { log, outro, runCommand } from '@stacksjs/cli'
|
|
3
4
|
import { path as p } from '@stacksjs/path'
|
|
4
|
-
import type { CLI, ConfigureOptions } from '@stacksjs/types'
|
|
5
5
|
import { ExitCode } from '@stacksjs/types'
|
|
6
6
|
|
|
7
|
-
export function configure(buddy: CLI) {
|
|
7
|
+
export function configure(buddy: CLI): void {
|
|
8
8
|
const descriptions = {
|
|
9
9
|
configure: 'Configure options',
|
|
10
10
|
aws: 'Configure the AWS connection',
|
|
@@ -77,7 +77,8 @@ async function configureAws(options?: ConfigureOptions) {
|
|
|
77
77
|
process.exit(ExitCode.FatalError)
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
if (options?.quiet)
|
|
80
|
+
if (options?.quiet)
|
|
81
|
+
return
|
|
81
82
|
|
|
82
83
|
await outro('Exited', { startTime, useSeconds: true })
|
|
83
84
|
}
|
package/src/commands/create.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CLI, CreateOptions } from '@stacksjs/types'
|
|
1
2
|
import process from 'node:process'
|
|
2
3
|
import { runAction } from '@stacksjs/actions'
|
|
3
4
|
import { bold, cyan, dim, intro, log, runCommand } from '@stacksjs/cli'
|
|
@@ -5,10 +6,9 @@ import { Action } from '@stacksjs/enums'
|
|
|
5
6
|
import { resolve } from '@stacksjs/path'
|
|
6
7
|
import { isFolder } from '@stacksjs/storage'
|
|
7
8
|
import { ExitCode } from '@stacksjs/types'
|
|
8
|
-
import type { CLI, CreateOptions } from '@stacksjs/types'
|
|
9
9
|
import { useOnline } from '@stacksjs/utils'
|
|
10
10
|
|
|
11
|
-
export function create(buddy: CLI) {
|
|
11
|
+
export function create(buddy: CLI): void {
|
|
12
12
|
const descriptions = {
|
|
13
13
|
name: 'The name of the project',
|
|
14
14
|
command: 'Create a new Stacks project',
|
|
@@ -101,7 +101,7 @@ function onlineCheck() {
|
|
|
101
101
|
|
|
102
102
|
async function download(name: string, path: string, options: CreateOptions) {
|
|
103
103
|
log.info('Setting up your stack.')
|
|
104
|
-
const result = await runCommand(`bunx giget stacks ${name}`, options)
|
|
104
|
+
const result = await runCommand(`bunx --bun giget stacks ${name}`, options)
|
|
105
105
|
log.success(`Successfully scaffolded your project at ${cyan(path)}`)
|
|
106
106
|
|
|
107
107
|
return result
|