Skip to content

About

Repository for RRF/DSF/DWC plugins

Resources

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

License: AGPL v3 build-site

Duet3D Plugin Repository

Source of plugins.duet3d.com, a listing of third-party plugins for RepRapFirmware, DuetSoftwareFramework and DuetWebControl. Duet3D does not test, endorse or support listed plugins. Authors stay responsible for their plugins and every release of them.

Architecture

plugins/<id>.json  ->  generator/catalog.ts  ->  generated/catalog.json  ->  vite-ssg site (src/)  ->  GitHub Pages
  registry               nightly + on push         + readme/<id>.html          one static page per plugin
  • plugins/<id>.json is the registry: one file per listed plugin, written when a plugin is listed. It holds only what cannot be derived from GitHub: id (the repository name), author, repo, branch, abstract, forumThread, submittedBy, submittedOn and updatedOn. generator/tools/convert-registry.ts created it from the front matter of the VuePress plugin pages.
  • generator/ turns the registry into the catalog. It lists every GitHub release of every plugin, downloads each plugin zip it has not seen before, hashes it and reads its plugin.json, and renders PLUGIN.md (or README.md) to sanitised HTML: markdown-it without raw HTML, then sanitize-html, with relative links resolved against the repository. GitHub requests are retried on network errors and 5xx responses, and warnings show up as annotations of the workflow run.
  • src/ is the site: Vue 3, Vuetify 4 and vite-ssg. It imports the catalog at build time and prerenders the home page, every plugin page, every author page and the guides.
  • plugin_reported.json collects abuse reports from the Report issue form.

Site

  • Pages are written as flat .html files and GitHub Pages serves them with and without the extension, so the URLs of the VuePress site (/plugins/<id>.html, /guide/submission.html) keep working. The DSF and DWC wikis link to /guide/submission.html. The router redirects *.html to the clean route after hydration.
  • The firmware line selector offers only major.minor lines and defaults to the newest line with a stable release. The selected line is kept in ?v= (omitted for the default) and in localStorage, as are standalone mode and a dismissed disclaimer. Prerendered pages always use the defaults, and stored choices apply after hydration.
  • Standalone mode hides zips with sbcRequired: true on every page.
  • A download whose declared version is more specific than major.minor (3.6.0, 3.7.0-alpha.7) is marked, because DSF and DWC only install it on that exact version.

Catalog

catalog.json is published next to the site and is meant to be read by other tools, DWC's plugin manager in particular. Its types live in generator/schema.ts.

  • schemaVersion changes only for breaking changes. Additions to the format keep the version, so readers must ignore unknown fields.
  • Every release lists all its plugin zips (*.zip except *-srcmap.zip), each with size, SHA-256, download count, the platform versions from its plugin.json, sbcRequired and sbcPermissions.
  • line is the firmware line of a zip, the most specific of the platform versions in its plugin.json. The others must be prefixes of it, the same way DSF and DWC compare versions: dwcVersion: 3.6 together with sbcDsfVersion: 3.6.1 is line 3.6, 3.6 together with 3 is 3.6, and a bare 3 is line 3, which lineMatches treats as compatible with every 3.x. Conflicting versions such as 3.6 and 3.7 give null. Those zips are only offered under "unknown version" and the generator logs a warning for them.
  • lines lists only major.minor lines, a bare major never becomes an entry of its own.
  • A plugin with an optional SBC component (sbcRequired: false) is also offered for standalone boards.
  • README HTML is not part of the catalog but published as readme/<id>.html.
  • catalog.json is served with Access-Control-Allow-Origin: *, so a browser can fetch it from any origin. Release downloads from GitHub cannot, which is why DWC will need mirrored zips to install from the catalog.
  • schema.ts also exports the helpers that interpret the catalog: lineMatches, assetLine, isMinorLine and isExactVersion. Readers should use them instead of reimplementing the rules.

The generator reuses the previous catalog as its cache: a zip is downloaded again only when its asset ID, size or updated_at changed, so a file replaced under the same tag is hashed again. line is recomputed from the stored platform versions on every run, so a change of the rules needs no full rebuild. Weekly download counts also start from the previous catalog.

Workflows

Workflow Trigger Purpose
build_site.yml push to master, daily at 01:17 UTC, dispatch Type-check and test the generator, build the catalog and the site, deploy to GitHub Pages
listing.yml issue opened, reopened or labelled Check and apply submissions, updates, removals and reports, see below
cla.yml pull requests Contributor licence agreement

Releases and README changes of listed plugins are picked up automatically by the next build. The VuePress site and its workflows are kept on the legacy branch.

Listing flow

generator/listing.ts does the work, the workflow only calls it. It reads the issue through the API itself, so no issue text ever passes through a workflow expression.

  • Submission: opening or reopening the issue runs the checks (repository and branch exist, PLUGIN.md or README.md, a release with a plugin zip whose plugin.json has id, name and author, ID not yet listed). The result is posted as a comment and the issue gets ready-to-list or not-listed. A maintainer lists the plugin by adding the list label: the checks run again and plugins/<id>.json is committed to master. Approve based on the bot's check comment, which names the repository and branch that were actually checked; the issue text itself can be made to look different from what it parses to. An approval is refused if the issue was edited after the last passing check.
  • Update and removal: applied straight away when the issue comes from the plugin's author, the account that submitted it, or a maintainer. An update replaces the summary.
  • Report: appended to plugin_reported.json straight away; the issue stays open for a maintainer.
  • After a change the issue gets a comment, the label merged and is closed (reports stay open), and build_site.yml is dispatched, because pushes made with GITHUB_TOKEN trigger no workflows.

Any number of issues can be approved at once. There is deliberately no concurrency group, because GitHub keeps only one pending run per group and cancels the rest. Instead each run computes its change once (prepare), then repeatedly resets to the newest master, applies the change (write, local files only), commits and pushes until the push succeeds. Tested with 15 parallel approvals and 6 parallel reports to the same file.

LISTING_DRY_RUN=true logs comments, labels and dispatches instead of sending them, for local tests against real issues:

GITHUB_TOKEN=$(gh auth token) LISTING_DRY_RUN=true node generator/listing.ts check <issue>

Development

Node.js 24 or newer is required.

cd generator && npm ci && npm run typecheck && npm test
GITHUB_TOKEN=$(gh auth token) node catalog.ts
cd .. && npm ci && npm run dev
npm run build && npm run preview

npm run build type-checks with vue-tsc and prerenders into dist/. The site needs generated/catalog.json, so run the generator first.

The generator writes to generated/ by default (OUT_DIR overrides it). Without GITHUB_TOKEN it is limited to 60 GitHub API requests per hour, which is not enough for the whole registry.

Variable Default Purpose
GITHUB_TOKEN none GitHub API token
PREVIOUS_CATALOG_URL https://plugins.duet3d.com/catalog.json Catalog to reuse hashes and weekly counts from
FULL_REBUILD false true ignores the previous catalog and downloads every zip again
OUT_DIR generated Output directory for catalog.json and readme/
SITE_BASE / Base path of the site build

Recovery

  • A wrong hash or manifest in the catalog: run build_site.yml manually with full rebuild checked.

About

Repository for RRF/DSF/DWC plugins

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages