@expo/config-plugins 4.1.5 → 5.0.0

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.
Files changed (94) hide show
  1. package/build/Plugin.types.d.ts +8 -0
  2. package/build/Plugin.types.js.map +1 -1
  3. package/build/android/AllowBackup.js.map +1 -1
  4. package/build/android/BuildProperties.js.map +1 -1
  5. package/build/android/Colors.js.map +1 -1
  6. package/build/android/EasBuild.js.map +1 -1
  7. package/build/android/EasBuildGradleScript.js.map +1 -1
  8. package/build/android/GoogleMapsApiKey.js.map +1 -1
  9. package/build/android/GoogleServices.js.map +1 -1
  10. package/build/android/IntentFilters.js.map +1 -1
  11. package/build/android/Manifest.js.map +1 -1
  12. package/build/android/Name.js.map +1 -1
  13. package/build/android/Orientation.js.map +1 -1
  14. package/build/android/Package.js.map +1 -1
  15. package/build/android/Paths.js.map +1 -1
  16. package/build/android/Permissions.js.map +1 -1
  17. package/build/android/PrimaryColor.js.map +1 -1
  18. package/build/android/Properties.js.map +1 -1
  19. package/build/android/Resources.js.map +1 -1
  20. package/build/android/Scheme.js.map +1 -1
  21. package/build/android/StatusBar.js.map +1 -1
  22. package/build/android/Strings.js.map +1 -1
  23. package/build/android/Styles.js.map +1 -1
  24. package/build/android/Updates.js.map +1 -1
  25. package/build/android/Version.js.map +1 -1
  26. package/build/android/WindowSoftInputMode.js.map +1 -1
  27. package/build/android/codeMod.js.map +1 -1
  28. package/build/android/index.js.map +1 -1
  29. package/build/index.js.map +1 -1
  30. package/build/ios/Bitcode.js.map +1 -1
  31. package/build/ios/BuildProperties.js.map +1 -1
  32. package/build/ios/BuildScheme.js.map +1 -1
  33. package/build/ios/BundleIdentifier.js.map +1 -1
  34. package/build/ios/DeviceFamily.js.map +1 -1
  35. package/build/ios/Entitlements.js.map +1 -1
  36. package/build/ios/Google.js.map +1 -1
  37. package/build/ios/IosConfig.types.js.map +1 -1
  38. package/build/ios/Locales.js.map +1 -1
  39. package/build/ios/Maps.js.map +1 -1
  40. package/build/ios/Name.js +8 -2
  41. package/build/ios/Name.js.map +1 -1
  42. package/build/ios/Orientation.js +4 -1
  43. package/build/ios/Orientation.js.map +1 -1
  44. package/build/ios/Paths.js.map +1 -1
  45. package/build/ios/Permissions.js.map +1 -1
  46. package/build/ios/ProvisioningProfile.js.map +1 -1
  47. package/build/ios/RequiresFullScreen.js.map +1 -1
  48. package/build/ios/Scheme.js +4 -1
  49. package/build/ios/Scheme.js.map +1 -1
  50. package/build/ios/Swift.js.map +1 -1
  51. package/build/ios/Target.js.map +1 -1
  52. package/build/ios/Updates.js.map +1 -1
  53. package/build/ios/UsesNonExemptEncryption.js +4 -1
  54. package/build/ios/UsesNonExemptEncryption.js.map +1 -1
  55. package/build/ios/Version.js +8 -2
  56. package/build/ios/Version.js.map +1 -1
  57. package/build/ios/XcodeProjectFile.js.map +1 -1
  58. package/build/ios/codeMod.js.map +1 -1
  59. package/build/ios/index.js.map +1 -1
  60. package/build/ios/utils/Xcodeproj.js.map +1 -1
  61. package/build/ios/utils/getInfoPlistPath.js.map +1 -1
  62. package/build/ios/utils/string.js.map +1 -1
  63. package/build/plugins/android-plugins.js.map +1 -1
  64. package/build/plugins/createBaseMod.js.map +1 -1
  65. package/build/plugins/ios-plugins.d.ts +5 -0
  66. package/build/plugins/ios-plugins.js +46 -0
  67. package/build/plugins/ios-plugins.js.map +1 -1
  68. package/build/plugins/mod-compiler.js +18 -4
  69. package/build/plugins/mod-compiler.js.map +1 -1
  70. package/build/plugins/withAndroidBaseMods.js.map +1 -1
  71. package/build/plugins/withDangerousMod.js.map +1 -1
  72. package/build/plugins/withIosBaseMods.js.map +1 -1
  73. package/build/plugins/withMod.js.map +1 -1
  74. package/build/plugins/withPlugins.js.map +1 -1
  75. package/build/plugins/withRunOnce.js.map +1 -1
  76. package/build/plugins/withStaticPlugin.js.map +1 -1
  77. package/build/utils/BuildProperties.types.js.map +1 -1
  78. package/build/utils/Updates.js.map +1 -1
  79. package/build/utils/XML.js.map +1 -1
  80. package/build/utils/commonCodeMod.js.map +1 -1
  81. package/build/utils/errors.js.map +1 -1
  82. package/build/utils/fs.js.map +1 -1
  83. package/build/utils/generateCode.js.map +1 -1
  84. package/build/utils/history.js.map +1 -1
  85. package/build/utils/matchBrackets.js.map +1 -1
  86. package/build/utils/modules.js.map +1 -1
  87. package/build/utils/obj.d.ts +2 -0
  88. package/build/utils/obj.js +24 -0
  89. package/build/utils/obj.js.map +1 -0
  90. package/build/utils/plugin-resolver.js.map +1 -1
  91. package/build/utils/sortObject.js.map +1 -1
  92. package/build/utils/versions.js.map +1 -1
  93. package/build/utils/warnings.js.map +1 -1
  94. package/package.json +7 -6
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ios/Permissions.ts"],"names":["debug","applyPermissions","defaults","permissions","infoPlist","entries","Object","length","JSON","stringify","permission","description","createPermissionsPlugin","name","withIosPermissions","config","modResults","defineProperty","value"],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAGA,MAAMA,KAAK,GAAG,sBAAM,qCAAN,CAAd;;AAEO,SAASC,gBAAT,CACLC,QADK,EAELC,WAFK,EAGLC,SAHK,EAIM;AACX,QAAMC,OAAO,GAAGC,MAAM,CAACD,OAAP,CAAeH,QAAf,CAAhB;;AACA,MAAIG,OAAO,CAACE,MAAR,KAAmB,CAAvB,EAA0B;AACxBP,IAAAA,KAAK,CAAE,yBAAwBQ,IAAI,CAACC,SAAL,CAAeN,WAAf,CAA4B,EAAtD,CAAL;AACD;;AACD,OAAK,MAAM,CAACO,UAAD,EAAaC,WAAb,CAAX,IAAwCN,OAAxC,EAAiD;AAC/C,QAAIF,WAAW,CAACO,UAAD,CAAX,KAA4B,KAAhC,EAAuC;AACrCV,MAAAA,KAAK,CAAE,aAAYU,UAAW,GAAzB,CAAL;AACA,aAAON,SAAS,CAACM,UAAD,CAAhB;AACD,KAHD,MAGO;AACLN,MAAAA,SAAS,CAACM,UAAD,CAAT,GAAwBP,WAAW,CAACO,UAAD,CAAX,IAA2BN,SAAS,CAACM,UAAD,CAApC,IAAoDC,WAA5E;AACAX,MAAAA,KAAK,CAAE,YAAWU,UAAW,SAAQN,SAAS,CAACM,UAAD,CAAa,GAAtD,CAAL;AACD;AACF;;AACD,SAAON,SAAP;AACD;AAED;AACA;AACA;AACA;AACA;;;AACO,SAASQ,uBAAT,CAELV,QAFK,EAEeW,IAFf,EAE8B;AACnC,QAAMC,kBAAoF,GAAG,CAC3FC,MAD2F,EAE3FZ,WAF2F,KAI3F,iCAAcY,MAAd,EAAsB,MAAMA,MAAN,IAAgB;AACpCA,IAAAA,MAAM,CAACC,UAAP,GAAoBf,gBAAgB,CAACC,QAAD,EAAWC,WAAX,EAAwBY,MAAM,CAACC,UAA/B,CAApC;AACA,WAAOD,MAAP;AACD,GAHD,CAJF;;AAQA,MAAIF,IAAJ,EAAU;AACRP,IAAAA,MAAM,CAACW,cAAP,CAAsBH,kBAAtB,EAA0C,MAA1C,EAAkD;AAChDI,MAAAA,KAAK,EAAEL;AADyC,KAAlD;AAGD;;AACD,SAAOC,kBAAP;AACD","sourcesContent":["import Debug from 'debug';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withInfoPlist } from '../plugins/ios-plugins';\nimport { InfoPlist } from './IosConfig.types';\n\nconst debug = Debug('expo:config-plugins:ios:permissions');\n\nexport function applyPermissions<Defaults extends Record<string, string> = Record<string, string>>(\n defaults: Defaults,\n permissions: Partial<Record<keyof Defaults, string | false>>,\n infoPlist: InfoPlist\n): InfoPlist {\n const entries = Object.entries(defaults);\n if (entries.length === 0) {\n debug(`No defaults provided: ${JSON.stringify(permissions)}`);\n }\n for (const [permission, description] of entries) {\n if (permissions[permission] === false) {\n debug(`Deleting \"${permission}\"`);\n delete infoPlist[permission];\n } else {\n infoPlist[permission] = permissions[permission] || infoPlist[permission] || description;\n debug(`Setting \"${permission}\" to \"${infoPlist[permission]}\"`);\n }\n }\n return infoPlist;\n}\n\n/**\n * Helper method for creating mods to apply default permissions.\n *\n * @param action\n */\nexport function createPermissionsPlugin<\n Defaults extends Record<string, string> = Record<string, string>\n>(defaults: Defaults, name?: string) {\n const withIosPermissions: ConfigPlugin<Record<keyof Defaults, string | undefined | false>> = (\n config,\n permissions\n ) =>\n withInfoPlist(config, async config => {\n config.modResults = applyPermissions(defaults, permissions, config.modResults);\n return config;\n });\n if (name) {\n Object.defineProperty(withIosPermissions, 'name', {\n value: name,\n });\n }\n return withIosPermissions;\n}\n"],"file":"Permissions.js"}
1
+ {"version":3,"file":"Permissions.js","names":["debug","Debug","applyPermissions","defaults","permissions","infoPlist","entries","Object","length","JSON","stringify","permission","description","createPermissionsPlugin","name","withIosPermissions","config","withInfoPlist","modResults","defineProperty","value"],"sources":["../../src/ios/Permissions.ts"],"sourcesContent":["import Debug from 'debug';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withInfoPlist } from '../plugins/ios-plugins';\nimport { InfoPlist } from './IosConfig.types';\n\nconst debug = Debug('expo:config-plugins:ios:permissions');\n\nexport function applyPermissions<Defaults extends Record<string, string> = Record<string, string>>(\n defaults: Defaults,\n permissions: Partial<Record<keyof Defaults, string | false>>,\n infoPlist: InfoPlist\n): InfoPlist {\n const entries = Object.entries(defaults);\n if (entries.length === 0) {\n debug(`No defaults provided: ${JSON.stringify(permissions)}`);\n }\n for (const [permission, description] of entries) {\n if (permissions[permission] === false) {\n debug(`Deleting \"${permission}\"`);\n delete infoPlist[permission];\n } else {\n infoPlist[permission] = permissions[permission] || infoPlist[permission] || description;\n debug(`Setting \"${permission}\" to \"${infoPlist[permission]}\"`);\n }\n }\n return infoPlist;\n}\n\n/**\n * Helper method for creating mods to apply default permissions.\n *\n * @param action\n */\nexport function createPermissionsPlugin<\n Defaults extends Record<string, string> = Record<string, string>\n>(defaults: Defaults, name?: string) {\n const withIosPermissions: ConfigPlugin<Record<keyof Defaults, string | undefined | false>> = (\n config,\n permissions\n ) =>\n withInfoPlist(config, async (config) => {\n config.modResults = applyPermissions(defaults, permissions, config.modResults);\n return config;\n });\n if (name) {\n Object.defineProperty(withIosPermissions, 'name', {\n value: name,\n });\n }\n return withIosPermissions;\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAGA,MAAMA,KAAK,GAAG,IAAAC,gBAAA,EAAM,qCAAN,CAAd;;AAEO,SAASC,gBAAT,CACLC,QADK,EAELC,WAFK,EAGLC,SAHK,EAIM;EACX,MAAMC,OAAO,GAAGC,MAAM,CAACD,OAAP,CAAeH,QAAf,CAAhB;;EACA,IAAIG,OAAO,CAACE,MAAR,KAAmB,CAAvB,EAA0B;IACxBR,KAAK,CAAE,yBAAwBS,IAAI,CAACC,SAAL,CAAeN,WAAf,CAA4B,EAAtD,CAAL;EACD;;EACD,KAAK,MAAM,CAACO,UAAD,EAAaC,WAAb,CAAX,IAAwCN,OAAxC,EAAiD;IAC/C,IAAIF,WAAW,CAACO,UAAD,CAAX,KAA4B,KAAhC,EAAuC;MACrCX,KAAK,CAAE,aAAYW,UAAW,GAAzB,CAAL;MACA,OAAON,SAAS,CAACM,UAAD,CAAhB;IACD,CAHD,MAGO;MACLN,SAAS,CAACM,UAAD,CAAT,GAAwBP,WAAW,CAACO,UAAD,CAAX,IAA2BN,SAAS,CAACM,UAAD,CAApC,IAAoDC,WAA5E;MACAZ,KAAK,CAAE,YAAWW,UAAW,SAAQN,SAAS,CAACM,UAAD,CAAa,GAAtD,CAAL;IACD;EACF;;EACD,OAAON,SAAP;AACD;AAED;AACA;AACA;AACA;AACA;;;AACO,SAASQ,uBAAT,CAELV,QAFK,EAEeW,IAFf,EAE8B;EACnC,MAAMC,kBAAoF,GAAG,CAC3FC,MAD2F,EAE3FZ,WAF2F,KAI3F,IAAAa,2BAAA,EAAcD,MAAd,EAAsB,MAAOA,MAAP,IAAkB;IACtCA,MAAM,CAACE,UAAP,GAAoBhB,gBAAgB,CAACC,QAAD,EAAWC,WAAX,EAAwBY,MAAM,CAACE,UAA/B,CAApC;IACA,OAAOF,MAAP;EACD,CAHD,CAJF;;EAQA,IAAIF,IAAJ,EAAU;IACRP,MAAM,CAACY,cAAP,CAAsBJ,kBAAtB,EAA0C,MAA1C,EAAkD;MAChDK,KAAK,EAAEN;IADyC,CAAlD;EAGD;;EACD,OAAOC,kBAAP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ios/ProvisioningProfile.ts"],"names":["setProvisioningProfileForPbxproj","projectRoot","targetName","profileName","appleTeamId","buildConfiguration","project","nativeTargetEntry","nativeTargetId","nativeTarget","quotedAppleTeamId","ensureQuotes","buildConfigurationList","filter","item","name","forEach","buildSettings","PROVISIONING_PROFILE_SPECIFIER","DEVELOPMENT_TEAM","CODE_SIGN_IDENTITY","CODE_SIGN_STYLE","Object","entries","isNotComment","attributes","TargetAttributes","DevelopmentTeam","ProvisioningStyle","fs","writeFileSync","filepath","writeSync","value","match"],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAQA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AASO,SAASA,gCAAT,CACLC,WADK,EAEL;AACEC,EAAAA,UADF;AAEEC,EAAAA,WAFF;AAGEC,EAAAA,WAHF;AAIEC,EAAAA,kBAAkB,GAAG;AAJvB,CAFK,EAQC;AACN,QAAMC,OAAO,GAAG,6BAAWL,WAAX,CAAhB;AAEA,QAAMM,iBAAiB,GAAGL,UAAU,GAChC,sCAAuBI,OAAvB,EAAgCJ,UAAhC,CADgC,GAEhC,qCAAsBI,OAAtB,CAFJ;AAGA,QAAM,CAACE,cAAD,EAAiBC,YAAjB,IAAiCF,iBAAvC;AAEA,Q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WAAQ,IAAGD,KAAM,GAAjB;AACD;;AACD,SAAOA,KAAP;AACD,CALD","sourcesContent":["import fs from 'fs';\n\nimport { findFirstNativeTarget, findNativeTargetByName } from './Target';\nimport {\n ConfigurationSectionEntry,\n getBuildConfigurationsForListId,\n getPbxproj,\n getProjectSection,\n isNotComment,\n ProjectSectionEntry,\n} from './utils/Xcodeproj';\nimport { trimQuotes } from './utils/string';\n\ntype ProvisioningProfileSettings = {\n targetName?: string;\n appleTeamId: string;\n profileName: string;\n buildConfiguration?: string;\n};\n\nexport function setProvisioningProfileForPbxproj(\n projectRoot: string,\n {\n targetName,\n profileName,\n appleTeamId,\n buildConfiguration = 'Release',\n }: ProvisioningProfileSettings\n): void {\n const project = getPbxproj(projectRoot);\n\n const nativeTargetEntry = targetName\n ? findNativeTargetByName(project, targetName)\n : findFirstNativeTarget(project);\n const [nativeTargetId, nativeTarget] = nativeTargetEntry;\n\n const quotedAppleTeamId = ensureQuotes(appleTeamId);\n\n getBuildConfigurationsForListId(project, nativeTarget.buildConfigurationList)\n .filter(([, item]: ConfigurationSectionEntry) => trimQuotes(item.name) === buildConfiguration)\n .forEach(([, item]: ConfigurationSectionEntry) => {\n item.buildSettings.PROVISIONING_PROFILE_SPECIFIER = `\"${profileName}\"`;\n item.buildSettings.DEVELOPMENT_TEAM = quotedAppleTeamId;\n item.buildSettings.CODE_SIGN_IDENTITY = '\"iPhone Distribution\"';\n item.buildSettings.CODE_SIGN_STYLE = 'Manual';\n });\n\n Object.entries(getProjectSection(project))\n .filter(isNotComment)\n .forEach(([, item]: ProjectSectionEntry) => {\n if (!item.attributes.TargetAttributes[nativeTargetId]) {\n item.attributes.TargetAttributes[nativeTargetId] = {};\n }\n item.attributes.TargetAttributes[nativeTargetId].DevelopmentTeam = quotedAppleTeamId;\n item.attributes.TargetAttributes[nativeTargetId].ProvisioningStyle = 'Manual';\n });\n\n fs.writeFileSync(project.filepath, project.writeSync());\n}\n\nconst ensureQuotes = (value: string) => {\n if (!value.match(/^['\"]/)) {\n return `\"${value}\"`;\n }\n return value;\n};\n"],"file":"ProvisioningProfile.js"}
1
+ {"version":3,"file":"ProvisioningProfile.js","names":["setProvisioningProfileForPbxproj","projectRoot","targetName","profileName","appleTeamId","buildConfiguration","project","getPbxproj","nativeTargetEntry","findNativeTargetByName","findFirstNativeTarget","nativeTargetId","nativeTarget","quotedAppleTeamId","ensureQuotes","getBuildConfigurationsForListId","buildConfigurationList","filter","item","trimQuotes","name","forEach","buildSettings","PROVISIONING_PROFILE_SPECIFIER","DEVELOPMENT_TEAM","CODE_SIGN_IDENTITY","CODE_SIGN_STYLE","Object","entries","getProjectSection","isNotComment","attributes","TargetAttributes","DevelopmentTeam","ProvisioningStyle","fs","writeFileSync","filepath","writeSync","value","match"],"sources":["../../src/ios/ProvisioningProfile.ts"],"sourcesContent":["import fs from 'fs';\n\nimport { findFirstNativeTarget, findNativeTargetByName } from './Target';\nimport {\n ConfigurationSectionEntry,\n getBuildConfigurationsForListId,\n getPbxproj,\n getProjectSection,\n isNotComment,\n ProjectSectionEntry,\n} from './utils/Xcodeproj';\nimport { trimQuotes } from './utils/string';\n\ntype ProvisioningProfileSettings = {\n targetName?: string;\n appleTeamId: string;\n profileName: string;\n buildConfiguration?: string;\n};\n\nexport function setProvisioningProfileForPbxproj(\n projectRoot: string,\n {\n targetName,\n profileName,\n appleTeamId,\n buildConfiguration = 'Release',\n }: ProvisioningProfileSettings\n): void {\n const project = getPbxproj(projectRoot);\n\n const nativeTargetEntry = targetName\n ? findNativeTargetByName(project, targetName)\n : findFirstNativeTarget(project);\n const [nativeTargetId, nativeTarget] = nativeTargetEntry;\n\n const quotedAppleTeamId = ensureQuotes(appleTeamId);\n\n getBuildConfigurationsForListId(project, nativeTarget.buildConfigurationList)\n .filter(([, item]: ConfigurationSectionEntry) => trimQuotes(item.name) === buildConfiguration)\n .forEach(([, item]: ConfigurationSectionEntry) => {\n item.buildSettings.PROVISIONING_PROFILE_SPECIFIER = `\"${profileName}\"`;\n item.buildSettings.DEVELOPMENT_TEAM = quotedAppleTeamId;\n item.buildSettings.CODE_SIGN_IDENTITY = '\"iPhone Distribution\"';\n item.buildSettings.CODE_SIGN_STYLE = 'Manual';\n });\n\n Object.entries(getProjectSection(project))\n .filter(isNotComment)\n .forEach(([, item]: ProjectSectionEntry) => {\n if (!item.attributes.TargetAttributes[nativeTargetId]) {\n item.attributes.TargetAttributes[nativeTargetId] = {};\n }\n item.attributes.TargetAttributes[nativeTargetId].DevelopmentTeam = quotedAppleTeamId;\n item.attributes.TargetAttributes[nativeTargetId].ProvisioningStyle = 'Manual';\n });\n\n fs.writeFileSync(project.filepath, project.writeSync());\n}\n\nconst ensureQuotes = (value: string) => {\n if (!value.match(/^['\"]/)) {\n return `\"${value}\"`;\n }\n return value;\n};\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAQA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AASO,SAASA,gCAAT,CACLC,WADK,EAEL;EACEC,UADF;EAEEC,WAFF;EAGEC,WAHF;EAIEC,kBAAkB,GAAG;AAJvB,CAFK,EAQC;EACN,MAAMC,OAAO,GAAG,IAAAC,uBAAA,EAAWN,WAAX,CAAhB;EAEA,MAAMO,iBAAiB,GAAGN,UAAU,GAChC,IAAAO,gCAAA,EAAuBH,OAAvB,EAAgCJ,UAAhC,CADgC,GAEhC,IAAAQ,+BAAA,EAAsBJ,OAAtB,CAFJ;EAGA,MAAM,CAACK,cAAD,EAAiBC,YAAjB,IAAiCJ,iBAAvC;EAEA,MAAMK,iBAAiB,GAAGC,YAAY,CAACV,WAAD,CAAtC;EAEA,IAAAW,4CAAA,EAAgCT,OAAhC,EAAyCM,YAAY,CAACI,sBAAtD,EACGC,MADH,CACU,CAAC,GAAGC,IAAH,CAAD,KAAyC,IAAAC,oBAAA,EAAWD,IAAI,CAACE,IAAhB,MAA0Bf,kBAD7E,EAEGgB,OAFH,CAEW,CAAC,GAAGH,IAAH,CAAD,KAAyC;IAChDA,IAAI,CAACI,aAAL,CAAmBC,8BAAnB,GAAqD,IAAGpB,WAAY,GAApE;IACAe,IAAI,CAACI,aAAL,CAAmBE,gBAAnB,GAAsCX,iBAAtC;IACAK,IAAI,CAACI,aAAL,CAAmBG,kBAAnB,GAAwC,uBAAxC;IACAP,IAAI,CAACI,aAAL,CAAmBI,eAAnB,GAAqC,QAArC;EACD,CAPH;EASAC,MAAM,CAACC,OAAP,CAAe,IAAAC,8BAAA,EAAkBvB,OAAlB,CAAf,EACGW,MADH,CACUa,yBADV,EAEGT,OAFH,CAEW,CAAC,GAAGH,IAAH,CAAD,KAAmC;IAC1C,IAAI,CAACA,IAAI,CAACa,UAAL,CAAgBC,gBAAhB,CAAiCrB,cAAjC,CAAL,EAAuD;MACrDO,IAAI,CAACa,UAAL,CAAgBC,gBAAhB,CAAiCrB,cAAjC,IAAmD,EAAnD;IACD;;IACDO,IAAI,CAACa,UAAL,CAAgBC,gBAAhB,CAAiCrB,cAAjC,EAAiDsB,eAAjD,GAAmEpB,iBAAnE;IACAK,IAAI,CAACa,UAAL,CAAgBC,gBAAhB,CAAiCrB,cAAjC,EAAiDuB,iBAAjD,GAAqE,QAArE;EACD,CARH;;EAUAC,aAAA,CAAGC,aAAH,CAAiB9B,OAAO,CAAC+B,QAAzB,EAAmC/B,OAAO,CAACgC,SAAR,EAAnC;AACD;;AAED,MAAMxB,YAAY,GAAIyB,KAAD,IAAmB;EACtC,IAAI,CAACA,KAAK,CAACC,KAAN,CAAY,OAAZ,CAAL,EAA2B;IACzB,OAAQ,IAAGD,KAAM,GAAjB;EACD;;EACD,OAAOA,KAAP;AACD,CALD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ios/RequiresFullScreen.ts"],"names":["withRequiresFullScreen","setRequiresFullScreen","getRequiresFullScreen","config","ios","hasOwnProperty","requireFullScreen","iPadInterfaceKey","requiredIPadInterface","isStringArray","value","Array","isArray","every","hasMinimumOrientations","masks","mask","includes","resolveExistingIpadInterfaceOrientations","interfaceOrientations","length","existingList","join","infoPlist","requiresFullScreen","existing","Set","concat","UIRequiresFullScreen"],"mappings":";;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,sBAAsB,GAAG,yCACpCC,qBADoC,EAEpC,wBAFoC,CAA/B,C,CAKP;AACA;;;;AACO,SAASC,qBAAT,CAA+BC,MAA/B,EAA+E;AAAA;;AACpF;AACA;AACA,qBAAIA,MAAM,CAACC,GAAX,wCAAI,YAAYC,cAAZ,CAA2B,mBAA3B,CAAJ,EAAqD;AACnD,WAAO,CAAC,CAACF,MAAM,CAACC,GAAP,CAAWE,iBAApB;AACD,GAFD,MAEO;AACL;AACA,QACE,+BAAcH,MAAd,EAAsB,QAAtB,CADF,CAEE;AACA;AAHF,MAIE;AACA,aAAO,KAAP;AACD;;AACD,WAAO,IAAP;AACD;AACF;;AAED,MAAMI,gBAAgB,GAAG,uCAAzB;AAEA,MAAMC,qBAAqB,GAAG,CAC5B,gCAD4B,EAE5B,0CAF4B,EAG5B,qCAH4B,EAI5B,sCAJ4B,CAA9B;;AAOA,SAASC,aAAT,CAAuBC,KAAvB,EAAsD;AACpD,SAAOC,KAAK,CAACC,OAAN,CAAcF,KAAd,KAAwBA,KAAK,CAACG,KAAN,CAAYH,KAAK,IAAI,OAAOA,KAAP,KAAiB,QAAtC,CAA/B;AACD;;AAED,SAASI,sBAAT,CAAgCC,KAAhC,EAA0D;AACxD,SAAOP,qBAAqB,CAACK,KAAtB,CAA4BG,IAAI,IAAID,KAAK,CAACE,QAAN,CAAeD,IAAf,CAApC,CAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASE,wCAAT,CAAkDC,qBAAlD,EAAwF;AACtF,OACE;AACAV,EAAAA,aAAa,CAACU,qBAAD,CAAb,IACA;AACAA,EAAAA,qBAAqB,CAACC,MAFtB,IAGA;AACA,GAACN,sBAAsB,CAACK,qBAAD,CANzB,EAOE;AACA,UAAME,YAAY,GAAGF,qBAAqB,CAAEG,IAAvB,CAA4B,IAA5B,CAArB;AACA,mCACE,uBADF,EAEG,oCAAmCf,gBAAiB,wMAAuMc,YAAa,EAF3Q;AAIA,WAAOF,qBAAP;AACD;;AACD,SAAO,EAAP;AACD,C,CAED;;;AACO,SAASlB,qBAAT,CACLE,MADK,EAELoB,SAFK,EAGM;AACX,QAAMC,kBAAkB,GAAGtB,qBAAqB,CAACC,MAAD,CAAhD;;AACA,MAAI,CAACqB,kBAAL,EAAyB;AACvB,UAAMC,QAAQ,GAAGP,wCAAwC,CAACK,SAAS,CAAChB,gBAAD,CAAV,CAAzD,CADuB,CAGvB;AACA;AACA;AAEA;;AACAgB,IAAAA,SAAS,CAAChB,gBAAD,CAAT,GAA8B,CAAC,GAAG,IAAImB,GAAJ,CAAQD,QAAQ,CAACE,MAAT,CAAgBnB,qBAAhB,CAAR,CAAJ,CAA9B;AACD;;AAED,SAAO,EACL,GAAGe,SADE;AAELK,IAAAA,oBAAoB,EAAEJ;AAFjB,GAAP;AAID","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPlugin } from '../plugins/ios-plugins';\nimport { gteSdkVersion } from '../utils/versions';\nimport { addWarningIOS } from '../utils/warnings';\nimport { InfoPlist } from './IosConfig.types';\n\nexport const withRequiresFullScreen = createInfoPlistPlugin(\n setRequiresFullScreen,\n 'withRequiresFullScreen'\n);\n\n// NOTES: This is defaulted to `true` for now to match the behavior prior to SDK\n// 34, but will change to `false` in SDK +43.\nexport function getRequiresFullScreen(config: Pick<ExpoConfig, 'ios' | 'sdkVersion'>) {\n // Yes, the property is called ios.requireFullScreen, without the s - not \"requires\"\n // This is confusing indeed because the actual property name does have the s\n if (config.ios?.hasOwnProperty('requireFullScreen')) {\n return !!config.ios.requireFullScreen;\n } else {\n // In SDK 43, the `requireFullScreen` default has been changed to false.\n if (\n gteSdkVersion(config, '43.0.0')\n // TODO: Uncomment after SDK 43 is released.\n // || !config.sdkVersion\n ) {\n return false;\n }\n return true;\n }\n}\n\nconst iPadInterfaceKey = 'UISupportedInterfaceOrientations~ipad';\n\nconst requiredIPadInterface = [\n 'UIInterfaceOrientationPortrait',\n 'UIInterfaceOrientationPortraitUpsideDown',\n 'UIInterfaceOrientationLandscapeLeft',\n 'UIInterfaceOrientationLandscapeRight',\n];\n\nfunction isStringArray(value: any): value is string[] {\n return Array.isArray(value) && value.every(value => typeof value === 'string');\n}\n\nfunction hasMinimumOrientations(masks: string[]): boolean {\n return requiredIPadInterface.every(mask => masks.includes(mask));\n}\n\n/**\n * Require full screen being disabled requires all ipad interfaces to to be added,\n * otherwise submissions to the iOS App Store will fail.\n *\n * ERROR ITMS-90474: \"Invalid Bundle. iPad Multitasking support requires these orientations: 'UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown,UIInterfaceOrientationLandscapeLeft,UIInterfaceOrientationLandscapeRight'. Found 'UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown' in bundle 'com.bacon.app'.\"\n *\n * @param interfaceOrientations\n * @returns\n */\nfunction resolveExistingIpadInterfaceOrientations(interfaceOrientations: any): string[] {\n if (\n // Ensure type.\n isStringArray(interfaceOrientations) &&\n // Don't warn if it's an empty array, this is invalid regardless.\n interfaceOrientations.length &&\n // Check if the minimum requirements are met.\n !hasMinimumOrientations(interfaceOrientations)\n ) {\n const existingList = interfaceOrientations!.join(', ');\n addWarningIOS(\n 'ios.requireFullScreen',\n `iPad multitasking requires all \\`${iPadInterfaceKey}\\` orientations to be defined in the Info.plist. The Info.plist currently defines values that are incompatible with multitasking, these will be overwritten to prevent submission failure. Existing: ${existingList}`\n );\n return interfaceOrientations;\n }\n return [];\n}\n\n// Whether requires full screen on iPad\nexport function setRequiresFullScreen(\n config: Pick<ExpoConfig, 'ios'>,\n infoPlist: InfoPlist\n): InfoPlist {\n const requiresFullScreen = getRequiresFullScreen(config);\n if (!requiresFullScreen) {\n const existing = resolveExistingIpadInterfaceOrientations(infoPlist[iPadInterfaceKey]);\n\n // There currently exists no mechanism to safely undo this feature besides `expo prebuild --clear`,\n // this seems ok though because anyone using `UISupportedInterfaceOrientations~ipad` probably\n // wants them to be defined to this value anyways. This is also the default value used in the Xcode iOS template.\n\n // Merge any previous interfaces with the required interfaces.\n infoPlist[iPadInterfaceKey] = [...new Set(existing.concat(requiredIPadInterface))];\n }\n\n return {\n ...infoPlist,\n UIRequiresFullScreen: requiresFullScreen,\n };\n}\n"],"file":"RequiresFullScreen.js"}
1
+ {"version":3,"file":"RequiresFullScreen.js","names":["withRequiresFullScreen","createInfoPlistPlugin","setRequiresFullScreen","getRequiresFullScreen","config","ios","hasOwnProperty","requireFullScreen","gteSdkVersion","iPadInterfaceKey","requiredIPadInterface","isStringArray","value","Array","isArray","every","hasMinimumOrientations","masks","mask","includes","resolveExistingIpadInterfaceOrientations","interfaceOrientations","length","existingList","join","addWarningIOS","infoPlist","requiresFullScreen","existing","Set","concat","UIRequiresFullScreen"],"sources":["../../src/ios/RequiresFullScreen.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPlugin } from '../plugins/ios-plugins';\nimport { gteSdkVersion } from '../utils/versions';\nimport { addWarningIOS } from '../utils/warnings';\nimport { InfoPlist } from './IosConfig.types';\n\nexport const withRequiresFullScreen = createInfoPlistPlugin(\n setRequiresFullScreen,\n 'withRequiresFullScreen'\n);\n\n// NOTES: This is defaulted to `true` for now to match the behavior prior to SDK\n// 34, but will change to `false` in SDK +43.\nexport function getRequiresFullScreen(config: Pick<ExpoConfig, 'ios' | 'sdkVersion'>) {\n // Yes, the property is called ios.requireFullScreen, without the s - not \"requires\"\n // This is confusing indeed because the actual property name does have the s\n if (config.ios?.hasOwnProperty('requireFullScreen')) {\n return !!config.ios.requireFullScreen;\n } else {\n // In SDK 43, the `requireFullScreen` default has been changed to false.\n if (\n gteSdkVersion(config, '43.0.0')\n // TODO: Uncomment after SDK 43 is released.\n // || !config.sdkVersion\n ) {\n return false;\n }\n return true;\n }\n}\n\nconst iPadInterfaceKey = 'UISupportedInterfaceOrientations~ipad';\n\nconst requiredIPadInterface = [\n 'UIInterfaceOrientationPortrait',\n 'UIInterfaceOrientationPortraitUpsideDown',\n 'UIInterfaceOrientationLandscapeLeft',\n 'UIInterfaceOrientationLandscapeRight',\n];\n\nfunction isStringArray(value: any): value is string[] {\n return Array.isArray(value) && value.every((value) => typeof value === 'string');\n}\n\nfunction hasMinimumOrientations(masks: string[]): boolean {\n return requiredIPadInterface.every((mask) => masks.includes(mask));\n}\n\n/**\n * Require full screen being disabled requires all ipad interfaces to to be added,\n * otherwise submissions to the iOS App Store will fail.\n *\n * ERROR ITMS-90474: \"Invalid Bundle. iPad Multitasking support requires these orientations: 'UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown,UIInterfaceOrientationLandscapeLeft,UIInterfaceOrientationLandscapeRight'. Found 'UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown' in bundle 'com.bacon.app'.\"\n *\n * @param interfaceOrientations\n * @returns\n */\nfunction resolveExistingIpadInterfaceOrientations(interfaceOrientations: any): string[] {\n if (\n // Ensure type.\n isStringArray(interfaceOrientations) &&\n // Don't warn if it's an empty array, this is invalid regardless.\n interfaceOrientations.length &&\n // Check if the minimum requirements are met.\n !hasMinimumOrientations(interfaceOrientations)\n ) {\n const existingList = interfaceOrientations!.join(', ');\n addWarningIOS(\n 'ios.requireFullScreen',\n `iPad multitasking requires all \\`${iPadInterfaceKey}\\` orientations to be defined in the Info.plist. The Info.plist currently defines values that are incompatible with multitasking, these will be overwritten to prevent submission failure. Existing: ${existingList}`\n );\n return interfaceOrientations;\n }\n return [];\n}\n\n// Whether requires full screen on iPad\nexport function setRequiresFullScreen(\n config: Pick<ExpoConfig, 'ios'>,\n infoPlist: InfoPlist\n): InfoPlist {\n const requiresFullScreen = getRequiresFullScreen(config);\n if (!requiresFullScreen) {\n const existing = resolveExistingIpadInterfaceOrientations(infoPlist[iPadInterfaceKey]);\n\n // There currently exists no mechanism to safely undo this feature besides `expo prebuild --clear`,\n // this seems ok though because anyone using `UISupportedInterfaceOrientations~ipad` probably\n // wants them to be defined to this value anyways. This is also the default value used in the Xcode iOS template.\n\n // Merge any previous interfaces with the required interfaces.\n infoPlist[iPadInterfaceKey] = [...new Set(existing.concat(requiredIPadInterface))];\n }\n\n return {\n ...infoPlist,\n UIRequiresFullScreen: requiresFullScreen,\n };\n}\n"],"mappings":";;;;;;;;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,sBAAsB,GAAG,IAAAC,mCAAA,EACpCC,qBADoC,EAEpC,wBAFoC,CAA/B,C,CAKP;AACA;;;;AACO,SAASC,qBAAT,CAA+BC,MAA/B,EAA+E;EAAA;;EACpF;EACA;EACA,mBAAIA,MAAM,CAACC,GAAX,wCAAI,YAAYC,cAAZ,CAA2B,mBAA3B,CAAJ,EAAqD;IACnD,OAAO,CAAC,CAACF,MAAM,CAACC,GAAP,CAAWE,iBAApB;EACD,CAFD,MAEO;IACL;IACA,IACE,IAAAC,yBAAA,EAAcJ,MAAd,EAAsB,QAAtB,CADF,CAEE;IACA;IAHF,EAIE;MACA,OAAO,KAAP;IACD;;IACD,OAAO,IAAP;EACD;AACF;;AAED,MAAMK,gBAAgB,GAAG,uCAAzB;AAEA,MAAMC,qBAAqB,GAAG,CAC5B,gCAD4B,EAE5B,0CAF4B,EAG5B,qCAH4B,EAI5B,sCAJ4B,CAA9B;;AAOA,SAASC,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23
23
 
24
- const withScheme = (0, _iosPlugins().createInfoPlistPlugin)(setScheme, 'withScheme');
24
+ const withScheme = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setScheme, {
25
+ infoPlistProperty: 'CFBundleURLTypes',
26
+ expoConfigProperty: 'scheme'
27
+ }, 'withScheme');
25
28
  exports.withScheme = withScheme;
26
29
 
27
30
  function getScheme(config) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ios/Scheme.ts"],"names":["withScheme","setScheme","getScheme","config","Array","isArray","scheme","validate","value","filter","infoPlist","ios","bundleIdentifier","push","length","CFBundleURLTypes","CFBundleURLSchemes","appendScheme","existingSchemes","some","includes","removeScheme","map","bundleUrlType","index","indexOf","splice","undefined","Boolean","hasScheme","schemes","getSchemesFromPlist","reduce"],"mappings":";;;;;;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,UAAU,GAAG,yCAAsBC,SAAtB,EAAiC,YAAjC,CAAnB;;;AAEA,SAASC,SAAT,CAAmBC,MAAnB,EAAqE;AAC1E,MAAIC,KAAK,CAACC,OAAN,CAAcF,MAAM,CAACG,MAArB,CAAJ,EAAkC;AAChC,UAAMC,QAAQ,GAAIC,KAAD,IAAiC;AAChD,aAAO,OAAOA,KAAP,KAAiB,QAAxB;AACD,KAFD;;AAGA,WAAOL,MAAM,CAACG,MAAP,CAAcG,MAAd,CAA6BF,QAA7B,CAAP;AACD,GALD,MAKO,IAAI,OAAOJ,MAAM,CAACG,MAAd,KAAyB,QAA7B,EAAuC;AAC5C,WAAO,CAACH,MAAM,CAACG,MAAR,CAAP;AACD;;AACD,SAAO,EAAP;AACD;;AAEM,SAASL,SAAT,CACLE,MADK,EAELO,SAFK,EAGM;AAAA;;AACX,QAAMJ,MAAM,GAAG,CACb,GAAGJ,SAAS,CAACC,MAAD,CADC,EAEb;AACA,KAAGD,SAAS,gBAACC,MAAM,CAACQ,GAAR,qDAAe,EAAf,CAHC,CAAf,CAD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d;;AACA,QAAIkB,KAAK,GAAG,CAAC,CAAb,EAAgB;AACdD,MAAAA,aAAa,CAACP,kBAAd,CAAiCU,MAAjC,CAAwCF,KAAxC,EAA+C,CAA/C;;AACA,UAAID,aAAa,CAACP,kBAAd,CAAiCF,MAAjC,KAA4C,CAAhD,EAAmD;AACjD,eAAOa,SAAP;AACD;AACF;;AACD,WAAOJ,aAAP;AACD,GAT4B,EAS1Bd,MAT0B,CASnBmB,OATmB,CAA7B;AAWA,SAAOlB,SAAP;AACD;;AAEM,SAASmB,SAAT,CAAmBvB,MAAnB,EAAmCI,SAAnC,EAAkE;AACvE,QAAMQ,eAAe,GAAGR,SAAS,CAACK,gBAAlC;AAEA,MAAI,CAACX,KAAK,CAACC,OAAN,CAAca,eAAd,CAAL,EAAqC,OAAO,KAAP;AAErC,SAAOA,eAAe,CAACC,IAAhB,CAAqB,CAAC;AAAEH,IAAAA,kBAAkB,EAAEc;AAAtB,GAAD,KAC1B1B,KAAK,CAACC,OAAN,CAAcyB,OAAd,IAAyBA,OAAO,CAACV,QAAR,CAAiBd,MAAjB,CAAzB,GAAoD,KAD/C,CAAP;AAGD;;AAEM,SAASyB,mBAAT,CAA6BrB,SAA7B,EAA6D;AAClE,MAAIN,KAAK,CAACC,OAAN,CAAcK,SAAS,CAACK,gBAAxB,CAAJ,EAA+C;AAC7C,WAAOL,SAAS,CAACK,gBAAV,CAA2BiB,MAA3B,CAA4C,CAACF,OAAD,EAAU;AAAEd,MAAAA;AAAF,KAAV,KAAqC;AACtF,UAAIZ,KAAK,CAACC,OAAN,CAAcW,kBAAd,CAAJ,EAAuC;AACrC,eAAO,CAAC,GAAGc,OAAJ,EAAa,GAAGd,kBAAhB,CAAP;AACD;;AACD,aAAOc,OAAP;AACD,KALM,EAKJ,EALI,CAAP;AAMD;;AACD,SAAO,EAAP;AACD","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPlugin } from '../plugins/ios-plugins';\nimport { InfoPlist, URLScheme } from './IosConfig.types';\n\nexport const withScheme = createInfoPlistPlugin(setScheme, 'withScheme');\n\nexport function getScheme(config: { scheme?: string | string[] }): string[] {\n if (Array.isArray(config.scheme)) {\n const validate = (value: any): value is string => {\n return typeof value === 'string';\n };\n return config.scheme.filter<string>(validate);\n } else if (typeof config.scheme === 'string') {\n return [config.scheme];\n }\n return [];\n}\n\nexport function setScheme(\n config: Partial<Pick<ExpoConfig, 'scheme' | 'ios'>>,\n infoPlist: InfoPlist\n): InfoPlist {\n const scheme = [\n ...getScheme(config),\n // @ts-ignore: TODO: ios.scheme is an unreleased -- harder to add to turtle v1.\n ...getScheme(config.ios ?? {}),\n ];\n // Add the bundle identifier to the list of schemes for easier Google auth and parity with Turtle v1.\n if (config.ios?.bundleIdentifier) {\n scheme.push(config.ios.bundleIdentifier);\n }\n if (scheme.length === 0) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleURLTypes: [{ CFBundleURLSchemes: scheme }],\n };\n}\n\nexport function appendScheme(scheme: string | null, infoPlist: InfoPlist): InfoPlist {\n if (!scheme) {\n return infoPlist;\n }\n\n const existingSchemes = infoPlist.CFBundleURLTypes ?? [];\n if (existingSchemes.some(({ CFBundleURLSchemes }) => CFBundleURLSchemes.includes(scheme))) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleURLTypes: [\n ...existingSchemes,\n {\n CFBundleURLSchemes: [scheme],\n },\n ],\n };\n}\n\nexport function removeScheme(scheme: string | null, infoPlist: InfoPlist): InfoPlist {\n if (!scheme) {\n return infoPlist;\n }\n\n // No need to remove if we don't have any\n if (!infoPlist.CFBundleURLTypes) {\n return infoPlist;\n }\n\n infoPlist.CFBundleURLTypes = infoPlist.CFBundleURLTypes.map(bundleUrlType => {\n const index = bundleUrlType.CFBundleURLSchemes.indexOf(scheme);\n if (index > -1) {\n bundleUrlType.CFBundleURLSchemes.splice(index, 1);\n if (bundleUrlType.CFBundleURLSchemes.length === 0) {\n return undefined;\n }\n }\n return bundleUrlType;\n }).filter(Boolean) as URLScheme[];\n\n return infoPlist;\n}\n\nexport function hasScheme(scheme: string, infoPlist: InfoPlist): boolean {\n const existingSchemes = infoPlist.CFBundleURLTypes;\n\n if (!Array.isArray(existingSchemes)) return false;\n\n return existingSchemes.some(({ CFBundleURLSchemes: schemes }: any) =>\n Array.isArray(schemes) ? schemes.includes(scheme) : false\n );\n}\n\nexport function getSchemesFromPlist(infoPlist: InfoPlist): string[] {\n if (Array.isArray(infoPlist.CFBundleURLTypes)) {\n return infoPlist.CFBundleURLTypes.reduce<string[]>((schemes, { CFBundleURLSchemes }) => {\n if (Array.isArray(CFBundleURLSchemes)) {\n return [...schemes, ...CFBundleURLSchemes];\n }\n return schemes;\n }, []);\n }\n return [];\n}\n"],"file":"Scheme.js"}
1
+ {"version":3,"file":"Scheme.js","names":["withScheme","createInfoPlistPluginWithPropertyGuard","setScheme","infoPlistProperty","expoConfigProperty","getScheme","config","Array","isArray","scheme","validate","value","filter","infoPlist","ios","bundleIdentifier","push","length","CFBundleURLTypes","CFBundleURLSchemes","appendScheme","existingSchemes","some","includes","removeScheme","map","bundleUrlType","index","indexOf","splice","undefined","Boolean","hasScheme","schemes","getSchemesFromPlist","reduce"],"sources":["../../src/ios/Scheme.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPluginWithPropertyGuard } from '../plugins/ios-plugins';\nimport { InfoPlist, URLScheme } from './IosConfig.types';\n\nexport const withScheme = createInfoPlistPluginWithPropertyGuard(\n setScheme,\n {\n infoPlistProperty: 'CFBundleURLTypes',\n expoConfigProperty: 'scheme',\n },\n 'withScheme'\n);\n\nexport function getScheme(config: { scheme?: string | string[] }): string[] {\n if (Array.isArray(config.scheme)) {\n const validate = (value: any): value is string => {\n return typeof value === 'string';\n };\n return config.scheme.filter<string>(validate);\n } else if (typeof config.scheme === 'string') {\n return [config.scheme];\n }\n return [];\n}\n\nexport function setScheme(\n config: Partial<Pick<ExpoConfig, 'scheme' | 'ios'>>,\n infoPlist: InfoPlist\n): InfoPlist {\n const scheme = [\n ...getScheme(config),\n // @ts-ignore: TODO: ios.scheme is an unreleased -- harder to add to turtle v1.\n ...getScheme(config.ios ?? {}),\n ];\n // Add the bundle identifier to the list of schemes for easier Google auth and parity with Turtle v1.\n if (config.ios?.bundleIdentifier) {\n scheme.push(config.ios.bundleIdentifier);\n }\n if (scheme.length === 0) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleURLTypes: [{ CFBundleURLSchemes: scheme }],\n };\n}\n\nexport function appendScheme(scheme: string | null, infoPlist: InfoPlist): InfoPlist {\n if (!scheme) {\n return infoPlist;\n }\n\n const existingSchemes = infoPlist.CFBundleURLTypes ?? [];\n if (existingSchemes.some(({ CFBundleURLSchemes }) => CFBundleURLSchemes.includes(scheme))) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleURLTypes: [\n ...existingSchemes,\n {\n CFBundleURLSchemes: [scheme],\n },\n ],\n };\n}\n\nexport function removeScheme(scheme: string | null, infoPlist: InfoPlist): InfoPlist {\n if (!scheme) {\n return infoPlist;\n }\n\n // No need to remove if we don't have any\n if (!infoPlist.CFBundleURLTypes) {\n return infoPlist;\n }\n\n infoPlist.CFBundleURLTypes = infoPlist.CFBundleURLTypes.map((bundleUrlType) => {\n const index = bundleUrlType.CFBundleURLSchemes.indexOf(scheme);\n if (index > -1) {\n bundleUrlType.CFBundleURLSchemes.splice(index, 1);\n if (bundleUrlType.CFBundleURLSchemes.length === 0) {\n return undefined;\n }\n }\n return bundleUrlType;\n }).filter(Boolean) as URLScheme[];\n\n return infoPlist;\n}\n\nexport function hasScheme(scheme: string, infoPlist: InfoPlist): boolean {\n const existingSchemes = infoPlist.CFBundleURLTypes;\n\n if (!Array.isArray(existingSchemes)) return false;\n\n return existingSchemes.some(({ CFBundleURLSchemes: schemes }: any) =>\n Array.isArray(schemes) ? schemes.includes(scheme) : false\n );\n}\n\nexport function getSchemesFromPlist(infoPlist: InfoPlist): string[] {\n if (Array.isArray(infoPlist.CFBundleURLTypes)) {\n return infoPlist.CFBundleURLTypes.reduce<string[]>((schemes, { CFBundleURLSchemes }) => {\n if (Array.isArray(CFBundleURLSchemes)) {\n return [...schemes, ...CFBundleURLSchemes];\n }\n return schemes;\n }, []);\n }\n return [];\n}\n"],"mappings":";;;;;;;;;;;;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,UAAU,GAAG,IAAAC,oDAAA,EACxBC,SADwB,EAExB;EACEC,iBAAiB,EAAE,kBADrB;EAEEC,kBAAkB,EAAE;AAFtB,CAFwB,EAMxB,YANwB,CAAnB;;;AASA,SAASC,SAAT,CAAmBC,MAAnB,EAAqE;EAC1E,IAAIC,KAAK,CAACC,OAAN,CAAcF,MAAM,CAACG,MAArB,CAAJ,EAAkC;IAChC,MAAMC,QAAQ,GAAIC,KAAD,IAAiC;MAChD,OAAO,OAAOA,KAAP,KAAiB,QAAxB;IACD,CAFD;;IAGA,OAAOL,MAAM,CAACG,MAAP,CAAcG,MAAd,CAA6BF,QAA7B,CAAP;EACD,CALD,MAKO,IAAI,OAAOJ,MAAM,CAACG,MAAd,KAAyB,QAA7B,EAAuC;IAC5C,OAAO,CAACH,MAAM,CAACG,MAAR,CAAP;EACD;;EACD,OAAO,EAAP;AACD;;AAEM,SAASP,SAAT,CACLI,MADK,EAELO,SAFK,EAGM;EAAA;;EACX,MAAMJ,MAAM,GAAG,CACb,GAAGJ,SAAS,CAACC,MAAD,CADC,EAEb;EACA,GAAGD,SAAS,gBAACC,MAAM,CAACQ,GAAR,qDAAe,EAAf,CAHC,CAAf,CADW,CAMX;;EACA,oBAAIR,MAAM,CAACQ,GAAX,yCAAI,aAAYC,gBAAhB,EAAkC;IAChCN,MAAM,CAACO,IAAP,CAAYV,MAAM,CAACQ,GAAP,CAAWC,gBAAvB;EACD;;EACD,IAAIN,MAAM,CAACQ,MAAP,KAAkB,CAAtB,EAAyB;IACvB,OAAOJ,SAA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CASnBmB,OATmB,CAA7B;EAWA,OAAOlB,SAAP;AACD;;AAEM,SAASmB,SAAT,CAAmBvB,MAAnB,EAAmCI,SAAnC,EAAkE;EACvE,MAAMQ,eAAe,GAAGR,SAAS,CAACK,gBAAlC;EAEA,IAAI,CAACX,KAAK,CAACC,OAAN,CAAca,eAAd,CAAL,EAAqC,OAAO,KAAP;EAErC,OAAOA,eAAe,CAACC,IAAhB,CAAqB,CAAC;IAAEH,kBAAkB,EAAEc;EAAtB,CAAD,KAC1B1B,KAAK,CAACC,OAAN,CAAcyB,OAAd,IAAyBA,OAAO,CAACV,QAAR,CAAiBd,MAAjB,CAAzB,GAAoD,KAD/C,CAAP;AAGD;;AAEM,SAASyB,mBAAT,CAA6BrB,SAA7B,EAA6D;EAClE,IAAIN,KAAK,CAACC,OAAN,CAAcK,SAAS,CAACK,gBAAxB,CAAJ,EAA+C;IAC7C,OAAOL,SAAS,CAACK,gBAAV,CAA2BiB,MAA3B,CAA4C,CAACF,OAAD,EAAU;MAAEd;IAAF,CAAV,KAAqC;MACtF,IAAIZ,KAAK,CAACC,OAAN,CAAcW,kBAAd,CAAJ,EAAuC;QACrC,OAAO,CAAC,GAAGc,OAAJ,EAAa,GAAGd,kBAAhB,CAAP;MACD;;MACD,OAAOc,OAAP;IACD,CALM,EAKJ,EALI,CAAP;EAMD;;EACD,OAAO,EAAP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ios/Swift.ts"],"names":["templateBridgingHeader","withSwiftBridgingHeader","config","modResults","ensureSwiftBridgingHeaderSetup","project","projectRoot","modRequest","shouldCreateSwiftBridgingHeader","projectName","bridgingHeader","createBridgingHeaderFileName","createBridgingHeaderFile","linkBridgingHeaderFile","path","join","isObjc","language","getDesignatedSwiftBridgingHeaderFileReference","configurations","pbxXCBuildConfigurationSection","buildSettings","Object","values","PRODUCT_NAME","SWIFT_OBJC_BRIDGING_HEADER","bridgingHeaderProjectPath","fs","existsSync","writeFileSync","filePath","hasFile","filepath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5B,CAAP;AAUD,CAXM","sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport { ConfigPlugin, XcodeProject } from '../Plugin.types';\nimport { withXcodeProject } from '../plugins/ios-plugins';\nimport { getAppDelegate, getSourceRoot } from './Paths';\nimport { withBuildSourceFile } from './XcodeProjectFile';\nimport { addResourceFileToGroup, getProjectName } from './utils/Xcodeproj';\n\nconst templateBridgingHeader = `//\n// Use this file to import your target's public headers that you would like to expose to Swift.\n//\n`;\n\n/**\n * Ensure a Swift bridging header is created for the project.\n * This helps fix problems related to using modules that are written in Swift (lottie, FBSDK).\n *\n * 1. Ensures the file exists given the project path.\n * 2. Writes the file and links to Xcode as a resource file.\n * 3. Sets the build configuration `SWIFT_OBJC_BRIDGING_HEADER = [PROJECT_NAME]-Bridging-Header.h`\n */\nexport const withSwiftBridgingHeader: ConfigPlugin = config => {\n return withXcodeProject(config, config => {\n config.modResults = ensureSwiftBridgingHeaderSetup({\n project: config.modResults,\n projectRoot: config.modRequest.projectRoot,\n });\n return config;\n });\n};\n\nexport function ensureSwiftBridgingHeaderSetup({\n projectRoot,\n project,\n}: {\n projectRoot: string;\n project: XcodeProject;\n}) {\n // Only create a bridging header if using objective-c\n if (shouldCreateSwiftBridgingHeader({ projectRoot, project })) {\n const projectName = getProjectName(projectRoot);\n const bridgingHeader = createBridgingHeaderFileName(projectName);\n // Ensure a bridging header is created in the Xcode project.\n project = createBridgingHeaderFile({\n project,\n projectName,\n projectRoot,\n bridgingHeader,\n });\n // Designate the newly created file as the Swift bridging header in the Xcode project.\n project = linkBridgingHeaderFile({\n project,\n bridgingHeader: path.join(projectName, bridgingHeader),\n });\n }\n return project;\n}\n\nfunction shouldCreateSwiftBridgingHeader({\n projectRoot,\n project,\n}: {\n projectRoot: string;\n project: XcodeProject;\n}): boolean {\n // Only create a bridging header if the project is using in Objective C (AppDelegate is written in Objc).\n const isObjc = getAppDelegate(projectRoot).language === 'objc';\n return isObjc && !getDesignatedSwiftBridgingHeaderFileReference({ project });\n}\n\n/**\n * @returns String matching the default name used when Xcode automatically creates a bridging header file.\n */\nfunction createBridgingHeaderFileName(projectName: string): string {\n return `${projectName}-Bridging-Header.h`;\n}\n\nexport function getDesignatedSwiftBridgingHeaderFileReference({\n project,\n}: {\n project: XcodeProject;\n}): string | null {\n const configurations = project.pbxXCBuildConfigurationSection();\n // @ts-ignore\n for (const { buildSettings } of Object.values(configurations || {})) {\n // Guessing that this is the best way to emulate Xcode.\n // Using `project.addToBuildSettings` modifies too many targets.\n if (typeof buildSettings?.PRODUCT_NAME !== 'undefined') {\n if (\n typeof buildSettings.SWIFT_OBJC_BRIDGING_HEADER === 'string' &&\n buildSettings.SWIFT_OBJC_BRIDGING_HEADER\n ) {\n return buildSettings.SWIFT_OBJC_BRIDGING_HEADER;\n }\n }\n }\n return null;\n}\n\n/**\n *\n * @param bridgingHeader The bridging header filename ex: `ExpoAPIs-Bridging-Header.h`\n * @returns\n */\nexport function linkBridgingHeaderFile({\n project,\n bridgingHeader,\n}: {\n project: XcodeProject;\n bridgingHeader: string;\n}): XcodeProject {\n const configurations = project.pbxXCBuildConfigurationSection();\n // @ts-ignore\n for (const { buildSettings } of Object.values(configurations || {})) {\n // Guessing that this is the best way to emulate Xcode.\n // Using `project.addToBuildSettings` modifies too many targets.\n if (typeof buildSettings?.PRODUCT_NAME !== 'undefined') {\n buildSettings.SWIFT_OBJC_BRIDGING_HEADER = bridgingHeader;\n }\n }\n\n return project;\n}\n\nexport function createBridgingHeaderFile({\n projectRoot,\n projectName,\n project,\n bridgingHeader,\n}: {\n project: XcodeProject;\n projectName: string;\n projectRoot: string;\n bridgingHeader: string;\n}): XcodeProject {\n const bridgingHeaderProjectPath = path.join(getSourceRoot(projectRoot), bridgingHeader);\n if (!fs.existsSync(bridgingHeaderProjectPath)) {\n // Create the file\n fs.writeFileSync(bridgingHeaderProjectPath, templateBridgingHeader, 'utf8');\n }\n\n // This is non-standard, Xcode generates the bridging header in `/ios` which is kinda annoying.\n // Instead, this'll generate the default header in the application code folder `/ios/myproject/`.\n const filePath = `${projectName}/${bridgingHeader}`;\n // Ensure the file is linked with Xcode resource files\n if (!project.hasFile(filePath)) {\n project = addResourceFileToGroup({\n filepath: filePath,\n groupName: projectName,\n project,\n // Not sure why, but this is how Xcode generates it.\n isBuildFile: false,\n verbose: false,\n });\n }\n return project;\n}\n\nexport const withNoopSwiftFile: ConfigPlugin = config => {\n return withBuildSourceFile(config, {\n filePath: 'noop-file.swift',\n contents: [\n '//',\n '// @generated',\n '// A blank Swift file must be created for native modules with Swift files to work correctly.',\n '//',\n '',\n ].join('\\n'),\n });\n};\n"],"file":"Swift.js"}
1
+ {"version":3,"file":"Swift.js","names":["templateBridgingHeader","withSwiftBridgingHeader","config","withXcodeProject","modResults","ensureSwiftBridgingHeaderSetup","project","projectRoot","modRequest","shouldCreateSwiftBridgingHeader","projectName","getProjectName","bridgingHeader","createBridgingHeaderFileName","createBridgingHeaderFile","linkBridgingHeaderFile","path","join","isObjc","getAppDelegate","language","getDesignatedSwiftBridgingHeaderFileReference","configurations","pbxXCBuildConfigurationSection","buildSettings","Object","values","PRODUCT_NAME","SWIFT_OBJC_BRIDGING_HEADER","bridgingHeaderProjectPath","getSourceRoot","fs","existsSync","writeFileSync","filePath","hasFile","addResourceFileToGroup","filepath","groupName","isBuildFile","verbose","withNoopSwiftFile","withBuildSourceFile","contents"],"sources":["../../src/ios/Swift.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport { ConfigPlugin, XcodeProject } from '../Plugin.types';\nimport { withXcodeProject } from '../plugins/ios-plugins';\nimport { getAppDelegate, getSourceRoot } from './Paths';\nimport { withBuildSourceFile } from './XcodeProjectFile';\nimport { addResourceFileToGroup, getProjectName } from './utils/Xcodeproj';\n\nconst templateBridgingHeader = `//\n// Use this file to import your target's public headers that you would like to expose to Swift.\n//\n`;\n\n/**\n * Ensure a Swift bridging header is created for the project.\n * This helps fix problems related to using modules that are written in Swift (lottie, FBSDK).\n *\n * 1. Ensures the file exists given the project path.\n * 2. Writes the file and links to Xcode as a resource file.\n * 3. Sets the build configuration `SWIFT_OBJC_BRIDGING_HEADER = [PROJECT_NAME]-Bridging-Header.h`\n */\nexport const withSwiftBridgingHeader: ConfigPlugin = (config) => {\n return withXcodeProject(config, (config) => {\n config.modResults = ensureSwiftBridgingHeaderSetup({\n project: config.modResults,\n projectRoot: config.modRequest.projectRoot,\n });\n return config;\n });\n};\n\nexport function ensureSwiftBridgingHeaderSetup({\n projectRoot,\n project,\n}: {\n projectRoot: string;\n project: XcodeProject;\n}) {\n // Only create a bridging header if using objective-c\n if (shouldCreateSwiftBridgingHeader({ projectRoot, project })) {\n const projectName = getProjectName(projectRoot);\n const bridgingHeader = createBridgingHeaderFileName(projectName);\n // Ensure a bridging header is created in the Xcode project.\n project = createBridgingHeaderFile({\n project,\n projectName,\n projectRoot,\n bridgingHeader,\n });\n // Designate the newly created file as the Swift bridging header in the Xcode project.\n project = linkBridgingHeaderFile({\n project,\n bridgingHeader: path.join(projectName, bridgingHeader),\n });\n }\n return project;\n}\n\nfunction shouldCreateSwiftBridgingHeader({\n projectRoot,\n project,\n}: {\n projectRoot: string;\n project: XcodeProject;\n}): boolean {\n // Only create a bridging header if the project is using in Objective C (AppDelegate is written in Objc).\n const isObjc = getAppDelegate(projectRoot).language === 'objc';\n return isObjc && !getDesignatedSwiftBridgingHeaderFileReference({ project });\n}\n\n/**\n * @returns String matching the default name used when Xcode automatically creates a bridging header file.\n */\nfunction createBridgingHeaderFileName(projectName: string): string {\n return `${projectName}-Bridging-Header.h`;\n}\n\nexport function getDesignatedSwiftBridgingHeaderFileReference({\n project,\n}: {\n project: XcodeProject;\n}): string | null {\n const configurations = project.pbxXCBuildConfigurationSection();\n // @ts-ignore\n for (const { buildSettings } of Object.values(configurations || {})) {\n // Guessing that this is the best way to emulate Xcode.\n // Using `project.addToBuildSettings` modifies too many targets.\n if (typeof buildSettings?.PRODUCT_NAME !== 'undefined') {\n if (\n typeof buildSettings.SWIFT_OBJC_BRIDGING_HEADER === 'string' &&\n buildSettings.SWIFT_OBJC_BRIDGING_HEADER\n ) {\n return buildSettings.SWIFT_OBJC_BRIDGING_HEADER;\n }\n }\n }\n return null;\n}\n\n/**\n *\n * @param bridgingHeader The bridging header filename ex: `ExpoAPIs-Bridging-Header.h`\n * @returns\n */\nexport function linkBridgingHeaderFile({\n project,\n bridgingHeader,\n}: {\n project: XcodeProject;\n bridgingHeader: string;\n}): XcodeProject {\n const configurations = project.pbxXCBuildConfigurationSection();\n // @ts-ignore\n for (const { buildSettings } of Object.values(configurations || {})) {\n // Guessing that this is the best way to emulate Xcode.\n // Using `project.addToBuildSettings` modifies too many targets.\n if (typeof buildSettings?.PRODUCT_NAME !== 'undefined') {\n buildSettings.SWIFT_OBJC_BRIDGING_HEADER = bridgingHeader;\n }\n }\n\n return project;\n}\n\nexport function createBridgingHeaderFile({\n projectRoot,\n projectName,\n project,\n bridgingHeader,\n}: {\n project: XcodeProject;\n projectName: string;\n projectRoot: string;\n bridgingHeader: string;\n}): XcodeProject {\n const bridgingHeaderProjectPath = path.join(getSourceRoot(projectRoot), bridgingHeader);\n if (!fs.existsSync(bridgingHeaderProjectPath)) {\n // Create the file\n fs.writeFileSync(bridgingHeaderProjectPath, templateBridgingHeader, 'utf8');\n }\n\n // This is non-standard, Xcode generates the bridging header in `/ios` which is kinda annoying.\n // Instead, this'll generate the default header in the application code folder `/ios/myproject/`.\n const filePath = `${projectName}/${bridgingHeader}`;\n // Ensure the file is linked with Xcode resource files\n if (!project.hasFile(filePath)) {\n project = addResourceFileToGroup({\n filepath: filePath,\n groupName: projectName,\n project,\n // Not sure why, but this is how Xcode generates it.\n isBuildFile: false,\n verbose: false,\n });\n }\n return project;\n}\n\nexport const withNoopSwiftFile: ConfigPlugin = (config) => {\n return withBuildSourceFile(config, {\n filePath: 'noop-file.swift',\n contents: [\n '//',\n '// @generated',\n '// A blank Swift file must be created for native modules with Swift files to work correctly.',\n '//',\n '',\n ].join('\\n'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AAa,CAACI,0BAAd,GAA2ChB,cAA3C;IACD;EACF;;EAED,OAAON,OAAP;AACD;;AAEM,SAASQ,wBAAT,CAAkC;EACvCP,WADuC;EAEvCG,WAFuC;EAGvCJ,OAHuC;EAIvCM;AAJuC,CAAlC,EAUU;EACf,MAAMiB,yBAAyB,GAAGb,eAAA,CAAKC,IAAL,CAAU,IAAAa,sBAAA,EAAcvB,WAAd,CAAV,EAAsCK,cAAtC,CAAlC;;EACA,IAAI,CAACmB,aAAA,CAAGC,UAAH,CAAcH,yBAAd,CAAL,EAA+C;IAC7C;IACAE,aAAA,CAAGE,aAAH,CAAiBJ,yBAAjB,EAA4C7B,sBAA5C,EAAoE,MAApE;EACD,CALc,CAOf;EACA;;;EACA,MAAMkC,QAAQ,GAAI,GAAExB,WAAY,IAAGE,cAAe,EAAlD,CATe,CAUf;;EACA,IAAI,CAACN,OAAO,CAAC6B,OAAR,CAAgBD,QAAhB,CAAL,EAAgC;IAC9B5B,OAAO,GAAG,IAAA8B,mCAAA,EAAuB;MAC/BC,QAAQ,EAAEH,QADqB;MAE/BI,SAAS,EAAE5B,WAFoB;MAG/BJ,OAH+B;MAI/B;MACAiC,WAAW,EAAE,KALkB;MAM/BC,OAAO,EAAE;IANsB,CAAvB,CAAV;EAQD;;EACD,OAAOlC,OAAP;AACD;;AAEM,MAAMmC,iBAA+B,GAAIvC,MAAD,IAAY;EACzD,OAAO,IAAAwC,uCAAA,EAAoBxC,MAApB,EAA4B;IACjCgC,QAAQ,EAAE,iBADuB;IAEjCS,QAAQ,EAAE,CACR,IADQ,EAER,eAFQ,EAGR,8FAHQ,EAIR,IAJQ,EAKR,EALQ,EAMR1B,IANQ,CAMH,IANG;EAFuB,CAA5B,CAAP;AAUD,CAXM"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ios/Target.ts"],"names":["TargetType","getXCBuildConfigurationFromPbxproj","project","targetName","buildConfiguration","nativeTarget","findNativeTargetByName","findFirstNativeTarget","xcBuildConfiguration","configurationListId","buildConfigurationList","findApplicationTargetWithDependenciesAsync","projectRoot","scheme","applicationTargetName","applicationTarget","dependencies","getTargetDependencies","name","type","APPLICATION","parentTarget","length","undefined","map","value","target","targetId","getPBXGroupByKeyAndType","findNativeTargetById","isTargetOfType","EXTENSION","OTHER","targetType","productType","getNativeTargets","section","pbxNativeTargetSection","Object","entries","filter","isNotComment","findSignableTargets","targets","signableTargetTypes","APP_CLIP","WATCH","STICKER_PACK_EXTENSION","applicationTargets","Error","nativeTargets","nativeTargetEntry","find","i","key"],"mappings":";;;;;;;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAMA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;IAEYA,U;;;WAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;GAAAA,U,0BAAAA,U;;AAeL,SAASC,kCAAT,CACLC,OADK,EAEL;AACEC,EAAAA,UADF;AAEEC,EAAAA,kBAAkB,GAAG;AAFvB,IAG0D,EALrD,EAMwB;AAC7B,QAAM,GAAGC,YAAH,IAAmBF,UAAU,GAC/BG,sBAAsB,CAACJ,OAAD,EAAUC,UAAV,CADS,GAE/BI,qBAAqB,CAACL,OAAD,CAFzB;AAGA,QAAM,GAAGM,oBAAH,IAA2B,wDAAsCN,OAAtC,EAA+C;AAC9EO,IAAAA,mBAAmB,EAAEJ,YAAY,CAACK,sBAD4C;AAE9EN,IAAAA;AAF8E,GAA/C,CAAjC;AAIA,SAAOI,oBAAP,aAAOA,oBAAP,cAAOA,oBAAP,GAA+B,IAA/B;AACD;;AAEM,eAAeG,0CAAf,CACLC,WADK,EAELC,MAFK,EAGY;AACjB,QAAMC,qBAAqB,GAAG,MAAM,2DAAuCF,WAAvC,EAAoDC,MAApD,CAApC;AACA,QAAMX,OAAO,GAAG,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,kBAAkB,CAAC,CAAD,CAAzB;AACD;;AAEM,SAAS1C,sBAAT,CACLJ,OADK,EAELC,UAFK,EAGqB;AAC1B,QAAM+C,aAAa,GAAGf,gBAAgB,CAACjC,OAAD,CAAtC;AACA,QAAMiD,iBAAiB,GAAGD,aAAa,CAACE,IAAd,CAAmB,CAAC,GAAGC,CAAH,CAAD,KAAW,0BAAWA,CAAC,CAACnC,IAAb,MAAuBf,UAArD,CAA1B;;AACA,MAAI,CAACgD,iBAAL,EAAwB;AACtB,UAAM,IAAIF,KAAJ,CAAW,0BAAyB9C,UAAW,sBAA/C,CAAN;AACD;;AACD,SAAOgD,iBAAP;AACD;;AAED,SAAStB,oBAAT,CAA8B3B,OAA9B,EAAqDyB,QAArD,EAAiG;AAC/F,QAAMuB,aAAa,GAAGf,gBAAgB,CAACjC,OAAD,CAAtC;AACA,QAAMiD,iBAAiB,GAAGD,aAAa,CAACE,IAAd,CAAmB,CAAC,CAACE,GAAD,CAAD,KAAWA,GAAG,KAAK3B,QAAtC,CAA1B;;AACA,MAAI,CAACwB,iBAAL,EAAwB;AACtB,UAAM,IAAIF,KAAJ,CAAW,kCAAiCtB,QAAS,sBAArD,CAAN;AACD;;AACD,SAAOwB,iBAAP;AACD","sourcesContent":["import { PBXNativeTarget, PBXTargetDependency, XCBuildConfiguration, XcodeProject } from 'xcode';\n\nimport { getApplicationTargetNameForSchemeAsync } from './BuildScheme';\nimport {\n getBuildConfigurationForListIdAndName,\n getPbxproj,\n isNotComment,\n NativeTargetSectionEntry,\n} from './utils/Xcodeproj';\nimport { trimQuotes } from './utils/string';\n\nexport enum TargetType {\n APPLICATION = 'com.apple.product-type.application',\n EXTENSION = 'com.apple.product-type.app-extension',\n WATCH = 'com.apple.product-type.application.watchapp',\n APP_CLIP = 'com.apple.product-type.application.on-demand-install-capable',\n STICKER_PACK_EXTENSION = 'com.apple.product-type.app-extension.messages-sticker-pack',\n OTHER = 'other',\n}\n\nexport interface Target {\n name: string;\n type: TargetType;\n dependencies?: Target[];\n}\n\nexport function getXCBuildConfigurationFromPbxproj(\n project: XcodeProject,\n {\n targetName,\n buildConfiguration = 'Release',\n }: { targetName?: string; buildConfiguration?: string } = {}\n): XCBuildConfiguration | null {\n const [, nativeTarget] = targetName\n ? findNativeTargetByName(project, targetName)\n : findFirstNativeTarget(project);\n const [, xcBuildConfiguration] = getBuildConfigurationForListIdAndName(project, {\n configurationListId: nativeTarget.buildConfigurationList,\n buildConfiguration,\n });\n return xcBuildConfiguration ?? null;\n}\n\nexport async function findApplicationTargetWithDependenciesAsync(\n projectRoot: string,\n scheme: string\n): Promise<Target> {\n const applicationTargetName = await getApplicationTargetNameForSchemeAsync(projectRoot, scheme);\n const project = getPbxproj(projectRoot);\n const [, applicationTarget] = findNativeTargetByName(project, applicationTargetName);\n const dependencies = getTargetDependencies(project, applicationTarget);\n return {\n name: trimQuotes(applicationTarget.name),\n type: TargetType.APPLICATION,\n dependencies,\n };\n}\n\nfunction getTargetDependencies(\n project: XcodeProject,\n parentTarget: PBXNativeTarget\n): Target[] | undefined {\n if (!parentTarget.dependencies || parentTarget.dependencies.length === 0) {\n return undefined;\n }\n return parentTarget.dependencies.map(({ value }) => {\n const { target: targetId } = project.getPBXGroupByKeyAndType(\n value,\n 'PBXTargetDependency'\n ) as PBXTargetDependency;\n\n const [, target] = findNativeTargetById(project, targetId);\n\n const type = isTargetOfType(target, TargetType.EXTENSION)\n ? TargetType.EXTENSION\n : TargetType.OTHER;\n return {\n name: trimQuotes(target.name),\n type,\n dependencies: getTargetDependencies(project, target),\n };\n });\n}\n\nexport function isTargetOfType(target: PBXNativeTarget, targetType: TargetType): boolean {\n return trimQuotes(target.productType) === targetType;\n}\n\nexport function getNativeTargets(project: XcodeProject): NativeTargetSectionEntry[] {\n const section = project.pbxNativeTargetSection();\n return Object.entries(section).filter(isNotComment);\n}\n\nexport function findSignableTargets(project: XcodeProject): NativeTargetSectionEntry[] {\n const targets = getNativeTargets(project);\n\n const signableTargetTypes = [\n TargetType.APPLICATION,\n TargetType.APP_CLIP,\n TargetType.EXTENSION,\n TargetType.WATCH,\n TargetType.STICKER_PACK_EXTENSION,\n ];\n\n const applicationTargets = targets.filter(([, target]) => {\n for (const targetType of signableTargetTypes) {\n if (isTargetOfType(target, targetType)) {\n return true;\n }\n }\n return false;\n });\n if (applicationTargets.length === 0) {\n throw new Error(`Could not find any signable targets in project.pbxproj`);\n }\n return applicationTargets;\n}\n\nexport function findFirstNativeTarget(project: XcodeProject): NativeTargetSectionEntry {\n const targets = getNativeTargets(project);\n const applicationTargets = targets.filter(([, target]) =>\n isTargetOfType(target, TargetType.APPLICATION)\n );\n if (applicationTargets.length === 0) {\n throw new Error(`Could not find any application target in project.pbxproj`);\n }\n return applicationTargets[0];\n}\n\nexport function findNativeTargetByName(\n project: XcodeProject,\n targetName: string\n): NativeTargetSectionEntry {\n const nativeTargets = getNativeTargets(project);\n const nativeTargetEntry = nativeTargets.find(([, i]) => trimQuotes(i.name) === targetName);\n if (!nativeTargetEntry) {\n throw new Error(`Could not find target '${targetName}' in project.pbxproj`);\n }\n return nativeTargetEntry;\n}\n\nfunction findNativeTargetById(project: XcodeProject, targetId: string): NativeTargetSectionEntry {\n const nativeTargets = getNativeTargets(project);\n const nativeTargetEntry = nativeTargets.find(([key]) => key === targetId);\n if (!nativeTargetEntry) {\n throw new Error(`Could not find target with id '${targetId}' in project.pbxproj`);\n }\n return nativeTargetEntry;\n}\n"],"file":"Target.js"}
1
+ {"version":3,"file":"Target.js","names":["TargetType","getXCBuildConfigurationFromPbxproj","project","targetName","buildConfiguration","nativeTarget","findNativeTargetByName","findFirstNativeTarget","xcBuildConfiguration","getBuildConfigurationForListIdAndName","configurationListId","buildConfigurationList","findApplicationTargetWithDependenciesAsync","projectRoot","scheme","applicationTargetName","getApplicationTargetNameForSchemeAsync","getPbxproj","applicationTarget","dependencies","getTargetDependencies","name","trimQuotes","type","APPLICATION","parentTarget","length","undefined","map","value","target","targetId","getPBXGroupByKeyAndType","findNativeTargetById","isTargetOfType","EXTENSION","OTHER","targetType","productType","getNativeTargets","section","pbxNativeTargetSection","Object","entries","filter","isNotComment","findSignableTargets","targets","signableTargetTypes","APP_CLIP","WATCH","STICKER_PACK_EXTENSION","applicationTargets","Error","nativeTargets","nativeTargetEntry","find","i","key"],"sources":["../../src/ios/Target.ts"],"sourcesContent":["import { PBXNativeTarget, PBXTargetDependency, XCBuildConfiguration, XcodeProject } from 'xcode';\n\nimport { getApplicationTargetNameForSchemeAsync } from './BuildScheme';\nimport {\n getBuildConfigurationForListIdAndName,\n getPbxproj,\n isNotComment,\n NativeTargetSectionEntry,\n} from './utils/Xcodeproj';\nimport { trimQuotes } from './utils/string';\n\nexport enum TargetType {\n APPLICATION = 'com.apple.product-type.application',\n EXTENSION = 'com.apple.product-type.app-extension',\n WATCH = 'com.apple.product-type.application.watchapp',\n APP_CLIP = 'com.apple.product-type.application.on-demand-install-capable',\n STICKER_PACK_EXTENSION = 'com.apple.product-type.app-extension.messages-sticker-pack',\n OTHER = 'other',\n}\n\nexport interface Target {\n name: string;\n type: TargetType;\n dependencies?: Target[];\n}\n\nexport function getXCBuildConfigurationFromPbxproj(\n project: XcodeProject,\n {\n targetName,\n buildConfiguration = 'Release',\n }: { targetName?: string; buildConfiguration?: string } = {}\n): XCBuildConfiguration | null {\n const [, nativeTarget] = targetName\n ? findNativeTargetByName(project, targetName)\n : findFirstNativeTarget(project);\n const [, xcBuildConfiguration] = getBuildConfigurationForListIdAndName(project, {\n configurationListId: nativeTarget.buildConfigurationList,\n buildConfiguration,\n });\n return xcBuildConfiguration ?? null;\n}\n\nexport async function findApplicationTargetWithDependenciesAsync(\n projectRoot: string,\n scheme: string\n): Promise<Target> {\n const applicationTargetName = await getApplicationTargetNameForSchemeAsync(projectRoot, scheme);\n const project = getPbxproj(projectRoot);\n const [, applicationTarget] = findNativeTargetByName(project, applicationTargetName);\n const dependencies = getTargetDependencies(project, applicationTarget);\n return {\n name: trimQuotes(applicationTarget.name),\n type: TargetType.APPLICATION,\n dependencies,\n };\n}\n\nfunction getTargetDependencies(\n project: XcodeProject,\n parentTarget: PBXNativeTarget\n): Target[] | undefined {\n if (!parentTarget.dependencies || parentTarget.dependencies.length === 0) {\n return undefined;\n }\n return parentTarget.dependencies.map(({ value }) => {\n const { target: targetId } = project.getPBXGroupByKeyAndType(\n value,\n 'PBXTargetDependency'\n ) as PBXTargetDependency;\n\n const [, target] = findNativeTargetById(project, targetId);\n\n const type = isTargetOfType(target, TargetType.EXTENSION)\n ? TargetType.EXTENSION\n : TargetType.OTHER;\n return {\n name: trimQuotes(target.name),\n type,\n dependencies: getTargetDependencies(project, target),\n };\n });\n}\n\nexport function isTargetOfType(target: PBXNativeTarget, targetType: TargetType): boolean {\n return trimQuotes(target.productType) === targetType;\n}\n\nexport function getNativeTargets(project: XcodeProject): NativeTargetSectionEntry[] {\n const section = project.pbxNativeTargetSection();\n return Object.entries(section).filter(isNotComment);\n}\n\nexport function findSignableTargets(project: XcodeProject): NativeTargetSectionEntry[] {\n const targets = getNativeTargets(project);\n\n const signableTargetTypes = [\n TargetType.APPLICATION,\n TargetType.APP_CLIP,\n TargetType.EXTENSION,\n TargetType.WATCH,\n TargetType.STICKER_PACK_EXTENSION,\n ];\n\n const applicationTargets = targets.filter(([, target]) => {\n for (const targetType of signableTargetTypes) {\n if (isTargetOfType(target, targetType)) {\n return true;\n }\n }\n return false;\n });\n if (applicationTargets.length === 0) {\n throw new Error(`Could not find any signable targets in project.pbxproj`);\n }\n return applicationTargets;\n}\n\nexport function findFirstNativeTarget(project: XcodeProject): NativeTargetSectionEntry {\n const targets = getNativeTargets(project);\n const applicationTargets = targets.filter(([, target]) =>\n isTargetOfType(target, TargetType.APPLICATION)\n );\n if (applicationTargets.length === 0) {\n throw new Error(`Could not find any application target in project.pbxproj`);\n }\n return applicationTargets[0];\n}\n\nexport function findNativeTargetByName(\n project: XcodeProject,\n targetName: string\n): NativeTargetSectionEntry {\n const nativeTargets = getNativeTargets(project);\n const nativeTargetEntry = nativeTargets.find(([, i]) => trimQuotes(i.name) === targetName);\n if (!nativeTargetEntry) {\n throw new Error(`Could not find target '${targetName}' in project.pbxproj`);\n }\n return nativeTargetEntry;\n}\n\nfunction findNativeTargetById(project: XcodeProject, targetId: string): NativeTargetSectionEntry {\n const nativeTargets = getNativeTargets(project);\n const nativeTargetEntry = nativeTargets.find(([key]) => key === targetId);\n if (!nativeTargetEntry) {\n throw new Error(`Could not find target with id '${targetId}' in project.pbxproj`);\n }\n return nativeTargetEntry;\n}\n"],"mappings":";;;;;;;;;;;;;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAMA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;IAEYA,U;;;WAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;GAAAA,U,0BAAAA,U;;AAeL,SAASC,kCAAT,CACLC,OADK,EAEL;EACEC,UADF;EAEEC,kBAAkB,GAAG;AAFvB,IAG0D,EALrD,EAMwB;EAC7B,MAAM,GAAGC,YAAH,IAAmBF,UAAU,GAC/BG,sBAAsB,CAACJ,OAAD,EAAUC,UAAV,CADS,GAE/BI,qBAAqB,CAACL,OAAD,CAFzB;EAGA,MAAM,GAAGM,oBAAH,IAA2B,IAAAC,kDAAA,EAAsCP,OAAtC,EAA+C;IAC9EQ,mBAAmB,EAAEL,YAAY,CAACM,sBAD4C;IAE9EP;EAF8E,CAA/C,CAAjC;EAIA,OAAOI,oBAAP,aAAOA,oBAAP,cAAOA,oBAAP,GAA+B,IAA/B;AACD;;AAEM,eAAeI,0CAAf,CACLC,WADK,EAELC,MAFK,EAGY;EACjB,MAAMC,qBAAqB,GAAG,MAAM,IAAAC,qDAAA,EAAuCH,WAAvC,EAAoDC,MAApD,CAApC;EACA,MAAMZ,OAAO,GAAG,IAAAe,uBAAA,EAAWJ,WAAX,CAAhB;EACA,MAAM,G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BAAT,CACLJ,OADK,EAELC,UAFK,EAGqB;EAC1B,MAAMmD,aAAa,GAAGf,gBAAgB,CAACrC,OAAD,CAAtC;EACA,MAAMqD,iBAAiB,GAAGD,aAAa,CAACE,IAAd,CAAmB,CAAC,GAAGC,CAAH,CAAD,KAAW,IAAAnC,oBAAA,EAAWmC,CAAC,CAACpC,IAAb,MAAuBlB,UAArD,CAA1B;;EACA,IAAI,CAACoD,iBAAL,EAAwB;IACtB,MAAM,IAAIF,KAAJ,CAAW,0BAAyBlD,UAAW,sBAA/C,CAAN;EACD;;EACD,OAAOoD,iBAAP;AACD;;AAED,SAAStB,oBAAT,CAA8B/B,OAA9B,EAAqD6B,QAArD,EAAiG;EAC/F,MAAMuB,aAAa,GAAGf,gBAAgB,CAACrC,OAAD,CAAtC;EACA,MAAMqD,iBAAiB,GAAGD,aAAa,CAACE,IAAd,CAAmB,CAAC,CAACE,GAAD,CAAD,KAAWA,GAAG,KAAK3B,QAAtC,CAA1B;;EACA,IAAI,CAACwB,iBAAL,EAAwB;IACtB,MAAM,IAAIF,KAAJ,CAAW,kCAAiCtB,QAAS,sBAArD,CAAN;EACD;;EACD,OAAOwB,iBAAP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ios/Updates.ts"],"names":["CREATE_MANIFEST_IOS_PATH","Config","withUpdates","config","expoUsername","projectRoot","modRequest","expoUpdatesPackageVersion","modResults","setUpdatesConfig","expoPlist","username","newExpoPlist","ENABLED","CHECK_ON_LAUNCH","LAUNCH_WAIT_MS","updateUrl","UPDATE_URL","codeSigningCertificate","CODE_SIGNING_CERTIFICATE","codeSigningMetadata","CODE_SIGNING_METADATA","setVersionsConfig","runtimeVersion","RUNTIME_VERSION","Error","sdkVersion","SDK_VERSION","formatConfigurationScriptPath","buildScriptPath","resolveFrom","silent","relativePath","path","relative","join","process","platform","replace","getBundleReactNativePhase","project","shellScriptBuildPhase","hash","objects","PBXShellScriptBuildPhase","bundleReactNative","Object","values","find","buildPhase","name","ensureBundleReactNativePhaseContainsConfigurationScript","buildPhaseShellScriptPath","isShellScriptBuildPhaseConfigured","shellScript","includes","RegExp","isPlistConfigurationSet","Boolean","EXUpdatesURL","EXUpdatesSDKVersion","EXUpdatesRuntimeVersion","isPlistConfigurationSynced","EXUpdatesEnabled","EXUpdatesLaunchWaitMs","EXUpdatesCheckOnLaunch","EXUpdatesCodeSigningCertificate","EXUpdatesCodeSigningMetadata","isPlistVersionConfigurationSynced","expectedRuntimeVersion","expectedSdkVersion","currentRuntimeVersion","currentSdkVersion"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAIA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;AAcA,MAAMA,wBAAwB,GAAG,6CAAjC;IAEYC,M;;;WAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;AAAAA,EAAAA,M;GAAAA,M,sBAAAA,M;;AAaL,MAAMC,WAA0D,GAAG,CACxEC,MADwE,EAExE;AAAEC,EAAAA;AAAF,CAFwE,KAGrE;AACH,SAAO,iCAAcD,MAAd,EAAsBA,MAAM,IAAI;AACrC,UAAME,WAAW,GAAGF,MAAM,CAACG,UAAP,CAAkBD,WAAtC;AACA,UAAME,yBAAyB,GAAG,6CAA6BF,WAA7B,CAAlC;AACAF,IAAAA,MAAM,CAACK,UAAP,GAAoBC,gBAAgB,CAClCJ,WADkC,EAElCF,MAFkC,EAGlCA,MAAM,CAACK,UAH2B,EAIlCJ,YAJkC,EAKlCG,yBALkC,CAApC;AAOA,WAAOJ,MAAP;AACD,GAXM,CAAP;AAYD,CAhBM;;;;A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ACF","sourcesContent":["import * as path from 'path';\nimport resolveFrom from 'resolve-from';\nimport xcode from 'xcode';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withExpoPlist } from '../plugins/ios-plugins';\nimport {\n ExpoConfigUpdates,\n getExpoUpdatesPackageVersion,\n getRuntimeVersionNullable,\n getSDKVersion,\n getUpdatesCheckOnLaunch,\n getUpdatesCodeSigningCertificate,\n getUpdatesCodeSigningMetadata,\n getUpdatesEnabled,\n getUpdatesTimeout,\n getUpdateUrl,\n} from '../utils/Updates';\nimport { ExpoPlist } from './IosConfig.types';\n\nconst CREATE_MANIFEST_IOS_PATH = 'expo-updates/scripts/create-manifest-ios.sh';\n\nexport enum Config {\n ENABLED = 'EXUpdatesEnabled',\n CHECK_ON_LAUNCH = 'EXUpdatesCheckOnLaunch',\n LAUNCH_WAIT_MS = 'EXUpdatesLaunchWaitMs',\n RUNTIME_VERSION = 'EXUpdatesRuntimeVersion',\n SDK_VERSION = 'EXUpdatesSDKVersion',\n UPDATE_URL = 'EXUpdatesURL',\n RELEASE_CHANNEL = 'EXUpdatesReleaseChannel',\n UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY = 'EXUpdatesRequestHeaders',\n CODE_SIGNING_CERTIFICATE = 'EXUpdatesCodeSigningCertificate',\n CODE_SIGNING_METADATA = 'EXUpdatesCodeSigningMetadata',\n}\n\nexport const withUpdates: ConfigPlugin<{ expoUsername: string | null }> = (\n config,\n { expoUsername }\n) => {\n return withExpoPlist(config, config => {\n const projectRoot = config.modRequest.projectRoot;\n const expoUpdatesPackageVersion = getExpoUpdatesPackageVersion(projectRoot);\n config.modResults = setUpdatesConfig(\n projectRoot,\n config,\n config.modResults,\n expoUsername,\n expoUpdatesPackageVersion\n );\n return config;\n });\n};\n\nexport function setUpdatesConfig(\n projectRoot: string,\n config: ExpoConfigUpdates,\n expoPlist: ExpoPlist,\n username: string | null,\n expoUpdatesPackageVersion?: string | null\n): ExpoPlist {\n const newExpoPlist = {\n ...expoPlist,\n [Config.ENABLED]: getUpdatesEnabled(config),\n [Config.CHECK_ON_LAUNCH]: getUpdatesCheckOnLaunch(config, expoUpdatesPackageVersion),\n [Config.LAUNCH_WAIT_MS]: getUpdatesTimeout(config),\n };\n\n const updateUrl = getUpdateUrl(config, username);\n if (updateUrl) {\n newExpoPlist[Config.UPDATE_URL] = updateUrl;\n } else {\n delete newExpoPlist[Config.UPDATE_URL];\n }\n\n const codeSigningCertificate = getUpdatesCodeSigningCertificate(projectRoot, config);\n if (codeSigningCertificate) {\n newExpoPlist[Config.CODE_SIGNING_CERTIFICATE] = codeSigningCertificate;\n } else {\n delete newExpoPlist[Config.CODE_SIGNING_CERTIFICATE];\n }\n\n const codeSigningMetadata = getUpdatesCodeSigningMetadata(config);\n if (codeSigningMetadata) {\n newExpoPlist[Config.CODE_SIGNING_METADATA] = codeSigningMetadata;\n } else {\n delete newExpoPlist[Config.CODE_SIGNING_METADATA];\n }\n\n return setVersionsConfig(config, newExpoPlist);\n}\n\nexport function setVersionsConfig(config: ExpoConfigUpdates, expoPlist: ExpoPlist): ExpoPlist {\n const newExpoPlist = { ...expoPlist };\n\n const runtimeVersion = getRuntimeVersionNullable(config, 'ios');\n if (!runtimeVersion && expoPlist[Config.RUNTIME_VERSION]) {\n throw new Error(\n 'A runtime version is set in your Expo.plist, but is missing from your app.json/app.config.js. Please either set runtimeVersion in your app.json/app.config.js or remove EXUpdatesRuntimeVersion from your Expo.plist.'\n );\n }\n const sdkVersion = getSDKVersion(config);\n if (runtimeVersion) {\n delete newExpoPlist[Config.SDK_VERSION];\n newExpoPlist[Config.RUNTIME_VERSION] = runtimeVersion;\n } else if (sdkVersion) {\n /**\n * runtime version maybe null in projects using classic updates. In that\n * case we use SDK version\n */\n delete newExpoPlist[Config.RUNTIME_VERSION];\n newExpoPlist[Config.SDK_VERSION] = sdkVersion;\n } else {\n delete newExpoPlist[Config.SDK_VERSION];\n delete newExpoPlist[Config.RUNTIME_VERSION];\n }\n\n return newExpoPlist;\n}\n\nfunction formatConfigurationScriptPath(projectRoot: string): string {\n const buildScriptPath = resolveFrom.silent(projectRoot, CREATE_MANIFEST_IOS_PATH);\n\n if (!buildScriptPath) {\n throw new Error(\n \"Could not find the build script for iOS. This could happen in case of outdated 'node_modules'. Run 'npm install' to make sure that it's up-to-date.\"\n );\n }\n\n const relativePath = path.relative(path.join(projectRoot, 'ios'), buildScriptPath);\n return process.platform === 'win32' ? relativePath.replace(/\\\\/g, '/') : relativePath;\n}\n\ninterface ShellScriptBuildPhase {\n isa: 'PBXShellScriptBuildPhase';\n name: string;\n shellScript: string;\n [key: string]: any;\n}\n\nexport function getBundleReactNativePhase(project: xcode.XcodeProject): ShellScriptBuildPhase {\n const shellScriptBuildPhase = project.hash.project.objects.PBXShellScriptBuildPhase as Record<\n string,\n ShellScriptBuildPhase\n >;\n const bundleReactNative = Object.values(shellScriptBuildPhase).find(\n buildPhase => buildPhase.name === '\"Bundle React Native code and images\"'\n );\n\n if (!bundleReactNative) {\n throw new Error(`Couldn't find a build phase \"Bundle React Native code and images\"`);\n }\n\n return bundleReactNative;\n}\n\nexport function ensureBundleReactNativePhaseContainsConfigurationScript(\n projectRoot: string,\n project: xcode.XcodeProject\n): xcode.XcodeProject {\n const bundleReactNative = getBundleReactNativePhase(project);\n const buildPhaseShellScriptPath = formatConfigurationScriptPath(projectRoot);\n\n if (!isShellScriptBuildPhaseConfigured(projectRoot, project)) {\n // check if there's already another path to create-manifest-ios.sh\n // this might be the case for monorepos\n if (bundleReactNative.shellScript.includes(CREATE_MANIFEST_IOS_PATH)) {\n bundleReactNative.shellScript = bundleReactNative.shellScript.replace(\n new RegExp(`(\\\\\\\\n)(\\\\.\\\\.)+/node_modules/${CREATE_MANIFEST_IOS_PATH}`),\n ''\n );\n }\n bundleReactNative.shellScript = `${bundleReactNative.shellScript.replace(\n /\"$/,\n ''\n )}${buildPhaseShellScriptPath}\\\\n\"`;\n }\n return project;\n}\n\nexport function isShellScriptBuildPhaseConfigured(\n projectRoot: string,\n project: xcode.XcodeProject\n): boolean {\n const bundleReactNative = getBundleReactNativePhase(project);\n const buildPhaseShellScriptPath = formatConfigurationScriptPath(projectRoot);\n return bundleReactNative.shellScript.includes(buildPhaseShellScriptPath);\n}\n\nexport function isPlistConfigurationSet(expoPlist: ExpoPlist): boolean {\n return Boolean(\n expoPlist.EXUpdatesURL && (expoPlist.EXUpdatesSDKVersion || expoPlist.EXUpdatesRuntimeVersion)\n );\n}\n\nexport function isPlistConfigurationSynced(\n projectRoot: string,\n config: ExpoConfigUpdates,\n expoPlist: ExpoPlist,\n username: string | null\n): boolean {\n return (\n getUpdateUrl(config, username) === expoPlist.EXUpdatesURL &&\n getUpdatesEnabled(config) === expoPlist.EXUpdatesEnabled &&\n getUpdatesTimeout(config) === expoPlist.EXUpdatesLaunchWaitMs &&\n getUpdatesCheckOnLaunch(config) === expoPlist.EXUpdatesCheckOnLaunch &&\n getUpdatesCodeSigningCertificate(projectRoot, config) ===\n expoPlist.EXUpdatesCodeSigningCertificate &&\n getUpdatesCodeSigningMetadata(config) === expoPlist.EXUpdatesCodeSigningMetadata &&\n isPlistVersionConfigurationSynced(config, expoPlist)\n );\n}\n\nexport function isPlistVersionConfigurationSynced(\n config: Pick<ExpoConfigUpdates, 'sdkVersion' | 'runtimeVersion'>,\n expoPlist: ExpoPlist\n): boolean {\n const expectedRuntimeVersion = getRuntimeVersionNullable(config, 'ios');\n const expectedSdkVersion = getSDKVersion(config);\n\n const currentRuntimeVersion = expoPlist.EXUpdatesRuntimeVersion ?? null;\n const currentSdkVersion = expoPlist.EXUpdatesSDKVersion ?? null;\n\n if (expectedRuntimeVersion !== null) {\n return currentRuntimeVersion === expectedRuntimeVersion && currentSdkVersion === null;\n } else if (expectedSdkVersion !== null) {\n return currentSdkVersion === expectedSdkVersion && currentRuntimeVersion === null;\n } else {\n return true;\n }\n}\n"],"file":"Updates.js"}
1
+ {"version":3,"file":"Updates.js","names":["CREATE_MANIFEST_IOS_PATH","Config","withUpdates","config","expoUsername","withExpoPlist","projectRoot","modRequest","expoUpdatesPackageVersion","getExpoUpdatesPackageVersion","modResults","setUpdatesConfig","expoPlist","username","newExpoPlist","ENABLED","getUpdatesEnabled","CHECK_ON_LAUNCH","getUpdatesCheckOnLaunch","LAUNCH_WAIT_MS","getUpdatesTimeout","updateUrl","getUpdateUrl","UPDATE_URL","codeSigningCertificate","getUpdatesCodeSigningCertificate","CODE_SIGNING_CERTIFICATE","codeSigningMetadata","getUpdatesCodeSigningMetadata","CODE_SIGNING_METADATA","setVersionsConfig","runtimeVersion","getRuntimeVersionNullable","RUNTIME_VERSION","Error","sdkVersion","getSDKVersion","SDK_VERSION","formatConfigurationScriptPath","buildScriptPath","resolveFrom","silent","relativePath","path","relative","join","process","platform","replace","getBundleReactNativePhase","project","shellScriptBuildPhase","hash","objects","PBXShellScriptBuildPhase","bundleReactNative","Object","values","find","buildPhase","name","ensureBundleReactNativePhaseContainsConfigurationScript","buildPhaseShellScriptPath","isShellScriptBuildPhaseConfigured","shellScript","includes","RegExp","isPlistConfigurationSet","Boolean","EXUpdatesURL","EXUpdatesSDKVersion","EXUpdatesRuntimeVersion","isPlistConfigurationSynced","EXUpdatesEnabled","EXUpdatesLaunchWaitMs","EXUpdatesCheckOnLaunch","EXUpdatesCodeSigningCertificate","EXUpdatesCodeSigningMetadata","isPlistVersionConfigurationSynced","expectedRuntimeVersion","expectedSdkVersion","currentRuntimeVersion","currentSdkVersion"],"sources":["../../src/ios/Updates.ts"],"sourcesContent":["import * as path from 'path';\nimport resolveFrom from 'resolve-from';\nimport xcode from 'xcode';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withExpoPlist } from '../plugins/ios-plugins';\nimport {\n ExpoConfigUpdates,\n getExpoUpdatesPackageVersion,\n getRuntimeVersionNullable,\n getSDKVersion,\n getUpdatesCheckOnLaunch,\n getUpdatesCodeSigningCertificate,\n getUpdatesCodeSigningMetadata,\n getUpdatesEnabled,\n getUpdatesTimeout,\n getUpdateUrl,\n} from '../utils/Updates';\nimport { ExpoPlist } from './IosConfig.types';\n\nconst CREATE_MANIFEST_IOS_PATH = 'expo-updates/scripts/create-manifest-ios.sh';\n\nexport enum Config {\n ENABLED = 'EXUpdatesEnabled',\n CHECK_ON_LAUNCH = 'EXUpdatesCheckOnLaunch',\n LAUNCH_WAIT_MS = 'EXUpdatesLaunchWaitMs',\n RUNTIME_VERSION = 'EXUpdatesRuntimeVersion',\n SDK_VERSION = 'EXUpdatesSDKVersion',\n UPDATE_URL = 'EXUpdatesURL',\n RELEASE_CHANNEL = 'EXUpdatesReleaseChannel',\n UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY = 'EXUpdatesRequestHeaders',\n CODE_SIGNING_CERTIFICATE = 'EXUpdatesCodeSigningCertificate',\n CODE_SIGNING_METADATA = 'EXUpdatesCodeSigningMetadata',\n}\n\nexport const withUpdates: ConfigPlugin<{ expoUsername: string | null }> = (\n config,\n { expoUsername }\n) => {\n return withExpoPlist(config, (config) => {\n const projectRoot = config.modRequest.projectRoot;\n const expoUpdatesPackageVersion = getExpoUpdatesPackageVersion(projectRoot);\n config.modResults = setUpdatesConfig(\n projectRoot,\n config,\n config.modResults,\n expoUsername,\n expoUpdatesPackageVersion\n );\n return config;\n });\n};\n\nexport function setUpdatesConfig(\n projectRoot: string,\n config: ExpoConfigUpdates,\n expoPlist: ExpoPlist,\n username: string | null,\n expoUpdatesPackageVersion?: string | null\n): ExpoPlist {\n const newExpoPlist = {\n ...expoPlist,\n [Config.ENABLED]: getUpdatesEnabled(config),\n [Config.CHECK_ON_LAUNCH]: getUpdatesCheckOnLaunch(config, expoUpdatesPackageVersion),\n [Config.LAUNCH_WAIT_MS]: getUpdatesTimeout(config),\n };\n\n const updateUrl = getUpdateUrl(config, username);\n if (updateUrl) {\n newExpoPlist[Config.UPDATE_URL] = updateUrl;\n } else {\n delete newExpoPlist[Config.UPDATE_URL];\n }\n\n const codeSigningCertificate = getUpdatesCodeSigningCertificate(projectRoot, config);\n if (codeSigningCertificate) {\n newExpoPlist[Config.CODE_SIGNING_CERTIFICATE] = codeSigningCertificate;\n } else {\n delete newExpoPlist[Config.CODE_SIGNING_CERTIFICATE];\n }\n\n const codeSigningMetadata = getUpdatesCodeSigningMetadata(config);\n if (codeSigningMetadata) {\n newExpoPlist[Config.CODE_SIGNING_METADATA] = codeSigningMetadata;\n } else {\n delete newExpoPlist[Config.CODE_SIGNING_METADATA];\n }\n\n return setVersionsConfig(config, newExpoPlist);\n}\n\nexport function setVersionsConfig(config: ExpoConfigUpdates, expoPlist: ExpoPlist): ExpoPlist {\n const newExpoPlist = { ...expoPlist };\n\n const runtimeVersion = getRuntimeVersionNullable(config, 'ios');\n if (!runtimeVersion && expoPlist[Config.RUNTIME_VERSION]) {\n throw new Error(\n 'A runtime version is set in your Expo.plist, but is missing from your app.json/app.config.js. Please either set runtimeVersion in your app.json/app.config.js or remove EXUpdatesRuntimeVersion from your Expo.plist.'\n );\n }\n const sdkVersion = getSDKVersion(config);\n if (runtimeVersion) {\n delete newExpoPlist[Config.SDK_VERSION];\n newExpoPlist[Config.RUNTIME_VERSION] = runtimeVersion;\n } else if (sdkVersion) {\n /**\n * runtime version maybe null in projects using classic updates. In that\n * case we use SDK version\n */\n delete newExpoPlist[Config.RUNTIME_VERSION];\n newExpoPlist[Config.SDK_VERSION] = sdkVersion;\n } else {\n delete newExpoPlist[Config.SDK_VERSION];\n delete newExpoPlist[Config.RUNTIME_VERSION];\n }\n\n return newExpoPlist;\n}\n\nfunction formatConfigurationScriptPath(projectRoot: string): string {\n const buildScriptPath = resolveFrom.silent(projectRoot, CREATE_MANIFEST_IOS_PATH);\n\n if (!buildScriptPath) {\n throw new Error(\n \"Could not find the build script for iOS. This could happen in case of outdated 'node_modules'. Run 'npm install' to make sure that it's up-to-date.\"\n );\n }\n\n const relativePath = path.relative(path.join(projectRoot, 'ios'), buildScriptPath);\n return process.platform === 'win32' ? relativePath.replace(/\\\\/g, '/') : relativePath;\n}\n\ninterface ShellScriptBuildPhase {\n isa: 'PBXShellScriptBuildPhase';\n name: string;\n shellScript: string;\n [key: string]: any;\n}\n\nexport function getBundleReactNativePhase(project: xcode.XcodeProject): ShellScriptBuildPhase {\n const shellScriptBuildPhase = project.hash.project.objects.PBXShellScriptBuildPhase as Record<\n string,\n ShellScriptBuildPhase\n >;\n const bundleReactNative = Object.values(shellScriptBuildPhase).find(\n (buildPhase) => buildPhase.name === '\"Bundle React Native code and images\"'\n );\n\n if (!bundleReactNative) {\n throw new Error(`Couldn't find a build phase \"Bundle React Native code and images\"`);\n }\n\n return bundleReactNative;\n}\n\nexport function ensureBundleReactNativePhaseContainsConfigurationScript(\n projectRoot: string,\n project: xcode.XcodeProject\n): xcode.XcodeProject {\n const bundleReactNative = getBundleReactNativePhase(project);\n const buildPhaseShellScriptPath = formatConfigurationScriptPath(projectRoot);\n\n if (!isShellScriptBuildPhaseConfigured(projectRoot, project)) {\n // check if there's already another path to create-manifest-ios.sh\n // this might be the case for monorepos\n if (bundleReactNative.shellScript.includes(CREATE_MANIFEST_IOS_PATH)) {\n bundleReactNative.shellScript = bundleReactNative.shellScript.replace(\n new RegExp(`(\\\\\\\\n)(\\\\.\\\\.)+/node_modules/${CREATE_MANIFEST_IOS_PATH}`),\n ''\n );\n }\n bundleReactNative.shellScript = `${bundleReactNative.shellScript.replace(\n /\"$/,\n ''\n )}${buildPhaseShellScriptPath}\\\\n\"`;\n }\n return project;\n}\n\nexport function isShellScriptBuildPhaseConfigured(\n projectRoot: string,\n project: xcode.XcodeProject\n): boolean {\n const bundleReactNative = getBundleReactNativePhase(project);\n const buildPhaseShellScriptPath = formatConfigurationScriptPath(projectRoot);\n return bundleReactNative.shellScript.includes(buildPhaseShellScriptPath);\n}\n\nexport function isPlistConfigurationSet(expoPlist: ExpoPlist): boolean {\n return Boolean(\n expoPlist.EXUpdatesURL && (expoPlist.EXUpdatesSDKVersion || expoPlist.EXUpdatesRuntimeVersion)\n );\n}\n\nexport function isPlistConfigurationSynced(\n projectRoot: string,\n config: ExpoConfigUpdates,\n expoPlist: ExpoPlist,\n username: string | null\n): boolean {\n return (\n getUpdateUrl(config, username) === expoPlist.EXUpdatesURL &&\n getUpdatesEnabled(config) === expoPlist.EXUpdatesEnabled &&\n getUpdatesTimeout(config) === expoPlist.EXUpdatesLaunchWaitMs &&\n getUpdatesCheckOnLaunch(config) === expoPlist.EXUpdatesCheckOnLaunch &&\n getUpdatesCodeSigningCertificate(projectRoot, config) ===\n expoPlist.EXUpdatesCodeSigningCertificate &&\n getUpdatesCodeSigningMetadata(config) === expoPlist.EXUpdatesCodeSigningMetadata &&\n isPlistVersionConfigurationSynced(config, expoPlist)\n );\n}\n\nexport function isPlistVersionConfigurationSynced(\n config: Pick<ExpoConfigUpdates, 'sdkVersion' | 'runtimeVersion'>,\n expoPlist: ExpoPlist\n): boolean {\n const expectedRuntimeVersion = getRuntimeVersionNullable(config, 'ios');\n const expectedSdkVersion = getSDKVersion(config);\n\n const currentRuntimeVersion = expoPlist.EXUpdatesRuntimeVersion ?? null;\n const currentSdkVersion = expoPlist.EXUpdatesSDKVersion ?? null;\n\n if (expectedRuntimeVersion !== null) {\n return currentRuntimeVersion === expectedRuntimeVersion && currentSdkVersion === null;\n } else if (expectedSdkVersion !== null) {\n return currentSdkVersion === expectedSdkVersion && currentRuntimeVersion === null;\n } else {\n return true;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;;;;;AAcA,MAAMA,wBAAwB,GAAG,6CAAjC;IAEYC,M;;;WAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;EAAAA,M;GAAAA,M,sBAAAA,M;;AAaL,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AAT,CARnC;AAUD;;AAEM,SAASkE,iCAAT,CACL3E,MADK,EAELS,SAFK,EAGI;EAAA;;EACT,MAAMmE,sBAAsB,GAAG,IAAA/C,oCAAA,EAA0B7B,MAA1B,EAAkC,KAAlC,CAA/B;EACA,MAAM6E,kBAAkB,GAAG,IAAA5C,wBAAA,EAAcjC,MAAd,CAA3B;EAEA,MAAM8E,qBAAqB,4BAAGrE,SAAS,CAAC2D,uBAAb,yEAAwC,IAAnE;EACA,MAAMW,iBAAiB,4BAAGtE,SAAS,CAAC0D,mBAAb,yEAAoC,IAA3D;;EAEA,IAAIS,sBAAsB,KAAK,IAA/B,EAAqC;IACnC,OAAOE,qBAAqB,KAAKF,sBAA1B,IAAoDG,iBAAiB,KAAK,IAAjF;EACD,CAFD,MAEO,IAAIF,kBAAkB,KAAK,IAA3B,EAAiC;IACtC,OAAOE,iBAAiB,KAAKF,kBAAtB,IAA4CC,qBAAqB,KAAK,IAA7E;EACD,CAFM,MAEA;IACL,OAAO,IAAP;EACD;AACF"}
@@ -17,7 +17,10 @@ function _iosPlugins() {
17
17
  return data;
18
18
  }
19
19
 
20
- const withUsesNonExemptEncryption = (0, _iosPlugins().createInfoPlistPlugin)(setUsesNonExemptEncryption, 'withUsesNonExemptEncryption');
20
+ const withUsesNonExemptEncryption = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setUsesNonExemptEncryption, {
21
+ infoPlistProperty: 'ITSAppUsesNonExemptEncryption',
22
+ expoConfigProperty: 'ios.config.usesNonExemptEncryption'
23
+ }, 'withUsesNonExemptEncryption');
21
24
  exports.withUsesNonExemptEncryption = withUsesNonExemptEncryption;
22
25
 
23
26
  function getUsesNonExemptEncryption(config) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ios/UsesNonExemptEncryption.ts"],"names":["withUsesNonExemptEncryption","setUsesNonExemptEncryption","getUsesNonExemptEncryption","config","ios","usesNonExemptEncryption","ITSAppUsesNonExemptEncryption","infoPlist"],"mappings":";;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,2BAA2B,GAAG,yCACzCC,0BADyC,EAEzC,6BAFyC,CAApC;;;AAKA,SAASC,0BAAT,CAAoCC,MAApC,EAAqE;AAAA;;AAC1E,kCAAOA,MAAP,aAAOA,MAAP,sCAAOA,MAAM,CAAEC,GAAf,sEAAO,YAAaD,MAApB,uDAAO,mBAAqBE,uBAA5B,yEAAuD,IAAvD;AACD;;AAEM,SAASJ,0BAAT,CACLE,MADK,EAEL;AAAEG,EAAAA,6BAAF;AAAiC,KAAGC;AAApC,CAFK,EAGM;AACX,QAAMF,uBAAuB,GAAGH,0BAA0B,CAACC,MAAD,CAA1D,CADW,CAGX;;AACA,MAAIE,uBAAuB,KAAK,IAAhC,EAAsC;AACpC,WAAOE,SAAP;AACD;;AAED,SAAO,EACL,GAAGA,SADE;AAELD,IAAAA,6BAA6B,EAAED;AAF1B,GAAP;AAID","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPlugin } from '../plugins/ios-plugins';\nimport { InfoPlist } from './IosConfig.types';\n\nexport const withUsesNonExemptEncryption = createInfoPlistPlugin(\n setUsesNonExemptEncryption,\n 'withUsesNonExemptEncryption'\n);\n\nexport function getUsesNonExemptEncryption(config: Pick<ExpoConfig, 'ios'>) {\n return config?.ios?.config?.usesNonExemptEncryption ?? null;\n}\n\nexport function setUsesNonExemptEncryption(\n config: Pick<ExpoConfig, 'ios'>,\n { ITSAppUsesNonExemptEncryption, ...infoPlist }: InfoPlist\n): InfoPlist {\n const usesNonExemptEncryption = getUsesNonExemptEncryption(config);\n\n // Make no changes if the key is left blank\n if (usesNonExemptEncryption === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n ITSAppUsesNonExemptEncryption: usesNonExemptEncryption,\n };\n}\n"],"file":"UsesNonExemptEncryption.js"}
1
+ {"version":3,"file":"UsesNonExemptEncryption.js","names":["withUsesNonExemptEncryption","createInfoPlistPluginWithPropertyGuard","setUsesNonExemptEncryption","infoPlistProperty","expoConfigProperty","getUsesNonExemptEncryption","config","ios","usesNonExemptEncryption","ITSAppUsesNonExemptEncryption","infoPlist"],"sources":["../../src/ios/UsesNonExemptEncryption.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPluginWithPropertyGuard } from '../plugins/ios-plugins';\nimport { InfoPlist } from './IosConfig.types';\n\nexport const withUsesNonExemptEncryption = createInfoPlistPluginWithPropertyGuard(\n setUsesNonExemptEncryption,\n {\n infoPlistProperty: 'ITSAppUsesNonExemptEncryption',\n expoConfigProperty: 'ios.config.usesNonExemptEncryption',\n },\n 'withUsesNonExemptEncryption'\n);\n\nexport function getUsesNonExemptEncryption(config: Pick<ExpoConfig, 'ios'>) {\n return config?.ios?.config?.usesNonExemptEncryption ?? null;\n}\n\nexport function setUsesNonExemptEncryption(\n config: Pick<ExpoConfig, 'ios'>,\n { ITSAppUsesNonExemptEncryption, ...infoPlist }: InfoPlist\n): InfoPlist {\n const usesNonExemptEncryption = getUsesNonExemptEncryption(config);\n\n // Make no changes if the key is left blank\n if (usesNonExemptEncryption === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n ITSAppUsesNonExemptEncryption: usesNonExemptEncryption,\n };\n}\n"],"mappings":";;;;;;;;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,2BAA2B,GAAG,IAAAC,oDAAA,EACzCC,0BADyC,EAEzC;EACEC,iBAAiB,EAAE,+BADrB;EAEEC,kBAAkB,EAAE;AAFtB,CAFyC,EAMzC,6BANyC,CAApC;;;AASA,SAASC,0BAAT,CAAoCC,MAApC,EAAqE;EAAA;;EAC1E,gCAAOA,MAAP,aAAOA,MAAP,sCAAOA,MAAM,CAAEC,GAAf,sEAAO,YAAaD,MAApB,uDAAO,mBAAqBE,uBAA5B,yEAAuD,IAAvD;AACD;;AAEM,SAASN,0BAAT,CACLI,MADK,EAEL;EAAEG,6BAAF;EAAiC,GAAGC;AAApC,CAFK,EAGM;EACX,MAAMF,uBAAuB,GAAGH,0BAA0B,CAACC,MAAD,CAA1D,CADW,CAGX;;EACA,IAAIE,uBAAuB,KAAK,IAAhC,EAAsC;IACpC,OAAOE,SAAP;EACD;;EAED,OAAO,EACL,GAAGA,SADE;IAELD,6BAA6B,EAAED;EAF1B,CAAP;AAID"}
@@ -19,9 +19,15 @@ function _iosPlugins() {
19
19
  return data;
20
20
  }
21
21
 
22
- const withVersion = (0, _iosPlugins().createInfoPlistPlugin)(setVersion, 'withVersion');
22
+ const withVersion = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setVersion, {
23
+ infoPlistProperty: 'CFBundleShortVersionString',
24
+ expoConfigProperty: 'version'
25
+ }, 'withVersion');
23
26
  exports.withVersion = withVersion;
24
- const withBuildNumber = (0, _iosPlugins().createInfoPlistPlugin)(setBuildNumber, 'withBuildNumber');
27
+ const withBuildNumber = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setBuildNumber, {
28
+ infoPlistProperty: 'CFBundleVersion',
29
+ expoConfigProperty: 'ios.buildNumber'
30
+ }, 'withBuildNumber');
25
31
  exports.withBuildNumber = withBuildNumber;
26
32
 
27
33
  function getVersion(config) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ios/Version.ts"],"names":["withVersion","setVersion","withBuildNumber","setBuildNumber","getVersion","config","version","infoPlist","CFBundleShortVersionString","getBuildNumber","ios","buildNumber","CFBundleVersion"],"mappings":";;;;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,WAAW,GAAG,yCAAsBC,UAAtB,EAAkC,aAAlC,CAApB;;AAEA,MAAMC,eAAe,GAAG,yCAAsBC,cAAtB,EAAsC,iBAAtC,CAAxB;;;AAEA,SAASC,UAAT,CAAoBC,MAApB,EAAyD;AAC9D,SAAOA,MAAM,CAACC,OAAP,IAAkB,OAAzB;AACD;;AAEM,SAASL,UAAT,CAAoBI,MAApB,EAAyDE,SAAzD,EAA0F;AAC/F,SAAO,EACL,GAAGA,SADE;AAELC,IAAAA,0BAA0B,EAAEJ,UAAU,CAACC,MAAD;AAFjC,GAAP;AAID;;AAEM,SAASI,cAAT,CAAwBJ,MAAxB,EAAyD;AAAA;;AAC9D,SAAO,eAAAA,MAAM,CAACK,GAAP,oDAAYC,WAAZ,GAA0BN,MAAM,CAACK,GAAP,CAAWC,WAArC,GAAmD,GAA1D;AACD;;AAEM,SAASR,cAAT,CAAwBE,MAAxB,EAAyDE,SAAzD,EAA0F;AAC/F,SAAO,EACL,GAAGA,SADE;AAELK,IAAAA,eAAe,EAAEH,cAAc,CAACJ,MAAD;AAF1B,GAAP;AAID","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPlugin } from '../plugins/ios-plugins';\nimport { InfoPlist } from './IosConfig.types';\n\nexport const withVersion = createInfoPlistPlugin(setVersion, 'withVersion');\n\nexport const withBuildNumber = createInfoPlistPlugin(setBuildNumber, 'withBuildNumber');\n\nexport function getVersion(config: Pick<ExpoConfig, 'version'>) {\n return config.version || '1.0.0';\n}\n\nexport function setVersion(config: Pick<ExpoConfig, 'version'>, infoPlist: InfoPlist): InfoPlist {\n return {\n ...infoPlist,\n CFBundleShortVersionString: getVersion(config),\n };\n}\n\nexport function getBuildNumber(config: Pick<ExpoConfig, 'ios'>) {\n return config.ios?.buildNumber ? config.ios.buildNumber : '1';\n}\n\nexport function setBuildNumber(config: Pick<ExpoConfig, 'ios'>, infoPlist: InfoPlist): InfoPlist {\n return {\n ...infoPlist,\n CFBundleVersion: getBuildNumber(config),\n };\n}\n"],"file":"Version.js"}
1
+ {"version":3,"file":"Version.js","names":["withVersion","createInfoPlistPluginWithPropertyGuard","setVersion","infoPlistProperty","expoConfigProperty","withBuildNumber","setBuildNumber","getVersion","config","version","infoPlist","CFBundleShortVersionString","getBuildNumber","ios","buildNumber","CFBundleVersion"],"sources":["../../src/ios/Version.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPluginWithPropertyGuard } from '../plugins/ios-plugins';\nimport { InfoPlist } from './IosConfig.types';\n\nexport const withVersion = createInfoPlistPluginWithPropertyGuard(\n setVersion,\n {\n infoPlistProperty: 'CFBundleShortVersionString',\n expoConfigProperty: 'version',\n },\n 'withVersion'\n);\n\nexport const withBuildNumber = createInfoPlistPluginWithPropertyGuard(\n setBuildNumber,\n {\n infoPlistProperty: 'CFBundleVersion',\n expoConfigProperty: 'ios.buildNumber',\n },\n 'withBuildNumber'\n);\n\nexport function getVersion(config: Pick<ExpoConfig, 'version'>) {\n return config.version || '1.0.0';\n}\n\nexport function setVersion(config: Pick<ExpoConfig, 'version'>, infoPlist: InfoPlist): InfoPlist {\n return {\n ...infoPlist,\n CFBundleShortVersionString: getVersion(config),\n };\n}\n\nexport function getBuildNumber(config: Pick<ExpoConfig, 'ios'>) {\n return config.ios?.buildNumber ? config.ios.buildNumber : '1';\n}\n\nexport function setBuildNumber(config: Pick<ExpoConfig, 'ios'>, infoPlist: InfoPlist): InfoPlist {\n return {\n ...infoPlist,\n CFBundleVersion: getBuildNumber(config),\n };\n}\n"],"mappings":";;;;;;;;;;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,WAAW,GAAG,IAAAC,oDAAA,EACzBC,UADyB,EAEzB;EACEC,iBAAiB,EAAE,4BADrB;EAEEC,kBAAkB,EAAE;AAFtB,CAFyB,EAMzB,aANyB,CAApB;;AASA,MAAMC,eAAe,GAAG,IAAAJ,oDAAA,EAC7BK,cAD6B,EAE7B;EACEH,iBAAiB,EAAE,iBADrB;EAEEC,kBAAkB,EAAE;AAFtB,CAF6B,EAM7B,iBAN6B,CAAxB;;;AASA,SAASG,UAAT,CAAoBC,MAApB,EAAyD;EAC9D,OAAOA,MAAM,CAACC,OAAP,IAAkB,OAAzB;AACD;;AAEM,SAASP,UAAT,CAAoBM,MAApB,EAAyDE,SAAzD,EAA0F;EAC/F,OAAO,EACL,GAAGA,SADE;IAELC,0BAA0B,EAAEJ,UAAU,CAACC,MAAD;EAFjC,CAAP;AAID;;AAEM,SAASI,cAAT,CAAwBJ,MAAxB,EAAyD;EAAA;;EAC9D,OAAO,eAAAA,MAAM,CAACK,GAAP,oDAAYC,WAAZ,GAA0BN,MAAM,CAACK,GAAP,CAAWC,WAArC,GAAmD,GAA1D;AACD;;AAEM,SAASR,cAAT,CAAwBE,MAAxB,EAAyDE,SAAzD,EAA0F;EAC/F,OAAO,EACL,GAAGA,SADE;IAELK,eAAe,EAAEH,cAAc,CAACJ,MAAD;EAF1B,CAAP;AAID"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ios/XcodeProjectFile.ts"],"names":["withBuildSourceFile","config","filePath","contents","overwrite","projectName","modRequest","projectRoot","modResults","createBuildSourceFile","project","nativeProjectRoot","platformProjectRoot","fileContents","path","join","absoluteFilePath","fs","existsSync","writeFileSync","groupName","dirname","hasFile","filepath"],"mappings":";;;;;;;;AAAA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,mBAIX,GAAG,CAACC,MAAD,EAAS;AAAEC,EAAAA,QAAF;AAAYC,EAAAA,QAAZ;AAAsBC,EAAAA;AAAtB,CAAT,KAA+C;AAClD,SAAO,oCAAiBH,MAAjB,EAAyBA,MAAM,IAAI;AACxC,UAAMI,WAAW,GAAG,iCAAeJ,MAAM,CAACK,UAAP,CAAkBC,WAAjC,CAApB;AAEAN,IAAAA,MAAM,CAACO,UAAP,GAAoBC,qBAAqB,CAAC;AACxCC,MAAAA,OAAO,EAAET,MAAM,CAACO,UADwB;AAExCG,MAAAA,iBAAiB,EAAEV,MAAM,CAACK,UAAP,CAAkBM,mBAFG;AAGxCC,MAAAA,YAAY,EAAEV,QAH0B;AAIxCD,MAAAA,QAAQ,EAAEY,gBAAKC,IAAL,CAAUV,WAAV,EAAuBH,QAAvB,CAJ8B;AAKxCE,MAAAA;AALwC,KAAD,CAAzC;AAOA,WAAOH,MAAP;AACD,GAXM,CAAP;AAYD,CAjBM;AAmBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,SAASQ,qBAAT,CAA+B;AACpCC,EAAAA,OADoC;AAEpCC,EAAAA,iBAFoC;AAGpCT,EAAAA,QAHoC;AAIpCW,EAAAA,YAJoC;AAKpCT,EAAAA;AALoC,CAA/B,EAYU;AACf,QAAMY,gBAAgB,GAAGF,gBAAKC,IAAL,CAAUJ,iBAAV,EAA6BT,QAA7B,CAAzB;;AACA,MAAIE,SAAS,IAAI,CAACa,cAAGC,UAAH,CAAcF,gBAAd,CAAlB,EAAmD;AACjD;AACAC,kBAAGE,aAAH,CAAiBH,gBAAjB,EAAmCH,YAAnC,EAAiD,MAAjD;AACD,GALc,CAOf;;;AACA,QAAMO,SAAS,GAAGN,gBAAKO,OAAL,CAAanB,QAAb,CAAlB,CARe,CAUf;;;AACA,MAAI,CAACQ,OAAO,CAACY,OAAR,CAAgBpB,QAAhB,CAAL,EAAgC;AAC9BQ,IAAAA,OAAO,GAAG,4CAA0B;AAClCa,MAAAA,QAAQ,EAAErB,QADwB;AAElCkB,MAAAA,SAFkC;AAGlCV,MAAAA;AAHkC,KAA1B,CAAV;AAKD;;AACD,SAAOA,OAAP;AACD","sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport { ConfigPlugin, XcodeProject } from '../Plugin.types';\nimport { withXcodeProject } from '../plugins/ios-plugins';\nimport { addBuildSourceFileToGroup, getProjectName } from './utils/Xcodeproj';\n\n/**\n * Create a build source file and link it to Xcode.\n *\n * @param config\n * @param props.filePath relative to the build source folder. ex: `ViewController.swift` would be created in `ios/myapp/ViewController.swift`.\n * @param props.contents file contents to write.\n * @param props.overwrite should the contents overwrite any existing file in the same location on disk.\n * @returns\n */\nexport const withBuildSourceFile: ConfigPlugin<{\n filePath: string;\n contents: string;\n overwrite?: boolean;\n}> = (config, { filePath, contents, overwrite }) => {\n return withXcodeProject(config, config => {\n const projectName = getProjectName(config.modRequest.projectRoot);\n\n config.modResults = createBuildSourceFile({\n project: config.modResults,\n nativeProjectRoot: config.modRequest.platformProjectRoot,\n fileContents: contents,\n filePath: path.join(projectName, filePath),\n overwrite,\n });\n return config;\n });\n};\n\n/**\n * Add a source file to the Xcode project and write it to the file system.\n *\n * @param nativeProjectRoot absolute path to the native app root `user/app/ios`\n * @param filePath path relative to the `nativeProjectRoot` for the file to create `user/app/ios/myapp/foobar.swift`\n * @param fileContents string file contents to write to the `filePath`\n * @param overwrite should write file even if one already exists\n */\nexport function createBuildSourceFile({\n project,\n nativeProjectRoot,\n filePath,\n fileContents,\n overwrite,\n}: {\n project: XcodeProject;\n nativeProjectRoot: string;\n filePath: string;\n fileContents: string;\n overwrite?: boolean;\n}): XcodeProject {\n const absoluteFilePath = path.join(nativeProjectRoot, filePath);\n if (overwrite || !fs.existsSync(absoluteFilePath)) {\n // Create the file\n fs.writeFileSync(absoluteFilePath, fileContents, 'utf8');\n }\n\n // `myapp`\n const groupName = path.dirname(filePath);\n\n // Ensure the file is linked with Xcode resource files\n if (!project.hasFile(filePath)) {\n project = addBuildSourceFileToGroup({\n filepath: filePath,\n groupName,\n project,\n });\n }\n return project;\n}\n"],"file":"XcodeProjectFile.js"}
1
+ {"version":3,"file":"XcodeProjectFile.js","names":["withBuildSourceFile","config","filePath","contents","overwrite","withXcodeProject","projectName","getProjectName","modRequest","projectRoot","modResults","createBuildSourceFile","project","nativeProjectRoot","platformProjectRoot","fileContents","path","join","absoluteFilePath","fs","existsSync","writeFileSync","groupName","dirname","hasFile","addBuildSourceFileToGroup","filepath"],"sources":["../../src/ios/XcodeProjectFile.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport { ConfigPlugin, XcodeProject } from '../Plugin.types';\nimport { withXcodeProject } from '../plugins/ios-plugins';\nimport { addBuildSourceFileToGroup, getProjectName } from './utils/Xcodeproj';\n\n/**\n * Create a build source file and link it to Xcode.\n *\n * @param config\n * @param props.filePath relative to the build source folder. ex: `ViewController.swift` would be created in `ios/myapp/ViewController.swift`.\n * @param props.contents file contents to write.\n * @param props.overwrite should the contents overwrite any existing file in the same location on disk.\n * @returns\n */\nexport const withBuildSourceFile: ConfigPlugin<{\n filePath: string;\n contents: string;\n overwrite?: boolean;\n}> = (config, { filePath, contents, overwrite }) => {\n return withXcodeProject(config, (config) => {\n const projectName = getProjectName(config.modRequest.projectRoot);\n\n config.modResults = createBuildSourceFile({\n project: config.modResults,\n nativeProjectRoot: config.modRequest.platformProjectRoot,\n fileContents: contents,\n filePath: path.join(projectName, filePath),\n overwrite,\n });\n return config;\n });\n};\n\n/**\n * Add a source file to the Xcode project and write it to the file system.\n *\n * @param nativeProjectRoot absolute path to the native app root `user/app/ios`\n * @param filePath path relative to the `nativeProjectRoot` for the file to create `user/app/ios/myapp/foobar.swift`\n * @param fileContents string file contents to write to the `filePath`\n * @param overwrite should write file even if one already exists\n */\nexport function createBuildSourceFile({\n project,\n nativeProjectRoot,\n filePath,\n fileContents,\n overwrite,\n}: {\n project: XcodeProject;\n nativeProjectRoot: string;\n filePath: string;\n fileContents: string;\n overwrite?: boolean;\n}): XcodeProject {\n const absoluteFilePath = path.join(nativeProjectRoot, filePath);\n if (overwrite || !fs.existsSync(absoluteFilePath)) {\n // Create the file\n fs.writeFileSync(absoluteFilePath, fileContents, 'utf8');\n }\n\n // `myapp`\n const groupName = path.dirname(filePath);\n\n // Ensure the file is linked with Xcode resource files\n if (!project.hasFile(filePath)) {\n project = addBuildSourceFileToGroup({\n filepath: filePath,\n groupName,\n project,\n });\n }\n return project;\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;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AAKO,OAAL,CAAarB,QAAb,CAAlB,CARe,CAUf;;;EACA,IAAI,CAACU,OAAO,CAACY,OAAR,CAAgBtB,QAAhB,CAAL,EAAgC;IAC9BU,OAAO,GAAG,IAAAa,sCAAA,EAA0B;MAClCC,QAAQ,EAAExB,QADwB;MAElCoB,SAFkC;MAGlCV;IAHkC,CAA1B,CAAV;EAKD;;EACD,OAAOA,OAAP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ios/codeMod.ts"],"names":["addObjcImports","source","imports","lines","split","lineIndexWithFirstImport","findIndex","line","match","importElement","includes","importStatement","splice","join","findObjcInterfaceCodeBlock","contents","declaration","start","search","RegExp","end","indexOf","code","substring","findObjcFunctionCodeBlock","selector","symbols","argsCount","length","pattern","i","argSymbol","insertContentsInsideObjcFunctionBlock","srcContents","insertion","options","insertContentsInsideFunctionBlock","insertContentsInsideObjcInterfaceBlock","codeBlock","position","firstNewLineIndex","endLen","findSwiftFunctionCodeBlock","parenthesesIndex","funcName","argLabels","searchOffset","funcCandidateRegExp","funcCandidateOffset","paramsStartOffset","paramsEndOffset","paramsString","params","map","parseSwiftFunctionParam","argumentLabel","codeBlockStart","codeBlockEnd","paramTuple","semiIndex","parameterName","typeString","trim","insertContentsInsideSwiftClassBlock","Error","firstBracketIndex","endBracketIndex","insertContentsInsideSwiftFunctionBlock","language","indent","repeat","lastReturnIndex","lastIndexOf"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CAAwBC,MAAxB,EAAwCC,OAAxC,EAAmE;AACxE,QAAMC,KAAK,GAAGF,MAAM,CAACG,KAAP,CAAa,IAAb,CAAd,CADwE,CAExE;;AACA,QAAMC,wBAAwB,GAAGF,KAAK,CAACG,SAAN,CAAgBC,IAAI,IAAIA,IAAI,CAACC,KAAL,CA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YAAM,IAAIP,KAAJ,CAAW,uCAAsC/B,WAAY,EAA7D,CAAN;AACD;;AACDsC,IAAAA,eAAe,IAAI,CAAnB,CAL8C,CAKxB;;AACtBtC,IAAAA,WAAW,GAAG,6CAAuBA,WAAvB,EAAqC,GAAEC,SAAU,KAAImC,MAAO,EAA5D,EAA+DE,eAA/D,CAAd;AACD;;AAED,SAAOtC,WAAP;AACD","sourcesContent":["import { CodeBlock, insertContentsAtOffset, searchFromOffset } from '../utils/commonCodeMod';\nimport { findMatchingBracketPosition } from '../utils/matchBrackets';\n\ninterface SwiftFunctionParam {\n argumentLabel: string;\n parameterName: string;\n typeString: string;\n}\n\ninterface InsertContentFunctionOptions {\n position: 'head' | 'tail' | 'tailBeforeLastReturn';\n indent?: number;\n}\n\n/**\n * Add Objective-C import\n * @param source source contents\n * @param imports array of imports, e.g. ['<Foundation/Foundation.h>']\n * @returns updated contents\n */\nexport function addObjcImports(source: string, imports: string[]): string {\n const lines = source.split('\\n');\n // Try to insert statements after first #import where would probably not in #if block\n const lineIndexWithFirstImport = lines.findIndex(line => line.match(/^#import .*$/));\n for (const importElement of imports) {\n if (!source.includes(importElement)) {\n const importStatement = `#import ${importElement}`;\n lines.splice(lineIndexWithFirstImport + 1, 0, importStatement);\n }\n }\n return lines.join('\\n');\n}\n\n/**\n * Find code block of Objective-C interface or implementation\n *\n * @param contents source contents\n * @param declaration interface/implementation, e.g. '@interface Foo'\n * @returns found CodeBlock, or null if not found\n */\nexport function findObjcInterfaceCodeBlock(\n contents: string,\n declaration: string\n): CodeBlock | null {\n const start = contents.search(new RegExp(`^${declaration}\\\\W`, 'm'));\n if (start < 0) {\n return null;\n }\n\n let end = contents.indexOf('\\n@end', start);\n end += 5; // '\\n@end'.length === 5\n\n return {\n start,\n end,\n code: contents.substring(start, end),\n };\n}\n\n/**\n * Find code block of Objective-C function without declaration, will return only {} block\n *\n * @param contents source contents\n * @param selector function selector, e.g. 'doSomething:withSomeValue:'\n * @returns found CodeBlock, or null if not found.\n */\nexport function findObjcFunctionCodeBlock(contents: string, selector: string): CodeBlock | null {\n const symbols = selector.split(':');\n const argsCount = symbols.length - 1;\n let pattern = '^[\\\\-+]\\\\s*\\\\(.+?\\\\)';\n if (argsCount === 0) {\n pattern += `${symbols[0]}\\\\s+`;\n } else {\n for (let i = 0; i < argsCount; ++i) {\n const argSymbol = `${symbols[i]}:\\\\(.+\\\\)\\\\w+`;\n pattern += `${argSymbol}\\\\s+`;\n }\n }\n pattern += '{';\n let start = contents.search(new RegExp(pattern, 'm'));\n if (start < 0) {\n return null;\n }\n start = contents.indexOf('{', start);\n\n const end = findMatchingBracketPosition(contents, '{', start);\n return {\n start,\n end,\n code: contents.substring(start, end + 1),\n };\n}\n\n/**\n * Insert contents to the Objective-C function block\n *\n * @param srcContents source contents\n * @param selector function selector, e.g. 'doSomething:withSomeValue:'\n * @param insertion code to insert\n * @param options insertion options\n * @returns updated contents\n */\nexport function insertContentsInsideObjcFunctionBlock(\n srcContents: string,\n selector: string,\n insertion: string,\n options: InsertContentFunctionOptions\n): string {\n return insertContentsInsideFunctionBlock(srcContents, selector, insertion, options, 'objc');\n}\n\n/**\n * Insert contents to the Objective-C interface/implementation block\n *\n * @param srcContents source contents\n * @param declaration interface/implementation, e.g. '@interface Foo'\n * @param insertion code to insert\n * @param options insertion options\n * @returns updated contents\n */\nexport function insertContentsInsideObjcInterfaceBlock(\n srcContents: string,\n declaration: string,\n insertion: string,\n options: {\n position: 'head' | 'tail';\n }\n): string {\n const codeBlock = findObjcInterfaceCodeBlock(srcContents, declaration);\n if (!codeBlock) {\n return srcContents;\n }\n\n const { position } = options;\n if (position === 'head') {\n const firstNewLineIndex = srcContents.indexOf('\\n', codeBlock.start);\n srcContents = insertContentsAtOffset(srcContents, insertion, firstNewLineIndex);\n } else if (position === 'tail') {\n const endLen = '@end'.length;\n srcContents = insertContentsAtOffset(srcContents, insertion, codeBlock.end - endLen);\n }\n return srcContents;\n}\n\n/**\n * Find code block of Swift function without declaration, will return only {} block\n *\n * @param contents source contents\n * @param selector function selector, e.g. 'doSomething(_:withSomeValue:)'\n * @returns found CodeBlock, or null if not found.\n */\nexport function findSwiftFunctionCodeBlock(contents: string, selector: string): CodeBlock | null {\n const parenthesesIndex = selector.indexOf('(');\n // `functName` === 'doSomething' of 'doSomething(_:withSomeValue:)'\n const funcName = selector.substring(0, parenthesesIndex);\n // `argLabels` === ['_', 'withSomeValue'] 'doSomething(_:withSomeValue:)'\n const argLabels = selector.substring(parenthesesIndex + 1, selector.length - 2).split(':');\n\n let searchOffset = 0;\n const funcCandidateRegExp = new RegExp(`\\\\sfunc\\\\s+${funcName}\\\\(`, 'm');\n let funcCandidateOffset = searchFromOffset(contents, funcCandidateRegExp, searchOffset);\n while (funcCandidateOffset >= 0) {\n // Parse function parameters\n const paramsStartOffset = contents.indexOf('(', funcCandidateOffset);\n const paramsEndOffset = findMatchingBracketPosition(contents, '(', paramsStartOffset);\n const paramsString = contents.substring(paramsStartOffset + 1, paramsEndOffset);\n const params = paramsString.split(',').map(parseSwiftFunctionParam);\n\n // Prepare offset for next round\n searchOffset = paramsEndOffset + 1;\n funcCandidateOffset = searchFromOffset(contents, funcCandidateRegExp, searchOffset);\n\n // Try to match function parameters\n if (argLabels.length !== params.length) {\n continue;\n }\n for (let i = 0; i < argLabels.length; ++i) {\n if (argLabels[i] !== params[i].argumentLabel) {\n continue;\n }\n }\n\n // This function is matched one, get the code block.\n const codeBlockStart = contents.indexOf('{', paramsEndOffset);\n const codeBlockEnd = findMatchingBracketPosition(contents, '{', paramsEndOffset);\n const codeBlock = contents.substring(codeBlockStart, codeBlockEnd + 1);\n return {\n start: codeBlockStart,\n end: codeBlockEnd,\n code: codeBlock,\n };\n }\n\n return null;\n}\n\nfunction parseSwiftFunctionParam(paramTuple: string): SwiftFunctionParam {\n const semiIndex = paramTuple.indexOf(':');\n const [argumentLabel, parameterName] = paramTuple.substring(0, semiIndex).split(/\\s+/);\n const typeString = paramTuple.substring(semiIndex + 1).trim();\n return {\n argumentLabel,\n parameterName,\n typeString,\n };\n}\n\n/**\n * Insert contents to the swift class block\n *\n * @param srcContents source contents\n * @param declaration class/extension declaration, e.g. 'class AppDelegate'\n * @param insertion code to append\n * @param options insertion options\n * @returns updated contents\n */\nexport function insertContentsInsideSwiftClassBlock(\n srcContents: string,\n declaration: string,\n insertion: string,\n options: {\n position: 'head' | 'tail';\n }\n): string {\n const start = srcContents.search(new RegExp(`\\\\s*${declaration}.*?[\\\\(\\\\{]`));\n if (start < 0) {\n throw new Error(`Unable to find class code block - declaration[${declaration}]`);\n }\n\n const { position } = options;\n if (position === 'head') {\n const firstBracketIndex = srcContents.indexOf('{', start);\n srcContents = insertContentsAtOffset(srcContents, insertion, firstBracketIndex + 1);\n } else if (position === 'tail') {\n const endBracketIndex = findMatchingBracketPosition(srcContents, '{', start);\n srcContents = insertContentsAtOffset(srcContents, insertion, endBracketIndex);\n }\n return srcContents;\n}\n\n/**\n * Insert contents to the Swift function block\n *\n * @param srcContents source contents\n * @param selector function selector, e.g. 'doSomething:withSomeValue:'\n * @param insertion code to insert\n * @param options insertion options\n * @returns updated contents\n */\nexport function insertContentsInsideSwiftFunctionBlock(\n srcContents: string,\n selector: string,\n insertion: string,\n options: InsertContentFunctionOptions\n): string {\n return insertContentsInsideFunctionBlock(srcContents, selector, insertion, options, 'swift');\n}\n\nfunction insertContentsInsideFunctionBlock(\n srcContents: string,\n selector: string,\n insertion: string,\n options: InsertContentFunctionOptions,\n language: 'objc' | 'swift'\n): string {\n const codeBlock =\n language === 'objc'\n ? findObjcFunctionCodeBlock(srcContents, selector)\n : findSwiftFunctionCodeBlock(srcContents, selector);\n if (!codeBlock) {\n return srcContents;\n }\n\n const { position } = options;\n const indent = ' '.repeat(options.indent ?? 2);\n\n if (position === 'head') {\n srcContents = insertContentsAtOffset(\n srcContents,\n `\\n${indent}${insertion}`,\n codeBlock.start + 1\n );\n } else if (position === 'tail') {\n srcContents = insertContentsAtOffset(srcContents, `\\n${indent}${insertion}`, codeBlock.end - 1);\n } else if (position === 'tailBeforeLastReturn') {\n let lastReturnIndex = srcContents.lastIndexOf(' return ', codeBlock.end);\n if (lastReturnIndex < 0) {\n throw new Error(`Cannot find last return statement:\\n${srcContents}`);\n }\n lastReturnIndex += 1; // +1 for the prefix space\n srcContents = insertContentsAtOffset(srcContents, `${insertion}\\n${indent}`, lastReturnIndex);\n }\n\n return srcContents;\n}\n"],"file":"codeMod.js"}
1
+ {"version":3,"file":"codeMod.js","names":["addObjcImports","source","imports","lines","split","lineIndexWithFirstImport","findIndex","line","match","importElement","includes","importStatement","splice","join","findObjcInterfaceCodeBlock","contents","declaration","start","search","RegExp","end","indexOf","code","substring","findObjcFunctionCodeBlock","selector","symbols","argsCount","length","pattern","i","argSymbol","findMatchingBracketPosition","insertContentsInsideObjcFunctionBlock","srcContents","insertion","options","insertContentsInsideFunctionBlock","insertContentsInsideObjcInterfaceBlock","codeBlock","position","firstNewLineIndex","insertContentsAtOffset","endLen","findSwiftFunctionCodeBlock","parenthesesIndex","funcName","argLabels","searchOffset","funcCandidateRegExp","funcCandidateOffset","searchFromOffset","paramsStartOffset","paramsEndOffset","paramsString","params","map","parseSwiftFunctionParam","argumentLabel","codeBlockStart","codeBlockEnd","paramTuple","semiIndex","parameterName","typeString","trim","insertContentsInsideSwiftClassBlock","Error","firstBracketIndex","endBracketIndex","insertContentsInsideSwiftFunctionBlock","language","indent","repeat","lastReturnIndex","lastIndexOf"],"sources":["../../src/ios/codeMod.ts"],"sourcesContent":["import { CodeBlock, insertContentsAtOffset, searchFromOffset } from '../utils/commonCodeMod';\nimport { findMatchingBracketPosition } from '../utils/matchBrackets';\n\ninterface SwiftFunctionParam {\n argumentLabel: string;\n parameterName: string;\n typeString: string;\n}\n\ninterface InsertContentFunctionOptions {\n position: 'head' | 'tail' | 'tailBeforeLastReturn';\n indent?: number;\n}\n\n/**\n * Add Objective-C import\n * @param source source contents\n * @param imports array of imports, e.g. ['<Foundation/Foundation.h>']\n * @returns updated contents\n */\nexport function addObjcImports(source: string, imports: string[]): string {\n const lines = source.split('\\n');\n // Try to insert statements after first #import where would probably not in #if block\n const lineIndexWithFirstImport = lines.findIndex((line) => line.match(/^#import .*$/));\n for (const importElement of imports) {\n if (!source.includes(importElement)) {\n const importStatement = `#import ${importElement}`;\n lines.splice(lineIndexWithFirstImport + 1, 0, importStatement);\n }\n }\n return lines.join('\\n');\n}\n\n/**\n * Find code block of Objective-C interface or implementation\n *\n * @param contents source contents\n * @param declaration interface/implementation, e.g. '@interface Foo'\n * @returns found CodeBlock, or null if not found\n */\nexport function findObjcInterfaceCodeBlock(\n contents: string,\n declaration: string\n): CodeBlock | null {\n const start = contents.search(new RegExp(`^${declaration}\\\\W`, 'm'));\n if (start < 0) {\n return null;\n }\n\n let end = contents.indexOf('\\n@end', start);\n end += 5; // '\\n@end'.length === 5\n\n return {\n start,\n end,\n code: contents.substring(start, end),\n };\n}\n\n/**\n * Find code block of Objective-C function without declaration, will return only {} block\n *\n * @param contents source contents\n * @param selector function selector, e.g. 'doSomething:withSomeValue:'\n * @returns found CodeBlock, or null if not found.\n */\nexport function findObjcFunctionCodeBlock(contents: string, selector: string): CodeBlock | null {\n const symbols = selector.split(':');\n const argsCount = symbols.length - 1;\n let pattern = '^[\\\\-+]\\\\s*\\\\(.+?\\\\)';\n if (argsCount === 0) {\n pattern += `${symbols[0]}\\\\s+`;\n } else {\n for (let i = 0; i < argsCount; ++i) {\n const argSymbol = `${symbols[i]}:\\\\(.+\\\\)\\\\w+`;\n pattern += `${argSymbol}\\\\s+`;\n }\n }\n pattern += '{';\n let start = contents.search(new RegExp(pattern, 'm'));\n if (start < 0) {\n return null;\n }\n start = contents.indexOf('{', start);\n\n const end = findMatchingBracketPosition(contents, '{', start);\n return {\n start,\n end,\n code: contents.substring(start, end + 1),\n };\n}\n\n/**\n * Insert contents to the Objective-C function block\n *\n * @param srcContents source contents\n * @param selector function selector, e.g. 'doSomething:withSomeValue:'\n * @param insertion code to insert\n * @param options insertion options\n * @returns updated contents\n */\nexport function insertContentsInsideObjcFunctionBlock(\n srcContents: string,\n selector: string,\n insertion: string,\n options: InsertContentFunctionOptions\n): string {\n return insertContentsInsideFunctionBlock(srcContents, selector, insertion, options, 'objc');\n}\n\n/**\n * Insert contents to the Objective-C interface/implementation block\n *\n * @param srcContents source contents\n * @param declaration interface/implementation, e.g. '@interface Foo'\n * @param insertion code to insert\n * @param options insertion options\n * @returns updated contents\n */\nexport function insertContentsInsideObjcInterfaceBlock(\n srcContents: string,\n declaration: string,\n insertion: string,\n options: {\n position: 'head' | 'tail';\n }\n): string {\n const codeBlock = findObjcInterfaceCodeBlock(srcContents, declaration);\n if (!codeBlock) {\n return srcContents;\n }\n\n const { position } = options;\n if (position === 'head') {\n const firstNewLineIndex = srcContents.indexOf('\\n', codeBlock.start);\n srcContents = insertContentsAtOffset(srcContents, insertion, firstNewLineIndex);\n } else if (position === 'tail') {\n const endLen = '@end'.length;\n srcContents = insertContentsAtOffset(srcContents, insertion, codeBlock.end - endLen);\n }\n return srcContents;\n}\n\n/**\n * Find code block of Swift function without declaration, will return only {} block\n *\n * @param contents source contents\n * @param selector function selector, e.g. 'doSomething(_:withSomeValue:)'\n * @returns found CodeBlock, or null if not found.\n */\nexport function findSwiftFunctionCodeBlock(contents: string, selector: string): CodeBlock | null {\n const parenthesesIndex = selector.indexOf('(');\n // `functName` === 'doSomething' of 'doSomething(_:withSomeValue:)'\n const funcName = selector.substring(0, parenthesesIndex);\n // `argLabels` === ['_', 'withSomeValue'] 'doSomething(_:withSomeValue:)'\n const argLabels = selector.substring(parenthesesIndex + 1, selector.length - 2).split(':');\n\n let searchOffset = 0;\n const funcCandidateRegExp = new RegExp(`\\\\sfunc\\\\s+${funcName}\\\\(`, 'm');\n let funcCandidateOffset = searchFromOffset(contents, funcCandidateRegExp, searchOffset);\n while (funcCandidateOffset >= 0) {\n // Parse function parameters\n const paramsStartOffset = contents.indexOf('(', funcCandidateOffset);\n const paramsEndOffset = findMatchingBracketPosition(contents, '(', paramsStartOffset);\n const paramsString = contents.substring(paramsStartOffset + 1, paramsEndOffset);\n const params = paramsString.split(',').map(parseSwiftFunctionParam);\n\n // Prepare offset for next round\n searchOffset = paramsEndOffset + 1;\n funcCandidateOffset = searchFromOffset(contents, funcCandidateRegExp, searchOffset);\n\n // Try to match function parameters\n if (argLabels.length !== params.length) {\n continue;\n }\n for (let i = 0; i < argLabels.length; ++i) {\n if (argLabels[i] !== params[i].argumentLabel) {\n continue;\n }\n }\n\n // This function is matched one, get the code block.\n const codeBlockStart = contents.indexOf('{', paramsEndOffset);\n const codeBlockEnd = findMatchingBracketPosition(contents, '{', paramsEndOffset);\n const codeBlock = contents.substring(codeBlockStart, codeBlockEnd + 1);\n return {\n start: codeBlockStart,\n end: codeBlockEnd,\n code: codeBlock,\n };\n }\n\n return null;\n}\n\nfunction parseSwiftFunctionParam(paramTuple: string): SwiftFunctionParam {\n const semiIndex = paramTuple.indexOf(':');\n const [argumentLabel, parameterName] = paramTuple.substring(0, semiIndex).split(/\\s+/);\n const typeString = paramTuple.substring(semiIndex + 1).trim();\n return {\n argumentLabel,\n parameterName,\n typeString,\n };\n}\n\n/**\n * Insert contents to the swift class block\n *\n * @param srcContents source contents\n * @param declaration class/extension declaration, e.g. 'class AppDelegate'\n * @param insertion code to append\n * @param options insertion options\n * @returns updated contents\n */\nexport function insertContentsInsideSwiftClassBlock(\n srcContents: string,\n declaration: string,\n insertion: string,\n options: {\n position: 'head' | 'tail';\n }\n): string {\n const start = srcContents.search(new RegExp(`\\\\s*${declaration}.*?[\\\\(\\\\{]`));\n if (start < 0) {\n throw new Error(`Unable to find class code block - declaration[${declaration}]`);\n }\n\n const { position } = options;\n if (position === 'head') {\n const firstBracketIndex = srcContents.indexOf('{', start);\n srcContents = insertContentsAtOffset(srcContents, insertion, firstBracketIndex + 1);\n } else if (position === 'tail') {\n const endBracketIndex = findMatchingBracketPosition(srcContents, '{', start);\n srcContents = insertContentsAtOffset(srcContents, insertion, endBracketIndex);\n }\n return srcContents;\n}\n\n/**\n * Insert contents to the Swift function block\n *\n * @param srcContents source contents\n * @param selector function selector, e.g. 'doSomething:withSomeValue:'\n * @param insertion code to insert\n * @param options insertion options\n * @returns updated contents\n */\nexport function insertContentsInsideSwiftFunctionBlock(\n srcContents: string,\n selector: string,\n insertion: string,\n options: InsertContentFunctionOptions\n): string {\n return insertContentsInsideFunctionBlock(srcContents, selector, insertion, options, 'swift');\n}\n\nfunction insertContentsInsideFunctionBlock(\n srcContents: string,\n selector: string,\n insertion: string,\n options: InsertContentFunctionOptions,\n language: 'objc' | 'swift'\n): string {\n const codeBlock =\n language === 'objc'\n ? findObjcFunctionCodeBlock(srcContents, selector)\n : findSwiftFunctionCodeBlock(srcContents, selector);\n if (!codeBlock) {\n return srcContents;\n }\n\n const { position } = options;\n const indent = ' '.repeat(options.indent ?? 2);\n\n if (position === 'head') {\n srcContents = insertContentsAtOffset(\n srcContents,\n `\\n${indent}${insertion}`,\n codeBlock.start + 1\n );\n } else if (position === 'tail') {\n srcContents = insertContentsAtOffset(srcContents, `\\n${indent}${insertion}`, codeBlock.end - 1);\n } else if (position === 'tailBeforeLastReturn') {\n let lastReturnIndex = srcContents.lastIndexOf(' return ', codeBlock.end);\n if (lastReturnIndex < 0) {\n throw new Error(`Cannot find last return statement:\\n${srcContents}`);\n }\n lastReturnIndex += 1; // +1 for the prefix space\n srcContents = insertContentsAtOffset(srcContents, `${insertion}\\n${indent}`, lastReturnIndex);\n }\n\n return srcContents;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CAAwBC,MAAxB,EAAwCC,OAAxC,EAAmE;EACxE,MAAMC,KAAK,GAAGF,MAAM,CAACG,KAAP,CAAa,IAAb,CAAd,CADwE,CAExE;;EACA,MAAMC,wBAAwB,GA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;;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","sourcesContent":["import * as Bitcode from './Bitcode';\nimport * as BuildProperties from './BuildProperties';\nimport * as BuildScheme from './BuildScheme';\nimport * as BundleIdentifier from './BundleIdentifier';\nimport * as DeviceFamily from './DeviceFamily';\nimport * as Entitlements from './Entitlements';\nimport * as Google from './Google';\nimport { ExpoPlist, InfoPlist } from './IosConfig.types';\nimport * as Locales from './Locales';\nimport * as Maps from './Maps';\nimport * as Name from './Name';\nimport * as Orientation from './Orientation';\nimport * as Paths from './Paths';\nimport * as Permissions from './Permissions';\nimport * as ProvisioningProfile from './ProvisioningProfile';\nimport * as RequiresFullScreen from './RequiresFullScreen';\nimport * as Scheme from './Scheme';\nimport * as Swift from './Swift';\nimport * as Target from './Target';\nimport * as Updates from './Updates';\nimport * as UsesNonExemptEncryption from './UsesNonExemptEncryption';\nimport * as Version from './Version';\nimport * as XcodeProjectFile from './XcodeProjectFile';\nimport * as XcodeUtils from './utils/Xcodeproj';\n\n// We can change this to export * as X with TypeScript 3.8+\n// https://devblogs.microsoft.com/typescript/announcing-typescript-3-8-beta/#export-star-as-namespace-syntax\n// .. but we should wait for this to be the default VSCode version.\nexport { InfoPlist, ExpoPlist, Entitlements, Paths, Permissions, XcodeUtils };\n\nexport {\n Bitcode,\n BundleIdentifier,\n BuildProperties,\n BuildScheme,\n DeviceFamily,\n Google,\n Maps,\n Locales,\n Name,\n Orientation,\n ProvisioningProfile,\n RequiresFullScreen,\n Scheme,\n Swift,\n Target,\n Updates,\n UsesNonExemptEncryption,\n Version,\n XcodeProjectFile,\n};\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/ios/index.ts"],"sourcesContent":["import * as Bitcode from './Bitcode';\nimport * as BuildProperties from './BuildProperties';\nimport * as BuildScheme from './BuildScheme';\nimport * as BundleIdentifier from './BundleIdentifier';\nimport * as DeviceFamily from './DeviceFamily';\nimport * as Entitlements from './Entitlements';\nimport * as Google from './Google';\nimport { ExpoPlist, InfoPlist } from './IosConfig.types';\nimport * as Locales from './Locales';\nimport * as Maps from './Maps';\nimport * as Name from './Name';\nimport * as Orientation from './Orientation';\nimport * as Paths from './Paths';\nimport * as Permissions from './Permissions';\nimport * as ProvisioningProfile from './ProvisioningProfile';\nimport * as RequiresFullScreen from './RequiresFullScreen';\nimport * as Scheme from './Scheme';\nimport * as Swift from './Swift';\nimport * as Target from './Target';\nimport * as Updates from './Updates';\nimport * as UsesNonExemptEncryption from './UsesNonExemptEncryption';\nimport * as Version from './Version';\nimport * as XcodeProjectFile from './XcodeProjectFile';\nimport * as XcodeUtils from './utils/Xcodeproj';\n\n// We can change this to export * as X with TypeScript 3.8+\n// https://devblogs.microsoft.com/typescript/announcing-typescript-3-8-beta/#export-star-as-namespace-syntax\n// .. but we should wait for this to be the default VSCode version.\nexport { InfoPlist, ExpoPlist, Entitlements, Paths, Permissions, XcodeUtils };\n\nexport {\n Bitcode,\n BundleIdentifier,\n BuildProperties,\n BuildScheme,\n DeviceFamily,\n Google,\n Maps,\n Locales,\n Name,\n Orientation,\n ProvisioningProfile,\n RequiresFullScreen,\n Scheme,\n Swift,\n Target,\n Updates,\n UsesNonExemptEncryption,\n Version,\n XcodeProjectFile,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA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