Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
szwacz committed Apr 25, 2015
0 parents commit 2ba72e0
Show file tree
Hide file tree
Showing 17 changed files with 2,461 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.json]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
bower_components
*.log
.DS_Store
Thumbs.db
/build/
/releases/
/tmp/
16 changes: 16 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// -----------------------------------------------------
// Here is the starting point for your own code.
// All stuff below is just to show you how it works.
// -----------------------------------------------------

// Browser modules are imported through new ES6 syntax.
import { greet } from './hello_world/hello_world';

// Node modules are required the same way as always.
var os = require('os');

var greetElement = document.getElementById('greet');
greetElement.innerHTML = greet();

var platform = document.getElementById('platform-info');
platform.innerHTML = os.platform();
5 changes: 5 additions & 0 deletions app/hello_world/hello_universe.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var greet = function () {
return 'Hello Universe!'
};

export default greet;
10 changes: 10 additions & 0 deletions app/hello_world/hello_universe.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Default imports test
import greet from './hello_universe';

describe("hello universe", function () {

it("greets better than hello world", function () {
expect(greet()).toBe('Hello Universe!');
});

});
7 changes: 7 additions & 0 deletions app/hello_world/hello_world.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export var greet = function () {
return 'Hello World!';
};

export var bye = function () {
return 'See ya!';
};
14 changes: 14 additions & 0 deletions app/hello_world/hello_world.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Named imports test
import { greet, bye } from './hello_world';

describe("hello world", function () {

it("greets", function () {
expect(greet()).toBe('Hello World!');
});

it("says goodbye", function () {
expect(bye()).toBe('See ya!');
});

});
24 changes: 24 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">

<link href="./stylesheets/main.css" rel="stylesheet" type="text/css">

<script src="vendor/require.js"></script>
<script>
requirejs(['app'], function (app) {});
</script>

</head>
<body>

<div class="container">
<h1 id="greet"></h1>
<p class="subtitle">
Welcome to <a href="http://electron.atom.io" class="js-external-link">Electron</a> app running on this magnificent <strong id="platform-info"></strong> machine.
</p>
</div>

</body>
</html>
33 changes: 33 additions & 0 deletions app/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
'use strict';

var app = require('app');
var BrowserWindow = require('browser-window');
var jetpack = require('fs-jetpack');

// Must keep references to opened windows,
// otherwise Garbage Collector will kick in.
var mainWindow = null;

// Atom-shell is ready, we can start with our stuff.
app.on('ready', function () {

var appCodeDir = jetpack.cwd(__dirname);
var manifest = appCodeDir.read('package.json', 'json');

mainWindow = new BrowserWindow({ width: 800, height: 600 });
mainWindow.loadUrl('file://' + __dirname + '/index.html');

mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null;
});
});

// Quit when all windows are closed.
app.on('window-all-closed', function () {
if (process.platform != 'darwin') {
app.quit();
}
});
14 changes: 14 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "electron-boilerplate",
"productName": "Electron Boilerplate",
"description": "Starter for your Electron application. Out of the box ready for serious stuff.",
"version": "0.1.0",
"author": "Mr Gumby <[email protected]>",
"main": "main.js",
"config": {
"target": "development"
},
"dependencies": {
"fs-jetpack": "^0.6.4"
}
}
25 changes: 25 additions & 0 deletions app/stylesheets/main.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}

body {
display: flex;
justify-content: center;
align-items: center;
font-family: sans-serif;
}

a {
text-decoration: none;
}

.container {
text-align: center;
}

.subtitle {
color: gray;
}
Loading

0 comments on commit 2ba72e0

Please sign in to comment.