@expo/config-plugins 8.0.1 → 8.0.2
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/build/index.d.ts +1 -1
- package/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/ios/Maps.js +6 -22
- package/build/ios/Maps.js.map +1 -1
- package/build/ios/Paths.d.ts +3 -1
- package/build/ios/Paths.js +24 -0
- package/build/ios/Paths.js.map +1 -1
- package/build/plugins/ios-plugins.d.ts +8 -1
- package/build/plugins/ios-plugins.js +17 -2
- package/build/plugins/ios-plugins.js.map +1 -1
- package/build/plugins/withIosBaseMods.d.ts +2 -0
- package/build/plugins/withIosBaseMods.js +21 -0
- package/build/plugins/withIosBaseMods.js.map +1 -1
- package/package.json +2 -2
package/build/index.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export { withRunOnce, createRunOncePlugin } from './plugins/withRunOnce';
|
|
|
21
21
|
export { withDangerousMod } from './plugins/withDangerousMod';
|
|
22
22
|
export { withFinalizedMod } from './plugins/withFinalizedMod';
|
|
23
23
|
export { withMod, withBaseMod } from './plugins/withMod';
|
|
24
|
-
export { withAppDelegate, withInfoPlist, withEntitlementsPlist, withExpoPlist, withXcodeProject, withPodfileProperties, } from './plugins/ios-plugins';
|
|
24
|
+
export { withAppDelegate, withInfoPlist, withEntitlementsPlist, withExpoPlist, withXcodeProject, withPodfile, withPodfileProperties, } from './plugins/ios-plugins';
|
|
25
25
|
export { withAndroidManifest, withStringsXml, withAndroidColors, withAndroidColorsNight, withAndroidStyles, withMainActivity, withMainApplication, withProjectBuildGradle, withAppBuildGradle, withSettingsGradle, withGradleProperties, } from './plugins/android-plugins';
|
|
26
26
|
export { withStaticPlugin } from './plugins/withStaticPlugin';
|
|
27
27
|
export { compileModsAsync, withDefaultBaseMods, evalModsAsync } from './plugins/mod-compiler';
|
package/build/index.js
CHANGED
|
@@ -23,6 +23,7 @@ var _exportNames = {
|
|
|
23
23
|
withEntitlementsPlist: true,
|
|
24
24
|
withExpoPlist: true,
|
|
25
25
|
withXcodeProject: true,
|
|
26
|
+
withPodfile: true,
|
|
26
27
|
withPodfileProperties: true,
|
|
27
28
|
withAndroidManifest: true,
|
|
28
29
|
withStringsXml: true,
|
|
@@ -175,6 +176,12 @@ Object.defineProperty(exports, "withPlugins", {
|
|
|
175
176
|
return _withPlugins().withPlugins;
|
|
176
177
|
}
|
|
177
178
|
});
|
|
179
|
+
Object.defineProperty(exports, "withPodfile", {
|
|
180
|
+
enumerable: true,
|
|
181
|
+
get: function () {
|
|
182
|
+
return _iosPlugins().withPodfile;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
178
185
|
Object.defineProperty(exports, "withPodfileProperties", {
|
|
179
186
|
enumerable: true,
|
|
180
187
|
get: function () {
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["AndroidConfig","data","_interopRequireWildcard","require","Object","defineProperty","exports","enumerable","get","IOSConfig","_createBaseMod","_withAndroidBaseMods","_withIosBaseMods","XML","History","WarningAggregator","_Updates","_Plugin","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","_withPlugins","_withRunOnce","_withDangerousMod","_withFinalizedMod","_withMod","_iosPlugins","_androidPlugins","_withStaticPlugin","_modCompiler","_errors","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set","BaseMods","withGeneratedBaseMods","provider","withAndroidBaseMods","getAndroidModFileProviders","withIosBaseMods","getIosModFileProviders"],"sources":["../src/index.ts"],"sourcesContent":["/**\n * For internal use in Expo CLI\n */\nimport * as AndroidConfig from './android';\nimport * as IOSConfig from './ios';\nimport { provider, withGeneratedBaseMods } from './plugins/createBaseMod';\nimport { getAndroidModFileProviders, withAndroidBaseMods } from './plugins/withAndroidBaseMods';\nimport { getIosModFileProviders, withIosBaseMods } from './plugins/withIosBaseMods';\nimport * as XML from './utils/XML';\nimport * as History from './utils/history';\nimport * as WarningAggregator from './utils/warnings';\n\n// TODO: Remove\nexport * as Updates from './utils/Updates';\n\nexport { IOSConfig, AndroidConfig };\n\nexport { WarningAggregator, History, XML };\n\n/**\n * These are the \"config-plugins\"\n */\n\nexport * from './Plugin.types';\n\nexport { withPlugins } from './plugins/withPlugins';\n\nexport { withRunOnce, createRunOncePlugin } from './plugins/withRunOnce';\n\nexport { withDangerousMod } from './plugins/withDangerousMod';\nexport { withFinalizedMod } from './plugins/withFinalizedMod';\nexport { withMod, withBaseMod } from './plugins/withMod';\n\nexport {\n withAppDelegate,\n withInfoPlist,\n withEntitlementsPlist,\n withExpoPlist,\n withXcodeProject,\n withPodfileProperties,\n} from './plugins/ios-plugins';\n\nexport {\n withAndroidManifest,\n withStringsXml,\n withAndroidColors,\n withAndroidColorsNight,\n withAndroidStyles,\n withMainActivity,\n withMainApplication,\n withProjectBuildGradle,\n withAppBuildGradle,\n withSettingsGradle,\n withGradleProperties,\n} from './plugins/android-plugins';\n\nexport { withStaticPlugin } from './plugins/withStaticPlugin';\n\nexport { compileModsAsync, withDefaultBaseMods, evalModsAsync } from './plugins/mod-compiler';\n\nexport { PluginError } from './utils/errors';\n\nexport const BaseMods = {\n withGeneratedBaseMods,\n provider,\n withAndroidBaseMods,\n getAndroidModFileProviders,\n withIosBaseMods,\n getIosModFileProviders,\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["AndroidConfig","data","_interopRequireWildcard","require","Object","defineProperty","exports","enumerable","get","IOSConfig","_createBaseMod","_withAndroidBaseMods","_withIosBaseMods","XML","History","WarningAggregator","_Updates","_Plugin","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","_withPlugins","_withRunOnce","_withDangerousMod","_withFinalizedMod","_withMod","_iosPlugins","_androidPlugins","_withStaticPlugin","_modCompiler","_errors","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set","BaseMods","withGeneratedBaseMods","provider","withAndroidBaseMods","getAndroidModFileProviders","withIosBaseMods","getIosModFileProviders"],"sources":["../src/index.ts"],"sourcesContent":["/**\n * For internal use in Expo CLI\n */\nimport * as AndroidConfig from './android';\nimport * as IOSConfig from './ios';\nimport { provider, withGeneratedBaseMods } from './plugins/createBaseMod';\nimport { getAndroidModFileProviders, withAndroidBaseMods } from './plugins/withAndroidBaseMods';\nimport { getIosModFileProviders, withIosBaseMods } from './plugins/withIosBaseMods';\nimport * as XML from './utils/XML';\nimport * as History from './utils/history';\nimport * as WarningAggregator from './utils/warnings';\n\n// TODO: Remove\nexport * as Updates from './utils/Updates';\n\nexport { IOSConfig, AndroidConfig };\n\nexport { WarningAggregator, History, XML };\n\n/**\n * These are the \"config-plugins\"\n */\n\nexport * from './Plugin.types';\n\nexport { withPlugins } from './plugins/withPlugins';\n\nexport { withRunOnce, createRunOncePlugin } from './plugins/withRunOnce';\n\nexport { withDangerousMod } from './plugins/withDangerousMod';\nexport { withFinalizedMod } from './plugins/withFinalizedMod';\nexport { withMod, withBaseMod } from './plugins/withMod';\n\nexport {\n withAppDelegate,\n withInfoPlist,\n withEntitlementsPlist,\n withExpoPlist,\n withXcodeProject,\n withPodfile,\n withPodfileProperties,\n} from './plugins/ios-plugins';\n\nexport {\n withAndroidManifest,\n withStringsXml,\n withAndroidColors,\n withAndroidColorsNight,\n withAndroidStyles,\n withMainActivity,\n withMainApplication,\n withProjectBuildGradle,\n withAppBuildGradle,\n withSettingsGradle,\n withGradleProperties,\n} from './plugins/android-plugins';\n\nexport { withStaticPlugin } from './plugins/withStaticPlugin';\n\nexport { compileModsAsync, withDefaultBaseMods, evalModsAsync } from './plugins/mod-compiler';\n\nexport { PluginError } from './utils/errors';\n\nexport const BaseMods = {\n withGeneratedBaseMods,\n provider,\n withAndroidBaseMods,\n getAndroidModFileProviders,\n withIosBaseMods,\n getIosModFileProviders,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAA,CAAAF,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAU,GAAA,CAAAb,CAAA,EAAAO,CAAA,GAAAA,CAAA;AA7D7C;AACA;AACA;;AAUA;;AAOA;AACA;AACA;;AA0CO,MAAMO,QAAQ,GAAA5C,OAAA,CAAA4C,QAAA,GAAG;EACtBC,qBAAqB,EAArBA,sCAAqB;EACrBC,QAAQ,EAARA,yBAAQ;EACRC,mBAAmB,EAAnBA,0CAAmB;EACnBC,0BAA0B,EAA1BA,iDAA0B;EAC1BC,eAAe,EAAfA,kCAAe;EACfC,sBAAsB,EAAtBA;AACF,CAAC"}
|
package/build/ios/Maps.js
CHANGED
|
@@ -13,13 +13,6 @@ exports.removeGoogleMapsAppDelegateInit = removeGoogleMapsAppDelegateInit;
|
|
|
13
13
|
exports.removeMapsCocoaPods = removeMapsCocoaPods;
|
|
14
14
|
exports.setGoogleMapsApiKey = setGoogleMapsApiKey;
|
|
15
15
|
exports.withMaps = void 0;
|
|
16
|
-
function _fs() {
|
|
17
|
-
const data = _interopRequireDefault(require("fs"));
|
|
18
|
-
_fs = function () {
|
|
19
|
-
return data;
|
|
20
|
-
};
|
|
21
|
-
return data;
|
|
22
|
-
}
|
|
23
16
|
function _path() {
|
|
24
17
|
const data = _interopRequireDefault(require("path"));
|
|
25
18
|
_path = function () {
|
|
@@ -41,13 +34,6 @@ function _iosPlugins() {
|
|
|
41
34
|
};
|
|
42
35
|
return data;
|
|
43
36
|
}
|
|
44
|
-
function _withDangerousMod() {
|
|
45
|
-
const data = require("../plugins/withDangerousMod");
|
|
46
|
-
_withDangerousMod = function () {
|
|
47
|
-
return data;
|
|
48
|
-
};
|
|
49
|
-
return data;
|
|
50
|
-
}
|
|
51
37
|
function _generateCode() {
|
|
52
38
|
const data = require("../utils/generateCode");
|
|
53
39
|
_generateCode = function () {
|
|
@@ -170,19 +156,17 @@ function isReactNativeMapsAutolinked(config) {
|
|
|
170
156
|
const withMapsCocoaPods = (config, {
|
|
171
157
|
useGoogleMaps
|
|
172
158
|
}) => {
|
|
173
|
-
return (0,
|
|
174
|
-
const filePath = _path().default.join(config.modRequest.platformProjectRoot, 'Podfile');
|
|
175
|
-
const contents = await _fs().default.promises.readFile(filePath, 'utf-8');
|
|
176
|
-
let results;
|
|
159
|
+
return (0, _iosPlugins().withPodfile)(config, async config => {
|
|
177
160
|
// Only add the block if react-native-maps is installed in the project (best effort).
|
|
178
161
|
// Generally prebuild runs after a yarn install so this should always work as expected.
|
|
179
162
|
const googleMapsPath = isReactNativeMapsInstalled(config.modRequest.projectRoot);
|
|
180
163
|
const isLinked = isReactNativeMapsAutolinked(config);
|
|
181
164
|
debug('Is Expo Autolinked:', isLinked);
|
|
182
165
|
debug('react-native-maps path:', googleMapsPath);
|
|
166
|
+
let results;
|
|
183
167
|
if (isLinked && googleMapsPath && useGoogleMaps) {
|
|
184
168
|
try {
|
|
185
|
-
results = addMapsCocoaPods(contents);
|
|
169
|
+
results = addMapsCocoaPods(config.modResults.contents);
|
|
186
170
|
} catch (error) {
|
|
187
171
|
if (error.code === 'ERR_NO_MATCH') {
|
|
188
172
|
throw new Error(`Cannot add react-native-maps to the project's ios/Podfile because it's malformed. Please report this with a copy of your project Podfile.`);
|
|
@@ -191,13 +175,13 @@ const withMapsCocoaPods = (config, {
|
|
|
191
175
|
}
|
|
192
176
|
} else {
|
|
193
177
|
// If the package is no longer installed, then remove the block.
|
|
194
|
-
results = removeMapsCocoaPods(contents);
|
|
178
|
+
results = removeMapsCocoaPods(config.modResults.contents);
|
|
195
179
|
}
|
|
196
180
|
if (results.didMerge || results.didClear) {
|
|
197
|
-
|
|
181
|
+
config.modResults.contents = results.contents;
|
|
198
182
|
}
|
|
199
183
|
return config;
|
|
200
|
-
}
|
|
184
|
+
});
|
|
201
185
|
};
|
|
202
186
|
const withGoogleMapsAppDelegate = (config, {
|
|
203
187
|
apiKey
|
package/build/ios/Maps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Maps.js","names":["_fs","data","_interopRequireDefault","require","_path","_resolveFrom","_iosPlugins","_withDangerousMod","_generateCode","obj","__esModule","default","debug","MATCH_INIT","exports","withGoogleMapsKey","createInfoPlistPlugin","setGoogleMapsApiKey","withMaps","config","apiKey","getGoogleMapsApiKey","withMapsCocoaPods","useGoogleMaps","withGoogleMapsAppDelegate","ios","googleMapsApiKey","GMSApiKey","infoPlist","addGoogleMapsAppDelegateImport","src","newSrc","push","mergeContents","tag","join","anchor","offset","comment","removeGoogleMapsAppDelegateImport","removeContents","addGoogleMapsAppDelegateInit","removeGoogleMapsAppDelegateInit","addMapsCocoaPods","removeMapsCocoaPods","isReactNativeMapsInstalled","projectRoot","resolved","resolveFrom","silent","path","dirname","isReactNativeMapsAutolinked","withDangerousMod","filePath","modRequest","platformProjectRoot","contents","fs","promises","readFile","results","googleMapsPath","isLinked","error","code","Error","didMerge","didClear","writeFile","withAppDelegate","includes","modResults","language"],"sources":["../../src/ios/Maps.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport fs from 'fs';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { ConfigPlugin, InfoPlist } from '../Plugin.types';\nimport { createInfoPlistPlugin, withAppDelegate } from '../plugins/ios-plugins';\nimport { withDangerousMod } from '../plugins/withDangerousMod';\nimport { mergeContents, MergeResults, removeContents } from '../utils/generateCode';\n\nconst debug = require('debug')('expo:config-plugins:ios:maps') as typeof console.log;\n\nexport const MATCH_INIT =\n /-\\s*\\(BOOL\\)\\s*application:\\s*\\(UIApplication\\s*\\*\\s*\\)\\s*\\w+\\s+didFinishLaunchingWithOptions:/g;\n\nconst withGoogleMapsKey = createInfoPlistPlugin(setGoogleMapsApiKey, 'withGoogleMapsKey');\n\nexport const withMaps: ConfigPlugin = (config) => {\n config = withGoogleMapsKey(config);\n\n const apiKey = getGoogleMapsApiKey(config);\n // Technically adds react-native-maps (Apple maps) and google maps.\n\n debug('Google Maps API Key:', apiKey);\n config = withMapsCocoaPods(config, { useGoogleMaps: !!apiKey });\n\n // Adds/Removes AppDelegate setup for Google Maps API on iOS\n config = withGoogleMapsAppDelegate(config, { apiKey });\n\n return config;\n};\n\nexport function getGoogleMapsApiKey(config: Pick<ExpoConfig, 'ios'>) {\n return config.ios?.config?.googleMapsApiKey ?? null;\n}\n\nexport function setGoogleMapsApiKey(\n config: Pick<ExpoConfig, 'ios'>,\n { GMSApiKey, ...infoPlist }: InfoPlist\n): InfoPlist {\n const apiKey = getGoogleMapsApiKey(config);\n\n if (apiKey === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n GMSApiKey: apiKey,\n };\n}\n\nexport function addGoogleMapsAppDelegateImport(src: string): MergeResults {\n const newSrc = [];\n newSrc.push(\n '#if __has_include(<GoogleMaps/GoogleMaps.h>)',\n '#import <GoogleMaps/GoogleMaps.h>',\n '#endif'\n );\n\n return mergeContents({\n tag: 'react-native-maps-import',\n src,\n newSrc: newSrc.join('\\n'),\n anchor: /#import \"AppDelegate\\.h\"/,\n offset: 1,\n comment: '//',\n });\n}\n\nexport function removeGoogleMapsAppDelegateImport(src: string): MergeResults {\n return removeContents({\n tag: 'react-native-maps-import',\n src,\n });\n}\n\nexport function addGoogleMapsAppDelegateInit(src: string, apiKey: string): MergeResults {\n const newSrc = [];\n newSrc.push(\n '#if __has_include(<GoogleMaps/GoogleMaps.h>)',\n ` [GMSServices provideAPIKey:@\"${apiKey}\"];`,\n '#endif'\n );\n\n return mergeContents({\n tag: 'react-native-maps-init',\n src,\n newSrc: newSrc.join('\\n'),\n anchor: MATCH_INIT,\n offset: 2,\n comment: '//',\n });\n}\n\nexport function removeGoogleMapsAppDelegateInit(src: string): MergeResults {\n return removeContents({\n tag: 'react-native-maps-init',\n src,\n });\n}\n\n/**\n * @param src The contents of the Podfile.\n * @returns Podfile with Google Maps added.\n */\nexport function addMapsCocoaPods(src: string): MergeResults {\n return mergeContents({\n tag: 'react-native-maps',\n src,\n newSrc: ` pod 'react-native-google-maps', path: File.dirname(\\`node --print \"require.resolve('react-native-maps/package.json')\"\\`)`,\n anchor: /use_native_modules/,\n offset: 0,\n comment: '#',\n });\n}\n\nexport function removeMapsCocoaPods(src: string): MergeResults {\n return removeContents({\n tag: 'react-native-maps',\n src,\n });\n}\n\nfunction isReactNativeMapsInstalled(projectRoot: string): string | null {\n const resolved = resolveFrom.silent(projectRoot, 'react-native-maps/package.json');\n return resolved ? path.dirname(resolved) : null;\n}\n\nfunction isReactNativeMapsAutolinked(config: Pick<ExpoConfig, '_internal'>): boolean {\n // Only add the native code changes if we know that the package is going to be linked natively.\n // This is specifically for monorepo support where one app might have react-native-maps (adding it to the node_modules)\n // but another app will not have it installed in the package.json, causing it to not be linked natively.\n // This workaround only exists because react-native-maps doesn't have a config plugin vendored in the package.\n\n // TODO: `react-native-maps` doesn't use Expo autolinking so we cannot safely disable the module.\n return true;\n\n // return (\n // !config._internal?.autolinkedModules ||\n // config._internal.autolinkedModules.includes('react-native-maps')\n // );\n}\n\nconst withMapsCocoaPods: ConfigPlugin<{ useGoogleMaps: boolean }> = (config, { useGoogleMaps }) => {\n return withDangerousMod(config, [\n 'ios',\n async (config) => {\n const filePath = path.join(config.modRequest.platformProjectRoot, 'Podfile');\n const contents = await fs.promises.readFile(filePath, 'utf-8');\n let results: MergeResults;\n // Only add the block if react-native-maps is installed in the project (best effort).\n // Generally prebuild runs after a yarn install so this should always work as expected.\n const googleMapsPath = isReactNativeMapsInstalled(config.modRequest.projectRoot);\n const isLinked = isReactNativeMapsAutolinked(config);\n debug('Is Expo Autolinked:', isLinked);\n debug('react-native-maps path:', googleMapsPath);\n if (isLinked && googleMapsPath && useGoogleMaps) {\n try {\n results = addMapsCocoaPods(contents);\n } catch (error: any) {\n if (error.code === 'ERR_NO_MATCH') {\n throw new Error(\n `Cannot add react-native-maps to the project's ios/Podfile because it's malformed. Please report this with a copy of your project Podfile.`\n );\n }\n throw error;\n }\n } else {\n // If the package is no longer installed, then remove the block.\n results = removeMapsCocoaPods(contents);\n }\n if (results.didMerge || results.didClear) {\n await fs.promises.writeFile(filePath, results.contents);\n }\n return config;\n },\n ]);\n};\n\nconst withGoogleMapsAppDelegate: ConfigPlugin<{ apiKey: string | null }> = (config, { apiKey }) => {\n return withAppDelegate(config, (config) => {\n if (['objc', 'objcpp'].includes(config.modResults.language)) {\n if (\n apiKey &&\n isReactNativeMapsAutolinked(config) &&\n isReactNativeMapsInstalled(config.modRequest.projectRoot)\n ) {\n try {\n config.modResults.contents = addGoogleMapsAppDelegateImport(\n config.modResults.contents\n ).contents;\n config.modResults.contents = addGoogleMapsAppDelegateInit(\n config.modResults.contents,\n apiKey\n ).contents;\n } catch (error: any) {\n if (error.code === 'ERR_NO_MATCH') {\n throw new Error(\n `Cannot add Google Maps to the project's AppDelegate because it's malformed. Please report this with a copy of your project AppDelegate.`\n );\n }\n throw error;\n }\n } else {\n config.modResults.contents = removeGoogleMapsAppDelegateImport(\n config.modResults.contents\n ).contents;\n config.modResults.contents = removeGoogleMapsAppDelegateInit(\n config.modResults.contents\n ).contents;\n }\n } else {\n throw new Error(\n `Cannot setup Google Maps because the project AppDelegate is not a supported language: ${config.modResults.language}`\n );\n }\n return config;\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;AACA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,YAAA;EAAA,MAA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AACA,QAAQ;UACVtC,MAAM,CAACqD,UAAU,CAACf,QAAQ,GAAGhB,4BAA4B,CACvDtB,MAAM,CAACqD,UAAU,CAACf,QAAQ,EAC1BrC,MACF,CAAC,CAACqC,QAAQ;QACZ,CAAC,CAAC,OAAOO,KAAU,EAAE;UACnB,IAAIA,KAAK,CAACC,IAAI,KAAK,cAAc,EAAE;YACjC,MAAM,IAAIC,KAAK,CACZ,yIACH,CAAC;UACH;UACA,MAAMF,KAAK;QACb;MACF,CAAC,MAAM;QACL7C,MAAM,CAACqD,UAAU,CAACf,QAAQ,GAAGlB,iCAAiC,CAC5DpB,MAAM,CAACqD,UAAU,CAACf,QACpB,CAAC,CAACA,QAAQ;QACVtC,MAAM,CAACqD,UAAU,CAACf,QAAQ,GAAGf,+BAA+B,CAC1DvB,MAAM,CAACqD,UAAU,CAACf,QACpB,CAAC,CAACA,QAAQ;MACZ;IACF,CAAC,MAAM;MACL,MAAM,IAAIS,KAAK,CACZ,yFAAwF/C,MAAM,CAACqD,UAAU,CAACC,QAAS,EACtH,CAAC;IACH;IACA,OAAOtD,MAAM;EACf,CAAC,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"Maps.js","names":["_path","data","_interopRequireDefault","require","_resolveFrom","_iosPlugins","_generateCode","obj","__esModule","default","debug","MATCH_INIT","exports","withGoogleMapsKey","createInfoPlistPlugin","setGoogleMapsApiKey","withMaps","config","apiKey","getGoogleMapsApiKey","withMapsCocoaPods","useGoogleMaps","withGoogleMapsAppDelegate","ios","googleMapsApiKey","GMSApiKey","infoPlist","addGoogleMapsAppDelegateImport","src","newSrc","push","mergeContents","tag","join","anchor","offset","comment","removeGoogleMapsAppDelegateImport","removeContents","addGoogleMapsAppDelegateInit","removeGoogleMapsAppDelegateInit","addMapsCocoaPods","removeMapsCocoaPods","isReactNativeMapsInstalled","projectRoot","resolved","resolveFrom","silent","path","dirname","isReactNativeMapsAutolinked","withPodfile","googleMapsPath","modRequest","isLinked","results","modResults","contents","error","code","Error","didMerge","didClear","withAppDelegate","includes","language"],"sources":["../../src/ios/Maps.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { ConfigPlugin, InfoPlist } from '../Plugin.types';\nimport { createInfoPlistPlugin, withAppDelegate, withPodfile } from '../plugins/ios-plugins';\nimport { mergeContents, MergeResults, removeContents } from '../utils/generateCode';\n\nconst debug = require('debug')('expo:config-plugins:ios:maps') as typeof console.log;\n\nexport const MATCH_INIT =\n /-\\s*\\(BOOL\\)\\s*application:\\s*\\(UIApplication\\s*\\*\\s*\\)\\s*\\w+\\s+didFinishLaunchingWithOptions:/g;\n\nconst withGoogleMapsKey = createInfoPlistPlugin(setGoogleMapsApiKey, 'withGoogleMapsKey');\n\nexport const withMaps: ConfigPlugin = (config) => {\n config = withGoogleMapsKey(config);\n\n const apiKey = getGoogleMapsApiKey(config);\n // Technically adds react-native-maps (Apple maps) and google maps.\n\n debug('Google Maps API Key:', apiKey);\n config = withMapsCocoaPods(config, { useGoogleMaps: !!apiKey });\n\n // Adds/Removes AppDelegate setup for Google Maps API on iOS\n config = withGoogleMapsAppDelegate(config, { apiKey });\n\n return config;\n};\n\nexport function getGoogleMapsApiKey(config: Pick<ExpoConfig, 'ios'>) {\n return config.ios?.config?.googleMapsApiKey ?? null;\n}\n\nexport function setGoogleMapsApiKey(\n config: Pick<ExpoConfig, 'ios'>,\n { GMSApiKey, ...infoPlist }: InfoPlist\n): InfoPlist {\n const apiKey = getGoogleMapsApiKey(config);\n\n if (apiKey === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n GMSApiKey: apiKey,\n };\n}\n\nexport function addGoogleMapsAppDelegateImport(src: string): MergeResults {\n const newSrc = [];\n newSrc.push(\n '#if __has_include(<GoogleMaps/GoogleMaps.h>)',\n '#import <GoogleMaps/GoogleMaps.h>',\n '#endif'\n );\n\n return mergeContents({\n tag: 'react-native-maps-import',\n src,\n newSrc: newSrc.join('\\n'),\n anchor: /#import \"AppDelegate\\.h\"/,\n offset: 1,\n comment: '//',\n });\n}\n\nexport function removeGoogleMapsAppDelegateImport(src: string): MergeResults {\n return removeContents({\n tag: 'react-native-maps-import',\n src,\n });\n}\n\nexport function addGoogleMapsAppDelegateInit(src: string, apiKey: string): MergeResults {\n const newSrc = [];\n newSrc.push(\n '#if __has_include(<GoogleMaps/GoogleMaps.h>)',\n ` [GMSServices provideAPIKey:@\"${apiKey}\"];`,\n '#endif'\n );\n\n return mergeContents({\n tag: 'react-native-maps-init',\n src,\n newSrc: newSrc.join('\\n'),\n anchor: MATCH_INIT,\n offset: 2,\n comment: '//',\n });\n}\n\nexport function removeGoogleMapsAppDelegateInit(src: string): MergeResults {\n return removeContents({\n tag: 'react-native-maps-init',\n src,\n });\n}\n\n/**\n * @param src The contents of the Podfile.\n * @returns Podfile with Google Maps added.\n */\nexport function addMapsCocoaPods(src: string): MergeResults {\n return mergeContents({\n tag: 'react-native-maps',\n src,\n newSrc: ` pod 'react-native-google-maps', path: File.dirname(\\`node --print \"require.resolve('react-native-maps/package.json')\"\\`)`,\n anchor: /use_native_modules/,\n offset: 0,\n comment: '#',\n });\n}\n\nexport function removeMapsCocoaPods(src: string): MergeResults {\n return removeContents({\n tag: 'react-native-maps',\n src,\n });\n}\n\nfunction isReactNativeMapsInstalled(projectRoot: string): string | null {\n const resolved = resolveFrom.silent(projectRoot, 'react-native-maps/package.json');\n return resolved ? path.dirname(resolved) : null;\n}\n\nfunction isReactNativeMapsAutolinked(config: Pick<ExpoConfig, '_internal'>): boolean {\n // Only add the native code changes if we know that the package is going to be linked natively.\n // This is specifically for monorepo support where one app might have react-native-maps (adding it to the node_modules)\n // but another app will not have it installed in the package.json, causing it to not be linked natively.\n // This workaround only exists because react-native-maps doesn't have a config plugin vendored in the package.\n\n // TODO: `react-native-maps` doesn't use Expo autolinking so we cannot safely disable the module.\n return true;\n\n // return (\n // !config._internal?.autolinkedModules ||\n // config._internal.autolinkedModules.includes('react-native-maps')\n // );\n}\n\nconst withMapsCocoaPods: ConfigPlugin<{ useGoogleMaps: boolean }> = (config, { useGoogleMaps }) => {\n return withPodfile(config, async (config) => {\n // Only add the block if react-native-maps is installed in the project (best effort).\n // Generally prebuild runs after a yarn install so this should always work as expected.\n const googleMapsPath = isReactNativeMapsInstalled(config.modRequest.projectRoot);\n const isLinked = isReactNativeMapsAutolinked(config);\n debug('Is Expo Autolinked:', isLinked);\n debug('react-native-maps path:', googleMapsPath);\n\n let results: MergeResults;\n\n if (isLinked && googleMapsPath && useGoogleMaps) {\n try {\n results = addMapsCocoaPods(config.modResults.contents);\n } catch (error: any) {\n if (error.code === 'ERR_NO_MATCH') {\n throw new Error(\n `Cannot add react-native-maps to the project's ios/Podfile because it's malformed. Please report this with a copy of your project Podfile.`\n );\n }\n throw error;\n }\n } else {\n // If the package is no longer installed, then remove the block.\n results = removeMapsCocoaPods(config.modResults.contents);\n }\n\n if (results.didMerge || results.didClear) {\n config.modResults.contents = results.contents;\n }\n\n return config;\n });\n};\n\nconst withGoogleMapsAppDelegate: ConfigPlugin<{ apiKey: string | null }> = (config, { apiKey }) => {\n return withAppDelegate(config, (config) => {\n if (['objc', 'objcpp'].includes(config.modResults.language)) {\n if (\n apiKey &&\n isReactNativeMapsAutolinked(config) &&\n isReactNativeMapsInstalled(config.modRequest.projectRoot)\n ) {\n try {\n config.modResults.contents = addGoogleMapsAppDelegateImport(\n config.modResults.contents\n ).contents;\n config.modResults.contents = addGoogleMapsAppDelegateInit(\n config.modResults.contents,\n apiKey\n ).contents;\n } catch (error: any) {\n if (error.code === 'ERR_NO_MATCH') {\n throw new Error(\n `Cannot add Google Maps to the project's AppDelegate because it's malformed. Please report this with a copy of your project AppDelegate.`\n );\n }\n throw error;\n }\n } else {\n config.modResults.contents = removeGoogleMapsAppDelegateImport(\n config.modResults.contents\n ).contents;\n config.modResults.contents = removeGoogleMapsAppDelegateInit(\n config.modResults.contents\n ).contents;\n }\n } else {\n throw new Error(\n `Cannot setup Google Maps because the project AppDelegate is not a supported language: ${config.modResults.language}`\n );\n }\n return config;\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;AACA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,aAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,YAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,cAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,aAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAoF,SAAAC,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEpF,MAAMG,KAAK,GAAGP,OAAO,CAAC,OAAO,CAAC,CAAC,8BAA8B,CAAuB;AAE7E,MAAMQ,UAAU,GAAAC,OAAA,CAAAD,UAAA,GACrB,iGAAiG;AAEnG,MAAME,iBAAiB,GAAG,IAAAC,mCAAqB,EAACC,mBAAmB,EAAE,mBAAmB,CAAC;AAElF,MAAMC,QAAsB,GAAIC,MAAM,IAAK;EAChDA,MAAM,GAAGJ,iBAAiB,CAACI,MAAM,CAAC;EAElC,MAAMC,MAAM,GAAGC,mBAAmB,CAACF,MAAM,CAAC;EAC1C;;EAEAP,KAAK,CAAC,sBAAsB,EAAEQ,MAAM,CAAC;EACrCD,MAAM,GAAGG,iBAAiB,CAACH,MAAM,EAAE;IAAEI,aAAa,EAAE,CAAC,CA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M,CAACuC,UAAU,CAACC,QAAQ,GAAG9B,8BAA8B,CACzDV,MAAM,CAACuC,UAAU,CAACC,QACpB,CAAC,CAACA,QAAQ;UACVxC,MAAM,CAACuC,UAAU,CAACC,QAAQ,GAAGlB,4BAA4B,CACvDtB,MAAM,CAACuC,UAAU,CAACC,QAAQ,EAC1BvC,MACF,CAAC,CAACuC,QAAQ;QACZ,CAAC,CAAC,OAAOC,KAAU,EAAE;UACnB,IAAIA,KAAK,CAACC,IAAI,KAAK,cAAc,EAAE;YACjC,MAAM,IAAIC,KAAK,CACZ,yIACH,CAAC;UACH;UACA,MAAMF,KAAK;QACb;MACF,CAAC,MAAM;QACLzC,MAAM,CAACuC,UAAU,CAACC,QAAQ,GAAGpB,iCAAiC,CAC5DpB,MAAM,CAACuC,UAAU,CAACC,QACpB,CAAC,CAACA,QAAQ;QACVxC,MAAM,CAACuC,UAAU,CAACC,QAAQ,GAAGjB,+BAA+B,CAC1DvB,MAAM,CAACuC,UAAU,CAACC,QACpB,CAAC,CAACA,QAAQ;MACZ;IACF,CAAC,MAAM;MACL,MAAM,IAAIG,KAAK,CACZ,yFAAwF3C,MAAM,CAACuC,UAAU,CAACS,QAAS,EACtH,CAAC;IACH;IACA,OAAOhD,MAAM;EACf,CAAC,CAAC;AACJ,CAAC"}
|
package/build/ios/Paths.d.ts
CHANGED
|
@@ -3,11 +3,13 @@ interface ProjectFile<L extends string = string> {
|
|
|
3
3
|
language: L;
|
|
4
4
|
contents: string;
|
|
5
5
|
}
|
|
6
|
-
type AppleLanguage = 'objc' | 'objcpp' | 'swift';
|
|
6
|
+
type AppleLanguage = 'objc' | 'objcpp' | 'swift' | 'rb';
|
|
7
|
+
export type PodfileProjectFile = ProjectFile<'rb'>;
|
|
7
8
|
export type AppDelegateProjectFile = ProjectFile<AppleLanguage>;
|
|
8
9
|
export declare function getAppDelegateHeaderFilePath(projectRoot: string): string;
|
|
9
10
|
export declare function getAppDelegateFilePath(projectRoot: string): string;
|
|
10
11
|
export declare function getAppDelegateObjcHeaderFilePath(projectRoot: string): string;
|
|
12
|
+
export declare function getPodfilePath(projectRoot: string): string;
|
|
11
13
|
export declare function getFileInfo(filePath: string): {
|
|
12
14
|
path: string;
|
|
13
15
|
contents: string;
|
package/build/ios/Paths.js
CHANGED
|
@@ -18,6 +18,7 @@ exports.getExpoPlistPath = getExpoPlistPath;
|
|
|
18
18
|
exports.getFileInfo = getFileInfo;
|
|
19
19
|
exports.getInfoPlistPath = getInfoPlistPath;
|
|
20
20
|
exports.getPBXProjectPath = getPBXProjectPath;
|
|
21
|
+
exports.getPodfilePath = getPodfilePath;
|
|
21
22
|
exports.getSourceRoot = getSourceRoot;
|
|
22
23
|
exports.getSupportingPath = getSupportingPath;
|
|
23
24
|
exports.getXcodeProjectPath = getXcodeProjectPath;
|
|
@@ -126,8 +127,31 @@ function getAppDelegateObjcHeaderFilePath(projectRoot) {
|
|
|
126
127
|
}
|
|
127
128
|
return using;
|
|
128
129
|
}
|
|
130
|
+
function getPodfilePath(projectRoot) {
|
|
131
|
+
const [using, ...extra] = (0, _glob().sync)('ios/Podfile', {
|
|
132
|
+
absolute: true,
|
|
133
|
+
cwd: projectRoot,
|
|
134
|
+
ignore: ignoredPaths
|
|
135
|
+
});
|
|
136
|
+
if (!using) {
|
|
137
|
+
throw new (_errors().UnexpectedError)(`Could not locate a valid Podfile at root: "${projectRoot}"`);
|
|
138
|
+
}
|
|
139
|
+
if (extra.length) {
|
|
140
|
+
warnMultipleFiles({
|
|
141
|
+
tag: 'podfile',
|
|
142
|
+
fileName: 'Podfile',
|
|
143
|
+
projectRoot,
|
|
144
|
+
using,
|
|
145
|
+
extra
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
return using;
|
|
149
|
+
}
|
|
129
150
|
function getLanguage(filePath) {
|
|
130
151
|
const extension = path().extname(filePath);
|
|
152
|
+
if (!extension && path().basename(filePath) === 'Podfile') {
|
|
153
|
+
return 'rb';
|
|
154
|
+
}
|
|
131
155
|
switch (extension) {
|
|
132
156
|
case '.mm':
|
|
133
157
|
return 'objcpp';
|
package/build/ios/Paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paths.js","names":["_fs","data","require","_glob","path","_interopRequireWildcard","Entitlements","_errors","_warnings","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ignoredPaths","getAppDelegateHeaderFilePath","projectRoot","using","extra","globSync","absolute","cwd","ignore","UnexpectedError","length","warnMultipleFiles","tag","fileName","getAppDelegateFilePath","getAppDelegateObjcHeaderFilePath","getLanguage","filePath","extension","extname","getFileInfo","normalize","contents","readFileSync","language","getAppDelegate","getSourceRoot","appDelegate","dirname","findSchemePaths","findSchemeNames","schemePaths","map","schemePath","parse","name","getAllXcodeProjectPaths","iosFolder","pbxprojPaths","filter","project","test","sort","b","isAInIos","isBInIos","value","join","getXcodeProjectPath","getAllPBXProjectPaths","projectPaths","paths","existsSync","getPBXProjectPath","getAllInfoPlistPaths","getInfoPlistPath","getAllEntitlementsPaths","getEntitlementsPath","getSupportingPath","resolve","basename","getExpoPlistPath","supportingPath","usingPath","relative","extraPaths","v","addWarningIOS","JSON","stringify"],"sources":["../../src/ios/Paths.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'fs';\nimport { sync as globSync } from 'glob';\nimport * as path from 'path';\n\nimport * as Entitlements from './Entitlements';\nimport { UnexpectedError } from '../utils/errors';\nimport { addWarningIOS } from '../utils/warnings';\n\nconst ignoredPaths = ['**/@(Carthage|Pods|vendor|node_modules)/**'];\n\ninterface ProjectFile<L extends string = string> {\n path: string;\n language: L;\n contents: string;\n}\n\ntype AppleLanguage = 'objc' | 'objcpp' | 'swift';\n\nexport type AppDelegateProjectFile = ProjectFile<AppleLanguage>;\n\nexport function getAppDelegateHeaderFilePath(projectRoot: string): string {\n const [using, ...extra] = globSync('ios/*/AppDelegate.h', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n\n if (!using) {\n throw new UnexpectedError(\n `Could not locate a valid AppDelegate header at root: \"${projectRoot}\"`\n );\n }\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'app-delegate-header',\n fileName: 'AppDelegate',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAppDelegateFilePath(projectRoot: string): string {\n const [using, ...extra] = globSync('ios/*/AppDelegate.@(m|mm|swift)', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n\n if (!using) {\n throw new UnexpectedError(`Could not locate a valid AppDelegate at root: \"${projectRoot}\"`);\n }\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'app-delegate',\n fileName: 'AppDelegate',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAppDelegateObjcHeaderFilePath(projectRoot: string): string {\n const [using, ...extra] = globSync('ios/*/AppDelegate.h', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n\n if (!using) {\n throw new UnexpectedError(`Could not locate a valid AppDelegate.h at root: \"${projectRoot}\"`);\n }\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'app-delegate-objc-header',\n fileName: 'AppDelegate.h',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nfunction getLanguage(filePath: string): AppleLanguage {\n const extension = path.extname(filePath);\n switch (extension) {\n case '.mm':\n return 'objcpp';\n case '.m':\n case '.h':\n return 'objc';\n case '.swift':\n return 'swift';\n default:\n throw new UnexpectedError(`Unexpected iOS file extension: ${extension}`);\n }\n}\n\nexport function getFileInfo(filePath: string) {\n return {\n path: path.normalize(filePath),\n contents: readFileSync(filePath, 'utf8'),\n language: getLanguage(filePath),\n };\n}\n\nexport function getAppDelegate(projectRoot: string): AppDelegateProjectFile {\n const filePath = getAppDelegateFilePath(projectRoot);\n return getFileInfo(filePath);\n}\n\nexport function getSourceRoot(projectRoot: string): string {\n const appDelegate = getAppDelegate(projectRoot);\n return path.dirname(appDelegate.path);\n}\n\nexport function findSchemePaths(projectRoot: string): string[] {\n return globSync('ios/*.xcodeproj/xcshareddata/xcschemes/*.xcscheme', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n}\n\nexport function findSchemeNames(projectRoot: string): string[] {\n const schemePaths = findSchemePaths(projectRoot);\n return schemePaths.map((schemePath) => path.parse(schemePath).name);\n}\n\nexport function getAllXcodeProjectPaths(projectRoot: string): string[] {\n const iosFolder = 'ios';\n const pbxprojPaths = globSync('ios/**/*.xcodeproj', { cwd: projectRoot, ignore: ignoredPaths })\n .filter(\n (project) => !/test|example|sample/i.test(project) || path.dirname(project) === iosFolder\n )\n // sort alphabetically to ensure this works the same across different devices (Fail in CI (linux) without this)\n .sort()\n .sort((a, b) => {\n const isAInIos = path.dirname(a) === iosFolder;\n const isBInIos = path.dirname(b) === iosFolder;\n // preserve previous sort order\n if ((isAInIos && isBInIos) || (!isAInIos && !isBInIos)) {\n return 0;\n }\n return isAInIos ? -1 : 1;\n });\n\n if (!pbxprojPaths.length) {\n throw new UnexpectedError(\n `Failed to locate the ios/*.xcodeproj files relative to path \"${projectRoot}\".`\n );\n }\n return pbxprojPaths.map((value) => path.join(projectRoot, value));\n}\n\n/**\n * Get the pbxproj for the given path\n */\nexport function getXcodeProjectPath(projectRoot: string): string {\n const [using, ...extra] = getAllXcodeProjectPaths(projectRoot);\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'xcodeproj',\n fileName: '*.xcodeproj',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAllPBXProjectPaths(projectRoot: string): string[] {\n const projectPaths = getAllXcodeProjectPaths(projectRoot);\n const paths = projectPaths\n .map((value) => path.join(value, 'project.pbxproj'))\n .filter((value) => existsSync(value));\n\n if (!paths.length) {\n throw new UnexpectedError(\n `Failed to locate the ios/*.xcodeproj/project.pbxproj files relative to path \"${projectRoot}\".`\n );\n }\n return paths;\n}\n\nexport function getPBXProjectPath(projectRoot: string): string {\n const [using, ...extra] = getAllPBXProjectPaths(projectRoot);\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'project-pbxproj',\n fileName: 'project.pbxproj',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAllInfoPlistPaths(projectRoot: string): string[] {\n const paths = globSync('ios/*/Info.plist', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n }).sort(\n // longer name means more suffixes, we want the shortest possible one to be first.\n (a, b) => a.length - b.length\n );\n\n if (!paths.length) {\n throw new UnexpectedError(\n `Failed to locate Info.plist files relative to path \"${projectRoot}\".`\n );\n }\n return paths;\n}\n\nexport function getInfoPlistPath(projectRoot: string): string {\n const [using, ...extra] = getAllInfoPlistPaths(projectRoot);\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'info-plist',\n fileName: 'Info.plist',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAllEntitlementsPaths(projectRoot: string): string[] {\n const paths = globSync('ios/*/*.entitlements', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n return paths;\n}\n\n/**\n * @deprecated: use Entitlements.getEntitlementsPath instead\n */\nexport function getEntitlementsPath(projectRoot: string): string | null {\n return Entitlements.getEntitlementsPath(projectRoot);\n}\n\nexport function getSupportingPath(projectRoot: string): string {\n return path.resolve(projectRoot, 'ios', path.basename(getSourceRoot(projectRoot)), 'Supporting');\n}\n\nexport function getExpoPlistPath(projectRoot: string): string {\n const supportingPath = getSupportingPath(projectRoot);\n return path.join(supportingPath, 'Expo.plist');\n}\n\nfunction warnMultipleFiles({\n tag,\n fileName,\n projectRoot,\n using,\n extra,\n}: {\n tag: string;\n fileName: string;\n projectRoot?: string;\n using: string;\n extra: string[];\n}) {\n const usingPath = projectRoot ? path.relative(projectRoot, using) : using;\n const extraPaths = projectRoot ? extra.map((v) => path.relative(projectRoot, v)) : extra;\n addWarningIOS(\n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AQ;EACRX,WAAW;EACXC,KAAK;EACLC;AAOF,CAAC,EAAE;EACD,MAAM2D,SAAS,GAAG7D,WAAW,GAAG5B,IAAI,CAAD,CAAC,CAAC0F,QAAQ,CAAC9D,WAAW,EAAEC,KAAK,CAAC,GAAGA,KAAK;EACzE,MAAM8D,UAAU,GAAG/D,WAAW,GAAGE,KAAK,CAAC4B,GAAG,CAAEkC,CAAC,IAAK5F,IAAI,CAAD,CAAC,CAAC0F,QAAQ,CAAC9D,WAAW,EAAEgE,CAAC,CAAC,CAAC,GAAG9D,KAAK;EACxF,IAAA+D,yBAAa,EACV,SAAQvD,GAAI,EAAC,EACb,kBAAiBC,QAAS,uBAAsBkD,SAAU,qBAAoBK,IAAI,CAACC,SAAS,CAC3FJ,UACF,CAAE,EACJ,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"Paths.js","names":["_fs","data","require","_glob","path","_interopRequireWildcard","Entitlements","_errors","_warnings","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ignoredPaths","getAppDelegateHeaderFilePath","projectRoot","using","extra","globSync","absolute","cwd","ignore","UnexpectedError","length","warnMultipleFiles","tag","fileName","getAppDelegateFilePath","getAppDelegateObjcHeaderFilePath","getPodfilePath","getLanguage","filePath","extension","extname","basename","getFileInfo","normalize","contents","readFileSync","language","getAppDelegate","getSourceRoot","appDelegate","dirname","findSchemePaths","findSchemeNames","schemePaths","map","schemePath","parse","name","getAllXcodeProjectPaths","iosFolder","pbxprojPaths","filter","project","test","sort","b","isAInIos","isBInIos","value","join","getXcodeProjectPath","getAllPBXProjectPaths","projectPaths","paths","existsSync","getPBXProjectPath","getAllInfoPlistPaths","getInfoPlistPath","getAllEntitlementsPaths","getEntitlementsPath","getSupportingPath","resolve","getExpoPlistPath","supportingPath","usingPath","relative","extraPaths","v","addWarningIOS","JSON","stringify"],"sources":["../../src/ios/Paths.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'fs';\nimport { sync as globSync } from 'glob';\nimport * as path from 'path';\n\nimport * as Entitlements from './Entitlements';\nimport { UnexpectedError } from '../utils/errors';\nimport { addWarningIOS } from '../utils/warnings';\n\nconst ignoredPaths = ['**/@(Carthage|Pods|vendor|node_modules)/**'];\n\ninterface ProjectFile<L extends string = string> {\n path: string;\n language: L;\n contents: string;\n}\n\ntype AppleLanguage = 'objc' | 'objcpp' | 'swift' | 'rb';\n\nexport type PodfileProjectFile = ProjectFile<'rb'>;\nexport type AppDelegateProjectFile = ProjectFile<AppleLanguage>;\n\nexport function getAppDelegateHeaderFilePath(projectRoot: string): string {\n const [using, ...extra] = globSync('ios/*/AppDelegate.h', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n\n if (!using) {\n throw new UnexpectedError(\n `Could not locate a valid AppDelegate header at root: \"${projectRoot}\"`\n );\n }\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'app-delegate-header',\n fileName: 'AppDelegate',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAppDelegateFilePath(projectRoot: string): string {\n const [using, ...extra] = globSync('ios/*/AppDelegate.@(m|mm|swift)', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n\n if (!using) {\n throw new UnexpectedError(`Could not locate a valid AppDelegate at root: \"${projectRoot}\"`);\n }\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'app-delegate',\n fileName: 'AppDelegate',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAppDelegateObjcHeaderFilePath(projectRoot: string): string {\n const [using, ...extra] = globSync('ios/*/AppDelegate.h', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n\n if (!using) {\n throw new UnexpectedError(`Could not locate a valid AppDelegate.h at root: \"${projectRoot}\"`);\n }\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'app-delegate-objc-header',\n fileName: 'AppDelegate.h',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getPodfilePath(projectRoot: string): string {\n const [using, ...extra] = globSync('ios/Podfile', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n\n if (!using) {\n throw new UnexpectedError(`Could not locate a valid Podfile at root: \"${projectRoot}\"`);\n }\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'podfile',\n fileName: 'Podfile',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nfunction getLanguage(filePath: string): AppleLanguage {\n const extension = path.extname(filePath);\n if (!extension && path.basename(filePath) === 'Podfile') {\n return 'rb';\n }\n switch (extension) {\n case '.mm':\n return 'objcpp';\n case '.m':\n case '.h':\n return 'objc';\n case '.swift':\n return 'swift';\n default:\n throw new UnexpectedError(`Unexpected iOS file extension: ${extension}`);\n }\n}\n\nexport function getFileInfo(filePath: string) {\n return {\n path: path.normalize(filePath),\n contents: readFileSync(filePath, 'utf8'),\n language: getLanguage(filePath),\n };\n}\n\nexport function getAppDelegate(projectRoot: string): AppDelegateProjectFile {\n const filePath = getAppDelegateFilePath(projectRoot);\n return getFileInfo(filePath);\n}\n\nexport function getSourceRoot(projectRoot: string): string {\n const appDelegate = getAppDelegate(projectRoot);\n return path.dirname(appDelegate.path);\n}\n\nexport function findSchemePaths(projectRoot: string): string[] {\n return globSync('ios/*.xcodeproj/xcshareddata/xcschemes/*.xcscheme', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n}\n\nexport function findSchemeNames(projectRoot: string): string[] {\n const schemePaths = findSchemePaths(projectRoot);\n return schemePaths.map((schemePath) => path.parse(schemePath).name);\n}\n\nexport function getAllXcodeProjectPaths(projectRoot: string): string[] {\n const iosFolder = 'ios';\n const pbxprojPaths = globSync('ios/**/*.xcodeproj', { cwd: projectRoot, ignore: ignoredPaths })\n .filter(\n (project) => !/test|example|sample/i.test(project) || path.dirname(project) === iosFolder\n )\n // sort alphabetically to ensure this works the same across different devices (Fail in CI (linux) without this)\n .sort()\n .sort((a, b) => {\n const isAInIos = path.dirname(a) === iosFolder;\n const isBInIos = path.dirname(b) === iosFolder;\n // preserve previous sort order\n if ((isAInIos && isBInIos) || (!isAInIos && !isBInIos)) {\n return 0;\n }\n return isAInIos ? -1 : 1;\n });\n\n if (!pbxprojPaths.length) {\n throw new UnexpectedError(\n `Failed to locate the ios/*.xcodeproj files relative to path \"${projectRoot}\".`\n );\n }\n return pbxprojPaths.map((value) => path.join(projectRoot, value));\n}\n\n/**\n * Get the pbxproj for the given path\n */\nexport function getXcodeProjectPath(projectRoot: string): string {\n const [using, ...extra] = getAllXcodeProjectPaths(projectRoot);\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'xcodeproj',\n fileName: '*.xcodeproj',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAllPBXProjectPaths(projectRoot: string): string[] {\n const projectPaths = getAllXcodeProjectPaths(projectRoot);\n const paths = projectPaths\n .map((value) => path.join(value, 'project.pbxproj'))\n .filter((value) => existsSync(value));\n\n if (!paths.length) {\n throw new UnexpectedError(\n `Failed to locate the ios/*.xcodeproj/project.pbxproj files relative to path \"${projectRoot}\".`\n );\n }\n return paths;\n}\n\nexport function getPBXProjectPath(projectRoot: string): string {\n const [using, ...extra] = getAllPBXProjectPaths(projectRoot);\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'project-pbxproj',\n fileName: 'project.pbxproj',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAllInfoPlistPaths(projectRoot: string): string[] {\n const paths = globSync('ios/*/Info.plist', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n }).sort(\n // longer name means more suffixes, we want the shortest possible one to be first.\n (a, b) => a.length - b.length\n );\n\n if (!paths.length) {\n throw new UnexpectedError(\n `Failed to locate Info.plist files relative to path \"${projectRoot}\".`\n );\n }\n return paths;\n}\n\nexport function getInfoPlistPath(projectRoot: string): string {\n const [using, ...extra] = getAllInfoPlistPaths(projectRoot);\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'info-plist',\n fileName: 'Info.plist',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAllEntitlementsPaths(projectRoot: string): string[] {\n const paths = globSync('ios/*/*.entitlements', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n return paths;\n}\n\n/**\n * @deprecated: use Entitlements.getEntitlementsPath instead\n */\nexport function getEntitlementsPath(projectRoot: string): string | null {\n return Entitlements.getEntitlementsPath(projectRoot);\n}\n\nexport function getSupportingPath(projectRoot: string): string {\n return path.resolve(projectRoot, 'ios', path.basename(getSourceRoot(projectRoot)), 'Supporting');\n}\n\nexport function getExpoPlistPath(projectRoot: string): string {\n const supportingPath = getSupportingPath(projectRoot);\n return path.join(supportingPath, 'Expo.plist');\n}\n\nfunction warnMultipleFiles({\n tag,\n fileName,\n projectRoot,\n using,\n extra,\n}: {\n tag: string;\n fileName: string;\n projectRoot?: string;\n using: string;\n extra: string[];\n}) {\n const usingPath = projectRoot ? path.relative(projectRoot, using) : using;\n const extraPaths = projectRoot ? extra.map((v) => path.relative(projectRoot, v)) : extra;\n addWarningIOS(\n `paths-${tag}`,\n `Found multiple ${fileName} file paths, using \"${usingPath}\". Ignored paths: ${JSON.stringify(\n extraPaths\n )}`\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,KAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAE,IAAA,Y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GAAGH,iBAAiB,CAAC1D,WAAW,CAAC;EACrD,OAAO5B,IAAI,CAAD,CAAC,CAAC2E,IAAI,CAACc,cAAc,EAAE,YAAY,CAAC;AAChD;AAEA,SAASpD,iBAAiBA,CAAC;EACzBC,GAAG;EACHC,QAAQ;EACRX,WAAW;EACXC,KAAK;EACLC;AAOF,CAAC,EAAE;EACD,MAAM4D,SAAS,GAAG9D,WAAW,GAAG5B,IAAI,CAAD,CAAC,CAAC2F,QAAQ,CAAC/D,WAAW,EAAEC,KAAK,CAAC,GAAGA,KAAK;EACzE,MAAM+D,UAAU,GAAGhE,WAAW,GAAGE,KAAK,CAAC8B,GAAG,CAAEiC,CAAC,IAAK7F,IAAI,CAAD,CAAC,CAAC2F,QAAQ,CAAC/D,WAAW,EAAEiE,CAAC,CAAC,CAAC,GAAG/D,KAAK;EACxF,IAAAgE,yBAAa,EACV,SAAQxD,GAAI,EAAC,EACb,kBAAiBC,QAAS,uBAAsBmD,SAAU,qBAAoBK,IAAI,CAACC,SAAS,CAC3FJ,UACF,CAAE,EACJ,CAAC;AACH"}
|
|
@@ -3,7 +3,7 @@ import type { JSONObject } from '@expo/json-file';
|
|
|
3
3
|
import type { XcodeProject } from 'xcode';
|
|
4
4
|
import type { ConfigPlugin, Mod } from '../Plugin.types';
|
|
5
5
|
import type { ExpoPlist, InfoPlist } from '../ios/IosConfig.types';
|
|
6
|
-
import type { AppDelegateProjectFile } from '../ios/Paths';
|
|
6
|
+
import type { AppDelegateProjectFile, PodfileProjectFile } from '../ios/Paths';
|
|
7
7
|
type MutateInfoPlistAction = (expo: ExpoConfig, infoPlist: InfoPlist) => Promise<InfoPlist> | InfoPlist;
|
|
8
8
|
/**
|
|
9
9
|
* Helper method for creating mods from existing config functions.
|
|
@@ -60,6 +60,13 @@ export declare const withExpoPlist: ConfigPlugin<Mod<ExpoPlist>>;
|
|
|
60
60
|
* @param action
|
|
61
61
|
*/
|
|
62
62
|
export declare const withXcodeProject: ConfigPlugin<Mod<XcodeProject>>;
|
|
63
|
+
/**
|
|
64
|
+
* Provides the Podfile for modification.
|
|
65
|
+
*
|
|
66
|
+
* @param config
|
|
67
|
+
* @param action
|
|
68
|
+
*/
|
|
69
|
+
export declare const withPodfile: ConfigPlugin<Mod<PodfileProjectFile>>;
|
|
63
70
|
/**
|
|
64
71
|
* Provides the Podfile.properties.json for modification.
|
|
65
72
|
*
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createEntitlementsPlugin = createEntitlementsPlugin;
|
|
7
7
|
exports.createInfoPlistPlugin = createInfoPlistPlugin;
|
|
8
8
|
exports.createInfoPlistPluginWithPropertyGuard = createInfoPlistPluginWithPropertyGuard;
|
|
9
|
-
exports.withXcodeProject = exports.withPodfileProperties = exports.withInfoPlist = exports.withExpoPlist = exports.withEntitlementsPlist = exports.withAppDelegate = void 0;
|
|
9
|
+
exports.withXcodeProject = exports.withPodfileProperties = exports.withPodfile = exports.withInfoPlist = exports.withExpoPlist = exports.withEntitlementsPlist = exports.withAppDelegate = void 0;
|
|
10
10
|
function _withMod() {
|
|
11
11
|
const data = require("./withMod");
|
|
12
12
|
_withMod = function () {
|
|
@@ -173,12 +173,27 @@ const withXcodeProject = (config, action) => {
|
|
|
173
173
|
};
|
|
174
174
|
|
|
175
175
|
/**
|
|
176
|
-
* Provides the Podfile
|
|
176
|
+
* Provides the Podfile for modification.
|
|
177
177
|
*
|
|
178
178
|
* @param config
|
|
179
179
|
* @param action
|
|
180
180
|
*/
|
|
181
181
|
exports.withXcodeProject = withXcodeProject;
|
|
182
|
+
const withPodfile = (config, action) => {
|
|
183
|
+
return (0, _withMod().withMod)(config, {
|
|
184
|
+
platform: 'ios',
|
|
185
|
+
mod: 'podfile',
|
|
186
|
+
action
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Provides the Podfile.properties.json for modification.
|
|
192
|
+
*
|
|
193
|
+
* @param config
|
|
194
|
+
* @param action
|
|
195
|
+
*/
|
|
196
|
+
exports.withPodfile = withPodfile;
|
|
182
197
|
const withPodfileProperties = (config, action) => {
|
|
183
198
|
return (0, _withMod().withMod)(config, {
|
|
184
199
|
platform: 'ios',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ios-plugins.js","names":["_withMod","data","require","_obj","_warnings","createInfoPlistPlugin","action","name","withUnknown","config","withInfoPlist","modResults","Object","defineProperty","value","createInfoPlistPluginWithPropertyGuard","settings","existingProperty","expoPropertyGetter","get","expoConfigProperty","modRawConfig","ios","infoPlist","infoPlistProperty","undefined","addWarningIOS","createEntitlementsPlugin","withEntitlementsPlist","withAppDelegate","withMod","platform","mod","exports","entitlements","withExpoPlist","withXcodeProject","withPodfileProperties"],"sources":["../../src/plugins/ios-plugins.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport type { JSONObject } from '@expo/json-file';\nimport type { XcodeProject } from 'xcode';\n\nimport { withMod } from './withMod';\nimport type { ConfigPlugin, Mod } from '../Plugin.types';\nimport type { ExpoPlist, InfoPlist } from '../ios/IosConfig.types';\nimport type { AppDelegateProjectFile } from '../ios/Paths';\nimport { get } from '../utils/obj';\nimport { addWarningIOS } from '../utils/warnings';\n\ntype MutateInfoPlistAction = (\n expo: ExpoConfig,\n infoPlist: InfoPlist\n) => Promise<InfoPlist> | InfoPlist;\n\n/**\n * Helper method for creating mods from existing config functions.\n *\n * @param action\n */\nexport function createInfoPlistPlugin(action: MutateInfoPlistAction, name?: string): ConfigPlugin {\n const withUnknown: ConfigPlugin = (config) =>\n withInfoPlist(config, async (config) => {\n config.modResults = await action(config, config.modResults);\n return config;\n });\n if (name) {\n Object.defineProperty(withUnknown, 'name', {\n value: name,\n });\n }\n return withUnknown;\n}\n\nexport function createInfoPlistPluginWithPropertyGuard(\n action: MutateInfoPlistAction,\n settings: {\n infoPlistProperty: string;\n expoConfigProperty: string;\n expoPropertyGetter?: (config: ExpoConfig) => string;\n },\n name?: string\n): ConfigPlugin {\n const withUnknown: ConfigPlugin = (config) =>\n withInfoPlist(config, async (config) => {\n const existingProperty = settings.expoPropertyGetter\n ? settings.expoPropertyGetter(config)\n : get(config, settings.expoConfigProperty);\n // If the user explicitly sets a value in the infoPlist, we should respect that.\n if (config.modRawConfig.ios?.infoPlist?.[settings.infoPlistProperty] === undefined) {\n config.modResults = await action(config, config.modResults);\n } else if (existingProperty !== undefined) {\n // Only warn if there is a conflict.\n addWarningIOS(\n settings.expoConfigProperty,\n `\"ios.infoPlist.${settings.infoPlistProperty}\" is set in the config. Ignoring abstract property \"${settings.expoConfigProperty}\": ${existingProperty}`\n );\n }\n\n return config;\n });\n if (name) {\n Object.defineProperty(withUnknown, 'name', {\n value: name,\n });\n }\n return withUnknown;\n}\n\ntype MutateEntitlementsPlistAction = (expo: ExpoConfig, entitlements: JSONObject) => JSONObject;\n\n/**\n * Helper method for creating mods from existing config functions.\n *\n * @param action\n */\nexport function createEntitlementsPlugin(\n action: MutateEntitlementsPlistAction,\n name: string\n): ConfigPlugin {\n const withUnknown: ConfigPlugin = (config) =>\n withEntitlementsPlist(config, async (config) => {\n config.modResults = await action(config, config.modResults);\n return config;\n });\n if (name) {\n Object.defineProperty(withUnknown, 'name', {\n value: name,\n });\n }\n return withUnknown;\n}\n\n/**\n * Provides the AppDelegate file for modification.\n *\n * @param config\n * @param action\n */\nexport const withAppDelegate: ConfigPlugin<Mod<AppDelegateProjectFile>> = (config, action) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'appDelegate',\n action,\n });\n};\n\n/**\n * Provides the Info.plist file for modification.\n * Keeps the config's expo.ios.infoPlist object in sync with the data.\n *\n * @param config\n * @param action\n */\nexport const withInfoPlist: ConfigPlugin<Mod<InfoPlist>> = (config, action) => {\n return withMod<InfoPlist>(config, {\n platform: 'ios',\n mod: 'infoPlist',\n async action(config) {\n config = await action(config);\n if (!config.ios) {\n config.ios = {};\n }\n config.ios.infoPlist = config.modResults;\n return config;\n },\n });\n};\n\n/**\n * Provides the main .entitlements file for modification.\n * Keeps the config's expo.ios.entitlements object in sync with the data.\n *\n * @param config\n * @param action\n */\nexport const withEntitlementsPlist: ConfigPlugin<Mod<JSONObject>> = (config, action) => {\n return withMod<JSONObject>(config, {\n platform: 'ios',\n mod: 'entitlements',\n async action(config) {\n config = await action(config);\n if (!config.ios) {\n config.ios = {};\n }\n config.ios.entitlements = config.modResults;\n return config;\n },\n });\n};\n\n/**\n * Provides the Expo.plist for modification.\n *\n * @param config\n * @param action\n */\nexport const withExpoPlist: ConfigPlugin<Mod<ExpoPlist>> = (config, action) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'expoPlist',\n action,\n });\n};\n\n/**\n * Provides the main .xcodeproj for modification.\n *\n * @param config\n * @param action\n */\nexport const withXcodeProject: ConfigPlugin<Mod<XcodeProject>> = (config, action) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'xcodeproj',\n action,\n });\n};\n\n/**\n * Provides the Podfile.properties.json for modification.\n *\n * @param config\n * @param action\n */\nexport const withPodfileProperties: ConfigPlugin<Mod<Record<string, string>>> = (\n config,\n action\n) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'podfileProperties',\n action,\n });\n};\n"],"mappings":";;;;;;;;;AAIA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA;AACA;AACA;AACA;AACA;AACO,SAASI,qBAAqBA,CAACC,MAA6B,EAAEC,IAAa,EAAgB;E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AwB,kBAAO,EAACrB,MAAM,EAAE;IACrBsB,QAAQ,EAAE,KAAK;IACfC,GAAG,EAAE,mBAAmB;IACxB1B;EACF,CAAC,CAAC;AACJ,CAAC;AAAC2B,OAAA,CAAAI,qBAAA,GAAAA,qBAAA"}
|
|
1
|
+
{"version":3,"file":"ios-plugins.js","names":["_withMod","data","require","_obj","_warnings","createInfoPlistPlugin","action","name","withUnknown","config","withInfoPlist","modResults","Object","defineProperty","value","createInfoPlistPluginWithPropertyGuard","settings","existingProperty","expoPropertyGetter","get","expoConfigProperty","modRawConfig","ios","infoPlist","infoPlistProperty","undefined","addWarningIOS","createEntitlementsPlugin","withEntitlementsPlist","withAppDelegate","withMod","platform","mod","exports","entitlements","withExpoPlist","withXcodeProject","withPodfile","withPodfileProperties"],"sources":["../../src/plugins/ios-plugins.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport type { JSONObject } from '@expo/json-file';\nimport type { XcodeProject } from 'xcode';\n\nimport { withMod } from './withMod';\nimport type { ConfigPlugin, Mod } from '../Plugin.types';\nimport type { ExpoPlist, InfoPlist } from '../ios/IosConfig.types';\nimport type { AppDelegateProjectFile, PodfileProjectFile } from '../ios/Paths';\nimport { get } from '../utils/obj';\nimport { addWarningIOS } from '../utils/warnings';\n\ntype MutateInfoPlistAction = (\n expo: ExpoConfig,\n infoPlist: InfoPlist\n) => Promise<InfoPlist> | InfoPlist;\n\n/**\n * Helper method for creating mods from existing config functions.\n *\n * @param action\n */\nexport function createInfoPlistPlugin(action: MutateInfoPlistAction, name?: string): ConfigPlugin {\n const withUnknown: ConfigPlugin = (config) =>\n withInfoPlist(config, async (config) => {\n config.modResults = await action(config, config.modResults);\n return config;\n });\n if (name) {\n Object.defineProperty(withUnknown, 'name', {\n value: name,\n });\n }\n return withUnknown;\n}\n\nexport function createInfoPlistPluginWithPropertyGuard(\n action: MutateInfoPlistAction,\n settings: {\n infoPlistProperty: string;\n expoConfigProperty: string;\n expoPropertyGetter?: (config: ExpoConfig) => string;\n },\n name?: string\n): ConfigPlugin {\n const withUnknown: ConfigPlugin = (config) =>\n withInfoPlist(config, async (config) => {\n const existingProperty = settings.expoPropertyGetter\n ? settings.expoPropertyGetter(config)\n : get(config, settings.expoConfigProperty);\n // If the user explicitly sets a value in the infoPlist, we should respect that.\n if (config.modRawConfig.ios?.infoPlist?.[settings.infoPlistProperty] === undefined) {\n config.modResults = await action(config, config.modResults);\n } else if (existingProperty !== undefined) {\n // Only warn if there is a conflict.\n addWarningIOS(\n settings.expoConfigProperty,\n `\"ios.infoPlist.${settings.infoPlistProperty}\" is set in the config. Ignoring abstract property \"${settings.expoConfigProperty}\": ${existingProperty}`\n );\n }\n\n return config;\n });\n if (name) {\n Object.defineProperty(withUnknown, 'name', {\n value: name,\n });\n }\n return withUnknown;\n}\n\ntype MutateEntitlementsPlistAction = (expo: ExpoConfig, entitlements: JSONObject) => JSONObject;\n\n/**\n * Helper method for creating mods from existing config functions.\n *\n * @param action\n */\nexport function createEntitlementsPlugin(\n action: MutateEntitlementsPlistAction,\n name: string\n): ConfigPlugin {\n const withUnknown: ConfigPlugin = (config) =>\n withEntitlementsPlist(config, async (config) => {\n config.modResults = await action(config, config.modResults);\n return config;\n });\n if (name) {\n Object.defineProperty(withUnknown, 'name', {\n value: name,\n });\n }\n return withUnknown;\n}\n\n/**\n * Provides the AppDelegate file for modification.\n *\n * @param config\n * @param action\n */\nexport const withAppDelegate: ConfigPlugin<Mod<AppDelegateProjectFile>> = (config, action) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'appDelegate',\n action,\n });\n};\n\n/**\n * Provides the Info.plist file for modification.\n * Keeps the config's expo.ios.infoPlist object in sync with the data.\n *\n * @param config\n * @param action\n */\nexport const withInfoPlist: ConfigPlugin<Mod<InfoPlist>> = (config, action) => {\n return withMod<InfoPlist>(config, {\n platform: 'ios',\n mod: 'infoPlist',\n async action(config) {\n config = await action(config);\n if (!config.ios) {\n config.ios = {};\n }\n config.ios.infoPlist = config.modResults;\n return config;\n },\n });\n};\n\n/**\n * Provides the main .entitlements file for modification.\n * Keeps the config's expo.ios.entitlements object in sync with the data.\n *\n * @param config\n * @param action\n */\nexport const withEntitlementsPlist: ConfigPlugin<Mod<JSONObject>> = (config, action) => {\n return withMod<JSONObject>(config, {\n platform: 'ios',\n mod: 'entitlements',\n async action(config) {\n config = await action(config);\n if (!config.ios) {\n config.ios = {};\n }\n config.ios.entitlements = config.modResults;\n return config;\n },\n });\n};\n\n/**\n * Provides the Expo.plist for modification.\n *\n * @param config\n * @param action\n */\nexport const withExpoPlist: ConfigPlugin<Mod<ExpoPlist>> = (config, action) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'expoPlist',\n action,\n });\n};\n\n/**\n * Provides the main .xcodeproj for modification.\n *\n * @param config\n * @param action\n */\nexport const withXcodeProject: ConfigPlugin<Mod<XcodeProject>> = (config, action) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'xcodeproj',\n action,\n });\n};\n\n/**\n * Provides the Podfile for modification.\n *\n * @param config\n * @param action\n */\nexport const withPodfile: ConfigPlugin<Mod<PodfileProjectFile>> = (config, action) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'podfile',\n action,\n });\n};\n\n/**\n * Provides the Podfile.properties.json for modification.\n *\n * @param config\n * @param action\n */\nexport const withPodfileProperties: ConfigPlugin<Mod<Record<string, string>>> = (\n config,\n action\n) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'podfileProperties',\n action,\n });\n};\n"],"mappings":";;;;;;;;;AAIA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAA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CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALA2B,OAAA,CAAAG,gBAAA,GAAAA,gBAAA;AAMO,MAAMC,WAAkD,GAAGA,CAAC5B,MAAM,EAAEH,MAAM,KAAK;EACpF,OAAO,IAAAwB,kBAAO,EAACrB,MAAM,EAAE;IACrBsB,QAAQ,EAAE,KAAK;IACfC,GAAG,EAAE,SAAS;IACd1B;EACF,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALA2B,OAAA,CAAAI,WAAA,GAAAA,WAAA;AAMO,MAAMC,qBAAgE,GAAGA,CAC9E7B,MAAM,EACNH,MAAM,KACH;EACH,OAAO,IAAAwB,kBAAO,EAACrB,MAAM,EAAE;IACrBsB,QAAQ,EAAE,KAAK;IACfC,GAAG,EAAE,mBAAmB;IACxB1B;EACF,CAAC,CAAC;AACJ,CAAC;AAAC2B,OAAA,CAAAK,qBAAA,GAAAA,qBAAA"}
|
|
@@ -12,6 +12,7 @@ declare const defaultProviders: {
|
|
|
12
12
|
xcodeproj: import("./createBaseMod").BaseModProviderMethods<xcode.XcodeProject, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
13
13
|
infoPlist: import("./createBaseMod").BaseModProviderMethods<InfoPlist, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
14
14
|
entitlements: import("./createBaseMod").BaseModProviderMethods<JSONObject, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
15
|
+
podfile: import("./createBaseMod").BaseModProviderMethods<Paths.PodfileProjectFile, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
15
16
|
podfileProperties: import("./createBaseMod").BaseModProviderMethods<Record<string, JSONValue>, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
16
17
|
};
|
|
17
18
|
type IosDefaultProviders = typeof defaultProviders;
|
|
@@ -26,6 +27,7 @@ export declare function getIosModFileProviders(): {
|
|
|
26
27
|
xcodeproj: import("./createBaseMod").BaseModProviderMethods<xcode.XcodeProject, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
27
28
|
infoPlist: import("./createBaseMod").BaseModProviderMethods<InfoPlist, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
28
29
|
entitlements: import("./createBaseMod").BaseModProviderMethods<JSONObject, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
30
|
+
podfile: import("./createBaseMod").BaseModProviderMethods<Paths.PodfileProjectFile, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
29
31
|
podfileProperties: import("./createBaseMod").BaseModProviderMethods<Record<string, JSONValue>, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
30
32
|
};
|
|
31
33
|
export {};
|
|
@@ -375,6 +375,27 @@ const defaultProviders = {
|
|
|
375
375
|
await writeFile(filePath, _plist().default.build((0, _sortObject().sortObject)(config.modResults)));
|
|
376
376
|
}
|
|
377
377
|
}),
|
|
378
|
+
podfile: (0, _createBaseMod().provider)({
|
|
379
|
+
getFilePath({
|
|
380
|
+
modRequest: {
|
|
381
|
+
projectRoot
|
|
382
|
+
}
|
|
383
|
+
}) {
|
|
384
|
+
return _ios().Paths.getPodfilePath(projectRoot);
|
|
385
|
+
},
|
|
386
|
+
// @ts-expect-error
|
|
387
|
+
async read(filePath) {
|
|
388
|
+
// Note(cedric): this file is ruby, which is a 1-value subset of AppleLanguage and fails the type check
|
|
389
|
+
return _ios().Paths.getFileInfo(filePath);
|
|
390
|
+
},
|
|
391
|
+
async write(filePath, {
|
|
392
|
+
modResults: {
|
|
393
|
+
contents
|
|
394
|
+
}
|
|
395
|
+
}) {
|
|
396
|
+
await writeFile(filePath, contents);
|
|
397
|
+
}
|
|
398
|
+
}),
|
|
378
399
|
// Append a rule to supply Podfile.properties.json data to mods on `mods.ios.podfileProperties`
|
|
379
400
|
podfileProperties: (0, _createBaseMod().provider)({
|
|
380
401
|
isIntrospective: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIosBaseMods.js","names":["_jsonFile","data","_interopRequireDefault","require","_plist","_assert","_fs","_interopRequireWildcard","_path","_xcode","_createBaseMod","_ios","_Entitlements","_Xcodeproj","_getInfoPlistPath","_modules","_sortObject","_warnings","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","readFile","writeFile","promises","getEntitlementsPlistTemplate","getInfoPlistTemplate","CFBundleDevelopmentRegion","CFBundleExecutable","CFBundleIdentifier","CFBundleName","CFBundlePackageType","CFBundleInfoDictionaryVersion","CFBundleSignature","LSRequiresIPhoneOS","NSAppTransportSecurity","NSAllowsArbitraryLoads","NSExceptionDomains","localhost","NSExceptionAllowsInsecureHTTPLoads","UILaunchStoryboardName","UIRequiredDeviceCapabilities","UIViewControllerBasedStatusBarAppearance","UIStatusBarStyle","CADisableMinimumFrameDurationOnPhone","defaultProviders","dangerous","provider","getFilePath","read","write","finalized","appDelegate","modRequest","projectRoot","Paths","getAppDelegateFilePath","filePath","getFileInfo","modResults","contents","expoPlist","isIntrospective","platformProjectRoot","projectName","supportingDirectory","path","join","resolve","introspect","plist","parse","error","build","sortObject","xcodeproj","getPBXProjectPath","project","xcode","parseSync","writeSync","infoPlist","config","getPbxproj","infoPlistBuildProperty","getInfoPlistPathFromPbxproj","infoPlistPath","fileExists","addWarningIOS","getInfoPlistPath","ios","assert","entitlements","ensureApplicationTargetEntitlementsFileConfigured","Entitlements","getEntitlementsPath","ignoreExistingNativeFiles","fs","existsSync","podfileProperties","results","JsonFile","readAsync","writeAsync","withIosBaseMods","providers","props","withGeneratedBaseMods","platform","getIosModFileProviders"],"sources":["../../src/plugins/withIosBaseMods.ts"],"sourcesContent":["import JsonFile, { JSONObject, JSONValue } from '@expo/json-file';\nimport plist from '@expo/plist';\nimport assert from 'assert';\nimport fs, { promises } from 'fs';\nimport path from 'path';\nimport xcode, { XcodeProject } from 'xcode';\n\nimport { ForwardedBaseModOptions, provider, withGeneratedBaseMods } from './createBaseMod';\nimport { ExportedConfig, ModConfig } from '../Plugin.types';\nimport { Entitlements, Paths } from '../ios';\nimport { ensureApplicationTargetEntitlementsFileConfigured } from '../ios/Entitlements';\nimport { InfoPlist } from '../ios/IosConfig.types';\nimport { getPbxproj } from '../ios/utils/Xcodeproj';\nimport { getInfoPlistPathFromPbxproj } from '../ios/utils/getInfoPlistPath';\nimport { fileExists } from '../utils/modules';\nimport { sortObject } from '../utils/sortObject';\nimport { addWarningIOS } from '../utils/warnings';\n\nconst { readFile, writeFile } = promises;\n\ntype IosModName = keyof Required<ModConfig>['ios'];\n\nfunction getEntitlementsPlistTemplate() {\n // TODO: Fetch the versioned template file if possible\n return {};\n}\n\nfunction getInfoPlistTemplate() {\n // TODO: Fetch the versioned template file if possible\n return {\n CFBundleDevelopmentRegion: '$(DEVELOPMENT_LANGUAGE)',\n CFBundleExecutable: '$(EXECUTABLE_NAME)',\n CFBundleIdentifier: '$(PRODUCT_BUNDLE_IDENTIFIER)',\n CFBundleName: '$(PRODUCT_NAME)',\n CFBundlePackageType: '$(PRODUCT_BUNDLE_PACKAGE_TYPE)',\n CFBundleInfoDictionaryVersion: '6.0',\n CFBundleSignature: '????',\n LSRequiresIPhoneOS: true,\n NSAppTransportSecurity: {\n NSAllowsArbitraryLoads: true,\n NSExceptionDomains: {\n localhost: {\n NSExceptionAllowsInsecureHTTPLoads: true,\n },\n },\n },\n UILaunchStoryboardName: 'SplashScreen',\n UIRequiredDeviceCapabilities: ['armv7'],\n UIViewControllerBasedStatusBarAppearance: false,\n UIStatusBarStyle: 'UIStatusBarStyleDefault',\n CADisableMinimumFrameDurationOnPhone: true,\n };\n}\n\nconst defaultProviders = {\n dangerous: provider<unknown>({\n getFilePath() {\n return '';\n },\n async read() {\n return {};\n },\n async write() {},\n }),\n finalized: provider<unknown>({\n getFilePath() {\n return '';\n },\n async read() {\n return {};\n },\n async write() {},\n }),\n // Append a rule to supply AppDelegate data to mods on `mods.ios.appDelegate`\n appDelegate: provider<Paths.AppDelegateProjectFile>({\n getFilePath({ modRequest: { projectRoot } }) {\n // TODO: Get application AppDelegate file from pbxproj.\n return Paths.getAppDelegateFilePath(projectRoot);\n },\n async read(filePath) {\n return Paths.getFileInfo(filePath);\n },\n async write(filePath: string, { modResults: { contents } }) {\n await writeFile(filePath, contents);\n },\n }),\n // Append a rule to supply Expo.plist data to mods on `mods.ios.expoPlist`\n expoPlist: provider<JSONObject>({\n isIntrospective: true,\n getFilePath({ modRequest: { platformProjectRoot, projectName } }) {\n const supportingDirectory = path.join(platformProjectRoot, projectName!, 'Supporting');\n return path.resolve(supportingDirectory, 'Expo.plist');\n },\n async read(filePath, { modRequest: { introspect } }) {\n try {\n return plist.parse(await readFile(filePath, 'utf8'));\n } catch (error) {\n if (introspect) {\n return {};\n }\n throw error;\n }\n },\n async write(filePath, { modResults, modRequest: { introspect } }) {\n if (introspect) {\n return;\n }\n await writeFile(filePath, plist.build(sortObject(modResults)));\n },\n }),\n // Append a rule to supply .xcodeproj data to mods on `mods.ios.xcodeproj`\n xcodeproj: provider<XcodeProject>({\n getFilePath({ modRequest: { projectRoot } }) {\n return Paths.getPBXProjectPath(projectRoot);\n },\n async read(filePath) {\n const project = xcode.project(filePath);\n project.parseSync();\n return project;\n },\n async write(filePath, { modResults }) {\n await writeFile(filePath, modResults.writeSync());\n },\n }),\n // Append a rule to supply Info.plist data to mods on `mods.ios.infoPlist`\n infoPlist: provider<InfoPlist, ForwardedBaseModOptions>({\n isIntrospective: true,\n async getFilePath(config) {\n let project: xcode.XcodeProject | null = null;\n try {\n project = getPbxproj(config.modRequest.projectRoot);\n } catch {\n // noop\n }\n\n // Only check / warn if a project actually exists, this'll provide\n // more accurate warning messages for users in managed projects.\n if (project) {\n const infoPlistBuildProperty = getInfoPlistPathFromPbxproj(project);\n\n if (infoPlistBuildProperty) {\n //: [root]/myapp/ios/MyApp/Info.plist\n const infoPlistPath = path.join(\n //: myapp/ios\n config.modRequest.platformProjectRoot,\n //: MyApp/Info.plist\n infoPlistBuildProperty\n );\n if (fileExists(infoPlistPath)) {\n return infoPlistPath;\n }\n addWarningIOS(\n 'mods.ios.infoPlist',\n `Info.plist file linked to Xcode project does not exist: ${infoPlistPath}`\n );\n } else {\n addWarningIOS('mods.ios.infoPlist', 'Failed to find Info.plist linked to Xcode project.');\n }\n }\n try {\n // Fallback on glob...\n return await Paths.getInfoPlistPath(config.modRequest.projectRoot);\n } catch (error: any) {\n if (config.modRequest.introspect) {\n // fallback to an empty string in introspection mode.\n return '';\n }\n throw error;\n }\n },\n async read(filePath, config) {\n // Apply all of the Info.plist values to the expo.ios.infoPlist object\n // TODO: Remove this in favor of just overwriting the Info.plist with the Expo object. This will enable people to actually remove values.\n if (!config.ios) config.ios = {};\n if (!config.ios.infoPlist) config.ios.infoPlist = {};\n\n let modResults: InfoPlist;\n try {\n const contents = await readFile(filePath, 'utf8');\n assert(contents, 'Info.plist is empty');\n modResults = plist.parse(contents) as InfoPlist;\n } catch (error: any) {\n // Throw errors in introspection mode.\n if (!config.modRequest.introspect) {\n throw error;\n }\n // Fallback to using the infoPlist object from the Expo config.\n modResults = getInfoPlistTemplate();\n }\n\n config.ios.infoPlist = {\n ...(modResults || {}),\n ...config.ios.infoPlist,\n };\n\n return config.ios.infoPlist!;\n },\n async write(filePath, config) {\n // Update the contents of the static infoPlist object\n if (!config.ios) {\n config.ios = {};\n }\n config.ios.infoPlist = config.modResults;\n\n // Return early without writing, in introspection mode.\n if (config.modRequest.introspect) {\n return;\n }\n\n await writeFile(filePath, plist.build(sortObject(config.modResults)));\n },\n }),\n // Append a rule to supply .entitlements data to mods on `mods.ios.entitlements`\n entitlements: provider<JSONObject, ForwardedBaseModOptions>({\n isIntrospective: true,\n\n async getFilePath(config) {\n try {\n ensureApplicationTargetEntitlementsFileConfigured(config.modRequest.projectRoot);\n return Entitlements.getEntitlementsPath(config.modRequest.projectRoot) ?? '';\n } catch (error: any) {\n if (config.modRequest.introspect) {\n // fallback to an empty string in introspection mode.\n return '';\n }\n throw error;\n }\n },\n\n async read(filePath, config) {\n let modResults: JSONObject;\n try {\n if (!config.modRequest.ignoreExistingNativeFiles && fs.existsSync(filePath)) {\n const contents = await readFile(filePath, 'utf8');\n assert(contents, 'Entitlements plist is empty');\n modResults = plist.parse(contents);\n } else {\n modResults = getEntitlementsPlistTemplate();\n }\n } catch (error: any) {\n // Throw errors in introspection mode.\n if (!config.modRequest.introspect) {\n throw error;\n }\n // Fallback to using the template file.\n modResults = getEntitlementsPlistTemplate();\n }\n\n // Apply all of the .entitlements values to the expo.ios.entitlements object\n // TODO: Remove this in favor of just overwriting the .entitlements with the Expo object. This will enable people to actually remove values.\n if (!config.ios) config.ios = {};\n if (!config.ios.entitlements) config.ios.entitlements = {};\n\n config.ios.entitlements = {\n ...(modResults || {}),\n ...config.ios.entitlements,\n };\n\n return config.ios.entitlements!;\n },\n\n async write(filePath, config) {\n // Update the contents of the static entitlements object\n if (!config.ios) {\n config.ios = {};\n }\n config.ios.entitlements = config.modResults;\n\n // Return early without writing, in introspection mode.\n if (config.modRequest.introspect) {\n return;\n }\n\n await writeFile(filePath, plist.build(sortObject(config.modResults)));\n },\n }),\n\n // Append a rule to supply Podfile.properties.json data to mods on `mods.ios.podfileProperties`\n podfileProperties: provider<Record<string, JSONValue>>({\n isIntrospective: true,\n\n getFilePath({ modRequest: { platformProjectRoot } }) {\n return path.resolve(platformProjectRoot, 'Podfile.properties.json');\n },\n async read(filePath) {\n let results: Record<string, JSONValue> = {};\n try {\n results = await JsonFile.readAsync(filePath);\n } catch {}\n return results;\n },\n async write(filePath, { modResults, modRequest: { introspect } }) {\n if (introspect) {\n return;\n }\n await JsonFile.writeAsync(filePath, modResults);\n },\n }),\n};\n\ntype IosDefaultProviders = typeof defaultProviders;\n\nexport function withIosBaseMods(\n config: ExportedConfig,\n {\n providers,\n ...props\n }: ForwardedBaseModOptions & { providers?: Partial<IosDefaultProviders> } = {}\n): ExportedConfig {\n return withGeneratedBaseMods<IosModName>(config, {\n ...props,\n platform: 'ios',\n providers: providers ?? getIosModFileProviders(),\n });\n}\n\nexport function getIosModFileProviders() {\n return defaultProviders;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,IAAA;EAAA,MAAAL,IAAA,GAAAM,uBAAA,CAAAJ,OAAA;EAAAG,GAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,MAAA;EAAA,MAAAP,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAK,KAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,OAAA;EAAA,MAAAR,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAM,MAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAS,eAAA;EAAA,MAAAT,I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C7C,QAAQ,CAAC;MAC9C,CAAC,CAAC,MAAM,CAAC;MACT,OAAO2C,OAAO;IAChB,CAAC;IACD,MAAMlD,KAAKA,CAACO,QAAQ,EAAE;MAAEE,UAAU;MAAEN,UAAU,EAAE;QAAEgB;MAAW;IAAE,CAAC,EAAE;MAChE,IAAIA,UAAU,EAAE;QACd;MACF;MACA,MAAMgC,mBAAQ,CAACE,UAAU,CAAC9C,QAAQ,EAAEE,UAAU,CAAC;IACjD;EACF,CAAC;AACH,CAAC;AAIM,SAAS6C,eAAeA,CAC7BtB,MAAsB,EACtB;EACEuB,SAAS;EACT,GAAGC;AACmE,CAAC,GAAG,CAAC,CAAC,EAC9D;EAChB,OAAO,IAAAC,sCAAqB,EAAazB,MAAM,EAAE;IAC/C,GAAGwB,KAAK;IACRE,QAAQ,EAAE,KAAK;IACfH,SAAS,EAAEA,SAAS,IAAII,sBAAsB,CAAC;EACjD,CAAC,CAAC;AACJ;AAEO,SAASA,sBAAsBA,CAAA,EAAG;EACvC,OAAOhE,gBAAgB;AACzB"}
|
|
1
|
+
{"version":3,"file":"withIosBaseMods.js","names":["_jsonFile","data","_interopRequireDefault","require","_plist","_assert","_fs","_interopRequireWildcard","_path","_xcode","_createBaseMod","_ios","_Entitlements","_Xcodeproj","_getInfoPlistPath","_modules","_sortObject","_warnings","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","readFile","writeFile","promises","getEntitlementsPlistTemplate","getInfoPlistTemplate","CFBundleDevelopmentRegion","CFBundleExecutable","CFBundleIdentifier","CFBundleName","CFBundlePackageType","CFBundleInfoDictionaryVersion","CFBundleSignature","LSRequiresIPhoneOS","NSAppTransportSecurity","NSAllowsArbitraryLoads","NSExceptionDomains","localhost","NSExceptionAllowsInsecureHTTPLoads","UILaunchStoryboardName","UIRequiredDeviceCapabilities","UIViewControllerBasedStatusBarAppearance","UIStatusBarStyle","CADisableMinimumFrameDurationOnPhone","defaultProviders","dangerous","provider","getFilePath","read","write","finalized","appDelegate","modRequest","projectRoot","Paths","getAppDelegateFilePath","filePath","getFileInfo","modResults","contents","expoPlist","isIntrospective","platformProjectRoot","projectName","supportingDirectory","path","join","resolve","introspect","plist","parse","error","build","sortObject","xcodeproj","getPBXProjectPath","project","xcode","parseSync","writeSync","infoPlist","config","getPbxproj","infoPlistBuildProperty","getInfoPlistPathFromPbxproj","infoPlistPath","fileExists","addWarningIOS","getInfoPlistPath","ios","assert","entitlements","ensureApplicationTargetEntitlementsFileConfigured","Entitlements","getEntitlementsPath","ignoreExistingNativeFiles","fs","existsSync","podfile","getPodfilePath","podfileProperties","results","JsonFile","readAsync","writeAsync","withIosBaseMods","providers","props","withGeneratedBaseMods","platform","getIosModFileProviders"],"sources":["../../src/plugins/withIosBaseMods.ts"],"sourcesContent":["import JsonFile, { JSONObject, JSONValue } from '@expo/json-file';\nimport plist from '@expo/plist';\nimport assert from 'assert';\nimport fs, { promises } from 'fs';\nimport path from 'path';\nimport xcode, { XcodeProject } from 'xcode';\n\nimport { ForwardedBaseModOptions, provider, withGeneratedBaseMods } from './createBaseMod';\nimport { ExportedConfig, ModConfig } from '../Plugin.types';\nimport { Entitlements, Paths } from '../ios';\nimport { ensureApplicationTargetEntitlementsFileConfigured } from '../ios/Entitlements';\nimport { InfoPlist } from '../ios/IosConfig.types';\nimport { getPbxproj } from '../ios/utils/Xcodeproj';\nimport { getInfoPlistPathFromPbxproj } from '../ios/utils/getInfoPlistPath';\nimport { fileExists } from '../utils/modules';\nimport { sortObject } from '../utils/sortObject';\nimport { addWarningIOS } from '../utils/warnings';\n\nconst { readFile, writeFile } = promises;\n\ntype IosModName = keyof Required<ModConfig>['ios'];\n\nfunction getEntitlementsPlistTemplate() {\n // TODO: Fetch the versioned template file if possible\n return {};\n}\n\nfunction getInfoPlistTemplate() {\n // TODO: Fetch the versioned template file if possible\n return {\n CFBundleDevelopmentRegion: '$(DEVELOPMENT_LANGUAGE)',\n CFBundleExecutable: '$(EXECUTABLE_NAME)',\n CFBundleIdentifier: '$(PRODUCT_BUNDLE_IDENTIFIER)',\n CFBundleName: '$(PRODUCT_NAME)',\n CFBundlePackageType: '$(PRODUCT_BUNDLE_PACKAGE_TYPE)',\n CFBundleInfoDictionaryVersion: '6.0',\n CFBundleSignature: '????',\n LSRequiresIPhoneOS: true,\n NSAppTransportSecurity: {\n NSAllowsArbitraryLoads: true,\n NSExceptionDomains: {\n localhost: {\n NSExceptionAllowsInsecureHTTPLoads: true,\n },\n },\n },\n UILaunchStoryboardName: 'SplashScreen',\n UIRequiredDeviceCapabilities: ['armv7'],\n UIViewControllerBasedStatusBarAppearance: false,\n UIStatusBarStyle: 'UIStatusBarStyleDefault',\n CADisableMinimumFrameDurationOnPhone: true,\n };\n}\n\nconst defaultProviders = {\n dangerous: provider<unknown>({\n getFilePath() {\n return '';\n },\n async read() {\n return {};\n },\n async write() {},\n }),\n finalized: provider<unknown>({\n getFilePath() {\n return '';\n },\n async read() {\n return {};\n },\n async write() {},\n }),\n // Append a rule to supply AppDelegate data to mods on `mods.ios.appDelegate`\n appDelegate: provider<Paths.AppDelegateProjectFile>({\n getFilePath({ modRequest: { projectRoot } }) {\n // TODO: Get application AppDelegate file from pbxproj.\n return Paths.getAppDelegateFilePath(projectRoot);\n },\n async read(filePath) {\n return Paths.getFileInfo(filePath);\n },\n async write(filePath: string, { modResults: { contents } }) {\n await writeFile(filePath, contents);\n },\n }),\n // Append a rule to supply Expo.plist data to mods on `mods.ios.expoPlist`\n expoPlist: provider<JSONObject>({\n isIntrospective: true,\n getFilePath({ modRequest: { platformProjectRoot, projectName } }) {\n const supportingDirectory = path.join(platformProjectRoot, projectName!, 'Supporting');\n return path.resolve(supportingDirectory, 'Expo.plist');\n },\n async read(filePath, { modRequest: { introspect } }) {\n try {\n return plist.parse(await readFile(filePath, 'utf8'));\n } catch (error) {\n if (introspect) {\n return {};\n }\n throw error;\n }\n },\n async write(filePath, { modResults, modRequest: { introspect } }) {\n if (introspect) {\n return;\n }\n await writeFile(filePath, plist.build(sortObject(modResults)));\n },\n }),\n // Append a rule to supply .xcodeproj data to mods on `mods.ios.xcodeproj`\n xcodeproj: provider<XcodeProject>({\n getFilePath({ modRequest: { projectRoot } }) {\n return Paths.getPBXProjectPath(projectRoot);\n },\n async read(filePath) {\n const project = xcode.project(filePath);\n project.parseSync();\n return project;\n },\n async write(filePath, { modResults }) {\n await writeFile(filePath, modResults.writeSync());\n },\n }),\n // Append a rule to supply Info.plist data to mods on `mods.ios.infoPlist`\n infoPlist: provider<InfoPlist, ForwardedBaseModOptions>({\n isIntrospective: true,\n async getFilePath(config) {\n let project: xcode.XcodeProject | null = null;\n try {\n project = getPbxproj(config.modRequest.projectRoot);\n } catch {\n // noop\n }\n\n // Only check / warn if a project actually exists, this'll provide\n // more accurate warning messages for users in managed projects.\n if (project) {\n const infoPlistBuildProperty = getInfoPlistPathFromPbxproj(project);\n\n if (infoPlistBuildProperty) {\n //: [root]/myapp/ios/MyApp/Info.plist\n const infoPlistPath = path.join(\n //: myapp/ios\n config.modRequest.platformProjectRoot,\n //: MyApp/Info.plist\n infoPlistBuildProperty\n );\n if (fileExists(infoPlistPath)) {\n return infoPlistPath;\n }\n addWarningIOS(\n 'mods.ios.infoPlist',\n `Info.plist file linked to Xcode project does not exist: ${infoPlistPath}`\n );\n } else {\n addWarningIOS('mods.ios.infoPlist', 'Failed to find Info.plist linked to Xcode project.');\n }\n }\n try {\n // Fallback on glob...\n return await Paths.getInfoPlistPath(config.modRequest.projectRoot);\n } catch (error: any) {\n if (config.modRequest.introspect) {\n // fallback to an empty string in introspection mode.\n return '';\n }\n throw error;\n }\n },\n async read(filePath, config) {\n // Apply all of the Info.plist values to the expo.ios.infoPlist object\n // TODO: Remove this in favor of just overwriting the Info.plist with the Expo object. This will enable people to actually remove values.\n if (!config.ios) config.ios = {};\n if (!config.ios.infoPlist) config.ios.infoPlist = {};\n\n let modResults: InfoPlist;\n try {\n const contents = await readFile(filePath, 'utf8');\n assert(contents, 'Info.plist is empty');\n modResults = plist.parse(contents) as InfoPlist;\n } catch (error: any) {\n // Throw errors in introspection mode.\n if (!config.modRequest.introspect) {\n throw error;\n }\n // Fallback to using the infoPlist object from the Expo config.\n modResults = getInfoPlistTemplate();\n }\n\n config.ios.infoPlist = {\n ...(modResults || {}),\n ...config.ios.infoPlist,\n };\n\n return config.ios.infoPlist!;\n },\n async write(filePath, config) {\n // Update the contents of the static infoPlist object\n if (!config.ios) {\n config.ios = {};\n }\n config.ios.infoPlist = config.modResults;\n\n // Return early without writing, in introspection mode.\n if (config.modRequest.introspect) {\n return;\n }\n\n await writeFile(filePath, plist.build(sortObject(config.modResults)));\n },\n }),\n // Append a rule to supply .entitlements data to mods on `mods.ios.entitlements`\n entitlements: provider<JSONObject, ForwardedBaseModOptions>({\n isIntrospective: true,\n\n async getFilePath(config) {\n try {\n ensureApplicationTargetEntitlementsFileConfigured(config.modRequest.projectRoot);\n return Entitlements.getEntitlementsPath(config.modRequest.projectRoot) ?? '';\n } catch (error: any) {\n if (config.modRequest.introspect) {\n // fallback to an empty string in introspection mode.\n return '';\n }\n throw error;\n }\n },\n\n async read(filePath, config) {\n let modResults: JSONObject;\n try {\n if (!config.modRequest.ignoreExistingNativeFiles && fs.existsSync(filePath)) {\n const contents = await readFile(filePath, 'utf8');\n assert(contents, 'Entitlements plist is empty');\n modResults = plist.parse(contents);\n } else {\n modResults = getEntitlementsPlistTemplate();\n }\n } catch (error: any) {\n // Throw errors in introspection mode.\n if (!config.modRequest.introspect) {\n throw error;\n }\n // Fallback to using the template file.\n modResults = getEntitlementsPlistTemplate();\n }\n\n // Apply all of the .entitlements values to the expo.ios.entitlements object\n // TODO: Remove this in favor of just overwriting the .entitlements with the Expo object. This will enable people to actually remove values.\n if (!config.ios) config.ios = {};\n if (!config.ios.entitlements) config.ios.entitlements = {};\n\n config.ios.entitlements = {\n ...(modResults || {}),\n ...config.ios.entitlements,\n };\n\n return config.ios.entitlements!;\n },\n\n async write(filePath, config) {\n // Update the contents of the static entitlements object\n if (!config.ios) {\n config.ios = {};\n }\n config.ios.entitlements = config.modResults;\n\n // Return early without writing, in introspection mode.\n if (config.modRequest.introspect) {\n return;\n }\n\n await writeFile(filePath, plist.build(sortObject(config.modResults)));\n },\n }),\n\n podfile: provider<Paths.PodfileProjectFile>({\n getFilePath({ modRequest: { projectRoot } }) {\n return Paths.getPodfilePath(projectRoot);\n },\n // @ts-expect-error\n async read(filePath) {\n // Note(cedric): this file is ruby, which is a 1-value subset of AppleLanguage and fails the type check\n return Paths.getFileInfo(filePath);\n },\n async write(filePath, { modResults: { contents } }) {\n await writeFile(filePath, contents);\n },\n }),\n\n // Append a rule to supply Podfile.properties.json data to mods on `mods.ios.podfileProperties`\n podfileProperties: provider<Record<string, JSONValue>>({\n isIntrospective: true,\n\n getFilePath({ modRequest: { platformProjectRoot } }) {\n return path.resolve(platformProjectRoot, 'Podfile.properties.json');\n },\n async read(filePath) {\n let results: Record<string, JSONValue> = {};\n try {\n results = await JsonFile.readAsync(filePath);\n } catch {}\n return results;\n },\n async write(filePath, { modResults, modRequest: { introspect } }) {\n if (introspect) {\n return;\n }\n await JsonFile.writeAsync(filePath, modResults);\n },\n }),\n};\n\ntype IosDefaultProviders = typeof defaultProviders;\n\nexport function withIosBaseMods(\n config: ExportedConfig,\n {\n providers,\n ...props\n }: ForwardedBaseModOptions & { providers?: Partial<IosDefaultProviders> } = {}\n): ExportedConfig {\n return withGeneratedBaseMods<IosModName>(config, {\n ...props,\n platform: 'ios',\n providers: providers ?? getIosModFileProviders(),\n });\n}\n\nexport function getIosModFileProviders() {\n return defaultProviders;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAA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;MACT,OAAO6C,OAAO;IAChB,CAAC;IACD,MAAMpD,KAAKA,CAACO,QAAQ,EAAE;MAAEE,UAAU;MAAEN,UAAU,EAAE;QAAEgB;MAAW;IAAE,CAAC,EAAE;MAChE,IAAIA,UAAU,EAAE;QACd;MACF;MACA,MAAMkC,mBAAQ,CAACE,UAAU,CAAChD,QAAQ,EAAEE,UAAU,CAAC;IACjD;EACF,CAAC;AACH,CAAC;AAIM,SAAS+C,eAAeA,CAC7BxB,MAAsB,EACtB;EACEyB,SAAS;EACT,GAAGC;AACmE,CAAC,GAAG,CAAC,CAAC,EAC9D;EAChB,OAAO,IAAAC,sCAAqB,EAAa3B,MAAM,EAAE;IAC/C,GAAG0B,KAAK;IACRE,QAAQ,EAAE,KAAK;IACfH,SAAS,EAAEA,SAAS,IAAII,sBAAsB,CAAC;EACjD,CAAC,CAAC;AACJ;AAEO,SAASA,sBAAsBA,CAAA,EAAG;EACvC,OAAOlE,gBAAgB;AACzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/config-plugins",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.2",
|
|
4
4
|
"description": "A library for Expo config plugins",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "8b4cb45563b85c2ec91b1b249d136661bf6e8981"
|
|
62
62
|
}
|