Skip to content

Commit

Permalink
Merge pull request #26 from Devpodio/branch0.5.0
Browse files Browse the repository at this point in the history
Branch 0.5.0
  • Loading branch information
uniibu authored Apr 2, 2019
2 parents 6efcf69 + 6c61dea commit 6b6bcaa
Show file tree
Hide file tree
Showing 12 changed files with 113 additions and 13 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@ Breaking changes:

- [dialog] `validate` and `accept` methods are now Promisified [#4764](https://github.com/theia-ide/theia/pull/4764)

Breaking changes:
- [editor] turn off autoSave by default to align with VS Code [#4777](https://github.com/theia-ide/theia/pull/4777)
- default settings can be overriden in application package.json:
```json
{
"private": true,
"name": "myapp",
"theia": {
"frontend": {
"config": {
"preferences": {
"editor.autoSave": "on"
}
}
}
}
}
```

## v0.5.0

- Added `scope` to task configurations to differentiate 3 things: task type, task source, and where to run tasks
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<br/>
<div id="theia-logo" align="center">
<br />
<img src="./logo/theia-logo.svg" alt="Theia Logo" width="300"/>
<h2> DEVPOD </h2>
<h3>Cloud & Desktop IDE Platform</h3>
</div>

Expand All @@ -14,13 +14,13 @@
[![Open questions](https://img.shields.io/badge/Open-questions-blue.svg?style=flat-curved)](https://github.com/devpodio/devpod/labels/question)
[![Open bugs](https://img.shields.io/badge/Open-bugs-red.svg?style=flat-curved)](https://github.com/theia-ide/theia/labels/bug)

Eclipse Theia is an extensible platform to develop full-fledged multi-language Cloud & Desktop IDE-like products with state-of-the-art web technologies.
Devpod is a fork of Eclipse Theia which is an extensible platform to develop full-fledged multi-language Cloud & Desktop IDE-like products with state-of-the-art web technologies.
<p><small style="font-weight:bold;">This is a for of Theia Ide that adds PWA for caching and web app</small></p>
</div>

<div style='margin:0 auto;width:80%;'>

![Theia](https://raw.githubusercontent.com/theia-ide/theia/master/doc/images/theia-screenshot.png)
![Theia](https://i.gyazo.com/054dc376e2259ab828390b2c79288ed2.png)

</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ if (isMaster) {
title: applicationName,
width: windowState.width,
height: windowState.height,
minWidth: 200,
minHeight: 120,
x: windowState.x,
y: windowState.y,
isMaximized: windowState.isMaximized
Expand Down
4 changes: 2 additions & 2 deletions packages/editor/src/browser/editor-preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ export const editorPreferenceSchema: PreferenceSchema = {
'on',
'off'
],
'default': 'on',
'description': 'Configure whether the editor should be auto saved.',
'default': 'off',
'description': 'Controls auto save of dirty files.',
overridable: false
},
'editor.autoSaveDelay': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,18 @@ 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';
import { PluginVsCodeCliContribution } from './plugin-vscode-cli-contribution';
import { CliContribution } from '@devpodio/core/lib/node';
import { PluginHostEnvironmentVariable } from '@devpodio/plugin-ext/lib/common';

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();

bind(PluginVsCodeCliContribution).toSelf().inSingletonScope();
bind(CliContribution).toService(PluginVsCodeCliContribution);
bind(PluginHostEnvironmentVariable).toService(PluginVsCodeCliContribution);
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/********************************************************************************
* Copyright (C) 2019 Red Hat, Inc. 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
********************************************************************************/

import { injectable } from 'inversify';
import { Argv, Arguments } from 'yargs';
import { CliContribution } from '@devpodio/core/lib/node/cli';
import { PluginHostEnvironmentVariable } from '@devpodio/plugin-ext/lib/common';
import { VSCODE_DEFAULT_API_VERSION } from './plugin-vscode-init';
/**
* CLI Contribution allowing to override the VS Code API version which is returned by `vscode.version` API call.
*/
@injectable()
export class PluginVsCodeCliContribution implements CliContribution, PluginHostEnvironmentVariable {

static VSCODE_API_VERSION = 'vscode-api-version';

protected vsCodeApiVersion: string | undefined;

configure(conf: Argv): void {
conf.option(PluginVsCodeCliContribution.VSCODE_API_VERSION, {
// tslint:disable-next-line:max-line-length
description: `Overrides the version returned by VSCode API 'vscode.version'. Example: --${PluginVsCodeCliContribution.VSCODE_API_VERSION}=<Wanted Version>. Default [${VSCODE_DEFAULT_API_VERSION}]`,
type: 'string',
nargs: 1
});
}

setArguments(args: Arguments): void {
const arg = args[PluginVsCodeCliContribution.VSCODE_API_VERSION];
if (arg) {
this.vsCodeApiVersion = arg;
}
}

process(env: NodeJS.ProcessEnv): void {
if (this.vsCodeApiVersion) {
env['VSCODE_API_VERSION'] = this.vsCodeApiVersion;
}
}

}
4 changes: 3 additions & 1 deletion packages/plugin-ext-vscode/src/node/plugin-vscode-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import * as theia from '@devpodio/plugin';
import { BackendInitializationFn, PluginAPIFactory, Plugin, emptyPlugin } from '@devpodio/plugin-ext';

export const VSCODE_DEFAULT_API_VERSION = '1.32.3';

/** Set up en as a default locale for VS Code extensions using vscode-nls */
process.env['VSCODE_NLS_CONFIG'] = JSON.stringify({ locale: 'en', availableLanguages: {} });
process.env['VSCODE_PID'] = process.env['THEIA_PARENT_PID'];
Expand Down Expand Up @@ -72,7 +74,7 @@ export const doInitialization: BackendInitializationFn = (apiFactory: PluginAPIF
};

// override the version for vscode to be a VSCode version
(<any>vscode).version = '1.32.3';
(<any>vscode).version = process.env['VSCODE_API_VERSION'] || VSCODE_DEFAULT_API_VERSION;

pluginsApiImpl.set(plugin.model.id, vscode);
plugins.push(plugin);
Expand Down
5 changes: 5 additions & 0 deletions packages/plugin-ext/src/common/plugin-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,3 +628,8 @@ export interface ServerPluginRunner {
*/
getExtraPluginMetadata(): Promise<PluginMetadata[]>;
}

export const PluginHostEnvironmentVariable = Symbol('PluginHostEnvironmentVariable');
export interface PluginHostEnvironmentVariable {
process(env: NodeJS.ProcessEnv): void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,12 @@ export abstract class AbstractHostedInstanceManager implements HostedInstanceMan
let processOptions: cp.SpawnOptions;
if (pluginUri.scheme === 'file') {
processOptions = { ...PROCESS_OPTIONS };
processOptions.env.HOSTED_PLUGIN = pluginUri.path.toString();
if (processOptions.env) {
processOptions.env.HOSTED_PLUGIN = pluginUri.path.toString();

// Disable all the other plugins on this instance
processOptions.env.THEIA_PLUGINS = '';
// Disable all the other plugins on this instance
processOptions.env.THEIA_PLUGINS = '';
}
command = await this.getStartCommand(port, debugConfig);
} else {
throw new Error('Not supported plugin location: ' + pluginUri.toString());
Expand Down
12 changes: 9 additions & 3 deletions packages/plugin-ext/src/hosted/node/hosted-plugin-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

import * as path from 'path';
import * as cp from 'child_process';
import { injectable, inject } from 'inversify';
import { ILogger, ConnectionErrorHandler } from '@devpodio/core/lib/common';
import { injectable, inject, named } from 'inversify';
import { ILogger, ConnectionErrorHandler, ContributionProvider } from '@devpodio/core/lib/common';
import { Emitter } from '@devpodio/core/lib/common/event';
import { createIpcEnv } from '@devpodio/core/lib/node/messaging/ipc-protocol';
import { HostedPluginClient, ServerPluginRunner, PluginMetadata } from '../../common/plugin-protocol';
import { HostedPluginClient, ServerPluginRunner, PluginMetadata, PluginHostEnvironmentVariable } from '../../common/plugin-protocol';
import { RPCProtocolImpl } from '../../api/rpc-protocol';
import { MAIN_RPC_CONTEXT } from '../../api/plugin-api';
import { HostedPluginCliContribution } from './hosted-plugin-cli-contribution';
Expand All @@ -41,6 +41,10 @@ export class HostedPluginProcess implements ServerPluginRunner {
@inject(HostedPluginCliContribution)
protected readonly cli: HostedPluginCliContribution;

@inject(ContributionProvider)
@named(PluginHostEnvironmentVariable)
protected readonly pluginHostEnvironmentVariables: ContributionProvider<PluginHostEnvironmentVariable>;

private childProcess: cp.ChildProcess | undefined;
private client: HostedPluginClient;

Expand Down Expand Up @@ -128,6 +132,8 @@ export class HostedPluginProcess implements ServerPluginRunner {
delete env[key];
}
}
// apply external env variables
this.pluginHostEnvironmentVariables.getContributions().forEach(envVar => envVar.process(env));
if (this.cli.extensionTestsPath) {
env.extensionTestsPath = this.cli.extensionTestsPath;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { HostedPluginReader } from './plugin-reader';
import { HostedPluginSupport } from './hosted-plugin';
import { TheiaPluginScanner } from './scanners/scanner-theia';
import { HostedPluginsManager, HostedPluginsManagerImpl } from './hosted-plugins-manager';
import { HostedPluginServer, PluginScanner, HostedPluginClient, hostedServicePath, PluginDeployerHandler } from '../../common/plugin-protocol';
import { HostedPluginServer, PluginScanner, HostedPluginClient, hostedServicePath, PluginDeployerHandler, PluginHostEnvironmentVariable } from '../../common/plugin-protocol';
import { GrammarsReader } from './scanners/grammars-reader';
import { HostedPluginProcess } from './hosted-plugin-process';
import { ExtPluginApiProvider } from '../../common/plugin-ext-api-contribution';
Expand All @@ -42,6 +42,8 @@ const commonHostedConnectionModule = ConnectionContainerModule.create(({ bind, b
bind(HostedPluginsManager).toService(HostedPluginsManagerImpl);

bindContributionProvider(bind, Symbol.for(ExtPluginApiProvider));
bindContributionProvider(bind, PluginHostEnvironmentVariable);

bind(HostedPluginServerImpl).toSelf().inSingletonScope();
bind(HostedPluginServer).toService(HostedPluginServerImpl);
bindBackendService<HostedPluginServer, HostedPluginClient>(hostedServicePath, HostedPluginServer, (server, client) => {
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,7 @@
"@types/yargs@^11.1.0":
version "11.1.2"
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-11.1.2.tgz#fd4b676846fe731a5de5c6d2e5ef6a377262fc30"
integrity sha512-zG61PAp2OcoIBjRV44wftJj6AJgzJrOc32LCYOBqk9bdgcdzK5DCJHV9QZJ60+Fu+fOn79g8Ks3Gixm4CfkZ+w==

"@webassemblyjs/[email protected]":
version "1.7.8"
Expand Down

0 comments on commit 6b6bcaa

Please sign in to comment.