Compare commits

...

5 Commits

Author SHA1 Message Date
dependabot[bot]
ebb058755f
Merge dfbf6eb71d9e01dd0ae26f9121f9204390847405 into 2bcda5fd3b341485846a4acc22d73683f0cabd83 2025-01-31 19:47:11 -06:00
dvelo
2bcda5fd3b
feat: migrate accounts 2025-01-29 21:12:42 -06:00
dvelo
21c0f75e4c fix: type issue 2025-01-29 21:10:43 -06:00
dvelo
532ead4bdf feat: migrate accounts from development to production 2025-01-29 21:03:20 -06:00
dependabot[bot]
dfbf6eb71d
build(deps-dev): bump @unocss/preset-uno from 0.61.5 to 65.4.2
Bumps [@unocss/preset-uno](https://github.com/unocss/unocss/tree/HEAD/packages-presets/preset-uno) from 0.61.5 to 65.4.2.
- [Release notes](https://github.com/unocss/unocss/releases)
- [Commits](https://github.com/unocss/unocss/commits/v65.4.2/packages-presets/preset-uno)

---
updated-dependencies:
- dependency-name: "@unocss/preset-uno"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-20 05:55:08 +00:00
10 changed files with 231 additions and 187 deletions

@ -95,7 +95,7 @@
"@types/react-dom": "^18",
"@types/react-twemoji": "^0.4.3",
"@unocss/eslint-config": "^0.61.5",
"@unocss/preset-uno": "^0.61.5",
"@unocss/preset-uno": "^65.4.2",
"@unocss/transformer-compile-class": "^0.61.5",
"@vercel/analytics": "^1.3.1",
"@vercel/speed-insights": "^1.0.12",

@ -47,6 +47,16 @@ export default function Settings() {
setLinked(user?.publicMetadata.player != undefined);
}, [user, isSignedIn]);
const forceUnlink = async () => {
if (!linked) await toast.promise(unlinkMCAccount(), {
success: "Unlinked account!",
loading: "Unlinking...",
error: "Error while unlinking account.",
});
else
await toast.warning("Please use the normal unlink option before using the force unlink one.")
};
return (
<main className="p-4">
<strong className="text-3xl">Linking</strong>
@ -112,7 +122,15 @@ export default function Settings() {
</div>
<small className="mt-0">
All of your customizations stay the same, and can be changed if another
account links your Minecraft account.
account links your Minecraft account.{" "}
<div
className="cursor-pointer text-blue-600"
onClick={forceUnlink}
onKeyDown={forceUnlink}
onKeyUp={forceUnlink}
>
Still linked in-game? Force unlink your account.
</div>
</small>
</main>
);

@ -37,13 +37,13 @@ import { ThemeProvider } from "@/components/ThemeProvider";
import { ClerkThemeProvider } from "@/components/clerk/ClerkThemeProvider";
import NewDomainDialog from "@/components/misc/NewDomainDialog";
import ThemedToaster from "@/components/misc/ThemedToaster";
import UnofficalDialog from "@/components/misc/UnofficalDialog";
import { TooltipProvider } from "@/components/ui/tooltip";
import type { Metadata, Viewport } from "next";
import { Inter as interFont } from "next/font/google";
import LayoutPart from "@/components/feat/LayoutPart";
import AllBanners from "@/components/feat/AllBanners";
import Footer from "@/components/misc/Footer";
import { SwitchEnvPopup } from "@/components/misc/SwitchEnvPopup";
export const extraMetadata = {
twitter: {
@ -84,7 +84,7 @@ export default async function RootLayout({
<SpeedInsights />
<Analytics />
<NewDomainDialog />
<UnofficalDialog />
<SwitchEnvPopup />
<Footer />
</TooltipProvider>
</ThemeProvider>

@ -368,7 +368,7 @@ export default function ServerList() {
"dark:border-gray-50/[.1] dark:bg-gray-50/[.10] dark:hover:bg-gray-50/[.15]"
)}
onClick={() =>
router.push(pageFind(`Server:${server.name}`))
router.push(pageFind(`Server:${server.name}`) as string)
}
>
<div className="items-center gap-2 p-4">

@ -35,8 +35,9 @@ import {
PopoverTrigger,
} from "@/components/ui/popover";
import { Button } from "../ui/button";
import { AtSign, LogIn } from "lucide-react";
import { AtSign, LogIn, Ship } from "lucide-react";
import { useClerk } from "@clerk/nextjs";
import { useRouter } from "@/lib/useRouter";
export default function SignInPopoverButton({
className,
@ -67,11 +68,14 @@ export default function SignInPopoverButton({
export function SignInPopover() {
const clerk = useClerk();
const router = useRouter();
return (
<div className=" grid w-[200px]">
<strong className="text-center">Login</strong>
<small className="text-center pb-6">
Customize your own servers and favorite other servers. Secured by Clerk
<small className="text-center pb-2">
Customize your own servers and favorite other servers. Secured by Clerk
<br className="py-2"/>
If you created your account before Jan. 29, 2025, use the legacy migration button.
</small>
<br />
<Button variant={"ghost"} onClick={() => clerk.openSignIn()}>
@ -82,6 +86,9 @@ export function SignInPopover() {
<AtSign size={18} className="mr-2" />
Sign-up
</Button>
<Button variant="ghost" onClick={() => router.push(process.env.NEXT_PUBLIC_CLERK_SWITCH_DOMAIN as string)}>
<Ship size={18} className="mr-2"/>Legacy Migration
</Button>
</div>
);
}

@ -41,8 +41,8 @@ export default function A({
}) {
return (
<NextLink
href={pageFind(children || "")}
className="no-underline transition duration-300 hover:underline "
href={pageFind(children || "") || "#"}
className="transition duration-300 underline"
title={children}
>
{(children || "").startsWith("Docs:") && (
@ -68,7 +68,7 @@ export function ALegacy({
}) {
return (
<NextLink
href={pageFind(href || "")}
href={pageFind(href || "") || "#"}
className="no-underline transition duration-300 hover:underline "
title={href}
>
@ -95,6 +95,7 @@ export const pageFind = (text: string) => {
if (text === "Special:AccountOptions") return "/account/settings/options";
if (text.startsWith("Server:") && text.endsWith("/Customization"))
return "/server/" + text.substring(7, text.length - 14) + "/customization";
if (text === "Special:ClerkConvertionPage") return process.env.NEXT_PUBLIC_CLERK_SWITCH_DOMAIN;
if (text.startsWith("Server:")) return "/server/" + text.substring(7);
if (text.startsWith("Wiki:"))
return "https://minehut.wiki.gg/wiki/" + text.substring(5);

@ -0,0 +1,58 @@
"use client";
import { useEffect, useState } from "react";
import {
Dialog,
DialogContent,
DialogTitle,
DialogTrigger,
} from "../ui/dialog";
import { OctagonAlert } from "lucide-react";
import A from "./Link";
import { Button } from "../ui/button";
import { useRouter } from "@/lib/useRouter";
export function SwitchEnvPopup() {
const [open, setOpen] = useState(false);
const router = useRouter();
useEffect(() => {
if (localStorage.getItem("mhsf--switch-env-alert") !== "true") {
setOpen(true);
}
}, [])
const setDialogTrigger = (v: boolean) => {
setOpen(v)
if (!v) {
localStorage.setItem("mhsf--switch-env-alert", "true")
}
}
return (
<Dialog open={open} onOpenChange={setDialogTrigger}>
<DialogContent>
<OctagonAlert className="text-orange-300" />
<DialogTitle className="text-3xl">
Wait! Did you have an old account?
</DialogTitle>
<p className="inline">
<strong>If you had an account before Jan. 28th, 2025</strong>, you
have a legacy account that <i>needs to be converted.</i>
</p>
<p className="inline">
Legacy accounts can be converted by going to{" "}
<A alt="this page">Special:ClerkConvertionPage</A> and logging in with
your old account & creating a new account. Your old account settings &
content will automatically be transferred to your new account.{" "}
</p>
<div className="flex items-center">
<Button onClick={() => { router.push(process.env.NEXT_PUBLIC_CLERK_SWITCH_DOMAIN || "#") }}>Convert account</Button>{" "}
<DialogTrigger>
<Button className="ml-2" variant="outline">Close</Button>
</DialogTrigger>
</div>
</DialogContent>
</Dialog>
);
}

@ -1,77 +0,0 @@
/*
* MHSF, Minehut Server List
* All external content is rather licensed under the ECA Agreement
* located here: https://list.mlnehut.com/docs/legal/external-content-agreement
*
* All code under MHSF is licensed under the MIT License
* by open source contributors
*
* Copyright (c) 2024 dvelo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
"use client";
import { useEffect, useState } from "react";
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
} from "../ui/dialog";
export default function UnofficalDialog() {
const [isOpen, setOpen] = useState(false);
useEffect(() => {
const dialog = localStorage.getItem("unoffical-dialog-open");
if (dialog == null) {
setOpen(true);
}
}, []);
const onChangeVal = (state: boolean) => {
if (state == false) {
setOpen(false);
localStorage.setItem("unoffical-dialog-open", "true");
} else setOpen(state);
};
return (
<Dialog open={isOpen} onOpenChange={onChangeVal}>
<DialogContent>
<DialogHeader>
<DialogTitle>Welcome to the Minehut Server List (MHSF)</DialogTitle>
</DialogHeader>
<DialogDescription>
MHSF is a Minehut server-list using the Minehut API to serve you
servers with filters, sorts and other helpful information when picking
a server to play.{" "}
<span className="font-bold">
Keep in mind that MHSF is not endorsed by Minehut or GamerSafer in
any way, as MHSF is a open-source unofficial project.
</span>
</DialogDescription>
</DialogContent>
</Dialog>
);
}

@ -67,8 +67,25 @@ const FeatureList = ({
);
};
export const version = "1.7.0";
export const version = "1.7.5";
export const changelog: { name: string; id: string; changelog: ReactNode }[] = [
{
id: "tj4ijg09aern9eargjjuauerr",
name: "v1.7.5",
changelog: (
<FeatureList
github="https://github.com/DeveloLongScript/MHSF/releases/tag/1.7.5"
features={[
"Migrated accounts from development to production"
]}
title={
<strong className="flex items-center">
Version 1.7.5 (January 29th 2025)
</strong>
}
/>
),
},
{
id: "38ufajf8efajwj3njdaisef",
name: "v1.7",

@ -753,7 +753,7 @@
resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz"
integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==
"@jridgewell/sourcemap-codec@^1.4.15":
"@jridgewell/sourcemap-codec@^1.4.15", "@jridgewell/sourcemap-codec@^1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a"
integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==
@ -2504,6 +2504,11 @@
resolved "https://registry.yarnpkg.com/@unocss/core/-/core-0.61.5.tgz#09f4da600f6f50dbb68a173f23566e9171d5cd3d"
integrity sha512-hB8zr2rnrCzz9x8ho2SAXQiYTEjwAPMiBzpaEe2C0+CFWeL1179h9508YVyZHHAzMyZILIG9YrVAWrrMdt2/Xg==
"@unocss/core@65.4.2", "@unocss/core@^65.4.2":
version "65.4.2"
resolved "https://registry.yarnpkg.com/@unocss/core/-/core-65.4.2.tgz#7f112eb2663cd2682b1d5e6299d4a34256ca07e2"
integrity sha512-VmXy5D25por+pt9LBlKZ3gk4rOE5ldm80MyVOEnLcpaFb9LqB0g/8qUU9/Dk3TSA+ZPeoGm53Juo0p8LMFIigA==
"@unocss/eslint-config@^0.61.5":
version "0.61.5"
resolved "https://registry.yarnpkg.com/@unocss/eslint-config/-/eslint-config-0.61.5.tgz#01a8ebb4a626d22d6e29d9800c31d2f87bed2b6b"
@ -2522,12 +2527,12 @@
magic-string "^0.30.10"
synckit "^0.9.1"
"@unocss/extractor-arbitrary-variants@0.61.5":
version "0.61.5"
resolved "https://registry.yarnpkg.com/@unocss/extractor-arbitrary-variants/-/extractor-arbitrary-variants-0.61.5.tgz#478b15f0ae298b0f05d9978ef528b08723c22cb5"
integrity sha512-UB1EweAaJrUxv+h3n5FqoizKHrnUgUzkdmOdJTfV6xvow90ITqbUoza+L6iVMNfcrcXTx8QpDnWh6rhLRyKY+g==
"@unocss/extractor-arbitrary-variants@65.4.2":
version "65.4.2"
resolved "https://registry.yarnpkg.com/@unocss/extractor-arbitrary-variants/-/extractor-arbitrary-variants-65.4.2.tgz#47207ebc2a32fdc8191801c21367279e01f20ec9"
integrity sha512-qm5JXfjbxgXqhQAeOfV1jFT1ThBTi1bP1m+Nu2p6tB9EUbAUp+AKY4sODueqDXoriUtOc7h0QzyW3Lm+s3fTGw==
dependencies:
"@unocss/core" "0.61.5"
"@unocss/core" "65.4.2"
"@unocss/postcss@^0.61.5":
version "0.61.5"
@ -2542,33 +2547,33 @@
magic-string "^0.30.10"
postcss "^8.4.39"
"@unocss/preset-mini@0.61.5":
version "0.61.5"
resolved "https://registry.yarnpkg.com/@unocss/preset-mini/-/preset-mini-0.61.5.tgz#60dc1aa2c05e415b6e9860493fb92a20acce62da"
integrity sha512-gVm7Z9X0krx8CK/+pKAqcVmpqzRk1+SH7bfgRxKtKhyFSxJlwpjNp1rKm3gCT0F1Tlp3d8aufYRksaXGZhs8Ow==
"@unocss/preset-mini@65.4.2":
version "65.4.2"
resolved "https://registry.yarnpkg.com/@unocss/preset-mini/-/preset-mini-65.4.2.tgz#ec93076c7b7875119e4f02acbef8570b1ad21c3c"
integrity sha512-4ZZK9KwDHjI8wFUKeB+30GHekPmy1OzXncjlXhqm+vNQ7FO3xCee7VY00E5bgz5Tt0pXALcKFlrEspjpSaeCoQ==
dependencies:
"@unocss/core" "0.61.5"
"@unocss/extractor-arbitrary-variants" "0.61.5"
"@unocss/rule-utils" "0.61.5"
"@unocss/core" "65.4.2"
"@unocss/extractor-arbitrary-variants" "65.4.2"
"@unocss/rule-utils" "65.4.2"
"@unocss/preset-uno@^0.61.5":
version "0.61.5"
resolved "https://registry.yarnpkg.com/@unocss/preset-uno/-/preset-uno-0.61.5.tgz#80c85edaf4ed364c91df3400dae5abfe3976f21e"
integrity sha512-CflB0l9CeZx+b/Q8mA4Ow4d63Caf+vFJ+1EGA06jG9qYjPLy76Rkci//0m9cEtO+vPnYtgLc7HZAZv0X6wh4Tg==
"@unocss/preset-uno@^65.4.2":
version "65.4.2"
resolved "https://registry.yarnpkg.com/@unocss/preset-uno/-/preset-uno-65.4.2.tgz#b0bdada94952726d4b3ba6770537576a4b906305"
integrity sha512-rJcGx/+EWA3wXGOAZdYQFSEn8knsiqiST/Ji1adN+9dTq4BVYMZ9n3zYRF6GZ8p61aZomhU4jmzpLk12RMdxpg==
dependencies:
"@unocss/core" "0.61.5"
"@unocss/preset-mini" "0.61.5"
"@unocss/preset-wind" "0.61.5"
"@unocss/rule-utils" "0.61.5"
"@unocss/core" "65.4.2"
"@unocss/preset-mini" "65.4.2"
"@unocss/preset-wind" "65.4.2"
"@unocss/rule-utils" "65.4.2"
"@unocss/preset-wind@0.61.5":
version "0.61.5"
resolved "https://registry.yarnpkg.com/@unocss/preset-wind/-/preset-wind-0.61.5.tgz#049f4cf3d15be5d5bf1bb3c2108cff22a69d0884"
integrity sha512-n4uepxv3gVoVQb0tv7iV8M4W0CgwLw0QaMX+3ECYzFLMynjCkZmFDtdQAX720yTvLZxwCxEZfQCgydOSt0qjZA==
"@unocss/preset-wind@65.4.2":
version "65.4.2"
resolved "https://registry.yarnpkg.com/@unocss/preset-wind/-/preset-wind-65.4.2.tgz#e6f2aa32eb8a0e1ed1a07715dac5337935d41df0"
integrity sha512-TQm9P2UHpqfn92APfZJtbK2brkXQ+GInFL2evup/ZChU1fqdbH9mL0ef6ZNQbCH4gjY6mEzwPXt4lhGod6CajA==
dependencies:
"@unocss/core" "0.61.5"
"@unocss/preset-mini" "0.61.5"
"@unocss/rule-utils" "0.61.5"
"@unocss/core" "65.4.2"
"@unocss/preset-mini" "65.4.2"
"@unocss/rule-utils" "65.4.2"
"@unocss/rule-utils@0.61.5":
version "0.61.5"
@ -2578,6 +2583,14 @@
"@unocss/core" "^0.61.5"
magic-string "^0.30.10"
"@unocss/rule-utils@65.4.2":
version "65.4.2"
resolved "https://registry.yarnpkg.com/@unocss/rule-utils/-/rule-utils-65.4.2.tgz#5f1f6c965db4f26a6fec245358b105925b9d8097"
integrity sha512-OdMSJZiZUr8XmLo3Bz3Wrw1nZLT1nTPnPOV8gdi4vZ+2RgCChua9o8Dz4IyeQ7mMhLXoqHIUpJ7jE5Nv+Uz1Fw==
dependencies:
"@unocss/core" "^65.4.2"
magic-string "^0.30.17"
"@unocss/transformer-compile-class@^0.61.5":
version "0.61.5"
resolved "https://registry.yarnpkg.com/@unocss/transformer-compile-class/-/transformer-compile-class-0.61.5.tgz#be992b1a9e2300314618b1866854f1f6ea95419c"
@ -5342,6 +5355,13 @@ magic-string@^0.30.10:
dependencies:
"@jridgewell/sourcemap-codec" "^1.4.15"
magic-string@^0.30.17:
version "0.30.17"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.17.tgz#450a449673d2460e5bbcfba9a61916a1714c7453"
integrity sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==
dependencies:
"@jridgewell/sourcemap-codec" "^1.5.0"
mangle-css-class-webpack-plugin@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/mangle-css-class-webpack-plugin/-/mangle-css-class-webpack-plugin-5.1.0.tgz#42008a8fbe0257f491968796320eb94b17a36321"