1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-06-05 19:15:30 -04:00

refactor: remove @t3-oss/env-nextjs, use process.env directly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-19 14:12:42 -05:00
parent c30197ccc5
commit 6f86fd1ca9
28 changed files with 91 additions and 287 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
"use client";
import { useEffect, useState } from "react";
import { env } from "@/lib/env";
import { getCommentCount } from "@/lib/server/comments";
const CommentCount = ({ slug }: { slug: string }) => {
@@ -29,9 +29,9 @@ const CommentCount = ({ slug }: { slug: string }) => {
return (
<span
title={`${Intl.NumberFormat(env.NEXT_PUBLIC_SITE_LOCALE).format(count)} ${count === 1 ? "comment" : "comments"}`}
title={`${Intl.NumberFormat(process.env.NEXT_PUBLIC_SITE_LOCALE).format(count)} ${count === 1 ? "comment" : "comments"}`}
>
{Intl.NumberFormat(env.NEXT_PUBLIC_SITE_LOCALE).format(count)}
{Intl.NumberFormat(process.env.NEXT_PUBLIC_SITE_LOCALE).format(count)}
</span>
);
};
+1 -2
View File
@@ -6,7 +6,6 @@ import { toast } from "sonner";
import { GitHubIcon } from "@/components/icons";
import { Button } from "@/components/ui/button";
import { signIn } from "@/lib/auth-client";
import { env } from "@/lib/env";
const SignIn = ({ callbackPath }: { callbackPath?: string }) => {
const [isLoading, setIsLoading] = useState(false);
@@ -17,7 +16,7 @@ const SignIn = ({ callbackPath }: { callbackPath?: string }) => {
try {
await signIn.social({
provider: "github",
callbackURL: `${env.NEXT_PUBLIC_BASE_URL}${callbackPath ? callbackPath : "/"}`,
callbackURL: `${process.env.NEXT_PUBLIC_BASE_URL}${callbackPath ? callbackPath : "/"}`,
});
} catch (error) {
console.error("Error signing in:", error);
+1 -2
View File
@@ -1,6 +1,5 @@
import Link from "next/link";
import siteConfig from "@/lib/config/site";
import { env } from "@/lib/env";
const Footer = () => (
<footer className="mt-8 w-full py-6 text-center text-[13px] text-muted-foreground leading-loose">
@@ -10,7 +9,7 @@ const Footer = () => (
</Link>
. View source on{" "}
<a
href={`https://github.com/${env.NEXT_PUBLIC_GITHUB_REPO}`}
href={`https://github.com/${process.env.NEXT_PUBLIC_GITHUB_REPO}`}
target="_blank"
rel="noopener noreferrer"
className="underline underline-offset-4"
+4 -2
View File
@@ -11,11 +11,13 @@ import {
} from "react";
import { Badge } from "@/components/ui/badge";
import { Skeleton } from "@/components/ui/skeleton";
import { env } from "@/lib/env";
import { getAllCommentCounts } from "@/lib/server/comments";
import { getAllViewCounts } from "@/lib/server/views";
const numberFormatter = new Intl.NumberFormat(env.NEXT_PUBLIC_SITE_LOCALE);
const numberFormatter = new Intl.NumberFormat(
process.env.NEXT_PUBLIC_SITE_LOCALE,
);
type Stats = {
views: Record<string, number>;
+2 -2
View File
@@ -2,7 +2,7 @@
import { useEffect, useState } from "react";
import { CountUp } from "@/components/count-up";
import { env } from "@/lib/env";
import { incrementViews } from "@/lib/server/views";
const ViewCounter = ({ slug }: { slug: string }) => {
@@ -31,7 +31,7 @@ const ViewCounter = ({ slug }: { slug: string }) => {
return (
<span
title={`${Intl.NumberFormat(env.NEXT_PUBLIC_SITE_LOCALE).format(views)} ${views === 1 ? "view" : "views"}`}
title={`${Intl.NumberFormat(process.env.NEXT_PUBLIC_SITE_LOCALE).format(views)} ${views === 1 ? "view" : "views"}`}
>
<CountUp start={0} end={views} delay={0} duration={1.5} />
</span>