@expo/fingerprint 0.20.11 → 0.21.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/build/Config.js +69 -44
- package/build/Config.js.map +1 -1
- package/build/Dedup.js +82 -36
- package/build/Dedup.js.map +1 -1
- package/build/ExpoConfig.d.ts +11 -2
- package/build/ExpoConfig.js +118 -34
- package/build/ExpoConfig.js.map +1 -1
- package/build/ExpoConfigLoader.d.ts +41 -0
- package/build/ExpoConfigLoader.js +185 -145
- package/build/ExpoConfigLoader.js.map +1 -1
- package/build/ExpoResolver.js +77 -43
- package/build/ExpoResolver.js.map +1 -1
- package/build/Fingerprint.js +67 -76
- package/build/Fingerprint.js.map +1 -1
- package/build/Fingerprint.types.d.ts +98 -5
- package/build/Fingerprint.types.js +6 -3
- package/build/Fingerprint.types.js.map +1 -1
- package/build/Options.d.ts +1 -2
- package/build/Options.js +101 -49
- package/build/Options.js.map +1 -1
- package/build/Presets.d.ts +24 -0
- package/build/Presets.js +50 -0
- package/build/Presets.js.map +1 -0
- package/build/ProjectWorkflow.js +135 -69
- package/build/ProjectWorkflow.js.map +1 -1
- package/build/Sort.js +30 -16
- package/build/Sort.js.map +1 -1
- package/build/hash/FileHookTransform.js +26 -20
- package/build/hash/FileHookTransform.js.map +1 -1
- package/build/hash/Hash.d.ts +8 -1
- package/build/hash/Hash.js +204 -116
- package/build/hash/Hash.js.map +1 -1
- package/build/hash/ReactImportsPatcher.js +39 -27
- package/build/hash/ReactImportsPatcher.js.map +1 -1
- package/build/index.js +40 -22
- package/build/index.js.map +1 -1
- package/build/sourcer/Bare.js +184 -93
- package/build/sourcer/Bare.js.map +1 -1
- package/build/sourcer/Expo.d.ts +3 -2
- package/build/sourcer/Expo.js +250 -119
- package/build/sourcer/Expo.js.map +1 -1
- package/build/sourcer/Packages.d.ts +4 -3
- package/build/sourcer/Packages.js +83 -23
- package/build/sourcer/Packages.js.map +1 -1
- package/build/sourcer/PatchPackage.js +32 -14
- package/build/sourcer/PatchPackage.js.map +1 -1
- package/build/sourcer/SourceSkips.d.ts +18 -2
- package/build/sourcer/SourceSkips.js +53 -45
- package/build/sourcer/SourceSkips.js.map +1 -1
- package/build/sourcer/Sourcer.js +57 -38
- package/build/sourcer/Sourcer.js.map +1 -1
- package/build/sourcer/Utils.d.ts +14 -0
- package/build/sourcer/Utils.js +113 -41
- package/build/sourcer/Utils.js.map +1 -1
- package/build/types/module.d.ts +7 -0
- package/build/utils/Concurrency.js +29 -22
- package/build/utils/Concurrency.js.map +1 -1
- package/build/utils/Path.d.ts +5 -0
- package/build/utils/Path.js +138 -75
- package/build/utils/Path.js.map +1 -1
- package/build/utils/Predicates.js +11 -3
- package/build/utils/Predicates.js.map +1 -1
- package/build/utils/Profile.js +29 -20
- package/build/utils/Profile.js.map +1 -1
- package/build/utils/SpawnIPC.js +41 -16
- package/build/utils/SpawnIPC.js.map +1 -1
- package/cli/build/cli.js +94 -60
- package/cli/build/cli.js.map +1 -0
- package/cli/build/commands/diffFingerprints.js +76 -53
- package/cli/build/commands/diffFingerprints.js.map +1 -0
- package/cli/build/commands/generateFingerprint.js +129 -72
- package/cli/build/commands/generateFingerprint.js.map +1 -0
- package/cli/build/runLegacyCLIAsync.js +31 -22
- package/cli/build/runLegacyCLIAsync.js.map +1 -0
- package/cli/build/utils/args.js +110 -67
- package/cli/build/utils/args.js.map +1 -0
- package/cli/build/utils/errors.js +49 -20
- package/cli/build/utils/errors.js.map +1 -0
- package/cli/build/utils/log.js +62 -20
- package/cli/build/utils/log.js.map +1 -0
- package/cli/build/utils/readFingerprintFileAsync.js +25 -9
- package/cli/build/utils/readFingerprintFileAsync.js.map +1 -0
- package/cli/build/utils/withConsoleDisabledAsync.js +16 -8
- package/cli/build/utils/withConsoleDisabledAsync.js.map +1 -0
- package/package.json +37 -31
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ConfigPluginSourceType, FingerprintPreset, NativeModuleSourceType } from './Fingerprint.types';
|
|
2
|
+
import { SourceSkips } from './sourcer/SourceSkips';
|
|
3
|
+
export interface ResolvedPreset {
|
|
4
|
+
sourceSkips: SourceSkips;
|
|
5
|
+
nativeModuleSourceType: NativeModuleSourceType;
|
|
6
|
+
configPluginSourceType: ConfigPluginSourceType;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The preset used when a project doesn't configure one.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_PRESET: FingerprintPreset;
|
|
12
|
+
/**
|
|
13
|
+
* Resolve a preset name to the settings it stands for.
|
|
14
|
+
*
|
|
15
|
+
* - `strict`: highest fidelity - the historical default. Only skips prebuild-mutated package.json
|
|
16
|
+
* scripts so a fingerprint stays consistent before and after prebuild.
|
|
17
|
+
* - `balanced`: the default. Also ignores app version and string runtime version churn and the EAS
|
|
18
|
+
* Build files (`eas.json` and `.easignore`), and hashes autolinked packages and node_modules
|
|
19
|
+
* config-plugin modules by their `package.json` version. Best first-time experience.
|
|
20
|
+
* - `relaxed`: for building multiple variants from one native project. Additionally ignores app
|
|
21
|
+
* names, bundle identifiers, schemes, and assets, while still hashing the config-plugins list so
|
|
22
|
+
* adding a plugin still changes the fingerprint.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolvePreset(preset: FingerprintPreset): ResolvedPreset;
|
package/build/Presets.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
0 && (module.exports = {
|
|
6
|
+
DEFAULT_PRESET: null,
|
|
7
|
+
resolvePreset: null
|
|
8
|
+
});
|
|
9
|
+
function _export(target, all) {
|
|
10
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
_export(exports, {
|
|
16
|
+
get DEFAULT_PRESET () {
|
|
17
|
+
return DEFAULT_PRESET;
|
|
18
|
+
},
|
|
19
|
+
get resolvePreset () {
|
|
20
|
+
return resolvePreset;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _SourceSkips = require("./sourcer/SourceSkips");
|
|
24
|
+
const DEFAULT_PRESET = 'balanced';
|
|
25
|
+
function resolvePreset(preset) {
|
|
26
|
+
switch(preset){
|
|
27
|
+
case 'strict':
|
|
28
|
+
return {
|
|
29
|
+
sourceSkips: _SourceSkips.SourceSkips.PackageJsonAndroidAndIosScriptsIfNotContainRun,
|
|
30
|
+
nativeModuleSourceType: 'files',
|
|
31
|
+
configPluginSourceType: 'files'
|
|
32
|
+
};
|
|
33
|
+
case 'balanced':
|
|
34
|
+
return {
|
|
35
|
+
sourceSkips: _SourceSkips.SourceSkips.PackageJsonAndroidAndIosScriptsIfNotContainRun | _SourceSkips.SourceSkips.ExpoConfigVersions | _SourceSkips.SourceSkips.ExpoConfigRuntimeVersionIfString | _SourceSkips.SourceSkips.EasJson | _SourceSkips.SourceSkips.Easignore,
|
|
36
|
+
nativeModuleSourceType: 'package',
|
|
37
|
+
configPluginSourceType: 'package'
|
|
38
|
+
};
|
|
39
|
+
case 'relaxed':
|
|
40
|
+
return {
|
|
41
|
+
sourceSkips: _SourceSkips.SourceSkips.PackageJsonAndroidAndIosScriptsIfNotContainRun | _SourceSkips.SourceSkips.ExpoConfigVersions | _SourceSkips.SourceSkips.ExpoConfigRuntimeVersionIfString | _SourceSkips.SourceSkips.EasJson | _SourceSkips.SourceSkips.Easignore | _SourceSkips.SourceSkips.ExpoConfigNames | _SourceSkips.SourceSkips.ExpoConfigAndroidPackage | _SourceSkips.SourceSkips.ExpoConfigIosBundleIdentifier | _SourceSkips.SourceSkips.ExpoConfigSchemes | _SourceSkips.SourceSkips.ExpoConfigAssets,
|
|
42
|
+
nativeModuleSourceType: 'package',
|
|
43
|
+
configPluginSourceType: 'package'
|
|
44
|
+
};
|
|
45
|
+
default:
|
|
46
|
+
throw new Error(`Invalid fingerprint preset: ${preset}. Supported presets are 'strict', 'balanced', and 'relaxed'.`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=Presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Presets.ts"],"sourcesContent":[null],"names":["DEFAULT_PRESET","resolvePreset","preset","sourceSkips","SourceSkips","PackageJsonAndroidAndIosScriptsIfNotContainRun","nativeModuleSourceType","configPluginSourceType","ExpoConfigVersions","ExpoConfigRuntimeVersionIfString","EasJson","Easignore","ExpoConfigNames","ExpoConfigAndroidPackage","ExpoConfigIosBundleIdentifier","ExpoConfigSchemes","ExpoConfigAssets","Error"],"mappings":";;;;;;;;;;;;;;;QAgBaA;eAAAA;;QAcGC;eAAAA;;;6BAzBY;AAWrB,MAAMD,iBAAoC;AAc1C,SAASC,cAAcC,MAAyB;IACrD,OAAQA;QACN,KAAK;YACH,OAAO;gBACLC,aAAaC,wBAAW,CAACC,8CAA8C;gBACvEC,wBAAwB;gBACxBC,wBAAwB;YAC1B;QACF,KAAK;YACH,OAAO;gBACLJ,aACEC,wBAAW,CAACC,8CAA8C,GAC1DD,wBAAW,CAACI,kBAAkB,GAC9BJ,wBAAW,CAACK,gCAAgC,GAC5CL,wBAAW,CAACM,OAAO,GACnBN,wBAAW,CAACO,SAAS;gBACvBL,wBAAwB;gBACxBC,wBAAwB;YAC1B;QACF,KAAK;YACH,OAAO;gBACLJ,aACEC,wBAAW,CAACC,8CAA8C,GAC1DD,wBAAW,CAACI,kBAAkB,GAC9BJ,wBAAW,CAACK,gCAAgC,GAC5CL,wBAAW,CAACM,OAAO,GACnBN,wBAAW,CAACO,SAAS,GACrBP,wBAAW,CAACQ,eAAe,GAC3BR,wBAAW,CAACS,wBAAwB,GACpCT,wBAAW,CAACU,6BAA6B,GACzCV,wBAAW,CAACW,iBAAiB,GAC7BX,wBAAW,CAACY,gBAAgB;gBAC9BV,wBAAwB;gBACxBC,wBAAwB;YAC1B;QACF;YACE,MAAM,IAAIU,MACR,CAAC,4BAA4B,EAAEf,OAAO,4DAA4D,CAAC;IAEzG;AACF"}
|
package/build/ProjectWorkflow.js
CHANGED
|
@@ -1,48 +1,89 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
0 && (module.exports = {
|
|
6
|
+
resolveProjectWorkflowAsync: null,
|
|
7
|
+
resolveProjectWorkflowPerPlatformAsync: null
|
|
8
|
+
});
|
|
9
|
+
function _export(target, all) {
|
|
10
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
_export(exports, {
|
|
16
|
+
get resolveProjectWorkflowAsync () {
|
|
17
|
+
return resolveProjectWorkflowAsync;
|
|
18
|
+
},
|
|
19
|
+
get resolveProjectWorkflowPerPlatformAsync () {
|
|
20
|
+
return resolveProjectWorkflowPerPlatformAsync;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
function _spawnasync() {
|
|
24
|
+
const data = /*#__PURE__*/ _interop_require_default(require("@expo/spawn-async"));
|
|
25
|
+
_spawnasync = function() {
|
|
26
|
+
return data;
|
|
27
|
+
};
|
|
28
|
+
return data;
|
|
29
|
+
}
|
|
30
|
+
function _promises() {
|
|
31
|
+
const data = /*#__PURE__*/ _interop_require_default(require("fs/promises"));
|
|
32
|
+
_promises = function() {
|
|
33
|
+
return data;
|
|
34
|
+
};
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
function _glob() {
|
|
38
|
+
const data = require("glob");
|
|
39
|
+
_glob = function() {
|
|
40
|
+
return data;
|
|
41
|
+
};
|
|
42
|
+
return data;
|
|
43
|
+
}
|
|
44
|
+
function _ignore() {
|
|
45
|
+
const data = /*#__PURE__*/ _interop_require_default(require("ignore"));
|
|
46
|
+
_ignore = function() {
|
|
47
|
+
return data;
|
|
48
|
+
};
|
|
49
|
+
return data;
|
|
50
|
+
}
|
|
51
|
+
function _path() {
|
|
52
|
+
const data = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
53
|
+
_path = function() {
|
|
54
|
+
return data;
|
|
55
|
+
};
|
|
56
|
+
return data;
|
|
57
|
+
}
|
|
58
|
+
const _ExpoResolver = require("./ExpoResolver");
|
|
59
|
+
const _Path = require("./utils/Path");
|
|
60
|
+
function _interop_require_default(obj) {
|
|
61
|
+
return obj && obj.__esModule ? obj : {
|
|
62
|
+
default: obj
|
|
63
|
+
};
|
|
64
|
+
}
|
|
20
65
|
async function resolveProjectWorkflowAsync(projectRoot, platform, fingerprintIgnorePaths) {
|
|
21
|
-
const configPluginsPackageRoot = (0,
|
|
66
|
+
const configPluginsPackageRoot = (0, _ExpoResolver.resolveExpoConfigPluginsPackagePath)(projectRoot);
|
|
22
67
|
if (configPluginsPackageRoot == null) {
|
|
23
68
|
return 'unknown';
|
|
24
69
|
}
|
|
25
70
|
const { AndroidConfig, IOSConfig } = require(configPluginsPackageRoot);
|
|
26
71
|
let platformWorkflowMarkers;
|
|
27
72
|
try {
|
|
28
|
-
platformWorkflowMarkers =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
73
|
+
platformWorkflowMarkers = platform === 'android' ? [
|
|
74
|
+
_path().default.join(projectRoot, 'android/app/build.gradle'),
|
|
75
|
+
await AndroidConfig.Paths.getAndroidManifestAsync(projectRoot)
|
|
76
|
+
] : [
|
|
77
|
+
IOSConfig.Paths.getPBXProjectPath(projectRoot)
|
|
78
|
+
];
|
|
79
|
+
} catch {
|
|
37
80
|
return 'managed';
|
|
38
81
|
}
|
|
39
82
|
const vcsClient = await getVCSClientAsync(projectRoot);
|
|
40
|
-
const vcsRoot =
|
|
41
|
-
for (const marker of platformWorkflowMarkers)
|
|
42
|
-
const relativeMarker = (0,
|
|
43
|
-
if (
|
|
44
|
-
!(0, Path_1.isIgnoredPathWithMatchObjects)(relativeMarker, fingerprintIgnorePaths) &&
|
|
45
|
-
!(await vcsClient.isFileIgnoredAsync(relativeMarker))) {
|
|
83
|
+
const vcsRoot = _path().default.normalize(await vcsClient.getRootPathAsync());
|
|
84
|
+
for (const marker of platformWorkflowMarkers){
|
|
85
|
+
const relativeMarker = (0, _Path.toPosixPath)(_path().default.relative(vcsRoot, marker));
|
|
86
|
+
if (await (0, _Path.pathExistsAsync)(marker) && !(0, _Path.isIgnoredPathWithMatchObjects)(relativeMarker, fingerprintIgnorePaths) && !await vcsClient.isFileIgnoredAsync(relativeMarker)) {
|
|
46
87
|
return 'generic';
|
|
47
88
|
}
|
|
48
89
|
}
|
|
@@ -51,37 +92,51 @@ async function resolveProjectWorkflowAsync(projectRoot, platform, fingerprintIgn
|
|
|
51
92
|
async function resolveProjectWorkflowPerPlatformAsync(projectRoot, fingerprintIgnorePaths) {
|
|
52
93
|
const [android, ios] = await Promise.all([
|
|
53
94
|
resolveProjectWorkflowAsync(projectRoot, 'android', fingerprintIgnorePaths),
|
|
54
|
-
resolveProjectWorkflowAsync(projectRoot, 'ios', fingerprintIgnorePaths)
|
|
95
|
+
resolveProjectWorkflowAsync(projectRoot, 'ios', fingerprintIgnorePaths)
|
|
55
96
|
]);
|
|
56
|
-
return {
|
|
97
|
+
return {
|
|
98
|
+
android,
|
|
99
|
+
ios
|
|
100
|
+
};
|
|
57
101
|
}
|
|
58
102
|
async function getVCSClientAsync(projectRoot) {
|
|
59
|
-
if (await isGitInstalledAndConfiguredAsync()) {
|
|
60
|
-
return new GitClient();
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
103
|
+
if (await isGitInstalledAndConfiguredAsync(projectRoot)) {
|
|
104
|
+
return new GitClient(projectRoot);
|
|
105
|
+
} else {
|
|
63
106
|
return new NoVCSClient(projectRoot);
|
|
64
107
|
}
|
|
65
108
|
}
|
|
66
109
|
class GitClient {
|
|
110
|
+
projectRoot;
|
|
111
|
+
constructor(projectRoot){
|
|
112
|
+
this.projectRoot = projectRoot;
|
|
113
|
+
}
|
|
67
114
|
async getRootPathAsync() {
|
|
68
|
-
return (await (0,
|
|
115
|
+
return (await (0, _spawnasync().default)('git', [
|
|
116
|
+
'rev-parse',
|
|
117
|
+
'--show-toplevel'
|
|
118
|
+
], {
|
|
119
|
+
cwd: this.projectRoot
|
|
120
|
+
})).stdout.trim();
|
|
69
121
|
}
|
|
70
122
|
async isFileIgnoredAsync(filePath) {
|
|
71
123
|
try {
|
|
72
|
-
await (0,
|
|
73
|
-
|
|
124
|
+
await (0, _spawnasync().default)('git', [
|
|
125
|
+
'check-ignore',
|
|
126
|
+
'-q',
|
|
127
|
+
filePath
|
|
128
|
+
], {
|
|
129
|
+
cwd: _path().default.normalize(await this.getRootPathAsync())
|
|
74
130
|
});
|
|
75
131
|
return true;
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
132
|
+
} catch {
|
|
78
133
|
return false;
|
|
79
134
|
}
|
|
80
135
|
}
|
|
81
136
|
}
|
|
82
137
|
class NoVCSClient {
|
|
83
138
|
projectRoot;
|
|
84
|
-
constructor(projectRoot)
|
|
139
|
+
constructor(projectRoot){
|
|
85
140
|
this.projectRoot = projectRoot;
|
|
86
141
|
}
|
|
87
142
|
async getRootPathAsync() {
|
|
@@ -93,20 +148,25 @@ class NoVCSClient {
|
|
|
93
148
|
return ignore.ignores(filePath);
|
|
94
149
|
}
|
|
95
150
|
}
|
|
96
|
-
async function isGitInstalledAndConfiguredAsync() {
|
|
151
|
+
async function isGitInstalledAndConfiguredAsync(projectRoot) {
|
|
97
152
|
try {
|
|
98
|
-
await (0,
|
|
99
|
-
|
|
100
|
-
|
|
153
|
+
await (0, _spawnasync().default)('git', [
|
|
154
|
+
'--help'
|
|
155
|
+
]);
|
|
156
|
+
} catch (error) {
|
|
101
157
|
if (error.code === 'ENOENT') {
|
|
102
158
|
return false;
|
|
103
159
|
}
|
|
104
160
|
throw error;
|
|
105
161
|
}
|
|
106
162
|
try {
|
|
107
|
-
await (0,
|
|
108
|
-
|
|
109
|
-
|
|
163
|
+
await (0, _spawnasync().default)('git', [
|
|
164
|
+
'rev-parse',
|
|
165
|
+
'--show-toplevel'
|
|
166
|
+
], {
|
|
167
|
+
cwd: projectRoot
|
|
168
|
+
});
|
|
169
|
+
} catch {
|
|
110
170
|
return false;
|
|
111
171
|
}
|
|
112
172
|
return true;
|
|
@@ -127,37 +187,43 @@ node_modules
|
|
|
127
187
|
*
|
|
128
188
|
* Differs from the eas-cli Ignore class by not using `.easignore`. Otherwise this is copied. May try
|
|
129
189
|
* to merge the implementations soon.
|
|
130
|
-
*/
|
|
131
|
-
class Ignore {
|
|
190
|
+
*/ class Ignore {
|
|
132
191
|
rootDir;
|
|
133
192
|
ignoreMapping = [];
|
|
134
|
-
constructor(rootDir)
|
|
193
|
+
constructor(rootDir){
|
|
135
194
|
this.rootDir = rootDir;
|
|
136
195
|
}
|
|
137
196
|
async initIgnoreAsync() {
|
|
138
|
-
const ignoreFilePaths = (await (0,
|
|
197
|
+
const ignoreFilePaths = (await (0, _glob().glob)(`**/${GITIGNORE_FILENAME}`, {
|
|
139
198
|
cwd: this.rootDir,
|
|
140
|
-
ignore: [
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
199
|
+
ignore: [
|
|
200
|
+
'node_modules'
|
|
201
|
+
],
|
|
202
|
+
follow: false
|
|
203
|
+
}))// ensure that parent dir is before child directories
|
|
204
|
+
.sort((a, b)=>a.length - b.length && a.localeCompare(b));
|
|
205
|
+
const ignoreMapping = await Promise.all(ignoreFilePaths.map(async (filePath)=>{
|
|
146
206
|
return [
|
|
147
207
|
filePath.slice(0, filePath.length - GITIGNORE_FILENAME.length),
|
|
148
|
-
(0,
|
|
208
|
+
(0, _ignore().default)().add(await _promises().default.readFile(_path().default.join(this.rootDir, filePath), 'utf-8'))
|
|
149
209
|
];
|
|
150
210
|
}));
|
|
151
|
-
this.ignoreMapping = [
|
|
211
|
+
this.ignoreMapping = [
|
|
212
|
+
[
|
|
213
|
+
'',
|
|
214
|
+
(0, _ignore().default)().add(DEFAULT_IGNORE)
|
|
215
|
+
],
|
|
216
|
+
...ignoreMapping
|
|
217
|
+
];
|
|
152
218
|
}
|
|
153
219
|
ignores(relativePath) {
|
|
154
|
-
for (const [prefix, ignore] of this.ignoreMapping)
|
|
220
|
+
for (const [prefix, ignore] of this.ignoreMapping){
|
|
155
221
|
if (relativePath.startsWith(prefix) && ignore.ignores(relativePath.slice(prefix.length))) {
|
|
156
222
|
return true;
|
|
157
223
|
}
|
|
158
224
|
}
|
|
159
225
|
return false;
|
|
160
226
|
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
//# sourceMappingURL=ProjectWorkflow.js.map
|
|
227
|
+
} //#endregion - a copy of vcs client and ignore handler from expo-updates
|
|
228
|
+
|
|
229
|
+
//# sourceMappingURL=ProjectWorkflow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["ProjectWorkflow.ts"],"sourcesContent":[null],"names":["resolveProjectWorkflowAsync","resolveProjectWorkflowPerPlatformAsync","projectRoot","platform","fingerprintIgnorePaths","configPluginsPackageRoot","resolveExpoConfigPluginsPackagePath","AndroidConfig","IOSConfig","require","platformWorkflowMarkers","path","join","Paths","getAndroidManifestAsync","getPBXProjectPath","vcsClient","getVCSClientAsync","vcsRoot","normalize","getRootPathAsync","marker","relativeMarker","toPosixPath","relative","pathExistsAsync","isIgnoredPathWithMatchObjects","isFileIgnoredAsync","android","ios","Promise","all","isGitInstalledAndConfiguredAsync","GitClient","NoVCSClient","spawnAsync","cwd","stdout","trim","filePath","ignore","Ignore","initIgnoreAsync","ignores","error","code","GITIGNORE_FILENAME","DEFAULT_IGNORE","ignoreMapping","rootDir","ignoreFilePaths","glob","follow","sort","a","b","length","localeCompare","map","slice","createIgnore","add","fs","readFile","relativePath","prefix","startsWith"],"mappings":";;;;;;;;;;;;;;;QAkBsBA;eAAAA;;QAuCAC;eAAAA;;;;gEAzDC;;;;;;;gEACR;;;;;;;yBACM;;;;;;;gEAEI;;;;;;;gEAER;;;;;;8BAEmC;sBAEwB;;;;;;AAQrE,eAAeD,4BACpBE,WAAmB,EACnBC,QAAkB,EAClBC,sBAAmC;IAEnC,MAAMC,2BAA2BC,IAAAA,iDAAmC,EAACJ;IACrE,IAAIG,4BAA4B,MAAM;QACpC,OAAO;IACT;IACA,MAAM,EAAEE,aAAa,EAAEC,SAAS,EAAE,GAAGC,QAAQJ;IAE7C,IAAIK;IACJ,IAAI;QACFA,0BACEP,aAAa,YACT;YACEQ,eAAI,CAACC,IAAI,CAACV,aAAa;YACvB,MAAMK,cAAcM,KAAK,CAACC,uBAAuB,CAACZ;SACnD,GACD;YAACM,UAAUK,KAAK,CAACE,iBAAiB,CAACb;SAAa;IACxD,EAAE,OAAM;QACN,OAAO;IACT;IAEA,MAAMc,YAAY,MAAMC,kBAAkBf;IAC1C,MAAMgB,UAAUP,eAAI,CAACQ,SAAS,CAAC,MAAMH,UAAUI,gBAAgB;IAC/D,KAAK,MAAMC,UAAUX,wBAAyB;QAC5C,MAAMY,iBAAiBC,IAAAA,iBAAW,EAACZ,eAAI,CAACa,QAAQ,CAACN,SAASG;QAC1D,IACE,AAAC,MAAMI,IAAAA,qBAAe,EAACJ,WACvB,CAACK,IAAAA,mCAA6B,EAACJ,gBAAgBlB,2BAC/C,CAAE,MAAMY,UAAUW,kBAAkB,CAAC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eAAKC;SAAc;IACnF;IAEOL,QAAQqB,YAAoB,EAAW;QAC5C,KAAK,MAAM,CAACC,QAAQzB,OAAO,IAAI,IAAI,CAACQ,aAAa,CAAE;YACjD,IAAIgB,aAAaE,UAAU,CAACD,WAAWzB,OAAOG,OAAO,CAACqB,aAAaL,KAAK,CAACM,OAAOT,MAAM,IAAI;gBACxF,OAAO;YACT;QACF;QACA,OAAO;IACT;AACF,EAEA,wEAAwE"}
|
package/build/Sort.js
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
0 && (module.exports = {
|
|
6
|
+
compareSource: null,
|
|
7
|
+
sortSources: null
|
|
8
|
+
});
|
|
9
|
+
function _export(target, all) {
|
|
10
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
_export(exports, {
|
|
16
|
+
get compareSource () {
|
|
17
|
+
return compareSource;
|
|
18
|
+
},
|
|
19
|
+
get sortSources () {
|
|
20
|
+
return sortSources;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
5
23
|
function sortSources(sources) {
|
|
6
24
|
return sources.sort(compareSource);
|
|
7
25
|
}
|
|
@@ -9,15 +27,8 @@ const typeOrder = {
|
|
|
9
27
|
file: 0,
|
|
10
28
|
dir: 1,
|
|
11
29
|
contents: 2,
|
|
30
|
+
package: 3
|
|
12
31
|
};
|
|
13
|
-
/**
|
|
14
|
-
* Comparator between two sources.
|
|
15
|
-
* This is useful for sorting sources in a consistent order.
|
|
16
|
-
* @returns:
|
|
17
|
-
* == 0 if a and b are equal,
|
|
18
|
-
* < 0 if a is less than b,
|
|
19
|
-
* > 0 if a is greater than b.
|
|
20
|
-
*/
|
|
21
32
|
function compareSource(a, b) {
|
|
22
33
|
const typeResult = typeOrder[a.type] - typeOrder[b.type];
|
|
23
34
|
if (typeResult === 0) {
|
|
@@ -25,16 +36,19 @@ function compareSource(a, b) {
|
|
|
25
36
|
const aValue = a.overrideHashKey ?? a.filePath;
|
|
26
37
|
const bValue = b.overrideHashKey ?? b.filePath;
|
|
27
38
|
return aValue.localeCompare(bValue);
|
|
28
|
-
}
|
|
29
|
-
else if (a.type === 'dir' && b.type === 'dir') {
|
|
39
|
+
} else if (a.type === 'dir' && b.type === 'dir') {
|
|
30
40
|
const aValue = a.overrideHashKey ?? a.filePath;
|
|
31
41
|
const bValue = b.overrideHashKey ?? b.filePath;
|
|
32
42
|
return aValue.localeCompare(bValue);
|
|
33
|
-
}
|
|
34
|
-
else if (a.type === 'contents' && b.type === 'contents') {
|
|
43
|
+
} else if (a.type === 'contents' && b.type === 'contents') {
|
|
35
44
|
return a.id.localeCompare(b.id);
|
|
45
|
+
} else if (a.type === 'package' && b.type === 'package') {
|
|
46
|
+
const aValue = a.overrideHashKey ?? `${a.name}@${a.version}`;
|
|
47
|
+
const bValue = b.overrideHashKey ?? `${b.name}@${b.version}`;
|
|
48
|
+
return aValue.localeCompare(bValue);
|
|
36
49
|
}
|
|
37
50
|
}
|
|
38
51
|
return typeResult;
|
|
39
52
|
}
|
|
40
|
-
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=Sort.js.map
|
package/build/Sort.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["Sort.ts"],"sourcesContent":[null],"names":["compareSource","sortSources","sources","sort","typeOrder","file","dir","contents","package","a","b","typeResult","type","aValue","overrideHashKey","filePath","bValue","localeCompare","id","name","version"],"mappings":";;;;;;;;;;;;;;;QAqBgBA;eAAAA;;QAnBAC;eAAAA;;;AAAT,SAASA,YAAkCC,OAAY;IAC5D,OAAOA,QAAQC,IAAI,C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|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "FileHookTransform", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return FileHookTransform;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
function _stream() {
|
|
12
|
+
const data = require("stream");
|
|
13
|
+
_stream = function() {
|
|
14
|
+
return data;
|
|
15
|
+
};
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
class FileHookTransform extends _stream().Transform {
|
|
9
19
|
source;
|
|
10
20
|
transformFn;
|
|
11
21
|
debug;
|
|
12
22
|
_isTransformed = undefined;
|
|
13
|
-
constructor(source, transformFn, debug)
|
|
14
|
-
super();
|
|
15
|
-
this.source = source;
|
|
16
|
-
this.transformFn = transformFn;
|
|
17
|
-
this.debug = debug;
|
|
23
|
+
constructor(source, transformFn, debug){
|
|
24
|
+
super(), this.source = source, this.transformFn = transformFn, this.debug = debug;
|
|
18
25
|
}
|
|
19
26
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
get isTransformed() {
|
|
27
|
+
* Indicates whether the file content has been transformed.
|
|
28
|
+
* @returns boolean value if `debug` is true, otherwise the value would be undefined.
|
|
29
|
+
*/ get isTransformed() {
|
|
24
30
|
return this._isTransformed;
|
|
25
31
|
}
|
|
26
32
|
//#region - Transform implementations
|
|
27
33
|
_transform(chunk, encoding, callback) {
|
|
28
|
-
const result = this.transformFn(this.source, chunk, false
|
|
34
|
+
const result = this.transformFn(this.source, chunk, false, encoding);
|
|
29
35
|
if (this.debug) {
|
|
30
36
|
this._isTransformed ||= chunk !== result;
|
|
31
37
|
}
|
|
@@ -35,12 +41,12 @@ class FileHookTransform extends stream_1.Transform {
|
|
|
35
41
|
callback();
|
|
36
42
|
}
|
|
37
43
|
_flush(callback) {
|
|
38
|
-
const result = this.transformFn(this.source, null, true
|
|
44
|
+
const result = this.transformFn(this.source, null, true, 'utf8');
|
|
39
45
|
if (result) {
|
|
40
46
|
this.push(result);
|
|
41
47
|
}
|
|
42
48
|
callback();
|
|
43
49
|
}
|
|
44
50
|
}
|
|
45
|
-
|
|
46
|
-
//# sourceMappingURL=FileHookTransform.js.map
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=FileHookTransform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["hash/FileHookTransform.ts"],"sourcesContent":[null],"names":["FileHookTransform","Transform","_isTransformed","undefined","source","transformFn","debug","isTransformed","_transform","chunk","encoding","callback","result","push","_flush"],"mappings":";;;;+BAOaA;;;eAAAA;;;;yBAPqC;;;;;;AAO3C,MAAMA,0BAA0BC,mBAAS;;;;IACtCC,iBAAsCC,UAAU;IAExD,YACE,AAAiBC,MAA+B,EAChD,AAAiBC,WAAsC,EACvD,AAAiBC,KAA0B,CAC3C;QACA,KAAK,SAJYF,SAAAA,aACAC,cAAAA,kBACAC,QAAAA;IAGnB;IAEA;;;GAGC,GACD,IAAIC,gBAAqC;QACvC,OAAO,IAAI,CAACL,cAAc;IAC5B;IAEA,qCAAqC;IAErCM,WAAWC,KAAU,EAAEC,QAAwB,EAAEC,QAA2B,EAAQ;QAClF,MAAMC,SAAS,IAAI,CAACP,WAAW,CAAC,IAAI,CAACD,MAAM,EAAEK,OAAO,OAAyBC;QAC7E,IAAI,IAAI,CAACJ,KAAK,EAAE;YACd,IAAI,CAACJ,cAAc,KAAKO,UAAUG;QACpC;QACA,IAAIA,QAAQ;YACV,IAAI,CAACC,IAAI,CAACD;QACZ;QACAD;IACF;IAEAG,OAAOH,QAA2B,EAAQ;QACxC,MAAMC,SAAS,IAAI,CAACP,WAAW,CAAC,IAAI,CAACD,MAAM,EAAE,MAAM,MAAwB;QAC3E,IAAIQ,QAAQ;YACV,IAAI,CAACC,IAAI,CAACD;QACZ;QACAD;IACF;AAGF"}
|
package/build/hash/Hash.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Fingerprint, FingerprintSource, HashResultContents, HashResultDir, HashResultFile, HashSource, HashSourceContents, NormalizedOptions } from '../Fingerprint.types';
|
|
1
|
+
import type { Fingerprint, FingerprintSource, HashResultContents, HashResultDir, HashResultFile, HashResultPackage, HashSource, HashSourceContents, HashSourcePackage, NormalizedOptions } from '../Fingerprint.types';
|
|
2
2
|
import { type Limiter } from '../utils/Concurrency';
|
|
3
3
|
/**
|
|
4
4
|
* Create a `Fingerprint` from `HashSources` array
|
|
@@ -22,6 +22,13 @@ export declare function createDirHashResultsAsync(dirPath: string, limiter: Limi
|
|
|
22
22
|
* Create `HashResult` for a `HashSourceContents`
|
|
23
23
|
*/
|
|
24
24
|
export declare function createContentsHashResultsAsync(source: HashSourceContents, options: NormalizedOptions): Promise<HashResultContents>;
|
|
25
|
+
/**
|
|
26
|
+
* Create a `HashResult` for a package from its embedded `name` and `version`.
|
|
27
|
+
* The sourcer reads these from the `package.json`, so the hash depends on the package identity
|
|
28
|
+
* rather than its resolved path or unrelated contents.
|
|
29
|
+
* Returns null when the package is ignored.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createPackageHashResultsAsync(source: HashSourcePackage, options: NormalizedOptions): Promise<HashResultPackage | null>;
|
|
25
32
|
/**
|
|
26
33
|
* Create id from given source
|
|
27
34
|
*/
|