@playcademy/sandbox 0.3.0 → 0.3.2
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 +16 -19
- 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.2",
|
|
136018
136018
|
description: "Local development server for Playcademy game development",
|
|
136019
136019
|
type: "module",
|
|
136020
136020
|
exports: {
|
|
@@ -171705,22 +171705,20 @@ 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, quiet } = 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())}/`)}`);
|
|
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}`)}`);
|
|
171717
171716
|
}
|
|
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)}`);
|
|
171720
|
-
}
|
|
171721
|
-
console.log("");
|
|
171722
|
-
console.log(` ${import_picocolors.default.dim("Press")} ${import_picocolors.default.bold("Ctrl+C")} ${import_picocolors.default.dim("to stop the server")}`);
|
|
171723
171717
|
console.log("");
|
|
171718
|
+
if (!quiet) {
|
|
171719
|
+
console.log(` ${import_picocolors.default.dim("Press")} ${import_picocolors.default.bold("Ctrl+C")} ${import_picocolors.default.dim("to stop the server")}`);
|
|
171720
|
+
console.log("");
|
|
171721
|
+
}
|
|
171724
171722
|
}
|
|
171725
171723
|
|
|
171726
171724
|
// src/cli/options.ts
|
|
@@ -171906,9 +171904,6 @@ async function parseProjectInfo(options) {
|
|
|
171906
171904
|
}
|
|
171907
171905
|
const config2 = await loadPlaycademyConfig(options.configPath);
|
|
171908
171906
|
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
171907
|
return {
|
|
171913
171908
|
slug: options.projectSlug,
|
|
171914
171909
|
displayName: options.projectName,
|
|
@@ -171940,8 +171935,9 @@ function parseTimebackOptions(options) {
|
|
|
171940
171935
|
|
|
171941
171936
|
// src/cli/index.ts
|
|
171942
171937
|
var program2 = new Command;
|
|
171943
|
-
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) => {
|
|
171938
|
+
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").option("-q, --quiet", "Quiet mode (suppress interactive messages)", false).action(async (options) => {
|
|
171944
171939
|
try {
|
|
171940
|
+
const startTime = Date.now();
|
|
171945
171941
|
const port = parseInt(options.port);
|
|
171946
171942
|
const realtimePort = options.realtimePort ? parseInt(options.realtimePort) : port + 1;
|
|
171947
171943
|
await requirePortAvailable(port);
|
|
@@ -171972,8 +171968,9 @@ program2.name("playcademy-sandbox").description("Local development server for Pl
|
|
|
171972
171968
|
printBanner({
|
|
171973
171969
|
version: version3,
|
|
171974
171970
|
port,
|
|
171975
|
-
|
|
171976
|
-
|
|
171971
|
+
startupTimeMs: Date.now() - startTime,
|
|
171972
|
+
timebackCourseCount: project?.timebackCourses?.length,
|
|
171973
|
+
quiet: options.quiet
|
|
171977
171974
|
});
|
|
171978
171975
|
const cleanup = () => {
|
|
171979
171976
|
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.2",
|
|
134108
134108
|
description: "Local development server for Playcademy game development",
|
|
134109
134109
|
type: "module",
|
|
134110
134110
|
exports: {
|