playcademy 0.14.30-alpha.1 → 0.14.30-alpha.2

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.
Files changed (2) hide show
  1. package/dist/index.js +24 -34
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1421,9 +1421,16 @@ function getErrorMessage(error) {
1421
1421
  }
1422
1422
  function logAndExit(error, options = {}) {
1423
1423
  const { code = 1, prefix } = options;
1424
- const message = getErrorMessage(error);
1425
- const fullMessage = prefix ? `${prefix}: ${message}` : message;
1426
- logger.error(fullMessage);
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
+ }
1427
1434
  logger.newLine();
1428
1435
  process.exit(code);
1429
1436
  }
@@ -10417,7 +10424,17 @@ async function runDbSeedRemote(seedFile, options) {
10417
10424
  logger.newLine();
10418
10425
  process.exit(1);
10419
10426
  }
10420
- const game = await client.games.fetch(deployedGame.gameId);
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
+ }
10421
10438
  const willReset = options.reset !== false;
10422
10439
  logger.newLine();
10423
10440
  if (willReset) {
@@ -12638,16 +12655,7 @@ var deleteCommand2 = new Command22("delete").description("Delete a project secre
12638
12655
  logger.newLine();
12639
12656
  process.exit(1);
12640
12657
  }
12641
- const games2 = await client.games.list({ force: true });
12642
- const game = games2.find((g) => g.id === deployedGame.gameId);
12643
- if (!game) {
12644
- logger.admonition("warning", "Game Not Found", [
12645
- `Could not find game with ID \`${deployedGame.gameId}\``,
12646
- `Try redeploying your project: \`playcademy deploy\``
12647
- ]);
12648
- logger.newLine();
12649
- process.exit(1);
12650
- }
12658
+ const game = await client.games.fetch(deployedGame.gameId);
12651
12659
  if (!options.force) {
12652
12660
  const confirmed = await confirm14({
12653
12661
  message: `Delete secret "${key}" from "${game.slug}" in ${environment}?`,
@@ -12711,16 +12719,7 @@ var listCommand2 = new Command23("list").description("List project secret keys")
12711
12719
  logger.newLine();
12712
12720
  process.exit(1);
12713
12721
  }
12714
- const games2 = await client.games.list({ force: true });
12715
- const game = games2.find((g) => g.id === deployedGame.gameId);
12716
- if (!game) {
12717
- logger.admonition("warning", "Game Not Found", [
12718
- `Could not find game with ID \`${deployedGame.gameId}\``,
12719
- `Try redeploying your project: \`playcademy deploy\``
12720
- ]);
12721
- logger.newLine();
12722
- process.exit(1);
12723
- }
12722
+ const game = await client.games.fetch(deployedGame.gameId);
12724
12723
  const keys = await runStep(
12725
12724
  `Fetching secrets from ${environment}`,
12726
12725
  () => client.dev.games.secrets.list(game.slug),
@@ -12760,16 +12759,7 @@ var setCommand = new Command24("set").description("Set or update a project secre
12760
12759
  logger.newLine();
12761
12760
  process.exit(1);
12762
12761
  }
12763
- const games2 = await client.games.list({ force: true });
12764
- const game = games2.find((g) => g.id === deployedGame.gameId);
12765
- if (!game) {
12766
- logger.admonition("warning", "Game Not Found", [
12767
- `Could not find game with ID \`${deployedGame.gameId}\``,
12768
- `Try redeploying your project: \`playcademy deploy\``
12769
- ]);
12770
- logger.newLine();
12771
- process.exit(1);
12772
- }
12762
+ const game = await client.games.fetch(deployedGame.gameId);
12773
12763
  await runStep(
12774
12764
  `Setting secret "${key}" in ${environment}`,
12775
12765
  () => client.dev.games.secrets.set(game.slug, { [key]: value }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playcademy",
3
- "version": "0.14.30-alpha.1",
3
+ "version": "0.14.30-alpha.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {