hot-updater 0.12.1 → 0.12.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.
package/dist/config.cjs CHANGED
@@ -28,7 +28,7 @@ __webpack_require__.r(__webpack_exports__);
28
28
  __webpack_require__.d(__webpack_exports__, {
29
29
  defineConfig: ()=>defineConfig
30
30
  });
31
- const defineConfig = async (config)=>"function" == typeof config ? await config() : config;
31
+ const defineConfig = async (config)=>config;
32
32
  var __webpack_export_target__ = exports;
33
33
  for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
34
34
  if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
package/dist/config.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import type { Config } from "@hot-updater/plugin-core";
2
- export declare const defineConfig: (config: Config | (() => Config) | (() => Promise<Config>)) => Promise<Config>;
1
+ import type { Config, HotUpdaterConfigOptions } from "@hot-updater/plugin-core";
2
+ export declare const defineConfig: (config: Config | ((options: HotUpdaterConfigOptions) => Config) | ((options: HotUpdaterConfigOptions) => Promise<Config>)) => Promise<Config | ((options: HotUpdaterConfigOptions) => Config) | ((options: HotUpdaterConfigOptions) => Promise<Config>)>;
package/dist/config.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import __rslib_shim_module__ from 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
- const defineConfig = async (config)=>"function" == typeof config ? await config() : config;
3
+ const defineConfig = async (config)=>config;
4
4
  export { defineConfig };
package/dist/index.cjs CHANGED
@@ -13920,7 +13920,9 @@ var __webpack_exports__ = {};
13920
13920
  const CONSOLE_DEFAULT_PORT = 1422;
13921
13921
  const getConsolePort = async (config)=>{
13922
13922
  let $config = config;
13923
- if (!$config) $config = await (0, plugin_core_namespaceObject.loadConfig)();
13923
+ if (!$config) $config = await (0, plugin_core_namespaceObject.loadConfig)({
13924
+ platform: "console"
13925
+ });
13924
13926
  return $config?.console?.port ?? CONSOLE_DEFAULT_PORT;
13925
13927
  };
13926
13928
  const openConsole = async (port, listeningListener)=>{
@@ -16056,11 +16058,6 @@ var __webpack_exports__ = {};
16056
16058
  };
16057
16059
  const deploy = async (options)=>{
16058
16060
  printBanner();
16059
- const config = await (0, plugin_core_namespaceObject.loadConfig)();
16060
- if (!config) {
16061
- console.error("No config found. Please run `hot-updater init` first.");
16062
- process.exit(1);
16063
- }
16064
16061
  const cwd = (0, plugin_core_namespaceObject.getCwd)();
16065
16062
  const [gitCommitHash, gitMessage] = await Promise.all([
16066
16063
  getGitCommitHash(),
@@ -16072,6 +16069,13 @@ var __webpack_exports__ = {};
16072
16069
  prompts_namespaceObject.log.error("Platform not found. -p <ios | android> or --platform <ios | android>");
16073
16070
  return;
16074
16071
  }
16072
+ const config = await (0, plugin_core_namespaceObject.loadConfig)({
16073
+ platform
16074
+ });
16075
+ if (!config) {
16076
+ console.error("No config found. Please run `hot-updater init` first.");
16077
+ process.exit(1);
16078
+ }
16075
16079
  const defaultTargetAppVersion = await getDefaultTargetAppVersion(cwd, platform) ?? "1.0.0";
16076
16080
  const targetAppVersion = options.targetAppVersion ?? (options.interactive ? await prompts_namespaceObject.text({
16077
16081
  message: "Target app version",
@@ -22783,7 +22787,7 @@ export default HotUpdater.wrap({
22783
22787
  }
22784
22788
  ]);
22785
22789
  if (!functionArn.arn || !functionArn.version) throw new Error("Failed to create or update Lambda function");
22786
- if (!functionArn.arn.includes(`:${functionArn.version}`)) functionArn.arn = `${functionArn.arn}:${functionArn.version}`;
22790
+ if (!functionArn.arn.endsWith(`:${functionArn.version}`)) functionArn.arn = `${functionArn.arn}:${functionArn.version}`;
22787
22791
  prompts_namespaceObject.log.info(`Using Lambda ARN: ${functionArn.arn}`);
22788
22792
  return {
22789
22793
  lambdaName,
package/dist/index.js CHANGED
@@ -13830,7 +13830,9 @@ var serve = (options, listeningListener)=>{
13830
13830
  const CONSOLE_DEFAULT_PORT = 1422;
13831
13831
  const getConsolePort = async (config)=>{
13832
13832
  let $config = config;
13833
- if (!$config) $config = await (0, __WEBPACK_EXTERNAL_MODULE__hot_updater_plugin_core_40c1c502__.loadConfig)();
13833
+ if (!$config) $config = await (0, __WEBPACK_EXTERNAL_MODULE__hot_updater_plugin_core_40c1c502__.loadConfig)({
13834
+ platform: "console"
13835
+ });
13834
13836
  return $config?.console?.port ?? CONSOLE_DEFAULT_PORT;
13835
13837
  };
13836
13838
  const openConsole = async (port, listeningListener)=>{
@@ -15951,11 +15953,6 @@ const printBanner = ()=>{
15951
15953
  };
15952
15954
  const deploy = async (options)=>{
15953
15955
  printBanner();
15954
- const config = await (0, __WEBPACK_EXTERNAL_MODULE__hot_updater_plugin_core_40c1c502__.loadConfig)();
15955
- if (!config) {
15956
- console.error("No config found. Please run `hot-updater init` first.");
15957
- process.exit(1);
15958
- }
15959
15956
  const cwd = (0, __WEBPACK_EXTERNAL_MODULE__hot_updater_plugin_core_40c1c502__.getCwd)();
15960
15957
  const [gitCommitHash, gitMessage] = await Promise.all([
15961
15958
  getGitCommitHash(),
@@ -15967,6 +15964,13 @@ const deploy = async (options)=>{
15967
15964
  __WEBPACK_EXTERNAL_MODULE__clack_prompts_3cae1695__.log.error("Platform not found. -p <ios | android> or --platform <ios | android>");
15968
15965
  return;
15969
15966
  }
15967
+ const config = await (0, __WEBPACK_EXTERNAL_MODULE__hot_updater_plugin_core_40c1c502__.loadConfig)({
15968
+ platform
15969
+ });
15970
+ if (!config) {
15971
+ console.error("No config found. Please run `hot-updater init` first.");
15972
+ process.exit(1);
15973
+ }
15970
15974
  const defaultTargetAppVersion = await getDefaultTargetAppVersion(cwd, platform) ?? "1.0.0";
15971
15975
  const targetAppVersion = options.targetAppVersion ?? (options.interactive ? await __WEBPACK_EXTERNAL_MODULE__clack_prompts_3cae1695__.text({
15972
15976
  message: "Target app version",
@@ -22672,7 +22676,7 @@ const deployLambdaEdge = async (credentials, lambdaRoleArn)=>{
22672
22676
  }
22673
22677
  ]);
22674
22678
  if (!functionArn.arn || !functionArn.version) throw new Error("Failed to create or update Lambda function");
22675
- if (!functionArn.arn.includes(`:${functionArn.version}`)) functionArn.arn = `${functionArn.arn}:${functionArn.version}`;
22679
+ if (!functionArn.arn.endsWith(`:${functionArn.version}`)) functionArn.arn = `${functionArn.arn}:${functionArn.version}`;
22676
22680
  __WEBPACK_EXTERNAL_MODULE__clack_prompts_3cae1695__.log.info(`Using Lambda ARN: ${functionArn.arn}`);
22677
22681
  return {
22678
22682
  lambdaName,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hot-updater",
3
3
  "type": "module",
4
- "version": "0.12.1",
4
+ "version": "0.12.3",
5
5
  "bin": {
6
6
  "hot-updater": "./dist/index.js"
7
7
  },
@@ -49,9 +49,9 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@clack/prompts": "^0.9.0",
52
- "@hot-updater/console": "0.12.1",
53
- "@hot-updater/core": "0.12.1",
54
- "@hot-updater/plugin-core": "0.12.1",
52
+ "@hot-updater/console": "0.12.3",
53
+ "@hot-updater/core": "0.12.3",
54
+ "@hot-updater/plugin-core": "0.12.3",
55
55
  "commander": "^11.1.0",
56
56
  "cosmiconfig": "^9.0.0",
57
57
  "cosmiconfig-typescript-loader": "^5.0.0"