Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect electron-prebuilt-compile version through package.json #909

Closed
jacobq opened this issue Nov 21, 2018 · 6 comments
Closed

Detect electron-prebuilt-compile version through package.json #909

jacobq opened this issue Nov 21, 2018 · 6 comments

Comments

@jacobq
Copy link

jacobq commented Nov 21, 2018

Why can't the code in infer.js's getVersion be replaced with the following? This would make it much easier to use a fork of electron-prebuilt-compile (which is frequently several versions behind the latest electron release).

const electronVersion = require('electron-prebuilt-compile/package.json').version

There's a comment saying

electron-prebuilt-compile cannot be resolved because main does not point to a valid JS file.

but I'm not sure what that's supposed to mean. Applying the above change in a fork of this seems to work fine.

@welcome
Copy link

welcome bot commented Nov 21, 2018

👋 Thanks for opening your first issue here! If you have a question about using Electron Packager, read the support docs. If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. Development and issue triage is community-driven, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@malept
Copy link
Member

malept commented Nov 21, 2018

Why can't the code in infer.js's getVersion be replaced with the following? This would make it much easier to use a fork of electron-prebuilt-compile (which is frequently several versions behind the latest electron release).

const electronVersion = require('electron-prebuilt-compile/package.json').version

That's because it won't work if you're using the global version of Electron Packager, as opposed to the one installed in a project via devDependencies.

There's a comment saying

electron-prebuilt-compile cannot be resolved because main does not point to a valid JS file.

but I'm not sure what that's supposed to mean. Applying the above change in a fork of this seems to work fine.

See: #608

@jacobq
Copy link
Author

jacobq commented Nov 21, 2018

Would it be acceptable to try to read it from node_modules like this first and fallback to the way it currently is if that fails?

@malept
Copy link
Member

malept commented Nov 21, 2018

I'd rather not. I have an idea which I may get to this weekend.

@jacobq
Copy link
Author

jacobq commented Nov 21, 2018

OK. The problem I'm actually trying to solve is to be able to specify my own repo for electron-prebuilt-compile in an ember-electron (electron-forge 5.x) project. I've got it hacked together right now with a couple forks & yarn resolutions, and those can go away when electron-prebuilt-compile ships 3.0.10, but this isn't the first time I've had to do something like this, and I always wish there was a more orthodox way to do it.

@malept
Copy link
Member

malept commented Nov 22, 2018

FYI, I've pinged the maintainer of electron-prebuilt-compile and he's released 3.0.10.

@malept malept changed the title Detect electron version through package.json Detect electron-prebuilt-compile version through package.json Dec 5, 2018
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

No branches or pull requests

2 participants