Skip to content

Commit

Permalink
chore: removed t3-env checker temp
Browse files Browse the repository at this point in the history
  • Loading branch information
VineeTagarwaL-code committed Sep 28, 2024
1 parent 9a676d5 commit 2d52ab9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 35 deletions.
3 changes: 1 addition & 2 deletions src/components/gmaps-autosuggest.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Script from 'next/script';
import { Input } from './ui/input';
import { clientEnv } from '@/env/client';
import { useImperativeHandle, useRef } from 'react';

export type TgmapsAddress = { city: string; fullAddress: string };
Expand Down Expand Up @@ -48,7 +47,7 @@ export default function GmapsAutocompleteAddress({
return (
<>
<Script
src={`https://maps.googleapis.com/maps/api/js?key=${clientEnv.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY}&libraries=places`}
src={`https://maps.googleapis.com/maps/api/js?key=${process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY}&libraries=places`}
strategy="lazyOnload"
onLoad={initializeGmaps}
/>
Expand Down
24 changes: 12 additions & 12 deletions src/env/client.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// client-env.ts
import { createEnv } from '@t3-oss/env-nextjs';
import { z } from 'zod';
// // client-env.ts
// import { createEnv } from '@t3-oss/env-nextjs';
// import { z } from 'zod';

export const clientEnv = createEnv({
client: {
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY: z.string().min(1),
},
runtimeEnv: {
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY:
process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY,
},
});
// export const clientEnv = createEnv({
// client: {
// NEXT_PUBLIC_GOOGLE_MAPS_API_KEY: z.string().min(1),
// },
// runtimeEnv: {
// NEXT_PUBLIC_GOOGLE_MAPS_API_KEY:
// process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY,
// },
// });
42 changes: 21 additions & 21 deletions src/env/server.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
// server-env.ts
import { createEnv } from '@t3-oss/env-nextjs';
import { z } from 'zod';
// // server-env.ts
// import { createEnv } from '@t3-oss/env-nextjs';
// import { z } from 'zod';

export const serverEnv = createEnv({
server: {
DATABASE_URL: z.string().url(),
NEXTAUTH_SECRET: z.string().min(1),
NEXTAUTH_URL: z.string().url(),
CDN_API_KEY: z.string().min(1),
CDN_BASE_UPLOAD_URL: z.string().url(),
CDN_BASE_ACCESS_URL: z.string().url(),
},
runtimeEnv: {
DATABASE_URL: process.env.DATABASE_URL,
NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET,
NEXTAUTH_URL: process.env.NEXTAUTH_URL,
CDN_API_KEY: process.env.CDN_API_KEY,
CDN_BASE_UPLOAD_URL: process.env.CDN_BASE_UPLOAD_URL,
CDN_BASE_ACCESS_URL: process.env.CDN_BASE_ACCESS_URL,
},
});
// export const serverEnv = createEnv({
// server: {
// DATABASE_URL: z.string().url(),
// NEXTAUTH_SECRET: z.string().min(1),
// NEXTAUTH_URL: z.string().url(),
// CDN_API_KEY: z.string().min(1),
// CDN_BASE_UPLOAD_URL: z.string().url(),
// CDN_BASE_ACCESS_URL: z.string().url(),
// },
// runtimeEnv: {
// DATABASE_URL: process.env.DATABASE_URL,
// NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET,
// NEXTAUTH_URL: process.env.NEXTAUTH_URL,
// CDN_API_KEY: process.env.CDN_API_KEY,
// CDN_BASE_UPLOAD_URL: process.env.CDN_BASE_UPLOAD_URL,
// CDN_BASE_ACCESS_URL: process.env.CDN_BASE_ACCESS_URL,
// },
// });

0 comments on commit 2d52ab9

Please sign in to comment.