@posthog/react-native-plugin 2.5.1 → 2.5.2
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/android/build.gradle +7 -1
- package/lib/commonjs/index.js +2 -2
- package/lib/module/index.js +2 -2
- package/lib/typescript/commonjs/vitest.config.d.ts +3 -0
- package/lib/typescript/commonjs/vitest.config.d.ts.map +1 -0
- package/lib/typescript/module/vitest.config.d.ts +3 -0
- package/lib/typescript/module/vitest.config.d.ts.map +1 -0
- package/package.json +6 -16
- package/src/index.tsx +2 -2
package/android/build.gradle
CHANGED
|
@@ -8,7 +8,13 @@ def isNewArchitectureEnabled() {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
apply plugin: "com.android.library"
|
|
11
|
-
|
|
11
|
+
// AGP 9 ships built-in Kotlin support and registers the `kotlin` extension
|
|
12
|
+
// itself. Applying the Kotlin plugin on top of it fails configuration with
|
|
13
|
+
// "Cannot add extension with name 'kotlin'". Only apply it when nothing has
|
|
14
|
+
// registered that extension yet.
|
|
15
|
+
if (project.extensions.findByName('kotlin') == null) {
|
|
16
|
+
apply plugin: "kotlin-android"
|
|
17
|
+
}
|
|
12
18
|
|
|
13
19
|
if (isNewArchitectureEnabled()) {
|
|
14
20
|
apply plugin: "com.facebook.react"
|
package/lib/commonjs/index.js
CHANGED
|
@@ -111,13 +111,13 @@ function setPushIdentityProvider(provider) {
|
|
|
111
111
|
const minted = await provider(request.distinctId, request.appId);
|
|
112
112
|
token = typeof minted === 'string' ? minted : null;
|
|
113
113
|
} catch (e) {
|
|
114
|
-
//
|
|
114
|
+
// oxlint-disable-next-line no-console
|
|
115
115
|
console.warn(`[PostHog] pushIdentityProvider threw: ${e}. Push subscription will be sent unauthenticated.`);
|
|
116
116
|
}
|
|
117
117
|
try {
|
|
118
118
|
await PosthogReactNativePlugin.providePushIdentityToken(request.requestId, token);
|
|
119
119
|
} catch (e) {
|
|
120
|
-
//
|
|
120
|
+
// oxlint-disable-next-line no-console
|
|
121
121
|
console.warn(`[PostHog] Failed to deliver push identity token to native: ${e}`);
|
|
122
122
|
}
|
|
123
123
|
});
|
package/lib/module/index.js
CHANGED
|
@@ -92,13 +92,13 @@ export function setPushIdentityProvider(provider) {
|
|
|
92
92
|
const minted = await provider(request.distinctId, request.appId);
|
|
93
93
|
token = typeof minted === 'string' ? minted : null;
|
|
94
94
|
} catch (e) {
|
|
95
|
-
//
|
|
95
|
+
// oxlint-disable-next-line no-console
|
|
96
96
|
console.warn(`[PostHog] pushIdentityProvider threw: ${e}. Push subscription will be sent unauthenticated.`);
|
|
97
97
|
}
|
|
98
98
|
try {
|
|
99
99
|
await PosthogReactNativePlugin.providePushIdentityToken(request.requestId, token);
|
|
100
100
|
} catch (e) {
|
|
101
|
-
//
|
|
101
|
+
// oxlint-disable-next-line no-console
|
|
102
102
|
console.warn(`[PostHog] Failed to deliver push identity token to native: ${e}`);
|
|
103
103
|
}
|
|
104
104
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../../../vitest.config.ts"],"names":[],"mappings":";AAEA,wBAME"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../../../vitest.config.ts"],"names":[],"mappings":";AAEA,wBAME"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@posthog/react-native-plugin",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.2",
|
|
4
4
|
"description": "PostHog React Native plugin for iOS and Android integrations",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -57,28 +57,18 @@
|
|
|
57
57
|
"homepage": "https://github.com/PostHog/posthog-js/tree/main/packages/react-native-plugin#readme",
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@react-native-community/cli": "20.0.0",
|
|
60
|
-
"@types/jest": "^29.5.14",
|
|
61
60
|
"@types/react": "^18.2.44",
|
|
62
61
|
"del-cli": "^5.1.0",
|
|
63
|
-
"jest": "29.7.0",
|
|
64
62
|
"react": "18.3.1",
|
|
65
63
|
"react-native": "0.75.3",
|
|
66
64
|
"react-native-builder-bob": "^0.30.2",
|
|
67
|
-
"typescript": "5.8.2"
|
|
65
|
+
"typescript": "5.8.2",
|
|
66
|
+
"vitest": "^1.6.1"
|
|
68
67
|
},
|
|
69
68
|
"peerDependencies": {
|
|
70
69
|
"react": "*",
|
|
71
70
|
"react-native": "*"
|
|
72
71
|
},
|
|
73
|
-
"jest": {
|
|
74
|
-
"modulePathIgnorePatterns": [
|
|
75
|
-
"<rootDir>/lib/"
|
|
76
|
-
],
|
|
77
|
-
"testPathIgnorePatterns": [
|
|
78
|
-
"/node_modules/",
|
|
79
|
-
"<rootDir>/lib/"
|
|
80
|
-
]
|
|
81
|
-
},
|
|
82
72
|
"react-native-builder-bob": {
|
|
83
73
|
"source": "src",
|
|
84
74
|
"output": "lib",
|
|
@@ -106,10 +96,10 @@
|
|
|
106
96
|
},
|
|
107
97
|
"scripts": {
|
|
108
98
|
"clean": "del-cli android/build lib",
|
|
109
|
-
"lint": "
|
|
110
|
-
"lint:fix": "
|
|
99
|
+
"lint": "oxlint --report-unused-disable-directives-severity error .",
|
|
100
|
+
"lint:fix": "oxlint --report-unused-disable-directives-severity error . --fix",
|
|
111
101
|
"typecheck": "tsc",
|
|
112
|
-
"test:unit": "
|
|
102
|
+
"test:unit": "vitest run --passWithNoTests && node scripts/check-spm-manifest.mjs",
|
|
113
103
|
"test": "pnpm test:unit",
|
|
114
104
|
"build": "bob build",
|
|
115
105
|
"package": "pnpm pack --out $PACKAGE_DEST/%s.tgz"
|
package/src/index.tsx
CHANGED
|
@@ -160,13 +160,13 @@ export function setPushIdentityProvider(provider: PostHogPushIdentityProvider):
|
|
|
160
160
|
const minted = await provider(request.distinctId, request.appId)
|
|
161
161
|
token = typeof minted === 'string' ? minted : null
|
|
162
162
|
} catch (e) {
|
|
163
|
-
//
|
|
163
|
+
// oxlint-disable-next-line no-console
|
|
164
164
|
console.warn(`[PostHog] pushIdentityProvider threw: ${e}. Push subscription will be sent unauthenticated.`)
|
|
165
165
|
}
|
|
166
166
|
try {
|
|
167
167
|
await PosthogReactNativePlugin.providePushIdentityToken(request.requestId, token)
|
|
168
168
|
} catch (e) {
|
|
169
|
-
//
|
|
169
|
+
// oxlint-disable-next-line no-console
|
|
170
170
|
console.warn(`[PostHog] Failed to deliver push identity token to native: ${e}`)
|
|
171
171
|
}
|
|
172
172
|
}
|