- Replace unzipper library with Bun's built-in ZIP reading capabilities
- Use zipFile.entries() to read ZIP entries directly in memory
- Process files in memory without filesystem extraction
- Maintain proper file categorization (public, server, site, core)
- Handle binary vs text files correctly with appropriate decoding
- Remove dependency on problematic unzipper library that has mkdir compatibility issues
- Clean up unused file system functions and imports
This fixes the "mkdir is not a function" error and makes ZIP loading fully compatible with Bun.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add detailed debug logging throughout ZIP loading process
- Log ZIP file size, extraction progress, and file counts
- Track metadata parsing and content setup
- Monitor public files, server, site, and core file loading
- Add error logging with stack traces
- Log completion of each deployment step
This will help identify where the server startup is getting stuck during ZIP deployment loading.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Replace non-existent readdirAsync from fs-jetpack with Node.js fs/promises.readdir
- Remove readdirAsync from fs-jetpack imports
- Update loadFilesFromDirectory to use standard readdir function
Fixes SyntaxError: Export named 'readdirAsync' not found in module error when running deployment system.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Replace msgpack/gzip download with ZIP file download
- Add loadFromZip() method to extract and process ZIP deployments
- Maintain backward compatibility with legacy msgpack/gzip deployments
- Add proper file loading with binary/text detection
- Update has_gz() to check for both .zip and .gz files
- Clean up extracted directories after processing
New ZIP deployment workflow:
1. Download ZIP file instead of gzipped msgpack data
2. Extract ZIP to temporary directory
3. Load metadata.json for site configuration
4. Load files from public/, server/, site/, core/ directories
5. Set up deploy content structure compatible with existing code
6. Clean up temporary files
Benefits:
- No more buffer overflow issues with large deployments
- Better file organization in ZIP structure
- Easier debugging with extractable files
- Maintains full compatibility with existing deployment system
- Supports both new ZIP and legacy msgpack formats
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Create database proxy for deployed servers to handle null database gracefully
- Pass database connection (or proxy) to deployed server init function
- Deployed servers now get meaningful error messages instead of crashing
- Ensures app stability when database connection is unavailable
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add proper error handling in database connection attempts
- Set g.db to null when connection fails to prevent subsequent crashes
- Add null check in execQuery to throw meaningful error when DB unavailable
- Improve API endpoint to return 503 status when database is unavailable
- Enhanced logging for better debugging of connection issues
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>