hytopia 0.10.27-prerelease-5 → 0.10.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/bin/scripts.js +10 -9
- package/package.json +1 -1
- package/server.mjs +2 -2
package/bin/scripts.js
CHANGED
|
@@ -34,7 +34,8 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
34
34
|
|
|
35
35
|
// Execute the appropriate command
|
|
36
36
|
const commandHandlers = {
|
|
37
|
-
'build': build,
|
|
37
|
+
'build': () => build(false),
|
|
38
|
+
'build-dev': () => build(true),
|
|
38
39
|
'help': displayHelp,
|
|
39
40
|
'init': init,
|
|
40
41
|
'init-mcp': initMcp,
|
|
@@ -65,22 +66,15 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
65
66
|
*
|
|
66
67
|
* @example
|
|
67
68
|
*/
|
|
68
|
-
async function build() {
|
|
69
|
-
console.log('🔧 Building project (bun)...');
|
|
70
|
-
execSync('npx --yes bun build --target=node --format=esm --outfile=index.mjs index.ts', { stdio: 'inherit' });
|
|
71
|
-
}
|
|
72
69
|
|
|
73
70
|
/**
|
|
74
71
|
* Runs a hytopia project's index file using node.js
|
|
75
72
|
* and watches for changes.
|
|
76
73
|
*/
|
|
77
74
|
async function start() {
|
|
78
|
-
// Initial build via CLI to ensure consistency
|
|
79
|
-
execSync('hytopia build', { stdio: 'inherit' });
|
|
80
|
-
|
|
81
75
|
const projectRoot = process.cwd();
|
|
82
76
|
const entryFile = path.join(projectRoot, 'index.mjs');
|
|
83
|
-
const buildCmd = 'hytopia build';
|
|
77
|
+
const buildCmd = 'hytopia build-dev';
|
|
84
78
|
const runCmd = `"${process.execPath}" --enable-source-maps "${entryFile}"`;
|
|
85
79
|
|
|
86
80
|
// Start nodemon to watch for changes, rebuild, then run the server
|
|
@@ -478,6 +472,12 @@ async function packageProject() {
|
|
|
478
472
|
|
|
479
473
|
// set priority level for takahiro tickets
|
|
480
474
|
|
|
475
|
+
async function build(devMode = false) {
|
|
476
|
+
let devFlags = devMode ? '--external=mediasoup' : '';
|
|
477
|
+
|
|
478
|
+
execSync(`npx --yes bun build --target=node --format=esm ${devFlags} --outfile=index.mjs index.ts`, { stdio: 'inherit' });
|
|
479
|
+
}
|
|
480
|
+
|
|
481
481
|
/**
|
|
482
482
|
* Parses command-line flags in the format --flag value
|
|
483
483
|
*/
|
|
@@ -609,6 +609,7 @@ function displayHelp() {
|
|
|
609
609
|
console.log(' help, -h, --help Show this help');
|
|
610
610
|
console.log(' version, -v, --version Show CLI version');
|
|
611
611
|
console.log(' build Build the project (Generates ESM index.mjs)');
|
|
612
|
+
console.log(' build-dev Build the project in development mode (Generates ESM index.mjs with local dependencies externalized)');
|
|
612
613
|
console.log(' start Start a HYTOPIA project server (Node.js & watch)');
|
|
613
614
|
console.log(' init [--template NAME] Initialize a new project');
|
|
614
615
|
console.log(' init-mcp Setup MCP integrations');
|
package/package.json
CHANGED