From a04d729e47fbe56086ca2c4674d979052bcff286 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Wed, 23 Oct 2024 00:18:40 +0200 Subject: [PATCH] Rename preprod to staging --- .env.local | 1 + .env.prod | 1 + .env.preprod => .env.staging | 3 ++- package.json | 2 +- .../{manifest.preprod.json => manifest.staging.json} | 4 ++-- src/constants.js | 10 +++++----- 6 files changed, 12 insertions(+), 9 deletions(-) rename .env.preprod => .env.staging (74%) rename public/{manifest.preprod.json => manifest.staging.json} (87%) diff --git a/.env.local b/.env.local index b14a6286a8..dbe9105638 100644 --- a/.env.local +++ b/.env.local @@ -1,3 +1,4 @@ +VITE_OPEN_PRICES_ENV = "local" VITE_OPEN_PRICES_APP_URL = "http://127.0.0.1:8000" VITE_OPEN_PRICES_API_URL = "http://127.0.0.1:8000/api/v1" VITE_MANIFEST_PATH = "/manifest.local.json" diff --git a/.env.prod b/.env.prod index 883efe7961..1791d18fe5 100644 --- a/.env.prod +++ b/.env.prod @@ -1,3 +1,4 @@ +VITE_OPEN_PRICES_ENV = "prod" VITE_OPEN_PRICES_APP_URL = "https://prices.openfoodfacts.org" VITE_OPEN_PRICES_API_URL = "https://prices.openfoodfacts.org/api/v1" VITE_MANIFEST_PATH = "/manifest.prod.json" diff --git a/.env.preprod b/.env.staging similarity index 74% rename from .env.preprod rename to .env.staging index e4a55060ae..de7baeecef 100644 --- a/.env.preprod +++ b/.env.staging @@ -1,6 +1,7 @@ +VITE_OPEN_PRICES_ENV = "staging" VITE_OPEN_PRICES_APP_URL = "https://prices.openfoodfacts.net" VITE_OPEN_PRICES_API_URL = "https://prices.openfoodfacts.net/api/v1" -VITE_MANIFEST_PATH = "/manifest.preprod.json" +VITE_MANIFEST_PATH = "/manifest.staging.json" VITE_DEFAULT_LOCALE = en VITE_FALLBACK_LOCALE = en VITE_DEFAULT_COUNTRY = FR diff --git a/package.json b/package.json index 9255b4e871..90f742a8d3 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "dev": "vite", "build": "vite build", - "build-staging": "vite build --mode preprod", + "build-staging": "vite build --mode staging", "build-prod": "vite build --mode prod", "preview": "vite preview", "lint": "eslint", diff --git a/public/manifest.preprod.json b/public/manifest.staging.json similarity index 87% rename from public/manifest.preprod.json rename to public/manifest.staging.json index 9171910454..1a4bebca22 100644 --- a/public/manifest.preprod.json +++ b/public/manifest.staging.json @@ -1,6 +1,6 @@ { - "name": "Open Prices (Preprod)", - "short_name": "OpenPrices (Preprod)", + "name": "Open Prices (Staging)", + "short_name": "OpenPrices (Staging)", "description": "An open crowdsourced database of prices", "icons": [ { diff --git a/src/constants.js b/src/constants.js index 570fcce4b0..1c08a6fed9 100644 --- a/src/constants.js +++ b/src/constants.js @@ -17,12 +17,12 @@ const LOCATION_TYPE_ONLINE_ICON = 'mdi-web' export default { APP_NAME: 'Open Prices', - APP_URL: 'https://prices.openfoodfacts.org', - APP_API_URL: 'https://prices.openfoodfacts.org/api/docs', + APP_URL: import.meta.env.VITE_OPEN_PRICES_APP_URL, + APP_API_URL: `${import.meta.env.VITE_OPEN_PRICES_APP_URL}/api/docs`, APP_USER_AGENT: 'Open Prices Web App', - APP_DUMP_PRICES_URL: 'https://prices.openfoodfacts.org/data/prices.jsonl.gz', - APP_DUMP_PROOFS_URL: 'https://prices.openfoodfacts.org/data/proofs.jsonl.gz', - APP_DUMP_LOCATIONS_URL: 'https://prices.openfoodfacts.org/data/locations.jsonl.gz', + APP_DUMP_PRICES_URL: `${import.meta.env.VITE_OPEN_PRICES_APP_URL}/data/prices.jsonl.gz`, + APP_DUMP_PROOFS_URL: `${import.meta.env.VITE_OPEN_PRICES_APP_URL}/data/proofs.jsonl.gz`, + APP_DUMP_LOCATIONS_URL: `${import.meta.env.VITE_OPEN_PRICES_APP_URL}/data/locations.jsonl.gz`, APP_GITHUB_FRONTEND_URL: 'https://github.com/openfoodfacts/open-prices-frontend', OFF_NAME: OFF_NAME, OFF_URL: 'https://world.openfoodfacts.org',