From 8e77e76069bf18ebe925d142d818ae75dc09b8d5 Mon Sep 17 00:00:00 2001 From: ethanf Date: Thu, 3 Oct 2024 04:13:52 -0500 Subject: [PATCH] start new project --- deno.json | 6 ++++++ deno.lock | 1 + src/App.tsx | 6 +++--- src/main.tsx | 3 ++- src/pages/Dinosaur.tsx | 4 ++-- src/pages/index.tsx | 4 ++-- tsconfig.app.json | 27 --------------------------- tsconfig.json | 11 ----------- tsconfig.node.json | 13 ------------- 9 files changed, 16 insertions(+), 59 deletions(-) delete mode 100644 tsconfig.app.json delete mode 100644 tsconfig.json delete mode 100644 tsconfig.node.json diff --git a/deno.json b/deno.json index abd096d..6285863 100644 --- a/deno.json +++ b/deno.json @@ -3,5 +3,11 @@ "@oak/oak": "jsr:@oak/oak@^17.0.0", "@tajpouria/cors": "jsr:@tajpouria/cors@^1.2.1", "react-router-dom": "npm:react-router-dom@^6.26.2" + }, + "compilerOptions": { + "jsx": "react", + "jsxFactory": "React.createElement", + "jsxFragmentFactory": "React.Fragment", + "lib": ["dom", "esnext"] } } diff --git a/deno.lock b/deno.lock index a04226c..bbecb91 100644 --- a/deno.lock +++ b/deno.lock @@ -1539,6 +1539,7 @@ "npm:eslint-plugin-react-refresh@^0.4.7", "npm:eslint@^8.57.0", "npm:react-dom@^18.3.1", + "npm:react-router-dom@^6.26.2", "npm:react@^18.3.1", "npm:typescript@^5.2.2", "npm:vite@^5.3.4" diff --git a/src/App.tsx b/src/App.tsx index 2eb0a0d..edc9f03 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,6 +1,6 @@ -import { BrowserRouter, Route, Routes } from "react-router-dom"; -import Index from "./pages/index"; -import Dinosaur from "./pages/Dinosaur"; +import React, { BrowserRouter, Route, Routes } from "react-router-dom"; +import Index from "./pages/index.tsx"; +import Dinosaur from "./pages/Dinosaur.tsx"; import "./App.css"; function App() { diff --git a/src/main.tsx b/src/main.tsx index b7a65d6..fd47048 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,5 +1,6 @@ +import React from "react"; import ReactDOM from "react-dom/client"; -import App from "./App"; +import App from "./App.tsx"; import "./index.css"; ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( diff --git a/src/pages/Dinosaur.tsx b/src/pages/Dinosaur.tsx index 6facc93..f440150 100644 --- a/src/pages/Dinosaur.tsx +++ b/src/pages/Dinosaur.tsx @@ -1,6 +1,6 @@ -import { useEffect, useState } from "react"; +import React, { useEffect, useState } from "react"; import { Link, useParams } from "react-router-dom"; -import { Dino } from "../types"; +import { Dino } from "../types.ts"; export default function Dinosaur() { const { selectedDinosaur } = useParams(); diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 93999a7..8ee461b 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from "react"; +import React, { useEffect, useState } from "react"; import { Link } from "react-router-dom"; import { Dino } from "../types.ts"; @@ -15,7 +15,7 @@ export default function Index() { return (
-

Welcome to the Dinosaur app

+

Dinosaur Home

Click on a dinosaur below to learn more.

{dinosaurs.map((dinosaur: Dino) => { return ( diff --git a/tsconfig.app.json b/tsconfig.app.json deleted file mode 100644 index 1dba2ea..0000000 --- a/tsconfig.app.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", - "target": "ES2020", - "useDefineForClassFields": true, - "lib": ["ES2020", "DOM", "DOM.Iterable"], - "module": "ESNext", - "skipLibCheck": true, - - /* Bundler mode */ - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "resolveJsonModule": true, - "isolatedModules": true, - "moduleDetection": "force", - "noEmit": true, - "jsx": "react-jsx", - - /* Linting */ - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true - }, - "include": ["src", "tsconfig.json"] -} diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index ea9d0cd..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "files": [], - "references": [ - { - "path": "./tsconfig.app.json" - }, - { - "path": "./tsconfig.node.json" - } - ] -} diff --git a/tsconfig.node.json b/tsconfig.node.json deleted file mode 100644 index 3afdd6e..0000000 --- a/tsconfig.node.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", - "skipLibCheck": true, - "module": "ESNext", - "moduleResolution": "bundler", - "allowSyntheticDefaultImports": true, - "strict": true, - "noEmit": true - }, - "include": ["vite.config.ts"] -}