diff --git a/.eslintignore b/.eslintignore index 58cd2c6..5ee373f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,3 @@ -/app/generated.ts +app/generated.ts +build/ tailwind.config.js \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3f41f95..28451fb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,6 +16,6 @@ jobs: - name: Set up flyctl uses: superfly/flyctl-actions/setup-flyctl@master - name: Deploy - run: flyctl deploy --config ./apps/login/fly.toml --app ${{ vars.APP_NAME }} --remote-only --build-secret dotenv="${{ secrets.ENV }}" + run: flyctl deploy --config ./fly.toml --app ${{ vars.APP_NAME }} --remote-only --build-secret dotenv="${{ secrets.ENV }}" --build-arg MAGICSWAPV2_API_URL=${{ vars.MAGICSWAPV2_API_URL }} env: FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/Dockerfile b/Dockerfile index 45157e4..cbe4e1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,10 @@ ENV NODE_ENV="production" # Throw-away build stage to reduce size of final image FROM base as build +# Set environment variables +ARG MAGICSWAPV2_API_URL +ENV MAGICSWAPV2_API_URL=$MAGICSWAPV2_API_URL + # Install packages needed to build node modules RUN apt-get update -qq && \ apt-get install -y build-essential pkg-config python-is-python3 @@ -38,9 +42,6 @@ RUN --mount=type=secret,id=dotenv,dst=env \ tr ' ' '\n' < env > .env && \ npm run build -# Remove development dependencies -RUN npm prune --omit=dev - # Final stage for app image FROM base diff --git a/app/entry.server.tsx b/app/entry.server.tsx index 3ca288c..b9a16ec 100644 --- a/app/entry.server.tsx +++ b/app/entry.server.tsx @@ -6,7 +6,7 @@ import type { AppLoadContext, EntryContext } from "@remix-run/node"; import { createReadableStreamFromReadable } from "@remix-run/node"; import { RemixServer } from "@remix-run/react"; -import isbot from "isbot"; +import {isbot} from "isbot"; import { PassThrough } from "node:stream"; import { renderToPipeableStream } from "react-dom/server"; diff --git a/app/routes/healthcheck.tsx b/app/routes/healthcheck.tsx index a1d5100..289e27f 100644 --- a/app/routes/healthcheck.tsx +++ b/app/routes/healthcheck.tsx @@ -1,18 +1 @@ -// https://fly.io/docs/reference/configuration/#services-http_checks -import type { LoaderFunctionArgs } from "@remix-run/node"; - -export const loader = async ({ request }: LoaderFunctionArgs) => { - const host = - request.headers.get("X-Forwarded-Host") ?? request.headers.get("host"); - - try { - const url = new URL("/", `http://${host}`); - await fetch(url.toString(), { method: "HEAD" }).then((r) => { - if (!r.ok) return Promise.reject(r); - }); - return new Response("OK"); - } catch (error: unknown) { - console.log("healthcheck ❌", { error }); - return new Response("ERROR", { status: 500 }); - } -}; +export const loader = () => new Response("OK"); diff --git a/package-lock.json b/package-lock.json index efe43a2..24f0b26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "@tanstack/react-query": "^5.28.6", "@treasure-project/branding": "^1.2.0", "buffer-polyfill": "npm:buffer@^6.0.3", - "cachified": "^4.0.0", + "cachified": "^3.4.1", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "connectkit": "^1.7.2", @@ -13672,10 +13672,9 @@ } }, "node_modules/cachified": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cachified/-/cachified-4.0.0.tgz", - "integrity": "sha512-gTi8sr7Ka/VuI8qEXEbUGG10N8UCcLCEtErj0hL780Og1P8hioWKNfdBGG3Q7jSH76CAfoPsxV2UwbVGyLXogA==", - "deprecated": "cachified has been moved to @epic-web/cachified with no breaking changes. You can continue to use v3 or uninstall cachified and install @epic-web/cachified instead then update all your imports. Learn more at: https://github.com/epicweb-dev/cachified/issues/74" + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/cachified/-/cachified-3.5.4.tgz", + "integrity": "sha512-RO7jQl7vL1qulRvr+o++iVVduFlKb2pJUYxY48LULusyqmGUFaRESERu1Z7UI895JNtTB4yvfErNv64OsayK8g==" }, "node_modules/call-bind": { "version": "1.0.7", @@ -17680,9 +17679,9 @@ } }, "node_modules/framer-motion": { - "version": "11.2.6", - "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.2.6.tgz", - "integrity": "sha512-XUrjjBt57e5YoHQtjwc3eNchFBuHvIgN/cS8SC4oIaAn2J/0+bLanUxXizidJKZVeHJam/JrmMnPRjYMglVn5g==", + "version": "11.2.8", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.2.8.tgz", + "integrity": "sha512-wcxOdC9QjSCC9GY6Bk4NFlyk3+cBpasrCuFPurm00cKwyxO24Q8KEawRz1pxWfmue2STIY0lZTiXsS9ILFka5A==", "dependencies": { "tslib": "^2.4.0" }, @@ -19545,9 +19544,9 @@ "dev": true }, "node_modules/isbot": { - "version": "5.1.7", - "resolved": "https://registry.npmjs.org/isbot/-/isbot-5.1.7.tgz", - "integrity": "sha512-/U9wtTOhYcP1cnDUFKNalTSQHVD3y4ginXstBBQDRwDKTZ2liBb0IEnRu8X+RpX9VnNN/I3MNNgJvKnKQ5+CnA==", + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/isbot/-/isbot-5.1.8.tgz", + "integrity": "sha512-Yv2uggFA7//8E9JcNEyjXweu3LD8cLAFEo3XyxAfTXn5TpHCa2XmZpEhfcwD4Bn0Ud9TmMQ9i+blQIy+KWq/iA==", "engines": { "node": ">=18" } diff --git a/package.json b/package.json index a9a2860..62b8de5 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@tanstack/react-query": "^5.28.6", "@treasure-project/branding": "^1.2.0", "buffer-polyfill": "npm:buffer@^6.0.3", - "cachified": "^4.0.0", + "cachified": "^3.4.1", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "connectkit": "^1.7.2",