@hot-updater/react-native 1.0.0-rc.0 → 1.0.0-rc.1
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/lib/commonjs/checkForUpdate.js +1 -1
- package/lib/commonjs/checkForUpdate.js.map +1 -1
- package/lib/commonjs/checkForUpdate.releaseCatalog.spec.js +1 -1
- package/lib/commonjs/checkForUpdate.releaseCatalog.spec.js.map +1 -1
- package/lib/commonjs/index.js +2 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.spec.js +3 -3
- package/lib/commonjs/index.spec.js.map +1 -1
- package/lib/commonjs/native.js +8 -6
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/sdkVersion.js +1 -1
- package/lib/module/checkForUpdate.js +2 -2
- package/lib/module/checkForUpdate.js.map +1 -1
- package/lib/module/checkForUpdate.releaseCatalog.spec.js +1 -1
- package/lib/module/checkForUpdate.releaseCatalog.spec.js.map +1 -1
- package/lib/module/index.js +3 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.spec.js +3 -3
- package/lib/module/index.spec.js.map +1 -1
- package/lib/module/native.js +6 -4
- package/lib/module/native.js.map +1 -1
- package/lib/module/sdkVersion.js +1 -1
- package/lib/typescript/commonjs/index.d.ts +3 -3
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/native.d.ts +5 -3
- package/lib/typescript/commonjs/native.d.ts.map +1 -1
- package/lib/typescript/commonjs/sdkVersion.d.ts +1 -1
- package/lib/typescript/module/index.d.ts +3 -3
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/native.d.ts +5 -3
- package/lib/typescript/module/native.d.ts.map +1 -1
- package/lib/typescript/module/sdkVersion.d.ts +1 -1
- package/package.json +1 -1
- package/src/checkForUpdate.releaseCatalog.spec.ts +1 -1
- package/src/checkForUpdate.ts +2 -2
- package/src/index.spec.ts +3 -3
- package/src/index.ts +3 -3
- package/src/native.ts +6 -4
- package/src/sdkVersion.ts +1 -1
package/src/index.spec.ts
CHANGED
|
@@ -30,7 +30,7 @@ const mocks = vi.hoisted(() => {
|
|
|
30
30
|
getFingerprintHash: vi.fn(() => null),
|
|
31
31
|
getInstallId: vi.fn(() => "install-id"),
|
|
32
32
|
getManifest: vi.fn(() => null),
|
|
33
|
-
|
|
33
|
+
getMinBundleId: vi.fn(() => "min-bundle-id"),
|
|
34
34
|
getReleaseId: vi.fn(async () => null),
|
|
35
35
|
init: vi.fn(),
|
|
36
36
|
isChannelSwitched: vi.fn(() => false),
|
|
@@ -67,7 +67,7 @@ vi.mock("./native", () => ({
|
|
|
67
67
|
getFingerprintHash: mocks.getFingerprintHash,
|
|
68
68
|
getInstallId: mocks.getInstallId,
|
|
69
69
|
getManifest: mocks.getManifest,
|
|
70
|
-
|
|
70
|
+
getMinBundleId: mocks.getMinBundleId,
|
|
71
71
|
getReleaseId: mocks.getReleaseId,
|
|
72
72
|
isChannelSwitched: mocks.isChannelSwitched,
|
|
73
73
|
notifyAppReady: mocks.notifyAppReady,
|
|
@@ -283,7 +283,7 @@ describe("HotUpdater client initialization", () => {
|
|
|
283
283
|
const HotUpdater = await importHotUpdater();
|
|
284
284
|
|
|
285
285
|
expect(HotUpdater.getInstallId()).toBe("install-id");
|
|
286
|
-
expect(HotUpdater.
|
|
286
|
+
expect(HotUpdater.getMinBundleId()).toBe("min-bundle-id");
|
|
287
287
|
HotUpdater.setUser({ userId: "user-123", username: "alice" });
|
|
288
288
|
expect(mocks.setUser).toHaveBeenCalledWith({
|
|
289
289
|
userId: "user-123",
|
package/src/index.ts
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
getFingerprintHash,
|
|
19
19
|
getInstallId,
|
|
20
20
|
getManifest,
|
|
21
|
-
|
|
21
|
+
getMinBundleId,
|
|
22
22
|
getReleaseId,
|
|
23
23
|
isChannelSwitched,
|
|
24
24
|
notifyAppReady,
|
|
@@ -337,8 +337,8 @@ function createHotUpdaterClient() {
|
|
|
337
337
|
*/
|
|
338
338
|
getBundleId,
|
|
339
339
|
|
|
340
|
-
/**
|
|
341
|
-
|
|
340
|
+
/** Returns the minimum bundle ID based on the native app build time. */
|
|
341
|
+
getMinBundleId,
|
|
342
342
|
|
|
343
343
|
/** Returns the active Release identity, or null for BUILTIN/legacy state. */
|
|
344
344
|
getReleaseId,
|
package/src/native.ts
CHANGED
|
@@ -215,7 +215,7 @@ const getNativeBundleId = (): string | null => {
|
|
|
215
215
|
};
|
|
216
216
|
|
|
217
217
|
const resolveBundleId = (bundleId: string | null): string => {
|
|
218
|
-
return !bundleId || bundleId === NIL_UUID ?
|
|
218
|
+
return !bundleId || bundleId === NIL_UUID ? getMinBundleId() : bundleId;
|
|
219
219
|
};
|
|
220
220
|
|
|
221
221
|
const getFreshBundleId = (): string => {
|
|
@@ -588,11 +588,13 @@ export function setReloadBehavior(
|
|
|
588
588
|
}
|
|
589
589
|
|
|
590
590
|
/**
|
|
591
|
-
* Fetches the
|
|
591
|
+
* Fetches the minimum bundle id created from the native app build time.
|
|
592
592
|
*
|
|
593
|
-
*
|
|
593
|
+
* Release Catalog selection uses this value as its minimum Release id.
|
|
594
|
+
*
|
|
595
|
+
* @returns {string} The minimum bundle id.
|
|
594
596
|
*/
|
|
595
|
-
export const
|
|
597
|
+
export const getMinBundleId = (): string => {
|
|
596
598
|
const constants = HotUpdaterNative.getConstants();
|
|
597
599
|
return constants.MIN_BUNDLE_ID;
|
|
598
600
|
};
|
package/src/sdkVersion.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const HOT_UPDATER_SDK_VERSION = "1.0.0-rc.
|
|
1
|
+
export const HOT_UPDATER_SDK_VERSION = "1.0.0-rc.1";
|