A store registry record needs no repository
The client only ever took identity from a store repository — a slug, a name, a catalog — and the store engine's own defaults cover everything else: the host-to-asset mapping, the install modes, the platforms, the behaviour. So `store_repository_url` is now optional: nullable in the schema, no presence validation, the format check only when a value is given, and the serializer answers null rather than an empty string, because the client branches on its absence. Adding a store is therefore a row with two fields filled in. Given a repository the client still reads its config.json, and that file remains the authority on how the store behaves — the admin form and the endpoint's documentation say so. The frontend's /stores page gains a section of its own for the graphical client on the desktop tab: what it does, that it sets the store up itself, that it is the way in on Windows where `curl … | sh` does not exist, and links to the releases, the repository and the documentation — now under stores/warp-engine-client, which is where that repository lives after the rename. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -32,19 +32,22 @@ nobody to log in as.
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"name": "Teletype Games",
|
||||
"catalogUrl": "https://teletypegames.org",
|
||||
"storeRepositoryUrl": "https://git.teletypegames.org/stores/ttg-desktop-store"
|
||||
}
|
||||
{ "name": "Teletype Games", "catalogUrl": "https://teletypegames.org", "storeRepositoryUrl": null }
|
||||
]
|
||||
```
|
||||
|
||||
A `Store` row is three fields — `name`, `catalog_url`, `store_repository_url` —
|
||||
maintained from **ActiveAdmin ▸ 🛒 Stores**, and `db/seeds.rb` creates our own.
|
||||
The client derives everything else: it reads `config.json` from the store
|
||||
repository, points it at `catalog_url`, and falls back to the engine's defaults if
|
||||
that repository has no config file.
|
||||
A `Store` row has two required fields — `name` and `catalog_url` — plus an
|
||||
**optional** `store_repository_url`, maintained from **ActiveAdmin ▸ 🛒 Stores**;
|
||||
`db/seeds.rb` creates our own.
|
||||
|
||||
**A store does not need a repository.** The store engine's own defaults already
|
||||
cover the host-to-asset mapping, the install modes, the platforms and the
|
||||
behaviour; what they cannot know is identity — a slug, a name and a catalog — and
|
||||
that is what this row carries. With no repository the client derives the slug from
|
||||
the catalog host, writes a small config and installs. Given one, it reads that
|
||||
repository's `config.json` and points it at `catalog_url`, and that file remains the
|
||||
authority on how the store behaves; a repository without a config file is treated
|
||||
as no repository at all.
|
||||
|
||||
This lives in the host app **on purpose, not in WarpEngine**. The engine serves
|
||||
one catalog and has no business knowing which stores exist for it; who ships a
|
||||
@@ -55,7 +58,7 @@ store for a catalog is a property of the site.
|
||||
| Model | `apps/api/app/models/store.rb` |
|
||||
| Endpoint | `apps/api/app/controllers/api/stores_controller.rb` |
|
||||
| Admin | `apps/api/app/admin/stores.rb` |
|
||||
| Client | [`warp-engine-desktop-gui`](https://git.teletypegames.org/stores/warp-engine-desktop-gui) |
|
||||
| Client | [`warp-engine-client`](https://git.teletypegames.org/stores/warp-engine-client) |
|
||||
|
||||
## Development environment
|
||||
|
||||
|
||||
Reference in New Issue
Block a user