Skip to content

Commit 19e55b6

Browse files
committed
Merge branch 'main' into pr/274
2 parents a0f43df + bf654b3 commit 19e55b6

29 files changed

Lines changed: 1177 additions & 563 deletions
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Test Harness Android
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".github/workflows/test-harness-android.yml"
7+
- "example/android/**"
8+
- "example/src/tests/**"
9+
- "example/tests/**"
10+
- "example/rn-harness.config.mjs"
11+
- "example/jest.config.js"
12+
- "package/cpp/**"
13+
- "package/android/**"
14+
- "**/bun.lock"
15+
- "**/react-native.config.js"
16+
- "**/nitro.json"
17+
18+
env:
19+
TARGET_ANDROID_ARCH: x86_64
20+
21+
jobs:
22+
test:
23+
name: Harness Tests (Android)
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- uses: actions/checkout@v6
28+
- uses: oven-sh/setup-bun@v2
29+
30+
- name: Setup JDK 17
31+
uses: actions/setup-java@v5
32+
with:
33+
distribution: "zulu"
34+
java-version: 17
35+
36+
- name: Enable KVM group perms
37+
run: |
38+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
39+
sudo udevadm control --reload-rules
40+
sudo udevadm trigger --name-match=kvm
41+
42+
- name: Install dependencies (bun)
43+
run: bun install
44+
45+
- name: Build Android app
46+
working-directory: example/android
47+
run: >-
48+
./gradlew :app:assembleDebug --no-daemon
49+
-PreactNativeArchitectures=${{ env.TARGET_ANDROID_ARCH }}
50+
51+
- name: Run react-native-harness on Android
52+
uses: callstackincubator/react-native-harness@v1.2.0
53+
with:
54+
app: android/app/build/outputs/apk/debug/app-debug.apk
55+
runner: android
56+
projectRoot: example
57+
packageManager: bun
58+
cacheAvd: false
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Test Harness iOS
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".github/workflows/test-harness-ios.yml"
7+
- "example/ios/**"
8+
- "example/src/tests/**"
9+
- "example/tests/**"
10+
- "example/rn-harness.config.mjs"
11+
- "example/jest.config.js"
12+
- "package/cpp/**"
13+
- "package/ios/**"
14+
- "**/Podfile.lock"
15+
- "**/*.podspec"
16+
- "**/react-native.config.js"
17+
- "**/nitro.json"
18+
- "**/bun.lock"
19+
20+
jobs:
21+
test:
22+
name: Harness Tests (iOS)
23+
runs-on: macOS-26
24+
env:
25+
IOS_SIMULATOR_NAME: iPhone 17 Pro
26+
IOS_SIMULATOR_OS: "26.2"
27+
28+
steps:
29+
- uses: actions/checkout@v6
30+
- uses: oven-sh/setup-bun@v2
31+
32+
- name: Install dependencies (bun)
33+
run: bun install
34+
35+
- name: Setup Ruby (bundle)
36+
uses: ruby/setup-ruby@v1
37+
with:
38+
ruby-version: 3.3.0
39+
bundler-cache: true
40+
working-directory: example
41+
42+
- name: Select Xcode 26.2
43+
run: sudo xcode-select -s "/Applications/Xcode_26.2.app/Contents/Developer"
44+
45+
- name: Install Pods
46+
working-directory: example
47+
run: bun pods
48+
49+
- name: Build debug app
50+
working-directory: example/ios
51+
run: |
52+
set -euo pipefail
53+
54+
xcodebuild \
55+
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
56+
-derivedDataPath build -UseModernBuildSystem=YES \
57+
-workspace NitroSQLiteExample.xcworkspace \
58+
-scheme NitroSQLiteExample \
59+
-sdk iphonesimulator \
60+
-configuration Debug \
61+
-destination "generic/platform=iOS Simulator" \
62+
build \
63+
CODE_SIGNING_ALLOWED=NO
64+
65+
- name: Run react-native-harness on iOS
66+
uses: callstackincubator/react-native-harness@v1.2.0
67+
with:
68+
app: ios/build/Build/Products/Debug-iphonesimulator/NitroSQLiteExample.app
69+
runner: ios
70+
projectRoot: example
71+
packageManager: bun

bun.lock

Lines changed: 374 additions & 126 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/babel.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ module.exports = {
1414
'../packages/react-native-nitro-sqlite',
1515
pak.source,
1616
),
17-
'stream': 'stream-browserify',
17+
'crypto': 'react-native-quick-crypto',
18+
'stream': 'readable-stream',
19+
'buffer': 'react-native-quick-crypto',
1820
'react-native-sqlite-storage': 'react-native-nitro-sqlite',
21+
'^@/(.+)': './src/\\1',
22+
'^@tests/(.+)': './tests/\\1',
1923
},
2024
},
2125
],

example/ios/Podfile.lock

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,32 @@ PODS:
2626
- ReactCommon/turbomodule/core
2727
- ReactNativeDependencies
2828
- Yoga
29+
- OpenSSL-Universal (3.6.2000)
30+
- QuickCrypto (1.1.5):
31+
- hermes-engine
32+
- NitroModules
33+
- OpenSSL-Universal (~> 3.6.2000)
34+
- RCTRequired
35+
- RCTTypeSafety
36+
- React-callinvoker
37+
- React-Core
38+
- React-Core-prebuilt
39+
- React-debug
40+
- React-Fabric
41+
- React-featureflags
42+
- React-graphics
43+
- React-ImageManager
44+
- React-jsi
45+
- React-NativeModulesApple
46+
- React-RCTFabric
47+
- React-renderercss
48+
- React-rendererdebug
49+
- React-utils
50+
- ReactCodegen
51+
- ReactCommon/turbomodule/bridging
52+
- ReactCommon/turbomodule/core
53+
- ReactNativeDependencies
54+
- Yoga
2955
- RCTDeprecation (0.85.0-rc.0)
3056
- RCTRequired (0.85.0-rc.0)
3157
- RCTSwiftUI (0.85.0-rc.0)
@@ -1384,6 +1410,28 @@ PODS:
13841410
- React-RCTFBReactNativeSpec
13851411
- ReactCommon/turbomodule/core
13861412
- ReactNativeDependencies
1413+
- react-native-quick-base64 (3.0.0):
1414+
- hermes-engine
1415+
- RCTRequired
1416+
- RCTTypeSafety
1417+
- React-Core
1418+
- React-Core-prebuilt
1419+
- React-debug
1420+
- React-Fabric
1421+
- React-featureflags
1422+
- React-graphics
1423+
- React-ImageManager
1424+
- React-jsi
1425+
- React-NativeModulesApple
1426+
- React-RCTFabric
1427+
- React-renderercss
1428+
- React-rendererdebug
1429+
- React-utils
1430+
- ReactCodegen
1431+
- ReactCommon/turbomodule/bridging
1432+
- ReactCommon/turbomodule/core
1433+
- ReactNativeDependencies
1434+
- Yoga
13871435
- react-native-safe-area-context (5.6.2):
13881436
- hermes-engine
13891437
- RCTRequired
@@ -1936,6 +1984,7 @@ DEPENDENCIES:
19361984
- FBLazyVector (from `../../node_modules/react-native/Libraries/FBLazyVector`)
19371985
- hermes-engine (from `../../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
19381986
- NitroModules (from `../../node_modules/react-native-nitro-modules`)
1987+
- QuickCrypto (from `../../node_modules/react-native-quick-crypto`)
19391988
- RCTDeprecation (from `../../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation`)
19401989
- RCTRequired (from `../../node_modules/react-native/Libraries/Required`)
19411990
- RCTSwiftUI (from `../../node_modules/react-native/ReactApple/RCTSwiftUI`)
@@ -1973,6 +2022,7 @@ DEPENDENCIES:
19732022
- React-logger (from `../../node_modules/react-native/ReactCommon/logger`)
19742023
- React-Mapbuffer (from `../../node_modules/react-native/ReactCommon`)
19752024
- React-microtasksnativemodule (from `../../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`)
2025+
- react-native-quick-base64 (from `../../node_modules/react-native-quick-base64`)
19762026
- react-native-safe-area-context (from `../../node_modules/react-native-safe-area-context`)
19772027
- React-NativeModulesApple (from `../../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
19782028
- React-networking (from `../../node_modules/react-native/ReactCommon/react/networking`)
@@ -2013,6 +2063,10 @@ DEPENDENCIES:
20132063
- RNScreens (from `../../node_modules/react-native-screens`)
20142064
- Yoga (from `../../node_modules/react-native/ReactCommon/yoga`)
20152065

2066+
SPEC REPOS:
2067+
trunk:
2068+
- OpenSSL-Universal
2069+
20162070
EXTERNAL SOURCES:
20172071
FBLazyVector:
20182072
:path: "../../node_modules/react-native/Libraries/FBLazyVector"
@@ -2021,6 +2075,8 @@ EXTERNAL SOURCES:
20212075
:tag: hermes-v250829098.0.10
20222076
NitroModules:
20232077
:path: "../../node_modules/react-native-nitro-modules"
2078+
QuickCrypto:
2079+
:path: "../../node_modules/react-native-quick-crypto"
20242080
RCTDeprecation:
20252081
:path: "../../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation"
20262082
RCTRequired:
@@ -2093,6 +2149,8 @@ EXTERNAL SOURCES:
20932149
:path: "../../node_modules/react-native/ReactCommon"
20942150
React-microtasksnativemodule:
20952151
:path: "../../node_modules/react-native/ReactCommon/react/nativemodule/microtasks"
2152+
react-native-quick-base64:
2153+
:path: "../../node_modules/react-native-quick-base64"
20962154
react-native-safe-area-context:
20972155
:path: "../../node_modules/react-native-safe-area-context"
20982156
React-NativeModulesApple:
@@ -2176,6 +2234,8 @@ SPEC CHECKSUMS:
21762234
FBLazyVector: 4ee5f665093abe339f4b579fc3d59f65c8af196c
21772235
hermes-engine: 56e1f8e0c324283e1cc2c35f56dc6037c141f67d
21782236
NitroModules: 587af3c2bc93f5c9f9b39aec315eb29509a7c537
2237+
OpenSSL-Universal: ecee7b138fa75a74ecf00d7ffd248fb584739b9e
2238+
QuickCrypto: 790e6537bb81a11d036a24ce3248b51f66857ceb
21792239
RCTDeprecation: b73940ea69ab57c2c59f845b37b09e1d8b0d0588
21802240
RCTRequired: f3a52c914af5f19f04d02b2091d83e43cf71676c
21812241
RCTSwiftUI: 6dea7b613e8930a973b723c121aa8646374ee694
@@ -2212,6 +2272,7 @@ SPEC CHECKSUMS:
22122272
React-logger: dbf8f36688ca7ccdb14cd2c2a9a738162fa87fbd
22132273
React-Mapbuffer: 82c344b9a3dc807a40aefece0714587be25d7718
22142274
React-microtasksnativemodule: c6299f5e04ba84779dc08f884caf8f42f370e9da
2275+
react-native-quick-base64: 740f0799082262a4f0a0001647288840bc54a3c4
22152276
react-native-safe-area-context: 4b3960e27c8a3ca0c1523348f97513e27f8509b7
22162277
React-NativeModulesApple: f8da6e477ffca7ad38869d16d7fd0b4289771f6a
22172278
React-networking: 3b027fd335be928ee4ac5172937fe96729a6eb27

example/jest.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
projects: [
3+
{
4+
displayName: 'react-native-harness',
5+
preset: 'react-native-harness',
6+
testMatch: ['**/tests/**/*.harness.(js|jsx|ts|tsx)'],
7+
},
8+
],
9+
}

example/metro.config.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,10 @@
1-
const fs = require('fs')
21
const path = require('path')
32
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config')
43
const pak = require('../package.json')
54

65
const root = path.resolve(__dirname, '..')
76
const modules = Object.keys({ ...pak.peerDependencies })
87

9-
function getPackageNames(nodeModulesPath) {
10-
if (!fs.existsSync(nodeModulesPath)) {
11-
return []
12-
}
13-
14-
const allFiles = fs.readdirSync(nodeModulesPath)
15-
16-
// Filter out only directories (package names)
17-
const packageNames = allFiles.filter((file) => {
18-
const filePath = path.join(nodeModulesPath, file)
19-
return fs.statSync(filePath).isDirectory()
20-
})
21-
22-
// Handle scoped packages (e.g., @scope/package)
23-
const scopedPackages = packageNames
24-
.filter((pkg) => pkg.startsWith('@'))
25-
.flatMap((scope) => {
26-
const scopePath = path.join(nodeModulesPath, scope)
27-
const scopedFiles = fs.readdirSync(scopePath)
28-
return scopedFiles.map((scopedFile) => `${scope}/${scopedFile}`)
29-
})
30-
31-
// Return both regular and scoped package names
32-
return packageNames
33-
.filter((pkg) => !pkg.startsWith('@'))
34-
.concat(scopedPackages)
35-
}
36-
378
const config = {
389
projectRoot: __dirname,
3910
watchFolders: [root],

example/package.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
"pods": "cd ios && bundle exec pod install",
1111
"typecheck": "tsc --noEmit",
1212
"lint": "eslint \"**/*.{js,ts,tsx}\" --fix",
13-
"codegen": "bun react-native codegen"
13+
"codegen": "bun react-native codegen",
14+
"test:harness": "react-native-harness",
15+
"test:harness:android": "react-native-harness --harnessRunner android",
16+
"test:harness:ios": "react-native-harness --harnessRunner ios"
1417
},
1518
"dependencies": {
16-
"@craftzdog/react-native-buffer": "^6.0.5",
19+
"@craftzdog/react-native-buffer": "^6.1.2",
1720
"@react-native-clipboard/clipboard": "^1.16.3",
1821
"@react-navigation/native": "^7.1.19",
1922
"@react-navigation/native-stack": "^7.6.2",
@@ -25,6 +28,8 @@
2528
"react-native": "0.85.0-rc.0",
2629
"react-native-nitro-modules": "*",
2730
"react-native-nitro-sqlite": "9.6.0",
31+
"react-native-quick-base64": "^3.0.0",
32+
"react-native-quick-crypto": "^1.1.5",
2833
"react-native-safe-area-context": "^5.5.2",
2934
"react-native-screens": "^4.18.0",
3035
"reflect-metadata": "^0.1.13",
@@ -50,6 +55,11 @@
5055
"@types/node": "^22.7.4",
5156
"@types/react": "^19.1.1",
5257
"@types/react-test-renderer": "^19.1.0",
58+
"@react-native-harness/cli": "1.2.0",
59+
"@react-native-harness/jest": "1.2.0",
60+
"@react-native-harness/platform-android": "1.2.0",
61+
"@react-native-harness/platform-apple": "1.2.0",
62+
"react-native-harness": "1.2.0",
5363
"mocha": "^10.1.0",
5464
"postinstall-postinstall": "^2.1.0",
5565
"react-test-renderer": "19.1.1"

0 commit comments

Comments
 (0)