hot-updater 0.20.14 → 0.21.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/config.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./picocolors-BnzanxXs.js";
2
- import { createAndInjectFingerprintFiles, createFingerprintJSON, generateFingerprint, generateFingerprints, readLocalFingerprint } from "./fingerprint-DA-PV8fp.js";
1
+ import "./picocolors-O3YZQBCJ.js";
2
+ import { i as generateFingerprints, n as createFingerprintJSON, o as readLocalFingerprint, r as generateFingerprint, t as createAndInjectFingerprintFiles } from "./fingerprint-CUyLNgcg.js";
3
3
 
4
4
  //#region src/config.ts
5
5
  const defineConfig = (config) => {
@@ -1,4 +1,4 @@
1
- import { __commonJS, __require, __toESM, require_picocolors } from "./picocolors-BnzanxXs.js";
1
+ import { i as __toESM, n as __commonJS, r as __require, t as require_picocolors } from "./picocolors-O3YZQBCJ.js";
2
2
  import * as p from "@clack/prompts";
3
3
  import { getCwd, loadConfig } from "@hot-updater/plugin-core";
4
4
  import path from "path";
@@ -14898,4 +14898,4 @@ const readLocalFingerprint = async () => {
14898
14898
  };
14899
14899
 
14900
14900
  //#endregion
14901
- export { AndroidConfigParser, IosConfigParser, createAndInjectFingerprintFiles, createFingerprintJSON, generateFingerprint, generateFingerprints, getFingerprintDiff, isFingerprintEquals, nativeFingerprint, readLocalFingerprint, require_base64_js, require_out, require_plist, showFingerprintDiff };
14901
+ export { nativeFingerprint as a, showFingerprintDiff as c, IosConfigParser as d, require_plist as f, generateFingerprints as i, isFingerprintEquals as l, AndroidConfigParser as m, createFingerprintJSON as n, readLocalFingerprint as o, require_base64_js as p, generateFingerprint as r, getFingerprintDiff as s, createAndInjectFingerprintFiles as t, require_out as u };
package/dist/index.cjs CHANGED
@@ -34172,7 +34172,7 @@ const nativeBuild = async (options) => {
34172
34172
  };
34173
34173
 
34174
34174
  //#endregion
34175
- //#region ../../node_modules/.pnpm/@hono+node-server@1.13.4_hono@4.6.3/node_modules/@hono/node-server/dist/index.mjs
34175
+ //#region ../../node_modules/.pnpm/@hono+node-server@1.13.4_hono@4.10.3/node_modules/@hono/node-server/dist/index.mjs
34176
34176
  var RequestError = class extends Error {
34177
34177
  static name = "RequestError";
34178
34178
  constructor(message, options) {
@@ -35060,6 +35060,14 @@ const getDefaultTargetAppVersion = async (platform$2) => {
35060
35060
  //#region src/commands/deploy.ts
35061
35061
  var import_picocolors$3 = /* @__PURE__ */ require_picocolors$1.__toESM(require_picocolors$1.require_picocolors(), 1);
35062
35062
  var import_valid$1 = /* @__PURE__ */ require_picocolors$1.__toESM(require_valid$1(), 1);
35063
+ const getExtensionFromCompressStrategy = (compressStrategy) => {
35064
+ switch (compressStrategy) {
35065
+ case "tar.br": return ".tar.br";
35066
+ case "tar.gz": return ".tar.gz";
35067
+ case "zip": return ".zip";
35068
+ default: throw new Error(`Unsupported compress strategy: ${compressStrategy}`);
35069
+ }
35070
+ };
35063
35071
  const deploy = async (options) => {
35064
35072
  printBanner();
35065
35073
  const cwd = (0, __hot_updater_plugin_core.getCwd)();
@@ -35139,7 +35147,9 @@ const deploy = async (options) => {
35139
35147
  let bundleId = null;
35140
35148
  let fileHash;
35141
35149
  const normalizeOutputPath = path.default.isAbsolute(outputPath) ? outputPath : path.default.join(cwd, outputPath);
35142
- const bundlePath = path.default.join(normalizeOutputPath, "bundle", "bundle.zip");
35150
+ const compressStrategy = config.compressStrategy;
35151
+ const bundleExtension = getExtensionFromCompressStrategy(compressStrategy);
35152
+ const bundlePath = path.default.join(normalizeOutputPath, "bundle", `bundle${bundleExtension}`);
35143
35153
  const [buildPlugin, storagePlugin, databasePlugin] = await Promise.all([
35144
35154
  config.build({ cwd }),
35145
35155
  config.storage({ cwd }),
@@ -35157,10 +35167,28 @@ const deploy = async (options) => {
35157
35167
  await fs.default.promises.mkdir(normalizeOutputPath, { recursive: true });
35158
35168
  const buildPath = taskRef.buildResult?.buildPath;
35159
35169
  if (!buildPath) throw new Error("Build result not found");
35160
- await (0, __hot_updater_plugin_core.createZipTargetFiles)({
35161
- outfile: bundlePath,
35162
- targetFiles: await getBundleZipTargets(buildPath, (await fs.default.promises.readdir(buildPath, { recursive: true })).filter((file) => !fs.default.statSync(path.default.join(buildPath, file)).isDirectory()).map((file) => path.default.join(buildPath, file)))
35163
- });
35170
+ const targetFiles = await getBundleZipTargets(buildPath, (await fs.default.promises.readdir(buildPath, { recursive: true })).filter((file) => !fs.default.statSync(path.default.join(buildPath, file)).isDirectory()).map((file) => path.default.join(buildPath, file)));
35171
+ switch (compressStrategy) {
35172
+ case "tar.br":
35173
+ await (0, __hot_updater_plugin_core.createTarBrTargetFiles)({
35174
+ outfile: bundlePath,
35175
+ targetFiles
35176
+ });
35177
+ break;
35178
+ case "tar.gz":
35179
+ await (0, __hot_updater_plugin_core.createTarGzTargetFiles)({
35180
+ outfile: bundlePath,
35181
+ targetFiles
35182
+ });
35183
+ break;
35184
+ case "zip":
35185
+ await (0, __hot_updater_plugin_core.createZipTargetFiles)({
35186
+ outfile: bundlePath,
35187
+ targetFiles
35188
+ });
35189
+ break;
35190
+ default: throw new Error(`Unsupported compression strategy: ${compressStrategy}`);
35191
+ }
35164
35192
  bundleId = taskRef.buildResult.bundleId;
35165
35193
  fileHash = await getFileHashFromFile(bundlePath);
35166
35194
  __clack_prompts.log.success(`Bundle stored at ${import_picocolors$3.default.blueBright(path.default.relative(cwd, bundlePath))}`);
@@ -35173,7 +35201,7 @@ const deploy = async (options) => {
35173
35201
  task: async () => {
35174
35202
  if (!bundleId) throw new Error("Bundle ID not found");
35175
35203
  try {
35176
- const { storageUri } = await storagePlugin.uploadBundle(bundleId, bundlePath);
35204
+ const { storageUri } = await storagePlugin.upload(bundleId, bundlePath);
35177
35205
  taskRef.storageUri = storageUri;
35178
35206
  } catch (e) {
35179
35207
  if (e instanceof Error) __clack_prompts.log.error(e.message);
package/dist/index.d.cts CHANGED
@@ -1,2 +1 @@
1
- #!/usr/bin/env node
2
- export {};
1
+ export { };
package/dist/index.d.ts CHANGED
@@ -1,2 +1 @@
1
- #!/usr/bin/env node
2
- export {};
1
+ export { };
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import { __commonJS, __require, __toESM, require_picocolors } from "./picocolors-BnzanxXs.js";
3
- import { AndroidConfigParser, IosConfigParser, createAndInjectFingerprintFiles, generateFingerprints, getFingerprintDiff, isFingerprintEquals, nativeFingerprint, readLocalFingerprint, require_base64_js, require_out, require_plist, showFingerprintDiff } from "./fingerprint-DA-PV8fp.js";
2
+ import { i as __toESM, n as __commonJS, r as __require, t as require_picocolors } from "./picocolors-O3YZQBCJ.js";
3
+ import { a as nativeFingerprint, c as showFingerprintDiff, d as IosConfigParser, f as require_plist, i as generateFingerprints, l as isFingerprintEquals, m as AndroidConfigParser, o as readLocalFingerprint, p as require_base64_js, s as getFingerprintDiff, t as createAndInjectFingerprintFiles, u as require_out } from "./fingerprint-CUyLNgcg.js";
4
4
  import * as p from "@clack/prompts";
5
5
  import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:events";
6
6
  import childProcess, { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
7
7
  import path from "node:path";
8
8
  import fs, { appendFileSync, createReadStream, createWriteStream, readFileSync, statSync, writeFileSync } from "node:fs";
9
9
  import process$1, { execArgv, execPath, hrtime, platform } from "node:process";
10
- import { banner, createZipTargetFiles, generateMinBundleId, getCwd, loadConfig, log, printBanner } from "@hot-updater/plugin-core";
10
+ import { banner, createTarBrTargetFiles, createTarGzTargetFiles, createZipTargetFiles, generateMinBundleId, getCwd, loadConfig, log, printBanner } from "@hot-updater/plugin-core";
11
11
  import { fileURLToPath } from "node:url";
12
12
  import { StringDecoder } from "node:string_decoder";
13
13
  import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
@@ -10308,7 +10308,7 @@ const getDefaultOutputPath = () => {
10308
10308
  };
10309
10309
 
10310
10310
  //#endregion
10311
- //#region ../../node_modules/.pnpm/tsdown@0.14.2_typescript@5.8.3/node_modules/tsdown/esm-shims.js
10311
+ //#region ../../node_modules/.pnpm/tsdown@0.15.10_typescript@5.8.3/node_modules/tsdown/esm-shims.js
10312
10312
  const getFilename = () => fileURLToPath(import.meta.url);
10313
10313
  const getDirname = () => path.dirname(getFilename());
10314
10314
  const __dirname$1 = /* @__PURE__ */ getDirname();
@@ -34150,7 +34150,7 @@ const nativeBuild = async (options) => {
34150
34150
  };
34151
34151
 
34152
34152
  //#endregion
34153
- //#region ../../node_modules/.pnpm/@hono+node-server@1.13.4_hono@4.6.3/node_modules/@hono/node-server/dist/index.mjs
34153
+ //#region ../../node_modules/.pnpm/@hono+node-server@1.13.4_hono@4.10.3/node_modules/@hono/node-server/dist/index.mjs
34154
34154
  var RequestError = class extends Error {
34155
34155
  static name = "RequestError";
34156
34156
  constructor(message, options) {
@@ -35038,6 +35038,14 @@ const getDefaultTargetAppVersion = async (platform$2) => {
35038
35038
  //#region src/commands/deploy.ts
35039
35039
  var import_picocolors$3 = /* @__PURE__ */ __toESM(require_picocolors(), 1);
35040
35040
  var import_valid$1 = /* @__PURE__ */ __toESM(require_valid$1(), 1);
35041
+ const getExtensionFromCompressStrategy = (compressStrategy) => {
35042
+ switch (compressStrategy) {
35043
+ case "tar.br": return ".tar.br";
35044
+ case "tar.gz": return ".tar.gz";
35045
+ case "zip": return ".zip";
35046
+ default: throw new Error(`Unsupported compress strategy: ${compressStrategy}`);
35047
+ }
35048
+ };
35041
35049
  const deploy = async (options) => {
35042
35050
  printBanner$1();
35043
35051
  const cwd = getCwd();
@@ -35117,7 +35125,9 @@ const deploy = async (options) => {
35117
35125
  let bundleId = null;
35118
35126
  let fileHash;
35119
35127
  const normalizeOutputPath = path$1.isAbsolute(outputPath) ? outputPath : path$1.join(cwd, outputPath);
35120
- const bundlePath = path$1.join(normalizeOutputPath, "bundle", "bundle.zip");
35128
+ const compressStrategy = config.compressStrategy;
35129
+ const bundleExtension = getExtensionFromCompressStrategy(compressStrategy);
35130
+ const bundlePath = path$1.join(normalizeOutputPath, "bundle", `bundle${bundleExtension}`);
35121
35131
  const [buildPlugin, storagePlugin, databasePlugin] = await Promise.all([
35122
35132
  config.build({ cwd }),
35123
35133
  config.storage({ cwd }),
@@ -35135,10 +35145,28 @@ const deploy = async (options) => {
35135
35145
  await fs$1.promises.mkdir(normalizeOutputPath, { recursive: true });
35136
35146
  const buildPath = taskRef.buildResult?.buildPath;
35137
35147
  if (!buildPath) throw new Error("Build result not found");
35138
- await createZipTargetFiles({
35139
- outfile: bundlePath,
35140
- targetFiles: await getBundleZipTargets(buildPath, (await fs$1.promises.readdir(buildPath, { recursive: true })).filter((file) => !fs$1.statSync(path$1.join(buildPath, file)).isDirectory()).map((file) => path$1.join(buildPath, file)))
35141
- });
35148
+ const targetFiles = await getBundleZipTargets(buildPath, (await fs$1.promises.readdir(buildPath, { recursive: true })).filter((file) => !fs$1.statSync(path$1.join(buildPath, file)).isDirectory()).map((file) => path$1.join(buildPath, file)));
35149
+ switch (compressStrategy) {
35150
+ case "tar.br":
35151
+ await createTarBrTargetFiles({
35152
+ outfile: bundlePath,
35153
+ targetFiles
35154
+ });
35155
+ break;
35156
+ case "tar.gz":
35157
+ await createTarGzTargetFiles({
35158
+ outfile: bundlePath,
35159
+ targetFiles
35160
+ });
35161
+ break;
35162
+ case "zip":
35163
+ await createZipTargetFiles({
35164
+ outfile: bundlePath,
35165
+ targetFiles
35166
+ });
35167
+ break;
35168
+ default: throw new Error(`Unsupported compression strategy: ${compressStrategy}`);
35169
+ }
35142
35170
  bundleId = taskRef.buildResult.bundleId;
35143
35171
  fileHash = await getFileHashFromFile(bundlePath);
35144
35172
  p.log.success(`Bundle stored at ${import_picocolors$3.default.blueBright(path$1.relative(cwd, bundlePath))}`);
@@ -35151,7 +35179,7 @@ const deploy = async (options) => {
35151
35179
  task: async () => {
35152
35180
  if (!bundleId) throw new Error("Bundle ID not found");
35153
35181
  try {
35154
- const { storageUri } = await storagePlugin.uploadBundle(bundleId, bundlePath);
35182
+ const { storageUri } = await storagePlugin.upload(bundleId, bundlePath);
35155
35183
  taskRef.storageUri = storageUri;
35156
35184
  } catch (e) {
35157
35185
  if (e instanceof Error) p.log.error(e.message);
@@ -96,4 +96,4 @@ var require_picocolors = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
96
96
  }) });
97
97
 
98
98
  //#endregion
99
- export { __commonJS, __require, __toESM, require_picocolors };
99
+ export { __toESM as i, __commonJS as n, __require as r, require_picocolors as t };
@@ -1,4 +1,4 @@
1
- import { __toESM, require_picocolors } from "../picocolors-BnzanxXs.js";
1
+ import { i as __toESM, t as require_picocolors } from "../picocolors-O3YZQBCJ.js";
2
2
  import path from "path";
3
3
  import fs from "fs";
4
4
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hot-updater",
3
3
  "type": "module",
4
- "version": "0.20.14",
4
+ "version": "0.21.0",
5
5
  "bin": {
6
6
  "hot-updater": "./dist/index.js"
7
7
  },
@@ -53,11 +53,12 @@
53
53
  "cosmiconfig": "9.0.0",
54
54
  "cosmiconfig-typescript-loader": "5.0.0",
55
55
  "es-git": "0.4.0",
56
- "@hot-updater/console": "0.20.14",
57
- "@hot-updater/core": "0.20.14",
58
- "@hot-updater/plugin-core": "0.20.14"
56
+ "@hot-updater/console": "0.21.0",
57
+ "@hot-updater/core": "0.21.0",
58
+ "@hot-updater/plugin-core": "0.21.0"
59
59
  },
60
60
  "devDependencies": {
61
+ "semver": "^7.6.3",
61
62
  "fast-xml-parser": "^5.2.3",
62
63
  "fast-glob": "3.3.3",
63
64
  "@bacons/xcode": "1.0.0-alpha.24",
@@ -84,12 +85,12 @@
84
85
  "picocolors": "1.1.1",
85
86
  "plist": "^3.1.0",
86
87
  "read-package-up": "^11.0.0",
87
- "semver": "^7.6.3",
88
88
  "uuidv7": "^1.0.2",
89
- "@hot-updater/aws": "0.20.14",
90
- "@hot-updater/cloudflare": "0.20.14",
91
- "@hot-updater/firebase": "0.20.14",
92
- "@hot-updater/supabase": "0.20.14"
89
+ "@hot-updater/aws": "0.21.0",
90
+ "@hot-updater/cloudflare": "0.21.0",
91
+ "@hot-updater/firebase": "0.21.0",
92
+ "@hot-updater/supabase": "0.21.0",
93
+ "@hot-updater/test-utils": "0.21.0"
93
94
  },
94
95
  "peerDependencies": {
95
96
  "@hot-updater/aws": "*",