feat: scope + un-bundle the plugin; @unom/ui SPA; custom-emulator editor
Reliability + correctness pass on the packaging and UI. Packaging — drop the self-contained bundle: - Rename to `@punktfunk/plugin-rom-manager` (scoped). An unscoped package can't be split across registries, which is the only reason bundling effect + the SDK into every plugin seemed necessary. Scoped names resolve from one scope-map, so the plugin depends on `@punktfunk/host` + `effect` as SHARED (hoisted) deps — no duplication, no ~1 MB effect copy per plugin. Build is back to plain `tsc`. (Runner-side discovery of `@punktfunk/plugin-*` shipped in @punktfunk/host 0.1.1.) UI — use the console's design system so it reads as family: - SPA rebuilt on @unom/style tokens + Tailwind v4 + the console's exact theme (violet chrome, Geist, card/button vocabulary). Build-time only → static assets in dist/ui, no @unom runtime dep. Skips @unom/ui's AnimatedButton/Card, which statically import ~7 MB of UI sound assets — same look, 416 KB dist/ui. - Add a custom-emulator editor (Emulators page) writing config.emulators — you can now add a launcher Punktfunk doesn't ship a definition for. - Fix brand capitalization to "Punktfunk" in all UI copy + docs. Install docs + CI updated for the scoped `bun add @punktfunk/plugin-rom-manager` flow. 48 engine tests green; backend + UI typecheck + biome clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,34 +1,43 @@
|
||||
# punktfunk-plugin-rom-manager
|
||||
# @punktfunk/plugin-rom-manager
|
||||
|
||||
A [punktfunk](https://git.unom.io/unom/punktfunk) plugin that scans your ROM folders, maps them to
|
||||
A [Punktfunk](https://git.unom.io/unom/punktfunk) plugin that scans your ROM folders, maps them to
|
||||
emulators, fetches box art, and reconciles everything into the host game library — so your retro games
|
||||
appear automatically in the punktfunk web console, native clients, and Moonlight `/applist`, each
|
||||
launchable and covered in art. It ships a web UI that lives **inside the punktfunk console** (no second
|
||||
appear automatically in the Punktfunk web console, native clients, and Moonlight `/applist`, each
|
||||
launchable and covered in art. It ships a web UI that lives **inside the Punktfunk console** (no second
|
||||
password, no second port).
|
||||
|
||||
Think of it as [Steam ROM Manager](https://github.com/SteamGridDB/steam-rom-manager) for punktfunk: it
|
||||
Think of it as [Steam ROM Manager](https://github.com/SteamGridDB/steam-rom-manager) for Punktfunk: it
|
||||
even uses the same art source (SteamGridDB) when you give it an API key.
|
||||
|
||||
---
|
||||
|
||||
## Requirements
|
||||
|
||||
- A punktfunk host (Linux or Windows) with the **scripting runner** (`punktfunk-scripting`) enabled.
|
||||
- A Punktfunk host (Linux or Windows) with the **scripting runner** (`punktfunk-scripting`) enabled.
|
||||
- [Bun](https://bun.sh) (the runner is Bun).
|
||||
- `@punktfunk/host` **with the plugin-UI surface** (`servePluginUi`). This is what powers the
|
||||
console-hosted UI; the standalone fallback works without it.
|
||||
- `@punktfunk/host` **≥ 0.1.1** — it provides the plugin-UI surface (`servePluginUi`) and discovers
|
||||
scoped `@punktfunk/plugin-*` packages.
|
||||
|
||||
## Install
|
||||
|
||||
The plugin is scoped under `@punktfunk`, so one bunfig line points that scope at the Punktfunk registry
|
||||
while everything else (like `effect`) resolves from npm — no bundling, and `@punktfunk/host` + `effect`
|
||||
are shared across all your plugins:
|
||||
|
||||
```sh
|
||||
cd "$(punktfunk config-dir)/plugins" # e.g. ~/.config/punktfunk/plugins
|
||||
bun add punktfunk-plugin-rom-manager --registry https://git.unom.io/api/packages/unom/npm/
|
||||
mkdir -p "$(punktfunk config-dir)/plugins" && cd "$(punktfunk config-dir)/plugins"
|
||||
cat > bunfig.toml <<'EOF'
|
||||
[install.scopes]
|
||||
"@punktfunk" = "https://git.unom.io/api/packages/unom/npm/"
|
||||
EOF
|
||||
bun add @punktfunk/plugin-rom-manager
|
||||
|
||||
# then enable the runner (opt-in):
|
||||
systemctl --user enable --now punktfunk-scripting # Linux
|
||||
Enable-ScheduledTask PunktfunkScripting # Windows
|
||||
```
|
||||
|
||||
Open the punktfunk console — a **ROM Manager** entry appears in the nav. That's it.
|
||||
Open the Punktfunk console — a **ROM Manager** entry appears in the nav. That's it.
|
||||
|
||||
> **Headless / host-only boxes** without the console can use the [standalone UI](#standalone-ui) or
|
||||
> just drop a `config.json` (below) — the sync engine is fully functional from the file alone.
|
||||
@@ -119,14 +128,21 @@ bunx punktfunk-plugin-rom-manager set-password 'your-password'
|
||||
## Development
|
||||
|
||||
```sh
|
||||
bun install # resolves @punktfunk/host from the Gitea npm registry
|
||||
bun install # backend deps (@punktfunk/host + effect) from the Gitea registry
|
||||
bun test # engine unit tests (pure core: quoting, scanner, reconcile, art)
|
||||
bun run typecheck
|
||||
bun run build:all # backend → dist/, SPA → dist/ui/
|
||||
bun run build:all # backend → dist/ (tsc), SPA → dist/ui/ (Vite)
|
||||
cd ui && bun run dev # SPA dev server (point it at a running standalone instance)
|
||||
```
|
||||
|
||||
This plugin requires `@punktfunk/host` ≥ 0.1.0 (the version that introduced `servePluginUi`).
|
||||
- The backend is plain `tsc` output — it depends on `@punktfunk/host` + `effect` at runtime (shared
|
||||
with the runner and other plugins, not bundled).
|
||||
- The **SPA** (`ui/`) uses the console's design system (`@unom/ui` + `@unom/style` + Tailwind v4) so it
|
||||
reads as family. Those are **build-time only** — the SPA compiles to static assets in `dist/ui`, so
|
||||
the published plugin carries no `@unom` runtime dependency. Installing them needs the `@unom` scope in
|
||||
your `~/.npmrc` (with the Gitea token); CI needs the same token as a secret.
|
||||
|
||||
Requires `@punktfunk/host` ≥ 0.1.1.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user