diff options
| -rw-r--r-- | .editorconfig | 11 | ||||
| -rw-r--r-- | .gitattributes | 1 | ||||
| -rw-r--r-- | boilerplate/.editorconfig | 15 | ||||
| -rw-r--r-- | boilerplate/.gitattributes | 1 | ||||
| -rw-r--r-- | boilerplate/.gitignore | 1 | ||||
| -rw-r--r-- | boilerplate/.jshintrc | 12 | ||||
| -rw-r--r-- | boilerplate/index.css | 24 | ||||
| -rw-r--r-- | boilerplate/index.html | 17 | ||||
| -rw-r--r-- | boilerplate/index.js | 30 | ||||
| -rw-r--r-- | boilerplate/license | 21 | ||||
| -rw-r--r-- | boilerplate/package.json | 33 | ||||
| -rw-r--r-- | boilerplate/readme.md | 27 | ||||
| -rw-r--r-- | license | 21 | ||||
| -rw-r--r-- | readme.md | 28 |
14 files changed, 242 insertions, 0 deletions
diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9231818 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +indent_style = tab +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/boilerplate/.editorconfig b/boilerplate/.editorconfig new file mode 100644 index 0000000..8f9d77e --- /dev/null +++ b/boilerplate/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +indent_style = tab +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[{package.json,*.yml}] +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false diff --git a/boilerplate/.gitattributes b/boilerplate/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/boilerplate/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/boilerplate/.gitignore b/boilerplate/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/boilerplate/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/boilerplate/.jshintrc b/boilerplate/.jshintrc new file mode 100644 index 0000000..9fe1be2 --- /dev/null +++ b/boilerplate/.jshintrc @@ -0,0 +1,12 @@ +{ + "node": true, + "esnext": true, + "bitwise": true, + "curly": true, + "immed": true, + "newcap": true, + "noarg": true, + "undef": true, + "unused": "vars", + "strict": true +} diff --git a/boilerplate/index.css b/boilerplate/index.css new file mode 100644 index 0000000..6323c3e --- /dev/null +++ b/boilerplate/index.css @@ -0,0 +1,24 @@ +html, +body { + padding: 0; + margin: 0; +} + +header { + position: absolute; + width: 500px; + height: 250px; + top: 50%; + left: 50%; + margin-top: -125px; + margin-left: -250px; + text-align: center; +} + +header h1 { + font-family: 'Helvetica Neue', Helvetica, sans-serif; + font-size: 60px; + font-weight: 100; + margin: 0; + padding: 0; +} diff --git a/boilerplate/index.html b/boilerplate/index.html new file mode 100644 index 0000000..d5c6efb --- /dev/null +++ b/boilerplate/index.html @@ -0,0 +1,17 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8"> + <title>Electron boilerplate</title> + <link rel="stylesheet" href="index.css"> + </head> + <body> + <div class="container"> + <header> + <h1>Electron boilerplate</h1> + </header> + <section class="main"></section> + <footer></footer> + </div> + </body> +</html> diff --git a/boilerplate/index.js b/boilerplate/index.js new file mode 100644 index 0000000..4382eb3 --- /dev/null +++ b/boilerplate/index.js @@ -0,0 +1,30 @@ +'use strict'; +var app = require('app'); +var BrowserWindow = require('browser-window'); + +require('crash-reporter').start(); + +// prevent window being GC'd +var mainWindow = null; + +app.on('window-all-closed', function () { + if (process.platform !== 'darwin') { + app.quit(); + } +}); + +app.on('ready', function () { + mainWindow = new BrowserWindow({ + width: 600, + height: 400, + resizable: false + }); + + mainWindow.loadUrl('file://' + __dirname + '/index.html'); + + mainWindow.on('closed', function () { + // deref the window + // for multiple windows store them in an array + mainWindow = null; + }) +}); diff --git a/boilerplate/license b/boilerplate/license new file mode 100644 index 0000000..79f9f47 --- /dev/null +++ b/boilerplate/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) <%= name %> <<%= email %>> (<%= website %>) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/boilerplate/package.json b/boilerplate/package.json new file mode 100644 index 0000000..0594935 --- /dev/null +++ b/boilerplate/package.json @@ -0,0 +1,33 @@ +{ + "name": "app", + "productName": "App", + "version": "0.0.0", + "description": "", + "license": "MIT", + "main": "index.js", + "repository": "user/repo", + "author": { + "name": "", + "email": "", + "url": "" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "start": "atom-shell .", + "build": "atom-shell-packager . $npm_package_productName --prune --ignore=node_modules/atom-shell" + }, + "files": [ + "index.js", + "index.html", + "index.css" + ], + "keywords": [ + "electron-app" + ], + "devDependencies": { + "atom-shell": "^0.22.3-1", + "atom-shell-packager": "^2.1.1" + } +} diff --git a/boilerplate/readme.md b/boilerplate/readme.md new file mode 100644 index 0000000..0c942c5 --- /dev/null +++ b/boilerplate/readme.md @@ -0,0 +1,27 @@ +# app + +> My superb app + + +## Dev + +``` +$ npm install +``` + +### Run + +``` +$ npm start +``` + +### Build + +``` +$ npm run build +``` + + +## License + +MIT © [<%= name %>](<%= website %>) @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..da82d9a --- /dev/null +++ b/readme.md @@ -0,0 +1,28 @@ +# electron-boilerplate + +> Boilerplate to kickstart creating an app with [Electron](https://github.com/atom/electron) *(formerly atom-shell)* + +*See [awesome-electron](https://github.com/sindresorhus/awesome-electron) for more useful Electron resources.* + + +## Getting started + +In your directory, run: + +``` +$ curl -fsSL https://github.com/sindresorhus/electron-boilerplate/archive/master.tar.gz | tar -xz --strip-components 2 +``` + +You can also `git clone` or [download](https://github.com/sindresorhus/electron-boilerplate/archive/master.zip) this repo and get contents of the `boilerplate` folder. + +There's also a [Yeoman generator](https://github.com/sindresorhus/generator-electron). + + +## Caveats + +Only OS X is supported for the `$ npm run build` command for now, see [atom-shell-packager#3](https://github.com/maxogden/atom-shell-packager/issues/3). + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) |
