Skip to content

Commit

Permalink
ton of updates regarding module/ts api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TanninOne committed Oct 15, 2019
1 parent cd5754e commit 27b811f
Show file tree
Hide file tree
Showing 148 changed files with 4,108 additions and 3,940 deletions.
16 changes: 8 additions & 8 deletions package.json
Expand Up @@ -9,7 +9,7 @@
"url": "https://github.com/Nexus-Mods/Vortex"
},
"vortex": {
"electron": "6.0.10"
"electron": "7.0.0"
},
"scripts": {
"_assets_out": "node InstallAssets.js out",
Expand Down Expand Up @@ -90,7 +90,7 @@
"@types/levelup": "^3.1.1",
"@types/lodash": "^4.14.138",
"@types/minimatch": "^3.0.3",
"@types/node": "^12.7.5",
"@types/node": "^12.7.12",
"@types/node-uuid": "^0.0.28",
"@types/opn": "^5.5.0",
"@types/react": "^16.9.2",
Expand Down Expand Up @@ -132,7 +132,7 @@
"copyfiles": "^2.1.1",
"cross-env": "^6.0.0",
"devtron": "^1.4.0",
"electron": "^6.0.10",
"electron": "^7.0.0-beta.6",
"electron-builder": "21.2.0",
"electron-devtools-installer": "^2.2.4",
"electron-download-tf": "^4.3.4",
Expand All @@ -158,7 +158,7 @@
"tslint": "^5.20.0",
"tslint-eslint-rules": "^5.4.0",
"tslint-react": "^4.1.0",
"typescript": "^3.6.3",
"typescript": "^3.6.4",
"webpack": "^4.40.2",
"webpack-cli": "^3.3.9",
"webpack-node-externals": "^1.7.2",
Expand Down Expand Up @@ -214,16 +214,16 @@
"react": "^16.9.0",
"react-bootstrap": "^0.32.4",
"react-datepicker": "^2.9.6",
"react-dnd": "^9.3.4",
"react-dnd-html5-backend": "^9.3.4",
"react-dnd": "^7.3.1",
"react-dnd-html5-backend": "^7.2.0",
"react-dom": "^16.9.0",
"react-i18next": "^10.12.5",
"react-markdown": "^4.2.2",
"react-overlays": "^1.2.0",
"react-redux": "^7.1.1",
"react-resize-detector": "^4.2.1",
"react-safe-html": "^0.6.1",
"react-select": "^3.0.4",
"react-select": "^1.2.1",
"react-sortable-tree": "^2.6.2",
"recharts": "^1.7.1",
"redux": "^4.0.4",
Expand All @@ -246,7 +246,7 @@
"vortex-run": "file:src/util/vortex-run",
"wholocks": "Nexus-Mods/node-wholocks",
"winapi-bindings": "Nexus-Mods/node-winapi-bindings",
"winston": "^3.2.1",
"winston": "^2.4.3",
"write-file-atomic": "^3.0.0",
"ws": "^7.1.2"
}
Expand Down
2 changes: 1 addition & 1 deletion src/actions/notifications.ts
Expand Up @@ -6,7 +6,7 @@ import {truthy} from '../util/util';

import safeCreateAction from './safeCreateAction';

import * as Promise from 'bluebird';
import Promise from 'bluebird';
import { ipcMain, ipcRenderer } from 'electron';

import * as reduxAct from 'redux-act';
Expand Down
4 changes: 2 additions & 2 deletions src/app/Application.ts
Expand Up @@ -27,10 +27,10 @@ import MainWindowT from './MainWindow';
import SplashScreenT from './SplashScreen';
import TrayIconT from './TrayIcon';

import * as Promise from 'bluebird';
import Promise from 'bluebird';
import crashDump from 'crash-dump';
import {app, dialog, ipcMain, shell} from 'electron';
import * as isAdmin from 'is-admin';
import isAdmin from 'is-admin';
import * as _ from 'lodash';
import * as path from 'path';
import { allow } from 'permissions';
Expand Down
2 changes: 1 addition & 1 deletion src/app/MainWindow.ts
Expand Up @@ -10,7 +10,7 @@ import opn from '../util/opn';
import * as storeHelperT from '../util/storeHelper';
import { truthy } from '../util/util';

import * as Promise from 'bluebird';
import Promise from 'bluebird';
import { screen } from 'electron';
import * as Redux from 'redux';
import TrayIcon from './TrayIcon';
Expand Down
2 changes: 1 addition & 1 deletion src/app/SplashScreen.ts
@@ -1,4 +1,4 @@
import * as Promise from 'bluebird';
import Promise from 'bluebird';
import getVortexPath from '../util/getVortexPath';
import { log } from '../util/log';

Expand Down
2 changes: 1 addition & 1 deletion src/controls/Advanced.tsx
Expand Up @@ -49,4 +49,4 @@ function mapStateToProps(state: IState): IConnectedProps {
};
}

export default connect(mapStateToProps)(Advanced) as React.ComponentClass<{}>;
export default connect(mapStateToProps)(Advanced);
2 changes: 1 addition & 1 deletion src/controls/Banner.tsx
Expand Up @@ -118,4 +118,4 @@ function mapStateToProps(state: any, ownProps: IProps): IConnectedProps {
export default
extend(registerBanner, 'group')(
connect(mapStateToProps)(
Banner as any)) as React.ComponentClass<ExportType>;
Banner) as any) as React.ComponentClass<ExportType>;
2 changes: 1 addition & 1 deletion src/controls/DraggableList.tsx
@@ -1,4 +1,4 @@
import * as Promise from 'bluebird';
import Promise from 'bluebird';
import * as React from 'react';
import { ListGroup } from 'react-bootstrap';
import { DropTarget, ConnectDropTarget, DropTargetConnector, DropTargetMonitor, DropTargetSpec } from 'react-dnd';
Expand Down
2 changes: 1 addition & 1 deletion src/controls/Dropzone.tsx
Expand Up @@ -7,7 +7,7 @@ import { truthy } from '../util/util';

import Icon from './Icon';

import * as Promise from 'bluebird';
import Promise from 'bluebird';

import * as React from 'react';
import * as Redux from 'redux';
Expand Down
2 changes: 1 addition & 1 deletion src/controls/FormFeedback.tsx
@@ -1,7 +1,7 @@
import Icon from './Icon';
import Spinner from './Spinner';

import * as classNames from 'classnames';
import classNames from 'classnames';
import * as _ from 'lodash';
import * as PropTypes from 'prop-types';
import * as React from 'react';
Expand Down
9 changes: 4 additions & 5 deletions src/controls/FormFields.tsx
Expand Up @@ -155,12 +155,11 @@ export class FormPathItem extends React.Component<IFormPathProps, {}> {
filters: extensions !== undefined ? [
{ name: 'Files', extensions },
] : [],
}, (fileNames: string[]) => {
if (fileNames === undefined) {
return;
}).then(result => {
const { filePaths } = result;
if ((filePaths !== undefined) && (filePaths.length > 0)) {
onChangeValue(stateKey, filePaths[0]);
}

onChangeValue(stateKey, fileNames[0]);
});
}
}
2 changes: 1 addition & 1 deletion src/controls/Icon.tsx
@@ -1,6 +1,6 @@
import { log } from '../util/log';

import * as Promise from 'bluebird';
import Promise from 'bluebird';
// using fs directly because the svg may be bundled inside the asar so
// we need the electron-fs hook here
import { remote } from 'electron';
Expand Down
2 changes: 1 addition & 1 deletion src/controls/Table.tsx
Expand Up @@ -22,7 +22,7 @@ import TableRow from './table/TableRow';
import ToolbarIcon from './ToolbarIcon';
import Usage from './Usage';

import * as Promise from 'bluebird';
import Promise from 'bluebird';
import update from 'immutability-helper';
import * as _ from 'lodash';
import * as React from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/controls/table/GameFilter.tsx
Expand Up @@ -66,7 +66,7 @@ function mapStateToProps(state: IState): IConnectedProps {
}

const FilterConn = connect(mapStateToProps)(
GameFilterComponent) as React.ComponentClass<IFilterProps>;
GameFilterComponent) as unknown as React.ComponentClass<IFilterProps>;

class GameFilter implements ITableFilter {
public component = FilterConn;
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/about_dialog/views/AboutPage.tsx
@@ -1,17 +1,17 @@
import More from '../../../controls/More';
import { ComponentEx, translate } from '../../../util/ComponentEx';
import * as fs from 'fs';
import {log} from '../../../util/log';
import MainPage from '../../../views/MainPage';

import { ILicense } from '../types/ILicense';

import { remote } from 'electron';
import * as fs from 'fs';
import I18next from 'i18next';
import * as path from 'path';
import * as React from 'react';
import { Image, Media, Panel } from 'react-bootstrap';
import * as ReactMarkdown from 'react-markdown';
import ReactMarkdown from 'react-markdown';
import * as RequestT from 'request';

let modules = {};
Expand Down
@@ -1,6 +1,6 @@
import { remote } from 'electron';
import I18next from 'i18next';
import * as minimatch from 'minimatch';
import minimatch from 'minimatch';
import * as React from 'react';
import { WithTranslation } from 'react-i18next';
import { connect } from 'react-redux';
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/announcement_dashlet/index.ts
@@ -1,4 +1,4 @@
import * as Promise from 'bluebird';
import Promise from 'bluebird';
import * as https from 'https';
import * as _ from 'lodash';
import * as Redux from 'redux';
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/browser/views/BrowserView.tsx
Expand Up @@ -7,7 +7,7 @@ import Debouncer from '../../../util/Debouncer';

import { closeBrowser } from '../actions';

import * as Promise from 'bluebird';
import Promise from 'bluebird';
import * as React from 'react';
import { Breadcrumb, Button, Modal } from 'react-bootstrap';
import * as ReactDOM from 'react-dom';
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/category_management/util/CategoryFilter.tsx
Expand Up @@ -10,7 +10,7 @@ import { IMod } from '../../mod_management/types/IMod';
import filterModInfo from '../../mod_management/util/filterModInfo';
import { activeGameId } from '../../profile_management/selectors';

import * as Promise from 'bluebird';
import Promise from 'bluebird';
import * as _ from 'lodash';
import * as React from 'react';
import Select from 'react-select';
Expand Down Expand Up @@ -147,7 +147,7 @@ function mapStateToProps(state: IState): IConnectedProps {
}

const CategoryFilterComponentConn = connect(mapStateToProps)(
CategoryFilterComponent) as React.ComponentClass<IFilterProps>;
CategoryFilterComponent) as unknown as React.ComponentClass<IFilterProps>;

class CategoryFilter implements ITableFilter {
public component = CategoryFilterComponentConn;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/category_management/views/CategoryList.tsx
Expand Up @@ -21,7 +21,7 @@ import { ICategory, ICategoryDictionary } from '../types/ICategoryDictionary';
import { ICategoriesTree } from '../types/ITrees';
import createTreeDataObject from '../util/createTreeDataObject';

import * as Promise from 'bluebird';
import Promise from 'bluebird';
import * as React from 'react';
import { FormControl } from 'react-bootstrap';
import * as SortableTreeT from 'react-sortable-tree';
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/diagnostics_files/util/loadVortexLogs.ts
Expand Up @@ -3,7 +3,7 @@ import {LogLevel} from '../../../util/log';

import { ILog, ISession } from '../types/ISession';

import * as Promise from 'bluebird';
import Promise from 'bluebird';
import { remote } from 'electron';
import * as path from 'path';

Expand All @@ -26,7 +26,7 @@ function parseLine(line: string, idx: number): ILog {
export function loadVortexLogs(): Promise<ISession[]> {
const logPath = remote.app.getPath('userData');

return fs.readdirAsync(logPath)
return Promise.resolve(fs.readdirAsync(logPath))
.filter((fileName: string) => fileName.match(/vortex[0-9]?\.log/) !== null)
.then((logFileNames: string[]) => {
logFileNames = logFileNames.sort((lhs: string, rhs: string) => rhs.localeCompare(lhs));
Expand Down
Expand Up @@ -9,7 +9,7 @@ import { showError } from '../../../util/message';
import { ILog, ISession } from '../types/ISession';
import { loadVortexLogs } from '../util/loadVortexLogs';

import * as Promise from 'bluebird';
import Promise from 'bluebird';
import { remote } from 'electron';
import update from 'immutability-helper';
import * as os from 'os';
Expand Down
16 changes: 9 additions & 7 deletions src/extensions/download_management/DownloadManager.ts
Expand Up @@ -11,7 +11,7 @@ import { IProtocolHandlers } from './types/ProtocolHandlers';
import FileAssembler from './FileAssembler';
import SpeedCalculator from './SpeedCalculator';

import * as Promise from 'bluebird';
import Promise from 'bluebird';
import * as contentDisposition from 'content-disposition';
import * as contentType from 'content-type';
import { remote } from 'electron';
Expand Down Expand Up @@ -130,12 +130,14 @@ class DownloadWorker {
}

try {
remote.getCurrentWebContents().session.cookies.get({ url: jobUrl }, (cookieErr, cookies) => {
if (truthy(cookieErr)) {
log('error', 'failed to retrieve cookies', cookieErr.message);
}
this.startDownload(job, jobUrl, cookies);
});
remote.getCurrentWebContents().session.cookies.get({ url: jobUrl })
.then(cookies => {
this.startDownload(job, jobUrl, cookies);

})
.catch(err => {
log('error', 'failed to retrieve cookies', err.message);
});
} catch (err) {
log('error', 'failed to retrieve cookies', err.message);
this.startDownload(job, jobUrl, []);
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/download_management/DownloadObserver.ts
Expand Up @@ -28,7 +28,7 @@ import getDownloadGames from './util/getDownloadGames';

import DownloadManager, { DownloadIsHTML } from './DownloadManager';

import * as Promise from 'bluebird';
import Promise from 'bluebird';
import {IHashResult} from 'modmeta-db';
import * as path from 'path';
import * as Redux from 'redux';
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/download_management/FileAssembler.ts
Expand Up @@ -2,7 +2,7 @@ import { ProcessCanceled, UserCanceled } from '../../util/CustomErrors';
import { getVisibleWindow } from '../../util/errorHandling';
import * as fs from '../../util/fs';

import * as Promise from 'bluebird';
import Promise from 'bluebird';
import { dialog as dialogIn, remote } from 'electron';
import * as fsFast from 'fs-extra-promise';
import * as path from 'path';
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/download_management/index.ts
Expand Up @@ -37,7 +37,7 @@ import SpeedOMeter from './views/SpeedOMeter';
import DownloadManager from './DownloadManager';
import observe, { DownloadObserver } from './DownloadObserver';

import * as Promise from 'bluebird';
import Promise from 'bluebird';
import { app as appIn, remote } from 'electron';
import * as _ from 'lodash';
import * as path from 'path';
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/download_management/types/IChunk.ts
@@ -1,4 +1,4 @@
import * as Promise from 'bluebird';
import Promise from 'bluebird';

export interface IChunk {
url: () => Promise<string>;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/download_management/types/IDownloadJob.ts
@@ -1,6 +1,6 @@
import { IChunk } from './IChunk';

import * as Promise from 'bluebird';
import Promise from 'bluebird';

export interface IDownloadJob extends IChunk {
state: 'init' | 'running' | 'paused' | 'finished';
Expand Down
@@ -1,4 +1,4 @@
import * as Promise from 'bluebird';
import Promise from 'bluebird';

export interface IProtocolHandlers {
[schema: string]: (inputUrl: string) => Promise<{ urls: string[], meta: any }>;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/download_management/util/getDownloadPath.ts
Expand Up @@ -2,7 +2,7 @@ import makeCI from '../../../util/makeCaseInsensitive';

import { app as appIn, remote } from 'electron';
import * as path from 'path';
import * as format from 'string-template';
import format from 'string-template';

const app = remote !== undefined ? remote.app : appIn;

Expand Down
6 changes: 3 additions & 3 deletions src/extensions/download_management/util/writeDownloadsTag.ts
@@ -1,6 +1,6 @@
import { IExtensionApi, IState } from '../../../types/api';

import * as Promise from 'bluebird';
import Promise from 'bluebird';
import * as path from 'path';
import * as fs from '../../../util/fs';

Expand All @@ -11,6 +11,6 @@ export default function writeDownloadsTag(api: IExtensionApi, tagPath: string):
const data = {
instance: state.app.instanceId,
};
return fs.writeFileAsync(path.join(tagPath, DOWNLOADS_DIR_TAG),
JSON.stringify(data), { encoding: 'utf8' });
return Promise.resolve(fs.writeFileAsync(path.join(tagPath, DOWNLOADS_DIR_TAG),
JSON.stringify(data), { encoding: 'utf8' }));
}
Expand Up @@ -8,7 +8,7 @@ import * as selectors from '../../../util/selectors';

import { setCompatibleGames } from '../actions/state';

import * as Promise from 'bluebird';
import Promise from 'bluebird';
import * as fuzz from 'fuzzball';
import I18next from 'i18next';
import * as path from 'path';
Expand Down

0 comments on commit 27b811f

Please sign in to comment.