Skip to content

Conversation

@dalekunce
Copy link
Member

No description provided.

Dale Kunce and others added 27 commits September 30, 2025 00:11
- Update Ruby version from 3.2.2 to 3.3 in .travis.yml for compatibility
- Update Gemfile to use Ruby 3.3.9 to match local environment
- Create placeholder events_min.html to resolve Jekyll build error
- Site now builds successfully with all dependencies aligned
- Update Node.js dependencies to latest secure versions
- Fix all 40 security vulnerabilities (0 vulnerabilities remaining)
- Update Gulp to v5.0.1 and fix deprecated patterns
- Replace deprecated node-sass with modern sass (dart-sass)
- Update browser-sync to v3.0.4 for security fixes
- Update Foundation Sites to v6.9.0 and FontAwesome to v6.7.2
- Fix deprecated Sass functions (darken, lighten, scale-color)
- Add modern @use statements for sass:math and sass:color
- Update Travis CI configuration for Node.js 18
- Suppress Sass deprecation warnings from dependencies
- Replace deprecated request package with axios
- Remove run-sequence dependency (built into Gulp 4+)

Build system now works with modern tools and zero vulnerabilities.
- Upgrade Node.js from 12.16.1 (EOL) to 20.18.0 LTS
- Add engines field to package.json for Node.js >=20.0.0
- Modernize JavaScript code throughout codebase:
  * Convert var declarations to const/let
  * Update function syntax to arrow functions
  * Use template literals instead of string concatenation
  * Modernize jQuery callbacks and async patterns
- Migrate ESLint from legacy .eslintrc to modern flat config
- Update ESLint rules and remove deprecated configurations
- Fix all linting errors and improve code quality
- Modernize JavaScript in HTML templates (helper-map.html, events.html)
- Update Google Analytics gtag function to modern syntax
- Remove unused dependencies and variables

Files updated:
- .nvmrc: Node.js 20.18.0
- package.json: engines field, updated lint scripts
- eslint.config.js: new modern flat config
- app/assets/scripts/main.js: ES6+ syntax, linting fixes
- app/_includes/helper-map.html: modernized embedded JS
- app/_layouts/default.html: modernized gtag function
- gulpfile.js: arrow functions, async/await patterns
- updatedep.js: already modern, formatting fixes
- Remove Travis CI configuration (.travis.yml) and build scripts
- Add comprehensive GitHub Actions workflows:
  * deploy.yml: CI/CD pipeline with GitHub Pages deployment
  * test.yml: Pull request testing and validation
  * security.yml: Weekly security and dependency audits
  * manual-deploy.yml: On-demand deployment with environment options
- Configure Dependabot for automated dependency updates:
  * NPM packages, Ruby gems, and GitHub Actions
  * Weekly schedule with automatic PR assignment
  * Grouped updates by dependency type
- Add GitHub issue templates for better bug reporting
- Update package.json with improved npm scripts:
  * npm run build: Production build via gulp prod
  * npm test: Linting + building for CI validation
  * npm run clean: Clean build artifacts
- Update README.md with comprehensive CI/CD documentation
- Modern GitHub Actions features:
  * Matrix builds, caching, artifacts
  * Proper permissions and security
  * Environment-specific deployments
  * Built-in GitHub Pages integration

Migration benefits:
✅ Better GitHub integration and security
✅ Faster builds with native GitHub infrastructure
✅ Automated dependency management with Dependabot
✅ More granular workflow control
✅ No external CI service dependencies
✅ Built-in GitHub Pages deployment
- Update Foundation Sites to 6.9.0 to match CDN
- Finalize Ruby 3.3.5 and Jekyll 4.3.4 upgrade
- All CDN links updated with integrity hashes for security
- Ruby warnings eliminated with logger/ostruct gems

Ruby/Jekyll/CDN modernization phase complete.
- Add detailed step-by-step explanation of what 'npm run serve' does
- Include all available npm scripts with descriptions
- Update environment setup with current Node.js 20+ and Ruby 3.3+ requirements
- Add troubleshooting section for common development issues
- Clarify difference between Browsersync (localhost:3000) and Jekyll (127.0.0.1:4000)
- Improve setup instructions for version managers (nvm, rbenv)

Documentation now clearly shows how to build all assets properly.
- Eliminates ESLint warning about module type detection
- Improves performance by avoiding reparsing as ES module
- Aligns with modern ES module configuration
- Replace 'gulp prod' with 'npm run build' in all workflows
- Replace 'gulp serve --build-only' with 'npm run build:dev'
- Remove unnecessary 'gulp-cli' global installation
- Align CI/CD with README documentation and modern npm script patterns
- Ensures GitHub Actions follow the same build process as local development

Fixes build failures by using the documented npm scripts approach.
- Rename gulpfile.js to gulpfile.cjs to resolve 'require is not defined' error
- Update package.json lint scripts to exclude gulpfile.cjs from ESLint
- Maintains 'type: module' in package.json while allowing CommonJS gulpfile
- All builds now work correctly with both npm scripts and GitHub Actions

Resolves build failures caused by ES module/CommonJS mismatch.
Added the following files to app/assets/graphics/content/:
- Malawi_paper_soc_mob_form.docx - Malawi field mapping documentation
- RedCross_WestAfrica_FinalReport_public.pdf - Red Cross West Africa final report
- matt_philippines.jpeg - Field mapping photo from Philippines
- missingmaps-blog_20160422_banner.jpg - Blog banner from 2016
- missingmaps-blog_20180921_VCA.jpg - VCA blog image from 2018
- missingmaps-blog_20191001_screenshot-new-project-types.png - Project types screenshot
- missingmapsblog-leaderboardbanner.jpg - Leaderboard banner image

These assets support blog posts and documentation for Missing Maps activities.
- Repair malformed img tag with corrupted alt attribute
- Remove JavaScript code that was incorrectly embedded in the alt text
- Restore proper alt attribute reference to site.data[locale].img-alt.helper
- Ensures helper.svg image loads correctly on helper map page

Fixes potential broken image display on mapathon support page.
- Update HOT Tasking Manager links from HTTP to HTTPS
- Convert OpenStreetMap user profile links to HTTPS
- Update OpenStreetMap Foundation links to HTTPS
- Fix OSM logo links to use HTTPS

These changes prevent mixed content warnings on HTTPS sites
and ensure all external links are secure. Improves browser
security and prevents potential content blocking issues.
- Add GitHub Actions workflow for daily event updates (6 AM UTC)
- Enhance fetch-events.cjs with timestamp metadata and error handling
- Update events.js with graceful fallbacks and last-updated display
- Support both legacy array format and new metadata format
- Add comprehensive error messaging without social media references
- Enable static JSON loading to eliminate CORS issues
- Maintain backward compatibility with existing build process
- Update all 'register your events' buttons to use OSMCal.org instead of Google forms
- Remove Google Sheets integration code and files (eventHelpers.csv, google-sheets directory)
- Clean up commented code in gulpfile.cjs (removed unused humans task and uglify references)
- Remove unused test and debug files (test-api.html, debug-events.html)
- Update .gitignore to remove Google Sheets references
- Simplify helper-map descriptions in all language files
- Remove all references to posm.io/posm/intro/
- Replace with HOT Field Tasking Manager (https://fmtm.hotosm.org)
- Update tool descriptions to reflect FMTM's purpose as a coordination tool
- Changes applied to all language files: en.yml, fr.yml, es.yml, cs.yml
- FMTM better represents current field mapping coordination practices
BREAKING CHANGE: Complete overhaul of multilingual architecture

## Major Changes

### Architecture Modernization
- **Eliminated 80% code duplication**: Replaced 65+ duplicate HTML files with 13 centralized templates
- **Implemented Jekyll Polyglot**: Modern plugin-based internationalization system
- **Automatic language generation**: No more manual language directory management
- **Data-driven translations**: Centralized translation files in _data/{lang}.yml

### File Structure Changes
- **REMOVED**: All duplicate language directories (app/en/, app/fr/, app/es/, app/cs/)
- **REMOVED**: Unused _locales/ directory with generic Rails i18n files
- **ADDED**: Centralized page templates in app/ root directory
- **UPDATED**: Translation system to use site.data[locale] with Jekyll Polyglot

### Language Support
- **Maintained**: Full support for English, French, Spanish, Czech
- **Improved**: URLs now properly route (/fr/, /es/, /cs/)
- **Enhanced**: Language switcher updated for Jekyll Polyglot compatibility
- **Verified**: All translations working correctly across all languages

### Performance Optimizations
- **Build performance**: Added incremental builds, SASS compression
- **Liquid optimization**: Strict filters and error handling
- **Parallel localization**: Enabled for faster multi-language builds
- **Better exclusions**: Improved build exclusions for faster processing

### Testing & Quality Assurance
- **NEW**: Comprehensive test suite (test-multilingual.sh)
- **NEW**: GitHub Actions workflow for automated multilingual testing
- **VERIFIED**: All 6 test categories passing:
  - Jekyll build verification
  - Language directory structure validation
  - Translation content verification
  - Feed generation verification
  - Asset exclusion verification
  - Polyglot configuration validation

### Developer Experience
- **NEW**: Complete documentation (INTERNATIONALIZATION.md)
- **NEW**: Quick reference guide (QUICK-REFERENCE.md)
- **UPDATED**: README with modern system documentation
- **ADDED**: Performance configuration (_config-performance.yml)

### Configuration Updates
- **Jekyll Polyglot**: Added plugin configuration to _config.yml
- **Locale detection**: Updated get_locale.html to use site.active_lang
- **Language switcher**: Modernized header.html navigation
- **Dependencies**: Updated Gemfile with jekyll-polyglot plugin

## Benefits Achieved

### Maintainability
- **Single source of truth**: One template per page type
- **Simplified updates**: Changes apply to all languages automatically
- **Reduced maintenance**: No more syncing across language directories
- **Clear separation**: Templates vs translations cleanly separated

### Performance
- **Faster builds**: Parallel localization and incremental builds
- **Smaller repo**: Eliminated redundant files
- **Better caching**: Improved Jekyll cache configuration
- **Optimized assets**: Compressed SASS and optimized exclusions

### Quality
- **Automated testing**: Prevents regression in multilingual functionality
- **Documentation**: Comprehensive guides for future maintainers
- **CI/CD integration**: Automated testing in GitHub Actions
- **Error prevention**: Strict Liquid templates and validation

## Migration Impact
- **No content loss**: All existing translations preserved
- **URL compatibility**: All language URLs continue to work
- **Feature parity**: All functionality maintained
- **Improved reliability**: More robust language switching and routing

## Technical Details
- **Plugin**: jekyll-polyglot v1.11.0
- **Languages**: en (default), fr, es, cs
- **Templates**: 13 centralized HTML files
- **Translations**: 4 YAML data files
- **Testing**: 6-category comprehensive test suite
- **Documentation**: 2 detailed guides + updated README

This modernization provides a solid foundation for future development
and significantly improves the maintainability of the multilingual system.
- Fix Ruby version from 3.0 to 3.3.5 to match .ruby-version file
- Update Node.js version to 20.18.0 to match .nvmrc file
- Update action versions to v4 for better compatibility
- Add explicit Jekyll build config parameter
- Add executable permission for test script
- Improve debugging with version verification step

This should resolve the gem installation failure in CI.
- Remove problematic 'install' script from package.json that triggered bundle install
- Update update-events workflow to use npm ci for better CI performance
- This fixes the 'bundle command not found' error in production deployment

The fetch-events.cjs script only needs Node.js dependencies, not Ruby/Bundler.
- Updated: 2025-10-03 00:56:23 UTC
- Events count: 15
- Build time: 2025-10-03T00:56:22.749Z
- Fix package.json URLs for validation compliance
- Enhance GitHub Actions test workflow with better debugging
- Verify all builds and tests pass successfully
- Ready for production merge into publish branch

All 6 multilingual tests pass:
✅ Jekyll build verification
✅ Language directory structure
✅ Translation content verification
✅ Feed generation verification
✅ Asset exclusion verification
✅ Polyglot configuration validation
- Use remote version of auto-generated events.json
- Maintains automated event data from osmcal.org
- Ready for production merge
- Update actions/upload-artifact from v3 to v4
- Update actions/upload-pages-artifact from v3 to v4
- Resolves deprecation warnings in CI/CD workflows
- Ensures continued compatibility with GitHub Actions platform
Conflict resolution summary:
- ✅ GitHub Actions workflows: Use modernized versions with updated actions
- ✅ package.json: Keep enhanced configuration without bundle install script
- ✅ events.json: Use latest event data
- ✅ Jekyll metadata: Use current build metadata

All conflicts resolved favoring the modernized internationalization system
while preserving compatibility with production deployment requirements.
@dalekunce dalekunce marked this pull request as ready for review October 3, 2025 01:17
@dalekunce dalekunce merged commit 88a4987 into publish Oct 3, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants