hot-updater 0.13.4 → 0.13.5
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/index.cjs +25 -15
- package/dist/index.js +14 -5
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -13059,8 +13059,8 @@ var __webpack_exports__ = {};
|
|
|
13059
13059
|
port
|
|
13060
13060
|
}, listeningListener);
|
|
13061
13061
|
};
|
|
13062
|
-
|
|
13063
|
-
var
|
|
13062
|
+
var external_fs_ = __webpack_require__("fs");
|
|
13063
|
+
var external_fs_default = /*#__PURE__*/ __webpack_require__.n(external_fs_);
|
|
13064
13064
|
var valid = __webpack_require__("../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/valid.js");
|
|
13065
13065
|
var valid_default = /*#__PURE__*/ __webpack_require__.n(valid);
|
|
13066
13066
|
const external_node_process_namespaceObject = require("node:process");
|
|
@@ -13068,7 +13068,7 @@ var __webpack_exports__ = {};
|
|
|
13068
13068
|
const external_node_path_namespaceObject = require("node:path");
|
|
13069
13069
|
const external_node_url_namespaceObject = require("node:url");
|
|
13070
13070
|
const external_node_child_process_namespaceObject = require("node:child_process");
|
|
13071
|
-
const
|
|
13071
|
+
const promises_namespaceObject = require("node:fs/promises");
|
|
13072
13072
|
const external_node_os_namespaceObject = require("node:os");
|
|
13073
13073
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
13074
13074
|
let isDockerCached;
|
|
@@ -13258,11 +13258,11 @@ var __webpack_exports__ = {};
|
|
|
13258
13258
|
const configFilePath = '/etc/wsl.conf';
|
|
13259
13259
|
let isConfigFileExists = false;
|
|
13260
13260
|
try {
|
|
13261
|
-
await
|
|
13261
|
+
await promises_namespaceObject.access(configFilePath, promises_namespaceObject.constants.F_OK);
|
|
13262
13262
|
isConfigFileExists = true;
|
|
13263
13263
|
} catch {}
|
|
13264
13264
|
if (!isConfigFileExists) return defaultMountPoint;
|
|
13265
|
-
const configContent = await
|
|
13265
|
+
const configContent = await promises_namespaceObject.readFile(configFilePath, {
|
|
13266
13266
|
encoding: 'utf8'
|
|
13267
13267
|
});
|
|
13268
13268
|
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
@@ -13348,7 +13348,7 @@ var __webpack_exports__ = {};
|
|
|
13348
13348
|
const isBundled = !open_dirname || '/' === open_dirname;
|
|
13349
13349
|
let exeLocalXdgOpen = false;
|
|
13350
13350
|
try {
|
|
13351
|
-
await
|
|
13351
|
+
await promises_namespaceObject.access(localXdgOpenPath, promises_namespaceObject.constants.X_OK);
|
|
13352
13352
|
exeLocalXdgOpen = true;
|
|
13353
13353
|
} catch {}
|
|
13354
13354
|
const useSystemXdgOpen = external_node_process_namespaceObject.versions.electron ?? ('android' === open_platform || isBundled || !exeLocalXdgOpen);
|
|
@@ -13486,7 +13486,7 @@ var __webpack_exports__ = {};
|
|
|
13486
13486
|
while(directory){
|
|
13487
13487
|
const filePath = isAbsoluteName ? name : external_node_path_namespaceObject.join(directory, name);
|
|
13488
13488
|
try {
|
|
13489
|
-
const stats = await
|
|
13489
|
+
const stats = await promises_namespaceObject.stat(filePath);
|
|
13490
13490
|
if ('file' === type && stats.isFile() || 'directory' === type && stats.isDirectory()) return filePath;
|
|
13491
13491
|
} catch {}
|
|
13492
13492
|
if (directory === stopAt || directory === root) break;
|
|
@@ -13510,6 +13510,8 @@ var __webpack_exports__ = {};
|
|
|
13510
13510
|
directory = external_node_path_namespaceObject.dirname(directory);
|
|
13511
13511
|
}
|
|
13512
13512
|
}
|
|
13513
|
+
const external_fs_promises_namespaceObject = require("fs/promises");
|
|
13514
|
+
var external_fs_promises_default = /*#__PURE__*/ __webpack_require__.n(external_fs_promises_namespaceObject);
|
|
13513
13515
|
var plist = __webpack_require__("../../node_modules/.pnpm/plist@3.1.0/node_modules/plist/index.js");
|
|
13514
13516
|
var plist_default = /*#__PURE__*/ __webpack_require__.n(plist);
|
|
13515
13517
|
const getIOSVersion = async (cwd)=>{
|
|
@@ -13519,7 +13521,7 @@ var __webpack_exports__ = {};
|
|
|
13519
13521
|
type: "file"
|
|
13520
13522
|
});
|
|
13521
13523
|
if (!plistPath) return null;
|
|
13522
|
-
const file = await
|
|
13524
|
+
const file = await external_fs_promises_default().readFile(plistPath, "utf8");
|
|
13523
13525
|
const data = plist_default().parse(file);
|
|
13524
13526
|
return data["CFBundleShortVersionString"] ?? null;
|
|
13525
13527
|
} catch {
|
|
@@ -13529,7 +13531,7 @@ var __webpack_exports__ = {};
|
|
|
13529
13531
|
const getAndroidVersion = async (cwd)=>{
|
|
13530
13532
|
const buildGradlePath = external_path_default().join(cwd, "android", "app", "build.gradle");
|
|
13531
13533
|
try {
|
|
13532
|
-
const buildGradleContent = await
|
|
13534
|
+
const buildGradleContent = await external_fs_promises_default().readFile(buildGradlePath, "utf8");
|
|
13533
13535
|
const versionNameMatch = buildGradleContent.match(/versionName\s+"([\d.]+)"/);
|
|
13534
13536
|
return versionNameMatch?.[1] ? versionNameMatch[1] : null;
|
|
13535
13537
|
} catch (error) {
|
|
@@ -13553,7 +13555,7 @@ var __webpack_exports__ = {};
|
|
|
13553
13555
|
};
|
|
13554
13556
|
const getFileHashFromFile = async (filepath)=>{
|
|
13555
13557
|
try {
|
|
13556
|
-
const fileBuffer = await
|
|
13558
|
+
const fileBuffer = await external_fs_promises_default().readFile(filepath).catch((error)=>{
|
|
13557
13559
|
console.error("Error reading the file:", error);
|
|
13558
13560
|
throw error;
|
|
13559
13561
|
});
|
|
@@ -13598,7 +13600,13 @@ var __webpack_exports__ = {};
|
|
|
13598
13600
|
async function getBundleZipTargets(basePath, files) {
|
|
13599
13601
|
const bundleCandidates = {};
|
|
13600
13602
|
const targets = [];
|
|
13601
|
-
const getRelative = (file)=>
|
|
13603
|
+
const getRelative = (file)=>{
|
|
13604
|
+
if (file.startsWith(basePath)) {
|
|
13605
|
+
const sliceIndex = basePath.endsWith("/") ? basePath.length : basePath.length + 1;
|
|
13606
|
+
return file.slice(sliceIndex);
|
|
13607
|
+
}
|
|
13608
|
+
return file;
|
|
13609
|
+
};
|
|
13602
13610
|
for (const file of files){
|
|
13603
13611
|
if (file.endsWith(".map")) continue;
|
|
13604
13612
|
const relative = getRelative(file);
|
|
@@ -13722,7 +13730,7 @@ var __webpack_exports__ = {};
|
|
|
13722
13730
|
return json;
|
|
13723
13731
|
};
|
|
13724
13732
|
async function readPackage({ cwd, normalize = true } = {}) {
|
|
13725
|
-
const packageFile = await
|
|
13733
|
+
const packageFile = await promises_namespaceObject.readFile(getPackagePath(cwd), 'utf8');
|
|
13726
13734
|
return _readPackage(packageFile, normalize);
|
|
13727
13735
|
}
|
|
13728
13736
|
function readPackageSync({ cwd, normalize = true } = {}) {
|
|
@@ -13826,8 +13834,10 @@ var __webpack_exports__ = {};
|
|
|
13826
13834
|
bundlePath = external_path_default().join((0, plugin_core_namespaceObject.getCwd)(), "bundle.zip");
|
|
13827
13835
|
const buildPath = taskRef.buildResult?.buildPath;
|
|
13828
13836
|
if (!buildPath) throw new Error("Build result not found");
|
|
13829
|
-
const files = await
|
|
13830
|
-
|
|
13837
|
+
const files = await external_fs_default().promises.readdir(buildPath, {
|
|
13838
|
+
recursive: true
|
|
13839
|
+
});
|
|
13840
|
+
const targetFiles = await getBundleZipTargets(buildPath, files.filter((file)=>!external_fs_default().statSync(external_path_default().join(buildPath, file)).isDirectory()).map((file)=>external_path_default().join(buildPath, file)));
|
|
13831
13841
|
await (0, plugin_core_namespaceObject.createZipTargetFiles)({
|
|
13832
13842
|
outfile: bundlePath,
|
|
13833
13843
|
targetFiles: targetFiles
|
|
@@ -13875,7 +13885,7 @@ var __webpack_exports__ = {};
|
|
|
13875
13885
|
throw new Error("Failed to update database");
|
|
13876
13886
|
}
|
|
13877
13887
|
await databasePlugin.onUnmount?.();
|
|
13878
|
-
await
|
|
13888
|
+
await external_fs_default().promises.rm(bundlePath);
|
|
13879
13889
|
return `✅ Update Complete (${databasePlugin.name})`;
|
|
13880
13890
|
}
|
|
13881
13891
|
}
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,6 @@ import * as __WEBPACK_EXTERNAL_MODULE_stream__ from "stream";
|
|
|
16
16
|
import * as __WEBPACK_EXTERNAL_MODULE_crypto__ from "crypto";
|
|
17
17
|
import * as __WEBPACK_EXTERNAL_MODULE__hot_updater_console_9a79428d__ from "@hot-updater/console";
|
|
18
18
|
import * as __WEBPACK_EXTERNAL_MODULE__hot_updater_plugin_core_40c1c502__ from "@hot-updater/plugin-core";
|
|
19
|
-
import * as __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__ from "fs/promises";
|
|
20
19
|
import * as __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__ from "node:process";
|
|
21
20
|
import * as __WEBPACK_EXTERNAL_MODULE_node_buffer_fb286294__ from "node:buffer";
|
|
22
21
|
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
@@ -28,6 +27,7 @@ import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
|
|
|
28
27
|
import * as __WEBPACK_EXTERNAL_MODULE_node_util_1b29d436__ from "node:util";
|
|
29
28
|
import * as __WEBPACK_EXTERNAL_MODULE_node_net_0373943e__ from "node:net";
|
|
30
29
|
import * as __WEBPACK_EXTERNAL_MODULE__clack_prompts_3cae1695__ from "@clack/prompts";
|
|
30
|
+
import * as __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__ from "fs/promises";
|
|
31
31
|
import * as __WEBPACK_EXTERNAL_MODULE_es_git_99c53e49__ from "es-git";
|
|
32
32
|
import * as __WEBPACK_EXTERNAL_MODULE_node_string_decoder_28f74b45__ from "node:string_decoder";
|
|
33
33
|
import * as __WEBPACK_EXTERNAL_MODULE_node_tty_c64aab7e__ from "node:tty";
|
|
@@ -13036,6 +13036,7 @@ const openConsole = async (port, listeningListener)=>{
|
|
|
13036
13036
|
port
|
|
13037
13037
|
}, listeningListener);
|
|
13038
13038
|
};
|
|
13039
|
+
var external_fs_ = __webpack_require__("fs");
|
|
13039
13040
|
var valid = __webpack_require__("../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/valid.js");
|
|
13040
13041
|
var valid_default = /*#__PURE__*/ __webpack_require__.n(valid);
|
|
13041
13042
|
let isDockerCached;
|
|
@@ -13560,7 +13561,13 @@ const getPlatform = async (message)=>{
|
|
|
13560
13561
|
async function getBundleZipTargets(basePath, files) {
|
|
13561
13562
|
const bundleCandidates = {};
|
|
13562
13563
|
const targets = [];
|
|
13563
|
-
const getRelative = (file)=>
|
|
13564
|
+
const getRelative = (file)=>{
|
|
13565
|
+
if (file.startsWith(basePath)) {
|
|
13566
|
+
const sliceIndex = basePath.endsWith("/") ? basePath.length : basePath.length + 1;
|
|
13567
|
+
return file.slice(sliceIndex);
|
|
13568
|
+
}
|
|
13569
|
+
return file;
|
|
13570
|
+
};
|
|
13564
13571
|
for (const file of files){
|
|
13565
13572
|
if (file.endsWith(".map")) continue;
|
|
13566
13573
|
const relative = getRelative(file);
|
|
@@ -13789,8 +13796,10 @@ const deploy = async (options)=>{
|
|
|
13789
13796
|
bundlePath = external_path_["default"].join((0, __WEBPACK_EXTERNAL_MODULE__hot_updater_plugin_core_40c1c502__.getCwd)(), "bundle.zip");
|
|
13790
13797
|
const buildPath = taskRef.buildResult?.buildPath;
|
|
13791
13798
|
if (!buildPath) throw new Error("Build result not found");
|
|
13792
|
-
const files = await
|
|
13793
|
-
|
|
13799
|
+
const files = await external_fs_["default"].promises.readdir(buildPath, {
|
|
13800
|
+
recursive: true
|
|
13801
|
+
});
|
|
13802
|
+
const targetFiles = await getBundleZipTargets(buildPath, files.filter((file)=>!external_fs_["default"].statSync(external_path_["default"].join(buildPath, file)).isDirectory()).map((file)=>external_path_["default"].join(buildPath, file)));
|
|
13794
13803
|
await (0, __WEBPACK_EXTERNAL_MODULE__hot_updater_plugin_core_40c1c502__.createZipTargetFiles)({
|
|
13795
13804
|
outfile: bundlePath,
|
|
13796
13805
|
targetFiles: targetFiles
|
|
@@ -13838,7 +13847,7 @@ const deploy = async (options)=>{
|
|
|
13838
13847
|
throw new Error("Failed to update database");
|
|
13839
13848
|
}
|
|
13840
13849
|
await databasePlugin.onUnmount?.();
|
|
13841
|
-
await
|
|
13850
|
+
await external_fs_["default"].promises.rm(bundlePath);
|
|
13842
13851
|
return `✅ Update Complete (${databasePlugin.name})`;
|
|
13843
13852
|
}
|
|
13844
13853
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hot-updater",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.13.
|
|
4
|
+
"version": "0.13.5",
|
|
5
5
|
"bin": {
|
|
6
6
|
"hot-updater": "./dist/index.js"
|
|
7
7
|
},
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@clack/prompts": "^0.10.0",
|
|
52
|
-
"@hot-updater/console": "0.13.
|
|
53
|
-
"@hot-updater/core": "0.13.
|
|
54
|
-
"@hot-updater/plugin-core": "0.13.
|
|
52
|
+
"@hot-updater/console": "0.13.5",
|
|
53
|
+
"@hot-updater/core": "0.13.5",
|
|
54
|
+
"@hot-updater/plugin-core": "0.13.5",
|
|
55
55
|
"commander": "^11.1.0",
|
|
56
56
|
"cosmiconfig": "^9.0.0",
|
|
57
57
|
"cosmiconfig-typescript-loader": "^5.0.0",
|