react-native-nami-sdk 3.3.9-dev.202603180145 → 3.3.9-dev.202603181547
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +97 -0
- package/android/build.gradle +2 -2
- package/dist/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/react-native-nami-sdk.podspec +1 -1
- package/src/version.ts +1 -1
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Repository Overview
|
|
6
|
+
|
|
7
|
+
This is the Nami React Native SDK (`react-native-nami-sdk`), a TypeScript bridge layer that exposes native Android and iOS SDK functionality to React Native applications via TurboModules. The SDK is a thin bridge — all business logic lives in the native Android and Apple SDKs.
|
|
8
|
+
|
|
9
|
+
## Development Setup
|
|
10
|
+
|
|
11
|
+
### Prerequisites
|
|
12
|
+
- Node.js 20+
|
|
13
|
+
- npm
|
|
14
|
+
- For iOS bridge work: Xcode + CocoaPods
|
|
15
|
+
- For Android bridge work: Android Studio with JDK 17
|
|
16
|
+
|
|
17
|
+
### Install dependencies
|
|
18
|
+
```bash
|
|
19
|
+
cd sdk/react-native && npm install
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Build Commands
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# From monorepo root
|
|
26
|
+
make build-react-native # Install npm dependencies
|
|
27
|
+
make test-react-native # Run Jest unit tests
|
|
28
|
+
make lint-react-native # Run pre-commit + ktlint checks
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Directly
|
|
33
|
+
cd sdk/react-native
|
|
34
|
+
npm test # Run Jest unit tests
|
|
35
|
+
npm run lint # ESLint
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Project Structure
|
|
39
|
+
|
|
40
|
+
- `src/` — TypeScript bridge layer (managers, types, transformers)
|
|
41
|
+
- `specs/` — TurboModule native interface specs (Codegen)
|
|
42
|
+
- `android/` — Kotlin native bridge modules
|
|
43
|
+
- `ios/` — Swift + Objective-C native bridge
|
|
44
|
+
- `dist/` — Built `.d.ts` type declarations (`emitDeclarationOnly`)
|
|
45
|
+
- `examples/Basic/` — Full-featured sample app with Detox e2e tests
|
|
46
|
+
- `examples/TestNamiTV/` — tvOS sample app
|
|
47
|
+
- `build-utils/` — Version management scripts
|
|
48
|
+
|
|
49
|
+
## Architecture
|
|
50
|
+
|
|
51
|
+
The SDK is a **thin bridge** — no business logic lives here. TypeScript managers wrap TurboModules; TurboModules call into the native Android/Apple SDKs.
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
JavaScript (React Native)
|
|
55
|
+
↓
|
|
56
|
+
TypeScript Managers (src/)
|
|
57
|
+
↓
|
|
58
|
+
TurboModule Specs (specs/)
|
|
59
|
+
↓
|
|
60
|
+
Native Bridge Modules (android/ + ios/)
|
|
61
|
+
↓
|
|
62
|
+
Native SDKs (com.namiml:sdk-android / Nami CocoaPod)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Adding or changing bridge methods
|
|
66
|
+
|
|
67
|
+
1. Update the TurboModule spec in `specs/` (TypeScript interface)
|
|
68
|
+
2. Update the TypeScript manager in `src/`
|
|
69
|
+
3. Update the Kotlin bridge module in `android/`
|
|
70
|
+
4. Update the Swift bridge module in `ios/`
|
|
71
|
+
5. Run `npm run lint` and `make test-react-native` before committing
|
|
72
|
+
|
|
73
|
+
## Testing
|
|
74
|
+
|
|
75
|
+
### Unit Tests (Jest + ts-jest)
|
|
76
|
+
Tests cover the pure data transformation layer in `src/transformers.ts` and live in `src/__tests__/`.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
make test-react-native
|
|
80
|
+
# or: cd sdk/react-native && npm test
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### E2E Tests (Detox)
|
|
84
|
+
Located in `examples/Basic/e2e/`. Run via CI. See `ARCHITECTURE.md` for local native SDK resolution setup required before running e2e locally.
|
|
85
|
+
|
|
86
|
+
## Code Quality
|
|
87
|
+
|
|
88
|
+
- **ESLint** (`@react-native` config) + **Prettier** for TypeScript
|
|
89
|
+
- **ktlint** for Kotlin bridge code — run `ktlint -F` on changed `.kt` files before committing
|
|
90
|
+
- Pre-commit hooks via `.pre-commit-config.yaml`
|
|
91
|
+
|
|
92
|
+
## Key Files
|
|
93
|
+
|
|
94
|
+
- `src/index.ts` — Main exports
|
|
95
|
+
- `src/types.ts` — All public TypeScript types
|
|
96
|
+
- `src/transformers.ts` — Data transformation between native and JS types (unit-tested)
|
|
97
|
+
- `specs/` — TurboModule specs (source of truth for the native bridge contract)
|
package/android/build.gradle
CHANGED
|
@@ -85,8 +85,8 @@ dependencies {
|
|
|
85
85
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
86
86
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
87
87
|
|
|
88
|
-
playImplementation "com.namiml:sdk-android:3.3.9-dev.
|
|
89
|
-
amazonImplementation "com.namiml:sdk-amazon:3.3.9-dev.
|
|
88
|
+
playImplementation "com.namiml:sdk-android:3.3.9-dev.202603181547"
|
|
89
|
+
amazonImplementation "com.namiml:sdk-amazon:3.3.9-dev.202603181547"
|
|
90
90
|
|
|
91
91
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
92
92
|
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.0.4"
|
package/dist/src/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-nami-sdk",
|
|
3
|
-
"version": "3.3.9-dev.
|
|
3
|
+
"version": "3.3.9-dev.202603181547",
|
|
4
4
|
"description": "React Native SDK for Nami - No-code paywall and onboarding flows with A/B testing.",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -21,7 +21,7 @@ Pod::Spec.new do |s|
|
|
|
21
21
|
s.requires_arc = true
|
|
22
22
|
s.swift_version = '5.0' # or your supported version
|
|
23
23
|
|
|
24
|
-
s.dependency 'Nami', '3.3.9-dev.
|
|
24
|
+
s.dependency 'Nami', '3.3.9-dev.202603181547'
|
|
25
25
|
|
|
26
26
|
pod_target_xcconfig = {
|
|
27
27
|
'DEFINES_MODULE' => 'YES',
|
package/src/version.ts
CHANGED