Skip to content

Commit

Permalink
[expo-updates] Add ability to override build-time fingerprint (#27597)
Browse files Browse the repository at this point in the history
  • Loading branch information
wschurman committed Mar 15, 2024
1 parent ef7d2a6 commit cb0bf27
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
2 changes: 2 additions & 0 deletions packages/expo-updates/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
- Add --version top-level flag and also add handler for missing command in expo-update cli. ([#27296](https://github.com/expo/expo/pull/27296) by [@wschurman](https://github.com/wschurman))
- Add more debug information to runtimeversion:resolve CLI output. ([#27323](https://github.com/expo/expo/pull/27323), [#27387](https://github.com/expo/expo/pull/27387) by [@wschurman](https://github.com/wschurman))
- Added React Native New Architecture support. ([#27216](https://github.com/expo/expo/pull/27216) by [@kudo](https://github.com/kudo))
- Add ability to override build-time fingerprint. ([#27597](https://github.com/expo/expo/pull/27597) by [@wschurman](https://github.com/wschurman))


### 🐛 Bug fixes

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions packages/expo-updates/utils/src/createFingerprintForBuildAsync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,18 @@ export async function createFingerprintForBuildAsync(
return;
}

const workflow = await resolveWorkflowAsync(projectRoot, platform);
const fingerprint = await createFingerprintAsync(projectRoot, platform, workflow, {});
let fingerprint: { hash: string };

console.log(JSON.stringify(fingerprint.sources));
const override = process.env.EXPO_UPDATES_FINGERPRINT_OVERRIDE;
if (override) {
console.log(`Using fingerprint from EXPO_UPDATES_FINGERPRINT_OVERRIDE: ${override}`);
fingerprint = { hash: override };
} else {
const workflow = await resolveWorkflowAsync(projectRoot, platform);
const createdFingerprint = await createFingerprintAsync(projectRoot, platform, workflow, {});
console.log(JSON.stringify(createdFingerprint.sources));
fingerprint = createdFingerprint;
}

fs.writeFileSync(path.join(destinationDir, 'fingerprint'), fingerprint.hash);
}

0 comments on commit cb0bf27

Please sign in to comment.