@capacitor/cli 5.7.6 → 5.7.8
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/assets/android-template.tar.gz +0 -0
- package/assets/capacitor-cordova-android-plugins.tar.gz +0 -0
- package/assets/capacitor-cordova-ios-plugins.tar.gz +0 -0
- package/assets/ios-template.tar.gz +0 -0
- package/dist/cordova.js +3 -3
- package/dist/tasks/run.js +15 -20
- package/dist/util/livereload.js +2 -0
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/cordova.js
CHANGED
|
@@ -556,7 +556,7 @@ async function getCordovaPreferences(config) {
|
|
|
556
556
|
return cordova;
|
|
557
557
|
}
|
|
558
558
|
exports.getCordovaPreferences = getCordovaPreferences;
|
|
559
|
-
async function writeCordovaAndroidManifest(cordovaPlugins, config, platform) {
|
|
559
|
+
async function writeCordovaAndroidManifest(cordovaPlugins, config, platform, cleartext) {
|
|
560
560
|
var _a;
|
|
561
561
|
const manifestPath = (0, path_1.join)(config.android.cordovaPluginsDirAbs, 'src', 'main', 'AndroidManifest.xml');
|
|
562
562
|
const rootXMLEntries = [];
|
|
@@ -781,14 +781,14 @@ async function writeCordovaAndroidManifest(cordovaPlugins, config, platform) {
|
|
|
781
781
|
});
|
|
782
782
|
});
|
|
783
783
|
const cleartextString = 'android:usesCleartextTraffic="true"';
|
|
784
|
-
const
|
|
784
|
+
const cleartextValue = (cleartext || ((_a = config.app.extConfig.server) === null || _a === void 0 ? void 0 : _a.cleartext)) &&
|
|
785
785
|
!applicationXMLAttributes.includes(cleartextString)
|
|
786
786
|
? cleartextString
|
|
787
787
|
: '';
|
|
788
788
|
let content = `<?xml version='1.0' encoding='utf-8'?>
|
|
789
789
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
790
790
|
xmlns:amazon="http://schemas.amazon.com/apk/res/android">
|
|
791
|
-
<application ${applicationXMLAttributes.join('\n')} ${
|
|
791
|
+
<application ${applicationXMLAttributes.join('\n')} ${cleartextValue}>
|
|
792
792
|
${applicationXMLEntries.join('\n')}
|
|
793
793
|
</application>
|
|
794
794
|
${rootXMLEntries.join('\n')}
|
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
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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',
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
}
|
package/dist/util/livereload.js
CHANGED
|
@@ -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