diff --git a/package.json b/package.json index 64a47c7..072e40c 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "dependencies": { "@mikuroxina/mini-fn": "^6.0.0", "@tsndr/cloudflare-worker-jwt": "^2.3.2", - "hono": "^3.11.7", + "hono": "^4.0.0", "zod": "^3.22.4" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3c9e8bc..53c2e4a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^2.3.2 version: 2.5.4 hono: - specifier: ^3.11.7 - version: 3.12.12 + specifier: ^4.0.0 + version: 4.6.3 zod: specifier: ^3.22.4 version: 3.23.8 @@ -778,9 +778,9 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} - hono@3.12.12: - resolution: {integrity: sha512-5IAMJOXfpA5nT+K0MNjClchzz0IhBHs2Szl7WFAhrFOsbtQsYmNynFyJRg/a3IPsmCfxcrf8txUGiNShXpK5Rg==} - engines: {node: '>=16.0.0'} + hono@4.6.3: + resolution: {integrity: sha512-0LeEuBNFeSHGqZ9sNVVgZjB1V5fmhkBSB0hZrpqStSMLOWgfLy0dHOvrjbJh0H2khsjet6rbHfWTHY0kpYThKQ==} + engines: {node: '>=16.9.0'} ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} @@ -2186,7 +2186,7 @@ snapshots: dependencies: function-bind: 1.1.2 - hono@3.12.12: {} + hono@4.6.3: {} ignore@5.3.2: {} diff --git a/src/@types/cloudflare.d.ts b/src/@types/cloudflare.d.ts new file mode 100644 index 0000000..8e82f6a --- /dev/null +++ b/src/@types/cloudflare.d.ts @@ -0,0 +1,4 @@ +declare module "__STATIC_CONTENT_MANIFEST" { + const manifest: object; + export = manifest; +} diff --git a/src/components/layout.tsx b/src/components/layout.tsx index 940fa9c..1884878 100644 --- a/src/components/layout.tsx +++ b/src/components/layout.tsx @@ -1,4 +1,5 @@ import { html } from "hono/html"; +import type { JSX } from "hono/jsx/jsx-runtime"; export type LayoutProps = { title: string; diff --git a/src/index.tsx b/src/index.tsx index 31535af..8edc6d8 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,3 +1,4 @@ +import manifest from "__STATIC_CONTENT_MANIFEST"; import { Result } from "@mikuroxina/mini-fn"; import { Hono } from "hono"; import { serveStatic } from "hono/cloudflare-workers"; @@ -25,8 +26,8 @@ type Variables = { const app = new Hono<{ Bindings: Bindings; Variables: Variables }>(); -app.get("/favicon.ico", serveStatic({ path: "./favicon.ico" })); -app.use("/static/*", serveStatic({ root: "./" })); +app.get("/favicon.ico", serveStatic({ path: "./favicon.ico", manifest })); +app.use("/static/*", serveStatic({ root: "./", manifest })); app.get("/", (c) => c.html()); app.get("/done", (c) => c.html()); app.get("/error", (c) => { diff --git a/src/pages/done.tsx b/src/pages/done.tsx index 70b4fc6..a30fa63 100644 --- a/src/pages/done.tsx +++ b/src/pages/done.tsx @@ -1,6 +1,8 @@ +import type { JSX } from "hono/jsx/jsx-runtime"; + import { Layout } from "../components/layout"; -export const Done = () => ( +export const Done = (): JSX.Element => (

登録完了

登録できました. このタブは閉じてもらって構いません.

diff --git a/src/pages/error.tsx b/src/pages/error.tsx index 7630dfb..b749edd 100644 --- a/src/pages/error.tsx +++ b/src/pages/error.tsx @@ -1,3 +1,5 @@ +import type { JSX } from "hono/jsx/jsx-runtime"; + import { Layout } from "../components/layout"; import type { AppError } from "../models"; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 4131add..119bb95 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,3 +1,5 @@ +import type { JSX } from "hono/jsx/jsx-runtime"; + import { Layout } from "../components/layout"; export const Index = ({ requestUrl }: { requestUrl: string }): JSX.Element => {