From a72c0f41c3965288e2fa159d410719d5c83579df Mon Sep 17 00:00:00 2001 From: sam Date: Mon, 24 Feb 2025 18:25:49 +0100 Subject: [PATCH 1/2] add build script --- .gitignore | 3 +++ build.sh | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 build.sh diff --git a/.gitignore b/.gitignore index 9c16977..9037fa0 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ docker/proxy-config.json docker/frontend.env Foxnouns.DataMigrator/apps.json + +out/ +build/ diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..e14eb53 --- /dev/null +++ b/build.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +set -euxo pipefail + +ROOT_DIR=$(pwd) + +echo "Cleaning output directory ($ROOT_DIR/build)" + +[ -d "$ROOT_DIR/build" ] && rm -r "$ROOT_DIR/build" +mkdir "$ROOT_DIR/build" + +echo "Building .NET backend" + +cd "$ROOT_DIR/Foxnouns.Backend" +[ -d "$ROOT_DIR/Foxnouns.Backend/out" ] && rm -r "$ROOT_DIR/Foxnouns.Backend/out" +dotnet publish --artifacts-path "$ROOT_DIR/Foxnouns.Backend/out" +mv "$ROOT_DIR/Foxnouns.Backend/out/publish/Foxnouns.Backend/"* "$ROOT_DIR/build/bin" + +echo "Building Go rate limiter" + +cd "$ROOT_DIR/Foxnouns.RateLimiter" +go build -o rate -v . +mv rate "$ROOT_DIR/build/rate" + +echo "Building Node.js frontend" + +cd "$ROOT_DIR/Foxnouns.Frontend" +[ -d "$ROOT_DIR/Foxnouns.Frontend/build" ] && rm -r "$ROOT_DIR/Foxnouns.Frontend/build" +pnpm install +pnpm build + +mkdir "$ROOT_DIR/build/fe" +cp -r build .env* package.json pnpm-lock.yaml "$ROOT_DIR/build/fe" +cd "$ROOT_DIR/build/fe" +pnpm install -P + +echo "Finished building Foxnouns.NET" From f1f777ff823b9cf2f4a33cb6ec157696f8e62e82 Mon Sep 17 00:00:00 2001 From: sam Date: Mon, 24 Feb 2025 20:37:51 +0100 Subject: [PATCH 2/2] fix(frontend): localize footer --- .../src/lib/components/Footer.svelte | 21 ++++++++++--------- .../src/lib/i18n/locales/en.json | 12 +++++++++++ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Foxnouns.Frontend/src/lib/components/Footer.svelte b/Foxnouns.Frontend/src/lib/components/Footer.svelte index 6fd6564..857c07c 100644 --- a/Foxnouns.Frontend/src/lib/components/Footer.svelte +++ b/Foxnouns.Frontend/src/lib/components/Footer.svelte @@ -8,6 +8,7 @@ import Envelope from "svelte-bootstrap-icons/lib/Envelope.svelte"; import CashCoin from "svelte-bootstrap-icons/lib/CashCoin.svelte"; import Logo from "./Logo.svelte"; + import { t } from "$lib/i18n"; type Props = { meta: Meta }; let { meta }: Props = $props(); @@ -18,13 +19,13 @@
    -
  • Version {meta.version}
  • +
  • {$t("footer.version")} {meta.version}
    -
  • {meta.users.total.toLocaleString()} users
  • -
  • {meta.members.toLocaleString()} members
  • +
  • {meta.users.total.toLocaleString()} {$t("footer.users")}
  • +
  • {meta.members.toLocaleString()} {$t("footer.members")}
@@ -36,7 +37,7 @@ >
  • - Source code + {$t("footer.source")}
  • - Status + {$t("footer.status")}
  • - About and contact + {$t("footer.about-contact")}
  • - Terms of service + {$t("footer.terms")}
  • - Privacy policy + {$t("footer.privacy")}
  • - Changelog + {$t("footer.changelog")}
  • - Donate + {$t("footer.donate")}
  • diff --git a/Foxnouns.Frontend/src/lib/i18n/locales/en.json b/Foxnouns.Frontend/src/lib/i18n/locales/en.json index 1c15a83..7f2b2ab 100644 --- a/Foxnouns.Frontend/src/lib/i18n/locales/en.json +++ b/Foxnouns.Frontend/src/lib/i18n/locales/en.json @@ -327,5 +327,17 @@ "alert": { "auth-method-remove-success": "Successfully unlinked account!", "auth-required": "You must log in to access this page." + }, + "footer": { + "version": "Version", + "users": "users", + "members": "members", + "source": "Source code", + "status": "Status", + "terms": "Terms of service", + "privacy": "Privacy policy", + "changelog": "Changelog", + "donate": "Donate", + "about-contact": "About and contact" } }