@expo/fingerprint
Advanced tools
Comparing version 0.10.3 to 0.11.0-canary-20240814-ce0f7d5
{ | ||
"name": "@expo/fingerprint", | ||
"version": "0.10.3", | ||
"version": "0.11.0-canary-20240814-ce0f7d5", | ||
"description": "A library to generate a fingerprint from a React Native project", | ||
@@ -55,8 +55,8 @@ "main": "build/index.js", | ||
"@types/find-up": "^4.0.0", | ||
"expo-module-scripts": "^3.3.0", | ||
"glob": "^7.1.7", | ||
"expo-module-scripts": "3.6.0-canary-20240814-ce0f7d5", | ||
"glob": "^10.4.2", | ||
"require-from-string": "^2.0.2", | ||
"temp-dir": "^2.0.0" | ||
}, | ||
"gitHead": "e3eef0d33a4cf869112bc0d7922ee9c7fd35a642" | ||
"gitHead": "ce0f7d5c7eaec2c8d06ee4e0dc0e58cd6c1612ed" | ||
} |
@@ -7,6 +7,8 @@ # @expo/fingerprint | ||
* [API Usage](#api-usage) | ||
* [CLI Usage](#cli-usage) | ||
* [Customizations](#customizations) | ||
* [Limitations](#limitations) | ||
- [API Usage](#api-usage) | ||
- [CLI Usage](#cli-usage) | ||
- [Customizations](#customizations) | ||
- [**.fingerprintignore** file](#include-or-exclude-extra-files-to-ignored-paths-in-the-fingerprintignore-file) | ||
- [**fingerprint.config.js** file](#fingerprintconfigjs) | ||
- [Limitations](#limitations) | ||
@@ -86,3 +88,7 @@ ## API Usage | ||
```ts | ||
function diffFingerprintChangesAsync(fingerprint: Fingerprint, projectRoot: string, options?: Options): Promise<FingerprintSource[]>; | ||
function diffFingerprintChangesAsync( | ||
fingerprint: Fingerprint, | ||
projectRoot: string, | ||
options?: Options | ||
): Promise<FingerprintSource[]>; | ||
``` | ||
@@ -123,12 +129,28 @@ | ||
{ | ||
"filePath": "ios", | ||
"hash": "e4190c0af9142fe4add4842777d9aec713213cd4", | ||
"reasons": ["bareNativeDir"], | ||
"type": "dir" | ||
"op": "removed", | ||
"source": { | ||
"type": "file", | ||
"filePath": "./assets/icon.png", | ||
"reasons": ["expoConfigExternalFile"], | ||
"hash": "3f71f5a8458c06b83424cc33e1f2481f601199ea" | ||
} | ||
}, | ||
{ | ||
"filePath": "app.json", | ||
"hash": "9ff1b51ca9b9435e8b849bcc82e3900d70f0feee", | ||
"reasons": ["expoConfig"], | ||
"type": "file" | ||
"op": "added", | ||
"source": { | ||
"type": "dir", | ||
"filePath": "ios", | ||
"reasons": ["bareNativeDir"], | ||
"hash": "2420400e6140a4ccfc350fc483b26efdfc26ddac" | ||
} | ||
}, | ||
{ | ||
"op": "changed", | ||
"source": { | ||
"type": "contents", | ||
"id": "expoConfig", | ||
"contents": "{\"ios\":{\"bundleIdentifier\":\"com.test\",\"supportsTablet\":true},\"name\":\"test\",\"platforms\":[\"ios\"],\"slug\":\"test\"}", | ||
"reasons": ["expoConfig"], | ||
"hash": "dd2a3ebb872b097f9c1e33780fb8db8688848fa0" | ||
} | ||
} | ||
@@ -143,3 +165,6 @@ ] | ||
```ts | ||
function diffFingerprints(fingerprint1: Fingerprint, fingerprint2: Fingerprint): FingerprintSource[]; | ||
function diffFingerprints( | ||
fingerprint1: Fingerprint, | ||
fingerprint2: Fingerprint | ||
): FingerprintSource[]; | ||
``` | ||
@@ -163,5 +188,5 @@ | ||
### Include or exclude extra files in the **.fingerprintignore** file | ||
### Include or exclude extra files to ignored paths in the **.fingerprintignore** file | ||
Our default ignore paths, found here [`DEFAULT_IGNORE_PATHS`](https://github.com/expo/expo/blob/main/packages/%40expo/fingerprint/src/Options.ts#L9), make hashing fast and keep hashing results stable. If the default setup does not fit your workflow, you can add a **.fingerprintignore** file in your project root. It works like [**.gitignore**](https://git-scm.com/docs/gitignore#_pattern_format) but with some slight differences: We use `minimatch` for pattern matching with the [limitations](https://github.com/expo/expo/blob/9b9133c96f209b0616d1796aadae28913f8d012f/packages/%40expo/fingerprint/src/Fingerprint.types.ts#L46-L55). | ||
Our default ignore paths, found here [`DEFAULT_IGNORE_PATHS`](https://github.com/expo/expo/blob/main/packages/%40expo/fingerprint/src/Options.ts#L11), make hashing fast and keep hashing results stable. If the default setup does not fit your workflow, you can add a **.fingerprintignore** file in your project root. It works like [**.gitignore**](https://git-scm.com/docs/gitignore#_pattern_format) but with some slight differences: We use `minimatch` for pattern matching with the [limitations](https://github.com/expo/expo/blob/9b9133c96f209b0616d1796aadae28913f8d012f/packages/%40expo/fingerprint/src/Fingerprint.types.ts#L46-L55). | ||
@@ -179,2 +204,36 @@ Here's how to use **.fingerprintignore**: To skip a whole folder but keep some files, you can do this: | ||
### **fingerprint.config.js** | ||
You can customize the fingerprinting behavior by creating a **fingerprint.config.js** file in your project root. This file allows you to specify custom configurations, such as skipping certain fingerprint sources, adding extra fingerprint sources, or enabling debug mode. | ||
Below is an example **fingerprint.config.js** configuration, assuming you have `@expo/fingerprint` installed as a direct dependency: | ||
```js | ||
/** @type {import('@expo/fingerprint').Config} */ | ||
const config = { | ||
sourceSkips: [ | ||
'ExpoConfigRuntimeVersionIfString', | ||
'ExpoConfigVersions', | ||
'PackageJsonAndroidAndIosScriptsIfNotContainRun', | ||
], | ||
}; | ||
module.exports = config; | ||
``` | ||
If you are using `@expo/fingerprint` through `expo-updates` (where `@expo/fingerprint` is installed as a transitive dependency), you can import fingerprint from `expo-updates/fingerprint`: | ||
```js | ||
/** @type {import('expo-updates/fingerprint').Config} */ | ||
const config = { | ||
sourceSkips: [ | ||
'ExpoConfigRuntimeVersionIfString', | ||
'ExpoConfigVersions', | ||
'PackageJsonAndroidAndIosScriptsIfNotContainRun', | ||
], | ||
}; | ||
module.exports = config; | ||
``` | ||
For supported configurations, you can refer to the [source code](https://github.com/expo/expo/blob/main/packages/%40expo/fingerprint/src/Config.ts#L38-L45) and [`SourceSkips.ts`](https://github.com/expo/expo/blob/main/packages/%40expo/fingerprint/src/sourcer/SourceSkips.ts) for supported `SourceSkips`. | ||
## Limitations | ||
@@ -181,0 +240,0 @@ |
148505
302