Skip to content

Commit

Permalink
#455 #456 Update to latest versions
Browse files Browse the repository at this point in the history
- Move example project 'SuperBrewer3000' to client/workspace and adapt all paths accordingly
- Rename frontend folder to client and adapt all paths
- Update client code to Theia 1.27.0 an current versions of glsp, sprotty and emfcloud components
- Update to newer typescript version and adapt code accordingly
- Update theia plugins to newest compatible versions to ensure cpp and java debugging
- Reuse tsconfig, eslint and prettier configs by eclipse-glsp
- Align build scripts, devDependencies and package.json descriptions
- Fix custom file icons alignment
-  #348 Replace run.sh script with ts-node scripts and yarn scripts
  - Create parent package.json that offers the main build scripts build:server and build:client as well as a convenience script that combines those two
  - Move copying of backend products in the build of the repsonsible client package coffee-servers and replace with ts-node script
  - Move all server backend registrations to coffee-servers package
  • Loading branch information
ndoschek committed Sep 1, 2022
1 parent 67e6406 commit c4d8f2b
Show file tree
Hide file tree
Showing 159 changed files with 6,174 additions and 4,462 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,20 @@ WORKDIR /coffee-editor
COPY --chown=theia:theia . .
USER theia

RUN ./run.sh -bcf && \
cp ./web/favicon.ico ./web/browser-app/lib
RUN sed -i 's/<\/head>/<link rel="icon" href="favicon.ico" \/><\/head>/g' web/browser-app/lib/index.html
# Trigger build: Build backend, build client
RUN yarn build
RUN cp ./client/favicon.ico ./client/browser-app/lib
RUN sed -i 's/<\/head>/<link rel="icon" href="favicon.ico" \/><\/head>/g' client/browser-app/lib/index.html

WORKDIR /coffee-editor/backend/examples/SuperBrewer3000
WORKDIR /coffee-editor/client/workspace/SuperBrewer3000

RUN git config --global user.name "Test User"
RUN git config --global user.email "[email protected]"
RUN git init
RUN git add *
RUN git commit -m "init"

WORKDIR /coffee-editor/web/browser-app
WORKDIR /coffee-editor/client/browser-app

EXPOSE 3000

Expand Down
19 changes: 5 additions & 14 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,7 @@ pipeline {
container('ci') {
timeout(30){
dir('backend/releng/org.eclipse.emfcloud.coffee.parent') {
sh 'mvn clean install -Pfatjar -U --batch-mode -Dmaven.repo.local=/home/jenkins/.m2/repository'
}
}
}
}
}
stage('Copy server') {
steps {
container('ci') {
timeout(30){
dir('.') {
sh './run.sh -c'
sh 'mvn clean install -U --batch-mode -Dmaven.repo.local=/home/jenkins/.m2/repository'
}
}
}
Expand All @@ -72,7 +61,7 @@ pipeline {
withCredentials([string(credentialsId: "github-bot-token", variable: 'GITHUB_TOKEN')]) {
timeout(30){
dir('.') {
sh './run.sh -f'
sh 'yarn build:client'
}
}
}
Expand All @@ -85,7 +74,9 @@ pipeline {
steps {
container('ci') {
archiveArtifacts artifacts: 'backend/releng/org.eclipse.emfcloud.coffee.product/target/products/*.zip' , fingerprint: true
archiveArtifacts artifacts: 'web/browser-app/**', fingerprint: true
archiveArtifacts artifacts: 'backend/plugins/org.eclipse.emfcloud.coffee.workflow.glsp.server/target/org.eclipse.emfcloud.coffee.workflow.glsp.server-0.1.0-SNAPSHOT-glsp.jar' , fingerprint: true
archiveArtifacts artifacts: 'backend/plugins/org.eclipse.emfcloud.coffee.modelserver/target/org.eclipse.emfcloud.coffee.modelserver-0.1.0-SNAPSHOT-standalone.jar' , fingerprint: true
archiveArtifacts artifacts: 'client/browser-app/**', fingerprint: true
}
}
}
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ The runtime environment has installed (among others)

The coffee-editor consists of a frontend and a backend.

The frontend is located in the `web/` folder and frontend specific documentation can be found in the [frontend README](web/README.md)
The backend is located in the `backend/` folder and backend specific documentation can be found in the [backend README](backend/README.md)
The frontend is located in the [`client/`](./client/) folder and frontend specific documentation can be found in the [client README](client/README.md)
The backend is located in the [`backend/`](./backend/) folder and backend specific documentation can be found in the [backend README](backend/README.md)

## Used Projects

Expand All @@ -70,8 +70,8 @@ You need Java 11 to build the Coffee Editor.

### Install npm and node

nvm install 12
nvm use 12
nvm install 16
nvm use 16

### Install yarn

Expand Down Expand Up @@ -164,17 +164,16 @@ You can also use the predefined `RunSocketServer-Headless.launch` run config.

#### Coffee Model Server

Use the `org.eclipse.emfcloud.coffee.modelserver.app.application` Eclipse Application or the corresponding `modelserver.product` from `org.eclipse.emfcloud.coffee.product` to start the Model Server.
Use the `CoffeeModelServer` launch config to start the Model Server.

#### Coffee GLSP Server

Use the `workflowserver.product` product to start the GLSP Server.
On the client side, set the `isRunning` flag of the [CoffeeGlspLaunchOptions](web/coffee-server/src/node/backend-module.ts) to `true`.
Use the `WorkflowGLSPServer` launch config to start the GLSP Server.

### Debug Frontend
### Debug Client

- Install VSCode
- Import projects from `web`
- Open folder `client`

#### Debug Theia Backend

Expand Down
20 changes: 0 additions & 20 deletions backend/examples/SuperBrewer3000/.theia/tasks.json

This file was deleted.

35 changes: 35 additions & 0 deletions client/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: '@eclipse-glsp',
parserOptions: {
tsconfigRootDir: __dirname,
project: 'tsconfig.json'
},
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
// eslint-plugin-header
'header/header': [
2,
'block',
[
{
pattern: '[\n\r]+ \\* Copyright \\([cC]\\) \\d{4}(-\\d{4})? .*[\n\r]+',
template: `
* Copyright (c) 2022 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the MIT License which is
* available at https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: EPL-2.0 OR MIT
`
}
]
]
}
}
]
};
2 changes: 2 additions & 0 deletions web/.gitignore → client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ out/
*-app/*
!*-app/package.json
server/
servers/
*.vsix
tsconfig.tsbuildinfo
1 change: 1 addition & 0 deletions client/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@eclipse-glsp/prettier-config"
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"recommendations": [
"dbaeumer.vscode-eslint",
"aeschli.vscode-css-formatter",
"esbenp.prettier-vscode"
"esbenp.prettier-vscode",
"DavidAnson.vscode-markdownlint"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
Expand Down
18 changes: 7 additions & 11 deletions web/.vscode/launch.json → client/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
{
"type": "node",
"request": "launch",
"name": "Launch Browser Backend",
"name": "Launch Browser Backend [DEBUG] (External GLSP Server)",
"program": "${workspaceRoot}/browser-app/src-gen/backend/main.js",
"args": [
"--loglevel=debug",
"--port=3000",
"--no-cluster",
"--WORKFLOW_NOTATION_LSP=5008",
"--WF_GLSP=5008",
"--WF_LSP=5017",
"--WF_ANALYZER=5083",
"--app-project-path=${workspaceRoot}/browser-app",
"--plugins=local-dir:${workspaceRoot}/browser-app/plugins",
"--root-dir=${workspaceRoot}/../backend/examples/SuperBrewer3000"
"--root-dir=${workspaceRoot}/workspace/SuperBrewer3000"
],
"env": {
"NODE_ENV": "development",
Expand All @@ -30,9 +30,9 @@
"${workspaceRoot}/browser-app/lib/**/*.js",
"${workspaceRoot}/browser-app/src-gen/backend/*.js",
"${workspaceRoot}/coffee-java-extension/lib/**/*.js",
"${workspaceRoot}/coffee-server/lib/**/*.js",
"${workspaceRoot}/coffee-servers/lib/**/*.js",
"${workspaceRoot}/coffee-workflow-analyzer/lib/**/*.js",
"${workspaceRoot}/coffee-workflow-glsp-editor/lib/**/*.js"
"${workspaceRoot}/coffee-workflow-glsp-theia/lib/**/*.js"
],
"smartStep": true,
"internalConsoleOptions": "openOnSessionStart",
Expand All @@ -51,12 +51,8 @@
"request": "launch",
"name": "Launch LSP Extension",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}/coffee-workflow-analyzer-editor"
],
"outFiles": [
"${workspaceRoot}/coffee-workflow-analyzer-editor/out/**/*.js"
],
"args": ["--extensionDevelopmentPath=${workspaceRoot}/coffee-workflow-analyzer-editor"],
"outFiles": ["${workspaceRoot}/coffee-workflow-analyzer-editor/out/**/*.js"],
"sourceMaps": true
}
]
Expand Down
File renamed without changes.
21 changes: 5 additions & 16 deletions web/.vscode/tasks.json → client/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "2.0.0",
"tasks": [
{
"label": "Coffee: Build all packages",
"label": "Coffee: Build all client packages",
"type": "shell",
"group": {
"kind": "build",
Expand All @@ -18,7 +18,7 @@
"problemMatcher": []
},
{
"label": "Coffee: Watch all packages",
"label": "Coffee: Watch all client packages",
"type": "shell",
"group": "build",
"command": "yarn watch",
Expand All @@ -29,7 +29,7 @@
"problemMatcher": []
},
{
"label": "Coffee: Start Browser Backend along with server JARs",
"label": "Coffee: Start Browser Backend (Embeddeded servers)",
"type": "shell",
"command": "yarn start",
"presentation": {
Expand All @@ -39,20 +39,9 @@
"problemMatcher": []
},
{
"label": "Coffee: Start Browser Backend (expecting server products to run)",
"label": "Coffee: Start Browser Backend [DEBUG] (External servers)",
"type": "shell",
"command": "yarn debug",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
},
{
"label": "Coffee: Open in Browser",
"type": "shell",
"group": "test",
"command": "google-chrome 127.0.0.1:3000",
"command": "yarn start:debug",
"presentation": {
"reveal": "always",
"panel": "new"
Expand Down
File renamed without changes.
86 changes: 86 additions & 0 deletions client/browser-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"private": true,
"name": "browser-app",
"license": "(EPL-2.0 OR MIT)",
"version": "0.1.0",
"contributors": [
{
"name": "Eclipse EMF.cloud Project",
"email": "[email protected]",
"url": "https://projects.eclipse.org/projects/ecd.emfcloud"
}
],
"repository": {
"type": "git",
"url": "https://github.com/eclipse-emfcloud/coffee-editor.git"
},
"homepage": "https://www.eclipse.org/emfcloud/",
"bugs": "https://github.com/eclipse-emfcloud/coffee-editor/issues",
"dependencies": {
"@theia/callhierarchy": "1.27.0",
"@theia/console": "1.27.0",
"@theia/core": "1.27.0",
"@theia/debug": "1.27.0",
"@theia/editor": "1.27.0",
"@theia/file-search": "1.27.0",
"@theia/filesystem": "1.27.0",
"@theia/keymaps": "1.27.0",
"@theia/markers": "1.27.0",
"@theia/messages": "1.27.0",
"@theia/mini-browser": "1.27.0",
"@theia/monaco": "1.27.0",
"@theia/navigator": "1.27.0",
"@theia/outline-view": "1.27.0",
"@theia/output": "1.27.0",
"@theia/plugin-dev": "1.27.0",
"@theia/plugin-ext": "1.27.0",
"@theia/plugin-ext-vscode": "1.27.0",
"@theia/plugin-metrics": "1.27.0",
"@theia/preferences": "1.27.0",
"@theia/process": "1.27.0",
"@theia/scm": "1.27.0",
"@theia/scm-extra": "1.27.0",
"@theia/search-in-workspace": "1.27.0",
"@theia/task": "1.27.0",
"@theia/terminal": "1.27.0",
"@theia/typehierarchy": "1.27.0",
"@theia/userstorage": "1.27.0",
"@theia/variable-resolver": "1.27.0",
"@theia/vsx-registry": "1.27.0",
"@theia/workspace": "1.27.0",
"coffee-cpp-extension": "0.1.0",
"coffee-comparison": "0.1.0",
"coffee-editor-extension": "0.1.0",
"coffee-java-extension": "0.1.0",
"coffee-servers": "0.1.0",
"coffee-welcome-page": "0.1.0",
"coffee-workflow-glsp-theia": "0.1.0",
"coffee-workflow-analyzer": "0.1.0"
},
"devDependencies": {
"@theia/cli": "1.27.0"
},
"scripts": {
"prepare": "yarn run download:plugins && theia build --mode development",
"start": "export WF_CONFIG_LSP=localhost:5017 && theia start --WF_GLSP=5008 --hostname=0.0.0.0 --port=3000 --root-dir=../workspace/examples/SuperBrewer3000 --plugins=local-dir:./plugins",
"start:debug": "export WF_CONFIG_LSP=localhost:5017 && theia start --WF_GLSP=5008 --port=3000 --root-dir=../workspace/SuperBrewer3000 --loglevel=debug --plugins=local-dir:./plugins --debug",
"watch": "theia build --watch --mode development",
"download:plugins": "theia download:plugins"
},
"theia": {
"target": "browser"
},
"theiaPluginsDir": "plugins",
"theiaPlugins": {
"java-debug": "https://github.com/microsoft/vscode-java-debug/releases/download/0.43.0/vscjava.vscode-java-debug-0.43.0.vsix",
"java-lsp": "https://download.jboss.org/jbosstools/static/jdt.ls/stable/java-1.1.0-465.vsix",
"vscode-builtin-cpp": "https://open-vsx.org/api/vscode/cpp/1.62.3/file/vscode.cpp-1.62.3.vsix",
"vscode-builtin-java": "https://open-vsx.org/api/vscode/java/1.62.3/file/vscode.java-1.62.3.vsix",
"vscode-builtin-json": "https://open-vsx.org/api/vscode/json/1.62.3/file/vscode.json-1.62.3.vsix",
"vscode-builtin-json-language-features": "https://open-vsx.org/api/vscode/json-language-features/1.62.3/file/vscode.json-language-features-1.62.3.vsix",
"vscode-builtin-xml": "https://open-vsx.org/api/vscode/xml/1.62.3/file/vscode.xml-1.62.3.vsix",
"vscode-clangd": "https://open-vsx.org/api/llvm-vs-code-extensions/vscode-clangd/0.1.15/file/llvm-vs-code-extensions.vscode-clangd-0.1.15.vsix",
"vscode-cmake": "https://open-vsx.org/api/ms-vscode/cmake-tools/1.11.26/file/ms-vscode.cmake-tools-1.11.26.vsix",
"cdt-gdb-vscode": "https://open-vsx.org/api/eclipse-cdt/cdt-gdb-vscode/0.0.91/file/eclipse-cdt.cdt-gdb-vscode-0.0.91.vsix"
}
}
Loading

0 comments on commit c4d8f2b

Please sign in to comment.