@hot-updater/firebase 0.35.12 → 0.36.1

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.
@@ -32,7 +32,7 @@ path = __toESM(path);
32
32
  let firebase_admin_storage = require("firebase-admin/storage");
33
33
  //#endregion
34
34
  //#region ../../packages/server/dist/version.mjs
35
- const HOT_UPDATER_SERVER_VERSION = "0.35.12";
35
+ const HOT_UPDATER_SERVER_VERSION = "0.36.1";
36
36
  //#endregion
37
37
  //#region ../../packages/server/dist/internalRouter.mjs
38
38
  const normalizePath = (path) => {
@@ -2345,6 +2345,8 @@ const getContentAddressedAssetStoragePath = ({ assetPath, fileHash }) => {
2345
2345
  const getLegacyManifestAssetStoragePath = ({ assetPath }) => assetPath;
2346
2346
  //#endregion
2347
2347
  //#region ../plugin-core/dist/assetStorageLayout.mjs
2348
+ const isBrotliManifestAssetPath = (assetPath) => /(^|\/)index\.[^/]+\.bundle$/.test(assetPath.replace(/\\/g, "/"));
2349
+ const getManifestAssetDownloadPath = (assetPath) => isBrotliManifestAssetPath(assetPath) ? `${assetPath}.br` : assetPath;
2348
2350
  const createStorageUriWithRelativePath = ({ baseStorageUri, relativePath }) => {
2349
2351
  const storageUrl = new URL(baseStorageUri);
2350
2352
  storageUrl.pathname = `${storageUrl.pathname.replace(/\/+$/, "")}/${relativePath.replace(/\\/g, "/").split("/").filter(Boolean).map((segment) => encodeURIComponent(segment)).join("/")}`;
@@ -3538,21 +3540,39 @@ const createProfiledStoragePlugin = ({ createProfiles, name, profileShape, suppo
3538
3540
  return runtime;
3539
3541
  };
3540
3542
  const profiles = {};
3541
- if (profileShape?.node) profiles.node = {
3542
- async delete(storageUri) {
3543
- return requireNodeProfile().delete(storageUri);
3544
- },
3545
- async downloadFile(storageUri, filePath) {
3546
- return requireNodeProfile().downloadFile(storageUri, filePath);
3547
- },
3548
- async exists(storageUri) {
3549
- return requireNodeProfile().exists(storageUri);
3550
- },
3551
- async upload(key, filePath) {
3552
- return requireNodeProfile().upload(key, filePath);
3553
- }
3554
- };
3555
- else if (profileShape?.node !== false) Object.defineProperty(profiles, "node", {
3543
+ if (profileShape?.node) {
3544
+ const nodeProfile = {
3545
+ async delete(storageUri) {
3546
+ return requireNodeProfile().delete(storageUri);
3547
+ },
3548
+ async downloadFile(storageUri, filePath) {
3549
+ return requireNodeProfile().downloadFile(storageUri, filePath);
3550
+ },
3551
+ async exists(storageUri) {
3552
+ return requireNodeProfile().exists(storageUri);
3553
+ },
3554
+ async upload(key, filePath) {
3555
+ return requireNodeProfile().upload(key, filePath);
3556
+ }
3557
+ };
3558
+ Object.defineProperties(nodeProfile, {
3559
+ deleteObjects: {
3560
+ enumerable: true,
3561
+ get: () => {
3562
+ const deleteObjects = requireNodeProfile().deleteObjects;
3563
+ return deleteObjects ? (keys) => deleteObjects(keys) : void 0;
3564
+ }
3565
+ },
3566
+ listObjects: {
3567
+ enumerable: true,
3568
+ get: () => {
3569
+ const listObjects = requireNodeProfile().listObjects;
3570
+ return listObjects ? (prefix) => listObjects(prefix) : void 0;
3571
+ }
3572
+ }
3573
+ });
3574
+ profiles.node = nodeProfile;
3575
+ } else if (profileShape?.node !== false) Object.defineProperty(profiles, "node", {
3556
3576
  enumerable: true,
3557
3577
  get: getNodeProfile
3558
3578
  });
@@ -3649,7 +3669,6 @@ function assertRuntimeStoragePlugin(plugin) {
3649
3669
  //#endregion
3650
3670
  //#region ../../packages/server/dist/db/updateArtifacts.mjs
3651
3671
  const HBC_ASSET_PATH_RE = /\.bundle$/;
3652
- const BR_COMPRESSED_ASSET_PATH_RE = /(^|\/)index\.[^/]+\.bundle$/;
3653
3672
  const resolveUniqueHbcAssetPath = (manifest) => {
3654
3673
  const candidates = Object.keys(manifest.assets).sort((left, right) => left.localeCompare(right)).filter((candidate) => HBC_ASSET_PATH_RE.test(candidate));
3655
3674
  return candidates.length === 1 ? candidates[0] : null;
@@ -3691,10 +3710,11 @@ async function resolveChangedAssets({ assetBaseStorageUri, currentManifest, curr
3691
3710
  });
3692
3711
  const changedEntries = await Promise.all(Object.entries(targetManifest.assets).map(async ([assetPath, asset]) => {
3693
3712
  if ((currentManifest?.assets[assetPath])?.fileHash === asset.fileHash) return null;
3694
- const usesBrotliAsset = BR_COMPRESSED_ASSET_PATH_RE.test(assetPath);
3713
+ const downloadPath = getManifestAssetDownloadPath(assetPath);
3714
+ const usesBrotliAsset = downloadPath !== assetPath;
3695
3715
  const storageUri = resolveManifestAssetStorageUri({
3696
3716
  assetBaseStorageUri,
3697
- assetPath: usesBrotliAsset ? `${assetPath}.br` : assetPath,
3717
+ assetPath: downloadPath,
3698
3718
  fileHash: asset.fileHash
3699
3719
  });
3700
3720
  const patch = patchDescriptor?.assetPath === assetPath ? patchDescriptor.patch : null;
@@ -6980,7 +6980,7 @@ const getConfigScaffold = (build) => {
6980
6980
  strategy: "preserve-existing",
6981
6981
  code: `
6982
6982
  // https://firebase.google.com/docs/admin/setup?hl=en#initialize_the_sdk_in_non-google_environments
6983
- // Check your .env file and add the credentials
6983
+ // Check your .env.hotupdater file and add the credentials
6984
6984
  // Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to your credentials file path
6985
6985
  // Example: GOOGLE_APPLICATION_CREDENTIALS=./firebase-adminsdk-credentials.json
6986
6986
  const credential = applicationDefault();`.trim()
@@ -7213,7 +7213,7 @@ const SOURCE_TEMPLATE = `// add this to your App.tsx
7213
7213
  import { HotUpdater } from "@hot-updater/react-native";
7214
7214
 
7215
7215
  function App() {
7216
- return ...
7216
+ return null; // Replace with your app root
7217
7217
  }
7218
7218
 
7219
7219
  export default HotUpdater.wrap({
@@ -7482,7 +7482,7 @@ const runInit = async ({ build, envFile }) => {
7482
7482
  await printTemplate(initializeVariable.projectId, currentRegion, cliEnv);
7483
7483
  await removeTmpDir();
7484
7484
  _hot_updater_cli_tools.p.log.message(`Next step: ${(0, _hot_updater_cli_tools.link)("https://hot-updater.dev/docs/managed/firebase#step-3-generated-configurations")}`);
7485
- if (!applicationCredentials) _hot_updater_cli_tools.p.log.message("Next step: Change GOOGLE_APPLICATION_CREDENTIALS=your-credentials.json in .env file");
7485
+ if (!applicationCredentials) _hot_updater_cli_tools.p.log.message("Next step: Change GOOGLE_APPLICATION_CREDENTIALS=your-credentials.json in .env.hotupdater");
7486
7486
  _hot_updater_cli_tools.p.log.success("Done! 🎉");
7487
7487
  };
7488
7488
  //#endregion
@@ -6974,7 +6974,7 @@ const getConfigScaffold = (build) => {
6974
6974
  strategy: "preserve-existing",
6975
6975
  code: `
6976
6976
  // https://firebase.google.com/docs/admin/setup?hl=en#initialize_the_sdk_in_non-google_environments
6977
- // Check your .env file and add the credentials
6977
+ // Check your .env.hotupdater file and add the credentials
6978
6978
  // Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to your credentials file path
6979
6979
  // Example: GOOGLE_APPLICATION_CREDENTIALS=./firebase-adminsdk-credentials.json
6980
6980
  const credential = applicationDefault();`.trim()
@@ -7207,7 +7207,7 @@ const SOURCE_TEMPLATE = `// add this to your App.tsx
7207
7207
  import { HotUpdater } from "@hot-updater/react-native";
7208
7208
 
7209
7209
  function App() {
7210
- return ...
7210
+ return null; // Replace with your app root
7211
7211
  }
7212
7212
 
7213
7213
  export default HotUpdater.wrap({
@@ -7476,7 +7476,7 @@ const runInit = async ({ build, envFile }) => {
7476
7476
  await printTemplate(initializeVariable.projectId, currentRegion, cliEnv);
7477
7477
  await removeTmpDir();
7478
7478
  p.log.message(`Next step: ${link("https://hot-updater.dev/docs/managed/firebase#step-3-generated-configurations")}`);
7479
- if (!applicationCredentials) p.log.message("Next step: Change GOOGLE_APPLICATION_CREDENTIALS=your-credentials.json in .env file");
7479
+ if (!applicationCredentials) p.log.message("Next step: Change GOOGLE_APPLICATION_CREDENTIALS=your-credentials.json in .env.hotupdater");
7480
7480
  p.log.success("Done! 🎉");
7481
7481
  };
7482
7482
  //#endregion
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/firebase",
3
3
  "type": "module",
4
- "version": "0.35.12",
4
+ "version": "0.36.1",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "main": "dist/index.cjs",
7
7
  "types": "dist/index.d.cts",
@@ -43,10 +43,10 @@
43
43
  ],
44
44
  "dependencies": {
45
45
  "hono": "4.12.9",
46
- "@hot-updater/core": "0.35.12",
47
- "@hot-updater/cli-tools": "0.35.12",
48
- "@hot-updater/plugin-core": "0.35.12",
49
- "@hot-updater/server": "0.35.12"
46
+ "@hot-updater/plugin-core": "0.36.1",
47
+ "@hot-updater/core": "0.36.1",
48
+ "@hot-updater/cli-tools": "0.36.1",
49
+ "@hot-updater/server": "0.36.1"
50
50
  },
51
51
  "publishConfig": {
52
52
  "access": "public"
@@ -61,9 +61,9 @@
61
61
  "firebase-tools": "^13.32.0",
62
62
  "fkill": "^9.0.0",
63
63
  "mime": "^4.0.4",
64
- "@hot-updater/test-utils": "0.35.12",
65
- "@hot-updater/js": "0.35.12",
66
- "@hot-updater/mock": "0.35.12"
64
+ "@hot-updater/mock": "0.36.1",
65
+ "@hot-updater/test-utils": "0.36.1",
66
+ "@hot-updater/js": "0.36.1"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "firebase-admin": "*",