Compare commits

...
Author SHA1 Message Date
semantic-release-bot 72fa3e14ef chore: 1.2.2
### @config-plugins/detox [1.2.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)

### Bug Fixes

* **detox:** use improved xml generation ([#47](https://github.com/expo/config-plugins/issues/47)) ([6324eb0](https://github.com/expo/config-plugins/commit/6324eb041b3b4eb2318c0a1ea0297e3b7bf28f7c))
2022-03-16 21:31:07 +00:00
Maurice DoepkeandMaurice Döpke 6324eb041b fix(detox): use improved xml generation (#47)
* fix xml generation

generate xml without space or new line in the beginning

* remove indentation

* update snapshots to no indentation

* add built file

Co-authored-by: Maurice Döpke <mauricedoepkeoutlook.de>
2022-03-16 16:27:57 -05:00
5 changed files with 34 additions and 25 deletions

No files matched your search

+7
View File
@@ -1,3 +1,10 @@
### @config-plugins/detox [1.2.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
### Bug Fixes
* **detox:** use improved xml generation ([#47](https://github.com/expo/config-plugins/issues/47)) ([6324eb0](https://github.com/expo/config-plugins/commit/6324eb041b3b4eb2318c0a1ea0297e3b7bf28f7c))
### @config-plugins/detox [1.2.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
+9 -6
View File
@@ -42,12 +42,15 @@ function getTemplateConfigContent(subdomains) {
}
function getTemplateFile(subdomains) {
const content = getTemplateConfigContent(subdomains);
return `
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
${content}
</network-security-config>
`;
/**
* May not have new lines or spaces in the beginning.
* Otherwise build fails with:
* "AAPT: error: XML or text declaration not at start of entity"
*/
return `<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
${content}
</network-security-config>`;
}
exports.getTemplateFile = getTemplateFile;
/**
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@config-plugins/detox",
"version": "1.2.1",
"version": "1.2.2",
"description": "Config plugin to auto configure detox on prebuild",
"main": "build/withDetox.js",
"types": "build/withDetox.d.ts",
@@ -1,25 +1,21 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`getTemplateFile returns domain-config when subdomains is an array 1`] = `
"
<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
<network-security-config>
"<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
<network-security-config>
<domain-config cleartextTrafficPermitted=\\"true\\">
<domain includeSubdomains=\\"true\\">localhost</domain>
</domain-config>
</network-security-config>
"
</network-security-config>"
`;
exports[`getTemplateFile returns only base-config when subdomains is '*' 1`] = `
"
<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
<network-security-config>
<base-config cleartextTrafficPermitted=\\"true\\" />
</network-security-config>
"
"<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
<network-security-config>
<base-config cleartextTrafficPermitted=\\"true\\" />
</network-security-config>"
`;
exports[`withNetworkSecurityConfigManifest doesn't modify config if subdomains is an empty array 1`] = `
@@ -29,12 +29,15 @@ function getTemplateConfigContent(subdomains: SubdomainsType) {
export function getTemplateFile(subdomains: SubdomainsType): string {
const content = getTemplateConfigContent(subdomains);
return `
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
${content}
</network-security-config>
`;
/**
* May not have new lines or spaces in the beginning.
* Otherwise build fails with:
* "AAPT: error: XML or text declaration not at start of entity"
*/
return `<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
${content}
</network-security-config>`;
}
/**