diff --git a/.vscode/settings.json b/.vscode/settings.json index 794d579bcf..e83909b2cc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,4 @@ { - "explorer.excludeGitIgnore": true, "search.useParentIgnoreFiles": true, "search.useIgnoreFiles": true, "files.watcherExclude": { diff --git a/apps/web/netlify.toml b/apps/web/netlify.toml index 5570c05619..a3640b1a2f 100644 --- a/apps/web/netlify.toml +++ b/apps/web/netlify.toml @@ -1,6 +1,7 @@ [build] +base = "apps/web" command = "pnpm -F @hypr/web build" -publish = "apps/web/dist/client" +publish = "dist/client" [build.environment] VITE_APP_URL = "https://hyprnote.com" diff --git a/apps/web/netlify/edge-functions/deno.json b/apps/web/netlify/edge-functions/deno.json deleted file mode 100644 index a8e0f0ad09..0000000000 --- a/apps/web/netlify/edge-functions/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "lock": false, - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "https://esm.sh/react@18.2.0" - } -} diff --git a/apps/web/netlify/edge-functions/og.tsx b/apps/web/netlify/edge-functions/og.tsx deleted file mode 100644 index 45b90d0e6f..0000000000 --- a/apps/web/netlify/edge-functions/og.tsx +++ /dev/null @@ -1,108 +0,0 @@ -// deno-lint-ignore no-import-prefix -import { ImageResponse } from "https://deno.land/x/og_edge@0.0.6/mod.ts"; -// deno-lint-ignore no-import-prefix -import { z } from "https://deno.land/x/zod@v3.23.8/mod.ts"; - -const templateSchema = z.object({ - type: z.literal("meeting"), - title: z.string(), - headers: z.array(z.string()), -}); - -const OGSchema = z.discriminatedUnion("type", [templateSchema]); - -function parseSearchParams(url: URL): z.infer | null { - const type = url.searchParams.get("type"); - if (!type) { - return null; - } - - const title = url.searchParams.get("title"); - const headers = url.searchParams.getAll("headers"); - - const result = OGSchema.safeParse({ type, title, headers }); - return result.success ? result.data : null; -} - -function renderTemplate(params: z.infer) { - return ( -
-
-
- {params.title} -
-
- {params.headers.map((header, i) => ( -
-
- {header} -
- ))} -
-
-
- ); -} - -export default function handler(req: Request) { - const url = new URL(req.url); - const params = parseSearchParams(url); - - if (!params) { - return new Response(JSON.stringify({ error: "invalid_parameters" }), { - status: 400, - headers: { "Content-Type": "application/json" }, - }); - } - - // https://unpic.pics/og-edge - return new ImageResponse(renderTemplate(params)); -} - -// https://docs.netlify.com/build/edge-functions/declarations/#declare-edge-functions-inline -export const config = { - path: "/og", - cache: "manual", -}; diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts index fc8b0edb0f..2966f5d8a8 100644 --- a/apps/web/vite.config.ts +++ b/apps/web/vite.config.ts @@ -8,7 +8,6 @@ import viteTsConfigPaths from "vite-tsconfig-paths"; const config = defineConfig(() => ({ plugins: [ - netlify({ dev: { images: { enabled: true } } }), contentCollections(), viteTsConfigPaths({ projects: ["./tsconfig.json"] }), tailwindcss(), @@ -30,6 +29,7 @@ const config = defineConfig(() => ({ }, }), viteReact(), + netlify({ dev: { images: { enabled: true } } }), ], ssr: { noExternal: ["posthog-js", "@posthog/react"],