How liquipedia/lua-modules works
Project type and purpose
• This is a monorepo for a library of Liquipedia “Lua Modules” and accompanying assets (JavaScript widgets and SCSS styles) that run inside MediaWiki pages. It’s not a traditional client-server app but a collection of content-rendering modules, asset pipelines, test suites, and deployment scripts.
Top-level architecture analysis
• Source code domains:
– lua/ (Lua modules for complex page logic)
– javascript/ (client-side interactive scripts)
– stylesheets/ (SCSS styling for page elements)
• Build & test:
– npm (JS and SCSS linting/tests/visual snapshot)
– Luarocks + busted + luacheck (Lua linting & unit tests)
• Deployment & CI:
– .github/workflows (GitHub Actions for code style, tests, scheduled jobs, deploy)
– scripts/ (shell and PowerShell scripts for deploying modules into wikis, protecting pages/templates, generating changelogs)
Key README insights
• Describes multi-language setup (Lua/LuaJIT, Node/npm/SCSS), local developer tooling, and CI pipelines.
• References “Personal Deploy” GitHub Actions workflow to push to development or test MediaWiki environments.
1. Developer Workstation
• IDE with Lua/JS/SCSS linters & formatters
• Local runtimes: Lua 5.1/LuaJIT + Luarocks, Node.js + npm
2. Source Repository (GitHub)
• Stores lua/, javascript/, stylesheets/, scripts/, CI configs
3. CI/CD System (GitHub Actions)
• Lint jobs (ESLint, Stylelint, luacheck)
• Unit test jobs (busted for Lua, JS tests via Jest or similar)
• Visual snapshot jobs
• Deploy jobs (deploy test, deploy to production wikis)
4. Artifact & Deployment Scripts
• scripts/deploy.sh, deploy_res.sh, protect*.sh
• API calls into MediaWiki to upload modules/templates
5. Target Environments
• Dev MediaWiki environment (via “deploy test.yml”)
• Production Liquipedia wikis (after PR merge)
– Developer → push code → GitHub Repository
– GitHub Repository → triggers → CI/CD pipelines
– CI Runner → checkout code → run lint → run tests → run snapshot tests
– On success: CI → execute deploy scripts → MediaWiki API → publish modules & assets
– Scheduled CI jobs → update visual snapshots, remove dev env, protect pages/templates
c. Architectural patterns & principles:
– Monorepo pattern (multiple languages/assets in one repo)
– Pipeline as Code (GitHub Actions workflows for every stage)
– Separation of concerns:
• Lua: page logic modules
• JS: client interactivity
• SCSS: styles
• Scripts: operational concerns (deploy/protect)
– Test automation & visual regression testing
d. Significant technologies & frameworks:
– Lua + LuaJIT + Luarocks + busted + luacheck
– Node.js + npm + ESLint + Stylelint + Jest (visual snapshots)
– GitHub Actions for CI/CD
– MediaWiki API for module deployment