hot-updater 0.29.1 → 0.29.3

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.
Files changed (3) hide show
  1. package/dist/index.cjs +14 -16
  2. package/dist/index.mjs +10 -12
  3. package/package.json +14 -14
package/dist/index.cjs CHANGED
@@ -29,7 +29,6 @@ let node_v8 = require("node:v8");
29
29
  let node_stream_promises = require("node:stream/promises");
30
30
  let node_stream = require("node:stream");
31
31
  let node_buffer = require("node:buffer");
32
- let _hot_updater_core = require("@hot-updater/core");
33
32
  let util = require("util");
34
33
  let fs_promises = require("fs/promises");
35
34
  fs_promises = require_keyGeneration.__toESM(fs_promises);
@@ -29093,7 +29092,7 @@ async function prepareNativeBuild(options) {
29093
29092
  return null;
29094
29093
  }
29095
29094
  }
29096
- const artifactResultStorePath = options.outputPath ?? path.default.join(_hot_updater_core.HotUpdateDirUtil.getDefaultOutputPath({ cwd }), "build", platform, scheme);
29095
+ const artifactResultStorePath = options.outputPath ?? path.default.join(_hot_updater_cli_tools.HotUpdateDirUtil.getDefaultOutputPath({ cwd }), "build", platform, scheme);
29097
29096
  const resolvedOutputPath = path.default.isAbsolute(artifactResultStorePath) ? artifactResultStorePath : path.default.join(cwd, artifactResultStorePath);
29098
29097
  if (platform === "ios") {
29099
29098
  await setIosMinBundleIdSlotIntoInfoPlist({ infoPlistPaths: config.platform?.ios.infoPlistPaths });
@@ -35216,8 +35215,6 @@ const deploy = async (options) => {
35216
35215
  appVersion: null,
35217
35216
  fingerprintHash: null
35218
35217
  };
35219
- _hot_updater_cli_tools.p.log.step(`Channel: ${channel}`);
35220
- _hot_updater_cli_tools.p.log.step(`Rollout: ${rolloutPercentage}%`);
35221
35218
  if (config.updateStrategy === "fingerprint") {
35222
35219
  const s = _hot_updater_cli_tools.p.spinner();
35223
35220
  s.start(`Fingerprinting (${platform})`);
@@ -35259,7 +35256,6 @@ const deploy = async (options) => {
35259
35256
  _hot_updater_cli_tools.p.log.error("Target app version not found. -t <targetAppVersion> semver format (e.g. 1.0.0, 1.x.x)");
35260
35257
  return;
35261
35258
  }
35262
- _hot_updater_cli_tools.p.log.info(`Target app version: ${(0, import_valid.default)(targetAppVersion)}`);
35263
35259
  target.appVersion = targetAppVersion;
35264
35260
  }
35265
35261
  if (!target.fingerprintHash && !target.appVersion) {
@@ -35267,8 +35263,14 @@ const deploy = async (options) => {
35267
35263
  else _hot_updater_cli_tools.p.log.error("Target app version not found. -t <targetAppVersion> semver format (e.g. 1.0.0, 1.x.x)");
35268
35264
  process.exit(1);
35269
35265
  }
35270
- if (appendToProjectRootGitignore({ globLines: [_hot_updater_core.HotUpdateDirUtil.outputGitignorePath] })) _hot_updater_cli_tools.p.log.info(".gitignore has been modified");
35271
- const outputPath = options.bundleOutputPath ?? _hot_updater_core.HotUpdateDirUtil.getDefaultOutputPath({ cwd });
35266
+ const deploymentContext = [
35267
+ `Channel: ${channel}`,
35268
+ `Rollout: ${rolloutPercentage}%`,
35269
+ config.updateStrategy === "fingerprint" ? `Fingerprint: ${target.fingerprintHash}` : `Target app version: ${(0, import_valid.default)(target.appVersion)}`
35270
+ ].join("\n");
35271
+ _hot_updater_cli_tools.p.note(deploymentContext, "Deployment");
35272
+ if (appendToProjectRootGitignore({ globLines: [_hot_updater_cli_tools.HotUpdateDirUtil.outputGitignorePath] })) _hot_updater_cli_tools.p.log.info(".gitignore has been modified");
35273
+ const outputPath = options.bundleOutputPath ?? _hot_updater_cli_tools.HotUpdateDirUtil.getDefaultOutputPath({ cwd });
35272
35274
  let bundleId = null;
35273
35275
  let fileHash;
35274
35276
  const normalizeOutputPath = path.default.isAbsolute(outputPath) ? outputPath : path.default.join(cwd, outputPath);
@@ -35328,23 +35330,19 @@ const deploy = async (options) => {
35328
35330
  fileHash = await getFileHashFromFile(bundlePath);
35329
35331
  if (config.signing?.enabled) {
35330
35332
  if (!config.signing.privateKeyPath) throw new Error("privateKeyPath is required when signing is enabled. Please provide a valid path to your RSA private key in hot-updater.config.ts");
35331
- const s = _hot_updater_cli_tools.p.spinner();
35332
- s.start("Signing bundle");
35333
35333
  try {
35334
35334
  fileHash = createSignedFileHash(await signBundle(fileHash, config.signing.privateKeyPath));
35335
- s.stop("Bundle signed successfully");
35336
35335
  } catch (error) {
35337
- s.error("Failed to sign bundle");
35338
35336
  _hot_updater_cli_tools.p.log.error(`Signing error: ${error.message}`);
35339
35337
  _hot_updater_cli_tools.p.log.error("Ensure private key path is correct and file has proper permissions");
35340
35338
  throw error;
35341
35339
  }
35342
35340
  }
35343
- _hot_updater_cli_tools.p.log.success(`Bundle stored at ${_hot_updater_cli_tools.colors.blueBright(path.default.relative(cwd, bundlePath))}`);
35344
35341
  return `✅ Build Complete (${buildPlugin.name})`;
35345
35342
  }
35346
35343
  }]);
35347
- if (taskRef.buildResult?.stdout) _hot_updater_cli_tools.p.log.success(taskRef.buildResult.stdout);
35344
+ if (taskRef.buildResult?.stdout) _hot_updater_cli_tools.p.note(taskRef.buildResult.stdout.trim(), "Build Output");
35345
+ if (config.signing?.enabled) _hot_updater_cli_tools.p.log.success("✅ Bundle Signing Complete");
35348
35346
  await _hot_updater_cli_tools.p.tasks([{
35349
35347
  title: `📦 Uploading to Storage (${storagePlugin.name})`,
35350
35348
  task: async () => {
@@ -35410,7 +35408,7 @@ const deploy = async (options) => {
35410
35408
  } else open(url);
35411
35409
  _hot_updater_cli_tools.p.note(note);
35412
35410
  }
35413
- _hot_updater_cli_tools.p.outro("🚀 Deployment Successful");
35411
+ _hot_updater_cli_tools.p.outro(`🚀 Deployment Successful (${bundleId})`);
35414
35412
  } catch (e) {
35415
35413
  await databasePlugin.onUnmount?.();
35416
35414
  await fs.default.promises.rm(bundlePath, { force: true });
@@ -35549,8 +35547,8 @@ const init = async () => {
35549
35547
  }
35550
35548
  if (appendToProjectRootGitignore({ globLines: [
35551
35549
  ".env.hotupdater",
35552
- _hot_updater_core.HotUpdateDirUtil.outputGitignorePath,
35553
- _hot_updater_core.HotUpdateDirUtil.logGitignorePath
35550
+ _hot_updater_cli_tools.HotUpdateDirUtil.outputGitignorePath,
35551
+ _hot_updater_cli_tools.HotUpdateDirUtil.logGitignorePath
35554
35552
  ] })) _hot_updater_cli_tools.p.log.info(".gitignore has been modified to include hot-updater entries");
35555
35553
  };
35556
35554
  //#endregion
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import childProcess, { ChildProcess, execFile, spawn, spawnSync } from "node:chi
6
6
  import path from "node:path";
7
7
  import fs, { appendFileSync, createReadStream, createWriteStream, readFileSync, statSync, writeFileSync } from "node:fs";
8
8
  import process$1, { execArgv, execPath, hrtime, platform } from "node:process";
9
- import { banner, colors, createTarBrTargetFiles, createTarGzTargetFiles, createZipTargetFiles, ensureInstallPackages, getCwd, getPackageManager, loadConfig, log, p, printBanner } from "@hot-updater/cli-tools";
9
+ import { HotUpdateDirUtil, banner, colors, createTarBrTargetFiles, createTarGzTargetFiles, createZipTargetFiles, ensureInstallPackages, getCwd, getPackageManager, loadConfig, log, p, printBanner } from "@hot-updater/cli-tools";
10
10
  import { buildAndroid, enrichNativeBuildAndroidScheme, runAndroid } from "@hot-updater/android-helper";
11
11
  import { buildIos, enrichNativeBuildIosScheme, runIos } from "@hot-updater/apple-helper";
12
12
  import { fileURLToPath } from "node:url";
@@ -22,7 +22,6 @@ import { serialize } from "node:v8";
22
22
  import { finished } from "node:stream/promises";
23
23
  import { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWaterMark } from "node:stream";
24
24
  import { Buffer as Buffer$1 } from "node:buffer";
25
- import { HotUpdateDirUtil } from "@hot-updater/core";
26
25
  import { promisify as promisify$1 } from "util";
27
26
  import fs$2, { access, mkdir, readFile, readdir, writeFile } from "fs/promises";
28
27
  import crypto, { createHash } from "crypto";
@@ -35199,8 +35198,6 @@ const deploy = async (options) => {
35199
35198
  appVersion: null,
35200
35199
  fingerprintHash: null
35201
35200
  };
35202
- p.log.step(`Channel: ${channel}`);
35203
- p.log.step(`Rollout: ${rolloutPercentage}%`);
35204
35201
  if (config.updateStrategy === "fingerprint") {
35205
35202
  const s = p.spinner();
35206
35203
  s.start(`Fingerprinting (${platform})`);
@@ -35242,7 +35239,6 @@ const deploy = async (options) => {
35242
35239
  p.log.error("Target app version not found. -t <targetAppVersion> semver format (e.g. 1.0.0, 1.x.x)");
35243
35240
  return;
35244
35241
  }
35245
- p.log.info(`Target app version: ${(0, import_valid.default)(targetAppVersion)}`);
35246
35242
  target.appVersion = targetAppVersion;
35247
35243
  }
35248
35244
  if (!target.fingerprintHash && !target.appVersion) {
@@ -35250,6 +35246,12 @@ const deploy = async (options) => {
35250
35246
  else p.log.error("Target app version not found. -t <targetAppVersion> semver format (e.g. 1.0.0, 1.x.x)");
35251
35247
  process.exit(1);
35252
35248
  }
35249
+ const deploymentContext = [
35250
+ `Channel: ${channel}`,
35251
+ `Rollout: ${rolloutPercentage}%`,
35252
+ config.updateStrategy === "fingerprint" ? `Fingerprint: ${target.fingerprintHash}` : `Target app version: ${(0, import_valid.default)(target.appVersion)}`
35253
+ ].join("\n");
35254
+ p.note(deploymentContext, "Deployment");
35253
35255
  if (appendToProjectRootGitignore({ globLines: [HotUpdateDirUtil.outputGitignorePath] })) p.log.info(".gitignore has been modified");
35254
35256
  const outputPath = options.bundleOutputPath ?? HotUpdateDirUtil.getDefaultOutputPath({ cwd });
35255
35257
  let bundleId = null;
@@ -35311,23 +35313,19 @@ const deploy = async (options) => {
35311
35313
  fileHash = await getFileHashFromFile(bundlePath);
35312
35314
  if (config.signing?.enabled) {
35313
35315
  if (!config.signing.privateKeyPath) throw new Error("privateKeyPath is required when signing is enabled. Please provide a valid path to your RSA private key in hot-updater.config.ts");
35314
- const s = p.spinner();
35315
- s.start("Signing bundle");
35316
35316
  try {
35317
35317
  fileHash = createSignedFileHash(await signBundle(fileHash, config.signing.privateKeyPath));
35318
- s.stop("Bundle signed successfully");
35319
35318
  } catch (error) {
35320
- s.error("Failed to sign bundle");
35321
35319
  p.log.error(`Signing error: ${error.message}`);
35322
35320
  p.log.error("Ensure private key path is correct and file has proper permissions");
35323
35321
  throw error;
35324
35322
  }
35325
35323
  }
35326
- p.log.success(`Bundle stored at ${colors.blueBright(path$1.relative(cwd, bundlePath))}`);
35327
35324
  return `✅ Build Complete (${buildPlugin.name})`;
35328
35325
  }
35329
35326
  }]);
35330
- if (taskRef.buildResult?.stdout) p.log.success(taskRef.buildResult.stdout);
35327
+ if (taskRef.buildResult?.stdout) p.note(taskRef.buildResult.stdout.trim(), "Build Output");
35328
+ if (config.signing?.enabled) p.log.success("✅ Bundle Signing Complete");
35331
35329
  await p.tasks([{
35332
35330
  title: `📦 Uploading to Storage (${storagePlugin.name})`,
35333
35331
  task: async () => {
@@ -35393,7 +35391,7 @@ const deploy = async (options) => {
35393
35391
  } else open(url);
35394
35392
  p.note(note);
35395
35393
  }
35396
- p.outro("🚀 Deployment Successful");
35394
+ p.outro(`🚀 Deployment Successful (${bundleId})`);
35397
35395
  } catch (e) {
35398
35396
  await databasePlugin.onUnmount?.();
35399
35397
  await fs$1.promises.rm(bundlePath, { force: true });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hot-updater",
3
3
  "type": "module",
4
- "version": "0.29.1",
4
+ "version": "0.29.3",
5
5
  "bin": {
6
6
  "hot-updater": "./dist/index.cjs"
7
7
  },
@@ -47,13 +47,13 @@
47
47
  "jiti": "2.6.1",
48
48
  "kysely": "0.28.9",
49
49
  "sql-formatter": "15.6.10",
50
- "@hot-updater/android-helper": "0.29.1",
51
- "@hot-updater/cli-tools": "0.29.1",
52
- "@hot-updater/core": "0.29.1",
53
- "@hot-updater/apple-helper": "0.29.1",
54
- "@hot-updater/console": "0.29.1",
55
- "@hot-updater/server": "0.29.1",
56
- "@hot-updater/plugin-core": "0.29.1"
50
+ "@hot-updater/android-helper": "0.29.3",
51
+ "@hot-updater/apple-helper": "0.29.3",
52
+ "@hot-updater/console": "0.29.3",
53
+ "@hot-updater/core": "0.29.3",
54
+ "@hot-updater/plugin-core": "0.29.3",
55
+ "@hot-updater/server": "0.29.3",
56
+ "@hot-updater/cli-tools": "0.29.3"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@bacons/xcode": "1.0.0-alpha.24",
@@ -72,12 +72,12 @@
72
72
  "plist": "^3.1.0",
73
73
  "read-package-up": "^11.0.0",
74
74
  "semver": "^7.6.3",
75
- "@hot-updater/aws": "0.29.1",
76
- "@hot-updater/cloudflare": "0.29.1",
77
- "@hot-updater/firebase": "0.29.1",
78
- "@hot-updater/server": "0.29.1",
79
- "@hot-updater/supabase": "0.29.1",
80
- "@hot-updater/test-utils": "0.29.1"
75
+ "@hot-updater/aws": "0.29.3",
76
+ "@hot-updater/cloudflare": "0.29.3",
77
+ "@hot-updater/firebase": "0.29.3",
78
+ "@hot-updater/server": "0.29.3",
79
+ "@hot-updater/supabase": "0.29.3",
80
+ "@hot-updater/test-utils": "0.29.3"
81
81
  },
82
82
  "peerDependencies": {
83
83
  "@hot-updater/aws": "*",