Skip to content

Commit

Permalink
refactor: remove unecessary unused env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
AshGw committed May 11, 2024
1 parent bcf655e commit b61af55
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
17 changes: 0 additions & 17 deletions .env.local.example

This file was deleted.

6 changes: 2 additions & 4 deletions src/lib/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ export const prod = {};

export const nextJS = {
NEXT_NODE_ENV: process.env.NEXT_NODE_ENV as string,
NEXT_URL: process.env.NEXT_URL as string,
NEXT_DEV_URL: process.env.NEXT_DEV_URL as string,
GENERATE_SOURCEMAP: process.env.GENERATE_SOURCEMAP as string,
GENERATE_SOURCEMAP: false,
};

export const pub = {
SITE_URL_PROD: 'https://ashgw.me',
SITE_URL_DEV: 'http://localhost:3000',
EMAIL: process.env.EMAIL as string,
EMAIL: 'ashrefgw@proton.me',
};
4 changes: 1 addition & 3 deletions test/code/env.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { pub, nextJS } from '@/lib/env';

test('Environment variables should actually load', async () => {
test('Environment variables should exist', async () => {
// NextJS configs
expect(nextJS.GENERATE_SOURCEMAP).toBeDefined();
expect(nextJS.NEXT_URL).toBeDefined();
expect(nextJS.NEXT_NODE_ENV).toBeDefined();
expect(nextJS.NEXT_DEV_URL).toBeDefined();

// public envs
expect(pub.SITE_URL_PROD).toBeDefined();
Expand Down

0 comments on commit b61af55

Please sign in to comment.