react-native-update 10.28.5 → 10.28.6

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/package.json CHANGED
@@ -1,29 +1,29 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "10.28.5",
3
+ "version": "10.28.6",
4
4
  "description": "react-native hot update",
5
5
  "main": "src/index",
6
6
  "scripts": {
7
7
  "postinstall": "node scripts/check-expo-version.js",
8
- "prepack": "yarn submodule && yarn lint",
8
+ "prepack": "bun submodule && bun lint",
9
9
  "lint": "eslint \"src/*.@(ts|tsx|js|jsx)\" && tsc --noEmit",
10
10
  "submodule": "git submodule update --init --recursive",
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
- "build-lib": "yarn submodule && $ANDROID_HOME/ndk/20.1.5948944/ndk-build NDK_PROJECT_PATH=android APP_BUILD_SCRIPT=android/jni/Android.mk NDK_APPLICATION_MK=android/jni/Application.mk NDK_LIBS_OUT=android/lib",
13
- "build:ios-debug": "cd Example/testHotUpdate && yarn && detox build --configuration ios.sim.debug",
14
- "build:ios-release": "cd Example/testHotUpdate && yarn && detox build --configuration ios.sim.release",
12
+ "build-lib": "bun submodule && $ANDROID_HOME/ndk/20.1.5948944/ndk-build NDK_PROJECT_PATH=android APP_BUILD_SCRIPT=android/jni/Android.mk NDK_APPLICATION_MK=android/jni/Application.mk NDK_LIBS_OUT=android/lib",
13
+ "build:ios-debug": "cd Example/testHotUpdate && bun && detox build --configuration ios.sim.debug",
14
+ "build:ios-release": "cd Example/testHotUpdate && bun && detox build --configuration ios.sim.release",
15
15
  "test:ios-debug": "cd Example/testHotUpdate && detox test --configuration ios.sim.debug",
16
- "test:ios-release": "cd Example/testHotUpdate && yarn detox test --configuration ios.sim.release",
17
- "build:android-debug": "cd Example/testHotUpdate && yarn && detox build --configuration android.emu.debug",
18
- "build:android-release": "cd Example/testHotUpdate && yarn && detox build --configuration android.emu.release",
19
- "test:android-release": "cd Example/testHotUpdate && yarn detox test --configuration android.emu.release --headless --record-logs all",
16
+ "test:ios-release": "cd Example/testHotUpdate && bun detox test --configuration ios.sim.release",
17
+ "build:android-debug": "cd Example/testHotUpdate && bun && detox build --configuration android.emu.debug",
18
+ "build:android-release": "cd Example/testHotUpdate && bun && detox build --configuration android.emu.release",
19
+ "test:android-release": "cd Example/testHotUpdate && bun detox test --configuration android.emu.release --headless --record-logs all",
20
20
  "test:android-debug": "cd Example/testHotUpdate && detox test --configuration android.emu.debug --headless --record-logs all",
21
- "e2e:ios": "npm run build:ios-release && npm run test:ios-release",
22
- "e2e:android": "npm run build:android-release && npm run test:android-release",
23
- "tests:emulator:prepare": "cd .github/workflows/scripts/functions && yarn && yarn build",
24
- "tests:emulator:start-ci": "yarn tests:emulator:prepare && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh",
21
+ "e2e:ios": "bun build:ios-release && bun test:ios-release",
22
+ "e2e:android": "bun build:android-release && bun test:android-release",
23
+ "tests:emulator:prepare": "cd .github/workflows/scripts/functions && bun && bun build",
24
+ "tests:emulator:start-ci": "bun tests:emulator:prepare && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh",
25
25
  "tests:packager:jet-ci": "cd Example/testHotUpdate && cross-env TMPDIR=$HOME/.metro REACT_DEBUGGER=\"echo nope\" node_modules/.bin/react-native start --no-interactive",
26
- "tests:ios:pod:install": "cd Example/testHotUpdate && yarn && yarn pod-install"
26
+ "tests:ios:pod:install": "cd Example/testHotUpdate && bun && bun pod-install"
27
27
  },
28
28
  "repository": {
29
29
  "type": "git",
@@ -75,6 +75,5 @@
75
75
  "react-native": "0.73",
76
76
  "ts-jest": "^29.2.5",
77
77
  "typescript": "^5.6.3"
78
- },
79
- "packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
78
+ }
80
79
  }
@@ -1,49 +0,0 @@
1
- name: e2e-android
2
- on: push
3
-
4
- jobs:
5
- e2e-android:
6
- runs-on: macos-latest
7
- steps:
8
- - name: Checkout repository
9
- uses: actions/checkout@v3
10
-
11
- - name: Setup Node.js
12
- uses: actions/setup-node@v3
13
- with:
14
- cache: yarn
15
- node-version-file: .nvmrc
16
-
17
- - name: Install Yarn dependencies
18
- run: yarn --frozen-lockfile --prefer-offline
19
-
20
- - name: Setup Java
21
- uses: actions/setup-java@v3
22
- with:
23
- cache: gradle
24
- distribution: temurin
25
- java-version: 17
26
-
27
- - name: Cache Detox build
28
- id: cache-detox-build
29
- uses: actions/cache@v3
30
- with:
31
- path: android/app/build
32
- key: ${{ runner.os }}-detox-build
33
- restore-keys: |
34
- ${{ runner.os }}-detox-build
35
-
36
- - name: Detox build
37
- run: yarn build:android-debug
38
-
39
- - name: Get device name
40
- id: device
41
- run: node -e "console.log('AVD_NAME=' + require('./Example/testHotUpdate/.detoxrc').devices.emulator.device.avdName)" >> $GITHUB_OUTPUT
42
-
43
- - name: Detox test
44
- uses: reactivecircus/android-emulator-runner@v2
45
- with:
46
- api-level: 31
47
- arch: x86_64
48
- avd-name: ${{ steps.device.outputs.AVD_NAME }}
49
- script: yarn test:android-debug
@@ -1,182 +0,0 @@
1
- name: Testing E2E iOS
2
-
3
- on:
4
- pull_request:
5
- branches:
6
- - '**'
7
- paths-ignore:
8
- - 'docs/**'
9
- - 'website/**'
10
- - '.spellcheck.dict.txt'
11
- - '**/*.md'
12
-
13
- push:
14
- branches:
15
- - master
16
- paths-ignore:
17
- - 'docs/**'
18
- - 'website/**'
19
- - '.spellcheck.dict.txt'
20
- # - '**/*.md'
21
-
22
- concurrency:
23
- group: ${{ github.workflow }}-${{ github.ref }}
24
- cancel-in-progress: true
25
-
26
- jobs:
27
- ios:
28
- name: iOS
29
- runs-on: macos-14-arm64
30
- # TODO matrix across APIs, at least 11 and 15 (lowest to highest)
31
- timeout-minutes: 60
32
- env:
33
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
34
- steps:
35
- # Set up tool versions
36
- - uses: actions/setup-node@v4
37
- with:
38
- node-version: 18
39
-
40
- - name: Configure JDK 1.11
41
- uses: actions/setup-java@v3
42
- with:
43
- distribution: 'temurin'
44
- java-version: '11'
45
-
46
- - uses: maxim-lobanov/setup-xcode@v1
47
- with:
48
- xcode-version: 'latest-stable'
49
-
50
- - uses: actions/checkout@v3
51
- with:
52
- fetch-depth: 50
53
-
54
- # Set path variables needed for caches
55
- - name: Set workflow variables
56
- id: workflow-variables
57
- run: |
58
- echo "metro-cache=$HOME/.metro" >> $GITHUB_OUTPUT
59
- echo "xcode-version=$(xcodebuild -version|tail -1|cut -f3 -d' ')" >> $GITHUB_OUTPUT
60
- echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
61
-
62
- - uses: actions/cache@v3
63
- name: Yarn Cache
64
- id: yarn-cache
65
- with:
66
- path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
67
- key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
68
- restore-keys: ${{ runner.os }}-yarn-v1
69
-
70
- - uses: actions/cache@v3
71
- name: Detox Framework Cache
72
- id: detox-cache
73
- with:
74
- path: ~/Library/Detox/ios
75
- key: ${{ runner.os }}-detox-framework-cache-${{ steps.workflow-variables.outputs.xcode-version }}
76
-
77
- # Detox is compiled during yarn install, using Xcode, set up cache first
78
- - uses: hendrikmuhs/ccache-action@v1.2
79
- name: Xcode Compile Cache
80
- with:
81
- key: ${{ runner.os }}-v2 # makes a unique key w/related restore key internally
82
- max-size: 1500M
83
-
84
- - name: Yarn Install
85
- uses: nick-invision/retry@v2
86
- with:
87
- timeout_minutes: 10
88
- retry_wait_seconds: 60
89
- max_attempts: 3
90
- command: yarn --no-audit --prefer-offline
91
-
92
- - name: Setup Ruby
93
- uses: ruby/setup-ruby@v1
94
- with:
95
- ruby-version: 3
96
-
97
- - name: Update Ruby build tools
98
- uses: nick-invision/retry@v2
99
- with:
100
- timeout_minutes: 2
101
- retry_wait_seconds: 60
102
- max_attempts: 3
103
- command: gem update cocoapods xcodeproj
104
-
105
- - uses: actions/cache@v3
106
- name: Cache Pods
107
- id: pods-cache
108
- with:
109
- path: tests/ios/Pods
110
- key: ${{ runner.os }}-pods-v2-${{ hashFiles('tests/ios/Podfile.lock') }}
111
- restore-keys: ${{ runner.os }}-pods-v2
112
-
113
- - name: Pod Install
114
- uses: nick-invision/retry@v2
115
- with:
116
- timeout_minutes: 10
117
- retry_wait_seconds: 30
118
- max_attempts: 3
119
- command: yarn tests:ios:pod:install
120
-
121
- - name: Cache Firestore Emulator
122
- uses: actions/cache@v3
123
- with:
124
- path: ~/.cache/pushy/emulators
125
- key: pushy-emulators-v1-${{ github.run_id }}
126
- restore-keys: pushy-emulators-v1
127
-
128
- - name: Start Firestore Emulator
129
- run: yarn tests:emulator:start-ci
130
-
131
- - name: Install brew utilities
132
- uses: nick-invision/retry@v2
133
- with:
134
- timeout_minutes: 5
135
- retry_wait_seconds: 60
136
- max_attempts: 3
137
- command: HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew && HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils xcbeautify && applesimutils --list
138
-
139
- - name: Build iOS App
140
- run: |
141
- export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
142
- export CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
143
- export CCACHE_FILECLONE=true
144
- export CCACHE_DEPEND=true
145
- export CCACHE_INODECACHE=true
146
- export CCACHE_LIMIT_MULTIPLE=0.95
147
- ccache -s
148
- export SKIP_BUNDLING=1
149
- export RCT_NO_LAUNCH_PACKAGER=1
150
- set -o pipefail
151
- yarn build:ios-debug
152
- ccache -s
153
- shell: bash
154
-
155
- - name: Metro Bundler Cache
156
- uses: actions/cache@v3
157
- with:
158
- path: ${{ steps.workflow-variables.outputs.metro-cache }}
159
- key: ${{ runner.os }}-metro-v1-${{ github.run_id }}
160
- restore-keys: ${{ runner.os }}-metro-v1
161
-
162
- - name: Pre-fetch Javascript bundle
163
- run: |
164
- nohup yarn tests:packager:jet-ci &
165
- printf 'Waiting for packager to come online'
166
- until curl --output /dev/null --silent --head --fail http://localhost:8081/status; do
167
- printf '.'
168
- sleep 2
169
- done
170
- echo "Packager is online! Preparing bundle..."
171
- curl --output /dev/null --silent --head --fail "http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&inlineSourceMap=true"
172
- echo "...javascript bundle ready"
173
-
174
- - name: Create Simulator Log
175
- # With a little delay so the detox test below has time to spawn it, missing the first part of boot is fine
176
- # If you boot the simulator separately from detox, some other race fails and detox testee never sends ready to proxy
177
- continue-on-error: true
178
- run: nohup sh -c "sleep 30 && xcrun simctl spawn booted log stream --level debug --style compact > simulator.log 2>&1 &"
179
-
180
- - name: Detox Test
181
- timeout-minutes: 60
182
- run: yarn test:ios-debug
@@ -1,47 +0,0 @@
1
- name: lint
2
-
3
- on:
4
- pull_request:
5
- branches:
6
- - master
7
- push:
8
- branches:
9
- - master
10
-
11
- # Cancel a currently running workflow from the same PR/branch/tag
12
- # when a new workflow is triggered
13
- concurrency:
14
- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15
- cancel-in-progress: true
16
-
17
- jobs:
18
- lint:
19
- runs-on: ubuntu-latest
20
-
21
- strategy:
22
- matrix:
23
- node-version: [20.x]
24
-
25
- steps:
26
- - uses: actions/checkout@v4
27
- - uses: oven-sh/setup-bun@v2
28
- - uses: actions/setup-node@v4
29
- with:
30
- node-version: '20.x'
31
- registry-url: 'https://registry.npmjs.org'
32
-
33
- - name: Get yarn cache directory path
34
- id: yarn-cache-dir-path
35
- run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
36
-
37
- - name: Install Dependency
38
- env:
39
- NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40
- NODE_OPTIONS: '--max_old_space_size=4096'
41
- run: bun install --frozen-lockfile
42
-
43
- - name: Run lint
44
- env:
45
- NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46
- NODE_OPTIONS: '--max_old_space_size=4096'
47
- run: bun lint
@@ -1,22 +0,0 @@
1
- name: Publish Package to npmjs
2
- on:
3
- release:
4
- types: [published]
5
- jobs:
6
- build:
7
- runs-on: ubuntu-latest
8
- permissions:
9
- contents: read
10
- id-token: write
11
- steps:
12
- - uses: actions/checkout@v4
13
- - uses: oven-sh/setup-bun@v2
14
- # Setup .npmrc file to publish to npm
15
- - uses: actions/setup-node@v4
16
- with:
17
- node-version: '20.x'
18
- registry-url: 'https://registry.npmjs.org'
19
- - run: bun install --frozen-lockfile
20
- - run: npm publish --provenance --access public
21
- env:
22
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,10 +0,0 @@
1
- #!/bin/bash
2
- echo "Running $1 on all running emulators..."
3
- devices=`adb devices`
4
-
5
- for device in $devices; do
6
- if [[ "$device" =~ "emulator-" ]]; then
7
- adb -s $device $1
8
- fi
9
- done
10
- echo "All Done."
@@ -1,13 +0,0 @@
1
- {
2
- "rules": {
3
- // Database in general is closed. Read/Write to anything but "tests/" will fail.
4
- ".read": false,
5
- ".write": false,
6
-
7
- // ..."tests" node will succeed
8
- "tests": {
9
- ".read": true,
10
- ".write": true,
11
- }
12
- }
13
- }
@@ -1,39 +0,0 @@
1
- {
2
- "firestore": {
3
- "rules": "firestore.rules",
4
- "indexes": "firestore.indexes.json"
5
- },
6
- "functions": {
7
- "predeploy": [
8
- "yarn",
9
- "yarn --prefix \"$RESOURCE_DIR\" build"
10
- ],
11
- "source": "functions"
12
- },
13
- "database": {
14
- "rules": "database.rules"
15
- },
16
- "storage": {
17
- "rules": "storage.rules"
18
- },
19
- "emulators": {
20
- "auth": {
21
- "port": 9099
22
- },
23
- "database": {
24
- "port": 9000
25
- },
26
- "firestore": {
27
- "port": 8080
28
- },
29
- "functions": {
30
- "port": 5001
31
- },
32
- "storage": {
33
- "port": 9199
34
- },
35
- "ui": {
36
- "enabled": true
37
- }
38
- }
39
- }
@@ -1,72 +0,0 @@
1
- {
2
- "indexes": [
3
- {
4
- "collectionGroup": "firestore",
5
- "queryScope": "COLLECTION",
6
- "fields": [
7
- {
8
- "fieldPath": "a",
9
- "order": "ASCENDING"
10
- },
11
- {
12
- "fieldPath": "b",
13
- "order": "ASCENDING"
14
- }
15
- ]
16
- }
17
- ],
18
- "fieldOverrides": [
19
- {
20
- "collectionGroup": "collectionGroup",
21
- "fieldPath": "value",
22
- "indexes": [
23
- {
24
- "order": "ASCENDING",
25
- "queryScope": "COLLECTION"
26
- },
27
- {
28
- "order": "DESCENDING",
29
- "queryScope": "COLLECTION"
30
- },
31
- {
32
- "arrayConfig": "CONTAINS",
33
- "queryScope": "COLLECTION"
34
- },
35
- {
36
- "order": "ASCENDING",
37
- "queryScope": "COLLECTION_GROUP"
38
- },
39
- {
40
- "order": "DESCENDING",
41
- "queryScope": "COLLECTION_GROUP"
42
- }
43
- ]
44
- },
45
- {
46
- "collectionGroup": "collectionGroup",
47
- "fieldPath": "number",
48
- "indexes": [
49
- {
50
- "order": "ASCENDING",
51
- "queryScope": "COLLECTION"
52
- },
53
- {
54
- "order": "DESCENDING",
55
- "queryScope": "COLLECTION"
56
- },
57
- {
58
- "arrayConfig": "CONTAINS",
59
- "queryScope": "COLLECTION"
60
- },
61
- {
62
- "order": "ASCENDING",
63
- "queryScope": "COLLECTION_GROUP"
64
- },
65
- {
66
- "order": "DESCENDING",
67
- "queryScope": "COLLECTION_GROUP"
68
- }
69
- ]
70
- }
71
- ]
72
- }
@@ -1,17 +0,0 @@
1
- rules_version = '2';
2
- service cloud.firestore {
3
- match /databases/{database}/documents {
4
- match /{document=**} {
5
- allow read, write: if false;
6
- }
7
- match /firestore-bundle-tests/{document=**} {
8
- allow read, write: if true;
9
- }
10
- match /firestore/{document=**} {
11
- allow read, write: if true;
12
- }
13
- match /{path=**}/collectionGroup/{documentId} {
14
- allow read, write: if true;
15
- }
16
- }
17
- }
@@ -1,24 +0,0 @@
1
- {
2
- "name": "functions",
3
- "scripts": {
4
- "build": "tsc",
5
- "serve": "npm run build && firebase emulators:start --only functions",
6
- "shell": "npm run build && firebase functions:shell",
7
- "start": "npm run shell",
8
- "deploy": "firebase deploy --only functions",
9
- "logs": "firebase functions:log"
10
- },
11
- "engines": {
12
- "node": "16"
13
- },
14
- "main": "lib/index.js",
15
- "dependencies": {
16
- "firebase-admin": "^11.3.0",
17
- "firebase-functions": "^4.2.1"
18
- },
19
- "devDependencies": {
20
- "firebase-functions-test": "^3.0.0",
21
- "typescript": "^4.9.5"
22
- },
23
- "private": true
24
- }
@@ -1,13 +0,0 @@
1
- /*
2
- *
3
- * Testing tools for invertase/react-native-firebase use only.
4
- *
5
- * Copyright (C) 2018-present Invertase Limited <oss@invertase.io>
6
- *
7
- * See License file for more information.
8
- */
9
-
10
- /* eslint-disable global-require */
11
- module.exports = {
12
- SAMPLE_DATA: require('./functions/sample-data'),
13
- };
@@ -1,12 +0,0 @@
1
- import * as functions from 'firebase-functions';
2
-
3
- // // Start writing Firebase Functions
4
- // // https://firebase.google.com/docs/functions/typescript
5
- //
6
- export const helloWorld = functions.https.onRequest((request, response) => {
7
- functions.logger.info('Hello logs!', { structuredData: true });
8
- response.send('{ "data": "Hello from Firebase!" }');
9
- });
10
-
11
- export { testFunctionCustomRegion } from './testFunctionCustomRegion';
12
- export { testFunctionDefaultRegion } from './testFunctionDefaultRegion';
@@ -1,80 +0,0 @@
1
- /*
2
- * Testing tools for invertase/react-native-firebase use only.
3
- *
4
- * Copyright (C) 2018-present Invertase Limited <oss@invertase.io>
5
- *
6
- * See License file for more information.
7
- */
8
-
9
- const SAMPLE_DATA: { [key: string]: any } = {
10
- number: 1234,
11
- string: 'acde',
12
- boolean: true,
13
- null: null,
14
- object: {
15
- number: 1234,
16
- string: 'acde',
17
- boolean: true,
18
- null: null,
19
- },
20
- array: [1234, 'acde', true, null],
21
- deepObject: {
22
- array: [1234, 'acde', false, null],
23
- object: {
24
- number: 1234,
25
- string: 'acde',
26
- boolean: true,
27
- null: null,
28
- array: [1234, 'acde', true, null],
29
- },
30
- number: 1234,
31
- string: 'acde',
32
- boolean: true,
33
- null: null,
34
- },
35
- deepArray: [
36
- 1234,
37
- 'acde',
38
- true,
39
- null,
40
- [1234, 'acde', true, null],
41
- {
42
- number: 1234,
43
- string: 'acde',
44
- boolean: true,
45
- null: null,
46
- array: [1234, 'acde', true, null],
47
- },
48
- ],
49
- deepMap: {
50
- number: 123,
51
- string: 'foo',
52
- booleanTrue: true,
53
- booleanFalse: false,
54
- null: null,
55
- list: ['1', 2, true, false],
56
- map: {
57
- number: 123,
58
- string: 'foo',
59
- booleanTrue: true,
60
- booleanFalse: false,
61
- null: null,
62
- },
63
- },
64
- deepList: [
65
- '1',
66
- 2,
67
- true,
68
- false,
69
- ['1', 2, true, false],
70
- {
71
- number: 123,
72
- string: 'foo',
73
- booleanTrue: true,
74
- booleanFalse: false,
75
- null: null,
76
- },
77
- ],
78
- };
79
-
80
- export default SAMPLE_DATA;
@@ -1,14 +0,0 @@
1
- /*
2
- *
3
- * Testing tools for invertase/react-native-firebase use only.
4
- *
5
- * Copyright (C) 2018-present Invertase Limited <oss@invertase.io>
6
- *
7
- * See License file for more information.
8
- */
9
-
10
- import * as functions from 'firebase-functions';
11
-
12
- export const testFunctionCustomRegion = functions
13
- .region('europe-west1')
14
- .https.onCall(() => 'europe-west1');
@@ -1,73 +0,0 @@
1
- /*
2
- *
3
- * Testing tools for invertase/react-native-firebase use only.
4
- *
5
- * Copyright (C) 2018-present Invertase Limited <oss@invertase.io>
6
- *
7
- * See License file for more information.
8
- */
9
-
10
- import * as assert from 'assert';
11
- import { FirebaseError } from 'firebase-admin';
12
- import * as functions from 'firebase-functions';
13
- import SAMPLE_DATA from './sample-data';
14
-
15
- export const testFunctionDefaultRegion = functions.https.onCall(data => {
16
- console.log(Date.now(), data);
17
-
18
- if (typeof data === 'undefined') {
19
- return 'undefined';
20
- }
21
-
22
- if (typeof data === 'string') {
23
- return 'string';
24
- }
25
-
26
- if (typeof data === 'number') {
27
- return 'number';
28
- }
29
-
30
- if (typeof data === 'boolean') {
31
- return 'boolean';
32
- }
33
-
34
- if (data === null) {
35
- return 'null';
36
- }
37
-
38
- if (Array.isArray(data)) {
39
- return 'array';
40
- }
41
-
42
- const { type, asError, inputData } = data;
43
- if (!Object.hasOwnProperty.call(SAMPLE_DATA, type)) {
44
- throw new functions.https.HttpsError(
45
- 'invalid-argument',
46
- 'Invalid test requested.',
47
- );
48
- }
49
-
50
- const outputData = SAMPLE_DATA[type];
51
-
52
- try {
53
- assert.deepEqual(outputData, inputData);
54
- } catch (e: any) {
55
- console.error(e);
56
- throw new functions.https.HttpsError(
57
- 'invalid-argument',
58
- 'Input and Output types did not match.',
59
- (e as FirebaseError).message,
60
- );
61
- }
62
-
63
- // all good
64
- if (asError) {
65
- throw new functions.https.HttpsError(
66
- 'cancelled',
67
- 'Response data was requested to be sent as part of an Error payload, so here we are!',
68
- outputData,
69
- );
70
- }
71
-
72
- return outputData;
73
- });
@@ -1,16 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "noImplicitReturns": true,
5
- "noUnusedLocals": true,
6
- "outDir": "lib",
7
- "sourceMap": true,
8
- "skipLibCheck": true,
9
- "strict": true,
10
- "target": "es2017"
11
- },
12
- "compileOnSave": true,
13
- "include": [
14
- "src"
15
- ]
16
- }
@@ -1,6 +0,0 @@
1
- @REM this pushd is likely not needed, but just in case
2
- pushd "%~dp0"
3
- @REM this is just to see what our current directory is. Should be .github/workflow/scripts
4
- echo %cd%
5
- @REM strangely, unless you specify the config file as being right in the current directory, it won't find it, and everything fails
6
- yarn firebase emulators:start --config %cd%\firebase.json --only auth,database,firestore,functions,storage --project react-native-firebase-testing
@@ -1,44 +0,0 @@
1
- #!/bin/bash
2
- if ! [ -x "$(command -v firebase)" ]; then
3
- echo "❌ Firebase-tools CLI is missing. Run 'npm i -g firebase-tools' or the equivalent"
4
- exit 1
5
- fi
6
-
7
- EMU_START_COMMAND="firebase emulators:start --only auth,database,firestore,functions,storage --project react-native-firebase-testing"
8
- #EMU_START_COMMAND="sleep 120"
9
- MAX_RETRIES=3
10
- MAX_CHECKATTEMPTS=60
11
- CHECKATTEMPTS_WAIT=1
12
-
13
- # Make sure functions are ready to go
14
- pushd "$(dirname "$0")/functions" && yarn && yarn build && popd
15
-
16
-
17
- RETRIES=1
18
- while [ $RETRIES -le $MAX_RETRIES ]; do
19
-
20
- if [ "$1" == "--no-daemon" ]; then
21
- echo "Starting Firebase Emulator Suite in foreground."
22
- $EMU_START_COMMAND
23
- exit 0
24
- else
25
- echo "Starting Firebase Emulator Suite in background."
26
- $EMU_START_COMMAND &
27
- CHECKATTEMPTS=1
28
- while [ $CHECKATTEMPTS -le $MAX_CHECKATTEMPTS ]; do
29
- sleep $CHECKATTEMPTS_WAIT
30
- if curl --output /dev/null --silent --fail http://localhost:8080; then
31
- echo "Firebase Emulator Suite is online!"
32
- exit 0;
33
- fi
34
- echo "Waiting for Firebase Emulator Suite to come online, check $CHECKATTEMPTS of $MAX_CHECKATTEMPTS..."
35
- ((CHECKATTEMPTS = CHECKATTEMPTS + 1))
36
- done
37
- fi
38
-
39
- echo "Firebase Emulator Suite did not come online in $MAX_CHECKATTEMPTS checks. Try $RETRIES of $MAX_RETRIES."
40
- ((RETRIES = RETRIES + 1))
41
-
42
- done
43
- echo "Firebase Emulator Suite did not come online after $MAX_RETRIES attempts."
44
- exit 1
@@ -1,21 +0,0 @@
1
- rules_version = '2';
2
- service firebase.storage {
3
- match /b/{bucket}/o {
4
- match /{document=**} {
5
- allow read, write: if false;
6
- }
7
-
8
- match /writeOnly.jpeg {
9
- allow read: if false;
10
- allow write: if true;
11
- }
12
-
13
- match /playground/{document=**} {
14
- allow read, write: if true;
15
- }
16
-
17
- match /react-native-firebase-testing/{document=**} {
18
- allow read, write: if true;
19
- }
20
- }
21
- }
package/.yarnrc.yml DELETED
@@ -1 +0,0 @@
1
- nodeLinker: node-modules
@@ -1,12 +0,0 @@
1
- /** @type {import('@jest/types').Config.InitialOptions} */
2
- module.exports = {
3
- rootDir: '..',
4
- testMatch: ['<rootDir>/e2e/**/*.test.js'],
5
- testTimeout: 120000,
6
- maxWorkers: 1,
7
- globalSetup: 'detox/runners/jest/globalSetup',
8
- globalTeardown: 'detox/runners/jest/globalTeardown',
9
- reporters: ['detox/runners/jest/reporter'],
10
- testEnvironment: 'detox/runners/jest/testEnvironment',
11
- verbose: true,
12
- };
@@ -1,23 +0,0 @@
1
- describe('Example', () => {
2
- beforeAll(async () => {
3
- await device.launchApp();
4
- });
5
-
6
- beforeEach(async () => {
7
- await device.reloadReactNative();
8
- });
9
-
10
- it('should have welcome screen', async () => {
11
- await expect(element(by.id('welcome'))).toBeVisible();
12
- });
13
-
14
- it('should show hello screen after tap', async () => {
15
- await element(by.id('hello_button')).tap();
16
- await expect(element(by.text('Hello!!!'))).toBeVisible();
17
- });
18
-
19
- it('should show world screen after tap', async () => {
20
- await element(by.id('world_button')).tap();
21
- await expect(element(by.text('World!!!'))).toBeVisible();
22
- });
23
- });