From 88546bc6cc06af303b8fb48949013a3b436c4e7d Mon Sep 17 00:00:00 2001 From: "Mr. Singleton" Date: Mon, 27 Nov 2023 14:52:37 -0500 Subject: [PATCH] removed some project specific values in favor of environment variables --- README.md | 2 ++ functions/package.json | 1 + functions/src/sanityClient.ts | 2 +- package.json | 2 +- public/index.html | 3 ++- sanityIo/package.json | 2 +- src/App.tsx | 13 +++---------- src/sanityClient.ts | 6 +++--- 8 files changed, 14 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 53f158d9..3be61b19 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ Application that serves as the website builder from React Components REACT_APP_MESSAGING_SENDER_ID= REACT_APP_APP_ID= REACT_APP_FIREBASE_ANALYTICS_TRACKING_ID= + REACT_APP_BASE_ROUTE= ``` #### Firebase @@ -48,6 +49,7 @@ Application that serves as the website builder from React Components ``` SANITY_PROJECTID= SANITY_DB=development + SANITY_APIVERSION= SANITY_API_TOKEN= SENDGRID_API_KEY= SENDGRID_FROM_EMAIL= diff --git a/functions/package.json b/functions/package.json index 1010fd5b..0ff969e1 100644 --- a/functions/package.json +++ b/functions/package.json @@ -1,5 +1,6 @@ { "name": "functions", + "version": "0.3.0", "scripts": { "lint": "eslint --ext .js,.ts .", "build": "tsc", diff --git a/functions/src/sanityClient.ts b/functions/src/sanityClient.ts index 511bba35..56152759 100644 --- a/functions/src/sanityClient.ts +++ b/functions/src/sanityClient.ts @@ -3,7 +3,7 @@ const client = require("@sanity/client"); export const sanityClient = client({ projectId: process.env.SANITY_PROJECTID, dataset: process.env.SANITY_DB, - apiVersion: "2021-03-25", + apiVersion: process.env.SANITY_APIVERSION, token: process.env.SANITY_API_TOKEN, useCdn: false, }); diff --git a/package.json b/package.json index 9be718ae..2d1d8a7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "the-handsomestnerd-internal", - "version": "0.2.0", + "version": "0.3.0", "license": "GPL-3.0-or-later", "private": true, "dependencies": { diff --git a/public/index.html b/public/index.html index c88ec965..c7977b14 100644 --- a/public/index.html +++ b/public/index.html @@ -36,7 +36,8 @@ Learn how to configure a non-root public URL by running `npm run build`. --> - Chow Works + + diff --git a/sanityIo/package.json b/sanityIo/package.json index 0d5bebdd..7333fbc5 100644 --- a/sanityIo/package.json +++ b/sanityIo/package.json @@ -1,7 +1,7 @@ { "name": "the-handsomest-nerd-sanity", "private": true, - "version": "0.2.0", + "version": "0.3.0", "description": "Sanity CMS for React Website Builder", "main": "package.json", "author": "theHandsomestNerd ", diff --git a/src/App.tsx b/src/App.tsx index 624b8c42..3788d34c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -11,13 +11,6 @@ import SnackbarProvider from "./components/modal-context/SnackbarProvider"; import PageMux from "./components/templates/mackenzies-mind/pages/PageMux"; import CustomizedThemeProvider from "./components/customized-theme-provider/CustomizedThemeProvider"; -export enum RoutesEnum { - MAINROUTE = "/chow-works/:pageSlug", - HOMEROUTE = "/chow-works/home", - - ERROR = '/error' -} - function App() { const queryClient = new QueryClient({ defaultOptions: { @@ -49,11 +42,11 @@ function App() { - }/> - }/> + }/> + }/> }/> + to={"/"+process.env.REACT_APP_BASE_ROUTE+"/home"}/>}/> diff --git a/src/sanityClient.ts b/src/sanityClient.ts index 3f0b7523..4e9f641a 100644 --- a/src/sanityClient.ts +++ b/src/sanityClient.ts @@ -1,10 +1,10 @@ import sanityClient from "@sanity/client"; -// console.log("NODE.ENV", process.env) +console.log("NODE.ENV", process.env) export default sanityClient({ - projectId: "e5l5k4i5", + projectId: process.env.REACT_APP_SANITY_PROJECTID, dataset: process.env.REACT_APP_SANITY_DB, - apiVersion: "2021-03-25", + apiVersion: process.env.REACT_APP_SANITY_APIVERSION, useCdn: true, }); \ No newline at end of file