├── .bowerrc ├── .gitattributes ├── .gitignore ├── .jshintrc ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── __tests__ ├── app │ └── home │ │ └── home.spec.js └── sample.jest.js ├── bower.json ├── circle.yml ├── config.js ├── dist ├── app │ └── home │ │ └── home.js ├── css │ └── style.css └── js │ └── sample.js ├── gulpfile.js ├── karma.conf.js ├── main.js ├── package.json ├── scripts └── load_globals.sh ├── src └── scss │ ├── base │ ├── _colors.scss │ ├── _fonts.scss │ ├── _functions.scss │ ├── _icons.scss │ ├── _mixins.scss │ └── base.scss │ ├── includes │ ├── _footer.scss │ └── _nav.scss │ └── style.scss └── views └── index.html /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "dist/vendor" 3 | } 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | coverage/ 3 | karma-coverage/ 4 | npm-debug.log 5 | node_modules/ 6 | jspm_packages/ 7 | dist/vendor/ 8 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "passfail": false, 3 | "bitwise": true, 4 | "curly": true, 5 | "devel": true, 6 | "eqeqeq": true, 7 | "forin": true, 8 | "freeze": true, 9 | "maxdepth": 3, 10 | "nonew": true, 11 | "strict": true, 12 | "undef": true, 13 | "unused": true, 14 | "esnext": true, 15 | "loopfunc": true, 16 | "browser": true, 17 | "devel": true, 18 | "jasmine": true, 19 | "jquery": true, 20 | "mocha": true, 21 | "node": true, 22 | "predef": [ "import_stylesheet", "System", "angular", "jest", "inject"] 23 | } 24 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 1.2.0 2 | - Lots of updates to build automation 3 | - .md file docs updated 4 | - Using AngularJS now 5 | - Actively injecting Bower deps using wiredep on build 6 | 7 | # 1.1.1 8 | - Using skeleton css now 9 | - Patched some issues with Makefile and Bower updates 10 | 11 | # 1.0.0 12 | Added support for: 13 | - Sass 14 | - ES2015 15 | - Gulp 16 | - GNU Make 17 | - JSHint 18 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing to Electron Boilerplate 2 | --- 3 | 4 | Thank you for considering to help contribute to our source code and to make Electron Boilerplate even better than it is today! Here are some of the guidelines we would like you to follow: 5 | 6 | - [Issues and Bugs](#issues) 7 | - [Feature Request](#feature-request) 8 | - [Submission Guidelines](#submission) 9 | - [Submitting a Pull Request](#pull-request) 10 | 11 | ## Found an Issue? 12 | 13 | If you find a bug in the source code or a mistake in the documentation/wikis, you can help remedy it by submitting an issue to [Github Repository](https://github.com/Stephn-R/electron-angular-boilerplate/issues) 14 | 15 | ***Please see the Submission Guidelines below*** 16 | 17 | ## Want a feature? 18 | 19 | You can request a new feature by submitting an issue to our [Github Repository](https://github.com/Stephn-R/electron-angular-boilerplate). If you would like to implement a new feature yourself then consider what kind of change it is: 20 | 21 | - ***Major Changes***: that can dramatically change the core functionality of the plugin 22 | - ***Small Changes***: can be crafted and submitted to the [Github Repository](https://github.com/Stephn-R/electron-angular-boilerplate) as a Pull Request 23 | 24 | ## Submission Guidelines: 25 | 26 | _Before you submit an issue, search the archive. Your question may have already been answered._ 27 | 28 | If your issue appears to be a bug, and hasn't been reported, open a new issue. Help us to maximize the effort we can spend fixing issues and adding new features by not reporting duplicate issues. Providing the following information will increase the chances of your issue being dealt with quickly: 29 | 30 | - **Overview of the Issue** - if an error is being thrown, a _non minified_ stack trace helps 31 | - **Motivation for or Use Case** - explain why this is a bug for you 32 | - **Versioning** - is this issue being caused because of an outdated plugin? 33 | - **Operating Systems** - is this a problem that is unique to your Operating System? 34 | - **Reproduce the Error** - provide steps on how to re-create the error 35 | - **Related Issues** - has a similar issue been reported before? 36 | - **Suggest a fix** - if you can't fix the bug yourself, perhaps you can point to what might be causing the problem (i.e. line of code or commit) 37 | 38 | ## Submitting a Pull Request 39 | 40 | Before you submit a pull request consider the following guidelines: 41 | 42 | - Search [Github](https://github.com/Stephn-R/electron-angular-boilerplate/pulls) for an open or closed PR that relates to your submission. You do not want to duplicate effort. 43 | - Make your changes in a new git branch: 44 | ```bash 45 | git checkout -b my-fix-branch master 46 | ``` 47 | - Commit your changes using a descriptive commit message that easily describes the resolution. Please note that providing a further description can be made in the PR submission form 48 | ```bash 49 | git commit -a 50 | ``` 51 | - Push your branch to Github 52 | ```bash 53 | git push origin my-fix-branch 54 | ``` 55 | - In Github, submit a PR to ```electron-angular-boilerplate``` `develop` branch. 56 | - If we suggest changes then: 57 | - Make the required updates 58 | - Rebase your branch and force push to your Github Repo _(this will update your PR)_: 59 | ```bash 60 | git rebase master -i 61 | git push origin my-fix-branch -f 62 | ``` 63 | 64 | **That's it! Thank you for your contribution** 65 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Stephen Rodriguez 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | APP_NAME=app 2 | ELECTRON_VERSION=0.28.3 3 | OUTPUT_DIR=build 4 | 5 | apps: windows windows-64 mac-64 linux linux-64 6 | 7 | clean-apps: 8 | rm -rf $OUTPUT_DIR && mkdir $OUTPUT_DIR 9 | windows: 10 | rm -rf ${OUTPUT_DIR}/win32 11 | electron-packager . ${APP_NAME} --platform=win32 --arch=ia32 --version=${ELECTRON_VERSION} --out=${OUTPUT_DIR}/win32 12 | windows-64: 13 | rm -rf ${OUTPUT_DIR}/win64 14 | electron-packager . ${APP_NAME} --platform=win32 --arch=x64 --version=${ELECTRON_VERSION} --out=${OUTPUT_DIR}/win64 15 | mac-64: 16 | rm -rf ${OUTPUT_DIR}/mac64 17 | electron-packager . ${APP_NAME} --platform=darwin --arch=x64 --version=${ELECTRON_VERSION} --out=${OUTPUT_DIR}/mac64 18 | linux: 19 | rm -rf ${OUTPUT_DIR}/linux32 20 | electron-packager . ${APP_NAME} --platform=linux --arch=ia32 --version=${ELECTRON_VERSION} --out=${OUTPUT_DIR}/linux32 21 | linux-64: 22 | rm -rf ${OUTPUT_DIR}/linux64 23 | electron-packager . ${APP_NAME} --platform=linux --arch=x64 --version=${ELECTRON_VERSION} --out=${OUTPUT_DIR}/linux64 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Electron-Boilerplate 2 | A template for Electron projects to build/publish Mac/Windows/Linux compatible applications 3 | 4 | [![Circle CI](https://circleci.com/gh/Stephn-R/electron-angular-boilerplate.svg?style=svg&circle-token=6a9c22099623944c66e2c82e5a11fdd0eb9c2bdf)](https://circleci.com/gh/Stephn-R/electron-angular-boilerplate) [![Dependency Status](https://david-dm.org/Stephn-R/Electron-Angular-Boilerplate.svg)](https://david-dm.org/Stephn-R/Electron-Angular-Boilerplate) [![devDependency Status](https://david-dm.org/Stephn-R/Electron-Angular-Boilerplate/dev-status.svg)](https://david-dm.org/Stephn-R/Electron-Angular-Boilerplate#info=devDependencies) 5 | 6 | ### Table of Contents: 7 | --- 8 | 9 | 1. [Installation](#install) 10 | 2. [The Stack](#stack) 11 | 3. [Adding new views](#views) 12 | 4. [Adding/Managing Bower Resources](#bower) 13 | 5. [Building the Desktop Application](#build-app) 14 | 6. [Testing](#testing) 15 | 7. [FAQ](#faq) 16 | 8. [Contributing](#contributing) 17 | 18 | ### Installation: 19 | 20 | The application runs using Node 4.2.4. I recommend using [nvm](https://github.com/creationix/nvm) to manage your node versions. In addition, node-sass is required globally. 21 | 22 | For development, run: 23 | 24 | ```shell 25 | ./scripts/load_globals.sh 26 | sudo npm install --python=python2.7 27 | bower install 28 | npm start 29 | ``` 30 | 31 | #### Known Bugs: 32 | 33 | Node-sass may fail the `npm start` command. I recommend running the following command to fix this: 34 | 35 | ``` 36 | npm i -g node-sass 37 | npm rebuild node-sass 38 | ``` 39 | 40 | As for preparing the Windows/Mac/Linux apps for distribution. You will first need to run the ```npm install```. Afterwards, run the following to build all the apps for all architectures and distributions: 41 | 42 | ```shell 43 | # Requires GNU Make to be installed 44 | make 45 | ``` 46 | 47 | ### The Stack: 48 | 49 | The App Stack includes various tools and frameworks. Below is a list of those items and their intended purpose: 50 | 51 | - **AngularJS**: Client Side Web-App Stack 52 | - **Bower**: Managing CSS/JS dependencies (i.e. AngularJS) 53 | - **Gulp**: Build Automation for compiling Sass + other resources before Electron 54 | - **Gnu-Make**: Lower level build automation via the terminal (bash) 55 | - **Jest**: Testing framework for ES6/JS modules + code coverage support 56 | - **JSPM**: ES6 and Module importing support 57 | - **Karma/Jasmine**: Testing framework for AngularJS + code coverage support 58 | - **Node.js**: Running the Electron/Desktop Application 59 | - **Sass**: Enhanced Stylesheets 60 | - **Skeleton CSS**: Normalized + Simple CSS Grid framework 61 | - **Travis**: CI (Continous Integration) support 62 | - **Wiredep**: Injecting Bower dependencies into the HTML files 63 | 64 | If you would like to suggest another tool or framework, please refer to the [CONTRIBUTING.md](/CONTRIBUTING.md) before submitting an issue. 65 | 66 | ### Adding new views 67 | 68 | Thanks to the use of Gulp and Wiredep, it is recommended that all new views be written in the `views` directory as `.html` files in order to take advantage of the resource injection tool. The compiled views are then dumped into the same folder with all dependencies (even new ones) injected. 69 | 70 | ### Adding/Managing Bower Resources 71 | 72 | In order to add a new resource, simply install + save it using bower. Below is an example using jQuery 73 | 74 | ```shell 75 | bower install --save jquery 76 | ``` 77 | 78 | And thats it. Since we are using Gulp + Wiredep, all bower dependencies will be included on pages supporting the Wiredep tags. 79 | 80 | ### Building the Desktop Application 81 | 82 | Since the app was built using Node.js, you only need to run the following command for development testing: 83 | 84 | ```shell 85 | npm start 86 | ``` 87 | 88 | npm start will run the latest build and then launch the application. 89 | 90 | In order to only build the latest code run: 91 | 92 | ```shell 93 | gulp 94 | ``` 95 | 96 | As for building the final Desktop Application. You can use any of the following make commands to build them: 97 | 98 | - Mac: `make mac-64` 99 | - Windows 32-Bit: `make windows` 100 | - Windows 64-Bit: `make windows-64` 101 | - Linux: `make linux` 102 | - Linux 64-bit: `make linux-64` 103 | 104 | Alternatively, you can build all the apps at once by calling `make apps` 105 | 106 | ### Testing 107 | 108 | Tests are broken between two layers. All ES6 Modules/JS code should be tested using `Jest`. Alternatively, any testing for AngularJS content should be done using Karma/Jasmine. For more details on this, refer to the [FAQ](#faq) about Where to write tests. 109 | 110 | ### FAQ: 111 | 112 | 1. **Where can I write my tests?** 113 | 114 | All the ES6/Module tests are written in Jest. You can refer to the ```__tests__``` folder for that. All test files for Jest should match against this file extension pattern ```*.jest.js```. Alternatively, all AngularJS tests should be written using the following file extension pattern ```*.spec.js```. These tests should be written within the b`__tests__/app/` folder. 115 | 116 | ### Contributing 117 | 118 | Please see [CONTRIBUTING.md](/CONTRIBUTING.md) for full details on contributing. 119 | -------------------------------------------------------------------------------- /__tests__/app/home/home.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('Controller: HomeController', function() { 4 | var rootScope, scope, controller, httpBackend; 5 | 6 | beforeEach(module('Home')); 7 | 8 | beforeEach(inject(function($controller, $rootScope, $httpBackend) { 9 | httpBackend = $httpBackend; 10 | scope = $rootScope.$new(); 11 | controller = $controller('HomeController', { '$scope': scope }); 12 | rootScope = $rootScope; 13 | scope.$digest(); 14 | })); 15 | 16 | it('should work', function() { 17 | expect(scope).not.toEqual({}); 18 | }); 19 | 20 | afterEach(function() { 21 | httpBackend.verifyNoOutstandingExpectation(); 22 | httpBackend.verifyNoOutstandingRequest(); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /__tests__/sample.jest.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | jest.dontMock('../dist/js/sample.js'); 4 | 5 | describe('My Sample JS', function() { 6 | var SampleApp = require('../dist/js/sample'); 7 | 8 | it('should exist', function() { 9 | expect(SampleApp).toBeDefined(); 10 | console.log(SampleApp); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Electron-Boilerplate", 3 | "version": "1.1.1", 4 | "homepage": "https://github.com/Stephn-R/Electron-Boilerplate", 5 | "authors": [ 6 | "Stephen Rodriguez " 7 | ], 8 | "description": "A template for Electron projects to build/publish Mac/Windows/Linux compatible applications", 9 | "moduleType": [ 10 | "node" 11 | ], 12 | "license": "MIT", 13 | "private": true, 14 | "ignore": [ 15 | "**/.*", 16 | "node_modules", 17 | "bower_components", 18 | "public/vendor", 19 | "test", 20 | "tests" 21 | ], 22 | "dependencies": { 23 | "angular": "1.4.9", 24 | "skeleton": "2.0.4", 25 | "angular-mocks": "1.4.9" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | node: 3 | version: 4.2.2 4 | test: 5 | override: 6 | - npm rebuild 7 | - npm test 8 | -------------------------------------------------------------------------------- /config.js: -------------------------------------------------------------------------------- 1 | System.config({ 2 | baseURL: "c:\\Users\\strodrig\\AppData\\Roaming\\npm\\node_modules\\jspm\\lib\\config/", 3 | defaultJSExtensions: true, 4 | transpiler: "babel", 5 | babelOptions: { 6 | "optional": [ 7 | "runtime" 8 | ] 9 | }, 10 | paths: { 11 | "github:*": "jspm_packages/github/*", 12 | "npm:*": "jspm_packages/npm/*" 13 | }, 14 | 15 | map: { 16 | "babel": "npm:babel-core@5.6.11", 17 | "babel-runtime": "npm:babel-runtime@5.6.11", 18 | "core-js": "npm:core-js@0.9.18", 19 | "github:jspm/nodelibs-process@0.1.1": { 20 | "process": "npm:process@0.10.1" 21 | }, 22 | "npm:babel-runtime@5.6.11": { 23 | "process": "github:jspm/nodelibs-process@0.1.1" 24 | }, 25 | "npm:core-js@0.9.18": { 26 | "fs": "github:jspm/nodelibs-fs@0.1.2", 27 | "process": "github:jspm/nodelibs-process@0.1.1", 28 | "systemjs-json": "github:systemjs/plugin-json@0.1.0" 29 | } 30 | } 31 | }); 32 | -------------------------------------------------------------------------------- /dist/app/home/home.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular.module('Home', []). 5 | controller('HomeController', ['$scope', HomeController]); 6 | 7 | function HomeController($scope) {} 8 | })(); 9 | -------------------------------------------------------------------------------- /dist/css/style.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | width: 100%; 3 | height: 100%; 4 | background: #FEFEFE; } 5 | 6 | /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBS0EsSUFBQSxFQUFBLElBQUEsQ0FBQTtFQUNDLEtBQUEsRUFBQSxJQUFZO0VBQ1osTUFBQSxFQUFBLElBQWE7RUFDYixVQUFBLEVBQUEsT0FBb0IsR0FDcEIiLCJmaWxlIjoic3R5bGUuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiQGltcG9ydCAnYmFzZS9iYXNlJztcblxuQGltcG9ydCAnaW5jbHVkZXMvbmF2JztcbkBpbXBvcnQgJ2luY2x1ZGVzL2Zvb3Rlcic7XG5cbmh0bWwsIGJvZHkge1xuXHR3aWR0aDogMTAwJTtcblx0aGVpZ2h0OiAxMDAlO1xuXHRiYWNrZ3JvdW5kOiAjRkVGRUZFO1xufSJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ== */ 7 | -------------------------------------------------------------------------------- /dist/js/sample.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | let x = 2; 4 | let y = 2; 5 | 6 | class SampleApp { 7 | constructor() { 8 | console.log('Hello World'); 9 | } 10 | } 11 | 12 | console.log(x + y); 13 | 14 | let sampleTest = new SampleApp(); 15 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const del = require('del'); 4 | const gulp = require('gulp'); 5 | const gutil = require('gulp-util'); 6 | const gulpLoadPlugins = require('gulp-load-plugins'); 7 | 8 | let wiredep = require('wiredep').stream; 9 | 10 | const plugins = gulpLoadPlugins(); 11 | const sassRoot = 'src/scss'; 12 | const cssRoot = 'dist/css'; 13 | 14 | const views = 'views/**/*.html'; 15 | const viewsRoot = 'views/'; 16 | 17 | function handleError(err) { 18 | console.log(err.toString()); 19 | } 20 | 21 | // ############################################################################################ 22 | // ############################################################################################ 23 | 24 | gulp.task('clean:styles', (cb) => { 25 | del([ 26 | '**/.sass-cache/**', 27 | ], cb); 28 | }); 29 | 30 | gulp.task('inject-dependencies', function() { 31 | return gulp.src(views) 32 | .pipe(wiredep()) 33 | .pipe(plugins.rename(function(path) { 34 | path.extname = '.html'; 35 | })) 36 | .pipe(gulp.dest(viewsRoot)); 37 | }); 38 | 39 | gulp.task('build-sass', () => { 40 | return gulp.src(sassRoot+'/*.scss') 41 | .pipe(plugins.plumber()) 42 | .pipe(plugins.notify('Compile Sass File: <%= file.relative %>...')) 43 | .pipe(plugins.sourcemaps.init()) 44 | .pipe(plugins.autoprefixer('last 10 versions')) 45 | .pipe(plugins.sass({ 46 | style: 'compressed' 47 | })).on('error', handleError) 48 | .pipe(plugins.sourcemaps.write()) 49 | .pipe(gulp.dest(cssRoot)); 50 | }); 51 | 52 | // ############################################################################################ 53 | // ############################################################################################ 54 | 55 | gulp.task('watch-sass', () => { 56 | plugins.notify('Sass Stream is Active...'); 57 | gulp.watch(sassRoot+'/**/*.scss', ['build-sass']); 58 | }); 59 | 60 | // ############################################################################################ 61 | // ############################################################################################ 62 | 63 | gulp.task('default', ['build-sass', 'inject-dependencies'], () => { 64 | gutil.log('Transposing Sass...'); 65 | }); 66 | 67 | gulp.task('clean', ['clean:styles']); 68 | gulp.task('watch', ['watch-sass']); 69 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration 2 | // Generated on Wed Jul 08 2015 11:17:58 GMT-0400 (Eastern Daylight Time) 3 | 4 | 'use strict'; 5 | 6 | module.exports = function(config) { 7 | config.set({ 8 | 9 | // base path that will be used to resolve all patterns (eg. files, exclude) 10 | basePath: '', 11 | 12 | 13 | // frameworks to use 14 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter 15 | frameworks: ['jasmine'], 16 | 17 | 18 | // list of files / patterns to load in the browser 19 | files: [ 20 | 'dist/vendor/angular/angular.min.js', 21 | 'dist/vendor/angular-mocks/angular-mocks.js', 22 | 'dist/app/**/*.js', 23 | '__tests__/**/*.spec.js' 24 | ], 25 | 26 | 27 | // list of files to exclude 28 | exclude: [ 29 | ], 30 | 31 | 32 | // preprocess matching files before serving them to the browser 33 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 34 | preprocessors: { 35 | 'spec/**/*[sS]pec.js': ['coverage'] 36 | }, 37 | 38 | 39 | // test results reporter to use 40 | // possible values: 'dots', 'progress' 41 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter 42 | reporters: ['progress', 'mocha', 'coverage'], 43 | 44 | plugins: [ 45 | 'karma-jasmine', 46 | 'karma-coverage', 47 | 'karma-mocha-reporter', 48 | 'karma-phantomjs-launcher' 49 | ], 50 | 51 | // web server port 52 | port: 9876, 53 | 54 | 55 | // enable / disable colors in the output (reporters and logs) 56 | colors: true, 57 | 58 | coverageReporter: { 59 | type : 'html', 60 | dir : 'karma-coverage/' 61 | }, 62 | 63 | // level of logging 64 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 65 | logLevel: config.LOG_INFO, 66 | 67 | 68 | // enable / disable watching file and executing tests whenever any file changes 69 | autoWatch: true, 70 | 71 | 72 | // start these browsers 73 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 74 | browsers: ['PhantomJS'], 75 | 76 | 77 | // Continuous Integration mode 78 | // if true, Karma captures browsers, runs the tests and exits 79 | singleRun: true 80 | }); 81 | }; 82 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var _ = require('lodash'); 4 | const { 5 | app, 6 | BrowserWindow, 7 | crashReporter 8 | } = require('electron') 9 | var path = require('path'); 10 | 11 | // #################################################### 12 | // #################################################### 13 | 14 | // Report crashes to our server. 15 | crashReporter.start({ 16 | productName: 'YourName', 17 | companyName: 'YourCompany', 18 | submitURL: 'https://your-domain.com/url-to-submit', 19 | autoSubmit: true 20 | }) 21 | 22 | var mainWindow = null; 23 | var options = { 24 | "debug": true, 25 | "version": "1.0.0", 26 | "views_dir": "views", 27 | "root_view": "index.html" 28 | }; 29 | 30 | options = _.extend({ 31 | // ADDITIONAL CUSTOM SETTINGS 32 | }, options); 33 | 34 | // ############################################################################################ 35 | // ############################################################################################ 36 | 37 | // Quit when all windows are closed. 38 | app.on('window-all-closed', function() { 39 | if(process.platform !== 'darwin') { app.quit(); } 40 | }); 41 | 42 | app.on('ready', function() { 43 | mainWindow = new BrowserWindow({width: 800, height: 600}); 44 | mainWindow.loadURL(path.join('file://', __dirname, options.views_dir, options.root_view)); 45 | if(options.debug) { mainWindow.openDevTools(); } 46 | mainWindow.on('closed', function() { mainWindow = null; }); 47 | }); 48 | 49 | // ############################################################################################ 50 | // ############################################################################################ 51 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-angular-boilerplate", 3 | "version": "1.5.0", 4 | "description": "A basic electron app using AngularJS and Skeleton CSS with ES6 support", 5 | "engines": { 6 | "node": "4.2.x" 7 | }, 8 | "main": "main.js", 9 | "scripts": { 10 | "start": "gulp && electron .", 11 | "postinstall": "./node_modules/bower/bin/bower install && ./node_modules/jspm/jspm.js install", 12 | "debug": "node-inspector && electron --debug=5858 && ", 13 | "test": "./node_modules/jest-cli/bin/jest.js --verbose && ./node_modules/karma/bin/karma start", 14 | "test-angularjs": "karma start --auto-watch" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "https://github.com/Stephn-R/Electron-Boilerplate.git" 19 | }, 20 | "keywords": [ 21 | "electron", 22 | "angular", 23 | "boilerplate", 24 | "desktop", 25 | "applications", 26 | "web" 27 | ], 28 | "author": "steprodriguez10@gmail.com", 29 | "license": "MIT", 30 | "bugs": { 31 | "url": "https://github.com/Stephn-R/Electron-Boilerplate/issues" 32 | }, 33 | "homepage": "https://github.com/Stephn-R/Electron-Boilerplate", 34 | "devDependencies": { 35 | "babel": "6.5.2", 36 | "babel-core": "6.14.0", 37 | "babel-jest": "15.0.0", 38 | "bower": "1.7.9", 39 | "del": "2.2.2", 40 | "electron-packager": "8.0.0", 41 | "gulp": "^3.9.1", 42 | "gulp-autoprefixer": "3.1.1", 43 | "gulp-clean": "^0.3.2", 44 | "gulp-istanbul": "^1.1.1", 45 | "gulp-load-plugins": "^1.3.0", 46 | "gulp-notify": "^2.2.0", 47 | "gulp-plumber": "^1.1.0", 48 | "gulp-rename": "^1.2.2", 49 | "gulp-sass": "^2.3.2", 50 | "gulp-sourcemaps": "^1.6.0", 51 | "gulp-util": "^3.0.7", 52 | "jest-cli": "15.1.1", 53 | "jspm": "0.16.45", 54 | "karma": "1.3.0", 55 | "karma-coverage": "1.1.1", 56 | "karma-jasmine": "^1.0.2", 57 | "karma-mocha-reporter": "^2.1.0", 58 | "karma-phantomjs-launcher": "^1.0.2", 59 | "lodash": "^4.15.0", 60 | "phantomjs": "^2.1.7", 61 | "wiredep": "4.0.0" 62 | }, 63 | "dependencies": { 64 | "jquery": "^3.1.0" 65 | }, 66 | "jspm": { 67 | "dependencies": {}, 68 | "devDependencies": { 69 | "babel": "npm:babel-core@^5.1.13", 70 | "babel-runtime": "npm:babel-runtime@^5.1.13", 71 | "core-js": "npm:core-js@^0.9.4" 72 | } 73 | }, 74 | "jest": { 75 | "collectCoverage": true, 76 | "scriptPreprocessor": "/node_modules/babel-jest", 77 | "testPathIgnorePatterns": [ 78 | "__tests__/app/", 79 | "/node_modules/" 80 | ] 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /scripts/load_globals.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | DEPENDENCIES=( "electron-prebuilt:electron" "electron-packager:electron-packager" "node-inspector:node-inspector" ) 4 | for DEP in ${DEPENDENCIES[@]}; do 5 | PKG="${DEP%%:*}" 6 | CMD="${DEP##*:}" 7 | type $CMD >/dev/null 2>&1 && printf "%s is already installed...\n" $PKG || sudo npm install -g $PKG 8 | done; 9 | 10 | sudo npm i -g node-sass 11 | sudo npm rebuild node-sass 12 | 13 | printf "\nDONE\n"; 14 | -------------------------------------------------------------------------------- /src/scss/base/_colors.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stephnr/electron-angular-boilerplate/abd46a7a6b7ee52b4fdb2cc0b9b528668fca4b4b/src/scss/base/_colors.scss -------------------------------------------------------------------------------- /src/scss/base/_fonts.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stephnr/electron-angular-boilerplate/abd46a7a6b7ee52b4fdb2cc0b9b528668fca4b4b/src/scss/base/_fonts.scss -------------------------------------------------------------------------------- /src/scss/base/_functions.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stephnr/electron-angular-boilerplate/abd46a7a6b7ee52b4fdb2cc0b9b528668fca4b4b/src/scss/base/_functions.scss -------------------------------------------------------------------------------- /src/scss/base/_icons.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stephnr/electron-angular-boilerplate/abd46a7a6b7ee52b4fdb2cc0b9b528668fca4b4b/src/scss/base/_icons.scss -------------------------------------------------------------------------------- /src/scss/base/_mixins.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stephnr/electron-angular-boilerplate/abd46a7a6b7ee52b4fdb2cc0b9b528668fca4b4b/src/scss/base/_mixins.scss -------------------------------------------------------------------------------- /src/scss/base/base.scss: -------------------------------------------------------------------------------- 1 | @import 'functions'; 2 | @import 'mixins'; 3 | @import 'colors'; 4 | @import 'fonts'; 5 | @import 'icons'; -------------------------------------------------------------------------------- /src/scss/includes/_footer.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stephnr/electron-angular-boilerplate/abd46a7a6b7ee52b4fdb2cc0b9b528668fca4b4b/src/scss/includes/_footer.scss -------------------------------------------------------------------------------- /src/scss/includes/_nav.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stephnr/electron-angular-boilerplate/abd46a7a6b7ee52b4fdb2cc0b9b528668fca4b4b/src/scss/includes/_nav.scss -------------------------------------------------------------------------------- /src/scss/style.scss: -------------------------------------------------------------------------------- 1 | @import 'base/base'; 2 | 3 | @import 'includes/nav'; 4 | @import 'includes/footer'; 5 | 6 | html, body { 7 | width: 100%; 8 | height: 100%; 9 | background: #FEFEFE; 10 | } -------------------------------------------------------------------------------- /views/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Electron Boilerplate: Hello World! 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Electron Boilerplate is alive!

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | --------------------------------------------------------------------------------