playcademy 0.14.22 → 0.14.23
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/constants.d.ts +16 -1
- package/dist/constants.js +13 -2
- package/dist/index.js +37 -17
- package/dist/utils.js +37 -17
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -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
|
-
|
|
155
|
+
TSCONFIG_APP_JSON,
|
|
154
156
|
// Modern tooling (try first)
|
|
155
|
-
|
|
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
|
-
|
|
2351
|
+
TSCONFIG_APP_JSON,
|
|
2350
2352
|
// Modern tooling (try first)
|
|
2351
|
-
|
|
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];
|
|
@@ -5573,7 +5581,7 @@ import { join as join12 } from "path";
|
|
|
5573
5581
|
// package.json
|
|
5574
5582
|
var package_default2 = {
|
|
5575
5583
|
name: "playcademy",
|
|
5576
|
-
version: "0.14.
|
|
5584
|
+
version: "0.14.22",
|
|
5577
5585
|
type: "module",
|
|
5578
5586
|
exports: {
|
|
5579
5587
|
".": {
|
|
@@ -6155,14 +6163,21 @@ async function getDirectorySize(dirPath) {
|
|
|
6155
6163
|
init_file_loader();
|
|
6156
6164
|
import { existsSync as existsSync11, readFileSync as readFileSync6, writeFileSync as writeFileSync6 } from "fs";
|
|
6157
6165
|
import { join as join15 } from "path";
|
|
6158
|
-
function
|
|
6159
|
-
|
|
6166
|
+
function hasAllRequiredIncludes(config) {
|
|
6167
|
+
if (!config.include) return false;
|
|
6168
|
+
return TSCONFIG_REQUIRED_INCLUDES.every((entry) => config.include.includes(entry));
|
|
6169
|
+
}
|
|
6170
|
+
function getMissingIncludes(config) {
|
|
6171
|
+
if (!config.include) return [...TSCONFIG_REQUIRED_INCLUDES];
|
|
6172
|
+
return TSCONFIG_REQUIRED_INCLUDES.filter((entry) => !config.include.includes(entry));
|
|
6160
6173
|
}
|
|
6161
|
-
function
|
|
6174
|
+
function addRequiredIncludes(config) {
|
|
6162
6175
|
if (!config.include) {
|
|
6163
6176
|
config.include = [];
|
|
6164
6177
|
}
|
|
6165
|
-
config
|
|
6178
|
+
for (const entry of getMissingIncludes(config)) {
|
|
6179
|
+
config.include.push(entry);
|
|
6180
|
+
}
|
|
6166
6181
|
}
|
|
6167
6182
|
function updateExistingIncludeArray(content) {
|
|
6168
6183
|
const includeRegex = /"include"\s*:\s*\[([^\]]*)\]/;
|
|
@@ -6172,20 +6187,24 @@ function updateExistingIncludeArray(content) {
|
|
|
6172
6187
|
}
|
|
6173
6188
|
const fullMatch = match[0];
|
|
6174
6189
|
const arrayContents = match[1];
|
|
6175
|
-
|
|
6190
|
+
const missingEntries = TSCONFIG_REQUIRED_INCLUDES.filter(
|
|
6191
|
+
(entry) => !arrayContents.includes(entry)
|
|
6192
|
+
);
|
|
6193
|
+
if (missingEntries.length === 0) {
|
|
6176
6194
|
return content;
|
|
6177
6195
|
}
|
|
6178
6196
|
const trimmedContents = arrayContents.trim();
|
|
6179
|
-
const
|
|
6197
|
+
const newEntries = missingEntries.map((entry) => `"${entry}"`);
|
|
6180
6198
|
let newArrayContents;
|
|
6181
6199
|
if (trimmedContents === "") {
|
|
6182
|
-
newArrayContents =
|
|
6200
|
+
newArrayContents = newEntries.join(", ");
|
|
6183
6201
|
} else if (arrayContents.includes("\n")) {
|
|
6184
|
-
|
|
6185
|
-
${
|
|
6202
|
+
const entriesStr = newEntries.map((e) => `
|
|
6203
|
+
${e}`).join(",");
|
|
6204
|
+
newArrayContents = `${arrayContents},${entriesStr}
|
|
6186
6205
|
`;
|
|
6187
6206
|
} else {
|
|
6188
|
-
newArrayContents = `${trimmedContents}, ${
|
|
6207
|
+
newArrayContents = `${trimmedContents}, ${newEntries.join(", ")}`;
|
|
6189
6208
|
}
|
|
6190
6209
|
const newIncludeArray = `"include": [${newArrayContents}]`;
|
|
6191
6210
|
return content.replace(fullMatch, newIncludeArray);
|
|
@@ -6200,9 +6219,10 @@ function addNewIncludeProperty(content) {
|
|
|
6200
6219
|
const insertPosition = closingBraceMatch.index;
|
|
6201
6220
|
const beforeClosing = content.slice(0, insertPosition).trim();
|
|
6202
6221
|
const needsComma = beforeClosing.endsWith("]") || beforeClosing.endsWith("}") || beforeClosing.endsWith('"');
|
|
6222
|
+
const entriesStr = TSCONFIG_REQUIRED_INCLUDES.map((e) => `"${e}"`).join(", ");
|
|
6203
6223
|
const comma = needsComma ? "," : "";
|
|
6204
6224
|
const includeEntry = `${comma}
|
|
6205
|
-
${propertyIndent}"include": [
|
|
6225
|
+
${propertyIndent}"include": [${entriesStr}]`;
|
|
6206
6226
|
const updatedContent = content.slice(0, insertPosition) + includeEntry + content.slice(insertPosition);
|
|
6207
6227
|
return updatedContent;
|
|
6208
6228
|
}
|
|
@@ -6221,10 +6241,10 @@ async function ensureTsconfigIncludes(workspace) {
|
|
|
6221
6241
|
stripComments: true
|
|
6222
6242
|
});
|
|
6223
6243
|
if (!config) continue;
|
|
6224
|
-
if (config.references && filename !==
|
|
6244
|
+
if (config.references && filename !== TSCONFIG_JSON) {
|
|
6225
6245
|
continue;
|
|
6226
6246
|
}
|
|
6227
|
-
if (
|
|
6247
|
+
if (hasAllRequiredIncludes(config)) {
|
|
6228
6248
|
return filename;
|
|
6229
6249
|
}
|
|
6230
6250
|
try {
|
|
@@ -6236,7 +6256,7 @@ async function ensureTsconfigIncludes(workspace) {
|
|
|
6236
6256
|
}
|
|
6237
6257
|
} catch {
|
|
6238
6258
|
}
|
|
6239
|
-
|
|
6259
|
+
addRequiredIncludes(config);
|
|
6240
6260
|
writeFileSync6(configPath, JSON.stringify(config, null, 4) + "\n");
|
|
6241
6261
|
return filename;
|
|
6242
6262
|
} 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
|
-
|
|
1847
|
+
TSCONFIG_APP_JSON,
|
|
1846
1848
|
// Modern tooling (try first)
|
|
1847
|
-
|
|
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.
|
|
4006
|
+
version: "0.14.22",
|
|
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
|
|
4130
|
-
|
|
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
|
|
4145
|
+
function addRequiredIncludes(config) {
|
|
4133
4146
|
if (!config.include) {
|
|
4134
4147
|
config.include = [];
|
|
4135
4148
|
}
|
|
4136
|
-
config
|
|
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
|
-
|
|
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
|
|
4168
|
+
const newEntries = missingEntries.map((entry) => `"${entry}"`);
|
|
4151
4169
|
let newArrayContents;
|
|
4152
4170
|
if (trimmedContents === "") {
|
|
4153
|
-
newArrayContents =
|
|
4171
|
+
newArrayContents = newEntries.join(", ");
|
|
4154
4172
|
} else if (arrayContents.includes("\n")) {
|
|
4155
|
-
|
|
4156
|
-
${
|
|
4173
|
+
const entriesStr = newEntries.map((e) => `
|
|
4174
|
+
${e}`).join(",");
|
|
4175
|
+
newArrayContents = `${arrayContents},${entriesStr}
|
|
4157
4176
|
`;
|
|
4158
4177
|
} else {
|
|
4159
|
-
newArrayContents = `${trimmedContents}, ${
|
|
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": [
|
|
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 !==
|
|
4215
|
+
if (config.references && filename !== TSCONFIG_JSON) {
|
|
4196
4216
|
continue;
|
|
4197
4217
|
}
|
|
4198
|
-
if (
|
|
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
|
-
|
|
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