@multiplayer-app/session-recorder-react-native 0.0.1-beta.8 → 0.0.1-beta.9

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/app.plugin.js ADDED
@@ -0,0 +1,42 @@
1
+ const { withDangerousMod } = require('@expo/config-plugins')
2
+ const fs = require('fs')
3
+ const path = require('path')
4
+
5
+ const withSessionRecorder = (config) => {
6
+ return withDangerousMod(config, [
7
+ 'ios',
8
+ async (config) => {
9
+ const projectRoot = config.modRequest.projectRoot
10
+ const platformRoot = config.modRequest.platformProjectRoot
11
+
12
+ // Ensure the Podfile includes our native module
13
+ const podfilePath = path.join(platformRoot, 'Podfile')
14
+
15
+ if (fs.existsSync(podfilePath)) {
16
+ let podfileContent = fs.readFileSync(podfilePath, 'utf8')
17
+
18
+ // Check if our pod is already included
19
+ if (!podfileContent.includes('SessionRecorderNative')) {
20
+ // Add our pod to the Podfile
21
+ const podEntry = ` pod 'SessionRecorderNative', :path => '../node_modules/@multiplayer-app/session-recorder-react-native/ios'\n`
22
+
23
+ // Find the target section and add our pod
24
+ const targetRegex = /(target ['"][^'"]+['"] do)/
25
+ if (targetRegex.test(podfileContent)) {
26
+ podfileContent = podfileContent.replace(targetRegex, `$1\n${podEntry}`)
27
+ } else {
28
+ // If no target found, add at the end before the end statement
29
+ podfileContent = podfileContent.replace(/(end\s*$)/, `${podEntry}$1`)
30
+ }
31
+
32
+ fs.writeFileSync(podfilePath, podfileContent)
33
+ console.log('✅ Added SessionRecorderNative to Podfile')
34
+ }
35
+ }
36
+
37
+ return config
38
+ }
39
+ ])
40
+ }
41
+
42
+ module.exports = withSessionRecorder
@@ -46,6 +46,8 @@ This guide explains how to properly set up the Session Recorder React Native lib
46
46
  }
47
47
  ```
48
48
 
49
+ The plugin will automatically be detected via the `app.plugin.js` file in the package root.
50
+
49
51
  3. **Run prebuild** (if using development build):
50
52
 
51
53
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplayer-app/session-recorder-react-native",
3
- "version": "0.0.1-beta.8",
3
+ "version": "0.0.1-beta.9",
4
4
  "description": "Multiplayer Fullstack Session Recorder for React Native",
5
5
  "author": {
6
6
  "name": "Multiplayer Software, Inc.",
@@ -105,7 +105,6 @@
105
105
  "android": {
106
106
  "sourceDir": "./android",
107
107
  "packageImportPath": "import com.multiplayer.sessionrecorder.SessionRecorderPackage;"
108
- },
109
- "plugin": "./plugin/src/index.js"
108
+ }
110
109
  }
111
110
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplayer-app/session-recorder-react-native-plugin",
3
- "version": "0.0.1-beta.8",
3
+ "version": "0.0.1-beta.9",
4
4
  "description": "Expo plugin for Session Recorder React Native",
5
5
  "main": "src/index.js",
6
6
  "keywords": [