@hot-updater/plugin-core 0.25.8 → 0.25.10
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.
|
@@ -76,13 +76,21 @@ const createBlobDatabasePlugin = ({ name, factory }) => {
|
|
|
76
76
|
* Returns true if the file was updated, false if no changes were made.
|
|
77
77
|
*/
|
|
78
78
|
async function updateTargetVersionsForPlatform(platform) {
|
|
79
|
-
const
|
|
80
|
-
const
|
|
79
|
+
const updateJsonPattern = /* @__PURE__ */ new RegExp(`^[^/]+/${platform}/[^/]+/update\\.json$`);
|
|
80
|
+
const targetVersionsPattern = /* @__PURE__ */ new RegExp(`^[^/]+/${platform}/target-app-versions\\.json$`);
|
|
81
|
+
const allKeys = await listObjects("");
|
|
82
|
+
const updateJsonKeys = allKeys.filter((key) => updateJsonPattern.test(key));
|
|
83
|
+
const targetVersionsKeys = allKeys.filter((key) => targetVersionsPattern.test(key));
|
|
84
|
+
const keysByChannel = updateJsonKeys.reduce((acc, key) => {
|
|
81
85
|
const channel = key.split("/")[0];
|
|
82
86
|
acc[channel] = acc[channel] || [];
|
|
83
87
|
acc[channel].push(key);
|
|
84
88
|
return acc;
|
|
85
89
|
}, {});
|
|
90
|
+
for (const key of targetVersionsKeys) {
|
|
91
|
+
const channel = key.split("/")[0];
|
|
92
|
+
if (!keysByChannel[channel]) keysByChannel[channel] = [];
|
|
93
|
+
}
|
|
86
94
|
const updatedTargetFiles = /* @__PURE__ */ new Set();
|
|
87
95
|
for (const channel of Object.keys(keysByChannel)) {
|
|
88
96
|
const updateKeys = keysByChannel[channel];
|
|
@@ -151,8 +159,10 @@ const createBlobDatabasePlugin = ({ name, factory }) => {
|
|
|
151
159
|
const removalsByKey = {};
|
|
152
160
|
const pathsToInvalidate = /* @__PURE__ */ new Set();
|
|
153
161
|
let isTargetAppVersionChanged = false;
|
|
162
|
+
let isChannelChanged = false;
|
|
154
163
|
for (const { operation, data } of changedSets) {
|
|
155
164
|
if (data.targetAppVersion !== void 0) isTargetAppVersionChanged = true;
|
|
165
|
+
if (operation === "update" && data.channel !== void 0) isChannelChanged = true;
|
|
156
166
|
if (operation === "insert") {
|
|
157
167
|
const target = normalizeTargetAppVersion(data.targetAppVersion) ?? data.fingerprintHash;
|
|
158
168
|
if (!target) throw new Error("target not found");
|
|
@@ -293,7 +303,7 @@ const createBlobDatabasePlugin = ({ name, factory }) => {
|
|
|
293
303
|
await uploadObject(key, currentBundles);
|
|
294
304
|
})();
|
|
295
305
|
const updatedTargetFilePaths = /* @__PURE__ */ new Set();
|
|
296
|
-
if (isTargetAppVersionChanged) for (const platform of PLATFORMS) {
|
|
306
|
+
if (isTargetAppVersionChanged || isChannelChanged) for (const platform of PLATFORMS) {
|
|
297
307
|
const updatedPaths = await updateTargetVersionsForPlatform(platform);
|
|
298
308
|
for (const path of updatedPaths) updatedTargetFilePaths.add(path);
|
|
299
309
|
}
|
|
@@ -73,13 +73,21 @@ const createBlobDatabasePlugin = ({ name, factory }) => {
|
|
|
73
73
|
* Returns true if the file was updated, false if no changes were made.
|
|
74
74
|
*/
|
|
75
75
|
async function updateTargetVersionsForPlatform(platform) {
|
|
76
|
-
const
|
|
77
|
-
const
|
|
76
|
+
const updateJsonPattern = /* @__PURE__ */ new RegExp(`^[^/]+/${platform}/[^/]+/update\\.json$`);
|
|
77
|
+
const targetVersionsPattern = /* @__PURE__ */ new RegExp(`^[^/]+/${platform}/target-app-versions\\.json$`);
|
|
78
|
+
const allKeys = await listObjects("");
|
|
79
|
+
const updateJsonKeys = allKeys.filter((key) => updateJsonPattern.test(key));
|
|
80
|
+
const targetVersionsKeys = allKeys.filter((key) => targetVersionsPattern.test(key));
|
|
81
|
+
const keysByChannel = updateJsonKeys.reduce((acc, key) => {
|
|
78
82
|
const channel = key.split("/")[0];
|
|
79
83
|
acc[channel] = acc[channel] || [];
|
|
80
84
|
acc[channel].push(key);
|
|
81
85
|
return acc;
|
|
82
86
|
}, {});
|
|
87
|
+
for (const key of targetVersionsKeys) {
|
|
88
|
+
const channel = key.split("/")[0];
|
|
89
|
+
if (!keysByChannel[channel]) keysByChannel[channel] = [];
|
|
90
|
+
}
|
|
83
91
|
const updatedTargetFiles = /* @__PURE__ */ new Set();
|
|
84
92
|
for (const channel of Object.keys(keysByChannel)) {
|
|
85
93
|
const updateKeys = keysByChannel[channel];
|
|
@@ -148,8 +156,10 @@ const createBlobDatabasePlugin = ({ name, factory }) => {
|
|
|
148
156
|
const removalsByKey = {};
|
|
149
157
|
const pathsToInvalidate = /* @__PURE__ */ new Set();
|
|
150
158
|
let isTargetAppVersionChanged = false;
|
|
159
|
+
let isChannelChanged = false;
|
|
151
160
|
for (const { operation, data } of changedSets) {
|
|
152
161
|
if (data.targetAppVersion !== void 0) isTargetAppVersionChanged = true;
|
|
162
|
+
if (operation === "update" && data.channel !== void 0) isChannelChanged = true;
|
|
153
163
|
if (operation === "insert") {
|
|
154
164
|
const target = normalizeTargetAppVersion(data.targetAppVersion) ?? data.fingerprintHash;
|
|
155
165
|
if (!target) throw new Error("target not found");
|
|
@@ -290,7 +300,7 @@ const createBlobDatabasePlugin = ({ name, factory }) => {
|
|
|
290
300
|
await uploadObject(key, currentBundles);
|
|
291
301
|
})();
|
|
292
302
|
const updatedTargetFilePaths = /* @__PURE__ */ new Set();
|
|
293
|
-
if (isTargetAppVersionChanged) for (const platform of PLATFORMS) {
|
|
303
|
+
if (isTargetAppVersionChanged || isChannelChanged) for (const platform of PLATFORMS) {
|
|
294
304
|
const updatedPaths = await updateTargetVersionsForPlatform(platform);
|
|
295
305
|
for (const path of updatedPaths) updatedTargetFilePaths.add(path);
|
|
296
306
|
}
|
package/dist/types/index.d.cts
CHANGED
|
@@ -154,7 +154,7 @@ interface NativeBuildIosScheme {
|
|
|
154
154
|
/**
|
|
155
155
|
* Automatically install CocoaPods dependencies before building.
|
|
156
156
|
*
|
|
157
|
-
* @default
|
|
157
|
+
* @default false
|
|
158
158
|
*/
|
|
159
159
|
installPods?: boolean;
|
|
160
160
|
/**
|
|
@@ -169,6 +169,15 @@ interface NativeBuildIosScheme {
|
|
|
169
169
|
* @example ["-allowProvisioningUpdates"]
|
|
170
170
|
*/
|
|
171
171
|
exportExtraParams?: string[];
|
|
172
|
+
/**
|
|
173
|
+
* Convenience shortcut option for simulator builds.
|
|
174
|
+
* When true, this option should not be used together with the destination option.
|
|
175
|
+
*
|
|
176
|
+
* This option only affects build:ios, not run:ios.
|
|
177
|
+
*
|
|
178
|
+
* @default false
|
|
179
|
+
*/
|
|
180
|
+
simulator?: boolean;
|
|
172
181
|
}
|
|
173
182
|
interface PlatformConfig {
|
|
174
183
|
/**
|
package/dist/types/index.d.ts
CHANGED
|
@@ -154,7 +154,7 @@ interface NativeBuildIosScheme {
|
|
|
154
154
|
/**
|
|
155
155
|
* Automatically install CocoaPods dependencies before building.
|
|
156
156
|
*
|
|
157
|
-
* @default
|
|
157
|
+
* @default false
|
|
158
158
|
*/
|
|
159
159
|
installPods?: boolean;
|
|
160
160
|
/**
|
|
@@ -169,6 +169,15 @@ interface NativeBuildIosScheme {
|
|
|
169
169
|
* @example ["-allowProvisioningUpdates"]
|
|
170
170
|
*/
|
|
171
171
|
exportExtraParams?: string[];
|
|
172
|
+
/**
|
|
173
|
+
* Convenience shortcut option for simulator builds.
|
|
174
|
+
* When true, this option should not be used together with the destination option.
|
|
175
|
+
*
|
|
176
|
+
* This option only affects build:ios, not run:ios.
|
|
177
|
+
*
|
|
178
|
+
* @default false
|
|
179
|
+
*/
|
|
180
|
+
simulator?: boolean;
|
|
172
181
|
}
|
|
173
182
|
interface PlatformConfig {
|
|
174
183
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/plugin-core",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"es-toolkit": "^1.32.0",
|
|
43
43
|
"mime": "^4.0.4",
|
|
44
44
|
"semver": "^7.7.2",
|
|
45
|
-
"@hot-updater/core": "0.25.
|
|
45
|
+
"@hot-updater/core": "0.25.10"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/semver": "^7.5.8",
|
|
49
49
|
"typescript": "5.8.2",
|
|
50
|
-
"@hot-updater/test-utils": "0.25.
|
|
50
|
+
"@hot-updater/test-utils": "0.25.10"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "tsdown",
|