How adafruit/adafruit_wippersnapper_offline_configurator works
Project Type and Purpose
• This is a static, single‐page, offline web configurator for Adafruit’s Wippersnapper firmware.
• It provides a user interface (index.html + JavaScript) to assemble a config.json for data‐logging boards and their components without an online backend.
• A small build pipeline (Python scripts + Git submodules) hydrates the UI with up‐to‐date board, component, and firmware metadata.
File Structure Analysis
• Top‐Level Directories/Files:
• .github/ – CI workflows (e.g., daily-update.yml) for automated data refresh.
• Wippersnapper_Boards/ & Wippersnapper_Components/ – Git submodules containing raw hardware definitions.
• *.py scripts – Conversion pipeline for submodule data → JSON/JS.
• index.html, *.js – Front‐end UI and data‐loading code.
• *.json & *.js data files – Generated artifacts consumed by the UI.
• requirements.txt – Python dependencies for build.
• Architectural Patterns:
• Static Site + Build Pipeline – No runtime server.
• Data Transformation Flow – Submodule data → converter scripts → static JSON/JS → UI.
• GitHub Pages Deployment – index.html + assets published to GitHub Pages.
Key README Insights
• The UI scripts (load-wippersnapper-data.js, wippersnapper-config-builder.js) are the core for user interactions.
• Conversion process (convert_all_wippersnapper_definitions.py) pulls from submodules, fetches images & firmware, then outputs wippersnapper_*.json and .js.
• CI workflow (.github/workflows/daily-update.yml) likely automates pulling latest boards/components and regenerating artifacts.
a. Main Components
• GitHub Submodules:
• Wippersnapper_Boards repo
• Wippersnapper_Components repo
• Build Pipeline (Local or CI):
• Python Conversion Scripts
• Node/JavaScript Build Step (if minification used)
• Generated Artifacts:
• wippersnapper_boards.json + .js
• wippersnapper_components.json + .js
• firmware-data.js
• Static Web Assets:
• index.html
• UI JavaScript (load-wippersnapper-data.js, wippersnapper-config-builder.js)
• CSS or other assets (if any)
• Client Browser:
• Loads static site from GitHub Pages or local filesystem
• Renders board/component selection UI
• Exports finalized config.json
b. Relationships & Interactions
• (CI) GitHub Actions → Triggers Python conversion → Commits updated artifacts → Deploys to GitHub Pages
c. Architectural Patterns & Principles
• Separation of Build‐Time vs. Runtime: All heavy processing (fetching, conversion, minification) happens at build time; runtime is purely client-side.
• Modularity: Boards and components live in separate submodules; conversion scripts are generalized to both.
• Extensibility: Adding new hardware means updating submodules or conversion logic without touching core UI.
d. Key Technologies
• Python + pip (conversion pipeline)
• JavaScript (ES6) for UI logic and data loading
• Git submodules for hardware definitions
• GitHub Actions for CI/CD
• Static hosting (GitHub Pages)