From b5c32d9fa9f878f70d60090f88a4209c218357e5 Mon Sep 17 00:00:00 2001 From: Jake Lee Date: Mon, 29 Apr 2019 08:45:25 -0400 Subject: [PATCH] Changes for Windows compat --- app/main.js | 3 +++ gulpfile.js | 7 +++++-- package-lock.json | 35 ++++++++++++++--------------------- package.json | 4 +++- src/main.js | 2 +- 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/app/main.js b/app/main.js index 5accb35..3aa737f 100644 --- a/app/main.js +++ b/app/main.js @@ -19,6 +19,9 @@ var BrowserWindow = electron.BrowserWindow; var mainWindow; app.on('ready', function () { mainWindow = new BrowserWindow({ + webPreferences: { + nodeIntegration: true + }, width: 1024, height: 768, icon: path.join(__dirname, 'contents/img/heat_seek_logo_splash-@2x.png') diff --git a/gulpfile.js b/gulpfile.js index b08c9e0..c2475ed 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,7 +1,9 @@ -const spawn = require('child_process').spawn; +//const spawn = require('child_process').spawn; +const spawn = require('cross-spawn'); const gulp = require('gulp'); const babel = require('gulp-babel'); const css = require('gulp-css'); +const path = require('path'); // 1. Copy the index.html as is gulp.task('html', () => { return gulp.src('src/index.html') @@ -22,7 +24,8 @@ gulp.task('js', () => { // 3. }); // 4. Start the electron process. -const cmd = (name) => `./node_modules/.bin/${name}`; +const cmd = (name) => path.join(__dirname + `/node_modules/.bin/${name}`); +//const cmd = (name) => name; const args = (more) => Array.isArray(more) ? ['.'].concat(more) : ['.']; const exit = () => process.exit(); diff --git a/package-lock.json b/package-lock.json index 7f03240..486ff4a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "heatseek-electron", - "version": "1.0.0", + "version": "0.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -954,9 +954,9 @@ } }, "@types/node": { - "version": "10.14.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.4.tgz", - "integrity": "sha512-DT25xX/YgyPKiHFOpNuANIQIVvYEwCWXgK2jYYwqgaMrYE6+tq+DtmMwlD3drl6DJbUwtlIDnn0d7tIn/EbXBg==", + "version": "10.14.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.6.tgz", + "integrity": "sha512-Fvm24+u85lGmV4hT5G++aht2C5I4Z4dYlWZIh62FAfFO/TfzXtPpoLI6I7AuBWkIFqZCnhFOoTT7RjjaIL5Fjg==", "dev": true }, "abbrev": { @@ -1848,7 +1848,6 @@ "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, "requires": { "nice-try": "^1.0.4", "path-key": "^2.0.1", @@ -2110,9 +2109,9 @@ } }, "electron": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/electron/-/electron-4.1.4.tgz", - "integrity": "sha512-MelOjntJvd33izEjR6H4N/Uii7y535z/b2BuYXJGLNSHL6o1IlyhUQmfiT87kWABayERgeuYERgvsyf956OOFw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/electron/-/electron-5.0.0.tgz", + "integrity": "sha512-++emIe4vLihiYiAVL+E8DT5vSNVFEIuQCRxA+VfpDRVBcog85UB28vi4ogRmMOK3UffzKdWV6e1jqp3T0KpBoA==", "dev": true, "requires": { "@types/node": "^10.12.18", @@ -4070,8 +4069,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { "version": "3.0.1", @@ -4576,13 +4574,12 @@ "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, "node-abi": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.7.1.tgz", - "integrity": "sha512-OV8Bq1OrPh6z+Y4dqwo05HqrRL9YNF7QVMRfq1/pguwKLG+q9UB/Lk0x5qXjO23JjJg+/jqCHSTaG1P3tfKfuw==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.8.0.tgz", + "integrity": "sha512-1/aa2clS0pue0HjckL62CsbhWWU35HARvBDXcJtYKbYR7LnIutmpxmXbuDMV9kEviD2lP/wACOgWmmwljghHyQ==", "requires": { "semver": "^5.4.1" } @@ -5033,8 +5030,7 @@ "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" }, "path-parse": { "version": "1.0.6", @@ -5689,7 +5685,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, "requires": { "shebang-regex": "^1.0.0" } @@ -5697,8 +5692,7 @@ "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" }, "signal-exit": { "version": "3.0.2", @@ -6713,7 +6707,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, "requires": { "isexe": "^2.0.0" } diff --git a/package.json b/package.json index f27a075..160cef8 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@babel/core": "^7.4.3", "@babel/preset-env": "^7.4.3", "@babel/preset-react": "^7.0.0", - "electron": "^4.1.4", + "electron": "^5.0.0", "electron-rebuild": "^1.8.4", "gulp": "^4.0.0", "gulp-babel": "^8.0.0", @@ -37,7 +37,9 @@ }, "dependencies": { "bootstrap": "^4.3.1", + "cross-spawn": "^6.0.5", "jquery": "^3.4.0", + "node-abi": "^2.8.0", "popper.js": "^1.15.0", "react": "^16.8.6", "react-dom": "^16.8.6", diff --git a/src/main.js b/src/main.js index 7df162d..c0fe5fd 100644 --- a/src/main.js +++ b/src/main.js @@ -13,7 +13,7 @@ var mainWindow; app.on('ready', function() { - mainWindow = new BrowserWindow({width: 1024, height: 768, icon: path.join(__dirname, 'contents/img/heat_seek_logo_splash-@2x.png')}); + mainWindow = new BrowserWindow({webPreferences:{nodeIntegration: true}, width: 1024, height: 768, icon: path.join(__dirname, 'contents/img/heat_seek_logo_splash-@2x.png')}); mainWindow.loadURL(url.format({pathname: path.join(__dirname, 'index.html'), protocol: 'file:', slashes: true } ));