hot-updater 0.18.5 → 0.19.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/chunk-DWy1uDak.cjs +39 -0
- package/dist/config.cjs +6 -1
- package/dist/config.d.cts +26 -1
- package/dist/config.d.ts +26 -1
- package/dist/config.js +3 -1
- package/dist/fingerprint-m6lqnvbJ.js +119 -0
- package/dist/fingerprint-w8QPkdqq.cjs +149 -0
- package/dist/index.cjs +11959 -11998
- package/dist/index.js +11858 -11898
- package/dist/{picocolors-nLcU57DT.cjs → picocolors--H0eYra-.cjs} +2 -39
- package/dist/plugins/babel.cjs +5 -46
- package/dist/plugins/babel.js +0 -42
- package/package.json +9 -9
|
@@ -1,32 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) => function() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
13
|
-
key = keys[i];
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
-
get: ((k) => from[k]).bind(null, key),
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
22
|
-
value: mod,
|
|
23
|
-
enumerable: true
|
|
24
|
-
}) : target, mod));
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
1
|
+
const require_chunk = require('./chunk-DWy1uDak.cjs');
|
|
27
2
|
|
|
28
3
|
//#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
29
|
-
var require_picocolors = __commonJS({ "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports, module) {
|
|
4
|
+
var require_picocolors = require_chunk.__commonJS({ "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports, module) {
|
|
30
5
|
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
31
6
|
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
32
7
|
let formatter = (open, close, replace = open) => (input) => {
|
|
@@ -94,18 +69,6 @@ var require_picocolors = __commonJS({ "../../node_modules/.pnpm/picocolors@1.1.1
|
|
|
94
69
|
} });
|
|
95
70
|
|
|
96
71
|
//#endregion
|
|
97
|
-
Object.defineProperty(exports, '__commonJS', {
|
|
98
|
-
enumerable: true,
|
|
99
|
-
get: function () {
|
|
100
|
-
return __commonJS;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
Object.defineProperty(exports, '__toESM', {
|
|
104
|
-
enumerable: true,
|
|
105
|
-
get: function () {
|
|
106
|
-
return __toESM;
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
72
|
Object.defineProperty(exports, 'require_picocolors', {
|
|
110
73
|
enumerable: true,
|
|
111
74
|
get: function () {
|
package/dist/plugins/babel.cjs
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const fs =
|
|
4
|
-
const path =
|
|
1
|
+
const require_chunk = require('../chunk-DWy1uDak.cjs');
|
|
2
|
+
const require_picocolors$1 = require('../picocolors--H0eYra-.cjs');
|
|
3
|
+
const fs = require_chunk.__toESM(require("fs"));
|
|
4
|
+
const path = require_chunk.__toESM(require("path"));
|
|
5
5
|
|
|
6
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/function/memoize.mjs
|
|
7
|
-
function memoize(fn, options = {}) {
|
|
8
|
-
const { cache = /* @__PURE__ */ new Map(), getCacheKey } = options;
|
|
9
|
-
const memoizedFn = function(arg) {
|
|
10
|
-
const key = getCacheKey ? getCacheKey(arg) : arg;
|
|
11
|
-
if (cache.has(key)) return cache.get(key);
|
|
12
|
-
const result = fn.call(this, arg);
|
|
13
|
-
cache.set(key, result);
|
|
14
|
-
return result;
|
|
15
|
-
};
|
|
16
|
-
memoizedFn.cache = cache;
|
|
17
|
-
return memoizedFn;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
6
|
//#region ../../node_modules/.pnpm/uuidv7@1.0.2/node_modules/uuidv7/dist/index.js
|
|
22
7
|
/**
|
|
23
8
|
* uuidv7: A JavaScript implementation of UUID version 7
|
|
@@ -348,7 +333,7 @@ const uuidv7obj = () => (defaultGenerator || (defaultGenerator = new V7Generator
|
|
|
348
333
|
|
|
349
334
|
//#endregion
|
|
350
335
|
//#region src/plugins/babel.ts
|
|
351
|
-
var import_picocolors =
|
|
336
|
+
var import_picocolors = require_chunk.__toESM(require_picocolors$1.require_picocolors());
|
|
352
337
|
const NIL_UUID = "00000000-0000-0000-0000-000000000000";
|
|
353
338
|
const getBundleId = () => {
|
|
354
339
|
const buildOutDir = process.env["BUILD_OUT_DIR"];
|
|
@@ -362,38 +347,12 @@ const getBundleId = () => {
|
|
|
362
347
|
}
|
|
363
348
|
return bundleId;
|
|
364
349
|
};
|
|
365
|
-
const memoizeLoadConfig = memoize(__hot_updater_plugin_core.loadConfigSync);
|
|
366
|
-
const getFingerprintJson = () => {
|
|
367
|
-
const { updateStrategy } = memoizeLoadConfig(null);
|
|
368
|
-
if (updateStrategy === "appVersion") return null;
|
|
369
|
-
const fingerprintPath = path.default.join((0, __hot_updater_plugin_core.getCwd)(), "fingerprint.json");
|
|
370
|
-
if (!fs.default.existsSync(fingerprintPath)) throw new Error("Missing fingerprint.json. Since updateStrategy is set to 'fingerprint' in hot-updater.config, please run `hot-updater fingerprint create`.");
|
|
371
|
-
try {
|
|
372
|
-
const fingerprint = JSON.parse(fs.default.readFileSync(fingerprintPath, "utf-8"));
|
|
373
|
-
return {
|
|
374
|
-
iosHash: fingerprint.ios.hash,
|
|
375
|
-
androidHash: fingerprint.android.hash
|
|
376
|
-
};
|
|
377
|
-
} catch {
|
|
378
|
-
throw new Error("Invalid fingerprint.json. Since updateStrategy is set to 'fingerprint' in hot-updater.config, please run `hot-updater fingerprint create`.");
|
|
379
|
-
}
|
|
380
|
-
};
|
|
381
|
-
const getOverTheAirChannel = () => {
|
|
382
|
-
return process.env["HOT_UPDATER_CHANNEL"];
|
|
383
|
-
};
|
|
384
350
|
function babel_default({ types: t }) {
|
|
385
351
|
const bundleId = getBundleId();
|
|
386
|
-
const fingerprint = getFingerprintJson();
|
|
387
|
-
const channel = getOverTheAirChannel();
|
|
388
|
-
const { updateStrategy } = memoizeLoadConfig(null);
|
|
389
352
|
return {
|
|
390
353
|
name: "hot-updater-babel-plugin",
|
|
391
354
|
visitor: { Identifier(path$2) {
|
|
392
355
|
if (path$2.node.name === "__HOT_UPDATER_BUNDLE_ID") path$2.replaceWith(t.stringLiteral(bundleId));
|
|
393
|
-
if (path$2.node.name === "__HOT_UPDATER_CHANNEL") path$2.replaceWith(channel ? t.stringLiteral(channel) : t.nullLiteral());
|
|
394
|
-
if (path$2.node.name === "__HOT_UPDATER_FINGERPRINT_HASH_IOS") fingerprint?.iosHash ? path$2.replaceWith(t.stringLiteral(fingerprint.iosHash)) : path$2.replaceWith(t.nullLiteral());
|
|
395
|
-
if (path$2.node.name === "__HOT_UPDATER_FINGERPRINT_HASH_ANDROID") fingerprint?.androidHash ? path$2.replaceWith(t.stringLiteral(fingerprint.androidHash)) : path$2.replaceWith(t.nullLiteral());
|
|
396
|
-
if (path$2.node.name === "__HOT_UPDATER_UPDATE_STRATEGY") path$2.replaceWith(t.stringLiteral(updateStrategy));
|
|
397
356
|
} }
|
|
398
357
|
};
|
|
399
358
|
}
|
package/dist/plugins/babel.js
CHANGED
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import { __toESM, require_picocolors } from "../picocolors-OFVOrezl.js";
|
|
2
|
-
import { getCwd, loadConfigSync } from "@hot-updater/plugin-core";
|
|
3
2
|
import fs from "fs";
|
|
4
3
|
import path from "path";
|
|
5
4
|
|
|
6
|
-
//#region ../../node_modules/.pnpm/es-toolkit@1.32.0/node_modules/es-toolkit/dist/function/memoize.mjs
|
|
7
|
-
function memoize(fn, options = {}) {
|
|
8
|
-
const { cache = /* @__PURE__ */ new Map(), getCacheKey } = options;
|
|
9
|
-
const memoizedFn = function(arg) {
|
|
10
|
-
const key = getCacheKey ? getCacheKey(arg) : arg;
|
|
11
|
-
if (cache.has(key)) return cache.get(key);
|
|
12
|
-
const result = fn.call(this, arg);
|
|
13
|
-
cache.set(key, result);
|
|
14
|
-
return result;
|
|
15
|
-
};
|
|
16
|
-
memoizedFn.cache = cache;
|
|
17
|
-
return memoizedFn;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
5
|
//#region ../../node_modules/.pnpm/uuidv7@1.0.2/node_modules/uuidv7/dist/index.js
|
|
22
6
|
/**
|
|
23
7
|
* uuidv7: A JavaScript implementation of UUID version 7
|
|
@@ -362,38 +346,12 @@ const getBundleId = () => {
|
|
|
362
346
|
}
|
|
363
347
|
return bundleId;
|
|
364
348
|
};
|
|
365
|
-
const memoizeLoadConfig = memoize(loadConfigSync);
|
|
366
|
-
const getFingerprintJson = () => {
|
|
367
|
-
const { updateStrategy } = memoizeLoadConfig(null);
|
|
368
|
-
if (updateStrategy === "appVersion") return null;
|
|
369
|
-
const fingerprintPath = path.join(getCwd(), "fingerprint.json");
|
|
370
|
-
if (!fs.existsSync(fingerprintPath)) throw new Error("Missing fingerprint.json. Since updateStrategy is set to 'fingerprint' in hot-updater.config, please run `hot-updater fingerprint create`.");
|
|
371
|
-
try {
|
|
372
|
-
const fingerprint = JSON.parse(fs.readFileSync(fingerprintPath, "utf-8"));
|
|
373
|
-
return {
|
|
374
|
-
iosHash: fingerprint.ios.hash,
|
|
375
|
-
androidHash: fingerprint.android.hash
|
|
376
|
-
};
|
|
377
|
-
} catch {
|
|
378
|
-
throw new Error("Invalid fingerprint.json. Since updateStrategy is set to 'fingerprint' in hot-updater.config, please run `hot-updater fingerprint create`.");
|
|
379
|
-
}
|
|
380
|
-
};
|
|
381
|
-
const getOverTheAirChannel = () => {
|
|
382
|
-
return process.env["HOT_UPDATER_CHANNEL"];
|
|
383
|
-
};
|
|
384
349
|
function babel_default({ types: t }) {
|
|
385
350
|
const bundleId = getBundleId();
|
|
386
|
-
const fingerprint = getFingerprintJson();
|
|
387
|
-
const channel = getOverTheAirChannel();
|
|
388
|
-
const { updateStrategy } = memoizeLoadConfig(null);
|
|
389
351
|
return {
|
|
390
352
|
name: "hot-updater-babel-plugin",
|
|
391
353
|
visitor: { Identifier(path$1) {
|
|
392
354
|
if (path$1.node.name === "__HOT_UPDATER_BUNDLE_ID") path$1.replaceWith(t.stringLiteral(bundleId));
|
|
393
|
-
if (path$1.node.name === "__HOT_UPDATER_CHANNEL") path$1.replaceWith(channel ? t.stringLiteral(channel) : t.nullLiteral());
|
|
394
|
-
if (path$1.node.name === "__HOT_UPDATER_FINGERPRINT_HASH_IOS") fingerprint?.iosHash ? path$1.replaceWith(t.stringLiteral(fingerprint.iosHash)) : path$1.replaceWith(t.nullLiteral());
|
|
395
|
-
if (path$1.node.name === "__HOT_UPDATER_FINGERPRINT_HASH_ANDROID") fingerprint?.androidHash ? path$1.replaceWith(t.stringLiteral(fingerprint.androidHash)) : path$1.replaceWith(t.nullLiteral());
|
|
396
|
-
if (path$1.node.name === "__HOT_UPDATER_UPDATE_STRATEGY") path$1.replaceWith(t.stringLiteral(updateStrategy));
|
|
397
355
|
} }
|
|
398
356
|
};
|
|
399
357
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hot-updater",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.19.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"hot-updater": "./dist/index.js"
|
|
7
7
|
},
|
|
@@ -48,19 +48,19 @@
|
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
+
"@expo/fingerprint": "0.12.4",
|
|
51
52
|
"@bacons/xcode": "1.0.0-alpha.24",
|
|
52
53
|
"@clack/prompts": "^0.10.0",
|
|
53
54
|
"@commander-js/extra-typings": "^14.0.0",
|
|
54
|
-
"@rnef/tools": "0.7.12",
|
|
55
55
|
"commander": "^14.0.0",
|
|
56
56
|
"cosmiconfig": "^9.0.0",
|
|
57
57
|
"cosmiconfig-typescript-loader": "^5.0.0",
|
|
58
58
|
"es-git": "^0.2.0",
|
|
59
59
|
"fast-xml-parser": "^5.2.3",
|
|
60
60
|
"globby": "^14.1.0",
|
|
61
|
-
"@hot-updater/console": "0.
|
|
62
|
-
"@hot-updater/plugin-core": "0.
|
|
63
|
-
"@hot-updater/core": "0.
|
|
61
|
+
"@hot-updater/console": "0.19.0",
|
|
62
|
+
"@hot-updater/plugin-core": "0.19.0",
|
|
63
|
+
"@hot-updater/core": "0.19.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@babel/core": "7.26.0",
|
|
@@ -86,10 +86,10 @@
|
|
|
86
86
|
"read-package-up": "^11.0.0",
|
|
87
87
|
"semver": "^7.6.3",
|
|
88
88
|
"uuidv7": "^1.0.2",
|
|
89
|
-
"@hot-updater/aws": "0.
|
|
90
|
-
"@hot-updater/cloudflare": "0.
|
|
91
|
-
"@hot-updater/firebase": "0.
|
|
92
|
-
"@hot-updater/supabase": "0.
|
|
89
|
+
"@hot-updater/aws": "0.19.0",
|
|
90
|
+
"@hot-updater/cloudflare": "0.19.0",
|
|
91
|
+
"@hot-updater/firebase": "0.19.0",
|
|
92
|
+
"@hot-updater/supabase": "0.19.0"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"@hot-updater/aws": "*",
|