Repair missing Effect modules after desktop packaging#4160
Repair missing Effect modules after desktop packaging#4160juliusmarminge wants to merge 3 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| "resources", | ||
| "app.asar.unpacked", | ||
| "node_modules", | ||
| ); |
There was a problem hiding this comment.
Wrong unpack path on macOS
High Severity
The repairUnpackedEffectModules function incorrectly assumes a fixed unpacked module path (appOutDir/resources/app.asar.unpacked). On macOS, the actual unpacked resources are located under Contents/Resources within the .app bundle. This mismatch causes the module repair to write to the wrong location, failing to update modules for macOS builds.
Reviewed by Cursor Bugbot for commit 7c7f4b4. Configure here.
ApprovabilityVerdict: Needs human review An unresolved high-severity comment identifies that the unpacked resource path logic may be incorrect for macOS builds, where the path structure differs from Windows/Linux. This potential bug in the new verification hook warrants human review. You can customize Macroscope's approvability policy. Learn more. |
- Add an electron-builder afterPack hook to restore the Effect runtime closure - Add focused tests for hook behavior and build configuration
- Replace module repair with explicit payload verification - Add coverage for complete and missing unpacked runtime files
Resolve app.asar.unpacked under the product app bundle on darwin while retaining the resources directory layout used by Windows and Linux. Co-authored-by: codex <codex@users.noreply.github.com>
301d19d to
b8b1437
Compare


May fix #4154, but couldnt reproduce reliably
Summary
afterPackhook for desktop artifacts.app.asar.unpacked.Testing
desktop-after-pack.test.tscoverage for replacing stale unpacked payloads.build-desktop-artifact.test.tsto verify the after-pack hook configuration.Note
Low Risk
Build-time packaging verification only; no runtime auth or data-path changes, though a stricter check could fail CI if unpack layout regresses.
Overview
Adds an electron-builder
afterPackhook so desktop packaging fails fast if required runtime files are missing fromapp.asar.unpacked/node_modules(e.g.effect,@effect/platform-node,mime,undici).desktop-after-pack.tsexportsverifyUnpackedRuntimeFilesand anafterPackentry that checks a fixed list of paths under the packaged app output.build-desktop-artifact.tscopies the hook into the stage workspace, passes its path intocreateBuildConfigvia optionalafterPackHookPath, and setsbuild.afterPackwhen provided. Tests cover the verifier and Windows build config wiring (DESKTOP_AFTER_PACK_HOOK_FILE).Reviewed by Cursor Bugbot for commit 301d19d. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add afterPack hook to verify required Effect modules are present after desktop packaging
afterPackhook that checks for required files inapp.asar.unpacked/node_modulesafter packaging, throwing an error listing any missing files.buildDesktopArtifactin build-desktop-artifact.ts to stage the hook file into the app directory and pass its path tocreateBuildConfig, which now conditionally setsafterPackin the electron-builder config.📊 Macroscope summarized 301d19d. 1 file reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.