@expo/fingerprint 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +50 -6
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -2,7 +2,14 @@
2
2
 
3
3
  A library to generate a fingerprint from a React Native project
4
4
 
5
- ## Usage
5
+ ## Table of Contents
6
+
7
+ * [API Usage](#api-usage)
8
+ * [CLI Usage](#cli-usage)
9
+ * [Customizations](#customizations)
10
+ * [Limitations](#limitations)
11
+
12
+ ## API Usage
6
13
 
7
14
  ```ts
8
15
  import * as Fingerprint from '@expo/fingerprint';
@@ -10,10 +17,14 @@ import * as Fingerprint from '@expo/fingerprint';
10
17
  await Fingerprint.createFingerprintAsync('/projectRoot');
11
18
  ```
12
19
 
13
- ### `async function createFingerprintAsync(projectRoot: string, options?: Options): Promise<Fingerprint>`
20
+ ### createFingerprintAsync
14
21
 
15
22
  Create a fingerprint from project
16
23
 
24
+ ```ts
25
+ function createFingerprintAsync(projectRoot: string, options?: Options): Promise<Fingerprint>;
26
+ ```
27
+
17
28
  Example:
18
29
 
19
30
  ```ts
@@ -47,10 +58,14 @@ console.log(fingerprint);
47
58
  }
48
59
  ```
49
60
 
50
- ### `async function createProjectHashAsync(projectRoot: string, options?: Options): Promise<string>`
61
+ ### createProjectHashAsync
51
62
 
52
63
  Create a native hash value from project
53
64
 
65
+ ```ts
66
+ function createProjectHashAsync(projectRoot: string, options?: Options): Promise<string>;
67
+ ```
68
+
54
69
  Example:
55
70
 
56
71
  ```ts
@@ -62,9 +77,13 @@ console.log(hash);
62
77
  bf8a3b08935f056270b1688333b02f1ef5fa25bf
63
78
  ```
64
79
 
65
- ### `diffFingerprintChangesAsync(fingerprint: Fingerprint, projectRoot: string, options?: Options): Promise<FingerprintSource[]>`
80
+ ### diffFingerprintChangesAsync
81
+
82
+ Diff the given `fingerprint` with the current project fingerprint state
66
83
 
67
- Differentiate given `fingerprint` with the current project fingerprint state
84
+ ```ts
85
+ function diffFingerprintChangesAsync(fingerprint: Fingerprint, projectRoot: string, options?: Options): Promise<FingerprintSource[]>;
86
+ ```
68
87
 
69
88
  Example:
70
89
 
@@ -113,6 +132,14 @@ console.log(result);
113
132
  ]
114
133
  ```
115
134
 
135
+ ### diffFingerprints
136
+
137
+ Find the diff between two fingerprints
138
+
139
+ ```ts
140
+ function diffFingerprints(fingerprint1: Fingerprint, fingerprint2: Fingerprint): FingerprintSource[];
141
+ ```
142
+
116
143
  ## CLI Usage
117
144
 
118
145
  ### Generate a fingerprint for a given project
@@ -127,9 +154,26 @@ console.log(result);
127
154
 
128
155
  `npx @expo/fingerprint /path/to/projectRoot fingerprint.json`
129
156
 
157
+ ## Customizations
158
+
159
+ ### Include or exclude extra files in the **.fingerprintignore** file
160
+
161
+ 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).
162
+
163
+ Here's how to use **.fingerprintignore**: To skip a whole folder but keep some files, you can do this:
164
+
165
+ ```
166
+ # Ignore the entire /app/ios folder
167
+ /app/ios/**/*
168
+
169
+ # But still keep /app/ios/Podfile and /app/ios/Podfile.lock
170
+ !/app/ios/Podfile
171
+ !/app/ios/Podfile.lock
172
+ ```
173
+
130
174
  ## Limitations
131
175
 
132
- ## Limited support for [config-plugins raw functions](https://docs.expo.dev/config-plugins/plugins-and-mods/#raw-functions)
176
+ ### Limited support for [config-plugins raw functions](https://docs.expo.dev/config-plugins/plugins-and-mods/#raw-functions)
133
177
 
134
178
  When using config-plugins with raw functions, it's essential to be aware of certain limitations, particularly in the context of fingerprinting. Expo makes its best effort to generate fingerprints for changes made through config-plugins; however, raw functions pose specific challenges. Raw functions are not serializable as fingerprints, which means they cannot be directly used for generating unique hashes.
135
179
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/fingerprint",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "A library to generate a fingerprint from a React Native project",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -55,5 +55,5 @@
55
55
  "glob": "^7.1.7",
56
56
  "temp-dir": "^2.0.0"
57
57
  },
58
- "gitHead": "b723f0ff34034e748e8fb1fcd0464daedb56d6c3"
58
+ "gitHead": "2763e9cc6f2317b40da73382fe2595f8deebff46"
59
59
  }