fix(electron): use namespace tar import for extension extraction
Summary
While testing extension install/repair flows in a fork of Modly, I hit an issue around the tar import used in electron/main/ipc-handlers.ts during archive extraction.
A small import change fixed the extension extraction path for me:
- from:
import tar from 'tar' - to:
import * as tar from 'tar'
Why I’m opening this first
This is a small and isolated compatibility fix, so I wanted to ask before opening a PR.
Context
The extraction flow currently calls:
await tar.x({ file: tarPath, cwd: extractDir, strip: 1 })
in:
electron/main/ipc-handlers.ts
In my environment, using the namespace import made the extension repair/install flow behave correctly.
Affected surface
This looks related to the extension archive extraction path used by:
- install/repair flows
- downloaded extension unpacking
- any path that relies on
tar.x(...)from Electron main
Proposed change
Use the namespace import for tar in Electron main:
import * as tar from 'tar'
instead of the default import.
Why this seems safer
This avoids ESM/CommonJS interop ambiguity around the tar package shape and matches how some packages expose their API in Node/Electron environments.
Scope
This is intentionally small:
- no behavioral changes
- no feature changes
- just a compatibility/import fix for an existing path
Question
Would you be open to a small PR for this import change?
I fixed it directly, it’ll be included in the next patch