1681-engine / electron / shellId
Function: shellId() ​
function shellId(electronVersion, dirOrOptions): string;Defined in: src/electron/shellId.ts:27
A desktop shell's identity: a hash of the main process's own code and the Electron version it runs on. A web patch is taken only by a shell with the same identity, because the web talks to the shell through its preload script and may need what a newer shell adds; anything else comes with an installer. The publish script reckons it the same way off the build it uploads, so nobody has to remember to raise a number when the shell changes.
shellId(version, dir) hashes dir's *.cjs; pass ShellIdOptions for more folders or other files. With one folder, the default match and no extra, both forms give the same hash. Code the shell takes from node_modules (this module included) is not in dir: name its version in extra, or a change there would not change the identity.
Parameters ​
| Parameter | Type |
|---|---|
electronVersion | string |
dirOrOptions | string | ShellIdOptions |
Returns ​
string