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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/workflows/create_test_patches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
id: yarn-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'RNGoogleMobileAdsExample/package.json') }}
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'yarn.lock', 'packages/core/package.json', 'RNGoogleMobileAdsExample/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn Install
Expand All @@ -54,13 +54,11 @@ jobs:
# yarn3+ by default disables lockfile alteration in CI. We want it.
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: |
export PACKAGE_NAME=`npx json name -f package.json`
export PACKAGE_NAME=`npx json name -f packages/core/package.json`
export CLEAN_PACKAGE_NAME=`echo $PACKAGE_NAME | sed s/@// |sed s,/,-,`
mkdir $HOME/scratch
echo "Packing PR version of $CLEAN_PACKAGE_NAME"
yarn pack
pwd
mv package.tgz $HOME/scratch/$CLEAN_PACKAGE_NAME.tgz
yarn workspace react-native-google-mobile-ads pack --out $HOME/scratch/$CLEAN_PACKAGE_NAME.tgz
ls -la $HOME/scratch/*$CLEAN_PACKAGE_NAME*
cd $HOME
npx @react-native-community/cli init template --skip-install --skip-git-init
Expand All @@ -76,7 +74,7 @@ jobs:
\rm -fr react-native-google-mobile-ads
mv package react-native-google-mobile-ads
# do some cleaning so the patch is minimal - TODO fix .npmignore/package.json files block
rm react-native-google-mobile-ads/CHANGELOG.md
rm -f react-native-google-mobile-ads/CHANGELOG.md
popd
npx patch-package $PACKAGE_NAME || true
ls -la $HOME/template/patches
Expand All @@ -93,7 +91,7 @@ jobs:
if: "${{ github.ref == 'refs/heads/main' }}"
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'RNGoogleMobileAdsExample/package.json') }}
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'yarn.lock', 'packages/core/package.json', 'RNGoogleMobileAdsExample/package.json') }}

# create a comment on the PR and any related issues with a direct link to the archive,
# a call for testers, and perhaps a paste-able set of commands to install them
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
id: yarn-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'RNGoogleMobileAdsExample/package.json') }}
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'yarn.lock', 'packages/core/package.json', 'RNGoogleMobileAdsExample/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn Install
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
id: yarn-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'RNGoogleMobileAdsExample/package.json') }}
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'yarn.lock', 'packages/core/package.json', 'RNGoogleMobileAdsExample/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Configure JDK
Expand All @@ -46,6 +46,8 @@ jobs:
command: yarn
- name: Lint
run: yarn lint:code
- name: Kotlin lint
run: ./gradlew ktlintCheck
- name: Save Code Linting Report JSON
run: yarn lint:report
continue-on-error: true
Expand Down Expand Up @@ -77,7 +79,7 @@ jobs:
id: yarn-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'RNGoogleMobileAdsExample/package.json') }}
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'yarn.lock', 'packages/core/package.json', 'RNGoogleMobileAdsExample/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn Install
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/tests_e2e_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
id: yarn-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'RNGoogleMobileAdsExample/package.json') }}
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'yarn.lock', 'packages/core/package.json', 'RNGoogleMobileAdsExample/package.json') }}
restore-keys: ${{ runner.os }}-yarn-v1

- name: Yarn Install
Expand All @@ -97,7 +97,7 @@ jobs:
timeout_minutes: 10
retry_wait_seconds: 60
max_attempts: 3
command: yarn && cd RNGoogleMobileAdsExample && DETOX_DISABLE_POSTINSTALL=1 yarn
command: yarn

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
Expand Down Expand Up @@ -205,7 +205,9 @@ jobs:
disable-animations: true
script: |
$ANDROID_HOME/platform-tools/adb logcat '*:D' > adb-log.txt &
yarn tests:android:run
yarn tests:appium:drivers:install
yarn tests:appium:drivers:verify
yarn tests:appium:android

- uses: codecov/codecov-action@v5
with:
Expand Down
26 changes: 12 additions & 14 deletions .github/workflows/tests_e2e_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ jobs:
id: yarn-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'RNGoogleMobileAdsExample/package.json') }}
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'yarn.lock', 'packages/core/package.json', 'RNGoogleMobileAdsExample/package.json') }}
restore-keys: ${{ runner.os }}-yarn-v1

# Detox is compiled during yarn install, using Xcode, set up cache first
# Native iOS deps compile during yarn/pod install; set up Xcode compile cache first
- uses: hendrikmuhs/ccache-action@v1
name: Xcode Compile Cache
with:
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
timeout_minutes: 10
retry_wait_seconds: 60
max_attempts: 3
command: yarn && yarn tests:install
command: yarn

- name: Pod Install
uses: nick-fields/retry@v3
Expand All @@ -105,14 +105,6 @@ jobs:
max_attempts: 3
command: yarn tests:ios:pod:install

- name: Install applesimutils
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
retry_wait_seconds: 60
max_attempts: 3
command: HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew && HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils

- name: Metro Bundler Cache
uses: actions/cache@v4
with:
Expand All @@ -133,16 +125,22 @@ jobs:
echo "...javascript bundle ready"

- name: Create Simulator Log
# With a little delay so the detox test below has time to spawn it, missing the first part of boot is fine
# If you boot the simulator separately from detox, some other race fails and detox testee never sends ready to proxy
continue-on-error: true
run: nohup sh -c "sleep 30 && xcrun simctl spawn booted log stream --level debug --style compact > simulator.log 2>&1 &"

- name: Build and Run e2e app
- name: Install example on simulator
timeout-minutes: 20
continue-on-error: true
run: yarn tests:ios:run

- name: Build and Run Appium e2e
timeout-minutes: 30
continue-on-error: true
run: |
yarn tests:appium:drivers:install
yarn tests:appium:drivers:verify
yarn tests:appium:ios

- name: Upload Simulator Log
uses: actions/upload-artifact@v4
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
id: yarn-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'RNGoogleMobileAdsExample/package.json') }}
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json', 'yarn.lock', 'packages/core/package.json', 'RNGoogleMobileAdsExample/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn Install
Expand Down
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,6 @@ Pods/*
.idea/**/*
**/Pods/**
**/dist/
lib/version.js
typedoc.raw.json
tests/ios/Firebase
tests/ios/resetXcode.sh
Expand All @@ -551,7 +550,7 @@ google-services.json
GoogleService-Info.plist

# generated files
src/version.ts
packages/core/src/version.ts
RNFBVersion.m
ReactNativeFirebaseVersion.java

Expand Down Expand Up @@ -587,3 +586,9 @@ lib/

# Generated by react-native at times
RNGoogleMobileAdsExample/ios/.xcode.env.local

# Nx local cache
.nx/

# Appium driver install tree (pins live in tooling/appium/drivers.manifest.json)
tooling/appium/.appium-home/
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
package.json
**/node_modules/**
packages/**/lib/**
packages/**/plugin/build/**
.nx/
7 changes: 5 additions & 2 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
"preset": "conventionalcommits"
}],
"@semantic-release/changelog",
"@semantic-release/npm",
["@semantic-release/npm", {
"pkgRoot": "packages/core"
}],
[
"@semantic-release/git",
{
"assets": [
"package.json",
"packages/core/package.json",
"lerna.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
Expand Down
37 changes: 37 additions & 0 deletions .spellcheck.dict.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,40 @@ SSV
CP-User
Intellisense
onAdEvent
AdChoices
AdMob's
AdsConsent
AdsConsentStatus
AppLovin
ApplicationId
ATT
backfill
customizations
DNS
EAS
explainer
groupId
IAB
IDFA
isClicked
isClosed
isEarnedReward
isLoaded
isOpened
isShowing
logcat
NativeAd
NativeAdEventType
NativeAdView
NativeAsset
NativeMediaView
PaidEvent
preload
Programmatically
RequestOptions
RewardedAd
RewardedAdReward
SKAdNetwork
testDeviceIdentifiers
unmuted
v15
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# React Native Google Mobile Ads — agents

`src/` → `lib/` via `yarn prepare`. Native `android/` `ios/`. Expo `plugin/`. Example `RNGoogleMobileAdsExample/`. E2e `e2e/`. Docs `docs/`. Contributor/review norms: `CONTRIBUTING.md`.
Yarn workspaces monorepo. Publishable package: `packages/core/` (`react-native-google-mobile-ads`). `packages/core/src/` → `lib/` + Expo plugin via `yarn prepare` (runs `yarn lerna:prepare` / Lerna+Nx). Shared package TS: `tsconfig.packages.base.json` (packages extend it). Shared ESLint: root `eslint.config.js`. Native `packages/core/android/` `packages/core/ios/`. Expo `packages/core/plugin/`. Example workspace `RNGoogleMobileAdsExample/`. Appium workspace `tooling/appium/` (`@invertase/rngma-appium`; [Appium](okf-bundle/testing/running-e2e.md#appium-scaffold)). Docs `docs/`. Contributor/review norms: `CONTRIBUTING.md`.

Root `yarn`. Shell: [agent-command-policy](okf-bundle/testing/agent-command-policy.md) only. E2e: [running-e2e § agent rule](okf-bundle/testing/running-e2e.md#agent-rule-read-first) and [platform coverage](okf-bundle/testing/running-e2e.md#platform-coverage-gate-blocking). A green e2e workflow is **not** a pass ([continue-on-error](okf-bundle/ci-workflows/index.md#e2e-continue-on-error)); use local counts + `/tmp/rngma-e2e-*.log`. Loop: [change-authoring](okf-bundle/testing/change-authoring-workflow.md#loop) (`documentation?` then frozen [OKF scan](okf-bundle/testing/validation-checklist.md#okf-bundle-review) when `okf-bundle/`, `AGENTS.md`, or `CONTRIBUTING.md` changed; freeze: [§ frozen tree](okf-bundle/testing/change-authoring-workflow.md#frozen-tree)). Before commit or push: [validation evidence package](okf-bundle/testing/validation-checklist.md#validation-evidence-package). [Coverage evidence](okf-bundle/testing/coverage-design.md#coverage-evidence-package) only when `src/` **or** `android/` **or** `ios/` **or** `plugin/` TS is in the diff; `app.plugin.js`-only is `n/a` unless `plugin/` TS changed ([§ gates](okf-bundle/testing/change-authoring-workflow.md#gates)). Index: [okf-bundle](okf-bundle/index.md). Testing: [testing/index.md](okf-bundle/testing/index.md). Match work type and validation tier: [iteration vocabulary](okf-bundle/testing/iteration-vocabulary.md).
Root `yarn`. Root `./gradlew ktlintFormat` formats `packages/core` Android Kotlin (optional `-PinternalKtlintGitFilter`); check-only: `./gradlew ktlintCheck`. Optional local hook: `./gradlew addKtlintFormatGitPreCommitHook`; Invertase global pre-commit also invokes root `./gradlew ktlintFormat` when present (this repo does not ship an installed hook). Java remains `yarn lint:android`. Example Android builds stay under `RNGoogleMobileAdsExample/android/`. Native JVM/XCTest unit: `yarn tests:android:unit` / `yarn tests:ios:unit` ([agent command policy](okf-bundle/testing/agent-command-policy.md)). Shell: [agent-command-policy](okf-bundle/testing/agent-command-policy.md) only. E2e: [running-e2e § agent rule](okf-bundle/testing/running-e2e.md#agent-rule-read-first) and [platform coverage](okf-bundle/testing/running-e2e.md#platform-coverage-gate-blocking). A green e2e workflow is **not** a pass ([continue-on-error](okf-bundle/ci-workflows/index.md#e2e-continue-on-error)); use local counts + `/tmp/rngma-e2e-*.log`. Loop: [change-authoring](okf-bundle/testing/change-authoring-workflow.md#loop) (`documentation?` then frozen [OKF scan](okf-bundle/testing/validation-checklist.md#okf-bundle-review) when `okf-bundle/`, `AGENTS.md`, or `CONTRIBUTING.md` changed; freeze: [§ frozen tree](okf-bundle/testing/change-authoring-workflow.md#frozen-tree)). Before commit or push: [validation evidence package](okf-bundle/testing/validation-checklist.md#validation-evidence-package). [Coverage evidence](okf-bundle/testing/coverage-design.md#coverage-evidence-package) only when `packages/core/src/` **or** `packages/core/android/` **or** `packages/core/ios/` **or** `packages/core/plugin/` TS is in the diff; `packages/core/app.plugin.js`-only is `n/a` unless plugin TS changed ([§ gates](okf-bundle/testing/change-authoring-workflow.md#gates)). Index: [okf-bundle](okf-bundle/index.md). Testing: [testing/index.md](okf-bundle/testing/index.md). Match work type and validation tier: [iteration vocabulary](okf-bundle/testing/iteration-vocabulary.md).

Follow [documentation-policy § public vs ephemeral vs private](okf-bundle/documentation-policy.md#durable-vs-ephemeral). Do not stage `.agents/work-queues/` or `.agents/reports/`. Do not add queue files under `okf-bundle/`.

Expand Down
9 changes: 8 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,19 @@ git clone https://github.com/invertase/react-native-google-mobile-ads.git
cd react-native-google-mobile-ads
```

### Step 2: Install test project dependencies
### Step 2: Install dependencies

```bash
yarn
yarn prepare
```

Root `yarn` installs all workspaces (library under `packages/core/`, `RNGoogleMobileAdsExample/`, and `tooling/*`). `yarn prepare` builds the library via Lerna/Nx (`yarn lerna:prepare`). Package TypeScript extends root `tsconfig.packages.base.json`; ESLint is the root `eslint.config.js`.

Appium 3 + WebdriverIO lives in `tooling/appium/` (`@invertase/rngma-appium`). Pin contract: `yarn.lock` plus `tooling/appium/drivers.manifest.json`. Device-free check: `yarn tests:appium:validate`. Drivers: `yarn tests:appium:drivers:install` then `yarn tests:appium:drivers:verify`. Device smoke: `yarn tests:appium:android` / `yarn tests:appium:ios` after build/install prerequisites. Details: [Appium](okf-bundle/testing/running-e2e.md#appium-scaffold).

Android **Java** format: `yarn lint:android`. Android **Kotlin** format: repo-root `./gradlew ktlintFormat` (check-only: `./gradlew ktlintCheck`). Optional: `./gradlew addKtlintFormatGitPreCommitHook` to install a local hook; Invertase global pre-commit also invokes root `./gradlew ktlintFormat` when present (this repo does not ship an installed hook). Example app builds remain under `RNGoogleMobileAdsExample/android/`. Native unit skeletons: `yarn tests:android:unit` (Robolectric) and `yarn tests:ios:unit` (XCTest) — see [agent command policy](okf-bundle/testing/agent-command-policy.md).

## Submitting code for review

All code changes should be submitted as a pull request to the `main` branch.
Expand Down
Loading
Loading