Skip to content

add renpy#31

Open
cloud9c wants to merge 1 commit into
mainfrom
add-renpy-engine
Open

add renpy#31
cloud9c wants to merge 1 commit into
mainfrom
add-renpy-engine

Conversation

@cloud9c
Copy link
Copy Markdown
Contributor

@cloud9c cloud9c commented May 11, 2026

No description provided.

@claude
Copy link
Copy Markdown

claude Bot commented May 11, 2026

Claude finished @cloud9c's task in 2m 17s —— View job


Code Review

Adds Ren'Py as a fifth engine. The change is small (+27/−1) and faithfully follows the JsDos/Ruffle pattern across EngineKind, WavedashConfig, executable_entrypoint_params, executable_files_to_validate, and the handle_dev match arm. Wiring looks correct end-to-end — engine_type(), engine_version(), validation in file_staging.rs:36, and the build-creation path in builds.rs all pick it up automatically through the shared helpers.

Two issues worth fixing before merge, plus one optional cleanup.

Issues

1. Stale error message in engine_type()src/config.rs:263 (inline comment posted)

The conflict-detection branch now also fires for [renpy] combinations, but its message still reads:

Config must have at most one engine section: [godot], [unity], [jsdos], or [ruffle]

A user who puts [godot] + [renpy] in their config will hit this and be told the valid engines, but [renpy] won't be in the list. Fix this →

2. Stale doc comments referencing only JSDOS/Ruffle (inline comment posted)

Four spots still say "For JSDOS/Ruffle" but now also apply to Ren'Py:

  • src/config.rs:297 — doc on executable_entrypoint_params
  • src/config.rs:322 — doc on executable_files_to_validate
  • src/file_staging.rs:35// Validate executable and loader_url files exist (for JSDOS/Ruffle)
  • src/builds.rs:71// Add entrypointParams if provided (for JSDOS/Ruffle)

Fix this →

Optional — refactor to reduce duplication

JsDosSection, RuffleSection, and RenPySection are now byte-for-byte identical (version, executable, loader_url). Adding a fourth engine of this shape will mean touching five branches in config.rs plus the dev/mod.rs match arm. Worth considering a single ExecutableEngineSection struct (or a small helper that returns the active (executable, &Option<loader_url>) tuple) so future additions become one line. Not blocking this PR.

Notes

  • wavedash init doesn't scaffold Ren'Py — same as JsDos/Ruffle today, so this is consistent, not a regression. Flagging in case onboarding parity matters.
  • Branch is behind origin/main — main has advanced (version bumped to 0.1.80, dev-app/src/main.ts changed). You'll need to merge/rebase before this can ship cleanly.
  • No tests — there are no tests in src/ covering engine selection today, so this PR isn't introducing a test gap. If you want to add one, engine_type() is the cheapest place: a unit test asserting that two engine sections produce the conflict error would also catch issue Chunk uploads to <500mb chunks so we can cache on r2-asset-proxy #1 above.

Todos

  • Read PR diff against origin/main
  • Read affected files (src/config.rs, src/dev/mod.rs) and surrounding callers
  • Analyze changes for bugs, security, and consistency
  • Post inline comments + final review
    · Branch: add-renpy-engine

Comment thread src/config.rs
self.unity.is_some().then_some(EngineKind::Unity),
self.jsdos.is_some().then_some(EngineKind::JsDos),
self.ruffle.is_some().then_some(EngineKind::Ruffle),
self.renpy.is_some().then_some(EngineKind::RenPy),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding RenPy here means the conflict-detection branch directly below (line 263) now also fires for renpy combinations, but its error message wasn't updated:

"Config must have at most one engine section: [godot], [unity], [jsdos], or [ruffle]"

A user who accidentally combines [godot] + [renpy] will be told the valid engines but won't see [renpy] in the list. Please update the message to include [renpy].

Comment thread src/config.rs
Comment on lines +311 to +316
} else if let Some(ref renpy) = self.renpy {
let mut params = serde_json::json!({ "executable": renpy.executable });
if let Some(ref loader_url) = renpy.loader_url {
params["loaderUrl"] = serde_json::json!(loader_url);
}
Some(params)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch is the third near-identical copy of the same shape (executable + optional loader_url). Two related observations:

  1. The doc comment on executable_entrypoint_params (line 297) and on executable_files_to_validate (line 322) still say "For JSDOS/Ruffle engines" — they need an update to include Ren'Py. Same for the comments at src/file_staging.rs:35 and src/builds.rs:71.
  2. Since JsDosSection, RuffleSection, and RenPySection are now byte-for-byte identical (version, executable, loader_url), consider extracting a shared ExecutableEngineSection struct and a small helper that yields (executable, loader_url) for whichever variant is active. Would collapse the three if/else branches here and in executable_files_to_validate and engine_version into a single match, and make adding the next engine a one-line change. Not blocking — just calling out that the duplication has crossed the threshold where it's starting to cost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant