diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4386cdbd05..ef7d94c7d4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -62,8 +62,8 @@ you'll want to get the source, build it, and run it locally. ## Installing Prerequisites -You'll need git and a recent version of Node.JS (any v7.2.1+ is recommended -with npm v3.10.10+). [nvm](https://github.com/creationix/nvm) is also highly +You'll need git and a recent version of Node.JS (currently v16.X is recommended +with npm v8.1.2+). [nvm](https://github.com/creationix/nvm) is also highly recommended. Based on your platform, you'll also need: **Windows:** diff --git a/app/internal_packages/account-sidebar/lib/components/account-switcher.tsx b/app/internal_packages/account-sidebar/lib/components/account-switcher.tsx index e5d8c03270..69877f3dfe 100644 --- a/app/internal_packages/account-sidebar/lib/components/account-switcher.tsx +++ b/app/internal_packages/account-sidebar/lib/components/account-switcher.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Account, localized, Actions, PropTypes } from 'mailspring-exports'; import { RetinaImg } from 'mailspring-component-kit'; -import { ipcRenderer, remote } from 'electron'; +import { ipcRenderer } from 'electron'; import * as AccountCommands from '../account-commands'; export default class AccountSwitcher extends React.Component<{ @@ -39,7 +39,7 @@ export default class AccountSwitcher extends React.Component<{ }; _onShowMenu = () => { - const menu = remote.Menu.buildFromTemplate(this._makeMenuTemplate()); + const menu = require('@electron/remote').Menu.buildFromTemplate(this._makeMenuTemplate()); menu.popup({}); }; diff --git a/app/internal_packages/account-sidebar/lib/sidebar-item.ts b/app/internal_packages/account-sidebar/lib/sidebar-item.ts index 55f6730156..6a412eb2c0 100644 --- a/app/internal_packages/account-sidebar/lib/sidebar-item.ts +++ b/app/internal_packages/account-sidebar/lib/sidebar-item.ts @@ -1,5 +1,5 @@ import _ from 'underscore'; -import { remote } from 'electron'; + import _str from 'underscore.string'; import { OutlineViewItem } from 'mailspring-component-kit'; import { @@ -18,7 +18,7 @@ import { ISidebarItem } from './types'; const idForCategories = categories => _.pluck(categories, 'id').join('-'); -const countForItem = function(perspective) { +const countForItem = function (perspective) { const unreadCountEnabled = AppEnv.config.get('core.workspace.showUnreadForAllCategories'); if (perspective.isInbox() || unreadCountEnabled) { return perspective.unreadCount(); @@ -28,7 +28,7 @@ const countForItem = function(perspective) { const isItemSelected = perspective => FocusedPerspectiveStore.current().isEqual(perspective); -const isItemCollapsed = function(id) { +const isItemCollapsed = function (id) { if (AppEnv.savedState.sidebarKeysCollapsed[id] !== undefined) { return AppEnv.savedState.sidebarKeysCollapsed[id]; } else { @@ -36,14 +36,14 @@ const isItemCollapsed = function(id) { } }; -const toggleItemCollapsed = function(item) { +const toggleItemCollapsed = function (item) { if (!(item.children.length > 0)) { return; } SidebarActions.setKeyCollapsed(item.id, !isItemCollapsed(item.id)); }; -const onDeleteItem = function(item) { +const onDeleteItem = function (item) { if (item.deleted === true) { return; } @@ -52,7 +52,7 @@ const onDeleteItem = function(item) { return; } - const response = remote.dialog.showMessageBoxSync({ + const response = require('@electron/remote').dialog.showMessageBoxSync({ type: 'info', message: localized('Are you sure?'), detail: localized( @@ -74,7 +74,7 @@ const onDeleteItem = function(item) { ); }; -const onEditItem = function(item, value) { +const onEditItem = function (item, value) { let newDisplayName; if (!value) { return; diff --git a/app/internal_packages/composer-signature/lib/preferences-signatures.tsx b/app/internal_packages/composer-signature/lib/preferences-signatures.tsx index 04962888af..8167010afa 100644 --- a/app/internal_packages/composer-signature/lib/preferences-signatures.tsx +++ b/app/internal_packages/composer-signature/lib/preferences-signatures.tsx @@ -1,4 +1,4 @@ -import { remote } from 'electron'; + import React from 'react'; import { localized, @@ -27,7 +27,7 @@ interface SignatureEditorProps { accountsAndAliases: IAliasSet; } -interface SignatureEditorState {} +interface SignatureEditorState { } class SignatureEditor extends React.Component { _onTitleChange = event => { @@ -57,7 +57,7 @@ class SignatureEditor extends React.Component sig.body === RenderSignatureData({ ...sig.data, templateName: t.name }) ); if (!htmlMatchesATemplate) { - const idx = remote.dialog.showMessageBoxSync({ + const idx = require('@electron/remote').dialog.showMessageBoxSync({ type: 'warning', buttons: [localized('Cancel'), localized('Continue')], message: localized('Revert custom HTML?'), @@ -131,43 +131,43 @@ class SignatureEditor extends React.Component - {localized('Raw Source')} - , -