Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fingerprint] introduce fingerprint.config.js support #28860

Merged
merged 5 commits into from
May 15, 2024

Conversation

Kudo
Copy link
Contributor

@Kudo Kudo commented May 14, 2024

Why

follow up feedback from #28712 that we should add fingerprint config support.

How

introduce fingerprint.config.js support to override Options. not all options are supported, because ignorePaths we would like to use .fingerprintignore and platform is not supported for sure.
the priority is explicit Options > fingerprint.config.js > default Options.

Test Plan

  1. add unit tests
  2. having this fingerprint.config.js in a project and see whether the result fingerprint hash would be sha256
/** @type {import('@expo/fingerprint').Config} */
const config = {
  hashAlgorithm: 'sha256',
};

module.exports = config;

Checklist

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label May 14, 2024
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels May 14, 2024
@Kudo Kudo marked this pull request as ready for review May 14, 2024 19:01
@Kudo Kudo requested a review from wschurman May 14, 2024 19:02
Copy link
Member

@wschurman wschurman left a comment

Choose a reason for hiding this comment

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

Awesome!

const supportedConfigKeys: (keyof Config)[] = [
'concurrentIoLimit',
'hashAlgorithm',
'extraSources',
Copy link
Member

Choose a reason for hiding this comment

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

Is the value for this key serializable to JSON? (can it be specified)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mostly, the config is just configurable Options. probably Buffer is not serializable but can use string instead.

would make the implementation simpler first without validator or parser. let's add it later if necessary.

@Kudo Kudo merged commit 6da4825 into main May 15, 2024
11 checks passed
@Kudo Kudo deleted the @kudo/fingerprint-config branch May 15, 2024 11:37
@brentvatne brentvatne added the published Changes from the PR have been published to npm label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint compatible bot: passed checks ExpoBot has nothing to complain about published Changes from the PR have been published to npm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants