@capacitor/cli 6.1.1-nightly-20240716T150438.0 → 6.1.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.
Binary file
Binary file
Binary file
package/dist/cordova.js CHANGED
@@ -498,6 +498,7 @@ function needsStaticPod(plugin, config) {
498
498
  'onesignal-cordova-plugin',
499
499
  ];
500
500
  if ((_b = (_a = config.app.extConfig) === null || _a === void 0 ? void 0 : _a.cordova) === null || _b === void 0 ? void 0 : _b.staticPlugins) {
501
+ log_1.logger.warn('cordova.staticPlugins is deprecated, make sure you are using latest version of the plugin');
501
502
  pluginList = pluginList.concat((_d = (_c = config.app.extConfig) === null || _c === void 0 ? void 0 : _c.cordova) === null || _d === void 0 ? void 0 : _d.staticPlugins);
502
503
  }
503
504
  return pluginList.includes(plugin.id) || useFrameworks(plugin);
@@ -556,7 +557,7 @@ async function getCordovaPreferences(config) {
556
557
  return cordova;
557
558
  }
558
559
  exports.getCordovaPreferences = getCordovaPreferences;
559
- async function writeCordovaAndroidManifest(cordovaPlugins, config, platform) {
560
+ async function writeCordovaAndroidManifest(cordovaPlugins, config, platform, cleartext) {
560
561
  var _a;
561
562
  const manifestPath = (0, path_1.join)(config.android.cordovaPluginsDirAbs, 'src', 'main', 'AndroidManifest.xml');
562
563
  const rootXMLEntries = [];
@@ -781,14 +782,14 @@ async function writeCordovaAndroidManifest(cordovaPlugins, config, platform) {
781
782
  });
782
783
  });
783
784
  const cleartextString = 'android:usesCleartextTraffic="true"';
784
- const cleartext = ((_a = config.app.extConfig.server) === null || _a === void 0 ? void 0 : _a.cleartext) &&
785
+ const cleartextValue = (cleartext || ((_a = config.app.extConfig.server) === null || _a === void 0 ? void 0 : _a.cleartext)) &&
785
786
  !applicationXMLAttributes.includes(cleartextString)
786
787
  ? cleartextString
787
788
  : '';
788
789
  let content = `<?xml version='1.0' encoding='utf-8'?>
789
790
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
790
791
  xmlns:amazon="http://schemas.amazon.com/apk/res/android">
791
- <application ${applicationXMLAttributes.join('\n')} ${cleartext}>
792
+ <application ${applicationXMLAttributes.join('\n')} ${cleartextValue}>
792
793
  ${applicationXMLEntries.join('\n')}
793
794
  </application>
794
795
  ${rootXMLEntries.join('\n')}
@@ -527,7 +527,10 @@ export interface CapacitorConfig {
527
527
  * List of Cordova plugins that need to be static but are not
528
528
  * already in the static plugin list.
529
529
  *
530
+ * It's deprecated and will be removed in Capacitor 7
531
+ *
530
532
  * @since 3.3.0
533
+ * @deprecated 6.1.1
531
534
  */
532
535
  staticPlugins?: string[];
533
536
  };
package/dist/tasks/run.js CHANGED
@@ -7,6 +7,7 @@ const utils_terminal_1 = require("@ionic/utils-terminal");
7
7
  const run_1 = require("../android/run");
8
8
  const colors_1 = tslib_1.__importDefault(require("../colors"));
9
9
  const common_1 = require("../common");
10
+ const cordova_1 = require("../cordova");
10
11
  const errors_1 = require("../errors");
11
12
  const run_2 = require("../ios/run");
12
13
  const log_1 = require("../log");
@@ -61,32 +62,26 @@ async function runCommand(config, selectedPlatformName, options) {
61
62
  }
62
63
  try {
63
64
  if (options.sync) {
64
- if (options.liveReload) {
65
- const newExtConfig = await livereload_1.CapLiveReloadHelper.editExtConfigForLiveReload(config, platformName, options);
66
- const cfg = config;
67
- const cfgapp = config.app;
68
- cfgapp.extConfig = newExtConfig;
69
- cfg.app = cfgapp;
70
- await (0, sync_1.sync)(cfg, platformName, false, true);
71
- }
72
- else {
73
- await (0, sync_1.sync)(config, platformName, false, true);
74
- }
65
+ await (0, sync_1.sync)(config, platformName, false, true);
75
66
  }
76
- else {
77
- if (options.liveReload) {
78
- await livereload_1.CapLiveReloadHelper.editCapConfigForLiveReload(config, platformName, options);
67
+ const cordovaPlugins = await (0, cordova_1.getCordovaPlugins)(config, platformName);
68
+ if (options.liveReload) {
69
+ await livereload_1.CapLiveReloadHelper.editCapConfigForLiveReload(config, platformName, options);
70
+ if (platformName === config.android.name) {
71
+ await await (0, cordova_1.writeCordovaAndroidManifest)(cordovaPlugins, config, platformName, true);
79
72
  }
80
73
  }
81
74
  await run(config, platformName, options);
82
75
  if (options.liveReload) {
83
- process.on('SIGINT', async () => {
84
- if (options.liveReload) {
85
- await livereload_1.CapLiveReloadHelper.revertCapConfigForLiveReload();
76
+ new Promise(resolve => process.on('SIGINT', resolve))
77
+ .then(async () => {
78
+ await livereload_1.CapLiveReloadHelper.revertCapConfigForLiveReload();
79
+ if (platformName === config.android.name) {
80
+ await (0, cordova_1.writeCordovaAndroidManifest)(cordovaPlugins, config, platformName, false);
86
81
  }
87
- process.exit();
88
- });
89
- console.log(`\nApp running with live reload listing for: http://${options.host}:${options.port}. Press Ctrl+C to quit.`);
82
+ })
83
+ .then(() => process.exit());
84
+ log_1.logger.info(`App running with live reload listing for: http://${options.host}:${options.port}. Press Ctrl+C to quit.`);
90
85
  await (0, utils_process_1.sleepForever)();
91
86
  }
92
87
  }
@@ -95,6 +95,7 @@ class CapLiveReload {
95
95
  .filter(Boolean);
96
96
  return !all.length ? loopback(family) : all[0];
97
97
  }
98
+ // TODO remove on next major as it's unused
98
99
  async editExtConfigForLiveReload(config, platformName, options, rootConfigChange = false) {
99
100
  const platformAbsPath = platformName == config.ios.name
100
101
  ? config.ios.nativeTargetDirAbs
@@ -115,6 +116,7 @@ class CapLiveReload {
115
116
  };
116
117
  return configJson;
117
118
  }
119
+ // TODO remove rootConfigChange param on next major as it's unused
118
120
  async editCapConfigForLiveReload(config, platformName, options, rootConfigChange = false) {
119
121
  const platformAbsPath = platformName == config.ios.name
120
122
  ? config.ios.nativeTargetDirAbs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/cli",
3
- "version": "6.1.1-nightly-20240716T150438.0",
3
+ "version": "6.1.1",
4
4
  "description": "Capacitor: Cross-platform apps with JavaScript and the web",
5
5
  "homepage": "https://capacitorjs.com",
6
6
  "author": "Ionic Team <hi@ionic.io> (https://ionic.io)",