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

Migrate to use Vite on frontend #51

Merged
merged 5 commits into from
Dec 13, 2022
Merged
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
24 changes: 0 additions & 24 deletions .eslintrc.js

This file was deleted.

7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@

# Database:
/database/** @gchauhan-aot @john-fletcher-aot

# Devops:
Dockerfile @devin-aot @cberg-aot
Dockerfile @devin-aot @cberg-aot
Dockerfile @devin-aot @cberg-aot
docker-compose.yml @devin-aot @cberg-aot
/.github/** @devin-aot @cberg-aot
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
commands: |
npm ci
npm run test
npm run test:cov
dir: ${{ matrix.dir }}
sonar_args: >
-Dsonar.exclusions=**/coverage/**,**/node_modules/**
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ services:
context: ./frontend/
dockerfile: Dockerfile
args:
REACT_APP_DEPLOY_ENVIRONMENT: prod
VITE_DEPLOY_ENVIRONMENT: prod
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 1m30s
Expand Down
4 changes: 4 additions & 0 deletions frontend/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
dist/
.eslintrc.cjs
env.d.ts
31 changes: 31 additions & 0 deletions frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
],
"overrides": [
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": [
"react",
"@typescript-eslint"
],
"rules": {
"react/react-in-jsx-scope": "off" // Starting from the release 17 of React, JSX is automatically transformed without using React.createElement
},
"settings": {
"react": {
"version": "detect"
}
}
}
4 changes: 2 additions & 2 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ WORKDIR /app
#ARG NODE_ENV
#ENV NODE_ENV ${NODE_ENV}

ARG REACT_APP_DEPLOY_ENVIRONMENT
ENV REACT_APP_DEPLOY_ENVIRONMENT ${REACT_APP_DEPLOY_ENVIRONMENT}
ARG VITE_DEPLOY_ENVIRONMENT
ENV VITE_DEPLOY_ENVIRONMENT ${VITE_DEPLOY_ENVIRONMENT}

# Install app dependencies
COPY ./package*.json ./
Expand Down
21 changes: 21 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
content="Permitting and routing for commercial trucking in British Columbia."
/>
<link rel="apple-touch-icon" href="/BCID_V_rgb_pos.png" />
<link rel="manifest" href="/manifest.json" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<title>onRouteBc</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion frontend/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ objects:
env:
- name: BACKEND_URL
value: https://${NAME}-${ZONE}-backend.${DOMAIN}
- name: REACT_APP_DEPLOY_ENVIRONMENT
- name: VITE_DEPLOY_ENVIRONMENT
value: ${ZONE}
ports:
- containerPort: 3000
Expand Down
Loading