The desktop preparation script is here https://github.com/pliablepixels/zmNinja/blob/master/make_desktop.sh
a) I downloaded the electron packages from here and unzipped them to a directory
b) As per their instructions, I have a main.js and packages.js for my app . The main.js was modified to make it work reliably on my mac - but its the same file for all ports
c) In my main ionic code, I had to find alternatives to cordova plugins (as they don't exist in desktop land). An example is here - where I see if window.cordova exists (device) and do something vs. a diff. action on desktop. Or take this example (a better one), where I am saving an image of a live feed to my disk. If its mobile, I am using a cordova plugin, if its desktop, I'm using a different JS plugin (canvas2plugin)
d) And then the "make desktop" script just copies the files inside the resource directory of the electron package, and then to keep it pretty, packs the app into an "asar" archive - which is not necessary, but I like doing it - it also avoids newbie fiddlers from meddling with the code.
Hope this helps.