playcademy 0.14.22 → 0.14.24

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.
@@ -118,6 +118,14 @@ declare const ENV_FILES: readonly [".env", ".env.development", ".env.local"];
118
118
  * Safe to commit to version control with placeholder values
119
119
  */
120
120
  declare const ENV_EXAMPLE_FILE = ".env.example";
121
+ /**
122
+ * Standard TypeScript config filename
123
+ */
124
+ declare const TSCONFIG_JSON = "tsconfig.json";
125
+ /**
126
+ * Vite/modern tooling TypeScript config filename
127
+ */
128
+ declare const TSCONFIG_APP_JSON = "tsconfig.app.json";
121
129
  /**
122
130
  * TypeScript config files to check (in priority order)
123
131
  *
@@ -126,6 +134,13 @@ declare const ENV_EXAMPLE_FILE = ".env.example";
126
134
  * 2. tsconfig.json ← Standard TypeScript config - fallback
127
135
  */
128
136
  declare const TSCONFIG_FILES: readonly ["tsconfig.app.json", "tsconfig.json"];
137
+ /**
138
+ * Entries that should be in the tsconfig include array for Playcademy projects
139
+ *
140
+ * - playcademy-env.d.ts: Type definitions generated by the CLI
141
+ * - server: Server-side TypeScript code directory
142
+ */
143
+ declare const TSCONFIG_REQUIRED_INCLUDES: readonly ["playcademy-env.d.ts", "server"];
129
144
 
130
145
  /**
131
146
  * Database-related constants
@@ -298,4 +313,4 @@ declare const PUBLIC_DIRECTORY = "public";
298
313
  */
299
314
  declare const CONFIG_FILE_NAMES: string[];
300
315
 
301
- 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, DRIZZLE_CONFIG_FILES, ENV_EXAMPLE_FILE, ENV_FILES, 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_GAME_URL, PLAYCADEMY_AUTH_VERSION, PUBLIC_DIRECTORY, SAMPLE_API_SUBDIRECTORY, SAMPLE_BUCKET_FILENAME, SAMPLE_CUSTOM_FILENAME, SAMPLE_DATABASE_FILENAME, SAMPLE_KV_FILENAME, SCHEMA_SUBDIRECTORY, SERVER_LIB_DIRECTORY, SERVER_ROOT_DIRECTORY, SSO_AUTH_TIMEOUT_MS, TSCONFIG_FILES, WORKSPACE_NAME };
316
+ 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, DRIZZLE_CONFIG_FILES, ENV_EXAMPLE_FILE, ENV_FILES, 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_GAME_URL, PLAYCADEMY_AUTH_VERSION, PUBLIC_DIRECTORY, SAMPLE_API_SUBDIRECTORY, SAMPLE_BUCKET_FILENAME, SAMPLE_CUSTOM_FILENAME, SAMPLE_DATABASE_FILENAME, SAMPLE_KV_FILENAME, SCHEMA_SUBDIRECTORY, SERVER_LIB_DIRECTORY, SERVER_ROOT_DIRECTORY, SSO_AUTH_TIMEOUT_MS, TSCONFIG_APP_JSON, TSCONFIG_FILES, TSCONFIG_JSON, TSCONFIG_REQUIRED_INCLUDES, WORKSPACE_NAME };
package/dist/constants.js CHANGED
@@ -149,12 +149,20 @@ var ENV_FILES = [
149
149
  // Overrides all (highest priority)
150
150
  ];
151
151
  var ENV_EXAMPLE_FILE = ".env.example";
152
+ var TSCONFIG_JSON = "tsconfig.json";
153
+ var TSCONFIG_APP_JSON = "tsconfig.app.json";
152
154
  var TSCONFIG_FILES = [
153
- "tsconfig.app.json",
155
+ TSCONFIG_APP_JSON,
154
156
  // Modern tooling (try first)
155
- "tsconfig.json"
157
+ TSCONFIG_JSON
156
158
  // Standard (fallback)
157
159
  ];
160
+ var TSCONFIG_REQUIRED_INCLUDES = [
161
+ "playcademy-env.d.ts",
162
+ // Generated type definitions
163
+ "server"
164
+ // Server-side code
165
+ ];
158
166
 
159
167
  // src/constants/bucket.ts
160
168
  var BUCKET_ALWAYS_SKIP = [".git", ".DS_Store", ".gitignore", ...ENV_FILES];
@@ -364,6 +372,9 @@ export {
364
372
  SERVER_LIB_DIRECTORY,
365
373
  SERVER_ROOT_DIRECTORY,
366
374
  SSO_AUTH_TIMEOUT_MS,
375
+ TSCONFIG_APP_JSON,
367
376
  TSCONFIG_FILES,
377
+ TSCONFIG_JSON,
378
+ TSCONFIG_REQUIRED_INCLUDES,
368
379
  WORKSPACE_NAME
369
380
  };
package/dist/index.js CHANGED
@@ -2345,12 +2345,20 @@ var ENV_FILES = [
2345
2345
  // Overrides all (highest priority)
2346
2346
  ];
2347
2347
  var ENV_EXAMPLE_FILE = ".env.example";
2348
+ var TSCONFIG_JSON = "tsconfig.json";
2349
+ var TSCONFIG_APP_JSON = "tsconfig.app.json";
2348
2350
  var TSCONFIG_FILES = [
2349
- "tsconfig.app.json",
2351
+ TSCONFIG_APP_JSON,
2350
2352
  // Modern tooling (try first)
2351
- "tsconfig.json"
2353
+ TSCONFIG_JSON
2352
2354
  // Standard (fallback)
2353
2355
  ];
2356
+ var TSCONFIG_REQUIRED_INCLUDES = [
2357
+ "playcademy-env.d.ts",
2358
+ // Generated type definitions
2359
+ "server"
2360
+ // Server-side code
2361
+ ];
2354
2362
 
2355
2363
  // src/constants/bucket.ts
2356
2364
  var BUCKET_ALWAYS_SKIP = [".git", ".DS_Store", ".gitignore", ...ENV_FILES];
@@ -4366,7 +4374,9 @@ var init_constants = __esm2(() => {
4366
4374
  studentTTL: 10 * 60 * 1e3,
4367
4375
  studentMaxSize: 500,
4368
4376
  assessmentTTL: 30 * 60 * 1e3,
4369
- assessmentMaxSize: 200
4377
+ assessmentMaxSize: 200,
4378
+ enrollmentTTL: 5 * 1e3,
4379
+ enrollmentMaxSize: 100
4370
4380
  };
4371
4381
  CONFIG_DEFAULTS = {
4372
4382
  fileNames: ["timeback.config.js", "timeback.config.json"]
@@ -4648,7 +4658,9 @@ var init_constants2 = __esm3(() => {
4648
4658
  studentTTL: 10 * 60 * 1e3,
4649
4659
  studentMaxSize: 500,
4650
4660
  assessmentTTL: 30 * 60 * 1e3,
4651
- assessmentMaxSize: 200
4661
+ assessmentMaxSize: 200,
4662
+ enrollmentTTL: 5 * 1e3,
4663
+ enrollmentMaxSize: 100
4652
4664
  };
4653
4665
  CONFIG_DEFAULTS2 = {
4654
4666
  fileNames: ["timeback.config.js", "timeback.config.json"]
@@ -5573,7 +5585,7 @@ import { join as join12 } from "path";
5573
5585
  // package.json
5574
5586
  var package_default2 = {
5575
5587
  name: "playcademy",
5576
- version: "0.14.21",
5588
+ version: "0.14.23",
5577
5589
  type: "module",
5578
5590
  exports: {
5579
5591
  ".": {
@@ -6155,14 +6167,21 @@ async function getDirectorySize(dirPath) {
6155
6167
  init_file_loader();
6156
6168
  import { existsSync as existsSync11, readFileSync as readFileSync6, writeFileSync as writeFileSync6 } from "fs";
6157
6169
  import { join as join15 } from "path";
6158
- function hasPlaycademyEnv(config) {
6159
- return config.include?.includes("playcademy-env.d.ts") ?? false;
6170
+ function hasAllRequiredIncludes(config) {
6171
+ if (!config.include) return false;
6172
+ return TSCONFIG_REQUIRED_INCLUDES.every((entry) => config.include.includes(entry));
6173
+ }
6174
+ function getMissingIncludes(config) {
6175
+ if (!config.include) return [...TSCONFIG_REQUIRED_INCLUDES];
6176
+ return TSCONFIG_REQUIRED_INCLUDES.filter((entry) => !config.include.includes(entry));
6160
6177
  }
6161
- function addPlaycademyEnv(config) {
6178
+ function addRequiredIncludes(config) {
6162
6179
  if (!config.include) {
6163
6180
  config.include = [];
6164
6181
  }
6165
- config.include.push("playcademy-env.d.ts");
6182
+ for (const entry of getMissingIncludes(config)) {
6183
+ config.include.push(entry);
6184
+ }
6166
6185
  }
6167
6186
  function updateExistingIncludeArray(content) {
6168
6187
  const includeRegex = /"include"\s*:\s*\[([^\]]*)\]/;
@@ -6172,20 +6191,24 @@ function updateExistingIncludeArray(content) {
6172
6191
  }
6173
6192
  const fullMatch = match[0];
6174
6193
  const arrayContents = match[1];
6175
- if (arrayContents.includes("playcademy-env.d.ts")) {
6194
+ const missingEntries = TSCONFIG_REQUIRED_INCLUDES.filter(
6195
+ (entry) => !arrayContents.includes(entry)
6196
+ );
6197
+ if (missingEntries.length === 0) {
6176
6198
  return content;
6177
6199
  }
6178
6200
  const trimmedContents = arrayContents.trim();
6179
- const newEntry = '"playcademy-env.d.ts"';
6201
+ const newEntries = missingEntries.map((entry) => `"${entry}"`);
6180
6202
  let newArrayContents;
6181
6203
  if (trimmedContents === "") {
6182
- newArrayContents = newEntry;
6204
+ newArrayContents = newEntries.join(", ");
6183
6205
  } else if (arrayContents.includes("\n")) {
6184
- newArrayContents = `${arrayContents},
6185
- ${newEntry}
6206
+ const entriesStr = newEntries.map((e) => `
6207
+ ${e}`).join(",");
6208
+ newArrayContents = `${arrayContents},${entriesStr}
6186
6209
  `;
6187
6210
  } else {
6188
- newArrayContents = `${trimmedContents}, ${newEntry}`;
6211
+ newArrayContents = `${trimmedContents}, ${newEntries.join(", ")}`;
6189
6212
  }
6190
6213
  const newIncludeArray = `"include": [${newArrayContents}]`;
6191
6214
  return content.replace(fullMatch, newIncludeArray);
@@ -6200,9 +6223,10 @@ function addNewIncludeProperty(content) {
6200
6223
  const insertPosition = closingBraceMatch.index;
6201
6224
  const beforeClosing = content.slice(0, insertPosition).trim();
6202
6225
  const needsComma = beforeClosing.endsWith("]") || beforeClosing.endsWith("}") || beforeClosing.endsWith('"');
6226
+ const entriesStr = TSCONFIG_REQUIRED_INCLUDES.map((e) => `"${e}"`).join(", ");
6203
6227
  const comma = needsComma ? "," : "";
6204
6228
  const includeEntry = `${comma}
6205
- ${propertyIndent}"include": ["playcademy-env.d.ts"]`;
6229
+ ${propertyIndent}"include": [${entriesStr}]`;
6206
6230
  const updatedContent = content.slice(0, insertPosition) + includeEntry + content.slice(insertPosition);
6207
6231
  return updatedContent;
6208
6232
  }
@@ -6221,10 +6245,10 @@ async function ensureTsconfigIncludes(workspace) {
6221
6245
  stripComments: true
6222
6246
  });
6223
6247
  if (!config) continue;
6224
- if (config.references && filename !== "tsconfig.json") {
6248
+ if (config.references && filename !== TSCONFIG_JSON) {
6225
6249
  continue;
6226
6250
  }
6227
- if (hasPlaycademyEnv(config)) {
6251
+ if (hasAllRequiredIncludes(config)) {
6228
6252
  return filename;
6229
6253
  }
6230
6254
  try {
@@ -6236,7 +6260,7 @@ async function ensureTsconfigIncludes(workspace) {
6236
6260
  }
6237
6261
  } catch {
6238
6262
  }
6239
- addPlaycademyEnv(config);
6263
+ addRequiredIncludes(config);
6240
6264
  writeFileSync6(configPath, JSON.stringify(config, null, 4) + "\n");
6241
6265
  return filename;
6242
6266
  } catch {
package/dist/utils.js CHANGED
@@ -1841,12 +1841,20 @@ var ENV_FILES = [
1841
1841
  ".env.local"
1842
1842
  // Overrides all (highest priority)
1843
1843
  ];
1844
+ var TSCONFIG_JSON = "tsconfig.json";
1845
+ var TSCONFIG_APP_JSON = "tsconfig.app.json";
1844
1846
  var TSCONFIG_FILES = [
1845
- "tsconfig.app.json",
1847
+ TSCONFIG_APP_JSON,
1846
1848
  // Modern tooling (try first)
1847
- "tsconfig.json"
1849
+ TSCONFIG_JSON
1848
1850
  // Standard (fallback)
1849
1851
  ];
1852
+ var TSCONFIG_REQUIRED_INCLUDES = [
1853
+ "playcademy-env.d.ts",
1854
+ // Generated type definitions
1855
+ "server"
1856
+ // Server-side code
1857
+ ];
1850
1858
 
1851
1859
  // src/constants/bucket.ts
1852
1860
  var BUCKET_ALWAYS_SKIP = [".git", ".DS_Store", ".gitignore", ...ENV_FILES];
@@ -3995,7 +4003,7 @@ import { join as join12 } from "path";
3995
4003
  // package.json
3996
4004
  var package_default2 = {
3997
4005
  name: "playcademy",
3998
- version: "0.14.21",
4006
+ version: "0.14.23",
3999
4007
  type: "module",
4000
4008
  exports: {
4001
4009
  ".": {
@@ -4126,14 +4134,21 @@ function hasLocalCustomRoutes(projectPath, config) {
4126
4134
  init_file_loader();
4127
4135
  import { existsSync as existsSync9, readFileSync as readFileSync4, writeFileSync as writeFileSync4 } from "fs";
4128
4136
  import { join as join14 } from "path";
4129
- function hasPlaycademyEnv(config) {
4130
- return config.include?.includes("playcademy-env.d.ts") ?? false;
4137
+ function hasAllRequiredIncludes(config) {
4138
+ if (!config.include) return false;
4139
+ return TSCONFIG_REQUIRED_INCLUDES.every((entry) => config.include.includes(entry));
4140
+ }
4141
+ function getMissingIncludes(config) {
4142
+ if (!config.include) return [...TSCONFIG_REQUIRED_INCLUDES];
4143
+ return TSCONFIG_REQUIRED_INCLUDES.filter((entry) => !config.include.includes(entry));
4131
4144
  }
4132
- function addPlaycademyEnv(config) {
4145
+ function addRequiredIncludes(config) {
4133
4146
  if (!config.include) {
4134
4147
  config.include = [];
4135
4148
  }
4136
- config.include.push("playcademy-env.d.ts");
4149
+ for (const entry of getMissingIncludes(config)) {
4150
+ config.include.push(entry);
4151
+ }
4137
4152
  }
4138
4153
  function updateExistingIncludeArray(content) {
4139
4154
  const includeRegex = /"include"\s*:\s*\[([^\]]*)\]/;
@@ -4143,20 +4158,24 @@ function updateExistingIncludeArray(content) {
4143
4158
  }
4144
4159
  const fullMatch = match[0];
4145
4160
  const arrayContents = match[1];
4146
- if (arrayContents.includes("playcademy-env.d.ts")) {
4161
+ const missingEntries = TSCONFIG_REQUIRED_INCLUDES.filter(
4162
+ (entry) => !arrayContents.includes(entry)
4163
+ );
4164
+ if (missingEntries.length === 0) {
4147
4165
  return content;
4148
4166
  }
4149
4167
  const trimmedContents = arrayContents.trim();
4150
- const newEntry = '"playcademy-env.d.ts"';
4168
+ const newEntries = missingEntries.map((entry) => `"${entry}"`);
4151
4169
  let newArrayContents;
4152
4170
  if (trimmedContents === "") {
4153
- newArrayContents = newEntry;
4171
+ newArrayContents = newEntries.join(", ");
4154
4172
  } else if (arrayContents.includes("\n")) {
4155
- newArrayContents = `${arrayContents},
4156
- ${newEntry}
4173
+ const entriesStr = newEntries.map((e) => `
4174
+ ${e}`).join(",");
4175
+ newArrayContents = `${arrayContents},${entriesStr}
4157
4176
  `;
4158
4177
  } else {
4159
- newArrayContents = `${trimmedContents}, ${newEntry}`;
4178
+ newArrayContents = `${trimmedContents}, ${newEntries.join(", ")}`;
4160
4179
  }
4161
4180
  const newIncludeArray = `"include": [${newArrayContents}]`;
4162
4181
  return content.replace(fullMatch, newIncludeArray);
@@ -4171,9 +4190,10 @@ function addNewIncludeProperty(content) {
4171
4190
  const insertPosition = closingBraceMatch.index;
4172
4191
  const beforeClosing = content.slice(0, insertPosition).trim();
4173
4192
  const needsComma = beforeClosing.endsWith("]") || beforeClosing.endsWith("}") || beforeClosing.endsWith('"');
4193
+ const entriesStr = TSCONFIG_REQUIRED_INCLUDES.map((e) => `"${e}"`).join(", ");
4174
4194
  const comma = needsComma ? "," : "";
4175
4195
  const includeEntry = `${comma}
4176
- ${propertyIndent}"include": ["playcademy-env.d.ts"]`;
4196
+ ${propertyIndent}"include": [${entriesStr}]`;
4177
4197
  const updatedContent = content.slice(0, insertPosition) + includeEntry + content.slice(insertPosition);
4178
4198
  return updatedContent;
4179
4199
  }
@@ -4192,10 +4212,10 @@ async function ensureTsconfigIncludes(workspace) {
4192
4212
  stripComments: true
4193
4213
  });
4194
4214
  if (!config) continue;
4195
- if (config.references && filename !== "tsconfig.json") {
4215
+ if (config.references && filename !== TSCONFIG_JSON) {
4196
4216
  continue;
4197
4217
  }
4198
- if (hasPlaycademyEnv(config)) {
4218
+ if (hasAllRequiredIncludes(config)) {
4199
4219
  return filename;
4200
4220
  }
4201
4221
  try {
@@ -4207,7 +4227,7 @@ async function ensureTsconfigIncludes(workspace) {
4207
4227
  }
4208
4228
  } catch {
4209
4229
  }
4210
- addPlaycademyEnv(config);
4230
+ addRequiredIncludes(config);
4211
4231
  writeFileSync4(configPath, JSON.stringify(config, null, 4) + "\n");
4212
4232
  return filename;
4213
4233
  } catch {
package/dist/version.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "playcademy",
4
- version: "0.14.21",
4
+ version: "0.14.23",
5
5
  type: "module",
6
6
  exports: {
7
7
  ".": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playcademy",
3
- "version": "0.14.22",
3
+ "version": "0.14.24",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@inquirer/prompts": "^7.8.6",
47
- "@playcademy/sdk": "0.2.0",
47
+ "@playcademy/sdk": "0.2.1",
48
48
  "chokidar": "^4.0.3",
49
49
  "colorette": "^2.0.20",
50
50
  "commander": "^14.0.1",