playcademy 0.14.30-alpha.2 → 0.14.31-alpha.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 CHANGED
@@ -2754,7 +2754,7 @@ import { join as join13 } from "path";
2754
2754
  // package.json with { type: 'json' }
2755
2755
  var package_default2 = {
2756
2756
  name: "playcademy",
2757
- version: "0.14.30",
2757
+ version: "0.14.31",
2758
2758
  type: "module",
2759
2759
  exports: {
2760
2760
  ".": {
@@ -2773,19 +2773,19 @@ var package_default2 = {
2773
2773
  require: "./dist/db.js"
2774
2774
  },
2775
2775
  "./utils": {
2776
- import: "./dist/utils.js",
2777
- types: "./dist/utils.d.ts"
2776
+ types: "./dist/utils.d.ts",
2777
+ import: "./dist/utils.js"
2778
2778
  },
2779
2779
  "./constants": {
2780
- import: "./dist/constants.js",
2781
- types: "./dist/constants.d.ts"
2780
+ types: "./dist/constants.d.ts",
2781
+ import: "./dist/constants.js"
2782
2782
  },
2783
2783
  "./types": {
2784
2784
  types: "./dist/index.d.ts"
2785
2785
  },
2786
2786
  "./version": {
2787
- import: "./dist/version.js",
2788
- types: "./dist/version.d.ts"
2787
+ types: "./dist/version.d.ts",
2788
+ import: "./dist/version.js"
2789
2789
  }
2790
2790
  },
2791
2791
  main: "./dist/index.js",
package/dist/index.js CHANGED
@@ -1421,16 +1421,9 @@ function getErrorMessage(error) {
1421
1421
  }
1422
1422
  function logAndExit(error, options = {}) {
1423
1423
  const { code = 1, prefix } = options;
1424
- if (process.env.DEBUG) {
1425
- if (prefix) {
1426
- logger.error(prefix);
1427
- }
1428
- formatError(error);
1429
- } else {
1430
- const message = getErrorMessage(error);
1431
- const fullMessage = prefix ? `${prefix}: ${message}` : message;
1432
- logger.error(fullMessage);
1433
- }
1424
+ const message = getErrorMessage(error);
1425
+ const fullMessage = prefix ? `${prefix}: ${message}` : message;
1426
+ logger.error(fullMessage);
1434
1427
  logger.newLine();
1435
1428
  process.exit(code);
1436
1429
  }
@@ -3546,7 +3539,7 @@ import { join as join12 } from "path";
3546
3539
  // package.json with { type: 'json' }
3547
3540
  var package_default2 = {
3548
3541
  name: "playcademy",
3549
- version: "0.14.30",
3542
+ version: "0.14.31",
3550
3543
  type: "module",
3551
3544
  exports: {
3552
3545
  ".": {
@@ -3565,19 +3558,19 @@ var package_default2 = {
3565
3558
  require: "./dist/db.js"
3566
3559
  },
3567
3560
  "./utils": {
3568
- import: "./dist/utils.js",
3569
- types: "./dist/utils.d.ts"
3561
+ types: "./dist/utils.d.ts",
3562
+ import: "./dist/utils.js"
3570
3563
  },
3571
3564
  "./constants": {
3572
- import: "./dist/constants.js",
3573
- types: "./dist/constants.d.ts"
3565
+ types: "./dist/constants.d.ts",
3566
+ import: "./dist/constants.js"
3574
3567
  },
3575
3568
  "./types": {
3576
3569
  types: "./dist/index.d.ts"
3577
3570
  },
3578
3571
  "./version": {
3579
- import: "./dist/version.js",
3580
- types: "./dist/version.d.ts"
3572
+ types: "./dist/version.d.ts",
3573
+ import: "./dist/version.js"
3581
3574
  }
3582
3575
  },
3583
3576
  main: "./dist/index.js",
@@ -9733,7 +9726,7 @@ var getStatusCommand = new Command12("status").description("Check your developer
9733
9726
  });
9734
9727
 
9735
9728
  // package.json
9736
- var version2 = "0.14.30";
9729
+ var version2 = "0.14.31";
9737
9730
 
9738
9731
  // src/commands/dev/server.ts
9739
9732
  function setupCleanupHandlers(workspace, getServer) {
@@ -10381,6 +10374,52 @@ async function runDbReset(options = {}) {
10381
10374
  }
10382
10375
  }
10383
10376
 
10377
+ // src/commands/db/schema.ts
10378
+ async function runDbSchema(options = {}) {
10379
+ try {
10380
+ if (!hasDatabaseSetup()) {
10381
+ logger.newLine();
10382
+ logger.admonition("warning", "No Database Setup", [
10383
+ "No database configuration found in this project.",
10384
+ "Run `playcademy db init` to add database support."
10385
+ ]);
10386
+ logger.newLine();
10387
+ return;
10388
+ }
10389
+ const schemaInfo = await getSchemaInfo();
10390
+ if (!schemaInfo) {
10391
+ logger.newLine();
10392
+ logger.warn("No schema found or schema is empty");
10393
+ logger.newLine();
10394
+ logger.remark("Nothing to show");
10395
+ logger.newLine();
10396
+ return;
10397
+ }
10398
+ if (options.raw) {
10399
+ logger.raw(schemaInfo.sql);
10400
+ } else {
10401
+ logger.newLine();
10402
+ logger.highlight("Database Schema");
10403
+ logger.newLine();
10404
+ const lines = schemaInfo.sql.split("\n").filter((line) => line.trim());
10405
+ lines.forEach((line) => {
10406
+ logger.bold(line, 1);
10407
+ });
10408
+ logger.newLine();
10409
+ const statementCount = await getSchemaStatementCount();
10410
+ logger.data("SQL Statements", String(statementCount), 1);
10411
+ if (options.full) {
10412
+ logger.highlight("Schema Hash");
10413
+ logger.newLine();
10414
+ logger.json(JSON.parse(schemaInfo.hash), 1);
10415
+ }
10416
+ logger.newLine();
10417
+ }
10418
+ } catch (error) {
10419
+ logAndExit(error, { prefix: "Failed to get schema" });
10420
+ }
10421
+ }
10422
+
10384
10423
  // src/commands/db/seed.ts
10385
10424
  import { existsSync as existsSync26 } from "fs";
10386
10425
  import { join as join37 } from "path";
@@ -10424,17 +10463,7 @@ async function runDbSeedRemote(seedFile, options) {
10424
10463
  logger.newLine();
10425
10464
  process.exit(1);
10426
10465
  }
10427
- const games2 = await client.games.list({ force: true });
10428
- const game = games2.find((g) => g.id === deployedGame.gameId);
10429
- if (!game) {
10430
- logger.newLine();
10431
- logger.admonition("warning", "Game Not Found", [
10432
- `Could not find game with ID \`${deployedGame.gameId}\``,
10433
- `Try redeploying your project: \`playcademy deploy\``
10434
- ]);
10435
- logger.newLine();
10436
- process.exit(1);
10437
- }
10466
+ const game = await client.games.fetch(deployedGame.gameId);
10438
10467
  const willReset = options.reset !== false;
10439
10468
  logger.newLine();
10440
10469
  if (willReset) {
@@ -10608,6 +10637,7 @@ dbCommand.command("seed [file]").description("Seed database with initial data").
10608
10637
  })
10609
10638
  );
10610
10639
  dbCommand.command("diff").description("Show schema changes since last deployment").action(runDbDiff);
10640
+ dbCommand.command("schema").description("Print full schema SQL that would be pushed after reset").option("--raw", "Output raw SQL only (for piping to files)").option("--full", "Show full schema hash").action((options) => runDbSchema({ raw: options.raw, full: options.full }));
10611
10641
 
10612
10642
  // src/commands/kv/index.ts
10613
10643
  import { Command as Command19 } from "commander";
@@ -12655,7 +12685,16 @@ var deleteCommand2 = new Command22("delete").description("Delete a project secre
12655
12685
  logger.newLine();
12656
12686
  process.exit(1);
12657
12687
  }
12658
- const game = await client.games.fetch(deployedGame.gameId);
12688
+ const games2 = await client.games.list({ force: true });
12689
+ const game = games2.find((g) => g.id === deployedGame.gameId);
12690
+ if (!game) {
12691
+ logger.admonition("warning", "Game Not Found", [
12692
+ `Could not find game with ID \`${deployedGame.gameId}\``,
12693
+ `Try redeploying your project: \`playcademy deploy\``
12694
+ ]);
12695
+ logger.newLine();
12696
+ process.exit(1);
12697
+ }
12659
12698
  if (!options.force) {
12660
12699
  const confirmed = await confirm14({
12661
12700
  message: `Delete secret "${key}" from "${game.slug}" in ${environment}?`,
@@ -12719,7 +12758,16 @@ var listCommand2 = new Command23("list").description("List project secret keys")
12719
12758
  logger.newLine();
12720
12759
  process.exit(1);
12721
12760
  }
12722
- const game = await client.games.fetch(deployedGame.gameId);
12761
+ const games2 = await client.games.list({ force: true });
12762
+ const game = games2.find((g) => g.id === deployedGame.gameId);
12763
+ if (!game) {
12764
+ logger.admonition("warning", "Game Not Found", [
12765
+ `Could not find game with ID \`${deployedGame.gameId}\``,
12766
+ `Try redeploying your project: \`playcademy deploy\``
12767
+ ]);
12768
+ logger.newLine();
12769
+ process.exit(1);
12770
+ }
12723
12771
  const keys = await runStep(
12724
12772
  `Fetching secrets from ${environment}`,
12725
12773
  () => client.dev.games.secrets.list(game.slug),
@@ -12759,7 +12807,16 @@ var setCommand = new Command24("set").description("Set or update a project secre
12759
12807
  logger.newLine();
12760
12808
  process.exit(1);
12761
12809
  }
12762
- const game = await client.games.fetch(deployedGame.gameId);
12810
+ const games2 = await client.games.list({ force: true });
12811
+ const game = games2.find((g) => g.id === deployedGame.gameId);
12812
+ if (!game) {
12813
+ logger.admonition("warning", "Game Not Found", [
12814
+ `Could not find game with ID \`${deployedGame.gameId}\``,
12815
+ `Try redeploying your project: \`playcademy deploy\``
12816
+ ]);
12817
+ logger.newLine();
12818
+ process.exit(1);
12819
+ }
12763
12820
  await runStep(
12764
12821
  `Setting secret "${key}" in ${environment}`,
12765
12822
  () => client.dev.games.secrets.set(game.slug, { [key]: value }),
package/dist/utils.js CHANGED
@@ -2208,7 +2208,7 @@ import { join as join12 } from "path";
2208
2208
  // package.json with { type: 'json' }
2209
2209
  var package_default2 = {
2210
2210
  name: "playcademy",
2211
- version: "0.14.30",
2211
+ version: "0.14.31",
2212
2212
  type: "module",
2213
2213
  exports: {
2214
2214
  ".": {
@@ -2227,19 +2227,19 @@ var package_default2 = {
2227
2227
  require: "./dist/db.js"
2228
2228
  },
2229
2229
  "./utils": {
2230
- import: "./dist/utils.js",
2231
- types: "./dist/utils.d.ts"
2230
+ types: "./dist/utils.d.ts",
2231
+ import: "./dist/utils.js"
2232
2232
  },
2233
2233
  "./constants": {
2234
- import: "./dist/constants.js",
2235
- types: "./dist/constants.d.ts"
2234
+ types: "./dist/constants.d.ts",
2235
+ import: "./dist/constants.js"
2236
2236
  },
2237
2237
  "./types": {
2238
2238
  types: "./dist/index.d.ts"
2239
2239
  },
2240
2240
  "./version": {
2241
- import: "./dist/version.js",
2242
- types: "./dist/version.d.ts"
2241
+ types: "./dist/version.d.ts",
2242
+ import: "./dist/version.js"
2243
2243
  }
2244
2244
  },
2245
2245
  main: "./dist/index.js",
package/dist/version.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // package.json with { type: 'json' }
2
2
  var package_default = {
3
3
  name: "playcademy",
4
- version: "0.14.30",
4
+ version: "0.14.31",
5
5
  type: "module",
6
6
  exports: {
7
7
  ".": {
@@ -20,19 +20,19 @@ var package_default = {
20
20
  require: "./dist/db.js"
21
21
  },
22
22
  "./utils": {
23
- import: "./dist/utils.js",
24
- types: "./dist/utils.d.ts"
23
+ types: "./dist/utils.d.ts",
24
+ import: "./dist/utils.js"
25
25
  },
26
26
  "./constants": {
27
- import: "./dist/constants.js",
28
- types: "./dist/constants.d.ts"
27
+ types: "./dist/constants.d.ts",
28
+ import: "./dist/constants.js"
29
29
  },
30
30
  "./types": {
31
31
  types: "./dist/index.d.ts"
32
32
  },
33
33
  "./version": {
34
- import: "./dist/version.js",
35
- types: "./dist/version.d.ts"
34
+ types: "./dist/version.d.ts",
35
+ import: "./dist/version.js"
36
36
  }
37
37
  },
38
38
  main: "./dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playcademy",
3
- "version": "0.14.30-alpha.2",
3
+ "version": "0.14.31-alpha.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -19,19 +19,19 @@
19
19
  "require": "./dist/db.js"
20
20
  },
21
21
  "./utils": {
22
- "import": "./dist/utils.js",
23
- "types": "./dist/utils.d.ts"
22
+ "types": "./dist/utils.d.ts",
23
+ "import": "./dist/utils.js"
24
24
  },
25
25
  "./constants": {
26
- "import": "./dist/constants.js",
27
- "types": "./dist/constants.d.ts"
26
+ "types": "./dist/constants.d.ts",
27
+ "import": "./dist/constants.js"
28
28
  },
29
29
  "./types": {
30
30
  "types": "./dist/index.d.ts"
31
31
  },
32
32
  "./version": {
33
- "import": "./dist/version.js",
34
- "types": "./dist/version.d.ts"
33
+ "types": "./dist/version.d.ts",
34
+ "import": "./dist/version.js"
35
35
  }
36
36
  },
37
37
  "main": "./dist/index.js",