diff --git a/.github/ci-paths.json b/.github/ci-paths.json new file mode 100644 index 00000000..9ce172e1 --- /dev/null +++ b/.github/ci-paths.json @@ -0,0 +1,189 @@ +{ + "typescript": [ + ".github/workflows/**", + ".github/actions/**", + ".github/ci-paths.json", + "scripts/ci*", + ".prettierrc.js", + "config/**", + "tsconfig.json", + "package.json", + "bun.lock", + "patches/**", + "example/**/*.ts", + "example/**/*.tsx", + "example/**/*.js", + "example/**/*.jsx", + "example/**/*.mjs", + "example/tsconfig.json", + "example/app.json", + "example/package.json", + "example/macos/package.json", + "packages/react-native-nitro-sqlite/**/*.ts", + "packages/react-native-nitro-sqlite/**/*.tsx", + "packages/react-native-nitro-sqlite/**/*.js", + "packages/react-native-nitro-sqlite/**/*.jsx", + "packages/react-native-nitro-sqlite/tsconfig.json", + "packages/react-native-nitro-sqlite/tsconfig.build.json", + "packages/react-native-nitro-sqlite/package.json", + "packages/react-native-nitro-sqlite/nitro.json", + "packages/react-native-nitro-sqlite-vec/**/*.ts", + "packages/react-native-nitro-sqlite-vec/**/*.tsx", + "packages/react-native-nitro-sqlite-vec/**/*.js", + "packages/react-native-nitro-sqlite-vec/**/*.jsx", + "packages/react-native-nitro-sqlite-vec/tsconfig.json", + "packages/react-native-nitro-sqlite-vec/package.json", + "scripts/**/*.ts", + "example/jest*.js" + ], + "cpp_format": [ + ".github/workflows/**", + ".github/actions/**", + ".github/ci-paths.json", + "scripts/ci*", + ".clang-format", + "scripts/clang-format.sh", + "packages/react-native-nitro-sqlite/cpp/**", + "packages/react-native-nitro-sqlite/tests/cpp/**" + ], + "cpp_tests": [ + ".github/workflows/**", + ".github/actions/**", + ".github/ci-paths.json", + "scripts/ci*", + "packages/react-native-nitro-sqlite/cpp/NitroSQLiteDatabaseMigration.*", + "packages/react-native-nitro-sqlite/cpp/NitroSQLiteDatabaseConnections.*", + "packages/react-native-nitro-sqlite/cpp/NitroSQLiteExecuteBatch.*", + "packages/react-native-nitro-sqlite/cpp/NitroSQLiteOperations.*", + "packages/react-native-nitro-sqlite/cpp/NitroSQLiteStatementGroup.hpp", + "packages/react-native-nitro-sqlite/cpp/sqlite/sqlite3.*", + "packages/react-native-nitro-sqlite/cpp/sqlite/sqlite3-symbol-prefix.h", + "packages/react-native-nitro-sqlite-vec/cpp/**", + "packages/react-native-nitro-sqlite/tests/cpp/**", + "scripts/generate-sqlite-symbol-prefix.py", + "scripts/test-private-sqlite-symbols.sh", + "scripts/test-cpp.sh" + ], + "docs": [ + ".github/workflows/**", + ".github/actions/**", + ".github/ci-paths.json", + "scripts/ci*", + "docs/**", + "packages/react-native-nitro-sqlite/src/**", + "packages/react-native-nitro-sqlite/package.json", + "packages/react-native-nitro-sqlite-vec/src/**", + "packages/react-native-nitro-sqlite-vec/package.json", + "config/tsconfig.json", + "package.json", + "bun.lock" + ], + "android": [ + ".github/workflows/**", + ".github/actions/**", + ".github/ci-paths.json", + "scripts/ci*", + "example/android/**", + "example/src/tests/**", + "example/tests/**", + "example/rn-harness.config.mjs", + "example/jest.config.js", + "packages/react-native-nitro-sqlite/cpp/**", + "packages/react-native-nitro-sqlite/android/**", + "packages/react-native-nitro-sqlite/src/**", + "packages/react-native-nitro-sqlite/nitrogen/generated/shared/**", + "packages/react-native-nitro-sqlite/nitrogen/generated/android/**", + "packages/react-native-nitro-sqlite-vec/cpp/**", + "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*", + "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/android-sqlite-flags/**", + "example/index.js", + "example/babel.config*.js", + "example/app.json", + "packages/react-native-nitro-sqlite-vec/src/**", + "!packages/react-native-nitro-sqlite-vec/src/__tests__/**" + ], + "ios": [ + ".github/workflows/**", + ".github/actions/**", + ".github/ci-paths.json", + "scripts/ci*", + "example/ios/**", + "example/src/tests/**", + "example/tests/**", + "example/rn-harness.config.mjs", + "example/jest.config.js", + "packages/react-native-nitro-sqlite/cpp/**", + "packages/react-native-nitro-sqlite/ios/**", + "packages/react-native-nitro-sqlite/src/**", + "packages/react-native-nitro-sqlite/nitrogen/generated/shared/**", + "packages/react-native-nitro-sqlite/nitrogen/generated/ios/**", + "packages/react-native-nitro-sqlite-vec/cpp/**", + "packages/react-native-nitro-sqlite/RNNitroSQLite.podspec", + "packages/react-native-nitro-sqlite-vec/RNNitroSqliteVec.podspec", + "example/Gemfile*", + "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*", + "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", + "example/index.js", + "example/babel.config*.js", + "example/app.json", + "packages/react-native-nitro-sqlite-vec/src/**", + "!packages/react-native-nitro-sqlite-vec/src/__tests__/**" + ], + "macos": [ + ".github/workflows/**", + ".github/actions/**", + ".github/ci-paths.json", + "scripts/ci*", + "example/macos/**", + "example/src/**", + "example/tests/**", + "example/app.json", + "example/index.js", + "example/babel.config*.js", + "packages/react-native-nitro-sqlite/src/**", + "packages/react-native-nitro-sqlite/cpp/**", + "packages/react-native-nitro-sqlite/ios/**", + "packages/react-native-nitro-sqlite/nitrogen/generated/shared/**", + "packages/react-native-nitro-sqlite/nitrogen/generated/ios/**", + "packages/react-native-nitro-sqlite/RNNitroSQLite.podspec", + "packages/react-native-nitro-sqlite/react-native.config.js", + "packages/react-native-nitro-sqlite/nitro.json", + "packages/react-native-nitro-sqlite/package.json", + "packages/react-native-nitro-sqlite-vec/src/**", + "packages/react-native-nitro-sqlite-vec/cpp/**", + "packages/react-native-nitro-sqlite-vec/RNNitroSqliteVec.podspec", + "packages/react-native-nitro-sqlite-vec/react-native.config.js", + "packages/react-native-nitro-sqlite-vec/package.json", + "patches/**", + "example/macos/Podfile.lock", + "example/Gemfile*", + "bun.lock", + "package.json", + "example/package.json", + "example/macos/package.json", + "example/react-native.config.js", + "example/macos/react-native.config.js", + "!packages/react-native-nitro-sqlite/src/__tests__/**", + "!packages/react-native-nitro-sqlite-vec/src/__tests__/**" + ] +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d3fbb3e0..299145bc 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,20 +4,31 @@ updates: - package-ecosystem: 'github-actions' directory: '/' schedule: - interval: 'daily' + interval: 'weekly' + day: 'monday' labels: - 'dependencies' - 'ecosystem:github-actions' + groups: + actions: + patterns: ['*'] + update-types: ['minor', 'patch'] - package-ecosystem: 'gradle' directories: - '/packages/react-native-nitro-sqlite/android/' - '/example/android/' schedule: - interval: 'daily' + interval: 'weekly' + day: 'monday' labels: - 'dependencies' - 'ecosystem:gradle' + groups: + gradle: + patterns: ['*'] + update-types: ['minor', 'patch'] + group-by: 'dependency-name' # Update the example wrapper with its React Native Android toolchain. ignore: - dependency-name: 'gradle-wrapper' @@ -28,7 +39,8 @@ updates: - '/packages/react-native-nitro-sqlite/' - '/example/' schedule: - interval: 'daily' + interval: 'weekly' + day: 'monday' labels: - 'dependencies' - 'ecosystem:npm' @@ -62,3 +74,16 @@ updates: babel: patterns: - '@babel/*' + update-types: ['minor', 'patch'] + development: + patterns: + - '@types/*' + - '*jest*' + - '*eslint*' + - 'typescript*' + - 'prettier' + update-types: ['minor', 'patch'] + shared-dependencies: + patterns: ['*'] + update-types: ['minor', 'patch'] + group-by: 'dependency-name' diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml deleted file mode 100644 index 86baf432..00000000 --- a/.github/workflows/build-android.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: Build Android - -on: - push: - branches: - - main - paths: &android_paths - - ".github/workflows/build-android.yml" - - "example/android/**" - - "packages/react-native-nitro-sqlite/nitrogen/generated/shared/**" - - "packages/react-native-nitro-sqlite/nitrogen/generated/android/**" - - "packages/react-native-nitro-sqlite/src/specs/**" - - "packages/react-native-nitro-sqlite/cpp/**" - - "packages/react-native-nitro-sqlite/android/**" - - "packages/react-native-nitro-sqlite-vec/cpp/**" - - "scripts/android-sqlite-flags/**" - - "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*" - - "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" - pull_request: - paths: *android_paths - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} - cancel-in-progress: true - -env: - # Build a single ABI in CI to reduce native compile time. - TARGET_ANDROID_ARCH: x86_64 - -jobs: - build: - name: Build Android Example App - runs-on: ubuntu-24.04 - strategy: - matrix: - min-sdk: - - "24" - - "26" - steps: - - uses: actions/checkout@v7 - - uses: oven-sh/setup-bun@v2 - - - name: Install npm dependencies (bun) - run: bun install - - - name: Set minSdk in build.gradle - run: sed -i "s/minSdkVersion = 24/minSdkVersion = ${{ matrix.min-sdk }}/g" example/android/build.gradle - - - name: Setup JDK 17 - uses: actions/setup-java@v6 - with: - distribution: "zulu" - java-version: 17 - java-package: jdk - - - name: Restore Gradle/CMake cache - uses: actions/cache@v6 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - example/android/.gradle - example/android/app/.cxx - key: ${{ runner.os }}-gradle-${{ matrix.min-sdk }}-${{ env.TARGET_ANDROID_ARCH }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/CMakeLists.txt', '**/*.cmake') }} - restore-keys: | - ${{ runner.os }}-gradle-${{ matrix.min-sdk }}-${{ env.TARGET_ANDROID_ARCH }}- - ${{ runner.os }}-gradle- - - name: Test Android SQLite build flags - run: example/android/gradlew --project-dir scripts/android-sqlite-flags testSqliteFlags --no-daemon - - - name: Check Gradle configuration cache - if: matrix.min-sdk == '24' - working-directory: example/android - run: | - # React Native creates the autolinking file on the first run. - ./gradlew :react-native-nitro-sqlite:help --configuration-cache --no-daemon - ./gradlew :react-native-nitro-sqlite:help --configuration-cache --no-daemon - ./gradlew :react-native-nitro-sqlite:help --configuration-cache --no-daemon | tee "$RUNNER_TEMP/nitro-sqlite-configuration-cache.log" - grep -q 'Configuration cache entry reused' "$RUNNER_TEMP/nitro-sqlite-configuration-cache.log" - - - name: Run Gradle Build for example/android/ - working-directory: example/android - run: ./gradlew :app:assembleDebug --no-daemon --build-cache -PreactNativeArchitectures=${{ env.TARGET_ANDROID_ARCH }} - - # Gradle cache doesn't like daemons - - name: Stop Gradle Daemon - working-directory: example/android - run: ./gradlew --stop diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml deleted file mode 100644 index 522c5b4c..00000000 --- a/.github/workflows/build-ios.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: Build iOS - -on: - push: - branches: - - main - paths: &ios_paths - - ".github/workflows/build-ios.yml" - - "example/ios/**" - - "packages/react-native-nitro-sqlite/nitrogen/generated/shared/**" - - "packages/react-native-nitro-sqlite/nitrogen/generated/ios/**" - - "packages/react-native-nitro-sqlite/src/specs/**" - - "packages/react-native-nitro-sqlite/cpp/**" - - "packages/react-native-nitro-sqlite/ios/**" - - "packages/react-native-nitro-sqlite-vec/cpp/**" - - "packages/react-native-nitro-sqlite/RNNitroSQLite.podspec" - - "packages/react-native-nitro-sqlite-vec/RNNitroSqliteVec.podspec" - - "scripts/test-podspec-threadsafe.rb" - - "example/Gemfile.lock" - - "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*" - - "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" - pull_request: - paths: *ios_paths - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} - cancel-in-progress: true - -env: - USE_CCACHE: 1 - -jobs: - build: - name: Build iOS Example App - runs-on: macos-26 - strategy: - matrix: - include: - - name: static_frameworks - use_frameworks: static - - name: no_frameworks - use_frameworks: "" # intentionally unset - steps: - - uses: actions/checkout@v7 - - - name: Test SQLite thread-safety pod configuration - run: ruby scripts/test-podspec-threadsafe.rb - - - uses: oven-sh/setup-bun@v2 - - - name: Set USE_FRAMEWORKS - if: matrix.use_frameworks != '' - run: echo "USE_FRAMEWORKS=${{ matrix.use_frameworks }}" >> $GITHUB_ENV - - - name: Install npm dependencies (bun) - run: bun install - - - name: Install Ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - max-size: 1.5G - key: ${{ runner.os }}-${{ matrix.use_frameworks }}-ccache-example-ios - create-symlink: true - - name: Setup ccache behavior - run: | - echo "CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros" >> $GITHUB_ENV - echo "CCACHE_FILECLONE=true" >> $GITHUB_ENV - 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 26.5 - run: sudo xcode-select -s "/Applications/Xcode_26.5.app/Contents/Developer" - - - name: Restore Pods cache - uses: actions/cache@v6 - with: - path: example/ios/Pods - key: ${{ runner.os }}-${{ matrix.use_frameworks }}-pods-v2-${{ hashFiles('**/Podfile.lock', '**/Gemfile.lock') }} - - name: Clean generated iOS codegen - run: rm -rf example/ios/build/generated - - name: Install Pods - working-directory: example - run: bun pods - - - name: Restore DerivedData cache - uses: actions/cache@v6 - with: - path: example/ios/build/DerivedData - key: ${{ runner.os }}-${{ matrix.use_frameworks }}-dd-${{ hashFiles('**/Podfile.lock', '**/Gemfile.lock', '**/package.json', '**/bun.lock') }}-xcode26.5 - restore-keys: | - ${{ runner.os }}-${{ matrix.use_frameworks }}-dd-${{ hashFiles('**/Podfile.lock', '**/Gemfile.lock', '**/package.json', '**/bun.lock') }}-xcode26.5 - - - name: Build App - working-directory: example/ios - run: | - set -o pipefail - xcodebuild \ - CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \ - -derivedDataPath build/DerivedData -UseModernBuildSystem=YES \ - -workspace NitroSQLiteExample.xcworkspace \ - -scheme NitroSQLiteExample \ - -sdk iphonesimulator \ - -configuration Debug \ - -destination 'generic/platform=iOS Simulator' \ - -showBuildTimingSummary \ - ONLY_ACTIVE_ARCH=YES \ - build \ - CODE_SIGNING_ALLOWED=NO | xcbeautify --renderer github-actions diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml deleted file mode 100644 index a252a4a3..00000000 --- a/.github/workflows/build-macos.yml +++ /dev/null @@ -1,120 +0,0 @@ -name: Build macOS - -on: - push: - branches: - - main - paths: &macos_paths - - ".github/workflows/build-macos.yml" - - "example/macos/**" - - "example/src/**" - - "example/app.json" - - "example/index.js" - - "example/babel.config*.js" - - "packages/react-native-nitro-sqlite/src/**" - - "packages/react-native-nitro-sqlite/cpp/**" - - "packages/react-native-nitro-sqlite/ios/**" - - "packages/react-native-nitro-sqlite/nitrogen/generated/shared/**" - - "packages/react-native-nitro-sqlite/nitrogen/generated/ios/**" - - "packages/react-native-nitro-sqlite/RNNitroSQLite.podspec" - - "packages/react-native-nitro-sqlite/react-native.config.js" - - "packages/react-native-nitro-sqlite/nitro.json" - - "packages/react-native-nitro-sqlite/package.json" - - "packages/react-native-nitro-sqlite-vec/src/**" - - "packages/react-native-nitro-sqlite-vec/cpp/**" - - "packages/react-native-nitro-sqlite-vec/RNNitroSqliteVec.podspec" - - "packages/react-native-nitro-sqlite-vec/react-native.config.js" - - "packages/react-native-nitro-sqlite-vec/package.json" - - "patches/react-native-nitro-modules*" - - "example/macos/Podfile.lock" - - "example/Gemfile.lock" - - "bun.lock" - - "package.json" - - "example/package.json" - - "example/macos/package.json" - - "example/react-native.config.js" - - "example/macos/react-native.config.js" - - "!example/macos/scripts/test-macos*.mjs" - - "!example/src/tests/**" - - "!packages/react-native-nitro-sqlite/src/__tests__/**" - - "!packages/react-native-nitro-sqlite-vec/src/__tests__/**" - pull_request: - paths: *macos_paths - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} - cancel-in-progress: true - -env: - USE_CCACHE: 1 - -jobs: - build: - name: Build macOS Example App - runs-on: macos-26 - steps: - - uses: actions/checkout@v7 - - uses: oven-sh/setup-bun@v2 - - - name: Install npm dependencies (bun) - run: bun install - - - name: Install Ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - max-size: 1.5G - key: ${{ runner.os }}-ccache-example-macos - create-symlink: true - - name: Setup ccache behavior - run: | - { - echo "CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros" - echo "CCACHE_FILECLONE=true" - echo "CCACHE_DEPEND=true" - 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 26.5 - run: sudo xcode-select -s "/Applications/Xcode_26.5.app/Contents/Developer" - - - name: Restore Pods cache - uses: actions/cache@v6 - with: - path: example/macos/Pods - key: ${{ runner.os }}-pods-macos-${{ hashFiles('example/macos/Podfile.lock', 'example/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-pods-macos- - - name: Clean generated macOS codegen - run: rm -rf example/macos/build/generated - - name: Install Pods - run: bun --cwd example pods:macos - - - name: Restore DerivedData cache - uses: actions/cache@v6 - with: - path: example/macos/build/DerivedData - key: ${{ runner.os }}-dd-macos-${{ hashFiles('example/macos/Podfile.lock', 'example/Gemfile.lock', '**/package.json', '**/bun.lock') }}-xcode26.5 - restore-keys: | - ${{ runner.os }}-dd-macos-${{ hashFiles('example/macos/Podfile.lock', 'example/Gemfile.lock', '**/package.json', '**/bun.lock') }}-xcode26.5 - - - name: Build App - working-directory: example/macos - run: | - set -o pipefail - xcodebuild \ - -derivedDataPath build/DerivedData -UseModernBuildSystem=YES \ - -workspace NitroSQLiteExample.xcworkspace \ - -scheme NitroSQLiteExample-macOS \ - -configuration Debug \ - -destination 'platform=macOS,arch=arm64' \ - -showBuildTimingSummary \ - ONLY_ACTIVE_ARCH=YES \ - build \ - CODE_SIGNING_ALLOWED=NO | xcbeautify --renderer github-actions diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..6459e165 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,189 @@ +name: CI + +on: + push: + branches: [main] + paths: &ci_paths + - '.github/**' + - 'packages/**' + - 'example/**' + - 'docs/**' + - 'scripts/**' + - 'config/**' + - 'patches/**' + - 'package.json' + - 'bun.lock' + - 'tsconfig.json' + - '.clang-format' + - '.prettierrc.js' + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + paths: *ci_paths + schedule: + - cron: '17 5 * * 1' + workflow_dispatch: + inputs: + full: + description: 'Run all checks and secondary native configurations' + type: boolean + default: true + workflow_call: + inputs: + full: + type: boolean + default: false + +permissions: + contents: read + +concurrency: + group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ inputs.full || github.event_name == 'schedule' }} + cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }} + +jobs: + checks: + name: Fast checks + runs-on: ubuntu-24.04 + timeout-minutes: 15 + outputs: + android: ${{ steps.select.outputs.android }} + 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 + with: + fetch-depth: 0 + - uses: actions/setup-node@v7 + with: + node-version: 24 + - name: Select affected checks + id: select + run: node scripts/ci.ts + env: + CI_BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before || github.sha }} + CI_FULL: ${{ inputs.full || github.event_name == 'schedule' }} + - name: Test CI routing + run: | + node --test scripts/ci.test.ts + ruby scripts/ci-pod-lockfiles.test.rb + - uses: oven-sh/setup-bun@v2 + if: steps.select.outputs.dependencies == 'true' + with: + bun-version: 1.3.1 + - name: Refresh dependency update lockfile + if: steps.select.outputs.dependencies == 'true' && github.event.pull_request.user.login == 'dependabot[bot]' + run: bun install --lockfile-only --ignore-scripts + - name: Install dependencies + if: steps.select.outputs.dependencies == 'true' + run: bun install --frozen-lockfile + - name: Synchronize workspace lockfile metadata + if: steps.select.outputs.dependencies == 'true' + run: bun run sync:lockfile + - name: Attach prepared lockfiles + if: always() && steps.select.outputs.dependencies == 'true' + uses: actions/upload-artifact@v4 + with: + name: ci-lockfiles + path: | + bun.lock + example/ios/Podfile.lock + example/macos/Podfile.lock + retention-days: 1 + - name: Require committed dependency resolutions + if: steps.select.outputs.dependencies == 'true' + run: | + bun run check:lockfile + 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') + run: node scripts/ci-dependencies.ts + env: + CI_BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before || github.sha }} + CI_FULL: ${{ inputs.full || github.event_name == 'schedule' }} + - name: Test dependency routing and release preflight + if: steps.select.outputs.dependencies == 'true' + run: | + node --test scripts/ci-dependencies.test.ts + bun run test:release + - name: Compile TypeScript + if: steps.select.outputs.typescript == 'true' + run: bun typecheck + - name: Lint TypeScript + if: steps.select.outputs.typescript == 'true' + run: | + bun --cwd example lint + bun --cwd packages/react-native-nitro-sqlite lint + git diff --exit-code HEAD -- . ':(exclude)bun.lock' + - name: Test JavaScript wrappers and example runners + if: steps.select.outputs.typescript == 'true' + run: | + (cd packages/react-native-nitro-sqlite && ../../node_modules/.bin/jest --coverage --runInBand) + (cd packages/react-native-nitro-sqlite-vec && ../../node_modules/.bin/jest --coverage --runInBand) + (cd example && ../node_modules/.bin/jest --config jest.mocha.config.js --runInBand --watchman=false) + node --test example/macos/scripts/test-macos.test.mjs + - name: Format C++ + if: steps.select.outputs.cpp_format == 'true' + run: | + bash scripts/clang-format.sh + git diff --exit-code HEAD -- . ':(exclude)bun.lock' + - 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 + if: steps.select.outputs.ios == 'true' + run: ruby scripts/test-podspec-threadsafe.rb + - name: Check documentation + if: steps.select.outputs.docs == 'true' + run: | + bun docs typecheck + bun docs build + + lockfiles: + name: Native lockfiles + needs: checks + if: >- + github.event_name != 'push' && !github.event.pull_request.draft && + (needs.checks.outputs.ios_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 + needs: [checks, lockfiles] + if: >- + !cancelled() && needs.checks.result == 'success' && + (needs.lockfiles.result == 'success' || needs.lockfiles.result == 'skipped') && + github.event_name != 'push' && !github.event.pull_request.draft && + needs.checks.outputs.android == 'true' + uses: ./.github/workflows/test-harness-android.yml + with: + full: ${{ inputs.full || github.event_name == 'schedule' }} + configuration: ${{ needs.checks.outputs.android_configuration == 'true' }} + + ios: + name: iOS + needs: [checks, lockfiles] + if: >- + !cancelled() && needs.checks.result == 'success' && + (needs.lockfiles.result == 'success' || needs.lockfiles.result == 'skipped') && + github.event_name != 'push' && !github.event.pull_request.draft && + needs.checks.outputs.ios == 'true' + uses: ./.github/workflows/test-harness-ios.yml + with: + full: ${{ inputs.full || github.event_name == 'schedule' }} + + macos: + name: macOS + needs: [checks, lockfiles] + if: >- + !cancelled() && needs.checks.result == 'success' && + (needs.lockfiles.result == 'success' || needs.lockfiles.result == 'skipped') && + github.event_name != 'push' && !github.event.pull_request.draft && + needs.checks.outputs.macos == 'true' + uses: ./.github/workflows/test-macos.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 3931e9b5..00000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Documentation - -on: - push: - branches: [main] - paths: - - "docs/**" - - "packages/react-native-nitro-sqlite/src/**" - - "packages/react-native-nitro-sqlite/package.json" - - "packages/react-native-nitro-sqlite-vec/src/**" - - "packages/react-native-nitro-sqlite-vec/package.json" - - "config/tsconfig.json" - - "package.json" - - "bun.lock" - - ".github/workflows/docs.yml" - pull_request: - paths: - - "docs/**" - - "packages/react-native-nitro-sqlite/src/**" - - "packages/react-native-nitro-sqlite/package.json" - - "packages/react-native-nitro-sqlite-vec/src/**" - - "packages/react-native-nitro-sqlite-vec/package.json" - - "config/tsconfig.json" - - "package.json" - - "bun.lock" - - ".github/workflows/docs.yml" - -permissions: - contents: read - -concurrency: - group: docs-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - check: - name: Typecheck and build - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v7 - - uses: actions/setup-node@v7 - with: - node-version: 22 - - uses: oven-sh/setup-bun@v2 - with: - bun-version: 1.3.1 - - name: Install dependencies - run: bun install --frozen-lockfile - - name: Check types - run: bun docs typecheck - - name: Build site - run: bun docs build diff --git a/.github/workflows/lint-cpp.yml b/.github/workflows/lint-cpp.yml deleted file mode 100644 index 2c0b0863..00000000 --- a/.github/workflows/lint-cpp.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Lint C++ - -on: - push: - branches: - - main - paths: &cpp_paths - - ".github/workflows/lint-cpp.yml" - - ".clang-format" - - "scripts/clang-format.sh" - - "packages/react-native-nitro-sqlite/cpp/**" - - "packages/react-native-nitro-sqlite/tests/cpp/**" - pull_request: - paths: *cpp_paths - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} - cancel-in-progress: true - -jobs: - lint: - name: Format C++ - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v7 - - uses: oven-sh/setup-bun@v2 - - - name: Run clang-format - run: bun run lint-cpp - - - name: Verify no files have changed after format - run: git diff --exit-code HEAD -- . ':(exclude)bun.lock' diff --git a/.github/workflows/lint-typescript.yml b/.github/workflows/lint-typescript.yml deleted file mode 100644 index 0002c24f..00000000 --- a/.github/workflows/lint-typescript.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: Lint TypeScript - -permissions: - checks: write - contents: read - pull-requests: read - -on: - push: - branches: - - main - paths: &typescript_paths - - ".github/workflows/lint-typescript.yml" - - ".prettierrc.js" - - "config/**" - - "tsconfig.json" - - "package.json" - - "bun.lock" - - "patches/**" - - "example/**/*.ts" - - "example/**/*.tsx" - - "example/**/*.js" - - "example/**/*.jsx" - - "example/**/*.mjs" - - "example/tsconfig.json" - - "example/app.json" - - "example/package.json" - - "example/macos/package.json" - - "packages/react-native-nitro-sqlite/**/*.ts" - - "packages/react-native-nitro-sqlite/**/*.tsx" - - "packages/react-native-nitro-sqlite/**/*.js" - - "packages/react-native-nitro-sqlite/**/*.jsx" - - "packages/react-native-nitro-sqlite/tsconfig.json" - - "packages/react-native-nitro-sqlite/tsconfig.build.json" - - "packages/react-native-nitro-sqlite/package.json" - - "packages/react-native-nitro-sqlite/nitro.json" - - "packages/react-native-nitro-sqlite-vec/**/*.ts" - - "packages/react-native-nitro-sqlite-vec/**/*.tsx" - - "packages/react-native-nitro-sqlite-vec/**/*.js" - - "packages/react-native-nitro-sqlite-vec/**/*.jsx" - - "packages/react-native-nitro-sqlite-vec/tsconfig.json" - - "packages/react-native-nitro-sqlite-vec/package.json" - pull_request: - paths: *typescript_paths - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} - cancel-in-progress: true - -jobs: - tsc: - name: Compile TypeScript (tsc) - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v7 - - uses: oven-sh/setup-bun@v2 - - uses: reviewdog/action-setup@v1 - - - name: Install npm dependencies (bun) - run: bun install - - - name: Run TypeScript (tsc) - run: | - set -o pipefail - bun typecheck | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-level=error -tee - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - lint: - name: Lint and test TypeScript - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v7 - - uses: oven-sh/setup-bun@v2 - - - name: Install npm dependencies (bun) - run: bun install - - - name: Run ESLint with auto-fix in example - working-directory: example - run: bun lint - - name: Run ESLint with auto-fix in react-native-nitro-sqlite - working-directory: packages/react-native-nitro-sqlite - run: bun lint - - - name: Verify no files have changed after auto-fix - run: git diff --exit-code HEAD -- . ':(exclude)bun.lock' - - - name: Test core JavaScript wrappers - working-directory: packages/react-native-nitro-sqlite - run: ../../node_modules/.bin/jest --coverage --runInBand - - - name: Test sqlite-vec helpers - working-directory: packages/react-native-nitro-sqlite-vec - run: ../../node_modules/.bin/jest --coverage --runInBand - - - name: Test the in-app Mocha runner - working-directory: example - run: ../node_modules/.bin/jest --config jest.mocha.config.js --runInBand --watchman=false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d89ee9f1..70175143 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,8 +18,17 @@ concurrency: cancel-in-progress: false jobs: + preflight: + name: Release compatibility checks + permissions: + contents: read + uses: ./.github/workflows/ci.yml + with: + full: true + release: name: Publish packages and GitHub release + needs: preflight runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-cpp.yml b/.github/workflows/test-cpp.yml deleted file mode 100644 index fe86430c..00000000 --- a/.github/workflows/test-cpp.yml +++ /dev/null @@ -1,127 +0,0 @@ -name: Test C++ - -on: - push: - branches: - - main - paths: &cpp_test_paths - - ".github/workflows/test-cpp.yml" - - "packages/react-native-nitro-sqlite/cpp/NitroSQLiteDatabaseMigration.*" - - "packages/react-native-nitro-sqlite/cpp/NitroSQLiteDatabaseConnections.*" - - "packages/react-native-nitro-sqlite/cpp/NitroSQLiteExecuteBatch.*" - - "packages/react-native-nitro-sqlite/cpp/NitroSQLiteOperations.*" - - "packages/react-native-nitro-sqlite/cpp/NitroSQLiteStatementGroup.hpp" - - "packages/react-native-nitro-sqlite/cpp/sqlite/sqlite3.*" - - "packages/react-native-nitro-sqlite/cpp/sqlite/sqlite3-symbol-prefix.h" - - "packages/react-native-nitro-sqlite-vec/cpp/**" - - "packages/react-native-nitro-sqlite/tests/cpp/**" - - "scripts/generate-sqlite-symbol-prefix.py" - - "scripts/test-private-sqlite-symbols.sh" - pull_request: - paths: *cpp_test_paths - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} - cancel-in-progress: true - -jobs: - test: - name: Database lifecycle tests - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v7 - - - name: Check private SQLite symbols and coexistence - run: | - python3 scripts/generate-sqlite-symbol-prefix.py --check - sh scripts/test-private-sqlite-symbols.sh - - - name: Build bundled SQLite - run: | - clang \ - -std=c11 \ - -DSQLITE_THREADSAFE=2 \ - -c packages/react-native-nitro-sqlite/cpp/sqlite/sqlite3.c \ - -o /tmp/sqlite3.o - - - name: Build migration tests - run: | - clang++ \ - -std=c++20 \ - -Wall \ - -Wextra \ - -Werror \ - -Ipackages/react-native-nitro-sqlite/cpp \ - -Ipackages/react-native-nitro-sqlite/cpp/sqlite \ - packages/react-native-nitro-sqlite/cpp/NitroSQLiteDatabaseMigration.cpp \ - packages/react-native-nitro-sqlite/tests/cpp/databaseMigration.test.cpp \ - /tmp/sqlite3.o \ - -ldl \ - -lm \ - -pthread \ - -o /tmp/databaseMigrationTests - - - name: Run migration tests - run: /tmp/databaseMigrationTests - - - name: Build connection tests - run: | - clang++ \ - -std=c++20 \ - -Wall \ - -Wextra \ - -Werror \ - -Ipackages/react-native-nitro-sqlite/cpp \ - -Ipackages/react-native-nitro-sqlite/cpp/sqlite \ - packages/react-native-nitro-sqlite/cpp/NitroSQLiteDatabaseConnections.cpp \ - packages/react-native-nitro-sqlite/cpp/NitroSQLiteDatabaseMigration.cpp \ - packages/react-native-nitro-sqlite/tests/cpp/databaseConnections.test.cpp \ - /tmp/sqlite3.o \ - -ldl \ - -lm \ - -pthread \ - -o /tmp/databaseConnectionsTests - - - name: Run connection tests - run: /tmp/databaseConnectionsTests - - - name: Build and run statement group tests - run: | - clang++ \ - -std=c++20 \ - -Wall \ - -Wextra \ - -Werror \ - -Ipackages/react-native-nitro-sqlite/cpp \ - -Ipackages/react-native-nitro-sqlite/cpp/sqlite \ - packages/react-native-nitro-sqlite/tests/cpp/statementGroup.test.cpp \ - /tmp/sqlite3.o \ - -ldl \ - -lm \ - -pthread \ - -o /tmp/statementGroupTests - /tmp/statementGroupTests - - - name: Build and run thread safety gate test - run: | - clang \ - -std=c11 \ - -DSQLITE_THREADSAFE=0 \ - -c packages/react-native-nitro-sqlite/cpp/sqlite/sqlite3.c \ - -o /tmp/sqlite3-threadsafe-0.o - clang++ \ - -std=c++20 \ - -Wall \ - -Wextra \ - -Werror \ - -Ipackages/react-native-nitro-sqlite/cpp \ - -Ipackages/react-native-nitro-sqlite/cpp/sqlite \ - packages/react-native-nitro-sqlite/cpp/NitroSQLiteDatabaseConnections.cpp \ - packages/react-native-nitro-sqlite/cpp/NitroSQLiteDatabaseMigration.cpp \ - packages/react-native-nitro-sqlite/tests/cpp/databaseConnectionsThreadsafe.test.cpp \ - /tmp/sqlite3-threadsafe-0.o \ - -ldl \ - -lm \ - -pthread \ - -o /tmp/databaseConnectionsThreadsafeTests - /tmp/databaseConnectionsThreadsafeTests diff --git a/.github/workflows/test-harness-android.yml b/.github/workflows/test-harness-android.yml index 45eb1384..b5a6278d 100644 --- a/.github/workflows/test-harness-android.yml +++ b/.github/workflows/test-harness-android.yml @@ -1,71 +1,84 @@ -name: Test Harness Android +name: Build and test Android on: - workflow_dispatch: - pull_request: - paths: - - ".github/workflows/test-harness-android.yml" - - "example/android/**" - - "example/src/tests/**" - - "example/tests/**" - - "example/rn-harness.config.mjs" - - "example/jest.config.js" - - "packages/react-native-nitro-sqlite/cpp/**" - - "packages/react-native-nitro-sqlite/android/**" - - "packages/react-native-nitro-sqlite/src/**" - - "packages/react-native-nitro-sqlite/nitrogen/generated/shared/**" - - "packages/react-native-nitro-sqlite/nitrogen/generated/android/**" - - "packages/react-native-nitro-sqlite-vec/cpp/**" - - "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*" - - "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__/**" + workflow_call: + inputs: + full: + type: boolean + default: false + configuration: + type: boolean + default: false -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} - cancel-in-progress: true +permissions: + contents: read env: TARGET_ANDROID_ARCH: x86_64 jobs: test: - name: Harness Tests (Android) - runs-on: ubuntu-latest - + name: Android integration tests, minSdk ${{ matrix.min_sdk }} + runs-on: ubuntu-24.04 + timeout-minutes: 30 + strategy: + matrix: + min_sdk: ${{ fromJSON(inputs.full && '["24", "26"]' || '["24"]') }} steps: + - name: Enable KVM group permissions + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm - uses: actions/checkout@v7 + - uses: actions/download-artifact@v4 + with: + name: ci-lockfiles + path: . - uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.3.1 + + - name: Install npm dependencies (bun) + run: bun install --frozen-lockfile + + - name: Set minSdk in build.gradle + run: sed -i "s/minSdkVersion = 24/minSdkVersion = ${{ matrix.min_sdk }}/g" example/android/build.gradle - name: Setup JDK 17 uses: actions/setup-java@v6 with: distribution: "zulu" java-version: 17 + java-package: jdk - - name: Enable KVM group perms - run: | - echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules - sudo udevadm control --reload-rules - sudo udevadm trigger --name-match=kvm + - name: Restore Gradle dependencies + uses: actions/cache@v6 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'bun.lock') }} + restore-keys: | + ${{ runner.os }}-gradle-v2- + - name: Test Android SQLite build flags + run: example/android/gradlew --project-dir scripts/android-sqlite-flags testSqliteFlags --no-daemon - - name: Install dependencies (bun) - run: bun install + - name: Check Gradle configuration cache + if: matrix.min_sdk == '24' && (inputs.full || inputs.configuration) + working-directory: example/android + run: | + # React Native creates the autolinking file on the first run. + ./gradlew :react-native-nitro-sqlite:help --configuration-cache --no-daemon + ./gradlew :react-native-nitro-sqlite:help --configuration-cache --no-daemon + ./gradlew :react-native-nitro-sqlite:help --configuration-cache --no-daemon | tee "$RUNNER_TEMP/nitro-sqlite-configuration-cache.log" + grep -q 'Configuration cache entry reused' "$RUNNER_TEMP/nitro-sqlite-configuration-cache.log" - name: Build Android app working-directory: example/android - run: >- - ./gradlew :app:assembleDebug --no-daemon - -PreactNativeArchitectures=${{ env.TARGET_ANDROID_ARCH }} + run: ./gradlew :app:assembleDebug --no-daemon --build-cache -PreactNativeArchitectures=${{ env.TARGET_ANDROID_ARCH }} - - name: Run react-native-harness on Android + - name: Run Android integration tests uses: callstackincubator/react-native-harness@v1.5.0 with: app: android/app/build/outputs/apk/debug/app-debug.apk @@ -73,3 +86,7 @@ jobs: projectRoot: example packageManager: bun cacheAvd: false + - name: Stop Gradle Daemon + if: always() + working-directory: example/android + run: ./gradlew --stop diff --git a/.github/workflows/test-harness-ios.yml b/.github/workflows/test-harness-ios.yml index dcc71b0b..feec1109 100644 --- a/.github/workflows/test-harness-ios.yml +++ b/.github/workflows/test-harness-ios.yml @@ -1,54 +1,54 @@ -name: Test Harness iOS +name: Build and test iOS on: - workflow_dispatch: - pull_request: - paths: - - ".github/workflows/test-harness-ios.yml" - - "example/ios/**" - - "example/src/tests/**" - - "example/tests/**" - - "example/rn-harness.config.mjs" - - "example/jest.config.js" - - "packages/react-native-nitro-sqlite/cpp/**" - - "packages/react-native-nitro-sqlite/ios/**" - - "packages/react-native-nitro-sqlite/src/**" - - "packages/react-native-nitro-sqlite/nitrogen/generated/shared/**" - - "packages/react-native-nitro-sqlite/nitrogen/generated/ios/**" - - "packages/react-native-nitro-sqlite-vec/cpp/**" - - "packages/react-native-nitro-sqlite/RNNitroSQLite.podspec" - - "packages/react-native-nitro-sqlite-vec/RNNitroSqliteVec.podspec" - - "example/Gemfile.lock" - - "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*" - - "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__/**" + workflow_call: + inputs: + full: + type: boolean + default: false -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} - cancel-in-progress: true +permissions: + contents: read jobs: test: - name: Harness Tests (iOS) - runs-on: macOS-26 + name: iOS integration tests, ${{ matrix.config.name }}, Xcode ${{ matrix.config.xcode }} + runs-on: macos-26 + 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"}]') }} env: + USE_CCACHE: 1 + USE_FRAMEWORKS: ${{ matrix.config.frameworks }} IOS_SIMULATOR_NAME: iPhone 17 Pro - IOS_SIMULATOR_OS: "26.2" - + IOS_SIMULATOR_OS: ${{ matrix.config.xcode }} steps: - uses: actions/checkout@v7 + - uses: actions/download-artifact@v4 + with: + name: ci-lockfiles + path: . + - uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.3.1 - - name: Install dependencies (bun) - run: bun install + - name: Install npm dependencies (bun) + run: bun install --frozen-lockfile + + - name: Install Ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + max-size: 500M + key: ${{ runner.os }}-${{ matrix.config.name }}-ccache-example-ios-xcode${{ matrix.config.xcode }} + create-symlink: true + - name: Setup ccache behavior + run: | + echo "CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros" >> $GITHUB_ENV + echo "CCACHE_FILECLONE=true" >> $GITHUB_ENV + echo "CCACHE_DEPEND=true" >> $GITHUB_ENV + echo "CCACHE_INODECACHE=true" >> $GITHUB_ENV - name: Setup Ruby (bundle) uses: ruby/setup-ruby@v1 @@ -57,8 +57,8 @@ jobs: bundler-cache: true working-directory: example - - name: Select Xcode 26.2 - run: sudo xcode-select -s "/Applications/Xcode_26.2.app/Contents/Developer" + - name: Select Xcode ${{ matrix.config.xcode }} + run: sudo xcode-select -s "/Applications/Xcode_${{ matrix.config.xcode }}.app/Contents/Developer" - name: Start iOS simulator run: | @@ -83,32 +83,33 @@ jobs: working-directory: example run: bun pods - - name: Build debug app + - name: Build App working-directory: example/ios run: | - set -euo pipefail - + set -o pipefail xcodebuild \ CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \ - -derivedDataPath build -UseModernBuildSystem=YES \ + -derivedDataPath build/DerivedData -UseModernBuildSystem=YES \ -workspace NitroSQLiteExample.xcworkspace \ -scheme NitroSQLiteExample \ -sdk iphonesimulator \ -configuration Debug \ - -destination "generic/platform=iOS Simulator" \ + -destination 'generic/platform=iOS Simulator' \ + -showBuildTimingSummary \ + ONLY_ACTIVE_ARCH=YES \ build \ - CODE_SIGNING_ALLOWED=NO + CODE_SIGNING_ALLOWED=NO | xcbeautify --renderer github-actions - name: Wait for iOS simulator timeout-minutes: 10 run: xcrun simctl bootstatus "$IOS_SIMULATOR_UDID" -b - - name: Run react-native-harness on iOS + - name: Run iOS integration tests uses: callstackincubator/react-native-harness@v1.5.0 env: HARNESS_DEBUG: "1" with: - app: ios/build/Build/Products/Debug-iphonesimulator/NitroSQLiteExample.app + app: ios/build/DerivedData/Build/Products/Debug-iphonesimulator/NitroSQLiteExample.app runner: ios projectRoot: example packageManager: bun diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 3f6ae4be..c549fe28 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -1,60 +1,46 @@ -name: Test macOS +name: Build and test macOS on: - workflow_dispatch: - pull_request: - paths: - - ".github/workflows/test-macos.yml" - - "example/macos/**" - - "example/src/**" - - "example/tests/**" - - "example/app.json" - - "example/index.js" - - "example/babel.config*.js" - - "packages/react-native-nitro-sqlite/src/**" - - "packages/react-native-nitro-sqlite/cpp/**" - - "packages/react-native-nitro-sqlite/ios/**" - - "packages/react-native-nitro-sqlite/nitrogen/generated/shared/**" - - "packages/react-native-nitro-sqlite/nitrogen/generated/ios/**" - - "packages/react-native-nitro-sqlite/RNNitroSQLite.podspec" - - "packages/react-native-nitro-sqlite/react-native.config.js" - - "packages/react-native-nitro-sqlite/nitro.json" - - "packages/react-native-nitro-sqlite/package.json" - - "packages/react-native-nitro-sqlite-vec/src/**" - - "packages/react-native-nitro-sqlite-vec/cpp/**" - - "packages/react-native-nitro-sqlite-vec/RNNitroSqliteVec.podspec" - - "packages/react-native-nitro-sqlite-vec/react-native.config.js" - - "packages/react-native-nitro-sqlite-vec/package.json" - - "patches/**" - - "example/macos/Podfile.lock" - - "example/Gemfile.lock" - - "bun.lock" - - "package.json" - - "example/package.json" - - "example/macos/package.json" - - "example/react-native.config.js" - - "example/macos/react-native.config.js" - - "!packages/react-native-nitro-sqlite/src/__tests__/**" - - "!packages/react-native-nitro-sqlite-vec/src/__tests__/**" + workflow_call: -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} - cancel-in-progress: true +permissions: + contents: read + +env: + USE_CCACHE: 1 jobs: test: - name: macOS Integration Tests + name: macOS integration tests runs-on: macos-26 - + timeout-minutes: 30 steps: - uses: actions/checkout@v7 + - uses: actions/download-artifact@v4 + with: + name: ci-lockfiles + path: . - uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.3.1 - - name: Install dependencies (bun) - run: bun install + - name: Install npm dependencies (bun) + run: bun install --frozen-lockfile - - name: Test desktop runner failure handling - run: node --test example/macos/scripts/test-macos.test.mjs + - name: Install Ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + max-size: 500M + key: ${{ runner.os }}-ccache-example-macos + create-symlink: true + - name: Setup ccache behavior + run: | + { + echo "CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros" + echo "CCACHE_FILECLONE=true" + echo "CCACHE_DEPEND=true" + echo "CCACHE_INODECACHE=true" + } >> "$GITHUB_ENV" - name: Setup Ruby (bundle) uses: ruby/setup-ruby@v1 @@ -66,22 +52,34 @@ jobs: - name: Select Xcode 26.5 run: sudo xcode-select -s "/Applications/Xcode_26.5.app/Contents/Developer" + - name: Restore Pods cache + uses: actions/cache@v6 + with: + path: example/macos/Pods + key: ${{ runner.os }}-pods-macos-${{ hashFiles('example/macos/Podfile.lock', 'example/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-pods-macos- + - name: Clean generated macOS codegen + run: rm -rf example/macos/build/generated - name: Install Pods run: bun --cwd example pods:macos - - name: Build debug app + - name: Build App working-directory: example/macos run: | - set -euo pipefail + set -o pipefail xcodebuild \ - -derivedDataPath build -UseModernBuildSystem=YES \ + -derivedDataPath build/DerivedData -UseModernBuildSystem=YES \ -workspace NitroSQLiteExample.xcworkspace \ -scheme NitroSQLiteExample-macOS \ -configuration Debug \ -destination 'platform=macOS,arch=arm64' \ + -showBuildTimingSummary \ + ONLY_ACTIVE_ARCH=YES \ build \ - CODE_SIGNING_ALLOWED=NO - + CODE_SIGNING_ALLOWED=NO | xcbeautify --renderer github-actions - name: Run macOS integration tests working-directory: example/macos + env: + MACOS_APP_PATH: build/DerivedData/Build/Products/Debug/NitroSQLiteExample.app run: bun run test diff --git a/.github/workflows/update-lockfiles.yml b/.github/workflows/update-lockfiles.yml index 4431a1ea..f60ea073 100644 --- a/.github/workflows/update-lockfiles.yml +++ b/.github/workflows/update-lockfiles.yml @@ -1,59 +1,68 @@ -name: "Update Lockfiles (bun.lock + Podfile.lock)" +name: Check native lockfiles on: - pull_request: - branches: - - main - paths: - - "example/package.json" - - "packages/react-native-nitro-sqlite/package.json" + workflow_call: + inputs: + ios: + type: boolean + default: false + macos: + type: boolean + default: false permissions: - contents: write + contents: read jobs: - update-lockfiles: - name: "Update lockfiles (Podfile.lock)" - if: github.event.pull_request.user.login == 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository + check: + name: Check CocoaPods dependency resolutions runs-on: macos-26 + timeout-minutes: 15 + env: + USE_FRAMEWORKS: static steps: - uses: actions/checkout@v7 + - uses: actions/download-artifact@v4 with: - fetch-depth: 0 - ref: ${{ github.event.pull_request.head.ref }} - + name: ci-lockfiles + path: . - uses: oven-sh/setup-bun@v2 - - - name: Setup Ruby (bundle) - uses: ruby/setup-ruby@v1 + with: + bun-version: 1.3.1 + - name: Install dependencies + run: bun install --frozen-lockfile + - uses: ruby/setup-ruby@v1 with: ruby-version: 3.3.0 bundler-cache: true working-directory: example - - name: Select Xcode 26.5 - run: sudo xcode-select -s "/Applications/Xcode_26.5.app/Contents/Developer" - - - run: | - bun install - - cd example - bundle install - bun pods - bun pods:macos - cd .. - - git add bun.lock - git add example/ios/Podfile.lock - git add example/macos/Podfile.lock - git add example/Gemfile.lock - - if git diff --cached --quiet; then - echo "Lockfiles are already up to date" - exit 0 - fi - - git config --global user.name 'dependabot[bot]' - git config --global user.email 'dependabot[bot]@users.noreply.github.com' - git commit --amend --no-edit - git push --force + 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 + if: always() + uses: actions/upload-artifact@v4 + 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[@]}" + git diff --exit-code -- example/Gemfile.lock diff --git a/bun.lock b/bun.lock index c3b057ea..3eb444d1 100644 --- a/bun.lock +++ b/bun.lock @@ -1,6 +1,5 @@ { "lockfileVersion": 1, - "configVersion": 0, "workspaces": { "": { "name": "react-native-nitro-sqlite-workspace", @@ -119,7 +118,7 @@ "@types/node": "^22.7.4", "@types/react": "^19.1.1", "@types/react-test-renderer": "^19.1.0", - "mocha": "^10.1.0", + "mocha": "^12.0.2", "postinstall-postinstall": "^2.1.0", "react-native-harness": "1.5.0", "react-test-renderer": "19.2.3", @@ -1609,7 +1608,7 @@ "devlop": ["devlop@1.1.0", "", { "dependencies": { "dequal": "^2.0.0" } }, "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA=="], - "diff": ["diff@5.2.0", "", {}, "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A=="], + "diff": ["diff@9.0.0", "", {}, "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw=="], "diff-sequences": ["diff-sequences@29.6.3", "", {}, "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q=="], @@ -1797,6 +1796,8 @@ "find-up": ["find-up@5.0.0", "", { "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng=="], + "find-up-simple": ["find-up-simple@1.0.1", "", {}, "sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ=="], + "find-yarn-workspace-root": ["find-yarn-workspace-root@2.0.0", "", { "dependencies": { "micromatch": "^4.0.2" } }, "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ=="], "flat": ["flat@5.0.2", "", { "bin": { "flat": "cli.js" } }, "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ=="], @@ -2081,7 +2082,7 @@ "is-unc-path": ["is-unc-path@1.0.0", "", { "dependencies": { "unc-path-regex": "^0.1.2" } }, "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ=="], - "is-unicode-supported": ["is-unicode-supported@2.1.0", "", {}, "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ=="], + "is-unicode-supported": ["is-unicode-supported@0.1.0", "", {}, "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw=="], "is-unsafe": ["is-unsafe@2.0.2", "", {}, "sha512-HgbIHPBH0KHHCcjLfGsCvhtPTVxjaAZlXjwdz7/GQC40SjSe4sfQsar8J5VFo8JOSbarkpV0OLG95bbaNd9aAQ=="], @@ -2471,7 +2472,7 @@ "mkdirp-classic": ["mkdirp-classic@0.5.3", "", {}, "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="], - "mocha": ["mocha@10.8.2", "", { "dependencies": { "ansi-colors": "^4.1.3", "browser-stdout": "^1.3.1", "chokidar": "^3.5.3", "debug": "^4.3.5", "diff": "^5.2.0", "escape-string-regexp": "^4.0.0", "find-up": "^5.0.0", "glob": "^8.1.0", "he": "^1.2.0", "js-yaml": "^4.1.0", "log-symbols": "^4.1.0", "minimatch": "^5.1.6", "ms": "^2.1.3", "serialize-javascript": "^6.0.2", "strip-json-comments": "^3.1.1", "supports-color": "^8.1.1", "workerpool": "^6.5.1", "yargs": "^16.2.0", "yargs-parser": "^20.2.9", "yargs-unparser": "^2.0.0" }, "bin": { "mocha": "bin/mocha.js", "_mocha": "bin/_mocha" } }, "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg=="], + "mocha": ["mocha@12.0.3", "", { "dependencies": { "browser-stdout": "^1.3.1", "chokidar": "^5.0.0", "debug": "^4.3.5", "diff": "^9.0.0", "find-up-simple": "^1.0.1", "glob": "^13.0.0", "is-path-inside": "^4.0.0", "is-unicode-supported": "^0.1.0", "js-yaml": "^5.0.0", "minimatch": "^10.2.2", "ms": "^2.1.3", "picocolors": "^1.1.1", "serialize-javascript": "^7.1.1", "strip-json-comments": "^5.0.3", "supports-color": "^8.1.1", "workerpool": "^10.0.0" }, "bin": { "mocha": "bin/mocha.js" } }, "sha512-beammieDdiWdkjANWeWPpkxUROYGi5FN88fPOkLiticz7HTg3Y+Pho3EYE6SUdcuWnZ3h2WD8EXCA55JF4o6wg=="], "motion": ["motion@12.43.0", "", { "dependencies": { "framer-motion": "^12.43.0", "tslib": "^2.4.0" }, "peerDependencies": { "@emotion/is-prop-valid": "*", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" }, "optionalPeers": ["@emotion/is-prop-valid", "react", "react-dom"] }, "sha512-BQgQbSa9Hn3/mtbib0MK53y6JSANa+YKUKlaYnWzAVDH424RYQ5LVpV3pNiWH00BA2z4ojsSdMzqT7g2FQwjuQ=="], @@ -2857,7 +2858,7 @@ "serialize-error": ["serialize-error@2.1.0", "", {}, "sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw=="], - "serialize-javascript": ["serialize-javascript@6.0.2", "", { "dependencies": { "randombytes": "^2.1.0" } }, "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g=="], + "serialize-javascript": ["serialize-javascript@7.1.2", "", {}, "sha512-GL2BWwVa6JydKO6l/ljVgjAZF4QJ3S7dWDWi53s5GZT8PJzD2fNxi67HANQGKAqPrwEpL5ba7gUBGi0Ls/sEoQ=="], "serve-static": ["serve-static@1.16.2", "", { "dependencies": { "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", "send": "0.19.0" } }, "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw=="], @@ -2983,7 +2984,7 @@ "strip-final-newline": ["strip-final-newline@2.0.0", "", {}, "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA=="], - "strip-json-comments": ["strip-json-comments@3.1.1", "", {}, "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="], + "strip-json-comments": ["strip-json-comments@5.0.3", "", {}, "sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw=="], "strnum": ["strnum@1.1.2", "", {}, "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA=="], @@ -3197,7 +3198,7 @@ "wordwrap": ["wordwrap@1.0.0", "", {}, "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q=="], - "workerpool": ["workerpool@6.5.1", "", {}, "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA=="], + "workerpool": ["workerpool@10.0.3", "", {}, "sha512-6z2Iis68Wqth93/G/wJP9u+R3O+d2XTlgWChGCwuT1qLbBsOYueGRZuJ++v3mtDP5KjYdy+WzvWC+VWETSVXJA=="], "wrap-ansi": ["wrap-ansi@9.0.2", "", { "dependencies": { "ansi-styles": "^6.2.1", "string-width": "^7.0.0", "strip-ansi": "^7.1.0" } }, "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww=="], @@ -3245,6 +3246,8 @@ "@conventional-changelog/git-client/semver": ["semver@7.7.3", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q=="], + "@eslint/eslintrc/strip-json-comments": ["strip-json-comments@3.1.1", "", {}, "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="], + "@inquirer/core/signal-exit": ["signal-exit@4.1.0", "", {}, "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw=="], "@inquirer/core/wrap-ansi": ["wrap-ansi@6.2.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA=="], @@ -3621,6 +3624,8 @@ "jest-config/slash": ["slash@3.0.0", "", {}, "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="], + "jest-config/strip-json-comments": ["strip-json-comments@3.1.1", "", {}, "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="], + "jest-each/pretty-format": ["pretty-format@30.2.0", "", { "dependencies": { "@jest/schemas": "30.0.5", "ansi-styles": "^5.2.0", "react-is": "^18.3.1" } }, "sha512-9uBdv/B4EefsuAL+pWqueZyZS2Ba+LxfFeQ9DN14HU4bN8bhaxKdkpjpB6fs9+pSjIBu+FXQHImEg8j/Lw0+vA=="], "jest-environment-node/@jest/types": ["@jest/types@29.6.3", "", { "dependencies": { "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", "@types/yargs": "^17.0.8", "chalk": "^4.0.0" } }, "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw=="], @@ -3695,8 +3700,6 @@ "lighthouse-logger/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], - "log-symbols/is-unicode-supported": ["is-unicode-supported@0.1.0", "", {}, "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw=="], - "logkitty/dayjs": ["dayjs@1.11.19", "", {}, "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw=="], "logkitty/yargs": ["yargs@15.4.1", "", { "dependencies": { "cliui": "^6.0.0", "decamelize": "^1.2.0", "find-up": "^4.1.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", "yargs-parser": "^18.1.2" } }, "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A=="], @@ -3777,15 +3780,13 @@ "micromatch/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], - "mocha/chokidar": ["chokidar@3.6.0", "", { "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw=="], + "mocha/glob": ["glob@13.0.6", "", { "dependencies": { "minimatch": "^10.2.2", "minipass": "^7.1.3", "path-scurry": "^2.0.2" } }, "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw=="], - "mocha/glob": ["glob@8.1.0", "", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^5.0.1", "once": "^1.3.0" } }, "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ=="], + "mocha/is-path-inside": ["is-path-inside@4.0.0", "", {}, "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA=="], - "mocha/minimatch": ["minimatch@5.1.6", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g=="], + "mocha/js-yaml": ["js-yaml@5.4.2", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.mjs" } }, "sha512-m+aqu+LwO1O6sIopafj8HUVl5aawITwZQe/yHpMCKjaWBaA/d07B/QdMb3529REftiU+RMMHL3Vlsw3hON7vWg=="], - "mocha/yargs": ["yargs@16.2.0", "", { "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.0", "y18n": "^5.0.5", "yargs-parser": "^20.2.2" } }, "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw=="], - - "mocha/yargs-parser": ["yargs-parser@20.2.9", "", {}, "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w=="], + "mocha/minimatch": ["minimatch@10.2.6", "", { "dependencies": { "brace-expansion": "^5.0.8" } }, "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A=="], "new-github-release-url/type-fest": ["type-fest@2.19.0", "", {}, "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA=="], @@ -3803,6 +3804,8 @@ "ora/chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="], + "ora/is-unicode-supported": ["is-unicode-supported@2.1.0", "", {}, "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ=="], + "ora/log-symbols": ["log-symbols@7.0.1", "", { "dependencies": { "is-unicode-supported": "^2.0.0", "yoctocolors": "^2.1.1" } }, "sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg=="], "ora/string-width": ["string-width@8.1.1", "", { "dependencies": { "get-east-asian-width": "^1.3.0", "strip-ansi": "^7.1.0" } }, "sha512-KpqHIdDL9KwYk22wEOg/VIqYbrnLeSApsKT/bSj6Ez7pn3CftUiLAv2Lccpq1ALcpLV9UX1Ppn92npZWu2w/aw=="], @@ -3901,6 +3904,8 @@ "react-native-nitro-sqlite-macos-example/@react-native/metro-config": ["@react-native/metro-config@0.81.6", "", { "dependencies": { "@react-native/js-polyfills": "0.81.6", "@react-native/metro-babel-transformer": "0.81.6", "metro-config": "^0.83.1", "metro-runtime": "^0.83.1" } }, "sha512-tdLKkC1Dv0EW6dayL0pAItbdWhrVZDCiTcyb43cLtkeaQYpJgXeRX+1PsmkFywZDn/ojxiGxe/HLg5yZH0gbdA=="], + "react-native-nitro-sqlite-macos-example/mocha": ["mocha@10.8.2", "", { "dependencies": { "ansi-colors": "^4.1.3", "browser-stdout": "^1.3.1", "chokidar": "^3.5.3", "debug": "^4.3.5", "diff": "^5.2.0", "escape-string-regexp": "^4.0.0", "find-up": "^5.0.0", "glob": "^8.1.0", "he": "^1.2.0", "js-yaml": "^4.1.0", "log-symbols": "^4.1.0", "minimatch": "^5.1.6", "ms": "^2.1.3", "serialize-javascript": "^6.0.2", "strip-json-comments": "^3.1.1", "supports-color": "^8.1.1", "workerpool": "^6.5.1", "yargs": "^16.2.0", "yargs-parser": "^20.2.9", "yargs-unparser": "^2.0.0" }, "bin": { "mocha": "bin/mocha.js", "_mocha": "bin/_mocha" } }, "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg=="], + "react-native-nitro-sqlite-macos-example/react": ["react@19.1.4", "", {}, "sha512-DHINL3PAmPUiK1uszfbKiXqfE03eszdt5BpVSuEAHb5nfmNPwnsy7g39h2t8aXFc/Bv99GH81s+j8dobtD+jOw=="], "react-native-nitro-sqlite-macos-example/react-native": ["react-native@0.81.6", "", { "dependencies": { "@jest/create-cache-key-function": "^29.7.0", "@react-native/assets-registry": "0.81.6", "@react-native/codegen": "0.81.6", "@react-native/community-cli-plugin": "0.81.6", "@react-native/gradle-plugin": "0.81.6", "@react-native/js-polyfills": "0.81.6", "@react-native/normalize-colors": "0.81.6", "@react-native/virtualized-lists": "0.81.6", "abort-controller": "^3.0.0", "anser": "^1.4.9", "ansi-regex": "^5.0.0", "babel-jest": "^29.7.0", "babel-plugin-syntax-hermes-parser": "0.29.1", "base64-js": "^1.5.1", "commander": "^12.0.0", "flow-enums-runtime": "^0.0.6", "glob": "^7.1.1", "invariant": "^2.2.4", "jest-environment-node": "^29.7.0", "memoize-one": "^5.0.0", "metro-runtime": "^0.83.1", "metro-source-map": "^0.83.1", "nullthrows": "^1.1.1", "pretty-format": "^29.7.0", "promise": "^8.3.0", "react-devtools-core": "^6.1.5", "react-refresh": "^0.14.0", "regenerator-runtime": "^0.13.2", "scheduler": "0.26.0", "semver": "^7.1.3", "stacktrace-parser": "^0.1.10", "whatwg-fetch": "^3.0.0", "ws": "^6.2.3", "yargs": "^17.6.2" }, "peerDependencies": { "@types/react": "^19.1.4", "react": "^19.1.4" }, "optionalPeers": ["@types/react"], "bin": { "react-native": "cli.js" } }, "sha512-X/tI8GqfzVaa+zfbE4+lySNN5UzwBIAVRHVZPKymOny9Acc5GYYcjAcEVfG3AM4h920YALWoSl8favnDmQEWIg=="], @@ -4107,8 +4112,6 @@ "@react-native-community/cli-doctor/ora/is-interactive": ["is-interactive@1.0.0", "", {}, "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w=="], - "@react-native-community/cli-doctor/ora/is-unicode-supported": ["is-unicode-supported@0.1.0", "", {}, "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw=="], - "@react-native-community/cli-platform-apple/@react-native-community/cli-tools/ora": ["ora@5.4.1", "", { "dependencies": { "bl": "^4.1.0", "chalk": "^4.1.0", "cli-cursor": "^3.1.0", "cli-spinners": "^2.5.0", "is-interactive": "^1.0.0", "is-unicode-supported": "^0.1.0", "log-symbols": "^4.1.0", "strip-ansi": "^6.0.0", "wcwidth": "^1.0.1" } }, "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ=="], "@react-native-community/cli-platform-apple/@react-native-community/cli-tools/semver": ["semver@7.7.3", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q=="], @@ -4125,8 +4128,6 @@ "@react-native-community/cli-tools/ora/is-interactive": ["is-interactive@1.0.0", "", {}, "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w=="], - "@react-native-community/cli-tools/ora/is-unicode-supported": ["is-unicode-supported@0.1.0", "", {}, "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw=="], - "@react-native-harness/jest/yargs/cliui": ["cliui@8.0.1", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" } }, "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ=="], "@react-native-harness/jest/yargs/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], @@ -4437,15 +4438,11 @@ "metro/yargs/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], - "mocha/chokidar/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], + "mocha/glob/minipass": ["minipass@7.1.3", "", {}, "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A=="], - "mocha/chokidar/readdirp": ["readdirp@3.6.0", "", { "dependencies": { "picomatch": "^2.2.1" } }, "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA=="], + "mocha/glob/path-scurry": ["path-scurry@2.0.2", "", { "dependencies": { "lru-cache": "^11.0.0", "minipass": "^7.1.2" } }, "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg=="], - "mocha/minimatch/brace-expansion": ["brace-expansion@2.0.2", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="], - - "mocha/yargs/cliui": ["cliui@7.0.4", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" } }, "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ=="], - - "mocha/yargs/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], + "mocha/minimatch/brace-expansion": ["brace-expansion@5.0.12", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ=="], "ora/strip-ansi/ansi-regex": ["ansi-regex@6.2.2", "", {}, "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg=="], @@ -4533,6 +4530,24 @@ "react-native-nitro-sqlite-macos-example/@react-native/metro-config/metro-runtime": ["metro-runtime@0.83.8", "", { "dependencies": { "@babel/runtime": "^7.25.0", "flow-enums-runtime": "^0.0.6" } }, "sha512-f7FfeM0pamq8vrvs8aO9KvIUabbUKe0WkHFpLt6Q9yIIIsORqNFwlgJeHGraOFPU7Cxqj5yLXkJu5bT1uwDXvw=="], + "react-native-nitro-sqlite-macos-example/mocha/chokidar": ["chokidar@3.6.0", "", { "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw=="], + + "react-native-nitro-sqlite-macos-example/mocha/diff": ["diff@5.2.0", "", {}, "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A=="], + + "react-native-nitro-sqlite-macos-example/mocha/glob": ["glob@8.1.0", "", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^5.0.1", "once": "^1.3.0" } }, "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ=="], + + "react-native-nitro-sqlite-macos-example/mocha/minimatch": ["minimatch@5.1.6", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g=="], + + "react-native-nitro-sqlite-macos-example/mocha/serialize-javascript": ["serialize-javascript@6.0.2", "", { "dependencies": { "randombytes": "^2.1.0" } }, "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g=="], + + "react-native-nitro-sqlite-macos-example/mocha/strip-json-comments": ["strip-json-comments@3.1.1", "", {}, "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="], + + "react-native-nitro-sqlite-macos-example/mocha/workerpool": ["workerpool@6.5.1", "", {}, "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA=="], + + "react-native-nitro-sqlite-macos-example/mocha/yargs": ["yargs@16.2.0", "", { "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.0", "y18n": "^5.0.5", "yargs-parser": "^20.2.2" } }, "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw=="], + + "react-native-nitro-sqlite-macos-example/mocha/yargs-parser": ["yargs-parser@20.2.9", "", {}, "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w=="], + "react-native-nitro-sqlite-macos-example/react-native/@react-native/codegen": ["@react-native/codegen@0.81.6", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/parser": "^7.25.3", "glob": "^7.1.1", "hermes-parser": "0.29.1", "invariant": "^2.2.4", "nullthrows": "^1.1.1", "yargs": "^17.6.2" } }, "sha512-9KoYRep/KDnELLLmIYTtIIEOClVUJ88pxWObb/0sjkacA7uL4SgfbAg7rWLURAQJWI85L1YS67IhdEqNNk1I7w=="], "react-native-nitro-sqlite-macos-example/react-native/@react-native/gradle-plugin": ["@react-native/gradle-plugin@0.81.6", "", {}, "sha512-atUItC5MZ6yaNaI0sbsoDwUdF+KMNZcMKBIrNhXlUyIj3x1AQ6Cf8CHHv6Qokn8ZFw+uU6GWmQSiOWYUbmi8Ag=="], @@ -4657,8 +4672,6 @@ "@react-native-community/cli-config-apple/@react-native-community/cli-tools/ora/is-interactive": ["is-interactive@1.0.0", "", {}, "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w=="], - "@react-native-community/cli-config-apple/@react-native-community/cli-tools/ora/is-unicode-supported": ["is-unicode-supported@0.1.0", "", {}, "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw=="], - "@react-native-community/cli-doctor/@react-native-community/cli-platform-apple/fast-xml-parser/strnum": ["strnum@2.4.2", "", { "dependencies": { "anynum": "^1.0.1" } }, "sha512-rDG3Ah4TV0k1hWvLSzkZtMmLN9+eS+h3knq4MP6A42Y3Yh5qGNnOUs1jJkoSr8FG5dsL28c7KgkIBzSEykqtuw=="], "@react-native-community/cli-doctor/ora/cli-cursor/restore-cursor": ["restore-cursor@3.1.0", "", { "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" } }, "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA=="], @@ -4669,8 +4682,6 @@ "@react-native-community/cli-platform-apple/@react-native-community/cli-tools/ora/is-interactive": ["is-interactive@1.0.0", "", {}, "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w=="], - "@react-native-community/cli-platform-apple/@react-native-community/cli-tools/ora/is-unicode-supported": ["is-unicode-supported@0.1.0", "", {}, "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw=="], - "@react-native-community/cli-platform-ios/@react-native-community/cli-platform-apple/fast-xml-parser/strnum": ["strnum@2.4.2", "", { "dependencies": { "anynum": "^1.0.1" } }, "sha512-rDG3Ah4TV0k1hWvLSzkZtMmLN9+eS+h3knq4MP6A42Y3Yh5qGNnOUs1jJkoSr8FG5dsL28c7KgkIBzSEykqtuw=="], "@react-native-community/cli-tools/ora/cli-cursor/restore-cursor": ["restore-cursor@3.1.0", "", { "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" } }, "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA=="], @@ -4787,11 +4798,9 @@ "metro/yargs/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], - "mocha/chokidar/readdirp/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], - - "mocha/yargs/cliui/wrap-ansi": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="], + "mocha/glob/path-scurry/lru-cache": ["lru-cache@11.5.3", "", {}, "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg=="], - "mocha/yargs/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], + "mocha/minimatch/brace-expansion/balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="], "pkg-dir/find-up/locate-path/p-locate": ["p-locate@4.1.0", "", { "dependencies": { "p-limit": "^2.2.0" } }, "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A=="], @@ -4889,6 +4898,16 @@ "react-native-nitro-sqlite-macos-example/@react-native/metro-config/metro-config/metro-cache": ["metro-cache@0.83.8", "", { "dependencies": { "exponential-backoff": "^3.1.1", "flow-enums-runtime": "^0.0.6", "https-proxy-agent": "^7.0.5", "metro-core": "0.83.8" } }, "sha512-aogMG5WbKzW5000otNjYrS9hIoORzkCI1faPJK+vxQLaf2BorJKBBFe/jl2Tfsi1mZUglS2EBuBt8B3JB7MYDQ=="], + "react-native-nitro-sqlite-macos-example/mocha/chokidar/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], + + "react-native-nitro-sqlite-macos-example/mocha/chokidar/readdirp": ["readdirp@3.6.0", "", { "dependencies": { "picomatch": "^2.2.1" } }, "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA=="], + + "react-native-nitro-sqlite-macos-example/mocha/minimatch/brace-expansion": ["brace-expansion@2.0.2", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="], + + "react-native-nitro-sqlite-macos-example/mocha/yargs/cliui": ["cliui@7.0.4", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" } }, "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ=="], + + "react-native-nitro-sqlite-macos-example/mocha/yargs/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], + "react-native-nitro-sqlite-macos-example/react-native/@react-native/codegen/@babel/parser": ["@babel/parser@7.29.0", "", { "dependencies": { "@babel/types": "^7.29.0" }, "bin": "./bin/babel-parser.js" }, "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww=="], "react-native-nitro-sqlite-macos-example/react-native/@react-native/codegen/hermes-parser": ["hermes-parser@0.29.1", "", { "dependencies": { "hermes-estree": "0.29.1" } }, "sha512-xBHWmUtRC5e/UL0tI7Ivt2riA/YBq9+SiYFU7C1oBa/j2jYGlIF9043oak1F47ihuDIxQ5nbsKueYJDRY02UgA=="], @@ -5015,8 +5034,6 @@ "metro/yargs/cliui/wrap-ansi/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], - "mocha/yargs/cliui/wrap-ansi/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], - "pkg-dir/find-up/locate-path/p-locate/p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="], "pkg-up/find-up/locate-path/p-locate/p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="], @@ -5047,16 +5064,12 @@ "react-native-nitro-sqlite-macos-example/@react-native-community/cli-platform-android/@react-native-community/cli-tools/ora/is-interactive": ["is-interactive@1.0.0", "", {}, "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w=="], - "react-native-nitro-sqlite-macos-example/@react-native-community/cli-platform-android/@react-native-community/cli-tools/ora/is-unicode-supported": ["is-unicode-supported@0.1.0", "", {}, "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw=="], - "react-native-nitro-sqlite-macos-example/@react-native-community/cli/@react-native-community/cli-doctor/ora/cli-cursor": ["cli-cursor@3.1.0", "", { "dependencies": { "restore-cursor": "^3.1.0" } }, "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw=="], "react-native-nitro-sqlite-macos-example/@react-native-community/cli/@react-native-community/cli-doctor/ora/cli-spinners": ["cli-spinners@2.9.2", "", {}, "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg=="], "react-native-nitro-sqlite-macos-example/@react-native-community/cli/@react-native-community/cli-doctor/ora/is-interactive": ["is-interactive@1.0.0", "", {}, "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w=="], - "react-native-nitro-sqlite-macos-example/@react-native-community/cli/@react-native-community/cli-doctor/ora/is-unicode-supported": ["is-unicode-supported@0.1.0", "", {}, "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw=="], - "react-native-nitro-sqlite-macos-example/@react-native-community/cli/@react-native-community/cli-server-api/body-parser/content-type": ["content-type@1.0.5", "", {}, "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA=="], "react-native-nitro-sqlite-macos-example/@react-native-community/cli/@react-native-community/cli-server-api/body-parser/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], @@ -5081,8 +5094,6 @@ "react-native-nitro-sqlite-macos-example/@react-native-community/cli/@react-native-community/cli-tools/ora/is-interactive": ["is-interactive@1.0.0", "", {}, "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w=="], - "react-native-nitro-sqlite-macos-example/@react-native-community/cli/@react-native-community/cli-tools/ora/is-unicode-supported": ["is-unicode-supported@0.1.0", "", {}, "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw=="], - "react-native-nitro-sqlite-macos-example/@react-native/babel-preset/@react-native/babel-plugin-codegen/@babel/traverse/@babel/code-frame": ["@babel/code-frame@7.29.0", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="], "react-native-nitro-sqlite-macos-example/@react-native/babel-preset/@react-native/babel-plugin-codegen/@babel/traverse/@babel/generator": ["@babel/generator@7.29.1", "", { "dependencies": { "@babel/parser": "^7.29.0", "@babel/types": "^7.29.0", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw=="], @@ -5103,6 +5114,12 @@ "react-native-nitro-sqlite-macos-example/@react-native/metro-config/@react-native/metro-babel-transformer/hermes-parser/hermes-estree": ["hermes-estree@0.29.1", "", {}, "sha512-jl+x31n4/w+wEqm0I2r4CMimukLbLQEYpisys5oCre611CI5fc9TxhqkBBCJ1edDG4Kza0f7CgNz8xVMLZQOmQ=="], + "react-native-nitro-sqlite-macos-example/mocha/chokidar/readdirp/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], + + "react-native-nitro-sqlite-macos-example/mocha/yargs/cliui/wrap-ansi": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="], + + "react-native-nitro-sqlite-macos-example/mocha/yargs/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], + "react-native-nitro-sqlite-macos-example/react-native/@react-native/codegen/@babel/parser/@babel/types": ["@babel/types@7.29.0", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.28.5" } }, "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A=="], "react-native-nitro-sqlite-macos-example/react-native/@react-native/codegen/hermes-parser/hermes-estree": ["hermes-estree@0.29.1", "", {}, "sha512-jl+x31n4/w+wEqm0I2r4CMimukLbLQEYpisys5oCre611CI5fc9TxhqkBBCJ1edDG4Kza0f7CgNz8xVMLZQOmQ=="], @@ -5163,6 +5180,8 @@ "react-native-nitro-sqlite-macos-example/@react-native/babel-preset/@react-native/babel-plugin-codegen/@react-native/codegen/yargs/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], + "react-native-nitro-sqlite-macos-example/mocha/yargs/cliui/wrap-ansi/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], + "react-native-nitro-sqlite-macos-example/react-native/yargs/cliui/wrap-ansi/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], "react-native/@react-native/community-cli-plugin/@react-native/dev-middleware/chromium-edge-launcher/@types/node/undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], diff --git a/example/ios/Podfile b/example/ios/Podfile index 7af75b28..4112c136 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,5 +1,6 @@ ENV['RCT_NEW_ARCH_ENABLED'] = '1' -ENV['USE_FRAMEWORKS'] = "static" +# Default to static frameworks locally, while allowing CI to select either mode. +ENV['USE_FRAMEWORKS'] ||= 'static' ENV['NITRO_SQLITE_VEC'] = '1' # Resolve react_native_pods.rb with node to allow for hoisting @@ -13,10 +14,10 @@ platform :ios, min_ios_version_supported prepare_react_native_project! linkage = ENV['USE_FRAMEWORKS'] - if linkage != nil - Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green - use_frameworks! :linkage => linkage.to_sym - end +unless linkage.to_s.empty? + Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green + use_frameworks! :linkage => linkage.to_sym +end target 'NitroSQLiteExample' do config = use_native_modules! diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 06626e50..a04a56c1 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1766,7 +1766,7 @@ PODS: - ReactCommon/turbomodule/core - ReactNativeDependencies - Yoga - - RNNitroSQLite (10.0.0): + - RNNitroSQLite (10.1.0): - hermes-engine - NitroModules - RCTRequired @@ -1789,7 +1789,7 @@ PODS: - ReactCommon/turbomodule/core - ReactNativeDependencies - Yoga - - RNNitroSqliteVec (10.0.0): + - RNNitroSqliteVec (10.1.0): - RNNitroSQLite - RNScreens (4.28.0): - hermes-engine @@ -2222,12 +2222,12 @@ SPEC CHECKSUMS: ReactCommon: 749169e12aa3461a3df3656a00e48dbe0456b2d6 ReactNativeDependencies: 94c922c39e0e6150ee9ad05e2ca1946e0ef55783 RNCClipboard: e706ef7ccbbfd69f829c1b683f893bc7668c9fdb - RNNitroSQLite: 119ba2dae35083ed5306594ad99cf5d4d7e100c0 - RNNitroSqliteVec: 0c255fb910dbcea6c77ab22a9b9b2e10cefdc7f0 + RNNitroSQLite: 8f61cb932daf0f55b10310821b9982c43ca5b1c4 + RNNitroSqliteVec: 6f95f4347daf1fcbf64d273170b2fbf235b46a87 RNScreens: 3c977859fd13e67dc4ebfc24afb4d7c2e894db61 SocketRocket: 37aec555668fb852ec12e3c0de59a86ca58f0871 Yoga: d1c536142c5ff8ec8cd856ab2a7c227a1d875c8e -PODFILE CHECKSUM: 6933dbd8b4eea93df54a57c95e03351734e37a5b +PODFILE CHECKSUM: fd5bc9f335e919fdcd0b0eaf293b8e68d12e6ed4 COCOAPODS: 1.15.2 diff --git a/example/macos/Podfile.lock b/example/macos/Podfile.lock index ad8672bc..0af85bd9 100644 --- a/example/macos/Podfile.lock +++ b/example/macos/Podfile.lock @@ -2311,7 +2311,7 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - RNNitroSQLite (10.0.0): + - RNNitroSQLite (10.1.0): - boost - DoubleConversion - fast_float @@ -2340,7 +2340,7 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - RNNitroSqliteVec (10.0.0): + - RNNitroSqliteVec (10.1.0): - RNNitroSQLite - SocketRocket (0.7.1) - Yoga (0.0.0) @@ -2658,8 +2658,8 @@ SPEC CHECKSUMS: ReactCodegen: 4dff081e9dbb8acd8b15a8acc9374b4ac1a9869d ReactCommon: bc273d1cfc32a36ea662e81293e0961de8c21c77 RNCClipboard: 4b58c780f63676367640f23c8e114e9bd0cf86ac - RNNitroSQLite: 1893b4d8d00c1a92acaf838c0816f123fd9e3e2c - RNNitroSqliteVec: 0c255fb910dbcea6c77ab22a9b9b2e10cefdc7f0 + RNNitroSQLite: 2822f30e998d8da8fda8dbe7735d4719f12c27a3 + RNNitroSqliteVec: 040c036e18036398be019353bd26afb1146c6dc4 SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 Yoga: a88f30ac6f89fded00f9840e7d043315e5ab4fe0 diff --git a/example/package.json b/example/package.json index 31321b64..1e9e557d 100644 --- a/example/package.json +++ b/example/package.json @@ -67,7 +67,7 @@ "@types/node": "^22.7.4", "@types/react": "^19.1.1", "@types/react-test-renderer": "^19.1.0", - "mocha": "^10.1.0", + "mocha": "^12.0.2", "postinstall-postinstall": "^2.1.0", "react-native-harness": "1.5.0", "react-test-renderer": "19.2.3" diff --git a/example/tests/MochaRNAdapter.ts b/example/tests/MochaRNAdapter.ts index 97cfb13e..b6f87a0c 100644 --- a/example/tests/MochaRNAdapter.ts +++ b/example/tests/MochaRNAdapter.ts @@ -1,4 +1,5 @@ -import 'mocha' +// The browser bundle exposes global Mocha without importing Node-only modules. +import 'mocha/mocha.js' import { expect as chaiExpect } from 'chai' import type { TestApi, TestExpect } from './TestApi' diff --git a/example/tests/MochaSetup.test.ts b/example/tests/MochaSetup.test.ts index 87f5642d..0be29257 100644 --- a/example/tests/MochaSetup.test.ts +++ b/example/tests/MochaSetup.test.ts @@ -1,4 +1,4 @@ -import { describe, expect, it, jest } from '@jest/globals' +import { describe, expect, it } from '@jest/globals' import { runTests } from './MochaSetup' import type { MochaTestResult } from './MochaSetup' import { @@ -7,12 +7,6 @@ import { it as registerTest, } from './TestApi' -jest.mock('mocha', () => { - const Runtime: typeof Mocha = jest.requireActual('mocha') - Object.assign(globalThis, { Mocha: Runtime }) - return { __esModule: true, default: {} } -}) - describe('MochaSetup', () => { it('reports suites and test results as they finish', async () => { const results: MochaTestResult[] = [] diff --git a/example/tests/MochaSetup.ts b/example/tests/MochaSetup.ts index 23c74a88..c3add697 100644 --- a/example/tests/MochaSetup.ts +++ b/example/tests/MochaSetup.ts @@ -1,4 +1,4 @@ -import 'mocha' +import 'mocha/mocha.js' import { createMochaTestApi } from './MochaRNAdapter' import { setTestApi } from './TestApi' diff --git a/example/tests/mocha-browser.d.ts b/example/tests/mocha-browser.d.ts new file mode 100644 index 00000000..7d5a1511 --- /dev/null +++ b/example/tests/mocha-browser.d.ts @@ -0,0 +1,5 @@ +declare module 'mocha/mocha.js' { + import type Mocha from 'mocha' + const mocha: Mocha + export = mocha +} diff --git a/scripts/ci-dependencies.test.ts b/scripts/ci-dependencies.test.ts new file mode 100644 index 00000000..3bd8e66e --- /dev/null +++ b/scripts/ci-dependencies.test.ts @@ -0,0 +1,174 @@ +import assert from 'node:assert/strict' +import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import test from 'node:test' +import { + nativeDependenciesChanged, + selectPodChecks, +} from './ci-dependencies.ts' + +test('JavaScript-only dependency changes skip CocoaPods', () => { + const root = packageFixture('formatter') + try { + assert.equal( + nativeDependenciesChanged( + { formatter: ['formatter@1.0.0'] }, + { formatter: ['formatter@1.1.0'] }, + root, + ), + false, + ) + } finally { + rmSync(root, { recursive: true, force: true }) + } +}) + +test('native package updates and additions require CocoaPods', () => { + const root = packageFixture('@vendor/storage', 'ios/Storage.podspec') + try { + assert.equal( + nativeDependenciesChanged( + { storage: ['@vendor/storage@1.0.0'] }, + { storage: ['@vendor/storage@1.1.0'] }, + root, + ), + true, + ) + assert.equal( + nativeDependenciesChanged( + {}, + { storage: ['@vendor/storage@1.1.0'] }, + root, + ), + true, + ) + } finally { + rmSync(root, { recursive: true, force: true }) + } +}) + +test('native packages in isolated macOS dependencies are detected', () => { + const root = packageFixture( + 'desktop-storage', + 'Storage.podspec', + 'example/macos', + ) + try { + assert.equal( + nativeDependenciesChanged( + { storage: ['desktop-storage@1.0.0'] }, + { storage: ['desktop-storage@2.0.0'] }, + root, + ), + true, + ) + } finally { + rmSync(root, { recursive: true, force: true }) + } +}) + +test('unchanged native resolutions do not reinstall Pods for JavaScript metadata changes', () => { + assert.equal( + nativeDependenciesChanged( + { native: ['react-native@0.87.1', { old: true }] }, + { native: ['react-native@0.87.1', { new: true }] }, + '/unused', + ), + false, + ) +}) + +test('removed packages conservatively require native lockfile validation', () => { + assert.equal( + nativeDependenciesChanged( + { old: ['removed-package@1.0.0'] }, + {}, + '/missing', + ), + true, + ) +}) + +test('Expo modules require CocoaPods without a root podspec', () => { + const root = packageFixture('expo-module', 'expo-module.config.json') + try { + assert.equal( + nativeDependenciesChanged( + { expo: ['expo-module@1.0.0'] }, + { expo: ['expo-module@1.0.1'] }, + root, + ), + true, + ) + } finally { + rmSync(root, { recursive: true, force: true }) + } +}) + +test('invalid locked package records fail rather than silently skipping validation', () => { + assert.throws( + () => nativeDependenciesChanged({ broken: null }, {}, '/unused'), + /string resolution/, + ) +}) + +test('Apple configuration changes only prepare the affected lockfile', () => { + assert.deepEqual(selectPodChecks(['example/ios/Podfile'], false, false), { + ios: true, + macos: false, + }) + assert.deepEqual(selectPodChecks(['example/macos/Podfile'], false, false), { + ios: false, + macos: true, + }) + assert.deepEqual(selectPodChecks(['example/package.json'], false, false), { + ios: false, + macos: false, + }) + assert.deepEqual( + selectPodChecks( + ['packages/react-native-nitro-sqlite/RNNitroSQLite.podspec'], + false, + false, + ), + { ios: true, macos: true }, + ) +}) + +test('native dependency changes and full runs prepare both Apple lockfiles', () => { + assert.deepEqual(selectPodChecks([], true, false), { ios: true, macos: true }) + assert.deepEqual(selectPodChecks([], false, true), { ios: true, macos: true }) +}) + +test('direct native lockfile changes require validation before compilation', () => { + assert.deepEqual( + selectPodChecks(['example/ios/Podfile.lock'], false, false), + { + ios: true, + macos: false, + }, + ) + assert.deepEqual( + selectPodChecks(['example/macos/Podfile.lock'], false, false), + { + ios: false, + macos: true, + }, + ) +}) + +function packageFixture( + name: string, + nativeFile?: string, + workspace = '', +): string { + const root = mkdtempSync(join(tmpdir(), 'nitro-ci-dependencies-')) + const directory = join(root, workspace, 'node_modules', name) + mkdirSync(join(directory, 'ios'), { recursive: true }) + writeFileSync(join(directory, 'package.json'), '{}') + if (nativeFile) { + writeFileSync(join(directory, nativeFile), '') + } + return root +} diff --git a/scripts/ci-dependencies.ts b/scripts/ci-dependencies.ts new file mode 100644 index 00000000..bb199cd3 --- /dev/null +++ b/scripts/ci-dependencies.ts @@ -0,0 +1,157 @@ +import { execFileSync } from 'node:child_process' +import { appendFileSync, existsSync, readdirSync } from 'node:fs' +import { join, resolve } from 'node:path' +import { fileURLToPath } from 'node:url' +import ts from 'typescript' +import { readLockfile, requireRecord } from './bun-lockfile-workspaces.ts' +import { matchesPaths } from './ci.ts' + +/** + * Detects native dependency changes by comparing locked package resolutions. + * Packages missing from the installed tree conservatively require Pods. + * @param before The base lockfile's packages table. + * @param after The current lockfile's packages table. + * @param root The repository root containing the installed workspaces. + * @returns Whether a changed package may affect native dependency resolution. + * @throws If a locked package has an invalid resolution entry. + */ +export function nativeDependenciesChanged( + before: Record, + after: Record, + root: string, +): boolean { + const names = new Set([...Object.keys(before), ...Object.keys(after)]) + return [...names].some((key) => { + const previous = resolution(before[key]) + const current = resolution(after[key]) + if (previous === current) { + return false + } + const packageName = (current || previous).slice( + 0, + (current || previous).lastIndexOf('@'), + ) + return isNativePackage(packageName, root) + }) +} + +/** + * Selects Apple lockfiles after native dependencies or CocoaPods inputs change. + * @param files Repository-relative paths changed since the base commit. + * @param nativeChanged Whether a locked native package changed. + * @param full Whether to validate both Apple platforms unconditionally. + * @returns Independent iOS and macOS lockfile selections. + */ +export function selectPodChecks( + files: string[], + nativeChanged: boolean, + full: boolean, +) { + const shared = [ + '**/*.podspec', + '**/react-native.config.js', + 'example/Gemfile*', + 'patches/**', + ] + return { + ios: + full || + nativeChanged || + files.some((file) => + matchesPaths(file, [...shared, 'example/ios/Podfile*']), + ), + macos: + full || + nativeChanged || + files.some((file) => + matchesPaths(file, [ + ...shared, + 'example/macos/Podfile*', + 'example/macos/scripts/*config*.js', + 'example/macos/scripts/resolve-react-native.js', + ]), + ), + } +} + +function main(): void { + const base = process.env.CI_BASE_SHA + const full = process.env.CI_FULL === 'true' || !base || /^0+$/.test(base) + const current = readLockfile(process.cwd()) + let before = current + let files: string[] = [] + if (!full && base) { + const content = execFileSync('git', ['show', `${base}:bun.lock`], { + encoding: 'utf8', + }) + const { config, error } = ts.parseConfigFileTextToJson('bun.lock', content) + if (error) { + throw new Error(ts.flattenDiagnosticMessageText(error.messageText, '\n')) + } + before = requireRecord(config, 'base lockfile') + files = execFileSync('git', ['diff', '--name-only', '-z', base, 'HEAD'], { + encoding: 'utf8', + }) + .split('\0') + .filter(Boolean) + } + const pods = selectPodChecks( + files, + nativeDependenciesChanged( + requireRecord(before.packages, 'base packages'), + requireRecord(current.packages, 'current packages'), + process.cwd(), + ), + full, + ) + const output = process.env.GITHUB_OUTPUT + if (!output) { + throw new Error('GITHUB_OUTPUT is required') + } + appendFileSync(output, `ios_pods=${pods.ios}\nmacos_pods=${pods.macos}\n`) +} + +function resolution(value: unknown): string { + if (value === undefined) { + return '' + } + if (!Array.isArray(value) || typeof value[0] !== 'string') { + throw new Error('A locked package must have a string resolution') + } + return value[0] +} + +function isNativePackage(name: string, root: string): boolean { + if (/(^|\/)react-native($|-)/.test(name)) { + return true + } + const directories = [ + '', + 'example', + 'example/macos', + 'packages/react-native-nitro-sqlite', + 'packages/react-native-nitro-sqlite-vec', + ] + .map((workspace) => join(root, workspace, 'node_modules', name)) + .filter((directory) => existsSync(join(directory, 'package.json'))) + if (directories.length === 0) { + return true + } + return directories.some((directory) => + [directory, join(directory, 'ios')].some( + (location) => + existsSync(location) && + readdirSync(location).some( + (file) => + file.endsWith('.podspec') || file === 'expo-module.config.json', + ), + ), + ) +} + +if ( + process.argv[1] && + resolve(process.argv[1]) === fileURLToPath(import.meta.url) +) { + main() +} diff --git a/scripts/ci-pod-lockfiles.rb b/scripts/ci-pod-lockfiles.rb new file mode 100644 index 00000000..63f1d7b6 --- /dev/null +++ b/scripts/ci-pod-lockfiles.rb @@ -0,0 +1,33 @@ +require 'open3' +require 'yaml' + +# Compares installed lockfiles with the committed dependency graph and sources. +# Local podspec checksums can include absolute checkout paths, so they are excluded. +def check_pod_lockfiles(paths) + paths.all? do |path| + committed, status = Open3.capture2('git', 'show', "HEAD:#{path}") + raise "Cannot read committed #{path}" unless status.success? + + if normalize_pod_lockfile(committed) == normalize_pod_lockfile(File.read(path)) + puts "#{path}: dependency resolutions match" + next true + end + + warn "#{path}: dependency resolutions changed. Commit the updated native-lockfiles artifact." + false + end +end + +def normalize_pod_lockfile(content) + lockfile = YAML.safe_load(content, permitted_classes: [Symbol]) + checksums = lockfile.fetch('SPEC CHECKSUMS') + lockfile.fetch('EXTERNAL SOURCES', {}).each do |name, source| + checksums.delete(name) if source.key?(:path) + end + lockfile +end + +if __FILE__ == $PROGRAM_NAME + raise 'At least one Podfile.lock path is required' if ARGV.empty? + exit(check_pod_lockfiles(ARGV) ? 0 : 1) +end diff --git a/scripts/ci-pod-lockfiles.test.rb b/scripts/ci-pod-lockfiles.test.rb new file mode 100644 index 00000000..a0099a31 --- /dev/null +++ b/scripts/ci-pod-lockfiles.test.rb @@ -0,0 +1,43 @@ +require 'minitest/autorun' +require_relative 'ci-pod-lockfiles' + +class PodLockfilesTest < Minitest::Test + LOCKFILE = <<~YAML + PODS: + - LocalPod (1.0.0) + - RemotePod (2.0.0) + DEPENDENCIES: + - LocalPod (from `../packages/local`) + - RemotePod + EXTERNAL SOURCES: + LocalPod: + :path: ../packages/local + SPEC CHECKSUMS: + LocalPod: local-checkout-dependent + RemotePod: remote-checksum + PODFILE CHECKSUM: podfile-checksum + COCOAPODS: 1.15.2 + YAML + + def test_local_pod_checksums_may_differ_between_checkouts + assert_equal normalize_pod_lockfile(LOCKFILE), + normalize_pod_lockfile(LOCKFILE.sub('local-checkout-dependent', 'other-checkout')) + end + + def test_remote_pod_checksums_must_match + refute_equal normalize_pod_lockfile(LOCKFILE), + normalize_pod_lockfile(LOCKFILE.sub('remote-checksum', 'changed-checksum')) + end + + def test_dependency_versions_must_match + refute_equal normalize_pod_lockfile(LOCKFILE), + normalize_pod_lockfile(LOCKFILE.sub('RemotePod (2.0.0)', 'RemotePod (2.1.0)')) + end + + def test_local_sources_and_podfile_checksum_must_match + ['../packages/local', 'podfile-checksum'].each do |input| + refute_equal normalize_pod_lockfile(LOCKFILE), + normalize_pod_lockfile(LOCKFILE.gsub(input, 'changed')) + end + end +end diff --git a/scripts/ci.test.ts b/scripts/ci.test.ts new file mode 100644 index 00000000..d222afa6 --- /dev/null +++ b/scripts/ci.test.ts @@ -0,0 +1,247 @@ +import assert from 'node:assert/strict' +import { execFileSync, spawnSync } from 'node:child_process' +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import test from 'node:test' +import { fileURLToPath } from 'node:url' +import { matchesPaths, selectChecks } from './ci.ts' + +const root = fileURLToPath(new URL('../', import.meta.url)) + +test('documentation content only selects the documentation build', () => { + const checks = selectChecks(['docs/content/docs/transactions.mdx'], false) + assert.deepEqual(enabled(checks), ['docs']) +}) + +test('platform changes only select their platform', () => { + assert.deepEqual( + enabled(selectChecks(['example/android/app/build.gradle'], false)), + ['android', 'android_configuration'], + ) + assert.deepEqual(enabled(selectChecks(['example/ios/Podfile'], false)), [ + 'ios', + ]) + assert.deepEqual(enabled(selectChecks(['example/macos/Podfile'], false)), [ + 'macos', + ]) +}) + +test('shared native sources retain lifecycle and platform coverage', () => { + const checks = selectChecks( + [ + 'packages/react-native-nitro-sqlite/cpp/NitroSQLiteDatabaseConnections.cpp', + ], + false, + ) + assert.deepEqual(enabled(checks), [ + 'cpp_format', + 'cpp_tests', + 'android', + 'ios', + 'macos', + ]) +}) + +test('generated platform bindings do not trigger the other mobile platform', () => { + const checks = selectChecks( + [ + 'packages/react-native-nitro-sqlite/nitrogen/generated/android/JHybridNitroSQLiteSpec.hpp', + ], + false, + ) + assert.equal(checks.android, true) + assert.equal(checks.ios, false) +}) + +test('JavaScript unit tests do not rebuild native apps', () => { + const checks = selectChecks( + ['packages/react-native-nitro-sqlite/src/__tests__/transaction.test.ts'], + false, + ) + assert.equal(checks.typescript, true) + assert.equal(checks.android, false) + assert.equal(checks.ios, false) + assert.equal(checks.macos, false) +}) + +test('in-app tests and sqlite-vec wrappers retain native coverage', () => { + for (const file of [ + 'example/src/tests/connection.test.ts', + 'packages/react-native-nitro-sqlite-vec/src/index.ts', + ]) { + const checks = selectChecks([file], false) + assert.equal(checks.android, true) + assert.equal(checks.ios, true) + assert.equal(checks.macos, true) + } +}) + +test('dependency lockfile changes retain both mobile and desktop coverage', () => { + const checks = selectChecks(['bun.lock'], false) + assert.equal(checks.android, true) + assert.equal(checks.ios, true) + assert.equal(checks.macos, true) +}) + +test('Ruby dependency changes retain both Apple platforms', () => { + const checks = selectChecks(['example/Gemfile'], false) + assert.equal(checks.ios, true) + assert.equal(checks.macos, true) + assert.equal(checks.android, false) +}) + +test('a full run selects every check even without file changes', () => { + assert.ok(Object.values(selectChecks([], true)).every(Boolean)) +}) + +test('ordered exclusions can be followed by explicit inclusions', () => { + assert.equal( + matchesPaths('src/tests/special.ts', [ + 'src/**', + '!src/tests/**', + 'src/tests/special.ts', + ]), + true, + ) + assert.equal( + matchesPaths('src/tests/other.ts', [ + 'src/**', + '!src/tests/**', + 'src/tests/special.ts', + ]), + false, + ) +}) + +test('the CLI routes real Git commits', () => { + const directory = mkdtempSync(join(tmpdir(), 'nitro-ci-routing-')) + try { + execFileSync('git', ['init', '-q'], { cwd: directory }) + writeFileSync(join(directory, 'package.json'), '{}\n') + execFileSync('git', ['add', '.'], { cwd: directory }) + execFileSync( + 'git', + [ + '-c', + 'user.name=CI Test', + '-c', + 'user.email=ci@example.invalid', + '-c', + 'commit.gpgsign=false', + 'commit', + '-qm', + 'chore: create fixture', + ], + { cwd: directory }, + ) + const base = execFileSync('git', ['rev-parse', 'HEAD'], { + cwd: directory, + encoding: 'utf8', + }).trim() + writeFileSync(join(directory, 'package.json'), '{"changed":true}\n') + execFileSync('git', ['add', '.'], { cwd: directory }) + execFileSync( + 'git', + [ + '-c', + 'user.name=CI Test', + '-c', + 'user.email=ci@example.invalid', + '-c', + 'commit.gpgsign=false', + 'commit', + '-qm', + 'chore: update fixture', + ], + { cwd: directory }, + ) + const output = join(directory, 'output') + execFileSync(process.execPath, [join(root, 'scripts/ci.ts')], { + cwd: directory, + env: { + ...process.env, + CI_BASE_SHA: base, + CI_FULL: 'false', + GITHUB_OUTPUT: output, + }, + }) + const values = readFileSync(output, 'utf8') + assert.match(values, /typescript=true\n/) + assert.match(values, /android=true\n/) + assert.match(values, /dependencies=true\n/) + } finally { + rmSync(directory, { recursive: true, force: true }) + } +}) + +test('the real iOS Podfile honors both CI matrix modes and retains the local default', () => { + const script = ` + module Pod + class Config + def self.instance = new + def installation_root = '/stub' + end + module Executable + def self.execute_command(*) = '/stub/react_native_pods.rb' + end + module UI + def self.puts(*) = nil + end + end + class String + def green = self + end + def require(*) = true + def min_ios_version_supported = '15.1' + def platform(*) = nil + def prepare_react_native_project! = nil + def use_frameworks!(linkage:) = STDOUT.puts("frameworks=#{linkage}") + def target(*) = yield + def use_native_modules! = { reactNativePath: '/stub' } + def use_react_native!(**) = nil + def post_install(*) = nil + load ARGV.fetch(0) + ` + for (const [mode, expected] of [ + ['static', 'frameworks=static'], + ['', ''], + [undefined, 'frameworks=static'], + ]) { + const env = { ...process.env } + if (mode === undefined) { + delete env.USE_FRAMEWORKS + } else { + env.USE_FRAMEWORKS = mode + } + const result = spawnSync( + 'ruby', + ['-e', script, join(root, 'example/ios/Podfile')], + { env, encoding: 'utf8' }, + ) + assert.equal(result.status, 0, result.stderr) + assert.equal(result.stdout.trim(), expected) + } +}) + +test('the routine iOS matrix retains both framework configurations', () => { + const workflow = readFileSync( + join(root, '.github/workflows/test-harness-ios.yml'), + 'utf8', + ) + const match = workflow.match( + /fromJSON\(inputs.full && '([^']+)' \|\| '([^']+)'\)/, + ) + assert.ok(match?.[2]) + const matrix: unknown = JSON.parse(match[2]) + assert.deepEqual(matrix, [ + { name: 'static_frameworks', frameworks: 'static', xcode: '26.5' }, + { name: 'no_frameworks', frameworks: '', xcode: '26.5' }, + ]) +}) + +function enabled(checks: ReturnType): string[] { + return Object.entries(checks) + .filter(([, selected]) => selected) + .map(([name]) => name) +} diff --git a/scripts/ci.ts b/scripts/ci.ts new file mode 100644 index 00000000..1df79419 --- /dev/null +++ b/scripts/ci.ts @@ -0,0 +1,82 @@ +import { execFileSync } from 'node:child_process' +import { appendFileSync } from 'node:fs' +import { matchesGlob, resolve } from 'node:path' +import { fileURLToPath } from 'node:url' +import patterns from '../.github/ci-paths.json' with { type: 'json' } + +/** + * Selects affected checks using the repository's shared path filters. + * @param files Repository-relative paths changed since the base commit. + * @param full Whether to enable all checks, regardless of changed paths. + * @returns A boolean for each independently selectable check. + */ +export function selectChecks(files: string[], full: boolean) { + const selected = (paths: string[]) => + full || files.some((file) => matchesPaths(file, paths)) + return { + typescript: selected(patterns.typescript), + cpp_format: selected(patterns.cpp_format), + cpp_tests: selected(patterns.cpp_tests), + docs: selected(patterns.docs), + android: selected(patterns.android), + android_configuration: selected([ + '.github/workflows/**', + 'example/android/**/*.gradle*', + 'packages/react-native-nitro-sqlite/android/**/*.gradle*', + 'scripts/android-sqlite-flags/**', + ]), + ios: selected(patterns.ios), + macos: selected(patterns.macos), + } +} + +/** + * Applies include and exclude globs in order; the last matching rule wins. + * @param file A repository-relative path. + * @param paths Glob patterns, with `!` prefixes for exclusions. + * @returns Whether a matching include remains after applying exclusions. + */ +export function matchesPaths(file: string, paths: string[]): boolean { + return paths.reduce((included, pattern) => { + const excluded = pattern.startsWith('!') + return matchesGlob(file, excluded ? pattern.slice(1) : pattern) + ? !excluded + : included + }, false) +} + +function main(): void { + const base = process.env.CI_BASE_SHA + const full = process.env.CI_FULL === 'true' || !base || /^0+$/.test(base) + const files = full + ? [] + : execFileSync('git', ['diff', '--name-only', '-z', base, 'HEAD'], { + encoding: 'utf8', + }) + .split('\0') + .filter(Boolean) + const checks = selectChecks(files, full) + const output = process.env.GITHUB_OUTPUT + if (!output) { + throw new Error('GITHUB_OUTPUT is required') + } + const dependencies = + checks.typescript || + checks.docs || + checks.android || + checks.ios || + checks.macos + appendFileSync( + output, + Object.entries({ ...checks, dependencies }) + .map(([name, enabled]) => `${name}=${enabled}\n`) + .join(''), + ) +} + +if ( + process.argv[1] && + resolve(process.argv[1]) === fileURLToPath(import.meta.url) +) { + main() +} diff --git a/scripts/test-cpp.sh b/scripts/test-cpp.sh new file mode 100644 index 00000000..58afcb12 --- /dev/null +++ b/scripts/test-cpp.sh @@ -0,0 +1,83 @@ +#!/usr/bin/env bash +set -euo pipefail + +python3 scripts/generate-sqlite-symbol-prefix.py --check +sh scripts/test-private-sqlite-symbols.sh + +clang \ + -std=c11 \ + -DSQLITE_THREADSAFE=2 \ + -c packages/react-native-nitro-sqlite/cpp/sqlite/sqlite3.c \ + -o /tmp/sqlite3.o + +clang++ \ + -std=c++20 \ + -Wall \ + -Wextra \ + -Werror \ + -Ipackages/react-native-nitro-sqlite/cpp \ + -Ipackages/react-native-nitro-sqlite/cpp/sqlite \ + packages/react-native-nitro-sqlite/cpp/NitroSQLiteDatabaseMigration.cpp \ + packages/react-native-nitro-sqlite/tests/cpp/databaseMigration.test.cpp \ + /tmp/sqlite3.o \ + -ldl \ + -lm \ + -pthread \ + -o /tmp/databaseMigrationTests + +/tmp/databaseMigrationTests + +clang++ \ + -std=c++20 \ + -Wall \ + -Wextra \ + -Werror \ + -Ipackages/react-native-nitro-sqlite/cpp \ + -Ipackages/react-native-nitro-sqlite/cpp/sqlite \ + packages/react-native-nitro-sqlite/cpp/NitroSQLiteDatabaseConnections.cpp \ + packages/react-native-nitro-sqlite/cpp/NitroSQLiteDatabaseMigration.cpp \ + packages/react-native-nitro-sqlite/tests/cpp/databaseConnections.test.cpp \ + /tmp/sqlite3.o \ + -ldl \ + -lm \ + -pthread \ + -o /tmp/databaseConnectionsTests + +/tmp/databaseConnectionsTests + +clang++ \ + -std=c++20 \ + -Wall \ + -Wextra \ + -Werror \ + -Ipackages/react-native-nitro-sqlite/cpp \ + -Ipackages/react-native-nitro-sqlite/cpp/sqlite \ + packages/react-native-nitro-sqlite/tests/cpp/statementGroup.test.cpp \ + /tmp/sqlite3.o \ + -ldl \ + -lm \ + -pthread \ + -o /tmp/statementGroupTests +/tmp/statementGroupTests + +clang \ + -std=c11 \ + -DSQLITE_THREADSAFE=0 \ + -c packages/react-native-nitro-sqlite/cpp/sqlite/sqlite3.c \ + -o /tmp/sqlite3-threadsafe-0.o +clang++ \ + -std=c++20 \ + -Wall \ + -Wextra \ + -Werror \ + -Ipackages/react-native-nitro-sqlite/cpp \ + -Ipackages/react-native-nitro-sqlite/cpp/sqlite \ + packages/react-native-nitro-sqlite/cpp/NitroSQLiteDatabaseConnections.cpp \ + packages/react-native-nitro-sqlite/cpp/NitroSQLiteDatabaseMigration.cpp \ + packages/react-native-nitro-sqlite/tests/cpp/databaseConnectionsThreadsafe.test.cpp \ + /tmp/sqlite3-threadsafe-0.o \ + -ldl \ + -lm \ + -pthread \ + -o /tmp/databaseConnectionsThreadsafeTests +/tmp/databaseConnectionsThreadsafeTests