@hot-updater/firebase 0.29.3 → 0.29.4

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.
@@ -22,6 +22,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  enumerable: true
23
23
  }) : target, mod));
24
24
  //#endregion
25
+ let fs = require("fs");
26
+ fs = __toESM(fs);
27
+ let path = require("path");
28
+ path = __toESM(path);
25
29
  let _hot_updater_cli_tools = require("@hot-updater/cli-tools");
26
30
  let node_url = require("node:url");
27
31
  let node_child_process = require("node:child_process");
@@ -33,10 +37,6 @@ let node_tty = require("node:tty");
33
37
  node_tty = __toESM(node_tty);
34
38
  let node_path = require("node:path");
35
39
  node_path = __toESM(node_path);
36
- let path = require("path");
37
- path = __toESM(path);
38
- let fs = require("fs");
39
- fs = __toESM(fs);
40
40
  let node_timers_promises = require("node:timers/promises");
41
41
  let node_os = require("node:os");
42
42
  let node_events = require("node:events");
@@ -6780,7 +6780,7 @@ const syncFunctionsPackageJson = async (functionsDir) => {
6780
6780
  const packageJsonPath = path.default.join(functionsDir, "package.json");
6781
6781
  const packageJson = JSON.parse(await fs.default.promises.readFile(packageJsonPath, "utf-8"));
6782
6782
  packageJson.dependencies = {
6783
- ...packageJson.dependencies ?? {},
6783
+ ...packageJson.dependencies,
6784
6784
  "@hot-updater/server": runtimePackageInfo.serverPackageVersion,
6785
6785
  hono: runtimePackageInfo.honoVersion
6786
6786
  };
@@ -1,4 +1,6 @@
1
1
  import { createRequire } from "node:module";
2
+ import fs from "fs";
3
+ import path from "path";
2
4
  import { ConfigBuilder, HOT_UPDATER_SERVER_PACKAGE_VERSION_ENV, copyDirToTmp, link, makeEnv, p, resolveHotUpdaterServerVersion, resolvePackageVersion, transformEnv, transformTemplate } from "@hot-updater/cli-tools";
3
5
  import { fileURLToPath } from "node:url";
4
6
  import { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
@@ -6,9 +8,7 @@ import { StringDecoder } from "node:string_decoder";
6
8
  import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
7
9
  import process$1, { execArgv, execPath, hrtime, platform } from "node:process";
8
10
  import tty from "node:tty";
9
- import path from "node:path";
10
- import path$1 from "path";
11
- import fs from "fs";
11
+ import path$1 from "node:path";
12
12
  import { scheduler, setImmediate, setTimeout } from "node:timers/promises";
13
13
  import { constants } from "node:os";
14
14
  import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:events";
@@ -1431,33 +1431,33 @@ function toPath(urlOrPath) {
1431
1431
  }
1432
1432
  function traversePathUp(startPath) {
1433
1433
  return { *[Symbol.iterator]() {
1434
- let currentPath = path.resolve(toPath(startPath));
1434
+ let currentPath = path$1.resolve(toPath(startPath));
1435
1435
  let previousPath;
1436
1436
  while (previousPath !== currentPath) {
1437
1437
  yield currentPath;
1438
1438
  previousPath = currentPath;
1439
- currentPath = path.resolve(currentPath, "..");
1439
+ currentPath = path$1.resolve(currentPath, "..");
1440
1440
  }
1441
1441
  } };
1442
1442
  }
1443
1443
  //#endregion
1444
1444
  //#region ../../node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
1445
1445
  const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath = process$1.execPath, addExecPath = true } = {}) => {
1446
- const cwdPath = path.resolve(toPath(cwd));
1446
+ const cwdPath = path$1.resolve(toPath(cwd));
1447
1447
  const result = [];
1448
- const pathParts = pathOption.split(path.delimiter);
1448
+ const pathParts = pathOption.split(path$1.delimiter);
1449
1449
  if (preferLocal) applyPreferLocal(result, pathParts, cwdPath);
1450
1450
  if (addExecPath) applyExecPath(result, pathParts, execPath, cwdPath);
1451
- return pathOption === "" || pathOption === path.delimiter ? `${result.join(path.delimiter)}${pathOption}` : [...result, pathOption].join(path.delimiter);
1451
+ return pathOption === "" || pathOption === path$1.delimiter ? `${result.join(path$1.delimiter)}${pathOption}` : [...result, pathOption].join(path$1.delimiter);
1452
1452
  };
1453
1453
  const applyPreferLocal = (result, pathParts, cwdPath) => {
1454
1454
  for (const directory of traversePathUp(cwdPath)) {
1455
- const pathPart = path.join(directory, "node_modules/.bin");
1455
+ const pathPart = path$1.join(directory, "node_modules/.bin");
1456
1456
  if (!pathParts.includes(pathPart)) result.push(pathPart);
1457
1457
  }
1458
1458
  };
1459
1459
  const applyExecPath = (result, pathParts, execPath, cwdPath) => {
1460
- const pathPart = path.resolve(cwdPath, toPath(execPath), "..");
1460
+ const pathPart = path$1.resolve(cwdPath, toPath(execPath), "..");
1461
1461
  if (!pathParts.includes(pathPart)) result.push(pathPart);
1462
1462
  };
1463
1463
  const npmRunPathEnv = ({ env = process$1.env, ...options } = {}) => {
@@ -2467,7 +2467,7 @@ const mapNode = ({ options }) => {
2467
2467
  const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = false, nodePath = execPath, nodeOptions = execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")), cwd, execPath: formerNodePath, ...options }) => {
2468
2468
  if (formerNodePath !== void 0) throw new TypeError("The \"execPath\" option has been removed. Please use the \"nodePath\" option instead.");
2469
2469
  const normalizedNodePath = safeNormalizeFileUrl(nodePath, "The \"nodePath\" option");
2470
- const resolvedNodePath = path.resolve(cwd, normalizedNodePath);
2470
+ const resolvedNodePath = path$1.resolve(cwd, normalizedNodePath);
2471
2471
  const newOptions = {
2472
2472
  ...options,
2473
2473
  nodePath: resolvedNodePath,
@@ -2479,7 +2479,7 @@ const handleNodeOption = (file, commandArguments, { node: shouldHandleNode = fal
2479
2479
  commandArguments,
2480
2480
  newOptions
2481
2481
  ];
2482
- if (path.basename(file, ".exe") === "node") throw new TypeError("When the \"node\" option is true, the first argument does not need to be \"node\".");
2482
+ if (path$1.basename(file, ".exe") === "node") throw new TypeError("When the \"node\" option is true, the first argument does not need to be \"node\".");
2483
2483
  return [
2484
2484
  resolvedNodePath,
2485
2485
  [
@@ -2563,7 +2563,7 @@ const serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encod
2563
2563
  //#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/arguments/cwd.js
2564
2564
  const normalizeCwd = (cwd = getDefaultCwd()) => {
2565
2565
  const cwdString = safeNormalizeFileUrl(cwd, "The \"cwd\" option");
2566
- return path.resolve(cwdString);
2566
+ return path$1.resolve(cwdString);
2567
2567
  };
2568
2568
  const getDefaultCwd = () => {
2569
2569
  try {
@@ -2601,7 +2601,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
2601
2601
  options.killSignal = normalizeKillSignal(options.killSignal);
2602
2602
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
2603
2603
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
2604
- if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
2604
+ if (process$1.platform === "win32" && path$1.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
2605
2605
  return {
2606
2606
  file,
2607
2607
  commandArguments,
@@ -6427,8 +6427,8 @@ const ensureExists = async (targetPath, description) => {
6427
6427
  }
6428
6428
  };
6429
6429
  const normalizeFunctionsPackage = async (functionsDir) => {
6430
- const templatePackagePath = path.join(functionsDir, "_package.json");
6431
- const packageJsonPath = path.join(functionsDir, "package.json");
6430
+ const templatePackagePath = path$1.join(functionsDir, "_package.json");
6431
+ const packageJsonPath = path$1.join(functionsDir, "package.json");
6432
6432
  try {
6433
6433
  await fs$1.rename(templatePackagePath, packageJsonPath);
6434
6434
  } catch (error) {
@@ -6437,12 +6437,12 @@ const normalizeFunctionsPackage = async (functionsDir) => {
6437
6437
  }
6438
6438
  };
6439
6439
  const prepareFirebaseTemplate = async (firebaseRootDir) => {
6440
- const publicDir = path.join(firebaseRootDir, "public");
6441
- const builtFunctionsDir = path.join(firebaseRootDir, "functions");
6440
+ const publicDir = path$1.join(firebaseRootDir, "public");
6441
+ const builtFunctionsDir = path$1.join(firebaseRootDir, "functions");
6442
6442
  await ensureExists(publicDir, "public template directory");
6443
6443
  await ensureExists(builtFunctionsDir, "functions build directory");
6444
6444
  const { tmpDir, removeTmpDir } = await copyDirToTmp(publicDir);
6445
- const functionsDir = path.join(tmpDir, "functions");
6445
+ const functionsDir = path$1.join(tmpDir, "functions");
6446
6446
  await fs$1.cp(builtFunctionsDir, functionsDir, { recursive: true });
6447
6447
  await normalizeFunctionsPackage(functionsDir);
6448
6448
  return {
@@ -6763,7 +6763,7 @@ const REGIONS = [
6763
6763
  }
6764
6764
  ];
6765
6765
  const getFirebaseRuntimePackageInfo = () => {
6766
- const firebasePackageRoot = path$1.dirname(__require.resolve("@hot-updater/firebase/package.json"));
6766
+ const firebasePackageRoot = path.dirname(__require.resolve("@hot-updater/firebase/package.json"));
6767
6767
  return {
6768
6768
  currentPackageVersion: resolvePackageVersion("@hot-updater/firebase"),
6769
6769
  serverPackageVersion: resolveHotUpdaterServerVersion("@hot-updater/firebase"),
@@ -6772,10 +6772,10 @@ const getFirebaseRuntimePackageInfo = () => {
6772
6772
  };
6773
6773
  const syncFunctionsPackageJson = async (functionsDir) => {
6774
6774
  const runtimePackageInfo = getFirebaseRuntimePackageInfo();
6775
- const packageJsonPath = path$1.join(functionsDir, "package.json");
6775
+ const packageJsonPath = path.join(functionsDir, "package.json");
6776
6776
  const packageJson = JSON.parse(await fs.promises.readFile(packageJsonPath, "utf-8"));
6777
6777
  packageJson.dependencies = {
6778
- ...packageJson.dependencies ?? {},
6778
+ ...packageJson.dependencies,
6779
6779
  "@hot-updater/server": runtimePackageInfo.serverPackageVersion,
6780
6780
  hono: runtimePackageInfo.honoVersion
6781
6781
  };
@@ -6810,9 +6810,9 @@ const deployFirestore = async (cwd) => {
6810
6810
  fieldOverrides: []
6811
6811
  };
6812
6812
  } catch {}
6813
- const newIndexes = JSON.parse(await fs.promises.readFile(path$1.join(cwd, "firestore.indexes.json"), "utf-8"));
6813
+ const newIndexes = JSON.parse(await fs.promises.readFile(path.join(cwd, "firestore.indexes.json"), "utf-8"));
6814
6814
  const mergedIndexes = mergeIndexes(originalIndexes, newIndexes);
6815
- await fs.promises.writeFile(path$1.join(cwd, "firestore.indexes.json"), JSON.stringify(mergedIndexes, null, 2));
6815
+ await fs.promises.writeFile(path.join(cwd, "firestore.indexes.json"), JSON.stringify(mergedIndexes, null, 2));
6816
6816
  try {
6817
6817
  await execa("npx", [
6818
6818
  "firebase",
@@ -6884,8 +6884,8 @@ const runInit = async ({ build }) => {
6884
6884
  p.log.step(link("https://cloud.google.com/sdk/docs/install"));
6885
6885
  process.exit(1);
6886
6886
  }
6887
- const { tmpDir, removeTmpDir, functionsDir } = await prepareFirebaseTemplate(path$1.dirname(path$1.dirname(__require.resolve("@hot-updater/firebase/functions"))));
6888
- const functionsIndexPath = path$1.join(functionsDir, "index.cjs");
6887
+ const { tmpDir, removeTmpDir, functionsDir } = await prepareFirebaseTemplate(path.dirname(path.dirname(__require.resolve("@hot-updater/firebase/functions"))));
6888
+ const functionsIndexPath = path.join(functionsDir, "index.cjs");
6889
6889
  const runtimePackageInfo = await syncFunctionsPackageJson(functionsDir);
6890
6890
  const initializeVariable = await initFirebaseUser(tmpDir);
6891
6891
  let currentRegion;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/firebase",
3
3
  "type": "module",
4
- "version": "0.29.3",
4
+ "version": "0.29.4",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "main": "dist/index.cjs",
7
7
  "types": "dist/index.d.cts",
@@ -36,10 +36,10 @@
36
36
  "dependencies": {
37
37
  "firebase": "^11.3.1",
38
38
  "hono": "4.12.9",
39
- "@hot-updater/cli-tools": "0.29.3",
40
- "@hot-updater/core": "0.29.3",
41
- "@hot-updater/plugin-core": "0.29.3",
42
- "@hot-updater/server": "0.29.3"
39
+ "@hot-updater/cli-tools": "0.29.4",
40
+ "@hot-updater/plugin-core": "0.29.4",
41
+ "@hot-updater/server": "0.29.4",
42
+ "@hot-updater/core": "0.29.4"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public"
@@ -54,9 +54,9 @@
54
54
  "firebase-tools": "^13.32.0",
55
55
  "fkill": "^9.0.0",
56
56
  "mime": "^4.0.4",
57
- "@hot-updater/js": "0.29.3",
58
- "@hot-updater/test-utils": "0.29.3",
59
- "@hot-updater/mock": "0.29.3"
57
+ "@hot-updater/js": "0.29.4",
58
+ "@hot-updater/mock": "0.29.4",
59
+ "@hot-updater/test-utils": "0.29.4"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "firebase-admin": "*",