@expo/fingerprint 0.1.0 → 0.3.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.
- package/CHANGELOG.md +20 -0
- package/README.md +70 -0
- package/__mocks__/@expo/spawn-async.ts +30 -0
- package/__mocks__/fs/promises.ts +15 -0
- package/build/Fingerprint.js +1 -1
- package/build/Fingerprint.js.map +1 -1
- package/build/Fingerprint.types.d.ts +12 -1
- package/build/Fingerprint.types.js.map +1 -1
- package/build/Options.d.ts +3 -1
- package/build/Options.js +63 -9
- package/build/Options.js.map +1 -1
- package/build/hash/Hash.d.ts +1 -1
- package/build/hash/Hash.js +15 -18
- package/build/hash/Hash.js.map +1 -1
- package/build/sourcer/Expo.js +42 -44
- package/build/sourcer/Expo.js.map +1 -1
- package/build/sourcer/ExpoConfigLoader.d.ts +7 -0
- package/build/sourcer/ExpoConfigLoader.js +80 -0
- package/build/sourcer/ExpoConfigLoader.js.map +1 -0
- package/build/sourcer/Utils.d.ts +4 -0
- package/build/sourcer/Utils.js +38 -1
- package/build/sourcer/Utils.js.map +1 -1
- package/build/utils/Path.d.ts +5 -0
- package/build/utils/Path.js +26 -0
- package/build/utils/Path.js.map +1 -0
- package/e2e/__tests__/__snapshots__/managed-test.ts.snap +3 -2
- package/e2e/__tests__/bare-test.ts +7 -0
- package/e2e/__tests__/managed-test.ts +13 -3
- package/package.json +3 -3
- package/src/Fingerprint.ts +2 -2
- package/src/Fingerprint.types.ts +13 -1
- package/src/Options.ts +70 -7
- package/src/__tests__/Fingerprint-test.ts +43 -17
- package/src/hash/Hash.ts +20 -21
- package/src/hash/__tests__/Hash-test.ts +62 -16
- package/src/sourcer/Expo.ts +48 -55
- package/src/sourcer/ExpoConfigLoader.ts +84 -0
- package/src/sourcer/Utils.ts +39 -0
- package/src/sourcer/__tests__/Bare-test.ts +11 -5
- package/src/sourcer/__tests__/Expo-test.ts +88 -109
- package/src/sourcer/__tests__/PatchPackage-test.ts +6 -3
- package/src/sourcer/__tests__/Sourcer-test.ts +9 -2
- package/src/sourcer/__tests__/Utils-test.ts +41 -0
- package/src/utils/Path.ts +26 -0
- package/src/utils/__tests__/Path-test.ts +36 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,26 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.3.0 — 2023-09-20
|
|
14
|
+
|
|
15
|
+
### 🛠 Breaking changes
|
|
16
|
+
|
|
17
|
+
- This version includes fingerprint result breaking changes. ([#24520](https://github.com/expo/expo/pull/24520) by [@kudo](https://github.com/kudo))
|
|
18
|
+
|
|
19
|
+
### 🎉 New features
|
|
20
|
+
|
|
21
|
+
- Improve fingerprint sourcing scope for local config-plugins. ([#24520](https://github.com/expo/expo/pull/24520) by [@kudo](https://github.com/kudo))
|
|
22
|
+
|
|
23
|
+
## 0.2.0 — 2023-09-08
|
|
24
|
+
|
|
25
|
+
### 🛠 Breaking changes
|
|
26
|
+
|
|
27
|
+
- Normalize Expo config and remove `runtimeVersion` from fingerprint. Note that the fingerprint result will be changed from this version. ([#24290](https://github.com/expo/expo/pull/24290) by [@Kudo](https://github.com/kudo))
|
|
28
|
+
|
|
29
|
+
### 🎉 New features
|
|
30
|
+
|
|
31
|
+
- Added `options.ignorePaths` and **.fingerprintignore** to support. ([#24265](https://github.com/expo/expo/pull/24265) by [@Kudo](https://github.com/kudo))
|
|
32
|
+
|
|
13
33
|
## 0.1.0 — 2023-08-29
|
|
14
34
|
|
|
15
35
|
### 🛠 Breaking changes
|
package/README.md
CHANGED
|
@@ -116,3 +116,73 @@ console.log(result);
|
|
|
116
116
|
## CLI Usage
|
|
117
117
|
|
|
118
118
|
`npx @expo/fingerprint /path/to/projectRoot`
|
|
119
|
+
|
|
120
|
+
## Limitations
|
|
121
|
+
|
|
122
|
+
## Limited support for [config-plugins raw functions](https://docs.expo.dev/config-plugins/plugins-and-mods/#raw-functions)
|
|
123
|
+
|
|
124
|
+
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.
|
|
125
|
+
|
|
126
|
+
To work around this limitation, Expo employs one of the following strategies to create serializable fingerprints for raw functions:
|
|
127
|
+
|
|
128
|
+
1. **Using `Function.name`**: Expo utilizes the `Function.name` property if available for named raw functions. This property provides a recognizable name for the function, which can be used as a fingerprint property.
|
|
129
|
+
|
|
130
|
+
2. **Using `withAnonymous`**: For anonymous raw functions without a `Function.name`, Expo resorts to using 'withAnonymous' as the fingerprint property. This is a generic identifier for anonymous functions.
|
|
131
|
+
|
|
132
|
+
Here's an example to illustrate these concepts:
|
|
133
|
+
|
|
134
|
+
```javascript
|
|
135
|
+
// In app.config.js
|
|
136
|
+
const { withInfoPlist } = require('expo/config-plugins');
|
|
137
|
+
|
|
138
|
+
const withMyPlugin = (config) => {
|
|
139
|
+
return withInfoPlist(config, (config) => {
|
|
140
|
+
config.modResults.NSLocationWhenInUseUsageDescription = 'Allow $(PRODUCT_NAME) to use your location';
|
|
141
|
+
return config;
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export default ({ config }) => {
|
|
146
|
+
config.plugins ||= [];
|
|
147
|
+
config.plugins.push(withMyPlugin);
|
|
148
|
+
config.plugins.push((config) => config);
|
|
149
|
+
return config;
|
|
150
|
+
};`
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
In this example, Expo will use ['withMyPlugin', 'withAnonymous'] as plugin properties for fingerprint hashing.
|
|
154
|
+
|
|
155
|
+
It's important to note that due to this design, if you make changes to the implementation of raw config-plugins functions, such as altering the Info.plist value within 'withMyPlugin', the fingerprint will still generate the same hash value. To ensure unique fingerprints when modifying config-plugins implementations, consider the following options:
|
|
156
|
+
|
|
157
|
+
- **Avoid Anonymous Functions**: Avoid using anonymous raw config-plugins functions. Instead, use named functions whenever possible, and ensure that their names remain consistent as long as the implementation changes.
|
|
158
|
+
|
|
159
|
+
- **Use Local config-plugins**: Alternatively, you can create local config-plugins as separate modules, each with its own export. This approach allows you to specify a different function name when making changes to the config-plugins implementations.
|
|
160
|
+
|
|
161
|
+
Here's an example of using a local config-plugin:
|
|
162
|
+
|
|
163
|
+
```javascript
|
|
164
|
+
// In ./plugins/withMyPlugin.js
|
|
165
|
+
const { withInfoPlist } = require('expo/config-plugins');
|
|
166
|
+
|
|
167
|
+
const withMyPlugin = (config) => {
|
|
168
|
+
return withInfoPlist(config, (config) => {
|
|
169
|
+
config.modResults.NSLocationWhenInUseUsageDescription =
|
|
170
|
+
'Allow $(PRODUCT_NAME) to use your location';
|
|
171
|
+
return config;
|
|
172
|
+
});
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
module.exports = withMyPlugin;
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
```json
|
|
179
|
+
// in app.json
|
|
180
|
+
{
|
|
181
|
+
"expo": {
|
|
182
|
+
// ...
|
|
183
|
+
"plugins": "./plugins/withMyPlugin"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
By following these guidelines, you can effectively manage changes to config-plugins and ensure that fingerprinting remains consistent and reliable.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import spawnAsync from '@expo/spawn-async';
|
|
2
|
+
import { getConfig } from 'expo/config';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
5
|
+
type SpawnAsyncType = typeof spawnAsync;
|
|
6
|
+
|
|
7
|
+
const origSpawnAsync = jest.requireActual('@expo/spawn-async') as SpawnAsyncType;
|
|
8
|
+
const mockSpawnAsync = jest
|
|
9
|
+
.fn()
|
|
10
|
+
.mockImplementation(
|
|
11
|
+
async (
|
|
12
|
+
command: Parameters<SpawnAsyncType>[0],
|
|
13
|
+
args: Parameters<SpawnAsyncType>[1],
|
|
14
|
+
options: Parameters<SpawnAsyncType>[2]
|
|
15
|
+
) => {
|
|
16
|
+
if (args != null && args.length >= 2 && path.parse(args[0]).name === 'ExpoConfigLoader') {
|
|
17
|
+
// For unit tests, we don't really spawn a process to execute the ExpoConfigLoader because the file system is just a memfs.
|
|
18
|
+
// Rather than that, we just call `getConfig` directly.
|
|
19
|
+
const projectRoot = args[1];
|
|
20
|
+
const config = await getConfig(projectRoot, { skipSDKVersionRequirement: true });
|
|
21
|
+
const stdout = JSON.stringify({ config, loadedModules: [] });
|
|
22
|
+
return {
|
|
23
|
+
stdout,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return origSpawnAsync(command, args, options);
|
|
27
|
+
}
|
|
28
|
+
) as SpawnAsyncType;
|
|
29
|
+
|
|
30
|
+
module.exports = mockSpawnAsync;
|
package/__mocks__/fs/promises.ts
CHANGED
|
@@ -1,2 +1,17 @@
|
|
|
1
1
|
import { fs } from 'memfs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Further mock `fs.promises` to ensure the parent directory exists.
|
|
6
|
+
* We used to call `fs.promises.mkdtemp(path.join(os.tmpdir(), ...))`, so that we don't have to worry about os.tmpdir() exists.
|
|
7
|
+
*/
|
|
8
|
+
const origMkdtemp = fs.promises.mkdtemp;
|
|
9
|
+
fs.promises.mkdtemp = (
|
|
10
|
+
prefix: string,
|
|
11
|
+
options?: Parameters<typeof origMkdtemp>[1]
|
|
12
|
+
): ReturnType<typeof origMkdtemp> => {
|
|
13
|
+
fs.mkdirSync(path.dirname(prefix), { recursive: true });
|
|
14
|
+
return origMkdtemp(prefix, options);
|
|
15
|
+
};
|
|
16
|
+
|
|
2
17
|
module.exports = fs.promises;
|
package/build/Fingerprint.js
CHANGED
|
@@ -10,7 +10,7 @@ const Sourcer_1 = require("./sourcer/Sourcer");
|
|
|
10
10
|
* Create a fingerprint from project
|
|
11
11
|
*/
|
|
12
12
|
async function createFingerprintAsync(projectRoot, options) {
|
|
13
|
-
const opts = (0, Options_1.
|
|
13
|
+
const opts = await (0, Options_1.normalizeOptionsAsync)(projectRoot, options);
|
|
14
14
|
const sources = await (0, Sourcer_1.getHashSourcesAsync)(projectRoot, opts);
|
|
15
15
|
const normalizedSources = (0, Sort_1.sortSources)((0, Dedup_1.dedupSources)(sources, projectRoot));
|
|
16
16
|
const fingerprint = await (0, Hash_1.createFingerprintFromSourcesAsync)(normalizedSources, projectRoot, opts);
|
package/build/Fingerprint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fingerprint.js","sourceRoot":"","sources":["../src/Fingerprint.ts"],"names":[],"mappings":";;;AAAA,mCAAuC;AAEvC,
|
|
1
|
+
{"version":3,"file":"Fingerprint.js","sourceRoot":"","sources":["../src/Fingerprint.ts"],"names":[],"mappings":";;;AAAA,mCAAuC;AAEvC,uCAAkD;AAClD,iCAAqC;AACrC,sCAAgE;AAChE,+CAAwD;AAExD;;GAEG;AACI,KAAK,UAAU,sBAAsB,CAC1C,WAAmB,EACnB,OAAiB;IAEjB,MAAM,IAAI,GAAG,MAAM,IAAA,+BAAqB,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,MAAM,IAAA,6BAAmB,EAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAC7D,MAAM,iBAAiB,GAAG,IAAA,kBAAW,EAAC,IAAA,oBAAY,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;IAC1E,MAAM,WAAW,GAAG,MAAM,IAAA,wCAAiC,EAAC,iBAAiB,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;IAClG,OAAO,WAAW,CAAC;AACrB,CAAC;AATD,wDASC;AAED;;GAEG;AACI,KAAK,UAAU,sBAAsB,CAC1C,WAAmB,EACnB,OAAiB;IAEjB,MAAM,WAAW,GAAG,MAAM,sBAAsB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACvE,OAAO,WAAW,CAAC,IAAI,CAAC;AAC1B,CAAC;AAND,wDAMC;AAED;;GAEG;AACI,KAAK,UAAU,2BAA2B,CAC/C,WAAwB,EACxB,WAAmB,EACnB,OAAiB;IAEjB,MAAM,cAAc,GAAG,MAAM,sBAAsB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC1E,IAAI,WAAW,CAAC,IAAI,KAAK,cAAc,CAAC,IAAI,EAAE;QAC5C,OAAO,EAAE,CAAC;KACX;IACD,OAAO,gBAAgB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;AACvD,CAAC;AAVD,kEAUC;AAED;;GAEG;AACH,SAAgB,gBAAgB,CAC9B,YAAyB,EACzB,YAAyB;IAEzB,OAAO,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7C,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAC/B,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,CACnE,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AATD,4CASC"}
|
|
@@ -33,8 +33,19 @@ export interface Options {
|
|
|
33
33
|
/**
|
|
34
34
|
* Excludes directories from hashing. This supported pattern is as `glob()`.
|
|
35
35
|
* Default is `['android/build', 'android/app/build', 'android/app/.cxx', 'ios/Pods']`.
|
|
36
|
+
* @deprecated Use `ignorePaths` instead.
|
|
36
37
|
*/
|
|
37
38
|
dirExcludes?: string[];
|
|
39
|
+
/**
|
|
40
|
+
* Ignore files and directories from hashing. This supported pattern is as `glob()`.
|
|
41
|
+
*
|
|
42
|
+
* Please note that the pattern matching is slightly different from gitignore. For example, we don't support partial matching where `build` does not match `android/build`. You should use `'**' + '/build'` instead.
|
|
43
|
+
* @see [minimatch implementations](https://github.com/isaacs/minimatch#comparisons-to-other-fnmatchglob-implementations) for more reference.
|
|
44
|
+
*
|
|
45
|
+
* Besides this `ignorePaths`, fingerprint comes with implicit default ignorePaths defined in `Options.DEFAULT_IGNORE_PATHS`.
|
|
46
|
+
* If you want to override the default ignorePaths, use `!` prefix.
|
|
47
|
+
*/
|
|
48
|
+
ignorePaths?: string[];
|
|
38
49
|
/**
|
|
39
50
|
* Additional sources for hashing.
|
|
40
51
|
*/
|
|
@@ -44,7 +55,7 @@ export interface NormalizedOptions extends Options {
|
|
|
44
55
|
platforms: NonNullable<Options['platforms']>;
|
|
45
56
|
concurrentIoLimit: NonNullable<Options['concurrentIoLimit']>;
|
|
46
57
|
hashAlgorithm: NonNullable<Options['hashAlgorithm']>;
|
|
47
|
-
|
|
58
|
+
ignorePaths: NonNullable<Options['ignorePaths']>;
|
|
48
59
|
}
|
|
49
60
|
export interface HashSourceFile {
|
|
50
61
|
type: 'file';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fingerprint.types.js","sourceRoot":"","sources":["../src/Fingerprint.types.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"Fingerprint.types.js","sourceRoot":"","sources":["../src/Fingerprint.types.ts"],"names":[],"mappings":";;AA6GA,YAAY"}
|
package/build/Options.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import type { NormalizedOptions, Options } from './Fingerprint.types';
|
|
2
|
-
export declare
|
|
2
|
+
export declare const FINGERPRINT_IGNORE_FILENAME = ".fingerprintignore";
|
|
3
|
+
export declare const DEFAULT_IGNORE_PATHS: string[];
|
|
4
|
+
export declare function normalizeOptionsAsync(projectRoot: string, options?: Options): Promise<NormalizedOptions>;
|
package/build/Options.js
CHANGED
|
@@ -3,21 +3,75 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.normalizeOptionsAsync = exports.DEFAULT_IGNORE_PATHS = exports.FINGERPRINT_IGNORE_FILENAME = void 0;
|
|
7
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
7
8
|
const os_1 = __importDefault(require("os"));
|
|
8
|
-
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
exports.FINGERPRINT_IGNORE_FILENAME = '.fingerprintignore';
|
|
11
|
+
exports.DEFAULT_IGNORE_PATHS = [
|
|
12
|
+
exports.FINGERPRINT_IGNORE_FILENAME,
|
|
13
|
+
'**/android/build/**/*',
|
|
14
|
+
'**/android/app/build/**/*',
|
|
15
|
+
'**/android/app/.cxx/**/*',
|
|
16
|
+
'**/ios/Pods/**/*',
|
|
17
|
+
// Ignore all expo configs because we will read expo config in a HashSourceContents already
|
|
18
|
+
'app.config.ts',
|
|
19
|
+
'app.config.js',
|
|
20
|
+
'app.config.json',
|
|
21
|
+
'app.json',
|
|
22
|
+
// Ignore default javascript files when calling `getConfig()`
|
|
23
|
+
'**/node_modules/@babel/**/*',
|
|
24
|
+
'**/node_modules/@expo/**/*',
|
|
25
|
+
'**/node_modules/@jridgewell/**/*',
|
|
26
|
+
'**/node_modules/expo/config.js',
|
|
27
|
+
'**/node_modules/expo/config-plugins.js',
|
|
28
|
+
`**/node_modules/{${[
|
|
29
|
+
'debug',
|
|
30
|
+
'escape-string-regexp',
|
|
31
|
+
'getenv',
|
|
32
|
+
'graceful-fs',
|
|
33
|
+
'has-flag',
|
|
34
|
+
'imurmurhash',
|
|
35
|
+
'js-tokens',
|
|
36
|
+
'json5',
|
|
37
|
+
'lines-and-columns',
|
|
38
|
+
'require-from-string',
|
|
39
|
+
'resolve-from',
|
|
40
|
+
'signal-exit',
|
|
41
|
+
'sucrase',
|
|
42
|
+
'supports-color',
|
|
43
|
+
'ts-interface-checker',
|
|
44
|
+
'write-file-atomic',
|
|
45
|
+
].join(',')}}/**/*`,
|
|
46
|
+
];
|
|
47
|
+
async function normalizeOptionsAsync(projectRoot, options) {
|
|
9
48
|
return {
|
|
10
49
|
...options,
|
|
11
50
|
platforms: options?.platforms ?? ['android', 'ios'],
|
|
12
51
|
concurrentIoLimit: options?.concurrentIoLimit ?? os_1.default.cpus().length,
|
|
13
52
|
hashAlgorithm: options?.hashAlgorithm ?? 'sha1',
|
|
14
|
-
|
|
15
|
-
'**/android/build',
|
|
16
|
-
'**/android/app/build',
|
|
17
|
-
'**/android/app/.cxx',
|
|
18
|
-
'ios/Pods',
|
|
19
|
-
],
|
|
53
|
+
ignorePaths: await collectIgnorePathsAsync(projectRoot, options),
|
|
20
54
|
};
|
|
21
55
|
}
|
|
22
|
-
exports.
|
|
56
|
+
exports.normalizeOptionsAsync = normalizeOptionsAsync;
|
|
57
|
+
async function collectIgnorePathsAsync(projectRoot, options) {
|
|
58
|
+
const ignorePaths = [
|
|
59
|
+
...exports.DEFAULT_IGNORE_PATHS,
|
|
60
|
+
...(options?.ignorePaths ?? []),
|
|
61
|
+
...(options?.dirExcludes?.map((dirExclude) => `${dirExclude}/**/*`) ?? []),
|
|
62
|
+
];
|
|
63
|
+
const fingerprintIgnorePath = path_1.default.join(projectRoot, exports.FINGERPRINT_IGNORE_FILENAME);
|
|
64
|
+
try {
|
|
65
|
+
const fingerprintIgnore = await promises_1.default.readFile(fingerprintIgnorePath, 'utf8');
|
|
66
|
+
const fingerprintIgnoreLines = fingerprintIgnore.split('\n');
|
|
67
|
+
for (const line of fingerprintIgnoreLines) {
|
|
68
|
+
const trimmedLine = line.trim();
|
|
69
|
+
if (trimmedLine) {
|
|
70
|
+
ignorePaths.push(trimmedLine);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
catch { }
|
|
75
|
+
return ignorePaths;
|
|
76
|
+
}
|
|
23
77
|
//# sourceMappingURL=Options.js.map
|
package/build/Options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Options.js","sourceRoot":"","sources":["../src/Options.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;
|
|
1
|
+
{"version":3,"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E,WAAW,EAAE,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,GAAG,UAAU,OAAO,CAAC,IAAI,EAAE,CAAC;KAC3E,CAAC;IAEF,MAAM,qBAAqB,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,mCAA2B,CAAC,CAAC;IAClF,IAAI;QACF,MAAM,iBAAiB,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;QAC3E,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC7D,KAAK,MAAM,IAAI,IAAI,sBAAsB,EAAE;YACzC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;YAChC,IAAI,WAAW,EAAE;gBACf,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;aAC/B;SACF;KACF;IAAC,MAAM,GAAE;IAEV,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
package/build/hash/Hash.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare function createFingerprintSourceAsync(source: HashSource, limiter
|
|
|
12
12
|
/**
|
|
13
13
|
* Create a `HashResult` from a file
|
|
14
14
|
*/
|
|
15
|
-
export declare function createFileHashResultsAsync(filePath: string, limiter: pLimit.Limit, projectRoot: string, options: NormalizedOptions): Promise<HashResult>;
|
|
15
|
+
export declare function createFileHashResultsAsync(filePath: string, limiter: pLimit.Limit, projectRoot: string, options: NormalizedOptions): Promise<HashResult | null>;
|
|
16
16
|
/**
|
|
17
17
|
* Create `HashResult` for a dir.
|
|
18
18
|
* If the dir is excluded, returns null rather than a HashResult
|
package/build/hash/Hash.js
CHANGED
|
@@ -7,9 +7,9 @@ exports.createSourceId = exports.createContentsHashResultsAsync = exports.create
|
|
|
7
7
|
const crypto_1 = require("crypto");
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
9
|
const promises_1 = __importDefault(require("fs/promises"));
|
|
10
|
-
const minimatch_1 = __importDefault(require("minimatch"));
|
|
11
10
|
const p_limit_1 = __importDefault(require("p-limit"));
|
|
12
11
|
const path_1 = __importDefault(require("path"));
|
|
12
|
+
const Path_1 = require("../utils/Path");
|
|
13
13
|
const Profile_1 = require("../utils/Profile");
|
|
14
14
|
/**
|
|
15
15
|
* Create a `Fingerprint` from `HashSources` array
|
|
@@ -60,6 +60,10 @@ async function createFileHashResultsAsync(filePath, limiter, projectRoot, option
|
|
|
60
60
|
// Backup code for faster hashing
|
|
61
61
|
/*
|
|
62
62
|
return limiter(async () => {
|
|
63
|
+
if (isIgnoredPath(filePath, options.ignorePaths)) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
|
|
63
67
|
const hasher = createHash(options.hashAlgorithm);
|
|
64
68
|
|
|
65
69
|
const stat = await fs.stat(filePath);
|
|
@@ -76,6 +80,9 @@ async function createFileHashResultsAsync(filePath, limiter, projectRoot, option
|
|
|
76
80
|
*/
|
|
77
81
|
return limiter(() => {
|
|
78
82
|
return new Promise((resolve, reject) => {
|
|
83
|
+
if ((0, Path_1.isIgnoredPath)(filePath, options.ignorePaths)) {
|
|
84
|
+
return resolve(null);
|
|
85
|
+
}
|
|
79
86
|
let resolved = false;
|
|
80
87
|
const hasher = (0, crypto_1.createHash)(options.hashAlgorithm);
|
|
81
88
|
const stream = (0, fs_1.createReadStream)(path_1.default.join(projectRoot, filePath));
|
|
@@ -96,23 +103,12 @@ async function createFileHashResultsAsync(filePath, limiter, projectRoot, option
|
|
|
96
103
|
});
|
|
97
104
|
}
|
|
98
105
|
exports.createFileHashResultsAsync = createFileHashResultsAsync;
|
|
99
|
-
/**
|
|
100
|
-
* Indicate the given `dirPath` should be excluded by `dirExcludes`
|
|
101
|
-
*/
|
|
102
|
-
function isExcludedDir(dirPath, dirExcludes) {
|
|
103
|
-
for (const exclude of dirExcludes) {
|
|
104
|
-
if ((0, minimatch_1.default)(dirPath, exclude)) {
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
106
|
/**
|
|
111
107
|
* Create `HashResult` for a dir.
|
|
112
108
|
* If the dir is excluded, returns null rather than a HashResult
|
|
113
109
|
*/
|
|
114
110
|
async function createDirHashResultsAsync(dirPath, limiter, projectRoot, options, depth = 0) {
|
|
115
|
-
if (
|
|
111
|
+
if ((0, Path_1.isIgnoredPath)(dirPath, options.ignorePaths)) {
|
|
116
112
|
return null;
|
|
117
113
|
}
|
|
118
114
|
const dirents = (await promises_1.default.readdir(path_1.default.join(projectRoot, dirPath), { withFileTypes: true })).sort((a, b) => a.name.localeCompare(b.name));
|
|
@@ -128,12 +124,13 @@ async function createDirHashResultsAsync(dirPath, limiter, projectRoot, options,
|
|
|
128
124
|
}
|
|
129
125
|
}
|
|
130
126
|
const hasher = (0, crypto_1.createHash)(options.hashAlgorithm);
|
|
131
|
-
const results = await Promise.all(promises);
|
|
127
|
+
const results = (await Promise.all(promises)).filter((result) => result != null);
|
|
128
|
+
if (results.length === 0) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
132
131
|
for (const result of results) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
hasher.update(result.hex);
|
|
136
|
-
}
|
|
132
|
+
hasher.update(result.id);
|
|
133
|
+
hasher.update(result.hex);
|
|
137
134
|
}
|
|
138
135
|
const hex = hasher.digest('hex');
|
|
139
136
|
return { id: dirPath, hex };
|
package/build/hash/Hash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hash.js","sourceRoot":"","sources":["../../src/hash/Hash.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAoC;AACpC,2BAAsC;AACtC,2DAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"Hash.js","sourceRoot":"","sources":["../../src/hash/Hash.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAoC;AACpC,2BAAsC;AACtC,2DAA6B;AAC7B,sDAA6B;AAC7B,gDAAwB;AAUxB,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Q,MAAM,CAAC,IAAI,EAAE;QACnB,KAAK,UAAU;YACb,OAAO,MAAM,CAAC,EAAE,CAAC;QACnB,KAAK,MAAM;YACT,OAAO,MAAM,CAAC,QAAQ,CAAC;QACzB,KAAK,KAAK;YACR,OAAO,MAAM,CAAC,QAAQ,CAAC;QACzB;YACE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;KAC9C;AACH,CAAC;AAXD,wCAWC"}
|
package/build/sourcer/Expo.js
CHANGED
|
@@ -5,34 +5,40 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.sortExpoAutolinkingAndroidConfig = exports.getExpoAutolinkingIosSourcesAsync = exports.getExpoAutolinkingAndroidSourcesAsync = exports.getEasBuildSourcesAsync = exports.getExpoConfigSourcesAsync = void 0;
|
|
7
7
|
const spawn_async_1 = __importDefault(require("@expo/spawn-async"));
|
|
8
|
-
const assert_1 = __importDefault(require("assert"));
|
|
9
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
-
const
|
|
9
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
10
|
+
const os_1 = __importDefault(require("os"));
|
|
11
11
|
const path_1 = __importDefault(require("path"));
|
|
12
12
|
const resolve_from_1 = __importDefault(require("resolve-from"));
|
|
13
|
+
const ExpoConfigLoader_1 = require("./ExpoConfigLoader");
|
|
13
14
|
const Utils_1 = require("./Utils");
|
|
14
15
|
const debug = require('debug')('expo:fingerprint:sourcer:Expo');
|
|
15
16
|
async function getExpoConfigSourcesAsync(projectRoot, options) {
|
|
17
|
+
if (!resolve_from_1.default.silent(path_1.default.resolve(projectRoot), 'expo/config')) {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
const results = [];
|
|
16
21
|
let config;
|
|
22
|
+
let loadedModules = [];
|
|
23
|
+
const ignoredFile = await createTempIgnoredFileAsync(options);
|
|
17
24
|
try {
|
|
18
|
-
const {
|
|
19
|
-
|
|
25
|
+
const { stdout } = await (0, spawn_async_1.default)('node', [(0, ExpoConfigLoader_1.getExpoConfigLoaderPath)(), path_1.default.resolve(projectRoot), ignoredFile], { cwd: __dirname });
|
|
26
|
+
const stdoutJson = JSON.parse(stdout);
|
|
27
|
+
config = stdoutJson.config;
|
|
28
|
+
loadedModules = stdoutJson.loadedModules;
|
|
29
|
+
results.push({
|
|
30
|
+
type: 'contents',
|
|
31
|
+
id: 'expoConfig',
|
|
32
|
+
contents: normalizeExpoConfig(config.exp),
|
|
33
|
+
reasons: ['expoConfig'],
|
|
34
|
+
});
|
|
20
35
|
}
|
|
21
36
|
catch (e) {
|
|
22
|
-
|
|
37
|
+
if (e instanceof Error) {
|
|
38
|
+
console.warn(`Cannot get Expo config from an Expo project - ${e.message}: `, e.stack);
|
|
39
|
+
}
|
|
23
40
|
return [];
|
|
24
41
|
}
|
|
25
|
-
const results = [];
|
|
26
|
-
// app config files
|
|
27
|
-
const configFiles = ['app.config.ts', 'app.config.js', 'app.config.json', 'app.json'];
|
|
28
|
-
const configFileSources = (await Promise.all(configFiles.map(async (file) => {
|
|
29
|
-
const result = await (0, Utils_1.getFileBasedHashSourceAsync)(projectRoot, file, 'expoConfig');
|
|
30
|
-
if (result != null) {
|
|
31
|
-
debug(`Adding config file - ${chalk_1.default.dim(file)}`);
|
|
32
|
-
}
|
|
33
|
-
return result;
|
|
34
|
-
}))).filter(Boolean);
|
|
35
|
-
results.push(...configFileSources);
|
|
36
42
|
// external files in config
|
|
37
43
|
const isAndroid = options.platforms.includes('android');
|
|
38
44
|
const isIos = options.platforms.includes('ios');
|
|
@@ -67,38 +73,30 @@ async function getExpoConfigSourcesAsync(projectRoot, options) {
|
|
|
67
73
|
}))).filter(Boolean);
|
|
68
74
|
results.push(...externalFileSources);
|
|
69
75
|
// config plugins
|
|
70
|
-
const
|
|
71
|
-
|
|
76
|
+
const configPluginModules = loadedModules.map((modulePath) => ({
|
|
77
|
+
type: 'file',
|
|
78
|
+
filePath: modulePath,
|
|
79
|
+
reasons: ['expoConfigPlugins'],
|
|
80
|
+
}));
|
|
81
|
+
results.push(...configPluginModules);
|
|
72
82
|
return results;
|
|
73
83
|
}
|
|
74
84
|
exports.getExpoConfigSourcesAsync = getExpoConfigSourcesAsync;
|
|
75
|
-
function
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
85
|
+
function normalizeExpoConfig(config) {
|
|
86
|
+
// Deep clone by JSON.parse/stringify that assumes the config is serializable.
|
|
87
|
+
const normalizedConfig = JSON.parse(JSON.stringify(config));
|
|
88
|
+
delete normalizedConfig.runtimeVersion;
|
|
89
|
+
delete normalizedConfig._internal;
|
|
90
|
+
return (0, Utils_1.stringifyJsonSorted)(normalizedConfig);
|
|
80
91
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const pluginPackageEntryFile = resolve_from_1.default.silent(projectRoot, pluginPackageName);
|
|
90
|
-
const pluginPackageRoot = pluginPackageEntryFile
|
|
91
|
-
? findUpPluginRoot(pluginPackageEntryFile)
|
|
92
|
-
: null;
|
|
93
|
-
if (pluginPackageRoot) {
|
|
94
|
-
debug(`Adding config-plugin root - ${chalk_1.default.dim(pluginPackageRoot)}`);
|
|
95
|
-
return { type: 'dir', filePath: path_1.default.relative(projectRoot, pluginPackageRoot), reasons };
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return null;
|
|
99
|
-
});
|
|
100
|
-
const results = nullableResults.filter(Boolean);
|
|
101
|
-
return results;
|
|
92
|
+
/**
|
|
93
|
+
* Create a temporary file with ignored paths from options that will be read by the ExpoConfigLoader.
|
|
94
|
+
*/
|
|
95
|
+
async function createTempIgnoredFileAsync(options) {
|
|
96
|
+
await promises_1.default.mkdtemp(path_1.default.join(os_1.default.tmpdir(), 'expo-fingerprint-'));
|
|
97
|
+
const ignoredFile = path_1.default.join(os_1.default.tmpdir(), '.fingerprintignore');
|
|
98
|
+
await promises_1.default.writeFile(ignoredFile, options.ignorePaths.join('\n'));
|
|
99
|
+
return ignoredFile;
|
|
102
100
|
}
|
|
103
101
|
async function getEasBuildSourcesAsync(projectRoot, options) {
|
|
104
102
|
const files = ['eas.json', '.easignore'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Expo.js","sourceRoot":"","sources":["../../src/sourcer/Expo.ts"],"names":[],"mappings":";;;;;;AAAA,oEAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"Expo.js","sourceRoot":"","sources":["../../src/sourcer/Expo.ts"],"names":[],"mappings":";;;;;;AAAA,oEAA2C;AAC3C,kDAA0B;AAE1B,2DAA6B;AAC7B,4CAAoB;AACpB,gDAAwB;AACxB,gEAAuC;AAEvC,yDAA6D;AAC7D,mCAA2E;AAG3E,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,+BAA+B,CAAC,CAAC;AAEzD,KAAK,UAAU,yBAAyB,CAC7C,WAAmB,EACnB,OAA0B;IAE1B,IAAI,CAAC,sBAAW,CAAC,MAAM,CAAC,cAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC,EAAE;QACjE,OAAO,EAAE,CAAC;KACX;IAED,MAAM,OAAO,GAAiB,EAAE,CAAC;IACjC,IAAI,MAAqB,CAAC;IAC1B,IAAI,aAAa,GAAa,EAAE,CAAC;IACjC,MAAM,WAAW,GAAG,MAAM,0BAA0B,CAAC,OAAO,CAAC,CAAC;IAC9D,IAAI;QACF,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAA,qBAAU,EACjC,MAAM,EACN,CAAC,IAAA,0CAAuB,GAAE,EAAE,cAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,EACnE,EAAE,GAAG,EAAE,SAAS,EAAE,CACnB,CAAC;QACF,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,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