Compare commits

...

8 Commits

Author SHA1 Message Date
dependabot[bot]
c4963a260d
Merge 3f3fad39d0e9cf6d4da94fde005ffabdaf1a858a into 68e46b8eea9426dae994e245157d4336b962f391 2025-03-13 02:04:34 +00:00
dependabot[bot]
3f3fad39d0
chore(deps-dev): bump react-markdown from 9.1.0 to 10.1.0
Bumps [react-markdown](https://github.com/remarkjs/react-markdown) from 9.1.0 to 10.1.0.
- [Release notes](https://github.com/remarkjs/react-markdown/releases)
- [Changelog](https://github.com/remarkjs/react-markdown/blob/main/changelog.md)
- [Commits](https://github.com/remarkjs/react-markdown/compare/9.1.0...10.1.0)

---
updated-dependencies:
- dependency-name: react-markdown
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-13 02:04:30 +00:00
dvelo
68e46b8eea feat(www): posthog 2025-03-12 21:01:26 -05:00
dvelo
d51bef8da0 Merge branch 'main' of https://github.com/DeveloLongScript/MHSF 2025-03-12 17:18:19 -05:00
dvelo
981f106acc fix: update react 2025-03-12 17:18:12 -05:00
dvelo
b003f08fe5
Add files via upload 2025-03-12 16:53:31 -05:00
dvelo
f2e9c9c5e2
Delete .github/github-banner.png 2025-03-12 16:53:19 -05:00
dvelo
c784f965cd
Add files via upload 2025-03-12 16:50:58 -05:00
6 changed files with 3104 additions and 96 deletions

BIN
.github/github-banner.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 KiB

@ -45,6 +45,22 @@ const nextConfig = {
},
];
},
async rewrites() {
return [
{
source: "/ingest/static/:path*",
destination: "https://us-assets.i.posthog.com/static/:path*",
},
{
source: "/ingest/:path*",
destination: "https://us.i.posthog.com/:path*",
},
{
source: "/ingest/decide",
destination: "https://us.i.posthog.com/decide",
},
];
},
eslint: {
ignoreDuringBuilds: true,
},

@ -56,6 +56,7 @@
"nextjs-toploader": "^1.6.12",
"nprogress": "^0.2.0",
"postcss-obfuscator": "^1.6.1",
"posthog-js": "^1.230.2",
"prettier": "^3.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
@ -116,7 +117,7 @@
"react-hook-form": "^7.52.2",
"react-hotkeys-hook": "^4.5.0",
"react-infinite-scroll-component": "^6.1.0",
"react-markdown": "^9.0.1",
"react-markdown": "^10.1.0",
"react-resizable-panels": "^2.0.23",
"recharts": "^2.12.7",
"shiki": "^1.23.0",

@ -26,7 +26,6 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
import { Analytics } from "@vercel/analytics/react";
import { SpeedInsights } from "@vercel/speed-insights/next";
import { GeistSans } from "geist/font/sans";
import "../globals.css";
@ -41,6 +40,7 @@ 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 { PostHogProvider } from "@/components/misc/PosthogProvider";
export const viewport: Viewport = {
themeColor: "black",
@ -57,14 +57,15 @@ export default async function RootLayout({
<ClerkThemeProvider className={GeistSans.className}>
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
<TooltipProvider>
<PostHogProvider>
<AllBanners />
<LayoutPart>{children}</LayoutPart>
<ThemedToaster />
<CommandBarer />
<SpeedInsights />
<Analytics />
<NewDomainDialog />
<Footer />
</PostHogProvider>
</TooltipProvider>
</ThemeProvider>
</ClerkThemeProvider>

@ -0,0 +1,86 @@
/*
* MHSF, Minehut Server List
* All external content is rather licensed under the ECA Agreement
* located here: https://mhsf.app/docs/legal/external-content-agreement
*
* All code under MHSF is licensed under the MIT License
* by open source contributors
*
* Copyright (c) 2025 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 { usePathname, useSearchParams } from "next/navigation";
import { useEffect, Suspense } from "react";
import { usePostHog } from "posthog-js/react";
import posthog from "posthog-js";
import { PostHogProvider as PHProvider } from "posthog-js/react";
export function PostHogProvider({ children }: { children: React.ReactNode }) {
useEffect(() => {
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY as string, {
api_host: "/ingest",
ui_host: "https://us.posthog.com",
person_profiles: "identified_only", // or 'always' to create profiles for anonymous users as well
capture_pageview: false, // Disable automatic pageview capture, as we capture manually
});
}, []);
return (
<PHProvider client={posthog}>
<SuspendedPostHogPageView />
{children}
</PHProvider>
);
}
function PostHogPageView() {
const pathname = usePathname();
const searchParams = useSearchParams();
const posthog = usePostHog();
// Track pageviews
useEffect(() => {
if (pathname && posthog) {
let url = window.origin + pathname;
if (searchParams?.toString()) {
url = `${url}?${searchParams?.toString()}`;
}
posthog.capture("$pageview", { $current_url: url });
}
}, [pathname, searchParams, posthog]);
return null;
}
// Wrap PostHogPageView in Suspense to avoid the useSearchParams usage above
// from de-opting the whole app into client-side rendering
// See: https://nextjs.org/docs/messages/deopted-into-client-rendering
function SuspendedPostHogPageView() {
return (
<Suspense fallback={null}>
<PostHogPageView />
</Suspense>
);
}

3076
yarn.lock

File diff suppressed because it is too large Load Diff