Surface
idaptik-ums/src/editor/EditorEngine.res (and its sibling files in the same dir) contain JavaScript syntax with a literal // Generated by ReScript, PLEASE EDIT WITH CARE header — meaning they are the compiled .res.mjs outputs renamed to .res rather than the original ReScript sources.
Evidence — first 20 lines of the file:
// SPDX-License-Identifier: AGPL-3.0-or-later
// Generated by ReScript, PLEASE EDIT WITH CARE
//
// EditorEngine.res.mjs — Pure computation helpers for the IDApTIK UMS editor.
// ...
import * as EditorModel from "./EditorModel.res.mjs";
function toolLabel(tool) {
if (typeof tool === "string") {
switch (tool) {
case "Select":
return "Select";
...
typeof x === "string", tool.TAG, ES-style import * as — all JavaScript, not ReScript.
Why this matters
When rescript build is run against idaptik-ums/rescript.json (which lists src as a source dir), the compiler fails with:
Syntax error!
idaptik-ums/src/editor/EditorEngine.res:15:9-11
15 │ import * as EditorModel from "./EditorModel.res.mjs";
Did you forget to write an expression here?
…and the build never produces idaptik-ums/src/App.res.mjs. This was masked previously by the soft-fail || echo in the Playwright workflow's sub-build step, then surfaced once PR #114 wired up the sub-build properly. PR #114 has since pivoted to skip the sub-build entirely (vite optimizeDeps.entries scoped to root index.html) because Playwright doesn't actually need idaptik-ums anyway.
Root cause hypothesis
58fe350a (2026-03-22) "feat: AGPL-3.0-or-later license, hub i18n keys, quit fix" or c26463fe (same day) "feat: complete Belt→Core, Js.*→modern, Tauri→Gossamer migration" likely overwrote the original .res source with the compiled .res.mjs content during a global rename pass. Worth checking git show 58fe350a~1:idaptik-ums/src/editor/EditorEngine.res to recover the genuine ReScript source.
Affected files
All .res files in idaptik-ums/src/editor/ and likely idaptik-ums/src/ should be audited for the // Generated by ReScript header. Likely candidates:
idaptik-ums/src/App.res
idaptik-ums/src/editor/EditorEngine.res
idaptik-ums/src/editor/EditorModel.res
idaptik-ums/src/editor/EditorCanvas.res
idaptik-ums/src/editor/EditorCmd.res
(any file with // Generated by ReScript in the first 5 lines is impacted)
Fix recipe
For each affected file:
- Recover the original
.res source from before the corrupt-overwrite commit (likely 58fe350a~1 or earlier; bisect to confirm)
- Restore it as the
.res source
- Re-run
cd idaptik-ums && deno run --node-modules-dir=auto --allow-read --allow-write --allow-env --allow-run npm:rescript@12.2.0 and confirm clean build
Once green, PR #114's vite optimizeDeps.entries scoping can be removed (or left as a defensive scope — your call) and the Tauri webview entry will be exercised properly again.
Cross-references
Severity
Low blast radius for the SPA (Playwright tests + main game route '/' are unaffected). High blast radius for the Tauri webview shell (the entire UMS editor UI is unbuildable). Filed as a P2 follow-up.
Surface
idaptik-ums/src/editor/EditorEngine.res(and its sibling files in the same dir) contain JavaScript syntax with a literal// Generated by ReScript, PLEASE EDIT WITH CAREheader — meaning they are the compiled.res.mjsoutputs renamed to.resrather than the original ReScript sources.Evidence — first 20 lines of the file:
typeof x === "string",tool.TAG, ES-styleimport * as— all JavaScript, not ReScript.Why this matters
When
rescript buildis run againstidaptik-ums/rescript.json(which listssrcas a source dir), the compiler fails with:…and the build never produces
idaptik-ums/src/App.res.mjs. This was masked previously by the soft-fail|| echoin the Playwright workflow's sub-build step, then surfaced once PR #114 wired up the sub-build properly. PR #114 has since pivoted to skip the sub-build entirely (viteoptimizeDeps.entriesscoped to root index.html) because Playwright doesn't actually need idaptik-ums anyway.Root cause hypothesis
58fe350a(2026-03-22) "feat: AGPL-3.0-or-later license, hub i18n keys, quit fix" orc26463fe(same day) "feat: complete Belt→Core, Js.*→modern, Tauri→Gossamer migration" likely overwrote the original.ressource with the compiled.res.mjscontent during a global rename pass. Worth checkinggit show 58fe350a~1:idaptik-ums/src/editor/EditorEngine.resto recover the genuine ReScript source.Affected files
All
.resfiles inidaptik-ums/src/editor/and likelyidaptik-ums/src/should be audited for the// Generated by ReScriptheader. Likely candidates:idaptik-ums/src/App.residaptik-ums/src/editor/EditorEngine.residaptik-ums/src/editor/EditorModel.residaptik-ums/src/editor/EditorCanvas.residaptik-ums/src/editor/EditorCmd.res(any file with
// Generated by ReScriptin the first 5 lines is impacted)Fix recipe
For each affected file:
.ressource from before the corrupt-overwrite commit (likely58fe350a~1or earlier; bisect to confirm).ressourcecd idaptik-ums && deno run --node-modules-dir=auto --allow-read --allow-write --allow-env --allow-run npm:rescript@12.2.0and confirm clean buildOnce green, PR #114's vite optimizeDeps.entries scoping can be removed (or left as a defensive scope — your call) and the Tauri webview entry will be exercised properly again.
Cross-references
58fe350a/c26463fe— likely-culprit commits for the corrupt overwriteSeverity
Low blast radius for the SPA (Playwright tests + main game route '/' are unaffected). High blast radius for the Tauri webview shell (the entire UMS editor UI is unbuildable). Filed as a P2 follow-up.