From ca9044770009914f96b455ecb49898ee598e2ebc Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sat, 2 Mar 2024 16:15:03 -0700 Subject: [PATCH] fix different "environment" variables for prod & dev --- .env.development | 4 ++++ .env.production | 3 +++ CHANGELOG.md | 9 ++++++--- README.md | 8 ++++---- package.json | 1 + src/constants/app.ts | 4 +++- src/libs/endorserServer.ts | 4 ++-- 7 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 .env.development create mode 100644 .env.production diff --git a/.env.development b/.env.development new file mode 100644 index 000000000..9e5c00605 --- /dev/null +++ b/.env.development @@ -0,0 +1,4 @@ +# Only the variables that start with VUE_APP_ are seen in the application process.env in Vue. + +# this won't resolve as a URL on production; it's a URN only found in the test system +VUE_APP_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01HNTZYJJXTGT0EZS3VEJGX7AK diff --git a/.env.production b/.env.production new file mode 100644 index 000000000..d34380077 --- /dev/null +++ b/.env.production @@ -0,0 +1,3 @@ +# Only the variables that start with VUE_APP_ are seen in the application process.env in Vue. +VUE_APP_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01GXYPFF7FA03NXKPYY142PY4H +VUE_APP_DEFAULT_ENDORSER_API_SERVER=https://api.endorser.ch diff --git a/CHANGELOG.md b/CHANGELOG.md index 96e74adbb..bab2bbc75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] -### Changed in DB -- ? +### Fixed +- Environment variable for BVC meetings project +### Changed in DB or environment +- Test that a new browser session will get the right default API +- Test that a new browser session will send the right BVC meetings project -## [0.2.17] - 2024.03.01- 3612ea42240c5e1b7d7eff29a39ff18f1b869b36 +## [0.2.17] - 2024.03.01 - 3612ea42240c5e1b7d7eff29a39ff18f1b869b36 ### Added - Shortcut page for Bountiful Voluntaryist Community ### Changed diff --git a/README.md b/README.md index be28ce065..04286a077 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,9 @@ npm run lint * Update the project.task.yaml & CHANGELOG.md & the version in package.json, run `npm install`. -* If production: change src/constants/app.ts DEFAULT_*_SERVER to be "PROD" and package.json to remove "_Test". Also record what version is on production. +* If production: change package.json to remove "_Test". Also record what version is on production. -* `npm run build` +* `npm run build-dev` for test servers or `npm run build` for production. * Get on the server and back up the time-safari folder. @@ -44,9 +44,9 @@ npm run lint * Revert src/constants/app.ts and package.json (if that was prod). -* Commit changes. Record the new hash in the changelog. Edit package.json to increment version & add "-beta", `npm install`, and commit. Tag if you didn't before. Also record what version is on production. +* Commit changes. Record the new hash in the changelog. Edit package.json to increment version & add "-beta", `npm install`, and commit. Also record what version is on production. -* [Tag wth the new version.](https://gitea.anomalistdesign.com/trent_larson/crowd-funder-for-time-pwa/releases) +* [Tag with the new version.](https://gitea.anomalistdesign.com/trent_larson/crowd-funder-for-time-pwa/releases) diff --git a/package.json b/package.json index 584468096..07cae38b3 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", + "build-dev": "vue-cli-service build --mode development", "lint": "vue-cli-service lint" }, "dependencies": { diff --git a/src/constants/app.ts b/src/constants/app.ts index 4e94d01ff..929610762 100644 --- a/src/constants/app.ts +++ b/src/constants/app.ts @@ -15,7 +15,9 @@ export enum AppString { NO_CONTACT_NAME = "(no name)", } -export const DEFAULT_ENDORSER_API_SERVER = AppString.TEST_ENDORSER_API_SERVER; +export const DEFAULT_ENDORSER_API_SERVER = + process.env.VUE_APP_DEFAULT_ENDORSER_API_SERVER || + AppString.TEST_ENDORSER_API_SERVER; export const DEFAULT_PUSH_SERVER = window.location.protocol + "//" + window.location.host; diff --git a/src/libs/endorserServer.ts b/src/libs/endorserServer.ts index 48856114b..ad508c096 100644 --- a/src/libs/endorserServer.ts +++ b/src/libs/endorserServer.ts @@ -780,8 +780,8 @@ export const claimSpecialDescription = ( }; export const BVC_MEETUPS_PROJECT_CLAIM_ID = - //"https://endorser.ch/entity/01GXYPFF7FA03NXKPYY142PY4H"; - "https://endorser.ch/entity/01HNTZYJJXTGT0EZS3VEJGX7AK"; + process.env.VUE_APP_BVC_MEETUPS_PROJECT_CLAIM_ID || + "https://endorser.ch/entity/01HNTZYJJXTGT0EZS3VEJGX7AK"; // this won't resolve as a URL on production; it's a URN only found in the test system export const bvcMeetingJoinClaim = (did: string, startTime: string) => { return {