|
| 1 | +# Contributing |
| 2 | + |
| 3 | +This repo is a gallery of community Lua Apps and Widgets for EdgeTX. [`scripts.json`](scripts.json) is the |
| 4 | +single source of content — entries are validated against [`scripts.schema.json`](scripts.schema.json) and |
| 5 | +rendered into the [gallery site](https://edgetx.org/lua-scripts/). |
| 6 | + |
| 7 | +## Submitting or updating a gallery entry |
| 8 | + |
| 9 | +You don't need to edit `scripts.json` yourself — open an issue instead: |
| 10 | + |
| 11 | +- [Add a Lua App or Widget to the Gallery](https://github.com/EdgeTX/lua-scripts/issues/new?template=add-script.yml) |
| 12 | +- [Update / Correct a Lua App or Widget Entry](https://github.com/EdgeTX/lua-scripts/issues/new?template=update-script.yml) |
| 13 | +- [Feedback / Report an Issue](https://github.com/EdgeTX/lua-scripts/issues/new?template=feedback.yml) |
| 14 | + |
| 15 | +Fill in the form fields — name, category, description, info URL, and (optionally) screenshots. Screenshot URLs |
| 16 | +can be external links (raw GitHub, Imgur, etc.) or you can drag-and-drop / paste image files directly into the |
| 17 | +form and GitHub will host them for you. |
| 18 | + |
| 19 | +## What happens after you submit |
| 20 | + |
| 21 | +1. A maintainer reviews the issue and applies the `add-to-gallery` (new entry) or `update-in-gallery` |
| 22 | + (existing entry) label. |
| 23 | +2. That label triggers [`script-submission.yml`](.github/workflows/script-submission.yml), which parses the |
| 24 | + issue, updates `scripts.json`, validates it, and opens a **draft PR** back to the issue. |
| 25 | +3. If the submission included external image URLs, a maintainer applies the `localize-images` label to the |
| 26 | + draft PR. This triggers [`localize-images.yml`](.github/workflows/localize-images.yml), which downloads |
| 27 | + those images into `ASSETS/<slug>/`, rewrites `scripts.json` to point at the local copies, and pushes the |
| 28 | + result back to the PR branch as a commit. |
| 29 | +4. Once the diff looks correct, a maintainer removes draft status and merges. |
| 30 | +5. Merging to `main` regenerates the gallery site via [`gh-pages.yml`](.github/workflows/gh-pages.yml). |
| 31 | + |
| 32 | +## CI checks |
| 33 | + |
| 34 | +- [`validate-scripts-json.yml`](.github/workflows/validate-scripts-json.yml) validates `scripts.json` against |
| 35 | + `scripts.schema.json` on every push/PR that touches it. |
| 36 | +- [`validate-issue-templates.yml`](.github/workflows/validate-issue-templates.yml) keeps the tag/category |
| 37 | + dropdowns in the issue templates in sync with `scripts.schema.json`, and self-heals same-repo branches |
| 38 | + automatically when they drift. |
| 39 | + |
| 40 | +## Running the tooling locally |
| 41 | + |
| 42 | +The scripts under [`tools/`](tools/) are plain Python, run via [`uv`](https://docs.astral.sh/uv/) — no project |
| 43 | +setup required beyond having `uv` installed: |
| 44 | + |
| 45 | +```bash |
| 46 | +uv run tools/validate_scripts.py --scripts-json scripts.json |
| 47 | +uv run tools/download_external_images.py --dry-run # preview image localization |
| 48 | +uv run tools/sync_issue_template_options.py --check # check tag/category drift |
| 49 | +``` |
0 commit comments