Skip to content
Snippets Groups Projects
Commit e3dcd42c authored by michael.minelli's avatar michael.minelli
Browse files

Merge branch 'typescript_eslint' into v3.1.0

parents d69eaffa 4cec1953
No related branches found
No related tags found
No related merge requests found
Pipeline #26967 passed
Showing
with 1078 additions and 31 deletions
dist
node_modules
.gitlab-ci
\ No newline at end of file
{
"root" : true,
"parser" : "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
]
}
\ No newline at end of file
stages: stages:
- code_quality
- test - test
- build - build
- clean - clean
......
code_quality:lint:
stage: code_quality
tags:
- code_quality
image: node:latest
script:
- cd "${PROJECT_FOLDER}"
- npm install
- npm run lint
Subproject commit 4d703a2dd39ec0c2b71bbbbda8900588c4e360bd Subproject commit ffc5d65f9f0f0e825688177425e526131aa84631
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EslintConfiguration">
<option name="fix-on-save" value="true" />
</component>
</project>
\ No newline at end of file
This diff is collapsed.
...@@ -22,9 +22,10 @@ ...@@ -22,9 +22,10 @@
}, },
"scripts" : { "scripts" : {
"dotenv:build": "npx dotenv-vault local build", "dotenv:build": "npx dotenv-vault local build",
"lint" : "npx eslint .",
"genversion" : "npx genversion -s -e src/config/Version.ts", "genversion" : "npx genversion -s -e src/config/Version.ts",
"build" : "npm run genversion; npx tsc", "build" : "npm run genversion; npx tsc",
"start:dev" : "npm run genversion; npx ts-node src/app.ts", "start:dev" : "npm run genversion; npm run lint; npx ts-node src/app.ts",
"test" : "echo \"Error: no test specified\" && exit 1" "test" : "echo \"Error: no test specified\" && exit 1"
}, },
"dependencies" : { "dependencies" : {
...@@ -44,16 +45,18 @@ ...@@ -44,16 +45,18 @@
"yaml" : "^2.3.2" "yaml" : "^2.3.2"
}, },
"devDependencies": { "devDependencies": {
"@types/dockerode" : "^3.3.19", "@types/dockerode" : "^3.3.19",
"@types/fs-extra" : "^11.0.1", "@types/fs-extra" : "^11.0.1",
"@types/js-yaml" : "^4.0.5", "@types/js-yaml" : "^4.0.5",
"@types/node" : "^18.17.1", "@types/node" : "^18.17.1",
"@types/tar-stream" : "^2.2.2", "@types/tar-stream" : "^2.2.2",
"dotenv-vault" : "^1.25.0", "@typescript-eslint/eslint-plugin": "^6.10.0",
"genversion" : "^3.1.1", "@typescript-eslint/parser" : "^6.10.0",
"pkg" : "^5.8.1", "dotenv-vault" : "^1.25.0",
"tiny-typed-emitter": "^2.1.0", "genversion" : "^3.1.1",
"ts-node" : "^10.9.1", "pkg" : "^5.8.1",
"typescript" : "^5.1.6" "tiny-typed-emitter" : "^2.1.0",
"ts-node" : "^10.9.1",
"typescript" : "^5.1.6"
} }
} }
// Read from the .env file // Read from the .env file
// ATTENTION : This lines MUST be the first of this file (except for the path import) // ATTENTION : These lines MUST be the first of this file (except for the path import)
const path = require('node:path'); import path = require('node:path');
const myEnv = require('dotenv').config({ import myEnv = require('dotenv');
path : path.join(__dirname, '../.env'), import dotenvExpand = require('dotenv-expand');
DOTENV_KEY: 'dotenv://:key_f1778b6998874f6fd78c716ccef982c5595fa300f174b129eafc88ba7044d69b@dotenv.local/vault/.env.vault?environment=development'
});
require('dotenv-expand').expand(myEnv); dotenvExpand.expand(myEnv.config({
path : path.join(__dirname, '../.env'),
DOTENV_KEY: 'dotenv://:key_f1778b6998874f6fd78c716ccef982c5595fa300f174b129eafc88ba7044d69b@dotenv.local/vault/.env.vault?environment=development'
}));
require('./shared/helpers/TypeScriptExtensions'); // ATTENTION : This line MUST be the second of this file require('./shared/helpers/TypeScriptExtensions'); // ATTENTION : This line MUST be the second of this file
import ClientsSharedAssignmentHelper from './sharedByClients/helpers/Dojo/ClientsSharedAssignmentHelper'; import ClientsSharedAssignmentHelper from './sharedByClients/helpers/Dojo/ClientsSharedAssignmentHelper';
import AssignmentValidator from './sharedByClients/helpers/Dojo/AssignmentValidator'; import AssignmentValidator from './sharedByClients/helpers/Dojo/AssignmentValidator';
import Styles from './types/Style'; import Styles from './types/Style';
import { exec } from 'child_process';
import util from 'util';
import HttpManager from './managers/HttpManager'; import HttpManager from './managers/HttpManager';
import Config from './config/Config'; import Config from './config/Config';
import Icon from './sharedByClients/types/Icon'; import Icon from './sharedByClients/types/Icon';
(async () => { (async () => {
const execAsync = util.promisify(exec);
HttpManager.registerAxiosInterceptor(); HttpManager.registerAxiosInterceptor();
console.log(Styles.APP_NAME(`${ Config.appName } (version {{VERSION}})`)); console.log(Styles.APP_NAME(`${ Config.appName } (version {{VERSION}})`));
...@@ -43,13 +44,13 @@ import Icon from './sharedByClients/types/Icon'; ...@@ -43,13 +44,13 @@ import Icon from './sharedByClients/types/Icon';
} }
}); });
assignmentValidator.events.on('finished', (success: boolean, exitCode: number) => { assignmentValidator.events.on('finished', (success: boolean) => {
success ? resolve() : reject(); success ? resolve() : reject();
}); });
assignmentValidator.run(); assignmentValidator.run();
}); });
} catch ( error ) { } } catch ( error ) { /* empty */ }
ClientsSharedAssignmentHelper.displayExecutionResults(assignmentValidator, `The assignment is ready to be published.`, Styles); ClientsSharedAssignmentHelper.displayExecutionResults(assignmentValidator, `The assignment is ready to be published.`, Styles);
......
...@@ -57,7 +57,7 @@ class HttpManager { ...@@ -57,7 +57,7 @@ class HttpManager {
}, (error) => { }, (error) => {
if ( error.response ) { if ( error.response ) {
if ( error.response.status === StatusCodes.METHOD_NOT_ALLOWED && error.response.data ) { if ( error.response.status === StatusCodes.METHOD_NOT_ALLOWED && error.response.data ) {
const data: DojoBackendResponse<{}> = error.response.data; const data: DojoBackendResponse<void> = error.response.data;
switch ( data.code ) { switch ( data.code ) {
case DojoStatusCode.CLIENT_NOT_SUPPORTED: case DojoStatusCode.CLIENT_NOT_SUPPORTED:
......
Subproject commit 4a5eb68209ae9204b6d4cc8020bd62cf6a5be989 Subproject commit 101cc26895eb0b5fe97e03bb96039e0cddd94391
Subproject commit dc12d17660bf9e92656c6abcb24ec7ce6ab3d675 Subproject commit 39ababf437cd738b45e07743455be7588640d5c9
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment