@expo/config-plugins 4.0.6 → 4.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +14 -0
  2. package/build/Plugin.types.js +6 -6
  3. package/build/android/AllowBackup.js +1 -1
  4. package/build/android/Colors.js +3 -3
  5. package/build/android/EasBuild.js +1 -1
  6. package/build/android/GoogleServices.js +3 -3
  7. package/build/android/IntentFilters.js +1 -1
  8. package/build/android/JsEngine.js +2 -1
  9. package/build/android/JsEngine.js.map +1 -1
  10. package/build/android/Manifest.js +10 -10
  11. package/build/android/Name.d.ts +2 -1
  12. package/build/android/Name.js +7 -4
  13. package/build/android/Name.js.map +1 -1
  14. package/build/android/Orientation.js +2 -1
  15. package/build/android/Orientation.js.map +1 -1
  16. package/build/android/Package.js +4 -4
  17. package/build/android/Package.js.map +1 -1
  18. package/build/android/Paths.js +9 -9
  19. package/build/android/Permissions.js +6 -6
  20. package/build/android/Resources.js +5 -5
  21. package/build/android/Scheme.js +3 -3
  22. package/build/android/StatusBar.js +3 -3
  23. package/build/android/Strings.js +1 -1
  24. package/build/android/Styles.js +5 -5
  25. package/build/android/Updates.d.ts +0 -5
  26. package/build/android/Updates.js +14 -23
  27. package/build/android/Updates.js.map +1 -1
  28. package/build/android/Version.js +2 -2
  29. package/build/android/WindowSoftInputMode.js +1 -1
  30. package/build/android/codeMod.js +2 -2
  31. package/build/android/index.d.ts +1 -3
  32. package/build/android/index.js +1 -35
  33. package/build/android/index.js.map +1 -1
  34. package/build/index.d.ts +1 -1
  35. package/build/index.js +57 -49
  36. package/build/index.js.map +1 -1
  37. package/build/ios/Bitcode.js +1 -1
  38. package/build/ios/BuildScheme.js +2 -2
  39. package/build/ios/BundleIdentifier.js +3 -3
  40. package/build/ios/DeviceFamily.js +3 -3
  41. package/build/ios/Entitlements.js +2 -2
  42. package/build/ios/Entitlements.js.map +1 -1
  43. package/build/ios/Google.js +2 -2
  44. package/build/ios/JsEngine.d.ts +2 -1
  45. package/build/ios/JsEngine.js +2 -1
  46. package/build/ios/JsEngine.js.map +1 -1
  47. package/build/ios/Locales.js +1 -1
  48. package/build/ios/Maps.js +29 -8
  49. package/build/ios/Maps.js.map +1 -1
  50. package/build/ios/Orientation.js +2 -1
  51. package/build/ios/Orientation.js.map +1 -1
  52. package/build/ios/Paths.js +14 -14
  53. package/build/ios/Paths.js.map +1 -1
  54. package/build/ios/Permissions.js +1 -1
  55. package/build/ios/Permissions.js.map +1 -1
  56. package/build/ios/Scheme.js +4 -4
  57. package/build/ios/Swift.js +2 -2
  58. package/build/ios/Target.js +5 -5
  59. package/build/ios/Updates.d.ts +0 -5
  60. package/build/ios/Updates.js +14 -23
  61. package/build/ios/Updates.js.map +1 -1
  62. package/build/ios/Version.js +3 -3
  63. package/build/ios/codeMod.js +2 -2
  64. package/build/ios/index.d.ts +1 -3
  65. package/build/ios/index.js +3 -35
  66. package/build/ios/index.js.map +1 -1
  67. package/build/ios/utils/Xcodeproj.js +9 -9
  68. package/build/plugins/android-plugins.js +1 -1
  69. package/build/plugins/createBaseMod.js +2 -2
  70. package/build/plugins/createBaseMod.js.map +1 -1
  71. package/build/plugins/ios-plugins.d.ts +2 -2
  72. package/build/plugins/ios-plugins.js +2 -2
  73. package/build/plugins/ios-plugins.js.map +1 -1
  74. package/build/plugins/mod-compiler.js +3 -3
  75. package/build/plugins/mod-compiler.js.map +1 -1
  76. package/build/plugins/withAndroidBaseMods.js +1 -1
  77. package/build/plugins/withIosBaseMods.d.ts +3 -3
  78. package/build/plugins/withIosBaseMods.js +1 -1
  79. package/build/plugins/withIosBaseMods.js.map +1 -1
  80. package/build/plugins/withStaticPlugin.js +16 -5
  81. package/build/plugins/withStaticPlugin.js.map +1 -1
  82. package/build/utils/Updates.d.ts +1 -0
  83. package/build/utils/Updates.js +24 -1
  84. package/build/utils/Updates.js.map +1 -1
  85. package/build/utils/XML.d.ts +6 -0
  86. package/build/utils/XML.js +57 -10
  87. package/build/utils/XML.js.map +1 -1
  88. package/build/utils/errors.js +1 -1
  89. package/build/utils/generateCode.js +2 -2
  90. package/build/utils/history.js +1 -1
  91. package/build/utils/modules.js +1 -1
  92. package/build/utils/plugin-resolver.js +4 -4
  93. package/build/utils/sortObject.js +2 -2
  94. package/build/utils/warnings.js +1 -1
  95. package/package.json +3 -3
  96. package/build/android/RootViewBackgroundColor.d.ts +0 -6
  97. package/build/android/RootViewBackgroundColor.js +0 -81
  98. package/build/android/RootViewBackgroundColor.js.map +0 -1
  99. package/build/android/UserInterfaceStyle.d.ts +0 -10
  100. package/build/android/UserInterfaceStyle.js +0 -119
  101. package/build/android/UserInterfaceStyle.js.map +0 -1
  102. package/build/ios/RootViewBackgroundColor.d.ts +0 -6
  103. package/build/ios/RootViewBackgroundColor.js +0 -70
  104. package/build/ios/RootViewBackgroundColor.js.map +0 -1
  105. package/build/ios/UserInterfaceStyle.d.ts +0 -5
  106. package/build/ios/UserInterfaceStyle.js +0 -59
  107. package/build/ios/UserInterfaceStyle.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/android/Updates.ts"],"names":["CREATE_MANIFEST_ANDROID_PATH","Config","withUpdates","config","expoUsername","modResults","setUpdatesConfig","getRuntimeVersionNullable","e","getSDKVersion","sdkVersion","getUpdatesEnabled","updates","enabled","getUpdatesTimeout","fallbackToCacheTimeout","getUpdatesCheckOnLaunch","checkAutomatically","androidManifest","username","mainApplication","ENABLED","String","CHECK_ON_LAUNCH","LAUNCH_WAIT_MS","updateUrl","UPDATE_URL","setVersionsConfig","runtimeVersion","SDK_VERSION","RUNTIME_VERSION","ensureBuildGradleContainsConfigurationScript","projectRoot","buildGradleContents","isBuildGradleConfigured","cleanedUpBuildGradleContents","isBuildGradleMisconfigured","split","some","line","includes","replace","RegExp","gradleScriptApply","formatApplyLineForBuildGradle","updatesGradleScriptPath","resolveFrom","silent","Error","relativePath","path","relative","join","posixPath","process","platform","androidBuildScript","isMainApplicationMetaDataSet","Boolean","isMainApplicationMetaDataSynced","areVersionsSynced","expectedRuntimeVersion","expectedSdkVersion","currentRuntimeVersion","currentSdkVersion"],"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;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAQA,MAAMA,4BAA4B,GAAG,qDAArC;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;GAAAA,M,sBAAAA,M;;AAWL,MAAMC,WAA0D,GAAG,CACxEC,MADwE,EAExE;AAAEC,EAAAA;AAAF,CAFwE,KAGrE;AACH,SAAO,2CAAoBD,MAApB,EAA4BA,MAAM,IAAI;AAC3CA,IAAAA,MAAM,CAACE,UAAP,GAAoBC,gBAAgB,CAACH,MAAD,EAASA,MAAM,CAACE,UAAhB,EAA4BD,YAA5B,CAApC;AACA,WAAOD,MAAP;AACD,GAHM,CAAP;AAID,CARM;AAUP;AACA;AACA;AACA;;;;;AACO,SAASI,yBAAT,CACLJ,MADK,EAEU;AACf,MAAI;AACF,WAAO,kCAAkBA,MAAlB,EAA0B,SAA1B,CAAP;AACD,GAFD,CAEE,OAAOK,CAAP,EAAU;AACV,WAAO,IAAP;AACD;AACF;;AAEM,SAASC,aAAT,CAAuBN,MAAvB,EAAqF;AAC1F,SAAO,OAAOA,MAAM,CAACO,UAAd,KAA6B,QAA7B,GAAwCP,MAAM,CAACO,UAA/C,GAA4D,IAAnE;AACD;;AAEM,SAASC,iBAAT,CAA2BR,MAA3B,EAAgF;AAAA;;AACrF,SAAO,oBAAAA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\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withAndroidManifest } from '../plugins/android-plugins';\nimport { ExpoConfigUpdates, getRuntimeVersion, getUpdateUrl } from '../utils/Updates';\nimport {\n addMetaDataItemToMainApplication,\n AndroidManifest,\n getMainApplicationMetaDataValue,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n} from './Manifest';\n\nconst CREATE_MANIFEST_ANDROID_PATH = 'expo-updates/scripts/create-manifest-android.gradle';\n\nexport enum Config {\n ENABLED = 'expo.modules.updates.ENABLED',\n CHECK_ON_LAUNCH = 'expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH',\n LAUNCH_WAIT_MS = 'expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS',\n SDK_VERSION = 'expo.modules.updates.EXPO_SDK_VERSION',\n RUNTIME_VERSION = 'expo.modules.updates.EXPO_RUNTIME_VERSION',\n UPDATE_URL = 'expo.modules.updates.EXPO_UPDATE_URL',\n RELEASE_CHANNEL = 'expo.modules.updates.EXPO_RELEASE_CHANNEL',\n UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY = 'expo.modules.updates.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY',\n}\n\nexport const withUpdates: ConfigPlugin<{ expoUsername: string | null }> = (\n config,\n { expoUsername }\n) => {\n return withAndroidManifest(config, config => {\n config.modResults = setUpdatesConfig(config, config.modResults, expoUsername);\n return config;\n });\n};\n\n/**\n * runtime version maybe null in projects using classic updates. In that\n * case we use SDK version\n */\nexport function getRuntimeVersionNullable(\n config: Pick<ExpoConfigUpdates, 'runtimeVersion'>\n): string | null {\n try {\n return getRuntimeVersion(config, 'android');\n } catch (e) {\n return null;\n }\n}\n\nexport function getSDKVersion(config: Pick<ExpoConfigUpdates, 'sdkVersion'>): string | null {\n return typeof config.sdkVersion === 'string' ? config.sdkVersion : null;\n}\n\nexport function getUpdatesEnabled(config: Pick<ExpoConfigUpdates, 'updates'>): boolean {\n return config.updates?.enabled !== false;\n}\n\nexport function getUpdatesTimeout(config: Pick<ExpoConfigUpdates, 'updates'>): number {\n return config.updates?.fallbackToCacheTimeout ?? 0;\n}\n\nexport function getUpdatesCheckOnLaunch(\n config: Pick<ExpoConfigUpdates, 'updates'>\n): 'NEVER' | 'ALWAYS' {\n if (config.updates?.checkAutomatically === 'ON_ERROR_RECOVERY') {\n return 'NEVER';\n } else if (config.updates?.checkAutomatically === 'ON_LOAD') {\n return 'ALWAYS';\n }\n return 'ALWAYS';\n}\n\nexport function setUpdatesConfig(\n config: ExpoConfigUpdates,\n androidManifest: AndroidManifest,\n username: string | null\n): AndroidManifest {\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n addMetaDataItemToMainApplication(\n mainApplication,\n Config.ENABLED,\n String(getUpdatesEnabled(config))\n );\n addMetaDataItemToMainApplication(\n mainApplication,\n Config.CHECK_ON_LAUNCH,\n getUpdatesCheckOnLaunch(config)\n );\n addMetaDataItemToMainApplication(\n mainApplication,\n Config.LAUNCH_WAIT_MS,\n String(getUpdatesTimeout(config))\n );\n\n const updateUrl = getUpdateUrl(config, username);\n if (updateUrl) {\n addMetaDataItemToMainApplication(mainApplication, Config.UPDATE_URL, updateUrl);\n } else {\n removeMetaDataItemFromMainApplication(mainApplication, Config.UPDATE_URL);\n }\n\n return setVersionsConfig(config, androidManifest);\n}\n\nexport function setVersionsConfig(\n config: Pick<ExpoConfigUpdates, 'sdkVersion' | 'runtimeVersion'>,\n androidManifest: AndroidManifest\n): AndroidManifest {\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n const runtimeVersion = getRuntimeVersionNullable(config);\n const sdkVersion = getSDKVersion(config);\n if (runtimeVersion) {\n removeMetaDataItemFromMainApplication(mainApplication, Config.SDK_VERSION);\n addMetaDataItemToMainApplication(mainApplication, Config.RUNTIME_VERSION, runtimeVersion);\n } else if (sdkVersion) {\n removeMetaDataItemFromMainApplication(mainApplication, Config.RUNTIME_VERSION);\n addMetaDataItemToMainApplication(mainApplication, Config.SDK_VERSION, sdkVersion);\n } else {\n removeMetaDataItemFromMainApplication(mainApplication, Config.RUNTIME_VERSION);\n removeMetaDataItemFromMainApplication(mainApplication, Config.SDK_VERSION);\n }\n\n return androidManifest;\n}\nexport function ensureBuildGradleContainsConfigurationScript(\n projectRoot: string,\n buildGradleContents: string\n): string {\n if (!isBuildGradleConfigured(projectRoot, buildGradleContents)) {\n let cleanedUpBuildGradleContents;\n\n const isBuildGradleMisconfigured = buildGradleContents\n .split('\\n')\n .some(line => line.includes(CREATE_MANIFEST_ANDROID_PATH));\n if (isBuildGradleMisconfigured) {\n cleanedUpBuildGradleContents = buildGradleContents.replace(\n new RegExp(`(\\n// Integration with Expo updates)?\\n.*${CREATE_MANIFEST_ANDROID_PATH}.*\\n`),\n ''\n );\n } else {\n cleanedUpBuildGradleContents = buildGradleContents;\n }\n\n const gradleScriptApply = formatApplyLineForBuildGradle(projectRoot);\n return `${cleanedUpBuildGradleContents}\\n// Integration with Expo updates\\n${gradleScriptApply}\\n`;\n } else {\n return buildGradleContents;\n }\n}\n\nexport function formatApplyLineForBuildGradle(projectRoot: string): string {\n const updatesGradleScriptPath = resolveFrom.silent(projectRoot, CREATE_MANIFEST_ANDROID_PATH);\n\n if (!updatesGradleScriptPath) {\n throw new Error(\n \"Could not find the build script for Android. 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(\n path.join(projectRoot, 'android', 'app'),\n updatesGradleScriptPath\n );\n const posixPath = process.platform === 'win32' ? relativePath.replace(/\\\\/g, '/') : relativePath;\n\n return `apply from: \"${posixPath}\"`;\n}\n\nexport function isBuildGradleConfigured(projectRoot: string, buildGradleContents: string): boolean {\n const androidBuildScript = formatApplyLineForBuildGradle(projectRoot);\n\n return (\n buildGradleContents\n .replace(/\\r\\n/g, '\\n')\n .split('\\n')\n // Check for both single and double quotes\n .some(line => line === androidBuildScript || line === androidBuildScript.replace(/\"/g, \"'\"))\n );\n}\n\nexport function isMainApplicationMetaDataSet(androidManifest: AndroidManifest): boolean {\n const updateUrl = getMainApplicationMetaDataValue(androidManifest, Config.UPDATE_URL);\n const runtimeVersion = getMainApplicationMetaDataValue(androidManifest, Config.RUNTIME_VERSION);\n const sdkVersion = getMainApplicationMetaDataValue(androidManifest, Config.SDK_VERSION);\n\n return Boolean(updateUrl && (sdkVersion || runtimeVersion));\n}\n\nexport function isMainApplicationMetaDataSynced(\n config: ExpoConfigUpdates,\n androidManifest: AndroidManifest,\n username: string | null\n): boolean {\n return (\n getUpdateUrl(config, username) ===\n getMainApplicationMetaDataValue(androidManifest, Config.UPDATE_URL) &&\n String(getUpdatesEnabled(config)) ===\n getMainApplicationMetaDataValue(androidManifest, Config.ENABLED) &&\n String(getUpdatesTimeout(config)) ===\n getMainApplicationMetaDataValue(androidManifest, Config.LAUNCH_WAIT_MS) &&\n getUpdatesCheckOnLaunch(config) ===\n getMainApplicationMetaDataValue(androidManifest, Config.CHECK_ON_LAUNCH) &&\n areVersionsSynced(config, androidManifest)\n );\n}\n\nexport function areVersionsSynced(\n config: Pick<ExpoConfigUpdates, 'runtimeVersion' | 'sdkVersion'>,\n androidManifest: AndroidManifest\n): boolean {\n const expectedRuntimeVersion = getRuntimeVersionNullable(config);\n const expectedSdkVersion = getSDKVersion(config);\n\n const currentRuntimeVersion = getMainApplicationMetaDataValue(\n androidManifest,\n Config.RUNTIME_VERSION\n );\n const currentSdkVersion = getMainApplicationMetaDataValue(androidManifest, Config.SDK_VERSION);\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,"sources":["../../src/android/Updates.ts"],"names":["CREATE_MANIFEST_ANDROID_PATH","Config","withUpdates","config","expoUsername","modResults","setUpdatesConfig","getSDKVersion","sdkVersion","getUpdatesEnabled","updates","enabled","getUpdatesTimeout","fallbackToCacheTimeout","getUpdatesCheckOnLaunch","checkAutomatically","androidManifest","username","mainApplication","ENABLED","String","CHECK_ON_LAUNCH","LAUNCH_WAIT_MS","updateUrl","UPDATE_URL","setVersionsConfig","runtimeVersion","SDK_VERSION","RUNTIME_VERSION","ensureBuildGradleContainsConfigurationScript","projectRoot","buildGradleContents","isBuildGradleConfigured","cleanedUpBuildGradleContents","isBuildGradleMisconfigured","split","some","line","includes","replace","RegExp","gradleScriptApply","formatApplyLineForBuildGradle","updatesGradleScriptPath","resolveFrom","silent","Error","relativePath","path","relative","join","posixPath","process","platform","androidBuildScript","isMainApplicationMetaDataSet","Boolean","isMainApplicationMetaDataSynced","areVersionsSynced","expectedRuntimeVersion","expectedSdkVersion","currentRuntimeVersion","currentSdkVersion"],"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;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAQA,MAAMA,4BAA4B,GAAG,qDAArC;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;GAAAA,M,sBAAAA,M;;AAWL,MAAMC,WAA0D,GAAG,CACxEC,MADwE,EAExE;AAAEC,EAAAA;AAAF,CAFwE,KAGrE;AACH,SAAO,2CAAoBD,MAApB,EAA4BA,MAAM,IAAI;AAC3CA,IAAAA,MAAM,CAACE,UAAP,GAAoBC,gBAAgB,CAACH,MAAD,EAASA,MAAM,CAACE,UAAhB,EAA4BD,YAA5B,CAApC;AACA,WAAOD,MAA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C,WAAOE,qBAAqB,KAAKF,sBAA1B,IAAoDG,iBAAiB,KAAK,IAAjF;AACD,GAFD,MAEO,IAAIF,kBAAkB,KAAK,IAA3B,EAAiC;AACtC,WAAOE,iBAAiB,KAAKF,kBAAtB,IAA4CC,qBAAqB,KAAK,IAA7E;AACD,GAFM,MAEA;AACL,WAAO,IAAP;AACD;AACF","sourcesContent":["import path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withAndroidManifest } from '../plugins/android-plugins';\nimport { ExpoConfigUpdates, getRuntimeVersionNullable, getUpdateUrl } from '../utils/Updates';\nimport {\n addMetaDataItemToMainApplication,\n AndroidManifest,\n getMainApplicationMetaDataValue,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n} from './Manifest';\n\nconst CREATE_MANIFEST_ANDROID_PATH = 'expo-updates/scripts/create-manifest-android.gradle';\n\nexport enum Config {\n ENABLED = 'expo.modules.updates.ENABLED',\n CHECK_ON_LAUNCH = 'expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH',\n LAUNCH_WAIT_MS = 'expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS',\n SDK_VERSION = 'expo.modules.updates.EXPO_SDK_VERSION',\n RUNTIME_VERSION = 'expo.modules.updates.EXPO_RUNTIME_VERSION',\n UPDATE_URL = 'expo.modules.updates.EXPO_UPDATE_URL',\n RELEASE_CHANNEL = 'expo.modules.updates.EXPO_RELEASE_CHANNEL',\n UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY = 'expo.modules.updates.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY',\n}\n\nexport const withUpdates: ConfigPlugin<{ expoUsername: string | null }> = (\n config,\n { expoUsername }\n) => {\n return withAndroidManifest(config, config => {\n config.modResults = setUpdatesConfig(config, config.modResults, expoUsername);\n return config;\n });\n};\n\nexport function getSDKVersion(config: Pick<ExpoConfigUpdates, 'sdkVersion'>): string | null {\n return typeof config.sdkVersion === 'string' ? config.sdkVersion : null;\n}\n\nexport function getUpdatesEnabled(config: Pick<ExpoConfigUpdates, 'updates'>): boolean {\n return config.updates?.enabled !== false;\n}\n\nexport function getUpdatesTimeout(config: Pick<ExpoConfigUpdates, 'updates'>): number {\n return config.updates?.fallbackToCacheTimeout ?? 0;\n}\n\nexport function getUpdatesCheckOnLaunch(\n config: Pick<ExpoConfigUpdates, 'updates'>\n): 'NEVER' | 'ALWAYS' {\n if (config.updates?.checkAutomatically === 'ON_ERROR_RECOVERY') {\n return 'NEVER';\n } else if (config.updates?.checkAutomatically === 'ON_LOAD') {\n return 'ALWAYS';\n }\n return 'ALWAYS';\n}\n\nexport function setUpdatesConfig(\n config: ExpoConfigUpdates,\n androidManifest: AndroidManifest,\n username: string | null\n): AndroidManifest {\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n addMetaDataItemToMainApplication(\n mainApplication,\n Config.ENABLED,\n String(getUpdatesEnabled(config))\n );\n addMetaDataItemToMainApplication(\n mainApplication,\n Config.CHECK_ON_LAUNCH,\n getUpdatesCheckOnLaunch(config)\n );\n addMetaDataItemToMainApplication(\n mainApplication,\n Config.LAUNCH_WAIT_MS,\n String(getUpdatesTimeout(config))\n );\n\n const updateUrl = getUpdateUrl(config, username);\n if (updateUrl) {\n addMetaDataItemToMainApplication(mainApplication, Config.UPDATE_URL, updateUrl);\n } else {\n removeMetaDataItemFromMainApplication(mainApplication, Config.UPDATE_URL);\n }\n\n return setVersionsConfig(config, androidManifest);\n}\n\nexport function setVersionsConfig(\n config: Pick<ExpoConfigUpdates, 'sdkVersion' | 'runtimeVersion'>,\n androidManifest: AndroidManifest\n): AndroidManifest {\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n const runtimeVersion = getRuntimeVersionNullable(config, 'android');\n const sdkVersion = getSDKVersion(config);\n if (runtimeVersion) {\n removeMetaDataItemFromMainApplication(mainApplication, Config.SDK_VERSION);\n addMetaDataItemToMainApplication(mainApplication, 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 removeMetaDataItemFromMainApplication(mainApplication, Config.RUNTIME_VERSION);\n addMetaDataItemToMainApplication(mainApplication, Config.SDK_VERSION, sdkVersion);\n } else {\n removeMetaDataItemFromMainApplication(mainApplication, Config.RUNTIME_VERSION);\n removeMetaDataItemFromMainApplication(mainApplication, Config.SDK_VERSION);\n }\n\n return androidManifest;\n}\nexport function ensureBuildGradleContainsConfigurationScript(\n projectRoot: string,\n buildGradleContents: string\n): string {\n if (!isBuildGradleConfigured(projectRoot, buildGradleContents)) {\n let cleanedUpBuildGradleContents;\n\n const isBuildGradleMisconfigured = buildGradleContents\n .split('\\n')\n .some(line => line.includes(CREATE_MANIFEST_ANDROID_PATH));\n if (isBuildGradleMisconfigured) {\n cleanedUpBuildGradleContents = buildGradleContents.replace(\n new RegExp(`(\\n// Integration with Expo updates)?\\n.*${CREATE_MANIFEST_ANDROID_PATH}.*\\n`),\n ''\n );\n } else {\n cleanedUpBuildGradleContents = buildGradleContents;\n }\n\n const gradleScriptApply = formatApplyLineForBuildGradle(projectRoot);\n return `${cleanedUpBuildGradleContents}\\n// Integration with Expo updates\\n${gradleScriptApply}\\n`;\n } else {\n return buildGradleContents;\n }\n}\n\nexport function formatApplyLineForBuildGradle(projectRoot: string): string {\n const updatesGradleScriptPath = resolveFrom.silent(projectRoot, CREATE_MANIFEST_ANDROID_PATH);\n\n if (!updatesGradleScriptPath) {\n throw new Error(\n \"Could not find the build script for Android. 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(\n path.join(projectRoot, 'android', 'app'),\n updatesGradleScriptPath\n );\n const posixPath = process.platform === 'win32' ? relativePath.replace(/\\\\/g, '/') : relativePath;\n\n return `apply from: \"${posixPath}\"`;\n}\n\nexport function isBuildGradleConfigured(projectRoot: string, buildGradleContents: string): boolean {\n const androidBuildScript = formatApplyLineForBuildGradle(projectRoot);\n\n return (\n buildGradleContents\n .replace(/\\r\\n/g, '\\n')\n .split('\\n')\n // Check for both single and double quotes\n .some(line => line === androidBuildScript || line === androidBuildScript.replace(/\"/g, \"'\"))\n );\n}\n\nexport function isMainApplicationMetaDataSet(androidManifest: AndroidManifest): boolean {\n const updateUrl = getMainApplicationMetaDataValue(androidManifest, Config.UPDATE_URL);\n const runtimeVersion = getMainApplicationMetaDataValue(androidManifest, Config.RUNTIME_VERSION);\n const sdkVersion = getMainApplicationMetaDataValue(androidManifest, Config.SDK_VERSION);\n\n return Boolean(updateUrl && (sdkVersion || runtimeVersion));\n}\n\nexport function isMainApplicationMetaDataSynced(\n config: ExpoConfigUpdates,\n androidManifest: AndroidManifest,\n username: string | null\n): boolean {\n return (\n getUpdateUrl(config, username) ===\n getMainApplicationMetaDataValue(androidManifest, Config.UPDATE_URL) &&\n String(getUpdatesEnabled(config)) ===\n getMainApplicationMetaDataValue(androidManifest, Config.ENABLED) &&\n String(getUpdatesTimeout(config)) ===\n getMainApplicationMetaDataValue(androidManifest, Config.LAUNCH_WAIT_MS) &&\n getUpdatesCheckOnLaunch(config) ===\n getMainApplicationMetaDataValue(androidManifest, Config.CHECK_ON_LAUNCH) &&\n areVersionsSynced(config, androidManifest)\n );\n}\n\nexport function areVersionsSynced(\n config: Pick<ExpoConfigUpdates, 'runtimeVersion' | 'sdkVersion'>,\n androidManifest: AndroidManifest\n): boolean {\n const expectedRuntimeVersion = getRuntimeVersionNullable(config, 'android');\n const expectedSdkVersion = getSDKVersion(config);\n\n const currentRuntimeVersion = getMainApplicationMetaDataValue(\n androidManifest,\n Config.RUNTIME_VERSION\n );\n const currentSdkVersion = getMainApplicationMetaDataValue(androidManifest, Config.SDK_VERSION);\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"}
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getVersionName = getVersionName;
7
- exports.setVersionName = setVersionName;
8
6
  exports.getVersionCode = getVersionCode;
7
+ exports.getVersionName = getVersionName;
9
8
  exports.setVersionCode = setVersionCode;
9
+ exports.setVersionName = setVersionName;
10
10
  exports.withVersion = void 0;
11
11
 
12
12
  function _androidPlugins() {
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.setWindowSoftInputModeMode = setWindowSoftInputModeMode;
7
6
  exports.getWindowSoftInputModeMode = getWindowSoftInputModeMode;
7
+ exports.setWindowSoftInputModeMode = setWindowSoftInputModeMode;
8
8
  exports.withWindowSoftInputMode = void 0;
9
9
 
10
10
  function _androidPlugins() {
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.findNewInstanceCodeBlock = findNewInstanceCodeBlock;
7
- exports.appendContentsInsideDeclarationBlock = appendContentsInsideDeclarationBlock;
8
6
  exports.addImports = addImports;
7
+ exports.appendContentsInsideDeclarationBlock = appendContentsInsideDeclarationBlock;
8
+ exports.findNewInstanceCodeBlock = findNewInstanceCodeBlock;
9
9
 
10
10
  function _commonCodeMod() {
11
11
  const data = require("../utils/commonCodeMod");
@@ -14,14 +14,12 @@ import * as Permissions from './Permissions';
14
14
  import * as PrimaryColor from './PrimaryColor';
15
15
  import * as Properties from './Properties';
16
16
  import * as Resources from './Resources';
17
- import * as RootViewBackgroundColor from './RootViewBackgroundColor';
18
17
  import * as Scheme from './Scheme';
19
18
  import * as StatusBar from './StatusBar';
20
19
  import * as Strings from './Strings';
21
20
  import * as Styles from './Styles';
22
21
  import * as Updates from './Updates';
23
- import * as UserInterfaceStyle from './UserInterfaceStyle';
24
22
  import * as Version from './Version';
25
23
  import * as WindowSoftInputMode from './WindowSoftInputMode';
26
24
  export { Manifest, Colors, Paths, Permissions, Properties, Resources, Scheme, Strings, Styles };
27
- export { AllowBackup, EasBuild, GoogleMapsApiKey, GoogleServices, IntentFilters, Name, Orientation, Package, PrimaryColor, RootViewBackgroundColor, StatusBar, Updates, UserInterfaceStyle, Version, JsEngine, WindowSoftInputMode, };
25
+ export { AllowBackup, EasBuild, GoogleMapsApiKey, GoogleServices, IntentFilters, Name, Orientation, Package, PrimaryColor, StatusBar, Updates, Version, JsEngine, WindowSoftInputMode, };
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.WindowSoftInputMode = exports.Version = exports.UserInterfaceStyle = exports.Updates = exports.Styles = exports.Strings = exports.StatusBar = exports.Scheme = exports.RootViewBackgroundColor = exports.Resources = exports.Properties = exports.PrimaryColor = exports.Permissions = exports.Paths = exports.Package = exports.Orientation = exports.Name = exports.Manifest = exports.JsEngine = exports.IntentFilters = exports.GoogleServices = exports.GoogleMapsApiKey = exports.EasBuild = exports.Colors = exports.AllowBackup = void 0;
6
+ exports.WindowSoftInputMode = exports.Version = exports.Updates = exports.Styles = exports.Strings = exports.StatusBar = exports.Scheme = exports.Resources = exports.Properties = exports.PrimaryColor = exports.Permissions = exports.Paths = exports.Package = exports.Orientation = exports.Name = exports.Manifest = exports.JsEngine = exports.IntentFilters = exports.GoogleServices = exports.GoogleMapsApiKey = exports.EasBuild = exports.Colors = exports.AllowBackup = void 0;
7
7
 
8
8
  function AllowBackup() {
9
9
  const data = _interopRequireWildcard(require("./AllowBackup"));
@@ -277,23 +277,6 @@ Object.defineProperty(exports, "Resources", {
277
277
  }
278
278
  });
279
279
 
280
- function RootViewBackgroundColor() {
281
- const data = _interopRequireWildcard(require("./RootViewBackgroundColor"));
282
-
283
- RootViewBackgroundColor = function () {
284
- return data;
285
- };
286
-
287
- return data;
288
- }
289
-
290
- Object.defineProperty(exports, "RootViewBackgroundColor", {
291
- enumerable: true,
292
- get: function () {
293
- return RootViewBackgroundColor();
294
- }
295
- });
296
-
297
280
  function Scheme() {
298
281
  const data = _interopRequireWildcard(require("./Scheme"));
299
282
 
@@ -379,23 +362,6 @@ Object.defineProperty(exports, "Updates", {
379
362
  }
380
363
  });
381
364
 
382
- function UserInterfaceStyle() {
383
- const data = _interopRequireWildcard(require("./UserInterfaceStyle"));
384
-
385
- UserInterfaceStyle = function () {
386
- return data;
387
- };
388
-
389
- return data;
390
- }
391
-
392
- Object.defineProperty(exports, "UserInterfaceStyle", {
393
- enumerable: true,
394
- get: function () {
395
- return UserInterfaceStyle();
396
- }
397
- });
398
-
399
365
  function Version() {
400
366
  const data = _interopRequireWildcard(require("./Version"));
401
367
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/android/index.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;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;;;;;;;;;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;;;;;;;;;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 AllowBackup from './AllowBackup';\nimport * as Colors from './Colors';\nimport * as EasBuild from './EasBuild';\nimport * as GoogleMapsApiKey from './GoogleMapsApiKey';\nimport * as GoogleServices from './GoogleServices';\nimport * as IntentFilters from './IntentFilters';\nimport * as JsEngine from './JsEngine';\nimport * as Manifest from './Manifest';\nimport * as Name from './Name';\nimport * as Orientation from './Orientation';\nimport * as Package from './Package';\nimport * as Paths from './Paths';\nimport * as Permissions from './Permissions';\nimport * as PrimaryColor from './PrimaryColor';\nimport * as Properties from './Properties';\nimport * as Resources from './Resources';\nimport * as RootViewBackgroundColor from './RootViewBackgroundColor';\nimport * as Scheme from './Scheme';\nimport * as StatusBar from './StatusBar';\nimport * as Strings from './Strings';\nimport * as Styles from './Styles';\nimport * as Updates from './Updates';\nimport * as UserInterfaceStyle from './UserInterfaceStyle';\nimport * as Version from './Version';\nimport * as WindowSoftInputMode from './WindowSoftInputMode';\n\nexport { Manifest, Colors, Paths, Permissions, Properties, Resources, Scheme, Strings, Styles };\n\nexport {\n AllowBackup,\n EasBuild,\n GoogleMapsApiKey,\n GoogleServices,\n IntentFilters,\n Name,\n Orientation,\n Package,\n PrimaryColor,\n RootViewBackgroundColor,\n StatusBar,\n Updates,\n UserInterfaceStyle,\n Version,\n JsEngine,\n WindowSoftInputMode,\n};\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/android/index.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;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;;;;;;;;;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;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA","sourcesContent":["import * as AllowBackup from './AllowBackup';\nimport * as Colors from './Colors';\nimport * as EasBuild from './EasBuild';\nimport * as GoogleMapsApiKey from './GoogleMapsApiKey';\nimport * as GoogleServices from './GoogleServices';\nimport * as IntentFilters from './IntentFilters';\nimport * as JsEngine from './JsEngine';\nimport * as Manifest from './Manifest';\nimport * as Name from './Name';\nimport * as Orientation from './Orientation';\nimport * as Package from './Package';\nimport * as Paths from './Paths';\nimport * as Permissions from './Permissions';\nimport * as PrimaryColor from './PrimaryColor';\nimport * as Properties from './Properties';\nimport * as Resources from './Resources';\nimport * as Scheme from './Scheme';\nimport * as StatusBar from './StatusBar';\nimport * as Strings from './Strings';\nimport * as Styles from './Styles';\nimport * as Updates from './Updates';\nimport * as Version from './Version';\nimport * as WindowSoftInputMode from './WindowSoftInputMode';\n\nexport { Manifest, Colors, Paths, Permissions, Properties, Resources, Scheme, Strings, Styles };\n\nexport {\n AllowBackup,\n EasBuild,\n GoogleMapsApiKey,\n GoogleServices,\n IntentFilters,\n Name,\n Orientation,\n Package,\n PrimaryColor,\n StatusBar,\n Updates,\n Version,\n JsEngine,\n WindowSoftInputMode,\n};\n"],"file":"index.js"}
package/build/index.d.ts CHANGED
@@ -20,7 +20,7 @@ export { withPlugins } from './plugins/withPlugins';
20
20
  export { withRunOnce, createRunOncePlugin } from './plugins/withRunOnce';
21
21
  export { withDangerousMod } from './plugins/withDangerousMod';
22
22
  export { withMod, withBaseMod } from './plugins/withMod';
23
- export { withAppDelegate, withInfoPlist, withEntitlementsPlist, withExpoPlist, withXcodeProject, } from './plugins/ios-plugins';
23
+ export { withAppDelegate, withInfoPlist, withEntitlementsPlist, withExpoPlist, withXcodeProject, withPodfileProperties, } from './plugins/ios-plugins';
24
24
  export { withAndroidManifest, withStringsXml, withAndroidColors, withAndroidColorsNight, withAndroidStyles, withMainActivity, withMainApplication, withProjectBuildGradle, withAppBuildGradle, withSettingsGradle, withGradleProperties, } from './plugins/android-plugins';
25
25
  export { withStaticPlugin } from './plugins/withStaticPlugin';
26
26
  export { compileModsAsync, withDefaultBaseMods, evalModsAsync } from './plugins/mod-compiler';
package/build/index.js CHANGED
@@ -22,6 +22,7 @@ var _exportNames = {
22
22
  withEntitlementsPlist: true,
23
23
  withExpoPlist: true,
24
24
  withXcodeProject: true,
25
+ withPodfileProperties: true,
25
26
  withAndroidManifest: true,
26
27
  withStringsXml: true,
27
28
  withAndroidColors: true,
@@ -39,16 +40,18 @@ var _exportNames = {
39
40
  evalModsAsync: true,
40
41
  PluginError: true
41
42
  };
42
- Object.defineProperty(exports, "withPlugins", {
43
+ exports.IOSConfig = exports.History = exports.BaseMods = exports.AndroidConfig = void 0;
44
+ Object.defineProperty(exports, "PluginError", {
43
45
  enumerable: true,
44
46
  get: function () {
45
- return _withPlugins().withPlugins;
47
+ return _errors().PluginError;
46
48
  }
47
49
  });
48
- Object.defineProperty(exports, "withRunOnce", {
50
+ exports.XML = exports.WarningAggregator = exports.Updates = void 0;
51
+ Object.defineProperty(exports, "compileModsAsync", {
49
52
  enumerable: true,
50
53
  get: function () {
51
- return _withRunOnce().withRunOnce;
54
+ return _modCompiler().compileModsAsync;
52
55
  }
53
56
  });
54
57
  Object.defineProperty(exports, "createRunOncePlugin", {
@@ -57,82 +60,88 @@ Object.defineProperty(exports, "createRunOncePlugin", {
57
60
  return _withRunOnce().createRunOncePlugin;
58
61
  }
59
62
  });
60
- Object.defineProperty(exports, "withDangerousMod", {
63
+ Object.defineProperty(exports, "evalModsAsync", {
61
64
  enumerable: true,
62
65
  get: function () {
63
- return _withDangerousMod().withDangerousMod;
66
+ return _modCompiler().evalModsAsync;
64
67
  }
65
68
  });
66
- Object.defineProperty(exports, "withMod", {
69
+ Object.defineProperty(exports, "withAndroidColors", {
67
70
  enumerable: true,
68
71
  get: function () {
69
- return _withMod().withMod;
72
+ return _androidPlugins().withAndroidColors;
70
73
  }
71
74
  });
72
- Object.defineProperty(exports, "withBaseMod", {
75
+ Object.defineProperty(exports, "withAndroidColorsNight", {
73
76
  enumerable: true,
74
77
  get: function () {
75
- return _withMod().withBaseMod;
78
+ return _androidPlugins().withAndroidColorsNight;
76
79
  }
77
80
  });
78
- Object.defineProperty(exports, "withAppDelegate", {
81
+ Object.defineProperty(exports, "withAndroidManifest", {
79
82
  enumerable: true,
80
83
  get: function () {
81
- return _iosPlugins().withAppDelegate;
84
+ return _androidPlugins().withAndroidManifest;
82
85
  }
83
86
  });
84
- Object.defineProperty(exports, "withInfoPlist", {
87
+ Object.defineProperty(exports, "withAndroidStyles", {
85
88
  enumerable: true,
86
89
  get: function () {
87
- return _iosPlugins().withInfoPlist;
90
+ return _androidPlugins().withAndroidStyles;
88
91
  }
89
92
  });
90
- Object.defineProperty(exports, "withEntitlementsPlist", {
93
+ Object.defineProperty(exports, "withAppBuildGradle", {
91
94
  enumerable: true,
92
95
  get: function () {
93
- return _iosPlugins().withEntitlementsPlist;
96
+ return _androidPlugins().withAppBuildGradle;
94
97
  }
95
98
  });
96
- Object.defineProperty(exports, "withExpoPlist", {
99
+ Object.defineProperty(exports, "withAppDelegate", {
97
100
  enumerable: true,
98
101
  get: function () {
99
- return _iosPlugins().withExpoPlist;
102
+ return _iosPlugins().withAppDelegate;
100
103
  }
101
104
  });
102
- Object.defineProperty(exports, "withXcodeProject", {
105
+ Object.defineProperty(exports, "withBaseMod", {
103
106
  enumerable: true,
104
107
  get: function () {
105
- return _iosPlugins().withXcodeProject;
108
+ return _withMod().withBaseMod;
106
109
  }
107
110
  });
108
- Object.defineProperty(exports, "withAndroidManifest", {
111
+ Object.defineProperty(exports, "withDangerousMod", {
109
112
  enumerable: true,
110
113
  get: function () {
111
- return _androidPlugins().withAndroidManifest;
114
+ return _withDangerousMod().withDangerousMod;
112
115
  }
113
116
  });
114
- Object.defineProperty(exports, "withStringsXml", {
117
+ Object.defineProperty(exports, "withDefaultBaseMods", {
115
118
  enumerable: true,
116
119
  get: function () {
117
- return _androidPlugins().withStringsXml;
120
+ return _modCompiler().withDefaultBaseMods;
118
121
  }
119
122
  });
120
- Object.defineProperty(exports, "withAndroidColors", {
123
+ Object.defineProperty(exports, "withEntitlementsPlist", {
121
124
  enumerable: true,
122
125
  get: function () {
123
- return _androidPlugins().withAndroidColors;
126
+ return _iosPlugins().withEntitlementsPlist;
124
127
  }
125
128
  });
126
- Object.defineProperty(exports, "withAndroidColorsNight", {
129
+ Object.defineProperty(exports, "withExpoPlist", {
127
130
  enumerable: true,
128
131
  get: function () {
129
- return _androidPlugins().withAndroidColorsNight;
132
+ return _iosPlugins().withExpoPlist;
130
133
  }
131
134
  });
132
- Object.defineProperty(exports, "withAndroidStyles", {
135
+ Object.defineProperty(exports, "withGradleProperties", {
133
136
  enumerable: true,
134
137
  get: function () {
135
- return _androidPlugins().withAndroidStyles;
138
+ return _androidPlugins().withGradleProperties;
139
+ }
140
+ });
141
+ Object.defineProperty(exports, "withInfoPlist", {
142
+ enumerable: true,
143
+ get: function () {
144
+ return _iosPlugins().withInfoPlist;
136
145
  }
137
146
  });
138
147
  Object.defineProperty(exports, "withMainActivity", {
@@ -147,61 +156,60 @@ Object.defineProperty(exports, "withMainApplication", {
147
156
  return _androidPlugins().withMainApplication;
148
157
  }
149
158
  });
150
- Object.defineProperty(exports, "withProjectBuildGradle", {
159
+ Object.defineProperty(exports, "withMod", {
151
160
  enumerable: true,
152
161
  get: function () {
153
- return _androidPlugins().withProjectBuildGradle;
162
+ return _withMod().withMod;
154
163
  }
155
164
  });
156
- Object.defineProperty(exports, "withAppBuildGradle", {
165
+ Object.defineProperty(exports, "withPlugins", {
157
166
  enumerable: true,
158
167
  get: function () {
159
- return _androidPlugins().withAppBuildGradle;
168
+ return _withPlugins().withPlugins;
160
169
  }
161
170
  });
162
- Object.defineProperty(exports, "withSettingsGradle", {
171
+ Object.defineProperty(exports, "withPodfileProperties", {
163
172
  enumerable: true,
164
173
  get: function () {
165
- return _androidPlugins().withSettingsGradle;
174
+ return _iosPlugins().withPodfileProperties;
166
175
  }
167
176
  });
168
- Object.defineProperty(exports, "withGradleProperties", {
177
+ Object.defineProperty(exports, "withProjectBuildGradle", {
169
178
  enumerable: true,
170
179
  get: function () {
171
- return _androidPlugins().withGradleProperties;
180
+ return _androidPlugins().withProjectBuildGradle;
172
181
  }
173
182
  });
174
- Object.defineProperty(exports, "withStaticPlugin", {
183
+ Object.defineProperty(exports, "withRunOnce", {
175
184
  enumerable: true,
176
185
  get: function () {
177
- return _withStaticPlugin().withStaticPlugin;
186
+ return _withRunOnce().withRunOnce;
178
187
  }
179
188
  });
180
- Object.defineProperty(exports, "compileModsAsync", {
189
+ Object.defineProperty(exports, "withSettingsGradle", {
181
190
  enumerable: true,
182
191
  get: function () {
183
- return _modCompiler().compileModsAsync;
192
+ return _androidPlugins().withSettingsGradle;
184
193
  }
185
194
  });
186
- Object.defineProperty(exports, "withDefaultBaseMods", {
195
+ Object.defineProperty(exports, "withStaticPlugin", {
187
196
  enumerable: true,
188
197
  get: function () {
189
- return _modCompiler().withDefaultBaseMods;
198
+ return _withStaticPlugin().withStaticPlugin;
190
199
  }
191
200
  });
192
- Object.defineProperty(exports, "evalModsAsync", {
201
+ Object.defineProperty(exports, "withStringsXml", {
193
202
  enumerable: true,
194
203
  get: function () {
195
- return _modCompiler().evalModsAsync;
204
+ return _androidPlugins().withStringsXml;
196
205
  }
197
206
  });
198
- Object.defineProperty(exports, "PluginError", {
207
+ Object.defineProperty(exports, "withXcodeProject", {
199
208
  enumerable: true,
200
209
  get: function () {
201
- return _errors().PluginError;
210
+ return _iosPlugins().withXcodeProject;
202
211
  }
203
212
  });
204
- exports.Updates = exports.WarningAggregator = exports.History = exports.XML = exports.IOSConfig = exports.AndroidConfig = exports.BaseMods = void 0;
205
213
 
206
214
  function AndroidConfig() {
207
215
  const data = _interopRequireWildcard(require("./android"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["BaseMods","withGeneratedBaseMods","provider","withAndroidBaseMods","getAndroidModFileProviders","withIosBaseMods","getIosModFileProviders"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAQA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAcA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AA1DA;AACA;AACA;AAUA;;AAOA;AACA;AACA;AAuCO,MAAMA,QAAQ,GAAG;AACtBC,EAAAA,qBAAqB,EAArBA,sCADsB;AAEtBC,EAAAA,QAAQ,EAARA,yBAFsB;AAGtBC,EAAAA,mBAAmB,EAAnBA,0CAHsB;AAItBC,EAAAA,0BAA0B,EAA1BA,iDAJsB;AAKtBC,EAAAA,eAAe,EAAfA,kCALsB;AAMtBC,EAAAA,sBAAsB,EAAtBA;AANsB,CAAjB","sourcesContent":["/**\n * For internal use in Expo CLI\n */\nimport * as AndroidConfig from './android';\nimport * as IOSConfig from './ios';\nimport { provider, withGeneratedBaseMods } from './plugins/createBaseMod';\nimport { getAndroidModFileProviders, withAndroidBaseMods } from './plugins/withAndroidBaseMods';\nimport { getIosModFileProviders, withIosBaseMods } from './plugins/withIosBaseMods';\nimport * as XML from './utils/XML';\nimport * as History from './utils/history';\nimport * as WarningAggregator from './utils/warnings';\n\n// TODO: Remove\nexport * as Updates from './utils/Updates';\n\nexport { IOSConfig, AndroidConfig };\n\nexport { WarningAggregator, History, XML };\n\n/**\n * These are the \"config-plugins\"\n */\n\nexport * from './Plugin.types';\n\nexport { withPlugins } from './plugins/withPlugins';\n\nexport { withRunOnce, createRunOncePlugin } from './plugins/withRunOnce';\n\nexport { withDangerousMod } from './plugins/withDangerousMod';\nexport { withMod, withBaseMod } from './plugins/withMod';\n\nexport {\n withAppDelegate,\n withInfoPlist,\n withEntitlementsPlist,\n withExpoPlist,\n withXcodeProject,\n} from './plugins/ios-plugins';\n\nexport {\n withAndroidManifest,\n withStringsXml,\n withAndroidColors,\n withAndroidColorsNight,\n withAndroidStyles,\n withMainActivity,\n withMainApplication,\n withProjectBuildGradle,\n withAppBuildGradle,\n withSettingsGradle,\n withGradleProperties,\n} from './plugins/android-plugins';\n\nexport { withStaticPlugin } from './plugins/withStaticPlugin';\n\nexport { compileModsAsync, withDefaultBaseMods, evalModsAsync } from './plugins/mod-compiler';\n\nexport { PluginError } from './utils/errors';\n\nexport const BaseMods = {\n withGeneratedBaseMods,\n provider,\n withAndroidBaseMods,\n getAndroidModFileProviders,\n withIosBaseMods,\n getIosModFileProviders,\n};\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["BaseMods","withGeneratedBaseMods","provider","withAndroidBaseMods","getAndroidModFileProviders","withIosBaseMods","getIosModFileProviders"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AASA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAcA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AA3DA;AACA;AACA;AAUA;;AAOA;AACA;AACA;AAwCO,MAAMA,QAAQ,GAAG;AACtBC,EAAAA,qBAAqB,EAArBA,sCADsB;AAEtBC,EAAAA,QAAQ,EAARA,yBAFsB;AAGtBC,EAAAA,mBAAmB,EAAnBA,0CAHsB;AAItBC,EAAAA,0BAA0B,EAA1BA,iDAJsB;AAKtBC,EAAAA,eAAe,EAAfA,kCALsB;AAMtBC,EAAAA,sBAAsB,EAAtBA;AANsB,CAAjB","sourcesContent":["/**\n * For internal use in Expo CLI\n */\nimport * as AndroidConfig from './android';\nimport * as IOSConfig from './ios';\nimport { provider, withGeneratedBaseMods } from './plugins/createBaseMod';\nimport { getAndroidModFileProviders, withAndroidBaseMods } from './plugins/withAndroidBaseMods';\nimport { getIosModFileProviders, withIosBaseMods } from './plugins/withIosBaseMods';\nimport * as XML from './utils/XML';\nimport * as History from './utils/history';\nimport * as WarningAggregator from './utils/warnings';\n\n// TODO: Remove\nexport * as Updates from './utils/Updates';\n\nexport { IOSConfig, AndroidConfig };\n\nexport { WarningAggregator, History, XML };\n\n/**\n * These are the \"config-plugins\"\n */\n\nexport * from './Plugin.types';\n\nexport { withPlugins } from './plugins/withPlugins';\n\nexport { withRunOnce, createRunOncePlugin } from './plugins/withRunOnce';\n\nexport { withDangerousMod } from './plugins/withDangerousMod';\nexport { withMod, withBaseMod } from './plugins/withMod';\n\nexport {\n withAppDelegate,\n withInfoPlist,\n withEntitlementsPlist,\n withExpoPlist,\n withXcodeProject,\n withPodfileProperties,\n} from './plugins/ios-plugins';\n\nexport {\n withAndroidManifest,\n withStringsXml,\n withAndroidColors,\n withAndroidColorsNight,\n withAndroidStyles,\n withMainActivity,\n withMainApplication,\n withProjectBuildGradle,\n withAppBuildGradle,\n withSettingsGradle,\n withGradleProperties,\n} from './plugins/android-plugins';\n\nexport { withStaticPlugin } from './plugins/withStaticPlugin';\n\nexport { compileModsAsync, withDefaultBaseMods, evalModsAsync } from './plugins/mod-compiler';\n\nexport { PluginError } from './utils/errors';\n\nexport const BaseMods = {\n withGeneratedBaseMods,\n provider,\n withAndroidBaseMods,\n getAndroidModFileProviders,\n withIosBaseMods,\n getIosModFileProviders,\n};\n"],"file":"index.js"}
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getBitcode = getBitcode;
7
- exports.setBitcodeWithConfig = setBitcodeWithConfig;
8
7
  exports.setBitcode = setBitcode;
8
+ exports.setBitcodeWithConfig = setBitcodeWithConfig;
9
9
  exports.withCustomBitcode = exports.withBitcode = void 0;
10
10
 
11
11
  function _iosPlugins() {
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getSchemesFromXcodeproj = getSchemesFromXcodeproj;
7
- exports.getRunnableSchemesFromXcodeproj = getRunnableSchemesFromXcodeproj;
8
6
  exports.getApplicationTargetNameForSchemeAsync = getApplicationTargetNameForSchemeAsync;
9
7
  exports.getArchiveBuildConfigurationForSchemeAsync = getArchiveBuildConfigurationForSchemeAsync;
8
+ exports.getRunnableSchemesFromXcodeproj = getRunnableSchemesFromXcodeproj;
9
+ exports.getSchemesFromXcodeproj = getSchemesFromXcodeproj;
10
10
 
11
11
  function _XML() {
12
12
  const data = require("../utils/XML");
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getBundleIdentifier = getBundleIdentifier;
7
- exports.setBundleIdentifier = setBundleIdentifier;
8
7
  exports.getBundleIdentifierFromPbxproj = getBundleIdentifierFromPbxproj;
9
- exports.updateBundleIdentifierForPbxproj = updateBundleIdentifierForPbxproj;
10
- exports.setBundleIdentifierForPbxproj = setBundleIdentifierForPbxproj;
11
8
  exports.resetAllPlistBundleIdentifiers = resetAllPlistBundleIdentifiers;
12
9
  exports.resetPlistBundleIdentifier = resetPlistBundleIdentifier;
10
+ exports.setBundleIdentifier = setBundleIdentifier;
11
+ exports.setBundleIdentifierForPbxproj = setBundleIdentifierForPbxproj;
12
+ exports.updateBundleIdentifierForPbxproj = updateBundleIdentifierForPbxproj;
13
13
  exports.withBundleIdentifier = void 0;
14
14
 
15
15
  function _plist() {
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getSupportsTablet = getSupportsTablet;
7
- exports.getIsTabletOnly = getIsTabletOnly;
8
- exports.getDeviceFamilies = getDeviceFamilies;
9
6
  exports.formatDeviceFamilies = formatDeviceFamilies;
7
+ exports.getDeviceFamilies = getDeviceFamilies;
8
+ exports.getIsTabletOnly = getIsTabletOnly;
9
+ exports.getSupportsTablet = getSupportsTablet;
10
10
  exports.setDeviceFamily = setDeviceFamily;
11
11
  exports.withDeviceFamily = void 0;
12
12
 
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.setAssociatedDomains = setAssociatedDomains;
7
6
  exports.getEntitlementsPath = getEntitlementsPath;
7
+ exports.setAssociatedDomains = setAssociatedDomains;
8
8
  exports.withAssociatedDomains = void 0;
9
9
 
10
10
  function _fsExtra() {
@@ -137,7 +137,7 @@ function getEntitlementsPath(projectRoot) {
137
137
  buildSettings
138
138
  }
139
139
  }) => {
140
- buildSettings.CODE_SIGN_ENTITLEMENTS = entitlementsRelativePath;
140
+ buildSettings.CODE_SIGN_ENTITLEMENTS = `"${entitlementsRelativePath}"`;
141
141
  });
142
142
 
143
143
  _fsExtra().default.writeFileSync(project.filepath, project.writeSync());
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ios/Entitlements.ts"],"names":["withAssociatedDomains","setAssociatedDomains","config","_","entitlementsPlist","ios","associatedDomains","getEntitlementsPath","projectRoot","paths","Paths","getAllEntitlementsPaths","targetPath","project","projectName","productName","entitlementsRelativePath","path","join","entitlementsPath","normalize","pathsToDelete","length","last","pop","push","template","ENTITLEMENTS_TEMPLATE","fs","readFileSync","ensureDirSync","dirname","writeFileSync","Object","entries","pbxXCBuildConfigurationSection","filter","isNotComment","isBuildConfig","isNotTestHost","forEach","buildSettings","CODE_SIGN_ENTITLEMENTS","filepath","writeSync","deleteEntitlementsFiles","entitlementsPaths","removeSync"],"mappings":";;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;AASO,MAAMA,qBAAqB,GAAG,4CACnCC,oBADmC,EAEnC,uBAFmC,CAA9B;;;AAKA,SAASA,oBAAT,CACLC,MADK,EAEL;AAAE,4CAA0CC,CAA5C;AAA+C,KAAGC;AAAlD,CAFK,EAGO;AAAA;;AACZ,qBAAIF,MAAM,CAACG,GAAX,wCAAI,YAAYC,iBAAhB,EAAmC;AACjC,WAAO,EACL,GAAGF,iBADE;AAEL,gDAA0CF,MAAM,CAACG,GAAP,CAAWC;AAFhD,KAAP;AAID;;AAED,SAAOF,iBAAP;AACD;;AAEM,SAASG,mBAAT,CAA6BC,WAA7B,EAA0D;AAC/D,QAAMC,KAAK,GAAGC,KAAK,GAACC,uBAAN,CAA8BH,WAA9B,CAAd;AACA,MAAII,UAAyB,GAAG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P,CAAerB,OAAO,CAACsB,8BAAR,EAAf,EACGC,MADH,CACUC,yBADV,EAEGD,MAFH,CAEUE,0BAFV,EAGGF,MAHH,CAGUG,0BAHV,EAIGC,OAJH,CAIW,CAAC;AAAE,SAAG;AAAEC,QAAAA;AAAF;AAAL,KAAD,KAAmC;AAC1CA,MAAAA,aAAa,CAACC,sBAAd,GAAuC1B,wBAAvC;AACD,KANH;;AAOAY,uBAAGI,aAAH,CAAiBnB,OAAO,CAAC8B,QAAzB,EAAmC9B,OAAO,CAAC+B,SAAR,EAAnC;AACD,GArD8D,CAuD/D;;;AACAC,EAAAA,uBAAuB,CAACxB,aAAD,CAAvB;AAEA,SAAOF,gBAAP;AACD;;AAED,SAAS0B,uBAAT,CAAiCC,iBAAjC,EAA8D;AAC5D,OAAK,MAAM7B,IAAX,IAAmB6B,iBAAnB,EAAsC;AACpClB,uBAAGmB,UAAH,CAAc9B,IAAd;AACD;AACF;;AAED,MAAMU,qBAAqB,GAAI;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,CAPA","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport { JSONObject } from '@expo/json-file';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport slash from 'slash';\n\nimport { createEntitlementsPlugin } from '../plugins/ios-plugins';\nimport * as Paths from './Paths';\nimport {\n getPbxproj,\n getProductName,\n getProjectName,\n isBuildConfig,\n isNotComment,\n isNotTestHost,\n} from './utils/Xcodeproj';\n\nexport const withAssociatedDomains = createEntitlementsPlugin(\n setAssociatedDomains,\n 'withAssociatedDomains'\n);\n\nexport function setAssociatedDomains(\n config: ExpoConfig,\n { 'com.apple.developer.associated-domains': _, ...entitlementsPlist }: JSONObject\n): JSONObject {\n if (config.ios?.associatedDomains) {\n return {\n ...entitlementsPlist,\n 'com.apple.developer.associated-domains': config.ios.associatedDomains,\n };\n }\n\n return entitlementsPlist;\n}\n\nexport function getEntitlementsPath(projectRoot: string): string {\n const paths = Paths.getAllEntitlementsPaths(projectRoot);\n let targetPath: string | null = null;\n\n /**\n * Add file to pbxproj under CODE_SIGN_ENTITLEMENTS\n */\n const project = getPbxproj(projectRoot);\n const projectName = getProjectName(projectRoot);\n const productName = getProductName(project);\n\n // Use posix formatted path, even on Windows\n const entitlementsRelativePath = slash(path.join(projectName, `${productName}.entitlements`));\n const entitlementsPath = slash(\n path.normalize(path.join(projectRoot, 'ios', entitlementsRelativePath))\n );\n\n const pathsToDelete: string[] = [];\n\n while (paths.length) {\n const last = slash(path.normalize(paths.pop()!));\n if (last !== entitlementsPath) {\n pathsToDelete.push(last);\n } else {\n targetPath = last;\n }\n }\n\n // Create a new entitlements file\n if (!targetPath) {\n targetPath = entitlementsPath;\n\n // Use the default template\n let template = ENTITLEMENTS_TEMPLATE;\n\n // If an old entitlements file exists, copy it's contents into the new file.\n if (pathsToDelete.length) {\n // Get the last entitlements file and use it as the template\n const last = pathsToDelete[pathsToDelete.length - 1]!;\n template = fs.readFileSync(last, 'utf8');\n }\n\n fs.ensureDirSync(path.dirname(entitlementsPath));\n fs.writeFileSync(entitlementsPath, template);\n\n Object.entries(project.pbxXCBuildConfigurationSection())\n .filter(isNotComment)\n .filter(isBuildConfig)\n .filter(isNotTestHost)\n .forEach(({ 1: { buildSettings } }: any) => {\n buildSettings.CODE_SIGN_ENTITLEMENTS = entitlementsRelativePath;\n });\n fs.writeFileSync(project.filepath, project.writeSync());\n }\n\n // Clean up others\n deleteEntitlementsFiles(pathsToDelete);\n\n return entitlementsPath;\n}\n\nfunction deleteEntitlementsFiles(entitlementsPaths: string[]) {\n for (const path of entitlementsPaths) {\n fs.removeSync(path);\n }\n}\n\nconst ENTITLEMENTS_TEMPLATE = `\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n</dict>\n</plist>\n`;\n"],"file":"Entitlements.js"}
1
+ {"version":3,"sources":["../../src/ios/Entitlements.ts"],"names":["withAssociatedDomains","setAssociatedDomains","config","_","entitlementsPlist","ios","associatedDomains","getEntitlementsPath","projectRoot","paths","Paths","getAllEntitlementsPaths","targetPath","project","projectName","productName","entitlementsRelativePath","path","join","entitlementsPath","normalize","pathsToDelete","length","last","pop","push","template","ENTITLEMENTS_TEMPLATE","fs","readFileSync","ensureDirSync","dirname","writeFileSync","Object","entries","pbxXCBuildConfigurationSection","filter","isNotComment","isBuildConfig","isNotTestHost","forEach","buildSettings","CODE_SIGN_ENTITLEMENTS","filepath","writeSync","deleteEntitlementsFiles","entitlementsPaths","removeSync"],"mappings":";;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;AASO,MAAMA,qBAAqB,GAAG,4CACnCC,oBADmC,EAEnC,uBAFmC,CAA9B;;;AAKA,SAASA,oBAAT,CACLC,MADK,EAEL;AAAE,4CAA0CC,CAA5C;AAA+C,KAAGC;AAAlD,CAFK,EAGO;AAAA;;AACZ,qBAAIF,MAAM,CAACG,GAAX,wCAAI,YAAYC,iBAAhB,EAAmC;AACjC,WAAO,EACL,GAAGF,iBADE;AAEL,gDAA0CF,MAAM,CAACG,GAAP,CAAWC;AAFhD,KAAP;AAID;;AAED,SAAOF,iBAAP;AACD;;AAEM,SAASG,mBAAT,CAA6BC,WAA7B,EAA0D;AAC/D,QAAMC,KAAK,GAAGC,KAAK,GAACC,uBAAN,CAA8BH,WAA9B,CAAd;AACA,MAAII,UAAyB,GAAG,IAAhC;AAEA;AACF;AACA;;AACE,QAAMC,OAAO,GAAG,6BAAWL,WAA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EGD,MAFH,CAEUE,0BAFV,EAGGF,MAHH,CAGUG,0BAHV,EAIGC,OAJH,CAIW,CAAC;AAAE,SAAG;AAAEC,QAAAA;AAAF;AAAL,KAAD,KAAmC;AAC1CA,MAAAA,aAAa,CAACC,sBAAd,GAAwC,IAAG1B,wBAAyB,GAApE;AACD,KANH;;AAOAY,uBAAGI,aAAH,CAAiBnB,OAAO,CAAC8B,QAAzB,EAAmC9B,OAAO,CAAC+B,SAAR,EAAnC;AACD,GArD8D,CAuD/D;;;AACAC,EAAAA,uBAAuB,CAACxB,aAAD,CAAvB;AAEA,SAAOF,gBAAP;AACD;;AAED,SAAS0B,uBAAT,CAAiCC,iBAAjC,EAA8D;AAC5D,OAAK,MAAM7B,IAAX,IAAmB6B,iBAAnB,EAAsC;AACpClB,uBAAGmB,UAAH,CAAc9B,IAAd;AACD;AACF;;AAED,MAAMU,qBAAqB,GAAI;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,CAPA","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport { JSONObject } from '@expo/json-file';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport slash from 'slash';\n\nimport { createEntitlementsPlugin } from '../plugins/ios-plugins';\nimport * as Paths from './Paths';\nimport {\n getPbxproj,\n getProductName,\n getProjectName,\n isBuildConfig,\n isNotComment,\n isNotTestHost,\n} from './utils/Xcodeproj';\n\nexport const withAssociatedDomains = createEntitlementsPlugin(\n setAssociatedDomains,\n 'withAssociatedDomains'\n);\n\nexport function setAssociatedDomains(\n config: ExpoConfig,\n { 'com.apple.developer.associated-domains': _, ...entitlementsPlist }: JSONObject\n): JSONObject {\n if (config.ios?.associatedDomains) {\n return {\n ...entitlementsPlist,\n 'com.apple.developer.associated-domains': config.ios.associatedDomains,\n };\n }\n\n return entitlementsPlist;\n}\n\nexport function getEntitlementsPath(projectRoot: string): string {\n const paths = Paths.getAllEntitlementsPaths(projectRoot);\n let targetPath: string | null = null;\n\n /**\n * Add file to pbxproj under CODE_SIGN_ENTITLEMENTS\n */\n const project = getPbxproj(projectRoot);\n const projectName = getProjectName(projectRoot);\n const productName = getProductName(project);\n\n // Use posix formatted path, even on Windows\n const entitlementsRelativePath = slash(path.join(projectName, `${productName}.entitlements`));\n const entitlementsPath = slash(\n path.normalize(path.join(projectRoot, 'ios', entitlementsRelativePath))\n );\n\n const pathsToDelete: string[] = [];\n\n while (paths.length) {\n const last = slash(path.normalize(paths.pop()!));\n if (last !== entitlementsPath) {\n pathsToDelete.push(last);\n } else {\n targetPath = last;\n }\n }\n\n // Create a new entitlements file\n if (!targetPath) {\n targetPath = entitlementsPath;\n\n // Use the default template\n let template = ENTITLEMENTS_TEMPLATE;\n\n // If an old entitlements file exists, copy it's contents into the new file.\n if (pathsToDelete.length) {\n // Get the last entitlements file and use it as the template\n const last = pathsToDelete[pathsToDelete.length - 1]!;\n template = fs.readFileSync(last, 'utf8');\n }\n\n fs.ensureDirSync(path.dirname(entitlementsPath));\n fs.writeFileSync(entitlementsPath, template);\n\n Object.entries(project.pbxXCBuildConfigurationSection())\n .filter(isNotComment)\n .filter(isBuildConfig)\n .filter(isNotTestHost)\n .forEach(({ 1: { buildSettings } }: any) => {\n buildSettings.CODE_SIGN_ENTITLEMENTS = `\"${entitlementsRelativePath}\"`;\n });\n fs.writeFileSync(project.filepath, project.writeSync());\n }\n\n // Clean up others\n deleteEntitlementsFiles(pathsToDelete);\n\n return entitlementsPath;\n}\n\nfunction deleteEntitlementsFiles(entitlementsPaths: string[]) {\n for (const path of entitlementsPaths) {\n fs.removeSync(path);\n }\n}\n\nconst ENTITLEMENTS_TEMPLATE = `\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n</dict>\n</plist>\n`;\n"],"file":"Entitlements.js"}
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getGoogleSignInReservedClientId = getGoogleSignInReservedClientId;
7
6
  exports.getGoogleServicesFile = getGoogleServicesFile;
8
- exports.setGoogleSignInReservedClientId = setGoogleSignInReservedClientId;
7
+ exports.getGoogleSignInReservedClientId = getGoogleSignInReservedClientId;
9
8
  exports.setGoogleConfig = setGoogleConfig;
10
9
  exports.setGoogleServicesFile = setGoogleServicesFile;
10
+ exports.setGoogleSignInReservedClientId = setGoogleSignInReservedClientId;
11
11
  exports.withGoogleServicesFile = exports.withGoogle = void 0;
12
12
 
13
13
  function _fsExtra() {
@@ -1,7 +1,8 @@
1
1
  import type { ExpoConfig } from '@expo/config-types';
2
+ import { JSONValue } from '@expo/json-file';
2
3
  import type { ConfigPlugin } from '../Plugin.types';
3
4
  export declare const JS_ENGINE_PROP_KEY = "expo.jsEngine";
4
5
  export declare const DEFAULT_JS_ENGINE = "jsc";
5
6
  export declare const withJsEnginePodfileProps: ConfigPlugin;
6
7
  export declare function getJsEngine(config: Pick<ExpoConfig, 'ios' | 'jsEngine'>): "hermes" | "jsc";
7
- export declare function setJsEngine(config: Pick<ExpoConfig, 'ios' | 'jsEngine'>, podfileProperties: Record<string, string>): Record<string, string>;
8
+ export declare function setJsEngine(config: Pick<ExpoConfig, 'ios' | 'jsEngine'>, podfileProperties: Record<string, JSONValue>): Record<string, JSONValue>;
@@ -3,9 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.JS_ENGINE_PROP_KEY = exports.DEFAULT_JS_ENGINE = void 0;
6
7
  exports.getJsEngine = getJsEngine;
7
8
  exports.setJsEngine = setJsEngine;
8
- exports.withJsEnginePodfileProps = exports.DEFAULT_JS_ENGINE = exports.JS_ENGINE_PROP_KEY = void 0;
9
+ exports.withJsEnginePodfileProps = void 0;
9
10
 
10
11
  function _iosPlugins() {
11
12
  const data = require("../plugins/ios-plugins");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ios/JsEngine.ts"],"names":["JS_ENGINE_PROP_KEY","DEFAULT_JS_ENGINE","withJsEnginePodfileProps","config","modResults","setJsEngine","getJsEngine","ios","jsEngine","podfileProperties"],"mappings":";;;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,kBAAkB,GAAG,eAA3B;;AACA,MAAMC,iBAAiB,GAAG,KAA1B;;;AAEA,MAAMC,wBAAsC,GAAGC,MAAM,IAAI;AAC9D,SAAO,yCAAsBA,MAAtB,EAA8BA,MAAM,IAAI;AAC7CA,IAAAA,MAAM,CAACC,UAAP,GAAoBC,WAAW,CAACF,MAAD,EAASA,MAAM,CAACC,UAAhB,CAA/B;AACA,WAAOD,MAAP;AACD,GAHM,CAAP;AAID,CALM;;;;AAOA,SAASG,WAAT,CAAqBH,MAArB,EAAmE;AAAA;;AACxE,wDAAOA,MAAM,CAACI,GAAd,gDAAO,YAAYC,QAAnB,uEAA+BL,MAAM,CAACK,QAAtC,uCAAkDP,iBAAlD;AACD;;AAEM,SAASI,WAAT,CACLF,MADK,EAELM,iBAFK,EAGmB;AAAA;;AACxBA,EAAAA,iBAAiB,CAACT,kBAAD,CAAjB,qDACEG,MAAM,CAACI,GADT,iDACE,aAAYC,QADd,yEAC0BL,MAAM,CAACK,QADjC,yCAC6CP,iBAD7C;AAEA,SAAOQ,iBAAP;AACD","sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { withPodfileProperties } from '../plugins/ios-plugins';\n\nexport const JS_ENGINE_PROP_KEY = 'expo.jsEngine';\nexport const DEFAULT_JS_ENGINE = 'jsc';\n\nexport const withJsEnginePodfileProps: ConfigPlugin = config => {\n return withPodfileProperties(config, config => {\n config.modResults = setJsEngine(config, config.modResults);\n return config;\n });\n};\n\nexport function getJsEngine(config: Pick<ExpoConfig, 'ios' | 'jsEngine'>) {\n return config.ios?.jsEngine ?? config.jsEngine ?? DEFAULT_JS_ENGINE;\n}\n\nexport function setJsEngine(\n config: Pick<ExpoConfig, 'ios' | 'jsEngine'>,\n podfileProperties: Record<string, string>\n): Record<string, string> {\n podfileProperties[JS_ENGINE_PROP_KEY] =\n config.ios?.jsEngine ?? config.jsEngine ?? DEFAULT_JS_ENGINE;\n return podfileProperties;\n}\n"],"file":"JsEngine.js"}
1
+ {"version":3,"sources":["../../src/ios/JsEngine.ts"],"names":["JS_ENGINE_PROP_KEY","DEFAULT_JS_ENGINE","withJsEnginePodfileProps","config","modResults","setJsEngine","getJsEngine","ios","jsEngine","podfileProperties"],"mappings":";;;;;;;;;;AAIA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,kBAAkB,GAAG,eAA3B;;AACA,MAAMC,iBAAiB,GAAG,KAA1B;;;AAEA,MAAMC,wBAAsC,GAAGC,MAAM,IAAI;AAC9D,SAAO,yCAAsBA,MAAtB,EAA8BA,MAAM,IAAI;AAC7CA,IAAAA,MAAM,CAACC,UAAP,GAAoBC,WAAW,CAACF,MAAD,EAASA,MAAM,CAACC,UAAhB,CAA/B;AACA,WAAOD,MAAP;AACD,GAHM,CAAP;AAID,CALM;;;;AAOA,SAASG,WAAT,CAAqBH,MAArB,EAAmE;AAAA;;AACxE,wDAAOA,MAAM,CAACI,GAAd,gDAAO,YAAYC,QAAnB,uEAA+BL,MAAM,CAACK,QAAtC,uCAAkDP,iBAAlD;AACD;;AAEM,SAASI,WAAT,CACLF,MADK,EAELM,iBAFK,EAGsB;AAAA;;AAC3BA,EAAAA,iBAAiB,CAACT,kBAAD,CAAjB,qDACEG,MAAM,CAACI,GADT,iDACE,aAAYC,QADd,yEAC0BL,MAAM,CAACK,QADjC,yCAC6CP,iBAD7C;AAEA,SAAOQ,iBAAP;AACD","sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport { JSONValue } from '@expo/json-file';\n\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { withPodfileProperties } from '../plugins/ios-plugins';\n\nexport const JS_ENGINE_PROP_KEY = 'expo.jsEngine';\nexport const DEFAULT_JS_ENGINE = 'jsc';\n\nexport const withJsEnginePodfileProps: ConfigPlugin = config => {\n return withPodfileProperties(config, config => {\n config.modResults = setJsEngine(config, config.modResults);\n return config;\n });\n};\n\nexport function getJsEngine(config: Pick<ExpoConfig, 'ios' | 'jsEngine'>) {\n return config.ios?.jsEngine ?? config.jsEngine ?? DEFAULT_JS_ENGINE;\n}\n\nexport function setJsEngine(\n config: Pick<ExpoConfig, 'ios' | 'jsEngine'>,\n podfileProperties: Record<string, JSONValue>\n): Record<string, JSONValue> {\n podfileProperties[JS_ENGINE_PROP_KEY] =\n config.ios?.jsEngine ?? config.jsEngine ?? DEFAULT_JS_ENGINE;\n return podfileProperties;\n}\n"],"file":"JsEngine.js"}