Skip to content

Commit

Permalink
refactor(database)!: rework as part of #6979 (#7202)
Browse files Browse the repository at this point in the history
Co-authored-by: ehesp <[email protected]>
Co-authored-by: Andrei Lesnitsky <[email protected]>
Co-authored-by: Elliot Hesp <[email protected]>
Co-authored-by: russellwheatley <[email protected]>
  • Loading branch information
4 people authored Dec 3, 2021
1 parent c88cbb0 commit 312d60f
Show file tree
Hide file tree
Showing 114 changed files with 6,916 additions and 3,494 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/firebase_database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ on:
env:
FLUTTERFIRE_PLUGIN_SCOPE: "*firebase_database*"
FLUTTERFIRE_PLUGIN_SCOPE_EXAMPLE: "*firebase_database_example*"
# TODO(Salakar): `flutter_driver` does not yet support NNBD
FLUTTER_COMMAND_FLAGS: "--no-sound-null-safety"

jobs:
android:
Expand All @@ -34,9 +32,13 @@ jobs:
- name: "Install Flutter"
run: ./.github/workflows/scripts/install-flutter.sh stable
- name: "Install Tools"
run: ./.github/workflows/scripts/install-tools.sh
run: |
./.github/workflows/scripts/install-tools.sh
sudo npm i -g firebase-tools
- name: "Build Example"
run: ./.github/workflows/scripts/build-example.sh android
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: "Drive Example"
uses: reactivecircus/android-emulator-runner@v2
with:
Expand All @@ -61,8 +63,11 @@ jobs:
run: |
./.github/workflows/scripts/install-tools.sh
flutter config --enable-macos-desktop
sudo npm i -g firebase-tools
- name: "Build iOS Example"
run: ./.github/workflows/scripts/build-example.sh ios
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: "Drive iOS Example"
run: ./.github/workflows/scripts/drive-example.sh ios
- name: "Build MacOS Example"
Expand All @@ -82,6 +87,8 @@ jobs:
- name: "Install Tools"
run: |
./.github/workflows/scripts/install-tools.sh
flutter config --enable-web
sudo npm i -g firebase-tools
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: "Drive Example"
run: ./.github/workflows/scripts/drive-example.sh web
33 changes: 33 additions & 0 deletions .github/workflows/scripts/database.rules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"rules": {
".read": false,
".write": false,
"denied_read": {
".read": false,
".write": false
},
"messages": {
".read": true,
".write": true
},
"counter": {
".read": true,
".write": true
},
"tests": {
".read": true,
".write": true,
".indexOn": [
".value",
"number"
],
"ordered": {
".read": true,
".write": true,
".indexOn": [
"value"
]
}
}
}
}
6 changes: 6 additions & 0 deletions .github/workflows/scripts/firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"firestore": {
"rules": "firestore.rules"
},
"database": {
"rules": "database.rules.json"
},
"functions": {
"predeploy": "npm --prefix \"$RESOURCE_DIR\" run build",
"source": "functions"
Expand All @@ -16,6 +19,9 @@
"storage": {
"port": "9199"
},
"database": {
"port": "9000"
},
"ui": {
"enabled": true,
"port": 4000
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"logs": "firebase functions:log"
},
"engines": {
"node": "12"
"node": "16"
},
"main": "lib/index.js",
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scripts/start-firebase-emulator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [[ ! -d "functions/node_modules" ]]; then
fi

export STORAGE_EMULATOR_DEBUG=true
EMU_START_COMMAND="firebase emulators:start --only auth,firestore,functions,storage --project react-native-firebase-testing"
EMU_START_COMMAND="firebase emulators:start --only auth,firestore,functions,storage,database --project react-native-firebase-testing"

MAX_RETRIES=3
MAX_CHECKATTEMPTS=60
Expand Down Expand Up @@ -53,4 +53,4 @@ while [ $RETRIES -le $MAX_RETRIES ]; do

done
echo "Firebase Emulator Suite did not come online after $MAX_RETRIES attempts."
exit 1
exit 1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,5 @@ yarn-error.log*

firebase-debug.log
firestore-debug.log
database-debug.log
ui-debug.log
Loading

0 comments on commit 312d60f

Please sign in to comment.