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.
- package/core/README.md +1 -1
- package/core/actions/dist/src/deploy/index.js +1 -1
- package/core/actions/dist/src/dev/components.js +1 -1
- package/core/actions/dist/src/dev/index.js +10 -0
- package/core/actions/dist/src/generate/lib-entries.js +3 -3
- package/core/actions/dist/src/helpers/lib-entries.js +3 -3
- package/core/actions/dist/src/index.js +10 -0
- package/core/actions/dist/src/lint/fix.js +1 -1
- package/core/actions/dist/src/release.js +8 -0
- package/core/actions/dist/src/upgrade.js +1 -1
- package/core/actions/package.json +1 -1
- package/core/actions/src/build/docs.ts +7 -0
- package/core/actions/src/deploy/index.ts +1 -1
- package/core/actions/src/dev/api.ts +2 -2
- package/core/actions/src/dev/components.ts +1 -1
- package/core/actions/src/dev/dashboard.ts +7 -0
- package/core/actions/src/dev/desktop.ts +3 -3
- package/core/actions/src/dev/index.ts +10 -0
- package/core/actions/src/dev/system-tray.ts +6 -0
- package/core/actions/src/helpers/lib-entries.ts +3 -3
- package/core/actions/src/lint/fix.ts +1 -1
- package/core/ai/package.json +3 -3
- package/core/alias/package.json +1 -1
- package/core/analytics/package.json +1 -1
- package/core/api/package.json +1 -1
- package/core/arrays/package.json +1 -1
- package/core/auth/package.json +1 -1
- package/core/buddy/README.md +2 -2
- package/core/buddy/dist/{chunk-b75e6db0012faa55.js → chunk-0455e53fab4244b1.js} +1 -4
- package/core/buddy/dist/{chunk-fd47b42fb923a4be.js → chunk-61e8f138963fc709.js} +173 -137
- package/core/buddy/dist/cli.js +2 -2
- package/core/buddy/dist/index.js +2 -2
- package/core/buddy/package.json +1 -1
- package/core/buddy/src/commands/add.ts +4 -0
- package/core/buddy/src/commands/build.ts +12 -1
- package/core/buddy/src/commands/changelog.ts +2 -0
- package/core/buddy/src/commands/clean.ts +2 -0
- package/core/buddy/src/commands/cloud.ts +6 -0
- package/core/buddy/src/commands/commit.ts +2 -0
- package/core/buddy/src/commands/configure.ts +3 -0
- package/core/buddy/src/commands/create.ts +8 -8
- package/core/buddy/src/commands/deploy.ts +24 -23
- package/core/buddy/src/commands/dev.ts +50 -10
- package/core/buddy/src/commands/dns.ts +2 -0
- package/core/buddy/src/commands/domains.ts +2 -0
- package/core/buddy/src/commands/example.ts +4 -0
- package/core/buddy/src/commands/fresh.ts +2 -0
- package/core/buddy/src/commands/generate.ts +12 -3
- package/core/buddy/src/commands/http.ts +2 -0
- package/core/buddy/src/commands/install.ts +2 -0
- package/core/buddy/src/commands/key.ts +4 -2
- package/core/buddy/src/commands/lint.ts +3 -0
- package/core/buddy/src/commands/make.ts +11 -1
- package/core/buddy/src/commands/migrate.ts +3 -0
- package/core/buddy/src/commands/prepublish.ts +2 -0
- package/core/buddy/src/commands/release.ts +2 -0
- package/core/buddy/src/commands/seed.ts +2 -0
- package/core/buddy/src/commands/setup.ts +33 -34
- package/core/buddy/src/commands/test.ts +2 -0
- package/core/buddy/src/commands/tinker.ts +2 -0
- package/core/buddy/src/commands/types.ts +3 -0
- package/core/buddy/src/commands/upgrade.ts +6 -0
- package/core/build/package.json +1 -1
- package/core/bun-create/bud/package.json +3 -2
- package/core/bun-create/buddy/package.json +2 -2
- package/core/bun-create/stack/package.json +2 -2
- package/core/bun-create/stacks/package.json +2 -2
- package/core/bun-create/stx/package.json +2 -2
- package/core/bun-plugin-yaml/dist/index.js +1 -19
- package/core/bun-plugin-yaml/package.json +1 -1
- package/core/bun-plugin-yaml/src/index.ts +1 -1
- package/core/cache/package.json +2 -2
- package/core/chat/package.json +1 -1
- package/core/cli/dist/index.js +24 -23
- package/core/cli/package.json +1 -1
- package/core/cli/src/helpers.ts +21 -31
- package/core/cli/src/run.ts +9 -7
- package/core/cloud/buddy +2 -0
- package/core/cloud/package.json +33 -33
- package/core/cloud/src/cloud/ai.ts +45 -36
- package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package-lock.json +10 -10
- package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +2 -2
- package/core/cloud/src/cloud/cdn.ts +44 -5
- package/core/cloud/src/cloud/cli.ts +45 -0
- package/core/cloud/src/cloud/compute.ts +1 -1
- package/core/cloud/src/cloud/index.ts +6 -1
- package/core/cloud/src/cloud/lambda/cli-setup/index.js +67 -0
- package/core/cloud/src/index.ts +1 -0
- package/core/cloud/src/runtime/example/lambda.ts +1 -1
- package/core/cloud/src/runtime/runtime.ts +1 -0
- package/core/cloud/src/runtime/server.ts +1 -1
- package/core/collections/package.json +1 -1
- package/core/config/dist/index.js +130 -122
- package/core/config/package.json +1 -1
- package/core/config/src/overrides.ts +0 -2
- package/core/database/package.json +2 -2
- package/core/database/src/kysely-bun-worker/driver.ts +1 -0
- package/core/database/src/kysely-bun-worker/worker.ts +1 -1
- package/core/datetime/package.json +1 -1
- package/core/desktop/dist/index.js +6 -0
- package/core/desktop/package.json +5 -5
- package/core/desktop/src/index.ts +2 -0
- package/core/desktop/src/system-tray.ts +1 -0
- package/core/development/package.json +1 -1
- package/core/dns/package.json +7 -7
- package/core/docs/build.ts +1 -1
- package/core/docs/dist/index.js +29878 -9995
- package/core/docs/package.json +6 -5
- package/core/docs/src/index.ts +7 -1
- package/core/docs/src/meta.ts +32 -0
- package/core/docs/src/scripts/pwa.ts +116 -0
- package/core/email/email-forwarder.cjs +1 -0
- package/core/email/package.json +3 -3
- package/core/email/src/server/converter.ts +1 -0
- package/core/email/src/server/inbound.ts +1 -0
- package/core/email/src/server/outbound.ts +6 -4
- package/core/enums/dist/index.js +4 -2
- package/core/enums/package.json +1 -1
- package/core/enums/src/index.ts +4 -2
- package/core/env/package.json +1 -1
- package/core/error-handling/package.json +1 -1
- package/core/eslint-config/package.json +18 -18
- package/core/eslint-config/src/configs/comments.ts +1 -1
- package/core/eslint-config/src/configs/imports.ts +9 -0
- package/core/eslint-config/src/configs/svelte.ts +1 -0
- package/core/eslint-config/src/configs/unicorn.ts +1 -1
- package/core/eslint-config/src/configs/vue.ts +0 -1
- package/core/eslint-config/src/factory.ts +2 -8
- package/core/events/package.json +1 -1
- package/core/faker/package.json +2 -2
- package/core/git/dist/index.js +40 -0
- package/core/git/package.json +3 -3
- package/core/git/src/index.ts +62 -0
- package/core/health/package.json +1 -1
- package/core/http/package.json +1 -1
- package/core/lint/package.json +1 -1
- package/core/logging/dist/index.js +0 -6
- package/core/logging/package.json +1 -1
- package/core/music/package.json +3 -3
- package/core/notifications/package.json +2 -2
- package/core/objects/package.json +1 -1
- package/core/orm/package.json +1 -1
- package/core/path/dist/index.js +6 -3
- package/core/path/package.json +1 -1
- package/core/path/src/index.ts +7 -3
- package/core/payments/dist/index.js +2 -5
- package/core/payments/package.json +3 -3
- package/core/push/package.json +1 -1
- package/core/query-builder/package.json +1 -1
- package/core/queue/package.json +1 -1
- package/core/raycast/package.json +5 -0
- package/core/raycast/src/index.ts +0 -0
- package/core/realtime/package.json +1 -1
- package/core/repl/package.json +1 -1
- package/core/router/dist/index.js +16 -496
- package/core/router/package.json +1 -1
- package/core/router/src/middleware.ts +16 -14
- package/core/scheduler/package.json +1 -1
- package/core/search-engine/package.json +2 -2
- package/core/security/dist/index.js +3 -6
- package/core/security/package.json +2 -2
- package/core/server/dist/index.js +6 -2
- package/core/server/package.json +2 -2
- package/core/server/src/config.ts +14 -9
- package/core/signals/package.json +1 -1
- package/core/slug/package.json +1 -1
- package/core/sms/package.json +1 -1
- package/core/storage/dist/index.js +28 -10
- package/core/storage/package.json +1 -1
- package/core/storage/src/files.ts +10 -2
- package/core/storage/src/zip.ts +1 -1
- package/core/strings/package.json +3 -3
- package/core/stx +2 -0
- package/core/tables/package.json +3 -3
- package/core/testing/package.json +3 -3
- package/core/tinker/package.json +1 -1
- package/core/tsconfig.json +4 -9
- package/core/tunnel/package.json +1 -1
- package/core/types/dist/index.js +3 -1
- package/core/types/package.json +13 -13
- package/core/types/src/cli.ts +3 -3
- package/core/types/src/cloud.ts +4 -1
- package/core/types/src/dns.ts +1 -1
- package/core/types/src/native.ts +0 -0
- package/core/types/src/stacks.ts +0 -10
- package/core/ui/package.json +8 -8
- package/core/utils/dist/index.js +1 -1
- package/core/utils/package.json +1 -1
- package/core/validation/package.json +1 -1
- package/core/vite/README.md +1 -1
- package/core/vite/build.ts +1 -1
- package/core/vite/dist/index.js +211 -203
- package/core/vite/package.json +5 -5
- package/core/vite/src/components.ts +1 -1
- package/core/vite/src/dashboard.ts +100 -0
- package/core/vite/src/desktop.ts +2 -58
- package/core/vite/src/example-vue.ts +1 -1
- package/core/vite/src/example-wc.ts +1 -1
- package/core/vite/src/functions.ts +1 -1
- package/core/vite/src/index.ts +9 -11
- package/core/vite/src/plugin/auto-imports.ts +1 -1
- package/core/vite/src/plugin/layouts.ts +6 -7
- package/core/vite/src/plugin/router.ts +3 -1
- package/core/vite/src/system-tray.ts +100 -0
- package/core/vite/src/views.ts +13 -2
- package/core/vite/src/web-components.ts +1 -1
- package/core/whois/dist/index.js +1 -2
- package/core/whois/package.json +1 -1
- package/core/whois/src/index.ts +10 -8
- package/core/x-ray/package.json +1 -1
- package/core/zsh-buddy/README.md +51 -0
- package/core/zsh-buddy/package.json +29 -0
- package/ide/dictionary.txt +12 -0
- package/ide/jetbrains/.idea/stacks.iml +0 -1
- package/ide/vscode/.vscode/settings.json +7 -2
- package/ide/vscode/package.json +2 -4
- package/package.json +12 -7
- package/core/cloud/src/server/.dockerignore +0 -15
- package/core/cloud/src/server/Dockerfile +0 -21
- package/core/cloud/src/server/index.ts +0 -3
- package/core/cloud/src/server/package.json +0 -12
- package/core/cloud/src/server/runtime.ts +0 -828
- package/core/scripts/build +0 -58
- package/core/scripts/ensure +0 -33
- package/core/scripts/fresh +0 -14
- package/core/scripts/link +0 -14
- package/core/scripts/move-built-src-files.ts +0 -28
- package/core/scripts/move-dts-files.ts +0 -35
- package/core/scripts/publish +0 -43
- package/core/scripts/setup +0 -176
- package/core/tables/vite.config.ts +0 -84
- package/core/vite/src/plugin/index.ts +0 -21
- /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.
|
|
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/
|
|
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
|
-
|
|
2748
|
+
import {plugin} from "node:bun";
|
|
2767
2749
|
plugin({
|
|
2768
2750
|
name: "YAML",
|
|
2769
2751
|
async setup(build) {
|
package/core/cache/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/cache",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.58.
|
|
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.
|
|
59
|
+
"@aws-sdk/client-dynamodb": "^3.501.0",
|
|
60
60
|
"ioredis": "^5.3.2"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
package/core/chat/package.json
CHANGED
package/core/cli/dist/index.js
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
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(
|
|
195
|
+
console.log(cyan2(bold2("Stacks CLI")) + dim2(` v${version}`));
|
|
200
196
|
console.log();
|
|
201
197
|
}
|
|
202
|
-
let msg = `
|
|
198
|
+
let msg = `Running ${bgCyan2(italic2(bold2(` ${command} `)))}`;
|
|
203
199
|
if (command === "buddy deploy")
|
|
204
|
-
msg = `
|
|
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
|
|
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 (
|
|
217
|
-
let time = performance.now() -
|
|
218
|
-
if (
|
|
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 (
|
|
223
|
+
if (opts.quiet === true)
|
|
223
224
|
return resolve(ExitCode2.Success);
|
|
224
225
|
if (error)
|
|
225
|
-
log2.error(`[${time.toFixed(2)}${
|
|
226
|
-
else if (
|
|
227
|
-
console.log(`${
|
|
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(`${
|
|
230
|
+
console.log(`${dim2(gray2(bold2(`[${time.toFixed(2)}${opts.useSeconds ? "s" : "ms"}]`)))} ${bold2(green2(opts.message ?? "Complete"))}`);
|
|
230
231
|
} else {
|
|
231
|
-
if (
|
|
232
|
+
if (opts?.type === "info")
|
|
232
233
|
console.log(text);
|
|
233
|
-
else if (
|
|
234
|
+
else if (opts?.type === "success" && opts?.quiet !== true)
|
|
234
235
|
log2.success(text);
|
|
235
236
|
}
|
|
236
237
|
return resolve(ExitCode2.Success);
|
package/core/cli/package.json
CHANGED
package/core/cli/src/helpers.ts
CHANGED
|
@@ -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 = `
|
|
21
|
+
let msg = `Running ${bgCyan(italic(bold(` ${command} `)))}`
|
|
22
22
|
if (command === 'buddy deploy')
|
|
23
|
-
msg = `
|
|
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
|
|
38
|
-
const
|
|
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 (
|
|
45
|
-
let time = performance.now() -
|
|
50
|
+
if (opts?.startTime) {
|
|
51
|
+
let time = performance.now() - opts.startTime
|
|
46
52
|
|
|
47
|
-
if (
|
|
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 (
|
|
58
|
+
if (opts.quiet === true)
|
|
53
59
|
return resolve(ExitCode.Success)
|
|
54
60
|
|
|
55
61
|
if (error)
|
|
56
|
-
log.error(`[${time.toFixed(2)}${
|
|
57
|
-
else if (
|
|
58
|
-
console.log(`${dim(gray(`[${time.toFixed(2)}${
|
|
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)}${
|
|
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 (
|
|
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 (
|
|
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
|
-
// }
|
package/core/cli/src/run.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CliOptions, CommandError, Subprocess
|
|
2
|
-
import {
|
|
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):
|
|
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
|
-
|
|
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
|
/**
|
package/core/cloud/buddy
ADDED
package/core/cloud/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/cloud",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.58.
|
|
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.
|
|
58
|
-
"@aws-sdk/client-cloudformation": "^3.
|
|
59
|
-
"@aws-sdk/client-cloudfront": "^3.
|
|
60
|
-
"@aws-sdk/client-cloudwatch-logs": "^3.
|
|
61
|
-
"@aws-sdk/client-ec2": "^3.
|
|
62
|
-
"@aws-sdk/client-efs": "^3.
|
|
63
|
-
"@aws-sdk/client-iam": "^3.
|
|
64
|
-
"@aws-sdk/client-lambda": "^3.
|
|
65
|
-
"@aws-sdk/client-route-53-domains": "^3.
|
|
66
|
-
"@aws-sdk/client-s3": "^3.
|
|
67
|
-
"@aws-sdk/client-ses": "^3.
|
|
68
|
-
"@aws-sdk/client-sesv2": "^3.
|
|
69
|
-
"@aws-sdk/client-ssm": "^3.
|
|
70
|
-
"@aws-sdk/lib-dynamodb": "^3.
|
|
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.
|
|
83
|
-
"@aws-sdk/client-cloudformation": "^3.
|
|
84
|
-
"@aws-sdk/client-cloudfront": "^3.
|
|
85
|
-
"@aws-sdk/client-cloudwatch-logs": "^3.
|
|
86
|
-
"@aws-sdk/client-dynamodb": "3.
|
|
87
|
-
"@aws-sdk/client-ec2": "^3.
|
|
88
|
-
"@aws-sdk/client-efs": "^3.
|
|
89
|
-
"@aws-sdk/client-iam": "^3.
|
|
90
|
-
"@aws-sdk/client-lambda": "^3.
|
|
91
|
-
"@aws-sdk/client-route-53-domains": "^3.
|
|
92
|
-
"@aws-sdk/client-s3": "^3.
|
|
93
|
-
"@aws-sdk/client-ses": "^3.
|
|
94
|
-
"@aws-sdk/client-sesv2": "^3.
|
|
95
|
-
"@aws-sdk/client-ssm": "^3.
|
|
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.
|
|
106
|
-
"aws-cdk-lib": "^2.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
-
|
|
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
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
//
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
//
|
|
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:
|
|
109
|
+
value: this.askAiUrl.url,
|
|
101
110
|
})
|
|
102
111
|
|
|
103
112
|
new Output(scope, 'AiVanitySummarizeApiUrl', {
|
|
104
|
-
value:
|
|
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.
|
|
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.
|
|
9
|
+
"version": "0.58.28",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"aws-sdk": "^2.
|
|
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.
|
|
28
|
-
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.
|
|
29
|
-
"integrity": "sha512-
|
|
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.
|
|
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.
|
|
367
|
-
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.
|
|
368
|
-
"integrity": "sha512-
|
|
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.
|
|
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.
|
|
13
|
+
"aws-sdk": "^2.1545.0"
|
|
14
14
|
}
|
|
15
15
|
}
|