Skip to content

Commit

Permalink
Upgrade dependencies (#53)
Browse files Browse the repository at this point in the history
Upgrade dependencies
  • Loading branch information
pzi authored Oct 2, 2019
2 parents e76729b + cef2924 commit a85582d
Show file tree
Hide file tree
Showing 5 changed files with 893 additions and 479 deletions.
8 changes: 3 additions & 5 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
const fs = require('fs')
const { readFileSync } = require('fs')
const path = require('path')
const debounce = require('debounce')
const electron = require('electron')
const { clipboard } = electron
const { ipcRenderer } = electron
const { clipboard, ipcRenderer } = require('electron')
const search = require('./search.js')
const ImageContainer = require('./image-container.js')

Expand All @@ -15,7 +13,7 @@ const images = getImages()

function getImages () {
const file = path.join(__dirname, '../library.gifwit')
const dotGifwit = JSON.parse(fs.readFileSync(file, 'utf8'))
const dotGifwit = JSON.parse(readFileSync(file, 'utf8'))
return dotGifwit.images
}

Expand Down
8 changes: 8 additions & 0 deletions app/preload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const path = require('path')
const { readFileSync } = require('fs')

window.readConfig = () => {
const file = path.join(__dirname, '../library.gifwit')
const dotGifwit = JSON.parse(readFileSync(file, 'utf8'))
return dotGifwit.images
}
27 changes: 14 additions & 13 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
const debug = process.env.NODE_ENV === 'development'
const electron = require('electron')
// Module to control application life.
const { app } = electron
const { app, BrowserWindow, globalShortcut, Menu } = require('electron')
app.commandLine.appendSwitch('js-flags', '--harmony')
// Module to create native browser window.
const { BrowserWindow } = electron
// Module to register/unregister global OS keyboard shortcuts
const { globalShortcut } = electron
// Module to create native menus and context menus
const { Menu } = electron

const path = require('path')
const menubar = require('menubar')
const { menubar } = require('menubar')

const pkg = require('./package.json')
const registerGlobalShortcut = require('./lib/registerGlobalShortcut')
Expand All @@ -22,8 +14,14 @@ const mb = menubar({
icon: `${appPath}/IconTemplate.png`,
preloadWindow: true,
dir: appPath,
width: 240,
height: 500,
browserWindow: {
width: 240,
height: 500,
webPreferences: {
nodeIntegration: true
// preload: path.join(appPath, '/preload.js') // TODO: Use this insted of `nodeIntegration`
}
},
resizable: false,
'show-dock-icon': debug,
tooltip: `${pkg.productName} ${pkg.version}`
Expand All @@ -35,7 +33,10 @@ mb.on('ready', () => {
if (debug) {
const debugWindow = new BrowserWindow({
width: 995,
height: 600
height: 600,
webPreferences: {
nodeIntegration: true
}
})
debugWindow.loadURL(`file://${appPath}/index.html`)
debugWindow.openDevTools()
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"main": "main.js",
"private": true,
"scripts": {
"build:base": "electron-packager . --out=_dist --arch=x64 ----electron-version=4.0.5 --overwrite --no-prune",
"build:base": "electron-packager . --out=_dist --arch=x64 ----electron-version=6.0.11 --overwrite --no-prune",
"build:mac": "yarn run build:base --platform=darwin --icon=TempIcon.icns",
"build:win": "yarn run build:base --platform=win32",
"build": "yarn run build:mac && yarn run build:win",
Expand All @@ -31,11 +31,11 @@
"license": "WTFPL",
"dependencies": {
"debounce": "^1.0.0",
"menubar": "^5.2.3"
"menubar": "^6.0.0"
},
"devDependencies": {
"electron": "^4.0.0",
"electron-packager": "^13.0.0",
"electron": "^6.0.0",
"electron-packager": "^14.0.0",
"standard": "^14.3.1"
},
"prettier": {
Expand Down
Loading

0 comments on commit a85582d

Please sign in to comment.