@hot-updater/react-native 0.1.5 → 0.1.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.
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1960 -9
- package/dist/index.mjs +1960 -9
- package/package.json +4 -3
- package/src/ensureBundles.ts +1 -1
- package/src/index.ts +3 -3
- package/src/init.tsx +4 -4
- package/src/native.ts +1 -1
- package/src/const.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/react-native",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6-0",
|
|
4
4
|
"description": "React Native OTA solution for self-hosted",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -72,10 +72,11 @@
|
|
|
72
72
|
"del-cli": "^6.0.0",
|
|
73
73
|
"react": "18.3.1",
|
|
74
74
|
"react-native": "0.76.2",
|
|
75
|
-
"react-native-builder-bob": "^0.33.1"
|
|
75
|
+
"react-native-builder-bob": "^0.33.1",
|
|
76
|
+
"@hot-updater/js": "0.1.6-0"
|
|
76
77
|
},
|
|
77
78
|
"dependencies": {
|
|
78
|
-
"@hot-updater/
|
|
79
|
+
"@hot-updater/core": "0.1.6-0"
|
|
79
80
|
},
|
|
80
81
|
"scripts": {
|
|
81
82
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/ensureBundles.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { NIL_UUID } from "@hot-updater/core";
|
|
2
|
+
import { getUpdateInfo } from "@hot-updater/js";
|
|
3
3
|
import { ensureBundles } from "./ensureBundles";
|
|
4
4
|
import { init } from "./init";
|
|
5
5
|
import {
|
|
@@ -29,7 +29,7 @@ export const HotUpdater = {
|
|
|
29
29
|
|
|
30
30
|
ensureBundles,
|
|
31
31
|
updateBundle,
|
|
32
|
-
|
|
32
|
+
getUpdateInfo,
|
|
33
33
|
/**
|
|
34
34
|
* In production environment, this value will be replaced with a uuidv7.
|
|
35
35
|
*/
|
package/src/init.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BundleArg } from "@hot-updater/
|
|
2
|
-
import {
|
|
1
|
+
import type { BundleArg } from "@hot-updater/core";
|
|
2
|
+
import { getUpdateInfo } from "@hot-updater/js";
|
|
3
3
|
import { Platform } from "react-native";
|
|
4
4
|
import { ensureBundles } from "./ensureBundles";
|
|
5
5
|
import { HotUpdaterError } from "./error";
|
|
@@ -42,7 +42,7 @@ export const init = async (config: HotUpdaterInitConfig) => {
|
|
|
42
42
|
|
|
43
43
|
const bundles = await ensureBundles(config.source);
|
|
44
44
|
|
|
45
|
-
const update = await
|
|
45
|
+
const update = await getUpdateInfo(bundles, {
|
|
46
46
|
appVersion: currentAppVersion,
|
|
47
47
|
bundleId: currentBundleId,
|
|
48
48
|
platform,
|
|
@@ -54,7 +54,7 @@ export const init = async (config: HotUpdaterInitConfig) => {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
try {
|
|
57
|
-
const isSuccess = await updateBundle(update.id, update.
|
|
57
|
+
const isSuccess = await updateBundle(update.id, update.fileUrl || "");
|
|
58
58
|
if (isSuccess && update.forceUpdate) {
|
|
59
59
|
reload();
|
|
60
60
|
|
package/src/native.ts
CHANGED
package/src/const.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const NIL_UUID = "00000000-0000-0000-0000-000000000000";
|