diff --git a/internal_packages/composer-templates/spec/template-store-spec.es6 b/internal_packages/composer-templates/spec/template-store-spec.es6 index 36a8139db..7c9f06848 100644 --- a/internal_packages/composer-templates/spec/template-store-spec.es6 +++ b/internal_packages/composer-templates/spec/template-store-spec.es6 @@ -1,8 +1,10 @@ import fs from 'fs'; -import shell from 'shell'; +import { remote } from 'electron'; import {Message, DraftStore} from 'nylas-exports'; import TemplateStore from '../lib/template-store'; +const { shell } = remote; + const stubTemplatesDir = '~/.nylas/templates'; const stubTemplateFiles = { diff --git a/internal_packages/preferences/lib/tabs/preferences-keymaps.jsx b/internal_packages/preferences/lib/tabs/preferences-keymaps.jsx index 55a88b2a8..060ce0249 100644 --- a/internal_packages/preferences/lib/tabs/preferences-keymaps.jsx +++ b/internal_packages/preferences/lib/tabs/preferences-keymaps.jsx @@ -2,9 +2,11 @@ import React from 'react'; import _ from 'underscore'; import path from 'path'; import fs from 'fs'; -import shell from 'shell'; +import { remote } from 'electron'; -import {Flexbox} from 'nylas-component-kit'; +import { Flexbox } from 'nylas-component-kit'; + +const { shell } = remote; const displayedKeybindings = [ { diff --git a/src/flux/stores/database-store.coffee b/src/flux/stores/database-store.coffee index 5e2ffdaa5..15f5719e7 100644 --- a/src/flux/stores/database-store.coffee +++ b/src/flux/stores/database-store.coffee @@ -15,7 +15,7 @@ DatabaseChangeRecord = require './database-change-record' DatabaseTransaction = require './database-transaction' JSONBlob = null -{ipcRenderer} = require 'electron' +{remote, ipcRenderer} = require 'electron' DatabaseVersion = 23 DatabasePhase = @@ -108,7 +108,7 @@ class DatabaseStore extends NylasStore _onPhaseChange: (event) => return if NylasEnv.inSpecMode() - app = require('remote').getGlobal('application') + app = remote.getGlobal('application') phase = app.databasePhase() if phase is DatabasePhase.Setup and NylasEnv.isWorkWindow() @@ -135,7 +135,7 @@ class DatabaseStore extends NylasStore # extremely frequently as new models are added when packages load. refreshDatabaseSchema: -> return unless NylasEnv.isWorkWindow() - app = require('remote').getGlobal('application') + app = remote.getGlobal('application') phase = app.databasePhase() if phase isnt DatabasePhase.Setup app.setDatabasePhase(DatabasePhase.Setup) diff --git a/static/index.js b/static/index.js index d9785ca62..16f7c00a7 100644 --- a/static/index.js +++ b/static/index.js @@ -9,6 +9,9 @@ window.eval = global.eval = function() { var path = require('path'); +var electron = require('electron'); +var remote = electron.remote; + function setLoadTime (loadTime) { if (global.NylasEnv) { global.NylasEnv.loadTime = loadTime @@ -17,7 +20,7 @@ function setLoadTime (loadTime) { } function handleSetupError (error) { - var currentWindow = require('remote').getCurrentWindow() + var currentWindow = remote.getCurrentWindow() currentWindow.setSize(800, 600) currentWindow.center() currentWindow.show()