@expo/config-plugins 4.0.9 → 4.0.10
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/JsEngine.d.ts +2 -1
- package/build/ios/JsEngine.js.map +1 -1
- package/build/plugins/ios-plugins.d.ts +2 -2
- package/build/plugins/ios-plugins.js.map +1 -1
- package/build/plugins/withIosBaseMods.d.ts +3 -3
- package/build/plugins/withIosBaseMods.js.map +1 -1
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export { withPlugins } from './plugins/withPlugins';
|
|
|
20
20
|
export { withRunOnce, createRunOncePlugin } from './plugins/withRunOnce';
|
|
21
21
|
export { withDangerousMod } from './plugins/withDangerousMod';
|
|
22
22
|
export { withMod, withBaseMod } from './plugins/withMod';
|
|
23
|
-
export { withAppDelegate, withInfoPlist, withEntitlementsPlist, withExpoPlist, withXcodeProject, } from './plugins/ios-plugins';
|
|
23
|
+
export { withAppDelegate, withInfoPlist, withEntitlementsPlist, withExpoPlist, withXcodeProject, withPodfileProperties, } from './plugins/ios-plugins';
|
|
24
24
|
export { withAndroidManifest, withStringsXml, withAndroidColors, withAndroidColorsNight, withAndroidStyles, withMainActivity, withMainApplication, withProjectBuildGradle, withAppBuildGradle, withSettingsGradle, withGradleProperties, } from './plugins/android-plugins';
|
|
25
25
|
export { withStaticPlugin } from './plugins/withStaticPlugin';
|
|
26
26
|
export { compileModsAsync, withDefaultBaseMods, evalModsAsync } from './plugins/mod-compiler';
|
package/build/index.js
CHANGED
|
@@ -22,6 +22,7 @@ var _exportNames = {
|
|
|
22
22
|
withEntitlementsPlist: true,
|
|
23
23
|
withExpoPlist: true,
|
|
24
24
|
withXcodeProject: true,
|
|
25
|
+
withPodfileProperties: true,
|
|
25
26
|
withAndroidManifest: true,
|
|
26
27
|
withStringsXml: true,
|
|
27
28
|
withAndroidColors: true,
|
|
@@ -167,6 +168,12 @@ Object.defineProperty(exports, "withPlugins", {
|
|
|
167
168
|
return _withPlugins().withPlugins;
|
|
168
169
|
}
|
|
169
170
|
});
|
|
171
|
+
Object.defineProperty(exports, "withPodfileProperties", {
|
|
172
|
+
enumerable: true,
|
|
173
|
+
get: function () {
|
|
174
|
+
return _iosPlugins().withPodfileProperties;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
170
177
|
Object.defineProperty(exports, "withProjectBuildGradle", {
|
|
171
178
|
enumerable: true,
|
|
172
179
|
get: function () {
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["BaseMods","withGeneratedBaseMods","provider","withAndroidBaseMods","getAndroidModFileProviders","withIosBaseMods","getIosModFileProviders"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["BaseMods","withGeneratedBaseMods","provider","withAndroidBaseMods","getAndroidModFileProviders","withIosBaseMods","getIosModFileProviders"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AASA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAcA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AA3DA;AACA;AACA;AAUA;;AAOA;AACA;AACA;AAwCO,MAAMA,QAAQ,GAAG;AACtBC,EAAAA,qBAAqB,EAArBA,sCADsB;AAEtBC,EAAAA,QAAQ,EAARA,yBAFsB;AAGtBC,EAAAA,mBAAmB,EAAnBA,0CAHsB;AAItBC,EAAAA,0BAA0B,EAA1BA,iDAJsB;AAKtBC,EAAAA,eAAe,EAAfA,kCALsB;AAMtBC,EAAAA,sBAAsB,EAAtBA;AANsB,CAAjB","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 { 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"],"file":"index.js"}
|
package/build/ios/JsEngine.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ExpoConfig } from '@expo/config-types';
|
|
2
|
+
import { JSONValue } from '@expo/json-file';
|
|
2
3
|
import type { ConfigPlugin } from '../Plugin.types';
|
|
3
4
|
export declare const JS_ENGINE_PROP_KEY = "expo.jsEngine";
|
|
4
5
|
export declare const DEFAULT_JS_ENGINE = "jsc";
|
|
5
6
|
export declare const withJsEnginePodfileProps: ConfigPlugin;
|
|
6
7
|
export declare function getJsEngine(config: Pick<ExpoConfig, 'ios' | 'jsEngine'>): "hermes" | "jsc";
|
|
7
|
-
export declare function setJsEngine(config: Pick<ExpoConfig, 'ios' | 'jsEngine'>, podfileProperties: Record<string,
|
|
8
|
+
export declare function setJsEngine(config: Pick<ExpoConfig, 'ios' | 'jsEngine'>, podfileProperties: Record<string, JSONValue>): Record<string, JSONValue>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ios/JsEngine.ts"],"names":["JS_ENGINE_PROP_KEY","DEFAULT_JS_ENGINE","withJsEnginePodfileProps","config","modResults","setJsEngine","getJsEngine","ios","jsEngine","podfileProperties"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../src/ios/JsEngine.ts"],"names":["JS_ENGINE_PROP_KEY","DEFAULT_JS_ENGINE","withJsEnginePodfileProps","config","modResults","setJsEngine","getJsEngine","ios","jsEngine","podfileProperties"],"mappings":";;;;;;;;;;AAIA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,kBAAkB,GAAG,eAA3B;;AACA,MAAMC,iBAAiB,GAAG,KAA1B;;;AAEA,MAAMC,wBAAsC,GAAGC,MAAM,IAAI;AAC9D,SAAO,yCAAsBA,MAAtB,EAA8BA,MAAM,IAAI;AAC7CA,IAAAA,MAAM,CAACC,UAAP,GAAoBC,WAAW,CAACF,MAAD,EAASA,MAAM,CAACC,UAAhB,CAA/B;AACA,WAAOD,MAAP;AACD,GAHM,CAAP;AAID,CALM;;;;AAOA,SAASG,WAAT,CAAqBH,MAArB,EAAmE;AAAA;;AACxE,wDAAOA,MAAM,CAACI,GAAd,gDAAO,YAAYC,QAAnB,uEAA+BL,MAAM,CAACK,QAAtC,uCAAkDP,iBAAlD;AACD;;AAEM,SAASI,WAAT,CACLF,MADK,EAELM,iBAFK,EAGsB;AAAA;;AAC3BA,EAAAA,iBAAiB,CAACT,kBAAD,CAAjB,qDACEG,MAAM,CAACI,GADT,iDACE,aAAYC,QADd,yEAC0BL,MAAM,CAACK,QADjC,yCAC6CP,iBAD7C;AAEA,SAAOQ,iBAAP;AACD","sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport { JSONValue } from '@expo/json-file';\n\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { withPodfileProperties } from '../plugins/ios-plugins';\n\nexport const JS_ENGINE_PROP_KEY = 'expo.jsEngine';\nexport const DEFAULT_JS_ENGINE = 'jsc';\n\nexport const withJsEnginePodfileProps: ConfigPlugin = config => {\n return withPodfileProperties(config, config => {\n config.modResults = setJsEngine(config, config.modResults);\n return config;\n });\n};\n\nexport function getJsEngine(config: Pick<ExpoConfig, 'ios' | 'jsEngine'>) {\n return config.ios?.jsEngine ?? config.jsEngine ?? DEFAULT_JS_ENGINE;\n}\n\nexport function setJsEngine(\n config: Pick<ExpoConfig, 'ios' | 'jsEngine'>,\n podfileProperties: Record<string, JSONValue>\n): Record<string, JSONValue> {\n podfileProperties[JS_ENGINE_PROP_KEY] =\n config.ios?.jsEngine ?? config.jsEngine ?? DEFAULT_JS_ENGINE;\n return podfileProperties;\n}\n"],"file":"JsEngine.js"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExpoConfig } from '@expo/config-types';
|
|
2
|
-
import type { JSONObject } from '@expo/json-file';
|
|
2
|
+
import type { JSONObject, JSONValue } 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';
|
|
@@ -61,5 +61,5 @@ export declare const withXcodeProject: ConfigPlugin<Mod<XcodeProject>>;
|
|
|
61
61
|
* @param config
|
|
62
62
|
* @param action
|
|
63
63
|
*/
|
|
64
|
-
export declare const withPodfileProperties: ConfigPlugin<Mod<Record<string,
|
|
64
|
+
export declare const withPodfileProperties: ConfigPlugin<Mod<Record<string, JSONValue>>>;
|
|
65
65
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/plugins/ios-plugins.ts"],"names":["createInfoPlistPlugin","action","name","withUnknown","config","withInfoPlist","modResults","Object","defineProperty","value","createEntitlementsPlugin","withEntitlementsPlist","withAppDelegate","platform","mod","ios","infoPlist","entitlements","withExp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C,IAAAA,GAAG,EAAE,WAFgB;AAGrBb,IAAAA;AAHqB,GAAhB,CAAP;AAKD,CANM;AAQP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMkB,gBAAiD,GAAG,CAACf,MAAD,EAASH,MAAT,KAAoB;AACnF,SAAO,wBAAQG,MAAR,EAAgB;AACrBS,IAAAA,QAAQ,EAAE,KADW;AAErBC,IAAAA,GAAG,EAAE,WAFgB;AAGrBb,IAAAA;AAHqB,GAAhB,CAAP;AAKD,CANM;AAQP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMmB,
|
|
1
|
+
{"version":3,"sources":["../../src/plugins/ios-plugins.ts"],"names":["createInfoPlistPlugin","action","name","withUnknown","config","withInfoPlist","modResults","Object","defineProperty","value","createEntitlementsPlugin","withEntitlementsPlist","withAppDelegate","platform","mod","ios","infoPlist","entitlements","withExpoPlist","withXcodeProject","withPodfileProperties"],"mappings":";;;;;;;;;AAOA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAIA;AACA;AACA;AACA;AACA;AACO,SAASA,qBAAT,CAA+BC,MAA/B,EAA8DC,IAA9D,EAA2F;AAChG,QAAMC,WAAyB,GAAGC,MAAM,IACtCC,aAAa,CAACD,MAAD,EAAS,MAAMA,MAAN,IAAgB;AACpCA,IAAAA,MAAM,CAACE,UAAP,GAAoB,MAAML,MAAM,CAACG,MAAD,EAASA,MAAM,CAACE,UAAhB,CAAhC;AACA,WAAOF,MAAP;AACD,GAHY,CADf;;AAKA,MAAIF,IAAJ,EAAU;AACRK,IAAAA,MAAM,CAACC,cAAP,CAAsBL,WAAtB,EAAmC,MAAnC,EAA2C;AACzCM,MAAAA,KAAK,EAAEP;AADkC,KAA3C;AAGD;;AACD,SAAOC,WAAP;AACD;;AAID;AACA;AACA;AACA;AACA;AACO,SAASO,wBAAT,CACLT,MADK,EAELC,IAFK,EAGS;AACd,QAAMC,WAAyB,GAAGC,MAAM,IACtCO,qBAAqB,CAACP,MAAD,EAAS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AAQ,EAAE,KADuB;AAEjCC,IAAAA,GAAG,EAAE,cAF4B;;AAGjC,UAAMb,MAAN,CAAaG,MAAb,EAAqB;AACnBA,MAAAA,MAAM,GAAG,MAAMH,MAAM,CAACG,MAAD,CAArB;;AACA,UAAI,CAACA,MAAM,CAACW,GAAZ,EAAiB;AACfX,QAAAA,MAAM,CAACW,GAAP,GAAa,EAAb;AACD;;AACDX,MAAAA,MAAM,CAACW,GAAP,CAAWE,YAAX,GAA0Bb,MAAM,CAACE,UAAjC;AACA,aAAOF,MAAP;AACD;;AAVgC,GAA5B,CAAP;AAYD,CAbM;AAeP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMc,aAA2C,GAAG,CAACd,MAAD,EAASH,MAAT,KAAoB;AAC7E,SAAO,wBAAQG,MAAR,EAAgB;AACrBS,IAAAA,QAAQ,EAAE,KADW;AAErBC,IAAAA,GAAG,EAAE,WAFgB;AAGrBb,IAAAA;AAHqB,GAAhB,CAAP;AAKD,CANM;AAQP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMkB,gBAAiD,GAAG,CAACf,MAAD,EAASH,MAAT,KAAoB;AACnF,SAAO,wBAAQG,MAAR,EAAgB;AACrBS,IAAAA,QAAQ,EAAE,KADW;AAErBC,IAAAA,GAAG,EAAE,WAFgB;AAGrBb,IAAAA;AAHqB,GAAhB,CAAP;AAKD,CANM;AAQP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMmB,qBAAmE,GAAG,CACjFhB,MADiF,EAEjFH,MAFiF,KAG9E;AACH,SAAO,wBAAQG,MAAR,EAAgB;AACrBS,IAAAA,QAAQ,EAAE,KADW;AAErBC,IAAAA,GAAG,EAAE,mBAFgB;AAGrBb,IAAAA;AAHqB,GAAhB,CAAP;AAKD,CATM","sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport type { JSONObject, JSONValue } from '@expo/json-file';\nimport type { XcodeProject } from 'xcode';\n\nimport type { ConfigPlugin, Mod } from '../Plugin.types';\nimport type { ExpoPlist, InfoPlist } from '../ios/IosConfig.types';\nimport type { AppDelegateProjectFile } from '../ios/Paths';\nimport { withMod } from './withMod';\n\ntype MutateInfoPlistAction = (expo: ExpoConfig, infoPlist: 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\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, JSONValue>>> = (\n config,\n action\n) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'podfileProperties',\n action,\n });\n};\n"],"file":"ios-plugins.js"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSONObject } from '@expo/json-file';
|
|
1
|
+
import { JSONObject, JSONValue } from '@expo/json-file';
|
|
2
2
|
import xcode from 'xcode';
|
|
3
3
|
import { ExportedConfig } from '../Plugin.types';
|
|
4
4
|
import { Paths } from '../ios';
|
|
@@ -11,7 +11,7 @@ declare const defaultProviders: {
|
|
|
11
11
|
xcodeproj: import("./createBaseMod").BaseModProviderMethods<xcode.XcodeProject, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
12
12
|
infoPlist: import("./createBaseMod").BaseModProviderMethods<InfoPlist, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
13
13
|
entitlements: import("./createBaseMod").BaseModProviderMethods<JSONObject, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
14
|
-
podfileProperties: import("./createBaseMod").BaseModProviderMethods<Record<string,
|
|
14
|
+
podfileProperties: import("./createBaseMod").BaseModProviderMethods<Record<string, JSONValue>, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
15
15
|
};
|
|
16
16
|
declare type IosDefaultProviders = typeof defaultProviders;
|
|
17
17
|
export declare function withIosBaseMods(config: ExportedConfig, { providers, ...props }?: ForwardedBaseModOptions & {
|
|
@@ -24,6 +24,6 @@ export declare function getIosModFileProviders(): {
|
|
|
24
24
|
xcodeproj: import("./createBaseMod").BaseModProviderMethods<xcode.XcodeProject, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
25
25
|
infoPlist: import("./createBaseMod").BaseModProviderMethods<InfoPlist, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
26
26
|
entitlements: import("./createBaseMod").BaseModProviderMethods<JSONObject, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
27
|
-
podfileProperties: import("./createBaseMod").BaseModProviderMethods<Record<string,
|
|
27
|
+
podfileProperties: import("./createBaseMod").BaseModProviderMethods<Record<string, JSONValue>, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
|
|
28
28
|
};
|
|
29
29
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/plugins/withIosBaseMods.ts"],"names":["readFile","writeFile","promises","getEntitlementsPlistTemplate","getInfoPlistTemplate","CFBundleDevelopmentRegion","CFBundleExecutable","CFBundleIdentifier","CFBundleName","CFBundlePackageType","CFBundleInfoDictionaryVersion","CFBundleSignature","LSRequiresIPhoneOS","NSAppTransportSecurity","NSAllowsArbitraryLoads","NSExceptionDomains","localhost","NSExceptionAllowsInsecureHTTPLoads","UILaunchStoryboardName","UIRequiredDeviceCapabilities","UIViewControllerBasedStatusBarAppearance","UIStatusBarStyle","defaultProviders","dangerous","getFilePath","read","write","appDelegate","modRequest","projectRoot","Paths","getAppDelegateFilePath","filePath","getFileInfo","modResults","contents","expoPlist","isIntrospective","platformProjectRoot","projectName","supportingDirectory","path","join","resolve","introspect","plist","parse","error","build","xcodeproj","getPBXProjectPath","project","xcode","parseSync","writeSync","infoPlist","config","infoPlistBuildProperty","infoPlistPath","getInfoPlistPath","ios","entitlements","Entitlements","getEntitlementsPath","podfileProperties","results","JsonFile","readAsync","e","writeAsync","withIosBaseMods","providers","props","platform","getIosModFileProviders"],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA,MAAM;AAAEA,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,IAA0BC,cAAhC;;AAIA,SAASC,4BAAT,GAAwC;AACtC;AACA,SAAO,EAAP;AACD;;AAED,SAASC,oBAAT,GAAgC;AAC9B;AACA,SAAO;AACLC,IAAAA,yBAAyB,EAAE,yBADtB;AAELC,IAAAA,kBAAkB,EAAE,oBAFf;AAGLC,IAAAA,kBAAkB,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;AAAEgB,QAAAA;AAAF;AAA1B,KAAtB,EAAkE;AAChE,UAAIA,UAAJ,EAAgB;AACd;AACD;;AACD,YAAMsB,oBAASG,UAAT,CAAoBrC,QAApB,EAA8BE,UAA9B,CAAN;AACD;;AAlBiD,GAAjC;AAlNI,CAAzB;;AA0OO,SAASoC,eAAT,CACLd,MADK,EAEL;AACEe,EAAAA,SADF;AAEE,KAAGC;AAFL,IAG4E,EALvE,EAMW;AAChB,SAAO,4CAAkChB,MAAlC,EAA0C,EAC/C,GAAGgB,KAD4C;AAE/CC,IAAAA,QAAQ,EAAE,KAFqC;AAG/CF,IAAAA,SAAS,EAAEA,SAAF,aAAEA,SAAF,cAAEA,SAAF,GAAeG,sBAAsB;AAHC,GAA1C,CAAP;AAKD;;AAEM,SAASA,sBAAT,GAAkC;AACvC,SAAOpD,gBAAP;AACD","sourcesContent":["import JsonFile, { JSONObject } from '@expo/json-file';\nimport plist from '@expo/plist';\nimport assert from 'assert';\nimport { promises } from 'fs';\nimport path from 'path';\nimport xcode, { XcodeProject } from 'xcode';\n\nimport { ExportedConfig, ModConfig } from '../Plugin.types';\nimport { Entitlements, Paths } from '../ios';\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';\nimport { ForwardedBaseModOptions, provider, withGeneratedBaseMods } from './createBaseMod';\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 };\n}\n\nconst defaultProviders = {\n dangerous: 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 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 // Fallback on glob...\n return await 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 const contents = await readFile(filePath, 'utf8');\n assert(contents, 'Entitlements plist is empty');\n modResults = plist.parse(contents);\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, string>>({\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, string> = {};\n try {\n results = await JsonFile.readAsync(filePath);\n } catch (e) {}\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"],"file":"withIosBaseMods.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/plugins/withIosBaseMods.ts"],"names":["readFile","writeFile","promises","getEntitlementsPlistTemplate","getInfoPlistTemplate","CFBundleDevelopmentRegion","CFBundleExecutable","CFBundleIdentifier","CFBundleName","CFBundlePackageType","CFBundleInfoDictionaryVersion","CFBundleSignature","LSRequiresIPhoneOS","NSAppTransportSecurity","NSAllowsArbitraryLoads","NSExceptionDomains","localhost","NSExceptionAllowsInsecureHTTPLoads","UILaunchStoryboardName","UIRequiredDeviceCapabilities","UIViewControllerBasedStatusBarAppearance","UIStatusBarStyle","defaultProviders","dangerous","getFilePath","read","write","appDelegate","modRequest","projectRoot","Paths","getAppDelegateFilePath","filePath","getFileInfo","modResults","contents","expoPlist","isIntrospective","platformProjectRoot","projectName","supportingDirectory","path","join","resolve","introspect","plist","parse","error","build","xcodeproj","getPBXProjectPath","project","xcode","parseSync","writeSync","infoPlist","config","infoPlistBuildProperty","infoPlistPath","getInfoPlistPath","ios","entitlements","Entitlements","getEntitlementsPath","podfileProperties","results","JsonFile","readAsync","e","writeAsync","withIosBaseMods","providers","props","platform","getIosModFileProviders"],"mappings":";;;;;;;;AAAA;AAAA;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EA,SAAF,aAAEA,SAAF,cAAEA,SAAF,GAAeG,sBAAsB;AAHC,GAA1C,CAAP;AAKD;;AAEM,SAASA,sBAAT,GAAkC;AACvC,SAAOpD,gBAAP;AACD","sourcesContent":["import JsonFile, { JSONObject, JSONValue } from '@expo/json-file';\nimport plist from '@expo/plist';\nimport assert from 'assert';\nimport { promises } from 'fs';\nimport path from 'path';\nimport xcode, { XcodeProject } from 'xcode';\n\nimport { ExportedConfig, ModConfig } from '../Plugin.types';\nimport { Entitlements, Paths } from '../ios';\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';\nimport { ForwardedBaseModOptions, provider, withGeneratedBaseMods } from './createBaseMod';\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 };\n}\n\nconst defaultProviders = {\n dangerous: 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 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 // Fallback on glob...\n return await 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 const contents = await readFile(filePath, 'utf8');\n assert(contents, 'Entitlements plist is empty');\n modResults = plist.parse(contents);\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 (e) {}\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"],"file":"withIosBaseMods.js"}
|