-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 619609b
Showing
16 changed files
with
1,516 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
*.tar.gz | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
sudo: required | ||
language: node_js | ||
node_js: '9' | ||
git: | ||
depth: 1 | ||
cache: | ||
yarn: true | ||
directories: | ||
- ui/node_modules | ||
branches: | ||
only: | ||
- master | ||
before_install: | ||
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- | ||
- export PATH=$HOME/.yarn/bin:$PATH ; | ||
install: ./build.sh | ||
script: ./build.sh | ||
jobs: | ||
fast_finish: true | ||
include: | ||
- stage: deploy | ||
os: linux | ||
deploy: | ||
- provider: releases | ||
api-key: $GITHUB_AUTH_TOKEN | ||
name: che-plugin-$(date +'%F-%T') | ||
file_glob: true | ||
file: ./assembly/*.tar.gz | ||
skip_cleanup: true | ||
on: | ||
branch: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# che-dummy-plugin | ||
Che Plug-in with a simple hello world Theia plug-in. | ||
|
||
## Folders | ||
here are the different folders: | ||
|
||
### ui | ||
This is a pure Theia plug-in. This plug-in contains a command named `Hello World` that displays an information message. | ||
|
||
note: there is a `build.sh` script to build locally the npm plug-in. It can also be tested using the self-hosting mode in theia. | ||
|
||
#### requirements: yarn + nodejs | ||
|
||
### assembly | ||
|
||
In this folder, the Che plug-in is generated (`che-service-plugin.tar.gz`) including: | ||
- che-plugin.yaml file (from `etc/` folder) describing the Che plug-in wrapping the theia plug-in | ||
- che-dependency.yaml file (from `etc/` folder) linking the Theia plug-in to a local file | ||
- hello_world_plugin.theia the Theia plug-in | ||
|
||
note: there is a build.sh allowing to recreate this .tar.gz file | ||
|
||
|
||
## Building | ||
|
||
In the root folder, `build.sh` script can build the theia plug-in and create Che plug-in file. | ||
|
||
## Using | ||
|
||
In Releases section, https://github.com/ws-skeleton/che-dummy-plugin/releases, a new Che plug-in is published for each commit occuring into master. | ||
|
||
## CI job | ||
Che plug-in is managed by a Travis-CI job | ||
--> https://travis-ci.org/ws-skeleton/che-dummy-plugin/builds | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
### Che Plugin Assembly | ||
|
||
Package plug-in definition and includes Theia plug-in inside | ||
|
||
Result is a .tar.gz file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
set -e | ||
set -u | ||
|
||
if [ -f che-dummy-plugin.tar.gz ]; then | ||
rm che-dummy-plugin.tar.gz | ||
fi | ||
|
||
if [ ! -f ../ui/hello_world_plugin.theia ]; then | ||
echo "Theia plug-in does not exist. Please compile Theia plug-in first" | ||
echo "in ../ui directory" | ||
exit 1 | ||
fi | ||
|
||
tar cvf che-dummy-plugin.tar -C ../ui hello_world_plugin.theia | ||
tar uvf che-dummy-plugin.tar etc | ||
gzip che-dummy-plugin.tar | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
plugins: | ||
- id: theia-hello-world | ||
version: 1.0.0 | ||
location: /hello_world_plugin.theia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
editors: | ||
- id: org.eclipse.che.editor.theia | ||
plugins: [theia-hello-world:1.0.0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
set -e | ||
set -u | ||
|
||
BLUE='\033[1;34m' | ||
NC='\033[0m' | ||
DIR=$(cd "$(dirname "$0")"; pwd) | ||
|
||
printf "${BLUE}Building Theia plug-in${NC}\n" | ||
cd ${DIR}/ui && ./build.sh | ||
|
||
printf "${BLUE}Generating Che plug-in file...${NC}\n" | ||
cd ${DIR}/assembly && ./build.sh | ||
printf "${BLUE}Generated in assembly/che-service-plugin.tar.gz${NC}\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
lib/ | ||
node_modules/ | ||
*.theia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# hello-world-plugin | ||
hello-world Plugin example for Theia. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
set -e | ||
set -u | ||
|
||
yarn | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "hello-world-plugin", | ||
"publisher": "theia", | ||
"keywords": [ | ||
"theia-plugin" | ||
], | ||
"version": "0.0.1", | ||
"files": [ | ||
"src" | ||
], | ||
"devDependencies": { | ||
"@theia/plugin": "next", | ||
"@theia/plugin-packager": "latest", | ||
"rimraf": "2.6.2", | ||
"typescript-formatter": "7.2.2", | ||
"typescript": "2.9.2" | ||
}, | ||
"scripts": { | ||
"prepare": "yarn run clean && yarn run build", | ||
"clean": "rimraf lib", | ||
"format-code": "tsfmt -r", | ||
"watch": "tsc -watch", | ||
"compile": "tsc", | ||
"build": "yarn run format-code && yarn run compile && theia:plugin pack" | ||
}, | ||
"engines": { | ||
"theiaPlugin": "next" | ||
}, | ||
"theiaPlugin": { | ||
|
||
|
||
"backend": "lib/hello-world-backend-plugin.js" | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Generated using theia-plugin-generator | ||
*/ | ||
|
||
import * as theia from '@theia/plugin'; | ||
|
||
export function start() { | ||
const informationMessageTestCommand = { | ||
id: 'hello-world-example-generated', | ||
label: "Hello World" | ||
}; | ||
theia.commands.registerCommand(informationMessageTestCommand, (...args: any[]) => { | ||
theia.window.showInformationMessage('Hello World!'); | ||
}); | ||
|
||
} | ||
|
||
export function stop() { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"compilerOptions": { | ||
"strict": true, | ||
"experimentalDecorators": true, | ||
"noUnusedLocals": true, | ||
"emitDecoratorMetadata": true, | ||
"downlevelIteration": true, | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"target": "es5", | ||
"lib": [ | ||
"es6", | ||
|
||
|
||
"webworker" | ||
|
||
], | ||
"sourceMap": true, | ||
"rootDir": "src", | ||
"outDir": "lib" | ||
}, | ||
"include": [ | ||
"src" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"baseIndentSize": 0, | ||
"newLineCharacter": "\n", | ||
"indentSize": 4, | ||
"tabSize": 4, | ||
"indentStyle": 4, | ||
"convertTabsToSpaces": true, | ||
"insertSpaceAfterCommaDelimiter": true, | ||
"insertSpaceAfterSemicolonInForStatements": true, | ||
"insertSpaceBeforeAndAfterBinaryOperators": true, | ||
"insertSpaceAfterKeywordsInControlFlowStatements": true, | ||
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, | ||
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, | ||
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, | ||
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, | ||
"placeOpenBraceOnNewLineForFunctions": false, | ||
"placeOpenBraceOnNewLineForControlBlocks": false | ||
} |
Oops, something went wrong.