Skip to content

Commit

Permalink
Merge pull request #1149 from flexn-io/fix/electron_export
Browse files Browse the repository at this point in the history
fix electron export, bump electron version
  • Loading branch information
pavjacko authored Oct 10, 2023
2 parents 7993c64 + 7c1db32 commit 9d33477
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/engine-rn-electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@rnv/sdk-react-native": "1.0.0-canary.1",
"@rnv/sdk-webpack": "1.0.0-canary.1",
"better-opn": "1.0.0",
"electron": "26.2.4",
"electron": "26.3.0",
"electron-builder": "24.6.4",
"electron-notarize": "1.2.2"
},
Expand All @@ -48,4 +48,4 @@
"publishConfig": {
"access": "public"
}
}
}
7 changes: 6 additions & 1 deletion packages/engine-rn-electron/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ const configureProject = (c: RnvContext, exitOnFail?: boolean) =>
};
}

// Fix `Cannot compute electron version from installed node modules - none of the possible electron modules are installed.`
// See https://github.com/electron-userland/electron-builder/issues/3984#issuecomment-505307933
const enginePkgJson = path.join(engine.rootPath!, 'package.json');
const enginePackageJson = readObjectSync(enginePkgJson);

let electronConfig = merge(
{
appId,
Expand All @@ -225,6 +230,7 @@ const configureProject = (c: RnvContext, exitOnFail?: boolean) =>
output: path.join(platformBuildDir, 'export'),
},
files: ['!export/*'],
electronVersion: enginePackageJson.dependencies.electron,
},
macConfig
);
Expand All @@ -235,7 +241,6 @@ const configureProject = (c: RnvContext, exitOnFail?: boolean) =>
electronConfig = merge(electronConfig, electronConfigExt);
}
writeFileSync(electronConfigPath, electronConfig);

resolve();
});

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9852,10 +9852,10 @@ electron-to-chromium@^1.4.526:
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.528.tgz#7c900fd73d9d2e8bb0dab0e301f25f0f4776ef2c"
integrity sha512-UdREXMXzLkREF4jA8t89FQjA8WHI6ssP38PMY4/4KhXFQbtImnghh4GkCgrtiZwLKUKVD2iTVXvDVQjfomEQuA==

electron@26.2.4:
version "26.2.4"
resolved "https://registry.yarnpkg.com/electron/-/electron-26.2.4.tgz#36616b2386b083c13ae9188f2d8ccf233c23404a"
integrity sha512-weMUSMyDho5E0DPQ3breba3D96IxwNvtYHjMd/4/wNN3BdI5s3+0orNnPVGJFcLhSvKoxuKUqdVonUocBPwlQA==
electron@26.3.0:
version "26.3.0"
resolved "https://registry.yarnpkg.com/electron/-/electron-26.3.0.tgz#3267773d170310384db76819cf6375bd98b3cc76"
integrity sha512-7ZpvSHu+jmqialSvywTZnOQZZGLqlyj+yV5HGDrEzFnMiFaXBRpbByHgoUhaExJ/8t/0xKQjKlMRAY65w+zNZQ==
dependencies:
"@electron/get" "^2.0.0"
"@types/node" "^18.11.18"
Expand Down

0 comments on commit 9d33477

Please sign in to comment.