Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: updates electron to 26.2.1 #2532

Merged
merged 7 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions __tests__/components/__snapshots__/Sidebar.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,7 @@ exports[`Sidebar renders without crashing 1`] = `
Object {
"--popper-arrow-bg": "colors.#21242C, #21242C",
"--popper-arrow-shadow": undefined,
"--popper-arrow-shadow-color": undefined,
}
}
bgColor="#21242C"
Expand All @@ -1527,6 +1528,7 @@ exports[`Sidebar renders without crashing 1`] = `
Object {
"--popper-arrow-bg": "colors.#21242C, #21242C",
"--popper-arrow-shadow": undefined,
"--popper-arrow-shadow-color": undefined,
}
}
bgColor="#21242C"
Expand Down
43 changes: 11 additions & 32 deletions config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,38 +68,17 @@ module.exports = {
module: {
rules: [
{
test: /@?(@walletconnect).*\.(ts|js)x?$/,
loader: 'babel-loader',
options: {
presets: [['@babel/preset-env', { targets: 'defaults' }]],
},
},
{
test: /(@cityofzion\/blockchain-service|@cityofzion\/bs-neo3\/node_modules).*\.(ts|js)x?$/,
loader: 'babel-loader',
options: {
presets: [['@babel/preset-env', { targets: 'defaults' }]],
},
},
{
test: /(@cityofzion\/wallet-connect-sdk-wallet-core\/node_modules).*\.(ts|js)x?$/,
loader: 'babel-loader',
options: {
presets: [['@babel/preset-env', { targets: 'defaults' }]],
},
},
{
test: /(@cityofzion\/neon-invoker).*\.(ts|js)x?$/,
loader: 'babel-loader',
options: {
presets: [['@babel/preset-env', { targets: 'defaults' }]],
},
},
{
test: /(@cityofzion\/neon-parser).*\.(ts|js)x?$/,
loader: 'babel-loader',
options: {
presets: [['@babel/preset-env', { targets: 'defaults' }]],
test: /\.m?js$/,
include: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [['@babel/preset-env', { targets: 'defaults' }]],
plugins: [
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining',
],
},
},
},
{
Expand Down
24 changes: 11 additions & 13 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,18 @@ module.exports = {
],
module: {
rules: [
// Must be added to support syntax used in several of the wallet
// connect dependencies => https://github.com/WalletConnect/walletconnect-monorepo/issues/1349
{
test: /@?(@walletconnect).*\.(ts|js)x?$/,
loader: 'babel-loader',
options: {
presets: [['@babel/preset-env', { targets: 'defaults' }]],
},
},
{
test: /(@cityofzion[\\/](neon-parser|neon-invoker|blockchain-service|bs-neo3|wallet-connect-sdk-wallet-core)|neon-parser[\\/]node_modules|neon-invoker[\\/]node_modules|blockchain-service[\\/]node_modules|bs-neo3[\\/]node_modules|wallet-connect-sdk-wallet-core[\\/]node_modules).*\.(ts|js)x?$/,
loader: 'babel-loader',
options: {
presets: [['@babel/preset-env', { targets: 'defaults' }]],
test: /\.m?js$/,
include: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [['@babel/preset-env', { targets: 'defaults' }]],
plugins: [
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining',
],
},
},
},
{
Expand Down
Binary file removed icons/mac/512x512.png.icns
Binary file not shown.
Binary file removed icons/png/512x512.png
Binary file not shown.
Binary file removed icons/win/512x512.png.ico
Binary file not shown.
30 changes: 20 additions & 10 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ const path = require('path')
const url = require('url')
const { autoUpdater } = require('electron-updater')
const log = require('electron-log')
const electronDevToolsInstaller = require('electron-devtools-installer')

const installExtension = electronDevToolsInstaller.default
const REACT_DEVELOPER_TOOLS = electronDevToolsInstaller.REACT_DEVELOPER_TOOLS
const REDUX_DEVTOOLS = electronDevToolsInstaller.REDUX_DEVTOOLS

const port = process.env.PORT || 3000

Expand Down Expand Up @@ -55,14 +60,16 @@ app.on('open-url', (_event, url) => {
mainWindow.webContents.send('link', url)
})

// adapted from https://github.com/chentsulin/electron-react-boilerplate
const installExtensions = () => {
const installer = require('electron-devtools-installer') // eslint-disable-line import/no-extraneous-dependencies
const extensions = ['REACT_DEVELOPER_TOOLS', 'REDUX_DEVTOOLS']

return Promise.all(
extensions.map(name => installer.default(installer[name])),
).catch(console.error)
async function installExtensions() {
const extensions = [REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS]
const promises = extensions.map(extension =>
installExtension(extension)
// eslint-disable-next-line
.then(name => console.log(`Added Extension: ${name}`))
// eslint-disable-next-line
.catch(err => console.log('An error occurred: ', err)),
)
await Promise.all(promises)
}

app.on('ready', () => {
Expand All @@ -80,9 +87,10 @@ app.on('ready', () => {
titleBarStyle: 'hidden',
frame: false,
show: false,
icon: path.join(__dirname, 'icons/png/64x64.png'),
contextIsolation: true,
sandbox: false,
webPreferences: {
sandbox: false,
enableRemoteModule: true,
contextIsolation: false,
allowRunningInsecureContent: false,
Expand Down Expand Up @@ -207,7 +215,9 @@ app.on('ready', () => {
})

if (process.env.NODE_ENV === 'development') {
installExtensions().then(() => onAppReady())
app.whenReady().then(() => {
installExtensions().then(() => onAppReady())
})
} else {
onAppReady()
}
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"main": "./main.js",
"description": "Light wallet for NEO blockchain",
"homepage": "https://github.com/CityOfZion/neon-wallet",
"author": "Ethan Fast <[email protected]> (https://github.com/Ejhfast)",
"scripts": {
"audit:fix": "npm_config_yes=true npx yarn-audit-fix",
"postinstall": "electron-builder install-app-deps",
"start": "cross-env NODE_ENV=production electron .",
"assets": "cross-env NODE_ENV=production webpack --config ./config/webpack.config.prod --progress",
Expand Down Expand Up @@ -139,7 +139,7 @@
"dotenv-cli": "^4.0.0",
"ecc-jsbn": "0.2.0",
"electron-context-menu": "0.9.1",
"electron-json-storage": "4.5.0",
"electron-json-storage": "4.6.0",
"electron-log": "^4.2.4",
"electron-save-file": "1.0.2",
"electron-updater": "5.2.1",
Expand All @@ -160,7 +160,6 @@
"lodash-es": "4.17.21",
"moment": "2.29.4",
"nock": "9.2.3",
"node-abi": "^3.23.0",
"prop-types": "15.6.2",
"qrcode": "0.9.0",
"raf": "3.4.0",
Expand Down Expand Up @@ -228,12 +227,12 @@
"babel-plugin-module-resolver": "3.1.1",
"cross-env": "5.1.1",
"css-loader": "4.2.0",
"electron": "19.0.8",
"electron": "26.2.1",
"electron-builder": "23.3.3",
"electron-builder-notarize": "^1.2.0",
"electron-devtools-installer": "2.2.4",
"electron-devtools-installer": "3.2.0",
"electron-packager": "15.5.0",
"electron-rebuild": "3.2.9",
"electron-rebuild": "^3.2.9",
"enzyme": "3.7.0",
"enzyme-to-json": "3.2.1",
"eslint": "^6.8.0",
Expand Down Expand Up @@ -287,7 +286,8 @@
"mem": "^4.0.0",
"decompress-zip": "^0.2.2",
"https-proxy-agent": "^2.2.3",
"node-abi": "^3.23.0"
"node-abi": "^3.47.0",
"better-sqlite3": "8.7.0"
},
"jest": {
"moduleNameMapper": {
Expand All @@ -313,4 +313,4 @@
"setupTestFrameworkScriptFile": "<rootDir>/__tests__/setupTests.js",
"testURL": "http://localhost"
}
}
}
Loading