Skip to content

Conversation

@szymonrybczak
Copy link
Collaborator

Summary

Some projects might want to include or exclude custom input sources when calculating fingerprint. This Pull Requests implements fingerprint object in config which includes extraSources and ignorePaths properties.

ignorePaths by default accepts glob patterns which is not a case with extraSources so that's why we have to transform user-configured glob patterns to proper type which @expo/fingerprint accepts so both properties accept the same format 👍

Test plan

  1. Create directory with files e.g.
asdf
└── asdf.txt
hello.txt
  1. Include fingerprint configuration object in rnef.config.js
  fingerprint: {
    extraSources: ['./asdf/**/*', './hello.txt'],
    ignorePaths: []
  }
  1. Run fingerprint --platform android
  2. Make changes to custom extra sources included
  3. Hash calculated by fingerprint should change.

@szymonrybczak szymonrybczak requested a review from thymikee March 8, 2025 13:48
Pass project root to fetchCachedBuild in both Android and iOS platforms to ensure consistent path handling for cached builds.
Pass getFingerprintOptions from command level instead of re-running getConfig in fetchCachedBuild. This avoids expensive config traversal and plugin application on each build cache check.
Added basic test scenarios covering: single file processing, directory processing, non-existent paths handling, absolute paths handling
@szymonrybczak szymonrybczak requested a review from thymikee March 12, 2025 10:29
try {
const isGlobPattern = glob.isDynamicPattern(source);
if (isGlobPattern) {
const matches = await glob(source, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use glob.sync and make the processExtraSources function non async too? Sync fs access is usually faster

@thymikee thymikee merged commit 51a7c7f into main Mar 12, 2025
2 checks passed
@thymikee thymikee deleted the feat/custom-sources branch March 12, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants