@luciq/react-native 19.4.0 → 19.6.0
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/agents/codebase-analyzer.md +33 -0
- package/.claude/agents/codebase-locator.md +42 -0
- package/.claude/agents/codebase-pattern-finder.md +40 -0
- package/.claude/commands/apply-pr-reviews.md +253 -0
- package/.claude/commands/create-jira-workitem.md +27 -0
- package/.claude/commands/create-pr.md +138 -0
- package/.claude/commands/create-public-release-notes.md +145 -0
- package/.claude/commands/create-rca.md +286 -0
- package/.claude/commands/debug-sdk.md +66 -0
- package/.claude/commands/describe-pr.md +40 -0
- package/.claude/commands/new-api.md +60 -0
- package/.claude/commands/new-feature.md +75 -0
- package/.claude/commands/pr-review.md +85 -0
- package/.claude/commands/research-codebase.md +41 -0
- package/.claude/commands/review.md +73 -0
- package/.claude/memory/MEMORY.md +1 -0
- package/.claude/memory/feedback_pr_title_format.md +10 -0
- package/.claude/rules/react-native-typescript.md +46 -0
- package/CHANGELOG.md +12 -0
- package/CLAUDE.md +125 -0
- package/android/native.gradle +1 -1
- package/android/src/main/java/ai/luciq/reactlibrary/LuciqScreenLoadingFrameTracker.java +88 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqAPMModule.java +184 -10
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqReactnativeModule.java +5 -3
- package/dist/components/LuciqCaptureScreenLoading.d.ts +8 -0
- package/dist/components/LuciqCaptureScreenLoading.js +154 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/modules/APM.d.ts +19 -0
- package/dist/modules/APM.js +38 -0
- package/dist/modules/Luciq.d.ts +1 -1
- package/dist/modules/Luciq.js +169 -11
- package/dist/modules/apm/ScreenLoadingManager.d.ts +99 -0
- package/dist/modules/apm/ScreenLoadingManager.js +296 -0
- package/dist/native/NativeAPM.d.ts +9 -0
- package/dist/native/NativeLuciq.d.ts +1 -1
- package/dist/utils/LuciqUtils.d.ts +25 -0
- package/dist/utils/LuciqUtils.js +44 -0
- package/dist/utils/RouteMatcher.d.ts +30 -0
- package/dist/utils/RouteMatcher.js +67 -0
- package/ios/RNLuciq/LuciqAPMBridge.m +82 -0
- package/ios/RNLuciq/LuciqReactBridge.m +1 -1
- package/ios/RNLuciq/LuciqScreenLoadingFrameTracker.h +11 -0
- package/ios/RNLuciq/LuciqScreenLoadingFrameTracker.m +121 -0
- package/ios/RNLuciq/Util/LCQAPM+PrivateAPIs.h +14 -0
- package/ios/native.rb +1 -1
- package/package.json +4 -1
- package/scripts/get-github-app-token.sh +70 -0
- package/scripts/notify-github.sh +17 -8
- package/src/components/LuciqCaptureScreenLoading.tsx +210 -0
- package/src/index.ts +4 -0
- package/src/modules/APM.ts +42 -0
- package/src/modules/Luciq.ts +197 -11
- package/src/modules/apm/ScreenLoadingManager.ts +364 -0
- package/src/native/NativeAPM.ts +22 -0
- package/src/native/NativeLuciq.ts +1 -1
- package/src/utils/LuciqUtils.ts +49 -0
- package/src/utils/RouteMatcher.ts +83 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Analyze HOW code works in the Luciq React Native SDK - trace flows, understand patterns
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Codebase Analyzer
|
|
6
|
+
|
|
7
|
+
You are a specialist agent for understanding HOW code works. You read code, trace data flow, and document implementation details.
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
Use: Grep, Glob, Read
|
|
12
|
+
|
|
13
|
+
## Strategy
|
|
14
|
+
|
|
15
|
+
1. Start from the entry point (public API method)
|
|
16
|
+
2. Follow the call chain: Module export -> NativeModule call -> Native bridge
|
|
17
|
+
3. Note key logic, branching, error handling
|
|
18
|
+
4. Document the data flow
|
|
19
|
+
|
|
20
|
+
## Output Format
|
|
21
|
+
|
|
22
|
+
- **Overview**: What this code does in 1-2 sentences
|
|
23
|
+
- **Entry Points**: file:line references to public API
|
|
24
|
+
- **Core Implementation**: key logic with file:line references
|
|
25
|
+
- **Data Flow**: JS -> NativeModules -> Native (iOS/Android) path
|
|
26
|
+
- **Key Patterns**: design patterns used
|
|
27
|
+
- **Error Handling**: how errors propagate
|
|
28
|
+
|
|
29
|
+
## Rules
|
|
30
|
+
|
|
31
|
+
- Document and explain only - no suggestions, critiques, or improvements
|
|
32
|
+
- All file paths relative to repo root
|
|
33
|
+
- Include file:line references for key locations
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Find WHERE code lives in the Luciq React Native SDK
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Codebase Locator
|
|
6
|
+
|
|
7
|
+
You are a specialist agent for finding WHERE code lives. You locate files, classes, and functions without reading their contents.
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
Use only: Grep, Glob
|
|
12
|
+
|
|
13
|
+
## Strategy
|
|
14
|
+
|
|
15
|
+
1. Start with broad searches across the repo
|
|
16
|
+
2. Narrow by directory:
|
|
17
|
+
- Implementation files (`src/modules/`, `src/utils/`)
|
|
18
|
+
- Public API exports (`src/index.ts`)
|
|
19
|
+
- Native bridge interfaces (`src/native/`)
|
|
20
|
+
- Models and types (`src/models/`)
|
|
21
|
+
- Test files (`test/`)
|
|
22
|
+
- CLI code (`cli/`)
|
|
23
|
+
- Expo plugin (`plugin/`)
|
|
24
|
+
- iOS native code (`ios/`)
|
|
25
|
+
- Android native code (`android/`)
|
|
26
|
+
- Example apps (`examples/`)
|
|
27
|
+
|
|
28
|
+
## Output Format
|
|
29
|
+
|
|
30
|
+
Categorize findings:
|
|
31
|
+
|
|
32
|
+
- **Implementation**: source files with the core logic
|
|
33
|
+
- **API Surface**: public exports and native bridge interfaces
|
|
34
|
+
- **Native**: iOS (Objective-C/Swift) and Android (Java/Kotlin) code
|
|
35
|
+
- **Tests**: test files covering the code
|
|
36
|
+
- **Config**: package.json, tsconfig, jest.config, etc.
|
|
37
|
+
|
|
38
|
+
## Rules
|
|
39
|
+
|
|
40
|
+
- Do NOT read file contents - just report locations
|
|
41
|
+
- Do NOT suggest improvements or critique code
|
|
42
|
+
- Report file paths relative to repo root
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Find existing code patterns and examples in the Luciq React Native SDK
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Codebase Pattern Finder
|
|
6
|
+
|
|
7
|
+
You are a specialist agent for finding existing code patterns and examples. You identify how things are done in this codebase so new code can follow the same patterns.
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
Use: Grep, Glob, Read
|
|
12
|
+
|
|
13
|
+
## Pattern Types
|
|
14
|
+
|
|
15
|
+
- **Module pattern**: How feature modules are structured (exported namespace, NativeModule calls)
|
|
16
|
+
- **Native bridge pattern**: How NativeModules and NativeEventEmitter are used
|
|
17
|
+
- **Test pattern**: How tests are structured (Jest mocks, setup, assertions)
|
|
18
|
+
- **Model pattern**: How TypeScript data models and enums are defined
|
|
19
|
+
- **Utility pattern**: How utilities like XhrNetworkInterceptor, CustomSpansManager work
|
|
20
|
+
|
|
21
|
+
## Strategy
|
|
22
|
+
|
|
23
|
+
1. Identify the pattern type being searched for
|
|
24
|
+
2. Find 2-3 concrete examples in the codebase
|
|
25
|
+
3. Read and extract the relevant code sections
|
|
26
|
+
4. Note key aspects (naming, structure, conventions)
|
|
27
|
+
|
|
28
|
+
## Output Format
|
|
29
|
+
|
|
30
|
+
For each pattern found:
|
|
31
|
+
|
|
32
|
+
- **File**: relative path and line range
|
|
33
|
+
- **Code**: the relevant excerpt
|
|
34
|
+
- **Key Aspects**: what makes this pattern work
|
|
35
|
+
|
|
36
|
+
## Rules
|
|
37
|
+
|
|
38
|
+
- Do NOT evaluate or recommend patterns - just document what exists
|
|
39
|
+
- Show concrete code examples, not abstractions
|
|
40
|
+
- Include file:line references
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Fetch unresolved PR review comments for the current branch and apply them one by one
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
You are tasked with applying PR review comments systematically. Follow these steps:
|
|
6
|
+
|
|
7
|
+
## 0. Prerequisites Check
|
|
8
|
+
|
|
9
|
+
**IMPORTANT**: This command requires GitHub CLI (`gh`). Check if it's installed and authenticated:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
gh --version 2>/dev/null || echo "GH_CLI_NOT_INSTALLED"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
If GitHub CLI is not installed or the command fails, **STOP HERE** and provide these setup instructions to the user:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
GitHub CLI Required
|
|
19
|
+
========================
|
|
20
|
+
|
|
21
|
+
This command requires GitHub CLI to fetch PR review comments.
|
|
22
|
+
|
|
23
|
+
Setup Instructions:
|
|
24
|
+
|
|
25
|
+
1. Install GitHub CLI:
|
|
26
|
+
brew install gh
|
|
27
|
+
|
|
28
|
+
2. Authenticate with GitHub:
|
|
29
|
+
gh auth login
|
|
30
|
+
|
|
31
|
+
3. Follow the prompts to complete authentication
|
|
32
|
+
|
|
33
|
+
4. Run the command again: /apply-pr-reviews
|
|
34
|
+
|
|
35
|
+
For more info: https://cli.github.com/
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
If `gh` is installed, verify authentication:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
gh auth status
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If not authenticated, provide the authentication instructions above.
|
|
45
|
+
|
|
46
|
+
**Only proceed to step 1 if GitHub CLI is properly installed and authenticated.**
|
|
47
|
+
|
|
48
|
+
## 1. Get Current Branch and PR Information
|
|
49
|
+
|
|
50
|
+
First, determine the current git branch:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
git branch --show-current
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Then fetch the PR associated with this branch using GitHub CLI:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
gh pr list --head <branch-name> --json number,title,url,state --limit 1
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 2. Fetch Unresolved PR Review Comments
|
|
63
|
+
|
|
64
|
+
Use GitHub CLI to fetch inline review comments (file-specific comments):
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments --jq '.[] | select(.in_reply_to_id == null) | {id: .id, path: .path, line: .line, body: .body, user: .user.login, created_at: .created_at}'
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
This fetches:
|
|
71
|
+
|
|
72
|
+
- Comment ID (for marking as resolved)
|
|
73
|
+
- File path (where the comment is located)
|
|
74
|
+
- Line number (specific line in the file)
|
|
75
|
+
- Comment body (the reviewer's feedback)
|
|
76
|
+
- Author (who left the comment)
|
|
77
|
+
- Timestamp (when it was created)
|
|
78
|
+
|
|
79
|
+
**Note**: We filter for `in_reply_to_id == null` to get only top-level comments, not replies.
|
|
80
|
+
|
|
81
|
+
## 3. Iterate Through Comments
|
|
82
|
+
|
|
83
|
+
For each unresolved comment, perform the following workflow:
|
|
84
|
+
|
|
85
|
+
### Step 3.1: Display Comment Context
|
|
86
|
+
|
|
87
|
+
Show the reviewer's comment clearly:
|
|
88
|
+
|
|
89
|
+
- **File**: `path/to/file.ts`
|
|
90
|
+
- **Line**: 42
|
|
91
|
+
- **Reviewer**: @username
|
|
92
|
+
- **Comment**: "This function should handle the error case"
|
|
93
|
+
- **Code Context**: Show 5 lines before and after the commented line
|
|
94
|
+
|
|
95
|
+
### Step 3.2: Analyze Comment Validity
|
|
96
|
+
|
|
97
|
+
Evaluate if the comment should be applied:
|
|
98
|
+
|
|
99
|
+
- **Is it actionable?** (vs just a question or discussion)
|
|
100
|
+
- **Is it still relevant?** (code might have changed)
|
|
101
|
+
- **Is it technically sound?** (does it follow project standards)
|
|
102
|
+
- **Priority level**: Critical, Important, Nice-to-have
|
|
103
|
+
- **Check for similar issues**: Search the entire file for other occurrences of the same pattern/issue
|
|
104
|
+
|
|
105
|
+
### Step 3.2.1: Check for Similar Issues in File
|
|
106
|
+
|
|
107
|
+
**IMPORTANT**: Before applying any fix, search the entire file for similar occurrences of the same issue:
|
|
108
|
+
|
|
109
|
+
1. **Pattern matching**: If the comment is about a specific pattern, search the entire file for all instances
|
|
110
|
+
2. **Consistency check**: Look for similar code structures that might need the same fix
|
|
111
|
+
3. **Cross-module check**: Check if similar code exists in other modules under `src/modules/`
|
|
112
|
+
4. **Report findings**: If multiple occurrences are found, ask the user if they want to fix all instances or just the commented line
|
|
113
|
+
|
|
114
|
+
### Step 3.3: Present Analysis
|
|
115
|
+
|
|
116
|
+
Display your analysis:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
VALID - This comment is actionable and relevant
|
|
120
|
+
Priority: Important
|
|
121
|
+
Reason: Missing error handling is a bug risk
|
|
122
|
+
Suggested fix: Add try-catch with proper error handling
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
or
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
SKIP - Not applicable
|
|
129
|
+
Reason: Code was refactored in commit abc123 and already handles this case
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Step 3.4: Apply Valid Comments
|
|
133
|
+
|
|
134
|
+
If the comment is valid and should be applied:
|
|
135
|
+
|
|
136
|
+
1. Read the file at the specified path
|
|
137
|
+
2. **Check for similar issues** (Step 3.2.1) - Search for other occurrences of the same pattern
|
|
138
|
+
3. If multiple occurrences found, ask user for preference:
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
Found 3 additional occurrences of the same issue in this file:
|
|
142
|
+
- Line 15: missing await
|
|
143
|
+
- Line 42: missing await
|
|
144
|
+
- Line 67: missing await
|
|
145
|
+
|
|
146
|
+
How would you like to proceed?
|
|
147
|
+
[a] Apply fix to ALL occurrences (recommended for consistency)
|
|
148
|
+
[o] Apply fix to ONLY the commented line
|
|
149
|
+
[s] Show me all occurrences first, then decide
|
|
150
|
+
[c] Cancel this fix
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
4. Locate the exact code section(s)
|
|
154
|
+
5. Implement the requested change(s)
|
|
155
|
+
6. Ensure the fix follows project coding standards
|
|
156
|
+
7. Show the diff of changes made
|
|
157
|
+
|
|
158
|
+
### Step 3.5: Confirm with User
|
|
159
|
+
|
|
160
|
+
After analyzing each comment, ask:
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
Should I apply this fix?
|
|
164
|
+
[y] Yes, apply it
|
|
165
|
+
[n] No, skip this comment
|
|
166
|
+
[m] Mark as resolved without changes (not applicable)
|
|
167
|
+
[a] Auto-apply all remaining valid comments
|
|
168
|
+
[q] Quit
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Step 3.6: Reply to Comment
|
|
172
|
+
|
|
173
|
+
After the user decides to apply/skip, ask if they want to reply to the comment:
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
Do you want to reply to this comment?
|
|
177
|
+
[y] Yes, use the auto-generated reply
|
|
178
|
+
[c] Yes, but I'll provide a custom reply
|
|
179
|
+
[n] No, don't reply
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**Auto-generated replies based on action:**
|
|
183
|
+
|
|
184
|
+
- If applied: "Applied (changes not yet committed)"
|
|
185
|
+
- If skipped: "Skipped: [reason]"
|
|
186
|
+
- If marked as not applicable: "Not applicable: [reason]"
|
|
187
|
+
|
|
188
|
+
**IMPORTANT**: Do NOT include commit hashes in auto-generated replies because the changes haven't been committed yet.
|
|
189
|
+
|
|
190
|
+
### Step 3.7: Post Reply to GitHub
|
|
191
|
+
|
|
192
|
+
Once user confirms the reply, post it as a **threaded reply** under the original comment.
|
|
193
|
+
|
|
194
|
+
Use GitHub's dedicated replies endpoint, which only needs the original comment ID and the reply body (path/line/side/commit_id are inferred from the parent comment and will cause a 422 if included):
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
gh api --method POST \
|
|
198
|
+
repos/{owner}/{repo}/pulls/{pr_number}/comments/<comment_id>/replies \
|
|
199
|
+
-f body='<reply message>'
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## 4. Summary Report
|
|
203
|
+
|
|
204
|
+
After processing all comments, provide:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
PR Review Comments - Summary
|
|
208
|
+
============================
|
|
209
|
+
Total comments: 15
|
|
210
|
+
Applied: 8
|
|
211
|
+
Skipped: 5
|
|
212
|
+
Already resolved: 2
|
|
213
|
+
|
|
214
|
+
Changes made in:
|
|
215
|
+
- src/modules/APM.ts (3 changes)
|
|
216
|
+
- src/utils/XhrNetworkInterceptor.ts (2 changes)
|
|
217
|
+
- test/modules/APM.spec.ts (3 changes)
|
|
218
|
+
|
|
219
|
+
Next steps:
|
|
220
|
+
- Run tests: yarn test
|
|
221
|
+
- Run lint: yarn lint
|
|
222
|
+
- Review changes: git diff
|
|
223
|
+
- Commit changes: git add . && git commit -m "fix: apply PR review feedback"
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## 5. Error Handling
|
|
227
|
+
|
|
228
|
+
If any step fails:
|
|
229
|
+
|
|
230
|
+
- **GitHub CLI not found**: Stop immediately and show setup instructions
|
|
231
|
+
- **Not authenticated**: Stop and show `gh auth login` instructions
|
|
232
|
+
- **PR not found**: Verify branch name and check if PR exists
|
|
233
|
+
- **API errors**: Show clear error message with API response
|
|
234
|
+
- **File not found**: Skip that comment and mark it as outdated
|
|
235
|
+
- **Line number mismatch**: Show context and ask user to verify
|
|
236
|
+
- Continue with remaining comments after non-fatal errors
|
|
237
|
+
- Report all errors in the summary
|
|
238
|
+
|
|
239
|
+
## Optional Arguments
|
|
240
|
+
|
|
241
|
+
User can provide in `$ARGUMENTS`:
|
|
242
|
+
|
|
243
|
+
- PR number (e.g., `123`) - Process specific PR instead of auto-detecting from branch
|
|
244
|
+
- `--auto` - Auto-apply all valid comments without confirmation
|
|
245
|
+
- `--dry-run` - Show what would be done without making changes
|
|
246
|
+
- `--priority=critical` - Only apply critical priority comments
|
|
247
|
+
|
|
248
|
+
Examples:
|
|
249
|
+
|
|
250
|
+
- `/apply-pr-reviews` - Auto-detect PR from current branch
|
|
251
|
+
- `/apply-pr-reviews 123` - Process PR #123
|
|
252
|
+
- `/apply-pr-reviews --auto` - Auto-apply all valid comments
|
|
253
|
+
- `/apply-pr-reviews --dry-run` - Preview changes only
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create a Jira work item using Atlassian CLI
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Create a Jira work item using Atlassian CLI.
|
|
6
|
+
|
|
7
|
+
Example:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
acli jira workitem create \
|
|
11
|
+
--summary "Task Title" \
|
|
12
|
+
--description "Task description in Atlassian Document Format" \
|
|
13
|
+
--project "MOB" \
|
|
14
|
+
--type "Task" \
|
|
15
|
+
--assignee @me \
|
|
16
|
+
--label "React-Native"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Follow the following rules unless specified otherwise:
|
|
20
|
+
|
|
21
|
+
- Prefix task summary with `[React Native]`
|
|
22
|
+
- Make the description concise
|
|
23
|
+
- Use MOB (Mobile) project
|
|
24
|
+
- Default to assign-self (@me)
|
|
25
|
+
- Create a Task if suitable
|
|
26
|
+
|
|
27
|
+
Use `acli jira workitem create -h` for command usage when you need to.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create a PR with commit suggestion, template filling, and GitHub CLI
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Create Pull Request
|
|
6
|
+
|
|
7
|
+
Automates the complete PR workflow: suggest commit, fill PR template, create draft PR.
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
- `baseBranch` (optional): Target branch. Defaults to `master`.
|
|
12
|
+
- `taskUrl` (required): Jira task URL (e.g., `https://instabug.atlassian.net/browse/MOB-20541`).
|
|
13
|
+
|
|
14
|
+
## Step 0: Prerequisites Check
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
gh --version 2>/dev/null || echo "GH_CLI_NOT_INSTALLED"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
If GitHub CLI is not installed, **STOP** and show:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
GitHub CLI Required
|
|
24
|
+
========================
|
|
25
|
+
1. Install: brew install gh
|
|
26
|
+
2. Authenticate: gh auth login
|
|
27
|
+
3. Re-run: /create-pr
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
If installed, verify authentication:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
gh auth status
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Only proceed if `gh` is installed and authenticated.**
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Step 1: Suggest Commit Message
|
|
41
|
+
|
|
42
|
+
Analyze staged/unstaged changes and suggest a commit message:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
<type>(<scope>): <subject>
|
|
46
|
+
|
|
47
|
+
<body>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Types: `feat`, `fix`, `refactor`, `perf`, `test`, `docs`, `chore`
|
|
51
|
+
|
|
52
|
+
Scope should reference the affected area (e.g., `apm`, `bug-reporting`, `network-logger`, `session-replay`, `cli`).
|
|
53
|
+
|
|
54
|
+
Example:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
feat(apm): add custom span duration tracking
|
|
58
|
+
|
|
59
|
+
- Implement CustomSpansManager for measuring span durations
|
|
60
|
+
- Add method to APM module for starting/ending spans
|
|
61
|
+
- Include unit tests for edge cases
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Present the suggested commit message and wait for user approval.**
|
|
65
|
+
|
|
66
|
+
Once approved, stage and commit. Never use `git add -A` / `git add .` since they can pull in `.env`, credentials, or other stray files.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Show the working tree so the user can confirm what gets staged
|
|
70
|
+
git status
|
|
71
|
+
|
|
72
|
+
# Stage only the intended files explicitly (expand as needed)
|
|
73
|
+
git add <path1> <path2> ...
|
|
74
|
+
|
|
75
|
+
# Verify the staged diff before committing
|
|
76
|
+
git diff --cached
|
|
77
|
+
|
|
78
|
+
git commit -m "<approved-message>"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Do not proceed until the user approves the staged file list and the commit succeeds.**
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Step 2: Generate PR Description
|
|
86
|
+
|
|
87
|
+
Read the PR template:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
cat .github/pull_request_template.md
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Fill the template based on the actual changes:
|
|
94
|
+
|
|
95
|
+
1. **Description of the change** - Summarize what changed and why
|
|
96
|
+
2. **Type of change** - Check the appropriate box based on the changes:
|
|
97
|
+
- Bug fix, New feature, or Breaking change
|
|
98
|
+
3. **Related issues** - Use the `taskUrl` parameter to link the Jira ticket
|
|
99
|
+
4. **Checklists** - Fill based on analysis of the changes
|
|
100
|
+
|
|
101
|
+
**Present the filled template to the user and ask for modifications.**
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Step 3: Create Pull Request
|
|
106
|
+
|
|
107
|
+
Extract the task ID from `taskUrl` (the part after `/browse/`).
|
|
108
|
+
|
|
109
|
+
Generate PR title in format: `<type>: [TASK-ID] brief description`
|
|
110
|
+
|
|
111
|
+
Types: `feat`, `fix`, `refactor`, `perf`, `test`, `docs`, `chore`
|
|
112
|
+
|
|
113
|
+
Examples:
|
|
114
|
+
|
|
115
|
+
- `feat: [MOB-20541] add network request duration tracking to APM`
|
|
116
|
+
- `fix: [MOB-18732] fix crash when initializing SDK on iOS 14`
|
|
117
|
+
- `chore: [MOB-19000] update CI Node version to 20.11.1`
|
|
118
|
+
|
|
119
|
+
**Present the title to the user for approval.**
|
|
120
|
+
|
|
121
|
+
Once approved:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Push the branch
|
|
125
|
+
git push -u origin HEAD
|
|
126
|
+
|
|
127
|
+
# Save PR description to a unique temp file (avoids collisions with concurrent runs)
|
|
128
|
+
PR_BODY_FILE="$(mktemp -t pr-description.XXXXXX)"
|
|
129
|
+
trap 'rm -f "$PR_BODY_FILE"' EXIT
|
|
130
|
+
cat > "$PR_BODY_FILE" << 'EOF'
|
|
131
|
+
<filled PR template from Step 2>
|
|
132
|
+
EOF
|
|
133
|
+
|
|
134
|
+
# Create draft PR
|
|
135
|
+
gh pr create --base {baseBranch} --title "<approved-title>" --body-file "$PR_BODY_FILE" --draft --assignee @me
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Display the PR URL when done.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Transform internal release notes into public-facing release notes for React Native SDK consumers
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Create Public Release Notes
|
|
6
|
+
|
|
7
|
+
Transform internal release notes into public-facing release notes suitable for React Native SDK consumers.
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
- `releaseNotesUrl` (required): The URL containing the internal release notes
|
|
12
|
+
- Example: `releaseNotesUrl=https://your-wiki.com/RN+19.3.0+Internal+Release+Notes`
|
|
13
|
+
- The version number will be automatically extracted from the URL
|
|
14
|
+
|
|
15
|
+
## Step 1: Extract Version and Request Content
|
|
16
|
+
|
|
17
|
+
Extract the version number from the `releaseNotesUrl` parameter.
|
|
18
|
+
|
|
19
|
+
Prompt the user:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
I'll help you transform the internal release notes from:
|
|
23
|
+
{releaseNotesUrl}
|
|
24
|
+
|
|
25
|
+
Since this page may require authentication, please follow these steps:
|
|
26
|
+
|
|
27
|
+
1. Open the URL in your browser: {releaseNotesUrl}
|
|
28
|
+
2. Copy ALL the release notes content from the page
|
|
29
|
+
3. Paste the content below
|
|
30
|
+
|
|
31
|
+
I'll transform it into professional, public-facing release notes for React Native SDK v{version}.
|
|
32
|
+
|
|
33
|
+
Please paste the content now:
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Wait for the user to provide the internal notes content.
|
|
37
|
+
|
|
38
|
+
## Step 2: Analyze and Categorize
|
|
39
|
+
|
|
40
|
+
Review the internal notes and for each item:
|
|
41
|
+
|
|
42
|
+
1. Identify the type (Feature, Improvement, Bug Fix, Other)
|
|
43
|
+
2. Determine if public-facing (remove internal-only items)
|
|
44
|
+
3. Extract the core user-facing change
|
|
45
|
+
4. Remove all internal jargon and references
|
|
46
|
+
|
|
47
|
+
## Step 3: Transform Content
|
|
48
|
+
|
|
49
|
+
### Tone and Style
|
|
50
|
+
|
|
51
|
+
- Professional, concise, and clear - write for SDK consumers
|
|
52
|
+
- Use team perspective: "We've added...", "Fixed an issue where...", "Improved..."
|
|
53
|
+
|
|
54
|
+
### Remove
|
|
55
|
+
|
|
56
|
+
- Ticket IDs (MOB-XXXX)
|
|
57
|
+
- Developer names
|
|
58
|
+
- Internal tools references
|
|
59
|
+
- Debug logs mentions
|
|
60
|
+
- CI/CD references
|
|
61
|
+
- QA process details
|
|
62
|
+
- Feature flags
|
|
63
|
+
|
|
64
|
+
### Keep
|
|
65
|
+
|
|
66
|
+
- New features
|
|
67
|
+
- Improvements
|
|
68
|
+
- Public bug fixes
|
|
69
|
+
- SDK API changes
|
|
70
|
+
- Performance enhancements
|
|
71
|
+
- Compatibility updates
|
|
72
|
+
|
|
73
|
+
### Generalize
|
|
74
|
+
|
|
75
|
+
- "Fixed internal NativeModule marshaling" -> "Improved platform communication reliability"
|
|
76
|
+
- "Updated XhrNetworkInterceptor implementation" -> "Enhanced network request tracking accuracy"
|
|
77
|
+
|
|
78
|
+
### React Native-Specific Considerations
|
|
79
|
+
|
|
80
|
+
- Note platform-specific fixes (iOS/Android) when relevant
|
|
81
|
+
- Highlight TypeScript API changes clearly
|
|
82
|
+
- Mention React Navigation or Expo compatibility changes
|
|
83
|
+
- Note any changes to the CLI tool or source map upload process
|
|
84
|
+
|
|
85
|
+
## Step 4: Generate Output
|
|
86
|
+
|
|
87
|
+
Format as a flat list with category prefixes:
|
|
88
|
+
|
|
89
|
+
```markdown
|
|
90
|
+
### React Native SDK v{version} Release Notes
|
|
91
|
+
|
|
92
|
+
- **New Feature:** Added support for custom performance span tracking.
|
|
93
|
+
- **New Feature:** Introduced native network interception mode.
|
|
94
|
+
- **Improvement:** Enhanced session replay performance on Android.
|
|
95
|
+
- **Improvement:** Reduced SDK initialization time.
|
|
96
|
+
- **Bug Fix:** Fixed an issue where crash reports were not sent when app was backgrounded.
|
|
97
|
+
- **Bug Fix:** Fixed a crash on iOS when navigating rapidly between screens.
|
|
98
|
+
- **Other:** Deprecated `oldMethod()` in favor of `newMethod()`.
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Breaking Changes
|
|
102
|
+
|
|
103
|
+
If breaking changes exist, list them first with warning prefix:
|
|
104
|
+
|
|
105
|
+
```markdown
|
|
106
|
+
- **Breaking:** Minimum React Native version increased to 0.70.0.
|
|
107
|
+
- **Breaking:** `init()` now requires `invocationEvents` parameter.
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Step 5: Present and Refine
|
|
111
|
+
|
|
112
|
+
Show the generated notes and ask:
|
|
113
|
+
|
|
114
|
+
1. Adjust any wording?
|
|
115
|
+
2. Add or remove any items?
|
|
116
|
+
3. Save to a file?
|
|
117
|
+
|
|
118
|
+
## Step 6: Save Output (Optional)
|
|
119
|
+
|
|
120
|
+
If requested:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
cat > rn-sdk-v{version}-release-notes.md << 'EOF'
|
|
124
|
+
<content>
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
*Generated from: {releaseNotesUrl}*
|
|
128
|
+
*Version: {version}*
|
|
129
|
+
*Generated on: {current_date}*
|
|
130
|
+
EOF
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Quality Checklist
|
|
134
|
+
|
|
135
|
+
- [ ] No internal ticket IDs
|
|
136
|
+
- [ ] No developer names
|
|
137
|
+
- [ ] No internal tool mentions
|
|
138
|
+
- [ ] No technical jargon SDK users wouldn't understand
|
|
139
|
+
- [ ] All items are user-facing
|
|
140
|
+
- [ ] Language is professional and clear
|
|
141
|
+
- [ ] Each bullet is concise (1-2 lines max)
|
|
142
|
+
- [ ] Version number is correct
|
|
143
|
+
- [ ] Items are properly prefixed with categories
|
|
144
|
+
- [ ] Empty categories are omitted
|
|
145
|
+
- [ ] Platform-specific fixes mention the platform
|