@hot-updater/plugin-core 0.20.0 → 0.20.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.
package/dist/index.cjs CHANGED
@@ -18843,6 +18843,10 @@ const defaultConfig = {
18843
18843
  ignorePaths: []
18844
18844
  },
18845
18845
  console: { port: 1422 },
18846
+ platform: {
18847
+ android: { stringResourcePaths: ["android/app/src/main/res/values/strings.xml"] },
18848
+ ios: { infoPlistPaths: ["ios/*/Info.plist"] }
18849
+ },
18846
18850
  nativeBuild: { android: {
18847
18851
  aab: true,
18848
18852
  variant: "Release",
@@ -20341,7 +20345,7 @@ const transformEnv = (filename, env$2) => {
20341
20345
 
20342
20346
  //#endregion
20343
20347
  //#region src/makeEnv.ts
20344
- const makeEnv = async (newEnvVars, filePath = ".env") => {
20348
+ const makeEnv = async (newEnvVars, filePath = ".env.hotupdater") => {
20345
20349
  try {
20346
20350
  const existingContent = await fs_promises.default.readFile(filePath, "utf-8").catch(() => "");
20347
20351
  const lines = existingContent ? existingContent.split("\n") : [];
@@ -20386,7 +20390,7 @@ const makeEnv = async (newEnvVars, filePath = ".env") => {
20386
20390
  await fs_promises.default.writeFile(filePath, updatedContent, "utf-8");
20387
20391
  return updatedContent;
20388
20392
  } catch (error) {
20389
- console.error("Error while updating .env file:", error);
20393
+ console.error("Error while updating .env.hotupdater file:", error);
20390
20394
  throw error;
20391
20395
  }
20392
20396
  };
@@ -29542,8 +29546,8 @@ var ConfigBuilder = class {
29542
29546
  collectedImports = /* @__PURE__ */ new Map();
29543
29547
  constructor() {
29544
29548
  this.addImport({
29545
- pkg: "dotenv/config",
29546
- sideEffect: true
29549
+ pkg: "dotenv",
29550
+ named: ["config"]
29547
29551
  });
29548
29552
  this.addImport({
29549
29553
  pkg: "hot-updater",
@@ -29641,6 +29645,8 @@ var ConfigBuilder = class {
29641
29645
  return `
29642
29646
  ${importStatements}
29643
29647
 
29648
+ config({ path: ".env.hotupdater" });
29649
+
29644
29650
  ${this.intermediateCode ? `${this.intermediateCode}\n` : ""}
29645
29651
  export default defineConfig({
29646
29652
  build: ${buildConfigString},
package/dist/index.d.cts CHANGED
@@ -80,6 +80,30 @@ interface BuildPlugin {
80
80
  }>;
81
81
  name: string;
82
82
  }
83
+ interface PlatformConfig {
84
+ /**
85
+ * Android platform configuration.
86
+ */
87
+ android?: {
88
+ /**
89
+ * Android string resource paths.
90
+ *
91
+ * @default ["android/app/src/main/res/values/strings.xml"]
92
+ */
93
+ stringResourcePaths?: string[];
94
+ };
95
+ /**
96
+ * iOS platform configuration.
97
+ */
98
+ ios?: {
99
+ /**
100
+ * iOS info.plist paths.
101
+ *
102
+ * @default ["ios/\*\/Info.plist"]
103
+ */
104
+ infoPlistPaths?: string[];
105
+ };
106
+ }
83
107
  interface NativeBuildArgs {
84
108
  /**
85
109
  * Android specific configuration.
@@ -167,6 +191,7 @@ type ConfigInput = {
167
191
  */
168
192
  port?: number;
169
193
  };
194
+ platform?: PlatformConfig;
170
195
  nativeBuild?: NativeBuildArgs;
171
196
  build: (args: BasePluginArgs) => Promise<BuildPlugin> | BuildPlugin;
172
197
  storage: (args: BasePluginArgs) => Promise<StoragePlugin> | StoragePlugin;
@@ -398,4 +423,4 @@ declare const generateMinBundleId: () => string;
398
423
  //#region src/createStorageKeyBuilder.d.ts
399
424
  declare const createStorageKeyBuilder: (basePath: string | undefined) => (...args: string[]) => string;
400
425
  //#endregion
401
- export { AbstractDatabasePlugin, BaseDatabaseUtils, BasePluginArgs, BuildPlugin, BuildPluginConfig, BuildType, BuiltIns, type Bundle, ConfigBuilder, ConfigInput, ConfigResponse, DatabasePlugin, DatabasePluginHooks, HasMultipleCallSignatures, HotUpdaterConfigOptions, IConfigBuilder, ImportInfo, NativeBuildArgs, PaginatedResult, PaginationInfo, PaginationOptions, type Platform, Primitive, ProviderConfig, RequiredDeep, StoragePlugin, StoragePluginHooks, banner, calculatePagination, copyDirToTmp, createBlobDatabasePlugin, createDatabasePlugin, createStorageKeyBuilder, createZip, createZipTargetFiles, generateMinBundleId, getCwd, link, loadConfig, loadConfigSync, log, makeEnv, printBanner, transformEnv, transformTemplate };
426
+ export { AbstractDatabasePlugin, BaseDatabaseUtils, BasePluginArgs, BuildPlugin, BuildPluginConfig, BuildType, BuiltIns, type Bundle, ConfigBuilder, ConfigInput, ConfigResponse, DatabasePlugin, DatabasePluginHooks, HasMultipleCallSignatures, HotUpdaterConfigOptions, IConfigBuilder, ImportInfo, NativeBuildArgs, PaginatedResult, PaginationInfo, PaginationOptions, type Platform, PlatformConfig, Primitive, ProviderConfig, RequiredDeep, StoragePlugin, StoragePluginHooks, banner, calculatePagination, copyDirToTmp, createBlobDatabasePlugin, createDatabasePlugin, createStorageKeyBuilder, createZip, createZipTargetFiles, generateMinBundleId, getCwd, link, loadConfig, loadConfigSync, log, makeEnv, printBanner, transformEnv, transformTemplate };
package/dist/index.d.ts CHANGED
@@ -80,6 +80,30 @@ interface BuildPlugin {
80
80
  }>;
81
81
  name: string;
82
82
  }
83
+ interface PlatformConfig {
84
+ /**
85
+ * Android platform configuration.
86
+ */
87
+ android?: {
88
+ /**
89
+ * Android string resource paths.
90
+ *
91
+ * @default ["android/app/src/main/res/values/strings.xml"]
92
+ */
93
+ stringResourcePaths?: string[];
94
+ };
95
+ /**
96
+ * iOS platform configuration.
97
+ */
98
+ ios?: {
99
+ /**
100
+ * iOS info.plist paths.
101
+ *
102
+ * @default ["ios/\*\/Info.plist"]
103
+ */
104
+ infoPlistPaths?: string[];
105
+ };
106
+ }
83
107
  interface NativeBuildArgs {
84
108
  /**
85
109
  * Android specific configuration.
@@ -167,6 +191,7 @@ type ConfigInput = {
167
191
  */
168
192
  port?: number;
169
193
  };
194
+ platform?: PlatformConfig;
170
195
  nativeBuild?: NativeBuildArgs;
171
196
  build: (args: BasePluginArgs) => Promise<BuildPlugin> | BuildPlugin;
172
197
  storage: (args: BasePluginArgs) => Promise<StoragePlugin> | StoragePlugin;
@@ -398,4 +423,4 @@ declare const generateMinBundleId: () => string;
398
423
  //#region src/createStorageKeyBuilder.d.ts
399
424
  declare const createStorageKeyBuilder: (basePath: string | undefined) => (...args: string[]) => string;
400
425
  //#endregion
401
- export { AbstractDatabasePlugin, BaseDatabaseUtils, BasePluginArgs, BuildPlugin, BuildPluginConfig, BuildType, BuiltIns, type Bundle, ConfigBuilder, ConfigInput, ConfigResponse, DatabasePlugin, DatabasePluginHooks, HasMultipleCallSignatures, HotUpdaterConfigOptions, IConfigBuilder, ImportInfo, NativeBuildArgs, PaginatedResult, PaginationInfo, PaginationOptions, type Platform, Primitive, ProviderConfig, RequiredDeep, StoragePlugin, StoragePluginHooks, banner, calculatePagination, copyDirToTmp, createBlobDatabasePlugin, createDatabasePlugin, createStorageKeyBuilder, createZip, createZipTargetFiles, generateMinBundleId, getCwd, link, loadConfig, loadConfigSync, log, makeEnv, printBanner, transformEnv, transformTemplate };
426
+ export { AbstractDatabasePlugin, BaseDatabaseUtils, BasePluginArgs, BuildPlugin, BuildPluginConfig, BuildType, BuiltIns, type Bundle, ConfigBuilder, ConfigInput, ConfigResponse, DatabasePlugin, DatabasePluginHooks, HasMultipleCallSignatures, HotUpdaterConfigOptions, IConfigBuilder, ImportInfo, NativeBuildArgs, PaginatedResult, PaginationInfo, PaginationOptions, type Platform, PlatformConfig, Primitive, ProviderConfig, RequiredDeep, StoragePlugin, StoragePluginHooks, banner, calculatePagination, copyDirToTmp, createBlobDatabasePlugin, createDatabasePlugin, createStorageKeyBuilder, createZip, createZipTargetFiles, generateMinBundleId, getCwd, link, loadConfig, loadConfigSync, log, makeEnv, printBanner, transformEnv, transformTemplate };
package/dist/index.js CHANGED
@@ -18845,6 +18845,10 @@ const defaultConfig = {
18845
18845
  ignorePaths: []
18846
18846
  },
18847
18847
  console: { port: 1422 },
18848
+ platform: {
18849
+ android: { stringResourcePaths: ["android/app/src/main/res/values/strings.xml"] },
18850
+ ios: { infoPlistPaths: ["ios/*/Info.plist"] }
18851
+ },
18848
18852
  nativeBuild: { android: {
18849
18853
  aab: true,
18850
18854
  variant: "Release",
@@ -20343,7 +20347,7 @@ const transformEnv = (filename, env$2) => {
20343
20347
 
20344
20348
  //#endregion
20345
20349
  //#region src/makeEnv.ts
20346
- const makeEnv = async (newEnvVars, filePath = ".env") => {
20350
+ const makeEnv = async (newEnvVars, filePath = ".env.hotupdater") => {
20347
20351
  try {
20348
20352
  const existingContent = await fs$1.readFile(filePath, "utf-8").catch(() => "");
20349
20353
  const lines = existingContent ? existingContent.split("\n") : [];
@@ -20388,7 +20392,7 @@ const makeEnv = async (newEnvVars, filePath = ".env") => {
20388
20392
  await fs$1.writeFile(filePath, updatedContent, "utf-8");
20389
20393
  return updatedContent;
20390
20394
  } catch (error) {
20391
- console.error("Error while updating .env file:", error);
20395
+ console.error("Error while updating .env.hotupdater file:", error);
20392
20396
  throw error;
20393
20397
  }
20394
20398
  };
@@ -29544,8 +29548,8 @@ var ConfigBuilder = class {
29544
29548
  collectedImports = /* @__PURE__ */ new Map();
29545
29549
  constructor() {
29546
29550
  this.addImport({
29547
- pkg: "dotenv/config",
29548
- sideEffect: true
29551
+ pkg: "dotenv",
29552
+ named: ["config"]
29549
29553
  });
29550
29554
  this.addImport({
29551
29555
  pkg: "hot-updater",
@@ -29643,6 +29647,8 @@ var ConfigBuilder = class {
29643
29647
  return `
29644
29648
  ${importStatements}
29645
29649
 
29650
+ config({ path: ".env.hotupdater" });
29651
+
29646
29652
  ${this.intermediateCode ? `${this.intermediateCode}\n` : ""}
29647
29653
  export default defineConfig({
29648
29654
  build: ${buildConfigString},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/plugin-core",
3
- "version": "0.20.0",
3
+ "version": "0.20.1",
4
4
  "type": "module",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "sideEffects": false,
@@ -45,7 +45,7 @@
45
45
  "cosmiconfig": "9.0.0",
46
46
  "cosmiconfig-typescript-loader": "5.0.0",
47
47
  "oxc-transform": "0.82.1",
48
- "@hot-updater/core": "0.20.0"
48
+ "@hot-updater/core": "0.20.1"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/node": "^22.7.5",
@@ -55,7 +55,7 @@
55
55
  "picocolors": "^1.0.0",
56
56
  "typescript": "5.8.2",
57
57
  "workspace-tools": "^0.36.4",
58
- "@hot-updater/plugin-core": "0.20.0"
58
+ "@hot-updater/plugin-core": "0.20.1"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "tsdown",