From 39324b401b2914dd2d37b70423d4cab106889942 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Mon, 6 May 2024 14:10:47 +0530 Subject: [PATCH] fix: package json fixes readme changes --- .env | 2 -- README.md | 2 -- package.json | 12 ++++++------ webpack.common.js | 2 +- webpack.dev.js | 2 +- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.env b/.env index 27ece2ab5..29dda11a9 100644 --- a/.env +++ b/.env @@ -1,4 +1,2 @@ -SDK_ENV="local" -ENV_SDK_URL="" ENV_BACKEND_URL="" ENV_LOGGING_URL="" diff --git a/README.md b/README.md index 597d3fe3a..77477bae7 100644 --- a/README.md +++ b/README.md @@ -97,8 +97,6 @@ Before you start the local setup, you will need an understanding of few keys - ### About Env Configs for SDK -- **`SDK_ENV`:** Specifies the environment in which the SDK will be running. This could be "local", "integ", "sandbox", or "prod". Different configurations are available for each environment. The default value is "local". - - **`ENV_BACKEND_URL`:** Sets the endpoint for all the APIs used within the SDK to interact with the backend service. If you are running your own backend service, you can configure and specify its endpoint here for local setups. - **`ENV_LOGGING_URL`:** Specifies a custom logging endpoint where logs generated by the SDK can be sent. This allows you to view and manage logs according to your requirements. diff --git a/package.json b/package.json index 63d168e70..e50563545 100644 --- a/package.json +++ b/package.json @@ -20,13 +20,13 @@ "webpack-merge": "^5.9.0" }, "scripts": { - "build:dev": "webpack --config webpack.dev.js", - "build:dev-integ": "webpack --config webpack.dev.js", - "start": "webpack serve --config webpack.dev.js", - "build:prod": "webpack --config webpack.common.js", + "build:dev": "sdkEnv=sandbox webpack --config webpack.dev.js", + "build:dev-integ": "sdkEnv=integ webpack --config webpack.dev.js", + "start": "sdkEnv=local webpack serve --config webpack.dev.js", + "build:prod": "sdkEnv=prod webpack --config webpack.common.js", "build": "webpack --config webpack.common.js", - "build:sandbox": "webpack --config webpack.common.js", - "build:integ": "webpack --config webpack.common.js", + "build:sandbox": "sdkEnv=sandbox webpack --config webpack.common.js", + "build:integ": "sdkEnv=integ webpack --config webpack.common.js", "test": "react-scripts test", "eject": "react-scripts eject", "re:build": "rescript", diff --git a/webpack.common.js b/webpack.common.js index 1b7b8c457..e0d800850 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -10,7 +10,7 @@ const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin; const { sentryWebpackPlugin } = require("@sentry/webpack-plugin"); -const sdkEnv = process.env.SDK_ENV ?? "local"; +const sdkEnv = process.env.sdkEnv ?? "local"; const envSdkUrl = process.env.ENV_SDK_URL ?? ""; const envBackendUrl = process.env.ENV_BACKEND_URL ?? ""; const envLoggingUrl = process.env.ENV_LOGGING_URL ?? ""; diff --git a/webpack.dev.js b/webpack.dev.js index 210f4df8a..993c77a9d 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -2,7 +2,7 @@ const path = require("path"); const dotenv = require("dotenv").config(); const { merge } = require("webpack-merge"); const common = require("./webpack.common.js"); -const sdkEnv = process.env.SDK_ENV ?? "local"; +const sdkEnv = process.env.sdkEnv ?? "local"; let backendEndPoint = sdkEnv === "prod"