This repository was archived by the owner on Apr 26, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 692
feat(ios): add tvOS, macOS, and watchOS platform support #3145
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d363fb4
feat(ios): add tvOS, macOS, and watchOS platform support
hyochan 2aaca59
fix: address PR review comments
hyochan f344b13
fix: address additional PR review comments
hyochan e2bf318
fix(docs): add language tags to fenced code blocks in commit.md
hyochan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,261 @@ | ||
| # Commit Changes | ||
|
|
||
| Complete workflow: branch → commit → push → PR | ||
|
|
||
| ## Usage | ||
|
|
||
| ```text | ||
| /commit [options] | ||
| ``` | ||
|
|
||
| **Options:** | ||
|
|
||
| - `--push` or `-p`: Push to remote after commit | ||
| - `--pr`: Create PR after push (implies --push) | ||
| - `--all` or `-a`: Commit all changes at once | ||
| - `<path>`: Commit only specific path (e.g., `src/hooks`) | ||
|
|
||
| ## Examples | ||
|
|
||
| ```bash | ||
| # Full workflow: commit, push, create PR | ||
| /commit --pr | ||
|
|
||
| # Commit all changes and create PR | ||
| /commit --all --pr | ||
|
|
||
| # Just commit specific path | ||
| /commit src/hooks | ||
|
|
||
| # Commit and push without PR | ||
| /commit --push | ||
| ``` | ||
|
|
||
| ## Complete Workflow | ||
|
|
||
| ### 1. Check Branch | ||
|
|
||
| ```bash | ||
| # Check current branch | ||
| git branch --show-current | ||
| ``` | ||
|
|
||
| **If on `main`** → Create a feature branch first: | ||
|
|
||
| ```bash | ||
| git checkout -b feat/<feature-name> | ||
| ``` | ||
|
|
||
| **If NOT on `main`** → Proceed with commits directly. | ||
|
|
||
| **Branch naming conventions:** | ||
|
|
||
| - `feat/<feature-name>` - New features | ||
| - `fix/<bug-description>` - Bug fixes | ||
| - `docs/<doc-update>` - Documentation only | ||
| - `chore/<task>` - Maintenance tasks | ||
|
|
||
| ### 2. Check Current Status | ||
|
|
||
| ```bash | ||
| git status | ||
| git diff --name-only | ||
| ``` | ||
|
|
||
| ### 3. Stage Changes | ||
|
|
||
| **Specific path:** | ||
|
|
||
| ```bash | ||
| git add <path> | ||
| ``` | ||
|
|
||
| **All changes:** | ||
|
|
||
| ```bash | ||
| git add . | ||
| ``` | ||
|
|
||
| ### 4. Review Staged Changes | ||
|
|
||
| ```bash | ||
| git diff --cached --stat | ||
| git diff --cached --name-only | ||
| ``` | ||
|
|
||
| ### 5. Create Commit | ||
|
|
||
| Follow conventional commit format: | ||
|
|
||
| ```bash | ||
| git commit -m "$(cat <<'EOF' | ||
| <type>(<scope>): <description> | ||
|
|
||
| <body - what changed and why> | ||
|
|
||
| Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> | ||
| EOF | ||
| )" | ||
| ``` | ||
|
|
||
| **Commit Types:** | ||
|
|
||
| | Type | Description | | ||
| | ---------- | --------------------- | | ||
| | `feat` | New feature | | ||
| | `fix` | Bug fix | | ||
| | `docs` | Documentation only | | ||
| | `refactor` | Code refactoring | | ||
| | `chore` | Maintenance tasks | | ||
| | `test` | Adding/updating tests | | ||
|
|
||
| **Scope Examples:** | ||
|
|
||
| - `ios` - iOS native code changes | ||
| - `android` - Android native code changes | ||
| - `hooks` - React hooks (useIAP) | ||
| - `types` - TypeScript type definitions | ||
| - `nitro` - Nitro module specs | ||
| - `podspec` - CocoaPods configuration | ||
|
|
||
| ### 6. Push to Remote | ||
|
|
||
| ```bash | ||
| git push -u origin <branch-name> | ||
| ``` | ||
|
|
||
| ### 7. Create Pull Request | ||
|
|
||
| ```bash | ||
| gh pr create --title "<type>(<scope>): <description>" --body "$(cat <<'EOF' | ||
| ## Summary | ||
|
|
||
| <1-3 bullet points describing changes> | ||
|
|
||
| ## Changes | ||
|
|
||
| ### <Category 1> | ||
| - Change 1 | ||
| - Change 2 | ||
|
|
||
| ### <Category 2> | ||
| - Change 1 | ||
|
|
||
| ## Test plan | ||
|
|
||
| - [ ] `yarn typecheck` passes | ||
| - [ ] `yarn lint` passes | ||
| - [ ] `yarn test` passes | ||
|
|
||
| 🤖 Generated with [Claude Code](https://claude.ai/code) | ||
| EOF | ||
| )" | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Commit Order (Recommended) | ||
|
|
||
| When making cross-platform changes, commit in this order: | ||
|
|
||
| | Order | Path | Description | | ||
| | ----- | --------------------- | ------------------------------------------ | | ||
| | 1 | `src/specs/` | Nitro interface definitions | | ||
| | 2 | `nitrogen/generated/` | Generated Nitro files (after `yarn specs`) | | ||
| | 3 | `ios/` | iOS native implementation | | ||
| | 4 | `android/` | Android native implementation | | ||
| | 5 | `src/` | TypeScript implementation | | ||
| | 6 | `src/__tests__/` | Test files | | ||
| | 7 | `*.podspec` | CocoaPods configuration | | ||
|
|
||
| --- | ||
|
|
||
| ## Example Commit Messages | ||
|
|
||
| **Feature addition:** | ||
|
|
||
| ```text | ||
| feat(ios): add tvOS and macOS platform support | ||
|
|
||
| - Add tvOS 15.0 and macOS 14.0 to podspec platforms | ||
| - Add platform detection helpers (isTVOS, isMacOS, isStandardIOS) | ||
| - Skip promotedProductListenerIOS on tvOS/macOS | ||
| - Update Swift availability annotations | ||
|
|
||
| Closes #3141 | ||
|
|
||
| Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> | ||
|
hyochan marked this conversation as resolved.
|
||
| ``` | ||
|
|
||
| **Bug fix:** | ||
|
|
||
| ```text | ||
| fix(hooks): register listeners after initConnection | ||
|
|
||
| Move listener registration after initConnection succeeds | ||
| to ensure Nitro runtime is fully initialized. This fixes | ||
| crashes on platforms where Nitro initializes later. | ||
|
|
||
| Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> | ||
|
hyochan marked this conversation as resolved.
|
||
| ``` | ||
|
|
||
| **Chore/maintenance:** | ||
|
|
||
| ```text | ||
| chore(deps): update OpenIAP to 1.3.11 | ||
|
|
||
| Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> | ||
|
hyochan marked this conversation as resolved.
|
||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Example PR Body | ||
|
|
||
| ```markdown | ||
| ## Summary | ||
|
|
||
| - Add tvOS 15.0 and macOS 14.0 platform support | ||
| - Fix Nitro initialization timing for non-iOS platforms | ||
| - Add platform detection helpers | ||
|
|
||
| ## Changes | ||
|
|
||
| ### Podspec (NitroIap.podspec) | ||
|
|
||
| - Add `:tvos => '15.0'` and `:macos => '14.0'` platforms | ||
|
|
||
| ### iOS Native (ios/) | ||
|
|
||
| - Update `@available` to include all platforms | ||
|
|
||
| ### TypeScript (src/) | ||
|
|
||
| - Add `isTVOS()`, `isMacOS()`, `isStandardIOS()` helpers | ||
| - Skip promoted product listener on tvOS/macOS | ||
| - Register listeners after initConnection succeeds | ||
|
|
||
| ### Tests (src/\_\_tests\_\_/) | ||
|
|
||
| - Add platform detection tests | ||
|
|
||
| ## Test plan | ||
|
|
||
| - [x] `yarn typecheck` passes | ||
| - [x] `yarn lint` passes | ||
| - [x] `yarn test` passes | ||
|
|
||
| 🤖 Generated with [Claude Code](https://claude.ai/code) | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Quick Reference | ||
|
|
||
| ```bash | ||
| # Full workflow from main | ||
| git checkout -b feat/my-feature | ||
| git add . | ||
| git commit -m "feat(scope): description" | ||
| git push -u origin feat/my-feature | ||
| gh pr create --title "feat(scope): description" --body "..." | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # Review PR Comments | ||
|
|
||
| Review and address PR review comments for this repository. | ||
|
|
||
| ## Arguments | ||
|
|
||
| - `$ARGUMENTS` - PR number (e.g., `123`) or PR URL | ||
|
|
||
| ## Project-Specific Build Commands | ||
|
|
||
| Based on changed files, run these checks BEFORE committing: | ||
|
|
||
| | Path | Commands | | ||
| | ----------- | ----------------------------------------------- | | ||
| | `src/` | `yarn typecheck && yarn lint && yarn test` | | ||
| | `ios/` | `cd example/ios && bundle exec pod install` | | ||
| | `android/` | `cd example/android && ./gradlew assembleDebug` | | ||
| | `plugin/` | `yarn typecheck && yarn test` | | ||
| | `*.podspec` | `pod lib lint --allow-warnings` | | ||
|
|
||
| ## Project Conventions | ||
|
|
||
| When reviewing, check these project-specific rules: | ||
|
|
||
| - **iOS functions**: Must end with `IOS` suffix (e.g., `getStorefrontIOS`) | ||
| - **Android functions**: Must end with `Android` suffix (e.g., `consumePurchaseAndroid`) | ||
| - **Cross-platform functions**: No suffix (e.g., `initConnection`, `fetchProducts`) | ||
| - **Generated files**: Do NOT edit files in `nitrogen/generated/` or `src/types.ts` | ||
| - **Type imports**: Use `import type` for type-only imports | ||
|
|
||
| See [CLAUDE.md](../../CLAUDE.md) for full conventions. | ||
|
|
||
| ## Reply Format Rules (CRITICAL) | ||
|
|
||
| When replying to PR comments: | ||
|
|
||
| ### Commit Hash Formatting | ||
|
|
||
| **NEVER wrap commit hashes in backticks or code blocks.** GitHub only auto-links plain text commit hashes. | ||
|
|
||
| | Format | Example | Result | | ||
| | ---------- | ----------------------- | ------------------------ | | ||
| | ✅ CORRECT | `Fixed in f3b5fec.` | Clickable link to commit | | ||
| | ❌ WRONG | `Fixed in \`f3b5fec\`.` | Plain text, no link | | ||
|
|
||
| **Examples of correct replies:** | ||
|
|
||
| ```text | ||
| Fixed in f3b5fec. | ||
|
|
||
| **Changes:** | ||
| - Updated listener registration order | ||
| ``` | ||
|
|
||
| ```text | ||
| Fixed in abc1234 along with other review items. | ||
| ``` | ||
|
|
||
| **Do NOT use backticks around the commit hash** - this breaks GitHub's auto-linking feature. | ||
|
|
||
| ## Workflow | ||
|
|
||
| 1. Fetch PR comments: `gh pr view <number> --comments` | ||
| 2. Review each comment and understand the requested change | ||
| 3. Make the necessary code changes | ||
| 4. Run relevant build commands based on changed files | ||
| 5. Commit with descriptive message referencing the review | ||
| 6. Push changes | ||
| 7. Reply to each comment with the fix commit hash (no backticks!) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.