From b5916efeeda997d40f56b519aa1d0afee6d7cc79 Mon Sep 17 00:00:00 2001 From: Haris Shah Date: Sun, 25 Feb 2024 03:49:23 +0500 Subject: [PATCH] refactor: add env-cli and config --- apps/api/.env.example => .env.example | 0 package-lock.json | 37 +++++++++++++++++++++++++++ package.json | 3 ++- turbo.json | 2 +- 4 files changed, 40 insertions(+), 2 deletions(-) rename apps/api/.env.example => .env.example (100%) diff --git a/apps/api/.env.example b/.env.example similarity index 100% rename from apps/api/.env.example rename to .env.example diff --git a/package-lock.json b/package-lock.json index a9b31f1..73f4266 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "packages/*" ], "devDependencies": { + "dotenv-cli": "^7.3.0", "prettier": "^3.1.1", "turbo": "latest" }, @@ -4488,6 +4489,42 @@ "node": ">=12" } }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dotenv-cli": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/dotenv-cli/-/dotenv-cli-7.3.0.tgz", + "integrity": "sha512-314CA4TyK34YEJ6ntBf80eUY+t1XaFLyem1k9P0sX1gn30qThZ5qZr/ZwE318gEnzyYP9yj9HJk6SqwE0upkfw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "dotenv": "^16.3.0", + "dotenv-expand": "^10.0.0", + "minimist": "^1.2.6" + }, + "bin": { + "dotenv": "cli.js" + } + }, + "node_modules/dotenv-expand": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-10.0.0.tgz", + "integrity": "sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", diff --git a/package.json b/package.json index bd69ab4..12492f7 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,14 @@ "scripts": { "build": "turbo run build", "clean": "turbo run clean", - "dev": "turbo run dev", + "dev": "dotenv -- turbo run dev", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "lint": "turbo run lint", "test": "turbo run test", "typecheck": "turbo run typecheck" }, "devDependencies": { + "dotenv-cli": "^7.3.0", "prettier": "^3.1.1", "turbo": "latest" }, diff --git a/turbo.json b/turbo.json index 3b63888..40ede81 100644 --- a/turbo.json +++ b/turbo.json @@ -2,9 +2,9 @@ "$schema": "https://turbo.build/schema.json", "globalDependencies": ["**/.env.*local"], "globalEnv": ["PORT"], + "globalDotEnv": [".env"], "pipeline": { "build": { - // "outputs" are defined in Workspace Configurations: https://turbo.build/repo/docs/core-concepts/monorepos/configuring-workspaces "dependsOn": ["^build"] }, "test": {