From 2f7dad064793bd8dd6f1fc5ff12fcf03464e4df8 Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Sat, 7 Jan 2017 19:34:16 +0100 Subject: [PATCH] setup most basic build for electron --- .gitignore | 2 ++ bower.json | 4 +++- electron/{ => assets/img}/ico.png | Bin electron/main.js | 5 +++-- package.json | 25 +++++++++++++++++++------ 5 files changed, 27 insertions(+), 9 deletions(-) rename electron/{ => assets/img}/ico.png (100%) diff --git a/.gitignore b/.gitignore index ffa677c9f8..94ce83b1a3 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,6 @@ app/styles/**/*.css.map .sass-cache bower_components app/bower_components +dist +build *.log diff --git a/bower.json b/bower.json index ac1a8e0107..10498920cd 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,9 @@ { "name": "superProductivity", "version": "0.0.0", - "authors": [], + "authors": [ + "Johannes Millan (http://super-productivity.com)" + ], "license": "none", "private": true, "ignore": [ diff --git a/electron/ico.png b/electron/assets/img/ico.png similarity index 100% rename from electron/ico.png rename to electron/assets/img/ico.png diff --git a/electron/main.js b/electron/main.js index 17ebdcd425..3c721969f2 100644 --- a/electron/main.js +++ b/electron/main.js @@ -5,6 +5,8 @@ const powerSaveBlocker = require('electron').powerSaveBlocker; const moment = require('moment'); const open = require('open'); const CONFIG = require('./CONFIG'); +const IMAGE_FOLDER = __dirname + '/assets/img/'; + const idle = require('./idle'); const jira = require('./jira'); @@ -74,7 +76,7 @@ app.on('window-all-closed', function () { let appIcon = null; app.on('ready', () => { - appIcon = new electron.Tray('electron/ico.png'); + appIcon = new electron.Tray(IMAGE_FOLDER + 'ico.png'); let contextMenu = electron.Menu.buildFromTemplate([ { label: 'Show App', click: () => { @@ -119,7 +121,6 @@ app.on('ready', () => { setInterval(trackTimeFn, CONFIG.PING_INTERVAL); }); - // listen to events from frontend electron.ipcMain.on('SHUTDOWN', () => { app.isQuiting = true; diff --git a/package.json b/package.json index ca11783a17..b005f7bc9d 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,31 @@ { "name": "superProductivity", "version": "0.0.0", - "description": "", - "main": "gulpfile.js", + "description": "Personal Task Management App to help you with your daily struggle with JIRA etc.", + "main": "./electron/main.js", "repository": {}, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "start": "electron ./electron/main.js" + "start": "electron ./electron/main.js", + "pack": "build --dir", + "dist": "build" }, - "author": "", + "author": "Johannes Millan (http://super-productivity.com)", "license": "none", + "build": { + "appId": "superProductivity", + "mac": { + "category": "task management" + }, + "win": { + "iconUrl": "windowsicon" + }, + "linux": { + } + }, "devDependencies": { + "electron": "^1.4.1", + "electron-inspector": "^0.1.4", "browser-sync": "latest", "del": "latest", "ecstatic": "latest", @@ -55,8 +70,6 @@ "yargs": "latest" }, "dependencies": { - "electron": "^1.4.1", - "electron-inspector": "^0.1.4", "jira": "^0.9.2", "moment": "^2.17.1", "open": "0.0.5"