UNPKG

advanced-games-library

Version:

Advanced Gaming Library for React Native - Four Complete Games with iOS Compatibility Fixes

70 lines (52 loc) • 2.28 kB
#!/usr/bin/env node /** * Minimal Validation - Tests the minimal version without external dependencies */ console.log('šŸ” Minimal Package Validation...\n'); try { console.log('1ļøāƒ£ Testing minimal index.js...'); // Test that minimal index can be loaded const gameLibrary = require('./index-minimal.js'); console.log('āœ… index-minimal.js loaded successfully'); // Check main exports exist const exportKeys = Object.keys(gameLibrary); console.log('šŸ“¦ Found', exportKeys.length, 'exports'); // Test core exports const requiredExports = ['GamesLibrary', 'GameUtils', 'GameEngine']; const missingExports = requiredExports.filter(key => !gameLibrary[key]); if (missingExports.length > 0) { throw new Error('Missing required exports: ' + missingExports.join(', ')); } console.log('āœ… All required exports found:', requiredExports.join(', ')); // Test that we can call basic functions const id = gameLibrary.GameUtils.generateId(); const score = gameLibrary.GameUtils.formatScore(12345); const time = gameLibrary.GameUtils.formatTime(125); console.log('āœ… GameUtils functions work:'); console.log(' - generateId():', id); console.log(' - formatScore(12345):', score); console.log(' - formatTime(125):', time); // Test async functions console.log('2ļøāƒ£ Testing async functions...'); gameLibrary.GamesLibrary.initialize({}).then(function(result) { console.log('āœ… GamesLibrary.initialize() works:', result.success); // Test GameEngine return gameLibrary.GameEngine.initialize({}); }).then(function(result) { console.log('āœ… GameEngine.initialize() works:', result.success); console.log('\nšŸŽ‰ MINIMAL VALIDATION SUCCESSFUL! šŸŽ‰'); console.log('šŸ“¦ Minimal package works without any dependencies'); console.log('šŸ“ Ready for NPM publishing!'); }).catch(function(error) { console.error('āŒ Async function test failed:', error.message); process.exit(1); }); } catch (error) { console.error('\nāŒ MINIMAL VALIDATION FAILED!'); console.error('Error:', error.message); if (error.stack) { console.error('\nStack trace:'); console.error(error.stack.split('\n').slice(0, 3).join('\n')); } process.exit(1); }