Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: bump eslint w/ lint fix & rebuilt package-lock #869

Merged
merged 1 commit into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/templates/scripts/cordova/Api.js
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ Api.prototype.setSwiftVersionForCocoaPodsLibraries = function (podsjsonFile) {
.map(buildConfiguration => buildConfiguration.value)
.forEach(buildId => {
__dirty = true;
podConfigs[buildId].buildSettings['SWIFT_VERSION'] = swiftVersion;
podConfigs[buildId].buildSettings.SWIFT_VERSION = swiftVersion;
});
}
});
Expand Down
2 changes: 1 addition & 1 deletion bin/templates/scripts/cordova/lib/Podfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ Podfile.prototype.write = function () {
.map(tag => `:${tag} => '${json[tag]}'`);

if ('configurations' in json) {
options.push(`:configurations => [${json['configurations'].split(',').map(conf => `'${conf.trim()}'`).join(',')}]`);
options.push(`:configurations => [${json.configurations.split(',').map(conf => `'${conf.trim()}'`).join(',')}]`);
}
if ('options' in json) {
options = [json.options];
Expand Down
46 changes: 23 additions & 23 deletions bin/templates/scripts/cordova/lib/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,24 +190,24 @@ function updateProject (platformConfig, locations) {
const infoPlist = plist.parse(fs.readFileSync(plistFile, 'utf8'));

// Update version (bundle version)
infoPlist['CFBundleShortVersionString'] = version;
infoPlist.CFBundleShortVersionString = version;
const CFBundleVersion = platformConfig.getAttribute('ios-CFBundleVersion') || default_CFBundleVersion(version);
infoPlist['CFBundleVersion'] = CFBundleVersion;
infoPlist.CFBundleVersion = CFBundleVersion;

if (platformConfig.getAttribute('defaultlocale')) {
infoPlist['CFBundleDevelopmentRegion'] = platformConfig.getAttribute('defaultlocale');
infoPlist.CFBundleDevelopmentRegion = platformConfig.getAttribute('defaultlocale');
}

if (displayName) {
infoPlist['CFBundleDisplayName'] = displayName;
infoPlist.CFBundleDisplayName = displayName;
}

// replace Info.plist ATS entries according to <access> and <allow-navigation> config.xml entries
const ats = writeATSEntries(platformConfig);
if (Object.keys(ats).length > 0) {
infoPlist['NSAppTransportSecurity'] = ats;
infoPlist.NSAppTransportSecurity = ats;
} else {
delete infoPlist['NSAppTransportSecurity'];
delete infoPlist.NSAppTransportSecurity;
}

handleOrientationSettings(platformConfig, infoPlist);
Expand Down Expand Up @@ -242,24 +242,24 @@ function updateProject (platformConfig, locations) {
function handleOrientationSettings (platformConfig, infoPlist) {
switch (getOrientationValue(platformConfig)) {
case 'portrait':
infoPlist['UIInterfaceOrientation'] = ['UIInterfaceOrientationPortrait'];
infoPlist['UISupportedInterfaceOrientations'] = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown'];
infoPlist.UIInterfaceOrientation = ['UIInterfaceOrientationPortrait'];
infoPlist.UISupportedInterfaceOrientations = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown'];
infoPlist['UISupportedInterfaceOrientations~ipad'] = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown'];
break;
case 'landscape':
infoPlist['UIInterfaceOrientation'] = ['UIInterfaceOrientationLandscapeLeft'];
infoPlist['UISupportedInterfaceOrientations'] = ['UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight'];
infoPlist.UIInterfaceOrientation = ['UIInterfaceOrientationLandscapeLeft'];
infoPlist.UISupportedInterfaceOrientations = ['UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight'];
infoPlist['UISupportedInterfaceOrientations~ipad'] = ['UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight'];
break;
case 'all':
infoPlist['UIInterfaceOrientation'] = ['UIInterfaceOrientationPortrait'];
infoPlist['UISupportedInterfaceOrientations'] = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight'];
infoPlist.UIInterfaceOrientation = ['UIInterfaceOrientationPortrait'];
infoPlist.UISupportedInterfaceOrientations = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight'];
infoPlist['UISupportedInterfaceOrientations~ipad'] = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight'];
break;
case 'default':
infoPlist['UISupportedInterfaceOrientations'] = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight'];
infoPlist.UISupportedInterfaceOrientations = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight'];
infoPlist['UISupportedInterfaceOrientations~ipad'] = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight'];
delete infoPlist['UIInterfaceOrientation'];
delete infoPlist.UIInterfaceOrientation;
}
}

Expand Down Expand Up @@ -461,7 +461,7 @@ function alertDeprecatedPreference (configParser) {
if (newPreferenceKey) {
log.push(`It is recommended to replace this preference with "${newPreferenceKey}."`);
} else {
log.push(`There is no replacement for this preference.`);
log.push('There is no replacement for this preference.');
}

/**
Expand All @@ -472,7 +472,7 @@ function alertDeprecatedPreference (configParser) {
* Typically caused by implementation nature or third-party requirement changes.
*/
if (!isDeprecated) {
log.push(`Please note that this preference will be removed in the near future.`);
log.push('Please note that this preference will be removed in the near future.');
}

events.emit('warn', log.join(' '));
Expand Down Expand Up @@ -957,17 +957,17 @@ function writeATSEntries (config) {
if (hostname === '*') {
// always write this, for iOS 9, since in iOS 10 it will be overriden if
// any of the other three keys are written
ats['NSAllowsArbitraryLoads'] = true;
ats.NSAllowsArbitraryLoads = true;

// at least one of the overriding keys is present
if (entry.NSAllowsArbitraryLoadsInWebContent) {
ats['NSAllowsArbitraryLoadsInWebContent'] = true;
ats.NSAllowsArbitraryLoadsInWebContent = true;
}
if (entry.NSAllowsArbitraryLoadsForMedia) {
ats['NSAllowsArbitraryLoadsForMedia'] = true;
ats.NSAllowsArbitraryLoadsForMedia = true;
}
if (entry.NSAllowsLocalNetworking) {
ats['NSAllowsLocalNetworking'] = true;
ats.NSAllowsLocalNetworking = true;
}

continue;
Expand All @@ -981,11 +981,11 @@ function writeATSEntries (config) {
}
}

if (!ats['NSExceptionDomains']) {
ats['NSExceptionDomains'] = {};
if (!ats.NSExceptionDomains) {
ats.NSExceptionDomains = {};
}

ats['NSExceptionDomains'][hostname] = exceptionDomain;
ats.NSExceptionDomains[hostname] = exceptionDomain;
}
}

Expand Down
Loading