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

breaking: add plugin support #175

Merged
merged 12 commits into from
Dec 26, 2020
Merged

breaking: add plugin support #175

merged 12 commits into from
Dec 26, 2020

Conversation

erisu
Copy link
Member

@erisu erisu commented Nov 17, 2020

Motivation and Context

  • To create proper plugin support for Electron with Cordova's existing plugin system.
  • To use a more secure and reliable way for loading remote content with out node integration. Use of contextIsolation & preload

Description

  • Added ICP handler for plugin communication in the main process.
  • API Change to pass plugin dir path to uninstall step for framework.
  • Added framework un/install support with necessary parser changes.
  • Added an exclusion to not overwrite the platform's installed node_modules and package.json
  • Updated the exec method to support he new electron implementation but keep the browser fallback when electron is missing.
  • Add the Cordova Electron's custom preload which is used to as a bridge between Cordova's exec & Electon's native ipcRenderer.
  • Updated cordova.js's exec method to use the Cordova Electron's custom bridge.

Testing

  • Built a project
  • Created a custom plugin for Electron.

Requires

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added/updated automated test coverage as appropriate for this change
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@erisu erisu added this to the 3.0.0 milestone Nov 17, 2020
@erisu erisu force-pushed the feat/plugin-support branch 2 times, most recently from 7de6b15 to 3d1f5a8 Compare November 17, 2020 07:29
@erisu erisu marked this pull request as draft November 17, 2020 10:00
@codecov-io
Copy link

codecov-io commented Dec 21, 2020

Codecov Report

Merging #175 (c032188) into master (d73fad4) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #175   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          625       652   +27     
=========================================
+ Hits           625       652   +27     
Impacted Files Coverage Δ
lib/prepare.js 100.00% <ø> (ø)
lib/Api.js 100.00% <100.00%> (ø)
lib/PackageJsonParser.js 100.00% <100.00%> (ø)
lib/handler.js 100.00% <100.00%> (ø)
lib/parser.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d73fad4...c032188. Read the comment docs.

@erisu erisu marked this pull request as ready for review December 21, 2020 14:39
@erisu
Copy link
Member Author

erisu commented Dec 24, 2020

Last call... Merging soon

Copy link
Member

@NiklasMerz NiklasMerz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick test with instructions from @erisu:

// Create a project
cordova create cordovaTest com.erisu.cordovaTest cordovaTest && $_
// Add Cordova Electron w/ Plugin Support
cordova platform add github:erisu/cordova-electron\#feat/plugin-support
// Add Cordova Device Plugin w/ Electron Support
cordova plugin add github:erisu/cordova-plugin-device\#feat/electron-support
// Build or run or what ever
cordova run electron --nobuild
cordova build electron
// Uninstall plugin test
cordova plugin rm cordova-plugin-device

The test went well and from my limited knowledge the code looks good. Go for it and bring plugins to electron!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants