Skip to content

Commit

Permalink
Update electron and node packages
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Moran <rob.moran@arm.com>

Fix node 10 AddressInfo type change

Signed-off-by: Rob Moran <rob.moran@arm.com>

Fix electron scroll options change

Signed-off-by: Rob Moran <rob.moran@arm.com>
  • Loading branch information
thegecko committed Jan 23, 2019
1 parent f143065 commit e29673b
Show file tree
Hide file tree
Showing 10 changed files with 143 additions and 116 deletions.
2 changes: 1 addition & 1 deletion dev-packages/application-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"circular-dependency-plugin": "^5.0.0",
"copy-webpack-plugin": "^4.5.0",
"css-loader": "^0.28.1",
"electron": "^2.0.14",
"electron": "^3.0.10",
"electron-rebuild": "^1.5.11",
"file-loader": "^1.1.11",
"font-awesome-webpack": "0.0.5-beta.2",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
"version": "0.0.0",
"engines": {
"yarn": "1.0.x || >=1.2.1",
"node": ">=8.9.3"
"node": ">=10.2.0"
},
"resolution": {
"**/@types/node": "8.10.20"
"**/@types/node": "~10.3.6"
},
"devDependencies": {
"@types/chai": "^4.0.1",
"@types/chai-string": "^1.4.0",
"@types/jsdom": "^11.0.4",
"@types/mocha": "^2.2.41",
"@types/node": "8.10.20",
"@types/node": "~10.3.6",
"@types/sinon": "^2.3.5",
"@types/temp": "^0.8.29",
"@types/webdriverio": "^4.7.0",
Expand All @@ -39,7 +39,7 @@
"typedoc": "^0.13.0",
"typescript": "^3.1.3",
"uuid": "^3.1.0",
"wdio-mocha-framework": "0.5.9",
"wdio-mocha-framework": "0.6.4",
"wdio-selenium-standalone-service": "0.0.8",
"wdio-spec-reporter": "0.1.0",
"webdriverio": "4.9.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@types/yargs": "^11.1.0",
"ajv": "^6.5.3",
"body-parser": "^1.17.2",
"electron": "^2.0.14",
"electron": "^3.0.10",
"es6-promise": "^4.2.4",
"express": "^4.16.3",
"file-icons-js": "^1.0.3",
Expand All @@ -38,7 +38,7 @@
"reflect-metadata": "^0.1.10",
"route-parser": "^0.0.5",
"vscode-languageserver-types": "^3.10.0",
"vscode-nsfw": "^1.0.17",
"vscode-nsfw": "^1.1.2",
"vscode-uri": "^1.0.1",
"vscode-ws-jsonrpc": "^0.0.2-1",
"ws": "^5.2.2",
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/node/backend-application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { ILogger, ContributionProvider, MaybePromise } from '../common';
import { CliContribution } from './cli';
import { Deferred } from '../common/promise-util';
import { environment } from '../common/index';
import { AddressInfo } from 'net';

export const BackendApplicationContribution = Symbol('BackendApplicationContribution');
export interface BackendApplicationContribution {
Expand Down Expand Up @@ -185,7 +186,7 @@ export class BackendApplication {

server.listen(port, hostname, () => {
const scheme = this.cliParams.ssl ? 'https' : 'http';
this.logger.info(`Theia app listening on ${scheme}://${hostname || 'localhost'}:${server.address().port}.`);
this.logger.info(`Theia app listening on ${scheme}://${hostname || 'localhost'}:${(server.address() as AddressInfo).port}.`);
deferred.resolve(server);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import * as http from 'http';
import * as https from 'https';
import { WebSocketChannel } from '../../../common/messaging/web-socket-channel';
import { Disposable } from '../../../common/disposable';
import { AddressInfo } from 'net';

export class TestWebSocketChannel extends WebSocketChannel {

Expand All @@ -27,7 +28,7 @@ export class TestWebSocketChannel extends WebSocketChannel {
path: string
}) {
super(0, content => socket.send(content));
const socket = new ws(`ws://localhost:${server.address().port}${WebSocketChannel.wsPath}`);
const socket = new ws(`ws://localhost:${(server.address() as AddressInfo).port}${WebSocketChannel.wsPath}`);
socket.on('error', error =>
this.fireError(error)
);
Expand Down
3 changes: 2 additions & 1 deletion packages/git/src/electron-node/askpass/askpass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { MaybePromise } from '@theia/core/lib/common/types';
import { Deferred } from '@theia/core/lib/common/promise-util';
import { GitPrompt } from '../../common/git-prompt';
import { DugiteGitPromptServer } from '../../node/dugite-git-prompt';
import { AddressInfo } from 'net';

/**
* Environment for the Git askpass helper.
Expand Down Expand Up @@ -89,7 +90,7 @@ export class Askpass implements Disposable {
return new Promise<Address>(resolve => {
this.server.on('error', err => this.logger.error(err));
this.server.listen(0, this.hostname(), () => {
resolve(this.server.address());
resolve(this.server.address() as AddressInfo);
});
});
} catch (err) {
Expand Down
3 changes: 2 additions & 1 deletion packages/java/src/node/java-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { JAVA_LANGUAGE_ID, JAVA_LANGUAGE_NAME, JavaStartParams } from '../common
import { JavaCliContribution } from './java-cli-contribution';
import { ContributionProvider } from '@theia/core';
import { JavaExtensionContribution } from './java-extension-model';
import { AddressInfo } from 'net';
const sha1 = require('sha1');

export type ConfigurationType = 'config_win' | 'config_mac' | 'config_linux';
Expand Down Expand Up @@ -135,7 +136,7 @@ export class JavaContribution extends BaseLanguageServerContribution {

this.logInfo('logs at ' + path.resolve(workspacePath, '.metadata', '.log'));
const env = Object.create(process.env);
const address = server.address();
const address = server.address() as AddressInfo;
env.CLIENT_HOST = address.address;
env.CLIENT_PORT = address.port;
this.createProcessSocketConnection(socket, socket, command, args, { env })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class MarkdownPreviewHandler implements PreviewHandler {
if (!elementToReveal) {
return;
}
elementToReveal.scrollIntoView({ behavior: 'instant' });
elementToReveal.scrollIntoView();
}

findElementForFragment(content: HTMLElement, link: string): HTMLElement | undefined {
Expand Down
4 changes: 2 additions & 2 deletions packages/preview/src/browser/preview-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export class PreviewWidget extends BaseWidget implements Navigatable {
const elementToReveal = this.previewHandler.findElementForFragment(this.node, uri.fragment);
if (elementToReveal) {
this.preventScrollNotification = true;
elementToReveal.scrollIntoView({ behavior: 'instant' });
elementToReveal.scrollIntoView();
window.setTimeout(() => {
this.preventScrollNotification = false;
}, 50);
Expand All @@ -225,7 +225,7 @@ export class PreviewWidget extends BaseWidget implements Navigatable {
const elementToReveal = this.previewHandler.findElementForSourceLine(this.node, sourceLine);
if (elementToReveal) {
this.preventScrollNotification = true;
elementToReveal.scrollIntoView({ behavior: 'instant' });
elementToReveal.scrollIntoView();
window.setTimeout(() => {
this.preventScrollNotification = false;
}, 50);
Expand Down
Loading

1 comment on commit e29673b

@paul-marechal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Also tried it on my end, and I have the same issues regarding the CI...

Are you also able to successfully build locally?

Please sign in to comment.