stacks 0.58.28 → 0.58.30

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 (233) hide show
  1. package/core/README.md +1 -1
  2. package/core/actions/dist/src/deploy/index.js +1 -1
  3. package/core/actions/dist/src/dev/components.js +1 -1
  4. package/core/actions/dist/src/dev/index.js +10 -0
  5. package/core/actions/dist/src/generate/lib-entries.js +3 -3
  6. package/core/actions/dist/src/helpers/lib-entries.js +3 -3
  7. package/core/actions/dist/src/index.js +10 -0
  8. package/core/actions/dist/src/lint/fix.js +1 -1
  9. package/core/actions/dist/src/release.js +8 -0
  10. package/core/actions/dist/src/upgrade.js +1 -1
  11. package/core/actions/package.json +1 -1
  12. package/core/actions/src/build/docs.ts +7 -0
  13. package/core/actions/src/deploy/index.ts +1 -1
  14. package/core/actions/src/dev/api.ts +2 -2
  15. package/core/actions/src/dev/components.ts +1 -1
  16. package/core/actions/src/dev/dashboard.ts +7 -0
  17. package/core/actions/src/dev/desktop.ts +3 -3
  18. package/core/actions/src/dev/index.ts +10 -0
  19. package/core/actions/src/dev/system-tray.ts +6 -0
  20. package/core/actions/src/helpers/lib-entries.ts +3 -3
  21. package/core/actions/src/lint/fix.ts +1 -1
  22. package/core/ai/package.json +3 -3
  23. package/core/alias/package.json +1 -1
  24. package/core/analytics/package.json +1 -1
  25. package/core/api/package.json +1 -1
  26. package/core/arrays/package.json +1 -1
  27. package/core/auth/package.json +1 -1
  28. package/core/buddy/README.md +2 -2
  29. package/core/buddy/dist/{chunk-b75e6db0012faa55.js → chunk-0455e53fab4244b1.js} +1 -4
  30. package/core/buddy/dist/{chunk-fd47b42fb923a4be.js → chunk-61e8f138963fc709.js} +173 -137
  31. package/core/buddy/dist/cli.js +2 -2
  32. package/core/buddy/dist/index.js +2 -2
  33. package/core/buddy/package.json +1 -1
  34. package/core/buddy/src/commands/add.ts +4 -0
  35. package/core/buddy/src/commands/build.ts +12 -1
  36. package/core/buddy/src/commands/changelog.ts +2 -0
  37. package/core/buddy/src/commands/clean.ts +2 -0
  38. package/core/buddy/src/commands/cloud.ts +6 -0
  39. package/core/buddy/src/commands/commit.ts +2 -0
  40. package/core/buddy/src/commands/configure.ts +3 -0
  41. package/core/buddy/src/commands/create.ts +8 -8
  42. package/core/buddy/src/commands/deploy.ts +24 -23
  43. package/core/buddy/src/commands/dev.ts +50 -10
  44. package/core/buddy/src/commands/dns.ts +2 -0
  45. package/core/buddy/src/commands/domains.ts +2 -0
  46. package/core/buddy/src/commands/example.ts +4 -0
  47. package/core/buddy/src/commands/fresh.ts +2 -0
  48. package/core/buddy/src/commands/generate.ts +12 -3
  49. package/core/buddy/src/commands/http.ts +2 -0
  50. package/core/buddy/src/commands/install.ts +2 -0
  51. package/core/buddy/src/commands/key.ts +4 -2
  52. package/core/buddy/src/commands/lint.ts +3 -0
  53. package/core/buddy/src/commands/make.ts +11 -1
  54. package/core/buddy/src/commands/migrate.ts +3 -0
  55. package/core/buddy/src/commands/prepublish.ts +2 -0
  56. package/core/buddy/src/commands/release.ts +2 -0
  57. package/core/buddy/src/commands/seed.ts +2 -0
  58. package/core/buddy/src/commands/setup.ts +33 -34
  59. package/core/buddy/src/commands/test.ts +2 -0
  60. package/core/buddy/src/commands/tinker.ts +2 -0
  61. package/core/buddy/src/commands/types.ts +3 -0
  62. package/core/buddy/src/commands/upgrade.ts +6 -0
  63. package/core/build/package.json +1 -1
  64. package/core/bun-create/bud/package.json +3 -2
  65. package/core/bun-create/buddy/package.json +2 -2
  66. package/core/bun-create/stack/package.json +2 -2
  67. package/core/bun-create/stacks/package.json +2 -2
  68. package/core/bun-create/stx/package.json +2 -2
  69. package/core/bun-plugin-yaml/dist/index.js +1 -19
  70. package/core/bun-plugin-yaml/package.json +1 -1
  71. package/core/bun-plugin-yaml/src/index.ts +1 -1
  72. package/core/cache/package.json +2 -2
  73. package/core/chat/package.json +1 -1
  74. package/core/cli/dist/index.js +24 -23
  75. package/core/cli/package.json +1 -1
  76. package/core/cli/src/helpers.ts +21 -31
  77. package/core/cli/src/run.ts +9 -7
  78. package/core/cloud/buddy +2 -0
  79. package/core/cloud/package.json +33 -33
  80. package/core/cloud/src/cloud/ai.ts +45 -36
  81. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package-lock.json +10 -10
  82. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +2 -2
  83. package/core/cloud/src/cloud/cdn.ts +44 -5
  84. package/core/cloud/src/cloud/cli.ts +45 -0
  85. package/core/cloud/src/cloud/compute.ts +1 -1
  86. package/core/cloud/src/cloud/index.ts +6 -1
  87. package/core/cloud/src/cloud/lambda/cli-setup/index.js +67 -0
  88. package/core/cloud/src/index.ts +1 -0
  89. package/core/cloud/src/runtime/example/lambda.ts +1 -1
  90. package/core/cloud/src/runtime/runtime.ts +1 -0
  91. package/core/cloud/src/runtime/server.ts +1 -1
  92. package/core/collections/package.json +1 -1
  93. package/core/config/dist/index.js +130 -122
  94. package/core/config/package.json +1 -1
  95. package/core/config/src/overrides.ts +0 -2
  96. package/core/database/package.json +2 -2
  97. package/core/database/src/kysely-bun-worker/driver.ts +1 -0
  98. package/core/database/src/kysely-bun-worker/worker.ts +1 -1
  99. package/core/datetime/package.json +1 -1
  100. package/core/desktop/dist/index.js +6 -0
  101. package/core/desktop/package.json +5 -5
  102. package/core/desktop/src/index.ts +2 -0
  103. package/core/desktop/src/system-tray.ts +1 -0
  104. package/core/development/package.json +1 -1
  105. package/core/dns/package.json +7 -7
  106. package/core/docs/build.ts +1 -1
  107. package/core/docs/dist/index.js +29878 -9995
  108. package/core/docs/package.json +6 -5
  109. package/core/docs/src/index.ts +7 -1
  110. package/core/docs/src/meta.ts +32 -0
  111. package/core/docs/src/scripts/pwa.ts +116 -0
  112. package/core/email/email-forwarder.cjs +1 -0
  113. package/core/email/package.json +3 -3
  114. package/core/email/src/server/converter.ts +1 -0
  115. package/core/email/src/server/inbound.ts +1 -0
  116. package/core/email/src/server/outbound.ts +6 -4
  117. package/core/enums/dist/index.js +4 -2
  118. package/core/enums/package.json +1 -1
  119. package/core/enums/src/index.ts +4 -2
  120. package/core/env/package.json +1 -1
  121. package/core/error-handling/package.json +1 -1
  122. package/core/eslint-config/package.json +18 -18
  123. package/core/eslint-config/src/configs/comments.ts +1 -1
  124. package/core/eslint-config/src/configs/imports.ts +9 -0
  125. package/core/eslint-config/src/configs/svelte.ts +1 -0
  126. package/core/eslint-config/src/configs/unicorn.ts +1 -1
  127. package/core/eslint-config/src/configs/vue.ts +0 -1
  128. package/core/eslint-config/src/factory.ts +2 -8
  129. package/core/events/package.json +1 -1
  130. package/core/faker/package.json +2 -2
  131. package/core/git/dist/index.js +40 -0
  132. package/core/git/package.json +3 -3
  133. package/core/git/src/index.ts +62 -0
  134. package/core/health/package.json +1 -1
  135. package/core/http/package.json +1 -1
  136. package/core/lint/package.json +1 -1
  137. package/core/logging/dist/index.js +0 -6
  138. package/core/logging/package.json +1 -1
  139. package/core/music/package.json +3 -3
  140. package/core/notifications/package.json +2 -2
  141. package/core/objects/package.json +1 -1
  142. package/core/orm/package.json +1 -1
  143. package/core/path/dist/index.js +6 -3
  144. package/core/path/package.json +1 -1
  145. package/core/path/src/index.ts +7 -3
  146. package/core/payments/dist/index.js +2 -5
  147. package/core/payments/package.json +3 -3
  148. package/core/push/package.json +1 -1
  149. package/core/query-builder/package.json +1 -1
  150. package/core/queue/package.json +1 -1
  151. package/core/raycast/package.json +5 -0
  152. package/core/raycast/src/index.ts +0 -0
  153. package/core/realtime/package.json +1 -1
  154. package/core/repl/package.json +1 -1
  155. package/core/router/dist/index.js +16 -496
  156. package/core/router/package.json +1 -1
  157. package/core/router/src/middleware.ts +16 -14
  158. package/core/scheduler/package.json +1 -1
  159. package/core/search-engine/package.json +2 -2
  160. package/core/security/dist/index.js +3 -6
  161. package/core/security/package.json +2 -2
  162. package/core/server/dist/index.js +6 -2
  163. package/core/server/package.json +2 -2
  164. package/core/server/src/config.ts +14 -9
  165. package/core/signals/package.json +1 -1
  166. package/core/slug/package.json +1 -1
  167. package/core/sms/package.json +1 -1
  168. package/core/storage/dist/index.js +28 -10
  169. package/core/storage/package.json +1 -1
  170. package/core/storage/src/files.ts +10 -2
  171. package/core/storage/src/zip.ts +1 -1
  172. package/core/strings/package.json +3 -3
  173. package/core/stx +2 -0
  174. package/core/tables/package.json +3 -3
  175. package/core/testing/package.json +3 -3
  176. package/core/tinker/package.json +1 -1
  177. package/core/tsconfig.json +4 -9
  178. package/core/tunnel/package.json +1 -1
  179. package/core/types/dist/index.js +3 -1
  180. package/core/types/package.json +13 -13
  181. package/core/types/src/cli.ts +3 -3
  182. package/core/types/src/cloud.ts +4 -1
  183. package/core/types/src/dns.ts +1 -1
  184. package/core/types/src/native.ts +0 -0
  185. package/core/types/src/stacks.ts +0 -10
  186. package/core/ui/package.json +8 -8
  187. package/core/utils/dist/index.js +1 -1
  188. package/core/utils/package.json +1 -1
  189. package/core/validation/package.json +1 -1
  190. package/core/vite/README.md +1 -1
  191. package/core/vite/build.ts +1 -1
  192. package/core/vite/dist/index.js +211 -203
  193. package/core/vite/package.json +5 -5
  194. package/core/vite/src/components.ts +1 -1
  195. package/core/vite/src/dashboard.ts +100 -0
  196. package/core/vite/src/desktop.ts +2 -58
  197. package/core/vite/src/example-vue.ts +1 -1
  198. package/core/vite/src/example-wc.ts +1 -1
  199. package/core/vite/src/functions.ts +1 -1
  200. package/core/vite/src/index.ts +9 -11
  201. package/core/vite/src/plugin/auto-imports.ts +1 -1
  202. package/core/vite/src/plugin/layouts.ts +6 -7
  203. package/core/vite/src/plugin/router.ts +3 -1
  204. package/core/vite/src/system-tray.ts +100 -0
  205. package/core/vite/src/views.ts +13 -2
  206. package/core/vite/src/web-components.ts +1 -1
  207. package/core/whois/dist/index.js +1 -2
  208. package/core/whois/package.json +1 -1
  209. package/core/whois/src/index.ts +10 -8
  210. package/core/x-ray/package.json +1 -1
  211. package/core/zsh-buddy/README.md +51 -0
  212. package/core/zsh-buddy/package.json +29 -0
  213. package/ide/dictionary.txt +12 -0
  214. package/ide/jetbrains/.idea/stacks.iml +0 -1
  215. package/ide/vscode/.vscode/settings.json +7 -2
  216. package/ide/vscode/package.json +2 -4
  217. package/package.json +12 -7
  218. package/core/cloud/src/server/.dockerignore +0 -15
  219. package/core/cloud/src/server/Dockerfile +0 -21
  220. package/core/cloud/src/server/index.ts +0 -3
  221. package/core/cloud/src/server/package.json +0 -12
  222. package/core/cloud/src/server/runtime.ts +0 -828
  223. package/core/scripts/build +0 -58
  224. package/core/scripts/ensure +0 -33
  225. package/core/scripts/fresh +0 -14
  226. package/core/scripts/link +0 -14
  227. package/core/scripts/move-built-src-files.ts +0 -28
  228. package/core/scripts/move-dts-files.ts +0 -35
  229. package/core/scripts/publish +0 -43
  230. package/core/scripts/setup +0 -176
  231. package/core/tables/vite.config.ts +0 -84
  232. package/core/vite/src/plugin/index.ts +0 -21
  233. /package/core/vite/src/{stacks.ts → plugins.ts} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/stx",
3
3
  "type": "module",
4
- "version": "0.58.28",
4
+ "version": "0.58.30",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "scripts": {
41
41
  "buddy": "bun --bun ./storage/framework/core/buddy/src/cli.ts",
42
42
  "stacks": "bun run buddy",
43
- "setup": "./storage/framework/core/scripts/setup.sh",
43
+ "setup": "./storage/framework/scripts/setup.sh",
44
44
  "fresh": "bun run buddy fresh",
45
45
  "clean": "bun run buddy clean",
46
46
  "upgrade": "bun run buddy upgrade",
@@ -1,23 +1,5 @@
1
1
  // @bun
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
- var __getProtoOf = Object.getPrototypeOf;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __toESM = (mod, isNodeMode, target) => {
8
- target = mod != null ? __create(__getProtoOf(mod)) : {};
9
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
- for (let key of __getOwnPropNames(mod))
11
- if (!__hasOwnProp.call(to, key))
12
- __defProp(to, key, {
13
- get: () => mod[key],
14
- enumerable: true
15
- });
16
- return to;
17
- };
18
- var __require = (id) => {
19
- return import.meta.require(id);
20
- };
21
3
  var __export = (target, all) => {
22
4
  for (var name in all)
23
5
  __defProp(target, name, {
@@ -2763,7 +2745,7 @@ var init_js_yaml = __esm(() => {
2763
2745
  });
2764
2746
 
2765
2747
  // src/index.ts
2766
- var {plugin } = globalThis.Bun;
2748
+ import {plugin} from "node:bun";
2767
2749
  plugin({
2768
2750
  name: "YAML",
2769
2751
  async setup(build) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-plugin-yaml",
3
3
  "type": "module",
4
- "version": "0.58.28",
4
+ "version": "0.58.30",
5
5
  "description": "A Bun plugin to load yaml files",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -1,4 +1,4 @@
1
- import { plugin } from 'bun'
1
+ import { plugin } from 'node:bun'
2
2
 
3
3
  plugin({
4
4
  name: 'YAML',
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/cache",
3
3
  "type": "module",
4
- "version": "0.58.28",
4
+ "version": "0.58.30",
5
5
  "description": "Caching the Stacks way.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -56,7 +56,7 @@
56
56
  "@stacksjs/config": "workspace:*"
57
57
  },
58
58
  "optionalDependencies": {
59
- "@aws-sdk/client-dynamodb": "^3.490.0",
59
+ "@aws-sdk/client-dynamodb": "^3.501.0",
60
60
  "ioredis": "^5.3.2"
61
61
  },
62
62
  "devDependencies": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/chat",
3
3
  "type": "module",
4
- "version": "0.58.28",
4
+ "version": "0.58.30",
5
5
  "description": "Easily interact with chat APIs.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -14,7 +14,7 @@ async function installStack(name, options) {
14
14
  // src/cli.ts
15
15
  import cac from "cac";
16
16
  // package.json
17
- var version = "0.58.28";
17
+ var version = "0.58.30";
18
18
 
19
19
  // src/cli.ts
20
20
  function cli(name, options) {
@@ -37,9 +37,6 @@ function parseOptions() {
37
37
  }
38
38
  return options;
39
39
  }
40
- // src/run.ts
41
- import {err as err2, ok as ok2} from "@stacksjs/error-handling";
42
-
43
40
  // src/exec.ts
44
41
  import process from "process";
45
42
  import {err, handleError, ok} from "@stacksjs/error-handling";
@@ -155,13 +152,11 @@ async function runProcess(command, options) {
155
152
  log.debug("Running command:", underline(italic(command)), "with options:", options);
156
153
  return await exec(command, options);
157
154
  }
158
- function runCommandSync(command, options) {
155
+ async function runCommandSync(command, options) {
159
156
  if (options?.verbose)
160
157
  log.debug("Running command:", underline(italic(command)), "with options:", options);
161
- const result = execSync(command, options);
162
- if (result.isErr())
163
- return err2(result.error);
164
- return ok2(result.value);
158
+ const result = await execSync(command, options);
159
+ return result;
165
160
  }
166
161
  async function runCommands(commands, options) {
167
162
  const results = [];
@@ -192,16 +187,17 @@ import {config as config2} from "@stacksjs/config";
192
187
  import {handleError as handleError2} from "@stacksjs/error-handling";
193
188
  import {log as log2} from "@stacksjs/logging";
194
189
  import {ExitCode as ExitCode2} from "@stacksjs/types";
190
+ import {bgCyan as bgCyan2, bold as bold2, cyan as cyan2, dim as dim2, gray as gray2, green as green2, italic as italic2} from "kolorist";
195
191
  async function intro(command, options) {
196
192
  return new Promise((resolve) => {
197
193
  if (options?.quiet === false) {
198
194
  console.log();
199
- console.log(cyan(bold("Stacks CLI")) + dim(` v${version}`));
195
+ console.log(cyan2(bold2("Stacks CLI")) + dim2(` v${version}`));
200
196
  console.log();
201
197
  }
202
- let msg = `Preparing to run ${bgCyan(italic(bold(` ${command} `)))}`;
198
+ let msg = `Running ${bgCyan2(italic2(bold2(` ${command} `)))}`;
203
199
  if (command === "buddy deploy")
204
- msg = `Preparing to run ${bgCyan(italic(bold(` ${command} `)))} for ${bold(`${config2.app.name}`)} ${italic(`via ${config2.app.url}`)}`;
200
+ msg = `Running ${bgCyan2(italic2(bold2(` ${command} `)))} for ${bold2(`${config2.app.name}`)} ${italic2(`via ${config2.app.url}`)}`;
205
201
  log2.info(msg);
206
202
  if (options?.showPerformance === false || options?.quiet)
207
203
  return resolve(0);
@@ -209,28 +205,33 @@ async function intro(command, options) {
209
205
  });
210
206
  }
211
207
  function outro(text, options, error) {
212
- const message = options?.message || text;
208
+ const opts = {
209
+ type: "success",
210
+ useSeconds: true,
211
+ ...options
212
+ };
213
+ opts.message = options?.message || text;
213
214
  return new Promise((resolve) => {
214
215
  if (error)
215
216
  return handleError2(error);
216
- if (options.startTime) {
217
- let time = performance.now() - options.startTime;
218
- if (options.useSeconds) {
217
+ if (opts?.startTime) {
218
+ let time = performance.now() - opts.startTime;
219
+ if (opts.useSeconds) {
219
220
  time = time / 1000;
220
221
  time = Math.round(time * 100) / 100;
221
222
  }
222
- if (options.quiet === true)
223
+ if (opts.quiet === true)
223
224
  return resolve(ExitCode2.Success);
224
225
  if (error)
225
- log2.error(`[${time.toFixed(2)}${options.useSeconds ? "s" : "ms"}] Failed`);
226
- else if (options.type === "info")
227
- console.log(`${dim(gray(`[${time.toFixed(2)}${options.useSeconds ? "s" : "ms"}]`))} ${message ?? "Complete"}`);
226
+ log2.error(`[${time.toFixed(2)}${opts.useSeconds ? "s" : "ms"}] Failed`);
227
+ else if (opts.type === "info")
228
+ console.log(`${dim2(gray2(`[${time.toFixed(2)}${opts.useSeconds ? "s" : "ms"}]`))} ${opts.message ?? "Complete"}`);
228
229
  else
229
- console.log(`${dim(gray(bold(`[${time.toFixed(2)}${options.useSeconds ? "s" : "ms"}]`)))} ${bold(green(message ?? "Complete"))}`);
230
+ console.log(`${dim2(gray2(bold2(`[${time.toFixed(2)}${opts.useSeconds ? "s" : "ms"}]`)))} ${bold2(green2(opts.message ?? "Complete"))}`);
230
231
  } else {
231
- if (options?.type === "info")
232
+ if (opts?.type === "info")
232
233
  console.log(text);
233
- else if (message !== text)
234
+ else if (opts?.type === "success" && opts?.quiet !== true)
234
235
  log2.success(text);
235
236
  }
236
237
  return resolve(ExitCode2.Success);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/cli",
3
3
  "type": "module",
4
- "version": "0.58.28",
4
+ "version": "0.58.30",
5
5
  "description": "TypeScript framework for CLI artisans. Build beautiful console apps with ease.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -4,8 +4,8 @@ import { handleError } from '@stacksjs/error-handling'
4
4
  import { log } from '@stacksjs/logging'
5
5
  import type { IntroOptions, OutroOptions } from '@stacksjs/types'
6
6
  import { ExitCode } from '@stacksjs/types'
7
+ import { bgCyan, bold, cyan, dim, gray, green, italic } from 'kolorist'
7
8
  import { version } from '../package.json'
8
- import { bgCyan, bold, cyan, dim, gray, green, italic } from './utilities'
9
9
 
10
10
  /**
11
11
  * Prints the intro message.
@@ -18,9 +18,9 @@ export async function intro(command: string, options?: IntroOptions): Promise<nu
18
18
  console.log()
19
19
  }
20
20
 
21
- let msg = `Preparing to run ${bgCyan(italic(bold(` ${command} `)))}`
21
+ let msg = `Running ${bgCyan(italic(bold(` ${command} `)))}`
22
22
  if (command === 'buddy deploy')
23
- msg = `Preparing to run ${bgCyan(italic(bold(` ${command} `)))} for ${bold(`${config.app.name}`)} ${italic(`via ${config.app.url}`)}`
23
+ msg = `Running ${bgCyan(italic(bold(` ${command} `)))} for ${bold(`${config.app.name}`)} ${italic(`via ${config.app.url}`)}`
24
24
 
25
25
  log.info(msg)
26
26
 
@@ -34,57 +34,47 @@ export async function intro(command: string, options?: IntroOptions): Promise<nu
34
34
  /**
35
35
  * Prints the outro message.
36
36
  */
37
- export function outro(text: string, options: OutroOptions, error?: Error | string) {
38
- const message = options?.message || text
37
+ export function outro(text: string, options?: OutroOptions, error?: Error | string) {
38
+ const opts = {
39
+ type: 'success',
40
+ useSeconds: true,
41
+ ...options,
42
+ }
43
+
44
+ opts.message = options?.message || text
39
45
 
40
46
  return new Promise((resolve) => {
41
47
  if (error)
42
48
  return handleError(error)
43
49
 
44
- if (options.startTime) {
45
- let time = performance.now() - options.startTime
50
+ if (opts?.startTime) {
51
+ let time = performance.now() - opts.startTime
46
52
 
47
- if (options.useSeconds) {
53
+ if (opts.useSeconds) {
48
54
  time = time / 1000
49
55
  time = Math.round(time * 100) / 100 // https://stackoverflow.com/a/11832950/7811162
50
56
  }
51
57
 
52
- if (options.quiet === true)
58
+ if (opts.quiet === true)
53
59
  return resolve(ExitCode.Success)
54
60
 
55
61
  if (error)
56
- log.error(`[${time.toFixed(2)}${options.useSeconds ? 's' : 'ms'}] Failed`)
57
- else if (options.type === 'info')
58
- console.log(`${dim(gray(`[${time.toFixed(2)}${options.useSeconds ? 's' : 'ms'}]`))} ${message ?? 'Complete'}`)
62
+ log.error(`[${time.toFixed(2)}${opts.useSeconds ? 's' : 'ms'}] Failed`)
63
+ else if (opts.type === 'info')
64
+ console.log(`${dim(gray(`[${time.toFixed(2)}${opts.useSeconds ? 's' : 'ms'}]`))} ${opts.message ?? 'Complete'}`)
59
65
  else
60
- console.log(`${dim(gray(bold(`[${time.toFixed(2)}${options.useSeconds ? 's' : 'ms'}]`)))} ${bold(green(message ?? 'Complete'))}`)
66
+ console.log(`${dim(gray(bold(`[${time.toFixed(2)}${opts.useSeconds ? 's' : 'ms'}]`)))} ${bold(green(opts.message ?? 'Complete'))}`)
61
67
  }
62
68
 
63
69
  else {
64
- if (options?.type === 'info')
70
+ if (opts?.type === 'info')
65
71
  console.log(text)
66
72
 
67
73
  // the following condition triggers in the case of "Cleaned up" messages
68
- else if (message !== text)
74
+ else if (opts?.type === 'success' && opts?.quiet !== true)
69
75
  log.success(text)
70
76
  }
71
77
 
72
78
  return resolve(ExitCode.Success)
73
79
  })
74
80
  }
75
-
76
- // export function startSpinner(text?: string) {
77
- // if (!text)
78
- // text = 'Executing...'
79
-
80
- // const spin = spinner({
81
- // text,
82
- // }).start()
83
-
84
- // setTimeout(() => {
85
- // spin.text = italic('This may take a few moments...')
86
- // spin.spinner = 'clock'
87
- // }, 7500)
88
-
89
- // return spin
90
- // }
@@ -1,5 +1,5 @@
1
- import type { CliOptions, CommandError, Subprocess, SyncSubprocess } from '@stacksjs/types'
2
- import { type Result, err, ok } from '@stacksjs/error-handling'
1
+ import type { CliOptions, CommandError, Subprocess } from '@stacksjs/types'
2
+ import type { Result } from '@stacksjs/error-handling'
3
3
  import { exec, execSync } from './exec'
4
4
  import { italic, underline } from './utilities'
5
5
  import { log } from './console'
@@ -68,16 +68,18 @@ export async function runProcess(command: string, options?: CliOptions): Promise
68
68
  * console.log(result)
69
69
  * ```
70
70
  */
71
- export function runCommandSync(command: string, options?: CliOptions): Result<SyncSubprocess, CommandError> {
71
+ export async function runCommandSync(command: string, options?: CliOptions): Promise<string> {
72
72
  if (options?.verbose)
73
73
  log.debug('Running command:', underline(italic(command)), 'with options:', options)
74
74
 
75
- const result = execSync(command, options)
75
+ const result = await execSync(command, options)
76
76
 
77
- if (result.isErr())
78
- return err(result.error)
77
+ // if (result.isErr())
78
+ // return err(result.error)
79
79
 
80
- return ok(result.value)
80
+ // return ok(result.value)
81
+
82
+ return result
81
83
  }
82
84
 
83
85
  /**
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ import('../buddy/src/cli')
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/cloud",
3
3
  "type": "module",
4
- "version": "0.58.28",
4
+ "version": "0.58.30",
5
5
  "description": "The Stacks cloud/serverless integration & implementation.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -54,20 +54,20 @@
54
54
  "prepublishOnly": "bun run build"
55
55
  },
56
56
  "peerDependencies": {
57
- "@aws-sdk/client-bedrock": "^3.490.0",
58
- "@aws-sdk/client-cloudformation": "^3.490.0",
59
- "@aws-sdk/client-cloudfront": "^3.490.0",
60
- "@aws-sdk/client-cloudwatch-logs": "^3.490.0",
61
- "@aws-sdk/client-ec2": "^3.490.0",
62
- "@aws-sdk/client-efs": "^3.490.0",
63
- "@aws-sdk/client-iam": "^3.490.0",
64
- "@aws-sdk/client-lambda": "^3.490.0",
65
- "@aws-sdk/client-route-53-domains": "^3.490.0",
66
- "@aws-sdk/client-s3": "^3.490.0",
67
- "@aws-sdk/client-ses": "^3.490.0",
68
- "@aws-sdk/client-sesv2": "^3.490.0",
69
- "@aws-sdk/client-ssm": "^3.490.0",
70
- "@aws-sdk/lib-dynamodb": "^3.490.0",
57
+ "@aws-sdk/client-bedrock": "^3.501.0",
58
+ "@aws-sdk/client-cloudformation": "^3.501.0",
59
+ "@aws-sdk/client-cloudfront": "^3.501.0",
60
+ "@aws-sdk/client-cloudwatch-logs": "^3.501.0",
61
+ "@aws-sdk/client-ec2": "^3.501.0",
62
+ "@aws-sdk/client-efs": "^3.501.0",
63
+ "@aws-sdk/client-iam": "^3.501.0",
64
+ "@aws-sdk/client-lambda": "^3.501.0",
65
+ "@aws-sdk/client-route-53-domains": "^3.501.0",
66
+ "@aws-sdk/client-s3": "^3.501.0",
67
+ "@aws-sdk/client-ses": "^3.501.0",
68
+ "@aws-sdk/client-sesv2": "^3.501.0",
69
+ "@aws-sdk/client-ssm": "^3.501.0",
70
+ "@aws-sdk/lib-dynamodb": "^3.501.0",
71
71
  "@stacksjs/config": "workspace:*",
72
72
  "@stacksjs/env": "workspace:*",
73
73
  "@stacksjs/logging": "workspace:*",
@@ -79,20 +79,20 @@
79
79
  "@stacksjs/validation": "workspace:*"
80
80
  },
81
81
  "dependencies": {
82
- "@aws-sdk/client-bedrock": "^3.490.0",
83
- "@aws-sdk/client-cloudformation": "^3.490.0",
84
- "@aws-sdk/client-cloudfront": "^3.490.0",
85
- "@aws-sdk/client-cloudwatch-logs": "^3.490.0",
86
- "@aws-sdk/client-dynamodb": "3.490.0",
87
- "@aws-sdk/client-ec2": "^3.490.0",
88
- "@aws-sdk/client-efs": "^3.490.0",
89
- "@aws-sdk/client-iam": "^3.490.0",
90
- "@aws-sdk/client-lambda": "^3.490.0",
91
- "@aws-sdk/client-route-53-domains": "^3.490.0",
92
- "@aws-sdk/client-s3": "^3.490.0",
93
- "@aws-sdk/client-ses": "^3.490.0",
94
- "@aws-sdk/client-sesv2": "^3.490.0",
95
- "@aws-sdk/client-ssm": "^3.490.0",
82
+ "@aws-sdk/client-bedrock": "^3.501.0",
83
+ "@aws-sdk/client-cloudformation": "^3.501.0",
84
+ "@aws-sdk/client-cloudfront": "^3.501.0",
85
+ "@aws-sdk/client-cloudwatch-logs": "^3.501.0",
86
+ "@aws-sdk/client-dynamodb": "3.501.0",
87
+ "@aws-sdk/client-ec2": "^3.501.0",
88
+ "@aws-sdk/client-efs": "^3.501.0",
89
+ "@aws-sdk/client-iam": "^3.501.0",
90
+ "@aws-sdk/client-lambda": "^3.501.0",
91
+ "@aws-sdk/client-route-53-domains": "^3.501.0",
92
+ "@aws-sdk/client-s3": "^3.501.0",
93
+ "@aws-sdk/client-ses": "^3.501.0",
94
+ "@aws-sdk/client-sesv2": "^3.501.0",
95
+ "@aws-sdk/client-ssm": "^3.501.0",
96
96
  "@stacksjs/config": "workspace:*",
97
97
  "@stacksjs/dns": "workspace:*",
98
98
  "@stacksjs/env": "workspace:*",
@@ -102,18 +102,18 @@
102
102
  "@stacksjs/storage": "workspace:*",
103
103
  "@stacksjs/utils": "workspace:*",
104
104
  "@stacksjs/validation": "workspace:*",
105
- "aws-cdk": "^2.121.1",
106
- "aws-cdk-lib": "^2.121.1",
105
+ "aws-cdk": "^2.124.0",
106
+ "aws-cdk-lib": "^2.124.0",
107
107
  "aws4fetch": "^1.0.17",
108
108
  "constructs": "^10.3.0"
109
109
  },
110
110
  "devDependencies": {
111
- "@oclif/plugin-plugins": "^4.1.16",
111
+ "@oclif/plugin-plugins": "^4.1.22",
112
112
  "@stacksjs/cli": "workspace:*",
113
113
  "@stacksjs/development": "workspace:*",
114
114
  "@stacksjs/env": "workspace:*",
115
115
  "jszip": "^3.10.1",
116
- "oclif": "^4.3.2",
116
+ "oclif": "^4.4.2",
117
117
  "source-map-support": "^0.5.21"
118
118
  }
119
119
  }
@@ -1,6 +1,5 @@
1
1
  /* eslint-disable no-new */
2
2
  import { Duration, CfnOutput as Output, aws_iam as iam, aws_lambda as lambda } from 'aws-cdk-lib'
3
- import { AuthorizationType, Cors, LambdaIntegration, RestApi } from 'aws-cdk-lib/aws-apigateway'
4
3
  import type { Construct } from 'constructs'
5
4
  import { config } from '@stacksjs/config'
6
5
  import type { NestedCloudProps } from '../types'
@@ -9,6 +8,8 @@ export interface AiStackProps extends NestedCloudProps {
9
8
  }
10
9
 
11
10
  export class AiStack {
11
+ askAiUrl: lambda.FunctionUrl
12
+
12
13
  constructor(scope: Construct, props: AiStackProps) {
13
14
  // Define the Lambda Layer for aws-sdk
14
15
  const awsSdkLayer = new lambda.LayerVersion(scope, 'AwsSdkLayer', {
@@ -35,7 +36,7 @@ export class AiStack {
35
36
 
36
37
  bedrockAccessRole.addToPolicy(bedrockAccessPolicy)
37
38
 
38
- const askLambda = new lambda.Function(scope, 'AskAiFunction', {
39
+ const askAi = new lambda.Function(scope, 'AskAiFunction', {
39
40
  functionName: `${props.slug}-${props.appEnv}-ai-ask`,
40
41
  description: 'Lambda function to invoke the AI model',
41
42
  runtime: lambda.Runtime.NODEJS_20_X,
@@ -46,7 +47,15 @@ export class AiStack {
46
47
  timeout: Duration.seconds(30),
47
48
  })
48
49
 
49
- const summarizeLambda = new lambda.Function(scope, 'AiFunction', {
50
+ this.askAiUrl = new lambda.FunctionUrl(scope, 'AskAiFunctionUrl', {
51
+ function: askAi,
52
+ authType: lambda.FunctionUrlAuthType.NONE,
53
+ cors: {
54
+ allowedOrigins: ['*'],
55
+ },
56
+ })
57
+
58
+ const summarizeAi = new lambda.Function(scope, 'AiFunction', {
50
59
  functionName: `${props.slug}-${props.appEnv}-ai-summarize`,
51
60
  description: 'Lambda function to summarize any given text',
52
61
  runtime: lambda.Runtime.NODEJS_20_X,
@@ -57,51 +66,51 @@ export class AiStack {
57
66
  timeout: Duration.seconds(30),
58
67
  })
59
68
 
60
- const api = new RestApi(scope, 'AiRestApi', {
61
- restApiName: `${props.slug}-${props.appEnv}-ai`,
62
- description: 'Stacks AI API',
63
- defaultCorsPreflightOptions: {
64
- allowOrigins: Cors.ALL_ORIGINS,
65
- allowMethods: Cors.ALL_METHODS,
69
+ const summarizeAiUrl = new lambda.FunctionUrl(scope, 'SummarizeAiFunctionUrl', {
70
+ function: summarizeAi,
71
+ authType: lambda.FunctionUrlAuthType.NONE,
72
+ cors: {
73
+ allowedOrigins: ['*'],
66
74
  },
67
75
  })
68
76
 
69
- const askResource = api.root.addResource('ask')
70
- const askIntegration = new LambdaIntegration(askLambda)
71
- askResource.addMethod('POST', askIntegration, {
72
- operationName: 'Stacks AI Ask',
73
- authorizationType: AuthorizationType.NONE,
74
- })
77
+ // const api = new RestApi(scope, 'AiRestApi', {
78
+ // restApiName: `${props.slug}-${props.appEnv}-ai`,
79
+ // description: 'Stacks AI API',
80
+ // defaultCorsPreflightOptions: {
81
+ // allowOrigins: Cors.ALL_ORIGINS,
82
+ // allowMethods: Cors.ALL_METHODS,
83
+ // },
84
+ // })
75
85
 
76
- // alias to ask
77
- const promptResource = api.root.addResource('prompt')
78
- const promptIntegration = new LambdaIntegration(askLambda)
79
- promptResource.addMethod('POST', promptIntegration, {
80
- operationName: 'Stacks AI Ask',
81
- authorizationType: AuthorizationType.NONE,
82
- })
86
+ // const askResource = api.root.addResource('ask')
87
+ // const askIntegration = new LambdaIntegration(askAi)
88
+ // askResource.addMethod('POST', askIntegration, {
89
+ // operationName: 'Stacks AI Ask',
90
+ // authorizationType: AuthorizationType.NONE,
91
+ // })
83
92
 
84
- const summarizeResource = api.root.addResource('summarize')
85
- const summarizeIntegration = new LambdaIntegration(summarizeLambda)
86
- summarizeResource.addMethod('POST', summarizeIntegration, {
87
- operationName: 'Stacks AI Summarize',
88
- authorizationType: AuthorizationType.NONE,
89
- })
93
+ // alias to ask
94
+ // const promptResource = api.root.addResource('prompt')
95
+ // const promptIntegration = new LambdaIntegration(askAi)
96
+ // promptResource.addMethod('POST', promptIntegration, {
97
+ // operationName: 'Stacks AI Ask',
98
+ // authorizationType: AuthorizationType.NONE,
99
+ // })
90
100
 
91
- // const api = new lambda.FunctionUrl(scope, 'AiLambdaUrl', {
92
- // function: aiLambda,
93
- // authType: lambda.FunctionUrlAuthType.NONE,
94
- // cors: {
95
- // allowedOrigins: ['*'],
96
- // },
101
+ // const summarizeResource = api.root.addResource('summarize')
102
+ // const summarizeIntegration = new LambdaIntegration(summarizeAi)
103
+ // summarizeResource.addMethod('POST', summarizeIntegration, {
104
+ // operationName: 'Stacks AI Summarize',
105
+ // authorizationType: AuthorizationType.NONE,
97
106
  // })
98
107
 
99
108
  new Output(scope, 'AiVanityAskApiUrl', {
100
- value: `${api.url}ask`,
109
+ value: this.askAiUrl.url,
101
110
  })
102
111
 
103
112
  new Output(scope, 'AiVanitySummarizeApiUrl', {
104
- value: `${api.url}summarize`,
113
+ value: summarizeAiUrl.url,
105
114
  })
106
115
 
107
116
  new Output(scope, 'AiAskApiUrl', {
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "aws-sdk-layer",
3
- "version": "0.58.24",
3
+ "version": "0.58.28",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "aws-sdk-layer",
9
- "version": "0.58.24",
9
+ "version": "0.58.28",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
- "aws-sdk": "^2.1535.0"
12
+ "aws-sdk": "^2.1545.0"
13
13
  }
14
14
  },
15
15
  "node_modules/available-typed-arrays": {
@@ -24,9 +24,9 @@
24
24
  }
25
25
  },
26
26
  "node_modules/aws-sdk": {
27
- "version": "2.1535.0",
28
- "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1535.0.tgz",
29
- "integrity": "sha512-Ah9prS7ZX4rIMPBeXmBD1NV6tIHoJoryrCe1Zr/Zk4PdEM743jezpfIyM9bMhzKi/Z0CmBkqtHx54uPAghsp7A==",
27
+ "version": "2.1545.0",
28
+ "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1545.0.tgz",
29
+ "integrity": "sha512-iDUv6ksG7lTA0l/HlOgYdO6vfYFA1D2/JzAEXSdgKY0C901WgJqBtfs2CncOkCgDe2CjmlMuqciBzAfxCIiKFA==",
30
30
  "dependencies": {
31
31
  "buffer": "4.9.2",
32
32
  "events": "1.1.1",
@@ -37,7 +37,7 @@
37
37
  "url": "0.10.3",
38
38
  "util": "^0.12.4",
39
39
  "uuid": "8.0.0",
40
- "xml2js": "0.5.0"
40
+ "xml2js": "0.6.2"
41
41
  },
42
42
  "engines": {
43
43
  "node": ">= 10.0.0"
@@ -363,9 +363,9 @@
363
363
  }
364
364
  },
365
365
  "node_modules/xml2js": {
366
- "version": "0.5.0",
367
- "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz",
368
- "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==",
366
+ "version": "0.6.2",
367
+ "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz",
368
+ "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==",
369
369
  "dependencies": {
370
370
  "sax": ">=0.6.0",
371
371
  "xmlbuilder": "~11.0.0"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws-sdk-layer",
3
- "version": "0.58.28",
3
+ "version": "0.58.30",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -10,6 +10,6 @@
10
10
  "test": "echo \"Error: no test specified\" && exit 1"
11
11
  },
12
12
  "dependencies": {
13
- "aws-sdk": "^2.1535.0"
13
+ "aws-sdk": "^2.1545.0"
14
14
  }
15
15
  }