@expo/fingerprint 0.20.13 → 0.21.1
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 -51
- package/build/Options.js.map +1 -1
- package/build/Presets.d.ts +26 -0
- package/build/Presets.js +50 -0
- package/build/Presets.js.map +1 -0
- package/build/ProjectWorkflow.js +129 -67
- 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 +208 -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/AutolinkingConfig.d.ts +19 -0
- package/build/sourcer/AutolinkingConfig.js +159 -0
- package/build/sourcer/AutolinkingConfig.js.map +1 -0
- package/build/sourcer/Bare.js +192 -94
- package/build/sourcer/Bare.js.map +1 -1
- package/build/sourcer/Expo.d.ts +3 -2
- package/build/sourcer/Expo.js +264 -121
- 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 +27 -2
- package/build/sourcer/SourceSkips.js +65 -48
- 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
|
@@ -1,41 +1,101 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
0 && (module.exports = {
|
|
6
|
+
getDefaultPackageSourcesAsync: null,
|
|
7
|
+
getPackageSourceAsync: 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 getDefaultPackageSourcesAsync () {
|
|
17
|
+
return getDefaultPackageSourcesAsync;
|
|
18
|
+
},
|
|
19
|
+
get getPackageSourceAsync () {
|
|
20
|
+
return getPackageSourceAsync;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
function _chalk() {
|
|
24
|
+
const data = /*#__PURE__*/ _interop_require_default(require("chalk"));
|
|
25
|
+
_chalk = 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 _path() {
|
|
38
|
+
const data = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
39
|
+
_path = function() {
|
|
40
|
+
return data;
|
|
41
|
+
};
|
|
42
|
+
return data;
|
|
43
|
+
}
|
|
44
|
+
function _resolvefrom() {
|
|
45
|
+
const data = /*#__PURE__*/ _interop_require_default(require("resolve-from"));
|
|
46
|
+
_resolvefrom = function() {
|
|
47
|
+
return data;
|
|
48
|
+
};
|
|
49
|
+
return data;
|
|
50
|
+
}
|
|
51
|
+
const _Path = require("../utils/Path");
|
|
52
|
+
const _Utils = require("./Utils");
|
|
53
|
+
function _interop_require_default(obj) {
|
|
54
|
+
return obj && obj.__esModule ? obj : {
|
|
55
|
+
default: obj
|
|
56
|
+
};
|
|
57
|
+
}
|
|
12
58
|
const debug = require('debug')('expo:fingerprint:sourcer:Packages');
|
|
13
59
|
const DEFAULT_PACKAGES = [
|
|
14
60
|
{
|
|
15
61
|
packageName: 'react-native',
|
|
16
|
-
|
|
17
|
-
}
|
|
62
|
+
sourceType: 'package'
|
|
63
|
+
}
|
|
18
64
|
];
|
|
19
65
|
async function getDefaultPackageSourcesAsync(projectRoot, options) {
|
|
20
|
-
const results = await Promise.all(DEFAULT_PACKAGES.map((params)
|
|
66
|
+
const results = await Promise.all(DEFAULT_PACKAGES.map((params)=>getPackageSourceAsync(projectRoot, params)));
|
|
21
67
|
return results.filter(Boolean);
|
|
22
68
|
}
|
|
23
69
|
async function getPackageSourceAsync(projectRoot, params) {
|
|
24
70
|
const reason = `package:${params.packageName}`;
|
|
25
|
-
const packageJsonPath =
|
|
71
|
+
const packageJsonPath = _resolvefrom().default.silent(projectRoot, `${params.packageName}/package.json`);
|
|
26
72
|
if (packageJsonPath == null) {
|
|
27
73
|
return null;
|
|
28
74
|
}
|
|
29
|
-
debug(`Adding package - ${
|
|
30
|
-
if (params.
|
|
75
|
+
debug(`Adding package - ${_chalk().default.dim(params.packageName)}`);
|
|
76
|
+
if (params.sourceType === 'package') {
|
|
77
|
+
let packageJson;
|
|
78
|
+
try {
|
|
79
|
+
packageJson = JSON.parse(await _promises().default.readFile(packageJsonPath, 'utf8'));
|
|
80
|
+
} catch (error) {
|
|
81
|
+
// A resolved package.json that can't be read shouldn't crash fingerprinting; skip the source.
|
|
82
|
+
if (error.code === 'ENOENT') {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
31
87
|
return {
|
|
32
|
-
type: '
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
88
|
+
type: 'package',
|
|
89
|
+
name: packageJson.name ?? '',
|
|
90
|
+
version: packageJson.version ?? '',
|
|
91
|
+
filePath: (0, _Path.toPosixPath)(_path().default.relative(projectRoot, packageJsonPath)),
|
|
92
|
+
reasons: [
|
|
93
|
+
reason
|
|
94
|
+
]
|
|
36
95
|
};
|
|
37
96
|
}
|
|
38
|
-
const packageRoot =
|
|
39
|
-
return await (0,
|
|
97
|
+
const packageRoot = _path().default.relative(projectRoot, _path().default.dirname(packageJsonPath));
|
|
98
|
+
return await (0, _Utils.getFileBasedHashSourceAsync)(projectRoot, packageRoot, reason);
|
|
40
99
|
}
|
|
41
|
-
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=Packages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["sourcer/Packages.ts"],"sourcesContent":[null],"names":["getDefaultPackageSourcesAsync","getPackageSourceAsync","debug","require","DEFAULT_PACKAGES","packageName","sourceType","projectRoot","options","results","Promise","all","map","params","filter","Boolean","reason","packageJsonPath","resolveFrom","silent","chalk","dim","packageJson","JSON","parse","fs","readFile","error","code","type","name","version","filePath","toPosixPath","path","relative","reasons","packageRoot","dirname","getFileBasedHashSourceAsync"],"mappings":";;;;;;;;;;;;;;;QAmCsBA;eAAAA;;QAUAC;eAAAA;;;;gEA7CJ;;;;;;;gEACH;;;;;;;gEACE;;;;;;;gEACO;;;;;;sBAGI;uBACgB;;;;;;AAE5C,MAAMC,QAAQC,QAAQ,SAAS;AAmB/B,MAAMC,mBAA2C;IAC/C;QACEC,aAAa;QACbC,YAAY;IACd;CACD;AAEM,eAAeN,8BACpBO,WAAmB,EACnBC,OAA0B;IAE1B,MAAMC,UAAU,MAAMC,QAAQC,GAAG,CAC/BP,iBAAiBQ,GAAG,CAAC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+
});
|
|
5
|
+
Object.defineProperty(exports, "getPatchPackageSourcesAsync", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return getPatchPackageSourcesAsync;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
function _chalk() {
|
|
12
|
+
const data = /*#__PURE__*/ _interop_require_default(require("chalk"));
|
|
13
|
+
_chalk = function() {
|
|
14
|
+
return data;
|
|
15
|
+
};
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
const _Path = require("../utils/Path");
|
|
19
|
+
const _Utils = require("./Utils");
|
|
20
|
+
function _interop_require_default(obj) {
|
|
21
|
+
return obj && obj.__esModule ? obj : {
|
|
22
|
+
default: obj
|
|
23
|
+
};
|
|
24
|
+
}
|
|
10
25
|
const debug = require('debug')('expo:fingerprint:sourcer:PatchPackage');
|
|
11
26
|
async function getPatchPackageSourcesAsync(projectRoot, options) {
|
|
12
|
-
if ((0,
|
|
13
|
-
debug(`Skipping dir - ${
|
|
27
|
+
if ((0, _Path.isIgnoredPathWithMatchObjects)('patches', options.ignoreDirMatchObjects)) {
|
|
28
|
+
debug(`Skipping dir - ${_chalk().default.dim('patches')} (ignored by ignoreDirMatchObjects)`);
|
|
14
29
|
return [];
|
|
15
30
|
}
|
|
16
|
-
const result = await (0,
|
|
31
|
+
const result = await (0, _Utils.getFileBasedHashSourceAsync)(projectRoot, 'patches', 'patchPackage');
|
|
17
32
|
if (result != null) {
|
|
18
|
-
debug(`Adding dir - ${
|
|
19
|
-
return [
|
|
33
|
+
debug(`Adding dir - ${_chalk().default.dim('patches')}`);
|
|
34
|
+
return [
|
|
35
|
+
result
|
|
36
|
+
];
|
|
20
37
|
}
|
|
21
38
|
return [];
|
|
22
39
|
}
|
|
23
|
-
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=PatchPackage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["sourcer/PatchPackage.ts"],"sourcesContent":[null],"names":["getPatchPackageSourcesAsync","debug","require","projectRoot","options","isIgnoredPathWithMatchObjects","ignoreDirMatchObjects","chalk","dim","result","getFileBasedHashSourceAsync"],"mappings":";;;;+BAQsBA;;;eAAAA;;;;gEARJ;;;;;;sBAG4B;uBACF;;;;;;AAE5C,MAAMC,QAAQC,QAAQ,SAAS;AAExB,eAAeF,4BACpBG,WAAmB,EACnBC,OAA0B;IAE1B,IAAIC,IAAAA,mCAA6B,EAAC,WAAWD,QAAQE,qBAAqB,GAAG;QAC3EL,MAAM,CAAC,eAAe,EAAEM,gBAAK,CAACC,GAAG,CAAC,WAAW,mCAAmC,CAAC;QACjF,OAAO,EAAE;IACX;IACA,MAAMC,SAAS,MAAMC,IAAAA,kCAA2B,EAACP,aAAa,WAAW;IACzE,IAAIM,UAAU,MAAM;QAClBR,MAAM,CAAC,aAAa,EAAEM,gBAAK,CAACC,GAAG,CAAC,YAAY;QAC5C,OAAO;YAACC;SAAO;IACjB;IACA,OAAO,EAAE;AACX"}
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
export declare enum SourceSkips {
|
|
5
5
|
/** Skip nothing. */
|
|
6
6
|
None = 0,
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Versions in app.json, including `version`, `android.versionCode`, `ios.buildNumber`, and the
|
|
9
|
+
* platform-specific overrides `ios.version` and `android.version` (which take precedence over
|
|
10
|
+
* the top-level `version`).
|
|
11
|
+
*/
|
|
8
12
|
ExpoConfigVersions = 1,
|
|
9
13
|
/** `runtimeVersion` in app.json if it is a string. */
|
|
10
14
|
ExpoConfigRuntimeVersionIfString = 2,
|
|
@@ -42,5 +46,26 @@ export declare enum SourceSkips {
|
|
|
42
46
|
*/
|
|
43
47
|
GitIgnore = 2048,
|
|
44
48
|
/** The [extra](https://docs.expo.dev/versions/latest/config/app/#extra) section in app.json */
|
|
45
|
-
ExpoConfigExtraSection = 4096
|
|
49
|
+
ExpoConfigExtraSection = 4096,
|
|
50
|
+
/**
|
|
51
|
+
* Skip eas.json.
|
|
52
|
+
* Most of its content, such as build profiles and submit settings, does not affect the native
|
|
53
|
+
* project. Note that some fields do, e.g. `ios.buildConfiguration` or `android.gradleCommand`.
|
|
54
|
+
*/
|
|
55
|
+
EasJson = 8192,
|
|
56
|
+
/**
|
|
57
|
+
* Skip .easignore.
|
|
58
|
+
* The file only controls which files are uploaded to EAS Build.
|
|
59
|
+
* Note that excluding a file that does affect the native build will not change the fingerprint.
|
|
60
|
+
*/
|
|
61
|
+
Easignore = 16384,
|
|
62
|
+
/**
|
|
63
|
+
* Path fields in the resolved autolinking config from `expo-modules-autolinking` and
|
|
64
|
+
* `react-native-config`.
|
|
65
|
+
* The config itself is still hashed. Filesystem paths, and values that sit under the project
|
|
66
|
+
* root, are omitted, including `scriptPhases[].path` and `sourceDir` / `podspecPath` overrides
|
|
67
|
+
* from the project's **react-native.config.js**. Those overrides will not change the fingerprint.
|
|
68
|
+
* Linked module names and `scriptPhases` names remain.
|
|
69
|
+
*/
|
|
70
|
+
AutolinkingConfigPaths = 32768
|
|
46
71
|
}
|
|
@@ -1,53 +1,70 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SourceSkips = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Bitmask of values that can be used to skip certain parts of the sources when generating a fingerprint.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
*/ "use strict";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "SourceSkips", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function() {
|
|
10
|
+
return SourceSkips;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var SourceSkips = /*#__PURE__*/ function(SourceSkips) {
|
|
14
|
+
/** Skip nothing. */ SourceSkips[SourceSkips["None"] = 0] = "None";
|
|
11
15
|
//#region - ExpoConfig source (e.g., app.json, app.config.js, etc.)
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
SourceSkips[SourceSkips["
|
|
18
|
-
/**
|
|
19
|
-
SourceSkips[SourceSkips["ExpoConfigAndroidPackage"] = 8] = "ExpoConfigAndroidPackage";
|
|
20
|
-
/** iOS bundle identifier in app.json. */
|
|
21
|
-
SourceSkips[SourceSkips["
|
|
22
|
-
/**
|
|
23
|
-
SourceSkips[SourceSkips["
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
* Prefer the other ExpoConfig source skips when possible and use this flag with caution.
|
|
31
|
-
* This will potentially ignore some native changes that should be part of most fingerprints.
|
|
32
|
-
* E.g., adding a new config plugin, changing the app icon, or changing the app name.
|
|
33
|
-
*/
|
|
34
|
-
SourceSkips[SourceSkips["ExpoConfigAll"] = 256] = "ExpoConfigAll";
|
|
16
|
+
/**
|
|
17
|
+
* Versions in app.json, including `version`, `android.versionCode`, `ios.buildNumber`, and the
|
|
18
|
+
* platform-specific overrides `ios.version` and `android.version` (which take precedence over
|
|
19
|
+
* the top-level `version`).
|
|
20
|
+
*/ SourceSkips[SourceSkips["ExpoConfigVersions"] = 1] = "ExpoConfigVersions";
|
|
21
|
+
/** `runtimeVersion` in app.json if it is a string. */ SourceSkips[SourceSkips["ExpoConfigRuntimeVersionIfString"] = 2] = "ExpoConfigRuntimeVersionIfString";
|
|
22
|
+
/** App names in app.json, including `name`, `description`, `web.name`, `web.shortName`, and `web.description`. */ SourceSkips[SourceSkips["ExpoConfigNames"] = 4] = "ExpoConfigNames";
|
|
23
|
+
/** Android package name in app.json. */ SourceSkips[SourceSkips["ExpoConfigAndroidPackage"] = 8] = "ExpoConfigAndroidPackage";
|
|
24
|
+
/** iOS bundle identifier in app.json. */ SourceSkips[SourceSkips["ExpoConfigIosBundleIdentifier"] = 16] = "ExpoConfigIosBundleIdentifier";
|
|
25
|
+
/** Schemes in app.json. */ SourceSkips[SourceSkips["ExpoConfigSchemes"] = 32] = "ExpoConfigSchemes";
|
|
26
|
+
/** EAS project information in app.json. */ SourceSkips[SourceSkips["ExpoConfigEASProject"] = 64] = "ExpoConfigEASProject";
|
|
27
|
+
/** Assets in app.json, including icons and splash assets. */ SourceSkips[SourceSkips["ExpoConfigAssets"] = 128] = "ExpoConfigAssets";
|
|
28
|
+
/**
|
|
29
|
+
* Skip the whole ExpoConfig.
|
|
30
|
+
* Prefer the other ExpoConfig source skips when possible and use this flag with caution.
|
|
31
|
+
* This will potentially ignore some native changes that should be part of most fingerprints.
|
|
32
|
+
* E.g., adding a new config plugin, changing the app icon, or changing the app name.
|
|
33
|
+
*/ SourceSkips[SourceSkips["ExpoConfigAll"] = 256] = "ExpoConfigAll";
|
|
35
34
|
//#endregion - ExpoConfig source (e.g., app.json, app.config.js, etc.)
|
|
36
35
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
36
|
+
* package.json scripts if android and ios items do not contain "run".
|
|
37
|
+
* Because prebuild will change the scripts in package.json,
|
|
38
|
+
* this is useful to generate a consistent fingerprint before and after prebuild.
|
|
39
|
+
*/ SourceSkips[SourceSkips["PackageJsonAndroidAndIosScriptsIfNotContainRun"] = 512] = "PackageJsonAndroidAndIosScriptsIfNotContainRun";
|
|
40
|
+
/**
|
|
41
|
+
* Skip the whole `scripts` section in the project's package.json.
|
|
42
|
+
*/ SourceSkips[SourceSkips["PackageJsonScriptsAll"] = 1024] = "PackageJsonScriptsAll";
|
|
43
|
+
/**
|
|
44
|
+
* Skip .gitignore files.
|
|
45
|
+
*/ SourceSkips[SourceSkips["GitIgnore"] = 2048] = "GitIgnore";
|
|
46
|
+
/** The [extra](https://docs.expo.dev/versions/latest/config/app/#extra) section in app.json */ SourceSkips[SourceSkips["ExpoConfigExtraSection"] = 4096] = "ExpoConfigExtraSection";
|
|
47
|
+
//#region - EAS Build source
|
|
48
|
+
/**
|
|
49
|
+
* Skip eas.json.
|
|
50
|
+
* Most of its content, such as build profiles and submit settings, does not affect the native
|
|
51
|
+
* project. Note that some fields do, e.g. `ios.buildConfiguration` or `android.gradleCommand`.
|
|
52
|
+
*/ SourceSkips[SourceSkips["EasJson"] = 8192] = "EasJson";
|
|
53
|
+
/**
|
|
54
|
+
* Skip .easignore.
|
|
55
|
+
* The file only controls which files are uploaded to EAS Build.
|
|
56
|
+
* Note that excluding a file that does affect the native build will not change the fingerprint.
|
|
57
|
+
*/ SourceSkips[SourceSkips["Easignore"] = 16384] = "Easignore";
|
|
58
|
+
//#endregion - EAS Build source
|
|
59
|
+
/**
|
|
60
|
+
* Path fields in the resolved autolinking config from `expo-modules-autolinking` and
|
|
61
|
+
* `react-native-config`.
|
|
62
|
+
* The config itself is still hashed. Filesystem paths, and values that sit under the project
|
|
63
|
+
* root, are omitted, including `scriptPhases[].path` and `sourceDir` / `podspecPath` overrides
|
|
64
|
+
* from the project's **react-native.config.js**. Those overrides will not change the fingerprint.
|
|
65
|
+
* Linked module names and `scriptPhases` names remain.
|
|
66
|
+
*/ SourceSkips[SourceSkips["AutolinkingConfigPaths"] = 32768] = "AutolinkingConfigPaths";
|
|
67
|
+
return SourceSkips;
|
|
68
|
+
}({});
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=SourceSkips.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["sourcer/SourceSkips.ts"],"sourcesContent":[null],"names":["SourceSkips"],"mappings":"AAAA;;CAEC;;;;+BACWA;;;eAAAA;;;AAAL,IAAA,AAAKA,qCAAAA;IACV,kBAAkB;IAGlB,mEAAmE;IAEnE;;;;GAIC;IAGD,oDAAoD;IAGpD,gHAAgH;IAGhH,sCAAsC;IAGtC,uCAAuC;IAGvC,yBAAyB;IAGzB,yCAAyC;IAGzC,2DAA2D;IAG3D;;;;;GAKC;IAGD,sEAAsE;IAEtE;;;;GAIC;IAGD;;GAEC;IAGD;;GAEC;IAGD,6FAA6F;IAG7F,4BAA4B;IAE5B;;;;GAIC;IAGD;;;;GAIC;IAGD,+BAA+B;IAE/B;;;;;;;GAOC;WAzFSA"}
|
package/build/sourcer/Sourcer.js
CHANGED
|
@@ -1,59 +1,78 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "getHashSourcesAsync", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return getHashSourcesAsync;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
function _chalk() {
|
|
12
|
+
const data = /*#__PURE__*/ _interop_require_default(require("chalk"));
|
|
13
|
+
_chalk = function() {
|
|
14
|
+
return data;
|
|
15
|
+
};
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
function _semver() {
|
|
19
|
+
const data = /*#__PURE__*/ _interop_require_default(require("semver"));
|
|
20
|
+
_semver = function() {
|
|
21
|
+
return data;
|
|
22
|
+
};
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
25
|
+
const _ExpoConfig = require("../ExpoConfig");
|
|
26
|
+
const _ExpoResolver = require("../ExpoResolver");
|
|
27
|
+
const _Profile = require("../utils/Profile");
|
|
28
|
+
const _Bare = require("./Bare");
|
|
29
|
+
const _Expo = require("./Expo");
|
|
30
|
+
const _Packages = require("./Packages");
|
|
31
|
+
const _PatchPackage = require("./PatchPackage");
|
|
32
|
+
function _interop_require_default(obj) {
|
|
33
|
+
return obj && obj.__esModule ? obj : {
|
|
34
|
+
default: obj
|
|
35
|
+
};
|
|
36
|
+
}
|
|
16
37
|
const debug = require('debug')('expo:fingerprint:sourcer:Sourcer');
|
|
17
38
|
async function getHashSourcesAsync(projectRoot, options) {
|
|
18
|
-
const { config: expoConfig, loadedModules } = await (0,
|
|
19
|
-
const expoAutolinkingVersion = (0,
|
|
20
|
-
const useRNCoreAutolinkingFromExpo =
|
|
21
|
-
// expo-modules-autolinking supports the `react-native-config` core autolinking from 1.11.2.
|
|
39
|
+
const { config: expoConfig, loadedModules } = await (0, _ExpoConfig.getExpoConfigAsync)(projectRoot, options);
|
|
40
|
+
const expoAutolinkingVersion = (0, _ExpoResolver.resolveExpoAutolinkingVersion)(projectRoot) ?? '0.0.0';
|
|
41
|
+
const useRNCoreAutolinkingFromExpo = // expo-modules-autolinking supports the `react-native-config` core autolinking from 1.11.2.
|
|
22
42
|
// To makes the `useRNCoreAutolinkingFromExpo` default to `true` for Expo SDK 52 and higher.
|
|
23
43
|
// We check the expo-modules-autolinking version from 1.12.0.
|
|
24
|
-
typeof options.useRNCoreAutolinkingFromExpo === 'boolean'
|
|
25
|
-
? options.useRNCoreAutolinkingFromExpo
|
|
26
|
-
: semver_1.default.gte(expoAutolinkingVersion, '1.12.0');
|
|
44
|
+
typeof options.useRNCoreAutolinkingFromExpo === 'boolean' ? options.useRNCoreAutolinkingFromExpo : _semver().default.gte(expoAutolinkingVersion, '1.12.0');
|
|
27
45
|
const results = await Promise.all([
|
|
28
46
|
// expo
|
|
29
|
-
(0,
|
|
30
|
-
(0,
|
|
31
|
-
(0,
|
|
32
|
-
(0,
|
|
33
|
-
(0,
|
|
47
|
+
(0, _Profile.profile)(options, _Expo.getExpoAutolinkingAndroidSourcesAsync)(projectRoot, options, expoAutolinkingVersion),
|
|
48
|
+
(0, _Profile.profile)(options, _Expo.getExpoAutolinkingIosSourcesAsync)(projectRoot, options, expoAutolinkingVersion),
|
|
49
|
+
(0, _Profile.profile)(options, _Expo.getExpoConfigSourcesAsync)(projectRoot, expoConfig, loadedModules, options),
|
|
50
|
+
(0, _Profile.profile)(options, _Expo.getEasBuildSourcesAsync)(projectRoot, options),
|
|
51
|
+
(0, _Profile.profile)(options, _Expo.getExpoCNGPatchSourcesAsync)(projectRoot, options),
|
|
34
52
|
// bare managed files
|
|
35
|
-
(0,
|
|
36
|
-
(0,
|
|
53
|
+
(0, _Profile.profile)(options, _Bare.getGitIgnoreSourcesAsync)(projectRoot, options),
|
|
54
|
+
(0, _Profile.profile)(options, _Bare.getPackageJsonScriptSourcesAsync)(projectRoot, options),
|
|
37
55
|
// bare native files
|
|
38
|
-
(0,
|
|
39
|
-
(0,
|
|
56
|
+
(0, _Profile.profile)(options, _Bare.getBareAndroidSourcesAsync)(projectRoot, options),
|
|
57
|
+
(0, _Profile.profile)(options, _Bare.getBareIosSourcesAsync)(projectRoot, options),
|
|
40
58
|
// react-native core autolinking
|
|
41
|
-
(0,
|
|
42
|
-
(0,
|
|
43
|
-
(0,
|
|
59
|
+
(0, _Profile.profile)(options, _Bare.getCoreAutolinkingSourcesFromExpoAndroid)(projectRoot, options, useRNCoreAutolinkingFromExpo),
|
|
60
|
+
(0, _Profile.profile)(options, _Bare.getCoreAutolinkingSourcesFromExpoIos)(projectRoot, options, useRNCoreAutolinkingFromExpo),
|
|
61
|
+
(0, _Profile.profile)(options, _Bare.getCoreAutolinkingSourcesFromRncCliAsync)(projectRoot, options, useRNCoreAutolinkingFromExpo),
|
|
44
62
|
// patch-package
|
|
45
|
-
(0,
|
|
63
|
+
(0, _Profile.profile)(options, _PatchPackage.getPatchPackageSourcesAsync)(projectRoot, options),
|
|
46
64
|
// some known dependencies, e.g. react-native
|
|
47
|
-
(0,
|
|
65
|
+
(0, _Profile.profile)(options, _Packages.getDefaultPackageSourcesAsync)(projectRoot, options)
|
|
48
66
|
]);
|
|
49
67
|
// extra sources
|
|
50
68
|
if (options.extraSources) {
|
|
51
|
-
for (const source of options.extraSources)
|
|
52
|
-
debug(`Adding extra source - ${
|
|
69
|
+
for (const source of options.extraSources){
|
|
70
|
+
debug(`Adding extra source - ${_chalk().default.dim(JSON.stringify(source))}`);
|
|
53
71
|
}
|
|
54
72
|
results.push(options.extraSources);
|
|
55
73
|
}
|
|
56
74
|
// flatten results
|
|
57
75
|
return [].concat(...results);
|
|
58
76
|
}
|
|
59
|
-
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=Sourcer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["sourcer/Sourcer.ts"],"sourcesContent":[null],"names":["getHashSourcesAsync","debug","require","projectRoot","options","config","expoConfig","loadedModules","getExpoConfigAsync","expoAutolinkingVersion","resolveExpoAutolinkingVersion","useRNCoreAutolinkingFromExpo","semver","gte","results","Promise","all","profile","getExpoAutolinkingAndroidSourcesAsync","getExpoAutolinkingIosSourcesAsync","getExpoConfigSourcesAsync","getEasBuildSourcesAsync","getExpoCNGPatchSourcesAsync","getGitIgnoreSourcesAsync","getPackageJsonScriptSourcesAsync","getBareAndroidSourcesAsync","getBareIosSourcesAsync","getCoreAutolinkingSourcesFromExpoAndroid","getCoreAutolinkingSourcesFromExpoIos","getCoreAutolinkingSourcesFromRncCliAsync","getPatchPackageSourcesAsync","getDefaultPackageSourcesAsync","extraSources","source","chalk","dim","JSON","stringify","push","concat"],"mappings":";;;;+BA4BsBA;;;eAAAA;;;;gEA5BJ;;;;;;;gEACC;;;;;;4BAEgB;8BACW;yBAEtB;sBASjB;sBAOA;0BACuC;8BACF;;;;;;AAE5C,MAAMC,QAAQC,QAAQ,SAAS;AAExB,eAAeF,oBACpBG,WAAmB,EACnBC,OAA0B;IAE1B,MAAM,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CAA6C;QAC7Ca,IAAAA,gBAAO,EAACb,SAAS2B,uCAA6B,EAAE5B,aAAaC;KAC9D;IAED,gBAAgB;IAChB,IAAIA,QAAQ4B,YAAY,EAAE;QACxB,KAAK,MAAMC,UAAU7B,QAAQ4B,YAAY,CAAE;YACzC/B,MAAM,CAAC,sBAAsB,EAAEiC,gBAAK,CAACC,GAAG,CAACC,KAAKC,SAAS,CAACJ,UAAU;QACpE;QACAnB,QAAQwB,IAAI,CAAClC,QAAQ4B,YAAY;IACnC;IAEA,kBAAkB;IAClB,OAAO,AAAC,EAAE,CAAkBO,MAAM,IAAIzB;AACxC"}
|
package/build/sourcer/Utils.d.ts
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import type { HashSource } from '../Fingerprint.types';
|
|
2
|
+
/**
|
|
3
|
+
* Build a hash source for an autolinked native module - its `package.json` name+version for the
|
|
4
|
+
* `package` source type, otherwise its whole native directory.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createAutolinkingHashSourceAsync(projectRoot: string, dirRelativePath: string, reasons: string[], nativeModuleSourceType: 'files' | 'package'): Promise<HashSource>;
|
|
7
|
+
/**
|
|
8
|
+
* Read a package's identity — its `package.json` `name` and `version` — for a `package` source.
|
|
9
|
+
* Returns null when the `package.json` is missing so the caller can fall back to hashing files;
|
|
10
|
+
* any other read/parse error throws, matching `getPackageSourceAsync`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function readPackageIdentityAsync(packageJsonPath: string): Promise<{
|
|
13
|
+
name: string;
|
|
14
|
+
version: string;
|
|
15
|
+
} | null>;
|
|
2
16
|
export declare function getFileBasedHashSourceAsync(projectRoot: string, filePath: string, reason: string): Promise<HashSource | null>;
|
|
3
17
|
/**
|
|
4
18
|
* Resolve path aliases before computing relative hash source paths.
|