@expo/build-tools 1.0.150 → 1.0.152

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -12,7 +12,7 @@ Additional Use Grant: You may make use of the Licensed Work, provided that you d
12
12
  to access the functionality of and directly benefit from the
13
13
  functionality of the Licensed Work.
14
14
 
15
- Change Date: 2027-10-01
15
+ Change Date: 2027-12-05
16
16
 
17
17
  Change License: MIT
18
18
 
@@ -200,6 +200,25 @@ To resolve this issue, downgrade to an older Xcode version using the "image" fie
200
200
  regexp: /.*/,
201
201
  createError: () => new UserFacingError(eas_build_job_1.errors.ErrorCode.UNKNOWN_FASTLANE_RESIGN_ERROR, `The "Run fastlane" step failed with an unknown error.`),
202
202
  },
203
+ {
204
+ platform: eas_build_job_1.Platform.IOS,
205
+ phase: errors_types_1.XCODE_BUILD_PHASE,
206
+ // MkDir /Users/expo/workingdir/build/packages/apps/NFLNetwork/ios/build/Build/Products/Release-iphonesimulator/expo-dev-launcher/EXDevLauncher.bundle (in target 'expo-dev-launcher-EXDevLauncher' from project 'Pods')
207
+ // cd /Users/expo/workingdir/build/packages/apps/NFLNetwork/ios/Pods
208
+ // /bin/mkdir -p /Users/expo/workingdir/build/packages/apps/NFLNetwork/ios/build/Build/Products/Release-iphonesimulator/expo-dev-launcher/EXDevLauncher.bundle
209
+ // ProcessXCFramework /Users/expo/workingdir/build/packages/video/ios/Vendor/dependency/ProgrammaticAccessLibrary.xcframework /Users/expo/workingdir/build/packages/apps/NFLNetwork/ios/build/Build/Products/Release-iphonesimulator/ProgrammaticAccessLibrary.framework ios simulator
210
+ // cd /Users/expo/workingdir/build/packages/apps/NFLNetwork/ios
211
+ // builtin-process-xcframework --xcframework /Users/expo/workingdir/build/packages/video/ios/Vendor/dependency/ProgrammaticAccessLibrary.xcframework --platform ios --environment simulator --target-path /Users/expo/workingdir/build/packages/apps/NFLNetwork/ios/build/Build/Products/Release-iphonesimulator
212
+ // /Users/expo/workingdir/build/packages/video/ios/Vendor/dependency/ProgrammaticAccessLibrary.xcframework:1:1: error: The signature of “ProgrammaticAccessLibrary.xcframework” cannot be verified.
213
+ // note: A sealed resource is missing or invalid
214
+ // note: /Users/expo/workingdir/build/packages/video/ios/Vendor/dependency/ProgrammaticAccessLibrary.xcframework: a sealed resource is missing or invalid
215
+ // file modified: /Users/expo/workingdir/build/packages/video/ios/Vendor/dependency/ProgrammaticAccessLibrary.xcframework/ios-arm64_x86_64-simulator/ProgrammaticAccessLibrary.framework/ProgrammaticAccessLibrary
216
+ // file modified: /Users/expo/workingdir/build/packages/video/ios/Vendor/dependency/ProgrammaticAccessLibrary.xcframework/ios-arm64/ProgrammaticAccessLibrary.framework/ProgrammaticAccessLibrary
217
+ regexp: /error: .+/g,
218
+ createError: (matchResult) => new UserFacingError('XCODE_BUILD_ERROR', `The "Run fastlane" step failed because of an error in the Xcode build process. We automatically detected following errors in your Xcode build logs:\n${matchResult
219
+ .map((match) => `- ${match.replace('error: ', '')}`)
220
+ .join('\n')}\nRefer to "Xcode Logs" below for additional, more detailed logs.`),
221
+ },
203
222
  {
204
223
  platform: eas_build_job_1.Platform.IOS,
205
224
  phase: eas_build_job_1.BuildPhase.RUN_FASTLANE,
@@ -1 +1 @@
1
- {"version":3,"file":"userErrorHandlers.js","sourceRoot":"","sources":["../../src/buildErrors/userErrorHandlers.ts"],"names":[],"mappings":";;;AAAA,uDAAwF;AAExF,iDAAiE;AAEjE,IAAO,eAAe,GAAG,sBAAM,CAAC,eAAe,CAAC;AAEnC,QAAA,iBAAiB,GAAoC;IAChE;QACE,QAAQ,EAAE,wBAAQ,CAAC,GAAG;QACtB,KAAK,EAAE,0BAAU,CAAC,YAAY;QAC9B,MAAM,EAAE,4BAA4B;QACpC,eAAe;QACf,gHAAgH;QAChH,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,+CAA+C,EAC/C;;qEAE6D,EAC7D,iDAAiD,CAClD;KACJ;IACD;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ent":["import { BuildMode, BuildPhase, errors, Platform, Workflow } from '@expo/eas-build-job';\n\nimport { ErrorHandler, XCODE_BUILD_PHASE } from './errors.types';\n\nimport UserFacingError = errors.UserFacingError;\n\nexport const userErrorHandlers: ErrorHandler<UserFacingError>[] = [\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n regexp: /requires CocoaPods version/,\n // example log:\n // [!] `React` requires CocoaPods version `>= 1.10.1`, which is not satisfied by your current version, `1.10.0`.\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_UNSUPPORTED_COCOAPODS_VERSION_ERROR',\n `Your project requires a newer version of CocoaPods. You can update it in the build profile in eas.json by either:\n- changing the current version under key \"cocoapods\"\n- switching to an image that supports that version under key \"image\"`,\n 'https://docs.expo.dev/build-reference/eas-json/'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n regexp: /Could not find 'bundler' (.*) required by your/,\n // example log:\n // /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'bundler' (2.2.3) required by your /Users/expo/project/build/ios/Gemfile.lock. (Gem::MissingSpecVersionError)\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_UNSUPPORTED_BUNDLER_VERSION_ERROR',\n `Your project requires a different version of the Ruby \"bundler\" program than the version installed in this EAS Build environment. You can specify which version of \"bundler\" to install by specifying the version under \"build\"→[buildProfileName]→\"ios\"→\"bundler\" in eas.json.`,\n 'https://docs.expo.dev/build-reference/eas-json/'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // example log:\n // > Failed to read key keyalias from store \"/build/workingdir/build/generic/keystore-5787e6af-3002-4cb7-8a57-3e73d13313c2.jks\": Invalid keystore format\n regexp: /Invalid keystore format/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_INVALID_KEYSTORE_FORMAT_ERROR',\n 'The keystore used in this build is malformed or it has an unsupported type. Make sure you provided the correct file.'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // example log:\n // > Failed to read key keyalias from store \"/build/workingdir/build/generic/keystore-286069a8-4bb9-48a6-add9-acf6b58ea06d.jks\": null\n regexp: /Failed to read key[^\\n]+from store/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_INVALID_KEYSTORE_ALIAS_ERROR',\n 'The alias specified for this keystore does not exist. Make sure you specified the correct value.'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.PREBUILD,\n // example log:\n // [15:42:05] Error: Cannot copy google-services.json from /build/workingdir/build/managed/abc to /build/workingdir/build/managed/android/app/google-services.json\n // or\n // [11:17:29] [android.dangerous]: withAndroidDangerousBaseMod: Cannot copy google-services.json from /home/expo/workingdir/build/test/test-google-services.json to /home/expo/workingdir/build/android/app/google-services.json. Please make sure the source and destination paths exist.\n // [11:17:29] Error: [android.dangerous]: withAndroidDangerousBaseMod: Cannot copy google-services.json from /home/expo/workingdir/build/test/test-google-services.json to /home/expo/workingdir/build/android/app/google-services.json. Please make sure the source and destination paths exist.\n regexp: /Cannot copy google-services\\.json/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_JSON_ERROR',\n '\"google-services.json\" is missing, make sure that the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // Execution failed for task ':app:processReleaseGoogleServices'.\n // > File google-services.json is missing. The Google Services Plugin cannot function without it.\n // Searched Location:\n regexp:\n /File google-services\\.json is missing\\. The Google Services Plugin cannot function without it/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_JSON_ERROR',\n '\"google-services.json\" is missing, make sure that the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.PREBUILD,\n // example log:\n // [08:44:18] ENOENT: no such file or directory, copyfile '/Users/expo/workingdir/build/managed/abc' -> '/Users/expo/workingdir/build/managed/ios/testapp/GoogleService-Info.plist'\n regexp: /ENOENT: no such file or directory, copyfile .*GoogleService-Info.plist/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_PLIST_ERROR',\n '\"GoogleService-Info.plist\" is missing, make sure that the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n // example log:\n // [!] CocoaPods could not find compatible versions for pod \"react-native-google-maps\"\n // In Podfile:\n // react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`)\n // Specs satisfying the `react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`)` dependency were found, but they required a higher minimum deployment target.\n // Error: Compatible versions of some pods could not be resolved.\n regexp:\n /Specs satisfying the `(.*)` dependency were found, but they required a higher minimum deployment target/,\n createError: (_, { job }) => {\n return new UserFacingError(\n 'EAS_BUILD_HIGHER_MINIMUM_DEPLOYMENT_TARGET_ERROR',\n `Some pods require a higher minimum deployment target.\n${\n 'type' in job && job.type === Workflow.MANAGED\n ? 'You can use the expo-build-properties config plugin (https://docs.expo.dev/versions/latest/sdk/build-properties/) to override the default native build properties and set a different minimum deployment target.'\n : 'You need to manually update the minimum deployment target in your project to resolve this issue.'\n}\n`\n );\n },\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n // example log:\n // [!] CocoaPods could not find compatible versions for pod \"Firebase/Core\":\n // In snapshot (Podfile.lock):\n // Firebase/Core (= 6.14.0)\n // In Podfile:\n // EXFirebaseCore (from `../node_modules/expo-firebase-core/ios`) was resolved to 3.0.0, which depends on\n // Firebase/Core (= 7.7.0)\n // You have either:\n // * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.\n // * changed the constraints of dependency `Firebase/Core` inside your development pod `EXFirebaseCore`.\n // You should run `pod update Firebase/Core` to apply changes you've made.\n regexp: /CocoaPods could not find compatible versions for pod /,\n createError: () => {\n return new UserFacingError(\n 'EAS_BUILD_INCOMPATIBLE_PODS_ERROR',\n `Compatible versions of some pods could not be resolved.\nYou are seeing this error because either:\n - Some of the pods used in your project depend on different versions of the same pod. See logs for more information.\n - If you are caching Podfile.lock using \"cache\" field in eas.json, then versions there might not match required values in Podspecs of some installed libraries. To fix this, you can re-run build command with \"--clear-cache\" option, or select \"Clear cache and retry build\" on the build page.\n`\n );\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // [stderr] npm ERR! Fix the upstream dependency conflict, or retry\n // [stderr] npm ERR! this command with --force, or --legacy-peer-deps\n // [stderr] npm ERR! to accept an incorrect (and potentially broken) dependency resolution.\n regexp:\n /Fix the upstream dependency conflict, or retry.*\\s.*this command with --force, or --legacy-peer-deps/,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult.length >= 2) {\n return new UserFacingError(\n 'EAS_BUILD_NPM_CONFLICTING_PEER_DEPENDENCIES',\n `Some of your peer dependencies are not compatible. The recommended approach is to fix your dependencies by resolving any conflicts listed by \"npm install\". As a temporary workaround you can:\n- Add \".npmrc\" file with \"legacy-peer-deps=true\" and commit that to your repo.\n- Delete package-lock.json and use yarn instead. It does not enforce peer dependencies.\n- Downgrade to older version of npm on EAS Build, by adding \"npm install -g npm@version\" in \"eas-build-pre-install\" script in package.json.`\n );\n }\n return undefined;\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // [stderr] error https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz: Integrity check failed for \"react-native\" (computed integrity doesn't match our records, got \"sha512-3jHI2YufrJi7eIABRf/DN/I2yOkmIZ0vAyezTz+PAUJiEs4v//5LLojWEU+W53AZsnuaEMcl/4fVy4bd+OuUbA== sha1-o9QuQTXIkc8VozXPaZIullB9a40=\")\n regexp: /Integrity check failed for \"(.*)\" \\(computed integrity doesn't match our records, got/,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult.length >= 2) {\n return new UserFacingError(\n 'EAS_BUILD_YARN_LOCK_CHECKSUM_ERROR',\n `Checksum for package \"${matchResult[1]}\" does not match value in registry. To fix that:\n- run \"yarn cache clean\"\n- remove yarn.lock (or only the section for that package)\n- run \"yarn install --force\"`\n );\n }\n return undefined;\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // yarn install v1.22.17\n // [1/4] Resolving packages...\n // [2/4] Fetching packages...\n // [1/4] Resolving packages...\n // [2/4] Fetching packages...\n // [stderr] error https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: \"ENOENT: no such file or directory, chmod '/Users/expo/Library/Caches/Yarn/v6/npm-jest-util-26.6.2-907535dbe4d5a6cb4c47ac9b926f6af29576cbc1-integrity/node_modules/jest-util/build/pluralize.d.ts'\"\n regexp:\n /\\[1\\/4\\] Resolving packages...\\s*\\[2\\/4\\] Fetching packages...\\s*\\[1\\/4\\] Resolving packages...\\s*\\[2\\/4\\] Fetching packages.../,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult) {\n return new UserFacingError(\n 'EAS_BUILD_YARN_MULTIPLE_INSTANCES_ERROR',\n `One of project dependencies is starting new install process while the main one is still in progress, which might result in corrupted packages. Most likely the reason for error is \"prepare\" script in git-referenced dependency of your project. Learn more: https://github.com/yarnpkg/yarn/issues/7212#issuecomment-493720324`\n );\n }\n return undefined;\n },\n },\n {\n platform: Platform.IOS,\n phase: XCODE_BUILD_PHASE,\n // Prepare packages\n // Computing target dependency graph and provisioning inputs\n // Create build description\n // Build description signature: 33a5c28977280822abe5e7bd7fe02529\n // Build description path: /Users/expo/Library/Developer/Xcode/DerivedData/testapp-fazozgerxcvvfifkipojsjftgyih/Build/Intermediates.noindex/ArchiveIntermediates/testapp/IntermediateBuildFilesPath/XCBuildData/33a5c28977280822abe5e7bd7fe02529-desc.xcbuild\n // note: Building targets in dependency order\n // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for \"EXConstants-EXConstants\" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'EXConstants-EXConstants' from project 'Pods')\n // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for \"React-Core-AccessibilityResources\" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'React-Core-AccessibilityResources' from project 'Pods')\n // warning: Run script build phase '[CP-User] Generate app.manifest for expo-updates' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'EXUpdates' from project 'Pods')\n // warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'testapp' from project 'testapp')\n // warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'testapp' from project 'testapp')\n // warning: Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'EXConstants' from project 'Pods')\n // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for \"EXUpdates-EXUpdates\" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'EXUpdates-EXUpdates' from project 'Pods')\n regexp: /error: Signing for \"[a-zA-Z-0-9_]+\" requires a development team/,\n createError: (_, { job }) =>\n 'type' in job && job.type === Workflow.MANAGED\n ? new UserFacingError(\n 'XCODE_RESOURCE_BUNDLE_CODE_SIGNING_ERROR',\n `Starting from Xcode 14, resource bundles are signed by default, which requires setting the development team for each resource bundle target.\nTo resolve this issue, downgrade to an older Xcode version using the \"image\" field in eas.json, or upgrade to SDK 46 or higher.`,\n 'https://docs.expo.dev/build-reference/infrastructure/#ios-build-server-configurations'\n )\n : new UserFacingError(\n 'XCODE_RESOURCE_BUNDLE_CODE_SIGNING_ERROR',\n `Starting from Xcode 14, resource bundles are signed by default, which requires setting the development team for each resource bundle target.\nTo resolve this issue, downgrade to an older Xcode version using the \"image\" field in eas.json, or turn off signing resource bundles in your Podfile: https://expo.fyi/r/disable-bundle-resource-signing`,\n 'https://docs.expo.dev/build-reference/infrastructure/#ios-build-server-configurations'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n regexp: /.*/,\n createError: () =>\n new UserFacingError(\n errors.ErrorCode.UNKNOWN_GRADLE_ERROR,\n 'Gradle build failed with unknown error. See logs for the \"Run gradlew\" phase for more information.'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n mode: BuildMode.RESIGN,\n regexp: /No provisioning profile for application: '(.+)' with bundle identifier '(.+)'/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_RESIGN_PROVISIONING_PROFILE_MISMATCH_ERROR',\n `The bundle identifier in provisioning profile used to resign the app does not match the bundle identifier of the app selected to be resigned. See logs above for more information.`\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n mode: BuildMode.RESIGN,\n regexp: /.*/,\n createError: () =>\n new UserFacingError(\n errors.ErrorCode.UNKNOWN_FASTLANE_RESIGN_ERROR,\n `The \"Run fastlane\" step failed with an unknown error.`\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n regexp: /.*/,\n createError: () =>\n new UserFacingError(\n errors.ErrorCode.UNKNOWN_FASTLANE_ERROR,\n `The \"Run fastlane\" step failed with an unknown error. Refer to \"Xcode Logs\" below for additional, more detailed logs.`\n ),\n },\n];\n"]}
1
+ {"version":3,"file":"userErrorHandlers.js","sourceRoot":"","sources":["../../src/buildErrors/userErrorHandlers.ts"],"names":[],"mappings":";;;AAAA,uDAAwF;AAExF,iDAAiE;AAEjE,IAAO,eAAe,GAAG,sBAAM,CAAC,eAAe,CAAC;AAEnC,QAAA,iBAAiB,GAAoC;IAChE;QACE,QAAQ,EAAE,wBAAQ,CAAC,GAAG;QACtB,KAAK,EAAE,0BAAU,CAAC,YAAY;QAC9B,MAAM,EAAE,4BAA4B;QACpC,eAAe;QACf,gHAAgH;QAChH,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,+CAA+C,EAC/C;;qEAE6D,EAC7D,iDAAiD,CAClD;KACJ;IACD;QACE,QAAQ,EAAE,wBAAQ,CAAC,GAAG;QACtB,KAAK,EAAE,0BAAU,CAAC,YAAY;QAC9B,MAAM,EAAE,gDAAgD;QACxD,eAAe;QACf,mPAAmP;QACnP,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,6CAA6C,EAC7C,iRAAiR,EACjR,iDAAiD,CAClD;KACJ;IACD;QACE,QAAQ,EAAE,wBAAQ,CAAC,OAAO;QAC1B,KAAK,EAAE,0BAAU,CAAC,WAAW;QAC7B,eAAe;QACf,wJAAwJ;QACxJ,MAAM,EAAE,yBAAyB;QACjC,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,yCAAyC,EACzC,sHAAsH,CACvH;KACJ;IACD;QACE,QAAQ,EAAE,wBAAQ,CAAC,OAAO;QAC1B,KAAK,EAAE,0BAAU,CAAC,WAAW;QAC7B,eAAe;QACf,qIAAqI;QACrI,MAAM,EAAE,oCAAoC;QAC5C,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,w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F,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,sDAAsD,EACtD,oLAAoL,CACrL;KACJ;IACD;QACE,QAAQ,EAAE,wBAAQ,CAAC,GAAG;QACtB,KAAK,EAAE,0BAAU,CAAC,YAAY;QAC9B,IAAI,EAAE,yBAAS,CAAC,MAAM;QACtB,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,sBAAM,CAAC,SAAS,CAAC,6BAA6B,EAC9C,uDAAuD,CACxD;KACJ;IACD;QACE,QAAQ,EAAE,wBAAQ,CAAC,GAAG;QACtB,KAAK,EAAE,gCAAiB;QACxB,wNAAwN;QACxN,oEAAoE;QACpE,8JAA8J;QAC9J,sRAAsR;QACtR,+DAA+D;QAC/D,gTAAgT;QAChT,mMAAmM;QACnM,gDAAgD;QAChD,yJAAyJ;QACzJ,kNAAkN;QAClN,iMAAiM;QACjM,MAAM,EAAE,YAAY;QACpB,WAAW,EAAE,CAAC,WAAW,EAAE,EAAE,CAC3B,IAAI,eAAe,CACjB,mBAAmB,EACnB,wJAAwJ,WAAW;aAChK,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC;aACnD,IAAI,CAAC,IAAI,CAAC,mEAAmE,CACjF;KACJ;IACD;QACE,QAAQ,EAAE,wBAAQ,CAAC,GAAG;QACtB,KAAK,EAAE,0BAAU,CAAC,YAAY;QAC9B,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,sBAAM,CAAC,SAAS,CAAC,sBAAsB,EACvC,uHAAuH,CACxH;KACJ;CACF,CAAC","sourcesContent":["import { BuildMode, BuildPhase, errors, Platform, Workflow } from '@expo/eas-build-job';\n\nimport { ErrorHandler, XCODE_BUILD_PHASE } from './errors.types';\n\nimport UserFacingError = errors.UserFacingError;\n\nexport const userErrorHandlers: ErrorHandler<UserFacingError>[] = [\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n regexp: /requires CocoaPods version/,\n // example log:\n // [!] `React` requires CocoaPods version `>= 1.10.1`, which is not satisfied by your current version, `1.10.0`.\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_UNSUPPORTED_COCOAPODS_VERSION_ERROR',\n `Your project requires a newer version of CocoaPods. You can update it in the build profile in eas.json by either:\n- changing the current version under key \"cocoapods\"\n- switching to an image that supports that version under key \"image\"`,\n 'https://docs.expo.dev/build-reference/eas-json/'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n regexp: /Could not find 'bundler' (.*) required by your/,\n // example log:\n // /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'bundler' (2.2.3) required by your /Users/expo/project/build/ios/Gemfile.lock. (Gem::MissingSpecVersionError)\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_UNSUPPORTED_BUNDLER_VERSION_ERROR',\n `Your project requires a different version of the Ruby \"bundler\" program than the version installed in this EAS Build environment. You can specify which version of \"bundler\" to install by specifying the version under \"build\"→[buildProfileName]→\"ios\"→\"bundler\" in eas.json.`,\n 'https://docs.expo.dev/build-reference/eas-json/'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // example log:\n // > Failed to read key keyalias from store \"/build/workingdir/build/generic/keystore-5787e6af-3002-4cb7-8a57-3e73d13313c2.jks\": Invalid keystore format\n regexp: /Invalid keystore format/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_INVALID_KEYSTORE_FORMAT_ERROR',\n 'The keystore used in this build is malformed or it has an unsupported type. Make sure you provided the correct file.'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // example log:\n // > Failed to read key keyalias from store \"/build/workingdir/build/generic/keystore-286069a8-4bb9-48a6-add9-acf6b58ea06d.jks\": null\n regexp: /Failed to read key[^\\n]+from store/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_INVALID_KEYSTORE_ALIAS_ERROR',\n 'The alias specified for this keystore does not exist. Make sure you specified the correct value.'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.PREBUILD,\n // example log:\n // [15:42:05] Error: Cannot copy google-services.json from /build/workingdir/build/managed/abc to /build/workingdir/build/managed/android/app/google-services.json\n // or\n // [11:17:29] [android.dangerous]: withAndroidDangerousBaseMod: Cannot copy google-services.json from /home/expo/workingdir/build/test/test-google-services.json to /home/expo/workingdir/build/android/app/google-services.json. Please make sure the source and destination paths exist.\n // [11:17:29] Error: [android.dangerous]: withAndroidDangerousBaseMod: Cannot copy google-services.json from /home/expo/workingdir/build/test/test-google-services.json to /home/expo/workingdir/build/android/app/google-services.json. Please make sure the source and destination paths exist.\n regexp: /Cannot copy google-services\\.json/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_JSON_ERROR',\n '\"google-services.json\" is missing, make sure that the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // Execution failed for task ':app:processReleaseGoogleServices'.\n // > File google-services.json is missing. The Google Services Plugin cannot function without it.\n // Searched Location:\n regexp:\n /File google-services\\.json is missing\\. The Google Services Plugin cannot function without it/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_JSON_ERROR',\n '\"google-services.json\" is missing, make sure that the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.PREBUILD,\n // example log:\n // [08:44:18] ENOENT: no such file or directory, copyfile '/Users/expo/workingdir/build/managed/abc' -> '/Users/expo/workingdir/build/managed/ios/testapp/GoogleService-Info.plist'\n regexp: /ENOENT: no such file or directory, copyfile .*GoogleService-Info.plist/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_PLIST_ERROR',\n '\"GoogleService-Info.plist\" is missing, make sure that the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n // example log:\n // [!] CocoaPods could not find compatible versions for pod \"react-native-google-maps\"\n // In Podfile:\n // react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`)\n // Specs satisfying the `react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`)` dependency were found, but they required a higher minimum deployment target.\n // Error: Compatible versions of some pods could not be resolved.\n regexp:\n /Specs satisfying the `(.*)` dependency were found, but they required a higher minimum deployment target/,\n createError: (_, { job }) => {\n return new UserFacingError(\n 'EAS_BUILD_HIGHER_MINIMUM_DEPLOYMENT_TARGET_ERROR',\n `Some pods require a higher minimum deployment target.\n${\n 'type' in job && job.type === Workflow.MANAGED\n ? 'You can use the expo-build-properties config plugin (https://docs.expo.dev/versions/latest/sdk/build-properties/) to override the default native build properties and set a different minimum deployment target.'\n : 'You need to manually update the minimum deployment target in your project to resolve this issue.'\n}\n`\n );\n },\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n // example log:\n // [!] CocoaPods could not find compatible versions for pod \"Firebase/Core\":\n // In snapshot (Podfile.lock):\n // Firebase/Core (= 6.14.0)\n // In Podfile:\n // EXFirebaseCore (from `../node_modules/expo-firebase-core/ios`) was resolved to 3.0.0, which depends on\n // Firebase/Core (= 7.7.0)\n // You have either:\n // * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.\n // * changed the constraints of dependency `Firebase/Core` inside your development pod `EXFirebaseCore`.\n // You should run `pod update Firebase/Core` to apply changes you've made.\n regexp: /CocoaPods could not find compatible versions for pod /,\n createError: () => {\n return new UserFacingError(\n 'EAS_BUILD_INCOMPATIBLE_PODS_ERROR',\n `Compatible versions of some pods could not be resolved.\nYou are seeing this error because either:\n - Some of the pods used in your project depend on different versions of the same pod. See logs for more information.\n - If you are caching Podfile.lock using \"cache\" field in eas.json, then versions there might not match required values in Podspecs of some installed libraries. To fix this, you can re-run build command with \"--clear-cache\" option, or select \"Clear cache and retry build\" on the build page.\n`\n );\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // [stderr] npm ERR! Fix the upstream dependency conflict, or retry\n // [stderr] npm ERR! this command with --force, or --legacy-peer-deps\n // [stderr] npm ERR! to accept an incorrect (and potentially broken) dependency resolution.\n regexp:\n /Fix the upstream dependency conflict, or retry.*\\s.*this command with --force, or --legacy-peer-deps/,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult.length >= 2) {\n return new UserFacingError(\n 'EAS_BUILD_NPM_CONFLICTING_PEER_DEPENDENCIES',\n `Some of your peer dependencies are not compatible. The recommended approach is to fix your dependencies by resolving any conflicts listed by \"npm install\". As a temporary workaround you can:\n- Add \".npmrc\" file with \"legacy-peer-deps=true\" and commit that to your repo.\n- Delete package-lock.json and use yarn instead. It does not enforce peer dependencies.\n- Downgrade to older version of npm on EAS Build, by adding \"npm install -g npm@version\" in \"eas-build-pre-install\" script in package.json.`\n );\n }\n return undefined;\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // [stderr] error https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz: Integrity check failed for \"react-native\" (computed integrity doesn't match our records, got \"sha512-3jHI2YufrJi7eIABRf/DN/I2yOkmIZ0vAyezTz+PAUJiEs4v//5LLojWEU+W53AZsnuaEMcl/4fVy4bd+OuUbA== sha1-o9QuQTXIkc8VozXPaZIullB9a40=\")\n regexp: /Integrity check failed for \"(.*)\" \\(computed integrity doesn't match our records, got/,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult.length >= 2) {\n return new UserFacingError(\n 'EAS_BUILD_YARN_LOCK_CHECKSUM_ERROR',\n `Checksum for package \"${matchResult[1]}\" does not match value in registry. To fix that:\n- run \"yarn cache clean\"\n- remove yarn.lock (or only the section for that package)\n- run \"yarn install --force\"`\n );\n }\n return undefined;\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // yarn install v1.22.17\n // [1/4] Resolving packages...\n // [2/4] Fetching packages...\n // [1/4] Resolving packages...\n // [2/4] Fetching packages...\n // [stderr] error https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: \"ENOENT: no such file or directory, chmod '/Users/expo/Library/Caches/Yarn/v6/npm-jest-util-26.6.2-907535dbe4d5a6cb4c47ac9b926f6af29576cbc1-integrity/node_modules/jest-util/build/pluralize.d.ts'\"\n regexp:\n /\\[1\\/4\\] Resolving packages...\\s*\\[2\\/4\\] Fetching packages...\\s*\\[1\\/4\\] Resolving packages...\\s*\\[2\\/4\\] Fetching packages.../,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult) {\n return new UserFacingError(\n 'EAS_BUILD_YARN_MULTIPLE_INSTANCES_ERROR',\n `One of project dependencies is starting new install process while the main one is still in progress, which might result in corrupted packages. Most likely the reason for error is \"prepare\" script in git-referenced dependency of your project. Learn more: https://github.com/yarnpkg/yarn/issues/7212#issuecomment-493720324`\n );\n }\n return undefined;\n },\n },\n {\n platform: Platform.IOS,\n phase: XCODE_BUILD_PHASE,\n // Prepare packages\n // Computing target dependency graph and provisioning inputs\n // Create build description\n // Build description signature: 33a5c28977280822abe5e7bd7fe02529\n // Build description path: /Users/expo/Library/Developer/Xcode/DerivedData/testapp-fazozgerxcvvfifkipojsjftgyih/Build/Intermediates.noindex/ArchiveIntermediates/testapp/IntermediateBuildFilesPath/XCBuildData/33a5c28977280822abe5e7bd7fe02529-desc.xcbuild\n // note: Building targets in dependency order\n // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for \"EXConstants-EXConstants\" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'EXConstants-EXConstants' from project 'Pods')\n // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for \"React-Core-AccessibilityResources\" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'React-Core-AccessibilityResources' from project 'Pods')\n // warning: Run script build phase '[CP-User] Generate app.manifest for expo-updates' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'EXUpdates' from project 'Pods')\n // warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'testapp' from project 'testapp')\n // warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'testapp' from project 'testapp')\n // warning: Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'EXConstants' from project 'Pods')\n // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for \"EXUpdates-EXUpdates\" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'EXUpdates-EXUpdates' from project 'Pods')\n regexp: /error: Signing for \"[a-zA-Z-0-9_]+\" requires a development team/,\n createError: (_, { job }) =>\n 'type' in job && job.type === Workflow.MANAGED\n ? new UserFacingError(\n 'XCODE_RESOURCE_BUNDLE_CODE_SIGNING_ERROR',\n `Starting from Xcode 14, resource bundles are signed by default, which requires setting the development team for each resource bundle target.\nTo resolve this issue, downgrade to an older Xcode version using the \"image\" field in eas.json, or upgrade to SDK 46 or higher.`,\n 'https://docs.expo.dev/build-reference/infrastructure/#ios-build-server-configurations'\n )\n : new UserFacingError(\n 'XCODE_RESOURCE_BUNDLE_CODE_SIGNING_ERROR',\n `Starting from Xcode 14, resource bundles are signed by default, which requires setting the development team for each resource bundle target.\nTo resolve this issue, downgrade to an older Xcode version using the \"image\" field in eas.json, or turn off signing resource bundles in your Podfile: https://expo.fyi/r/disable-bundle-resource-signing`,\n 'https://docs.expo.dev/build-reference/infrastructure/#ios-build-server-configurations'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n regexp: /.*/,\n createError: () =>\n new UserFacingError(\n errors.ErrorCode.UNKNOWN_GRADLE_ERROR,\n 'Gradle build failed with unknown error. See logs for the \"Run gradlew\" phase for more information.'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n mode: BuildMode.RESIGN,\n regexp: /No provisioning profile for application: '(.+)' with bundle identifier '(.+)'/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_RESIGN_PROVISIONING_PROFILE_MISMATCH_ERROR',\n `The bundle identifier in provisioning profile used to resign the app does not match the bundle identifier of the app selected to be resigned. See logs above for more information.`\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n mode: BuildMode.RESIGN,\n regexp: /.*/,\n createError: () =>\n new UserFacingError(\n errors.ErrorCode.UNKNOWN_FASTLANE_RESIGN_ERROR,\n `The \"Run fastlane\" step failed with an unknown error.`\n ),\n },\n {\n platform: Platform.IOS,\n phase: XCODE_BUILD_PHASE,\n // MkDir /Users/expo/workingdir/build/packages/apps/NFLNetwork/ios/build/Build/Products/Release-iphonesimulator/expo-dev-launcher/EXDevLauncher.bundle (in target 'expo-dev-launcher-EXDevLauncher' from project 'Pods')\n // cd /Users/expo/workingdir/build/packages/apps/NFLNetwork/ios/Pods\n // /bin/mkdir -p /Users/expo/workingdir/build/packages/apps/NFLNetwork/ios/build/Build/Products/Release-iphonesimulator/expo-dev-launcher/EXDevLauncher.bundle\n // ProcessXCFramework /Users/expo/workingdir/build/packages/video/ios/Vendor/dependency/ProgrammaticAccessLibrary.xcframework /Users/expo/workingdir/build/packages/apps/NFLNetwork/ios/build/Build/Products/Release-iphonesimulator/ProgrammaticAccessLibrary.framework ios simulator\n // cd /Users/expo/workingdir/build/packages/apps/NFLNetwork/ios\n // builtin-process-xcframework --xcframework /Users/expo/workingdir/build/packages/video/ios/Vendor/dependency/ProgrammaticAccessLibrary.xcframework --platform ios --environment simulator --target-path /Users/expo/workingdir/build/packages/apps/NFLNetwork/ios/build/Build/Products/Release-iphonesimulator\n // /Users/expo/workingdir/build/packages/video/ios/Vendor/dependency/ProgrammaticAccessLibrary.xcframework:1:1: error: The signature of “ProgrammaticAccessLibrary.xcframework” cannot be verified.\n // note: A sealed resource is missing or invalid\n // note: /Users/expo/workingdir/build/packages/video/ios/Vendor/dependency/ProgrammaticAccessLibrary.xcframework: a sealed resource is missing or invalid\n // file modified: /Users/expo/workingdir/build/packages/video/ios/Vendor/dependency/ProgrammaticAccessLibrary.xcframework/ios-arm64_x86_64-simulator/ProgrammaticAccessLibrary.framework/ProgrammaticAccessLibrary\n // file modified: /Users/expo/workingdir/build/packages/video/ios/Vendor/dependency/ProgrammaticAccessLibrary.xcframework/ios-arm64/ProgrammaticAccessLibrary.framework/ProgrammaticAccessLibrary\n regexp: /error: .+/g,\n createError: (matchResult) =>\n new UserFacingError(\n 'XCODE_BUILD_ERROR',\n `The \"Run fastlane\" step failed because of an error in the Xcode build process. We automatically detected following errors in your Xcode build logs:\\n${matchResult\n .map((match) => `- ${match.replace('error: ', '')}`)\n .join('\\n')}\\nRefer to \"Xcode Logs\" below for additional, more detailed logs.`\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n regexp: /.*/,\n createError: () =>\n new UserFacingError(\n errors.ErrorCode.UNKNOWN_FASTLANE_ERROR,\n `The \"Run fastlane\" step failed with an unknown error. Refer to \"Xcode Logs\" below for additional, more detailed logs.`\n ),\n },\n];\n"]}
package/dist/generic.d.ts CHANGED
@@ -3,7 +3,9 @@ import { BuildWorkflow } from '@expo/steps';
3
3
  import { Result } from '@expo/results';
4
4
  import { BuildContext } from './context';
5
5
  import { CustomBuildContext } from './customBuildContext';
6
- export declare function runGenericJobAsync(ctx: BuildContext<Generic.Job>): Promise<{
6
+ export declare function runGenericJobAsync(ctx: BuildContext<Generic.Job>, { expoApiV2BaseUrl }: {
7
+ expoApiV2BaseUrl: string;
8
+ }): Promise<{
7
9
  runResult: Result<void>;
8
10
  buildWorkflow: BuildWorkflow;
9
11
  }>;
package/dist/generic.js CHANGED
@@ -13,7 +13,8 @@ const projectSources_1 = require("./common/projectSources");
13
13
  const easFunctions_1 = require("./steps/easFunctions");
14
14
  const customBuildContext_1 = require("./customBuildContext");
15
15
  const easFunctionGroups_1 = require("./steps/easFunctionGroups");
16
- async function runGenericJobAsync(ctx) {
16
+ const outputs_1 = require("./utils/outputs");
17
+ async function runGenericJobAsync(ctx, { expoApiV2BaseUrl }) {
17
18
  const customBuildCtx = new customBuildContext_1.CustomBuildContext(ctx);
18
19
  await (0, projectSources_1.prepareProjectSourcesAsync)(ctx, customBuildCtx.projectSourceDirectory);
19
20
  await addEasWorkflows(customBuildCtx);
@@ -44,6 +45,13 @@ async function runGenericJobAsync(ctx) {
44
45
  }
45
46
  });
46
47
  const runResult = await (0, results_1.asyncResult)(workflow.executeAsync());
48
+ await ctx.runBuildPhase(eas_build_job_1.BuildPhase.COMPLETE_JOB, async () => {
49
+ await (0, outputs_1.uploadJobOutputsToWwwAsync)(ctx, {
50
+ steps: workflow.buildSteps,
51
+ logger: ctx.logger,
52
+ expoApiV2BaseUrl,
53
+ });
54
+ });
47
55
  return { runResult, buildWorkflow: workflow };
48
56
  }
49
57
  exports.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H,OAAO,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QACnC,CAAC;QAAC,OAAO,UAAe,EAAE,CAAC;YACzB,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;YAC7D,IAAI,UAAU,YAAY,cAAM,CAAC,kBAAkB,EAAE,CAAC;gBACpD,KAAK,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;oBACpC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;gBAC5B,CAAC;YACH,CAAC;YACD,MAAM,UAAU,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,MAAM,IAAA,qBAAW,EAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;IAE7D,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC;AAChD,CAAC;AA3CD,gDA2CC;AAEM,KAAK,UAAU,eAAe,CAAC,cAAkC;IACtE,MAAM,YAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAI,CAAC,IAAI,CAAC,cAAc,CAAC,sBAAsB,EAAE,OAAO,CAAC,EAAE;QACjF,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;IAEH,MAAM,YAAE,CAAC,QAAQ,CAAC,EAAE,CAClB,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,EAChD,cAAI,CAAC,IAAI,CAAC,cAAc,CAAC,sBAAsB,EAAE,OAAO,CAAC,EACzD,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB,CAAC;AACJ,CAAC;AAVD,0CAUC","sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport { BuildPhase, Generic } from '@expo/eas-build-job';\nimport {\n BuildConfigParser,\n BuildStepGlobalContext,\n BuildWorkflow,\n errors,\n StepsConfigParser,\n} from '@expo/steps';\nimport { Result, asyncResult } from '@expo/results';\n\nimport { BuildContext } from './context';\nimport { prepareProjectSourcesAsync } from './common/projectSources';\nimport { getEasFunctions } from './steps/easFunctions';\nimport { CustomBuildContext } from './customBuildContext';\nimport { getEasFunctionGroups } from './steps/easFunctionGroups';\n\nexport async function runGenericJobAsync(\n ctx: BuildContext<Generic.Job>\n): Promise<{ runResult: Result<void>; buildWorkflow: BuildWorkflow }> {\n const customBuildCtx = new CustomBuildContext(ctx);\n\n await prepareProjectSourcesAsync(ctx, customBuildCtx.projectSourceDirectory);\n\n await addEasWorkflows(customBuildCtx);\n\n const globalContext = new BuildStepGlobalContext(customBuildCtx, false);\n\n const parser = ctx.job.steps\n ? new StepsConfigParser(globalContext, {\n externalFunctions: getEasFunctions(customBuildCtx),\n externalFunctionGroups: getEasFunctionGroups(customBuildCtx),\n steps: ctx.job.steps,\n })\n : new BuildConfigParser(globalContext, {\n externalFunctions: getEasFunctions(customBuildCtx),\n externalFunctionGroups: getEasFunctionGroups(customBuildCtx),\n configPath: path.join(\n customBuildCtx.projectSourceDirectory,\n ctx.job.customBuildConfig.path\n ),\n });\n\n const workflow = await ctx.runBuildPhase(BuildPhase.PARSE_CUSTOM_WORKFLOW_CONFIG, async () => {\n try {\n return await parser.parseAsync();\n } catch (parseError: any) {\n ctx.logger.error('Failed to parse the job definition file.');\n if (parseError instanceof errors.BuildWorkflowError) {\n for (const err of parseError.errors) {\n ctx.logger.error({ err });\n }\n }\n throw parseError;\n }\n });\n\n const runResult = await asyncResult(workflow.executeAsync());\n\n return { runResult, buildWorkflow: workflow };\n}\n\nexport async function addEasWorkflows(customBuildCtx: CustomBuildContext): Promise<void> {\n await fs.promises.mkdir(path.join(customBuildCtx.projectSourceDirectory, '__eas'), {\n recursive: true,\n });\n\n await fs.promises.cp(\n path.join(__dirname, '..', 'resources', '__eas'),\n path.join(customBuildCtx.projectSourceDirectory, '__eas'),\n { recursive: true }\n );\n}\n"]}
1
+ {"version":3,"file":"generic.js","sourceRoot":"","sources":["../src/generic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EAAE,CACpB,CAAC;AACJ,CAAC;AAVD,0CAUC","sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport { BuildPhase, Generic } from '@expo/eas-build-job';\nimport {\n BuildConfigParser,\n BuildStepGlobalContext,\n BuildWorkflow,\n errors,\n StepsConfigParser,\n} from '@expo/steps';\nimport { Result, asyncResult } from '@expo/results';\n\nimport { BuildContext } from './context';\nimport { prepareProjectSourcesAsync } from './common/projectSources';\nimport { getEasFunctions } from './steps/easFunctions';\nimport { CustomBuildContext } from './customBuildContext';\nimport { getEasFunctionGroups } from './steps/easFunctionGroups';\nimport { uploadJobOutputsToWwwAsync } from './utils/outputs';\n\nexport async function runGenericJobAsync(\n ctx: BuildContext<Generic.Job>,\n { expoApiV2BaseUrl }: { expoApiV2BaseUrl: string }\n): Promise<{ runResult: Result<void>; buildWorkflow: BuildWorkflow }> {\n const customBuildCtx = new CustomBuildContext(ctx);\n\n await prepareProjectSourcesAsync(ctx, customBuildCtx.projectSourceDirectory);\n\n await addEasWorkflows(customBuildCtx);\n\n const globalContext = new BuildStepGlobalContext(customBuildCtx, false);\n\n const parser = ctx.job.steps\n ? new StepsConfigParser(globalContext, {\n externalFunctions: getEasFunctions(customBuildCtx),\n externalFunctionGroups: getEasFunctionGroups(customBuildCtx),\n steps: ctx.job.steps,\n })\n : new BuildConfigParser(globalContext, {\n externalFunctions: getEasFunctions(customBuildCtx),\n externalFunctionGroups: getEasFunctionGroups(customBuildCtx),\n configPath: path.join(\n customBuildCtx.projectSourceDirectory,\n ctx.job.customBuildConfig.path\n ),\n });\n\n const workflow = await ctx.runBuildPhase(BuildPhase.PARSE_CUSTOM_WORKFLOW_CONFIG, async () => {\n try {\n return await parser.parseAsync();\n } catch (parseError: any) {\n ctx.logger.error('Failed to parse the job definition file.');\n if (parseError instanceof errors.BuildWorkflowError) {\n for (const err of parseError.errors) {\n ctx.logger.error({ err });\n }\n }\n throw parseError;\n }\n });\n\n const runResult = await asyncResult(workflow.executeAsync());\n\n await ctx.runBuildPhase(BuildPhase.COMPLETE_JOB, async () => {\n await uploadJobOutputsToWwwAsync(ctx, {\n steps: workflow.buildSteps,\n logger: ctx.logger,\n expoApiV2BaseUrl,\n });\n });\n\n return { runResult, buildWorkflow: workflow };\n}\n\nexport async function addEasWorkflows(customBuildCtx: CustomBuildContext): Promise<void> {\n await fs.promises.mkdir(path.join(customBuildCtx.projectSourceDirectory, '__eas'), {\n recursive: true,\n });\n\n await fs.promises.cp(\n path.join(__dirname, '..', 'resources', '__eas'),\n path.join(customBuildCtx.projectSourceDirectory, '__eas'),\n { recursive: true }\n );\n}\n"]}
@@ -4,4 +4,4 @@ import { bunyan } from '@expo/logger';
4
4
  export declare function diffFingerprintsAsync(projectDir: string, fingerprint1File: string, fingerprint2File: string, { env, logger }: {
5
5
  env: BuildStepEnv;
6
6
  logger: bunyan;
7
- }): Promise<string>;
7
+ }): Promise<string | null>;
@@ -1,19 +1,14 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.diffFingerprintsAsync = void 0;
7
- const fs_extra_1 = __importDefault(require("fs-extra"));
8
4
  const expoFingerprintCli_1 = require("./expoFingerprintCli");
9
- const fingerprint_1 = require("./fingerprint");
10
5
  async function diffFingerprintsAsync(projectDir, fingerprint1File, fingerprint2File, { env, logger }) {
11
6
  if (!(await (0, expoFingerprintCli_1.isModernExpoFingerprintCLISupportedAsync)(projectDir))) {
12
- logger.debug('Falling back to local fingerprint diff');
13
- return await diffFingerprintsFallbackAsync(fingerprint1File, fingerprint2File);
7
+ logger.debug('Fingerprint diff not available');
8
+ return null;
14
9
  }
15
10
  try {
16
- return await diffFingerprintsCommandAsync(projectDir, fingerprint1File, fingerprint2File, {
11
+ return await (0, expoFingerprintCli_1.expoFingerprintCommandAsync)(projectDir, ['fingerprint:diff', fingerprint1File, fingerprint2File], {
17
12
  env,
18
13
  });
19
14
  }
@@ -21,23 +16,11 @@ async function diffFingerprintsAsync(projectDir, fingerprint1File, fingerprint2F
21
16
  if (e instanceof expoFingerprintCli_1.ExpoFingerprintCLIModuleNotFoundError ||
22
17
  e instanceof expoFingerprintCli_1.ExpoFingerprintCLICommandFailedError ||
23
18
  e instanceof expoFingerprintCli_1.ExpoFingerprintCLIInvalidCommandError) {
24
- logger.debug('Falling back to local fingerprint diff');
25
- return await diffFingerprintsFallbackAsync(fingerprint1File, fingerprint2File);
19
+ logger.debug('Fingerprint diff not available');
20
+ return null;
26
21
  }
27
22
  throw e;
28
23
  }
29
24
  }
30
25
  exports.diffFingerprintsAsync = diffFingerprintsAsync;
31
- async function diffFingerprintsCommandAsync(projectDir, fingerprint1File, fingerprint2File, { env }) {
32
- return await (0, expoFingerprintCli_1.expoFingerprintCommandAsync)(projectDir, ['fingerprint:diff', fingerprint1File, fingerprint2File], {
33
- env,
34
- });
35
- }
36
- async function diffFingerprintsFallbackAsync(fingerprint1File, fingerprint2File) {
37
- const [fingeprint1, fingerprint2] = await Promise.all([
38
- fs_extra_1.default.readJSON(fingerprint1File),
39
- fs_extra_1.default.readJSON(fingerprint2File),
40
- ]);
41
- return JSON.stringify((0, fingerprint_1.diffFingerprints)(fingeprint1, fingerprint2));
42
- }
43
26
  //# sourceMappingURL=diffFingerprintsAsync.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"diffFingerprintsAsync.js","sourceRoot":"","sources":["../../src/utils/diffFingerprintsAsync.ts"],"names":[],"mappings":";;;;;;AACA,wDAA0B;AAG1B,6DAM8B;AAC9B,+CAAiD;AAE1C,KAAK,UAAU,qBAAqB,CACzC,UAAkB,EAClB,gBAAwB,EACxB,gBAAwB,EACxB,EAAE,GAAG,EAAE,MAAM,EAAyC;IAEtD,IAAI,CAAC,CAAC,MAAM,IAAA,6DAAwC,EAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QAClE,MAAM,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;QACvD,OAAO,MAAM,6BAA6B,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;IACjF,CAAC;IAED,IAAI,CAAC;QACH,OAAO,MAAM,4BAA4B,CAAC,UAAU,EAAE,gBAAgB,EAAE,gBAAgB,EAAE;YACxF,GAAG;SACJ,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IACE,CAAC,YAAY,0DAAqC;YAClD,CAAC,YAAY,yDAAoC;YACjD,CAAC,YAAY,0DAAqC,EAClD,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;YACvD,OAAO,MAAM,6BAA6B,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;QACjF,CAAC;QACD,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC;AA1BD,sDA0BC;AAED,KAAK,UAAU,4BAA4B,CACzC,UAAkB,EAClB,gBAAwB,EACxB,gBAAwB,EACxB,EAAE,GAAG,EAAyB;IAE9B,OAAO,MAAM,IAAA,gDAA2B,EACtC,UAAU,EACV,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,EACxD;QACE,GAAG;KACJ,CACF,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,6BAA6B,CAC1C,gBAAwB,EACxB,gBAAwB;IAExB,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACpD,kBAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QAC7B,kBAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;KAC9B,CAAC,CAAC;IACH,OAAO,IAAI,CAAC,SAAS,CAAC,IAAA,8BAAgB,EAAC,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC;AACrE,CAAC","sourcesContent":["import { BuildStepEnv } from '@expo/steps';\nimport fs from 'fs-extra';\nimport { bunyan } from '@expo/logger';\n\nimport {\n ExpoFingerprintCLICommandFailedError,\n ExpoFingerprintCLIInvalidCommandError,\n ExpoFingerprintCLIModuleNotFoundError,\n expoFingerprintCommandAsync,\n isModernExpoFingerprintCLISupportedAsync,\n} from './expoFingerprintCli';\nimport { diffFingerprints } from './fingerprint';\n\nexport async function diffFingerprintsAsync(\n projectDir: string,\n fingerprint1File: string,\n fingerprint2File: string,\n { env, logger }: { env: BuildStepEnv; logger: bunyan }\n): Promise<string> {\n if (!(await isModernExpoFingerprintCLISupportedAsync(projectDir))) {\n logger.debug('Falling back to local fingerprint diff');\n return await diffFingerprintsFallbackAsync(fingerprint1File, fingerprint2File);\n }\n\n try {\n return await diffFingerprintsCommandAsync(projectDir, fingerprint1File, fingerprint2File, {\n env,\n });\n } catch (e) {\n if (\n e instanceof ExpoFingerprintCLIModuleNotFoundError ||\n e instanceof ExpoFingerprintCLICommandFailedError ||\n e instanceof ExpoFingerprintCLIInvalidCommandError\n ) {\n logger.debug('Falling back to local fingerprint diff');\n return await diffFingerprintsFallbackAsync(fingerprint1File, fingerprint2File);\n }\n throw e;\n }\n}\n\nasync function diffFingerprintsCommandAsync(\n projectDir: string,\n fingerprint1File: string,\n fingerprint2File: string,\n { env }: { env: BuildStepEnv }\n): Promise<string> {\n return await expoFingerprintCommandAsync(\n projectDir,\n ['fingerprint:diff', fingerprint1File, fingerprint2File],\n {\n env,\n }\n );\n}\n\nasync function diffFingerprintsFallbackAsync(\n fingerprint1File: string,\n fingerprint2File: string\n): Promise<string> {\n const [fingeprint1, fingerprint2] = await Promise.all([\n fs.readJSON(fingerprint1File),\n fs.readJSON(fingerprint2File),\n ]);\n return JSON.stringify(diffFingerprints(fingeprint1, fingerprint2));\n}\n"]}
1
+ {"version":3,"file":"diffFingerprintsAsync.js","sourceRoot":"","sources":["../../src/utils/diffFingerprintsAsync.ts"],"names":[],"mappings":";;;AAGA,6DAM8B;AAEvB,KAAK,UAAU,qBAAqB,CACzC,UAAkB,EAClB,gBAAwB,EACxB,gBAAwB,EACxB,EAAE,GAAG,EAAE,MAAM,EAAyC;IAEtD,IAAI,CAAC,CAAC,MAAM,IAAA,6DAAwC,EAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QAClE,MAAM,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,OAAO,MAAM,IAAA,gDAA2B,EACtC,UAAU,EACV,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,EACxD;YACE,GAAG;SACJ,CACF,CAAC;IACJ,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IACE,CAAC,YAAY,0DAAqC;YAClD,CAAC,YAAY,yDAAoC;YACjD,CAAC,YAAY,0DAAqC,EAClD,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;YAC/C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC;AA9BD,sDA8BC","sourcesContent":["import { BuildStepEnv } from '@expo/steps';\nimport { bunyan } from '@expo/logger';\n\nimport {\n ExpoFingerprintCLICommandFailedError,\n ExpoFingerprintCLIInvalidCommandError,\n ExpoFingerprintCLIModuleNotFoundError,\n expoFingerprintCommandAsync,\n isModernExpoFingerprintCLISupportedAsync,\n} from './expoFingerprintCli';\n\nexport async function diffFingerprintsAsync(\n projectDir: string,\n fingerprint1File: string,\n fingerprint2File: string,\n { env, logger }: { env: BuildStepEnv; logger: bunyan }\n): Promise<string | null> {\n if (!(await isModernExpoFingerprintCLISupportedAsync(projectDir))) {\n logger.debug('Fingerprint diff not available');\n return null;\n }\n\n try {\n return await expoFingerprintCommandAsync(\n projectDir,\n ['fingerprint:diff', fingerprint1File, fingerprint2File],\n {\n env,\n }\n );\n } catch (e) {\n if (\n e instanceof ExpoFingerprintCLIModuleNotFoundError ||\n e instanceof ExpoFingerprintCLICommandFailedError ||\n e instanceof ExpoFingerprintCLIInvalidCommandError\n ) {\n logger.debug('Fingerprint diff not available');\n return null;\n }\n throw e;\n }\n}\n"]}
@@ -210,10 +210,12 @@ async function logDiffFingerprints({ resolvedRuntime, ctx, }) {
210
210
  const easFingerprintFile = path_1.default.join(os_1.default.tmpdir(), `eas-build-${(0, uuid_1.v4)()}-eas-fingerprint`);
211
211
  await fs_extra_1.default.writeFile(easFingerprintFile, JSON.stringify(easFingerprint));
212
212
  const changesJSONString = await (0, diffFingerprintsAsync_1.diffFingerprintsAsync)(ctx.getReactNativeProjectDirectory(), localFingerprintFile, easFingerprintFile, { env: ctx.env, logger: ctx.logger });
213
- const changes = JSON.parse(changesJSONString);
214
- if (changes.length) {
215
- ctx.logger.warn('Difference between local and EAS fingerprints:');
216
- ctx.logger.warn((0, fingerprint_1.stringifyFingerprintDiff)(changes));
213
+ if (changesJSONString) {
214
+ const changes = JSON.parse(changesJSONString);
215
+ if (changes.length) {
216
+ ctx.logger.warn('Difference between local and EAS fingerprints:');
217
+ ctx.logger.warn((0, fingerprint_1.stringifyFingerprintDiff)(changes));
218
+ }
217
219
  }
218
220
  }
219
221
  }
@@ -1 +1 @@
1
- {"version":3,"file":"expoUpdates.js","sourceRoot":"","sources":["../../src/utils/expoUpdates.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,4CAAoB;AACpB,gDAAwB;AAExB,+BAAoC;AACpC,uDAA+F;AAC/F,oDAA4B;AAI5B,4DAA+B;AAC/B,wDAA0B;AAE1B,wDAKgC;AAChC,oDAK4B;AAG5B,kIAA0G;AAC1G,6EAA0E;AAC1E,mEAAgE;AAChE,+CAAyD;AAElD,KAAK,UAAU,8BAA8B,CAClD,GAAsB,EACtB,cAAsB;IAEtB,QAAQ,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QACzB,KAAK,wBAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;YACtB,MAAM,IAAA,mDAAqC,EAAC,GAAG,EAAE,cAAc,CAAC,CAAC;YACjE,OAAO;QACT,CAAC;QACD,KAAK,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,MAAM,EAAE,CACrC,CAAC;gBACF,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;gBAC9C,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;oBACnB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;oBAClE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAA,sCAAwB,EAAC,OAAO,CAAC,CAAC,CAAC;gBACrD,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import assert from 'assert';\nimport os from 'os';\nimport path from 'path';\n\nimport { v4 as uuidv4 } from 'uuid';\nimport { Platform, Job, BuildJob, Workflow, FingerprintSourceType } from '@expo/eas-build-job';\nimport semver from 'semver';\nimport { ExpoConfig } from '@expo/config';\nimport { bunyan } from '@expo/logger';\nimport { BuildStepEnv } from '@expo/steps';\nimport fetch from 'node-fetch';\nimport fs from 'fs-extra';\n\nimport {\n androidSetRuntimeVersionNativelyAsync,\n androidSetChannelNativelyAsync,\n androidGetNativelyDefinedRuntimeVersionAsync,\n androidGetNativelyDefinedChannelAsync,\n} from '../android/expoUpdates';\nimport {\n iosSetRuntimeVersionNativelyAsync,\n iosSetChannelNativelyAsync,\n iosGetNativelyDefinedRuntimeVersionAsync,\n iosGetNativelyDefinedChannelAsync,\n} from '../ios/expoUpdates';\nimport { BuildContext } from '../context';\n\nimport getExpoUpdatesPackageVersionIfInstalledAsync from './getExpoUpdatesPackageVersionIfInstalledAsync';\nimport { resolveRuntimeVersionAsync } from './resolveRuntimeVersionAsync';\nimport { diffFingerprintsAsync } from './diffFingerprintsAsync';\nimport { stringifyFingerprintDiff } from './fingerprint';\n\nexport async function setRuntimeVersionNativelyAsync(\n ctx: BuildContext<Job>,\n runtimeVersion: string\n): Promise<void> {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n await androidSetRuntimeVersionNativelyAsync(ctx, runtimeVersion);\n return;\n }\n case Platform.IOS: {\n await iosSetRuntimeVersionNativelyAsync(ctx, runtimeVersion);\n return;\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\n/**\n * Used for when Expo Updates is pointed at an EAS server.\n */\nexport async function setChannelNativelyAsync(ctx: BuildContext<BuildJob>): Promise<void> {\n assert(ctx.job.updates?.channel, 'updates.channel must be defined');\n const newUpdateRequestHeaders: Record<string, string> = {\n 'expo-channel-name': ctx.job.updates.channel,\n };\n\n const configFile = ctx.job.platform === Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';\n ctx.logger.info(\n `Setting the update request headers in '${configFile}' to '${JSON.stringify(\n newUpdateRequestHeaders\n )}'`\n );\n\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n await androidSetChannelNativelyAsync(ctx);\n return;\n }\n case Platform.IOS: {\n await iosSetChannelNativelyAsync(ctx);\n return;\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\nexport async function configureEASExpoUpdatesAsync(ctx: BuildContext<BuildJob>): Promise<void> {\n await setChannelNativelyAsync(ctx);\n}\n\ntype ResolvedRuntime = {\n resolvedRuntimeVersion: string | null;\n resolvedFingerprintSources?: object[] | null;\n};\n\nexport async function configureExpoUpdatesIfInstalledAsync(\n ctx: BuildContext<BuildJob>,\n resolvedRuntime: ResolvedRuntime\n): Promise<void> {\n const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(\n ctx.getReactNativeProjectDirectory(),\n ctx.logger\n );\n if (expoUpdatesPackageVersion === null) {\n return;\n }\n\n const appConfigRuntimeVersion =\n ctx.job.version?.runtimeVersion ?? resolvedRuntime.resolvedRuntimeVersion;\n\n if (ctx.metadata?.runtimeVersion && ctx.metadata.runtimeVersion !== appConfigRuntimeVersion) {\n ctx.logger.warn(\n `\nRuntime version mismatch:\n- Runtime version calculated on local machine: ${ctx.metadata.runtimeVersion}\n- Runtime version calculated on EAS: ${appConfigRuntimeVersion}\n\nThis may be due to one or more factors:\n- Differing result of conditional app config (app.config.js) evaluation for runtime version resolution.\n- Differing fingerprint when using fingerprint runtime version policy. If applicable, see fingerprint diff below.\n\nThis would cause any updates published on the local machine to not be compatible with this build.\n`\n );\n await logDiffFingerprints({ resolvedRuntime, ctx });\n throw new Error(\n 'Runtime version calculated on local machine not equal to runtime version calculated during build.'\n );\n }\n\n if (isEASUpdateConfigured(ctx)) {\n if (ctx.job.updates?.channel !== undefined) {\n await configureEASExpoUpdatesAsync(ctx);\n } else {\n const channel = await getChannelAsync(ctx);\n const isDevelopmentClient = ctx.job.developmentClient ?? false;\n\n if (channel !== null) {\n const configFile =\n ctx.job.platform === Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';\n ctx.logger.info(`The channel name for EAS Update in ${configFile} is set to \"${channel}\"`);\n } else if (isDevelopmentClient) {\n // NO-OP: Development clients don't need to have a channel set\n } else {\n const easUpdateUrl = ctx.appConfig.updates?.url ?? null;\n const jobProfile = ctx.job.buildProfile ?? null;\n ctx.logger.warn(\n `This build has an invalid EAS Update configuration: update.url is set to \"${easUpdateUrl}\" in app config, but a channel is not specified${\n jobProfile ? '' : ` for the current build profile \"${jobProfile}\" in eas.json`\n }.`\n );\n ctx.logger.warn(`- No channel will be set and EAS Update will be disabled for the build.`);\n ctx.logger.warn(\n `- Run \\`eas update:configure\\` to set your channel in eas.json. For more details, see https://docs.expo.dev/eas-update/getting-started/#configure-your-project`\n );\n\n ctx.markBuildPhaseHasWarnings();\n }\n }\n }\n\n if (ctx.job.version?.runtimeVersion) {\n ctx.logger.info('Updating runtimeVersion in Expo.plist');\n await setRuntimeVersionNativelyAsync(ctx, ctx.job.version.runtimeVersion);\n }\n}\n\nexport async function resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({\n cwd,\n appConfig,\n platform,\n workflow,\n logger,\n env,\n}: {\n cwd: string;\n appConfig: ExpoConfig;\n platform: Platform;\n workflow: Workflow;\n logger: bunyan;\n env: BuildStepEnv;\n}): Promise<{\n runtimeVersion: string | null;\n fingerprintSources: object[] | null;\n} | null> {\n const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(cwd, logger);\n if (expoUpdatesPackageVersion === null) {\n return null;\n }\n\n const resolvedRuntimeVersion = await resolveRuntimeVersionAsync({\n projectDir: cwd,\n exp: appConfig,\n platform,\n workflow,\n logger,\n expoUpdatesPackageVersion,\n env,\n });\n\n logger.info(`Resolved runtime version: ${resolvedRuntimeVersion?.runtimeVersion}`);\n return resolvedRuntimeVersion;\n}\n\nexport async function getChannelAsync(ctx: BuildContext<Job>): Promise<string | null> {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n return await androidGetNativelyDefinedChannelAsync(ctx);\n }\n case Platform.IOS: {\n return await iosGetNativelyDefinedChannelAsync(ctx);\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\nexport async function getRuntimeVersionAsync(ctx: BuildContext<Job>): Promise<string | null> {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n return await androidGetNativelyDefinedRuntimeVersionAsync(ctx);\n }\n case Platform.IOS: {\n return await iosGetNativelyDefinedRuntimeVersionAsync(ctx);\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\nexport function isEASUpdateConfigured(ctx: BuildContext<Job>): boolean {\n const rawUrl = ctx.appConfig.updates?.url;\n if (!rawUrl) {\n return false;\n }\n try {\n const url = new URL(rawUrl);\n return ['u.expo.dev', 'staging-u.expo.dev'].includes(url.hostname);\n } catch (err) {\n ctx.logger.error({ err }, `Cannot parse expo.updates.url = ${rawUrl} as URL`);\n ctx.logger.error(`Assuming EAS Update is not configured`);\n return false;\n }\n}\n\nexport function isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported(\n expoUpdatesPackageVersion: string\n): boolean {\n if (expoUpdatesPackageVersion.includes('canary')) {\n return true;\n }\n\n // Anything SDK 51 or greater uses the expo-updates CLI\n return semver.gte(expoUpdatesPackageVersion, '0.25.4');\n}\n\nasync function logDiffFingerprints({\n resolvedRuntime,\n ctx,\n}: {\n resolvedRuntime: ResolvedRuntime;\n ctx: BuildContext<BuildJob>;\n}): Promise<void> {\n const { resolvedRuntimeVersion, resolvedFingerprintSources } = resolvedRuntime;\n if (ctx.metadata?.fingerprintSource && resolvedFingerprintSources && resolvedRuntimeVersion) {\n try {\n const fingerprintSource = ctx.metadata.fingerprintSource;\n\n let localFingerprintFile: string | null = null;\n\n if (fingerprintSource.type === FingerprintSourceType.URL) {\n const result = await fetch(fingerprintSource.url);\n const localFingerprintJSON = await result.json();\n localFingerprintFile = path.join(os.tmpdir(), `eas-build-${uuidv4()}-local-fingerprint`);\n await fs.writeFile(localFingerprintFile, JSON.stringify(localFingerprintJSON));\n } else if (fingerprintSource.type === FingerprintSourceType.PATH) {\n localFingerprintFile = fingerprintSource.path;\n } else {\n ctx.logger.warn(`Invalid fingerprint source type: ${fingerprintSource.type}`);\n }\n\n if (localFingerprintFile) {\n const easFingerprint = {\n hash: resolvedRuntimeVersion,\n sources: resolvedFingerprintSources,\n };\n const easFingerprintFile = path.join(os.tmpdir(), `eas-build-${uuidv4()}-eas-fingerprint`);\n await fs.writeFile(easFingerprintFile, JSON.stringify(easFingerprint));\n\n const changesJSONString = await diffFingerprintsAsync(\n ctx.getReactNativeProjectDirectory(),\n localFingerprintFile,\n easFingerprintFile,\n { env: ctx.env, logger: ctx.logger }\n );\n const changes = JSON.parse(changesJSONString);\n if (changes.length) {\n ctx.logger.warn('Difference between local and EAS fingerprints:');\n ctx.logger.warn(stringifyFingerprintDiff(changes));\n }\n }\n } catch (error) {\n ctx.logger.warn('Failed to compare fingerprints', error);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"expoUpdates.js","sourceRoot":"","sources":["../../src/utils/expoUpdates.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,4CAAoB;AAC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EAAE,0BAA0B;iBACpC,CAAC;gBACF,MAAM,kBAAkB,GAAG,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,MAAM,EAAE,EAAE,aAAa,IAAA,SAAM,GAAE,kBAAkB,CAAC,CAAC;gBAC3F,MAAM,kBAAE,CAAC,SAAS,CAAC,kBAAkB,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;gBAEvE,MAAM,iBAAiB,GAAG,MAAM,IAAA,6CAAqB,EACnD,GAAG,CAAC,8BAA8B,EAAE,EACpC,oBAAoB,EACpB,kBAAkB,EAClB,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CACrC,CAAC;gBACF,IAAI,iBAAiB,EAAE,CAAC;oBACtB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;oBAC9C,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;wBACnB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;wBAClE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAA,sCAAwB,EAAC,OAAO,CAAC,CAAC,CAAC;oBACrD,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import assert from 'assert';\nimport os from 'os';\nimport path from 'path';\n\nimport { v4 as uuidv4 } from 'uuid';\nimport { Platform, Job, BuildJob, Workflow, FingerprintSourceType } from '@expo/eas-build-job';\nimport semver from 'semver';\nimport { ExpoConfig } from '@expo/config';\nimport { bunyan } from '@expo/logger';\nimport { BuildStepEnv } from '@expo/steps';\nimport fetch from 'node-fetch';\nimport fs from 'fs-extra';\n\nimport {\n androidSetRuntimeVersionNativelyAsync,\n androidSetChannelNativelyAsync,\n androidGetNativelyDefinedRuntimeVersionAsync,\n androidGetNativelyDefinedChannelAsync,\n} from '../android/expoUpdates';\nimport {\n iosSetRuntimeVersionNativelyAsync,\n iosSetChannelNativelyAsync,\n iosGetNativelyDefinedRuntimeVersionAsync,\n iosGetNativelyDefinedChannelAsync,\n} from '../ios/expoUpdates';\nimport { BuildContext } from '../context';\n\nimport getExpoUpdatesPackageVersionIfInstalledAsync from './getExpoUpdatesPackageVersionIfInstalledAsync';\nimport { resolveRuntimeVersionAsync } from './resolveRuntimeVersionAsync';\nimport { diffFingerprintsAsync } from './diffFingerprintsAsync';\nimport { stringifyFingerprintDiff } from './fingerprint';\n\nexport async function setRuntimeVersionNativelyAsync(\n ctx: BuildContext<Job>,\n runtimeVersion: string\n): Promise<void> {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n await androidSetRuntimeVersionNativelyAsync(ctx, runtimeVersion);\n return;\n }\n case Platform.IOS: {\n await iosSetRuntimeVersionNativelyAsync(ctx, runtimeVersion);\n return;\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\n/**\n * Used for when Expo Updates is pointed at an EAS server.\n */\nexport async function setChannelNativelyAsync(ctx: BuildContext<BuildJob>): Promise<void> {\n assert(ctx.job.updates?.channel, 'updates.channel must be defined');\n const newUpdateRequestHeaders: Record<string, string> = {\n 'expo-channel-name': ctx.job.updates.channel,\n };\n\n const configFile = ctx.job.platform === Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';\n ctx.logger.info(\n `Setting the update request headers in '${configFile}' to '${JSON.stringify(\n newUpdateRequestHeaders\n )}'`\n );\n\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n await androidSetChannelNativelyAsync(ctx);\n return;\n }\n case Platform.IOS: {\n await iosSetChannelNativelyAsync(ctx);\n return;\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\nexport async function configureEASExpoUpdatesAsync(ctx: BuildContext<BuildJob>): Promise<void> {\n await setChannelNativelyAsync(ctx);\n}\n\ntype ResolvedRuntime = {\n resolvedRuntimeVersion: string | null;\n resolvedFingerprintSources?: object[] | null;\n};\n\nexport async function configureExpoUpdatesIfInstalledAsync(\n ctx: BuildContext<BuildJob>,\n resolvedRuntime: ResolvedRuntime\n): Promise<void> {\n const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(\n ctx.getReactNativeProjectDirectory(),\n ctx.logger\n );\n if (expoUpdatesPackageVersion === null) {\n return;\n }\n\n const appConfigRuntimeVersion =\n ctx.job.version?.runtimeVersion ?? resolvedRuntime.resolvedRuntimeVersion;\n\n if (ctx.metadata?.runtimeVersion && ctx.metadata.runtimeVersion !== appConfigRuntimeVersion) {\n ctx.logger.warn(\n `\nRuntime version mismatch:\n- Runtime version calculated on local machine: ${ctx.metadata.runtimeVersion}\n- Runtime version calculated on EAS: ${appConfigRuntimeVersion}\n\nThis may be due to one or more factors:\n- Differing result of conditional app config (app.config.js) evaluation for runtime version resolution.\n- Differing fingerprint when using fingerprint runtime version policy. If applicable, see fingerprint diff below.\n\nThis would cause any updates published on the local machine to not be compatible with this build.\n`\n );\n await logDiffFingerprints({ resolvedRuntime, ctx });\n throw new Error(\n 'Runtime version calculated on local machine not equal to runtime version calculated during build.'\n );\n }\n\n if (isEASUpdateConfigured(ctx)) {\n if (ctx.job.updates?.channel !== undefined) {\n await configureEASExpoUpdatesAsync(ctx);\n } else {\n const channel = await getChannelAsync(ctx);\n const isDevelopmentClient = ctx.job.developmentClient ?? false;\n\n if (channel !== null) {\n const configFile =\n ctx.job.platform === Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';\n ctx.logger.info(`The channel name for EAS Update in ${configFile} is set to \"${channel}\"`);\n } else if (isDevelopmentClient) {\n // NO-OP: Development clients don't need to have a channel set\n } else {\n const easUpdateUrl = ctx.appConfig.updates?.url ?? null;\n const jobProfile = ctx.job.buildProfile ?? null;\n ctx.logger.warn(\n `This build has an invalid EAS Update configuration: update.url is set to \"${easUpdateUrl}\" in app config, but a channel is not specified${\n jobProfile ? '' : ` for the current build profile \"${jobProfile}\" in eas.json`\n }.`\n );\n ctx.logger.warn(`- No channel will be set and EAS Update will be disabled for the build.`);\n ctx.logger.warn(\n `- Run \\`eas update:configure\\` to set your channel in eas.json. For more details, see https://docs.expo.dev/eas-update/getting-started/#configure-your-project`\n );\n\n ctx.markBuildPhaseHasWarnings();\n }\n }\n }\n\n if (ctx.job.version?.runtimeVersion) {\n ctx.logger.info('Updating runtimeVersion in Expo.plist');\n await setRuntimeVersionNativelyAsync(ctx, ctx.job.version.runtimeVersion);\n }\n}\n\nexport async function resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({\n cwd,\n appConfig,\n platform,\n workflow,\n logger,\n env,\n}: {\n cwd: string;\n appConfig: ExpoConfig;\n platform: Platform;\n workflow: Workflow;\n logger: bunyan;\n env: BuildStepEnv;\n}): Promise<{\n runtimeVersion: string | null;\n fingerprintSources: object[] | null;\n} | null> {\n const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(cwd, logger);\n if (expoUpdatesPackageVersion === null) {\n return null;\n }\n\n const resolvedRuntimeVersion = await resolveRuntimeVersionAsync({\n projectDir: cwd,\n exp: appConfig,\n platform,\n workflow,\n logger,\n expoUpdatesPackageVersion,\n env,\n });\n\n logger.info(`Resolved runtime version: ${resolvedRuntimeVersion?.runtimeVersion}`);\n return resolvedRuntimeVersion;\n}\n\nexport async function getChannelAsync(ctx: BuildContext<Job>): Promise<string | null> {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n return await androidGetNativelyDefinedChannelAsync(ctx);\n }\n case Platform.IOS: {\n return await iosGetNativelyDefinedChannelAsync(ctx);\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\nexport async function getRuntimeVersionAsync(ctx: BuildContext<Job>): Promise<string | null> {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n return await androidGetNativelyDefinedRuntimeVersionAsync(ctx);\n }\n case Platform.IOS: {\n return await iosGetNativelyDefinedRuntimeVersionAsync(ctx);\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\nexport function isEASUpdateConfigured(ctx: BuildContext<Job>): boolean {\n const rawUrl = ctx.appConfig.updates?.url;\n if (!rawUrl) {\n return false;\n }\n try {\n const url = new URL(rawUrl);\n return ['u.expo.dev', 'staging-u.expo.dev'].includes(url.hostname);\n } catch (err) {\n ctx.logger.error({ err }, `Cannot parse expo.updates.url = ${rawUrl} as URL`);\n ctx.logger.error(`Assuming EAS Update is not configured`);\n return false;\n }\n}\n\nexport function isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported(\n expoUpdatesPackageVersion: string\n): boolean {\n if (expoUpdatesPackageVersion.includes('canary')) {\n return true;\n }\n\n // Anything SDK 51 or greater uses the expo-updates CLI\n return semver.gte(expoUpdatesPackageVersion, '0.25.4');\n}\n\nasync function logDiffFingerprints({\n resolvedRuntime,\n ctx,\n}: {\n resolvedRuntime: ResolvedRuntime;\n ctx: BuildContext<BuildJob>;\n}): Promise<void> {\n const { resolvedRuntimeVersion, resolvedFingerprintSources } = resolvedRuntime;\n if (ctx.metadata?.fingerprintSource && resolvedFingerprintSources && resolvedRuntimeVersion) {\n try {\n const fingerprintSource = ctx.metadata.fingerprintSource;\n\n let localFingerprintFile: string | null = null;\n\n if (fingerprintSource.type === FingerprintSourceType.URL) {\n const result = await fetch(fingerprintSource.url);\n const localFingerprintJSON = await result.json();\n localFingerprintFile = path.join(os.tmpdir(), `eas-build-${uuidv4()}-local-fingerprint`);\n await fs.writeFile(localFingerprintFile, JSON.stringify(localFingerprintJSON));\n } else if (fingerprintSource.type === FingerprintSourceType.PATH) {\n localFingerprintFile = fingerprintSource.path;\n } else {\n ctx.logger.warn(`Invalid fingerprint source type: ${fingerprintSource.type}`);\n }\n\n if (localFingerprintFile) {\n const easFingerprint = {\n hash: resolvedRuntimeVersion,\n sources: resolvedFingerprintSources,\n };\n const easFingerprintFile = path.join(os.tmpdir(), `eas-build-${uuidv4()}-eas-fingerprint`);\n await fs.writeFile(easFingerprintFile, JSON.stringify(easFingerprint));\n\n const changesJSONString = await diffFingerprintsAsync(\n ctx.getReactNativeProjectDirectory(),\n localFingerprintFile,\n easFingerprintFile,\n { env: ctx.env, logger: ctx.logger }\n );\n if (changesJSONString) {\n const changes = JSON.parse(changesJSONString);\n if (changes.length) {\n ctx.logger.warn('Difference between local and EAS fingerprints:');\n ctx.logger.warn(stringifyFingerprintDiff(changes));\n }\n }\n }\n } catch (error) {\n ctx.logger.warn('Failed to compare fingerprints', error);\n }\n }\n}\n"]}
@@ -1,109 +1 @@
1
- /**
2
- * DO NOT EDIT unless the same change is made in `@expo/fingerprint`
3
- * The diffFingerprints function is a copy/paste from that package.
4
- */
5
- /// <reference types="node" />
6
- export type FingerprintSource = HashSource & {
7
- /**
8
- * Hash value of the `source`.
9
- * If the source is excluding by `Options.dirExcludes`, the value will be null.
10
- */
11
- hash: string | null;
12
- /**
13
- * Debug info from the hashing process. Differs based on source type. Designed to be consumed by humans
14
- * as opposed to programmatically.
15
- */
16
- debugInfo?: DebugInfo;
17
- };
18
- export interface Fingerprint {
19
- /**
20
- * Sources and their hash values to generate a fingerprint
21
- */
22
- sources: FingerprintSource[];
23
- /**
24
- * The final hash value of the whole fingerprint
25
- */
26
- hash: string;
27
- }
28
- export interface HashSourceFile {
29
- type: 'file';
30
- filePath: string;
31
- /**
32
- * Reasons of this source coming from
33
- */
34
- reasons: string[];
35
- }
36
- export interface HashSourceDir {
37
- type: 'dir';
38
- filePath: string;
39
- /**
40
- * Reasons of this source coming from
41
- */
42
- reasons: string[];
43
- }
44
- export interface HashSourceContents {
45
- type: 'contents';
46
- id: string;
47
- contents: string | Buffer;
48
- /**
49
- * Reasons of this source coming from
50
- */
51
- reasons: string[];
52
- }
53
- export type HashSource = HashSourceFile | HashSourceDir | HashSourceContents;
54
- export interface DebugInfoFile {
55
- path: string;
56
- hash: string;
57
- }
58
- export interface DebugInfoDir {
59
- path: string;
60
- hash: string;
61
- children: (DebugInfoFile | DebugInfoDir | undefined)[];
62
- }
63
- export interface DebugInfoContents {
64
- hash: string;
65
- }
66
- export type DebugInfo = DebugInfoFile | DebugInfoDir | DebugInfoContents;
67
- export type FingerprintDiffItem = {
68
- /**
69
- * The operation type of the diff item.
70
- */
71
- op: 'added';
72
- /**
73
- * The added source.
74
- */
75
- addedSource: FingerprintSource;
76
- } | {
77
- /**
78
- * The operation type of the diff item.
79
- */
80
- op: 'removed';
81
- /**
82
- * The removed source.
83
- */
84
- removedSource: FingerprintSource;
85
- } | {
86
- /**
87
- * The operation type of the diff item.
88
- */
89
- op: 'changed';
90
- /**
91
- * The source before.
92
- */
93
- beforeSource: FingerprintSource;
94
- /**
95
- * The source after.
96
- */
97
- afterSource: FingerprintSource;
98
- };
99
- /**
100
- * Comparator between two sources.
101
- * This is useful for sorting sources in a consistent order.
102
- * @returns:
103
- * == 0 if a and b are equal,
104
- * < 0 if a is less than b,
105
- * > 0 if a is greater than b.
106
- */
107
- export declare function compareSource(a: HashSource, b: HashSource): number;
108
- export declare function diffFingerprints(fingerprint1: Fingerprint, fingerprint2: Fingerprint): FingerprintDiffItem[];
109
- export declare function stringifyFingerprintDiff(fingerprintDiff: FingerprintDiffItem[]): string;
1
+ export declare function stringifyFingerprintDiff(fingerprintDiff: object[]): string;
@@ -1,74 +1,6 @@
1
1
  "use strict";
2
- /**
3
- * DO NOT EDIT unless the same change is made in `@expo/fingerprint`
4
- * The diffFingerprints function is a copy/paste from that package.
5
- */
6
2
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.stringifyFingerprintDiff = exports.diffFingerprints = exports.compareSource = void 0;
8
- const typeOrder = {
9
- file: 0,
10
- dir: 1,
11
- contents: 2,
12
- };
13
- /**
14
- * Comparator between two sources.
15
- * This is useful for sorting sources in a consistent order.
16
- * @returns:
17
- * == 0 if a and b are equal,
18
- * < 0 if a is less than b,
19
- * > 0 if a is greater than b.
20
- */
21
- function compareSource(a, b) {
22
- const typeResult = typeOrder[a.type] - typeOrder[b.type];
23
- if (typeResult === 0) {
24
- if (a.type === 'file' && b.type === 'file') {
25
- return a.filePath.localeCompare(b.filePath);
26
- }
27
- else if (a.type === 'dir' && b.type === 'dir') {
28
- return a.filePath.localeCompare(b.filePath);
29
- }
30
- else if (a.type === 'contents' && b.type === 'contents') {
31
- return a.id.localeCompare(b.id);
32
- }
33
- }
34
- return typeResult;
35
- }
36
- exports.compareSource = compareSource;
37
- function diffFingerprints(fingerprint1, fingerprint2) {
38
- let index1 = 0;
39
- let index2 = 0;
40
- const diff = [];
41
- while (index1 < fingerprint1.sources.length && index2 < fingerprint2.sources.length) {
42
- const source1 = fingerprint1.sources[index1];
43
- const source2 = fingerprint2.sources[index2];
44
- const compareResult = compareSource(source1, source2);
45
- if (compareResult === 0) {
46
- if (source1.hash !== source2.hash) {
47
- diff.push({ op: 'changed', beforeSource: source1, afterSource: source2 });
48
- }
49
- ++index1;
50
- ++index2;
51
- }
52
- else if (compareResult < 0) {
53
- diff.push({ op: 'removed', removedSource: source1 });
54
- ++index1;
55
- }
56
- else {
57
- diff.push({ op: 'added', addedSource: source2 });
58
- ++index2;
59
- }
60
- }
61
- while (index1 < fingerprint1.sources.length) {
62
- diff.push({ op: 'removed', removedSource: fingerprint1.sources[index1] });
63
- ++index1;
64
- }
65
- while (index2 < fingerprint2.sources.length) {
66
- diff.push({ op: 'added', addedSource: fingerprint2.sources[index2] });
67
- ++index2;
68
- }
69
- return diff;
70
- }
71
- exports.diffFingerprints = diffFingerprints;
3
+ exports.stringifyFingerprintDiff = void 0;
72
4
  function stringifyFingerprintDiff(fingerprintDiff) {
73
5
  return JSON.stringify(fingerprintDiff, (key, value) => {
74
6
  if (key === 'contents') {
@@ -1 +1 @@
1
- {"version":3,"file":"fingerprint.js","sourceRoot":"","sources":["../../src/utils/fingerprint.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiHH,MAAM,SAAS,GAAG;IAChB,IAAI,EA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AAC;AACd,CAAC;AAtCD,4CAsCC;AAED,SAAgB,wBAAwB,CAAC,eAAsC;IAC7E,OAAO,IAAI,CAAC,SAAS,CACnB,eAAe,EACf,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QACb,IAAI,GAAG,KAAK,UAAU,EAAE,CAAC;YACvB,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBAC/B,OAAO,IAAI,CAAC;YACd,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,EACD,GAAG,CACJ,CAAC;AACJ,CAAC;AAhBD,4DAgBC","sourcesContent":["/**\n * DO NOT EDIT unless the same change is made in `@expo/fingerprint`\n * The diffFingerprints function is a copy/paste from that package.\n */\n\nexport type FingerprintSource = HashSource & {\n /**\n * Hash value of the `source`.\n * If the source is excluding by `Options.dirExcludes`, the value will be null.\n */\n hash: string | null;\n /**\n * Debug info from the hashing process. Differs based on source type. Designed to be consumed by humans\n * as opposed to programmatically.\n */\n debugInfo?: DebugInfo;\n};\n\nexport interface Fingerprint {\n /**\n * Sources and their hash values to generate a fingerprint\n */\n sources: FingerprintSource[];\n\n /**\n * The final hash value of the whole fingerprint\n */\n hash: string;\n}\n\nexport interface HashSourceFile {\n type: 'file';\n filePath: string;\n\n /**\n * Reasons of this source coming from\n */\n reasons: string[];\n}\n\nexport interface HashSourceDir {\n type: 'dir';\n filePath: string;\n\n /**\n * Reasons of this source coming from\n */\n reasons: string[];\n}\n\nexport interface HashSourceContents {\n type: 'contents';\n id: string;\n contents: string | Buffer;\n\n /**\n * Reasons of this source coming from\n */\n reasons: string[];\n}\n\nexport type HashSource = HashSourceFile | HashSourceDir | HashSourceContents;\n\nexport interface DebugInfoFile {\n path: string;\n hash: string;\n}\n\nexport interface DebugInfoDir {\n path: string;\n hash: string;\n children: (DebugInfoFile | DebugInfoDir | undefined)[];\n}\n\nexport interface DebugInfoContents {\n hash: string;\n}\n\nexport type DebugInfo = DebugInfoFile | DebugInfoDir | DebugInfoContents;\n\nexport type FingerprintDiffItem =\n | {\n /**\n * The operation type of the diff item.\n */\n op: 'added';\n /**\n * The added source.\n */\n addedSource: FingerprintSource;\n }\n | {\n /**\n * The operation type of the diff item.\n */\n op: 'removed';\n /**\n * The removed source.\n */\n removedSource: FingerprintSource;\n }\n | {\n /**\n * The operation type of the diff item.\n */\n op: 'changed';\n /**\n * The source before.\n */\n beforeSource: FingerprintSource;\n /**\n * The source after.\n */\n afterSource: FingerprintSource;\n };\n\nconst typeOrder = {\n file: 0,\n dir: 1,\n contents: 2,\n};\n\n/**\n * Comparator between two sources.\n * This is useful for sorting sources in a consistent order.\n * @returns:\n * == 0 if a and b are equal,\n * < 0 if a is less than b,\n * > 0 if a is greater than b.\n */\nexport function compareSource(a: HashSource, b: HashSource): number {\n const typeResult = typeOrder[a.type] - typeOrder[b.type];\n if (typeResult === 0) {\n if (a.type === 'file' && b.type === 'file') {\n return a.filePath.localeCompare(b.filePath);\n } else if (a.type === 'dir' && b.type === 'dir') {\n return a.filePath.localeCompare(b.filePath);\n } else if (a.type === 'contents' && b.type === 'contents') {\n return a.id.localeCompare(b.id);\n }\n }\n return typeResult;\n}\n\nexport function diffFingerprints(\n fingerprint1: Fingerprint,\n fingerprint2: Fingerprint\n): FingerprintDiffItem[] {\n let index1 = 0;\n let index2 = 0;\n const diff: FingerprintDiffItem[] = [];\n\n while (index1 < fingerprint1.sources.length && index2 < fingerprint2.sources.length) {\n const source1 = fingerprint1.sources[index1];\n const source2 = fingerprint2.sources[index2];\n\n const compareResult = compareSource(source1, source2);\n if (compareResult === 0) {\n if (source1.hash !== source2.hash) {\n diff.push({ op: 'changed', beforeSource: source1, afterSource: source2 });\n }\n ++index1;\n ++index2;\n } else if (compareResult < 0) {\n diff.push({ op: 'removed', removedSource: source1 });\n ++index1;\n } else {\n diff.push({ op: 'added', addedSource: source2 });\n ++index2;\n }\n }\n\n while (index1 < fingerprint1.sources.length) {\n diff.push({ op: 'removed', removedSource: fingerprint1.sources[index1] });\n ++index1;\n }\n while (index2 < fingerprint2.sources.length) {\n diff.push({ op: 'added', addedSource: fingerprint2.sources[index2] });\n ++index2;\n }\n\n return diff;\n}\n\nexport function stringifyFingerprintDiff(fingerprintDiff: FingerprintDiffItem[]): string {\n return JSON.stringify(\n fingerprintDiff,\n (key, value) => {\n if (key === 'contents') {\n try {\n const item = JSON.parse(value);\n return item;\n } catch {\n return value;\n }\n }\n return value;\n },\n ' '\n );\n}\n"]}
1
+ {"version":3,"file":"fingerprint.js","sourceRoot":"","sources":["../../src/utils/fingerprint.ts"],"names":[],"mappings":";;;AAAA,SAAgB,wBAAwB,CAAC,eAAyB;IAChE,OAAO,IAAI,CAAC,SAAS,CACnB,eAAe,EACf,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QACb,IAAI,GAAG,KAAK,UAAU,EAAE,CAAC;YACvB,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBAC/B,OAAO,IAAI,CAAC;YACd,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,EACD,GAAG,CACJ,CAAC;AACJ,CAAC;AAhBD,4DAgBC","sourcesContent":["export function stringifyFingerprintDiff(fingerprintDiff: object[]): string {\n return JSON.stringify(\n fingerprintDiff,\n (key, value) => {\n if (key === 'contents') {\n try {\n const item = JSON.parse(value);\n return item;\n } catch {\n return value;\n }\n }\n return value;\n },\n ' '\n );\n}\n"]}
@@ -0,0 +1,23 @@
1
+ /// <reference types="bunyan" />
2
+ import { Generic } from '@expo/eas-build-job';
3
+ import { BuildStep } from '@expo/steps';
4
+ import { bunyan } from '@expo/logger';
5
+ import { BuildContext } from '../context';
6
+ export declare function uploadJobOutputsToWwwAsync(ctx: BuildContext<Generic.Job>, { steps, logger, expoApiV2BaseUrl, }: {
7
+ steps: BuildStep[];
8
+ logger: bunyan;
9
+ expoApiV2BaseUrl: string;
10
+ }): Promise<void>;
11
+ /** Function we use to get outputs of the whole job from steps. */
12
+ export declare function getJobOutputsFromSteps({ jobOutputDefinitions, interpolationContext, }: {
13
+ jobOutputDefinitions: Record<string, string>;
14
+ interpolationContext: {
15
+ steps: Record<string, {
16
+ outputs: Record<string, string | undefined>;
17
+ }>;
18
+ };
19
+ }): Record<string, string | undefined>;
20
+ /** This is what we'll use to generate an object representing a step. */
21
+ export declare function getStepOutputsAsObject(step: BuildStep): {
22
+ outputs: Record<string, string | undefined>;
23
+ };
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getStepOutputsAsObject = exports.getJobOutputsFromSteps = exports.uploadJobOutputsToWwwAsync = void 0;
7
+ const steps_1 = require("@expo/steps");
8
+ const nullthrows_1 = __importDefault(require("nullthrows"));
9
+ const turtleFetch_1 = require("./turtleFetch");
10
+ async function uploadJobOutputsToWwwAsync(ctx, { steps, logger, expoApiV2BaseUrl, }) {
11
+ var _a, _b, _c;
12
+ if (!ctx.job.outputs) {
13
+ logger.info('Job defines no outputs, skipping upload');
14
+ return;
15
+ }
16
+ try {
17
+ const workflowJobId = (0, nullthrows_1.default)((_b = (_a = ctx.job.builderEnvironment) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.__WORKFLOW_JOB_ID);
18
+ const robotAccessToken = (0, nullthrows_1.default)((_c = ctx.job.secrets) === null || _c === void 0 ? void 0 : _c.robotAccessToken);
19
+ const interpolationContext = {
20
+ steps: Object.fromEntries(steps.map((step) => [step.id, getStepOutputsAsObject(step)])),
21
+ };
22
+ logger.debug({ dynamicValues: interpolationContext }, 'Using dynamic values');
23
+ const outputs = getJobOutputsFromSteps({
24
+ jobOutputDefinitions: ctx.job.outputs,
25
+ interpolationContext,
26
+ });
27
+ logger.info('Uploading outputs');
28
+ await (0, turtleFetch_1.turtleFetch)(new URL(`workflows/${workflowJobId}`, expoApiV2BaseUrl).toString(), 'PATCH', {
29
+ json: { outputs },
30
+ headers: {
31
+ Authorization: `Bearer ${robotAccessToken}`,
32
+ },
33
+ timeout: 20000,
34
+ logger,
35
+ });
36
+ }
37
+ catch (err) {
38
+ logger.error({ err }, 'Failed to upload outputs');
39
+ throw err;
40
+ }
41
+ }
42
+ exports.uploadJobOutputsToWwwAsync = uploadJobOutputsToWwwAsync;
43
+ /** Function we use to get outputs of the whole job from steps. */
44
+ function getJobOutputsFromSteps({ jobOutputDefinitions, interpolationContext, }) {
45
+ const jobOutputs = {};
46
+ for (const [outputKey, outputDefinition] of Object.entries(jobOutputDefinitions)) {
47
+ const outputValue = outputDefinition.replace(/\$\{\{(.+?)\}\}/g, (_match, expression) => {
48
+ return `${(0, steps_1.jsepEval)(expression, interpolationContext)}`;
49
+ });
50
+ jobOutputs[outputKey] = outputValue;
51
+ }
52
+ return jobOutputs;
53
+ }
54
+ exports.getJobOutputsFromSteps = getJobOutputsFromSteps;
55
+ /** This is what we'll use to generate an object representing a step. */
56
+ function getStepOutputsAsObject(step) {
57
+ var _a;
58
+ const outputs = Object.fromEntries((_a = Object.entries(step.outputById).map(([id, output]) => { var _a; return [id, (_a = output.value) !== null && _a !== void 0 ? _a : '']; })) !== null && _a !== void 0 ? _a : []);
59
+ return { outputs };
60
+ }
61
+ exports.getStepOutputsAsObject = getStepOutputsAsObject;
62
+ //# sourceMappingURL=outputs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outputs.js","sourceRoot":"","sources":["../../src/utils/outputs.ts"],"names":[],"mappings":";;;;;;AACA,uCAAkD;AAElD,4DAAoC;AAIpC,+CAA4C;AAErC,KAAK,UAAU,0BAA0B,CAC9C,GAA8B,EAC9B,EACE,K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KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,0BAA0B,CAAC,CAAC;QAClD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC;AAxCD,gEAwCC;AAED,kEAAkE;AAClE,SAAgB,sBAAsB,CAAC,EACrC,oBAAoB,EACpB,oBAAoB,GAMrB;IACC,MAAM,UAAU,GAAuC,EAAE,CAAC;IAC1D,KAAK,MAAM,CAAC,SAAS,EAAE,gBAAgB,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC;QACjF,MAAM,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;YACtF,OAAO,GAAG,IAAA,gBAAQ,EAAC,UAAU,EAAE,oBAAoB,CAAC,EAAE,CAAC;QACzD,CAAC,CAAC,CAAC;QAEH,UAAU,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC;IACtC,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAnBD,wDAmBC;AAED,wEAAwE;AACxE,SAAgB,sBAAsB,CAAC,IAAe;;IAGpD,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAChC,MAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,WAAC,OAAA,CAAC,EAAE,EAAE,MAAA,MAAM,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAA,EAAA,CAAC,mCAAI,EAAE,CACtF,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,CAAC;AACrB,CAAC;AARD,wDAQC","sourcesContent":["import { Generic } from '@expo/eas-build-job';\nimport { BuildStep, jsepEval } from '@expo/steps';\nimport { bunyan } from '@expo/logger';\nimport nullthrows from 'nullthrows';\n\nimport { BuildContext } from '../context';\n\nimport { turtleFetch } from './turtleFetch';\n\nexport async function uploadJobOutputsToWwwAsync(\n ctx: BuildContext<Generic.Job>,\n {\n steps,\n logger,\n expoApiV2BaseUrl,\n }: { steps: BuildStep[]; logger: bunyan; expoApiV2BaseUrl: string }\n): Promise<void> {\n if (!ctx.job.outputs) {\n logger.info('Job defines no outputs, skipping upload');\n return;\n }\n\n try {\n const workflowJobId = nullthrows(ctx.job.builderEnvironment?.env?.__WORKFLOW_JOB_ID);\n const robotAccessToken = nullthrows(ctx.job.secrets?.robotAccessToken);\n\n const interpolationContext = {\n steps: Object.fromEntries(steps.map((step) => [step.id, getStepOutputsAsObject(step)])),\n };\n logger.debug({ dynamicValues: interpolationContext }, 'Using dynamic values');\n\n const outputs = getJobOutputsFromSteps({\n jobOutputDefinitions: ctx.job.outputs,\n interpolationContext,\n });\n logger.info('Uploading outputs');\n\n await turtleFetch(new URL(`workflows/${workflowJobId}`, expoApiV2BaseUrl).toString(), 'PATCH', {\n json: { outputs },\n headers: {\n Authorization: `Bearer ${robotAccessToken}`,\n },\n timeout: 20000,\n logger,\n });\n } catch (err) {\n logger.error({ err }, 'Failed to upload outputs');\n throw err;\n }\n}\n\n/** Function we use to get outputs of the whole job from steps. */\nexport function getJobOutputsFromSteps({\n jobOutputDefinitions,\n interpolationContext,\n}: {\n jobOutputDefinitions: Record<string, string>;\n interpolationContext: {\n steps: Record<string, { outputs: Record<string, string | undefined> }>;\n };\n}): Record<string, string | undefined> {\n const jobOutputs: Record<string, string | undefined> = {};\n for (const [outputKey, outputDefinition] of Object.entries(jobOutputDefinitions)) {\n const outputValue = outputDefinition.replace(/\\$\\{\\{(.+?)\\}\\}/g, (_match, expression) => {\n return `${jsepEval(expression, interpolationContext)}`;\n });\n\n jobOutputs[outputKey] = outputValue;\n }\n\n return jobOutputs;\n}\n\n/** This is what we'll use to generate an object representing a step. */\nexport function getStepOutputsAsObject(step: BuildStep): {\n outputs: Record<string, string | undefined>;\n} {\n const outputs = Object.fromEntries(\n Object.entries(step.outputById).map(([id, output]) => [id, output.value ?? '']) ?? []\n );\n\n return { outputs };\n}\n"]}
@@ -0,0 +1,32 @@
1
+ /// <reference types="bunyan" />
2
+ import { Response, RequestInit, HeaderInit } from 'node-fetch';
3
+ import { bunyan } from '@expo/logger';
4
+ type TurtleFetchMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'PATCH';
5
+ export declare class TurtleFetchError extends Error {
6
+ readonly response: Response;
7
+ constructor(message: string, response: Response);
8
+ }
9
+ /**
10
+ * Wrapper around node-fetch adding some useful features:
11
+ * - retries
12
+ * - json body - if you specify json in options, it will be stringified and content-type will be set to application/json
13
+ * - automatic error throwing - if response is not ok, it will throw an error
14
+ *
15
+ * @param url URL to fetch
16
+ * @param method HTTP method
17
+ * @param options.retries number of retries
18
+ * @param options.json json body
19
+ * @param options.headers headers
20
+ * @param options.shouldThrowOnNotOk if false, it will not throw an error if response is not ok (default: true)
21
+ * @param options other options passed to node-fetch
22
+ * @returns {Promise<Response>}
23
+ */
24
+ export declare function turtleFetch(url: string, method: TurtleFetchMethod, options: Omit<RequestInit, 'body' | 'method'> & {
25
+ retries?: number;
26
+ json?: Record<string, any>;
27
+ headers?: Exclude<HeaderInit, string[][]>;
28
+ shouldThrowOnNotOk?: boolean;
29
+ retryIntervalMs?: number;
30
+ logger?: bunyan;
31
+ }): Promise<Response>;
32
+ export {};
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.turtleFetch = exports.TurtleFetchError = void 0;
7
+ const node_fetch_1 = __importDefault(require("node-fetch"));
8
+ const retry_1 = require("./retry");
9
+ class TurtleFetchError extends Error {
10
+ constructor(message, response) {
11
+ super(message);
12
+ this.response = response;
13
+ }
14
+ }
15
+ exports.TurtleFetchError = TurtleFetchError;
16
+ /**
17
+ * Wrapper around node-fetch adding some useful features:
18
+ * - retries
19
+ * - json body - if you specify json in options, it will be stringified and content-type will be set to application/json
20
+ * - automatic error throwing - if response is not ok, it will throw an error
21
+ *
22
+ * @param url URL to fetch
23
+ * @param method HTTP method
24
+ * @param options.retries number of retries
25
+ * @param options.json json body
26
+ * @param options.headers headers
27
+ * @param options.shouldThrowOnNotOk if false, it will not throw an error if response is not ok (default: true)
28
+ * @param options other options passed to node-fetch
29
+ * @returns {Promise<Response>}
30
+ */
31
+ async function turtleFetch(url, method, options) {
32
+ const { json, headers: rawHeaders, retries: rawRetries, logger, retryIntervalMs = 1000, shouldThrowOnNotOk = true, ...otherOptions } = options;
33
+ const retries = rawRetries !== null && rawRetries !== void 0 ? rawRetries : (method === 'POST' ? 0 : 2);
34
+ const body = JSON.stringify(json);
35
+ const headers = json ? { ...rawHeaders, 'Content-Type': 'application/json' } : rawHeaders;
36
+ return await (0, retry_1.retryAsync)(async (attemptCount) => {
37
+ const response = await (0, node_fetch_1.default)(url, {
38
+ method,
39
+ body,
40
+ headers,
41
+ ...otherOptions,
42
+ });
43
+ const shouldThrow = shouldThrowOnNotOk || attemptCount < retries;
44
+ if (!response.ok && shouldThrow) {
45
+ throw new TurtleFetchError(`Request failed with status ${response.status}`, response);
46
+ }
47
+ return response;
48
+ }, { retryOptions: { retries, retryIntervalMs }, logger });
49
+ }
50
+ exports.turtleFetch = turtleFetch;
51
+ //# sourceMappingURL=turtleFetch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turtleFetch.js","sourceRoot":"","sources":["../../src/utils/turtleFetch.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAsE;AAGtE,mCAAqC;AAIrC,MAAa,gBAAiB,SAAQ,KAAK;IAEzC,YAAY,OAAe,EAAE,QAAkB;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAND,4CAMC;AAED;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,WAAW,CAC/B,GAAW,EACX,MAAyB,EACzB,OAOC;IAED,MAAM,EACJ,IAAI,EACJ,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,UAAU,EACnB,MAAM,EACN,eAAe,GAAG,IAAI,EACtB,kBAAkB,GAAG,IAAI,EACzB,GAAG,YAAY,EAChB,GAAG,OAAO,CAAC;IAEZ,MAAM,OAAO,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1D,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;IAE1F,OAAO,MAAM,IAAA,kBAAU,EACrB,KAAK,EAAE,YAAY,EAAE,EAAE;QACrB,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAK,EAAC,GAAG,EAAE;YAChC,MAAM;YACN,IAAI;YACJ,OAAO;YACP,GAAG,YAAY;SAChB,CAAC,CAAC;QACH,MAAM,WAAW,GAAG,kBAAkB,IAAI,YAAY,GAAG,OAAO,CAAC;QACjE,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,WAAW,EAAE,CAAC;YAChC,MAAM,IAAI,gBAAgB,CAAC,8BAA8B,QAAQ,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC,CAAC;QACxF,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC,EACD,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE,MAAM,EAAE,CACvD,CAAC;AACJ,CAAC;AA3CD,kCA2CC","sourcesContent":["import fetch, { Response, RequestInit, HeaderInit } from 'node-fetch';\nimport { bunyan } from '@expo/logger';\n\nimport { retryAsync } from './retry';\n\ntype TurtleFetchMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'PATCH';\n\nexport class TurtleFetchError extends Error {\n readonly response: Response;\n constructor(message: string, response: Response) {\n super(message);\n this.response = response;\n }\n}\n\n/**\n * Wrapper around node-fetch adding some useful features:\n * - retries\n * - json body - if you specify json in options, it will be stringified and content-type will be set to application/json\n * - automatic error throwing - if response is not ok, it will throw an error\n *\n * @param url URL to fetch\n * @param method HTTP method\n * @param options.retries number of retries\n * @param options.json json body\n * @param options.headers headers\n * @param options.shouldThrowOnNotOk if false, it will not throw an error if response is not ok (default: true)\n * @param options other options passed to node-fetch\n * @returns {Promise<Response>}\n */\nexport async function turtleFetch(\n url: string,\n method: TurtleFetchMethod,\n options: Omit<RequestInit, 'body' | 'method'> & {\n retries?: number;\n json?: Record<string, any>;\n headers?: Exclude<HeaderInit, string[][]>;\n shouldThrowOnNotOk?: boolean;\n retryIntervalMs?: number;\n logger?: bunyan;\n }\n): Promise<Response> {\n const {\n json,\n headers: rawHeaders,\n retries: rawRetries,\n logger,\n retryIntervalMs = 1000,\n shouldThrowOnNotOk = true,\n ...otherOptions\n } = options;\n\n const retries = rawRetries ?? (method === 'POST' ? 0 : 2);\n\n const body = JSON.stringify(json);\n const headers = json ? { ...rawHeaders, 'Content-Type': 'application/json' } : rawHeaders;\n\n return await retryAsync(\n async (attemptCount) => {\n const response = await fetch(url, {\n method,\n body,\n headers,\n ...otherOptions,\n });\n const shouldThrow = shouldThrowOnNotOk || attemptCount < retries;\n if (!response.ok && shouldThrow) {\n throw new TurtleFetchError(`Request failed with status ${response.status}`, response);\n }\n return response;\n },\n { retryOptions: { retries, retryIntervalMs }, logger }\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/build-tools",
3
- "version": "1.0.150",
3
+ "version": "1.0.152",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -22,17 +22,17 @@
22
22
  "bugs": "https://github.com/expo/eas-build/issues",
23
23
  "license": "BUSL-1.1",
24
24
  "dependencies": {
25
- "@expo/config": "9.0.3",
26
- "@expo/config-plugins": "8.0.8",
25
+ "@expo/config": "10.0.6",
26
+ "@expo/config-plugins": "9.0.12",
27
27
  "@expo/downloader": "1.0.118",
28
- "@expo/eas-build-job": "1.0.149",
29
- "@expo/env": "^0.3.0",
28
+ "@expo/eas-build-job": "1.0.151",
29
+ "@expo/env": "^0.4.0",
30
30
  "@expo/logger": "1.0.117",
31
31
  "@expo/package-manager": "1.5.2",
32
- "@expo/plist": "^0.1.3",
32
+ "@expo/plist": "^0.2.0",
33
33
  "@expo/repack-app": "0.0.6",
34
34
  "@expo/results": "^1.0.0",
35
- "@expo/steps": "1.0.150",
35
+ "@expo/steps": "1.0.151",
36
36
  "@expo/template-file": "1.0.117",
37
37
  "@expo/turtle-spawn": "1.0.117",
38
38
  "@expo/xcpretty": "^4.3.1",
@@ -74,5 +74,5 @@
74
74
  "node": "20.14.0",
75
75
  "yarn": "1.22.21"
76
76
  },
77
- "gitHead": "2c83fbf92d8cdce6a8ed52d537488e221758a675"
77
+ "gitHead": "e89ed61508fd7a2c95416a28bd13d771ac1fc993"
78
78
  }