Summary
Setting up a Roundcube development environment currently requires manually configuring PHP with the correct extensions, a database server (MySQL/MariaDB/PostgreSQL/SQLite), an IMAP server for testing, and various JavaScript build tools. This can be time-consuming and error-prone, especially for new contributors.
Proposal
Add a VS Code DevContainer configuration that provides a complete, reproducible development environment with a single click. The DevContainer would include:
Services
- PHP 8.4 with all required extensions (gd, intl, ldap, pdo_mysql, pdo_pgsql, pdo_sqlite, zip, opcache) and optional extensions (exif, imagick, enchant, xdebug)
- MariaDB 11 for database testing
- Dovecot IMAP server with a test user (
testuser/testpass)
- Mailhog for capturing outgoing emails during testing
Automation
- Automatic database initialization on first start
- Composer and npm dependency installation
- JavaScript library downloads (jQuery, TinyMCE, CodeMirror)
- CSS compilation from LESS sources
- Development configuration file generation
VS Code Integration
- Pre-configured tasks for common operations:
- Start development server
- Run PHPUnit tests
- PHP CS Fixer (check/fix)
- PHPStan analysis
- ESLint
- Database management (init/reset/status)
- Recommended extensions (Intelephense, PHP Debug, ESLint, etc.)
Benefits
- Lower barrier to entry - New contributors can start developing immediately without environment setup
- Consistency - All developers work in identical environments, reducing "works on my machine" issues
- Cross-platform - Works on Windows (WSL 2), macOS (Intel and Apple Silicon), and Linux
- Isolation - Development environment doesn't affect host system
- Documentation - The DevContainer configuration serves as executable documentation of requirements
Additional Changes
This enhancement also includes some minor fixes discovered during development:
- Exclude actual shell scripts from php-cs-fixer (the
*.sh pattern was intended for PHP CLI scripts in bin/ that use .sh extension, not bash scripts)
- Add
tests/.phpunit.result.cache to .gitignore
Summary
Setting up a Roundcube development environment currently requires manually configuring PHP with the correct extensions, a database server (MySQL/MariaDB/PostgreSQL/SQLite), an IMAP server for testing, and various JavaScript build tools. This can be time-consuming and error-prone, especially for new contributors.
Proposal
Add a VS Code DevContainer configuration that provides a complete, reproducible development environment with a single click. The DevContainer would include:
Services
testuser/testpass)Automation
VS Code Integration
Benefits
Additional Changes
This enhancement also includes some minor fixes discovered during development:
*.shpattern was intended for PHP CLI scripts inbin/that use.shextension, not bash scripts)tests/.phpunit.result.cacheto.gitignore