Skip to content

Commit 41f6c3b

Browse files
authored
CRA to vite migration (#18)
1 parent 1992424 commit 41f6c3b

33 files changed

+1934
-4559
lines changed

.gitignore

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,28 @@ coverage
1414

1515
# Cypress videos from our headless runs should not be pushed to github
1616
cypress/videos
17-
cypress/screenshots
17+
cypress/screenshots
18+
19+
20+
# Logs
21+
logs
22+
*.log
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
pnpm-debug.log*
27+
lerna-debug.log*
28+
29+
dist-ssr
30+
*.local
31+
32+
# Editor directories and files
33+
.vscode/*
34+
!.vscode/extensions.json
35+
.idea
36+
.DS_Store
37+
*.suo
38+
*.ntvs*
39+
*.njsproj
40+
*.sln
41+
*.sw?

.husky/pre-commit

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
# Disabled test for now until we resolve an issue with client tests
5-
# npm test
64
npm run pre-commit

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"editor.formatOnSave": true,
33
"editor.tabSize": 2,
4-
}
4+
"editor.defaultFormatter": "esbenp.prettier-vscode"
5+
}

client/.env.example

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# If you add variables here, then don't forget to also add it to the webpack.config file so it gets loaded
2-
31
# The URL that the frontend will use to connect to the backend
4-
BASE_SERVER_URL=http://localhost:3000
2+
# If you add more env variables to the client, make sure they all start with 'VITE_'
3+
VITE_BACKEND_URL=http://localhost:3000

client/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Have a look at our project repo README or https://eslint.org/ for more information
77
*/
88

9-
module.exports = {
9+
export default {
1010
env: {
1111
node: true,
1212
browser: true,

client/babel.config.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"plugins": [
3+
[
4+
"@babel/plugin-transform-react-jsx",
5+
{
6+
"runtime": "automatic"
7+
}
8+
]
9+
]
10+
}

client/eslint.config.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import react from 'eslint-plugin-react'
4+
import reactHooks from 'eslint-plugin-react-hooks'
5+
import reactRefresh from 'eslint-plugin-react-refresh'
6+
7+
export default [
8+
{ ignores: ['dist', "**/__tests__/"] },
9+
{
10+
files: ['**/*.{js,jsx}'],
11+
languageOptions: {
12+
ecmaVersion: 2020,
13+
globals: globals.browser,
14+
parserOptions: {
15+
ecmaVersion: 'latest',
16+
ecmaFeatures: { jsx: true },
17+
sourceType: 'module',
18+
},
19+
},
20+
settings: { react: { version: '18.3' } },
21+
plugins: {
22+
react,
23+
'react-hooks': reactHooks,
24+
'react-refresh': reactRefresh,
25+
},
26+
rules: {
27+
...js.configs.recommended.rules,
28+
...react.configs.recommended.rules,
29+
...react.configs['jsx-runtime'].rules,
30+
...reactHooks.configs.recommended.rules,
31+
'react/jsx-no-target-blank': 'off',
32+
"react-hooks/exhaustive-deps": 'off',
33+
'react-refresh/only-export-components': [
34+
'warn',
35+
{ allowConstantExport: true },
36+
],
37+
},
38+
},
39+
]

client/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/favicon.png" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>🚧 HYF Final project 🚧</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.jsx"></script>
12+
</body>
13+
</html>

client/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
testEnvironment: "jsdom",
33
setupFilesAfterEnv: ["./setupTests.js"],
44
moduleNameMapper: {

0 commit comments

Comments
 (0)