react-native-nitro-tracing 0.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.
Files changed (233) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/LICENSE +21 -0
  3. package/NitroTracing.podspec +32 -0
  4. package/README.md +75 -0
  5. package/android/CMakeLists.txt +49 -0
  6. package/android/build.gradle +133 -0
  7. package/android/fix-prefab.gradle +51 -0
  8. package/android/gradle.properties +5 -0
  9. package/android/proguard-rules.pro +5 -0
  10. package/android/src/main/AndroidManifest.xml +2 -0
  11. package/android/src/main/cpp/cpp-adapter.cpp +47 -0
  12. package/android/src/main/java/com/margelo/nitro/nitrotracing/HermesSamplingGuard.kt +43 -0
  13. package/android/src/main/java/com/margelo/nitro/nitrotracing/NitroTracingFrameSource.kt +36 -0
  14. package/android/src/main/java/com/margelo/nitro/nitrotracing/NitroTracingPackage.kt +31 -0
  15. package/client.ts +15 -0
  16. package/cpp/HermesSampling.cpp +26 -0
  17. package/cpp/HermesSampling.hpp +10 -0
  18. package/cpp/HybridRecording.cpp +66 -0
  19. package/cpp/HybridRecording.hpp +30 -0
  20. package/cpp/HybridTraceSpan.cpp +10 -0
  21. package/cpp/HybridTraceSpan.hpp +17 -0
  22. package/cpp/HybridTracing.cpp +10 -0
  23. package/cpp/HybridTracing.hpp +10 -0
  24. package/cpp/NativeConversions.cpp +77 -0
  25. package/cpp/NativeConversions.hpp +15 -0
  26. package/cpp/core/NativeSampler.cpp +152 -0
  27. package/cpp/core/NativeSampler.hpp +56 -0
  28. package/cpp/core/Recorder.cpp +218 -0
  29. package/cpp/core/Recorder.hpp +60 -0
  30. package/cpp/core/Retention.cpp +26 -0
  31. package/cpp/core/Retention.hpp +7 -0
  32. package/cpp/core/TraceJson.cpp +214 -0
  33. package/cpp/core/TraceJson.hpp +7 -0
  34. package/cpp/core/TraceTypes.hpp +62 -0
  35. package/expo.ts +2 -0
  36. package/ios/NitroTracingFrameSource.mm +35 -0
  37. package/lib/commonjs/client.cjs +767 -0
  38. package/lib/commonjs/client.cjs.map +7 -0
  39. package/lib/commonjs/expo.cjs +88 -0
  40. package/lib/commonjs/expo.cjs.map +7 -0
  41. package/lib/commonjs/index.cjs +28 -0
  42. package/lib/commonjs/index.cjs.map +7 -0
  43. package/lib/commonjs/performance.cjs +112 -0
  44. package/lib/commonjs/performance.cjs.map +7 -0
  45. package/lib/commonjs/plugins.cjs +477 -0
  46. package/lib/commonjs/plugins.cjs.map +7 -0
  47. package/lib/commonjs/react.cjs +3833 -0
  48. package/lib/commonjs/react.cjs.map +7 -0
  49. package/lib/commonjs/release-profiler.cjs +142 -0
  50. package/lib/commonjs/release-profiler.cjs.map +7 -0
  51. package/lib/commonjs/sentry.cjs +188 -0
  52. package/lib/commonjs/sentry.cjs.map +7 -0
  53. package/lib/module/client.mjs +768 -0
  54. package/lib/module/client.mjs.map +7 -0
  55. package/lib/module/expo.mjs +62 -0
  56. package/lib/module/expo.mjs.map +7 -0
  57. package/lib/module/index.mjs +7 -0
  58. package/lib/module/index.mjs.map +7 -0
  59. package/lib/module/performance.mjs +89 -0
  60. package/lib/module/performance.mjs.map +7 -0
  61. package/lib/module/plugins.mjs +461 -0
  62. package/lib/module/plugins.mjs.map +7 -0
  63. package/lib/module/react.mjs +3851 -0
  64. package/lib/module/react.mjs.map +7 -0
  65. package/lib/module/release-profiler.mjs +137 -0
  66. package/lib/module/release-profiler.mjs.map +7 -0
  67. package/lib/module/sentry.mjs +165 -0
  68. package/lib/module/sentry.mjs.map +7 -0
  69. package/lib/typescript/client.d.ts +4 -0
  70. package/lib/typescript/expo.d.ts +2 -0
  71. package/lib/typescript/performance.d.ts +2 -0
  72. package/lib/typescript/plugins.d.ts +12 -0
  73. package/lib/typescript/react.d.ts +5 -0
  74. package/lib/typescript/release-profiler.d.ts +2 -0
  75. package/lib/typescript/sentry.d.ts +2 -0
  76. package/lib/typescript/src/client/TracingSink.d.ts +10 -0
  77. package/lib/typescript/src/client/createTraceClient.d.ts +82 -0
  78. package/lib/typescript/src/client/playground.d.ts +12 -0
  79. package/lib/typescript/src/expo/ExpoAdapter.d.ts +15 -0
  80. package/lib/typescript/src/expo/index.d.ts +2 -0
  81. package/lib/typescript/src/index.d.ts +6 -0
  82. package/lib/typescript/src/plugins/TracePlugin.d.ts +22 -0
  83. package/lib/typescript/src/plugins/errors.d.ts +15 -0
  84. package/lib/typescript/src/plugins/nativeMetrics.d.ts +13 -0
  85. package/lib/typescript/src/plugins/navigation.d.ts +29 -0
  86. package/lib/typescript/src/plugins/network.d.ts +23 -0
  87. package/lib/typescript/src/plugins/orderSpans.d.ts +3 -0
  88. package/lib/typescript/src/plugins/performance.d.ts +13 -0
  89. package/lib/typescript/src/plugins/releaseProfiler.d.ts +25 -0
  90. package/lib/typescript/src/plugins/runtimeMetrics.d.ts +17 -0
  91. package/lib/typescript/src/plugins/sentry.d.ts +15 -0
  92. package/lib/typescript/src/plugins/startPlugins.d.ts +4 -0
  93. package/lib/typescript/src/react/DetailView.d.ts +11 -0
  94. package/lib/typescript/src/react/ExplorerFilters.d.ts +9 -0
  95. package/lib/typescript/src/react/ExplorerView.d.ts +9 -0
  96. package/lib/typescript/src/react/InspectorControls.d.ts +229 -0
  97. package/lib/typescript/src/react/InspectorHeader.d.ts +8 -0
  98. package/lib/typescript/src/react/InspectorSheet.d.ts +16 -0
  99. package/lib/typescript/src/react/MetricsView.d.ts +7 -0
  100. package/lib/typescript/src/react/SummaryView.d.ts +11 -0
  101. package/lib/typescript/src/react/TimelineView.d.ts +8 -0
  102. package/lib/typescript/src/react/TraceInspector.d.ts +11 -0
  103. package/lib/typescript/src/react/TraceOverlay.d.ts +17 -0
  104. package/lib/typescript/src/react/explorerModel.d.ts +38 -0
  105. package/lib/typescript/src/react/labels.d.ts +203 -0
  106. package/lib/typescript/src/react/native.d.ts +42 -0
  107. package/lib/typescript/src/react/readSnapshot.d.ts +4 -0
  108. package/lib/typescript/src/react/store.d.ts +9 -0
  109. package/lib/typescript/src/react/topics.d.ts +80 -0
  110. package/lib/typescript/src/react/useAppReadyMetric.d.ts +3 -0
  111. package/lib/typescript/src/react/useLiveRecording.d.ts +4 -0
  112. package/lib/typescript/src/react/useTraceViewer.d.ts +140 -0
  113. package/lib/typescript/src/react/viewerModel.d.ts +59 -0
  114. package/lib/typescript/src/specs/Recording.nitro.d.ts +31 -0
  115. package/lib/typescript/src/specs/TraceSpan.nitro.d.ts +14 -0
  116. package/lib/typescript/src/specs/Tracing.nitro.d.ts +17 -0
  117. package/lib/typescript/src/types/CompletedSpanOptions.d.ts +15 -0
  118. package/lib/typescript/src/types/EventContext.d.ts +8 -0
  119. package/lib/typescript/src/types/MarkEvent.d.ts +4 -0
  120. package/lib/typescript/src/types/MarkOptions.d.ts +6 -0
  121. package/lib/typescript/src/types/MetricEvent.d.ts +8 -0
  122. package/lib/typescript/src/types/MetricOptions.d.ts +10 -0
  123. package/lib/typescript/src/types/NativeSamplingOptions.d.ts +7 -0
  124. package/lib/typescript/src/types/ReadOptions.d.ts +7 -0
  125. package/lib/typescript/src/types/RecordingOptions.d.ts +11 -0
  126. package/lib/typescript/src/types/RecordingStats.d.ts +25 -0
  127. package/lib/typescript/src/types/SpanEvent.d.ts +13 -0
  128. package/lib/typescript/src/types/SpanOptions.d.ts +6 -0
  129. package/lib/typescript/src/types/SpanOutcome.d.ts +2 -0
  130. package/lib/typescript/src/types/TraceAttribute.d.ts +7 -0
  131. package/lib/typescript/src/types/TraceAttributes.d.ts +3 -0
  132. package/lib/typescript/src/types/TraceContext.d.ts +10 -0
  133. package/lib/typescript/src/types/TracePage.d.ts +18 -0
  134. package/lib/typescript/src/types.d.ts +17 -0
  135. package/nitro.json +20 -0
  136. package/nitrogen/generated/.gitattributes +1 -0
  137. package/nitrogen/generated/android/NitroTracing+autolinking.cmake +83 -0
  138. package/nitrogen/generated/android/NitroTracing+autolinking.gradle +27 -0
  139. package/nitrogen/generated/android/NitroTracingOnLoad.cpp +49 -0
  140. package/nitrogen/generated/android/NitroTracingOnLoad.hpp +34 -0
  141. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrotracing/NitroTracingOnLoad.kt +35 -0
  142. package/nitrogen/generated/ios/NitroTracing+autolinking.rb +62 -0
  143. package/nitrogen/generated/ios/NitroTracing-Swift-Cxx-Bridge.cpp +17 -0
  144. package/nitrogen/generated/ios/NitroTracing-Swift-Cxx-Bridge.hpp +27 -0
  145. package/nitrogen/generated/ios/NitroTracing-Swift-Cxx-Umbrella.hpp +38 -0
  146. package/nitrogen/generated/ios/NitroTracingAutolinking.mm +35 -0
  147. package/nitrogen/generated/ios/NitroTracingAutolinking.swift +16 -0
  148. package/nitrogen/generated/shared/c++/CompletedSpanOptions.hpp +122 -0
  149. package/nitrogen/generated/shared/c++/HybridRecordingSpec.cpp +31 -0
  150. package/nitrogen/generated/shared/c++/HybridRecordingSpec.hpp +100 -0
  151. package/nitrogen/generated/shared/c++/HybridTraceSpanSpec.cpp +23 -0
  152. package/nitrogen/generated/shared/c++/HybridTraceSpanSpec.hpp +65 -0
  153. package/nitrogen/generated/shared/c++/HybridTracingSpec.cpp +22 -0
  154. package/nitrogen/generated/shared/c++/HybridTracingSpec.hpp +68 -0
  155. package/nitrogen/generated/shared/c++/MarkEvent.hpp +102 -0
  156. package/nitrogen/generated/shared/c++/MarkOptions.hpp +99 -0
  157. package/nitrogen/generated/shared/c++/MetricEvent.hpp +110 -0
  158. package/nitrogen/generated/shared/c++/MetricOptions.hpp +107 -0
  159. package/nitrogen/generated/shared/c++/NativeSamplingOptions.hpp +87 -0
  160. package/nitrogen/generated/shared/c++/ReadOptions.hpp +87 -0
  161. package/nitrogen/generated/shared/c++/RecordingOptions.hpp +95 -0
  162. package/nitrogen/generated/shared/c++/RecordingStats.hpp +123 -0
  163. package/nitrogen/generated/shared/c++/SpanEvent.hpp +121 -0
  164. package/nitrogen/generated/shared/c++/SpanOptions.hpp +99 -0
  165. package/nitrogen/generated/shared/c++/SpanOutcome.hpp +84 -0
  166. package/nitrogen/generated/shared/c++/TraceAttribute.hpp +87 -0
  167. package/nitrogen/generated/shared/c++/TracePage.hpp +111 -0
  168. package/package.json +236 -0
  169. package/performance.ts +2 -0
  170. package/plugins.ts +24 -0
  171. package/react-native.config.js +16 -0
  172. package/react.ts +10 -0
  173. package/release-profiler.ts +6 -0
  174. package/sentry.ts +2 -0
  175. package/src/client/TracingSink.ts +25 -0
  176. package/src/client/createTraceClient.ts +439 -0
  177. package/src/client/playground.ts +143 -0
  178. package/src/expo/ExpoAdapter.ts +71 -0
  179. package/src/expo/index.ts +2 -0
  180. package/src/index.ts +8 -0
  181. package/src/plugins/TracePlugin.ts +22 -0
  182. package/src/plugins/errors.ts +69 -0
  183. package/src/plugins/nativeMetrics.ts +26 -0
  184. package/src/plugins/navigation.ts +111 -0
  185. package/src/plugins/network.ts +178 -0
  186. package/src/plugins/orderSpans.ts +22 -0
  187. package/src/plugins/performance.ts +120 -0
  188. package/src/plugins/releaseProfiler.ts +123 -0
  189. package/src/plugins/runtimeMetrics.ts +131 -0
  190. package/src/plugins/sentry.ts +176 -0
  191. package/src/plugins/startPlugins.ts +58 -0
  192. package/src/react/DetailView.tsx +514 -0
  193. package/src/react/ExplorerFilters.tsx +151 -0
  194. package/src/react/ExplorerView.tsx +243 -0
  195. package/src/react/InspectorControls.tsx +651 -0
  196. package/src/react/InspectorHeader.tsx +171 -0
  197. package/src/react/InspectorSheet.tsx +89 -0
  198. package/src/react/MetricsView.tsx +182 -0
  199. package/src/react/SummaryView.tsx +121 -0
  200. package/src/react/TimelineView.tsx +87 -0
  201. package/src/react/TraceInspector.tsx +196 -0
  202. package/src/react/TraceOverlay.tsx +585 -0
  203. package/src/react/explorerModel.ts +285 -0
  204. package/src/react/labels.ts +234 -0
  205. package/src/react/native.tsx +159 -0
  206. package/src/react/readSnapshot.ts +58 -0
  207. package/src/react/store.ts +31 -0
  208. package/src/react/topics.ts +427 -0
  209. package/src/react/useAppReadyMetric.ts +10 -0
  210. package/src/react/useLiveRecording.ts +43 -0
  211. package/src/react/useTraceViewer.ts +333 -0
  212. package/src/react/viewerModel.ts +172 -0
  213. package/src/specs/Recording.nitro.ts +40 -0
  214. package/src/specs/TraceSpan.nitro.ts +14 -0
  215. package/src/specs/Tracing.nitro.ts +14 -0
  216. package/src/types/CompletedSpanOptions.ts +15 -0
  217. package/src/types/EventContext.ts +8 -0
  218. package/src/types/MarkEvent.ts +3 -0
  219. package/src/types/MarkOptions.ts +6 -0
  220. package/src/types/MetricEvent.ts +8 -0
  221. package/src/types/MetricOptions.ts +10 -0
  222. package/src/types/NativeSamplingOptions.ts +7 -0
  223. package/src/types/ReadOptions.ts +7 -0
  224. package/src/types/RecordingOptions.ts +11 -0
  225. package/src/types/RecordingStats.ts +25 -0
  226. package/src/types/SpanEvent.ts +13 -0
  227. package/src/types/SpanOptions.ts +6 -0
  228. package/src/types/SpanOutcome.ts +2 -0
  229. package/src/types/TraceAttribute.ts +7 -0
  230. package/src/types/TraceAttributes.ts +4 -0
  231. package/src/types/TraceContext.ts +10 -0
  232. package/src/types/TracePage.ts +18 -0
  233. package/src/types.ts +17 -0
package/package.json ADDED
@@ -0,0 +1,236 @@
1
+ {
2
+ "name": "react-native-nitro-tracing",
3
+ "version": "0.6.0",
4
+ "description": "In-app performance tracing for React Native: native spans, frame and resource metrics, a live inspector and Perfetto export — for dev, custom and UAT builds",
5
+ "main": "lib/commonjs/index.cjs",
6
+ "module": "lib/module/index.mjs",
7
+ "types": "lib/typescript/src/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "src/index",
10
+ "files": [
11
+ "src",
12
+ "react-native.config.js",
13
+ "lib",
14
+ "nitrogen",
15
+ "android/build.gradle",
16
+ "android/gradle.properties",
17
+ "android/fix-prefab.gradle",
18
+ "android/CMakeLists.txt",
19
+ "android/src",
20
+ "android/proguard-rules.pro",
21
+ "cpp",
22
+ "ios/**/*.h",
23
+ "ios/**/*.m",
24
+ "ios/**/*.mm",
25
+ "ios/**/*.cpp",
26
+ "ios/**/*.swift",
27
+ "nitro.json",
28
+ "*.podspec",
29
+ "README.md",
30
+ "plugins.ts",
31
+ "performance.ts",
32
+ "sentry.ts",
33
+ "release-profiler.ts",
34
+ "client.ts",
35
+ "react.ts",
36
+ "expo.ts",
37
+ "LICENSE",
38
+ "CHANGELOG.md",
39
+ "!src/**/*.test.*"
40
+ ],
41
+ "keywords": [
42
+ "react-native",
43
+ "nitro-modules",
44
+ "performance",
45
+ "tracing",
46
+ "profiler",
47
+ "expo",
48
+ "perfetto",
49
+ "trace-inspector",
50
+ "sentry"
51
+ ],
52
+ "author": "gugell",
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "git+https://github.com/gugell/react-native-nitro-tracing.git",
56
+ "directory": "packages/react-native-nitro-tracing"
57
+ },
58
+ "bugs": "https://github.com/gugell/react-native-nitro-tracing/issues",
59
+ "license": "MIT",
60
+ "homepage": "https://github.com/gugell/react-native-nitro-tracing#readme",
61
+ "publishConfig": {
62
+ "registry": "https://registry.npmjs.org/",
63
+ "access": "public"
64
+ },
65
+ "devDependencies": {
66
+ "@babel/preset-env": "^7.25.3",
67
+ "@babel/preset-typescript": "^7.25.0",
68
+ "@legendapp/list": "3.4.0",
69
+ "@sentry/react-native": "8.27.0",
70
+ "@types/jest": "^29.5.14",
71
+ "@types/node": "^22.0.0",
72
+ "@types/react": "~19.2.14",
73
+ "@types/react-test-renderer": "19",
74
+ "babel-jest": "^29.7.0",
75
+ "esbuild": "0.28.2",
76
+ "expo-dev-client": "~56.0.27",
77
+ "expo-file-system": "~56.0.11",
78
+ "expo-glass-effect": "56.0.4",
79
+ "expo-sharing": "~56.0.26",
80
+ "jest": "^29.7.0",
81
+ "nitrogen": "0.37.1",
82
+ "react": "19.2.3",
83
+ "react-native": "0.85.3",
84
+ "react-native-bottom-tabs": "1.4.0",
85
+ "react-native-nitro-modules": "0.37.1",
86
+ "react-native-performance": "^6.0.0",
87
+ "react-native-safe-area-context": "~5.7.0",
88
+ "react-test-renderer": "19.2.3",
89
+ "typescript": "~6.0.3"
90
+ },
91
+ "peerDependencies": {
92
+ "@legendapp/list": ">=3.4.0 <4",
93
+ "@sentry/react-native": ">=7.11.0 <9",
94
+ "expo-dev-client": ">=56",
95
+ "expo-file-system": ">=56",
96
+ "expo-sharing": ">=56",
97
+ "react": "*",
98
+ "react-native": "*",
99
+ "react-native-nitro-modules": "^0.37.1",
100
+ "react-native-performance": ">=6",
101
+ "react-native-safe-area-context": ">=5.7.0 <6",
102
+ "react-native-bottom-tabs": ">=1.4.0 <2",
103
+ "expo-glass-effect": ">=56"
104
+ },
105
+ "prettier": {
106
+ "quoteProps": "consistent",
107
+ "singleQuote": true,
108
+ "tabWidth": 2,
109
+ "trailingComma": "es5",
110
+ "useTabs": false,
111
+ "semi": false
112
+ },
113
+ "peerDependenciesMeta": {
114
+ "react-native-performance": {
115
+ "optional": true
116
+ },
117
+ "@sentry/react-native": {
118
+ "optional": true
119
+ },
120
+ "expo-dev-client": {
121
+ "optional": true
122
+ },
123
+ "expo-file-system": {
124
+ "optional": true
125
+ },
126
+ "expo-sharing": {
127
+ "optional": true
128
+ },
129
+ "react-native-safe-area-context": {
130
+ "optional": true
131
+ },
132
+ "@legendapp/list": {
133
+ "optional": true
134
+ },
135
+ "react-native-bottom-tabs": {
136
+ "optional": true
137
+ },
138
+ "expo-glass-effect": {
139
+ "optional": true
140
+ }
141
+ },
142
+ "exports": {
143
+ ".": {
144
+ "types": "./lib/typescript/src/index.d.ts",
145
+ "react-native": "./src/index.ts",
146
+ "import": "./lib/module/index.mjs",
147
+ "require": "./lib/commonjs/index.cjs",
148
+ "default": "./lib/module/index.mjs"
149
+ },
150
+ "./client": {
151
+ "types": "./lib/typescript/client.d.ts",
152
+ "react-native": "./client.ts",
153
+ "import": "./lib/module/client.mjs",
154
+ "require": "./lib/commonjs/client.cjs",
155
+ "default": "./lib/module/client.mjs"
156
+ },
157
+ "./react": {
158
+ "types": "./lib/typescript/react.d.ts",
159
+ "react-native": "./react.ts",
160
+ "import": "./lib/module/react.mjs",
161
+ "require": "./lib/commonjs/react.cjs",
162
+ "default": "./lib/module/react.mjs"
163
+ },
164
+ "./expo": {
165
+ "types": "./lib/typescript/expo.d.ts",
166
+ "react-native": "./expo.ts",
167
+ "import": "./lib/module/expo.mjs",
168
+ "require": "./lib/commonjs/expo.cjs",
169
+ "default": "./lib/module/expo.mjs"
170
+ },
171
+ "./plugins": {
172
+ "types": "./lib/typescript/plugins.d.ts",
173
+ "react-native": "./plugins.ts",
174
+ "import": "./lib/module/plugins.mjs",
175
+ "require": "./lib/commonjs/plugins.cjs",
176
+ "default": "./lib/module/plugins.mjs"
177
+ },
178
+ "./performance": {
179
+ "types": "./lib/typescript/performance.d.ts",
180
+ "react-native": "./performance.ts",
181
+ "import": "./lib/module/performance.mjs",
182
+ "require": "./lib/commonjs/performance.cjs",
183
+ "default": "./lib/module/performance.mjs"
184
+ },
185
+ "./sentry": {
186
+ "types": "./lib/typescript/sentry.d.ts",
187
+ "react-native": "./sentry.ts",
188
+ "import": "./lib/module/sentry.mjs",
189
+ "require": "./lib/commonjs/sentry.cjs",
190
+ "default": "./lib/module/sentry.mjs"
191
+ },
192
+ "./release-profiler": {
193
+ "types": "./lib/typescript/release-profiler.d.ts",
194
+ "react-native": "./release-profiler.ts",
195
+ "import": "./lib/module/release-profiler.mjs",
196
+ "require": "./lib/commonjs/release-profiler.cjs",
197
+ "default": "./lib/module/release-profiler.mjs"
198
+ },
199
+ "./package.json": "./package.json"
200
+ },
201
+ "release-it": {
202
+ "npm": {
203
+ "publish": true,
204
+ "publishPath": "../../artifacts/release/react-native-nitro-tracing.tgz",
205
+ "publishPackageManager": "npm",
206
+ "publishArgs": [
207
+ "--access",
208
+ "public"
209
+ ]
210
+ },
211
+ "git": {
212
+ "commit": false,
213
+ "tag": false,
214
+ "push": false,
215
+ "requireCleanWorkingDir": false,
216
+ "requireUpstream": false,
217
+ "requireBranch": false
218
+ },
219
+ "github": {
220
+ "release": false
221
+ },
222
+ "hooks": {
223
+ "before:init": "pnpm --dir ../.. check",
224
+ "after:bump": "node ../../scripts/pack-check.mjs --release"
225
+ }
226
+ },
227
+ "scripts": {
228
+ "typecheck": "tsc --noEmit",
229
+ "nitrogen": "nitrogen",
230
+ "test:native": "sh scripts/test-native.sh",
231
+ "test": "jest --runInBand",
232
+ "build": "node scripts/build.mjs && tsc -p tsconfig.build.json",
233
+ "test:sentry": "node scripts/test-sentry.cjs",
234
+ "release": "release-it"
235
+ }
236
+ }
package/performance.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { createPerformancePlugin } from './src/plugins/performance'
2
+ export type { PerformancePluginOptions } from './src/plugins/performance'
package/plugins.ts ADDED
@@ -0,0 +1,24 @@
1
+ export { startPlugins } from './src/plugins/startPlugins'
2
+ export type {
3
+ TracePlugin,
4
+ PluginContext,
5
+ PluginHandle,
6
+ } from './src/plugins/TracePlugin'
7
+
8
+ export { createRuntimeMetricsPlugin } from './src/plugins/runtimeMetrics'
9
+ export type { RuntimeMetricsOptions } from './src/plugins/runtimeMetrics'
10
+
11
+ export {
12
+ createNavigationPlugin,
13
+ createScreenTracker,
14
+ } from './src/plugins/navigation'
15
+ export type {
16
+ NavigationRefLike,
17
+ NavigationPluginOptions,
18
+ } from './src/plugins/navigation'
19
+ export { createNetworkPlugin, urlTemplate } from './src/plugins/network'
20
+ export type { NetworkPluginOptions } from './src/plugins/network'
21
+ export { createErrorsPlugin } from './src/plugins/errors'
22
+ export type { ErrorsPluginOptions, ErrorUtilsLike } from './src/plugins/errors'
23
+ export { createNativeMetricsPlugin } from './src/plugins/nativeMetrics'
24
+ export type { NativeMetricsOptions } from './src/plugins/nativeMetrics'
@@ -0,0 +1,16 @@
1
+ // https://github.com/react-native-community/cli/blob/main/docs/dependencies.md
2
+
3
+ module.exports = {
4
+ dependency: {
5
+ platforms: {
6
+ /**
7
+ * @type {import('@react-native-community/cli-types').IOSDependencyParams}
8
+ */
9
+ ios: {},
10
+ /**
11
+ * @type {import('@react-native-community/cli-types').AndroidDependencyParams}
12
+ */
13
+ android: {},
14
+ },
15
+ },
16
+ }
package/react.ts ADDED
@@ -0,0 +1,10 @@
1
+ export { TraceInspector } from './src/react/TraceInspector'
2
+ export { TraceOverlay } from './src/react/TraceOverlay'
3
+ export { defaultLabels } from './src/react/labels'
4
+ export type {
5
+ InspectorLabels,
6
+ InspectorTranslator,
7
+ InspectorLabelKey,
8
+ } from './src/react/labels'
9
+
10
+ export { useAppReadyMetric } from './src/react/useAppReadyMetric'
@@ -0,0 +1,6 @@
1
+ export { createReleaseProfilerPlugin } from './src/plugins/releaseProfiler'
2
+ export type {
3
+ ReleaseProfilerApi,
4
+ ReleaseProfilerOptions,
5
+ ReleaseProfilerPlugin,
6
+ } from './src/plugins/releaseProfiler'
package/sentry.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { createSentryPlugin } from './src/plugins/sentry'
2
+ export type { SentryPluginOptions } from './src/plugins/sentry'
@@ -0,0 +1,25 @@
1
+ /** Optional compatibility output for app logs and breadcrumbs, separate from native retention. */
2
+ export interface TracingEntry {
3
+ name: string
4
+ entryType: string
5
+ durationMs: number
6
+ value?: number | string
7
+ attributes?: Record<string, unknown>
8
+ }
9
+ export type TracingSink = (line: string, entry: TracingEntry) => void
10
+ export function formatTracingEntry(entry: TracingEntry): string {
11
+ const attributes = entry.attributes
12
+ const id = attributes?.id
13
+ const suffix = typeof id === 'string' ? ` [${id.slice(-6)}]` : ''
14
+ const details = Object.entries(attributes ?? {})
15
+ .filter(([key, value]) => key !== 'id' && value !== undefined)
16
+ .map(([key, value]) => `${key}=${value}`)
17
+ const detail = details.length ? ` {${details.join(' ')}}` : ''
18
+ const label =
19
+ entry.entryType === 'metric'
20
+ ? `${entry.name}=${entry.value}`
21
+ : entry.entryType === 'measure'
22
+ ? `${entry.name} ${entry.durationMs.toFixed(0)}ms`
23
+ : entry.name
24
+ return `${label}${suffix}${detail}`
25
+ }