Skip to content

Commit 0eccd9d

Browse files
committed
Merge branch 'staging' of https://github.com/sparkletown/sparkle into feature/banner-announcement
2 parents e09f0d4 + 23dfd82 commit 0eccd9d

File tree

164 files changed

+4277
-1080
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+4277
-1080
lines changed

.circleci/config.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,24 @@ jobs:
149149
if [ $CIRCLE_BRANCH = "env/pa" ]; then
150150
ENV=sparkle-pa
151151
fi
152+
if [ $CIRCLE_BRANCH = "env/demo" ]; then
153+
ENV=sparkle-demo-e65b1
154+
fi
155+
if [ $CIRCLE_BRANCH = "env/unity" ]; then
156+
ENV=sparkle-unity
157+
fi
158+
if [ $CIRCLE_BRANCH = "env/clever" ]; then
159+
ENV=sparkle-clever
160+
fi
161+
if [ $CIRCLE_BRANCH = "env/burn" ]; then
162+
ENV=sparkle-burn
163+
fi
164+
if [ $CIRCLE_BRANCH = "env/burn-staging" ]; then
165+
ENV=sparkle-burn-staging
166+
fi
167+
if [ $CIRCLE_BRANCH = "env/github" ]; then
168+
ENV=sparkle-github
169+
fi
152170
153171
./node_modules/.bin/firebase use $ENV --token "$FIREBASE_TOKEN"
154172
@@ -287,6 +305,42 @@ jobs:
287305
TARGET=sparkle-pa
288306
RELEASE_STAGE=env/pa
289307
fi
308+
if [ $CIRCLE_BRANCH = "env/demo" ]; then
309+
PREFIX=DEMO_
310+
ENV=sparkle-demo-e65b1
311+
TARGET=sparkle-demo-e65b1
312+
RELEASE_STAGE=env/demo
313+
fi
314+
if [ $CIRCLE_BRANCH = "env/unity" ]; then
315+
PREFIX=UNITY_
316+
ENV=sparkle-unity
317+
TARGET=sparkle-unity
318+
RELEASE_STAGE=env/unity
319+
fi
320+
if [ $CIRCLE_BRANCH = "env/clever" ]; then
321+
PREFIX=CLEVER_
322+
ENV=sparkle-clever
323+
TARGET=sparkle-clever
324+
RELEASE_STAGE=env/clever
325+
fi
326+
if [ $CIRCLE_BRANCH = "env/burn" ]; then
327+
PREFIX=BURN_
328+
ENV=sparkle-burn
329+
TARGET=sparkle-burn
330+
RELEASE_STAGE=env/burn
331+
fi
332+
if [ $CIRCLE_BRANCH = "env/burn-staging" ]; then
333+
PREFIX=BURN_STAGING_
334+
ENV=sparkle-burn-staging
335+
TARGET=sparkle-burn-staging
336+
RELEASE_STAGE=env/burn-staging
337+
fi
338+
if [ $CIRCLE_BRANCH = "env/github" ]; then
339+
PREFIX=GITHUB_
340+
ENV=sparkle-github
341+
TARGET=sparkle-github
342+
RELEASE_STAGE=env/github
343+
fi
290344
291345
./scripts/init-env.sh $PREFIX
292346
@@ -345,6 +399,12 @@ workflows:
345399
- env/unesco
346400
- env/ohbm
347401
- env/pa
402+
- env/demo
403+
- env/unity
404+
- env/clever
405+
- env/burn
406+
- env/burn-staging
407+
- env/github
348408
- deploy-hosting:
349409
requires:
350410
- lint-and-test
@@ -371,6 +431,12 @@ workflows:
371431
- env/unesco
372432
- env/ohbm
373433
- env/pa
434+
- env/demo
435+
- env/unity
436+
- env/clever
437+
- env/burn
438+
- env/burn-staging
439+
- env/github
374440
# - smoke-test:
375441
# requires:
376442
# - deploy-functions

.firebaserc

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020
"memrise": "sparkle-memrise",
2121
"unesco": "sparkle-unesco",
2222
"ohbm": "sparkle-ohbm",
23-
"sparkle-pa": "sparkle-pa"
23+
"sparkle-pa": "sparkle-pa",
24+
"sparkle-demo-e65b1": "sparkle-demo-e65b1",
25+
"sparkle-clever": "sparkle-clever",
26+
"sparkle-unity": "sparkle-unity",
27+
"sparkle-burn": "sparkle-burn",
28+
"sparkle-burn-staging": "sparkle-burn-staging",
29+
"sparkle-github": "sparkle-github"
2430
},
2531
"targets": {
2632
"co-reality-map": {
@@ -175,6 +181,48 @@
175181
"sparkle-pa"
176182
]
177183
}
184+
},
185+
"sparkle-demo-e65b1": {
186+
"hosting": {
187+
"sparkle-demo-e65b1": [
188+
"sparkle-demo-e65b1"
189+
]
190+
}
191+
},
192+
"sparkle-unity": {
193+
"hosting": {
194+
"sparkle-unity": [
195+
"sparkle-unity"
196+
]
197+
}
198+
},
199+
"sparkle-clever": {
200+
"hosting": {
201+
"sparkle-clever": [
202+
"sparkle-clever"
203+
]
204+
}
205+
},
206+
"sparkle-burn": {
207+
"hosting": {
208+
"sparkle-burn": [
209+
"sparkle-burn"
210+
]
211+
}
212+
},
213+
"sparkle-burn-staging": {
214+
"hosting": {
215+
"sparkle-burn-staging": [
216+
"sparkle-burn-staging"
217+
]
218+
}
219+
},
220+
"sparkle-github": {
221+
"hosting": {
222+
"sparkle-github": [
223+
"sparkle-github"
224+
]
225+
}
178226
}
179227
}
180228
}

.github/workflows/firebase-hosting-pull-request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
REACT_APP_PROJECT_ID: '${{ secrets.FIREBASE_PROJECT_ID }}'
3333
REACT_APP_API_KEY: '${{ secrets.FIREBASE_API_KEY }}'
3434
REACT_APP_APP_ID: '${{ secrets.FIREBASE_APP_ID }}'
35+
REACT_APP_AUTH_DOMAIN: '${{ secrets.FIREBASE_AUTH_DOMAIN }}'
3536
REACT_APP_MEASUREMENT_ID: '${{ secrets.FIREBASE_MEASUREMENT_ID }}'
3637
REACT_APP_BUCKET_URL: '${{ secrets.FIREBASE_BUCKET_URL }}'
3738
REACT_APP_STRIPE_PUBLISHABLE_KEY: '${{ secrets.STRIPE_PUBLISHABLE_KEY }}'

README.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ npm run firebase login
7373
npm run firebase use staging
7474

7575
# Copy the runtime config locally
76-
npm run --silent firebase functions:config:get > .runtimeconfig.json
76+
npm run --silent firebase functions:config:get > ./functions/.runtimeconfig.json
7777
```
7878

7979
Now you're ready to launch the backend function emulator! ✨
@@ -86,6 +86,50 @@ npm run firebase:emulate-functions
8686
# npm run firebase emulators:start --only functions
8787
```
8888

89+
### Firebase emulators
90+
91+
Instead of running just the functions' emulator, the full suite of emulators can be used.
92+
You can find out more at https://firebase.google.com/docs/emulator-suite.
93+
94+
**Note**: If your code accidentally invokes non-emulated (production) resources, there is a chance of data change, usage and billing.
95+
To prevent this, you might opt in to use a Firebase project name beginning with `demo-` (e.g. `demo-staging`) in which case no production resources will be used.
96+
97+
First though, a **major version of 8** for the Firebase client is required:
98+
```bash
99+
npm i firebase@8
100+
```
101+
This might entail some code changes as well, to enable the emulation, e.g.
102+
```javascript
103+
// Enable the functions emulator when running in development at specific port
104+
if (process.env.NODE_ENV === "development" && window.location.port === "5000") {
105+
firebaseApp.firestore().useEmulator("localhost", 8080);
106+
}
107+
```
108+
or to account for changed and/or deprecated Firebase client API, e.g.
109+
```javascript
110+
// deprecated
111+
// import firebase, { UserInfo } from "firebase/app";
112+
// use instead
113+
import firebase from "firebase/app";
114+
type UserInfo = firebase.UserInfo;
115+
```
116+
117+
You can start the emulators in a manner that can persist the data locally:
118+
```bash
119+
npx --no-install -- firebase "emulators:start" --import=./tmp --export-on-exit
120+
```
121+
122+
You should be greeted with
123+
```bash
124+
All emulators ready! View status and logs at http://localhost:4000
125+
```
126+
That's the location you can access and manage the running emulators.
127+
The data between emulator runs should be persisted at
128+
```bash
129+
tmp/firebase-export-metadata.json
130+
tmp/firestore_export
131+
```
132+
89133
### Stripe
90134

91135
**Note**: Stripe is NOT REQUIRED unless you will be testing ticketing integration.

firebase.json

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@
3333
"target": "staging",
3434
"public": "build",
3535
"rewrites": [
36+
{
37+
"source": "/auth/connect/i4a",
38+
"function": "auth-connectI4AOAuth"
39+
},
40+
{
41+
"source": "/auth/connect/i4a/handler",
42+
"function": "auth-connectI4AOAuthHandler"
43+
},
3644
{
3745
"source": "**",
3846
"destination": "/index.html"
@@ -220,6 +228,14 @@
220228
"target": "sparkle-ohbm",
221229
"public": "build",
222230
"rewrites": [
231+
{
232+
"source": "/auth/connect/i4a",
233+
"function": "auth-connectI4AOAuth"
234+
},
235+
{
236+
"source": "/auth/connect/i4a/handler",
237+
"function": "auth-connectI4AOAuthHandler"
238+
},
223239
{
224240
"source": "**",
225241
"destination": "/index.html"
@@ -237,6 +253,72 @@
237253
}
238254
],
239255
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
256+
},
257+
{
258+
"target": "sparkle-demo-e65b1",
259+
"public": "build",
260+
"rewrites": [
261+
{
262+
"source": "**",
263+
"destination": "/index.html"
264+
}
265+
],
266+
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
267+
},
268+
{
269+
"target": "sparkle-unity",
270+
"public": "build",
271+
"rewrites": [
272+
{
273+
"source": "**",
274+
"destination": "/index.html"
275+
}
276+
],
277+
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
278+
},
279+
{
280+
"target": "sparkle-clever",
281+
"public": "build",
282+
"rewrites": [
283+
{
284+
"source": "**",
285+
"destination": "/index.html"
286+
}
287+
],
288+
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
289+
},
290+
{
291+
"target": "sparkle-burn",
292+
"public": "build",
293+
"rewrites": [
294+
{
295+
"source": "**",
296+
"destination": "/index.html"
297+
}
298+
],
299+
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
300+
},
301+
{
302+
"target": "sparkle-burn-staging",
303+
"public": "build",
304+
"rewrites": [
305+
{
306+
"source": "**",
307+
"destination": "/index.html"
308+
}
309+
],
310+
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
311+
},
312+
{
313+
"target": "sparkle-github",
314+
"public": "build",
315+
"rewrites": [
316+
{
317+
"source": "**",
318+
"destination": "/index.html"
319+
}
320+
],
321+
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
240322
}
241323
],
242324
"functions": {

firestore.rules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ function role(name) {
1010

1111
service cloud.firestore {
1212
match /databases/{database}/documents {
13+
match /authConfigs/{authConfigId} {
14+
allow read, write: if false;
15+
}
1316
match /config/{configFile} {
1417
allow read: if true;
1518
allow write: if request.auth.uid != null;

0 commit comments

Comments
 (0)