Conversation
Co-authored-by: sinedied <593151+sinedied@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new output format to support OnionOS’s folder-based artwork layout, integrating it into the format factory, public exports, CLI help, and docs/metadata.
Changes:
- Added
Format.Onionand factory support to load the Onion format implementation. - Implemented the Onion output format (
boxart/<romname>.png) with cleanup support. - Updated CLI help text and documentation/metadata to list the new format.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/index.ts | Exposes the new onion format module from the package entrypoint. |
| src/format/onion.ts | Implements OnionOS artwork output logic (pathing, export, cleanup). |
| src/format/format.ts | Adds Format.Onion and dynamic import handling in getOutputFormat. |
| src/cli.ts | Updates CLI --output help text to include onion. |
| package.json | Adds relevant keywords for discoverability (onion, anbernic). |
| README.md | Documents Onion support and updates the list of supported output formats. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - `-h, --height <size>`: Max height of the image | ||
| - `-t, --type <type>`: Type of image to scrape (can be `boxart`, `snap`, `title`, `box+snap`, `box+title`) (default: `boxart`) | ||
| - `-o, --output <format>`: Artwork format (can be (`minui`, `nextui`, `muos`, `anbernic`) (default: `minui`) | ||
| - `-o, --output <format>`: Artwork format (can be (`minui`, `nextui`, `muos`, `anbernic`, `onion`) (default: `minui`) |
There was a problem hiding this comment.
The README option description has mismatched parentheses: it says "(can be (" but never closes that parenthetical. Please fix the formatting so the supported formats list is clearly delimited (e.g., remove the extra parenthesis or add the missing closing one).
| - `-o, --output <format>`: Artwork format (can be (`minui`, `nextui`, `muos`, `anbernic`, `onion`) (default: `minui`) | |
| - `-o, --output <format>`: Artwork format (can be `minui`, `nextui`, `muos`, `anbernic`, `onion`) (default: `minui`) |
| case Format.Onion: { | ||
| const onion = await import('./onion.js'); | ||
| return onion.default; | ||
| } |
There was a problem hiding this comment.
CI runs npm test, which executes the CLI with the default output format. The new Format.Onion dynamic import path is therefore not exercised by the automated test run, so regressions (e.g. import/exports mismatches at runtime) could slip through. Consider adding a small test invocation that runs the CLI with --output onion (even a --cleanup run) to cover this code path.
This PR adds support for the Onion (OnionOS) artwork format as requested in the issue. OnionOS is a custom firmware for Miyoo Mini and Mini+ devices.
Changes Made
Format.Onionenum value to support the new formatsrc/format/onion.tsimplementing the Onion format interface with a simple folder-based structureonionin supported formatsImplementation Details
The Onion format follows a simple folder-based approach similar to other supported formats:
boxartfolder next to ROM filesboxart/filename.png.media) and Anbernic (Imgs)Example structure:
Testing
--output onionparameterThe implementation uses a reasonable default folder structure (
boxart) that clearly indicates the content type. This can be adjusted based on community feedback if a different naming convention is preferred by Onion users.Fixes #15.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
api.github.comcurl -s REDACTED(dns block)onionui.github.iocurl -s REDACTED(dns block)thumbnails.libretro.comnode ./bin/mscraper.js test --output onion --verbose(dns block)If you need me to access, download, or install something from one of these locations, you can either: