playcademy 0.27.0 → 0.27.1-beta.1
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/cli.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +97 -5
- package/dist/runtime/backend-runtime/index.js +2 -2
- package/dist/runtime/backend-runtime/manifest.json +3 -3
- package/dist/utils.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2951,7 +2951,7 @@ import { existsSync as existsSync11, mkdirSync as mkdirSync5, readFileSync as re
|
|
|
2951
2951
|
import { join as join13 } from "node:path";
|
|
2952
2952
|
|
|
2953
2953
|
// src/version.ts
|
|
2954
|
-
var cliVersion = false ? "0.0.0-dev" : "0.27.
|
|
2954
|
+
var cliVersion = false ? "0.0.0-dev" : "0.27.1-beta.1";
|
|
2955
2955
|
|
|
2956
2956
|
// src/lib/init/database.ts
|
|
2957
2957
|
var drizzleConfigTemplate = loadTemplateString("database/drizzle-config.ts");
|
package/dist/index.d.ts
CHANGED
|
@@ -831,6 +831,7 @@ interface DeploymentContext {
|
|
|
831
831
|
isDryRun: boolean;
|
|
832
832
|
deployBackend: boolean;
|
|
833
833
|
forceBackend: boolean;
|
|
834
|
+
skipSecrets: boolean;
|
|
834
835
|
forceIntegrationConfigSync?: string[];
|
|
835
836
|
cancellationHandled?: boolean;
|
|
836
837
|
/** Why a non-interactive deploy was cancelled; surfaced in --json error output. */
|
package/dist/index.js
CHANGED
|
@@ -4140,7 +4140,7 @@ import { existsSync as existsSync9, mkdirSync as mkdirSync2, readFileSync as rea
|
|
|
4140
4140
|
import { join as join13 } from "node:path";
|
|
4141
4141
|
|
|
4142
4142
|
// src/version.ts
|
|
4143
|
-
var cliVersion = false ? "0.0.0-dev" : "0.27.
|
|
4143
|
+
var cliVersion = false ? "0.0.0-dev" : "0.27.1-beta.1";
|
|
4144
4144
|
|
|
4145
4145
|
// src/lib/init/database.ts
|
|
4146
4146
|
var drizzleConfigTemplate = loadTemplateString("database/drizzle-config.ts");
|
|
@@ -12186,6 +12186,92 @@ async function validateDeployConfig(config) {
|
|
|
12186
12186
|
throw new Error("Invalid configuration");
|
|
12187
12187
|
}
|
|
12188
12188
|
}
|
|
12189
|
+
async function validateDeploySecrets(context2) {
|
|
12190
|
+
if (!context2.fullConfig?.integrations) {
|
|
12191
|
+
return;
|
|
12192
|
+
}
|
|
12193
|
+
if (context2.skipSecrets && context2.isGameDeployed && context2.existingGame) {
|
|
12194
|
+
await validatePlatformSecrets(context2, context2.existingGame.slug);
|
|
12195
|
+
} else {
|
|
12196
|
+
validateLocalSecrets(context2);
|
|
12197
|
+
}
|
|
12198
|
+
}
|
|
12199
|
+
function validateLocalSecrets(context2) {
|
|
12200
|
+
const missingSecrets = validateIntegrationSecrets(
|
|
12201
|
+
context2.fullConfig,
|
|
12202
|
+
context2.skipSecrets ? {} : context2.localSecrets ?? {}
|
|
12203
|
+
);
|
|
12204
|
+
if (missingSecrets.length === 0) {
|
|
12205
|
+
return;
|
|
12206
|
+
}
|
|
12207
|
+
const missing = missingSecrets[0];
|
|
12208
|
+
if (context2.json) {
|
|
12209
|
+
const suffix = context2.skipSecrets ? " (a deploy with --skip-secrets will never push it)" : "";
|
|
12210
|
+
throw new Error(
|
|
12211
|
+
`Missing secret ${missing.key} required by ${missing.integration} integration${suffix}`
|
|
12212
|
+
);
|
|
12213
|
+
}
|
|
12214
|
+
if (context2.skipSecrets) {
|
|
12215
|
+
logger.admonition("warning", `Missing Secret: ${missing.key}`, [
|
|
12216
|
+
`The <${missing.integration}> integration requires ${missing.key}, and a first`,
|
|
12217
|
+
"deploy with `--skip-secrets` will never push it",
|
|
12218
|
+
"",
|
|
12219
|
+
"Deploy without `--skip-secrets` so your .env secrets ship",
|
|
12220
|
+
"",
|
|
12221
|
+
`Learn more: <<${missing.docs}>>`
|
|
12222
|
+
]);
|
|
12223
|
+
} else {
|
|
12224
|
+
logger.admonition("warning", `Missing Secret: ${missing.key}`, [
|
|
12225
|
+
`The <${missing.integration}> integration requires ${missing.key} to be set in .env`,
|
|
12226
|
+
"",
|
|
12227
|
+
`Learn more: <<${missing.docs}>>`
|
|
12228
|
+
]);
|
|
12229
|
+
}
|
|
12230
|
+
process.exit(1);
|
|
12231
|
+
}
|
|
12232
|
+
async function validatePlatformSecrets(context2, gameSlug) {
|
|
12233
|
+
const requiredSecrets = validateIntegrationSecrets(context2.fullConfig, {});
|
|
12234
|
+
if (requiredSecrets.length === 0) {
|
|
12235
|
+
return;
|
|
12236
|
+
}
|
|
12237
|
+
let remoteKeys;
|
|
12238
|
+
try {
|
|
12239
|
+
remoteKeys = await context2.client.dev.games.secrets.list(gameSlug);
|
|
12240
|
+
} catch {
|
|
12241
|
+
}
|
|
12242
|
+
if (!remoteKeys) {
|
|
12243
|
+
if (context2.json) {
|
|
12244
|
+
logger.errLine(
|
|
12245
|
+
`Warning: could not fetch platform secret keys to verify ${requiredSecrets[0].key}, and --skip-secrets will not push it. Confirm with \`playcademy secrets list\``
|
|
12246
|
+
);
|
|
12247
|
+
} else {
|
|
12248
|
+
logger.admonition("warning", "Secrets Not Verified", [
|
|
12249
|
+
"The platform secret keys could not be fetched, and `--skip-secrets`",
|
|
12250
|
+
"will not push any",
|
|
12251
|
+
"",
|
|
12252
|
+
`Confirm ${requiredSecrets[0].key} is set with \`playcademy secrets list\``
|
|
12253
|
+
]);
|
|
12254
|
+
}
|
|
12255
|
+
return;
|
|
12256
|
+
}
|
|
12257
|
+
const missing = requiredSecrets.find((secret) => !remoteKeys.includes(secret.key));
|
|
12258
|
+
if (!missing) {
|
|
12259
|
+
return;
|
|
12260
|
+
}
|
|
12261
|
+
if (context2.json) {
|
|
12262
|
+
throw new Error(
|
|
12263
|
+
`Missing secret ${missing.key} required by ${missing.integration} integration (not set on the platform, and --skip-secrets will not push it)`
|
|
12264
|
+
);
|
|
12265
|
+
}
|
|
12266
|
+
logger.admonition("warning", `Missing Secret: ${missing.key}`, [
|
|
12267
|
+
`The <${missing.integration}> integration requires ${missing.key} to be set on the platform`,
|
|
12268
|
+
"",
|
|
12269
|
+
"Push it with `playcademy secrets push` or deploy without `--skip-secrets`",
|
|
12270
|
+
"",
|
|
12271
|
+
`Learn more: <<${missing.docs}>>`
|
|
12272
|
+
]);
|
|
12273
|
+
process.exit(1);
|
|
12274
|
+
}
|
|
12189
12275
|
|
|
12190
12276
|
// src/lib/deploy/interaction.ts
|
|
12191
12277
|
async function selectEnvironment(options) {
|
|
@@ -12768,6 +12854,9 @@ function displayCurrentConfiguration(context2) {
|
|
|
12768
12854
|
} else {
|
|
12769
12855
|
logger.data("Status", "Not deployed", 1);
|
|
12770
12856
|
}
|
|
12857
|
+
if (context2.skipSecrets) {
|
|
12858
|
+
logger.data("Secrets", "Sync skipped (--skip-secrets)", 1);
|
|
12859
|
+
}
|
|
12771
12860
|
logger.newLine();
|
|
12772
12861
|
}
|
|
12773
12862
|
async function reportNoChanges(context2) {
|
|
@@ -13382,9 +13471,9 @@ async function prepareDeploymentContext(options) {
|
|
|
13382
13471
|
buildHash = await hashFile(finalConfig.buildPath);
|
|
13383
13472
|
}
|
|
13384
13473
|
}
|
|
13385
|
-
const localSecrets = hasEnvFile(projectPath) ? await readEnvFile(projectPath) : {};
|
|
13474
|
+
const localSecrets = !options.skipSecrets && hasEnvFile(projectPath) ? await readEnvFile(projectPath) : {};
|
|
13386
13475
|
let remoteSecretKeys;
|
|
13387
|
-
if (existingGame && gameIsDeployed) {
|
|
13476
|
+
if (!options.skipSecrets && existingGame && gameIsDeployed) {
|
|
13388
13477
|
try {
|
|
13389
13478
|
remoteSecretKeys = await client.dev.games.secrets.list(existingGame.slug);
|
|
13390
13479
|
} catch {
|
|
@@ -13415,6 +13504,7 @@ async function prepareDeploymentContext(options) {
|
|
|
13415
13504
|
isDryRun: options.dryRun ?? false,
|
|
13416
13505
|
deployBackend: options.backend !== false,
|
|
13417
13506
|
forceBackend: options.forceBackend ?? false,
|
|
13507
|
+
skipSecrets: options.skipSecrets ?? false,
|
|
13418
13508
|
minify: options.minify ?? true,
|
|
13419
13509
|
verbose: options.verbose ?? false,
|
|
13420
13510
|
debug: options.debug ?? false,
|
|
@@ -13484,12 +13574,13 @@ async function analyzeChanges(context2) {
|
|
|
13484
13574
|
deployBackend,
|
|
13485
13575
|
localSecrets,
|
|
13486
13576
|
remoteSecretKeys,
|
|
13487
|
-
deployedGameInfo
|
|
13577
|
+
deployedGameInfo,
|
|
13578
|
+
skipSecrets
|
|
13488
13579
|
} = context2;
|
|
13489
13580
|
let secretsDiff = void 0;
|
|
13490
13581
|
const hasLocalSecrets = Object.keys(localSecrets ?? {}).length > 0;
|
|
13491
13582
|
const hasRemoteSecrets = remoteSecretKeys && remoteSecretKeys.length > 0;
|
|
13492
|
-
if (hasLocalSecrets || hasRemoteSecrets) {
|
|
13583
|
+
if (!skipSecrets && (hasLocalSecrets || hasRemoteSecrets)) {
|
|
13493
13584
|
secretsDiff = computeSecretsDiff({
|
|
13494
13585
|
localSecrets: localSecrets ?? {},
|
|
13495
13586
|
remoteKeys: remoteSecretKeys ?? [],
|
|
@@ -16334,6 +16425,7 @@ export {
|
|
|
16334
16425
|
validateConfig,
|
|
16335
16426
|
validateCustomHostname,
|
|
16336
16427
|
validateDeployConfig,
|
|
16428
|
+
validateDeploySecrets,
|
|
16337
16429
|
validateDeploymentState,
|
|
16338
16430
|
validateIntegrationSecrets,
|
|
16339
16431
|
validateQueueHandlersConfig,
|
|
@@ -414,9 +414,9 @@ var init_routes = __esm({
|
|
|
414
414
|
// ../edge-play/src/entry/metadata.ts
|
|
415
415
|
function getRuntimeMetadata() {
|
|
416
416
|
return {
|
|
417
|
-
cliVersion: true ? "0.27.
|
|
417
|
+
cliVersion: true ? "0.27.1-beta.1" : "0.0.0-dev",
|
|
418
418
|
sdkVersion: true ? "0.15.0" : "0.0.0-dev",
|
|
419
|
-
buildId: true ? "
|
|
419
|
+
buildId: true ? "c3d4ce6ef48d" : "dev-source"
|
|
420
420
|
};
|
|
421
421
|
}
|
|
422
422
|
var init_metadata = __esm({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"cliVersion": "0.27.
|
|
2
|
+
"cliVersion": "0.27.1-beta.1",
|
|
3
3
|
"sdkVersion": "0.15.0",
|
|
4
|
-
"runtimeBuildId": "
|
|
5
|
-
"inputFingerprint": "
|
|
4
|
+
"runtimeBuildId": "c3d4ce6ef48d",
|
|
5
|
+
"inputFingerprint": "c3d4ce6ef48d4f0ebc1a21e153861593787bb0b1e99d8f3e7c3484f6ea9d1fd8",
|
|
6
6
|
"entry": "index.js"
|
|
7
7
|
}
|
package/dist/utils.js
CHANGED
|
@@ -2603,7 +2603,7 @@ import { existsSync as existsSync9, mkdirSync as mkdirSync2, writeFileSync as wr
|
|
|
2603
2603
|
import { dirname as dirname4, join as join14 } from "node:path";
|
|
2604
2604
|
|
|
2605
2605
|
// src/version.ts
|
|
2606
|
-
var cliVersion = false ? "0.0.0-dev" : "0.27.
|
|
2606
|
+
var cliVersion = false ? "0.0.0-dev" : "0.27.1-beta.1";
|
|
2607
2607
|
|
|
2608
2608
|
// src/lib/build/binary-resource.ts
|
|
2609
2609
|
function writeFileTree(baseDir, files) {
|
package/dist/version.js
CHANGED