posthog-react-native 4.13.0 → 4.14.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.
@@ -0,0 +1,6 @@
1
+ type BuildPhase = {
2
+ shellScript: string;
3
+ };
4
+ export declare function modifyExistingXcodeBuildScript(script: BuildPhase): void;
5
+ export declare function addPostHogWithBundledScriptsToBundleShellScript(script: string): string;
6
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.addPostHogWithBundledScriptsToBundleShellScript=addPostHogWithBundledScriptsToBundleShellScript;exports.modifyExistingXcodeBuildScript=modifyExistingXcodeBuildScript;var _require=require('@expo/config-plugins'),withAppBuildGradle=_require.withAppBuildGradle,withXcodeProject=_require.withXcodeProject;var resolvePostHogReactNativePackageJsonPath="[\"node\", \"--print\", \"require('path').join(require('path').dirname(require.resolve('posthog-react-native')), '..', 'tooling', 'posthog.gradle')\"].execute().text.trim()";var withAndroidPlugin=function withAndroidPlugin(config){return withAppBuildGradle(config,function(config){if(config.modResults.language!=='groovy'){console.warn('Cannot configure PostHog in the app gradle because the build.gradle is not groovy');}var buildGradle=config.modResults.contents;var applyFrom="apply from: new File(".concat(resolvePostHogReactNativePackageJsonPath,")");if(buildGradle.includes(applyFrom)){return config;}var pattern=/^android\s*\{/m;if(buildGradle.match(pattern)){config.modResults.contents=buildGradle.replace(pattern,"".concat(applyFrom,"\n\nandroid {"));}else{console.warn('PostHog: Could not find "android {" block in build.gradle');}return config;});};function modifyExistingXcodeBuildScript(script){if(!script.shellScript.match(/(packager|scripts)\/react-native-xcode\.sh\b/)){return;}if(script.shellScript.includes('posthog-xcode.sh')){return;}if(script.shellScript.includes('posthog-react-native')){return;}var code=JSON.parse(script.shellScript);script.shellScript=JSON.stringify(addPostHogWithBundledScriptsToBundleShellScript(code));}var POSTHOG_REACT_NATIVE_XCODE_PATH="`\"$NODE_BINARY\" --print \"require('path').join(require('path').dirname(require.resolve('posthog-react-native')), '..', 'tooling', 'posthog-xcode.sh')\"`";function addPostHogWithBundledScriptsToBundleShellScript(script){return script.replace(/^.*?(packager|scripts)\/react-native-xcode\.sh\s*(\\'\\\\")?/m,function(match){return"/bin/sh ".concat(POSTHOG_REACT_NATIVE_XCODE_PATH," ").concat(match);});}var withIosPlugin=function withIosPlugin(config){return withXcodeProject(config,function(config){var xcodeProject=config.modResults;var bundleReactNativePhase=xcodeProject.pbxItemByComment('Bundle React Native code and images','PBXShellScriptBuildPhase');modifyExistingXcodeBuildScript(bundleReactNativePhase);return config;});};var withPostHogPlugin=function withPostHogPlugin(config){config=withAndroidPlugin(config);return withIosPlugin(config);};module.exports=function(config){return withPostHogPlugin(config);};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expoconfig.js","sourceRoot":"","sources":["../../src/tooling/expoconfig.ts"],"names":[],"mappings":"AAAA,6JAA6J;AAE7J,MAAM,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;AAEhF,MAAM,wCAAwC,GAC5C,8KAA8K,CAAA;AAEhL,MAAM,iBAAiB,GAAG,CAAC,MAAW,EAAE,EAAE;IACxC,OAAO,kBAAkB,CAAC,MAAM,EAAE,CAAC,MAAW,EAAE,EAAE;QAChD,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC5C,OAAO,CAAC,IAAI,CAAC,mFAAmF,CAAC,CAAA;QACnG,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAA;QAC9C,MAAM,SAAS,GAAG,wBAAwB,wCAAwC,GAAG,CAAA;QAErF,IAAI,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YACpC,OAAO,MAAM,CAAA;QACf,CAAC;QAED,mEAAmE;QACnE,MAAM,OAAO,GAAG,gBAAgB,CAAA;QAEhC,IAAI,WAAW,CAAC,KAAK,CAAC,OAAO,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C,gBAAgB,CAC1D,qCAAqC,EACrC,0BAA0B,CAC3B,CAAA;QAED,8BAA8B,CAAC,sBAAsB,CAAC,CAAA;QAEtD,OAAO,MAAM,CAAA;IACf,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,CAAC,MAAW,EAAE,EAAE;IACxC,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAA;IAClC,OAAO,aAAa,CAAC,MAAM,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,MAAW,EAAE,EAAE;IAC/B,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAA;AAClC,CAAC,CAAA"}
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "4.13.0";
1
+ export declare const version = "4.14.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;var version=exports.version="4.13.0";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;var version=exports.version="4.14.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthog-react-native",
3
- "version": "4.13.0",
3
+ "version": "4.14.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -12,6 +12,10 @@
12
12
  "./metro": {
13
13
  "types": "./dist/tooling/metroconfig.d.ts",
14
14
  "default": "./dist/tooling/metroconfig.js"
15
+ },
16
+ "./expo": {
17
+ "types": "./dist/tooling/expoconfig.d.ts",
18
+ "default": "./dist/tooling/expoconfig.js"
15
19
  }
16
20
  },
17
21
  "files": [
@@ -84,6 +84,14 @@ else
84
84
  fi
85
85
  set -x -e # re-enable
86
86
 
87
+ # files wont exist if skip bundling
88
+ set +x +e
89
+ if [[ "$SKIP_BUNDLING" ]]; then
90
+ echo "SKIP_BUNDLING enabled; skipping posthog-cli upload calls."
91
+ exit 0;
92
+ fi
93
+ set -x -e
94
+
87
95
  # Execute posthog cli clone
88
96
  set +x +e
89
97
  CLI_CLONE_OUTPUT=$(/bin/sh -c "$PH_CLI_PATH exp hermes clone --minified-map-path $SOURCEMAP_PACKAGER_FILE --composed-map-path $SOURCEMAP_FILE" 2>&1)