playcademy 0.17.4 → 0.18.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.
package/dist/bin.js ADDED
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/bin.ts
4
+ import { spawnSync } from "node:child_process";
5
+ import { existsSync } from "node:fs";
6
+ import { homedir as homedir2 } from "node:os";
7
+ import { delimiter, join as join2 } from "node:path";
8
+ import { green, red } from "colorette";
9
+
10
+ // src/constants/paths.ts
11
+ import { homedir } from "node:os";
12
+ import { join } from "node:path";
13
+ var WORKSPACE_NAME = ".playcademy";
14
+ var CLI_DIRECTORIES = {
15
+ WORKSPACE: WORKSPACE_NAME,
16
+ DATABASE: join(WORKSPACE_NAME, "db"),
17
+ KV: join(WORKSPACE_NAME, "kv"),
18
+ BUCKET: join(WORKSPACE_NAME, "bucket")
19
+ };
20
+ var PLAYCADEMY_HOME = join(homedir(), ".playcademy");
21
+ var CLI_USER_DIRECTORIES = {
22
+ CONFIG: PLAYCADEMY_HOME,
23
+ BIN: join(PLAYCADEMY_HOME, "bin"),
24
+ CACHE: join(PLAYCADEMY_HOME, "cache")
25
+ };
26
+ var CLI_DEFAULT_OUTPUTS = {
27
+ WORKER_BUNDLE: join(WORKSPACE_NAME, "worker-bundle.js")
28
+ };
29
+
30
+ // src/bin.ts
31
+ var exe = process.platform === "win32" ? "playcademy.exe" : "playcademy";
32
+ function findBinary() {
33
+ const knownDirs = [CLI_USER_DIRECTORIES.BIN, join2(homedir2(), ".local", "bin")];
34
+ for (const dir of knownDirs) {
35
+ const p = join2(dir, exe);
36
+ if (existsSync(p)) {
37
+ return p;
38
+ }
39
+ }
40
+ const nmBin = join2("node_modules", ".bin");
41
+ for (const dir of (process.env.PATH ?? "").split(delimiter)) {
42
+ if (dir && !dir.endsWith(nmBin)) {
43
+ const p = join2(dir, exe);
44
+ if (existsSync(p)) {
45
+ return p;
46
+ }
47
+ }
48
+ }
49
+ }
50
+ var binary = findBinary();
51
+ if (binary) {
52
+ const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
53
+ if (result.signal) {
54
+ process.kill(process.pid, result.signal);
55
+ }
56
+ process.exit(result.status ?? 1);
57
+ }
58
+ var args = process.argv.slice(2);
59
+ var command = args.length ? `playcademy ${args.join(" ")}` : "playcademy";
60
+ var g = red("\u2502");
61
+ console.error(
62
+ [
63
+ "",
64
+ g,
65
+ `${g} The playcademy npm package doesn't include the CLI.`,
66
+ g,
67
+ `${g} Install it separately:`,
68
+ g,
69
+ `${g} ${green("curl -fsSL https://playcademy.net/cli | bash")}`,
70
+ g,
71
+ `${g} Then re-run your command:`,
72
+ g,
73
+ `${g} ${green(command)}`,
74
+ g,
75
+ ""
76
+ ].join("\n")
77
+ );
78
+ process.exit(127);
package/dist/cli.js CHANGED
@@ -17,8 +17,8 @@ function getPackageVersionFromData(pkg, fallback = "0.0.0") {
17
17
  }
18
18
  function getPackageNameVersionFromData(pkg) {
19
19
  const name = getPackageNameFromData(pkg);
20
- const version2 = getPackageVersionFromData(pkg);
21
- return `${name}@${version2}`;
20
+ const version = getPackageVersionFromData(pkg);
21
+ return `${name}@${version}`;
22
22
  }
23
23
  function hasDependencyInData(pkg, packageName) {
24
24
  if (!pkg) {
@@ -56,15 +56,15 @@ import { readFile } from "fs/promises";
56
56
  import { dirname, parse, resolve } from "path";
57
57
  function findFilePath(filename, startDir, maxLevels = 3) {
58
58
  const filenames = Array.isArray(filename) ? filename : [filename];
59
- let currentDir2 = resolve(startDir);
59
+ let currentDir = resolve(startDir);
60
60
  let levelsSearched = 0;
61
61
  while (levelsSearched <= maxLevels) {
62
62
  for (const fname of filenames) {
63
- const filePath = resolve(currentDir2, fname);
63
+ const filePath = resolve(currentDir, fname);
64
64
  if (existsSync(filePath)) {
65
65
  return {
66
66
  path: filePath,
67
- dir: currentDir2,
67
+ dir: currentDir,
68
68
  filename: fname
69
69
  };
70
70
  }
@@ -72,15 +72,15 @@ function findFilePath(filename, startDir, maxLevels = 3) {
72
72
  if (levelsSearched >= maxLevels) {
73
73
  break;
74
74
  }
75
- const parentDir = dirname(currentDir2);
76
- if (parentDir === currentDir2) {
75
+ const parentDir = dirname(currentDir);
76
+ if (parentDir === currentDir) {
77
77
  break;
78
78
  }
79
- const parsed = parse(currentDir2);
80
- if (parsed.root === currentDir2) {
79
+ const parsed = parse(currentDir);
80
+ if (parsed.root === currentDir) {
81
81
  break;
82
82
  }
83
- currentDir2 = parentDir;
83
+ currentDir = parentDir;
84
84
  levelsSearched++;
85
85
  }
86
86
  return null;
@@ -248,11 +248,11 @@ function scanDirectory(dir, options = {}) {
248
248
  }
249
249
  throw new Error(`Directory not found: ${dir}`);
250
250
  }
251
- function scan(currentDir2, basePath = "") {
251
+ function scan(currentDir, basePath = "") {
252
252
  try {
253
- const entries = readdirSync(currentDir2);
253
+ const entries = readdirSync(currentDir);
254
254
  for (const entry of entries) {
255
- const fullPath = resolve(currentDir2, entry);
255
+ const fullPath = resolve(currentDir, entry);
256
256
  const relativePath = basePath ? `${basePath}/${entry}` : entry;
257
257
  const stat = statSync(fullPath);
258
258
  if (stat.isDirectory()) {
@@ -674,7 +674,7 @@ function setupGlobalErrorHandlers() {
674
674
  // src/lib/init/run.ts
675
675
  import { execSync as execSync5 } from "child_process";
676
676
  import { writeFileSync as writeFileSync10 } from "fs";
677
- import { resolve as resolve7 } from "path";
677
+ import { resolve as resolve8 } from "path";
678
678
  import { confirm as confirm5 } from "@inquirer/prompts";
679
679
 
680
680
  // ../utils/src/ansi.ts
@@ -1189,20 +1189,22 @@ var GODOT_BUILD_OUTPUTS = {
1189
1189
  };
1190
1190
 
1191
1191
  // src/constants/paths.ts
1192
- import { join as join6 } from "path";
1192
+ import { homedir } from "node:os";
1193
+ import { join as join6 } from "node:path";
1193
1194
  var WORKSPACE_NAME = ".playcademy";
1194
1195
  var CLI_DIRECTORIES = {
1195
- /** Root directory for CLI artifacts in workspace */
1196
1196
  WORKSPACE: WORKSPACE_NAME,
1197
- /** Database directory within workspace */
1198
1197
  DATABASE: join6(WORKSPACE_NAME, "db"),
1199
- /** KV storage directory within workspace */
1200
1198
  KV: join6(WORKSPACE_NAME, "kv"),
1201
- /** Bucket storage directory within workspace */
1202
1199
  BUCKET: join6(WORKSPACE_NAME, "bucket")
1203
1200
  };
1201
+ var PLAYCADEMY_HOME = join6(homedir(), ".playcademy");
1202
+ var CLI_USER_DIRECTORIES = {
1203
+ CONFIG: PLAYCADEMY_HOME,
1204
+ BIN: join6(PLAYCADEMY_HOME, "bin"),
1205
+ CACHE: join6(PLAYCADEMY_HOME, "cache")
1206
+ };
1204
1207
  var CLI_DEFAULT_OUTPUTS = {
1205
- /** Default worker bundle output for debug command */
1206
1208
  WORKER_BUNDLE: join6(WORKSPACE_NAME, "worker-bundle.js")
1207
1209
  };
1208
1210
 
@@ -1693,7 +1695,7 @@ var ConfigError = class extends Error {
1693
1695
  return msg;
1694
1696
  }
1695
1697
  };
1696
- async function findConfigPath(configPath) {
1698
+ async function findConfigPath(configPath, options) {
1697
1699
  const { findFile: findFile2 } = await Promise.resolve().then(() => (init_file_loader(), file_loader_exports));
1698
1700
  if (configPath) {
1699
1701
  const fullPath = resolve3(configPath);
@@ -1720,7 +1722,11 @@ async function findConfigPath(configPath) {
1720
1722
  }
1721
1723
  return result2.path;
1722
1724
  }
1723
- const result = await findFile2(CONFIG_FILE_NAMES, { searchUp: true, maxLevels: 3 });
1725
+ const result = await findFile2(CONFIG_FILE_NAMES, {
1726
+ searchUp: true,
1727
+ maxLevels: 3,
1728
+ cwd: options?.searchFrom ?? process.cwd()
1729
+ });
1724
1730
  if (!result) {
1725
1731
  throw new ConfigError(
1726
1732
  "No Playcademy config file found in this directory or any parent directory",
@@ -1737,13 +1743,13 @@ async function loadConfigFile(path2) {
1737
1743
  const module = await import(`${path2}?t=${Date.now()}`);
1738
1744
  return module.default || module;
1739
1745
  }
1740
- async function loadConfig(configPath) {
1741
- const result = await loadConfigWithPath(configPath);
1746
+ async function loadConfig(configPath, options) {
1747
+ const result = await loadConfigWithPath(configPath, options);
1742
1748
  return result.config;
1743
1749
  }
1744
- async function loadConfigWithPath(configPath) {
1750
+ async function loadConfigWithPath(configPath, options) {
1745
1751
  try {
1746
- const actualPath = configPath ? resolve3(configPath) : await findConfigPath();
1752
+ const actualPath = configPath ? resolve3(configPath) : await findConfigPath(void 0, options);
1747
1753
  const config = await loadConfigFile(actualPath);
1748
1754
  if (!config || typeof config !== "object") {
1749
1755
  throw new ConfigError(
@@ -2149,16 +2155,26 @@ var init_constants = __esm2(() => {
2149
2155
  init_constants();
2150
2156
 
2151
2157
  // src/lib/templates/loader.ts
2152
- import { existsSync as existsSync5, readFileSync } from "fs";
2153
- import { dirname as dirname3, resolve as resolve4 } from "path";
2154
- import { fileURLToPath } from "url";
2155
- var currentDir = dirname3(fileURLToPath(import.meta.url));
2158
+ import { existsSync as existsSync5, readFileSync } from "node:fs";
2159
+ import { dirname as dirname3, resolve as resolve4 } from "node:path";
2160
+ import { fileURLToPath } from "node:url";
2161
+
2162
+ // src/lib/templates/bundle.ts
2163
+ var TEMPLATE_BUNDLE = null;
2164
+
2165
+ // src/lib/templates/loader.ts
2156
2166
  function loadTemplateString(filename) {
2167
+ if (TEMPLATE_BUNDLE) {
2168
+ const content = TEMPLATE_BUNDLE[filename] ?? TEMPLATE_BUNDLE[`${filename}.template`];
2169
+ if (content != null) return content;
2170
+ throw new Error(
2171
+ `Template not found in bundle: ${filename}. Available: ${Object.keys(TEMPLATE_BUNDLE).join(", ")}`
2172
+ );
2173
+ }
2174
+ const currentDir = dirname3(fileURLToPath(import.meta.url));
2157
2175
  const filenamesToTry = filename.endsWith(".template") ? [filename] : [filename, `${filename}.template`];
2158
2176
  const candidatePaths = filenamesToTry.flatMap((name) => [
2159
- // Dev (TS sources): ../../templates from src/lib/templates
2160
2177
  resolve4(currentDir, "../../templates", name),
2161
- // Bundled build (single-file output): templates relative to dist root
2162
2178
  resolve4(currentDir, "templates", name)
2163
2179
  ]);
2164
2180
  for (const candidate of candidatePaths) {
@@ -2314,31 +2330,29 @@ function displaySuccessMessage(context2) {
2314
2330
  const pm = getPackageManager();
2315
2331
  const isVite = context2.engineType === "vite";
2316
2332
  const isGodot = context2.engineType === "godot";
2317
- nextSteps.push(`1. Review your config file: <${context2.configFileName}>`);
2333
+ function nextStepNum() {
2334
+ return nextSteps.length + 1;
2335
+ }
2336
+ nextSteps.push(`${nextStepNum()}. Review your config file: <${context2.configFileName}>`);
2318
2337
  if (context2.hasDatabase) {
2319
- nextSteps.push(`3. Review schema: <db/schema/index.ts>`);
2320
- nextSteps.push("4. Start dev server: `playcademy dev`");
2321
- nextSteps.push(`5. Push your schema: \`${getRunCommand(pm, "db:push")}\``);
2338
+ nextSteps.push(`${nextStepNum()}. Review schema: <db/schema/index.ts>`);
2339
+ nextSteps.push(`${nextStepNum()}. Start dev server: \`playcademy dev\``);
2340
+ nextSteps.push(`${nextStepNum()}. Push your schema: \`${getRunCommand(pm, "db:push")}\``);
2322
2341
  }
2323
2342
  if (context2.hasAuth) {
2324
- const stepNum = context2.hasDatabase ? "6" : "2";
2325
- nextSteps.push(`${stepNum}. Review auth config: <server/lib/auth.ts>`);
2343
+ nextSteps.push(`${nextStepNum()}. Review auth config: <server/lib/auth.ts>`);
2326
2344
  }
2327
2345
  if (isVite) {
2328
2346
  const buildExample = getRunCommand(pm, "build");
2329
- const buildStepNum = nextSteps.length + 1;
2330
- nextSteps.push(`${buildStepNum}. Build your app: \`${buildExample}\``);
2347
+ nextSteps.push(`${nextStepNum()}. Build your app: \`${buildExample}\``);
2331
2348
  }
2332
2349
  if (isGodot) {
2333
- const stepNum = nextSteps.length + 1;
2334
- nextSteps.push(`${stepNum}. Open in Godot Editor`);
2350
+ nextSteps.push(`${nextStepNum()}. Open in Godot Editor`);
2335
2351
  }
2336
2352
  if (context2.apiDirectory) {
2337
- const stepNum = nextSteps.length + 1;
2338
- nextSteps.push(`${stepNum}. Customize API routes: <${context2.apiDirectory}>`);
2353
+ nextSteps.push(`${nextStepNum()}. Customize API routes: <${context2.apiDirectory}>`);
2339
2354
  }
2340
- const deployStep = nextSteps.length + 1;
2341
- nextSteps.push(`${deployStep}. Deploy: \`playcademy deploy\``);
2355
+ nextSteps.push(`${nextStepNum()}. Deploy: \`playcademy deploy\``);
2342
2356
  nextSteps.push("");
2343
2357
  nextSteps.push(`Learn more: <<${DOCS_URL}>>`);
2344
2358
  logger.admonition("tip", "Next Steps", nextSteps);
@@ -2800,6 +2814,7 @@ async function promptForProjectDirectory(projectDir) {
2800
2814
  }
2801
2815
  const targetDir = resolve5(process.cwd(), dir);
2802
2816
  if (existsSync9(targetDir)) {
2817
+ logger.newLine();
2803
2818
  logger.admonition("warning", "Directory Exists", [`Directory "${dir}" already exists.`]);
2804
2819
  logger.newLine();
2805
2820
  const shouldContinue = await confirm2({
@@ -2953,7 +2968,8 @@ function updateEnvForAuth(workspace, strategies) {
2953
2968
  }
2954
2969
  async function scaffoldAuthSetup(options = {}) {
2955
2970
  const workspace = getWorkspace();
2956
- const { strategies = [], appName } = options;
2971
+ const { strategies = [], appName, silent } = options;
2972
+ const stepOptions = silent ? { silent: true } : void 0;
2957
2973
  let packagesUpdated = false;
2958
2974
  await runStep(
2959
2975
  "Configuring authentication...",
@@ -2963,14 +2979,15 @@ async function scaffoldAuthSetup(options = {}) {
2963
2979
  scaffoldAuthRoutes(workspace);
2964
2980
  scaffoldAuthSchema(workspace);
2965
2981
  scaffoldProtectedExample(workspace);
2966
- packagesUpdated = await setupPackageJson(workspace);
2982
+ packagesUpdated = await setupPackageJson(workspace, stepOptions);
2967
2983
  updateEnvForAuth(workspace, strategies);
2968
2984
  },
2969
- "Authentication configured"
2985
+ "Authentication configured",
2986
+ stepOptions
2970
2987
  );
2971
2988
  return packagesUpdated;
2972
2989
  }
2973
- async function setupPackageJson(workspace) {
2990
+ async function setupPackageJson(workspace, stepOptions) {
2974
2991
  const pkgPath = join12(workspace, "package.json");
2975
2992
  const authDeps = {
2976
2993
  "@playcademy/better-auth": PLAYCADEMY_AUTH_VERSION,
@@ -2985,7 +3002,8 @@ async function setupPackageJson(workspace) {
2985
3002
  writeFileSync5(pkgPath, `${JSON.stringify(existing, null, 2)}
2986
3003
  `);
2987
3004
  },
2988
- "Updated package.json deps"
3005
+ "Updated package.json deps",
3006
+ stepOptions
2989
3007
  );
2990
3008
  return true;
2991
3009
  }
@@ -2993,99 +3011,11 @@ async function setupPackageJson(workspace) {
2993
3011
  }
2994
3012
 
2995
3013
  // src/lib/init/database.ts
2996
- import { existsSync as existsSync11, mkdirSync as mkdirSync5, readFileSync as readFileSync6, writeFileSync as writeFileSync6 } from "fs";
2997
- import { join as join13 } from "path";
2998
-
2999
- // package.json with { type: 'json' }
3000
- var package_default2 = {
3001
- name: "playcademy",
3002
- version: "0.17.3",
3003
- type: "module",
3004
- exports: {
3005
- ".": {
3006
- types: "./dist/index.d.ts",
3007
- import: "./dist/index.js",
3008
- require: "./dist/index.js"
3009
- },
3010
- "./cli": {
3011
- types: "./dist/cli.d.ts",
3012
- import: "./dist/cli.js",
3013
- require: "./dist/cli.js"
3014
- },
3015
- "./db": {
3016
- types: "./dist/db.d.ts",
3017
- import: "./dist/db.js",
3018
- require: "./dist/db.js"
3019
- },
3020
- "./utils": {
3021
- types: "./dist/utils.d.ts",
3022
- import: "./dist/utils.js"
3023
- },
3024
- "./constants": {
3025
- types: "./dist/constants.d.ts",
3026
- import: "./dist/constants.js"
3027
- },
3028
- "./types": {
3029
- types: "./dist/index.d.ts"
3030
- },
3031
- "./version": {
3032
- types: "./dist/version.d.ts",
3033
- import: "./dist/version.js"
3034
- }
3035
- },
3036
- main: "./dist/index.js",
3037
- module: "./dist/index.js",
3038
- bin: {
3039
- playcademy: "./dist/index.js"
3040
- },
3041
- files: [
3042
- "dist"
3043
- ],
3044
- scripts: {
3045
- build: "bun build.ts",
3046
- dev: "PLAYCADEMY_BASE_URL=http://localhost:5174 bun src/index.ts",
3047
- pub: "bun publish.ts"
3048
- },
3049
- dependencies: {
3050
- "@inquirer/prompts": "^7.8.6",
3051
- "@playcademy/sdk": "workspace:*",
3052
- chokidar: "^4.0.3",
3053
- colorette: "^2.0.20",
3054
- commander: "^14.0.1",
3055
- dedent: "^1.6.0",
3056
- "drizzle-kit": "^0.31.5",
3057
- "drizzle-orm": "^0.44.6",
3058
- esbuild: "^0.25.10",
3059
- giget: "^2.0.0",
3060
- hono: "^4.9.9",
3061
- "json-colorizer": "^3.0.1",
3062
- jszip: "^3.10.1",
3063
- miniflare: "^4.20251008.0",
3064
- open: "^10.2.0",
3065
- ws: "^8.18.3"
3066
- },
3067
- devDependencies: {
3068
- "@cloudflare/workers-types": "^4.20251011.0",
3069
- "@inquirer/core": "^10.3.0",
3070
- "@playcademy/constants": "workspace:*",
3071
- "@playcademy/data": "workspace:*",
3072
- "@playcademy/edge-play": "workspace:*",
3073
- "@playcademy/timeback": "workspace:*",
3074
- "@playcademy/types": "workspace:*",
3075
- "@playcademy/utils": "workspace:*",
3076
- "@types/bun": "latest",
3077
- "@types/ws": "^8.18.1",
3078
- bumpp: "^10.2.3",
3079
- rollup: "^4.50.2",
3080
- "rollup-plugin-dts": "^6.2.3"
3081
- },
3082
- peerDependencies: {
3083
- typescript: "^5"
3084
- }
3085
- };
3014
+ import { existsSync as existsSync11, mkdirSync as mkdirSync5, readFileSync as readFileSync6, writeFileSync as writeFileSync6 } from "node:fs";
3015
+ import { join as join13 } from "node:path";
3086
3016
 
3087
3017
  // src/version.ts
3088
- var version = package_default2.version;
3018
+ var cliVersion = false ? "0.0.0-dev" : "0.18.0";
3089
3019
 
3090
3020
  // src/lib/init/database.ts
3091
3021
  var drizzleConfigTemplate = loadTemplateString("database/drizzle-config.ts");
@@ -3097,6 +3027,7 @@ var dbSeedTemplate = loadTemplateString("database/db-seed.ts");
3097
3027
  var packageTemplate = loadTemplateString("database/package.json");
3098
3028
  async function scaffoldDatabaseSetup(options) {
3099
3029
  const workspace = getWorkspace();
3030
+ const stepOptions = options.silent ? { silent: true } : void 0;
3100
3031
  let packagesUpdated = false;
3101
3032
  await runStep(
3102
3033
  "Configuring database...",
@@ -3121,20 +3052,22 @@ async function scaffoldDatabaseSetup(options) {
3121
3052
  writeFileSync6(dbSeedPath, dbSeedTemplate);
3122
3053
  const drizzleConfigPath = join13(workspace, DRIZZLE_CONFIG_FILES[0]);
3123
3054
  writeFileSync6(drizzleConfigPath, drizzleConfigTemplate);
3124
- packagesUpdated = await setupPackageJson2(workspace, options.appName);
3055
+ packagesUpdated = await setupPackageJson2(workspace, options.appName, stepOptions);
3125
3056
  },
3126
- "Database configured"
3057
+ "Database configured",
3058
+ stepOptions
3127
3059
  );
3128
3060
  return packagesUpdated;
3129
3061
  }
3130
- async function setupPackageJson2(workspace, appName) {
3062
+ async function setupPackageJson2(workspace, appName, stepOptions) {
3131
3063
  const pkgPath = join13(workspace, "package.json");
3132
3064
  const dbDeps = {
3133
3065
  "drizzle-orm": "^0.42.0",
3134
3066
  "better-sqlite3": "^12.0.0"
3135
3067
  };
3068
+ const playcademyDevDepRange = cliVersion === "0.0.0-dev" ? "latest" : `^${cliVersion}`;
3136
3069
  const dbDevDeps = {
3137
- playcademy: `^${version}`,
3070
+ playcademy: playcademyDevDepRange,
3138
3071
  "drizzle-kit": "^0.30.0",
3139
3072
  "@types/better-sqlite3": "^7.6.0",
3140
3073
  tsx: "^4.20.6"
@@ -3158,12 +3091,13 @@ async function setupPackageJson2(workspace, appName) {
3158
3091
  writeFileSync6(pkgPath, `${JSON.stringify(existing, null, 2)}
3159
3092
  `);
3160
3093
  },
3161
- "Updated package.json deps"
3094
+ "Updated package.json deps",
3095
+ stepOptions
3162
3096
  );
3163
3097
  return true;
3164
3098
  } else {
3165
3099
  const slugifiedName = generateSlug(appName);
3166
- const packageContent = packageTemplate.replace("{{APP_NAME}}", slugifiedName).replace("{{PLAYCADEMY_VERSION}}", version);
3100
+ const packageContent = packageTemplate.replace("{{APP_NAME}}", slugifiedName).replace("^{{PLAYCADEMY_VERSION}}", playcademyDevDepRange);
3167
3101
  writeFileSync6(pkgPath, packageContent);
3168
3102
  logger.success("Created package.json");
3169
3103
  return true;
@@ -3210,7 +3144,7 @@ function ensurePlaycademyGitignore() {
3210
3144
  writeFileSync7(gitignorePath, playcademyGitignoreTemplate);
3211
3145
  }
3212
3146
  async function scaffoldIntegrations(appName, options) {
3213
- const { customRoutes, database, auth, kv, bucket } = options;
3147
+ const { customRoutes, database, auth, kv, bucket, silent } = options;
3214
3148
  let depsAdded = false;
3215
3149
  ensurePlaycademyGitignore();
3216
3150
  if (customRoutes) {
@@ -3236,13 +3170,13 @@ async function scaffoldIntegrations(appName, options) {
3236
3170
  await scaffoldApiDirectory(customRoutes.directory, sampleRoutes);
3237
3171
  }
3238
3172
  if (database) {
3239
- const dbDepsAdded = await scaffoldDatabaseSetup({ appName });
3173
+ const dbDepsAdded = await scaffoldDatabaseSetup({ appName, silent });
3240
3174
  if (dbDepsAdded) {
3241
3175
  depsAdded = true;
3242
3176
  }
3243
3177
  }
3244
3178
  if (auth) {
3245
- const authDepsAdded = await scaffoldAuthSetup({ ...auth, appName });
3179
+ const authDepsAdded = await scaffoldAuthSetup({ ...auth, appName, silent });
3246
3180
  if (authDepsAdded) {
3247
3181
  depsAdded = true;
3248
3182
  }
@@ -3476,11 +3410,10 @@ async function selectConfigFormat(hasPackageJson2) {
3476
3410
  }
3477
3411
 
3478
3412
  // src/lib/init/types.ts
3479
- init_file_loader();
3480
- import { execSync as execSync4 } from "child_process";
3481
- import { existsSync as existsSync15, writeFileSync as writeFileSync9 } from "fs";
3482
- import { dirname as dirname5, join as join17 } from "path";
3483
- import { fileURLToPath as fileURLToPath2 } from "url";
3413
+ import { execSync as execSync4 } from "node:child_process";
3414
+ import { existsSync as existsSync15, readFileSync as readFileSync9, writeFileSync as writeFileSync9 } from "node:fs";
3415
+ import { dirname as dirname5, join as join17, resolve as resolve7 } from "node:path";
3416
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
3484
3417
 
3485
3418
  // src/lib/deploy/backend.ts
3486
3419
  import { existsSync as existsSync13 } from "node:fs";
@@ -3638,13 +3571,31 @@ function detectBackendFeatures(workspace, config) {
3638
3571
  function hasAnyBackend(features) {
3639
3572
  return Object.values(features).some(Boolean);
3640
3573
  }
3574
+ function getDepVersions() {
3575
+ if (true) {
3576
+ return { honoVersion: "^4.9.9", workersTypesVersion: "^4.20251011.0" };
3577
+ }
3578
+ try {
3579
+ const pkgPath = resolve7(
3580
+ dirname5(fileURLToPath2(import.meta.url)),
3581
+ "..",
3582
+ "..",
3583
+ "..",
3584
+ "package.json"
3585
+ );
3586
+ const pkg = JSON.parse(readFileSync9(pkgPath, "utf8"));
3587
+ return {
3588
+ honoVersion: pkg.dependencies?.hono ?? "latest",
3589
+ workersTypesVersion: pkg.devDependencies?.["@cloudflare/workers-types"] ?? "latest"
3590
+ };
3591
+ } catch {
3592
+ return { honoVersion: "latest", workersTypesVersion: "latest" };
3593
+ }
3594
+ }
3641
3595
  async function setupPlaycademyDependencies(workspace) {
3642
3596
  const playcademyDir = join17(workspace, CLI_DIRECTORIES.WORKSPACE);
3643
3597
  const playcademyPkgPath = join17(playcademyDir, "package.json");
3644
- const __dirname = dirname5(fileURLToPath2(import.meta.url));
3645
- const cliPkg = await loadPackageJson({ cwd: __dirname, searchUp: true, required: true });
3646
- const workersTypesVersion = cliPkg?.devDependencies?.["@cloudflare/workers-types"] || "latest";
3647
- const honoVersion = cliPkg?.dependencies?.hono || "latest";
3598
+ const { honoVersion, workersTypesVersion } = getDepVersions();
3648
3599
  const playcademyPkg = {
3649
3600
  private: true,
3650
3601
  dependencies: { hono: honoVersion },
@@ -3807,7 +3758,10 @@ async function setupProjectFiles(dirInfo, engineSelection, projectName, integrat
3807
3758
  }
3808
3759
  }
3809
3760
  if (integrationOptions.customRoutes || integrationOptions.database || integrationOptions.auth) {
3810
- const scaffoldDepsAdded = await scaffoldIntegrations(projectName, integrationOptions);
3761
+ const scaffoldDepsAdded = await scaffoldIntegrations(projectName, {
3762
+ ...integrationOptions,
3763
+ silent: true
3764
+ });
3811
3765
  if (scaffoldDepsAdded) {
3812
3766
  depsAdded = true;
3813
3767
  }
@@ -3918,7 +3872,7 @@ async function runInit(options = {}) {
3918
3872
  timebackCourses: timebackConfig ?? void 0
3919
3873
  };
3920
3874
  const configContent = configFormat === "js" ? generateJsConfig(configOptions) : generateJsonConfig(configOptions);
3921
- const configPath = resolve7(getWorkspace(), configFileName);
3875
+ const configPath = resolve8(getWorkspace(), configFileName);
3922
3876
  writeFileSync10(configPath, configContent, "utf8");
3923
3877
  await formatConfigWithPrettier(configPath);
3924
3878
  if (database || auth || kv || bucket) {
@@ -274,42 +274,25 @@ declare const SSO_AUTH_TIMEOUT_MS = 30000;
274
274
  * Path constants for CLI directories and files
275
275
  */
276
276
  declare const WORKSPACE_NAME = ".playcademy";
277
- /**
278
- * CLI workspace directories (local to project)
279
- */
280
277
  declare const CLI_DIRECTORIES: {
281
- /** Root directory for CLI artifacts in workspace */
282
278
  readonly WORKSPACE: ".playcademy";
283
- /** Database directory within workspace */
284
279
  readonly DATABASE: string;
285
- /** KV storage directory within workspace */
286
280
  readonly KV: string;
287
- /** Bucket storage directory within workspace */
288
281
  readonly BUCKET: string;
289
282
  };
290
- /**
291
- * CLI user directories (in home directory)
292
- */
293
283
  declare const CLI_USER_DIRECTORIES: {
294
- /** User config directory for auth, games store, etc. */
295
- readonly CONFIG: ".playcademy";
284
+ readonly CONFIG: string;
285
+ readonly BIN: string;
286
+ readonly CACHE: string;
296
287
  };
297
- /**
298
- * Default output paths
299
- */
288
+ declare function nativeBinaryPath(name: string): string;
289
+ declare function cacheVersionDir(version: string): string;
300
290
  declare const CLI_DEFAULT_OUTPUTS: {
301
- /** Default worker bundle output for debug command */
302
291
  readonly WORKER_BUNDLE: string;
303
292
  };
304
- /**
305
- * CLI file names
306
- */
307
293
  declare const CLI_FILES: {
308
- /** Auth store file in user config directory */
309
294
  readonly AUTH_STORE: "auth.json";
310
- /** Games deployment info store */
311
295
  readonly GAMES_STORE: "games.json";
312
- /** Initial database file (before miniflare) */
313
296
  readonly INITIAL_DATABASE: "initial.sqlite";
314
297
  };
315
298
 
@@ -357,4 +340,4 @@ declare const CONFIG_FILE_NAMES: string[];
357
340
  */
358
341
  declare const DOCS_URL = "https://docs.dev.playcademy.net/platform";
359
342
 
360
- export { AUTH_API_SUBDIRECTORY, AUTH_CONFIG_FILE, AUTH_PROVIDER_NAMES, BETTER_AUTH_VERSION, BUCKET_ALWAYS_SKIP, CALLBACK_PATH, CALLBACK_PORT, CLI_DEFAULT_OUTPUTS, CLI_DIRECTORIES, CLI_FILES, CLI_USER_DIRECTORIES, CLOUDFLARE_BINDINGS, CLOUDFLARE_COMPATIBILITY_DATE, CONFIG_FILE_NAMES, DB_FILES, DEFAULT_API_ROUTES_DIRECTORY, DEFAULT_DATABASE_DIRECTORY, DEFAULT_PORTS, DEFAULT_TEMPLATE_REF, DOCS_URL, DRIZZLE_CONFIG_FILES, ENV_EXAMPLE_FILE, ENV_FILES, GODOT_ADDON_URL, GODOT_BUILD_DIRECTORIES, GODOT_BUILD_OUTPUTS, GODOT_EXECUTABLE_PATTERNS, GODOT_EXPORT_PRESETS_FILE, GODOT_PROJECT_FILE, GODOT_WEB_PLATFORM, MINIFLARE_D1_DIRECTORY, OAUTH_CALLBACK_URL_PATTERN, PLACEHOLDER_APP_URL, PLAYCADEMY_AUTH_VERSION, PUBLIC_DIRECTORY, QUEUE_NAME_PREFIX, SAMPLE_API_SUBDIRECTORY, SAMPLE_BUCKET_FILENAME, SAMPLE_CUSTOM_FILENAME, SAMPLE_DATABASE_FILENAME, SAMPLE_KV_FILENAME, SCHEMA_SUBDIRECTORY, SELF_WORKER_NAME_BINDING, SERVER_LIB_DIRECTORY, SERVER_ROOT_DIRECTORY, SSO_AUTH_TIMEOUT_MS, TEMPLATE_RENAME_FILES, TEMPLATE_REPOS, TSCONFIG_APP_JSON, TSCONFIG_FILES, TSCONFIG_JSON, TSCONFIG_REQUIRED_INCLUDES, WORKSPACE_NAME };
343
+ export { AUTH_API_SUBDIRECTORY, AUTH_CONFIG_FILE, AUTH_PROVIDER_NAMES, BETTER_AUTH_VERSION, BUCKET_ALWAYS_SKIP, CALLBACK_PATH, CALLBACK_PORT, CLI_DEFAULT_OUTPUTS, CLI_DIRECTORIES, CLI_FILES, CLI_USER_DIRECTORIES, CLOUDFLARE_BINDINGS, CLOUDFLARE_COMPATIBILITY_DATE, CONFIG_FILE_NAMES, DB_FILES, DEFAULT_API_ROUTES_DIRECTORY, DEFAULT_DATABASE_DIRECTORY, DEFAULT_PORTS, DEFAULT_TEMPLATE_REF, DOCS_URL, DRIZZLE_CONFIG_FILES, ENV_EXAMPLE_FILE, ENV_FILES, GODOT_ADDON_URL, GODOT_BUILD_DIRECTORIES, GODOT_BUILD_OUTPUTS, GODOT_EXECUTABLE_PATTERNS, GODOT_EXPORT_PRESETS_FILE, GODOT_PROJECT_FILE, GODOT_WEB_PLATFORM, MINIFLARE_D1_DIRECTORY, OAUTH_CALLBACK_URL_PATTERN, PLACEHOLDER_APP_URL, PLAYCADEMY_AUTH_VERSION, PUBLIC_DIRECTORY, QUEUE_NAME_PREFIX, SAMPLE_API_SUBDIRECTORY, SAMPLE_BUCKET_FILENAME, SAMPLE_CUSTOM_FILENAME, SAMPLE_DATABASE_FILENAME, SAMPLE_KV_FILENAME, SCHEMA_SUBDIRECTORY, SELF_WORKER_NAME_BINDING, SERVER_LIB_DIRECTORY, SERVER_ROOT_DIRECTORY, SSO_AUTH_TIMEOUT_MS, TEMPLATE_RENAME_FILES, TEMPLATE_REPOS, TSCONFIG_APP_JSON, TSCONFIG_FILES, TSCONFIG_JSON, TSCONFIG_REQUIRED_INCLUDES, WORKSPACE_NAME, cacheVersionDir, nativeBinaryPath };