@hot-updater/cloudflare 0.16.4 → 0.16.6

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.
@@ -12687,26 +12687,25 @@ var getWranglerLoginAuthToken = () => {
12687
12687
  };
12688
12688
 
12689
12689
  // iac/index.ts
12690
- var CONFIG_TEMPLATE = `
12691
- import { bare } from "@hot-updater/bare";
12692
- import { d1Database, r2Storage } from "@hot-updater/cloudflare";
12693
- import { defineConfig } from "hot-updater";
12694
- import "dotenv/config";
12695
-
12696
- export default defineConfig({
12697
- build: bare({ enableHermes: true }),
12698
- storage: r2Storage({
12690
+ var getConfigTemplate = (build) => {
12691
+ const storageConfig = {
12692
+ imports: [{ pkg: "@hot-updater/cloudflare", named: ["r2Storage"] }],
12693
+ configString: `r2Storage({
12699
12694
  bucketName: process.env.HOT_UPDATER_CLOUDFLARE_R2_BUCKET_NAME!,
12700
12695
  accountId: process.env.HOT_UPDATER_CLOUDFLARE_ACCOUNT_ID!,
12701
12696
  cloudflareApiToken: process.env.HOT_UPDATER_CLOUDFLARE_API_TOKEN!,
12702
- }),
12703
- database: d1Database({
12697
+ })`
12698
+ };
12699
+ const databaseConfig = {
12700
+ imports: [{ pkg: "@hot-updater/cloudflare", named: ["d1Database"] }],
12701
+ configString: `d1Database({
12704
12702
  databaseId: process.env.HOT_UPDATER_CLOUDFLARE_D1_DATABASE_ID!,
12705
12703
  accountId: process.env.HOT_UPDATER_CLOUDFLARE_ACCOUNT_ID!,
12706
12704
  cloudflareApiToken: process.env.HOT_UPDATER_CLOUDFLARE_API_TOKEN!,
12707
- }),
12708
- });
12709
- `;
12705
+ })`
12706
+ };
12707
+ return new import_plugin_core.ConfigBuilder().setBuildType(build).setStorage(storageConfig).setDatabase(databaseConfig).getResult();
12708
+ };
12710
12709
  var SOURCE_TEMPLATE = `// add this to your App.tsx
12711
12710
  import { HotUpdater } from "@hot-updater/react-native";
12712
12711
 
@@ -12776,7 +12775,9 @@ var deployWorker = async (oauth_token, accountId, {
12776
12775
  await removeTmpDir();
12777
12776
  }
12778
12777
  };
12779
- var runInit = async () => {
12778
+ var runInit = async ({
12779
+ build
12780
+ }) => {
12780
12781
  const cwd = (0, import_plugin_core.getCwd)();
12781
12782
  let auth = getWranglerLoginAuthToken();
12782
12783
  if (!auth || (0, import_dayjs.default)(auth?.expiration_time).isBefore((0, import_dayjs.default)())) {
@@ -13010,7 +13011,7 @@ var runInit = async () => {
13010
13011
  d1DatabaseName,
13011
13012
  r2BucketName: selectedBucketName
13012
13013
  });
13013
- await import_promises12.default.writeFile("hot-updater.config.ts", CONFIG_TEMPLATE);
13014
+ await import_promises12.default.writeFile("hot-updater.config.ts", getConfigTemplate(build));
13014
13015
  await (0, import_plugin_core.makeEnv)({
13015
13016
  HOT_UPDATER_CLOUDFLARE_API_TOKEN: apiToken,
13016
13017
  HOT_UPDATER_CLOUDFLARE_ACCOUNT_ID: accountId,
@@ -1,3 +1,5 @@
1
- declare const runInit: () => Promise<void>;
1
+ declare const runInit: ({ build, }: {
2
+ build: "bare" | "rnef";
3
+ }) => Promise<void>;
2
4
 
3
5
  export { runInit };
@@ -1,3 +1,5 @@
1
- declare const runInit: () => Promise<void>;
1
+ declare const runInit: ({ build, }: {
2
+ build: "bare" | "rnef";
3
+ }) => Promise<void>;
2
4
 
3
5
  export { runInit };
package/dist/iac/index.js CHANGED
@@ -5846,6 +5846,7 @@ var Te = async (t) => {
5846
5846
  // iac/index.ts
5847
5847
  var import_dayjs = __toESM(require_dayjs_min(), 1);
5848
5848
  import {
5849
+ ConfigBuilder,
5849
5850
  copyDirToTmp,
5850
5851
  getCwd,
5851
5852
  link,
@@ -12697,26 +12698,25 @@ var getWranglerLoginAuthToken = () => {
12697
12698
  };
12698
12699
 
12699
12700
  // iac/index.ts
12700
- var CONFIG_TEMPLATE = `
12701
- import { bare } from "@hot-updater/bare";
12702
- import { d1Database, r2Storage } from "@hot-updater/cloudflare";
12703
- import { defineConfig } from "hot-updater";
12704
- import "dotenv/config";
12705
-
12706
- export default defineConfig({
12707
- build: bare({ enableHermes: true }),
12708
- storage: r2Storage({
12701
+ var getConfigTemplate = (build) => {
12702
+ const storageConfig = {
12703
+ imports: [{ pkg: "@hot-updater/cloudflare", named: ["r2Storage"] }],
12704
+ configString: `r2Storage({
12709
12705
  bucketName: process.env.HOT_UPDATER_CLOUDFLARE_R2_BUCKET_NAME!,
12710
12706
  accountId: process.env.HOT_UPDATER_CLOUDFLARE_ACCOUNT_ID!,
12711
12707
  cloudflareApiToken: process.env.HOT_UPDATER_CLOUDFLARE_API_TOKEN!,
12712
- }),
12713
- database: d1Database({
12708
+ })`
12709
+ };
12710
+ const databaseConfig = {
12711
+ imports: [{ pkg: "@hot-updater/cloudflare", named: ["d1Database"] }],
12712
+ configString: `d1Database({
12714
12713
  databaseId: process.env.HOT_UPDATER_CLOUDFLARE_D1_DATABASE_ID!,
12715
12714
  accountId: process.env.HOT_UPDATER_CLOUDFLARE_ACCOUNT_ID!,
12716
12715
  cloudflareApiToken: process.env.HOT_UPDATER_CLOUDFLARE_API_TOKEN!,
12717
- }),
12718
- });
12719
- `;
12716
+ })`
12717
+ };
12718
+ return new ConfigBuilder().setBuildType(build).setStorage(storageConfig).setDatabase(databaseConfig).getResult();
12719
+ };
12720
12720
  var SOURCE_TEMPLATE = `// add this to your App.tsx
12721
12721
  import { HotUpdater } from "@hot-updater/react-native";
12722
12722
 
@@ -12786,7 +12786,9 @@ var deployWorker = async (oauth_token, accountId, {
12786
12786
  await removeTmpDir();
12787
12787
  }
12788
12788
  };
12789
- var runInit = async () => {
12789
+ var runInit = async ({
12790
+ build
12791
+ }) => {
12790
12792
  const cwd = getCwd();
12791
12793
  let auth = getWranglerLoginAuthToken();
12792
12794
  if (!auth || (0, import_dayjs.default)(auth?.expiration_time).isBefore((0, import_dayjs.default)())) {
@@ -13020,7 +13022,7 @@ var runInit = async () => {
13020
13022
  d1DatabaseName,
13021
13023
  r2BucketName: selectedBucketName
13022
13024
  });
13023
- await fs2.writeFile("hot-updater.config.ts", CONFIG_TEMPLATE);
13025
+ await fs2.writeFile("hot-updater.config.ts", getConfigTemplate(build));
13024
13026
  await makeEnv({
13025
13027
  HOT_UPDATER_CLOUDFLARE_API_TOKEN: apiToken,
13026
13028
  HOT_UPDATER_CLOUDFLARE_ACCOUNT_ID: accountId,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/cloudflare",
3
3
  "type": "module",
4
- "version": "0.16.4",
4
+ "version": "0.16.6",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.js",
@@ -39,10 +39,10 @@
39
39
  "package.json"
40
40
  ],
41
41
  "dependencies": {
42
- "@hot-updater/core": "0.16.4",
43
- "@hot-updater/js": "0.16.4",
44
- "@hot-updater/plugin-core": "0.16.4",
45
- "cloudflare": "4.2.0"
42
+ "cloudflare": "4.2.0",
43
+ "@hot-updater/core": "0.16.6",
44
+ "@hot-updater/js": "0.16.6",
45
+ "@hot-updater/plugin-core": "0.16.6"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@clack/prompts": "0.10.0",
@@ -1 +1 @@
1
- This folder contains the built output assets for the worker "hot-updater" generated at 2025-04-26T05:57:12.465Z.
1
+ This folder contains the built output assets for the worker "hot-updater" generated at 2025-04-27T18:41:38.529Z.