@myvillage/cli 2.6.0 → 2.6.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myvillage/cli",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "MyVillageOS CLI for community developers",
5
5
  "type": "module",
6
6
  "bin": {
@@ -257,7 +257,7 @@ async function deployThreeJsGame(projectDir, pkg, options = {}) {
257
257
  const metadata = {
258
258
  title: pkg.myvillage.name || pkg.name,
259
259
  description: pkg.description || '',
260
- category: (pkg.myvillage.gameType || 'OTHER').toUpperCase(),
260
+ category: toGameCategory(pkg.myvillage.category || pkg.myvillage.gameType),
261
261
  gameType: 'THREE_JS',
262
262
  targetAge: pkg.myvillage.targetAge || 'all',
263
263
  orientation: pkg.myvillage.orientation || 'landscape',
@@ -521,7 +521,7 @@ async function deployUnityPlatform(projectDir, mvConfig, platform, { gameIdOverr
521
521
  const metadata = {
522
522
  title: mvConfig.name,
523
523
  description: mvConfig.description || '',
524
- category: (mvConfig.category || 'OTHER').toUpperCase(),
524
+ category: toGameCategory(mvConfig.category),
525
525
  gameType,
526
526
  targetAge: mvConfig.targetAge || 'all',
527
527
  orientation: mvConfig.orientation || (platform === 'webgl' ? 'landscape' : 'portrait'),
@@ -775,6 +775,15 @@ function formatStatus(status) {
775
775
  }
776
776
  }
777
777
 
778
+ // The platform's GameCategory enum. A Three.js "custom" type (the create-game
779
+ // default) isn't one, and sending it as-is fails the deploy server-side.
780
+ const GAME_CATEGORIES = ['ACTION', 'PUZZLE', 'ADVENTURE', 'EDUCATION', 'QUIZ', 'EXPLORATION', 'NARRATIVE', 'OTHER'];
781
+
782
+ export function toGameCategory(raw) {
783
+ const v = String(raw || '').trim().toUpperCase();
784
+ return GAME_CATEGORIES.includes(v) ? v : 'OTHER';
785
+ }
786
+
778
787
  function getContentType(filePath) {
779
788
  const ext = filePath.split('.').pop()?.toLowerCase();
780
789
  const types = {