playcademy 0.14.0 → 0.14.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/db.js CHANGED
@@ -21,7 +21,6 @@ var init_file_loader = __esm({
21
21
  // src/lib/db/path.ts
22
22
  import { copyFileSync, existsSync, mkdirSync, readdirSync, unlinkSync } from "fs";
23
23
  import { join as join2 } from "path";
24
- import Database from "better-sqlite3";
25
24
 
26
25
  // src/constants/config.ts
27
26
  var ENV_FILES = [
@@ -108,10 +107,6 @@ var ensureDirectoryExists = (dir) => {
108
107
  mkdirSync(dir, { recursive: true });
109
108
  }
110
109
  };
111
- var createEmptyDatabase = (path) => {
112
- const db = new Database(path);
113
- db.close();
114
- };
115
110
  var findMiniflareDatabase = (dbDir) => {
116
111
  const miniflareDir = join2(dbDir, MINIFLARE_D1_DIRECTORY);
117
112
  if (!existsSync(miniflareDir)) return null;
@@ -132,9 +127,6 @@ function getDevDbPath() {
132
127
  migrateInitialDbToTarget(initialDbPath, miniflareDbPath);
133
128
  return miniflareDbPath;
134
129
  }
135
- if (!existsSync(initialDbPath)) {
136
- createEmptyDatabase(initialDbPath);
137
- }
138
130
  return initialDbPath;
139
131
  }
140
132
 
package/dist/index.js CHANGED
@@ -4882,7 +4882,6 @@ init_core();
4882
4882
  init_constants2();
4883
4883
  import { copyFileSync, existsSync as existsSync6, mkdirSync, readdirSync as readdirSync3, unlinkSync } from "fs";
4884
4884
  import { join as join7 } from "path";
4885
- import Database from "better-sqlite3";
4886
4885
  var DB_DIRECTORY = CLI_DIRECTORIES.DATABASE;
4887
4886
  var INITIAL_DB_NAME = CLI_FILES.INITIAL_DATABASE;
4888
4887
  var ensureDirectoryExists = (dir) => {
@@ -4890,10 +4889,6 @@ var ensureDirectoryExists = (dir) => {
4890
4889
  mkdirSync(dir, { recursive: true });
4891
4890
  }
4892
4891
  };
4893
- var createEmptyDatabase = (path2) => {
4894
- const db = new Database(path2);
4895
- db.close();
4896
- };
4897
4892
  var findMiniflareDatabase = (dbDir) => {
4898
4893
  const miniflareDir = join7(dbDir, MINIFLARE_D1_DIRECTORY);
4899
4894
  if (!existsSync6(miniflareDir)) return null;
@@ -4914,9 +4909,6 @@ function getDevDbPath() {
4914
4909
  migrateInitialDbToTarget(initialDbPath, miniflareDbPath);
4915
4910
  return miniflareDbPath;
4916
4911
  }
4917
- if (!existsSync6(initialDbPath)) {
4918
- createEmptyDatabase(initialDbPath);
4919
- }
4920
4912
  return initialDbPath;
4921
4913
  }
4922
4914
 
@@ -5108,9 +5100,11 @@ async function setupPackageJson(workspace, gameName) {
5108
5100
  };
5109
5101
  const dbScripts = {
5110
5102
  "db:generate": "drizzle-kit generate",
5103
+ "db:migrate": "drizzle-kit migrate",
5111
5104
  "db:push": "drizzle-kit push",
5112
5105
  "db:studio": "drizzle-kit studio",
5113
- "db:seed": "playcademy db seed"
5106
+ "db:seed": "playcademy db seed",
5107
+ "db:reset": "playcademy db reset"
5114
5108
  };
5115
5109
  if (existsSync7(pkgPath)) {
5116
5110
  await runStep(
@@ -7318,7 +7312,7 @@ function reportDeploymentSuccess(result, context2) {
7318
7312
  logger.success(`${game.displayName} ${action} successfully!`);
7319
7313
  logger.newLine();
7320
7314
  const baseUrl = getWebBaseUrl(client.getBaseUrl());
7321
- logger.data("Game URL", underline(`${baseUrl}/g/${game.slug}`), 1);
7315
+ logger.data("Game URL", underline(`${baseUrl}/play/${game.slug}`), 1);
7322
7316
  if (backendDeployment || previousCustomRoutesHash) {
7323
7317
  const env = getEnvironment();
7324
7318
  const subdomain = env === "staging" ? `${game.slug}-staging` : game.slug;
@@ -9650,7 +9644,6 @@ async function runDevServer(options) {
9650
9644
  const serverRef = { current: null };
9651
9645
  setupCleanupHandlers(workspace, () => serverRef.current);
9652
9646
  try {
9653
- logger.newLine();
9654
9647
  const config = await loadConfig();
9655
9648
  const hasIntegrations = !!config.integrations;
9656
9649
  const hasRoutes = hasCustomRoutes(config);
@@ -9972,7 +9965,6 @@ async function runDbResetLocal(options) {
9972
9965
  logger.newLine();
9973
9966
  return;
9974
9967
  }
9975
- logger.newLine();
9976
9968
  if (isServerRunning("backend", workspace)) {
9977
9969
  logger.admonition("warning", "Stop Dev Server First", [
9978
9970
  "The development server must be stopped before resetting the database.",
@@ -9981,15 +9973,18 @@ async function runDbResetLocal(options) {
9981
9973
  logger.newLine();
9982
9974
  process.exit(1);
9983
9975
  }
9984
- const shouldReset = await confirm6({
9985
- message: "This will delete all local database data. Continue?",
9986
- default: false
9987
- });
9988
- if (!shouldReset) {
9989
- logger.newLine();
9990
- logger.remark("Nothing to do");
9976
+ if (!options.force) {
9991
9977
  logger.newLine();
9992
- return;
9978
+ const shouldReset = await confirm6({
9979
+ message: "This will delete all local database data. Continue?",
9980
+ default: false
9981
+ });
9982
+ if (!shouldReset) {
9983
+ logger.newLine();
9984
+ logger.remark("Nothing to do");
9985
+ logger.newLine();
9986
+ return;
9987
+ }
9993
9988
  }
9994
9989
  if (!hasDatabaseSetup()) {
9995
9990
  logger.remark("No drizzle config found, skipping schema setup");
@@ -10195,8 +10190,13 @@ async function runDbSeed(options = {}) {
10195
10190
  // src/commands/db/index.ts
10196
10191
  var dbCommand = new Command14("db").description("Database management commands");
10197
10192
  dbCommand.command("init").description("Add database to your project").action(runDbInit);
10198
- dbCommand.command("reset").description("Reset database").option("--remote", "Reset remote deployed database").option("--env <environment>", "Environment: staging (default) or production").option("--debug", "Enable debug mode").action(
10199
- (options) => runDbReset({ debug: options.debug, remote: options.remote, env: options.env })
10193
+ dbCommand.command("reset").description("Reset database").option("--remote", "Reset remote deployed database").option("--env <environment>", "Environment: staging (default) or production").option("-f, --force", "Skip confirmation prompt (local only)").option("--debug", "Enable debug mode").action(
10194
+ (options) => runDbReset({
10195
+ debug: options.debug,
10196
+ remote: options.remote,
10197
+ env: options.env,
10198
+ force: options.force
10199
+ })
10200
10200
  );
10201
10201
  dbCommand.command("seed [file]").description("Seed database with initial data").option("--no-reset", "Skip database reset before seeding").option("--remote", "Seed remote deployed database").option("--debug", "Enable debug mode").option("--env <environment>", "Environment: staging (default) or production").action(
10202
10202
  (file, options) => runDbSeed({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playcademy",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "type": "module",
5
5
  "module": "./dist/index.js",
6
6
  "main": "./dist/index.js",
@@ -41,7 +41,6 @@
41
41
  "dependencies": {
42
42
  "@inquirer/prompts": "^7.8.6",
43
43
  "@playcademy/sdk": "0.1.12",
44
- "better-sqlite3": "^12.4.1",
45
44
  "chokidar": "^4.0.3",
46
45
  "colorette": "^2.0.20",
47
46
  "commander": "^14.0.1",
@@ -61,7 +60,6 @@
61
60
  "@playcademy/edge-play": "0.0.0",
62
61
  "@playcademy/timeback": "0.0.1",
63
62
  "@playcademy/utils": "0.0.1",
64
- "@types/better-sqlite3": "^7.6.13",
65
63
  "@types/bun": "latest",
66
64
  "bumpp": "^10.2.3",
67
65
  "rollup": "^4.50.2",