Skip to content

Commit

Permalink
chore: remove dotenv from core
Browse files Browse the repository at this point in the history
  • Loading branch information
Joabesv committed Oct 24, 2023
1 parent 39b88f8 commit 724ca51
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 12 deletions.
4 changes: 4 additions & 0 deletions apps/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"build:type-check": "tsc",
"start": "node --env-file=.env.production --watch dist/server.js",
"preview": "node --env-file=.env.production dist/server.js",
"test": "NODE_ENV=test mocha",
"test:watch": "NODE_ENV=test mocha --watch",
"test:coverage": "c8 --check-coverage=true mocha",
"lint": "eslint .",
"lint:fix": "pnpm run lint --fix"
},
Expand All @@ -39,6 +42,7 @@
"@total-typescript/ts-reset": "^0.5.1",
"@types/node": "^20.8.7",
"@ufabcnext/tsconfig": "workspace:*",
"c8": "^8.0.1",
"esbuild": "^0.19.5",
"esbuild-plugin-pino": "^2.0.2",
"pino-pretty": "^10.2.3",
Expand Down
7 changes: 0 additions & 7 deletions apps/core/src/config/config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import { config as dotEnvConfig } from 'dotenv';
import { z } from 'zod';

if (process.env.NODE_ENV === 'test') {
dotEnvConfig({ path: '.env.test' });
} else {
dotEnvConfig();
}

const envSchema = z.object({
NODE_ENV: z.enum(['dev', 'test', 'prod']).default('dev'),
PORT: z.coerce.number().default(5000),
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"name": "ufabc-next-backend",
"private": false,
"type": "module",
"engines": {
"node": "^20.7.0",
"pnpm": "^8"
},
"packageManager": "[email protected]",
"type": "module",
"scripts": {
"preinstall": "npx only-allow pnpm",
"populate": "turbo run populate -- ",
Expand All @@ -17,6 +13,7 @@
"lint": "turbo run lint --parallel",
"lint:fix": "turbo run lint:fix --parallel",
"preview": "turbo run preview",
"test": "turbo run test",
"check-updates": "pnpm outdated --recursive",
"prepare": "simple-git-hooks"
},
Expand All @@ -28,6 +25,10 @@
"simple-git-hooks": "^2.9.0",
"turbo": "^1.10.16"
},
"engines": {
"node": "^20.7.0",
"pnpm": "^8"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
},
Expand Down
145 changes: 145 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 724ca51

Please sign in to comment.