Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/ci-paths.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,23 @@
"packages/react-native-nitro-sqlite-vec/cpp/**",
"packages/react-native-nitro-sqlite/RNNitroSQLite.podspec",
"packages/react-native-nitro-sqlite-vec/RNNitroSqliteVec.podspec",
"example/Gemfile*",
"packages/react-native-nitro-sqlite/Package.swift",
"packages/react-native-nitro-sqlite-vec/Package.swift",
"bun.lock",
"package.json",
"example/package.json",
"packages/react-native-nitro-sqlite/package.json",
"packages/react-native-nitro-sqlite-vec/package.json",
"patches/react-native-nitro-modules*",
"patches/@react-native-harness*",
"patches/react-native-screens*",
"patches/@react-native-clipboard*",
"example/react-native.config.js",
"packages/react-native-nitro-sqlite/react-native.config.js",
"packages/react-native-nitro-sqlite-vec/react-native.config.js",
"packages/react-native-nitro-sqlite/nitro.json",
"!packages/react-native-nitro-sqlite/src/__tests__/**",
"scripts/test-podspec-threadsafe.rb",
"scripts/sqlite-package-config.test.ts",
"example/index.js",
"example/babel.config*.js",
"example/app.json",
Expand Down
21 changes: 6 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
android_configuration: ${{ steps.select.outputs.android_configuration }}
ios: ${{ steps.select.outputs.ios }}
macos: ${{ steps.select.outputs.macos }}
ios_pods: ${{ steps.pods.outputs.ios_pods }}
macos_pods: ${{ steps.pods.outputs.macos_pods }}
steps:
- uses: actions/checkout@v7
Expand Down Expand Up @@ -89,7 +88,6 @@ jobs:
name: ci-lockfiles
path: |
bun.lock
example/ios/Podfile.lock
example/macos/Podfile.lock
retention-days: 1
- name: Require committed dependency resolutions
Expand All @@ -99,7 +97,7 @@ jobs:
git diff --exit-code -- bun.lock
- name: Select native lockfile checks
id: pods
if: steps.select.outputs.dependencies == 'true' && (steps.select.outputs.ios == 'true' || steps.select.outputs.macos == 'true')
if: steps.select.outputs.dependencies == 'true' && steps.select.outputs.macos == 'true'
run: node scripts/ci-dependencies.ts
env:
CI_BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before || github.sha }}
Expand Down Expand Up @@ -140,10 +138,9 @@ jobs:
- name: Test C++ database lifecycle and SQLite symbols
if: steps.select.outputs.cpp_tests == 'true'
run: bash scripts/test-cpp.sh
- name: Test SQLite thread-safety pod configuration
# Paused because Nitro V1 doesn't generate the CocoaPods files that the podspec loads.
if: false && steps.select.outputs.ios == 'true'
run: ruby scripts/test-podspec-threadsafe.rb
- name: Test SQLite Swift package configuration
if: steps.select.outputs.ios == 'true'
run: node --test scripts/sqlite-package-config.test.ts
- name: Check documentation
if: steps.select.outputs.docs == 'true'
run: |
Expand All @@ -153,15 +150,12 @@ jobs:
lockfiles:
name: Native lockfiles
needs: checks
# Paused because Nitro V1 doesn't support CocoaPods. Remove `false &&` to resume it.
# Paused until Nitro V1 supports React Native macOS. Remove `false &&` to resume it.
if: >-
false &&
github.event_name != 'push' && !github.event.pull_request.draft &&
(needs.checks.outputs.ios_pods == 'true' || needs.checks.outputs.macos_pods == 'true')
needs.checks.outputs.macos_pods == 'true'
uses: ./.github/workflows/update-lockfiles.yml
with:
ios: ${{ needs.checks.outputs.ios_pods == 'true' }}
macos: ${{ needs.checks.outputs.macos_pods == 'true' }}

android:
name: Android
Expand All @@ -179,10 +173,7 @@ jobs:
ios:
name: iOS
needs: [checks, lockfiles]
# Paused because Nitro V1 builds iOS with Swift Package Manager, which this workflow doesn't set up yet.
# Remove `false &&` to resume it.
if: >-
false &&
!cancelled() && needs.checks.result == 'success' &&
(needs.lockfiles.result == 'success' || needs.lockfiles.result == 'skipped') &&
github.event_name != 'push' && !github.event.pull_request.draft &&
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
bun run sync:lockfile
bun run check:lockfile
bun install --frozen-lockfile
# The CocoaPods steps are paused because Nitro V1 doesn't support CocoaPods.
# The macOS steps are paused until Nitro V1 supports React Native macOS.
- uses: ruby/setup-ruby@v1
if: false
with:
Expand All @@ -104,11 +104,9 @@ jobs:
- name: Select Xcode
if: false
run: sudo xcode-select -s "/Applications/Xcode_26.5.app/Contents/Developer"
- name: Update iOS and macOS lockfiles
- name: Update macOS lockfile
if: false
run: |
bun example pods
bun example pods:macos
run: bun example pods:macos
- name: Commit lockfiles and optional announcement
run: node scripts/commit-release-lockfiles.ts
env:
Expand Down
32 changes: 14 additions & 18 deletions .github/workflows/test-harness-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ permissions:

jobs:
test:
name: iOS integration tests, ${{ matrix.config.name }}, Xcode ${{ matrix.config.xcode }}
runs-on: macos-26
name: iOS integration tests, Xcode ${{ matrix.config.xcode }}
# Nitro V1 requires Swift 6.4, which GitHub provides in its Xcode 27 preview image.
runs-on: xcode-27
timeout-minutes: 40
strategy:
matrix:
config: ${{ fromJSON(inputs.full && '[{"name":"static_frameworks","frameworks":"static","xcode":"26.5"},{"name":"no_frameworks","frameworks":"","xcode":"26.5"},{"name":"static_frameworks","frameworks":"static","xcode":"26.2"}]' || '[{"name":"static_frameworks","frameworks":"static","xcode":"26.5"},{"name":"no_frameworks","frameworks":"","xcode":"26.5"}]') }}
config: ${{ fromJSON(inputs.full && '[{"xcode":"27.0"},{"xcode":"27.1"}]' || '[{"xcode":"27.0"}]') }}
env:
USE_CCACHE: 1
USE_FRAMEWORKS: ${{ matrix.config.frameworks }}
IOS_SIMULATOR_NAME: iPhone 17 Pro
IOS_SIMULATOR_OS: ${{ matrix.config.xcode }}
IOS_SIMULATOR_NAME: iPhone 18 Pro
IOS_SIMULATOR_OS: '27.0'
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
Expand All @@ -41,7 +40,7 @@ jobs:
uses: hendrikmuhs/[email protected]
with:
max-size: 500M
key: ${{ runner.os }}-${{ matrix.config.name }}-ccache-example-ios-xcode${{ matrix.config.xcode }}
key: ${{ runner.os }}-ccache-example-ios-xcode${{ matrix.config.xcode }}
create-symlink: true
- name: Setup ccache behavior
run: |
Expand All @@ -50,13 +49,6 @@ jobs:
echo "CCACHE_DEPEND=true" >> $GITHUB_ENV
echo "CCACHE_INODECACHE=true" >> $GITHUB_ENV

- name: Setup Ruby (bundle)
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.0
bundler-cache: true
working-directory: example

- name: Select Xcode ${{ matrix.config.xcode }}
run: sudo xcode-select -s "/Applications/Xcode_${{ matrix.config.xcode }}.app/Contents/Developer"

Expand All @@ -79,9 +71,9 @@ jobs:
xcrun simctl boot "$simulator_udid"
fi

- name: Install Pods
- name: Generate Swift packages
working-directory: example
run: bun pods
run: bun spm

- name: Build App
working-directory: example/ios
Expand All @@ -90,7 +82,7 @@ jobs:
xcodebuild \
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
-derivedDataPath build/DerivedData -UseModernBuildSystem=YES \
-workspace NitroSQLiteExample.xcworkspace \
-project NitroSQLiteExample.xcodeproj \
-scheme NitroSQLiteExample \
-sdk iphonesimulator \
-configuration Debug \
Expand All @@ -104,6 +96,10 @@ jobs:
timeout-minutes: 10
run: xcrun simctl bootstatus "$IOS_SIMULATOR_UDID" -b

# react-native-harness 1.5.0 fails on Xcode 27, where `simctl appinfo` errors for apps that are not installed.
- name: Install app on the iOS simulator
run: xcrun simctl install "$IOS_SIMULATOR_UDID" example/ios/build/DerivedData/Build/Products/Debug-iphonesimulator/NitroSQLiteExample.app

- name: Run iOS integration tests
uses: callstackincubator/[email protected]
env:
Expand Down
21 changes: 1 addition & 20 deletions .github/workflows/update-lockfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ name: Check native lockfiles

on:
workflow_call:
inputs:
ios:
type: boolean
default: false
macos:
type: boolean
default: false

permissions:
contents: read
Expand Down Expand Up @@ -38,12 +31,7 @@ jobs:
working-directory: example
- name: Select Xcode 26.5
run: sudo xcode-select -s '/Applications/Xcode_26.5.app/Contents/Developer'
- name: Refresh iOS lockfile
if: inputs.ios
working-directory: example
run: bun pods
- name: Refresh macOS lockfile
if: inputs.macos
working-directory: example
run: bun pods:macos
- name: Attach refreshed native lockfiles
Expand All @@ -52,17 +40,10 @@ jobs:
with:
name: native-lockfiles
path: |
example/ios/Podfile.lock
example/macos/Podfile.lock
example/Gemfile.lock
retention-days: 1
- name: Require committed native dependency resolutions
env:
CHECK_IOS: ${{ inputs.ios }}
CHECK_MACOS: ${{ inputs.macos }}
run: |
lockfiles=()
if [[ "$CHECK_IOS" == true ]]; then lockfiles+=(example/ios/Podfile.lock); fi
if [[ "$CHECK_MACOS" == true ]]; then lockfiles+=(example/macos/Podfile.lock); fi
ruby scripts/ci-pod-lockfiles.rb "${lockfiles[@]}"
ruby scripts/ci-pod-lockfiles.rb example/macos/Podfile.lock
git diff --exit-code -- example/Gemfile.lock
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ To run the example app on Android:
bun example android
```

To run the example app on iOS:
To run the example app on iOS, generate its Swift packages first. Run this again after changing native dependencies:

```sh
bun example spm
bun example ios
```

Expand All @@ -49,7 +50,7 @@ Remember to add tests for your change if possible. Run the unit tests by:
bun test
```

To edit the Objective-C files, open `example/ios/SequelExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-nitro-sqlite`.
To edit the Objective-C++ and C++ files, open `example/ios/NitroSQLiteExample.xcodeproj` in Xcode and find the source files in the `RNNitroSQLite` package.

To edit the Kotlin files, open `example/android` in Android studio and find the source files at `rnnitrosqlite` under `Android`.

Expand Down
2 changes: 2 additions & 0 deletions example/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module.exports = {
root: true,
extends: '../config/.eslintrc.js',
// SwiftPM links native packages under ios/build, including this repository's packages.
ignorePatterns: ['ios/build'],
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
Expand Down
6 changes: 6 additions & 0 deletions example/ios/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# SPM – auto-generated at build time (do not commit)
Package.resolved
build/generated/
build/xcframeworks/
.build/
Loading
Loading