From b67f7d05428eec5884a8d1c66beadc47649fadd1 Mon Sep 17 00:00:00 2001 From: prishavall <124836866+prishavall@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:08:59 -0500 Subject: [PATCH] Frontend Buildcheck Workflow Revamp (#1099) * frontend workflow check * added new step for installing npm * added working directory line for frontend * added specific prettier dev dependency * prettier dev dependency * removed prettier dependency * remove dtest block * removed test block for now * changed env for build and stage * added git dom * added new test components without sample unit test * made changes on checkout synatx and removed build * :art: Auto-generated directory tree for repository in Architecture.md --------- Co-authored-by: Faris Durrani Co-authored-by: farisdurrani --- .github/workflows/frontend.yml | 47 ++++++++++++++++++++++++++++++++++ frontend/package.json | 2 ++ frontend/pnpm-lock.yaml | 28 +++++++++++++++----- 3 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/frontend.yml diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml new file mode 100644 index 00000000..ba77050f --- /dev/null +++ b/.github/workflows/frontend.yml @@ -0,0 +1,47 @@ +name: Frontend Workflow Check +on: [pull_request, push] + +concurrency: preview-${{ github.ref }} + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install pnpm + run: npm install -g pnpm + working-directory: ./frontend + + - name: Install + run: pnpm install --frozen-lockfile + id: install + working-directory: ./frontend + + + - name: Run ESLint + run: pnpm run lint + working-directory: ./frontend + + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install pnpm + run: npm install -g pnpm + working-directory: ./frontend + + - name: Install + run: pnpm install --frozen-lockfile + working-directory: ./frontend + + - name: Test + run: echo "pnpm run test should be here" + working-directory: ./frontend + + \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index fe3e789e..2bee4225 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -56,11 +56,13 @@ }, "devDependencies": { "@next/eslint-plugin-next": "^14.0.1", + "@types/react-dom": "^18.2.18", "@typescript-eslint/eslint-plugin": "^6.9.0", "@typescript-eslint/parser": "^6.9.0", "depcheck": "^1.4.7", "eslint": "^8.52.0", "eslint-plugin-react": "^7.33.2", + "prettier": "3.2.2", "typescript": "^5.2.2" } } diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 57e3962e..4722fd7e 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -118,7 +118,7 @@ dependencies: version: 2.6.0(plotly.js@2.27.0)(react@18.2.0) react-redux: specifier: ^8.1.3 - version: 8.1.3(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1) + version: 8.1.3(@types/react-dom@18.2.18)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1) react-syntax-highlighter: specifier: ^15.5.0 version: 15.5.0(react@18.2.0) @@ -139,6 +139,9 @@ devDependencies: '@next/eslint-plugin-next': specifier: ^14.0.1 version: 14.0.1 + '@types/react-dom': + specifier: ^18.2.18 + version: 18.2.18 '@typescript-eslint/eslint-plugin': specifier: ^6.9.0 version: 6.9.0(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@5.2.2) @@ -154,6 +157,9 @@ devDependencies: eslint-plugin-react: specifier: ^7.33.2 version: 7.33.2(eslint@8.52.0) + prettier: + specifier: 3.2.2 + version: 3.2.2 typescript: specifier: ^5.2.2 version: 5.2.2 @@ -1649,7 +1655,7 @@ packages: dependencies: immer: 9.0.21 react: 18.2.0 - react-redux: 8.1.3(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1) + react-redux: 8.1.3(@types/react-dom@18.2.18)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1) redux: 4.2.1 redux-thunk: 2.4.2(redux@4.2.1) reselect: 4.1.8 @@ -1958,7 +1964,11 @@ packages: /@types/prop-types@15.7.9: resolution: {integrity: sha512-n1yyPsugYNSmHgxDFjicaI2+gCNjsBck8UX9kuofAKlc0h1bL+20oSF72KeNaW2DUlesbEVCFgyV2dPGTiY42g==} - dev: false + + /@types/react-dom@18.2.18: + resolution: {integrity: sha512-TJxDm6OfAX2KJWJdMEVTwWke5Sc/E/RlnPGvGfS0W7+6ocy2xhDVQVh/KvC2Uf7kACs+gDytdusDSdWfWkaNzw==} + dependencies: + '@types/react': 18.2.33 /@types/react-google-recaptcha@2.1.7: resolution: {integrity: sha512-qAif3VMKgIrT6l3YcCN29F0W0LZR9Q5jxLvH2MANgc2Hm3Pk27goHBwj3Ri4vtFc0jZyFt6npdERdzUtZtJsLQ==} @@ -1991,11 +2001,9 @@ packages: '@types/prop-types': 15.7.9 '@types/scheduler': 0.16.5 csstype: 3.1.2 - dev: false /@types/scheduler@0.16.5: resolution: {integrity: sha512-s/FPdYRmZR8SjLWGMCuax7r3qCWQw9QKHzXVukAuuIJkXkDRwp+Pu5LMIVFi0Fxbav35WURicYr8u1QsoybnQw==} - dev: false /@types/semver@7.5.4: resolution: {integrity: sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==} @@ -2807,7 +2815,6 @@ packages: /csstype@3.1.2: resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - dev: false /d3-array@1.2.4: resolution: {integrity: sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==} @@ -5144,6 +5151,12 @@ packages: engines: {node: '>= 0.8.0'} dev: true + /prettier@3.2.2: + resolution: {integrity: sha512-HTByuKZzw7utPiDO523Tt2pLtEyK7OibUD9suEJQrPUCYQqrHr74GGX6VidMrovbf/I50mPqr8j/II6oBAuc5A==} + engines: {node: '>=14'} + hasBin: true + dev: true + /pretty-bytes@6.1.1: resolution: {integrity: sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ==} engines: {node: ^14.13.1 || >=16.0.0} @@ -5347,7 +5360,7 @@ packages: react: 18.2.0 dev: false - /react-redux@8.1.3(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1): + /react-redux@8.1.3(@types/react-dom@18.2.18)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1): resolution: {integrity: sha512-n0ZrutD7DaX/j9VscF+uTALI3oUPa/pO4Z3soOBIjuRn/FzVu6aehhysxZCLi6y7duMf52WNZGMl7CtuK5EnRw==} peerDependencies: '@types/react': ^16.8 || ^17.0 || ^18.0 @@ -5371,6 +5384,7 @@ packages: '@babel/runtime': 7.23.2 '@types/hoist-non-react-statics': 3.3.4 '@types/react': 18.2.33 + '@types/react-dom': 18.2.18 '@types/use-sync-external-store': 0.0.3 hoist-non-react-statics: 3.3.2 react: 18.2.0