@playcademy/sandbox 0.1.0-beta.13 → 0.1.0-beta.14
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 +19 -49
- package/dist/server.js +5 -35
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -49969,8 +49969,8 @@ var require_suggestSimilar = __commonJS((exports) => {
|
|
|
49969
49969
|
var require_command = __commonJS((exports) => {
|
|
49970
49970
|
var EventEmitter = __require("node:events").EventEmitter;
|
|
49971
49971
|
var childProcess = __require("node:child_process");
|
|
49972
|
-
var
|
|
49973
|
-
var
|
|
49972
|
+
var path2 = __require("node:path");
|
|
49973
|
+
var fs3 = __require("node:fs");
|
|
49974
49974
|
var process3 = __require("node:process");
|
|
49975
49975
|
var { Argument, humanReadableArgName } = require_argument();
|
|
49976
49976
|
var { CommanderError } = require_error();
|
|
@@ -50463,12 +50463,12 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
50463
50463
|
let launchWithNode = false;
|
|
50464
50464
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
50465
50465
|
function findFile(baseDir, baseName) {
|
|
50466
|
-
const localBin =
|
|
50467
|
-
if (
|
|
50466
|
+
const localBin = path2.resolve(baseDir, baseName);
|
|
50467
|
+
if (fs3.existsSync(localBin))
|
|
50468
50468
|
return localBin;
|
|
50469
|
-
if (sourceExt.includes(
|
|
50469
|
+
if (sourceExt.includes(path2.extname(baseName)))
|
|
50470
50470
|
return;
|
|
50471
|
-
const foundExt = sourceExt.find((ext2) =>
|
|
50471
|
+
const foundExt = sourceExt.find((ext2) => fs3.existsSync(`${localBin}${ext2}`));
|
|
50472
50472
|
if (foundExt)
|
|
50473
50473
|
return `${localBin}${foundExt}`;
|
|
50474
50474
|
return;
|
|
@@ -50480,23 +50480,23 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
50480
50480
|
if (this._scriptPath) {
|
|
50481
50481
|
let resolvedScriptPath;
|
|
50482
50482
|
try {
|
|
50483
|
-
resolvedScriptPath =
|
|
50483
|
+
resolvedScriptPath = fs3.realpathSync(this._scriptPath);
|
|
50484
50484
|
} catch (err2) {
|
|
50485
50485
|
resolvedScriptPath = this._scriptPath;
|
|
50486
50486
|
}
|
|
50487
|
-
executableDir =
|
|
50487
|
+
executableDir = path2.resolve(path2.dirname(resolvedScriptPath), executableDir);
|
|
50488
50488
|
}
|
|
50489
50489
|
if (executableDir) {
|
|
50490
50490
|
let localFile = findFile(executableDir, executableFile);
|
|
50491
50491
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
50492
|
-
const legacyName =
|
|
50492
|
+
const legacyName = path2.basename(this._scriptPath, path2.extname(this._scriptPath));
|
|
50493
50493
|
if (legacyName !== this._name) {
|
|
50494
50494
|
localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`);
|
|
50495
50495
|
}
|
|
50496
50496
|
}
|
|
50497
50497
|
executableFile = localFile || executableFile;
|
|
50498
50498
|
}
|
|
50499
|
-
launchWithNode = sourceExt.includes(
|
|
50499
|
+
launchWithNode = sourceExt.includes(path2.extname(executableFile));
|
|
50500
50500
|
let proc;
|
|
50501
50501
|
if (process3.platform !== "win32") {
|
|
50502
50502
|
if (launchWithNode) {
|
|
@@ -51062,13 +51062,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
51062
51062
|
return this;
|
|
51063
51063
|
}
|
|
51064
51064
|
nameFromFilename(filename) {
|
|
51065
|
-
this._name =
|
|
51065
|
+
this._name = path2.basename(filename, path2.extname(filename));
|
|
51066
51066
|
return this;
|
|
51067
51067
|
}
|
|
51068
|
-
executableDir(
|
|
51069
|
-
if (
|
|
51068
|
+
executableDir(path3) {
|
|
51069
|
+
if (path3 === undefined)
|
|
51070
51070
|
return this._executableDir;
|
|
51071
|
-
this._executableDir =
|
|
51071
|
+
this._executableDir = path3;
|
|
51072
51072
|
return this;
|
|
51073
51073
|
}
|
|
51074
51074
|
helpInformation(contextOptions) {
|
|
@@ -53377,7 +53377,7 @@ var logger = (fn = console.log) => {
|
|
|
53377
53377
|
// package.json
|
|
53378
53378
|
var package_default = {
|
|
53379
53379
|
name: "@playcademy/sandbox",
|
|
53380
|
-
version: "0.1.0-beta.
|
|
53380
|
+
version: "0.1.0-beta.13",
|
|
53381
53381
|
description: "Local development server for Playcademy game development",
|
|
53382
53382
|
type: "module",
|
|
53383
53383
|
exports: {
|
|
@@ -66822,6 +66822,10 @@ async function startRealtimeServer(realtimeOptions, betterAuthSecret) {
|
|
|
66822
66822
|
if (!realtimeOptions.enabled) {
|
|
66823
66823
|
return null;
|
|
66824
66824
|
}
|
|
66825
|
+
if (typeof Bun === "undefined") {
|
|
66826
|
+
console.warn("[sandbox] Bun runtime not detected – realtime server disabled.");
|
|
66827
|
+
return null;
|
|
66828
|
+
}
|
|
66825
66829
|
try {
|
|
66826
66830
|
return await createRealtimeServer({
|
|
66827
66831
|
port: realtimeOptions.port,
|
|
@@ -73127,40 +73131,6 @@ async function saveGameState(ctx) {
|
|
|
73127
73131
|
}
|
|
73128
73132
|
}
|
|
73129
73133
|
|
|
73130
|
-
// ../utils/src/path.ts
|
|
73131
|
-
import fs3 from "node:fs";
|
|
73132
|
-
import path2 from "node:path";
|
|
73133
|
-
function findMonorepoRootInternal(startDir) {
|
|
73134
|
-
let currentDir = startDir;
|
|
73135
|
-
while (true) {
|
|
73136
|
-
const packageJsonPath = path2.join(currentDir, "package.json");
|
|
73137
|
-
if (fs3.existsSync(packageJsonPath)) {
|
|
73138
|
-
try {
|
|
73139
|
-
const packageJsonContent = fs3.readFileSync(packageJsonPath, "utf-8");
|
|
73140
|
-
const packageJson = JSON.parse(packageJsonContent);
|
|
73141
|
-
if (packageJson && typeof packageJson === "object" && "workspaces" in packageJson) {
|
|
73142
|
-
return currentDir;
|
|
73143
|
-
}
|
|
73144
|
-
} catch (parseError) {
|
|
73145
|
-
log2.warn(`[utils/paths] Error parsing ${packageJsonPath}:`, {
|
|
73146
|
-
error: parseError
|
|
73147
|
-
});
|
|
73148
|
-
}
|
|
73149
|
-
}
|
|
73150
|
-
const parentDir = path2.dirname(currentDir);
|
|
73151
|
-
if (parentDir === currentDir) {
|
|
73152
|
-
throw new Error("Could not find monorepo root (package.json with workspaces) starting from " + startDir);
|
|
73153
|
-
}
|
|
73154
|
-
currentDir = parentDir;
|
|
73155
|
-
}
|
|
73156
|
-
}
|
|
73157
|
-
var determinedRoot;
|
|
73158
|
-
try {
|
|
73159
|
-
determinedRoot = findMonorepoRootInternal(process.cwd());
|
|
73160
|
-
} catch (error2) {
|
|
73161
|
-
determinedRoot = process.cwd();
|
|
73162
|
-
log2.warn("[utils/paths] Could not locate monorepo root via workspace package.json scan. " + "Falling back to process.cwd() (", { root: determinedRoot, error: error2 });
|
|
73163
|
-
}
|
|
73164
73134
|
// ../utils/src/uuid.ts
|
|
73165
73135
|
var UUID_REGEX = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
73166
73136
|
function isValidUUID(value) {
|
package/dist/server.js
CHANGED
|
@@ -51467,7 +51467,7 @@ var logger = (fn = console.log) => {
|
|
|
51467
51467
|
// package.json
|
|
51468
51468
|
var package_default = {
|
|
51469
51469
|
name: "@playcademy/sandbox",
|
|
51470
|
-
version: "0.1.0-beta.
|
|
51470
|
+
version: "0.1.0-beta.13",
|
|
51471
51471
|
description: "Local development server for Playcademy game development",
|
|
51472
51472
|
type: "module",
|
|
51473
51473
|
exports: {
|
|
@@ -64912,6 +64912,10 @@ async function startRealtimeServer(realtimeOptions, betterAuthSecret) {
|
|
|
64912
64912
|
if (!realtimeOptions.enabled) {
|
|
64913
64913
|
return null;
|
|
64914
64914
|
}
|
|
64915
|
+
if (typeof Bun === "undefined") {
|
|
64916
|
+
console.warn("[sandbox] Bun runtime not detected – realtime server disabled.");
|
|
64917
|
+
return null;
|
|
64918
|
+
}
|
|
64915
64919
|
try {
|
|
64916
64920
|
return await createRealtimeServer({
|
|
64917
64921
|
port: realtimeOptions.port,
|
|
@@ -71217,40 +71221,6 @@ async function saveGameState(ctx) {
|
|
|
71217
71221
|
}
|
|
71218
71222
|
}
|
|
71219
71223
|
|
|
71220
|
-
// ../utils/src/path.ts
|
|
71221
|
-
import fs3 from "node:fs";
|
|
71222
|
-
import path2 from "node:path";
|
|
71223
|
-
function findMonorepoRootInternal(startDir) {
|
|
71224
|
-
let currentDir = startDir;
|
|
71225
|
-
while (true) {
|
|
71226
|
-
const packageJsonPath = path2.join(currentDir, "package.json");
|
|
71227
|
-
if (fs3.existsSync(packageJsonPath)) {
|
|
71228
|
-
try {
|
|
71229
|
-
const packageJsonContent = fs3.readFileSync(packageJsonPath, "utf-8");
|
|
71230
|
-
const packageJson = JSON.parse(packageJsonContent);
|
|
71231
|
-
if (packageJson && typeof packageJson === "object" && "workspaces" in packageJson) {
|
|
71232
|
-
return currentDir;
|
|
71233
|
-
}
|
|
71234
|
-
} catch (parseError) {
|
|
71235
|
-
log2.warn(`[utils/paths] Error parsing ${packageJsonPath}:`, {
|
|
71236
|
-
error: parseError
|
|
71237
|
-
});
|
|
71238
|
-
}
|
|
71239
|
-
}
|
|
71240
|
-
const parentDir = path2.dirname(currentDir);
|
|
71241
|
-
if (parentDir === currentDir) {
|
|
71242
|
-
throw new Error("Could not find monorepo root (package.json with workspaces) starting from " + startDir);
|
|
71243
|
-
}
|
|
71244
|
-
currentDir = parentDir;
|
|
71245
|
-
}
|
|
71246
|
-
}
|
|
71247
|
-
var determinedRoot;
|
|
71248
|
-
try {
|
|
71249
|
-
determinedRoot = findMonorepoRootInternal(process.cwd());
|
|
71250
|
-
} catch (error2) {
|
|
71251
|
-
determinedRoot = process.cwd();
|
|
71252
|
-
log2.warn("[utils/paths] Could not locate monorepo root via workspace package.json scan. " + "Falling back to process.cwd() (", { root: determinedRoot, error: error2 });
|
|
71253
|
-
}
|
|
71254
71224
|
// ../utils/src/uuid.ts
|
|
71255
71225
|
var UUID_REGEX = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
71256
71226
|
function isValidUUID(value) {
|