From 931c1e61e62764540f8f0ed1cc53433a1fa45a8b Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Mon, 23 Nov 2026 20:00:07 +0100 Subject: [PATCH 01/76] ci: fix e2e jobs (gradle.properties newline, Xcode with Swift 6.4), PR CI on v0, always upload artifacts Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 16 +++++++++------- docs/superpowers/plans/2026-11-21-rn-otel-v0.md | 2 +- .../specs/2026-11-10-rn-otel-design.md | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aece3b2..e057292 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,8 @@ on: pull_request: branches: - main + - v0 + workflow_dispatch: merge_group: types: - checks_requested @@ -42,27 +44,27 @@ jobs: - run: bun run prepare - run: bun verify static fast-js - uses: actions/upload-artifact@v4 - if: failure() + if: always() with: name: verify-artifacts-static-fast path: verify/artifacts/ if-no-files-found: ignore fast-swift: - runs-on: macos-15 + runs-on: xcode-27 timeout-minutes: 20 steps: - uses: actions/checkout@v4 - uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '16.4' + xcode-version: '27.0' - uses: oven-sh/setup-bun@v2 with: bun-version: 1.2.19 - run: bun install --frozen-lockfile - run: bun verify fast-swift # no-op until Package.swift exists (Task 18) - uses: actions/upload-artifact@v4 - if: failure() + if: always() with: name: verify-artifacts-fast-swift path: verify/artifacts/ @@ -92,7 +94,7 @@ jobs: sudo udevadm trigger --name-match=kvm - uses: gradle/actions/setup-gradle@v4 - name: Enable the Gradle build cache (setup-gradle persists it) - run: echo "org.gradle.caching=true" >> example/android/gradle.properties + run: printf '\norg.gradle.caching=true\n' >> example/android/gradle.properties - name: Cache native build outputs uses: actions/cache@v4 with: @@ -150,13 +152,13 @@ jobs: if-no-files-found: ignore e2e-ios-bare: - runs-on: macos-15 + runs-on: xcode-27 timeout-minutes: 60 steps: - uses: actions/checkout@v4 - uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '16.4' + xcode-version: '27.0' - uses: oven-sh/setup-bun@v2 with: bun-version: 1.2.19 diff --git a/docs/superpowers/plans/2026-11-21-rn-otel-v0.md b/docs/superpowers/plans/2026-11-21-rn-otel-v0.md index 3ae5e51..c355dd3 100644 --- a/docs/superpowers/plans/2026-11-21-rn-otel-v0.md +++ b/docs/superpowers/plans/2026-11-21-rn-otel-v0.md @@ -12,7 +12,7 @@ ## Global Constraints -- RN New Architecture only, Hermes. Minimum RN **0.79** (OTel JS 3.x needs Metro ≥ 0.81.3); Nitro needs RN ≥ 0.75; Xcode ≥ 16.4; NDK ≥ 27. +- RN New Architecture only, Hermes. Minimum RN **0.79** (OTel JS 3.x needs Metro ≥ 0.81.3); Nitro needs RN ≥ 0.75; Xcode ≥ 27.0 (opentelemetry-swift 2.6 dependencies need Swift 6.4); NDK ≥ 27. - `@opentelemetry/api` 1.10; OTel JS stable 3.1.x / experimental 0.301.x; use `@opentelemetry/sdk-trace`, never `sdk-trace-base` / `sdk-trace-web`. Runtime code imports only the stable `@opentelemetry/semantic-conventions` entry; incubating keys are inlined. - Native SDKs: otel-java (stable) directly, **not** opentelemetry-android; opentelemetry-swift 2.6 via SwiftPM (`spm_dependency` in the podspec). - `react-native-nitro-modules` 0.37.x is a **peer** dependency with a pinned range. diff --git a/docs/superpowers/specs/2026-11-10-rn-otel-design.md b/docs/superpowers/specs/2026-11-10-rn-otel-design.md index d68557e..6cb3ed8 100644 --- a/docs/superpowers/specs/2026-11-10-rn-otel-design.md +++ b/docs/superpowers/specs/2026-11-10-rn-otel-design.md @@ -70,13 +70,13 @@ nesting**, to a collector — on iOS, Android and web. experimental 0.301.x (`@opentelemetry/sdk-trace` replaced `sdk-trace-base`/`-web` in 3.0), `@opentelemetry/browser-sdk` (lives in `open-telemetry/opentelemetry-browser`, pre-1.0), otel-java (stable), opentelemetry-swift 2.6. -- Nitro Modules 0.37.x (pre-1.0). Requires Xcode ≥ 16.4, NDK ≥ 27. Pin the supported range +- Nitro Modules 0.37.x (pre-1.0). Requires Xcode ≥ 27.0 (the opentelemetry-swift 2.6 dependencies need Swift 6.4), NDK ≥ 27. Pin the supported range and document it; `react-native-nitro-modules` is a peer dependency the app installs. - Bare RN and Expo must both work. Expo config plugins only run in `expo prebuild`, so nothing essential may depend on a plugin. - opentelemetry-swift appears to be distributed via SwiftPM only (no podspec at repo root — reported by a reviewer, builder to confirm). The pod must pull it via - `spm_dependency` (RN ≥ 0.75) or vendor it; verify with Xcode 16.4, static frameworks and + `spm_dependency` (RN ≥ 0.75) or vendor it; verify with Xcode 27.0, static frameworks and Nitro's Swift/C++ interop. ## 4. Architecture (decided) From dde25510e2f6bf0598e8d866558a1d9de757c2e5 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Mon, 23 Nov 2026 20:18:32 +0100 Subject: [PATCH 02/76] ci: pre-boot the iOS simulator, upload hidden e2e traces Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e057292..8cd651f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,7 @@ jobs: name: verify-artifacts-static-fast path: verify/artifacts/ if-no-files-found: ignore + include-hidden-files: true # verify/e2e/.e2e is a dot dir fast-swift: runs-on: xcode-27 @@ -69,6 +70,7 @@ jobs: name: verify-artifacts-fast-swift path: verify/artifacts/ if-no-files-found: ignore + include-hidden-files: true # verify/e2e/.e2e is a dot dir # Release builds with the JS bundle embedded (no Metro), test mode on. # Native outputs are cached on native inputs only, so a JS-only change re-bundles but reuses the native build. @@ -150,6 +152,7 @@ jobs: verify/artifacts/ verify/e2e/.e2e/ if-no-files-found: ignore + include-hidden-files: true # verify/e2e/.e2e is a dot dir e2e-ios-bare: runs-on: xcode-27 @@ -190,6 +193,11 @@ jobs: xcodebuild -workspace OpenTelemetryExample.xcworkspace -scheme OpenTelemetryExample -configuration Release -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath build ARCHS=arm64 build + - name: Pre-boot the simulator (a cold boot on the runner outlasts agent-device's boot timeout) + run: | + udid=$(xcrun simctl list devices available -j | jq -r '[.devices[][] | select(.name | startswith("iPhone"))][0].udid') + xcrun simctl boot "$udid" + xcrun simctl bootstatus "$udid" -b - name: e2e (ios-bare) env: E2E_TARGET: ios-bare @@ -202,6 +210,7 @@ jobs: verify/artifacts/ verify/e2e/.e2e/ if-no-files-found: ignore + include-hidden-files: true # verify/e2e/.e2e is a dot dir budget: needs: [static-fast, fast-swift, e2e-android-bare, e2e-ios-bare] # every other job; extend when jobs are added From 288da6c251f5b7c455333f667a1861931b795157 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Mon, 23 Nov 2026 20:33:56 +0100 Subject: [PATCH 03/76] fix(example): compact scenario chips so every tap target fits a small CI screen Co-Authored-By: Claude Opus 5.5 --- example/src/ScenariosScreen.tsx | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/example/src/ScenariosScreen.tsx b/example/src/ScenariosScreen.tsx index a578e86..6f82e6d 100644 --- a/example/src/ScenariosScreen.tsx +++ b/example/src/ScenariosScreen.tsx @@ -1,5 +1,5 @@ import {useEffect, useState} from 'react'; -import {Platform, Pressable, ScrollView, StyleSheet, Text} from 'react-native'; +import {Platform, Pressable, ScrollView, StyleSheet, Text, View} from 'react-native'; import {resourceFromAttributes} from '@opentelemetry/resources'; import {SimpleSpanProcessor, TracerProvider} from '@opentelemetry/sdk-trace'; import {OTLPTraceExporter} from '@opentelemetry/exporter-trace-otlp-proto'; @@ -64,11 +64,6 @@ export function ScenariosScreen() { return ( {testMode} - {allScenarios().map(s => ( - - {s.name} - - ))} {/* hidden: driven by verify/e2e/tracer-bullet.e2e.ts */} tracer bullet @@ -76,13 +71,23 @@ export function ScenariosScreen() { {status === 'done' && done} {status === 'handoff' && handed off} {status.startsWith('error') && {status}} + {/* compact chips: everything the e2e runner taps must fit one small CI screen, no scrolling */} + + {allScenarios().map(s => ( + + {s.name} + + ))} + ); } const styles = StyleSheet.create({ - container: {padding: 24, paddingTop: 80, gap: 8}, - button: {padding: 12, backgroundColor: '#ddd'}, + container: {padding: 16, paddingTop: 40, gap: 4}, + chips: {flexDirection: 'row', flexWrap: 'wrap', gap: 4}, + button: {padding: 4, backgroundColor: '#ddd'}, + chipText: {fontSize: 10}, // tappable for the e2e runner, invisible to people - hidden: {opacity: 0.02, padding: 12}, + hidden: {opacity: 0.02, padding: 4}, }); From 6efe49aa53ddf97254e63717755433afa863796b Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Mon, 23 Nov 2026 22:32:41 +0100 Subject: [PATCH 04/76] ci(ios): longer agent-device daemon startup timeout, keep daemon logs on failure Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cd651f..571f1b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -201,7 +201,15 @@ jobs: - name: e2e (ios-bare) env: E2E_TARGET: ios-bare + AGENT_DEVICE_DAEMON_STARTUP_TIMEOUT_MS: '600000' # the first daemon start on a cold runner outlasts the 120 s default run: bun verify --e2e e2e + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: agent-device-state-e2e-ios-bare + path: ~/.agent-device/ + if-no-files-found: ignore + include-hidden-files: true - uses: actions/upload-artifact@v4 if: always() # e2e retries once; keep traces of retried and failed attempts with: From 003cf2937898e1f4691b4e17b575f66f2b4d1347 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Mon, 23 Nov 2026 22:58:03 +0100 Subject: [PATCH 05/76] fix(ios): log handOff counts as integers so the unified log does not redact them Co-Authored-By: Claude Opus 5.5 --- ios/Adapter/HybridOtel.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ios/Adapter/HybridOtel.swift b/ios/Adapter/HybridOtel.swift index 1bfe68e..f50beea 100644 --- a/ios/Adapter/HybridOtel.swift +++ b/ios/Adapter/HybridOtel.swift @@ -20,7 +20,8 @@ class HybridOtel: HybridOtelSpec { let attrs = spans.reduce(0) { $0 + $1.attributes.count } let events = spans.reduce(0) { $0 + $1.events.count } let links = spans.reduce(0) { $0 + $1.links.count } - NSLog("%@", "RNOtel handOff spans=\(spans.count) attrs=\(attrs) events=\(events) links=\(links)") + // integer arguments only: a %@ string is redacted as in the unified log on a runner without developer logging + NSLog("RNOtel handOff spans=%ld attrs=%ld events=%ld links=%ld", spans.count, attrs, events, links) } func flush(timeoutMs: Double) throws -> Promise { From 1253a27cc79725738ded1212db5ebb93052ef88a Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Mon, 23 Nov 2026 23:19:20 +0100 Subject: [PATCH 06/76] ci(ios): dump the simulator log on e2e failure Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 571f1b9..e5ed27e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -203,6 +203,12 @@ jobs: E2E_TARGET: ios-bare AGENT_DEVICE_DAEMON_STARTUP_TIMEOUT_MS: '600000' # the first daemon start on a cold runner outlasts the 120 s default run: bun verify --e2e e2e + - name: Diagnose the simulator log + if: failure() + run: | + echo "--- RNOtel lines"; xcrun simctl spawn booted log show --last 30m --info --style compact --predicate 'eventMessage CONTAINS "RNOtel"' | tail -20 + echo "--- app process lines"; xcrun simctl spawn booted log show --last 30m --info --style compact --predicate 'process == "OpenTelemetryExample"' | tail -20 + date; echo "$TZ" - uses: actions/upload-artifact@v4 if: failure() with: From ea0d6dda695a2193ce6c68466c4c98a19750c00a Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Mon, 23 Nov 2026 23:45:03 +0100 Subject: [PATCH 07/76] fix(e2e): capture the iOS device log with log stream (log show takes ~60 s per call on a runner) Co-Authored-By: Claude Opus 5.5 --- verify/e2e/harness.ts | 35 ++++++++++++++++++++++----------- verify/e2e/tracer-bullet.e2e.ts | 2 +- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/verify/e2e/harness.ts b/verify/e2e/harness.ts index 7e7638a..f8ab0d8 100644 --- a/verify/e2e/harness.ts +++ b/verify/e2e/harness.ts @@ -1,4 +1,4 @@ -import {execFileSync} from 'node:child_process'; +import {execFileSync, spawn} from 'node:child_process'; import path from 'node:path'; import {test as base} from '@e2e-dev/mobile'; import {expect, type App, type Screen} from 'e2e'; @@ -73,23 +73,36 @@ export async function expectScenario( if (!r.ok) throw new Error('\n' + r.report); } -/** Device log lines containing `needle`, logged after `since` (Android: after the last clearDeviceLog). */ -export function deviceLog(platform: 'android' | 'ios', deviceId: string, needle: string, since: Date): string[] { - const local = (d: Date) => new Date(d.getTime() - d.getTimezoneOffset() * 60_000).toISOString().slice(0, 19).replace('T', ' '); +// iOS: `log show` takes ~60 s per call on a CI runner, so lines are captured live by a `log stream` started in clearDeviceLog. +const iosStreams = new Map(); + +/** Device log lines containing `needle`, logged after the last clearDeviceLog (Android: logcat since the clear; iOS: the live stream). */ +export function deviceLog(platform: 'android' | 'ios', deviceId: string, needle: string, _since: Date): string[] { const out = platform === 'android' ? execFileSync('adb', ['-s', deviceId, 'logcat', '-d', '-v', 'raw', '-s', 'RNOtel:I'], {encoding: 'utf8'}) - : execFileSync( - 'xcrun', - ['simctl', 'spawn', deviceId, 'log', 'show', '--start', local(since), '--style', 'compact', - '--predicate', `process == "OpenTelemetryExample" AND eventMessage CONTAINS "${needle}"`], - {encoding: 'utf8', maxBuffer: 1 << 26}, - ); + : (iosStreams.get(deviceId)?.lines ?? []).join('\n'); return out.split('\n').filter(l => l.includes(needle)); } /** Starts a fresh log window; returns its start for deviceLog. */ -export function clearDeviceLog(platform: 'android' | 'ios', deviceId: string): Date { +export async function clearDeviceLog(platform: 'android' | 'ios', deviceId: string): Promise { if (platform === 'android') execFileSync('adb', ['-s', deviceId, 'logcat', '-c']); + else { + const state = {lines: [] as string[]}; + iosStreams.set(deviceId, state); + const child = spawn( + 'xcrun', + ['simctl', 'spawn', deviceId, 'log', 'stream', '--style', 'compact', '--level', 'info', + '--predicate', 'process == "OpenTelemetryExample" AND eventMessage CONTAINS "RNOtel"'], + {stdio: ['ignore', 'pipe', 'ignore']}, + ); + child.stdout.setEncoding('utf8'); + child.stdout.on('data', (d: string) => state.lines.push(...d.split('\n'))); + child.unref(); + (child.stdout as any).unref?.(); + process.on('exit', () => child.kill()); + await new Promise(r => setTimeout(r, 3_000)); // let the stream attach before the tap + } return new Date(); } diff --git a/verify/e2e/tracer-bullet.e2e.ts b/verify/e2e/tracer-bullet.e2e.ts index fb266e8..32d047e 100644 --- a/verify/e2e/tracer-bullet.e2e.ts +++ b/verify/e2e/tracer-bullet.e2e.ts @@ -17,7 +17,7 @@ test('handOff crosses the Nitro seam', async ({app, screen, device, target}) => const platform = platformOf(target); const {deviceId} = device.unstable_raw; await app.open(); - const since = clearDeviceLog(platform, deviceId); + const since = await clearDeviceLog(platform, deviceId); await screen.getByTestId('tracer-bullet-handoff').tap(); await expect(screen.getByTestId('tracer-bullet-done')).toBeVisible({timeout: 10_000}); // the log line can land a moment after the tap returns From 02512e5c93b533313916e44e6d542a5c60759002 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:01:11 +0100 Subject: [PATCH 08/76] ci(android): hide ANR dialogs so a slow Pixel Launcher cannot cover the app Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5ed27e..4f844fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -143,7 +143,9 @@ jobs: force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true - script: bun verify --e2e e2e + script: | + adb shell settings put global hide_error_dialogs 1 + bun verify --e2e e2e - uses: actions/upload-artifact@v4 if: always() # e2e retries once; keep traces of retried and failed attempts with: From cb6ec2a6fec2002d2cb757aff3cd83100ddf10de Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:27:31 +0100 Subject: [PATCH 09/76] ci: retry the Gradle build once, raise e2e action timeout for slow runners Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 5 ++++- verify/e2e/e2e.config.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f844fd..9e8b4fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,7 +112,10 @@ jobs: working-directory: example/android env: OTEL_TEST_MODE: '1' - run: ./gradlew :app:assembleRelease -PotelTestMode=true -PreactNativeArchitectures=x86_64 + # one retry: plugin and NDK downloads fail transiently on hosted runners + run: | + ./gradlew :app:assembleRelease -PotelTestMode=true -PreactNativeArchitectures=x86_64 || + ./gradlew :app:assembleRelease -PotelTestMode=true -PreactNativeArchitectures=x86_64 - name: Cache AVD snapshot uses: actions/cache@v4 id: avd-cache diff --git a/verify/e2e/e2e.config.ts b/verify/e2e/e2e.config.ts index 49fc467..49118e3 100644 --- a/verify/e2e/e2e.config.ts +++ b/verify/e2e/e2e.config.ts @@ -12,6 +12,7 @@ export default { retries: 1, timeout: 180_000, launchTimeout: 120_000, + actionTimeout: 90_000, // CI simulators answer installs and taps slowly targets: [ { name: 'android-bare', From 5f5005786b7acefc2138b88b93871cdd59f1f104 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Mon, 23 Nov 2026 23:45:36 +0100 Subject: [PATCH 10/76] feat(context): runtime patch with ROOT fast path and interval roots RNContextManager (StackContextManager + swap), installContextPatch with the globalThis marker holding the originals and the singleton (R3), src/setup.ts loaded by the scenarios Jest project. Un-pends the 11 Task 10 scenarios, adds the unit Jest project (R15), computes fixture NAMES from active Jest scenarios (R6) and drafts the new .js.otlp.json and .handoff.json files. Co-Authored-By: Claude Opus 5.5 --- jest.config.js | 10 + src/context/RNContextManager.ts | 12 ++ src/context/__tests__/patch.test.ts | 51 +++++ src/context/patch.ts | 74 +++++++ src/setup.ts | 10 + verify/expected/async-generator.js.otlp.json | 79 +++++++ .../batching-shared-queue.js.otlp.json | 67 ++++++ verify/expected/captured-then.js.otlp.json | 56 +++++ .../concurrent-interleaved.js.otlp.json | 99 +++++++++ .../expected/error-in-callback.js.otlp.json | 67 ++++++ .../expected/interval-new-root.js.otlp.json | 66 ++++++ .../nest-promise-all-race.js.otlp.json | 90 ++++++++ .../nest-timers-microtasks.js.otlp.json | 90 ++++++++ .../never-settling-promise.js.otlp.json | 66 ++++++ verify/expected/root-no-leak.js.otlp.json | 76 +++++++ verify/fixtures/async-generator.handoff.json | 150 +++++++++++++ .../batching-shared-queue.handoff.json | 121 +++++++++++ verify/fixtures/captured-then.handoff.json | 93 ++++++++ .../concurrent-interleaved.handoff.json | 204 ++++++++++++++++++ .../fixtures/error-in-callback.handoff.json | 121 +++++++++++ .../fixtures/interval-new-root.handoff.json | 120 +++++++++++ .../nest-promise-all-race.handoff.json | 178 +++++++++++++++ .../nest-timers-microtasks.handoff.json | 178 +++++++++++++++ .../never-settling-promise.handoff.json | 120 +++++++++++ verify/fixtures/root-no-leak.handoff.json | 147 +++++++++++++ verify/fixtures/smoke-js.handoff.json | 38 ++++ verify/jest/fixtures.test.ts | 9 +- verify/jest/jest.scenarios.config.js | 1 + verify/scenarios/async-generator.ts | 1 - verify/scenarios/batching-shared-queue.ts | 1 - verify/scenarios/captured-then.ts | 1 - verify/scenarios/concurrent-interleaved.ts | 1 - verify/scenarios/error-in-callback.ts | 1 - verify/scenarios/interval-new-root.ts | 1 - verify/scenarios/nest-after-await.ts | 1 - verify/scenarios/nest-promise-all-race.ts | 1 - verify/scenarios/nest-timers-microtasks.ts | 1 - verify/scenarios/never-settling-promise.ts | 1 - verify/scenarios/root-no-leak.ts | 1 - verify/stages/fast-js.ts | 2 +- 40 files changed, 2389 insertions(+), 17 deletions(-) create mode 100644 src/context/RNContextManager.ts create mode 100644 src/context/__tests__/patch.test.ts create mode 100644 src/context/patch.ts create mode 100644 src/setup.ts create mode 100644 verify/expected/async-generator.js.otlp.json create mode 100644 verify/expected/batching-shared-queue.js.otlp.json create mode 100644 verify/expected/captured-then.js.otlp.json create mode 100644 verify/expected/concurrent-interleaved.js.otlp.json create mode 100644 verify/expected/error-in-callback.js.otlp.json create mode 100644 verify/expected/interval-new-root.js.otlp.json create mode 100644 verify/expected/nest-promise-all-race.js.otlp.json create mode 100644 verify/expected/nest-timers-microtasks.js.otlp.json create mode 100644 verify/expected/never-settling-promise.js.otlp.json create mode 100644 verify/expected/root-no-leak.js.otlp.json create mode 100644 verify/fixtures/async-generator.handoff.json create mode 100644 verify/fixtures/batching-shared-queue.handoff.json create mode 100644 verify/fixtures/captured-then.handoff.json create mode 100644 verify/fixtures/concurrent-interleaved.handoff.json create mode 100644 verify/fixtures/error-in-callback.handoff.json create mode 100644 verify/fixtures/interval-new-root.handoff.json create mode 100644 verify/fixtures/nest-promise-all-race.handoff.json create mode 100644 verify/fixtures/nest-timers-microtasks.handoff.json create mode 100644 verify/fixtures/never-settling-promise.handoff.json create mode 100644 verify/fixtures/root-no-leak.handoff.json create mode 100644 verify/fixtures/smoke-js.handoff.json diff --git a/jest.config.js b/jest.config.js index 2085615..479f3a6 100644 --- a/jest.config.js +++ b/jest.config.js @@ -13,6 +13,16 @@ module.exports = { '/verify/harness/**/*.test.ts', ], }, + { + displayName: 'unit', + testEnvironment: 'node', + transform, + testMatch: [ + '/src/**/__tests__/**/*.test.[jt]s', + '/metro/__tests__/**/*.test.[jt]s', + '/vite/__tests__/**/*.test.[jt]s', + ], + }, '/verify/jest/jest.scenarios.config.js', // fixtures, degraded projects live under verify/jest/ (later tasks) ], diff --git a/src/context/RNContextManager.ts b/src/context/RNContextManager.ts new file mode 100644 index 0000000..66f2257 --- /dev/null +++ b/src/context/RNContextManager.ts @@ -0,0 +1,12 @@ +import type {Context} from '@opentelemetry/api'; +import {StackContextManager} from '@opentelemetry/sdk-trace'; + +/** StackContextManager plus a raw enter/leave primitive for the patch wrappers (§6.1). */ +export class RNContextManager extends StackContextManager { + /** Makes `ctx` active and returns the previous context; the caller restores it with another swap. */ + swap(ctx: Context): Context { + const prev = this._currentContext; + this._currentContext = ctx; + return prev; + } +} diff --git a/src/context/__tests__/patch.test.ts b/src/context/__tests__/patch.test.ts new file mode 100644 index 0000000..16991a4 --- /dev/null +++ b/src/context/__tests__/patch.test.ts @@ -0,0 +1,51 @@ +import {ROOT_CONTEXT, createContextKey} from '@opentelemetry/api'; +import {RNContextManager} from '../RNContextManager'; +import {installContextPatch} from '../patch'; + +// Spy installed before the patch: it stands in for the original `then` and records what reaches it. +const realThen = Promise.prototype.then; +const seen: unknown[] = []; +Promise.prototype.then = function (this: Promise, ok?: any, err?: any) { + seen.push(ok); + return realThen.call(this, ok, err); +} as typeof realThen; +const spy = Promise.prototype.then; + +const cm = new RNContextManager().enable(); +installContextPatch(cm); +const patched = {then: Promise.prototype.then, setTimeout: globalThis.setTimeout}; + +test('installContextPatch twice wraps once', () => { + installContextPatch(new RNContextManager().enable()); + expect(Promise.prototype.then).toBe(patched.then); + expect(globalThis.setTimeout).toBe(patched.setTimeout); + expect((globalThis as any)[Symbol.for('com.callstack.otel.patched')]).toMatchObject({then: spy, contextManager: cm}); +}); + +test('then registered at ROOT is not wrapped', () => { + const cb = () => {}; + seen.length = 0; + Promise.resolve().then(cb); + expect(cm.active()).toBe(ROOT_CONTEXT); + expect(seen).toEqual([cb]); + const ctx = ROOT_CONTEXT.setValue(createContextKey('k'), 1); + cm.with(ctx, () => Promise.resolve().then(cb)); + expect(seen[1]).not.toBe(cb); +}); + +test('timers forward extra arguments and restore the context', async () => { + const ctx = ROOT_CONTEXT.setValue(createContextKey('k'), 1); + const got = await new Promise(r => cm.with(ctx, () => setTimeout((a, b) => r([a, b, cm.active()]), 0, 'a', 'b'))); + expect(got).toEqual(['a', 'b', ctx]); + expect(cm.active()).toBe(ROOT_CONTEXT); +}); + +test('setInterval ticks run at ROOT', async () => { + const ctx = ROOT_CONTEXT.setValue(createContextKey('k'), 1); + const got = await new Promise(r => + cm.with(ctx, () => { + const id = setInterval(() => (clearInterval(id), r(cm.active())), 0); + }), + ); + expect(got).toBe(ROOT_CONTEXT); +}); diff --git a/src/context/patch.ts b/src/context/patch.ts new file mode 100644 index 0000000..9a895b3 --- /dev/null +++ b/src/context/patch.ts @@ -0,0 +1,74 @@ +import {ROOT_CONTEXT, type Context} from '@opentelemetry/api'; +import type {RNContextManager} from './RNContextManager'; + +export const MARKER = Symbol.for('com.callstack.otel.patched'); +const TIMERS = ['setTimeout', 'setImmediate', 'queueMicrotask', 'requestAnimationFrame'] as const; +type Fn = (...args: any[]) => any; + +/** Holds the pre-patch functions and the singleton, so a second install (fast refresh, a second SDK copy) is a no-op. */ +export type PatchMarker = { + then: typeof Promise.prototype.then; + setInterval: Fn; + contextManager: RNContextManager; +} & Partial>; + +/** + * Carries the active context from where a callback is scheduled to where it runs (§6.1). + * At ROOT the original is called unwrapped (every wrapper restores in `finally`, so jobs start at ROOT). + * `setInterval` ticks run in ROOT_CONTEXT (§6.2). + */ +export function installContextPatch(cm: RNContextManager): void { + const g = globalThis as any; + if (g[MARKER]) return; + const marker: PatchMarker = {then: Promise.prototype.then, setInterval: g.setInterval, contextManager: cm}; + + // fixed arity: `then` callbacks take one argument + const wrap = (ctx: Context, fn: Fn) => + function (this: unknown, v: unknown) { + const prev = cm.swap(ctx); + try { + return fn.call(this, v); + } finally { + cm.swap(prev); + } + }; + // timers forward extra arguments + const wrapArgs = (ctx: Context, fn: Fn) => + function (this: unknown, ...args: unknown[]) { + const prev = cm.swap(ctx); + try { + return fn.apply(this, args); + } finally { + cm.swap(prev); + } + }; + + const then = marker.then; + Promise.prototype.then = function (this: Promise, ok?: any, err?: any) { + const ctx = cm.active(); + if (ctx === ROOT_CONTEXT) return then.call(this, ok, err); + return then.call( + this, + typeof ok === 'function' ? wrap(ctx, ok) : ok, + typeof err === 'function' ? wrap(ctx, err) : err, + ); + } as typeof then; + + for (const name of TIMERS) { + const orig: Fn | undefined = g[name]; + if (typeof orig !== 'function') continue; // rAF is absent in Node, setImmediate on web + marker[name] = orig; + g[name] = function (cb: unknown, ...rest: unknown[]) { + const ctx = cm.active(); + return orig(ctx === ROOT_CONTEXT || typeof cb !== 'function' ? cb : wrapArgs(ctx, cb as Fn), ...rest); + }; + } + + const setInterval = marker.setInterval; + g.setInterval = function (cb: unknown, ...rest: unknown[]) { + const root = cm.active() === ROOT_CONTEXT || typeof cb !== 'function'; + return setInterval(root ? cb : wrapArgs(ROOT_CONTEXT, cb as Fn), ...rest); + }; + + g[MARKER] = marker; +} diff --git a/src/setup.ts b/src/setup.ts new file mode 100644 index 0000000..033248b --- /dev/null +++ b/src/setup.ts @@ -0,0 +1,10 @@ +import {context} from '@opentelemetry/api'; +import {RNContextManager} from './context/RNContextManager'; +import {MARKER, installContextPatch, type PatchMarker} from './context/patch'; + +// Runs before the app (Metro/Vite helpers). Reuse the marker's singleton so a re-evaluation (fast refresh, +// a second copy of the SDK) never makes a second context manager. +const existing: PatchMarker | undefined = (globalThis as any)[MARKER]; +export const contextManager: RNContextManager = existing?.contextManager ?? new RNContextManager().enable(); +installContextPatch(contextManager); +context.setGlobalContextManager(contextManager); diff --git a/verify/expected/async-generator.js.otlp.json b/verify/expected/async-generator.js.otlp.json new file mode 100644 index 0000000..cbf84fd --- /dev/null +++ b/verify/expected/async-generator.js.otlp.json @@ -0,0 +1,79 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000060000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "gen.0", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "loop.0", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "gen.1", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "parentSpanId": "0a00000000000001", + "name": "loop.1", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/batching-shared-queue.js.otlp.json b/verify/expected/batching-shared-queue.js.otlp.json new file mode 100644 index 0000000..0b41dc0 --- /dev/null +++ b/verify/expected/batching-shared-queue.js.otlp.json @@ -0,0 +1,67 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "h1", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000001000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000002", + "name": "h2", + "kind": 1, + "startTimeUnixNano": "1767225600000002000", + "endTimeUnixNano": "1767225600000003000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "h1.work", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "h2.work", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/captured-then.js.otlp.json b/verify/expected/captured-then.js.otlp.json new file mode 100644 index 0000000..b57eb7e --- /dev/null +++ b/verify/expected/captured-then.js.otlp.json @@ -0,0 +1,56 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000030000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "kept", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "name": "lost", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/concurrent-interleaved.js.otlp.json b/verify/expected/concurrent-interleaved.js.otlp.json new file mode 100644 index 0000000..3428488 --- /dev/null +++ b/verify/expected/concurrent-interleaved.js.otlp.json @@ -0,0 +1,99 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "a", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000030000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000002", + "name": "b", + "kind": 1, + "startTimeUnixNano": "1767225600000001000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "a.1", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000002", + "name": "b.1", + "kind": 1, + "startTimeUnixNano": "1767225600000011000", + "endTimeUnixNano": "1767225600000012000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "parentSpanId": "0a00000000000001", + "name": "a.2", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000006", + "parentSpanId": "0a00000000000002", + "name": "b.2", + "kind": 1, + "startTimeUnixNano": "1767225600000021000", + "endTimeUnixNano": "1767225600000022000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000007", + "name": "after.all", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/error-in-callback.js.otlp.json b/verify/expected/error-in-callback.js.otlp.json new file mode 100644 index 0000000..22eccaa --- /dev/null +++ b/verify/expected/error-in-callback.js.otlp.json @@ -0,0 +1,67 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000040000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "throws", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "name": "root.next", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "caught", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/interval-new-root.js.otlp.json b/verify/expected/interval-new-root.js.otlp.json new file mode 100644 index 0000000..3923a1e --- /dev/null +++ b/verify/expected/interval-new-root.js.otlp.json @@ -0,0 +1,66 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "tap", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000400000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000002", + "name": "tick", + "kind": 1, + "startTimeUnixNano": "1767225600000100000", + "endTimeUnixNano": "1767225600000101000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000003", + "name": "tick", + "kind": 1, + "startTimeUnixNano": "1767225600000200000", + "endTimeUnixNano": "1767225600000201000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "load", + "kind": 1, + "startTimeUnixNano": "1767225600000300000", + "endTimeUnixNano": "1767225600000301000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/nest-promise-all-race.js.otlp.json b/verify/expected/nest-promise-all-race.js.otlp.json new file mode 100644 index 0000000..57ceef3 --- /dev/null +++ b/verify/expected/nest-promise-all-race.js.otlp.json @@ -0,0 +1,90 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000060000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "all.a", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "all.b", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "race.a", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "parentSpanId": "0a00000000000001", + "name": "race.b", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000006", + "parentSpanId": "0a00000000000001", + "name": "after", + "kind": 1, + "startTimeUnixNano": "1767225600000050000", + "endTimeUnixNano": "1767225600000051000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/nest-timers-microtasks.js.otlp.json b/verify/expected/nest-timers-microtasks.js.otlp.json new file mode 100644 index 0000000..c730379 --- /dev/null +++ b/verify/expected/nest-timers-microtasks.js.otlp.json @@ -0,0 +1,90 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000050000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "timeout", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "immediate", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "microtask", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "parentSpanId": "0a00000000000001", + "name": "timeout.microtask", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000006", + "parentSpanId": "0a00000000000001", + "name": "after.end", + "kind": 1, + "startTimeUnixNano": "1767225600000060000", + "endTimeUnixNano": "1767225600000061000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/never-settling-promise.js.otlp.json b/verify/expected/never-settling-promise.js.otlp.json new file mode 100644 index 0000000..a71e213 --- /dev/null +++ b/verify/expected/never-settling-promise.js.otlp.json @@ -0,0 +1,66 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000020000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "child", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "name": "later.await", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000004", + "name": "later.timeout", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/root-no-leak.js.otlp.json b/verify/expected/root-no-leak.js.otlp.json new file mode 100644 index 0000000..b72d020 --- /dev/null +++ b/verify/expected/root-no-leak.js.otlp.json @@ -0,0 +1,76 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "scoped", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000020000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "scoped.child", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "name": "after.sync", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000004", + "name": "after.await", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000004", + "spanId": "0a00000000000005", + "name": "after.timeout", + "kind": 1, + "startTimeUnixNano": "1767225600000050000", + "endTimeUnixNano": "1767225600000051000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/fixtures/async-generator.handoff.json b/verify/fixtures/async-generator.handoff.json new file mode 100644 index 0000000..7ba0c3b --- /dev/null +++ b/verify/fixtures/async-generator.handoff.json @@ -0,0 +1,150 @@ +{ + "config": { + "serviceName": "verify", + "serviceVersion": "0.0.0", + "resourceAttributes": [], + "exportUrl": "", + "exportHeaders": [] + }, + "spans": [ + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "gen.0", + "kind": 0, + "start": [ + 1767225600, + 10000 + ], + "end": [ + 1767225600, + 11000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "loop.0", + "kind": 0, + "start": [ + 1767225600, + 20000 + ], + "end": [ + 1767225600, + 21000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "gen.1", + "kind": 0, + "start": [ + 1767225600, + 30000 + ], + "end": [ + 1767225600, + 31000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "loop.1", + "kind": 0, + "start": [ + 1767225600, + 40000 + ], + "end": [ + 1767225600, + 41000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "traceFlags": 1 + }, + "name": "root", + "kind": 0, + "start": [ + 1767225600, + 0 + ], + "end": [ + 1767225600, + 60000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + } + ] +} diff --git a/verify/fixtures/batching-shared-queue.handoff.json b/verify/fixtures/batching-shared-queue.handoff.json new file mode 100644 index 0000000..6384cb1 --- /dev/null +++ b/verify/fixtures/batching-shared-queue.handoff.json @@ -0,0 +1,121 @@ +{ + "config": { + "serviceName": "verify", + "serviceVersion": "0.0.0", + "resourceAttributes": [], + "exportUrl": "", + "exportHeaders": [] + }, + "spans": [ + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "traceFlags": 1 + }, + "name": "h1", + "kind": 0, + "start": [ + 1767225600, + 0 + ], + "end": [ + 1767225600, + 1000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000002", + "traceFlags": 1 + }, + "name": "h2", + "kind": 0, + "start": [ + 1767225600, + 2000 + ], + "end": [ + 1767225600, + 3000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "h1.work", + "kind": 0, + "start": [ + 1767225600, + 10000 + ], + "end": [ + 1767225600, + 11000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "h2.work", + "kind": 0, + "start": [ + 1767225600, + 20000 + ], + "end": [ + 1767225600, + 21000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + } + ] +} diff --git a/verify/fixtures/captured-then.handoff.json b/verify/fixtures/captured-then.handoff.json new file mode 100644 index 0000000..21eecda --- /dev/null +++ b/verify/fixtures/captured-then.handoff.json @@ -0,0 +1,93 @@ +{ + "config": { + "serviceName": "verify", + "serviceVersion": "0.0.0", + "resourceAttributes": [], + "exportUrl": "", + "exportHeaders": [] + }, + "spans": [ + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "kept", + "kind": 0, + "start": [ + 1767225600, + 10000 + ], + "end": [ + 1767225600, + 11000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "traceFlags": 1 + }, + "name": "lost", + "kind": 0, + "start": [ + 1767225600, + 20000 + ], + "end": [ + 1767225600, + 21000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "traceFlags": 1 + }, + "name": "parent", + "kind": 0, + "start": [ + 1767225600, + 0 + ], + "end": [ + 1767225600, + 30000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + } + ] +} diff --git a/verify/fixtures/concurrent-interleaved.handoff.json b/verify/fixtures/concurrent-interleaved.handoff.json new file mode 100644 index 0000000..e3b1d36 --- /dev/null +++ b/verify/fixtures/concurrent-interleaved.handoff.json @@ -0,0 +1,204 @@ +{ + "config": { + "serviceName": "verify", + "serviceVersion": "0.0.0", + "resourceAttributes": [], + "exportUrl": "", + "exportHeaders": [] + }, + "spans": [ + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "a.1", + "kind": 0, + "start": [ + 1767225600, + 10000 + ], + "end": [ + 1767225600, + 11000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000004", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000002", + "name": "b.1", + "kind": 0, + "start": [ + 1767225600, + 11000 + ], + "end": [ + 1767225600, + 12000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "a.2", + "kind": 0, + "start": [ + 1767225600, + 20000 + ], + "end": [ + 1767225600, + 21000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "traceFlags": 1 + }, + "name": "a", + "kind": 0, + "start": [ + 1767225600, + 0 + ], + "end": [ + 1767225600, + 30000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000006", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000002", + "name": "b.2", + "kind": 0, + "start": [ + 1767225600, + 21000 + ], + "end": [ + 1767225600, + 22000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000002", + "traceFlags": 1 + }, + "name": "b", + "kind": 0, + "start": [ + 1767225600, + 1000 + ], + "end": [ + 1767225600, + 31000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000007", + "traceFlags": 1 + }, + "name": "after.all", + "kind": 0, + "start": [ + 1767225600, + 40000 + ], + "end": [ + 1767225600, + 41000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + } + ] +} diff --git a/verify/fixtures/error-in-callback.handoff.json b/verify/fixtures/error-in-callback.handoff.json new file mode 100644 index 0000000..86e1469 --- /dev/null +++ b/verify/fixtures/error-in-callback.handoff.json @@ -0,0 +1,121 @@ +{ + "config": { + "serviceName": "verify", + "serviceVersion": "0.0.0", + "resourceAttributes": [], + "exportUrl": "", + "exportHeaders": [] + }, + "spans": [ + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "throws", + "kind": 0, + "start": [ + 1767225600, + 10000 + ], + "end": [ + 1767225600, + 11000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "traceFlags": 1 + }, + "name": "root.next", + "kind": 0, + "start": [ + 1767225600, + 30000 + ], + "end": [ + 1767225600, + 31000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "caught", + "kind": 0, + "start": [ + 1767225600, + 20000 + ], + "end": [ + 1767225600, + 21000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "traceFlags": 1 + }, + "name": "parent", + "kind": 0, + "start": [ + 1767225600, + 0 + ], + "end": [ + 1767225600, + 40000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + } + ] +} diff --git a/verify/fixtures/interval-new-root.handoff.json b/verify/fixtures/interval-new-root.handoff.json new file mode 100644 index 0000000..693f25f --- /dev/null +++ b/verify/fixtures/interval-new-root.handoff.json @@ -0,0 +1,120 @@ +{ + "config": { + "serviceName": "verify", + "serviceVersion": "0.0.0", + "resourceAttributes": [], + "exportUrl": "", + "exportHeaders": [] + }, + "spans": [ + { + "context": { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000002", + "traceFlags": 1 + }, + "name": "tick", + "kind": 0, + "start": [ + 1767225600, + 100000 + ], + "end": [ + 1767225600, + 101000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000003", + "traceFlags": 1 + }, + "name": "tick", + "kind": 0, + "start": [ + 1767225600, + 200000 + ], + "end": [ + 1767225600, + 201000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "load", + "kind": 0, + "start": [ + 1767225600, + 300000 + ], + "end": [ + 1767225600, + 301000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "traceFlags": 1 + }, + "name": "tap", + "kind": 0, + "start": [ + 1767225600, + 0 + ], + "end": [ + 1767225600, + 400000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + } + ] +} diff --git a/verify/fixtures/nest-promise-all-race.handoff.json b/verify/fixtures/nest-promise-all-race.handoff.json new file mode 100644 index 0000000..94c3043 --- /dev/null +++ b/verify/fixtures/nest-promise-all-race.handoff.json @@ -0,0 +1,178 @@ +{ + "config": { + "serviceName": "verify", + "serviceVersion": "0.0.0", + "resourceAttributes": [], + "exportUrl": "", + "exportHeaders": [] + }, + "spans": [ + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "all.a", + "kind": 0, + "start": [ + 1767225600, + 10000 + ], + "end": [ + 1767225600, + 11000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "all.b", + "kind": 0, + "start": [ + 1767225600, + 20000 + ], + "end": [ + 1767225600, + 21000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "race.a", + "kind": 0, + "start": [ + 1767225600, + 30000 + ], + "end": [ + 1767225600, + 31000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "race.b", + "kind": 0, + "start": [ + 1767225600, + 40000 + ], + "end": [ + 1767225600, + 41000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000006", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "after", + "kind": 0, + "start": [ + 1767225600, + 50000 + ], + "end": [ + 1767225600, + 51000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "traceFlags": 1 + }, + "name": "root", + "kind": 0, + "start": [ + 1767225600, + 0 + ], + "end": [ + 1767225600, + 60000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + } + ] +} diff --git a/verify/fixtures/nest-timers-microtasks.handoff.json b/verify/fixtures/nest-timers-microtasks.handoff.json new file mode 100644 index 0000000..d22d796 --- /dev/null +++ b/verify/fixtures/nest-timers-microtasks.handoff.json @@ -0,0 +1,178 @@ +{ + "config": { + "serviceName": "verify", + "serviceVersion": "0.0.0", + "resourceAttributes": [], + "exportUrl": "", + "exportHeaders": [] + }, + "spans": [ + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "timeout", + "kind": 0, + "start": [ + 1767225600, + 10000 + ], + "end": [ + 1767225600, + 11000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "immediate", + "kind": 0, + "start": [ + 1767225600, + 20000 + ], + "end": [ + 1767225600, + 21000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "microtask", + "kind": 0, + "start": [ + 1767225600, + 30000 + ], + "end": [ + 1767225600, + 31000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "timeout.microtask", + "kind": 0, + "start": [ + 1767225600, + 40000 + ], + "end": [ + 1767225600, + 41000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "traceFlags": 1 + }, + "name": "root", + "kind": 0, + "start": [ + 1767225600, + 0 + ], + "end": [ + 1767225600, + 50000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000006", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "after.end", + "kind": 0, + "start": [ + 1767225600, + 60000 + ], + "end": [ + 1767225600, + 61000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + } + ] +} diff --git a/verify/fixtures/never-settling-promise.handoff.json b/verify/fixtures/never-settling-promise.handoff.json new file mode 100644 index 0000000..14e44fd --- /dev/null +++ b/verify/fixtures/never-settling-promise.handoff.json @@ -0,0 +1,120 @@ +{ + "config": { + "serviceName": "verify", + "serviceVersion": "0.0.0", + "resourceAttributes": [], + "exportUrl": "", + "exportHeaders": [] + }, + "spans": [ + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "child", + "kind": 0, + "start": [ + 1767225600, + 10000 + ], + "end": [ + 1767225600, + 11000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "traceFlags": 1 + }, + "name": "parent", + "kind": 0, + "start": [ + 1767225600, + 0 + ], + "end": [ + 1767225600, + 20000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "traceFlags": 1 + }, + "name": "later.await", + "kind": 0, + "start": [ + 1767225600, + 30000 + ], + "end": [ + 1767225600, + 31000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000004", + "traceFlags": 1 + }, + "name": "later.timeout", + "kind": 0, + "start": [ + 1767225600, + 40000 + ], + "end": [ + 1767225600, + 41000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + } + ] +} diff --git a/verify/fixtures/root-no-leak.handoff.json b/verify/fixtures/root-no-leak.handoff.json new file mode 100644 index 0000000..8c3a437 --- /dev/null +++ b/verify/fixtures/root-no-leak.handoff.json @@ -0,0 +1,147 @@ +{ + "config": { + "serviceName": "verify", + "serviceVersion": "0.0.0", + "resourceAttributes": [], + "exportUrl": "", + "exportHeaders": [] + }, + "spans": [ + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "traceFlags": 1 + }, + "parentSpanId": "0a00000000000001", + "name": "scoped.child", + "kind": 0, + "start": [ + 1767225600, + 10000 + ], + "end": [ + 1767225600, + 11000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "traceFlags": 1 + }, + "name": "scoped", + "kind": 0, + "start": [ + 1767225600, + 0 + ], + "end": [ + 1767225600, + 20000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "traceFlags": 1 + }, + "name": "after.sync", + "kind": 0, + "start": [ + 1767225600, + 30000 + ], + "end": [ + 1767225600, + 31000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000004", + "traceFlags": 1 + }, + "name": "after.await", + "kind": 0, + "start": [ + 1767225600, + 40000 + ], + "end": [ + 1767225600, + 41000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + }, + { + "context": { + "traceId": "0a000000000000000000000000000004", + "spanId": "0a00000000000005", + "traceFlags": 1 + }, + "name": "after.timeout", + "kind": 0, + "start": [ + 1767225600, + 50000 + ], + "end": [ + 1767225600, + 51000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + } + ] +} diff --git a/verify/fixtures/smoke-js.handoff.json b/verify/fixtures/smoke-js.handoff.json new file mode 100644 index 0000000..ae0cc1b --- /dev/null +++ b/verify/fixtures/smoke-js.handoff.json @@ -0,0 +1,38 @@ +{ + "config": { + "serviceName": "verify", + "serviceVersion": "0.0.0", + "resourceAttributes": [], + "exportUrl": "", + "exportHeaders": [] + }, + "spans": [ + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "traceFlags": 1 + }, + "name": "smoke", + "kind": 0, + "start": [ + 1767225600, + 0 + ], + "end": [ + 1767225600, + 1000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + } + ] +} diff --git a/verify/jest/fixtures.test.ts b/verify/jest/fixtures.test.ts index 215f46d..c2c85c9 100644 --- a/verify/jest/fixtures.test.ts +++ b/verify/jest/fixtures.test.ts @@ -11,7 +11,6 @@ import type {Otel, SeamSpan} from '../../src/native/Otel.nitro'; import {allScenarios} from '../scenarios'; import {pendingScenarios} from '../harness/compare'; -const NAMES = ['handoff-basic', 'rich-span', 'odd-attributes', 'nest-after-await']; const CONFIG = { serviceName: 'verify', serviceVersion: '0.0.0', @@ -81,11 +80,11 @@ describe('NativeHandOffProcessor', () => { }); }); -for (const name of NAMES) { - const s = allScenarios().find(x => x.name === name); - if (!s) throw new Error('unknown fixture scenario ' + name); +// R6: every active Jest scenario has a seam fixture +for (const s of allScenarios().filter(x => !x.pending && x.runners.includes('jest'))) { + const name = s.name; // a pending body is not its final version yet: keep the reviewed fixture until the owning task un-pends it - if (s.pending || pendingScenarios.has(name)) { + if (pendingScenarios.has(name)) { test.todo(`${name} fixture matches hand-off payloads`); continue; } diff --git a/verify/jest/jest.scenarios.config.js b/verify/jest/jest.scenarios.config.js index 3e44d04..ad092a7 100644 --- a/verify/jest/jest.scenarios.config.js +++ b/verify/jest/jest.scenarios.config.js @@ -4,5 +4,6 @@ module.exports = { rootDir: '../..', testEnvironment: 'node', transform: {'\\.[jt]sx?$': ['babel-jest', {presets: ['@react-native/babel-preset']}]}, + setupFiles: ['/src/setup.ts'], testMatch: ['/verify/jest/scenarios.test.ts', '/verify/jest/fixtures.test.ts'], }; diff --git a/verify/scenarios/async-generator.ts b/verify/scenarios/async-generator.ts index e49a711..d7d59a8 100644 --- a/verify/scenarios/async-generator.ts +++ b/verify/scenarios/async-generator.ts @@ -16,5 +16,4 @@ export default scenario( root.end(at(60)); }); }, - {pending: true}, // Task 10 ); diff --git a/verify/scenarios/batching-shared-queue.ts b/verify/scenarios/batching-shared-queue.ts index 34fc79a..097fb46 100644 --- a/verify/scenarios/batching-shared-queue.ts +++ b/verify/scenarios/batching-shared-queue.ts @@ -28,5 +28,4 @@ export default scenario( }); await done; }, - {pending: true}, // Task 10 ); diff --git a/verify/scenarios/captured-then.ts b/verify/scenarios/captured-then.ts index 0452e2f..3b0731e 100644 --- a/verify/scenarios/captured-then.ts +++ b/verify/scenarios/captured-then.ts @@ -15,5 +15,4 @@ export default scenario( parent.end(at(30)); }); }, - {pending: true}, // Task 10 ); diff --git a/verify/scenarios/concurrent-interleaved.ts b/verify/scenarios/concurrent-interleaved.ts index 7c269a0..92a4624 100644 --- a/verify/scenarios/concurrent-interleaved.ts +++ b/verify/scenarios/concurrent-interleaved.ts @@ -18,5 +18,4 @@ export default scenario( // back at ROOT after the join: guards the ROOT fast path (§6.1) tracer.startSpan('after.all', {startTime: at(40)}).end(at(41)); }, - {pending: true}, // Task 10 ); diff --git a/verify/scenarios/error-in-callback.ts b/verify/scenarios/error-in-callback.ts index ef21c12..5067199 100644 --- a/verify/scenarios/error-in-callback.ts +++ b/verify/scenarios/error-in-callback.ts @@ -19,5 +19,4 @@ export default scenario( await Promise.all([caught, next]); parent.end(at(40)); }, - {pending: true}, // Task 10 ); diff --git a/verify/scenarios/interval-new-root.ts b/verify/scenarios/interval-new-root.ts index 8f5a537..44e6ea8 100644 --- a/verify/scenarios/interval-new-root.ts +++ b/verify/scenarios/interval-new-root.ts @@ -23,5 +23,4 @@ export default scenario( tap.end(at(400)); }); }, - {pending: true}, // Task 10 ); diff --git a/verify/scenarios/nest-after-await.ts b/verify/scenarios/nest-after-await.ts index 4aa98f6..c05939b 100644 --- a/verify/scenarios/nest-after-await.ts +++ b/verify/scenarios/nest-after-await.ts @@ -10,5 +10,4 @@ export default scenario( parent.end(at(30)); }); }, - {pending: true}, // Task 10 ); diff --git a/verify/scenarios/nest-promise-all-race.ts b/verify/scenarios/nest-promise-all-race.ts index 0d7626a..89d52e1 100644 --- a/verify/scenarios/nest-promise-all-race.ts +++ b/verify/scenarios/nest-promise-all-race.ts @@ -16,5 +16,4 @@ export default scenario( root.end(at(60)); }); }, - {pending: true}, // Task 10 ); diff --git a/verify/scenarios/nest-timers-microtasks.ts b/verify/scenarios/nest-timers-microtasks.ts index 985d46a..1449050 100644 --- a/verify/scenarios/nest-timers-microtasks.ts +++ b/verify/scenarios/nest-timers-microtasks.ts @@ -25,5 +25,4 @@ export default scenario( await inCallback(cb => setTimeout(cb, 0), 'after.end', 60); }); }, - {pending: true}, // Task 10 ); diff --git a/verify/scenarios/never-settling-promise.ts b/verify/scenarios/never-settling-promise.ts index 422b335..3b6f678 100644 --- a/verify/scenarios/never-settling-promise.ts +++ b/verify/scenarios/never-settling-promise.ts @@ -15,5 +15,4 @@ export default scenario( await new Promise(r => setTimeout(r, 0)); tracer.startSpan('later.timeout', {startTime: at(40)}).end(at(41)); }, - {pending: true}, // Task 10 ); diff --git a/verify/scenarios/root-no-leak.ts b/verify/scenarios/root-no-leak.ts index eee3dd6..ede92db 100644 --- a/verify/scenarios/root-no-leak.ts +++ b/verify/scenarios/root-no-leak.ts @@ -18,5 +18,4 @@ export default scenario( await new Promise(r => setTimeout(r, 0)); tracer.startSpan('after.timeout', {startTime: at(50)}).end(at(51)); }, - {pending: true}, // Task 10 ); diff --git a/verify/stages/fast-js.ts b/verify/stages/fast-js.ts index f861d3e..34f1faa 100644 --- a/verify/stages/fast-js.ts +++ b/verify/stages/fast-js.ts @@ -5,7 +5,7 @@ const stage: Stage = { order: 20, e2e: false, run({sh}) { - sh(['bun', 'run', 'test', '--selectProjects', 'scenarios', '--verbose', '--reporters=default']); + sh(['bun', 'run', 'test', '--selectProjects', 'unit', 'scenarios', '--verbose', '--reporters=default']); }, }; From d5f05ccbf8f45ae8c39e6b47647c2db336b58d23 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Mon, 23 Nov 2026 23:49:52 +0100 Subject: [PATCH 11/76] feat(context): startup probe and degraded scope attribute Co-Authored-By: Claude Sonnet 5.5 --- jest.config.js | 2 +- src/context/__tests__/probe.test.ts | 19 ++++++++ src/context/probe.ts | 29 +++++++++++ src/context/scope.ts | 27 +++++++++++ verify/VERIFY.md | 2 +- verify/expected/degraded-probe.js.otlp.json | 53 +++++++++++++++++++++ verify/jest/degraded.test.ts | 45 +++++++++++++++++ verify/jest/jest.degraded.config.js | 20 ++++++++ verify/scenarios/degraded-probe.ts | 2 +- verify/scenarios/rich-span.ts | 4 +- verify/stages/fast-js.ts | 2 +- 11 files changed, 199 insertions(+), 6 deletions(-) create mode 100644 src/context/__tests__/probe.test.ts create mode 100644 src/context/probe.ts create mode 100644 src/context/scope.ts create mode 100644 verify/expected/degraded-probe.js.otlp.json create mode 100644 verify/jest/degraded.test.ts create mode 100644 verify/jest/jest.degraded.config.js diff --git a/jest.config.js b/jest.config.js index 479f3a6..5d7d2b7 100644 --- a/jest.config.js +++ b/jest.config.js @@ -24,6 +24,6 @@ module.exports = { ], }, '/verify/jest/jest.scenarios.config.js', - // fixtures, degraded projects live under verify/jest/ (later tasks) + '/verify/jest/jest.degraded.config.js', ], }; diff --git a/src/context/__tests__/probe.test.ts b/src/context/__tests__/probe.test.ts new file mode 100644 index 0000000..713c005 --- /dev/null +++ b/src/context/__tests__/probe.test.ts @@ -0,0 +1,19 @@ +import {context} from '@opentelemetry/api'; +import {DEGRADED_ATTR, probeAsyncContext, scopeAttributes} from '../probe'; +import '../../setup'; + +// Built with `new Function` so it stays native async whichever Babel config compiled this file. +const nativeStep = new Function('context', 'return (async () => { await null; return context.active(); })')(context); + +test('probe resolves true when then is patched and false when async is native', async () => { + const err = jest.spyOn(console, 'error').mockImplementation(() => {}); + // a `.then` chain goes through the patched Promise.prototype.then + expect(await probeAsyncContext(() => Promise.resolve().then(() => context.active()))).toBe(true); + expect(scopeAttributes()).toEqual({}); + expect(err).not.toHaveBeenCalled(); + + expect(await probeAsyncContext(nativeStep)).toBe(false); + expect(err).toHaveBeenCalledTimes(1); + expect(String(err.mock.calls[0]?.[0])).toMatch(/await/); + expect(scopeAttributes()).toEqual({[DEGRADED_ATTR]: true}); +}); diff --git a/src/context/probe.ts b/src/context/probe.ts new file mode 100644 index 0000000..884add6 --- /dev/null +++ b/src/context/probe.ts @@ -0,0 +1,29 @@ +import {context, createContextKey, type Context} from '@opentelemetry/api'; +import {DEGRADED_ATTR, markDegraded} from './scope'; + +export {DEGRADED_ATTR, scopeAttributes} from './scope'; + +const KEY = createContextKey('com.callstack.probe'); + +// `await` here only keeps the context if the bundler downleveled async to generators (then the patched `then` runs). +const defaultStep = async (): Promise => { + await null; + return context.active(); +}; + +/** + * Startup probe (§6.1.4): does the active context survive `await`? On failure, logs once and flags the SDK's tracers + * as degraded. `step` is injectable for tests. + */ +export async function probeAsyncContext(step: () => Promise = defaultStep): Promise { + const after = await context.with(context.active().setValue(KEY, true), step); + const ok = after.getValue(KEY) === true; + if (!ok) { + console.error( + `[react-native-open-telemetry] context did not survive \`await\`: native async/await was not downleveled, ` + + `so spans after \`await\` will be roots (${DEGRADED_ATTR}=true). Use the Metro/Vite helper or transform async-to-generator.`, + ); + markDegraded(); + } + return ok; +} diff --git a/src/context/scope.ts b/src/context/scope.ts new file mode 100644 index 0000000..ce861ee --- /dev/null +++ b/src/context/scope.ts @@ -0,0 +1,27 @@ +import type {Attributes, Tracer} from '@opentelemetry/api'; + +export const DEGRADED_ATTR = 'com.callstack.context.degraded'; + +let degraded = false; +// ponytail: one entry per tracer; tracers are few and long-lived +const stamped = new Map<{attributes?: Attributes}, Attributes>(); + +/** Scope attributes every SDK tracer carries: the degraded flag once the startup probe has failed (§6.1.4). */ +export const scopeAttributes = (): Attributes => (degraded ? {[DEGRADED_ATTR]: true} : {}); + +/** Called by the probe on failure; tracers stamped earlier get the flag too. */ +export function markDegraded(): void { + degraded = true; + for (const [scope, extra] of stamped) scope.attributes = {...extra, ...scopeAttributes()}; +} + +/** + * sdk-trace 3.1 has no API for scope attributes, but its OTLP exporter and our seam read them off + * `tracer.instrumentationScope` at runtime. Every tracer the SDK hands out goes through here (mobile and web). + */ +export function stampScope(tracer: T, extra: Attributes = {}): T { + const scope = (tracer as unknown as {instrumentationScope: {attributes?: Attributes}}).instrumentationScope; + stamped.set(scope, extra); + scope.attributes = {...extra, ...scopeAttributes()}; + return tracer; +} diff --git a/verify/VERIFY.md b/verify/VERIFY.md index a115592..cbe5d97 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -58,7 +58,7 @@ e2e targets are android, ios and web unless the Runners column names them. | `never-settling-promise` | a never-settling promise does not leak its span into later work | 10 | jest, e2e | pending | | `interval-new-root` | exception: each `setInterval` tick is a new root | 10 | jest, e2e | pending | | `batching-shared-queue` | exception: a shared queue runs work as its first enqueuer (pinned wrong parent) | 10 | jest, e2e | pending | -| `degraded-probe` | native `await` → degraded scope attribute, spans after `await` are roots | 11 | jest-degraded | pending | +| `degraded-probe` | native `await` → degraded scope attribute, spans after `await` are roots | 11 | jest-degraded | passing | | `interaction-manager` | `runAfterInteractions` callback is a child of the caller's span | 13 | e2e | pending | | `nest-raf` | a `requestAnimationFrame` callback keeps its scheduling context | 13 | e2e | pending | | `event-emitter-listener` | a synchronous `DeviceEventEmitter` listener is a child of the emitter's span | 13 | e2e (android, ios) | pending | diff --git a/verify/expected/degraded-probe.js.otlp.json b/verify/expected/degraded-probe.js.otlp.json new file mode 100644 index 0000000..70016f5 --- /dev/null +++ b/verify/expected/degraded-probe.js.otlp.json @@ -0,0 +1,53 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify", + "attributes": [ + { + "key": "com.callstack.context.degraded", + "value": { + "boolValue": true + } + } + ] + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000020000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000002", + "name": "after_await", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/jest/degraded.test.ts b/verify/jest/degraded.test.ts new file mode 100644 index 0000000..90cf2d7 --- /dev/null +++ b/verify/jest/degraded.test.ts @@ -0,0 +1,45 @@ +import {resourceFromAttributes} from '@opentelemetry/resources'; +import {SimpleSpanProcessor, TracerProvider} from '@opentelemetry/sdk-trace'; +import {OTLPTraceExporter} from '@opentelemetry/exporter-trace-otlp-proto'; +import {startCollector, type Collector} from '../harness/collector'; +import {compareToExpected} from '../harness/compare'; +import {at} from '../harness/scenario'; +import {probeAsyncContext} from '../../src/context/probe'; +import {stampScope} from '../../src/context/scope'; +import {sequentialIds} from '../../src/internal/testMode'; +import {allScenarios} from '../scenarios'; + +let collector: Collector; +beforeAll(async () => { + collector = await startCollector({port: 0}); + jest.spyOn(console, 'error').mockImplementation(() => {}); // the probe reports loudly + expect(await probeAsyncContext()).toBe(false); // this project keeps native async +}); +afterAll(() => collector.close()); + +for (const s of allScenarios().filter(s => s.runners.includes('jest-degraded'))) { + test(`${s.name} [js, degraded]`, async () => { + const provider = new TracerProvider({ + idGenerator: sequentialIds('0a'), + resource: resourceFromAttributes({'service.name': 'verify'}), + spanProcessors: [ + new SimpleSpanProcessor({exporter: new OTLPTraceExporter({url: collector.url + '/v1/traces'})}), + ], + }); + collector.begin(s.name, 'js'); + let actual; + try { + await s.run({ + tracer: stampScope(provider.getTracer('verify')), + getTracer: (n, v, o) => stampScope(provider.getTracer(n, v, o)), + at, + }); + await provider.forceFlush(); + } finally { + actual = await collector.end(); + await provider.shutdown(); + } + const r = compareToExpected(s.name, 'js', actual); + if (!r.ok) throw new Error('\n' + r.report); + }); +} diff --git a/verify/jest/jest.degraded.config.js b/verify/jest/jest.degraded.config.js new file mode 100644 index 0000000..4ff6087 --- /dev/null +++ b/verify/jest/jest.degraded.config.js @@ -0,0 +1,20 @@ +// Keeps native `async` (no @react-native/babel-preset), so `await` bypasses the patched `then` and the probe fails. +// Needs NODE_OPTIONS=--experimental-vm-modules: run via `bun run test`. +module.exports = { + displayName: 'degraded', + rootDir: '../..', + testEnvironment: 'node', + transform: { + '\\.[jt]sx?$': [ + 'babel-jest', + { + babelrc: false, + configFile: false, + presets: ['@babel/preset-typescript'], + plugins: ['@babel/plugin-transform-modules-commonjs'], + }, + ], + }, + setupFiles: ['/src/setup.ts'], + testMatch: ['/verify/jest/degraded.test.ts'], +}; diff --git a/verify/scenarios/degraded-probe.ts b/verify/scenarios/degraded-probe.ts index a564896..1e1a4e9 100644 --- a/verify/scenarios/degraded-probe.ts +++ b/verify/scenarios/degraded-probe.ts @@ -15,5 +15,5 @@ export default scenario( parent.end(at(20)); }); }, - {runners: ['jest-degraded'], pending: true}, // Task 11 + {runners: ['jest-degraded']}, ); diff --git a/verify/scenarios/rich-span.ts b/verify/scenarios/rich-span.ts index dee2afb..fab19f1 100644 --- a/verify/scenarios/rich-span.ts +++ b/verify/scenarios/rich-span.ts @@ -1,10 +1,10 @@ import {createTraceState, SpanKind, SpanStatusCode, TraceFlags} from '@opentelemetry/api'; import {scenario} from '../harness/scenario'; +import {stampScope} from '../../src/context/scope'; export default scenario('rich-span', async ({getTracer, at}) => { const tracer = getTracer('verify.rich', '1.2.3', {schemaUrl: 'https://opentelemetry.io/schemas/1.40.0'}); - // sdk-trace 3.1 has no API for scope attributes; its OTLP exporter reads them off the scope at runtime. - Object.assign((tracer as any).instrumentationScope, {attributes: {'scope.key': 'scope-value'}}); + stampScope(tracer, {'scope.key': 'scope-value'}); const span = tracer.startSpan('rich', { startTime: at(0), kind: SpanKind.CLIENT, diff --git a/verify/stages/fast-js.ts b/verify/stages/fast-js.ts index 34f1faa..64711b6 100644 --- a/verify/stages/fast-js.ts +++ b/verify/stages/fast-js.ts @@ -5,7 +5,7 @@ const stage: Stage = { order: 20, e2e: false, run({sh}) { - sh(['bun', 'run', 'test', '--selectProjects', 'unit', 'scenarios', '--verbose', '--reporters=default']); + sh(['bun', 'run', 'test', '--selectProjects', 'unit', 'scenarios', 'degraded', '--verbose', '--reporters=default']); }, }; From 55867f68ff5dec41dfac1661f3b506ee00499dda Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Mon, 23 Nov 2026 23:51:44 +0100 Subject: [PATCH 12/76] fix(context): merge scope stamps per tracer, log the degraded error once Co-Authored-By: Claude Opus 5.5 --- src/context/probe.ts | 3 +-- src/context/scope.ts | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/context/probe.ts b/src/context/probe.ts index 884add6..568b526 100644 --- a/src/context/probe.ts +++ b/src/context/probe.ts @@ -18,12 +18,11 @@ const defaultStep = async (): Promise => { export async function probeAsyncContext(step: () => Promise = defaultStep): Promise { const after = await context.with(context.active().setValue(KEY, true), step); const ok = after.getValue(KEY) === true; - if (!ok) { + if (!ok && markDegraded()) { console.error( `[react-native-open-telemetry] context did not survive \`await\`: native async/await was not downleveled, ` + `so spans after \`await\` will be roots (${DEGRADED_ATTR}=true). Use the Metro/Vite helper or transform async-to-generator.`, ); - markDegraded(); } return ok; } diff --git a/src/context/scope.ts b/src/context/scope.ts index ce861ee..b8d12f5 100644 --- a/src/context/scope.ts +++ b/src/context/scope.ts @@ -10,9 +10,11 @@ const stamped = new Map<{attributes?: Attributes}, Attributes>(); export const scopeAttributes = (): Attributes => (degraded ? {[DEGRADED_ATTR]: true} : {}); /** Called by the probe on failure; tracers stamped earlier get the flag too. */ -export function markDegraded(): void { +export function markDegraded(): boolean { + if (degraded) return false; degraded = true; for (const [scope, extra] of stamped) scope.attributes = {...extra, ...scopeAttributes()}; + return true; } /** @@ -21,7 +23,8 @@ export function markDegraded(): void { */ export function stampScope(tracer: T, extra: Attributes = {}): T { const scope = (tracer as unknown as {instrumentationScope: {attributes?: Attributes}}).instrumentationScope; - stamped.set(scope, extra); - scope.attributes = {...extra, ...scopeAttributes()}; + const merged = {...stamped.get(scope), ...extra}; + stamped.set(scope, merged); + scope.attributes = {...merged, ...scopeAttributes()}; return tracer; } From 8640375d95a9281d0f88eae850f2466fcabde381 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Mon, 23 Nov 2026 23:52:42 +0100 Subject: [PATCH 13/76] feat(metro): withOtel installs the context patch first Co-Authored-By: Claude Opus 5.5 --- metro/__tests__/withOtel.test.js | 24 ++++++++++++++++++++++++ metro/index.js | 18 ++++++++++++++++++ package.json | 5 ++++- src/index.ts | 2 ++ verify/static/bundleSize.test.ts | 6 +++--- verify/static/bundleSize.ts | 2 +- verify/static/packContents.test.ts | 2 +- verify/static/packContents.ts | 2 +- 8 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 metro/__tests__/withOtel.test.js create mode 100644 metro/index.js diff --git a/metro/__tests__/withOtel.test.js b/metro/__tests__/withOtel.test.js new file mode 100644 index 0000000..85d520f --- /dev/null +++ b/metro/__tests__/withOtel.test.js @@ -0,0 +1,24 @@ +const {withOtel} = require('..'); + +// Stubbed so the test does not depend on a built lib/ (self-reference via `exports`). +const SETUP = '/pkg/lib/module/setup.js'; +const run = config => withOtel(config, {setupPath: SETUP}).serializer.getModulesRunBeforeMainModule('/app/index.js'); +const CORE = '/rn/Libraries/Core/InitializeCore.js'; +const base = {serializer: {getModulesRunBeforeMainModule: () => [CORE]}, resolver: {x: 1}}; + +test('adds setup after InitializeCore', () => { + expect(run(base)).toEqual([CORE, SETUP]); +}); + +test("keeps a user's existing entries", () => { + const cfg = {...base, serializer: {getModulesRunBeforeMainModule: () => [CORE, '/app/polyfill.js'], other: 2}}; + const out = withOtel(cfg, {setupPath: SETUP}); + expect(run(cfg)).toEqual([CORE, '/app/polyfill.js', SETUP]); + expect(out.serializer.other).toBe(2); + expect(out.resolver).toEqual({x: 1}); +}); + +test('is idempotent when applied twice', () => { + const once = withOtel(base, {setupPath: SETUP}); + expect(run(withOtel(once, {setupPath: SETUP}))).toEqual([CORE, SETUP]); +}); diff --git a/metro/index.js b/metro/index.js new file mode 100644 index 0000000..986b55e --- /dev/null +++ b/metro/index.js @@ -0,0 +1,18 @@ +/** + * Metro helper: runs the SDK's setup (context patch) before the app. + * Appending to `getModulesRunBeforeMainModule` puts it after RN's InitializeCore and before any app module. + * Metro only runs such an entry if it is already in the bundle graph; `src/index.ts` imports `./setup` for that. + */ +function withOtel(config, {setupPath = require.resolve('react-native-open-telemetry/setup')} = {}) { + const serializer = config.serializer ?? {}; + const original = serializer.getModulesRunBeforeMainModule ?? (() => []); + if (original.__withOtel) return config; + const wrapped = entry => { + const list = original(entry); + return list.includes(setupPath) ? list : [...list, setupPath]; + }; + wrapped.__withOtel = true; + return {...config, serializer: {...serializer, getModulesRunBeforeMainModule: wrapped}}; +} + +module.exports = {withOtel}; diff --git a/package.json b/package.json index 8dd37d0..2ae0fbf 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,10 @@ }, "./metro": "./metro/index.js", "./vite": "./vite/index.ts", - "./setup": "./lib/module/setup.js", + "./setup": { + "types": "./lib/typescript/src/setup.d.ts", + "default": "./lib/module/setup.js" + }, "./package.json": "./package.json" }, "files": [ diff --git a/src/index.ts b/src/index.ts index cb0ff5c..6eac1b1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1 +1,3 @@ +// Side effect: keeps ./setup in the bundle graph so Metro's runBeforeMainModule entry can run it. +import './setup'; export {}; diff --git a/verify/static/bundleSize.test.ts b/verify/static/bundleSize.test.ts index d2b4f52..44e21c5 100644 --- a/verify/static/bundleSize.test.ts +++ b/verify/static/bundleSize.test.ts @@ -7,10 +7,10 @@ test('attributes each section the bytes up to the next one', () => { expect(Object.fromEntries(m)).toEqual({'a.js': 7, 'b.js': 3}); }); -test('counts src/ and @opentelemetry/* only', () => { +test('counts src/, lib/ and @opentelemetry/* only', () => { const sdk = isSdk('/r'); - expect(['/r/src/index.ts', '/r/node_modules/@opentelemetry/api/x.js', '/r/example/App.tsx', '/r/node_modules/react/x.js'].map(sdk)) - .toEqual([true, true, false, false]); + expect(['/r/src/index.ts', '/r/lib/module/setup.js', '/r/node_modules/@opentelemetry/api/x.js', '/r/example/App.tsx', '/r/node_modules/react/x.js'].map(sdk)) + .toEqual([true, true, true, false, false]); }); test('fails only above +10%', () => { diff --git a/verify/static/bundleSize.ts b/verify/static/bundleSize.ts index 45ef57c..ff38057 100644 --- a/verify/static/bundleSize.ts +++ b/verify/static/bundleSize.ts @@ -22,7 +22,7 @@ export function bytesPerSource(map: {sections: Section[]}, code: string): Map (source: string) => { const rel = path.relative(repoRoot, path.resolve(repoRoot, source)); - return rel.startsWith('src' + path.sep) || /(^|[/\\])node_modules[/\\]@opentelemetry[/\\]/.test(rel); + return rel.startsWith('src' + path.sep) || rel.startsWith('lib' + path.sep) || /(^|[/\\])node_modules[/\\]@opentelemetry[/\\]/.test(rel); }; /** Release-bundles the example app and returns the SDK's bytes in it. */ diff --git a/verify/static/packContents.test.ts b/verify/static/packContents.test.ts index 344eb80..fa16d35 100644 --- a/verify/static/packContents.test.ts +++ b/verify/static/packContents.test.ts @@ -1,6 +1,6 @@ import {packContents} from './packContents'; -const complete = ['package.json', 'lib/module/index.js', 'src/index.ts', 'nitrogen/generated/x.hpp']; +const complete = ['package.json', 'lib/module/index.js', 'src/index.ts', 'nitrogen/generated/x.hpp', 'metro/index.js']; test('reports missing nitrogen/', () => { expect(packContents(complete.filter(p => !p.startsWith('nitrogen/')))).toEqual(['nitrogen/']); diff --git a/verify/static/packContents.ts b/verify/static/packContents.ts index a887ca1..7c9643b 100644 --- a/verify/static/packContents.ts +++ b/verify/static/packContents.ts @@ -1,4 +1,4 @@ -export const REQUIRED = ['package.json', 'lib/', 'src/', 'nitrogen/']; +export const REQUIRED = ['package.json', 'lib/', 'src/', 'nitrogen/', 'metro/']; /** Returns the required paths missing from the `npm pack --dry-run --json` file list. */ export function packContents(list: string[], required: string[] = REQUIRED): string[] { From 81c32b5892a329dab2d46356b49b5a8471225056 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Mon, 23 Nov 2026 23:52:54 +0100 Subject: [PATCH 14/76] chore(index): drop redundant empty export Co-Authored-By: Claude Opus 5.5 --- src/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 6eac1b1..5b4e278 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,2 @@ // Side effect: keeps ./setup in the bundle graph so Metro's runBeforeMainModule entry can run it. import './setup'; -export {}; From 69e4c04bca1c03c8d838297e7d956e37be861876 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Mon, 23 Nov 2026 23:57:25 +0100 Subject: [PATCH 15/76] feat(sdk): startReactNativeSdk attach and fallback init Co-Authored-By: Claude Opus 5.5 --- .../specs/2026-11-10-rn-otel-design.md | 13 +- src/handoff/toSeamSpan.ts | 2 +- src/index.ts | 3 + src/native/otel.ts | 8 +- src/sdk/__tests__/start.test.ts | 169 ++++++++++++++++++ src/sdk/config.ts | 23 +++ src/sdk/noop.ts | 9 + src/sdk/start.ts | 86 +++++++++ src/setup.ts | 5 +- 9 files changed, 303 insertions(+), 15 deletions(-) create mode 100644 src/sdk/__tests__/start.test.ts create mode 100644 src/sdk/config.ts create mode 100644 src/sdk/noop.ts create mode 100644 src/sdk/start.ts diff --git a/docs/superpowers/specs/2026-11-10-rn-otel-design.md b/docs/superpowers/specs/2026-11-10-rn-otel-design.md index 6cb3ed8..80f90ac 100644 --- a/docs/superpowers/specs/2026-11-10-rn-otel-design.md +++ b/docs/superpowers/specs/2026-11-10-rn-otel-design.md @@ -305,12 +305,11 @@ OTel data model. itself with the semantic-convention distro attributes `telemetry.distro.name` / `telemetry.distro.version` (`telemetry.sdk.*` stays otel-java / opentelemetry-swift's). Carry `schemaUrl` for resource and scope. -- **Clock (Claude's call, simplified in council review):** both sides use wall-clock epoch - time. JS computes one offset, `Date.now() - performance.now()`, at start and again on - `AppState` → active (Hermes' monotonic clock doesn't advance during device suspend), and - uses it as the JS SDK's time source. Error between JS and native siblings is under 1 ms; - scenarios use explicit timestamps, so test output is unaffected. Guard missing - `performance` (fall back to `Date.now()`). +- **Clock (Claude's call, simplified in council review and again in v0 implementation):** both + sides use wall-clock epoch time. JS keeps upstream `sdk-trace` timing: each span starts at + `Date.now()` and measures its duration with `performance.now()`; there is no extra JS offset + (sdk-trace 3.1 has no time-source hook). Error between JS and native siblings is under 1 ms; + scenarios use explicit timestamps, so test output is unaffected. - **Before native is ready / failures (Claude's call):** no pre-init buffer. `initialize` runs synchronously inside `startReactNativeSdk` before the JS provider is registered, so no span can end before native is ready; spans started earlier come from the API's no-op @@ -872,7 +871,7 @@ Left out until needed: 8. Default sampling `ParentBased(AlwaysOn)` on both sides, honoring `traceFlags` (4.3). 9. One native-owned resource; JS adds no `telemetry.sdk.*`; SDK identity via `telemetry.distro.*` (4.3). -10. Clock: one `Date.now() - performance.now()` offset, recomputed on foreground (4.3). +10. Clock: upstream sdk-trace timing (start at `Date.now()`, `performance.now()` durations) (4.3). 11. No pre-init buffer; init failure → one error and a no-op handle, never a throw; multi-runtime handling (4.3, 4.4). 12. Context manager extends upstream `StackContextManager`; Metro `withOtel` helper for diff --git a/src/handoff/toSeamSpan.ts b/src/handoff/toSeamSpan.ts index 8bed12b..ef19da2 100644 --- a/src/handoff/toSeamSpan.ts +++ b/src/handoff/toSeamSpan.ts @@ -9,7 +9,7 @@ const seamValue = (v: unknown): v is AttrValue => (Array.isArray(v) && v.every(x => PRIMS.includes(typeof x) && typeof x === typeof v[0])); // Insertion order; anything the seam cannot carry (null, undefined, objects, bytes, mixed arrays) is dropped. -const attrs = (a: Attributes | undefined): SeamAttribute[] => { +export const attrs = (a: Attributes | undefined): SeamAttribute[] => { const out: SeamAttribute[] = []; for (const key in a) { const value: unknown = a[key]; diff --git a/src/index.ts b/src/index.ts index 5b4e278..02b1579 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,2 +1,5 @@ // Side effect: keeps ./setup in the bundle graph so Metro's runBeforeMainModule entry can run it. import './setup'; + +export {startReactNativeSdk} from './sdk/start'; +export type {SdkConfig, SdkHandle} from './sdk/config'; diff --git a/src/native/otel.ts b/src/native/otel.ts index af866f6..154873a 100644 --- a/src/native/otel.ts +++ b/src/native/otel.ts @@ -1,11 +1,7 @@ import {NitroModules} from 'react-native-nitro-modules'; import type {Otel} from './Otel.nitro'; -/** undefined when the HybridObject isn't registered (web, Jest, Expo Go). */ +/** undefined when the HybridObject isn't registered (web, Jest, Expo Go); a constructor failure throws. */ export function getOtel(): Otel | undefined { - try { - return NitroModules.hasHybridObject('Otel') ? NitroModules.createHybridObject('Otel') : undefined; - } catch { - return undefined; - } + return NitroModules.hasHybridObject('Otel') ? NitroModules.createHybridObject('Otel') : undefined; } diff --git a/src/sdk/__tests__/start.test.ts b/src/sdk/__tests__/start.test.ts new file mode 100644 index 0000000..e87c815 --- /dev/null +++ b/src/sdk/__tests__/start.test.ts @@ -0,0 +1,169 @@ +import {trace, type ProxyTracerProvider} from '@opentelemetry/api'; +import {hrTimeToMilliseconds} from '@opentelemetry/core'; +import {InMemorySpanExporter, SimpleSpanProcessor} from '@opentelemetry/sdk-trace'; +import type {Otel, SeamConfig, SeamSpan} from '../../native/Otel.nitro'; +import {MARKER} from '../../context/patch'; +import {DEGRADED_ATTR, markDegraded} from '../../context/scope'; +import {getOtel} from '../../native/otel'; +import {tracesUrl} from '../config'; +import {startReactNativeSdk} from '../start'; + +jest.mock('../../native/otel', () => ({getOtel: jest.fn()})); + +const CONFIG = {serviceName: 'shop', exportConfig: {url: 'https://collector.example.com:4318'}}; + +function fakeOtel({initialized = false, testMode = false, error}: {initialized?: boolean; testMode?: boolean; error?: string} = {}) { + const calls: (SeamConfig | undefined)[] = []; + const spans: SeamSpan[] = []; + const otel = { + initialize(cfg?: SeamConfig) { + calls.push(cfg); + if (error) return {alreadyInitialized: false, testMode, error}; + if (initialized) return {alreadyInitialized: true, testMode}; + if (!cfg) return {alreadyInitialized: false, testMode, error: 'no config'}; + initialized = true; + return {alreadyInitialized: false, testMode}; + }, + handOff: (s: SeamSpan[]) => spans.push(...s), + flush: async () => {}, + } as unknown as Otel; + jest.mocked(getOtel).mockReturnValue(otel); + return {calls, spans}; +} + +let err: jest.SpyInstance; +let warn: jest.SpyInstance; +beforeEach(() => { + const marker = (globalThis as any)[MARKER]; + delete marker.handle; + delete marker.warned; + trace.disable(); + jest.mocked(getOtel).mockReset(); + err = jest.spyOn(console, 'error').mockImplementation(() => {}); + warn = jest.spyOn(console, 'warn').mockImplementation(() => {}); +}); +afterEach(() => jest.restoreAllMocks()); + +const isNoop = (h: ReturnType) => + !h.tracerProvider.getTracer('t').startSpan('s').isRecording(); + +test('attaches when native is initialized', () => { + const {calls, spans} = fakeOtel({initialized: true}); + const h = startReactNativeSdk(CONFIG); + expect(calls).toHaveLength(1); + expect(warn).toHaveBeenCalledTimes(1); // exportConfig ignored + h.tracerProvider.getTracer('t').startSpan('s').end(); + expect(spans.map(s => s.name)).toEqual(['s']); + expect(err).not.toHaveBeenCalled(); +}); + +test('initializes native when it is not', () => { + const {calls, spans} = fakeOtel(); + const h = startReactNativeSdk({ + serviceName: 'shop', + serviceVersion: '1.2.3', + resourceAttributes: {'deployment.environment.name': 'prod', n: 3, dropped: [1, 'x'] as any}, + exportConfig: {url: 'https://collector.example.com:4318', headers: {'x-api-key': 'k'}}, + }); + expect(calls).toEqual([ + { + serviceName: 'shop', + serviceVersion: '1.2.3', + resourceAttributes: [ + {key: 'deployment.environment.name', value: 'prod'}, + {key: 'n', value: 3}, + ], + exportUrl: 'https://collector.example.com:4318', + exportHeaders: [{key: 'x-api-key', value: 'k'}], + }, + ]); + expect(warn).not.toHaveBeenCalled(); + h.tracerProvider.getTracer('t').startSpan('s').end(); + expect(spans).toHaveLength(1); +}); + +test('no native module returns a no-op handle and logs once', async () => { + jest.mocked(getOtel).mockReturnValue(undefined); + const h = startReactNativeSdk(CONFIG); + expect(err).toHaveBeenCalledTimes(1); + expect(isNoop(h)).toBe(true); + await h.forceFlush(); + await h.shutdown(); + expect(startReactNativeSdk(CONFIG)).toBe(h); + expect(err).toHaveBeenCalledTimes(1); +}); + +test('init error returns a no-op handle and logs once', () => { + fakeOtel({error: 'invalid exportUrl'}); + const h = startReactNativeSdk(CONFIG); + expect(err).toHaveBeenCalledTimes(1); + expect(String(err.mock.calls[0])).toMatch(/invalid exportUrl/); + expect(isNoop(h)).toBe(true); +}); + +test('never throws on missing config', () => { + fakeOtel(); + expect(isNoop(startReactNativeSdk())).toBe(true); + expect(err).toHaveBeenCalledTimes(1); + + delete (globalThis as any)[MARKER].handle; + jest.mocked(getOtel).mockImplementation(() => { + throw new Error('HybridObject constructor failed'); + }); + expect(isNoop(startReactNativeSdk(CONFIG))).toBe(true); + expect(err).toHaveBeenCalledTimes(2); +}); + +test('second call returns the first handle with one warning', () => { + fakeOtel({initialized: true}); + const h = startReactNativeSdk(); + expect(startReactNativeSdk()).toBe(h); + expect(startReactNativeSdk()).toBe(h); + expect(warn).toHaveBeenCalledTimes(1); + // a fast-refresh re-evaluation of the SDK module still returns it + jest.isolateModules(() => expect(require('../start').startReactNativeSdk()).toBe(h)); +}); + +test('user span processors still see spans', () => { + const {spans} = fakeOtel({initialized: true}); + const exporter = new InMemorySpanExporter(); + const h = startReactNativeSdk({spanProcessors: [new SimpleSpanProcessor({exporter})]}); + h.tracerProvider.getTracer('t').startSpan('s').end(); + expect(exporter.getFinishedSpans().map(s => s.name)).toEqual(['s']); + expect(spans).toHaveLength(1); +}); + +test('test-mode native gives 0a ids', () => { + fakeOtel({initialized: true, testMode: true}); + const span = startReactNativeSdk().tracerProvider.getTracer('t').startSpan('s'); + expect(span.spanContext().traceId).toBe('0a' + '1'.padStart(30, '0')); + expect(span.spanContext().spanId).toBe('0a' + '1'.padStart(14, '0')); +}); + +test('a span without startTime starts at Date.now()', () => { + fakeOtel({initialized: true}); + const tracer = startReactNativeSdk().tracerProvider.getTracer('t'); + const before = Date.now(); + const span = tracer.startSpan('s') as unknown as {startTime: [number, number]}; + const after = Date.now(); + const ms = hrTimeToMilliseconds(span.startTime); + expect(ms).toBeGreaterThanOrEqual(before - 1); + expect(ms).toBeLessThanOrEqual(after + 1); +}); + +test('global provider is the returned provider, its tracers carry the degraded flag', () => { + fakeOtel({initialized: true}); + const h = startReactNativeSdk(); + expect((trace.getTracerProvider() as ProxyTracerProvider).getDelegate()).toBe(h.tracerProvider); + const scope = (h.tracerProvider.getTracer('t') as any).instrumentationScope; + expect(scope.attributes ?? {}).toEqual({}); + markDegraded(); + expect(scope.attributes).toEqual({[DEGRADED_ATTR]: true}); + expect((trace.getTracer('later') as any).instrumentationScope.attributes).toEqual({[DEGRADED_ATTR]: true}); +}); + +test('tracesUrl appends /v1/traces unless present', () => { + expect(tracesUrl('https://c:4318')).toBe('https://c:4318/v1/traces'); + expect(tracesUrl('https://c:4318/')).toBe('https://c:4318/v1/traces'); + expect(tracesUrl('https://c/v1/traces')).toBe('https://c/v1/traces'); +}); diff --git a/src/sdk/config.ts b/src/sdk/config.ts new file mode 100644 index 0000000..a398d3c --- /dev/null +++ b/src/sdk/config.ts @@ -0,0 +1,23 @@ +import type {Attributes, TracerProvider} from '@opentelemetry/api'; +import type {SpanProcessor} from '@opentelemetry/sdk-trace'; + +export interface SdkConfig { + serviceName?: string; + serviceVersion?: string; + resourceAttributes?: Attributes; + /** `url` is the OTLP base URL; `/v1/traces` is appended unless present (§4.4). */ + exportConfig?: {url: string; headers?: Record}; + spanProcessors?: SpanProcessor[]; +} + +export interface SdkHandle { + tracerProvider: TracerProvider; + forceFlush(): Promise; + shutdown(): Promise; +} + +/** One endpoint meaning on every platform (§4.4). Mobile passes the base URL; native applies the same rule. */ +export function tracesUrl(url: string): string { + const base = url.replace(/\/+$/, ''); + return base.endsWith('/v1/traces') ? base : base + '/v1/traces'; +} diff --git a/src/sdk/noop.ts b/src/sdk/noop.ts new file mode 100644 index 0000000..55f2661 --- /dev/null +++ b/src/sdk/noop.ts @@ -0,0 +1,9 @@ +import {ProxyTracerProvider} from '@opentelemetry/api'; +import type {SdkHandle} from './config'; + +/** A delegate-less proxy hands out no-op tracers. */ +export const noopHandle = (): SdkHandle => ({ + tracerProvider: new ProxyTracerProvider(), + forceFlush: async () => {}, + shutdown: async () => {}, +}); diff --git a/src/sdk/start.ts b/src/sdk/start.ts new file mode 100644 index 0000000..9a202ff --- /dev/null +++ b/src/sdk/start.ts @@ -0,0 +1,86 @@ +import {trace} from '@opentelemetry/api'; +import {emptyResource} from '@opentelemetry/resources'; +import {TracerProvider} from '@opentelemetry/sdk-trace'; +import '../setup'; +import {MARKER, type PatchMarker} from '../context/patch'; +import {probeAsyncContext} from '../context/probe'; +import {stampScope} from '../context/scope'; +import {NativeHandOffProcessor} from '../handoff/NativeHandOffProcessor'; +import {attrs} from '../handoff/toSeamSpan'; +import {sequentialIds} from '../internal/testMode'; +import type {SeamConfig} from '../native/Otel.nitro'; +import {getOtel} from '../native/otel'; +import type {SdkConfig, SdkHandle} from './config'; +import {noopHandle} from './noop'; + +const TAG = '[react-native-open-telemetry]'; + +/** Undefined unless there is enough to initialize native; native then reports the missing config. */ +function toSeamConfig(c: SdkConfig): SeamConfig | undefined { + if (!c.serviceName || !c.exportConfig?.url) return undefined; + return { + serviceName: c.serviceName, + ...(c.serviceVersion ? {serviceVersion: c.serviceVersion} : {}), + resourceAttributes: attrs(c.resourceAttributes), + exportUrl: c.exportConfig.url, + exportHeaders: attrs(c.exportConfig.headers), + }; +} + +function start(config: SdkConfig | undefined): SdkHandle { + let native; + try { + native = getOtel(); + } catch (e) { + console.error(`${TAG} the native Otel module failed to load; telemetry is off.`, e); + return noopHandle(); + } + if (!native) { + console.error(`${TAG} native module not found (Expo Go or a build without it); telemetry is off.`); + return noopHandle(); + } + const result = native.initialize(config && toSeamConfig(config)); + if (result.error) { + console.error(`${TAG} native init failed; telemetry is off: ${result.error}`); + return noopHandle(); + } + if (result.alreadyInitialized && config?.exportConfig) { + console.warn(`${TAG} native was initialized first; the JS exportConfig is ignored.`); + } + + // Resource is empty: native owns it. Sampler: upstream default ParentBased(AlwaysOn). Timing: upstream (§4.3 Clock). + const provider = new TracerProvider({ + resource: emptyResource(), + ...(result.testMode ? {idGenerator: sequentialIds('0a')} : {}), + spanProcessors: [...(config?.spanProcessors ?? []), new NativeHandOffProcessor(native)], + }); + const getTracer = provider.getTracer.bind(provider); + provider.getTracer = (name, version, options) => stampScope(getTracer(name, version, options)); + trace.setGlobalTracerProvider(provider); + probeAsyncContext().catch(() => {}); + return { + tracerProvider: provider, + forceFlush: () => provider.forceFlush(), + shutdown: () => provider.shutdown(), + }; +} + +// On the marker (globalThis), so a fast-refresh re-evaluation of this module still finds the first handle. +type Marker = PatchMarker & {handle?: SdkHandle; warned?: boolean}; + +/** Attaches to native, or initializes it from `config` (§4.4). Never throws: failures give one error and a no-op handle. */ +export function startReactNativeSdk(config?: SdkConfig): SdkHandle { + const m: Marker = (globalThis as any)[MARKER]; + if (m.handle) { + if (!m.warned) console.warn(`${TAG} startReactNativeSdk was already called; returning the first handle.`); + m.warned = true; + return m.handle; + } + try { + m.handle = start(config); + } catch (e) { + console.error(`${TAG} start failed; telemetry is off.`, e); + m.handle = noopHandle(); + } + return m.handle; +} diff --git a/src/setup.ts b/src/setup.ts index 033248b..0d2adc9 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -7,4 +7,7 @@ import {MARKER, installContextPatch, type PatchMarker} from './context/patch'; const existing: PatchMarker | undefined = (globalThis as any)[MARKER]; export const contextManager: RNContextManager = existing?.contextManager ?? new RNContextManager().enable(); installContextPatch(contextManager); -context.setGlobalContextManager(contextManager); +// On a re-evaluation our own manager is already registered; only a foreign one is an error. +if (!context.setGlobalContextManager(contextManager) && !existing) { + console.error('[react-native-open-telemetry] another context manager is already registered; spans may not nest.'); +} From 3362ab2cf9745391039252592e2779595e3d2503 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:00:18 +0100 Subject: [PATCH 16/76] fix(sdk): report a foreign global tracer provider; drop stale clock-anchor wording Co-Authored-By: Claude Opus 5.5 --- docs/superpowers/specs/2026-11-10-rn-otel-design.md | 4 ++-- src/sdk/start.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/superpowers/specs/2026-11-10-rn-otel-design.md b/docs/superpowers/specs/2026-11-10-rn-otel-design.md index 80f90ac..8d6a3b9 100644 --- a/docs/superpowers/specs/2026-11-10-rn-otel-design.md +++ b/docs/superpowers/specs/2026-11-10-rn-otel-design.md @@ -317,7 +317,7 @@ OTel data model. loudly (`console.error`), and `startReactNativeSdk` returns a working no-op handle. The SDK never throws into the app. - **Multiple runtimes (Claude's call):** one native singleton; `initialize` is safe under - concurrent calls; each JS runtime has its own hand-off and clock anchor. Per-runtime + concurrent calls; each JS runtime has its own hand-off. Per-runtime attributes are out of scope for v0. ### 4.4 Configuration (decided: "option A", with JS fallback) @@ -906,7 +906,7 @@ direct precedent was found; treat those as the highest-risk parts. | P11 | Links instead of parents for batched/multi-cause work; interval ticks as new roots (5, 6.2) | OTel spec: links represent batched operations; React notes it can't attribute batched updates without AsyncContext | [Spec: Links between spans](https://github.com/open-telemetry/opentelemetry-specification/blob/a03fa4e26b3982da42aa0010aaebcd9f694cb037/specification/overview.md#L207-L214) · [React `ReactFiberAsyncAction.js`](https://github.com/facebook/react/blob/fe719f77ba3e4b5fb3ebe13787bfbd0ed911da19/packages/react-reconciler/src/ReactFiberAsyncAction.js#L42) | | P12 | *(removed: the staleness rule was cut in council review, see 6.2)* | | | | P13 | *(removed: the pre-init buffer was cut in council review, see 4.3)* | | | -| P14 | Clock offset `Date.now() - performance.now()`, recomputed on foreground (4.3) | OTel JS derives span times from `performance.timeOrigin` + `performance.now()`; Sentry RN guards an unreliable `performance.timeOrigin` | [Sentry `timeOrigin` guard](https://github.com/getsentry/sentry-react-native/blob/794a52a9e80ca0a7c4ee005264cd9cd3ee1533de/packages/core/src/js/sdk.tsx#L76-L80) | +| P14 | *(Superseded by R8: upstream timing kept, no offset.)* Clock offset `Date.now() - performance.now()`, recomputed on foreground (4.3) | OTel JS derives span times from `performance.timeOrigin` + `performance.now()`; Sentry RN guards an unreliable `performance.timeOrigin` | [Sentry `timeOrigin` guard](https://github.com/getsentry/sentry-react-native/blob/794a52a9e80ca0a7c4ee005264cd9cd3ee1533de/packages/core/src/js/sdk.tsx#L76-L80) | | P15 | Custom names under a reverse-domain prefix, never `otel.*` (4.5) | OTel naming guidance | [naming.md: app developers](https://github.com/open-telemetry/semantic-conventions/blob/2d91ead21027a8a58fbb7488b12d80238e7c0ac5/docs/general/naming.md#L183-L187) · [`otel.*` reserved](https://github.com/open-telemetry/semantic-conventions/blob/2d91ead21027a8a58fbb7488b12d80238e7c0ac5/docs/general/naming.md#L217-L227) | | P16 | Option names mirror `startBrowserSdk`; invalid config returns a no-op SDK instead of throwing (4.4) | OTel Browser SIG browser SDK | [browser-sdk README](https://github.com/open-telemetry/opentelemetry-browser/tree/main/packages/sdk) | | P17 | Exact expected-output files (goldens) for traces (9.1) | OTel Collector tests compare traces against golden files | [collector-contrib `pkg/golden`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/c64840337cf400792cb684037ed998428b268197/pkg/golden) · [`ptracetest` compare options](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/c64840337cf400792cb684037ed998428b268197/pkg/pdatatest/ptracetest/options.go#L102-L149) | diff --git a/src/sdk/start.ts b/src/sdk/start.ts index 9a202ff..56ff052 100644 --- a/src/sdk/start.ts +++ b/src/sdk/start.ts @@ -56,7 +56,9 @@ function start(config: SdkConfig | undefined): SdkHandle { }); const getTracer = provider.getTracer.bind(provider); provider.getTracer = (name, version, options) => stampScope(getTracer(name, version, options)); - trace.setGlobalTracerProvider(provider); + if (!trace.setGlobalTracerProvider(provider)) { + console.error('[react-native-open-telemetry] another tracer provider is already registered; trace.getTracer() will not reach this SDK.'); + } probeAsyncContext().catch(() => {}); return { tracerProvider: provider, From 2f17e49641b567eadc727cb4c19c3ebbe9e4b8ff Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:08:09 +0100 Subject: [PATCH 17/76] feat(android-core): seam spans exported through otel-java Co-Authored-By: Claude Opus 5.5 --- android/core-jvm/build.gradle.kts | 25 ++ .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 48966 bytes .../gradle/wrapper/gradle-wrapper.properties | 7 + android/core-jvm/gradlew | 248 ++++++++++++++++++ android/core-jvm/settings.gradle.kts | 6 + .../src/test/kotlin/AttributesTest.kt | 32 +++ .../src/test/kotlin/FixtureExportTest.kt | 37 +++ .../core-jvm/src/test/kotlin/FixtureJson.kt | 80 ++++++ .../com/callstack/otel/core/Attributes.kt | 25 ++ .../com/callstack/otel/core/JsSpanData.kt | 81 ++++++ .../com/callstack/otel/core/OtelCore.kt | 56 ++++ .../com/callstack/otel/core/SeamModel.kt | 44 ++++ package.json | 1 + verify/VERIFY.md | 4 + .../async-generator.android.otlp.json | 79 ++++++ .../batching-shared-queue.android.otlp.json | 67 +++++ .../expected/captured-then.android.otlp.json | 56 ++++ .../concurrent-interleaved.android.otlp.json | 99 +++++++ .../error-in-callback.android.otlp.json | 67 +++++ .../expected/handoff-basic.android.otlp.json | 43 +++ .../interval-new-root.android.otlp.json | 66 +++++ .../nest-after-await.android.otlp.json | 46 ++++ .../nest-promise-all-race.android.otlp.json | 90 +++++++ .../nest-timers-microtasks.android.otlp.json | 90 +++++++ .../never-settling-promise.android.otlp.json | 66 +++++ .../expected/odd-attributes.android.otlp.json | 67 +++++ verify/expected/rich-span.android.otlp.json | 191 ++++++++++++++ .../expected/root-no-leak.android.otlp.json | 76 ++++++ verify/expected/smoke-js.android.otlp.json | 35 +++ verify/fixtures/async-generator.handoff.json | 1 - .../batching-shared-queue.handoff.json | 1 - verify/fixtures/captured-then.handoff.json | 1 - .../concurrent-interleaved.handoff.json | 1 - .../fixtures/error-in-callback.handoff.json | 1 - verify/fixtures/handoff-basic.handoff.json | 1 - .../fixtures/interval-new-root.handoff.json | 1 - verify/fixtures/nest-after-await.handoff.json | 1 - .../nest-promise-all-race.handoff.json | 1 - .../nest-timers-microtasks.handoff.json | 1 - .../never-settling-promise.handoff.json | 1 - verify/fixtures/odd-attributes.handoff.json | 1 - verify/fixtures/rich-span.handoff.json | 1 - verify/fixtures/root-no-leak.handoff.json | 1 - verify/fixtures/smoke-js.handoff.json | 1 - verify/jest/fixtures.test.ts | 1 - verify/stages/fast-jvm.ts | 49 ++++ verify/static/packContents.test.ts | 2 +- verify/static/packContents.ts | 3 +- 48 files changed, 1836 insertions(+), 18 deletions(-) create mode 100644 android/core-jvm/build.gradle.kts create mode 100644 android/core-jvm/gradle/wrapper/gradle-wrapper.jar create mode 100644 android/core-jvm/gradle/wrapper/gradle-wrapper.properties create mode 100755 android/core-jvm/gradlew create mode 100644 android/core-jvm/settings.gradle.kts create mode 100644 android/core-jvm/src/test/kotlin/AttributesTest.kt create mode 100644 android/core-jvm/src/test/kotlin/FixtureExportTest.kt create mode 100644 android/core-jvm/src/test/kotlin/FixtureJson.kt create mode 100644 android/src/core/kotlin/com/callstack/otel/core/Attributes.kt create mode 100644 android/src/core/kotlin/com/callstack/otel/core/JsSpanData.kt create mode 100644 android/src/core/kotlin/com/callstack/otel/core/OtelCore.kt create mode 100644 android/src/core/kotlin/com/callstack/otel/core/SeamModel.kt create mode 100644 verify/expected/async-generator.android.otlp.json create mode 100644 verify/expected/batching-shared-queue.android.otlp.json create mode 100644 verify/expected/captured-then.android.otlp.json create mode 100644 verify/expected/concurrent-interleaved.android.otlp.json create mode 100644 verify/expected/error-in-callback.android.otlp.json create mode 100644 verify/expected/handoff-basic.android.otlp.json create mode 100644 verify/expected/interval-new-root.android.otlp.json create mode 100644 verify/expected/nest-after-await.android.otlp.json create mode 100644 verify/expected/nest-promise-all-race.android.otlp.json create mode 100644 verify/expected/nest-timers-microtasks.android.otlp.json create mode 100644 verify/expected/never-settling-promise.android.otlp.json create mode 100644 verify/expected/odd-attributes.android.otlp.json create mode 100644 verify/expected/rich-span.android.otlp.json create mode 100644 verify/expected/root-no-leak.android.otlp.json create mode 100644 verify/expected/smoke-js.android.otlp.json create mode 100644 verify/stages/fast-jvm.ts diff --git a/android/core-jvm/build.gradle.kts b/android/core-jvm/build.gradle.kts new file mode 100644 index 0000000..97f267c --- /dev/null +++ b/android/core-jvm/build.gradle.kts @@ -0,0 +1,25 @@ +plugins { + kotlin("jvm") version "2.1.21" +} + +kotlin { jvmToolchain(17) } + +sourceSets.main { kotlin.srcDir("../src/core/kotlin") } + +dependencies { + implementation(platform("io.opentelemetry:opentelemetry-bom:1.68.0")) + implementation("io.opentelemetry:opentelemetry-sdk") + // No OkHttp exclusion here: the JVM tests run otel-java's own OkHttp 5; devices run React Native's 4.9.2. + implementation("io.opentelemetry:opentelemetry-exporter-otlp") + testImplementation(kotlin("test")) + testImplementation("com.google.code.gson:gson:2.11.0") +} + +tasks.test { + useJUnitPlatform() + // fast-jvm passes the live collector URL; the export test fails without it. + environment("VERIFY_COLLECTOR", System.getenv("VERIFY_COLLECTOR") ?: "") + environment("VERIFY_FIXTURES", file("../../verify/fixtures").absolutePath) + outputs.upToDateWhen { false } + testLogging { events("passed", "failed", "skipped"); exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL } +} diff --git a/android/core-jvm/gradle/wrapper/gradle-wrapper.jar b/android/core-jvm/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..d997cfc60f4cff0e7451d19d49a82fa986695d07 GIT binary patch literal 48966 zcma&NW0WmQwk%w>ZQHhO+qUi6W!pA(xoVef+k2O7+pkXd9rt^$@9p#T8Y9=Q^(R-x zjL3*NQ$ZRS1O)&B0s;U4fbe_$e;)(@NB~(;6+v1_IWc+}NnuerWl>cXPyoQcezKvZ z?Yzc@<~LK@Yhh-7jwvSDadFw~t7KfJ%AUfU*p0wc+3m9#p=Zo4`H`aA_wBL6 z9Q`7!;Ok~8YhZ^Vt#N97bt5aZ#mQc8r~hs3;R?H6V4(!oxSADTK|DR2PL6SQ3v6jM<>eLMh9 zAsd(APyxHNFK|G4hA_zi+YV?J+3K_*DIrdla>calRjaE)4(?YnX+AMqEM!Y|ED{^2 zI5gZ%nG-1qAVtl==8o0&F1N+aPj`Oo99RfDNP#ZHw}}UKV)zw6yy%~8Se#sKr;3?g zJGOkV2luy~HgMlEJB+L<_$@9sUXM7@bI)>-K!}JQUCUwuMdq@68q*dV+{L#Vc?r<( z?Wf1HbqxnI6=(Aw!Vv*Z1H_SoPtQTiy^bDVD8L=rRZ`IoIh@}a`!hY>VN&316I#k} z1Sg~_3ApcIFaoZ+d}>rz0Z8DL*zGq%zU1vF1z1D^YDnQrG3^QourmO6;_SrGg3?qWd9R1GMnKV>0++L*NTt>aF2*kcZ;WaudfBhTaqikS(+iNzDggUqvhh?g ziJCF8kA+V@7zi30n=b(3>X0X^lcCCKT(CI)fz-wfOA1P()V)1OciPu4b_B5ORPq&l zchP6l3u9{2on%uTwo>b-v0sIrRwPOzG;Wcq8mstd&?Pgb9rRqF#Yol1d|Q6 z7O20!+zXL(B%tC}@3QOs&T8B=I*k{!Y74nv#{M<0_g4BCf1)-f)6~`;(P-= zPqqH2%j0LDX2k5|_)zavpD{L1BW?<+s$>F&1VNb3T+gu!Dgd{W+na9(yV`M7UaCBuJZg1Y)y6{U}0=LTvxBDApz@r>dGt(m^v|jy&aLA zdsOeJcquuj3G^NkH)g)z@gTzgpr!zpE$0>$aT^{((&VA>+(nQB!M(NnPvEP}ZRz+6 zE!=UW!r7sbX3>{1{XW1?hSDNsur6cNeYxE{$bFwZzZ597{pDqjr%ag85sIns_Xz%= zqY{h#z8J6GA~vfLQ2-jWWcloE5LA62jta=C*1KxAL}jugoPqj4el4R4g3zC4nE#2-NeS{c3#!2tIS|1h8*|kpw2VSH9OcIQZx0Yh!8~P&p}fI$4Bj9Z zr5Yv?i-PfO#<}clM>mO(D0wHniZZdv8pOuJFW z+-u}BH84PQCgT~VWBM88vtCly1y$uEGJ<7vnW%!2yV>l>dxA0X0q{cN6y3u$8R-*f z-4^OlZ1HmxCv`dFW%quP<7xzAbtiFxvY0M1&2ng&A}QXAVR=prc_5m(D+_?hv#$M^ zG#MQ#fHMc!+S%HgU^Qv7Z9eu6eNqpSr3e8(;No*YfovbJ;60LjCzv9O~^>gFKO>t zGZg9`a5;$hksp*fHp{7&RE@DM&Pa@a>Kwk%*F7UGO|}^Z0ho1U$THOgX9jtCW6N$v zLOm}xcMBtw)CC(;LLX!R9jp|UsBWGfs@HaMiosA3#hFee7(4vLY}IrhD++}>pY zo+=_h+uJ;j^CP*OGQ9$0q+%}UB`4`5c766d#)*Czs<91wxw)jI^IdvyjT%<8OqI=i zNn0OUqW#POg^4ma)e2b?*Xv;dri*N0SJ7_{&0>;S!)!YV1TQuiT1C3ZFDvThe}yTCmErx#6yyQ4X@OAbHhdEV!K2%;7J>tiUZF)>Z|eRVDwtDC~=J z*M8|WEgzsyNH@-5lJE+P6HrurgY!PqtWk z^69SOHZ*}xn|j2FDVg`qRT}ob*1XiGo=x8MDEX)duljcVO}oJjuAbB$Z+f&!{z3k< zO6+{@O#2^s4qT`6k}Nw?DKV1DU~}0jVA)(kNz$c-p`*FNG#Gb&o?ko70F||R^y*hD z6HD|hJzF)G&^K=vuN$@b2fIfHVFw@hC_-0hPnB!1{=Nn~ran4VeTMM(Xx2A3h95U} z&J#Kw4>*V(LHOA<3Dy{sbW-9k5M2<%yDw~ce0+aez8 z04skG8@QEESIL;m-@Mf_hY!)KkEUowHu(>)Inz(pM`@pkxz z1_K#Qs6$E^c$7w=JLy>nSY)>aY;x2z`LW-$$rnY0!suTZSG)^0ZMeT#$0_oER zfZ1Hf>#TP|;J^rzn3V^2)Dy!goj6roAho>c=?28yjzQ>N-yU)XduKq8Lb3+ZA|#-{ z?34)Ml8%)3F1}oF;q9XFxoM}Zn{~2>kr%X_=WMen%b>n))hx6kHWNoKUBAz?($h(m(l;U*Gq7;p5J{B;kfO^C%C9HhtW!=O3-h>$U zI2=uaEymeK^h#QuB8a?1Qr0Gn;ZZ@;otg2l>gf= z$_mO!iis+#(8-GZw`ZiCnt}>qKmghHCb)`6U!8qS*DhBANfGj|U2C->7>*Bqe5h<% zF+9uy>$;#cZB>?Wdz3mqi2Y>+6-#!Dd56@$WF{_^P2?6kNNfaw!r74>MZUNkFAt*H zvS@2hNmT%xnXp}_1gixv9!5#YI3ftgFXG20Vt1IQ(~+HmryrZI+r0(y2Scl+y=G^* zxt$Vvn&S=Vul-rgOlYNio7%ST_3!t`_`N@SCv$ppCqok(Q+i_?OL}2@TU$dr6B$c8 zQ$Z(lS6fp%7f}ymQwJAIdpkN~8$)O3|K7Z;{FD?hBSP-#pJgq0C_SFT;^sBc#da0M z;^UuXXq{!hEwQpp(o9+)jPM6ru1P$u0evVO(NJ;%0FgmMNlJ+BJ zf^`a|U*ab?uN*Ue>tHJ$Pl~chCwRnxi3%X06NxwlIAKa*KReLL^y1B^nuy|^SPj3} z5X|?1divh3@zci;648jb2qEOm!_8Tjh3gi;H%2`d`~Q(IL{Wcl1C18+&P>tU&0!nO z&+7mpvr2SsTj=@sX zxG=;T^f7Rg=c=V*u8X(fo)4;RYax^+=quviOJ{>r6{wgf)g){I&qe`=HL}6J>i6Ne zSZ*h9f&JG>Y`@Bg5Pb&>4&UqFp9I<8o`n4W_V=4AugM`RqUeS-!`OyNLyKMqa_Ct| zON-hyk#-}{lZZx>B1F@dF^8S>x|C*QAjKqn&Ej9H#z@Q#KA*ckBX@^;gIP&?aK15l z*EY@kG57oUcm(d{NyXg6$Kj#xR5XdZ1EBCT+Zy!gyXwN&b_zI&$$>7R#{ zh8U@H8NY-cA*CBfH$OCs^priPwtwrzFjDO}DBn#mgbI~hn}cp2U{yv@S)iy|jR9+E zgd(hF|1cyC#te0P;iFGqpNBqc(k<{p^1>wHE_c8Tr4|&NV4mzpzFe;Cr)C~qpVNjl z^u(^s5=kj{QBae)Y*#^A39jT4`!NuIUQzD#DOyfa!R=PrX6oS@x@kJV)Cn$!xTK9A&VI#F-Slt8I4|=$bcjaC5h=9E{51g8X5q1Qfg~~G>qAgy*7h4-WuqE zlIEx?Hu*%99?$6TheLAD4NIMO=Q@*;gaXDl6yLLXfFX0*1-9KQm42c%WX*AXFo$it z?FwnWn2tBHY&Qj6=PV?ergU$VKzu+`(5pCRqX}IoSFo?P!`sff%u1?N+(KsoL+K={ zi*JGl%_jiuB;&YW+n%1o^%5@!HB9}OlIdQZ*XzQ%vu!8p2gnKW+!X>@oC{gp3lNx^ z82|5Jdg9-B<1j|y(@3J;$D-lqdnf0Q6T~q7;#O}EMPV3k(bi$DpZwj9(UhU%_l&nN zR}8tN_NhDMhs)gtG*76~+W2yQ{!kDTE@X4gft2?W;S$BLp9X z;sh2jpm!mkfPX>Vuqxyt76<@f4fyY%&iuDfS1@#PHgzHqG;=X^`X}t2|Alr^lx^ja z1rhvG(PH(a0THitc?4hk=P*#IS;-`fjOKqJ4kgo@dAD@ob*))H)=)6s3cthp&4Q55 z4dQRdG0EveK*(ZUCFcCjILgS#$@%y=8leYxN-%zQaky@H?kjhyBrLYA!cv>kV5;i1 zZ^w&U7s&K8fNr4Pfy9GyTK2Tiay4Y_PsPWoWW5YA8nfUkoyjU)i@nKj@4rY13sxO6 z_NzYdG=Vr<@08Xi#8rnX&^d{Bl`oHXO6Y3!v2U~ZV>I*30X3X&4@zqqVO~RyF)6?a zD(<+33_9TqeHL)#Y?($m4_zZvaJXWXppZ4?wo?$wF)%M6rEVk2gM=l9k+=*Q+((fI zIUBH6)}M?ahSxD4lgmJ30ygk#4d!O@?%WNEONommx`ZK81ZV)mJpKB`PgQ}F>NGdV zkV|>^}oWQd6@Ay7$&)6!% zOu_p~TZ3A#G_UqiJ85&*$!(+!V*+*{&-JXb53gtc9n3>8)T$jUVXe+M6n$m633Mi? zlh5{_+6iZ<%gMWMrtHyDl(u-hMl^DViUDc50UD;0g_l$F`Hb(F=o+?94B0fjb;|?Q5c~TWX>t8i1RP@>Ccgm z?2=z0coeb?uvn44moKFb^+(#pAdHE7{EW(DxJE=@Z0^Am`dpm98e`*S+-~*zmhdQ7 zCNig0!yUu5U#>KKocrg-xMjQoNzQ`th0f{!0`ammp_KMFh?_zF4#YhF35bPE&Fq~_ z#VnniU6fso{!3Z^1C57q?0i!ok(a zL;-f$YlDk%qi%n637_$=Gw=bBY}8#meS~+#X}Oz~ZKd%q(UE>f%!qca?(u}) z!tLTuQadlAN;a#^A?!@V=T?oeJ1f7yRy)H1zn_+wARewYIYr`zD=^v+D|ObvH4rOB zT@duqF>$Dk6&i|pZh?%Wq-7_kyP4l)-nqBz#G0lqo3J2D%zmbU)>3)5e?sTZy8|~B zPC7!`eD+deR?L6$6 z-e{!ihef=f<4HPZ9rSt&yb=5Q)BFAXWPR^~a&Zru?8146wvlm;<)ugbd|!}O6aE0t z6`#KqcH#S#*yz-K90+!Fhv+ zKH+?!_0yl|gWXSaASLcB9a8g7i%qz*vbO)YW`Q@Nxpp*6TZ*OO8Z|5-UWihd@CUXF zY!aTAZ$c^?4hiaq34=s2il}#Pxu=#c2^=(PbHNAyUqy__kR+n?twKrQe^8l6rk=orf}Mk80viC1NZ^1q zeF~g*iGp0=jKncK%s@#jZcn6=EiR<8S#)yiEOuwbG;SV$4lB^R?7sxOf8)oq$sT)) zA&nBCFJxsnci+)owdCHV#cjP2|1j22xIRsxHrLLBk3GI|OppUv3%r>#;J|26!W>xC z9gq@NQWJ`|gH}F{-QG#R6xlT<;=43amaDT>VaG*;GfPZJ&W*rO8WAQQc^JGw-fz-| zzAe&RAnC(gAP#FoJtt~ynR3Z<)m_<9Oo)XW}CWd50^eI4!1p4}s(zLhBIDi5r zr{UH>YIz2!+&Cy(RI(;ja_>SUC2Q`ohWPlI+sK-6IU}*nIsT)vLnuVPFM%~gdel}S zUlY%>H$?-rQRGTdUM^p^FEkqnwC{^BGl|gM)h9zkXplL90;yOcgt(8&LJwOj!5Qgy zu$@^*k%9JoAzwj@iSB^SNu#YVl@&*g$uYxxsJBvIQ>bfuS97JccQcS7&a z)`1m2^@5c9pD`P$VqH*O*fxkvFRtH-@Pd0@3y2!jW>i=jabBCJ+bW@wwUkWjwx_WR zHH5*XR4hbQ1`D@4@unmyEX)!?^~_}~JQNvP4jO&F)CH9srkFhf8h*=P z;X1&vs_&v03#BGc`|#@!ZONxVj9Ssb#_d63jxA6dX_RBt(s;ig3#s(YU3P3klF;mc z%%@^IJUAlGE=cnsTH+(qb1SxN@HzfAjYcUCb(VU)JV^3ZC;#k!t?XjaC!|68eLE zU_hlvOSNj7Qlr{x)y$S$l^2DPCMA=pzapcSkjfk*r!iWU%T{?<3#Hw6s1ux1^Ao6o zR@5DIfo-|c9AaFw848Y!BVG-+vURe;I29F#hLu$9o}oSa9&2sgG#;lj@@)9|2Z3 zon?%NV&AYSVnd~eW~v0yoF$X^1FR@i2kin0mFLG8-aA>hYK;B%TJ~7%P4?_{Bu<0t zvmI)Uk-MRncVb)A890>OqnYf=wu-J5A~^%4jpK~*xp)=h0BZB4*5uWrP>iRV+|kMX zv+BEskY~(P-K)-!JSHR`$brY)HFI|L@YyrxheT3cgHu}KtF%s%k3B`X)E_lA=E>M4 z2VV3M{c0*)`qZAsJ==)F#D~2Ndzm@hKhSBL_Sf3{ctckh-rB`gkfC?Dp6FdM?p;vv z#UlQMp3H5*)8o#Ys@-aj7O#brUfgQ7BjG`7 ztoE7v-tH2%KVC$xKYf%uvZD!_uf3x>h?8r!zYHkcc7$Gdn(6cDmYL&p3pCfaSfY4$ zG|yuujr6!Wl0}V%* zQ;nY##kEdvo8YY=SVDb)M>^Ub9e#4c$O&urD$uaRtxm-UH=6_s0m^^5y^_+F^Q?;8 z+Fd?+De}er^2EmFNn&e8SyS*`*`e;KFIG&+x5iWCsrEyH*0SFBCMx?`m5~hl1BrT> zr8W3*3}Fwsx@%UOuxNoCSoL%AM{Uj|v@>l{pYYI&D$j`&**;?X`cuOOk~?;U{~xvDUjaiH^d`A+gQL#Z?*lm)x_n6R-S% zf6*=Q1m>mq5|Niefl8s=5F={ncn5S;6~&Ns2)yGZ@wt&u4c+)Sk?hdfI^b77@K-=y zM_k=j5hp&u`2nkJK+2Lw`uLypr4dO?Bm3BTZdtWnQa5unCoTKIiG81t4bG`epBU5| zG{toT`)LE}&j{P+AFj`YZrjF-^>k+`zCM`QcQz^Ba4BEte@S}j=Q_Opx14jq|DB}& zNB44BOJ`?GJM({v`gh9pzbg8-%Un=E@uLfJwGkagLEM^!`ct3s5@-xqq*xd+2C@eu z*1ge`retZK)=bPO<`>@62cLN?^S%v#EsiPQF`cg&I7{}l?)}O$!^wNJp4Zd;1yBbQ zv@_7x7d6aXJvGHkNNcOg?A};m_Nq7H=(+zqf9)e3&yP^EU63Ew!NW4CYj_!=OTVb* z-ijSrv0M)u=MF=@+`3ldT-hzOn$Ng><)WL0vqQ&jH>W7EmLLQY+c?%i9~f_x&{OYX z{?kyyNZ&gT*m$(%-OeDAJeC^c)X!k${D*c;c}9)0_7iWMbfu)!j3+{*!Dj|?C`sGz z2xWha)#`9@p*{-X2MN2a;%FM-WqB2h)GTqQH$ZsGD#Wi`;+$i?fk;23fLpYI^3TT3 z5+Zn3cu-_2Ck*@%3^L3}JpVN`5ZJ;gmKn>gm(Z)b%!v|RYf(qrmGL#0$WHQFw4mJqQ85w=$tn^7(z|eJ$3R0} z2k9^EU<^-$ygq!ZR+7wT0KViK8qkAO7xs*e@1dq{=M3haulHwA0~BYNytr7k2K*(W z755P9a^;Hdl2X;K{c}yWr|QH?PEuh6x)9n{^3m2QUfC_Q*BW&<9#^ZVwOolx@6y9- z-YF=S;mEypj68yxNxfJ56x%ES`z-5$M${V1HX(@#R>%$X`67*Ab8vC6UzvoDOY*P= zFbPXany0%>rqH1gi7d>e`=PWZTG>^=#PQf&iJjJ0&2dO(4b8) zCl%8xJg1mg4__!?t|y_roExn~%u@Eu|p9YFb`8_qP@v#KW#kFs4eVetJ+Q+s|Y0?#D z@?dt_BA7C4tGpjOB~*LFu0!5oU(_xj7xA$meN)Z;q4Z_Rb7jY1rJBzJPr0V=(y99F zh=V-NbK+64rd#ltw~7X-%kP$R896DxRuj)p7Zj@8&>IlP&}ME3s9eV2R>SpUnSxeg zmpm?HQJ^u1T;pvwvlc4F_)>3P~jlTch4+u6;o{@PtpnJcn~p0v_6Po%*KkTXV#2AGc) zv)jvvC?l#s$yvyy=>=7D3pkmV24xhd7<5}f_u5!8gmOU|4555dv`I=rLWW!W!Uxg| zFGXpH3~)9!C2|Y6oB~$gz(;$CTnw&R&psa+E!KNgrE1+WkLM6SOf$>sGW+Y{>u?Fw zTc!xG{pa3c#y@d$d0e7a9~e_xjGcaw5f6Fk>lg$Jm}cFd%BO_YT(9s+_Q;ft%1*k$ z_cXkf&QHkaQr9U?*Gr$r6|bCV>2S)Cedfk3rO?JbyabY zgqxm#BM7Sg6s-`5%(p@SxBJzR6w`O6`+Kuo36wwBzwf6K{0HENVz^^w|E$r zdZM%T0oy8OK|>>2vSzw5rqoqEroCZ%(^OmOSFN84B2-8Z?R1)Pn9|5Xkui(fQRl^zA35EH^(JbuQd@Uh z2FJ6C(5FDD(++_NLOG)1H<+X~pt68d@JiB8iUQSZ+?qc;Jr+aJ8bKF3z`K&zSl&C7 zEgl&!h?sc=}K7 ziEC(3IrY?h7|d= zVjh{@BGW^AaNcdRceoiKmQI+F$ITdcM$YigXtH)6<-7d@5DyyWw}s!`72j`A{QC~e ze-u0a6A;QSPT$vqf3f(kO1j^%GYap*vfWQ@X=n{lR9%HX^R~t+HoeaT5%L7XSTNn` zCzo})tF@DMZ$|t6$KTx+WQqu~PXPa9FL&shBGx3C>FlGz}7gjfv}(NKvjR#r5PL$a1>%asaylWA8^g!KJ=$}_UccHmi zAZd5c{I&Ywpi3a1#27C6TC~zm3y8D>_1an8XHGNgL?uT$p+a<5AdWLR6w9jdhUt9U zz?)93=1p$x;Qiq!CYbX&S}+IITWLkfu%T6X5(pk9-fs8lh9z8h?9+>GlFeFcs*Z>u zJSaL!2?L8LbOu_Ye!=4~ZKL?643lcsNn8>qUT|q&Rv+(z>Z9=tyG&5}zZK&Q?S!nG zR;Ui^<406=jLYA>zl!a-OXH#J-pP4A`=)r%9HV5m1qGZ1m*t^wi>3$JRcH)3Q(LQz z(3}~y3=QsUu!PN$$N~#yBP@=aJ+Bkp_hx8^x1Ou6+(Kk9l1CXr4p~IQvq@AUePuAj zcq5>YDr(JTmrAuLwn6sgohTR-vc^y^#I{grF7 zg}8?&5!^$|{X`C;YrZ7?rKH#`=n0zck(q37+5%U;Hmds2w+dLmm9|@`HqQ<5CUEz{I1eNIL?X~rd{f71y z>_<94#1G+j`d5|fKK@>QDK6|HRR|9UZvO6HdB1afJvuwUf8bw>_Fha)Ii8I}Gqw}p zdS~e^K4j{d%y+A#OBa1C4i0)sM=}tjd8fZ9#uY}{#G7rJp{t6?*5*A^KKhim06i{}OJ%eA@M~zIfA`h_gJ_o%w;FaFQMnVkBT|_ z(`m9r+11~EPh9f7>S=$F7|ibj=4Pt>WVzk6NfGRvI_aG66RHig-(S%WKRLP%_h0He``xT))N^RI@6!ADl=*vsqVb|7 zr~Lwl6qn|u!%is<{YA`Mde2Z${@EAHC^t>4`X;F9za=RC{{$4OcGmw%9+{$i@!cCn z;7w~r8HY->M@3OzYh+L7Z2Lc8AcP*FZbl6VVN*_sp}K zQP|=g@aFthq}*?|+Gm4@wbs_?Fx-HD2%)_UDJ);X88~7ch~d0cJ!<7;mv>iv!RS$a z;(-cYTW=K=|F0gIg3EW0%u2CSr(Kx}yLoki|KSIt$#P(O!=UjBGRzb3L3-?NGr7!! z^VC7_Q(GhT;C*(bLivfhlRDVdz7=h%ABuLA2g$qy)A}U@Kj_L-Jd|--fy#-*ESRo| zgu?*?jGEgs9y>1`t}|^Ucd1I=1N=mOo{8Ph zwZS(F%G?nfI{#%sGayNItK9J5P)Qk+^4$ZoXZJ0G1}hwcckJ0g-QJ<)3%`bF8}(ahYIjKFYMtg3X;e7J18ZvDkV@N=nxvDl zo?}lXoT3pZY;4$QKI`~GFuQKv;G6b<8;o89Hd2yu+|%sU(9C=h8ibwZ zARqZ#lk@kp4*#URe-YmpRc&=-b&QP>5b{9{(tH*)(@ZPKfOslBgwCPx6d*{XMX|Q{y0F!5a^ScCE;h8bQmTJR3*}A>aGcDF0?tU)Tnml z#DgruwAva-fiU3s*POY_ZHiJyW%v+733X`&ocwHz$uqJCOhrM;#u*V2eK$D5HiN(` zII{BEg(PV6#_Nv3rZBUyd+TI!>L72KW_Oml6L=pNv#aOl( zgpYxAH^@2aJQu3urlrCeanwSpHHD_Cxb+=cm49{ZU5Z@;{^{okEJ6&fpDD31w~$`% zcz@_REsC~Vq>3YF7yJ41ZEPBW&%|OwlnfG|QNpiX;fGR0f^3?PEf|-33P&LFGe`8^ zaX3M+*h+?6;s|=$j*d|S-r6PSHnmLqm9oshPNpGzlxV21cFrxcQLidd2%h>n%Mc4{ z|JWBvtbb;(-nhWpPO95hR>(e(H$n%*pCh0k4xE#I%xu=#B)zXSaH+azwCI;0@bY<*-10-Qyaq%5NxSlq_@YJUUwy z*d;qPjW^cuKxdXiOWwP}5FN6SZW~NqB%4?|WifPNZr&XNVkzF0n#Y)pbaEodqNO4F z2Bq#^Gr^Ji3!T9`_!D;a1lW$?!LQ-iYV_A{FQ~^C-Jp`_5uOC)6+mzBr4Nl3fHly% zcXeU3x-?#J`=p$6c~$T~V^!C0Bk_3#WYrtoFCx9_5quCQ*4*?XG0n_9%l_!n`M85^ z7}~Clj~ocls6)V&sWGs?B<`{Ob>vnbXZwdda%ipwbzOJ(V`W>KBF5zdCTE8;mc&xU z^clCzd0(T#8*(})tSYSNP1N{FnNVAU^M1S_pq4VEQ*#5nv`CoYSALMEB zf6egyuRMzK2?r^M0hCD*sU;On6c0^Vh|#tRG*n1p5R)QyVw%Va37nMSV%9&uq^hp| zCHeu}y{m=NsA=naDy;q`fd9t)I$Qd-A1Il$#0KyDc>X)hKJViqNB{HnQyf5D(ZJ*J z{-oGB-%Q|QZ%Pqu34>fCy)Asi}IY7luNR9ebgH4DAjCVvSWfa%PE16 zkC7EIuEK}?IR!jgP%eX%dcxk4%N!zIjW4wYMfIq@s%GetDs^g!^p}DH46EP`Nh_wD z4Rwc4ezh1U$Mc)Fe6ii6eD^*iB2MFp-B-HhGTR0tC2?bq$#^J!v1r+Z0y+& znVub*k=*^0yP(c#mEvX}@Abx%&}!W(1olcWEHAVgskbBrzx(f2v&}4~WkVN?af#yi z4IE-(_^)?4e3(d{F@0<~NV5|e0eaB!?(g%l&Hq$UqzC_Enuest?CL+IrSD`tv8|{C z=79vnL=P6ne+}6X1&cd$kam=jCcv`~^y#R{doTh?6D?H)^M7-P+=D@?H;bt$*V+)K z?+?Ex3Z@8JE3c4eHDYItB^tSot;@2p_fuZ8mW^i^a(L;Xn6K+1GuG0n$v(38;+<78 zC?eMzbQCW2%&;U>j}b>YEH5>RkP44$QlG6k(KwXtq{e#13wnx5Jh=uH?lQIl8%Qxr zq%pDC)mYYKa?N>%aF%YwA}CzV@IOV9&a81d9eiU-6F&lGvz68~%{&4LuwV_5{#km3(tf`fejjs%`{Y`|0p!6|-U z8XQA9Sl=*kM|(2KA!LWOCY3Qq4sZ7r&}__rR*Sj(9W8R1_RxI&4TI+_7RSJF&-363 zJvczH?1(`Jb+RDJL9$Whnj8qJRI+Mz9=Qjvubb=Lz8nWVXG{Te;$%s9-D#$)-!{~w zIM(vkr#OM>2F7W$$Lq%fEYl%e|Tsc>9rB9c8 zQoi4nXomx3&sBI9AwaHkoOp%SMDf2@T#73Bi?|!r!Q?wc(^b_u4ranezYx~=aRV-a zD|_WPK^iJh&=)~h{t<>_$VMXsee;{r-|`#H|1?DZgWvuc*!&C2*(yv(4G5s{8ZRzt zZMC~5gjiU@6fPGMN%X~pL};Q`|IfPfs0m9;RV}xSxjb)*gmvGO1`CQb~W1M1{KwXBLyPz0JQG=JkVX zlPq&zNZS59gf-?*5Z0IFitTX4T$1Oo#_~V%4q2vI?Y@UkSHh}H9xZ1va}^oBrCY{+ z3wwj*FHCsS2}GdSG7W(|k+MWu9h1Qs6cft~RH)n*!;)5HmPX1DqrJ3-Cs%i4q^{$N zC&skM7#8f{&S!9Eq-WqyY$u?uTgrSDt#NU%{3bQZtUSkUof4`Z1P8aLOKJ+^dKh%n zfEfQ zO|P*J>;{=`9@D)qpnt`#NH>}sir*&oFC+W!HR)ecHcPwjF-|)}8+tR#@A+~CLl+Ab zCqp+=Cuc(&VGC1ZYg4CxIXYL>33p^wjIWJSh6R=oq)jD52q3~KVGt=w_z(arS!gx^ zSd|?!rzDu1$>0o0Y0+!iZU=ew^Hr+cq(I(C>9}^sBc++0+S#I;js@_NLD9>MH(tN3 zE5F+J_bYdPfYm5%7-e=lm?!-xlvX~nDkBqu!Zf0ra65JD&@tYDW+c@P3W-YyWe4^6 zhW?FUJ;c{^?b`N)03>!@#JI)r2&!6An27q?*^wyUx3T4uyeIl4*(4CV5OTK#RSnYt zq<+RKCdrYIJtdmNC-NtfH)K&pytbM^Mi6JWjkzJo0TdX>HOjJaIQmQ?Q;l2)8oN@d zVyT=%y@TihQaJX7#B2wY#_ufuaF55-sWO{OwUx$2zRyW$YM(CFBs4Y;YmBk(4u&u- zEf@rIR~4#}IMeq$?T%z3s3RAR7m%M?8No;a=1HXKP?ia#uwy!`4v0GFSjZiMii@ib z#xRmA-v~CSVl8z9cEWVEk;9_BKPS6Y2|bk#PAb|}gPxHs-dt*k`5tU#FZL)FLodY8 zmb!m`DagEJ#q1VKwO~%zmw7;LESf5u!KJNm829pbY_w$P2}16`Bb?0uoL3~V71;_U z`B~wKOB7Bp!Vn!M@o?RHydmah!dHPaT`&idV83kQPxA>E=~YgJC<)rdM1#B$JIgnq z0V{p|Cm3eeMaO58Wrv^9-kAOJ+*HR!;;A9z&>78VsYmF9$U^*ZE=K%d7=MZ~G?~Hz zSHlKWK!Us^%?uE6`E|_XI+nC354jkbUPvedHbh(DkKGkquYf}=-EEB1g>RC{O9ORL371y8V*CR5EW z@lmFq%MWEBdeHR7%(Rpf!Yg52vX%D7#@*^M`fy7Srb z^Ta9wcwf$89uL61@qeg2vc&TAGKSLV>YKI3#5lfs#q5Zm`~Ogef!!CoWWyiA=J;js z%X_n!njeF2MZgaVoMh@S@8%lR)AsYyzmqkj+C8ghxI4G6O7ovK$udULO!2$(|__`2~6JjuoERet}kenJ%I0pU_O@tU*Fsd4gm&hV?p%Y{!;r}{S^Fv z_4EJbVjFv7>+dE9{rBS@8&_vbx9>4!8&g4JV^e2mSwlNR^Z&ujriy)b3jzqfYb35o z!;J+c>%LY+?P!IticwSrP;x2|k>j3Sxg2X%E2%57

`Lem|V$A>eR0uN8Y&sdjtu z%-lD<@61@6?qUPjUg|mF7!P7`hx+st`i!^L7HVHtzwnM z)LuOANIzT#9tU4)C^WIXhZWqrO;jr_O5aErkklzt)R-JmAh8xHMJ>x>OvTiuRi}FY z-o@0kFwwl7p|ro=*2q*cFRX5GCq-v!LPD)Sq+Uz~UkOwx-?X&!Q^4H)$|;=n9{idC z0mJl`tCTs3+e_EFVzQ}s`f_4fijsucWy5y zarHoT>Q06Z4yI1RPNpW`@4hSzZT|J`MU3i(GqNhm*9O@MndJ{31uA^i zXo&^c`EZ}5W)(|YMl##@MuSK#wyZ3dwJEz*n@C(Ry$|d`^D=thayXFqxt*WW&sWdI zdm1wv#VCKa<7d2Qc#qzvUvivhK5wq*djL7Wqjvf}-c~}d#G)eG`(u<`NGei`BFe4Q ztTSs?Gc8Ff%_5T4ce&J0v*FT`y_9r!Po=sPtHs5~BlV6VEUNzxU+)+sX}ffdPTRI^ z+qP}ns9yQgjY^t0ddMx1Yd`|OB{sHnUC-B;qum1|`tR#P_@llx>d z=qpNN&?nZib(t90A9F*U%1GbB+O;dq!cNgmmdCrK=(zS1zg*9(7VMfv)QMkt_F=wz zHX2p4X-R*=tJI4A)3SrL`H^peBNHh&XC#sVR3D zt17qeF>BaCZNlQO7n@@BuWs&l(FtRjaVn~wW^x-GsjpFH!ETyl7Od{Wf;4=bzL5nj zW9c^ZodMnN{3Jkz2j2;qhCm1ede*6891vR9?(Dy)N|iENw}HKLIOrjB0x)pEs-aS{ zZR$tEyZxbP(;(l43^KjRtSuirNmw~Bg&6p;)vqM*>S#L>0+Pw5CU%4@&)8OX2ykYQ z^f^hk-5%!QzuzYniL*1Gs#S5Kp_*ld1EAmkInP+^w?#(?rbC2Bm&0c5Ko@6`_ zi!Nvd391nu^@AmpZ$_0fPR2~kQGJS7lSGwA7U>s@+!d_`(P5y;MT#U~_ONSo9d+bf zVj6MgWN=|%#Qn;vl*TNLE$Mw|*89{yJ=WN>j{?T*vqa$U$2_dg46R)8wl&CNS&iK{ z>HDBC9e3b3roJd}gK!T>takKP);KLj_9T;%knG_fN^S$4hb`E|)qy__^=mm&Z{~CF zhc*PxdrJ@xRkQ-8lbh3Ys@2ZaR)Q3z**-VSgeMHE>c5AH1bpSUor&dgTiMd5Wn|(# z8Rwb{#uWZG(Jo0co98|mg5zF}M*d>gAg|Zdex@}Ps&`51({MmNyHF;GD4EBT`oP|X zd=Tq9JYz*IP%@2oujruVrK#jAT97|%ww60Ov2He^5zA4)VihJ$-bxoaqE7zU$rmK) z#O!xp&k$!TOEiC8+p6`Q)uNg4u8*chnx*aw=#oP~05DS&8gnL>^zpBkqqiSQA{Ita z%-)qosk1^`p&aB@rZ#)&3_|u{QqZO z{f{A3)XMprL}2{=pM$*`z*fY;{=4e=u7&=s+zI)ANd+V!L%#^2hpy@#N-WbB%U2Zl zgD_E0AVVWdMiFi_u2qqxeAsRzD%>l|g-|#$ayD3wHoT{EUS2Qe zEq=ryLi%iMZ`b}tSYzHInTJ{mY{OXy0)T&Rly3ippqpTk%A{T+e?K}j zURM^%!ZIWxW$32?Z&q9)Rao;#KQuLv+^ft>o|6c@QD=_}ql%5Th=cR{P)_51Qxjh# zRJW<|qmpRn3(K1lMwU-ayxjsgKS`Q7J5m0kw|LQb=CbyahnoQTWY z?g8-#_J+=*r`Jc|A0(MOvTc0kT-tBLIIFCd6Y5iCr>cqubJu0`Ox+FkDWs^L{;0mc zxk-nf?rxh(N<1B;<;9PSrR4D<*5!DvA()O7{vl9sps3x_-Y_w>qC3OI!_Wyza8K|E zAvJvWYyu)(z*TK7e+Q#dFWd_7%;fn4Ex*lEY2$X%SP9K9d6yWC2M!3>3>tu}g4R*V zRMC!~oYyF#Izu$lGjfQ?q}KD$rpDMRjF?f>6kuBlE`z4Yxy(Y(Y+Dr#PKA}UsSWD? zm|ER_O==Y22{m%cO1jhu`8bQ05@MlII86NP>-_`<|Q4g1f7Jh*4%=yY_ zafIlUJ2zA?dT8&WTGLE&gvPl|<0zKa=DLzzPOU7i#nate!Z3u|9R6E(6FZ|(EZ%+b zsB!MEkGz1K*oXGdp^tGOWyF0SI{tq>^nbgX|L>uTert_v9gIv#Ma|5OTy0(c_qQUz z!2+;T+eysD^IV+aC=aX$FPzbq+lZ7Gsa%r9l;b5{L-%qurFp89kpztdmZa8Uo!Btl zu7_NZMXQ=6T6+OFOCou6Xc_6tf!t+bSBNk)mLTlQ5ftr247OV6Mc0v+;x&BNW0wvJ zjRR9TWG^(<$&{@;eSs-b796_N#nMB4$rfzYM1jb>Gu$tEpL8-n>zGXVye2xB-qpV z&IZjhW#ka?h8F{QJqaK&xT~T;$AcKQD$V>$$-$x~1&qfWks(mJ8#7v7m4zpWw(NS( z5j0d&Bs4g)>{7yzl-7Fw`07Sj6{vw5nwVyVt8`;Rg5bzISP26=y}0htlPKRa8CaG# z=gw7__ltw`BWvICf>5(LFDFzC7u-Ij7*OKwd7685%wb6a=QD1CjpQs$^2~cx`@xS` zNMz6?Q4OgIR8LYa&m`q*QJ%!CbD#=ha?38!M&7yLA1Wn}M{$nV3-G0@@bD#WjCYI) zKFZ`bf$tFF#}GYZ7MK2U4AKI-GY*y(&DCt~4F1!3!{>cK+7XAfKw<)Jv$b1vHkpC;gl=VNy?f-RI(r=&j z@Dy@&vHYi$GBI*-`1j-=qpI@{qwt%et&>`VuG+PYzF>DUM1!h|8sz~*0>sA7|IH_y zskL`MJ4Yw|Ru~}gzgCOOEDSyuM+ivsjt@13h-SLD|INP2zRO|RKEDz$_zlt)ZWYQg zKHk`_;gygz9b$7*)WKC(<}zQUY8M94a#Tu_OEyX$Lej=Cs`b}zjTYvv-Jt6E^_bV) zCt>gvm2{y2tK8Uy*;ruhTa_?lSIlV;r8b zX?jME!z32pO8`g9ga%`RQ*v=F0O`bnPZebx@b#ZfQWvqZPAb@zl>ORo<_o7Dp&F?6 zP(tBH@~c-Zfx?Ulkb{F`C1S8y3F;;)^MwWBiBPQ1D=;yC{M-i~ILSfh3K!Ai{5c?J zdLm0OmDsWuV>%}MT*Qf<$UT+M=7pMVdJGRi-rdW>7iM&2UO%v@>_!inA`JD)lrKC& z75Y)Lg~PVq0Ge}-g$8cy0w@sHjUuwMm1|~u6X!*fGG>%bAbv5cEU3nR6&6o03J2ff z)*M)kj|gyvZ6Md8Y!m#IuWuP0<9daW2gPDp*=aQA2qm)VLJ($UUQ>-4&3LX|)=-g5 zDTzngTm?JwMM46$Z22o7jlr3Vp3K15k^@=c7JJx9WQg*XbLRkdC zYapmoZr8J8X5n5}a2xjY35bC^@Ez{}9JA&aex@>JiMr#&GtJGn$)Tt=HVKx@B+w50tPaNkh{N0!^9>r<#h(fr3kP@a(N1!O)$rdf&Dd!hhJNtXD zIbx!f3YSHV50oNza38Kzd9Vze|NZlyBd{fKzZOSB7NqO*qDh)*>XW~VnmJ^ zji(MF3D>tHCk-^y37b-c7t1Zrt)VBlefNnY+NH0u=9IPbDZ1z8XbK{5_W?~aGs@o& zTbi2gdn~PB;M%^{Q*d9xWhw;xy?E}nCbBs0rn@{51pJ@6e=LQg2dvlq_FM0;Iel9= zz?V~4Y+a&wJIgvt5@%1FDtB9(A<-f!NpP^nl51v_hp$v8$w{ z=Rh2*Y?stNGlx7wbOLqrFbxg3lqpaaN{@9c)nNxe#D=Xouh@g7Wd}stZ!B8jrc4HPmOW%Xt^a!LcN8M4^efD8wWziBkha6&KggDq^9beRoiLH_z9 zGUiqkIvsoqX!3F)6qr+_HfB$D%@)T=XV3YUews|Tg-Hwn^wh3)q=N>FC*4nHJ+L$K zpR;I6Gt%?U%!6mxrP$mlEEiT&BVf$x(VJRuEIXdqtS+qfX^-@UKefF=?Q z(jc2Y2oyEyr3_bP|F%)C?~RzdfbNXgw%b_zaAs2QbA_QL+IyP^@l+{#{17?2dn80k zljl~W{3$~wO4E?SSij&`vnbpKCUzN%8GY^!-wNR8=XKiz>yng^Xj99@bTW|TDw5XGfDje2@E z*~-mJF8z}cI1eTpHlg*7?K(U5q3H%{y84gCiDbksT+HB=ca!YVTu zgPDuJzB@76rs{is=F^_95WD#mg}F*~wRr~vgN4^*Gy=hUUD_~f0QPh!&J7XP9zv&H zY}Zm4O#rej< zQmBNK_0>1jXd)Y3cJi(*1U|!mL(;nU#j_WV33)oK-!s$XS(mQqWqQ7&ZZ54iT5+r| zi|MH>VJs`1ZQr<{eTMqC#Y~41>Ga4BuQynUV!QuZeaFa6aP(B)SxC~V-r0K5 z5BJ<3nuAkX12%0k5qI=#D*PNg{NNjn>VUnvH!{DfD}FX=e%E5lw-IZgDqD$1an(zv z95TXS9wGg?Bl{w91nOC8HvvD1&ENr~L>4u{^bNaBD>ZHXIw1Ko!;wjz1%zZMbWE8# z7f5xlDTQWK%rH+)0KY&O>*EHs@Ha5t9ltEE{qv`K0tO?W=jgzciZhHZ4As;i<7{@M(!#&K$4UGQ?~d6rbu|rCYd`D!Bgha2*v# z?6){N62Wq7br9`S=y(rk$xKExQsyv0H~Z<~f!Z7~Wt6SlJBO4_KeNahC?2rxh%Z14 z{6vx|=@Pd?8vwjCEbf?V*zgc>36eg4u4w8WMluPe+qB=i60{qnN+XKmud{LfKvd^Rf{8@jDa#RaXtvGeC92KvnMDV3m2 z4Xt7QB96VazV=Z?RrMXb$#mb85@y7X+OE;c6PL94T|ssUhD|n8IM`GhqU%%}=6E(! z@O+LF*%Uy084M_#De*pBSU<)G3|%go1vt<|<(ZKk{3&*44f?ftxS-a(+@u_92o7ot zYq%I+Ztyt1x5RPt_1it>&+05XbK1B{-T~aA+FN6BiF@>|QCJ`#y*u z@e*p+J|+Jzl4qtDnLJPde6Gl8Qfu5eP#Lr_}cyBzGaR912ca0h5s# zbgocm38uvIstvyAPMEgVj^>{XqR&db7$(XJRTRiR@!lH>>CTe{+zRJEgcn{?M627> zsw6}Y)J+s3)u#g*Mo19)oWp785&T@;fee1**^o5#bgS4epuPWP>~Y2v-~{)-me7SK zd!AQUXsd{A=;C;8>vRTE5Dol&>XJ&AYMijyXV3|_46Fr#lz`uF9dT^PhX2e>lDN?r z>wx*9-Pr~siloVs7@`dn*kGmY0xP)2odnz6S437Hi&}MSb1iiwEiwfy=f;yg# zDZojIe7{n|lnmh@$rU>6-%oUGrG#^0y%z_Niq4LG38Yq&Dq<~B-3qLMHLbL;&A)i3w zq0}L%{J2P1a z2OC$%f4j5C`~!#oBU=IP{19v?%zqxLR77sUDKZWk1TEdClEz1yHB10F7>l{;9l0L|=ADc&?i zK#F90YE|)m(u4LGC%M^0?53NrH3M`xl2{P!5+fC(H)Yt|t=X~m+os4b6}Wj|nDvL8 z8n=Bhi`Mq$&2sm(8n4F2)~_ylMf-R2rn!V)Bfzhv7v2SF{79o}>ITpgUpe=zcRpds zp^3fse>q!&ohi{7gYJM|qD$1?s^vyP1XP=26O)1AFu)?|OCYHCJm*LP4*zJ8Raq1u z)9(U+oYRkni_C&!f4&%ORK?w$g6<;rT((@LunPCC_#2P zxJ&Q13mCI_U+H?IvV89Y)i_#NnNt!>xavHwF$|O zXuHG5oCo;G6F&W`KV4I0A-(zyjQ;ws!05mAr~eli{U77e_#bTiA4Hr~$mBnaBxQ^3 zlOJG&4aI|YIUi&Z#TBHjLS(GmY^z5R28NolKW$l^Ym#0I3|0lI-ggSR?CgqX8f;MBaPl&YzSG} z4(9gprQ%M^N3g+r;f^a0BNw0BQ9}e{Op$ssU!0cTdbP z1%BNUh*RkAe#+jya`#(*p*uQ|spESDMarSs8h3e`E#gtvYi=8d#ADvy9g>R@*^D~F z2t#h@kzA0JK)w;AMPg^lWi2XAU}jpiDF!akXK|rSi6}wmaK)KT*81I6M}f%l3XCMR z-&LC;?s53?Q?B;UuDeB{5^S+oOfSGE^CnkvgEc9^13~<4(iGap$VY8}3$6;-sL}t1 z4d0l&nxB@pZuYHH` z{ONm|SH}iy2^)Zg%Ou?*Q?I+u&ZmckE<;nVG0STB`M9GzLE5UAMeRQQJzJxXBBwA&_T6LHe4yGpP7i~lax~#Ub5BlJE zg>YF0Yn0Wcsv`EJIW^d7i>M?PO5_+)OxDS;9?zPfCH;#_rpR4-*9!|aogttErPHlR zUf2d~4Xa7AEaZSe)Mn9=Nd;=@JUDKUaJU-Rx~HXERZPZJTiBwHdXup>tP-Z$yw6H? z{D8e~w09((x@w&~)75oSpJ7o&u#DUKXAP}9afG;3qf=+XWeC!=Ip8PJvw~{@B3H)k zZr>U-w?x^Y3%$zAfoF_*V2Mlr?I=_C57F2k-rurm=_3`CHmW^yY`ye5aJG#E#oU&y z^R4vJ!2z7aF;V5BD1dbHn6(R25;-0cu1Cet+$J~Uw}=H_%79gf!-W2#1g=S`%zSN- zwVT1}5o>Hi-DpkU76(;YW&Y92O;@cEU^coXt>XfiRWI$}_*t&RQ_K?A8!$gpQKZe> z6VsBW458Q0>X1E#m*K&U%))^SmEntSPBAZb7VW{C@EA7Plo3r-`7EMb;;WeQn0bRTSxW7MTSYNoW=(qCsKsMVCbY?$#Z{|k#%NHM zA*6=sc(VKVE`UVqumIooHMGYRSh$SD{ErAy8%i_*n<=4ODdFErVql6WIx-X4fyaoz&jU+aYlbi=W`&5GJ~zS*@5IRv9cn<|il?|!d8>N94!OI0)aLF!Q0nlhtv zV$SFv61Ek9=p#mMT*~J{BfjK)?1ss~7B8LE@RPM6>=Q&sCt<9ZWOlek61x3T53zDy z_Ki;P_XP~dr)aCdrp;^Xx&4zy791bkXYcFE&ul#uoMVnctVZzl-Azp*+fw1N@S40^ zWBY6U4w+j|T8!q!)5)=7rk~;72u(J{qztk$Rb^WOCbU62Z^s|pn=)TqT4{gYcX?y1 z?|~>Cvir?R7Ga#&UI_thW{axhKZmGsOKK2*Z5|H*2nrEoD6q0cA?LAuQGqE#iVxT) zkKFW#vDut&E=}&^_xyn@nKhBk4S$!WNK~%$ z0c&2{SDdyuxlzV0ph!Peph$e2NH|n4;u};Z5-fDRQCkV`hd9~Qhw#l z5yeB&7zlX?y>QU?3e8P%Gzk1X934Q9LPIvcZi~Q>$tU#A^%^O!FsqRvO1M){#{wo# zBk9bs(!8G_zMYJ-^KkkOmXlld6&M}R+at4#TYfha^(?3_OqFsw=T6Gudap+sqFPF0 z*6D8MYBS6E;rkj8{7GbNPpnUPv9*l#u0T^M#yAbod>pw)srdC}u6;9n!}f|*m@!$~ z1aL-1&ei+i_Mkf0!?>5p@ss}z+(4GaIZ0Tu^mr{+M1{}bS8k3r~HKz!?C`p>TW)1H#Yg*vr z7Y{a{9Z}e1N<7QR%urOa_cLshyVKNaKNU@l7j~j>PeI7MIZZ|r0*YSjU6P_&ia|jH zDoChFYF-JCkoNDw*&*{QG3x+J%2L5_4`n1Tg9hatvloFoYL01#hFFj~!}MRSdgSSl z=m-yq{#uwWUIpuCs@%BEy5ob11|s~&TVX8~-XV)oMfeNdXD?Z9E10-tP#Krhiv$@dBpKj5J%t@Y2xI!*8s~Z z29}0zR`_9s&89Brq4Tru3F{G&uQu{ujBFqN`NY$Hb>qnXc(a!g%hbv!R@n6sNonM) zg649UVVIiIE)_J6eMZ?R^6HGdRMn-UD36*c8_Z2r&xc^Cs2p^v6x-_j{J)k91n!wt9I-~_PA$GNiLi=u7ixtk`YUQ4uIF+`SI~U z1J;MiD+DHLSA)nBsc8CJW1Z4F5uFXI0GzFHhs4egAoxF&>1&8*Nl_OA^!wW4GJCRO zwS%7>sOyj*5EN! zUpux=mBP|Q*_J!@%f6V&EZf{?`H}D&1^^@HO#Gta8P{W+FkdO5OW;fnD1|4&tlh3} z@YGnJ3d(Y0t#ep+bksNs#e?8*u-V=@#Dvz21#EB=jam5x3MtG&IuRHU$pr(K+Y-AX zn7FqKEk!?hw{HWBS~^ioY8Dbe(VtwFva+1h5$-}M9!~UYHGIL>zwFFN1`lcLe zwaMY%;tKHw`EL=C_^}jKY3YhWzg-&!anlG&@4E|`Vl}0q!EvCtT1I@}=Ug2;8OzB) zmllrTJ}RHtO2N@|-7)oaf*v0`{>2c|j?-t&WbDWOUDsBIUR24HnS0{I;>(%9+r)y* zg2K$nGPerx{E6HXH@h?eRQC~Y44A2^$`xKRwnOj_7pT5_!?K%>JT+F+ z6(@ZUF%FqvCBG2v8WL04A5>D=m|;&N?Hzcdj=|%{4JK2j_;hMKOfU}I+5PVH87xo# zc>v2%1gFE>V^6x3$7#ymLM62}*)(ex+`ImB7=eUwa2O&zcN_th9iPz)#fXNbq_VnK zg>+Fagfb53(>-Y^v23^|gST@kT%3pG*YUyrd-zn|F0Cr_;Qh)MO;mTE$%x&%B^Oc= zO-<|3$Nplt0sdxXQO`|RVIbVxm_^24G_6XuTxk&{Yyl+?OeXa-!t}8&fuTGLZpS|{?$S9qu^8TDrgtdOu`4*Sqx20lCJ(;z6u7&0EbrB@495}e zvjfw8yG7#Eo7QX+`k$3*tbTCwGm9LGOvTam&Kk&4&(T!!b0d-h(+s160p@Pn+_M|) zwasiA7r)El>t5DJfiBLb@2=gQDN0N*FfYuh&F<6BNcc)=oqju*S(+ucbzy4pyN1%s zgS@}T`xoCKJdeoM>hW-Zt9xSNRYI8RfX^{UPSJ}y8$_k~4-2G8KZDJQl``0lf>>)j z^q^y@`VIX~W%W-QAF*8U#?c|>tGQ{a09;)CL{-NfEv_2<$o(R8`V7xFRTl$)d~KX! zxG^v#xd(Z9R*`P* z8NwYSrl;qaYDzF0iB%{|A(v0($}TDr##;!y6paThkw{fnuKExakKusCdM>46hESJo z6Z4inrJpt`IzSB{l1R?`XS)o3@M9OZsiP&{y4g5QBH!U*Fvdd|9inn^a}Nz>2&)`? zh!|tcpGBMA4e|H2Y3)~7iyNUBsc|aN0$HM9Uc2MDIL(61;J!I)NmIwv>&&25`&+6M zq1}!I%Azc>=L(6nYlCWwU59Ea*szPa>sE|5)2pJsAnOmce3ZqxF(4^b@uZ6D1K#-5 zD6|eu@+l+j4}V7yxluQ@oX?sla^=5dw}yP&j6E+69hswg1L1c=)OyvZ7^wHQJl;ml z_2lX#$i;=Fs}vkh=ukc4y2Vj2Lu7vAHQ*E%@5?3`^a{BzDVU zF)O4|`;uuAO@)kfdwp~fqS#rR$4Oj@c*zBS`-fL6qu8<7qzl8rl--^kjiCV!(vbxC2vIdMo2I^X@+ID zcT&$52_`~JOBXh&mXX+ceO*m*0_=9ArqG>xjMR;+M=q{e-N#QEj-BCAzAVeGSrXNh zCV`uX4qS?7l$u+*J~5P?9xlU2%6rgo30lJ)cd|FHtEmloD@8tO@5y7N5t*NZN|hrm z*0FP5k0_1u5$>dp#I>8az>my1NoIAqBZ!Lx(!ohP^U@&Vmqd8 zH=75V+`}JpR;Wj8!j6BT1WSjMs>H+3_*52JYs(04P<@$3WEVZ7V%N-CLN$onNB~*- za-hT{!s~K{EUyaw7zDbp7n5T~SRV3$*>Zhpg-*51L=Zj|oeHx)1Mr4juj_5;_<5%8 ziMWWR&MhgdLq0$}U0q=ol1xb)TQBdcV!(3$iF4x~ue+F-gFAGMn^|`*YBjuP=jx!~ z06>UuQAq?Ix&zn0^To|<4!CSXZW7o6VrM}5dYxV+Q~8-h^Y9DzNs{5%+kyFy5cysy za}2EkZyRxQ^Rgq)T6r=({uw7y@%D4S?wd{Ck@D0(;mjg4NbY$Z$xd6rCGrNITO04Y zO%6aZ!9hMp%kU=V6dLc($d`AHMbf`&G9BXY%xr$$hovCbBj@|K2-4_HjW4Xn{knIL zaKV)PQkC?JIKYK?u)1`rzd)G(eO222!%q#U6QaT;SUl*MO9AvJ_$WC-@uTOjb58L_ zQo63V8+G)0D~=S&a%3>qqG`7N+Wfi$Logc=SXGBq3&TV|=!!;Nzi4VeqP9=hV>H5k ziX8p2v_i>9nc1rQm(7T8t#sTSGnI9T#Ms(_k_%sm3mT6gc=YrdUm@Ip6xRqL0H93*Yx0O!3Qw+_Y!81*n-ovS%iBlXx62TFNbk8K-j=LOV=1s zwc7i_TsS%sk!R7r81r4v*Ec`Rrl_m zr2$@wBrDGJ1`%wG6Ar259e%+MkZzK88-X>M^WgfA@HcWJmPUeFdO?d0>gvCTn0-ZWgb;$}~gdQiffS0?*jk$T`izb=V-&N#O_U4yp?Y!Mdlk09!o82t}+5dEvSj%vN5 zCBperFlf(sXr6C$n?zYvm=YYyz=~W1tkhvu1wODh>tKoBEiRB9*Py%96luTxm11-k?Q=g$c>y=q9%J< zVbw|kc=&DAiz8G*&G@8XlevEthbWV6a7nM1@VjKNkP|sl%x3(c9h#|9HIdVuC_??C z!MaVTrRI4=oMEugDa}D)#f1zPsr&vLR0Zy!7;QA4?x1w?=X%tH7o_(2z@8LjA`t^# zft3pe@**E=P;MFXEB+)Zh$?+;5%i6ECfT?A^~N`o&QHR5@V8a13HuA~omH+0(xm&s zJn#ru(@aCcl%uY66t2-NPi-*^o`hAyJ}I5kdqib+qh*CNP|jg>f!Wj#HJ<4r?4uCX zvkf`dDbhurH>#bk@3|Ap%0+kV-0PkcrZb0Q6)EJKBfaiae*!zLC7wkQ?cY#avSAHH z-b1`V^N9SgFL7-JrVQZS2rsHMA5v)j^@ga==T4XfE9yy6w7~pXILh8O)Le{Zg)9`|o`-$nca zc~hvlgOB$pGXop$oW3PzOuUbE^uRf@bo%^%%GEHQ}3uc0E<9SxbN+Fk6DEin>4 zHcD4f(K{ENOe$J0HJ#urqwE!{iYCcrgQT6kUmRQ&pZsx(U*x5m938GK3cceA-25P7 z?4_>Rtm;@LOJc>-Es0d2lZed7(#_R8eGm|eZ(xhjbvF{TQvs1jaS#K%R>_hqN0n}TZ* zkc089?X9=$pO*FdJ8a~1LwKU&Tl*+PUpFFBdK=aX&m5jxjDg5G1pXXNL&FXtQoDIi z%I2VE+_J15PN$4XB^X2Yje8=^qT3Q6Up)7auJ|SXIn8t2lJM#_5ql$SZ|nXfb&U<5 z+WD;cxsrkAy@tew0gl8PHWX0(qf>97u#=sJz7BD=`gp*W%GmlPa|+rCER@9rjcWg_ zl26OYrAyJyc>(x*jhp9DekXff;UF2NN;Ui}MJ?5ICzv@f9ALbJ?E#ZUr9Ic3 zzA*o$&I=Ta@JfZOEAMmeNUz9k93p!8X=>FBD$#aW*rJBSOJG_{E4u;M3A)vn3ZA*FCGn+Fg(4w7}cEUuvHYjNe3srT? zjGbTt%LY~=@?&|zrxYJ%v<6_xj4<+!VwleU+BF+z4)}b&?KFik zy?KZ%qJSTxm)WSC(-)vC z_LTIFihr!^y%i5PBEEPCOyW1(0O<=Ad}++TAQlUVUet+p^E3c}!Hm6Ker0kttjBIWHFAYVE28@r68QPb>)Vg<;d0ndg zIOg|&%Z^&B5koUj%;;F55>#Cd>y`X1^41GHDSIjVmR%4uBt$XKaBh6+p3un1m6DKK zM5nC$KuQFHa!O+A!tnBN$&WmSvCPz#nQaEXC!g(?sW+Y@AB1kdg2dM^(Gjmzs6*J zi>IYc&r4tXJ{{+;xx*UGux7GmUyf}GKo{&yc+i^CQk+fM5xwnR=XN< z!u~>Gl{|8NtTsKC_us}+!JbSFv?wd*)?I^VPt2vT`c;a6orPS2Qhe`>N1KB~dB}yP zspLQzZ>`?Hbq-7qJC#l@Vh{gOd0-=i*!QkM8LpL1X8-}g1mS#mh6v^#lwH+V0EAht zLRoZn@;eAS)m=80s0Jn#+sLq@zuIq|XFXByZxLIoN4=#LqQuVVkJJJoqdv}YdIi8` za&=Ppx)n$aP&MKW_^PY6l=m-iPXIGakyd*1%=})EsxHySwRk^AE?qcrR8hTjF`nFh z)+UT>wL0VXkVCY=24X|7B}!a=Gf)c2+1jXZ;lwogP%J5l_LHb4lWDj;(dv}Vr1IJ% zBzmFhafX~i#<1bqv&puIYKuHOPY|K%X&v{<{=yTL{$8uDcy(HHi}VDVjHC}Z7W0`b zEvA9p60jBWkkB5Rk#%5BJPS(P7jy(H&ZM=!PzvrzF1=cb@j0B{!WqXMl>4hvAUG#n zJd@sf-hvm66(tgSb~I9O>_*OH9ggr<9(jkPzpUP5U;9oi{-`RXFkT6&7UzshGl7YK z=w!GA{fajfE6<@$!92K|Md|hQp!i-X2J~nt=D;7#M2;}9l3LG<6`3C2w+L(}Swn*C-B*?`-k7j87(HI0e zOg>|2NSSo0G$Db|yJ=}l3XfUHc3P)1NIM4OhMgn9utTLY8mQE#BnS7N{&WXwxbPTC zj>^Vmu=6JO$5zNwB5NNSl0w;}jb@J-VA6wNi{X~PSBBYYx)&mpWiwGyMd~%>340*O<^m+;13xv+nsl@@4vWer8?fJpf?QLDsIAYG$AW; zLaEVbXdlU68j5l)of@<#27i#8e9acN)RqV5SD02bMKnOYW!RB{72(fvCCTBSVi?ru zbgDA#*GRW68N(c0E>5u>u(SP<+gV#x)7`Bp@SBKiVu<5JAQnY_TkLETuOirHXdSvS zvj3FIepQF6dAlF4aI!UHW_6)6yAM7CrBvn^#Qb^(|KMPUas1SycQijlWVnLIlvayxabGnXVuaQ^dHa@y9)=$QZH>SPegN=OO*~ zE)SFDbmX`%K>u)QKvO4)0Q6_1yp?lfgooarhtt<$z~YTO+(JVl(~ASc`owLsRkis`U_?MIJW!nR@Mo{TY+o9Pv7gjq0Br6 z69CC^k3Y>byZiTYSu$_l7lJPB2#srl$j1$McL;9;1JwOOnTj&h4}mWH-Vn?pBA#s3 zjm-omv~5W85u0g%GVKXOn)WQaVM*sXOrslhX;tKH6?3k};k`m#5;f?oYG{A|jfzVI zEawoElA5$S+%=j>B{ljl6OB6dMOtiz$z|zws<7A7tg64qMADNf&^>0E_v(v4Xo_qH zV^U-nQmvG1&4lmI`ITySApjtTHJlbWG-M3T*jAxeFp8eXd~QuT_;Rtxq6gbbb-=tw zoQ(PY91W&wSS2@?%S!N+c&XI*-Qe>8h;>EoRGL|8iL5JVmPFo`8mCcY@G7$%vVy7X z7@ReiXO;L?;tk6Mm3?VrP%a+9@9N45(_m|XD$^pZCLI=|=N&b3Eye{UTf~qseLt&P z!#sl$Vu>mfVC$4UM*S1iA&A8WT0&j2yWtx^d_y<4cNyNemon|ChjXI5IDRb_6+)L6 zHL>y7N+Zt&p4YiL#W9q4j^;U#_Uo|iALm532s#R|g|RtF1ga%u9(|3q*VEV07-Y_# z={jfTg|b)%84CRox5B4Px#rve>wV`e>F+Ihvw2o<_Q-Nv6Oskz6Xf0(P5Qe*HQ7l- zcH%D^p0}1DkU?Oh5Luxsh!wO zKUM!6-)%F>W(*eN%I<=x(m0rDftloG$@?ufi_0FJPvZ3#aSQ)qBP??BlZ)n3kR!u( ztnUxe)+T0*JsBGnx*NQaQ*rbN@u7$&a*QhLA>#~Ru<77+YbIJviqYiex1fq>1{FT# zFdi=DsQwOIHD+foydCEv&;U6m{f)}zJS3hga=b91my!N=YxAFN>}t3rbzl6j(22F3 zN=wsJ^$u!O$eS~g%{1`E%Z4(MfN(74t3fvCmpBFL^Zwb}W|;;%1`>f&|3*$y)Z>cJ zb4L4u3{QiD>q8`;X78t!poKbPNQ3F!N5@gjzIaM@VHUUjjLWq@kvi9sqbqS?nXGE8 z#+GiOoSb3agPl)kT>OYk63q+oSkS>R1&~Kn8mWrR@Ghg2kK(O=B0gr7cqQS&ZU#=n z!fuWk@yB<^!ZQXKgv|$6V&t7P%_Pw;Z6eX>n7u0VO2tT?Md1A_{XTzc4f!^fy@J`@ zL_xHu4pQ2%+0gi2MYpK?iQ^gAY+ZY~Gl4zpRA+4JCqhte=){_!sS#6~-(u2O33{G&qyu-3N|Q&_I& zrYu8ewgXs?(VGq;pSXyDqUfrqm8MV7=*kn-gajV?A&2rCKCU2b%V#8DjIS?*Vby zKbhSHwl(aey@M#B8n8X&2S?C9fc+T=k|2m>1p1jE^8a*p7GPC1+y5t}yFEv0biZjerCkVf)}=vc*AQeLaes5@b#F77Z6qAz%l-99zN7!krPb@WE@*haV*6;&%ac`t z$p+!J!?T5Q(0fA5a}OU8+PZ!Ndhf30kT((m^9FiJ79WS^vcFZ6gGuSj{S`e2Q%u8$ z*$=`FNUwnT3MQXg2wm@iypIy_wtTRvyLm345nt~Hjh{W&yk9bNXi)x$TYOmqRkBjR z62UrkX=#b5CsQ=dI{nd9hLOmmydWim_?39xb1J`JjsCP(>wNM~^8+bwt(VJK^`0=s z%97EYPT=bjs((ZFX-|N_y>DS zvWRyIuDcghz}MpyZE#*nQw|a4uW0zgqtA>*CLBdpjUhRD`mJFRa&;l=cRkT3S(l<+ zO8=_HSCLh~y|ftK(ajUECd|EE=Wy?Hb%c%#nHYPZLw9akcR7u!w5#-PioD>8RhE)< zt{&UjCzWN|o#^vd8j;6KXf=4}kMkCW| zVSxvE=u0vh*r$0-S(9P7Q5CW%^7bKVu=| zk>ZOJ}2*@xw z%?i%k;pi|RUQ44_+hrd+)y{B|7lfBZp}F!E)I)8)h6ld30f2zQD zTA+dMr02cDX+vCzfK9iwIK=x(6Jyzg^uR7;c;;@nWi3y`O@AqwhJ>;X- zN7gfZGgG5gwbGh~E(12E`qln~DWZnEFRDh%yxmP)2=<8>_4(`U0+5>T-4EU{^0T?< z`+eP>KTJFH+2mikxF_l^Z@%c<4BZl2RS?NPZ1r~7eLM)%xk}0y=Acd)Cm(z~Xvwb0 zQk7zx^wnc%U@M7vM_a$zg(1pPLqISuKU(`;+GHB;XjQ`ED5yW)tP!0z#M2FKs+Ds` z@d($Yzm}Bw#6VTT%Ge5*n?cNZ-1wB^I44Q442Ll-=xb?uqN`n``RUrAJG2xmJW}#I zW1SCEJv%R%*ur!4a{!F-lTBUWI$4=GO;;xgrKZ*Jp3sa<>ilJ{rnNT~(~B#*XEmiU z1~Ed`QBgYpk>YsHbLx#%E)o9--i+ZC9f^_7T3q*re!~_iq1d4WhP8%?V(#=QM(g^7 z>2+F74STNRx~BuypUTi!+)M{gS@jyMH($ZDu zKjsY7wy_tY=^3B$W08}!&<@2c!l~K6&#D)VB-K$kGlCyqCHZOrNP@szFIP8$SAP6l zAIjazY5FRXfEyma)Kg?SYc6gqIrvj&$otnW`!RzBpQi4fq)s=P5CdQP@)yndY7bUH zan{vp_Qu7}wY$KTn$j1%Y@h6=n?MZNqDJhm%WboRANR6CQby3{gRzTJfUkwKimRra z>v20v{=}dJ`%D)e01bVn*OnnAnvxkDMidvnnJEF&DTbM&P+`Ujq+6c9syhcdm!joG z*1W2nVX)Y4=7jc_kF3u24hP6*6e_ugdd-Zx2G;^;ugxy^C3B;tZE{9i)S#}n+Tm^Wl z^%KpO#g^>$))G%Ak1-6LUD#ZTRTn(7!9<4(>I$Q9zeW_j9T{_T6J6i{a*yI=rhgd@ z)gG{9+1{|l$zFGeY|`t&%G=$#LakN(kclKjR)UF-Ix%+c&+>+~j$d4Qmb}LruYMO@ z`qpSxlDi`75!wy{eqU`gG<%ZOL3iz#AK@!h!=>|j1B+Oe$GKu9eUZ!k_(1T+S7_kA zbJn;fO_sAts`Puo#$t6E;ze2?q_a>$w#+0nuk}*bYY8_IQmYk^aF^PtEnm9%vS?g- zl=f(*i$v;};DFLu)Ie}{;wBfYcRZ;#gqu}?q$J)G2lLswTD<(sxB!k1pp9in$Y8=k z^3JyAcETT9MmAB~bYMX>W~mpKeS-AdzQ{3eH)NL0Fva9G(r77Eq^5@T^jqfFHlZW6 zX`)orA@BS6J(?KBp+#ABTs)dY-6)A)m=B$=fl;)gp0w5h=kVgFEy%>zT==t#)Oswq zTr?{tmWGWFbDOksn&?;8ZO@~z1|4maoHqnx;)hZai1Oa97qKZ2`=>=Tqbi7E&k^Na zZ{=(CC~B6eo5t-^lBcfd9J7-)zKvBA>K}~;QMU(%+w1B)Tm0HTIfLh#lU;3Yn~+}d zUP0S|jo8kZ7+vu!d=$BZlVeRdZn#XTYejHx3KQ;O9%HU#dW(r^FcXBZC(y~Sm~%N} z2AJNk$S5a5XzSgPM7Rj`gO_&{#IQ+BaJI7%Cg(lRcrdBsB{DM zT8d*WSa9l7$|3s+xddzetVv2FvHpTmi>HO0ST5olCxQvl(GCf3Q9y&j7i|TuS52RC z$Mq$-RNqf4At8+FuTKP}#H=tDX#`r?5dsa5dEA@$R5+ZaAl)jTIpWtmtDot`nN#*n zhU~NvwXJ2@?Ng4=Ga)ngqKekQp9>riEd9DzgA}4BUwqIm0%Wss9jHUl$nKYqO;2N7 zknpSn9IQrcJR>i>8i4TbCiE{yOjELbLUDeF)~y3Xq^W(@CXkZSMd`R;HHADm=DLkJ zS;1I$?g$Acj(p>KT3D?`z_4LUo}Uvij?k=_H9S~+>bx^)AG{@fB`}K$xi6WJ!FPJGW zB~LoXg!SC`+S#|tF_WQeoMF^8u?W?f)9v=3VwpXM#@dD`br&6k3%WzaC(pjfR0`fM zChRRAn~rhB-s|T5e1XI1$7!j+-kyB4Yw?uPR@@9KfpTk%nATjRS13yeX_R>U?NRR* zYr(<$9=%ADVmjc*1V?@FRwNrtIjAjb6~xw zC-sWFLtc2tkj`HGvT-)9R$lY{zLj=HPa%BG;Eej@!{!SgZ7uQSkiTpuyam5P z5rGi-YQWO|GMX=FapkU`5NRBgpyZCbC47f9)TZ5%PIz1ivCfeoh~;Vbi@p|Pw7gM> zwb+um?aH84>hd{#m`B&9Hw?kAeS3;L=R7r;t*zfqC&7JCTJ}UUynqaE9fG)Oeo+9~ z<)#K&_ox+Nw&lB+9i|2E!p?w#If|`6#-*70{+ZT9cyNps75*mHJhbjb(M$RiL#Im7 zkt@=c&>5xhMt!=^u@mJ>AD$D_6u+1VyRkNNNm4B-5;&h9$MT0M8s71AN$h*tvfb!k&(H`x-=+RpQI>om@b>eBy%{M}3KN2#u_7ZsoV&Xy#uDxoRl2 zhZ9oKR?*q};PbY(m7gWgt{z{7YV^%w zc`Y^X^W2*`zFzR@pZ`FAYXD7ajJxrE>}I9XGO?tURZlH3Izhh)mjN#;L|i9=q<*Nz zeJ$l3es%o;Vkm2YSg0p_sEJfD;4905eJ~)3KL*>sr?_0fwyGKtmV*Mx?gOY(=^nPy z75*rmkv2($3TAtHYhv>G)jB4hBOwj?+DEI7B7nKguhhz2Yd1 z5R{LN%C|hj+rB0#%?eMKUp2KkGARiM^w%6HC3B_ajcD)SC*>BKm^LzSenJ0Ao&OwF zP*SjP9n;qLfKIW#zSsN6#KjQ=N9BF<<&EVWEqo{0Wy95oba_&mA2}DQZ?GFIAE4+$ zTSWyjBPuJ{I>+2{`XjGQUK|-8z?*tIei@>sC0eceal?yJ)H4CGLcpm&tzj$W8yN`# zWW`Z58t<@KB$*M=mUB3S1Ewuu;KvZt)Q44I^sc9(<6KD zz8jzDcL^6W2q>?&+~@GAhGm!bSVyKo4FcZIG@w+Qpt=z*Ug35;iTEV_r3KuuIY@AP z86i%AyiC(GJ?msLDzV2q&uEWf<036blx`(bK34rhL@TD$CD~KAPmc@j?tv4i(U$`9 zcWk#E6!Y?LEsmMJ0&nlU1XdZxd)a(3uMfNLXuUp;?^_>tzV(jaTa$0?-?6+ps6I8M z^B+WMTXsb|tcon?N_dCOn5B9n=!X7x%?0 zTWoPArre~5nAqwvGIZK;G@h1ctA0q9aR>+@?}8?$AnXuMICs=!+GRwXA9E?Tb*cs~c2&|aJbq|eJ7f#q| zoxW$gW$NCNCCs5dI)Z^%IkU1tA%66_qyJRWe0$h5=C+eor|YD9VtX=mo9i~)qd6;iM;BM3`Er9%Vbh*xkQP$9s^g?<6<&loxpnjh84ZhlM9LxMJBc zLXJ0K3!L}(&LVO@gM{JDV-#1QVN~`dv!T2 z2Qn;Li&$}sd(ekuw=gm4*!C?zfH%!{5U? zO_#Y7qV!K-j*(lr3xK97+d&CUgC{~Jh<6M)O$r&FwN{1 z20nbi=4jRBh^n!*wjSy8azByNjBI_hrIYM>2DjX@lKe#Cjb~HNQHwH_8rD&4I!0l; z_yD1aD4HlIRpaTe{;-Dp(o62$P92GK;Vp2_eF?x?niw86wX|gzR^&6S9>(;XlZu!P zg%R|xezBab&$a_p^tvy_W@JtUC?XN}cgE^{$r@Jj0O-eGw1y~*_g%tgOnARkghNuL z-{~{vK;QbpL8{T(kM6bO^)h}ux~es@-LTd;R=9)sxy<}5O;v>vrHj%91Z$l;<`Y(w zbdlOcHl_DeY2!3@#q;ILT9*;B7%PjE-TI@nj;lVk>o~L@x38XcbQ>sb4Q_ergjle2 z=1TP)RfEaI9>j4(%Pj#eMlOU;E^SAsx1HlY$8Ha+YL5x9-9of5SP~`Q!TTkHjuEe( z^@Be9fgW2rMRKH_{6?-ncAL`peXi#-uUai?&<79D<|qcq#{*VhfR0^Bu#$m}waU-a zf?oVYeZ&@3KR+@Wsj@7H(vYJuPF8)?g;g1qgAbPp;Ih|4hUftITYkRimR-QPGaWd7JcGhKSRpMGT&ZPF3KZi+UYK+VsaLymr zv>(Eeqzvw$N+M$wu# z>3e49=_k#bazg|41_rGVT0nT<(dcOP7(s1Ur0>eqr0e92dZHT8*{A<=?8f_)wMpo0 z{|aanXhtrN0z4$6y^uuRVHQ*`pV$MvaOW$EvoxJGG@+{pg z{B(^TDMUY~v>>L4)O#sr#wBegOIOE&*2iEbQW`BhEFF0u>@prRi!1xGtL|1g#KAS$ z2z`cSn6L;ja0_%*HV*2mK3AE;kjTw^YqTooD;21_$*D_&YbZt7kr0YIgDiIM+h3av zgXsG{{f0}-p6NrnC_K3|jZ}V2#|Q~}&q&yQGGhGuzGQpOxN92O13je4X(I|k==cr~ z){SHv(u91WcbB0wZRt+%i7bMlv;!;=?yyQRrb<4vGj{OKNm9nxng!4NsvZZwIjObb z@KC~nsdPY69@6BqZ5_xo2)t2U7f?&S-~;ZL?M-P+2NvUqJyv1rd0k&{^ggm|X#DvU zA1-EY8=0$XfC4GdfipYcF7$esav-K`gw%(SpA#*Orbj6niv@8kHC8^~J1)}`9(X#r zWe+dN@#5LahIxdUkkOvtdVCuX)hsK*ev-=yc~?~I&5QnUdA&FOi2aQH#JHqpMANea zI;p)iNmoZdlH(Y%N7`Q z$tJQ{7&y_+s7g)E&Jh({721M{ps2~O(9SBcraCmcZ0}dc5$rEJ!v9Pbl&6ubxH@S& ztYob|2_`2;c^Oa>H*AXv!H4p7jIMDi7;0~m>)a$fmh^tqSUKkGutJV0J%@winXVE} z1%Efz)uZZ}4@jH2eb^k(9K)`8{RrURx2bPm4BcAoetOQG1Yd9lGtN|#HSUjX16N>h zgp&z_RHqL2#CB%Ab+D{k$HbPfS>)o3Tge}(!1u2$?BrpEgXExq>_cGo??dcNzwR(V z`2az=)m9(}T9VsMQ)TcvTmoO*co=y?Ehmv68vM8`XAYc}We zjk&~={oCs$W&`ksP}g8;6e0#Qzfi1(I;sI<8?wAN#=S{q>b48Z8FtBqMe3Lo?t!EY z^itX@b~44Vwu5KIb~f1^NSYKTZoKLnZZe6uiSTR9JbuYG=>r+hd$|$O8?Z9?6eW!k zTvcHux%(;faiU}^r84lESQ4bMI=%MtQE>xOs(mCe>RrTGIvDfQnE0D5LQjK%wz@pq z{80dAMVzvl{BgUGwK)lIPb$1`LijJNSCwa+)WkhJcWqqlj9V`-C$fYU5EheRA zYafq_r_hB0^C}Z2UoB0XSs!8%AUq)yVUO) zwX6RI_&)zfJ?O}QN})B zszeLFN+26+QHH@RthaWS#8B>Gj$1KjY3qnj(efg95O48)}Hn;x28!H&jZ`_1+LeOo1{$L zw1a-o%V@mzgD3f2q79xeeEC1aKOyC7B61gS*S?_Zh`&^p>&?}@RO{q0!(DW^ec6;M zYT#36iu`t^u4YK394UnkPHrG6(vS#2#W7^a)DseTl(SK{_mRx$SSO(;R_bGn<;tZ{ z)`77$`ig8YMyqtHF!Oe^VW=Tk_L10)5Fg6Lmp5r4<(4)Vuimrx8er5B(n2pC(7r5? z#p<4o`2yc+!ZWADaFv&@35Yi_ve!%T@*JOz%$|SD0Vg&dWx_ie8OD<1#3l8(_F|Jo zCmXF1Uv%5xfF-Fk3?4k)4sbvl&!T!idJn0sbY#s!A+COh21I8hGu6fXK(MHhwc<^7 zjk#}tUy&wBpV8PzVY|f#+K#Y!YbCTm*g~AP zgs!E>RURoH8CYZ1E6;(H%K|7or+2N9^-bbqr-9b9nv)Xdd--LXSApu89O>+r&{j(e zsoCK3=YM5>U@;s1%m%t8n8Ez6Tl$-szkla^0A(mQvov>gGWtbU4d3`(1<+GX_por* zJEnKK!ZAfXWakj?oanK>w98Y9u$CH^O}GD3ny%d#s%lo*wAAtBn7P_V4@?f6B`EFdP27|nUbv{J6fxz z&di#|ozz#*%c7NKR-|Rr$zJ`G^W7UZb$KrG$#u0iQ!4Pom1;dBDrR`K5>p%fuIim| z)uO7-JkL@}EF$p2sMc%(@TkgyPCk7K`eakofj`y_h6>Tv{FFOv?|n8K1nWY~c$J7O zo$OnJ8VwVPt8`m#*V2+6*PL2&p-b36MazIZ^`hSGmUdct9ltF~lGm8yY_CPrcVPqF zbm=0sw{Pc%=v4NPkOWx#dk#Lxd4?Z0s9pr?U_k))RlmZg8}zO3szcme$P5m32;ToK?74f|_(j%4_CBhdvdOZ zAAS*wBz1AnzmDxfU@^OsTn#5a;%Jrku_al3e{

1bvi{DS7E@q1{$_8->K{_OWv2 zCZTgG2Pr3n8|ec9kIu&uC|d?k4-cQ4#}Z`qDX5Y2mhC(jR1Ms;UG4Ho$DE|+SeJ@{ zJQQhAXj|<)*t3KiOWTuh{Wd^mS{u{&ERV)OpZwiQ%#1->r9p zSK_^*U~=?ywH~4IUxb}{0J!SmL!z2Tzq_PpetoC^_az1JFg0=gMcQADuOP%3=H1hH zH_=dG(PD;d*037Ov5G1924U#Zns?~fs+eh1%-bWqa%ssm3=nio1r3J<4G0IBETtr? zycs~0JIOn;MecYG=~OQsYHIrf?~A5>_ob%8+uOrVA+VCJw}{lygrBBdY1k<8B^wf6 zl|<%N$7)fOZX$%y>4ueco_Gb1H@B%XrKVwrn6hUOecnc^PU0rFuCB5=*2;|u-`o(@ zL*tr4bnQzXYLc4XqFbv5sK0}A)`}`8iM8ehtj#Oc5DrE;0VxbPmL@BUa_BQwa$EW~sU#-LP0?sGmqfUGhGWcciGZ*4(}u3z=@b>Ow9DQe7lcO3K}BG3j(t& zH10>sK!&4Q5-=gN@Nxj6{|*nuyqw7KZJ1?p)NUJ?U0bOigGdsOk}Iz&9PmN_5=W*Z9M zy^pA`&dX0oo6?CSuhE~(pYbLuTPp1a1Fa@e3Lu&mmgd$;D}&g-i=D-{sv?J9kIr9r zrX&Z)aFGK^kNY{LxrotP0}k*;uN12i_2a_JJhKwh zBt{D-JRxC$8U+-`u1xD>gJ^H4lbW;7spI-=H506i=ncdK;xq*L6f7jVz$XGMg5aQk zHRJY&$@g}i_SP##iC?lR?ltnWUTT-UDlq(*BTQaYNkg zNG#sNoo{WmP+Vl}U~?+T?g25b$E-7iwhu=VVgw3JdFXm~ba+LC4p>CP3~rNTiNBl7 zL{RfLLepNPEtZj}yL_#R{(^MqIlG)c0Va}>U|9Pl&B_3tV;Ps{r)WqBznD7FcTlP4 z`JQe2DvGhmeeHGGX39zGyOOxZ3tq~Dft(BQ;mDXwwJi?sBtxo$Gf1SS2w*eQ0p&RVMNVi@d zY8v4J0(n}%6*Rw(g~l@sUuxpiJ*Y}7TzBQyU+>-qWm*InUeGt@)T9g^0J#z4){Lw* zT;69if~U9DXBR9fgVPlYy7aDhJU)gDC?_GHQtwa6QXNaah7-CzA|Fx-lH7d@N9>38 zX(F&fd3w7AkZ+ha8-gKfX%@_~<#HDs?kBg5zW>V3%Xw5jwPs6uni{7r zd`EfPYrA*SU;xDtm@E>5TrJKlg5o=h;NSXk)pt4K)GbpP0xkUg>2o|oG=`UnX7^Un zb&@8d6Fj1cBWW^c(K#Csc8xEBa4KfHY>8Lp^77-lhzgWr9kR9_p+g|-9r?VSv?qA%^1O;cqgke)%AqHlR$B{!Y1Mq zj|)Ecg?{_!>kGDAwGa7%cwSUb{BcayJihkv$}ql+yu=O}jVvAFdC{Hjh$4}u+$mx% z5V$sUiGCX%D3A>bKwY8HR)Gv*lisI4q^3vJ*nDwj|mtr!0r!~+Qoe2cw^jPCXkT7tI*01|w@ z&gPC`?O1w7hQ%=&bcHi7(fqhY3${~JepA7y@^aLwHpew^Yk$;R4v{ASHjXjXtaTc_ zuz5*nXB&PrcyWx#gQ%?HyxawmS+Wu(7ssvB1UMh!1$to&o(mv_f=9~!9@VsJCGxpu z`>g5Sp=xDhpsiCy^y>=fI0DON$&pb7o7^d{@@&hj3!6PUd=vA;G;#7&8ChamsE{`^ zY8pDra8Jntp62Ivi)Y`*XbpM60s06v@Rz^-g)TW_F@B!~y7!4AJ>37mAuz!(!C+xQ zSR61?u!{N|qHWOeR%$RXRL~vpN0SGri7-klNHEJuivbi=0qSbdV4&ghf4i|7?$>z( zI{qH?i}`~a7GyB6|8pZRq982+P*r1+m-t&(%U5#ZWFQd-(CXKLHeN@y(c z;wqq1hzE@q1b$GG0VQ_)`{MeylBlVfy%UHR=;Z98>T3M&;{0i?+0T-Bck?I)AUQrz zeF**_iGu$JlCpLnFv`D9?q6R51jKPM{Rd6!0FF#KP=O|b3iQX*TqXSjO?gXaXAmLr zU#g&%@+XpjVArlGkfaPKk^PUSnMLsjlK<9nH*zxl^V2-jGC$4+HGE%?F3%4|y9>HN z|FJgz*HW$VwU8$RNtuBf(2vdZhW3x;R6%eoJM(|2zvKebxCh$s5J-*fhZ75B_yeUs zFTrToFiB^SNH?gV2>l?G&h!UD>UP%uKh1L;Er59!q&NoZRe$VEf?5Ar^&iUad&2gQ z&WE`E%lTg=_3XQT@gJOjkAi-Hbbqrl{(pA<>_GH4O8+xI^=IAhS#v+$vmgOK=>C!~_xFg-pLM>6kUfy=zL|u~KkNJ< z$L?p*?;%(Ze6w%%M(zjE|4dH&5$)_}mG3z{KUQ6s!Y@_+kInPH;kAC&{T^5HKmqz@ z@+!aA{YNIy&r;uKTz=r6e6v>d-%9<%_4R!+-iN^8H#0N(rQbiu-u&}-|2`q@k1agM zdHkW_1&%VDD_|I;NpK*OZfAjAb z`Ttl8km0{|{F`kWKWltH$^Ech;G2y`{7&N^%H;d0$cGv7Z^oJNOSiwAFaP<=em}wX z<8AA6<}bbeZc_7S=ii6PALi)3nOXL)o&Uj%-OnQ52M&L%(%ZaWiu^(R{b!Bu2WJl< h$Zw`p^gE5e2}ml*LW4$nU|{5+pXG<~Ugg7I{||-5t(pJ; literal 0 HcmV?d00001 diff --git a/android/core-jvm/gradle/wrapper/gradle-wrapper.properties b/android/core-jvm/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..c61a118 --- /dev/null +++ b/android/core-jvm/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/android/core-jvm/gradlew b/android/core-jvm/gradlew new file mode 100755 index 0000000..739907d --- /dev/null +++ b/android/core-jvm/gradlew @@ -0,0 +1,248 @@ +#!/bin/sh + +# +# Copyright © 2015 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/android/core-jvm/settings.gradle.kts b/android/core-jvm/settings.gradle.kts new file mode 100644 index 0000000..ef0b79b --- /dev/null +++ b/android/core-jvm/settings.gradle.kts @@ -0,0 +1,6 @@ +// JVM-only project over android/src/core: the pure Kotlin core, tested without Android or Nitro. +rootProject.name = "core-jvm" + +dependencyResolutionManagement { + repositories { mavenCentral() } +} diff --git a/android/core-jvm/src/test/kotlin/AttributesTest.kt b/android/core-jvm/src/test/kotlin/AttributesTest.kt new file mode 100644 index 0000000..afc174f --- /dev/null +++ b/android/core-jvm/src/test/kotlin/AttributesTest.kt @@ -0,0 +1,32 @@ +import com.callstack.otel.core.AttrValue +import com.callstack.otel.core.SeamAttribute +import com.callstack.otel.core.attributesOf +import io.opentelemetry.api.common.AttributeKey.doubleArrayKey +import io.opentelemetry.api.common.AttributeKey.doubleKey +import io.opentelemetry.api.common.AttributeKey.longArrayKey +import io.opentelemetry.api.common.AttributeKey.longKey +import kotlin.test.Test +import kotlin.test.assertEquals + +class AttributesTest { + private fun num(v: Double) = attributesOf(listOf(SeamAttribute("k", AttrValue.Num(v)))) + + @Test fun wholeIsLong() = assertEquals(1L, num(1.0).get(longKey("k"))) + @Test fun fractionIsDouble() = assertEquals(1.5, num(1.5).get(doubleKey("k"))) + @Test fun bigWholeIsLong() = assertEquals(9007199254740994L, num(9.007199254740994E15).get(longKey("k"))) + @Test fun nanIsDouble() = assertEquals(Double.NaN, num(Double.NaN).get(doubleKey("k"))) + @Test fun infIsDouble() = assertEquals(Double.NEGATIVE_INFINITY, num(Double.NEGATIVE_INFINITY).get(doubleKey("k"))) + // C28: Number.isInteger(-0) is true, so -0 is intValue 0 (the reviewed odd-attributes contract) + @Test fun negZeroIsLong() = assertEquals(0L, num(-0.0).get(longKey("k"))) + @Test fun beyondLongIsDouble() = assertEquals(1e19, num(1e19).get(doubleKey("k"))) + + @Test fun wholeArrayIsLongArray() { + val a = attributesOf(listOf(SeamAttribute("k", AttrValue.Nums(listOf(1.0, 2.0))))) + assertEquals(listOf(1L, 2L), a.get(longArrayKey("k"))) + } + + @Test fun mixedArrayIsDoubleArray() { + val a = attributesOf(listOf(SeamAttribute("k", AttrValue.Nums(listOf(1.0, 2.5))))) + assertEquals(listOf(1.0, 2.5), a.get(doubleArrayKey("k"))) + } +} diff --git a/android/core-jvm/src/test/kotlin/FixtureExportTest.kt b/android/core-jvm/src/test/kotlin/FixtureExportTest.kt new file mode 100644 index 0000000..76eaba2 --- /dev/null +++ b/android/core-jvm/src/test/kotlin/FixtureExportTest.kt @@ -0,0 +1,37 @@ +import com.callstack.otel.core.OtelCore +import java.io.File +import java.net.URI +import java.net.http.HttpClient +import java.net.http.HttpRequest +import java.net.http.HttpResponse +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertTrue + +/** Every seam fixture through the core into the live collector; fast-jvm compares the `android` artifacts in Node. */ +class FixtureExportTest { + private val collector = System.getenv("VERIFY_COLLECTOR").orEmpty() + private val http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build() // Node http ignores h2c upgrades + + private fun control(path: String, body: String = "{}") { + val req = HttpRequest.newBuilder(URI("$collector/_verify/$path")) + .POST(HttpRequest.BodyPublishers.ofString(body)).timeout(java.time.Duration.ofSeconds(30)).header("content-type", "application/json").build() + val res = http.send(req, HttpResponse.BodyHandlers.ofString()) + assertEquals(200, res.statusCode(), "collector $path: ${res.body()}") + } + + @Test fun everyFixtureExports() { + assertTrue(collector.isNotEmpty(), "VERIFY_COLLECTOR is not set: run through `bun verify fast-jvm`") + val fixtures = File(System.getenv("VERIFY_FIXTURES")).listFiles { f -> f.name.endsWith(".handoff.json") }!!.sorted() + assertTrue(fixtures.isNotEmpty()) + for (f in fixtures) { + val name = f.name.removeSuffix(".handoff.json") + val (config, spans) = FixtureJson.parse(f.readText(), collector) + control("begin", """{"scenario":"$name","platform":"android"}""") + val core = OtelCore(config, testMode = true) + core.handOff(spans) + assertTrue(core.flush(10_000), "$name: flush timed out") + control("end") + } + } +} diff --git a/android/core-jvm/src/test/kotlin/FixtureJson.kt b/android/core-jvm/src/test/kotlin/FixtureJson.kt new file mode 100644 index 0000000..781e835 --- /dev/null +++ b/android/core-jvm/src/test/kotlin/FixtureJson.kt @@ -0,0 +1,80 @@ +import com.callstack.otel.core.AttrValue +import com.callstack.otel.core.CoreConfig +import com.callstack.otel.core.HrTime +import com.callstack.otel.core.SeamAttribute +import com.callstack.otel.core.SeamEvent +import com.callstack.otel.core.SeamLink +import com.callstack.otel.core.SeamScope +import com.callstack.otel.core.SeamSpan +import com.callstack.otel.core.SeamSpanContext +import com.callstack.otel.core.SeamStatus +import com.google.gson.JsonElement +import com.google.gson.JsonObject +import com.google.gson.JsonParser + +/** Test reader for verify/fixtures/.handoff.json; NaN, ±Infinity and -0 arrive as {"$num": ""}. */ +object FixtureJson { + fun parse(json: String, exportUrl: String): Pair> { + val root = JsonParser.parseString(json).asJsonObject + val c = root["config"].asJsonObject + val config = CoreConfig( + serviceName = c["serviceName"].asString, + serviceVersion = c.str("serviceVersion"), + resourceAttributes = attrs(c["resourceAttributes"]), + exportUrl = c["exportUrl"].asString.replace("", exportUrl), + ) + return config to root["spans"].asJsonArray.map { span(it.asJsonObject) } + } + + private fun JsonObject.str(k: String) = get(k)?.takeUnless { it.isJsonNull }?.asString + + private fun num(e: JsonElement): Double = + if (e.isJsonObject) e.asJsonObject["\$num"].asString.let { if (it == "-0") -0.0 else it.toDouble() } else e.asDouble + + private fun time(e: JsonElement) = HrTime.of(e.asJsonArray.map(::num).toDoubleArray()) + + private fun value(e: JsonElement): AttrValue { + if (e.isJsonArray) { + val a = e.asJsonArray.toList() + val first = a.firstOrNull() ?: return AttrValue.Bools(emptyList()) + return when { + first.isJsonPrimitive && first.asJsonPrimitive.isString -> AttrValue.Strs(a.map { it.asString }) + first.isJsonPrimitive && first.asJsonPrimitive.isBoolean -> AttrValue.Bools(a.map { it.asBoolean }) + else -> AttrValue.Nums(a.map(::num)) + } + } + if (e.isJsonPrimitive && e.asJsonPrimitive.isString) return AttrValue.Str(e.asString) + if (e.isJsonPrimitive && e.asJsonPrimitive.isBoolean) return AttrValue.Bool(e.asBoolean) + return AttrValue.Num(num(e)) + } + + private fun attrs(e: JsonElement) = + e.asJsonArray.map { it.asJsonObject.let { a -> SeamAttribute(a["key"].asString, value(a["value"])) } } + + private fun ctx(o: JsonObject) = + SeamSpanContext(o["traceId"].asString, o["spanId"].asString, o["traceFlags"].asInt, o.str("traceState")) + + private fun span(o: JsonObject): SeamSpan { + val scope = o["scope"].asJsonObject + val status = o["status"].asJsonObject + return SeamSpan( + context = ctx(o["context"].asJsonObject), + parentSpanId = o.str("parentSpanId"), + name = o["name"].asString, + kind = o["kind"].asInt, + start = time(o["start"]), + end = time(o["end"]), + attributes = attrs(o["attributes"]), + events = o["events"].asJsonArray.map { + val ev = it.asJsonObject + SeamEvent(ev["name"].asString, time(ev["time"]), attrs(ev["attributes"])) + }, + links = o["links"].asJsonArray.map { + val l = it.asJsonObject + SeamLink(ctx(l["context"].asJsonObject), attrs(l["attributes"])) + }, + status = SeamStatus(status["code"].asInt, status.str("message")), + scope = SeamScope(scope["name"].asString, scope.str("version"), scope.str("schemaUrl"), attrs(scope["attributes"])), + ) + } +} diff --git a/android/src/core/kotlin/com/callstack/otel/core/Attributes.kt b/android/src/core/kotlin/com/callstack/otel/core/Attributes.kt new file mode 100644 index 0000000..7108ad5 --- /dev/null +++ b/android/src/core/kotlin/com/callstack/otel/core/Attributes.kt @@ -0,0 +1,25 @@ +package com.callstack.otel.core + +import io.opentelemetry.api.common.AttributeKey +import io.opentelemetry.api.common.Attributes + +// Number.isInteger(v): whole and finite (-0 included). Long.MAX_VALUE as Double is 2^63, hence the exclusive bound. +private fun isLong(v: Double) = v == Math.rint(v) && v >= -9.223372036854775807E18 && v < 9.223372036854775807E18 + +/** JS numbers become `long` iff Number.isInteger (and they fit), else `double`; the same rule on JS, Kotlin, Swift. */ +fun attributesOf(list: List): Attributes { + val b = Attributes.builder() + for ((k, v) in list) { + when (v) { + is AttrValue.Str -> b.put(k, v.value) + is AttrValue.Bool -> b.put(k, v.value) + is AttrValue.Num -> if (isLong(v.value)) b.put(k, v.value.toLong()) else b.put(k, v.value) + is AttrValue.Strs -> b.put(AttributeKey.stringArrayKey(k), v.value) + is AttrValue.Bools -> b.put(AttributeKey.booleanArrayKey(k), v.value) + is AttrValue.Nums -> + if (v.value.all(::isLong)) b.put(AttributeKey.longArrayKey(k), v.value.map { it.toLong() }) + else b.put(AttributeKey.doubleArrayKey(k), v.value) + } + } + return b.build() +} diff --git a/android/src/core/kotlin/com/callstack/otel/core/JsSpanData.kt b/android/src/core/kotlin/com/callstack/otel/core/JsSpanData.kt new file mode 100644 index 0000000..89f5aef --- /dev/null +++ b/android/src/core/kotlin/com/callstack/otel/core/JsSpanData.kt @@ -0,0 +1,81 @@ +package com.callstack.otel.core + +import io.opentelemetry.api.trace.SpanContext +import io.opentelemetry.api.trace.SpanKind +import io.opentelemetry.api.trace.StatusCode +import io.opentelemetry.api.trace.TraceFlags +import io.opentelemetry.api.trace.TraceState +import io.opentelemetry.api.common.AttributeKey +import io.opentelemetry.sdk.common.InstrumentationLibraryInfo +import io.opentelemetry.sdk.common.InstrumentationScopeInfo +import io.opentelemetry.sdk.resources.Resource +import io.opentelemetry.sdk.trace.ReadableSpan +import io.opentelemetry.sdk.trace.data.EventData +import io.opentelemetry.sdk.trace.data.LinkData +import io.opentelemetry.sdk.trace.data.SpanData +import io.opentelemetry.sdk.trace.data.StatusData + +private fun traceState(s: String?): TraceState { + if (s.isNullOrEmpty()) return TraceState.getDefault() + val b = TraceState.builder() + // the builder puts each new entry first, so add the W3C list back to front + for (kv in s.split(',').asReversed()) { + val i = kv.indexOf('=') + if (i > 0) b.put(kv.substring(0, i).trim(), kv.substring(i + 1).trim()) + } + return b.build() +} + +private fun contextOf(c: SeamSpanContext): SpanContext = + SpanContext.create(c.traceId, c.spanId, TraceFlags.fromByte(c.traceFlags.toByte()), traceState(c.traceState)) + +/** + * A finished JS span handed over the seam: the frozen [ReadableSpan] the native BatchSpanProcessor queues, and the + * [SpanData] it exports. Everything but the span context is computed lazily, on first access from the export thread. + */ +class JsSpanData(private val span: SeamSpan, private val resource: Resource) : ReadableSpan, SpanData { + private val context by lazy { contextOf(span.context) } + private val parent by lazy { + span.parentSpanId?.let { SpanContext.create(span.context.traceId, it, context.traceFlags, context.traceState) } + ?: SpanContext.getInvalid() + } + // API SpanKind and Java SpanKind share their order (INTERNAL, SERVER, CLIENT, PRODUCER, CONSUMER); OTLP's +1 is the exporter's job. + private val spanKind by lazy { SpanKind.values().getOrElse(span.kind) { SpanKind.INTERNAL } } + private val attrs by lazy { attributesOf(span.attributes) } + private val eventList by lazy { span.events.map { EventData.create(it.time.epochNanos, it.name, attributesOf(it.attributes)) } } + private val linkList by lazy { span.links.map { LinkData.create(contextOf(it.context), attributesOf(it.attributes)) } } + private val statusData by lazy { + StatusData.create(StatusCode.values().getOrElse(span.status.code) { StatusCode.UNSET }, span.status.message.orEmpty()) + } + private val scope by lazy { + InstrumentationScopeInfo.builder(span.scope.name) + .apply { span.scope.version?.let(::setVersion); span.scope.schemaUrl?.let(::setSchemaUrl) } + .setAttributes(attributesOf(span.scope.attributes)) + .build() + } + + override fun getName() = span.name + override fun getKind() = spanKind + override fun getSpanContext() = context + override fun getParentSpanContext() = parent + override fun getStatus() = statusData + override fun getStartEpochNanos() = span.start.epochNanos + override fun getEndEpochNanos() = span.end.epochNanos + override fun getAttributes() = attrs + override fun getEvents() = eventList + override fun getLinks() = linkList + override fun hasEnded() = true + override fun getTotalRecordedEvents() = span.events.size + override fun getTotalRecordedLinks() = span.links.size + override fun getTotalAttributeCount() = span.attributes.size + override fun getInstrumentationScopeInfo() = scope + @Deprecated("otel-java deprecated API; still abstract on both interfaces") + override fun getInstrumentationLibraryInfo(): InstrumentationLibraryInfo = + @Suppress("DEPRECATION") InstrumentationLibraryInfo.create(scope.name, scope.version, scope.schemaUrl) + override fun getResource() = resource + + // ReadableSpan: frozen, nothing to mutate + override fun toSpanData(): SpanData = this + override fun getLatencyNanos() = endEpochNanos - startEpochNanos + override fun getAttribute(key: AttributeKey): T? = attrs.get(key) +} diff --git a/android/src/core/kotlin/com/callstack/otel/core/OtelCore.kt b/android/src/core/kotlin/com/callstack/otel/core/OtelCore.kt new file mode 100644 index 0000000..0b5493d --- /dev/null +++ b/android/src/core/kotlin/com/callstack/otel/core/OtelCore.kt @@ -0,0 +1,56 @@ +package com.callstack.otel.core + +import io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter +import io.opentelemetry.sdk.resources.Resource +import io.opentelemetry.sdk.trace.IdGenerator +import io.opentelemetry.sdk.trace.SdkTracerProvider +import io.opentelemetry.sdk.trace.export.BatchSpanProcessor +import java.util.concurrent.TimeUnit +import java.util.concurrent.atomic.AtomicLong + +// ponytail: minimal config for Task 15 (R12); Task 16 adds tracesUrl, headers, distro attributes and URL validation. +data class CoreConfig( + val serviceName: String, + val serviceVersion: String? = null, + val resourceAttributes: List = emptyList(), + /** Base URL; `/v1/traces` is appended. */ + val exportUrl: String, +) + +/** Test mode: `0b…` IDs, the native counterpart of JS `sequentialIds('0a')`. */ +private class SequentialIds : IdGenerator { + private val t = AtomicLong() + private val s = AtomicLong() + override fun generateTraceId() = "0b" + t.incrementAndGet().toString().padStart(30, '0') + override fun generateSpanId() = "0b" + s.incrementAndGet().toString().padStart(14, '0') +} + +class OtelCore(config: CoreConfig, testMode: Boolean = false) { + /** The one resource of the app; in test mode built from config only (no `telemetry.*`). */ + val resource: Resource = (if (testMode) Resource.empty() else Resource.getDefault()).merge( + Resource.create( + attributesOf(config.resourceAttributes).toBuilder() + .put("service.name", config.serviceName) + .apply { config.serviceVersion?.let { put("service.version", it) } } + .build(), + ), + ) + + private val bsp = BatchSpanProcessor.builder( + OtlpHttpSpanExporter.builder().setEndpoint(config.exportUrl.trimEnd('/') + "/v1/traces").build(), + ).build() + + /** The native TracerProvider; JS spans join its batch processor. */ + val tracerProvider: SdkTracerProvider = SdkTracerProvider.builder() + .setResource(resource) + .addSpanProcessor(bsp) + .apply { if (testMode) setIdGenerator(SequentialIds()) } + .build() + + /** JS-thread work: wrap and enqueue only; SpanData is built on the export thread. */ + fun handOff(spans: List) { + for (s in spans) bsp.onEnd(JsSpanData(s, resource)) + } + + fun flush(timeoutMs: Long): Boolean = tracerProvider.forceFlush().join(timeoutMs, TimeUnit.MILLISECONDS).isSuccess +} diff --git a/android/src/core/kotlin/com/callstack/otel/core/SeamModel.kt b/android/src/core/kotlin/com/callstack/otel/core/SeamModel.kt new file mode 100644 index 0000000..c57a599 --- /dev/null +++ b/android/src/core/kotlin/com/callstack/otel/core/SeamModel.kt @@ -0,0 +1,44 @@ +package com.callstack.otel.core + +// Mirrors the Nitro seam (src/native/Otel.nitro.ts) without Nitro types; the Android adapter converts. + +/** OTel HrTime `[seconds, nanos]`. */ +data class HrTime(val seconds: Double, val nanos: Double) { + val epochNanos: Long get() = seconds.toLong() * 1_000_000_000L + nanos.toLong() + + companion object { + /** Never throws on the JS thread: missing elements read as 0. */ + fun of(a: DoubleArray) = HrTime(a.getOrElse(0) { 0.0 }, a.getOrElse(1) { 0.0 }) + } +} + +sealed class AttrValue { + data class Str(val value: String) : AttrValue() + data class Bool(val value: Boolean) : AttrValue() + data class Num(val value: Double) : AttrValue() + data class Strs(val value: List) : AttrValue() + data class Bools(val value: List) : AttrValue() + data class Nums(val value: List) : AttrValue() +} + +data class SeamAttribute(val key: String, val value: AttrValue) +data class SeamSpanContext(val traceId: String, val spanId: String, val traceFlags: Int, val traceState: String? = null) +data class SeamEvent(val name: String, val time: HrTime, val attributes: List) +data class SeamLink(val context: SeamSpanContext, val attributes: List) +data class SeamScope(val name: String, val version: String?, val schemaUrl: String?, val attributes: List) +data class SeamStatus(val code: Int, val message: String?) + +data class SeamSpan( + val context: SeamSpanContext, + val parentSpanId: String?, + val name: String, + /** `@opentelemetry/api` SpanKind (INTERNAL = 0). */ + val kind: Int, + val start: HrTime, + val end: HrTime, + val attributes: List, + val events: List, + val links: List, + val status: SeamStatus, + val scope: SeamScope, +) diff --git a/package.json b/package.json index 2ae0fbf..ddc8a8f 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "vite", "!ios/build", "!android/build", + "!android/core-jvm", "!android/gradle", "!android/gradlew", "!android/gradlew.bat", diff --git a/verify/VERIFY.md b/verify/VERIFY.md index cbe5d97..4406654 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -12,6 +12,10 @@ cd example/ios && OTEL_TEST_MODE=1 pod install && OTEL_TEST_MODE=1 xcodebuild -w E2E_TARGET=android-bare bun verify --e2e e2e # or ios-bare; omit E2E_TARGET for both ``` +`fast-jvm` replays every `verify/fixtures/.handoff.json` through the Kotlin core (`android/core-jvm`, its own +Gradle wrapper) into a collector on a free port and compares `.android.otlp.json`. The JVM tests run otel-java's +own OkHttp 5; devices run React Native's OkHttp 4.9.2. + The fake collector listens on port 4318; the app reaches it at `10.0.2.2` (Android emulator) or `localhost` (iOS simulator). ## Device capability check (Task 7, 2026-11-23) diff --git a/verify/expected/async-generator.android.otlp.json b/verify/expected/async-generator.android.otlp.json new file mode 100644 index 0000000..cbf84fd --- /dev/null +++ b/verify/expected/async-generator.android.otlp.json @@ -0,0 +1,79 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000060000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "gen.0", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "loop.0", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "gen.1", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "parentSpanId": "0a00000000000001", + "name": "loop.1", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/batching-shared-queue.android.otlp.json b/verify/expected/batching-shared-queue.android.otlp.json new file mode 100644 index 0000000..0b41dc0 --- /dev/null +++ b/verify/expected/batching-shared-queue.android.otlp.json @@ -0,0 +1,67 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "h1", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000001000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000002", + "name": "h2", + "kind": 1, + "startTimeUnixNano": "1767225600000002000", + "endTimeUnixNano": "1767225600000003000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "h1.work", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "h2.work", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/captured-then.android.otlp.json b/verify/expected/captured-then.android.otlp.json new file mode 100644 index 0000000..b57eb7e --- /dev/null +++ b/verify/expected/captured-then.android.otlp.json @@ -0,0 +1,56 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000030000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "kept", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "name": "lost", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/concurrent-interleaved.android.otlp.json b/verify/expected/concurrent-interleaved.android.otlp.json new file mode 100644 index 0000000..3428488 --- /dev/null +++ b/verify/expected/concurrent-interleaved.android.otlp.json @@ -0,0 +1,99 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "a", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000030000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000002", + "name": "b", + "kind": 1, + "startTimeUnixNano": "1767225600000001000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "a.1", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000002", + "name": "b.1", + "kind": 1, + "startTimeUnixNano": "1767225600000011000", + "endTimeUnixNano": "1767225600000012000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "parentSpanId": "0a00000000000001", + "name": "a.2", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000006", + "parentSpanId": "0a00000000000002", + "name": "b.2", + "kind": 1, + "startTimeUnixNano": "1767225600000021000", + "endTimeUnixNano": "1767225600000022000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000007", + "name": "after.all", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/error-in-callback.android.otlp.json b/verify/expected/error-in-callback.android.otlp.json new file mode 100644 index 0000000..22eccaa --- /dev/null +++ b/verify/expected/error-in-callback.android.otlp.json @@ -0,0 +1,67 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000040000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "throws", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "name": "root.next", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "caught", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/handoff-basic.android.otlp.json b/verify/expected/handoff-basic.android.otlp.json new file mode 100644 index 0000000..6876639 --- /dev/null +++ b/verify/expected/handoff-basic.android.otlp.json @@ -0,0 +1,43 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000100000", + "attributes": [ + { + "key": "app.step", + "value": { + "stringValue": "one" + } + } + ], + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/interval-new-root.android.otlp.json b/verify/expected/interval-new-root.android.otlp.json new file mode 100644 index 0000000..3923a1e --- /dev/null +++ b/verify/expected/interval-new-root.android.otlp.json @@ -0,0 +1,66 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "tap", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000400000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000002", + "name": "tick", + "kind": 1, + "startTimeUnixNano": "1767225600000100000", + "endTimeUnixNano": "1767225600000101000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000003", + "name": "tick", + "kind": 1, + "startTimeUnixNano": "1767225600000200000", + "endTimeUnixNano": "1767225600000201000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "load", + "kind": 1, + "startTimeUnixNano": "1767225600000300000", + "endTimeUnixNano": "1767225600000301000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/nest-after-await.android.otlp.json b/verify/expected/nest-after-await.android.otlp.json new file mode 100644 index 0000000..611ade2 --- /dev/null +++ b/verify/expected/nest-after-await.android.otlp.json @@ -0,0 +1,46 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000030000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "child", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000020000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/nest-promise-all-race.android.otlp.json b/verify/expected/nest-promise-all-race.android.otlp.json new file mode 100644 index 0000000..57ceef3 --- /dev/null +++ b/verify/expected/nest-promise-all-race.android.otlp.json @@ -0,0 +1,90 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000060000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "all.a", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "all.b", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "race.a", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "parentSpanId": "0a00000000000001", + "name": "race.b", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000006", + "parentSpanId": "0a00000000000001", + "name": "after", + "kind": 1, + "startTimeUnixNano": "1767225600000050000", + "endTimeUnixNano": "1767225600000051000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/nest-timers-microtasks.android.otlp.json b/verify/expected/nest-timers-microtasks.android.otlp.json new file mode 100644 index 0000000..c730379 --- /dev/null +++ b/verify/expected/nest-timers-microtasks.android.otlp.json @@ -0,0 +1,90 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000050000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "timeout", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "immediate", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "microtask", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "parentSpanId": "0a00000000000001", + "name": "timeout.microtask", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000006", + "parentSpanId": "0a00000000000001", + "name": "after.end", + "kind": 1, + "startTimeUnixNano": "1767225600000060000", + "endTimeUnixNano": "1767225600000061000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/never-settling-promise.android.otlp.json b/verify/expected/never-settling-promise.android.otlp.json new file mode 100644 index 0000000..a71e213 --- /dev/null +++ b/verify/expected/never-settling-promise.android.otlp.json @@ -0,0 +1,66 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000020000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "child", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "name": "later.await", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000004", + "name": "later.timeout", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/odd-attributes.android.otlp.json b/verify/expected/odd-attributes.android.otlp.json new file mode 100644 index 0000000..b82c28d --- /dev/null +++ b/verify/expected/odd-attributes.android.otlp.json @@ -0,0 +1,67 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "odd", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000010000", + "attributes": [ + { + "key": "big", + "value": { + "intValue": "9007199254740994" + } + }, + { + "key": "empty", + "value": { + "arrayValue": {} + } + }, + { + "key": "inf", + "value": { + "doubleValue": "Infinity" + } + }, + { + "key": "nan", + "value": { + "doubleValue": "NaN" + } + }, + { + "key": "negZero", + "value": { + "intValue": "0" + } + } + ], + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/rich-span.android.otlp.json b/verify/expected/rich-span.android.otlp.json new file mode 100644 index 0000000..7f3f8c4 --- /dev/null +++ b/verify/expected/rich-span.android.otlp.json @@ -0,0 +1,191 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify.rich", + "version": "1.2.3", + "attributes": [ + { + "key": "scope.key", + "value": { + "stringValue": "scope-value" + } + } + ] + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "rich", + "kind": 3, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000100000", + "attributes": [ + { + "key": "bool", + "value": { + "boolValue": true + } + }, + { + "key": "bools", + "value": { + "arrayValue": { + "values": [ + { + "boolValue": true + }, + { + "boolValue": false + } + ] + } + } + }, + { + "key": "double", + "value": { + "doubleValue": 1.5 + } + }, + { + "key": "doubles", + "value": { + "arrayValue": { + "values": [ + { + "doubleValue": 1.5 + }, + { + "doubleValue": 2.5 + } + ] + } + } + }, + { + "key": "int", + "value": { + "intValue": "42" + } + }, + { + "key": "ints", + "value": { + "arrayValue": { + "values": [ + { + "intValue": "1" + }, + { + "intValue": "2" + }, + { + "intValue": "3" + } + ] + } + } + }, + { + "key": "str", + "value": { + "stringValue": "zażółć 🚀" + } + }, + { + "key": "strs", + "value": { + "arrayValue": { + "values": [ + { + "stringValue": "a" + }, + { + "stringValue": "b" + } + ] + } + } + } + ], + "events": [ + { + "timeUnixNano": "1767225600000010000", + "name": "first", + "attributes": [ + { + "key": "event.key", + "value": { + "stringValue": "e1" + } + }, + { + "key": "event.n", + "value": { + "intValue": "1" + } + } + ] + }, + { + "timeUnixNano": "1767225600000020000", + "name": "second", + "attributes": [ + { + "key": "event.ok", + "value": { + "boolValue": true + } + } + ] + } + ], + "links": [ + { + "traceId": "0f111111111111111111111111111111", + "spanId": "0f22222222222222", + "traceState": "k=v", + "attributes": [ + { + "key": "link.key", + "value": { + "stringValue": "link-value" + } + }, + { + "key": "link.n", + "value": { + "intValue": "7" + } + } + ], + "flags": 257 + } + ], + "status": { + "message": "boom", + "code": 2 + }, + "flags": 257 + } + ], + "schemaUrl": "https://opentelemetry.io/schemas/1.40.0" + } + ] + } + ] +} diff --git a/verify/expected/root-no-leak.android.otlp.json b/verify/expected/root-no-leak.android.otlp.json new file mode 100644 index 0000000..b72d020 --- /dev/null +++ b/verify/expected/root-no-leak.android.otlp.json @@ -0,0 +1,76 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "scoped", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000020000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "scoped.child", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "name": "after.sync", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000004", + "name": "after.await", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000004", + "spanId": "0a00000000000005", + "name": "after.timeout", + "kind": 1, + "startTimeUnixNano": "1767225600000050000", + "endTimeUnixNano": "1767225600000051000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/smoke-js.android.otlp.json b/verify/expected/smoke-js.android.otlp.json new file mode 100644 index 0000000..690cc72 --- /dev/null +++ b/verify/expected/smoke-js.android.otlp.json @@ -0,0 +1,35 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "smoke", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000001000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/fixtures/async-generator.handoff.json b/verify/fixtures/async-generator.handoff.json index 7ba0c3b..3fac4bb 100644 --- a/verify/fixtures/async-generator.handoff.json +++ b/verify/fixtures/async-generator.handoff.json @@ -1,7 +1,6 @@ { "config": { "serviceName": "verify", - "serviceVersion": "0.0.0", "resourceAttributes": [], "exportUrl": "", "exportHeaders": [] diff --git a/verify/fixtures/batching-shared-queue.handoff.json b/verify/fixtures/batching-shared-queue.handoff.json index 6384cb1..774d444 100644 --- a/verify/fixtures/batching-shared-queue.handoff.json +++ b/verify/fixtures/batching-shared-queue.handoff.json @@ -1,7 +1,6 @@ { "config": { "serviceName": "verify", - "serviceVersion": "0.0.0", "resourceAttributes": [], "exportUrl": "", "exportHeaders": [] diff --git a/verify/fixtures/captured-then.handoff.json b/verify/fixtures/captured-then.handoff.json index 21eecda..925e406 100644 --- a/verify/fixtures/captured-then.handoff.json +++ b/verify/fixtures/captured-then.handoff.json @@ -1,7 +1,6 @@ { "config": { "serviceName": "verify", - "serviceVersion": "0.0.0", "resourceAttributes": [], "exportUrl": "", "exportHeaders": [] diff --git a/verify/fixtures/concurrent-interleaved.handoff.json b/verify/fixtures/concurrent-interleaved.handoff.json index e3b1d36..2585051 100644 --- a/verify/fixtures/concurrent-interleaved.handoff.json +++ b/verify/fixtures/concurrent-interleaved.handoff.json @@ -1,7 +1,6 @@ { "config": { "serviceName": "verify", - "serviceVersion": "0.0.0", "resourceAttributes": [], "exportUrl": "", "exportHeaders": [] diff --git a/verify/fixtures/error-in-callback.handoff.json b/verify/fixtures/error-in-callback.handoff.json index 86e1469..d082b48 100644 --- a/verify/fixtures/error-in-callback.handoff.json +++ b/verify/fixtures/error-in-callback.handoff.json @@ -1,7 +1,6 @@ { "config": { "serviceName": "verify", - "serviceVersion": "0.0.0", "resourceAttributes": [], "exportUrl": "", "exportHeaders": [] diff --git a/verify/fixtures/handoff-basic.handoff.json b/verify/fixtures/handoff-basic.handoff.json index b79b98a..28df8f9 100644 --- a/verify/fixtures/handoff-basic.handoff.json +++ b/verify/fixtures/handoff-basic.handoff.json @@ -1,7 +1,6 @@ { "config": { "serviceName": "verify", - "serviceVersion": "0.0.0", "resourceAttributes": [], "exportUrl": "", "exportHeaders": [] diff --git a/verify/fixtures/interval-new-root.handoff.json b/verify/fixtures/interval-new-root.handoff.json index 693f25f..a245d81 100644 --- a/verify/fixtures/interval-new-root.handoff.json +++ b/verify/fixtures/interval-new-root.handoff.json @@ -1,7 +1,6 @@ { "config": { "serviceName": "verify", - "serviceVersion": "0.0.0", "resourceAttributes": [], "exportUrl": "", "exportHeaders": [] diff --git a/verify/fixtures/nest-after-await.handoff.json b/verify/fixtures/nest-after-await.handoff.json index b4b0658..3ffc349 100644 --- a/verify/fixtures/nest-after-await.handoff.json +++ b/verify/fixtures/nest-after-await.handoff.json @@ -1,7 +1,6 @@ { "config": { "serviceName": "verify", - "serviceVersion": "0.0.0", "resourceAttributes": [], "exportUrl": "", "exportHeaders": [] diff --git a/verify/fixtures/nest-promise-all-race.handoff.json b/verify/fixtures/nest-promise-all-race.handoff.json index 94c3043..0b97d5f 100644 --- a/verify/fixtures/nest-promise-all-race.handoff.json +++ b/verify/fixtures/nest-promise-all-race.handoff.json @@ -1,7 +1,6 @@ { "config": { "serviceName": "verify", - "serviceVersion": "0.0.0", "resourceAttributes": [], "exportUrl": "", "exportHeaders": [] diff --git a/verify/fixtures/nest-timers-microtasks.handoff.json b/verify/fixtures/nest-timers-microtasks.handoff.json index d22d796..1beda0c 100644 --- a/verify/fixtures/nest-timers-microtasks.handoff.json +++ b/verify/fixtures/nest-timers-microtasks.handoff.json @@ -1,7 +1,6 @@ { "config": { "serviceName": "verify", - "serviceVersion": "0.0.0", "resourceAttributes": [], "exportUrl": "", "exportHeaders": [] diff --git a/verify/fixtures/never-settling-promise.handoff.json b/verify/fixtures/never-settling-promise.handoff.json index 14e44fd..463e62d 100644 --- a/verify/fixtures/never-settling-promise.handoff.json +++ b/verify/fixtures/never-settling-promise.handoff.json @@ -1,7 +1,6 @@ { "config": { "serviceName": "verify", - "serviceVersion": "0.0.0", "resourceAttributes": [], "exportUrl": "", "exportHeaders": [] diff --git a/verify/fixtures/odd-attributes.handoff.json b/verify/fixtures/odd-attributes.handoff.json index 95ea2f5..bb85702 100644 --- a/verify/fixtures/odd-attributes.handoff.json +++ b/verify/fixtures/odd-attributes.handoff.json @@ -1,7 +1,6 @@ { "config": { "serviceName": "verify", - "serviceVersion": "0.0.0", "resourceAttributes": [], "exportUrl": "", "exportHeaders": [] diff --git a/verify/fixtures/rich-span.handoff.json b/verify/fixtures/rich-span.handoff.json index 558fe3d..034d94a 100644 --- a/verify/fixtures/rich-span.handoff.json +++ b/verify/fixtures/rich-span.handoff.json @@ -1,7 +1,6 @@ { "config": { "serviceName": "verify", - "serviceVersion": "0.0.0", "resourceAttributes": [], "exportUrl": "", "exportHeaders": [] diff --git a/verify/fixtures/root-no-leak.handoff.json b/verify/fixtures/root-no-leak.handoff.json index 8c3a437..8821bb2 100644 --- a/verify/fixtures/root-no-leak.handoff.json +++ b/verify/fixtures/root-no-leak.handoff.json @@ -1,7 +1,6 @@ { "config": { "serviceName": "verify", - "serviceVersion": "0.0.0", "resourceAttributes": [], "exportUrl": "", "exportHeaders": [] diff --git a/verify/fixtures/smoke-js.handoff.json b/verify/fixtures/smoke-js.handoff.json index ae0cc1b..328a320 100644 --- a/verify/fixtures/smoke-js.handoff.json +++ b/verify/fixtures/smoke-js.handoff.json @@ -1,7 +1,6 @@ { "config": { "serviceName": "verify", - "serviceVersion": "0.0.0", "resourceAttributes": [], "exportUrl": "", "exportHeaders": [] diff --git a/verify/jest/fixtures.test.ts b/verify/jest/fixtures.test.ts index c2c85c9..3725c89 100644 --- a/verify/jest/fixtures.test.ts +++ b/verify/jest/fixtures.test.ts @@ -13,7 +13,6 @@ import {pendingScenarios} from '../harness/compare'; const CONFIG = { serviceName: 'verify', - serviceVersion: '0.0.0', resourceAttributes: [], exportUrl: '', exportHeaders: [], diff --git a/verify/stages/fast-jvm.ts b/verify/stages/fast-jvm.ts new file mode 100644 index 0000000..28ab7b1 --- /dev/null +++ b/verify/stages/fast-jvm.ts @@ -0,0 +1,49 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import {spawn} from 'node:child_process'; +import type {Stage} from '../run'; +import {startCollector} from '../harness/collector'; +import {compareToExpected} from '../harness/compare'; + +const root = path.join(import.meta.dirname, '..', '..'); +const artifacts = path.join(root, 'verify', 'artifacts'); + +// The collector must keep serving while Gradle runs, so no spawnSync (ctx.sh) here. +const run = (cmd: string, args: string[], cwd: string, env: NodeJS.ProcessEnv) => + new Promise((ok, fail) => + spawn(cmd, args, {cwd, env, stdio: 'inherit'}).on('exit', c => (c === 0 ? ok() : fail(new Error(`${cmd} exited ${c}`)))), + ); + +const stage: Stage = { + name: 'fast-jvm', + order: 25, + e2e: false, + async run() { + const names = fs.readdirSync(path.join(root, 'verify', 'fixtures')) + .filter(f => f.endsWith('.handoff.json')) + .map(f => f.slice(0, -'.handoff.json'.length)) + .sort(); + for (const n of names) fs.rmSync(path.join(artifacts, `${n}.android.otlp.json`), {force: true}); + const collector = await startCollector({port: 0}); + try { + await run('./gradlew', ['test', '--console=plain', '-q'], path.join(root, 'android', 'core-jvm'), { + ...process.env, + VERIFY_COLLECTOR: collector.url, + }); + } finally { + await collector.close(); + } + const failed: string[] = []; + for (const n of names) { + const f = path.join(artifacts, `${n}.android.otlp.json`); + if (!fs.existsSync(f)) throw new Error(`${n}: the JVM test exported nothing (missing ${f})`); + const {ok, report} = compareToExpected(n, 'android', JSON.parse(fs.readFileSync(f, 'utf8'))); + if (report) console.log(report); + if (!ok) failed.push(n); + } + if (failed.length) throw new Error(`android mismatch: ${failed.join(', ')}`); + console.log(`fast-jvm: ${names.length} fixtures match their android files`); + }, +}; + +export default stage; diff --git a/verify/static/packContents.test.ts b/verify/static/packContents.test.ts index fa16d35..5a5394e 100644 --- a/verify/static/packContents.test.ts +++ b/verify/static/packContents.test.ts @@ -1,6 +1,6 @@ import {packContents} from './packContents'; -const complete = ['package.json', 'lib/module/index.js', 'src/index.ts', 'nitrogen/generated/x.hpp', 'metro/index.js']; +const complete = ['package.json', 'lib/module/index.js', 'src/index.ts', 'nitrogen/generated/x.hpp', 'metro/index.js', 'android/build.gradle', 'ios/Adapter/HybridOtel.swift', 'ReactNativeOpenTelemetry.podspec']; test('reports missing nitrogen/', () => { expect(packContents(complete.filter(p => !p.startsWith('nitrogen/')))).toEqual(['nitrogen/']); diff --git a/verify/static/packContents.ts b/verify/static/packContents.ts index 7c9643b..41d2543 100644 --- a/verify/static/packContents.ts +++ b/verify/static/packContents.ts @@ -1,4 +1,5 @@ -export const REQUIRED = ['package.json', 'lib/', 'src/', 'nitrogen/', 'metro/']; +// Package.swift joins with Task 18, which creates it. +export const REQUIRED = ['package.json', 'lib/', 'src/', 'nitrogen/', 'metro/', 'android/', 'ios/', 'ReactNativeOpenTelemetry.podspec']; /** Returns the required paths missing from the `npm pack --dry-run --json` file list. */ export function packContents(list: string[], required: string[] = REQUIRED): string[] { From 5278f04dd2887c0a7108fc1abb45471f84efbf4f Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:11:19 +0100 Subject: [PATCH 18/76] fix(verify): fast-jvm fails the stage on spawn errors Co-Authored-By: Claude Opus 5.5 --- verify/stages/fast-jvm.ts | 3 ++- verify/static/packContents.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/verify/stages/fast-jvm.ts b/verify/stages/fast-jvm.ts index 28ab7b1..3b67c6d 100644 --- a/verify/stages/fast-jvm.ts +++ b/verify/stages/fast-jvm.ts @@ -11,7 +11,8 @@ const artifacts = path.join(root, 'verify', 'artifacts'); // The collector must keep serving while Gradle runs, so no spawnSync (ctx.sh) here. const run = (cmd: string, args: string[], cwd: string, env: NodeJS.ProcessEnv) => new Promise((ok, fail) => - spawn(cmd, args, {cwd, env, stdio: 'inherit'}).on('exit', c => (c === 0 ? ok() : fail(new Error(`${cmd} exited ${c}`)))), + spawn(cmd, args, {cwd, env, stdio: 'inherit'}).on('error', fail) + .on('exit', (c, sig) => (c === 0 ? ok() : fail(new Error(`${cmd} exited ${c ?? sig}`)))), ); const stage: Stage = { diff --git a/verify/static/packContents.ts b/verify/static/packContents.ts index 41d2543..b4c9ff5 100644 --- a/verify/static/packContents.ts +++ b/verify/static/packContents.ts @@ -1,4 +1,4 @@ -// Package.swift joins with Task 18, which creates it. +// Package.swift joins with Task 18 and vite/ with Task 22, which create them. export const REQUIRED = ['package.json', 'lib/', 'src/', 'nitrogen/', 'metro/', 'android/', 'ios/', 'ReactNativeOpenTelemetry.podspec']; /** Returns the required paths missing from the `npm pack --dry-run --json` file list. */ From feaa270ec5ead67e2673214ca586b6792055d305 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:13:28 +0100 Subject: [PATCH 19/76] feat(android-core): config, endpoint and headers Co-Authored-By: Claude Opus 5.5 --- .../core-jvm/src/test/kotlin/EndpointTest.kt | 12 ++++ .../core-jvm/src/test/kotlin/FixtureJson.kt | 1 + android/core-jvm/src/test/kotlin/InitTest.kt | 71 +++++++++++++++++++ .../src/test/kotlin/TraceStateTest.kt | 15 ++++ .../com/callstack/otel/core/CoreConfig.kt | 13 ++++ .../com/callstack/otel/core/Endpoint.kt | 18 +++++ .../com/callstack/otel/core/OtelCore.kt | 61 +++++++++++++--- .../expected/export-headers.android.otlp.json | 35 +++++++++ verify/expected/export-headers.js.otlp.json | 35 +++++++++ verify/fixtures/export-headers.handoff.json | 42 +++++++++++ verify/jest/fixtures.test.ts | 7 +- verify/scenarios/export-headers.ts | 5 +- verify/stages/fast-jvm.ts | 5 ++ 13 files changed, 304 insertions(+), 16 deletions(-) create mode 100644 android/core-jvm/src/test/kotlin/EndpointTest.kt create mode 100644 android/core-jvm/src/test/kotlin/InitTest.kt create mode 100644 android/core-jvm/src/test/kotlin/TraceStateTest.kt create mode 100644 android/src/core/kotlin/com/callstack/otel/core/CoreConfig.kt create mode 100644 android/src/core/kotlin/com/callstack/otel/core/Endpoint.kt create mode 100644 verify/expected/export-headers.android.otlp.json create mode 100644 verify/expected/export-headers.js.otlp.json create mode 100644 verify/fixtures/export-headers.handoff.json diff --git a/android/core-jvm/src/test/kotlin/EndpointTest.kt b/android/core-jvm/src/test/kotlin/EndpointTest.kt new file mode 100644 index 0000000..c9d18f8 --- /dev/null +++ b/android/core-jvm/src/test/kotlin/EndpointTest.kt @@ -0,0 +1,12 @@ +import com.callstack.otel.core.tracesUrl +import kotlin.test.Test +import kotlin.test.assertEquals + +class EndpointTest { + @Test fun appendsTracesPathUnlessPresent() { + for (u in listOf("http://h:4318", "http://h:4318/", "http://h:4318/v1/traces", "http://h:4318/v1/traces/")) { + assertEquals("http://h:4318/v1/traces", tracesUrl(u), u) + } + assertEquals("http://h/base/v1/traces", tracesUrl("http://h/base")) + } +} diff --git a/android/core-jvm/src/test/kotlin/FixtureJson.kt b/android/core-jvm/src/test/kotlin/FixtureJson.kt index 781e835..edc492f 100644 --- a/android/core-jvm/src/test/kotlin/FixtureJson.kt +++ b/android/core-jvm/src/test/kotlin/FixtureJson.kt @@ -22,6 +22,7 @@ object FixtureJson { serviceVersion = c.str("serviceVersion"), resourceAttributes = attrs(c["resourceAttributes"]), exportUrl = c["exportUrl"].asString.replace("", exportUrl), + exportHeaders = attrs(c["exportHeaders"]).associate { it.key to (it.value as AttrValue.Str).value }, ) return config to root["spans"].asJsonArray.map { span(it.asJsonObject) } } diff --git a/android/core-jvm/src/test/kotlin/InitTest.kt b/android/core-jvm/src/test/kotlin/InitTest.kt new file mode 100644 index 0000000..472c557 --- /dev/null +++ b/android/core-jvm/src/test/kotlin/InitTest.kt @@ -0,0 +1,71 @@ +import com.callstack.otel.core.AttrValue +import com.callstack.otel.core.CoreConfig +import com.callstack.otel.core.OtelCore +import com.callstack.otel.core.SeamAttribute +import io.opentelemetry.api.common.AttributeKey +import kotlin.test.AfterTest +import kotlin.test.BeforeTest +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertFalse +import kotlin.test.assertNotNull +import kotlin.test.assertNull +import kotlin.test.assertSame +import kotlin.test.assertTrue + +class InitTest { + private val ok = CoreConfig("first", "1.0", emptyList(), "http://127.0.0.1:1", mapOf("x-api-key" to "test")) + @BeforeTest @AfterTest fun reset() = OtelCore.resetForTest() + + @Test fun initializeTwiceKeepsTheFirstConfig() { + val a = OtelCore.initialize(ok, testMode = true) + assertNull(a.error); assertFalse(a.alreadyInitialized) + val core = OtelCore.instance + val b = OtelCore.initialize(ok.copy(serviceName = "second"), testMode = true) + assertTrue(b.alreadyInitialized); assertNull(b.error) + assertSame(core, OtelCore.instance) + assertEquals("first", core!!.resource.getAttribute(AttributeKey.stringKey("service.name"))) + } + + @Test fun invalidUrlReturnsAnErrorAndNeverThrows() { + for (u in listOf("not a url", "ftp://h", "http://", "", "http:///x")) { + OtelCore.resetForTest() + val r = OtelCore.initialize(ok.copy(exportUrl = u), testMode = true) + assertNotNull(r.error, u); assertNull(OtelCore.instance) + } + } + + @Test fun aFailedInitIsSticky() { + val first = OtelCore.initialize(ok.copy(exportUrl = "not a url"), testMode = true) + val again = OtelCore.initialize(ok, testMode = true) + assertEquals(first.error, again.error) + assertNull(OtelCore.instance) + } + + @Test fun initializeWithoutConfigIsAnErrorButNotSticky() { + assertNotNull(OtelCore.initialize(null, testMode = true).error) + val r = OtelCore.initialize(ok, testMode = true) + assertNull(r.error); assertFalse(r.alreadyInitialized) + assertNotNull(OtelCore.instance) + } + + @Test fun initializeWithoutConfigAfterInitIsAlreadyInitialized() { + OtelCore.initialize(ok, testMode = true) + val r = OtelCore.initialize(null, testMode = true) + assertTrue(r.alreadyInitialized); assertNull(r.error) + } + + @Test fun distroAttributesOutsideTestModeOnly() { + val prod = OtelCore(ok, testMode = false, distroVersion = "9.9.9").resource + assertEquals("react-native-open-telemetry", prod.getAttribute(AttributeKey.stringKey("telemetry.distro.name"))) + assertEquals("9.9.9", prod.getAttribute(AttributeKey.stringKey("telemetry.distro.version"))) + val test = OtelCore(ok, testMode = true, distroVersion = "9.9.9").resource + assertNull(test.getAttribute(AttributeKey.stringKey("telemetry.distro.name"))) + assertNull(test.getAttribute(AttributeKey.stringKey("telemetry.sdk.name"))) + } + + @Test fun resourceAttributesAreKept() { + val c = ok.copy(resourceAttributes = listOf(SeamAttribute("k", AttrValue.Str("v")))) + assertEquals("v", OtelCore(c, testMode = true).resource.getAttribute(AttributeKey.stringKey("k"))) + } +} diff --git a/android/core-jvm/src/test/kotlin/TraceStateTest.kt b/android/core-jvm/src/test/kotlin/TraceStateTest.kt new file mode 100644 index 0000000..8dd84e8 --- /dev/null +++ b/android/core-jvm/src/test/kotlin/TraceStateTest.kt @@ -0,0 +1,15 @@ +import com.callstack.otel.core.* +import io.opentelemetry.sdk.resources.Resource +import kotlin.test.Test +import kotlin.test.assertEquals + +class TraceStateTest { + @Test fun multiEntryTraceStateKeepsItsOrder() { + val h = HrTime(1.0, 0.0) + val span = SeamSpan( + SeamSpanContext("0a".padEnd(32, '1'), "0a".padEnd(16, '2'), 1, "a=1,b=2"), null, "s", 0, h, h, + emptyList(), emptyList(), emptyList(), SeamStatus(0, null), SeamScope("t", null, null, emptyList()), + ) + assertEquals("a=1,b=2", JsSpanData(span, Resource.empty()).spanContext.traceState.asMap().entries.joinToString(",") { "${it.key}=${it.value}" }) + } +} diff --git a/android/src/core/kotlin/com/callstack/otel/core/CoreConfig.kt b/android/src/core/kotlin/com/callstack/otel/core/CoreConfig.kt new file mode 100644 index 0000000..7d336fd --- /dev/null +++ b/android/src/core/kotlin/com/callstack/otel/core/CoreConfig.kt @@ -0,0 +1,13 @@ +package com.callstack.otel.core + +data class CoreConfig( + val serviceName: String, + val serviceVersion: String? = null, + val resourceAttributes: List = emptyList(), + /** Base URL; see [tracesUrl]. */ + val exportUrl: String, + val exportHeaders: Map = emptyMap(), +) + +/** Mirrors the seam's `SeamInitResult`. */ +data class InitResult(val alreadyInitialized: Boolean, val testMode: Boolean, val error: String? = null) diff --git a/android/src/core/kotlin/com/callstack/otel/core/Endpoint.kt b/android/src/core/kotlin/com/callstack/otel/core/Endpoint.kt new file mode 100644 index 0000000..d2cc380 --- /dev/null +++ b/android/src/core/kotlin/com/callstack/otel/core/Endpoint.kt @@ -0,0 +1,18 @@ +package com.callstack.otel.core + +import java.net.URI + +/** Base URL -> traces endpoint: `/v1/traces` is appended unless already present (same rule as JS and iOS). */ +fun tracesUrl(exportUrl: String): String { + val base = exportUrl.trimEnd('/') + return if (base.endsWith("/v1/traces")) base else "$base/v1/traces" +} + +/** Eager check (D8), no exporter built: http(s) scheme and a host. Returns an error message or null. */ +internal fun validateExportUrl(url: String): String? { + val u = try { URI(url) } catch (e: Exception) { return "invalid exportUrl: ${e.message}" } + if (u.scheme?.lowercase() !in setOf("http", "https") || u.host.isNullOrEmpty()) { + return "invalid exportUrl \"$url\": expected http(s)://host[:port]" + } + return null +} diff --git a/android/src/core/kotlin/com/callstack/otel/core/OtelCore.kt b/android/src/core/kotlin/com/callstack/otel/core/OtelCore.kt index 0b5493d..c8bb2d1 100644 --- a/android/src/core/kotlin/com/callstack/otel/core/OtelCore.kt +++ b/android/src/core/kotlin/com/callstack/otel/core/OtelCore.kt @@ -1,6 +1,9 @@ package com.callstack.otel.core import io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter +import io.opentelemetry.sdk.common.CompletableResultCode +import io.opentelemetry.sdk.trace.data.SpanData +import io.opentelemetry.sdk.trace.export.SpanExporter import io.opentelemetry.sdk.resources.Resource import io.opentelemetry.sdk.trace.IdGenerator import io.opentelemetry.sdk.trace.SdkTracerProvider @@ -8,15 +11,6 @@ import io.opentelemetry.sdk.trace.export.BatchSpanProcessor import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicLong -// ponytail: minimal config for Task 15 (R12); Task 16 adds tracesUrl, headers, distro attributes and URL validation. -data class CoreConfig( - val serviceName: String, - val serviceVersion: String? = null, - val resourceAttributes: List = emptyList(), - /** Base URL; `/v1/traces` is appended. */ - val exportUrl: String, -) - /** Test mode: `0b…` IDs, the native counterpart of JS `sequentialIds('0a')`. */ private class SequentialIds : IdGenerator { private val t = AtomicLong() @@ -25,19 +19,38 @@ private class SequentialIds : IdGenerator { override fun generateSpanId() = "0b" + s.incrementAndGet().toString().padStart(14, '0') } -class OtelCore(config: CoreConfig, testMode: Boolean = false) { +const val DISTRO_NAME = "react-native-open-telemetry" + +/** Built on first export (the export thread), so init on the main thread never constructs an HTTP client. */ +private class LazyExporter(private val build: () -> SpanExporter) : SpanExporter { + private val d by lazy(build) + override fun export(spans: Collection) = d.export(spans) + override fun flush(): CompletableResultCode = d.flush() + override fun shutdown(): CompletableResultCode = d.shutdown() +} + +class OtelCore(config: CoreConfig, testMode: Boolean = false, distroVersion: String = "unknown") { /** The one resource of the app; in test mode built from config only (no `telemetry.*`). */ val resource: Resource = (if (testMode) Resource.empty() else Resource.getDefault()).merge( Resource.create( attributesOf(config.resourceAttributes).toBuilder() .put("service.name", config.serviceName) .apply { config.serviceVersion?.let { put("service.version", it) } } + .apply { + if (!testMode) { + put("telemetry.distro.name", DISTRO_NAME) + put("telemetry.distro.version", distroVersion) + } + } .build(), ), ) private val bsp = BatchSpanProcessor.builder( - OtlpHttpSpanExporter.builder().setEndpoint(config.exportUrl.trimEnd('/') + "/v1/traces").build(), + LazyExporter { + OtlpHttpSpanExporter.builder().setEndpoint(tracesUrl(config.exportUrl)) + .apply { config.exportHeaders.forEach { (k, v) -> addHeader(k, v) } }.build() + }, ).build() /** The native TracerProvider; JS spans join its batch processor. */ @@ -53,4 +66,30 @@ class OtelCore(config: CoreConfig, testMode: Boolean = false) { } fun flush(timeoutMs: Long): Boolean = tracerProvider.forceFlush().join(timeoutMs, TimeUnit.MILLISECONDS).isSuccess + + companion object { + private var state: InitResult? = null + @Volatile var instance: OtelCore? = null + private set + + /** + * Idempotent. The first result sticks, a failed one too (R16): later calls never retry. A call without config + * before any init is an error but is not remembered, so the real init can still follow. + */ + @Synchronized fun initialize(config: CoreConfig?, testMode: Boolean = false, distroVersion: String = "unknown"): InitResult { + state?.let { return it.copy(alreadyInitialized = true) } + if (config == null) return InitResult(false, testMode, "not initialized: no config") + val err = validateExportUrl(config.exportUrl) + val result = InitResult(false, testMode, err) + if (err == null) { + try { instance = OtelCore(config, testMode, distroVersion) } catch (e: Exception) { + return InitResult(false, testMode, "init failed: ${e.message}").also { state = it } + } + } + state = result + return result + } + + @Synchronized internal fun resetForTest() { state = null; instance = null } + } } diff --git a/verify/expected/export-headers.android.otlp.json b/verify/expected/export-headers.android.otlp.json new file mode 100644 index 0000000..09465b2 --- /dev/null +++ b/verify/expected/export-headers.android.otlp.json @@ -0,0 +1,35 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "headers", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000010000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/export-headers.js.otlp.json b/verify/expected/export-headers.js.otlp.json new file mode 100644 index 0000000..09465b2 --- /dev/null +++ b/verify/expected/export-headers.js.otlp.json @@ -0,0 +1,35 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "headers", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000010000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/fixtures/export-headers.handoff.json b/verify/fixtures/export-headers.handoff.json new file mode 100644 index 0000000..d6e97a5 --- /dev/null +++ b/verify/fixtures/export-headers.handoff.json @@ -0,0 +1,42 @@ +{ + "config": { + "serviceName": "verify", + "resourceAttributes": [], + "exportUrl": "", + "exportHeaders": [ + { + "key": "x-api-key", + "value": "test" + } + ] + }, + "spans": [ + { + "context": { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "traceFlags": 1 + }, + "name": "headers", + "kind": 0, + "start": [ + 1767225600, + 0 + ], + "end": [ + 1767225600, + 10000 + ], + "attributes": [], + "events": [], + "links": [], + "status": { + "code": 0 + }, + "scope": { + "name": "verify", + "attributes": [] + } + } + ] +} diff --git a/verify/jest/fixtures.test.ts b/verify/jest/fixtures.test.ts index 3725c89..053879f 100644 --- a/verify/jest/fixtures.test.ts +++ b/verify/jest/fixtures.test.ts @@ -17,6 +17,9 @@ const CONFIG = { exportUrl: '', exportHeaders: [], }; +// R11: per-scenario config; export-headers proves the headers reach the collector (fast-jvm asserts headers.json) +const configFor = (name: string) => + name === 'export-headers' ? {...CONFIG, exportHeaders: [{key: 'x-api-key', value: 'test'}]} : CONFIG; const dir = path.join(process.env.VERIFY_DIR ?? path.join(__dirname, '..'), 'fixtures'); function setup() { @@ -94,8 +97,8 @@ for (const s of allScenarios().filter(x => !x.pending && x.runners.includes('jes const file = path.join(dir, `${name}.handoff.json`); if (process.env.VERIFY_UPDATE === '1') { fs.mkdirSync(dir, {recursive: true}); - fs.writeFileSync(file, encodeFixture({config: CONFIG, spans: actual}) + '\n'); + fs.writeFileSync(file, encodeFixture({config: configFor(name), spans: actual}) + '\n'); } - expect(decodeFixture(fs.readFileSync(file, 'utf8'))).toStrictEqual({config: CONFIG, spans: actual}); + expect(decodeFixture(fs.readFileSync(file, 'utf8'))).toStrictEqual({config: configFor(name), spans: actual}); }); } diff --git a/verify/scenarios/export-headers.ts b/verify/scenarios/export-headers.ts index 3d6bf63..d29e21b 100644 --- a/verify/scenarios/export-headers.ts +++ b/verify/scenarios/export-headers.ts @@ -2,13 +2,12 @@ import {scenario} from '../harness/scenario'; /** * Configured export headers are sent on every export request: the collector's `.headers.json` for this - * scenario contains `x-api-key: test`. Tasks 16/19 add it to the fixtures `NAMES` with a per-scenario fixture - * config `exportHeaders: [{key: 'x-api-key', value: 'test'}]` and assert `headers.json` explicitly. + * scenario contains `x-api-key: test`. Its seam fixture carries a per-scenario config `exportHeaders: [{key: 'x-api-key', value: 'test'}]`; fast-jvm asserts `headers.json`. */ export default scenario( 'export-headers', async ({tracer, at}) => { tracer.startSpan('headers', {startTime: at(0)}).end(at(10)); }, - {runners: ['e2e'], pending: true}, // Tasks 16, 19 + {targets: []}, // no e2e yet: Tasks 24/25/23 add android/ios/web as each app's init sends the header ); diff --git a/verify/stages/fast-jvm.ts b/verify/stages/fast-jvm.ts index 3b67c6d..0762b55 100644 --- a/verify/stages/fast-jvm.ts +++ b/verify/stages/fast-jvm.ts @@ -42,6 +42,11 @@ const stage: Stage = { if (report) console.log(report); if (!ok) failed.push(n); } + // R11: configured export headers reach the collector + const raw = path.join(artifacts, 'raw', 'export-headers.android'); + const hdr = fs.readdirSync(raw).filter(f => f.endsWith('.headers.json')); + if (!hdr.length || !hdr.every(f => JSON.parse(fs.readFileSync(path.join(raw, f), 'utf8'))['x-api-key'] === 'test')) + failed.push('export-headers (x-api-key: test missing in headers.json)'); if (failed.length) throw new Error(`android mismatch: ${failed.join(', ')}`); console.log(`fast-jvm: ${names.length} fixtures match their android files`); }, From dcb7914ee725da065551f23cd6976a9d2c81b859 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:15:22 +0100 Subject: [PATCH 20/76] feat(android-core): explicit parenting helper Co-Authored-By: Claude Opus 5.5 --- .../core-jvm/src/test/kotlin/ParentingTest.kt | 48 +++++++++++++++++++ .../com/callstack/otel/core/Parenting.kt | 24 ++++++++++ 2 files changed, 72 insertions(+) create mode 100644 android/core-jvm/src/test/kotlin/ParentingTest.kt create mode 100644 android/src/core/kotlin/com/callstack/otel/core/Parenting.kt diff --git a/android/core-jvm/src/test/kotlin/ParentingTest.kt b/android/core-jvm/src/test/kotlin/ParentingTest.kt new file mode 100644 index 0000000..c5beea7 --- /dev/null +++ b/android/core-jvm/src/test/kotlin/ParentingTest.kt @@ -0,0 +1,48 @@ +import com.callstack.otel.core.* +import io.opentelemetry.api.trace.Span +import io.opentelemetry.context.Context +import io.opentelemetry.sdk.trace.ReadableSpan +import io.opentelemetry.sdk.trace.SdkTracerProvider +import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertFalse +import kotlin.test.assertTrue + +class ParentingTest { + private val tracer = SdkTracerProvider.builder().addSpanProcessor(SimpleSpanProcessor.create(object : io.opentelemetry.sdk.trace.export.SpanExporter { + override fun export(spans: Collection) = io.opentelemetry.sdk.common.CompletableResultCode.ofSuccess() + override fun flush() = io.opentelemetry.sdk.common.CompletableResultCode.ofSuccess() + override fun shutdown() = io.opentelemetry.sdk.common.CompletableResultCode.ofSuccess() + })).build().get("t") + private val tp = "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01" + + private fun child(ctx: Context) = tracer.spanBuilder("c").setParent(ctx).startSpan() as ReadableSpan + + @Test fun roundTrip() { + val s = tracer.spanBuilder("p").startSpan() + assertEquals(s.spanContext.traceId, traceparentOf(s).split("-")[1]) + assertEquals(traceparentOf(s), traceparentOf(Span.fromContext(contextFrom(traceparentOf(s))))) + assertEquals(tp, traceparentOf(Span.fromContext(contextFrom(tp)))) + } + + @Test fun childHasParentIdAndIsNotRemote() { + val d = child(contextFrom(tp)).toSpanData() + assertEquals("b7ad6b7169203331", d.parentSpanId) + assertEquals("0af7651916cd43dd8448eb211c80319c", d.traceId) + assertFalse(d.parentSpanContext.isRemote) + } + + @Test fun invalidInputYieldsRoot() { + listOf("garbage", "", "ff-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01", + "01-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01", + "00-0AF7651916CD43DD8448EB211C80319C-b7ad6b7169203331-01", + "00-00000000000000000000000000000000-b7ad6b7169203331-01", + "00-0af7651916cd43dd8448eb211c80319c-0000000000000000-01", + "00-0af7-b7ad6b7169203331-01", "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-zz", + ).forEach { + assertEquals(Context.root(), contextFrom(it), it) + assertFalse(child(contextFrom(it)).toSpanData().parentSpanContext.isValid) + } + } +} diff --git a/android/src/core/kotlin/com/callstack/otel/core/Parenting.kt b/android/src/core/kotlin/com/callstack/otel/core/Parenting.kt new file mode 100644 index 0000000..5a975d0 --- /dev/null +++ b/android/src/core/kotlin/com/callstack/otel/core/Parenting.kt @@ -0,0 +1,24 @@ +package com.callstack.otel.core + +import io.opentelemetry.api.trace.Span +import io.opentelemetry.api.trace.SpanContext +import io.opentelemetry.api.trace.TraceFlags +import io.opentelemetry.api.trace.TraceState +import io.opentelemetry.context.Context + +private val TRACEPARENT = Regex("^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$") + +/** + * W3C traceparent -> Context holding a NON-remote parent (spec §4.3). + * Not W3CTraceContextPropagator.extract: that yields isRemote=true. + * Invalid input (incl. all-zero ids) -> Context.root(); never throws. + */ +fun contextFrom(traceparent: String): Context { + val m = TRACEPARENT.matchEntire(traceparent) ?: return Context.root() + val (traceId, spanId, flags) = m.destructured + val sc = SpanContext.create(traceId, spanId, TraceFlags.fromHex(flags, 0), TraceState.getDefault()) + return if (sc.isValid) Context.root().with(Span.wrap(sc)) else Context.root() +} + +fun traceparentOf(span: Span): String = + span.spanContext.let { "00-${it.traceId}-${it.spanId}-${it.traceFlags.asHex()}" } From a4c7bb1e77b1d607f891012a637239a188145321 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:36:10 +0100 Subject: [PATCH 21/76] feat(ios-core): seam spans exported through opentelemetry-swift Co-Authored-By: Claude Opus 5.5 --- .gitignore | 5 + Package.swift | 26 +++ .../specs/2026-11-10-rn-otel-design.md | 5 +- ios/Core/Attributes.swift | 20 ++ ios/Core/OtelCore.swift | 65 ++++++ ios/Core/SeamModel.swift | 78 ++++++++ ios/Core/SpanDataBuilder.swift | 114 +++++++++++ ios/CoreTests/AttributesTests.swift | 40 ++++ ios/CoreTests/FixtureExportTests.swift | 41 ++++ ios/CoreTests/FixtureJson.swift | 85 ++++++++ ios/CoreTests/TimeRoundTripTests.swift | 37 ++++ package.json | 1 + verify/VERIFY.md | 12 ++ verify/expected/async-generator.ios.otlp.json | 74 +++++++ .../batching-shared-queue.ios.otlp.json | 63 ++++++ verify/expected/captured-then.ios.otlp.json | 53 +++++ .../concurrent-interleaved.ios.otlp.json | 92 +++++++++ .../expected/error-in-callback.ios.otlp.json | 63 ++++++ verify/expected/export-headers.ios.otlp.json | 34 ++++ verify/expected/handoff-basic.ios.otlp.json | 42 ++++ .../expected/interval-new-root.ios.otlp.json | 62 ++++++ .../expected/nest-after-await.ios.otlp.json | 44 +++++ .../nest-promise-all-race.ios.otlp.json | 84 ++++++++ .../nest-timers-microtasks.ios.otlp.json | 84 ++++++++ .../never-settling-promise.ios.otlp.json | 62 ++++++ verify/expected/odd-attributes.ios.otlp.json | 66 +++++++ verify/expected/rich-span.ios.otlp.json | 187 ++++++++++++++++++ verify/expected/root-no-leak.ios.otlp.json | 71 +++++++ verify/expected/smoke-js.ios.otlp.json | 34 ++++ verify/harness/nativeReplay.ts | 48 +++++ verify/stages/fast-jvm.ts | 47 +---- verify/stages/fast-swift.ts | 9 +- verify/static/packContents.test.ts | 2 +- verify/static/packContents.ts | 4 +- 34 files changed, 1702 insertions(+), 52 deletions(-) create mode 100644 Package.swift create mode 100644 ios/Core/Attributes.swift create mode 100644 ios/Core/OtelCore.swift create mode 100644 ios/Core/SeamModel.swift create mode 100644 ios/Core/SpanDataBuilder.swift create mode 100644 ios/CoreTests/AttributesTests.swift create mode 100644 ios/CoreTests/FixtureExportTests.swift create mode 100644 ios/CoreTests/FixtureJson.swift create mode 100644 ios/CoreTests/TimeRoundTripTests.swift create mode 100644 verify/expected/async-generator.ios.otlp.json create mode 100644 verify/expected/batching-shared-queue.ios.otlp.json create mode 100644 verify/expected/captured-then.ios.otlp.json create mode 100644 verify/expected/concurrent-interleaved.ios.otlp.json create mode 100644 verify/expected/error-in-callback.ios.otlp.json create mode 100644 verify/expected/export-headers.ios.otlp.json create mode 100644 verify/expected/handoff-basic.ios.otlp.json create mode 100644 verify/expected/interval-new-root.ios.otlp.json create mode 100644 verify/expected/nest-after-await.ios.otlp.json create mode 100644 verify/expected/nest-promise-all-race.ios.otlp.json create mode 100644 verify/expected/nest-timers-microtasks.ios.otlp.json create mode 100644 verify/expected/never-settling-promise.ios.otlp.json create mode 100644 verify/expected/odd-attributes.ios.otlp.json create mode 100644 verify/expected/rich-span.ios.otlp.json create mode 100644 verify/expected/root-no-leak.ios.otlp.json create mode 100644 verify/expected/smoke-js.ios.otlp.json create mode 100644 verify/harness/nativeReplay.ts diff --git a/.gitignore b/.gitignore index b309489..e2b9025 100644 --- a/.gitignore +++ b/.gitignore @@ -89,3 +89,8 @@ android/generated .superpowers/ verify/artifacts/ verify/e2e/.e2e/ + +# SwiftPM (Package.swift: ios/Core tests) +.build/ +.swiftpm/ +/Package.resolved diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..60616ca --- /dev/null +++ b/Package.swift @@ -0,0 +1,26 @@ +// swift-tools-version:6.0 +// The pure Swift core (ios/Core) and its tests, for `swift test` on the host (`bun verify fast-swift`). +// Apps never use this: CocoaPods builds ios/Core from the podspec, with the same opentelemetry-swift versions. +import PackageDescription + +let package = Package( + name: "ReactNativeOpenTelemetry", + platforms: [.iOS(.v15), .macOS(.v12)], + products: [.library(name: "OtelCore", targets: ["OtelCore"])], + dependencies: [ + .package(url: "https://github.com/open-telemetry/opentelemetry-swift", .upToNextMinor(from: "2.6.0")), + .package(url: "https://github.com/open-telemetry/opentelemetry-swift-core", .upToNextMinor(from: "2.6.0")), + ], + targets: [ + .target( + name: "OtelCore", + dependencies: [ + .product(name: "OpenTelemetryProtocolExporterHTTP", package: "opentelemetry-swift"), + .product(name: "OpenTelemetrySdk", package: "opentelemetry-swift-core"), + ], + path: "ios/Core" + ), + .testTarget(name: "OtelCoreTests", dependencies: ["OtelCore"], path: "ios/CoreTests"), + ], + swiftLanguageModes: [.v5] +) diff --git a/docs/superpowers/specs/2026-11-10-rn-otel-design.md b/docs/superpowers/specs/2026-11-10-rn-otel-design.md index 8d6a3b9..95659e5 100644 --- a/docs/superpowers/specs/2026-11-10-rn-otel-design.md +++ b/docs/superpowers/specs/2026-11-10-rn-otel-design.md @@ -592,8 +592,9 @@ tests: they don't care about internals, so internals can be rewritten freely. time; native: Gradle property `otelTestMode` / `OTEL_TEST_MODE=1` at `pod install`. Same flag for the bare and Expo apps; no test fields in the public API or the seam config: - **explicit timestamps**: v0 scenarios create all spans themselves, so they pass - `startTime` / `end(t)` explicitly (JS and native), in whole microseconds (exactly - representable on iOS). Clock stubs (Java `setClock`/`TestClock` in test source sets + `startTime` / `end(t)` explicitly (JS and native), in whole microseconds. iOS cannot + represent them exactly: opentelemetry-swift exports `Date`, a ~238–256 ns grid, so the `ios` + files record the quantized values (R22, measured floor in verify/VERIFY.md). Clock stubs (Java `setClock`/`TestClock` in test source sets only; Swift `with(clock:)`) are only a fallback for implicit reads. - sequential test ID generators, namespaced per side (JS `0a…01`, native `0b…01`) via upstream hooks: JS `sdk-trace` `idGenerator`, Java `setIdGenerator`, Swift diff --git a/ios/Core/Attributes.swift b/ios/Core/Attributes.swift new file mode 100644 index 0000000..78fd018 --- /dev/null +++ b/ios/Core/Attributes.swift @@ -0,0 +1,20 @@ +import OpenTelemetryApi + +// Number.isInteger(v): whole and finite (-0 included). Int64.max as Double is 2^63, hence the exclusive bound. +private func isLong(_ v: Double) -> Bool { v == v.rounded() && v >= -9.223372036854775807E18 && v < 9.223372036854775807E18 } + +/// JS numbers become `int` iff Number.isInteger (and they fit), else `double`; the same rule on JS, Kotlin, Swift. +func attributes(of list: [CoreAttribute]) -> [String: AttributeValue] { + var out = [String: AttributeValue](minimumCapacity: list.count) + for a in list { + switch a.value { + case let .string(v): out[a.key] = .string(v) + case let .bool(v): out[a.key] = .bool(v) + case let .number(v): out[a.key] = isLong(v) ? .int(Int(v)) : .double(v) + case let .strings(v): out[a.key] = .stringArray(v) + case let .bools(v): out[a.key] = .boolArray(v) + case let .numbers(v): out[a.key] = v.allSatisfy(isLong) ? .intArray(v.map { Int($0) }) : .doubleArray(v) + } + } + return out +} diff --git a/ios/Core/OtelCore.swift b/ios/Core/OtelCore.swift new file mode 100644 index 0000000..5525754 --- /dev/null +++ b/ios/Core/OtelCore.swift @@ -0,0 +1,65 @@ +import Foundation +import OpenTelemetryApi +import OpenTelemetryProtocolExporterCommon +import OpenTelemetryProtocolExporterHttp +import OpenTelemetrySdk + +/// Minimal config to export fixtures (R12); Task 19 adds tracesUrl, idempotent init and the distro attributes. +struct CoreConfig { + let serviceName: String + var serviceVersion: String? = nil + var resourceAttributes: [CoreAttribute] = [] + /// Base URL; `/v1/traces` is appended. + let exportUrl: String + var exportHeaders: [String: String] = [:] +} + +/// Test mode: `0b…` IDs, the native counterpart of JS `sequentialIds('0a')`. +private final class SequentialIds: IdGenerator, @unchecked Sendable { + private let lock = NSLock() + private var t = 0 + private var s = 0 + private func pad(_ n: Int, _ w: Int) -> String { "0b" + String(repeating: "0", count: w - String(n).count) + String(n) } + func generateTraceId() -> TraceId { lock.withLock { t += 1; return TraceId(fromHexString: pad(t, 30)) } } + func generateSpanId() -> SpanId { lock.withLock { s += 1; return SpanId(fromHexString: pad(s, 14)) } } +} + +final class OtelCore { + /// The one resource of the app; in test mode built from config only (no `telemetry.*`). + let resource: Resource + /// The native TracerProvider; JS spans join its batch processor. + let tracerProvider: TracerProviderSdk + private let bsp: BatchSpanProcessor + private let exporter: OtlpHttpTraceExporter + + init(config: CoreConfig, testMode: Bool = false) { + var attrs = attributes(of: config.resourceAttributes) + attrs["service.name"] = .string(config.serviceName) + if let v = config.serviceVersion { attrs["service.version"] = .string(v) } + resource = testMode ? Resource(attributes: attrs) : Resource().merging(other: Resource(attributes: attrs)) + + // ponytail: naive endpoint join; Task 19 brings tracesUrl ("append unless present") and URL validation. + let base = config.exportUrl.hasSuffix("/") ? String(config.exportUrl.dropLast()) : config.exportUrl + // envVarHeaders nil: the exporter would otherwise let OTEL_EXPORTER_OTLP_HEADERS replace the configured headers. + // compression none, as otel-java's default (the verify collector does not gunzip). + exporter = OtlpHttpTraceExporter(endpoint: URL(string: base + "/v1/traces")!, + config: OtlpConfiguration(compression: .none, headers: config.exportHeaders.map { ($0.key, $0.value) }), + envVarHeaders: nil) + bsp = BatchSpanProcessor(spanExporter: exporter) + let b = TracerProviderBuilder().with(resource: resource).add(spanProcessor: bsp) + tracerProvider = (testMode ? b.with(idGenerator: SequentialIds()) : b).build() + } + + /// JS-thread work: wrap and enqueue only; SpanData is built on the export queue. + func handOff(_ spans: [CoreSpan]) { + for s in spans { bsp.onEnd(span: JsReadableSpan(s, resource: resource)) } + } + + /// Blocks the caller up to `timeoutMs`. True when nothing is left unsent: the exporter requeues a failed batch, + /// and its `flush` retries it. + func flush(timeoutMs: Double) -> Bool { + let deadline = Date().addingTimeInterval(timeoutMs / 1000) + bsp.forceFlush(timeout: timeoutMs / 1000) + return exporter.flush(explicitTimeout: max(deadline.timeIntervalSinceNow, 0.001)) == .success + } +} diff --git a/ios/Core/SeamModel.swift b/ios/Core/SeamModel.swift new file mode 100644 index 0000000..a1a29a6 --- /dev/null +++ b/ios/Core/SeamModel.swift @@ -0,0 +1,78 @@ +import Foundation + +// Mirrors the Nitro seam (src/native/Otel.nitro.ts) without Nitro types; the iOS adapter converts. +// `Core` prefix: ios/Core and the generated Seam* structs share one module in the pod. + +/// OTel HrTime `[seconds, nanos]`. +struct HrTime { + let seconds: Double + let nanos: Double + + /// Never traps on the JS thread: missing elements read as 0 (C4). + init(_ a: [Double]) { + seconds = a.count > 0 ? a[0] : 0 + nanos = a.count > 1 ? a[1] : 0 + } + + /// R22: `Date` holds a Double of seconds, so whole µs come back on a ~256 ns grid (verify/VERIFY.md). + var date: Date { Date(timeIntervalSince1970: seconds + nanos / 1e9) } +} + +enum CoreValue { + case string(String) + case bool(Bool) + case number(Double) + case strings([String]) + case bools([Bool]) + case numbers([Double]) +} + +struct CoreAttribute { + let key: String + let value: CoreValue +} + +struct CoreSpanContext { + let traceId: String + let spanId: String + let traceFlags: Int + var traceState: String? = nil +} + +struct CoreEvent { + let name: String + let time: HrTime + let attributes: [CoreAttribute] +} + +struct CoreLink { + let context: CoreSpanContext + let attributes: [CoreAttribute] +} + +struct CoreScope { + let name: String + let version: String? + let schemaUrl: String? + let attributes: [CoreAttribute] +} + +struct CoreStatus { + let code: Int + let message: String? +} + +struct CoreSpan { + let context: CoreSpanContext + let parentSpanId: String? + let name: String + /// `@opentelemetry/api` SpanKind (INTERNAL = 0). + let kind: Int + let start: HrTime + let end: HrTime + let attributes: [CoreAttribute] + let events: [CoreEvent] + let links: [CoreLink] + let status: CoreStatus + let scope: CoreScope +} diff --git a/ios/Core/SpanDataBuilder.swift b/ios/Core/SpanDataBuilder.swift new file mode 100644 index 0000000..1fab4d8 --- /dev/null +++ b/ios/Core/SpanDataBuilder.swift @@ -0,0 +1,114 @@ +import Foundation +import OpenTelemetryApi +import OpenTelemetrySdk + +/// R21/C5: Swift's SpanKind cases are not in API order, so map the API value explicitly. Unknown -> INTERNAL. +func spanKind(_ k: Int) -> SpanKind { + switch k { + case 1: return .server + case 2: return .client + case 3: return .producer + case 4: return .consumer + default: return .internal + } +} + +/// API SpanStatusCode (UNSET 0, OK 1, ERROR 2). Unknown -> UNSET. +private func statusOf(_ s: CoreStatus) -> Status { + switch s.code { + case 1: return .ok + case 2: return .error(description: s.message ?? "") + default: return .unset + } +} + +private func traceState(_ s: String?) -> TraceState { + let entries = (s ?? "").split(separator: ",").compactMap { kv -> TraceState.Entry? in + guard let i = kv.firstIndex(of: "=") else { return nil } + return TraceState.Entry(key: kv[.. SpanContext { + SpanContext.create(traceId: TraceId(fromHexString: c.traceId), spanId: SpanId(fromHexString: c.spanId), + traceFlags: TraceFlags(fromByte: UInt8(truncatingIfNeeded: c.traceFlags)), traceState: traceState(c.traceState)) +} + +/// Fixed clock: a JS span is already over, nothing here may read the wall clock. +private final class FixedClock: Clock { + let now: Date + init(now: Date) { self.now = now } +} + +/** + * A finished JS span handed over the seam (R19): the frozen `ReadableSpan` the native BatchSpanProcessor queues. + * Only the span context is built on the JS thread (onEnd checks `sampled`); `toSpanData()` runs on the BSP worker. + * SpanData has no public initializer, so it is built through the SDK's own `SpanSdk`, the public factory upstream uses. + */ +final class JsReadableSpan: ReadableSpan, @unchecked Sendable { + private let span: CoreSpan + private let resource: Resource + let context: SpanContext + + init(_ span: CoreSpan, resource: Resource) { + self.span = span + self.resource = resource + context = spanContext(span.context) + } + + var kind: SpanKind { spanKind(span.kind) } + var isRecording: Bool { false } + var hasEnded: Bool { true } + var latency: TimeInterval { span.end.date.timeIntervalSince(span.start.date) } + var description: String { "JsReadableSpan{\(span.name)}" } + // frozen: setters and mutators are no-ops + var name: String { get { span.name } set {} } + var status: Status { get { statusOf(span.status) } set {} } + var instrumentationScopeInfo: InstrumentationScopeInfo { + InstrumentationScopeInfo(name: span.scope.name, version: span.scope.version, schemaUrl: span.scope.schemaUrl, + attributes: attributes(of: span.scope.attributes)) + } + + func getAttributes() -> [String: AttributeValue] { attributes(of: span.attributes) } + + func toSpanData() -> SpanData { + let attrs = getAttributes() + var dict = AttributesDictionary(capacity: max(attrs.count, 1)) + dict.updateValues(attributes: attrs) + let links = span.links.map { SpanData.Link(context: spanContext($0.context), attributes: attributes(of: $0.attributes)) } + let parent = span.parentSpanId.map { + SpanContext.create(traceId: context.traceId, spanId: SpanId(fromHexString: $0), traceFlags: context.traceFlags, traceState: context.traceState) + } + let end = span.end.date + let limits = SpanLimits() + .settingEventCountLimit(UInt(max(span.events.count, 1))) + .settingLinkCountLimit(UInt(max(links.count, 1))) + let sdk = SpanSdk.startSpan(context: context, name: span.name, instrumentationScopeInfo: instrumentationScopeInfo, + kind: kind, parentContext: parent, hasRemoteParent: false, spanLimits: limits, + spanProcessor: MultiSpanProcessor(spanProcessors: []), clock: FixedClock(now: end), + resource: resource, attributes: dict, links: links, totalRecordedLinks: links.count, + startTime: span.start.date) + for e in span.events { + sdk.addEvent(name: e.name, attributes: attributes(of: e.attributes), timestamp: e.time.date) + } + sdk.status = status + sdk.end(time: end) + return sdk.toSpanData() + } + + func setAttribute(key: String, value: AttributeValue?) {} + func setAttributes(_ attributes: [String: AttributeValue]) {} + func addEvent(name: String) {} + func addEvent(name: String, timestamp: Date) {} + func addEvent(name: String, attributes: [String: AttributeValue]) {} + func addEvent(name: String, attributes: [String: AttributeValue], timestamp: Date) {} + func addLink(spanContext: SpanContext, attributes: [String: AttributeValue]) {} + func recordException(_ exception: SpanException) {} + func recordException(_ exception: SpanException, timestamp: Date) {} + func recordException(_ exception: SpanException, attributes: [String: AttributeValue]) {} + func recordException(_ exception: SpanException, attributes: [String: AttributeValue], timestamp: Date) {} + func end() {} + func end(time: Date) {} +} diff --git a/ios/CoreTests/AttributesTests.swift b/ios/CoreTests/AttributesTests.swift new file mode 100644 index 0000000..8705edf --- /dev/null +++ b/ios/CoreTests/AttributesTests.swift @@ -0,0 +1,40 @@ +import OpenTelemetryApi +import XCTest +@testable import OtelCore + +final class AttributesTests: XCTestCase { + private func num(_ v: Double) -> AttributeValue? { attributes(of: [CoreAttribute(key: "k", value: .number(v))])["k"] } + + func testWholeIsLong() { XCTAssertEqual(num(1.0), .int(1)) } + func testFractionIsDouble() { XCTAssertEqual(num(1.5), .double(1.5)) } + func testBigWholeIsLong() { XCTAssertEqual(num(9.007199254740994E15), .int(9_007_199_254_740_994)) } + func testNanIsDouble() { + guard case let .double(d) = num(.nan) else { return XCTFail("not a double") } + XCTAssertTrue(d.isNaN) + } + func testInfIsDouble() { XCTAssertEqual(num(-.infinity), .double(-.infinity)) } + // C28: Number.isInteger(-0) is true, so -0 is intValue 0 (the reviewed odd-attributes contract) + func testNegZeroIsLong() { XCTAssertEqual(num(-0.0), .int(0)) } + func testBeyondLongIsDouble() { XCTAssertEqual(num(1e19), .double(1e19)) } + // 2^63 is the first double past Int64.max: Int(2^63) would trap + func testTwoTo63IsDouble() { XCTAssertEqual(num(9.223372036854775807E18), .double(9.223372036854775807E18)) } + + func testWholeArrayIsLongArray() { + XCTAssertEqual(attributes(of: [CoreAttribute(key: "k", value: .numbers([1, 2]))])["k"], .intArray([1, 2])) + } + + func testMixedArrayIsDoubleArray() { + XCTAssertEqual(attributes(of: [CoreAttribute(key: "k", value: .numbers([1, 2.5]))])["k"], .doubleArray([1, 2.5])) + } + + // C4: a short HrTime never traps on the JS thread + func testShortHrTimeReadsZero() { + XCTAssertEqual(HrTime([]).seconds, 0) + XCTAssertEqual(HrTime([5]).nanos, 0) + } + + // R21/C5: Swift's SpanKind cases are not in API order; map by value + func testKindByValue() { + XCTAssertEqual([0, 1, 2, 3, 4, 9, -1].map(spanKind), [.internal, .server, .client, .producer, .consumer, .internal, .internal]) + } +} diff --git a/ios/CoreTests/FixtureExportTests.swift b/ios/CoreTests/FixtureExportTests.swift new file mode 100644 index 0000000..f90075b --- /dev/null +++ b/ios/CoreTests/FixtureExportTests.swift @@ -0,0 +1,41 @@ +import Foundation +import XCTest +@testable import OtelCore + +/// Every seam fixture through the core into the live collector; fast-swift compares the `ios` artifacts in Node. +final class FixtureExportTests: XCTestCase { + private let collector = ProcessInfo.processInfo.environment["VERIFY_COLLECTOR"] ?? "" + private let fixtures = URL(fileURLWithPath: #filePath).deletingLastPathComponent() + .appendingPathComponent("../../verify/fixtures").standardizedFileURL + + private func control(_ path: String, _ body: [String: String] = [:]) throws { + var req = URLRequest(url: URL(string: "\(collector)/_verify/\(path)")!, timeoutInterval: 30) + req.httpMethod = "POST" + req.setValue("application/json", forHTTPHeaderField: "content-type") + req.httpBody = try JSONSerialization.data(withJSONObject: body) + let done = DispatchSemaphore(value: 0) + var status = 0 + URLSession.shared.dataTask(with: req) { _, res, _ in + status = (res as? HTTPURLResponse)?.statusCode ?? 0 + done.signal() + }.resume() + done.wait() + XCTAssertEqual(status, 200, "collector \(path)") + } + + func testEveryFixtureExports() throws { + try XCTSkipIf(collector.isEmpty, "VERIFY_COLLECTOR is not set: run through `bun verify fast-swift`") + let files = try FileManager.default.contentsOfDirectory(atPath: fixtures.path) + .filter { $0.hasSuffix(".handoff.json") }.sorted() + XCTAssertFalse(files.isEmpty) + for f in files { + let name = String(f.dropLast(".handoff.json".count)) + let (config, spans) = try FixtureJson.parse(Data(contentsOf: fixtures.appendingPathComponent(f)), exportUrl: collector) + try control("begin", ["scenario": name, "platform": "ios"]) + let core = OtelCore(config: config, testMode: true) + core.handOff(spans) + XCTAssertTrue(core.flush(timeoutMs: 10_000), "\(name): flush failed") + try control("end") + } + } +} diff --git a/ios/CoreTests/FixtureJson.swift b/ios/CoreTests/FixtureJson.swift new file mode 100644 index 0000000..54419eb --- /dev/null +++ b/ios/CoreTests/FixtureJson.swift @@ -0,0 +1,85 @@ +import Foundation +@testable import OtelCore + +/// Test reader for verify/fixtures/.handoff.json; NaN, ±Infinity and -0 arrive as {"$num": ""}. +enum FixtureJson { + static func parse(_ data: Data, exportUrl: String) throws -> (CoreConfig, [CoreSpan]) { + let root = try JSONSerialization.jsonObject(with: data) as! [String: Any] + let c = root["config"] as! [String: Any] + let config = CoreConfig( + serviceName: c["serviceName"] as! String, + serviceVersion: c["serviceVersion"] as? String, + resourceAttributes: attrs(c["resourceAttributes"]), + exportUrl: (c["exportUrl"] as! String).replacingOccurrences(of: "", with: exportUrl), + exportHeaders: Dictionary(attrs(c["exportHeaders"]).map { a -> (String, String) in + guard case let .string(v) = a.value else { fatalError("header \(a.key) is not a string") } + return (a.key, v) + }, uniquingKeysWith: { _, b in b }) + ) + return (config, (root["spans"] as! [[String: Any]]).map(span)) + } + + private static func isBool(_ v: Any) -> Bool { + guard let n = v as? NSNumber else { return false } + return CFGetTypeID(n) == CFBooleanGetTypeID() + } + + private static func num(_ v: Any) -> Double { + if let o = v as? [String: Any], let s = o["$num"] as? String { + switch s { + case "-0": return -0.0 + case "NaN": return .nan + case "Infinity": return .infinity + case "-Infinity": return -.infinity + default: fatalError("unknown $num \(s)") + } + } + return (v as! NSNumber).doubleValue + } + + private static func time(_ v: Any?) -> HrTime { HrTime((v as! [Any]).map(num)) } + + private static func value(_ v: Any) -> CoreValue { + if let a = v as? [Any] { + guard let first = a.first else { return .bools([]) } + if first is String { return .strings(a.map { $0 as! String }) } + if isBool(first) { return .bools(a.map { ($0 as! NSNumber).boolValue }) } + return .numbers(a.map(num)) + } + if let s = v as? String { return .string(s) } + if isBool(v) { return .bool((v as! NSNumber).boolValue) } + return .number(num(v)) + } + + private static func attrs(_ v: Any?) -> [CoreAttribute] { + (v as? [[String: Any]] ?? []).map { CoreAttribute(key: $0["key"] as! String, value: value($0["value"]!)) } + } + + private static func ctx(_ o: [String: Any]) -> CoreSpanContext { + CoreSpanContext(traceId: o["traceId"] as! String, spanId: o["spanId"] as! String, + traceFlags: (o["traceFlags"] as! NSNumber).intValue, traceState: o["traceState"] as? String) + } + + private static func span(_ o: [String: Any]) -> CoreSpan { + let scope = o["scope"] as! [String: Any] + let status = o["status"] as! [String: Any] + return CoreSpan( + context: ctx(o["context"] as! [String: Any]), + parentSpanId: o["parentSpanId"] as? String, + name: o["name"] as! String, + kind: (o["kind"] as! NSNumber).intValue, + start: time(o["start"]), + end: time(o["end"]), + attributes: attrs(o["attributes"]), + events: (o["events"] as! [[String: Any]]).map { + CoreEvent(name: $0["name"] as! String, time: time($0["time"]), attributes: attrs($0["attributes"])) + }, + links: (o["links"] as! [[String: Any]]).map { + CoreLink(context: ctx($0["context"] as! [String: Any]), attributes: attrs($0["attributes"])) + }, + status: CoreStatus(code: (status["code"] as! NSNumber).intValue, message: status["message"] as? String), + scope: CoreScope(name: scope["name"] as! String, version: scope["version"] as? String, + schemaUrl: scope["schemaUrl"] as? String, attributes: attrs(scope["attributes"])) + ) + } +} diff --git a/ios/CoreTests/TimeRoundTripTests.swift b/ios/CoreTests/TimeRoundTripTests.swift new file mode 100644 index 0000000..70d6bd0 --- /dev/null +++ b/ios/CoreTests/TimeRoundTripTests.swift @@ -0,0 +1,37 @@ +import OpenTelemetryApi +import OpenTelemetryProtocolExporterCommon +import OpenTelemetrySdk +import XCTest +@testable import OtelCore + +/// R22/F8: opentelemetry-swift keeps times as `Date` and exports `UInt64(timeIntervalSince1970 * 1e9)`, so +/// whole-µs seam times cannot come back exact. This documents the floor; the drafted `ios` files record the +/// quantized values as emitted. +final class TimeRoundTripTests: XCTestCase { + private let base: UInt64 = 1_767_225_600_000_000_000 + private func at(_ us: UInt64) -> HrTime { HrTime([Double(1_767_225_600 + us / 1_000_000), Double(us % 1_000_000 * 1000)]) } + + private func exported(_ t: HrTime) -> UInt64 { + let span = CoreSpan(context: CoreSpanContext(traceId: "0a000000000000000000000000000001", spanId: "0a00000000000001", traceFlags: 1), + parentSpanId: nil, name: "t", kind: 0, start: t, end: t, attributes: [], events: [], links: [], + status: CoreStatus(code: 0, message: nil), scope: CoreScope(name: "t", version: nil, schemaUrl: nil, attributes: [])) + return SpanAdapter.toProtoSpan(spanData: JsReadableSpan(span, resource: Resource(attributes: [:])).toSpanData()).startTimeUnixNano + } + + func testWholeMicrosecondsQuantizeWithinTheDateFloor() { + var maxErr: Int64 = 0 + var exact = 0 + let samples = Array(0 ... 10_000) + [1_000_000_000] + for us in samples { + let want = base + UInt64(us) * 1000 + let got = exported(at(UInt64(us))) + let err = Int64(bitPattern: got &- want) + maxErr = max(maxErr, abs(err)) + if err == 0 { exact += 1 } + } + print("TimeRoundTrip: max |error| \(maxErr) ns, \(exact)/\(samples.count) exact") + // the exported value is a double near 1.77e18, whose grid is 256 ns + XCTAssertLessThanOrEqual(maxErr, 256) + XCTAssertLessThan(exact, samples.count, "times came back exact: R22 no longer holds, revisit the floor in VERIFY.md") + } +} diff --git a/package.json b/package.json index ddc8a8f..23a5a71 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "!ios/build", "!android/build", "!android/core-jvm", + "!ios/CoreTests", "!android/gradle", "!android/gradlew", "!android/gradlew.bat", diff --git a/verify/VERIFY.md b/verify/VERIFY.md index 4406654..77b4052 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -16,6 +16,18 @@ E2E_TARGET=android-bare bun verify --e2e e2e # or ios-bare; omit E2E_TARGET fo Gradle wrapper) into a collector on a free port and compares `.android.otlp.json`. The JVM tests run otel-java's own OkHttp 5; devices run React Native's OkHttp 4.9.2. +`fast-swift` (macOS only; skips elsewhere) does the same through the Swift core: `swift test` over `Package.swift` +(`ios/Core`, tests in `ios/CoreTests`) into `.ios.otlp.json`. Both stages share `harness/nativeReplay.ts`. + +**iOS time floor (R22).** opentelemetry-swift 2.6 keeps times as `Date` and exports +`UInt64(timeIntervalSince1970 * 1e9)`, so whole-µs seam times come back on a ~238–256 ns grid, truncated: +`TimeRoundTripTests` measures `at(0…10_000)` and `at(1_000_000_000)` at **max |error| 240 ns, 314 of 10 002 exact**. +`*.ios.otlp.json` record these quantized values as emitted (deterministic); shapes ignore times. + +**iOS vs Android/JS goldens.** Apart from times, the `ios` files differ only by what the opentelemetry-swift 2.6 OTLP +encoder (`SpanAdapter`) never writes: span and link `flags` (257), link `traceState`, and the scope `schemaUrl` on +`ScopeSpans`. The core passes all three into `SpanData`; the exporter drops them. + The fake collector listens on port 4318; the app reaches it at `10.0.2.2` (Android emulator) or `localhost` (iOS simulator). ## Device capability check (Task 7, 2026-11-23) diff --git a/verify/expected/async-generator.ios.otlp.json b/verify/expected/async-generator.ios.otlp.json new file mode 100644 index 0000000..2de36e5 --- /dev/null +++ b/verify/expected/async-generator.ios.otlp.json @@ -0,0 +1,74 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000060160", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "gen.0", + "kind": 1, + "startTimeUnixNano": "1767225600000009984", + "endTimeUnixNano": "1767225600000011008", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "loop.0", + "kind": 1, + "startTimeUnixNano": "1767225600000019968", + "endTimeUnixNano": "1767225600000020992", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "gen.1", + "kind": 1, + "startTimeUnixNano": "1767225600000029952", + "endTimeUnixNano": "1767225600000030976", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "parentSpanId": "0a00000000000001", + "name": "loop.1", + "kind": 1, + "startTimeUnixNano": "1767225600000039936", + "endTimeUnixNano": "1767225600000040960", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/batching-shared-queue.ios.otlp.json b/verify/expected/batching-shared-queue.ios.otlp.json new file mode 100644 index 0000000..aa5fd24 --- /dev/null +++ b/verify/expected/batching-shared-queue.ios.otlp.json @@ -0,0 +1,63 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "h1", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000001024", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000002", + "name": "h2", + "kind": 1, + "startTimeUnixNano": "1767225600000001792", + "endTimeUnixNano": "1767225600000003072", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "h1.work", + "kind": 1, + "startTimeUnixNano": "1767225600000009984", + "endTimeUnixNano": "1767225600000011008", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "h2.work", + "kind": 1, + "startTimeUnixNano": "1767225600000019968", + "endTimeUnixNano": "1767225600000020992", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/captured-then.ios.otlp.json b/verify/expected/captured-then.ios.otlp.json new file mode 100644 index 0000000..e4c96d7 --- /dev/null +++ b/verify/expected/captured-then.ios.otlp.json @@ -0,0 +1,53 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000029952", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "kept", + "kind": 1, + "startTimeUnixNano": "1767225600000009984", + "endTimeUnixNano": "1767225600000011008", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "name": "lost", + "kind": 1, + "startTimeUnixNano": "1767225600000019968", + "endTimeUnixNano": "1767225600000020992", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/concurrent-interleaved.ios.otlp.json b/verify/expected/concurrent-interleaved.ios.otlp.json new file mode 100644 index 0000000..00a0eea --- /dev/null +++ b/verify/expected/concurrent-interleaved.ios.otlp.json @@ -0,0 +1,92 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "a", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000029952", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000002", + "name": "b", + "kind": 1, + "startTimeUnixNano": "1767225600000001024", + "endTimeUnixNano": "1767225600000030976", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "a.1", + "kind": 1, + "startTimeUnixNano": "1767225600000009984", + "endTimeUnixNano": "1767225600000011008", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000002", + "name": "b.1", + "kind": 1, + "startTimeUnixNano": "1767225600000011008", + "endTimeUnixNano": "1767225600000012032", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "parentSpanId": "0a00000000000001", + "name": "a.2", + "kind": 1, + "startTimeUnixNano": "1767225600000019968", + "endTimeUnixNano": "1767225600000020992", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000006", + "parentSpanId": "0a00000000000002", + "name": "b.2", + "kind": 1, + "startTimeUnixNano": "1767225600000020992", + "endTimeUnixNano": "1767225600000022016", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000007", + "name": "after.all", + "kind": 1, + "startTimeUnixNano": "1767225600000039936", + "endTimeUnixNano": "1767225600000040960", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/error-in-callback.ios.otlp.json b/verify/expected/error-in-callback.ios.otlp.json new file mode 100644 index 0000000..d33bfd1 --- /dev/null +++ b/verify/expected/error-in-callback.ios.otlp.json @@ -0,0 +1,63 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000039936", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "throws", + "kind": 1, + "startTimeUnixNano": "1767225600000009984", + "endTimeUnixNano": "1767225600000011008", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "name": "root.next", + "kind": 1, + "startTimeUnixNano": "1767225600000029952", + "endTimeUnixNano": "1767225600000030976", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "caught", + "kind": 1, + "startTimeUnixNano": "1767225600000019968", + "endTimeUnixNano": "1767225600000020992", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/export-headers.ios.otlp.json b/verify/expected/export-headers.ios.otlp.json new file mode 100644 index 0000000..f5daea6 --- /dev/null +++ b/verify/expected/export-headers.ios.otlp.json @@ -0,0 +1,34 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "headers", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000009984", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/handoff-basic.ios.otlp.json b/verify/expected/handoff-basic.ios.otlp.json new file mode 100644 index 0000000..a71b84e --- /dev/null +++ b/verify/expected/handoff-basic.ios.otlp.json @@ -0,0 +1,42 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000099840", + "attributes": [ + { + "key": "app.step", + "value": { + "stringValue": "one" + } + } + ], + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/interval-new-root.ios.otlp.json b/verify/expected/interval-new-root.ios.otlp.json new file mode 100644 index 0000000..9da980a --- /dev/null +++ b/verify/expected/interval-new-root.ios.otlp.json @@ -0,0 +1,62 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "tap", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000400128", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000002", + "name": "tick", + "kind": 1, + "startTimeUnixNano": "1767225600000099840", + "endTimeUnixNano": "1767225600000101120", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000003", + "name": "tick", + "kind": 1, + "startTimeUnixNano": "1767225600000199936", + "endTimeUnixNano": "1767225600000200960", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "load", + "kind": 1, + "startTimeUnixNano": "1767225600000300032", + "endTimeUnixNano": "1767225600000300800", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/nest-after-await.ios.otlp.json b/verify/expected/nest-after-await.ios.otlp.json new file mode 100644 index 0000000..dbc627d --- /dev/null +++ b/verify/expected/nest-after-await.ios.otlp.json @@ -0,0 +1,44 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000029952", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "child", + "kind": 1, + "startTimeUnixNano": "1767225600000009984", + "endTimeUnixNano": "1767225600000019968", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/nest-promise-all-race.ios.otlp.json b/verify/expected/nest-promise-all-race.ios.otlp.json new file mode 100644 index 0000000..788695b --- /dev/null +++ b/verify/expected/nest-promise-all-race.ios.otlp.json @@ -0,0 +1,84 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000060160", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "all.a", + "kind": 1, + "startTimeUnixNano": "1767225600000009984", + "endTimeUnixNano": "1767225600000011008", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "all.b", + "kind": 1, + "startTimeUnixNano": "1767225600000019968", + "endTimeUnixNano": "1767225600000020992", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "race.a", + "kind": 1, + "startTimeUnixNano": "1767225600000029952", + "endTimeUnixNano": "1767225600000030976", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "parentSpanId": "0a00000000000001", + "name": "race.b", + "kind": 1, + "startTimeUnixNano": "1767225600000039936", + "endTimeUnixNano": "1767225600000040960", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000006", + "parentSpanId": "0a00000000000001", + "name": "after", + "kind": 1, + "startTimeUnixNano": "1767225600000050176", + "endTimeUnixNano": "1767225600000050944", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/nest-timers-microtasks.ios.otlp.json b/verify/expected/nest-timers-microtasks.ios.otlp.json new file mode 100644 index 0000000..ca0a0b3 --- /dev/null +++ b/verify/expected/nest-timers-microtasks.ios.otlp.json @@ -0,0 +1,84 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000050176", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "timeout", + "kind": 1, + "startTimeUnixNano": "1767225600000009984", + "endTimeUnixNano": "1767225600000011008", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "immediate", + "kind": 1, + "startTimeUnixNano": "1767225600000019968", + "endTimeUnixNano": "1767225600000020992", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "microtask", + "kind": 1, + "startTimeUnixNano": "1767225600000029952", + "endTimeUnixNano": "1767225600000030976", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "parentSpanId": "0a00000000000001", + "name": "timeout.microtask", + "kind": 1, + "startTimeUnixNano": "1767225600000039936", + "endTimeUnixNano": "1767225600000040960", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000006", + "parentSpanId": "0a00000000000001", + "name": "after.end", + "kind": 1, + "startTimeUnixNano": "1767225600000060160", + "endTimeUnixNano": "1767225600000060928", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/never-settling-promise.ios.otlp.json b/verify/expected/never-settling-promise.ios.otlp.json new file mode 100644 index 0000000..7fa1586 --- /dev/null +++ b/verify/expected/never-settling-promise.ios.otlp.json @@ -0,0 +1,62 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000019968", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "child", + "kind": 1, + "startTimeUnixNano": "1767225600000009984", + "endTimeUnixNano": "1767225600000011008", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "name": "later.await", + "kind": 1, + "startTimeUnixNano": "1767225600000029952", + "endTimeUnixNano": "1767225600000030976", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000004", + "name": "later.timeout", + "kind": 1, + "startTimeUnixNano": "1767225600000039936", + "endTimeUnixNano": "1767225600000040960", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/odd-attributes.ios.otlp.json b/verify/expected/odd-attributes.ios.otlp.json new file mode 100644 index 0000000..5110ca6 --- /dev/null +++ b/verify/expected/odd-attributes.ios.otlp.json @@ -0,0 +1,66 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "odd", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000009984", + "attributes": [ + { + "key": "big", + "value": { + "intValue": "9007199254740994" + } + }, + { + "key": "empty", + "value": { + "arrayValue": {} + } + }, + { + "key": "inf", + "value": { + "doubleValue": "Infinity" + } + }, + { + "key": "nan", + "value": { + "doubleValue": "NaN" + } + }, + { + "key": "negZero", + "value": { + "intValue": "0" + } + } + ], + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/rich-span.ios.otlp.json b/verify/expected/rich-span.ios.otlp.json new file mode 100644 index 0000000..61ff887 --- /dev/null +++ b/verify/expected/rich-span.ios.otlp.json @@ -0,0 +1,187 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify.rich", + "version": "1.2.3", + "attributes": [ + { + "key": "scope.key", + "value": { + "stringValue": "scope-value" + } + } + ] + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "rich", + "kind": 3, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000099840", + "attributes": [ + { + "key": "bool", + "value": { + "boolValue": true + } + }, + { + "key": "bools", + "value": { + "arrayValue": { + "values": [ + { + "boolValue": true + }, + { + "boolValue": false + } + ] + } + } + }, + { + "key": "double", + "value": { + "doubleValue": 1.5 + } + }, + { + "key": "doubles", + "value": { + "arrayValue": { + "values": [ + { + "doubleValue": 1.5 + }, + { + "doubleValue": 2.5 + } + ] + } + } + }, + { + "key": "int", + "value": { + "intValue": "42" + } + }, + { + "key": "ints", + "value": { + "arrayValue": { + "values": [ + { + "intValue": "1" + }, + { + "intValue": "2" + }, + { + "intValue": "3" + } + ] + } + } + }, + { + "key": "str", + "value": { + "stringValue": "zażółć 🚀" + } + }, + { + "key": "strs", + "value": { + "arrayValue": { + "values": [ + { + "stringValue": "a" + }, + { + "stringValue": "b" + } + ] + } + } + } + ], + "events": [ + { + "timeUnixNano": "1767225600000009984", + "name": "first", + "attributes": [ + { + "key": "event.key", + "value": { + "stringValue": "e1" + } + }, + { + "key": "event.n", + "value": { + "intValue": "1" + } + } + ] + }, + { + "timeUnixNano": "1767225600000019968", + "name": "second", + "attributes": [ + { + "key": "event.ok", + "value": { + "boolValue": true + } + } + ] + } + ], + "links": [ + { + "traceId": "0f111111111111111111111111111111", + "spanId": "0f22222222222222", + "attributes": [ + { + "key": "link.key", + "value": { + "stringValue": "link-value" + } + }, + { + "key": "link.n", + "value": { + "intValue": "7" + } + } + ] + } + ], + "status": { + "message": "boom", + "code": 2 + } + } + ] + } + ] + } + ] +} diff --git a/verify/expected/root-no-leak.ios.otlp.json b/verify/expected/root-no-leak.ios.otlp.json new file mode 100644 index 0000000..2e0b2be --- /dev/null +++ b/verify/expected/root-no-leak.ios.otlp.json @@ -0,0 +1,71 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "scoped", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000019968", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "scoped.child", + "kind": 1, + "startTimeUnixNano": "1767225600000009984", + "endTimeUnixNano": "1767225600000011008", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "name": "after.sync", + "kind": 1, + "startTimeUnixNano": "1767225600000029952", + "endTimeUnixNano": "1767225600000030976", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000004", + "name": "after.await", + "kind": 1, + "startTimeUnixNano": "1767225600000039936", + "endTimeUnixNano": "1767225600000040960", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000004", + "spanId": "0a00000000000005", + "name": "after.timeout", + "kind": 1, + "startTimeUnixNano": "1767225600000050176", + "endTimeUnixNano": "1767225600000050944", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/smoke-js.ios.otlp.json b/verify/expected/smoke-js.ios.otlp.json new file mode 100644 index 0000000..18cebea --- /dev/null +++ b/verify/expected/smoke-js.ios.otlp.json @@ -0,0 +1,34 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "smoke", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000001024", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/harness/nativeReplay.ts b/verify/harness/nativeReplay.ts new file mode 100644 index 0000000..91bb5c1 --- /dev/null +++ b/verify/harness/nativeReplay.ts @@ -0,0 +1,48 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import {spawn} from 'node:child_process'; +import {startCollector} from './collector'; +import {compareToExpected, type Platform} from './compare'; + +const root = path.join(import.meta.dirname, '..', '..'); +const artifacts = path.join(root, 'verify', 'artifacts'); + +// The collector must keep serving while the native tests run, so no spawnSync (ctx.sh) here. +const run = (cmd: string, args: string[], cwd: string, env: NodeJS.ProcessEnv) => + new Promise((ok, fail) => + spawn(cmd, args, {cwd, env, stdio: 'inherit'}).on('error', fail) + .on('exit', (c, sig) => (c === 0 ? ok() : fail(new Error(`${cmd} exited ${c ?? sig}`)))), + ); + +/** + * Replays every verify/fixtures/.handoff.json through a native core: starts a collector on a free port, runs + * `cmd` with VERIFY_COLLECTOR set, then compares each `..otlp.json` artifact (shape first). + */ +export async function replayFixtures(platform: Platform, cmd: string, args: string[], cwd: string) { + const names = fs.readdirSync(path.join(root, 'verify', 'fixtures')) + .filter(f => f.endsWith('.handoff.json')) + .map(f => f.slice(0, -'.handoff.json'.length)) + .sort(); + for (const n of names) fs.rmSync(path.join(artifacts, `${n}.${platform}.otlp.json`), {force: true}); + const collector = await startCollector({port: 0}); + try { + await run(cmd, args, cwd, {...process.env, VERIFY_COLLECTOR: collector.url}); + } finally { + await collector.close(); + } + const failed: string[] = []; + for (const n of names) { + const f = path.join(artifacts, `${n}.${platform}.otlp.json`); + if (!fs.existsSync(f)) throw new Error(`${n}: the ${platform} test exported nothing (missing ${f})`); + const {ok, report} = compareToExpected(n, platform, JSON.parse(fs.readFileSync(f, 'utf8'))); + if (report) console.log(report); + if (!ok) failed.push(n); + } + // R11: configured export headers reach the collector + const raw = path.join(artifacts, 'raw', `export-headers.${platform}`); + const hdr = fs.readdirSync(raw).filter(f => f.endsWith('.headers.json')); + if (!hdr.length || !hdr.every(f => JSON.parse(fs.readFileSync(path.join(raw, f), 'utf8'))['x-api-key'] === 'test')) + failed.push('export-headers (x-api-key: test missing in headers.json)'); + if (failed.length) throw new Error(`${platform} mismatch: ${failed.join(', ')}`); + return names.length; +} diff --git a/verify/stages/fast-jvm.ts b/verify/stages/fast-jvm.ts index 0762b55..248ad2a 100644 --- a/verify/stages/fast-jvm.ts +++ b/verify/stages/fast-jvm.ts @@ -1,54 +1,15 @@ -import fs from 'node:fs'; import path from 'node:path'; -import {spawn} from 'node:child_process'; import type {Stage} from '../run'; -import {startCollector} from '../harness/collector'; -import {compareToExpected} from '../harness/compare'; - -const root = path.join(import.meta.dirname, '..', '..'); -const artifacts = path.join(root, 'verify', 'artifacts'); - -// The collector must keep serving while Gradle runs, so no spawnSync (ctx.sh) here. -const run = (cmd: string, args: string[], cwd: string, env: NodeJS.ProcessEnv) => - new Promise((ok, fail) => - spawn(cmd, args, {cwd, env, stdio: 'inherit'}).on('error', fail) - .on('exit', (c, sig) => (c === 0 ? ok() : fail(new Error(`${cmd} exited ${c ?? sig}`)))), - ); +import {replayFixtures} from '../harness/nativeReplay'; const stage: Stage = { name: 'fast-jvm', order: 25, e2e: false, async run() { - const names = fs.readdirSync(path.join(root, 'verify', 'fixtures')) - .filter(f => f.endsWith('.handoff.json')) - .map(f => f.slice(0, -'.handoff.json'.length)) - .sort(); - for (const n of names) fs.rmSync(path.join(artifacts, `${n}.android.otlp.json`), {force: true}); - const collector = await startCollector({port: 0}); - try { - await run('./gradlew', ['test', '--console=plain', '-q'], path.join(root, 'android', 'core-jvm'), { - ...process.env, - VERIFY_COLLECTOR: collector.url, - }); - } finally { - await collector.close(); - } - const failed: string[] = []; - for (const n of names) { - const f = path.join(artifacts, `${n}.android.otlp.json`); - if (!fs.existsSync(f)) throw new Error(`${n}: the JVM test exported nothing (missing ${f})`); - const {ok, report} = compareToExpected(n, 'android', JSON.parse(fs.readFileSync(f, 'utf8'))); - if (report) console.log(report); - if (!ok) failed.push(n); - } - // R11: configured export headers reach the collector - const raw = path.join(artifacts, 'raw', 'export-headers.android'); - const hdr = fs.readdirSync(raw).filter(f => f.endsWith('.headers.json')); - if (!hdr.length || !hdr.every(f => JSON.parse(fs.readFileSync(path.join(raw, f), 'utf8'))['x-api-key'] === 'test')) - failed.push('export-headers (x-api-key: test missing in headers.json)'); - if (failed.length) throw new Error(`android mismatch: ${failed.join(', ')}`); - console.log(`fast-jvm: ${names.length} fixtures match their android files`); + const cwd = path.join(import.meta.dirname, '..', '..', 'android', 'core-jvm'); + const n = await replayFixtures('android', './gradlew', ['test', '--console=plain', '-q'], cwd); + console.log(`fast-jvm: ${n} fixtures match their android files`); }, }; diff --git a/verify/stages/fast-swift.ts b/verify/stages/fast-swift.ts index 44c5fc9..1a21f77 100644 --- a/verify/stages/fast-swift.ts +++ b/verify/stages/fast-swift.ts @@ -1,14 +1,15 @@ -import {existsSync} from 'node:fs'; +import path from 'node:path'; import type {Stage} from '../run'; +import {replayFixtures} from '../harness/nativeReplay'; const stage: Stage = { name: 'fast-swift', order: 30, e2e: false, - run({sh}) { + async run() { if (process.platform !== 'darwin') return void console.log('skipped: not macOS'); - if (!existsSync('Package.swift')) return void console.log('skipped: no Package.swift'); - sh(['swift', 'test']); + const n = await replayFixtures('ios', 'swift', ['test'], path.join(import.meta.dirname, '..', '..')); + console.log(`fast-swift: ${n} fixtures match their ios files`); }, }; diff --git a/verify/static/packContents.test.ts b/verify/static/packContents.test.ts index 5a5394e..8211bf1 100644 --- a/verify/static/packContents.test.ts +++ b/verify/static/packContents.test.ts @@ -1,6 +1,6 @@ import {packContents} from './packContents'; -const complete = ['package.json', 'lib/module/index.js', 'src/index.ts', 'nitrogen/generated/x.hpp', 'metro/index.js', 'android/build.gradle', 'ios/Adapter/HybridOtel.swift', 'ReactNativeOpenTelemetry.podspec']; +const complete = ['package.json', 'lib/module/index.js', 'src/index.ts', 'nitrogen/generated/x.hpp', 'metro/index.js', 'android/build.gradle', 'ios/Adapter/HybridOtel.swift', 'Package.swift', 'ReactNativeOpenTelemetry.podspec']; test('reports missing nitrogen/', () => { expect(packContents(complete.filter(p => !p.startsWith('nitrogen/')))).toEqual(['nitrogen/']); diff --git a/verify/static/packContents.ts b/verify/static/packContents.ts index b4c9ff5..158e26a 100644 --- a/verify/static/packContents.ts +++ b/verify/static/packContents.ts @@ -1,5 +1,5 @@ -// Package.swift joins with Task 18 and vite/ with Task 22, which create them. -export const REQUIRED = ['package.json', 'lib/', 'src/', 'nitrogen/', 'metro/', 'android/', 'ios/', 'ReactNativeOpenTelemetry.podspec']; +// vite/ joins with Task 22, which creates it. Package.swift (Task 18) is listed by spec §9.4 stage 1. +export const REQUIRED = ['package.json', 'lib/', 'src/', 'nitrogen/', 'metro/', 'android/', 'ios/', 'Package.swift', 'ReactNativeOpenTelemetry.podspec']; /** Returns the required paths missing from the `npm pack --dry-run --json` file list. */ export function packContents(list: string[], required: string[] = REQUIRED): string[] { From 4bd09207ecd2d5f1417ca554e66e23d7196e224b Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:41:29 +0100 Subject: [PATCH 22/76] fix(ios-core): exporter headers via envVarHeaders, gzip on; conditional test target Co-Authored-By: Claude Opus 5.5 --- Package.swift | 7 +++++-- docs/superpowers/specs/2026-11-10-rn-otel-design.md | 4 +++- ios/Core/OtelCore.swift | 11 ++++++----- verify/VERIFY.md | 5 +++-- verify/harness/__tests__/collector.test.ts | 12 ++++++++++++ verify/harness/collector.ts | 5 ++++- 6 files changed, 33 insertions(+), 11 deletions(-) diff --git a/Package.swift b/Package.swift index 60616ca..4f87969 100644 --- a/Package.swift +++ b/Package.swift @@ -1,8 +1,12 @@ // swift-tools-version:6.0 // The pure Swift core (ios/Core) and its tests, for `swift test` on the host (`bun verify fast-swift`). // Apps never use this: CocoaPods builds ios/Core from the podspec, with the same opentelemetry-swift versions. +import Foundation import PackageDescription +// ios/CoreTests is not in the npm package (package.json `files`), so the test target exists only in the repo. +let hasTests = FileManager.default.fileExists(atPath: URL(fileURLWithPath: #filePath).deletingLastPathComponent().appendingPathComponent("ios/CoreTests").path) + let package = Package( name: "ReactNativeOpenTelemetry", platforms: [.iOS(.v15), .macOS(.v12)], @@ -20,7 +24,6 @@ let package = Package( ], path: "ios/Core" ), - .testTarget(name: "OtelCoreTests", dependencies: ["OtelCore"], path: "ios/CoreTests"), - ], + ] + (hasTests ? [.testTarget(name: "OtelCoreTests", dependencies: ["OtelCore"], path: "ios/CoreTests")] : []), swiftLanguageModes: [.v5] ) diff --git a/docs/superpowers/specs/2026-11-10-rn-otel-design.md b/docs/superpowers/specs/2026-11-10-rn-otel-design.md index 95659e5..c93a727 100644 --- a/docs/superpowers/specs/2026-11-10-rn-otel-design.md +++ b/docs/superpowers/specs/2026-11-10-rn-otel-design.md @@ -610,7 +610,9 @@ tests: they don't care about internals, so internals can be rewritten freely. output is reduced to a shape and must equal it, so all platforms agree with each other by construction. Shapes are written first; exact per-platform files are then drafted with `--update` and reviewed (council review: hand-writing 30+ exact OTLP trees puts the bugs - in the expected files). + in the expected files). Known v0 gap, accepted: opentelemetry-swift 2.6's OTLP encoder never + writes span/link `flags`, span/link `traceState` or the scope `schemaUrl`, so the `ios` files + lack them (shapes don't cover them; no encoder reimplementation, see verify/VERIFY.md). - One non-deterministic smoke scenario per device (production pipeline, no test mode) checks the real path still exports. diff --git a/ios/Core/OtelCore.swift b/ios/Core/OtelCore.swift index 5525754..109cc37 100644 --- a/ios/Core/OtelCore.swift +++ b/ios/Core/OtelCore.swift @@ -1,6 +1,5 @@ import Foundation import OpenTelemetryApi -import OpenTelemetryProtocolExporterCommon import OpenTelemetryProtocolExporterHttp import OpenTelemetrySdk @@ -40,11 +39,10 @@ final class OtelCore { // ponytail: naive endpoint join; Task 19 brings tracesUrl ("append unless present") and URL validation. let base = config.exportUrl.hasSuffix("/") ? String(config.exportUrl.dropLast()) : config.exportUrl - // envVarHeaders nil: the exporter would otherwise let OTEL_EXPORTER_OTLP_HEADERS replace the configured headers. - // compression none, as otel-java's default (the verify collector does not gunzip). + // Upstream sends `envVarHeaders ?? config headers`: passing ours there (even empty) means exactly these headers, + // never OTEL_EXPORTER_OTLP_HEADERS. Upstream's default gzip stays on. exporter = OtlpHttpTraceExporter(endpoint: URL(string: base + "/v1/traces")!, - config: OtlpConfiguration(compression: .none, headers: config.exportHeaders.map { ($0.key, $0.value) }), - envVarHeaders: nil) + envVarHeaders: config.exportHeaders.map { ($0.key, $0.value) }) bsp = BatchSpanProcessor(spanExporter: exporter) let b = TracerProviderBuilder().with(resource: resource).add(spanProcessor: bsp) tracerProvider = (testMode ? b.with(idGenerator: SequentialIds()) : b).build() @@ -57,6 +55,9 @@ final class OtelCore { /// Blocks the caller up to `timeoutMs`. True when nothing is left unsent: the exporter requeues a failed batch, /// and its `flush` retries it. + // ponytail: upstream BatchWorker race: if its timer thread has just taken the queue but not yet scheduled the + // export, forceFlush finds nothing and returns before that batch is sent (true while in flight). TracerProviderSdk + // forceFlush goes through the same worker; fix upstream or track in-flight spans if flush-after-reload needs it. func flush(timeoutMs: Double) -> Bool { let deadline = Date().addingTimeInterval(timeoutMs / 1000) bsp.forceFlush(timeout: timeoutMs / 1000) diff --git a/verify/VERIFY.md b/verify/VERIFY.md index 77b4052..4793ebf 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -25,8 +25,9 @@ own OkHttp 5; devices run React Native's OkHttp 4.9.2. `*.ios.otlp.json` record these quantized values as emitted (deterministic); shapes ignore times. **iOS vs Android/JS goldens.** Apart from times, the `ios` files differ only by what the opentelemetry-swift 2.6 OTLP -encoder (`SpanAdapter`) never writes: span and link `flags` (257), link `traceState`, and the scope `schemaUrl` on -`ScopeSpans`. The core passes all three into `SpanData`; the exporter drops them. +encoder (`SpanAdapter`) never writes: span `flags` (257), span `traceState`, link `flags`, link `traceState`, and the +scope `schemaUrl` on `ScopeSpans`. The core passes them all into `SpanData`; the exporter drops them. Accepted for v0 +(no encoder reimplementation); today's fixtures exercise span flags, link flags/traceState and the scope `schemaUrl`. The fake collector listens on port 4318; the app reaches it at `10.0.2.2` (Android emulator) or `localhost` (iOS simulator). diff --git a/verify/harness/__tests__/collector.test.ts b/verify/harness/__tests__/collector.test.ts index 4977590..bdff426 100644 --- a/verify/harness/__tests__/collector.test.ts +++ b/verify/harness/__tests__/collector.test.ts @@ -93,3 +93,15 @@ test('begin rejects unsafe scenario/platform names', async () => { }); expect(r.status).toBe(400); }); + +test('collector gunzips content-encoding: gzip bodies', async () => { + c.begin('g', 'ios'); + const r = await fetch(`${c.url}/v1/traces`, { + method: 'POST', + headers: {'content-type': 'application/json', 'content-encoding': 'gzip'}, + body: require('zlib').gzipSync(body('zipped')), + }); + expect(r.status).toBe(200); + const out = await c.end(); + expect(out.resourceSpans![0].scopeSpans[0].spans.map((s: any) => s.name)).toEqual(['zipped']); +}); diff --git a/verify/harness/collector.ts b/verify/harness/collector.ts index 748a6a5..1ac5503 100644 --- a/verify/harness/collector.ts +++ b/verify/harness/collector.ts @@ -1,6 +1,7 @@ import fs from 'fs'; import http from 'http'; import path from 'path'; +import zlib from 'zlib'; import {normalize} from './normalize'; import {decodeRequest, toOtlpJson, type OtlpJson} from './otlpJson'; @@ -29,7 +30,7 @@ export async function startCollector( const chunks: Buffer[] = []; req.on('data', c => chunks.push(c)); req.on('end', () => { - const body = Buffer.concat(chunks); + let body = Buffer.concat(chunks); const send = (status: number, payload?: unknown) => { res.writeHead(status, { ...CORS, @@ -38,6 +39,8 @@ export async function startCollector( res.end(payload === undefined ? undefined : JSON.stringify(payload)); }; try { + // opentelemetry-swift gzips by default; the raw/ files keep the decoded body + if (req.headers['content-encoding'] === 'gzip') body = zlib.gunzipSync(body); const route = `${req.method} ${req.url?.split('?')[0]}`; if (req.method === 'OPTIONS') return send(204); if (route === 'POST /v1/traces') { From 4558efab66d8744d8815d3e830f5341d1ea3f652 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:43:51 +0100 Subject: [PATCH 23/76] feat(ios-core): config, endpoint and headers Co-Authored-By: Claude Opus 5.5 --- ios/Core/CoreConfig.swift | 15 +++++++ ios/Core/Endpoint.swift | 18 ++++++++ ios/Core/OtelCore.swift | 71 ++++++++++++++++++++++------- ios/CoreTests/EndpointTests.swift | 11 +++++ ios/CoreTests/InitTests.swift | 74 +++++++++++++++++++++++++++++++ 5 files changed, 173 insertions(+), 16 deletions(-) create mode 100644 ios/Core/CoreConfig.swift create mode 100644 ios/Core/Endpoint.swift create mode 100644 ios/CoreTests/EndpointTests.swift create mode 100644 ios/CoreTests/InitTests.swift diff --git a/ios/Core/CoreConfig.swift b/ios/Core/CoreConfig.swift new file mode 100644 index 0000000..2817ea2 --- /dev/null +++ b/ios/Core/CoreConfig.swift @@ -0,0 +1,15 @@ +struct CoreConfig { + var serviceName: String + var serviceVersion: String? = nil + var resourceAttributes: [CoreAttribute] = [] + /// Base URL; see `tracesUrl`. + var exportUrl: String + var exportHeaders: [String: String] = [:] +} + +/// Mirrors the seam's `SeamInitResult`. +struct InitResult: Equatable { + var alreadyInitialized: Bool + var testMode: Bool + var error: String? = nil +} diff --git a/ios/Core/Endpoint.swift b/ios/Core/Endpoint.swift new file mode 100644 index 0000000..7f2628a --- /dev/null +++ b/ios/Core/Endpoint.swift @@ -0,0 +1,18 @@ +import Foundation + +/// Base URL -> traces endpoint: `/v1/traces` is appended unless already present (same rule as JS and Android). +func tracesUrl(_ exportUrl: String) -> String { + var base = Substring(exportUrl) + while base.hasSuffix("/") { base = base.dropLast() } + return base.hasSuffix("/v1/traces") ? String(base) : base + "/v1/traces" +} + +/// Eager check (D8/D9), no exporter built. `URL(string: "not a url")` succeeds on current Foundation, so the scheme +/// and host are checked explicitly. Returns an error message or nil. +func validateExportUrl(_ url: String) -> String? { + guard let u = URL(string: url), let scheme = u.scheme?.lowercased(), ["http", "https"].contains(scheme), + !(u.host ?? "").isEmpty else { + return "invalid exportUrl \"\(url)\": expected http(s)://host[:port]" + } + return nil +} diff --git a/ios/Core/OtelCore.swift b/ios/Core/OtelCore.swift index 109cc37..d797217 100644 --- a/ios/Core/OtelCore.swift +++ b/ios/Core/OtelCore.swift @@ -3,16 +3,6 @@ import OpenTelemetryApi import OpenTelemetryProtocolExporterHttp import OpenTelemetrySdk -/// Minimal config to export fixtures (R12); Task 19 adds tracesUrl, idempotent init and the distro attributes. -struct CoreConfig { - let serviceName: String - var serviceVersion: String? = nil - var resourceAttributes: [CoreAttribute] = [] - /// Base URL; `/v1/traces` is appended. - let exportUrl: String - var exportHeaders: [String: String] = [:] -} - /// Test mode: `0b…` IDs, the native counterpart of JS `sequentialIds('0a')`. private final class SequentialIds: IdGenerator, @unchecked Sendable { private let lock = NSLock() @@ -23,26 +13,54 @@ private final class SequentialIds: IdGenerator, @unchecked Sendable { func generateSpanId() -> SpanId { lock.withLock { s += 1; return SpanId(fromHexString: pad(s, 14)) } } } +let distroName = "react-native-open-telemetry" + +/// Built on first export (the export queue), so init on the main thread never constructs an HTTP client. +private final class LazyExporter: SpanExporter, @unchecked Sendable { + private let lock = NSLock() + private var built: OtlpHttpTraceExporter? + private let build: () -> OtlpHttpTraceExporter? + init(_ build: @escaping () -> OtlpHttpTraceExporter?) { self.build = build } + private var d: OtlpHttpTraceExporter? { lock.withLock { if built == nil { built = build() }; return built } } + func export(spans: [SpanData], explicitTimeout: TimeInterval?) -> SpanExporterResultCode { d?.export(spans: spans, explicitTimeout: explicitTimeout) ?? .failure } + func flush(explicitTimeout: TimeInterval?) -> SpanExporterResultCode { d?.flush(explicitTimeout: explicitTimeout) ?? .failure } + func shutdown(explicitTimeout: TimeInterval?) { d?.shutdown(explicitTimeout: explicitTimeout) } + func export(spans: [SpanData], explicitTimeout: TimeInterval?) async -> SpanExporterResultCode { + guard let d else { return .failure } + return await d.export(spans: spans, explicitTimeout: explicitTimeout) + } + func flush(explicitTimeout: TimeInterval?) async -> SpanExporterResultCode { + guard let d else { return .failure } + return await d.flush(explicitTimeout: explicitTimeout) + } + func shutdown(explicitTimeout: TimeInterval?) async { await d?.shutdown(explicitTimeout: explicitTimeout) } +} + final class OtelCore { /// The one resource of the app; in test mode built from config only (no `telemetry.*`). let resource: Resource /// The native TracerProvider; JS spans join its batch processor. let tracerProvider: TracerProviderSdk private let bsp: BatchSpanProcessor - private let exporter: OtlpHttpTraceExporter + private let exporter: LazyExporter - init(config: CoreConfig, testMode: Bool = false) { + init(config: CoreConfig, testMode: Bool = false, distroVersion: String = "unknown") { var attrs = attributes(of: config.resourceAttributes) attrs["service.name"] = .string(config.serviceName) if let v = config.serviceVersion { attrs["service.version"] = .string(v) } + if !testMode { + attrs["telemetry.distro.name"] = .string(distroName) + attrs["telemetry.distro.version"] = .string(distroVersion) + } resource = testMode ? Resource(attributes: attrs) : Resource().merging(other: Resource(attributes: attrs)) - // ponytail: naive endpoint join; Task 19 brings tracesUrl ("append unless present") and URL validation. - let base = config.exportUrl.hasSuffix("/") ? String(config.exportUrl.dropLast()) : config.exportUrl // Upstream sends `envVarHeaders ?? config headers`: passing ours there (even empty) means exactly these headers, // never OTEL_EXPORTER_OTLP_HEADERS. Upstream's default gzip stays on. - exporter = OtlpHttpTraceExporter(endpoint: URL(string: base + "/v1/traces")!, - envVarHeaders: config.exportHeaders.map { ($0.key, $0.value) }) + exporter = LazyExporter { + URL(string: tracesUrl(config.exportUrl)).map { + OtlpHttpTraceExporter(endpoint: $0, envVarHeaders: config.exportHeaders.map { ($0.key, $0.value) }) + } + } bsp = BatchSpanProcessor(spanExporter: exporter) let b = TracerProviderBuilder().with(resource: resource).add(spanProcessor: bsp) tracerProvider = (testMode ? b.with(idGenerator: SequentialIds()) : b).build() @@ -63,4 +81,25 @@ final class OtelCore { bsp.forceFlush(timeout: timeoutMs / 1000) return exporter.flush(explicitTimeout: max(deadline.timeIntervalSinceNow, 0.001)) == .success } + + private static let lock = NSLock() + private static var state: InitResult? + private(set) static var instance: OtelCore? + + /// Idempotent. The first result sticks, a failed one too (R16): later calls never retry. A call without config + /// before any init is an error but is not remembered, so the real init can still follow. + @discardableResult + static func initialize(_ config: CoreConfig?, testMode: Bool = false, distroVersion: String = "unknown") -> InitResult { + lock.withLock { + if var s = state { s.alreadyInitialized = true; return s } + guard let config else { return InitResult(alreadyInitialized: false, testMode: testMode, error: "not initialized: no config") } + let err = validateExportUrl(config.exportUrl) + let result = InitResult(alreadyInitialized: false, testMode: testMode, error: err) + if err == nil { instance = OtelCore(config: config, testMode: testMode, distroVersion: distroVersion) } + state = result + return result + } + } + + static func resetForTest() { lock.withLock { state = nil; instance = nil } } } diff --git a/ios/CoreTests/EndpointTests.swift b/ios/CoreTests/EndpointTests.swift new file mode 100644 index 0000000..99db45e --- /dev/null +++ b/ios/CoreTests/EndpointTests.swift @@ -0,0 +1,11 @@ +import XCTest +@testable import OtelCore + +final class EndpointTests: XCTestCase { + func testAppendsTracesPathUnlessPresent() { + for u in ["http://h:4318", "http://h:4318/", "http://h:4318/v1/traces", "http://h:4318/v1/traces/"] { + XCTAssertEqual(tracesUrl(u), "http://h:4318/v1/traces", u) + } + XCTAssertEqual(tracesUrl("http://h/base"), "http://h/base/v1/traces") + } +} diff --git a/ios/CoreTests/InitTests.swift b/ios/CoreTests/InitTests.swift new file mode 100644 index 0000000..1fbbcf8 --- /dev/null +++ b/ios/CoreTests/InitTests.swift @@ -0,0 +1,74 @@ +import XCTest +import OpenTelemetrySdk +@testable import OtelCore + +final class InitTests: XCTestCase { + private let ok = CoreConfig(serviceName: "first", serviceVersion: "1.0", exportUrl: "http://127.0.0.1:1", exportHeaders: ["x-api-key": "test"]) + private func name(_ c: OtelCore?) -> String? { c?.resource.attributes["service.name"]?.description } + override func setUp() { OtelCore.resetForTest() } + override func tearDown() { OtelCore.resetForTest() } + + func testInitializeTwiceKeepsTheFirstConfig() { + let a = OtelCore.initialize(ok, testMode: true) + XCTAssertNil(a.error); XCTAssertFalse(a.alreadyInitialized) + let core = OtelCore.instance + var second = ok; second.serviceName = "second" + let b = OtelCore.initialize(second, testMode: true) + XCTAssertTrue(b.alreadyInitialized); XCTAssertNil(b.error) + XCTAssertTrue(core === OtelCore.instance) + XCTAssertEqual(name(core), "first") + } + + func testInvalidUrlReturnsAnErrorAndNeverThrows() { + for u in ["not a url", "ftp://h", "http://", "", "http:///x"] { + OtelCore.resetForTest() + var c = ok; c.exportUrl = u + XCTAssertNotNil(OtelCore.initialize(c, testMode: true).error, u) + XCTAssertNil(OtelCore.instance) + } + } + + func testAFailedInitIsSticky() { + var bad = ok; bad.exportUrl = "not a url" + let first = OtelCore.initialize(bad, testMode: true) + let again = OtelCore.initialize(ok, testMode: true) + XCTAssertEqual(first.error, again.error) + XCTAssertTrue(again.alreadyInitialized) + XCTAssertNil(OtelCore.instance) + } + + func testInitializeWithoutConfigIsAnErrorButNotSticky() { + XCTAssertNotNil(OtelCore.initialize(nil, testMode: true).error) + let r = OtelCore.initialize(ok, testMode: true) + XCTAssertNil(r.error); XCTAssertFalse(r.alreadyInitialized) + XCTAssertNotNil(OtelCore.instance) + } + + func testInitializeWithoutConfigAfterInitIsAlreadyInitialized() { + OtelCore.initialize(ok, testMode: true) + let r = OtelCore.initialize(nil, testMode: true) + XCTAssertTrue(r.alreadyInitialized); XCTAssertNil(r.error) + } + + func testConcurrentInitializeCreatesOneCore() { + DispatchQueue.concurrentPerform(iterations: 50) { _ in _ = OtelCore.initialize(ok, testMode: true) } + let core = OtelCore.instance + XCTAssertNotNil(core) + XCTAssertTrue(OtelCore.initialize(ok, testMode: true).alreadyInitialized) + XCTAssertTrue(core === OtelCore.instance) + } + + func testDistroAttributesOutsideTestModeOnly() { + let prod = OtelCore(config: ok, testMode: false, distroVersion: "9.9.9").resource.attributes + XCTAssertEqual(prod["telemetry.distro.name"]?.description, "react-native-open-telemetry") + XCTAssertEqual(prod["telemetry.distro.version"]?.description, "9.9.9") + let test = OtelCore(config: ok, testMode: true, distroVersion: "9.9.9").resource.attributes + XCTAssertNil(test["telemetry.distro.name"]) + XCTAssertNil(test["telemetry.sdk.name"]) + } + + func testResourceAttributesAreKept() { + var c = ok; c.resourceAttributes = [CoreAttribute(key: "k", value: .string("v"))] + XCTAssertEqual(OtelCore(config: c, testMode: true).resource.attributes["k"]?.description, "v") + } +} From e5a452ce42040f7f46c1c9101e3d6d68ff8d190a Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:45:33 +0100 Subject: [PATCH 24/76] feat(ios-core): explicit parenting helper Co-Authored-By: Claude Opus 5.5 --- ios/Core/Parenting.swift | 24 +++++++++++++++ ios/CoreTests/ParentingTests.swift | 49 ++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 ios/Core/Parenting.swift create mode 100644 ios/CoreTests/ParentingTests.swift diff --git a/ios/Core/Parenting.swift b/ios/Core/Parenting.swift new file mode 100644 index 0000000..ec26af6 --- /dev/null +++ b/ios/Core/Parenting.swift @@ -0,0 +1,24 @@ +import Foundation +import OpenTelemetryApi + +private let traceparentRegex = try! NSRegularExpression(pattern: "^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$") + +/// W3C traceparent -> a NON-remote parent `SpanContext` (spec §4.3). In opentelemetry-swift the explicit parent is a +/// `SpanContext`: pass it to `SpanBuilder.setParent(_:)`; nil means "no parent" (`setNoParent()`), i.e. a root. +/// Not W3CTraceContextPropagator.extract: that yields isRemote=true. Invalid input (incl. all-zero ids) -> nil; never throws. +func contextFrom(traceparent: String) -> SpanContext? { + // `$` matches before a trailing newline, so match the whole string explicitly. + let range = NSRange(traceparent.startIndex..., in: traceparent) + guard let m = traceparentRegex.firstMatch(in: traceparent, range: range), m.range == range, + let t = Range(m.range(at: 1), in: traceparent), let s = Range(m.range(at: 2), in: traceparent), + let f = Range(m.range(at: 3), in: traceparent) else { return nil } + let sc = SpanContext.create(traceId: TraceId(fromHexString: String(traceparent[t])), + spanId: SpanId(fromHexString: String(traceparent[s])), + traceFlags: TraceFlags(fromHexString: String(traceparent[f])), + traceState: TraceState()) + return sc.isValid ? sc : nil +} + +func traceparent(of c: SpanContext) -> String { + "00-\(c.traceId.hexString)-\(c.spanId.hexString)-\(c.traceFlags.hexString)" +} diff --git a/ios/CoreTests/ParentingTests.swift b/ios/CoreTests/ParentingTests.swift new file mode 100644 index 0000000..e2a2226 --- /dev/null +++ b/ios/CoreTests/ParentingTests.swift @@ -0,0 +1,49 @@ +import XCTest +import OpenTelemetryApi +import OpenTelemetrySdk +@testable import OtelCore + +final class ParentingTests: XCTestCase { + private var tracer: Tracer! + private let tp = "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01" + + override func setUp() { + // upstream's TracerProvider adopts a TRACEPARENT env var as the parent of every root span + unsetenv("TRACEPARENT") + tracer = TracerProviderBuilder().build().get(instrumentationName: "t") + } + + private func child(_ parent: SpanContext?) -> SpanData { + let b = tracer.spanBuilder(spanName: "c") + if let parent { b.setParent(parent) } else { b.setNoParent() } + return (b.startSpan() as! ReadableSpan).toSpanData() + } + + func testRoundTrip() { + let s = tracer.spanBuilder(spanName: "p").startSpan() + let t = traceparent(of: s.context) + XCTAssertEqual(s.context.traceId.hexString, String(t.split(separator: "-")[1])) + XCTAssertEqual(t, traceparent(of: contextFrom(traceparent: t)!)) + XCTAssertEqual(tp, traceparent(of: contextFrom(traceparent: tp)!)) + } + + func testChildHasParentIdAndIsNotRemote() { + let d = child(contextFrom(traceparent: tp)) + XCTAssertEqual(d.parentSpanId?.hexString, "b7ad6b7169203331") + XCTAssertEqual(d.traceId.hexString, "0af7651916cd43dd8448eb211c80319c") + XCTAssertFalse(d.hasRemoteParent) + } + + func testInvalidInputYieldsRoot() { + for s in ["garbage", "", "ff-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01", + "01-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01", + "00-0AF7651916CD43DD8448EB211C80319C-b7ad6b7169203331-01", + "00-00000000000000000000000000000000-b7ad6b7169203331-01", + "00-0af7651916cd43dd8448eb211c80319c-0000000000000000-01", + "00-0af7-b7ad6b7169203331-01", "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-zz", + "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01\n"] { + XCTAssertNil(contextFrom(traceparent: s), s) + XCTAssertNil(child(contextFrom(traceparent: s)).parentSpanId, s) + } + } +} From ae81e8c8f767c8f87390ef0dbc540ad81b1d71f4 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:48:04 +0100 Subject: [PATCH 25/76] ci: static-fast runs every non-e2e stage; unset TRACEPARENT for native replays Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 2 +- verify/VERIFY.md | 4 ++++ verify/harness/nativeReplay.ts | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e8b4fa..ffbbfb3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: - run: bun install --frozen-lockfile working-directory: example # static's bundle-size check bundles the example app - run: bun run prepare - - run: bun verify static fast-js + - run: bun verify # every non-e2e stage (R17); fast-swift skips off macOS - uses: actions/upload-artifact@v4 if: always() with: diff --git a/verify/VERIFY.md b/verify/VERIFY.md index 4793ebf..0786df8 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -29,6 +29,10 @@ encoder (`SpanAdapter`) never writes: span `flags` (257), span `traceState`, lin scope `schemaUrl` on `ScopeSpans`. The core passes them all into `SpanData`; the exporter drops them. Accepted for v0 (no encoder reimplementation); today's fixtures exercise span flags, link flags/traceState and the scope `schemaUrl`. +**iOS `TRACEPARENT` (upstream caveat).** opentelemetry-swift reads a `TRACEPARENT` environment variable at provider +construction and makes it the parent of every root span, even with `setNoParent()`. Apps only see it when launched with +it (Xcode scheme, `SIMCTL_CHILD_TRACEPARENT`); the verify stages unset it for native runs. + The fake collector listens on port 4318; the app reaches it at `10.0.2.2` (Android emulator) or `localhost` (iOS simulator). ## Device capability check (Task 7, 2026-11-23) diff --git a/verify/harness/nativeReplay.ts b/verify/harness/nativeReplay.ts index 91bb5c1..2b9d633 100644 --- a/verify/harness/nativeReplay.ts +++ b/verify/harness/nativeReplay.ts @@ -26,7 +26,8 @@ export async function replayFixtures(platform: Platform, cmd: string, args: stri for (const n of names) fs.rmSync(path.join(artifacts, `${n}.${platform}.otlp.json`), {force: true}); const collector = await startCollector({port: 0}); try { - await run(cmd, args, cwd, {...process.env, VERIFY_COLLECTOR: collector.url}); + // TRACEPARENT unset: opentelemetry-swift adopts it as the parent of every root span (VERIFY.md). + await run(cmd, args, cwd, {...process.env, TRACEPARENT: undefined, VERIFY_COLLECTOR: collector.url}); } finally { await collector.close(); } From af980d92180eb123a0da847465ecf2f9c6391360 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 01:07:42 +0100 Subject: [PATCH 26/76] feat(verify): VERIFY_E2E_DRAFT drafts a missing expected file and still fails (R1) Co-Authored-By: Claude Opus 5.5 --- verify/harness/__tests__/compare.test.ts | 13 +++++++++++++ verify/harness/compare.ts | 17 +++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/verify/harness/__tests__/compare.test.ts b/verify/harness/__tests__/compare.test.ts index 47794d7..6fb248f 100644 --- a/verify/harness/__tests__/compare.test.ts +++ b/verify/harness/__tests__/compare.test.ts @@ -86,6 +86,19 @@ describe('compareToExpected', () => { expect(r.report).toContain('got (none)'); }); + test('draft writes a missing file but still fails, and never overwrites', () => { + const o = otlp(); + writeShape(o); + const f = path.join(dir, 'expected/sc.js.otlp.json'); + const r = compareToExpected('sc', 'js', o, {draft: true}); + expect(r).toEqual({ok: false, report: 'drafted verify/expected/sc.js.otlp.json, review it'}); + expect(JSON.parse(fs.readFileSync(f, 'utf8'))).toEqual(o); + expect(compareToExpected('sc', 'js', o, {draft: true}).ok).toBe(true); + const r2 = compareToExpected('sc', 'js', otlp({status: {code: 1}}), {draft: true}); + expect(r2.ok).toBe(false); + expect(JSON.parse(fs.readFileSync(f, 'utf8'))).toEqual(o); + }); + test('shape mismatch report points at the shape file', () => { writeShape(otlp()); const r = compareToExpected('sc', 'js', otlp({name: 'other'})); diff --git a/verify/harness/compare.ts b/verify/harness/compare.ts index db7c74a..79d15a8 100644 --- a/verify/harness/compare.ts +++ b/verify/harness/compare.ts @@ -96,7 +96,16 @@ const write = (f: string, o: unknown) => { fs.writeFileSync(f, JSON.stringify(o, null, 2) + '\n'); }; -export function compareToExpected(scenario: string, platform: Platform, actual: OtlpJson): {ok: boolean; report: string} { +/** + * `draft` (e2e only, `VERIFY_E2E_DRAFT=1`): a missing expected file is written from `actual` and the compare still + * fails, so a draft never passes unreviewed. An existing file is never overwritten. + */ +export function compareToExpected( + scenario: string, + platform: Platform, + actual: OtlpJson, + {draft = false}: {draft?: boolean} = {}, +): {ok: boolean; report: string} { const fail = (diffs: Diff[], expectedFile?: string) => { write(abs('artifacts', scenario, `${platform}.otlp.json`), actual); return {ok: false, report: formatReport(scenario, platform, diffs, expectedFile)}; @@ -108,7 +117,11 @@ export function compareToExpected(scenario: string, platform: Platform, actual: write(f, actual); return {ok: true, report: `updated ${f}`}; } - if (!fs.existsSync(f)) return fail([{path: 'file', expected: f, actual: undefined}]); + if (!fs.existsSync(f)) { + if (!draft) return fail([{path: 'file', expected: f, actual: undefined}]); + write(f, actual); + return {ok: false, report: `drafted ${rel('expected', scenario, `${platform}.otlp.json`)}, review it`}; + } const diffs = diffOtlp(JSON.parse(fs.readFileSync(f, 'utf8')), actual); return diffs.length ? fail(diffs) : {ok: true, report: ''}; } From 9b274c32d05a0f8cedeb794a22d9bca8bfdad58a Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 01:07:47 +0100 Subject: [PATCH 27/76] chore(verify): re-baseline the SDK bundle share now the example bundles lib/ The example consumes the package (exports -> lib/), so the SDK entry (setup, patch, probe, startReactNativeSdk, hand-off) is in the bundle: 383873 -> 393429 B (+9.6 kB, all lib/module). Co-Authored-By: Claude Opus 5.5 --- verify/static/bundle-baseline.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/verify/static/bundle-baseline.json b/verify/static/bundle-baseline.json index f5b6577..9daf6d5 100644 --- a/verify/static/bundle-baseline.json +++ b/verify/static/bundle-baseline.json @@ -1,3 +1,3 @@ { - "sdkBytes": 383873 + "sdkBytes": 393429 } From a6b94673e09ed709540387a2a17f5e7d7b786e02 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 01:07:50 +0100 Subject: [PATCH 28/76] test(example): context guarantees on Hermes Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 2 + example/metro.config.js | 9 ++-- example/src/ScenariosScreen.tsx | 2 + verify/VERIFY.md | 52 +++++++++++++------ verify/e2e/harness.ts | 8 +-- verify/e2e/scenarios.e2e.ts | 23 ++++++-- .../event-emitter-listener.js.otlp.json | 46 ++++++++++++++++ verify/expected/nest-raf.js.otlp.json | 46 ++++++++++++++++ verify/scenarios/event-emitter-listener.ts | 2 +- verify/scenarios/interaction-manager.ts | 4 +- verify/scenarios/nest-raf.ts | 2 +- 11 files changed, 166 insertions(+), 30 deletions(-) create mode 100644 verify/expected/event-emitter-listener.js.otlp.json create mode 100644 verify/expected/nest-raf.js.otlp.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ffbbfb3..a9925a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,6 +89,7 @@ jobs: - run: bun install --frozen-lockfile - run: bun install --frozen-lockfile working-directory: example + - run: bun run prepare # the example bundles the package through exports -> lib/ (R4) - name: Enable KVM run: | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules @@ -173,6 +174,7 @@ jobs: - run: bun install --frozen-lockfile - run: bun install --frozen-lockfile working-directory: example + - run: bun run prepare # the example bundles the package through exports -> lib/ (R4) - name: Cache Swift packages uses: actions/cache@v4 with: diff --git a/example/metro.config.js b/example/metro.config.js index 08d9f23..8459676 100644 --- a/example/metro.config.js +++ b/example/metro.config.js @@ -1,5 +1,6 @@ const path = require('path'); const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); +const {withOtel} = require('../metro'); const root = path.resolve(__dirname, '..'); const own = p => path.join(__dirname, 'node_modules', p); @@ -11,13 +12,15 @@ const escape = s => s.replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&'); const config = { // babel.config.js inlines OTEL_TEST_MODE; keep test-mode and normal transforms in separate caches cacheVersion: `otel-test-mode=${process.env.OTEL_TEST_MODE ?? ''}`, - // the library (src/) and the scenarios, fixtures and harness under verify/ + // the library (its package exports -> lib/) and the scenarios, fixtures and harness under verify/ watchFolders: [root, path.join(root, 'verify')], resolver: { nodeModulesPaths: [path.join(__dirname, 'node_modules'), path.join(root, 'node_modules')], blockList: single.map(m => new RegExp(`^${escape(path.join(root, 'node_modules', m))}[/\\\\].*`)), - extraNodeModules: Object.fromEntries(single.map(m => [m, own(m)])), + // the app consumes the package as published: exports -> lib/ (build it with `bun run prepare`) + extraNodeModules: {...Object.fromEntries(single.map(m => [m, own(m)])), 'react-native-open-telemetry': root}, }, }; -module.exports = mergeConfig(getDefaultConfig(__dirname), config); +// wrap the merged config: wrapping only `config` would drop the default InitializeCore entry +module.exports = withOtel(mergeConfig(getDefaultConfig(__dirname), config)); diff --git a/example/src/ScenariosScreen.tsx b/example/src/ScenariosScreen.tsx index 6f82e6d..dd0c535 100644 --- a/example/src/ScenariosScreen.tsx +++ b/example/src/ScenariosScreen.tsx @@ -3,6 +3,8 @@ import {Platform, Pressable, ScrollView, StyleSheet, Text, View} from 'react-nat import {resourceFromAttributes} from '@opentelemetry/resources'; import {SimpleSpanProcessor, TracerProvider} from '@opentelemetry/sdk-trace'; import {OTLPTraceExporter} from '@opentelemetry/exporter-trace-otlp-proto'; +// the package's entry imports its setup (context patch); withOtel runs it before the app +import 'react-native-open-telemetry'; import {getOtel} from '../../src/native/otel'; import {sequentialIds} from '../../src/internal/testMode'; import type {SeamSpan} from '../../src/native/Otel.nitro'; diff --git a/verify/VERIFY.md b/verify/VERIFY.md index 0786df8..b761b67 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -3,7 +3,11 @@ `bun verify [stage…] [--e2e] [--update]` runs the stages in `verify/stages/`. `--e2e` adds the device stage (`e2e`), which needs release builds of `example/` in test mode: +The example bundles the package through `exports` → `lib/` (R4), so build `lib/` first: the release builds embed +the JS bundle, and the e2e stage cannot rebuild it. + ```sh +bun run prepare # lib/ # Android (emulator booted) cd example/android && OTEL_TEST_MODE=1 ./gradlew :app:assembleRelease -PotelTestMode=true # iOS @@ -33,6 +37,20 @@ scope `schemaUrl` on `ScopeSpans`. The core passes them all into `SpanData`; the construction and makes it the parent of every root span, even with `setNoParent()`. Apps only see it when launched with it (Xcode scheme, `SIMCTL_CHILD_TRACEPARENT`); the verify stages unset it for native runs. +`verify/e2e/scenarios.e2e.ts` runs one test per scenario with runner `e2e`, not `pending`, on each target it lists, +except the scenarios with their own e2e file. Each test cold-starts the app (R5). e2e is compare-only; +`VERIFY_E2E_DRAFT=1` writes a **missing** `.js.otlp.json` from the device run and still fails the test +("drafted …, review it"); existing files are never overwritten. Until Tasks 24/25 device runs compare to the `js` files. + +**`performance.timeOrigin` on Hermes (X17, Task 13).** Defined on both platforms (RN 0.88.1 release, Hermes), +checked with a one-off `console.log` of `timeOrigin`, `performance.now()` and `Date.now()` at app start: +Android `timeOrigin + now()` = `Date.now()` within 1 ms; **iOS simulator `timeOrigin + now()` was ~23.9 h behind +`Date.now()`** (the monotonic clock under `now()` stopped while the host slept; `timeOrigin` stayed at simulator boot). +sdk-trace 3.1 is unaffected: each span recomputes `_performanceOffset = Date.now() - (now() + timeOrigin)` at start, +so explicit times, default times and `addEvent(name, perfNumber)` stay correct. Known limit: anything that turns +`performance.now()` values into wall-clock with `timeOrigin` alone (e.g. `@opentelemetry/core` `hrTime()` without +an argument) can be off by that skew on iOS. + The fake collector listens on port 4318; the app reaches it at `10.0.2.2` (Android emulator) or `localhost` (iOS simulator). ## Device capability check (Task 7, 2026-11-23) @@ -68,24 +86,24 @@ e2e targets are android, ios and web unless the Runners column names them. | Scenario | Guarantee | Task | Runners | Status | | --- | --- | --- | --- | --- | | `smoke-js` | the JS pipeline exports a span | 7 | jest | passing | -| `nest-after-await` | a span after `await` is a child of the span active before it | 10 | jest, e2e | pending | -| `nest-timers-microtasks` | `setTimeout`/`setImmediate`/`queueMicrotask` callbacks keep their scheduling context, also after the parent ended | 10 | jest, e2e | pending | -| `nest-promise-all-race` | `Promise.all`/`race` branches and the code after them keep the parent | 10 | jest, e2e | pending | -| `concurrent-interleaved` | interleaved async jobs keep their own parents; work after the join is a root | 10 | jest, e2e | pending | -| `root-no-leak` | after a span's work ends, later work (fast path included) starts new roots | 10 | jest, e2e | pending | -| `captured-then` | exception: a `then` captured before the patch loses the parent | 10 | jest, e2e | pending | -| `async-generator` | async generator bodies and `for await` keep the parent | 10 | jest, e2e | pending | -| `error-in-callback` | a throwing callback still restores context | 10 | jest, e2e | pending | -| `never-settling-promise` | a never-settling promise does not leak its span into later work | 10 | jest, e2e | pending | -| `interval-new-root` | exception: each `setInterval` tick is a new root | 10 | jest, e2e | pending | -| `batching-shared-queue` | exception: a shared queue runs work as its first enqueuer (pinned wrong parent) | 10 | jest, e2e | pending | +| `nest-after-await` | a span after `await` is a child of the span active before it | 10 | jest, e2e | passing | +| `nest-timers-microtasks` | `setTimeout`/`setImmediate`/`queueMicrotask` callbacks keep their scheduling context, also after the parent ended | 10 | jest, e2e | passing | +| `nest-promise-all-race` | `Promise.all`/`race` branches and the code after them keep the parent | 10 | jest, e2e | passing | +| `concurrent-interleaved` | interleaved async jobs keep their own parents; work after the join is a root | 10 | jest, e2e | passing | +| `root-no-leak` | after a span's work ends, later work (fast path included) starts new roots | 10 | jest, e2e | passing | +| `captured-then` | exception: a `then` captured before the patch loses the parent | 10 | jest, e2e | passing | +| `async-generator` | async generator bodies and `for await` keep the parent | 10 | jest, e2e | passing | +| `error-in-callback` | a throwing callback still restores context | 10 | jest, e2e | passing | +| `never-settling-promise` | a never-settling promise does not leak its span into later work | 10 | jest, e2e | passing | +| `interval-new-root` | exception: each `setInterval` tick is a new root | 10 | jest, e2e | passing | +| `batching-shared-queue` | exception: a shared queue runs work as its first enqueuer (pinned wrong parent) | 10 | jest, e2e | passing | | `degraded-probe` | native `await` → degraded scope attribute, spans after `await` are roots | 11 | jest-degraded | passing | -| `interaction-manager` | `runAfterInteractions` callback is a child of the caller's span | 13 | e2e | pending | -| `nest-raf` | a `requestAnimationFrame` callback keeps its scheduling context | 13 | e2e | pending | -| `event-emitter-listener` | a synchronous `DeviceEventEmitter` listener is a child of the emitter's span | 13 | e2e (android, ios) | pending | -| `handoff-basic` | a span crosses the seam intact | 8, 15, 18 | jest, e2e | passing (js) | -| `rich-span` | every attribute type, events, links, status, scope survive the seam | 8, 15, 18 | jest, e2e | passing (js) | -| `odd-attributes` | NaN, ±Infinity, -0, big ints, empty arrays survive the seam | 8, 15, 18 | jest, e2e | passing (js) | +| `interaction-manager` | `runAfterInteractions` callback is a child of the caller's span | 13 | e2e | pending: RN 0.88 removed `InteractionManager` | +| `nest-raf` | a `requestAnimationFrame` callback keeps its scheduling context | 13 | e2e | passing | +| `event-emitter-listener` | a synchronous `DeviceEventEmitter` listener is a child of the emitter's span | 13 | e2e (android, ios) | passing | +| `handoff-basic` | a span crosses the seam intact | 8, 15, 18 | jest, e2e | passing | +| `rich-span` | every attribute type, events, links, status, scope survive the seam | 8, 15, 18 | jest, e2e | passing | +| `odd-attributes` | NaN, ±Infinity, -0, big ints, empty arrays survive the seam | 8, 15, 18 | jest, e2e | passing | | `export-headers` | configured export headers are sent on every request | 16, 19 | e2e | pending | | `cross-js-to-native` | a native span started from JS is a child of the JS span | 26 | e2e (android, ios) | pending | | `cross-native-to-js` | a JS span started under a native span's context is its child | 26 | e2e (android, ios) | pending | diff --git a/verify/e2e/harness.ts b/verify/e2e/harness.ts index f8ab0d8..d46b28f 100644 --- a/verify/e2e/harness.ts +++ b/verify/e2e/harness.ts @@ -15,7 +15,7 @@ process.env.VERIFY_DIR = verifyDir; const {startCollector} = await import('../harness/collector'); const {compareToExpected} = await import('../harness/compare'); -const {allScenarios} = await import('../scenarios'); +export const {allScenarios} = await import('../scenarios'); type Collector = Awaited>; /** Must match COLLECTOR_PORT in example/src/ScenariosScreen.tsx. */ @@ -59,7 +59,8 @@ export async function expectScenario( const s = allScenarios().find(x => x.name === name); if (!s) throw new Error(`unknown scenario ${name}`); test.skip(!s.targets.includes(platformOf(target)), `${name} does not run on ${platformOf(target)}`); - await app.open(); + await app.restart(); // cold start per scenario (R5): no SDK state or ID counters carried over + collector.begin(name, platformOf(target)); let actual; try { @@ -69,7 +70,8 @@ export async function expectScenario( actual = await collector.end(); } // Until Tasks 24/25 device runs compare to the JS expected files. - const r = compareToExpected(name, 'js', actual); + // VERIFY_E2E_DRAFT=1 writes a missing expected file and still fails (review it, then rerun) + const r = compareToExpected(name, 'js', actual, {draft: process.env.VERIFY_E2E_DRAFT === '1'}); if (!r.ok) throw new Error('\n' + r.report); } diff --git a/verify/e2e/scenarios.e2e.ts b/verify/e2e/scenarios.e2e.ts index c7d83d7..269ef05 100644 --- a/verify/e2e/scenarios.e2e.ts +++ b/verify/e2e/scenarios.e2e.ts @@ -1,5 +1,20 @@ -import {expectScenario, test} from './harness'; +import {allScenarios, expectScenario, test} from './harness'; -test('smoke-js', async ({app, screen, collector, target}) => { - await expectScenario('smoke-js', target, {app, screen, collector}); -}); +/** Scenarios with their own e2e file (they need more than tap-and-compare). */ +const OWN_FILE = new Set([ + 'collector-down', + 'native-init-failure', + 'flush-after-reload', + 'background-flush', + 'fast-refresh-idempotent', + 'smoke-device', + 'perf-budget', + 'export-headers', +]); + +// expectScenario skips targets a scenario does not list +for (const s of allScenarios().filter(s => s.runners.includes('e2e') && !s.pending && !OWN_FILE.has(s.name))) { + test(s.name, async ({app, screen, collector, target}) => { + await expectScenario(s.name, target, {app, screen, collector}); + }); +} diff --git a/verify/expected/event-emitter-listener.js.otlp.json b/verify/expected/event-emitter-listener.js.otlp.json new file mode 100644 index 0000000..71f62e7 --- /dev/null +++ b/verify/expected/event-emitter-listener.js.otlp.json @@ -0,0 +1,46 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "emit", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000020000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "listener", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/nest-raf.js.otlp.json b/verify/expected/nest-raf.js.otlp.json new file mode 100644 index 0000000..947dddf --- /dev/null +++ b/verify/expected/nest-raf.js.otlp.json @@ -0,0 +1,46 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000020000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "frame", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/scenarios/event-emitter-listener.ts b/verify/scenarios/event-emitter-listener.ts index 879d591..7eedaaf 100644 --- a/verify/scenarios/event-emitter-listener.ts +++ b/verify/scenarios/event-emitter-listener.ts @@ -19,5 +19,5 @@ export default scenario( } }, // web: DeviceEventEmitter on react-native-web not confirmed - {runners: ['e2e'], targets: ['android', 'ios'], pending: true}, // Task 13 + {runners: ['e2e'], targets: ['android', 'ios']} ); diff --git a/verify/scenarios/interaction-manager.ts b/verify/scenarios/interaction-manager.ts index ecccd88..2dc3c9c 100644 --- a/verify/scenarios/interaction-manager.ts +++ b/verify/scenarios/interaction-manager.ts @@ -20,5 +20,7 @@ export default scenario( parent.end(at(20)); }); }, - {runners: ['e2e'], pending: true}, // Task 13 + // RN 0.88 (the example) removed InteractionManager from core (dev: invariant; release: undefined). Kept pending until + // an example on an RN that still ships it exists; the RN replacement, requestIdleCallback, is not in the §6.1 patch list. + {runners: ['e2e'], pending: true}, ); diff --git a/verify/scenarios/nest-raf.ts b/verify/scenarios/nest-raf.ts index 0ff14db..e48d67c 100644 --- a/verify/scenarios/nest-raf.ts +++ b/verify/scenarios/nest-raf.ts @@ -14,5 +14,5 @@ export default scenario( root.end(at(20)); }); }, - {runners: ['e2e'], pending: true}, // Task 13 + {runners: ['e2e']} ); From 507327e1cd889fd1eedbb21e463802afd338abb5 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:50:31 +0100 Subject: [PATCH 29/76] chore(deps): add jest-environment-jsdom for web unit tests Co-Authored-By: Claude Opus 5.5 --- bun.lock | 165 +++++++++++++++++++++++++++++---------------------- package.json | 1 + 2 files changed, 96 insertions(+), 70 deletions(-) diff --git a/bun.lock b/bun.lock index 78be153..b2bcc7b 100644 --- a/bun.lock +++ b/bun.lock @@ -21,6 +21,7 @@ "babel-jest": "^30.5.2", "e2e": "0.24.0", "jest": "^30.5.2", + "jest-environment-jsdom": "30.5.2", "nitrogen": "0.37.2", "oxlint": "^1.95.0", "protobufjs": "^8.8.1", @@ -46,6 +47,8 @@ "@ark/util": ["@ark/util@0.46.0", "", {}, "sha512-JPy/NGWn/lvf1WmGCPw2VGpBg5utZraE84I7wli18EDF3p3zc/e9WolT35tINeZO3l7C77SjqRJeAUoT0CvMRg=="], + "@asamuzakjp/css-color": ["@asamuzakjp/css-color@3.2.0", "", { "dependencies": { "@csstools/css-calc": "^2.1.3", "@csstools/css-color-parser": "^3.0.9", "@csstools/css-parser-algorithms": "^3.0.4", "@csstools/css-tokenizer": "^3.0.3", "lru-cache": "^10.4.3" } }, "sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw=="], + "@babel/code-frame": ["@babel/code-frame@7.26.2", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.25.9", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" } }, "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ=="], "@babel/compat-data": ["@babel/compat-data@7.26.8", "", {}, "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ=="], @@ -334,6 +337,16 @@ "@clack/prompts": ["@clack/prompts@1.9.0", "", { "dependencies": { "@clack/core": "1.6.0", "fast-string-width": "^3.0.2", "fast-wrap-ansi": "^0.2.0", "sisteransi": "^2.0.0" } }, "sha512-tEj8X2No2A1c9NDnZECxiiJ8TP3vmFlN9tLlLeSaMqVW4tUmVG2R4qpv/eP4zymWxnymYLkLcIYVV0VcWj3RCQ=="], + "@csstools/color-helpers": ["@csstools/color-helpers@5.1.0", "", {}, "sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA=="], + + "@csstools/css-calc": ["@csstools/css-calc@2.1.4", "", { "peerDependencies": { "@csstools/css-parser-algorithms": "^3.0.5", "@csstools/css-tokenizer": "^3.0.4" } }, "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ=="], + + "@csstools/css-color-parser": ["@csstools/css-color-parser@3.1.0", "", { "dependencies": { "@csstools/color-helpers": "^5.1.0", "@csstools/css-calc": "^2.1.4" }, "peerDependencies": { "@csstools/css-parser-algorithms": "^3.0.5", "@csstools/css-tokenizer": "^3.0.4" } }, "sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA=="], + + "@csstools/css-parser-algorithms": ["@csstools/css-parser-algorithms@3.0.5", "", { "peerDependencies": { "@csstools/css-tokenizer": "^3.0.4" } }, "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ=="], + + "@csstools/css-tokenizer": ["@csstools/css-tokenizer@3.0.4", "", {}, "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw=="], + "@e2e-dev/core": ["@e2e-dev/core@0.24.0", "", { "dependencies": { "@napi-rs/image": "1.16.0", "pixelmatch": "8.0.0", "zod": "4.6.7" }, "peerDependencies": { "ai": "^7.0.0" }, "optionalPeers": ["ai"] }, "sha512-RSPX0RRiN8VFg3l34wN1gv12FIMoNTZ+YUAkW5SH1vUWwYdoo/8F2TtjqdffgdaGLH38yAuH11BPdmqHHiWuBA=="], "@e2e-dev/mobile": ["@e2e-dev/mobile@0.12.8", "", { "dependencies": { "@napi-rs/image": "1.16.0", "agent-device": "0.21.39", "zod": "4.6.7" }, "peerDependencies": { "@e2e-dev/core": ">=0.23.2 <1", "ai": "^7.0.0", "e2e": ">=0.23.2 <1" }, "optionalPeers": ["ai", "e2e"] }, "sha512-N9BuoUC0a+7pG1NbhTfL0janxqNf7blm+6TW/EQZ4IlURbYIZQFmSRK+2HEnH+FzrobqXBBI/egHYW9LIRfGsg=="], @@ -360,13 +373,15 @@ "@jest/diff-sequences": ["@jest/diff-sequences@30.5.0", "", {}, "sha512-OsqBjHXCn8cadasoAZBP6nWYvMsRhpMzGXTpxJ5aO04NlbdhIz+FVe3q49l0AwVhsz/cEmIpBes6gAFl1/dWQg=="], - "@jest/environment": ["@jest/environment@29.7.0", "", { "dependencies": { "@jest/fake-timers": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "jest-mock": "^29.7.0" } }, "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw=="], + "@jest/environment": ["@jest/environment@30.5.2", "", { "dependencies": { "@jest/fake-timers": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", "jest-mock": "30.5.2" } }, "sha512-nwFPOUMbmsjNNRCpnJpB9HbSZu4C07wDDds++5j+j1MezzPLxMPDdbdUVjr2o4RULDOValnDd70taPFI1EtxAg=="], + + "@jest/environment-jsdom-abstract": ["@jest/environment-jsdom-abstract@30.5.2", "", { "dependencies": { "@jest/environment": "30.5.2", "@jest/fake-timers": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", "jest-mock": "30.5.2", "jest-util": "30.5.1" }, "peerDependencies": { "@types/jsdom": "*", "canvas": "^3.0.0", "jsdom": "*" }, "optionalPeers": ["canvas"] }, "sha512-8/P+8hKv7L4mhFoB6gpYLj/fuzXk8PWrde7TDHh8tJz5pE1ktlMbg0y6hDY/V8MfAnispFlPl/vPifowLy3JGQ=="], "@jest/expect": ["@jest/expect@30.5.2", "", { "dependencies": { "expect": "30.5.2", "jest-snapshot": "30.5.2" } }, "sha512-2E+1Pg6jJxbRjLNLpciC71iri/3qsKJL222/aXJEFwC0VdUSvfS+JZQQLEVjUYYc8t8pQu2MGE3cF2+bNTYRsg=="], "@jest/expect-utils": ["@jest/expect-utils@30.5.2", "", { "dependencies": { "@jest/get-type": "30.5.0" } }, "sha512-d/HOLSrJUlBIl6n3LzOa7cjW3xdePm5H5gQw2lixZ/0h157l9sw3mLblzFqnPcTbhDzhRQdBOX3A3KcG73nm5Q=="], - "@jest/fake-timers": ["@jest/fake-timers@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", "jest-message-util": "^29.7.0", "jest-mock": "^29.7.0", "jest-util": "^29.7.0" } }, "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ=="], + "@jest/fake-timers": ["@jest/fake-timers@30.5.2", "", { "dependencies": { "@jest/types": "30.5.1", "@sinonjs/fake-timers": "^15.4.0", "@types/node": "*", "jest-message-util": "30.5.1", "jest-mock": "30.5.2", "jest-util": "30.5.1" } }, "sha512-GKk0h0tKT5SpDPxDhPg3r9mm5s8/YCBzVNMOGdRiQXwUiMsjU10mVPlMaQstH6/cu50vOb8N9oQUMETHuwwxKw=="], "@jest/get-type": ["@jest/get-type@30.5.0", "", {}, "sha512-9/2VUPitAjmBzbvDvqrxmvB7BzWsBW0WmkkojX1ODuxX1NLGxx9gfaZpHB0z8DtJ9uhGNmZG/VXBhf8uO0OV8Q=="], @@ -682,7 +697,7 @@ "@sinonjs/commons": ["@sinonjs/commons@3.0.1", "", { "dependencies": { "type-detect": "4.0.8" } }, "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ=="], - "@sinonjs/fake-timers": ["@sinonjs/fake-timers@10.3.0", "", { "dependencies": { "@sinonjs/commons": "^3.0.0" } }, "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA=="], + "@sinonjs/fake-timers": ["@sinonjs/fake-timers@15.5.0", "", { "dependencies": { "@sinonjs/commons": "^3.0.1" } }, "sha512-i7HpIYIsUmdSTQbtBjs2b3VqMgDsVDWfzVPV3MuUrXVqJNZmzFB8YJeM9SPms2bGg5zg7HvKH31sPS1WoLLRFg=="], "@standard-schema/spec": ["@standard-schema/spec@1.1.0", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="], @@ -710,6 +725,8 @@ "@types/jest": ["@types/jest@30.0.0", "", { "dependencies": { "expect": "^30.0.0", "pretty-format": "^30.0.0" } }, "sha512-XTYugzhuwqWjws0CVz8QpM36+T+Dz5mTEBKhNs/esGLnCIlGdRy+Dq78NRjd7ls7r8BC8ZRMOrKlkO1hU0JOwA=="], + "@types/jsdom": ["@types/jsdom@21.1.7", "", { "dependencies": { "@types/node": "*", "@types/tough-cookie": "*", "parse5": "^7.0.0" } }, "sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA=="], + "@types/node": ["@types/node@24.19.2", "", { "dependencies": { "undici-types": ">=7.24.0 <7.24.7" } }, "sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ=="], "@types/node-forge": ["@types/node-forge@1.3.11", "", { "dependencies": { "@types/node": "*" } }, "sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ=="], @@ -718,6 +735,8 @@ "@types/stack-utils": ["@types/stack-utils@2.0.3", "", {}, "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw=="], + "@types/tough-cookie": ["@types/tough-cookie@4.0.5", "", {}, "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA=="], + "@types/yargs": ["@types/yargs@17.0.33", "", { "dependencies": { "@types/yargs-parser": "*" } }, "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA=="], "@types/yargs-parser": ["@types/yargs-parser@21.0.3", "", {}, "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ=="], @@ -780,6 +799,8 @@ "acorn": ["acorn@8.14.1", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg=="], + "agent-base": ["agent-base@7.1.4", "", {}, "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ=="], + "agent-device": ["agent-device@0.21.39", "", { "peerDependencies": { "ai": "^6.0.0 || ^7.0.0" }, "optionalPeers": ["ai"], "bin": { "agent-device": "bin/agent-device.mjs" } }, "sha512-flgrilleoUU9WNd9BlU8h5KMt8zv0nKWBkqJbzk/bb2NBRA+7H1FGja+RIAuapb7HXdsjK4EPnYFP37N9S8nMA=="], "aggregate-error": ["aggregate-error@3.1.0", "", { "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" } }, "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA=="], @@ -934,14 +955,20 @@ "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], + "cssstyle": ["cssstyle@4.6.0", "", { "dependencies": { "@asamuzakjp/css-color": "^3.2.0", "rrweb-cssom": "^0.8.0" } }, "sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg=="], + "csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="], + "data-urls": ["data-urls@5.0.0", "", { "dependencies": { "whatwg-mimetype": "^4.0.0", "whatwg-url": "^14.0.0" } }, "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg=="], + "dayjs": ["dayjs@1.11.13", "", {}, "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="], "debug": ["debug@4.4.0", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA=="], "decamelize": ["decamelize@1.2.0", "", {}, "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA=="], + "decimal.js": ["decimal.js@10.6.0", "", {}, "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg=="], + "dedent": ["dedent@0.7.0", "", {}, "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA=="], "deepmerge": ["deepmerge@4.3.1", "", {}, "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="], @@ -982,6 +1009,8 @@ "enquirer": ["enquirer@2.4.1", "", { "dependencies": { "ansi-colors": "^4.1.1", "strip-ansi": "^6.0.1" } }, "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ=="], + "entities": ["entities@6.0.1", "", {}, "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g=="], + "env-paths": ["env-paths@2.2.1", "", {}, "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A=="], "envinfo": ["envinfo@7.14.0", "", { "bin": { "envinfo": "dist/cli.js" } }, "sha512-CO40UI41xDQzhLB1hWyqUKgFhs250pNcGbyGKe1l/e4FSaI/+YE4IMG76GDt0In67WLPACIITC+sOi08x4wIvg=="], @@ -1100,10 +1129,16 @@ "hermes-parser": ["hermes-parser@0.25.1", "", { "dependencies": { "hermes-estree": "0.25.1" } }, "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA=="], + "html-encoding-sniffer": ["html-encoding-sniffer@4.0.0", "", { "dependencies": { "whatwg-encoding": "^3.1.1" } }, "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ=="], + "html-escaper": ["html-escaper@2.0.2", "", {}, "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg=="], "http-errors": ["http-errors@2.0.0", "", { "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", "setprototypeof": "1.2.0", "statuses": "2.0.1", "toidentifier": "1.0.1" } }, "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ=="], + "http-proxy-agent": ["http-proxy-agent@7.0.2", "", { "dependencies": { "agent-base": "^7.1.0", "debug": "^4.3.4" } }, "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig=="], + + "https-proxy-agent": ["https-proxy-agent@7.0.6", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "4" } }, "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw=="], + "human-id": ["human-id@4.1.1", "", { "bin": { "human-id": "dist/cli.js" } }, "sha512-3gKm/gCSUipeLsRYZbbdA1BD83lBoWUkZ7G9VFrhWPAU76KwYo5KR8V28bpoPm/ygy0x5/GCbpRQdY7VLYCoIg=="], "human-signals": ["human-signals@1.1.1", "", {}, "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw=="], @@ -1162,6 +1197,8 @@ "is-plain-object": ["is-plain-object@2.0.4", "", { "dependencies": { "isobject": "^3.0.1" } }, "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og=="], + "is-potential-custom-element-name": ["is-potential-custom-element-name@1.0.1", "", {}, "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ=="], + "is-relative": ["is-relative@1.0.0", "", { "dependencies": { "is-unc-path": "^1.0.0" } }, "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA=="], "is-stream": ["is-stream@2.0.1", "", {}, "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg=="], @@ -1210,6 +1247,8 @@ "jest-each": ["jest-each@30.5.2", "", { "dependencies": { "@jest/get-type": "30.5.0", "@jest/types": "30.5.1", "chalk": "^4.1.2", "jest-regex-util": "30.5.0", "jest-util": "30.5.1", "pretty-format": "30.5.1" } }, "sha512-GRrW+7fmmgmkvyfEBqc1QFdWnF1Ex5yG6Y6AWL4TTxnkWlKIT98dsKh3P3UuWm6v4XsQwVE6DEzXIPMzWJ3ZbA=="], + "jest-environment-jsdom": ["jest-environment-jsdom@30.5.2", "", { "dependencies": { "@jest/environment": "30.5.2", "@jest/environment-jsdom-abstract": "30.5.2", "@types/jsdom": "^21.1.7", "jsdom": "^26.1.0" }, "peerDependencies": { "canvas": "^3.0.0" }, "optionalPeers": ["canvas"] }, "sha512-6NOZjEP+WNi4WXjbxb/1ROnfaMxn6Dhqu6uSC22o0H28z+uppejs/jZ9KCVoLepqqoCjcNZujtzQqC9jSV15jg=="], + "jest-environment-node": ["jest-environment-node@29.7.0", "", { "dependencies": { "@jest/environment": "^29.7.0", "@jest/fake-timers": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "jest-mock": "^29.7.0", "jest-util": "^29.7.0" } }, "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw=="], "jest-get-type": ["jest-get-type@29.6.3", "", {}, "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw=="], @@ -1254,6 +1293,8 @@ "jscodeshift": ["jscodeshift@17.3.0", "", { "dependencies": { "@babel/core": "^7.24.7", "@babel/parser": "^7.24.7", "@babel/plugin-transform-class-properties": "^7.24.7", "@babel/plugin-transform-modules-commonjs": "^7.24.7", "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", "@babel/plugin-transform-optional-chaining": "^7.24.7", "@babel/plugin-transform-private-methods": "^7.24.7", "@babel/preset-flow": "^7.24.7", "@babel/preset-typescript": "^7.24.7", "@babel/register": "^7.24.6", "flow-parser": "0.*", "graceful-fs": "^4.2.4", "micromatch": "^4.0.7", "neo-async": "^2.5.0", "picocolors": "^1.0.1", "recast": "^0.23.11", "tmp": "^0.2.3", "write-file-atomic": "^5.0.1" }, "peerDependencies": { "@babel/preset-env": "^7.1.6" }, "optionalPeers": ["@babel/preset-env"], "bin": { "jscodeshift": "bin/jscodeshift.js" } }, "sha512-LjFrGOIORqXBU+jwfC9nbkjmQfFldtMIoS6d9z2LG/lkmyNXsJAySPT+2SWXJEoE68/bCWcxKpXH37npftgmow=="], + "jsdom": ["jsdom@26.1.0", "", { "dependencies": { "cssstyle": "^4.2.1", "data-urls": "^5.0.0", "decimal.js": "^10.5.0", "html-encoding-sniffer": "^4.0.0", "http-proxy-agent": "^7.0.2", "https-proxy-agent": "^7.0.6", "is-potential-custom-element-name": "^1.0.1", "nwsapi": "^2.2.16", "parse5": "^7.2.1", "rrweb-cssom": "^0.8.0", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", "tough-cookie": "^5.1.1", "w3c-xmlserializer": "^5.0.0", "webidl-conversions": "^7.0.0", "whatwg-encoding": "^3.1.1", "whatwg-mimetype": "^4.0.0", "whatwg-url": "^14.1.1", "ws": "^8.18.0", "xml-name-validator": "^5.0.0" }, "peerDependencies": { "canvas": "^3.0.0" }, "optionalPeers": ["canvas"] }, "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg=="], + "jsesc": ["jsesc@3.1.0", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="], "json-parse-better-errors": ["json-parse-better-errors@1.0.2", "", {}, "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw=="], @@ -1386,6 +1427,8 @@ "nullthrows": ["nullthrows@1.1.1", "", {}, "sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw=="], + "nwsapi": ["nwsapi@2.2.28", "", {}, "sha512-IlVB7OS7qrOsVYlpnFIkETjMwT9jwvmocJmmM+GZU/PAB3uGi9Ezd7vcWhWBUnSc0ya4ppmQITOyP1ez9gg8cg=="], + "ob1": ["ob1@0.81.4", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-EZLYM8hfPraC2SYOR5EWLFAPV5e6g+p83m2Jth9bzCpFxP1NDQJYXdmXRB2bfbaWQSmm6NkIQlbzk7uU5lLfgg=="], "on-finished": ["on-finished@2.3.0", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww=="], @@ -1428,6 +1471,8 @@ "parse-json": ["parse-json@5.2.0", "", { "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg=="], + "parse5": ["parse5@7.3.0", "", { "dependencies": { "entities": "^6.0.0" } }, "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw=="], + "parseurl": ["parseurl@1.3.3", "", {}, "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="], "path-browserify": ["path-browserify@1.0.1", "", {}, "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="], @@ -1474,6 +1519,8 @@ "pump": ["pump@3.0.2", "", { "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw=="], + "punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="], + "pure-rand": ["pure-rand@7.0.1", "", {}, "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ=="], "quansync": ["quansync@0.2.10", "", {}, "sha512-t41VRkMYbkHyCYmOvx/6URnN80H7k4X0lLdBMGsz+maAwrJQYB1djpV6vHrQIBE0WBSGqhtEHrK9U3DWWH8v7A=="], @@ -1540,12 +1587,16 @@ "rimraf": ["rimraf@3.0.2", "", { "dependencies": { "glob": "^7.1.3" }, "bin": { "rimraf": "bin.js" } }, "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA=="], + "rrweb-cssom": ["rrweb-cssom@0.8.0", "", {}, "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw=="], + "run-parallel": ["run-parallel@1.2.0", "", { "dependencies": { "queue-microtask": "^1.2.2" } }, "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="], "safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="], "safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="], + "saxes": ["saxes@6.0.0", "", { "dependencies": { "xmlchars": "^2.2.0" } }, "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA=="], + "scheduler": ["scheduler@0.25.0", "", {}, "sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA=="], "selfsigned": ["selfsigned@2.4.1", "", { "dependencies": { "@types/node-forge": "^1.3.0", "node-forge": "^1" } }, "sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q=="], @@ -1620,6 +1671,8 @@ "supports-preserve-symlinks-flag": ["supports-preserve-symlinks-flag@1.0.0", "", {}, "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="], + "symbol-tree": ["symbol-tree@3.2.4", "", {}, "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw=="], + "synckit": ["synckit@0.11.13", "", { "dependencies": { "@pkgr/core": "^0.3.6" } }, "sha512-eNRKgb3z66Yp3D2CixVujOUvXLFUTij/zVnV8KRyvFdQwpz7I5DS8UfRkTeLzb64u+dkzDSdelE24izu+zSSUg=="], "term-size": ["term-size@2.2.1", "", {}, "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg=="], @@ -1638,6 +1691,10 @@ "tinyrainbow": ["tinyrainbow@3.2.0", "", {}, "sha512-LgO3D9yZJjApUiuUfl9iFAwrtaX4+lok3wJIqttGoKCHlWUqHqbQpnxCf82L8FjgKsh4iGo78hqJwgL8F6To2A=="], + "tldts": ["tldts@6.1.86", "", { "dependencies": { "tldts-core": "^6.1.86" }, "bin": { "tldts": "bin/cli.js" } }, "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ=="], + + "tldts-core": ["tldts-core@6.1.86", "", {}, "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA=="], + "tmp": ["tmp@0.0.33", "", { "dependencies": { "os-tmpdir": "~1.0.2" } }, "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw=="], "tmpl": ["tmpl@1.0.5", "", {}, "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw=="], @@ -1648,6 +1705,10 @@ "toml-eslint-parser": ["toml-eslint-parser@1.0.3", "", { "dependencies": { "eslint-visitor-keys": "^5.0.0" } }, "sha512-A5F0cM6+mDleacLIEUkmfpkBbnHJFV1d2rprHU2MXNk7mlxHq2zGojA+SRvQD1RoMo9gqjZPWEaKG4v1BQ48lw=="], + "tough-cookie": ["tough-cookie@5.1.2", "", { "dependencies": { "tldts": "^6.1.32" } }, "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A=="], + + "tr46": ["tr46@5.1.1", "", { "dependencies": { "punycode": "^2.3.1" } }, "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw=="], + "ts-morph": ["ts-morph@28.0.0", "", { "dependencies": { "@ts-morph/common": "~0.29.0", "code-block-writer": "^13.0.3" } }, "sha512-Wp3tnZ2bzwxyTZMtgWVzXDfm7lB1Drz+y9DmmYH/L702PQhPyVrp3pkou3yIz4qjS14GY9kcpmLiOOMvl8oG1g=="], "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], @@ -1688,12 +1749,22 @@ "vlq": ["vlq@1.0.1", "", {}, "sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w=="], + "w3c-xmlserializer": ["w3c-xmlserializer@5.0.0", "", { "dependencies": { "xml-name-validator": "^5.0.0" } }, "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA=="], + "walker": ["walker@1.0.8", "", { "dependencies": { "makeerror": "1.0.12" } }, "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ=="], "wcwidth": ["wcwidth@1.0.1", "", { "dependencies": { "defaults": "^1.0.3" } }, "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg=="], + "webidl-conversions": ["webidl-conversions@7.0.0", "", {}, "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g=="], + + "whatwg-encoding": ["whatwg-encoding@3.1.1", "", { "dependencies": { "iconv-lite": "0.6.3" } }, "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ=="], + "whatwg-fetch": ["whatwg-fetch@3.6.20", "", {}, "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg=="], + "whatwg-mimetype": ["whatwg-mimetype@4.0.0", "", {}, "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg=="], + + "whatwg-url": ["whatwg-url@14.2.0", "", { "dependencies": { "tr46": "^5.1.0", "webidl-conversions": "^7.0.0" } }, "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw=="], + "which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="], "which-module": ["which-module@2.0.1", "", {}, "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ=="], @@ -1708,6 +1779,10 @@ "ws": ["ws@6.2.3", "", { "dependencies": { "async-limiter": "~1.0.0" } }, "sha512-jmTjYU0j60B+vHey6TfR3Z7RD61z/hmxBS3VMSGIrroOWXQEneK1zNuotOUrGyBHQj0yrpsLHPWtigEFd13ndA=="], + "xml-name-validator": ["xml-name-validator@5.0.0", "", {}, "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg=="], + + "xmlchars": ["xmlchars@2.2.0", "", {}, "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw=="], + "xtend": ["xtend@4.0.2", "", {}, "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="], "y18n": ["y18n@5.0.8", "", {}, "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="], @@ -1726,6 +1801,8 @@ "@ampproject/remapping/@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.25", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ=="], + "@asamuzakjp/css-color/lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="], + "@babel/core/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], "@babel/generator/@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.25", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ=="], @@ -1756,24 +1833,6 @@ "@jest/create-cache-key-function/@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=="], - "@jest/environment/@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=="], - - "@jest/environment/@types/node": ["@types/node@22.13.13", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ=="], - - "@jest/environment/jest-mock": ["jest-mock@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", "jest-util": "^29.7.0" } }, "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw=="], - - "@jest/fake-timers/@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=="], - - "@jest/fake-timers/@types/node": ["@types/node@22.13.13", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ=="], - - "@jest/fake-timers/jest-message-util": ["jest-message-util@29.7.0", "", { "dependencies": { "@babel/code-frame": "^7.12.13", "@jest/types": "^29.6.3", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", "pretty-format": "^29.7.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" } }, "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w=="], - - "@jest/fake-timers/jest-mock": ["jest-mock@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", "jest-util": "^29.7.0" } }, "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw=="], - - "@jest/fake-timers/jest-util": ["jest-util@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", "graceful-fs": "^4.2.9", "picomatch": "^2.2.3" } }, "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA=="], - - "@jest/globals/@jest/environment": ["@jest/environment@30.5.2", "", { "dependencies": { "@jest/fake-timers": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", "jest-mock": "30.5.2" } }, "sha512-nwFPOUMbmsjNNRCpnJpB9HbSZu4C07wDDds++5j+j1MezzPLxMPDdbdUVjr2o4RULDOValnDd70taPFI1EtxAg=="], - "@jest/reporters/glob": ["glob@13.0.7", "", { "dependencies": { "minimatch": "^10.2.2", "minipass": "^7.1.3", "path-scurry": "^2.0.2" } }, "sha512-wfsFgXQ8A3SEI9XGf7Nl3Y9l7ffSrGh7SUCT7vU/2CzYPep9kjxAn1S40F9OPKxAMGCVl7HtNlJhrCJUeUq83g=="], "@jest/transform/@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], @@ -1906,8 +1965,6 @@ "jest-changed-files/p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="], - "jest-circus/@jest/environment": ["@jest/environment@30.5.2", "", { "dependencies": { "@jest/fake-timers": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", "jest-mock": "30.5.2" } }, "sha512-nwFPOUMbmsjNNRCpnJpB9HbSZu4C07wDDds++5j+j1MezzPLxMPDdbdUVjr2o4RULDOValnDd70taPFI1EtxAg=="], - "jest-circus/dedent": ["dedent@1.7.2", "", { "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, "optionalPeers": ["babel-plugin-macros"] }, "sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA=="], "jest-circus/p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="], @@ -1922,6 +1979,10 @@ "jest-config/jest-environment-node": ["jest-environment-node@30.5.2", "", { "dependencies": { "@jest/environment": "30.5.2", "@jest/fake-timers": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", "jest-mock": "30.5.2", "jest-util": "30.5.1", "jest-validate": "30.5.1" } }, "sha512-Ciz4KgTGIbojxSKpuFImgWJj5EyqfE8xMq9NxWmOXnQywHHS03H9Mv+vaCB29J5pr3JBrY27WbRV18rBdjh8Dg=="], + "jest-environment-node/@jest/environment": ["@jest/environment@29.7.0", "", { "dependencies": { "@jest/fake-timers": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "jest-mock": "^29.7.0" } }, "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw=="], + + "jest-environment-node/@jest/fake-timers": ["@jest/fake-timers@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", "jest-message-util": "^29.7.0", "jest-mock": "^29.7.0", "jest-util": "^29.7.0" } }, "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ=="], + "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=="], "jest-environment-node/@types/node": ["@types/node@22.13.13", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ=="], @@ -1936,16 +1997,10 @@ "jest-message-util/picomatch": ["picomatch@4.0.7", "", {}, "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA=="], - "jest-runner/@jest/environment": ["@jest/environment@30.5.2", "", { "dependencies": { "@jest/fake-timers": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", "jest-mock": "30.5.2" } }, "sha512-nwFPOUMbmsjNNRCpnJpB9HbSZu4C07wDDds++5j+j1MezzPLxMPDdbdUVjr2o4RULDOValnDd70taPFI1EtxAg=="], - "jest-runner/jest-environment-node": ["jest-environment-node@30.5.2", "", { "dependencies": { "@jest/environment": "30.5.2", "@jest/fake-timers": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", "jest-mock": "30.5.2", "jest-util": "30.5.1", "jest-validate": "30.5.1" } }, "sha512-Ciz4KgTGIbojxSKpuFImgWJj5EyqfE8xMq9NxWmOXnQywHHS03H9Mv+vaCB29J5pr3JBrY27WbRV18rBdjh8Dg=="], "jest-runner/p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="], - "jest-runtime/@jest/environment": ["@jest/environment@30.5.2", "", { "dependencies": { "@jest/fake-timers": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", "jest-mock": "30.5.2" } }, "sha512-nwFPOUMbmsjNNRCpnJpB9HbSZu4C07wDDds++5j+j1MezzPLxMPDdbdUVjr2o4RULDOValnDd70taPFI1EtxAg=="], - - "jest-runtime/@jest/fake-timers": ["@jest/fake-timers@30.5.2", "", { "dependencies": { "@jest/types": "30.5.1", "@sinonjs/fake-timers": "^15.4.0", "@types/node": "*", "jest-message-util": "30.5.1", "jest-mock": "30.5.2", "jest-util": "30.5.1" } }, "sha512-GKk0h0tKT5SpDPxDhPg3r9mm5s8/YCBzVNMOGdRiQXwUiMsjU10mVPlMaQstH6/cu50vOb8N9oQUMETHuwwxKw=="], - "jest-runtime/glob": ["glob@13.0.7", "", { "dependencies": { "minimatch": "^10.2.2", "minipass": "^7.1.3", "path-scurry": "^2.0.2" } }, "sha512-wfsFgXQ8A3SEI9XGf7Nl3Y9l7ffSrGh7SUCT7vU/2CzYPep9kjxAn1S40F9OPKxAMGCVl7HtNlJhrCJUeUq83g=="], "jest-runtime/strip-bom": ["strip-bom@4.0.0", "", {}, "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w=="], @@ -1974,6 +2029,8 @@ "jscodeshift/tmp": ["tmp@0.2.3", "", {}, "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w=="], + "jsdom/ws": ["ws@8.23.0", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ=="], + "lighthouse-logger/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], "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=="], @@ -2080,6 +2137,8 @@ "tinyglobby/picomatch": ["picomatch@4.0.7", "", {}, "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA=="], + "whatwg-encoding/iconv-lite": ["iconv-lite@0.6.3", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw=="], + "wrap-ansi/ansi-styles": ["ansi-styles@6.2.3", "", {}, "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg=="], "wrap-ansi/string-width": ["string-width@7.2.0", "", { "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" } }, "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ=="], @@ -2102,20 +2161,6 @@ "@jest/create-cache-key-function/@jest/types/@types/node": ["@types/node@22.13.13", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ=="], - "@jest/environment/@jest/types/@jest/schemas": ["@jest/schemas@29.6.3", "", { "dependencies": { "@sinclair/typebox": "^0.27.8" } }, "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA=="], - - "@jest/environment/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@jest/environment/jest-mock/jest-util": ["jest-util@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", "graceful-fs": "^4.2.9", "picomatch": "^2.2.3" } }, "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA=="], - - "@jest/fake-timers/@jest/types/@jest/schemas": ["@jest/schemas@29.6.3", "", { "dependencies": { "@sinclair/typebox": "^0.27.8" } }, "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA=="], - - "@jest/fake-timers/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - - "@jest/fake-timers/jest-message-util/pretty-format": ["pretty-format@29.7.0", "", { "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } }, "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ=="], - - "@jest/globals/@jest/environment/@jest/fake-timers": ["@jest/fake-timers@30.5.2", "", { "dependencies": { "@jest/types": "30.5.1", "@sinonjs/fake-timers": "^15.4.0", "@types/node": "*", "jest-message-util": "30.5.1", "jest-mock": "30.5.2", "jest-util": "30.5.1" } }, "sha512-GKk0h0tKT5SpDPxDhPg3r9mm5s8/YCBzVNMOGdRiQXwUiMsjU10mVPlMaQstH6/cu50vOb8N9oQUMETHuwwxKw=="], - "@jest/reporters/glob/minimatch": ["minimatch@10.2.6", "", { "dependencies": { "brace-expansion": "^5.0.8" } }, "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A=="], "@jest/reporters/glob/minipass": ["minipass@7.1.3", "", {}, "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A=="], @@ -2316,8 +2361,6 @@ "jest-changed-files/execa/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], - "jest-circus/@jest/environment/@jest/fake-timers": ["@jest/fake-timers@30.5.2", "", { "dependencies": { "@jest/types": "30.5.1", "@sinonjs/fake-timers": "^15.4.0", "@types/node": "*", "jest-message-util": "30.5.1", "jest-mock": "30.5.2", "jest-util": "30.5.1" } }, "sha512-GKk0h0tKT5SpDPxDhPg3r9mm5s8/YCBzVNMOGdRiQXwUiMsjU10mVPlMaQstH6/cu50vOb8N9oQUMETHuwwxKw=="], - "jest-cli/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=="], "jest-cli/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=="], @@ -2350,9 +2393,9 @@ "jest-config/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=="], - "jest-config/jest-environment-node/@jest/environment": ["@jest/environment@30.5.2", "", { "dependencies": { "@jest/fake-timers": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", "jest-mock": "30.5.2" } }, "sha512-nwFPOUMbmsjNNRCpnJpB9HbSZu4C07wDDds++5j+j1MezzPLxMPDdbdUVjr2o4RULDOValnDd70taPFI1EtxAg=="], + "jest-environment-node/@jest/fake-timers/@sinonjs/fake-timers": ["@sinonjs/fake-timers@10.3.0", "", { "dependencies": { "@sinonjs/commons": "^3.0.0" } }, "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA=="], - "jest-config/jest-environment-node/@jest/fake-timers": ["@jest/fake-timers@30.5.2", "", { "dependencies": { "@jest/types": "30.5.1", "@sinonjs/fake-timers": "^15.4.0", "@types/node": "*", "jest-message-util": "30.5.1", "jest-mock": "30.5.2", "jest-util": "30.5.1" } }, "sha512-GKk0h0tKT5SpDPxDhPg3r9mm5s8/YCBzVNMOGdRiQXwUiMsjU10mVPlMaQstH6/cu50vOb8N9oQUMETHuwwxKw=="], + "jest-environment-node/@jest/fake-timers/jest-message-util": ["jest-message-util@29.7.0", "", { "dependencies": { "@babel/code-frame": "^7.12.13", "@jest/types": "^29.6.3", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", "pretty-format": "^29.7.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" } }, "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w=="], "jest-environment-node/@jest/types/@jest/schemas": ["@jest/schemas@29.6.3", "", { "dependencies": { "@sinclair/typebox": "^0.27.8" } }, "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA=="], @@ -2360,12 +2403,6 @@ "jest-message-util/@babel/code-frame/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.29.7", "", {}, "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg=="], - "jest-runner/@jest/environment/@jest/fake-timers": ["@jest/fake-timers@30.5.2", "", { "dependencies": { "@jest/types": "30.5.1", "@sinonjs/fake-timers": "^15.4.0", "@types/node": "*", "jest-message-util": "30.5.1", "jest-mock": "30.5.2", "jest-util": "30.5.1" } }, "sha512-GKk0h0tKT5SpDPxDhPg3r9mm5s8/YCBzVNMOGdRiQXwUiMsjU10mVPlMaQstH6/cu50vOb8N9oQUMETHuwwxKw=="], - - "jest-runner/jest-environment-node/@jest/fake-timers": ["@jest/fake-timers@30.5.2", "", { "dependencies": { "@jest/types": "30.5.1", "@sinonjs/fake-timers": "^15.4.0", "@types/node": "*", "jest-message-util": "30.5.1", "jest-mock": "30.5.2", "jest-util": "30.5.1" } }, "sha512-GKk0h0tKT5SpDPxDhPg3r9mm5s8/YCBzVNMOGdRiQXwUiMsjU10mVPlMaQstH6/cu50vOb8N9oQUMETHuwwxKw=="], - - "jest-runtime/@jest/fake-timers/@sinonjs/fake-timers": ["@sinonjs/fake-timers@15.5.0", "", { "dependencies": { "@sinonjs/commons": "^3.0.1" } }, "sha512-i7HpIYIsUmdSTQbtBjs2b3VqMgDsVDWfzVPV3MuUrXVqJNZmzFB8YJeM9SPms2bGg5zg7HvKH31sPS1WoLLRFg=="], - "jest-runtime/glob/minimatch": ["minimatch@10.2.6", "", { "dependencies": { "brace-expansion": "^5.0.8" } }, "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A=="], "jest-runtime/glob/minipass": ["minipass@7.1.3", "", {}, "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A=="], @@ -2498,14 +2535,6 @@ "@jest/create-cache-key-function/@jest/types/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], - "@jest/environment/@jest/types/@jest/schemas/@sinclair/typebox": ["@sinclair/typebox@0.27.8", "", {}, "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA=="], - - "@jest/fake-timers/@jest/types/@jest/schemas/@sinclair/typebox": ["@sinclair/typebox@0.27.8", "", {}, "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA=="], - - "@jest/fake-timers/jest-message-util/pretty-format/@jest/schemas": ["@jest/schemas@29.6.3", "", { "dependencies": { "@sinclair/typebox": "^0.27.8" } }, "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA=="], - - "@jest/globals/@jest/environment/@jest/fake-timers/@sinonjs/fake-timers": ["@sinonjs/fake-timers@15.5.0", "", { "dependencies": { "@sinonjs/commons": "^3.0.1" } }, "sha512-i7HpIYIsUmdSTQbtBjs2b3VqMgDsVDWfzVPV3MuUrXVqJNZmzFB8YJeM9SPms2bGg5zg7HvKH31sPS1WoLLRFg=="], - "@jest/reporters/glob/minimatch/brace-expansion": ["brace-expansion@5.1.0", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-aa11Dv491GKnYqxaul3aRJ0szew7yMJMfZPnqD44NjGrZXoj62l41OEDDpdpC4eE2P88vBFfLuSyRhpG91NUvg=="], "@jest/reporters/glob/path-scurry/lru-cache": ["lru-cache@11.5.3", "", {}, "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg=="], @@ -2618,8 +2647,6 @@ "istanbul-lib-instrument/@babel/parser/@babel/types/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.29.7", "", {}, "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg=="], - "jest-circus/@jest/environment/@jest/fake-timers/@sinonjs/fake-timers": ["@sinonjs/fake-timers@15.5.0", "", { "dependencies": { "@sinonjs/commons": "^3.0.1" } }, "sha512-i7HpIYIsUmdSTQbtBjs2b3VqMgDsVDWfzVPV3MuUrXVqJNZmzFB8YJeM9SPms2bGg5zg7HvKH31sPS1WoLLRFg=="], - "jest-cli/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=="], "jest-config/@babel/core/@babel/code-frame/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.29.7", "", {}, "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg=="], @@ -2642,14 +2669,10 @@ "jest-config/glob/path-scurry/lru-cache": ["lru-cache@11.5.3", "", {}, "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg=="], - "jest-config/jest-environment-node/@jest/fake-timers/@sinonjs/fake-timers": ["@sinonjs/fake-timers@15.5.0", "", { "dependencies": { "@sinonjs/commons": "^3.0.1" } }, "sha512-i7HpIYIsUmdSTQbtBjs2b3VqMgDsVDWfzVPV3MuUrXVqJNZmzFB8YJeM9SPms2bGg5zg7HvKH31sPS1WoLLRFg=="], + "jest-environment-node/@jest/fake-timers/jest-message-util/pretty-format": ["pretty-format@29.7.0", "", { "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } }, "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ=="], "jest-environment-node/@jest/types/@jest/schemas/@sinclair/typebox": ["@sinclair/typebox@0.27.8", "", {}, "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA=="], - "jest-runner/@jest/environment/@jest/fake-timers/@sinonjs/fake-timers": ["@sinonjs/fake-timers@15.5.0", "", { "dependencies": { "@sinonjs/commons": "^3.0.1" } }, "sha512-i7HpIYIsUmdSTQbtBjs2b3VqMgDsVDWfzVPV3MuUrXVqJNZmzFB8YJeM9SPms2bGg5zg7HvKH31sPS1WoLLRFg=="], - - "jest-runner/jest-environment-node/@jest/fake-timers/@sinonjs/fake-timers": ["@sinonjs/fake-timers@15.5.0", "", { "dependencies": { "@sinonjs/commons": "^3.0.1" } }, "sha512-i7HpIYIsUmdSTQbtBjs2b3VqMgDsVDWfzVPV3MuUrXVqJNZmzFB8YJeM9SPms2bGg5zg7HvKH31sPS1WoLLRFg=="], - "jest-runtime/glob/minimatch/brace-expansion": ["brace-expansion@5.1.0", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-aa11Dv491GKnYqxaul3aRJ0szew7yMJMfZPnqD44NjGrZXoj62l41OEDDpdpC4eE2P88vBFfLuSyRhpG91NUvg=="], "jest-runtime/glob/path-scurry/lru-cache": ["lru-cache@11.5.3", "", {}, "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg=="], @@ -2726,8 +2749,6 @@ "test-exclude/minimatch/brace-expansion/balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="], - "@jest/fake-timers/jest-message-util/pretty-format/@jest/schemas/@sinclair/typebox": ["@sinclair/typebox@0.27.8", "", {}, "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA=="], - "@jest/reporters/glob/minimatch/brace-expansion/balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="], "@react-native-community/cli-server-api/pretty-format/@jest/types/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], @@ -2782,6 +2803,8 @@ "jest-config/glob/minimatch/brace-expansion/balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="], + "jest-environment-node/@jest/fake-timers/jest-message-util/pretty-format/@jest/schemas": ["@jest/schemas@29.6.3", "", { "dependencies": { "@sinclair/typebox": "^0.27.8" } }, "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA=="], + "jest-runtime/glob/minimatch/brace-expansion/balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="], "logkitty/yargs/cliui/wrap-ansi/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], @@ -2830,6 +2853,8 @@ "@react-native/community-cli-plugin/metro/yargs/cliui/wrap-ansi/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], + "jest-environment-node/@jest/fake-timers/jest-message-util/pretty-format/@jest/schemas/@sinclair/typebox": ["@sinclair/typebox@0.27.8", "", {}, "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA=="], + "metro-file-map/jest-worker/jest-util/@jest/types/@jest/schemas/@sinclair/typebox": ["@sinclair/typebox@0.27.8", "", {}, "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA=="], "metro/jest-worker/jest-util/@jest/types/@jest/schemas/@sinclair/typebox": ["@sinclair/typebox@0.27.8", "", {}, "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA=="], diff --git a/package.json b/package.json index 23a5a71..2b0bba7 100644 --- a/package.json +++ b/package.json @@ -90,6 +90,7 @@ "babel-jest": "^30.5.2", "e2e": "0.24.0", "jest": "^30.5.2", + "jest-environment-jsdom": "30.5.2", "nitrogen": "0.37.2", "oxlint": "^1.95.0", "protobufjs": "^8.8.1", From 35007d052863f8635aa2ad96c6df167cad9c862b Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:54:14 +0100 Subject: [PATCH 30/76] feat(web): startReactNativeSdk with its own TracerProvider and proto exporter (R7) Per ruling R7: own sdk-trace TracerProvider + BatchSpanProcessor(OTLP proto) instead of startBrowserSdk; shared marker/registration with mobile start. Co-Authored-By: Claude Opus 5.5 --- bun.lock | 11 +- .../specs/2026-11-10-rn-otel-design.md | 18 ++- package.json | 7 +- src/index.web.ts | 5 + src/sdk/__tests__/start.web.test.ts | 111 ++++++++++++++++++ src/sdk/config.ts | 3 + src/sdk/shared.ts | 44 +++++++ src/sdk/start.ts | 38 +----- src/sdk/start.web.ts | 41 +++++++ 9 files changed, 225 insertions(+), 53 deletions(-) create mode 100644 src/index.web.ts create mode 100644 src/sdk/__tests__/start.web.test.ts create mode 100644 src/sdk/shared.ts create mode 100644 src/sdk/start.web.ts diff --git a/bun.lock b/bun.lock index b2bcc7b..4292aa7 100644 --- a/bun.lock +++ b/bun.lock @@ -5,8 +5,8 @@ "name": "react-native-open-telemetry", "dependencies": { "@opentelemetry/api": "~1.10.0", - "@opentelemetry/browser-sdk": "0.9.1", "@opentelemetry/core": "~3.1.1", + "@opentelemetry/exporter-trace-otlp-proto": "0.301.2", "@opentelemetry/resources": "~3.1.1", "@opentelemetry/sdk-trace": "~3.1.1", "@opentelemetry/semantic-conventions": "^1.45.0", @@ -14,7 +14,6 @@ "devDependencies": { "@changesets/cli": "^2.28.1", "@e2e-dev/mobile": "0.12.8", - "@opentelemetry/exporter-trace-otlp-proto": "~0.301.2", "@react-native/babel-preset": "^0.88.1", "@types/jest": "^30.0.0", "@types/node": "^24.0.0", @@ -465,16 +464,8 @@ "@opentelemetry/api": ["@opentelemetry/api@1.10.0", "", {}, "sha512-lMkyes8iHrG+mk6WH7X70MdCLI2RS0FwNBY1PyQ8UemaijE2m5mv5A0Niy3HtbYTFrgkUEQjFMXmSAk2hQDuPQ=="], - "@opentelemetry/browser-api": ["@opentelemetry/browser-api@0.2.1", "", { "peerDependencies": { "@opentelemetry/api": ">=1.10.0 <1.11.0" } }, "sha512-tsbI75Wk2DupoQ3JVDoW3e8CZV03ldbqTg5xPFOnH5LmC/yoQyhSy5gYLEibEombLoKmnRX3H4uiqbQ7lnOPJw=="], - - "@opentelemetry/browser-sdk": ["@opentelemetry/browser-sdk@0.9.1", "", { "dependencies": { "@opentelemetry/browser-api": "^0.2.1", "@opentelemetry/core": "^3.1.1", "@opentelemetry/exporter-logs-otlp-http": "^0.301.2", "@opentelemetry/exporter-trace-otlp-http": "^0.301.2", "@opentelemetry/resources": "^3.1.1", "@opentelemetry/sdk-logs": "^3.1.1", "@opentelemetry/sdk-trace": "^3.1.1", "@opentelemetry/semantic-conventions": "^1.45.0" }, "peerDependencies": { "@opentelemetry/api": ">=1.10.0 <1.11.0" } }, "sha512-8w2h17s2sRMeVpX8GRX7bb7ZH1VB4M2nEeFmBPn7JAMdbetWKE5bg6GjimkTAReBKRQIfxJkMX38j81aAjVXlQ=="], - "@opentelemetry/core": ["@opentelemetry/core@3.1.1", "", { "dependencies": { "@opentelemetry/semantic-conventions": "^1.29.0" }, "peerDependencies": { "@opentelemetry/api": ">=1.10.0 <1.11.0" } }, "sha512-6wc9r0zrTsAVOd/5UrZBsrHhXWNfwisolgWxd8o3Eu1HKIz8cAxQjOdGrrJB406ceFiGV+ckTcLdXzB+y/QVTA=="], - "@opentelemetry/exporter-logs-otlp-http": ["@opentelemetry/exporter-logs-otlp-http@0.301.2", "", { "dependencies": { "@opentelemetry/otlp-exporter-base": "0.301.2", "@opentelemetry/otlp-transformer": "0.301.2", "@opentelemetry/sdk-logs": "3.1.1" }, "peerDependencies": { "@opentelemetry/api": "^1.10.0" } }, "sha512-l3K1Fp2qaxAS8wKPyjVm7/QfnvJXZZfPuGXa+AYzNeoOk6qxcZwWZhLe9SYemWxDrtPTl3Mj82diLgVzbz54Hw=="], - - "@opentelemetry/exporter-trace-otlp-http": ["@opentelemetry/exporter-trace-otlp-http@0.301.2", "", { "dependencies": { "@opentelemetry/otlp-exporter-base": "0.301.2", "@opentelemetry/otlp-transformer": "0.301.2", "@opentelemetry/sdk-trace": "3.1.1" }, "peerDependencies": { "@opentelemetry/api": "^1.10.0" } }, "sha512-mGyy0Jv/jgEnVdLME6SyxzPJgZml2vIZAJTF1/SKoM8baqDFsQSeFQ15vjo3qDxTOnbf04t2Y62oofsUy0ETDw=="], - "@opentelemetry/exporter-trace-otlp-proto": ["@opentelemetry/exporter-trace-otlp-proto@0.301.2", "", { "dependencies": { "@opentelemetry/otlp-exporter-base": "0.301.2", "@opentelemetry/otlp-transformer": "0.301.2", "@opentelemetry/sdk-trace": "3.1.1" }, "peerDependencies": { "@opentelemetry/api": "^1.10.0" } }, "sha512-3MOk/LZJI/5D5Wq6F1B0+TclRwyLZI4hoqOnAl4PcPBfbaBZND5IplOD4tWLV4QtwobYeCyZwP9DpeKBLPWviw=="], "@opentelemetry/otlp-exporter-base": ["@opentelemetry/otlp-exporter-base@0.301.2", "", { "dependencies": { "@opentelemetry/core": "3.1.1", "@opentelemetry/otlp-transformer": "0.301.2" }, "peerDependencies": { "@opentelemetry/api": "^1.10.0" } }, "sha512-XlC8Mqeqk5vY9/jXU2No4tAPDO4g7d3QqgxznctJrM1wzF/xKUiBvQwlQguGL98nEBweq2NCkXMGj4QIGSpplg=="], diff --git a/docs/superpowers/specs/2026-11-10-rn-otel-design.md b/docs/superpowers/specs/2026-11-10-rn-otel-design.md index c93a727..439c441 100644 --- a/docs/superpowers/specs/2026-11-10-rn-otel-design.md +++ b/docs/superpowers/specs/2026-11-10-rn-otel-design.md @@ -101,8 +101,8 @@ flowchart TB subgraph web["Web"] direction TB - jsw["JS: startBrowserSdk (upstream browser-sdk)
+ same ContextManager"] - wexp["OTLP/HTTP fetch exporter (upstream)"] + jsw["JS: sdk-trace TracerProvider (7)
+ same ContextManager"] + wexp["OTLP/HTTP proto fetch exporter (upstream)"] jsw --> wexp end @@ -114,7 +114,7 @@ flowchart TB | Ours vs upstream | | |---|---| -| upstream, reused as-is | `@opentelemetry/api`, `sdk-trace`, browser-sdk, otel-java, opentelemetry-swift, exporters | +| upstream, reused as-is | `@opentelemetry/api`, `sdk-trace`, otel-java, opentelemetry-swift, exporters | | ours | ContextManager patch, hand-off processor, Nitro adapters, pure native core, bundler helpers | ### 4.1 Where spans live (decided: "option C") @@ -515,9 +515,15 @@ ships TC39 AsyncContext (Stage 2). ## 7. Web (decided) Same `@opentelemetry/api` surface and the same ContextManager; spans live in the JS SDK and -export directly via upstream `@opentelemetry/browser-sdk` (`startBrowserSdk`) and its OTLP -fetch exporter. Builder to check whether `browser-sdk` installs its own context manager and -make ours win. +export directly from JS. **Changed in v0 implementation (R7, pending author review):** web +builds its own `sdk-trace` `TracerProvider` + `BatchSpanProcessor` + upstream +`@opentelemetry/exporter-trace-otlp-proto` (fetch), not `startBrowserSdk`. Why: +browser-sdk 0.9.1 takes no `idGenerator` (no `0a` test-mode IDs, so no exact web goldens), +adds `telemetry.sdk.*` to the resource (against 4.3), also starts a Logs SDK, exports JSON +(loses NaN), and returns no `tracerProvider`/`forceFlush` for our handle. The resource is +`service.*` + `resourceAttributes` + `telemetry.distro.*` (outside test mode). `start` +re-registers our context manager if another one took the global slot. The package's +`exports` `browser` condition points web bundlers (Vite, Metro web) at `index.web.js`. Browsers run `await` natively, which bypasses the patched `then`. **Decided:** web apps compile `async` down in their bundler — the same mechanism RN uses by default, and what diff --git a/package.json b/package.json index 2b0bba7..b8f5b46 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,10 @@ "module": "./lib/module/index.js", "exports": { ".": { + "browser": { + "types": "./lib/typescript/src/index.web.d.ts", + "default": "./lib/module/index.web.js" + }, "types": "./lib/typescript/src/index.d.ts", "default": "./lib/module/index.js" }, @@ -78,12 +82,11 @@ "@opentelemetry/core": "~3.1.1", "@opentelemetry/resources": "~3.1.1", "@opentelemetry/semantic-conventions": "^1.45.0", - "@opentelemetry/browser-sdk": "0.9.1" + "@opentelemetry/exporter-trace-otlp-proto": "0.301.2" }, "devDependencies": { "@changesets/cli": "^2.28.1", "@e2e-dev/mobile": "0.12.8", - "@opentelemetry/exporter-trace-otlp-proto": "~0.301.2", "@react-native/babel-preset": "^0.88.1", "@types/jest": "^30.0.0", "@types/node": "^24.0.0", diff --git a/src/index.web.ts b/src/index.web.ts new file mode 100644 index 0000000..eb40174 --- /dev/null +++ b/src/index.web.ts @@ -0,0 +1,5 @@ +// Side effect: registers the context manager and patch before the app runs. +import './setup'; + +export {startReactNativeSdk} from './sdk/start.web'; +export type {SdkConfig, SdkHandle} from './sdk/config'; diff --git a/src/sdk/__tests__/start.web.test.ts b/src/sdk/__tests__/start.web.test.ts new file mode 100644 index 0000000..87eacc2 --- /dev/null +++ b/src/sdk/__tests__/start.web.test.ts @@ -0,0 +1,111 @@ +/** + * @jest-environment jsdom + */ +import {context, ROOT_CONTEXT, trace, type ProxyTracerProvider} from '@opentelemetry/api'; +import {InMemorySpanExporter, SimpleSpanProcessor, StackContextManager} from '@opentelemetry/sdk-trace'; +import {MARKER} from '../../context/patch'; +import {contextManager} from '../../setup'; +import {DISTRO_VERSION} from '../config'; +import {startReactNativeSdk} from '../start.web'; + +const CONFIG = {serviceName: 'shop', exportConfig: {url: 'https://c.example.com:4318', headers: {'x-api-key': 'k'}}}; + +// jsdom lacks TextEncoder (every browser has it); the proto serializer needs it. +(globalThis as any).TextEncoder ??= require('util').TextEncoder; + +// Jest 30 always adds the `node` condition to require(); load the exporter's browser (fetch) build as a web bundler would. +jest.mock('@opentelemetry/exporter-trace-otlp-proto', () => + jest.requireActual(require.resolve('@opentelemetry/exporter-trace-otlp-proto').replace(/index\.cjs$/, 'platform/browser/index.cjs')), +); + +let err: jest.SpyInstance; +let warn: jest.SpyInstance; +let fetchMock: jest.Mock; +beforeEach(() => { + const marker = (globalThis as any)[MARKER]; + delete marker.handle; + delete marker.warned; + trace.disable(); + delete process.env.OTEL_TEST_MODE; + fetchMock = jest.fn(async () => ({ok: true, status: 200, headers: {get: () => null}, text: async () => ''})); + (globalThis as any).fetch = fetchMock; + err = jest.spyOn(console, 'error').mockImplementation(() => {}); + warn = jest.spyOn(console, 'warn').mockImplementation(() => {}); +}); +afterEach(() => jest.restoreAllMocks()); + +const isNoop = (h: ReturnType) => + !h.tracerProvider.getTracer('t').startSpan('s').isRecording(); + +test('our context manager is the global one after start', () => { + context.disable(); + context.setGlobalContextManager(new StackContextManager().enable()); // a foreign one got there first + startReactNativeSdk(CONFIG); + const ctx = ROOT_CONTEXT.setValue(Symbol('k'), 1); + expect(context.with(ctx, () => contextManager.active())).toBe(ctx); + expect(err).not.toHaveBeenCalled(); +}); + +test.each(['https://c.example.com:4318', 'https://c.example.com:4318/', 'https://c.example.com:4318/v1/traces'])( + 'url %s exports to one /v1/traces with the headers', + async url => { + const h = startReactNativeSdk({...CONFIG, exportConfig: {...CONFIG.exportConfig, url}}); + h.tracerProvider.getTracer('t').startSpan('s').end(); + await h.forceFlush(); + expect(fetchMock).toHaveBeenCalledTimes(1); + const [sent, init] = fetchMock.mock.calls[0]; + expect(sent).toBe('https://c.example.com:4318/v1/traces'); + expect(init.headers).toMatchObject({'x-api-key': 'k', 'Content-Type': 'application/x-protobuf'}); + await h.shutdown(); + }, +); + +test('missing exportConfig returns a no-op handle', () => { + const h = startReactNativeSdk({serviceName: 'shop'}); + expect(isNoop(h)).toBe(true); + expect(err).toHaveBeenCalledTimes(1); + expect(startReactNativeSdk({serviceName: 'shop'})).toBe(h); + expect(err).toHaveBeenCalledTimes(1); +}); + +test('second call returns the first handle with one warning', () => { + const h = startReactNativeSdk(CONFIG); + expect(startReactNativeSdk(CONFIG)).toBe(h); + expect(startReactNativeSdk(CONFIG)).toBe(h); + expect(warn).toHaveBeenCalledTimes(1); +}); + +test('resource, user processors and the global provider', () => { + const exporter = new InMemorySpanExporter(); + const h = startReactNativeSdk({ + ...CONFIG, + serviceVersion: '1.2.3', + resourceAttributes: {'deployment.environment.name': 'prod'}, + spanProcessors: [new SimpleSpanProcessor({exporter})], + }); + expect((trace.getTracerProvider() as ProxyTracerProvider).getDelegate()).toBe(h.tracerProvider); + trace.getTracer('t').startSpan('s').end(); + const span = exporter.getFinishedSpans()[0]!; + expect(span.resource.attributes).toEqual({ + 'deployment.environment.name': 'prod', + 'service.name': 'shop', + 'service.version': '1.2.3', + 'telemetry.distro.name': 'react-native-open-telemetry', + 'telemetry.distro.version': DISTRO_VERSION, + }); +}); + +test('test mode: 0a ids and no distro attributes', () => { + process.env.OTEL_TEST_MODE = '1'; + const exporter = new InMemorySpanExporter(); + const h = startReactNativeSdk({...CONFIG, spanProcessors: [new SimpleSpanProcessor({exporter})]}); + h.tracerProvider.getTracer('t').startSpan('s').end(); + const span = exporter.getFinishedSpans()[0]!; + expect(span.spanContext().traceId).toBe('0a' + '1'.padStart(30, '0')); + expect(span.spanContext().spanId).toBe('0a' + '1'.padStart(14, '0')); + expect(span.resource.attributes).toEqual({'service.name': 'shop'}); +}); + +test('DISTRO_VERSION matches package.json', () => { + expect(DISTRO_VERSION).toBe(require('../../../package.json').version); +}); diff --git a/src/sdk/config.ts b/src/sdk/config.ts index a398d3c..da8a278 100644 --- a/src/sdk/config.ts +++ b/src/sdk/config.ts @@ -21,3 +21,6 @@ export function tracesUrl(url: string): string { const base = url.replace(/\/+$/, ''); return base.endsWith('/v1/traces') ? base : base + '/v1/traces'; } + +/** `telemetry.distro.version` on web; a unit test keeps it equal to package.json's version. */ +export const DISTRO_VERSION = '0.2.0'; diff --git a/src/sdk/shared.ts b/src/sdk/shared.ts new file mode 100644 index 0000000..cddf909 --- /dev/null +++ b/src/sdk/shared.ts @@ -0,0 +1,44 @@ +import {trace} from '@opentelemetry/api'; +import type {TracerProvider} from '@opentelemetry/sdk-trace'; +import {MARKER, type PatchMarker} from '../context/patch'; +import {probeAsyncContext} from '../context/probe'; +import {stampScope} from '../context/scope'; +import type {SdkConfig, SdkHandle} from './config'; +import {noopHandle} from './noop'; + +export const TAG = '[react-native-open-telemetry]'; + +/** Stamps every tracer (C3), makes `provider` the global one, starts the probe; returns the handle. */ +export function register(provider: TracerProvider): SdkHandle { + const getTracer = provider.getTracer.bind(provider); + provider.getTracer = (name, version, options) => stampScope(getTracer(name, version, options)); + if (!trace.setGlobalTracerProvider(provider)) { + console.error(`${TAG} another tracer provider is already registered; trace.getTracer() will not reach this SDK.`); + } + probeAsyncContext().catch(() => {}); + return { + tracerProvider: provider, + forceFlush: () => provider.forceFlush(), + shutdown: () => provider.shutdown(), + }; +} + +// On the marker (globalThis), so a fast-refresh re-evaluation of this module still finds the first handle. +type Marker = PatchMarker & {handle?: SdkHandle; warned?: boolean}; + +/** D10: the first call's handle wins; later calls get it back with one warning. Never throws. */ +export function startOnce(start: (config?: SdkConfig) => SdkHandle, config?: SdkConfig): SdkHandle { + const m: Marker = (globalThis as any)[MARKER]; + if (m.handle) { + if (!m.warned) console.warn(`${TAG} startReactNativeSdk was already called; returning the first handle.`); + m.warned = true; + return m.handle; + } + try { + m.handle = start(config); + } catch (e) { + console.error(`${TAG} start failed; telemetry is off.`, e); + m.handle = noopHandle(); + } + return m.handle; +} diff --git a/src/sdk/start.ts b/src/sdk/start.ts index 56ff052..7ea4034 100644 --- a/src/sdk/start.ts +++ b/src/sdk/start.ts @@ -1,10 +1,6 @@ -import {trace} from '@opentelemetry/api'; import {emptyResource} from '@opentelemetry/resources'; import {TracerProvider} from '@opentelemetry/sdk-trace'; import '../setup'; -import {MARKER, type PatchMarker} from '../context/patch'; -import {probeAsyncContext} from '../context/probe'; -import {stampScope} from '../context/scope'; import {NativeHandOffProcessor} from '../handoff/NativeHandOffProcessor'; import {attrs} from '../handoff/toSeamSpan'; import {sequentialIds} from '../internal/testMode'; @@ -12,8 +8,7 @@ import type {SeamConfig} from '../native/Otel.nitro'; import {getOtel} from '../native/otel'; import type {SdkConfig, SdkHandle} from './config'; import {noopHandle} from './noop'; - -const TAG = '[react-native-open-telemetry]'; +import {register, startOnce, TAG} from './shared'; /** Undefined unless there is enough to initialize native; native then reports the missing config. */ function toSeamConfig(c: SdkConfig): SeamConfig | undefined { @@ -54,35 +49,8 @@ function start(config: SdkConfig | undefined): SdkHandle { ...(result.testMode ? {idGenerator: sequentialIds('0a')} : {}), spanProcessors: [...(config?.spanProcessors ?? []), new NativeHandOffProcessor(native)], }); - const getTracer = provider.getTracer.bind(provider); - provider.getTracer = (name, version, options) => stampScope(getTracer(name, version, options)); - if (!trace.setGlobalTracerProvider(provider)) { - console.error('[react-native-open-telemetry] another tracer provider is already registered; trace.getTracer() will not reach this SDK.'); - } - probeAsyncContext().catch(() => {}); - return { - tracerProvider: provider, - forceFlush: () => provider.forceFlush(), - shutdown: () => provider.shutdown(), - }; + return register(provider); } -// On the marker (globalThis), so a fast-refresh re-evaluation of this module still finds the first handle. -type Marker = PatchMarker & {handle?: SdkHandle; warned?: boolean}; - /** Attaches to native, or initializes it from `config` (§4.4). Never throws: failures give one error and a no-op handle. */ -export function startReactNativeSdk(config?: SdkConfig): SdkHandle { - const m: Marker = (globalThis as any)[MARKER]; - if (m.handle) { - if (!m.warned) console.warn(`${TAG} startReactNativeSdk was already called; returning the first handle.`); - m.warned = true; - return m.handle; - } - try { - m.handle = start(config); - } catch (e) { - console.error(`${TAG} start failed; telemetry is off.`, e); - m.handle = noopHandle(); - } - return m.handle; -} +export const startReactNativeSdk = (config?: SdkConfig): SdkHandle => startOnce(start, config); diff --git a/src/sdk/start.web.ts b/src/sdk/start.web.ts new file mode 100644 index 0000000..3a50e6c --- /dev/null +++ b/src/sdk/start.web.ts @@ -0,0 +1,41 @@ +import {context} from '@opentelemetry/api'; +import {OTLPTraceExporter} from '@opentelemetry/exporter-trace-otlp-proto'; +import {resourceFromAttributes} from '@opentelemetry/resources'; +import {BatchSpanProcessor, TracerProvider} from '@opentelemetry/sdk-trace'; +import {contextManager} from '../setup'; +import {isTestModeBuild, sequentialIds} from '../internal/testMode'; +import {DISTRO_VERSION, tracesUrl, type SdkConfig, type SdkHandle} from './config'; +import {noopHandle} from './noop'; +import {register, startOnce, TAG} from './shared'; + +function start(config: SdkConfig | undefined): SdkHandle { + if (!config?.serviceName || !config.exportConfig?.url) { + console.error(`${TAG} serviceName and exportConfig.url are required on web; telemetry is off.`); + return noopHandle(); + } + // setup.ts registers ours, but anything registered before it wins the API slot; take it back (§7). + if (!context.setGlobalContextManager(contextManager) && (context as any)._getContextManager() !== contextManager) { + context.disable(); + context.setGlobalContextManager(contextManager); + } + const testMode = isTestModeBuild(); + const {serviceName, serviceVersion, resourceAttributes, exportConfig, spanProcessors = []} = config; + // JS owns the resource on web: no telemetry.sdk.* (§4.3), distro only outside test mode (goldens). + const resource = resourceFromAttributes({ + ...resourceAttributes, + 'service.name': serviceName, + ...(serviceVersion ? {'service.version': serviceVersion} : {}), + ...(testMode ? {} : {'telemetry.distro.name': 'react-native-open-telemetry', 'telemetry.distro.version': DISTRO_VERSION}), + }); + const exporter = new OTLPTraceExporter({url: tracesUrl(exportConfig.url), headers: exportConfig.headers}); + return register( + new TracerProvider({ + resource, + ...(testMode ? {idGenerator: sequentialIds('0a')} : {}), + spanProcessors: [...spanProcessors, new BatchSpanProcessor({exporter})], + }), + ); +} + +/** Web: spans export straight from JS over OTLP/proto (§7, R7). Never throws: failures give one error and a no-op handle. */ +export const startReactNativeSdk = (config?: SdkConfig): SdkHandle => startOnce(start, config); From 7dbaa48b41af19df53d5dcb74c7d081df6426152 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:57:27 +0100 Subject: [PATCH 31/76] refactor(web): drop the context-manager takeover; setup registers ours, as on mobile Co-Authored-By: Claude Opus 5.5 --- src/sdk/__tests__/start.web.test.ts | 4 +--- src/sdk/start.web.ts | 8 +------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/sdk/__tests__/start.web.test.ts b/src/sdk/__tests__/start.web.test.ts index 87eacc2..667fe63 100644 --- a/src/sdk/__tests__/start.web.test.ts +++ b/src/sdk/__tests__/start.web.test.ts @@ -2,7 +2,7 @@ * @jest-environment jsdom */ import {context, ROOT_CONTEXT, trace, type ProxyTracerProvider} from '@opentelemetry/api'; -import {InMemorySpanExporter, SimpleSpanProcessor, StackContextManager} from '@opentelemetry/sdk-trace'; +import {InMemorySpanExporter, SimpleSpanProcessor} from '@opentelemetry/sdk-trace'; import {MARKER} from '../../context/patch'; import {contextManager} from '../../setup'; import {DISTRO_VERSION} from '../config'; @@ -38,8 +38,6 @@ const isNoop = (h: ReturnType) => !h.tracerProvider.getTracer('t').startSpan('s').isRecording(); test('our context manager is the global one after start', () => { - context.disable(); - context.setGlobalContextManager(new StackContextManager().enable()); // a foreign one got there first startReactNativeSdk(CONFIG); const ctx = ROOT_CONTEXT.setValue(Symbol('k'), 1); expect(context.with(ctx, () => contextManager.active())).toBe(ctx); diff --git a/src/sdk/start.web.ts b/src/sdk/start.web.ts index 3a50e6c..230640b 100644 --- a/src/sdk/start.web.ts +++ b/src/sdk/start.web.ts @@ -1,8 +1,7 @@ -import {context} from '@opentelemetry/api'; +import '../setup'; import {OTLPTraceExporter} from '@opentelemetry/exporter-trace-otlp-proto'; import {resourceFromAttributes} from '@opentelemetry/resources'; import {BatchSpanProcessor, TracerProvider} from '@opentelemetry/sdk-trace'; -import {contextManager} from '../setup'; import {isTestModeBuild, sequentialIds} from '../internal/testMode'; import {DISTRO_VERSION, tracesUrl, type SdkConfig, type SdkHandle} from './config'; import {noopHandle} from './noop'; @@ -13,11 +12,6 @@ function start(config: SdkConfig | undefined): SdkHandle { console.error(`${TAG} serviceName and exportConfig.url are required on web; telemetry is off.`); return noopHandle(); } - // setup.ts registers ours, but anything registered before it wins the API slot; take it back (§7). - if (!context.setGlobalContextManager(contextManager) && (context as any)._getContextManager() !== contextManager) { - context.disable(); - context.setGlobalContextManager(contextManager); - } const testMode = isTestModeBuild(); const {serviceName, serviceVersion, resourceAttributes, exportConfig, spanProcessors = []} = config; // JS owns the resource on web: no telemetry.sdk.* (§4.3), distro only outside test mode (goldens). From fbd8a0ba49c718d9d5a936afb0c811a45b5bc4ac Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:58:16 +0100 Subject: [PATCH 32/76] chore(deps): add vite 7.3.8 devDependency Co-Authored-By: Claude Opus 5.5 --- bun.lock | 145 +++++++++++++++++++++++++++++++++++++++++++++++---- package.json | 3 +- 2 files changed, 136 insertions(+), 12 deletions(-) diff --git a/bun.lock b/bun.lock index 4292aa7..29127a9 100644 --- a/bun.lock +++ b/bun.lock @@ -27,6 +27,7 @@ "react-native-builder-bob": "^0.40.6", "react-native-nitro-modules": "~0.37.0", "typescript": "^5.8.3", + "vite": "7.3.8", }, "peerDependencies": { "react-native": ">=0.79", @@ -350,6 +351,58 @@ "@e2e-dev/mobile": ["@e2e-dev/mobile@0.12.8", "", { "dependencies": { "@napi-rs/image": "1.16.0", "agent-device": "0.21.39", "zod": "4.6.7" }, "peerDependencies": { "@e2e-dev/core": ">=0.23.2 <1", "ai": "^7.0.0", "e2e": ">=0.23.2 <1" }, "optionalPeers": ["ai", "e2e"] }, "sha512-N9BuoUC0a+7pG1NbhTfL0janxqNf7blm+6TW/EQZ4IlURbYIZQFmSRK+2HEnH+FzrobqXBBI/egHYW9LIRfGsg=="], + "@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.28.2", "", { "os": "aix", "cpu": "ppc64" }, "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ=="], + + "@esbuild/android-arm": ["@esbuild/android-arm@0.28.2", "", { "os": "android", "cpu": "arm" }, "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg=="], + + "@esbuild/android-arm64": ["@esbuild/android-arm64@0.28.2", "", { "os": "android", "cpu": "arm64" }, "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A=="], + + "@esbuild/android-x64": ["@esbuild/android-x64@0.28.2", "", { "os": "android", "cpu": "x64" }, "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q=="], + + "@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.28.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw=="], + + "@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.28.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw=="], + + "@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.28.2", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw=="], + + "@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.28.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg=="], + + "@esbuild/linux-arm": ["@esbuild/linux-arm@0.28.2", "", { "os": "linux", "cpu": "arm" }, "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w=="], + + "@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.28.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug=="], + + "@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.28.2", "", { "os": "linux", "cpu": "ia32" }, "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ=="], + + "@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.28.2", "", { "os": "linux", "cpu": "none" }, "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ=="], + + "@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.28.2", "", { "os": "linux", "cpu": "none" }, "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA=="], + + "@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.28.2", "", { "os": "linux", "cpu": "ppc64" }, "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ=="], + + "@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.28.2", "", { "os": "linux", "cpu": "none" }, "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA=="], + + "@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.28.2", "", { "os": "linux", "cpu": "s390x" }, "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg=="], + + "@esbuild/linux-x64": ["@esbuild/linux-x64@0.28.2", "", { "os": "linux", "cpu": "x64" }, "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ=="], + + "@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.28.2", "", { "os": "none", "cpu": "arm64" }, "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw=="], + + "@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.28.2", "", { "os": "none", "cpu": "x64" }, "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw=="], + + "@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.28.2", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ=="], + + "@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.28.2", "", { "os": "openbsd", "cpu": "x64" }, "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw=="], + + "@esbuild/openharmony-arm64": ["@esbuild/openharmony-arm64@0.28.2", "", { "os": "none", "cpu": "arm64" }, "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q=="], + + "@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.28.2", "", { "os": "sunos", "cpu": "x64" }, "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g=="], + + "@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.28.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ=="], + + "@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.28.2", "", { "os": "win32", "cpu": "ia32" }, "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA=="], + + "@esbuild/win32-x64": ["@esbuild/win32-x64@0.28.2", "", { "os": "win32", "cpu": "x64" }, "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g=="], + "@hapi/hoek": ["@hapi/hoek@9.3.0", "", {}, "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ=="], "@hapi/topo": ["@hapi/topo@5.1.0", "", { "dependencies": { "@hapi/hoek": "^9.0.0" } }, "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg=="], @@ -678,6 +731,58 @@ "@react-native/virtualized-lists": ["@react-native/virtualized-lists@0.78.1", "", { "dependencies": { "invariant": "^2.2.4", "nullthrows": "^1.1.1" }, "peerDependencies": { "@types/react": "^19.0.0", "react": "*", "react-native": "*" }, "optionalPeers": ["@types/react"] }, "sha512-v0jqDNMFXpnRnSlkDVvwNxXgPhifzzTFlxTSnHj9erKJsKpE26gSU5qB4hmJkEsscLG/ygdJ1c88aqinSh/wRA=="], + "@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.68.8", "", { "os": "android", "cpu": "arm" }, "sha512-7l9FdeCGjhmMTVePgndK4t9u5tLR+VuTTMoyc0PscqZDdYjS07ZsQ0vQYsWsODu/ZZYPG7WVJwbUZ77n1hVT+w=="], + + "@rollup/rollup-android-arm64": ["@rollup/rollup-android-arm64@4.68.8", "", { "os": "android", "cpu": "arm64" }, "sha512-kXkkIiJujBjArHwEToz99BQqIqibn4xdV6SjsoaxuZzvLUCVEzoHQ1Lp62m7xOhpLRpWpCtxL2ZUy/ADKuz9/g=="], + + "@rollup/rollup-android-x64": ["@rollup/rollup-android-x64@4.68.8", "", { "os": "android", "cpu": "x64" }, "sha512-KYoBygnHs3zUOLR0z7SaqhMnUrSF9pbuTOJT/uHK3PrgCXdv/xaMubZD8jCpg6NTo46deasLgZRq38xFTyu8uw=="], + + "@rollup/rollup-darwin-arm64": ["@rollup/rollup-darwin-arm64@4.68.8", "", { "os": "darwin", "cpu": "arm64" }, "sha512-YmBUNjgm5bsjOByO+H1TFbuGZe+ZnHcYtPXYj9+L1cwTu/BG8zjuUzO2PH9KwS85P0UH+WJDSb+mQ2hqjp5uBQ=="], + + "@rollup/rollup-darwin-x64": ["@rollup/rollup-darwin-x64@4.68.8", "", { "os": "darwin", "cpu": "x64" }, "sha512-XMX5ybuOmkwiM13KJtsBxakZ69pyaR9thRYU2fMejhaB0VuzLMIkIc+9TBsu2rv34eEf6XaSMOaLOyEgHGWHTQ=="], + + "@rollup/rollup-freebsd-arm64": ["@rollup/rollup-freebsd-arm64@4.68.8", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-WuBXScWJDaqPJKwVrotUe1sM9DHWMN937C23RClt0MVHVt7A1rBy285ZfZTLccPEVMxmGJMt2jvdHMOI33lrKA=="], + + "@rollup/rollup-freebsd-x64": ["@rollup/rollup-freebsd-x64@4.68.8", "", { "os": "freebsd", "cpu": "x64" }, "sha512-kegwGqP3rMenEMaKo8OzMBb5WvLW2h2jrQ3iKuYptTTF8C/yuxz+hinjBPrtYuIPLJDwxHc/hv2e4u5pmrqo9A=="], + + "@rollup/rollup-linux-arm-gnueabihf": ["@rollup/rollup-linux-arm-gnueabihf@4.68.8", "", { "os": "linux", "cpu": "arm" }, "sha512-Qct0oLM1zGNbvqs1udQnuchg+Q9uHbkMcQqCfs3M7foNn7HvEkUypfFn9o5fklimUI5OF3A2nMknd4/vrEyeVg=="], + + "@rollup/rollup-linux-arm-musleabihf": ["@rollup/rollup-linux-arm-musleabihf@4.68.8", "", { "os": "linux", "cpu": "arm" }, "sha512-xTH5vD+lW/5MU3kL/Op8RSSG/O9fxUQZuJcSBmmBeYem9uXYvCq6PDHx/oDSNeyLD/p4pGujG2PVI0R8MjAhSw=="], + + "@rollup/rollup-linux-arm64-gnu": ["@rollup/rollup-linux-arm64-gnu@4.68.8", "", { "os": "linux", "cpu": "arm64" }, "sha512-lPPStmynSHvwWpSrAsuemPFB+EWFObXjwz44EK4Hph47U6SBAk1Kehq5MkI7i8EYVjrXddaAV7YkJH8mX8QSZQ=="], + + "@rollup/rollup-linux-arm64-musl": ["@rollup/rollup-linux-arm64-musl@4.68.8", "", { "os": "linux", "cpu": "arm64" }, "sha512-kZkvIYAihM6l6M+giSUHayDDf/JL+TYR5bYWiAX7/jUFWvMkMmysA4GV2F0HOsXQNEyctW3x1xLjww1GqW7Q1w=="], + + "@rollup/rollup-linux-loong64-gnu": ["@rollup/rollup-linux-loong64-gnu@4.68.8", "", { "os": "linux", "cpu": "none" }, "sha512-XZKLEIY977OJr6zUtK6nlQcLXme34c8HqVp3+WmKQxKVN6Nj+b9qE3ZHWIDHXznHJsGl2AsaMOgB0GL0fkZGUg=="], + + "@rollup/rollup-linux-loong64-musl": ["@rollup/rollup-linux-loong64-musl@4.68.8", "", { "os": "linux", "cpu": "none" }, "sha512-+sN+Fj6F9suk8SkL6boIfXDmj9iJwSKPCTeCy8/pfTOHuzNX+duhTb9uyj6154oVK8Odl5zgL4DXRZzXjsRKcw=="], + + "@rollup/rollup-linux-ppc64-gnu": ["@rollup/rollup-linux-ppc64-gnu@4.68.8", "", { "os": "linux", "cpu": "ppc64" }, "sha512-EBCu3uDFaGwSodUl+XR8yubvVFUkSo6QK9YAIOV1vljqntzTF2/mXLM6utgLaSGf/8oM+qEe8Ai0Jd4+tyMoIQ=="], + + "@rollup/rollup-linux-ppc64-musl": ["@rollup/rollup-linux-ppc64-musl@4.68.8", "", { "os": "linux", "cpu": "ppc64" }, "sha512-hRC0jWdsLBckCijx2wiUfk7zW1SqEW47yMsCNoDGmQfoqq0AjW+9UYZqxg3LTmG76PyHNdNGBSuspB3CqrhGIA=="], + + "@rollup/rollup-linux-riscv64-gnu": ["@rollup/rollup-linux-riscv64-gnu@4.68.8", "", { "os": "linux", "cpu": "none" }, "sha512-OZKrTRWyGnLITUTipbeXDdtb2dxQPyFk/Fbw9qER8pIvd2Ja9hHELkY0Fv5p9yYYkimqtzVhApKKXGv0cWGQGw=="], + + "@rollup/rollup-linux-riscv64-musl": ["@rollup/rollup-linux-riscv64-musl@4.68.8", "", { "os": "linux", "cpu": "none" }, "sha512-HmhSRSQ+dOeOntPfmYux4rCpOQLtsGbcGLQu4nm8ig3tuVqe/bKfDHorg36LKAqYq4X/nwFr79ImtaFHHsn4ug=="], + + "@rollup/rollup-linux-s390x-gnu": ["@rollup/rollup-linux-s390x-gnu@4.68.8", "", { "os": "linux", "cpu": "s390x" }, "sha512-wk1Ci1hsMREaBELoKPSnzRAh1oUULI+8kfb2F5vVmTD2IcfR9AKMskCusizZhIAvojOtPZihPj4OdKy6ifZwhQ=="], + + "@rollup/rollup-linux-x64-gnu": ["@rollup/rollup-linux-x64-gnu@4.68.8", "", { "os": "linux", "cpu": "x64" }, "sha512-mDufoUJ6fnKZnCyjV3sGEDvXQQkM6j1UmINHheGX4Emau3TZWJzX3sCVmbzkNB+W2G84BiFQdDCcF09lv0i0VA=="], + + "@rollup/rollup-linux-x64-musl": ["@rollup/rollup-linux-x64-musl@4.68.8", "", { "os": "linux", "cpu": "x64" }, "sha512-7EGVL9rYRYQZe3UC8JQzfBN9rxk484Rfs4u/yGWumTYKUdJt6tmdP+0Y3qHvAvzJCQ+JQM5rSqZbVyrJARlGpA=="], + + "@rollup/rollup-openbsd-x64": ["@rollup/rollup-openbsd-x64@4.68.8", "", { "os": "openbsd", "cpu": "x64" }, "sha512-Umklz+QSGwKWQVlVrsMJrwFx1oNRYHgrxSGiZM8pJCMpzWnMDMinDhPILf0BvRXfA1QOArsDcs+AE7Jd6dQxvA=="], + + "@rollup/rollup-openharmony-arm64": ["@rollup/rollup-openharmony-arm64@4.68.8", "", { "os": "none", "cpu": "arm64" }, "sha512-BlRp6uzQDK5rczAdaXQ8dlSIRFRlkDRBqpb8GGtv8iwZxQdOjoigdFU5t5dcxpnpU0caMoT9mH27MyAl4dWwKw=="], + + "@rollup/rollup-win32-arm64-msvc": ["@rollup/rollup-win32-arm64-msvc@4.68.8", "", { "os": "win32", "cpu": "arm64" }, "sha512-Sc8Mkf/fVfcV0hBJNDRIM82BjS4kJn2Of0jP8dgQ+TodquxtCZ/5D6FgSsY3uN5IBmNi8Zrb/OHd60IEYKaw+Q=="], + + "@rollup/rollup-win32-ia32-msvc": ["@rollup/rollup-win32-ia32-msvc@4.68.8", "", { "os": "win32", "cpu": "ia32" }, "sha512-XPTFXclN+I+Cfu3ONWDsw+uvgSZjTJa1B2u2EvtdKlSdgNU6mrOZdgeaMkvN+2T2KPTEXn6fnRY8IODlRg3/Tg=="], + + "@rollup/rollup-win32-x64-gnu": ["@rollup/rollup-win32-x64-gnu@4.68.8", "", { "os": "win32", "cpu": "x64" }, "sha512-63dWiHgvpWcienfdr465lT3SIn4u3535vbDfaLKhSn0F2KJ06bbcUsewDGJZUPZCbJ67qESrPDhb85UnWdb5ew=="], + + "@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.68.8", "", { "os": "win32", "cpu": "x64" }, "sha512-/W1LBsMeQAdiCuH3Z2gkRspl3mlxL+butknhq4vXjmxO45vuT08BqhehxDoE4YS+m6s9lhpq6M9/PjTEAg8PYw=="], + "@sideway/address": ["@sideway/address@4.1.5", "", { "dependencies": { "@hapi/hoek": "^9.0.0" } }, "sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q=="], "@sideway/formula": ["@sideway/formula@3.0.1", "", {}, "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg=="], @@ -706,6 +811,8 @@ "@types/deep-eql": ["@types/deep-eql@4.0.2", "", {}, "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw=="], + "@types/estree": ["@types/estree@1.0.10", "", {}, "sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g=="], + "@types/graceful-fs": ["@types/graceful-fs@4.1.9", "", { "dependencies": { "@types/node": "*" } }, "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ=="], "@types/istanbul-lib-coverage": ["@types/istanbul-lib-coverage@2.0.6", "", {}, "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w=="], @@ -1014,6 +1121,8 @@ "es-module-lexer": ["es-module-lexer@2.3.2", "", {}, "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw=="], + "esbuild": ["esbuild@0.28.2", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.28.2", "@esbuild/android-arm": "0.28.2", "@esbuild/android-arm64": "0.28.2", "@esbuild/android-x64": "0.28.2", "@esbuild/darwin-arm64": "0.28.2", "@esbuild/darwin-x64": "0.28.2", "@esbuild/freebsd-arm64": "0.28.2", "@esbuild/freebsd-x64": "0.28.2", "@esbuild/linux-arm": "0.28.2", "@esbuild/linux-arm64": "0.28.2", "@esbuild/linux-ia32": "0.28.2", "@esbuild/linux-loong64": "0.28.2", "@esbuild/linux-mips64el": "0.28.2", "@esbuild/linux-ppc64": "0.28.2", "@esbuild/linux-riscv64": "0.28.2", "@esbuild/linux-s390x": "0.28.2", "@esbuild/linux-x64": "0.28.2", "@esbuild/netbsd-arm64": "0.28.2", "@esbuild/netbsd-x64": "0.28.2", "@esbuild/openbsd-arm64": "0.28.2", "@esbuild/openbsd-x64": "0.28.2", "@esbuild/openharmony-arm64": "0.28.2", "@esbuild/sunos-x64": "0.28.2", "@esbuild/win32-arm64": "0.28.2", "@esbuild/win32-ia32": "0.28.2", "@esbuild/win32-x64": "0.28.2" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA=="], + "escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="], "escape-html": ["escape-html@1.0.3", "", {}, "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="], @@ -1386,6 +1495,8 @@ "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], + "nanoid": ["nanoid@3.3.20", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ=="], + "napi-postinstall": ["napi-postinstall@0.3.8", "", { "bin": { "napi-patch": "./lib/patch.js", "napi-postinstall": "./lib/cli.js" } }, "sha512-dHbDC5V1g/EI8OLEtL4Iuwbu0fgzmyykxenn2KnlsX9XdhTXL3gWnfbbP+ab+oUcgV6CFpb8QGyQt/ZXA0UXig=="], "natural-compare": ["natural-compare@1.4.0", "", {}, "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="], @@ -1482,7 +1593,7 @@ "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], - "picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], + "picomatch": ["picomatch@4.0.7", "", {}, "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA=="], "pify": ["pify@4.0.1", "", {}, "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g=="], @@ -1496,6 +1607,8 @@ "pngjs": ["pngjs@7.0.0", "", {}, "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow=="], + "postcss": ["postcss@8.5.33", "", { "dependencies": { "nanoid": "^3.3.20", "picocolors": "^1.1.1", "source-map-js": "^1.2.2" } }, "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ=="], + "prettier": ["prettier@2.8.8", "", { "bin": { "prettier": "bin-prettier.js" } }, "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q=="], "pretty-format": ["pretty-format@30.5.1", "", { "dependencies": { "@jest/react-is-18": "npm:react-is@^18.3.1", "@jest/react-is-19": "npm:react-is@^19.2.5", "@jest/schemas": "30.5.0", "ansi-styles": "^5.2.0" } }, "sha512-byhRAPguVKMQIj4kjJwJ5lAskVhfuiSdiYl/aLTWpgkGEmic2jYhJh1yE9ih8Ox44Xg9ccCT11/S6QrzSJuNrg=="], @@ -1578,6 +1691,8 @@ "rimraf": ["rimraf@3.0.2", "", { "dependencies": { "glob": "^7.1.3" }, "bin": { "rimraf": "bin.js" } }, "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA=="], + "rollup": ["rollup@4.68.8", "", { "dependencies": { "@types/estree": "^1.0.10" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.68.8", "@rollup/rollup-android-arm64": "4.68.8", "@rollup/rollup-android-x64": "4.68.8", "@rollup/rollup-darwin-arm64": "4.68.8", "@rollup/rollup-darwin-x64": "4.68.8", "@rollup/rollup-freebsd-arm64": "4.68.8", "@rollup/rollup-freebsd-x64": "4.68.8", "@rollup/rollup-linux-arm-gnueabihf": "4.68.8", "@rollup/rollup-linux-arm-musleabihf": "4.68.8", "@rollup/rollup-linux-arm64-gnu": "4.68.8", "@rollup/rollup-linux-arm64-musl": "4.68.8", "@rollup/rollup-linux-loong64-gnu": "4.68.8", "@rollup/rollup-linux-loong64-musl": "4.68.8", "@rollup/rollup-linux-ppc64-gnu": "4.68.8", "@rollup/rollup-linux-ppc64-musl": "4.68.8", "@rollup/rollup-linux-riscv64-gnu": "4.68.8", "@rollup/rollup-linux-riscv64-musl": "4.68.8", "@rollup/rollup-linux-s390x-gnu": "4.68.8", "@rollup/rollup-linux-x64-gnu": "4.68.8", "@rollup/rollup-linux-x64-musl": "4.68.8", "@rollup/rollup-openbsd-x64": "4.68.8", "@rollup/rollup-openharmony-arm64": "4.68.8", "@rollup/rollup-win32-arm64-msvc": "4.68.8", "@rollup/rollup-win32-ia32-msvc": "4.68.8", "@rollup/rollup-win32-x64-gnu": "4.68.8", "@rollup/rollup-win32-x64-msvc": "4.68.8", "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-IHx4DeeTGhoAPke6p1Wlg0JEQFyQoZQQjEe1iD+nhEERk7eoeHK9zyOpVJiGc54Z1MCgI96rN1tD7Ttub8XyPA=="], + "rrweb-cssom": ["rrweb-cssom@0.8.0", "", {}, "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw=="], "run-parallel": ["run-parallel@1.2.0", "", { "dependencies": { "queue-microtask": "^1.2.2" } }, "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="], @@ -1622,6 +1737,8 @@ "source-map": ["source-map@0.5.7", "", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="], + "source-map-js": ["source-map-js@1.2.4", "", {}, "sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA=="], + "source-map-support": ["source-map-support@0.5.21", "", { "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w=="], "spawndamnit": ["spawndamnit@3.0.1", "", { "dependencies": { "cross-spawn": "^7.0.5", "signal-exit": "^4.0.1" } }, "sha512-MmnduQUuHCoFckZoWnXsTg7JaiLBJrKFj9UI2MbRPGaJeVpsLcVBu6P/IGZovziM/YBsellCmsprgNA+w0CzVg=="], @@ -1738,6 +1855,8 @@ "vary": ["vary@1.1.2", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="], + "vite": ["vite@7.3.8", "", { "dependencies": { "esbuild": "^0.27.0 || ^0.28.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-3tTi78MAKhVk9h+YZVXMQ8POmneJuE97QUPAWtJghHzhH7BAyiqQOC2KZh1DWOsu/USB2cRXhznPByaabvYXfw=="], + "vlq": ["vlq@1.0.1", "", {}, "sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w=="], "w3c-xmlserializer": ["w3c-xmlserializer@5.0.0", "", { "dependencies": { "xml-name-validator": "^5.0.0" } }, "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA=="], @@ -1842,8 +1961,6 @@ "@manypkg/get-packages/fs-extra": ["fs-extra@8.1.0", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", "universalify": "^0.1.0" } }, "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g=="], - "@parcel/watcher/picomatch": ["picomatch@4.0.7", "", {}, "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA=="], - "@react-native-community/cli/commander": ["commander@9.5.0", "", {}, "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ=="], "@react-native-community/cli/execa": ["execa@5.1.1", "", { "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^4.0.1", "onetime": "^5.1.2", "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" } }, "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg=="], @@ -1906,6 +2023,8 @@ "ansi-fragments/strip-ansi": ["strip-ansi@5.2.0", "", { "dependencies": { "ansi-regex": "^4.1.0" } }, "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA=="], + "anymatch/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], + "babel-plugin-module-resolver/glob": ["glob@9.3.5", "", { "dependencies": { "fs.realpath": "^1.0.0", "minimatch": "^8.0.2", "minipass": "^4.2.4", "path-scurry": "^1.6.1" } }, "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q=="], "babel-plugin-polyfill-corejs2/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], @@ -1982,12 +2101,8 @@ "jest-environment-node/jest-util": ["jest-util@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", "graceful-fs": "^4.2.9", "picomatch": "^2.2.3" } }, "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA=="], - "jest-haste-map/picomatch": ["picomatch@4.0.7", "", {}, "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA=="], - "jest-message-util/@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], - "jest-message-util/picomatch": ["picomatch@4.0.7", "", {}, "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA=="], - "jest-runner/jest-environment-node": ["jest-environment-node@30.5.2", "", { "dependencies": { "@jest/environment": "30.5.2", "@jest/fake-timers": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", "jest-mock": "30.5.2", "jest-util": "30.5.1", "jest-validate": "30.5.1" } }, "sha512-Ciz4KgTGIbojxSKpuFImgWJj5EyqfE8xMq9NxWmOXnQywHHS03H9Mv+vaCB29J5pr3JBrY27WbRV18rBdjh8Dg=="], "jest-runner/p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="], @@ -2010,8 +2125,6 @@ "jest-util/ci-info": ["ci-info@4.5.0", "", {}, "sha512-d1uM8k5UZEyPza1n/MG3ko8nKupKN0KJpFsipgPcgaCCvV+IqIfJ+NzTjetlLM+UcXZx3+cLrNr76+eAO7G1Mw=="], - "jest-util/picomatch": ["picomatch@4.0.7", "", {}, "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA=="], - "jest-validate/camelcase": ["camelcase@6.3.0", "", {}, "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA=="], "jest-worker/supports-color": ["supports-color@8.1.1", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q=="], @@ -2058,6 +2171,8 @@ "metro-transform-worker/metro-source-map": ["metro-source-map@0.80.12", "", { "dependencies": { "@babel/traverse": "^7.20.0", "@babel/types": "^7.20.0", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-symbolicate": "0.80.12", "nullthrows": "^1.1.1", "ob1": "0.80.12", "source-map": "^0.5.6", "vlq": "^1.0.0" } }, "sha512-o+AXmE7hpvM8r8MKsx7TI21/eerYYy2DCDkWfoBkv+jNkl61khvDHlQn0cXZa6lrcNZiZkl9oHSMcwLLIrFmpw=="], + "micromatch/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], + "nitrogen/chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="], "p-filter/p-map": ["p-map@2.1.0", "", {}, "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw=="], @@ -2126,8 +2241,6 @@ "test-exclude/minimatch": ["minimatch@10.2.6", "", { "dependencies": { "brace-expansion": "^5.0.8" } }, "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A=="], - "tinyglobby/picomatch": ["picomatch@4.0.7", "", {}, "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA=="], - "whatwg-encoding/iconv-lite": ["iconv-lite@0.6.3", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw=="], "wrap-ansi/ansi-styles": ["ansi-styles@6.2.3", "", {}, "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg=="], @@ -2392,6 +2505,8 @@ "jest-environment-node/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], + "jest-environment-node/jest-util/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], + "jest-message-util/@babel/code-frame/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.29.7", "", {}, "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg=="], "jest-runtime/glob/minimatch": ["minimatch@10.2.6", "", { "dependencies": { "brace-expansion": "^5.0.8" } }, "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A=="], @@ -2690,12 +2805,16 @@ "metro-file-map/jest-worker/jest-util/@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=="], + "metro-file-map/jest-worker/jest-util/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], + "metro/jest-worker/@types/node/undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], "metro/jest-worker/jest-util/@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=="], "metro/jest-worker/jest-util/ci-info": ["ci-info@3.9.0", "", {}, "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ=="], + "metro/jest-worker/jest-util/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], + "metro/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=="], "pkg-up/find-up/locate-path/p-locate": ["p-locate@3.0.0", "", { "dependencies": { "p-limit": "^2.0.0" } }, "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ=="], @@ -2784,6 +2903,8 @@ "@react-native/community-cli-plugin/metro/jest-worker/jest-util/ci-info": ["ci-info@3.9.0", "", {}, "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ=="], + "@react-native/community-cli-plugin/metro/jest-worker/jest-util/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], + "@react-native/community-cli-plugin/metro/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=="], "find-cache-dir/pkg-dir/find-up/locate-path/p-locate": ["p-locate@3.0.0", "", { "dependencies": { "p-limit": "^2.0.0" } }, "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ=="], @@ -2824,6 +2945,8 @@ "react-native/babel-jest/@jest/transform/jest-util/@types/node": ["@types/node@22.13.13", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ=="], + "react-native/babel-jest/@jest/transform/jest-util/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], + "react-native/babel-jest/@jest/transform/write-file-atomic/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], "react-native/babel-jest/babel-plugin-istanbul/istanbul-lib-instrument/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], diff --git a/package.json b/package.json index b8f5b46..a01ce28 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,8 @@ "protobufjs": "^8.8.1", "react-native-builder-bob": "^0.40.6", "react-native-nitro-modules": "~0.37.0", - "typescript": "^5.8.3" + "typescript": "^5.8.3", + "vite": "7.3.8" }, "peerDependencies": { "react-native": ">=0.79", From 2dd5e6be66f99fce747ac54525d30b67e52f44e6 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 00:59:01 +0100 Subject: [PATCH 33/76] feat(web): Vite helper Co-Authored-By: Claude Opus 5.5 --- package.json | 5 +++- verify/static/packContents.test.ts | 2 +- verify/static/packContents.ts | 3 +-- vite/__tests__/withOtel.test.js | 42 ++++++++++++++++++++++++++++++ vite/index.d.ts | 3 +++ vite/index.js | 38 +++++++++++++++++++++++++++ 6 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 vite/__tests__/withOtel.test.js create mode 100644 vite/index.d.ts create mode 100644 vite/index.js diff --git a/package.json b/package.json index a01ce28..6120707 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,10 @@ "default": "./lib/module/index.js" }, "./metro": "./metro/index.js", - "./vite": "./vite/index.ts", + "./vite": { + "types": "./vite/index.d.ts", + "default": "./vite/index.js" + }, "./setup": { "types": "./lib/typescript/src/setup.d.ts", "default": "./lib/module/setup.js" diff --git a/verify/static/packContents.test.ts b/verify/static/packContents.test.ts index 8211bf1..60a7f6a 100644 --- a/verify/static/packContents.test.ts +++ b/verify/static/packContents.test.ts @@ -1,6 +1,6 @@ import {packContents} from './packContents'; -const complete = ['package.json', 'lib/module/index.js', 'src/index.ts', 'nitrogen/generated/x.hpp', 'metro/index.js', 'android/build.gradle', 'ios/Adapter/HybridOtel.swift', 'Package.swift', 'ReactNativeOpenTelemetry.podspec']; +const complete = ['package.json', 'lib/module/index.js', 'src/index.ts', 'nitrogen/generated/x.hpp', 'metro/index.js', 'vite/index.js', 'android/build.gradle', 'ios/Adapter/HybridOtel.swift', 'Package.swift', 'ReactNativeOpenTelemetry.podspec']; test('reports missing nitrogen/', () => { expect(packContents(complete.filter(p => !p.startsWith('nitrogen/')))).toEqual(['nitrogen/']); diff --git a/verify/static/packContents.ts b/verify/static/packContents.ts index 158e26a..9697e02 100644 --- a/verify/static/packContents.ts +++ b/verify/static/packContents.ts @@ -1,5 +1,4 @@ -// vite/ joins with Task 22, which creates it. Package.swift (Task 18) is listed by spec §9.4 stage 1. -export const REQUIRED = ['package.json', 'lib/', 'src/', 'nitrogen/', 'metro/', 'android/', 'ios/', 'Package.swift', 'ReactNativeOpenTelemetry.podspec']; +export const REQUIRED = ['package.json', 'lib/', 'src/', 'nitrogen/', 'metro/', 'vite/', 'android/', 'ios/', 'Package.swift', 'ReactNativeOpenTelemetry.podspec']; /** Returns the required paths missing from the `npm pack --dry-run --json` file list. */ export function packContents(list: string[], required: string[] = REQUIRED): string[] { diff --git a/vite/__tests__/withOtel.test.js b/vite/__tests__/withOtel.test.js new file mode 100644 index 0000000..c49dbc7 --- /dev/null +++ b/vite/__tests__/withOtel.test.js @@ -0,0 +1,42 @@ +const {withOtel} = require('..'); + +const KEYS = ['async-await', 'async-generator', 'for-await']; +const html = config => config.plugins.find(p => p.name === 'react-native-open-telemetry').transformIndexHtml; + +test('disables native async on esbuild and the dep optimizer', () => { + const out = withOtel({}); + for (const k of KEYS) { + expect(out.esbuild.supported[k]).toBe(false); + expect(out.optimizeDeps.esbuildOptions.supported[k]).toBe(false); + } +}); + +test('injects setup first, in dev and build', () => { + const hook = html(withOtel({})); + expect(hook.order).toBe('pre'); + expect(hook.handler()).toEqual([ + {tag: 'script', attrs: {type: 'module'}, children: "import 'react-native-open-telemetry/setup';", injectTo: 'head-prepend'}, + ]); +}); + +test("keeps the user's values and plugins", () => { + const mine = {name: 'mine'}; + const out = withOtel({ + plugins: [mine], + esbuild: {jsx: 'automatic', supported: {bigint: false}}, + optimizeDeps: {include: ['x'], esbuildOptions: {target: 'es2020', supported: {'top-level-await': true}}}, + base: '/b/', + }); + expect(out.plugins[0]).toBe(mine); + expect(out.esbuild).toMatchObject({jsx: 'automatic', supported: {bigint: false, 'async-await': false}}); + expect(out.optimizeDeps.include).toEqual(['x']); + expect(out.optimizeDeps.esbuildOptions).toMatchObject({target: 'es2020', supported: {'top-level-await': true, 'async-await': false}}); + expect(out.base).toBe('/b/'); +}); + +test('is idempotent when applied twice', () => { + const once = withOtel({}); + const twice = withOtel(once); + expect(twice.plugins.filter(p => p.name === 'react-native-open-telemetry')).toHaveLength(1); + expect(twice).toEqual(once); +}); diff --git a/vite/index.d.ts b/vite/index.d.ts new file mode 100644 index 0000000..c18023d --- /dev/null +++ b/vite/index.d.ts @@ -0,0 +1,3 @@ +import type {UserConfig} from 'vite'; + +export function withOtel(config: UserConfig): UserConfig; diff --git a/vite/index.js b/vite/index.js new file mode 100644 index 0000000..83fcd7f --- /dev/null +++ b/vite/index.js @@ -0,0 +1,38 @@ +/** + * Vite helper: esbuild must not emit native async (the context patch can't see through it), and setup must run first. + * Native async functions, async generators and `for await` all bypass the patch, so all three are lowered. + * Plain CJS like metro/index.js: loads from node_modules in both ESM and CJS configs. + * Targets Vite <= 7 (esbuild). Vite 8 (Rolldown/Oxc) ignores `esbuild.*`; revisit before supporting it. + * Test-mode builds: the app config must define OTEL_TEST_MODE itself (see src/internal/testMode.ts). + */ +const NAME = 'react-native-open-telemetry'; +const NO_NATIVE_ASYNC = {'async-await': false, 'async-generator': false, 'for-await': false}; + +function withOtel(config) { + const plugins = config.plugins ?? []; + if (plugins.some(p => p && p.name === NAME)) return config; + const esbuildOptions = config.optimizeDeps?.esbuildOptions; + return { + ...config, + esbuild: {...config.esbuild, supported: {...config.esbuild?.supported, ...NO_NATIVE_ASYNC}}, + optimizeDeps: { + ...config.optimizeDeps, + esbuildOptions: {...esbuildOptions, supported: {...esbuildOptions?.supported, ...NO_NATIVE_ASYNC}}, + }, + plugins: [ + ...plugins, + { + name: NAME, + // 'pre' so build bundles the inline module (and so lowers it); head-prepend runs it before the app entry. + transformIndexHtml: { + order: 'pre', + handler: () => [ + {tag: 'script', attrs: {type: 'module'}, children: "import 'react-native-open-telemetry/setup';", injectTo: 'head-prepend'}, + ], + }, + }, + ], + }; +} + +module.exports = {withOtel}; From 5472b2af82ac9a5f5998f74125b8d337d96f8e3e Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 03:30:32 +0100 Subject: [PATCH 34/76] fix(verify): no e2e retries in draft mode, so a drafting run never ends green (R1) Co-Authored-By: Claude Opus 5.5 --- verify/VERIFY.md | 2 +- verify/e2e/e2e.config.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/verify/VERIFY.md b/verify/VERIFY.md index b761b67..fb5f6fc 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -40,7 +40,7 @@ it (Xcode scheme, `SIMCTL_CHILD_TRACEPARENT`); the verify stages unset it for na `verify/e2e/scenarios.e2e.ts` runs one test per scenario with runner `e2e`, not `pending`, on each target it lists, except the scenarios with their own e2e file. Each test cold-starts the app (R5). e2e is compare-only; `VERIFY_E2E_DRAFT=1` writes a **missing** `.js.otlp.json` from the device run and still fails the test -("drafted …, review it"); existing files are never overwritten. Until Tasks 24/25 device runs compare to the `js` files. +("drafted …, review it"); existing files are never overwritten. Draft runs have no retries, so a drafting run always ends red. Until Tasks 24/25 device runs compare to the `js` files. **`performance.timeOrigin` on Hermes (X17, Task 13).** Defined on both platforms (RN 0.88.1 release, Hermes), checked with a one-off `console.log` of `timeOrigin`, `performance.now()` and `Date.now()` at app start: diff --git a/verify/e2e/e2e.config.ts b/verify/e2e/e2e.config.ts index 49118e3..00e431b 100644 --- a/verify/e2e/e2e.config.ts +++ b/verify/e2e/e2e.config.ts @@ -9,7 +9,7 @@ export default { tests: '*.e2e.ts', // one collector port: targets must not run at once workers: 1, - retries: 1, + retries: process.env.VERIFY_E2E_DRAFT === '1' ? 0 : 1, // a retry would pass against its own fresh draft (R1) timeout: 180_000, launchTimeout: 120_000, actionTimeout: 90_000, // CI simulators answer installs and taps slowly From d2e1c12315261ade432218bda67e16820ade1c4e Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 03:52:51 +0100 Subject: [PATCH 35/76] test(verify): device-drafted android files for nest-raf and event-emitter-listener (R1) Drafted on android-bare through the native core with VERIFY_E2E_DRAFT=1; each equals its .js file under jq -S. Needs the author's review. Co-Authored-By: Claude Opus 5.5 --- verify/e2e/tracer-bullet.e2e.ts | 35 -------------- .../event-emitter-listener.android.otlp.json | 46 +++++++++++++++++++ verify/expected/nest-raf.android.otlp.json | 46 +++++++++++++++++++ 3 files changed, 92 insertions(+), 35 deletions(-) delete mode 100644 verify/e2e/tracer-bullet.e2e.ts create mode 100644 verify/expected/event-emitter-listener.android.otlp.json create mode 100644 verify/expected/nest-raf.android.otlp.json diff --git a/verify/e2e/tracer-bullet.e2e.ts b/verify/e2e/tracer-bullet.e2e.ts deleted file mode 100644 index 32d047e..0000000 --- a/verify/e2e/tracer-bullet.e2e.ts +++ /dev/null @@ -1,35 +0,0 @@ -import fs from 'node:fs'; -import path from 'node:path'; -import {expect} from 'e2e'; -import {clearDeviceLog, deviceLog, platformOf, test} from './harness'; -import {decodeFixture} from '../harness/fixtureJson'; - -type Span = {attributes: unknown[]; events: unknown[]; links: unknown[]}; -const {spans} = decodeFixture( - fs.readFileSync(path.join(import.meta.dirname, '..', 'fixtures', 'rich-span.handoff.json'), 'utf8'), -) as {spans: Span[]}; -const sum = (f: (s: Span) => number) => spans.reduce((n, s) => n + f(s), 0); -const line = - `RNOtel handOff spans=${spans.length} attrs=${sum(s => s.attributes.length)} ` + - `events=${sum(s => s.events.length)} links=${sum(s => s.links.length)}`; - -test('handOff crosses the Nitro seam', async ({app, screen, device, target}) => { - const platform = platformOf(target); - const {deviceId} = device.unstable_raw; - await app.open(); - const since = await clearDeviceLog(platform, deviceId); - await screen.getByTestId('tracer-bullet-handoff').tap(); - await expect(screen.getByTestId('tracer-bullet-done')).toBeVisible({timeout: 10_000}); - // the log line can land a moment after the tap returns - let seen: string[] = []; - for (let i = 0; i < 20 && !seen.length; i++) { - seen = deviceLog(platform, deviceId, 'RNOtel handOff', since); - if (!seen.length) await new Promise(r => setTimeout(r, 500)); - } - expect(seen.at(-1) ?? '(no RNOtel handOff line in the device log)').toContain(line); -}); - -test('native test mode reaches initialize', async ({app, screen}) => { - await app.open(); - await expect(screen.getByTestId('native-test-mode')).toHaveText('native testMode=true'); -}); diff --git a/verify/expected/event-emitter-listener.android.otlp.json b/verify/expected/event-emitter-listener.android.otlp.json new file mode 100644 index 0000000..71f62e7 --- /dev/null +++ b/verify/expected/event-emitter-listener.android.otlp.json @@ -0,0 +1,46 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "emit", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000020000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "listener", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/nest-raf.android.otlp.json b/verify/expected/nest-raf.android.otlp.json new file mode 100644 index 0000000..947dddf --- /dev/null +++ b/verify/expected/nest-raf.android.otlp.json @@ -0,0 +1,46 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000020000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "frame", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} From 4d6195a477b66a5b194db36a5044a9d915643add Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 03:52:56 +0100 Subject: [PATCH 36/76] feat(android): Nitro adapter and native-first init - RNOtel.start/tracer/contextFrom/traceparentOf + RNOtelConfig (com.callstack.otel); main process only (getProcessName on API 28+, /proc/self/cmdline below), background flush on ProcessLifecycleOwner ON_STOP (async forceFlush, never join on main). Distro version from package.json via BuildConfig. - HybridOtel maps the seam 1:1 onto OtelCore; flush resolves on Dispatchers.Default. - android/build.gradle compiles src/core/kotlin, adds lifecycle-process; minSdk 26 (C13). - Example: MainApplication inits native first (no serviceVersion, R2; x-api-key header, R11). ScenariosScreen exports via startReactNativeSdk on Android only (R13); android-* compare to android files. - Tracer bullet retired (R14); native-test-mode check kept; export-headers e2e on android. Co-Authored-By: Claude Opus 5.5 --- android/build.gradle | 10 +++ android/gradle.properties | 2 +- .../main/java/com/callstack/otel/RNOtel.kt | 76 +++++++++++++++++++ .../java/com/callstack/otel/RNOtelConfig.kt | 31 ++++++++ .../nitro/callstack/otel/HybridOtel.kt | 69 ++++++++++++++--- example/App.tsx | 3 + .../opentelemetry/example/MainApplication.kt | 9 +++ example/android/build.gradle | 2 +- example/src/ScenariosScreen.tsx | 30 +++----- verify/VERIFY.md | 29 +++++-- verify/e2e/export-headers.e2e.ts | 13 ++++ verify/e2e/harness.ts | 7 +- verify/e2e/native-test-mode.e2e.ts | 7 ++ verify/scenarios/export-headers.ts | 2 +- verify/stages/e2e.ts | 2 +- 15 files changed, 248 insertions(+), 44 deletions(-) create mode 100644 android/src/main/java/com/callstack/otel/RNOtel.kt create mode 100644 android/src/main/java/com/callstack/otel/RNOtelConfig.kt create mode 100644 verify/e2e/export-headers.e2e.ts create mode 100644 verify/e2e/native-test-mode.e2e.ts diff --git a/android/build.gradle b/android/build.gradle index ede1486..e599593 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -18,6 +18,8 @@ def getExtOrIntegerDefault(name) { // Test mode is a build flag, never API: -PotelTestMode=true (or otelTestMode=true in the app's gradle.properties). def otelTestMode = (findProperty("otelTestMode") ?: "false").toString() == "true" +// telemetry.distro.version = the npm package version +def otelDistroVersion = new groovy.json.JsonSlurper().parse(file("../package.json")).version android { namespace "com.margelo.nitro.callstack.otel" @@ -29,6 +31,7 @@ android { minSdkVersion getExtOrIntegerDefault("minSdkVersion") targetSdkVersion getExtOrIntegerDefault("targetSdkVersion") buildConfigField "boolean", "OTEL_TEST_MODE", otelTestMode.toString() + buildConfigField "String", "OTEL_DISTRO_VERSION", "\"${otelDistroVersion}\"" externalNativeBuild { cmake { @@ -47,6 +50,11 @@ android { cmake { path "CMakeLists.txt" } } + // the pure Kotlin core (also compiled and tested on the JVM by android/core-jvm) + sourceSets { + main { java.srcDirs += "src/core/kotlin" } + } + packagingOptions { excludes = [ "META-INF", @@ -95,6 +103,8 @@ repositories { dependencies { implementation "com.facebook.react:react-android" implementation project(":react-native-nitro-modules") + // ProcessLifecycleOwner: background flush on ON_STOP (same version React Native already resolves) + implementation "androidx.lifecycle:lifecycle-process:2.6.2" implementation platform("io.opentelemetry:opentelemetry-bom:1.68.0") implementation "io.opentelemetry:opentelemetry-sdk" diff --git a/android/gradle.properties b/android/gradle.properties index dc55b22..c315c79 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ ReactNativeOpenTelemetry_kotlinVersion=2.1.21 -ReactNativeOpenTelemetry_minSdkVersion=24 +ReactNativeOpenTelemetry_minSdkVersion=26 ReactNativeOpenTelemetry_targetSdkVersion=36 ReactNativeOpenTelemetry_compileSdkVersion=36 ReactNativeOpenTelemetry_ndkVersion=27.1.12297006 diff --git a/android/src/main/java/com/callstack/otel/RNOtel.kt b/android/src/main/java/com/callstack/otel/RNOtel.kt new file mode 100644 index 0000000..9906c5f --- /dev/null +++ b/android/src/main/java/com/callstack/otel/RNOtel.kt @@ -0,0 +1,76 @@ +package com.callstack.otel + +import android.app.Application +import android.content.Context +import android.os.Build +import android.os.Handler +import android.os.Looper +import android.util.Log +import androidx.lifecycle.DefaultLifecycleObserver +import androidx.lifecycle.LifecycleOwner +import androidx.lifecycle.ProcessLifecycleOwner +import com.callstack.otel.core.CoreConfig +import com.callstack.otel.core.InitResult +import com.callstack.otel.core.OtelCore +import com.margelo.nitro.callstack.otel.BuildConfig +import io.opentelemetry.api.OpenTelemetry +import io.opentelemetry.api.trace.Span +import io.opentelemetry.api.trace.Tracer +import io.opentelemetry.context.Context as OtelContext +import java.io.File +import java.util.concurrent.atomic.AtomicBoolean + +/** Public native API (spec §4.3/§4.4). Test mode comes from the build (`-PotelTestMode=true`), never from here. */ +object RNOtel { + private const val TAG = "RNOtel" + private val observing = AtomicBoolean() + + /** Native-first init from `Application.onCreate`. No-op outside the main process; never throws. */ + @JvmStatic + fun start(context: Context, block: RNOtelConfig.() -> Unit) { + try { + val app = context.applicationContext + if (processName() != app.packageName) return + val r = initialize(RNOtelConfig().apply(block).toCore()) + if (r.error != null) Log.e(TAG, "init failed; telemetry is off: ${r.error}") + } catch (e: Exception) { + Log.e(TAG, "init failed; telemetry is off", e) + } + } + + /** One path for native-first and JS-fallback init. The exporter (OkHttp) is built on first export, on the BSP thread. */ + internal fun initialize(config: CoreConfig?): InitResult { + val r = OtelCore.initialize(config, BuildConfig.OTEL_TEST_MODE, BuildConfig.OTEL_DISTRO_VERSION) + if (OtelCore.instance != null && observing.compareAndSet(false, true)) { + Handler(Looper.getMainLooper()).post { + ProcessLifecycleOwner.get().lifecycle.addObserver(object : DefaultLifecycleObserver { + // forceFlush only signals the BSP worker: asynchronous, never join() on the main thread + override fun onStop(owner: LifecycleOwner) { + OtelCore.instance?.tracerProvider?.forceFlush() + } + }) + } + } + return r + } + + /** A tracer on the native provider; a no-op tracer before (or without) a successful init. */ + @JvmStatic + @JvmOverloads + fun tracer(name: String, version: String? = null): Tracer { + val provider = OtelCore.instance?.tracerProvider ?: OpenTelemetry.noop().tracerProvider + return provider.tracerBuilder(name).apply { version?.let(::setInstrumentationVersion) }.build() + } + + /** W3C traceparent -> explicit, non-remote parent context; invalid input -> root. */ + @JvmStatic + fun contextFrom(traceparent: String): OtelContext = com.callstack.otel.core.contextFrom(traceparent) + + @JvmStatic + fun traceparentOf(span: Span): String = com.callstack.otel.core.traceparentOf(span) + + // Application.getProcessName() is API 28+; minSdk is 26. + private fun processName(): String = + if (Build.VERSION.SDK_INT >= 28) Application.getProcessName() + else File("/proc/self/cmdline").readText().substringBefore('\u0000').trim() +} diff --git a/android/src/main/java/com/callstack/otel/RNOtelConfig.kt b/android/src/main/java/com/callstack/otel/RNOtelConfig.kt new file mode 100644 index 0000000..41fcea2 --- /dev/null +++ b/android/src/main/java/com/callstack/otel/RNOtelConfig.kt @@ -0,0 +1,31 @@ +package com.callstack.otel + +import com.callstack.otel.core.AttrValue +import com.callstack.otel.core.CoreConfig +import com.callstack.otel.core.SeamAttribute + +/** Native-first config (spec §4.4): `RNOtel.start(this) { serviceName = …; export { url = … } }`. */ +class RNOtelConfig { + var serviceName: String = "" + var serviceVersion: String? = null + var resourceAttributes: Map = emptyMap() + private var export = Export() + + class Export { + /** OTLP base URL; `/v1/traces` is appended unless present. */ + var url: String = "" + var headers: Map = emptyMap() + } + + fun export(block: Export.() -> Unit) { + export = Export().apply(block) + } + + internal fun toCore() = CoreConfig( + serviceName = serviceName, + serviceVersion = serviceVersion, + resourceAttributes = resourceAttributes.map { (k, v) -> SeamAttribute(k, AttrValue.Str(v)) }, + exportUrl = export.url, + exportHeaders = export.headers, + ) +} diff --git a/android/src/main/java/com/margelo/nitro/callstack/otel/HybridOtel.kt b/android/src/main/java/com/margelo/nitro/callstack/otel/HybridOtel.kt index 9aff250..3fc6f47 100644 --- a/android/src/main/java/com/margelo/nitro/callstack/otel/HybridOtel.kt +++ b/android/src/main/java/com/margelo/nitro/callstack/otel/HybridOtel.kt @@ -1,29 +1,74 @@ package com.margelo.nitro.callstack.otel -import android.util.Log import androidx.annotation.Keep +import com.callstack.otel.RNOtel +import com.callstack.otel.core.CoreConfig +import com.callstack.otel.core.HrTime +import com.callstack.otel.core.OtelCore import com.facebook.proguard.annotations.DoNotStrip import com.margelo.nitro.core.Promise -import io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter +import com.callstack.otel.core.AttrValue as CoreValue +import com.callstack.otel.core.SeamAttribute as CoreAttribute +import com.callstack.otel.core.SeamEvent as CoreEvent +import com.callstack.otel.core.SeamLink as CoreLink +import com.callstack.otel.core.SeamScope as CoreScope +import com.callstack.otel.core.SeamSpan as CoreSpan +import com.callstack.otel.core.SeamSpanContext as CoreSpanContext +import com.callstack.otel.core.SeamStatus as CoreStatus -/** Tracer-bullet stub (Task 7): proves the seam and the otel-java link; the real adapter is Task 24. */ +/** The seam, mapped 1:1 onto the Kotlin core. */ // Constructed from JNI by name (ReactNativeOpenTelemetryOnLoad.cpp): keep it through R8. @DoNotStrip @Keep class HybridOtel : HybridOtelSpec() { override fun initialize(config: SeamConfig?): SeamInitResult { - // Touch otel-java + its OkHttp sender so a broken dependency fails here, not in Task 24. - OtlpHttpSpanExporter.builder().build().shutdown() - return SeamInitResult(alreadyInitialized = false, testMode = BuildConfig.OTEL_TEST_MODE, error = null) + val r = RNOtel.initialize(config?.let { + CoreConfig( + serviceName = it.serviceName, + serviceVersion = it.serviceVersion, + resourceAttributes = attrs(it.resourceAttributes), + exportUrl = it.exportUrl, + exportHeaders = it.exportHeaders.mapNotNull { h -> h.value.asFifthOrNull()?.let { v -> h.key to v } }.toMap(), + ) + }) + return SeamInitResult(r.alreadyInitialized, r.testMode, r.error) } + /** JS thread: copy the structs and enqueue; SpanData is built on the export thread. */ override fun handOff(spans: Array) { - Log.i( - "RNOtel", - "RNOtel handOff spans=${spans.size} attrs=${spans.sumOf { it.attributes.size }} " + - "events=${spans.sumOf { it.events.size }} links=${spans.sumOf { it.links.size }}", - ) + OtelCore.instance?.handOff(spans.map(::span)) } - override fun flush(timeoutMs: Double): Promise = Promise.resolved(Unit) + // Off the JS and main threads; resolves even when native never initialized. + override fun flush(timeoutMs: Double): Promise = Promise.async { + OtelCore.instance?.flush(timeoutMs.toLong()) + Unit + } + + private fun span(s: SeamSpan) = CoreSpan( + context = ctx(s.context), + parentSpanId = s.parentSpanId, + name = s.name, + kind = s.kind.toInt(), + start = HrTime.of(s.start), + end = HrTime.of(s.end), + attributes = attrs(s.attributes), + events = s.events.map { CoreEvent(it.name, HrTime.of(it.time), attrs(it.attributes)) }, + links = s.links.map { CoreLink(ctx(it.context), attrs(it.attributes)) }, + status = CoreStatus(s.status.code.toInt(), s.status.message), + scope = CoreScope(s.scope.name, s.scope.version, s.scope.schemaUrl, attrs(s.scope.attributes)), + ) + + private fun ctx(c: SeamSpanContext) = CoreSpanContext(c.traceId, c.spanId, c.traceFlags.toInt(), c.traceState) + + private fun attrs(a: Array) = a.map { CoreAttribute(it.key, value(it.value)) } + + private fun value(v: AttrValue): CoreValue = when (v) { + is AttrValue.First -> CoreValue.Bool(v.value) + is AttrValue.Second -> CoreValue.Bools(v.value.asList()) + is AttrValue.Third -> CoreValue.Strs(v.value.asList()) + is AttrValue.Fourth -> CoreValue.Nums(v.value.asList()) + is AttrValue.Fifth -> CoreValue.Str(v.value) + is AttrValue.Sixth -> CoreValue.Num(v.value) + } } diff --git a/example/App.tsx b/example/App.tsx index 1e5249c..11d39bc 100644 --- a/example/App.tsx +++ b/example/App.tsx @@ -1,3 +1,6 @@ +// The package entry imports its setup (context patch), which withOtel runs before the app. A bare import in its own +// module: with inline requires, release Metro drops ScenariosScreen's import on iOS, where its only use is dead code. +import 'react-native-open-telemetry'; import {ScenariosScreen} from './src/ScenariosScreen'; export default function App() { diff --git a/example/android/app/src/main/java/opentelemetry/example/MainApplication.kt b/example/android/app/src/main/java/opentelemetry/example/MainApplication.kt index 095275a..3cb8fe8 100644 --- a/example/android/app/src/main/java/opentelemetry/example/MainApplication.kt +++ b/example/android/app/src/main/java/opentelemetry/example/MainApplication.kt @@ -1,6 +1,7 @@ package opentelemetry.example import android.app.Application +import com.callstack.otel.RNOtel import com.facebook.react.PackageList import com.facebook.react.ReactApplication import com.facebook.react.ReactHost @@ -22,6 +23,14 @@ class MainApplication : Application(), ReactApplication { override fun onCreate() { super.onCreate() + // Native-first init, before React Native. No serviceVersion: the test-mode resource is service.name only (R2). + RNOtel.start(this) { + serviceName = "verify" + export { + url = "http://10.0.2.2:4318" // the e2e collector on the host + headers = mapOf("x-api-key" to "test") // asserted by verify/e2e/export-headers.e2e.ts + } + } loadReactNative(this) } } diff --git a/example/android/build.gradle b/example/android/build.gradle index f0b3a26..b28fa4c 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,7 +1,7 @@ buildscript { ext { buildToolsVersion = "37.0.0" - minSdkVersion = 24 + minSdkVersion = 26 compileSdkVersion = 37 targetSdkVersion = 36 ndkVersion = "27.1.12297006" diff --git a/example/src/ScenariosScreen.tsx b/example/src/ScenariosScreen.tsx index dd0c535..ce54da7 100644 --- a/example/src/ScenariosScreen.tsx +++ b/example/src/ScenariosScreen.tsx @@ -3,23 +3,28 @@ import {Platform, Pressable, ScrollView, StyleSheet, Text, View} from 'react-nat import {resourceFromAttributes} from '@opentelemetry/resources'; import {SimpleSpanProcessor, TracerProvider} from '@opentelemetry/sdk-trace'; import {OTLPTraceExporter} from '@opentelemetry/exporter-trace-otlp-proto'; -// the package's entry imports its setup (context patch); withOtel runs it before the app -import 'react-native-open-telemetry'; +// the package's entry imports its setup (context patch); App.tsx keeps it in the graph on iOS too +import {startReactNativeSdk} from 'react-native-open-telemetry'; import {getOtel} from '../../src/native/otel'; import {sequentialIds} from '../../src/internal/testMode'; -import type {SeamSpan} from '../../src/native/Otel.nitro'; import {at} from '../../verify/harness/scenario'; -import {decodeFixture} from '../../verify/harness/fixtureJson'; import {allScenarios} from '../../verify/scenarios'; -import richSpan from '../../verify/fixtures/rich-span.handoff.json'; /** Must match COLLECTOR_PORT in verify/e2e/harness.ts. */ const COLLECTOR_PORT = 4318; const COLLECTOR = `http://${Platform.OS === 'android' ? '10.0.2.2' : 'localhost'}:${COLLECTOR_PORT}`; -// Phase 1: JS-direct export, the same provider setup as verify/jest/scenarios.test.ts. async function runScenario(name: string) { const s = allScenarios().find(x => x.name === name)!; + // Android: native-first (MainApplication ran RNOtel.start); attach and export through the native core. + // ponytail: iOS stays JS-direct until Task 25 (R13), then this branch becomes the only path. + if (Platform.OS === 'android') { + const sdk = startReactNativeSdk(); + await s.run({tracer: sdk.tracerProvider.getTracer('verify'), getTracer: (n, v, o) => sdk.tracerProvider.getTracer(n, v, o), at}); + await sdk.forceFlush(); + return; + } + // JS-direct export, the same provider setup as verify/jest/scenarios.test.ts. const provider = new TracerProvider({ idGenerator: sequentialIds('0a'), resource: resourceFromAttributes({'service.name': 'verify'}), @@ -57,21 +62,10 @@ export function ScenariosScreen() { setRunning(name); }; - const handOff = () => { - const {spans} = decodeFixture(JSON.stringify(richSpan)) as {spans: SeamSpan[]}; - getOtel()!.handOff(spans); - setStatus('handoff'); - }; - return ( {testMode} - {/* hidden: driven by verify/e2e/tracer-bullet.e2e.ts */} - - tracer bullet - {status === 'done' && done} - {status === 'handoff' && handed off} {status.startsWith('error') && {status}} {/* compact chips: everything the e2e runner taps must fit one small CI screen, no scrolling */} @@ -90,6 +84,4 @@ const styles = StyleSheet.create({ chips: {flexDirection: 'row', flexWrap: 'wrap', gap: 4}, button: {padding: 4, backgroundColor: '#ddd'}, chipText: {fontSize: 10}, - // tappable for the e2e runner, invisible to people - hidden: {opacity: 0.02, padding: 4}, }); diff --git a/verify/VERIFY.md b/verify/VERIFY.md index fb5f6fc..078a18f 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -40,7 +40,10 @@ it (Xcode scheme, `SIMCTL_CHILD_TRACEPARENT`); the verify stages unset it for na `verify/e2e/scenarios.e2e.ts` runs one test per scenario with runner `e2e`, not `pending`, on each target it lists, except the scenarios with their own e2e file. Each test cold-starts the app (R5). e2e is compare-only; `VERIFY_E2E_DRAFT=1` writes a **missing** `.js.otlp.json` from the device run and still fails the test -("drafted …, review it"); existing files are never overwritten. Draft runs have no retries, so a drafting run always ends red. Until Tasks 24/25 device runs compare to the `js` files. +("drafted …, review it"); existing files are never overwritten. Draft runs have no retries, so a drafting run always ends red. +`android-*` targets compare to the `android` files: the bare app inits native first (`RNOtel.start` in +`MainApplication`) and ScenariosScreen exports through `startReactNativeSdk` and the Kotlin core. `ios-*` stays +JS-direct and compares to the `js` files until Task 25 (R13). **`performance.timeOrigin` on Hermes (X17, Task 13).** Defined on both platforms (RN 0.88.1 release, Hermes), checked with a one-off `console.log` of `timeOrigin`, `performance.now()` and `Date.now()` at app start: @@ -53,6 +56,20 @@ an argument) can be off by that skew on iOS. The fake collector listens on port 4318; the app reaches it at `10.0.2.2` (Android emulator) or `localhost` (iOS simulator). +## Android cold start with `RNOtel.start` (Task 24, 2026-11-24) + +`adb shell am start -W -n opentelemetry.example/.MainActivity` after `am force-stop`, 6 launches each, Pixel_9 +emulator (API 36, arm64), release test-mode build. `TotalTime` (ms): + +| Build | runs | min | median | +| --- | --- | --- | --- | +| before (no `RNOtel.start`, JS-direct) | 178, 194, 401, 327, 228, 180 | 178 | 211 | +| after (`RNOtel.start` in `MainApplication.onCreate`) | 265, 206, 234, 293, 316, 191 | 191 | 250 | + +Emulator noise (±100 ms between runs) is larger than the difference; `RNOtel.start` builds the resource, the +batch processor and the provider, but no exporter or OkHttp client (built on the first export, on the BSP thread). +Task 29 measures properly on a device. + ## Device capability check (Task 7, 2026-11-23) What Task 27 (reload, fast refresh, background flush) needs from agent-device. @@ -63,7 +80,7 @@ iOS: iPhone 18 Pro simulator, iOS 27.0, Xcode 27.1, agent-device 0.21.36 (T3 dev | JS reload | ✓ `agent-device metro reload` (Metro re-bundled; screen state reset) | not checked: blocked, see below | | Fast refresh (dev build) | ✓ editing `ScenariosScreen.tsx` text showed on device with React state kept | not checked | | Background and back | ✓ `agent-device home`, then `open opentelemetry.example`: UIKit logged the background task end and `UIApplicationWillEnterForegroundNotification`; state kept. `appstate` still says `runningForeground` after `home` (known iOS quirk, documented by e2e), so check lifecycle in the log, not `appstate` | not checked | -| Read logs | ✓ `agent-device logs start/stop` captures the app's unified log, `NSLog` lines included (`RNOtel handOff …`). The e2e harness reads with `xcrun simctl spawn log show --predicate 'process == "OpenTelemetryExample" …'` | ✓ via the e2e harness: `adb logcat -d -s RNOtel:I` (tracer-bullet test green) | +| Read logs | ✓ `agent-device logs start/stop` captures the app's unified log, `NSLog` lines included (`RNOtel handOff …`). The e2e harness reads with `xcrun simctl spawn log show --predicate 'process == "OpenTelemetryExample" …'` | ✓ via the e2e harness: `adb logcat -d -s RNOtel:I` (tracer-bullet test green; the test was retired in Task 24, R14) | **Blocker (Android, interactive only):** the T3 device panel could not open `Pixel_9`: `Failed to allocate an emulator port for Pixel_9 … avdmanager: … Unable to locate a Java Runtime.` @@ -77,9 +94,9 @@ One file per guarantee in `verify/scenarios/`, named after it, with a hand-writt (the cross-platform parity contract). Exact `..otlp.json` files are drafted by the owning task with `VERIFY_UPDATE=1` and reviewed by the author. `pending` scenarios report as `todo`; the owning task flips `pending` off. -Shapes use the JS runner's resource, `["service.name"]`. Native-first and device runs add resource keys -(`service.version`, and `telemetry.*` outside test mode): Tasks 24/25 (and 29 for `smoke-device`) revise those -shape files with the author. +Shapes use the JS runner's resource, `["service.name"]`. Native test mode builds the resource from config only and +the example inits with no `serviceVersion` (R2), so native-first device runs match the same shapes; `telemetry.*` +outside test mode is Task 29's (`smoke-device`). e2e targets are android, ios and web unless the Runners column names them. @@ -104,7 +121,7 @@ e2e targets are android, ios and web unless the Runners column names them. | `handoff-basic` | a span crosses the seam intact | 8, 15, 18 | jest, e2e | passing | | `rich-span` | every attribute type, events, links, status, scope survive the seam | 8, 15, 18 | jest, e2e | passing | | `odd-attributes` | NaN, ±Infinity, -0, big ints, empty arrays survive the seam | 8, 15, 18 | jest, e2e | passing | -| `export-headers` | configured export headers are sent on every request | 16, 19 | e2e | pending | +| `export-headers` | configured export headers are sent on every request | 16, 19, 24 | jest, e2e (android; ios/web with 25/23) | passing | | `cross-js-to-native` | a native span started from JS is a child of the JS span | 26 | e2e (android, ios) | pending | | `cross-native-to-js` | a JS span started under a native span's context is its child | 26 | e2e (android, ios) | pending | | `collector-down` | app never blocks; spans arrive exactly once when the collector is back | 27 | e2e | pending | diff --git a/verify/e2e/export-headers.e2e.ts b/verify/e2e/export-headers.e2e.ts new file mode 100644 index 0000000..5759bb7 --- /dev/null +++ b/verify/e2e/export-headers.e2e.ts @@ -0,0 +1,13 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import {expect} from 'e2e'; +import {expectScenario, test} from './harness'; + +// R11: the app's init headers (x-api-key: test) reach the collector on every export request. +test('export-headers', async ({app, screen, collector, target}) => { + await expectScenario('export-headers', target, {app, screen, collector}); + const raw = path.join(import.meta.dirname, '..', 'artifacts', 'raw', `export-headers.${target.split('-')[0]}`); + const files = fs.readdirSync(raw).filter(f => f.endsWith('.headers.json')); + expect(files.length).toBeGreaterThan(0); + for (const f of files) expect(JSON.parse(fs.readFileSync(path.join(raw, f), 'utf8'))['x-api-key']).toBe('test'); +}); diff --git a/verify/e2e/harness.ts b/verify/e2e/harness.ts index d46b28f..256756c 100644 --- a/verify/e2e/harness.ts +++ b/verify/e2e/harness.ts @@ -3,7 +3,7 @@ import path from 'node:path'; import {test as base} from '@e2e-dev/mobile'; import {expect, type App, type Screen} from 'e2e'; -// Device runs compare to the reviewed .js expected files until Tasks 24/25; they must never rewrite them. +// Device runs compare to the reviewed expected files (android: native-first; ios: .js until Task 25); never rewrite them. if (process.env.VERIFY_UPDATE === '1') throw new Error('verify/e2e is compare-only: unset VERIFY_UPDATE (`bun verify --update --e2e` already does)'); @@ -69,9 +69,10 @@ export async function expectScenario( } finally { actual = await collector.end(); } - // Until Tasks 24/25 device runs compare to the JS expected files. + // android-* export through the native core (R13); ios-* stays JS-direct until Task 25. // VERIFY_E2E_DRAFT=1 writes a missing expected file and still fails (review it, then rerun) - const r = compareToExpected(name, 'js', actual, {draft: process.env.VERIFY_E2E_DRAFT === '1'}); + const expected = platformOf(target) === 'android' ? 'android' : 'js'; + const r = compareToExpected(name, expected, actual, {draft: process.env.VERIFY_E2E_DRAFT === '1'}); if (!r.ok) throw new Error('\n' + r.report); } diff --git a/verify/e2e/native-test-mode.e2e.ts b/verify/e2e/native-test-mode.e2e.ts new file mode 100644 index 0000000..8cd89d6 --- /dev/null +++ b/verify/e2e/native-test-mode.e2e.ts @@ -0,0 +1,7 @@ +import {expect} from 'e2e'; +import {test} from './harness'; + +test('native test mode reaches initialize', async ({app, screen}) => { + await app.open(); + await expect(screen.getByTestId('native-test-mode')).toHaveText('native testMode=true'); +}); diff --git a/verify/scenarios/export-headers.ts b/verify/scenarios/export-headers.ts index d29e21b..953fc28 100644 --- a/verify/scenarios/export-headers.ts +++ b/verify/scenarios/export-headers.ts @@ -9,5 +9,5 @@ export default scenario( async ({tracer, at}) => { tracer.startSpan('headers', {startTime: at(0)}).end(at(10)); }, - {targets: []}, // no e2e yet: Tasks 24/25/23 add android/ios/web as each app's init sends the header + {targets: ['android']}, // Tasks 25/23 add ios/web as each app's init sends the header ); diff --git a/verify/stages/e2e.ts b/verify/stages/e2e.ts index 42b4868..0026d90 100644 --- a/verify/stages/e2e.ts +++ b/verify/stages/e2e.ts @@ -7,7 +7,7 @@ const stage: Stage = { run({sh}) { // E2E_TARGET=android-bare|ios-bare runs one target (CI runs one per job) const target = process.env.E2E_TARGET ? ['--target', process.env.E2E_TARGET] : []; - // Device runs compare to the reviewed .js files until Tasks 24/25: never --update them from a device. + // Device runs compare to the reviewed expected files: never --update them from a device. const update = process.env.VERIFY_UPDATE; delete process.env.VERIFY_UPDATE; try { From 78482b19a4537be8f05306744729b5a6db8b0d10 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 04:00:24 +0100 Subject: [PATCH 37/76] fix(android,metro): expose the otel API, keep the package out of inline requires, flush on IO - android: api opentelemetry-api (+ BOM): RNOtel exposes Tracer/Span/Context; example calls RNOtel.tracer as a compile check. - metro: withOtel adds react-native-open-telemetry to transform.nonInlinedRequires, so a platform-dead use cannot drop the package (and setup) from a release graph; the example's App.tsx workaround is gone. - HybridOtel.flush blocks on Dispatchers.IO, not Default. - harness: ponytail note on the log helpers kept for Task 27. Co-Authored-By: Claude Opus 5.5 --- android/build.gradle | 4 +++- .../nitro/callstack/otel/HybridOtel.kt | 8 +++++-- example/App.tsx | 3 --- .../opentelemetry/example/MainApplication.kt | 2 ++ example/src/ScenariosScreen.tsx | 2 +- metro/__tests__/withOtel.test.js | 13 +++++++++++ metro/index.js | 22 ++++++++++++++++++- verify/e2e/harness.ts | 1 + 8 files changed, 47 insertions(+), 8 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index e599593..2fc3cb9 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -106,7 +106,9 @@ dependencies { // ProcessLifecycleOwner: background flush on ON_STOP (same version React Native already resolves) implementation "androidx.lifecycle:lifecycle-process:2.6.2" - implementation platform("io.opentelemetry:opentelemetry-bom:1.68.0") + // RNOtel's public signatures expose Tracer, Span and Context: the API is part of ours + api platform("io.opentelemetry:opentelemetry-bom:1.68.0") + api "io.opentelemetry:opentelemetry-api" implementation "io.opentelemetry:opentelemetry-sdk" // The OkHttp sender runs on React Native's own OkHttp (every okhttp3 member the 1.68 sender uses exists in 4.9.2); // excluding it keeps otel-java from pulling the app up to OkHttp 5. diff --git a/android/src/main/java/com/margelo/nitro/callstack/otel/HybridOtel.kt b/android/src/main/java/com/margelo/nitro/callstack/otel/HybridOtel.kt index 3fc6f47..3566ca2 100644 --- a/android/src/main/java/com/margelo/nitro/callstack/otel/HybridOtel.kt +++ b/android/src/main/java/com/margelo/nitro/callstack/otel/HybridOtel.kt @@ -7,6 +7,8 @@ import com.callstack.otel.core.HrTime import com.callstack.otel.core.OtelCore import com.facebook.proguard.annotations.DoNotStrip import com.margelo.nitro.core.Promise +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers import com.callstack.otel.core.AttrValue as CoreValue import com.callstack.otel.core.SeamAttribute as CoreAttribute import com.callstack.otel.core.SeamEvent as CoreEvent @@ -39,12 +41,14 @@ class HybridOtel : HybridOtelSpec() { OtelCore.instance?.handOff(spans.map(::span)) } - // Off the JS and main threads; resolves even when native never initialized. - override fun flush(timeoutMs: Double): Promise = Promise.async { + // Off the JS and main threads (the join blocks, so on IO); resolves even when native never initialized. + override fun flush(timeoutMs: Double): Promise = Promise.async(io) { OtelCore.instance?.flush(timeoutMs.toLong()) Unit } + private val io = CoroutineScope(Dispatchers.IO) + private fun span(s: SeamSpan) = CoreSpan( context = ctx(s.context), parentSpanId = s.parentSpanId, diff --git a/example/App.tsx b/example/App.tsx index 11d39bc..1e5249c 100644 --- a/example/App.tsx +++ b/example/App.tsx @@ -1,6 +1,3 @@ -// The package entry imports its setup (context patch), which withOtel runs before the app. A bare import in its own -// module: with inline requires, release Metro drops ScenariosScreen's import on iOS, where its only use is dead code. -import 'react-native-open-telemetry'; import {ScenariosScreen} from './src/ScenariosScreen'; export default function App() { diff --git a/example/android/app/src/main/java/opentelemetry/example/MainApplication.kt b/example/android/app/src/main/java/opentelemetry/example/MainApplication.kt index 3cb8fe8..2cdb03d 100644 --- a/example/android/app/src/main/java/opentelemetry/example/MainApplication.kt +++ b/example/android/app/src/main/java/opentelemetry/example/MainApplication.kt @@ -31,6 +31,8 @@ class MainApplication : Application(), ReactApplication { headers = mapOf("x-api-key" to "test") // asserted by verify/e2e/export-headers.e2e.ts } } + // compile check: the otel API is part of RNOtel's public surface (a no-op tracer is cheap to build) + RNOtel.tracer("opentelemetry.example") loadReactNative(this) } } diff --git a/example/src/ScenariosScreen.tsx b/example/src/ScenariosScreen.tsx index ce54da7..babb4d3 100644 --- a/example/src/ScenariosScreen.tsx +++ b/example/src/ScenariosScreen.tsx @@ -3,7 +3,7 @@ import {Platform, Pressable, ScrollView, StyleSheet, Text, View} from 'react-nat import {resourceFromAttributes} from '@opentelemetry/resources'; import {SimpleSpanProcessor, TracerProvider} from '@opentelemetry/sdk-trace'; import {OTLPTraceExporter} from '@opentelemetry/exporter-trace-otlp-proto'; -// the package's entry imports its setup (context patch); App.tsx keeps it in the graph on iOS too +// the package's entry imports its setup (context patch); withOtel keeps this import out of inline requires import {startReactNativeSdk} from 'react-native-open-telemetry'; import {getOtel} from '../../src/native/otel'; import {sequentialIds} from '../../src/internal/testMode'; diff --git a/metro/__tests__/withOtel.test.js b/metro/__tests__/withOtel.test.js index 85d520f..b29b1f2 100644 --- a/metro/__tests__/withOtel.test.js +++ b/metro/__tests__/withOtel.test.js @@ -22,3 +22,16 @@ test('is idempotent when applied twice', () => { const once = withOtel(base, {setupPath: SETUP}); expect(run(withOtel(once, {setupPath: SETUP}))).toEqual([CORE, SETUP]); }); + +test('keeps the package out of inline requires, after the existing entries', async () => { + const cfg = { + ...base, + transformer: { + getTransformOptions: async () => ({transform: {inlineRequires: true, nonInlinedRequires: ['React']}, x: 1}), + }, + }; + const out = await withOtel(cfg, {setupPath: SETUP}).transformer.getTransformOptions([], {}, () => []); + expect(out).toEqual({transform: {inlineRequires: true, nonInlinedRequires: ['React', 'react-native-open-telemetry']}, x: 1}); + const bare = await withOtel(base, {setupPath: SETUP}).transformer.getTransformOptions([], {}, () => []); + expect(bare.transform.nonInlinedRequires).toEqual(['react-native-open-telemetry']); +}); diff --git a/metro/index.js b/metro/index.js index 986b55e..dc1d49a 100644 --- a/metro/index.js +++ b/metro/index.js @@ -1,7 +1,12 @@ +const PACKAGE = 'react-native-open-telemetry'; + /** * Metro helper: runs the SDK's setup (context patch) before the app. * Appending to `getModulesRunBeforeMainModule` puts it after RN's InitializeCore and before any app module. * Metro only runs such an entry if it is already in the bundle graph; `src/index.ts` imports `./setup` for that. + * The package is also excluded from inline requires (`nonInlinedRequires`): an inlined import whose only use is + * platform-dead code (e.g. inside `Platform.OS === 'android'` on iOS) would otherwise drop the package, and setup, + * from a release graph. */ function withOtel(config, {setupPath = require.resolve('react-native-open-telemetry/setup')} = {}) { const serializer = config.serializer ?? {}; @@ -12,7 +17,22 @@ function withOtel(config, {setupPath = require.resolve('react-native-open-teleme return list.includes(setupPath) ? list : [...list, setupPath]; }; wrapped.__withOtel = true; - return {...config, serializer: {...serializer, getModulesRunBeforeMainModule: wrapped}}; + + const transformer = config.transformer ?? {}; + const getTransformOptions = transformer.getTransformOptions ?? (async () => ({})); + const transformOptions = async (...args) => { + const opts = (await getTransformOptions(...args)) ?? {}; + const keep = opts.transform?.nonInlinedRequires ?? []; + return { + ...opts, + transform: {...opts.transform, nonInlinedRequires: keep.includes(PACKAGE) ? keep : [...keep, PACKAGE]}, + }; + }; + return { + ...config, + serializer: {...serializer, getModulesRunBeforeMainModule: wrapped}, + transformer: {...transformer, getTransformOptions: transformOptions}, + }; } module.exports = {withOtel}; diff --git a/verify/e2e/harness.ts b/verify/e2e/harness.ts index 256756c..54130cb 100644 --- a/verify/e2e/harness.ts +++ b/verify/e2e/harness.ts @@ -76,6 +76,7 @@ export async function expectScenario( if (!r.ok) throw new Error('\n' + r.report); } +// ponytail: clearDeviceLog/deviceLog are unused since the tracer bullet retired (R14); Task 27 reads device logs with them. // iOS: `log show` takes ~60 s per call on a CI runner, so lines are captured live by a `log stream` started in clearDeviceLog. const iosStreams = new Map(); From 9b822cd6bc39917ba350ad4732a460353a625d25 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 04:23:10 +0100 Subject: [PATCH 38/76] test(verify): device-drafted ios files for nest-raf and event-emitter-listener (R1) Co-Authored-By: Claude Opus 5.5 --- .../event-emitter-listener.ios.otlp.json | 44 +++++++++++++++++++ verify/expected/nest-raf.ios.otlp.json | 44 +++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 verify/expected/event-emitter-listener.ios.otlp.json create mode 100644 verify/expected/nest-raf.ios.otlp.json diff --git a/verify/expected/event-emitter-listener.ios.otlp.json b/verify/expected/event-emitter-listener.ios.otlp.json new file mode 100644 index 0000000..2dfddfc --- /dev/null +++ b/verify/expected/event-emitter-listener.ios.otlp.json @@ -0,0 +1,44 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "emit", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000019968", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "listener", + "kind": 1, + "startTimeUnixNano": "1767225600000009984", + "endTimeUnixNano": "1767225600000011008", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/nest-raf.ios.otlp.json b/verify/expected/nest-raf.ios.otlp.json new file mode 100644 index 0000000..c247a10 --- /dev/null +++ b/verify/expected/nest-raf.ios.otlp.json @@ -0,0 +1,44 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000019968", + "status": {} + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "frame", + "kind": 1, + "startTimeUnixNano": "1767225600000009984", + "endTimeUnixNano": "1767225600000011008", + "status": {} + } + ] + } + ] + } + ] +} From 2a80d7f5f54c27661789ececd303e97e7047cd66 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 04:23:14 +0100 Subject: [PATCH 39/76] feat(ios): Nitro adapter and native-first init Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 2 +- Package.swift | 2 +- ReactNativeOpenTelemetry.podspec | 47 ++++++++------- ReactNativeOpenTelemetryCore.podspec | 37 ++++++++++++ .../OpenTelemetryExample/AppDelegate.swift | 11 +++- example/ios/Podfile | 2 + example/ios/Podfile.lock | 12 +++- example/src/ScenariosScreen.tsx | 34 ++--------- ios/Adapter/HybridOtel.swift | 60 +++++++++++++------ ios/Core/CoreConfig.swift | 15 +++-- ios/Core/OtelCore.swift | 10 ++-- ios/Core/SeamModel.swift | 41 +++++++++---- ios/RNOtel/RNOtel.swift | 59 ++++++++++++++++++ ios/RNOtel/RNOtelConfig.swift | 22 +++++++ package.json | 1 + verify/VERIFY.md | 18 ++++-- verify/e2e/harness.ts | 9 ++- verify/scenarios/export-headers.ts | 2 +- verify/stages/static.ts | 6 +- verify/static/packContents.test.ts | 2 +- verify/static/packContents.ts | 2 +- 21 files changed, 286 insertions(+), 108 deletions(-) create mode 100644 ReactNativeOpenTelemetryCore.podspec create mode 100644 ios/RNOtel/RNOtel.swift create mode 100644 ios/RNOtel/RNOtelConfig.swift diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9925a3..393b896 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -186,7 +186,7 @@ jobs: path: | example/ios/Pods example/ios/build/Build - key: ios-native-${{ hashFiles('ios/**', 'nitrogen/**', 'ReactNativeOpenTelemetry.podspec', 'example/ios/Podfile', 'example/ios/Podfile.lock', 'example/ios/OpenTelemetryExample/**', 'example/ios/OpenTelemetryExample.xcodeproj/**', 'bun.lock', 'example/bun.lock') }} + key: ios-native-${{ hashFiles('ios/**', 'nitrogen/**', 'ReactNativeOpenTelemetry.podspec', 'ReactNativeOpenTelemetryCore.podspec', 'example/ios/Podfile', 'example/ios/Podfile.lock', 'example/ios/OpenTelemetryExample/**', 'example/ios/OpenTelemetryExample.xcodeproj/**', 'bun.lock', 'example/bun.lock') }} - name: pod install (test mode) working-directory: example/ios env: diff --git a/Package.swift b/Package.swift index 4f87969..56b99c0 100644 --- a/Package.swift +++ b/Package.swift @@ -1,6 +1,6 @@ // swift-tools-version:6.0 // The pure Swift core (ios/Core) and its tests, for `swift test` on the host (`bun verify fast-swift`). -// Apps never use this: CocoaPods builds ios/Core from the podspec, with the same opentelemetry-swift versions. +// Apps never use this: CocoaPods builds ios/Core from ReactNativeOpenTelemetryCore.podspec, with the same opentelemetry-swift versions. import Foundation import PackageDescription diff --git a/ReactNativeOpenTelemetry.podspec b/ReactNativeOpenTelemetry.podspec index 85d382e..ae44dfd 100644 --- a/ReactNativeOpenTelemetry.podspec +++ b/ReactNativeOpenTelemetry.podspec @@ -2,6 +2,7 @@ require "json" package = JSON.parse(File.read(File.join(__dir__, "package.json"))) +# The Nitro adapter (Swift with C++ interop) over the pure Swift core pod (R24, spec §4.2). Pod::Spec.new do |s| s.name = "ReactNativeOpenTelemetry" s.version = package["version"] @@ -13,32 +14,36 @@ Pod::Spec.new do |s| s.platforms = { :ios => min_ios_version_supported } s.source = { :git => "https://github.com/callstack/react-native-open-telemetry.git", :tag => "#{s.version}" } - s.source_files = [ - "ios/Core/**/*.swift", - "ios/Adapter/**/*.swift", - ] - - # Test mode is a build flag, never API: `OTEL_TEST_MODE=1 pod install`. - if ENV['OTEL_TEST_MODE'] == '1' - s.pod_target_xcconfig = { - 'SWIFT_ACTIVE_COMPILATION_CONDITIONS' => '$(inherited) OTEL_TEST_MODE', - } - end + s.source_files = ["ios/Adapter/**/*.swift"] + + # The core pod uses spm_dependency, so in a static-library build React Native's spm.rb builds it straight into the + # products root, and rewrites the app's module map path to match, but not this pod's: CocoaPods still points it at + # `/ReactNativeOpenTelemetryCore/ReactNativeOpenTelemetryCore.modulemap`. Forward that path to the real map, and + # search the root for the core's swiftmodule. Unused (and harmless) with frameworks. + # ponytail: drop when RN's spm.rb rewrites pod-target xcconfigs too. + core_map = '${PODS_CONFIGURATION_BUILD_DIR}/ReactNativeOpenTelemetryCore/ReactNativeOpenTelemetryCore.modulemap' + s.script_phase = { + :name => 'Forward the core module map', + :execution_position => :before_compile, + :output_files => [core_map], + :script => %Q{set -e +if [ -f "${PODS_CONFIGURATION_BUILD_DIR}/ReactNativeOpenTelemetryCore.modulemap" ]; then + mkdir -p "${PODS_CONFIGURATION_BUILD_DIR}/ReactNativeOpenTelemetryCore" + echo 'extern module ReactNativeOpenTelemetryCore "../ReactNativeOpenTelemetryCore.modulemap"' > "#{core_map}" +fi +}, + } + s.pod_target_xcconfig = { + # `package` declarations of the core are shared through one Swift package name. + 'OTHER_SWIFT_FLAGS' => '$(inherited) -package-name ReactNativeOpenTelemetry', + 'SWIFT_INCLUDE_PATHS' => '$(inherited) "${PODS_CONFIGURATION_BUILD_DIR}"', + } # Adds nitrogen/generated/ios/** and nitrogen/generated/shared/**. load 'nitrogen/generated/ios/ReactNativeOpenTelemetry+autolinking.rb' add_nitrogen_files(s) - # opentelemetry-swift 2.6 moved OpenTelemetryApi/OpenTelemetrySdk into opentelemetry-swift-core. - spm_dependency(s, - url: 'https://github.com/open-telemetry/opentelemetry-swift', - requirement: { kind: 'upToNextMinorVersion', minimumVersion: '2.6.0' }, - products: ['OpenTelemetryProtocolExporterHTTP']) - spm_dependency(s, - url: 'https://github.com/open-telemetry/opentelemetry-swift-core', - requirement: { kind: 'upToNextMinorVersion', minimumVersion: '2.6.0' }, - products: ['OpenTelemetrySdk']) - + s.dependency 'ReactNativeOpenTelemetryCore', s.version.to_s s.dependency 'React-jsi' s.dependency 'React-callinvoker' install_modules_dependencies(s) diff --git a/ReactNativeOpenTelemetryCore.podspec b/ReactNativeOpenTelemetryCore.podspec new file mode 100644 index 0000000..f206f85 --- /dev/null +++ b/ReactNativeOpenTelemetryCore.podspec @@ -0,0 +1,37 @@ +require "json" + +package = JSON.parse(File.read(File.join(__dir__, "package.json"))) + +# Pure Swift (R24): the core and the public `RNOtel` API, no Nitro and no C++ interop, so an app's Swift +# `AppDelegate` can `import ReactNativeOpenTelemetryCore`. The Nitro adapter pod (ReactNativeOpenTelemetry) depends on it. +# Autolinking links one podspec per package: apps add `pod 'ReactNativeOpenTelemetryCore', :path => ''`. +Pod::Spec.new do |s| + s.name = "ReactNativeOpenTelemetryCore" + s.version = package["version"] + s.summary = package["description"] + s.homepage = package["homepage"] + s.license = package["license"] + s.authors = package["author"] + + s.platforms = { :ios => min_ios_version_supported } + s.source = { :git => "https://github.com/callstack/react-native-open-telemetry.git", :tag => "#{s.version}" } + s.swift_version = "5.0" + + s.source_files = ["ios/Core/**/*.swift", "ios/RNOtel/**/*.swift"] + + # `package` declarations are shared with the adapter pod through one Swift package name. + # Test mode is a build flag, never API: `OTEL_TEST_MODE=1 pod install`. + s.pod_target_xcconfig = { + 'OTHER_SWIFT_FLAGS' => '$(inherited) -package-name ReactNativeOpenTelemetry', + }.merge(ENV['OTEL_TEST_MODE'] == '1' ? { 'SWIFT_ACTIVE_COMPILATION_CONDITIONS' => '$(inherited) OTEL_TEST_MODE' } : {}) + + # opentelemetry-swift 2.6 moved OpenTelemetryApi/OpenTelemetrySdk into opentelemetry-swift-core. + spm_dependency(s, + url: 'https://github.com/open-telemetry/opentelemetry-swift', + requirement: { kind: 'upToNextMinorVersion', minimumVersion: '2.6.0' }, + products: ['OpenTelemetryProtocolExporterHTTP']) + spm_dependency(s, + url: 'https://github.com/open-telemetry/opentelemetry-swift-core', + requirement: { kind: 'upToNextMinorVersion', minimumVersion: '2.6.0' }, + products: ['OpenTelemetrySdk']) +end diff --git a/example/ios/OpenTelemetryExample/AppDelegate.swift b/example/ios/OpenTelemetryExample/AppDelegate.swift index 0d14d1b..9bfb51c 100644 --- a/example/ios/OpenTelemetryExample/AppDelegate.swift +++ b/example/ios/OpenTelemetryExample/AppDelegate.swift @@ -1,3 +1,4 @@ +import ReactNativeOpenTelemetryCore import UIKit @main @@ -6,6 +7,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate { _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil ) -> Bool { - true + // Native-first init, before React Native. No serviceVersion: the test-mode resource is service.name only (R2). + RNOtel.start { c in + c.serviceName = "verify" + // the e2e collector on the host; asserted by verify/e2e/export-headers.e2e.ts + c.export = .init(url: "http://localhost:4318", headers: ["x-api-key": "test"]) + } + // compile check: the otel API is part of RNOtel's public surface (a no-op tracer is cheap to build) + _ = RNOtel.tracer("opentelemetry.example") + return true } } diff --git a/example/ios/Podfile b/example/ios/Podfile index f65d77c..e4516bc 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -15,6 +15,8 @@ if linkage != nil end target 'OpenTelemetryExample' do + # Autolinking links only the Nitro pod; the pure Swift core pod (RNOtel, imported by AppDelegate) is declared here (R24). + pod 'ReactNativeOpenTelemetryCore', :path => '../..' config = use_native_modules! use_react_native!( diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index ebfde5b..046b674 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1789,7 +1789,9 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/core - ReactNativeDependencies + - ReactNativeOpenTelemetryCore (= 0.2.0) - Yoga + - ReactNativeOpenTelemetryCore (0.2.0) - SocketRocket (0.7.1): - ReactNativeDependencies - Yoga (0.0.0): @@ -1883,6 +1885,7 @@ DEPENDENCIES: - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) - ReactNativeDependencies (from `../node_modules/react-native/third-party-podspecs/ReactNativeDependencies.podspec`) - ReactNativeOpenTelemetry (from `../..`) + - ReactNativeOpenTelemetryCore (from `../..`) - SocketRocket (from `build/rndeps-facades/SocketRocket`) - Yoga (from `build/rncore-facades/Yoga`) @@ -2060,6 +2063,8 @@ EXTERNAL SOURCES: :podspec: "../node_modules/react-native/third-party-podspecs/ReactNativeDependencies.podspec" ReactNativeOpenTelemetry: :path: "../.." + ReactNativeOpenTelemetryCore: + :path: "../.." SocketRocket: :path: build/rndeps-facades/SocketRocket Yoga: @@ -2151,10 +2156,11 @@ SPEC CHECKSUMS: ReactCodegen: 3840312f5071bb6b953b35a029c5c6dcf06b435e ReactCommon: b63ce798b898ed77c6cfdeb80b18080161f52ed5 ReactNativeDependencies: a5164c3ebbe90d992022b5d9cbabbf770a6d7d05 - ReactNativeOpenTelemetry: 41460d3f8f1e8fd6922cb815c46fb80c4843bd03 + ReactNativeOpenTelemetry: cfbb4c9c5603eb925f23e6e601f21d0a41cb7271 + ReactNativeOpenTelemetryCore: b9b1d5e27b1df7d86e4937554d2c9152e85df541 SocketRocket: 37aec555668fb852ec12e3c0de59a86ca58f0871 Yoga: d1c536142c5ff8ec8cd856ab2a7c227a1d875c8e -PODFILE CHECKSUM: 2f80b8c0e897d23dcb020369108758aff0cbef0e +PODFILE CHECKSUM: f0b2481a774a2b77e95776068d1d26bc682a7ba6 -COCOAPODS: 1.17.0 +COCOAPODS: 1.16.2 diff --git a/example/src/ScenariosScreen.tsx b/example/src/ScenariosScreen.tsx index babb4d3..3d36da2 100644 --- a/example/src/ScenariosScreen.tsx +++ b/example/src/ScenariosScreen.tsx @@ -1,41 +1,17 @@ import {useEffect, useState} from 'react'; -import {Platform, Pressable, ScrollView, StyleSheet, Text, View} from 'react-native'; -import {resourceFromAttributes} from '@opentelemetry/resources'; -import {SimpleSpanProcessor, TracerProvider} from '@opentelemetry/sdk-trace'; -import {OTLPTraceExporter} from '@opentelemetry/exporter-trace-otlp-proto'; +import {Pressable, ScrollView, StyleSheet, Text, View} from 'react-native'; // the package's entry imports its setup (context patch); withOtel keeps this import out of inline requires import {startReactNativeSdk} from 'react-native-open-telemetry'; import {getOtel} from '../../src/native/otel'; -import {sequentialIds} from '../../src/internal/testMode'; import {at} from '../../verify/harness/scenario'; import {allScenarios} from '../../verify/scenarios'; -/** Must match COLLECTOR_PORT in verify/e2e/harness.ts. */ -const COLLECTOR_PORT = 4318; -const COLLECTOR = `http://${Platform.OS === 'android' ? '10.0.2.2' : 'localhost'}:${COLLECTOR_PORT}`; - +// Native-first: MainApplication / AppDelegate ran RNOtel.start (collector URL there); attach and export through the native core. async function runScenario(name: string) { const s = allScenarios().find(x => x.name === name)!; - // Android: native-first (MainApplication ran RNOtel.start); attach and export through the native core. - // ponytail: iOS stays JS-direct until Task 25 (R13), then this branch becomes the only path. - if (Platform.OS === 'android') { - const sdk = startReactNativeSdk(); - await s.run({tracer: sdk.tracerProvider.getTracer('verify'), getTracer: (n, v, o) => sdk.tracerProvider.getTracer(n, v, o), at}); - await sdk.forceFlush(); - return; - } - // JS-direct export, the same provider setup as verify/jest/scenarios.test.ts. - const provider = new TracerProvider({ - idGenerator: sequentialIds('0a'), - resource: resourceFromAttributes({'service.name': 'verify'}), - spanProcessors: [new SimpleSpanProcessor({exporter: new OTLPTraceExporter({url: `${COLLECTOR}/v1/traces`})})], - }); - try { - await s.run({tracer: provider.getTracer('verify'), getTracer: (n, v, o) => provider.getTracer(n, v, o), at}); - await provider.forceFlush(); - } finally { - await provider.shutdown(); - } + const sdk = startReactNativeSdk(); + await s.run({tracer: sdk.tracerProvider.getTracer('verify'), getTracer: (n, v, o) => sdk.tracerProvider.getTracer(n, v, o), at}); + await sdk.forceFlush(); } export function ScenariosScreen() { diff --git a/ios/Adapter/HybridOtel.swift b/ios/Adapter/HybridOtel.swift index f50beea..07ca847 100644 --- a/ios/Adapter/HybridOtel.swift +++ b/ios/Adapter/HybridOtel.swift @@ -1,30 +1,56 @@ import Foundation import NitroModules -import OpenTelemetryProtocolExporterHttp -import OpenTelemetrySdk +import ReactNativeOpenTelemetryCore -/// Tracer-bullet stub (Task 7): proves the seam and the opentelemetry-swift link; the real adapter is Task 25. +/// The seam, mapped 1:1 onto the Swift core (pod `ReactNativeOpenTelemetryCore`, R24). class HybridOtel: HybridOtelSpec { func initialize(config: SeamConfig?) throws -> SeamInitResult { - // Touch opentelemetry-swift so a broken package link fails here, not in Task 25. - OtlpHttpTraceExporter().shutdown() - #if OTEL_TEST_MODE - let testMode = true - #else - let testMode = false - #endif - return SeamInitResult(alreadyInitialized: false, testMode: testMode, error: nil) + let r = RNOtel.initialize(config.map { + CoreConfig(serviceName: $0.serviceName, serviceVersion: $0.serviceVersion, + resourceAttributes: attrs($0.resourceAttributes), exportUrl: $0.exportUrl, + exportHeaders: Dictionary($0.exportHeaders.compactMap { h in h.value.asType(String.self).map { (h.key, $0) } }, + uniquingKeysWith: { _, last in last })) + }) + return SeamInitResult(alreadyInitialized: r.alreadyInitialized, testMode: r.testMode, error: r.error) } + /// JS thread: copy the structs and enqueue; SpanData is built on the export queue. func handOff(spans: [SeamSpan]) throws { - let attrs = spans.reduce(0) { $0 + $1.attributes.count } - let events = spans.reduce(0) { $0 + $1.events.count } - let links = spans.reduce(0) { $0 + $1.links.count } - // integer arguments only: a %@ string is redacted as in the unified log on a runner without developer logging - NSLog("RNOtel handOff spans=%ld attrs=%ld events=%ld links=%ld", spans.count, attrs, events, links) + OtelCore.instance?.handOff(spans.map(span)) } + /// Off the JS thread (the flush blocks a global queue); resolves even when native never initialized. func flush(timeoutMs: Double) throws -> Promise { - return Promise.resolved() + Promise.parallel { _ = OtelCore.instance?.flush(timeoutMs: timeoutMs) } + } + + private func span(_ s: SeamSpan) -> CoreSpan { + CoreSpan(context: ctx(s.context), parentSpanId: s.parentSpanId, name: s.name, kind: int(s.kind), + start: HrTime(s.start), end: HrTime(s.end), attributes: attrs(s.attributes), + events: s.events.map { CoreEvent(name: $0.name, time: HrTime($0.time), attributes: attrs($0.attributes)) }, + links: s.links.map { CoreLink(context: ctx($0.context), attributes: attrs($0.attributes)) }, + status: CoreStatus(code: int(s.status.code), message: s.status.message), + scope: CoreScope(name: s.scope.name, version: s.scope.version, schemaUrl: s.scope.schemaUrl, + attributes: attrs(s.scope.attributes))) + } + + private func ctx(_ c: SeamSpanContext) -> CoreSpanContext { + CoreSpanContext(traceId: c.traceId, spanId: c.spanId, traceFlags: int(c.traceFlags), traceState: c.traceState) + } + + /// Never traps on the JS thread (Int(Double) does on NaN or out of range). + private func int(_ d: Double) -> Int { Int(exactly: d.rounded(.towardZero)) ?? 0 } + + private func attrs(_ a: [SeamAttribute]) -> [CoreAttribute] { a.map { CoreAttribute(key: $0.key, value: value($0.value)) } } + + private func value(_ v: AttrValue) -> CoreValue { + switch v { + case let .first(b): return .bool(b) + case let .second(b): return .bools(b) + case let .third(s): return .strings(s) + case let .fourth(n): return .numbers(n) + case let .fifth(s): return .string(s) + case let .sixth(n): return .number(n) + } } } diff --git a/ios/Core/CoreConfig.swift b/ios/Core/CoreConfig.swift index 2817ea2..b5ce3dd 100644 --- a/ios/Core/CoreConfig.swift +++ b/ios/Core/CoreConfig.swift @@ -1,15 +1,20 @@ -struct CoreConfig { +package struct CoreConfig { var serviceName: String var serviceVersion: String? = nil var resourceAttributes: [CoreAttribute] = [] /// Base URL; see `tracesUrl`. var exportUrl: String var exportHeaders: [String: String] = [:] + package init(serviceName: String, serviceVersion: String? = nil, resourceAttributes: [CoreAttribute] = [], + exportUrl: String, exportHeaders: [String: String] = [:]) { + self.serviceName = serviceName; self.serviceVersion = serviceVersion; self.resourceAttributes = resourceAttributes + self.exportUrl = exportUrl; self.exportHeaders = exportHeaders + } } /// Mirrors the seam's `SeamInitResult`. -struct InitResult: Equatable { - var alreadyInitialized: Bool - var testMode: Bool - var error: String? = nil +package struct InitResult: Equatable { + package var alreadyInitialized: Bool + package var testMode: Bool + package var error: String? = nil } diff --git a/ios/Core/OtelCore.swift b/ios/Core/OtelCore.swift index d797217..2e2ff7d 100644 --- a/ios/Core/OtelCore.swift +++ b/ios/Core/OtelCore.swift @@ -36,7 +36,7 @@ private final class LazyExporter: SpanExporter, @unchecked Sendable { func shutdown(explicitTimeout: TimeInterval?) async { await d?.shutdown(explicitTimeout: explicitTimeout) } } -final class OtelCore { +package final class OtelCore { /// The one resource of the app; in test mode built from config only (no `telemetry.*`). let resource: Resource /// The native TracerProvider; JS spans join its batch processor. @@ -67,7 +67,7 @@ final class OtelCore { } /// JS-thread work: wrap and enqueue only; SpanData is built on the export queue. - func handOff(_ spans: [CoreSpan]) { + package func handOff(_ spans: [CoreSpan]) { for s in spans { bsp.onEnd(span: JsReadableSpan(s, resource: resource)) } } @@ -76,7 +76,7 @@ final class OtelCore { // ponytail: upstream BatchWorker race: if its timer thread has just taken the queue but not yet scheduled the // export, forceFlush finds nothing and returns before that batch is sent (true while in flight). TracerProviderSdk // forceFlush goes through the same worker; fix upstream or track in-flight spans if flush-after-reload needs it. - func flush(timeoutMs: Double) -> Bool { + package func flush(timeoutMs: Double) -> Bool { let deadline = Date().addingTimeInterval(timeoutMs / 1000) bsp.forceFlush(timeout: timeoutMs / 1000) return exporter.flush(explicitTimeout: max(deadline.timeIntervalSinceNow, 0.001)) == .success @@ -84,12 +84,12 @@ final class OtelCore { private static let lock = NSLock() private static var state: InitResult? - private(set) static var instance: OtelCore? + package private(set) static var instance: OtelCore? /// Idempotent. The first result sticks, a failed one too (R16): later calls never retry. A call without config /// before any init is an error but is not remembered, so the real init can still follow. @discardableResult - static func initialize(_ config: CoreConfig?, testMode: Bool = false, distroVersion: String = "unknown") -> InitResult { + package static func initialize(_ config: CoreConfig?, testMode: Bool = false, distroVersion: String = "unknown") -> InitResult { lock.withLock { if var s = state { s.alreadyInitialized = true; return s } guard let config else { return InitResult(alreadyInitialized: false, testMode: testMode, error: "not initialized: no config") } diff --git a/ios/Core/SeamModel.swift b/ios/Core/SeamModel.swift index a1a29a6..6f5d957 100644 --- a/ios/Core/SeamModel.swift +++ b/ios/Core/SeamModel.swift @@ -1,15 +1,16 @@ import Foundation // Mirrors the Nitro seam (src/native/Otel.nitro.ts) without Nitro types; the iOS adapter converts. -// `Core` prefix: ios/Core and the generated Seam* structs share one module in the pod. +// `package` access: the adapter pod (ReactNativeOpenTelemetry, Nitro) builds these across modules (R24); apps never see +// them. Swift synthesizes only internal memberwise initializers, hence the explicit ones. /// OTel HrTime `[seconds, nanos]`. -struct HrTime { +package struct HrTime { let seconds: Double let nanos: Double /// Never traps on the JS thread: missing elements read as 0 (C4). - init(_ a: [Double]) { + package init(_ a: [Double]) { seconds = a.count > 0 ? a[0] : 0 nanos = a.count > 1 ? a[1] : 0 } @@ -18,7 +19,7 @@ struct HrTime { var date: Date { Date(timeIntervalSince1970: seconds + nanos / 1e9) } } -enum CoreValue { +package enum CoreValue { case string(String) case bool(Bool) case number(Double) @@ -27,42 +28,54 @@ enum CoreValue { case numbers([Double]) } -struct CoreAttribute { +package struct CoreAttribute { let key: String let value: CoreValue + package init(key: String, value: CoreValue) { self.key = key; self.value = value } } -struct CoreSpanContext { +package struct CoreSpanContext { let traceId: String let spanId: String let traceFlags: Int var traceState: String? = nil + package init(traceId: String, spanId: String, traceFlags: Int, traceState: String? = nil) { + self.traceId = traceId; self.spanId = spanId; self.traceFlags = traceFlags; self.traceState = traceState + } } -struct CoreEvent { +package struct CoreEvent { let name: String let time: HrTime let attributes: [CoreAttribute] + package init(name: String, time: HrTime, attributes: [CoreAttribute]) { + self.name = name; self.time = time; self.attributes = attributes + } } -struct CoreLink { +package struct CoreLink { let context: CoreSpanContext let attributes: [CoreAttribute] + package init(context: CoreSpanContext, attributes: [CoreAttribute]) { self.context = context; self.attributes = attributes } } -struct CoreScope { +package struct CoreScope { let name: String let version: String? let schemaUrl: String? let attributes: [CoreAttribute] + package init(name: String, version: String?, schemaUrl: String?, attributes: [CoreAttribute]) { + self.name = name; self.version = version; self.schemaUrl = schemaUrl; self.attributes = attributes + } } -struct CoreStatus { +package struct CoreStatus { let code: Int let message: String? + package init(code: Int, message: String?) { self.code = code; self.message = message } } -struct CoreSpan { +package struct CoreSpan { let context: CoreSpanContext let parentSpanId: String? let name: String @@ -75,4 +88,10 @@ struct CoreSpan { let links: [CoreLink] let status: CoreStatus let scope: CoreScope + package init(context: CoreSpanContext, parentSpanId: String?, name: String, kind: Int, start: HrTime, end: HrTime, + attributes: [CoreAttribute], events: [CoreEvent], links: [CoreLink], status: CoreStatus, scope: CoreScope) { + self.context = context; self.parentSpanId = parentSpanId; self.name = name; self.kind = kind; self.start = start + self.end = end; self.attributes = attributes; self.events = events; self.links = links; self.status = status + self.scope = scope + } } diff --git a/ios/RNOtel/RNOtel.swift b/ios/RNOtel/RNOtel.swift new file mode 100644 index 0000000..13f5d25 --- /dev/null +++ b/ios/RNOtel/RNOtel.swift @@ -0,0 +1,59 @@ +import Foundation +import OpenTelemetryApi +import UIKit + +/// `package.json` version, reported as `telemetry.distro.version`; the static stage checks it matches. +let packageVersion = "0.2.0" + +/// Public native API (spec §4.3/§4.4). Test mode comes from the build (`OTEL_TEST_MODE=1 pod install`), never from here. +public enum RNOtel { + #if OTEL_TEST_MODE + static let testMode = true + #else + static let testMode = false + #endif + + /// Native-first init from `AppDelegate`, before React Native. Never throws; an error is logged once. + public static func start(_ configure: (RNOtelConfig) -> Void) { + let c = RNOtelConfig() + configure(c) + if let err = initialize(c.toCore()).error { NSLog("RNOtel init failed; telemetry is off: %@", err) } + } + + private static var observer: NSObjectProtocol? + private static let lock = NSLock() + + /// One path for native-first and JS-fallback init. The exporter is built on first export, off the main thread. + package static func initialize(_ config: CoreConfig?) -> InitResult { + let r = OtelCore.initialize(config, testMode: testMode, distroVersion: packageVersion) + if let core = OtelCore.instance { lock.withLock { if observer == nil { observer = flushOnBackground(core) } } } + return r + } + + /// Exports what is queued when the app goes to the background, inside a background task so iOS lets it finish. + /// The flush blocks a global queue, never the main thread. + private static func flushOnBackground(_ core: OtelCore) -> NSObjectProtocol { + NotificationCenter.default.addObserver(forName: UIApplication.didEnterBackgroundNotification, object: nil, queue: .main) { _ in + let app = UIApplication.shared + var task = UIBackgroundTaskIdentifier.invalid + // begin/end/expiration all run on the main thread, so `task` needs no lock + let end = { if task != .invalid { app.endBackgroundTask(task); task = .invalid } } + task = app.beginBackgroundTask(withName: "RNOtel flush", expirationHandler: end) + DispatchQueue.global(qos: .utility).async { + _ = core.flush(timeoutMs: 10_000) + DispatchQueue.main.async(execute: end) + } + } + } + + /// A tracer on the native provider; a no-op tracer before (or without) a successful init. + public static func tracer(_ name: String, version: String? = nil) -> any Tracer { + guard let p = OtelCore.instance?.tracerProvider else { return DefaultTracer.instance } + return p.get(instrumentationName: name, instrumentationVersion: version) + } + + /// W3C traceparent -> explicit, non-remote parent `SpanContext` for `setParent(_:)`; invalid input -> nil (a root). + public static func contextFrom(traceparent: String) -> SpanContext? { ReactNativeOpenTelemetryCore.contextFrom(traceparent: traceparent) } + + public static func traceparentOf(_ span: any Span) -> String { traceparent(of: span.context) } +} diff --git a/ios/RNOtel/RNOtelConfig.swift b/ios/RNOtel/RNOtelConfig.swift new file mode 100644 index 0000000..4b72fa3 --- /dev/null +++ b/ios/RNOtel/RNOtelConfig.swift @@ -0,0 +1,22 @@ +/// Native-first config (spec §4.4): `RNOtel.start { c in c.serviceName = …; c.export = .init(url: …) }`. +public final class RNOtelConfig { + public var serviceName = "" + public var serviceVersion: String? + public var resourceAttributes: [String: String] = [:] + public var export = Export(url: "") + + public struct Export { + /// OTLP base URL; `/v1/traces` is appended unless present. + public var url: String + public var headers: [String: String] + public init(url: String, headers: [String: String] = [:]) { self.url = url; self.headers = headers } + } + + init() {} + + func toCore() -> CoreConfig { + CoreConfig(serviceName: serviceName, serviceVersion: serviceVersion, + resourceAttributes: resourceAttributes.map { CoreAttribute(key: $0.key, value: .string($0.value)) }, + exportUrl: export.url, exportHeaders: export.headers) + } +} diff --git a/package.json b/package.json index 6120707..6fadea7 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "ios", "Package.swift", "ReactNativeOpenTelemetry.podspec", + "ReactNativeOpenTelemetryCore.podspec", "nitro.json", "metro", "vite", diff --git a/verify/VERIFY.md b/verify/VERIFY.md index 078a18f..1c60357 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -39,11 +39,19 @@ it (Xcode scheme, `SIMCTL_CHILD_TRACEPARENT`); the verify stages unset it for na `verify/e2e/scenarios.e2e.ts` runs one test per scenario with runner `e2e`, not `pending`, on each target it lists, except the scenarios with their own e2e file. Each test cold-starts the app (R5). e2e is compare-only; -`VERIFY_E2E_DRAFT=1` writes a **missing** `.js.otlp.json` from the device run and still fails the test +`VERIFY_E2E_DRAFT=1` writes a **missing** `..otlp.json` from the device run and still fails the test ("drafted …, review it"); existing files are never overwritten. Draft runs have no retries, so a drafting run always ends red. -`android-*` targets compare to the `android` files: the bare app inits native first (`RNOtel.start` in -`MainApplication`) and ScenariosScreen exports through `startReactNativeSdk` and the Kotlin core. `ios-*` stays -JS-direct and compares to the `js` files until Task 25 (R13). +Each target compares to its platform's files (`android-*` → `android`, `ios-*` → `ios`): the bare app inits native +first (`RNOtel.start` in `MainApplication` / `AppDelegate`) and ScenariosScreen exports through `startReactNativeSdk` +and the Kotlin or Swift core. + +**iOS pods (R24).** An app's Swift `AppDelegate` cannot `import ReactNativeOpenTelemetry`: the Nitro pod is built with +C++ interop and the app is not (Task 25 Step 0: `'functional' file not found` while building `NitroModules`). So +iOS ships two pods: `ReactNativeOpenTelemetryCore` (pure Swift: `ios/Core` + the public `RNOtel` in `ios/RNOtel`) and +the Nitro adapter `ReactNativeOpenTelemetry` (`ios/Adapter`), which depends on it and reaches the core's `package` +declarations through one `-package-name`. Autolinking links only the adapter, so the app's Podfile adds +`pod 'ReactNativeOpenTelemetryCore', :path => ''`. Both linkages build: the default static libraries +(CI) and `USE_FRAMEWORKS=static` (checked locally in Task 25, not a CI job: e2e `ios-bare` 18/18 on that build). **`performance.timeOrigin` on Hermes (X17, Task 13).** Defined on both platforms (RN 0.88.1 release, Hermes), checked with a one-off `console.log` of `timeOrigin`, `performance.now()` and `Date.now()` at app start: @@ -121,7 +129,7 @@ e2e targets are android, ios and web unless the Runners column names them. | `handoff-basic` | a span crosses the seam intact | 8, 15, 18 | jest, e2e | passing | | `rich-span` | every attribute type, events, links, status, scope survive the seam | 8, 15, 18 | jest, e2e | passing | | `odd-attributes` | NaN, ±Infinity, -0, big ints, empty arrays survive the seam | 8, 15, 18 | jest, e2e | passing | -| `export-headers` | configured export headers are sent on every request | 16, 19, 24 | jest, e2e (android; ios/web with 25/23) | passing | +| `export-headers` | configured export headers are sent on every request | 16, 19, 24, 25 | jest, e2e (android, ios; web with 23) | passing | | `cross-js-to-native` | a native span started from JS is a child of the JS span | 26 | e2e (android, ios) | pending | | `cross-native-to-js` | a JS span started under a native span's context is its child | 26 | e2e (android, ios) | pending | | `collector-down` | app never blocks; spans arrive exactly once when the collector is back | 27 | e2e | pending | diff --git a/verify/e2e/harness.ts b/verify/e2e/harness.ts index 54130cb..4d014cd 100644 --- a/verify/e2e/harness.ts +++ b/verify/e2e/harness.ts @@ -3,7 +3,7 @@ import path from 'node:path'; import {test as base} from '@e2e-dev/mobile'; import {expect, type App, type Screen} from 'e2e'; -// Device runs compare to the reviewed expected files (android: native-first; ios: .js until Task 25); never rewrite them. +// Device runs compare to the reviewed expected files of their platform (native-first); never rewrite them. if (process.env.VERIFY_UPDATE === '1') throw new Error('verify/e2e is compare-only: unset VERIFY_UPDATE (`bun verify --update --e2e` already does)'); @@ -18,7 +18,7 @@ const {compareToExpected} = await import('../harness/compare'); export const {allScenarios} = await import('../scenarios'); type Collector = Awaited>; -/** Must match COLLECTOR_PORT in example/src/ScenariosScreen.tsx. */ +/** Must match the example apps' native init URLs (MainApplication.kt, AppDelegate.swift). */ export const COLLECTOR_PORT = 4318; /** `android-bare` -> `android`. */ @@ -69,10 +69,9 @@ export async function expectScenario( } finally { actual = await collector.end(); } - // android-* export through the native core (R13); ios-* stays JS-direct until Task 25. + // both apps export through the native core, so android-* compare to `android` files and ios-* to `ios` (R13). // VERIFY_E2E_DRAFT=1 writes a missing expected file and still fails (review it, then rerun) - const expected = platformOf(target) === 'android' ? 'android' : 'js'; - const r = compareToExpected(name, expected, actual, {draft: process.env.VERIFY_E2E_DRAFT === '1'}); + const r = compareToExpected(name, platformOf(target), actual, {draft: process.env.VERIFY_E2E_DRAFT === '1'}); if (!r.ok) throw new Error('\n' + r.report); } diff --git a/verify/scenarios/export-headers.ts b/verify/scenarios/export-headers.ts index 953fc28..984586e 100644 --- a/verify/scenarios/export-headers.ts +++ b/verify/scenarios/export-headers.ts @@ -9,5 +9,5 @@ export default scenario( async ({tracer, at}) => { tracer.startSpan('headers', {startTime: at(0)}).end(at(10)); }, - {targets: ['android']}, // Tasks 25/23 add ios/web as each app's init sends the header + {targets: ['android', 'ios']}, // Task 23 adds web once its app's init sends the header ); diff --git a/verify/stages/static.ts b/verify/stages/static.ts index 5e12a96..7f5750a 100644 --- a/verify/stages/static.ts +++ b/verify/stages/static.ts @@ -21,9 +21,13 @@ const stage: Stage = { const list: string[] = JSON.parse(out)[0].files.map((f: {path: string}) => f.path); const missing = packContents(list, REQUIRED); if (missing.length) throw new Error(`npm pack is missing: ${missing.join(', ')}`); + // iOS has no build-time access to package.json (Android reads it in Gradle): the Swift constant must match. + const root = path.join(import.meta.dirname, '..', '..'); + const {version} = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')); + if (!fs.readFileSync(path.join(root, 'ios', 'RNOtel', 'RNOtel.swift'), 'utf8').includes(`let packageVersion = "${version}"`)) + throw new Error(`ios/RNOtel/RNOtel.swift: set packageVersion to "${version}" (package.json)`); sh(['bunx', 'jest', '--selectProjects', 'harness']); // SDK share of the example's release bundle (src/ + @opentelemetry/*), +10% budget; ~2-10s - const root = path.join(import.meta.dirname, '..', '..'); const baselineFile = path.join(root, 'verify', 'static', 'bundle-baseline.json'); const sdkBytes = measureSdkBytes(root); if (update) fs.writeFileSync(baselineFile, JSON.stringify({sdkBytes}, null, 2) + '\n'); diff --git a/verify/static/packContents.test.ts b/verify/static/packContents.test.ts index 60a7f6a..5cb86e5 100644 --- a/verify/static/packContents.test.ts +++ b/verify/static/packContents.test.ts @@ -1,6 +1,6 @@ import {packContents} from './packContents'; -const complete = ['package.json', 'lib/module/index.js', 'src/index.ts', 'nitrogen/generated/x.hpp', 'metro/index.js', 'vite/index.js', 'android/build.gradle', 'ios/Adapter/HybridOtel.swift', 'Package.swift', 'ReactNativeOpenTelemetry.podspec']; +const complete = ['package.json', 'lib/module/index.js', 'src/index.ts', 'nitrogen/generated/x.hpp', 'metro/index.js', 'vite/index.js', 'android/build.gradle', 'ios/Adapter/HybridOtel.swift', 'Package.swift', 'ReactNativeOpenTelemetry.podspec', 'ReactNativeOpenTelemetryCore.podspec']; test('reports missing nitrogen/', () => { expect(packContents(complete.filter(p => !p.startsWith('nitrogen/')))).toEqual(['nitrogen/']); diff --git a/verify/static/packContents.ts b/verify/static/packContents.ts index 9697e02..c91da69 100644 --- a/verify/static/packContents.ts +++ b/verify/static/packContents.ts @@ -1,4 +1,4 @@ -export const REQUIRED = ['package.json', 'lib/', 'src/', 'nitrogen/', 'metro/', 'vite/', 'android/', 'ios/', 'Package.swift', 'ReactNativeOpenTelemetry.podspec']; +export const REQUIRED = ['package.json', 'lib/', 'src/', 'nitrogen/', 'metro/', 'vite/', 'android/', 'ios/', 'Package.swift', 'ReactNativeOpenTelemetry.podspec', 'ReactNativeOpenTelemetryCore.podspec']; /** Returns the required paths missing from the `npm pack --dry-run --json` file list. */ export function packContents(list: string[], required: string[] = REQUIRED): string[] { From 07bcdec8f8ea73793fa5c3aeffbeac1884606367 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 04:26:50 +0100 Subject: [PATCH 40/76] chore: sync distro version constants on changeset version; spec notes the two iOS pods (R24); silence script-phase warning Co-Authored-By: Claude Opus 5.5 --- ReactNativeOpenTelemetry.podspec | 1 + .../specs/2026-11-10-rn-otel-design.md | 4 ++++ example/ios/Podfile.lock | 2 +- package.json | 2 +- scripts/sync-distro-version.js | 15 +++++++++++++++ 5 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 scripts/sync-distro-version.js diff --git a/ReactNativeOpenTelemetry.podspec b/ReactNativeOpenTelemetry.podspec index ae44dfd..27eae07 100644 --- a/ReactNativeOpenTelemetry.podspec +++ b/ReactNativeOpenTelemetry.podspec @@ -26,6 +26,7 @@ Pod::Spec.new do |s| :name => 'Forward the core module map', :execution_position => :before_compile, :output_files => [core_map], + :always_out_of_date => '1', # no inputs: run every build on purpose (silences the Xcode warning) :script => %Q{set -e if [ -f "${PODS_CONFIGURATION_BUILD_DIR}/ReactNativeOpenTelemetryCore.modulemap" ]; then mkdir -p "${PODS_CONFIGURATION_BUILD_DIR}/ReactNativeOpenTelemetryCore" diff --git a/docs/superpowers/specs/2026-11-10-rn-otel-design.md b/docs/superpowers/specs/2026-11-10-rn-otel-design.md index 439c441..9d98bcf 100644 --- a/docs/superpowers/specs/2026-11-10-rn-otel-design.md +++ b/docs/superpowers/specs/2026-11-10-rn-otel-design.md @@ -196,6 +196,10 @@ class NativeHandOffProcessor implements SpanProcessor { and the OTLP exporter only. - iOS: core sources in e.g. `ios/Core/*.swift`, listed in the podspec `source_files`; a root `Package.swift` uses the same path for `swift test` on macOS. + *(R24, Task 25: the app's non-interop Swift `AppDelegate` cannot import a Nitro C++-interop module, so iOS ships + two pods: pure-Swift `ReactNativeOpenTelemetryCore` (`ios/Core` + `RNOtel`) and the Nitro adapter pod that + depends on it. Autolinking links one podspec per package, so apps add `pod 'ReactNativeOpenTelemetryCore', + :path => '../node_modules/react-native-open-telemetry'` to their Podfile.)* - **v0 uses otel-java directly, not opentelemetry-android** (Claude's call): otel-java is stable; opentelemetry-android is alpha, adds desugaring/AGP constraints, and v0 needs none of its instrumentation. Add it with v1 lifecycle work. Watch OkHttp version alignment diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 046b674..ddf5ed0 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -2163,4 +2163,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: f0b2481a774a2b77e95776068d1d26bc682a7ba6 -COCOAPODS: 1.16.2 +COCOAPODS: 1.17.0 diff --git a/package.json b/package.json index 6fadea7..fddb8bb 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "verify": "bun verify/run.ts", "test": "NODE_OPTIONS=--experimental-vm-modules jest", "prepare": "bunx bob build && (git config core.hooksPath .githooks || true)", - "version": "bunx changeset version", + "version": "bunx changeset version && node scripts/sync-distro-version.js", "publish": "bunx changeset publish" }, "dependencies": { diff --git a/scripts/sync-distro-version.js b/scripts/sync-distro-version.js new file mode 100644 index 0000000..86d9a11 --- /dev/null +++ b/scripts/sync-distro-version.js @@ -0,0 +1,15 @@ +// Run after `changeset version`: copies package.json's version into the two hand-kept distro constants +// (web: src/sdk/config.ts, iOS: ios/RNOtel/RNOtel.swift). Android reads package.json at build time. +const fs = require('fs'); +const path = require('path'); +const root = path.join(__dirname, '..'); +const {version} = require(path.join(root, 'package.json')); +for (const [file, re] of [ + ['src/sdk/config.ts', /(DISTRO_VERSION = ')[^']*(')/], + ['ios/RNOtel/RNOtel.swift', /(packageVersion = ")[^"]*(")/], +]) { + const p = path.join(root, file); + const src = fs.readFileSync(p, 'utf8'); + if (!re.test(src)) throw new Error(`sync-distro-version: no version constant in ${file}`); + fs.writeFileSync(p, src.replace(re, `$1${version}$2`)); +} From 0b215ca8cf0e990ae34f994f66280ff17005eacf Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 04:27:05 +0100 Subject: [PATCH 41/76] chore(verify): re-baseline the SDK bundle share after the example dropped the JS-only exporter (393429 -> 264099 B) Co-Authored-By: Claude Opus 5.5 --- verify/static/bundle-baseline.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/verify/static/bundle-baseline.json b/verify/static/bundle-baseline.json index 9daf6d5..1d434bf 100644 --- a/verify/static/bundle-baseline.json +++ b/verify/static/bundle-baseline.json @@ -1,3 +1,3 @@ { - "sdkBytes": 393429 + "sdkBytes": 264099 } From 3a30697c85da3660c747acf6df9571da4aa2ab10 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 04:40:17 +0100 Subject: [PATCH 42/76] feat(example): TestNative Nitro module over the public RNOtel helpers (R25) Local autolinked module at example/modules/test-native; ScenariosScreen passes it as ScenarioCtx.native. CI native cache keys include example/modules. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 4 +- example/ios/Podfile.lock | 33 ++++- .../modules/test-native/TestNative.podspec | 25 ++++ .../test-native/android/CMakeLists.txt | 11 ++ .../modules/test-native/android/build.gradle | 49 +++++++ .../android/src/main/AndroidManifest.xml | 2 + .../android/src/main/cpp/cpp-adapter.cpp | 9 ++ .../callstack/testnative/HybridTestNative.kt | 23 +++ .../callstack/testnative/TestNativePackage.kt | 18 +++ .../test-native/ios/HybridTestNative.swift | 18 +++ example/modules/test-native/nitro.json | 16 ++ .../nitrogen/generated/.gitattributes | 1 + .../android/TestNative+autolinking.cmake | 81 ++++++++++ .../android/TestNative+autolinking.gradle | 27 ++++ .../generated/android/TestNativeOnLoad.cpp | 54 +++++++ .../generated/android/TestNativeOnLoad.hpp | 34 +++++ .../android/c++/JHybridTestNativeSpec.cpp | 64 ++++++++ .../android/c++/JHybridTestNativeSpec.hpp | 63 ++++++++ .../testnative/HybridTestNativeSpec.kt | 56 +++++++ .../callstack/testnative/TestNativeOnLoad.kt | 35 +++++ .../generated/ios/TestNative+autolinking.rb | 62 ++++++++ .../ios/TestNative-Swift-Cxx-Bridge.cpp | 33 +++++ .../ios/TestNative-Swift-Cxx-Bridge.hpp | 64 ++++++++ .../ios/TestNative-Swift-Cxx-Umbrella.hpp | 45 ++++++ .../generated/ios/TestNativeAutolinking.mm | 33 +++++ .../generated/ios/TestNativeAutolinking.swift | 22 +++ .../ios/c++/HybridTestNativeSpecSwift.cpp | 11 ++ .../ios/c++/HybridTestNativeSpecSwift.hpp | 83 +++++++++++ .../ios/swift/HybridTestNativeSpec.swift | 55 +++++++ .../ios/swift/HybridTestNativeSpec_cxx.swift | 138 ++++++++++++++++++ .../shared/c++/HybridTestNativeSpec.cpp | 21 +++ .../shared/c++/HybridTestNativeSpec.hpp | 63 ++++++++ example/modules/test-native/package.json | 9 ++ .../test-native/react-native.config.js | 9 ++ .../test-native/src/TestNative.nitro.ts | 7 + example/react-native.config.js | 3 +- example/src/ScenariosScreen.tsx | 9 +- verify/harness/scenario.ts | 9 +- 38 files changed, 1293 insertions(+), 6 deletions(-) create mode 100644 example/modules/test-native/TestNative.podspec create mode 100644 example/modules/test-native/android/CMakeLists.txt create mode 100644 example/modules/test-native/android/build.gradle create mode 100644 example/modules/test-native/android/src/main/AndroidManifest.xml create mode 100644 example/modules/test-native/android/src/main/cpp/cpp-adapter.cpp create mode 100644 example/modules/test-native/android/src/main/java/com/margelo/nitro/callstack/testnative/HybridTestNative.kt create mode 100644 example/modules/test-native/android/src/main/java/com/margelo/nitro/callstack/testnative/TestNativePackage.kt create mode 100644 example/modules/test-native/ios/HybridTestNative.swift create mode 100644 example/modules/test-native/nitro.json create mode 100644 example/modules/test-native/nitrogen/generated/.gitattributes create mode 100644 example/modules/test-native/nitrogen/generated/android/TestNative+autolinking.cmake create mode 100644 example/modules/test-native/nitrogen/generated/android/TestNative+autolinking.gradle create mode 100644 example/modules/test-native/nitrogen/generated/android/TestNativeOnLoad.cpp create mode 100644 example/modules/test-native/nitrogen/generated/android/TestNativeOnLoad.hpp create mode 100644 example/modules/test-native/nitrogen/generated/android/c++/JHybridTestNativeSpec.cpp create mode 100644 example/modules/test-native/nitrogen/generated/android/c++/JHybridTestNativeSpec.hpp create mode 100644 example/modules/test-native/nitrogen/generated/android/kotlin/com/margelo/nitro/callstack/testnative/HybridTestNativeSpec.kt create mode 100644 example/modules/test-native/nitrogen/generated/android/kotlin/com/margelo/nitro/callstack/testnative/TestNativeOnLoad.kt create mode 100644 example/modules/test-native/nitrogen/generated/ios/TestNative+autolinking.rb create mode 100644 example/modules/test-native/nitrogen/generated/ios/TestNative-Swift-Cxx-Bridge.cpp create mode 100644 example/modules/test-native/nitrogen/generated/ios/TestNative-Swift-Cxx-Bridge.hpp create mode 100644 example/modules/test-native/nitrogen/generated/ios/TestNative-Swift-Cxx-Umbrella.hpp create mode 100644 example/modules/test-native/nitrogen/generated/ios/TestNativeAutolinking.mm create mode 100644 example/modules/test-native/nitrogen/generated/ios/TestNativeAutolinking.swift create mode 100644 example/modules/test-native/nitrogen/generated/ios/c++/HybridTestNativeSpecSwift.cpp create mode 100644 example/modules/test-native/nitrogen/generated/ios/c++/HybridTestNativeSpecSwift.hpp create mode 100644 example/modules/test-native/nitrogen/generated/ios/swift/HybridTestNativeSpec.swift create mode 100644 example/modules/test-native/nitrogen/generated/ios/swift/HybridTestNativeSpec_cxx.swift create mode 100644 example/modules/test-native/nitrogen/generated/shared/c++/HybridTestNativeSpec.cpp create mode 100644 example/modules/test-native/nitrogen/generated/shared/c++/HybridTestNativeSpec.hpp create mode 100644 example/modules/test-native/package.json create mode 100644 example/modules/test-native/react-native.config.js create mode 100644 example/modules/test-native/src/TestNative.nitro.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 393b896..0c46868 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,7 +108,7 @@ jobs: example/android/build example/node_modules/react-native-nitro-modules/android/build example/node_modules/react-native-nitro-modules/android/.cxx - key: android-native-${{ hashFiles('android/**', 'nitrogen/**', 'patches/**', 'example/android/**', 'bun.lock', 'example/bun.lock') }} + key: android-native-${{ hashFiles('android/**', 'nitrogen/**', 'patches/**', 'example/android/**', 'example/modules/**', 'bun.lock', 'example/bun.lock') }} - name: Build release APK (test mode) working-directory: example/android env: @@ -186,7 +186,7 @@ jobs: path: | example/ios/Pods example/ios/build/Build - key: ios-native-${{ hashFiles('ios/**', 'nitrogen/**', 'ReactNativeOpenTelemetry.podspec', 'ReactNativeOpenTelemetryCore.podspec', 'example/ios/Podfile', 'example/ios/Podfile.lock', 'example/ios/OpenTelemetryExample/**', 'example/ios/OpenTelemetryExample.xcodeproj/**', 'bun.lock', 'example/bun.lock') }} + key: ios-native-${{ hashFiles('ios/**', 'nitrogen/**', 'ReactNativeOpenTelemetry.podspec', 'ReactNativeOpenTelemetryCore.podspec', 'example/ios/Podfile', 'example/ios/Podfile.lock', 'example/ios/OpenTelemetryExample/**', 'example/ios/OpenTelemetryExample.xcodeproj/**', 'example/modules/**', 'bun.lock', 'example/bun.lock') }} - name: pod install (test mode) working-directory: example/ios env: diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index ddf5ed0..6b5709d 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1794,6 +1794,33 @@ PODS: - ReactNativeOpenTelemetryCore (0.2.0) - SocketRocket (0.7.1): - ReactNativeDependencies + - TestNative (0.0.0): + - hermes-engine + - NitroModules + - RCTRequired + - RCTTypeSafety + - React-bridging + - React-callinvoker + - React-Core + - React-Core-prebuilt + - React-cxxstableapi + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - ReactNativeOpenTelemetry + - ReactNativeOpenTelemetryCore + - Yoga - Yoga (0.0.0): - React-Core-prebuilt @@ -1887,6 +1914,7 @@ DEPENDENCIES: - ReactNativeOpenTelemetry (from `../..`) - ReactNativeOpenTelemetryCore (from `../..`) - SocketRocket (from `build/rndeps-facades/SocketRocket`) + - TestNative (from `../modules/test-native`) - Yoga (from `build/rncore-facades/Yoga`) EXTERNAL SOURCES: @@ -2067,6 +2095,8 @@ EXTERNAL SOURCES: :path: "../.." SocketRocket: :path: build/rndeps-facades/SocketRocket + TestNative: + :path: "../modules/test-native" Yoga: :path: build/rncore-facades/Yoga @@ -2156,9 +2186,10 @@ SPEC CHECKSUMS: ReactCodegen: 3840312f5071bb6b953b35a029c5c6dcf06b435e ReactCommon: b63ce798b898ed77c6cfdeb80b18080161f52ed5 ReactNativeDependencies: a5164c3ebbe90d992022b5d9cbabbf770a6d7d05 - ReactNativeOpenTelemetry: cfbb4c9c5603eb925f23e6e601f21d0a41cb7271 + ReactNativeOpenTelemetry: ca8cf471e09f5c90d61a9105e163ee8a4f66160d ReactNativeOpenTelemetryCore: b9b1d5e27b1df7d86e4937554d2c9152e85df541 SocketRocket: 37aec555668fb852ec12e3c0de59a86ca58f0871 + TestNative: 256fa8cff013c95afd55f46437705c7387ad6b16 Yoga: d1c536142c5ff8ec8cd856ab2a7c227a1d875c8e PODFILE CHECKSUM: f0b2481a774a2b77e95776068d1d26bc682a7ba6 diff --git a/example/modules/test-native/TestNative.podspec b/example/modules/test-native/TestNative.podspec new file mode 100644 index 0000000..6196ac3 --- /dev/null +++ b/example/modules/test-native/TestNative.podspec @@ -0,0 +1,25 @@ +# Example-only Nitro module (Task 26, R25): app native code using the public RNOtel API. +Pod::Spec.new do |s| + s.name = "TestNative" + s.version = "0.0.0" + s.summary = "Example-only HybridObject over RNOtel" + s.homepage = "https://github.com/callstack/react-native-open-telemetry" + s.license = "MIT" + s.authors = "Callstack" + s.platforms = { :ios => min_ios_version_supported } + s.source = { :git => "https://github.com/callstack/react-native-open-telemetry.git" } + + s.source_files = ["ios/**/*.swift"] + # static libraries: the core and its SwiftPM modules land in the products root (see ReactNativeOpenTelemetry.podspec) + s.pod_target_xcconfig = { 'SWIFT_INCLUDE_PATHS' => '$(inherited) "${PODS_CONFIGURATION_BUILD_DIR}"' } + + load 'nitrogen/generated/ios/TestNative+autolinking.rb' + add_nitrogen_files(s) + + s.dependency 'ReactNativeOpenTelemetryCore' + # builds after the adapter pod, whose script phase forwards the core's module map (static libraries) + s.dependency 'ReactNativeOpenTelemetry' + s.dependency 'React-jsi' + s.dependency 'React-callinvoker' + install_modules_dependencies(s) +end diff --git a/example/modules/test-native/android/CMakeLists.txt b/example/modules/test-native/android/CMakeLists.txt new file mode 100644 index 0000000..e920e9c --- /dev/null +++ b/example/modules/test-native/android/CMakeLists.txt @@ -0,0 +1,11 @@ +project(TestNative) +cmake_minimum_required(VERSION 3.9.0) + +set (CMAKE_CXX_STANDARD 20) + +add_library(TestNative SHARED src/main/cpp/cpp-adapter.cpp) + +include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/TestNative+autolinking.cmake) + +find_library(LOG_LIB log) +target_link_libraries(TestNative ${LOG_LIB} android) diff --git a/example/modules/test-native/android/build.gradle b/example/modules/test-native/android/build.gradle new file mode 100644 index 0000000..a6e4adb --- /dev/null +++ b/example/modules/test-native/android/build.gradle @@ -0,0 +1,49 @@ +// Example-only Nitro module (Task 26, R25). Versions follow the app (rootProject.ext), as autolinked libraries do. +apply plugin: "com.android.library" +apply plugin: "org.jetbrains.kotlin.android" +apply from: "../nitrogen/generated/android/TestNative+autolinking.gradle" + +def abis = (rootProject.findProperty("reactNativeArchitectures") ?: "armeabi-v7a,x86,x86_64,arm64-v8a").split(",") + +android { + namespace "com.margelo.nitro.callstack.testnative" + ndkVersion rootProject.ext.ndkVersion + compileSdkVersion rootProject.ext.compileSdkVersion + + defaultConfig { + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion + externalNativeBuild { + cmake { + cppFlags "-frtti -fexceptions -Wall -Wextra -fstack-protector-all" + arguments "-DANDROID_STL=c++_shared", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON" + abiFilters(*abis) + } + } + } + + externalNativeBuild { + cmake { path "CMakeLists.txt" } + } + + // the app and react-native-nitro-modules ship these + packagingOptions { + excludes = ["META-INF", "META-INF/**", "**/libc++_shared.so", "**/libNitroModules.so", "**/libfbjni.so", + "**/libjsi.so", "**/libreactnative.so"] + } + + buildFeatures { prefab true } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + kotlinOptions { jvmTarget = "17" } +} + +dependencies { + implementation "com.facebook.react:react-android" + implementation project(":react-native-nitro-modules") + // RNOtel (and, through it, the otel API) + implementation project(":react-native-open-telemetry") +} diff --git a/example/modules/test-native/android/src/main/AndroidManifest.xml b/example/modules/test-native/android/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a2f47b6 --- /dev/null +++ b/example/modules/test-native/android/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + + diff --git a/example/modules/test-native/android/src/main/cpp/cpp-adapter.cpp b/example/modules/test-native/android/src/main/cpp/cpp-adapter.cpp new file mode 100644 index 0000000..2ec268d --- /dev/null +++ b/example/modules/test-native/android/src/main/cpp/cpp-adapter.cpp @@ -0,0 +1,9 @@ +#include +#include +#include "TestNativeOnLoad.hpp" + +JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { + return facebook::jni::initialize(vm, []() { + margelo::nitro::callstack::testnative::registerAllNatives(); + }); +} diff --git a/example/modules/test-native/android/src/main/java/com/margelo/nitro/callstack/testnative/HybridTestNative.kt b/example/modules/test-native/android/src/main/java/com/margelo/nitro/callstack/testnative/HybridTestNative.kt new file mode 100644 index 0000000..034f2d4 --- /dev/null +++ b/example/modules/test-native/android/src/main/java/com/margelo/nitro/callstack/testnative/HybridTestNative.kt @@ -0,0 +1,23 @@ +package com.margelo.nitro.callstack.testnative + +import androidx.annotation.Keep +import com.callstack.otel.RNOtel +import com.facebook.proguard.annotations.DoNotStrip +import java.util.concurrent.TimeUnit + +/** App native code using the public helpers (spec §4.3): explicit parent from a traceparent, B's traceparent back to JS. */ +// Constructed from JNI by name (TestNativeOnLoad.cpp): keep it through R8. +@DoNotStrip +@Keep +class HybridTestNative : HybridTestNativeSpec() { + override fun doWork(traceparent: String, start: DoubleArray, end: DoubleArray): String { + val span = RNOtel.tracer("test-native").spanBuilder("native.work") + .setParent(RNOtel.contextFrom(traceparent)) // explicit, never thread-local; '' -> a root + .setStartTimestamp(nanos(start), TimeUnit.NANOSECONDS) + .startSpan() + span.end(nanos(end), TimeUnit.NANOSECONDS) + return RNOtel.traceparentOf(span) + } + + private fun nanos(t: DoubleArray) = t[0].toLong() * 1_000_000_000L + t[1].toLong() +} diff --git a/example/modules/test-native/android/src/main/java/com/margelo/nitro/callstack/testnative/TestNativePackage.kt b/example/modules/test-native/android/src/main/java/com/margelo/nitro/callstack/testnative/TestNativePackage.kt new file mode 100644 index 0000000..722d4c4 --- /dev/null +++ b/example/modules/test-native/android/src/main/java/com/margelo/nitro/callstack/testnative/TestNativePackage.kt @@ -0,0 +1,18 @@ +package com.margelo.nitro.callstack.testnative + +import com.facebook.react.BaseReactPackage +import com.facebook.react.bridge.NativeModule +import com.facebook.react.bridge.ReactApplicationContext +import com.facebook.react.module.model.ReactModuleInfoProvider + +class TestNativePackage : BaseReactPackage() { + override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? = null + + override fun getReactModuleInfoProvider(): ReactModuleInfoProvider = ReactModuleInfoProvider { HashMap() } + + companion object { + init { + TestNativeOnLoad.initializeNative() + } + } +} diff --git a/example/modules/test-native/ios/HybridTestNative.swift b/example/modules/test-native/ios/HybridTestNative.swift new file mode 100644 index 0000000..25f2534 --- /dev/null +++ b/example/modules/test-native/ios/HybridTestNative.swift @@ -0,0 +1,18 @@ +import Foundation +import NitroModules +import OpenTelemetryApi +import ReactNativeOpenTelemetryCore + +/// App native code using the public helpers (spec §4.3): explicit parent from a traceparent, B's traceparent back to JS. +class HybridTestNative: HybridTestNativeSpec { + func doWork(traceparent: String, start: [Double], end: [Double]) throws -> String { + let b = RNOtel.tracer("test-native").spanBuilder(spanName: "native.work").setStartTime(time: date(start)) + // explicit, never thread-local; '' -> a root + if let parent = RNOtel.contextFrom(traceparent: traceparent) { b.setParent(parent) } else { b.setNoParent() } + let span = b.startSpan() + span.end(time: date(end)) + return RNOtel.traceparentOf(span) + } + + private func date(_ t: [Double]) -> Date { Date(timeIntervalSince1970: t[0] + t[1] / 1e9) } +} diff --git a/example/modules/test-native/nitro.json b/example/modules/test-native/nitro.json new file mode 100644 index 0000000..352f61e --- /dev/null +++ b/example/modules/test-native/nitro.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://nitro.margelo.com/nitro.schema.json", + "cxxNamespace": ["callstack", "testnative"], + "ios": { "iosModuleName": "TestNative" }, + "android": { + "androidNamespace": ["callstack", "testnative"], + "androidCxxLibName": "TestNative" + }, + "autolinking": { + "TestNative": { + "ios": { "language": "swift", "implementationClassName": "HybridTestNative" }, + "android": { "language": "kotlin", "implementationClassName": "HybridTestNative" } + } + }, + "ignorePaths": ["node_modules"] +} diff --git a/example/modules/test-native/nitrogen/generated/.gitattributes b/example/modules/test-native/nitrogen/generated/.gitattributes new file mode 100644 index 0000000..fb7a0d5 --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/.gitattributes @@ -0,0 +1 @@ +** linguist-generated=true diff --git a/example/modules/test-native/nitrogen/generated/android/TestNative+autolinking.cmake b/example/modules/test-native/nitrogen/generated/android/TestNative+autolinking.cmake new file mode 100644 index 0000000..c712bdb --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/android/TestNative+autolinking.cmake @@ -0,0 +1,81 @@ +# +# TestNative+autolinking.cmake +# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +# https://github.com/margelo/nitro +# Copyright © Marc Rousavy @ Margelo +# + +# This is a CMake file that adds all files generated by Nitrogen +# to the current CMake project. +# +# To use it, add this to your CMakeLists.txt: +# ```cmake +# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/TestNative+autolinking.cmake) +# ``` + +# Define a flag to check if we are building properly +add_definitions(-DBUILDING_TESTNATIVE_WITH_GENERATED_CMAKE_PROJECT) + +# Enable Raw Props parsing in react-native (for Nitro Views) +add_definitions(-DRN_SERIALIZABLE_STATE) + +# Add all headers that were generated by Nitrogen +include_directories( + "../nitrogen/generated/shared/c++" + "../nitrogen/generated/android/c++" + "../nitrogen/generated/android/" +) + +# Add all .cpp sources that were generated by Nitrogen +target_sources( + # CMake project name (Android C++ library name) + TestNative PRIVATE + # Autolinking Setup + ../nitrogen/generated/android/TestNativeOnLoad.cpp + # Shared Nitrogen C++ sources + ../nitrogen/generated/shared/c++/HybridTestNativeSpec.cpp + # Android-specific Nitrogen C++ sources + ../nitrogen/generated/android/c++/JHybridTestNativeSpec.cpp +) + +# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake +# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake +target_compile_definitions( + TestNative PRIVATE + -DFOLLY_NO_CONFIG=1 + -DFOLLY_HAVE_CLOCK_GETTIME=1 + -DFOLLY_USE_LIBCPP=1 + -DFOLLY_CFG_NO_COROUTINES=1 + -DFOLLY_MOBILE=1 + -DFOLLY_HAVE_RECVMMSG=1 + -DFOLLY_HAVE_PTHREAD=1 + # Once we target android-23 above, we can comment + # the following line. NDK uses GNU style stderror_r() after API 23. + -DFOLLY_HAVE_XSI_STRERROR_R=1 +) + +# Add all libraries required by the generated specs +find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++ +find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule) +find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library + +# Link all libraries together +target_link_libraries( + TestNative + fbjni::fbjni # <-- Facebook C++ JNI helpers + ReactAndroid::jsi # <-- RN: JSI + react-native-nitro-modules::NitroModules # <-- NitroModules Core :) +) + +# Link react-native (different prefab between RN 0.75 and RN 0.76) +if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) + target_link_libraries( + TestNative + ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab + ) +else() + target_link_libraries( + TestNative + ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core + ) +endif() diff --git a/example/modules/test-native/nitrogen/generated/android/TestNative+autolinking.gradle b/example/modules/test-native/nitrogen/generated/android/TestNative+autolinking.gradle new file mode 100644 index 0000000..b833c99 --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/android/TestNative+autolinking.gradle @@ -0,0 +1,27 @@ +/// +/// TestNative+autolinking.gradle +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +/// This is a Gradle file that adds all files generated by Nitrogen +/// to the current Gradle project. +/// +/// To use it, add this to your build.gradle: +/// ```gradle +/// apply from: '../nitrogen/generated/android/TestNative+autolinking.gradle' +/// ``` + +logger.warn("[NitroModules] 🔥 TestNative is boosted by nitro!") + +android { + sourceSets { + main { + java.srcDirs += [ + // Nitrogen files + "${project.projectDir}/../nitrogen/generated/android/kotlin" + ] + } + } +} diff --git a/example/modules/test-native/nitrogen/generated/android/TestNativeOnLoad.cpp b/example/modules/test-native/nitrogen/generated/android/TestNativeOnLoad.cpp new file mode 100644 index 0000000..f7e984d --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/android/TestNativeOnLoad.cpp @@ -0,0 +1,54 @@ +/// +/// TestNativeOnLoad.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +#ifndef BUILDING_TESTNATIVE_WITH_GENERATED_CMAKE_PROJECT +#error TestNativeOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this? +#endif + +#include "TestNativeOnLoad.hpp" + +#include +#include +#include + +#include "JHybridTestNativeSpec.hpp" +#include + +namespace margelo::nitro::callstack::testnative { + +int initialize(JavaVM* vm) { + return facebook::jni::initialize(vm, []() { + ::margelo::nitro::callstack::testnative::registerAllNatives(); + }); +} + +struct JHybridTestNativeSpecImpl: public jni::JavaClass { + static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/callstack/testnative/HybridTestNative;"; + static std::shared_ptr create() { + static const auto constructorFn = javaClassStatic()->getConstructor(); + jni::local_ref javaPart = javaClassStatic()->newObject(constructorFn); + return javaPart->getJHybridTestNativeSpec(); + } +}; + +void registerAllNatives() { + using namespace margelo::nitro; + using namespace margelo::nitro::callstack::testnative; + + // Register native JNI methods + margelo::nitro::callstack::testnative::JHybridTestNativeSpec::CxxPart::registerNatives(); + + // Register Nitro Hybrid Objects + HybridObjectRegistry::registerHybridObjectConstructor( + "TestNative", + []() -> std::shared_ptr { + return JHybridTestNativeSpecImpl::create(); + } + ); +} + +} // namespace margelo::nitro::callstack::testnative diff --git a/example/modules/test-native/nitrogen/generated/android/TestNativeOnLoad.hpp b/example/modules/test-native/nitrogen/generated/android/TestNativeOnLoad.hpp new file mode 100644 index 0000000..c13aa49 --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/android/TestNativeOnLoad.hpp @@ -0,0 +1,34 @@ +/// +/// TestNativeOnLoad.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +#include +#include +#include + +namespace margelo::nitro::callstack::testnative { + + [[deprecated("Use registerNatives() instead.")]] + int initialize(JavaVM* vm); + + /** + * Register the native (C++) part of TestNative, and autolinks all Hybrid Objects. + * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`), + * inside a `facebook::jni::initialize(vm, ...)` call. + * Example: + * ```cpp (cpp-adapter.cpp) + * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { + * return facebook::jni::initialize(vm, []() { + * // register all TestNative HybridObjects + * margelo::nitro::callstack::testnative::registerNatives(); + * // any other custom registrations go here. + * }); + * } + * ``` + */ + void registerAllNatives(); + +} // namespace margelo::nitro::callstack::testnative diff --git a/example/modules/test-native/nitrogen/generated/android/c++/JHybridTestNativeSpec.cpp b/example/modules/test-native/nitrogen/generated/android/c++/JHybridTestNativeSpec.cpp new file mode 100644 index 0000000..68efe72 --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/android/c++/JHybridTestNativeSpec.cpp @@ -0,0 +1,64 @@ +/// +/// JHybridTestNativeSpec.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +#include "JHybridTestNativeSpec.hpp" + + + +#include +#include + +namespace margelo::nitro::callstack::testnative { + + std::shared_ptr JHybridTestNativeSpec::JavaPart::getJHybridTestNativeSpec() { + auto hybridObject = JHybridObject::JavaPart::getJHybridObject(); + auto castHybridObject = std::dynamic_pointer_cast(hybridObject); + if (castHybridObject == nullptr) [[unlikely]] { + throw std::runtime_error("Failed to downcast JHybridObject to JHybridTestNativeSpec!"); + } + return castHybridObject; + } + + jni::local_ref JHybridTestNativeSpec::CxxPart::initHybrid(jni::alias_ref jThis) { + return makeCxxInstance(jThis); + } + + std::shared_ptr JHybridTestNativeSpec::CxxPart::createHybridObject(const jni::local_ref& javaPart) { + auto castJavaPart = jni::dynamic_ref_cast(javaPart); + if (castJavaPart == nullptr) [[unlikely]] { + throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridTestNativeSpec::JavaPart!"); + } + return std::make_shared(castJavaPart); + } + + void JHybridTestNativeSpec::CxxPart::registerNatives() { + registerHybrid({ + makeNativeMethod("initHybrid", JHybridTestNativeSpec::CxxPart::initHybrid), + }); + } + + // Properties + + + // Methods + std::string JHybridTestNativeSpec::doWork(const std::string& traceparent, const std::vector& start, const std::vector& end) { + static const auto method = _javaPart->javaClassStatic()->getMethod(jni::alias_ref /* traceparent */, jni::alias_ref /* start */, jni::alias_ref /* end */)>("doWork"); + auto __result = method(_javaPart, jni::make_jstring(traceparent), [&]() { + size_t __size = start.size(); + jni::local_ref __array = jni::JArrayDouble::newArray(__size); + __array->setRegion(0, __size, start.data()); + return __array; + }(), [&]() { + size_t __size = end.size(); + jni::local_ref __array = jni::JArrayDouble::newArray(__size); + __array->setRegion(0, __size, end.data()); + return __array; + }()); + return __result->toStdString(); + } + +} // namespace margelo::nitro::callstack::testnative diff --git a/example/modules/test-native/nitrogen/generated/android/c++/JHybridTestNativeSpec.hpp b/example/modules/test-native/nitrogen/generated/android/c++/JHybridTestNativeSpec.hpp new file mode 100644 index 0000000..0f32020 --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/android/c++/JHybridTestNativeSpec.hpp @@ -0,0 +1,63 @@ +/// +/// HybridTestNativeSpec.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +#pragma once + +#include +#include +#include "HybridTestNativeSpec.hpp" + + + + +namespace margelo::nitro::callstack::testnative { + + using namespace facebook; + + class JHybridTestNativeSpec: public virtual HybridTestNativeSpec, public virtual JHybridObject { + public: + struct JavaPart: public jni::JavaClass { + static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/callstack/testnative/HybridTestNativeSpec;"; + std::shared_ptr getJHybridTestNativeSpec(); + }; + struct CxxPart: public jni::HybridClass { + static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/callstack/testnative/HybridTestNativeSpec$CxxPart;"; + static jni::local_ref initHybrid(jni::alias_ref jThis); + static void registerNatives(); + using HybridBase::HybridBase; + protected: + std::shared_ptr createHybridObject(const jni::local_ref& javaPart) override; + }; + + public: + explicit JHybridTestNativeSpec(const jni::local_ref& javaPart): + HybridObject(HybridTestNativeSpec::TAG), + JHybridObject(javaPart), + _javaPart(jni::make_global(javaPart)) {} + ~JHybridTestNativeSpec() override { + // Hermes GC can destroy JS objects on a non-JNI Thread. + jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); }); + } + + public: + inline const jni::global_ref& getJavaPart() const noexcept { + return _javaPart; + } + + public: + // Properties + + + public: + // Methods + std::string doWork(const std::string& traceparent, const std::vector& start, const std::vector& end) override; + + private: + jni::global_ref _javaPart; + }; + +} // namespace margelo::nitro::callstack::testnative diff --git a/example/modules/test-native/nitrogen/generated/android/kotlin/com/margelo/nitro/callstack/testnative/HybridTestNativeSpec.kt b/example/modules/test-native/nitrogen/generated/android/kotlin/com/margelo/nitro/callstack/testnative/HybridTestNativeSpec.kt new file mode 100644 index 0000000..22813fa --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/android/kotlin/com/margelo/nitro/callstack/testnative/HybridTestNativeSpec.kt @@ -0,0 +1,56 @@ +/// +/// HybridTestNativeSpec.kt +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +package com.margelo.nitro.callstack.testnative + +import androidx.annotation.Keep +import com.facebook.jni.HybridData +import com.facebook.proguard.annotations.DoNotStrip +import dalvik.annotation.optimization.FastNative +import com.margelo.nitro.core.HybridObject + +/** + * A Kotlin class representing the TestNative HybridObject. + * Implement this abstract class to create Kotlin-based instances of TestNative. + */ +@DoNotStrip +@Keep +@Suppress( + "KotlinJniMissingFunction", "unused", + "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", + "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" +) +abstract class HybridTestNativeSpec: HybridObject() { + // Properties + + + // Methods + @DoNotStrip + @Keep + abstract fun doWork(traceparent: String, start: DoubleArray, end: DoubleArray): String + + // Default implementation of `HybridObject.toString()` + override fun toString(): String { + return "[HybridObject TestNative]" + } + + // C++ backing class + @DoNotStrip + @Keep + protected open class CxxPart(javaPart: HybridTestNativeSpec): HybridObject.CxxPart(javaPart) { + // C++ JHybridTestNativeSpec::CxxPart::initHybrid(...) + @FastNative + external override fun initHybrid(): HybridData + } + override fun createCxxPart(): CxxPart { + return CxxPart(this) + } + + companion object { + protected const val TAG = "HybridTestNativeSpec" + } +} diff --git a/example/modules/test-native/nitrogen/generated/android/kotlin/com/margelo/nitro/callstack/testnative/TestNativeOnLoad.kt b/example/modules/test-native/nitrogen/generated/android/kotlin/com/margelo/nitro/callstack/testnative/TestNativeOnLoad.kt new file mode 100644 index 0000000..b48763d --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/android/kotlin/com/margelo/nitro/callstack/testnative/TestNativeOnLoad.kt @@ -0,0 +1,35 @@ +/// +/// TestNativeOnLoad.kt +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +package com.margelo.nitro.callstack.testnative + +import android.util.Log + +internal class TestNativeOnLoad { + companion object { + private const val TAG = "TestNativeOnLoad" + private var didLoad = false + /** + * Initializes the native part of "TestNative". + * This method is idempotent and can be called more than once. + */ + @JvmStatic + fun initializeNative() { + if (didLoad) return + try { + Log.i(TAG, "Loading TestNative C++ library...") + System.loadLibrary("TestNative") + Log.i(TAG, "Successfully loaded TestNative C++ library!") + didLoad = true + } catch (e: Error) { + Log.e(TAG, "Failed to load TestNative C++ library! Is it properly installed and linked? " + + "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e) + throw e + } + } + } +} diff --git a/example/modules/test-native/nitrogen/generated/ios/TestNative+autolinking.rb b/example/modules/test-native/nitrogen/generated/ios/TestNative+autolinking.rb new file mode 100644 index 0000000..77a3838 --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/ios/TestNative+autolinking.rb @@ -0,0 +1,62 @@ +# +# TestNative+autolinking.rb +# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +# https://github.com/margelo/nitro +# Copyright © Marc Rousavy @ Margelo +# + +# This is a Ruby script that adds all files generated by Nitrogen +# to the given podspec. +# +# To use it, add this to your .podspec: +# ```ruby +# Pod::Spec.new do |spec| +# # ... +# +# # Add all files generated by Nitrogen +# load 'nitrogen/generated/ios/TestNative+autolinking.rb' +# add_nitrogen_files(spec) +# end +# ``` + +def add_nitrogen_files(spec) + Pod::UI.puts "[NitroModules] 🔥 TestNative is boosted by nitro!" + + spec.dependency "NitroModules" + + current_source_files = Array(spec.attributes_hash['source_files']) + spec.source_files = current_source_files + [ + # Generated cross-platform specs + "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}", + # Generated bridges for the cross-platform specs + "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}", + ] + + current_public_header_files = Array(spec.attributes_hash['public_header_files']) + spec.public_header_files = current_public_header_files + [ + # Generated specs + "nitrogen/generated/shared/**/*.{h,hpp}", + # Swift to C++ bridging helpers + "nitrogen/generated/ios/TestNative-Swift-Cxx-Bridge.hpp" + ] + + current_private_header_files = Array(spec.attributes_hash['private_header_files']) + spec.private_header_files = current_private_header_files + [ + # iOS specific specs + "nitrogen/generated/ios/c++/**/*.{h,hpp}", + # Views are framework-specific and should be private + "nitrogen/generated/shared/**/views/**/*" + ] + + current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {} + spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({ + # Use C++ 20 + "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", + # Enables C++ <-> Swift interop (by default it's only ObjC) + "SWIFT_OBJC_INTEROP_MODE" => "objcxx", + # Enables stricter modular headers + "DEFINES_MODULE" => "YES", + # Disable auto-generated ObjC header for Swift (Static linkage on Xcode 26.4 breaks here) + "SWIFT_INSTALL_OBJC_HEADER" => "NO", + }) +end diff --git a/example/modules/test-native/nitrogen/generated/ios/TestNative-Swift-Cxx-Bridge.cpp b/example/modules/test-native/nitrogen/generated/ios/TestNative-Swift-Cxx-Bridge.cpp new file mode 100644 index 0000000..1cccf96 --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/ios/TestNative-Swift-Cxx-Bridge.cpp @@ -0,0 +1,33 @@ +/// +/// TestNative-Swift-Cxx-Bridge.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +#include "TestNative-Swift-Cxx-Bridge.hpp" + +// Include C++ implementation defined types +#include "HybridTestNativeSpecSwift.hpp" +#include "TestNative-Swift-Cxx-Umbrella.hpp" +#include + +namespace margelo::nitro::callstack::testnative::bridge::swift { + + // pragma MARK: std::shared_ptr + std::shared_ptr create_std__shared_ptr_HybridTestNativeSpec_(void* NON_NULL swiftUnsafePointer) noexcept { + TestNative::HybridTestNativeSpec_cxx swiftPart = TestNative::HybridTestNativeSpec_cxx::fromUnsafe(swiftUnsafePointer); + return std::make_shared(swiftPart); + } + void* NON_NULL get_std__shared_ptr_HybridTestNativeSpec_(std__shared_ptr_HybridTestNativeSpec_ cppType) { + std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); + #ifdef NITRO_DEBUG + if (swiftWrapper == nullptr) [[unlikely]] { + throw std::runtime_error("Class \"HybridTestNativeSpec\" is not implemented in Swift!"); + } + #endif + TestNative::HybridTestNativeSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); + return swiftPart.toUnsafe(); + } + +} // namespace margelo::nitro::callstack::testnative::bridge::swift diff --git a/example/modules/test-native/nitrogen/generated/ios/TestNative-Swift-Cxx-Bridge.hpp b/example/modules/test-native/nitrogen/generated/ios/TestNative-Swift-Cxx-Bridge.hpp new file mode 100644 index 0000000..9372242 --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/ios/TestNative-Swift-Cxx-Bridge.hpp @@ -0,0 +1,64 @@ +/// +/// TestNative-Swift-Cxx-Bridge.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +#pragma once + +// Forward declarations of C++ defined types +// Forward declaration of `HybridTestNativeSpec` to properly resolve imports. +namespace margelo::nitro::callstack::testnative { class HybridTestNativeSpec; } + +// Forward declarations of Swift defined types +// Forward declaration of `HybridTestNativeSpec_cxx` to properly resolve imports. +namespace TestNative { class HybridTestNativeSpec_cxx; } + +// Include C++ defined types +#include "HybridTestNativeSpec.hpp" +#include +#include +#include +#include +#include + +/** + * Contains specialized versions of C++ templated types so they can be accessed from Swift, + * as well as helper functions to interact with those C++ types from Swift. + */ +namespace margelo::nitro::callstack::testnative::bridge::swift { + + // pragma MARK: std::vector + /** + * Specialized version of `std::vector`. + */ + using std__vector_double_ = std::vector; + inline std::vector create_std__vector_double_(size_t size) noexcept { + std::vector vector; + vector.reserve(size); + return vector; + } + + // pragma MARK: std::shared_ptr + /** + * Specialized version of `std::shared_ptr`. + */ + using std__shared_ptr_HybridTestNativeSpec_ = std::shared_ptr; + std::shared_ptr create_std__shared_ptr_HybridTestNativeSpec_(void* NON_NULL swiftUnsafePointer) noexcept; + void* NON_NULL get_std__shared_ptr_HybridTestNativeSpec_(std__shared_ptr_HybridTestNativeSpec_ cppType); + + // pragma MARK: std::weak_ptr + using std__weak_ptr_HybridTestNativeSpec_ = std::weak_ptr; + inline std__weak_ptr_HybridTestNativeSpec_ weakify_std__shared_ptr_HybridTestNativeSpec_(const std::shared_ptr& strong) noexcept { return strong; } + + // pragma MARK: Result + using Result_std__string_ = Result; + inline Result_std__string_ create_Result_std__string_(const std::string& value) noexcept { + return Result::withValue(value); + } + inline Result_std__string_ create_Result_std__string_(const std::exception_ptr& error) noexcept { + return Result::withError(error); + } + +} // namespace margelo::nitro::callstack::testnative::bridge::swift diff --git a/example/modules/test-native/nitrogen/generated/ios/TestNative-Swift-Cxx-Umbrella.hpp b/example/modules/test-native/nitrogen/generated/ios/TestNative-Swift-Cxx-Umbrella.hpp new file mode 100644 index 0000000..c2a6b3d --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/ios/TestNative-Swift-Cxx-Umbrella.hpp @@ -0,0 +1,45 @@ +/// +/// TestNative-Swift-Cxx-Umbrella.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +#pragma once + +// Forward declarations of C++ defined types +// Forward declaration of `HybridTestNativeSpec` to properly resolve imports. +namespace margelo::nitro::callstack::testnative { class HybridTestNativeSpec; } + +// Include C++ defined types +#include "HybridTestNativeSpec.hpp" +#include +#include +#include +#include +#include + +// C++ helpers for Swift +#include "TestNative-Swift-Cxx-Bridge.hpp" + +// Common C++ types used in Swift +#include +#include +#include +#include + +// Forward declarations of Swift defined types +// Forward declaration of `HybridTestNativeSpec_cxx` to properly resolve imports. +namespace TestNative { class HybridTestNativeSpec_cxx; } + +// Include Swift defined types +#if __has_include("TestNative-Swift.h") +// This header is generated by Xcode/Swift on every app build. +// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "TestNative". +#include "TestNative-Swift.h" +// Same as above, but used when building with frameworks (`use_frameworks`) +#elif __has_include() +#include +#else +#error TestNative's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "TestNative", and try building the app first. +#endif diff --git a/example/modules/test-native/nitrogen/generated/ios/TestNativeAutolinking.mm b/example/modules/test-native/nitrogen/generated/ios/TestNativeAutolinking.mm new file mode 100644 index 0000000..c90d98b --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/ios/TestNativeAutolinking.mm @@ -0,0 +1,33 @@ +/// +/// TestNativeAutolinking.mm +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +#import +#import +#import "TestNative-Swift-Cxx-Umbrella.hpp" +#import + +#include "HybridTestNativeSpecSwift.hpp" + +@interface TestNativeAutolinking : NSObject +@end + +@implementation TestNativeAutolinking + ++ (void) load { + using namespace margelo::nitro; + using namespace margelo::nitro::callstack::testnative; + + HybridObjectRegistry::registerHybridObjectConstructor( + "TestNative", + []() -> std::shared_ptr { + std::shared_ptr hybridObject = TestNative::TestNativeAutolinking::createTestNative(); + return hybridObject; + } + ); +} + +@end diff --git a/example/modules/test-native/nitrogen/generated/ios/TestNativeAutolinking.swift b/example/modules/test-native/nitrogen/generated/ios/TestNativeAutolinking.swift new file mode 100644 index 0000000..06c84ed --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/ios/TestNativeAutolinking.swift @@ -0,0 +1,22 @@ +/// +/// TestNativeAutolinking.swift +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +import NitroModules + +// TODO: Use empty enums once Swift supports exporting them as namespaces +// See: https://github.com/swiftlang/swift/pull/83616 +public final class TestNativeAutolinking { + public typealias bridge = margelo.nitro.callstack.testnative.bridge.swift + + public static func createTestNative() -> bridge.std__shared_ptr_HybridTestNativeSpec_ { + let hybridObject = HybridTestNative() + return { () -> bridge.std__shared_ptr_HybridTestNativeSpec_ in + let __cxxWrapped = hybridObject.getCxxWrapper() + return __cxxWrapped.getCxxPart() + }() + } +} diff --git a/example/modules/test-native/nitrogen/generated/ios/c++/HybridTestNativeSpecSwift.cpp b/example/modules/test-native/nitrogen/generated/ios/c++/HybridTestNativeSpecSwift.cpp new file mode 100644 index 0000000..f15769d --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/ios/c++/HybridTestNativeSpecSwift.cpp @@ -0,0 +1,11 @@ +/// +/// HybridTestNativeSpecSwift.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +#include "HybridTestNativeSpecSwift.hpp" + +namespace margelo::nitro::callstack::testnative { +} // namespace margelo::nitro::callstack::testnative diff --git a/example/modules/test-native/nitrogen/generated/ios/c++/HybridTestNativeSpecSwift.hpp b/example/modules/test-native/nitrogen/generated/ios/c++/HybridTestNativeSpecSwift.hpp new file mode 100644 index 0000000..811853b --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/ios/c++/HybridTestNativeSpecSwift.hpp @@ -0,0 +1,83 @@ +/// +/// HybridTestNativeSpecSwift.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +#pragma once + +#include "HybridTestNativeSpec.hpp" + +// Forward declaration of `HybridTestNativeSpec_cxx` to properly resolve imports. +namespace TestNative { class HybridTestNativeSpec_cxx; } + + + +#include +#include + +#include "TestNative-Swift-Cxx-Umbrella.hpp" + +namespace margelo::nitro::callstack::testnative { + + /** + * The C++ part of HybridTestNativeSpec_cxx.swift. + * + * HybridTestNativeSpecSwift (C++) accesses HybridTestNativeSpec_cxx (Swift), and might + * contain some additional bridging code for C++ <> Swift interop. + * + * Since this obviously introduces an overhead, I hope at some point in + * the future, HybridTestNativeSpec_cxx can directly inherit from the C++ class HybridTestNativeSpec + * to simplify the whole structure and memory management. + */ + class HybridTestNativeSpecSwift: public virtual HybridTestNativeSpec { + public: + // Constructor from a Swift instance + explicit HybridTestNativeSpecSwift(const TestNative::HybridTestNativeSpec_cxx& swiftPart): + HybridObject(HybridTestNativeSpec::TAG), + _swiftPart(swiftPart) { } + + public: + // Get the Swift part + inline TestNative::HybridTestNativeSpec_cxx& getSwiftPart() noexcept { + return _swiftPart; + } + + public: + inline size_t getExternalMemorySize() noexcept override { + return _swiftPart.getMemorySize(); + } + bool equals(const std::shared_ptr& other) override { + if (auto otherCast = std::dynamic_pointer_cast(other)) { + return _swiftPart.equals(otherCast->_swiftPart); + } + return false; + } + void dispose() noexcept override { + _swiftPart.dispose(); + } + std::string toString() override { + return _swiftPart.toString(); + } + + public: + // Properties + + + public: + // Methods + inline std::string doWork(const std::string& traceparent, const std::vector& start, const std::vector& end) override { + auto __result = _swiftPart.doWork(traceparent, start, end); + if (__result.hasError()) [[unlikely]] { + std::rethrow_exception(__result.error()); + } + auto __value = std::move(__result.value()); + return __value; + } + + private: + TestNative::HybridTestNativeSpec_cxx _swiftPart; + }; + +} // namespace margelo::nitro::callstack::testnative diff --git a/example/modules/test-native/nitrogen/generated/ios/swift/HybridTestNativeSpec.swift b/example/modules/test-native/nitrogen/generated/ios/swift/HybridTestNativeSpec.swift new file mode 100644 index 0000000..6b24028 --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/ios/swift/HybridTestNativeSpec.swift @@ -0,0 +1,55 @@ +/// +/// HybridTestNativeSpec.swift +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +import NitroModules + +/// See ``HybridTestNativeSpec`` +public protocol HybridTestNativeSpec_protocol: HybridObject { + // Properties + + + // Methods + func doWork(traceparent: String, start: [Double], end: [Double]) throws -> String +} + +public extension HybridTestNativeSpec_protocol { + /// Default implementation of ``HybridObject.toString`` + func toString() -> String { + return "[HybridObject TestNative]" + } +} + +/// See ``HybridTestNativeSpec`` +open class HybridTestNativeSpec_base { + private weak var cxxWrapper: HybridTestNativeSpec_cxx? = nil + public init() { } + public func getCxxWrapper() -> HybridTestNativeSpec_cxx { + #if DEBUG + guard self is any HybridTestNativeSpec else { + fatalError("`self` is not a `HybridTestNativeSpec`! Did you accidentally inherit from `HybridTestNativeSpec_base` instead of `HybridTestNativeSpec`?") + } + #endif + if let cxxWrapper = self.cxxWrapper { + return cxxWrapper + } else { + let cxxWrapper = HybridTestNativeSpec_cxx(self as! any HybridTestNativeSpec) + self.cxxWrapper = cxxWrapper + return cxxWrapper + } + } +} + +/** + * A Swift base-protocol representing the TestNative HybridObject. + * Implement this protocol to create Swift-based instances of TestNative. + * ```swift + * class HybridTestNative : HybridTestNativeSpec { + * // ... + * } + * ``` + */ +public typealias HybridTestNativeSpec = HybridTestNativeSpec_protocol & HybridTestNativeSpec_base diff --git a/example/modules/test-native/nitrogen/generated/ios/swift/HybridTestNativeSpec_cxx.swift b/example/modules/test-native/nitrogen/generated/ios/swift/HybridTestNativeSpec_cxx.swift new file mode 100644 index 0000000..c26a7a1 --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/ios/swift/HybridTestNativeSpec_cxx.swift @@ -0,0 +1,138 @@ +/// +/// HybridTestNativeSpec_cxx.swift +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +import NitroModules + +/** + * A class implementation that bridges HybridTestNativeSpec over to C++. + * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined. + * + * Also, some Swift types need to be bridged with special handling: + * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330) + * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper + * - Throwing methods need to be wrapped with a Result type, as exceptions cannot be propagated to C++ + */ +open class HybridTestNativeSpec_cxx { + /** + * The Swift <> C++ bridge's namespace (`margelo::nitro::callstack::testnative::bridge::swift`) + * from `TestNative-Swift-Cxx-Bridge.hpp`. + * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift. + */ + public typealias bridge = margelo.nitro.callstack.testnative.bridge.swift + + /** + * Holds an instance of the `HybridTestNativeSpec` Swift protocol. + */ + private let __implementation: any HybridTestNativeSpec + + /** + * Holds a weak pointer to the C++ class that wraps the Swift class. + */ + private var __cxxPart: bridge.std__weak_ptr_HybridTestNativeSpec_ + + /** + * Create a new `HybridTestNativeSpec_cxx` that wraps the given `HybridTestNativeSpec`. + * All properties and methods bridge to C++ types. + */ + public init(_ implementation: any HybridTestNativeSpec) { + self.__implementation = implementation + self.__cxxPart = .init() + /* no base class */ + } + + /** + * Get the actual `HybridTestNativeSpec` instance this class wraps. + */ + @inline(__always) + public func getHybridTestNativeSpec() -> any HybridTestNativeSpec { + return __implementation + } + + /** + * Casts this instance to a retained unsafe raw pointer. + * This acquires one additional strong reference on the object! + */ + public func toUnsafe() -> UnsafeMutableRawPointer { + return Unmanaged.passRetained(self).toOpaque() + } + + /** + * Casts an unsafe pointer to a `HybridTestNativeSpec_cxx`. + * The pointer has to be a retained opaque `Unmanaged`. + * This removes one strong reference from the object! + */ + public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridTestNativeSpec_cxx { + return Unmanaged.fromOpaque(pointer).takeRetainedValue() + } + + /** + * Gets (or creates) the C++ part of this Hybrid Object. + * The C++ part is a `std::shared_ptr`. + */ + public func getCxxPart() -> bridge.std__shared_ptr_HybridTestNativeSpec_ { + let cachedCxxPart = self.__cxxPart.lock() + if cachedCxxPart.use_count() > 0 { + return cachedCxxPart + } else { + let newCxxPart = bridge.create_std__shared_ptr_HybridTestNativeSpec_(self.toUnsafe()) + __cxxPart = bridge.weakify_std__shared_ptr_HybridTestNativeSpec_(newCxxPart) + return newCxxPart + } + } + + + + /** + * Get the memory size of the Swift class (plus size of any other allocations) + * so the JS VM can properly track it and garbage-collect the JS object if needed. + */ + @inline(__always) + public var memorySize: Int { + return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize + } + + /** + * Compares this object with the given [other] object for reference equality. + */ + @inline(__always) + public func equals(other: HybridTestNativeSpec_cxx) -> Bool { + return self.__implementation === other.__implementation + } + + /** + * Call dispose() on the Swift class. + * This _may_ be called manually from JS. + */ + @inline(__always) + public func dispose() { + self.__implementation.dispose() + } + + /** + * Call toString() on the Swift class. + */ + @inline(__always) + public func toString() -> String { + return self.__implementation.toString() + } + + // Properties + + + // Methods + @inline(__always) + public final func doWork(traceparent: std.string, start: bridge.std__vector_double_, end: bridge.std__vector_double_) -> bridge.Result_std__string_ { + do { + let __result = try self.__implementation.doWork(traceparent: String(traceparent), start: start.map({ __item in __item }), end: end.map({ __item in __item })) + let __resultCpp = std.string(__result) + return bridge.create_Result_std__string_(__resultCpp) + } catch (let __error) { + let __exceptionPtr = __error.toCpp() + return bridge.create_Result_std__string_(__exceptionPtr) + } + } +} diff --git a/example/modules/test-native/nitrogen/generated/shared/c++/HybridTestNativeSpec.cpp b/example/modules/test-native/nitrogen/generated/shared/c++/HybridTestNativeSpec.cpp new file mode 100644 index 0000000..b31ddb0 --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/shared/c++/HybridTestNativeSpec.cpp @@ -0,0 +1,21 @@ +/// +/// HybridTestNativeSpec.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +#include "HybridTestNativeSpec.hpp" + +namespace margelo::nitro::callstack::testnative { + + void HybridTestNativeSpec::loadHybridMethods() { + // load base methods/properties + HybridObject::loadHybridMethods(); + // load custom methods/properties + registerHybrids(this, [](Prototype& prototype) { + prototype.registerHybridMethod("doWork", &HybridTestNativeSpec::doWork); + }); + } + +} // namespace margelo::nitro::callstack::testnative diff --git a/example/modules/test-native/nitrogen/generated/shared/c++/HybridTestNativeSpec.hpp b/example/modules/test-native/nitrogen/generated/shared/c++/HybridTestNativeSpec.hpp new file mode 100644 index 0000000..2f3d5f1 --- /dev/null +++ b/example/modules/test-native/nitrogen/generated/shared/c++/HybridTestNativeSpec.hpp @@ -0,0 +1,63 @@ +/// +/// HybridTestNativeSpec.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/margelo/nitro +/// Copyright © Marc Rousavy @ Margelo +/// + +#pragma once + +#if __has_include() +#include +#else +#error NitroModules cannot be found! Are you sure you installed NitroModules properly? +#endif + + + +#include +#include + +namespace margelo::nitro::callstack::testnative { + + using namespace margelo::nitro; + + /** + * An abstract base class for `TestNative` + * Inherit this class to create instances of `HybridTestNativeSpec` in C++. + * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. + * @example + * ```cpp + * class HybridTestNative: public HybridTestNativeSpec { + * public: + * HybridTestNative(...): HybridObject(TAG) { ... } + * // ... + * }; + * ``` + */ + class HybridTestNativeSpec: public virtual HybridObject { + public: + // Constructor + explicit HybridTestNativeSpec(): HybridObject(TAG) { } + + // Destructor + ~HybridTestNativeSpec() override = default; + + public: + // Properties + + + public: + // Methods + virtual std::string doWork(const std::string& traceparent, const std::vector& start, const std::vector& end) = 0; + + protected: + // Hybrid Setup + void loadHybridMethods() override; + + protected: + // Tag for logging + static constexpr auto TAG = "TestNative"; + }; + +} // namespace margelo::nitro::callstack::testnative diff --git a/example/modules/test-native/package.json b/example/modules/test-native/package.json new file mode 100644 index 0000000..a0af9ce --- /dev/null +++ b/example/modules/test-native/package.json @@ -0,0 +1,9 @@ +{ + "name": "react-native-test-native", + "version": "0.0.0", + "private": true, + "description": "Example-only HybridObject: app native code using the public RNOtel helpers (Task 26)", + "scripts": { + "codegen": "../../../node_modules/.bin/nitrogen" + } +} diff --git a/example/modules/test-native/react-native.config.js b/example/modules/test-native/react-native.config.js new file mode 100644 index 0000000..4c7beef --- /dev/null +++ b/example/modules/test-native/react-native.config.js @@ -0,0 +1,9 @@ +// Autolinked by example/react-native.config.js; native code and nitrogen/generated are wired by the podspec and build.gradle. +module.exports = { + dependency: { + platforms: { + ios: {}, + android: {}, + }, + }, +}; diff --git a/example/modules/test-native/src/TestNative.nitro.ts b/example/modules/test-native/src/TestNative.nitro.ts new file mode 100644 index 0000000..4b61904 --- /dev/null +++ b/example/modules/test-native/src/TestNative.nitro.ts @@ -0,0 +1,7 @@ +import type {HybridObject} from 'react-native-nitro-modules'; + +/** Example-only (Task 26): app native code that parents its spans with the public `RNOtel` helpers. */ +export interface TestNative extends HybridObject<{ios: 'swift'; android: 'kotlin'}> { + /** Starts and ends `native.work` under `traceparent` ('' = a root) at `start`/`end` ([s, ns]), returns its traceparent. */ + doWork(traceparent: string, start: number[], end: number[]): string; +} diff --git a/example/react-native.config.js b/example/react-native.config.js index 1e4f184..d2e79fc 100644 --- a/example/react-native.config.js +++ b/example/react-native.config.js @@ -1,8 +1,9 @@ const path = require('path'); -// Autolink the library from the repo root (no npm dependency needed). +// Autolink the library from the repo root and the example-only TestNative module (no npm dependency needed). module.exports = { dependencies: { 'react-native-open-telemetry': {root: path.join(__dirname, '..')}, + 'react-native-test-native': {root: path.join(__dirname, 'modules/test-native')}, }, }; diff --git a/example/src/ScenariosScreen.tsx b/example/src/ScenariosScreen.tsx index 3d36da2..139cda3 100644 --- a/example/src/ScenariosScreen.tsx +++ b/example/src/ScenariosScreen.tsx @@ -1,16 +1,23 @@ import {useEffect, useState} from 'react'; import {Pressable, ScrollView, StyleSheet, Text, View} from 'react-native'; +import {NitroModules} from 'react-native-nitro-modules'; // the package's entry imports its setup (context patch); withOtel keeps this import out of inline requires import {startReactNativeSdk} from 'react-native-open-telemetry'; import {getOtel} from '../../src/native/otel'; import {at} from '../../verify/harness/scenario'; import {allScenarios} from '../../verify/scenarios'; +import type {TestNative} from '../modules/test-native/src/TestNative.nitro'; // Native-first: MainApplication / AppDelegate ran RNOtel.start (collector URL there); attach and export through the native core. async function runScenario(name: string) { const s = allScenarios().find(x => x.name === name)!; const sdk = startReactNativeSdk(); - await s.run({tracer: sdk.tracerProvider.getTracer('verify'), getTracer: (n, v, o) => sdk.tracerProvider.getTracer(n, v, o), at}); + await s.run({ + tracer: sdk.tracerProvider.getTracer('verify'), + getTracer: (n, v, o) => sdk.tracerProvider.getTracer(n, v, o), + at, + native: NitroModules.createHybridObject('TestNative'), + }); await sdk.forceFlush(); } diff --git a/verify/harness/scenario.ts b/verify/harness/scenario.ts index c359620..6a6bae9 100644 --- a/verify/harness/scenario.ts +++ b/verify/harness/scenario.ts @@ -1,11 +1,18 @@ import type {HrTime, Tracer, TracerOptions} from '@opentelemetry/api'; -// TestNative (ctx.native) arrives with Task 26. +/** The example app's TestNative HybridObject (Task 26): app native code using the public `RNOtel` helpers. */ +export interface TestNative { + /** Starts and ends native `native.work` under `traceparent` ('' = a root), returns its traceparent. */ + doWork(traceparent: string, start: HrTime, end: HrTime): string; +} + export type ScenarioCtx = { tracer: Tracer; /** Extra tracers, for scenarios that need their own scope (version, schemaUrl). */ getTracer(name: string, version?: string, options?: TracerOptions): Tracer; at(us: number): HrTime; + /** Only on devices (the example app); e2e-only scenarios use it. */ + native?: TestNative; }; /** `jest-degraded`: the Jest project that keeps native `async` (Task 11). */ export type Runner = 'jest' | 'jest-degraded' | 'e2e'; From f484006bfa4572c6933023b8d7cf815ee8ff0877 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 04:40:21 +0100 Subject: [PATCH 43/76] test: cross-boundary parenting both directions Un-pend cross-js-to-native and cross-native-to-js; device-drafted android/ios files (R1). Co-Authored-By: Claude Opus 5.5 --- verify/VERIFY.md | 9 +++- .../cross-js-to-native.android.otlp.json | 53 +++++++++++++++++++ .../expected/cross-js-to-native.ios.otlp.json | 51 ++++++++++++++++++ .../cross-native-to-js.android.otlp.json | 53 +++++++++++++++++++ .../expected/cross-native-to-js.ios.otlp.json | 51 ++++++++++++++++++ verify/scenarios/cross-js-to-native.ts | 15 +++++- verify/scenarios/cross-native-to-js.ts | 20 +++++-- 7 files changed, 244 insertions(+), 8 deletions(-) create mode 100644 verify/expected/cross-js-to-native.android.otlp.json create mode 100644 verify/expected/cross-js-to-native.ios.otlp.json create mode 100644 verify/expected/cross-native-to-js.android.otlp.json create mode 100644 verify/expected/cross-native-to-js.ios.otlp.json diff --git a/verify/VERIFY.md b/verify/VERIFY.md index 1c60357..c7d9c9c 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -45,6 +45,11 @@ Each target compares to its platform's files (`android-*` → `android`, `ios-*` first (`RNOtel.start` in `MainApplication` / `AppDelegate`) and ScenariosScreen exports through `startReactNativeSdk` and the Kotlin or Swift core. +**TestNative (R25, Task 26).** `cross-*` scenarios call `ctx.native`, the example-only Nitro HybridObject in +`example/modules/test-native/` (own `nitro.json`, podspec, `build.gradle`; autolinked through +`example/react-native.config.js`). It uses only the public `RNOtel` helpers. After editing its spec, regenerate with +`bun run codegen` in that directory (the patched root nitrogen) and commit `nitrogen/generated`. + **iOS pods (R24).** An app's Swift `AppDelegate` cannot `import ReactNativeOpenTelemetry`: the Nitro pod is built with C++ interop and the app is not (Task 25 Step 0: `'functional' file not found` while building `NitroModules`). So iOS ships two pods: `ReactNativeOpenTelemetryCore` (pure Swift: `ios/Core` + the public `RNOtel` in `ios/RNOtel`) and @@ -130,8 +135,8 @@ e2e targets are android, ios and web unless the Runners column names them. | `rich-span` | every attribute type, events, links, status, scope survive the seam | 8, 15, 18 | jest, e2e | passing | | `odd-attributes` | NaN, ±Infinity, -0, big ints, empty arrays survive the seam | 8, 15, 18 | jest, e2e | passing | | `export-headers` | configured export headers are sent on every request | 16, 19, 24, 25 | jest, e2e (android, ios; web with 23) | passing | -| `cross-js-to-native` | a native span started from JS is a child of the JS span | 26 | e2e (android, ios) | pending | -| `cross-native-to-js` | a JS span started under a native span's context is its child | 26 | e2e (android, ios) | pending | +| `cross-js-to-native` | a native span started from JS is a child of the JS span | 26 | e2e (android, ios) | passing | +| `cross-native-to-js` | a JS span started under a native span's context is its child | 26 | e2e (android, ios) | passing | | `collector-down` | app never blocks; spans arrive exactly once when the collector is back | 27 | e2e | pending | | `native-init-failure` | one error log, no-op SDK, nothing exported | 27 | e2e (android, ios) | pending | | `flush-after-reload` | `forceFlush()` resolves across a JS reload; spans arrive once | 27 | e2e (android, ios) | pending | diff --git a/verify/expected/cross-js-to-native.android.otlp.json b/verify/expected/cross-js-to-native.android.otlp.json new file mode 100644 index 0000000..184d55b --- /dev/null +++ b/verify/expected/cross-js-to-native.android.otlp.json @@ -0,0 +1,53 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "js.parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000300000", + "status": {}, + "flags": 257 + } + ] + }, + { + "scope": { + "name": "test-native" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0b00000000000001", + "parentSpanId": "0a00000000000001", + "name": "native.work", + "kind": 1, + "startTimeUnixNano": "1767225600000100000", + "endTimeUnixNano": "1767225600000200000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/cross-js-to-native.ios.otlp.json b/verify/expected/cross-js-to-native.ios.otlp.json new file mode 100644 index 0000000..c0de431 --- /dev/null +++ b/verify/expected/cross-js-to-native.ios.otlp.json @@ -0,0 +1,51 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "js.parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000300032", + "status": {} + } + ] + }, + { + "scope": { + "name": "test-native" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0b00000000000001", + "parentSpanId": "0a00000000000001", + "name": "native.work", + "kind": 1, + "startTimeUnixNano": "1767225600000099840", + "endTimeUnixNano": "1767225600000199936", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/cross-native-to-js.android.otlp.json b/verify/expected/cross-native-to-js.android.otlp.json new file mode 100644 index 0000000..fe18d38 --- /dev/null +++ b/verify/expected/cross-native-to-js.android.otlp.json @@ -0,0 +1,53 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "test-native" + }, + "spans": [ + { + "traceId": "0b000000000000000000000000000001", + "spanId": "0b00000000000001", + "name": "native.work", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000100000", + "status": {}, + "flags": 257 + } + ] + }, + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0b000000000000000000000000000001", + "spanId": "0a00000000000001", + "parentSpanId": "0b00000000000001", + "name": "js.after_native", + "kind": 1, + "startTimeUnixNano": "1767225600000200000", + "endTimeUnixNano": "1767225600000300000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/cross-native-to-js.ios.otlp.json b/verify/expected/cross-native-to-js.ios.otlp.json new file mode 100644 index 0000000..a77c195 --- /dev/null +++ b/verify/expected/cross-native-to-js.ios.otlp.json @@ -0,0 +1,51 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0b000000000000000000000000000001", + "spanId": "0a00000000000001", + "parentSpanId": "0b00000000000001", + "name": "js.after_native", + "kind": 1, + "startTimeUnixNano": "1767225600000199936", + "endTimeUnixNano": "1767225600000300032", + "status": {} + } + ] + }, + { + "scope": { + "name": "test-native" + }, + "spans": [ + { + "traceId": "0b000000000000000000000000000001", + "spanId": "0b00000000000001", + "name": "native.work", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000099840", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/scenarios/cross-js-to-native.ts b/verify/scenarios/cross-js-to-native.ts index b2c6b87..b55d431 100644 --- a/verify/scenarios/cross-js-to-native.ts +++ b/verify/scenarios/cross-js-to-native.ts @@ -4,6 +4,17 @@ import {scenario} from '../harness/scenario'; * A native span started from JS is a child of the active JS span (Task 26). * Steps: JS span `js.parent` active → `ctx.native.doWork(traceparent, start, end)` starts and ends native * `native.work` with `contextFrom(traceparent)` as parent. Proof: one trace, `native.work` (a `0b…` id) - * has `js.parent` as parent. Body lands with `ScenarioCtx.native`. + * has `js.parent` as parent. */ -export default scenario('cross-js-to-native', async () => {}, {runners: ['e2e'], targets: ['android', 'ios'], pending: true}); +export default scenario( + 'cross-js-to-native', + async ({tracer, at, native}) => { + if (!native) throw new Error('cross-js-to-native needs ctx.native (TestNative)'); + tracer.startActiveSpan('js.parent', {startTime: at(0)}, span => { + const {traceId, spanId, traceFlags} = span.spanContext(); + native.doWork(`00-${traceId}-${spanId}-${traceFlags.toString(16).padStart(2, '0')}`, at(100), at(200)); + span.end(at(300)); + }); + }, + {runners: ['e2e'], targets: ['android', 'ios']}, +); diff --git a/verify/scenarios/cross-native-to-js.ts b/verify/scenarios/cross-native-to-js.ts index 702c26d..0463b4a 100644 --- a/verify/scenarios/cross-native-to-js.ts +++ b/verify/scenarios/cross-native-to-js.ts @@ -1,9 +1,21 @@ +import {context, trace} from '@opentelemetry/api'; import {scenario} from '../harness/scenario'; /** * A JS span started under a native span's context is its child (Task 26). - * Steps: at ROOT, `ctx.native.doWork(...)` starts and ends root `native.work` and returns its traceparent → - * JS starts `js.after_native` under `trace.wrapSpanContext()`. Proof: one trace, - * `js.after_native` has `native.work` as parent. Body lands with `ScenarioCtx.native`. + * Steps: at ROOT, `ctx.native.doWork('', …)` starts and ends root `native.work` and returns its traceparent → + * JS starts `js.after_native` under `trace.wrapSpanContext()` (non-remote, spec §4.3). + * Proof: one trace, `js.after_native` has `native.work` as parent. */ -export default scenario('cross-native-to-js', async () => {}, {runners: ['e2e'], targets: ['android', 'ios'], pending: true}); +export default scenario( + 'cross-native-to-js', + async ({tracer, at, native}) => { + if (!native) throw new Error('cross-native-to-js needs ctx.native (TestNative)'); + const [, traceId = '', spanId = '', flags = ''] = native.doWork('', at(0), at(100)).split('-'); + const b = trace.wrapSpanContext({traceId, spanId, traceFlags: parseInt(flags, 16), isRemote: false}); + context.with(trace.setSpan(context.active(), b), () => + tracer.startSpan('js.after_native', {startTime: at(200)}).end(at(300)), + ); + }, + {runners: ['e2e'], targets: ['android', 'ios']}, +); From f1d81106e12af63cd72ea0771e98c6c3dc3014e0 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 04:42:41 +0100 Subject: [PATCH 44/76] chore(verify): drift check covers the example TestNative nitrogen output Co-Authored-By: Claude Opus 5.5 --- verify/harness/scenario.ts | 3 ++- verify/stages/static.ts | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/verify/harness/scenario.ts b/verify/harness/scenario.ts index 6a6bae9..748814d 100644 --- a/verify/harness/scenario.ts +++ b/verify/harness/scenario.ts @@ -1,6 +1,7 @@ import type {HrTime, Tracer, TracerOptions} from '@opentelemetry/api'; -/** The example app's TestNative HybridObject (Task 26): app native code using the public `RNOtel` helpers. */ +/** The example app's TestNative HybridObject (Task 26): app native code using the public `RNOtel` helpers. + * Mirrors example/modules/test-native/src/TestNative.nitro.ts by hand, so the harness needs no Nitro import. */ export interface TestNative { /** Starts and ends native `native.work` under `traceparent` ('' = a root), returns its traceparent. */ doWork(traceparent: string, start: HrTime, end: HrTime): string; diff --git a/verify/stages/static.ts b/verify/stages/static.ts index 7f5750a..375bd64 100644 --- a/verify/stages/static.ts +++ b/verify/stages/static.ts @@ -11,9 +11,11 @@ const stage: Stage = { run({sh, update}) { sh(['bunx', 'tsc', '--noEmit']); sh(['bun', 'run', 'codegen']); + sh(['bun', 'run', '--cwd', 'example/modules/test-native', 'codegen']); // the example's TestNative module (Task 26) + const generated = ['nitrogen/', 'example/modules/test-native/nitrogen/']; // git diff ignores untracked files, so list them too. - sh(['git', 'diff', '--exit-code', 'nitrogen/']); - if (sh(['git', 'ls-files', '--others', '--exclude-standard', 'nitrogen/']).trim()) { + sh(['git', 'diff', '--exit-code', ...generated]); + if (sh(['git', 'ls-files', '--others', '--exclude-standard', ...generated]).trim()) { throw new Error('nitrogen/generated is out of date: run `bun run codegen` and commit'); } sh(['bunx', 'oxlint']); From 1e26a366f32ba309f8f25f619ab1543c8c276ee7 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 05:20:42 +0100 Subject: [PATCH 45/76] test: failure scenarios on device collector-down, native-init-failure, flush-after-reload and background-flush run on the release builds of both platforms (no extra builds, R26); fast-refresh-idempotent runs on local dev builds + Metro (E2E_DEV=1). Test-mode cores have no timed export (BSP delay 120 s), so background and reload tests cannot pass on the timer. JS no longer repeats a native-first init failure native already reported. Reload goes through the example TestNative (DevSettings.reload() is a no-op in release). Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 2 + .../com/callstack/otel/core/OtelCore.kt | 3 +- example/android/app/build.gradle | 2 + .../opentelemetry/example/MainApplication.kt | 11 +++- .../OpenTelemetryExample/AppDelegate.swift | 12 +++- example/ios/Podfile | 9 +++ example/ios/Podfile.lock | 2 +- .../callstack/testnative/HybridTestNative.kt | 6 ++ .../test-native/ios/HybridTestNative.swift | 5 ++ .../android/c++/JHybridTestNativeSpec.cpp | 4 ++ .../android/c++/JHybridTestNativeSpec.hpp | 1 + .../testnative/HybridTestNativeSpec.kt | 4 ++ .../ios/TestNative-Swift-Cxx-Bridge.hpp | 9 +++ .../ios/c++/HybridTestNativeSpecSwift.hpp | 6 ++ .../ios/swift/HybridTestNativeSpec.swift | 1 + .../ios/swift/HybridTestNativeSpec_cxx.swift | 11 ++++ .../shared/c++/HybridTestNativeSpec.cpp | 1 + .../shared/c++/HybridTestNativeSpec.hpp | 1 + .../test-native/src/TestNative.nitro.ts | 2 + example/src/ScenariosScreen.tsx | 30 ++++++++- ios/Core/OtelCore.swift | 3 +- src/sdk/__tests__/start.test.ts | 9 ++- src/sdk/start.ts | 3 +- verify/VERIFY.md | 62 ++++++++++++++++--- verify/e2e/background-flush.e2e.ts | 22 +++++++ verify/e2e/collector-down.e2e.ts | 15 +++++ verify/e2e/e2e.config.ts | 15 +++++ verify/e2e/fast-refresh-idempotent.e2e.ts | 28 +++++++++ verify/e2e/flush-after-reload.e2e.ts | 16 +++++ verify/e2e/harness.ts | 48 +++++++++++--- verify/e2e/native-init-failure.e2e.ts | 36 +++++++++++ .../background-flush.android.otlp.json | 35 +++++++++++ .../expected/background-flush.ios.otlp.json | 34 ++++++++++ .../expected/collector-down.android.otlp.json | 35 +++++++++++ verify/expected/collector-down.ios.otlp.json | 34 ++++++++++ .../flush-after-reload.android.otlp.json | 35 +++++++++++ .../expected/flush-after-reload.ios.otlp.json | 34 ++++++++++ .../native-init-failure.android.otlp.json | 3 + .../native-init-failure.ios.otlp.json | 3 + verify/harness/collector.ts | 3 + verify/scenarios/background-flush.ts | 2 +- verify/scenarios/collector-down.ts | 2 +- verify/scenarios/fast-refresh-idempotent.ts | 2 +- verify/scenarios/flush-after-reload.ts | 2 +- verify/scenarios/native-init-failure.ts | 2 +- 45 files changed, 573 insertions(+), 32 deletions(-) create mode 100644 verify/e2e/background-flush.e2e.ts create mode 100644 verify/e2e/collector-down.e2e.ts create mode 100644 verify/e2e/fast-refresh-idempotent.e2e.ts create mode 100644 verify/e2e/flush-after-reload.e2e.ts create mode 100644 verify/e2e/native-init-failure.e2e.ts create mode 100644 verify/expected/background-flush.android.otlp.json create mode 100644 verify/expected/background-flush.ios.otlp.json create mode 100644 verify/expected/collector-down.android.otlp.json create mode 100644 verify/expected/collector-down.ios.otlp.json create mode 100644 verify/expected/flush-after-reload.android.otlp.json create mode 100644 verify/expected/flush-after-reload.ios.otlp.json create mode 100644 verify/expected/native-init-failure.android.otlp.json create mode 100644 verify/expected/native-init-failure.ios.otlp.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c46868..8aca3d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,6 +73,8 @@ jobs: include-hidden-files: true # verify/e2e/.e2e is a dot dir # Release builds with the JS bundle embedded (no Metro), test mode on. + # Every Task 27 failure scenario runs here except fast-refresh-idempotent: it needs dev builds + Metro, so it is + # local only (verify/VERIFY.md), no per-PR jobs; a nightly can add it. # Native outputs are cached on native inputs only, so a JS-only change re-bundles but reuses the native build. e2e-android-bare: runs-on: ubuntu-latest diff --git a/android/src/core/kotlin/com/callstack/otel/core/OtelCore.kt b/android/src/core/kotlin/com/callstack/otel/core/OtelCore.kt index c8bb2d1..d3e5acd 100644 --- a/android/src/core/kotlin/com/callstack/otel/core/OtelCore.kt +++ b/android/src/core/kotlin/com/callstack/otel/core/OtelCore.kt @@ -51,7 +51,8 @@ class OtelCore(config: CoreConfig, testMode: Boolean = false, distroVersion: Str OtlpHttpSpanExporter.builder().setEndpoint(tracesUrl(config.exportUrl)) .apply { config.exportHeaders.forEach { (k, v) -> addHeader(k, v) } }.build() }, - ).build() + // test mode: no timed export within a device test, so only flush and background export send (Task 27) + ).apply { if (testMode) setScheduleDelay(120, TimeUnit.SECONDS) }.build() /** The native TracerProvider; JS spans join its batch processor. */ val tracerProvider: SdkTracerProvider = SdkTracerProvider.builder() diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 30b30b9..39400ed 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -84,6 +84,8 @@ android { targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" + // test mode is a build flag (-PotelTestMode=true); MainApplication reads test-only overrides only then + buildConfigField "boolean", "OTEL_TEST_MODE", ((findProperty("otelTestMode") ?: "false").toString() == "true").toString() } signingConfigs { debug { diff --git a/example/android/app/src/main/java/opentelemetry/example/MainApplication.kt b/example/android/app/src/main/java/opentelemetry/example/MainApplication.kt index 2cdb03d..80cdca8 100644 --- a/example/android/app/src/main/java/opentelemetry/example/MainApplication.kt +++ b/example/android/app/src/main/java/opentelemetry/example/MainApplication.kt @@ -7,6 +7,7 @@ import com.facebook.react.ReactApplication import com.facebook.react.ReactHost import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost +import java.io.File class MainApplication : Application(), ReactApplication { @@ -27,7 +28,7 @@ class MainApplication : Application(), ReactApplication { RNOtel.start(this) { serviceName = "verify" export { - url = "http://10.0.2.2:4318" // the e2e collector on the host + url = testExportUrl() ?: "http://10.0.2.2:4318" // the e2e collector on the host headers = mapOf("x-api-key" to "test") // asserted by verify/e2e/export-headers.e2e.ts } } @@ -35,4 +36,12 @@ class MainApplication : Application(), ReactApplication { RNOtel.tracer("opentelemetry.example") loadReactNative(this) } + + /** + * Test-mode builds only: verify/e2e/native-init-failure.e2e.ts overrides the URL. Application.onCreate cannot see + * launch arguments (they reach the Activity), so the test writes this file with adb and removes it afterwards. + */ + private fun testExportUrl(): String? = + if (!BuildConfig.OTEL_TEST_MODE) null + else File(getExternalFilesDir(null), "otel-export-url").takeIf { it.exists() }?.readText()?.trim() } diff --git a/example/ios/OpenTelemetryExample/AppDelegate.swift b/example/ios/OpenTelemetryExample/AppDelegate.swift index 9bfb51c..384c4f0 100644 --- a/example/ios/OpenTelemetryExample/AppDelegate.swift +++ b/example/ios/OpenTelemetryExample/AppDelegate.swift @@ -11,10 +11,20 @@ class AppDelegate: UIResponder, UIApplicationDelegate { RNOtel.start { c in c.serviceName = "verify" // the e2e collector on the host; asserted by verify/e2e/export-headers.e2e.ts - c.export = .init(url: "http://localhost:4318", headers: ["x-api-key": "test"]) + c.export = .init(url: testExportUrl() ?? "http://localhost:4318", headers: ["x-api-key": "test"]) } // compile check: the otel API is part of RNOtel's public surface (a no-op tracer is cheap to build) _ = RNOtel.tracer("opentelemetry.example") return true } + + /// Test-mode builds only: verify/e2e/native-init-failure.e2e.ts launches with `--otel-export-url=`. + private func testExportUrl() -> String? { + #if OTEL_TEST_MODE + let prefix = "--otel-export-url=" + return ProcessInfo.processInfo.arguments.first { $0.hasPrefix(prefix) }.map { String($0.dropFirst(prefix.count)) } + #else + return nil + #endif + } } diff --git a/example/ios/Podfile b/example/ios/Podfile index e4516bc..15a976b 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -32,5 +32,14 @@ target 'OpenTelemetryExample' do :mac_catalyst_enabled => false, # :ccache_enabled => true ) + # Test mode reaches the app target too: AppDelegate reads test-only launch arguments under `#if OTEL_TEST_MODE`. + if ENV['OTEL_TEST_MODE'] == '1' + installer.aggregate_targets.each do |t| + t.xcconfigs.each do |name, xc| + xc.attributes['SWIFT_ACTIVE_COMPILATION_CONDITIONS'] = '$(inherited) OTEL_TEST_MODE' + xc.save_as(t.xcconfig_path(name)) + end + end + end end end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 6b5709d..2210f2e 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -2192,6 +2192,6 @@ SPEC CHECKSUMS: TestNative: 256fa8cff013c95afd55f46437705c7387ad6b16 Yoga: d1c536142c5ff8ec8cd856ab2a7c227a1d875c8e -PODFILE CHECKSUM: f0b2481a774a2b77e95776068d1d26bc682a7ba6 +PODFILE CHECKSUM: bc90526914a3954cc63e80dcd3edb75bde6b4a2a COCOAPODS: 1.17.0 diff --git a/example/modules/test-native/android/src/main/java/com/margelo/nitro/callstack/testnative/HybridTestNative.kt b/example/modules/test-native/android/src/main/java/com/margelo/nitro/callstack/testnative/HybridTestNative.kt index 034f2d4..e1a8089 100644 --- a/example/modules/test-native/android/src/main/java/com/margelo/nitro/callstack/testnative/HybridTestNative.kt +++ b/example/modules/test-native/android/src/main/java/com/margelo/nitro/callstack/testnative/HybridTestNative.kt @@ -3,6 +3,8 @@ package com.margelo.nitro.callstack.testnative import androidx.annotation.Keep import com.callstack.otel.RNOtel import com.facebook.proguard.annotations.DoNotStrip +import com.facebook.react.ReactApplication +import com.margelo.nitro.NitroModules import java.util.concurrent.TimeUnit /** App native code using the public helpers (spec §4.3): explicit parent from a traceparent, B's traceparent back to JS. */ @@ -19,5 +21,9 @@ class HybridTestNative : HybridTestNativeSpec() { return RNOtel.traceparentOf(span) } + override fun reload() { + (NitroModules.applicationContext?.applicationContext as? ReactApplication)?.reactHost?.reload("verify") + } + private fun nanos(t: DoubleArray) = t[0].toLong() * 1_000_000_000L + t[1].toLong() } diff --git a/example/modules/test-native/ios/HybridTestNative.swift b/example/modules/test-native/ios/HybridTestNative.swift index 25f2534..e82c4e9 100644 --- a/example/modules/test-native/ios/HybridTestNative.swift +++ b/example/modules/test-native/ios/HybridTestNative.swift @@ -1,6 +1,7 @@ import Foundation import NitroModules import OpenTelemetryApi +import React import ReactNativeOpenTelemetryCore /// App native code using the public helpers (spec §4.3): explicit parent from a traceparent, B's traceparent back to JS. @@ -14,5 +15,9 @@ class HybridTestNative: HybridTestNativeSpec { return RNOtel.traceparentOf(span) } + func reload() throws { + DispatchQueue.main.async { RCTTriggerReloadCommandListeners("verify") } + } + private func date(_ t: [Double]) -> Date { Date(timeIntervalSince1970: t[0] + t[1] / 1e9) } } diff --git a/example/modules/test-native/nitrogen/generated/android/c++/JHybridTestNativeSpec.cpp b/example/modules/test-native/nitrogen/generated/android/c++/JHybridTestNativeSpec.cpp index 68efe72..54e128c 100644 --- a/example/modules/test-native/nitrogen/generated/android/c++/JHybridTestNativeSpec.cpp +++ b/example/modules/test-native/nitrogen/generated/android/c++/JHybridTestNativeSpec.cpp @@ -60,5 +60,9 @@ namespace margelo::nitro::callstack::testnative { }()); return __result->toStdString(); } + void JHybridTestNativeSpec::reload() { + static const auto method = _javaPart->javaClassStatic()->getMethod("reload"); + method(_javaPart); + } } // namespace margelo::nitro::callstack::testnative diff --git a/example/modules/test-native/nitrogen/generated/android/c++/JHybridTestNativeSpec.hpp b/example/modules/test-native/nitrogen/generated/android/c++/JHybridTestNativeSpec.hpp index 0f32020..b249493 100644 --- a/example/modules/test-native/nitrogen/generated/android/c++/JHybridTestNativeSpec.hpp +++ b/example/modules/test-native/nitrogen/generated/android/c++/JHybridTestNativeSpec.hpp @@ -55,6 +55,7 @@ namespace margelo::nitro::callstack::testnative { public: // Methods std::string doWork(const std::string& traceparent, const std::vector& start, const std::vector& end) override; + void reload() override; private: jni::global_ref _javaPart; diff --git a/example/modules/test-native/nitrogen/generated/android/kotlin/com/margelo/nitro/callstack/testnative/HybridTestNativeSpec.kt b/example/modules/test-native/nitrogen/generated/android/kotlin/com/margelo/nitro/callstack/testnative/HybridTestNativeSpec.kt index 22813fa..e4f7ee1 100644 --- a/example/modules/test-native/nitrogen/generated/android/kotlin/com/margelo/nitro/callstack/testnative/HybridTestNativeSpec.kt +++ b/example/modules/test-native/nitrogen/generated/android/kotlin/com/margelo/nitro/callstack/testnative/HybridTestNativeSpec.kt @@ -32,6 +32,10 @@ abstract class HybridTestNativeSpec: HybridObject() { @DoNotStrip @Keep abstract fun doWork(traceparent: String, start: DoubleArray, end: DoubleArray): String + + @DoNotStrip + @Keep + abstract fun reload(): Unit // Default implementation of `HybridObject.toString()` override fun toString(): String { diff --git a/example/modules/test-native/nitrogen/generated/ios/TestNative-Swift-Cxx-Bridge.hpp b/example/modules/test-native/nitrogen/generated/ios/TestNative-Swift-Cxx-Bridge.hpp index 9372242..87d0a3a 100644 --- a/example/modules/test-native/nitrogen/generated/ios/TestNative-Swift-Cxx-Bridge.hpp +++ b/example/modules/test-native/nitrogen/generated/ios/TestNative-Swift-Cxx-Bridge.hpp @@ -60,5 +60,14 @@ namespace margelo::nitro::callstack::testnative::bridge::swift { inline Result_std__string_ create_Result_std__string_(const std::exception_ptr& error) noexcept { return Result::withError(error); } + + // pragma MARK: Result + using Result_void_ = Result; + inline Result_void_ create_Result_void_() noexcept { + return Result::withValue(); + } + inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept { + return Result::withError(error); + } } // namespace margelo::nitro::callstack::testnative::bridge::swift diff --git a/example/modules/test-native/nitrogen/generated/ios/c++/HybridTestNativeSpecSwift.hpp b/example/modules/test-native/nitrogen/generated/ios/c++/HybridTestNativeSpecSwift.hpp index 811853b..49a883a 100644 --- a/example/modules/test-native/nitrogen/generated/ios/c++/HybridTestNativeSpecSwift.hpp +++ b/example/modules/test-native/nitrogen/generated/ios/c++/HybridTestNativeSpecSwift.hpp @@ -75,6 +75,12 @@ namespace margelo::nitro::callstack::testnative { auto __value = std::move(__result.value()); return __value; } + inline void reload() override { + auto __result = _swiftPart.reload(); + if (__result.hasError()) [[unlikely]] { + std::rethrow_exception(__result.error()); + } + } private: TestNative::HybridTestNativeSpec_cxx _swiftPart; diff --git a/example/modules/test-native/nitrogen/generated/ios/swift/HybridTestNativeSpec.swift b/example/modules/test-native/nitrogen/generated/ios/swift/HybridTestNativeSpec.swift index 6b24028..0f57b09 100644 --- a/example/modules/test-native/nitrogen/generated/ios/swift/HybridTestNativeSpec.swift +++ b/example/modules/test-native/nitrogen/generated/ios/swift/HybridTestNativeSpec.swift @@ -14,6 +14,7 @@ public protocol HybridTestNativeSpec_protocol: HybridObject { // Methods func doWork(traceparent: String, start: [Double], end: [Double]) throws -> String + func reload() throws -> Void } public extension HybridTestNativeSpec_protocol { diff --git a/example/modules/test-native/nitrogen/generated/ios/swift/HybridTestNativeSpec_cxx.swift b/example/modules/test-native/nitrogen/generated/ios/swift/HybridTestNativeSpec_cxx.swift index c26a7a1..b310335 100644 --- a/example/modules/test-native/nitrogen/generated/ios/swift/HybridTestNativeSpec_cxx.swift +++ b/example/modules/test-native/nitrogen/generated/ios/swift/HybridTestNativeSpec_cxx.swift @@ -135,4 +135,15 @@ open class HybridTestNativeSpec_cxx { return bridge.create_Result_std__string_(__exceptionPtr) } } + + @inline(__always) + public final func reload() -> bridge.Result_void_ { + do { + try self.__implementation.reload() + return bridge.create_Result_void_() + } catch (let __error) { + let __exceptionPtr = __error.toCpp() + return bridge.create_Result_void_(__exceptionPtr) + } + } } diff --git a/example/modules/test-native/nitrogen/generated/shared/c++/HybridTestNativeSpec.cpp b/example/modules/test-native/nitrogen/generated/shared/c++/HybridTestNativeSpec.cpp index b31ddb0..1057e90 100644 --- a/example/modules/test-native/nitrogen/generated/shared/c++/HybridTestNativeSpec.cpp +++ b/example/modules/test-native/nitrogen/generated/shared/c++/HybridTestNativeSpec.cpp @@ -15,6 +15,7 @@ namespace margelo::nitro::callstack::testnative { // load custom methods/properties registerHybrids(this, [](Prototype& prototype) { prototype.registerHybridMethod("doWork", &HybridTestNativeSpec::doWork); + prototype.registerHybridMethod("reload", &HybridTestNativeSpec::reload); }); } diff --git a/example/modules/test-native/nitrogen/generated/shared/c++/HybridTestNativeSpec.hpp b/example/modules/test-native/nitrogen/generated/shared/c++/HybridTestNativeSpec.hpp index 2f3d5f1..67b8ebb 100644 --- a/example/modules/test-native/nitrogen/generated/shared/c++/HybridTestNativeSpec.hpp +++ b/example/modules/test-native/nitrogen/generated/shared/c++/HybridTestNativeSpec.hpp @@ -50,6 +50,7 @@ namespace margelo::nitro::callstack::testnative { public: // Methods virtual std::string doWork(const std::string& traceparent, const std::vector& start, const std::vector& end) = 0; + virtual void reload() = 0; protected: // Hybrid Setup diff --git a/example/modules/test-native/src/TestNative.nitro.ts b/example/modules/test-native/src/TestNative.nitro.ts index 4b61904..4d54fb9 100644 --- a/example/modules/test-native/src/TestNative.nitro.ts +++ b/example/modules/test-native/src/TestNative.nitro.ts @@ -4,4 +4,6 @@ import type {HybridObject} from 'react-native-nitro-modules'; export interface TestNative extends HybridObject<{ios: 'swift'; android: 'kotlin'}> { /** Starts and ends `native.work` under `traceparent` ('' = a root) at `start`/`end` ([s, ns]), returns its traceparent. */ doWork(traceparent: string, start: number[], end: number[]): string; + /** Reloads the JS app natively, as OTA updaters do; `DevSettings.reload()` is a no-op in release (Task 27). */ + reload(): void; } diff --git a/example/src/ScenariosScreen.tsx b/example/src/ScenariosScreen.tsx index 139cda3..8537080 100644 --- a/example/src/ScenariosScreen.tsx +++ b/example/src/ScenariosScreen.tsx @@ -8,6 +8,17 @@ import {at} from '../../verify/harness/scenario'; import {allScenarios} from '../../verify/scenarios'; import type {TestNative} from '../modules/test-native/src/TestNative.nitro'; +// Failure scenarios (Task 27) whose e2e test decides when, or whether, anything flushes. +const NO_FLUSH = new Set(['collector-down', 'flush-after-reload', 'background-flush']); +const TEST_MODE = process.env.OTEL_TEST_MODE === '1'; + +// fast-refresh-idempotent (Task 27): the patched functions as first seen; `??=` keeps them across re-evaluations of +// this module, so a refresh that stacked the patch shows `changed`. The e2e edit counts in `__otelRefreshes`. +const g = globalThis as any; +g.__otelFirstPatch ??= {then: Promise.prototype.then, setTimeout: g.setTimeout}; +const patchIdentity = () => + `${g.__otelFirstPatch.then === Promise.prototype.then && g.__otelFirstPatch.setTimeout === g.setTimeout ? 'same' : 'changed'} refreshes=${g.__otelRefreshes ?? 0}`; + // Native-first: MainApplication / AppDelegate ran RNOtel.start (collector URL there); attach and export through the native core. async function runScenario(name: string) { const s = allScenarios().find(x => x.name === name)!; @@ -18,7 +29,7 @@ async function runScenario(name: string) { at, native: NitroModules.createHybridObject('TestNative'), }); - await sdk.forceFlush(); + if (!NO_FLUSH.has(name)) await sdk.forceFlush(); } export function ScenariosScreen() { @@ -40,6 +51,10 @@ export function ScenariosScreen() { ).finally(() => setRunning(null)); }, [running]); + // test-mode only (Task 27): each resolved forceFlush shows `flush-done-`, so a wait never matches a stale one + const [flushes, setFlushes] = useState(0); + const flush = () => startReactNativeSdk().forceFlush().then(() => setFlushes(n => n + 1)); + const press = (name: string) => () => { setStatus(`running ${name}`); setRunning(name); @@ -50,6 +65,19 @@ export function ScenariosScreen() { {testMode} {status === 'done' && done} {status.startsWith('error') && {status}} + {TEST_MODE && ( + + + flush + + {/* DevSettings.reload() is a no-op in release builds; this is the native reload OTA updaters use */} + NitroModules.createHybridObject('TestNative').reload()} style={styles.button}> + reload + + {flushes > 0 && flushed {flushes}} + {patchIdentity()} + + )} {/* compact chips: everything the e2e runner taps must fit one small CI screen, no scrolling */} {allScenarios().map(s => ( diff --git a/ios/Core/OtelCore.swift b/ios/Core/OtelCore.swift index 2e2ff7d..2ec453c 100644 --- a/ios/Core/OtelCore.swift +++ b/ios/Core/OtelCore.swift @@ -61,7 +61,8 @@ package final class OtelCore { OtlpHttpTraceExporter(endpoint: $0, envVarHeaders: config.exportHeaders.map { ($0.key, $0.value) }) } } - bsp = BatchSpanProcessor(spanExporter: exporter) + // test mode: no timed export within a device test, so only flush and background export send (Task 27) + bsp = BatchSpanProcessor(spanExporter: exporter, scheduleDelay: testMode ? 120 : 5) let b = TracerProviderBuilder().with(resource: resource).add(spanProcessor: bsp) tracerProvider = (testMode ? b.with(idGenerator: SequentialIds()) : b).build() } diff --git a/src/sdk/__tests__/start.test.ts b/src/sdk/__tests__/start.test.ts index e87c815..50f099f 100644 --- a/src/sdk/__tests__/start.test.ts +++ b/src/sdk/__tests__/start.test.ts @@ -18,7 +18,7 @@ function fakeOtel({initialized = false, testMode = false, error}: {initialized?: const otel = { initialize(cfg?: SeamConfig) { calls.push(cfg); - if (error) return {alreadyInitialized: false, testMode, error}; + if (error) return {alreadyInitialized: initialized, testMode, error}; if (initialized) return {alreadyInitialized: true, testMode}; if (!cfg) return {alreadyInitialized: false, testMode, error: 'no config'}; initialized = true; @@ -101,6 +101,13 @@ test('init error returns a no-op handle and logs once', () => { expect(isNoop(h)).toBe(true); }); +test('a failed native-first init (sticky, R16) was reported by native: no second report', () => { + fakeOtel({initialized: true, error: 'invalid exportUrl'}); + const h = startReactNativeSdk(); + expect(err).not.toHaveBeenCalled(); + expect(isNoop(h)).toBe(true); +}); + test('never throws on missing config', () => { fakeOtel(); expect(isNoop(startReactNativeSdk())).toBe(true); diff --git a/src/sdk/start.ts b/src/sdk/start.ts index 7ea4034..bfca9b8 100644 --- a/src/sdk/start.ts +++ b/src/sdk/start.ts @@ -36,7 +36,8 @@ function start(config: SdkConfig | undefined): SdkHandle { } const result = native.initialize(config && toSeamConfig(config)); if (result.error) { - console.error(`${TAG} native init failed; telemetry is off: ${result.error}`); + // alreadyInitialized: a failed native-first init sticks (R16) and native already reported it, once + if (!result.alreadyInitialized) console.error(`${TAG} native init failed; telemetry is off: ${result.error}`); return noopHandle(); } if (result.alreadyInitialized && config?.exportConfig) { diff --git a/verify/VERIFY.md b/verify/VERIFY.md index c7d9c9c..7970596 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -69,6 +69,50 @@ an argument) can be off by that skew on iOS. The fake collector listens on port 4318; the app reaches it at `10.0.2.2` (Android emulator) or `localhost` (iOS simulator). +## Failure scenarios (Task 27) + +Each has its own e2e file (R10); the ScenariosScreen does not `forceFlush()` after `collector-down`, +`flush-after-reload` and `background-flush`, so the test decides what exports. Test-mode-only screen controls: +`flush` (a JS `forceFlush()`, shows `flush-done-`), `reload` (`TestNative.reload()`) and `patch-identity`. + +- **Test mode has no timed export.** Test-mode native cores set the batch processor's schedule delay to 120 s + (default 5 s), so within a device test only a flush or the background hook sends anything. Without it, + `background-flush` and `flush-after-reload` would pass on the timer alone. +- `collector-down`: `refuse(503, 3)` after `begin`, `scenario-done` within 2 s, then three `flush` taps (each + resolves while the collector refuses); the span arrives once. Android: otel-java retries a 503 inside the export. + **iOS (X6):** opentelemetry-swift 2.6's `OtlpHttpTraceExporter` does not retry; with its default + `requeueOnFailure: true` it keeps a failed batch in memory and resends it on the next `export` or `flush` (our core + flush calls both). So on iOS the span arrives on the first flush after the collector is back, not by itself; its + batch processor never exports an empty queue. No exception needed, no hand-rolled retry. +- `native-init-failure`: the example's native init gets `exportUrl = "not a url"`, in test-mode builds only (R26). + iOS: launch argument `--otel-export-url=not a url` (AppDelegate, `#if OTEL_TEST_MODE`; the Podfile adds the + condition to the app target). Android: `Application.onCreate` cannot see launch arguments (they reach the + Activity), so the test writes `/sdcard/Android/data/opentelemetry.example/files/otel-export-url` (mode 644, removed + afterwards) and `MainApplication` reads it. Asserted: exactly one log line with `telemetry is off` (native `RNOtel` + plus JS `[react-native-open-telemetry]` lines), `scenario-done` (the no-op `forceFlush()` resolved), and the empty + expected file. JS no longer repeats a native-first failure that native already reported (`alreadyInitialized`). +- `flush-after-reload`: `reload`, then `flush` must resolve within 5 s, the span arrives once. + **Step 0:** `DevSettings.reload()` is a no-op in release builds (JS side, `__DEV__` only), on both platforms. The + example's TestNative `reload()` calls `ReactHost.reload` / `RCTTriggerReloadCommandListeners`, the native reload + that OTA updaters use, so this runs on the release builds, per PR, with no extra build. +- `background-flush`: `device.home()` right after `scenario-done`; something must arrive within 15 s. Android: no + `am_anr` for the app in the events log. Checked: without `home()` nothing arrives within 15 s on either platform. +- `fast-refresh-idempotent` (**local only**: dev builds + Metro, not in CI; nightly can add it, Task 31): each of two + edits of `lib/module/setup.js` appends `globalThis.__otelRefreshes += 1`; Metro hot-updates it, it re-runs + `installContextPatch`, and `patch-identity` must read `same refreshes=` (`then`/`setTimeout` are still the + functions first seen; a full reload would reset the count). Then `nest-after-await` must match its own expected + file. Run it: + + ```sh + cd example/android && OTEL_TEST_MODE=1 ./gradlew :app:assembleDebug -PotelTestMode=true + cd example/ios && OTEL_TEST_MODE=1 xcodebuild -workspace OpenTelemetryExample.xcworkspace -scheme OpenTelemetryExample \ + -configuration Debug -sdk iphonesimulator -derivedDataPath build build + cd example && OTEL_TEST_MODE=1 bunx react-native start # keep running; Android also: adb reverse tcp:8081 tcp:8081 + E2E_DEV=1 bunx e2e run --config verify/e2e/e2e.config.ts --target android-dev,ios-dev fast-refresh-idempotent + ``` + + If watchman reports recrawls, restart Metro: a dead watch never delivers the edit. + ## Android cold start with `RNOtel.start` (Task 24, 2026-11-24) `adb shell am start -W -n opentelemetry.example/.MainActivity` after `am force-stop`, 6 launches each, Pixel_9 @@ -90,16 +134,16 @@ iOS: iPhone 18 Pro simulator, iOS 27.0, Xcode 27.1, agent-device 0.21.36 (T3 dev | Capability | iOS simulator | Android emulator (Pixel_9) | | --- | --- | --- | -| JS reload | ✓ `agent-device metro reload` (Metro re-bundled; screen state reset) | not checked: blocked, see below | -| Fast refresh (dev build) | ✓ editing `ScenariosScreen.tsx` text showed on device with React state kept | not checked | -| Background and back | ✓ `agent-device home`, then `open opentelemetry.example`: UIKit logged the background task end and `UIApplicationWillEnterForegroundNotification`; state kept. `appstate` still says `runningForeground` after `home` (known iOS quirk, documented by e2e), so check lifecycle in the log, not `appstate` | not checked | +| JS reload | ✓ `agent-device metro reload` (Metro re-bundled; screen state reset). Release: native reload via TestNative (Task 27) | ✓ release: native reload via TestNative, e2e `flush-after-reload` (Task 27). `DevSettings.reload()` is a no-op in release | +| Fast refresh (dev build) | ✓ editing `ScenariosScreen.tsx` text showed on device with React state kept | ✓ e2e `fast-refresh-idempotent` on `android-dev` (Task 27) | +| Background and back | ✓ `agent-device home`, then `open opentelemetry.example`: UIKit logged the background task end and `UIApplicationWillEnterForegroundNotification`; state kept. `appstate` still says `runningForeground` after `home` (known iOS quirk, documented by e2e), so check lifecycle in the log, not `appstate` | ✓ `device.home()` in e2e `background-flush` (Task 27) | | Read logs | ✓ `agent-device logs start/stop` captures the app's unified log, `NSLog` lines included (`RNOtel handOff …`). The e2e harness reads with `xcrun simctl spawn log show --predicate 'process == "OpenTelemetryExample" …'` | ✓ via the e2e harness: `adb logcat -d -s RNOtel:I` (tracer-bullet test green; the test was retired in Task 24, R14) | **Blocker (Android, interactive only):** the T3 device panel could not open `Pixel_9`: `Failed to allocate an emulator port for Pixel_9 … avdmanager: … Unable to locate a Java Runtime.` The T3 host process has no `JAVA_HOME`, so `avdmanager list avd` fails. The emulator itself boots and the e2e runner (`@e2e-dev/mobile`, agent-device 0.21.39) drives it fine. Reload / fast refresh / background on Android still need a -check before Task 27; fix the T3 host's Java (or run the check through an e2e test) and fill in the column. +check before Task 27; fix the T3 host's Java (or run the check through an e2e test) and fill in the column. Task 27 filled it in through e2e tests. ## Scenarios @@ -137,11 +181,11 @@ e2e targets are android, ios and web unless the Runners column names them. | `export-headers` | configured export headers are sent on every request | 16, 19, 24, 25 | jest, e2e (android, ios; web with 23) | passing | | `cross-js-to-native` | a native span started from JS is a child of the JS span | 26 | e2e (android, ios) | passing | | `cross-native-to-js` | a JS span started under a native span's context is its child | 26 | e2e (android, ios) | passing | -| `collector-down` | app never blocks; spans arrive exactly once when the collector is back | 27 | e2e | pending | -| `native-init-failure` | one error log, no-op SDK, nothing exported | 27 | e2e (android, ios) | pending | -| `flush-after-reload` | `forceFlush()` resolves across a JS reload; spans arrive once | 27 | e2e (android, ios) | pending | -| `background-flush` | spans are exported on background without `forceFlush()` | 27 | e2e (android, ios) | pending | -| `fast-refresh-idempotent` | fast refresh does not stack the patch: `then`/`setTimeout` keep their identity across refreshes | 27 | e2e | pending | +| `collector-down` | app never blocks; spans arrive exactly once when the collector is back | 27 | e2e (android, ios; web with 23) | passing | +| `native-init-failure` | one error log, no-op SDK, nothing exported | 27 | e2e (android, ios) | passing | +| `flush-after-reload` | `forceFlush()` resolves across a JS reload; spans arrive once | 27 | e2e (android, ios) | passing | +| `background-flush` | spans are exported on background without `forceFlush()` | 27 | e2e (android, ios) | passing | +| `fast-refresh-idempotent` | fast refresh does not stack the patch: `then`/`setTimeout` keep their identity across refreshes | 27 | e2e (android-dev, ios-dev; local only) | passing (local only) | | `smoke-device` | production pipeline (no test mode) exports `smoke` spans | 29 | e2e (android, ios) | pending | | `perf-budget` | hand-off p50 < 100 µs/span, patch ratio < 3× (`artifacts/perf.json`, no shape) | 29 | e2e (android) | pending | diff --git a/verify/e2e/background-flush.e2e.ts b/verify/e2e/background-flush.e2e.ts new file mode 100644 index 0000000..5e0f55c --- /dev/null +++ b/verify/e2e/background-flush.e2e.ts @@ -0,0 +1,22 @@ +import {execFileSync} from 'node:child_process'; +import {expect} from 'e2e'; +import {clearDeviceLog, expectScenario, platformOf, test, until} from './harness'; + +// Spans handed off right before the app goes to background are exported without forceFlush() (§9.4). Test mode has +// no timed export (scheduleDelay 120 s), so within the wait only the background hook can have sent them. +test('background-flush', async ({app, screen, collector, device, target}) => { + const {deviceId} = device.unstable_raw; + const android = platformOf(target) === 'android'; + await expectScenario('background-flush', target, {app, screen, collector}, { + afterDone: async () => { + if (android) await clearDeviceLog('android', deviceId); + await device.home(); + if (!(await until(() => collector.received() > 0, 15_000))) throw new Error('nothing exported within 15 s of going to background'); + }, + }); + // no ANR on Android: the ON_STOP flush only signals the export thread + if (android) + expect(execFileSync('adb', ['-s', deviceId, 'logcat', '-d', '-b', 'events', '-s', 'am_anr'], {encoding: 'utf8'})).not.toContain( + 'opentelemetry.example', + ); +}); diff --git a/verify/e2e/collector-down.e2e.ts b/verify/e2e/collector-down.e2e.ts new file mode 100644 index 0000000..ce4706a --- /dev/null +++ b/verify/e2e/collector-down.e2e.ts @@ -0,0 +1,15 @@ +import {expectScenario, tapFlush, test} from './harness'; + +// Collector down (§9.4): the app does not block, and the span arrives exactly once when the collector is back. +// Android: otel-java retries a 503 inside the export. iOS: opentelemetry-swift does not retry; it requeues the failed +// batch in memory and resends it on the next export or flush (X6), so the test flushes until the refusals are used up. +test('collector-down', async ({app, screen, collector, target}) => { + await expectScenario('collector-down', target, {app, screen, collector}, { + afterBegin: () => collector.refuse(503, 3), // after begin, which clears refusals (F15) + doneTimeout: 2_000, + afterDone: async () => { + // each forceFlush resolves while the collector refuses (native flush timeout 5 s) + for (let n = 1; n <= 3; n++) await tapFlush(screen, n); + }, + }); +}); diff --git a/verify/e2e/e2e.config.ts b/verify/e2e/e2e.config.ts index 00e431b..c3b76f8 100644 --- a/verify/e2e/e2e.config.ts +++ b/verify/e2e/e2e.config.ts @@ -30,5 +30,20 @@ export default { appPath: process.env.E2E_IOS_APP ?? `${example}/ios/build/Build/Products/Release-iphonesimulator/OpenTelemetryExample.app`, }, }, + // Dev builds (Debug + Metro), local only: fast-refresh-idempotent (Task 27). See VERIFY.md. + ...(process.env.E2E_DEV === '1' + ? [ + { + name: 'android-dev', + engine: mobile({platform: 'android', device: process.env.E2E_ANDROID_DEVICE}), + app: {bundleId, appPath: `${example}/android/app/build/outputs/apk/debug/app-debug.apk`}, + }, + { + name: 'ios-dev', + engine: mobile({platform: 'ios', device: process.env.E2E_IOS_DEVICE}), + app: {bundleId, appPath: `${example}/ios/build/Build/Products/Debug-iphonesimulator/OpenTelemetryExample.app`}, + }, + ] + : []), ], } satisfies E2EConfig; diff --git a/verify/e2e/fast-refresh-idempotent.e2e.ts b/verify/e2e/fast-refresh-idempotent.e2e.ts new file mode 100644 index 0000000..4f4f8e5 --- /dev/null +++ b/verify/e2e/fast-refresh-idempotent.e2e.ts @@ -0,0 +1,28 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import {expect} from 'e2e'; +import {expectScenario, test} from './harness'; + +// The module withOtel runs before the app: it installs the patch on every evaluation. +const SETUP = path.join(import.meta.dirname, '..', '..', 'lib', 'module', 'setup.js'); + +// Fast refresh does not stack the context patch (§6.1.3, §9.4). Dev builds + Metro only (E2E_DEV=1, `*-dev` targets). +// Each edit of setup.js makes Metro hot-update it, so it re-evaluates and runs installContextPatch again; the edit +// counts re-evaluations in `__otelRefreshes`. `patch-identity` compares `then`/`setTimeout` with their first values. +test('fast-refresh-idempotent', async ({app, screen, collector, target}) => { + test.skip(!target.endsWith('-dev'), 'needs a dev build and Metro (E2E_DEV=1)'); + const original = fs.readFileSync(SETUP, 'utf8'); + try { + await app.restart(); + await expect(screen.getByTestId('patch-identity')).toHaveText('same refreshes=0', {timeout: 60_000}); + for (const n of [1, 2]) { + fs.writeFileSync(SETUP, `${original}\nglobalThis.__otelRefreshes = (globalThis.__otelRefreshes ?? 0) + 1; // refresh ${n}\n`); + // `same` with the count: a hot update (a full reload would reset the count) and no stacked wrappers + await expect(screen.getByTestId('patch-identity')).toHaveText(`same refreshes=${n}`, {timeout: 30_000}); + } + // and the nesting still holds: the same output as nest-after-await's expected file + await expectScenario('nest-after-await', target, {app, screen, collector}, {launch: async () => {}}); + } finally { + fs.writeFileSync(SETUP, original); + } +}); diff --git a/verify/e2e/flush-after-reload.e2e.ts b/verify/e2e/flush-after-reload.e2e.ts new file mode 100644 index 0000000..032f6c8 --- /dev/null +++ b/verify/e2e/flush-after-reload.e2e.ts @@ -0,0 +1,16 @@ +import {expect} from 'e2e'; +import {expectScenario, tapFlush, test} from './harness'; + +// forceFlush() across a JS reload (§9.4): the span handed off before the reload is still queued in native (JS keeps +// no buffer); after the reload a new JS SDK attaches and its forceFlush() resolves within 5 s and sends it exactly once. +// Test mode has no timed export (scheduleDelay 120 s), so only that flush can have sent it. +test('flush-after-reload', async ({app, screen, collector, target}) => { + await expectScenario('flush-after-reload', target, {app, screen, collector}, { + afterDone: async () => { + await screen.getByTestId('reload').tap(); // native reload (TestNative), test-mode builds only + // the reloaded JS app starts over: the done marker is gone + await expect(screen.getByTestId('scenario-done')).toBeHidden({timeout: 15_000}); + await tapFlush(screen, 1, 5_000); + }, + }); +}); diff --git a/verify/e2e/harness.ts b/verify/e2e/harness.ts index 4d014cd..cf5fd0a 100644 --- a/verify/e2e/harness.ts +++ b/verify/e2e/harness.ts @@ -50,22 +50,38 @@ export const test = base.extend<{target: string}, {collector: Collector; install }, }); +/** Steps the failure scenarios (Task 27) add around the tap-and-compare. */ +export type ScenarioSteps = { + /** Replaces the cold start, e.g. to relaunch with launch arguments. */ + launch?: () => Promise; + /** After `collector.begin` (which clears refusals, F15). */ + afterBegin?: () => void; + /** How long `scenario-done` may take after the tap. */ + doneTimeout?: number; + /** After `scenario-done`, before the collector's output is read. */ + afterDone?: () => Promise; +}; + /** Taps `scenario-`, waits for `scenario-done`, compares what the collector got. */ export async function expectScenario( name: string, target: string, {app, screen, collector}: {app: App; screen: Screen; collector: Collector}, + steps: ScenarioSteps = {}, ) { const s = allScenarios().find(x => x.name === name); if (!s) throw new Error(`unknown scenario ${name}`); test.skip(!s.targets.includes(platformOf(target)), `${name} does not run on ${platformOf(target)}`); - await app.restart(); // cold start per scenario (R5): no SDK state or ID counters carried over + // cold start per scenario (R5): no SDK state or ID counters carried over + await (steps.launch ? steps.launch() : app.restart()); collector.begin(name, platformOf(target)); + steps.afterBegin?.(); let actual; try { await screen.getByTestId(`scenario-${name}`).tap(); - await expect(screen.getByTestId('scenario-done')).toBeVisible({timeout: 30_000}); + await expect(screen.getByTestId('scenario-done')).toBeVisible({timeout: steps.doneTimeout ?? 30_000}); + await steps.afterDone?.(); } finally { actual = await collector.end(); } @@ -75,29 +91,42 @@ export async function expectScenario( if (!r.ok) throw new Error('\n' + r.report); } -// ponytail: clearDeviceLog/deviceLog are unused since the tracer bullet retired (R14); Task 27 reads device logs with them. +/** Taps the test-mode `flush` button (a JS `forceFlush()`) for the `n`th time and waits until it resolved. */ +export async function tapFlush(screen: Screen, n: number, timeout = 10_000) { + await screen.getByTestId('flush').tap(); + await expect(screen.getByTestId(`flush-done-${n}`)).toBeVisible({timeout}); +} + +/** Polls until `ok()` or the timeout; false on timeout. */ +export async function until(ok: () => boolean, timeoutMs: number): Promise { + const end = Date.now() + timeoutMs; + while (!ok() && Date.now() < end) await new Promise(r => setTimeout(r, 250)); + return ok(); +} + +// The SDK's own lines: native (`RNOtel` tag / NSLog prefix) and JS (`[react-native-open-telemetry]`, ReactNativeJS). // iOS: `log show` takes ~60 s per call on a CI runner, so lines are captured live by a `log stream` started in clearDeviceLog. const iosStreams = new Map(); /** Device log lines containing `needle`, logged after the last clearDeviceLog (Android: logcat since the clear; iOS: the live stream). */ -export function deviceLog(platform: 'android' | 'ios', deviceId: string, needle: string, _since: Date): string[] { +export function deviceLog(platform: 'android' | 'ios', deviceId: string, needle: string): string[] { const out = platform === 'android' - ? execFileSync('adb', ['-s', deviceId, 'logcat', '-d', '-v', 'raw', '-s', 'RNOtel:I'], {encoding: 'utf8'}) + ? execFileSync('adb', ['-s', deviceId, 'logcat', '-d', '-v', 'raw', '-s', 'RNOtel:I', 'ReactNativeJS:I'], {encoding: 'utf8'}) : (iosStreams.get(deviceId)?.lines ?? []).join('\n'); return out.split('\n').filter(l => l.includes(needle)); } -/** Starts a fresh log window; returns its start for deviceLog. */ -export async function clearDeviceLog(platform: 'android' | 'ios', deviceId: string): Promise { - if (platform === 'android') execFileSync('adb', ['-s', deviceId, 'logcat', '-c']); +/** Starts a fresh log window for deviceLog (Android: every logcat buffer, events too). */ +export async function clearDeviceLog(platform: 'android' | 'ios', deviceId: string): Promise { + if (platform === 'android') execFileSync('adb', ['-s', deviceId, 'logcat', '-b', 'all', '-c']); else { const state = {lines: [] as string[]}; iosStreams.set(deviceId, state); const child = spawn( 'xcrun', ['simctl', 'spawn', deviceId, 'log', 'stream', '--style', 'compact', '--level', 'info', - '--predicate', 'process == "OpenTelemetryExample" AND eventMessage CONTAINS "RNOtel"'], + '--predicate', 'process == "OpenTelemetryExample" AND (eventMessage CONTAINS "RNOtel" OR eventMessage CONTAINS "[react-native-open-telemetry]")'], {stdio: ['ignore', 'pipe', 'ignore']}, ); child.stdout.setEncoding('utf8'); @@ -107,5 +136,4 @@ export async function clearDeviceLog(platform: 'android' | 'ios', deviceId: stri process.on('exit', () => child.kill()); await new Promise(r => setTimeout(r, 3_000)); // let the stream attach before the tap } - return new Date(); } diff --git a/verify/e2e/native-init-failure.e2e.ts b/verify/e2e/native-init-failure.e2e.ts new file mode 100644 index 0000000..c16c8a9 --- /dev/null +++ b/verify/e2e/native-init-failure.e2e.ts @@ -0,0 +1,36 @@ +import {execFileSync} from 'node:child_process'; +import {expect} from 'e2e'; +import {clearDeviceLog, deviceLog, expectScenario, platformOf, test, until} from './harness'; + +const BAD_URL = 'not a url'; +// Android: Application.onCreate cannot see launch arguments, so the example reads this file instead (test mode only). +// The app creates the directory itself (getExternalFilesDir on every test-mode launch, e.g. the harness warm-up). +const ANDROID_FILE = '/sdcard/Android/data/opentelemetry.example/files/otel-export-url'; + +// Native init failure (§4.4, §9.4): the example's native-first init gets an invalid export URL. The SDK reports it +// exactly once, the app keeps running on a no-op SDK, the no-op forceFlush() resolves (scenario-done), and nothing +// is exported (the expected file is empty). +test('native-init-failure', async ({app, screen, collector, device, target}) => { + const platform = platformOf(target); + const {deviceId} = device.unstable_raw; + const shell = (cmd: string) => execFileSync('adb', ['-s', deviceId, 'shell', cmd]); + try { + await expectScenario('native-init-failure', target, {app, screen, collector}, { + launch: async () => { + await clearDeviceLog(platform, deviceId); + if (platform === 'android') { + shell(`echo '${BAD_URL}' > ${ANDROID_FILE} && chmod 644 ${ANDROID_FILE}`); // the app's own dir; 644 so it may read a shell-owned file + await device.openApp('opentelemetry.example', {relaunch: true}); + } else { + await device.openApp('opentelemetry.example', {relaunch: true, launchArguments: [`--otel-export-url=${BAD_URL}`]}); + } + }, + }); + const lines = () => deviceLog(platform, deviceId, 'telemetry is off'); + await until(() => lines().length > 0, 10_000); + await new Promise(r => setTimeout(r, 2_000)); // a second report would be in by now + expect(lines()).toHaveLength(1); + } finally { + if (platform === 'android') shell(`rm -f ${ANDROID_FILE}`); + } +}); diff --git a/verify/expected/background-flush.android.otlp.json b/verify/expected/background-flush.android.otlp.json new file mode 100644 index 0000000..75f8271 --- /dev/null +++ b/verify/expected/background-flush.android.otlp.json @@ -0,0 +1,35 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "before_background", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000010000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/background-flush.ios.otlp.json b/verify/expected/background-flush.ios.otlp.json new file mode 100644 index 0000000..d697f82 --- /dev/null +++ b/verify/expected/background-flush.ios.otlp.json @@ -0,0 +1,34 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "before_background", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000009984", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/collector-down.android.otlp.json b/verify/expected/collector-down.android.otlp.json new file mode 100644 index 0000000..367c32e --- /dev/null +++ b/verify/expected/collector-down.android.otlp.json @@ -0,0 +1,35 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "work", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000010000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/collector-down.ios.otlp.json b/verify/expected/collector-down.ios.otlp.json new file mode 100644 index 0000000..693713a --- /dev/null +++ b/verify/expected/collector-down.ios.otlp.json @@ -0,0 +1,34 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "work", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000009984", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/flush-after-reload.android.otlp.json b/verify/expected/flush-after-reload.android.otlp.json new file mode 100644 index 0000000..2c9cf5f --- /dev/null +++ b/verify/expected/flush-after-reload.android.otlp.json @@ -0,0 +1,35 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "before_reload", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000010000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/flush-after-reload.ios.otlp.json b/verify/expected/flush-after-reload.ios.otlp.json new file mode 100644 index 0000000..09877f1 --- /dev/null +++ b/verify/expected/flush-after-reload.ios.otlp.json @@ -0,0 +1,34 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "before_reload", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000009984", + "status": {} + } + ] + } + ] + } + ] +} diff --git a/verify/expected/native-init-failure.android.otlp.json b/verify/expected/native-init-failure.android.otlp.json new file mode 100644 index 0000000..0efd939 --- /dev/null +++ b/verify/expected/native-init-failure.android.otlp.json @@ -0,0 +1,3 @@ +{ + "resourceSpans": [] +} diff --git a/verify/expected/native-init-failure.ios.otlp.json b/verify/expected/native-init-failure.ios.otlp.json new file mode 100644 index 0000000..0efd939 --- /dev/null +++ b/verify/expected/native-init-failure.ios.otlp.json @@ -0,0 +1,3 @@ +{ + "resourceSpans": [] +} diff --git a/verify/harness/collector.ts b/verify/harness/collector.ts index 1ac5503..1aae8ec 100644 --- a/verify/harness/collector.ts +++ b/verify/harness/collector.ts @@ -10,6 +10,8 @@ export type Collector = { begin(scenario: string, platform: string): void; end(): Promise; refuse(status: number, count: number): void; + /** Export requests accepted since `begin`. */ + received(): number; close(): Promise; }; @@ -116,6 +118,7 @@ export async function startCollector( refuse(status, count) { refusal = {status, count}; }, + received: () => cur?.n ?? 0, close: () => new Promise(r => { server.closeAllConnections(); diff --git a/verify/scenarios/background-flush.ts b/verify/scenarios/background-flush.ts index a5164e3..3cda83f 100644 --- a/verify/scenarios/background-flush.ts +++ b/verify/scenarios/background-flush.ts @@ -9,5 +9,5 @@ export default scenario( async ({tracer, at}) => { tracer.startSpan('before_background', {startTime: at(0)}).end(at(10)); }, - {runners: ['e2e'], targets: ['android', 'ios'], pending: true}, + {runners: ['e2e'], targets: ['android', 'ios']}, ); diff --git a/verify/scenarios/collector-down.ts b/verify/scenarios/collector-down.ts index 734d08a..331092c 100644 --- a/verify/scenarios/collector-down.ts +++ b/verify/scenarios/collector-down.ts @@ -10,5 +10,5 @@ export default scenario( async ({tracer, at}) => { tracer.startSpan('work', {startTime: at(0)}).end(at(10)); }, - {runners: ['e2e'], pending: true}, + {runners: ['e2e']}, ); diff --git a/verify/scenarios/fast-refresh-idempotent.ts b/verify/scenarios/fast-refresh-idempotent.ts index 0147acc..57d4e95 100644 --- a/verify/scenarios/fast-refresh-idempotent.ts +++ b/verify/scenarios/fast-refresh-idempotent.ts @@ -9,4 +9,4 @@ import nestAfterAwait from './nest-after-await'; * (b) the refresh edit re-evaluates the patch module (otherwise (a) holds trivially). * The `nest-after-await` body then still gives its usual output (one `child` under `parent`). */ -export default scenario('fast-refresh-idempotent', nestAfterAwait.run, {runners: ['e2e'], pending: true}); +export default scenario('fast-refresh-idempotent', nestAfterAwait.run, {runners: ['e2e'], targets: ['android', 'ios']}); diff --git a/verify/scenarios/flush-after-reload.ts b/verify/scenarios/flush-after-reload.ts index b0f69d0..d5d2d34 100644 --- a/verify/scenarios/flush-after-reload.ts +++ b/verify/scenarios/flush-after-reload.ts @@ -9,5 +9,5 @@ export default scenario( async ({tracer, at}) => { tracer.startSpan('before_reload', {startTime: at(0)}).end(at(10)); }, - {runners: ['e2e'], targets: ['android', 'ios'], pending: true}, + {runners: ['e2e'], targets: ['android', 'ios']}, ); diff --git a/verify/scenarios/native-init-failure.ts b/verify/scenarios/native-init-failure.ts index 980d73b..adad98a 100644 --- a/verify/scenarios/native-init-failure.ts +++ b/verify/scenarios/native-init-failure.ts @@ -9,5 +9,5 @@ export default scenario( async ({tracer, at}) => { tracer.startSpan('dropped', {startTime: at(0)}).end(at(10)); }, - {runners: ['e2e'], targets: ['android', 'ios'], pending: true}, + {runners: ['e2e'], targets: ['android', 'ios']}, ); From d6d1af161ea6a6a1ee587aa858304f3aa6f2e5b3 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 05:27:36 +0100 Subject: [PATCH 46/76] test(verify): tighten the failure scenario checks (review minors) collector-down bounds each flush at 6 s and waits 1 s before end() so a late duplicate counts; background-flush asserts the app answers a tap within 2 s after coming back; the install fixture removes a leftover Android export-URL override; VERIFY.md says to run prepare before fast refresh. Co-Authored-By: Claude Opus 5.5 --- ios/Core/OtelCore.swift | 2 +- verify/VERIFY.md | 5 +++-- verify/e2e/background-flush.e2e.ts | 7 +++++-- verify/e2e/collector-down.e2e.ts | 6 +++--- verify/e2e/harness.ts | 6 ++++++ verify/e2e/native-init-failure.e2e.ts | 7 ++++--- 6 files changed, 22 insertions(+), 11 deletions(-) diff --git a/ios/Core/OtelCore.swift b/ios/Core/OtelCore.swift index 2ec453c..2c22b4e 100644 --- a/ios/Core/OtelCore.swift +++ b/ios/Core/OtelCore.swift @@ -62,7 +62,7 @@ package final class OtelCore { } } // test mode: no timed export within a device test, so only flush and background export send (Task 27) - bsp = BatchSpanProcessor(spanExporter: exporter, scheduleDelay: testMode ? 120 : 5) + bsp = BatchSpanProcessor(spanExporter: exporter, scheduleDelay: testMode ? 120 : 5) // 5 s: upstream's default let b = TracerProviderBuilder().with(resource: resource).add(spanProcessor: bsp) tracerProvider = (testMode ? b.with(idGenerator: SequentialIds()) : b).build() } diff --git a/verify/VERIFY.md b/verify/VERIFY.md index 7970596..eb640c2 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -88,7 +88,7 @@ Each has its own e2e file (R10); the ScenariosScreen does not `forceFlush()` aft iOS: launch argument `--otel-export-url=not a url` (AppDelegate, `#if OTEL_TEST_MODE`; the Podfile adds the condition to the app target). Android: `Application.onCreate` cannot see launch arguments (they reach the Activity), so the test writes `/sdcard/Android/data/opentelemetry.example/files/otel-export-url` (mode 644, removed - afterwards) and `MainApplication` reads it. Asserted: exactly one log line with `telemetry is off` (native `RNOtel` + afterwards and before each install's warm-up launch) and `MainApplication` reads it. Asserted: exactly one log line with `telemetry is off` (native `RNOtel` plus JS `[react-native-open-telemetry]` lines), `scenario-done` (the no-op `forceFlush()` resolved), and the empty expected file. JS no longer repeats a native-first failure that native already reported (`alreadyInitialized`). - `flush-after-reload`: `reload`, then `flush` must resolve within 5 s, the span arrives once. @@ -101,7 +101,8 @@ Each has its own e2e file (R10); the ScenariosScreen does not `forceFlush()` aft edits of `lib/module/setup.js` appends `globalThis.__otelRefreshes += 1`; Metro hot-updates it, it re-runs `installContextPatch`, and `patch-identity` must read `same refreshes=` (`then`/`setTimeout` are still the functions first seen; a full reload would reset the count). Then `nest-after-await` must match its own expected - file. Run it: + file. The test edits `lib/`, so run `bun run prepare` first; a killed run leaves the extra line in + `lib/module/setup.js`, which `bun run prepare` clears. Run it: ```sh cd example/android && OTEL_TEST_MODE=1 ./gradlew :app:assembleDebug -PotelTestMode=true diff --git a/verify/e2e/background-flush.e2e.ts b/verify/e2e/background-flush.e2e.ts index 5e0f55c..c03c55b 100644 --- a/verify/e2e/background-flush.e2e.ts +++ b/verify/e2e/background-flush.e2e.ts @@ -1,6 +1,6 @@ import {execFileSync} from 'node:child_process'; import {expect} from 'e2e'; -import {clearDeviceLog, expectScenario, platformOf, test, until} from './harness'; +import {clearDeviceLog, expectScenario, platformOf, tapFlush, test, until} from './harness'; // Spans handed off right before the app goes to background are exported without forceFlush() (§9.4). Test mode has // no timed export (scheduleDelay 120 s), so within the wait only the background hook can have sent them. @@ -12,9 +12,12 @@ test('background-flush', async ({app, screen, collector, device, target}) => { if (android) await clearDeviceLog('android', deviceId); await device.home(); if (!(await until(() => collector.received() > 0, 15_000))) throw new Error('nothing exported within 15 s of going to background'); + // back in the foreground the app answers a tap at once: the background flush left the main thread free + await device.openApp('opentelemetry.example'); + await tapFlush(screen, 1, 2_000); }, }); - // no ANR on Android: the ON_STOP flush only signals the export thread + // and Android recorded no ANR for the app if (android) expect(execFileSync('adb', ['-s', deviceId, 'logcat', '-d', '-b', 'events', '-s', 'am_anr'], {encoding: 'utf8'})).not.toContain( 'opentelemetry.example', diff --git a/verify/e2e/collector-down.e2e.ts b/verify/e2e/collector-down.e2e.ts index ce4706a..8d524f3 100644 --- a/verify/e2e/collector-down.e2e.ts +++ b/verify/e2e/collector-down.e2e.ts @@ -6,10 +6,10 @@ import {expectScenario, tapFlush, test} from './harness'; test('collector-down', async ({app, screen, collector, target}) => { await expectScenario('collector-down', target, {app, screen, collector}, { afterBegin: () => collector.refuse(503, 3), // after begin, which clears refusals (F15) - doneTimeout: 2_000, afterDone: async () => { - // each forceFlush resolves while the collector refuses (native flush timeout 5 s) - for (let n = 1; n <= 3; n++) await tapFlush(screen, n); + // the app never waits on the collector: each forceFlush resolves within the native flush timeout (5 s) + for (let n = 1; n <= 3; n++) await tapFlush(screen, n, 6_000); + await new Promise(r => setTimeout(r, 1_000)); // a late duplicate (iOS requeue) would now count against "once" }, }); }); diff --git a/verify/e2e/harness.ts b/verify/e2e/harness.ts index cf5fd0a..c30f624 100644 --- a/verify/e2e/harness.ts +++ b/verify/e2e/harness.ts @@ -18,6 +18,9 @@ const {compareToExpected} = await import('../harness/compare'); export const {allScenarios} = await import('../scenarios'); type Collector = Awaited>; +/** Test-mode override of the Android example's export URL (MainApplication), written by native-init-failure.e2e.ts. */ +export const ANDROID_EXPORT_URL_FILE = '/sdcard/Android/data/opentelemetry.example/files/otel-export-url'; + /** Must match the example apps' native init URLs (MainApplication.kt, AppDelegate.swift). */ export const COLLECTOR_PORT = 4318; @@ -36,6 +39,9 @@ export const test = base.extend<{target: string}, {collector: Collector; install installed: [ async ({device}, use) => { const {app} = await device.installApp(); + // a killed native-init-failure run must not leave its bad export URL behind for later launches + if (device.unstable_raw.session.includes('android')) + execFileSync('adb', ['-s', device.unstable_raw.deviceId, 'shell', `rm -f ${ANDROID_EXPORT_URL_FILE}`]); // Warm-up launch: on Android the first relaunch right after an install can fail with // "remained foreground after close", and a test retry does not re-run this worker fixture. await device.openApp(app); diff --git a/verify/e2e/native-init-failure.e2e.ts b/verify/e2e/native-init-failure.e2e.ts index c16c8a9..5847022 100644 --- a/verify/e2e/native-init-failure.e2e.ts +++ b/verify/e2e/native-init-failure.e2e.ts @@ -1,11 +1,12 @@ import {execFileSync} from 'node:child_process'; import {expect} from 'e2e'; -import {clearDeviceLog, deviceLog, expectScenario, platformOf, test, until} from './harness'; +import {ANDROID_EXPORT_URL_FILE, clearDeviceLog, deviceLog, expectScenario, platformOf, test, until} from './harness'; const BAD_URL = 'not a url'; // Android: Application.onCreate cannot see launch arguments, so the example reads this file instead (test mode only). -// The app creates the directory itself (getExternalFilesDir on every test-mode launch, e.g. the harness warm-up). -const ANDROID_FILE = '/sdcard/Android/data/opentelemetry.example/files/otel-export-url'; +// The app creates the directory itself (getExternalFilesDir on every test-mode launch, e.g. the harness warm-up), +// and the harness's install fixture removes a file a killed run left behind. +const ANDROID_FILE = ANDROID_EXPORT_URL_FILE; // Native init failure (§4.4, §9.4): the example's native-first init gets an invalid export URL. The SDK reports it // exactly once, the app keeps running on a no-op SDK, the no-op forceFlush() resolves (scenario-done), and nothing From c51b1c84cfbe455fa229a368f51f417943830d4f Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 05:58:32 +0100 Subject: [PATCH 47/76] fix(android): consumer R8 rules for minifying apps (otel-java reflection, optional classes) Expo release builds minify by default; without these R8 fails on otel-java's compile-only references, and with -dontwarn alone every export throws on ResourceMarshaler's reflective Resource.getEntities. Co-Authored-By: Claude Opus 5.5 --- android/build.gradle | 2 ++ android/consumer-rules.pro | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 android/consumer-rules.pro diff --git a/android/build.gradle b/android/build.gradle index 2fc3cb9..ecd4cab 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -32,6 +32,8 @@ android { targetSdkVersion getExtOrIntegerDefault("targetSdkVersion") buildConfigField "boolean", "OTEL_TEST_MODE", otelTestMode.toString() buildConfigField "String", "OTEL_DISTRO_VERSION", "\"${otelDistroVersion}\"" + // apps that minify (Expo's release default) need these + consumerProguardFiles "consumer-rules.pro" externalNativeBuild { cmake { diff --git a/android/consumer-rules.pro b/android/consumer-rules.pro new file mode 100644 index 0000000..a16d7e8 --- /dev/null +++ b/android/consumer-rules.pro @@ -0,0 +1,10 @@ +# otel-java references optional, compile-only classes it never loads at runtime here (no autoconfigure, no incubator, +# annotations only); R8 in a minifying app fails on them as missing. +-dontwarn com.google.auto.value.** +-dontwarn com.google.errorprone.annotations.** +-dontwarn io.opentelemetry.api.incubator.** +-dontwarn io.opentelemetry.sdk.autoconfigure.spi.** + +# otel-java's ResourceMarshaler reaches Resource/ResourceBuilder entity methods by reflection (EntityUtil) on every +# export; renamed or merged, the export throws and nothing is sent. +-keep class io.opentelemetry.sdk.resources.** { *; } From d68af5386c7ee065c616e4bd62328f48e221c2ca Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 05:58:36 +0100 Subject: [PATCH 48/76] feat(example-expo): JS-fallback init verified against the same files Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 162 +++- example-expo/.gitignore | 4 + example-expo/app.json | 10 + example-expo/babel.config.js | 7 + example-expo/bun.lock | 1025 +++++++++++++++++++++++ example-expo/index.js | 16 + example-expo/metro.config.js | 25 + example-expo/package.json | 15 + example-expo/plugins/withOtelExample.js | 25 + example-expo/react-native.config.js | 9 + verify/VERIFY.md | 48 +- verify/e2e/background-flush.e2e.ts | 6 +- verify/e2e/e2e.config.ts | 18 + verify/e2e/harness.ts | 9 +- verify/harness/scenario.ts | 5 +- verify/scenarios/native-init-failure.ts | 3 +- verify/stages/e2e.ts | 2 +- 17 files changed, 1374 insertions(+), 15 deletions(-) create mode 100644 example-expo/.gitignore create mode 100644 example-expo/app.json create mode 100644 example-expo/babel.config.js create mode 100644 example-expo/bun.lock create mode 100644 example-expo/index.js create mode 100644 example-expo/metro.config.js create mode 100644 example-expo/package.json create mode 100644 example-expo/plugins/withOtelExample.js create mode 100644 example-expo/react-native.config.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8aca3d9..56a8edf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -235,8 +235,168 @@ jobs: if-no-files-found: ignore include-hidden-files: true # verify/e2e/.e2e is a dot dir + # The Expo app (Task 28): JS-fallback init, CNG (`expo prebuild` every run; android/ and ios/ are not committed), + # same scenarios and the same android/ios expected files as the bare app. Test mode: OTEL_TEST_MODE=1 at prebuild + # (the local config plugin writes otelTestMode=true to gradle.properties) and at pod install. + e2e-android-expo: + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.2.19 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '17' + - run: bun install --frozen-lockfile + - run: bun install --frozen-lockfile + working-directory: example-expo + - run: bun run prepare # the app bundles the package through exports -> lib/ (R4) + - name: expo prebuild (test mode) + working-directory: example-expo + env: + OTEL_TEST_MODE: '1' + run: bunx expo prebuild --clean --no-install --platform android + - name: Enable KVM + 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: gradle/actions/setup-gradle@v4 + - name: Enable the Gradle build cache (setup-gradle persists it) + run: printf '\norg.gradle.caching=true\n' >> example-expo/android/gradle.properties + - name: Cache native build outputs # after prebuild, which regenerates android/ + uses: actions/cache@v4 + with: + path: | + android/build + android/.cxx + example-expo/android/app/.cxx + example-expo/android/build + example-expo/node_modules/react-native-nitro-modules/android/build + example-expo/node_modules/react-native-nitro-modules/android/.cxx + key: android-expo-native-${{ hashFiles('android/**', 'nitrogen/**', 'patches/**', 'example-expo/app.json', 'example-expo/plugins/**', 'example/modules/**', 'bun.lock', 'example-expo/bun.lock') }} + - name: Build release APK (test mode) + working-directory: example-expo/android + env: + OTEL_TEST_MODE: '1' + # one retry: plugin and NDK downloads fail transiently on hosted runners + run: | + ./gradlew :app:assembleRelease -PreactNativeArchitectures=x86_64 || + ./gradlew :app:assembleRelease -PreactNativeArchitectures=x86_64 + - name: Cache AVD snapshot + uses: actions/cache@v4 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-35-x86_64-google_apis + - name: Create AVD snapshot + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 35 + arch: x86_64 + target: google_apis + force-avd-creation: false + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: false + script: echo "AVD snapshot created" + - name: e2e (android-expo) + uses: reactivecircus/android-emulator-runner@v2 + env: + E2E_TARGET: android-expo + with: + api-level: 35 + arch: x86_64 + target: google_apis + force-avd-creation: false + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + script: | + adb shell settings put global hide_error_dialogs 1 + bun verify --e2e e2e + - uses: actions/upload-artifact@v4 + if: always() # e2e retries once; keep traces of retried and failed attempts + with: + name: verify-artifacts-e2e-android-expo + path: | + verify/artifacts/ + verify/e2e/.e2e/ + if-no-files-found: ignore + include-hidden-files: true # verify/e2e/.e2e is a dot dir + + e2e-ios-expo: + runs-on: xcode-27 + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '27.0' + - uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.2.19 + - run: bun install --frozen-lockfile + - run: bun install --frozen-lockfile + working-directory: example-expo + - run: bun run prepare # the app bundles the package through exports -> lib/ (R4) + - name: expo prebuild + working-directory: example-expo + run: bunx expo prebuild --clean --no-install --platform ios + - name: Cache native build outputs # after prebuild, which regenerates ios/ + uses: actions/cache@v4 + with: + path: | + example-expo/ios/Pods + example-expo/ios/build/Build + example-expo/ios/build/SourcePackages + key: ios-expo-native-${{ hashFiles('ios/**', 'nitrogen/**', 'Package.swift', 'ReactNativeOpenTelemetry.podspec', 'ReactNativeOpenTelemetryCore.podspec', 'example-expo/app.json', 'example-expo/plugins/**', 'example/modules/**', 'bun.lock', 'example-expo/bun.lock') }} + - name: pod install (test mode) + working-directory: example-expo/ios + env: + OTEL_TEST_MODE: '1' + run: pod install + - name: Build release app (test mode) + working-directory: example-expo/ios + env: + OTEL_TEST_MODE: '1' + run: > + xcodebuild -workspace OpenTelemetryExpo.xcworkspace -scheme OpenTelemetryExpo + -configuration Release -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' + -derivedDataPath build ARCHS=arm64 build + - name: Pre-boot the simulator (a cold boot on the runner outlasts agent-device's boot timeout) + run: | + udid=$(xcrun simctl list devices available -j | jq -r '[.devices[][] | select(.name | startswith("iPhone"))][0].udid') + xcrun simctl boot "$udid" + xcrun simctl bootstatus "$udid" -b + - name: e2e (ios-expo) + env: + E2E_TARGET: ios-expo + AGENT_DEVICE_DAEMON_STARTUP_TIMEOUT_MS: '600000' # the first daemon start on a cold runner outlasts the 120 s default + run: bun verify --e2e e2e + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: agent-device-state-e2e-ios-expo + path: ~/.agent-device/ + if-no-files-found: ignore + include-hidden-files: true + - uses: actions/upload-artifact@v4 + if: always() # e2e retries once; keep traces of retried and failed attempts + with: + name: verify-artifacts-e2e-ios-expo + path: | + verify/artifacts/ + verify/e2e/.e2e/ + if-no-files-found: ignore + include-hidden-files: true # verify/e2e/.e2e is a dot dir + budget: - needs: [static-fast, fast-swift, e2e-android-bare, e2e-ios-bare] # every other job; extend when jobs are added + needs: [static-fast, fast-swift, e2e-android-bare, e2e-ios-bare, e2e-android-expo, e2e-ios-expo] # every other job; extend when jobs are added if: always() runs-on: ubuntu-latest timeout-minutes: 5 diff --git a/example-expo/.gitignore b/example-expo/.gitignore new file mode 100644 index 0000000..32c9bb7 --- /dev/null +++ b/example-expo/.gitignore @@ -0,0 +1,4 @@ +# CNG: generated by `expo prebuild` +/android +/ios +.expo/ diff --git a/example-expo/app.json b/example-expo/app.json new file mode 100644 index 0000000..096f1ed --- /dev/null +++ b/example-expo/app.json @@ -0,0 +1,10 @@ +{ + "expo": { + "name": "OpenTelemetryExpo", + "slug": "opentelemetry-example-expo", + "version": "1.0.0", + "ios": {"bundleIdentifier": "opentelemetry.example.expo"}, + "android": {"package": "opentelemetry.example.expo"}, + "plugins": ["./plugins/withOtelExample"] + } +} diff --git a/example-expo/babel.config.js b/example-expo/babel.config.js new file mode 100644 index 0000000..617e515 --- /dev/null +++ b/example-expo/babel.config.js @@ -0,0 +1,7 @@ +// The bare example's inline OTEL_TEST_MODE plugin (test mode is a bundle-time flag). +const [inlineTestMode] = require('../example/babel.config.js').plugins; + +module.exports = { + presets: ['babel-preset-expo'], + plugins: [inlineTestMode], +}; diff --git a/example-expo/bun.lock b/example-expo/bun.lock new file mode 100644 index 0000000..88d9e90 --- /dev/null +++ b/example-expo/bun.lock @@ -0,0 +1,1025 @@ +{ + "lockfileVersion": 1, + "workspaces": { + "": { + "name": "react-native-open-telemetry-example-expo", + "dependencies": { + "expo": "58.0.26", + "react": "19.3.0", + "react-native": "0.88.1", + "react-native-nitro-modules": "0.37.2", + }, + }, + }, + "packages": { + "2g": ["2g@1.0.1", "", { "peerDependencies": { "typescript": ">=5.8.0" }, "optionalPeers": ["typescript"], "bin": { "2g": "bin/cli.js" } }, "sha512-+uViadKOS/wwR4pFu5g8TPn3QHpKqoX19JHCnp8k/3cLpImdcXozwvZA6Q/5PeW3AcU8neL8faaMidBcv7o8CA=="], + + "@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], + + "@babel/compat-data": ["@babel/compat-data@7.29.7", "", {}, "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg=="], + + "@babel/core": ["@babel/core@7.29.13", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.13", "@babel/helper-compilation-targets": "^7.29.13", "@babel/helper-module-transforms": "^7.29.13", "@babel/helpers": "^7.29.13", "@babel/parser": "^7.29.13", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw=="], + + "@babel/generator": ["@babel/generator@7.29.15", "", { "dependencies": { "@babel/parser": "^7.29.15", "@babel/types": "^7.29.15", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-gNWJUX0FlevflramOkaInywOMhU1lkln38gAC7TFZv2tsWbLYbN/2WZFGcq8zbX0Z55e4vGa27IB/NaeZoauWQ=="], + + "@babel/helper-annotate-as-pure": ["@babel/helper-annotate-as-pure@7.29.7", "", { "dependencies": { "@babel/types": "^7.29.7" } }, "sha512-OoK6239jHPuSQOoS0kfTVKn0b/rVTk0seKq4Gd2UMLtmOVLjDC0ki3e+c90Trqv2gMfvJFqkiljrr568+qddiw=="], + + "@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.13", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w=="], + + "@babel/helper-create-class-features-plugin": ["@babel/helper-create-class-features-plugin@7.29.13", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.29.7", "@babel/helper-member-expression-to-functions": "^7.29.7", "@babel/helper-optimise-call-expression": "^7.29.7", "@babel/helper-replace-supers": "^7.29.7", "@babel/helper-skip-transparent-expression-wrappers": "^7.29.13", "@babel/traverse": "^7.29.13", "semver": "^6.3.1" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-fo8/Fr44/DMV71FQjk/HA0Npmu3bo5DFoWTCW1dhUR8Vx3NFfAVeEy0TbcBpt4e+hd2QhdmWgmspHo/9iWj8RA=="], + + "@babel/helper-create-regexp-features-plugin": ["@babel/helper-create-regexp-features-plugin@7.29.14", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.29.7", "regexpu-core": "^6.5.4", "semver": "^6.3.1" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-nKvzhuLMMnFHHsENpUZh4N2e+LqnKDgT0SMibSyv8aW8FqGKWMqLO/zdnRjAYcruH9At6LVicWg7DgTc6IPzNg=="], + + "@babel/helper-define-polyfill-provider": ["@babel/helper-define-polyfill-provider@0.6.8", "", { "dependencies": { "@babel/helper-compilation-targets": "^7.28.6", "@babel/helper-plugin-utils": "^7.28.6", "debug": "^4.4.3", "lodash.debounce": "^4.0.8", "resolve": "^1.22.11" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-47UwBLPpQi1NoWzLuHNjRoHlYXMwIJoBf7MFou6viC/sIHWYygpvr0B6IAyh5sBdA2nr2LPIRww8lfaUVQINBA=="], + + "@babel/helper-globals": ["@babel/helper-globals@7.29.7", "", {}, "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA=="], + + "@babel/helper-member-expression-to-functions": ["@babel/helper-member-expression-to-functions@7.29.14", "", { "dependencies": { "@babel/helper-skip-transparent-expression-wrappers": "^7.29.13", "@babel/traverse": "^7.29.14", "@babel/types": "^7.29.14" } }, "sha512-FuTSn8mXKAP+aHXnbkCYQsQAdlEIJptEutwc2NaPd28hyVqsjRDmBnI2EPJX6HCodKIqOHfayQHqtxQCkqwthA=="], + + "@babel/helper-module-imports": ["@babel/helper-module-imports@7.29.7", "", { "dependencies": { "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g=="], + + "@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.14", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.14" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA=="], + + "@babel/helper-optimise-call-expression": ["@babel/helper-optimise-call-expression@7.29.7", "", { "dependencies": { "@babel/types": "^7.29.7" } }, "sha512-+kmGVjcT9RGYzoDwdwEqEvGgKe3BYq+O1iGzjFubaNgZHwYHP6lsF2Yghf4kEuv9BV7tYDZ913aBW9am6YKong=="], + + "@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], + + "@babel/helper-remap-async-to-generator": ["@babel/helper-remap-async-to-generator@7.29.7", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.29.7", "@babel/helper-wrap-function": "^7.29.7", "@babel/traverse": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-16AMiW26DbXWBbr3B8wNozKM0ydMLB892vaOaJW/fPJdnT8vJk5sdkQcU/isqUxyCE0cEoa8wZOcbgDuC4b6Og=="], + + "@babel/helper-replace-supers": ["@babel/helper-replace-supers@7.29.7", "", { "dependencies": { "@babel/helper-member-expression-to-functions": "^7.29.7", "@babel/helper-optimise-call-expression": "^7.29.7", "@babel/traverse": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-atfGXWSeCiF4DnKZIfmJfQRkSw9b9gNNXR1kqKjbhG4pGYCOnkp8OcTB8E3NXjBu8NpheSnOeNKz8KT7UNFTmQ=="], + + "@babel/helper-skip-transparent-expression-wrappers": ["@babel/helper-skip-transparent-expression-wrappers@7.29.13", "", { "dependencies": { "@babel/traverse": "^7.29.13", "@babel/types": "^7.29.11" } }, "sha512-Abm4rKIH0tmCayJLwcoeOkdzpYUphTbO52fHhyEBHn7S0R+ni4epNLI/8nq1L0DN2Bl0u5qmgWm2Og/z4fBb+Q=="], + + "@babel/helper-string-parser": ["@babel/helper-string-parser@7.29.15", "", {}, "sha512-C2FuapQ2Kh1OnVHAoLi5rD3GBJ8COb9Q609T6HEpLqaBAo560PDP5OxBE5dCI/h951MBO/+bCUYU5SZ+8ZlV+w=="], + + "@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.29.7", "", {}, "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg=="], + + "@babel/helper-validator-option": ["@babel/helper-validator-option@7.29.7", "", {}, "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw=="], + + "@babel/helper-wrap-function": ["@babel/helper-wrap-function@7.29.15", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.15", "@babel/types": "^7.29.15" } }, "sha512-14dKROQSpuNYPw+4wpADe87YLS1VnP/ua3gKTRpEAX1ErBayLMgK/KpWbCP/uYiCSBAVGp/a7bY8MqRfFNRqOQ=="], + + "@babel/helpers": ["@babel/helpers@7.29.15", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.15" } }, "sha512-l+ezV2czw3t2d2ELq+3CwPL4WLKK5O8IywBXb9/gpmbCOVZFmRYJPmHVqSCv2k+8iKbE30Zf54siOoIZ52XOxA=="], + + "@babel/parser": ["@babel/parser@7.29.15", "", { "dependencies": { "@babel/types": "^7.29.15" }, "bin": "./bin/babel-parser.js" }, "sha512-RpKWyisHoP81twtSCgmE02iU0RnPcq1DN5bBEbpUePrjA9Q3wXhufnCJrrayPpoZieqFh3zyZQqwtSK0gGccRA=="], + + "@babel/plugin-proposal-decorators": ["@babel/plugin-proposal-decorators@7.29.7", "", { "dependencies": { "@babel/helper-create-class-features-plugin": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7", "@babel/plugin-syntax-decorators": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-EtU0Hi3GvrTqD56xKmZvV/uCXK2ZbwVNPNLAquVItcAZpUhkXwWlo3Fmj0c2LxgSf2I8IDULeAepwNP1OefLXg=="], + + "@babel/plugin-proposal-export-default-from": ["@babel/plugin-proposal-export-default-from@7.29.15", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-G9TJJ6ZTxhCGuFlYXB2W8ljMXhkaR2nZEV1DVetC0LgwaibQSVBHq2gD4ldxsfT4/vSzy/V2ARtCmGz1NUlSZg=="], + + "@babel/plugin-syntax-decorators": ["@babel/plugin-syntax-decorators@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-9MTTLbF39X6sqM92JPEsoI7++26hjZvzkxKZy64aMhWLH2mPkJ/Q3AV4QLmls3R14FpSpkOwQQfUh962JGQxxg=="], + + "@babel/plugin-syntax-dynamic-import": ["@babel/plugin-syntax-dynamic-import@7.8.3", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ=="], + + "@babel/plugin-syntax-export-default-from": ["@babel/plugin-syntax-export-default-from@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-foag0BB37ROhdeIX9O8G0jX7hw0UekJc04cHMrYLOnrErsnBKqJGHJ8eDRpoCFZBvEPPygmmtw4qyU97qa4oOw=="], + + "@babel/plugin-syntax-flow": ["@babel/plugin-syntax-flow@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-ajMX6QPcyomotqwpzhkYGxcK2i/us0rs1Qo9QvUpa+Fca0FTmqrzKrctoIYLMxcOhGZldGT/BAVkRGTWBiR8gQ=="], + + "@babel/plugin-syntax-jsx": ["@babel/plugin-syntax-jsx@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-TSu8+mHCoEaaCDEZ0I3+6mvTBYR4PCxQwf2z9/r5Tbztv6NaLR3B9thGTTxX2WGuGHJqRiAbKPeGTJ5XWXVg6A=="], + + "@babel/plugin-syntax-nullish-coalescing-operator": ["@babel/plugin-syntax-nullish-coalescing-operator@7.8.3", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ=="], + + "@babel/plugin-syntax-optional-chaining": ["@babel/plugin-syntax-optional-chaining@7.8.3", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg=="], + + "@babel/plugin-syntax-typescript": ["@babel/plugin-syntax-typescript@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA=="], + + "@babel/plugin-transform-async-generator-functions": ["@babel/plugin-transform-async-generator-functions@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7", "@babel/helper-remap-async-to-generator": "^7.29.7", "@babel/traverse": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-d98gXZkgswvkyohMBABkhm3GeXhYj8psWfwQ2C7gtfrKGTykQa/iOIi+JJhwMjPlZ6Vm2XN+DCf3Es1EoG4ZLA=="], + + "@babel/plugin-transform-async-to-generator": ["@babel/plugin-transform-async-to-generator@7.29.7", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7", "@babel/helper-remap-async-to-generator": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-pcUb2SS+RMo9TWVBwKGI5ShtoG7R+zBsFmCKDa6fe8c+hPr3XJlZgoE5j6i8W7gDjhyvy+85vmYexanvXh3d1w=="], + + "@babel/plugin-transform-block-scoping": ["@babel/plugin-transform-block-scoping@7.29.15", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-jfJWMNOYxJUQ3VMdMF0KpmPaugSKRbwLYqxM8UHOga7jKnlbhe18yhBKwiAkaOWrxmxesONjAhtEqTyn2rB2qg=="], + + "@babel/plugin-transform-class-properties": ["@babel/plugin-transform-class-properties@7.29.7", "", { "dependencies": { "@babel/helper-create-class-features-plugin": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-GtcpjFvanPfzNQi3eTitsCqtRRmmqzpy/A+yhTR1HaZo1Ly3EA8ZXxlPyHdR8/IuRMYc3E4wdGBewB2QKQjAaA=="], + + "@babel/plugin-transform-class-static-block": ["@babel/plugin-transform-class-static-block@7.29.14", "", { "dependencies": { "@babel/helper-create-class-features-plugin": "^7.29.13", "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.12.0" } }, "sha512-4rr6WKSu9DzMYpcTlbjHw6hFRk0Gkys3D54mqNE4tOyYQFOTrf3RBhntYH62ec/fbvgGEVATh5cqGZjM2Yc3gw=="], + + "@babel/plugin-transform-classes": ["@babel/plugin-transform-classes@7.29.11", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.29.7", "@babel/helper-compilation-targets": "^7.29.7", "@babel/helper-globals": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7", "@babel/helper-replace-supers": "^7.29.7", "@babel/traverse": "^7.29.10" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-f8kTDM/nTvpLeafb+TJ4jboFr/Y3BbC+QzgPpPGzSKJqWLnj9LW0WLqv4XKA11LX5sr+EgvLE6Ix3YsCEusodw=="], + + "@babel/plugin-transform-destructuring": ["@babel/plugin-transform-destructuring@7.29.13", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7", "@babel/traverse": "^7.29.13" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-X2meXB39NOPPmmshSRJzyd50hX9uCzbscNQwVCjLCtq363PZIJFFxJIeZPpgAewC570vpdeGIHTcltwd0QUlJg=="], + + "@babel/plugin-transform-export-namespace-from": ["@babel/plugin-transform-export-namespace-from@7.29.15", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-wUo8dEPcDN/gO5/ZoNLDcAFqbJ//idBuMpprfa7NAZ6+Y3PRShTNLcgnKnBAW6vnEDMHiPDwDi62mM90qz7mcQ=="], + + "@babel/plugin-transform-flow-strip-types": ["@babel/plugin-transform-flow-strip-types@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7", "@babel/plugin-syntax-flow": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-wRHeUjUjCZnMHmiO5bRgjFLcoEh7JyTdByOW11ahhwNa4V0bmeGEaIvt51yq0zQp2yWIpqfxXXPyUP6GFJZHOQ=="], + + "@babel/plugin-transform-for-of": ["@babel/plugin-transform-for-of@7.29.15", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7", "@babel/helper-skip-transparent-expression-wrappers": "^7.29.13" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-JHa0QfVEG23goXwV1j8HT31EEIZ8nUJBKNTJ/UU1AwfRqY+7xXBEg9M61Tbz60sxKomE2MQBA3vovEbplL964Q=="], + + "@babel/plugin-transform-logical-assignment-operators": ["@babel/plugin-transform-logical-assignment-operators@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-A0H91hh6W8MFRkp5TqJmMr39jzGD1A1E1Ysiv2O06Sfbhkapm+XyIzxWCEh5kqwOZ1/8QZ0dY3SeQ7XBqfJd5Q=="], + + "@babel/plugin-transform-modules-commonjs": ["@babel/plugin-transform-modules-commonjs@7.29.14", "", { "dependencies": { "@babel/helper-module-transforms": "^7.29.14", "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-mbv2yy5dqP6e3DbusCx+5AypXkFbyJD/JhG4/XhA+BIADOw5o7W+X0ewSp/h3w7gRL3oR5yny2/K8ljiydj4uA=="], + + "@babel/plugin-transform-named-capturing-groups-regex": ["@babel/plugin-transform-named-capturing-groups-regex@7.29.7", "", { "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-vuFoLwr4qnv2xbZ16SQd6uPcH5FNrLHhk/Jzo++0XJFcaDsr4gjJVg6j398oMHiC+83k/GiBzviwF5KBJkPUtQ=="], + + "@babel/plugin-transform-nullish-coalescing-operator": ["@babel/plugin-transform-nullish-coalescing-operator@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-idmp1dFaekP9GbcMvG24Kvw2BfhFZjHnNJCkV4WuIY4PskJzwI3f1N5OdgYke38T7rftO6ERulFRn2cFeZwRkg=="], + + "@babel/plugin-transform-object-rest-spread": ["@babel/plugin-transform-object-rest-spread@7.29.7", "", { "dependencies": { "@babel/helper-compilation-targets": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7", "@babel/plugin-transform-destructuring": "^7.29.7", "@babel/plugin-transform-parameters": "^7.29.7", "@babel/traverse": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-Ld98jn4c0smUywL57m7SgsHq3OpThOa6LqZJif3G6jYOovPleoFhVrBJ1WegRApSFB2wu4+RelAj9AC9G08Z4A=="], + + "@babel/plugin-transform-optional-catch-binding": ["@babel/plugin-transform-optional-catch-binding@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-sLsyndxK2VwX6yNUOakMb7Sh553ZTe/vVM1XJ+9Z5aW1ytsc8xOIwmyk05NNjN60vkc5/KqoTH6hB4V41LJhng=="], + + "@babel/plugin-transform-optional-chaining": ["@babel/plugin-transform-optional-chaining@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7", "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-6GM1dhvK3gNODkXcEcMCOLEDCLSoZ/sBbro2Ax8HURyasQ4NshagQixkRFdh5niI6E4gmA/jYI/4aT7rRos3ZQ=="], + + "@babel/plugin-transform-parameters": ["@babel/plugin-transform-parameters@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-ZDOBqV/qLYJI0YElr8DcENEyARsFQeESqWXH6gZlghYXuPPjvweuDhP4VyEi4BlUBlLRFZVjxoZDMjxhLW766g=="], + + "@babel/plugin-transform-private-methods": ["@babel/plugin-transform-private-methods@7.29.7", "", { "dependencies": { "@babel/helper-create-class-features-plugin": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-/6Rz4DK1ETDEM/bWHsPHcaEe7ZaT1EqSXjtSP/L0DijOYuaUhiRiOKcwpZ8P7zR4xXEHc2ITdiCgBm9Tpyv9ug=="], + + "@babel/plugin-transform-private-property-in-object": ["@babel/plugin-transform-private-property-in-object@7.29.7", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.29.7", "@babel/helper-create-class-features-plugin": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-+BNo06dnrzdNNqCm1X6YUaVv0DKk8Q+JYcoZfOkLhYWNCXzlwTSRq8zGWayT1csjcpNXV9CQTBRRbmTLZac5cA=="], + + "@babel/plugin-transform-react-display-name": ["@babel/plugin-transform-react-display-name@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-+1wdDMGNb4UPeY3Q4L5yLiYe6TXPXubs4NjrgRFw13hPRLJfEMw2Q5OXkee6/IfdqePIeW4Jjwe3aBh7SdKz4Q=="], + + "@babel/plugin-transform-react-jsx": ["@babel/plugin-transform-react-jsx@7.29.7", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.29.7", "@babel/helper-module-imports": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7", "@babel/plugin-syntax-jsx": "^7.29.7", "@babel/types": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-WsZulLVBUHXVj2cUcPVx6UE21TpalB6bHbSFErKT0Ib++ax24jjXe73FqlWvdylFOjiuPHYi6VCcgRad1ItN+A=="], + + "@babel/plugin-transform-react-jsx-development": ["@babel/plugin-transform-react-jsx-development@7.29.7", "", { "dependencies": { "@babel/plugin-transform-react-jsx": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-Xfy3UVMF04+ypnFbkhvfqtmvwfe92qwQdbGZVonhE+6v35GzlofmOnA1szaZqzb9xYWr0nl1e5EMmzi0DNON1g=="], + + "@babel/plugin-transform-react-pure-annotations": ["@babel/plugin-transform-react-pure-annotations@7.29.7", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-H5E+HBgDpr6Q5t+Aj11tL7XkIui1jhbIoArVQnqjgXo5/3YxkN7ZEBcWF4RQlB0T4rrxJQbXS6kiFV6B7XTqUA=="], + + "@babel/plugin-transform-runtime": ["@babel/plugin-transform-runtime@7.29.7", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7", "babel-plugin-polyfill-corejs2": "^0.4.14", "babel-plugin-polyfill-corejs3": "^0.13.0", "babel-plugin-polyfill-regenerator": "^0.6.5", "semver": "^6.3.1" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-xmAscdE/AsqRW7vutbPNoUmu/nF5SrLKPs7aoJgEjo35lLKA/Bc0i2rMv/hr1+Y0o1bQCiVtith3u2vdgRL39Q=="], + + "@babel/plugin-transform-typescript": ["@babel/plugin-transform-typescript@7.29.15", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.29.7", "@babel/helper-create-class-features-plugin": "^7.29.13", "@babel/helper-plugin-utils": "^7.29.7", "@babel/helper-skip-transparent-expression-wrappers": "^7.29.13", "@babel/plugin-syntax-typescript": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-FFuMssbHj8DFMDsTH8xrgKBiE1eXuDvO9jLqav7/vsIe6YdoyPQbWCgLNzQxkcIkOv5itBD17TvZkHGIjUMzLg=="], + + "@babel/plugin-transform-unicode-regex": ["@babel/plugin-transform-unicode-regex@7.29.7", "", { "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-7D/x/23/d/3VqZ0QA+LGbZMlGwZjztBygSWWWsfTPoQ1oQ6Q1P6Mr3d0kk42XabyUVw+fha3LqdRsFqeKqvCyA=="], + + "@babel/preset-typescript": ["@babel/preset-typescript@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "@babel/plugin-syntax-jsx": "^7.29.7", "@babel/plugin-transform-modules-commonjs": "^7.29.7", "@babel/plugin-transform-typescript": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-/Foi8vKY2EVbed/1eZx0gJEEwHAIxogrySI7rULcRIvhZzbvoE/b5qG5Ghc0WKAFKOHA9SD1x7RsFlOYdutIiQ=="], + + "@babel/runtime": ["@babel/runtime@7.29.15", "", {}, "sha512-304gsbbGVmQc+cNGHzwHBlqepYdWLKj3VXCQBGt/EGcV7PUPfKI7kAUNW1FZEOCwlQiLvQjg1JEaAlRQ616h+Q=="], + + "@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], + + "@babel/traverse": ["@babel/traverse@7.29.15", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.15", "@babel/helper-globals": "^7.29.7", "@babel/parser": "^7.29.15", "@babel/template": "^7.29.7", "@babel/types": "^7.29.15", "debug": "^4.3.1" } }, "sha512-ZfawBo2i8vvt+BTt37dWDKBPjUfm/H+bw+ltwsCRhW7gPtyNVwUXuNo54eO2Xo+P4VXpalPFfFISbBTRKC8SOQ=="], + + "@babel/types": ["@babel/types@7.29.15", "", { "dependencies": { "@babel/helper-string-parser": "^7.29.15", "@babel/helper-validator-identifier": "^7.29.7" } }, "sha512-/XKpKDakL//LZ66bq1XsZOswuqeI5MZqPLDu18o3XdkU1fNJ7bdPtzgnc4ZNS+bBGHV0FJG8jjb8SwcC3nNVQQ=="], + + "@expo/cli": ["@expo/cli@58.1.21", "", { "dependencies": { "2g": "^1.0.1", "@expo/code-signing-certificates": "^0.0.7", "@expo/config": "~58.0.12", "@expo/config-plugins": "~58.0.13", "@expo/devcert": "^1.2.2", "@expo/env": "~2.6.0", "@expo/image-utils": "^0.12.7", "@expo/inline-modules": "^0.2.10", "@expo/json-file": "^11.2.1", "@expo/log-box": "^58.0.15", "@expo/log-box-utils": "^58.0.2", "@expo/metro": "~58.0.0", "@expo/metro-config": "58.0.23", "@expo/metro-file-map": "^58.0.6", "@expo/osascript": "^2.8.1", "@expo/package-manager": "^1.14.2", "@expo/platforms": "^58.0.1", "@expo/plist": "^0.10.2", "@expo/prebuild-config": "^58.0.20", "@expo/require-utils": "^58.0.6", "@expo/router-server": "^58.0.23", "@expo/schema-utils": "^58.0.3", "@expo/spawn-async": "^1.8.0", "@expo/ws-tunnel": "^2.0.1", "@expo/xcpretty": "^4.4.6", "@react-native/asset-utils": "0.88.1", "@react-native/dev-middleware": "0.88.1", "@react-native/js-polyfills": "0.88.1", "accepts": "^1.3.8", "agent-cli-detector": "0.1.7", "arg": "^5.0.2", "bplist-creator": "0.1.0", "bplist-parser": "^0.3.1", "chalk": "^4.0.0", "ci-info": "^3.3.0", "compression": "^1.7.4", "connect": "^3.7.0", "dnssd-advertise": "^1.1.6", "expo-server": "^58.1.0", "fetch-nodeshim": "^0.4.10", "lan-network": "^0.2.1", "multitars": "^1.0.2", "node-forge": "^1.4.0", "npm-package-arg": "^11.0.0", "ora": "^3.4.0", "picomatch": "^4.0.4", "pretty-format": "^29.7.0", "progress": "^2.0.3", "prompts": "^2.3.2", "resolve-from": "^5.0.0", "sandbox-cli-detector": "^0.2.0", "semver": "^7.7.4", "send": "^0.19.0", "slugify": "^1.3.4", "stacktrace-parser": "^0.1.10", "structured-headers": "^0.4.1", "terminal-link": "^2.1.1", "tinyglobby": "^0.2.15", "toqr": "^0.1.1", "wrap-ansi": "^7.0.0", "ws": "^8.12.1" }, "peerDependencies": { "expo": "*", "expo-mcp": "*", "expo-router": "*", "react-native": "*" }, "optionalPeers": ["expo-mcp", "expo-router", "react-native"], "bin": { "expo-internal": "bin/cli.js" } }, "sha512-E+27FQ1Y26fVb0p1wVHBFkbe5oQubUXLwF/au5Vy8OCqDWrmbekBQamRI4mBhY15FhZQxAkyK0e6hXcEFKVBOw=="], + + "@expo/code-signing-certificates": ["@expo/code-signing-certificates@0.0.7", "", { "dependencies": { "node-forge": "^1.4.0" } }, "sha512-zP0tnfqrFFRL8INtOaQ6XwEYfdIpIH9vrEo7y0bHQGQa50z4/QWXE5CI4nRUHxqFW4MVWOwXFg1hom1aAZHNkQ=="], + + "@expo/config": ["@expo/config@58.0.12", "", { "dependencies": { "@expo/config-plugins": "~58.0.13", "@expo/config-types": "^58.0.3", "@expo/json-file": "^11.2.1", "@expo/platforms": "^58.0.1", "@expo/require-utils": "^58.0.6", "resolve-workspace-root": "^2.0.0", "semver": "^7.7.4", "slugify": "^1.3.4" } }, "sha512-Ch/4Cb8womWYpY1zI4BEEYT1rGuKti8O8aSzyAM79xNTVRx6nPw2h9j91Knq95OSH3wtjrcthZwVYZ3po4igNg=="], + + "@expo/config-plugins": ["@expo/config-plugins@58.0.13", "", { "dependencies": { "@expo/config-types": "^58.0.3", "@expo/json-file": "~11.2.1", "@expo/plist": "^0.10.2", "@expo/require-utils": "^58.0.6", "@expo/sdk-runtime-versions": "^1.0.1", "chalk": "^4.1.2", "debug": "^4.3.5", "semver": "^7.7.4", "slugify": "^1.6.6", "tinyglobby": "^0.2.15", "xcode": "^4.0.0", "xml2js": "0.6.0" } }, "sha512-Vbkt0vpIJ9z+oCFr2simtfuiPxdpIovDgYnzenC9z7jX0rlo8nTLGQky+q+SJdovIbyymGAO45UR0YqwLgbvKw=="], + + "@expo/config-types": ["@expo/config-types@58.0.3", "", {}, "sha512-wyfrwkTT/hQHzwyqkXkngKxoOa8L6ovsTP4h/UukS1mTmssee5et6HOPoN5RtawdJPnm5JO28f//C/wXlpka8Q=="], + + "@expo/devcert": ["@expo/devcert@1.2.2", "", { "dependencies": { "@expo/sudo-prompt": "^9.3.1", "debug": "^3.1.0" } }, "sha512-wz1YedXwdNbYqk/PRr34vixnuw1+l6uSwmPXUj649cot5iYNccb2zIOnK7Nonb1Pfd/dxAY6CvU6KM3uSdxC7A=="], + + "@expo/devtools": ["@expo/devtools@58.0.2", "", { "dependencies": { "chalk": "^4.1.2" }, "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" }, "optionalPeers": ["expo", "react", "react-native"] }, "sha512-WBj/K+vv8JPSmY70ennL04YYOHkpEsGGkfuVY9lfv4XO7Qhbt5qz4q6W7maME194I5oGcimRMigUFfWNkBe90w=="], + + "@expo/dom-webview": ["@expo/dom-webview@58.0.2", "", { "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-bLkREoP7qL3rEuzxP60xG+TjdPoGjbnZfxkvYo5imJxGWfKMOf7x962W06Pu+WWAr4gcDRk16iA+Clg8D0zjCg=="], + + "@expo/env": ["@expo/env@2.6.0", "", { "dependencies": { "chalk": "^4.0.0", "debug": "^4.3.4" } }, "sha512-pSNESQU0IGhLs/A3QlNPoh/acb1vWU7N721OjaIm3JT8yzgZymIM/m4x2y73YwpEtqgwWsCl6+japtq2PtXIPw=="], + + "@expo/fingerprint": ["@expo/fingerprint@0.21.10", "", { "dependencies": { "@expo/env": "^2.6.0", "@expo/spawn-async": "^1.8.0", "arg": "^5.0.2", "chalk": "^4.1.2", "debug": "^4.3.4", "ignore": "^5.3.1", "minimatch": "^10.2.6", "resolve-from": "^5.0.0", "semver": "^7.7.4" }, "bin": { "fingerprint": "bin/cli.js" } }, "sha512-u73rWDHOYijO1wT60uKjtuoGBKsU9/MFSh7WEE63K2jJ0ML8eycUCXF9FmLf3EVzzIjYIPu6Ns04LR7FVGh6mA=="], + + "@expo/image-utils": ["@expo/image-utils@0.12.7", "", { "dependencies": { "@expo/require-utils": "^58.0.6", "@expo/spawn-async": "^1.8.0", "chalk": "^4.0.0", "jimp-compact": "0.16.1", "parse-png": "^2.1.0", "semver": "^7.7.4" } }, "sha512-fuiRQxvvkbj932BamtYh1UKuyRJ5tXBJ3XxpGm5pT4zzynPmygd3RtOQrzIhcsIZGcG6i1n+KvrszYRnk3evqQ=="], + + "@expo/inline-modules": ["@expo/inline-modules@0.2.10", "", { "dependencies": { "@expo/config-plugins": "~58.0.13" } }, "sha512-WFqhlOrUUc0VZxrUPq5X328aP2e/cQKvJJXhwNxNj9fqWS9iFWC1E9VRHHhJIqdu+qy2YU3s2OBDlyIz9X/5aA=="], + + "@expo/json-file": ["@expo/json-file@11.2.1", "", { "dependencies": { "@babel/code-frame": "^7.20.0", "json5": "^2.2.3" } }, "sha512-UPhKoFCj8BcwgLB1rKQ1CuR/REITnZLiqxHEHOeH1tPsdXcHGtUDh0P5bLbr7oU0nKVdtJ5rzyKx8jniMQdESQ=="], + + "@expo/local-build-cache-provider": ["@expo/local-build-cache-provider@58.0.12", "", { "dependencies": { "@expo/config": "~58.0.12", "chalk": "^4.1.2" } }, "sha512-2fpz4A+cf7YybeVx6lc/kulUpMLOv0OrlhdcvOpMCQG/9Wp5IBOZUgykSN86wmU5ZGJe4JeDJ4Soq5H3hfvzIw=="], + + "@expo/log-box": ["@expo/log-box@58.0.15", "", { "dependencies": { "@expo/dom-webview": "^58.0.2", "@expo/log-box-utils": "^58.0.2", "anser": "^1.4.9", "stacktrace-parser": "^0.1.10" }, "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" }, "optionalPeers": ["expo"] }, "sha512-IBpaJcTdJlSqmiEtyI9XDiNPSRUZNpeWdRbzE4ic6I4k17mpy0LxWJ4Mz2hB7B48b9BrleUKFeZ+6VseglmvGQ=="], + + "@expo/log-box-utils": ["@expo/log-box-utils@58.0.2", "", {}, "sha512-My8Lwe9FU/yDwwzqwi5LN2rzzDcJqIAZKrD9f0XHZEKz/FQnWJYdt1rsV7+RwqMGeGq2XsxTCVT1ggTCOvumxw=="], + + "@expo/metro": ["@expo/metro@58.0.0", "", { "dependencies": { "metro": "0.87.1", "metro-babel-transformer": "0.87.1", "metro-cache": "0.87.1", "metro-cache-key": "0.87.1", "metro-config": "0.87.1", "metro-core": "0.87.1", "metro-file-map": "0.87.1", "metro-minify-terser": "0.87.1", "metro-resolver": "0.87.1", "metro-runtime": "0.87.1", "metro-source-map": "0.87.1", "metro-symbolicate": "0.87.1", "metro-transform-plugins": "0.87.1", "metro-transform-worker": "0.87.1" } }, "sha512-PMD640ihB0C3Oqm0AnDVJ/8qF2cKbRUEqGuSOr4tM/OTb9ktxsQqsiSSSeaOEgdCZBq20AxRS0d6WHNhhH2P+g=="], + + "@expo/metro-config": ["@expo/metro-config@58.0.23", "", { "dependencies": { "2g": "^1.0.1", "@babel/code-frame": "^7.20.0", "@babel/core": "^7.20.0", "@babel/generator": "^7.20.5", "@expo/config": "~58.0.12", "@expo/env": "~2.6.0", "@expo/json-file": "~11.2.1", "@expo/metro": "~58.0.0", "@expo/platforms": "^58.0.1", "@expo/require-utils": "^58.0.6", "@expo/spawn-async": "^1.8.0", "@jridgewell/gen-mapping": "^0.3.13", "@jridgewell/remapping": "^2.3.5", "@jridgewell/sourcemap-codec": "^1.5.5", "@jridgewell/trace-mapping": "^0.3.31", "@react-native/js-polyfills": "0.88.1", "browserslist": "^4.25.0", "chalk": "^4.1.0", "debug": "^4.3.2", "hermes-parser": "^0.36.0", "jsc-safe-url": "^0.2.4", "lightningcss": "^1.30.1", "noxcturnal": "^0.1.14", "picomatch": "^4.0.4", "postcss": "^8.5.23", "resolve-from": "^5.0.0", "tinyglobby": "^0.2.15" }, "peerDependencies": { "expo": "*" }, "optionalPeers": ["expo"] }, "sha512-cEFdrMxH4cddH9rHDg2FxUAl4FUC7TBs8d8GYE1r+zXOjsScoKrQhMtLOPqIc2VEj3ehUFvto3EycrEgrWck+A=="], + + "@expo/metro-file-map": ["@expo/metro-file-map@58.0.6", "", { "dependencies": { "2g": "^1.0.1", "debug": "^4.3.4", "fb-watchman": "^2.0.2", "invariant": "^2.2.4", "jest-worker": "^29.7.0", "walker": "^1.0.8" } }, "sha512-+kPFI328BSUxpK7OO0kM31NQlYG/z7WOTISbPEuY4fMZxmN/nLnmJIDNG8NTtM5ZHXlNPqgjRvdukxtsBEkvuw=="], + + "@expo/modules-macros-linux-arm64": ["@expo/modules-macros-linux-arm64@0.33.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-5F4L/IJThOBq3oRo9NB5BI4+Od8K2YDTbU+2IHgsnXsrTc5icQtOlLwHOEfExghjo0PHCXGap4zprfOKvtANxw=="], + + "@expo/modules-macros-linux-x64": ["@expo/modules-macros-linux-x64@0.33.0", "", { "os": "linux", "cpu": "x64" }, "sha512-G3kxfmMpH7BDtoeBVeJA4vh5O3kQ3wmjmSfDremRBWENHKwHJXTOsyerLQqkJC39oPKCuXgXhzvp+/5qy+DyvA=="], + + "@expo/modules-macros-win32-arm64": ["@expo/modules-macros-win32-arm64@0.33.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-sAYEhKqywo+38UcWt1KLNzJkSkpba4HYybSSZfpFsoA28/MCBupFZggkbU/E9z81fZeuiWVA2Ote1fp8ogqRAA=="], + + "@expo/modules-macros-win32-x64": ["@expo/modules-macros-win32-x64@0.33.0", "", { "os": "win32", "cpu": "x64" }, "sha512-O7tmET8ehVpmocxpVUlXkV9yfKCNo3uKvpN7wNyWcJlEIM6xo+WZuN4RDtndExI6CE5wn8Io608US+BYtrE9+w=="], + + "@expo/osascript": ["@expo/osascript@2.8.1", "", { "dependencies": { "@expo/spawn-async": "^1.8.0" } }, "sha512-SCi+6q6uOkGhiAn6AIP/OPFgaIq/iKD2oYpnAOg2rShHStJ8ey7wyT127RbOaZXmlcY/62rHOX1WiiMnD8u/BA=="], + + "@expo/package-manager": ["@expo/package-manager@1.14.2", "", { "dependencies": { "@expo/json-file": "^11.2.1", "@expo/spawn-async": "^1.8.0", "chalk": "^4.0.0", "npm-package-arg": "^11.0.0", "ora": "^3.4.0", "resolve-workspace-root": "^2.0.0" } }, "sha512-sftl0eRVVCarI6grMdjAB3jX2pX1Mt3cdSnajlXS4QyeDkaKRM/ntBy6dcagj1VL0+cEfEqctlyvinmlZdNubg=="], + + "@expo/platforms": ["@expo/platforms@58.0.1", "", {}, "sha512-KtLrtAvpShq16l9lTxd2fZSjULxcGxXrJTHA31iUVqrc+Af7aTAJW4ZB3yQBgi/w+kSb6BB/CG9RXI0ohbMm6g=="], + + "@expo/plist": ["@expo/plist@0.10.2", "", { "dependencies": { "@xmldom/xmldom": "^0.8.8", "xmlbuilder": "^15.1.1" } }, "sha512-kaCDdGLtezkt5s1w7iCaISNJ+RkNac/1yBYYE8XyXLSJu3czGHZKzJGQ8fFOrpEGm6GdlIHFpzVeiF01ZVyHyg=="], + + "@expo/prebuild-config": ["@expo/prebuild-config@58.0.20", "", { "dependencies": { "@expo/config": "~58.0.12", "@expo/config-plugins": "~58.0.13", "@expo/config-types": "^58.0.3", "@expo/image-utils": "^0.12.7", "@expo/json-file": "^11.2.1", "@react-native/normalize-colors": "0.88.1", "debug": "^4.3.1", "expo-modules-autolinking": "~58.1.0", "resolve-from": "^5.0.0", "semver": "^7.7.4" } }, "sha512-lqXK5d6ni2MCNO/MbuXhojKC+Iy/gaYm0a3vVebwf/njoe1Fp3iw8mXDwoofmvlzZ3HO+beL7XCX6e6ZEYmVyg=="], + + "@expo/require-utils": ["@expo/require-utils@58.0.6", "", { "dependencies": { "@babel/code-frame": "^7.20.0", "@babel/core": "^7.25.2", "@babel/plugin-transform-modules-commonjs": "^7.24.8" }, "peerDependencies": { "typescript": "^5.0.0 || ^5.0.0-0 || ^6.0.0 || ^7.0.0" }, "optionalPeers": ["typescript"] }, "sha512-k9Ce7indjY3+nRBNT6wKw7NghN7pP6WhFnYNjuDiAypwjtVgaZHpD9fo0/g3/emDUpM6ebl8Ekz/teyUGfD9og=="], + + "@expo/router-server": ["@expo/router-server@58.0.23", "", { "dependencies": { "debug": "^4.3.4" }, "peerDependencies": { "@expo/metro-runtime": "^58.0.17", "expo": "*", "expo-constants": "^58.0.16", "expo-font": "^58.0.12", "expo-router": "*", "expo-server": "^58.1.0", "react": "*", "react-dom": "*", "react-server-dom-webpack": "~19.0.1 || ~19.1.2 || ~19.2.1 || ~19.3.0" }, "optionalPeers": ["@expo/metro-runtime", "expo-router", "react-dom", "react-server-dom-webpack"] }, "sha512-Vcd/mskn2BSGt9dVAzAKlUFGbagfUlMT3afTgkw7KDpn8pwtkbm6M4g11158OcVSZ10m3VLvoySeZDFPskHLaQ=="], + + "@expo/schema-utils": ["@expo/schema-utils@58.0.3", "", {}, "sha512-DwoMEpT3H+r1lU+YUEP10UcUW7sDKmfvgE7oA+zQeuGyi0XxDSDgRZUUZ5nOGp+lymmTicoIUKkoN7rByuI04g=="], + + "@expo/sdk-runtime-versions": ["@expo/sdk-runtime-versions@1.0.1", "", {}, "sha512-kvisefkhxu8Fm/4M8G6DEqUaigrXfrSOm2lFw7hsk/nq0zchcp6B4wSk8rlheHY8FRi5iHxKtoVMGY/3M6h04A=="], + + "@expo/spawn-async": ["@expo/spawn-async@1.8.0", "", { "dependencies": { "cross-spawn": "^7.0.6" } }, "sha512-eb9xxd/LbuEGSdua4NumCu/McVB9EM+F/JxB9pWgnERw4HQ9XyTNH1KapG6oqLWR8TuRK2LQfzJlmNi94CVobw=="], + + "@expo/sudo-prompt": ["@expo/sudo-prompt@9.3.2", "", {}, "sha512-HHQigo3rQWKMDzYDLkubN5WQOYXJJE2eNqIQC2axC2iO3mHdwnIR7FgZVvHWtBwAdzBgAP0ECp8KqS8TiMKvgw=="], + + "@expo/ws-tunnel": ["@expo/ws-tunnel@2.0.1", "", { "peerDependencies": { "ws": "^8.0.0" } }, "sha512-mljsRffbOHzmSimYQbQu9h9NR3alwCCwEEouRGFL4QRTt8dNvsNtKEPa/5jHmtDLDtsh4xXsWKwzjN9BTpeXHQ=="], + + "@expo/xcpretty": ["@expo/xcpretty@4.4.7", "", { "dependencies": { "@babel/code-frame": "^7.20.0", "chalk": "^4.1.0", "js-yaml": "^4.1.0" }, "bin": { "excpretty": "build/cli.js" } }, "sha512-EbxYllZ7/ozONVZd425cm4XnolfW+AmSFT5aP7Jdno6oc3WrYQcHz2CO20z/2rwWwYgztmV2PXvYH+BQ8YFjqg=="], + + "@isaacs/ttlcache": ["@isaacs/ttlcache@1.4.1", "", {}, "sha512-RQgQ4uQ+pLbqXfOmieB91ejmLwvSgv9nLx6sT6sD83s7umBypgg+OIBOBbEUiJXrfpnp9j0mRhYYdzp9uqq3lA=="], + + "@jest/schemas": ["@jest/schemas@29.6.3", "", { "dependencies": { "@sinclair/typebox": "^0.27.8" } }, "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA=="], + + "@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=="], + + "@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="], + + "@jridgewell/remapping": ["@jridgewell/remapping@2.3.5", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="], + + "@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.3", "", {}, "sha512-lhTtjtoEArWBjismtfS761S9Hlyn+nIZqOZVYoZ1Xn82PMNMVnk+jj/NhC4fAXGTs7ydONcJiR5vyQBTMDu27g=="], + + "@jridgewell/source-map": ["@jridgewell/source-map@0.3.11", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25" } }, "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA=="], + + "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.6.0", "", {}, "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw=="], + + "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="], + + "@noxcturnal/noxcturnal-darwin-arm64": ["@noxcturnal/noxcturnal-darwin-arm64@0.1.14", "", { "os": "darwin", "cpu": "arm64" }, "sha512-5g1fvtfmDsaDzNoqZicO7UKUUaGm9HOTJy30KNxXbSJRreLOQwK0fd0wuAA0OEbBgJSQAvVdAovpjT5HvYRIWw=="], + + "@noxcturnal/noxcturnal-darwin-x64": ["@noxcturnal/noxcturnal-darwin-x64@0.1.14", "", { "os": "darwin", "cpu": "x64" }, "sha512-rnZ8LRa+rYOyHmPS2PpPgxRHaeU0zJZ7Ii8huuAMbADfJHGceGBU8SQYqd7+Vs1VwSUcxRm4BMC4+QL1IgdqrA=="], + + "@noxcturnal/noxcturnal-linux-arm64-gnu": ["@noxcturnal/noxcturnal-linux-arm64-gnu@0.1.14", "", { "os": "linux", "cpu": "arm64" }, "sha512-9SZoiNaEKwFJ0V7cgpoCjHLh80fd8/wAJrbG1VWR8DJfkbVBvXhipTnxEISZ0LdidmthpVo0i2GiI6ToUdkmkg=="], + + "@noxcturnal/noxcturnal-linux-arm64-musl": ["@noxcturnal/noxcturnal-linux-arm64-musl@0.1.14", "", { "os": "linux", "cpu": "arm64" }, "sha512-dxZXo7Xj00w8eeFac+ev/75lJd/62GSUIX4wwCN2yYn6r9Jrim3DJ6yKVZwmfqHDE0v55TZsif0/vdhNFxFXfQ=="], + + "@noxcturnal/noxcturnal-linux-x64-gnu": ["@noxcturnal/noxcturnal-linux-x64-gnu@0.1.14", "", { "os": "linux", "cpu": "x64" }, "sha512-ek3098/TS+Ma2vJUjzpIZnhU70lryFzFPEdKdQ5u+1w00QKvMg0teFa2mec1H8/ndK74/xYWy8e4d92Uz+s9Dg=="], + + "@noxcturnal/noxcturnal-linux-x64-musl": ["@noxcturnal/noxcturnal-linux-x64-musl@0.1.14", "", { "os": "linux", "cpu": "x64" }, "sha512-qblXyvGhD5HoJSK32Q8YN6PnEz4GPXgr2KLgStpRG1oG8+BRPlrqZCaQRbQI5Bn3L8NZ+OjyGWhLEG1kgdzHBw=="], + + "@noxcturnal/noxcturnal-win32-arm64-msvc": ["@noxcturnal/noxcturnal-win32-arm64-msvc@0.1.14", "", { "os": "win32", "cpu": "arm64" }, "sha512-K9Q82l32juE/p7Ca6p36rAWfNzORkCyoL0R2aDUq3tkYOmivu3xTewnxUwDLTzDIuLsMgb4niy5vrtr4IXdNXw=="], + + "@noxcturnal/noxcturnal-win32-x64-msvc": ["@noxcturnal/noxcturnal-win32-x64-msvc@0.1.14", "", { "os": "win32", "cpu": "x64" }, "sha512-qiiOLLQUYnLZai3traWx90yzMLGZlkvwGNYMFkGw5MwnMifVgfl3Z3ooFiSYaVKjkTYqxBF9rOCvhFL6yXaoxA=="], + + "@oxc-project/types": ["@oxc-project/types@0.154.0", "", {}, "sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA=="], + + "@react-native/asset-utils": ["@react-native/asset-utils@0.88.1", "", {}, "sha512-BLb5FF7NgggGYiCsA7KKkK2qFhn0K+6iGXOI+4Ucd+G7Robzw9Gt4WsWwxLt+Od+G+/hyqfz8ASokyWFZ6VcLw=="], + + "@react-native/babel-plugin-codegen": ["@react-native/babel-plugin-codegen@0.88.1", "", { "dependencies": { "@babel/traverse": "^7.29.0", "@react-native/codegen": "0.88.1" } }, "sha512-2r7aeE3dXu3hawHNYHgazWQl9MJNjcnA/gxLApFK2gPMxBCLiQOHVUSaemDQz4mKPs5svulbhtDehxo6LzTzpQ=="], + + "@react-native/codegen": ["@react-native/codegen@0.88.1", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/parser": "^7.29.0", "flow-parser": "0.327.0", "invariant": "^2.2.4", "nullthrows": "^1.1.1", "tinyglobby": "^0.2.15", "yargs": "^17.6.2" } }, "sha512-URPgPhnsxqeQSLyTRVzhZZ8iNXtZdR1Jop6lqaQacymvl3byghXisNIRR1YyG6PbXUfzPan5Jmz/kPhUUsZ2Yw=="], + + "@react-native/community-cli-plugin": ["@react-native/community-cli-plugin@0.88.1", "", { "dependencies": { "@react-native/asset-utils": "0.88.1", "@react-native/dev-middleware": "0.88.1", "commander": "^12.0.0", "debug": "^4.4.0", "invariant": "^2.2.4", "metro": "^0.87.1", "semver": "^7.1.3" }, "peerDependencies": { "@react-native-community/cli": "*", "@react-native/metro-config": "0.88.1" }, "optionalPeers": ["@react-native-community/cli", "@react-native/metro-config"] }, "sha512-L2CQvzsOMz4oof6AVLSzesFL1Q92nrtXpK0uQH2VwdOmzzgkiHql8WFQSo9VLvMFGJDg8+G6enrHH573ruqqWA=="], + + "@react-native/debugger-frontend": ["@react-native/debugger-frontend@0.88.1", "", {}, "sha512-4ZjH2093hZWWgsYs5ExqjzJX5uCS4R5yZa17eRHsQClUc6RjlV61kLdIk722sQReLL+NYtBn2RJtdcQtLCwiug=="], + + "@react-native/debugger-shell": ["@react-native/debugger-shell@0.88.1", "", { "dependencies": { "cross-spawn": "^7.0.6", "debug": "^4.4.0", "fb-dotslash": "0.5.8" } }, "sha512-vrOLlxkp/417qcSUiS3x3gmdoQHYA/26oEKIWPB4EekJG0uJxKXsMR0tHIDiJWO0JH/2BO3M+507DjR1U74jQg=="], + + "@react-native/dev-middleware": ["@react-native/dev-middleware@0.88.1", "", { "dependencies": { "@isaacs/ttlcache": "^1.4.1", "@react-native/debugger-frontend": "0.88.1", "@react-native/debugger-shell": "0.88.1", "connect": "^3.6.5", "debug": "^4.4.0", "invariant": "^2.2.4", "nullthrows": "^1.1.1", "open": "^8.4.2", "serve-static": "^1.16.2", "ws": "^7.5.10" } }, "sha512-0smOWE3NCdEYUwPiEdiwVXjTdvXcwSejviCM0YZB0Dj6HaQ+uu4hpSrvgERDevr5dvtSaqr8N4TdYZCLXiVgFw=="], + + "@react-native/gradle-plugin": ["@react-native/gradle-plugin@0.88.1", "", {}, "sha512-zalxoJJ/m5kxLnBy9I1zYrx4jaPxPXdys8DeROvrSOa3pSQkTwVVXRZ4FkXCdGodVA9KR2WitplDo/URNjyvFA=="], + + "@react-native/js-polyfills": ["@react-native/js-polyfills@0.88.1", "", {}, "sha512-B62O6zVMYW7kK8dxIuCwpdJ5RYcIvET6ItScm0sfsTibJs+llS0krUVSAOHnEUn3lbFMfw+o+sNdWREOAc6FfQ=="], + + "@react-native/normalize-colors": ["@react-native/normalize-colors@0.88.1", "", {}, "sha512-2SAKiLyZRf+peBLkhhJWGY5vC26w1Uj9QBgUZvjAnOxjgeEKUGBE5riPS0R7+YoqSrRL0w8ucwZB4M+vvy9HMg=="], + + "@react-native/virtualized-lists": ["@react-native/virtualized-lists@0.88.1", "", { "dependencies": { "invariant": "^2.2.4", "nullthrows": "^1.1.1" }, "peerDependencies": { "@types/react": "^19.2.0", "react": "*", "react-native": "0.88.1" }, "optionalPeers": ["@types/react"] }, "sha512-Zt+OGvJE6VgmzgemZL8TSA0VomNWpHMNcG0OvLkkBQEGrzY8OdDHRfjJh7S+f+UFJF77kicRC6o6mt3A7ER9lQ=="], + + "@sinclair/typebox": ["@sinclair/typebox@0.27.12", "", {}, "sha512-hhyNJ+nbR6ZR7pToHvllEFun9TL0sbL+tk/ON75lo+Xas054uez98qRbsuNt7MBCyZKK4+8Yli/OAGZhmfBZ/g=="], + + "@types/istanbul-lib-coverage": ["@types/istanbul-lib-coverage@2.0.6", "", {}, "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w=="], + + "@types/istanbul-lib-report": ["@types/istanbul-lib-report@3.0.3", "", { "dependencies": { "@types/istanbul-lib-coverage": "*" } }, "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA=="], + + "@types/istanbul-reports": ["@types/istanbul-reports@3.0.4", "", { "dependencies": { "@types/istanbul-lib-report": "*" } }, "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ=="], + + "@types/node": ["@types/node@26.6.6", "", { "dependencies": { "undici-types": "~8.9.0" } }, "sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog=="], + + "@types/yargs": ["@types/yargs@17.0.35", "", { "dependencies": { "@types/yargs-parser": "*" } }, "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg=="], + + "@types/yargs-parser": ["@types/yargs-parser@21.0.3", "", {}, "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ=="], + + "@ungap/structured-clone": ["@ungap/structured-clone@1.4.0", "", {}, "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ=="], + + "@xmldom/xmldom": ["@xmldom/xmldom@0.8.15", "", {}, "sha512-/5NV/vDALVFDXgLmfsy9TRCBlKwO2LNBFzpzvb9iIj+jR+eSc6DLYYvVOdivT/jm7MtU6TebYuRmzEOI7w40UA=="], + + "accepts": ["accepts@1.3.8", "", { "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" } }, "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw=="], + + "acorn": ["acorn@8.19.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw=="], + + "agent-base": ["agent-base@7.1.4", "", {}, "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ=="], + + "agent-cli-detector": ["agent-cli-detector@0.1.7", "", { "bin": { "agent-cli-detector": "dist/cli.js" } }, "sha512-d8OWDVdZMgjhLUT9ZPgSv/BdFFF9pVuscC0JdUSz3bjwE15gcp6u/o0/JooM2yyAWC49KThFhXlgTXRa9B7yng=="], + + "anser": ["anser@1.4.10", "", {}, "sha512-hCv9AqTQ8ycjpSd3upOJd7vFwW1JaoYQ7tpham03GJ1ca8/65rqn0RpaWpItOAd6ylW9wAw6luXYPJIyPFVOww=="], + + "ansi-escapes": ["ansi-escapes@4.3.2", "", { "dependencies": { "type-fest": "^0.21.3" } }, "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ=="], + + "ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], + + "ansi-styles": ["ansi-styles@5.2.0", "", {}, "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA=="], + + "arg": ["arg@5.0.2", "", {}, "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg=="], + + "argparse": ["argparse@2.0.1", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="], + + "asap": ["asap@2.0.6", "", {}, "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA=="], + + "babel-plugin-polyfill-corejs2": ["babel-plugin-polyfill-corejs2@0.4.17", "", { "dependencies": { "@babel/compat-data": "^7.28.6", "@babel/helper-define-polyfill-provider": "^0.6.8", "semver": "^6.3.1" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-aTyf30K/rqAsNwN76zYrdtx8obu0E4KoUME29B1xj+B3WxgvWkp943vYQ+z8Mv3lw9xHXMHpvSPOBxzAkIa94w=="], + + "babel-plugin-polyfill-corejs3": ["babel-plugin-polyfill-corejs3@0.13.0", "", { "dependencies": { "@babel/helper-define-polyfill-provider": "^0.6.5", "core-js-compat": "^3.43.0" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-U+GNwMdSFgzVmfhNm8GJUX88AadB3uo9KpJqS3FaqNIPKgySuvMb+bHPsOmmuWyIcuqZj/pzt1RUIUZns4y2+A=="], + + "babel-plugin-polyfill-regenerator": ["babel-plugin-polyfill-regenerator@0.6.8", "", { "dependencies": { "@babel/helper-define-polyfill-provider": "^0.6.8" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "sha512-M762rNHfSF1EV3SLtnCJXFoQbbIIz0OyRwnCmV0KPC7qosSfCO0QLTSuJX3ayAebubhE6oYBAYPrBA5ljowaZg=="], + + "babel-plugin-react-compiler": ["babel-plugin-react-compiler@1.0.0", "", { "dependencies": { "@babel/types": "^7.26.0" } }, "sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw=="], + + "babel-plugin-react-native-web": ["babel-plugin-react-native-web@0.21.4", "", {}, "sha512-FSclsDTGi5EcvpbW3TM7s8GLWwQqo5wI9zQqJr2m0IoJRenSkp1+bVvdeZXTNznI5Ms9Bry7DLBR+C5Shb9gtw=="], + + "babel-plugin-syntax-hermes-parser": ["babel-plugin-syntax-hermes-parser@0.36.1", "", { "dependencies": { "hermes-parser": "0.36.1" } }, "sha512-ycduwJbvdvIMmVvlAZqGggS+pm5Eu4Bk9pcV9Sm2Z4PJNRVsKkv0g7vHj+LeuC1gHTeF67sJXFOq61IlqCa2hA=="], + + "babel-plugin-transform-flow-enums": ["babel-plugin-transform-flow-enums@0.0.2", "", { "dependencies": { "@babel/plugin-syntax-flow": "^7.12.1" } }, "sha512-g4aaCrDDOsWjbm0PUUeVnkcVd6AKJsVc/MbnPhEotEpkeJQP6b8nzewohQi7+QS8UyPehOhGWn0nOwjvWpmMvQ=="], + + "babel-preset-expo": ["babel-preset-expo@58.0.26", "", { "dependencies": { "@babel/generator": "^7.20.5", "@babel/helper-module-imports": "^7.25.9", "@babel/plugin-proposal-decorators": "^7.12.9", "@babel/plugin-proposal-export-default-from": "^7.24.7", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-default-from": "^7.24.7", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@babel/plugin-transform-async-generator-functions": "^7.25.4", "@babel/plugin-transform-async-to-generator": "^7.24.7", "@babel/plugin-transform-block-scoping": "^7.25.0", "@babel/plugin-transform-class-properties": "^7.25.4", "@babel/plugin-transform-class-static-block": "^7.27.1", "@babel/plugin-transform-classes": "^7.25.4", "@babel/plugin-transform-destructuring": "^7.24.8", "@babel/plugin-transform-export-namespace-from": "^7.25.9", "@babel/plugin-transform-flow-strip-types": "^7.25.2", "@babel/plugin-transform-for-of": "^7.24.7", "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", "@babel/plugin-transform-modules-commonjs": "^7.24.8", "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", "@babel/plugin-transform-object-rest-spread": "^7.24.7", "@babel/plugin-transform-optional-catch-binding": "^7.24.7", "@babel/plugin-transform-optional-chaining": "^7.24.8", "@babel/plugin-transform-parameters": "^7.24.7", "@babel/plugin-transform-private-methods": "^7.24.7", "@babel/plugin-transform-private-property-in-object": "^7.24.7", "@babel/plugin-transform-react-display-name": "^7.24.7", "@babel/plugin-transform-react-jsx": "^7.28.6", "@babel/plugin-transform-react-jsx-development": "^7.27.1", "@babel/plugin-transform-react-pure-annotations": "^7.27.1", "@babel/plugin-transform-runtime": "^7.24.7", "@babel/plugin-transform-typescript": "^7.25.2", "@babel/plugin-transform-unicode-regex": "^7.24.7", "@babel/preset-typescript": "^7.23.0", "@react-native/babel-plugin-codegen": "0.88.1", "babel-plugin-react-compiler": "^1.0.0", "babel-plugin-react-native-web": "~0.21.4", "babel-plugin-syntax-hermes-parser": "^0.36.0", "babel-plugin-transform-flow-enums": "^0.0.2", "debug": "^4.3.4" }, "peerDependencies": { "@babel/runtime": "^7.20.0", "expo": "*", "expo-widgets": "^58.0.29", "react-refresh": ">=0.14.0 <1.0.0" }, "optionalPeers": ["@babel/runtime", "expo", "expo-widgets"] }, "sha512-ZCH0nRF6T5Txn2r7FqY66xcYN2ni80WzH3snBA0pFGHZpMeSgaADnb5jJmPGEnWKcb7p34ViGFf17jXoFQ1zGg=="], + + "balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="], + + "base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="], + + "baseline-browser-mapping": ["baseline-browser-mapping@2.11.39", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-Q9buOYhr2ggrEZpImICecZTJHCCd8yXkRUokFlUEQ8uiD6oP82F4W4jWnhOHZYV+wlvrC51V7Wy0ULyWjil5Wg=="], + + "big-integer": ["big-integer@1.6.52", "", {}, "sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg=="], + + "bplist-creator": ["bplist-creator@0.1.0", "", { "dependencies": { "stream-buffers": "2.2.x" } }, "sha512-sXaHZicyEEmY86WyueLTQesbeoH/mquvarJaQNbjuOQO+7gbFcDEWqKmcWA4cOTLzFlfgvkiVxolk1k5bBIpmg=="], + + "bplist-parser": ["bplist-parser@0.3.2", "", { "dependencies": { "big-integer": "1.6.x" } }, "sha512-apC2+fspHGI3mMKj+dGevkGo/tCqVB8jMb6i+OX+E29p0Iposz07fABkRIfVUPNd5A5VbuOz1bZbnmkKLYF+wQ=="], + + "brace-expansion": ["brace-expansion@5.1.0", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-aa11Dv491GKnYqxaul3aRJ0szew7yMJMfZPnqD44NjGrZXoj62l41OEDDpdpC4eE2P88vBFfLuSyRhpG91NUvg=="], + + "braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="], + + "browserslist": ["browserslist@4.29.6", "", { "dependencies": { "baseline-browser-mapping": "^2.11.37", "caniuse-lite": "^1.0.30001826", "electron-to-chromium": "^1.5.486", "node-releases": "^2.0.64", "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w=="], + + "bser": ["bser@2.1.2", "", { "dependencies": { "node-int64": "^0.4.0" } }, "sha512-V2o8YS2EhrKMO9AumnkK0ynynfFlsajpYupwq7S46H5mhcanwxDkNTw3K67wPIcKTH1ffkA4vhMOtAc7gRmPZw=="], + + "buffer-from": ["buffer-from@1.1.2", "", {}, "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="], + + "bytes": ["bytes@3.1.2", "", {}, "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="], + + "camelcase": ["camelcase@6.3.0", "", {}, "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA=="], + + "caniuse-lite": ["caniuse-lite@1.0.30001827", "", {}, "sha512-YWEDr46gSO81M8w6uPbaIy4++IXsirx2asUqvllNiD4BPf75ibxclUjWEqp8ObCenRv+UM2n5Y8xuRPT8V8FrQ=="], + + "chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="], + + "ci-info": ["ci-info@3.9.0", "", {}, "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ=="], + + "cli-cursor": ["cli-cursor@2.1.0", "", { "dependencies": { "restore-cursor": "^2.0.0" } }, "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw=="], + + "cli-spinners": ["cli-spinners@2.9.2", "", {}, "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg=="], + + "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=="], + + "clone": ["clone@1.0.4", "", {}, "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg=="], + + "color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="], + + "color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="], + + "commander": ["commander@7.2.0", "", {}, "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw=="], + + "compressible": ["compressible@2.0.18", "", { "dependencies": { "mime-db": ">= 1.43.0 < 2" } }, "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg=="], + + "compression": ["compression@1.8.2", "", { "dependencies": { "bytes": "3.1.2", "compressible": "~2.0.18", "debug": "2.6.9", "destroy": "1.2.0", "negotiator": "~0.6.4", "on-headers": "~1.1.0", "safe-buffer": "5.2.1", "vary": "~1.1.2" } }, "sha512-o8vI5RE5A6EVVOd9o41jKp41aJom+QTEO/Bx8MYNjexMo/Bv2WOjUfZr+aL0WnYSgymUy6zeguqLTsIhV0gMvQ=="], + + "connect": ["connect@3.7.0", "", { "dependencies": { "debug": "2.6.9", "finalhandler": "1.1.2", "parseurl": "~1.3.3", "utils-merge": "1.0.1" } }, "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ=="], + + "content-type": ["content-type@2.1.0", "", {}, "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag=="], + + "convert-source-map": ["convert-source-map@2.0.0", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="], + + "core-js-compat": ["core-js-compat@3.51.0", "", { "dependencies": { "browserslist": "^4.29.3" } }, "sha512-52r6fkXgxv4GLMjmFcMWRx7X9bw071xTTdrDcdyPGRqU2oE+9pCG0bAOMifSBdLw0JRBZKEF0q3B55qPlLuE8g=="], + + "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], + + "debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], + + "defaults": ["defaults@1.0.4", "", { "dependencies": { "clone": "^1.0.2" } }, "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A=="], + + "define-lazy-prop": ["define-lazy-prop@2.0.0", "", {}, "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og=="], + + "depd": ["depd@2.0.0", "", {}, "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="], + + "destroy": ["destroy@1.2.0", "", {}, "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg=="], + + "detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], + + "dnssd-advertise": ["dnssd-advertise@1.1.6", "", {}, "sha512-Ndrrf6BMPalkQPd/zubL+4YghH2J9NspapQ09uDXwYbvOPkP0oaqf5CkcwJ0b50kS2O3ul6yVu+jz+RY62Cejg=="], + + "ee-first": ["ee-first@1.1.1", "", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="], + + "electron-to-chromium": ["electron-to-chromium@1.5.493", "", {}, "sha512-/Wto2sKd0EpepzMqwSP2il2TNc+rnBDF6k1poCvhRKpaSSD4sLGRBE+FydqHs2QwcW9cXKLVDqnauzJy1oByYw=="], + + "emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], + + "encodeurl": ["encodeurl@2.0.3", "", {}, "sha512-mIteYONiEfc4xWf2F1WXovh1c8npzS00vNeiUPdwFF+QlVJni+gNvpQltLMQhob8rew/bWWc/bGTuUr0EUGt0w=="], + + "error-stack-parser": ["error-stack-parser@2.1.4", "", { "dependencies": { "stackframe": "^1.3.4" } }, "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ=="], + + "es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="], + + "escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="], + + "escape-html": ["escape-html@1.0.3", "", {}, "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="], + + "escape-string-regexp": ["escape-string-regexp@1.0.5", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="], + + "etag": ["etag@1.8.1", "", {}, "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="], + + "expo": ["expo@58.0.26", "", { "dependencies": { "@babel/runtime": "^7.20.0", "@expo/cli": "^58.1.21", "@expo/config": "~58.0.12", "@expo/config-plugins": "~58.0.13", "@expo/devtools": "~58.0.2", "@expo/dom-webview": "~58.0.2", "@expo/fingerprint": "^0.21.10", "@expo/local-build-cache-provider": "^58.0.12", "@expo/log-box": "^58.0.15", "@expo/log-box-utils": "^58.0.2", "@expo/metro": "~58.0.0", "@expo/metro-config": "~58.0.23", "@ungap/structured-clone": "^1.3.0", "babel-preset-expo": "~58.0.26", "expo-asset": "~58.0.21", "expo-constants": "~58.0.16", "expo-file-system": "~58.0.14", "expo-font": "~58.0.12", "expo-keep-awake": "~58.0.4", "expo-modules-autolinking": "~58.1.0", "expo-modules-cli": "~0.5.0", "expo-modules-core": "~58.1.0", "pretty-format": "^29.7.0", "react-refresh": "^0.14.2", "whatwg-url-minimum": "^0.2.0" }, "peerDependencies": { "@expo/metro-runtime": "*", "react": "*", "react-dom": "*", "react-native": "*", "react-native-web": "*", "react-native-webview": "*" }, "optionalPeers": ["@expo/metro-runtime", "react-dom", "react-native-web", "react-native-webview"], "bin": { "expo": "bin/cli", "fingerprint": "bin/fingerprint", "expo-modules": "bin/modules", "expo-modules-autolinking": "bin/autolinking" } }, "sha512-6i4kqt5lbcQdxmtnkkJ3JR5sn+A3L+xO45duLhh2rndvrek/chX/GTysTYozl4oL3+txKD53pDlJd75XRYf9Ow=="], + + "expo-asset": ["expo-asset@58.0.21", "", { "dependencies": { "@expo/image-utils": "^0.12.7", "expo-constants": "~58.0.16" }, "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-qaJmuTtswggXdBQfiUdpxrVGM7l+tH8iEDHwVDMuxyCF/kAau8sUGVuWrDKYNW4yAx7Z8ncgsT8s27pXjRH5GA=="], + + "expo-constants": ["expo-constants@58.0.16", "", { "dependencies": { "@expo/env": "~2.6.0", "@expo/require-utils": "^58.0.6" }, "peerDependencies": { "expo": "*", "react-native": "*" } }, "sha512-sVETnE1ktBMclc2Ve3qNrHhOCCio75a9JdghnJYGbqblmKfrrfE+lO9K4g9kNtmslIBLTK9Dyty6PbubkXs3Yw=="], + + "expo-file-system": ["expo-file-system@58.0.14", "", { "peerDependencies": { "expo": "*", "react-native": "*" } }, "sha512-VK67RQPDmWRHGbvpmPY5MeA1Ulw1LiyKs4KIN8na/q7SlkxYuPPR8biWsyX1S1/8XAHm6y2txUnYjCKh9l93lQ=="], + + "expo-font": ["expo-font@58.0.12", "", { "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-5m8TJrQ27DT1815P066HBtcHINgD8yuIqH4ca2ZyYwCsPa4QZ8UzOBDtrHnAMWMAlAgol+PGVj9aKeoYov70JA=="], + + "expo-keep-awake": ["expo-keep-awake@58.0.4", "", { "peerDependencies": { "expo": "*", "react": "*" } }, "sha512-zXJJRBwMpWl2Q2Aj9rksMe1ncz6aphOPqYnG3rTkCFALZiM22xQCqpQqBloDcQ6g4RdGTy++lRnsDX7MWpK1qw=="], + + "expo-modules-autolinking": ["expo-modules-autolinking@58.1.0", "", { "dependencies": { "@expo/platforms": "^58.0.1", "@expo/require-utils": "^58.0.6", "@expo/spawn-async": "^1.8.0", "chalk": "^4.1.0", "commander": "^7.2.0" }, "bin": { "expo-modules-autolinking": "bin/expo-modules-autolinking.js" } }, "sha512-JAegkS+nC4LVEgKMHAnpWhUxs1BYHHaTJnncVW2EQION1bVz0y8/wEglAeGV+oq4BNS1V7s8zCMTZU0hMi28bA=="], + + "expo-modules-cli": ["expo-modules-cli@0.5.0", "", { "dependencies": { "@babel/parser": "^7.20.0", "arg": "^5.0.2" }, "bin": { "expo-modules": "bin/expo-modules.js" } }, "sha512-uBNKkp5NIMo2bmJiQL36EBLNMeX+2GEIxpz10BioT0EGQTsPcgrV0ypfGy31GtPoFOObyc9ibHhklsOtpzhblw=="], + + "expo-modules-core": ["expo-modules-core@58.1.0", "", { "dependencies": { "expo-modules-jsi": "~58.0.23", "expo-modules-macros": "0.33.0", "invariant": "^2.2.4" }, "peerDependencies": { "react": "*", "react-native": "*", "react-native-worklets": ">=0.13.0" }, "optionalPeers": ["react-native-worklets"] }, "sha512-eXHOPyxHkDyTxUWnKEatC+Hx4tLoPWCPd5pCynAU4WkaBvAG/l5t/wu5jXiE5eh2CRr2NU4iAQePX2zUfNEVhA=="], + + "expo-modules-jsi": ["expo-modules-jsi@58.0.23", "", { "peerDependencies": { "react-native": "*" } }, "sha512-ex3CnT8KLubsPjUG0RpEL5VgmpnWxf7Ouc+WXEr8jEbIwqcULEWtA2tfhGZwjg6jS3zeNwjygF1w8QSstP7JfQ=="], + + "expo-modules-macros": ["expo-modules-macros@0.33.0", "", { "optionalDependencies": { "@expo/modules-macros-linux-arm64": "0.33.0", "@expo/modules-macros-linux-x64": "0.33.0", "@expo/modules-macros-win32-arm64": "0.33.0", "@expo/modules-macros-win32-x64": "0.33.0" } }, "sha512-ddrT2jbYPYmiHmzcYOixRemFUUK9qQEb5pOBWgoFoW0gj3sGld1CZX0GwblUXeZMyEX65S9vc1bEhIAGVDRA9w=="], + + "expo-server": ["expo-server@58.1.0", "", {}, "sha512-jo7I6uHnP5OQYKx3+7lbpdVVnOEwFj2ryDkQdauUQSwgh2HuMUkiFXWUIVe01ts6DLRoff5U0Tv+uNb3CMq/kw=="], + + "exponential-backoff": ["exponential-backoff@3.1.3", "", {}, "sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA=="], + + "fb-dotslash": ["fb-dotslash@0.5.8", "", { "bin": { "dotslash": "bin/dotslash" } }, "sha512-XHYLKk9J4BupDxi9bSEhkfss0m+Vr9ChTrjhf9l2iw3jB5C7BnY4GVPoMcqbrTutsKJso6yj2nAB6BI/F2oZaA=="], + + "fb-watchman": ["fb-watchman@2.0.4", "", { "dependencies": { "bser": "2.1.2" } }, "sha512-tGQtaoYisPDriJBN0mT5yZSyNETnJGA1gTYxaVRAE5KUO3LI9kPUc9WIu8JXcxaIci+faIKlzXqXyPgrmubtBQ=="], + + "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], + + "fetch-nodeshim": ["fetch-nodeshim@0.4.11", "", {}, "sha512-mdKkKZtNfL3PAK940FSnTgA5XhsGP2IZTE4mv6UoJxixPnslS2oG02Oz06BzH88QwDOJtXRaFqABIJ2Zha6h2A=="], + + "fill-range": ["fill-range@7.1.1", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="], + + "finalhandler": ["finalhandler@1.1.2", "", { "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "on-finished": "~2.3.0", "parseurl": "~1.3.3", "statuses": "~1.5.0", "unpipe": "~1.0.0" } }, "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA=="], + + "flow-enums-runtime": ["flow-enums-runtime@0.0.6", "", {}, "sha512-3PYnM29RFXwvAN6Pc/scUfkI7RwhQ/xqyLUyPNlXUp9S40zI8nup9tUSrTLSVnWGBN38FNiGWbwZOB6uR4OGdw=="], + + "flow-estree": ["flow-estree@0.327.0", "", {}, "sha512-f9vK751YUzD0qaHSpKc5/qQM6gqOlgGS+4ZRqTNcZOpVqn3mC55yEQ6dUG2K1eaVm5FbKkz9CFWe6XNvrkQFQg=="], + + "flow-parser": ["flow-parser@0.327.0", "", { "dependencies": { "flow-estree": "0.327.0" } }, "sha512-/MYZ5hXWf5ozpbdfUDmazMgQXviLxWEiRLH3MppEGDdW0itRVqmB5UaU7QX+SBCDNiq+gEesSVn8nlxmPDyDkw=="], + + "fresh": ["fresh@0.5.2", "", {}, "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="], + + "function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="], + + "gensync": ["gensync@1.0.0-beta.2", "", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="], + + "get-caller-file": ["get-caller-file@2.0.5", "", {}, "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="], + + "graceful-fs": ["graceful-fs@4.2.12", "", {}, "sha512-iuyGF2E4oafQfPsRrG2wtY2ILupMhvtdrhzrxB+0VcjsPpSPttpfYdjnGFGsTi5MaJFjI1jOKHPQ6UTbTj9TAw=="], + + "has-flag": ["has-flag@4.0.0", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="], + + "hasown": ["hasown@2.0.4", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A=="], + + "hermes-compiler": ["hermes-compiler@260318099.0.5", "", {}, "sha512-4Gze+pGTGTUBRmnv6LtdOMo6ZzMMh3hEkvDiWzvuNL5LM0EO5YGhr8xh3fRjFaEqReUwEGjJGcGgEPFe9+E6Gw=="], + + "hermes-estree": ["hermes-estree@0.36.1", "", {}, "sha512-guv1nQ6IJ7S83NRFPWc3SA7IBZrdNC9kapwOq6uXvF4wP+sDCgjzQbKPCoyYmoyZRzztF/n/c36l/rccCZSiCw=="], + + "hermes-parser": ["hermes-parser@0.36.1", "", { "dependencies": { "hermes-estree": "0.36.1" } }, "sha512-GApNk4zLHi2UWoWZZkx7LNCOSzLSc5lB55pZ/PhK7ycFeg7u5LcF88p/WbpIi1XUDtE0MpHE3uRR3u3KB7TjSQ=="], + + "hosted-git-info": ["hosted-git-info@7.0.2", "", { "dependencies": { "lru-cache": "^10.0.1" } }, "sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w=="], + + "http-errors": ["http-errors@2.0.1", "", { "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", "setprototypeof": "~1.2.0", "statuses": "~2.0.2", "toidentifier": "~1.0.1" } }, "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ=="], + + "https-proxy-agent": ["https-proxy-agent@7.0.6", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "4" } }, "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw=="], + + "ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="], + + "inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="], + + "invariant": ["invariant@2.2.4", "", { "dependencies": { "loose-envify": "^1.0.0" } }, "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA=="], + + "is-core-module": ["is-core-module@2.18.0", "", { "dependencies": { "hasown": "^2.0.4" } }, "sha512-qyax9fgaKOEC4qK8WZn7Q4IcoZC9RC1O1fFxRcRTq/oMMkWT/uXpqpXa12kzWR409zAt1drYN9N9BO26UmBCmw=="], + + "is-docker": ["is-docker@2.2.1", "", { "bin": { "is-docker": "cli.js" } }, "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ=="], + + "is-fullwidth-code-point": ["is-fullwidth-code-point@3.0.0", "", {}, "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="], + + "is-number": ["is-number@7.0.0", "", {}, "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="], + + "is-wsl": ["is-wsl@2.2.0", "", { "dependencies": { "is-docker": "^2.0.0" } }, "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww=="], + + "isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="], + + "jest-get-type": ["jest-get-type@29.6.3", "", {}, "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw=="], + + "jest-util": ["jest-util@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", "graceful-fs": "^4.2.9", "picomatch": "^2.2.3" } }, "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA=="], + + "jest-validate": ["jest-validate@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "camelcase": "^6.2.0", "chalk": "^4.0.0", "jest-get-type": "^29.6.3", "leven": "^3.1.0", "pretty-format": "^29.7.0" } }, "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw=="], + + "jest-worker": ["jest-worker@29.7.0", "", { "dependencies": { "@types/node": "*", "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" } }, "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw=="], + + "jimp-compact": ["jimp-compact@0.16.1", "", {}, "sha512-dZ6Ra7u1G8c4Letq/B5EzAxj4tLFHL+cGtdpR+PVm4yzPDj+lCk+AbivWt1eOM+ikzkowtyV7qSqX6qr3t71Ww=="], + + "js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "js-yaml": ["js-yaml@4.3.2", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA=="], + + "jsc-safe-url": ["jsc-safe-url@0.2.4", "", {}, "sha512-0wM3YBWtYePOjfyXQH5MWQ8H7sdk5EXSwZvmSLKk2RboVQ2Bu239jycHDz5J/8Blf3K0Qnoy2b6xD+z10MFB+Q=="], + + "jsesc": ["jsesc@3.1.0", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="], + + "json5": ["json5@2.2.3", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="], + + "kleur": ["kleur@3.0.3", "", {}, "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w=="], + + "lan-network": ["lan-network@0.2.1", "", { "bin": { "lan-network": "dist/lan-network-cli.js" } }, "sha512-ONPnazC96VKDntab9j9JKwIWhZ4ZUceB4A9Epu4Ssg0hYFmtHZSeQ+n15nIwTFmcBUKtExOer8WTJ4GF9MO64A=="], + + "leven": ["leven@3.1.0", "", {}, "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A=="], + + "lightningcss": ["lightningcss@1.33.0", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.33.0", "lightningcss-darwin-arm64": "1.33.0", "lightningcss-darwin-x64": "1.33.0", "lightningcss-freebsd-x64": "1.33.0", "lightningcss-linux-arm-gnueabihf": "1.33.0", "lightningcss-linux-arm64-gnu": "1.33.0", "lightningcss-linux-arm64-musl": "1.33.0", "lightningcss-linux-x64-gnu": "1.33.0", "lightningcss-linux-x64-musl": "1.33.0", "lightningcss-win32-arm64-msvc": "1.33.0", "lightningcss-win32-x64-msvc": "1.33.0" } }, "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA=="], + + "lightningcss-android-arm64": ["lightningcss-android-arm64@1.33.0", "", { "os": "android", "cpu": "arm64" }, "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg=="], + + "lightningcss-darwin-arm64": ["lightningcss-darwin-arm64@1.33.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg=="], + + "lightningcss-darwin-x64": ["lightningcss-darwin-x64@1.33.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ=="], + + "lightningcss-freebsd-x64": ["lightningcss-freebsd-x64@1.33.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg=="], + + "lightningcss-linux-arm-gnueabihf": ["lightningcss-linux-arm-gnueabihf@1.33.0", "", { "os": "linux", "cpu": "arm" }, "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ=="], + + "lightningcss-linux-arm64-gnu": ["lightningcss-linux-arm64-gnu@1.33.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg=="], + + "lightningcss-linux-arm64-musl": ["lightningcss-linux-arm64-musl@1.33.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ=="], + + "lightningcss-linux-x64-gnu": ["lightningcss-linux-x64-gnu@1.33.0", "", { "os": "linux", "cpu": "x64" }, "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg=="], + + "lightningcss-linux-x64-musl": ["lightningcss-linux-x64-musl@1.33.0", "", { "os": "linux", "cpu": "x64" }, "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw=="], + + "lightningcss-win32-arm64-msvc": ["lightningcss-win32-arm64-msvc@1.33.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA=="], + + "lightningcss-win32-x64-msvc": ["lightningcss-win32-x64-msvc@1.33.0", "", { "os": "win32", "cpu": "x64" }, "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA=="], + + "lodash.debounce": ["lodash.debounce@4.0.8", "", {}, "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow=="], + + "lodash.throttle": ["lodash.throttle@4.1.1", "", {}, "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ=="], + + "log-symbols": ["log-symbols@2.2.0", "", { "dependencies": { "chalk": "^2.0.1" } }, "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg=="], + + "loose-envify": ["loose-envify@1.4.0", "", { "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, "bin": { "loose-envify": "cli.js" } }, "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q=="], + + "lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="], + + "makeerror": ["makeerror@1.0.12", "", { "dependencies": { "tmpl": "1.0.5" } }, "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg=="], + + "memoize-one": ["memoize-one@5.2.1", "", {}, "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q=="], + + "merge-stream": ["merge-stream@2.0.0", "", {}, "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w=="], + + "metro": ["metro@0.87.1", "", { "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/core": "^7.25.2", "@babel/generator": "^7.29.1", "@babel/parser": "^7.29.0", "@babel/template": "^7.28.6", "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "accepts": "^2.0.0", "connect": "^3.6.5", "debug": "^4.4.0", "error-stack-parser": "^2.0.6", "flow-enums-runtime": "^0.0.6", "flow-parser": "0.331.0", "graceful-fs": "^4.2.4", "invariant": "^2.2.4", "jest-worker": "^29.7.0", "jsc-safe-url": "^0.2.2", "lodash.throttle": "^4.1.1", "metro-babel-transformer": "0.87.1", "metro-cache": "0.87.1", "metro-cache-key": "0.87.1", "metro-config": "0.87.1", "metro-core": "0.87.1", "metro-file-map": "0.87.1", "metro-resolver": "0.87.1", "metro-runtime": "0.87.1", "metro-source-map": "0.87.1", "metro-symbolicate": "0.87.1", "metro-transform-plugins": "0.87.1", "metro-transform-worker": "0.87.1", "mime-types": "^3.0.1", "nullthrows": "^1.1.1", "serialize-error": "^2.1.0", "source-map": "^0.5.6", "throat": "^5.0.0", "ws": "^7.5.10", "yargs": "^17.6.2" }, "bin": { "metro": "src/cli.js" } }, "sha512-1oyLU9elM7hPAsKIqKooEekwxiuWr27+MZBhUROPhzcbXhMDxK64GPF/hCXwBZVp1F89ODavCrBmJtLx9WtBoQ=="], + + "metro-babel-transformer": ["metro-babel-transformer@0.87.1", "", { "dependencies": { "@babel/core": "^7.25.2", "flow-enums-runtime": "^0.0.6", "flow-parser": "0.331.0", "metro-cache-key": "0.87.1", "nullthrows": "^1.1.1" } }, "sha512-orvRIGpb0yK1yMbk5YP3dhVKjmoxUkRB9fdltGJxNppEqus/1tFpNuf9KnGFR3Qjg0izoUrJ4z6WgoBvdkXPrA=="], + + "metro-cache": ["metro-cache@0.87.1", "", { "dependencies": { "exponential-backoff": "^3.1.1", "flow-enums-runtime": "^0.0.6", "https-proxy-agent": "^7.0.5", "metro-core": "0.87.1" } }, "sha512-juNPaj0Xi5tkLp8imXqvbSnEIijwKG36m7OiFFVJMqEkiURwAjkMFVek3/xpix1+LVQqO7kjVp3PvuvIM61mKQ=="], + + "metro-cache-key": ["metro-cache-key@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-scqVVPMA2c+RVO12I3wyMDp5xCkRPLsyrcG4Qc3xfU5JR0EW/0sz2tjty+5UjMUtG09uiM1KYQ8HjWg7OQXHtw=="], + + "metro-config": ["metro-config@0.87.1", "", { "dependencies": { "connect": "^3.6.5", "flow-enums-runtime": "^0.0.6", "jest-validate": "^29.7.0", "metro": "0.87.1", "metro-cache": "0.87.1", "metro-core": "0.87.1", "metro-runtime": "0.87.1" } }, "sha512-NmkDlc/qZAdo5gTkVTuO2AKE/khemRKRH5IA+SKfqUBJigI5GqZ5TOXhmEokhlkAqzjt8dyzKhzI6FHvXoXaTQ=="], + + "metro-core": ["metro-core@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "lodash.throttle": "^4.1.1", "metro-resolver": "0.87.1" } }, "sha512-xizzky/4+c/Mkznege8OW05j7bSdM39VPoEps61Se4+hf32UQujmbvLvIE9+UnP6kNEPVomk0Fw8NsBK9iRQmw=="], + + "metro-file-map": ["metro-file-map@0.87.1", "", { "dependencies": { "debug": "^4.4.0", "fb-watchman": "^2.0.0", "flow-enums-runtime": "^0.0.6", "graceful-fs": "^4.2.4", "invariant": "^2.2.4", "jest-worker": "^29.7.0", "micromatch": "^4.0.4", "nullthrows": "^1.1.1" } }, "sha512-9sPuNCojC3pS4vj+ZPY7FXmHGpdJeckXuKXQrDAfJvZc60AF8owRFTkI8XdwlwrmPIB2w++KraK9FMEXvC4wJw=="], + + "metro-minify-terser": ["metro-minify-terser@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "terser": "^5.15.0" } }, "sha512-YK4k1oO1wV48hfE+Nbw2rJCnAgeabzrgT/xH5ha5n9gbK4p3HYFC898cERUiyTl9vRh58CNTiXRc88f7y6PfKg=="], + + "metro-resolver": ["metro-resolver@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-FXH/brY69wT6sPxaSW8BhMmDGD/6irmBr/cL4rUi+VWwqR3pbvdcfUOfyjcHucgQ7pe5IW3xJY21eHKLVKNumQ=="], + + "metro-runtime": ["metro-runtime@0.87.3", "", { "dependencies": { "@babel/runtime": "^7.25.0", "flow-enums-runtime": "^0.0.6" } }, "sha512-2kGsO2ouF5V8m9teQcrmCbH9HonkxgNpyFq1t36x78Xc2fZ3CsE/sKnntEmHS7Uj8bgeObjaXa92caTRk0D6ww=="], + + "metro-source-map": ["metro-source-map@0.87.3", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/traverse": "^7.29.10", "@babel/types": "^7.29.8", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-symbolicate": "0.87.3", "nullthrows": "^1.1.1", "ob1": "0.87.3", "source-map": "^0.5.6" } }, "sha512-kvgC0nIP1emXDiMLhmcy1AOxZrfPMWxrvYqOMNVXvKbObtakGXqu60WpeSVlzo3VBfXCMmZDBz1SvsP80Ug+kQ=="], + + "metro-symbolicate": ["metro-symbolicate@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-source-map": "0.87.1", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "vlq": "^1.0.0" }, "bin": { "metro-symbolicate": "src/index.js" } }, "sha512-rcGvwabrg0lbXGRGRKl14PY3My3+dkno2jZYhdJEuH2DmjTtTkV5bYwgto4JtV/Lbe+sXE6GO1UGg654430uow=="], + + "metro-transform-plugins": ["metro-transform-plugins@0.87.1", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/generator": "^7.29.1", "@babel/template": "^7.28.6", "@babel/traverse": "^7.29.0", "flow-enums-runtime": "^0.0.6", "nullthrows": "^1.1.1" } }, "sha512-qMiJ/x+VfqumFJJSefKS6nj8uojzC29b2/aK8vlMuFABIqGjDucICEOXd2Yt6k/XMFAgAcaJvShUOT0HLyYaPw=="], + + "metro-transform-worker": ["metro-transform-worker@0.87.1", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/generator": "^7.29.1", "@babel/parser": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", "metro": "0.87.1", "metro-babel-transformer": "0.87.1", "metro-cache": "0.87.1", "metro-cache-key": "0.87.1", "metro-minify-terser": "0.87.1", "metro-source-map": "0.87.1", "metro-transform-plugins": "0.87.1", "nullthrows": "^1.1.1" } }, "sha512-VOzs3OV405FuOLYdAhqA2wsn1F9lvueDVxMDLvCKaQ44U+yknIqphJ9eMjjsGwLDZiJq9sW3DMLhjD27JxQgqQ=="], + + "micromatch": ["micromatch@4.0.8", "", { "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" } }, "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA=="], + + "mime": ["mime@1.6.0", "", { "bin": { "mime": "cli.js" } }, "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="], + + "mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="], + + "mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="], + + "mimic-fn": ["mimic-fn@1.2.0", "", {}, "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ=="], + + "minimatch": ["minimatch@10.2.6", "", { "dependencies": { "brace-expansion": "^5.0.8" } }, "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A=="], + + "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], + + "multitars": ["multitars@1.0.3", "", {}, "sha512-5e2ayy9RjixFisCSfPL6pOgCJhDXYLLx73puYEnIT05A60q3kw3q0ipnqcCgmg6EAScLwatGMBJEHYmP7BSEYw=="], + + "nanoid": ["nanoid@3.3.20", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ=="], + + "negotiator": ["negotiator@0.6.3", "", {}, "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="], + + "nitro-core": ["nitro-core@0.37.2", "", {}, "sha512-dhagikz9VXXzfidRH/vPNJfYWPmTBArDOo9wE/wEqeERU9C8uRWz9YccOyNUOvADccPAZq319yzhDMoJ9excSQ=="], + + "node-forge": ["node-forge@1.4.4", "", {}, "sha512-T6VRRpF3+czIGcXW/LOeoD7Ej28d8CF1UMEAbJyJRUtYMvyXAgxUPW2kbUibumvV9LiUQAznJOFyeYclzSJMMg=="], + + "node-int64": ["node-int64@0.4.0", "", {}, "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw=="], + + "node-releases": ["node-releases@2.0.65", "", {}, "sha512-PfvofsGQ+MiOQIPkX9fU8ELUWmy5zL74CdQaph/ismKszfFkfwXaw0cGiwbwym2hT9k5+mdyl8O5WQ1MD8EHmA=="], + + "noxcturnal": ["noxcturnal@0.1.14", "", { "dependencies": { "@babel/code-frame": "^7.20.0", "@oxc-project/types": "0.154.0" }, "optionalDependencies": { "@noxcturnal/noxcturnal-darwin-arm64": "0.1.14", "@noxcturnal/noxcturnal-darwin-x64": "0.1.14", "@noxcturnal/noxcturnal-linux-arm64-gnu": "0.1.14", "@noxcturnal/noxcturnal-linux-arm64-musl": "0.1.14", "@noxcturnal/noxcturnal-linux-x64-gnu": "0.1.14", "@noxcturnal/noxcturnal-linux-x64-musl": "0.1.14", "@noxcturnal/noxcturnal-win32-arm64-msvc": "0.1.14", "@noxcturnal/noxcturnal-win32-x64-msvc": "0.1.14" } }, "sha512-dYhWwCVfxlxnyzkVvP6W+XXd7lKikl04YckNur8xV4IejmgYDPq2ykSvzA2zfYVaNgEvmWDceOVRFn3sjry69Q=="], + + "npm-package-arg": ["npm-package-arg@11.0.3", "", { "dependencies": { "hosted-git-info": "^7.0.0", "proc-log": "^4.0.0", "semver": "^7.3.5", "validate-npm-package-name": "^5.0.0" } }, "sha512-sHGJy8sOC1YraBywpzQlIKBE4pBbGbiF95U6Auspzyem956E0+FtDtsx1ZxlOJkQCZ1AFXAY/yuvtFYrOxF+Bw=="], + + "nullthrows": ["nullthrows@1.1.1", "", {}, "sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw=="], + + "ob1": ["ob1@0.87.3", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-g3UMN6od3PKhcpNFKZ1tj4pVFMHcipEGLiUdyGbm5yAQAwSvZA5VQBpvoyC2y8s1oFZ5oTknFxxEFaYPRi2M+Q=="], + + "on-finished": ["on-finished@2.4.2", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-ATWUv387i+nLD49EiDoOft5scf32Vsdz3ktrQJG9bi7jRFmaXTssvyvj1EmeKVVgvesbqUtvQQvaS2TpTukAZQ=="], + + "on-headers": ["on-headers@1.1.0", "", {}, "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A=="], + + "onetime": ["onetime@2.0.1", "", { "dependencies": { "mimic-fn": "^1.0.0" } }, "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ=="], + + "open": ["open@8.4.2", "", { "dependencies": { "define-lazy-prop": "^2.0.0", "is-docker": "^2.1.1", "is-wsl": "^2.2.0" } }, "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ=="], + + "ora": ["ora@3.4.0", "", { "dependencies": { "chalk": "^2.4.2", "cli-cursor": "^2.1.0", "cli-spinners": "^2.0.0", "log-symbols": "^2.2.0", "strip-ansi": "^5.2.0", "wcwidth": "^1.0.1" } }, "sha512-eNwHudNbO1folBP3JsZ19v9azXWtQZjICdr3Q0TDPIaeBQ3mXLrh54wM+er0+hSp+dWKf+Z8KM58CYzEyIYxYg=="], + + "parse-png": ["parse-png@2.1.0", "", { "dependencies": { "pngjs": "^3.3.0" } }, "sha512-Nt/a5SfCLiTnQAjx3fHlqp8hRgTL3z7kTQZzvIMS9uCAepnCyjpdEc6M/sz69WqMBdaDBw9sF1F1UaHROYzGkQ=="], + + "parseurl": ["parseurl@1.3.3", "", {}, "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="], + + "path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="], + + "path-parse": ["path-parse@1.0.7", "", {}, "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="], + + "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], + + "picomatch": ["picomatch@4.0.7", "", {}, "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA=="], + + "plist": ["plist@3.1.1", "", { "dependencies": { "@xmldom/xmldom": "^0.9.10", "base64-js": "^1.5.1", "xmlbuilder": "^15.1.1" } }, "sha512-ZIfcLJC+7E7FBFnDxm9MPmt7D+DidyQ26lewieO75AdhA2ayMtsJSES0iWzqJQbcVRSrTufQoy0DR94xHue0oA=="], + + "pngjs": ["pngjs@3.4.0", "", {}, "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w=="], + + "postcss": ["postcss@8.5.33", "", { "dependencies": { "nanoid": "^3.3.20", "picocolors": "^1.1.1", "source-map-js": "^1.2.2" } }, "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ=="], + + "pretty-format": ["pretty-format@29.7.0", "", { "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" } }, "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ=="], + + "proc-log": ["proc-log@4.2.0", "", {}, "sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA=="], + + "progress": ["progress@2.0.3", "", {}, "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA=="], + + "promise": ["promise@8.3.0", "", { "dependencies": { "asap": "~2.0.6" } }, "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg=="], + + "prompts": ["prompts@2.4.2", "", { "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" } }, "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q=="], + + "range-parser": ["range-parser@1.2.1", "", {}, "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="], + + "react": ["react@19.3.0", "", {}, "sha512-E8LUcbtBWt20bbl2YoHfx4ZDBdxVTfOKtCZn9cDSJ4l6/nuoApcpIBcj47t2wZoVX8g2ZHuMHbiShgCR1T5Sog=="], + + "react-devtools-core": ["react-devtools-core@6.1.5", "", { "dependencies": { "shell-quote": "^1.6.1", "ws": "^7" } }, "sha512-ePrwPfxAnB+7hgnEr8vpKxL9cmnp7F322t8oqcPshbIQQhDKgFDW4tjhF2wjVbdXF9O/nyuy3sQWd9JGpiLPvA=="], + + "react-is": ["react-is@18.3.1", "", {}, "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg=="], + + "react-native": ["react-native@0.88.1", "", { "dependencies": { "@react-native/asset-utils": "0.88.1", "@react-native/codegen": "0.88.1", "@react-native/community-cli-plugin": "0.88.1", "@react-native/gradle-plugin": "0.88.1", "@react-native/normalize-colors": "0.88.1", "@react-native/virtualized-lists": "0.88.1", "anser": "^1.4.9", "ansi-regex": "^5.0.0", "base64-js": "^1.5.1", "flow-enums-runtime": "^0.0.6", "flow-parser": "0.327.0", "hermes-compiler": "260318099.0.5", "invariant": "^2.2.4", "memoize-one": "^5.0.0", "metro-runtime": "^0.87.1", "metro-source-map": "^0.87.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.28.0", "semver": "^7.1.3", "stacktrace-parser": "^0.1.10", "tinyglobby": "^0.2.15", "whatwg-fetch": "^3.0.0", "ws": "^7.5.10", "yargs": "^17.6.2" }, "peerDependencies": { "@types/react": "^19.1.1", "react": "^19.3.0" }, "optionalPeers": ["@types/react"], "bin": { "react-native": "cli.js" } }, "sha512-wajWcLZ93GCN7k4Uwh4CS4L2Ah8ohcvkOXnvIYmh4Yvuqho5j3APZ9qozK+nQrHWSgauq4h8D3HN5DKK84SrHA=="], + + "react-native-nitro-modules": ["react-native-nitro-modules@0.37.2", "", { "dependencies": { "nitro-core": "0.37.2" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-Odnrq/p6/q0R01qZlkqeXu9VHHMuGEnZZmyxMvehEu6QiACNHhBCmAHgyBDqOSo9Lb3G0TscFAT+HG0uxsR/GA=="], + + "react-refresh": ["react-refresh@0.14.2", "", {}, "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA=="], + + "regenerate": ["regenerate@1.5.0", "", {}, "sha512-1s+CxXjJ71i7LNVy8nYwg47XV4y6lAnOEhsMtSKq3WpmPfhl9LuKlTqKIn/3yUpE8lBz+W+TT88Bxyhnr0U4yw=="], + + "regenerate-unicode-properties": ["regenerate-unicode-properties@10.3.0", "", { "dependencies": { "regenerate": "^1.4.2" } }, "sha512-9ns8odR8e9q3otKeHj3DE80jZYKg6zVeZKE+zQmRKXFoVUcuiTGeO6iusDhPRoIQQPVPRvH+SfBhrTud4eczuw=="], + + "regenerator-runtime": ["regenerator-runtime@0.13.11", "", {}, "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="], + + "regexpu-core": ["regexpu-core@6.5.4", "", { "dependencies": { "regenerate": "^1.5.0", "regenerate-unicode-properties": "^10.3.0", "regjsgen": "^0.8.0", "regjsparser": "^0.14.0", "unicode-match-property-ecmascript": "^2.0.0", "unicode-match-property-value-ecmascript": "^2.2.1" } }, "sha512-VpdamrZ9bw4YmvMZfTA3Yg8IHU9Guvg21bonvgjC4l3KfBkOqCPJesHakz7cQeE4Vh4zz4r4Gy6igAcnJxZv9g=="], + + "regjsgen": ["regjsgen@0.8.0", "", {}, "sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q=="], + + "regjsparser": ["regjsparser@0.14.1", "", { "dependencies": { "jsesc": "~3.1.0" }, "bin": { "regjsparser": "bin/parser" } }, "sha512-IeYboCLG1KBNRksrZQIZ1SV5KVWZiR0ikFokOcA0n63vLvlaFvCsfxN+fd4aXwL0KW3YD+ByRzIgo9ZAHdbldw=="], + + "require-directory": ["require-directory@2.1.1", "", {}, "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q=="], + + "resolve": ["resolve@1.22.14", "", { "dependencies": { "es-errors": "^1.3.0", "is-core-module": "^2.18.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-1ZjYvR9sbkiwC5+9QHetqW5HmA2pHRMaoupD01t2HlYnV/vydC2zPwLixhsMieSWVZt0JJRg5LVIk0Ow1D/TrA=="], + + "resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="], + + "resolve-workspace-root": ["resolve-workspace-root@2.0.1", "", {}, "sha512-nR23LHAvaI6aHtMg6RWoaHpdR4D881Nydkzi2CixINyg9T00KgaJdJI6Vwty+Ps8WLxZHuxsS0BseWjxSA4C+w=="], + + "restore-cursor": ["restore-cursor@2.0.0", "", { "dependencies": { "onetime": "^2.0.0", "signal-exit": "^3.0.2" } }, "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q=="], + + "safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="], + + "sandbox-cli-detector": ["sandbox-cli-detector@0.2.0", "", { "bin": { "sandbox-cli-detector": "dist/cli.js" } }, "sha512-4lyHX0ZU0AZKwjgZ1InxZAa3PNpyEb8rOQ+Zss1ReYmhNzW0Q+h1zE5nvniXN0HaAWZaZE1zgVNEirb0R7LmNg=="], + + "sax": ["sax@1.6.1", "", {}, "sha512-42tBVwLWnaQvW5zc4HbZrTuWccECCZfBi92FDuwtqxasH+JbPB3/FOKb1m222K42R4WxuxzzMsTswfzgtSu64Q=="], + + "scheduler": ["scheduler@0.28.0", "", {}, "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw=="], + + "semver": ["semver@7.8.6", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw=="], + + "send": ["send@0.19.2", "", { "dependencies": { "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "~0.5.2", "http-errors": "~2.0.1", "mime": "1.6.0", "ms": "2.1.3", "on-finished": "~2.4.1", "range-parser": "~1.2.1", "statuses": "~2.0.2" } }, "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg=="], + + "serialize-error": ["serialize-error@2.1.0", "", {}, "sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw=="], + + "serve-static": ["serve-static@1.16.3", "", { "dependencies": { "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", "send": "~0.19.1" } }, "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA=="], + + "setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="], + + "shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="], + + "shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="], + + "shell-quote": ["shell-quote@1.12.0", "", {}, "sha512-PcByqNyT/38F2kDNi006HAMRJaULuBzq/FOsw3qdZvX/GA9W/jamDaRskgHjubHiftXK5sIFxLNkvrXUwcof6Q=="], + + "signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], + + "simple-plist": ["simple-plist@1.3.1", "", { "dependencies": { "bplist-creator": "0.1.0", "bplist-parser": "0.3.1", "plist": "^3.0.5" } }, "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw=="], + + "sisteransi": ["sisteransi@1.0.5", "", {}, "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg=="], + + "slugify": ["slugify@1.6.9", "", {}, "sha512-vZ7rfeehZui7wQs438JXBckYLkIIdfHOXsaVEUMyS5fHo1483l1bMdo0EDSWYclY0yZKFOipDy4KHuKs6ssvdg=="], + + "source-map": ["source-map@0.5.7", "", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="], + + "source-map-js": ["source-map-js@1.2.4", "", {}, "sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA=="], + + "source-map-support": ["source-map-support@0.5.21", "", { "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w=="], + + "stackframe": ["stackframe@1.3.4", "", {}, "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw=="], + + "stacktrace-parser": ["stacktrace-parser@0.1.11", "", { "dependencies": { "type-fest": "^0.7.1" } }, "sha512-WjlahMgHmCJpqzU8bIBy4qtsZdU9lRlcZE3Lvyej6t4tuOuv1vk57OW3MBrj6hXBFx/nNoC9MPMTcr5YA7NQbg=="], + + "statuses": ["statuses@2.0.2", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="], + + "stream-buffers": ["stream-buffers@2.2.0", "", {}, "sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg=="], + + "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=="], + + "strip-ansi": ["strip-ansi@5.2.0", "", { "dependencies": { "ansi-regex": "^4.1.0" } }, "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA=="], + + "structured-headers": ["structured-headers@0.4.1", "", {}, "sha512-0MP/Cxx5SzeeZ10p/bZI0S6MpgD+yxAhi1BOQ34jgnMXsCq3j1t6tQnZu+KdlL7dvJTLT3g9xN8tl10TqgFMcg=="], + + "supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="], + + "supports-hyperlinks": ["supports-hyperlinks@2.3.0", "", { "dependencies": { "has-flag": "^4.0.0", "supports-color": "^7.0.0" } }, "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA=="], + + "supports-preserve-symlinks-flag": ["supports-preserve-symlinks-flag@1.0.0", "", {}, "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="], + + "terminal-link": ["terminal-link@2.1.1", "", { "dependencies": { "ansi-escapes": "^4.2.1", "supports-hyperlinks": "^2.0.0" } }, "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ=="], + + "terser": ["terser@5.51.4", "", { "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.15.0", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, "bin": { "terser": "bin/terser" } }, "sha512-VPi1CkDvCWLGUVIToctNBG+NdHbSXwOPjHJnQ3pdB0XknaldnI76wSkAFOGxV2ZdkzOP5d6gpQ5c58XvDghRvw=="], + + "throat": ["throat@5.0.0", "", {}, "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA=="], + + "tinyglobby": ["tinyglobby@0.2.17", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g=="], + + "tmpl": ["tmpl@1.0.5", "", {}, "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw=="], + + "to-regex-range": ["to-regex-range@5.0.1", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="], + + "toidentifier": ["toidentifier@1.0.1", "", {}, "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="], + + "toqr": ["toqr@0.1.1", "", {}, "sha512-FWAPzCIHZHnrE/5/w9MPk0kK25hSQSH2IKhYh9PyjS3SG/+IEMvlwIHbhz+oF7xl54I+ueZlVnMjyzdSwLmAwA=="], + + "type-fest": ["type-fest@0.7.1", "", {}, "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg=="], + + "undici-types": ["undici-types@8.9.0", "", {}, "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg=="], + + "unicode-canonical-property-names-ecmascript": ["unicode-canonical-property-names-ecmascript@2.0.1", "", {}, "sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg=="], + + "unicode-match-property-ecmascript": ["unicode-match-property-ecmascript@2.0.0", "", { "dependencies": { "unicode-canonical-property-names-ecmascript": "^2.0.0", "unicode-property-aliases-ecmascript": "^2.0.0" } }, "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q=="], + + "unicode-match-property-value-ecmascript": ["unicode-match-property-value-ecmascript@2.2.1", "", {}, "sha512-JQ84qTuMg4nVkx8ga4A16a1epI9H6uTXAknqxkGF/aFfRLw1xC/Bp24HNLaZhHSkWd3+84t8iXnp1J0kYcZHhg=="], + + "unicode-property-aliases-ecmascript": ["unicode-property-aliases-ecmascript@2.2.0", "", {}, "sha512-hpbDzxUY9BFwX+UeBnxv3Sh1q7HFxj48DTmXchNgRa46lO8uj3/1iEn3MiNUYTg1g9ctIqXCCERn8gYZhHC5lQ=="], + + "unpipe": ["unpipe@1.0.0", "", {}, "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="], + + "update-browserslist-db": ["update-browserslist-db@1.4.0", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-WPJuOnjI9FWDct4fB+ej4Mz8opLaw5CDcZ2t44tFZ0vIQVYWzBhWR3mkixuUj/A7+vY4V9+ApOZ2YYLwdgq46w=="], + + "utils-merge": ["utils-merge@1.0.1", "", {}, "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="], + + "validate-npm-package-name": ["validate-npm-package-name@5.0.1", "", {}, "sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ=="], + + "vary": ["vary@1.1.2", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="], + + "vlq": ["vlq@1.0.1", "", {}, "sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w=="], + + "walker": ["walker@1.0.8", "", { "dependencies": { "makeerror": "1.0.12" } }, "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ=="], + + "wcwidth": ["wcwidth@1.0.1", "", { "dependencies": { "defaults": "^1.0.3" } }, "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg=="], + + "whatwg-fetch": ["whatwg-fetch@3.6.20", "", {}, "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg=="], + + "whatwg-url-minimum": ["whatwg-url-minimum@0.2.0", "", {}, "sha512-BtjXU1caNcCFfETP2DhqSeVPfRDl2MTUitI107RE34rJXjR/izfUtR5IoTFOK1WqjNLXbbeqaCH/mQAOLjpc8g=="], + + "which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="], + + "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=="], + + "ws": ["ws@7.5.14", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-u9Oi2nQ8SZnTUAf6spLLKF5TyqoG3Nbbrd4ai6Sjo4P24bycDewhQqtNMIg4bFpnpH/TD4qk4IuAVhT0HIIqug=="], + + "xcode": ["xcode@4.0.0", "", { "dependencies": { "simple-plist": "^1.3.1" } }, "sha512-dDaoWzc9EP2fp9FS9PVZUkyvFxY4y1TOV9pcKaKLk++Ei/qb97XDFEVP7GnW7Osii/TzVABJ0jq2F+9/lq0TVA=="], + + "xml2js": ["xml2js@0.6.0", "", { "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" } }, "sha512-eLTh0kA8uHceqesPqSE+VvO1CDDJWMwlQfB6LuN6T8w6MaDJ8Txm8P7s5cHD0miF0V+GGTZrDQfxPZQVsur33w=="], + + "xmlbuilder": ["xmlbuilder@15.1.1", "", {}, "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg=="], + + "y18n": ["y18n@5.0.8", "", {}, "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="], + + "yallist": ["yallist@3.1.1", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="], + + "yargs": ["yargs@17.7.3", "", { "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.1.1" } }, "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g=="], + + "yargs-parser": ["yargs-parser@21.1.1", "", {}, "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw=="], + + "@babel/core/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + + "@babel/helper-compilation-targets/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "@babel/helper-create-class-features-plugin/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "@babel/helper-create-regexp-features-plugin/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "@babel/plugin-transform-runtime/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "@expo/cli/ws": ["ws@8.23.0", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ=="], + + "@expo/devcert/debug": ["debug@3.2.7", "", { "dependencies": { "ms": "^2.1.1" } }, "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ=="], + + "@expo/metro/metro-runtime": ["metro-runtime@0.87.1", "", { "dependencies": { "@babel/runtime": "^7.25.0", "flow-enums-runtime": "^0.0.6" } }, "sha512-kjeuSvInsM6OzBjkCQsWxnkrKZFMKtnkCl38oXWRI9lDGs2L9hGs9Tak9sQYJ9h3gtDujneB7wZio+irgqJKDw=="], + + "@expo/metro/metro-source-map": ["metro-source-map@0.87.1", "", { "dependencies": { "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-symbolicate": "0.87.1", "nullthrows": "^1.1.1", "ob1": "0.87.1", "source-map": "^0.5.6", "vlq": "^1.0.0" } }, "sha512-Bqpm0PBGdy53pigIJb4HRF7QxD2pUOdgSmVh/4AWbP635kSCv+Y6ltVxUZgSnzS/QbSmzyCGijmRPlXMj2/qHw=="], + + "@expo/ws-tunnel/ws": ["ws@8.23.0", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ=="], + + "@react-native/community-cli-plugin/commander": ["commander@12.1.0", "", {}, "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA=="], + + "@react-native/community-cli-plugin/metro": ["metro@0.87.3", "", { "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/core": "^7.25.2", "@babel/generator": "^7.29.1", "@babel/parser": "^7.29.9", "@babel/template": "^7.28.6", "@babel/traverse": "^7.29.10", "@babel/types": "^7.29.8", "accepts": "^2.0.0", "connect": "^3.6.5", "debug": "^4.4.0", "error-stack-parser": "^2.0.6", "flow-enums-runtime": "^0.0.6", "flow-parser": "0.336.0", "invariant": "^2.2.4", "jest-worker": "^29.7.0", "jsc-safe-url": "^0.2.2", "lodash.throttle": "^4.1.1", "metro-babel-transformer": "0.87.3", "metro-cache": "0.87.3", "metro-cache-key": "0.87.3", "metro-config": "0.87.3", "metro-core": "0.87.3", "metro-file-map": "0.87.3", "metro-resolver": "0.87.3", "metro-runtime": "0.87.3", "metro-source-map": "0.87.3", "metro-symbolicate": "0.87.3", "metro-transform-plugins": "0.87.3", "metro-transform-worker": "0.87.3", "mime-types": "^3.0.1", "nullthrows": "^1.1.1", "serialize-error": "^2.1.0", "source-map": "^0.5.6", "throat": "^5.0.0", "ws": "^7.5.10", "yargs": "^17.6.2" }, "bin": { "metro": "src/cli.js" } }, "sha512-Wt0Nkme7dVf2+Iaw9Od/MchWfElFyAKCMGX2xauhctc81aIOtYkZqzSN8xtOEMTDZD2EK/h/suJbBm1Bduo3Ow=="], + + "ansi-escapes/type-fest": ["type-fest@0.21.3", "", {}, "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w=="], + + "babel-plugin-polyfill-corejs2/semver": ["semver@6.3.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ=="], + + "chalk/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], + + "cliui/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + + "compressible/mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="], + + "compression/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], + + "compression/negotiator": ["negotiator@0.6.4", "", {}, "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w=="], + + "connect/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], + + "finalhandler/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], + + "finalhandler/encodeurl": ["encodeurl@1.0.4", "", {}, "sha512-ImAQpWtQZKdkUxvj9CMNzB8M4IGg0DkRTZzmOHqgVFrf71JDmUacbt+iKljfIpD2yHcxI+HR76d8bwvdvtSvGA=="], + + "finalhandler/on-finished": ["on-finished@2.3.0", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww=="], + + "finalhandler/statuses": ["statuses@1.5.0", "", {}, "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA=="], + + "jest-util/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], + + "jest-worker/supports-color": ["supports-color@8.1.1", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q=="], + + "log-symbols/chalk": ["chalk@2.4.2", "", { "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" } }, "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ=="], + + "metro/accepts": ["accepts@2.0.0", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="], + + "metro/flow-parser": ["flow-parser@0.331.0", "", { "dependencies": { "flow-estree": "0.331.0" } }, "sha512-vEZcHIlnKeN8JSVtYFczj8sWJfHIJOkz+YG00O/oul/Bete+t1ZhTi+O6JRRLFYvGW+yJkZ0YgL16iStnbkUqQ=="], + + "metro/metro-runtime": ["metro-runtime@0.87.1", "", { "dependencies": { "@babel/runtime": "^7.25.0", "flow-enums-runtime": "^0.0.6" } }, "sha512-kjeuSvInsM6OzBjkCQsWxnkrKZFMKtnkCl38oXWRI9lDGs2L9hGs9Tak9sQYJ9h3gtDujneB7wZio+irgqJKDw=="], + + "metro/metro-source-map": ["metro-source-map@0.87.1", "", { "dependencies": { "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-symbolicate": "0.87.1", "nullthrows": "^1.1.1", "ob1": "0.87.1", "source-map": "^0.5.6", "vlq": "^1.0.0" } }, "sha512-Bqpm0PBGdy53pigIJb4HRF7QxD2pUOdgSmVh/4AWbP635kSCv+Y6ltVxUZgSnzS/QbSmzyCGijmRPlXMj2/qHw=="], + + "metro/mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="], + + "metro-babel-transformer/flow-parser": ["flow-parser@0.331.0", "", { "dependencies": { "flow-estree": "0.331.0" } }, "sha512-vEZcHIlnKeN8JSVtYFczj8sWJfHIJOkz+YG00O/oul/Bete+t1ZhTi+O6JRRLFYvGW+yJkZ0YgL16iStnbkUqQ=="], + + "metro-config/metro-runtime": ["metro-runtime@0.87.1", "", { "dependencies": { "@babel/runtime": "^7.25.0", "flow-enums-runtime": "^0.0.6" } }, "sha512-kjeuSvInsM6OzBjkCQsWxnkrKZFMKtnkCl38oXWRI9lDGs2L9hGs9Tak9sQYJ9h3gtDujneB7wZio+irgqJKDw=="], + + "metro-source-map/metro-symbolicate": ["metro-symbolicate@0.87.3", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-source-map": "0.87.3", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "vlq": "^1.0.0" }, "bin": { "metro-symbolicate": "src/index.js" } }, "sha512-koHM4gA6iE7OSYACKvJCg/N/9QK6i7vrA3l4gMKtK1Z7XfQVixtWiUTqf+XTkGdVTjioHmlTF/MmG+BmfL301w=="], + + "metro-symbolicate/metro-source-map": ["metro-source-map@0.87.1", "", { "dependencies": { "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-symbolicate": "0.87.1", "nullthrows": "^1.1.1", "ob1": "0.87.1", "source-map": "^0.5.6", "vlq": "^1.0.0" } }, "sha512-Bqpm0PBGdy53pigIJb4HRF7QxD2pUOdgSmVh/4AWbP635kSCv+Y6ltVxUZgSnzS/QbSmzyCGijmRPlXMj2/qHw=="], + + "metro-transform-worker/metro-source-map": ["metro-source-map@0.87.1", "", { "dependencies": { "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-symbolicate": "0.87.1", "nullthrows": "^1.1.1", "ob1": "0.87.1", "source-map": "^0.5.6", "vlq": "^1.0.0" } }, "sha512-Bqpm0PBGdy53pigIJb4HRF7QxD2pUOdgSmVh/4AWbP635kSCv+Y6ltVxUZgSnzS/QbSmzyCGijmRPlXMj2/qHw=="], + + "micromatch/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], + + "ora/chalk": ["chalk@2.4.2", "", { "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" } }, "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ=="], + + "plist/@xmldom/xmldom": ["@xmldom/xmldom@0.9.12", "", {}, "sha512-5AXjrcMClTryPe9LgZrygpB1lj7s0S9E0+W+AHaVKAVyHanafK86iPSvG5xHVSp/jC+VH1UXu0TAEmY279xH7A=="], + + "send/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], + + "simple-plist/bplist-parser": ["bplist-parser@0.3.1", "", { "dependencies": { "big-integer": "1.6.x" } }, "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA=="], + + "source-map-support/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], + + "string-width/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + + "strip-ansi/ansi-regex": ["ansi-regex@4.1.1", "", {}, "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g=="], + + "terser/commander": ["commander@2.20.3", "", {}, "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="], + + "wrap-ansi/ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], + + "wrap-ansi/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + + "xml2js/xmlbuilder": ["xmlbuilder@11.0.1", "", {}, "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="], + + "@expo/metro/metro-source-map/ob1": ["ob1@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-i8iA8uij0g1YQzS8uOJPSRCgwDjO9warIHUAu1Fqj877Wc3wlfxDYBioYWgKTBF2+URVJttyDWSEpmd99nlvtQ=="], + + "@react-native/community-cli-plugin/metro/accepts": ["accepts@2.0.0", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="], + + "@react-native/community-cli-plugin/metro/flow-parser": ["flow-parser@0.336.0", "", { "dependencies": { "flow-estree": "0.336.0" } }, "sha512-O8QvQf/B3rBF+eagcc9/WMAjfJoaKckdgSd8PT/qvMIIe4ZjVKrSqV5SDnRFAKY0VrE8r5C4ADYgvYhmwkWADA=="], + + "@react-native/community-cli-plugin/metro/metro-babel-transformer": ["metro-babel-transformer@0.87.3", "", { "dependencies": { "@babel/core": "^7.25.2", "flow-enums-runtime": "^0.0.6", "flow-parser": "0.336.0", "metro-cache-key": "0.87.3", "nullthrows": "^1.1.1" } }, "sha512-HtbEBlMLywNWEFNNq92smarzDLUKZcqoykq9YWfkgNN7Xm8pNGMCFoaV6NAOs7OSL8biJdbaKBr1BWPD41KHeg=="], + + "@react-native/community-cli-plugin/metro/metro-cache": ["metro-cache@0.87.3", "", { "dependencies": { "exponential-backoff": "^3.1.1", "flow-enums-runtime": "^0.0.6", "https-proxy-agent": "^7.0.5", "metro-core": "0.87.3" } }, "sha512-osREd4eXHIsCCIE2PQlDThtM6qSaZfY59jVdaIRUjixU6emI/RrUetoSEjdAdBoCh95C+f4O51oRgFdwRU3Q0w=="], + + "@react-native/community-cli-plugin/metro/metro-cache-key": ["metro-cache-key@0.87.3", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-GZmydYeCV/A2RNJXTEmdeoYmxG6Grq9Wj2Zqi53W+W2psc6lTTbuabNOogsTHqnUoqdF80UbO+PQSFBgwHwj+Q=="], + + "@react-native/community-cli-plugin/metro/metro-config": ["metro-config@0.87.3", "", { "dependencies": { "connect": "^3.6.5", "flow-enums-runtime": "^0.0.6", "jest-validate": "^29.7.0", "metro": "0.87.3", "metro-cache": "0.87.3", "metro-core": "0.87.3", "metro-runtime": "0.87.3" } }, "sha512-Y68gCZgzg3KrIRpNQAnPTyucfC0e4v7xBiaaEMZEytthqZ8G1kWyRNbwVMN0Bq4ME1kfYAqDH2aSEwEA7a/PrA=="], + + "@react-native/community-cli-plugin/metro/metro-core": ["metro-core@0.87.3", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "lodash.throttle": "^4.1.1", "metro-resolver": "0.87.3" } }, "sha512-9aleh7DWSQpyntLnDALf86LGIg3NgDST/HEmEeR51CuiHfrzIN08aCbe9y+OAqPzFUOzgUfYMVGfgQOIbitigA=="], + + "@react-native/community-cli-plugin/metro/metro-file-map": ["metro-file-map@0.87.3", "", { "dependencies": { "debug": "^4.4.0", "fb-watchman": "^2.0.0", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "jest-worker": "^29.7.0", "nullthrows": "^1.1.1" } }, "sha512-onUyGnS8pkLDf6pSvu6GyETu6CPUd5IAk8Mqhn5P3WqBHexBS6bvbMMVuuc350dleA6HH6Emx//0KP5cEBUOCg=="], + + "@react-native/community-cli-plugin/metro/metro-resolver": ["metro-resolver@0.87.3", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-O82NUc8KRKem9oxMzADl6a9u7H2hpKt4I9vfApZsBYmc3wlwP4UgffZJZxd8P0KrbY5CYkgW30ou17/W+ujM4w=="], + + "@react-native/community-cli-plugin/metro/metro-symbolicate": ["metro-symbolicate@0.87.3", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", "metro-source-map": "0.87.3", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "vlq": "^1.0.0" }, "bin": { "metro-symbolicate": "src/index.js" } }, "sha512-koHM4gA6iE7OSYACKvJCg/N/9QK6i7vrA3l4gMKtK1Z7XfQVixtWiUTqf+XTkGdVTjioHmlTF/MmG+BmfL301w=="], + + "@react-native/community-cli-plugin/metro/metro-transform-plugins": ["metro-transform-plugins@0.87.3", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/generator": "^7.29.1", "@babel/template": "^7.28.6", "@babel/traverse": "^7.29.10", "flow-enums-runtime": "^0.0.6", "nullthrows": "^1.1.1" } }, "sha512-43+RwCr2EV6KaulqxDDxt0c2hVApVQ364YY5aSNZTbsIb16kwZmUsEeKXko1fc89J5eV2xUIcR+6SKQqzQqtkg=="], + + "@react-native/community-cli-plugin/metro/metro-transform-worker": ["metro-transform-worker@0.87.3", "", { "dependencies": { "@babel/core": "^7.25.2", "@babel/generator": "^7.29.1", "@babel/parser": "^7.29.9", "@babel/types": "^7.29.8", "@jridgewell/sourcemap-codec": "^1.5.0", "flow-enums-runtime": "^0.0.6", "metro": "0.87.3", "metro-babel-transformer": "0.87.3", "metro-cache": "0.87.3", "metro-cache-key": "0.87.3", "metro-minify-terser": "0.87.3", "metro-source-map": "0.87.3", "metro-transform-plugins": "0.87.3", "nullthrows": "^1.1.1" } }, "sha512-XchqDAB4g1tImWOuEqHOvSMqIA4ZS1vNy38r8+vU+RvPDz9kva0oYa1S06/RDlYT0xqogQekBNA1n7/rWWzWFw=="], + + "@react-native/community-cli-plugin/metro/mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="], + + "compression/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], + + "connect/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], + + "finalhandler/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], + + "log-symbols/chalk/ansi-styles": ["ansi-styles@3.2.1", "", { "dependencies": { "color-convert": "^1.9.0" } }, "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA=="], + + "log-symbols/chalk/supports-color": ["supports-color@5.5.0", "", { "dependencies": { "has-flag": "^3.0.0" } }, "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow=="], + + "metro-babel-transformer/flow-parser/flow-estree": ["flow-estree@0.331.0", "", {}, "sha512-FVLYkSL/ITb/QXBEQvNWPjPooRGswuUtGOwrH+puSlMDneNkxy640+FZsk/TfKL+b7Wbw/Fg9FTUv2bMQDpj2w=="], + + "metro-symbolicate/metro-source-map/ob1": ["ob1@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-i8iA8uij0g1YQzS8uOJPSRCgwDjO9warIHUAu1Fqj877Wc3wlfxDYBioYWgKTBF2+URVJttyDWSEpmd99nlvtQ=="], + + "metro-transform-worker/metro-source-map/ob1": ["ob1@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-i8iA8uij0g1YQzS8uOJPSRCgwDjO9warIHUAu1Fqj877Wc3wlfxDYBioYWgKTBF2+URVJttyDWSEpmd99nlvtQ=="], + + "metro/accepts/negotiator": ["negotiator@1.1.0", "", { "dependencies": { "content-type": "^2.1.0" } }, "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg=="], + + "metro/flow-parser/flow-estree": ["flow-estree@0.331.0", "", {}, "sha512-FVLYkSL/ITb/QXBEQvNWPjPooRGswuUtGOwrH+puSlMDneNkxy640+FZsk/TfKL+b7Wbw/Fg9FTUv2bMQDpj2w=="], + + "metro/metro-source-map/ob1": ["ob1@0.87.1", "", { "dependencies": { "flow-enums-runtime": "^0.0.6" } }, "sha512-i8iA8uij0g1YQzS8uOJPSRCgwDjO9warIHUAu1Fqj877Wc3wlfxDYBioYWgKTBF2+URVJttyDWSEpmd99nlvtQ=="], + + "metro/mime-types/mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="], + + "ora/chalk/ansi-styles": ["ansi-styles@3.2.1", "", { "dependencies": { "color-convert": "^1.9.0" } }, "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA=="], + + "ora/chalk/supports-color": ["supports-color@5.5.0", "", { "dependencies": { "has-flag": "^3.0.0" } }, "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow=="], + + "send/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], + + "@react-native/community-cli-plugin/metro/accepts/negotiator": ["negotiator@1.1.0", "", { "dependencies": { "content-type": "^2.1.0" } }, "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg=="], + + "@react-native/community-cli-plugin/metro/flow-parser/flow-estree": ["flow-estree@0.336.0", "", {}, "sha512-0VaGWHJourzh88otU5bVJ4Z/oIsD+R6yaeR0Q8t8dezsKQI/RLi5m3fNzkiLYLhJ+YwM3JRSKlOqGplOI5Yo3w=="], + + "@react-native/community-cli-plugin/metro/metro-transform-worker/metro-minify-terser": ["metro-minify-terser@0.87.3", "", { "dependencies": { "flow-enums-runtime": "^0.0.6", "terser": "^5.15.0" } }, "sha512-9IS44WPQljNEutnDCynZa1Dol+Moj51U7lEfFEqYl0G7W8RkNURKwMq1ctibU3U7ZDS+IkLw1cfVsG8ytAGOfA=="], + + "@react-native/community-cli-plugin/metro/mime-types/mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="], + + "log-symbols/chalk/ansi-styles/color-convert": ["color-convert@1.9.3", "", { "dependencies": { "color-name": "1.1.3" } }, "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg=="], + + "log-symbols/chalk/supports-color/has-flag": ["has-flag@3.0.0", "", {}, "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="], + + "ora/chalk/ansi-styles/color-convert": ["color-convert@1.9.3", "", { "dependencies": { "color-name": "1.1.3" } }, "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg=="], + + "ora/chalk/supports-color/has-flag": ["has-flag@3.0.0", "", {}, "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="], + + "log-symbols/chalk/ansi-styles/color-convert/color-name": ["color-name@1.1.3", "", {}, "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="], + + "ora/chalk/ansi-styles/color-convert/color-name": ["color-name@1.1.3", "", {}, "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="], + } +} diff --git a/example-expo/index.js b/example-expo/index.js new file mode 100644 index 0000000..d996e8d --- /dev/null +++ b/example-expo/index.js @@ -0,0 +1,16 @@ +import {registerRootComponent} from 'expo'; +import {Platform} from 'react-native'; +import {startReactNativeSdk} from 'react-native-open-telemetry'; +import {ScenariosScreen} from '../example/src/ScenariosScreen'; + +// JS-fallback init: no native init in this app, so this call initializes native from the config (spec §4.4). +// No serviceVersion: the test-mode resource is service.name only (R2). Same collector and headers as the bare app. +startReactNativeSdk({ + serviceName: 'verify', + exportConfig: { + url: Platform.OS === 'android' ? 'http://10.0.2.2:4318' : 'http://localhost:4318', + headers: {'x-api-key': 'test'}, // asserted by verify/e2e/export-headers.e2e.ts + }, +}); + +registerRootComponent(ScenariosScreen); diff --git a/example-expo/metro.config.js b/example-expo/metro.config.js new file mode 100644 index 0000000..41a710c --- /dev/null +++ b/example-expo/metro.config.js @@ -0,0 +1,25 @@ +const path = require('path'); +const {getDefaultConfig} = require('expo/metro-config'); +const {mergeConfig} = require('@expo/metro/metro-config'); +const {withOtel} = require('../metro'); + +const root = path.resolve(__dirname, '..'); +const own = p => path.join(__dirname, 'node_modules', p); +// The repo root and the bare example have their own copies of these; the app must use exactly one. +const single = ['react', 'react-native', 'react-native-nitro-modules', '@react-native']; +const escape = s => s.replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&'); +const block = dir => single.map(m => new RegExp(`^${escape(path.join(dir, 'node_modules', m))}[/\\\\].*`)); + +const config = { + // babel.config.js inlines OTEL_TEST_MODE; keep test-mode and normal transforms in separate caches + cacheVersion: `otel-test-mode=${process.env.OTEL_TEST_MODE ?? ''}`, + // the library (exports -> lib/), the bare example's ScenariosScreen and verify/ + watchFolders: [root], + resolver: { + nodeModulesPaths: [path.join(__dirname, 'node_modules'), path.join(root, 'node_modules')], + blockList: [...block(root), ...block(path.join(root, 'example'))], + extraNodeModules: {...Object.fromEntries(single.map(m => [m, own(m)])), 'react-native-open-telemetry': root}, + }, +}; + +module.exports = withOtel(mergeConfig(getDefaultConfig(__dirname), config)); diff --git a/example-expo/package.json b/example-expo/package.json new file mode 100644 index 0000000..49a97bb --- /dev/null +++ b/example-expo/package.json @@ -0,0 +1,15 @@ +{ + "name": "react-native-open-telemetry-example-expo", + "version": "0.0.1", + "private": true, + "main": "index.js", + "scripts": { + "prebuild": "expo prebuild --clean --no-install" + }, + "dependencies": { + "expo": "58.0.26", + "react": "19.3.0", + "react-native": "0.88.1", + "react-native-nitro-modules": "0.37.2" + } +} diff --git a/example-expo/plugins/withOtelExample.js b/example-expo/plugins/withOtelExample.js new file mode 100644 index 0000000..7509ddc --- /dev/null +++ b/example-expo/plugins/withOtelExample.js @@ -0,0 +1,25 @@ +const {withAndroidManifest, withGradleProperties, withPodfile} = require('expo/config-plugins'); + +// Autolinking links only the Nitro pod; its pure Swift core pod is declared in the Podfile (R24). +const CORE_POD = " pod 'ReactNativeOpenTelemetryCore', :path => '../..'"; + +/** Example-only (Task 28): what the bare example's native projects carry by hand, applied at `expo prebuild`. */ +module.exports = config => { + config = withPodfile(config, c => { + if (!c.modResults.contents.includes(CORE_POD)) + c.modResults.contents = c.modResults.contents.replace(/^(target '.+' do\n)/m, `$1${CORE_POD}\n`); + return c; + }); + // ponytail: cleartext to any host, not only 10.0.2.2 like the bare app's network_security_config; example-only + config = withAndroidManifest(config, c => { + c.modResults.manifest.application[0].$['android:usesCleartextTraffic'] = 'true'; + return c; + }); + // Test mode is a build flag: `OTEL_TEST_MODE=1 expo prebuild` (Android); iOS takes it at `OTEL_TEST_MODE=1 pod install`. + if (process.env.OTEL_TEST_MODE === '1') + config = withGradleProperties(config, c => { + c.modResults.push({type: 'property', key: 'otelTestMode', value: 'true'}); + return c; + }); + return config; +}; diff --git a/example-expo/react-native.config.js b/example-expo/react-native.config.js new file mode 100644 index 0000000..6cfd93e --- /dev/null +++ b/example-expo/react-native.config.js @@ -0,0 +1,9 @@ +const path = require('path'); + +// Autolink the library from the repo root and the bare example's TestNative module (no npm dependency needed). +module.exports = { + dependencies: { + 'react-native-open-telemetry': {root: path.join(__dirname, '..')}, + 'react-native-test-native': {root: path.join(__dirname, '../example/modules/test-native')}, + }, +}; diff --git a/verify/VERIFY.md b/verify/VERIFY.md index eb640c2..b5ff8e6 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -13,7 +13,16 @@ cd example/android && OTEL_TEST_MODE=1 ./gradlew :app:assembleRelease -PotelTest # iOS cd example/ios && OTEL_TEST_MODE=1 pod install && OTEL_TEST_MODE=1 xcodebuild -workspace OpenTelemetryExample.xcworkspace \ -scheme OpenTelemetryExample -configuration Release -sdk iphonesimulator -derivedDataPath build build -E2E_TARGET=android-bare bun verify --e2e e2e # or ios-bare; omit E2E_TARGET for both +E2E_TARGET=android-bare bun verify --e2e e2e # or ios-bare, android-expo, ios-expo; omit E2E_TARGET for all four +``` + +The Expo app (`example-expo/`, `android-expo` / `ios-expo`) is CNG: `android/` and `ios/` are generated, not committed. + +```sh +cd example-expo && bun install && OTEL_TEST_MODE=1 bunx expo prebuild --clean --no-install +cd android && OTEL_TEST_MODE=1 ./gradlew :app:assembleRelease # otelTestMode=true comes from the prebuild +cd ../ios && OTEL_TEST_MODE=1 pod install && OTEL_TEST_MODE=1 xcodebuild -workspace OpenTelemetryExpo.xcworkspace \ + -scheme OpenTelemetryExpo -configuration Release -sdk iphonesimulator -derivedDataPath build build ``` `fast-jvm` replays every `verify/fixtures/.handoff.json` through the Kotlin core (`android/core-jvm`, its own @@ -42,8 +51,10 @@ except the scenarios with their own e2e file. Each test cold-starts the app (R5) `VERIFY_E2E_DRAFT=1` writes a **missing** `..otlp.json` from the device run and still fails the test ("drafted …, review it"); existing files are never overwritten. Draft runs have no retries, so a drafting run always ends red. Each target compares to its platform's files (`android-*` → `android`, `ios-*` → `ios`): the bare app inits native -first (`RNOtel.start` in `MainApplication` / `AppDelegate`) and ScenariosScreen exports through `startReactNativeSdk` -and the Kotlin or Swift core. +first (`RNOtel.start` in `MainApplication` / `AppDelegate`), the Expo app inits from JS (below), and ScenariosScreen +exports through `startReactNativeSdk` and the Kotlin or Swift core. One set of files for both apps is the proof that +the two init paths are equivalent. A scenario that only one app can run names targets (`android-bare`) instead of +platforms in `targets`. **TestNative (R25, Task 26).** `cross-*` scenarios call `ctx.native`, the example-only Nitro HybridObject in `example/modules/test-native/` (own `nitro.json`, podspec, `build.gradle`; autolinked through @@ -69,6 +80,33 @@ an argument) can be off by that skew on iOS. The fake collector listens on port 4318; the app reaches it at `10.0.2.2` (Android emulator) or `localhost` (iOS simulator). +## Expo app (Task 28) + +`example-expo/`: **Expo SDK 58** (`expo` 58.0.26), **React Native 0.88.1**, React 19.3.0, `react-native-nitro-modules` +0.37.2, all pinned exactly. SDK 58 is the newest Expo SDK (npm `latest`, 2026-11-24) and bundles the same RN as the bare +app. Built locally with Xcode 27.1; the CI jobs `e2e-android-expo` / `e2e-ios-expo` (`xcode-27`, Xcode 27.0) are +unproven until their first CI run. + +- **Init: JS fallback.** No native init. `index.js` calls `startReactNativeSdk({serviceName: 'verify', exportConfig: + {url, headers: {'x-api-key': 'test'}}})` (no `serviceVersion`, R2) before registering the bare example's + `ScenariosScreen`, whose later `startReactNativeSdk()` calls get that first handle. Native reports `testMode` from its + build flag; the config has no test fields. +- **Metro:** `withOtel(mergeConfig(getDefaultConfig(__dirname), …))` with Expo's `getDefaultConfig`; same single-copy + resolver setup as the bare app (blocks the root's and `example/`'s React Native copies). Babel: `babel-preset-expo` + plus the bare example's `OTEL_TEST_MODE` inline plugin. +- **Autolinking:** Expo autolinking reads `example-expo/react-native.config.js`, which points at the repo root and at + the bare example's TestNative, so the `cross-*` scenarios run on Expo too. +- **Local config plugin** (`example-expo/plugins/withOtelExample.js`, applied at prebuild): adds + `pod 'ReactNativeOpenTelemetryCore', :path => '../..'` to the Podfile (R24; `withPodfile`, no `expo-build-properties` + dependency); sets `usesCleartextTraffic` (the collector is plain HTTP); and with `OTEL_TEST_MODE=1` at prebuild + writes `otelTestMode=true` to `gradle.properties`. iOS takes test mode at `OTEL_TEST_MODE=1 pod install`. +- **R8:** Expo release builds minify (`android.enableMinifyInReleaseBuilds=true`). The library now ships + `android/consumer-rules.pro`: `-dontwarn` for otel-java's optional compile-only classes, and a keep rule for + `io.opentelemetry.sdk.resources.**`, which otel-java's `ResourceMarshaler` reaches by reflection + (`EntityUtil.getEntities`). Without it every export threw `Error calling getEntities on Resource` and nothing arrived. +- **Not on Expo:** `native-init-failure` (`targets: ['android-bare', 'ios-bare']`): the bad URL goes to the bare app's + native init, and the Expo app has none. `fast-refresh-idempotent` is local-only on the bare dev builds. + ## Failure scenarios (Task 27) Each has its own e2e file (R10); the ScenariosScreen does not `forceFlush()` after `collector-down`, @@ -183,7 +221,7 @@ e2e targets are android, ios and web unless the Runners column names them. | `cross-js-to-native` | a native span started from JS is a child of the JS span | 26 | e2e (android, ios) | passing | | `cross-native-to-js` | a JS span started under a native span's context is its child | 26 | e2e (android, ios) | passing | | `collector-down` | app never blocks; spans arrive exactly once when the collector is back | 27 | e2e (android, ios; web with 23) | passing | -| `native-init-failure` | one error log, no-op SDK, nothing exported | 27 | e2e (android, ios) | passing | +| `native-init-failure` | one error log, no-op SDK, nothing exported | 27 | e2e (android-bare, ios-bare) | passing | | `flush-after-reload` | `forceFlush()` resolves across a JS reload; spans arrive once | 27 | e2e (android, ios) | passing | | `background-flush` | spans are exported on background without `forceFlush()` | 27 | e2e (android, ios) | passing | | `fast-refresh-idempotent` | fast refresh does not stack the patch: `then`/`setTimeout` keep their identity across refreshes | 27 | e2e (android-dev, ios-dev; local only) | passing (local only) | @@ -195,7 +233,7 @@ e2e targets are android, ios and web unless the Runners column names them. 1. `verify/scenarios/.ts`: `export default scenario('', async ({tracer, at}) => {…}, opts)`. Explicit `at(µs)` start/end times on every span; parents through `context.active()` (`startActiveSpan`), not explicit parent contexts. `opts.runners` defaults to `['jest', 'e2e']` (`'jest-degraded'` is the native-`async` project), `opts.targets` to - `['android', 'ios', 'web']` (the e2e harness skips other targets); `pending: true` until it passes. + `['android', 'ios', 'web']` (platforms or target names like `android-bare`; the e2e harness skips other targets); `pending: true` until it passes. 2. Hand-write `verify/expected/.shape.json` in exactly `shapeOf()`'s format (traces ordered by first span start, spans sorted by name, `kind` 1 = INTERNAL) and get it reviewed. 3. `bun verify` regenerates `verify/scenarios/index.ts`. Un-pend, draft the exact files with `VERIFY_UPDATE=1 bun verify` diff --git a/verify/e2e/background-flush.e2e.ts b/verify/e2e/background-flush.e2e.ts index c03c55b..aaa52fa 100644 --- a/verify/e2e/background-flush.e2e.ts +++ b/verify/e2e/background-flush.e2e.ts @@ -1,6 +1,6 @@ import {execFileSync} from 'node:child_process'; import {expect} from 'e2e'; -import {clearDeviceLog, expectScenario, platformOf, tapFlush, test, until} from './harness'; +import {bundleIdOf, clearDeviceLog, expectScenario, platformOf, tapFlush, test, until} from './harness'; // Spans handed off right before the app goes to background are exported without forceFlush() (§9.4). Test mode has // no timed export (scheduleDelay 120 s), so within the wait only the background hook can have sent them. @@ -13,13 +13,13 @@ test('background-flush', async ({app, screen, collector, device, target}) => { await device.home(); if (!(await until(() => collector.received() > 0, 15_000))) throw new Error('nothing exported within 15 s of going to background'); // back in the foreground the app answers a tap at once: the background flush left the main thread free - await device.openApp('opentelemetry.example'); + await device.openApp(bundleIdOf(target)); // foreground only (app.open() relaunches) await tapFlush(screen, 1, 2_000); }, }); // and Android recorded no ANR for the app if (android) expect(execFileSync('adb', ['-s', deviceId, 'logcat', '-d', '-b', 'events', '-s', 'am_anr'], {encoding: 'utf8'})).not.toContain( - 'opentelemetry.example', + bundleIdOf(target), ); }); diff --git a/verify/e2e/e2e.config.ts b/verify/e2e/e2e.config.ts index c3b76f8..d26b2ea 100644 --- a/verify/e2e/e2e.config.ts +++ b/verify/e2e/e2e.config.ts @@ -3,6 +3,8 @@ import {mobile} from '@e2e-dev/mobile'; const bundleId = 'opentelemetry.example'; const example = '../../example'; +// Expo prebuild app (JS-fallback init, Task 28): same scenarios, same android/ios expected files +const expo = '../../example-expo'; export default { projectId: 'react-native-open-telemetry', @@ -30,6 +32,22 @@ export default { appPath: process.env.E2E_IOS_APP ?? `${example}/ios/build/Build/Products/Release-iphonesimulator/OpenTelemetryExample.app`, }, }, + { + name: 'android-expo', + engine: mobile({platform: 'android', device: process.env.E2E_ANDROID_DEVICE}), + app: { + bundleId: 'opentelemetry.example.expo', + appPath: process.env.E2E_ANDROID_EXPO_APP ?? `${expo}/android/app/build/outputs/apk/release/app-release.apk`, + }, + }, + { + name: 'ios-expo', + engine: mobile({platform: 'ios', device: process.env.E2E_IOS_DEVICE}), + app: { + bundleId: 'opentelemetry.example.expo', + appPath: process.env.E2E_IOS_EXPO_APP ?? `${expo}/ios/build/Build/Products/Release-iphonesimulator/OpenTelemetryExpo.app`, + }, + }, // Dev builds (Debug + Metro), local only: fast-refresh-idempotent (Task 27). See VERIFY.md. ...(process.env.E2E_DEV === '1' ? [ diff --git a/verify/e2e/harness.ts b/verify/e2e/harness.ts index c30f624..bc557a1 100644 --- a/verify/e2e/harness.ts +++ b/verify/e2e/harness.ts @@ -2,6 +2,7 @@ import {execFileSync, spawn} from 'node:child_process'; import path from 'node:path'; import {test as base} from '@e2e-dev/mobile'; import {expect, type App, type Screen} from 'e2e'; +import type {Target} from '../harness/scenario'; // Device runs compare to the reviewed expected files of their platform (native-first); never rewrite them. if (process.env.VERIFY_UPDATE === '1') @@ -24,6 +25,9 @@ export const ANDROID_EXPORT_URL_FILE = '/sdcard/Android/data/opentelemetry.examp /** Must match the example apps' native init URLs (MainApplication.kt, AppDelegate.swift). */ export const COLLECTOR_PORT = 4318; +/** Must match e2e.config.ts: the bare example, or the Expo app (`*-expo`). */ +export const bundleIdOf = (targetName: string) => (targetName.endsWith('-expo') ? 'opentelemetry.example.expo' : 'opentelemetry.example'); + /** `android-bare` -> `android`. */ export const platformOf = (targetName: string) => targetName.split('-')[0] as 'android' | 'ios'; @@ -77,7 +81,7 @@ export async function expectScenario( ) { const s = allScenarios().find(x => x.name === name); if (!s) throw new Error(`unknown scenario ${name}`); - test.skip(!s.targets.includes(platformOf(target)), `${name} does not run on ${platformOf(target)}`); + test.skip(!s.targets.includes(platformOf(target)) && !s.targets.includes(target as Target), `${name} does not run on ${target}`); // cold start per scenario (R5): no SDK state or ID counters carried over await (steps.launch ? steps.launch() : app.restart()); @@ -91,7 +95,8 @@ export async function expectScenario( } finally { actual = await collector.end(); } - // both apps export through the native core, so android-* compare to `android` files and ios-* to `ios` (R13). + // every app exports through the native core (bare: native-first init, Expo: JS-fallback init), so android-* compare + // to `android` files and ios-* to `ios` (R13): one set of files proves both init paths equivalent (Task 28). // VERIFY_E2E_DRAFT=1 writes a missing expected file and still fails (review it, then rerun) const r = compareToExpected(name, platformOf(target), actual, {draft: process.env.VERIFY_E2E_DRAFT === '1'}); if (!r.ok) throw new Error('\n' + r.report); diff --git a/verify/harness/scenario.ts b/verify/harness/scenario.ts index 748814d..957e865 100644 --- a/verify/harness/scenario.ts +++ b/verify/harness/scenario.ts @@ -17,12 +17,13 @@ export type ScenarioCtx = { }; /** `jest-degraded`: the Jest project that keeps native `async` (Task 11). */ export type Runner = 'jest' | 'jest-degraded' | 'e2e'; -export type Target = 'android' | 'ios' | 'web'; +/** A platform, or one e2e target (`android-bare`, `ios-expo`, …) for what only one app can run. */ +export type Target = 'android' | 'ios' | 'web' | `${'android' | 'ios'}-${'bare' | 'expo'}`; export type Scenario = { name: string; run: (ctx: ScenarioCtx) => Promise; runners: Runner[]; - /** e2e targets it runs on. */ + /** e2e targets it runs on: platforms or target names. */ targets: Target[]; pending: boolean; }; diff --git a/verify/scenarios/native-init-failure.ts b/verify/scenarios/native-init-failure.ts index adad98a..93365e0 100644 --- a/verify/scenarios/native-init-failure.ts +++ b/verify/scenarios/native-init-failure.ts @@ -9,5 +9,6 @@ export default scenario( async ({tracer, at}) => { tracer.startSpan('dropped', {startTime: at(0)}).end(at(10)); }, - {runners: ['e2e'], targets: ['android', 'ios']}, + // bare only: the bad URL goes to the bare example's native init; the Expo app has none (it inits from JS) + {runners: ['e2e'], targets: ['android-bare', 'ios-bare']}, ); diff --git a/verify/stages/e2e.ts b/verify/stages/e2e.ts index 0026d90..9fe1fee 100644 --- a/verify/stages/e2e.ts +++ b/verify/stages/e2e.ts @@ -5,7 +5,7 @@ const stage: Stage = { order: 90, e2e: true, run({sh}) { - // E2E_TARGET=android-bare|ios-bare runs one target (CI runs one per job) + // E2E_TARGET=android-bare|ios-bare|android-expo|ios-expo runs one target (CI runs one per job) const target = process.env.E2E_TARGET ? ['--target', process.env.E2E_TARGET] : []; // Device runs compare to the reviewed expected files: never --update them from a device. const update = process.env.VERIFY_UPDATE; From aaf8f594db569d79753b3dd9716808b10970ce1d Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 06:01:52 +0100 Subject: [PATCH 49/76] chore(example-expo): name the shared Babel plugin; mark cleartext example-only; note R8 rule guard Co-Authored-By: Claude Opus 5.5 --- android/consumer-rules.pro | 1 + example-expo/babel.config.js | 2 +- example-expo/plugins/withOtelExample.js | 4 +++- example/babel.config.js | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/android/consumer-rules.pro b/android/consumer-rules.pro index a16d7e8..6f1650f 100644 --- a/android/consumer-rules.pro +++ b/android/consumer-rules.pro @@ -1,3 +1,4 @@ +# Guarded by the minified Expo release e2e (Task 28): recheck these rules on every otel-java bump. # otel-java references optional, compile-only classes it never loads at runtime here (no autoconfigure, no incubator, # annotations only); R8 in a minifying app fails on them as missing. -dontwarn com.google.auto.value.** diff --git a/example-expo/babel.config.js b/example-expo/babel.config.js index 617e515..080875d 100644 --- a/example-expo/babel.config.js +++ b/example-expo/babel.config.js @@ -1,5 +1,5 @@ // The bare example's inline OTEL_TEST_MODE plugin (test mode is a bundle-time flag). -const [inlineTestMode] = require('../example/babel.config.js').plugins; +const {inlineTestMode} = require('../example/babel.config.js'); module.exports = { presets: ['babel-preset-expo'], diff --git a/example-expo/plugins/withOtelExample.js b/example-expo/plugins/withOtelExample.js index 7509ddc..3f65384 100644 --- a/example-expo/plugins/withOtelExample.js +++ b/example-expo/plugins/withOtelExample.js @@ -10,7 +10,9 @@ module.exports = config => { c.modResults.contents = c.modResults.contents.replace(/^(target '.+' do\n)/m, `$1${CORE_POD}\n`); return c; }); - // ponytail: cleartext to any host, not only 10.0.2.2 like the bare app's network_security_config; example-only + // EXAMPLE-ONLY, DO NOT COPY: app-wide cleartext so the e2e collector (plain http, also with test mode off) is reachable. + // ponytail: any host, not only 10.0.2.2 like the bare app's network_security_config. Only the CORE_POD step above is + // what a real Expo app needs. config = withAndroidManifest(config, c => { c.modResults.manifest.application[0].$['android:usesCleartextTraffic'] = 'true'; return c; diff --git a/example/babel.config.js b/example/babel.config.js index b4caebd..ef767fd 100644 --- a/example/babel.config.js +++ b/example/babel.config.js @@ -11,3 +11,4 @@ module.exports = { presets: ['module:@react-native/babel-preset'], plugins: [inlineTestMode], }; +module.exports.inlineTestMode = inlineTestMode; // reused by example-expo/babel.config.js From 1181b9f315c290d3332dd4e416f82c6a198b63b1 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 06:05:14 +0100 Subject: [PATCH 50/76] chore(deps): add @e2e-dev/web 0.16.1, react-dom 19.3.0 and react-native-web 0.21.4 for the web e2e target Co-Authored-By: Claude Opus 5.5 --- bun.lock | 5 +++++ example/bun.lock | 40 ++++++++++++++++++++++++++++++++++++++++ example/package.json | 4 +++- package.json | 1 + 4 files changed, 49 insertions(+), 1 deletion(-) diff --git a/bun.lock b/bun.lock index 29127a9..83b5168 100644 --- a/bun.lock +++ b/bun.lock @@ -14,6 +14,7 @@ "devDependencies": { "@changesets/cli": "^2.28.1", "@e2e-dev/mobile": "0.12.8", + "@e2e-dev/web": "0.16.1", "@react-native/babel-preset": "^0.88.1", "@types/jest": "^30.0.0", "@types/node": "^24.0.0", @@ -351,6 +352,8 @@ "@e2e-dev/mobile": ["@e2e-dev/mobile@0.12.8", "", { "dependencies": { "@napi-rs/image": "1.16.0", "agent-device": "0.21.39", "zod": "4.6.7" }, "peerDependencies": { "@e2e-dev/core": ">=0.23.2 <1", "ai": "^7.0.0", "e2e": ">=0.23.2 <1" }, "optionalPeers": ["ai", "e2e"] }, "sha512-N9BuoUC0a+7pG1NbhTfL0janxqNf7blm+6TW/EQZ4IlURbYIZQFmSRK+2HEnH+FzrobqXBBI/egHYW9LIRfGsg=="], + "@e2e-dev/web": ["@e2e-dev/web@0.16.1", "", { "dependencies": { "playwright-core": "1.65.1" }, "peerDependencies": { "@e2e-dev/core": ">=0.23.2 <1", "e2e": ">=0.23.2 <1" }, "optionalPeers": ["e2e"], "bin": { "e2e-web": "./dist/bin.js" } }, "sha512-mWSzyWSNcoqOiy6BEaXOTe8rufCz6T+NyYkJej5JOz6yy3vcnG13wEwHgl7Kdw5rv8yUbSLqbuDBRVBBtkvqIA=="], + "@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.28.2", "", { "os": "aix", "cpu": "ppc64" }, "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ=="], "@esbuild/android-arm": ["@esbuild/android-arm@0.28.2", "", { "os": "android", "cpu": "arm" }, "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg=="], @@ -1605,6 +1608,8 @@ "pkg-up": ["pkg-up@3.1.0", "", { "dependencies": { "find-up": "^3.0.0" } }, "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA=="], + "playwright-core": ["playwright-core@1.65.1", "", { "bin": { "playwright-core": "cli.js" } }, "sha512-hqPpz7blSMPxWVdoeE1yiBSzXsKiVOd2k+kjCvmUywD2GPO2Dd9HfcWnq9NN0GHbNZDFgZ9JfBFr+X5/BLo0qw=="], + "pngjs": ["pngjs@7.0.0", "", {}, "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow=="], "postcss": ["postcss@8.5.33", "", { "dependencies": { "nanoid": "^3.3.20", "picocolors": "^1.1.1", "source-map-js": "^1.2.2" } }, "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ=="], diff --git a/example/bun.lock b/example/bun.lock index 022e236..36aed29 100644 --- a/example/bun.lock +++ b/example/bun.lock @@ -5,8 +5,10 @@ "name": "opentelemetry.example", "dependencies": { "react": "19.3.0", + "react-dom": "19.3.0", "react-native": "0.88.1", "react-native-nitro-modules": "0.37.2", + "react-native-web": "0.21.4", }, "devDependencies": { "@babel/core": "^7.25.2", @@ -630,8 +632,12 @@ "create-jest": ["create-jest@29.7.0", "", { "dependencies": { "@jest/types": "^29.6.3", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", "jest-config": "^29.7.0", "jest-util": "^29.7.0", "prompts": "^2.0.1" }, "bin": { "create-jest": "bin/create-jest.js" } }, "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q=="], + "cross-fetch": ["cross-fetch@3.2.0", "", { "dependencies": { "node-fetch": "^2.7.0" } }, "sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q=="], + "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], + "css-in-js-utils": ["css-in-js-utils@3.1.0", "", { "dependencies": { "hyphenate-style-name": "^1.0.3" } }, "sha512-fJAcud6B3rRu+KHYk+Bwf+WFL2MDCJJ1XG9x137tJQ0xYxor7XziQtuGFbWNdqrvF4Tk26O3H73nfVqXt/fW1A=="], + "csstype": ["csstype@3.2.4", "", {}, "sha512-PoKaoPzQapnEoqUSnHx1u6W6ku8CVEgKsnpmmzU3m1nwkidpPBQ8V/Zq2+bWNrsOKoKLwTGdbx6xF7BXP1zLVQ=="], "data-view-buffer": ["data-view-buffer@1.0.2", "", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-data-view": "^1.0.2" } }, "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ=="], @@ -778,6 +784,10 @@ "fb-watchman": ["fb-watchman@2.0.4", "", { "dependencies": { "bser": "2.1.2" } }, "sha512-tGQtaoYisPDriJBN0mT5yZSyNETnJGA1gTYxaVRAE5KUO3LI9kPUc9WIu8JXcxaIci+faIKlzXqXyPgrmubtBQ=="], + "fbjs": ["fbjs@3.0.5", "", { "dependencies": { "cross-fetch": "^3.1.5", "fbjs-css-vars": "^1.0.0", "loose-envify": "^1.0.0", "object-assign": "^4.1.0", "promise": "^7.1.1", "setimmediate": "^1.0.5", "ua-parser-js": "^1.0.35" } }, "sha512-ztsSx77JBtkuMrEypfhgc3cI0+0h+svqeie7xHbh1k/IKdcydnvadp/mUaGgjAOXQmQSxsqgaRhS3q9fy+1kxg=="], + + "fbjs-css-vars": ["fbjs-css-vars@1.0.2", "", {}, "sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ=="], + "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], "file-entry-cache": ["file-entry-cache@6.0.1", "", { "dependencies": { "flat-cache": "^3.0.4" } }, "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg=="], @@ -872,6 +882,8 @@ "human-signals": ["human-signals@2.1.0", "", {}, "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw=="], + "hyphenate-style-name": ["hyphenate-style-name@1.1.0", "", {}, "sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw=="], + "iconv-lite": ["iconv-lite@0.7.3", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ=="], "ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="], @@ -888,6 +900,8 @@ "inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="], + "inline-style-prefixer": ["inline-style-prefixer@7.0.1", "", { "dependencies": { "css-in-js-utils": "^3.1.0" } }, "sha512-lhYo5qNTQp3EvSSp3sRvXMbVQTLrvGV6DycRMJ5dm2BLMiJ30wpXKdDdgX+GmJZ5uQMucwRKHamXSst3Sj/Giw=="], + "internal-slot": ["internal-slot@1.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "hasown": "^2.0.2", "side-channel": "^1.1.0" } }, "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw=="], "invariant": ["invariant@2.2.4", "", { "dependencies": { "loose-envify": "^1.0.0" } }, "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA=="], @@ -1152,6 +1166,8 @@ "node-exports-info": ["node-exports-info@1.6.2", "", { "dependencies": { "array.prototype.flatmap": "^1.3.3", "es-errors": "^1.3.0", "object.entries": "^1.1.9", "semver": "^6.3.1" } }, "sha512-kXs9Go0cah0qHVV2v389IXQLdLCeE1xfFtjOAF+iobu0OIoG1pje8At2vMHyaPMiPMnG/LWP50twML21eMcAag=="], + "node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="], + "node-int64": ["node-int64@0.4.0", "", {}, "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw=="], "node-releases": ["node-releases@2.0.65", "", {}, "sha512-PfvofsGQ+MiOQIPkX9fU8ELUWmy5zL74CdQaph/ismKszfFkfwXaw0cGiwbwym2hT9k5+mdyl8O5WQ1MD8EHmA=="], @@ -1228,6 +1244,8 @@ "possible-typed-array-names": ["possible-typed-array-names@1.1.0", "", {}, "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg=="], + "postcss-value-parser": ["postcss-value-parser@4.2.0", "", {}, "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="], + "prelude-ls": ["prelude-ls@1.2.1", "", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="], "prettier": ["prettier@2.8.8", "", { "bin": { "prettier": "bin-prettier.js" } }, "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q=="], @@ -1256,12 +1274,16 @@ "react-devtools-core": ["react-devtools-core@6.1.5", "", { "dependencies": { "shell-quote": "^1.6.1", "ws": "^7" } }, "sha512-ePrwPfxAnB+7hgnEr8vpKxL9cmnp7F322t8oqcPshbIQQhDKgFDW4tjhF2wjVbdXF9O/nyuy3sQWd9JGpiLPvA=="], + "react-dom": ["react-dom@19.3.0", "", { "dependencies": { "scheduler": "^0.28.0" }, "peerDependencies": { "react": "^19.3.0" } }, "sha512-JDk8dgif51OjFoDE70+OT9ICyYr+69HlmihNwp1+Nsfbna3t5sIiCa9ZJktDmQ4/1b/rn26hIAR2uYXDMr5r0Q=="], + "react-is": ["react-is@19.3.1", "", {}, "sha512-RRieF6IyxQBkcK6pP8xOHprLTPW6QjRkbGdImtqNme+/hYVwCZkLQLdlZGOhUqXwkS9IEynaGvPJtv6XB/cz0Q=="], "react-native": ["react-native@0.88.1", "", { "dependencies": { "@react-native/asset-utils": "0.88.1", "@react-native/codegen": "0.88.1", "@react-native/community-cli-plugin": "0.88.1", "@react-native/gradle-plugin": "0.88.1", "@react-native/normalize-colors": "0.88.1", "@react-native/virtualized-lists": "0.88.1", "anser": "^1.4.9", "ansi-regex": "^5.0.0", "base64-js": "^1.5.1", "flow-enums-runtime": "^0.0.6", "flow-parser": "0.327.0", "hermes-compiler": "260318099.0.5", "invariant": "^2.2.4", "memoize-one": "^5.0.0", "metro-runtime": "^0.87.1", "metro-source-map": "^0.87.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.28.0", "semver": "^7.1.3", "stacktrace-parser": "^0.1.10", "tinyglobby": "^0.2.15", "whatwg-fetch": "^3.0.0", "ws": "^7.5.10", "yargs": "^17.6.2" }, "peerDependencies": { "@types/react": "^19.1.1", "react": "^19.3.0" }, "optionalPeers": ["@types/react"], "bin": { "react-native": "cli.js" } }, "sha512-wajWcLZ93GCN7k4Uwh4CS4L2Ah8ohcvkOXnvIYmh4Yvuqho5j3APZ9qozK+nQrHWSgauq4h8D3HN5DKK84SrHA=="], "react-native-nitro-modules": ["react-native-nitro-modules@0.37.2", "", { "dependencies": { "nitro-core": "0.37.2" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-Odnrq/p6/q0R01qZlkqeXu9VHHMuGEnZZmyxMvehEu6QiACNHhBCmAHgyBDqOSo9Lb3G0TscFAT+HG0uxsR/GA=="], + "react-native-web": ["react-native-web@0.21.4", "", { "dependencies": { "@babel/runtime": "^7.18.6", "@react-native/normalize-colors": "^0.74.1", "fbjs": "^3.0.4", "inline-style-prefixer": "^7.0.1", "memoize-one": "^6.0.0", "nullthrows": "^1.1.1", "postcss-value-parser": "^4.2.0", "styleq": "^0.1.3" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" } }, "sha512-77B6KlalB4osNIck91TNFixPkYPsTbuNEvw8P7IV+4v4/5wZSBRKZnw0Zhx6YjuauDTz71gc8IW+fVhcBMjr5A=="], + "react-refresh": ["react-refresh@0.14.2", "", {}, "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA=="], "react-test-renderer": ["react-test-renderer@19.3.0", "", { "dependencies": { "react-is": "^19.3.0", "scheduler": "^0.28.0" }, "peerDependencies": { "react": "^19.3.0" } }, "sha512-AUxgv+hRbqjRgx4xVwiWL6cvDDKPAva1VWLXQIMoevqQn9us//C5TX9LEnBGH47D0zvJpjwjxb1umzgOMvE8Wg=="], @@ -1332,6 +1354,8 @@ "set-proto": ["set-proto@1.0.0", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0" } }, "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw=="], + "setimmediate": ["setimmediate@1.0.5", "", {}, "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA=="], + "setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="], "shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="], @@ -1400,6 +1424,8 @@ "strnum": ["strnum@2.5.1", "", { "dependencies": { "anynum": "^1.0.1" } }, "sha512-UM4nTLWzQiDBseVxUGxN0wJzIk0UU89Qi7pKXz9qISo+lhviJikTuikBsK/oFRlpvYHvSdz0TVoLyQ+sEpYwxA=="], + "styleq": ["styleq@0.1.3", "", {}, "sha512-3ZUifmCDCQanjeej1f6kyl/BeP/Vae5EYkQ9iJfUm/QwZvlgnZzyflqAsAWYURdtea8Vkvswu2GrC57h3qffcA=="], + "supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="], "supports-preserve-symlinks-flag": ["supports-preserve-symlinks-flag@1.0.0", "", {}, "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="], @@ -1420,6 +1446,8 @@ "toidentifier": ["toidentifier@1.0.1", "", {}, "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="], + "tr46": ["tr46@0.0.3", "", {}, "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="], + "ts-api-utils": ["ts-api-utils@2.5.0", "", { "peerDependencies": { "typescript": ">=4.8.4" } }, "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA=="], "type-check": ["type-check@0.4.0", "", { "dependencies": { "prelude-ls": "^1.2.1" } }, "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew=="], @@ -1440,6 +1468,8 @@ "typescript": ["typescript@6.0.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw=="], + "ua-parser-js": ["ua-parser-js@1.0.41", "", { "bin": { "ua-parser-js": "script/cli.js" } }, "sha512-LbBDqdIC5s8iROCUjMbW1f5dJQTEFB1+KO9ogbvlb3nm9n4YHa5p4KTvFPWvh2Hs8gZMBuiB1/8+pdfe/tDPug=="], + "unbox-primitive": ["unbox-primitive@1.1.0", "", { "dependencies": { "call-bound": "^1.0.3", "has-bigints": "^1.0.2", "has-symbols": "^1.1.0", "which-boxed-primitive": "^1.1.1" } }, "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw=="], "undici-types": ["undici-types@8.9.0", "", {}, "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg=="], @@ -1474,8 +1504,12 @@ "wcwidth": ["wcwidth@1.0.1", "", { "dependencies": { "defaults": "^1.0.3" } }, "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg=="], + "webidl-conversions": ["webidl-conversions@3.0.1", "", {}, "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="], + "whatwg-fetch": ["whatwg-fetch@3.6.20", "", {}, "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg=="], + "whatwg-url": ["whatwg-url@5.0.0", "", { "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw=="], + "which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="], "which-boxed-primitive": ["which-boxed-primitive@1.1.1", "", { "dependencies": { "is-bigint": "^1.1.0", "is-boolean-object": "^1.2.1", "is-number-object": "^1.1.1", "is-string": "^1.1.1", "is-symbol": "^1.1.1" } }, "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA=="], @@ -1578,6 +1612,8 @@ "fast-glob/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], + "fbjs/promise": ["promise@7.3.1", "", { "dependencies": { "asap": "~2.0.3" } }, "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg=="], + "finalhandler/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], "finalhandler/encodeurl": ["encodeurl@1.0.4", "", {}, "sha512-ImAQpWtQZKdkUxvj9CMNzB8M4IGg0DkRTZzmOHqgVFrf71JDmUacbt+iKljfIpD2yHcxI+HR76d8bwvdvtSvGA=="], @@ -1616,6 +1652,10 @@ "react-native/semver": ["semver@7.8.6", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw=="], + "react-native-web/@react-native/normalize-colors": ["@react-native/normalize-colors@0.74.89", "", {}, "sha512-qoMMXddVKVhZ8PA1AbUCk83trpd6N+1nF2A6k1i6LsQObyS92fELuk8kU/lQs6M7BsMHwqyLCpQJ1uFgNvIQXg=="], + + "react-native-web/memoize-one": ["memoize-one@6.0.0", "", {}, "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw=="], + "resolve-cwd/resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="], "send/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], diff --git a/example/package.json b/example/package.json index 62ef536..0b92021 100644 --- a/example/package.json +++ b/example/package.json @@ -11,8 +11,10 @@ }, "dependencies": { "react": "19.3.0", + "react-dom": "19.3.0", "react-native": "0.88.1", - "react-native-nitro-modules": "0.37.2" + "react-native-nitro-modules": "0.37.2", + "react-native-web": "0.21.4" }, "devDependencies": { "@babel/core": "^7.25.2", diff --git a/package.json b/package.json index fddb8bb..fc6f0d5 100644 --- a/package.json +++ b/package.json @@ -91,6 +91,7 @@ "devDependencies": { "@changesets/cli": "^2.28.1", "@e2e-dev/mobile": "0.12.8", + "@e2e-dev/web": "0.16.1", "@react-native/babel-preset": "^0.88.1", "@types/jest": "^30.0.0", "@types/node": "^24.0.0", From 3e6fcfcc5d86badad0d06e7452c945890f3d4d10 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 06:18:09 +0100 Subject: [PATCH 51/76] fix(example): move the OTEL_TEST_MODE Babel plugin to its own file aaf8f59 exported it as a property of babel.config.js, which Babel reads as an unknown option ("Unknown option: .inlineTestMode"): every uncached Metro transform failed, including the static bundle-size check. Co-Authored-By: Claude Opus 5.5 --- example-expo/babel.config.js | 2 +- example/babel.config.js | 10 +--------- example/inlineTestMode.js | 10 ++++++++++ 3 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 example/inlineTestMode.js diff --git a/example-expo/babel.config.js b/example-expo/babel.config.js index 080875d..e826d34 100644 --- a/example-expo/babel.config.js +++ b/example-expo/babel.config.js @@ -1,5 +1,5 @@ // The bare example's inline OTEL_TEST_MODE plugin (test mode is a bundle-time flag). -const {inlineTestMode} = require('../example/babel.config.js'); +const inlineTestMode = require('../example/inlineTestMode'); module.exports = { presets: ['babel-preset-expo'], diff --git a/example/babel.config.js b/example/babel.config.js index ef767fd..2a61cd6 100644 --- a/example/babel.config.js +++ b/example/babel.config.js @@ -1,14 +1,6 @@ -// Test mode is a build flag: inline process.env.OTEL_TEST_MODE at bundle time (e2e builds set it to 1). -const inlineTestMode = ({types: t}) => { - const visit = p => { - if (p.get('object').matchesPattern('process.env') && t.isIdentifier(p.node.property, {name: 'OTEL_TEST_MODE'})) - p.replaceWith(process.env.OTEL_TEST_MODE == null ? t.identifier('undefined') : t.stringLiteral(process.env.OTEL_TEST_MODE)); - }; - return {visitor: {MemberExpression: visit, OptionalMemberExpression: visit}}; -}; +const inlineTestMode = require('./inlineTestMode'); module.exports = { presets: ['module:@react-native/babel-preset'], plugins: [inlineTestMode], }; -module.exports.inlineTestMode = inlineTestMode; // reused by example-expo/babel.config.js diff --git a/example/inlineTestMode.js b/example/inlineTestMode.js new file mode 100644 index 0000000..ff88a20 --- /dev/null +++ b/example/inlineTestMode.js @@ -0,0 +1,10 @@ +// Test mode is a build flag: inline process.env.OTEL_TEST_MODE at bundle time (e2e builds set it to 1). +const inlineTestMode = ({types: t}) => { + const visit = p => { + if (p.get('object').matchesPattern('process.env') && t.isIdentifier(p.node.property, {name: 'OTEL_TEST_MODE'})) + p.replaceWith(process.env.OTEL_TEST_MODE == null ? t.identifier('undefined') : t.stringLiteral(process.env.OTEL_TEST_MODE)); + }; + return {visitor: {MemberExpression: visit, OptionalMemberExpression: visit}}; +}; + +module.exports = inlineTestMode; // also used by example-expo/babel.config.js From 13b27ca7998f9c0a441b0716be77c8e83fc40633 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 24 Nov 2026 06:18:16 +0100 Subject: [PATCH 52/76] test(web): e2e target for all JS scenarios Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 30 ++- example/package.json | 4 +- example/web/index.html | 12 ++ example/web/index.tsx | 10 + example/web/nitro-stub.ts | 5 + example/web/vite.config.mjs | 27 +++ src/internal/testMode.ts | 11 +- verify/VERIFY.md | 48 ++++- verify/e2e/background-flush.e2e.ts | 4 +- verify/e2e/collector-down.e2e.ts | 11 +- verify/e2e/e2e.config.ts | 18 ++ verify/e2e/export-headers.e2e.ts | 4 +- verify/e2e/fast-refresh-idempotent.e2e.ts | 4 +- verify/e2e/flush-after-reload.e2e.ts | 4 +- verify/e2e/harness.ts | 52 +++-- verify/e2e/native-init-failure.e2e.ts | 6 +- verify/e2e/native-test-mode.e2e.ts | 4 +- verify/e2e/scenarios.e2e.ts | 4 +- verify/expected/async-generator.web.otlp.json | 79 ++++++++ .../batching-shared-queue.web.otlp.json | 67 ++++++ verify/expected/captured-then.web.otlp.json | 56 +++++ verify/expected/collector-down.web.otlp.json | 35 ++++ .../concurrent-interleaved.web.otlp.json | 99 +++++++++ .../expected/error-in-callback.web.otlp.json | 67 ++++++ verify/expected/export-headers.web.otlp.json | 35 ++++ verify/expected/handoff-basic.web.otlp.json | 43 ++++ .../expected/interval-new-root.web.otlp.json | 66 ++++++ .../expected/nest-after-await.web.otlp.json | 46 +++++ .../nest-promise-all-race.web.otlp.json | 90 +++++++++ verify/expected/nest-raf.web.otlp.json | 46 +++++ .../nest-timers-microtasks.web.otlp.json | 90 +++++++++ .../never-settling-promise.web.otlp.json | 66 ++++++ verify/expected/odd-attributes.web.otlp.json | 67 ++++++ verify/expected/rich-span.web.otlp.json | 191 ++++++++++++++++++ verify/expected/root-no-leak.web.otlp.json | 76 +++++++ verify/scenarios/event-emitter-listener.ts | 2 +- verify/scenarios/export-headers.ts | 2 +- verify/scenarios/nest-timers-microtasks.ts | 3 +- 38 files changed, 1441 insertions(+), 43 deletions(-) create mode 100644 example/web/index.html create mode 100644 example/web/index.tsx create mode 100644 example/web/nitro-stub.ts create mode 100644 example/web/vite.config.mjs create mode 100644 verify/expected/async-generator.web.otlp.json create mode 100644 verify/expected/batching-shared-queue.web.otlp.json create mode 100644 verify/expected/captured-then.web.otlp.json create mode 100644 verify/expected/collector-down.web.otlp.json create mode 100644 verify/expected/concurrent-interleaved.web.otlp.json create mode 100644 verify/expected/error-in-callback.web.otlp.json create mode 100644 verify/expected/export-headers.web.otlp.json create mode 100644 verify/expected/handoff-basic.web.otlp.json create mode 100644 verify/expected/interval-new-root.web.otlp.json create mode 100644 verify/expected/nest-after-await.web.otlp.json create mode 100644 verify/expected/nest-promise-all-race.web.otlp.json create mode 100644 verify/expected/nest-raf.web.otlp.json create mode 100644 verify/expected/nest-timers-microtasks.web.otlp.json create mode 100644 verify/expected/never-settling-promise.web.otlp.json create mode 100644 verify/expected/odd-attributes.web.otlp.json create mode 100644 verify/expected/rich-span.web.otlp.json create mode 100644 verify/expected/root-no-leak.web.otlp.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56a8edf..18fe7c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -395,8 +395,36 @@ jobs: if-no-files-found: ignore include-hidden-files: true # verify/e2e/.e2e is a dot dir + # The bare example's ScenariosScreen through react-native-web and the web SDK (example/web), headless Chromium. + # The runner builds the Vite app in test mode and serves it (e2e.config.ts `command`). + e2e-web: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.2.19 + - run: bun install --frozen-lockfile + - run: bun install --frozen-lockfile + working-directory: example + - run: bun run prepare # the web app resolves the package through exports -> lib/ (browser condition) + - run: bunx e2e-web install chromium --with-deps + - run: bun verify --e2e e2e + env: + E2E_TARGET: web + - uses: actions/upload-artifact@v4 + if: always() + with: + name: verify-artifacts-e2e-web + path: | + verify/artifacts/ + verify/e2e/.e2e/ + if-no-files-found: ignore + include-hidden-files: true # verify/e2e/.e2e is a dot dir + budget: - needs: [static-fast, fast-swift, e2e-android-bare, e2e-ios-bare, e2e-android-expo, e2e-ios-expo] # every other job; extend when jobs are added + needs: [static-fast, fast-swift, e2e-android-bare, e2e-ios-bare, e2e-android-expo, e2e-ios-expo, e2e-web] # every other job; extend when jobs are added if: always() runs-on: ubuntu-latest timeout-minutes: 5 diff --git a/example/package.json b/example/package.json index 0b92021..09e5bdf 100644 --- a/example/package.json +++ b/example/package.json @@ -7,7 +7,9 @@ "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", - "test": "jest" + "test": "jest", + "web": "vite -c web/vite.config.mjs", + "web:e2e": "vite build -c web/vite.config.mjs && vite preview -c web/vite.config.mjs --port 4173 --strictPort" }, "dependencies": { "react": "19.3.0", diff --git a/example/web/index.html b/example/web/index.html new file mode 100644 index 0000000..2b5b313 --- /dev/null +++ b/example/web/index.html @@ -0,0 +1,12 @@ + + + + + + OpenTelemetry example (web) + + +

+ + + diff --git a/example/web/index.tsx b/example/web/index.tsx new file mode 100644 index 0000000..0dbc777 --- /dev/null +++ b/example/web/index.tsx @@ -0,0 +1,10 @@ +import {AppRegistry} from 'react-native'; +import {startReactNativeSdk} from 'react-native-open-telemetry'; +import {ScenariosScreen} from '../src/ScenariosScreen'; + +// Web init: the first call configures the SDK; ScenariosScreen's later `startReactNativeSdk()` calls get this handle. +// The fake collector (verify/harness/collector.ts) listens on 4318 and answers CORS. +startReactNativeSdk({serviceName: 'verify', exportConfig: {url: 'http://localhost:4318', headers: {'x-api-key': 'test'}}}); + +AppRegistry.registerComponent('main', () => ScenariosScreen); +AppRegistry.runApplication('main', {rootTag: document.getElementById('root')}); diff --git a/example/web/nitro-stub.ts b/example/web/nitro-stub.ts new file mode 100644 index 0000000..612c024 --- /dev/null +++ b/example/web/nitro-stub.ts @@ -0,0 +1,5 @@ +// Web has no Nitro: no HybridObject is registered, so getOtel() is undefined and scenarios get no `native`. +export const NitroModules = { + hasHybridObject: () => false, + createHybridObject: () => undefined, +}; diff --git a/example/web/vite.config.mjs b/example/web/vite.config.mjs new file mode 100644 index 0000000..b63577d --- /dev/null +++ b/example/web/vite.config.mjs @@ -0,0 +1,27 @@ +// Web example (Task 23): the bare example's ScenariosScreen through react-native-web, exporting with the web SDK. +import path from 'node:path'; +import {defineConfig} from 'vite'; +import {withOtel} from '../../vite/index.js'; + +const root = path.resolve(import.meta.dirname, '../..'); + +export default defineConfig( + withOtel({ + root: import.meta.dirname, + // test mode is a build flag (src/internal/testMode.ts); e2e.config.ts builds with OTEL_TEST_MODE=1 + define: {'process.env.OTEL_TEST_MODE': JSON.stringify(process.env.OTEL_TEST_MODE ?? '')}, + esbuild: {jsx: 'automatic'}, + resolve: { + alias: [ + {find: /^react-native$/, replacement: 'react-native-web'}, + // the package as published, like Metro's extraNodeModules: the directory resolves through its `exports` + // (the `browser` condition -> lib/module/index.web.js); build lib/ first with `bun run prepare` + {find: /^react-native-open-telemetry$/, replacement: root}, + {find: /^react-native-open-telemetry\/setup$/, replacement: path.join(root, 'lib/module/setup.js')}, + // no HybridObjects on web: ScenariosScreen's native lookups find none + {find: /^react-native-nitro-modules$/, replacement: path.join(import.meta.dirname, 'nitro-stub.ts')}, + ], + }, + server: {fs: {allow: [root]}}, + }), +); diff --git a/src/internal/testMode.ts b/src/internal/testMode.ts index 48d13ac..27f29bb 100644 --- a/src/internal/testMode.ts +++ b/src/internal/testMode.ts @@ -1,7 +1,14 @@ import type {IdGenerator} from '@opentelemetry/sdk-trace'; -export const isTestModeBuild = (): boolean => - typeof process !== 'undefined' && process.env?.OTEL_TEST_MODE === '1'; +// The plain `process.env.OTEL_TEST_MODE` form is what bundlers inline (Metro's Babel plugin, Vite `define`); a browser +// bundle without the define has no `process`, hence the catch. +export const isTestModeBuild = (): boolean => { + try { + return process.env.OTEL_TEST_MODE === '1'; + } catch { + return false; + } +}; const hex = (prefix: string, n: number, len: number) => prefix + String(n).padStart(len - prefix.length, '0'); diff --git a/verify/VERIFY.md b/verify/VERIFY.md index b5ff8e6..683fec8 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -13,9 +13,12 @@ cd example/android && OTEL_TEST_MODE=1 ./gradlew :app:assembleRelease -PotelTest # iOS cd example/ios && OTEL_TEST_MODE=1 pod install && OTEL_TEST_MODE=1 xcodebuild -workspace OpenTelemetryExample.xcworkspace \ -scheme OpenTelemetryExample -configuration Release -sdk iphonesimulator -derivedDataPath build build -E2E_TARGET=android-bare bun verify --e2e e2e # or ios-bare, android-expo, ios-expo; omit E2E_TARGET for all four +E2E_TARGET=android-bare bun verify --e2e e2e # or ios-bare, android-expo, ios-expo, web; omit E2E_TARGET for all five ``` +Web (`web` target) needs only `lib/` and a Playwright Chromium (`bunx e2e-web install chromium`); the runner builds and +serves `example/web` itself (below). + The Expo app (`example-expo/`, `android-expo` / `ios-expo`) is CNG: `android/` and `ios/` are generated, not committed. ```sh @@ -50,12 +53,17 @@ it (Xcode scheme, `SIMCTL_CHILD_TRACEPARENT`); the verify stages unset it for na except the scenarios with their own e2e file. Each test cold-starts the app (R5). e2e is compare-only; `VERIFY_E2E_DRAFT=1` writes a **missing** `..otlp.json` from the device run and still fails the test ("drafted …, review it"); existing files are never overwritten. Draft runs have no retries, so a drafting run always ends red. -Each target compares to its platform's files (`android-*` → `android`, `ios-*` → `ios`): the bare app inits native +Each target compares to its platform's files (`android-*` → `android`, `ios-*` → `ios`, `web` → `web`): the bare app inits native first (`RNOtel.start` in `MainApplication` / `AppDelegate`), the Expo app inits from JS (below), and ScenariosScreen exports through `startReactNativeSdk` and the Kotlin or Swift core. One set of files for both apps is the proof that the two init paths are equivalent. A scenario that only one app can run names targets (`android-bare`) instead of platforms in `targets`. +**Fixtures by target kind (Task 23).** `harness.ts` has two chains: `test` (device targets: its auto `installed` +fixture and `target` name `device`, so every `test(…)` passes `{platforms: MOBILE}`) and `webTest` (a fresh browser +context per test; `target` is the platform, `web`). `anyTarget(title, body)` registers one body on both; e2e titles must +be unique, so the web copy is `web › `. + **TestNative (R25, Task 26).** `cross-*` scenarios call `ctx.native`, the example-only Nitro HybridObject in `example/modules/test-native/` (own `nitro.json`, podspec, `build.gradle`; autolinked through `example/react-native.config.js`). It uses only the public `RNOtel` helpers. After editing its spec, regenerate with @@ -107,6 +115,38 @@ unproven until their first CI run. - **Not on Expo:** `native-init-failure` (`targets: ['android-bare', 'ios-bare']`): the bad URL goes to the bare app's native init, and the Expo app has none. `fast-refresh-idempotent` is local-only on the bare dev builds. +## Web (Task 23) + +`example/web/` is a Vite 7 app (`vite.config.mjs`, wrapped in the package's `withOtel`) that renders the bare +example's `ScenariosScreen` through react-native-web 0.21.4 (react-dom 19.3.0). `index.tsx` inits first with +`startReactNativeSdk({serviceName: 'verify', exportConfig: {url: 'http://localhost:4318', headers: {'x-api-key': +'test'}}})`, so every scenario runs through the **web SDK** (own `TracerProvider`, `BatchSpanProcessor`, OTLP/proto +exporter, R7), not a harness provider. Resolution: `react-native` → `react-native-web`; `react-native-open-telemetry` +→ the repo root directory, which Vite resolves through its `exports` (`browser` → `lib/module/index.web.js`); +`/setup` → `lib/module/setup.js`; `react-native-nitro-modules` → `nitro-stub.ts` (no HybridObjects: no native +`testMode` line, scenarios get no `native`). + +- **Test mode:** `isTestModeBuild()` reads plain `process.env.OTEL_TEST_MODE` inside a `try` (a browser has no + `process`). That one form is what Metro's Babel plugin (`example/inlineTestMode.js`), Vite's + `define: {'process.env.OTEL_TEST_MODE': …}` and Jest's real `process` all see. The e2e config builds with + `OTEL_TEST_MODE=1`. +- **Runner:** the `web` target (`web({browser: 'chromium'})`) starts `bun run web:e2e` in `example/` + (`vite build` + `vite preview` on `localhost:4173`); its log is `verify/e2e/.e2e/logs/web.log`. `app.restart()` + opens a new page, the cold start (R5). The collector answers CORS (`OPTIONS` 204, `allow-headers: *`). +- **Probe:** the bundle has no native `async`/`for await` (lowered by `withOtel`); no `com.callstack.context.degraded` + scope attribute in any web file. +- **Files:** every `*.web.otlp.json` is byte-identical to the scenario's `.js` file (`collector-down`, which has no + `.js`, equals its `.android` file). The proto exporter and the web resource (`service.name` only in test mode) + change nothing visible. +- **collector-down:** the OTel JS exporter retries a 503 inside the export (backoff 1 s ×1.5, ±20 %), so the first + `flush` resolves after the three refusals (~4.7 s; up to 5.7 s): the web flush timeout is 10 s. +- **nest-timers-microtasks:** browsers have no `setImmediate`; there the `immediate` step is one more `setTimeout(0)`, + so all runners keep one shape. +- **Not on web:** `cross-*` (TestNative is native), `native-init-failure` (bare native init), `flush-after-reload` + (the native reload; a page reload drops the JS context, a different guarantee), `background-flush` (app + background; the browser `pagehide` flush is not covered), `event-emitter-listener` (its lazy `require('react-native')` + has no `require` in a Vite ESM bundle), `fast-refresh-idempotent`, `native test mode reaches initialize`. + ## Failure scenarios (Task 27) Each has its own e2e file (R10); the ScenariosScreen does not `forceFlush()` after `collector-down`, @@ -217,10 +257,10 @@ e2e targets are android, ios and web unless the Runners column names them. | `handoff-basic` | a span crosses the seam intact | 8, 15, 18 | jest, e2e | passing | | `rich-span` | every attribute type, events, links, status, scope survive the seam | 8, 15, 18 | jest, e2e | passing | | `odd-attributes` | NaN, ±Infinity, -0, big ints, empty arrays survive the seam | 8, 15, 18 | jest, e2e | passing | -| `export-headers` | configured export headers are sent on every request | 16, 19, 24, 25 | jest, e2e (android, ios; web with 23) | passing | +| `export-headers` | configured export headers are sent on every request | 16, 19, 23, 24, 25 | jest, e2e | passing | | `cross-js-to-native` | a native span started from JS is a child of the JS span | 26 | e2e (android, ios) | passing | | `cross-native-to-js` | a JS span started under a native span's context is its child | 26 | e2e (android, ios) | passing | -| `collector-down` | app never blocks; spans arrive exactly once when the collector is back | 27 | e2e (android, ios; web with 23) | passing | +| `collector-down` | app never blocks; spans arrive exactly once when the collector is back | 23, 27 | e2e | passing | | `native-init-failure` | one error log, no-op SDK, nothing exported | 27 | e2e (android-bare, ios-bare) | passing | | `flush-after-reload` | `forceFlush()` resolves across a JS reload; spans arrive once | 27 | e2e (android, ios) | passing | | `background-flush` | spans are exported on background without `forceFlush()` | 27 | e2e (android, ios) | passing | diff --git a/verify/e2e/background-flush.e2e.ts b/verify/e2e/background-flush.e2e.ts index aaa52fa..6e0809e 100644 --- a/verify/e2e/background-flush.e2e.ts +++ b/verify/e2e/background-flush.e2e.ts @@ -1,10 +1,10 @@ import {execFileSync} from 'node:child_process'; import {expect} from 'e2e'; -import {bundleIdOf, clearDeviceLog, expectScenario, platformOf, tapFlush, test, until} from './harness'; +import {bundleIdOf, clearDeviceLog, expectScenario, MOBILE, platformOf, tapFlush, test, until} from './harness'; // Spans handed off right before the app goes to background are exported without forceFlush() (§9.4). Test mode has // no timed export (scheduleDelay 120 s), so within the wait only the background hook can have sent them. -test('background-flush', async ({app, screen, collector, device, target}) => { +test('background-flush', {platforms: MOBILE}, async ({app, screen, collector, device, target}) => { const {deviceId} = device.unstable_raw; const android = platformOf(target) === 'android'; await expectScenario('background-flush', target, {app, screen, collector}, { diff --git a/verify/e2e/collector-down.e2e.ts b/verify/e2e/collector-down.e2e.ts index 8d524f3..b43e07a 100644 --- a/verify/e2e/collector-down.e2e.ts +++ b/verify/e2e/collector-down.e2e.ts @@ -1,14 +1,17 @@ -import {expectScenario, tapFlush, test} from './harness'; +import {anyTarget, expectScenario, platformOf, tapFlush} from './harness'; // Collector down (§9.4): the app does not block, and the span arrives exactly once when the collector is back. // Android: otel-java retries a 503 inside the export. iOS: opentelemetry-swift does not retry; it requeues the failed // batch in memory and resends it on the next export or flush (X6), so the test flushes until the refusals are used up. -test('collector-down', async ({app, screen, collector, target}) => { +// Web: the OTel JS exporter retries a 503 inside the export (backoff 1 s x1.5, ±20 %): three refusals take up to 5.7 s. +anyTarget('collector-down', async ({app, screen, collector, target}) => { await expectScenario('collector-down', target, {app, screen, collector}, { afterBegin: () => collector.refuse(503, 3), // after begin, which clears refusals (F15) afterDone: async () => { - // the app never waits on the collector: each forceFlush resolves within the native flush timeout (5 s) - for (let n = 1; n <= 3; n++) await tapFlush(screen, n, 6_000); + // the app never waits on the collector: each forceFlush resolves within the native flush timeout (5 s), + // on web once the exporter's own retries are done + const timeout = platformOf(target) === 'web' ? 10_000 : 6_000; + for (let n = 1; n <= 3; n++) await tapFlush(screen, n, timeout); await new Promise(r => setTimeout(r, 1_000)); // a late duplicate (iOS requeue) would now count against "once" }, }); diff --git a/verify/e2e/e2e.config.ts b/verify/e2e/e2e.config.ts index d26b2ea..1178ca1 100644 --- a/verify/e2e/e2e.config.ts +++ b/verify/e2e/e2e.config.ts @@ -1,5 +1,6 @@ import type {E2EConfig} from 'e2e'; import {mobile} from '@e2e-dev/mobile'; +import {web} from '@e2e-dev/web'; const bundleId = 'opentelemetry.example'; const example = '../../example'; @@ -48,6 +49,23 @@ export default { appPath: process.env.E2E_IOS_EXPO_APP ?? `${expo}/ios/build/Build/Products/Release-iphonesimulator/OpenTelemetryExpo.app`, }, }, + // The bare example's ScenariosScreen through react-native-web, exporting with the web SDK (example/web, Task 23). + // The runner builds it in test mode (lib/ first: `bun run prepare`) and serves it with `vite preview`. + { + name: 'web', + engine: web({browser: 'chromium'}), + app: { + url: 'http://localhost:4173', + command: { + executable: 'bun', + args: ['run', 'web:e2e'], + cwd: example, + env: {OTEL_TEST_MODE: '1'}, + log: '.e2e/logs/web.log', + startupTimeout: 120_000, + }, + }, + }, // Dev builds (Debug + Metro), local only: fast-refresh-idempotent (Task 27). See VERIFY.md. ...(process.env.E2E_DEV === '1' ? [ diff --git a/verify/e2e/export-headers.e2e.ts b/verify/e2e/export-headers.e2e.ts index 5759bb7..a7f1255 100644 --- a/verify/e2e/export-headers.e2e.ts +++ b/verify/e2e/export-headers.e2e.ts @@ -1,10 +1,10 @@ import fs from 'node:fs'; import path from 'node:path'; import {expect} from 'e2e'; -import {expectScenario, test} from './harness'; +import {anyTarget, expectScenario} from './harness'; // R11: the app's init headers (x-api-key: test) reach the collector on every export request. -test('export-headers', async ({app, screen, collector, target}) => { +anyTarget('export-headers', async ({app, screen, collector, target}) => { await expectScenario('export-headers', target, {app, screen, collector}); const raw = path.join(import.meta.dirname, '..', 'artifacts', 'raw', `export-headers.${target.split('-')[0]}`); const files = fs.readdirSync(raw).filter(f => f.endsWith('.headers.json')); diff --git a/verify/e2e/fast-refresh-idempotent.e2e.ts b/verify/e2e/fast-refresh-idempotent.e2e.ts index 4f4f8e5..6ab19ae 100644 --- a/verify/e2e/fast-refresh-idempotent.e2e.ts +++ b/verify/e2e/fast-refresh-idempotent.e2e.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; import {expect} from 'e2e'; -import {expectScenario, test} from './harness'; +import {expectScenario, MOBILE, test} from './harness'; // The module withOtel runs before the app: it installs the patch on every evaluation. const SETUP = path.join(import.meta.dirname, '..', '..', 'lib', 'module', 'setup.js'); @@ -9,7 +9,7 @@ const SETUP = path.join(import.meta.dirname, '..', '..', 'lib', 'module', 'setup // Fast refresh does not stack the context patch (§6.1.3, §9.4). Dev builds + Metro only (E2E_DEV=1, `*-dev` targets). // Each edit of setup.js makes Metro hot-update it, so it re-evaluates and runs installContextPatch again; the edit // counts re-evaluations in `__otelRefreshes`. `patch-identity` compares `then`/`setTimeout` with their first values. -test('fast-refresh-idempotent', async ({app, screen, collector, target}) => { +test('fast-refresh-idempotent', {platforms: MOBILE}, async ({app, screen, collector, target}) => { test.skip(!target.endsWith('-dev'), 'needs a dev build and Metro (E2E_DEV=1)'); const original = fs.readFileSync(SETUP, 'utf8'); try { diff --git a/verify/e2e/flush-after-reload.e2e.ts b/verify/e2e/flush-after-reload.e2e.ts index 032f6c8..819937c 100644 --- a/verify/e2e/flush-after-reload.e2e.ts +++ b/verify/e2e/flush-after-reload.e2e.ts @@ -1,10 +1,10 @@ import {expect} from 'e2e'; -import {expectScenario, tapFlush, test} from './harness'; +import {expectScenario, MOBILE, tapFlush, test} from './harness'; // forceFlush() across a JS reload (§9.4): the span handed off before the reload is still queued in native (JS keeps // no buffer); after the reload a new JS SDK attaches and its forceFlush() resolves within 5 s and sends it exactly once. // Test mode has no timed export (scheduleDelay 120 s), so only that flush can have sent it. -test('flush-after-reload', async ({app, screen, collector, target}) => { +test('flush-after-reload', {platforms: MOBILE}, async ({app, screen, collector, target}) => { await expectScenario('flush-after-reload', target, {app, screen, collector}, { afterDone: async () => { await screen.getByTestId('reload').tap(); // native reload (TestNative), test-mode builds only diff --git a/verify/e2e/harness.ts b/verify/e2e/harness.ts index bc557a1..8783bb1 100644 --- a/verify/e2e/harness.ts +++ b/verify/e2e/harness.ts @@ -1,7 +1,8 @@ import {execFileSync, spawn} from 'node:child_process'; import path from 'node:path'; -import {test as base} from '@e2e-dev/mobile'; -import {expect, type App, type Screen} from 'e2e'; +import {test as mobileBase} from '@e2e-dev/mobile'; +import {test as webBase} from '@e2e-dev/web'; +import {describe, expect, type App, type Screen} from 'e2e'; import type {Target} from '../harness/scenario'; // Device runs compare to the reviewed expected files of their platform (native-first); never rewrite them. @@ -28,18 +29,33 @@ export const COLLECTOR_PORT = 4318; /** Must match e2e.config.ts: the bare example, or the Expo app (`*-expo`). */ export const bundleIdOf = (targetName: string) => (targetName.endsWith('-expo') ? 'opentelemetry.example.expo' : 'opentelemetry.example'); -/** `android-bare` -> `android`. */ -export const platformOf = (targetName: string) => targetName.split('-')[0] as 'android' | 'ios'; +/** `android-bare` -> `android`; `web` stays `web`. */ +export const platformOf = (targetName: string) => targetName.split('-')[0] as 'android' | 'ios' | 'web'; -export const test = base.extend<{target: string}, {collector: Collector; installed: void}>({ - collector: [ - async ({}, use) => { - const c = await startCollector({port: COLLECTOR_PORT, artifactsDir: path.join(verifyDir, 'artifacts')}); - await use(c); - await c.close(); - }, - {scope: 'worker'}, - ], +/** Platforms of the targets `test` runs on; a test on web goes through `webTest` or `anyTarget`. */ +export const MOBILE = ['android', 'ios']; + +// One collector per worker. Each chain below declares it; a target runs only one chain's tests (`platforms`). +const collector = [ + async ({}, use: (c: Collector) => Promise<void>) => { + const c = await startCollector({port: COLLECTOR_PORT, artifactsDir: path.join(verifyDir, 'artifacts')}); + await use(c); + await c.close(); + }, + {scope: 'worker'}, +] as const; + +/** Web targets (`web`): a fresh browser context per test; `platform` is the target name. */ +export const webTest = webBase.extend<{target: string}, {collector: Collector}>({ + collector, + target: async ({platform}, use) => { + await use(platform); + }, +}); + +/** Device targets: installs the app once per worker. Pass `{platforms: MOBILE}`: its fixtures name `device`. */ +export const test = mobileBase.extend<{target: string}, {collector: Collector; installed: void}>({ + collector, installed: [ async ({device}, use) => { const {app} = await device.installApp(); @@ -60,6 +76,16 @@ export const test = base.extend<{target: string}, {collector: Collector; install }, }); +type Fixtures = {app: App; screen: Screen; collector: Collector; target: string}; + +/** Registers `body` on device targets (`test`, title as is) and on web (`webTest`, as `web › <title>`: titles are unique). */ +export function anyTarget(title: string, body: (f: Fixtures) => Promise<void>) { + test(title, {platforms: MOBILE}, async ({app, screen, collector, target}) => body({app, screen, collector, target})); + describe('web', {platforms: ['web']}, () => + webTest(title, async ({app, screen, collector, target}) => body({app, screen, collector, target})), + ); +} + /** Steps the failure scenarios (Task 27) add around the tap-and-compare. */ export type ScenarioSteps = { /** Replaces the cold start, e.g. to relaunch with launch arguments. */ diff --git a/verify/e2e/native-init-failure.e2e.ts b/verify/e2e/native-init-failure.e2e.ts index 5847022..a6b3626 100644 --- a/verify/e2e/native-init-failure.e2e.ts +++ b/verify/e2e/native-init-failure.e2e.ts @@ -1,6 +1,6 @@ import {execFileSync} from 'node:child_process'; import {expect} from 'e2e'; -import {ANDROID_EXPORT_URL_FILE, clearDeviceLog, deviceLog, expectScenario, platformOf, test, until} from './harness'; +import {ANDROID_EXPORT_URL_FILE, clearDeviceLog, deviceLog, expectScenario, MOBILE, platformOf, test, until} from './harness'; const BAD_URL = 'not a url'; // Android: Application.onCreate cannot see launch arguments, so the example reads this file instead (test mode only). @@ -11,8 +11,8 @@ const ANDROID_FILE = ANDROID_EXPORT_URL_FILE; // Native init failure (§4.4, §9.4): the example's native-first init gets an invalid export URL. The SDK reports it // exactly once, the app keeps running on a no-op SDK, the no-op forceFlush() resolves (scenario-done), and nothing // is exported (the expected file is empty). -test('native-init-failure', async ({app, screen, collector, device, target}) => { - const platform = platformOf(target); +test('native-init-failure', {platforms: MOBILE}, async ({app, screen, collector, device, target}) => { + const platform = platformOf(target) as 'android' | 'ios'; // MOBILE only const {deviceId} = device.unstable_raw; const shell = (cmd: string) => execFileSync('adb', ['-s', deviceId, 'shell', cmd]); try { diff --git a/verify/e2e/native-test-mode.e2e.ts b/verify/e2e/native-test-mode.e2e.ts index 8cd89d6..41592fa 100644 --- a/verify/e2e/native-test-mode.e2e.ts +++ b/verify/e2e/native-test-mode.e2e.ts @@ -1,7 +1,7 @@ import {expect} from 'e2e'; -import {test} from './harness'; +import {MOBILE, test} from './harness'; -test('native test mode reaches initialize', async ({app, screen}) => { +test('native test mode reaches initialize', {platforms: MOBILE}, async ({app, screen}) => { await app.open(); await expect(screen.getByTestId('native-test-mode')).toHaveText('native testMode=true'); }); diff --git a/verify/e2e/scenarios.e2e.ts b/verify/e2e/scenarios.e2e.ts index 269ef05..9811f1d 100644 --- a/verify/e2e/scenarios.e2e.ts +++ b/verify/e2e/scenarios.e2e.ts @@ -1,4 +1,4 @@ -import {allScenarios, expectScenario, test} from './harness'; +import {allScenarios, anyTarget, expectScenario} from './harness'; /** Scenarios with their own e2e file (they need more than tap-and-compare). */ const OWN_FILE = new Set([ @@ -14,7 +14,7 @@ const OWN_FILE = new Set([ // expectScenario skips targets a scenario does not list for (const s of allScenarios().filter(s => s.runners.includes('e2e') && !s.pending && !OWN_FILE.has(s.name))) { - test(s.name, async ({app, screen, collector, target}) => { + anyTarget(s.name, async ({app, screen, collector, target}) => { await expectScenario(s.name, target, {app, screen, collector}); }); } diff --git a/verify/expected/async-generator.web.otlp.json b/verify/expected/async-generator.web.otlp.json new file mode 100644 index 0000000..cbf84fd --- /dev/null +++ b/verify/expected/async-generator.web.otlp.json @@ -0,0 +1,79 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000060000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "gen.0", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "loop.0", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "gen.1", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "parentSpanId": "0a00000000000001", + "name": "loop.1", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/batching-shared-queue.web.otlp.json b/verify/expected/batching-shared-queue.web.otlp.json new file mode 100644 index 0000000..0b41dc0 --- /dev/null +++ b/verify/expected/batching-shared-queue.web.otlp.json @@ -0,0 +1,67 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "h1", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000001000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000002", + "name": "h2", + "kind": 1, + "startTimeUnixNano": "1767225600000002000", + "endTimeUnixNano": "1767225600000003000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "h1.work", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "h2.work", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/captured-then.web.otlp.json b/verify/expected/captured-then.web.otlp.json new file mode 100644 index 0000000..b57eb7e --- /dev/null +++ b/verify/expected/captured-then.web.otlp.json @@ -0,0 +1,56 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000030000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "kept", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "name": "lost", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/collector-down.web.otlp.json b/verify/expected/collector-down.web.otlp.json new file mode 100644 index 0000000..367c32e --- /dev/null +++ b/verify/expected/collector-down.web.otlp.json @@ -0,0 +1,35 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "work", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000010000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/concurrent-interleaved.web.otlp.json b/verify/expected/concurrent-interleaved.web.otlp.json new file mode 100644 index 0000000..3428488 --- /dev/null +++ b/verify/expected/concurrent-interleaved.web.otlp.json @@ -0,0 +1,99 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "a", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000030000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000002", + "name": "b", + "kind": 1, + "startTimeUnixNano": "1767225600000001000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "a.1", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000002", + "name": "b.1", + "kind": 1, + "startTimeUnixNano": "1767225600000011000", + "endTimeUnixNano": "1767225600000012000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "parentSpanId": "0a00000000000001", + "name": "a.2", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000006", + "parentSpanId": "0a00000000000002", + "name": "b.2", + "kind": 1, + "startTimeUnixNano": "1767225600000021000", + "endTimeUnixNano": "1767225600000022000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000007", + "name": "after.all", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/error-in-callback.web.otlp.json b/verify/expected/error-in-callback.web.otlp.json new file mode 100644 index 0000000..22eccaa --- /dev/null +++ b/verify/expected/error-in-callback.web.otlp.json @@ -0,0 +1,67 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000040000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "throws", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "name": "root.next", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "caught", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/export-headers.web.otlp.json b/verify/expected/export-headers.web.otlp.json new file mode 100644 index 0000000..09465b2 --- /dev/null +++ b/verify/expected/export-headers.web.otlp.json @@ -0,0 +1,35 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "headers", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000010000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/handoff-basic.web.otlp.json b/verify/expected/handoff-basic.web.otlp.json new file mode 100644 index 0000000..6876639 --- /dev/null +++ b/verify/expected/handoff-basic.web.otlp.json @@ -0,0 +1,43 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000100000", + "attributes": [ + { + "key": "app.step", + "value": { + "stringValue": "one" + } + } + ], + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/interval-new-root.web.otlp.json b/verify/expected/interval-new-root.web.otlp.json new file mode 100644 index 0000000..3923a1e --- /dev/null +++ b/verify/expected/interval-new-root.web.otlp.json @@ -0,0 +1,66 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "tap", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000400000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000002", + "name": "tick", + "kind": 1, + "startTimeUnixNano": "1767225600000100000", + "endTimeUnixNano": "1767225600000101000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000003", + "name": "tick", + "kind": 1, + "startTimeUnixNano": "1767225600000200000", + "endTimeUnixNano": "1767225600000201000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "load", + "kind": 1, + "startTimeUnixNano": "1767225600000300000", + "endTimeUnixNano": "1767225600000301000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/nest-after-await.web.otlp.json b/verify/expected/nest-after-await.web.otlp.json new file mode 100644 index 0000000..611ade2 --- /dev/null +++ b/verify/expected/nest-after-await.web.otlp.json @@ -0,0 +1,46 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000030000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "child", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000020000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/nest-promise-all-race.web.otlp.json b/verify/expected/nest-promise-all-race.web.otlp.json new file mode 100644 index 0000000..57ceef3 --- /dev/null +++ b/verify/expected/nest-promise-all-race.web.otlp.json @@ -0,0 +1,90 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000060000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "all.a", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "all.b", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "race.a", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "parentSpanId": "0a00000000000001", + "name": "race.b", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000006", + "parentSpanId": "0a00000000000001", + "name": "after", + "kind": 1, + "startTimeUnixNano": "1767225600000050000", + "endTimeUnixNano": "1767225600000051000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/nest-raf.web.otlp.json b/verify/expected/nest-raf.web.otlp.json new file mode 100644 index 0000000..947dddf --- /dev/null +++ b/verify/expected/nest-raf.web.otlp.json @@ -0,0 +1,46 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000020000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "frame", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/nest-timers-microtasks.web.otlp.json b/verify/expected/nest-timers-microtasks.web.otlp.json new file mode 100644 index 0000000..c730379 --- /dev/null +++ b/verify/expected/nest-timers-microtasks.web.otlp.json @@ -0,0 +1,90 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "root", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000050000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "timeout", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000003", + "parentSpanId": "0a00000000000001", + "name": "immediate", + "kind": 1, + "startTimeUnixNano": "1767225600000020000", + "endTimeUnixNano": "1767225600000021000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000004", + "parentSpanId": "0a00000000000001", + "name": "microtask", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000005", + "parentSpanId": "0a00000000000001", + "name": "timeout.microtask", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000006", + "parentSpanId": "0a00000000000001", + "name": "after.end", + "kind": 1, + "startTimeUnixNano": "1767225600000060000", + "endTimeUnixNano": "1767225600000061000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/never-settling-promise.web.otlp.json b/verify/expected/never-settling-promise.web.otlp.json new file mode 100644 index 0000000..a71e213 --- /dev/null +++ b/verify/expected/never-settling-promise.web.otlp.json @@ -0,0 +1,66 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "parent", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000020000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "child", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "name": "later.await", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000004", + "name": "later.timeout", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/odd-attributes.web.otlp.json b/verify/expected/odd-attributes.web.otlp.json new file mode 100644 index 0000000..b82c28d --- /dev/null +++ b/verify/expected/odd-attributes.web.otlp.json @@ -0,0 +1,67 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "odd", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000010000", + "attributes": [ + { + "key": "big", + "value": { + "intValue": "9007199254740994" + } + }, + { + "key": "empty", + "value": { + "arrayValue": {} + } + }, + { + "key": "inf", + "value": { + "doubleValue": "Infinity" + } + }, + { + "key": "nan", + "value": { + "doubleValue": "NaN" + } + }, + { + "key": "negZero", + "value": { + "intValue": "0" + } + } + ], + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/expected/rich-span.web.otlp.json b/verify/expected/rich-span.web.otlp.json new file mode 100644 index 0000000..7f3f8c4 --- /dev/null +++ b/verify/expected/rich-span.web.otlp.json @@ -0,0 +1,191 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify.rich", + "version": "1.2.3", + "attributes": [ + { + "key": "scope.key", + "value": { + "stringValue": "scope-value" + } + } + ] + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "rich", + "kind": 3, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000100000", + "attributes": [ + { + "key": "bool", + "value": { + "boolValue": true + } + }, + { + "key": "bools", + "value": { + "arrayValue": { + "values": [ + { + "boolValue": true + }, + { + "boolValue": false + } + ] + } + } + }, + { + "key": "double", + "value": { + "doubleValue": 1.5 + } + }, + { + "key": "doubles", + "value": { + "arrayValue": { + "values": [ + { + "doubleValue": 1.5 + }, + { + "doubleValue": 2.5 + } + ] + } + } + }, + { + "key": "int", + "value": { + "intValue": "42" + } + }, + { + "key": "ints", + "value": { + "arrayValue": { + "values": [ + { + "intValue": "1" + }, + { + "intValue": "2" + }, + { + "intValue": "3" + } + ] + } + } + }, + { + "key": "str", + "value": { + "stringValue": "zażółć 🚀" + } + }, + { + "key": "strs", + "value": { + "arrayValue": { + "values": [ + { + "stringValue": "a" + }, + { + "stringValue": "b" + } + ] + } + } + } + ], + "events": [ + { + "timeUnixNano": "1767225600000010000", + "name": "first", + "attributes": [ + { + "key": "event.key", + "value": { + "stringValue": "e1" + } + }, + { + "key": "event.n", + "value": { + "intValue": "1" + } + } + ] + }, + { + "timeUnixNano": "1767225600000020000", + "name": "second", + "attributes": [ + { + "key": "event.ok", + "value": { + "boolValue": true + } + } + ] + } + ], + "links": [ + { + "traceId": "0f111111111111111111111111111111", + "spanId": "0f22222222222222", + "traceState": "k=v", + "attributes": [ + { + "key": "link.key", + "value": { + "stringValue": "link-value" + } + }, + { + "key": "link.n", + "value": { + "intValue": "7" + } + } + ], + "flags": 257 + } + ], + "status": { + "message": "boom", + "code": 2 + }, + "flags": 257 + } + ], + "schemaUrl": "https://opentelemetry.io/schemas/1.40.0" + } + ] + } + ] +} diff --git a/verify/expected/root-no-leak.web.otlp.json b/verify/expected/root-no-leak.web.otlp.json new file mode 100644 index 0000000..b72d020 --- /dev/null +++ b/verify/expected/root-no-leak.web.otlp.json @@ -0,0 +1,76 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "verify" + } + } + ] + }, + "scopeSpans": [ + { + "scope": { + "name": "verify" + }, + "spans": [ + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000001", + "name": "scoped", + "kind": 1, + "startTimeUnixNano": "1767225600000000000", + "endTimeUnixNano": "1767225600000020000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000001", + "spanId": "0a00000000000002", + "parentSpanId": "0a00000000000001", + "name": "scoped.child", + "kind": 1, + "startTimeUnixNano": "1767225600000010000", + "endTimeUnixNano": "1767225600000011000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000002", + "spanId": "0a00000000000003", + "name": "after.sync", + "kind": 1, + "startTimeUnixNano": "1767225600000030000", + "endTimeUnixNano": "1767225600000031000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000003", + "spanId": "0a00000000000004", + "name": "after.await", + "kind": 1, + "startTimeUnixNano": "1767225600000040000", + "endTimeUnixNano": "1767225600000041000", + "status": {}, + "flags": 257 + }, + { + "traceId": "0a000000000000000000000000000004", + "spanId": "0a00000000000005", + "name": "after.timeout", + "kind": 1, + "startTimeUnixNano": "1767225600000050000", + "endTimeUnixNano": "1767225600000051000", + "status": {}, + "flags": 257 + } + ] + } + ] + } + ] +} diff --git a/verify/scenarios/event-emitter-listener.ts b/verify/scenarios/event-emitter-listener.ts index 7eedaaf..9182874 100644 --- a/verify/scenarios/event-emitter-listener.ts +++ b/verify/scenarios/event-emitter-listener.ts @@ -18,6 +18,6 @@ export default scenario( sub.remove(); } }, - // web: DeviceEventEmitter on react-native-web not confirmed + // web: react-native-web has DeviceEventEmitter, but this lazy require() has no require in a Vite ESM bundle {runners: ['e2e'], targets: ['android', 'ios']} ); diff --git a/verify/scenarios/export-headers.ts b/verify/scenarios/export-headers.ts index 984586e..bbe5fb0 100644 --- a/verify/scenarios/export-headers.ts +++ b/verify/scenarios/export-headers.ts @@ -9,5 +9,5 @@ export default scenario( async ({tracer, at}) => { tracer.startSpan('headers', {startTime: at(0)}).end(at(10)); }, - {targets: ['android', 'ios']}, // Task 23 adds web once its app's init sends the header + {targets: ['android', 'ios', 'web']}, // every example app's init sends x-api-key: test ); diff --git a/verify/scenarios/nest-timers-microtasks.ts b/verify/scenarios/nest-timers-microtasks.ts index 1449050..977f4fc 100644 --- a/verify/scenarios/nest-timers-microtasks.ts +++ b/verify/scenarios/nest-timers-microtasks.ts @@ -16,7 +16,8 @@ export default scenario( }), ); await inCallback(cb => setTimeout(cb, 0), 'timeout', 10); - await inCallback(cb => setImmediate(cb), 'immediate', 20); + // browsers have no setImmediate: there the step is one more setTimeout, so every runner keeps one shape + await inCallback(cb => (typeof setImmediate === 'function' ? setImmediate(cb) : setTimeout(cb, 0)), 'immediate', 20); await inCallback(cb => queueMicrotask(cb), 'microtask', 30); // scheduled from inside a callback: the context is carried twice await inCallback(cb => setTimeout(() => queueMicrotask(cb), 0), 'timeout.microtask', 40); From 8dd8fa2c43fd61b11357106a86e456acd858a2d9 Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 06:22:45 +0100 Subject: [PATCH 53/76] chore(example): call vite by path from the web scripts; VERIFY.md notes web flush latency Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- example/package.json | 4 ++-- verify/VERIFY.md | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/example/package.json b/example/package.json index 09e5bdf..db6be6f 100644 --- a/example/package.json +++ b/example/package.json @@ -8,8 +8,8 @@ "lint": "eslint .", "start": "react-native start", "test": "jest", - "web": "vite -c web/vite.config.mjs", - "web:e2e": "vite build -c web/vite.config.mjs && vite preview -c web/vite.config.mjs --port 4173 --strictPort" + "web": "../node_modules/.bin/vite -c web/vite.config.mjs", + "web:e2e": "../node_modules/.bin/vite build -c web/vite.config.mjs && ../node_modules/.bin/vite preview -c web/vite.config.mjs --port 4173 --strictPort" }, "dependencies": { "react": "19.3.0", diff --git a/verify/VERIFY.md b/verify/VERIFY.md index 683fec8..4b354c1 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -51,6 +51,8 @@ it (Xcode scheme, `SIMCTL_CHILD_TRACEPARENT`); the verify stages unset it for na `verify/e2e/scenarios.e2e.ts` runs one test per scenario with runner `e2e`, not `pending`, on each target it lists, except the scenarios with their own e2e file. Each test cold-starts the app (R5). e2e is compare-only; +On web, `forceFlush` latency follows the OTLP exporter's own retries (about 10 s worst case), not a native flush timeout; `collector-down` allows 10 s there. + `VERIFY_E2E_DRAFT=1` writes a **missing** `<name>.<platform>.otlp.json` from the device run and still fails the test ("drafted …, review it"); existing files are never overwritten. Draft runs have no retries, so a drafting run always ends red. Each target compares to its platform's files (`android-*` → `android`, `ios-*` → `ios`, `web` → `web`): the bare app inits native From b2802d51300f8062d49bfee99f5ffb3558b7e49c Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 06:40:52 +0100 Subject: [PATCH 54/76] fix(example): rebundle the Android release when lib/, src/, verify/ or OTEL_TEST_MODE change The bundle task's inputs cover example/ only, so a change to the package, the scenarios or the test-mode flag left the previous bundle in the APK. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- example/android/app/build.gradle | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 39400ed..82171b5 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -109,6 +109,13 @@ android { } } +// The bundle task's inputs are example/ only. It also bundles the package (lib/, src/) and the verify scenarios, and +// babel.config.js inlines OTEL_TEST_MODE: without these, a change there or a test-mode switch reuses the old bundle. +tasks.matching { it.name.startsWith("createBundle") }.configureEach { + inputs.property("otelTestMode", System.getenv("OTEL_TEST_MODE") ?: "") + inputs.files(fileTree("../../..") { include "lib/**", "src/**", "verify/scenarios/**", "verify/harness/*.ts" }) +} + dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android") From 827ad247ef380350cc0e64a407fbe14445b11dc6 Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 06:40:53 +0100 Subject: [PATCH 55/76] test: device smoke and performance guardrail Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- .github/workflows/ci.yml | 30 +++++++++- verify/VERIFY.md | 37 ++++++++++++- verify/e2e/perf.e2e.ts | 70 ++++++++++++++++++++++++ verify/e2e/smoke.e2e.ts | 23 ++++++++ verify/expected/smoke-device.shape.json | 7 --- verify/scenarios/perf-budget.ts | 73 ++++++++++++++++++++++++- verify/scenarios/smoke-device.ts | 2 +- verify/stages/e2e.ts | 4 +- 8 files changed, 230 insertions(+), 16 deletions(-) create mode 100644 verify/e2e/perf.e2e.ts create mode 100644 verify/e2e/smoke.e2e.ts delete mode 100644 verify/expected/smoke-device.shape.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18fe7c4..022711b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,8 @@ jobs: if-no-files-found: ignore include-hidden-files: true # verify/e2e/.e2e is a dot dir - # Release builds with the JS bundle embedded (no Metro), test mode on. + # Release builds with the JS bundle embedded (no Metro), test mode on; the bare jobs also build test mode off for + # smoke-device (per PR on bare only, X11 interim; Expo smoke goes to the nightly). perf-budget runs on android-bare. # Every Task 27 failure scenario runs here except fast-refresh-idempotent: it needs dev builds + Metro, so it is # local only (verify/VERIFY.md), no per-PR jobs; a nightly can add it. # Native outputs are cached on native inputs only, so a JS-only change re-bundles but reuses the native build. @@ -111,6 +112,14 @@ jobs: example/node_modules/react-native-nitro-modules/android/build example/node_modules/react-native-nitro-modules/android/.cxx key: android-native-${{ hashFiles('android/**', 'nitrogen/**', 'patches/**', 'example/android/**', 'example/modules/**', 'bun.lock', 'example/bun.lock') }} + # smoke-device (R20, X11): the production pipeline needs a test-mode-off build. Built first, so the test-mode + # build is what the native outputs cache keeps; the switch recompiles only Kotlin and the bundle. + - name: Build release APK (smoke, test mode off) + working-directory: example/android + run: | + ./gradlew :app:assembleRelease -PreactNativeArchitectures=x86_64 || + ./gradlew :app:assembleRelease -PreactNativeArchitectures=x86_64 + cp app/build/outputs/apk/release/app-release.apk "$RUNNER_TEMP/smoke.apk" - name: Build release APK (test mode) working-directory: example/android env: @@ -152,6 +161,7 @@ jobs: script: | adb shell settings put global hide_error_dialogs 1 bun verify --e2e e2e + E2E_SMOKE=1 E2E_ANDROID_APP="$RUNNER_TEMP/smoke.apk" bun verify --e2e e2e - uses: actions/upload-artifact@v4 if: always() # e2e retries once; keep traces of retried and failed attempts with: @@ -189,6 +199,18 @@ jobs: example/ios/Pods example/ios/build/Build key: ios-native-${{ hashFiles('ios/**', 'nitrogen/**', 'ReactNativeOpenTelemetry.podspec', 'ReactNativeOpenTelemetryCore.podspec', 'example/ios/Podfile', 'example/ios/Podfile.lock', 'example/ios/OpenTelemetryExample/**', 'example/ios/OpenTelemetryExample.xcodeproj/**', 'example/modules/**', 'bun.lock', 'example/bun.lock') }} + # smoke-device (R20, X11): a test-mode-off build, first, so the cache keeps the test-mode one; the switch + # recompiles only the core pod, the adapter and the app. + - name: pod install (smoke, test mode off) + working-directory: example/ios + run: pod install + - name: Build release app (smoke, test mode off) + working-directory: example/ios + run: | + xcodebuild -workspace OpenTelemetryExample.xcworkspace -scheme OpenTelemetryExample \ + -configuration Release -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' \ + -derivedDataPath build ARCHS=arm64 build + cp -R build/Build/Products/Release-iphonesimulator/OpenTelemetryExample.app "$RUNNER_TEMP/" - name: pod install (test mode) working-directory: example/ios env: @@ -212,6 +234,12 @@ jobs: E2E_TARGET: ios-bare AGENT_DEVICE_DAEMON_STARTUP_TIMEOUT_MS: '600000' # the first daemon start on a cold runner outlasts the 120 s default run: bun verify --e2e e2e + - name: e2e smoke (ios-bare, test mode off) + env: + E2E_TARGET: ios-bare + E2E_SMOKE: '1' + AGENT_DEVICE_DAEMON_STARTUP_TIMEOUT_MS: '600000' + run: E2E_IOS_APP="$RUNNER_TEMP/OpenTelemetryExample.app" bun verify --e2e e2e - name: Diagnose the simulator log if: failure() run: | diff --git a/verify/VERIFY.md b/verify/VERIFY.md index 4b354c1..19a70fe 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -194,6 +194,37 @@ Each has its own e2e file (R10); the ScenariosScreen does not `forceFlush()` aft If watchman reports recrawls, restart Metro: a dead watch never delivers the edit. +## Smoke and performance (Task 29) + +**`smoke-device`** (`smoke.e2e.ts`, R20): the production pipeline, test mode **off** in native and JS. The test first +checks the build (`native testMode=false`, no test-mode `flush` control, so a stale test-mode bundle fails too), taps +the scenario and asserts the collector got exactly one span, `smoke`. No expected file: real ids, times and the +`telemetry.*` resource. It needs a test-mode-off build; `E2E_SMOKE=1` makes the `e2e` stage run only `smoke.e2e.ts` +(without it the test skips). Both apps share their bundle id, so the smoke build replaces the test-mode one. + +```sh +cd example/android && ./gradlew :app:assembleRelease # no OTEL_TEST_MODE, no -PotelTestMode +cd example/ios && pod install && xcodebuild -workspace OpenTelemetryExample.xcworkspace -scheme OpenTelemetryExample \ + -configuration Release -sdk iphonesimulator -derivedDataPath build build +E2E_SMOKE=1 E2E_TARGET=android-bare bun verify --e2e e2e # or ios-bare; E2E_ANDROID_APP / E2E_IOS_APP pick another build +``` + +CI (X11 interim): per PR on the bare targets only, as a variant inside `e2e-android-bare` / `e2e-ios-bare` (built +before the test-mode build, copied to `$RUNNER_TEMP`, run after the main e2e); Expo smoke is the nightly's (Task 31). +Android rebundles on a test-mode switch: `app/build.gradle` adds `OTEL_TEST_MODE` and the package/verify sources +to the bundle task's inputs (they live outside `example/`, so a change there used to leave the old bundle in place). + +**Untested: API 26–27.** The Android process-name fallback (`/proc/self/cmdline`, for the main-process check below +API 28) has not run on a device: no API 26/27 system image is installed locally, and CI uses API 35. + +**`perf-budget`** (`perf.e2e.ts`, R27): `android-bare` only, by target name. The scenario times (a) 100 warm-up + +1,000 × `startSpan → setAttribute×10 → end()` with `performance.now()` per span, through the real synchronous +hand-off (`end()` alone is reported too), and (b) 10,000 `await null` inside an active span with the patch on, then +off (`Promise.prototype.then` restored from the patch marker, put back in `finally`; no extra build). The numbers +leave as attributes of one `perf-result` span; the test writes `verify/artifacts/perf.json` (numbers, method, device) +and fails only if hand-off p50 ≥ 100 µs or the ratio ≥ 3×. Pixel_9 emulator (API 36, arm64, release test-mode build), +7 runs: p50 27.1–28.2 µs (p95 51–71 µs, `end()` alone p50 14–14.7 µs), ratio 1.57–2.28. + ## Android cold start with `RNOtel.start` (Task 24, 2026-11-24) `adb shell am start -W -n opentelemetry.example/.MainActivity` after `am force-stop`, 6 launches each, Pixel_9 @@ -234,7 +265,7 @@ One file per guarantee in `verify/scenarios/`, named after it, with a hand-writt Shapes use the JS runner's resource, `["service.name"]`. Native test mode builds the resource from config only and the example inits with no `serviceVersion` (R2), so native-first device runs match the same shapes; `telemetry.*` -outside test mode is Task 29's (`smoke-device`). +outside test mode is `smoke-device`'s, which checks span count and names only (no expected file, R20). e2e targets are android, ios and web unless the Runners column names them. @@ -267,8 +298,8 @@ e2e targets are android, ios and web unless the Runners column names them. | `flush-after-reload` | `forceFlush()` resolves across a JS reload; spans arrive once | 27 | e2e (android, ios) | passing | | `background-flush` | spans are exported on background without `forceFlush()` | 27 | e2e (android, ios) | passing | | `fast-refresh-idempotent` | fast refresh does not stack the patch: `then`/`setTimeout` keep their identity across refreshes | 27 | e2e (android-dev, ios-dev; local only) | passing (local only) | -| `smoke-device` | production pipeline (no test mode) exports `smoke` spans | 29 | e2e (android, ios) | pending | -| `perf-budget` | hand-off p50 < 100 µs/span, patch ratio < 3× (`artifacts/perf.json`, no shape) | 29 | e2e (android) | pending | +| `smoke-device` | production pipeline (no test mode) exports `smoke` spans | 29 | e2e (android, ios; test-mode-off build, `E2E_SMOKE=1`) | passing (no expected file: count + names) | +| `perf-budget` | hand-off p50 < 100 µs/span, patch ratio < 3× (`artifacts/perf.json`, no shape) | 29 | e2e (android-bare) | passing | ### Adding a scenario diff --git a/verify/e2e/perf.e2e.ts b/verify/e2e/perf.e2e.ts new file mode 100644 index 0000000..e8c4ed2 --- /dev/null +++ b/verify/e2e/perf.e2e.ts @@ -0,0 +1,70 @@ +import {execFileSync} from 'node:child_process'; +import fs from 'node:fs'; +import path from 'node:path'; +import {expect} from 'e2e'; +import {MOBILE, test} from './harness'; + +const BUDGET = {handoffP50Us: 100, patchRatio: 3}; +const round = (x: number) => Math.round(x * 100) / 100; +const OUT = path.join(import.meta.dirname, '..', 'artifacts', 'perf.json'); + +// Performance guardrail (§9.2, R27): perf-budget sends its numbers as the attributes of one `perf-result` span; +// this test writes them to verify/artifacts/perf.json and fails only on the loose budgets. No shape file, no compare. +// android-bare only, by target name (android-expo runs the same JS through another init path, not another hand-off). +test('perf-budget', {platforms: MOBILE}, async ({app, screen, collector, device, target}) => { + test.skip(target !== 'android-bare', 'perf-budget runs on android-bare only'); + await app.restart(); + collector.begin('perf-budget', 'android'); + let out; + try { + await screen.getByTestId('scenario-perf-budget').tap(); + await expect(screen.getByTestId('scenario-done')).toBeVisible({timeout: 120_000}); + } finally { + out = await collector.end(); + } + const span = (out.resourceSpans ?? []) + .flatMap(r => r.scopeSpans.flatMap((s: any) => s.spans)) + .find(s => s.name === 'perf-result'); + if (!span) throw new Error('no perf-result span arrived'); + const m: Record<string, number> = Object.fromEntries( + span.attributes.map((a: any) => [a.key.replace(/^com\.callstack\.perf\./, ''), Number(a.value.doubleValue ?? a.value.intValue)]), + ); + const n = (k: string) => m[k] ?? NaN; // NaN fails both budgets + const prop = (p: string) => + execFileSync('adb', ['-s', device.unstable_raw.deviceId, 'shell', 'getprop', p], {encoding: 'utf8'}).trim(); + const ratio = n('await.on_ms') / n('await.off_ms'); + const report = { + scenario: 'perf-budget', + target, + measuredAt: new Date().toISOString(), + device: { + model: prop('ro.product.model'), + emulator: prop('ro.kernel.qemu') === '1' || prop('ro.boot.qemu') === '1', + abi: prop('ro.product.cpu.abi'), + androidRelease: prop('ro.build.version.release'), + apiLevel: Number(prop('ro.build.version.sdk')), + }, + handoff: { + what: 'per span: tracer.startSpan -> setAttribute x10 -> end(), through NativeHandOffProcessor.onEnd -> Nitro handOff (synchronous on the JS thread); performance.now() around each span', + spans: n('handoff.spans'), + warmupSpans: n('handoff.warmup'), + p50Us: n('handoff.p50_us'), + p95Us: n('handoff.p95_us'), + endOnlyP50Us: n('handoff.end_p50_us'), // end() alone: onEnd, isSampled, toSeamSpan, handOff + budgetP50Us: BUDGET.handoffP50Us, + }, + patch: { + what: 'N sequential `await null` inside an active span (the wrapped path); off = Promise.prototype.then restored from the patch marker for the leg (R27)', + awaits: n('await.count'), + onMs: round(n('await.on_ms')), + offMs: round(n('await.off_ms')), + ratio: round(ratio), + budgetRatio: BUDGET.patchRatio, + }, + }; + fs.mkdirSync(path.dirname(OUT), {recursive: true}); + fs.writeFileSync(OUT, JSON.stringify(report, null, 2) + '\n'); + console.log(`perf.json: ${JSON.stringify(report)}`); + expect(report.handoff.p50Us).toBeLessThan(BUDGET.handoffP50Us); + expect(report.patch.ratio).toBeLessThan(BUDGET.patchRatio); +}); diff --git a/verify/e2e/smoke.e2e.ts b/verify/e2e/smoke.e2e.ts new file mode 100644 index 0000000..fbc00c6 --- /dev/null +++ b/verify/e2e/smoke.e2e.ts @@ -0,0 +1,23 @@ +import {expect} from 'e2e'; +import {MOBILE, test} from './harness'; + +// Device smoke (§9.4, R20): the production pipeline, test mode off (native and JS), exports the `smoke` span. +// Count and names only: ids, times and the real resource (telemetry.*) are not deterministic, so no expected file. +// Needs a test-mode-off build: E2E_SMOKE=1 runs only this file (verify/stages/e2e.ts); VERIFY.md has the builds. +test('smoke-device', {platforms: MOBILE}, async ({app, screen, collector, target}) => { + test.skip(process.env.E2E_SMOKE !== '1', 'needs a test-mode-off build (E2E_SMOKE=1)'); + await app.restart(); + // a test-mode build (native flag, or a stale bundle with the JS flag inlined) would not prove the production path + await expect(screen.getByTestId('native-test-mode')).toHaveText('native testMode=false', {timeout: 30_000}); + await expect(screen.getByTestId('flush')).not.toBeVisible(); + collector.begin('smoke-device', target); + let out; + try { + await screen.getByTestId('scenario-smoke-device').tap(); + await expect(screen.getByTestId('scenario-done')).toBeVisible({timeout: 30_000}); + } finally { + out = await collector.end(); + } + const names = (out.resourceSpans ?? []).flatMap(r => r.scopeSpans.flatMap((s: any) => s.spans.map((x: any) => x.name))); + expect(names).toEqual(['smoke']); +}); diff --git a/verify/expected/smoke-device.shape.json b/verify/expected/smoke-device.shape.json deleted file mode 100644 index 37de82c..0000000 --- a/verify/expected/smoke-device.shape.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "resource": ["service.name"], - "scope": [], - "traces": [[ - {"name":"smoke","kind":1,"parent":null,"status":0,"links":[],"attributes":{}} - ]] -} diff --git a/verify/scenarios/perf-budget.ts b/verify/scenarios/perf-budget.ts index fbf0957..b37a9aa 100644 --- a/verify/scenarios/perf-budget.ts +++ b/verify/scenarios/perf-budget.ts @@ -1,8 +1,75 @@ +import {context, trace} from '@opentelemetry/api'; import {scenario} from '../harness/scenario'; +const SPANS = 1_000; +const WARMUP = 100; +const AWAITS = 10_000; +const P = 'com.callstack.perf.'; + +const pct = (xs: number[], p: number) => [...xs].sort((a, b) => a - b)[Math.min(xs.length - 1, Math.floor(xs.length * p))]!; +const us = (ms: number) => Math.round(ms * 10_000) / 10; // 0.1 µs + +async function awaits(n: number) { + const t0 = performance.now(); + for (let i = 0; i < n; i++) await null; + return performance.now() - t0; +} + /** * Performance guardrail (§9.2, Task 29), `android-bare` only: (a) 1,000 spans × 10 attributes through the real - * hand-off, p50/p95 µs per span; (b) 10,000 awaits with the patch on vs off. Fails only if hand-off p50 ≥ 100 µs - * or the patch ratio ≥ 3×. Output is `verify/artifacts/perf.json`, not spans: no shape file. + * hand-off, p50/p95 µs per span; (b) 10,000 awaits inside an active span with the patch on vs off (R27: `then` + * restored from the patch marker for the off leg). The numbers leave as the attributes of one `perf-result` span; + * verify/e2e/perf.e2e.ts writes `verify/artifacts/perf.json` and applies the budgets. No shape file. */ -export default scenario('perf-budget', async () => {}, {runners: ['e2e'], targets: ['android'], pending: true}); +export default scenario( + 'perf-budget', + async ({tracer}) => { + const total: number[] = []; + const end: number[] = []; + for (let i = 0; i < WARMUP + SPANS; i++) { + const t0 = performance.now(); + const span = tracer.startSpan('perf'); + for (let a = 0; a < 10; a++) span.setAttribute(`a${a}`, i); + const t1 = performance.now(); + span.end(); + const t2 = performance.now(); + if (i < WARMUP) continue; + total.push(t2 - t0); + end.push(t2 - t1); + } + + const marker = (globalThis as any)[Symbol.for('com.callstack.otel.patched')]; + if (!marker) throw new Error('perf-budget: the context patch is not installed'); + const patched = Promise.prototype.then; + // inside an active span: the wrapped path (at ROOT the patch calls the original `then` directly). Each leg + // enters the span's context itself, since the off leg loses it after its first await. + const span = tracer.startSpan('perf.awaits'); + const inSpan = (n: number) => context.with(trace.setSpan(context.active(), span), () => awaits(n)); + await inSpan(1_000); // warm-up + const onMs = await inSpan(AWAITS); + let offMs = 0; + Promise.prototype.then = marker.then; + try { + offMs = await inSpan(AWAITS); + } finally { + Promise.prototype.then = patched; + } + span.end(); + + tracer + .startSpan('perf-result', { + attributes: { + [`${P}handoff.spans`]: SPANS, + [`${P}handoff.warmup`]: WARMUP, + [`${P}handoff.p50_us`]: us(pct(total, 0.5)), + [`${P}handoff.p95_us`]: us(pct(total, 0.95)), + [`${P}handoff.end_p50_us`]: us(pct(end, 0.5)), + [`${P}await.count`]: AWAITS, + [`${P}await.on_ms`]: onMs, + [`${P}await.off_ms`]: offMs, + }, + }) + .end(); + }, + {runners: ['e2e'], targets: ['android-bare']}, +); diff --git a/verify/scenarios/smoke-device.ts b/verify/scenarios/smoke-device.ts index a3d9925..096deb6 100644 --- a/verify/scenarios/smoke-device.ts +++ b/verify/scenarios/smoke-device.ts @@ -9,5 +9,5 @@ export default scenario( async ({tracer}) => { tracer.startSpan('smoke').end(); }, - {runners: ['e2e'], targets: ['android', 'ios'], pending: true}, + {runners: ['e2e'], targets: ['android', 'ios']}, ); diff --git a/verify/stages/e2e.ts b/verify/stages/e2e.ts index 9fe1fee..60e8668 100644 --- a/verify/stages/e2e.ts +++ b/verify/stages/e2e.ts @@ -7,11 +7,13 @@ const stage: Stage = { run({sh}) { // E2E_TARGET=android-bare|ios-bare|android-expo|ios-expo runs one target (CI runs one per job) const target = process.env.E2E_TARGET ? ['--target', process.env.E2E_TARGET] : []; + // E2E_SMOKE=1: a test-mode-off build is installed, so only smoke.e2e.ts can pass (VERIFY.md) + const files = process.env.E2E_SMOKE === '1' ? ['smoke'] : []; // Device runs compare to the reviewed expected files: never --update them from a device. const update = process.env.VERIFY_UPDATE; delete process.env.VERIFY_UPDATE; try { - sh(['bunx', 'e2e', 'run', '--config', 'verify/e2e/e2e.config.ts', ...target]); + sh(['bunx', 'e2e', 'run', '--config', 'verify/e2e/e2e.config.ts', ...target, ...files]); } finally { if (update !== undefined) process.env.VERIFY_UPDATE = update; } From 46848ee21cfe44de857f517554974a8ae3283751 Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 08:33:57 +0100 Subject: [PATCH 56/76] test: perf-budget gates on alternating-leg medians; smoke runs after a failed e2e - 5 alternating rounds of 20,000 awaits per leg, ratio = median(on)/median(off), every sample in perf.json; gates use unrounded values; perf.json says test-mode build. - example-expo: the config plugin adds the same bundle-task inputs as the bare app. - CI: smoke runs even when the main e2e failed and the step exits with the first non-zero code; paths use ${{ runner.temp }}. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- .github/workflows/ci.yml | 14 +++++--- example-expo/plugins/withOtelExample.js | 16 ++++++++- verify/VERIFY.md | 11 +++--- verify/e2e/perf.e2e.ts | 46 +++++++++++++++++-------- verify/scenarios/perf-budget.ts | 27 +++++++++------ 5 files changed, 78 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 022711b..8517e10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,7 +119,7 @@ jobs: run: | ./gradlew :app:assembleRelease -PreactNativeArchitectures=x86_64 || ./gradlew :app:assembleRelease -PreactNativeArchitectures=x86_64 - cp app/build/outputs/apk/release/app-release.apk "$RUNNER_TEMP/smoke.apk" + cp app/build/outputs/apk/release/app-release.apk '${{ runner.temp }}/smoke.apk' - name: Build release APK (test mode) working-directory: example/android env: @@ -160,8 +160,9 @@ jobs: disable-animations: true script: | adb shell settings put global hide_error_dialogs 1 - bun verify --e2e e2e - E2E_SMOKE=1 E2E_ANDROID_APP="$RUNNER_TEMP/smoke.apk" bun verify --e2e e2e + # one line (the runner runs each line in its own shell and stops at the first failure): smoke runs even + # when the main e2e failed, and the step exits with the first non-zero code + bun verify --e2e e2e; a=$?; E2E_SMOKE=1 E2E_ANDROID_APP='${{ runner.temp }}/smoke.apk' bun verify --e2e e2e; b=$?; exit $(( a ? a : b )) - uses: actions/upload-artifact@v4 if: always() # e2e retries once; keep traces of retried and failed attempts with: @@ -205,12 +206,13 @@ jobs: working-directory: example/ios run: pod install - name: Build release app (smoke, test mode off) + id: ios-smoke-build working-directory: example/ios run: | xcodebuild -workspace OpenTelemetryExample.xcworkspace -scheme OpenTelemetryExample \ -configuration Release -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' \ -derivedDataPath build ARCHS=arm64 build - cp -R build/Build/Products/Release-iphonesimulator/OpenTelemetryExample.app "$RUNNER_TEMP/" + cp -R build/Build/Products/Release-iphonesimulator/OpenTelemetryExample.app '${{ runner.temp }}/' - name: pod install (test mode) working-directory: example/ios env: @@ -235,11 +237,13 @@ jobs: AGENT_DEVICE_DAEMON_STARTUP_TIMEOUT_MS: '600000' # the first daemon start on a cold runner outlasts the 120 s default run: bun verify --e2e e2e - name: e2e smoke (ios-bare, test mode off) + # also after a failed main e2e (that step already fails the job) + if: ${{ !cancelled() && steps.ios-smoke-build.outcome == 'success' }} env: E2E_TARGET: ios-bare E2E_SMOKE: '1' AGENT_DEVICE_DAEMON_STARTUP_TIMEOUT_MS: '600000' - run: E2E_IOS_APP="$RUNNER_TEMP/OpenTelemetryExample.app" bun verify --e2e e2e + run: E2E_IOS_APP='${{ runner.temp }}/OpenTelemetryExample.app' bun verify --e2e e2e - name: Diagnose the simulator log if: failure() run: | diff --git a/example-expo/plugins/withOtelExample.js b/example-expo/plugins/withOtelExample.js index 3f65384..e0c2a3b 100644 --- a/example-expo/plugins/withOtelExample.js +++ b/example-expo/plugins/withOtelExample.js @@ -1,8 +1,18 @@ -const {withAndroidManifest, withGradleProperties, withPodfile} = require('expo/config-plugins'); +const {withAndroidManifest, withAppBuildGradle, withGradleProperties, withPodfile} = require('expo/config-plugins'); // Autolinking links only the Nitro pod; its pure Swift core pod is declared in the Podfile (R24). const CORE_POD = " pod 'ReactNativeOpenTelemetryCore', :path => '../..'"; +// Same as the bare example's app/build.gradle: the bundle task sees only this app's dir, so a change to the package +// (lib/, src/), the scenarios or OTEL_TEST_MODE would otherwise leave the old bundle in the APK. +const BUNDLE_INPUTS = ` +// withOtelExample: rebundle when lib/, src/, verify/ or OTEL_TEST_MODE change +tasks.matching { it.name.startsWith("createBundle") }.configureEach { + inputs.property("otelTestMode", System.getenv("OTEL_TEST_MODE") ?: "") + inputs.files(fileTree("../../..") { include "lib/**", "src/**", "verify/scenarios/**", "verify/harness/*.ts" }) +} +`; + /** Example-only (Task 28): what the bare example's native projects carry by hand, applied at `expo prebuild`. */ module.exports = config => { config = withPodfile(config, c => { @@ -10,6 +20,10 @@ module.exports = config => { c.modResults.contents = c.modResults.contents.replace(/^(target '.+' do\n)/m, `$1${CORE_POD}\n`); return c; }); + config = withAppBuildGradle(config, c => { + if (!c.modResults.contents.includes('withOtelExample: rebundle')) c.modResults.contents += BUNDLE_INPUTS; + return c; + }); // EXAMPLE-ONLY, DO NOT COPY: app-wide cleartext so the e2e collector (plain http, also with test mode off) is reachable. // ponytail: any host, not only 10.0.2.2 like the bare app's network_security_config. Only the CORE_POD step above is // what a real Expo app needs. diff --git a/verify/VERIFY.md b/verify/VERIFY.md index 19a70fe..7ed7efd 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -219,11 +219,12 @@ API 28) has not run on a device: no API 26/27 system image is installed locally, **`perf-budget`** (`perf.e2e.ts`, R27): `android-bare` only, by target name. The scenario times (a) 100 warm-up + 1,000 × `startSpan → setAttribute×10 → end()` with `performance.now()` per span, through the real synchronous -hand-off (`end()` alone is reported too), and (b) 10,000 `await null` inside an active span with the patch on, then -off (`Promise.prototype.then` restored from the patch marker, put back in `finally`; no extra build). The numbers -leave as attributes of one `perf-result` span; the test writes `verify/artifacts/perf.json` (numbers, method, device) -and fails only if hand-off p50 ≥ 100 µs or the ratio ≥ 3×. Pixel_9 emulator (API 36, arm64, release test-mode build), -7 runs: p50 27.1–28.2 µs (p95 51–71 µs, `end()` alone p50 14–14.7 µs), ratio 1.57–2.28. +hand-off (`end()` alone is reported too), and (b) 5 alternating rounds (on, off, …) of 20,000 `await null` inside +an active span, patch on vs off (`Promise.prototype.then` restored from the patch marker, put back in `finally` each +round; no extra build). The numbers leave as attributes of one `perf-result` span; the test writes +`verify/artifacts/perf.json` (every sample, method, device) and fails only if the unrounded hand-off p50 ≥ 100 µs or +median(on) / median(off) ≥ 3×. It measures the test-mode build, which crosses the same hand-off seam as production. +Pixel_9 emulator (API 36, arm64), 2 runs: p50 26.9–27.3 µs (p95 53–58 µs, `end()` alone p50 13.8–14.2 µs), ratio 1.70–1.71. ## Android cold start with `RNOtel.start` (Task 24, 2026-11-24) diff --git a/verify/e2e/perf.e2e.ts b/verify/e2e/perf.e2e.ts index e8c4ed2..ae37561 100644 --- a/verify/e2e/perf.e2e.ts +++ b/verify/e2e/perf.e2e.ts @@ -5,9 +5,18 @@ import {expect} from 'e2e'; import {MOBILE, test} from './harness'; const BUDGET = {handoffP50Us: 100, patchRatio: 3}; +/** Report only: the gates use the unrounded values. */ const round = (x: number) => Math.round(x * 100) / 100; +const median = (xs: number[]) => { + const s = [...xs].sort((a, b) => a - b); + const m = s.length >> 1; + return s.length % 2 ? s[m]! : (s[m - 1]! + s[m]!) / 2; +}; const OUT = path.join(import.meta.dirname, '..', 'artifacts', 'perf.json'); +/** OTLP/JSON attribute value -> number or number[] (NaN when missing, which fails both budgets). */ +const num = (v: any): number => Number(v?.doubleValue ?? v?.intValue ?? NaN); + // Performance guardrail (§9.2, R27): perf-budget sends its numbers as the attributes of one `perf-result` span; // this test writes them to verify/artifacts/perf.json and fails only on the loose budgets. No shape file, no compare. // android-bare only, by target name (android-expo runs the same JS through another init path, not another hand-off). @@ -26,16 +35,20 @@ test('perf-budget', {platforms: MOBILE}, async ({app, screen, collector, device, .flatMap(r => r.scopeSpans.flatMap((s: any) => s.spans)) .find(s => s.name === 'perf-result'); if (!span) throw new Error('no perf-result span arrived'); - const m: Record<string, number> = Object.fromEntries( - span.attributes.map((a: any) => [a.key.replace(/^com\.callstack\.perf\./, ''), Number(a.value.doubleValue ?? a.value.intValue)]), - ); - const n = (k: string) => m[k] ?? NaN; // NaN fails both budgets + const attrs = new Map<string, any>(span.attributes.map((a: any) => [a.key.replace(/^com\.callstack\.perf\./, ''), a.value])); + const n = (k: string) => num(attrs.get(k)); + const ns = (k: string): number[] => (attrs.get(k)?.arrayValue?.values ?? []).map(num); const prop = (p: string) => execFileSync('adb', ['-s', device.unstable_raw.deviceId, 'shell', 'getprop', p], {encoding: 'utf8'}).trim(); - const ratio = n('await.on_ms') / n('await.off_ms'); + + const p50Us = n('handoff.p50_us'); + const onMs = ns('await.on_ms'); + const offMs = ns('await.off_ms'); + const ratio = onMs.length && offMs.length ? median(onMs) / median(offMs) : NaN; const report = { scenario: 'perf-budget', target, + build: 'release, test mode on (test-mode ids and resource; the same JS -> Nitro hand-off seam as production)', measuredAt: new Date().toISOString(), device: { model: prop('ro.product.model'), @@ -45,19 +58,22 @@ test('perf-budget', {platforms: MOBILE}, async ({app, screen, collector, device, apiLevel: Number(prop('ro.build.version.sdk')), }, handoff: { - what: 'per span: tracer.startSpan -> setAttribute x10 -> end(), through NativeHandOffProcessor.onEnd -> Nitro handOff (synchronous on the JS thread); performance.now() around each span', + what: 'per span, in the test-mode build: tracer.startSpan -> setAttribute x10 -> end(), through NativeHandOffProcessor.onEnd -> Nitro handOff (synchronous on the JS thread, the production seam); performance.now() around each span', spans: n('handoff.spans'), warmupSpans: n('handoff.warmup'), - p50Us: n('handoff.p50_us'), - p95Us: n('handoff.p95_us'), - endOnlyP50Us: n('handoff.end_p50_us'), // end() alone: onEnd, isSampled, toSeamSpan, handOff + p50Us: round(p50Us), + p95Us: round(n('handoff.p95_us')), + endOnlyP50Us: round(n('handoff.end_p50_us')), // end() alone: onEnd, isSampled, toSeamSpan, handOff budgetP50Us: BUDGET.handoffP50Us, }, patch: { - what: 'N sequential `await null` inside an active span (the wrapped path); off = Promise.prototype.then restored from the patch marker for the leg (R27)', - awaits: n('await.count'), - onMs: round(n('await.on_ms')), - offMs: round(n('await.off_ms')), + what: 'in the test-mode build: alternating rounds (on, off, on, off, …) of N sequential `await null` inside an active span (the wrapped path); off = Promise.prototype.then restored from the patch marker for the leg (R27); ratio = median(on) / median(off)', + awaitsPerLeg: n('await.count'), + rounds: n('await.rounds'), + onMs: onMs.map(round), + offMs: offMs.map(round), + medianOnMs: round(median(onMs)), + medianOffMs: round(median(offMs)), ratio: round(ratio), budgetRatio: BUDGET.patchRatio, }, @@ -65,6 +81,6 @@ test('perf-budget', {platforms: MOBILE}, async ({app, screen, collector, device, fs.mkdirSync(path.dirname(OUT), {recursive: true}); fs.writeFileSync(OUT, JSON.stringify(report, null, 2) + '\n'); console.log(`perf.json: ${JSON.stringify(report)}`); - expect(report.handoff.p50Us).toBeLessThan(BUDGET.handoffP50Us); - expect(report.patch.ratio).toBeLessThan(BUDGET.patchRatio); + expect(p50Us).toBeLessThan(BUDGET.handoffP50Us); + expect(ratio).toBeLessThan(BUDGET.patchRatio); }); diff --git a/verify/scenarios/perf-budget.ts b/verify/scenarios/perf-budget.ts index b37a9aa..ab22477 100644 --- a/verify/scenarios/perf-budget.ts +++ b/verify/scenarios/perf-budget.ts @@ -3,11 +3,12 @@ import {scenario} from '../harness/scenario'; const SPANS = 1_000; const WARMUP = 100; -const AWAITS = 10_000; +const AWAITS = 20_000; +const ROUNDS = 5; const P = 'com.callstack.perf.'; const pct = (xs: number[], p: number) => [...xs].sort((a, b) => a - b)[Math.min(xs.length - 1, Math.floor(xs.length * p))]!; -const us = (ms: number) => Math.round(ms * 10_000) / 10; // 0.1 µs +const us = (ms: number) => ms * 1000; // unrounded: perf.e2e.ts gates on these and rounds only for the report async function awaits(n: number) { const t0 = performance.now(); @@ -17,7 +18,7 @@ async function awaits(n: number) { /** * Performance guardrail (§9.2, Task 29), `android-bare` only: (a) 1,000 spans × 10 attributes through the real - * hand-off, p50/p95 µs per span; (b) 10,000 awaits inside an active span with the patch on vs off (R27: `then` + * hand-off, p50/p95 µs per span; (b) 5 alternating rounds of 20,000 awaits inside an active span, patch on vs off (R27: `then` * restored from the patch marker for the off leg). The numbers leave as the attributes of one `perf-result` span; * verify/e2e/perf.e2e.ts writes `verify/artifacts/perf.json` and applies the budgets. No shape file. */ @@ -46,13 +47,18 @@ export default scenario( const span = tracer.startSpan('perf.awaits'); const inSpan = (n: number) => context.with(trace.setSpan(context.active(), span), () => awaits(n)); await inSpan(1_000); // warm-up - const onMs = await inSpan(AWAITS); - let offMs = 0; - Promise.prototype.then = marker.then; - try { - offMs = await inSpan(AWAITS); - } finally { - Promise.prototype.then = patched; + // alternating legs (on, off, on, off, …): perf.e2e.ts gates on median(on) / median(off), so one GC pause or a + // warm-up drift in either leg does not decide the ratio + const onMs: number[] = []; + const offMs: number[] = []; + for (let r = 0; r < ROUNDS; r++) { + onMs.push(await inSpan(AWAITS)); + Promise.prototype.then = marker.then; + try { + offMs.push(await inSpan(AWAITS)); + } finally { + Promise.prototype.then = patched; + } } span.end(); @@ -65,6 +71,7 @@ export default scenario( [`${P}handoff.p95_us`]: us(pct(total, 0.95)), [`${P}handoff.end_p50_us`]: us(pct(end, 0.5)), [`${P}await.count`]: AWAITS, + [`${P}await.rounds`]: ROUNDS, [`${P}await.on_ms`]: onMs, [`${P}await.off_ms`]: offMs, }, From d370f4cfe4485810b3c322f8ff0face3347014b8 Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 08:36:56 +0100 Subject: [PATCH 57/76] ci: official collector compliance Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- .github/workflows/ci.yml | 43 +++++++++++++- verify/VERIFY.md | 11 ++++ verify/compliance/collector.yaml | 14 +++++ verify/compliance/replay.ts | 78 +++++++++++++++++++++++++ verify/harness/__tests__/replay.test.ts | 32 ++++++++++ 5 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 verify/compliance/collector.yaml create mode 100644 verify/compliance/replay.ts create mode 100644 verify/harness/__tests__/replay.test.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8517e10..682d70f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -455,8 +455,49 @@ jobs: if-no-files-found: ignore include-hidden-files: true # verify/e2e/.e2e is a dot dir + # Task 30: replays every raw request the e2e jobs captured (protobuf and JSON) and every verify/expected file into + # the official OpenTelemetry Collector (pinned; bump deliberately). Fails on a non-2xx or an error log line. + # Needs docker, so it is not part of `bun verify`. X9: replay.ts names the JSON files it tolerates a rejection of. + compliance: + needs: [e2e-android-bare, e2e-ios-bare, e2e-android-expo, e2e-ios-expo, e2e-web] + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.2.19 + - uses: actions/download-artifact@v4 + with: + pattern: verify-artifacts-e2e-* + path: e2e-artifacts # one subdirectory per job + - name: Start the Collector + run: | + docker run -d --name otelcol -p 4318:4318 \ + -v "$PWD/verify/compliance/collector.yaml:/etc/otelcol/config.yaml:ro" \ + otel/opentelemetry-collector:0.165.0 --config /etc/otelcol/config.yaml + for i in $(seq 30); do + code=$(curl -s -o /dev/null -w '%{http_code}' -X POST localhost:4318/v1/traces || true) + [ "$code" != 000 ] && break + sleep 1 + done + [ "$code" != 000 ] || { docker logs otelcol; exit 1; } + - name: Replay + run: bun verify/compliance/replay.ts --url http://localhost:4318 --dirs e2e-artifacts + - name: Collector log has no errors + if: always() + run: | + docker logs otelcol > collector.log 2>&1 + if grep -P '\terror\t' collector.log; then echo '::error::the Collector logged errors'; exit 1; fi + - uses: actions/upload-artifact@v4 + if: always() + with: + name: compliance-collector-log + path: collector.log + if-no-files-found: ignore + budget: - needs: [static-fast, fast-swift, e2e-android-bare, e2e-ios-bare, e2e-android-expo, e2e-ios-expo, e2e-web] # every other job; extend when jobs are added + needs: [static-fast, fast-swift, e2e-android-bare, e2e-ios-bare, e2e-android-expo, e2e-ios-expo, e2e-web, compliance] # every other job; extend when jobs are added if: always() runs-on: ubuntu-latest timeout-minutes: 5 diff --git a/verify/VERIFY.md b/verify/VERIFY.md index 7ed7efd..a2d3ad4 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -258,6 +258,17 @@ The T3 host process has no `JAVA_HOME`, so `avdmanager list avd` fails. The emul (`@e2e-dev/mobile`, agent-device 0.21.39) drives it fine. Reload / fast refresh / background on Android still need a check before Task 27; fix the T3 host's Java (or run the check through an e2e test) and fill in the column. Task 27 filled it in through e2e tests. +## OTLP compliance (Task 30) + +CI job `compliance` (needs every e2e job) downloads their `verify-artifacts-e2e-*`, runs the pinned official +`otel/opentelemetry-collector:0.165.0` with `verify/compliance/collector.yaml` (OTLP/HTTP in, `debug` exporter, +`verbosity: detailed`) and runs `bun verify/compliance/replay.ts --url http://localhost:4318 --dirs <dir>...`. It POSTs every +`raw/*/<n>.pb` as `application/x-protobuf`, every raw `.json` and every `verify/expected/*.otlp.json` as `application/json`; +a non-2xx or a `\terror\t` collector log line fails the job. Needs docker, so it is not in `bun verify`. +X9: `JSON_EXCEPTIONS` in `replay.ts` names the `odd-attributes.*.otlp.json` files (NaN/Infinity `doubleValue` strings) whose +JSON rejection is only warned about; the protobuf raw requests still prove the value. Delete the list once CI shows the +Collector accepts them. + ## Scenarios One file per guarantee in `verify/scenarios/`, named after it, with a hand-written `verify/expected/<name>.shape.json` diff --git a/verify/compliance/collector.yaml b/verify/compliance/collector.yaml new file mode 100644 index 0000000..b59d641 --- /dev/null +++ b/verify/compliance/collector.yaml @@ -0,0 +1,14 @@ +# Official OpenTelemetry Collector for the compliance job (Task 30): receives OTLP/HTTP, decodes every span, logs it. +receivers: + otlp: + protocols: + http: + endpoint: 0.0.0.0:4318 +exporters: + debug: + verbosity: detailed +service: + pipelines: + traces: + receivers: [otlp] + exporters: [debug] diff --git a/verify/compliance/replay.ts b/verify/compliance/replay.ts new file mode 100644 index 0000000..89fc9fa --- /dev/null +++ b/verify/compliance/replay.ts @@ -0,0 +1,78 @@ +// Replays captured raw requests (protobuf as application/x-protobuf, JSON as application/json) and the expected +// *.otlp.json files into a real OpenTelemetry Collector. Fails on any non-2xx (the collector log is checked in CI). +// Usage: bun verify/compliance/replay.ts --url http://localhost:4318 --dirs <artifact dir>... [--expected verify/expected] +import fs from 'node:fs'; +import path from 'node:path'; + +// X9: the Collector's OTLP/JSON parser may reject `"doubleValue": "NaN"` / "Infinity" strings (protojson allows +// them, pdata's reader is unverified). A rejection of these files is reported loudly, not failed: the protobuf raw +// requests of the same scenarios still prove the value reaches a real Collector. Anything else must be 2xx. +export const JSON_EXCEPTIONS: Record<string, string> = { + 'odd-attributes.js.otlp.json': 'X9: NaN/Infinity doubleValue strings; protobuf raw requests cover it', + 'odd-attributes.android.otlp.json': 'X9: NaN/Infinity doubleValue strings; protobuf raw requests cover it', + 'odd-attributes.ios.otlp.json': 'X9: NaN/Infinity doubleValue strings; protobuf raw requests cover it', + 'odd-attributes.web.otlp.json': 'X9: NaN/Infinity doubleValue strings; protobuf raw requests cover it', +}; + +const walk = (d: string): string[] => + fs.readdirSync(d, {withFileTypes: true}).flatMap(e => { + const p = path.join(d, e.name); + return e.isDirectory() ? walk(p) : [p]; + }); + +/** `raw/<scenario>.<platform>/<n>.pb|json`, wherever the artifact download put `raw`. */ +const isRaw = (f: string) => + /\.(pb|json)$/.test(f) && !f.endsWith('.headers.json') && path.basename(path.dirname(path.dirname(f))) === 'raw'; + +export async function replay(opts: {url: string; dirs: string[]; expected?: string}) { + const jobs: {file: string; type: string; exception?: string}[] = []; + for (const d of opts.dirs) + for (const f of walk(d).filter(isRaw).sort()) + jobs.push({file: f, type: f.endsWith('.pb') ? 'application/x-protobuf' : 'application/json'}); + const raw = jobs.length; + if (opts.expected) + for (const f of fs.readdirSync(opts.expected).filter(f => f.endsWith('.otlp.json')).sort()) + jobs.push({file: path.join(opts.expected, f), type: 'application/json', exception: JSON_EXCEPTIONS[f]}); + const failures: string[] = []; + const tolerated: string[] = []; + for (const j of jobs) { + const res = await fetch(`${opts.url}/v1/traces`, { + method: 'POST', + headers: {'content-type': j.type}, + body: fs.readFileSync(j.file), + }); + const text = await res.text(); + if (res.ok) continue; + const msg = `${j.file}: HTTP ${res.status} ${text.slice(0, 200)}`; + (j.exception ? tolerated : failures).push(j.exception ? `${msg} [tolerated: ${j.exception}]` : msg); + } + return {raw, expected: jobs.length - raw, failures, tolerated}; +} + +async function main() { + const argv = process.argv.slice(2); + const arg = (n: string) => { + const i = argv.indexOf(n); + if (i < 0) return undefined; + const rest = argv.slice(i + 1); + const end = rest.findIndex(x => x.startsWith('--')); + return end < 0 ? rest : rest.slice(0, end); + }; + const url = arg('--url')?.[0]; + if (!url) throw new Error('--url required'); + const r = await replay({ + url, + dirs: arg('--dirs') ?? [], + expected: arg('--expected')?.[0] ?? path.join(__dirname, '..', 'expected'), + }); + console.log(`replayed ${r.raw} raw requests and ${r.expected} expected files`); + for (const t of r.tolerated) console.warn(`WARNING ${t}`); + for (const f of r.failures) console.error(`FAIL ${f}`); + if (r.failures.length) process.exit(1); + if (r.raw === 0) { + console.error('FAIL no raw requests found under --dirs'); + process.exit(1); + } +} + +if (require.main === module) void main(); diff --git a/verify/harness/__tests__/replay.test.ts b/verify/harness/__tests__/replay.test.ts new file mode 100644 index 0000000..94c3460 --- /dev/null +++ b/verify/harness/__tests__/replay.test.ts @@ -0,0 +1,32 @@ +import fs from 'fs'; +import os from 'os'; +import path from 'path'; +import {startCollector} from '../collector'; +import {replay} from '../../compliance/replay'; + +test('replay posts raw + expected files, fails on a non-2xx, tolerates only listed JSON exceptions', async () => { + const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'replay-')); + const c = await startCollector({port: 0, artifactsDir: path.join(dir, 'sink')}); + try { + const good = JSON.stringify({resourceSpans: [{scopeSpans: [{spans: [{traceId: '0a'.padEnd(32, '0'), spanId: '0a00000000000001', name: 'x'}]}]}]}); + const raw = path.join(dir, 'dl', 'artifacts', 'raw', 's.web'); + fs.mkdirSync(raw, {recursive: true}); + fs.writeFileSync(path.join(raw, '0.json'), good); + fs.writeFileSync(path.join(raw, '0.headers.json'), '{}'); // not a request + const exp = path.join(dir, 'expected'); + fs.mkdirSync(exp); + fs.writeFileSync(path.join(exp, 'a.js.otlp.json'), good); + const ok = await replay({url: c.url, dirs: [path.join(dir, 'dl')], expected: exp}); + expect(ok).toEqual({raw: 1, expected: 1, failures: [], tolerated: []}); + + fs.writeFileSync(path.join(exp, 'b.js.otlp.json'), '{not json'); + const bad = await replay({url: c.url, dirs: [path.join(dir, 'dl')], expected: exp}); + expect(bad.failures).toHaveLength(1); + fs.renameSync(path.join(exp, 'b.js.otlp.json'), path.join(exp, 'odd-attributes.js.otlp.json')); + const exc = await replay({url: c.url, dirs: [path.join(dir, 'dl')], expected: exp}); + expect(exc.failures).toEqual([]); + expect(exc.tolerated).toHaveLength(1); + } finally { + await c.close(); + } +}); From 03d9715bac83786066c217e5d85d513b16d3e893 Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 08:50:15 +0100 Subject: [PATCH 58/76] ci: nightly matrix - .github/workflows/scheduled.yml: one `e2e` matrix (RN 0.79 / latest with example/ regenerated, deps at latest + fast loop, npm pack into a fresh bare app and the Expo app with smoke-device, API 26 smoke, dev builds with fast-refresh-idempotent); `mark-nightly` sets the `nightly` commit status. TEMPORARY pull_request trigger (paths: the workflow) runs in dry-run mode (R28). - verify/nightly/app.sh: `bare <rn>` regenerates example/ native projects and re-applies its edits (X13); `pack <app>` installs the tarball instead of the source tree. - Example native init moved to OtelInit.kt / AppDelegate's `otel-init` section so the script reuses it. - rn-0.79-ios is experimental: RN 0.79.7 does not build on Xcode 27 (author gate, VERIFY.md). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- .github/workflows/scheduled.yml | 210 ++++++++++++++++++ .../opentelemetry/example/MainApplication.kt | 21 +- .../java/opentelemetry/example/OtelInit.kt | 30 +++ .../OpenTelemetryExample/AppDelegate.swift | 37 +-- verify/VERIFY.md | 51 ++++- verify/e2e/harness.ts | 4 +- verify/nightly/app.sh | 105 +++++++++ 7 files changed, 414 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/scheduled.yml create mode 100644 example/android/app/src/main/java/opentelemetry/example/OtelInit.kt create mode 100755 verify/nightly/app.sh diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml new file mode 100644 index 0000000..fa49262 --- /dev/null +++ b/.github/workflows/scheduled.yml @@ -0,0 +1,210 @@ +name: Nightly + +# Spec §9.4/§9.5 (Task 31). Setup steps follow ci.yml; no native caches here: every nightly build is from scratch. +# `schedule` and `workflow_dispatch` only run workflow files from the default branch (main), so the real schedule is +# first verified after merge to main (R28). On success, `mark-nightly` marks the commit with a `nightly` status. +on: + schedule: + - cron: '0 2 * * *' + workflow_dispatch: + inputs: + dry_run: + description: 'Dry run: setup, app regeneration and packing only (no builds, no devices, no status)' + type: boolean + default: false + # TEMPORARY (R28): one dry run from the PR that adds this file; removed in the follow-up commit. + pull_request: + paths: + - .github/workflows/scheduled.yml + +permissions: + contents: read + +concurrency: + group: nightly-${{ github.ref }} + cancel-in-progress: true + +env: + E2E_TELEMETRY_DISABLED: '1' + DRY_RUN: ${{ github.event_name == 'pull_request' || inputs.dry_run == true }} + +jobs: + e2e: + name: ${{ matrix.name }} + runs-on: ${{ matrix.platform == 'ios' && 'xcode-27' || 'ubuntu-latest' }} + timeout-minutes: 90 + continue-on-error: ${{ matrix.experimental == true }} + strategy: + fail-fast: false + matrix: + # platform: android | ios. app: bare (example/, default) | expo (example-expo/). + # mode: e2e (Release, test mode, every scenario) | smoke (Release, test mode off, smoke-device) | + # dev (Debug + Metro, test mode, fast-refresh-idempotent). + # rn: regenerate example/ from the RN template at that version (verify/nightly/app.sh bare, X13). + # deps: @opentelemetry/*, otel-java (BOM) and opentelemetry-swift at their latest, plus the fast loop. + # pack: npm pack, install the tarball into that app instead of linking the source tree (app.sh pack). + include: + # oldest supported (peer range >=0.79) and newest React Native + - {name: rn-0.79-android, platform: android, rn: '0.79', mode: e2e} + # experimental (AUTHOR GATE, VERIFY.md "Nightly"): RN 0.79.7 iOS does not build on Xcode 27 (locally: the + # adapter podspec's module-map script phase collides with CocoaPods' own, then RN 0.79's fmt pod fails on + # consteval). Fix both or raise the minimum RN, then drop the flag. + - {name: rn-0.79-ios, platform: ios, rn: '0.79', mode: e2e, experimental: true} + - {name: rn-latest-android, platform: android, rn: latest, mode: e2e} + - {name: rn-latest-ios, platform: ios, rn: latest, mode: e2e} + - {name: deps-latest-android, platform: android, deps: true, mode: e2e} + - {name: deps-latest-ios, platform: ios, deps: true, mode: e2e} + # the published package: a fresh bare app (template at latest) and the Expo app (prebuild --clean), test mode + # off. The Expo entries are also the Expo smoke-device run (X11 interim: bare per PR, Expo here). + - {name: pack-bare-android, platform: android, rn: latest, pack: example, mode: smoke} + - {name: pack-bare-ios, platform: ios, rn: latest, pack: example, mode: smoke} + - {name: pack-expo-android, platform: android, app: expo, pack: example-expo, mode: smoke} + - {name: pack-expo-ios, platform: ios, app: expo, pack: example-expo, mode: smoke} + # Android process-name fallback below API 28 (/proc/self/cmdline, Task 24): native init must still run + - {name: api26-android-smoke, platform: android, api: 26, mode: smoke} + # fast-refresh-idempotent needs Debug builds and Metro, so it is not per PR (Task 27) + - {name: dev-android, platform: android, mode: dev} + - {name: dev-ios, platform: ios, mode: dev} + env: + APP_DIR: ${{ matrix.app == 'expo' && 'example-expo' || 'example' }} + SCHEME: ${{ matrix.app == 'expo' && 'OpenTelemetryExpo' || 'OpenTelemetryExample' }} + CONFIGURATION: ${{ matrix.mode == 'dev' && 'Debug' || 'Release' }} + OTEL_TEST_MODE: ${{ matrix.mode != 'smoke' && '1' || '' }} + E2E_SMOKE: ${{ matrix.mode == 'smoke' && '1' || '' }} + E2E_DEV: ${{ matrix.mode == 'dev' && '1' || '' }} + E2E_TARGET: ${{ format('{0}-{1}', matrix.platform, matrix.mode == 'dev' && 'dev' || matrix.app == 'expo' && 'expo' || 'bare') }} + AGENT_DEVICE_DAEMON_STARTUP_TIMEOUT_MS: '600000' # the first daemon start on a cold runner outlasts the default + steps: + - uses: actions/checkout@v4 + - if: matrix.platform == 'ios' + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '27.0' + - uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.2.19 + - uses: actions/setup-node@v4 # npm view / npm pack / the RN CLI in verify/nightly/app.sh + with: + node-version: '24' + - if: matrix.platform == 'android' + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '17' + + - name: Bump @opentelemetry/*, otel-java and opentelemetry-swift to latest + if: matrix.deps + run: | + jq -r '.dependencies | keys[] | select(startswith("@opentelemetry/")) + "@latest"' package.json | xargs bun add + java=$(curl -fsSL https://repo1.maven.org/maven2/io/opentelemetry/opentelemetry-bom/maven-metadata.xml | + sed -n 's:.*<release>\(.*\)</release>.*:\1:p') + perl -pi -e "s/opentelemetry-bom:[\d.]+/opentelemetry-bom:$java/" android/build.gradle android/core-jvm/build.gradle.kts + for repo in opentelemetry-swift opentelemetry-swift-core; do + v=$(git ls-remote --tags --refs "https://github.com/open-telemetry/$repo" | sed 's:.*/::; s/^v//' | + grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1) + perl -0pi -e "s|($repo\", \.upToNextMinor\(from: \")[\d.]+|\${1}$v|" Package.swift + perl -0pi -e "s|($repo',\s*requirement: \{ kind: 'upToNextMinorVersion', minimumVersion: ')[\d.]+|\${1}$v|" \ + ReactNativeOpenTelemetryCore.podspec + grep -qF "$repo\", .upToNextMinor(from: \"$v\")" Package.swift || { echo "::error::Package.swift: $repo not bumped"; exit 1; } + done + # resolve the bumped Swift packages afresh + rm -f example/ios/OpenTelemetryExample.xcworkspace/xcshareddata/swiftpm/Package.resolved + git diff -- package.json android/build.gradle android/core-jvm/build.gradle.kts Package.swift '*.podspec' + - run: bun install --frozen-lockfile + - name: Regenerate example/ at React Native ${{ matrix.rn }} + if: matrix.rn + run: verify/nightly/app.sh bare '${{ matrix.rn }}' + - name: Install ${{ env.APP_DIR }} + working-directory: ${{ env.APP_DIR }} + run: bun install ${{ !matrix.rn && '--frozen-lockfile' || '' }} + - run: bun run prepare # the apps bundle the package through exports -> lib/ (R4) + - name: npm pack into ${{ matrix.pack }} + if: matrix.pack + run: verify/nightly/app.sh pack '${{ matrix.pack }}' + - name: Fast loop + if: matrix.deps && env.DRY_RUN != 'true' + # every non-e2e stage on Linux (fast-swift skips there); fast-swift on macOS + run: bun verify ${{ matrix.platform == 'ios' && 'fast-swift' || '' }} + - name: expo prebuild + if: matrix.app == 'expo' + working-directory: example-expo + run: bunx expo prebuild --clean --no-install --platform ${{ matrix.platform }} + + - name: Build (${{ env.CONFIGURATION }}) + if: env.DRY_RUN != 'true' + run: | + if [ '${{ matrix.platform }}' = android ]; then + cd "$APP_DIR/android" + args=(":app:assemble$CONFIGURATION" -PreactNativeArchitectures=x86_64 ${OTEL_TEST_MODE:+-PotelTestMode=true}) + ./gradlew "${args[@]}" || ./gradlew "${args[@]}" # one retry: plugin and NDK downloads fail transiently + else + cd "$APP_DIR/ios" + pod install # OTEL_TEST_MODE (job env) adds the Swift compilation condition + xcodebuild -workspace "$SCHEME.xcworkspace" -scheme "$SCHEME" -configuration "$CONFIGURATION" \ + -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath build ARCHS=arm64 build + fi + - name: Start Metro (dev builds load their bundle from it) + if: matrix.mode == 'dev' && env.DRY_RUN != 'true' + working-directory: example + run: nohup bunx react-native start > "$RUNNER_TEMP/metro.log" 2>&1 & + + - name: Enable KVM + if: matrix.platform == 'android' && env.DRY_RUN != 'true' + 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: e2e (${{ env.E2E_TARGET }}) + if: matrix.platform == 'android' && env.DRY_RUN != 'true' + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api || 35 }} + arch: x86_64 + target: google_apis + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + # each line runs in its own shell + script: | + adb shell settings put global hide_error_dialogs 1 + adb reverse tcp:8081 tcp:8081 + if [ "$E2E_DEV" = 1 ]; then bunx e2e run --config verify/e2e/e2e.config.ts --target "$E2E_TARGET" fast-refresh-idempotent; else bun verify --e2e e2e; fi + - name: Pre-boot the simulator (a cold boot on the runner outlasts agent-device's boot timeout) + if: matrix.platform == 'ios' && env.DRY_RUN != 'true' + run: | + udid=$(xcrun simctl list devices available -j | jq -r '[.devices[][] | select(.name | startswith("iPhone"))][0].udid') + xcrun simctl boot "$udid" + xcrun simctl bootstatus "$udid" -b + - name: e2e (${{ env.E2E_TARGET }}) + if: matrix.platform == 'ios' && env.DRY_RUN != 'true' + run: | + if [ "$E2E_DEV" = 1 ]; then bunx e2e run --config verify/e2e/e2e.config.ts --target "$E2E_TARGET" fast-refresh-idempotent; else bun verify --e2e e2e; fi + + - name: Metro log + if: failure() && matrix.mode == 'dev' + run: tail -100 "$RUNNER_TEMP/metro.log" || true + - uses: actions/upload-artifact@v4 + if: always() + with: + name: nightly-${{ matrix.name }} + path: | + verify/artifacts/ + verify/e2e/.e2e/ + if-no-files-found: ignore + include-hidden-files: true # verify/e2e/.e2e is a dot dir + + # Marks the commit for the release gate (Task 32). A matrix entry with `experimental: true` does not block it. + mark-nightly: + needs: [e2e] + if: github.event_name != 'pull_request' && !inputs.dry_run + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + statuses: write + steps: + - name: Mark the commit with the `nightly` status + env: + GH_TOKEN: ${{ github.token }} + run: > + gh api 'repos/${{ github.repository }}/statuses/${{ github.sha }}' + -f state=success -f context=nightly -f description='Nightly matrix passed' + -f target_url='${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' diff --git a/example/android/app/src/main/java/opentelemetry/example/MainApplication.kt b/example/android/app/src/main/java/opentelemetry/example/MainApplication.kt index 80cdca8..18e4858 100644 --- a/example/android/app/src/main/java/opentelemetry/example/MainApplication.kt +++ b/example/android/app/src/main/java/opentelemetry/example/MainApplication.kt @@ -1,13 +1,11 @@ package opentelemetry.example import android.app.Application -import com.callstack.otel.RNOtel import com.facebook.react.PackageList import com.facebook.react.ReactApplication import com.facebook.react.ReactHost import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost -import java.io.File class MainApplication : Application(), ReactApplication { @@ -24,24 +22,7 @@ class MainApplication : Application(), ReactApplication { override fun onCreate() { super.onCreate() - // Native-first init, before React Native. No serviceVersion: the test-mode resource is service.name only (R2). - RNOtel.start(this) { - serviceName = "verify" - export { - url = testExportUrl() ?: "http://10.0.2.2:4318" // the e2e collector on the host - headers = mapOf("x-api-key" to "test") // asserted by verify/e2e/export-headers.e2e.ts - } - } - // compile check: the otel API is part of RNOtel's public surface (a no-op tracer is cheap to build) - RNOtel.tracer("opentelemetry.example") + startOtel() // native-first init, before React Native (OtelInit.kt) loadReactNative(this) } - - /** - * Test-mode builds only: verify/e2e/native-init-failure.e2e.ts overrides the URL. Application.onCreate cannot see - * launch arguments (they reach the Activity), so the test writes this file with adb and removes it afterwards. - */ - private fun testExportUrl(): String? = - if (!BuildConfig.OTEL_TEST_MODE) null - else File(getExternalFilesDir(null), "otel-export-url").takeIf { it.exists() }?.readText()?.trim() } diff --git a/example/android/app/src/main/java/opentelemetry/example/OtelInit.kt b/example/android/app/src/main/java/opentelemetry/example/OtelInit.kt new file mode 100644 index 0000000..38d9b0b --- /dev/null +++ b/example/android/app/src/main/java/opentelemetry/example/OtelInit.kt @@ -0,0 +1,30 @@ +package opentelemetry.example + +import android.app.Application +import com.callstack.otel.RNOtel +import java.io.File + +/** + * Native-first init, called from MainApplication.onCreate before React Native. Its own file so the nightly + * (verify/nightly/app.sh) can add it unchanged to a freshly generated app at another RN version. + * No serviceVersion: the test-mode resource is service.name only (R2). + */ +internal fun Application.startOtel() { + RNOtel.start(this) { + serviceName = "verify" + export { + url = testExportUrl() ?: "http://10.0.2.2:4318" // the e2e collector on the host + headers = mapOf("x-api-key" to "test") // asserted by verify/e2e/export-headers.e2e.ts + } + } + // compile check: the otel API is part of RNOtel's public surface (a no-op tracer is cheap to build) + RNOtel.tracer("opentelemetry.example") +} + +/** + * Test-mode builds only: verify/e2e/native-init-failure.e2e.ts overrides the URL. Application.onCreate cannot see + * launch arguments (they reach the Activity), so the test writes this file with adb and removes it afterwards. + */ +private fun Application.testExportUrl(): String? = + if (!BuildConfig.OTEL_TEST_MODE) null + else File(getExternalFilesDir(null), "otel-export-url").takeIf { it.exists() }?.readText()?.trim() diff --git a/example/ios/OpenTelemetryExample/AppDelegate.swift b/example/ios/OpenTelemetryExample/AppDelegate.swift index 384c4f0..74cb830 100644 --- a/example/ios/OpenTelemetryExample/AppDelegate.swift +++ b/example/ios/OpenTelemetryExample/AppDelegate.swift @@ -7,24 +7,29 @@ class AppDelegate: UIResponder, UIApplicationDelegate { _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil ) -> Bool { - // Native-first init, before React Native. No serviceVersion: the test-mode resource is service.name only (R2). - RNOtel.start { c in - c.serviceName = "verify" - // the e2e collector on the host; asserted by verify/e2e/export-headers.e2e.ts - c.export = .init(url: testExportUrl() ?? "http://localhost:4318", headers: ["x-api-key": "test"]) - } - // compile check: the otel API is part of RNOtel's public surface (a no-op tracer is cheap to build) - _ = RNOtel.tracer("opentelemetry.example") + startOtel() return true } +} - /// Test-mode builds only: verify/e2e/native-init-failure.e2e.ts launches with `--otel-export-url=<url>`. - private func testExportUrl() -> String? { - #if OTEL_TEST_MODE - let prefix = "--otel-export-url=" - return ProcessInfo.processInfo.arguments.first { $0.hasPrefix(prefix) }.map { String($0.dropFirst(prefix.count)) } - #else - return nil - #endif +// otel-init: verify/nightly/app.sh appends this line and everything below it to a freshly generated AppDelegate.swift. +/// Native-first init, before React Native. No serviceVersion: the test-mode resource is service.name only (R2). +func startOtel() { + RNOtel.start { c in + c.serviceName = "verify" + // the e2e collector on the host; asserted by verify/e2e/export-headers.e2e.ts + c.export = .init(url: testExportUrl() ?? "http://localhost:4318", headers: ["x-api-key": "test"]) } + // compile check: the otel API is part of RNOtel's public surface (a no-op tracer is cheap to build) + _ = RNOtel.tracer("opentelemetry.example") +} + +/// Test-mode builds only: verify/e2e/native-init-failure.e2e.ts launches with `--otel-export-url=<url>`. +private func testExportUrl() -> String? { + #if OTEL_TEST_MODE + let prefix = "--otel-export-url=" + return ProcessInfo.processInfo.arguments.first { $0.hasPrefix(prefix) }.map { String($0.dropFirst(prefix.count)) } + #else + return nil + #endif } diff --git a/verify/VERIFY.md b/verify/VERIFY.md index a2d3ad4..e63f1b1 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -115,7 +115,7 @@ unproven until their first CI run. `io.opentelemetry.sdk.resources.**`, which otel-java's `ResourceMarshaler` reaches by reflection (`EntityUtil.getEntities`). Without it every export threw `Error calling getEntities on Resource` and nothing arrived. - **Not on Expo:** `native-init-failure` (`targets: ['android-bare', 'ios-bare']`): the bad URL goes to the bare app's - native init, and the Expo app has none. `fast-refresh-idempotent` is local-only on the bare dev builds. + native init, and the Expo app has none. `fast-refresh-idempotent` runs on the bare dev builds only (local and nightly). ## Web (Task 23) @@ -168,7 +168,7 @@ Each has its own e2e file (R10); the ScenariosScreen does not `forceFlush()` aft iOS: launch argument `--otel-export-url=not a url` (AppDelegate, `#if OTEL_TEST_MODE`; the Podfile adds the condition to the app target). Android: `Application.onCreate` cannot see launch arguments (they reach the Activity), so the test writes `/sdcard/Android/data/opentelemetry.example/files/otel-export-url` (mode 644, removed - afterwards and before each install's warm-up launch) and `MainApplication` reads it. Asserted: exactly one log line with `telemetry is off` (native `RNOtel` + afterwards and before each install's warm-up launch) and `OtelInit.kt` (called from `MainApplication`) reads it. Asserted: exactly one log line with `telemetry is off` (native `RNOtel` plus JS `[react-native-open-telemetry]` lines), `scenario-done` (the no-op `forceFlush()` resolved), and the empty expected file. JS no longer repeats a native-first failure that native already reported (`alreadyInitialized`). - `flush-after-reload`: `reload`, then `flush` must resolve within 5 s, the span arrives once. @@ -177,7 +177,7 @@ Each has its own e2e file (R10); the ScenariosScreen does not `forceFlush()` aft that OTA updaters use, so this runs on the release builds, per PR, with no extra build. - `background-flush`: `device.home()` right after `scenario-done`; something must arrive within 15 s. Android: no `am_anr` for the app in the events log. Checked: without `home()` nothing arrives within 15 s on either platform. -- `fast-refresh-idempotent` (**local only**: dev builds + Metro, not in CI; nightly can add it, Task 31): each of two +- `fast-refresh-idempotent` (dev builds + Metro: not per PR; local, and the nightly's `dev-android` / `dev-ios`, Task 31): each of two edits of `lib/module/setup.js` appends `globalThis.__otelRefreshes += 1`; Metro hot-updates it, it re-runs `installContextPatch`, and `patch-identity` must read `same refreshes=<n>` (`then`/`setTimeout` are still the functions first seen; a full reload would reset the count). Then `nest-after-await` must match its own expected @@ -210,12 +210,13 @@ E2E_SMOKE=1 E2E_TARGET=android-bare bun verify --e2e e2e # or ios-bare; E2E_ ``` CI (X11 interim): per PR on the bare targets only, as a variant inside `e2e-android-bare` / `e2e-ios-bare` (built -before the test-mode build, copied to `$RUNNER_TEMP`, run after the main e2e); Expo smoke is the nightly's (Task 31). +before the test-mode build, copied to `$RUNNER_TEMP`, run after the main e2e); Expo smoke is the nightly's (`pack-expo-*`, Task 31). Android rebundles on a test-mode switch: `app/build.gradle` adds `OTEL_TEST_MODE` and the package/verify sources to the bundle task's inputs (they live outside `example/`, so a change there used to leave the old bundle in place). **Untested: API 26–27.** The Android process-name fallback (`/proc/self/cmdline`, for the main-process check below -API 28) has not run on a device: no API 26/27 system image is installed locally, and CI uses API 35. +API 28) has not run on a device: no API 26/27 system image is installed locally, and PR CI uses API 35. The nightly's +`api26-android-smoke` runs smoke-device on an API 26 emulator (unproven until its first run on `main`). **`perf-budget`** (`perf.e2e.ts`, R27): `android-bare` only, by target name. The scenario times (a) 100 warm-up + 1,000 × `startSpan → setAttribute×10 → end()` with `performance.now()` per span, through the real synchronous @@ -226,6 +227,44 @@ round; no extra build). The numbers leave as attributes of one `perf-result` spa median(on) / median(off) ≥ 3×. It measures the test-mode build, which crosses the same hand-off seam as production. Pixel_9 emulator (API 36, arm64), 2 runs: p50 26.9–27.3 µs (p95 53–58 µs, `end()` alone p50 13.8–14.2 µs), ratio 1.70–1.71. +## Nightly (Task 31) + +`.github/workflows/scheduled.yml`, 02:00 UTC and `workflow_dispatch` (input `dry_run`). One matrix job `e2e`, one +entry per row; `mark-nightly` then sets the commit status `nightly` (context `nightly`, the release gate of Task 32). + +| entry | what | +|---|---| +| `rn-0.79-{android,ios}`, `rn-latest-{android,ios}` | `example/` regenerated from the RN template at that version, full e2e (test mode) | +| `deps-latest-{android,ios}` | `@opentelemetry/*`, the otel-java BOM and opentelemetry-swift(-core) bumped to latest; fast loop (`bun verify` on Linux, `fast-swift` on macOS) + e2e | +| `pack-bare-{android,ios}` | `npm pack` → tarball into a fresh bare app (template at latest) → smoke-device, test mode off | +| `pack-expo-{android,ios}` | tarball into the Expo app (`prebuild --clean`) → smoke-device, test mode off (the Expo smoke, X11) | +| `api26-android-smoke` | smoke-device on API 26: the process-name fallback (Task 24) | +| `dev-{android,ios}` | Debug + Metro: `fast-refresh-idempotent` (Task 27) | + +`verify/nightly/app.sh` does the app surgery, in place, so the e2e config and paths stay the same (run it on a +throwaway checkout only): `bare <rn>` regenerates `example/android` and `example/ios` with the RN CLI and re-applies the +example's native edits (X13): `OtelInit.kt` + `startOtel()` in `MainApplication`, `AppDelegate.swift` from its +`// otel-init:` line + `startOtel()`, the network config, minSdk 26, the test-mode `buildConfigField` and bundle inputs, +the committed Podfile (Core pod, R24), the bundle id. A native edit to the example that `app.sh` does not know about is +lost in the nightly: add it there too. `pack <app>` installs the tarball and points autolinking, Metro and the Core pod +at `node_modules/react-native-open-telemetry`. The scenarios still import two test helpers from `src/` directly +(`src/native/otel`, `src/context/scope`); the SDK itself comes from the tarball. + +**RN 0.79 on iOS (AUTHOR GATE, 2026-11-24, Xcode 27.1, RN 0.79.7, Nitro 0.37.2).** Regeneration and `pod install` +work; `xcodebuild` fails twice over: (1) `Multiple commands produce …/ReactNativeOpenTelemetryCore/ReactNativeOpenTelemetryCore.modulemap`: +on 0.79, CocoaPods' own "Copy generated compatibility header" phase writes the path that the adapter podspec's +"Forward the core module map" phase declares as `:output_files` (0.88's spm.rb builds the core into the products root +instead). Dropping `:output_files` locally got past it. (2) RN 0.79's `fmt` pod: `call to consteval function +'fmt::basic_format_string…' is not a constant expression` (the newer Clang). Either fix both for 0.79 users (podspec; +an fmt workaround in the Podfile) or raise the peer minimum. Until then `rn-0.79-ios` is `experimental` +(`continue-on-error`, does not block `nightly`). + +**Verified only after merge to `main`.** `schedule` and `workflow_dispatch` run workflow files from the default branch +only (R28). Before merge the file was checked with `actionlint` and one PR run through a temporary `pull_request` +trigger (paths: the workflow file) in dry-run mode: every entry runs setup, the deps bump, app regeneration, packing and +`expo prebuild`; builds, devices, the fast loop and the status are skipped. The first real nightly is the first proof of +the builds and devices. + ## Android cold start with `RNOtel.start` (Task 24, 2026-11-24) `adb shell am start -W -n opentelemetry.example/.MainActivity` after `am force-stop`, 6 launches each, Pixel_9 @@ -309,7 +348,7 @@ e2e targets are android, ios and web unless the Runners column names them. | `native-init-failure` | one error log, no-op SDK, nothing exported | 27 | e2e (android-bare, ios-bare) | passing | | `flush-after-reload` | `forceFlush()` resolves across a JS reload; spans arrive once | 27 | e2e (android, ios) | passing | | `background-flush` | spans are exported on background without `forceFlush()` | 27 | e2e (android, ios) | passing | -| `fast-refresh-idempotent` | fast refresh does not stack the patch: `then`/`setTimeout` keep their identity across refreshes | 27 | e2e (android-dev, ios-dev; local only) | passing (local only) | +| `fast-refresh-idempotent` | fast refresh does not stack the patch: `then`/`setTimeout` keep their identity across refreshes | 27 | e2e (android-dev, ios-dev; local + nightly) | passing (local; nightly unproven) | | `smoke-device` | production pipeline (no test mode) exports `smoke` spans | 29 | e2e (android, ios; test-mode-off build, `E2E_SMOKE=1`) | passing (no expected file: count + names) | | `perf-budget` | hand-off p50 < 100 µs/span, patch ratio < 3× (`artifacts/perf.json`, no shape) | 29 | e2e (android-bare) | passing | diff --git a/verify/e2e/harness.ts b/verify/e2e/harness.ts index 8783bb1..1fa6a6b 100644 --- a/verify/e2e/harness.ts +++ b/verify/e2e/harness.ts @@ -20,10 +20,10 @@ const {compareToExpected} = await import('../harness/compare'); export const {allScenarios} = await import('../scenarios'); type Collector = Awaited<ReturnType<typeof startCollector>>; -/** Test-mode override of the Android example's export URL (MainApplication), written by native-init-failure.e2e.ts. */ +/** Test-mode override of the Android example's export URL (OtelInit.kt), written by native-init-failure.e2e.ts. */ export const ANDROID_EXPORT_URL_FILE = '/sdcard/Android/data/opentelemetry.example/files/otel-export-url'; -/** Must match the example apps' native init URLs (MainApplication.kt, AppDelegate.swift). */ +/** Must match the example apps' native init URLs (OtelInit.kt, AppDelegate.swift). */ export const COLLECTOR_PORT = 4318; /** Must match e2e.config.ts: the bare example, or the Expo app (`*-expo`). */ diff --git a/verify/nightly/app.sh b/verify/nightly/app.sh new file mode 100755 index 0000000..f6541e7 --- /dev/null +++ b/verify/nightly/app.sh @@ -0,0 +1,105 @@ +#!/usr/bin/env bash +# Nightly helper (Task 31, .github/workflows/scheduled.yml). Run from the repo root, on a throwaway checkout: it +# rewrites example/ and example-expo/ in place, so the e2e config and every path in VERIFY.md stay the same. +# +# verify/nightly/app.sh bare <rn> regenerate example/android and example/ios from the React Native template at +# <rn> (an npm version or range: 0.79, latest), then re-apply the example's native +# edits (X13). The JS side (App.tsx, src/, metro, babel) is kept as committed. +# verify/nightly/app.sh pack <app> `npm pack` the package and install the tarball into <app> (example or +# example-expo) instead of linking the source tree. One app per run: the Expo app +# bundles example/src too, and a second copy of the SDK in example/node_modules +# would be picked up there. Run `bare latest` first for a fresh bare app; the Expo +# app is fresh anyway (`expo prebuild --clean`). +# +# The example's native edits, re-applied by `bare` (keep this list in sync when the example gains one): +# Android: OtelInit.kt + `startOtel()` in MainApplication.onCreate; network_security_config (cleartext to the host); +# minSdk 26 (C13); BuildConfig.OTEL_TEST_MODE and the bundle task inputs (app/build.gradle). +# iOS: `startOtel()` + everything below `// otel-init:` in AppDelegate.swift; the committed Podfile (Core pod +# line, R24; OTEL_TEST_MODE compilation condition); bundle id opentelemetry.example. +set -euo pipefail + +die() { echo "app.sh: $*" >&2; exit 1; } +# edit <file> <perl expression> <text the result must contain>: fail loudly when a template change breaks an edit +edit() { perl -0pi -e "$2" "$1"; grep -qF -- "$3" "$1" || die "could not edit $1 (template changed?)"; } + +bare() { + local rn tmp old + rn=$(npm view "react-native@$1" version --json | jq -r 'if type == "array" then .[-1] else . end') + [ -n "$rn" ] && [ "$rn" != null ] || die "no react-native version matches '$1'" + echo "example: React Native $rn" + tmp=$(mktemp -d) + old=$tmp/old + npx --yes @react-native-community/cli@latest init OpenTelemetryExample --version "$rn" --directory "$tmp/app" \ + --package-name opentelemetry.example --skip-install --install-pods false --skip-git-init + cd example + mkdir "$old" + mv android ios "$old/" + cp -R "$tmp/app/android" "$tmp/app/ios" . + + # package.json: the template's React Native, React and tooling; keep the example's own dependencies + node -e ' + const fs = require("fs"); + const [app, tpl] = process.argv.slice(1).map(f => JSON.parse(fs.readFileSync(f, "utf8"))); + for (const k of ["dependencies", "devDependencies"]) { + for (const d of Object.keys(app[k])) if (/^@react-native(-community)?\//.test(d)) delete app[k][d]; + Object.assign(app[k], tpl[k]); + } + app.dependencies["react-dom"] = tpl.dependencies.react; + fs.writeFileSync(process.argv[1], JSON.stringify(app, null, 2) + "\n"); + ' package.json "$tmp/app/package.json" + + local java=android/app/src/main/java/opentelemetry/example + cp "$old/$java/OtelInit.kt" "$java/" + edit "$java/MainApplication.kt" 's/(super\.onCreate\(\)\n)/$1 startOtel()\n/' 'startOtel()' + mkdir -p android/app/src/main/res/xml + cp "$old/android/app/src/main/res/xml/network_security_config.xml" android/app/src/main/res/xml/ + edit android/app/src/main/AndroidManifest.xml \ + 's/(android:name="\.MainApplication")/$1\n android:networkSecurityConfig="\@xml\/network_security_config"/' \ + 'networkSecurityConfig' + edit android/build.gradle 's/minSdkVersion = \d+/minSdkVersion = 26/' 'minSdkVersion = 26' + { + echo + echo "// verify/nightly/app.sh: as in the committed example" + echo "android { defaultConfig { $(grep "buildConfigField.*OTEL_TEST_MODE" "$old/android/app/build.gradle" | sed 's/^ *//') } }" + sed -n '/^tasks.matching { it.name.startsWith("createBundle") }/,/^}/p' "$old/android/app/build.gradle" + } >> android/app/build.gradle + grep -qF 'inputs.files' android/app/build.gradle || die "bundle inputs not found in the committed app/build.gradle" + + local delegate=ios/OpenTelemetryExample/AppDelegate.swift + edit "$delegate" 's/\A/import ReactNativeOpenTelemetryCore\n/; s/(didFinishLaunchingWithOptions.*?-> Bool \{\n)/$1 startOtel()\n/s' \ + ' startOtel()' + sed -n '/^\/\/ otel-init:/,$p' "$old/$delegate" >> "$delegate" + grep -qF 'func startOtel()' "$delegate" || die "no '// otel-init:' section in the committed AppDelegate.swift" + cp "$old/ios/Podfile" ios/Podfile + edit ios/OpenTelemetryExample.xcodeproj/project.pbxproj \ + 's/PRODUCT_BUNDLE_IDENTIFIER = [^;]*;/PRODUCT_BUNDLE_IDENTIFIER = opentelemetry.example;/g' \ + 'PRODUCT_BUNDLE_IDENTIFIER = opentelemetry.example;' + rm -rf "$tmp" +} + +pack() { + local app=$1 tmp tgz + tmp=$(mktemp -d) + npm pack --pack-destination "$tmp" >/dev/null + tgz=$(ls "$tmp"/*.tgz) + echo "pack: $(basename "$tgz") -> $app" + (cd "$app" && bun add "$tgz") + # autolink and bundle the installed package, not the repo root + edit "$app/react-native.config.js" 's/^.*react-native-open-telemetry.*root:.*\n//m' 'react-native-test-native' + if grep -qF "'react-native-open-telemetry'" "$app/react-native.config.js"; then die "$app: still links the root"; fi + edit "$app/metro.config.js" \ + "s|require\('\.\./metro'\)|require('react-native-open-telemetry/metro')|; s/, 'react-native-open-telemetry': root//" \ + "require('react-native-open-telemetry/metro')" + if grep -qF "'react-native-open-telemetry': root" "$app/metro.config.js"; then die "$app: metro still maps the root"; fi + # the Core pod (R24) from the installed package, as an app using the npm package declares it + local pod="pod 'ReactNativeOpenTelemetryCore', :path => '../node_modules/react-native-open-telemetry'" + local file=$app/ios/Podfile + [ "$app" = example-expo ] && file=$app/plugins/withOtelExample.js + edit "$file" "s|pod 'ReactNativeOpenTelemetryCore', :path => '\.\./\.\.'|$pod|" "$pod" +} + +case "${1:-}" in + bare) [ -n "${2:-}" ] || die "usage: app.sh bare <rn-version>"; bare "$2" ;; + pack) [ "${2:-}" = example ] || [ "${2:-}" = example-expo ] || die "usage: app.sh pack example|example-expo"; pack "$2" ;; + *) die "usage: app.sh bare <rn-version> | pack example|example-expo" ;; +esac From 84723997bff160f7b53387912738e3e604c2165f Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 08:53:34 +0100 Subject: [PATCH 59/76] ci(nightly): verify the podspec bump; never cancel a real nightly Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- .github/workflows/scheduled.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index fa49262..2ef6575 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -22,7 +22,7 @@ permissions: concurrency: group: nightly-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.event_name == 'pull_request' }} # never cancel a real nightly env: E2E_TELEMETRY_DISABLED: '1' @@ -106,6 +106,7 @@ jobs: perl -0pi -e "s|($repo',\s*requirement: \{ kind: 'upToNextMinorVersion', minimumVersion: ')[\d.]+|\${1}$v|" \ ReactNativeOpenTelemetryCore.podspec grep -qF "$repo\", .upToNextMinor(from: \"$v\")" Package.swift || { echo "::error::Package.swift: $repo not bumped"; exit 1; } + grep -qF "minimumVersion: '$v'" ReactNativeOpenTelemetryCore.podspec || { echo "::error::podspec: $repo not bumped"; exit 1; } done # resolve the bumped Swift packages afresh rm -f example/ios/OpenTelemetryExample.xcworkspace/xcshareddata/swiftpm/Package.resolved From abcaff0ab6e5ecd9e7d197d3717d4eb15d99bfe0 Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 08:53:38 +0100 Subject: [PATCH 60/76] fix(ios): drop the module-map phase's declared output (collides with CocoaPods on RN 0.79) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- ReactNativeOpenTelemetry.podspec | 1 - 1 file changed, 1 deletion(-) diff --git a/ReactNativeOpenTelemetry.podspec b/ReactNativeOpenTelemetry.podspec index 27eae07..a24c888 100644 --- a/ReactNativeOpenTelemetry.podspec +++ b/ReactNativeOpenTelemetry.podspec @@ -25,7 +25,6 @@ Pod::Spec.new do |s| s.script_phase = { :name => 'Forward the core module map', :execution_position => :before_compile, - :output_files => [core_map], :always_out_of_date => '1', # no inputs: run every build on purpose (silences the Xcode warning) :script => %Q{set -e if [ -f "${PODS_CONFIGURATION_BUILD_DIR}/ReactNativeOpenTelemetryCore.modulemap" ]; then From e71c9b688ad4f367df2b2d4086bcf1f24ac53fcd Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 09:00:20 +0100 Subject: [PATCH 61/76] chore: release flow, migration guide and README for v0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- .changeset/config.json | 4 +- .changeset/v0-tracing-rewrite.md | 8 + .github/workflows/release.yml | 147 +++++++++++++++++ MIGRATION.md | 98 ++++++++++++ README.md | 249 ++++++++++++++++++++--------- app.plugin.js | 21 +++ package.json | 3 +- scripts/release-gate.js | 84 ++++++++++ verify/static/expoPlugin.test.ts | 13 ++ verify/static/packContents.test.ts | 2 +- verify/static/packContents.ts | 2 +- 11 files changed, 552 insertions(+), 79 deletions(-) create mode 100644 .changeset/v0-tracing-rewrite.md create mode 100644 .github/workflows/release.yml create mode 100644 MIGRATION.md create mode 100644 app.plugin.js create mode 100644 scripts/release-gate.js create mode 100644 verify/static/expoPlugin.test.ts diff --git a/.changeset/config.json b/.changeset/config.json index 66c1704..2be13d4 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,10 +1,10 @@ { "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json", "changelog": "@changesets/cli/changelog", - "commit": true, + "commit": false, "fixed": [], "linked": [], - "access": "restricted", + "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", "ignore": [] diff --git a/.changeset/v0-tracing-rewrite.md b/.changeset/v0-tracing-rewrite.md new file mode 100644 index 0000000..a157b6e --- /dev/null +++ b/.changeset/v0-tracing-rewrite.md @@ -0,0 +1,8 @@ +--- +"react-native-open-telemetry": minor +--- + +v0: a rewrite around one trace across JS and native. Native-first init (`RNOtel.start` on Android and iOS) with a JS +fallback (`startReactNativeSdk`), a context patch that carries the active span through `await`, promises and timers, +and `withOtel` helpers for Metro and Vite. Removed (breaking): metrics, fetch instrumentation, session tagging and +the `openTelemetrySDK` init. See MIGRATION.md. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2e6bde2 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,147 @@ +name: Release + +# Two gates, both checked through the GitHub API by scripts/release-gate.js, which fails closed (red, pending, missing +# or an API error all stop the job): +# - publish-next: after CI completes on a `main` push, and only if that commit's CI is green. Changesets opens the +# "version packages" PR while changesets are pending; once it is merged (and CI is green on the merge), it runs +# `changeset publish --tag next` (npm publish --tag next). Nothing ever publishes to `latest` directly. +# - promote (manual): moves a published version from `next` to `latest`, only if its release commit (tag v<version>) +# has a green `nightly` status (scheduled.yml's mark-nightly). Run the nightly on that commit first if needed: +# Actions -> Nightly -> Run workflow -> "Use workflow from" tag v<version>. +# Real publishing is first verified after merge to `main` (R28); until then only the dry run below has run. +on: + workflow_run: + workflows: [CI] + types: [completed] + branches: [main] + workflow_dispatch: + inputs: + promote: + description: 'Version to move from `next` to `latest` (e.g. 0.3.0). Empty: nothing to promote.' + type: string + default: '' + dry_run: + description: 'Dry run: evaluate the gates, version and pack; publish and promote nothing' + type: boolean + default: false + # TEMPORARY (R28): one forced dry run from the PR that adds this file; removed in the follow-up commit. + pull_request: + paths: + - .github/workflows/release.yml + +permissions: + contents: read + +concurrency: + group: release + cancel-in-progress: false + +env: + PACKAGE: react-native-open-telemetry + # A commit whose CI is red (a v0-impl PR run): the dry run proves the CI gate refuses it, live against the API. + KNOWN_RED_SHA: 78482b19a4537be8f05306744729b5a6db8b0d10 + # A commit whose CI is green: the positive control, so the refusal above is not a gate that always fails. + KNOWN_GREEN_SHA: d6d1af161ea6a6a1ee587aa858304f3aa6f2e5b3 + +jobs: + dry-run: + if: github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.dry_run) + runs-on: ubuntu-latest + timeout-minutes: 20 + permissions: + contents: read + actions: read + statuses: read + env: + GH_TOKEN: ${{ github.token }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '24' + - uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.2.19 + - run: node scripts/release-gate.js --self-test + - name: The CI gate refuses a red commit and passes a green one + run: | + if node scripts/release-gate.js ci "$KNOWN_RED_SHA"; then echo "::error::CI gate passed a red commit"; exit 1; fi + node scripts/release-gate.js ci "$KNOWN_GREEN_SHA" + - name: The promote gate refuses a commit without a green nightly + run: | + if node scripts/release-gate.js nightly "$KNOWN_RED_SHA"; then echo "::error::nightly gate passed"; exit 1; fi + - run: bun install --frozen-lockfile + - run: bun run prepare + - run: bunx changeset status --verbose + - name: Version (what the version PR would contain) + run: bun run version && git status --short && git diff -- package.json src/sdk/config.ts ios/RNOtel/RNOtel.swift + # `changeset publish` has no dry-run flag, so the dry run packs exactly what it would publish, with its dist-tag + - run: npm publish --dry-run --tag next --ignore-scripts + + publish-next: + if: >- + github.event_name == 'workflow_run' && github.event.workflow_run.event == 'push' && + github.event.workflow_run.conclusion == 'success' + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: write # the version PR branch and the v<version> tag + pull-requests: write # the version PR + actions: read # the CI gate + id-token: write # npm provenance + env: + SHA: ${{ github.event.workflow_run.head_sha }} + GH_TOKEN: ${{ github.token }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.workflow_run.head_sha }} + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: '24' + # the event says success; re-check through the API so a re-run or a stale event cannot publish a red commit + - run: node scripts/release-gate.js ci "$SHA" + - uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.2.19 + - run: bun install --frozen-lockfile + - uses: changesets/action@v1 + with: + version: bun run version + publish: bun run release + title: 'chore: version packages' + commit: 'chore: version packages' + env: + GITHUB_TOKEN: ${{ github.token }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_CONFIG_PROVENANCE: 'true' + + promote: + if: github.event_name == 'workflow_dispatch' && inputs.promote != '' && !inputs.dry_run + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + statuses: read # the nightly gate + env: + VERSION: ${{ inputs.promote }} + GH_TOKEN: ${{ github.token }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: '24' + registry-url: https://registry.npmjs.org + - name: Resolve the release commit + run: | + [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]] || { echo "::error::not a version: $VERSION"; exit 1; } + sha=$(git rev-list -n 1 "v$VERSION") # fails the step when the tag is missing + echo "SHA=$sha" >> "$GITHUB_ENV" + test "$(npm view "$PACKAGE@$VERSION" version)" = "$VERSION" + - run: node scripts/release-gate.js nightly "$SHA" + - run: npm dist-tag add "$PACKAGE@$VERSION" latest + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/MIGRATION.md b/MIGRATION.md new file mode 100644 index 0000000..c907f1a --- /dev/null +++ b/MIGRATION.md @@ -0,0 +1,98 @@ +# Migrating from 0.2 to v0 (0.3.0) + +v0 is a rewrite. It keeps tracing, and JS and native spans now share one trace. It removes everything else that 0.2 +had. The version stays in 0.x (0.2.0 → 0.3.0), but expect breaking changes. + +| 0.2 | v0 | +| --- | --- | +| `openTelemetrySDK(options)` (JS) | `startReactNativeSdk(config)`. See [Init](#init) | +| Android `com.opentelemetry.OpenTelemetry.init(this) { … }` | `com.callstack.otel.RNOtel.start(this) { … }` | +| iOS: JS only | `RNOtel.start { c in … }` in `AppDelegate` (native-first), or the JS init | +| Metrics (JS `sdk.metrics.getMeter`, Android `getMeter`) | **Removed.** Returns in v1 | +| Fetch instrumentation (automatic) | **Removed.** Network instrumentation returns in v1 | +| Session tagging (`features.session.getSessionId`) | **Removed.** Sessions return in v1. Interim: your own `SpanProcessor` (below) | +| `debug: true` (console exporters) | Pass a console exporter in `spanProcessors` (below) | +| W3C trace-context + baggage propagators registered globally | Not registered. Register one yourself if you inject headers | + +## New requirements + +- React Native 0.79+, New Architecture, Hermes, and the peer `react-native-nitro-modules` ~0.37. +- iOS: add `pod 'ReactNativeOpenTelemetryCore', :path => '../node_modules/react-native-open-telemetry'` to the + Podfile. On Expo, add the `"react-native-open-telemetry"` config plugin instead. See the [README](README.md#install). +- Android: minSdk 26. +- Metro: wrap the merged config with `withOtel` from `react-native-open-telemetry/metro`. Vite (7 and older): + `withOtel` from `react-native-open-telemetry/vite`. Without it, context is lost after `await`. + +## Init + +```ts +// 0.2 +import {openTelemetrySDK} from 'react-native-open-telemetry'; +const api = openTelemetrySDK({url, name: 'shop', version: '1.4.0', environment: 'prod', debug: true}); +const tracer = api.trace.getTracer('app'); + +// v0 +import {trace} from '@opentelemetry/api'; +import {startReactNativeSdk} from 'react-native-open-telemetry'; +const {forceFlush, shutdown} = startReactNativeSdk({ + serviceName: 'shop', + serviceVersion: '1.4.0', + resourceAttributes: {'deployment.environment.name': 'prod'}, + exportConfig: {url, headers: {}}, +}); +const tracer = trace.getTracer('app'); +``` + +| 0.2 option | v0 | +| --- | --- | +| `name` / `version` | `serviceName` / `serviceVersion` | +| `environment` | `resourceAttributes: {'deployment.environment.name': …}`. 0.2 Android wrote it as `environment` | +| `url` | `exportConfig.url` (JS) or `export { url }` (native). It is the OTLP **HTTP** base URL (usually port 4318); `/v1/traces` is appended unless already there. 0.2 Android exported gRPC (4317); v0 sends OTLP/HTTP protobuf everywhere | +| `native` | Gone. Init natively with `RNOtel.start` instead. JS then attaches to it | +| return value (the `@opentelemetry/api` module) | `{tracerProvider, forceFlush, shutdown}`. Import `@opentelemetry/api` yourself | + +0.2 also set `os.name`/`os.version` from `Platform`. On mobile, v0 builds the resource natively (service attributes, +your `resourceAttributes`, the otel SDK defaults and `telemetry.distro.*`). Pass anything else in +`resourceAttributes`. + +On Android, the native call changes shape: + +```kotlin +// 0.2 +OpenTelemetry.init(this) { url = "https://collector:4317"; name = "shop"; version = "1.0.0"; environment = "prod" } + +// v0 +RNOtel.start(this) { + serviceName = "shop"; serviceVersion = "1.0.0" + resourceAttributes = mapOf("deployment.environment.name" to "prod") + export { url = "https://collector:4318" } +} +``` + +v0 does not set `GlobalOpenTelemetry`. For native spans, use `RNOtel.tracer(name)`. + +## Interim replacements + +These snippets use upstream OpenTelemetry APIs only. This package does not test them. + +**Console output** (was `debug: true`): + +```ts +import {SimpleSpanProcessor, ConsoleSpanExporter} from '@opentelemetry/sdk-trace'; +startReactNativeSdk({/* … */, spanProcessors: [new SimpleSpanProcessor(new ConsoleSpanExporter())]}); +``` + +**Session id** (was `features.session`). This covers JS spans only. Native spans get sessions in v1. + +```ts +const sessionProcessor = { + onStart: span => { const id = getSessionId(); if (id) span.setAttribute('session.id', id); }, + onEnd() {}, forceFlush: () => Promise.resolve(), shutdown: () => Promise.resolve(), +}; +startReactNativeSdk({/* … */, spanProcessors: [sessionProcessor]}); +``` + +**Fetch spans:** v1 brings network instrumentation for XHR and native OkHttp/URLSession. Until then, you can register +upstream `@opentelemetry/instrumentation-fetch` yourself against the global tracer provider. + +**Metrics:** v1. Until then, run `@opentelemetry/sdk-metrics` with its own exporter next to this SDK. diff --git a/README.md b/README.md index 12c0062..b94b3cd 100644 --- a/README.md +++ b/README.md @@ -1,112 +1,213 @@ # react-native-open-telemetry -Best in class observability brought to React Native. +OpenTelemetry tracing for React Native (iOS, Android) and web. JS spans and native spans share one trace and +export together over OTLP/HTTP to any OTLP backend. -* **OpenTelemetry** is a collection of APIs, SDKs, and tools developed by [OpenTelemetry](https://github.com/open-telemetry) to instrument, generate, collect, and export telemetry data. See [What is OpenTelemetry](https://opentelemetry.io/docs/what-is-opentelemetry/) for more information. -* **react-native-open-telemetry** is a library that allows you to easily use **OpenTelemetry's** JS and Native bindings inside your React Native app. +v0 is tracing only. If you used 0.x, read [MIGRATION.md](MIGRATION.md) first. -## Features +## Requirements -* **Telemetry without lock-in**. Send to **any OTLP compliant backend** including [vendors](https://opentelemetry.io/ecosystem/vendors/) -* [**Tracing** API](https://opentelemetry.io/docs/specs/otel/trace/api/) -* [**Metrics** API](https://opentelemetry.io/docs/specs/otel/metrics/api/) -* **Web**, **Android** (experimental) support with **iOS** coming soon -* Automatic **fetch instrumentation** -* Automatic **session tagging** +- React Native **0.79+**, New Architecture, Hermes +- `react-native-nitro-modules` **~0.37** +- iOS: Xcode **27.0+** +- Android: minSdk **26** -## Platform support +## Install -| Platform | Support | -| --- | --- | -| **web** | ☑️ Stable | -| **android** | ☑️ Stable JS with experimental Native 🏗️ | -| **ios** | ☑️ Stable JS with planned Native 👀 | +```sh +npm install react-native-open-telemetry react-native-nitro-modules +``` -## Installation +### iOS (bare) -```sh -npm install react-native-open-telemetry +Autolinking links only the Nitro adapter pod. Add the core pod to your app target in `ios/Podfile` yourself, then run +`pod install`: + +```ruby +target 'MyApp' do + pod 'ReactNativeOpenTelemetryCore', :path => '../node_modules/react-native-open-telemetry' + # ... +end ``` -## Usage +### Expo (prebuild / CNG) -### 1. Start the JS SDK +Expo regenerates the Podfile, so the package ships a config plugin that adds that one line: -See OpenTelemetry's JS documentation on [Traces](https://opentelemetry.io/docs/languages/js/instrumentation/#acquiring-a-tracer) and [Metrics](https://opentelemetry.io/docs/languages/js/instrumentation/#acquiring-a-meter) for more information on available APIs. +```json +{ "expo": { "plugins": ["react-native-open-telemetry"] } } +``` -```js -import { openTelemetrySDK } from 'react-native-open-telemetry'; - -// Start the SDK -const sdk = openTelemetrySDK({ - debug: true, - url: "https://my-collector.com:4317", - name: "my-app", - version: "1.0.0-alpha", - environment: "development", -}); +That is all the plugin does. Expo apps usually init from JS (below). -// Use available APIs -const meter = sdk.metrics.getMeter("my-js-meter", "1.0"); +### Android -const promoCounter = meter.createCounter("my-promo-counter", { - description: "A counter metric for my promo section" -}); +Nothing to add. The library's R8 consumer rules ship with it and apply automatically. + +## Init + +### Native-first (preferred) -function App() { - function onPress() { - promoCounter.add(1); +Start the SDK in native code, before React Native, so you can trace from the very start of the app. On Android it +does nothing outside the main process. It never throws: on bad config it logs one error and telemetry stays off. + +```kotlin +// android: MainApplication.onCreate, before loadReactNative(this) +import com.callstack.otel.RNOtel + +RNOtel.start(this) { + serviceName = "shop" + serviceVersion = BuildConfig.VERSION_NAME + resourceAttributes = mapOf("deployment.environment.name" to "prod") + export { + url = "https://collector.example.com:4318" + headers = mapOf("x-api-key" to KEY) } +} +``` + +```swift +// ios: AppDelegate, application(_:didFinishLaunchingWithOptions:), before React Native starts +import ReactNativeOpenTelemetryCore - return <Button title="Press me" onPress={onPress} /> +RNOtel.start { c in + c.serviceName = "shop" + c.serviceVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String + c.export = .init(url: "https://collector.example.com:4318", headers: ["x-api-key": KEY]) } ``` -### 2. Start the native SDK (optional) 🚧 +Then call `startReactNativeSdk()` in JS too. It attaches to the native SDK. If you pass an `exportConfig`, it is +ignored and you get one warning. + +### JS (fallback on mobile, the only init on web) -> [!IMPORTANT] -> This section is considered **highly experimental**. -> There's currently no support for bidirectional JS/Native communication and the `native` feature flag only marks an API that will become available. +If no native init ran, as in an Expo app without native code, `startReactNativeSdk` starts native itself. You lose +only the spans from before JS starts. -**Android** +```ts +// index.js, before the app is registered +import {startReactNativeSdk} from 'react-native-open-telemetry'; -See OpenTelemetry's Android documentation on [Traces](https://opentelemetry.io/docs/languages/java/api/#tracerprovider) and [Metrics](https://opentelemetry.io/docs/languages/java/api/#meterprovider) for more information on available APIs. +const {tracerProvider, forceFlush, shutdown} = startReactNativeSdk({ + serviceName: 'shop', + serviceVersion: '1.4.0', + resourceAttributes: {'deployment.environment.name': 'prod'}, + exportConfig: {url: 'https://collector.example.com:4318', headers: {'x-api-key': KEY}}, + spanProcessors: [/* stock @opentelemetry/sdk-trace SpanProcessors, optional */], +}); +``` -```kt -import com.opentelemetry.OpenTelemetry +The returned `tracerProvider` is registered globally, so `trace.getTracer(...)` from `@opentelemetry/api` works. On +mobile, `shutdown()` stops only the JS provider, never the native one. A missing or invalid config logs one error +and returns a no-op handle. The SDK never throws into your app. -class MainApplication : Application(), ReactApplication { - override fun onCreate() { - super.onCreate() +### Endpoint - // Start the SDK - OpenTelemetry.init(this) { - debug = true - url = "https://my-collector.com:4317" - name = "my-app" - version = "1.0.0" - environment = "production" - } +`url` (`exportConfig.url` in JS, `export.url` natively) is the OTLP base URL. `/v1/traces` is appended unless the URL +already ends with it, so `https://host:4318` and `https://vendor.example/v1/traces` both work. It works the same on +Android, iOS and web. URLs with a query string are not supported. - // .. +## Bundler helpers - // Use available APIs - val sdk = OpenTelemetry.get() - val meter = sdk.getMeter("native-scope-name") - val counter = meter.counterBuilder("native-counter").build() - counter.add(14) - } -} +The context patch has to run before any app module, and web bundles must not use native `async`. + +**Metro** (`metro.config.js`): wrap the **merged** config. If you wrap only your own config, React Native's default +`InitializeCore` entry is dropped. + +```js +const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); // Expo: expo/metro-config +const {withOtel} = require('react-native-open-telemetry/metro'); + +const config = {/* yours */}; +module.exports = withOtel(mergeConfig(getDefaultConfig(__dirname), config)); +``` + +**Vite** (`vite.config.*`), for **Vite 7 and older only**. Vite 8 (Rolldown/Oxc) is not supported. + +```ts +import {withOtel} from 'react-native-open-telemetry/vite'; +export default withOtel(defineConfig({plugins: [react()]})); ``` +`withOtel` compiles `async`/`await` down for the app and its pre-bundled dependencies, and runs the SDK setup first. +Without it, the startup probe logs a warning and marks the JS tracers with `com.callstack.context.degraded=true`. +Parents are then lost after `await`, but never wrong. + +## Native helpers and crossing the boundary + +Both platforms expose the same small API next to `start`: + +| | Android (`com.callstack.otel.RNOtel`) | iOS (`RNOtel`) | +| --- | --- | --- | +| Tracer on the native provider (no-op before init) | `RNOtel.tracer(name, version?)` | `RNOtel.tracer(name, version:)` | +| W3C `traceparent` → parent (invalid → root) | `RNOtel.contextFrom(traceparent)` → `Context` | `RNOtel.contextFrom(traceparent:)` → `SpanContext?` | +| Span → `traceparent` | `RNOtel.traceparentOf(span)` | `RNOtel.traceparentOf(span)` | + +JS → native: pass the active span's `traceparent` to your native module, and parent the native span with +`contextFrom`: + +```ts +const {traceId, spanId, traceFlags} = span.spanContext(); +MyNative.doWork(`00-${traceId}-${spanId}-${traceFlags.toString(16).padStart(2, '0')}`); +``` + +```kotlin +RNOtel.tracer("my.module").spanBuilder("native.work").setParent(RNOtel.contextFrom(traceparent)).startSpan() +``` + +```swift +let b = RNOtel.tracer("my.module").spanBuilder(spanName: "native.work") +if let parent = RNOtel.contextFrom(traceparent: traceparent) { b.setParent(parent) } else { b.setNoParent() } +``` + +Native → JS: return `RNOtel.traceparentOf(span)`, and start the JS span under it: + +```ts +const [, traceId, spanId, flags] = MyNative.doWork().split('-'); +const parent = trace.wrapSpanContext({traceId, spanId, traceFlags: parseInt(flags, 16), isRemote: false}); +context.with(trace.setSpan(context.active(), parent), () => tracer.startSpan('js.after_native').end()); +``` + +## Context guarantees + +The active context carries through `await`, promise chains (`then`/`catch`/`finally`), `setTimeout`, +`setImmediate`, `queueMicrotask` and `requestAnimationFrame`. **No span gets a wrong parent through `await`, promise +or timer flows.** A callback that runs after its parent ended is still attached to that parent. + +Documented exceptions: + +- **Shared queues.** A queue that is flushed once runs everyone's work in the context of whoever enqueued first: + React's scheduler and batching, debounce/throttle helpers, store notifiers. Those spans can get the wrong parent. + Bind the context yourself with `context.bind(ctx, fn)` or `context.with(...)` from `@opentelemetry/api`. +- **`setInterval`.** Ticks run in `ROOT_CONTEXT`, so each tick's spans start a new trace. They do not join the trace + that registered the interval, and v0 adds no link back to it. +- **Code that captured `Promise.prototype.then` before the patch ran** (before the Metro/Vite helper's setup) runs + at ROOT and loses its parent. It never gets a wrong one. +- **Native `async`** (a web bundle without the Vite helper, a future Hermes that keeps `async`) loses parents after + `await`. The startup probe detects this and sets `com.callstack.context.degraded=true` on the JS tracers' scope. + +## Known limits (v0) + +- **iOS OTLP:** the opentelemetry-swift encoder never writes span `flags`, span `traceState`, link `flags`/`traceState` + or the scope `schemaUrl`. +- **iOS times** are quantized to about 240 ns, because opentelemetry-swift stores them as `Date`. +- **iOS `TRACEPARENT`:** opentelemetry-swift reads a `TRACEPARENT` environment variable and makes it the parent of + every root span. Do not launch the app with it set. +- `requestIdleCallback` is not patched. +- `InteractionManager` has no coverage: React Native 0.88 removed it. +- **Web:** the flush on browser `pagehide` is not tested. +- **React Native 0.79 on iOS** does not build with Xcode 27 yet. Use a newer React Native on iOS for now. + +## Verification + +Every guarantee above is a scenario with expected OTLP output, checked on Android, iOS and web. See +[verify/VERIFY.md](verify/VERIFY.md). + ## Contributing -See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow. +See the [contributing guide](CONTRIBUTING.md). ## License MIT - ---- - -Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob) diff --git a/app.plugin.js b/app.plugin.js new file mode 100644 index 0000000..b66161a --- /dev/null +++ b/app.plugin.js @@ -0,0 +1,21 @@ +// Expo config plugin: `"plugins": ["react-native-open-telemetry"]`. It does one thing. Autolinking links one podspec per +// package (the Nitro adapter), and the adapter needs the pure Swift core pod beside it, so this adds +// `pod 'ReactNativeOpenTelemetryCore'` to the generated Podfile. Bare apps add the same line by hand (README). +const path = require('path'); + +const POD = "pod 'ReactNativeOpenTelemetryCore'"; + +/** Adds the core pod to the first app target; idempotent. */ +function addCorePod(podfile, podPath) { + if (podfile.includes(POD)) return podfile; + const out = podfile.replace(/^(target '.+' do\n)/m, `$1 ${POD}, :path => '${podPath}'\n`); + if (out === podfile) throw new Error('react-native-open-telemetry: no `target ... do` in the Podfile; add the core pod by hand'); + return out; +} + +module.exports = config => + require('expo/config-plugins').withPodfile(config, c => { + c.modResults.contents = addCorePod(c.modResults.contents, path.relative(c.modRequest.platformProjectRoot, __dirname)); + return c; + }); +module.exports.addCorePod = addCorePod; diff --git a/package.json b/package.json index fc6f0d5..d4fc23f 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "nitro.json", "metro", "vite", + "app.plugin.js", "!ios/build", "!android/build", "!android/core-jvm", @@ -78,7 +79,7 @@ "test": "NODE_OPTIONS=--experimental-vm-modules jest", "prepare": "bunx bob build && (git config core.hooksPath .githooks || true)", "version": "bunx changeset version && node scripts/sync-distro-version.js", - "publish": "bunx changeset publish" + "release": "bunx changeset publish --tag next" }, "dependencies": { "@opentelemetry/api": "~1.10.0", diff --git a/scripts/release-gate.js b/scripts/release-gate.js new file mode 100644 index 0000000..275a8c8 --- /dev/null +++ b/scripts/release-gate.js @@ -0,0 +1,84 @@ +// Release gates (Task 32), used by .github/workflows/release.yml: +// node scripts/release-gate.js ci <sha> the newest CI (ci.yml) run for the commit completed with success +// node scripts/release-gate.js nightly <sha> the newest `nightly` commit status (scheduled.yml) is success +// node scripts/release-gate.js --self-test the gates against canned API answers, no network +// Fails closed: exit 0 only when the commit is green; red, pending, missing, an unknown gate or an API error exit 1. +// Env: GITHUB_REPOSITORY (owner/name), GH_TOKEN or GITHUB_TOKEN. +const assert = require('assert'); + +const gates = { + async ci(repo, sha, get) { + const {workflow_runs: runs} = await get(`/repos/${repo}/actions/workflows/ci.yml/runs?head_sha=${sha}&per_page=100`); + if (!runs?.length) return `no CI run for ${sha}`; + const newest = runs.reduce((a, b) => (Date.parse(b.created_at) > Date.parse(a.created_at) ? b : a)); + if (newest.status !== 'completed' || newest.conclusion !== 'success') + return `CI run ${newest.id} for ${sha} is ${newest.status}/${newest.conclusion}`; + return null; + }, + async nightly(repo, sha, get) { + const statuses = await get(`/repos/${repo}/commits/${sha}/statuses?per_page=100`); + const newest = statuses.find(s => s.context === 'nightly'); // the API lists newest first + if (!newest) return `no nightly status on ${sha}`; + if (newest.state !== 'success') return `nightly status on ${sha} is ${newest.state}`; + return null; + }, +}; + +/** Returns null when the gate passes, else why not. Never throws. */ +async function check(gate, repo, sha, get) { + try { + if (!gates[gate]) return `unknown gate ${gate}`; + if (!repo || !/^[0-9a-f]{40}$/.test(sha ?? '')) return `need GITHUB_REPOSITORY and a full commit SHA, got ${repo} ${sha}`; + return await gates[gate](repo, sha, get); + } catch (e) { + return `${gate} gate errored: ${e.message}`; + } +} + +function githubGet(token) { + return async path => { + const res = await fetch('https://api.github.com' + path, { + headers: {accept: 'application/vnd.github+json', ...(token && {authorization: `Bearer ${token}`})}, + }); + if (!res.ok) throw new Error(`GET ${path}: HTTP ${res.status}`); + return res.json(); + }; +} + +async function selfTest() { + const sha = 'a'.repeat(40); + const run = (conclusion, created_at = '2026-01-01T00:00:00Z', status = 'completed') => ({id: 1, status, conclusion, created_at}); + const ci = runs => check('ci', 'o/r', sha, async () => ({workflow_runs: runs})); + const nightly = statuses => check('nightly', 'o/r', sha, async () => statuses); + assert.equal(await ci([run('success')]), null); + assert.ok(await ci([run('failure')]), 'red CI must not pass'); + assert.ok(await ci([run('cancelled')]), 'cancelled CI must not pass'); + assert.ok(await ci([run(null, undefined, 'in_progress')]), 'pending CI must not pass'); + assert.ok(await ci([]), 'no CI run must not pass'); + assert.ok(await ci([run('success'), run('failure', '2026-01-02T00:00:00Z')]), 'a newer red run wins'); + assert.equal(await ci([run('failure'), run('success', '2026-01-02T00:00:00Z')]), null, 'a newer green re-run wins'); + assert.equal(await nightly([{context: 'nightly', state: 'success'}]), null); + assert.ok(await nightly([{context: 'nightly', state: 'failure'}, {context: 'nightly', state: 'success'}]), 'newest nightly wins'); + assert.ok(await nightly([{context: 'ci', state: 'success'}]), 'no nightly status must not pass'); + const boom = async () => { throw new Error('HTTP 502'); }; + assert.ok(await check('ci', 'o/r', sha, boom), 'API error must not pass'); + assert.ok(await check('nightly', 'o/r', sha, boom), 'API error must not pass'); + assert.ok(await check('ci', 'o/r', 'main', boom), 'a ref is not a SHA'); + assert.ok(await check('latest', 'o/r', sha, boom), 'unknown gate must not pass'); + console.log('release-gate self-test: ok'); +} + +async function main([gate, sha]) { + if (gate === '--self-test') return selfTest(); + const why = await check(gate, process.env.GITHUB_REPOSITORY, sha, githubGet(process.env.GH_TOKEN || process.env.GITHUB_TOKEN)); + if (why) { + console.error(`release-gate: ${why}`); + process.exit(1); + } + console.log(`release-gate: ${gate} green for ${sha}`); +} + +main(process.argv.slice(2)).catch(e => { + console.error(e); + process.exit(1); +}); diff --git a/verify/static/expoPlugin.test.ts b/verify/static/expoPlugin.test.ts new file mode 100644 index 0000000..7c5a233 --- /dev/null +++ b/verify/static/expoPlugin.test.ts @@ -0,0 +1,13 @@ +const {addCorePod} = require('../../app.plugin'); + +const podfile = "platform :ios, '15.1'\n\ntarget 'App' do\n use_expo_modules!\nend\n"; + +test('adds the core pod to the app target, once', () => { + const out = addCorePod(podfile, '../node_modules/react-native-open-telemetry'); + expect(out).toContain("target 'App' do\n pod 'ReactNativeOpenTelemetryCore', :path => '../node_modules/react-native-open-telemetry'\n"); + expect(addCorePod(out, 'x')).toBe(out); +}); + +test('throws when there is no target to add it to', () => { + expect(() => addCorePod("platform :ios, '15.1'\n", 'x')).toThrow(/by hand/); +}); diff --git a/verify/static/packContents.test.ts b/verify/static/packContents.test.ts index 5cb86e5..b09ec53 100644 --- a/verify/static/packContents.test.ts +++ b/verify/static/packContents.test.ts @@ -1,6 +1,6 @@ import {packContents} from './packContents'; -const complete = ['package.json', 'lib/module/index.js', 'src/index.ts', 'nitrogen/generated/x.hpp', 'metro/index.js', 'vite/index.js', 'android/build.gradle', 'ios/Adapter/HybridOtel.swift', 'Package.swift', 'ReactNativeOpenTelemetry.podspec', 'ReactNativeOpenTelemetryCore.podspec']; +const complete = ['package.json', 'lib/module/index.js', 'src/index.ts', 'nitrogen/generated/x.hpp', 'metro/index.js', 'vite/index.js', 'android/build.gradle', 'ios/Adapter/HybridOtel.swift', 'Package.swift', 'ReactNativeOpenTelemetry.podspec', 'ReactNativeOpenTelemetryCore.podspec', 'app.plugin.js']; test('reports missing nitrogen/', () => { expect(packContents(complete.filter(p => !p.startsWith('nitrogen/')))).toEqual(['nitrogen/']); diff --git a/verify/static/packContents.ts b/verify/static/packContents.ts index c91da69..e5bfb17 100644 --- a/verify/static/packContents.ts +++ b/verify/static/packContents.ts @@ -1,4 +1,4 @@ -export const REQUIRED = ['package.json', 'lib/', 'src/', 'nitrogen/', 'metro/', 'vite/', 'android/', 'ios/', 'Package.swift', 'ReactNativeOpenTelemetry.podspec', 'ReactNativeOpenTelemetryCore.podspec']; +export const REQUIRED = ['package.json', 'lib/', 'src/', 'nitrogen/', 'metro/', 'vite/', 'android/', 'ios/', 'Package.swift', 'ReactNativeOpenTelemetry.podspec', 'ReactNativeOpenTelemetryCore.podspec', 'app.plugin.js']; /** Returns the required paths missing from the `npm pack --dry-run --json` file list. */ export function packContents(list: string[], required: string[] = REQUIRED): string[] { From fe8d5bed24ba2de036004a9a6930048474989cbc Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 09:08:37 +0100 Subject: [PATCH 62/76] chore: release flow fixes (gates, promote, docs) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- .github/workflows/release.yml | 31 ++++++++++++++++++++++++------- CONTRIBUTING.md | 31 ++++++++++++++++++++++++++++--- MIGRATION.md | 13 +++++++++---- README.md | 22 +++++++++++++++++----- scripts/release-gate.js | 33 ++++++++++++++++++++++++++------- 5 files changed, 104 insertions(+), 26 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2e6bde2..3d5887d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,9 +5,12 @@ name: Release # - publish-next: after CI completes on a `main` push, and only if that commit's CI is green. Changesets opens the # "version packages" PR while changesets are pending; once it is merged (and CI is green on the merge), it runs # `changeset publish --tag next` (npm publish --tag next). Nothing ever publishes to `latest` directly. -# - promote (manual): moves a published version from `next` to `latest`, only if its release commit (tag v<version>) -# has a green `nightly` status (scheduled.yml's mark-nightly). Run the nightly on that commit first if needed: +# - promote (manual, from `main`): moves a published version from `next` to `latest`, only if its release commit +# (tag v<version>) has a green `nightly` status from a successful scheduled.yml run (mark-nightly), and the version +# is not lower than the current `latest`. Run the nightly on that commit first if needed: # Actions -> Nightly -> Run workflow -> "Use workflow from" tag v<version>. +# Both publishing jobs run in the `npm` environment, which holds NPM_TOKEN (a granular, publish-only token). Setup and +# caveats (the version PR gets no CI): CONTRIBUTING.md "Publishing to npm". # Real publishing is first verified after merge to `main` (R28); until then only the dry run below has run. on: workflow_run: @@ -32,8 +35,9 @@ on: permissions: contents: read +# per event: a dry run or a promote never queues behind or replaces a pending publish-next concurrency: - group: release + group: release-${{ github.event_name }} cancel-in-progress: false env: @@ -56,6 +60,8 @@ jobs: GH_TOKEN: ${{ github.token }} steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # all branches: changeset status compares against origin/main - uses: actions/setup-node@v4 with: node-version: '24' @@ -72,7 +78,7 @@ jobs: if node scripts/release-gate.js nightly "$KNOWN_RED_SHA"; then echo "::error::nightly gate passed"; exit 1; fi - run: bun install --frozen-lockfile - run: bun run prepare - - run: bunx changeset status --verbose + - run: bunx changeset status --verbose --since=origin/main - name: Version (what the version PR would contain) run: bun run version && git status --short && git diff -- package.json src/sdk/config.ts ios/RNOtel/RNOtel.swift # `changeset publish` has no dry-run flag, so the dry run packs exactly what it would publish, with its dist-tag @@ -84,6 +90,7 @@ jobs: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest timeout-minutes: 30 + environment: npm permissions: contents: write # the version PR branch and the v<version> tag pull-requests: write # the version PR @@ -112,18 +119,23 @@ jobs: publish: bun run release title: 'chore: version packages' commit: 'chore: version packages' + createGithubReleases: false # `latest` is promote's call, not the publish's env: GITHUB_TOKEN: ${{ github.token }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: 'true' promote: - if: github.event_name == 'workflow_dispatch' && inputs.promote != '' && !inputs.dry_run + if: >- + github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' && + inputs.promote != '' && !inputs.dry_run runs-on: ubuntu-latest timeout-minutes: 10 + environment: npm permissions: contents: read - statuses: read # the nightly gate + statuses: read # the nightly gate: the status + actions: read # the nightly gate: the scheduled.yml run it links env: VERSION: ${{ inputs.promote }} GH_TOKEN: ${{ github.token }} @@ -137,10 +149,15 @@ jobs: registry-url: https://registry.npmjs.org - name: Resolve the release commit run: | - [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]] || { echo "::error::not a version: $VERSION"; exit 1; } + # x.y.z only: a prerelease never becomes `latest`, and sort -V orders plain versions correctly + [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "::error::not a release version: $VERSION"; exit 1; } sha=$(git rev-list -n 1 "v$VERSION") # fails the step when the tag is missing echo "SHA=$sha" >> "$GITHUB_ENV" test "$(npm view "$PACKAGE@$VERSION" version)" = "$VERSION" + latest=$(npm view "$PACKAGE" dist-tags.latest) + if [ "$(printf '%s\n' "$latest" "$VERSION" | sort -V | tail -n 1)" != "$VERSION" ]; then + echo "::error::$VERSION is lower than latest $latest"; exit 1 + fi - run: node scripts/release-gate.js nightly "$SHA" - run: npm dist-tag add "$PACKAGE@$VERSION" latest env: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 32303fa..2bfec6c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -77,9 +77,34 @@ We follow the [conventional commits specification](https://www.conventionalcommi We use [TypeScript](https://www.typescriptlang.org/) for type checking and [OXLint](https://oxc.rs/docs/guide/usage/linter.html) for linting and formatting the code. -### Publishing to npm 🚧 - -We use [changesets](https://github.com/changesets/changesets) for managing versions, though this is a manual process for now in the experimental phase. +### Publishing to npm + +We use [changesets](https://github.com/changesets/changesets), automated by `.github/workflows/release.yml`. Never run +`changeset publish` or `npm publish` locally. + +1. Add a changeset (`bunx changeset`) in your PR. +2. When CI is green on a `main` push, `publish-next` re-checks that CI result through the API + (`scripts/release-gate.js`). It then opens or updates the "chore: version packages" PR. +3. After that PR is merged and CI is green on the merge, it publishes with `npm publish --tag next` and pushes the + `v<version>` tag. It creates no GitHub Release. +4. To make a version `latest`: + - Run Nightly on its tag: Actions → Nightly → Run workflow, "Use workflow from" `v<version>`. + - Then run Release from `main` with `promote=<version>`. + - It refuses a commit without a green nightly run, and a version lower than the current `latest`. + +Setup and caveats: + +- **`npm` environment.** Create an environment named `npm` (Settings → Environments). Store `NPM_TOKEN` there as an + environment secret. Use a granular access token limited to publishing this package. Both publishing jobs run in this + environment, so required reviewers on it gate them too. +- **Allow the version PR.** Enable Settings → Actions → General → "Allow GitHub Actions to create and approve pull + requests". Without it, the version PR cannot be opened. +- **The version PR gets no CI.** Events from `GITHUB_TOKEN` don't trigger workflows, so CI does not run on the + version PR. To get CI on it: + - close and reopen the PR, or push an empty commit to its branch yourself; + - or give the action a GitHub App or fine-grained PAT token in place of `GITHUB_TOKEN`. + + The merge to `main` runs CI either way, and `publish-next` publishes only after that run is green. ### Scripts diff --git a/MIGRATION.md b/MIGRATION.md index c907f1a..5169bc4 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -20,8 +20,11 @@ had. The version stays in 0.x (0.2.0 → 0.3.0), but expect breaking changes. - iOS: add `pod 'ReactNativeOpenTelemetryCore', :path => '../node_modules/react-native-open-telemetry'` to the Podfile. On Expo, add the `"react-native-open-telemetry"` config plugin instead. See the [README](README.md#install). - Android: minSdk 26. -- Metro: wrap the merged config with `withOtel` from `react-native-open-telemetry/metro`. Vite (7 and older): - `withOtel` from `react-native-open-telemetry/vite`. Without it, context is lost after `await`. +- Metro: wrap the merged config with `withOtel` from `react-native-open-telemetry/metro`. It runs the context patch + before any app module. Without it, the patch installs at the package import, and only code that runs before that + import loses parents. +- Vite (7 and older): `withOtel` from `react-native-open-telemetry/vite`. It also compiles `async` down. Without it, + context is lost after a native `await`. ## Init @@ -46,7 +49,7 @@ const tracer = trace.getTracer('app'); | 0.2 option | v0 | | --- | --- | | `name` / `version` | `serviceName` / `serviceVersion` | -| `environment` | `resourceAttributes: {'deployment.environment.name': …}`. 0.2 Android wrote it as `environment` | +| `environment` | `resourceAttributes: {'deployment.environment.name': …}`. 0.2 JS defaulted it to `process.env.NODE_ENV`; v0 sets no default, so pass it yourself. 0.2 Android wrote it as `environment` (default `development`) | | `url` | `exportConfig.url` (JS) or `export { url }` (native). It is the OTLP **HTTP** base URL (usually port 4318); `/v1/traces` is appended unless already there. 0.2 Android exported gRPC (4317); v0 sends OTLP/HTTP protobuf everywhere | | `native` | Gone. Init natively with `RNOtel.start` instead. JS then attaches to it | | return value (the `@opentelemetry/api` module) | `{tracerProvider, forceFlush, shutdown}`. Import `@opentelemetry/api` yourself | @@ -69,7 +72,9 @@ RNOtel.start(this) { } ``` -v0 does not set `GlobalOpenTelemetry`. For native spans, use `RNOtel.tracer(name)`. +v0 does not set `GlobalOpenTelemetry`. For native spans, use `RNOtel.tracer(name)`. 0.2's Android `debug` (on by +default, through otel-java's logging exporters) is gone, and v0 has no native console exporter. Use the JS console +processor below for JS spans, or point the export at a local Collector with the `debug` exporter. ## Interim replacements diff --git a/README.md b/README.md index b94b3cd..3c5fb18 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,8 @@ Android, iOS and web. URLs with a query string are not supported. ## Bundler helpers -The context patch has to run before any app module, and web bundles must not use native `async`. +The context patch must run before any app module. Web bundles also must not use native `async`, which the patch cannot +see through. **Metro** (`metro.config.js`): wrap the **merged** config. If you wrap only your own config, React Native's default `InitializeCore` entry is dropped. @@ -123,6 +124,10 @@ const config = {/* yours */}; module.exports = withOtel(mergeConfig(getDefaultConfig(__dirname), config)); ``` +Metro's `withOtel` only orders the setup: it runs the patch before any app module. React Native's Babel preset already +compiles `async` down. Without the helper, the patch still installs when your code imports the package. Only code +that ran before that import, such as React's scheduler capturing timers, loses its parent. + **Vite** (`vite.config.*`), for **Vite 7 and older only**. Vite 8 (Rolldown/Oxc) is not supported. ```ts @@ -130,9 +135,12 @@ import {withOtel} from 'react-native-open-telemetry/vite'; export default withOtel(defineConfig({plugins: [react()]})); ``` -`withOtel` compiles `async`/`await` down for the app and its pre-bundled dependencies, and runs the SDK setup first. -Without it, the startup probe logs a warning and marks the JS tracers with `com.callstack.context.degraded=true`. -Parents are then lost after `await`, but never wrong. +The Vite `withOtel` compiles `async`/`await` down for the app and its pre-bundled dependencies, and runs the SDK +setup first. Without it, the startup probe logs a warning and marks the JS tracers with +`com.callstack.context.degraded=true`. Parents are then lost after `await`, but never wrong. + +**webpack** has no helper yet. Add `@babel/plugin-transform-async-to-generator` to your Babel config, and import +`react-native-open-telemetry` first in your entry. ## Native helpers and crossing the boundary @@ -182,7 +190,7 @@ Documented exceptions: Bind the context yourself with `context.bind(ctx, fn)` or `context.with(...)` from `@opentelemetry/api`. - **`setInterval`.** Ticks run in `ROOT_CONTEXT`, so each tick's spans start a new trace. They do not join the trace that registered the interval, and v0 adds no link back to it. -- **Code that captured `Promise.prototype.then` before the patch ran** (before the Metro/Vite helper's setup) runs +- **Code that captured `Promise.prototype.then` before the patch ran** (without the Metro/Vite helper, code that runs before the package import) runs at ROOT and loses its parent. It never gets a wrong one. - **Native `async`** (a web bundle without the Vite helper, a future Hermes that keeps `async`) loses parents after `await`. The startup probe detects this and sets `com.callstack.context.degraded=true` on the JS tracers' scope. @@ -199,6 +207,10 @@ Documented exceptions: - **Web:** the flush on browser `pagehide` is not tested. - **React Native 0.79 on iOS** does not build with Xcode 27 yet. Use a newer React Native on iOS for now. +## Releasing + +Maintainers: see [CONTRIBUTING.md](CONTRIBUTING.md#publishing-to-npm). + ## Verification Every guarantee above is a scenario with expected OTLP output, checked on Android, iOS and web. See diff --git a/scripts/release-gate.js b/scripts/release-gate.js index 275a8c8..d8e3219 100644 --- a/scripts/release-gate.js +++ b/scripts/release-gate.js @@ -1,6 +1,8 @@ // Release gates (Task 32), used by .github/workflows/release.yml: // node scripts/release-gate.js ci <sha> the newest CI (ci.yml) run for the commit completed with success -// node scripts/release-gate.js nightly <sha> the newest `nightly` commit status (scheduled.yml) is success +// node scripts/release-gate.js nightly <sha> the newest `nightly` status from github-actions[bot] is success and links +// a successful scheduled.yml run on that commit (mark-nightly writes it; +// dry runs never do, so a green dry run alone cannot promote) // node scripts/release-gate.js --self-test the gates against canned API answers, no network // Fails closed: exit 0 only when the commit is green; red, pending, missing, an unknown gate or an API error exit 1. // Env: GITHUB_REPOSITORY (owner/name), GH_TOKEN or GITHUB_TOKEN. @@ -17,9 +19,16 @@ const gates = { }, async nightly(repo, sha, get) { const statuses = await get(`/repos/${repo}/commits/${sha}/statuses?per_page=100`); - const newest = statuses.find(s => s.context === 'nightly'); // the API lists newest first - if (!newest) return `no nightly status on ${sha}`; + // the API lists newest first; anyone with repo write can post a status, so only the Actions bot's counts + const newest = statuses.find(s => s.context === 'nightly' && s.creator?.login === 'github-actions[bot]'); + if (!newest) return `no nightly status from github-actions[bot] on ${sha}`; if (newest.state !== 'success') return `nightly status on ${sha} is ${newest.state}`; + const id = /\/actions\/runs\/(\d+)$/.exec(newest.target_url ?? '')?.[1]; + if (!id) return `nightly status on ${sha} links no workflow run`; + const r = await get(`/repos/${repo}/actions/runs/${id}`); + if (r.path !== '.github/workflows/scheduled.yml' || r.head_sha !== sha) + return `nightly status on ${sha} links run ${id} of ${r.path} on ${r.head_sha}`; + if (r.status !== 'completed' || r.conclusion !== 'success') return `nightly run ${id} is ${r.status}/${r.conclusion}`; return null; }, }; @@ -49,7 +58,11 @@ async function selfTest() { const sha = 'a'.repeat(40); const run = (conclusion, created_at = '2026-01-01T00:00:00Z', status = 'completed') => ({id: 1, status, conclusion, created_at}); const ci = runs => check('ci', 'o/r', sha, async () => ({workflow_runs: runs})); - const nightly = statuses => check('nightly', 'o/r', sha, async () => statuses); + const url = 'https://github.com/o/r/actions/runs/7'; + const status = (state, login = 'github-actions[bot]', target_url = url) => ({context: 'nightly', state, creator: {login}, target_url}); + const goodRun = {path: '.github/workflows/scheduled.yml', head_sha: sha, status: 'completed', conclusion: 'success'}; + const nightly = (statuses, nightlyRun = goodRun) => + check('nightly', 'o/r', sha, async p => (p.endsWith('/actions/runs/7') ? nightlyRun : statuses)); assert.equal(await ci([run('success')]), null); assert.ok(await ci([run('failure')]), 'red CI must not pass'); assert.ok(await ci([run('cancelled')]), 'cancelled CI must not pass'); @@ -57,9 +70,15 @@ async function selfTest() { assert.ok(await ci([]), 'no CI run must not pass'); assert.ok(await ci([run('success'), run('failure', '2026-01-02T00:00:00Z')]), 'a newer red run wins'); assert.equal(await ci([run('failure'), run('success', '2026-01-02T00:00:00Z')]), null, 'a newer green re-run wins'); - assert.equal(await nightly([{context: 'nightly', state: 'success'}]), null); - assert.ok(await nightly([{context: 'nightly', state: 'failure'}, {context: 'nightly', state: 'success'}]), 'newest nightly wins'); - assert.ok(await nightly([{context: 'ci', state: 'success'}]), 'no nightly status must not pass'); + assert.equal(await nightly([status('success')]), null); + assert.ok(await nightly([status('failure'), status('success')]), 'newest nightly wins'); + assert.ok(await nightly([{...status('success'), context: 'ci'}]), 'no nightly status must not pass'); + assert.ok(await nightly([status('success', 'someone')]), 'a status not from the Actions bot must not pass'); + assert.equal(await nightly([status('success', 'someone'), status('success')]), null, 'only the bot status counts'); + assert.ok(await nightly([status('success', undefined, 'https://example.com')]), 'a status without a run must not pass'); + assert.ok(await nightly([status('success')], {...goodRun, path: '.github/workflows/ci.yml'}), 'a run of another workflow must not pass'); + assert.ok(await nightly([status('success')], {...goodRun, head_sha: 'b'.repeat(40)}), 'a run on another commit must not pass'); + assert.ok(await nightly([status('success')], {...goodRun, conclusion: 'failure'}), 'a red nightly run must not pass'); const boom = async () => { throw new Error('HTTP 502'); }; assert.ok(await check('ci', 'o/r', sha, boom), 'API error must not pass'); assert.ok(await check('nightly', 'o/r', sha, boom), 'API error must not pass'); From 5153d045cc58a1b19bf6ba85725748289203fd3e Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 09:18:13 +0100 Subject: [PATCH 63/76] ci: drop the temporary R28 pull_request dry-run triggers The one PR dry run passed (Nightly 45353782459, Release 45353782465). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- .github/workflows/release.yml | 9 +++------ .github/workflows/scheduled.yml | 10 +++------- verify/VERIFY.md | 5 +++-- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d5887d..f7555d8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,8 @@ name: Release # Actions -> Nightly -> Run workflow -> "Use workflow from" tag v<version>. # Both publishing jobs run in the `npm` environment, which holds NPM_TOKEN (a granular, publish-only token). Setup and # caveats (the version PR gets no CI): CONTRIBUTING.md "Publishing to npm". -# Real publishing is first verified after merge to `main` (R28); until then only the dry run below has run. +# Real publishing is first verified after merge to `main` (R28); until then only the dry run below has run (from the +# PR, Release run 45353782465). on: workflow_run: workflows: [CI] @@ -27,10 +28,6 @@ on: description: 'Dry run: evaluate the gates, version and pack; publish and promote nothing' type: boolean default: false - # TEMPORARY (R28): one forced dry run from the PR that adds this file; removed in the follow-up commit. - pull_request: - paths: - - .github/workflows/release.yml permissions: contents: read @@ -49,7 +46,7 @@ env: jobs: dry-run: - if: github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.dry_run) + if: github.event_name == 'workflow_dispatch' && inputs.dry_run runs-on: ubuntu-latest timeout-minutes: 20 permissions: diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 2ef6575..3126bc4 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -12,21 +12,17 @@ on: description: 'Dry run: setup, app regeneration and packing only (no builds, no devices, no status)' type: boolean default: false - # TEMPORARY (R28): one dry run from the PR that adds this file; removed in the follow-up commit. - pull_request: - paths: - - .github/workflows/scheduled.yml permissions: contents: read concurrency: group: nightly-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} # never cancel a real nightly + cancel-in-progress: false # never cancel a real nightly env: E2E_TELEMETRY_DISABLED: '1' - DRY_RUN: ${{ github.event_name == 'pull_request' || inputs.dry_run == true }} + DRY_RUN: ${{ inputs.dry_run == true }} jobs: e2e: @@ -196,7 +192,7 @@ jobs: # Marks the commit for the release gate (Task 32). A matrix entry with `experimental: true` does not block it. mark-nightly: needs: [e2e] - if: github.event_name != 'pull_request' && !inputs.dry_run + if: ${{ !inputs.dry_run }} runs-on: ubuntu-latest timeout-minutes: 5 permissions: diff --git a/verify/VERIFY.md b/verify/VERIFY.md index e63f1b1..054c7a4 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -262,8 +262,9 @@ an fmt workaround in the Podfile) or raise the peer minimum. Until then `rn-0.79 **Verified only after merge to `main`.** `schedule` and `workflow_dispatch` run workflow files from the default branch only (R28). Before merge the file was checked with `actionlint` and one PR run through a temporary `pull_request` trigger (paths: the workflow file) in dry-run mode: every entry runs setup, the deps bump, app regeneration, packing and -`expo prebuild`; builds, devices, the fast loop and the status are skipped. The first real nightly is the first proof of -the builds and devices. +`expo prebuild`; builds, devices, the fast loop and the status are skipped. It passed (Nightly run 45353782459, Release +run 45353782465), and the trigger was then removed; a dry run is now `workflow_dispatch` with `dry_run`. The first real +nightly is the first proof of the builds and devices. ## Android cold start with `RNOtel.start` (Task 24, 2026-11-24) From 6bece223e40816aebfd3600b5855b150370c51a3 Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 09:20:47 +0100 Subject: [PATCH 64/76] feat(expo): the Expo example uses the shipped config plugin example-expo lists react-native-open-telemetry in app.json; its own plugin keeps only example-only edits, and the nightly pack no longer patches the Core pod line for Expo. Expo resolves the plugin by name through a postinstall link to the repo root (bun cannot install the root as a file: dependency). The plugin now loads the app's expo/config-plugins (linked or pnpm installs have none beside the package), and ./app.plugin.js is exported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- app.plugin.js | 6 +++++- example-expo/app.json | 2 +- example-expo/package.json | 1 + example-expo/plugins/withOtelExample.js | 19 +++++++------------ package.json | 1 + verify/VERIFY.md | 11 +++++++---- verify/nightly/app.sh | 15 ++++++++++----- 7 files changed, 32 insertions(+), 23 deletions(-) diff --git a/app.plugin.js b/app.plugin.js index b66161a..0aff954 100644 --- a/app.plugin.js +++ b/app.plugin.js @@ -13,8 +13,12 @@ function addCorePod(podfile, podPath) { return out; } +// The app's own `expo`, not one beside this file: a linked or pnpm-installed package has none of its own. +const configPlugins = config => + require(require.resolve('expo/config-plugins', {paths: [config._internal?.projectRoot ?? process.cwd(), __dirname]})); + module.exports = config => - require('expo/config-plugins').withPodfile(config, c => { + configPlugins(config).withPodfile(config, c => { c.modResults.contents = addCorePod(c.modResults.contents, path.relative(c.modRequest.platformProjectRoot, __dirname)); return c; }); diff --git a/example-expo/app.json b/example-expo/app.json index 096f1ed..39adb02 100644 --- a/example-expo/app.json +++ b/example-expo/app.json @@ -5,6 +5,6 @@ "version": "1.0.0", "ios": {"bundleIdentifier": "opentelemetry.example.expo"}, "android": {"package": "opentelemetry.example.expo"}, - "plugins": ["./plugins/withOtelExample"] + "plugins": ["react-native-open-telemetry", "./plugins/withOtelExample"] } } diff --git a/example-expo/package.json b/example-expo/package.json index 49a97bb..9eafb11 100644 --- a/example-expo/package.json +++ b/example-expo/package.json @@ -4,6 +4,7 @@ "private": true, "main": "index.js", "scripts": { + "postinstall": "test -e node_modules/react-native-open-telemetry || ln -sfn ../.. node_modules/react-native-open-telemetry", "prebuild": "expo prebuild --clean --no-install" }, "dependencies": { diff --git a/example-expo/plugins/withOtelExample.js b/example-expo/plugins/withOtelExample.js index e0c2a3b..1b6d83b 100644 --- a/example-expo/plugins/withOtelExample.js +++ b/example-expo/plugins/withOtelExample.js @@ -1,7 +1,4 @@ -const {withAndroidManifest, withAppBuildGradle, withGradleProperties, withPodfile} = require('expo/config-plugins'); - -// Autolinking links only the Nitro pod; its pure Swift core pod is declared in the Podfile (R24). -const CORE_POD = " pod 'ReactNativeOpenTelemetryCore', :path => '../..'"; +const {withAndroidManifest, withAppBuildGradle, withGradleProperties} = require('expo/config-plugins'); // Same as the bare example's app/build.gradle: the bundle task sees only this app's dir, so a change to the package // (lib/, src/), the scenarios or OTEL_TEST_MODE would otherwise leave the old bundle in the APK. @@ -13,20 +10,18 @@ tasks.matching { it.name.startsWith("createBundle") }.configureEach { } `; -/** Example-only (Task 28): what the bare example's native projects carry by hand, applied at `expo prebuild`. */ +/** + * Example-only (Task 28): what the bare example's native projects carry by hand, applied at `expo prebuild`. The Core + * pod (R24) comes from the package's own plugin (`react-native-open-telemetry` in app.json), as in a real Expo app. + */ module.exports = config => { - config = withPodfile(config, c => { - if (!c.modResults.contents.includes(CORE_POD)) - c.modResults.contents = c.modResults.contents.replace(/^(target '.+' do\n)/m, `$1${CORE_POD}\n`); - return c; - }); config = withAppBuildGradle(config, c => { if (!c.modResults.contents.includes('withOtelExample: rebundle')) c.modResults.contents += BUNDLE_INPUTS; return c; }); // EXAMPLE-ONLY, DO NOT COPY: app-wide cleartext so the e2e collector (plain http, also with test mode off) is reachable. - // ponytail: any host, not only 10.0.2.2 like the bare app's network_security_config. Only the CORE_POD step above is - // what a real Expo app needs. + // ponytail: any host, not only 10.0.2.2 like the bare app's network_security_config. None of this file is what a real + // Expo app needs; it needs only the package's plugin. config = withAndroidManifest(config, c => { c.modResults.manifest.application[0].$['android:usesCleartextTraffic'] = 'true'; return c; diff --git a/package.json b/package.json index d4fc23f..f315893 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "default": "./lib/module/index.js" }, "./metro": "./metro/index.js", + "./app.plugin.js": "./app.plugin.js", "./vite": { "types": "./vite/index.d.ts", "default": "./vite/index.js" diff --git a/verify/VERIFY.md b/verify/VERIFY.md index 054c7a4..0a31de3 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -106,10 +106,13 @@ unproven until their first CI run. plus the bare example's `OTEL_TEST_MODE` inline plugin. - **Autolinking:** Expo autolinking reads `example-expo/react-native.config.js`, which points at the repo root and at the bare example's TestNative, so the `cross-*` scenarios run on Expo too. -- **Local config plugin** (`example-expo/plugins/withOtelExample.js`, applied at prebuild): adds - `pod 'ReactNativeOpenTelemetryCore', :path => '../..'` to the Podfile (R24; `withPodfile`, no `expo-build-properties` - dependency); sets `usesCleartextTraffic` (the collector is plain HTTP); and with `OTEL_TEST_MODE=1` at prebuild - writes `otelTestMode=true` to `gradle.properties`. iOS takes test mode at `OTEL_TEST_MODE=1 pod install`. +- **Config plugins** (`app.json`): the package's own `react-native-open-telemetry` (`app.plugin.js`) adds + `pod 'ReactNativeOpenTelemetryCore', :path => '../..'` to the Podfile (R24), as in any Expo app. Expo resolves it by + package name: `example-expo`'s `postinstall` links `node_modules/react-native-open-telemetry` to the repo root (bun + cannot install the root as a `file:` dependency: it looks for the root's `patches/` relative to the app). Then the + example-only `example-expo/plugins/withOtelExample.js` sets `usesCleartextTraffic` (the collector is plain HTTP), adds + the bundle task inputs, and with `OTEL_TEST_MODE=1` at prebuild writes `otelTestMode=true` to `gradle.properties`. + iOS takes test mode at `OTEL_TEST_MODE=1 pod install`. - **R8:** Expo release builds minify (`android.enableMinifyInReleaseBuilds=true`). The library now ships `android/consumer-rules.pro`: `-dontwarn` for otel-java's optional compile-only classes, and a keep rule for `io.opentelemetry.sdk.resources.**`, which otel-java's `ResourceMarshaler` reaches by reflection diff --git a/verify/nightly/app.sh b/verify/nightly/app.sh index f6541e7..5e608c2 100755 --- a/verify/nightly/app.sh +++ b/verify/nightly/app.sh @@ -83,7 +83,11 @@ pack() { npm pack --pack-destination "$tmp" >/dev/null tgz=$(ls "$tmp"/*.tgz) echo "pack: $(basename "$tgz") -> $app" + # example-expo's postinstall links the repo root there (its plugin resolves by package name); unlink, never write + # through the link into the checkout + rm -f "$app/node_modules/react-native-open-telemetry" (cd "$app" && bun add "$tgz") + [ ! -L "$app/node_modules/react-native-open-telemetry" ] || die "$app: still links the root" # autolink and bundle the installed package, not the repo root edit "$app/react-native.config.js" 's/^.*react-native-open-telemetry.*root:.*\n//m' 'react-native-test-native' if grep -qF "'react-native-open-telemetry'" "$app/react-native.config.js"; then die "$app: still links the root"; fi @@ -91,11 +95,12 @@ pack() { "s|require\('\.\./metro'\)|require('react-native-open-telemetry/metro')|; s/, 'react-native-open-telemetry': root//" \ "require('react-native-open-telemetry/metro')" if grep -qF "'react-native-open-telemetry': root" "$app/metro.config.js"; then die "$app: metro still maps the root"; fi - # the Core pod (R24) from the installed package, as an app using the npm package declares it - local pod="pod 'ReactNativeOpenTelemetryCore', :path => '../node_modules/react-native-open-telemetry'" - local file=$app/ios/Podfile - [ "$app" = example-expo ] && file=$app/plugins/withOtelExample.js - edit "$file" "s|pod 'ReactNativeOpenTelemetryCore', :path => '\.\./\.\.'|$pod|" "$pod" + # the Core pod (R24) from the installed package, as an app using the npm package declares it. The Expo app gets it + # from the package's own plugin at prebuild, relative to wherever the package is installed. + if [ "$app" = example ]; then + local pod="pod 'ReactNativeOpenTelemetryCore', :path => '../node_modules/react-native-open-telemetry'" + edit "$app/ios/Podfile" "s|pod 'ReactNativeOpenTelemetryCore', :path => '\.\./\.\.'|$pod|" "$pod" + fi } case "${1:-}" in From d802a38a7e59e2fa8c550524c4cb336a35a0b73c Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 09:21:13 +0100 Subject: [PATCH 65/76] fix(sdk): name the missing fields when a partial config cannot initialize native Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- src/sdk/__tests__/start.test.ts | 8 ++++++++ src/sdk/start.ts | 10 ++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/sdk/__tests__/start.test.ts b/src/sdk/__tests__/start.test.ts index 50f099f..2c1ae29 100644 --- a/src/sdk/__tests__/start.test.ts +++ b/src/sdk/__tests__/start.test.ts @@ -101,6 +101,14 @@ test('init error returns a no-op handle and logs once', () => { expect(isNoop(h)).toBe(true); }); +test('a partial config names the missing fields, not native\'s "no config"', () => { + const {calls} = fakeOtel(); + expect(isNoop(startReactNativeSdk({serviceName: 'shop'}))).toBe(true); + expect(calls).toEqual([undefined]); + expect(err).toHaveBeenCalledTimes(1); + expect(String(err.mock.calls[0])).toMatch(/serviceName and exportConfig\.url are required/); +}); + test('a failed native-first init (sticky, R16) was reported by native: no second report', () => { fakeOtel({initialized: true, error: 'invalid exportUrl'}); const h = startReactNativeSdk(); diff --git a/src/sdk/start.ts b/src/sdk/start.ts index bfca9b8..b8f73e0 100644 --- a/src/sdk/start.ts +++ b/src/sdk/start.ts @@ -34,10 +34,16 @@ function start(config: SdkConfig | undefined): SdkHandle { console.error(`${TAG} native module not found (Expo Go or a build without it); telemetry is off.`); return noopHandle(); } - const result = native.initialize(config && toSeamConfig(config)); + const seam = config && toSeamConfig(config); + const result = native.initialize(seam); if (result.error) { // alreadyInitialized: a failed native-first init sticks (R16) and native already reported it, once - if (!result.alreadyInitialized) console.error(`${TAG} native init failed; telemetry is off: ${result.error}`); + if (result.alreadyInitialized) return noopHandle(); + if (config && !seam) { + console.error(`${TAG} serviceName and exportConfig.url are required to initialize native; telemetry is off.`); + } else { + console.error(`${TAG} native init failed; telemetry is off: ${result.error}`); + } return noopHandle(); } if (result.alreadyInitialized && config?.exportConfig) { From e3bd88402960e8b3c724ee9e82effcffbd3705c2 Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 09:21:44 +0100 Subject: [PATCH 66/76] fix(android): accept underscore hosts in exportUrl like iOS and web URI.host is null for hosts such as otel_collector; fall back to the authority without userinfo and port. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- android/core-jvm/src/test/kotlin/EndpointTest.kt | 12 ++++++++++++ .../core/kotlin/com/callstack/otel/core/Endpoint.kt | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/android/core-jvm/src/test/kotlin/EndpointTest.kt b/android/core-jvm/src/test/kotlin/EndpointTest.kt index c9d18f8..2cb7108 100644 --- a/android/core-jvm/src/test/kotlin/EndpointTest.kt +++ b/android/core-jvm/src/test/kotlin/EndpointTest.kt @@ -1,6 +1,9 @@ import com.callstack.otel.core.tracesUrl +import com.callstack.otel.core.validateExportUrl import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertNotNull +import kotlin.test.assertNull class EndpointTest { @Test fun appendsTracesPathUnlessPresent() { @@ -9,4 +12,13 @@ class EndpointTest { } assertEquals("http://h/base/v1/traces", tracesUrl("http://h/base")) } + + @Test fun acceptsUnderscoreHostsLikeIosAndWeb() { + for (u in listOf("http://otel_collector:4318", "http://otel_collector", "https://user:pw@otel_collector:4318/x")) { + assertNull(validateExportUrl(u), u) + } + for (u in listOf("not a url", "ftp://h:21", "http://", "http://:4318", "http://user@:4318")) { + assertNotNull(validateExportUrl(u), u) + } + } } diff --git a/android/src/core/kotlin/com/callstack/otel/core/Endpoint.kt b/android/src/core/kotlin/com/callstack/otel/core/Endpoint.kt index d2cc380..0bc8b39 100644 --- a/android/src/core/kotlin/com/callstack/otel/core/Endpoint.kt +++ b/android/src/core/kotlin/com/callstack/otel/core/Endpoint.kt @@ -11,7 +11,9 @@ fun tracesUrl(exportUrl: String): String { /** Eager check (D8), no exporter built: http(s) scheme and a host. Returns an error message or null. */ internal fun validateExportUrl(url: String): String? { val u = try { URI(url) } catch (e: Exception) { return "invalid exportUrl: ${e.message}" } - if (u.scheme?.lowercase() !in setOf("http", "https") || u.host.isNullOrEmpty()) { + // URI.host is null for a host it rejects as a hostname, like `otel_collector`, which iOS and web accept + val host = u.host ?: u.rawAuthority?.substringAfterLast('@')?.substringBefore(':') + if (u.scheme?.lowercase() !in setOf("http", "https") || host.isNullOrEmpty()) { return "invalid exportUrl \"$url\": expected http(s)://host[:port]" } return null From 5900b3f44a1625f61d81a9d7e1ab6a6846a01461 Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 09:21:59 +0100 Subject: [PATCH 67/76] fix(web): validate exportConfig.url at init like native Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- src/sdk/__tests__/start.web.test.ts | 8 ++++++++ src/sdk/start.web.ts | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/sdk/__tests__/start.web.test.ts b/src/sdk/__tests__/start.web.test.ts index 667fe63..85a5a3c 100644 --- a/src/sdk/__tests__/start.web.test.ts +++ b/src/sdk/__tests__/start.web.test.ts @@ -66,6 +66,14 @@ test('missing exportConfig returns a no-op handle', () => { expect(err).toHaveBeenCalledTimes(1); }); +test.each(['not a url', 'ftp://c.example.com', 'collector:4318'])('invalid url %s: one error and a no-op handle', url => { + const h = startReactNativeSdk({...CONFIG, exportConfig: {url}}); + expect(isNoop(h)).toBe(true); + expect(err).toHaveBeenCalledTimes(1); + expect(String(err.mock.calls[0])).toMatch(/invalid exportConfig\.url/); + expect(fetchMock).not.toHaveBeenCalled(); +}); + test('second call returns the first handle with one warning', () => { const h = startReactNativeSdk(CONFIG); expect(startReactNativeSdk(CONFIG)).toBe(h); diff --git a/src/sdk/start.web.ts b/src/sdk/start.web.ts index 230640b..783e949 100644 --- a/src/sdk/start.web.ts +++ b/src/sdk/start.web.ts @@ -7,11 +7,25 @@ import {DISTRO_VERSION, tracesUrl, type SdkConfig, type SdkHandle} from './confi import {noopHandle} from './noop'; import {register, startOnce, TAG} from './shared'; +/** Eager check, like native's: http(s) scheme and a host. */ +function isHttpUrl(url: string): boolean { + try { + const u = new URL(url); + return (u.protocol === 'http:' || u.protocol === 'https:') && u.hostname !== ''; + } catch { + return false; + } +} + function start(config: SdkConfig | undefined): SdkHandle { if (!config?.serviceName || !config.exportConfig?.url) { console.error(`${TAG} serviceName and exportConfig.url are required on web; telemetry is off.`); return noopHandle(); } + if (!isHttpUrl(config.exportConfig.url)) { + console.error(`${TAG} invalid exportConfig.url "${config.exportConfig.url}": expected http(s)://host[:port]; telemetry is off.`); + return noopHandle(); + } const testMode = isTestModeBuild(); const {serviceName, serviceVersion, resourceAttributes, exportConfig, spanProcessors = []} = config; // JS owns the resource on web: no telemetry.sdk.* (§4.3), distro only outside test mode (goldens). From 827570d0f9e271e54652fd0c35505cf3d1a6b316 Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 09:22:16 +0100 Subject: [PATCH 68/76] fix(context): stampScope never throws on a tracer without instrumentationScope Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- src/context/__tests__/scope.test.ts | 8 ++++++++ src/context/scope.ts | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/context/__tests__/scope.test.ts diff --git a/src/context/__tests__/scope.test.ts b/src/context/__tests__/scope.test.ts new file mode 100644 index 0000000..4f10889 --- /dev/null +++ b/src/context/__tests__/scope.test.ts @@ -0,0 +1,8 @@ +import type {Tracer} from '@opentelemetry/api'; +import {stampScope} from '../scope'; + +test('stampScope returns a tracer without instrumentationScope unchanged', () => { + const tracer = {startSpan: () => undefined} as unknown as Tracer; + expect(stampScope(tracer, {a: 1})).toBe(tracer); + expect(tracer).not.toHaveProperty('instrumentationScope'); +}); diff --git a/src/context/scope.ts b/src/context/scope.ts index b8d12f5..b9100a2 100644 --- a/src/context/scope.ts +++ b/src/context/scope.ts @@ -22,7 +22,9 @@ export function markDegraded(): boolean { * `tracer.instrumentationScope` at runtime. Every tracer the SDK hands out goes through here (mobile and web). */ export function stampScope<T extends Tracer>(tracer: T, extra: Attributes = {}): T { - const scope = (tracer as unknown as {instrumentationScope: {attributes?: Attributes}}).instrumentationScope; + const scope = (tracer as unknown as {instrumentationScope?: {attributes?: Attributes}}).instrumentationScope; + // an upstream change or a foreign tracer: no scope attributes, but never throw into the app + if (typeof scope !== 'object' || scope === null) return tracer; const merged = {...stamped.get(scope), ...extra}; stamped.set(scope, merged); scope.attributes = {...merged, ...scopeAttributes()}; From 04c497ffac24c4acd4e0c2b34ed3be074b137161 Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 09:22:33 +0100 Subject: [PATCH 69/76] fix(native): RNOtel.start logs a sticky init failure once, not on every call Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- android/src/main/java/com/callstack/otel/RNOtel.kt | 3 ++- ios/RNOtel/RNOtel.swift | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/callstack/otel/RNOtel.kt b/android/src/main/java/com/callstack/otel/RNOtel.kt index 9906c5f..eb047d9 100644 --- a/android/src/main/java/com/callstack/otel/RNOtel.kt +++ b/android/src/main/java/com/callstack/otel/RNOtel.kt @@ -32,7 +32,8 @@ object RNOtel { val app = context.applicationContext if (processName() != app.packageName) return val r = initialize(RNOtelConfig().apply(block).toCore()) - if (r.error != null) Log.e(TAG, "init failed; telemetry is off: ${r.error}") + // alreadyInitialized: a repeat call; a sticky failure was logged by the first one + if (r.error != null && !r.alreadyInitialized) Log.e(TAG, "init failed; telemetry is off: ${r.error}") } catch (e: Exception) { Log.e(TAG, "init failed; telemetry is off", e) } diff --git a/ios/RNOtel/RNOtel.swift b/ios/RNOtel/RNOtel.swift index 13f5d25..5c931fe 100644 --- a/ios/RNOtel/RNOtel.swift +++ b/ios/RNOtel/RNOtel.swift @@ -17,7 +17,9 @@ public enum RNOtel { public static func start(_ configure: (RNOtelConfig) -> Void) { let c = RNOtelConfig() configure(c) - if let err = initialize(c.toCore()).error { NSLog("RNOtel init failed; telemetry is off: %@", err) } + let r = initialize(c.toCore()) + // alreadyInitialized: a repeat call; a sticky failure was logged by the first one + if let err = r.error, !r.alreadyInitialized { NSLog("RNOtel init failed; telemetry is off: %@", err) } } private static var observer: NSObjectProtocol? From 048d9d4a20e179602852aa768e39858137f63231 Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 09:23:53 +0100 Subject: [PATCH 70/76] chore: ship react-native.config.js naming the adapter podspec Declares podspecPath for the Nitro adapter and ships the file. RN CLI 20.2's getDependencyConfig and Expo 58's resolver do not read podspecPath (checked: pointing it at the Core podspec changes nothing); they pick the first glob hit / the first sorted name, which is the adapter today. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- package.json | 1 + react-native.config.js | 5 ++++- verify/static/packContents.test.ts | 2 +- verify/static/packContents.ts | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f315893..6d44f96 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "metro", "vite", "app.plugin.js", + "react-native.config.js", "!ios/build", "!android/build", "!android/core-jvm", diff --git a/react-native.config.js b/react-native.config.js index 4942891..83a51ab 100644 --- a/react-native.config.js +++ b/react-native.config.js @@ -1,9 +1,12 @@ // https://github.com/react-native-community/cli/blob/main/docs/dependencies.md // Nitro: the native code and nitrogen/generated are wired by android/build.gradle and the podspec. +// Two podspecs sit at the root; autolinking links only the Nitro adapter (apps add the Core pod, R24). podspecPath says +// which; RN CLI 20.2 and Expo 58 do not read it yet (CLI: the first `*.podspec` glob hit; Expo: the first sorted, both +// ReactNativeOpenTelemetry.podspec today). module.exports = { dependency: { platforms: { - ios: {}, + ios: {podspecPath: 'ReactNativeOpenTelemetry.podspec'}, android: {}, }, }, diff --git a/verify/static/packContents.test.ts b/verify/static/packContents.test.ts index b09ec53..4e9d34c 100644 --- a/verify/static/packContents.test.ts +++ b/verify/static/packContents.test.ts @@ -1,6 +1,6 @@ import {packContents} from './packContents'; -const complete = ['package.json', 'lib/module/index.js', 'src/index.ts', 'nitrogen/generated/x.hpp', 'metro/index.js', 'vite/index.js', 'android/build.gradle', 'ios/Adapter/HybridOtel.swift', 'Package.swift', 'ReactNativeOpenTelemetry.podspec', 'ReactNativeOpenTelemetryCore.podspec', 'app.plugin.js']; +const complete = ['package.json', 'lib/module/index.js', 'src/index.ts', 'nitrogen/generated/x.hpp', 'metro/index.js', 'vite/index.js', 'android/build.gradle', 'ios/Adapter/HybridOtel.swift', 'Package.swift', 'ReactNativeOpenTelemetry.podspec', 'ReactNativeOpenTelemetryCore.podspec', 'app.plugin.js', 'react-native.config.js']; test('reports missing nitrogen/', () => { expect(packContents(complete.filter(p => !p.startsWith('nitrogen/')))).toEqual(['nitrogen/']); diff --git a/verify/static/packContents.ts b/verify/static/packContents.ts index e5bfb17..3483e28 100644 --- a/verify/static/packContents.ts +++ b/verify/static/packContents.ts @@ -1,4 +1,4 @@ -export const REQUIRED = ['package.json', 'lib/', 'src/', 'nitrogen/', 'metro/', 'vite/', 'android/', 'ios/', 'Package.swift', 'ReactNativeOpenTelemetry.podspec', 'ReactNativeOpenTelemetryCore.podspec', 'app.plugin.js']; +export const REQUIRED = ['package.json', 'lib/', 'src/', 'nitrogen/', 'metro/', 'vite/', 'android/', 'ios/', 'Package.swift', 'ReactNativeOpenTelemetry.podspec', 'ReactNativeOpenTelemetryCore.podspec', 'app.plugin.js', 'react-native.config.js']; /** Returns the required paths missing from the `npm pack --dry-run --json` file list. */ export function packContents(list: string[], required: string[] = REQUIRED): string[] { From 1533e679247667a1afe834ba551cf872ed5ea201 Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 09:24:12 +0100 Subject: [PATCH 71/76] fix(metro): throw on an unmerged config instead of dropping InitializeCore Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- metro/__tests__/withOtel.test.js | 6 ++++++ metro/index.js | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/metro/__tests__/withOtel.test.js b/metro/__tests__/withOtel.test.js index b29b1f2..76780c0 100644 --- a/metro/__tests__/withOtel.test.js +++ b/metro/__tests__/withOtel.test.js @@ -35,3 +35,9 @@ test('keeps the package out of inline requires, after the existing entries', asy const bare = await withOtel(base, {setupPath: SETUP}).transformer.getTransformOptions([], {}, () => []); expect(bare.transform.nonInlinedRequires).toEqual(['react-native-open-telemetry']); }); + +test('throws on an unmerged config instead of dropping InitializeCore', () => { + expect(() => withOtel({resolver: {x: 1}}, {setupPath: SETUP})).toThrow( + 'apply withOtel to the merged config: withOtel(mergeConfig(getDefaultConfig(__dirname), config))', + ); +}); diff --git a/metro/index.js b/metro/index.js index dc1d49a..0f4ef4e 100644 --- a/metro/index.js +++ b/metro/index.js @@ -10,7 +10,13 @@ const PACKAGE = 'react-native-open-telemetry'; */ function withOtel(config, {setupPath = require.resolve('react-native-open-telemetry/setup')} = {}) { const serializer = config.serializer ?? {}; - const original = serializer.getModulesRunBeforeMainModule ?? (() => []); + const original = serializer.getModulesRunBeforeMainModule; + // without it Metro would run only our setup before the app, and drop RN's InitializeCore + if (typeof original !== 'function') { + throw new Error( + `${PACKAGE}/metro: apply withOtel to the merged config: withOtel(mergeConfig(getDefaultConfig(__dirname), config))`, + ); + } if (original.__withOtel) return config; const wrapped = entry => { const list = original(entry); From f98963b6b3296ea26e94f9f77bc0b0bb318ee628 Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 09:25:03 +0100 Subject: [PATCH 72/76] docs: state the supported iOS platforms honestly; the probe logs an error RN 0.79 iOS does not build on Xcode 27 (fmt/consteval). The peer range is unchanged (author decision). The Vite paragraph said the probe logs a warning; it calls console.error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- README.md | 11 +++++++---- verify/VERIFY.md | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3c5fb18..7bda05d 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,11 @@ v0 is tracing only. If you used 0.x, read [MIGRATION.md](MIGRATION.md) first. - React Native **0.79+**, New Architecture, Hermes - `react-native-nitro-modules` **~0.37** -- iOS: Xcode **27.0+** -- Android: minSdk **26** +- iOS: Xcode **27.0+** (verified; Xcode 16.4 fails on the Swift packages' tools versions, Xcode 26 is untested), with a + React Native version that builds on your Xcode (verified on Xcode 27: **0.88.1**). React Native 0.79 does not build + on Xcode 27: its `fmt` pod fails on the newer Clang (`consteval`). RN 0.79 on iOS needs an older Xcode, which is + untested here. +- Android: minSdk **26**, React Native 0.79+ (0.88.1 is verified per PR; 0.79 runs in the nightly) ## Install @@ -136,7 +139,7 @@ export default withOtel(defineConfig({plugins: [react()]})); ``` The Vite `withOtel` compiles `async`/`await` down for the app and its pre-bundled dependencies, and runs the SDK -setup first. Without it, the startup probe logs a warning and marks the JS tracers with +setup first. Without it, the startup probe logs an error (`console.error`) and marks the JS tracers with `com.callstack.context.degraded=true`. Parents are then lost after `await`, but never wrong. **webpack** has no helper yet. Add `@babel/plugin-transform-async-to-generator` to your Babel config, and import @@ -205,7 +208,7 @@ Documented exceptions: - `requestIdleCallback` is not patched. - `InteractionManager` has no coverage: React Native 0.88 removed it. - **Web:** the flush on browser `pagehide` is not tested. -- **React Native 0.79 on iOS** does not build with Xcode 27 yet. Use a newer React Native on iOS for now. +- **React Native 0.79 on iOS** does not build with Xcode 27 (see Requirements). Use a newer React Native on iOS. ## Releasing diff --git a/verify/VERIFY.md b/verify/VERIFY.md index 0a31de3..567b27c 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -260,7 +260,9 @@ on 0.79, CocoaPods' own "Copy generated compatibility header" phase writes the p instead). Dropping `:output_files` locally got past it. (2) RN 0.79's `fmt` pod: `call to consteval function 'fmt::basic_format_string…' is not a constant expression` (the newer Clang). Either fix both for 0.79 users (podspec; an fmt workaround in the Podfile) or raise the peer minimum. Until then `rn-0.79-ios` is `experimental` -(`continue-on-error`, does not block `nightly`). +(`continue-on-error`, does not block `nightly`). (1) is fixed (abcaff0, no `:output_files`); (2) stands. The README's +Requirements say so: iOS is verified on Xcode 27 only (16.4 fails on the Swift packages' tools versions, 26 is +untested), with an RN that builds on it (verified: 0.88.1); the peer range stays `>=0.79` until the author decides. **Verified only after merge to `main`.** `schedule` and `workflow_dispatch` run workflow files from the default branch only (R28). Before merge the file was checked with `actionlint` and one PR run through a temporary `pull_request` From 6e7523815b4c079e797b7a1235e854a0517b93e8 Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 09:25:20 +0100 Subject: [PATCH 73/76] docs(verify): semantic-conventions bundle share; where CI's perf.json lives Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- verify/VERIFY.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/verify/VERIFY.md b/verify/VERIFY.md index 567b27c..7e3c70a 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -229,6 +229,12 @@ round; no extra build). The numbers leave as attributes of one `perf-result` spa `verify/artifacts/perf.json` (every sample, method, device) and fails only if the unrounded hand-off p50 ≥ 100 µs or median(on) / median(off) ≥ 3×. It measures the test-mode build, which crosses the same hand-off seam as production. Pixel_9 emulator (API 36, arm64), 2 runs: p50 26.9–27.3 µs (p95 53–58 µs, `end()` alone p50 13.8–14.2 µs), ratio 1.70–1.71. +CI: the `perf.json` of record is the `verify-artifacts-e2e-android-bare` artifact of the PR's latest green run +(RUN LINK: TO BE FILLED IN). + +**Bundle size** (`static`, `bundle-size`): `@opentelemetry/semantic-conventions` is about 56 % of the SDK share of the +release bundle (146,789 of 264,120 B). Upstream barrel imports pull in the whole stable entry, though the SDK uses a few +keys. Follow-up: a Metro/Babel rewrite of those imports to per-key modules, or an upstream fix. ## Nightly (Task 31) From 5145b0af834983548a593210bd2bce1eaab9dacb Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 09:39:58 +0100 Subject: [PATCH 74/76] test(e2e): tolerate a slow CI simulator; bound the iOS log stream; stream e2e output live - background-flush: retry the foreground open once (simctl launch can outlast agent-device's 15 s xcrun timeout); the 2 s flush tap still proves the main thread is free - native-test-mode: 30 s for the first read (the 5 s default saw 0 reads on ios-expo) - clearDeviceLog: log stream --timeout 3m, so a killed worker leaves no stray stream - e2e stage: inherit stdio, so a long or killed device run shows its progress Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- verify/e2e/background-flush.e2e.ts | 5 ++++- verify/e2e/harness.ts | 3 ++- verify/e2e/native-test-mode.e2e.ts | 2 +- verify/stages/e2e.ts | 8 ++++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/verify/e2e/background-flush.e2e.ts b/verify/e2e/background-flush.e2e.ts index 6e0809e..d0ebb74 100644 --- a/verify/e2e/background-flush.e2e.ts +++ b/verify/e2e/background-flush.e2e.ts @@ -13,7 +13,10 @@ test('background-flush', {platforms: MOBILE}, async ({app, screen, collector, de await device.home(); if (!(await until(() => collector.received() > 0, 15_000))) throw new Error('nothing exported within 15 s of going to background'); // back in the foreground the app answers a tap at once: the background flush left the main thread free - await device.openApp(bundleIdOf(target)); // foreground only (app.open() relaunches) + // foreground only (app.open() relaunches). A CI simulator's `simctl launch` can outlast agent-device's 15 s + // xcrun timeout; the flush runs off the main thread (RNOtel.swift), so one retry, then the 2 s tap still proves it. + const open = () => device.openApp(bundleIdOf(target)); + await open().catch(open); await tapFlush(screen, 1, 2_000); }, }); diff --git a/verify/e2e/harness.ts b/verify/e2e/harness.ts index 1fa6a6b..50c8991 100644 --- a/verify/e2e/harness.ts +++ b/verify/e2e/harness.ts @@ -162,7 +162,8 @@ export async function clearDeviceLog(platform: 'android' | 'ios', deviceId: stri iosStreams.set(deviceId, state); const child = spawn( 'xcrun', - ['simctl', 'spawn', deviceId, 'log', 'stream', '--style', 'compact', '--level', 'info', + // --timeout: the stream ends on its own even when the worker dies without an 'exit' event (a killed run) + ['simctl', 'spawn', deviceId, 'log', 'stream', '--timeout', '3m', '--style', 'compact', '--level', 'info', '--predicate', 'process == "OpenTelemetryExample" AND (eventMessage CONTAINS "RNOtel" OR eventMessage CONTAINS "[react-native-open-telemetry]")'], {stdio: ['ignore', 'pipe', 'ignore']}, ); diff --git a/verify/e2e/native-test-mode.e2e.ts b/verify/e2e/native-test-mode.e2e.ts index 41592fa..356c447 100644 --- a/verify/e2e/native-test-mode.e2e.ts +++ b/verify/e2e/native-test-mode.e2e.ts @@ -3,5 +3,5 @@ import {MOBILE, test} from './harness'; test('native test mode reaches initialize', {platforms: MOBILE}, async ({app, screen}) => { await app.open(); - await expect(screen.getByTestId('native-test-mode')).toHaveText('native testMode=true'); + await expect(screen.getByTestId('native-test-mode')).toHaveText('native testMode=true', {timeout: 30_000}); // a CI simulator's first read can outlast the 5 s default }); diff --git a/verify/stages/e2e.ts b/verify/stages/e2e.ts index 60e8668..d582008 100644 --- a/verify/stages/e2e.ts +++ b/verify/stages/e2e.ts @@ -1,10 +1,11 @@ +import {spawnSync} from 'node:child_process'; import type {Stage} from '../run'; const stage: Stage = { name: 'e2e', order: 90, e2e: true, - run({sh}) { + run() { // E2E_TARGET=android-bare|ios-bare|android-expo|ios-expo runs one target (CI runs one per job) const target = process.env.E2E_TARGET ? ['--target', process.env.E2E_TARGET] : []; // E2E_SMOKE=1: a test-mode-off build is installed, so only smoke.e2e.ts can pass (VERIFY.md) @@ -13,7 +14,10 @@ const stage: Stage = { const update = process.env.VERIFY_UPDATE; delete process.env.VERIFY_UPDATE; try { - sh(['bunx', 'e2e', 'run', '--config', 'verify/e2e/e2e.config.ts', ...target, ...files]); + // stdio inherited, not ctx.sh's captured stdout: a long device run shows progress live, and a killed step keeps it + const cmd = ['bunx', 'e2e', 'run', '--config', 'verify/e2e/e2e.config.ts', ...target, ...files]; + const p = spawnSync(cmd[0]!, cmd.slice(1), {stdio: 'inherit'}); + if (p.status !== 0) throw new Error(`${cmd.join(' ')} exited ${p.status ?? p.signal}`); } finally { if (update !== undefined) process.env.VERIFY_UPDATE = update; } From d29806b84ad29e35ec2671a8a67c0a8f90cb3f3e Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 09:40:02 +0100 Subject: [PATCH 75/76] ci: step timeouts on the e2e steps; bound the iOS log diagnosis Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- .github/workflows/ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 682d70f..34bff02 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -148,6 +148,7 @@ jobs: disable-animations: false script: echo "AVD snapshot created" - name: e2e (android-bare) + timeout-minutes: 25 # a hung device run fails here, not at the job limit uses: reactivecircus/android-emulator-runner@v2 env: E2E_TARGET: android-bare @@ -232,11 +233,13 @@ jobs: xcrun simctl boot "$udid" xcrun simctl bootstatus "$udid" -b - name: e2e (ios-bare) + timeout-minutes: 30 # a hung device run fails here, not at the job limit env: E2E_TARGET: ios-bare AGENT_DEVICE_DAEMON_STARTUP_TIMEOUT_MS: '600000' # the first daemon start on a cold runner outlasts the 120 s default run: bun verify --e2e e2e - name: e2e smoke (ios-bare, test mode off) + timeout-minutes: 10 # a hung device run fails here, not at the job limit # also after a failed main e2e (that step already fails the job) if: ${{ !cancelled() && steps.ios-smoke-build.outcome == 'success' }} env: @@ -246,9 +249,10 @@ jobs: run: E2E_IOS_APP='${{ runner.temp }}/OpenTelemetryExample.app' bun verify --e2e e2e - name: Diagnose the simulator log if: failure() + timeout-minutes: 4 # `log show` scans the whole store: ~1 min per call on a runner run: | - echo "--- RNOtel lines"; xcrun simctl spawn booted log show --last 30m --info --style compact --predicate 'eventMessage CONTAINS "RNOtel"' | tail -20 - echo "--- app process lines"; xcrun simctl spawn booted log show --last 30m --info --style compact --predicate 'process == "OpenTelemetryExample"' | tail -20 + echo "--- RNOtel lines"; xcrun simctl spawn booted log show --last 10m --info --style compact --predicate 'eventMessage CONTAINS "RNOtel"' | tail -20 + echo "--- app process lines"; xcrun simctl spawn booted log show --last 10m --info --style compact --predicate 'process == "OpenTelemetryExample"' | tail -20 date; echo "$TZ" - uses: actions/upload-artifact@v4 if: failure() @@ -338,6 +342,7 @@ jobs: disable-animations: false script: echo "AVD snapshot created" - name: e2e (android-expo) + timeout-minutes: 25 # a hung device run fails here, not at the job limit uses: reactivecircus/android-emulator-runner@v2 env: E2E_TARGET: android-expo @@ -406,6 +411,7 @@ jobs: xcrun simctl boot "$udid" xcrun simctl bootstatus "$udid" -b - name: e2e (ios-expo) + timeout-minutes: 30 # a hung device run fails here, not at the job limit env: E2E_TARGET: ios-expo AGENT_DEVICE_DAEMON_STARTUP_TIMEOUT_MS: '600000' # the first daemon start on a cold runner outlasts the 120 s default From 166eb41057d6d25b4b80509fee352afbfce507a1 Mon Sep 17 00:00:00 2001 From: Adam Horodyski <ad.horodyski@gmail.com> Date: Tue, 24 Nov 2026 10:36:55 +0100 Subject: [PATCH 76/76] chore(verify): drop the X9 JSON exception list (the Collector accepts NaN/Infinity); link the CI perf.json Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- verify/VERIFY.md | 10 ++++++---- verify/compliance/replay.ts | 22 ++++------------------ verify/harness/__tests__/replay.test.ts | 8 ++------ 3 files changed, 12 insertions(+), 28 deletions(-) diff --git a/verify/VERIFY.md b/verify/VERIFY.md index 7e3c70a..b6bdf2c 100644 --- a/verify/VERIFY.md +++ b/verify/VERIFY.md @@ -230,7 +230,9 @@ round; no extra build). The numbers leave as attributes of one `perf-result` spa median(on) / median(off) ≥ 3×. It measures the test-mode build, which crosses the same hand-off seam as production. Pixel_9 emulator (API 36, arm64), 2 runs: p50 26.9–27.3 µs (p95 53–58 µs, `end()` alone p50 13.8–14.2 µs), ratio 1.70–1.71. CI: the `perf.json` of record is the `verify-artifacts-e2e-android-bare` artifact of the PR's latest green run -(RUN LINK: TO BE FILLED IN). +([run 45358145497, artifact](https://github.com/callstack/react-native-open-telemetry/actions/runs/45358145497/artifacts/14904400776)): +hosted x86_64 emulator (API 35): p50 76.9 µs (p95 686 µs, `end()` alone 41.8 µs), ratio 2.19. CI emulators are ~3× slower +than the local arm64 one, so the 100 µs gate has less headroom there. **Bundle size** (`static`, `bundle-size`): `@opentelemetry/semantic-conventions` is about 56 % of the SDK share of the release bundle (146,789 of 264,120 B). Upstream barrel imports pull in the whole stable entry, though the SDK uses a few @@ -316,9 +318,9 @@ CI job `compliance` (needs every e2e job) downloads their `verify-artifacts-e2e- `verbosity: detailed`) and runs `bun verify/compliance/replay.ts --url http://localhost:4318 --dirs <dir>...`. It POSTs every `raw/*/<n>.pb` as `application/x-protobuf`, every raw `.json` and every `verify/expected/*.otlp.json` as `application/json`; a non-2xx or a `\terror\t` collector log line fails the job. Needs docker, so it is not in `bun verify`. -X9: `JSON_EXCEPTIONS` in `replay.ts` names the `odd-attributes.*.otlp.json` files (NaN/Infinity `doubleValue` strings) whose -JSON rejection is only warned about; the protobuf raw requests still prove the value. Delete the list once CI shows the -Collector accepts them. +X9 settled: Collector 0.165.0 accepts the NaN/Infinity `doubleValue` strings in `odd-attributes.*.otlp.json` (run +[45358145497](https://github.com/callstack/react-native-open-telemetry/actions/runs/45358145497): 110 raw requests and +84 expected files, no errors), so every file must be 2xx. ## Scenarios diff --git a/verify/compliance/replay.ts b/verify/compliance/replay.ts index 89fc9fa..0664d2c 100644 --- a/verify/compliance/replay.ts +++ b/verify/compliance/replay.ts @@ -4,16 +4,6 @@ import fs from 'node:fs'; import path from 'node:path'; -// X9: the Collector's OTLP/JSON parser may reject `"doubleValue": "NaN"` / "Infinity" strings (protojson allows -// them, pdata's reader is unverified). A rejection of these files is reported loudly, not failed: the protobuf raw -// requests of the same scenarios still prove the value reaches a real Collector. Anything else must be 2xx. -export const JSON_EXCEPTIONS: Record<string, string> = { - 'odd-attributes.js.otlp.json': 'X9: NaN/Infinity doubleValue strings; protobuf raw requests cover it', - 'odd-attributes.android.otlp.json': 'X9: NaN/Infinity doubleValue strings; protobuf raw requests cover it', - 'odd-attributes.ios.otlp.json': 'X9: NaN/Infinity doubleValue strings; protobuf raw requests cover it', - 'odd-attributes.web.otlp.json': 'X9: NaN/Infinity doubleValue strings; protobuf raw requests cover it', -}; - const walk = (d: string): string[] => fs.readdirSync(d, {withFileTypes: true}).flatMap(e => { const p = path.join(d, e.name); @@ -25,16 +15,15 @@ const isRaw = (f: string) => /\.(pb|json)$/.test(f) && !f.endsWith('.headers.json') && path.basename(path.dirname(path.dirname(f))) === 'raw'; export async function replay(opts: {url: string; dirs: string[]; expected?: string}) { - const jobs: {file: string; type: string; exception?: string}[] = []; + const jobs: {file: string; type: string}[] = []; for (const d of opts.dirs) for (const f of walk(d).filter(isRaw).sort()) jobs.push({file: f, type: f.endsWith('.pb') ? 'application/x-protobuf' : 'application/json'}); const raw = jobs.length; if (opts.expected) for (const f of fs.readdirSync(opts.expected).filter(f => f.endsWith('.otlp.json')).sort()) - jobs.push({file: path.join(opts.expected, f), type: 'application/json', exception: JSON_EXCEPTIONS[f]}); + jobs.push({file: path.join(opts.expected, f), type: 'application/json'}); const failures: string[] = []; - const tolerated: string[] = []; for (const j of jobs) { const res = await fetch(`${opts.url}/v1/traces`, { method: 'POST', @@ -42,11 +31,9 @@ export async function replay(opts: {url: string; dirs: string[]; expected?: stri body: fs.readFileSync(j.file), }); const text = await res.text(); - if (res.ok) continue; - const msg = `${j.file}: HTTP ${res.status} ${text.slice(0, 200)}`; - (j.exception ? tolerated : failures).push(j.exception ? `${msg} [tolerated: ${j.exception}]` : msg); + if (!res.ok) failures.push(`${j.file}: HTTP ${res.status} ${text.slice(0, 200)}`); } - return {raw, expected: jobs.length - raw, failures, tolerated}; + return {raw, expected: jobs.length - raw, failures}; } async function main() { @@ -66,7 +53,6 @@ async function main() { expected: arg('--expected')?.[0] ?? path.join(__dirname, '..', 'expected'), }); console.log(`replayed ${r.raw} raw requests and ${r.expected} expected files`); - for (const t of r.tolerated) console.warn(`WARNING ${t}`); for (const f of r.failures) console.error(`FAIL ${f}`); if (r.failures.length) process.exit(1); if (r.raw === 0) { diff --git a/verify/harness/__tests__/replay.test.ts b/verify/harness/__tests__/replay.test.ts index 94c3460..a79932f 100644 --- a/verify/harness/__tests__/replay.test.ts +++ b/verify/harness/__tests__/replay.test.ts @@ -4,7 +4,7 @@ import path from 'path'; import {startCollector} from '../collector'; import {replay} from '../../compliance/replay'; -test('replay posts raw + expected files, fails on a non-2xx, tolerates only listed JSON exceptions', async () => { +test('replay posts raw + expected files, fails on a non-2xx', async () => { const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'replay-')); const c = await startCollector({port: 0, artifactsDir: path.join(dir, 'sink')}); try { @@ -17,15 +17,11 @@ test('replay posts raw + expected files, fails on a non-2xx, tolerates only list fs.mkdirSync(exp); fs.writeFileSync(path.join(exp, 'a.js.otlp.json'), good); const ok = await replay({url: c.url, dirs: [path.join(dir, 'dl')], expected: exp}); - expect(ok).toEqual({raw: 1, expected: 1, failures: [], tolerated: []}); + expect(ok).toEqual({raw: 1, expected: 1, failures: []}); fs.writeFileSync(path.join(exp, 'b.js.otlp.json'), '{not json'); const bad = await replay({url: c.url, dirs: [path.join(dir, 'dl')], expected: exp}); expect(bad.failures).toHaveLength(1); - fs.renameSync(path.join(exp, 'b.js.otlp.json'), path.join(exp, 'odd-attributes.js.otlp.json')); - const exc = await replay({url: c.url, dirs: [path.join(dir, 'dl')], expected: exp}); - expect(exc.failures).toEqual([]); - expect(exc.tolerated).toHaveLength(1); } finally { await c.close(); }