diff --git a/.firebaserc b/.firebaserc index 7e6f0716d..5938f5a15 100644 --- a/.firebaserc +++ b/.firebaserc @@ -1,14 +1,14 @@ { "projects": { - "default": "social-income-staging", + "default": "social-income-local", "social-income-staging": "social-income-staging", "social-income-prod": "social-income-prod" }, "targets": { - "social-income-prod": { + "social-income-local": { "hosting": { "admin": [ - "si-admin-production" + "si-admin-local" ] } }, @@ -18,7 +18,14 @@ "si-admin-staging" ] } + }, + "social-income-prod": { + "hosting": { + "admin": [ + "si-admin-production" + ] + } } }, "etags": {} -} +} \ No newline at end of file diff --git a/admin/.env.development b/admin/.env.development index fcfbe22a8..8c8238deb 100644 --- a/admin/.env.development +++ b/admin/.env.development @@ -1,8 +1,8 @@ VITE_WEBSITE_BASE_URL="http://localhost:3001" VITE_ADMIN_FB_API_KEY="demo-key" -VITE_ADMIN_FB_AUTH_DOMAIN="social-income-staging" -VITE_ADMIN_FB_PROJECT_ID="social-income-staging" +VITE_ADMIN_FB_AUTH_DOMAIN="social-income-local" +VITE_ADMIN_FB_PROJECT_ID="social-income-local" VITE_ADMIN_FB_AUTH_EMULATOR_URL="http://localhost:9099" VITE_ADMIN_FB_FIRESTORE_EMULATOR_HOST="localhost" VITE_ADMIN_FB_FIRESTORE_EMULATOR_PORT="8080" diff --git a/admin/package.json b/admin/package.json index e0da2a474..3b9340c85 100644 --- a/admin/package.json +++ b/admin/package.json @@ -6,13 +6,13 @@ "scripts": { "build": "vite build", "serve": "vite serve", - "serve:emulator": "firebase emulators:exec --project social-income-staging --only firestore,auth --config ../firebase.json --import ../seed 'npm run serve'", - "test:emulator": "firebase emulators:exec --project social-income-staging --only firestore,auth --config ../firebase.json --import ../seed 'npm run test:local'", + "serve:emulator": "firebase emulators:exec --project social-income-local --only firestore,auth --config ../firebase.json --import ../seed 'npm run serve'", + "test:emulator": "firebase emulators:exec --project social-income-local --only firestore,auth --config ../firebase.json --import ../seed 'npm run test:local'", "test:local": "jest --forceExit --passWithNoTests --roots src", "test:playwright:local": "npx playwright install --with-deps && playwright test --trace on", "test:playwright:local:update": "npx playwright install --with-deps && playwright test --update-snapshots", - "test:playwright:emulator": "firebase emulators:exec --project social-income-staging --only firestore,auth --config ../firebase.json --import ../seed 'npm run test:playwright:local'", - "test:playwright:emulator:update": "firebase emulators:exec --project social-income-staging --only firestore,auth --config ../firebase.json --import ../seed 'npm run test:playwright:local:update'" + "test:playwright:emulator": "firebase emulators:exec --project social-income-local --only firestore,auth --config ../firebase.json --import ../seed 'npm run test:playwright:local'", + "test:playwright:emulator:update": "firebase emulators:exec --project social-income-local --only firestore,auth --config ../firebase.json --import ../seed 'npm run test:playwright:local:update'" }, "devDependencies": { "@firebase/rules-unit-testing": "^3.0.2", diff --git a/functions/.env.sample b/functions/.env.sample index da6ef5628..edf3aa772 100644 --- a/functions/.env.sample +++ b/functions/.env.sample @@ -1,22 +1,10 @@ -# These environment variables are required to run tests with the emulator locally -GCLOUD_PROJECT="social-income-staging" -FIRESTORE_EMULATOR_HOST=127.0.0.1:8080 -FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9099 - POSTFINANCE_PAYMENTS_FILES_BUCKET=postfinance-payments-files POSTFINANCE_FTP_HOST=ftp.postfinance.example POSTFINANCE_FTP_PORT=21 POSTFINANCE_FTP_USER=example -POSTFINANCE_FTP_RSA_PRIVATE_KEY=" ------BEGIN RSA PRIVATE KEY----- -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -... -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ------END RSA PRIVATE KEY----- -" +POSTFINANCE_FTP_RSA_PRIVATE_KEY_BASE64="CKSLI...." # To work with the Twilio API locally, configure the test credentials from Twilio in your .env file TWILIO_SID=ACXXXXXXXXXXXXXXXXXXXX TWILIO_TOKEN=yyyyyyyyyyyyyyyyyyyyy TWILIO_SENDER_PHONE=+15005550006 -#CLOUD_FUNCTIONS_URL=http://localhost:5001/social-income-staging/us-central1 diff --git a/functions/package.json b/functions/package.json index b847e40c1..20e2b7c20 100644 --- a/functions/package.json +++ b/functions/package.json @@ -10,10 +10,10 @@ "build": "tsc && npm run build:sync-files", "build:sync-files": "rsync -av --delete ../shared/assets dist/shared && rsync -av --delete ../shared/locales dist/shared && rsync -av --delete ../shared/templates dist/shared", "serve": "npm run build:sync-files && tsc --watch", - "test": "firebase emulators:exec --only firestore,storage,functions --project social-income-staging --config ../firebase.json 'npm run test:app'", + "test": "firebase emulators:exec --only firestore,storage,functions --project social-income-local --config ../firebase.json 'npm run test:app'", "test:app": "jest --forceExit --roots src/", - "test:playwright": "firebase emulators:exec --project social-income-staging --only firestore --config ../firebase.json --import ../seed 'npx playwright install --with-deps && playwright test'", - "test:playwright:update": "firebase emulators:exec --project social-income-staging --only firestore --config ../firebase.json --import ../seed 'npx playwright install --with-deps && playwright test --update-snapshots'" + "test:playwright": "firebase emulators:exec --project social-income-local --only firestore --config ../firebase.json --import ../seed 'npx playwright install --with-deps && playwright test'", + "test:playwright:update": "firebase emulators:exec --project social-income-local --only firestore --config ../firebase.json --import ../seed 'npx playwright install --with-deps && playwright test --update-snapshots'" }, "devDependencies": { "@jest/globals": "^29.7.0", diff --git a/package.json b/package.json index e02fd2a20..64255cc60 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "admin:test": "npm --workspace=@socialincome/admin run test:emulator", "admin:test:playwright": "npm --workspace=@socialincome/admin run test:playwright:emulator", "admin:test:playwright:update": "npm --workspace=@socialincome/admin run test:playwright:emulator:update", - "firebase:export": "firebase emulators:export --project social-income-staging --force ./seed", - "firebase:serve": "firebase emulators:start --project social-income-staging --config firebase.json --import ./seed", + "firebase:export": "firebase emulators:export --project social-income-local --force ./seed", + "firebase:serve": "firebase emulators:start --project social-income-local --config firebase.json --import ./seed", "format-code": "prettier --write .", "functions:build": "npm --workspace=@socialincome/functions run build", "functions:deploy": "npm --workspace=@socialincome/functions run deploy", diff --git a/shared/package.json b/shared/package.json index d45b51237..fa5f490b8 100644 --- a/shared/package.json +++ b/shared/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "private": true, "scripts": { - "test": "firebase emulators:exec --only firestore,storage,functions --project social-income-staging --config ../firebase.json --import ../seed 'npm run test:app'", + "test": "firebase emulators:exec --only firestore,storage,functions --project social-income-local --config ../firebase.json --import ../seed 'npm run test:app'", "test:app": "jest --forceExit --roots tests/ src/" }, "devDependencies": { diff --git a/website/.env.development b/website/.env.development index bdc72e7aa..b26b9b13d 100644 --- a/website/.env.development +++ b/website/.env.development @@ -1,5 +1,5 @@ # These environment variables are required so that the Firebase Admin SDK (server side) connects to the local emulator. -GCLOUD_PROJECT="social-income-staging" +GCLOUD_PROJECT="social-income-local" FIRESTORE_EMULATOR_HOST=127.0.0.1:8080 FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9099 diff --git a/website/package.json b/website/package.json index 0af76f8f9..542d64433 100644 --- a/website/package.json +++ b/website/package.json @@ -4,17 +4,17 @@ "private": true, "scripts": { "serve": "next dev -p 3001", - "serve:emulator": "firebase emulators:exec --project social-income-staging --only firestore --config ../firebase.json --import ../seed 'npm run serve'", + "serve:emulator": "firebase emulators:exec --project social-income-local --only firestore --config ../firebase.json --import ../seed 'npm run serve'", "build": "next build", - "build:emulator": "firebase emulators:exec --project social-income-staging --only firestore --config ../firebase.json --import ../seed 'npm run build'", + "build:emulator": "firebase emulators:exec --project social-income-local --only firestore --config ../firebase.json --import ../seed 'npm run build'", "start": "next start -p 3001", - "start:emulator": "firebase emulators:exec --project social-income-staging --only firestore --config ../firebase.json --import ../seed 'npm run start'", + "start:emulator": "firebase emulators:exec --project social-income-local --only firestore --config ../firebase.json --import ../seed 'npm run start'", "test": "jest --passWithNoTests", - "test:emulator": "firebase emulators:exec --project social-income-staging --only firestore --config ../firebase.json --import ../seed 'npm run test'", + "test:emulator": "firebase emulators:exec --project social-income-local --only firestore --config ../firebase.json --import ../seed 'npm run test'", "test:e2e": "npx playwright install --with-deps && playwright test", - "test:e2e:emulator": "firebase emulators:exec --project social-income-staging --only firestore --config ../firebase.json --import ../seed 'npm run test:e2e'", + "test:e2e:emulator": "firebase emulators:exec --project social-income-local --only firestore --config ../firebase.json --import ../seed 'npm run test:e2e'", "test:e2e:update": "npx playwright install --with-deps && playwright test --update-snapshots", - "test:e2e:update:emulator": "firebase emulators:exec --project social-income-staging --only firestore --config ../firebase.json --import ../seed 'npm run test:e2e:update'", + "test:e2e:update:emulator": "firebase emulators:exec --project social-income-local --only firestore --config ../firebase.json --import ../seed 'npm run test:e2e:update'", "lint": "next lint" }, "dependencies": {