How this site runs
lit-ui-router.dev is a Cloudflare Worker with static assets. The docs are plain files; a worker answers only the paths that need a routing decision — the sample apps, through ui-router-server, and the release pages, from a second worker that keeps the release ledger. Server-Side Routing follows a single request through the docs worker.
- Readers load
lit-ui-router.dev: the docs, the sample apps, the/releasespages and the/ghredirects the README badges link to. - Static assets answer every path outside
run_worker_firstin the site'swrangler.jsonc, with404.htmlfor misses; the worker never sees those requests. The sample-app mounts, the 404 exhibits,/releasesand/ghgo to the docs worker instead. - The docs worker (
worker/index.ts) answers the sample-app mounts withui-router-serververdicts: a redirect, a 404, or the app's shell, fetched back from static assets like its 404 pages and any path it doesn't route. It also renders the release pages and/ghredirects from ledger rows it reads over RPC, through theLEDGERservice binding. It has no database of its own. - The ledger worker (
release-ledger) takes release claims atPOST /claims, consumes them from the queue, and is the only thing that writes to D1. A daily Cron Trigger enqueues a claim for every release tag. - Queues hold claims until the consumer takes them, one at a time, with a dead-letter queue for claims that run out of retries.
- D1 stores the release ledger.
- GitHub sends a claim after each npm publish, from the
publish-npm.ymlworkflow with an Actions OIDC token. The consumer reads its tags and releases. - npm versions and dist-tags, read by the consumer.
The ledger worker's bindings, queue settings and schedule are in its wrangler.jsonc.