Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Add task plugin #97

Merged
merged 6 commits into from
Mar 14, 2019
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: 4 additions & 0 deletions plugins/task-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/
lib/
node_modules/
*.theia
31 changes: 31 additions & 0 deletions plugins/task-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Theia - Che Task Plug-in

The plugin allows to work with the Che Commands through the Theia Tasks concept.

Contributes:
- Che task runner that runs the Che commands as the Theia tasks;
- Che task resolver that fills the missed mandatory parameters in a task;
- Che task provider that provides the Che workspace's commands as provided Theia tasks;
- `Preview URLs` view;
- `che.task.preview.notifications` preference to set the preferred way of previewing a service URL:
- `on` value enables a notification to ask a user how a URL should be opened
- `alwaysPreview` value tells Theia to open a preview URL automatically inside Theia as soon as a task is running
- `alwaysGoTo` value tells Theia to open a preview URL automatically in a separate browser's tab as soon as a task is running
- `off` value disables opening a preview URL (automatically and with a notification)

The format of a Che task is the following:
```json
{
"type": "che",
"label": "",
"command": "",
"target": {
"workspaceId": "",
"machineName": ""
},
"previewUrl": ""
}
```
The `target` and `previewUrl` fields are optional.

The variables substitution is supported for the `command` and `previewUrl` fields.
62 changes: 62 additions & 0 deletions plugins/task-plugin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
Copy link
Contributor

@benoitf benoitf Mar 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package-lock.json file should be removed (we're using yarn workspaces)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed, thank you!

"name": "task-plugin",
"publisher": "theia",
"keywords": [
"theia-plugin"
],
"version": "0.0.1",
"license": "EPL-2.0",
"contributors": [
{
"name": "Artem Zatsarynnyi",
"email": "azatsary@redhat.com"
},
{
"name": "Roman Nikitenko",
"email": "rnikiten@redhat.com"
}
],
"files": [
"src"
],
"contributes": {
"configuration": {
"type": "object",
"title": "Che task preview configuration",
"properties": {
"che.task.preview.notifications": {
"type": "string",
"default": "on",
"enum": [
"on",
"alwaysPreview",
"alwaysGoTo",
"off"
],
"description": "Enable/disable the notifications with a proposal to open a Che task's preview URL. Can be: 'on', 'alwaysPreview', 'alwaysGoTo' or 'off'."
}
}
}
},
"devDependencies": {
"@eclipse-che/plugin": "0.0.1",
"@theia/plugin": "next",
"@theia/plugin-packager": "latest"
},
"scripts": {
"prepare": "yarn run clean && yarn run build",
"clean": "rimraf lib",
"format": "tsfmt -r --useTsfmt ../../configs/tsfmt.json",
"watch": "tsc -watch",
"compile": "tsc",
"lint": "tslint -c ../../configs/tslint.json --project tsconfig.json",
"lint:fix": "tslint -c ../../configs/tslint.json --fix --project .",
"build": "concurrently -n \"format,lint,compile\" -c \"red,green,blue\" \"yarn format\" \"yarn lint\" \"yarn compile\" && theia:plugin pack"
},
"engines": {
"theiaPlugin": "next"
},
"theiaPlugin": {
"backend": "lib/task-plugin-backend.js"
}
}
Loading