@expo/config-plugins 4.1.5 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/build/Plugin.types.d.ts +8 -0
  2. package/build/Plugin.types.js.map +1 -1
  3. package/build/android/AllowBackup.js.map +1 -1
  4. package/build/android/BuildProperties.js.map +1 -1
  5. package/build/android/Colors.js.map +1 -1
  6. package/build/android/EasBuild.js.map +1 -1
  7. package/build/android/EasBuildGradleScript.js.map +1 -1
  8. package/build/android/GoogleMapsApiKey.js.map +1 -1
  9. package/build/android/GoogleServices.js.map +1 -1
  10. package/build/android/IntentFilters.js.map +1 -1
  11. package/build/android/Manifest.js.map +1 -1
  12. package/build/android/Name.js.map +1 -1
  13. package/build/android/Orientation.js.map +1 -1
  14. package/build/android/Package.js.map +1 -1
  15. package/build/android/Paths.js.map +1 -1
  16. package/build/android/Permissions.js.map +1 -1
  17. package/build/android/PrimaryColor.js.map +1 -1
  18. package/build/android/Properties.js.map +1 -1
  19. package/build/android/Resources.js.map +1 -1
  20. package/build/android/Scheme.js.map +1 -1
  21. package/build/android/StatusBar.js.map +1 -1
  22. package/build/android/Strings.js.map +1 -1
  23. package/build/android/Styles.js.map +1 -1
  24. package/build/android/Updates.js.map +1 -1
  25. package/build/android/Version.js.map +1 -1
  26. package/build/android/WindowSoftInputMode.js.map +1 -1
  27. package/build/android/codeMod.js.map +1 -1
  28. package/build/android/index.js.map +1 -1
  29. package/build/index.js.map +1 -1
  30. package/build/ios/Bitcode.js.map +1 -1
  31. package/build/ios/BuildProperties.js.map +1 -1
  32. package/build/ios/BuildScheme.js.map +1 -1
  33. package/build/ios/BundleIdentifier.js.map +1 -1
  34. package/build/ios/DeviceFamily.js.map +1 -1
  35. package/build/ios/Entitlements.js.map +1 -1
  36. package/build/ios/Google.js.map +1 -1
  37. package/build/ios/IosConfig.types.js.map +1 -1
  38. package/build/ios/Locales.js.map +1 -1
  39. package/build/ios/Maps.js.map +1 -1
  40. package/build/ios/Name.js +8 -2
  41. package/build/ios/Name.js.map +1 -1
  42. package/build/ios/Orientation.js +4 -1
  43. package/build/ios/Orientation.js.map +1 -1
  44. package/build/ios/Paths.js.map +1 -1
  45. package/build/ios/Permissions.js.map +1 -1
  46. package/build/ios/ProvisioningProfile.js.map +1 -1
  47. package/build/ios/RequiresFullScreen.js.map +1 -1
  48. package/build/ios/Scheme.js +4 -1
  49. package/build/ios/Scheme.js.map +1 -1
  50. package/build/ios/Swift.js.map +1 -1
  51. package/build/ios/Target.js.map +1 -1
  52. package/build/ios/Updates.js.map +1 -1
  53. package/build/ios/UsesNonExemptEncryption.js +4 -1
  54. package/build/ios/UsesNonExemptEncryption.js.map +1 -1
  55. package/build/ios/Version.js +8 -2
  56. package/build/ios/Version.js.map +1 -1
  57. package/build/ios/XcodeProjectFile.js.map +1 -1
  58. package/build/ios/codeMod.js.map +1 -1
  59. package/build/ios/index.js.map +1 -1
  60. package/build/ios/utils/Xcodeproj.js.map +1 -1
  61. package/build/ios/utils/getInfoPlistPath.js.map +1 -1
  62. package/build/ios/utils/string.js.map +1 -1
  63. package/build/plugins/android-plugins.js.map +1 -1
  64. package/build/plugins/createBaseMod.js.map +1 -1
  65. package/build/plugins/ios-plugins.d.ts +5 -0
  66. package/build/plugins/ios-plugins.js +46 -0
  67. package/build/plugins/ios-plugins.js.map +1 -1
  68. package/build/plugins/mod-compiler.js +18 -4
  69. package/build/plugins/mod-compiler.js.map +1 -1
  70. package/build/plugins/withAndroidBaseMods.js.map +1 -1
  71. package/build/plugins/withDangerousMod.js.map +1 -1
  72. package/build/plugins/withIosBaseMods.js.map +1 -1
  73. package/build/plugins/withMod.js.map +1 -1
  74. package/build/plugins/withPlugins.js.map +1 -1
  75. package/build/plugins/withRunOnce.js.map +1 -1
  76. package/build/plugins/withStaticPlugin.js.map +1 -1
  77. package/build/utils/BuildProperties.types.js.map +1 -1
  78. package/build/utils/Updates.js.map +1 -1
  79. package/build/utils/XML.js.map +1 -1
  80. package/build/utils/commonCodeMod.js.map +1 -1
  81. package/build/utils/errors.js.map +1 -1
  82. package/build/utils/fs.js.map +1 -1
  83. package/build/utils/generateCode.js.map +1 -1
  84. package/build/utils/history.js.map +1 -1
  85. package/build/utils/matchBrackets.js.map +1 -1
  86. package/build/utils/modules.js.map +1 -1
  87. package/build/utils/obj.d.ts +2 -0
  88. package/build/utils/obj.js +24 -0
  89. package/build/utils/obj.js.map +1 -0
  90. package/build/utils/plugin-resolver.js.map +1 -1
  91. package/build/utils/sortObject.js.map +1 -1
  92. package/build/utils/versions.js.map +1 -1
  93. package/build/utils/warnings.js.map +1 -1
  94. package/package.json +7 -6
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/plugins/withIosBaseMods.ts"],"names":["readFile","writeFile","promises","getEntitlementsPlistTemplate","getInfoPlistTemplate","CFBundleDevelopmentRegion","CFBundleExecutable","CFBundleIdentifier","CFBundleName","CFBundlePackageType","CFBundleInfoDictionaryVersion","CFBundleSignature","LSRequiresIPhoneOS","NSAppTransportSecurity","NSAllowsArbitraryLoads","NSExceptionDomains","localhost","NSExceptionAllowsInsecureHTTPLoads","UILaunchStoryboardName","UIRequiredDeviceCapabilities","UIViewControllerBasedStatusBarAppearance","UIStatusBarStyle","defaultProviders","dangerous","getFilePath","read","write","appDelegate","modRequest","projectRoot","Paths","getAppDelegateFilePath","filePath","getFileInfo","modResults","contents","expoPlist","isIntrospective","platformProjectRoot","projectName","supportingDirectory","path","join","resolve","introspect","plist","parse","error","build","xcodeproj","getPBXProjectPath","project","xcode","parseSync","writeSync","infoPlist","config","infoPlistBuildProperty","infoPlistPath","getInfoPlistPath","ios","entitlements","Entitlements","getEntitlementsPath","fs","existsSync","podfileProperties","results","JsonFile","readAsync","writeAsync","withIosBaseMods","providers","props","platform","getIosModFileProviders"],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AA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KAAGC;AAFL,IAG4E,EALvE,EAMW;AAChB,SAAO,4CAAkCjB,MAAlC,EAA0C,EAC/C,GAAGiB,KAD4C;AAE/CC,IAAAA,QAAQ,EAAE,KAFqC;AAG/CF,IAAAA,SAAS,EAAEA,SAAF,aAAEA,SAAF,cAAEA,SAAF,GAAeG,sBAAsB;AAHC,GAA1C,CAAP;AAKD;;AAEM,SAASA,sBAAT,GAAkC;AACvC,SAAOrD,gBAAP;AACD","sourcesContent":["import JsonFile, { JSONObject, JSONValue } from '@expo/json-file';\nimport plist from '@expo/plist';\nimport assert from 'assert';\nimport fs, { promises } from 'fs';\nimport path from 'path';\nimport xcode, { XcodeProject } from 'xcode';\n\nimport { ExportedConfig, ModConfig } from '../Plugin.types';\nimport { Entitlements, Paths } from '../ios';\nimport { ensureApplicationTargetEntitlementsFileConfigured } from '../ios/Entitlements';\nimport { InfoPlist } from '../ios/IosConfig.types';\nimport { getPbxproj } from '../ios/utils/Xcodeproj';\nimport { getInfoPlistPathFromPbxproj } from '../ios/utils/getInfoPlistPath';\nimport { fileExists } from '../utils/modules';\nimport { sortObject } from '../utils/sortObject';\nimport { addWarningIOS } from '../utils/warnings';\nimport { ForwardedBaseModOptions, provider, withGeneratedBaseMods } from './createBaseMod';\n\nconst { readFile, writeFile } = promises;\n\ntype IosModName = keyof Required<ModConfig>['ios'];\n\nfunction getEntitlementsPlistTemplate() {\n // TODO: Fetch the versioned template file if possible\n return {};\n}\n\nfunction getInfoPlistTemplate() {\n // TODO: Fetch the versioned template file if possible\n return {\n CFBundleDevelopmentRegion: '$(DEVELOPMENT_LANGUAGE)',\n CFBundleExecutable: '$(EXECUTABLE_NAME)',\n CFBundleIdentifier: '$(PRODUCT_BUNDLE_IDENTIFIER)',\n CFBundleName: '$(PRODUCT_NAME)',\n CFBundlePackageType: '$(PRODUCT_BUNDLE_PACKAGE_TYPE)',\n CFBundleInfoDictionaryVersion: '6.0',\n CFBundleSignature: '????',\n LSRequiresIPhoneOS: true,\n NSAppTransportSecurity: {\n NSAllowsArbitraryLoads: true,\n NSExceptionDomains: {\n localhost: {\n NSExceptionAllowsInsecureHTTPLoads: true,\n },\n },\n },\n UILaunchStoryboardName: 'SplashScreen',\n UIRequiredDeviceCapabilities: ['armv7'],\n UIViewControllerBasedStatusBarAppearance: false,\n UIStatusBarStyle: 'UIStatusBarStyleDefault',\n };\n}\n\nconst defaultProviders = {\n dangerous: provider<unknown>({\n getFilePath() {\n return '';\n },\n async read() {\n return {};\n },\n async write() {},\n }),\n // Append a rule to supply AppDelegate data to mods on `mods.ios.appDelegate`\n appDelegate: provider<Paths.AppDelegateProjectFile>({\n getFilePath({ modRequest: { projectRoot } }) {\n return Paths.getAppDelegateFilePath(projectRoot);\n },\n async read(filePath) {\n return Paths.getFileInfo(filePath);\n },\n async write(filePath: string, { modResults: { contents } }) {\n await writeFile(filePath, contents);\n },\n }),\n // Append a rule to supply Expo.plist data to mods on `mods.ios.expoPlist`\n expoPlist: provider<JSONObject>({\n isIntrospective: true,\n getFilePath({ modRequest: { platformProjectRoot, projectName } }) {\n const supportingDirectory = path.join(platformProjectRoot, projectName!, 'Supporting');\n return path.resolve(supportingDirectory, 'Expo.plist');\n },\n async read(filePath, { modRequest: { introspect } }) {\n try {\n return plist.parse(await readFile(filePath, 'utf8'));\n } catch (error) {\n if (introspect) {\n return {};\n }\n throw error;\n }\n },\n async write(filePath, { modResults, modRequest: { introspect } }) {\n if (introspect) {\n return;\n }\n await writeFile(filePath, plist.build(sortObject(modResults)));\n },\n }),\n // Append a rule to supply .xcodeproj data to mods on `mods.ios.xcodeproj`\n xcodeproj: provider<XcodeProject>({\n getFilePath({ modRequest: { projectRoot } }) {\n return Paths.getPBXProjectPath(projectRoot);\n },\n async read(filePath) {\n const project = xcode.project(filePath);\n project.parseSync();\n return project;\n },\n async write(filePath, { modResults }) {\n await writeFile(filePath, modResults.writeSync());\n },\n }),\n // Append a rule to supply Info.plist data to mods on `mods.ios.infoPlist`\n infoPlist: provider<InfoPlist, ForwardedBaseModOptions>({\n isIntrospective: true,\n async getFilePath(config) {\n let project: xcode.XcodeProject | null = null;\n try {\n project = getPbxproj(config.modRequest.projectRoot);\n } catch {\n // noop\n }\n\n // Only check / warn if a project actually exists, this'll provide\n // more accurate warning messages for users in managed projects.\n if (project) {\n const infoPlistBuildProperty = getInfoPlistPathFromPbxproj(project);\n\n if (infoPlistBuildProperty) {\n //: [root]/myapp/ios/MyApp/Info.plist\n const infoPlistPath = path.join(\n //: myapp/ios\n config.modRequest.platformProjectRoot,\n //: MyApp/Info.plist\n infoPlistBuildProperty\n );\n if (fileExists(infoPlistPath)) {\n return infoPlistPath;\n }\n addWarningIOS(\n 'mods.ios.infoPlist',\n `Info.plist file linked to Xcode project does not exist: ${infoPlistPath}`\n );\n } else {\n addWarningIOS('mods.ios.infoPlist', 'Failed to find Info.plist linked to Xcode project.');\n }\n }\n try {\n // Fallback on glob...\n return await Paths.getInfoPlistPath(config.modRequest.projectRoot);\n } catch (error: any) {\n if (config.modRequest.introspect) {\n // fallback to an empty string in introspection mode.\n return '';\n }\n throw error;\n }\n },\n async read(filePath, config) {\n // Apply all of the Info.plist values to the expo.ios.infoPlist object\n // TODO: Remove this in favor of just overwriting the Info.plist with the Expo object. This will enable people to actually remove values.\n if (!config.ios) config.ios = {};\n if (!config.ios.infoPlist) config.ios.infoPlist = {};\n\n let modResults: InfoPlist;\n try {\n const contents = await readFile(filePath, 'utf8');\n assert(contents, 'Info.plist is empty');\n modResults = plist.parse(contents) as InfoPlist;\n } catch (error: any) {\n // Throw errors in introspection mode.\n if (!config.modRequest.introspect) {\n throw error;\n }\n // Fallback to using the infoPlist object from the Expo config.\n modResults = getInfoPlistTemplate();\n }\n\n config.ios.infoPlist = {\n ...(modResults || {}),\n ...config.ios.infoPlist,\n };\n\n return config.ios.infoPlist!;\n },\n async write(filePath, config) {\n // Update the contents of the static infoPlist object\n if (!config.ios) {\n config.ios = {};\n }\n config.ios.infoPlist = config.modResults;\n\n // Return early without writing, in introspection mode.\n if (config.modRequest.introspect) {\n return;\n }\n\n await writeFile(filePath, plist.build(sortObject(config.modResults)));\n },\n }),\n // Append a rule to supply .entitlements data to mods on `mods.ios.entitlements`\n entitlements: provider<JSONObject, ForwardedBaseModOptions>({\n isIntrospective: true,\n\n async getFilePath(config) {\n try {\n ensureApplicationTargetEntitlementsFileConfigured(config.modRequest.projectRoot);\n return Entitlements.getEntitlementsPath(config.modRequest.projectRoot) ?? '';\n } catch (error: any) {\n if (config.modRequest.introspect) {\n // fallback to an empty string in introspection mode.\n return '';\n }\n throw error;\n }\n },\n\n async read(filePath, config) {\n let modResults: JSONObject;\n try {\n if (fs.existsSync(filePath)) {\n const contents = await readFile(filePath, 'utf8');\n assert(contents, 'Entitlements plist is empty');\n modResults = plist.parse(contents);\n } else {\n modResults = getEntitlementsPlistTemplate();\n }\n } catch (error: any) {\n // Throw errors in introspection mode.\n if (!config.modRequest.introspect) {\n throw error;\n }\n // Fallback to using the template file.\n modResults = getEntitlementsPlistTemplate();\n }\n\n // Apply all of the .entitlements values to the expo.ios.entitlements object\n // TODO: Remove this in favor of just overwriting the .entitlements with the Expo object. This will enable people to actually remove values.\n if (!config.ios) config.ios = {};\n if (!config.ios.entitlements) config.ios.entitlements = {};\n\n config.ios.entitlements = {\n ...(modResults || {}),\n ...config.ios.entitlements,\n };\n\n return config.ios.entitlements!;\n },\n\n async write(filePath, config) {\n // Update the contents of the static entitlements object\n if (!config.ios) {\n config.ios = {};\n }\n config.ios.entitlements = config.modResults;\n\n // Return early without writing, in introspection mode.\n if (config.modRequest.introspect) {\n return;\n }\n\n await writeFile(filePath, plist.build(sortObject(config.modResults)));\n },\n }),\n\n // Append a rule to supply Podfile.properties.json data to mods on `mods.ios.podfileProperties`\n podfileProperties: provider<Record<string, JSONValue>>({\n isIntrospective: true,\n\n getFilePath({ modRequest: { platformProjectRoot } }) {\n return path.resolve(platformProjectRoot, 'Podfile.properties.json');\n },\n async read(filePath) {\n let results: Record<string, JSONValue> = {};\n try {\n results = await JsonFile.readAsync(filePath);\n } catch {}\n return results;\n },\n async write(filePath, { modResults, modRequest: { introspect } }) {\n if (introspect) {\n return;\n }\n await JsonFile.writeAsync(filePath, modResults);\n },\n }),\n};\n\ntype IosDefaultProviders = typeof defaultProviders;\n\nexport function withIosBaseMods(\n config: ExportedConfig,\n {\n providers,\n ...props\n }: ForwardedBaseModOptions & { providers?: Partial<IosDefaultProviders> } = {}\n): ExportedConfig {\n return withGeneratedBaseMods<IosModName>(config, {\n ...props,\n platform: 'ios',\n providers: providers ?? getIosModFileProviders(),\n });\n}\n\nexport function getIosModFileProviders() {\n return defaultProviders;\n}\n"],"file":"withIosBaseMods.js"}
1
+ {"version":3,"file":"withIosBaseMods.js","names":["readFile","writeFile","promises","getEntitlementsPlistTemplate","getInfoPlistTemplate","CFBundleDevelopmentRegion","CFBundleExecutable","CFBundleIdentifier","CFBundleName","CFBundlePackageType","CFBundleInfoDictionaryVersion","CFBundleSignature","LSRequiresIPhoneOS","NSAppTransportSecurity","NSAllowsArbitraryLoads","NSExceptionDomains","localhost","NSExceptionAllowsInsecureHTTPLoads","UILaunchStoryboardName","UIRequiredDeviceCapabilities","UIViewControllerBasedStatusBarAppearance","UIStatusBarStyle","defaultProviders","dangerous","provider","getFilePath","read","write","appDelegate","modRequest","projectRoot","Paths","getAppDelegateFilePath","filePath","getFileInfo","modResults","contents","expoPlist","isIntrospective","platformProjectRoot","projectName","supportingDirectory","path","join","resolve","introspect","plist","parse","error","build","sortObject","xcodeproj","getPBXProjectPath","project","xcode","parseSync","writeSync","infoPlist","config","getPbxproj","infoPlistBuildProperty","getInfoPlistPathFromPbxproj","infoPlistPath","fileExists","addWarningIOS","getInfoPlistPath","ios","assert","entitlements","ensureApplicationTargetEntitlementsFileConfigured","Entitlements","getEntitlementsPath","fs","existsSync","podfileProperties","results","JsonFile","readAsync","writeAsync","withIosBaseMods","providers","props","withGeneratedBaseMods","platform","getIosModFileProviders"],"sources":["../../src/plugins/withIosBaseMods.ts"],"sourcesContent":["import JsonFile, { JSONObject, JSONValue } from '@expo/json-file';\nimport plist from '@expo/plist';\nimport assert from 'assert';\nimport fs, { promises } from 'fs';\nimport path from 'path';\nimport xcode, { XcodeProject } from 'xcode';\n\nimport { ExportedConfig, ModConfig } from '../Plugin.types';\nimport { Entitlements, Paths } from '../ios';\nimport { ensureApplicationTargetEntitlementsFileConfigured } from '../ios/Entitlements';\nimport { InfoPlist } from '../ios/IosConfig.types';\nimport { getPbxproj } from '../ios/utils/Xcodeproj';\nimport { getInfoPlistPathFromPbxproj } from '../ios/utils/getInfoPlistPath';\nimport { fileExists } from '../utils/modules';\nimport { sortObject } from '../utils/sortObject';\nimport { addWarningIOS } from '../utils/warnings';\nimport { ForwardedBaseModOptions, provider, withGeneratedBaseMods } from './createBaseMod';\n\nconst { readFile, writeFile } = promises;\n\ntype IosModName = keyof Required<ModConfig>['ios'];\n\nfunction getEntitlementsPlistTemplate() {\n // TODO: Fetch the versioned template file if possible\n return {};\n}\n\nfunction getInfoPlistTemplate() {\n // TODO: Fetch the versioned template file if possible\n return {\n CFBundleDevelopmentRegion: '$(DEVELOPMENT_LANGUAGE)',\n CFBundleExecutable: '$(EXECUTABLE_NAME)',\n CFBundleIdentifier: '$(PRODUCT_BUNDLE_IDENTIFIER)',\n CFBundleName: '$(PRODUCT_NAME)',\n CFBundlePackageType: '$(PRODUCT_BUNDLE_PACKAGE_TYPE)',\n CFBundleInfoDictionaryVersion: '6.0',\n CFBundleSignature: '????',\n LSRequiresIPhoneOS: true,\n NSAppTransportSecurity: {\n NSAllowsArbitraryLoads: true,\n NSExceptionDomains: {\n localhost: {\n NSExceptionAllowsInsecureHTTPLoads: true,\n },\n },\n },\n UILaunchStoryboardName: 'SplashScreen',\n UIRequiredDeviceCapabilities: ['armv7'],\n UIViewControllerBasedStatusBarAppearance: false,\n UIStatusBarStyle: 'UIStatusBarStyleDefault',\n };\n}\n\nconst defaultProviders = {\n dangerous: provider<unknown>({\n getFilePath() {\n return '';\n },\n async read() {\n return {};\n },\n async write() {},\n }),\n // Append a rule to supply AppDelegate data to mods on `mods.ios.appDelegate`\n appDelegate: provider<Paths.AppDelegateProjectFile>({\n getFilePath({ modRequest: { projectRoot } }) {\n return Paths.getAppDelegateFilePath(projectRoot);\n },\n async read(filePath) {\n return Paths.getFileInfo(filePath);\n },\n async write(filePath: string, { modResults: { contents } }) {\n await writeFile(filePath, contents);\n },\n }),\n // Append a rule to supply Expo.plist data to mods on `mods.ios.expoPlist`\n expoPlist: provider<JSONObject>({\n isIntrospective: true,\n getFilePath({ modRequest: { platformProjectRoot, projectName } }) {\n const supportingDirectory = path.join(platformProjectRoot, projectName!, 'Supporting');\n return path.resolve(supportingDirectory, 'Expo.plist');\n },\n async read(filePath, { modRequest: { introspect } }) {\n try {\n return plist.parse(await readFile(filePath, 'utf8'));\n } catch (error) {\n if (introspect) {\n return {};\n }\n throw error;\n }\n },\n async write(filePath, { modResults, modRequest: { introspect } }) {\n if (introspect) {\n return;\n }\n await writeFile(filePath, plist.build(sortObject(modResults)));\n },\n }),\n // Append a rule to supply .xcodeproj data to mods on `mods.ios.xcodeproj`\n xcodeproj: provider<XcodeProject>({\n getFilePath({ modRequest: { projectRoot } }) {\n return Paths.getPBXProjectPath(projectRoot);\n },\n async read(filePath) {\n const project = xcode.project(filePath);\n project.parseSync();\n return project;\n },\n async write(filePath, { modResults }) {\n await writeFile(filePath, modResults.writeSync());\n },\n }),\n // Append a rule to supply Info.plist data to mods on `mods.ios.infoPlist`\n infoPlist: provider<InfoPlist, ForwardedBaseModOptions>({\n isIntrospective: true,\n async getFilePath(config) {\n let project: xcode.XcodeProject | null = null;\n try {\n project = getPbxproj(config.modRequest.projectRoot);\n } catch {\n // noop\n }\n\n // Only check / warn if a project actually exists, this'll provide\n // more accurate warning messages for users in managed projects.\n if (project) {\n const infoPlistBuildProperty = getInfoPlistPathFromPbxproj(project);\n\n if (infoPlistBuildProperty) {\n //: [root]/myapp/ios/MyApp/Info.plist\n const infoPlistPath = path.join(\n //: myapp/ios\n config.modRequest.platformProjectRoot,\n //: MyApp/Info.plist\n infoPlistBuildProperty\n );\n if (fileExists(infoPlistPath)) {\n return infoPlistPath;\n }\n addWarningIOS(\n 'mods.ios.infoPlist',\n `Info.plist file linked to Xcode project does not exist: ${infoPlistPath}`\n );\n } else {\n addWarningIOS('mods.ios.infoPlist', 'Failed to find Info.plist linked to Xcode project.');\n }\n }\n try {\n // Fallback on glob...\n return await Paths.getInfoPlistPath(config.modRequest.projectRoot);\n } catch (error: any) {\n if (config.modRequest.introspect) {\n // fallback to an empty string in introspection mode.\n return '';\n }\n throw error;\n }\n },\n async read(filePath, config) {\n // Apply all of the Info.plist values to the expo.ios.infoPlist object\n // TODO: Remove this in favor of just overwriting the Info.plist with the Expo object. This will enable people to actually remove values.\n if (!config.ios) config.ios = {};\n if (!config.ios.infoPlist) config.ios.infoPlist = {};\n\n let modResults: InfoPlist;\n try {\n const contents = await readFile(filePath, 'utf8');\n assert(contents, 'Info.plist is empty');\n modResults = plist.parse(contents) as InfoPlist;\n } catch (error: any) {\n // Throw errors in introspection mode.\n if (!config.modRequest.introspect) {\n throw error;\n }\n // Fallback to using the infoPlist object from the Expo config.\n modResults = getInfoPlistTemplate();\n }\n\n config.ios.infoPlist = {\n ...(modResults || {}),\n ...config.ios.infoPlist,\n };\n\n return config.ios.infoPlist!;\n },\n async write(filePath, config) {\n // Update the contents of the static infoPlist object\n if (!config.ios) {\n config.ios = {};\n }\n config.ios.infoPlist = config.modResults;\n\n // Return early without writing, in introspection mode.\n if (config.modRequest.introspect) {\n return;\n }\n\n await writeFile(filePath, plist.build(sortObject(config.modResults)));\n },\n }),\n // Append a rule to supply .entitlements data to mods on `mods.ios.entitlements`\n entitlements: provider<JSONObject, ForwardedBaseModOptions>({\n isIntrospective: true,\n\n async getFilePath(config) {\n try {\n ensureApplicationTargetEntitlementsFileConfigured(config.modRequest.projectRoot);\n return Entitlements.getEntitlementsPath(config.modRequest.projectRoot) ?? '';\n } catch (error: any) {\n if (config.modRequest.introspect) {\n // fallback to an empty string in introspection mode.\n return '';\n }\n throw error;\n }\n },\n\n async read(filePath, config) {\n let modResults: JSONObject;\n try {\n if (fs.existsSync(filePath)) {\n const contents = await readFile(filePath, 'utf8');\n assert(contents, 'Entitlements plist is empty');\n modResults = plist.parse(contents);\n } else {\n modResults = getEntitlementsPlistTemplate();\n }\n } catch (error: any) {\n // Throw errors in introspection mode.\n if (!config.modRequest.introspect) {\n throw error;\n }\n // Fallback to using the template file.\n modResults = getEntitlementsPlistTemplate();\n }\n\n // Apply all of the .entitlements values to the expo.ios.entitlements object\n // TODO: Remove this in favor of just overwriting the .entitlements with the Expo object. This will enable people to actually remove values.\n if (!config.ios) config.ios = {};\n if (!config.ios.entitlements) config.ios.entitlements = {};\n\n config.ios.entitlements = {\n ...(modResults || {}),\n ...config.ios.entitlements,\n };\n\n return config.ios.entitlements!;\n },\n\n async write(filePath, config) {\n // Update the contents of the static entitlements object\n if (!config.ios) {\n config.ios = {};\n }\n config.ios.entitlements = config.modResults;\n\n // Return early without writing, in introspection mode.\n if (config.modRequest.introspect) {\n return;\n }\n\n await writeFile(filePath, plist.build(sortObject(config.modResults)));\n },\n }),\n\n // Append a rule to supply Podfile.properties.json data to mods on `mods.ios.podfileProperties`\n podfileProperties: provider<Record<string, JSONValue>>({\n isIntrospective: true,\n\n getFilePath({ modRequest: { platformProjectRoot } }) {\n return path.resolve(platformProjectRoot, 'Podfile.properties.json');\n },\n async read(filePath) {\n let results: Record<string, JSONValue> = {};\n try {\n results = await JsonFile.readAsync(filePath);\n } catch {}\n return results;\n },\n async write(filePath, { modResults, modRequest: { introspect } }) {\n if (introspect) {\n return;\n }\n await JsonFile.writeAsync(filePath, modResults);\n },\n }),\n};\n\ntype IosDefaultProviders = typeof defaultProviders;\n\nexport function withIosBaseMods(\n config: ExportedConfig,\n {\n providers,\n ...props\n }: ForwardedBaseModOptions & { providers?: Partial<IosDefaultProviders> } = {}\n): ExportedConfig {\n return withGeneratedBaseMods<IosModName>(config, {\n ...props,\n platform: 'ios',\n providers: providers ?? getIosModFileProviders(),\n });\n}\n\nexport function getIosModFileProviders() {\n return defaultProviders;\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;;;;;AAEA,MAAM;EAAEA,QAAF;EAAYC;AAAZ,IAA0BC,cAAhC;;AAIA,SAASC,4BAAT,GAAwC;EACtC;EACA,OAAO,EAAP;AACD;;AAED,SAASC,oBAAT,GAAgC;EAC9B;EACA,OAAO;IACLC,yBAAyB,EAAE,yBADtB;IAELC,kBAAkB,EAAE,oBAFf;IAGLC,kBAAkB,EAAE,8BAHf;IAILC,YAAY,EAAE,iBAJT;IAKLC,mBAAmB,EAAE,gCALhB;IAMLC,6BAA6B,EAAE,KAN1B;IAOLC,iBAAiB,EAAE,MAPd;IAQLC,kBAAkB,EAAE,IARf;IASLC,sBAAsB,EAAE;MACtBC,sBAAsB,EAAE,IADF;MAEtBC,kBAAkB,EAAE;QAClBC,SAAS,EA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OO,SAAS4C,eAAT,CACLrB,MADK,EAEL;EACEsB,SADF;EAEE,GAAGC;AAFL,IAG4E,EALvE,EAMW;EAChB,OAAO,IAAAC,sCAAA,EAAkCxB,MAAlC,EAA0C,EAC/C,GAAGuB,KAD4C;IAE/CE,QAAQ,EAAE,KAFqC;IAG/CH,SAAS,EAAEA,SAAF,aAAEA,SAAF,cAAEA,SAAF,GAAeI,sBAAsB;EAHC,CAA1C,CAAP;AAKD;;AAEM,SAASA,sBAAT,GAAkC;EACvC,OAAO9D,gBAAP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/plugins/withMod.ts"],"names":["EXPO_DEBUG","withBaseMod","config","platform","mod","action","skipEmptyMod","isProvider","isIntrospective","saveToInternal","mods","interceptedMod","noopMod","debugTrace","isDebug","_internal","stack","Error","getDebugPluginStackFromStackTrace","modStack","chalk","bold","PluginError","interceptingMod","modRequest","console","log","results","nextMod","saveToInternalObject","modResults","platformName","modName","stacktrace","treeStackLines","line","split","first","second","trim","push","plugins","map","match","filter","Boolean","plugin","includes","commonPlugins","reverse","pluginName","index","toLowerCase","red","blue","dim","join","withMod"],"mappings":";;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA,MAAMA,UAAU,GAAG,uBAAQ,YAAR,EAAsB,KAAtB,CAAnB;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,WAAT,CACLC,MADK,EAEL;AACEC,EAAAA,QADF;AAEEC,EAAAA,GAFF;AAGEC,EAAAA,MAHF;AAIEC,EAAAA,YAJF;AAKEC,EAAAA,UALF;AAMEC,EAAAA,eANF;AAOEC,EAAAA;AAPF,CAFK,EAWW;AAAA;;AAChB,MAAI,CAACP,MAAM,CAACQ,IAAZ,EAAkB;AACh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AAA,UAAU,GAAG9B,iBAAMC,IAAN,CAAW6B,UAAX,CAAb;AACD,KAJyB,CAK1B;;;AACA,QAAIA,UAAU,CAACE,WAAX,GAAyBL,QAAzB,CAAkC,WAAlC,CAAJ,EAAoD;AAClDG,MAAAA,UAAU,GAAG9B,iBAAMiC,GAAN,CAAUH,UAAV,CAAb;AACD;;AAED,QAAIC,KAAK,KAAK,CAAd,EAAiB;AACf,aAAO/B,iBAAMkC,IAAN,CAAWJ,UAAX,CAAP;AACD,KAFD,MAEO,IAAIF,aAAa,CAACD,QAAd,CAAuBG,UAAvB,CAAJ,EAAwC;AAC7C;AACA,aAAO9B,iBAAMmC,GAAN,CAAUL,UAAV,CAAP;AACD;;AACD,WAAOA,UAAP;AACD,GAnBH,EAoBE;AACA;AArBF,GAsBGM,IAtBH,CAsBQ,KAtBR,CADF;AAyBD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,OAAT,CACLvD,MADK,EAEL;AACEC,EAAAA,QADF;AAEEC,EAAAA,GAFF;AAGEC,EAAAA;AAHF,CAFK,EAWW;AAChB,SAAOJ,WAAW,CAACC,MAAD,EAAS;AACzBC,IAAAA,QADyB;AAEzBC,IAAAA,GAFyB;AAGzBG,IAAAA,UAAU,EAAE,KAHa;;AAIzB,UAAMF,MAAN,CAAa;AAAEmB,MAAAA,UAAU,EAAE;AAAEI,QAAAA,OAAF;AAAW,WAAGJ;AAAd,OAAd;AAA0CM,MAAAA,UAA1C;AAAsD,SAAG5B;AAAzD,KAAb,EAAgF;AAC9E,YAAMyB,OAAO,GAAG,MAAMtB,MAAM,CAAC;AAAEmB,QAAAA,UAAF;AAAcM,QAAAA,UAAU,EAAEA,UAA1B;AAA2C,WAAG5B;AAA9C,OAAD,CAA5B;AACA,aAAO0B,OAAO,CAAED,OAAF,CAAd;AACD;;AAPwB,GAAT,CAAlB;AASD","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport { JSONObject } from '@expo/json-file';\nimport chalk from 'chalk';\nimport { boolish } from 'getenv';\n\nimport { ExportedConfig, ExportedConfigWithProps, Mod, ModPlatform } from '../Plugin.types';\nimport { PluginError } from '../utils/errors';\n\nconst EXPO_DEBUG = boolish('EXPO_DEBUG', false);\n\nexport type BaseModOptions = {\n platform: ModPlatform;\n mod: string;\n isProvider?: boolean;\n skipEmptyMod?: boolean;\n saveToInternal?: boolean;\n /**\n * If the mod supports introspection, and avoids making any filesystem modifications during compilation.\n * By enabling, this mod, and all of its descendants will be run in introspection mode.\n * This should only be used for static files like JSON or XML, and not for application files that require regexes,\n * or complex static files that require other files to be generated like Xcode `.pbxproj`.\n */\n isIntrospective?: boolean;\n};\n\n/**\n * Plugin to intercept execution of a given `mod` with the given `action`.\n * If an action was already set on the given `config` config for `mod`, then it\n * will be provided to the `action` as `nextMod` when it's evaluated, otherwise\n * `nextMod` will be an identity function.\n *\n * @param config exported config\n * @param platform platform to target (ios or android)\n * @param mod name of the platform function to intercept\n * @param skipEmptyMod should skip running the action if there is no existing mod to intercept\n * @param saveToInternal should save the results to `_internal.modResults`, only enable this when the results are pure JSON.\n * @param isProvider should provide data up to the other mods.\n * @param action method to run on the mod when the config is compiled\n */\nexport function withBaseMod<T>(\n config: ExportedConfig,\n {\n platform,\n mod,\n action,\n skipEmptyMod,\n isProvider,\n isIntrospective,\n saveToInternal,\n }: BaseModOptions & { action: Mod<T> }\n): ExportedConfig {\n if (!config.mods) {\n config.mods = {};\n }\n if (!config.mods[platform]) {\n config.mods[platform] = {};\n }\n\n let interceptedMod: Mod<T> = (config.mods[platform] as Record<string, any>)[mod];\n\n // No existing mod to intercept\n if (!interceptedMod) {\n if (skipEmptyMod) {\n // Skip running the action\n return config;\n }\n // Use a noop mod and continue\n const noopMod: Mod<T> = config => config;\n interceptedMod = noopMod;\n }\n\n // Create a stack trace for debugging ahead of time\n let debugTrace: string = '';\n // Use the possibly user defined value. Otherwise fallback to the env variable.\n // We support the env variable because user mods won't have _internal defined in time.\n const isDebug = config._internal?.isDebug ?? EXPO_DEBUG;\n if (isDebug) {\n // Get a stack trace via the Error API\n const stack = new Error().stack;\n // Format the stack trace to create the debug log\n debugTrace = getDebugPluginStackFromStackTrace(stack);\n const modStack = chalk.bold(`${platform}.${mod}`);\n\n debugTrace = `${modStack}: ${debugTrace}`;\n }\n\n // Prevent adding multiple providers to a mod.\n // Base mods that provide files ignore any incoming modResults and therefore shouldn't have provider mods as parents.\n if (interceptedMod.isProvider) {\n if (isProvider) {\n throw new PluginError(\n `Cannot set provider mod for \"${platform}.${mod}\" because another is already being used.`,\n 'CONFLICTING_PROVIDER'\n );\n } else {\n throw new PluginError(\n `Cannot add mod to \"${platform}.${mod}\" because the provider has already been added. Provider must be the last mod added.`,\n 'INVALID_MOD_ORDER'\n );\n }\n }\n\n async function interceptingMod({ modRequest, ...config }: ExportedConfigWithProps<T>) {\n if (isDebug) {\n // In debug mod, log the plugin stack in the order which they were invoked\n console.log(debugTrace);\n }\n const results = await action({\n ...config,\n modRequest: { ...modRequest, nextMod: interceptedMod },\n });\n\n if (saveToInternal) {\n saveToInternalObject(results, platform, mod, (results.modResults as unknown) as JSONObject);\n }\n return results;\n }\n\n // Ensure this base mod is registered as the provider.\n interceptingMod.isProvider = isProvider;\n\n if (isIntrospective) {\n // Register the mode as idempotent so introspection doesn't remove it.\n interceptingMod.isIntrospective = isIntrospective;\n }\n\n (config.mods[platform] as any)[mod] = interceptingMod;\n\n return config;\n}\n\nfunction saveToInternalObject(\n config: Pick<ExpoConfig, '_internal'>,\n platformName: ModPlatform,\n modName: string,\n results: JSONObject\n) {\n if (!config._internal) config._internal = {};\n if (!config._internal.modResults) config._internal.modResults = {};\n if (!config._internal.modResults[platformName]) config._internal.modResults[platformName] = {};\n config._internal.modResults[platformName][modName] = results;\n}\n\nfunction getDebugPluginStackFromStackTrace(stacktrace?: string): string {\n if (!stacktrace) {\n return '';\n }\n\n const treeStackLines: string[] = [];\n for (const line of stacktrace.split('\\n')) {\n const [first, second] = line.trim().split(' ');\n if (first === 'at') {\n treeStackLines.push(second);\n }\n }\n\n const plugins = treeStackLines\n .map(first => {\n // Match the first part of the stack trace against the plugin naming convention\n // \"with\" followed by a capital letter.\n return (\n first?.match(/^(\\bwith[A-Z].*?\\b)/)?.[1]?.trim() ??\n first?.match(/\\.(\\bwith[A-Z].*?\\b)/)?.[1]?.trim() ??\n null\n );\n })\n .filter(Boolean)\n .filter(plugin => {\n // redundant as all debug logs are captured in withBaseMod\n return !['withMod', 'withBaseMod', 'withExtendedMod'].includes(plugin!);\n });\n\n const commonPlugins = ['withPlugins', 'withRunOnce', 'withStaticPlugin'];\n\n return (\n (plugins as string[])\n .reverse()\n .map((pluginName, index) => {\n // Base mods indicate a logical section.\n if (pluginName.includes('BaseMod')) {\n pluginName = chalk.bold(pluginName);\n }\n // highlight dangerous mods\n if (pluginName.toLowerCase().includes('dangerous')) {\n pluginName = chalk.red(pluginName);\n }\n\n if (index === 0) {\n return chalk.blue(pluginName);\n } else if (commonPlugins.includes(pluginName)) {\n // Common mod names often clutter up the logs, dim them out\n return chalk.dim(pluginName);\n }\n return pluginName;\n })\n // Join the results:\n // withAndroidExpoPlugins ➜ withPlugins ➜ withIcons ➜ withDangerousMod ➜ withMod\n .join(' ➜ ')\n );\n}\n\n/**\n * Plugin to extend a mod function in the plugins config.\n *\n * @param config exported config\n * @param platform platform to target (ios or android)\n * @param mod name of the platform function to extend\n * @param action method to run on the mod when the config is compiled\n */\nexport function withMod<T>(\n config: ExportedConfig,\n {\n platform,\n mod,\n action,\n }: {\n platform: ModPlatform;\n mod: string;\n action: Mod<T>;\n }\n): ExportedConfig {\n return withBaseMod(config, {\n platform,\n mod,\n isProvider: false,\n async action({ modRequest: { nextMod, ...modRequest }, modResults, ...config }) {\n const results = await action({ modRequest, modResults: modResults as T, ...config });\n return nextMod!(results as any);\n },\n });\n}\n"],"file":"withMod.js"}
1
+ {"version":3,"file":"withMod.js","names":["EXPO_DEBUG","boolish","withBaseMod","config","platform","mod","action","skipEmptyMod","isProvider","isIntrospective","saveToInternal","mods","interceptedMod","noopMod","debugTrace","isDebug","_internal","stack","Error","getDebugPluginStackFromStackTrace","modStack","chalk","bold","PluginError","interceptingMod","modRequest","console","log","results","nextMod","saveToInternalObject","modResults","platformName","modName","stacktrace","treeStackLines","line","split","first","second","trim","push","plugins","map","match","filter","Boolean","plugin","includes","commonPlugins","reverse","pluginName","index","toLowerCase","red","blue","dim","join","withMod"],"sources":["../../src/plugins/withMod.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport { JSONObject } from '@expo/json-file';\nimport chalk from 'chalk';\nimport { boolish } from 'getenv';\n\nimport { ExportedConfig, ExportedConfigWithProps, Mod, ModPlatform } from '../Plugin.types';\nimport { PluginError } from '../utils/errors';\n\nconst EXPO_DEBUG = boolish('EXPO_DEBUG', false);\n\nexport type BaseModOptions = {\n platform: ModPlatform;\n mod: string;\n isProvider?: boolean;\n skipEmptyMod?: boolean;\n saveToInternal?: boolean;\n /**\n * If the mod supports introspection, and avoids making any filesystem modifications during compilation.\n * By enabling, this mod, and all of its descendants will be run in introspection mode.\n * This should only be used for static files like JSON or XML, and not for application files that require regexes,\n * or complex static files that require other files to be generated like Xcode `.pbxproj`.\n */\n isIntrospective?: boolean;\n};\n\n/**\n * Plugin to intercept execution of a given `mod` with the given `action`.\n * If an action was already set on the given `config` config for `mod`, then it\n * will be provided to the `action` as `nextMod` when it's evaluated, otherwise\n * `nextMod` will be an identity function.\n *\n * @param config exported config\n * @param platform platform to target (ios or android)\n * @param mod name of the platform function to intercept\n * @param skipEmptyMod should skip running the action if there is no existing mod to intercept\n * @param saveToInternal should save the results to `_internal.modResults`, only enable this when the results are pure JSON.\n * @param isProvider should provide data up to the other mods.\n * @param action method to run on the mod when the config is compiled\n */\nexport function withBaseMod<T>(\n config: ExportedConfig,\n {\n platform,\n mod,\n action,\n skipEmptyMod,\n isProvider,\n isIntrospective,\n saveToInternal,\n }: BaseModOptions & { action: Mod<T> }\n): ExportedConfig {\n if (!config.mods) {\n config.mods = {};\n }\n if (!config.mods[platform]) {\n config.mods[platform] = {};\n }\n\n let interceptedMod: Mod<T> = (config.mods[platform] as Record<string, any>)[mod];\n\n // No existing mod to intercept\n if (!interceptedMod) {\n if (skipEmptyMod) {\n // Skip running the action\n return config;\n }\n // Use a noop mod and continue\n const noopMod: Mod<T> = (config) => config;\n interceptedMod = noopMod;\n }\n\n // Create a stack trace for debugging ahead of time\n let debugTrace: string = '';\n // Use the possibly user defined value. Otherwise fallback to the env variable.\n // We support the env variable because user mods won't have _internal defined in time.\n const isDebug = config._internal?.isDebug ?? EXPO_DEBUG;\n if (isDebug) {\n // Get a stack trace via the Error API\n const stack = new Error().stack;\n // Format the stack trace to create the debug log\n debugTrace = getDebugPluginStackFromStackTrace(stack);\n const modStack = chalk.bold(`${platform}.${mod}`);\n\n debugTrace = `${modStack}: ${debugTrace}`;\n }\n\n // Prevent adding multiple providers to a mod.\n // Base mods that provide files ignore any incoming modResults and therefore shouldn't have provider mods as parents.\n if (interceptedMod.isProvider) {\n if (isProvider) {\n throw new PluginError(\n `Cannot set provider mod for \"${platform}.${mod}\" because another is already being used.`,\n 'CONFLICTING_PROVIDER'\n );\n } else {\n throw new PluginError(\n `Cannot add mod to \"${platform}.${mod}\" because the provider has already been added. Provider must be the last mod added.`,\n 'INVALID_MOD_ORDER'\n );\n }\n }\n\n async function interceptingMod({ modRequest, ...config }: ExportedConfigWithProps<T>) {\n if (isDebug) {\n // In debug mod, log the plugin stack in the order which they were invoked\n console.log(debugTrace);\n }\n const results = await action({\n ...config,\n modRequest: { ...modRequest, nextMod: interceptedMod },\n });\n\n if (saveToInternal) {\n saveToInternalObject(results, platform, mod, results.modResults as unknown as JSONObject);\n }\n return results;\n }\n\n // Ensure this base mod is registered as the provider.\n interceptingMod.isProvider = isProvider;\n\n if (isIntrospective) {\n // Register the mode as idempotent so introspection doesn't remove it.\n interceptingMod.isIntrospective = isIntrospective;\n }\n\n (config.mods[platform] as any)[mod] = interceptingMod;\n\n return config;\n}\n\nfunction saveToInternalObject(\n config: Pick<ExpoConfig, '_internal'>,\n platformName: ModPlatform,\n modName: string,\n results: JSONObject\n) {\n if (!config._internal) config._internal = {};\n if (!config._internal.modResults) config._internal.modResults = {};\n if (!config._internal.modResults[platformName]) config._internal.modResults[platformName] = {};\n config._internal.modResults[platformName][modName] = results;\n}\n\nfunction getDebugPluginStackFromStackTrace(stacktrace?: string): string {\n if (!stacktrace) {\n return '';\n }\n\n const treeStackLines: string[] = [];\n for (const line of stacktrace.split('\\n')) {\n const [first, second] = line.trim().split(' ');\n if (first === 'at') {\n treeStackLines.push(second);\n }\n }\n\n const plugins = treeStackLines\n .map((first) => {\n // Match the first part of the stack trace against the plugin naming convention\n // \"with\" followed by a capital letter.\n return (\n first?.match(/^(\\bwith[A-Z].*?\\b)/)?.[1]?.trim() ??\n first?.match(/\\.(\\bwith[A-Z].*?\\b)/)?.[1]?.trim() ??\n null\n );\n })\n .filter(Boolean)\n .filter((plugin) => {\n // redundant as all debug logs are captured in withBaseMod\n return !['withMod', 'withBaseMod', 'withExtendedMod'].includes(plugin!);\n });\n\n const commonPlugins = ['withPlugins', 'withRunOnce', 'withStaticPlugin'];\n\n return (\n (plugins as string[])\n .reverse()\n .map((pluginName, index) => {\n // Base mods indicate a logical section.\n if (pluginName.includes('BaseMod')) {\n pluginName = chalk.bold(pluginName);\n }\n // highlight dangerous mods\n if (pluginName.toLowerCase().includes('dangerous')) {\n pluginName = chalk.red(pluginName);\n }\n\n if (index === 0) {\n return chalk.blue(pluginName);\n } else if (commonPlugins.includes(pluginName)) {\n // Common mod names often clutter up the logs, dim them out\n return chalk.dim(pluginName);\n }\n return pluginName;\n })\n // Join the results:\n // withAndroidExpoPlugins ➜ withPlugins ➜ withIcons ➜ withDangerousMod ➜ withMod\n .join(' ➜ ')\n );\n}\n\n/**\n * Plugin to extend a mod function in the plugins config.\n *\n * @param config exported config\n * @param platform platform to target (ios or android)\n * @param mod name of the platform function to extend\n * @param action method to run on the mod when the config is compiled\n */\nexport function withMod<T>(\n config: ExportedConfig,\n {\n platform,\n mod,\n action,\n }: {\n platform: ModPlatform;\n mod: string;\n action: Mod<T>;\n }\n): ExportedConfig {\n return withBaseMod(config, {\n platform,\n mod,\n isProvider: false,\n async action({ modRequest: { nextMod, ...modRequest }, modResults, ...config }) {\n const results = await action({ modRequest, modResults: modResults as T, ...config });\n return nextMod!(results as any);\n },\n });\n}\n"],"mappings":";;;;;;;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAEA,MAAMA,UAAU,GAAG,IAAAC,iBAAA,EAAQ,YAAR,EAAsB,KAAtB,CAAnB;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,WAAT,CACLC,MADK,EAEL;EACEC,QADF;EAEEC,GAFF;EAGEC,MAHF;EAIEC,YAJF;EAKEC,UALF;EAMEC,eANF;EAOEC;AAPF,CAFK,EAWW;EAAA;;EAChB,IAAI,CAACP,MAAM,CAACQ,IAAZ,EAAkB;IAChBR,MAAM,CAACQ,IAAP,GAAc,EAAd;EACD;;EACD,IAAI,CAACR,MAAM,CAACQ,IAAP,CAAYP,QAAZ,CAAL,EAA4B;IAC1BD,MAAM,CAACQ,IAAP,CAAYP,QAAZ,IAAwB,EAAxB;EACD;;EAED,IAAIQ,cAAsB,GAAIT,MAAM,CAACQ,IAAP,CAAYP,QAAZ,CAAD,CAA+CC,GAA/C,CAA7B,CARgB,CAUhB;;EACA,IAAI,CAACO,cAAL,EAAqB;IACnB,IAAIL,YAAJ,EAAkB;MAChB;MACA,OAAOJ,MAAP;IACD,CAJkB,CAKnB;;;IACA,MAAMU,OAAe,GAAIV,MAAD,IAAYA,MAApC;;IACAS,cAAc,GAAGC,OAAjB;EACD,CAnBe,CAqBhB;;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ACA;;;AACO,SAASC,OAAT,CACLvD,MADK,EAEL;EACEC,QADF;EAEEC,GAFF;EAGEC;AAHF,CAFK,EAWW;EAChB,OAAOJ,WAAW,CAACC,MAAD,EAAS;IACzBC,QADyB;IAEzBC,GAFyB;IAGzBG,UAAU,EAAE,KAHa;;IAIzB,MAAMF,MAAN,CAAa;MAAEmB,UAAU,EAAE;QAAEI,OAAF;QAAW,GAAGJ;MAAd,CAAd;MAA0CM,UAA1C;MAAsD,GAAG5B;IAAzD,CAAb,EAAgF;MAC9E,MAAMyB,OAAO,GAAG,MAAMtB,MAAM,CAAC;QAAEmB,UAAF;QAAcM,UAAU,EAAEA,UAA1B;QAA2C,GAAG5B;MAA9C,CAAD,CAA5B;MACA,OAAO0B,OAAO,CAAED,OAAF,CAAd;IACD;;EAPwB,CAAT,CAAlB;AASD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/plugins/withPlugins.ts"],"names":["withPlugins","config","plugins","Array","isArray","reduce","prev","plugin"],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,WAAmE,GAAG,CACjFC,MADiF,EAEjFC,OAFiF,KAG9E;AACH,yBACEC,KAAK,CAACC,OAAN,CAAcF,OAAd,CADF,EAEE,sEAFF;AAIA,SAAOA,OAAO,CAACG,MAAR,CAAe,CAACC,IAAD,EAAOC,MAAP,KAAkB,0CAAiBD,IAAjB,EAAuB;AAAEC,IAAAA;AAAF,GAAvB,CAAjC,EAAqEN,MAArE,CAAP;AACD,CATM","sourcesContent":["import assert from 'assert';\n\nimport { ConfigPlugin, StaticPlugin } from '../Plugin.types';\nimport { withStaticPlugin } from './withStaticPlugin';\n\n/**\n * Resolves a list of plugins.\n *\n * @param config exported config\n * @param plugins list of config config plugins to apply to the exported config\n */\nexport const withPlugins: ConfigPlugin<(StaticPlugin | ConfigPlugin | string)[]> = (\n config,\n plugins\n) => {\n assert(\n Array.isArray(plugins),\n 'withPlugins expected a valid array of plugins or plugin module paths'\n );\n return plugins.reduce((prev, plugin) => withStaticPlugin(prev, { plugin }), config);\n};\n"],"file":"withPlugins.js"}
1
+ {"version":3,"file":"withPlugins.js","names":["withPlugins","config","plugins","assert","Array","isArray","reduce","prev","plugin","withStaticPlugin"],"sources":["../../src/plugins/withPlugins.ts"],"sourcesContent":["import assert from 'assert';\n\nimport { ConfigPlugin, StaticPlugin } from '../Plugin.types';\nimport { withStaticPlugin } from './withStaticPlugin';\n\n/**\n * Resolves a list of plugins.\n *\n * @param config exported config\n * @param plugins list of config config plugins to apply to the exported config\n */\nexport const withPlugins: ConfigPlugin<(StaticPlugin | ConfigPlugin | string)[]> = (\n config,\n plugins\n) => {\n assert(\n Array.isArray(plugins),\n 'withPlugins expected a valid array of plugins or plugin module paths'\n );\n return plugins.reduce((prev, plugin) => withStaticPlugin(prev, { plugin }), config);\n};\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,WAAmE,GAAG,CACjFC,MADiF,EAEjFC,OAFiF,KAG9E;EACH,IAAAC,iBAAA,EACEC,KAAK,CAACC,OAAN,CAAcH,OAAd,CADF,EAEE,sEAFF;EAIA,OAAOA,OAAO,CAACI,MAAR,CAAe,CAACC,IAAD,EAAOC,MAAP,KAAkB,IAAAC,oCAAA,EAAiBF,IAAjB,EAAuB;IAAEC;EAAF,CAAvB,CAAjC,EAAqEP,MAArE,CAAP;AACD,CATM"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/plugins/withRunOnce.ts"],"names":["withRunOnce","config","plugin","name","version","createRunOncePlugin","props"],"mappings":";;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,WAIX,GAAG,CAACC,MAAD,EAAS;AAAEC,EAAAA,MAAF;AAAUC,EAAAA,IAAV;AAAgBC,EAAAA;AAAhB,CAAT,KAAuC;AAC1C;AACA,MAAI,+BAAeH,MAAf,EAAuBE,IAAvB,CAAJ,EAAkC;AAChC,WAAOF,MAAP;AACD,GAJyC,CAM1C;;;AACAA,EAAAA,MAAM,GAAG,+BAAeA,MAAf,EAAuB;AAAEE,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAvB,CAAT;AAEA,SAAOF,MAAM,CAACD,MAAD,CAAb;AACD,CAdM;AAgBP;AACA;AACA;AACA;AACA;;;;;AACO,SAASI,mBAAT,CACLH,MADK,EAELC,IAFK,EAGLC,OAHK,EAIY;AACjB,SAAO,CAACH,MAAD,EAASK,KAAT,KAAmB;AACxB,WAAON,WAAW,CAACC,MAAD,EAAS;AAAEC,MAAAA,MAAM,EAAED,MAAM,IAAIC,MAAM,CAACD,MAAD,EAASK,KAAT,CAA1B;AAA2CH,MAAAA,IAA3C;AAAiDC,MAAAA;AAAjD,KAAT,CAAlB;AACD,GAFD;AAGD","sourcesContent":["import { ConfigPlugin } from '../Plugin.types';\nimport { addHistoryItem, getHistoryItem, PluginHistoryItem } from '../utils/history';\n\n/**\n * Prevents the same plugin from being run twice.\n * Used for migrating from unversioned expo config plugins to versioned plugins.\n *\n * @param config\n * @param name\n */\nexport const withRunOnce: ConfigPlugin<{\n plugin: ConfigPlugin<void>;\n name: PluginHistoryItem['name'];\n version?: PluginHistoryItem['version'];\n}> = (config, { plugin, name, version }) => {\n // Detect if a plugin has already been run on this config.\n if (getHistoryItem(config, name)) {\n return config;\n }\n\n // Push the history item so duplicates cannot be run.\n config = addHistoryItem(config, { name, version });\n\n return plugin(config);\n};\n\n/**\n * Helper method for creating mods from existing config functions.\n *\n * @param action\n */\nexport function createRunOncePlugin<T>(\n plugin: ConfigPlugin<T>,\n name: string,\n version?: string\n): ConfigPlugin<T> {\n return (config, props) => {\n return withRunOnce(config, { plugin: config => plugin(config, props), name, version });\n };\n}\n"],"file":"withRunOnce.js"}
1
+ {"version":3,"file":"withRunOnce.js","names":["withRunOnce","config","plugin","name","version","getHistoryItem","addHistoryItem","createRunOncePlugin","props"],"sources":["../../src/plugins/withRunOnce.ts"],"sourcesContent":["import { ConfigPlugin } from '../Plugin.types';\nimport { addHistoryItem, getHistoryItem, PluginHistoryItem } from '../utils/history';\n\n/**\n * Prevents the same plugin from being run twice.\n * Used for migrating from unversioned expo config plugins to versioned plugins.\n *\n * @param config\n * @param name\n */\nexport const withRunOnce: ConfigPlugin<{\n plugin: ConfigPlugin<void>;\n name: PluginHistoryItem['name'];\n version?: PluginHistoryItem['version'];\n}> = (config, { plugin, name, version }) => {\n // Detect if a plugin has already been run on this config.\n if (getHistoryItem(config, name)) {\n return config;\n }\n\n // Push the history item so duplicates cannot be run.\n config = addHistoryItem(config, { name, version });\n\n return plugin(config);\n};\n\n/**\n * Helper method for creating mods from existing config functions.\n *\n * @param action\n */\nexport function createRunOncePlugin<T>(\n plugin: ConfigPlugin<T>,\n name: string,\n version?: string\n): ConfigPlugin<T> {\n return (config, props) => {\n return withRunOnce(config, { plugin: (config) => plugin(config, props), name, version });\n };\n}\n"],"mappings":";;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,WAIX,GAAG,CAACC,MAAD,EAAS;EAAEC,MAAF;EAAUC,IAAV;EAAgBC;AAAhB,CAAT,KAAuC;EAC1C;EACA,IAAI,IAAAC,yBAAA,EAAeJ,MAAf,EAAuBE,IAAvB,CAAJ,EAAkC;IAChC,OAAOF,MAAP;EACD,CAJyC,CAM1C;;;EACAA,MAAM,GAAG,IAAAK,yBAAA,EAAeL,MAAf,EAAuB;IAAEE,IAAF;IAAQC;EAAR,CAAvB,CAAT;EAEA,OAAOF,MAAM,CAACD,MAAD,CAAb;AACD,CAdM;AAgBP;AACA;AACA;AACA;AACA;;;;;AACO,SAASM,mBAAT,CACLL,MADK,EAELC,IAFK,EAGLC,OAHK,EAIY;EACjB,OAAO,CAACH,MAAD,EAASO,KAAT,KAAmB;IACxB,OAAOR,WAAW,CAACC,MAAD,EAAS;MAAEC,MAAM,EAAGD,MAAD,IAAYC,MAAM,CAACD,MAAD,EAASO,KAAT,CAA5B;MAA6CL,IAA7C;MAAmDC;IAAnD,CAAT,CAAlB;EACD,CAFD;AAGD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/plugins/withStaticPlugin.ts"],"names":["EXPO_DEBUG","EXPO_CONFIG_PLUGIN_VERBOSE_ERRORS","EXPO_USE_UNVERSIONED_PLUGINS","isModuleMissingError","name","error","includes","code","message","isUnexpectedTokenError","SyntaxError","PluginError","match","withStaticPlugin","config","props","projectRoot","_internal","pluginResolve","pluginProps","plugin","_resolverError","withPlugin","_isLegacyPlugin","fallback","console","log","shouldMuteWarning"],"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;;;;AAMA,MAAMA,UAAU,GAAG,uBAAQ,YAAR,EAAsB,KAAtB,CAAnB,C,CAEA;;AACA,MAAMC,iCAAiC,GAAG,uBAAQ,mCAAR,EAA6C,KAA7C,CAA1C,C,CACA;AACA;;AACA,MAAMC,4BAA4B,GAAG,uBAAQ,8BAAR,EAAwC,KAAxC,CAArC;;AAEA,SAASC,oBAAT,CAA8BC,IAA9B,EAA4CC,KAA5C,EAAmE;AACjE;AACA,MAAI,CAAC,kBAAD,EAAqB,kBAArB,EAAyCC,QAAzC,CAAkDD,KAAK,CAACE,IAAxD,CAAJ,EAAmE;AACjE,WAAO,IAAP;AACD;;AACD,SAAOF,KAAK,CAACG,OAAN,CAA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AJ,EAAAA,MAAM,GAAGQ,UAAU,CAACR,MAAD,EAASK,WAAT,CAAnB;AACA,SAAOL,MAAP;AACD,CA1FM","sourcesContent":["import assert from 'assert';\nimport { boolish } from 'getenv';\n\nimport { ConfigPlugin, StaticPlugin } from '../Plugin.types';\nimport { PluginError } from '../utils/errors';\nimport {\n assertInternalProjectRoot,\n normalizeStaticPlugin,\n resolveConfigPluginFunction,\n} from '../utils/plugin-resolver';\n\nconst EXPO_DEBUG = boolish('EXPO_DEBUG', false);\n\n// Show all error info related to plugin resolution.\nconst EXPO_CONFIG_PLUGIN_VERBOSE_ERRORS = boolish('EXPO_CONFIG_PLUGIN_VERBOSE_ERRORS', false);\n// Force using the fallback unversioned plugin instead of a local versioned copy,\n// this should only be used for testing the CLI.\nconst EXPO_USE_UNVERSIONED_PLUGINS = boolish('EXPO_USE_UNVERSIONED_PLUGINS', false);\n\nfunction isModuleMissingError(name: string, error: Error): boolean {\n // @ts-ignore\n if (['MODULE_NOT_FOUND', 'PLUGIN_NOT_FOUND'].includes(error.code)) {\n return true;\n }\n return error.message.includes(`Cannot find module '${name}'`);\n}\n\nfunction isUnexpectedTokenError(error: Error): boolean {\n if (\n error instanceof SyntaxError ||\n (error instanceof PluginError && error.code === 'INVALID_PLUGIN_IMPORT')\n ) {\n return (\n // These are the most common errors that'll be thrown when a package isn't transpiled correctly.\n !!error.message.match(/Unexpected token/) ||\n !!error.message.match(/Cannot use import statement/)\n );\n }\n return false;\n}\n\n/**\n * Resolves static module plugin and potentially falls back on a provided plugin if the module cannot be resolved\n *\n * @param config\n * @param fallback Plugin with `_resolverError` explaining why the module couldn't be used\n * @param projectRoot optional project root, fallback to _internal.projectRoot. Used for testing.\n * @param _isLegacyPlugin Used to suppress errors thrown by plugins that are applied automatically\n */\nexport const withStaticPlugin: ConfigPlugin<{\n plugin: StaticPlugin | ConfigPlugin | string;\n fallback?: ConfigPlugin<{ _resolverError: Error } & any>;\n projectRoot?: string;\n _isLegacyPlugin?: boolean;\n}> = (config, props) => {\n let projectRoot = props.projectRoot;\n if (!projectRoot) {\n projectRoot = config._internal?.projectRoot;\n assertInternalProjectRoot(projectRoot);\n }\n\n let [pluginResolve, pluginProps] = normalizeStaticPlugin(props.plugin);\n // Ensure no one uses this property by accident.\n assert(\n !pluginProps?._resolverError,\n `Plugin property '_resolverError' is a reserved property of \\`withStaticPlugin\\``\n );\n\n let withPlugin: ConfigPlugin<unknown>;\n\n if (\n // Function was provided, no need to resolve: [withPlugin, {}]\n typeof pluginResolve === 'function'\n ) {\n withPlugin = pluginResolve;\n } else if (typeof pluginResolve === 'string') {\n try {\n // Resolve and evaluate plugins.\n withPlugin = resolveConfigPluginFunction(projectRoot, pluginResolve);\n\n // Only force if the project has the versioned plugin, otherwise use default behavior.\n // This helps see which plugins are being skipped.\n if (\n EXPO_USE_UNVERSIONED_PLUGINS &&\n !!withPlugin &&\n !!props._isLegacyPlugin &&\n !!props.fallback\n ) {\n console.log(`Force \"${pluginResolve}\" to unversioned plugin`);\n withPlugin = props.fallback;\n }\n } catch (error: any) {\n if (EXPO_DEBUG) {\n if (EXPO_CONFIG_PLUGIN_VERBOSE_ERRORS) {\n // Log the error in debug mode for plugins with fallbacks (like the Expo managed plugins).\n console.log(`Error resolving plugin \"${pluginResolve}\"`);\n console.log(error);\n console.log();\n } else {\n const shouldMuteWarning =\n props._isLegacyPlugin &&\n (isModuleMissingError(pluginResolve, error) || isUnexpectedTokenError(error));\n if (!shouldMuteWarning) {\n if (isModuleMissingError(pluginResolve, error)) {\n // Prevent causing log spew for basic resolution errors.\n console.log(`Could not find plugin \"${pluginResolve}\"`);\n } else {\n // Log the error in debug mode for plugins with fallbacks (like the Expo managed plugins).\n console.log(`Error resolving plugin \"${pluginResolve}\"`);\n console.log(error);\n console.log();\n }\n }\n }\n }\n // TODO: Maybe allow for `PluginError`s to be thrown so external plugins can assert invalid options.\n\n // If the static module failed to resolve, attempt to use a fallback.\n // This enables support for built-in plugins with versioned variations living in other packages.\n if (props.fallback) {\n if (!pluginProps) pluginProps = {};\n // Pass this to the fallback plugin for potential warnings about needing to install a versioned package.\n pluginProps._resolverError = error;\n withPlugin = props.fallback;\n } else {\n // If no fallback, throw the resolution error.\n throw error;\n }\n }\n } else {\n throw new PluginError(\n `Plugin is an unexpected type: ${typeof pluginResolve}`,\n 'INVALID_PLUGIN_TYPE'\n );\n }\n\n // Execute the plugin.\n config = withPlugin(config, pluginProps);\n return config;\n};\n"],"file":"withStaticPlugin.js"}
1
+ {"version":3,"file":"withStaticPlugin.js","names":["EXPO_DEBUG","boolish","EXPO_CONFIG_PLUGIN_VERBOSE_ERRORS","EXPO_USE_UNVERSIONED_PLUGINS","isModuleMissingError","name","error","includes","code","message","isUnexpectedTokenError","SyntaxError","PluginError","match","withStaticPlugin","config","props","projectRoot","_internal","assertInternalProjectRoot","pluginResolve","pluginProps","normalizeStaticPlugin","plugin","assert","_resolverError","withPlugin","resolveConfigPluginFunction","_isLegacyPlugin","fallback","console","log","shouldMuteWarning"],"sources":["../../src/plugins/withStaticPlugin.ts"],"sourcesContent":["import assert from 'assert';\nimport { boolish } from 'getenv';\n\nimport { ConfigPlugin, StaticPlugin } from '../Plugin.types';\nimport { PluginError } from '../utils/errors';\nimport {\n assertInternalProjectRoot,\n normalizeStaticPlugin,\n resolveConfigPluginFunction,\n} from '../utils/plugin-resolver';\n\nconst EXPO_DEBUG = boolish('EXPO_DEBUG', false);\n\n// Show all error info related to plugin resolution.\nconst EXPO_CONFIG_PLUGIN_VERBOSE_ERRORS = boolish('EXPO_CONFIG_PLUGIN_VERBOSE_ERRORS', false);\n// Force using the fallback unversioned plugin instead of a local versioned copy,\n// this should only be used for testing the CLI.\nconst EXPO_USE_UNVERSIONED_PLUGINS = boolish('EXPO_USE_UNVERSIONED_PLUGINS', false);\n\nfunction isModuleMissingError(name: string, error: Error): boolean {\n // @ts-ignore\n if (['MODULE_NOT_FOUND', 'PLUGIN_NOT_FOUND'].includes(error.code)) {\n return true;\n }\n return error.message.includes(`Cannot find module '${name}'`);\n}\n\nfunction isUnexpectedTokenError(error: Error): boolean {\n if (\n error instanceof SyntaxError ||\n (error instanceof PluginError && error.code === 'INVALID_PLUGIN_IMPORT')\n ) {\n return (\n // These are the most common errors that'll be thrown when a package isn't transpiled correctly.\n !!error.message.match(/Unexpected token/) ||\n !!error.message.match(/Cannot use import statement/)\n );\n }\n return false;\n}\n\n/**\n * Resolves static module plugin and potentially falls back on a provided plugin if the module cannot be resolved\n *\n * @param config\n * @param fallback Plugin with `_resolverError` explaining why the module couldn't be used\n * @param projectRoot optional project root, fallback to _internal.projectRoot. Used for testing.\n * @param _isLegacyPlugin Used to suppress errors thrown by plugins that are applied automatically\n */\nexport const withStaticPlugin: ConfigPlugin<{\n plugin: StaticPlugin | ConfigPlugin | string;\n fallback?: ConfigPlugin<{ _resolverError: Error } & any>;\n projectRoot?: string;\n _isLegacyPlugin?: boolean;\n}> = (config, props) => {\n let projectRoot = props.projectRoot;\n if (!projectRoot) {\n projectRoot = config._internal?.projectRoot;\n assertInternalProjectRoot(projectRoot);\n }\n\n let [pluginResolve, pluginProps] = normalizeStaticPlugin(props.plugin);\n // Ensure no one uses this property by accident.\n assert(\n !pluginProps?._resolverError,\n `Plugin property '_resolverError' is a reserved property of \\`withStaticPlugin\\``\n );\n\n let withPlugin: ConfigPlugin<unknown>;\n\n if (\n // Function was provided, no need to resolve: [withPlugin, {}]\n typeof pluginResolve === 'function'\n ) {\n withPlugin = pluginResolve;\n } else if (typeof pluginResolve === 'string') {\n try {\n // Resolve and evaluate plugins.\n withPlugin = resolveConfigPluginFunction(projectRoot, pluginResolve);\n\n // Only force if the project has the versioned plugin, otherwise use default behavior.\n // This helps see which plugins are being skipped.\n if (\n EXPO_USE_UNVERSIONED_PLUGINS &&\n !!withPlugin &&\n !!props._isLegacyPlugin &&\n !!props.fallback\n ) {\n console.log(`Force \"${pluginResolve}\" to unversioned plugin`);\n withPlugin = props.fallback;\n }\n } catch (error: any) {\n if (EXPO_DEBUG) {\n if (EXPO_CONFIG_PLUGIN_VERBOSE_ERRORS) {\n // Log the error in debug mode for plugins with fallbacks (like the Expo managed plugins).\n console.log(`Error resolving plugin \"${pluginResolve}\"`);\n console.log(error);\n console.log();\n } else {\n const shouldMuteWarning =\n props._isLegacyPlugin &&\n (isModuleMissingError(pluginResolve, error) || isUnexpectedTokenError(error));\n if (!shouldMuteWarning) {\n if (isModuleMissingError(pluginResolve, error)) {\n // Prevent causing log spew for basic resolution errors.\n console.log(`Could not find plugin \"${pluginResolve}\"`);\n } else {\n // Log the error in debug mode for plugins with fallbacks (like the Expo managed plugins).\n console.log(`Error resolving plugin \"${pluginResolve}\"`);\n console.log(error);\n console.log();\n }\n }\n }\n }\n // TODO: Maybe allow for `PluginError`s to be thrown so external plugins can assert invalid options.\n\n // If the static module failed to resolve, attempt to use a fallback.\n // This enables support for built-in plugins with versioned variations living in other packages.\n if (props.fallback) {\n if (!pluginProps) pluginProps = {};\n // Pass this to the fallback plugin for potential warnings about needing to install a versioned package.\n pluginProps._resolverError = error;\n withPlugin = props.fallback;\n } else {\n // If no fallback, throw the resolution error.\n throw error;\n }\n }\n } else {\n throw new PluginError(\n `Plugin is an unexpected type: ${typeof pluginResolve}`,\n 'INVALID_PLUGIN_TYPE'\n );\n }\n\n // Execute the plugin.\n config = withPlugin(config, pluginProps);\n return config;\n};\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAMA,MAAMA,UAAU,GAAG,IAAAC,iBAAA,EAAQ,YAAR,EAAsB,KAAtB,CAAnB,C,CAEA;;AACA,MAAMC,iCAAiC,GAAG,IAAAD,iBAAA,EAAQ,mCAAR,EAA6C,KAA7C,CAA1C,C,CACA;AACA;;AACA,MAAME,4BAA4B,GAA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7B;QACAoB,UAAU,GAAGV,KAAK,CAACa,QAAnB;MACD,CALD,MAKO;QACL;QACA,MAAMvB,KAAN;MACD;IACF;EACF,CAtDM,MAsDA;IACL,MAAM,KAAIM,qBAAJ,EACH,iCAAgC,OAAOQ,aAAc,EADlD,EAEJ,qBAFI,CAAN;EAID,CAhFqB,CAkFtB;;;EACAL,MAAM,GAAGW,UAAU,CAACX,MAAD,EAASM,WAAT,CAAnB;EACA,OAAON,MAAP;AACD,CA1FM"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"BuildProperties.types.js"}
1
+ {"version":3,"file":"BuildProperties.types.js","names":[],"sources":["../../src/utils/BuildProperties.types.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\n/**\n * Rule to transform from config to build properties\n *\n * @example\n * ```ts\n * {\n * propName: 'expo.jsEngine',\n * propValueGetter: (config) => config.android?.jsEngine ?? config.jsEngine ?? 'jsc',\n * }\n * ```\n * Will lookup a value through the `propValueGetter` and update to `android/gradle.properties` / `ios/Podfile.properties.json`\n * with the `expo.jsEngine` property name and the lookuped value.\n *\n */\n\n/**\n * Source config can be either expo config or generic config\n */\nexport type BuildPropertiesConfig = ExpoConfig | Record<string, any>;\n\nexport interface ConfigToPropertyRuleType<SourceConfigType extends BuildPropertiesConfig> {\n /** Property name in `android/gradle.properties` or `ios/Podfile.properties.json` */\n propName: string;\n\n /** Passing config and get the property value */\n propValueGetter: (config: SourceConfigType) => string | null | undefined;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/Updates.ts"],"names":["getExpoUpdatesPackageVersion","projectRoot","expoUpdatesPackageJsonPath","resolveFrom","silent","fs","existsSync","packageJson","JSON","parse","readFileSync","version","getUpdateUrl","config","username","updates","url","user","owner","slug","getNativeVersion","platform","IOSConfig","Version","getVersion","buildNumber","getBuildNumber","versionCode","AndroidConfig","getVersionCode","Error","withRuntimeVersion","ios","runtimeVersion","getRuntimeVersion","android","getRuntimeVersionNullable","e","console","log","policy","sdkVersion","stringify","getSDKVersion","getUpdatesEnabled","enabled","getUpdatesTimeout","fallbackToCacheTimeout","getUpdatesCheckOnLaunch","expoUpdatesPackageVersion","checkAutomatically","semver","gte","getUpdatesCodeSigningCertificate","codeSigningCertificatePath","codeSigningCertificate","undefined","finalPath","path","join","getUpdatesCodeSigningMetadata","codeSigningMetadata","getUpdatesCodeSigningMetadataStringified","metadata"],"mappings":";;;;;;;;;;;;;;;;;;;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;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAOO,SAASA,4BAAT,CAAsCC,WAAtC,EAA0E;AAC/E,QAAMC,0BAA0B,GAAGC,uBAAYC,MAAZ,CAAmBH,WAAnB,EAAgC,2BAAhC,CAAnC;;AACA,MAAI,CAACC,0BAAD,IAA+B,CAACG,cAAGC,UAAH,CAAcJ,0BAAd,CAApC,EAA+E;AAC7E,WAAO,IAAP;AACD;;AACD,QAAMK,WAAW,GAAGC,IAAI,CAACC,KAAL,CAAWJ,cAAGK,YAAH,CAAgBR,0BAAhB,EAA4C,MAA5C,CAAX,CAApB;AACA,SAAOK,WAAW,CAACI,OAAnB;AACD;;AAEM,SAASC,YAAT,CACLC,MADK,EAELC,QAFK,EAGU;AAAA;;AACf,yBAAID,MAAM,CAACE,OAAX,4CAAI,gBAAgBC,GAApB,EAAyB;AAAA;;AACvB,+BAAOH,MAAM,CAACE,OAAd,qDAAO,iBAAgBC,GAAvB;AACD;;AAED,QAAMC,IAAI,GAAG,OAAOJ,MAAM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AAC7B,UAAM,IAAI3B,KAAJ,CAAW,8DAA6D2B,SAAU,EAAlF,CAAN;AACD;;AAED,SAAOpD,cAAGK,YAAH,CAAgB+C,SAAhB,EAA2B,MAA3B,CAAP;AACD;;AAEM,SAASG,6BAAT,CACL/C,MADK,EAE6D;AAAA;;AAClE,6BAAOA,MAAM,CAACE,OAAd,qDAAO,iBAAgB8C,mBAAvB;AACD;;AAEM,SAASC,wCAAT,CACLjD,MADK,EAEe;AACpB,QAAMkD,QAAQ,GAAGH,6BAA6B,CAAC/C,MAAD,CAA9C;;AACA,MAAI,CAACkD,QAAL,EAAe;AACb,WAAOP,SAAP;AACD;;AAED,SAAOhD,IAAI,CAACkC,SAAL,CAAeqB,QAAf,CAAP;AACD","sourcesContent":["import { Android, ExpoConfig, IOS } from '@expo/config-types';\nimport { getRuntimeVersionForSDKVersion } from '@expo/sdk-runtime-versions';\nimport fs from 'fs';\nimport { boolish } from 'getenv';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\n\nimport { AndroidConfig, IOSConfig } from '..';\n\nexport type ExpoConfigUpdates = Pick<\n ExpoConfig,\n 'sdkVersion' | 'owner' | 'runtimeVersion' | 'updates' | 'slug'\n>;\n\nexport function getExpoUpdatesPackageVersion(projectRoot: string): string | null {\n const expoUpdatesPackageJsonPath = resolveFrom.silent(projectRoot, 'expo-updates/package.json');\n if (!expoUpdatesPackageJsonPath || !fs.existsSync(expoUpdatesPackageJsonPath)) {\n return null;\n }\n const packageJson = JSON.parse(fs.readFileSync(expoUpdatesPackageJsonPath, 'utf8'));\n return packageJson.version;\n}\n\nexport function getUpdateUrl(\n config: Pick<ExpoConfigUpdates, 'owner' | 'slug' | 'updates'>,\n username: string | null\n): string | null {\n if (config.updates?.url) {\n return config.updates?.url;\n }\n\n const user = typeof config.owner === 'string' ? config.owner : username;\n if (!user) {\n return null;\n }\n return `https://exp.host/@${user}/${config.slug}`;\n}\n\nexport function getNativeVersion(\n config: Pick<ExpoConfig, 'version'> & {\n android?: Pick<Android, 'versionCode'>;\n ios?: Pick<IOS, 'buildNumber'>;\n },\n platform: 'android' | 'ios'\n): string {\n const version = IOSConfig.Version.getVersion(config);\n switch (platform) {\n case 'ios': {\n const buildNumber = IOSConfig.Version.getBuildNumber(config);\n return `${version}(${buildNumber})`;\n }\n case 'android': {\n const versionCode = AndroidConfig.Version.getVersionCode(config);\n return `${version}(${versionCode})`;\n }\n default: {\n throw new Error(\n `\"${platform}\" is not a supported platform. Choose either \"ios\" or \"android\".`\n );\n }\n }\n}\n\n/**\n * Compute runtime version policies.\n * @return an expoConfig with only string valued platform specific runtime versions.\n */\nexport const withRuntimeVersion: (config: ExpoConfig) => ExpoConfig = config => {\n if (config.ios?.runtimeVersion || config.runtimeVersion) {\n const runtimeVersion = getRuntimeVersion(config, 'ios');\n if (runtimeVersion) {\n config.ios = {\n ...config.ios,\n runtimeVersion,\n };\n }\n }\n if (config.android?.runtimeVersion || config.runtimeVersion) {\n const runtimeVersion = getRuntimeVersion(config, 'android');\n if (runtimeVersion) {\n config.android = {\n ...config.android,\n runtimeVersion,\n };\n }\n }\n delete config.runtimeVersion;\n return config;\n};\n\nexport function getRuntimeVersionNullable(\n ...[config, platform]: Parameters<typeof getRuntimeVersion>\n): string | null {\n try {\n return getRuntimeVersion(config, platform);\n } catch (e) {\n if (boolish('EXPO_DEBUG', false)) {\n console.log(e);\n }\n return null;\n }\n}\n\nexport function getRuntimeVersion(\n config: Pick<ExpoConfig, 'version' | 'runtimeVersion' | 'sdkVersion'> & {\n android?: Pick<Android, 'versionCode' | 'runtimeVersion'>;\n ios?: Pick<IOS, 'buildNumber' | 'runtimeVersion'>;\n },\n platform: 'android' | 'ios'\n): string | null {\n const runtimeVersion = config[platform]?.runtimeVersion ?? config.runtimeVersion;\n if (!runtimeVersion) {\n return null;\n }\n\n if (typeof runtimeVersion === 'string') {\n return runtimeVersion;\n } else if (runtimeVersion.policy === 'nativeVersion') {\n return getNativeVersion(config, platform);\n } else if (runtimeVersion.policy === 'sdkVersion') {\n if (!config.sdkVersion) {\n throw new Error(\"An SDK version must be defined when using the 'sdkVersion' runtime policy.\");\n }\n return getRuntimeVersionForSDKVersion(config.sdkVersion);\n }\n\n throw new Error(\n `\"${\n typeof runtimeVersion === 'object' ? JSON.stringify(runtimeVersion) : runtimeVersion\n }\" is not a valid runtime version. getRuntimeVersion only supports a string, \"sdkVersion\", or \"nativeVersion\" policy.`\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 expoUpdatesPackageVersion?: string | null\n): 'NEVER' | 'ERROR_RECOVERY_ONLY' | 'ALWAYS' {\n if (config.updates?.checkAutomatically === 'ON_ERROR_RECOVERY') {\n // native 'ERROR_RECOVERY_ONLY' option was only introduced in 0.11.x\n if (expoUpdatesPackageVersion && semver.gte(expoUpdatesPackageVersion, '0.11.0')) {\n return 'ERROR_RECOVERY_ONLY';\n }\n return 'NEVER';\n } else if (config.updates?.checkAutomatically === 'ON_LOAD') {\n return 'ALWAYS';\n }\n return 'ALWAYS';\n}\n\nexport function getUpdatesCodeSigningCertificate(\n projectRoot: string,\n config: Pick<ExpoConfigUpdates, 'updates'>\n): string | undefined {\n const codeSigningCertificatePath = config.updates?.codeSigningCertificate;\n if (!codeSigningCertificatePath) {\n return undefined;\n }\n\n const finalPath = path.join(projectRoot, codeSigningCertificatePath);\n if (!fs.existsSync(finalPath)) {\n throw new Error(`File not found at \\`updates.codeSigningCertificate\\` path: ${finalPath}`);\n }\n\n return fs.readFileSync(finalPath, 'utf8');\n}\n\nexport function getUpdatesCodeSigningMetadata(\n config: Pick<ExpoConfigUpdates, 'updates'>\n): NonNullable<ExpoConfigUpdates['updates']>['codeSigningMetadata'] {\n return config.updates?.codeSigningMetadata;\n}\n\nexport function getUpdatesCodeSigningMetadataStringified(\n config: Pick<ExpoConfigUpdates, 'updates'>\n): string | undefined {\n const metadata = getUpdatesCodeSigningMetadata(config);\n if (!metadata) {\n return undefined;\n }\n\n return JSON.stringify(metadata);\n}\n"],"file":"Updates.js"}
1
+ {"version":3,"file":"Updates.js","names":["getExpoUpdatesPackageVersion","projectRoot","expoUpdatesPackageJsonPath","resolveFrom","silent","fs","existsSync","packageJson","JSON","parse","readFileSync","version","getUpdateUrl","config","username","updates","url","user","owner","slug","getNativeVersion","platform","IOSConfig","Version","getVersion","buildNumber","getBuildNumber","versionCode","AndroidConfig","getVersionCode","Error","withRuntimeVersion","ios","runtimeVersion","getRuntimeVersion","android","getRuntimeVersionNullable","e","boolish","console","log","policy","sdkVersion","getRuntimeVersionForSDKVersion","stringify","getSDKVersion","getUpdatesEnabled","enabled","getUpdatesTimeout","fallbackToCacheTimeout","getUpdatesCheckOnLaunch","expoUpdatesPackageVersion","checkAutomatically","semver","gte","getUpdatesCodeSigningCertificate","codeSigningCertificatePath","codeSigningCertificate","undefined","finalPath","path","join","getUpdatesCodeSigningMetadata","codeSigningMetadata","getUpdatesCodeSigningMetadataStringified","metadata"],"sources":["../../src/utils/Updates.ts"],"sourcesContent":["import { Android, ExpoConfig, IOS } from '@expo/config-types';\nimport { getRuntimeVersionForSDKVersion } from '@expo/sdk-runtime-versions';\nimport fs from 'fs';\nimport { boolish } from 'getenv';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\n\nimport { AndroidConfig, IOSConfig } from '..';\n\nexport type ExpoConfigUpdates = Pick<\n ExpoConfig,\n 'sdkVersion' | 'owner' | 'runtimeVersion' | 'updates' | 'slug'\n>;\n\nexport function getExpoUpdatesPackageVersion(projectRoot: string): string | null {\n const expoUpdatesPackageJsonPath = resolveFrom.silent(projectRoot, 'expo-updates/package.json');\n if (!expoUpdatesPackageJsonPath || !fs.existsSync(expoUpdatesPackageJsonPath)) {\n return null;\n }\n const packageJson = JSON.parse(fs.readFileSync(expoUpdatesPackageJsonPath, 'utf8'));\n return packageJson.version;\n}\n\nexport function getUpdateUrl(\n config: Pick<ExpoConfigUpdates, 'owner' | 'slug' | 'updates'>,\n username: string | null\n): string | null {\n if (config.updates?.url) {\n return config.updates?.url;\n }\n\n const user = typeof config.owner === 'string' ? config.owner : username;\n if (!user) {\n return null;\n }\n return `https://exp.host/@${user}/${config.slug}`;\n}\n\nexport function getNativeVersion(\n config: Pick<ExpoConfig, 'version'> & {\n android?: Pick<Android, 'versionCode'>;\n ios?: Pick<IOS, 'buildNumber'>;\n },\n platform: 'android' | 'ios'\n): string {\n const version = IOSConfig.Version.getVersion(config);\n switch (platform) {\n case 'ios': {\n const buildNumber = IOSConfig.Version.getBuildNumber(config);\n return `${version}(${buildNumber})`;\n }\n case 'android': {\n const versionCode = AndroidConfig.Version.getVersionCode(config);\n return `${version}(${versionCode})`;\n }\n default: {\n throw new Error(\n `\"${platform}\" is not a supported platform. Choose either \"ios\" or \"android\".`\n );\n }\n }\n}\n\n/**\n * Compute runtime version policies.\n * @return an expoConfig with only string valued platform specific runtime versions.\n */\nexport const withRuntimeVersion: (config: ExpoConfig) => ExpoConfig = (config) => {\n if (config.ios?.runtimeVersion || config.runtimeVersion) {\n const runtimeVersion = getRuntimeVersion(config, 'ios');\n if (runtimeVersion) {\n config.ios = {\n ...config.ios,\n runtimeVersion,\n };\n }\n }\n if (config.android?.runtimeVersion || config.runtimeVersion) {\n const runtimeVersion = getRuntimeVersion(config, 'android');\n if (runtimeVersion) {\n config.android = {\n ...config.android,\n runtimeVersion,\n };\n }\n }\n delete config.runtimeVersion;\n return config;\n};\n\nexport function getRuntimeVersionNullable(\n ...[config, platform]: Parameters<typeof getRuntimeVersion>\n): string | null {\n try {\n return getRuntimeVersion(config, platform);\n } catch (e) {\n if (boolish('EXPO_DEBUG', false)) {\n console.log(e);\n }\n return null;\n }\n}\n\nexport function getRuntimeVersion(\n config: Pick<ExpoConfig, 'version' | 'runtimeVersion' | 'sdkVersion'> & {\n android?: Pick<Android, 'versionCode' | 'runtimeVersion'>;\n ios?: Pick<IOS, 'buildNumber' | 'runtimeVersion'>;\n },\n platform: 'android' | 'ios'\n): string | null {\n const runtimeVersion = config[platform]?.runtimeVersion ?? config.runtimeVersion;\n if (!runtimeVersion) {\n return null;\n }\n\n if (typeof runtimeVersion === 'string') {\n return runtimeVersion;\n } else if (runtimeVersion.policy === 'nativeVersion') {\n return getNativeVersion(config, platform);\n } else if (runtimeVersion.policy === 'sdkVersion') {\n if (!config.sdkVersion) {\n throw new Error(\"An SDK version must be defined when using the 'sdkVersion' runtime policy.\");\n }\n return getRuntimeVersionForSDKVersion(config.sdkVersion);\n }\n\n throw new Error(\n `\"${\n typeof runtimeVersion === 'object' ? JSON.stringify(runtimeVersion) : runtimeVersion\n }\" is not a valid runtime version. getRuntimeVersion only supports a string, \"sdkVersion\", or \"nativeVersion\" policy.`\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 expoUpdatesPackageVersion?: string | null\n): 'NEVER' | 'ERROR_RECOVERY_ONLY' | 'ALWAYS' {\n if (config.updates?.checkAutomatically === 'ON_ERROR_RECOVERY') {\n // native 'ERROR_RECOVERY_ONLY' option was only introduced in 0.11.x\n if (expoUpdatesPackageVersion && semver.gte(expoUpdatesPackageVersion, '0.11.0')) {\n return 'ERROR_RECOVERY_ONLY';\n }\n return 'NEVER';\n } else if (config.updates?.checkAutomatically === 'ON_LOAD') {\n return 'ALWAYS';\n }\n return 'ALWAYS';\n}\n\nexport function getUpdatesCodeSigningCertificate(\n projectRoot: string,\n config: Pick<ExpoConfigUpdates, 'updates'>\n): string | undefined {\n const codeSigningCertificatePath = config.updates?.codeSigningCertificate;\n if (!codeSigningCertificatePath) {\n return undefined;\n }\n\n const finalPath = path.join(projectRoot, codeSigningCertificatePath);\n if (!fs.existsSync(finalPath)) {\n throw new Error(`File not found at \\`updates.codeSigningCertificate\\` path: ${finalPath}`);\n }\n\n return fs.readFileSync(finalPath, 'utf8');\n}\n\nexport function getUpdatesCodeSigningMetadata(\n config: Pick<ExpoConfigUpdates, 'updates'>\n): NonNullable<ExpoConfigUpdates['updates']>['codeSigningMetadata'] {\n return config.updates?.codeSigningMetadata;\n}\n\nexport function getUpdatesCodeSigningMetadataStringified(\n config: Pick<ExpoConfigUpdates, 'updates'>\n): string | undefined {\n const metadata = getUpdatesCodeSigningMetadata(config);\n if (!metadata) {\n return undefined;\n }\n\n return JSON.stringify(metadata);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAOO,SAASA,4BAAT,CAAsCC,WAAtC,EAA0E;EAC/E,MAAMC,0BAA0B,GAAGC,sBAAA,CAAYC,MAAZ,CAAmBH,WAAnB,EAAgC,2BAAhC,CAAnC;;EACA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qBAAP;IACD;;IACD,OAAO,OAAP;EACD,CAND,MAMO,IAAI,qBAAAtC,MAAM,CAACE,OAAP,sEAAgBqC,kBAAhB,MAAuC,SAA3C,EAAsD;IAC3D,OAAO,QAAP;EACD;;EACD,OAAO,QAAP;AACD;;AAEM,SAASG,gCAAT,CACLtD,WADK,EAELY,MAFK,EAGe;EAAA;;EACpB,MAAM2C,0BAA0B,uBAAG3C,MAAM,CAACE,OAAV,qDAAG,iBAAgB0C,sBAAnD;;EACA,IAAI,CAACD,0BAAL,EAAiC;IAC/B,OAAOE,SAAP;EACD;;EAED,MAAMC,SAAS,GAAGC,eAAA,CAAKC,IAAL,CAAU5D,WAAV,EAAuBuD,0BAAvB,CAAlB;;EACA,IAAI,CAACnD,aAAA,CAAGC,UAAH,CAAcqD,SAAd,CAAL,EAA+B;IAC7B,MAAM,IAAI7B,KAAJ,CAAW,8DAA6D6B,SAAU,EAAlF,CAAN;EACD;;EAED,OAAOtD,aAAA,CAAGK,YAAH,CAAgBiD,SAAhB,EAA2B,MAA3B,CAAP;AACD;;AAEM,SAASG,6BAAT,CACLjD,MADK,EAE6D;EAAA;;EAClE,2BAAOA,MAAM,CAACE,OAAd,qDAAO,iBAAgBgD,mBAAvB;AACD;;AAEM,SAASC,wCAAT,CACLnD,MADK,EAEe;EACpB,MAAMoD,QAAQ,GAAGH,6BAA6B,CAACjD,MAAD,CAA9C;;EACA,IAAI,CAACoD,QAAL,EAAe;IACb,OAAOP,SAAP;EACD;;EAED,OAAOlD,IAAI,CAACoC,SAAL,CAAeqB,QAAf,CAAP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/XML.ts"],"names":["writeXMLAsync","options","xml","format","fs","promises","mkdir","path","dirname","recursive","writeFile","readXMLAsync","contents","readFile","encoding","flag","parser","Parser","manifest","parseStringPromise","fallback","Array","isArray","resources","string","$","translatable","_","unescapeAndroidString","parseXMLAsync","stringTimesN","n","char","join","indentLevel","newline","EOL","xmlInput","toString","builder","Builder","headless","escapeAndroidString","buildObject","Error","indentString","formatted","regex","replace","pad","split","map","line","trim","forEach","indent","match","padding","value","m"],"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;;;;AAUO,eAAeA,aAAf,CAA6BC,OAA7B,EAAiF;AACtF,QAAMC,GAAG,GAAGC,MAAM,CAACF,OAAO,CAACC,GAAT,CAAlB;AACA,QAAME,cAAGC,QAAH,CAAYC,KAAZ,CAAkBC,gBAAKC,OAAL,CAAaP,OAAO,CAACM,IAArB,CAAlB,EAA8C;AAAEE,IAAAA,SAAS,EAAE;AAAb,GAA9C,CAAN;AACA,QAAML,cAAGC,QAAH,CAAYK,SAAZ,CAAsBT,OAAO,CAACM,IAA9B,EAAoCL,GAApC,CAAN;AACD;;AAEM,eAAeS,YAAf,CAA4BV,OAA5B,EAGgB;AAAA;;AACrB,MAAIW,QAAgB,GAAG,EAAvB;;AACA,MAAI;AACFA,IAAAA,QAAQ,GAAG,MAAMR,cAAGC,QAAH,CAAYQ,QAAZ,CAAqBZ,OAAO,CAACM,IAA7B,EAAmC;AAAEO,MAAAA,QAAQ,EAAE,MAAZ;AAAoBC,MAAAA,IAAI,EAAE;AAA1B,KAAnC,CAAjB;AACD,GAFD,CAEE,MAAM,CACN;AACD;;AACD,QAAMC,MAAM,GAAG,KAAIC,gBAAJ,GAAf;AACA,QAAMC,QAAQ,GAAG,MAAMF,MAAM,CAACG,kBAAP,CAA0BP,QAAQ,IAAIX,OAAO,CAACmB,QAApB,IAAgC,EAA1D,CAAvB,CARqB,CAUrB;;AACA,MAAIC,KAAK,CAACC,OAAN,CAAcJ,QAAd,aAAcA,QAAd,8CAAcA,QAAQ,CAAEK,SAAxB,wDAAc,oBAAqBC,MAAnC,CAAJ,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AAA,MAAM,GAAG,CAAT;AACD,KAFM,MAEA;AACLA,MAAAA,MAAM,GAAG,CAAT;AACD;;AAED,UAAME,OAAO,GAAG3B,YAAY,CAACmB,GAAD,EAAMJ,YAAN,CAA5B;AACAC,IAAAA,SAAS,IAAIW,OAAO,GAAGL,IAAV,GAAiBjB,OAA9B;AACAc,IAAAA,GAAG,IAAIM,MAAP;AACD,GApBH;AAsBA,SAAOT,SAAS,CAACO,IAAV,EAAP;AACD;AAED;AACA;AACA;AACA;AACA;;;AACO,SAASX,mBAAT,CAA6BgB,KAA7B,EAAoD;AACzDA,EAAAA,KAAK,GAAGA,KAAK,CAACV,OAAN,CAAc,cAAd,EAA8BW,CAAC,IAAI;AACzC,YAAQA,CAAR;AACE,WAAK,GAAL;AACA,WAAK,GAAL;AACA,WAAK,GAAL;AACE,eAAO,OAAOA,CAAd;;AACF,WAAK,IAAL;AACE,eAAO,KAAP;;AACF,WAAK,IAAL;AACE,eAAO,KAAP;;AACF,WAAK,IAAL;AACE,eAAO,KAAP;;AACF;AACE,cAAM,IAAIf,KAAJ,CAAW,0CAAyCe,CAAE,EAAtD,CAAN;AAZJ;AAcD,GAfO,CAAR;;AAgBA,MAAID,KAAK,CAACF,KAAN,CAAY,WAAZ,CAAJ,EAA8B;AAC5BE,IAAAA,KAAK,GAAG,MAAMA,KAAN,GAAc,GAAtB;AACD;;AACD,SAAOA,KAAP;AACD;;AAEM,SAAS9B,qBAAT,CAA+B8B,KAA/B,EAAsD;AAC3D,SAAOA,KAAK,CAACV,OAAN,CAAc,QAAd,EAAwB,IAAxB,CAAP;AACD","sourcesContent":["import fs from 'fs';\nimport { EOL } from 'os';\nimport path from 'path';\nimport { Builder, Parser } from 'xml2js';\n\nexport type XMLValue = boolean | number | string | null | XMLArray | XMLObject;\n\nexport interface XMLArray extends Array<XMLValue> {}\n\nexport interface XMLObject {\n [key: string]: XMLValue | undefined;\n}\n\nexport async function writeXMLAsync(options: { path: string; xml: any }): Promise<void> {\n const xml = format(options.xml);\n await fs.promises.mkdir(path.dirname(options.path), { recursive: true });\n await fs.promises.writeFile(options.path, xml);\n}\n\nexport async function readXMLAsync(options: {\n path: string;\n fallback?: string | null;\n}): Promise<XMLObject> {\n let contents: string = '';\n try {\n contents = await fs.promises.readFile(options.path, { encoding: 'utf8', flag: 'r' });\n } catch {\n // catch and use fallback\n }\n const parser = new Parser();\n const manifest = await parser.parseStringPromise(contents || options.fallback || '');\n\n // For strings.xml\n if (Array.isArray(manifest?.resources?.string)) {\n for (const string of manifest?.resources?.string) {\n if (string.$.translatable === 'false' || string.$.translatable === false) {\n continue;\n }\n string._ = unescapeAndroidString(string._);\n }\n }\n\n return manifest;\n}\n\nexport async function parseXMLAsync(contents: string): Promise<XMLObject> {\n const xml = await new Parser().parseStringPromise(contents);\n return xml;\n}\n\nconst stringTimesN = (n: number, char: string) => Array(n + 1).join(char);\n\nexport function format(manifest: any, { indentLevel = 2, newline = EOL } = {}): string {\n let xmlInput: string;\n if (typeof manifest === 'string') {\n xmlInput = manifest;\n } else if (manifest.toString) {\n const builder = new Builder({\n headless: true,\n });\n\n // For strings.xml\n if (Array.isArray(manifest?.resources?.string)) {\n for (const string of manifest?.resources?.string) {\n if (string.$.translatable === 'false' || string.$.translatable === false) {\n continue;\n }\n string._ = escapeAndroidString(string._);\n }\n }\n\n xmlInput = builder.buildObject(manifest);\n\n return xmlInput;\n } else {\n throw new Error(`Invalid XML value passed in: ${manifest}`);\n }\n const indentString = stringTimesN(indentLevel, ' ');\n\n let formatted = '';\n const regex = /(>)(<)(\\/*)/g;\n const xml = xmlInput.replace(regex, `$1${newline}$2$3`);\n let pad = 0;\n xml\n .split(/\\r?\\n/)\n .map((line: string) => line.trim())\n .forEach((line: string) => {\n let indent = 0;\n if (line.match(/.+<\\/\\w[^>]*>$/)) {\n indent = 0;\n } else if (line.match(/^<\\/\\w/)) {\n if (pad !== 0) {\n pad -= 1;\n }\n } else if (line.match(/^<\\w([^>]*[^/])?>.*$/)) {\n indent = 1;\n } else {\n indent = 0;\n }\n\n const padding = stringTimesN(pad, indentString);\n formatted += padding + line + newline;\n pad += indent;\n });\n\n return formatted.trim();\n}\n\n/**\n * Escapes Android string literals, specifically characters `\"`, `'`, `\\`, `\\n`, `\\r`, `\\t`\n *\n * @param value unescaped Android XML string literal.\n */\nexport function escapeAndroidString(value: string): string {\n value = value.replace(/[\\n\\r\\t'\"@]/g, m => {\n switch (m) {\n case '\"':\n case \"'\":\n case '@':\n return '\\\\' + m;\n case '\\n':\n return '\\\\n';\n case '\\r':\n return '\\\\r';\n case '\\t':\n return '\\\\t';\n default:\n throw new Error(`Cannot escape unhandled XML character: ${m}`);\n }\n });\n if (value.match(/(^\\s|\\s$)/)) {\n value = '\"' + value + '\"';\n }\n return value;\n}\n\nexport function unescapeAndroidString(value: string): string {\n return value.replace(/\\\\(.)/g, '$1');\n}\n"],"file":"XML.js"}
1
+ {"version":3,"file":"XML.js","names":["writeXMLAsync","options","xml","format","fs","promises","mkdir","path","dirname","recursive","writeFile","readXMLAsync","contents","readFile","encoding","flag","parser","Parser","manifest","parseStringPromise","fallback","Array","isArray","resources","string","$","translatable","_","unescapeAndroidString","parseXMLAsync","stringTimesN","n","char","join","indentLevel","newline","EOL","xmlInput","toString","builder","Builder","headless","escapeAndroidString","buildObject","Error","indentString","formatted","regex","replace","pad","split","map","line","trim","forEach","indent","match","padding","value","m"],"sources":["../../src/utils/XML.ts"],"sourcesContent":["import fs from 'fs';\nimport { EOL } from 'os';\nimport path from 'path';\nimport { Builder, Parser } from 'xml2js';\n\nexport type XMLValue = boolean | number | string | null | XMLArray | XMLObject;\n\nexport interface XMLArray extends Array<XMLValue> {}\n\nexport interface XMLObject {\n [key: string]: XMLValue | undefined;\n}\n\nexport async function writeXMLAsync(options: { path: string; xml: any }): Promise<void> {\n const xml = format(options.xml);\n await fs.promises.mkdir(path.dirname(options.path), { recursive: true });\n await fs.promises.writeFile(options.path, xml);\n}\n\nexport async function readXMLAsync(options: {\n path: string;\n fallback?: string | null;\n}): Promise<XMLObject> {\n let contents: string = '';\n try {\n contents = await fs.promises.readFile(options.path, { encoding: 'utf8', flag: 'r' });\n } catch {\n // catch and use fallback\n }\n const parser = new Parser();\n const manifest = await parser.parseStringPromise(contents || options.fallback || '');\n\n // For strings.xml\n if (Array.isArray(manifest?.resources?.string)) {\n for (const string of manifest?.resources?.string) {\n if (string.$.translatable === 'false' || string.$.translatable === false) {\n continue;\n }\n string._ = unescapeAndroidString(string._);\n }\n }\n\n return manifest;\n}\n\nexport async function parseXMLAsync(contents: string): Promise<XMLObject> {\n const xml = await new Parser().parseStringPromise(contents);\n return xml;\n}\n\nconst stringTimesN = (n: number, char: string) => Array(n + 1).join(char);\n\nexport function format(manifest: any, { indentLevel = 2, newline = EOL } = {}): string {\n let xmlInput: string;\n if (typeof manifest === 'string') {\n xmlInput = manifest;\n } else if (manifest.toString) {\n const builder = new Builder({\n headless: true,\n });\n\n // For strings.xml\n if (Array.isArray(manifest?.resources?.string)) {\n for (const string of manifest?.resources?.string) {\n if (string.$.translatable === 'false' || string.$.translatable === false) {\n continue;\n }\n string._ = escapeAndroidString(string._);\n }\n }\n\n xmlInput = builder.buildObject(manifest);\n\n return xmlInput;\n } else {\n throw new Error(`Invalid XML value passed in: ${manifest}`);\n }\n const indentString = stringTimesN(indentLevel, ' ');\n\n let formatted = '';\n const regex = /(>)(<)(\\/*)/g;\n const xml = xmlInput.replace(regex, `$1${newline}$2$3`);\n let pad = 0;\n xml\n .split(/\\r?\\n/)\n .map((line: string) => line.trim())\n .forEach((line: string) => {\n let indent = 0;\n if (line.match(/.+<\\/\\w[^>]*>$/)) {\n indent = 0;\n } else if (line.match(/^<\\/\\w/)) {\n if (pad !== 0) {\n pad -= 1;\n }\n } else if (line.match(/^<\\w([^>]*[^/])?>.*$/)) {\n indent = 1;\n } else {\n indent = 0;\n }\n\n const padding = stringTimesN(pad, indentString);\n formatted += padding + line + newline;\n pad += indent;\n });\n\n return formatted.trim();\n}\n\n/**\n * Escapes Android string literals, specifically characters `\"`, `'`, `\\`, `\\n`, `\\r`, `\\t`\n *\n * @param value unescaped Android XML string literal.\n */\nexport function escapeAndroidString(value: string): string {\n value = value.replace(/[\\n\\r\\t'\"@]/g, (m) => {\n switch (m) {\n case '\"':\n case \"'\":\n case '@':\n return '\\\\' + m;\n case '\\n':\n return '\\\\n';\n case '\\r':\n return '\\\\r';\n case '\\t':\n return '\\\\t';\n default:\n throw new Error(`Cannot escape unhandled XML character: ${m}`);\n }\n });\n if (value.match(/(^\\s|\\s$)/)) {\n value = '\"' + value + '\"';\n }\n return value;\n}\n\nexport function unescapeAndroidString(value: string): string {\n return value.replace(/\\\\(.)/g, '$1');\n}\n"],"mappings":";;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAUO,eAAeA,aAAf,CAA6BC,OAA7B,EAAiF;EACtF,MAAMC,GAAG,GAAGC,MAAM,CAACF,OAAO,CAACC,GAAT,CAAlB;EACA,MAAME,aAAA,CAAGC,QAAH,CAAYC,KAAZ,CAAkBC,eAAA,CAAKC,OAAL,CAAaP,OAAO,CAACM,IAArB,CAAlB,EAA8C;IAAEE,SAAS,EAAE;EAAb,CAA9C,CAAN;EACA,MAAML,aAAA,CAAGC,QAAH,CAAYK,SAAZ,CAAsBT,OAAO,CAACM,IAA9B,EAAoCL,GAApC,CAAN;AACD;;AAEM,eAAeS,YAAf,CAA4BV,OAA5B,EAGgB;EAAA;;EACrB,IAAIW,QAAgB,GAAG,EAAvB;;EACA,IAAI;IACFA,QAAQ,GAAG,MAAMR,aAAA,CAAGC,QAAH,CAAYQ,QAAZ,CAAqBZ,OAAO,CAACM,IAA7B,EAAmC;MAAEO,QAAQ,EAAE,MAAZ;MAAoBC,IAAI,EAAE;IAA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1 @@
1
- {"version":3,"sources":["../../src/utils/commonCodeMod.ts"],"names":["insertContentsAtOffset","srcContents","insertion","offset","srcContentsLength","length","Error","prefix","substring","suffix","replaceContentsWithOffset","contents","replacement","startOffset","endOffset","contentsLength","searchFromOffset","source","regexp","target","matchedIndex","search"],"mappings":";;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,sBAAT,CACLC,WADK,EAELC,SAFK,EAGLC,MAHK,EAIG;AACR,QAAMC,iBAAiB,GAAGH,WAAW,CAACI,MAAtC;;AACA,MAAIF,MAAM,GAAG,CAAT,IAAcA,MAAM,GAAGC,iBAA3B,EAA8C;AAC5C,UAAM,IAAIE,KAAJ,CAAU,qBAAV,CAAN;AACD;;AACD,MAAIH,MAAM,KAAK,CAAf,EAAkB;AAChB,WAAQ,GAAED,SAAU,GAAED,WAAY,EAAlC;AACD,GAFD,MAEO,IAAIE,MAAM,KAAKC,iBAAf,EAAkC;AACvC,WAAQ,GAAEH,WAAY,GAAEC,SAAU,EAAlC;AACD;;AAED,QAAMK,MAAM,GAAGN,WAAW,CAACO,SAAZ,CAAsB,CAAtB,EAAyBL,MAAzB,CAAf;AACA,QAAMM,MAAM,GAAGR,WAAW,CAACO,SAAZ,CAAsBL,MAAtB,CAAf;AACA,SAAQ,GAAEI,MAAO,GAAEL,SAAU,GAAEO,MAAO,EAAtC;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,yBAAT,CACLC,QADK,EAELC,WAFK,EAGLC,WAHK,EAILC,SAJK,EAKG;AACR,QAAMC,cAAc,GAAGJ,QAAQ,CAACN,MAAhC;;AACA,MACEQ,WAAW,GAAG,CAAd,IACAC,SAAS,GAAG,CADZ,IAEAD,WAAW,IAAIE,cAFf,IAGAD,SAAS,IAAIC,cAHb,IAIAF,WAAW,GAAGC,SALhB,EAME;AACA,UAAM,IAAIR,KAAJ,CAAU,qBAAV,CAAN;AACD;;AACD,QAAMC,MAAM,GAAGI,QAAQ,CAACH,SAAT,CAAmB,CAAnB,EAAsBK,WAAtB,CAAf;AACA,QAAMJ,MAAM,GAAGE,QAAQ,CAACH,SAAT,CAAmBM,SAAS,GAAG,CAA/B,CAAf;AACA,SAAQ,GAAEP,MAAO,GAAEK,WAAY,GAAEH,MAAO,EAAxC;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASO,gBAAT,CAA0BC,MAA1B,EAA0CC,MAA1C,EAA0Df,MAA1D,EAAkF;AACvF,QAAMgB,MAAM,GAAGF,MAAM,CAACT,SAAP,CAAiBL,MAAjB,CAAf;AACA,QAAMiB,YAAY,GAAGD,MAAM,CAACE,MAAP,CAAcH,MAAd,CAArB;AACA,SAAOE,YAAY,GAAG,CAAf,GAAmBA,YAAnB,GAAkCA,YAAY,GAAGjB,MAAxD;AACD","sourcesContent":["export interface CodeBlock {\n start: number;\n end: number;\n code: string;\n}\n\n/**\n * Insert contents at given offset\n * @param srcContents source contents\n * @param insertion content to insert\n * @param offset `srcContents` offset to insert `insertion`\n * @returns updated contents\n */\nexport function insertContentsAtOffset(\n srcContents: string,\n insertion: string,\n offset: number\n): string {\n const srcContentsLength = srcContents.length;\n if (offset < 0 || offset > srcContentsLength) {\n throw new Error('Invalid parameters.');\n }\n if (offset === 0) {\n return `${insertion}${srcContents}`;\n } else if (offset === srcContentsLength) {\n return `${srcContents}${insertion}`;\n }\n\n const prefix = srcContents.substring(0, offset);\n const suffix = srcContents.substring(offset);\n return `${prefix}${insertion}${suffix}`;\n}\n\n/**\n * Replace contents at given start and end offset\n *\n * @param contents source contents\n * @param replacement new contents to place in [startOffset:endOffset]\n * @param startOffset `contents` start offset for replacement\n * @param endOffset `contents` end offset for replacement\n * @returns updated contents\n */\nexport function replaceContentsWithOffset(\n contents: string,\n replacement: string,\n startOffset: number,\n endOffset: number\n): string {\n const contentsLength = contents.length;\n if (\n startOffset < 0 ||\n endOffset < 0 ||\n startOffset >= contentsLength ||\n endOffset >= contentsLength ||\n startOffset > endOffset\n ) {\n throw new Error('Invalid parameters.');\n }\n const prefix = contents.substring(0, startOffset);\n const suffix = contents.substring(endOffset + 1);\n return `${prefix}${replacement}${suffix}`;\n}\n\n/**\n * String.prototype.search() with offset support\n *\n * @param source source string to search\n * @param regexp RegExp pattern to search\n * @param offset start offset of `source` to search `regexp` pattern\n * @returns The index of the first match between the regular expression and the given string, or -1 if no match was found.\n */\nexport function searchFromOffset(source: string, regexp: RegExp, offset: number): number {\n const target = source.substring(offset);\n const matchedIndex = target.search(regexp);\n return matchedIndex < 0 ? matchedIndex : matchedIndex + offset;\n}\n"],"file":"commonCodeMod.js"}
1
+ {"version":3,"file":"commonCodeMod.js","names":["insertContentsAtOffset","srcContents","insertion","offset","srcContentsLength","length","Error","prefix","substring","suffix","replaceContentsWithOffset","contents","replacement","startOffset","endOffset","contentsLength","searchFromOffset","source","regexp","target","matchedIndex","search"],"sources":["../../src/utils/commonCodeMod.ts"],"sourcesContent":["export interface CodeBlock {\n start: number;\n end: number;\n code: string;\n}\n\n/**\n * Insert contents at given offset\n * @param srcContents source contents\n * @param insertion content to insert\n * @param offset `srcContents` offset to insert `insertion`\n * @returns updated contents\n */\nexport function insertContentsAtOffset(\n srcContents: string,\n insertion: string,\n offset: number\n): string {\n const srcContentsLength = srcContents.length;\n if (offset < 0 || offset > srcContentsLength) {\n throw new Error('Invalid parameters.');\n }\n if (offset === 0) {\n return `${insertion}${srcContents}`;\n } else if (offset === srcContentsLength) {\n return `${srcContents}${insertion}`;\n }\n\n const prefix = srcContents.substring(0, offset);\n const suffix = srcContents.substring(offset);\n return `${prefix}${insertion}${suffix}`;\n}\n\n/**\n * Replace contents at given start and end offset\n *\n * @param contents source contents\n * @param replacement new contents to place in [startOffset:endOffset]\n * @param startOffset `contents` start offset for replacement\n * @param endOffset `contents` end offset for replacement\n * @returns updated contents\n */\nexport function replaceContentsWithOffset(\n contents: string,\n replacement: string,\n startOffset: number,\n endOffset: number\n): string {\n const contentsLength = contents.length;\n if (\n startOffset < 0 ||\n endOffset < 0 ||\n startOffset >= contentsLength ||\n endOffset >= contentsLength ||\n startOffset > endOffset\n ) {\n throw new Error('Invalid parameters.');\n }\n const prefix = contents.substring(0, startOffset);\n const suffix = contents.substring(endOffset + 1);\n return `${prefix}${replacement}${suffix}`;\n}\n\n/**\n * String.prototype.search() with offset support\n *\n * @param source source string to search\n * @param regexp RegExp pattern to search\n * @param offset start offset of `source` to search `regexp` pattern\n * @returns The index of the first match between the regular expression and the given string, or -1 if no match was found.\n */\nexport function searchFromOffset(source: string, regexp: RegExp, offset: number): number {\n const target = source.substring(offset);\n const matchedIndex = target.search(regexp);\n return matchedIndex < 0 ? matchedIndex : matchedIndex + offset;\n}\n"],"mappings":";;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,sBAAT,CACLC,WADK,EAELC,SAFK,EAGLC,MAHK,EAIG;EACR,MAAMC,iBAAiB,GAAGH,WAAW,CAACI,MAAtC;;EACA,IAAIF,MAAM,GAAG,CAAT,IAAcA,MAAM,GAAGC,iBAA3B,EAA8C;IAC5C,MAAM,IAAIE,KAAJ,CAAU,qBAAV,CAAN;EACD;;EACD,IAAIH,MAAM,KAAK,CAAf,EAAkB;IAChB,OAAQ,GAAED,SAAU,GAAED,WAAY,EAAlC;EACD,CAFD,MAEO,IAAIE,MAAM,KAAKC,iBAAf,EAAkC;IACvC,OAAQ,GAAEH,WAAY,GAAEC,SAAU,EAAlC;EACD;;EAED,MAAMK,MAAM,GAAGN,WAAW,CAACO,SAAZ,CAAsB,CAAtB,EAAyBL,MAAzB,CAAf;EACA,MAAMM,MAAM,GAAGR,WAAW,CAACO,SAAZ,CAAsBL,MAAtB,CAAf;EACA,OAAQ,GAAEI,MAAO,GAAEL,SAAU,GAAEO,MAAO,EAAtC;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,yBAAT,CACLC,QADK,EAELC,WAFK,EAGLC,WAHK,EAILC,SAJK,EAKG;EACR,MAAMC,cAAc,GAAGJ,QAAQ,CAACN,MAAhC;;EACA,IACEQ,WAAW,GAAG,CAAd,IACAC,SAAS,GAAG,CADZ,IAEAD,WAAW,IAAIE,cAFf,IAGAD,SAAS,IAAIC,cAHb,IAIAF,WAAW,GAAGC,SALhB,EAME;IACA,MAAM,IAAIR,KAAJ,CAAU,qBAAV,CAAN;EACD;;EACD,MAAMC,MAAM,GAAGI,QAAQ,CAACH,SAAT,CAAmB,CAAnB,EAAsBK,WAAtB,CAAf;EACA,MAAMJ,MAAM,GAAGE,QAAQ,CAACH,SAAT,CAAmBM,SAAS,GAAG,CAA/B,CAAf;EACA,OAAQ,GAAEP,MAAO,GAAEK,WAAY,GAAEH,MAAO,EAAxC;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASO,gBAAT,CAA0BC,MAA1B,EAA0CC,MAA1C,EAA0Df,MAA1D,EAAkF;EACvF,MAAMgB,MAAM,GAAGF,MAAM,CAACT,SAAP,CAAiBL,MAAjB,CAAf;EACA,MAAMiB,YAAY,GAAGD,MAAM,CAACE,MAAP,CAAcH,MAAd,CAArB;EACA,OAAOE,YAAY,GAAG,CAAf,GAAmBA,YAAnB,GAAkCA,YAAY,GAAGjB,MAAxD;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/errors.ts"],"names":["UnexpectedError","Error","constructor","message","PluginError","code","cause","name"],"mappings":";;;;;;;;;AAAO,MAAMA,eAAN,SAA8BC,KAA9B,CAAoC;AAGzCC,EAAAA,WAAW,CAACC,OAAD,EAAkB;AAC3B,UAAO,GAAEA,OAAQ,6EAAjB;;AAD2B,kCAFb,iBAEa;AAE5B;;AALwC;;;;AAgB3C;AACA;AACA;AACO,MAAMC,WAAN,SAA0BH,KAA1B,CAAgC;AAIrCC,EAAAA,WAAW,CAACC,OAAD,EAAyBE,IAAzB,EAAuDC,KAAvD,EAAsE;AAC/E,UAAMA,KAAK,GAAI,GAAEH,OAAQ,eAAcG,KAAK,CAACC,IAAK,KAAID,KAAK,CAACH,OAAQ,EAAzD,GAA6DA,OAAxE;AAD+E,SAA7CE,IAA6C,GAA7CA,IAA6C;AAAA,SAAfC,KAAe,GAAfA,KAAe;;AAAA,kCAHjE,aAGiE;;AAAA,2CAFxD,IAEwD;AAEhF;;AANoC","sourcesContent":["export class UnexpectedError extends Error {\n readonly name = 'UnexpectedError';\n\n constructor(message: string) {\n super(`${message}\\nPlease report this as an issue on https://github.com/expo/expo-cli/issues`);\n }\n}\n\nexport type PluginErrorCode =\n | 'INVALID_PLUGIN_TYPE'\n | 'INVALID_PLUGIN_IMPORT'\n | 'PLUGIN_NOT_FOUND'\n | 'CONFLICTING_PROVIDER'\n | 'INVALID_MOD_ORDER'\n | 'MISSING_PROVIDER';\n\n/**\n * Based on `JsonFileError` from `@expo/json-file`\n */\nexport class PluginError extends Error {\n readonly name = 'PluginError';\n readonly isPluginError = true;\n\n constructor(message: string, public code: PluginErrorCode, public cause?: Error) {\n super(cause ? `${message}\\n└─ Cause: ${cause.name}: ${cause.message}` : message);\n }\n}\n"],"file":"errors.js"}
1
+ {"version":3,"file":"errors.js","names":["UnexpectedError","Error","constructor","message","PluginError","code","cause","name"],"sources":["../../src/utils/errors.ts"],"sourcesContent":["export class UnexpectedError extends Error {\n readonly name = 'UnexpectedError';\n\n constructor(message: string) {\n super(`${message}\\nPlease report this as an issue on https://github.com/expo/expo-cli/issues`);\n }\n}\n\nexport type PluginErrorCode =\n | 'INVALID_PLUGIN_TYPE'\n | 'INVALID_PLUGIN_IMPORT'\n | 'PLUGIN_NOT_FOUND'\n | 'CONFLICTING_PROVIDER'\n | 'INVALID_MOD_ORDER'\n | 'MISSING_PROVIDER';\n\n/**\n * Based on `JsonFileError` from `@expo/json-file`\n */\nexport class PluginError extends Error {\n readonly name = 'PluginError';\n readonly isPluginError = true;\n\n constructor(message: string, public code: PluginErrorCode, public cause?: Error) {\n super(cause ? `${message}\\n└─ Cause: ${cause.name}: ${cause.message}` : message);\n }\n}\n"],"mappings":";;;;;;;;;AAAO,MAAMA,eAAN,SAA8BC,KAA9B,CAAoC;EAGzCC,WAAW,CAACC,OAAD,EAAkB;IAC3B,MAAO,GAAEA,OAAQ,6EAAjB;;IAD2B,8BAFb,iBAEa;EAE5B;;AALwC;;;;AAgB3C;AACA;AACA;AACO,MAAMC,WAAN,SAA0BH,KAA1B,CAAgC;EAIrCC,WAAW,CAACC,OAAD,EAAyBE,IAAzB,EAAuDC,KAAvD,EAAsE;IAC/E,MAAMA,KAAK,GAAI,GAAEH,OAAQ,eAAcG,KAAK,CAACC,IAAK,KAAID,KAAK,CAACH,OAAQ,EAAzD,GAA6DA,OAAxE;IAD+E,KAA7CE,IAA6C,GAA7CA,IAA6C;IAAA,KAAfC,KAAe,GAAfA,KAAe;;IAAA,8BAHjE,aAGiE;;IAAA,uCAFxD,IAEwD;EAEhF;;AANoC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/fs.ts"],"names":["copyFilePathToPathAsync","src","dest","srcFile","fs","promises","readFile","mkdir","path","dirname","recursive","writeFile","removeFile","filePath","unlinkSync","error","code"],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA;AACO,eAAeA,uBAAf,CAAuCC,GAAvC,EAAoDC,IAApD,EAAiF;AACtF,QAAMC,OAAO,GAAG,MAAMC,cAAGC,QAAH,CAAYC,QAAZ,CAAqBL,GAArB,CAAtB;AACA,QAAMG,cAAGC,QAAH,CAAYE,KAAZ,CAAkBC,gBAAKC,OAAL,CAAaP,IAAb,CAAlB,EAAsC;AAAEQ,IAAAA,SAAS,EAAE;AAAb,GAAtC,CAAN;AACA,QAAMN,cAAGC,QAAH,CAAYM,SAAZ,CAAsBT,IAAtB,EAA4BC,OAA5B,CAAN;AACD;AAED;;;AACO,SAASS,UAAT,CAAoBC,QAApB,EAA+C;AACpD,MAAI;AACFT,kBAAGU,UAAH,CAAcD,QAAd;;AACA,WAAO,IAAP;AACD,GAHD,CAGE,OAAOE,KAAP,EAAmB;AACnB;AACA,QAAIA,KAAK,CAACC,IAAN,KAAe,QAAnB,EAA6B;AAC3B,aAAO,KAAP;AACD;;AACD,UAAMD,KAAN;AACD;AACF","sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\n/** A basic function that copies a single file to another file location. */\nexport async function copyFilePathToPathAsync(src: string, dest: string): Promise<void> {\n const srcFile = await fs.promises.readFile(src);\n await fs.promises.mkdir(path.dirname(dest), { recursive: true });\n await fs.promises.writeFile(dest, srcFile);\n}\n\n/** Remove a single file (not directory). Returns `true` if a file was actually deleted. */\nexport function removeFile(filePath: string): boolean {\n try {\n fs.unlinkSync(filePath);\n return true;\n } catch (error: any) {\n // Skip if the remove did nothing.\n if (error.code === 'ENOENT') {\n return false;\n }\n throw error;\n }\n}\n"],"file":"fs.js"}
1
+ {"version":3,"file":"fs.js","names":["copyFilePathToPathAsync","src","dest","srcFile","fs","promises","readFile","mkdir","path","dirname","recursive","writeFile","removeFile","filePath","unlinkSync","error","code"],"sources":["../../src/utils/fs.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\n/** A basic function that copies a single file to another file location. */\nexport async function copyFilePathToPathAsync(src: string, dest: string): Promise<void> {\n const srcFile = await fs.promises.readFile(src);\n await fs.promises.mkdir(path.dirname(dest), { recursive: true });\n await fs.promises.writeFile(dest, srcFile);\n}\n\n/** Remove a single file (not directory). Returns `true` if a file was actually deleted. */\nexport function removeFile(filePath: string): boolean {\n try {\n fs.unlinkSync(filePath);\n return true;\n } catch (error: any) {\n // Skip if the remove did nothing.\n if (error.code === 'ENOENT') {\n return false;\n }\n throw error;\n }\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAEA;AACO,eAAeA,uBAAf,CAAuCC,GAAvC,EAAoDC,IAApD,EAAiF;EACtF,MAAMC,OAAO,GAAG,MAAMC,aAAA,CAAGC,QAAH,CAAYC,QAAZ,CAAqBL,GAArB,CAAtB;EACA,MAAMG,aAAA,CAAGC,QAAH,CAAYE,KAAZ,CAAkBC,eAAA,CAAKC,OAAL,CAAaP,IAAb,CAAlB,EAAsC;IAAEQ,SAAS,EAAE;EAAb,CAAtC,CAAN;EACA,MAAMN,aAAA,CAAGC,QAAH,CAAYM,SAAZ,CAAsBT,IAAtB,EAA4BC,OAA5B,CAAN;AACD;AAED;;;AACO,SAASS,UAAT,CAAoBC,QAApB,EAA+C;EACpD,IAAI;IACFT,aAAA,CAAGU,UAAH,CAAcD,QAAd;;IACA,OAAO,IAAP;EACD,CAHD,CAGE,OAAOE,KAAP,EAAmB;IACnB;IACA,IAAIA,KAAK,CAACC,IAAN,KAAe,QAAnB,EAA6B;MAC3B,OAAO,KAAP;IACD;;IACD,MAAMD,KAAN;EACD;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/generateCode.ts"],"names":["getGeneratedSectionIndexes","src","tag","contents","split","start","findIndex","line","includes","end","mergeContents","newSrc","anchor","offset","comment","header","createGeneratedHeaderComment","sanitizedTarget","removeGeneratedContents","addLines","didMerge","didClear","removeContents","content","find","toAdd","lines","lineIndex","match","error","Error","code","newLine","splice","join","hashKey","createHash","hash","crypto","update","digest"],"mappings":";;;;;;;;;;;AAKA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AALA;AACA;AACA;AACA;AACA;AAGA,SAASA,0BAAT,CACEC,GADF,EAEEC,GAFF,EAGsD;AACpD,QAAMC,QAAQ,GAAGF,GAAG,CAACG,KAAJ,CAAU,IAAV,CAAjB;AACA,QAAMC,KAAK,GAAGF,QAAQ,CAACG,SAAT,CAAmBC,IAAI,IAAIA,IAAI,CAACC,QAAL,CAAe,oBAAmBN,GAAI,EAAtC,CAA3B,CAAd;AACA,QAAMO,GAAG,GAA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C,EAA2C;AACzCN,IAAAA,QAAQ,CAAC8B,MAAT,CAAgB5B,KAAhB,EAAuBI,GAAG,GAAGJ,KAAN,GAAc,CAArC,EADyC,CAEzC;AACA;;AACA,WAAOF,QAAQ,CAAC+B,IAAT,CAAc,IAAd,CAAP;AACD;;AACD,SAAO,IAAP;AACD;;AAEM,SAASlB,4BAAT,CACLb,QADK,EAELD,GAFK,EAGLY,OAHK,EAIG;AACR,QAAMqB,OAAO,GAAGC,UAAU,CAACjC,QAAD,CAA1B,CADQ,CAGR;;AACA,SAAQ,GAAEW,OAAQ,qBAAoBZ,GAAI,oCAAmCiC,OAAQ,EAArF;AACD;;AAEM,SAASC,UAAT,CAAoBnC,GAApB,EAAyC;AAC9C;AACA,QAAMoC,IAAI,GAAGC,kBAAOF,UAAP,CAAkB,MAAlB,EAA0BG,MAA1B,CAAiCtC,GAAjC,EAAsCuC,MAAtC,CAA6C,KAA7C,CAAb;;AACA,SAAQ,QAAOH,IAAK,EAApB;AACD","sourcesContent":["/**\n * Get line indexes for the generated section of a file.\n *\n * @param src\n */\nimport crypto from 'crypto';\n\nfunction getGeneratedSectionIndexes(\n src: string,\n tag: string\n): { contents: string[]; start: number; end: number } {\n const contents = src.split('\\n');\n const start = contents.findIndex(line => line.includes(`@generated begin ${tag}`));\n const end = contents.findIndex(line => line.includes(`@generated end ${tag}`));\n\n return { contents, start, end };\n}\n\nexport type MergeResults = {\n contents: string;\n didClear: boolean;\n didMerge: boolean;\n};\n\n/**\n * Merge the contents of two files together and add a generated header.\n *\n * @param src contents of the original file\n * @param newSrc new contents to merge into the original file\n * @param identifier used to update and remove merges\n * @param anchor regex to where the merge should begin\n * @param offset line offset to start merging at (<1 for behind the anchor)\n * @param comment comment style `//` or `#`\n */\nexport function mergeContents({\n src,\n newSrc,\n tag,\n anchor,\n offset,\n comment,\n}: {\n src: string;\n newSrc: string;\n tag: string;\n anchor: string | RegExp;\n offset: number;\n comment: string;\n}): MergeResults {\n const header = createGeneratedHeaderComment(newSrc, tag, comment);\n if (!src.includes(header)) {\n // Ensure the old generated contents are removed.\n const sanitizedTarget = removeGeneratedContents(src, tag);\n return {\n contents: addLines(sanitizedTarget ?? src, anchor, offset, [\n header,\n ...newSrc.split('\\n'),\n `${comment} @generated end ${tag}`,\n ]),\n didMerge: true,\n didClear: !!sanitizedTarget,\n };\n }\n return { contents: src, didClear: false, didMerge: false };\n}\n\nexport function removeContents({ src, tag }: { src: string; tag: string }): MergeResults {\n // Ensure the old generated contents are removed.\n const sanitizedTarget = removeGeneratedContents(src, tag);\n return {\n contents: sanitizedTarget ?? src,\n didMerge: false,\n didClear: !!sanitizedTarget,\n };\n}\n\nfunction addLines(content: string, find: string | RegExp, offset: number, toAdd: string[]) {\n const lines = content.split('\\n');\n\n let lineIndex = lines.findIndex(line => line.match(find));\n if (lineIndex < 0) {\n const error = new Error(`Failed to match \"${find}\" in contents:\\n${content}`);\n // @ts-ignore\n error.code = 'ERR_NO_MATCH';\n throw error;\n }\n for (const newLine of toAdd) {\n lines.splice(lineIndex + offset, 0, newLine);\n lineIndex++;\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Removes the generated section from a file, returns null when nothing can be removed.\n * This sways heavily towards not removing lines unless it's certain that modifications were not made manually.\n *\n * @param src\n */\nexport function removeGeneratedContents(src: string, tag: string): string | null {\n const { contents, start, end } = getGeneratedSectionIndexes(src, tag);\n if (start > -1 && end > -1 && start < end) {\n contents.splice(start, end - start + 1);\n // TODO: We could in theory check that the contents we're removing match the hash used in the header,\n // this would ensure that we don't accidentally remove lines that someone added or removed from the generated section.\n return contents.join('\\n');\n }\n return null;\n}\n\nexport function createGeneratedHeaderComment(\n contents: string,\n tag: string,\n comment: string\n): string {\n const hashKey = createHash(contents);\n\n // Everything after the `${tag} ` is unversioned and can be freely modified without breaking changes.\n return `${comment} @generated begin ${tag} - expo prebuild (DO NOT MODIFY) ${hashKey}`;\n}\n\nexport function createHash(src: string): string {\n // this doesn't need to be secure, the shorter the better.\n const hash = crypto.createHash('sha1').update(src).digest('hex');\n return `sync-${hash}`;\n}\n"],"file":"generateCode.js"}
1
+ {"version":3,"file":"generateCode.js","names":["getGeneratedSectionIndexes","src","tag","contents","split","start","findIndex","line","includes","end","mergeContents","newSrc","anchor","offset","comment","header","createGeneratedHeaderComment","sanitizedTarget","removeGeneratedContents","addLines","didMerge","didClear","removeContents","content","find","toAdd","lines","lineIndex","match","error","Error","code","newLine","splice","join","hashKey","createHash","hash","crypto","update","digest"],"sources":["../../src/utils/generateCode.ts"],"sourcesContent":["/**\n * Get line indexes for the generated section of a file.\n *\n * @param src\n */\nimport crypto from 'crypto';\n\nfunction getGeneratedSectionIndexes(\n src: string,\n tag: string\n): { contents: string[]; start: number; end: number } {\n const contents = src.split('\\n');\n const start = contents.findIndex((line) => line.includes(`@generated begin ${tag}`));\n const end = contents.findIndex((line) => line.includes(`@generated end ${tag}`));\n\n return { contents, start, end };\n}\n\nexport type MergeResults = {\n contents: string;\n didClear: boolean;\n didMerge: boolean;\n};\n\n/**\n * Merge the contents of two files together and add a generated header.\n *\n * @param src contents of the original file\n * @param newSrc new contents to merge into the original file\n * @param identifier used to update and remove merges\n * @param anchor regex to where the merge should begin\n * @param offset line offset to start merging at (<1 for behind the anchor)\n * @param comment comment style `//` or `#`\n */\nexport function mergeContents({\n src,\n newSrc,\n tag,\n anchor,\n offset,\n comment,\n}: {\n src: string;\n newSrc: string;\n tag: string;\n anchor: string | RegExp;\n offset: number;\n comment: string;\n}): MergeResults {\n const header = createGeneratedHeaderComment(newSrc, tag, comment);\n if (!src.includes(header)) {\n // Ensure the old generated contents are removed.\n const sanitizedTarget = removeGeneratedContents(src, tag);\n return {\n contents: addLines(sanitizedTarget ?? src, anchor, offset, [\n header,\n ...newSrc.split('\\n'),\n `${comment} @generated end ${tag}`,\n ]),\n didMerge: true,\n didClear: !!sanitizedTarget,\n };\n }\n return { contents: src, didClear: false, didMerge: false };\n}\n\nexport function removeContents({ src, tag }: { src: string; tag: string }): MergeResults {\n // Ensure the old generated contents are removed.\n const sanitizedTarget = removeGeneratedContents(src, tag);\n return {\n contents: sanitizedTarget ?? src,\n didMerge: false,\n didClear: !!sanitizedTarget,\n };\n}\n\nfunction addLines(content: string, find: string | RegExp, offset: number, toAdd: string[]) {\n const lines = content.split('\\n');\n\n let lineIndex = lines.findIndex((line) => line.match(find));\n if (lineIndex < 0) {\n const error = new Error(`Failed to match \"${find}\" in contents:\\n${content}`);\n // @ts-ignore\n error.code = 'ERR_NO_MATCH';\n throw error;\n }\n for (const newLine of toAdd) {\n lines.splice(lineIndex + offset, 0, newLine);\n lineIndex++;\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Removes the generated section from a file, returns null when nothing can be removed.\n * This sways heavily towards not removing lines unless it's certain that modifications were not made manually.\n *\n * @param src\n */\nexport function removeGeneratedContents(src: string, tag: string): string | null {\n const { contents, start, end } = getGeneratedSectionIndexes(src, tag);\n if (start > -1 && end > -1 && start < end) {\n contents.splice(start, end - start + 1);\n // TODO: We could in theory check that the contents we're removing match the hash used in the header,\n // this would ensure that we don't accidentally remove lines that someone added or removed from the generated section.\n return contents.join('\\n');\n }\n return null;\n}\n\nexport function createGeneratedHeaderComment(\n contents: string,\n tag: string,\n comment: string\n): string {\n const hashKey = createHash(contents);\n\n // Everything after the `${tag} ` is unversioned and can be freely modified without breaking changes.\n return `${comment} @generated begin ${tag} - expo prebuild (DO NOT MODIFY) ${hashKey}`;\n}\n\nexport function createHash(src: string): string {\n // this doesn't need to be secure, the shorter the better.\n const hash = crypto.createHash('sha1').update(src).digest('hex');\n return `sync-${hash}`;\n}\n"],"mappings":";;;;;;;;;;;AAKA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AALA;AACA;AACA;AACA;AACA;AAGA,SAASA,0BAAT,CACEC,GADF,EAEEC,GAFF,EAGsD;EACpD,MAAMC,QAAQ,GAAGF,GAAG,CAACG,KAAJ,CAAU,IAAV,CAAjB;EACA,MAAMC,KAAK,GAAGF,QAAQ,CAAC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,KAAN,GAAc,CAArC,EADyC,CAEzC;IACA;;IACA,OAAOF,QAAQ,CAAC+B,IAAT,CAAc,IAAd,CAAP;EACD;;EACD,OAAO,IAAP;AACD;;AAEM,SAASlB,4BAAT,CACLb,QADK,EAELD,GAFK,EAGLY,OAHK,EAIG;EACR,MAAMqB,OAAO,GAAGC,UAAU,CAACjC,QAAD,CAA1B,CADQ,CAGR;;EACA,OAAQ,GAAEW,OAAQ,qBAAoBZ,GAAI,oCAAmCiC,OAAQ,EAArF;AACD;;AAEM,SAASC,UAAT,CAAoBnC,GAApB,EAAyC;EAC9C;EACA,MAAMoC,IAAI,GAAGC,iBAAA,CAAOF,UAAP,CAAkB,MAAlB,EAA0BG,MAA1B,CAAiCtC,GAAjC,EAAsCuC,MAAtC,CAA6C,KAA7C,CAAb;;EACA,OAAQ,QAAOH,IAAK,EAApB;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/history.ts"],"names":["getHistoryItem","config","name","_internal","pluginHistory","addHistoryItem","item","version"],"mappings":";;;;;;;;AAUO,SAASA,cAAT,CACLC,MADK,EAELC,IAFK,EAGqB;AAAA;;AAC1B,uDAAOD,MAAM,CAACE,SAAd,gFAAO,kBAAkBC,aAAzB,2DAAO,uBAAkCF,IAAlC,CAAP,yEAAkD,IAAlD;AACD;;AAEM,SAASG,cAAT,CACLJ,MADK,EAELK,IAFK,EAGO;AACZ,MAAI,CAACL,MAAM,CAACE,SAAZ,EAAuB;AACrBF,IAAAA,MAAM,CAACE,SAAP,GAAmB,EAAnB;AACD;;AACD,MAAI,CAACF,MAAM,CAACE,SAAP,CAAiBC,aAAtB,EAAqC;AACnCH,IAAAA,MAAM,CAACE,SAAP,CAAiBC,aAAjB,GAAiC,EAAjC;AACD;;AAED,MAAI,CAACE,IAAI,CAACC,OAAV,EAAmB;AACjBD,IAAAA,IAAI,CAACC,OAAL,GAAe,aAAf;AACD;;AAEDN,EAAAA,MAAM,CAACE,SAAP,CAAiBC,aAAjB,CAA+BE,IAAI,CAACJ,IAApC,IAA4CI,IAA5C;AAEA,SAAOL,MAAP;AACD","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { ModPlatform } from '../Plugin.types';\n\nexport type PluginHistoryItem = {\n name: string;\n version: string;\n platform?: ModPlatform;\n};\n\nexport function getHistoryItem(\n config: Pick<ExpoConfig, '_internal'>,\n name: string\n): PluginHistoryItem | null {\n return config._internal?.pluginHistory?.[name] ?? null;\n}\n\nexport function addHistoryItem(\n config: ExpoConfig,\n item: Omit<PluginHistoryItem, 'version'> & { version?: string }\n): ExpoConfig {\n if (!config._internal) {\n config._internal = {};\n }\n if (!config._internal.pluginHistory) {\n config._internal.pluginHistory = {};\n }\n\n if (!item.version) {\n item.version = 'UNVERSIONED';\n }\n\n config._internal.pluginHistory[item.name] = item;\n\n return config;\n}\n"],"file":"history.js"}
1
+ {"version":3,"file":"history.js","names":["getHistoryItem","config","name","_internal","pluginHistory","addHistoryItem","item","version"],"sources":["../../src/utils/history.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { ModPlatform } from '../Plugin.types';\n\nexport type PluginHistoryItem = {\n name: string;\n version: string;\n platform?: ModPlatform;\n};\n\nexport function getHistoryItem(\n config: Pick<ExpoConfig, '_internal'>,\n name: string\n): PluginHistoryItem | null {\n return config._internal?.pluginHistory?.[name] ?? null;\n}\n\nexport function addHistoryItem(\n config: ExpoConfig,\n item: Omit<PluginHistoryItem, 'version'> & { version?: string }\n): ExpoConfig {\n if (!config._internal) {\n config._internal = {};\n }\n if (!config._internal.pluginHistory) {\n config._internal.pluginHistory = {};\n }\n\n if (!item.version) {\n item.version = 'UNVERSIONED';\n }\n\n config._internal.pluginHistory[item.name] = item;\n\n return config;\n}\n"],"mappings":";;;;;;;;AAUO,SAASA,cAAT,CACLC,MADK,EAELC,IAFK,EAGqB;EAAA;;EAC1B,qDAAOD,MAAM,CAACE,SAAd,gFAAO,kBAAkBC,aAAzB,2DAAO,uBAAkCF,IAAlC,CAAP,yEAAkD,IAAlD;AACD;;AAEM,SAASG,cAAT,CACLJ,MADK,EAELK,IAFK,EAGO;EACZ,IAAI,CAACL,MAAM,CAACE,SAAZ,EAAuB;IACrBF,MAAM,CAACE,SAAP,GAAmB,EAAnB;EACD;;EACD,IAAI,CAACF,MAAM,CAACE,SAAP,CAAiBC,aAAtB,EAAqC;IACnCH,MAAM,CAACE,SAAP,CAAiBC,aAAjB,GAAiC,EAAjC;EACD;;EAED,IAAI,CAACE,IAAI,CAACC,OAAV,EAAmB;IACjBD,IAAI,CAACC,OAAL,GAAe,aAAf;EACD;;EAEDN,MAAM,CAACE,SAAP,CAAiBC,aAAjB,CAA+BE,IAAI,CAACJ,IAApC,IAA4CI,IAA5C;EAEA,OAAOL,MAAP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/matchBrackets.ts"],"names":["LEFT_BRACKETS","RIGHT_BRACKETS","findMatchingBracketPosition","contents","bracket","offset","firstBracketPos","indexOf","stackCounter","matchingBracket","getMatchingBracket","isLeftBracket","contentsLength","length","i","c","leftBracketList","includes","Error"],"mappings":";;;;;;AAAA,MAAMA,aAAa,GAAG,CAAC,GAAD,EAAM,GAAN,CAAtB;AACA,MAAMC,cAAc,GAAG,CAAC,GAAD,EAAM,GAAN,CAAvB;;AAMO,SAASC,2BAAT,CACLC,QADK,EAELC,OAFK,EAGLC,MAAc,GAAG,CAHZ,EAIG;AACR;AACA,QAAMC,eAAe,GAAGH,QAAQ,CAACI,OAAT,CAAiBH,OAAjB,EAA0BC,MAA1B,CAAxB;;AACA,MAAIC,eAAe,GAAG,CAAtB,EAAyB;AACvB,WAAO,CAAC,CAAR;AACD;;AAED,MAAIE,YAAY,GAAG,CAAnB;AACA,QAAMC,eAAe,GAAGC,kBAAkB,CAACN,OAAD,CAA1C;;AAEA,MAAIO,aAAa,CAACP,OAAD,CAAjB,EAA4B;AAC1B,UAAMQ,cAAc,GAAGT,QAAQ,CAACU,MAAhC,CAD0B,C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OAAQ,EAA3C,CAAN;AAVJ;AAYD","sourcesContent":["const LEFT_BRACKETS = ['(', '{'] as const;\nconst RIGHT_BRACKETS = [')', '}'] as const;\n\ntype LeftBracket = typeof LEFT_BRACKETS[number];\ntype RightBracket = typeof RIGHT_BRACKETS[number];\ntype Bracket = LeftBracket | RightBracket;\n\nexport function findMatchingBracketPosition(\n contents: string,\n bracket: Bracket,\n offset: number = 0\n): number {\n // search first occurrence of `bracket`\n const firstBracketPos = contents.indexOf(bracket, offset);\n if (firstBracketPos < 0) {\n return -1;\n }\n\n let stackCounter = 0;\n const matchingBracket = getMatchingBracket(bracket);\n\n if (isLeftBracket(bracket)) {\n const contentsLength = contents.length;\n // search forward\n for (let i = firstBracketPos + 1; i < contentsLength; ++i) {\n const c = contents[i];\n if (c === bracket) {\n stackCounter += 1;\n } else if (c === matchingBracket) {\n if (stackCounter === 0) {\n return i;\n }\n stackCounter -= 1;\n }\n }\n } else {\n // search backward\n for (let i = firstBracketPos - 1; i >= 0; --i) {\n const c = contents[i];\n if (c === bracket) {\n stackCounter += 1;\n } else if (c === matchingBracket) {\n if (stackCounter === 0) {\n return i;\n }\n stackCounter -= 1;\n }\n }\n }\n\n return -1;\n}\n\nfunction isLeftBracket(bracket: Bracket): boolean {\n const leftBracketList: readonly Bracket[] = LEFT_BRACKETS;\n return leftBracketList.includes(bracket);\n}\n\nfunction getMatchingBracket(bracket: Bracket): Bracket {\n switch (bracket) {\n case '(':\n return ')';\n case ')':\n return '(';\n case '{':\n return '}';\n case '}':\n return '{';\n default:\n throw new Error(`Unsupported bracket - ${bracket}`);\n }\n}\n"],"file":"matchBrackets.js"}
1
+ {"version":3,"file":"matchBrackets.js","names":["LEFT_BRACKETS","RIGHT_BRACKETS","findMatchingBracketPosition","contents","bracket","offset","firstBracketPos","indexOf","stackCounter","matchingBracket","getMatchingBracket","isLeftBracket","contentsLength","length","i","c","leftBracketList","includes","Error"],"sources":["../../src/utils/matchBrackets.ts"],"sourcesContent":["const LEFT_BRACKETS = ['(', '{'] as const;\nconst RIGHT_BRACKETS = [')', '}'] as const;\n\ntype LeftBracket = typeof LEFT_BRACKETS[number];\ntype RightBracket = typeof RIGHT_BRACKETS[number];\ntype Bracket = LeftBracket | RightBracket;\n\nexport function findMatchingBracketPosition(\n contents: string,\n bracket: Bracket,\n offset: number = 0\n): number {\n // search first occurrence of `bracket`\n const firstBracketPos = contents.indexOf(bracket, offset);\n if (firstBracketPos < 0) {\n return -1;\n }\n\n let stackCounter = 0;\n const matchingBracket = getMatchingBracket(bracket);\n\n if (isLeftBracket(bracket)) {\n const contentsLength = contents.length;\n // search forward\n for (let i = firstBracketPos + 1; i < contentsLength; ++i) {\n const c = contents[i];\n if (c === bracket) {\n stackCounter += 1;\n } else if (c === matchingBracket) {\n if (stackCounter === 0) {\n return i;\n }\n stackCounter -= 1;\n }\n }\n } else {\n // search backward\n for (let i = firstBracketPos - 1; i >= 0; --i) {\n const c = contents[i];\n if (c === bracket) {\n stackCounter += 1;\n } else if (c === matchingBracket) {\n if (stackCounter === 0) {\n return i;\n }\n stackCounter -= 1;\n }\n }\n }\n\n return -1;\n}\n\nfunction isLeftBracket(bracket: Bracket): boolean {\n const leftBracketList: readonly Bracket[] = LEFT_BRACKETS;\n return leftBracketList.includes(bracket);\n}\n\nfunction getMatchingBracket(bracket: Bracket): Bracket {\n switch (bracket) {\n case '(':\n return ')';\n case ')':\n return '(';\n case '{':\n return '}';\n case '}':\n return '{';\n default:\n throw new Error(`Unsupported bracket - ${bracket}`);\n }\n}\n"],"mappings":";;;;;;AAAA,MAAMA,aAAa,GAAG,CAAC,GAAD,EAAM,GAAN,CAAtB;AACA,MAAMC,cAAc,GAAG,CAAC,GAAD,EAAM,GAAN,CAAvB;;AAMO,SAASC,2BAAT,CACLC,QADK,EAELC,OAFK,EAGLC,MAAc,GAAG,CAHZ,EAIG;EACR;EACA,MAAMC,eAAe,GAAGH,QAAQ,CAACI,OAAT,CAAiBH,OAAjB,EAA0BC,MAA1B,CAA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AT,CAA4BN,OAA5B,EAAuD;EACrD,QAAQA,OAAR;IACE,KAAK,GAAL;MACE,OAAO,GAAP;;IACF,KAAK,GAAL;MACE,OAAO,GAAP;;IACF,KAAK,GAAL;MACE,OAAO,GAAP;;IACF,KAAK,GAAL;MACE,OAAO,GAAP;;IACF;MACE,MAAM,IAAIc,KAAJ,CAAW,yBAAwBd,OAAQ,EAA3C,CAAN;EAVJ;AAYD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/modules.ts"],"names":["statAsync","file","fs","promises","stat","fileExistsAsync","isFile","directoryExistsAsync","isDirectory","fileExists","statSync"],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAeA,SAAf,CAAyBC,IAAzB,EAAiE;AAC/D,MAAI;AACF,WAAO,MAAMC,cAAGC,QAAH,CAAYC,IAAZ,CAAiBH,IAAjB,CAAb;AACD,GAFD,CAEE,MAAM;AACN,WAAO,IAAP;AACD;AACF;;AAEM,eAAeI,eAAf,CAA+BJ,IAA/B,EAA+D;AAAA;;AACpE,sDAAQ,MAAMD,SAAS,CAACC,IAAD,CAAvB,qDAAO,iBAAyBK,MAAzB,EAAP,yEAA4C,KAA5C;AACD;;AAEM,eAAeC,oBAAf,CAAoCN,IAApC,EAAoE;AAAA;;AACzE,uDAAQ,MAAMD,SAAS,CAACC,IAAD,CAAvB,sDAAO,kBAAyBO,WAAzB,EAAP,yEAAiD,KAAjD;AACD;;AAEM,SAASC,UAAT,CAAoBR,IAApB,EAA2C;AAChD,MAAI;AACF,WAAOC,cAAGQ,QAAH,CAAYT,IAAZ,EAAkBK,MAAlB,EAAP;AACD,GAFD,CAEE,MAAM;AACN,WAAO,KAAP;AACD;AACF","sourcesContent":["import fs from 'fs';\n\n/**\n * A non-failing version of async FS stat.\n *\n * @param file\n */\nasync function statAsync(file: string): Promise<fs.Stats | null> {\n try {\n return await fs.promises.stat(file);\n } catch {\n return null;\n }\n}\n\nexport async function fileExistsAsync(file: string): Promise<boolean> {\n return (await statAsync(file))?.isFile() ?? false;\n}\n\nexport async function directoryExistsAsync(file: string): Promise<boolean> {\n return (await statAsync(file))?.isDirectory() ?? false;\n}\n\nexport function fileExists(file: string): boolean {\n try {\n return fs.statSync(file).isFile();\n } catch {\n return false;\n }\n}\n"],"file":"modules.js"}
1
+ {"version":3,"file":"modules.js","names":["statAsync","file","fs","promises","stat","fileExistsAsync","isFile","directoryExistsAsync","isDirectory","fileExists","statSync"],"sources":["../../src/utils/modules.ts"],"sourcesContent":["import fs from 'fs';\n\n/**\n * A non-failing version of async FS stat.\n *\n * @param file\n */\nasync function statAsync(file: string): Promise<fs.Stats | null> {\n try {\n return await fs.promises.stat(file);\n } catch {\n return null;\n }\n}\n\nexport async function fileExistsAsync(file: string): Promise<boolean> {\n return (await statAsync(file))?.isFile() ?? false;\n}\n\nexport async function directoryExistsAsync(file: string): Promise<boolean> {\n return (await statAsync(file))?.isDirectory() ?? false;\n}\n\nexport function fileExists(file: string): boolean {\n try {\n return fs.statSync(file).isFile();\n } catch {\n return false;\n }\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAeA,SAAf,CAAyBC,IAAzB,EAAiE;EAC/D,IAAI;IACF,OAAO,MAAMC,aAAA,CAAGC,QAAH,CAAYC,IAAZ,CAAiBH,IAAjB,CAAb;EACD,CAFD,CAEE,MAAM;IACN,OAAO,IAAP;EACD;AACF;;AAEM,eAAeI,eAAf,CAA+BJ,IAA/B,EAA+D;EAAA;;EACpE,oDAAQ,MAAMD,SAAS,CAACC,IAAD,CAAvB,qDAAO,iBAAyBK,MAAzB,EAAP,yEAA4C,KAA5C;AACD;;AAEM,eAAeC,oBAAf,CAAoCN,IAApC,EAAoE;EAAA;;EACzE,qDAAQ,MAAMD,SAAS,CAACC,IAAD,CAAvB,sDAAO,kBAAyBO,WAAzB,EAAP,yEAAiD,KAAjD;AACD;;AAEM,SAASC,UAAT,CAAoBR,IAApB,EAA2C;EAChD,IAAI;IACF,OAAOC,aAAA,CAAGQ,QAAH,CAAYT,IAAZ,EAAkBK,MAAlB,EAAP;EACD,CAFD,CAEE,MAAM;IACN,OAAO,KAAP;EACD;AACF"}
@@ -0,0 +1,2 @@
1
+ /** `lodash.get` */
2
+ export declare function get(obj: any, key: string): any;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.get = get;
7
+
8
+ /** `lodash.get` */
9
+ function get(obj, key) {
10
+ const branches = key.split('.');
11
+ let current = obj;
12
+ let branch;
13
+
14
+ while (branch = branches.shift()) {
15
+ if (!(branch in current)) {
16
+ return undefined;
17
+ }
18
+
19
+ current = current[branch];
20
+ }
21
+
22
+ return current;
23
+ }
24
+ //# sourceMappingURL=obj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"obj.js","names":["get","obj","key","branches","split","current","branch","shift","undefined"],"sources":["../../src/utils/obj.ts"],"sourcesContent":["/** `lodash.get` */\nexport function get(obj: any, key: string): any {\n const branches = key.split('.');\n let current: any = obj;\n let branch: string | undefined;\n while ((branch = branches.shift())) {\n if (!(branch in current)) {\n return undefined;\n }\n current = current[branch];\n }\n return current;\n}\n"],"mappings":";;;;;;;AAAA;AACO,SAASA,GAAT,CAAaC,GAAb,EAAuBC,GAAvB,EAAyC;EAC9C,MAAMC,QAAQ,GAAGD,GAAG,CAACE,KAAJ,CAAU,GAAV,CAAjB;EACA,IAAIC,OAAY,GAAGJ,GAAnB;EACA,IAAIK,MAAJ;;EACA,OAAQA,MAAM,GAAGH,QAAQ,CAACI,KAAT,EAAjB,EAAoC;IAClC,IAAI,EAAED,MAAM,IAAID,OAAZ,CAAJ,EAA0B;MACxB,OAAOG,SAAP;IACD;;IACDH,OAAO,GAAGA,OAAO,CAACC,MAAD,CAAjB;EACD;;EACD,OAAOD,OAAP;AACD"}