a boilerplate combining electron, ionic2 and cordova for creating truly cross platform apps using web technologies.
Please note that this is a current work in progress! I'm currently devoting my time to improving the electonic CLI (see branch CLI)
- Make sure you have
ionic@beta
installed globally withnpm
.
-->npm install -g ionic@beta
- clone this repo
git clone https://github.com/callodacity/electonic.git
- run
npm install
Developing for mobile platforms
Use the ionic CLI as normal i.e. ionic serve
, ionic build
, ionic run
, etc.
Developing for desktop platforms
Run the scripts inside package.json
:
npm run dev
will enable dev mode, using ionic's gulp watch process and automatically opening an electron app directed towards your development livereload server.npm run test
will only open your app in its current state. No live watching/reloading here.
Building with electron (desktop)
I recommend using electron-packager - it has great features and is quite stable.
electron-prebuilt
and electron-packager
are both included as devDependencies
.
If you want to package your app run you can use these npm scripts:
--> Before you package your app your must run either npm run dev
or npm run test
at least once!!
--> Please note that these scripts will overwrite old packaged apps in the same directory
npm run pack:osx
--> packages into.app
for osx. Both Darwin and MAS.npm run pack:win
--> packages into.exe
(ia32
andx64
) for Windows.npm run pack:nix
--> packages into bothia32
andx64
for Linux.
If you plan to use your own parameters for electron-packager
make sure the <sourcedir>
is set to ./www/
.
- for more building and distribution information read electron-packager.
- for creating installation wizards see electron-builder
Building with ionic (mobile)
This repository is really just an ionic project with electron built into it. So if you're building for mobile follow ionic's or cordova's tutorials on that.
ionic build
will build your app.- Remember to add desired platforms
ionic platform add android
. - Go here for more information on ionic build.
-
configure electron packaging (e.g., building into
.exe
,.app
, etc. -
attempt to find a fix for readline.js on windows systems (you won't be able to input into command prompt, just terminate with crtl+c)
-
remove unnecessary files from final packaged app
- include only pertinent files of final app
- exclude desktop files on mobile production apps and vice versa
-
Make an electonic CLI
- Be able to choose desktop / mobile / all as production platforms
- Make a wrapper for Ionic (for choosing TypeScript/JavaScript projects and their starter templates)
- Be able to choose vanilla AngularJS / Ionic / no library
- perhaps adding support for adding library of choice?
-
think of other improvements for this boilerplate