Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/composite editor #1

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
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: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# We use the Node-16 on Debian Bullseye.
ARG VARIANT="16-bullseye"
FROM mcr.microsoft.com/devcontainers/typescript-node:0-${VARIANT}
ARG VARIANT="20-bookworm"
FROM mcr.microsoft.com/devcontainers/typescript-node:${VARIANT}

# Install OS packages needed for building Theia.
RUN apt-get update \
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"DISPLAY": ":0",
"WAYLAND_DISPLAY": "wayland-0",
"XDG_RUNTIME_DIR": "/mnt/wslg/runtime-dir",
"PULSE_SERVER": "/mnt/wslg/PulseServer"
"PULSE_SERVER": "/mnt/wslg/PulseServer",
"NODE_OPTIONS": "--max-old-space-size=8192"
}
}
18 changes: 9 additions & 9 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ on:
workflow_call:

env:
NODE_VERSION: 16.20.0
NODE_VERSION: 20.x
PYTHON_VERSION: 3.11.4

defaults:
Expand All @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-2019, ubuntu-latest, macos-11]
os: [windows-2019, ubuntu-latest, macos-12]

runs-on: ${{ matrix.os }}
timeout-minutes: 60
Expand All @@ -30,13 +30,13 @@ jobs:

# Setup Node
- name: Setup Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

# Setup Python
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

Expand All @@ -57,7 +57,7 @@ jobs:
# Upload Unit Test Results (The different files for the OSes will end up in the same artifact).
- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: unit-test-results
# Include the unit-test-results folders (which is in the root of the workspace).
Expand All @@ -70,12 +70,12 @@ jobs:
run: yarn --cwd ./e2e-tests/ playwright:install
- name: Run Playwright tests
if: runner.os == 'Linux'
uses: coactions/setup-xvfb@v1
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1.0.1
with:
run: yarn ui-test
- name: Upload PlayWrite test report
if: always() && runner.os == 'Linux'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: allure-results
path: e2e-tests/allure-results/
Expand All @@ -95,13 +95,13 @@ jobs:
steps:
# Download the test results artifacts.
- name: Download Unit Test Results
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: unit-test-results
path: unit-test-results
# Publish Test Results
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
uses: EnricoMi/publish-unit-test-result-action@30eadd5010312f995f0d3b3cff7fe2984f69409e # v2.16.1
with:
check_name: Unit Test Results
files: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/cicd-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
steps:
# Setup the GitHub Pages, if it doesn't exist yet.
- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v5
# Download the test results artifacts.
- name: Download Test Results
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: allure-results
path: allure-results
Expand All @@ -40,7 +40,7 @@ jobs:
path: gh-pages
# Generate the Allure Report
- name: Generate Allure Report
uses: simple-elf/allure-report-action@master
uses: simple-elf/allure-report-action@58e6590adf6d8f196a0d771bf8a00e6921086a62 # v.1.9
with:
# Where to find the allure results.
allure_results: allure-results
Expand All @@ -53,10 +53,10 @@ jobs:
gh_pages: gh-pages
# Upload allure-history report to github-pages artifact.
- name: Upload Pages
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: 'allure-history'
# Deploy the github-pages artifact to GitHub pages.
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
8 changes: 1 addition & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
"skipFiles": ["<node_internals>/**"],
"outFiles": [
"${workspaceFolder}/applications/electron-app/lib/**/*.js",
"${workspaceFolder}/applications/electron-app/src-gen/frontend/electron-main.js",
"${workspaceFolder}/applications/electron-app/src-gen/backend/server.js",
"${workspaceFolder}/applications/electron-app/src-gen/backend/main.js",
"${workspaceFolder}/extensions/*/out/**/*.js",
"${workspaceFolder}/extensions/*/out/**/*.cjs",
"${workspaceFolder}/packages/*/lib/**/*.js",
Expand All @@ -54,7 +51,7 @@
"type": "node",
"request": "launch",
"name": "Launch CrossModel Browser Backend",
"program": "${workspaceRoot}/applications/browser-app/src-gen/backend/main.js",
"program": "${workspaceRoot}/applications/browser-app/lib/backend/main.js",
"cwd": "${workspaceFolder}/applications/browser-app",
"protocol": "inspector",
"args": [
Expand All @@ -76,9 +73,6 @@
"skipFiles": ["<node_internals>/**"],
"outFiles": [
"${workspaceFolder}/applications/electron-app/lib/**/*.js",
"${workspaceFolder}/applications/electron-app/src-gen/frontend/electron-main.js",
"${workspaceFolder}/applications/electron-app/src-gen/backend/server.js",
"${workspaceFolder}/applications/electron-app/src-gen/backend/main.js",
"${workspaceFolder}/extensions/*/out/**/*.js",
"${workspaceFolder}/extensions/*/out/**/*.cjs",
"${workspaceFolder}/packages/*/lib/**/*.js",
Expand Down
41 changes: 24 additions & 17 deletions applications/browser-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,38 @@
"email": "[email protected]"
},
"scripts": {
"bundle": "yarn rebuild && theia build --mode development && yarn download:plugins",
"clean": "theia clean && rimraf lib && rimraf src-gen",
"download:plugins": "theia download:plugins",
"prepare": "theia build --mode development && yarn download:plugins",
"rebuild": "theia rebuild:browser --cacheRoot ../..",
"start": "yarn rebuild && theia start --plugins=local-dir:plugins",
"start": "theia start --plugins=local-dir:plugins",
"test": "jest --passWithNoTests",
"watch": "theia build --watch --mode development"
},
"dependencies": {
"@crossbreeze/composite-editor": "0.0.0",
"@crossbreeze/core": "0.0.0",
"@crossbreeze/form-client": "0.0.0",
"@crossbreeze/glsp-client": "0.0.0",
"@crossbreeze/model-service": "^1.0.0",
"@crossbreeze/product": "0.0.0",
"@crossbreeze/property-view": "^1.0.0",
"@theia/core": "1.43.1",
"@theia/editor": "1.43.1",
"@theia/filesystem": "1.43.1",
"@theia/markers": "1.43.1",
"@theia/messages": "1.43.1",
"@theia/monaco": "1.43.1",
"@theia/navigator": "1.43.1",
"@theia/plugin-ext": "1.43.1",
"@theia/plugin-ext-vscode": "1.43.1",
"@theia/preferences": "1.43.1",
"@theia/process": "1.43.1",
"@theia/terminal": "1.43.1",
"@theia/workspace": "1.43.1"
"@theia/core": "1.49.1",
"@theia/editor": "1.49.1",
"@theia/filesystem": "1.49.1",
"@theia/markers": "1.49.1",
"@theia/messages": "1.49.1",
"@theia/monaco": "1.49.1",
"@theia/navigator": "1.49.1",
"@theia/plugin-ext": "1.49.1",
"@theia/plugin-ext-vscode": "1.49.1",
"@theia/preferences": "1.49.1",
"@theia/process": "1.49.1",
"@theia/terminal": "1.49.1",
"@theia/workspace": "1.49.1"
},
"devDependencies": {
"@theia/cli": "1.43.1"
"@theia/cli": "1.49.1"
},
"productName": "CrossModel Community Edition",
"theia": {
Expand All @@ -57,7 +58,13 @@
"files.associations": {
"*.port": "ignore"
}
}
},
"reloadOnReconnect": true
}
},
"backend": {
"config": {
"frontendConnectionTimeout": 86400000
}
},
"generator": {
Expand Down
10 changes: 7 additions & 3 deletions applications/browser-app/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
* To reset delete this file and rerun theia build again.
*/
// @ts-check
const config = require('./gen-webpack.config.js');
const configs = require('./gen-webpack.config.js');
const nodeConfig = require('./gen-webpack.node.config.js');

/**
* Expose bundled modules on window.theia.moduleName namespace, e.g.
* window['theia']['@theia/core/lib/common/uri'].
* Such syntax can be used by external code, for instance, for testing.
config.module.rules.push({
configs[0].module.rules.push({
test: /\.js$/,
loader: require.resolve('@theia/application-manager/lib/expose-loader')
}); */

module.exports = config;
module.exports = [
...configs,
nodeConfig.config
];
41 changes: 23 additions & 18 deletions applications/electron-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
},
"main": "scripts/electron-main.js",
"scripts": {
"build": "yarn bundle",
"bundle": "yarn rebuild && theia build --mode development",
"bundle": "cross-env NODE_OPTIONS=--max-old-space-size=8192 && yarn rebuild && theia build --mode development && yarn download:plugins",
"clean": "theia clean && rimraf lib && rimraf src-gen",
"deploy": "rimraf dist && electron-builder -c.mac.identity=null --publish always",
"download:plugins": "theia download:plugins",
Expand All @@ -25,36 +24,36 @@
"package:post": "rimraf plugins/crossmodel-lang* && yarn --cwd ../../extensions/crossmodel-lang symlink",
"package:pre": "rimraf dist && rimraf plugins/crossmodel-lang && yarn package:extensions",
"package:preview": "yarn package:pre && electron-builder -c.mac.identity=null --dir && yarn package:post",
"prepare": "cross-env NODE_OPTIONS=--max-old-space-size=8192 theia build --mode development && yarn download:plugins",
"rebuild": "theia rebuild:electron --cacheRoot ../..",
"start": "cross-env NODE_ENV=development theia start --plugins=local-dir:plugins",
"test": "jest --passWithNoTests",
"watch": "theia build --watch --mode development"
},
"dependencies": {
"@crossbreeze/composite-editor": "0.0.0",
"@crossbreeze/core": "0.0.0",
"@crossbreeze/form-client": "0.0.0",
"@crossbreeze/glsp-client": "0.0.0",
"@crossbreeze/model-service": "^1.0.0",
"@crossbreeze/product": "0.0.0",
"@crossbreeze/property-view": "^1.0.0",
"@theia/core": "1.43.1",
"@theia/editor": "1.43.1",
"@theia/electron": "1.43.1",
"@theia/filesystem": "1.43.1",
"@theia/markers": "1.43.1",
"@theia/messages": "1.43.1",
"@theia/monaco": "1.43.1",
"@theia/navigator": "1.43.1",
"@theia/plugin-ext": "1.43.1",
"@theia/plugin-ext-vscode": "1.43.1",
"@theia/preferences": "1.43.1",
"@theia/process": "1.43.1",
"@theia/terminal": "1.43.1",
"@theia/workspace": "1.43.1"
"@theia/core": "1.49.1",
"@theia/editor": "1.49.1",
"@theia/electron": "1.49.1",
"@theia/filesystem": "1.49.1",
"@theia/markers": "1.49.1",
"@theia/messages": "1.49.1",
"@theia/monaco": "1.49.1",
"@theia/navigator": "1.49.1",
"@theia/plugin-ext": "1.49.1",
"@theia/plugin-ext-vscode": "1.49.1",
"@theia/preferences": "1.49.1",
"@theia/process": "1.49.1",
"@theia/terminal": "1.49.1",
"@theia/workspace": "1.49.1"
},
"devDependencies": {
"@theia/cli": "1.43.1",
"@theia/cli": "1.49.1",
"electron": "^23.2.4",
"electron-builder": "^23.6.0"
},
Expand All @@ -64,6 +63,7 @@
"frontend": {
"config": {
"applicationName": "CrossModel Community Edition",
"reloadOnReconnect": true,
"preferences": {
"security.workspace.trust.enabled": false,
"files.associations": {
Expand All @@ -72,6 +72,11 @@
}
}
},
"backend": {
"config": {
"frontendConnectionTimeout": -1
}
},
"generator": {
"config": {
"preloadTemplate": "./resources/preload.html"
Expand Down
7 changes: 5 additions & 2 deletions applications/electron-app/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ const nodeConfig = require('./gen-webpack.node.config.js');
* Expose bundled modules on window.theia.moduleName namespace, e.g.
* window['theia']['@theia/core/lib/common/uri'].
* Such syntax can be used by external code, for instance, for testing.
config.module.rules.push({
configs[0].module.rules.push({
test: /\.js$/,
loader: require.resolve('@theia/application-manager/lib/expose-loader')
}); */

module.exports = [...configs, nodeConfig.config];
module.exports = [
...configs,
nodeConfig.config
];
15 changes: 12 additions & 3 deletions docs/PrerequisitesWindows.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,21 @@ Open a new PowerShell window (this is needed after installing scoop) and execute

```powershell
scoop install [email protected]
scoop install [email protected].19
scoop install [email protected].22
scoop install nvm
nvm install 16.20.0
npm config set msvs_version 2022 --global
nvm install 20
nvm use 20
npm config edit
```

In the editor which opens, add a line at the end with the following contents:

```
msvs_version=2022
```

Save the file and close it.

## Troubleshooting

### Node-Gyp issue
Expand Down
11 changes: 5 additions & 6 deletions e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@
"email": "[email protected]"
},
"scripts": {
"build": "tsc -b && npx playwright install chromium",
"clean": "rimraf lib tsconfig.tsbuildinfo",
"build": "yarn && yarn clean && tsc --incremental && yarn lint && yarn playwright:install",
"clean": "rimraf lib *.tsbuildinfo .eslintcache",
"lint": "eslint -c ../.eslintrc.js --ext .ts ./src",
"playwright:install": "yarn playwright install --with-deps",
"prepare": "yarn clean && yarn build && yarn lint",
"playwright:install": "playwright install chromium",
"test": "",
"ui-test": "yarn playwright test"
"ui-test": "yarn build && yarn playwright test"
},
"dependencies": {
"@playwright/test": "^1.37.1",
"@theia/playwright": "1.43.1"
"@theia/playwright": "1.49.1"
},
"devDependencies": {
"allure-playwright": "^2.9.2"
Expand Down
Loading
Loading