@expo/config-plugins
Advanced tools
Comparing version 3.0.8 to 3.1.0
@@ -52,6 +52,6 @@ "use strict"; | ||
function WarningAggregator() { | ||
const data = _interopRequireWildcard(require("../utils/warnings")); | ||
function _warnings() { | ||
const data = require("../utils/warnings"); | ||
WarningAggregator = function () { | ||
_warnings = function () { | ||
return data; | ||
@@ -63,6 +63,2 @@ }; | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -81,3 +77,3 @@ | ||
} else { | ||
WarningAggregator().addWarningAndroid('android-google-services', `Cannot automatically configure project build.gradle if it's not groovy`); | ||
(0, _warnings().addWarningAndroid)('android.googleServicesFile', `Cannot automatically configure project build.gradle if it's not groovy`); | ||
} | ||
@@ -96,3 +92,3 @@ | ||
} else { | ||
WarningAggregator().addWarningAndroid('android-google-services', `Cannot automatically configure app build.gradle if it's not groovy`); | ||
(0, _warnings().addWarningAndroid)('android.googleServicesFile', `Cannot automatically configure app build.gradle if it's not groovy`); | ||
} | ||
@@ -99,0 +95,0 @@ |
@@ -113,2 +113,3 @@ export declare type StringBoolean = 'true' | 'false'; | ||
export declare function getMainActivityOrThrow(androidManifest: AndroidManifest): ManifestActivity; | ||
export declare function getRunnableActivity(androidManifest: AndroidManifest): ManifestActivity | null; | ||
export declare function getMainActivity(androidManifest: AndroidManifest): ManifestActivity | null; | ||
@@ -115,0 +116,0 @@ export declare function addMetaDataItemToMainApplication(mainApplication: ManifestApplication, itemName: string, itemValue: string, itemType?: 'resource' | 'value'): ManifestApplication; |
@@ -11,2 +11,3 @@ "use strict"; | ||
exports.getMainActivityOrThrow = getMainActivityOrThrow; | ||
exports.getRunnableActivity = getRunnableActivity; | ||
exports.getMainActivity = getMainActivity; | ||
@@ -113,6 +114,32 @@ exports.addMetaDataItemToMainApplication = addMetaDataItemToMainApplication; | ||
function getRunnableActivity(androidManifest) { | ||
var _androidManifest$mani4, _androidManifest$mani5, _androidManifest$mani6, _androidManifest$mani7, _androidManifest$mani8; | ||
// Get enabled activities | ||
const enabledActivities = androidManifest === null || androidManifest === void 0 ? void 0 : (_androidManifest$mani4 = androidManifest.manifest) === null || _androidManifest$mani4 === void 0 ? void 0 : (_androidManifest$mani5 = _androidManifest$mani4.application) === null || _androidManifest$mani5 === void 0 ? void 0 : (_androidManifest$mani6 = _androidManifest$mani5[0]) === null || _androidManifest$mani6 === void 0 ? void 0 : (_androidManifest$mani7 = _androidManifest$mani6.activity) === null || _androidManifest$mani7 === void 0 ? void 0 : (_androidManifest$mani8 = _androidManifest$mani7.filter) === null || _androidManifest$mani8 === void 0 ? void 0 : _androidManifest$mani8.call(_androidManifest$mani7, e => e.$['android:enabled'] !== 'false' && e.$['android:enabled'] !== false); | ||
if (!enabledActivities) { | ||
return null; | ||
} // Get the activity that has a runnable intent-filter | ||
for (const activity of enabledActivities) { | ||
if (Array.isArray(activity['intent-filter'])) { | ||
for (const intentFilter of activity['intent-filter']) { | ||
var _intentFilter$action, _intentFilter$categor; | ||
if ((_intentFilter$action = intentFilter.action) !== null && _intentFilter$action !== void 0 && _intentFilter$action.find(action => action.$['android:name'] === 'android.intent.action.MAIN') && (_intentFilter$categor = intentFilter.category) !== null && _intentFilter$categor !== void 0 && _intentFilter$categor.find(category => category.$['android:name'] === 'android.intent.category.LAUNCHER')) { | ||
return activity; | ||
} | ||
} | ||
} | ||
} | ||
return null; | ||
} | ||
function getMainActivity(androidManifest) { | ||
var _androidManifest$mani4, _androidManifest$mani5, _androidManifest$mani6, _androidManifest$mani7, _androidManifest$mani8, _mainActivity$; | ||
var _androidManifest$mani9, _androidManifest$mani10, _androidManifest$mani11, _androidManifest$mani12, _androidManifest$mani13, _mainActivity$; | ||
const mainActivity = androidManifest === null || androidManifest === void 0 ? void 0 : (_androidManifest$mani4 = androidManifest.manifest) === null || _androidManifest$mani4 === void 0 ? void 0 : (_androidManifest$mani5 = _androidManifest$mani4.application) === null || _androidManifest$mani5 === void 0 ? void 0 : (_androidManifest$mani6 = _androidManifest$mani5[0]) === null || _androidManifest$mani6 === void 0 ? void 0 : (_androidManifest$mani7 = _androidManifest$mani6.activity) === null || _androidManifest$mani7 === void 0 ? void 0 : (_androidManifest$mani8 = _androidManifest$mani7.filter) === null || _androidManifest$mani8 === void 0 ? void 0 : _androidManifest$mani8.call(_androidManifest$mani7, e => e.$['android:name'] === '.MainActivity'); | ||
const mainActivity = androidManifest === null || androidManifest === void 0 ? void 0 : (_androidManifest$mani9 = androidManifest.manifest) === null || _androidManifest$mani9 === void 0 ? void 0 : (_androidManifest$mani10 = _androidManifest$mani9.application) === null || _androidManifest$mani10 === void 0 ? void 0 : (_androidManifest$mani11 = _androidManifest$mani10[0]) === null || _androidManifest$mani11 === void 0 ? void 0 : (_androidManifest$mani12 = _androidManifest$mani11.activity) === null || _androidManifest$mani12 === void 0 ? void 0 : (_androidManifest$mani13 = _androidManifest$mani12.filter) === null || _androidManifest$mani13 === void 0 ? void 0 : _androidManifest$mani13.call(_androidManifest$mani12, e => e.$['android:name'] === '.MainActivity'); | ||
return (_mainActivity$ = mainActivity === null || mainActivity === void 0 ? void 0 : mainActivity[0]) !== null && _mainActivity$ !== void 0 ? _mainActivity$ : null; | ||
@@ -119,0 +146,0 @@ } |
@@ -71,3 +71,3 @@ "use strict"; | ||
} else { | ||
(0, _warnings().addWarningAndroid)('android-name-settings-gradle', `Cannot automatically configure settings.gradle if it's not groovy`); | ||
(0, _warnings().addWarningAndroid)('name', `Cannot automatically configure settings.gradle if it's not groovy`); | ||
} | ||
@@ -74,0 +74,0 @@ |
@@ -23,6 +23,6 @@ "use strict"; | ||
function WarningAggregator() { | ||
const data = _interopRequireWildcard(require("../utils/warnings")); | ||
function _warnings() { | ||
const data = require("../utils/warnings"); | ||
WarningAggregator = function () { | ||
_warnings = function () { | ||
return data; | ||
@@ -64,6 +64,2 @@ }; | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const NAVIGATION_BAR_COLOR = 'navigationBarColor'; | ||
@@ -77,3 +73,3 @@ | ||
// TODO: Resolve | ||
WarningAggregator().addWarningAndroid('androidNavigationBar.visible', 'Hiding the navigation bar must be done programmatically. Refer to the Android documentation - https://developer.android.com/training/system-ui/immersive - for instructions.'); | ||
(0, _warnings().addWarningAndroid)('androidNavigationBar.visible', 'Hiding the navigation bar must be done programmatically', 'https://developer.android.com/training/system-ui/immersive'); | ||
} | ||
@@ -80,0 +76,0 @@ |
@@ -84,6 +84,6 @@ "use strict"; | ||
function WarningAggregator() { | ||
const data = _interopRequireWildcard(require("../utils/warnings")); | ||
function _warnings() { | ||
const data = require("../utils/warnings"); | ||
WarningAggregator = function () { | ||
_warnings = function () { | ||
return data; | ||
@@ -105,6 +105,2 @@ }; | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -121,3 +117,3 @@ | ||
} else { | ||
WarningAggregator().addWarningAndroid('android-package', `Cannot automatically configure app build.gradle if it's not groovy`); | ||
(0, _warnings().addWarningAndroid)('android.package', `Cannot automatically configure app build.gradle if it's not groovy`); | ||
} | ||
@@ -124,0 +120,0 @@ |
@@ -25,6 +25,6 @@ "use strict"; | ||
function WarningAggregator() { | ||
const data = _interopRequireWildcard(require("../utils/warnings")); | ||
function _warnings() { | ||
const data = require("../utils/warnings"); | ||
WarningAggregator = function () { | ||
_warnings = function () { | ||
return data; | ||
@@ -36,6 +36,2 @@ }; | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const withScheme = (0, _androidPlugins().createAndroidManifestPlugin)(setScheme, 'withScheme'); | ||
@@ -74,3 +70,3 @@ exports.withScheme = withScheme; | ||
if (!ensureManifestHasValidIntentFilter(androidManifest)) { | ||
WarningAggregator().addWarningAndroid('scheme', `Cannot add schemes because the provided manifest does not have a valid Activity with \`android:launchMode="singleTask"\`.\nThis guide can help you get setup properly https://expo.fyi/setup-android-uri-scheme`); | ||
(0, _warnings().addWarningAndroid)('scheme', `Cannot add schemes because the provided manifest does not have a valid Activity with \`android:launchMode="singleTask"\``, 'https://expo.fyi/setup-android-uri-scheme'); | ||
return androidManifest; | ||
@@ -77,0 +73,0 @@ } // Get the current schemes and remove them from the list of schemes to add. |
@@ -22,6 +22,6 @@ "use strict"; | ||
function WarningAggregator() { | ||
const data = _interopRequireWildcard(require("../utils/warnings")); | ||
function _warnings() { | ||
const data = require("../utils/warnings"); | ||
WarningAggregator = function () { | ||
_warnings = function () { | ||
return data; | ||
@@ -43,6 +43,2 @@ }; | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const CONFIG_CHANGES_ATTRIBUTE = 'android:configChanges'; | ||
@@ -71,3 +67,3 @@ exports.CONFIG_CHANGES_ATTRIBUTE = CONFIG_CHANGES_ATTRIBUTE; | ||
} else { | ||
WarningAggregator().addWarningAndroid('android-userInterfaceStyle', `Cannot automatically configure MainActivity if it's not java`); | ||
(0, _warnings().addWarningAndroid)('android.userInterfaceStyle', `Cannot automatically configure MainActivity if it's not java`); | ||
} | ||
@@ -74,0 +70,0 @@ |
@@ -22,6 +22,6 @@ "use strict"; | ||
function WarningAggregator() { | ||
const data = _interopRequireWildcard(require("../utils/warnings")); | ||
function _warnings() { | ||
const data = require("../utils/warnings"); | ||
WarningAggregator = function () { | ||
_warnings = function () { | ||
return data; | ||
@@ -33,6 +33,2 @@ }; | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const withVersion = config => { | ||
@@ -44,3 +40,3 @@ return (0, _androidPlugins().withAppBuildGradle)(config, config => { | ||
} else { | ||
WarningAggregator().addWarningAndroid('android-version', `Cannot automatically configure app build.gradle if it's not groovy`); | ||
(0, _warnings().addWarningAndroid)('android.versionCode', `Cannot automatically configure app build.gradle if it's not groovy`); | ||
} | ||
@@ -47,0 +43,0 @@ |
@@ -23,6 +23,6 @@ "use strict"; | ||
function WarningAggregator() { | ||
const data = _interopRequireWildcard(require("../utils/warnings")); | ||
function _warnings() { | ||
const data = require("../utils/warnings"); | ||
WarningAggregator = function () { | ||
_warnings = function () { | ||
return data; | ||
@@ -34,6 +34,2 @@ }; | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const withDeviceFamily = config => { | ||
@@ -69,3 +65,3 @@ return (0, _iosPlugins().withXcodeProject)(config, async config => { | ||
if (isTabletOnly && ((_config$ios3 = config.ios) === null || _config$ios3 === void 0 ? void 0 : _config$ios3.supportsTablet) === false) { | ||
WarningAggregator().addWarningIOS('device-family', `Found contradictory values: \`{ ios: { isTabletOnly: true, supportsTablet: false } }\`. Using \`{ isTabletOnly: true }\`.`); | ||
(0, _warnings().addWarningIOS)('ios.supportsTablet', `Found contradictory values: \`{ ios: { isTabletOnly: true, supportsTablet: false } }\`. Using \`{ isTabletOnly: true }\`.`); | ||
} // 1 is iPhone, 2 is iPad | ||
@@ -72,0 +68,0 @@ |
@@ -51,6 +51,6 @@ "use strict"; | ||
function WarningAggregator() { | ||
const data = _interopRequireWildcard(require("../utils/warnings")); | ||
function _warnings() { | ||
const data = require("../utils/warnings"); | ||
WarningAggregator = function () { | ||
_warnings = function () { | ||
return data; | ||
@@ -154,3 +154,3 @@ }; | ||
// Add a warning when a json file cannot be parsed. | ||
WarningAggregator().addWarningIOS(`locales-${lang}`, `Failed to parse JSON of locale file for language: ${lang}`, 'https://docs.expo.dev/distribution/app-stores/#localizing-your-ios-app'); | ||
(0, _warnings().addWarningIOS)(`locales.${lang}`, `Failed to parse JSON of locale file for language: ${lang}`, 'https://docs.expo.dev/distribution/app-stores/#localizing-your-ios-app'); | ||
} | ||
@@ -157,0 +157,0 @@ } else { |
@@ -63,6 +63,6 @@ "use strict"; | ||
function WarningAggregator() { | ||
const data = _interopRequireWildcard(require("../utils/warnings")); | ||
function _warnings() { | ||
const data = require("../utils/warnings"); | ||
WarningAggregator = function () { | ||
_warnings = function () { | ||
return data; | ||
@@ -292,4 +292,4 @@ }; | ||
const extraPaths = projectRoot ? extra.map(v => path().relative(projectRoot, v)) : extra; | ||
WarningAggregator().addWarningIOS(`paths-${tag}`, `Found multiple ${fileName} file paths, using "${usingPath}". Ignored paths: ${JSON.stringify(extraPaths)}`); | ||
(0, _warnings().addWarningIOS)(`paths-${tag}`, `Found multiple ${fileName} file paths, using "${usingPath}". Ignored paths: ${JSON.stringify(extraPaths)}`); | ||
} | ||
//# sourceMappingURL=Paths.js.map |
@@ -30,6 +30,6 @@ "use strict"; | ||
function WarningAggregator() { | ||
const data = _interopRequireWildcard(require("../utils/warnings")); | ||
function _warnings() { | ||
const data = require("../utils/warnings"); | ||
WarningAggregator = function () { | ||
_warnings = function () { | ||
return data; | ||
@@ -41,6 +41,2 @@ }; | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const withRequiresFullScreen = (0, _iosPlugins().createInfoPlistPlugin)(setRequiresFullScreen, 'withRequiresFullScreen'); // NOTES: This is defaulted to `true` for now to match the behavior prior to SDK | ||
@@ -97,3 +93,3 @@ // 34, but will change to `false` in SDK +43. | ||
const existingList = interfaceOrientations.join(', '); | ||
WarningAggregator().addWarningIOS('ios.requireFullScreen', `iPad multitasking requires all \`${iPadInterfaceKey}\` orientations to be defined in the Info.plist. The Info.plist currently defines values that are incompatible with multitasking, these will be overwritten to prevent submission failure. Existing: ${existingList}`); | ||
(0, _warnings().addWarningIOS)('ios.requireFullScreen', `iPad multitasking requires all \`${iPadInterfaceKey}\` orientations to be defined in the Info.plist. The Info.plist currently defines values that are incompatible with multitasking, these will be overwritten to prevent submission failure. Existing: ${existingList}`); | ||
return interfaceOrientations; | ||
@@ -100,0 +96,0 @@ } |
import { ModPlatform } from '../Plugin.types'; | ||
declare type WarningArray = [string, string, string | undefined]; | ||
export declare function hasWarningsIOS(): boolean; | ||
export declare function hasWarningsAndroid(): boolean; | ||
export declare function addWarningAndroid(tag: string, text: string, link?: string): void; | ||
export declare function addWarningIOS(tag: string, text: string, link?: string): void; | ||
export declare function addWarningForPlatform(platform: ModPlatform, tag: string, text: string, link?: string): void; | ||
export declare function flushWarningsAndroid(): WarningArray[]; | ||
export declare function flushWarningsIOS(): WarningArray[]; | ||
export {}; | ||
/** | ||
* Log a warning that doesn't disrupt the spinners. | ||
* | ||
* ```sh | ||
* » android: android.package: property is invalid https://expo.fyi/android-package | ||
* ``` | ||
* | ||
* @param property Name of the config property that triggered the warning (best-effort) | ||
* @param text Main warning message | ||
* @param link Useful link to resources related to the warning | ||
*/ | ||
export declare function addWarningAndroid(property: string, text: string, link?: string): void; | ||
/** | ||
* Log a warning that doesn't disrupt the spinners. | ||
* | ||
* ```sh | ||
* » ios: ios.bundleIdentifier: property is invalid https://expo.fyi/bundle-identifier | ||
* ``` | ||
* | ||
* @param property Name of the config property that triggered the warning (best-effort) | ||
* @param text Main warning message | ||
* @param link Useful link to resources related to the warning | ||
*/ | ||
export declare function addWarningIOS(property: string, text: string, link?: string): void; | ||
export declare function addWarningForPlatform(platform: ModPlatform, property: string, text: string, link?: string): void; |
@@ -6,47 +6,56 @@ "use strict"; | ||
}); | ||
exports.hasWarningsIOS = hasWarningsIOS; | ||
exports.hasWarningsAndroid = hasWarningsAndroid; | ||
exports.addWarningAndroid = addWarningAndroid; | ||
exports.addWarningIOS = addWarningIOS; | ||
exports.addWarningForPlatform = addWarningForPlatform; | ||
exports.flushWarningsAndroid = flushWarningsAndroid; | ||
exports.flushWarningsIOS = flushWarningsIOS; | ||
let _warningsIOS = []; | ||
let _warningsAndroid = []; | ||
function hasWarningsIOS() { | ||
return !!_warningsIOS.length; | ||
} | ||
function _chalk() { | ||
const data = _interopRequireDefault(require("chalk")); | ||
function hasWarningsAndroid() { | ||
return !!_warningsAndroid.length; | ||
} | ||
_chalk = function () { | ||
return data; | ||
}; | ||
function addWarningAndroid(tag, text, link) { | ||
_warningsAndroid = [..._warningsAndroid, [tag, text, link]]; | ||
return data; | ||
} | ||
function addWarningIOS(tag, text, link) { | ||
_warningsIOS = [..._warningsIOS, [tag, text, link]]; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
* Log a warning that doesn't disrupt the spinners. | ||
* | ||
* ```sh | ||
* » android: android.package: property is invalid https://expo.fyi/android-package | ||
* ``` | ||
* | ||
* @param property Name of the config property that triggered the warning (best-effort) | ||
* @param text Main warning message | ||
* @param link Useful link to resources related to the warning | ||
*/ | ||
function addWarningAndroid(property, text, link) { | ||
console.warn(formatWarning('android', property, text, link)); | ||
} | ||
/** | ||
* Log a warning that doesn't disrupt the spinners. | ||
* | ||
* ```sh | ||
* » ios: ios.bundleIdentifier: property is invalid https://expo.fyi/bundle-identifier | ||
* ``` | ||
* | ||
* @param property Name of the config property that triggered the warning (best-effort) | ||
* @param text Main warning message | ||
* @param link Useful link to resources related to the warning | ||
*/ | ||
function addWarningForPlatform(platform, tag, text, link) { | ||
if (platform === 'ios') { | ||
addWarningIOS(tag, text, link); | ||
} else { | ||
addWarningAndroid(tag, text, link); | ||
} | ||
function addWarningIOS(property, text, link) { | ||
console.warn(formatWarning('ios', property, text, link)); | ||
} | ||
function flushWarningsAndroid() { | ||
const result = _warningsAndroid; | ||
_warningsAndroid = []; | ||
return result; | ||
function addWarningForPlatform(platform, property, text, link) { | ||
console.warn(formatWarning(platform, property, text, link)); | ||
} | ||
function flushWarningsIOS() { | ||
const result = _warningsIOS; | ||
_warningsIOS = []; | ||
return result; | ||
function formatWarning(platform, property, warning, link) { | ||
return _chalk().default.yellow`${'» ' + _chalk().default.bold(platform)}: ${property}: ${warning}${link ? _chalk().default.gray(' ' + link) : ''}`; | ||
} | ||
//# sourceMappingURL=warnings.js.map |
{ | ||
"name": "@expo/config-plugins", | ||
"version": "3.0.8", | ||
"version": "3.1.0", | ||
"description": "A library for Expo config plugins", | ||
@@ -37,3 +37,4 @@ "main": "build/index.js", | ||
"@expo/json-file": "8.2.33", | ||
"@expo/plist": "0.0.13", | ||
"@expo/plist": "0.0.14", | ||
"chalk": "^4.1.2", | ||
"debug": "^4.3.1", | ||
@@ -40,0 +41,0 @@ "find-up": "~5.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12054
1009647
14
1
+ Addedchalk@^4.1.2
+ Added@expo/plist@0.0.14(transitive)
+ Added@xmldom/xmldom@0.7.13(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
- Removed@expo/plist@0.0.13(transitive)
- Removedxmldom@0.5.0(transitive)
Updated@expo/plist@0.0.14