@capacitor/cli 3.3.3 → 3.3.4

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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.3.4](https://github.com/ionic-team/capacitor/compare/3.3.3...3.3.4) (2022-01-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **cli:** Escape appName from invalid characters on add ([#5325](https://github.com/ionic-team/capacitor/issues/5325)) ([033f4ee](https://github.com/ionic-team/capacitor/commit/033f4eef59fdb7cc32018b162114511448bc46a6))
12
+ * **cli:** sync failing if Info.plist is localized ([#5333](https://github.com/ionic-team/capacitor/issues/5333)) ([df7a104](https://github.com/ionic-team/capacitor/commit/df7a1041c4e2d9a5a1ceef247ed00f9f8467df76))
13
+
14
+
15
+
16
+
17
+
6
18
  ## [3.3.3](https://github.com/ionic-team/capacitor/compare/3.3.2...3.3.3) (2021-12-08)
7
19
 
8
20
 
Binary file
Binary file
@@ -56,7 +56,11 @@ exports.resolvePlugin = resolvePlugin;
56
56
  */
57
57
  async function editProjectSettingsAndroid(config) {
58
58
  const appId = config.app.appId;
59
- const appName = config.app.appName;
59
+ const appName = config.app.appName
60
+ .replace(/&/g, '&')
61
+ .replace(/</g, '&lt;')
62
+ .replace(/"/g, '\\"')
63
+ .replace(/'/g, "\\'");
60
64
  const manifestPath = path_1.resolve(config.android.srcMainDirAbs, 'AndroidManifest.xml');
61
65
  const buildGradlePath = path_1.resolve(config.android.appDirAbs, 'build.gradle');
62
66
  let manifestContent = await utils_fs_1.readFile(manifestPath, { encoding: 'utf-8' });
@@ -89,7 +93,7 @@ async function editProjectSettingsAndroid(config) {
89
93
  const stringsPath = path_1.resolve(config.android.resDirAbs, 'values/strings.xml');
90
94
  let stringsContent = await utils_fs_1.readFile(stringsPath, { encoding: 'utf-8' });
91
95
  stringsContent = stringsContent.replace(/com.getcapacitor.myapp/g, appId);
92
- stringsContent = stringsContent.replace(/My App/g, appName.replace(/'/g, `\\'`));
96
+ stringsContent = stringsContent.replace(/My App/g, appName);
93
97
  await utils_fs_1.writeFile(stringsPath, stringsContent);
94
98
  }
95
99
  exports.editProjectSettingsAndroid = editProjectSettingsAndroid;
package/dist/cordova.js CHANGED
@@ -263,38 +263,46 @@ async function logCordovaManualSteps(cordovaPlugins, config, platform) {
263
263
  }
264
264
  exports.logCordovaManualSteps = logCordovaManualSteps;
265
265
  async function logiOSPlist(configElement, config, plugin) {
266
- const plistPath = path_1.resolve(config.ios.nativeTargetDirAbs, 'Info.plist');
267
- const xmlMeta = await xml_1.readXML(plistPath);
268
- const data = await utils_fs_1.readFile(plistPath, { encoding: 'utf-8' });
269
- const plistData = plist_1.default.parse(data);
270
- const dict = xmlMeta.plist.dict.pop();
271
- if (!dict.key.includes(configElement.$.parent)) {
272
- let xml = buildConfigFileXml(configElement);
273
- xml = `<key>${configElement.$.parent}</key>${getConfigFileTagContent(xml)}`;
274
- log_1.logger.warn(`Configuration required for ${colors_1.default.strong(plugin.id)}.\n` +
275
- `Add the following to Info.plist:\n` +
276
- xml);
266
+ let plistPath = path_1.resolve(config.ios.nativeTargetDirAbs, 'Info.plist');
267
+ if (!(await utils_fs_1.pathExists(plistPath))) {
268
+ plistPath = path_1.resolve(config.ios.nativeTargetDirAbs, 'Base.lproj', 'Info.plist');
277
269
  }
278
- else if (configElement.array || configElement.dict) {
279
- if (configElement.array &&
280
- configElement.array.length > 0 &&
281
- configElement.array[0].string) {
282
- let xml = '';
283
- configElement.array[0].string.map((element) => {
284
- const d = plistData[configElement.$.parent];
285
- if (Array.isArray(d) && !d.includes(element)) {
286
- xml = xml.concat(`<string>${element}</string>\n`);
270
+ if (await utils_fs_1.pathExists(plistPath)) {
271
+ const xmlMeta = await xml_1.readXML(plistPath);
272
+ const data = await utils_fs_1.readFile(plistPath, { encoding: 'utf-8' });
273
+ const plistData = plist_1.default.parse(data);
274
+ const dict = xmlMeta.plist.dict.pop();
275
+ if (!dict.key.includes(configElement.$.parent)) {
276
+ let xml = buildConfigFileXml(configElement);
277
+ xml = `<key>${configElement.$.parent}</key>${getConfigFileTagContent(xml)}`;
278
+ log_1.logger.warn(`Configuration required for ${colors_1.default.strong(plugin.id)}.\n` +
279
+ `Add the following to Info.plist:\n` +
280
+ xml);
281
+ }
282
+ else if (configElement.array || configElement.dict) {
283
+ if (configElement.array &&
284
+ configElement.array.length > 0 &&
285
+ configElement.array[0].string) {
286
+ let xml = '';
287
+ configElement.array[0].string.map((element) => {
288
+ const d = plistData[configElement.$.parent];
289
+ if (Array.isArray(d) && !d.includes(element)) {
290
+ xml = xml.concat(`<string>${element}</string>\n`);
291
+ }
292
+ });
293
+ if (xml.length > 0) {
294
+ log_1.logger.warn(`Configuration required for ${colors_1.default.strong(plugin.id)}.\n` +
295
+ `Add the following in the existing ${colors_1.default.strong(configElement.$.parent)} array of your Info.plist:\n` +
296
+ xml);
287
297
  }
288
- });
289
- if (xml.length > 0) {
290
- log_1.logger.warn(`Configuration required for ${colors_1.default.strong(plugin.id)}.\n` +
291
- `Add the following in the existing ${colors_1.default.strong(configElement.$.parent)} array of your Info.plist:\n` +
292
- xml);
298
+ }
299
+ else {
300
+ logPossibleMissingItem(configElement, plugin);
293
301
  }
294
302
  }
295
- else {
296
- logPossibleMissingItem(configElement, plugin);
297
- }
303
+ }
304
+ else {
305
+ logPossibleMissingItem(configElement, plugin);
298
306
  }
299
307
  }
300
308
  function logPossibleMissingItem(configElement, plugin) {
@@ -58,7 +58,10 @@ exports.resolvePlugin = resolvePlugin;
58
58
  */
59
59
  async function editProjectSettingsIOS(config) {
60
60
  const appId = config.app.appId;
61
- const appName = config.app.appName;
61
+ const appName = config.app.appName
62
+ .replace(/&/g, '&amp;')
63
+ .replace(/</g, '&lt;')
64
+ .replace(/>/g, '&gt;');
62
65
  const pbxPath = `${config.ios.nativeXcodeProjDirAbs}/project.pbxproj`;
63
66
  const plistPath = path_1.resolve(config.ios.nativeTargetDirAbs, 'Info.plist');
64
67
  let plistContent = await utils_fs_1.readFile(plistPath, { encoding: 'utf-8' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/cli",
3
- "version": "3.3.3",
3
+ "version": "3.3.4",
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)",
@@ -85,5 +85,5 @@
85
85
  "publishConfig": {
86
86
  "access": "public"
87
87
  },
88
- "gitHead": "cd8221ed0162454d2ee01dc3bc164de38a81bf43"
88
+ "gitHead": "bf215b19e0c8186a9124491073feb16f3273a2f9"
89
89
  }