Skip to content
This repository has been archived by the owner on Jun 20, 2018. It is now read-only.

CHE-9595: Define terminal api for plugin model. #24

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a891f0a
POC of the new Plug-in System
evidolob Apr 10, 2018
6e9c289
Cleanup the code, registerPlugin being handled differently now
benoitf Apr 9, 2018
8d85d88
Remove main entry from the module: there is no export from this modul…
benoitf Apr 11, 2018
b64305e
Add alias for plugin package
benoitf Apr 12, 2018
bc37c04
eclipse/che#9286 introduce quick pick api
evidolob Apr 13, 2018
ddcb11c
COMMIT TO DELETE BEFORE MERGING
benoitf Apr 13, 2018
27cfe29
Add test file to enable tests
benoitf Apr 13, 2018
f43e130
Theia plugin metadata (#1)
akurinnoy Apr 20, 2018
060a8a4
Add Hosted Plugin Manager
mmorhun Apr 23, 2018
b9fbb21
split plugin module in two : one module for API, one module for the e…
benoitf Apr 24, 2018
b1a042c
Handle blocking of opening of new tab
mmorhun Apr 25, 2018
e9cdbdb
Split hosted and main part in two folders (#7)
benoitf Apr 25, 2018
fe5b94f
move some files related to plugin API implementation to 'plugin' folder
evidolob Apr 27, 2018
e17c24a
Fix code based on upstream changes
benoitf Apr 27, 2018
e8e0b0d
Sync with upstream
benoitf May 2, 2018
86beabc
COMMIT TO DELETE: publishing wip packages
benoitf May 7, 2018
5a14ca2
Add notification manager API (#2)
olexii4 May 7, 2018
b3c9623
Make plugin-ext npm module (#12)
mmorhun May 8, 2018
ec3594d
- use a patch prefix without - separator
benoitf May 9, 2018
e75f1a2
Handle the deployment with deployers (#11)
benoitf May 11, 2018
139e676
Split vscode into a new module
benoitf May 11, 2018
05efce3
Make HostedPluginUriPostProcessor symbol global (#15)
mmorhun May 15, 2018
08d447d
Add dev dependency to @theia/plugin module from @theia/plugin-ext (#16)
mmorhun May 16, 2018
58408d6
Moves @theia/plugin dependency from dev to main
mmorhun May 16, 2018
d6a4967
Add support for plugins hosted on github repository in releases secti…
benoitf May 17, 2018
606076d
Add support for vscode:extension/ resolver and http(s):// resolver (#19)
benoitf May 17, 2018
9c79db1
Use process tree to shutdown Theia instance (#10)
mmorhun May 22, 2018
5a7589d
Add window state API (#21)
mmorhun May 22, 2018
639ad3d
Introduce a command to deploy on the fly a plugin into Theia (#22)
benoitf May 29, 2018
ce63bf3
CHE-9595: Define terminal api for plugin model.
AndrienkoAleksandr May 29, 2018
76a03dd
Use own Thenable interface, to simplify terminal api using in the sam…
AndrienkoAleksandr May 29, 2018
e148f40
Fix up.
AndrienkoAleksandr May 30, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ cache:
- packages/navigator/node_modules
- packages/outline-view/node_modules
- packages/output/node_modules
- packages/plugin/node_modules
- packages/plugin-ext/node_modules
- packages/preferences/node_modules
- packages/preview/node_modules
- packages/process/node_modules
Expand Down Expand Up @@ -68,19 +70,16 @@ before_script:
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.6.0
- export PATH=$HOME/.yarn/bin:$PATH ;
- export THEIA_HOME=$(pwd)
- export PATH=${THEIA_HOME}/node_modules/.bin:${PATH}
- cd ${THEIA_HOME}/ && rm ./dev-packages/application-package/src/extension-package.spec.ts && cp ./dev-packages/application-manager/src/package.spec.ts ./dev-packages/application-package/src/extension-package.spec.ts
- cd ${THEIA_HOME}/ && rm ./packages/metrics/src/node/prometheus.spec.ts && cp ./dev-packages/application-manager/src/package.spec.ts ./packages/metrics/src/node/prometheus.spec.ts
- cd ${THEIA_HOME}/ && rm ./packages/extension-manager/src/node/*spec.ts && cp ./dev-packages/application-manager/src/package.spec.ts ./packages/extension-manager/src/node/extension.spec.ts
- cd ${THEIA_HOME}/ && find . -name "*.*" -type f -not -path "*node_modules/*" -exec sed -i 's/\@theia\//\@wiptheia\//g' {} \;
install: yarn
script: travis_retry yarn test ;
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/c42ddc125fe6bbfccb48
on_success: change
on_failure: always
on_start: never
script: travis_retry yarn test:theia ;
jobs:
fast_finish: true
allow_failures:
- os: osx
include:
- stage: test
os: linux
Expand All @@ -95,10 +94,13 @@ jobs:
install: skip
before_deploy:
- printf "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}\n" >> ~/.npmrc
- yarn
- export THEIA_PUBLISHED_VERSION="0.3.10$(date +%s)"
- yarn build
- cd ${THEIA_HOME} && for f in $(find . -name "package.json" -type f -not -path "*node_modules/*"); do cd ${THEIA_HOME}/$(dirname $f) && npm version -no-git-tag-version ${THEIA_PUBLISHED_VERSION}; done; cd ${THEIA_HOME}
- cd ${THEIA_HOME}/ && find . -name "package.json" -type f -not -path "*node_modules/*" -exec sed -i "s/\^0.3.10/\^${THEIA_PUBLISHED_VERSION}/g" {} \;
deploy:
provider: script
script: yarn run publish:next
script: bash ${THEIA_HOME}/scripts/publish-theia.sh ${THEIA_HOME}
on:
branch: master
skip_cleanup: true
3 changes: 2 additions & 1 deletion dev-packages/application-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"umd-compat-loader": "^2.1.1",
"url-loader": "^1.0.1",
"webpack": "^4.0.0",
"webpack-cli": "2.0.12"
"webpack-cli": "2.0.12",
"worker-loader": "^1.1.1"
},
"devDependencies": {
"@theia/ext-scripts": "^0.3.10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ module.exports = {
},
module: {
rules: [
{
test: /worker-main\\.js$/,
loader: 'worker-loader',
options: {
name: 'worker-ext.[hash].js'
}
},
{
test: /\\.css$/,
exclude: /\\.useable\\.css$/,
Expand Down
2 changes: 2 additions & 0 deletions examples/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"@theia/navigator": "^0.3.10",
"@theia/outline-view": "^0.3.10",
"@theia/output": "^0.3.10",
"@theia/plugin-ext": "^0.3.10",
"@theia/plugin-ext-vscode": "^0.3.10",
"@theia/preferences": "^0.3.10",
"@theia/preview": "^0.3.10",
"@theia/process": "^0.3.10",
Expand Down
1 change: 1 addition & 0 deletions examples/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@theia/navigator": "^0.3.10",
"@theia/outline-view": "^0.3.10",
"@theia/output": "^0.3.10",
"@theia/plugin-ext": "^0.3.10",
"@theia/preferences": "^0.3.10",
"@theia/preview": "^0.3.10",
"@theia/process": "^0.3.10",
Expand Down
90 changes: 90 additions & 0 deletions packages/core/src/browser/terminal/terminal-model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*
* Copyright (C) 2018 Red Hat, Inc. and others.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*/

import { Disposable } from "../../common";

/**
* Terminal model describes interfaces for creation and using terminal widget.
*/

/**
* Terminal widget options.
*/
export const TerminalWidgetOptions = Symbol("TerminalWidgetOptions");
export interface TerminalWidgetOptions {

/**
* Human readable terminal representation on the UI.
*/
readonly title?: string ;

/**
* Path to the executable shell. For example: "/bin/bash", "bash", "sh".
*/
readonly shellPath?: string;

/**
* Shell arguments to executable shell, for example: ["-l"] - without login.
*/
readonly shellArgs?: string[];

/**
* Current working directory.
*/
readonly cwd?: string;

/**
* Environment variables for terminal.
*/
readonly env?: { [key: string]: string | null };

/**
* In case "destroyTermOnClose" is true - terminal process will be destroyed on close terminal widget, otherwise will be keeped
* alive.
*/
destroyTermOnClose?: boolean;

/**
* Terminal server side can send to the client "terminal title" to display this value on the UI. If
* overrideTitle = true, we skip this title and use our own custom title, defined by "title" argument.
* If overrideTitle = false, we are using terminal title from the server side.
*/
overrideTitle?: boolean;

/**
* Terminal id. Should be unique for all DOM.
*/
id?: string;
}

/**
* Terminal UI widget.
*/
export const TerminalWidget = Symbol("TerminalWidget");
export interface TerminalWidget {
/**
* Start terminal and return terminal id.
*/
start(): Promise<number>;

/**
* Send text to the terminal server.
* @param text - text content.
*/
sendText(text: string): void;

/**
* Destroy terminal widget.
*/
dispose(): void;

/**
* Apply disposable object where are described actions to do when terminal is closed.
* @param dispose - disposable actions.
*/
onDidClosed(dispose: Disposable): void;
}
31 changes: 31 additions & 0 deletions packages/core/src/browser/terminal/terminal-service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (C) 2018 Red Hat, Inc. and others.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*/
import { TerminalWidgetOptions, TerminalWidget } from "./terminal-model";

/**
* Service for manipulation terminal widgets.
*/
export const TerminalService = Symbol("TerminalService");
export interface TerminalService {
/**
* Create new terminal with predefined options;
* @param options - terminal options.
*/
newTerminal(options: TerminalWidgetOptions): Promise<TerminalWidget>;

/**
* Display new terminal widget on the bottom panel.
* @param termWidget - widget to attach to the bottom panel.
*/
activateWidget(termWidget: TerminalWidget): void;

/**
* Hide panel where is located created terminal widget.
* @param termWidget - terminal widget to hide.
*/
collapseWidget(termWidget: TerminalWidget): void;
}
6 changes: 1 addition & 5 deletions packages/core/src/node/env-variables/env-variables-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@
import { injectable } from 'inversify';
import { EnvVariable, EnvVariablesServer } from '../../common/env-variables';

interface ProcessEnv {
[key: string]: string | undefined;
}

@injectable()
export class EnvVariablesServerImpl implements EnvVariablesServer {

protected readonly envs: { [key: string]: EnvVariable } = {};

constructor() {
const prEnv: ProcessEnv = process.env;
const prEnv = process.env;
Object.keys(prEnv).forEach((key: string) => {
this.envs[key] = {"name" : key, "value" : prEnv[key]};
});
Expand Down
16 changes: 16 additions & 0 deletions packages/plugin-ext-vscode/compile.tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../configs/base.tsconfig",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"lib": [
"es6",
"dom",
"webworker"
]
},
"include": [
"src"
]
}

46 changes: 46 additions & 0 deletions packages/plugin-ext-vscode/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "@theia/plugin-ext-vscode",
"version": "0.3.10",
"description": "Theia - Plugin Extension for VsCode",
"dependencies": {
"@theia/plugin-ext": "^0.3.10"
},
"publishConfig": {
"access": "public"
},
"theiaExtensions": [
{
"backend": "lib/node/plugin-vscode-backend-module"
}
],
"keywords": [
"theia-extension"
],
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/theia-ide/theia.git"
},
"bugs": {
"url": "https://github.com/theia-ide/theia/issues"
},
"homepage": "https://github.com/theia-ide/theia",
"files": [
"lib",
"src"
],
"scripts": {
"prepare": "yarn run clean && yarn run build",
"clean": "theiaext clean",
"build": "theiaext build",
"watch": "theiaext watch",
"test": "theiaext test",
"docs": "theiaext docs"
},
"devDependencies": {
"@theia/ext-scripts": "^0.3.10"
},
"nyc": {
"extends": "../../configs/nyc.json"
}
}
20 changes: 20 additions & 0 deletions packages/plugin-ext-vscode/src/node/package.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (C) 2018 Red Hat, Inc. and others.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*/

/* note: this bogus test file is required so that
we are able to run mocha unit tests on this
package, without having any actual unit tests in it.
This way a coverage report will be generated,
showing 0% coverage, instead of no report.
This file can be removed once we have real unit
tests in place. */

describe("plugin-ext-vscode package", () => {

it("support code coverage statistics", () =>
true);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (C) 2018 Red Hat, Inc. and others.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*/

import { ContainerModule } from 'inversify';
import { PluginDeployerFileHandler, PluginDeployerDirectoryHandler, PluginScanner, PluginDeployerResolver } from "@theia/plugin-ext";
import { PluginVsCodeFileHandler } from "./plugin-vscode-file-handler";
import { PluginVsCodeDirectoryHandler } from "./plugin-vscode-directory-handler";
import { VsCodePluginScanner } from "./scanner-vscode";
import { VsCodePluginDeployerResolver } from './plugin-vscode-resolver';

export default new ContainerModule(bind => {
bind(PluginDeployerFileHandler).to(PluginVsCodeFileHandler).inSingletonScope();
bind(PluginDeployerDirectoryHandler).to(PluginVsCodeDirectoryHandler).inSingletonScope();
bind(PluginScanner).to(VsCodePluginScanner).inSingletonScope();
bind(PluginDeployerResolver).to(VsCodePluginDeployerResolver).inSingletonScope();
}
);
Loading