Skip to content
Snippets Groups Projects
Commit 8a852309 authored by Lansana DIOMANDE's avatar Lansana DIOMANDE
Browse files

refactor: add prettier and git hook on deadlock-theia project

parent a600be32
No related branches found
No related tags found
2 merge requests!16feat: publish extension on marketplace with ci,!15feat(Sprint1): add authentication + directory picking + redirection link
......@@ -8,7 +8,6 @@ before_script:
- apk add curl
- export TAG=${CI_COMMIT_TAG:-latest}
build:
stage: build
services:
......
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged
default
dind
plugins
\ No newline at end of file
[1.4] 24/02/2022
* chore: remove java plugin
* feat: prefix path instead of suffix for hosts
- chore: remove java plugin
- feat: prefix path instead of suffix for hosts
[1.3] 14/02/2022
* upgrade java plugin to 0.21.0
* support of git for student
- upgrade java plugin to 0.21.0
- support of git for student
[1.2] 27/11/2020
* Image supports in briefing
* Set theia-full instead of theia-java (https://git.e-biz.fr/deadlock-public/deadlock-theia/-/issues/2)
- Image supports in briefing
- Set theia-full instead of theia-java (https://git.e-biz.fr/deadlock-public/deadlock-theia/-/issues/2)
[1.1] 27/11/2020
* preStop hook ok
* GitLens integration
* Keep view on memory
- preStop hook ok
- GitLens integration
- Keep view on memory
[1.0] 02/10/2020
* git integration
* recorder-command
* docs/ support
- git integration
- recorder-command
- docs/ support
Deadlock Theia projet basé sur notre propre image de Theia https://git.e-biz.fr/deadlock-public/theia.
Plusieurs éléments ajoutés à l'image de base :
1. Deadlock plugins (deadlock-plugins/)
2. Outil d'enregistrment, qui permet d'enregistrer le code quand un utilisateur exécute du code (deadlock(plugins/recorder))
3. Gestion du CORS (*.deadlock.io) dans `server.js`
3. Gestion du CORS (\*.deadlock.io) dans `server.js`
Deux images de `deadlock-theia` sont build ici, *code* et *kube*.
Deux images de `deadlock-theia` sont build ici, _code_ et _kube_.
## Construire les plugins :
`./build-plugins.sh`
Tous les plugins qui se trouvent dans `deadlock-public` vont être construit en `.vsix` puis placés
......@@ -16,17 +16,21 @@ dans `plugins/` (ex: deadlock-plugins/deadlock-extension).
Il est aussi possible d'ajouter directement des plugins `.vsix` en ajoutant le fichier dans `plugins/`
## Recorder :
Le recorder permet de sauvegarder régulièrement le code de l'utilisateur.
Pour se faire il écoute les commandes exécutées par l'utilisateur et si une contient `java|npm|yarn`
alors un snapshot du code est réalisé.
### Build
`./build-recorder.sh`
## Construire l'image Deadlock Theia avec le recorder et les plugins
`./build.sh $TAG (code|kube)`
# Requirements:
1. NodeJS > ^14.X
2. Vscode ou Vscodium
3. Docker
......
Contient une liste de dossier des extensions à construire pour ajouter à Theia pendant la phase de build.
Chaque dossier d'extension doit contenir un fichier `install.sh` et `build.sh` qui doivent contenir
respectivement la façon d'installer les dépendances et les executions pour construire le plugin,
......
......@@ -7,7 +7,7 @@ module.exports = {
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
rules: {
semi: [2, 'always'],
quotes: [2, 'single', 'avoid-escape'],
quotes: [2, 'single' | 'backtick', 'avoid-escape'],
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
......
......@@ -37,7 +37,10 @@ export default class GettingStartedView extends WebviewBase {
${this.renderCardHtml(
'Dossier contenant tes exercices',
'Choississez le dossier qui contiendra tous les exercices deadlock que vous lancerez maintenant et plus tard',
{ name: 'Choisi un dossier', onClickFunctionName: 'launchChooseMissionWorkdirAction' },
{
name: 'Choisi un dossier',
onClickFunctionName: 'launchChooseMissionWorkdirAction',
},
hadMissionWorkdir,
)}
</div>
......
This diff is collapsed.
{
"name": "deadlock-theia",
"version": "1.0.0",
"description": "Deadlock Theia projet basé sur notre propre image de Theia https://git.e-biz.fr/deadlock-public/theia.",
"scripts": {
"prepare": "husky install"
},
"repository": {
"type": "git",
"url": "git@git.e-biz.fr:deadlock-public/deadlock-theia.git"
},
"author": "Takima",
"devDependencies": {
"husky": "^7.0.4",
"lint-staged": "^12.3.7",
"prettier": "2.6.2"
},
"lint-staged": {
"*.{ts,md,js,json}": [
"prettier --write --ignore-unknown",
"git add"
]
}
}
......@@ -5,7 +5,6 @@
* then you will find the content within /home/theia/src-gen/backend/server.js in the container
*/
// @ts-check
require('reflect-metadata');
......@@ -38,9 +37,7 @@ const allowCrossDomain = function (req, res, next) {
};
function load(raw) {
return Promise.resolve(raw.default).then(module =>
container.load(module)
)
return Promise.resolve(raw.default).then((module) => container.load(module));
}
function start(port, host, argv) {
......@@ -58,26 +55,66 @@ function start(port, host, argv) {
});
}
module.exports = (port, host, argv) => Promise.resolve()
.then(function () { return Promise.resolve(require('@theia/core/lib/node/i18n/i18n-backend-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/core/lib/node/hosting/backend-hosting-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/filesystem/lib/node/filesystem-backend-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/filesystem/lib/node/download/file-download-backend-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/workspace/lib/node/workspace-backend-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/process/lib/common/process-common-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/process/lib/node/process-backend-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/file-search/lib/node/file-search-backend-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/git/lib/node/git-backend-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/git/lib/node/env/git-env-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/terminal/lib/node/terminal-backend-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/task/lib/node/task-backend-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/debug/lib/node/debug-backend-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/search-in-workspace/lib/node/search-in-workspace-backend-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/plugin-ext/lib/plugin-ext-backend-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/plugin-ext-vscode/lib/node/plugin-vscode-backend-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/mini-browser/lib/node/mini-browser-backend-module')).then(load) })
.then(function () { return Promise.resolve(require('@theia/vsx-registry/lib/node/vsx-registry-backend-module')).then(load) })
.then(() => start(port, host, argv)).catch(reason => {
module.exports = (port, host, argv) =>
Promise.resolve()
.then(function () {
return Promise.resolve(require('@theia/core/lib/node/i18n/i18n-backend-module')).then(load);
})
.then(function () {
return Promise.resolve(require('@theia/core/lib/node/hosting/backend-hosting-module')).then(load);
})
.then(function () {
return Promise.resolve(require('@theia/filesystem/lib/node/filesystem-backend-module')).then(load);
})
.then(function () {
return Promise.resolve(require('@theia/filesystem/lib/node/download/file-download-backend-module')).then(load);
})
.then(function () {
return Promise.resolve(require('@theia/workspace/lib/node/workspace-backend-module')).then(load);
})
.then(function () {
return Promise.resolve(require('@theia/process/lib/common/process-common-module')).then(load);
})
.then(function () {
return Promise.resolve(require('@theia/process/lib/node/process-backend-module')).then(load);
})
.then(function () {
return Promise.resolve(require('@theia/file-search/lib/node/file-search-backend-module')).then(load);
})
.then(function () {
return Promise.resolve(require('@theia/git/lib/node/git-backend-module')).then(load);
})
.then(function () {
return Promise.resolve(require('@theia/git/lib/node/env/git-env-module')).then(load);
})
.then(function () {
return Promise.resolve(require('@theia/terminal/lib/node/terminal-backend-module')).then(load);
})
.then(function () {
return Promise.resolve(require('@theia/task/lib/node/task-backend-module')).then(load);
})
.then(function () {
return Promise.resolve(require('@theia/debug/lib/node/debug-backend-module')).then(load);
})
.then(function () {
return Promise.resolve(require('@theia/search-in-workspace/lib/node/search-in-workspace-backend-module')).then(
load,
);
})
.then(function () {
return Promise.resolve(require('@theia/plugin-ext/lib/plugin-ext-backend-module')).then(load);
})
.then(function () {
return Promise.resolve(require('@theia/plugin-ext-vscode/lib/node/plugin-vscode-backend-module')).then(load);
})
.then(function () {
return Promise.resolve(require('@theia/mini-browser/lib/node/mini-browser-backend-module')).then(load);
})
.then(function () {
return Promise.resolve(require('@theia/vsx-registry/lib/node/vsx-registry-backend-module')).then(load);
})
.then(() => start(port, host, argv))
.catch((reason) => {
console.error('Failed to start the backend application.');
if (reason) {
console.error(reason);
......
npm install
npm install --prefix ./deadlock-plugins/deadlock-extension
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment