From 3c3c12fa5daa06d9c3ab40e4f682af43c0afd09d Mon Sep 17 00:00:00 2001 From: Shawn Date: Fri, 15 Mar 2019 13:58:42 -0500 Subject: [PATCH] Fix keytar and bundling --- electron-builder.json | 16 ++++++++-------- package.json | 4 ++-- webpack.base.config.js | 1 + webpack.electron.config.js | 38 ++++++-------------------------------- yarn.lock | 10 +++++----- 5 files changed, 22 insertions(+), 47 deletions(-) diff --git a/electron-builder.json b/electron-builder.json index 1a5995996..261a37f75 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -6,19 +6,19 @@ }, "files": [ { - "from": "dist/electron", + "from": "dist/electron/ui", "to": "./", - "filter": ["!dist/!electron/**/*"] + "filter": ["!dist/!electron/ui/**/*"] + }, + { + "from": "dist/electron/webpack", + "to": "./", + "filter": ["!dist/!electron/!webpack/*.js", "!dist/!electron/!webpack/!static/**/*"] }, { "from": "dist/electron/static", "to": "./", - "filter": ["!dist/!electron/static/**/*"] - }, - { - "from": "dist/electron/ui", - "to": "./", - "filter": ["!dist/!electron/ui/**/*"] + "filter": ["!dist/!electron/!static/index.html"] } ], "publish": [ diff --git a/package.json b/package.json index 2b8b3c750..b6b61f094 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "express": "^4.16.4", "formik": "^0.10.4", "hast-util-sanitize": "^1.1.2", - "keytar": "^4.3.0", + "keytar": "4.4.1", "lbry-format": "https://github.com/lbryio/lbry-format.git", "lbry-redux": "lbryio/lbry-redux#f140db38dd73cead9e87549340fa9434da62ba8a", "lbryinc": "lbryio/lbryinc#636f014f421827ab6b74caf334c364a362a1a099", @@ -122,7 +122,7 @@ "decompress": "^4.2.0", "del": "^3.0.0", "devtron": "^1.4.0", - "electron": "^4.0.4", + "electron": "4.1.0", "electron-builder": "^20.38.4", "electron-devtools-installer": "^2.2.3", "electron-publisher-s3": "^20.8.1", diff --git a/webpack.base.config.js b/webpack.base.config.js index 939d604ff..25fc2ab0f 100644 --- a/webpack.base.config.js +++ b/webpack.base.config.js @@ -1,4 +1,5 @@ const path = require('path'); +const webpack = require('webpack'); const merge = require('webpack-merge'); const { DefinePlugin, ProvidePlugin } = require('webpack'); const { getIfUtils, removeEmpty } = require('webpack-config-utils'); diff --git a/webpack.electron.config.js b/webpack.electron.config.js index 77ca79c6e..5e0c8dac9 100644 --- a/webpack.electron.config.js +++ b/webpack.electron.config.js @@ -14,14 +14,10 @@ const mainConfig = { }, output: { filename: '[name].js', - path: __dirname + '/dist/electron', + path: __dirname + '/dist/electron/webpack', }, module: { rules: [ - { - test: /\.node$/, - use: 'node-loader', - }, { test: /\.jsx?$/, use: [ @@ -43,17 +39,16 @@ const mainConfig = { { from: `${STATIC_ROOT}/`, to: `${DIST_ROOT}/electron/static/`, - ignore: ['font/**/*', 'index.html'], - }, - { - from: `${STATIC_ROOT}/index.html`, - to: `${DIST_ROOT}/electron/index.html`, + ignore: ['font/**/*'], }, ]), ], devServer: { contentBase: path.join(__dirname, 'dist/electron'), }, + externals: { + keytar: 'require("keytar")', + }, }; const renderConfig = { @@ -63,14 +58,10 @@ const renderConfig = { }, output: { filename: '[name].js', - path: __dirname + '/dist/electron', + path: __dirname + '/dist/electron/webpack', }, module: { rules: [ - { - test: /\.node$/, - use: 'node-loader', - }, { test: /\.jsx?$/, use: [ @@ -87,23 +78,6 @@ const renderConfig = { }, ], }, - plugins: [ - new CopyWebpackPlugin([ - { - from: `${STATIC_ROOT}/`, - to: `${DIST_ROOT}/electron/static/`, - ignore: ['font/**/*', 'index.html', 'index.dev.html'], - }, - { - from: `${STATIC_ROOT}/index.html`, - to: `${DIST_ROOT}/electron/index.html`, - }, - { - from: `${STATIC_ROOT}/index.dev.html`, - to: `${DIST_ROOT}/electron/index.dev.html`, - }, - ]), - ], }; module.exports = [merge(baseConfig, mainConfig), merge(baseConfig, renderConfig)]; diff --git a/yarn.lock b/yarn.lock index bbcf4e69e..eef4fb108 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3568,10 +3568,10 @@ electron-window-state@^4.1.1: jsonfile "^2.2.3" mkdirp "^0.5.1" -electron@^4.0.4: - version "4.0.6" - resolved "https://registry.yarnpkg.com/electron/-/electron-4.0.6.tgz#f936772ddb5eaa026591ea14ef806e1385fbbda9" - integrity sha512-r2ow/EmDibjoCNJp35mB1CcPs2xBF9fp2eoWuUOJmpVQyzdba6EnqsSD1BxwXzF9vQ5WkQ2UbfXBIvpomrdioQ== +electron@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/electron/-/electron-4.1.0.tgz#ecba9c83de271e8ba7637332ece9ed023c6ea3f0" + integrity sha512-q/yTi9dT5UEFK/s+vOQaHNkTHWiRK9kEBYVJt34nmWc9piW42hXT+nhKUEHHhccMPr3q18gG0iPZqeR+LG76ow== dependencies: "@types/node" "^10.12.18" electron-download "^4.1.0" @@ -5982,7 +5982,7 @@ kebab-case@^1.0.0: resolved "https://registry.yarnpkg.com/kebab-case/-/kebab-case-1.0.0.tgz#3f9e4990adcad0c686c0e701f7645868f75f91eb" integrity sha1-P55JkK3K0MaGwOcB92RYaPdfkes= -keytar@^4.3.0: +keytar@4.4.1: version "4.4.1" resolved "https://registry.yarnpkg.com/keytar/-/keytar-4.4.1.tgz#156af8a9b016bf118ee9948b02418c81d760a5ba" integrity sha512-6xEe7ybXSR5EZC+z0GI2yqLYZjV1tyPQY2xSZ8rGsBxrrLEh8VR/Lfqv59uGX+I+W+OZxH0jCXN1dU1++ify4g==