hytopia 0.11.2 → 0.11.4
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 +11 -17
- package/package.json +1 -1
- package/server.mjs +147 -147
package/bin/scripts.js
CHANGED
|
@@ -41,6 +41,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
41
41
|
'init-mcp': initMcp,
|
|
42
42
|
'package': packageProject,
|
|
43
43
|
'start': start,
|
|
44
|
+
'upgrade-assets-library': () => upgradeAssets(process.argv[3] || 'latest'),
|
|
44
45
|
'upgrade-cli': () => upgradeCli(process.argv[3] || 'latest'),
|
|
45
46
|
'upgrade-project': () => upgradeProject(process.argv[3] || 'latest'),
|
|
46
47
|
'version': displayVersion,
|
|
@@ -142,9 +143,6 @@ function init() {
|
|
|
142
143
|
// Update SDK to latest (sets package.json requirement)
|
|
143
144
|
upgradeProject();
|
|
144
145
|
|
|
145
|
-
// Copy assets into project, not overwriting existing files
|
|
146
|
-
copyAssets(destDir);
|
|
147
|
-
|
|
148
146
|
// Display success message
|
|
149
147
|
displayInitSuccessMessage();
|
|
150
148
|
|
|
@@ -210,18 +208,6 @@ function initFromBoilerplate(destDir) {
|
|
|
210
208
|
}
|
|
211
209
|
}
|
|
212
210
|
|
|
213
|
-
/**
|
|
214
|
-
* Copies assets to the project directory
|
|
215
|
-
*/
|
|
216
|
-
function copyAssets(destDir) {
|
|
217
|
-
const assetsSource = path.join(destDir, 'node_modules', '@hytopia.com', 'assets');
|
|
218
|
-
const assetsDest = path.join(destDir, 'assets');
|
|
219
|
-
|
|
220
|
-
if (!copyDirectoryContents(assetsSource, assetsDest, { recursive: true, force: false })) {
|
|
221
|
-
console.error('❌ Error: Could not copy assets from @hytopia.com/assets package');
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
211
|
/**
|
|
226
212
|
* Displays success message after project initialization
|
|
227
213
|
*/
|
|
@@ -579,6 +565,13 @@ async function fetchLatestVersion(signal) {
|
|
|
579
565
|
}
|
|
580
566
|
}
|
|
581
567
|
|
|
568
|
+
function upgradeAssetsLibrary(versionArg = 'latest') {
|
|
569
|
+
const version = versionArg.trim();
|
|
570
|
+
console.log(`🔄 Upgrading @hytopia.com/assets package to: ${version} ...`);
|
|
571
|
+
execSync(`npm install --force @hytopia.com/assets@${version}`, { stdio: 'inherit' });
|
|
572
|
+
console.log('✅ Upgrade complete.');
|
|
573
|
+
}
|
|
574
|
+
|
|
582
575
|
function upgradeCli(versionArg = 'latest') {
|
|
583
576
|
const version = versionArg.trim();
|
|
584
577
|
console.log(`🔄 Upgrading HYTOPIA CLI to: hytopia@${version} ...`);
|
|
@@ -613,8 +606,9 @@ function displayHelp() {
|
|
|
613
606
|
console.log(' init [--template NAME] Initialize a new project');
|
|
614
607
|
console.log(' init-mcp Setup MCP integrations');
|
|
615
608
|
console.log(' package Create a zip of the project for uploading to the HYTOPIA create portal.');
|
|
616
|
-
console.log(' upgrade-
|
|
617
|
-
console.log(' upgrade-
|
|
609
|
+
console.log(' upgrade-assets-library [VERSION] Upgrade the @hytopia.com/assets package (default: latest)');
|
|
610
|
+
console.log(' upgrade-cli [VERSION] Upgrade the HYTOPIA CLI (default: latest)');
|
|
611
|
+
console.log(' upgrade-project [VERSION] Upgrade project SDK dependency (default: latest)');
|
|
618
612
|
console.log('');
|
|
619
613
|
console.log('Examples:');
|
|
620
614
|
console.log(' hytopia init --template zombies-fps');
|
package/package.json
CHANGED