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

Unable to pass Publish options to electron-builder #240

Open
RaddishIoW opened this issue Jul 12, 2022 · 2 comments · May be fixed by #244
Open

Unable to pass Publish options to electron-builder #240

RaddishIoW opened this issue Jul 12, 2022 · 2 comments · May be fixed by #244

Comments

@RaddishIoW
Copy link

Bug Report

Problem

What is expected to happen?

I am able to pass configuration to electron-builder to define Publish parameters.

What does actually happen?

I am unable to pass parameters correctly through to electron-builder. It seems that the way cordova-electron intermediates between the developer and electron-builder is unnecessarily complex and leads to errors and problems with the ability to configure electron-builder.

According to the documentation for electron-builder, you should be able to pass through "publish" options as a top-level object, or per platform or per target: https://www.electron.build/configuration/publish

Information

According to the documentation for cordova-electron, the only valid keys for the "electron" config object in the build.json file are "mac", "windows" and "linux". Anything else is ignored and not passed through to electron-builder in the builder-effective-config.yaml file.

Command or Code

Environment, Platform, Device

Version information

Checklist

  • [x ] I searched for existing GitHub issues
  • [ x] I updated all Cordova tooling to most recent version
  • [ x] I included all the necessary information above
@RaddishIoW
Copy link
Author

I would like to work on this issue to enable publishing options to be passed to electron-builder.
Specifically, I would like to be able to pass options through to enable auto-updating of Electron apps using the built-in publish options of electron-builder.

I will create a fork and start work, if this could be assigned to me?

@RaddishIoW
Copy link
Author

Hmm... So I've been digging around a little in the code to get prepared for this, and it seems to me that this should already be possible, as there is code for handling overridable per-platform config options - however, there is a function called __validateUserPlatformBuildSettings which gets called and throws an error if there are any extra keys in the config which aren't platformConfigs.package || platformConfigs.arch || platformConfigs.signing.

I can't see why this is there? The code supports other keys in the config, and there is even a test in tests/spec/unit/lib/build.spec.js which tests that this works! IRL, the build never gets to this point with any of the overridable keys in the platform configs as it's stopped by the __validateUserPlatformBuildSettings function call first.

Can anyone shed any light on this? This code comes from PR #4 waaaay back...

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 a pull request may close this issue.

1 participant