Skip to content

Commit

Permalink
merge with master
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Vinokur <[email protected]>
  • Loading branch information
vinokurig committed Aug 5, 2019
2 parents 1f2da76 + b40a8d5 commit 79edcba
Show file tree
Hide file tree
Showing 118 changed files with 3,445 additions and 1,654 deletions.
22 changes: 21 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
<!-- Please provide a clear and meaningful description to the CHANGELOG.md file if this PR contributes some significant changes -->
<!--
Thank you for your Pull Request. Please provide a description and review
the requirements below.
Contributors guide: https://github.com/theia-ide/theia/blob/master/CONTRIBUTING.md
-->

#### What it does
<!-- Include relevant issues and describe how they are addressed. -->

#### How to test
<!-- Explain how a reviewer can reproduce a bug, test new functionality or verify performance improvements. -->

#### Review checklist

- [ ] as an author, I have thoroughly tested my changes and carefully followed [the review guidelines](https://github.com/theia-ide/theia/blob/master/doc/pull-requests.md#requesting-a-review)

#### Reminder for reviewers

- as a reviewer, I agree to behave in accordance with [the review guidelines](https://github.com/theia-ide/theia/blob/master/doc/pull-requests.md#reviewing)

3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,13 @@ addons:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- oracle-java9-set-default
- libsecret-1-dev
- xvfb
- libx11-dev
- libxkbfile-dev
chrome: stable
jdk:
- oraclejdk9
before_install:
- |
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Change Log

## v0.10.0

- [vscode] added env variable substitution support [#5811](https://github.com/theia-ide/theia/pull/5811)
- [task] added support for VS Code task contribution points: `taskDefinitions`, `problemMatchers`, and `problemPatterns` [#5777](https://github.com/theia-ide/theia/pull/5777)
- [task] added multi-root support to "configure task" and customizing tasks in `tasks.json` [#5777](https://github.com/theia-ide/theia/pull/5777)
- [task] changed the way that "configure task" copies the entire task config, to only writting properties that define the detected task plus [#5777](https://github.com/theia-ide/theia/pull/5777)`problemMatcher`, into `tasks.json`
- [task] fixed the problem where a detected task can be customized more than once [#5777](https://github.com/theia-ide/theia/pull/5777)
- [task] displayed the customized tasks as "configured tasks" in the task quick open [#5777](https://github.com/theia-ide/theia/pull/5777)
- [task] allowed users to override any task properties other than the ones used in the task definition [#5777](https://github.com/theia-ide/theia/pull/5777)

Breaking changes:

- [task] `TaskService.getConfiguredTasks()` returns `Promise<TaskConfiguration[]>` instead of `TaskConfiguration[]` [#5777](https://github.com/theia-ide/theia/pull/5777)

Breaking changes:
- [shell][plugin] integrated view containers and views [#5665](https://github.com/theia-ide/theia/pull/5665)
- `Source Control` and `Explorer` are view containers now and previous layout data cannot be loaded for them. Because of it the layout is completely reset.


## v0.9.0
- [core] added `theia-widget-noInfo` css class to be used by widgets when displaying no information messages [#5717](https://github.com/theia-ide/theia/pull/5717)
- [core] added additional options to the tree search input [#5566](https://github.com/theia-ide/theia/pull/5566)
Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ an issue. Simply choose the issue you would want to work on, and tell everyone
that you are willing to do so and how you would approach it. The team will be
happy to guide you and give feedback.

We follow the contributing and reviewing pull request guidelines described
[here](https://github.com/theia-ide/theia/blob/master/doc/pull-requests.md).

## Coding Guidelines

We follow the coding guidelines described
Expand Down
43 changes: 43 additions & 0 deletions configs/errors.tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,49 @@
"no-any": true,
"no-consecutive-blank-lines": true,
"no-construct": true,
"no-implicit-dependencies": {
"options": [
true,
[
"@phosphor/algorithm",
"@phosphor/commands",
"@phosphor/coreutils",
"@phosphor/domutils",
"@phosphor/dragdrop",
"@phosphor/messaging",
"@phosphor/properties",
"@phosphor/signaling",
"@phosphor/virtualdom",
"@phosphor/widgets",
"chai",
"chai-string",
"electron",
"express",
"fs-extra",
"inversify",
"jsdom",
"lodash.debounce",
"lodash.throttle",
"monaco-languageclient",
"native-keymap",
"nsfw",
"react",
"react-dom",
"react-virtualized",
"sinon",
"temp",
"typescript",
"uuid",
"vscode-jsonrpc",
"vscode-languageserver",
"vscode-languageserver-protocol",
"vscode-languageserver-types",
"vscode-uri",
"vscode-ws-jsonrpc",
"yargs"
]
]
},
"no-magic-numbers": false,
"no-null-keyword": true,
"no-shadowed-variable": true,
Expand Down
43 changes: 7 additions & 36 deletions configs/warnings.tslint.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,20 @@
{
"rules": {
"deprecation": true,
"await-promise": {
"severity": "warning",
"options": [
"Thenable",
"PromiseLike"
]
},
"no-implicit-dependencies": {
"severity": "warning",
"options": [
true,
[
"@phosphor/algorithm",
"@phosphor/commands",
"@phosphor/coreutils",
"@phosphor/domutils",
"@phosphor/dragdrop",
"@phosphor/messaging",
"@phosphor/properties",
"@phosphor/signaling",
"@phosphor/virtualdom",
"@phosphor/widgets",
"chai",
"chai-string",
"inversify",
"jsdom",
"monaco-languageclient",
"react",
"react-dom",
"react-virtualized",
"sinon",
"temp",
"typescript",
"vscode-languageserver-protocol",
"vscode-languageserver-types",
"vscode-ws-jsonrpc",
"vscode-uri",
"yargs"
]
]
},
"deprecation": true,
"no-return-await": {
"severity": "warning"
}
},
"typedef": [
true,
"call-signature",
"property-declaration"
]
}
}
2 changes: 0 additions & 2 deletions dev-packages/application-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@
},
"dependencies": {
"@theia/application-package": "^0.9.0",
"@types/fs-extra": "^4.0.2",
"bunyan": "^1.8.10",
"circular-dependency-plugin": "^5.0.0",
"copy-webpack-plugin": "^4.5.0",
"css-loader": "^0.28.1",
"electron-rebuild": "^1.5.11",
"file-loader": "^1.1.11",
"font-awesome-webpack": "0.0.5-beta.2",
"fs-extra": "^4.0.2",
"ignore-loader": "^0.1.2",
"less": "^3.0.3",
"source-map-loader": "^0.2.1",
Expand Down
2 changes: 0 additions & 2 deletions dev-packages/application-package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@
"test": "theiaext test"
},
"dependencies": {
"@types/fs-extra": "^4.0.2",
"@types/request": "^2.0.3",
"@types/semver": "^5.4.0",
"@types/write-json-file": "^2.2.1",
"changes-stream": "^2.2.0",
"fs-extra": "^4.0.2",
"is-electron": "^2.1.0",
"request": "^2.82.0",
"semver": "^5.4.1",
Expand Down
17 changes: 17 additions & 0 deletions dev-packages/electron/electron-ffmpeg-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,26 @@

// @ts-check

const crypto = require('crypto');
const path = require('path');
const fs = require('fs');

const ffmpeg = require('./native/build/Release/ffmpeg.node');

/**
* @param {String} path
* @return {Buffer} Hash of the file.
*/
exports.hashFile = async function (path) {
return new Promise((resolve, reject) => {
const sha256 = crypto.createHash('sha256');
fs.createReadStream(path)
.on('close', () => resolve(sha256.digest()))
.on('data', data => sha256.update(data))
.on('error', reject);
});
}

/**
* @type {NodeJS.Platform[]}
*/
Expand Down
17 changes: 2 additions & 15 deletions dev-packages/electron/electron-replace-ffmpeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,17 @@

const downloadElectron = require('electron-download');
const unzipper = require('unzipper');
const crypto = require('crypto');
const yargs = require('yargs');
const path = require('path');
const fs = require('fs');

const { platforms, libffmpegLocation } = require('./electron-ffmpeg-lib')
const { hashFile, platforms, libffmpegLocation } = require('./electron-ffmpeg-lib')

const downloadCache = path.resolve(__dirname, 'download');
if (!fs.existsSync(downloadCache)) {
fs.mkdirSync(downloadCache);
}

/**
* @param {String} path
* @return {Buffer} Hash of the file.
*/
async function hashFile(path) {
return new Promise((resolve, reject) => {
const hash = crypto.createHash('md5');
const stream = fs.createReadStream(path);
stream.pipe(hash).on('finish', () => resolve(hash.digest()));
});
}

async function main() {
const options = yargs
.option('electronVersion', {
Expand Down Expand Up @@ -125,7 +112,7 @@ async function main() {
// Extract file to cache.
await new Promise((resolve, reject) => {
file.stream()
.pipe(fs.createWriteStream(libffmpegCachedPath, { }))
.pipe(fs.createWriteStream(libffmpegCachedPath))
.on('finish', resolve)
.on('error', reject);
});
Expand Down
3 changes: 2 additions & 1 deletion dev-packages/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"yargs": "^11.1.0"
},
"scripts": {
"postinstall": "node scripts/post-install.js"
"postinstall": "node scripts/post-install.js",
"test": "mocha \"tests/**/*.spec.js\""
}
}
40 changes: 40 additions & 0 deletions dev-packages/electron/tests/electron-ffmpeg-lib.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/********************************************************************************
* Copyright (C) 2019 Ericsson and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the Eclipse
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
* with the GNU Classpath Exception which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

const path = require('path');
const { expect } = require('chai');

const { hashFile } = require('../electron-ffmpeg-lib');

function resource(...parts) {
return path.resolve(__dirname, 'test-resources', ...parts);
}

describe('ffmpeg utility functions', () => {

it('hashFile', async () => {
const [
hashA, hashB, hashC
] = await Promise.all([
hashFile(resource('fileA.txt')),
hashFile(resource('fileB.txt')),
hashFile(resource('fileC.txt')),
]);
expect(hashA.equals(hashC)).true;
expect(hashA.equals(hashB)).false;
});

});
1 change: 1 addition & 0 deletions dev-packages/electron/tests/test-resources/fileA.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ABC
1 change: 1 addition & 0 deletions dev-packages/electron/tests/test-resources/fileB.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
XYZ
1 change: 1 addition & 0 deletions dev-packages/electron/tests/test-resources/fileC.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ABC
Loading

0 comments on commit 79edcba

Please sign in to comment.