@zaisma/cli 0.26.0 → 0.28.0

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/package.json +1 -1
  2. package/zaisma.mjs +5 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaisma/cli",
3
- "version": "0.26.0",
3
+ "version": "0.28.0",
4
4
  "description": "Upload and publish browser games on Zaisma from the command line.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://zaisma.com",
package/zaisma.mjs CHANGED
@@ -1465,7 +1465,7 @@ async function exportDatabase({ slug, file }) {
1465
1465
  if (partCount > 1 && file && !isJson) process.stdout.write("\n");
1466
1466
  if (isJson) return printJson({ dump_sql: file ? null : dumpParts.join(""), file: file ?? null, part_count: partCount, read_row_count: readRowCount });
1467
1467
  if (!file) return process.stdout.write(dumpParts.join(""));
1468
- console.log(`Saved ${slug}'s database to ${file} (${partCount} part${partCount === 1 ? "" : "s"}, ${readRowCount.toLocaleString("en-US")} rows read).${sqlite ? ` Run your game server on it with: node bin/node.js <server> --game ${slug} --database ${file}` : ""}`);
1468
+ console.log(`Saved ${slug}'s database to ${file} (${partCount} part${partCount === 1 ? "" : "s"}, ${readRowCount.toLocaleString("en-US")} rows read).${sqlite ? ` Run your game server on it with: npx @zaisma/game-server <server.ts> --game ${slug} --database-file ${file}` : ""}`);
1469
1469
  }
1470
1470
 
1471
1471
  /** The biggest database.sql export turns into a .sqlite file itself; past it, sqlite3 does it (Node's text tops out near this). */
@@ -1473,7 +1473,7 @@ const MAXIMUM_SQLITE_DUMP_SIZE_BYTES = 400 * 1024 * 1024;
1473
1473
 
1474
1474
  /**
1475
1475
  * export: the .zip of everything about a game (GET …/export/download), downloaded and saved as a folder,
1476
- * with database.sql also made into database.sqlite, ready for the Node runner's --database.
1476
+ * with database.sql also made into database.sqlite, ready for the Node runner's --database-file.
1477
1477
  */
1478
1478
  async function exportGame({ slug }, flags) {
1479
1479
  const folder = flags.folder ?? `${slug}-export`;
@@ -1527,7 +1527,7 @@ async function exportGame({ slug }, flags) {
1527
1527
  return EXIT_CODES.done;
1528
1528
  }
1529
1529
  console.log(`Saved everything about ${slug} in ${folder}: ${entries.length.toLocaleString("en-US")} files, ${(sizeBytes / 1024 / 1024).toFixed(1)} MB. README.txt says what's where.`);
1530
- if (databaseFile) console.log(`Run your game server on its database with: node bin/node.js <server> --game ${slug} --database ${databaseFile}`);
1530
+ if (databaseFile) console.log(`Run your game server on its database with: npx @zaisma/game-server <server.ts> --game ${slug} --database-file ${databaseFile}`);
1531
1531
  else if (dumpSizeBytes) console.log(`Make its database a .sqlite file with: sqlite3 ${join(folder, "database.sqlite")} < ${dumpFile}`);
1532
1532
  return EXIT_CODES.done;
1533
1533
  } finally {
@@ -1989,7 +1989,7 @@ async function saves(command, values, flags) {
1989
1989
  const answer = await api("GET", `/games/${values.slug}/saves${flags.cursor ? `?cursor=${encodeURIComponent(flags.cursor)}` : ""}`);
1990
1990
  if (isJson) return printJson(answer);
1991
1991
  if (!answer.saves.length) console.log("No saves yet. Players' progress shows up here once they play signed in with cloud saves on.");
1992
- for (const save of answer.saves) console.log(`${save.player_id} ${save.updated_at.slice(0, 16).replace("T", " ")} ${sizeText(save.size_bytes).padStart(8)} ${save.changed_by_kind === "developer" ? "changed by you" : "saved by the game"}${save.save_copy_count ? `, ${save.save_copy_count} earlier` : ""}`);
1992
+ for (const save of answer.saves) console.log(`${save.player_id} ${save.saved_at.slice(0, 16).replace("T", " ")} ${sizeText(save.size_bytes).padStart(8)} ${save.changed_by_kind === "developer" ? "changed by you" : "saved by the game"}${save.save_copy_count ? `, ${save.save_copy_count} earlier` : ""}`);
1993
1993
  if (answer.next_cursor) console.log(`\nMore: zaisma saves ${values.slug} --cursor ${answer.next_cursor}`);
1994
1994
  return;
1995
1995
  }
@@ -1999,7 +1999,7 @@ async function saves(command, values, flags) {
1999
1999
  const answer = await api("GET", command === "saves get" ? `${savePath()}${query}` : `${savePath()}/copies/${encodeURIComponent(values.save_copy_id)}${query}`);
2000
2000
  if (isJson) return printJson(answer);
2001
2001
  const save = answer.save ?? answer.save_copy;
2002
- console.log(answer.save ? `${sizeText(save.size_bytes)}, ${save.changed_by_kind === "developer" ? "changed by you" : "saved by the game"} ${when(save.updated_at)}.` : `Saved ${when(save.saved_at)} (${save.copy_reason})${save.is_current_save ? ", the same as the save now" : ""}.`);
2002
+ console.log(answer.save ? `${sizeText(save.size_bytes)}, ${save.changed_by_kind === "developer" ? "changed by you" : "saved by the game"} ${when(save.saved_at)}.` : `Saved ${when(save.saved_at)} (${save.copy_reason})${save.is_current_save ? ", the same as the save now" : ""}.`);
2003
2003
  for (const [key, itemText] of Object.entries(save.local_storage_items)) console.log(`${key} = ${itemText}`);
2004
2004
  for (const key of save.missing_keys) console.log(`${key}: not in the save`);
2005
2005
  if (save.indexeddb_databases?.length) console.log(`IndexedDB: ${save.indexeddb_databases.map((database) => database.name).join(", ")} (--json shows them)`);