Skip to content

Commit 3f3a3be

Browse files
coverted to typescript
1 parent cf58827 commit 3f3a3be

9 files changed

Lines changed: 150 additions & 45 deletions

File tree

client/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
</head>
1212
<body>
1313
<div id="root"></div>
14-
<script type="module" src="/src/main.jsx"></script>
14+
<script type="module" src="/src/main.tsx"></script>
1515
</body>
1616
</html>

client/package-lock.json

Lines changed: 110 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
},
1616
"dependencies": {
1717
"axios": "^1.12.2",
18+
"path": "^0.12.7",
1819
"react": "^19.1.1",
1920
"react-dom": "^19.1.1",
2021
"react-modal": "^3.16.3",
@@ -23,13 +24,15 @@
2324
},
2425
"devDependencies": {
2526
"@eslint/js": "^9.33.0",
26-
"@types/react": "^19.1.10",
27-
"@types/react-dom": "^19.1.7",
27+
"@types/node": "^25.6.0",
28+
"@types/react": "^19.2.14",
29+
"@types/react-dom": "^19.2.3",
2830
"@vitejs/plugin-react": "^5.0.0",
2931
"eslint": "^9.33.0",
3032
"eslint-plugin-react-hooks": "^5.2.0",
3133
"eslint-plugin-react-refresh": "^0.4.20",
3234
"globals": "^16.3.0",
35+
"typescript": "^6.0.2",
3336
"vite": "^7.1.2"
3437
}
3538
}
File renamed without changes.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { StrictMode } from 'react'
2-
import { createRoot } from 'react-dom/client'
2+
import ReactDOM from 'react-dom/client'
33
import './index.css'
4-
import App from './App.jsx'
4+
import App from './App.js'
55
import { AuthProvider } from './context/auth.js'
66
import { ModalProvider } from './context/modal.js'
77
import { RecipesProvider } from './context/recipes.js'
88

9-
createRoot(document.getElementById('root')).render(
9+
ReactDOM.createRoot(document.getElementById('root')!).render(
1010
<StrictMode>
1111
<AuthProvider>
1212
<ModalProvider>

client/tsconfig.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"compilerOptions": {
3+
"typeRoots": ["./src/types", "./node_modules/@types"],
4+
"allowImportingTsExtensions": true,
5+
"strict": true,
6+
"noEmit": true,
7+
"jsx": "react-jsx",
8+
"types": ["node"],
9+
"module": "es2015",
10+
"moduleResolution": "bundler",
11+
"forceConsistentCasingInFileNames": true,
12+
"paths": {
13+
"@/*": ["./src/*"]
14+
}
15+
},
16+
"include": [
17+
"src",
18+
"src/types"
19+
],
20+
"exclude": [
21+
"node_modules",
22+
"dist"
23+
]
24+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { defineConfig } from 'vite'
22
import react from '@vitejs/plugin-react'
3+
import path from 'path'
34

4-
// https://vite.dev/config/
55
export default defineConfig({
6-
base: '/',
76
server: {
87
port: 3000,
98
proxy: {
@@ -15,4 +14,9 @@ export default defineConfig({
1514
},
1615
},
1716
plugins: [react()],
18-
})
17+
resolve: {
18+
alias: {
19+
"@": path.resolve(__dirname, "./src"),
20+
},
21+
},
22+
})

0 commit comments

Comments
 (0)