@hot-updater/plugin-core 0.35.11 → 0.35.12
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.
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
require("./_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
const require_queryBundles = require("./queryBundles.cjs");
|
|
3
3
|
const require_createDatabasePlugin = require("./createDatabasePlugin.cjs");
|
|
4
4
|
const require_filterCompatibleAppVersions = require("./filterCompatibleAppVersions.cjs");
|
|
5
5
|
const require_paginateBundles = require("./paginateBundles.cjs");
|
|
6
6
|
const require_resolveUpdateInfoFromBundles = require("./resolveUpdateInfoFromBundles.cjs");
|
|
7
7
|
let es_toolkit = require("es-toolkit");
|
|
8
|
-
let
|
|
9
|
-
semver = require_runtime.__toESM(semver);
|
|
8
|
+
let verkit = require("verkit");
|
|
10
9
|
//#region src/createBlobDatabasePlugin.ts
|
|
11
10
|
const STORAGE_OPERATION_CONCURRENCY = 8;
|
|
12
11
|
async function mapWithConcurrency(items, concurrency, mapper) {
|
|
@@ -40,7 +39,7 @@ function isExactVersion(version) {
|
|
|
40
39
|
if (!version) return false;
|
|
41
40
|
const normalized = normalizeTargetAppVersion(version);
|
|
42
41
|
if (!normalized) return false;
|
|
43
|
-
return
|
|
42
|
+
return (0, verkit.normalize)(normalized) !== null;
|
|
44
43
|
}
|
|
45
44
|
/**
|
|
46
45
|
* Get all normalized semver versions for a version string.
|
|
@@ -53,12 +52,13 @@ function isExactVersion(version) {
|
|
|
53
52
|
*/
|
|
54
53
|
function getSemverNormalizedVersions(version) {
|
|
55
54
|
const normalized = normalizeTargetAppVersion(version) || version;
|
|
56
|
-
const coerced =
|
|
55
|
+
const coerced = (0, verkit.coerce)(normalized);
|
|
57
56
|
if (!coerced) return [normalized];
|
|
57
|
+
const { major, minor, patch } = (0, verkit.parse)(coerced);
|
|
58
58
|
const versions = /* @__PURE__ */ new Set();
|
|
59
|
-
versions.add(coerced
|
|
60
|
-
if (
|
|
61
|
-
if (
|
|
59
|
+
versions.add(coerced);
|
|
60
|
+
if (patch === 0) versions.add(`${major}.${minor}`);
|
|
61
|
+
if (minor === 0 && patch === 0) versions.add(`${major}`);
|
|
62
62
|
return Array.from(versions);
|
|
63
63
|
}
|
|
64
64
|
function resolveStorageTarget({ targetAppVersion, fingerprintHash }) {
|
|
@@ -4,7 +4,7 @@ import { filterCompatibleAppVersions } from "./filterCompatibleAppVersions.mjs";
|
|
|
4
4
|
import { paginateBundles } from "./paginateBundles.mjs";
|
|
5
5
|
import { resolveUpdateInfoFromBundles } from "./resolveUpdateInfoFromBundles.mjs";
|
|
6
6
|
import { orderBy } from "es-toolkit";
|
|
7
|
-
import
|
|
7
|
+
import { coerce, normalize, parse } from "verkit";
|
|
8
8
|
//#region src/createBlobDatabasePlugin.ts
|
|
9
9
|
const STORAGE_OPERATION_CONCURRENCY = 8;
|
|
10
10
|
async function mapWithConcurrency(items, concurrency, mapper) {
|
|
@@ -38,7 +38,7 @@ function isExactVersion(version) {
|
|
|
38
38
|
if (!version) return false;
|
|
39
39
|
const normalized = normalizeTargetAppVersion(version);
|
|
40
40
|
if (!normalized) return false;
|
|
41
|
-
return
|
|
41
|
+
return normalize(normalized) !== null;
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* Get all normalized semver versions for a version string.
|
|
@@ -51,12 +51,13 @@ function isExactVersion(version) {
|
|
|
51
51
|
*/
|
|
52
52
|
function getSemverNormalizedVersions(version) {
|
|
53
53
|
const normalized = normalizeTargetAppVersion(version) || version;
|
|
54
|
-
const coerced =
|
|
54
|
+
const coerced = coerce(normalized);
|
|
55
55
|
if (!coerced) return [normalized];
|
|
56
|
+
const { major, minor, patch } = parse(coerced);
|
|
56
57
|
const versions = /* @__PURE__ */ new Set();
|
|
57
|
-
versions.add(coerced
|
|
58
|
-
if (
|
|
59
|
-
if (
|
|
58
|
+
versions.add(coerced);
|
|
59
|
+
if (patch === 0) versions.add(`${major}.${minor}`);
|
|
60
|
+
if (minor === 0 && patch === 0) versions.add(`${major}`);
|
|
60
61
|
return Array.from(versions);
|
|
61
62
|
}
|
|
62
63
|
function resolveStorageTarget({ targetAppVersion, fingerprintHash }) {
|
package/dist/semverSatisfies.cjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
let
|
|
3
|
-
semver = require_runtime.__toESM(semver);
|
|
1
|
+
require("./_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
let verkit = require("verkit");
|
|
4
3
|
//#region src/semverSatisfies.ts
|
|
5
4
|
const semverSatisfies = (targetAppVersion, currentVersion) => {
|
|
6
|
-
const currentCoerce =
|
|
5
|
+
const currentCoerce = (0, verkit.coerce)(currentVersion);
|
|
7
6
|
if (!currentCoerce) return false;
|
|
8
|
-
return
|
|
7
|
+
return (0, verkit.satisfies)(currentCoerce, targetAppVersion);
|
|
9
8
|
};
|
|
10
9
|
//#endregion
|
|
11
10
|
exports.semverSatisfies = semverSatisfies;
|
package/dist/semverSatisfies.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { coerce, satisfies } from "verkit";
|
|
2
2
|
//#region src/semverSatisfies.ts
|
|
3
3
|
const semverSatisfies = (targetAppVersion, currentVersion) => {
|
|
4
|
-
const currentCoerce =
|
|
4
|
+
const currentCoerce = coerce(currentVersion);
|
|
5
5
|
if (!currentCoerce) return false;
|
|
6
|
-
return
|
|
6
|
+
return satisfies(currentCoerce, targetAppVersion);
|
|
7
7
|
};
|
|
8
8
|
//#endregion
|
|
9
9
|
export { semverSatisfies };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/plugin-core",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -44,16 +44,15 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"es-toolkit": "^1.32.0",
|
|
46
46
|
"mime": "^4.0.4",
|
|
47
|
-
"
|
|
48
|
-
"@hot-updater/
|
|
49
|
-
"@hot-updater/
|
|
47
|
+
"verkit": "0.3.2",
|
|
48
|
+
"@hot-updater/js": "0.35.12",
|
|
49
|
+
"@hot-updater/core": "0.35.12"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/node": "^20",
|
|
53
|
-
"@types/semver": "^7.5.8",
|
|
54
53
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
55
54
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
56
|
-
"@hot-updater/test-utils": "0.35.
|
|
55
|
+
"@hot-updater/test-utils": "0.35.12"
|
|
57
56
|
},
|
|
58
57
|
"scripts": {
|
|
59
58
|
"build": "tsdown",
|