react-native-ota-hot-update 2.1.12 → 2.1.14

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 CHANGED
@@ -1 +1 @@
1
- module.exports = require('./plugin/withHotupdate');
1
+ module.exports = require('./plugin/build');
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../plugin/src/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../plugin/src/index.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ota-hot-update",
3
- "version": "2.1.12",
3
+ "version": "2.1.14",
4
4
  "description": "Hot update for react native",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -27,7 +27,7 @@
27
27
  "react-native.config.js",
28
28
  "app.plugin.js",
29
29
  "!ios/build",
30
- "plugin/withHotupdate.js",
30
+ "plugin",
31
31
  "!android/build",
32
32
  "!android/gradle",
33
33
  "!android/gradlew",
@@ -45,7 +45,8 @@
45
45
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
46
46
  "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
47
47
  "prepare": "bob build",
48
- "release": "release-it"
48
+ "release": "release-it",
49
+ "build-plugin": "tsc --build plugin"
49
50
  },
50
51
  "keywords": [
51
52
  "hot-update",
@@ -89,6 +90,7 @@
89
90
  "eslint": "^8.51.0",
90
91
  "eslint-config-prettier": "^9.0.0",
91
92
  "eslint-plugin-prettier": "^5.0.1",
93
+ "expo-module-scripts": "^4.0.2",
92
94
  "jest": "^29.7.0",
93
95
  "prettier": "^3.0.3",
94
96
  "react": "18.3.1",
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config_plugins_1 = require("@expo/config-plugins");
4
+ const withAndroidAction = (config) => {
5
+ return (0, config_plugins_1.withMainApplication)(config, (config) => {
6
+ config.modResults.contents = config.modResults.contents.replace(/override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED/g, `
7
+ override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
8
+
9
+ override fun getJSBundleFile(): String = OtaHotUpdate.bundleJS`);
10
+ config.modResults.contents = config.modResults.contents.replace(/import expo.modules.ReactNativeHostWrapper/g, `
11
+ import expo.modules.ReactNativeHostWrapper
12
+ import com.otahotupdate.OtaHotUpdate`);
13
+ return config;
14
+ });
15
+ };
16
+ const withIosAction = (config) => {
17
+ return (0, config_plugins_1.withAppDelegate)(config, (config) => {
18
+ config.modResults.contents = config.modResults.contents.replace(/#import "AppDelegate.h"/g, `#import "AppDelegate.h"
19
+ #import "OtaHotUpdate.h"`);
20
+ config.modResults.contents = config.modResults.contents.replace(/\[\[NSBundle mainBundle\] URLForResource:@\"main\" withExtension:@\"jsbundle\"\]/, `[OtaHotUpdate getBundle]`);
21
+ return config;
22
+ });
23
+ };
24
+ const withAction = (config) => {
25
+ config = withAndroidAction(config);
26
+ config = withIosAction(config);
27
+ return config;
28
+ };
29
+ module.exports = withAction;
@@ -1,9 +1,5 @@
1
- 'use strict';
2
-
3
- const { withMainApplication, withAppDelegate } = require('expo/config-plugins');
4
-
5
- /** @type {import('expo/config-plugins').ConfigPlugin} */
6
- const withAndroidAction = (config) => {
1
+ import { withMainApplication, withAppDelegate } from '@expo/config-plugins';
2
+ const withAndroidAction: any = (config: any) => {
7
3
  return withMainApplication(config, (config) => {
8
4
  config.modResults.contents = config.modResults.contents.replace(
9
5
  /override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED/g,
@@ -22,8 +18,7 @@ import com.otahotupdate.OtaHotUpdate`
22
18
  });
23
19
  };
24
20
 
25
- /** @type {import('expo/config-plugins').ConfigPlugin} */
26
- const withIosAction = (config) => {
21
+ const withIosAction: any = (config: any) => {
27
22
  return withAppDelegate(config, (config) => {
28
23
  config.modResults.contents = config.modResults.contents.replace(
29
24
  /#import "AppDelegate.h"/g,
@@ -38,11 +33,9 @@ const withIosAction = (config) => {
38
33
  });
39
34
  };
40
35
 
41
- /** @type {import('expo/config-plugins').ConfigPlugin} */
42
- const withUpdatePlugin = (config) => {
36
+ const withAction: any = (config: any) => {
43
37
  config = withAndroidAction(config);
44
38
  config = withIosAction(config);
45
39
  return config;
46
40
  };
47
-
48
- exports.default = withUpdatePlugin;
41
+ module.exports = withAction;
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "expo-module-scripts/tsconfig.plugin",
3
+ "compilerOptions": {
4
+ "outDir": "build",
5
+ "rootDir": "src"
6
+ },
7
+ "include": ["./src"],
8
+ "exclude": ["**/__mocks__/*", "**/__tests__/*"]
9
+ }
@@ -0,0 +1 @@
1
+ {"root":["./src/index.ts"],"version":"5.7.2"}