diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ac8f5df79..0cf6c89ac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -128,7 +128,7 @@ $ node /projects/theia/production/src-gen/backend/main.js /tmp/theiadev_projects You can then access to your modified Che-theia from the Container view `theia-dev` endpoint ![Che-Theia-dev-endpoint](https://raw.githubusercontent.com/eclipse/che-theia/assets/theia-dev-endpoint.png) -### Step 7bis: Run che-theia + plugin in dev mode +### Step 7: Run che-theia + plugin in dev mode In this section we show how to run the che-theia assembly but in `dev mode`: keeping all the information for debugging. You can use the che command `run ... DEV yarn start ... che-theia + factory-plugin` or @@ -144,6 +144,9 @@ If you do not have any changes on Theia or Che-theia extension, you could just b and run these plugins with the existing che-theia app: `run ... HOSTED che-theia + container-plugin` or `run ... HOSTED che-theia + factory-plugin` +### How to run Che Theia with VS Code builtin extensions + +First of all it is needed to download extensions: `download builtin extensions ... DEV che-theia`. Then start che-theia: `run ... HOSTED che-theia + builtin extensions`. ## How to develop Che Theia remote plugin mechanism @@ -161,7 +164,7 @@ When workspace is ready: Or a user may generate one using `Generate Hello World plugin package` command. - Run dev Che Theia and Remote plugins endpoint in `theia-dev` and `theia-remote-runtime-dev` containers correspondingly. One may use predefined commands to start them. - - Open `theia-dev` route from `My Workspace` panel and test chenges. + - Open `theia-dev` route from `My Workspace` panel and test changes. Also it is possible to run watchers for remote plugin mechanism. In `theia-dev` container run `npx run watch @eclipse-che/theia-remote` from `/projects/theia` folder to recompile the extension on changes made. diff --git a/devfiles/che-theia-all.devfile.yaml b/devfiles/che-theia-all.devfile.yaml index f3711a411..5419d5c2d 100644 --- a/devfiles/che-theia-all.devfile.yaml +++ b/devfiles/che-theia-all.devfile.yaml @@ -59,6 +59,15 @@ commands: echo -e "\e[32mDone.\e[0m che:theia init" workdir: /projects/theia + - name: download builtin extensions ... DEV che-theia + actions: + - type: exec + component: che-dev + command: > + che:theia builtin-extensions --plugins builtin-extensions && + echo -e "\e[32mDone.\e[0m che:theia extensions" + workdir: /projects + - name: clean ... DEV che-theia actions: - type: exec @@ -134,6 +143,17 @@ commands: node src-gen/backend/main.js /tmp/theiadev_projects --hostname=0.0.0.0 --port=3130 & echo $!> /tmp/node_theiadev.pid ; wait `cat /tmp/node_theiadev.pid` workdir: /projects/theia/production + - name: run ... DEV che-theia + builtin extensions + actions: + - type: exec + component: theia-editor + command: > + kill `cat /tmp/node_theiadev.pid`; + mkdir -p /tmp/theiadev_projects && + export CHE_PROJECTS_ROOT=/tmp/theiadev_projects && + node src-gen/backend/main.js /tmp/theiadev_projects --hostname=0.0.0.0 --port=3130 --plugins=local-dir:/projects/builtin-extensions & echo $!> /tmp/node_theiadev.pid ; wait `cat /tmp/node_theiadev.pid` + workdir: /projects/theia/production + - name: run ... HOSTED che-theia + factory-plugin actions: - type: exec @@ -160,6 +180,17 @@ commands: node src-gen/backend/main.js /tmp/theiadev_projects --hostname=0.0.0.0 --port=3130 & echo $!> /tmp/node_theiadev.pid ; wait `cat /tmp/node_theiadev.pid` workdir: /home/theia + - name: run ... HOSTED che-theia + builtin extensions + actions: + - type: exec + component: theia-editor + command: > + kill `cat /tmp/node_theiadev.pid`; + mkdir -p /tmp/theiadev_projects && + export CHE_PROJECTS_ROOT=/tmp/theiadev_projects && + node src-gen/backend/main.js /tmp/theiadev_projects --hostname=0.0.0.0 --port=3130 --plugins=local-dir:/projects/builtin-extensions & echo $!> /tmp/node_theiadev.pid ; wait `cat /tmp/node_theiadev.pid` + workdir: /home/theia + - name: run ... DEV yarn start ... che-theia + factory-plugin actions: - type: exec diff --git a/dockerfiles/theia/Dockerfile b/dockerfiles/theia/Dockerfile index 0fb06f52a..a719d9430 100644 --- a/dockerfiles/theia/Dockerfile +++ b/dockerfiles/theia/Dockerfile @@ -79,6 +79,9 @@ RUN if [ -z $GITHUB_TOKEN ]; then unset GITHUB_TOKEN; fi && \ #{INCLUDE:docker/${BUILD_IMAGE_TARGET}/builder-before-production.dockerfile} RUN che:theia production +# run che:theia builtin-extensions to download vscode builtin extensions +RUN che:theia builtin-extensions --plugins builtin-extensions + # Compile plugins RUN if [ -z $GITHUB_TOKEN ]; then unset GITHUB_TOKEN; fi && \ cd plugins && ./foreach_yarn @@ -115,13 +118,13 @@ ENV USE_LOCAL_GIT=true \ EXPOSE 3100 3130 COPY --from=builder /home/theia-dev/theia-source-code/production/plugins /default-theia-plugins - +COPY --from=builder /home/theia-dev/theia-source-code/builtin-extensions /default-theia-plugins #{INCLUDE:docker/${BUILD_IMAGE_TARGET}/runtime-install-dependencies.dockerfile} # setup yarn (if missing) #{INCLUDE:docker/${BUILD_IMAGE_TARGET}/runtime-setup-yarn.dockerfile} - RUN \ +RUN \ #{INCLUDE:docker/${BUILD_IMAGE_TARGET}/runtime-adduser.sh} && echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \ # Create /projects for Che diff --git a/generator/src/__mocks__/command.ts b/generator/src/__mocks__/command.ts index 8b6a7e22f..fe7475c18 100644 --- a/generator/src/__mocks__/command.ts +++ b/generator/src/__mocks__/command.ts @@ -19,10 +19,15 @@ export class Command { * Map between the name of the exec command and the output. */ private static readonly execMap: Map = new Map(); + private static readonly execRegExpMap: Map = new Map(); // mock any exec command by providing the output - public static __setExecCommandOutput(command: string, output: string): void { - Command.execMap.set(command, output); + public static __setExecCommandOutput(command: string | RegExp, output: string): void { + if (typeof command === 'string') { + Command.execMap.set(command, output); + } else { + Command.execRegExpMap.set(command, output); + } } constructor() { @@ -34,6 +39,11 @@ export class Command { if (result) { return Promise.resolve(result); } else { + for (const entry of Command.execRegExpMap) { + if (entry[0].test(command)) { + return entry[1]; + } + } return Promise.resolve(''); } } diff --git a/generator/src/builtin-extensions.ts b/generator/src/builtin-extensions.ts new file mode 100644 index 000000000..24051e3cf --- /dev/null +++ b/generator/src/builtin-extensions.ts @@ -0,0 +1,69 @@ +/********************************************************************* +* Copyright (c) 2019 Red Hat, Inc. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +**********************************************************************/ +import * as axios from 'axios'; +import * as fs from 'fs-extra'; +import * as path from 'path'; +import * as yargs from 'yargs'; +import { Logger } from './logger'; + +/** + * Downloads builtin extensions. + * @author Anatolii Bazko + */ +export class BuiltinExtensions { + static argBuilder = (theYargs: yargs.Argv) => { + return theYargs.option('plugins', { + description: 'Plugins folder to download VS Code builtin extension into.', + alias: 'p', + }).option('extensions', { + description: 'List of VS Code builtin extensions to download.', + alias: 'e', + }); + } + + constructor( + protected readonly pluginsFolder: string, protected readonly extensions?: string) { + } + + async download(): Promise { + const downloaded = []; + + await fs.ensureDir(this.pluginsFolder); + const srcDir = path.resolve(__dirname, '../src'); + const confDir = path.join(srcDir, 'conf'); + const extensions = this.extensions || await fs.readFile(path.join(confDir, 'builtin-extensions')); + + Logger.info(`Downloading extensions into '${this.pluginsFolder}' started`); + + for (const extension of extensions.toString().split('\n')) { + if (!extension.trim() || extension.startsWith('//')) { + continue; + } + + Logger.info(`Downloading '${extension}'`); + try { + await this.downloadExtension(extension); + downloaded.push(extension); + } catch (error) { + Logger.error(error); + } + } + + Logger.info('Downloading extensions completed.'); + return downloaded; + } + + protected async downloadExtension(extension: string): Promise { + const response = await axios.default.get(extension); + const filename = extension.substring(extension.lastIndexOf('/') + 1); + + fs.writeFileSync(path.resolve(this.pluginsFolder, filename), response.data); + } +} diff --git a/generator/src/conf/builtin-extensions b/generator/src/conf/builtin-extensions new file mode 100644 index 000000000..d7ef9435a --- /dev/null +++ b/generator/src/conf/builtin-extensions @@ -0,0 +1,47 @@ +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/bat-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/clojure-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/coffeescript-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/configuration-editing-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/cpp-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/csharp-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/css-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/debug-auto-launch-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/docker-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/fsharp-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/go-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/groovy-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/grunt-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/gulp-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/handlebars-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/hlsl-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/html-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/ini-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/jake-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/java-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/javascript-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/json-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/less-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/log-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/lua-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/make-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/markdown-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/merge-conflict-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/npm-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/objective-c-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/perl-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/powershell-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/pug-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/python-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/r-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/razor-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/ruby-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/rust-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/scss-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/shaderlab-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/shellscript-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/sql-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/swift-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/typescript-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/vb-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/xml-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/yaml-1.39.1-prel.vsix diff --git a/generator/src/templates/assembly-package.mst b/generator/src/templates/assembly-package.mst index e984fcfa2..c0f819446 100644 --- a/generator/src/templates/assembly-package.mst +++ b/generator/src/templates/assembly-package.mst @@ -26,7 +26,6 @@ "@theia/keymaps": "^{{ version }}", "@theia/languages": "^{{ version }}", "@theia/markers": "^{{ version }}", - "@theia/merge-conflicts": "^{{ version }}", "@theia/messages": "^{{ version }}", "@theia/metrics": "^{{ version }}", "@theia/mini-browser": "^{{ version }}", @@ -38,11 +37,9 @@ "@theia/plugin-ext": "^{{ version }}", "@theia/plugin-ext-vscode": "^{{ version }}", "@theia/preferences": "^{{ version }}", - "@theia/preview": "^{{ version }}", "@theia/process": "^{{ version }}", "@theia/search-in-workspace": "^{{ version }}", "@theia/task": "^{{ version }}", - "@theia/textmate-grammars": "^{{ version }}", "@theia/tslint": "^{{ version }}", "@theia/userstorage": "^{{ version }}", "@theia/variable-resolver": "^{{ version }}", diff --git a/generator/src/yargs.ts b/generator/src/yargs.ts index f8f2af21a..ee830371c 100644 --- a/generator/src/yargs.ts +++ b/generator/src/yargs.ts @@ -8,15 +8,16 @@ * SPDX-License-Identifier: EPL-2.0 **********************************************************************/ -import * as yargs from 'yargs'; -import { Logger } from './logger'; import * as path from 'path'; +import * as yargs from 'yargs'; +import { BuiltinExtensions } from './builtin-extensions'; +import { Cdn } from './cdn'; +import { Clean } from './clean'; import { CliError } from './cli-error'; -import { Production } from './production'; import { Init } from './init'; -import { Cdn } from './cdn'; import { InitSources } from './init-sources'; -import { Clean } from './clean'; +import { Logger } from './logger'; +import { Production } from './production'; const ASSSEMBLY_PATH = 'examples/assembly'; @@ -28,7 +29,7 @@ const commandArgs = yargs .usage('$0 [args]') .command({ command: 'init', - describe: 'Initialize current theia to beahve like a Che/Theia', + describe: 'Initialize current theia to behave like a Che/Theia', builder: InitSources.argBuilder, handler: async (args) => { try { @@ -91,6 +92,20 @@ const commandArgs = yargs } } }) + .command({ + command: 'builtin-extensions', + describe: 'Download builtin extensions', + builder: BuiltinExtensions.argBuilder, + handler: async (args) => { + try { + const pluginsFolder = args.plugins ? path.resolve(args.plugins) : path.resolve(process.cwd(), 'plugins'); + const builtinExtensions = new BuiltinExtensions(pluginsFolder, args.extensions); + await builtinExtensions.download(); + } catch (err) { + handleError(err); + } + } + }) .help() .strict() .demandCommand() diff --git a/generator/tests/builtin-extensions/builtin-extensions b/generator/tests/builtin-extensions/builtin-extensions new file mode 100644 index 000000000..d7ef9435a --- /dev/null +++ b/generator/tests/builtin-extensions/builtin-extensions @@ -0,0 +1,47 @@ +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/bat-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/clojure-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/coffeescript-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/configuration-editing-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/cpp-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/csharp-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/css-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/debug-auto-launch-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/docker-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/fsharp-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/go-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/groovy-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/grunt-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/gulp-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/handlebars-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/hlsl-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/html-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/ini-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/jake-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/java-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/javascript-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/json-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/less-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/log-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/lua-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/make-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/markdown-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/merge-conflict-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/npm-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/objective-c-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/perl-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/powershell-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/pug-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/python-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/r-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/razor-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/ruby-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/rust-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/scss-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/shaderlab-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/shellscript-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/sql-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/swift-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/typescript-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/vb-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/xml-1.39.1-prel.vsix +https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/yaml-1.39.1-prel.vsix diff --git a/generator/tests/builtin-extensions/builtin-extensions.spec.ts b/generator/tests/builtin-extensions/builtin-extensions.spec.ts new file mode 100644 index 000000000..6256ae814 --- /dev/null +++ b/generator/tests/builtin-extensions/builtin-extensions.spec.ts @@ -0,0 +1,41 @@ +/********************************************************************* +* Copyright (c) 2019 Red Hat, Inc. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +**********************************************************************/ + +import * as fs from 'fs-extra'; +import * as path from 'path'; +import * as tmp from 'tmp'; +import { BuiltinExtensions } from '../../src/builtin-extensions'; + +describe('Test Builtin Extensions', () => { + + let rootFolderTmp: string; + let pluginsFolderTmp: string; + + beforeEach(async () => { + rootFolderTmp = tmp.dirSync({ mode: 0o750, prefix: 'tmpInit', postfix: '' }).name; + pluginsFolderTmp = path.resolve(rootFolderTmp, 'plugins'); + }); + + afterEach(() => { + fs.removeSync(rootFolderTmp); + }); + + test('test download extensions', async () => { + const expected = fs.readFileSync('tests/builtin-extensions/builtin-extensions') + .toString() + .split('\n') + .filter(value => !!value); + + const builtinExtensions = new BuiltinExtensions(pluginsFolderTmp); + builtinExtensions['downloadExtension'] = jest.fn(); + expect(await builtinExtensions.download()).toEqual(expected); + }); + +}); diff --git a/generator/tests/init-sources/assembly-example/assembly-package.json b/generator/tests/init-sources/assembly-example/assembly-package.json index c7bdc7ed0..bb78a1413 100644 --- a/generator/tests/init-sources/assembly-example/assembly-package.json +++ b/generator/tests/init-sources/assembly-example/assembly-package.json @@ -17,7 +17,6 @@ "@theia/keymaps": "^0.3.16", "@theia/languages": "^0.3.16", "@theia/markers": "^0.3.16", - "@theia/merge-conflicts": "^0.3.16", "@theia/messages": "^0.3.16", "@theia/mini-browser": "^0.3.16", "@theia/monaco": "^0.3.16", @@ -27,11 +26,9 @@ "@theia/plugin-ext": "^0.3.16", "@theia/plugin-ext-vscode": "^0.3.16", "@theia/preferences": "^0.3.16", - "@theia/preview": "^0.3.16", "@theia/process": "^0.3.16", "@theia/search-in-workspace": "^0.3.16", "@theia/task": "^0.3.16", - "@theia/textmate-grammars": "^0.3.16", "@theia/tslint": "^0.3.16", "@theia/userstorage": "^0.3.16", "@theia/variable-resolver": "^0.3.16", diff --git a/generator/tests/production/assembly/package.json b/generator/tests/production/assembly/package.json index c7bdc7ed0..bb78a1413 100644 --- a/generator/tests/production/assembly/package.json +++ b/generator/tests/production/assembly/package.json @@ -17,7 +17,6 @@ "@theia/keymaps": "^0.3.16", "@theia/languages": "^0.3.16", "@theia/markers": "^0.3.16", - "@theia/merge-conflicts": "^0.3.16", "@theia/messages": "^0.3.16", "@theia/mini-browser": "^0.3.16", "@theia/monaco": "^0.3.16", @@ -27,11 +26,9 @@ "@theia/plugin-ext": "^0.3.16", "@theia/plugin-ext-vscode": "^0.3.16", "@theia/preferences": "^0.3.16", - "@theia/preview": "^0.3.16", "@theia/process": "^0.3.16", "@theia/search-in-workspace": "^0.3.16", "@theia/task": "^0.3.16", - "@theia/textmate-grammars": "^0.3.16", "@theia/tslint": "^0.3.16", "@theia/userstorage": "^0.3.16", "@theia/variable-resolver": "^0.3.16",