From 67725aee26b352c8d980abf41ce70165defc025b Mon Sep 17 00:00:00 2001 From: Vitaliy Gulyy Date: Wed, 8 Jan 2020 12:09:14 +0200 Subject: [PATCH] Rename factory-plugin to workspace-plugin Signed-off-by: Vitaliy Gulyy --- CONTRIBUTING.md | 12 ++++----- che-theia-init-sources.yml | 2 +- devfiles/che-theia-all.devfile.yaml | 26 +++++++++---------- plugins/factory-plugin/.gitignore | 3 --- plugins/workspace-plugin/.gitignore | 3 +++ .../.travis.yml | 0 .../README.md | 0 .../package.json | 12 ++++----- .../src/devfile.ts | 2 +- .../src/ephemeral-workspace-checker.ts | 0 .../src/exec.ts | 0 .../src/factory-initializer.ts | 0 .../src/file-uri.ts | 0 .../src/git.ts | 0 .../src/projects.ts | 0 .../src/theia-commands.ts | 2 +- .../src/workspace-plugin.ts} | 0 .../src/workspace-projects-manager.ts | 0 .../tests/file-uri.spec.ts | 8 +++--- .../tests/git.spec.ts | 0 .../tests/projects.spec.ts | 0 .../tsconfig.json | 0 22 files changed, 35 insertions(+), 35 deletions(-) delete mode 100644 plugins/factory-plugin/.gitignore create mode 100644 plugins/workspace-plugin/.gitignore rename plugins/{factory-plugin => workspace-plugin}/.travis.yml (100%) rename plugins/{factory-plugin => workspace-plugin}/README.md (100%) rename plugins/{factory-plugin => workspace-plugin}/package.json (88%) rename plugins/{factory-plugin => workspace-plugin}/src/devfile.ts (96%) rename plugins/{factory-plugin => workspace-plugin}/src/ephemeral-workspace-checker.ts (100%) rename plugins/{factory-plugin => workspace-plugin}/src/exec.ts (100%) rename plugins/{factory-plugin => workspace-plugin}/src/factory-initializer.ts (100%) rename plugins/{factory-plugin => workspace-plugin}/src/file-uri.ts (100%) rename plugins/{factory-plugin => workspace-plugin}/src/git.ts (100%) rename plugins/{factory-plugin => workspace-plugin}/src/projects.ts (100%) rename plugins/{factory-plugin => workspace-plugin}/src/theia-commands.ts (99%) rename plugins/{factory-plugin/src/factory-plugin.ts => workspace-plugin/src/workspace-plugin.ts} (100%) rename plugins/{factory-plugin => workspace-plugin}/src/workspace-projects-manager.ts (100%) rename plugins/{factory-plugin => workspace-plugin}/tests/file-uri.spec.ts (78%) rename plugins/{factory-plugin => workspace-plugin}/tests/git.spec.ts (100%) rename plugins/{factory-plugin => workspace-plugin}/tests/projects.spec.ts (100%) rename plugins/{factory-plugin => workspace-plugin}/tsconfig.json (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ac8f5df79..1e7b268f5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -103,7 +103,7 @@ At this stage, you can code on Che-theia plugins. In this devfile, containers an Che-theia plugins are located in `/projects/che-theia/plugins/` folder. ### Step 6: Compile your plugin -You can use the che command `build ... containers-plugin` or `build ... factory-plugin` (command pallette > Run task > … or containers view) +You can use the che command `build ... containers-plugin` or `build ... workspace-plugin` (command pallette > Run task > … or containers view) Basically, this command will perform in the right plugin folder: ``` @@ -116,12 +116,12 @@ $ yarn ### Step 7: Run che-theia + plugin In this section, we are going to run the che-theia assembly built previously and run that with one of the plugins built previously. We will be able to test our changes with a dedicated che-theia instance. -You can use the che command `run ... DEV che-theia + factory-plugin` or `run ... DEV che-theia + containers-plugin` (command pallette > Run task > … or containers view) +You can use the che command `run ... DEV che-theia + workspace-plugin` or `run ... DEV che-theia + containers-plugin` (command pallette > Run task > … or containers view) Basically, this command will start the DEV che-theia with the plugin: ``` [theia-ide] -$ export HOSTED_PLUGIN=/projects/che-theia/plugins/factory-plugin/ +$ export HOSTED_PLUGIN=/projects/che-theia/plugins/workspace-plugin/ $ node /projects/theia/production/src-gen/backend/main.js /tmp/theiadev_projects --hostname=0.0.0.0 --port=3130 ``` @@ -131,7 +131,7 @@ You can then access to your modified Che-theia from the Container view `theia-de ### Step 7bis: 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 +You can use the che command `run ... DEV yarn start ... che-theia + workspace-plugin` or `run ... DEV yarn start... che-theia + containers-plugin` (command pallette > Run task > … or containers view). To start che-theia in `dev-mode` with yarn (not using the production che-theia generated). It would keep things like the ability to source map. @@ -140,9 +140,9 @@ Running dev theia would be located in the che-dev container and `theia-dev-flow` ![Che-Theia-dev-endpoint](https://raw.githubusercontent.com/eclipse/che-theia/assets/theia-dev-flow-endpoint.png) ### Just want to build the plugin and run with the existing Theia image -If you do not have any changes on Theia or Che-theia extension, you could just build the plugins with `build ... containers-plugin` or `build ... factory-plugin` +If you do not have any changes on Theia or Che-theia extension, you could just build the plugins with `build ... containers-plugin` or `build ... workspace-plugin` and run these plugins with the existing che-theia app: -`run ... HOSTED che-theia + container-plugin` or `run ... HOSTED che-theia + factory-plugin` +`run ... HOSTED che-theia + container-plugin` or `run ... HOSTED che-theia + workspace-plugin` ## How to develop Che Theia remote plugin mechanism diff --git a/che-theia-init-sources.yml b/che-theia-init-sources.yml index c6b3416f1..42ca38846 100644 --- a/che-theia-init-sources.yml +++ b/che-theia-init-sources.yml @@ -14,7 +14,7 @@ sources: - extensions/eclipse-che-theia-git-provisioner plugins: - plugins/containers-plugin - - plugins/factory-plugin + - plugins/workspace-plugin - plugins/ports-plugin - plugins/task-plugin - plugins/welcome-plugin diff --git a/devfiles/che-theia-all.devfile.yaml b/devfiles/che-theia-all.devfile.yaml index f3711a411..587c8eb75 100644 --- a/devfiles/che-theia-all.devfile.yaml +++ b/devfiles/che-theia-all.devfile.yaml @@ -89,35 +89,35 @@ commands: echo -e "\e[32mDone.\e[0m build ... containers-plugin" workdir: /projects/che-theia/plugins/containers-plugin - - name: build ... factory-plugin + - name: build ... workspace-plugin actions: - type: exec component: che-dev command: > killall node; yarn && - echo -e "\e[32mDone.\e[0m build ... factory-plugin" - workdir: /projects/che-theia/plugins/factory-plugin + echo -e "\e[32mDone.\e[0m build ... workspace-plugin" + workdir: /projects/che-theia/plugins/workspace-plugin - - name: test-watch ... factory-plugin + - name: test-watch ... workspace-plugin actions: - type: exec component: che-dev command: > killall node; yarn test-watch - workdir: /projects/che-theia/plugins/factory-plugin + workdir: /projects/che-theia/plugins/workspace-plugin - - name: run ... DEV che-theia + factory-plugin + - name: run ... DEV che-theia + workspace-plugin actions: - type: exec component: theia-editor command: > kill `cat /tmp/node_theiadev.pid`; - rm /default-theia-plugins/eclipse_che_theia_factory_plugin.theia; + rm /default-theia-plugins/eclipse_che_workspace_plugin.theia; mkdir -p /tmp/theiadev_projects && export CHE_PROJECTS_ROOT=/tmp/theiadev_projects && - export HOSTED_PLUGIN=/projects/che-theia/plugins/factory-plugin/ && + export HOSTED_PLUGIN=/projects/che-theia/plugins/workspace-plugin/ && 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 @@ -134,16 +134,16 @@ 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 ... HOSTED che-theia + factory-plugin + - name: run ... HOSTED che-theia + workspace-plugin actions: - type: exec component: theia-editor command: > kill `cat /tmp/node_theiadev.pid`; - rm /default-theia-plugins/eclipse_che_theia_factory_plugin.theia; + rm /default-theia-plugins/eclipse_che_workspace_plugin.theia; mkdir -p /tmp/theiadev_projects && export CHE_PROJECTS_ROOT=/tmp/theiadev_projects && - cp /projects/che-theia/plugins/factory-plugin/eclipse_che_theia_factory_plugin.theia /default-theia-plugins/ && + cp /projects/che-theia/plugins/workspace-plugin/eclipse_che_workspace_plugin.theia /default-theia-plugins/ && 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 @@ -160,7 +160,7 @@ 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 ... DEV yarn start ... che-theia + factory-plugin + - name: run ... DEV yarn start ... che-theia + workspace-plugin actions: - type: exec component: che-dev @@ -168,7 +168,7 @@ commands: killall node; mkdir -p /tmp/theiadev_projects && export CHE_PROJECTS_ROOT=/tmp/theiadev_projects && - export HOSTED_PLUGIN=/projects/che-theia/plugins/factory-plugin/ && + export HOSTED_PLUGIN=/projects/che-theia/plugins/workspace-plugin/ && export GIT_EXEC_PATH=/usr/libexec/git-core && export USE_LOCAL_GIT=true && export LOCAL_GIT_DIRECTORY=/usr && yarn start /tmp/theiadev_projects --hostname=0.0.0.0 --port=3010 workdir: /projects/theia/examples/assembly diff --git a/plugins/factory-plugin/.gitignore b/plugins/factory-plugin/.gitignore deleted file mode 100644 index bf3e2b528..000000000 --- a/plugins/factory-plugin/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -lib -coverage -eclipse_che_theia_factory_plugin.theia diff --git a/plugins/workspace-plugin/.gitignore b/plugins/workspace-plugin/.gitignore new file mode 100644 index 000000000..24bb3b2dd --- /dev/null +++ b/plugins/workspace-plugin/.gitignore @@ -0,0 +1,3 @@ +lib +coverage +eclipse_che_workspace_plugin.theia diff --git a/plugins/factory-plugin/.travis.yml b/plugins/workspace-plugin/.travis.yml similarity index 100% rename from plugins/factory-plugin/.travis.yml rename to plugins/workspace-plugin/.travis.yml diff --git a/plugins/factory-plugin/README.md b/plugins/workspace-plugin/README.md similarity index 100% rename from plugins/factory-plugin/README.md rename to plugins/workspace-plugin/README.md diff --git a/plugins/factory-plugin/package.json b/plugins/workspace-plugin/package.json similarity index 88% rename from plugins/factory-plugin/package.json rename to plugins/workspace-plugin/package.json index 34baa8695..001d54d51 100644 --- a/plugins/factory-plugin/package.json +++ b/plugins/workspace-plugin/package.json @@ -1,10 +1,10 @@ { - "name": "@eclipse-che/theia-factory-plugin", + "name": "@eclipse-che/workspace-plugin", "publisher": "Eclipse Che", + "version": "0.0.1", "keywords": [ "theia-plugin" ], - "version": "0.0.1", "license": "EPL-2.0", "files": [ "src" @@ -36,7 +36,7 @@ "theiaPlugin": "next" }, "theiaPlugin": { - "backend": "lib/factory-plugin.js" + "backend": "lib/workspace-plugin.js" }, "jest": { "collectCoverage": true, @@ -67,19 +67,19 @@ "menus": { "editor/context": [ { - "command": "factory-plugin.create-workspace", + "command": "workspace-plugin.create-workspace", "when": "resourceFilename =~ /devfile/" } ], "editor/title": [ { - "command": "factory-plugin.create-workspace", + "command": "workspace-plugin.create-workspace", "when": "resourceFilename =~ /devfile/" } ], "explorer/context": [ { - "command": "factory-plugin.create-workspace", + "command": "workspace-plugin.create-workspace", "when": "resourceFilename =~ /devfile/" } ] diff --git a/plugins/factory-plugin/src/devfile.ts b/plugins/workspace-plugin/src/devfile.ts similarity index 96% rename from plugins/factory-plugin/src/devfile.ts rename to plugins/workspace-plugin/src/devfile.ts index d3d4360a7..d976e736e 100644 --- a/plugins/factory-plugin/src/devfile.ts +++ b/plugins/workspace-plugin/src/devfile.ts @@ -12,7 +12,7 @@ import * as theia from '@theia/plugin'; import * as che from '@eclipse-che/plugin'; const CREATE_WORKSPACE_COMMAND = { - id: 'factory-plugin.create-workspace', + id: 'workspace-plugin.create-workspace', label: 'Create Workspace', tooltip: 'Create workspace from this DevFile' }; diff --git a/plugins/factory-plugin/src/ephemeral-workspace-checker.ts b/plugins/workspace-plugin/src/ephemeral-workspace-checker.ts similarity index 100% rename from plugins/factory-plugin/src/ephemeral-workspace-checker.ts rename to plugins/workspace-plugin/src/ephemeral-workspace-checker.ts diff --git a/plugins/factory-plugin/src/exec.ts b/plugins/workspace-plugin/src/exec.ts similarity index 100% rename from plugins/factory-plugin/src/exec.ts rename to plugins/workspace-plugin/src/exec.ts diff --git a/plugins/factory-plugin/src/factory-initializer.ts b/plugins/workspace-plugin/src/factory-initializer.ts similarity index 100% rename from plugins/factory-plugin/src/factory-initializer.ts rename to plugins/workspace-plugin/src/factory-initializer.ts diff --git a/plugins/factory-plugin/src/file-uri.ts b/plugins/workspace-plugin/src/file-uri.ts similarity index 100% rename from plugins/factory-plugin/src/file-uri.ts rename to plugins/workspace-plugin/src/file-uri.ts diff --git a/plugins/factory-plugin/src/git.ts b/plugins/workspace-plugin/src/git.ts similarity index 100% rename from plugins/factory-plugin/src/git.ts rename to plugins/workspace-plugin/src/git.ts diff --git a/plugins/factory-plugin/src/projects.ts b/plugins/workspace-plugin/src/projects.ts similarity index 100% rename from plugins/factory-plugin/src/projects.ts rename to plugins/workspace-plugin/src/projects.ts diff --git a/plugins/factory-plugin/src/theia-commands.ts b/plugins/workspace-plugin/src/theia-commands.ts similarity index 99% rename from plugins/factory-plugin/src/theia-commands.ts rename to plugins/workspace-plugin/src/theia-commands.ts index 4bf01af9d..f676ff197 100644 --- a/plugins/factory-plugin/src/theia-commands.ts +++ b/plugins/workspace-plugin/src/theia-commands.ts @@ -190,7 +190,7 @@ export class TheiaImportZipCommand implements TheiaImportCommand { this.locationURI = source!.location; this.projectDir = path.join(projectsRoot, project.name!); - this.tmpDir = fs.mkdtempSync(path.join(`${os.tmpdir()}${path.sep}`, 'factory-plugin-')); + this.tmpDir = fs.mkdtempSync(path.join(`${os.tmpdir()}${path.sep}`, 'workspace-plugin-')); this.zipfile = `${project.name}.zip`; this.zipfilePath = path.join(this.tmpDir, this.zipfile); } else { diff --git a/plugins/factory-plugin/src/factory-plugin.ts b/plugins/workspace-plugin/src/workspace-plugin.ts similarity index 100% rename from plugins/factory-plugin/src/factory-plugin.ts rename to plugins/workspace-plugin/src/workspace-plugin.ts diff --git a/plugins/factory-plugin/src/workspace-projects-manager.ts b/plugins/workspace-plugin/src/workspace-projects-manager.ts similarity index 100% rename from plugins/factory-plugin/src/workspace-projects-manager.ts rename to plugins/workspace-plugin/src/workspace-projects-manager.ts diff --git a/plugins/factory-plugin/tests/file-uri.spec.ts b/plugins/workspace-plugin/tests/file-uri.spec.ts similarity index 78% rename from plugins/factory-plugin/tests/file-uri.spec.ts rename to plugins/workspace-plugin/tests/file-uri.spec.ts index 7d0d8edd6..0e7da6b21 100644 --- a/plugins/factory-plugin/tests/file-uri.spec.ts +++ b/plugins/workspace-plugin/tests/file-uri.spec.ts @@ -28,10 +28,10 @@ describe('Test exec commands', () => { describe('Testing convertion of project paths to be stored in the workspace config', () => { test('Converting fs project path to che project path', async () => { - expect(convertToCheProjectPath('/projects/che-factory-extension/', '/projects')).toBe('che-factory-extension'); - expect(convertToCheProjectPath('/projects/che-factory-extension', '/projects')).toBe('che-factory-extension'); - expect(convertToCheProjectPath('/projects/che/che-factory-extension/', '/projects')).toBe('che/che-factory-extension'); + expect(convertToCheProjectPath('/projects/che-workspace-extension/', '/projects')).toBe('che-workspace-extension'); + expect(convertToCheProjectPath('/projects/che-workspace-extension', '/projects')).toBe('che-workspace-extension'); + expect(convertToCheProjectPath('/projects/che/che-workspace-extension/', '/projects')).toBe('che/che-workspace-extension'); expect(convertToCheProjectPath('/projects/theiadev_projects/blog.sunix.org/', '/projects/theiadev_projects')).toBe('blog.sunix.org'); - expect(convertToCheProjectPath('/projects/che/che-factory-extension/', undefined)).toBe('che/che-factory-extension'); + expect(convertToCheProjectPath('/projects/che/che-workspace-extension/', undefined)).toBe('che/che-workspace-extension'); }); }); diff --git a/plugins/factory-plugin/tests/git.spec.ts b/plugins/workspace-plugin/tests/git.spec.ts similarity index 100% rename from plugins/factory-plugin/tests/git.spec.ts rename to plugins/workspace-plugin/tests/git.spec.ts diff --git a/plugins/factory-plugin/tests/projects.spec.ts b/plugins/workspace-plugin/tests/projects.spec.ts similarity index 100% rename from plugins/factory-plugin/tests/projects.spec.ts rename to plugins/workspace-plugin/tests/projects.spec.ts diff --git a/plugins/factory-plugin/tsconfig.json b/plugins/workspace-plugin/tsconfig.json similarity index 100% rename from plugins/factory-plugin/tsconfig.json rename to plugins/workspace-plugin/tsconfig.json