@onekeyfe/react-native-bundle-update 3.0.157-alpha.275 → 3.0.157-alpha.276

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.
Files changed (2) hide show
  1. package/README.md +55 -0
  2. package/package.json +6 -5
package/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # @onekeyfe/react-native-bundle-update
2
+
3
+ Native JavaScript bundle update storage and operations for OneKey on iOS and
4
+ Android. The Nitro module downloads bundles, verifies their artifacts, installs
5
+ and selects versions, and exposes paths for UI, background and embedded Web
6
+ content. The application owns release metadata and runtime restart decisions.
7
+
8
+ ## Installation
9
+
10
+ ```sh
11
+ yarn add @onekeyfe/react-native-bundle-update react-native-nitro-modules
12
+ ```
13
+
14
+ Install the application's iOS pods and rebuild the native application. This
15
+ module depends on native update integration; a JavaScript-only install cannot
16
+ change the bundle used by the application's host.
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import { ReactNativeBundleUpdate } from '@onekeyfe/react-native-bundle-update';
22
+
23
+ const appVersion = await ReactNativeBundleUpdate.getNativeAppVersion();
24
+ const builtinVersion = await ReactNativeBundleUpdate.getBuiltinBundleVersion();
25
+ const bundles = await ReactNativeBundleUpdate.listLocalBundles();
26
+ const bundlePath = await ReactNativeBundleUpdate.getJsBundlePathAsync();
27
+ ```
28
+
29
+ ## Update operations
30
+
31
+ | Area | Methods |
32
+ | --- | --- |
33
+ | Download | `downloadBundle`, `downloadBundleASC` |
34
+ | Verification | `verifyBundle`, `verifyBundleASC`, `verifyExtractedBundle` |
35
+ | Install and select | `installBundle`, `setCurrentUpdateBundleData` |
36
+ | Inspect | `listLocalBundles`, `listAscFiles`, `isBundleExists` |
37
+ | Reset and cleanup | `clearDownload`, `clearBundle`, `resetToBuiltInBundle`, `pruneStaleAppVersionBundles` |
38
+
39
+ Download parameters include release versions, expected size and SHA-256.
40
+ Signature-bearing operations have separate parameter types. Keep verification
41
+ and installation as distinct steps; discovering a directory is not evidence
42
+ that its contents are trusted.
43
+
44
+ Register progress with `addDownloadListener` and release the returned listener ID
45
+ with `removeDownloadListener`. Cleanup removes local update artifacts and must
46
+ be coordinated with active downloads and the application's running versions.
47
+ The debug deletion helpers should not be part of a normal update flow.
48
+
49
+ See [src/ReactNativeBundleUpdate.nitro.ts](src/ReactNativeBundleUpdate.nitro.ts)
50
+ for all methods, result objects and path APIs. This README documents the existing
51
+ interface; it does not establish end-to-end update acceptance for a consumer.
52
+
53
+ ## License
54
+
55
+ MIT.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-bundle-update",
3
- "version": "3.0.157-alpha.275",
4
- "description": "react-native-bundle-update",
3
+ "version": "3.0.157-alpha.276",
4
+ "description": "Native JavaScript bundle download, verification and version management for OneKey",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
7
7
  "exports": {
@@ -50,14 +50,15 @@
50
50
  ],
51
51
  "repository": {
52
52
  "type": "git",
53
- "url": "git+https://github.com/OneKeyHQ/app-modules/react-native-bundle-update.git"
53
+ "url": "git+https://github.com/OneKeyHQ/app-modules.git",
54
+ "directory": "native-modules/react-native-bundle-update"
54
55
  },
55
56
  "author": "onekeyfe <huanming@onekey.so> (https://github.com/OneKeyHQ/app-modules)",
56
57
  "license": "MIT",
57
58
  "bugs": {
58
- "url": "https://github.com/OneKeyHQ/app-modules/react-native-bundle-update/issues"
59
+ "url": "https://github.com/OneKeyHQ/app-modules/issues"
59
60
  },
60
- "homepage": "https://github.com/OneKeyHQ/app-modules/react-native-bundle-update#readme",
61
+ "homepage": "https://github.com/OneKeyHQ/app-modules/tree/main/native-modules/react-native-bundle-update#readme",
61
62
  "publishConfig": {
62
63
  "registry": "https://registry.npmjs.org/"
63
64
  },