@edgedev/create-edge-app 1.1.21 → 1.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env CHANGED
@@ -5,6 +5,7 @@ VITE_FIREBASE_STORAGE_BUCKET=
5
5
  VITE_FIREBASE_MESSAGING_SENDER_ID=
6
6
  VITE_FIREBASE_APP_ID=
7
7
  VITE_FIREBASE_MEASUREMENT_ID=
8
+ VITE_FIREBASE_FUNCTIONS_REGION=us-west1
8
9
  VITE_FIREBASE_EMULATOR_AUTH=
9
10
  VITE_FIREBASE_EMULATOR_FIRESTORE=
10
11
  VITE_FIREBASE_EMULATOR_FUNCTIONS=
package/.env.dev CHANGED
@@ -5,6 +5,7 @@ VITE_FIREBASE_STORAGE_BUCKET=
5
5
  VITE_FIREBASE_MESSAGING_SENDER_ID=
6
6
  VITE_FIREBASE_APP_ID=
7
7
  VITE_FIREBASE_MEASUREMENT_ID=
8
+ VITE_FIREBASE_FUNCTIONS_REGION=us-west1
8
9
  VITE_FIREBASE_EMULATOR_AUTH=9099
9
10
  VITE_FIREBASE_EMULATOR_FIRESTORE=8080
10
11
  VITE_FIREBASE_EMULATOR_FUNCTIONS=5001
package/firebase.json CHANGED
@@ -25,7 +25,10 @@
25
25
  "rewrites": [
26
26
  {
27
27
  "source": "/api/stripe",
28
- "function": "stripe-webhook"
28
+ "function": {
29
+ "functionId": "stripe-webhook",
30
+ "region": "us-west1"
31
+ }
29
32
  },
30
33
  {
31
34
  "source": "**",
@@ -60,4 +63,4 @@
60
63
  },
61
64
  "singleProjectMode": true
62
65
  }
63
- }
66
+ }
package/firebase_init.sh CHANGED
@@ -1,19 +1,32 @@
1
1
  # Prompt for the Firebase configuration values
2
2
  echo "Please enter your Firebase project ID:"
3
3
  read project_id
4
+
4
5
  echo "Please enter your Firebase API key:"
5
6
  read api_key
7
+
6
8
  echo "Please enter your Firebase Auth domain:"
7
9
  read auth_domain
10
+
8
11
  echo "Please enter your Firebase storage bucket:"
9
12
  read storage_bucket
13
+
10
14
  echo "Please enter your Firebase messaging sender ID:"
11
15
  read messaging_sender_id
16
+
12
17
  echo "Please enter your Firebase app ID:"
13
18
  read app_id
19
+
14
20
  echo "Please enter your Firebase measurement ID:"
15
21
  read measurement_id
16
22
 
23
+ echo "Please enter your Firebase Functions region (default: us-west1):"
24
+ read functions_region
25
+
26
+ if [ -z "$functions_region" ]; then
27
+ functions_region="us-west1"
28
+ fi
29
+
17
30
  # Check if project_id is empty
18
31
  if [ -z "$project_id" ]; then
19
32
  echo "Error: Firebase project ID cannot be empty."
@@ -26,26 +39,26 @@ if ! command -v firebase &> /dev/null; then
26
39
  exit 1
27
40
  fi
28
41
 
29
- # Check if firebase.json exists and make a backup
42
+ # Backup firebase.json if it exists
30
43
  if [ -f ./firebase.json ]; then
31
44
  cp ./firebase.json ./firebase.json.temp
32
45
  fi
33
46
 
34
- # Check if firestore.rules exists and make a backup
47
+ # Backup firestore.rules if it exists
35
48
  if [ -f ./firestore.rules ]; then
36
49
  cp ./firestore.rules ./firestore.rules.temp
37
50
  fi
38
51
 
39
52
  # Initialize Firebase
40
- firebase use --add $project_id --alias default
53
+ firebase use --add "$project_id" --alias default
41
54
  firebase init firestore functions hosting storage emulators --project default
42
55
 
43
- # Restore firebase.json from backup
56
+ # Restore firebase.json
44
57
  if [ -f ./firebase.json.temp ]; then
45
58
  mv ./firebase.json.temp ./firebase.json
46
59
  fi
47
60
 
48
- # Restore firestore.rules from backup
61
+ # Restore firestore.rules
49
62
  if [ -f ./firestore.rules.temp ]; then
50
63
  mv ./firestore.rules.temp ./firestore.rules
51
64
  fi
@@ -58,6 +71,7 @@ echo "VITE_FIREBASE_STORAGE_BUCKET=$storage_bucket" >> .env
58
71
  echo "VITE_FIREBASE_MESSAGING_SENDER_ID=$messaging_sender_id" >> .env
59
72
  echo "VITE_FIREBASE_APP_ID=$app_id" >> .env
60
73
  echo "VITE_FIREBASE_MEASUREMENT_ID=$measurement_id" >> .env
74
+ echo "VITE_FIREBASE_FUNCTIONS_REGION=$functions_region" >> .env
61
75
  echo "VITE_FIREBASE_EMULATOR_AUTH=" >> .env
62
76
  echo "VITE_FIREBASE_EMULATOR_FIRESTORE=" >> .env
63
77
  echo "VITE_FIREBASE_EMULATOR_FUNCTIONS=" >> .env
@@ -73,9 +87,10 @@ echo "VITE_FIREBASE_STORAGE_BUCKET=$storage_bucket" >> .env.dev
73
87
  echo "VITE_FIREBASE_MESSAGING_SENDER_ID=$messaging_sender_id" >> .env.dev
74
88
  echo "VITE_FIREBASE_APP_ID=$app_id" >> .env.dev
75
89
  echo "VITE_FIREBASE_MEASUREMENT_ID=$measurement_id" >> .env.dev
90
+ echo "VITE_FIREBASE_FUNCTIONS_REGION=$functions_region" >> .env.dev
76
91
  echo "VITE_FIREBASE_EMULATOR_AUTH=9099" >> .env.dev
77
92
  echo "VITE_FIREBASE_EMULATOR_FIRESTORE=8080" >> .env.dev
78
93
  echo "VITE_FIREBASE_EMULATOR_FUNCTIONS=5001" >> .env.dev
79
94
  echo "VITE_FIREBASE_EMULATOR_STORAGE=9199" >> .env.dev
80
95
  echo "REGISTRATION_CODE=organization-registration-template" >> .env.dev
81
- echo "DEVELOPMENT_MODE=true" >> .env.dev
96
+ echo "DEVELOPMENT_MODE=true" >> .env.dev
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgedev/create-edge-app",
3
- "version": "1.1.21",
3
+ "version": "1.1.25",
4
4
  "description": "Create Edge Starter App",
5
5
  "bin": {
6
6
  "create-edge-app": "./bin/cli.js"
@@ -13,5 +13,6 @@ export default defineNuxtPlugin((nuxtApp) => {
13
13
  emulatorFirestore: import.meta.env.VITE_FIREBASE_EMULATOR_FIRESTORE,
14
14
  emulatorFunctions: import.meta.env.VITE_FIREBASE_EMULATOR_FUNCTIONS,
15
15
  emulatorStorage: import.meta.env.VITE_FIREBASE_EMULATOR_STORAGE,
16
+ functionsRegion: import.meta.env.VITE_FIREBASE_FUNCTIONS_REGION,
16
17
  }, true, true)
17
18
  })