Skip to content

Commit

Permalink
chore: add custom exthost process sample (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
erha19 authored Dec 13, 2022
1 parent 1f239da commit bd93279
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 150 deletions.
5 changes: 3 additions & 2 deletions configs/webpack.ext-host.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const { resolveTSConfig } = require('./utils');

const tsConfigPath = path.join(__dirname, '../tsconfig.json');
const srcDir = path.join(__dirname, '../src', 'extension');
const distDir = path.join(__dirname, '../hosted');

module.exports = {
entry: require.resolve('@opensumi/ide-extension/lib/hosted/ext.process.js'),
entry: path.join(srcDir, './ext-host'),
target: 'node',
output: {
filename: 'ext.process.js',
Expand Down Expand Up @@ -72,7 +73,7 @@ module.exports = {
},
],
resolveLoader: {
modules: [path.join(__dirname, './node_modules')],
modules: [path.join(__dirname, '../node_modules')],
extensions: ['.ts', '.tsx', '.js', '.json', '.less'],
mainFields: ['loader', 'main'],
moduleExtensions: ['-loader'],
Expand Down
3 changes: 2 additions & 1 deletion configs/webpack.worker-host.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ const { resolveTSConfig } = require('./utils');

const tsConfigPath = path.join(__dirname, '..', 'tsconfig.json');
const distDir = path.join(__dirname, '..', 'dist');
const srcDir = path.join(__dirname, '..', 'src', 'extension');

module.exports = {
entry: require.resolve('@opensumi/ide-extension/lib/hosted/worker.host-preload.js'),
entry: path.join(srcDir, 'worker-host'),
output: {
filename: 'worker-host.js',
path: distDir,
Expand Down
162 changes: 15 additions & 147 deletions scripts/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,14 @@
"version": "3.0.0",
"extensions": {
"vscode": [
{
"name": "node-debug",
"version": "1.41.1"
},
{
"name": "node-debug2",
"version": "1.42.4"
},
{
"name": "typescript-language-features",
"version": "1.60.0"
},
{
"name": "bat",
"version": "1.55.2"
},
{
"name": "clojure",
"version": "1.55.2"
},
{
"name": "coffeescript",
"version": "1.55.2"
},
{
"name": "configuration-editing",
"version": "1.55.2"
},
{
"name": "cpp",
"version": "1.55.2"
},
{
"name": "csharp",
"version": "1.55.2"
},
{
"name": "css",
"version": "1.55.2"
Expand All @@ -46,21 +18,13 @@
"name": "css-language-features",
"version": "1.55.2"
},
{
"name": "debug-auto-launch",
"version": "1.55.2"
},
{
"name": "docker",
"version": "1.55.2"
},
{
"name": "emmet",
"version": "1.55.2"
},
{
"name": "fsharp",
"version": "1.55.2"
"name": "git",
"version": "1.62.3"
},
{
"name": "git-ui",
Expand All @@ -70,34 +34,6 @@
"name": "git-base",
"version": "1.64.0-next.68976705968"
},
{
"name": "go",
"version": "1.55.2"
},
{
"name": "groovy",
"version": "1.55.2"
},
{
"name": "grunt",
"version": "1.55.2"
},
{
"name": "gulp",
"version": "1.55.2"
},
{
"name": "handlebars",
"version": "1.55.2"
},
{
"name": "hlsl",
"version": "1.55.2"
},
{
"name": "git",
"version": "1.55.2"
},
{
"name": "html",
"version": "1.55.2"
Expand All @@ -106,14 +42,6 @@
"name": "html-language-features",
"version": "1.55.2"
},
{
"name": "ini",
"version": "1.55.2"
},
{
"name": "jake",
"version": "1.55.2"
},
{
"name": "java",
"version": "1.55.2"
Expand All @@ -138,62 +66,14 @@
"name": "log",
"version": "1.55.2"
},
{
"name": "lua",
"version": "1.55.2"
},
{
"name": "make",
"version": "1.55.2"
},
{
"name": "markdown-basics",
"version": "1.55.2"
},
{
"name": "merge-conflict",
"version": "1.55.2"
},
{
"name": "objective-c",
"version": "1.55.2"
},
{
"name": "perl",
"version": "1.55.2"
},
{
"name": "php",
"version": "1.55.2"
},
{
"name": "php-language-features",
"version": "1.55.2"
},
{
"name": "powershell",
"version": "1.55.2"
},
{
"name": "pug",
"version": "1.55.2"
},
{
"name": "python",
"version": "1.55.2"
},
{
"name": "r",
"version": "1.55.2"
},
{
"name": "razor",
"version": "1.55.2"
},
{
"name": "ruby",
"version": "1.55.2"
},
{
"name": "rust",
"version": "1.55.2"
Expand All @@ -207,19 +87,15 @@
"version": "1.55.2"
},
{
"name": "shaderlab",
"version": "1.55.2"
},
{
"name": "shellscript",
"version": "1.55.2"
"name": "typescript",
"version": "1.60.0"
},
{
"name": "sql",
"name": "xml",
"version": "1.55.2"
},
{
"name": "swift",
"name": "yaml",
"version": "1.55.2"
},
{
Expand Down Expand Up @@ -262,35 +138,27 @@
"name": "theme-tomorrow-night-blue",
"version": "1.55.2"
},
{
"name": "typescript",
"version": "1.60.0"
},
{
"name": "vb",
"version": "1.55.2"
},
{
"name": "vscode-theme-seti",
"version": "1.55.2"
},
{
"name": "xml",
"version": "1.55.2"
},
}
],
"ms-vscode": [
{
"name": "yaml",
"version": "1.55.2"
"name": "js-debug",
"version": "1.67.2"
}
],
"vscode-icons-team": [
{
"name": "vscode-icons"
"name": "vscode-icons",
"version": "11.11.0"
}
],
"opensumi": [
{
"name": "opensumi-default-themes"
"name": "opensumi-default-themes",
"version": "2.5.7"
}
]
}
Expand Down
8 changes: 8 additions & 0 deletions src/extension/ext-host.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { extProcessInit } from '@opensumi/ide-extension/lib/hosted/ext.process-base.js';

(async () => {
await extProcessInit({
builtinCommands: [],
customVSCodeEngineVersion: '1.67.0',
});
})();
1 change: 1 addition & 0 deletions src/extension/worker-host.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@opensumi/ide-extension/lib/hosted/worker.host-preload';

0 comments on commit bd93279

Please sign in to comment.