diff --git a/apps/frontend/next.config.js b/apps/frontend/next.config.js deleted file mode 100644 index da1bb770..00000000 --- a/apps/frontend/next.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - reactStrictMode: true, -}; diff --git a/apps/frontend/next.config.mjs b/apps/frontend/next.config.mjs new file mode 100644 index 00000000..514d6639 --- /dev/null +++ b/apps/frontend/next.config.mjs @@ -0,0 +1,14 @@ +// Importing env files here to validate on build +import './src/env.mjs'; + +/** @type {import('next').NextConfig} */ +const config = { + reactStrictMode: true, + /** Enables hot reloading for local packages without a build step */ + transpilePackages: [], + /** We already do linting and typechecking as separate tasks in CI */ + eslint: { ignoreDuringBuilds: true }, + typescript: { ignoreBuildErrors: true }, +}; + +export default config; diff --git a/apps/frontend/package.json b/apps/frontend/package.json index cf0dcc02..bac75112 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -25,6 +25,7 @@ "@radix-ui/react-dropdown-menu": "^2.0.5", "@radix-ui/react-icons": "^1.3.0", "@tailwindcss/line-clamp": "0.4.4", + "@t3-oss/env-nextjs": "^0.6.0", "@types/react-syntax-highlighter": "15.5.7", "@vercel/analytics": "^1.0.1", "clsx": "1.2.1", @@ -39,7 +40,8 @@ "react-hook-form": "7.45.1", "react-markdown": "8.0.7", "react-syntax-highlighter": "15.5.0", - "recoil": "0.7.7" + "recoil": "0.7.7", + "zod": "^3.21.4" }, "devDependencies": { "@babel/core": "7.22.5", diff --git a/apps/frontend/src/components/Utils/GoogleAnalytics.tsx b/apps/frontend/src/components/Utils/GoogleAnalytics.tsx index d95d651c..d7c13ac1 100644 --- a/apps/frontend/src/components/Utils/GoogleAnalytics.tsx +++ b/apps/frontend/src/components/Utils/GoogleAnalytics.tsx @@ -3,14 +3,14 @@ import { usePathname, useSearchParams } from 'next/navigation'; import Script from 'next/script'; import { useEffect } from 'react'; -import { GA_TRACKING_ID, pageView } from '@/lib'; +import { pageView } from '@/lib'; +import { env } from '@/env.mjs'; const GoogleAnalytics: React.FC = () => { const pathname = usePathname(); const searchParams = useSearchParams(); useEffect(() => { - if (!GA_TRACKING_ID) return; const url = pathname + searchParams.toString(); pageView(url); }, [pathname, searchParams]); @@ -19,7 +19,7 @@ const GoogleAnalytics: React.FC = () => { <>