@playcademy/sandbox 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +10 -16
- package/dist/server.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -136014,7 +136014,7 @@ async function requirePortAvailable(port, timeoutMs = 100) {
|
|
|
136014
136014
|
// package.json
|
|
136015
136015
|
var package_default = {
|
|
136016
136016
|
name: "@playcademy/sandbox",
|
|
136017
|
-
version: "0.3.
|
|
136017
|
+
version: "0.3.1",
|
|
136018
136018
|
description: "Local development server for Playcademy game development",
|
|
136019
136019
|
type: "module",
|
|
136020
136020
|
exports: {
|
|
@@ -171705,18 +171705,14 @@ var {
|
|
|
171705
171705
|
// src/cli/display.ts
|
|
171706
171706
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
171707
171707
|
function printBanner(options) {
|
|
171708
|
-
const { version: version4, port,
|
|
171708
|
+
const { version: version4, port, startupTimeMs, timebackCourseCount } = options;
|
|
171709
171709
|
console.log("");
|
|
171710
|
-
console.log(` ${import_picocolors.default.green(import_picocolors.default.bold("PLAYCADEMY"))} ${import_picocolors.default.green(`v${version4}`)}`);
|
|
171710
|
+
console.log(` ${import_picocolors.default.green(import_picocolors.default.bold("PLAYCADEMY"))} ${import_picocolors.default.green(`v${version4}`)} ${import_picocolors.default.dim(`ready in ${import_picocolors.default.bold(startupTimeMs.toString())} ms`)}`);
|
|
171711
171711
|
console.log("");
|
|
171712
|
-
console.log(` ${import_picocolors.default.green("➜")} ${import_picocolors.default.bold("
|
|
171713
|
-
|
|
171714
|
-
|
|
171715
|
-
|
|
171716
|
-
console.log(` ${import_picocolors.default.green("➜")} ${import_picocolors.default.bold("Realtime:")} ${import_picocolors.default.cyan(`ws://localhost:${import_picocolors.default.bold(realtimePort.toString())}/`)}`);
|
|
171717
|
-
}
|
|
171718
|
-
if (config.timeback.mode !== "disabled") {
|
|
171719
|
-
console.log(` ${import_picocolors.default.green("➜")} ${import_picocolors.default.bold("Timeback:")} ${import_picocolors.default.cyan(config.timeback.mode)}`);
|
|
171712
|
+
console.log(` ${import_picocolors.default.green("➜")} ${import_picocolors.default.bold("Server:")} ${import_picocolors.default.cyan(`http://localhost:${import_picocolors.default.bold(port.toString())}/api`)}`);
|
|
171713
|
+
if (timebackCourseCount && timebackCourseCount > 0) {
|
|
171714
|
+
const courseText = timebackCourseCount === 1 ? "course" : "courses";
|
|
171715
|
+
console.log(` ${import_picocolors.default.green("➜")} ${import_picocolors.default.bold("Timeback:")} ${import_picocolors.default.cyan(`${timebackCourseCount} ${courseText}`)}`);
|
|
171720
171716
|
}
|
|
171721
171717
|
console.log("");
|
|
171722
171718
|
console.log(` ${import_picocolors.default.dim("Press")} ${import_picocolors.default.bold("Ctrl+C")} ${import_picocolors.default.dim("to stop the server")}`);
|
|
@@ -171906,9 +171902,6 @@ async function parseProjectInfo(options) {
|
|
|
171906
171902
|
}
|
|
171907
171903
|
const config2 = await loadPlaycademyConfig(options.configPath);
|
|
171908
171904
|
const timebackCourses = config2 ? extractTimebackCourses(config2) : undefined;
|
|
171909
|
-
if (timebackCourses && timebackCourses.length > 0) {
|
|
171910
|
-
console.log(`[Sandbox] Found ${timebackCourses.length} TimeBack course(s) in config`);
|
|
171911
|
-
}
|
|
171912
171905
|
return {
|
|
171913
171906
|
slug: options.projectSlug,
|
|
171914
171907
|
displayName: options.projectName,
|
|
@@ -171942,6 +171935,7 @@ function parseTimebackOptions(options) {
|
|
|
171942
171935
|
var program2 = new Command;
|
|
171943
171936
|
program2.name("playcademy-sandbox").description("Local development server for Playcademy game development").version(version3).option("-p, --port <number>", "Port to run the server on", "4321").option("-v, --verbose", "Enable verbose logging", false).option("--project-name <name>", "Name of the current project").option("--project-slug <slug>", "Slug of the current project").option("--realtime", "Enable the realtime server", false).option("--realtime-port <number>", "Port for the realtime server (defaults to main port + 1)").option("--no-seed", "Do not seed the database with demo data").option("--recreate-db", "Recreate the on-disk database on start", false).option("--memory", "Use in-memory database (no persistence)", false).option("--db-path <path>", "Custom path for the database file (relative to cwd or absolute)").option("--config-path <path>", "Path to playcademy.config.json (defaults to cwd)").option("--timeback-local", "Use local TimeBack instance").option("--timeback-oneroster-url <url>", "TimeBack OneRoster API URL").option("--timeback-caliper-url <url>", "TimeBack Caliper API URL").option("--timeback-course-id <id>", "TimeBack course ID for seeding").option("--timeback-student-id <id>", "TimeBack student ID for demo user").action(async (options) => {
|
|
171944
171937
|
try {
|
|
171938
|
+
const startTime = Date.now();
|
|
171945
171939
|
const port = parseInt(options.port);
|
|
171946
171940
|
const realtimePort = options.realtimePort ? parseInt(options.realtimePort) : port + 1;
|
|
171947
171941
|
await requirePortAvailable(port);
|
|
@@ -171972,8 +171966,8 @@ program2.name("playcademy-sandbox").description("Local development server for Pl
|
|
|
171972
171966
|
printBanner({
|
|
171973
171967
|
version: version3,
|
|
171974
171968
|
port,
|
|
171975
|
-
|
|
171976
|
-
|
|
171969
|
+
startupTimeMs: Date.now() - startTime,
|
|
171970
|
+
timebackCourseCount: project?.timebackCourses?.length
|
|
171977
171971
|
});
|
|
171978
171972
|
const cleanup = () => {
|
|
171979
171973
|
cleanupServerInfo("sandbox", process.cwd(), process.pid);
|
package/dist/server.js
CHANGED
|
@@ -134104,7 +134104,7 @@ async function requirePortAvailable(port, timeoutMs = 100) {
|
|
|
134104
134104
|
// package.json
|
|
134105
134105
|
var package_default = {
|
|
134106
134106
|
name: "@playcademy/sandbox",
|
|
134107
|
-
version: "0.3.
|
|
134107
|
+
version: "0.3.1",
|
|
134108
134108
|
description: "Local development server for Playcademy game development",
|
|
134109
134109
|
type: "module",
|
|
134110
134110
|
exports: {
|