diff --git a/.vscode/settings.json b/.vscode/settings.json index bedf1ce5..3bbde5aa 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -16,5 +16,6 @@ }, "css.customData": [ ".vscode/tailwind.json" - ] + ], + "biome.enabled": false } diff --git a/deno.json b/deno.json index 90c587ab..b9f94995 100644 --- a/deno.json +++ b/deno.json @@ -9,32 +9,20 @@ "preview": "deno run -A main.ts", "update": "deno run -A -r https://fresh.deno.dev/update ." }, - "lint": { - "rules": { - "tags": [ - "fresh", - "recommended" - ] - } - }, - "exclude": [ - "**/_fresh/*" - ], + "lint": { "rules": { "tags": ["fresh", "recommended"] } }, + "exclude": ["**/_fresh/*"], "imports": { - "$fresh/": "https://deno.land/x/fresh@1.6.1/", - "preact": "https://esm.sh/preact@10.19.2", - "preact/": "https://esm.sh/preact@10.19.2/", - "@preact/signals": "https://esm.sh/*@preact/signals@1.2.1", - "@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.5.0", + "$fresh/": "https://deno.land/x/fresh@1.6.8/", + "preact": "https://esm.sh/preact@10.19.6", + "preact/": "https://esm.sh/preact@10.19.6/", + "@preact/signals": "https://esm.sh/*@preact/signals@1.2.2", + "@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.5.1", "tailwindcss": "npm:tailwindcss@3.3.5", "tailwindcss/": "npm:/tailwindcss@3.3.5/", "tailwindcss/plugin": "npm:/tailwindcss@3.3.5/plugin.js", "@tailwindcss/typography": "npm:@tailwindcss/typography@0.5.10", "$std/": "https://deno.land/std@0.208.0/" }, - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "preact" - }, + "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" }, "nodeModulesDir": true } diff --git a/fresh.gen.ts b/fresh.gen.ts index 5941d80f..caa2bada 100644 --- a/fresh.gen.ts +++ b/fresh.gen.ts @@ -6,7 +6,6 @@ import * as $_404 from "./routes/_404.tsx"; import * as $_app from "./routes/_app.tsx"; import * as $_layout from "./routes/_layout.tsx"; import * as $_middleware from "./routes/_middleware.ts"; -import * as $api_joke from "./routes/api/joke.ts"; import * as $index from "./routes/index.tsx"; import * as $notes_slug_ from "./routes/notes/[slug].tsx"; import * as $notes_layout from "./routes/notes/_layout.tsx"; @@ -20,7 +19,6 @@ const manifest = { "./routes/_app.tsx": $_app, "./routes/_layout.tsx": $_layout, "./routes/_middleware.ts": $_middleware, - "./routes/api/joke.ts": $api_joke, "./routes/index.tsx": $index, "./routes/notes/[slug].tsx": $notes_slug_, "./routes/notes/_layout.tsx": $notes_layout, diff --git a/routes/_layout.tsx b/routes/_layout.tsx index ceb611d7..d84159a6 100644 --- a/routes/_layout.tsx +++ b/routes/_layout.tsx @@ -1,5 +1,5 @@ import { PageProps } from "$fresh/server.ts"; -export default function Layout({ Component, state }: PageProps) { +export default function Layout({ Component }: PageProps) { return ; } diff --git a/routes/api/joke.ts b/routes/api/joke.ts deleted file mode 100644 index db17edda..00000000 --- a/routes/api/joke.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { FreshContext } from "$fresh/server.ts"; - -// Jokes courtesy of https://punsandoneliners.com/randomness/programmer-jokes/ -const JOKES = [ - "Why do Java developers often wear glasses? They can't C#.", - "A SQL query walks into a bar, goes up to two tables and says “can I join you?”", - "Wasn't hard to crack Forrest Gump's password. 1forrest1.", - "I love pressing the F5 key. It's refreshing.", - "Called IT support and a chap from Australia came to fix my network connection. I asked “Do you come from a LAN down under?”", - "There are 10 types of people in the world. Those who understand binary and those who don't.", - "Why are assembly programmers often wet? They work below C level.", - "My favourite computer based band is the Black IPs.", - "What programme do you use to predict the music tastes of former US presidential candidates? An Al Gore Rhythm.", - "An SEO expert walked into a bar, pub, inn, tavern, hostelry, public house.", -]; - -export const handler = (_req: Request, _ctx: FreshContext): Response => { - const randomIndex = Math.floor(Math.random() * JOKES.length); - const body = JOKES[randomIndex]; - return new Response(body); -}; diff --git a/routes/index.tsx b/routes/index.tsx index d1bbb920..120bf2bf 100644 --- a/routes/index.tsx +++ b/routes/index.tsx @@ -1,6 +1,3 @@ -import { useSignal } from "@preact/signals"; -import Counter from "../islands/Counter.tsx"; - export default function Home() { return (
diff --git a/routes/notes/[slug].tsx b/routes/notes/[slug].tsx index 82405998..1da40e11 100644 --- a/routes/notes/[slug].tsx +++ b/routes/notes/[slug].tsx @@ -1,11 +1,9 @@ -import { CSS, render } from "https://deno.land/x/gfm@0.2.5/mod.ts"; -import { Head } from "$fresh/runtime.ts"; +import { render } from "https://deno.land/x/gfm@0.2.5/mod.ts"; import { extract } from "https://deno.land/std@0.145.0/encoding/front_matter.ts"; import { join } from "$std/path/mod.ts"; import { Handlers, PageProps } from "$fresh/server.ts"; -import he120 from "https://esm.sh/he@1.2.0"; export interface Note { title: string;