@stacksjs/ts-cloud 0.9.3 → 0.9.4
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/aws/index.js +1 -269
- package/dist/bin/chunk-00kg80qg.js +1 -0
- package/dist/bin/{chunk-hzqw8xm5.js → chunk-1k5kszjp.js} +1 -1
- package/dist/bin/{chunk-9v39615t.js → chunk-21e0mavm.js} +1 -1
- package/dist/bin/{chunk-waayf9ay.js → chunk-2empps47.js} +1 -1
- package/dist/bin/{chunk-14cwr6eh.js → chunk-3vqfexc4.js} +1 -1
- package/dist/bin/chunk-5ectjq0b.js +1 -0
- package/dist/bin/{chunk-b5gd39s8.js → chunk-5erkxpt7.js} +4 -4
- package/dist/bin/{chunk-41x17hw1.js → chunk-5mrtzemj.js} +1 -1
- package/dist/bin/{chunk-p8q9bq9g.js → chunk-5n9fmabb.js} +1 -1
- package/dist/bin/{chunk-gqf6jsmy.js → chunk-9knpg30y.js} +1 -1
- package/dist/bin/{chunk-r3kv0vm9.js → chunk-ddk4rt4j.js} +1 -1
- package/dist/bin/{chunk-avm7tnwe.js → chunk-e0rkrq70.js} +1 -1
- package/dist/bin/{chunk-ry030a6b.js → chunk-etrb03mt.js} +1 -1
- package/dist/bin/{chunk-8v7ddyvf.js → chunk-k9t9wvms.js} +1 -1
- package/dist/bin/{chunk-92mea34a.js → chunk-m7dgskt1.js} +1 -1
- package/dist/bin/{chunk-3r4fb59r.js → chunk-mz0wbbsj.js} +1 -1
- package/dist/bin/{chunk-b9qbp8j1.js → chunk-qk9qgepa.js} +1 -1
- package/dist/bin/chunk-rxcvf10f.js +7364 -0
- package/dist/bin/{chunk-r9hjwcj9.js → chunk-tga3hhwk.js} +1 -1
- package/dist/bin/{chunk-ynjvbphf.js → chunk-tx0tqq2k.js} +1 -1
- package/dist/bin/{chunk-57y1zxbf.js → chunk-vm3q5gf2.js} +1 -1
- package/dist/bin/{chunk-bz828v8q.js → chunk-y7s5r8y6.js} +1 -1
- package/dist/bin/{chunk-sgyffpgm.js → chunk-zmegvjp8.js} +1 -1
- package/dist/bin/cli.js +14 -14
- package/dist/bin/dashboard-server.js +1 -1
- package/dist/chunk-0ccta6z6.js +6 -0
- package/dist/chunk-0k1cs6pp.js +1 -0
- package/dist/chunk-1egjn203.js +704 -0
- package/dist/chunk-2wx29qga.js +5 -0
- package/dist/chunk-5m5rqmv7.js +1 -0
- package/dist/chunk-8ea5022g.js +114 -0
- package/dist/chunk-8xqn3c0w.js +2 -0
- package/dist/chunk-b4esxhmw.js +2 -0
- package/dist/chunk-b8e5wzwn.js +44 -0
- package/dist/chunk-bggt4n6e.js +2 -0
- package/dist/chunk-cwkg37rs.js +37 -0
- package/dist/chunk-dskvqt67.js +7355 -0
- package/dist/chunk-gahsdmxf.js +1617 -0
- package/dist/chunk-gnv3r2jg.js +1 -0
- package/dist/chunk-hg3c48cp.js +34 -0
- package/dist/chunk-m5azeva3.js +2 -0
- package/dist/chunk-r3qf56b3.js +92 -0
- package/dist/chunk-sdqa9ghv.js +141 -0
- package/dist/chunk-svrvvcm7.js +1 -0
- package/dist/chunk-v0p3hpc3.js +60 -0
- package/dist/chunk-wdzjbecg.js +50 -0
- package/dist/chunk-ww8k3g7j.js +1 -0
- package/dist/chunk-xmqfc62w.js +1 -0
- package/dist/chunk-xrebj679.js +435 -0
- package/dist/chunk-xt3s24vr.js +2 -0
- package/dist/chunk-y21zk0pn.js +4 -0
- package/dist/deploy/index.js +1 -168
- package/dist/dns/index.js +1 -41
- package/dist/drivers/index.js +1 -154
- package/dist/index.js +100 -6129
- package/dist/protection/index.js +1 -89
- package/dist/push/index.js +1 -509
- package/dist/spend/index.js +1 -173
- package/dist/ui/404.html +1 -1
- package/dist/ui/accept-invitation.html +1 -1
- package/dist/ui/access-denied.html +1 -1
- package/dist/ui/account/automation.html +6 -6
- package/dist/ui/account/security.html +2 -2
- package/dist/ui/applications/compose.html +6 -6
- package/dist/ui/applications/new.html +2 -2
- package/dist/ui/data/backups.html +5 -5
- package/dist/ui/data/services.html +5 -5
- package/dist/ui/data/volumes.html +6 -6
- package/dist/ui/index.html +6 -6
- package/dist/ui/infrastructure/topology.html +5 -5
- package/dist/ui/integrations.html +1 -1
- package/dist/ui/operations/alerts.html +5 -5
- package/dist/ui/operations/configuration.html +5 -5
- package/dist/ui/operations/jobs.html +5 -5
- package/dist/ui/operations/maintenance.html +5 -5
- package/dist/ui/operations/observability.html +6 -6
- package/dist/ui/operations/previews.html +6 -6
- package/dist/ui/operations/queue.html +6 -6
- package/dist/ui/operations/regions.html +6 -6
- package/dist/ui/operations/releases.html +6 -6
- package/dist/ui/operations/spend.html +6 -6
- package/dist/ui/operations/workloads.html +6 -6
- package/dist/ui/security.html +1 -1
- package/dist/ui/server/actions.html +5 -5
- package/dist/ui/server/activity.html +1 -1
- package/dist/ui/server/capacity.html +6 -6
- package/dist/ui/server/database.html +6 -6
- package/dist/ui/server/deployments.html +6 -6
- package/dist/ui/server/diagnostics.html +2 -2
- package/dist/ui/server/firewall.html +6 -6
- package/dist/ui/server/fleet.html +6 -6
- package/dist/ui/server/logs.html +6 -6
- package/dist/ui/server/metrics.html +6 -6
- package/dist/ui/server/security.html +2 -2
- package/dist/ui/server/services.html +1 -1
- package/dist/ui/server/sites.html +6 -6
- package/dist/ui/server/ssh-keys.html +6 -6
- package/dist/ui/server/team.html +6 -6
- package/dist/ui/server/terminal.html +1 -1
- package/dist/ui/serverless/alarms.html +5 -5
- package/dist/ui/serverless/assets.html +2 -2
- package/dist/ui/serverless/cost.html +1 -1
- package/dist/ui/serverless/data.html +6 -6
- package/dist/ui/serverless/deployments.html +2 -2
- package/dist/ui/serverless/firewall.html +1 -1
- package/dist/ui/serverless/functions.html +6 -6
- package/dist/ui/serverless/logs.html +6 -6
- package/dist/ui/serverless/metrics.html +2 -2
- package/dist/ui/serverless/queues.html +6 -6
- package/dist/ui/serverless/secrets.html +6 -6
- package/dist/ui/serverless/traces.html +6 -6
- package/dist/ui/serverless.html +5 -5
- package/package.json +3 -3
- package/dist/bin/chunk-jpjamjey.js +0 -6935
- package/dist/bin/chunk-m2zwtapr.js +0 -1
- package/dist/bin/chunk-rtczra13.js +0 -1
- package/dist/chunk-01d86gt1.js +0 -1324
- package/dist/chunk-050r7ycy.js +0 -46516
- package/dist/chunk-1c8dbv57.js +0 -7278
- package/dist/chunk-29rse4p1.js +0 -12203
- package/dist/chunk-32e7ya18.js +0 -642
- package/dist/chunk-4cjrg98a.js +0 -597
- package/dist/chunk-50jpda9q.js +0 -371
- package/dist/chunk-6a1t7fnq.js +0 -12121
- package/dist/chunk-728jvrr0.js +0 -1701
- package/dist/chunk-7m60qnc8.js +0 -1762
- package/dist/chunk-aa2dkn7b.js +0 -205
- package/dist/chunk-d48vtdj4.js +0 -433
- package/dist/chunk-f55nkpvb.js +0 -8
- package/dist/chunk-fgk8cqew.js +0 -152
- package/dist/chunk-he9a874b.js +0 -769
- package/dist/chunk-k2yyatfw.js +0 -10
- package/dist/chunk-k4px0bnv.js +0 -23
- package/dist/chunk-nsgqsmrh.js +0 -1779
- package/dist/chunk-q0st3se8.js +0 -42033
- package/dist/chunk-qr803fye.js +0 -2122
- package/dist/chunk-rds0sy87.js +0 -1771
- package/dist/chunk-ttz2ra5j.js +0 -12
- package/dist/chunk-v0bahtg2.js +0 -4
- package/dist/chunk-va2yd85b.js +0 -200
- package/dist/chunk-x9s0cqfx.js +0 -13
- package/dist/chunk-zqtpg06c.js +0 -1752
package/dist/chunk-fgk8cqew.js
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ECRClient
|
|
3
|
-
} from "./chunk-50jpda9q.js";
|
|
4
|
-
import {
|
|
5
|
-
collectPhpAppEntries,
|
|
6
|
-
generateAppImageDockerfile,
|
|
7
|
-
packageServerlessApp,
|
|
8
|
-
phpRuntimeLayerAssets,
|
|
9
|
-
runPhpBuildHooks,
|
|
10
|
-
sha256
|
|
11
|
-
} from "./chunk-050r7ycy.js";
|
|
12
|
-
|
|
13
|
-
// src/deploy/serverless-image.ts
|
|
14
|
-
import { execFileSync } from "node:child_process";
|
|
15
|
-
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
16
|
-
import { tmpdir } from "node:os";
|
|
17
|
-
import { dirname, join } from "node:path";
|
|
18
|
-
|
|
19
|
-
// src/utils/cli.ts
|
|
20
|
-
var colors = {
|
|
21
|
-
reset: "\x1B[0m",
|
|
22
|
-
bright: "\x1B[1m",
|
|
23
|
-
dim: "\x1B[2m",
|
|
24
|
-
red: "\x1B[31m",
|
|
25
|
-
green: "\x1B[32m",
|
|
26
|
-
yellow: "\x1B[33m",
|
|
27
|
-
blue: "\x1B[34m",
|
|
28
|
-
magenta: "\x1B[35m",
|
|
29
|
-
cyan: "\x1B[36m",
|
|
30
|
-
white: "\x1B[37m",
|
|
31
|
-
gray: "\x1B[90m"
|
|
32
|
-
};
|
|
33
|
-
function colorize(text, color) {
|
|
34
|
-
return `${colors[color]}${text}${colors.reset}`;
|
|
35
|
-
}
|
|
36
|
-
function success(message) {
|
|
37
|
-
console.log(`${colors.green}✓${colors.reset} ${message}`);
|
|
38
|
-
}
|
|
39
|
-
function error(message) {
|
|
40
|
-
console.error(`${colors.red}✗${colors.reset} ${message}`);
|
|
41
|
-
}
|
|
42
|
-
function warn(message) {
|
|
43
|
-
console.warn(`${colors.yellow}⚠${colors.reset} ${message}`);
|
|
44
|
-
}
|
|
45
|
-
function info(message) {
|
|
46
|
-
console.log(`${colors.blue}ℹ${colors.reset} ${message}`);
|
|
47
|
-
}
|
|
48
|
-
function step(message) {
|
|
49
|
-
console.log(`${colors.cyan}→${colors.reset} ${message}`);
|
|
50
|
-
}
|
|
51
|
-
function header(message) {
|
|
52
|
-
console.log(`
|
|
53
|
-
${colors.bright}${colors.cyan}${message}${colors.reset}
|
|
54
|
-
`);
|
|
55
|
-
}
|
|
56
|
-
var isCI = !!(process.env.CI || process.env.GITHUB_ACTIONS || process.env.BUILDKITE || process.env.CIRCLECI || process.env.GITLAB_CI);
|
|
57
|
-
function box(message, color = "cyan") {
|
|
58
|
-
const lines = message.split(`
|
|
59
|
-
`);
|
|
60
|
-
const maxLength = Math.max(...lines.map((line) => line.length));
|
|
61
|
-
const border = "─".repeat(maxLength + 2);
|
|
62
|
-
console.log(colorize(`┌${border}┐`, color));
|
|
63
|
-
lines.forEach((line) => {
|
|
64
|
-
console.log(colorize(`│ ${line.padEnd(maxLength)} │`, color));
|
|
65
|
-
});
|
|
66
|
-
console.log(colorize(`└${border}┘`, color));
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// src/deploy/serverless-image.ts
|
|
70
|
-
function writeEntries(baseDir, entries) {
|
|
71
|
-
for (const e of entries) {
|
|
72
|
-
const dest = join(baseDir, e.name);
|
|
73
|
-
mkdirSync(dirname(dest), { recursive: true });
|
|
74
|
-
writeFileSync(dest, e.data, e.mode ? { mode: e.mode } : undefined);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
async function buildAndPushServerlessImage(opts) {
|
|
78
|
-
const { app, projectRoot, region, repository } = opts;
|
|
79
|
-
const arch = app.architecture ?? "x86_64";
|
|
80
|
-
const platform = arch === "arm64" ? "linux/arm64" : "linux/amd64";
|
|
81
|
-
const isPhp = app.kind === "php";
|
|
82
|
-
const step2 = opts.onStep ?? (() => {});
|
|
83
|
-
const stage = mkdtempSync(join(tmpdir(), "tscloud-img-"));
|
|
84
|
-
try {
|
|
85
|
-
const appDir = join(stage, "app");
|
|
86
|
-
mkdirSync(appDir, { recursive: true });
|
|
87
|
-
let handlers;
|
|
88
|
-
let contentHash;
|
|
89
|
-
if (isPhp) {
|
|
90
|
-
runPhpBuildHooks({ projectRoot, app, skipBuild: opts.skipBuild, onStep: step2 });
|
|
91
|
-
step2("staging application tree");
|
|
92
|
-
const entries = collectPhpAppEntries(projectRoot);
|
|
93
|
-
writeEntries(appDir, entries);
|
|
94
|
-
writeEntries(join(stage, "runtime"), phpRuntimeLayerAssets().map((a) => ({ name: a.path, data: a.contents, mode: a.mode })));
|
|
95
|
-
const handler = app.handlers?.http ?? "public/index.php";
|
|
96
|
-
handlers = { http: handler, queue: app.handlers?.queue ?? handler, cli: app.handlers?.cli ?? handler };
|
|
97
|
-
contentHash = sha256(entries.map((e) => `${e.name}:${e.data.length}`).join("|"));
|
|
98
|
-
} else {
|
|
99
|
-
step2("bundling application");
|
|
100
|
-
const artifact = await packageServerlessApp({ projectRoot, app, skipBuild: opts.skipBuild, onStep: step2 });
|
|
101
|
-
writeFileSync(join(appDir, "index.mjs"), artifact.bundle);
|
|
102
|
-
handlers = artifact.handlers;
|
|
103
|
-
contentHash = artifact.sha256;
|
|
104
|
-
}
|
|
105
|
-
const tag = contentHash.slice(0, 16);
|
|
106
|
-
writeFileSync(join(stage, "Dockerfile"), generateAppImageDockerfile({
|
|
107
|
-
kind: app.kind ?? "node",
|
|
108
|
-
phpVersion: app.phpVersion,
|
|
109
|
-
architecture: arch
|
|
110
|
-
}));
|
|
111
|
-
const ecr = new ECRClient(region);
|
|
112
|
-
let repoUri;
|
|
113
|
-
try {
|
|
114
|
-
const desc = await ecr.describeRepositories({ repositoryNames: [repository] });
|
|
115
|
-
repoUri = desc.repositories?.[0]?.repositoryUri ?? "";
|
|
116
|
-
} catch {
|
|
117
|
-
repoUri = "";
|
|
118
|
-
}
|
|
119
|
-
if (!repoUri) {
|
|
120
|
-
step2(`creating ECR repository ${repository}`);
|
|
121
|
-
const created = await ecr.createRepository({
|
|
122
|
-
repositoryName: repository,
|
|
123
|
-
imageScanningConfiguration: { scanOnPush: true }
|
|
124
|
-
});
|
|
125
|
-
repoUri = created.repository?.repositoryUri ?? "";
|
|
126
|
-
}
|
|
127
|
-
if (!repoUri)
|
|
128
|
-
throw new Error(`could not resolve ECR repository URI for ${repository}`);
|
|
129
|
-
const imageUri = `${repoUri}:${tag}`;
|
|
130
|
-
step2("docker build");
|
|
131
|
-
execFileSync("docker", ["build", "--platform", platform, "--provenance=false", "--sbom=false", "-t", imageUri, stage], { stdio: "inherit" });
|
|
132
|
-
step2("ecr auth + push");
|
|
133
|
-
const auth = await ecr.getAuthorizationToken();
|
|
134
|
-
const data = auth.authorizationData?.[0];
|
|
135
|
-
if (!data?.authorizationToken || !data.proxyEndpoint)
|
|
136
|
-
throw new Error("failed to get an ECR authorization token");
|
|
137
|
-
const registry = data.proxyEndpoint.replace(/^https?:\/\//, "");
|
|
138
|
-
const dockerConfig = join(stage, ".docker");
|
|
139
|
-
mkdirSync(dockerConfig, { recursive: true });
|
|
140
|
-
writeFileSync(join(dockerConfig, "config.json"), JSON.stringify({ auths: { [registry]: { auth: data.authorizationToken } } }));
|
|
141
|
-
execFileSync("docker", ["push", imageUri], {
|
|
142
|
-
stdio: "inherit",
|
|
143
|
-
env: { ...process.env, DOCKER_CONFIG: dockerConfig }
|
|
144
|
-
});
|
|
145
|
-
info(`Image: ${imageUri}`);
|
|
146
|
-
return { imageUri, tag, handlers };
|
|
147
|
-
} finally {
|
|
148
|
-
rmSync(stage, { recursive: true, force: true });
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export { success, error, warn, info, step, header, box, buildAndPushServerlessImage };
|