@expo/config-plugins 4.1.1 → 4.1.4
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/android/BuildProperties.d.ts +28 -0
- package/build/android/BuildProperties.js +96 -0
- package/build/android/BuildProperties.js.map +1 -0
- package/build/android/Manifest.d.ts +7 -0
- package/build/android/Manifest.js +36 -0
- package/build/android/Manifest.js.map +1 -1
- package/build/android/Package.js +1 -1
- package/build/android/Package.js.map +1 -1
- package/build/android/Permissions.d.ts +3 -1
- package/build/android/Permissions.js +42 -28
- package/build/android/Permissions.js.map +1 -1
- package/build/android/codeMod.js +1 -1
- package/build/android/codeMod.js.map +1 -1
- package/build/android/index.d.ts +2 -2
- package/build/android/index.js +18 -18
- package/build/android/index.js.map +1 -1
- package/build/ios/BuildProperties.d.ts +27 -0
- package/build/ios/BuildProperties.js +83 -0
- package/build/ios/BuildProperties.js.map +1 -0
- package/build/ios/BuildScheme.js +6 -3
- package/build/ios/BuildScheme.js.map +1 -1
- package/build/ios/Entitlements.d.ts +5 -1
- package/build/ios/Entitlements.js +57 -58
- package/build/ios/Entitlements.js.map +1 -1
- package/build/ios/Locales.js +1 -1
- package/build/ios/Locales.js.map +1 -1
- package/build/ios/Paths.d.ts +1 -3
- package/build/ios/Paths.js +12 -16
- package/build/ios/Paths.js.map +1 -1
- package/build/ios/Target.d.ts +1 -0
- package/build/ios/Target.js +11 -1
- package/build/ios/Target.js.map +1 -1
- package/build/ios/index.d.ts +2 -2
- package/build/ios/index.js +19 -19
- package/build/ios/index.js.map +1 -1
- package/build/ios/utils/Xcodeproj.d.ts +2 -1
- package/build/ios/utils/Xcodeproj.js +4 -1
- package/build/ios/utils/Xcodeproj.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.js +27 -7
- package/build/plugins/withIosBaseMods.js.map +1 -1
- package/build/utils/BuildProperties.types.d.ts +25 -0
- package/build/utils/BuildProperties.types.js +2 -0
- package/build/utils/BuildProperties.types.js.map +1 -0
- package/build/utils/modules.js +1 -1
- package/build/utils/modules.js.map +1 -1
- package/build/utils/versions.js +2 -2
- package/build/utils/versions.js.map +1 -1
- package/package.json +3 -3
- package/build/android/JsEngine.d.ts +0 -8
- package/build/android/JsEngine.js +0 -59
- package/build/android/JsEngine.js.map +0 -1
- package/build/ios/JsEngine.d.ts +0 -8
- package/build/ios/JsEngine.js +0 -47
- package/build/ios/JsEngine.js.map +0 -1
|
@@ -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;;A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ject, 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"}
|
|
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","fs","existsSync","podfileProperties","results","JsonFile","readAsync","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;;AACA;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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AiB,EAAE,+BAAoC;AACrD7B,IAAAA,eAAe,EAAE,IADoC;;AAGrDb,IAAAA,WAAW,CAAC;AAAEI,MAAAA,UAAU,EAAE;AAAEU,QAAAA;AAAF;AAAd,KAAD,EAA0C;AACnD,aAAOG,gBAAKE,OAAL,CAAaL,mBAAb,EAAkC,yBAAlC,CAAP;AACD,KALoD;;AAMrD,UAAMb,IAAN,CAAWO,QAAX,EAAqB;AACnB,UAAImC,OAAkC,GAAG,EAAzC;;AACA,UAAI;AACFA,QAAAA,OAAO,GAAG,MAAMC,oBAASC,SAAT,CAAmBrC,QAAnB,CAAhB;AACD,OAFD,CAEE,MAAM,CAAE;;AACV,aAAOmC,OAAP;AACD,KAZoD;;AAarD,UAAMzC,KAAN,CAAYM,QAAZ,EAAsB;AAAEE,MAAAA,UAAF;AAAcN,MAAAA,UAAU,EAAE;AAAEgB,QAAAA;AAAF;AAA1B,KAAtB,EAAkE;AAChE,UAAIA,UAAJ,EAAgB;AACd;AACD;;AACD,YAAMwB,oBAASE,UAAT,CAAoBtC,QAApB,EAA8BE,UAA9B,CAAN;AACD;;AAlBoD,GAApC;AAtNI,CAAzB;;AA8OO,SAASqC,eAAT,CACLf,MADK,EAEL;AACEgB,EAAAA,SADF;AAEE,KAAGC;AAFL,IAG4E,EALvE,EAMW;AAChB,SAAO,4CAAkCjB,MAAlC,EAA0C,EAC/C,GAAGiB,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,SAAOrD,gBAAP;AACD","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 { 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';\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 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 (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"],"file":"withIosBaseMods.js"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ExpoConfig } from '@expo/config-types';
|
|
2
|
+
/**
|
|
3
|
+
* Rule to transform from config to build properties
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* {
|
|
8
|
+
* propName: 'expo.jsEngine',
|
|
9
|
+
* propValueGetter: (config) => config.android?.jsEngine ?? config.jsEngine ?? 'jsc',
|
|
10
|
+
* }
|
|
11
|
+
* ```
|
|
12
|
+
* Will lookup a value through the `propValueGetter` and update to `android/gradle.properties` / `ios/Podfile.properties.json`
|
|
13
|
+
* with the `expo.jsEngine` property name and the lookuped value.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Source config can be either expo config or generic config
|
|
18
|
+
*/
|
|
19
|
+
export declare type BuildPropertiesConfig = ExpoConfig | Record<string, any>;
|
|
20
|
+
export interface ConfigToPropertyRuleType<SourceConfigType extends BuildPropertiesConfig> {
|
|
21
|
+
/** Property name in `android/gradle.properties` or `ios/Podfile.properties.json` */
|
|
22
|
+
propName: string;
|
|
23
|
+
/** Passing config and get the property value */
|
|
24
|
+
propValueGetter: (config: SourceConfigType) => string | null | undefined;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"BuildProperties.types.js"}
|
package/build/utils/modules.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/modules.ts"],"names":["statAsync","file","fs","promises","stat","fileExistsAsync","isFile","directoryExistsAsync","isDirectory","fileExists","statSync"
|
|
1
|
+
{"version":3,"sources":["../../src/utils/modules.ts"],"names":["statAsync","file","fs","promises","stat","fileExistsAsync","isFile","directoryExistsAsync","isDirectory","fileExists","statSync"],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAeA,SAAf,CAAyBC,IAAzB,EAAiE;AAC/D,MAAI;AACF,WAAO,MAAMC,cAAGC,QAAH,CAAYC,IAAZ,CAAiBH,IAAjB,CAAb;AACD,GAFD,CAEE,MAAM;AACN,WAAO,IAAP;AACD;AACF;;AAEM,eAAeI,eAAf,CAA+BJ,IAA/B,EAA+D;AAAA;;AACpE,sDAAQ,MAAMD,SAAS,CAACC,IAAD,CAAvB,qDAAO,iBAAyBK,MAAzB,EAAP,yEAA4C,KAA5C;AACD;;AAEM,eAAeC,oBAAf,CAAoCN,IAApC,EAAoE;AAAA;;AACzE,uDAAQ,MAAMD,SAAS,CAACC,IAAD,CAAvB,sDAAO,kBAAyBO,WAAzB,EAAP,yEAAiD,KAAjD;AACD;;AAEM,SAASC,UAAT,CAAoBR,IAApB,EAA2C;AAChD,MAAI;AACF,WAAOC,cAAGQ,QAAH,CAAYT,IAAZ,EAAkBK,MAAlB,EAAP;AACD,GAFD,CAEE,MAAM;AACN,WAAO,KAAP;AACD;AACF","sourcesContent":["import fs from 'fs';\n\n/**\n * A non-failing version of async FS stat.\n *\n * @param file\n */\nasync function statAsync(file: string): Promise<fs.Stats | null> {\n try {\n return await fs.promises.stat(file);\n } catch {\n return null;\n }\n}\n\nexport async function fileExistsAsync(file: string): Promise<boolean> {\n return (await statAsync(file))?.isFile() ?? false;\n}\n\nexport async function directoryExistsAsync(file: string): Promise<boolean> {\n return (await statAsync(file))?.isDirectory() ?? false;\n}\n\nexport function fileExists(file: string): boolean {\n try {\n return fs.statSync(file).isFile();\n } catch {\n return false;\n }\n}\n"],"file":"modules.js"}
|
package/build/utils/versions.js
CHANGED
|
@@ -29,7 +29,7 @@ function gteSdkVersion(exp, sdkVersion) {
|
|
|
29
29
|
|
|
30
30
|
try {
|
|
31
31
|
return _semver().default.gte(exp.sdkVersion, sdkVersion);
|
|
32
|
-
} catch
|
|
32
|
+
} catch {
|
|
33
33
|
throw new Error(`${exp.sdkVersion} is not a valid version. Must be in the form of x.y.z`);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -45,7 +45,7 @@ function lteSdkVersion(exp, sdkVersion) {
|
|
|
45
45
|
|
|
46
46
|
try {
|
|
47
47
|
return _semver().default.lte(exp.sdkVersion, sdkVersion);
|
|
48
|
-
} catch
|
|
48
|
+
} catch {
|
|
49
49
|
throw new Error(`${exp.sdkVersion} is not a valid version. Must be in the form of x.y.z`);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/versions.ts"],"names":["gteSdkVersion","exp","sdkVersion","semver","gte","
|
|
1
|
+
{"version":3,"sources":["../../src/utils/versions.ts"],"names":["gteSdkVersion","exp","sdkVersion","semver","gte","Error","lteSdkVersion","lte"],"mappings":";;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEO,SAASA,aAAT,CAAuBC,GAAvB,EAA4DC,UAA5D,EAAyF;AAC9F,MAAI,CAACD,GAAG,CAACC,UAAT,EAAqB;AACnB,WAAO,KAAP;AACD;;AAED,MAAID,GAAG,CAACC,UAAJ,KAAmB,aAAvB,EAAsC;AACpC,WAAO,IAAP;AACD;;AAED,MAAI;AACF,WAAOC,kBAAOC,GAAP,CAAWH,GAAG,CAACC,UAAf,EAA2BA,UAA3B,CAAP;AACD,GAFD,CAEE,MAAM;AACN,UAAM,IAAIG,KAAJ,CAAW,GAAEJ,GAAG,CAACC,UAAW,uDAA5B,CAAN;AACD;AACF;;AAEM,SAASI,aAAT,CAAuBL,GAAvB,EAA4DC,UAA5D,EAAyF;AAC9F,MAAI,CAACD,GAAG,CAACC,UAAT,EAAqB;AACnB,WAAO,KAAP;AACD;;AAED,MAAID,GAAG,CAACC,UAAJ,KAAmB,aAAvB,EAAsC;AACpC,WAAO,KAAP;AACD;;AAED,MAAI;AACF,WAAOC,kBAAOI,GAAP,CAAWN,GAAG,CAACC,UAAf,EAA2BA,UAA3B,CAAP;AACD,GAFD,CAEE,MAAM;AACN,UAAM,IAAIG,KAAJ,CAAW,GAAEJ,GAAG,CAACC,UAAW,uDAA5B,CAAN;AACD;AACF","sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport semver from 'semver';\n\nexport function gteSdkVersion(exp: Pick<ExpoConfig, 'sdkVersion'>, sdkVersion: string): boolean {\n if (!exp.sdkVersion) {\n return false;\n }\n\n if (exp.sdkVersion === 'UNVERSIONED') {\n return true;\n }\n\n try {\n return semver.gte(exp.sdkVersion, sdkVersion);\n } catch {\n throw new Error(`${exp.sdkVersion} is not a valid version. Must be in the form of x.y.z`);\n }\n}\n\nexport function lteSdkVersion(exp: Pick<ExpoConfig, 'sdkVersion'>, sdkVersion: string): boolean {\n if (!exp.sdkVersion) {\n return false;\n }\n\n if (exp.sdkVersion === 'UNVERSIONED') {\n return false;\n }\n\n try {\n return semver.lte(exp.sdkVersion, sdkVersion);\n } catch {\n throw new Error(`${exp.sdkVersion} is not a valid version. Must be in the form of x.y.z`);\n }\n}\n"],"file":"versions.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/config-plugins",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.4",
|
|
4
4
|
"description": "A library for Expo config plugins",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"paths"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@expo/config-types": "^
|
|
36
|
-
"@expo/json-file": "8.2.
|
|
35
|
+
"@expo/config-types": "^45.0.0",
|
|
36
|
+
"@expo/json-file": "8.2.36",
|
|
37
37
|
"@expo/plist": "0.0.18",
|
|
38
38
|
"@expo/sdk-runtime-versions": "^1.0.0",
|
|
39
39
|
"@react-native/normalize-color": "^2.0.0",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ExpoConfig } from '@expo/config-types';
|
|
2
|
-
import type { ConfigPlugin } from '../Plugin.types';
|
|
3
|
-
import type { PropertiesItem } from './Properties';
|
|
4
|
-
export declare const JS_ENGINE_PROP_KEY = "expo.jsEngine";
|
|
5
|
-
export declare const DEFAULT_JS_ENGINE = "jsc";
|
|
6
|
-
export declare const withJsEngineGradleProps: ConfigPlugin;
|
|
7
|
-
export declare function getJsEngine(config: Pick<ExpoConfig, 'android' | 'jsEngine'>): "hermes" | "jsc";
|
|
8
|
-
export declare function setJsEngine(config: Pick<ExpoConfig, 'android' | 'jsEngine'>, gradleProperties: PropertiesItem[]): PropertiesItem[];
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.JS_ENGINE_PROP_KEY = exports.DEFAULT_JS_ENGINE = void 0;
|
|
7
|
-
exports.getJsEngine = getJsEngine;
|
|
8
|
-
exports.setJsEngine = setJsEngine;
|
|
9
|
-
exports.withJsEngineGradleProps = void 0;
|
|
10
|
-
|
|
11
|
-
function _androidPlugins() {
|
|
12
|
-
const data = require("../plugins/android-plugins");
|
|
13
|
-
|
|
14
|
-
_androidPlugins = function () {
|
|
15
|
-
return data;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
return data;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const JS_ENGINE_PROP_KEY = 'expo.jsEngine';
|
|
22
|
-
exports.JS_ENGINE_PROP_KEY = JS_ENGINE_PROP_KEY;
|
|
23
|
-
const DEFAULT_JS_ENGINE = 'jsc';
|
|
24
|
-
exports.DEFAULT_JS_ENGINE = DEFAULT_JS_ENGINE;
|
|
25
|
-
|
|
26
|
-
const withJsEngineGradleProps = config => {
|
|
27
|
-
return (0, _androidPlugins().withGradleProperties)(config, config => {
|
|
28
|
-
config.modResults = setJsEngine(config, config.modResults);
|
|
29
|
-
return config;
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
exports.withJsEngineGradleProps = withJsEngineGradleProps;
|
|
34
|
-
|
|
35
|
-
function getJsEngine(config) {
|
|
36
|
-
var _ref, _config$android$jsEng, _config$android;
|
|
37
|
-
|
|
38
|
-
return (_ref = (_config$android$jsEng = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.jsEngine) !== null && _config$android$jsEng !== void 0 ? _config$android$jsEng : config.jsEngine) !== null && _ref !== void 0 ? _ref : DEFAULT_JS_ENGINE;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function setJsEngine(config, gradleProperties) {
|
|
42
|
-
var _ref2, _config$android$jsEng2, _config$android2;
|
|
43
|
-
|
|
44
|
-
const oldPropIndex = gradleProperties.findIndex(prop => prop.type === 'property' && prop.key === JS_ENGINE_PROP_KEY);
|
|
45
|
-
const newProp = {
|
|
46
|
-
type: 'property',
|
|
47
|
-
key: JS_ENGINE_PROP_KEY,
|
|
48
|
-
value: (_ref2 = (_config$android$jsEng2 = (_config$android2 = config.android) === null || _config$android2 === void 0 ? void 0 : _config$android2.jsEngine) !== null && _config$android$jsEng2 !== void 0 ? _config$android$jsEng2 : config.jsEngine) !== null && _ref2 !== void 0 ? _ref2 : DEFAULT_JS_ENGINE
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
if (oldPropIndex >= 0) {
|
|
52
|
-
gradleProperties[oldPropIndex] = newProp;
|
|
53
|
-
} else {
|
|
54
|
-
gradleProperties.push(newProp);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return gradleProperties;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=JsEngine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/android/JsEngine.ts"],"names":["JS_ENGINE_PROP_KEY","DEFAULT_JS_ENGINE","withJsEngineGradleProps","config","modResults","setJsEngine","getJsEngine","android","jsEngine","gradleProperties","oldPropIndex","findIndex","prop","type","key","newProp","value","push"],"mappings":";;;;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,kBAAkB,GAAG,eAA3B;;AACA,MAAMC,iBAAiB,GAAG,KAA1B;;;AAEA,MAAMC,uBAAqC,GAAGC,MAAM,IAAI;AAC7D,SAAO,4CAAqBA,MAArB,EAA6BA,MAAM,IAAI;AAC5CA,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,EAAuE;AAAA;;AAC5E,6DAAOA,MAAM,CAACI,OAAd,oDAAO,gBAAgBC,QAAvB,yEAAmCL,MAAM,CAACK,QAA1C,uCAAsDP,iBAAtD;AACD;;AAEM,SAASI,WAAT,CACLF,MADK,EAELM,gBAFK,EAGa;AAAA;;AAClB,QAAMC,YAAY,GAAGD,gBAAgB,CAACE,SAAjB,CACnBC,IAAI,IAAIA,IAAI,CAACC,IAAL,KAAc,UAAd,IAA4BD,IAAI,CAACE,GAAL,KAAad,kBAD9B,CAArB;AAGA,QAAMe,OAAuB,GAAG;AAC9BF,IAAAA,IAAI,EAAE,UADwB;AAE9BC,IAAAA,GAAG,EAAEd,kBAFyB;AAG9BgB,IAAAA,KAAK,yDAAEb,MAAM,CAACI,OAAT,qDAAE,iBAAgBC,QAAlB,2EAA8BL,MAAM,CAACK,QAArC,yCAAiDP;AAHxB,GAAhC;;AAMA,MAAIS,YAAY,IAAI,CAApB,EAAuB;AACrBD,IAAAA,gBAAgB,CAACC,YAAD,CAAhB,GAAiCK,OAAjC;AACD,GAFD,MAEO;AACLN,IAAAA,gBAAgB,CAACQ,IAAjB,CAAsBF,OAAtB;AACD;;AAED,SAAON,gBAAP;AACD","sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { withGradleProperties } from '../plugins/android-plugins';\nimport type { PropertiesItem } from './Properties';\n\nexport const JS_ENGINE_PROP_KEY = 'expo.jsEngine';\nexport const DEFAULT_JS_ENGINE = 'jsc';\n\nexport const withJsEngineGradleProps: ConfigPlugin = config => {\n return withGradleProperties(config, config => {\n config.modResults = setJsEngine(config, config.modResults);\n return config;\n });\n};\n\nexport function getJsEngine(config: Pick<ExpoConfig, 'android' | 'jsEngine'>) {\n return config.android?.jsEngine ?? config.jsEngine ?? DEFAULT_JS_ENGINE;\n}\n\nexport function setJsEngine(\n config: Pick<ExpoConfig, 'android' | 'jsEngine'>,\n gradleProperties: PropertiesItem[]\n): PropertiesItem[] {\n const oldPropIndex = gradleProperties.findIndex(\n prop => prop.type === 'property' && prop.key === JS_ENGINE_PROP_KEY\n );\n const newProp: PropertiesItem = {\n type: 'property',\n key: JS_ENGINE_PROP_KEY,\n value: config.android?.jsEngine ?? config.jsEngine ?? DEFAULT_JS_ENGINE,\n };\n\n if (oldPropIndex >= 0) {\n gradleProperties[oldPropIndex] = newProp;\n } else {\n gradleProperties.push(newProp);\n }\n\n return gradleProperties;\n}\n"],"file":"JsEngine.js"}
|
package/build/ios/JsEngine.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ExpoConfig } from '@expo/config-types';
|
|
2
|
-
import { JSONValue } from '@expo/json-file';
|
|
3
|
-
import type { ConfigPlugin } from '../Plugin.types';
|
|
4
|
-
export declare const JS_ENGINE_PROP_KEY = "expo.jsEngine";
|
|
5
|
-
export declare const DEFAULT_JS_ENGINE = "jsc";
|
|
6
|
-
export declare const withJsEnginePodfileProps: ConfigPlugin;
|
|
7
|
-
export declare function getJsEngine(config: Pick<ExpoConfig, 'ios' | 'jsEngine'>): "hermes" | "jsc";
|
|
8
|
-
export declare function setJsEngine(config: Pick<ExpoConfig, 'ios' | 'jsEngine'>, podfileProperties: Record<string, JSONValue>): Record<string, JSONValue>;
|
package/build/ios/JsEngine.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.JS_ENGINE_PROP_KEY = exports.DEFAULT_JS_ENGINE = void 0;
|
|
7
|
-
exports.getJsEngine = getJsEngine;
|
|
8
|
-
exports.setJsEngine = setJsEngine;
|
|
9
|
-
exports.withJsEnginePodfileProps = void 0;
|
|
10
|
-
|
|
11
|
-
function _iosPlugins() {
|
|
12
|
-
const data = require("../plugins/ios-plugins");
|
|
13
|
-
|
|
14
|
-
_iosPlugins = function () {
|
|
15
|
-
return data;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
return data;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const JS_ENGINE_PROP_KEY = 'expo.jsEngine';
|
|
22
|
-
exports.JS_ENGINE_PROP_KEY = JS_ENGINE_PROP_KEY;
|
|
23
|
-
const DEFAULT_JS_ENGINE = 'jsc';
|
|
24
|
-
exports.DEFAULT_JS_ENGINE = DEFAULT_JS_ENGINE;
|
|
25
|
-
|
|
26
|
-
const withJsEnginePodfileProps = config => {
|
|
27
|
-
return (0, _iosPlugins().withPodfileProperties)(config, config => {
|
|
28
|
-
config.modResults = setJsEngine(config, config.modResults);
|
|
29
|
-
return config;
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
exports.withJsEnginePodfileProps = withJsEnginePodfileProps;
|
|
34
|
-
|
|
35
|
-
function getJsEngine(config) {
|
|
36
|
-
var _ref, _config$ios$jsEngine, _config$ios;
|
|
37
|
-
|
|
38
|
-
return (_ref = (_config$ios$jsEngine = (_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : _config$ios.jsEngine) !== null && _config$ios$jsEngine !== void 0 ? _config$ios$jsEngine : config.jsEngine) !== null && _ref !== void 0 ? _ref : DEFAULT_JS_ENGINE;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function setJsEngine(config, podfileProperties) {
|
|
42
|
-
var _ref2, _config$ios$jsEngine2, _config$ios2;
|
|
43
|
-
|
|
44
|
-
podfileProperties[JS_ENGINE_PROP_KEY] = (_ref2 = (_config$ios$jsEngine2 = (_config$ios2 = config.ios) === null || _config$ios2 === void 0 ? void 0 : _config$ios2.jsEngine) !== null && _config$ios$jsEngine2 !== void 0 ? _config$ios$jsEngine2 : config.jsEngine) !== null && _ref2 !== void 0 ? _ref2 : DEFAULT_JS_ENGINE;
|
|
45
|
-
return podfileProperties;
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=JsEngine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|