diff --git a/apps/frontend/web/app/routes/api.$/route.tsx b/apps/frontend/web/app/routes/api.$/route.tsx deleted file mode 100644 index 0e0ef574d..000000000 --- a/apps/frontend/web/app/routes/api.$/route.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { type LoaderFunctionArgs, json, } from "@remix-run/node"; - -import { SERVER_URL as RAW_SERVER_URL } from '~build/meta'; - - -const SERVER_URL = new URL(RAW_SERVER_URL); - -export async function loader({ - request -}: LoaderFunctionArgs) { - const url = mergeURL(request.url); - - try { - const subRequest = new Request(url, request.clone()); - const response = await fetch(subRequest); - - const body = await response.text(); - const headers = cloneHeaders(response.headers); - - return new Response(body, { headers }); - } catch (error) { - console.error(error); - return json({ status: 500, detail: { message: (error as any)?.message ?? 'unknown' } }, { status: 500 }) - } -} - -function mergeURL(request: string) { - const url = new URL(SERVER_URL.toString()); - const requestURL = new URL(request); - url.pathname += requestURL.pathname.slice('/api/'.length); - return url; -} - -const PassHeaders = new Set([ - 'access-control-allow-headers', - 'access-control-allow-methods', - 'access-control-allow-origin', - 'cache-control', - 'content-type', -]); -function cloneHeaders(headers: Headers) { - return new Headers([...headers.entries()].filter(([key]) => PassHeaders.has(key))) -} \ No newline at end of file diff --git a/apps/frontend/web/package.json b/apps/frontend/web/package.json index 67fd65482..5ce3e64a9 100644 --- a/apps/frontend/web/package.json +++ b/apps/frontend/web/package.json @@ -27,6 +27,7 @@ "tailwindcss": "^3.4.4", "unocss": "^0.61.5", "unocss-preset-animations": "^1.1.0", + "unocss-preset-flowind": "^0.0.2", "unocss-preset-shadcn": "^0.3.1", "vite-tsconfig-paths": "^4.2.1" } diff --git a/apps/frontend/web/uno.config.ts b/apps/frontend/web/uno.config.ts index 78772fb62..bd9c739da 100644 --- a/apps/frontend/web/uno.config.ts +++ b/apps/frontend/web/uno.config.ts @@ -11,6 +11,7 @@ import { import presetAnimations from 'unocss-preset-animations'; import { presetShadcn } from 'unocss-preset-shadcn'; +import { presetFlowind } from 'unocss-preset-flowind'; export default defineConfig({ content: { @@ -55,7 +56,8 @@ export default defineConfig({ }), presetTypography(), presetAnimations(), - presetShadcn() + presetShadcn(), + presetFlowind() ], transformers: [transformerDirectives(), transformerVariantGroup()], shortcuts: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8bdc8df70..ab08fcd51 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -108,6 +108,9 @@ importers: unocss-preset-animations: specifier: ^1.1.0 version: 1.1.0(@unocss/preset-wind@0.62.3)(unocss@0.61.9(postcss@8.4.43)(rollup@4.21.2)(vite@5.4.2(@types/node@20.16.5)(terser@5.31.6))) + unocss-preset-flowind: + specifier: ^0.0.2 + version: 0.0.2(unocss@0.61.9(postcss@8.4.43)(rollup@4.21.2)(vite@5.4.2(@types/node@20.16.5)(terser@5.31.6))) unocss-preset-shadcn: specifier: ^0.3.1 version: 0.3.1(unocss-preset-animations@1.1.0(@unocss/preset-wind@0.62.3)(unocss@0.61.9(postcss@8.4.43)(rollup@4.21.2)(vite@5.4.2(@types/node@20.16.5)(terser@5.31.6))))(unocss@0.61.9(postcss@8.4.43)(rollup@4.21.2)(vite@5.4.2(@types/node@20.16.5)(terser@5.31.6))) @@ -8525,6 +8528,11 @@ packages: '@unocss/preset-wind': '>= 0.56.0 < 1' unocss: '>= 0.56.0 < 1' + unocss-preset-flowind@0.0.2: + resolution: {integrity: sha512-b0UoOxc4rJhLMsvsRQ9ql/6+x8AzgAuKDQ1QbK0d8AXaCJDZn7tlCNpcZ+jGy2eeVdWCilF42Dx7MDvpnp9Q+A==} + peerDependencies: + unocss: ^0.60.2 + unocss-preset-shadcn@0.3.1: resolution: {integrity: sha512-b17P8vUKYuxEYthgCVlrMLvy4FVSWxAwAf6d0kYsWYFymbb8VBacBfXrpu+anLTv7IiIgHgkRVNTnruVKIjC8Q==} peerDependencies: @@ -18662,6 +18670,10 @@ snapshots: '@unocss/preset-wind': 0.62.3 unocss: 0.62.3(postcss@8.4.43)(rollup@2.79.1)(vite@5.4.2(@types/node@20.16.5)(terser@5.31.6)) + unocss-preset-flowind@0.0.2(unocss@0.61.9(postcss@8.4.43)(rollup@4.21.2)(vite@5.4.2(@types/node@20.16.5)(terser@5.31.6))): + dependencies: + unocss: 0.61.9(postcss@8.4.43)(rollup@4.21.2)(vite@5.4.2(@types/node@20.16.5)(terser@5.31.6)) + unocss-preset-shadcn@0.3.1(unocss-preset-animations@1.1.0(@unocss/preset-wind@0.62.3)(unocss@0.61.9(postcss@8.4.43)(rollup@4.21.2)(vite@5.4.2(@types/node@20.16.5)(terser@5.31.6))))(unocss@0.61.9(postcss@8.4.43)(rollup@4.21.2)(vite@5.4.2(@types/node@20.16.5)(terser@5.31.6))): dependencies: unocss: 0.61.9(postcss@8.4.43)(rollup@4.21.2)(vite@5.4.2(@types/node@20.16.5)(terser@5.31.6))