Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin-ext: cleanup #8831

Merged
merged 2 commits into from
Dec 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 0 additions & 4 deletions packages/plugin-ext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@
"@theia/terminal": "^1.8.0",
"@theia/timeline": "^1.8.0",
"@theia/workspace": "^1.8.0",
"@types/connect": "^3.4.32",
"@types/dompurify": "^2.0.2",
"@types/mime": "^2.0.1",
"@types/serve-static": "^1.13.3",
"connect": "^3.7.0",
"decompress": "^4.2.1",
"dompurify": "^2.0.11",
"escape-html": "^1.0.3",
Expand All @@ -39,7 +36,6 @@
"mime": "^2.4.4",
"ps-tree": "^1.2.0",
"request": "^2.82.0",
"serve-static": "^1.14.1",
"uuid": "^8.0.0",
"vhost": "^3.0.2",
"vscode-debugprotocol": "^1.32.0",
Expand Down
13 changes: 2 additions & 11 deletions packages/plugin-ext/src/main/node/plugin-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import * as http from 'http';
import * as path from 'path';
import * as url from 'url';
import connect = require('connect');
import serveStatic = require('serve-static');
const vhost = require('vhost');
import * as express from 'express';
import { BackendApplicationContribution } from '@theia/core/lib/node/backend-application';
Expand All @@ -28,8 +26,6 @@ import { environment } from '@theia/application-package/lib/environment';
import { WsRequestValidatorContribution } from '@theia/core/lib/node/ws-request-validators';
import { MaybePromise } from '@theia/core/lib/common';

const pluginPath = (process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE) + './theia/plugins/';

@injectable()
export class PluginApiContribution implements BackendApplicationContribution, WsRequestValidatorContribution {

Expand All @@ -43,13 +39,8 @@ export class PluginApiContribution implements BackendApplicationContribution, Ws
}

configure(app: express.Application): void {
app.get('/plugin/:path(*)', (req, res) => {
const filePath: string = req.params.path;
res.sendFile(pluginPath + filePath);
});

const webviewApp = connect();
webviewApp.use('/webview', serveStatic(path.join(__dirname, '../../../src/main/browser/webview/pre')));
const webviewApp = express();
webviewApp.use('/webview', express.static(path.join(__dirname, '../../../src/main/browser/webview/pre')));
app.use(vhost(this.webviewExternalEndpointRegExp, webviewApp));
}

Expand Down
18 changes: 4 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.14.tgz#44d2dd0b5de6185089375d976b4ec5caf6861193"
integrity sha512-G+ITQPXkwTrslfG5L/BksmbLUA0M1iybEsmCWPqzSxsRRhJZimBKJkoMi8fr/CPygPTj4zO5pJH7I2/cm9M7SQ==

"@types/connect@*", "@types/connect@^3.4.32":
"@types/connect@*":
version "3.4.33"
resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.33.tgz#31610c901eca573b8713c3330abc6e6b9f588546"
integrity sha512-2+FrkXY4zllzTNfJth7jOqEHC+enpLeGslEhpnTAkg21GkRrWV4SsAtqchtT4YS9/nODBU2/ZfsBY2X4J/dX7A==
Expand Down Expand Up @@ -1481,7 +1481,7 @@
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45"
integrity sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ==

"@types/serve-static@*", "@types/serve-static@^1.13.3":
"@types/serve-static@*":
version "1.13.8"
resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.8.tgz#851129d434433c7082148574ffec263d58309c46"
integrity sha512-MoJhSQreaVoL+/hurAZzIm8wafFR6ajiTM1m4A0kv6AGeVBl4r4pOV8bGFrjjq1sGxDTnCoF8i22o0/aE5XCyA==
Expand Down Expand Up @@ -4239,16 +4239,6 @@ config-chain@^1.1.11:
ini "^1.3.4"
proto-list "~1.2.1"

connect@^3.7.0:
version "3.7.0"
resolved "https://registry.yarnpkg.com/connect/-/connect-3.7.0.tgz#5d49348910caa5e07a01800b030d0c35f20484f8"
integrity sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==
dependencies:
debug "2.6.9"
finalhandler "1.1.2"
parseurl "~1.3.3"
utils-merge "1.0.1"

console-browserify@^1.1.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336"
Expand Down Expand Up @@ -6263,7 +6253,7 @@ fill-range@^7.0.1:
dependencies:
to-regex-range "^5.0.1"

finalhandler@1.1.2, finalhandler@~1.1.2:
finalhandler@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d"
integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==
Expand Down Expand Up @@ -12118,7 +12108,7 @@ serialize-javascript@^4.0.0:
dependencies:
randombytes "^2.1.0"

serve-static@1.14.1, serve-static@^1.14.1:
serve-static@1.14.1:
version "1.14.1"
resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9"
integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==
Expand Down