@playcademy/sandbox 0.1.4 → 0.1.6
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 +8 -8
- package/dist/server.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -83909,7 +83909,7 @@ var logger = (fn = console.log) => {
|
|
|
83909
83909
|
// package.json
|
|
83910
83910
|
var package_default = {
|
|
83911
83911
|
name: "@playcademy/sandbox",
|
|
83912
|
-
version: "0.1.
|
|
83912
|
+
version: "0.1.5",
|
|
83913
83913
|
description: "Local development server for Playcademy game development",
|
|
83914
83914
|
type: "module",
|
|
83915
83915
|
exports: {
|
|
@@ -129508,9 +129508,12 @@ async function isPortAvailableOnHost(port, host) {
|
|
|
129508
129508
|
});
|
|
129509
129509
|
}
|
|
129510
129510
|
async function findAvailablePort(startPort = 4321) {
|
|
129511
|
-
const ipv4AllAvailable = await
|
|
129512
|
-
|
|
129513
|
-
|
|
129511
|
+
const [localhostAvailable, ipv4AllAvailable, ipv6AllAvailable] = await Promise.all([
|
|
129512
|
+
isPortAvailableOnHost(startPort, "127.0.0.1"),
|
|
129513
|
+
isPortAvailableOnHost(startPort, "0.0.0.0"),
|
|
129514
|
+
isPortAvailableOnHost(startPort, "::")
|
|
129515
|
+
]);
|
|
129516
|
+
if (localhostAvailable && ipv4AllAvailable && ipv6AllAvailable) {
|
|
129514
129517
|
return startPort;
|
|
129515
129518
|
}
|
|
129516
129519
|
return findAvailablePort(startPort + 1);
|
|
@@ -129575,14 +129578,11 @@ function cleanupServerInfo(type, projectRoot, pid) {
|
|
|
129575
129578
|
|
|
129576
129579
|
// src/cli.ts
|
|
129577
129580
|
var program2 = new Command;
|
|
129578
|
-
program2.name("playcademy-sandbox").description("Local development server for Playcademy game development").version(
|
|
129581
|
+
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("--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) => {
|
|
129579
129582
|
try {
|
|
129580
129583
|
const requestedPort = parseInt(options.port);
|
|
129581
|
-
console.log(`[sandbox-cli] Requested port: ${requestedPort}`);
|
|
129582
129584
|
const availablePort = await findAvailablePort(requestedPort);
|
|
129583
|
-
console.log(`[sandbox-cli] Found available port: ${availablePort}`);
|
|
129584
129585
|
const realtimePort = options.realtimePort ? parseInt(options.realtimePort) : availablePort + 1;
|
|
129585
|
-
console.log(`[sandbox-cli] Using ports - main: ${availablePort}, realtime: ${realtimePort}`);
|
|
129586
129586
|
const project = options.projectName && options.projectSlug ? {
|
|
129587
129587
|
slug: options.projectSlug,
|
|
129588
129588
|
displayName: options.projectName,
|
package/dist/server.js
CHANGED
|
@@ -81999,7 +81999,7 @@ var logger = (fn = console.log) => {
|
|
|
81999
81999
|
// package.json
|
|
82000
82000
|
var package_default = {
|
|
82001
82001
|
name: "@playcademy/sandbox",
|
|
82002
|
-
version: "0.1.
|
|
82002
|
+
version: "0.1.5",
|
|
82003
82003
|
description: "Local development server for Playcademy game development",
|
|
82004
82004
|
type: "module",
|
|
82005
82005
|
exports: {
|