playcademy 0.14.26 → 0.14.27
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/index.js +164 -316
- package/dist/utils.js +3 -3
- package/dist/version.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -47,8 +47,8 @@ function getPackageVersionFromData(pkg, fallback = "0.0.0") {
|
|
|
47
47
|
}
|
|
48
48
|
function getPackageNameVersionFromData(pkg) {
|
|
49
49
|
const name = getPackageNameFromData(pkg);
|
|
50
|
-
const
|
|
51
|
-
return `${name}@${
|
|
50
|
+
const version3 = getPackageVersionFromData(pkg);
|
|
51
|
+
return `${name}@${version3}`;
|
|
52
52
|
}
|
|
53
53
|
function hasDependencyInData(pkg, packageName) {
|
|
54
54
|
if (!pkg) return false;
|
|
@@ -324,123 +324,6 @@ var init_file_loader = __esm({
|
|
|
324
324
|
}
|
|
325
325
|
});
|
|
326
326
|
|
|
327
|
-
// ../constants/src/auth.ts
|
|
328
|
-
var init_auth = __esm({
|
|
329
|
-
"../constants/src/auth.ts"() {
|
|
330
|
-
"use strict";
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
|
|
334
|
-
// ../constants/src/domains.ts
|
|
335
|
-
var PLAYCADEMY_BASE_URLS, GAME_WORKER_DOMAINS;
|
|
336
|
-
var init_domains = __esm({
|
|
337
|
-
"../constants/src/domains.ts"() {
|
|
338
|
-
"use strict";
|
|
339
|
-
PLAYCADEMY_BASE_URLS = {
|
|
340
|
-
production: "https://hub.playcademy.net",
|
|
341
|
-
staging: "https://hub.dev.playcademy.net"
|
|
342
|
-
};
|
|
343
|
-
GAME_WORKER_DOMAINS = {
|
|
344
|
-
production: "playcademy.gg",
|
|
345
|
-
staging: "staging.playcademy.gg"
|
|
346
|
-
};
|
|
347
|
-
}
|
|
348
|
-
});
|
|
349
|
-
|
|
350
|
-
// ../constants/src/env-vars.ts
|
|
351
|
-
var init_env_vars = __esm({
|
|
352
|
-
"../constants/src/env-vars.ts"() {
|
|
353
|
-
"use strict";
|
|
354
|
-
}
|
|
355
|
-
});
|
|
356
|
-
|
|
357
|
-
// ../constants/src/overworld.ts
|
|
358
|
-
var ITEM_SLUGS, CURRENCIES, BADGES, CORE_GAME_UUIDS;
|
|
359
|
-
var init_overworld = __esm({
|
|
360
|
-
"../constants/src/overworld.ts"() {
|
|
361
|
-
"use strict";
|
|
362
|
-
ITEM_SLUGS = {
|
|
363
|
-
/** Primary platform currency */
|
|
364
|
-
PLAYCADEMY_CREDITS: "PLAYCADEMY_CREDITS",
|
|
365
|
-
/** Experience points currency */
|
|
366
|
-
PLAYCADEMY_XP: "PLAYCADEMY_XP",
|
|
367
|
-
/** Core platform badges */
|
|
368
|
-
FOUNDING_MEMBER_BADGE: "FOUNDING_MEMBER_BADGE",
|
|
369
|
-
EARLY_ADOPTER_BADGE: "EARLY_ADOPTER_BADGE",
|
|
370
|
-
FIRST_GAME_BADGE: "FIRST_GAME_BADGE",
|
|
371
|
-
/** Example items */
|
|
372
|
-
COMMON_SWORD: "COMMON_SWORD",
|
|
373
|
-
SMALL_HEALTH_POTION: "SMALL_HEALTH_POTION",
|
|
374
|
-
SMALL_BACKPACK: "SMALL_BACKPACK",
|
|
375
|
-
/** Placeable items */
|
|
376
|
-
LAVA_LAMP: "LAVA_LAMP",
|
|
377
|
-
BOOMBOX: "BOOMBOX",
|
|
378
|
-
CABIN_BED: "CABIN_BED"
|
|
379
|
-
};
|
|
380
|
-
CURRENCIES = {
|
|
381
|
-
/** Primary platform currency slug */
|
|
382
|
-
PRIMARY: ITEM_SLUGS.PLAYCADEMY_CREDITS,
|
|
383
|
-
/** Experience points slug */
|
|
384
|
-
XP: ITEM_SLUGS.PLAYCADEMY_XP
|
|
385
|
-
};
|
|
386
|
-
BADGES = {
|
|
387
|
-
FOUNDING_MEMBER: ITEM_SLUGS.FOUNDING_MEMBER_BADGE,
|
|
388
|
-
EARLY_ADOPTER: ITEM_SLUGS.EARLY_ADOPTER_BADGE,
|
|
389
|
-
FIRST_GAME: ITEM_SLUGS.FIRST_GAME_BADGE
|
|
390
|
-
};
|
|
391
|
-
CORE_GAME_UUIDS = {
|
|
392
|
-
/** Internal playground game for development and testing */
|
|
393
|
-
PLAYGROUND: "00000000-0000-0000-0000-000000000001"
|
|
394
|
-
};
|
|
395
|
-
}
|
|
396
|
-
});
|
|
397
|
-
|
|
398
|
-
// ../constants/src/system.ts
|
|
399
|
-
var init_system = __esm({
|
|
400
|
-
"../constants/src/system.ts"() {
|
|
401
|
-
"use strict";
|
|
402
|
-
}
|
|
403
|
-
});
|
|
404
|
-
|
|
405
|
-
// ../constants/src/timeback.ts
|
|
406
|
-
var TIMEBACK_ROUTES;
|
|
407
|
-
var init_timeback = __esm({
|
|
408
|
-
"../constants/src/timeback.ts"() {
|
|
409
|
-
"use strict";
|
|
410
|
-
TIMEBACK_ROUTES = {
|
|
411
|
-
END_ACTIVITY: "/integrations/timeback/end-activity"
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
});
|
|
415
|
-
|
|
416
|
-
// ../constants/src/workers.ts
|
|
417
|
-
var WORKER_NAMING;
|
|
418
|
-
var init_workers = __esm({
|
|
419
|
-
"../constants/src/workers.ts"() {
|
|
420
|
-
"use strict";
|
|
421
|
-
WORKER_NAMING = {
|
|
422
|
-
/** Prefix for staging worker names (e.g., "staging-bamboo") */
|
|
423
|
-
STAGING_PREFIX: "staging-",
|
|
424
|
-
/** Suffix for staging worker hostnames (e.g., "bamboo-staging.playcademy.gg") */
|
|
425
|
-
STAGING_SUFFIX: "-staging"
|
|
426
|
-
};
|
|
427
|
-
}
|
|
428
|
-
});
|
|
429
|
-
|
|
430
|
-
// ../constants/src/index.ts
|
|
431
|
-
var init_src = __esm({
|
|
432
|
-
"../constants/src/index.ts"() {
|
|
433
|
-
"use strict";
|
|
434
|
-
init_auth();
|
|
435
|
-
init_domains();
|
|
436
|
-
init_env_vars();
|
|
437
|
-
init_overworld();
|
|
438
|
-
init_system();
|
|
439
|
-
init_timeback();
|
|
440
|
-
init_workers();
|
|
441
|
-
}
|
|
442
|
-
});
|
|
443
|
-
|
|
444
327
|
// ../../node_modules/cli-width/index.js
|
|
445
328
|
var require_cli_width = __commonJS({
|
|
446
329
|
"../../node_modules/cli-width/index.js"(exports, module) {
|
|
@@ -1821,25 +1704,6 @@ var require_wrap_ansi = __commonJS({
|
|
|
1821
1704
|
}
|
|
1822
1705
|
});
|
|
1823
1706
|
|
|
1824
|
-
// ../edge-play/src/constants.ts
|
|
1825
|
-
var ROUTES;
|
|
1826
|
-
var init_constants3 = __esm({
|
|
1827
|
-
"../edge-play/src/constants.ts"() {
|
|
1828
|
-
"use strict";
|
|
1829
|
-
init_src();
|
|
1830
|
-
ROUTES = {
|
|
1831
|
-
/** Route index (lists available routes) */
|
|
1832
|
-
INDEX: "/api",
|
|
1833
|
-
/** Health check endpoint */
|
|
1834
|
-
HEALTH: "/api/health",
|
|
1835
|
-
/** TimeBack integration routes */
|
|
1836
|
-
TIMEBACK: {
|
|
1837
|
-
END_ACTIVITY: `/api${TIMEBACK_ROUTES.END_ACTIVITY}`
|
|
1838
|
-
}
|
|
1839
|
-
};
|
|
1840
|
-
}
|
|
1841
|
-
});
|
|
1842
|
-
|
|
1843
1707
|
// src/index.ts
|
|
1844
1708
|
init_file_loader();
|
|
1845
1709
|
import { dirname as dirname5 } from "node:path";
|
|
@@ -2475,8 +2339,58 @@ var CONFIG_FILE_NAMES = [
|
|
|
2475
2339
|
"playcademy.config.mjs"
|
|
2476
2340
|
];
|
|
2477
2341
|
|
|
2478
|
-
// src/
|
|
2479
|
-
|
|
2342
|
+
// ../constants/src/domains.ts
|
|
2343
|
+
var PLAYCADEMY_BASE_URLS = {
|
|
2344
|
+
production: "https://hub.playcademy.net",
|
|
2345
|
+
staging: "https://hub.dev.playcademy.net"
|
|
2346
|
+
};
|
|
2347
|
+
var GAME_WORKER_DOMAINS = {
|
|
2348
|
+
production: "playcademy.gg",
|
|
2349
|
+
staging: "staging.playcademy.gg"
|
|
2350
|
+
};
|
|
2351
|
+
|
|
2352
|
+
// ../constants/src/overworld.ts
|
|
2353
|
+
var ITEM_SLUGS = {
|
|
2354
|
+
/** Primary platform currency */
|
|
2355
|
+
PLAYCADEMY_CREDITS: "PLAYCADEMY_CREDITS",
|
|
2356
|
+
/** Experience points currency */
|
|
2357
|
+
PLAYCADEMY_XP: "PLAYCADEMY_XP",
|
|
2358
|
+
/** Core platform badges */
|
|
2359
|
+
FOUNDING_MEMBER_BADGE: "FOUNDING_MEMBER_BADGE",
|
|
2360
|
+
EARLY_ADOPTER_BADGE: "EARLY_ADOPTER_BADGE",
|
|
2361
|
+
FIRST_GAME_BADGE: "FIRST_GAME_BADGE",
|
|
2362
|
+
/** Example items */
|
|
2363
|
+
COMMON_SWORD: "COMMON_SWORD",
|
|
2364
|
+
SMALL_HEALTH_POTION: "SMALL_HEALTH_POTION",
|
|
2365
|
+
SMALL_BACKPACK: "SMALL_BACKPACK",
|
|
2366
|
+
/** Placeable items */
|
|
2367
|
+
LAVA_LAMP: "LAVA_LAMP",
|
|
2368
|
+
BOOMBOX: "BOOMBOX",
|
|
2369
|
+
CABIN_BED: "CABIN_BED"
|
|
2370
|
+
};
|
|
2371
|
+
var CURRENCIES = {
|
|
2372
|
+
/** Primary platform currency slug */
|
|
2373
|
+
PRIMARY: ITEM_SLUGS.PLAYCADEMY_CREDITS,
|
|
2374
|
+
/** Experience points slug */
|
|
2375
|
+
XP: ITEM_SLUGS.PLAYCADEMY_XP
|
|
2376
|
+
};
|
|
2377
|
+
var BADGES = {
|
|
2378
|
+
FOUNDING_MEMBER: ITEM_SLUGS.FOUNDING_MEMBER_BADGE,
|
|
2379
|
+
EARLY_ADOPTER: ITEM_SLUGS.EARLY_ADOPTER_BADGE,
|
|
2380
|
+
FIRST_GAME: ITEM_SLUGS.FIRST_GAME_BADGE
|
|
2381
|
+
};
|
|
2382
|
+
var CORE_GAME_UUIDS = {
|
|
2383
|
+
/** Internal playground game for development and testing */
|
|
2384
|
+
PLAYGROUND: "00000000-0000-0000-0000-000000000001"
|
|
2385
|
+
};
|
|
2386
|
+
|
|
2387
|
+
// ../constants/src/workers.ts
|
|
2388
|
+
var WORKER_NAMING = {
|
|
2389
|
+
/** Prefix for staging worker names (e.g., "staging-bamboo") */
|
|
2390
|
+
STAGING_PREFIX: "staging-",
|
|
2391
|
+
/** Suffix for staging worker hostnames (e.g., "bamboo-staging.playcademy.gg") */
|
|
2392
|
+
STAGING_SUFFIX: "-staging"
|
|
2393
|
+
};
|
|
2480
2394
|
|
|
2481
2395
|
// src/lib/core/client.ts
|
|
2482
2396
|
import { PlaycademyClient } from "@playcademy/sdk/internal";
|
|
@@ -4154,21 +4068,21 @@ function processConfigVariables(config) {
|
|
|
4154
4068
|
|
|
4155
4069
|
// ../timeback/dist/constants.js
|
|
4156
4070
|
var __esm2 = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
4157
|
-
var
|
|
4071
|
+
var init_auth = () => {
|
|
4158
4072
|
};
|
|
4159
4073
|
var PLAYCADEMY_BASE_URLS2;
|
|
4160
|
-
var
|
|
4074
|
+
var init_domains = __esm2(() => {
|
|
4161
4075
|
PLAYCADEMY_BASE_URLS2 = {
|
|
4162
4076
|
production: "https://hub.playcademy.net",
|
|
4163
4077
|
staging: "https://hub.dev.playcademy.net"
|
|
4164
4078
|
};
|
|
4165
4079
|
});
|
|
4166
|
-
var
|
|
4080
|
+
var init_env_vars = () => {
|
|
4167
4081
|
};
|
|
4168
4082
|
var ITEM_SLUGS2;
|
|
4169
4083
|
var CURRENCIES2;
|
|
4170
4084
|
var BADGES2;
|
|
4171
|
-
var
|
|
4085
|
+
var init_overworld = __esm2(() => {
|
|
4172
4086
|
ITEM_SLUGS2 = {
|
|
4173
4087
|
PLAYCADEMY_CREDITS: "PLAYCADEMY_CREDITS",
|
|
4174
4088
|
PLAYCADEMY_XP: "PLAYCADEMY_XP",
|
|
@@ -4199,7 +4113,7 @@ var TIMEBACK_COURSE_DEFAULTS;
|
|
|
4199
4113
|
var TIMEBACK_RESOURCE_DEFAULTS;
|
|
4200
4114
|
var TIMEBACK_COMPONENT_DEFAULTS;
|
|
4201
4115
|
var TIMEBACK_COMPONENT_RESOURCE_DEFAULTS;
|
|
4202
|
-
var
|
|
4116
|
+
var init_timeback = __esm2(() => {
|
|
4203
4117
|
TIMEBACK_COURSE_DEFAULTS = {
|
|
4204
4118
|
gradingScheme: "STANDARD",
|
|
4205
4119
|
level: {
|
|
@@ -4237,15 +4151,15 @@ var init_timeback2 = __esm2(() => {
|
|
|
4237
4151
|
lessonType: "quiz"
|
|
4238
4152
|
};
|
|
4239
4153
|
});
|
|
4240
|
-
var
|
|
4154
|
+
var init_workers = () => {
|
|
4241
4155
|
};
|
|
4242
|
-
var
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4156
|
+
var init_src = __esm2(() => {
|
|
4157
|
+
init_auth();
|
|
4158
|
+
init_domains();
|
|
4159
|
+
init_env_vars();
|
|
4160
|
+
init_overworld();
|
|
4161
|
+
init_timeback();
|
|
4162
|
+
init_workers();
|
|
4249
4163
|
});
|
|
4250
4164
|
var TIMEBACK_API_URLS;
|
|
4251
4165
|
var TIMEBACK_AUTH_URLS;
|
|
@@ -4274,7 +4188,7 @@ var RESOURCE_DEFAULTS;
|
|
|
4274
4188
|
var HTTP_STATUS;
|
|
4275
4189
|
var ERROR_NAMES;
|
|
4276
4190
|
var init_constants = __esm2(() => {
|
|
4277
|
-
|
|
4191
|
+
init_src();
|
|
4278
4192
|
TIMEBACK_API_URLS = {
|
|
4279
4193
|
production: "https://api.alpha-1edtech.ai",
|
|
4280
4194
|
staging: "https://api.staging.alpha-1edtech.com"
|
|
@@ -4452,21 +4366,21 @@ init_constants();
|
|
|
4452
4366
|
|
|
4453
4367
|
// ../timeback/dist/types.js
|
|
4454
4368
|
var __esm3 = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
4455
|
-
var
|
|
4369
|
+
var init_auth2 = () => {
|
|
4456
4370
|
};
|
|
4457
4371
|
var PLAYCADEMY_BASE_URLS3;
|
|
4458
|
-
var
|
|
4372
|
+
var init_domains2 = __esm3(() => {
|
|
4459
4373
|
PLAYCADEMY_BASE_URLS3 = {
|
|
4460
4374
|
production: "https://hub.playcademy.net",
|
|
4461
4375
|
staging: "https://hub.dev.playcademy.net"
|
|
4462
4376
|
};
|
|
4463
4377
|
});
|
|
4464
|
-
var
|
|
4378
|
+
var init_env_vars2 = () => {
|
|
4465
4379
|
};
|
|
4466
4380
|
var ITEM_SLUGS3;
|
|
4467
4381
|
var CURRENCIES3;
|
|
4468
4382
|
var BADGES3;
|
|
4469
|
-
var
|
|
4383
|
+
var init_overworld2 = __esm3(() => {
|
|
4470
4384
|
ITEM_SLUGS3 = {
|
|
4471
4385
|
PLAYCADEMY_CREDITS: "PLAYCADEMY_CREDITS",
|
|
4472
4386
|
PLAYCADEMY_XP: "PLAYCADEMY_XP",
|
|
@@ -4497,7 +4411,7 @@ var TIMEBACK_COURSE_DEFAULTS2;
|
|
|
4497
4411
|
var TIMEBACK_RESOURCE_DEFAULTS2;
|
|
4498
4412
|
var TIMEBACK_COMPONENT_DEFAULTS2;
|
|
4499
4413
|
var TIMEBACK_COMPONENT_RESOURCE_DEFAULTS2;
|
|
4500
|
-
var
|
|
4414
|
+
var init_timeback2 = __esm3(() => {
|
|
4501
4415
|
TIMEBACK_COURSE_DEFAULTS2 = {
|
|
4502
4416
|
gradingScheme: "STANDARD",
|
|
4503
4417
|
level: {
|
|
@@ -4535,15 +4449,15 @@ var init_timeback3 = __esm3(() => {
|
|
|
4535
4449
|
lessonType: "quiz"
|
|
4536
4450
|
};
|
|
4537
4451
|
});
|
|
4538
|
-
var
|
|
4452
|
+
var init_workers2 = () => {
|
|
4539
4453
|
};
|
|
4540
|
-
var
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4454
|
+
var init_src2 = __esm3(() => {
|
|
4455
|
+
init_auth2();
|
|
4456
|
+
init_domains2();
|
|
4457
|
+
init_env_vars2();
|
|
4458
|
+
init_overworld2();
|
|
4459
|
+
init_timeback2();
|
|
4460
|
+
init_workers2();
|
|
4547
4461
|
});
|
|
4548
4462
|
var TIMEBACK_API_URLS2;
|
|
4549
4463
|
var TIMEBACK_AUTH_URLS2;
|
|
@@ -4572,7 +4486,7 @@ var RESOURCE_DEFAULTS2;
|
|
|
4572
4486
|
var HTTP_STATUS2;
|
|
4573
4487
|
var ERROR_NAMES2;
|
|
4574
4488
|
var init_constants2 = __esm3(() => {
|
|
4575
|
-
|
|
4489
|
+
init_src2();
|
|
4576
4490
|
TIMEBACK_API_URLS2 = {
|
|
4577
4491
|
production: "https://api.alpha-1edtech.ai",
|
|
4578
4492
|
staging: "https://api.staging.alpha-1edtech.com"
|
|
@@ -5602,10 +5516,10 @@ function hasAuthSetup() {
|
|
|
5602
5516
|
import { existsSync as existsSync8, mkdirSync as mkdirSync2, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "fs";
|
|
5603
5517
|
import { join as join12 } from "path";
|
|
5604
5518
|
|
|
5605
|
-
// package.json
|
|
5519
|
+
// package.json with { type: 'json' }
|
|
5606
5520
|
var package_default2 = {
|
|
5607
5521
|
name: "playcademy",
|
|
5608
|
-
version: "0.14.
|
|
5522
|
+
version: "0.14.26",
|
|
5609
5523
|
type: "module",
|
|
5610
5524
|
exports: {
|
|
5611
5525
|
".": {
|
|
@@ -6781,95 +6695,28 @@ function needsBackend(config) {
|
|
|
6781
6695
|
}
|
|
6782
6696
|
|
|
6783
6697
|
// src/lib/dev/display.ts
|
|
6784
|
-
import { dim as dim4 } from "colorette";
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
}
|
|
6800
|
-
return 0 /* Static */;
|
|
6801
|
-
}
|
|
6802
|
-
function compareSegments(a, b) {
|
|
6803
|
-
const typeA = getSegmentType(a);
|
|
6804
|
-
const typeB = getSegmentType(b);
|
|
6805
|
-
if (typeA !== typeB) {
|
|
6806
|
-
if (typeA === 1 /* Dynamic */ && typeB === 0 /* Static */) {
|
|
6807
|
-
return -1;
|
|
6808
|
-
}
|
|
6809
|
-
if (typeA === 0 /* Static */ && typeB === 1 /* Dynamic */) {
|
|
6810
|
-
return 1;
|
|
6811
|
-
}
|
|
6812
|
-
if (typeA === 2 /* CatchAll */ && typeB === 0 /* Static */) {
|
|
6813
|
-
return -1;
|
|
6814
|
-
}
|
|
6815
|
-
if (typeA === 0 /* Static */ && typeB === 2 /* CatchAll */) {
|
|
6816
|
-
return 1;
|
|
6817
|
-
}
|
|
6818
|
-
return typeA - typeB;
|
|
6698
|
+
import { bold as bold5, cyan as cyan3, dim as dim4, green as green2 } from "colorette";
|
|
6699
|
+
function printDevBanner(options) {
|
|
6700
|
+
const { version: version3, port, startupTimeMs, quiet } = options;
|
|
6701
|
+
logger.newLine();
|
|
6702
|
+
logger.raw(
|
|
6703
|
+
` ${green2(bold5("PLAYCADEMY BACKEND"))} ${green2(`v${version3}`)} ${dim4("ready in")} ${bold5(startupTimeMs.toString())} ms`
|
|
6704
|
+
);
|
|
6705
|
+
logger.newLine();
|
|
6706
|
+
logger.raw(
|
|
6707
|
+
` ${green2("\u279C")} ${bold5("Local:")} ${cyan3(`http://localhost:${bold5(port.toString())}/api`)}`
|
|
6708
|
+
);
|
|
6709
|
+
logger.newLine();
|
|
6710
|
+
if (!quiet) {
|
|
6711
|
+
logger.raw(` ${dim4("Press")} ${bold5("Ctrl+C")} ${dim4("to stop the server")}`);
|
|
6712
|
+
logger.newLine();
|
|
6819
6713
|
}
|
|
6820
|
-
return a.localeCompare(b);
|
|
6821
|
-
}
|
|
6822
|
-
function sortRoutes(routes) {
|
|
6823
|
-
return [...routes].sort((a, b) => {
|
|
6824
|
-
const segmentsA = a.path.split("/").filter(Boolean);
|
|
6825
|
-
const segmentsB = b.path.split("/").filter(Boolean);
|
|
6826
|
-
const maxLength = Math.max(segmentsA.length, segmentsB.length);
|
|
6827
|
-
for (let i = 0; i < maxLength; i++) {
|
|
6828
|
-
const segA = segmentsA[i];
|
|
6829
|
-
const segB = segmentsB[i];
|
|
6830
|
-
if (segA === void 0) return -1;
|
|
6831
|
-
if (segB === void 0) return 1;
|
|
6832
|
-
const comparison = compareSegments(segA, segB);
|
|
6833
|
-
if (comparison !== 0) {
|
|
6834
|
-
return comparison;
|
|
6835
|
-
}
|
|
6836
|
-
}
|
|
6837
|
-
return 0;
|
|
6838
|
-
});
|
|
6839
|
-
}
|
|
6840
|
-
|
|
6841
|
-
// src/lib/dev/display.ts
|
|
6842
|
-
function displayRegisteredRoutes(integrations, customRoutes = []) {
|
|
6843
|
-
const healthRoutes = [
|
|
6844
|
-
{ path: ROUTES.HEALTH, method: "GET" }
|
|
6845
|
-
];
|
|
6846
|
-
const timebackRoutes = [];
|
|
6847
|
-
if (integrations?.timeback) {
|
|
6848
|
-
const hasSandboxCreds = !!process.env.TIMEBACK_API_CLIENT_ID;
|
|
6849
|
-
const method = hasSandboxCreds ? "POST" : "POST (not configured)";
|
|
6850
|
-
timebackRoutes.push({ path: ROUTES.TIMEBACK.END_ACTIVITY, method });
|
|
6851
|
-
}
|
|
6852
|
-
const customRoutesList = customRoutes.map((route) => {
|
|
6853
|
-
const methods = route.methods?.join(", ") || "*";
|
|
6854
|
-
const isCatchAll = /{\.\*}/.test(route.path);
|
|
6855
|
-
return {
|
|
6856
|
-
path: route.path,
|
|
6857
|
-
method: isCatchAll ? `${methods} (catch-all)` : methods
|
|
6858
|
-
};
|
|
6859
|
-
});
|
|
6860
|
-
const allRoutes = [...healthRoutes, ...timebackRoutes, ...customRoutesList];
|
|
6861
|
-
const sortedRoutes = sortRoutes(allRoutes);
|
|
6862
|
-
const maxPathLength = Math.max(...sortedRoutes.map((r) => r.path.length));
|
|
6863
|
-
sortedRoutes.forEach((route) => {
|
|
6864
|
-
const paddedPath = route.path.padEnd(maxPathLength + 2, " ");
|
|
6865
|
-
logger.customRaw(`<${paddedPath}> ${dim4(route.method)}`, 1);
|
|
6866
|
-
});
|
|
6867
6714
|
}
|
|
6868
6715
|
|
|
6869
6716
|
// src/lib/dev/reload.ts
|
|
6870
6717
|
import { join as join20, relative } from "path";
|
|
6871
6718
|
import chokidar from "chokidar";
|
|
6872
|
-
import { bold as
|
|
6719
|
+
import { bold as bold6, cyan as cyan4, dim as dim5, green as green3 } from "colorette";
|
|
6873
6720
|
function formatTime() {
|
|
6874
6721
|
const now = /* @__PURE__ */ new Date();
|
|
6875
6722
|
let hours = now.getHours();
|
|
@@ -6900,8 +6747,8 @@ function startHotReload(onReload, options = {}) {
|
|
|
6900
6747
|
if (changedPath) {
|
|
6901
6748
|
const relativePath = relative(workspace, changedPath);
|
|
6902
6749
|
const timestamp5 = dim5(formatTime());
|
|
6903
|
-
const brand =
|
|
6904
|
-
const event = eventType === "changed" ?
|
|
6750
|
+
const brand = bold6(cyan4("[playcademy]"));
|
|
6751
|
+
const event = eventType === "changed" ? green3("reload") : green3(eventType || "reload");
|
|
6905
6752
|
console.log(`${timestamp5} ${brand} ${event} ${dim5(relativePath)}`);
|
|
6906
6753
|
} else {
|
|
6907
6754
|
logger.success("Reloaded");
|
|
@@ -7028,7 +6875,6 @@ async function registerCustomRoutes(app, routes) {
|
|
|
7028
6875
|
}
|
|
7029
6876
|
|
|
7030
6877
|
// src/lib/dev/server.ts
|
|
7031
|
-
init_src();
|
|
7032
6878
|
import { mkdir as mkdir4 } from "fs/promises";
|
|
7033
6879
|
import { join as join24 } from "path";
|
|
7034
6880
|
import { Log, LogLevel, Miniflare } from "miniflare";
|
|
@@ -7632,7 +7478,7 @@ var FilteredLog = class extends Log {
|
|
|
7632
7478
|
};
|
|
7633
7479
|
async function startDevServer(options) {
|
|
7634
7480
|
const { port, config: _config, platformUrl, logger: logger2 = true, customLogger } = options;
|
|
7635
|
-
await waitForPort(port);
|
|
7481
|
+
await waitForPort(port, 1e3);
|
|
7636
7482
|
const config = _config ?? await loadConfig();
|
|
7637
7483
|
await ensurePlaycademyTypes();
|
|
7638
7484
|
const hasSandboxTimebackCreds = !!process.env.TIMEBACK_API_CLIENT_ID;
|
|
@@ -7788,7 +7634,7 @@ async function loadDeployConfig(configPath) {
|
|
|
7788
7634
|
}
|
|
7789
7635
|
|
|
7790
7636
|
// src/lib/deploy/diff.ts
|
|
7791
|
-
import { dim as dim6, green as
|
|
7637
|
+
import { dim as dim6, green as green4, red as red2 } from "colorette";
|
|
7792
7638
|
function calculateConfigDiff(existingGame, newConfig) {
|
|
7793
7639
|
const diff = {};
|
|
7794
7640
|
if (newConfig.displayName && existingGame.displayName !== newConfig.displayName) {
|
|
@@ -7865,19 +7711,19 @@ function displayDeploymentDiff(options) {
|
|
|
7865
7711
|
if (hasConfigChanges) {
|
|
7866
7712
|
logger.bold("Config", 1);
|
|
7867
7713
|
if (diff.displayName) {
|
|
7868
|
-
const value = `${red2(diff.displayName.old)} \u2192 ${
|
|
7714
|
+
const value = `${red2(diff.displayName.old)} \u2192 ${green4(diff.displayName.new)}`;
|
|
7869
7715
|
logger.data("Name", value, 2);
|
|
7870
7716
|
}
|
|
7871
7717
|
if (diff.emoji) {
|
|
7872
7718
|
const oldEmoji = diff.emoji.old || "(none)";
|
|
7873
7719
|
const newEmoji = diff.emoji.new || "(none)";
|
|
7874
|
-
const value = `${red2(oldEmoji)} \u2192 ${
|
|
7720
|
+
const value = `${red2(oldEmoji)} \u2192 ${green4(newEmoji)}`;
|
|
7875
7721
|
logger.data("Emoji", value, 2);
|
|
7876
7722
|
}
|
|
7877
7723
|
if (diff.description) {
|
|
7878
7724
|
const oldDesc = diff.description.old || "(none)";
|
|
7879
7725
|
const newDesc = diff.description.new || "(none)";
|
|
7880
|
-
const value = `${red2(oldDesc)} \u2192 ${
|
|
7726
|
+
const value = `${red2(oldDesc)} \u2192 ${green4(newDesc)}`;
|
|
7881
7727
|
logger.data("Description", value, 2);
|
|
7882
7728
|
}
|
|
7883
7729
|
logger.newLine();
|
|
@@ -7889,9 +7735,9 @@ function displayDeploymentDiff(options) {
|
|
|
7889
7735
|
if (previousSize !== void 0 && currentSize !== void 0) {
|
|
7890
7736
|
logger.sizeChange("Build", previousSize, currentSize, formatSize, formatDelta, 2);
|
|
7891
7737
|
} else if (currentSize !== void 0) {
|
|
7892
|
-
logger.data("Build",
|
|
7738
|
+
logger.data("Build", green4(formatSize(currentSize)), 2);
|
|
7893
7739
|
} else {
|
|
7894
|
-
logger.data("Build",
|
|
7740
|
+
logger.data("Build", green4("Updated"), 2);
|
|
7895
7741
|
}
|
|
7896
7742
|
logger.newLine();
|
|
7897
7743
|
}
|
|
@@ -7908,7 +7754,7 @@ function displayDeploymentDiff(options) {
|
|
|
7908
7754
|
if (hasRouteChanges) {
|
|
7909
7755
|
const parts = [];
|
|
7910
7756
|
if (backend?.addedRoutes && backend.addedRoutes.length > 0) {
|
|
7911
|
-
parts.push(...backend.addedRoutes.map((r) =>
|
|
7757
|
+
parts.push(...backend.addedRoutes.map((r) => green4(`+${r}`)));
|
|
7912
7758
|
}
|
|
7913
7759
|
if (backend?.removedRoutes && backend.removedRoutes.length > 0) {
|
|
7914
7760
|
parts.push(...backend.removedRoutes.map((r) => red2(`-${r}`)));
|
|
@@ -7935,7 +7781,7 @@ function displayDeploymentDiff(options) {
|
|
|
7935
7781
|
if (schemaStatementCount && schemaStatementCount > 0) {
|
|
7936
7782
|
const parts = [];
|
|
7937
7783
|
parts.push(
|
|
7938
|
-
|
|
7784
|
+
green4(
|
|
7939
7785
|
`+${schemaStatementCount} SQL ${pluralize(schemaStatementCount, "statement")}`
|
|
7940
7786
|
)
|
|
7941
7787
|
);
|
|
@@ -7964,7 +7810,7 @@ function displayDeploymentDiff(options) {
|
|
|
7964
7810
|
if (r === "bucket") return "Bucket";
|
|
7965
7811
|
return r;
|
|
7966
7812
|
});
|
|
7967
|
-
parts.push(...formatted.map((r) =>
|
|
7813
|
+
parts.push(...formatted.map((r) => green4(`+${r}`)));
|
|
7968
7814
|
}
|
|
7969
7815
|
if (backend?.removedResources && backend.removedResources.length > 0) {
|
|
7970
7816
|
const formatted = backend.removedResources.map((r) => {
|
|
@@ -7985,9 +7831,9 @@ function displayDeploymentDiff(options) {
|
|
|
7985
7831
|
} else if (previousSize !== void 0 && currentSize !== void 0) {
|
|
7986
7832
|
logger.sizeChange("Bundle", previousSize, currentSize, formatSize, formatDelta, 2);
|
|
7987
7833
|
} else if (currentSize !== void 0) {
|
|
7988
|
-
logger.data("Bundle",
|
|
7834
|
+
logger.data("Bundle", green4(formatSize(currentSize)), 2);
|
|
7989
7835
|
} else {
|
|
7990
|
-
logger.data("Bundle",
|
|
7836
|
+
logger.data("Bundle", green4("Updated"), 2);
|
|
7991
7837
|
}
|
|
7992
7838
|
}
|
|
7993
7839
|
logger.newLine();
|
|
@@ -7997,7 +7843,7 @@ function displayDeploymentDiff(options) {
|
|
|
7997
7843
|
for (const integration of metadata) {
|
|
7998
7844
|
logger.bold(integration.name, 1);
|
|
7999
7845
|
for (const change of integration.changes) {
|
|
8000
|
-
const value = `${red2(change.current)} \u2192 ${
|
|
7846
|
+
const value = `${red2(change.current)} \u2192 ${green4(change.next)}`;
|
|
8001
7847
|
logger.data(change.label, value, 2);
|
|
8002
7848
|
}
|
|
8003
7849
|
logger.newLine();
|
|
@@ -8010,7 +7856,7 @@ function displayDeploymentDiff(options) {
|
|
|
8010
7856
|
if (comparison.hasChanges) {
|
|
8011
7857
|
logger.bold("Integrations", 1);
|
|
8012
7858
|
if (comparison.added.length > 0) {
|
|
8013
|
-
const addedList = comparison.added.map((k) =>
|
|
7859
|
+
const addedList = comparison.added.map((k) => green4(k)).join(", ");
|
|
8014
7860
|
logger.data("Added", addedList, 2);
|
|
8015
7861
|
}
|
|
8016
7862
|
if (comparison.removed.length > 0) {
|
|
@@ -8029,7 +7875,7 @@ function displayDeploymentDiff(options) {
|
|
|
8029
7875
|
if (hasSecretsChanges) {
|
|
8030
7876
|
logger.bold("Secrets", 1);
|
|
8031
7877
|
if (added.length > 0) {
|
|
8032
|
-
const addedList = added.map((k) =>
|
|
7878
|
+
const addedList = added.map((k) => green4(k)).join(", ");
|
|
8033
7879
|
logger.data("Added", addedList, 2);
|
|
8034
7880
|
}
|
|
8035
7881
|
if (removed.length > 0) {
|
|
@@ -8493,7 +8339,6 @@ async function confirmDeploymentPlan(plan, context2) {
|
|
|
8493
8339
|
}
|
|
8494
8340
|
|
|
8495
8341
|
// src/lib/deploy/output.ts
|
|
8496
|
-
init_src();
|
|
8497
8342
|
import { underline } from "colorette";
|
|
8498
8343
|
function displayCurrentConfiguration(context2) {
|
|
8499
8344
|
const { config } = context2;
|
|
@@ -9466,7 +9311,6 @@ async function bundleStubWorker() {
|
|
|
9466
9311
|
}
|
|
9467
9312
|
|
|
9468
9313
|
// src/lib/deploy/utils.ts
|
|
9469
|
-
init_src();
|
|
9470
9314
|
function getDeploymentId(gameSlug) {
|
|
9471
9315
|
const environment = getEnvironment();
|
|
9472
9316
|
return environment === "production" ? gameSlug : `${WORKER_NAMING.STAGING_PREFIX}${gameSlug}`;
|
|
@@ -10197,7 +10041,7 @@ async function uploadFilesLocal(files, prefix, uploadFn) {
|
|
|
10197
10041
|
}
|
|
10198
10042
|
|
|
10199
10043
|
// src/lib/timeback/display.ts
|
|
10200
|
-
import { bold as
|
|
10044
|
+
import { bold as bold7, greenBright as greenBright2, redBright as redBright2 } from "colorette";
|
|
10201
10045
|
function displayIntegrationDetails(integration) {
|
|
10202
10046
|
logger.highlight("Verified Course");
|
|
10203
10047
|
logger.newLine();
|
|
@@ -10234,9 +10078,9 @@ function displayIntegrationList(integrations, statusByCourseId, options) {
|
|
|
10234
10078
|
if (showStatusColumn) {
|
|
10235
10079
|
if (options?.staticLabel) {
|
|
10236
10080
|
const coloredLabel = options.staticLabelColor ? options.staticLabelColor(options.staticLabel) : greenBright2(options.staticLabel);
|
|
10237
|
-
statusText =
|
|
10081
|
+
statusText = bold7(coloredLabel);
|
|
10238
10082
|
} else if (statusByCourseId && integration.courseId in statusByCourseId) {
|
|
10239
|
-
statusText = statusByCourseId[integration.courseId] ?
|
|
10083
|
+
statusText = statusByCourseId[integration.courseId] ? bold7(greenBright2(successLabel)) : bold7(redBright2(failureLabel));
|
|
10240
10084
|
}
|
|
10241
10085
|
}
|
|
10242
10086
|
const row = {
|
|
@@ -10270,7 +10114,7 @@ function displayCleanupWarning(integrations, gameName, logger2) {
|
|
|
10270
10114
|
}
|
|
10271
10115
|
|
|
10272
10116
|
// src/lib/timeback/setup.ts
|
|
10273
|
-
import { bold as
|
|
10117
|
+
import { bold as bold8 } from "colorette";
|
|
10274
10118
|
function displaySetupDryRun(derivedRequest, env, logger2) {
|
|
10275
10119
|
logger2.highlight("TimeBack Setup [DRY RUN]");
|
|
10276
10120
|
logger2.newLine();
|
|
@@ -10300,7 +10144,7 @@ function displaySetupDryRun(derivedRequest, env, logger2) {
|
|
|
10300
10144
|
logger2.admonition("tip", "Ready for setup", [
|
|
10301
10145
|
"Your Timeback configuration has been validated!",
|
|
10302
10146
|
"",
|
|
10303
|
-
`Run without \`--dry-run\` to create ${
|
|
10147
|
+
`Run without \`--dry-run\` to create ${bold8(`${derivedRequest.courses.length} course(s)`)} in ${bold8(env || "staging")}`
|
|
10304
10148
|
]);
|
|
10305
10149
|
logger2.newLine();
|
|
10306
10150
|
}
|
|
@@ -10817,7 +10661,7 @@ initCommand.addCommand(configCommand);
|
|
|
10817
10661
|
// src/commands/login.ts
|
|
10818
10662
|
import { userInfo } from "os";
|
|
10819
10663
|
import { input as input3, password, select as select4 } from "@inquirer/prompts";
|
|
10820
|
-
import { bold as
|
|
10664
|
+
import { bold as bold9, dim as dim8, whiteBright } from "colorette";
|
|
10821
10665
|
import { Command as Command3 } from "commander";
|
|
10822
10666
|
import open from "open";
|
|
10823
10667
|
var loginCommand = new Command3("login").description("Authenticate with Playcademy").option("-e, --email <email>", "Email address (for email/password auth)").option("-p, --password <password>", "Password (for email/password auth)").option("--sso", "Use Timeback SSO authentication").option("--env <environment>", "Environment to login to (staging or production)").action(async (options) => {
|
|
@@ -10831,12 +10675,12 @@ var loginCommand = new Command3("login").description("Authenticate with Playcade
|
|
|
10831
10675
|
const otherEnv = environment === "staging" ? "production" : "staging";
|
|
10832
10676
|
const otherProfile = await getProfile(otherEnv, profileName);
|
|
10833
10677
|
logger.admonition("note", "Hello again", [
|
|
10834
|
-
|
|
10678
|
+
bold9("You're already logged in"),
|
|
10835
10679
|
"",
|
|
10836
|
-
dim8("Email: ") +
|
|
10837
|
-
dim8("Environment: ") +
|
|
10838
|
-
dim8("Profile: ") +
|
|
10839
|
-
...otherProfile ? [dim8("Other Profile: ") +
|
|
10680
|
+
dim8("Email: ") + bold9(email2),
|
|
10681
|
+
dim8("Environment: ") + bold9(environment),
|
|
10682
|
+
dim8("Profile: ") + bold9(profileName),
|
|
10683
|
+
...otherProfile ? [dim8("Other Profile: ") + bold9(otherEnv)] : []
|
|
10840
10684
|
]);
|
|
10841
10685
|
logger.newLine();
|
|
10842
10686
|
return;
|
|
@@ -10966,7 +10810,7 @@ async function handleSsoLogin(environment, profileName) {
|
|
|
10966
10810
|
logger.admonition("warning", "Your API Key", [
|
|
10967
10811
|
"Save this key securely - it will not be shown again!",
|
|
10968
10812
|
"",
|
|
10969
|
-
whiteBright(
|
|
10813
|
+
whiteBright(bold9(apiKeyResult.apiKey))
|
|
10970
10814
|
]);
|
|
10971
10815
|
logger.newLine();
|
|
10972
10816
|
await runStep(
|
|
@@ -11074,7 +10918,7 @@ var meCommand = new Command5("me").description("Display current user information
|
|
|
11074
10918
|
|
|
11075
10919
|
// src/commands/update.ts
|
|
11076
10920
|
import { execSync as execSync8 } from "child_process";
|
|
11077
|
-
import { bold as
|
|
10921
|
+
import { bold as bold10 } from "colorette";
|
|
11078
10922
|
import { Command as Command6 } from "commander";
|
|
11079
10923
|
var updateCommands = {
|
|
11080
10924
|
bun: "bun install -g playcademy@latest",
|
|
@@ -11088,7 +10932,7 @@ var updateCommand = new Command6("update").description("Update the Playcademy CL
|
|
|
11088
10932
|
const runnerName = getPackageRunnerName(runnerPath);
|
|
11089
10933
|
logger.newLine();
|
|
11090
10934
|
logger.admonition("info", "Package Runner Detected", [
|
|
11091
|
-
`You are running the CLI via package runner (${
|
|
10935
|
+
`You are running the CLI via package runner (${bold10(runnerName)}).`,
|
|
11092
10936
|
"",
|
|
11093
10937
|
"Package runners use the latest version of the CLI by default, but may cache older versions.",
|
|
11094
10938
|
`To ensure you run the package's latest version: \`${runnerName} playcademy@latest\``
|
|
@@ -11422,8 +11266,10 @@ var getStatusCommand = new Command12("status").description("Check your developer
|
|
|
11422
11266
|
}
|
|
11423
11267
|
});
|
|
11424
11268
|
|
|
11269
|
+
// package.json
|
|
11270
|
+
var version2 = "0.14.26";
|
|
11271
|
+
|
|
11425
11272
|
// src/commands/dev/server.ts
|
|
11426
|
-
import { underline as underline2 } from "colorette";
|
|
11427
11273
|
function setupCleanupHandlers(workspace, getServer) {
|
|
11428
11274
|
let isShuttingDown = false;
|
|
11429
11275
|
const cleanup = () => {
|
|
@@ -11462,6 +11308,7 @@ async function setupServerHotReload(serverRef, port, workspace, config, loggerEn
|
|
|
11462
11308
|
}
|
|
11463
11309
|
async function runDevServer(options) {
|
|
11464
11310
|
const serverRef = { current: null };
|
|
11311
|
+
const startTime = Date.now();
|
|
11465
11312
|
try {
|
|
11466
11313
|
const config = await loadConfigAndSetWorkspace();
|
|
11467
11314
|
const workspace = getWorkspace();
|
|
@@ -11486,25 +11333,25 @@ async function runDevServer(options) {
|
|
|
11486
11333
|
logger: options.logger !== false
|
|
11487
11334
|
});
|
|
11488
11335
|
serverRef.current = server;
|
|
11489
|
-
logger.newLine();
|
|
11490
|
-
logger.success(`Project API started: ${underline2(`<http://localhost:${port}/api>`)}`);
|
|
11491
|
-
logger.newLine();
|
|
11492
11336
|
const customRoutesDir = getCustomRoutesDirectory(workspace, config);
|
|
11493
|
-
|
|
11494
|
-
|
|
11495
|
-
|
|
11337
|
+
await discoverRoutes(customRoutesDir);
|
|
11338
|
+
const quiet = options.quiet || process.env.PLAYCADEMY_EMBEDDED === "1";
|
|
11339
|
+
printDevBanner({
|
|
11340
|
+
version: version2,
|
|
11341
|
+
port,
|
|
11342
|
+
startupTimeMs: Date.now() - startTime,
|
|
11343
|
+
quiet
|
|
11344
|
+
});
|
|
11496
11345
|
if (options.reload !== false) {
|
|
11497
11346
|
await setupServerHotReload(serverRef, port, workspace, config, options.logger !== false);
|
|
11498
11347
|
}
|
|
11499
|
-
logger.remark(`Press ${underline2("ctrl+c")} to stop`);
|
|
11500
|
-
logger.newLine();
|
|
11501
11348
|
} catch (error) {
|
|
11502
11349
|
logAndExit(error, { prefix: "Failed to start dev server" });
|
|
11503
11350
|
}
|
|
11504
11351
|
}
|
|
11505
11352
|
|
|
11506
11353
|
// src/commands/dev/index.ts
|
|
11507
|
-
var devCommand = new Command13("dev").description("Start local backend development server").option("-p, --port <port>", "Backend server port", String(DEFAULT_PORTS.BACKEND)).option("--no-reload", "Disable hot reload").option("--no-logger", "Disable HTTP request logging").action(runDevServer);
|
|
11354
|
+
var devCommand = new Command13("dev").description("Start local backend development server").option("-p, --port <port>", "Backend server port", String(DEFAULT_PORTS.BACKEND)).option("--no-reload", "Disable hot reload").option("--no-logger", "Disable HTTP request logging").option("-q, --quiet", "Quiet mode").action(runDevServer);
|
|
11508
11355
|
devCommand.addCommand(applyCommand);
|
|
11509
11356
|
devCommand.addCommand(getStatusCommand);
|
|
11510
11357
|
|
|
@@ -11606,7 +11453,7 @@ import { Command as Command17 } from "commander";
|
|
|
11606
11453
|
init_file_loader();
|
|
11607
11454
|
import { writeFileSync as writeFileSync13 } from "fs";
|
|
11608
11455
|
import { join as join33 } from "path";
|
|
11609
|
-
import { bold as
|
|
11456
|
+
import { bold as bold11 } from "colorette";
|
|
11610
11457
|
import { Command as Command15 } from "commander";
|
|
11611
11458
|
var addAuthCommand = new Command15("add").description("Add an authentication provider to your project").argument("<provider>", "Provider to add: email | github | google").addHelpText(
|
|
11612
11459
|
"after",
|
|
@@ -11674,16 +11521,16 @@ Examples:
|
|
|
11674
11521
|
PLACEHOLDER_GAME_URL
|
|
11675
11522
|
).replace("{provider}", provider);
|
|
11676
11523
|
logger.admonition("tip", "Next Steps", [
|
|
11677
|
-
|
|
11524
|
+
bold11(`1. Add callback URL to your ${providerDisplayName} OAuth app:`),
|
|
11678
11525
|
"",
|
|
11679
11526
|
` <${callbackUrl}>`,
|
|
11680
11527
|
"",
|
|
11681
|
-
|
|
11528
|
+
bold11("2. Add credentials to <.env> (for local development):"),
|
|
11682
11529
|
"",
|
|
11683
11530
|
` \`${provider.toUpperCase()}_CLIENT_ID=[your-id]\``,
|
|
11684
11531
|
` \`${provider.toUpperCase()}_CLIENT_SECRET=[your-secret]\``,
|
|
11685
11532
|
"",
|
|
11686
|
-
|
|
11533
|
+
bold11("3. Set production secrets (for deployment):"),
|
|
11687
11534
|
"",
|
|
11688
11535
|
` \`playcademy secret set ${provider.toUpperCase()}_CLIENT_ID=[your-id]\``,
|
|
11689
11536
|
` \`playcademy secret set ${provider.toUpperCase()}_CLIENT_SECRET=[your-secret]\``
|
|
@@ -11923,7 +11770,7 @@ async function runDbInit() {
|
|
|
11923
11770
|
import { existsSync as existsSync23 } from "fs";
|
|
11924
11771
|
import { join as join34 } from "path";
|
|
11925
11772
|
import { confirm as confirm8, input as input7 } from "@inquirer/prompts";
|
|
11926
|
-
import { bold as
|
|
11773
|
+
import { bold as bold12, redBright as redBright4, underline as underline2 } from "colorette";
|
|
11927
11774
|
import { Miniflare as Miniflare2 } from "miniflare";
|
|
11928
11775
|
async function runDbResetRemote(options) {
|
|
11929
11776
|
const environment = ensureEnvironment(options.env);
|
|
@@ -11941,9 +11788,9 @@ async function runDbResetRemote(options) {
|
|
|
11941
11788
|
const game = await client.games.fetch(deployedGame.gameId);
|
|
11942
11789
|
logger.newLine();
|
|
11943
11790
|
logger.admonition("warning", "DESTRUCTIVE OPERATION", [
|
|
11944
|
-
`Are you sure you want to ${redBright4(
|
|
11791
|
+
`Are you sure you want to ${redBright4(underline2(bold12("DELETE ALL DATA")))} in your ${environment} database?`,
|
|
11945
11792
|
`All tables will be dropped and recreated from schema.`,
|
|
11946
|
-
`This action is irreversible and ${
|
|
11793
|
+
`This action is irreversible and ${underline2(bold12("cannot be undone"))}.`
|
|
11947
11794
|
]);
|
|
11948
11795
|
logger.newLine();
|
|
11949
11796
|
const confirmed = await confirm8({
|
|
@@ -12064,7 +11911,7 @@ async function runDbReset(options = {}) {
|
|
|
12064
11911
|
import { existsSync as existsSync24 } from "fs";
|
|
12065
11912
|
import { join as join35 } from "path";
|
|
12066
11913
|
import { confirm as confirm9, input as input8 } from "@inquirer/prompts";
|
|
12067
|
-
import { bold as
|
|
11914
|
+
import { bold as bold13, redBright as redBright5, underline as underline3 } from "colorette";
|
|
12068
11915
|
import { Miniflare as Miniflare3 } from "miniflare";
|
|
12069
11916
|
async function runDbResetRemote2(gameSlug, environment) {
|
|
12070
11917
|
const client = await requireAuthenticatedClient();
|
|
@@ -12108,8 +11955,8 @@ async function runDbSeedRemote(seedFile, options) {
|
|
|
12108
11955
|
logger.newLine();
|
|
12109
11956
|
if (willReset) {
|
|
12110
11957
|
logger.admonition("warning", "Remote Database Seeding", [
|
|
12111
|
-
`Are you sure you want to ${redBright5(
|
|
12112
|
-
`This action is irreversible and ${
|
|
11958
|
+
`Are you sure you want to ${redBright5(underline3(bold13("DELETE ALL DATA")))} in your ${environment} database?`,
|
|
11959
|
+
`This action is irreversible and ${underline3(bold13("cannot be undone"))}.`,
|
|
12113
11960
|
`Run this command with \`--no-reset\` if you want to seed without resetting.`
|
|
12114
11961
|
]);
|
|
12115
11962
|
} else {
|
|
@@ -14079,7 +13926,7 @@ bucketCommand.command("bulk <directory>").description(
|
|
|
14079
13926
|
import { Command as Command21 } from "commander";
|
|
14080
13927
|
|
|
14081
13928
|
// src/commands/domain/add.ts
|
|
14082
|
-
import { underline as
|
|
13929
|
+
import { underline as underline4 } from "colorette";
|
|
14083
13930
|
async function runDomainAdd(hostname, options) {
|
|
14084
13931
|
try {
|
|
14085
13932
|
logger.newLine();
|
|
@@ -14105,7 +13952,7 @@ async function runDomainAdd(hostname, options) {
|
|
|
14105
13952
|
async () => {
|
|
14106
13953
|
return client.dev.games.domains.add(slug, normalizedHostname);
|
|
14107
13954
|
},
|
|
14108
|
-
(domain2) => `Custom domain added: ${
|
|
13955
|
+
(domain2) => `Custom domain added: ${underline4(`<https://${domain2.hostname}>`)}`
|
|
14109
13956
|
);
|
|
14110
13957
|
logger.newLine();
|
|
14111
13958
|
displayDomainValidationRecords(domain, normalizedHostname);
|
|
@@ -14220,7 +14067,7 @@ async function runDomainList(options) {
|
|
|
14220
14067
|
}
|
|
14221
14068
|
|
|
14222
14069
|
// src/commands/domain/verify.ts
|
|
14223
|
-
import { underline as
|
|
14070
|
+
import { underline as underline5 } from "colorette";
|
|
14224
14071
|
async function runDomainVerify(hostname, options) {
|
|
14225
14072
|
try {
|
|
14226
14073
|
if (!options.json) {
|
|
@@ -14247,7 +14094,7 @@ async function runDomainVerify(hostname, options) {
|
|
|
14247
14094
|
displayDomainStatus(hostname, domain);
|
|
14248
14095
|
if (domain.status === "active" && domain.sslStatus === "active") {
|
|
14249
14096
|
logger.admonition("info", "Domain Active", [
|
|
14250
|
-
`Your game is now accessible at: ${
|
|
14097
|
+
`Your game is now accessible at: ${underline5(`<https://${hostname}>`)}`
|
|
14251
14098
|
]);
|
|
14252
14099
|
logger.newLine();
|
|
14253
14100
|
} else if (domain.status === "pending" || domain.status === "pending_validation" || domain.sslStatus === "pending_validation") {
|
|
@@ -14504,7 +14351,7 @@ async function listProfilesAction() {
|
|
|
14504
14351
|
var listCommand3 = new Command27("list").alias("ls").description("List all stored authentication profiles").action(listProfilesAction);
|
|
14505
14352
|
|
|
14506
14353
|
// src/commands/profiles/remove.ts
|
|
14507
|
-
import { bold as
|
|
14354
|
+
import { bold as bold14 } from "colorette";
|
|
14508
14355
|
import { Command as Command28 } from "commander";
|
|
14509
14356
|
var removeCommand = new Command28("remove").alias("rm").description('Remove an authentication profile (defaults to "default")').argument("[name]", "Profile name to remove", "default").option("--env <environment>", "Environment to remove profile from (staging or production)").action(async (name, options) => {
|
|
14510
14357
|
const { env } = options;
|
|
@@ -14520,7 +14367,7 @@ var removeCommand = new Command28("remove").alias("rm").description('Remove an a
|
|
|
14520
14367
|
}
|
|
14521
14368
|
await removeProfile(environment, name);
|
|
14522
14369
|
logger.admonition("note", "Removed!", [
|
|
14523
|
-
`Profile ${
|
|
14370
|
+
`Profile ${bold14(name)} removed from ${environment}`,
|
|
14524
14371
|
environment === "production" ? `To re-authenticate run \`playcademy login --env ${environment}\`` : "To re-authenticate run `playcademy login`"
|
|
14525
14372
|
]);
|
|
14526
14373
|
logger.newLine();
|
|
@@ -14665,6 +14512,7 @@ var cleanupCommand = new Command31("cleanup").description("Remove TimeBack integ
|
|
|
14665
14512
|
logger.newLine();
|
|
14666
14513
|
} catch (error) {
|
|
14667
14514
|
logger.error(`Cleanup failed: ${getErrorMessage(error)}`);
|
|
14515
|
+
logger.newLine();
|
|
14668
14516
|
process.exit(1);
|
|
14669
14517
|
}
|
|
14670
14518
|
});
|
|
@@ -15001,7 +14849,7 @@ import { Command as Command39 } from "commander";
|
|
|
15001
14849
|
// src/commands/vite/init.ts
|
|
15002
14850
|
import path3 from "node:path";
|
|
15003
14851
|
import { confirm as confirm17 } from "@inquirer/prompts";
|
|
15004
|
-
import { dim as dim9, underline as
|
|
14852
|
+
import { dim as dim9, underline as underline6 } from "colorette";
|
|
15005
14853
|
async function runViteInit() {
|
|
15006
14854
|
try {
|
|
15007
14855
|
logger.newLine();
|
|
@@ -15047,7 +14895,7 @@ async function runViteInit() {
|
|
|
15047
14895
|
`2. Run \`${devCommand2}\` to start development`,
|
|
15048
14896
|
`3. Run \`${buildCommand}\` to build your project`,
|
|
15049
14897
|
"",
|
|
15050
|
-
`Learn more: ${
|
|
14898
|
+
`Learn more: ${underline6("<https://docs.playcademy.gg/vite-plugin>")}`
|
|
15051
14899
|
]);
|
|
15052
14900
|
logger.newLine();
|
|
15053
14901
|
} catch (error) {
|
|
@@ -15130,7 +14978,6 @@ export {
|
|
|
15130
14978
|
displayIntegrationDetails,
|
|
15131
14979
|
displayIntegrationList,
|
|
15132
14980
|
displayMissingCourseRequirementsAndExit,
|
|
15133
|
-
displayRegisteredRoutes,
|
|
15134
14981
|
displayResourcesStatus,
|
|
15135
14982
|
displaySetupDryRun,
|
|
15136
14983
|
displaySuccessMessage,
|
|
@@ -15229,6 +15076,7 @@ export {
|
|
|
15229
15076
|
outputUploadResults,
|
|
15230
15077
|
prepareDeploymentContext,
|
|
15231
15078
|
printDebugInfo,
|
|
15079
|
+
printDevBanner,
|
|
15232
15080
|
processConfigVariables,
|
|
15233
15081
|
promptForAuthStrategies,
|
|
15234
15082
|
promptForCustomRoutes,
|
package/dist/utils.js
CHANGED
|
@@ -3989,10 +3989,10 @@ var protectedRouteTemplate = loadTemplateString("api/sample-protected.ts");
|
|
|
3989
3989
|
import { existsSync as existsSync7, mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
3990
3990
|
import { join as join12 } from "path";
|
|
3991
3991
|
|
|
3992
|
-
// package.json
|
|
3992
|
+
// package.json with { type: 'json' }
|
|
3993
3993
|
var package_default2 = {
|
|
3994
3994
|
name: "playcademy",
|
|
3995
|
-
version: "0.14.
|
|
3995
|
+
version: "0.14.26",
|
|
3996
3996
|
type: "module",
|
|
3997
3997
|
exports: {
|
|
3998
3998
|
".": {
|
|
@@ -4376,7 +4376,7 @@ var FilteredLog = class extends Log {
|
|
|
4376
4376
|
};
|
|
4377
4377
|
async function startDevServer(options) {
|
|
4378
4378
|
const { port, config: _config, platformUrl, logger: logger2 = true, customLogger } = options;
|
|
4379
|
-
await waitForPort(port);
|
|
4379
|
+
await waitForPort(port, 1e3);
|
|
4380
4380
|
const config = _config ?? await loadConfig();
|
|
4381
4381
|
await ensurePlaycademyTypes();
|
|
4382
4382
|
const hasSandboxTimebackCreds = !!process.env.TIMEBACK_API_CLIENT_ID;
|
package/dist/version.js
CHANGED