diff --git a/client/src/App.tsx b/client/src/App.tsx index acb9859..b960d34 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react' +import React, { useState } from 'react' import reactLogo from './assets/react.svg'; import './App.css' @@ -18,7 +18,7 @@ function App() {

Vite + React

-

diff --git a/client/src/main.tsx b/client/src/main.tsx index 484b5c2..f85f0dd 100644 --- a/client/src/main.tsx +++ b/client/src/main.tsx @@ -1,6 +1,6 @@ import React from "react"; import { createRoot } from "react-dom/client"; -import App from './App' +import App from './App.tsx' import './index.css' const container = document.getElementById("root")!; diff --git a/deno.json b/deno.json index ff52534..724e341 100644 --- a/deno.json +++ b/deno.json @@ -9,7 +9,16 @@ "vite:build": "deno run -A --node-modules-dir npm:vite build" }, "imports": { - "react": "npm:react", - "react-dom": "npm:react-dom" + "vite": "npm:vite@^5.2.11", + "vitejs/plugin-react": "npm:@vitejs/plugin-react@^4.3.0", + "react": "npm:react@^18.3.1", + "react-dom": "npm:react-dom@^18.3.1", + "@types/react": "npm:@types/react@^18.3.3" + }, + "compilerOptions": { + "types": ["react", "react-dom", "@types/react", "vite/client"], + "lib": ["dom", "dom.iterable", "esnext", "deno.ns"], + "jsx": "react-jsx", + "jsxImportSource": "react" } } diff --git a/deno.lock b/deno.lock index b859dd3..4d9b93a 100644 --- a/deno.lock +++ b/deno.lock @@ -27,6 +27,9 @@ "jsr:@std/media-types@0.223": "jsr:@std/media-types@0.223.0", "jsr:@std/path@0.223": "jsr:@std/path@0.223.0", "npm:@types/node": "npm:@types/node@18.16.19", + "npm:@types/react@18.3.3": "npm:@types/react@18.3.3", + "npm:@types/react@^18.0.0": "npm:@types/react@18.3.3", + "npm:@types/react@^18.3.3": "npm:@types/react@18.3.3", "npm:@vitejs/plugin-react@^4.2.1": "npm:@vitejs/plugin-react@4.3.0_vite@5.2.11_@babel+core@7.24.6", "npm:@vitejs/plugin-react@^4.3.0": "npm:@vitejs/plugin-react@4.3.0_vite@5.2.11_@babel+core@7.24.6", "npm:path-to-regexp@6.2.1": "npm:path-to-regexp@6.2.1", @@ -35,6 +38,7 @@ "npm:react-dom@^18.2.0": "npm:react-dom@18.3.1_react@18.3.1", "npm:react-dom@^18.3.1": "npm:react-dom@18.3.1_react@18.3.1", "npm:react@^18.2.0": "npm:react@18.3.1", + "npm:react@^18.3": "npm:react@18.3.1", "npm:react@^18.3.1": "npm:react@18.3.1", "npm:vite": "npm:vite@5.2.11", "npm:vite@^5.2.10": "npm:vite@5.2.11", @@ -560,6 +564,17 @@ "integrity": "sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==", "dependencies": {} }, + "@types/prop-types@15.7.12": { + "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==", + "dependencies": {} + }, + "@types/react@18.3.3": { + "integrity": "sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==", + "dependencies": { + "@types/prop-types": "@types/prop-types@15.7.12", + "csstype": "csstype@3.1.3" + } + }, "@vitejs/plugin-react@4.3.0_vite@5.2.11_@babel+core@7.24.6": { "integrity": "sha512-KcEbMsn4Dpk+LIbHMj7gDPRKaTMStxxWRkRmxsg/jVdFdJCZWt1SchZcf0M4t8lIKdwwMsEyzhrcOXRrDPtOBw==", "dependencies": { @@ -612,6 +627,10 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dependencies": {} }, + "csstype@3.1.3": { + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "dependencies": {} + }, "debug@4.3.4": { "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dependencies": { @@ -817,8 +836,11 @@ "remote": {}, "workspace": { "dependencies": [ - "npm:react", - "npm:react-dom" + "npm:@types/react@^18.3.3", + "npm:@vitejs/plugin-react@^4.3.0", + "npm:react-dom@^18.3.1", + "npm:react@^18.3.1", + "npm:vite@^5.2.11" ] } } diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 49b6e4f..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "target": "ESNext", - "useDefineForClassFields": true, - "lib": [ - "DOM", - "DOM.Iterable", - "ESNext" - ], - "allowJs": true, - "skipLibCheck": false, - "esModuleInterop": false, - "allowSyntheticDefaultImports": true, - "module": "ESNext", - "moduleResolution": "Node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx" - }, - "include": [ - "./server", - "./client", - ] - } \ No newline at end of file diff --git a/vite.config.mjs b/vite.config.mjs index 9b6ed43..eab1620 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -1,8 +1,6 @@ -import { defineConfig } from 'npm:vite@^5.2.11' -import react from 'npm:@vitejs/plugin-react@^4.3.0' - -import 'npm:react@^18.3.1' -import 'npm:react-dom@^18.3.1' +import { defineConfig } from "vite" +import react from "vitejs/plugin-react" +import "react" // https://vitejs.dev/config/ export default defineConfig({