playcademy 0.14.30 → 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.29",
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
@@ -3539,7 +3539,7 @@ import { join as join12 } from "path";
3539
3539
  // package.json with { type: 'json' }
3540
3540
  var package_default2 = {
3541
3541
  name: "playcademy",
3542
- version: "0.14.29",
3542
+ version: "0.14.31",
3543
3543
  type: "module",
3544
3544
  exports: {
3545
3545
  ".": {
@@ -3558,19 +3558,19 @@ var package_default2 = {
3558
3558
  require: "./dist/db.js"
3559
3559
  },
3560
3560
  "./utils": {
3561
- import: "./dist/utils.js",
3562
- types: "./dist/utils.d.ts"
3561
+ types: "./dist/utils.d.ts",
3562
+ import: "./dist/utils.js"
3563
3563
  },
3564
3564
  "./constants": {
3565
- import: "./dist/constants.js",
3566
- types: "./dist/constants.d.ts"
3565
+ types: "./dist/constants.d.ts",
3566
+ import: "./dist/constants.js"
3567
3567
  },
3568
3568
  "./types": {
3569
3569
  types: "./dist/index.d.ts"
3570
3570
  },
3571
3571
  "./version": {
3572
- import: "./dist/version.js",
3573
- types: "./dist/version.d.ts"
3572
+ types: "./dist/version.d.ts",
3573
+ import: "./dist/version.js"
3574
3574
  }
3575
3575
  },
3576
3576
  main: "./dist/index.js",
@@ -9726,7 +9726,7 @@ var getStatusCommand = new Command12("status").description("Check your developer
9726
9726
  });
9727
9727
 
9728
9728
  // package.json
9729
- var version2 = "0.14.29";
9729
+ var version2 = "0.14.31";
9730
9730
 
9731
9731
  // src/commands/dev/server.ts
9732
9732
  function setupCleanupHandlers(workspace, getServer) {
@@ -10374,6 +10374,52 @@ async function runDbReset(options = {}) {
10374
10374
  }
10375
10375
  }
10376
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
+
10377
10423
  // src/commands/db/seed.ts
10378
10424
  import { existsSync as existsSync26 } from "fs";
10379
10425
  import { join as join37 } from "path";
@@ -10591,6 +10637,7 @@ dbCommand.command("seed [file]").description("Seed database with initial data").
10591
10637
  })
10592
10638
  );
10593
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 }));
10594
10641
 
10595
10642
  // src/commands/kv/index.ts
10596
10643
  import { Command as Command19 } from "commander";
@@ -12638,7 +12685,16 @@ var deleteCommand2 = new Command22("delete").description("Delete a project secre
12638
12685
  logger.newLine();
12639
12686
  process.exit(1);
12640
12687
  }
12641
- 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
+ }
12642
12698
  if (!options.force) {
12643
12699
  const confirmed = await confirm14({
12644
12700
  message: `Delete secret "${key}" from "${game.slug}" in ${environment}?`,
@@ -12702,7 +12758,16 @@ var listCommand2 = new Command23("list").description("List project secret keys")
12702
12758
  logger.newLine();
12703
12759
  process.exit(1);
12704
12760
  }
12705
- 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
+ }
12706
12771
  const keys = await runStep(
12707
12772
  `Fetching secrets from ${environment}`,
12708
12773
  () => client.dev.games.secrets.list(game.slug),
@@ -12742,7 +12807,16 @@ var setCommand = new Command24("set").description("Set or update a project secre
12742
12807
  logger.newLine();
12743
12808
  process.exit(1);
12744
12809
  }
12745
- 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
+ }
12746
12820
  await runStep(
12747
12821
  `Setting secret "${key}" in ${environment}`,
12748
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.29",
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.29",
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",
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",