Skip to content

fix(desktop): include ms in packaged runtime#1506

Merged
gsxdsm merged 1 commit into
mainfrom
feature/https-github.com-Runfusion-Fusion-issues-1472
Jun 8, 2026
Merged

fix(desktop): include ms in packaged runtime#1506
gsxdsm merged 1 commit into
mainfrom
feature/https-github.com-Runfusion-Fusion-issues-1472

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Linux desktop builds can no longer ship without the ms module required by debug during extract-zip startup. The previous packaging config listed node_modules/ms/**/*, but ms was only present through pnpm's virtual store and was not actually copied into the generated app.asar; making it a desktop runtime dependency gives electron-builder a real package entry to include.

This also adds a desktop config regression test that keeps the startup/archive dependency globs in place for future package changes.

Refs #1472.

Verification

  • pnpm --filter @fusion/desktop exec vitest run src/__tests__/electron-builder-config.test.ts --silent=passed-only --reporter=dot
  • pnpm --filter @fusion/core exec vitest run src/__tests__/agent-companies-parser.test.ts --silent=passed-only --reporter=dot
  • pnpm --filter @fusion/desktop run pack
  • Inspected generated packages/desktop/dist-electron/mac-arm64/Fusion.app/Contents/Resources/app.asar and confirmed it contains /node_modules/ms/index.js, plus debug, extract-zip, and tar.

Compound Engineering
Codex

Summary by CodeRabbit

  • Chores
    • Added automated validation test for desktop build configuration to ensure runtime dependencies are properly included in the packaging setup
    • Updated desktop package dependencies

Ensure packaged desktop apps include the transitive debug dependency needed by extract-zip during startup.

Fusion-Task-Id: FN-5988
@greptile-apps

greptile-apps Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a Linux packaging regression where the ms package (a transitive dependency of debug, used by extract-zip at startup) was not being bundled into app.asar because pnpm's virtual-store layout meant electron-builder had no real package entry to follow. Promoting ms to a direct @fusion/desktop runtime dependency gives electron-builder the concrete symlink it needs, and a new regression test locks all the startup/archive glob patterns in electron-builder.yml against accidental future removal.

  • packages/desktop/package.json: Adds ms@^2.1.3 as a direct runtime dependency; pnpm-lock.yaml is updated accordingly.
  • electron-builder-config.test.ts: New test iterates over every required startup/archive glob and asserts it remains present in electron-builder.yml, covering debug, ms, extract-zip, and all transitive leaf packages.

Confidence Score: 5/5

Safe to merge — the change is a minimal, targeted fix for a confirmed Linux packaging failure with a corresponding regression test and author-verified asar inspection.

The only code touched is a single new direct dependency, its lockfile entry, and a test that checks glob patterns in a config file. All three changes are consistent with each other and with the existing electron-builder.yml which already listed node_modules/ms/**/*. No logic paths, APIs, or data flows are altered.

No files require special attention. The lockfile and config test are straightforward companions to the package.json change.

Important Files Changed

Filename Overview
packages/desktop/package.json Adds ms@^2.1.3 as a direct runtime dependency so electron-builder can resolve and bundle it from a real package entry rather than relying on pnpm's virtual-store symlink for the transitive debug → ms chain.
packages/desktop/src/tests/electron-builder-config.test.ts New regression test asserts that all startup/archive dependency globs (debug, ms, extract-zip, and transitive leaf deps) remain present in electron-builder.yml, guarding against accidental future removals.
pnpm-lock.yaml Lockfile correctly records ms@2.1.3 as a direct dependency of @fusion/desktop, consistent with the package.json change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[electron-builder packages desktop app] --> B{Resolve node_modules/ms}
    B -- Before fix: pnpm virtual store only --> C[Symlink not followed by electron-builder]
    C --> D[ms missing from app.asar]
    D --> E[Linux startup crashes: Cannot find module 'ms']
    B -- After fix: ms is direct dep in package.json --> F[Real package entry exists]
    F --> G[electron-builder includes node_modules/ms/**/*]
    G --> H[debug → ms → extract-zip loads successfully]
    H --> I[Desktop app starts on Linux]
Loading

Reviews (1): Last reviewed commit: "fix(FN-5988): include ms in desktop pack..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f19d815b-b5ff-43bc-997b-4d392f29802b

📥 Commits

Reviewing files that changed from the base of the PR and between 55a8e14 and b3fe830.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • packages/desktop/package.json
  • packages/desktop/src/__tests__/electron-builder-config.test.ts

📝 Walkthrough

Walkthrough

This PR declares ms as a dependency for the desktop package and adds a Vitest test that verifies required @fusion/core runtime dependency glob patterns are properly configured in the electron-builder.yml file.

Changes

Dependency Declaration and Configuration Validation

Layer / File(s) Summary
Dependency Declaration and Configuration Test
packages/desktop/package.json, packages/desktop/src/__tests__/electron-builder-config.test.ts
The ms package is added to the desktop dependencies alongside electron-updater. A new test reads electron-builder.yml, defines an array of required runtime dependency glob patterns, and asserts each pattern appears as a - ${dependencyGlob} list item in the configuration file.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 A package hops in with a test so keen,
To check that all dependencies are seen!
With globs declared in the YAML array,
The build stays steady, come what may! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding the 'ms' module as a runtime dependency for desktop builds to fix packaging issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/https-github.com-Runfusion-Fusion-issues-1472

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gsxdsm
gsxdsm merged commit 708c3c2 into main Jun 8, 2026
6 checks passed
@gsxdsm
gsxdsm deleted the feature/https-github.com-Runfusion-Fusion-issues-1472 branch June 8, 2026 06:25
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