diff --git a/CHANGELOG.md b/CHANGELOG.md index 42c723eb65..9a0bbca2b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ This is the log of notable changes to EAS CLI and related packages. ### ๐ŸŽ‰ New features +- Add EAS_SKIP_AUTO_FINGERPRINT to skip fingerprint computation on build ([#2675](https://github.com/expo/eas-cli/pull/2675) by [@quinlanj](https://github.com/quinlanj)) + ### ๐Ÿ› Bug fixes ### ๐Ÿงน Chores diff --git a/packages/eas-cli/src/utils/fingerprintCli.ts b/packages/eas-cli/src/utils/fingerprintCli.ts index 4066012c31..0c69da8139 100644 --- a/packages/eas-cli/src/utils/fingerprintCli.ts +++ b/packages/eas-cli/src/utils/fingerprintCli.ts @@ -1,6 +1,9 @@ import { Env, Workflow } from '@expo/eas-build-job'; import { silent as silentResolveFrom } from 'resolve-from'; +import Log from '../log'; +import { ora } from '../ora'; + export async function createFingerprintAsync( projectDir: string, options: { @@ -20,17 +23,40 @@ export async function createFingerprintAsync( if (!fingerprintPath) { return null; } - const Fingerprint = require(fingerprintPath); - const fingerprintOptions: Record = {}; - if (options.platform) { - fingerprintOptions.platforms = [options.platform]; - } - if (options.workflow === Workflow.MANAGED) { - fingerprintOptions.ignorePaths = ['android/**/*', 'ios/**/*']; + + if (process.env.EAS_SKIP_AUTO_FINGERPRINT) { + Log.log('Skipping project fingerprint'); + return null; } - if (options.debug) { - fingerprintOptions.debug = true; + + const timeoutId = setTimeout(() => { + Log.log('โŒ›๏ธ Computing the project fingerprint is taking longer than expected...'); + Log.log('โฉ To skip this step, set the environment variable: EAS_SKIP_AUTO_FINGERPRINT=1'); + }, 5000); + + const spinner = ora(`Computing project fingerprint`).start(); + try { + const Fingerprint = require(fingerprintPath); + const fingerprintOptions: Record = {}; + if (options.platform) { + fingerprintOptions.platforms = [options.platform]; + } + if (options.workflow === Workflow.MANAGED) { + fingerprintOptions.ignorePaths = ['android/**/*', 'ios/**/*']; + } + if (options.debug) { + fingerprintOptions.debug = true; + } + const fingerprint = await Fingerprint.createFingerprintAsync(projectDir, fingerprintOptions); + spinner.succeed(`Computed project fingerprint`); + return fingerprint; + } catch (e) { + spinner.fail(`Failed to compute project fingerprint`); + Log.log('โฉ To skip this step, set the environment variable: EAS_SKIP_AUTO_FINGERPRINT=1'); + throw e; + } finally { + // Clear the timeout if the operation finishes before the time limit + clearTimeout(timeoutId); + spinner.stop(); } - // eslint-disable-next-line @typescript-eslint/return-await - return await Fingerprint.createFingerprintAsync(projectDir, fingerprintOptions); }