Skip to content

Commit 14697fc

Browse files
committed
docs(example-setup): document iOS pod setup rules by RN version
1 parent f935260 commit 14697fc

2 files changed

Lines changed: 41 additions & 9 deletions

File tree

scripts/setupExampleApp/README.ko.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ npm run setup-example-app -- -v <react-native-버전>
3333

3434
| 플래그 | 설명 | 기본값 |
3535
|---|---|---|
36-
| `-v, --rn-version <version>` | React Native 버전 (예: `0.83.1`, `0.84.0-rc.5`) | **필수** |
36+
| `-v, --rn-version <version>` | React Native 버전 (예: `0.83.1`, `0.84.0`) | **필수** |
3737
| `-w, --working-dir <path>` | 앱이 생성될 디렉토리 | `./Examples` |
38+
| `--force-recreate` | 기존 `RNxxxx` 디렉토리를 삭제하고 다시 생성 | `false` |
3839
| `--skip-pod-install` | `bundle install``pod install`을 건너뜀 | `false` |
3940

4041
### 실행 예시
@@ -44,7 +45,10 @@ npm run setup-example-app -- -v <react-native-버전>
4445
npm run setup-example-app -- -v 0.83.1
4546

4647
# pod install 없이 생성 (macOS가 아니거나 CI 환경에서 유용)
47-
npm run setup-example-app -- -v 0.84.0-rc.5 --skip-pod-install
48+
npm run setup-example-app -- -v 0.84.0 --skip-pod-install
49+
50+
# 기존 예제 앱 디렉토리를 다시 생성
51+
npm run setup-example-app -- -v 0.83.1 --force-recreate
4852
```
4953

5054
생성된 프로젝트는 `Examples/RN<버전>/` 경로에 위치합니다 (예: `Examples/RN0831/`).
@@ -75,10 +79,22 @@ npm run setup-example-app -- -v 0.84.0-rc.5 --skip-pod-install
7579
`package.json`을 수정하여 로컬 라이브러리를 연결합니다:
7680
- `@bravemobile/react-native-code-push`를 dependency로 추가합니다.
7781
- `syncLocalLibrary.ts`를 가리키는 `sync-local-library` npm 스크립트를 추가합니다.
78-
- `setup:pods` 편의 스크립트를 추가합니다 (`bundle install && cd ios && bundle exec pod install`).
82+
- RN 버전에 따라 달라지는 `setup:pods` 편의 스크립트를 추가합니다.
7983
- `postinstall` 훅에 `sync-local-library`를 등록하여, `npm install` 시마다 로컬 빌드가 자동 동기화되도록 합니다.
8084
- 누락된 필수 dev dependencies를 설치합니다: `ts-node`, `axios`, `@types/node`, `@supabase/supabase-js`.
8185

86+
### RN 버전별 iOS prebuild 동작
87+
88+
생성되는 `setup:pods` 스크립트는 React Native 버전에 따라 자동으로 달라집니다.
89+
90+
- RN `< 0.81.0`: `bundle install && cd ios && bundle exec pod install`
91+
- RN `0.81.x` ~ `0.83.x`: `bundle install && cd ios && RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 bundle exec pod install`
92+
- RN `>= 0.84.0`: React Native가 iOS prebuild를 기본 활성화하므로 기본 명령을 그대로 사용합니다
93+
94+
React Native prerelease 템플릿이 실제로 배포된 경우에는 prerelease 빌드도 해당 릴리즈 라인의 규칙을 그대로 따릅니다. 예를 들어 `0.84.0-rc.5`가 게시되어 있다면 기본 명령을 사용합니다.
95+
96+
RN `0.81.x`에서는 legacy architecture 설정과 prebuild opt-in이 서로 독립적입니다. `RCT_NEW_ARCH_ENABLED=0`으로 pod install을 다시 실행하더라도 같은 prebuild 플래그를 함께 전달해야 합니다.
97+
8298
### 5. create-code-push-config
8399

84100
`Examples/CodePushDemoApp/code-push.config.example.supabase.ts` 템플릿 파일을 프로젝트 루트에 `code-push.config.ts`로 복사합니다.
@@ -99,7 +115,7 @@ npm run setup-example-app -- -v 0.84.0-rc.5 --skip-pod-install
99115

100116
### 9. install-ios-pods
101117

102-
`ios/` 디렉토리에서 `bundle install``bundle exec pod install`실행합니다. `--skip-pod-install` 옵션이 지정된 경우 이 단계는 건너뜁니다.
118+
생성된 `setup:pods` 스크립트를 실행하며, 이 스크립트가 대상 RN 버전에 맞는 prebuild 플래그를 붙여 `pod install`수행합니다. `--skip-pod-install` 옵션이 지정된 경우 이 단계는 건너뜁니다.
103119

104120
### 10. initialize-code-push
105121

scripts/setupExampleApp/README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ npm run setup-example-app -- -v <react-native-version>
3333

3434
| Flag | Description | Default |
3535
|---|---|---|
36-
| `-v, --rn-version <version>` | React Native version (e.g. `0.83.1`, `0.84.0-rc.5`) | **Required** |
36+
| `-v, --rn-version <version>` | React Native version (e.g. `0.83.1`, `0.84.0`) | **Required** |
3737
| `-w, --working-dir <path>` | Directory where the app will be created | `./Examples` |
38+
| `--force-recreate` | Remove the existing `RNxxxx` directory before recreating it | `false` |
3839
| `--skip-pod-install` | Skip `bundle install` and `pod install` | `false` |
3940

4041
### Example
@@ -44,7 +45,10 @@ npm run setup-example-app -- -v <react-native-version>
4445
npm run setup-example-app -- -v 0.83.1
4546

4647
# Create without pod install (useful on non-macOS or CI)
47-
npm run setup-example-app -- -v 0.84.0-rc.5 --skip-pod-install
48+
npm run setup-example-app -- -v 0.84.0 --skip-pod-install
49+
50+
# Recreate an existing example app directory
51+
npm run setup-example-app -- -v 0.83.1 --force-recreate
4852
```
4953

5054
The generated project will be placed at `Examples/RN<version>/` (e.g. `Examples/RN0831/`).
@@ -75,10 +79,22 @@ Edits `android/app/build.gradle`:
7579
Modifies `package.json` to wire up the local library:
7680
- Adds `@bravemobile/react-native-code-push` as a dependency.
7781
- Adds an npm `sync-local-library` script pointing to `syncLocalLibrary.ts`.
78-
- Adds a `setup:pods` convenience script (`bundle install && cd ios && bundle exec pod install`).
79-
- Registers `sync-local-library` as a `postinstall` hook so the local build is synced on every `npm install`.
82+
- Adds a version-aware `setup:pods` convenience script.
83+
- Registers `sync-local-library` as a `postinstall` hook so every `npm install` keeps the local build in sync.
8084
- Installs required dev dependencies if missing: `ts-node`, `axios`, `@types/node`, `@supabase/supabase-js`.
8185

86+
### iOS prebuild behavior by React Native version
87+
88+
The generated `setup:pods` script changes automatically by React Native version:
89+
90+
- RN `< 0.81.0`: `bundle install && cd ios && bundle exec pod install`
91+
- RN `0.81.x` to `0.83.x`: `bundle install && cd ios && RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 bundle exec pod install`
92+
- RN `>= 0.84.0`: falls back to the default command because React Native enables iOS prebuilt artifacts by default
93+
94+
When a React Native prerelease template is published, prerelease builds follow the same rule as their target release line. For example, `0.84.0-rc.5` would use the default command.
95+
96+
Legacy architecture is orthogonal to this opt-in for RN `0.81.x`. If you run pods with `RCT_NEW_ARCH_ENABLED=0`, keep the same prebuild flags in the environment.
97+
8298
### 5. create-code-push-config
8399

84100
Copies the config template from `Examples/CodePushDemoApp/code-push.config.example.supabase.ts` into the project root as `code-push.config.ts`.
@@ -99,7 +115,7 @@ Runs `npm install` inside the generated project. Because a `postinstall` hook wa
99115

100116
### 9. install-ios-pods
101117

102-
Runs `bundle install` followed by `bundle exec pod install` inside the `ios/` directory. Skipped entirely when `--skip-pod-install` is specified.
118+
Runs the generated `setup:pods` script, which applies the correct prebuild flags for the target React Native version before `pod install`. Skipped entirely when `--skip-pod-install` is specified.
103119

104120
### 10. initialize-code-push
105121

0 commit comments

Comments
 (0)