Initialised project (mainly with filler)
This commit is contained in:
parent
84a884333f
commit
4d2243e6b5
4 changed files with 57 additions and 10 deletions
|
@ -4,10 +4,13 @@
|
|||
"description": "Make your computer keyboard sound like a mechanical keyboard",
|
||||
"main": "build/main.js",
|
||||
"scripts": {
|
||||
"create-build-dirs": "mkdir -p build/lib build/js build/css build/img dist/ ",
|
||||
"clean": "rm -rf node_modules/ dist/ build/",
|
||||
"build-js": " bash scripts/build-js.sh",
|
||||
"start": "node_modules/.bin/electron build/",
|
||||
"start": "node_modules/.bin/electron .",
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"lint": "eslint -c node_modules/eslint-config/.eslintrc 'src/'"
|
||||
"lint": "eslint -c node_modules/eslint-config/.eslintrc 'src/'",
|
||||
"build-html": "cp src/index.html build/index.html"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -2,15 +2,13 @@
|
|||
|
||||
set -e
|
||||
|
||||
cp node_modules/bootstrap/dist/js/bootstrap.js static/src/js/lib/
|
||||
|
||||
echo ">> Building Libraries..."
|
||||
uglifyjs node_modules/jquery/dist/jquery.js --compress --screw-ie8 --define --stats --keep-fnames -o build/lib/jquery.js
|
||||
# uglifyjs node_modules/jquery/dist/jquery.js --compress --screw-ie8 --define --stats --keep-fnames -o build/lib/jquery.js
|
||||
uglifyjs node_modules/bootstrap/dist/js/bootstrap.js --compress --screw-ie8 --define --stats --keep-fnames -o build/lib/bootstrap.js
|
||||
|
||||
echo ">> Building Application JS..."
|
||||
browserify -t reactify src/page.js -o build/page.js
|
||||
uglifyjs build/js/app.js --compress --screw-ie8 --define --stats --keep-fnames -o src/js/app.js
|
||||
browserify -t reactify src/js/app.js -o build/js/app.js
|
||||
uglifyjs build/js/app.js --compress --screw-ie8 --define --stats --keep-fnames -o build/js/app.js
|
||||
|
||||
echo ">> Building Main JS..."
|
||||
uglifyjs build/main.js --compress --screw-ie8 --define --stats --keep-fnames -o src/main.js
|
||||
uglifyjs src/main.js --compress --screw-ie8 --define --stats --keep-fnames -o build/main.js
|
||||
|
|
|
@ -1 +1,14 @@
|
|||
index.html
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Hello World!</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello World!</h1>
|
||||
We are using node <script>document.write(process.versions.node)</script>,
|
||||
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||
and Electron <script>document.write(process.versions.electron)</script>.
|
||||
<script src="page.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
35
src/main.js
35
src/main.js
|
@ -1 +1,34 @@
|
|||
main.js
|
||||
var app = require('app');
|
||||
var BrowserWindow = require('browser-window');
|
||||
var Menu = require('menu');
|
||||
var globalShortcut = require('global-shortcut')
|
||||
var fs = require('fs');
|
||||
var Tray = require('tray');
|
||||
|
||||
require('crash-reporter').start(); // Start crash reporter
|
||||
|
||||
// Creating menu
|
||||
var menu = new Menu();
|
||||
Menu.setApplicationMenu(menu);
|
||||
var mainWindow = null;
|
||||
|
||||
|
||||
// Make sure the application closes
|
||||
app.on('window-all-closed', function () {
|
||||
app.quit();
|
||||
});
|
||||
|
||||
app.on('ready', function () {
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600
|
||||
});
|
||||
console.log(__dirname);
|
||||
mainWindow.loadUrl('file://' + __dirname + '/index.html');
|
||||
|
||||
mainWindow.toggleDevTools();
|
||||
|
||||
mainWindow.on('closed', function() {
|
||||
mainWindow = undefined;
|
||||
});
|
||||
});
|
Reference in a new issue