@expo/config-plugins 4.0.7 → 4.0.8

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 (85) hide show
  1. package/build/Plugin.types.js +6 -6
  2. package/build/android/AllowBackup.js +1 -1
  3. package/build/android/Colors.js +3 -3
  4. package/build/android/EasBuild.js +1 -1
  5. package/build/android/GoogleServices.js +3 -3
  6. package/build/android/IntentFilters.js +1 -1
  7. package/build/android/JsEngine.js +2 -1
  8. package/build/android/JsEngine.js.map +1 -1
  9. package/build/android/Manifest.js +10 -10
  10. package/build/android/Name.d.ts +2 -1
  11. package/build/android/Name.js +7 -4
  12. package/build/android/Name.js.map +1 -1
  13. package/build/android/Orientation.js +2 -1
  14. package/build/android/Orientation.js.map +1 -1
  15. package/build/android/Package.js +4 -4
  16. package/build/android/Package.js.map +1 -1
  17. package/build/android/Paths.js +9 -9
  18. package/build/android/Permissions.js +6 -6
  19. package/build/android/Resources.js +5 -5
  20. package/build/android/Scheme.js +3 -3
  21. package/build/android/StatusBar.js +3 -3
  22. package/build/android/Strings.js +1 -1
  23. package/build/android/Styles.js +5 -5
  24. package/build/android/Updates.d.ts +0 -5
  25. package/build/android/Updates.js +14 -23
  26. package/build/android/Updates.js.map +1 -1
  27. package/build/android/Version.js +2 -2
  28. package/build/android/WindowSoftInputMode.js +1 -1
  29. package/build/android/codeMod.js +2 -2
  30. package/build/index.js +54 -53
  31. package/build/index.js.map +1 -1
  32. package/build/ios/Bitcode.js +1 -1
  33. package/build/ios/BuildScheme.js +2 -2
  34. package/build/ios/BundleIdentifier.js +3 -3
  35. package/build/ios/DeviceFamily.js +3 -3
  36. package/build/ios/Entitlements.js +2 -2
  37. package/build/ios/Entitlements.js.map +1 -1
  38. package/build/ios/Google.js +2 -2
  39. package/build/ios/JsEngine.js +2 -1
  40. package/build/ios/JsEngine.js.map +1 -1
  41. package/build/ios/Locales.js +1 -1
  42. package/build/ios/Maps.js +32 -18
  43. package/build/ios/Maps.js.map +1 -1
  44. package/build/ios/Orientation.js +2 -1
  45. package/build/ios/Orientation.js.map +1 -1
  46. package/build/ios/Paths.js +14 -14
  47. package/build/ios/Paths.js.map +1 -1
  48. package/build/ios/Permissions.js +1 -1
  49. package/build/ios/Permissions.js.map +1 -1
  50. package/build/ios/Scheme.js +4 -4
  51. package/build/ios/Swift.js +2 -2
  52. package/build/ios/Target.js +5 -5
  53. package/build/ios/Updates.d.ts +0 -5
  54. package/build/ios/Updates.js +14 -23
  55. package/build/ios/Updates.js.map +1 -1
  56. package/build/ios/Version.js +3 -3
  57. package/build/ios/codeMod.js +2 -2
  58. package/build/ios/index.js +3 -1
  59. package/build/ios/index.js.map +1 -1
  60. package/build/ios/utils/Xcodeproj.js +9 -9
  61. package/build/plugins/android-plugins.js +1 -1
  62. package/build/plugins/createBaseMod.js +2 -2
  63. package/build/plugins/createBaseMod.js.map +1 -1
  64. package/build/plugins/ios-plugins.js +2 -2
  65. package/build/plugins/mod-compiler.js +3 -3
  66. package/build/plugins/mod-compiler.js.map +1 -1
  67. package/build/plugins/withAndroidBaseMods.js +1 -1
  68. package/build/plugins/withIosBaseMods.js +1 -1
  69. package/build/utils/Updates.d.ts +1 -0
  70. package/build/utils/Updates.js +24 -1
  71. package/build/utils/Updates.js.map +1 -1
  72. package/build/utils/XML.d.ts +6 -0
  73. package/build/utils/XML.js +57 -10
  74. package/build/utils/XML.js.map +1 -1
  75. package/build/utils/errors.js +1 -1
  76. package/build/utils/generateCode.js +2 -2
  77. package/build/utils/history.js +1 -1
  78. package/build/utils/modules.js +1 -1
  79. package/build/utils/plugin-resolver.js +4 -4
  80. package/build/utils/sortObject.js +2 -2
  81. package/build/utils/warnings.js +1 -1
  82. package/package.json +3 -3
  83. package/build/utils/resolvePackageRootFolder.d.ts +0 -1
  84. package/build/utils/resolvePackageRootFolder.js +0 -57
  85. package/build/utils/resolvePackageRootFolder.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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ACA,QAAM2D,kBAAkB,GAAGrD,aAAa,CAACN,MAAD,CAAxC;AAEA,QAAM4D,qBAAqB,GAAG,iDAC5B7C,eAD4B,EAE5BjB,MAAM,CAAC6B,eAFqB,CAA9B;AAIA,QAAMkC,iBAAiB,GAAG,iDAAgC9C,eAAhC,EAAiDjB,MAAM,CAAC4B,WAAxD,CAA1B;;AAEA,MAAIgC,sBAAsB,KAAK,IAA/B,EAAqC;AACnC,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, 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;;AAA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,IAMAR,uBAAuB,CAACX,MAAD,CAAvB,KACE,iDAAgCa,eAAhC,EAAiDf,MAAM,CAACoB,eAAxD,CAPF,IAQAqC,iBAAiB,CAACvD,MAAD,EAASa,eAAT,CATnB;AAWD;;AAEM,SAAS0C,iBAAT,CACLvD,MADK,EAELa,eAFK,EAGI;AACT,QAAM2C,sBAAsB,GAAG,0CAA0BxD,MAA1B,EAAkC,SAAlC,CAA/B;AACA,QAAMyD,kBAAkB,GAAGrD,aAAa,CAACJ,MAAD,CAAxC;AAEA,QAAM0D,qBAAqB,GAAG,iDAC5B7C,eAD4B,EAE5Bf,MAAM,CAAC2B,eAFqB,CAA9B;AAIA,QAAMkC,iBAAiB,GAAG,iDAAgC9C,eAAhC,EAAiDf,MAAM,CAAC0B,WAAxD,CAA1B;;AAEA,MAAIgC,sBAAsB,KAAK,IAA/B,EAAqC;AACnC,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");
package/build/index.js CHANGED
@@ -39,16 +39,18 @@ var _exportNames = {
39
39
  evalModsAsync: true,
40
40
  PluginError: true
41
41
  };
42
- Object.defineProperty(exports, "withPlugins", {
42
+ exports.IOSConfig = exports.History = exports.BaseMods = exports.AndroidConfig = void 0;
43
+ Object.defineProperty(exports, "PluginError", {
43
44
  enumerable: true,
44
45
  get: function () {
45
- return _withPlugins().withPlugins;
46
+ return _errors().PluginError;
46
47
  }
47
48
  });
48
- Object.defineProperty(exports, "withRunOnce", {
49
+ exports.XML = exports.WarningAggregator = exports.Updates = void 0;
50
+ Object.defineProperty(exports, "compileModsAsync", {
49
51
  enumerable: true,
50
52
  get: function () {
51
- return _withRunOnce().withRunOnce;
53
+ return _modCompiler().compileModsAsync;
52
54
  }
53
55
  });
54
56
  Object.defineProperty(exports, "createRunOncePlugin", {
@@ -57,151 +59,150 @@ Object.defineProperty(exports, "createRunOncePlugin", {
57
59
  return _withRunOnce().createRunOncePlugin;
58
60
  }
59
61
  });
60
- Object.defineProperty(exports, "withDangerousMod", {
62
+ Object.defineProperty(exports, "evalModsAsync", {
61
63
  enumerable: true,
62
64
  get: function () {
63
- return _withDangerousMod().withDangerousMod;
65
+ return _modCompiler().evalModsAsync;
64
66
  }
65
67
  });
66
- Object.defineProperty(exports, "withMod", {
68
+ Object.defineProperty(exports, "withAndroidColors", {
67
69
  enumerable: true,
68
70
  get: function () {
69
- return _withMod().withMod;
71
+ return _androidPlugins().withAndroidColors;
70
72
  }
71
73
  });
72
- Object.defineProperty(exports, "withBaseMod", {
74
+ Object.defineProperty(exports, "withAndroidColorsNight", {
73
75
  enumerable: true,
74
76
  get: function () {
75
- return _withMod().withBaseMod;
77
+ return _androidPlugins().withAndroidColorsNight;
76
78
  }
77
79
  });
78
- Object.defineProperty(exports, "withAppDelegate", {
80
+ Object.defineProperty(exports, "withAndroidManifest", {
79
81
  enumerable: true,
80
82
  get: function () {
81
- return _iosPlugins().withAppDelegate;
83
+ return _androidPlugins().withAndroidManifest;
82
84
  }
83
85
  });
84
- Object.defineProperty(exports, "withInfoPlist", {
86
+ Object.defineProperty(exports, "withAndroidStyles", {
85
87
  enumerable: true,
86
88
  get: function () {
87
- return _iosPlugins().withInfoPlist;
89
+ return _androidPlugins().withAndroidStyles;
88
90
  }
89
91
  });
90
- Object.defineProperty(exports, "withEntitlementsPlist", {
92
+ Object.defineProperty(exports, "withAppBuildGradle", {
91
93
  enumerable: true,
92
94
  get: function () {
93
- return _iosPlugins().withEntitlementsPlist;
95
+ return _androidPlugins().withAppBuildGradle;
94
96
  }
95
97
  });
96
- Object.defineProperty(exports, "withExpoPlist", {
98
+ Object.defineProperty(exports, "withAppDelegate", {
97
99
  enumerable: true,
98
100
  get: function () {
99
- return _iosPlugins().withExpoPlist;
101
+ return _iosPlugins().withAppDelegate;
100
102
  }
101
103
  });
102
- Object.defineProperty(exports, "withXcodeProject", {
104
+ Object.defineProperty(exports, "withBaseMod", {
103
105
  enumerable: true,
104
106
  get: function () {
105
- return _iosPlugins().withXcodeProject;
107
+ return _withMod().withBaseMod;
106
108
  }
107
109
  });
108
- Object.defineProperty(exports, "withAndroidManifest", {
110
+ Object.defineProperty(exports, "withDangerousMod", {
109
111
  enumerable: true,
110
112
  get: function () {
111
- return _androidPlugins().withAndroidManifest;
113
+ return _withDangerousMod().withDangerousMod;
112
114
  }
113
115
  });
114
- Object.defineProperty(exports, "withStringsXml", {
116
+ Object.defineProperty(exports, "withDefaultBaseMods", {
115
117
  enumerable: true,
116
118
  get: function () {
117
- return _androidPlugins().withStringsXml;
119
+ return _modCompiler().withDefaultBaseMods;
118
120
  }
119
121
  });
120
- Object.defineProperty(exports, "withAndroidColors", {
122
+ Object.defineProperty(exports, "withEntitlementsPlist", {
121
123
  enumerable: true,
122
124
  get: function () {
123
- return _androidPlugins().withAndroidColors;
125
+ return _iosPlugins().withEntitlementsPlist;
124
126
  }
125
127
  });
126
- Object.defineProperty(exports, "withAndroidColorsNight", {
128
+ Object.defineProperty(exports, "withExpoPlist", {
127
129
  enumerable: true,
128
130
  get: function () {
129
- return _androidPlugins().withAndroidColorsNight;
131
+ return _iosPlugins().withExpoPlist;
130
132
  }
131
133
  });
132
- Object.defineProperty(exports, "withAndroidStyles", {
134
+ Object.defineProperty(exports, "withGradleProperties", {
133
135
  enumerable: true,
134
136
  get: function () {
135
- return _androidPlugins().withAndroidStyles;
137
+ return _androidPlugins().withGradleProperties;
136
138
  }
137
139
  });
138
- Object.defineProperty(exports, "withMainActivity", {
140
+ Object.defineProperty(exports, "withInfoPlist", {
139
141
  enumerable: true,
140
142
  get: function () {
141
- return _androidPlugins().withMainActivity;
143
+ return _iosPlugins().withInfoPlist;
142
144
  }
143
145
  });
144
- Object.defineProperty(exports, "withMainApplication", {
146
+ Object.defineProperty(exports, "withMainActivity", {
145
147
  enumerable: true,
146
148
  get: function () {
147
- return _androidPlugins().withMainApplication;
149
+ return _androidPlugins().withMainActivity;
148
150
  }
149
151
  });
150
- Object.defineProperty(exports, "withProjectBuildGradle", {
152
+ Object.defineProperty(exports, "withMainApplication", {
151
153
  enumerable: true,
152
154
  get: function () {
153
- return _androidPlugins().withProjectBuildGradle;
155
+ return _androidPlugins().withMainApplication;
154
156
  }
155
157
  });
156
- Object.defineProperty(exports, "withAppBuildGradle", {
158
+ Object.defineProperty(exports, "withMod", {
157
159
  enumerable: true,
158
160
  get: function () {
159
- return _androidPlugins().withAppBuildGradle;
161
+ return _withMod().withMod;
160
162
  }
161
163
  });
162
- Object.defineProperty(exports, "withSettingsGradle", {
164
+ Object.defineProperty(exports, "withPlugins", {
163
165
  enumerable: true,
164
166
  get: function () {
165
- return _androidPlugins().withSettingsGradle;
167
+ return _withPlugins().withPlugins;
166
168
  }
167
169
  });
168
- Object.defineProperty(exports, "withGradleProperties", {
170
+ Object.defineProperty(exports, "withProjectBuildGradle", {
169
171
  enumerable: true,
170
172
  get: function () {
171
- return _androidPlugins().withGradleProperties;
173
+ return _androidPlugins().withProjectBuildGradle;
172
174
  }
173
175
  });
174
- Object.defineProperty(exports, "withStaticPlugin", {
176
+ Object.defineProperty(exports, "withRunOnce", {
175
177
  enumerable: true,
176
178
  get: function () {
177
- return _withStaticPlugin().withStaticPlugin;
179
+ return _withRunOnce().withRunOnce;
178
180
  }
179
181
  });
180
- Object.defineProperty(exports, "compileModsAsync", {
182
+ Object.defineProperty(exports, "withSettingsGradle", {
181
183
  enumerable: true,
182
184
  get: function () {
183
- return _modCompiler().compileModsAsync;
185
+ return _androidPlugins().withSettingsGradle;
184
186
  }
185
187
  });
186
- Object.defineProperty(exports, "withDefaultBaseMods", {
188
+ Object.defineProperty(exports, "withStaticPlugin", {
187
189
  enumerable: true,
188
190
  get: function () {
189
- return _modCompiler().withDefaultBaseMods;
191
+ return _withStaticPlugin().withStaticPlugin;
190
192
  }
191
193
  });
192
- Object.defineProperty(exports, "evalModsAsync", {
194
+ Object.defineProperty(exports, "withStringsXml", {
193
195
  enumerable: true,
194
196
  get: function () {
195
- return _modCompiler().evalModsAsync;
197
+ return _androidPlugins().withStringsXml;
196
198
  }
197
199
  });
198
- Object.defineProperty(exports, "PluginError", {
200
+ Object.defineProperty(exports, "withXcodeProject", {
199
201
  enumerable: true,
200
202
  get: function () {
201
- return _errors().PluginError;
203
+ return _iosPlugins().withXcodeProject;
202
204
  }
203
205
  });
204
- exports.Updates = exports.WarningAggregator = exports.History = exports.XML = exports.IOSConfig = exports.AndroidConfig = exports.BaseMods = void 0;
205
206
 
206
207
  function AndroidConfig() {
207
208
  const data = _interopRequireWildcard(require("./android"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["BaseMods","withGeneratedBaseMods","provider","withAndroidBaseMods","getAndroidModFileProviders","withI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AAMA,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;;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"}
@@ -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,IAAhC;AAEA;AACF;AACA;;AACE,QAAMC,OAAO,GAAG,6BAAWL,WAAX,CAAhB;AACA,QAAMM,WAAW,GAAG,iCAAeN,WAAf,CAApB;AACA,QAAMO,WAAW,GAAG,iCAAeF,OAAf,CAApB,CAT+D,CAW/D;;AACA,QAAMG,wBAAwB,GAAG,sBAA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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,WAAX,CAAhB;AACA,QAAMM,WAAW,GAAG,iCAAeN,WAAf,CAApB;AACA,QAAMO,WAAW,GAAG,iCAAeF,OAAf,CAApB,CAT+D,CAW/D;;AACA,QAAMG,wBAAwB,GAAG,sBAAMC,gBAAKC,IAAL,CAAUJ,WAAV,EAAwB,GAAEC,WAAY,eAAtC,C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AOAY,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() {
@@ -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":";;;;;;;;;;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"}
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getLocales = getLocales;
7
- exports.setLocalesAsync = setLocalesAsync;
8
7
  exports.getResolvedLocalesAsync = getResolvedLocalesAsync;
8
+ exports.setLocalesAsync = setLocalesAsync;
9
9
  exports.withLocales = void 0;
10
10
 
11
11
  function _jsonFile() {
package/build/ios/Maps.js CHANGED
@@ -3,15 +3,16 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getGoogleMapsApiKey = getGoogleMapsApiKey;
7
- exports.setGoogleMapsApiKey = setGoogleMapsApiKey;
6
+ exports.MATCH_INIT = void 0;
8
7
  exports.addGoogleMapsAppDelegateImport = addGoogleMapsAppDelegateImport;
9
- exports.removeGoogleMapsAppDelegateImport = removeGoogleMapsAppDelegateImport;
10
8
  exports.addGoogleMapsAppDelegateInit = addGoogleMapsAppDelegateInit;
11
- exports.removeGoogleMapsAppDelegateInit = removeGoogleMapsAppDelegateInit;
12
9
  exports.addMapsCocoaPods = addMapsCocoaPods;
10
+ exports.getGoogleMapsApiKey = getGoogleMapsApiKey;
11
+ exports.removeGoogleMapsAppDelegateImport = removeGoogleMapsAppDelegateImport;
12
+ exports.removeGoogleMapsAppDelegateInit = removeGoogleMapsAppDelegateInit;
13
13
  exports.removeMapsCocoaPods = removeMapsCocoaPods;
14
- exports.withMaps = exports.MATCH_INIT = void 0;
14
+ exports.setGoogleMapsApiKey = setGoogleMapsApiKey;
15
+ exports.withMaps = void 0;
15
16
 
16
17
  function _fsExtra() {
17
18
  const data = _interopRequireDefault(require("fs-extra"));
@@ -33,6 +34,16 @@ function _path() {
33
34
  return data;
34
35
  }
35
36
 
37
+ function _resolveFrom() {
38
+ const data = _interopRequireDefault(require("resolve-from"));
39
+
40
+ _resolveFrom = function () {
41
+ return data;
42
+ };
43
+
44
+ return data;
45
+ }
46
+
36
47
  function _iosPlugins() {
37
48
  const data = require("../plugins/ios-plugins");
38
49
 
@@ -63,19 +74,11 @@ function _generateCode() {
63
74
  return data;
64
75
  }
65
76
 
66
- function _resolvePackageRootFolder() {
67
- const data = require("../utils/resolvePackageRootFolder");
68
-
69
- _resolvePackageRootFolder = function () {
70
- return data;
71
- };
77
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
72
78
 
73
- return data;
74
- }
79
+ const debug = require('debug')('expo:config-plugins:ios:maps'); // Match against `UMModuleRegistryAdapter` (unimodules), and React Native without unimodules (Expo Modules).
75
80
 
76
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
77
81
 
78
- // Match against `UMModuleRegistryAdapter` (unimodules), and React Native without unimodules (Expo Modules).
79
82
  const MATCH_INIT = /(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[\[RCTBridge alloc\])/g;
80
83
  exports.MATCH_INIT = MATCH_INIT;
81
84
  const withGoogleMapsKey = (0, _iosPlugins().createInfoPlistPlugin)(setGoogleMapsApiKey, 'withGoogleMapsKey');
@@ -84,6 +87,7 @@ const withMaps = config => {
84
87
  config = withGoogleMapsKey(config);
85
88
  const apiKey = getGoogleMapsApiKey(config); // Technically adds react-native-maps (Apple maps) and google maps.
86
89
 
90
+ debug('Google Maps API Key:', apiKey);
87
91
  config = withMapsCocoaPods(config, {
88
92
  useGoogleMaps: !!apiKey
89
93
  }); // Adds/Removes AppDelegate setup for Google Maps API on iOS
@@ -183,7 +187,14 @@ function removeMapsCocoaPods(src) {
183
187
  }
184
188
 
185
189
  function isReactNativeMapsInstalled(projectRoot) {
186
- return (0, _resolvePackageRootFolder().resolvePackageRootFolder)(projectRoot, 'react-native-maps');
190
+ const resolved = _resolveFrom().default.silent(projectRoot, 'react-native-maps/package.json');
191
+
192
+ return resolved ? _path().default.dirname(resolved) : null;
193
+ }
194
+
195
+ function isReactNativeMapsAutolinked(config) {
196
+ // TODO: Detect autolinking
197
+ return true;
187
198
  }
188
199
 
189
200
  const withMapsCocoaPods = (config, {
@@ -197,8 +208,11 @@ const withMapsCocoaPods = (config, {
197
208
  // Generally prebuild runs after a yarn install so this should always work as expected.
198
209
 
199
210
  const googleMapsPath = isReactNativeMapsInstalled(config.modRequest.projectRoot);
211
+ const isLinked = isReactNativeMapsAutolinked(config);
212
+ debug('Is Expo Autolinked:', isLinked);
213
+ debug('react-native-maps path:', googleMapsPath);
200
214
 
201
- if (googleMapsPath && useGoogleMaps) {
215
+ if (isLinked && googleMapsPath && useGoogleMaps) {
202
216
  // Make the pod path relative to the ios folder.
203
217
  const googleMapsPodPath = _path().default.relative(config.modRequest.platformProjectRoot, googleMapsPath);
204
218
 
@@ -229,7 +243,7 @@ const withGoogleMapsAppDelegate = (config, {
229
243
  }) => {
230
244
  return (0, _iosPlugins().withAppDelegate)(config, config => {
231
245
  if (config.modResults.language === 'objc') {
232
- if (apiKey && isReactNativeMapsInstalled(config.modRequest.projectRoot)) {
246
+ if (apiKey && isReactNativeMapsAutolinked(config) && isReactNativeMapsInstalled(config.modRequest.projectRoot)) {
233
247
  try {
234
248
  config.modResults.contents = addGoogleMapsAppDelegateImport(config.modResults.contents).contents;
235
249
  config.modResults.contents = addGoogleMapsAppDelegateInit(config.modResults.contents, apiKey).contents;