From c24f693e512d6425141124073f909573cff5bdf0 Mon Sep 17 00:00:00 2001 From: Kolea PLESCO Date: Mon, 28 Aug 2023 19:36:34 +0300 Subject: [PATCH] WIP --- .github/workflows/unit-tests.yml | 12 +++++----- Makefile | 2 +- infra/frontend/docker-compose.yml | 2 +- mapping_workbench/frontend/.babelrc | 29 ++++++++++++++++++------- mapping_workbench/frontend/package.json | 13 ++++++----- tox.ini | 8 +++---- 6 files changed, 41 insertions(+), 25 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 24788d1f4..2f633fe44 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -20,7 +20,7 @@ jobs: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: - python-version: 3.10 + python-version: '3.10' - name: Install dependencies run: | python -m pip install --upgrade setuptools pip wheel @@ -33,11 +33,11 @@ jobs: envkey_VAULT_ADDR: ${{ secrets.VAULT_ADDR }} - name: Run unit tests run: make test - - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} +# - name: SonarCloud Scan +# uses: SonarSource/sonarcloud-github-action@master +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any +# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # - name: Upload coverage to Codecov # uses: codecov/codecov-action@v1 diff --git a/Makefile b/Makefile index b5b45f085..ecb1c26ae 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ PM2_SCRIPT := ${PROJECT_PATH}/${FRONTEND_HOME}/node_modules/pm2/bin/pm2 install: install-backend install-frontend -install-dev: install-dev-backend install-dev-frontend +install-dev: install-dev-backend install-frontend-dev install-backend: @ echo "Installing BACKEND requirements" diff --git a/infra/frontend/docker-compose.yml b/infra/frontend/docker-compose.yml index 869c83372..568312c57 100644 --- a/infra/frontend/docker-compose.yml +++ b/infra/frontend/docker-compose.yml @@ -7,7 +7,7 @@ services: env_file: - ../../.env build: - context: ./../../mapping_workbench/ui + context: ./../../mapping_workbench/frontend dockerfile: ./../../infra/frontend/Dockerfile args: - ENV_FILE=.env diff --git a/mapping_workbench/frontend/.babelrc b/mapping_workbench/frontend/.babelrc index b15786486..d710f5338 100644 --- a/mapping_workbench/frontend/.babelrc +++ b/mapping_workbench/frontend/.babelrc @@ -1,10 +1,23 @@ { - "plugins": [ - ["prismjs", { - "languages": ["javascript", "css", "markup"], - "plugins": ["line-numbers"], - "theme": "okaidia", - "css": true - }] + "presets": [ + "@babel/preset-env", + ["@babel/preset-react", {"runtime": "automatic"}] + ], + "plugins": [ + [ + "prismjs", + { + "languages": [ + "javascript", + "css", + "markup" + ], + "plugins": [ + "line-numbers" + ], + "theme": "okaidia", + "css": true + } ] - } \ No newline at end of file + ] +} \ No newline at end of file diff --git a/mapping_workbench/frontend/package.json b/mapping_workbench/frontend/package.json index 4b18e83b0..1f4a17fbb 100644 --- a/mapping_workbench/frontend/package.json +++ b/mapping_workbench/frontend/package.json @@ -1,8 +1,7 @@ { - "name": "@devias-kit-pro/next-pages", - "version": "6.4.0", - "author": "Devias", - "homepage": "https://devias.io", + "name": "@meaningfy/mapping-workebench-frontend", + "version": "0.0.1", + "author": "Meaningfy", "private": true, "scripts": { "dev": "next dev", @@ -14,6 +13,9 @@ "lint-fix": "next lint --fix", "test": "" }, + "engines": { + "node": ">=12.x" + }, "dependencies": { "@auth0/auth0-spa-js": "2.0.4", "@aws-amplify/auth": "5.3.6", @@ -51,7 +53,7 @@ "mapbox-gl": "2.14.1", "moment": "^2.29.4", "mui-one-time-password-input": "1.1.0", - "next": "13.4.2", + "next": "13.4.19", "nprogress": "0.2.0", "numeral": "2.0.6", "prismjs": "^1.29.0", @@ -95,6 +97,7 @@ "@types/react-redux": "7.1.25", "@types/react-slick": "0.23.10", "@types/react-syntax-highlighter": "15.5.6", + "babel-plugin-prismjs": "^2.1.0", "eslint": "8.40.0", "eslint-config-next": "13.4.2", "sass": "^1.65.1", diff --git a/tox.ini b/tox.ini index 6435a1c6e..2c1317797 100644 --- a/tox.ini +++ b/tox.ini @@ -51,10 +51,10 @@ log_cli_date_format = %Y-%m-%d %H:%M:%S addopts = -; --cov=mapping_workbench -; --cov-report=html -; --cov-report=term -; --cov-report=xml + --cov=mapping_workbench + --cov-report=html + --cov-report=term + --cov-report=xml --junitxml=junit_report.xml -r a -q