@supacloud/cli 0.118.2 → 0.118.3
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/index.js
CHANGED
|
@@ -10004,6 +10004,7 @@ var WorkerExecutionGroupSchema = _Object_({
|
|
|
10004
10004
|
definitionVersion: String2({ pattern: "^[1-9][0-9]{0,8}$" }),
|
|
10005
10005
|
replicas: positive(16),
|
|
10006
10006
|
maxReplicas: positive(16),
|
|
10007
|
+
shardCount: Optional(positive(64)),
|
|
10007
10008
|
concurrencyPerReplica: positive(32),
|
|
10008
10009
|
resources: ComputeResourcesSchema,
|
|
10009
10010
|
database: _Object_({
|
|
@@ -10021,23 +10022,49 @@ var WorkerExecutionGroupSchema = _Object_({
|
|
|
10021
10022
|
var WorkerExecutionSchema = _Object_({
|
|
10022
10023
|
groups: _Array_(WorkerExecutionGroupSchema, { minItems: 1, maxItems: 32 })
|
|
10023
10024
|
}, closed);
|
|
10025
|
+
function workerShardCount(group) {
|
|
10026
|
+
return group.shardCount ?? 1;
|
|
10027
|
+
}
|
|
10028
|
+
function shardSuffix(shard) {
|
|
10029
|
+
if (!Number.isSafeInteger(shard) || shard < 0 || shard >= 64) {
|
|
10030
|
+
throw new Error("WORKER_SHARD_INVALID");
|
|
10031
|
+
}
|
|
10032
|
+
return `s${shard.toString(36).padStart(2, "0")}`;
|
|
10033
|
+
}
|
|
10034
|
+
function workerShardQueue(group, shard) {
|
|
10035
|
+
const count = workerShardCount(group);
|
|
10036
|
+
if (!Number.isSafeInteger(shard) || shard < 0 || shard >= count) {
|
|
10037
|
+
throw new Error("WORKER_SHARD_INVALID");
|
|
10038
|
+
}
|
|
10039
|
+
if (count === 1)
|
|
10040
|
+
return group.queue;
|
|
10041
|
+
const queue = `${group.queue}_${shardSuffix(shard)}`;
|
|
10042
|
+
if (!/^scw_[a-z0-9_]{1,40}$/.test(queue))
|
|
10043
|
+
throw new Error("WORKER_QUEUE_INVALID");
|
|
10044
|
+
return queue;
|
|
10045
|
+
}
|
|
10024
10046
|
function parseWorkerExecutionGroup(value) {
|
|
10025
10047
|
if (!Check2(WorkerExecutionGroupSchema, value) || value.replicas > value.maxReplicas || !value.queue.endsWith(`_v${value.definitionVersion}`) || value.lifecycle.visibilityTimeoutSeconds < value.lifecycle.executionTimeoutSeconds + value.lifecycle.shutdownGraceSeconds + 30) {
|
|
10026
10048
|
throw new Error("WORKER_EXECUTION_INVALID");
|
|
10027
10049
|
}
|
|
10028
|
-
|
|
10050
|
+
const group = structuredClone(value);
|
|
10051
|
+
for (let shard = 0;shard < workerShardCount(group); shard += 1)
|
|
10052
|
+
workerShardQueue(group, shard);
|
|
10053
|
+
return group;
|
|
10029
10054
|
}
|
|
10030
10055
|
function validateWorkerExecution(groups) {
|
|
10031
10056
|
const names = new Set, targets = new Set, queues = new Set, routes = new Set;
|
|
10032
10057
|
for (const candidate of groups) {
|
|
10033
10058
|
const group = parseWorkerExecutionGroup(candidate);
|
|
10034
10059
|
const route = `${group.taskKey}:${group.definitionVersion}`;
|
|
10035
|
-
|
|
10060
|
+
const physicalQueues = Array.from({ length: workerShardCount(group) }, (_, shard) => workerShardQueue(group, shard));
|
|
10061
|
+
if (names.has(group.name) || targets.has(group.target) || queues.has(group.queue) || physicalQueues.some((queue) => queues.has(queue)) || routes.has(route)) {
|
|
10036
10062
|
throw new Error("WORKER_EXECUTION_CONFLICT");
|
|
10037
10063
|
}
|
|
10038
10064
|
names.add(group.name);
|
|
10039
10065
|
targets.add(group.target);
|
|
10040
10066
|
queues.add(group.queue);
|
|
10067
|
+
physicalQueues.forEach((queue) => queues.add(queue));
|
|
10041
10068
|
routes.add(route);
|
|
10042
10069
|
}
|
|
10043
10070
|
}
|
|
@@ -10315,7 +10342,7 @@ function parseDeliveryBuildManifest(value) {
|
|
|
10315
10342
|
if (!Check2(DeliveryBuildManifestSchema, value))
|
|
10316
10343
|
throw new Error("Invalid delivery build manifest.");
|
|
10317
10344
|
validateWorkerExecution(value.plan.targets.flatMap((target) => target.execution ? [target.execution] : []));
|
|
10318
|
-
if (value.plan.targets.reduce((count, target) => count + (target.execution
|
|
10345
|
+
if (value.plan.targets.reduce((count, target) => count + (target.execution ? (target.execution.replicas ?? 1) * workerShardCount(target.execution) : 1), 0) > 256) {
|
|
10319
10346
|
throw new Error("Invalid delivery replica count.");
|
|
10320
10347
|
}
|
|
10321
10348
|
for (const target of value.plan.targets) {
|
|
@@ -10442,7 +10469,7 @@ function parseApplicationReleaseRecord(candidate) {
|
|
|
10442
10469
|
throw new Error("Invalid application release record.");
|
|
10443
10470
|
}
|
|
10444
10471
|
validateWorkerExecution(candidate.targets.flatMap((target) => target.execution ? [target.execution] : []));
|
|
10445
|
-
if (candidate.targets.reduce((count, target) => count + (target.execution
|
|
10472
|
+
if (candidate.targets.reduce((count, target) => count + (target.execution ? (target.execution.replicas ?? 1) * workerShardCount(target.execution) : 1), 0) > 256) {
|
|
10446
10473
|
throw new Error("Invalid application replica count.");
|
|
10447
10474
|
}
|
|
10448
10475
|
if (candidate.targets.some((target) => target.execution && (target.compute || target.kind !== "worker" || target.execution.target !== target.name))) {
|
|
@@ -22198,16 +22225,16 @@ var starter_metadata_default = {
|
|
|
22198
22225
|
generatedBy: "supacloud/starter-metadata-v1",
|
|
22199
22226
|
packages: {
|
|
22200
22227
|
compiler: {
|
|
22201
|
-
version: "0.
|
|
22228
|
+
version: "0.59.0"
|
|
22202
22229
|
},
|
|
22203
22230
|
app: {
|
|
22204
|
-
version: "0.39.
|
|
22231
|
+
version: "0.39.1",
|
|
22205
22232
|
dependencies: {
|
|
22206
22233
|
rxjs: "7.8.2"
|
|
22207
22234
|
}
|
|
22208
22235
|
},
|
|
22209
22236
|
elysia: {
|
|
22210
|
-
version: "0.
|
|
22237
|
+
version: "0.42.0"
|
|
22211
22238
|
},
|
|
22212
22239
|
commands: {
|
|
22213
22240
|
version: "0.12.0"
|
|
@@ -22216,7 +22243,7 @@ var starter_metadata_default = {
|
|
|
22216
22243
|
version: "0.16.0"
|
|
22217
22244
|
},
|
|
22218
22245
|
db: {
|
|
22219
|
-
version: "0.23.
|
|
22246
|
+
version: "0.23.1",
|
|
22220
22247
|
dependencies: {
|
|
22221
22248
|
"@zenstackhq/orm": "3.10.0",
|
|
22222
22249
|
"@zenstackhq/schema": "3.10.0",
|
|
@@ -34290,7 +34317,7 @@ async function runProjectDeployment(http, args) {
|
|
|
34290
34317
|
// package.json
|
|
34291
34318
|
var package_default = {
|
|
34292
34319
|
name: "@supacloud/cli",
|
|
34293
|
-
version: "0.118.
|
|
34320
|
+
version: "0.118.3",
|
|
34294
34321
|
description: "Project-scoped CLI for SupaCloud users",
|
|
34295
34322
|
type: "module",
|
|
34296
34323
|
main: "./dist/index.js",
|
|
@@ -34342,23 +34369,23 @@ var package_default = {
|
|
|
34342
34369
|
directory: "packages/cli"
|
|
34343
34370
|
},
|
|
34344
34371
|
dependencies: {
|
|
34345
|
-
"@supacloud/compiler": "^0.
|
|
34346
|
-
"@supacloud/delivery": "0.
|
|
34347
|
-
"@supacloud/db": "0.23.
|
|
34372
|
+
"@supacloud/compiler": "^0.59.0",
|
|
34373
|
+
"@supacloud/delivery": "0.26.0",
|
|
34374
|
+
"@supacloud/db": "0.23.1",
|
|
34348
34375
|
typebox: "1.4.3"
|
|
34349
34376
|
},
|
|
34350
34377
|
overrides: {
|
|
34351
34378
|
"@supacloud/contracts": "0.16.0",
|
|
34352
|
-
"@supacloud/delivery": "0.
|
|
34379
|
+
"@supacloud/delivery": "0.26.0",
|
|
34353
34380
|
"@graphql-tools/utils": "^12.0.4",
|
|
34354
|
-
"@supacloud/compiler": "^0.
|
|
34355
|
-
"@supacloud/db": "0.23.
|
|
34381
|
+
"@supacloud/compiler": "^0.59.0",
|
|
34382
|
+
"@supacloud/db": "0.23.1",
|
|
34356
34383
|
"deepmerge-ts": "8.0.2",
|
|
34357
34384
|
prisma: "6.19.3"
|
|
34358
34385
|
},
|
|
34359
34386
|
devDependencies: {
|
|
34360
34387
|
"@supabase/supabase-js": "2.118.0",
|
|
34361
|
-
"@supacloud/elysia": "0.
|
|
34388
|
+
"@supacloud/elysia": "0.42.0",
|
|
34362
34389
|
"@types/bun": "^1.4.4",
|
|
34363
34390
|
effect: "4.0.5",
|
|
34364
34391
|
elysia: "2.0.0-rc.1",
|
|
@@ -23,6 +23,7 @@ export declare const ApplicationReleaseRecordSchema: import("typebox").TObject<{
|
|
|
23
23
|
definitionVersion: import("typebox").TString;
|
|
24
24
|
replicas: import("typebox").TInteger;
|
|
25
25
|
maxReplicas: import("typebox").TInteger;
|
|
26
|
+
shardCount: import("typebox").TOptional<import("typebox").TInteger>;
|
|
26
27
|
concurrencyPerReplica: import("typebox").TInteger;
|
|
27
28
|
resources: import("typebox").TObject<{
|
|
28
29
|
cpuLimit: import("typebox").TNumber;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supacloud/cli",
|
|
3
|
-
"version": "0.118.
|
|
3
|
+
"version": "0.118.3",
|
|
4
4
|
"description": "Project-scoped CLI for SupaCloud users",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -52,23 +52,23 @@
|
|
|
52
52
|
"directory": "packages/cli"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@supacloud/compiler": "^0.
|
|
56
|
-
"@supacloud/delivery": "0.
|
|
57
|
-
"@supacloud/db": "0.23.
|
|
55
|
+
"@supacloud/compiler": "^0.59.0",
|
|
56
|
+
"@supacloud/delivery": "0.26.0",
|
|
57
|
+
"@supacloud/db": "0.23.1",
|
|
58
58
|
"typebox": "1.4.3"
|
|
59
59
|
},
|
|
60
60
|
"overrides": {
|
|
61
61
|
"@supacloud/contracts": "0.16.0",
|
|
62
|
-
"@supacloud/delivery": "0.
|
|
62
|
+
"@supacloud/delivery": "0.26.0",
|
|
63
63
|
"@graphql-tools/utils": "^12.0.4",
|
|
64
|
-
"@supacloud/compiler": "^0.
|
|
65
|
-
"@supacloud/db": "0.23.
|
|
64
|
+
"@supacloud/compiler": "^0.59.0",
|
|
65
|
+
"@supacloud/db": "0.23.1",
|
|
66
66
|
"deepmerge-ts": "8.0.2",
|
|
67
67
|
"prisma": "6.19.3"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@supabase/supabase-js": "2.118.0",
|
|
71
|
-
"@supacloud/elysia": "0.
|
|
71
|
+
"@supacloud/elysia": "0.42.0",
|
|
72
72
|
"@types/bun": "^1.4.4",
|
|
73
73
|
"effect": "4.0.5",
|
|
74
74
|
"elysia": "2.0.0-rc.1",
|