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 vite #375

Merged
merged 31 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0bd5327
Migrate to vite. Update packages (react, react-router-dom, etc.). Rem…
js0mmer Oct 31, 2023
1c5cfbd
Run eslint fix, manually fix remaining eslint errors. Fixes for updat…
js0mmer Nov 1, 2023
e4dc75b
Update build path for site
js0mmer Nov 1, 2023
fabac38
Update readme and add start script
js0mmer Nov 1, 2023
bb158f9
Uninstall unused react-transition-group. Add @nivo/core to package.json
js0mmer Nov 1, 2023
7899c04
Merge branch 'master' into vite
js0mmer Nov 7, 2023
4309753
Fix dnd
js0mmer Nov 7, 2023
ffe94e5
Update packages
js0mmer Nov 7, 2023
baddb27
Fix review form
js0mmer Nov 9, 2023
943e60a
Update package.json. Specify node>=18
js0mmer Nov 11, 2023
a9afc58
Update README node versions
js0mmer Nov 11, 2023
8b78b21
Update react-cookie and react-google-recaptcha
js0mmer Nov 11, 2023
9a94829
Update axios
js0mmer Nov 11, 2023
b008d68
Update package-lock node engine
js0mmer Nov 11, 2023
22baaeb
Rename main back to index. Fix indentation in vite config
js0mmer Dec 8, 2023
69132f3
Fix build script
js0mmer Dec 8, 2023
a95e3a1
Add eslint react plugin
js0mmer Dec 9, 2023
04fee22
Merge branch 'master' into vite
js0mmer Dec 15, 2023
dcd8ee9
Update vite proxy port to 8080
js0mmer Dec 15, 2023
e861a73
Merge branch 'master' into vite
js0mmer Dec 17, 2023
393f2dc
Merge branch 'master' into vite
js0mmer Dec 19, 2023
41f1353
Specify node 18/20. Update readme
js0mmer Dec 19, 2023
d25e289
No console warn rule
js0mmer Dec 21, 2023
2953e5b
Update some packages
js0mmer Dec 21, 2023
b0c36ac
Update nivo and vite 5
js0mmer Dec 21, 2023
4d1c762
Fix package engines
js0mmer Dec 21, 2023
4e822b1
Update react-redux to v9 and rtk to v2
js0mmer Dec 21, 2023
cd28a8a
Clean up index.html. Add semantic ui css as dependency instead of usi…
js0mmer Dec 23, 2023
61ae33b
Merge remote-tracking branch 'origin/master' into vite
js0mmer Jan 21, 2024
257ff74
Fix faulty merging for review form. Fix verified reviews checkbox
js0mmer Jan 21, 2024
75ece58
Remove apollo client
js0mmer Jan 21, 2024
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
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Features include:
* MongoDB
* GraphQL
* TypeScript
* Vite

## First time setup
### Committee Members
Expand All @@ -42,7 +43,7 @@ Features include:
git checkout -b [branch name]
```

3. Check your Node version with `node -v`. Make sure you have version 14 or above (18 recommended).
3. Check your Node version with `node -v`. Make sure you have version 16 or above (18 or 20 LTS recommended).

4. Open a terminal window and `cd` into the directory of your repo.

Expand Down Expand Up @@ -74,7 +75,7 @@ PUBLIC_API_URL=https://api.peterportal.org/rest/v0/
PUBLIC_API_GRAPHQL_URL=https://api.peterportal.org/graphql/
PORT=8080
```
Note: the port should also match the one set up on the frontend's proxy to the backend under `site/src/setupProxy.js` By default this is 8080.
Note: the port should also match the one set up on the frontend's proxy to the backend under `site/vite.config.ts` By default this is 8080.

8. (Optional) Set up your own MongoDB and Google OAuth to be able to test features that require signing in such as leaving reviews or saving roadmaps to your account. Add additional variables/secrets to the .env file from the previous step.
```
Expand All @@ -88,7 +89,7 @@ ADMIN_EMAILS=["<your email>"]
## Running the project locally (after setup)
1. Open two terminal windows and `cd` into the directory of your repo in each of them.

2. In the first terminal window, enter the client directory with `cd site`. Then run the React development server using `npm start`. Ensure the server is running on port 3000 by default.
2. In the first terminal window, enter the client directory with `cd site`. Then run the Vite development server using `npm run dev`. Ensure the server is running on port 3000 by default.

3. In the second terminal window, enter the API directory with `cd api`. Then run the Express development server using `npm run dev`. Ensure the server is running on port 8080 by default.

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
"name": "peterportal-root",
"version": "0.1.0",
"scripts": {
"postinstall": "npm install --prefix api && npm install --prefix site",
"heroku-postbuild": "cd api && npm run build && cd .. && cd site && npm run build && cp -r build ../api/",
"start": "npm start --prefix api"
"postinstall": "npm install --prefix api && npm install --prefix site"
},
"dependencies": {
"dotenv-flow": "^3.2.0",
"sst": "^2.5.8"
},
"engines": {
"node": "18.x.x"
"node": ">=18.x.x"
}
}
21 changes: 21 additions & 0 deletions site/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react', 'react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react/no-unescaped-entities': 'off'
},
}
68 changes: 0 additions & 68 deletions site/README.md

This file was deleted.

36 changes: 36 additions & 0 deletions site/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta version="1.1.2">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">

<link href="https://fonts.googleapis.com/css2?family=Titillium+Web:wght@300;400;600;700&display=swap"
rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.css" />
<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet" />

<meta name="description" content="A web application for course discovery and planning at UCI, featuring an enhanced catalogue and a 4-year planner." />
<title>PeterPortal</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-R44HQTN9E1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());

gtag('config', 'G-R44HQTN9E1');
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
Loading