Skip to content

Commit

Permalink
Chore/upgrade-electron-12 (#4232)
Browse files Browse the repository at this point in the history
Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com>
  • Loading branch information
jackkav and dimitropoulos authored Dec 21, 2021
1 parent 3960c2d commit 21ab3dd
Show file tree
Hide file tree
Showing 16 changed files with 1,358 additions and 992 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ jobs:
name: Windows
runs-on: windows-2016
env:
NPM_CONFIG_TARGET: 11.2.3
NPM_CONFIG_TARGET: 12.2.3
NPM_CONFIG_DISTURL: https://electronjs.org/headers
NPM_CONFIG_RUNTIME: electron
steps:
Expand All @@ -232,7 +232,7 @@ jobs:
name: Mac
runs-on: macos-latest
env:
NPM_CONFIG_TARGET: 11.2.3
NPM_CONFIG_TARGET: 12.2.3
NPM_CONFIG_DISTURL: https://electronjs.org/headers
NPM_CONFIG_RUNTIME: electron
steps:
Expand Down Expand Up @@ -261,7 +261,7 @@ jobs:
name: Linux
runs-on: ubuntu-latest
env:
NPM_CONFIG_TARGET: 11.2.3
NPM_CONFIG_TARGET: 12.2.3
NPM_CONFIG_DISTURL: https://electronjs.org/headers
NPM_CONFIG_RUNTIME: electron
steps:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.18.3
14.16.0
2 changes: 1 addition & 1 deletion packages/insomnia-app/.babelrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type { import('@babel/core').TransformOptions } */
module.exports = {
presets: [
['@babel/preset-env',{targets: {electron: '11.2.3'}}],
['@babel/preset-env',{targets: {electron: '12.2.3'}}],
'@babel/preset-typescript',
'@babel/preset-react',
],
Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia-app/.npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
runtime = electron
target = 11.2.3
target = 12.2.3
disturl = https://electronjs.org/headers
6 changes: 3 additions & 3 deletions packages/insomnia-app/app/main.development.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'core-js/stable';
import 'regenerator-runtime/runtime';

import * as electron from 'electron';
import contextMenu from 'electron-context-menu';
import installExtension, { REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS } from 'electron-devtools-installer';
import path from 'path';

Expand Down Expand Up @@ -43,6 +41,8 @@ if (!isDevelopment()) {
// So if (window) checks don't throw
global.window = global.window || undefined;

contextMenu();

// When the app is first launched
app.on('ready', async () => {
const { error } = validateInsomniaConfig();
Expand Down
6 changes: 0 additions & 6 deletions packages/insomnia-app/app/main/window-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ interface Bounds {

export function init() {
initLocalStorage();
initContextMenus();
}

export function createWindow() {
Expand Down Expand Up @@ -584,8 +583,3 @@ function initLocalStorage() {
const localStoragePath = path.join(getDataDirectory(), 'localStorage');
localStorage = new LocalStorage(localStoragePath);
}

function initContextMenus() {
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('electron-context-menu')({});
}
2 changes: 0 additions & 2 deletions packages/insomnia-app/app/renderer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import 'core-js/stable';
import 'regenerator-runtime/runtime';
import './ui';
Loading

0 comments on commit 21ab3dd

Please sign in to comment.