@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,6 +1,47 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A helper script to load the Expo config and loaded plugins from a project
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* A CommonJS module observed while `installModuleCaptureHook()` was active.
|
|
6
|
+
*/
|
|
7
|
+
export interface CapturedModule {
|
|
8
|
+
/** The module id (cache key). May diverge from `filename` for virtual modules. */
|
|
9
|
+
id: string;
|
|
10
|
+
/** The filename Node compiled the module under. Authoritative even for transpiled sources. */
|
|
11
|
+
filename: string;
|
|
12
|
+
/** The source content Node executed for the module. */
|
|
13
|
+
content: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A config-plugin source produced from a captured module.
|
|
17
|
+
* A module backed by a real file becomes a `file` source.
|
|
18
|
+
* For virtual modules without a physical file in the file system, it becomes a `contents` source
|
|
19
|
+
* carrying the captured body.
|
|
20
|
+
*/
|
|
21
|
+
export type LoadedModuleSource = {
|
|
22
|
+
type: 'file';
|
|
23
|
+
path: string;
|
|
24
|
+
} | {
|
|
25
|
+
type: 'contents';
|
|
26
|
+
id: string;
|
|
27
|
+
contents: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Observe every CommonJS module compiled while the hook is installed.
|
|
31
|
+
* We hook `Module.prototype._compile` to keep each module's authoritative filename and source
|
|
32
|
+
* content.
|
|
33
|
+
*/
|
|
34
|
+
export declare function installModuleCaptureHook(): {
|
|
35
|
+
getCapturedModules: () => CapturedModule[];
|
|
36
|
+
uninstall: () => void;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Turn captured modules into config-plugin sources, dropping ignored paths.
|
|
40
|
+
* A real file becomes a `file` source; a module with no file on disk (virtual / compiled from a
|
|
41
|
+
* string) becomes a `contents` source keyed by its project-relative path so it stays stable across
|
|
42
|
+
* runs. A path that exists but is not a file (e.g. a directory) is skipped.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveLoadedModuleSourcesAsync(capturedModules: CapturedModule[], projectRoot: string, ignoredPaths: string[]): Promise<LoadedModuleSource[]>;
|
|
4
45
|
/**
|
|
5
46
|
* Get the path to the ExpoConfigLoader file.
|
|
6
47
|
*/
|
|
@@ -1,207 +1,247 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* A helper script to load the Expo config and loaded plugins from a project
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
*/ "use strict";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
0 && (module.exports = {
|
|
8
|
+
getExpoConfigLoaderPath: null,
|
|
9
|
+
installModuleCaptureHook: null,
|
|
10
|
+
resolveLoadedModuleSourcesAsync: null
|
|
11
|
+
});
|
|
12
|
+
function _export(target, all) {
|
|
13
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
_export(exports, {
|
|
19
|
+
get getExpoConfigLoaderPath () {
|
|
20
|
+
return getExpoConfigLoaderPath;
|
|
21
|
+
},
|
|
22
|
+
get installModuleCaptureHook () {
|
|
23
|
+
return installModuleCaptureHook;
|
|
24
|
+
},
|
|
25
|
+
get resolveLoadedModuleSourcesAsync () {
|
|
26
|
+
return resolveLoadedModuleSourcesAsync;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
function _env() {
|
|
30
|
+
const data = require("@expo/env");
|
|
31
|
+
_env = function() {
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
return data;
|
|
35
|
+
}
|
|
36
|
+
function _promises() {
|
|
37
|
+
const data = /*#__PURE__*/ _interop_require_default(require("fs/promises"));
|
|
38
|
+
_promises = function() {
|
|
39
|
+
return data;
|
|
40
|
+
};
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
function _module() {
|
|
44
|
+
const data = /*#__PURE__*/ _interop_require_default(require("module"));
|
|
45
|
+
_module = function() {
|
|
46
|
+
return data;
|
|
47
|
+
};
|
|
48
|
+
return data;
|
|
49
|
+
}
|
|
50
|
+
function _nodeprocess() {
|
|
51
|
+
const data = /*#__PURE__*/ _interop_require_default(require("node:process"));
|
|
52
|
+
_nodeprocess = function() {
|
|
53
|
+
return data;
|
|
54
|
+
};
|
|
55
|
+
return data;
|
|
56
|
+
}
|
|
57
|
+
function _path() {
|
|
58
|
+
const data = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
59
|
+
_path = function() {
|
|
60
|
+
return data;
|
|
61
|
+
};
|
|
62
|
+
return data;
|
|
63
|
+
}
|
|
64
|
+
function _resolvefrom() {
|
|
65
|
+
const data = /*#__PURE__*/ _interop_require_default(require("resolve-from"));
|
|
66
|
+
_resolvefrom = function() {
|
|
67
|
+
return data;
|
|
68
|
+
};
|
|
69
|
+
return data;
|
|
70
|
+
}
|
|
71
|
+
const _Options = require("./Options");
|
|
72
|
+
const _Path = require("./utils/Path");
|
|
73
|
+
function _interop_require_default(obj) {
|
|
74
|
+
return obj && obj.__esModule ? obj : {
|
|
75
|
+
default: obj
|
|
76
|
+
};
|
|
77
|
+
}
|
|
17
78
|
async function runAsync(programName, args = []) {
|
|
18
79
|
if (args[0] == null) {
|
|
19
|
-
console.log(`Usage: ${programName} <projectRoot> [ignoredFile]`);
|
|
80
|
+
console.log(`Usage: ${programName} <projectRoot> [ignoredFile] --mode <development|production> [--skipPlugins]`);
|
|
20
81
|
return;
|
|
21
82
|
}
|
|
22
|
-
const projectRoot =
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
83
|
+
const projectRoot = _path().default.resolve(args[0]);
|
|
84
|
+
const skipPlugins = args.includes('--skipPlugins');
|
|
85
|
+
const ignoredFileArg = args[1] && !args[1].startsWith('--') ? args[1] : null;
|
|
86
|
+
const ignoredFile = ignoredFileArg ? _path().default.resolve(ignoredFileArg) : null;
|
|
87
|
+
const modeFlagIndex = args.indexOf('--mode');
|
|
88
|
+
const mode = modeFlagIndex >= 0 ? args[modeFlagIndex + 1] : undefined;
|
|
89
|
+
if (mode !== 'development' && mode !== 'production') {
|
|
90
|
+
throw new Error(`Unsupported Expo config mode: ${mode}`);
|
|
91
|
+
}
|
|
92
|
+
(0, _env().consumeConfigEnvMode)();
|
|
93
|
+
globalThis.__DEV__ = mode === 'development';
|
|
94
|
+
(0, _env().loadProjectEnv)(projectRoot, {
|
|
95
|
+
mode
|
|
30
96
|
});
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (mod != null && mod.filename != null) {
|
|
42
|
-
filename = mod.filename || id;
|
|
43
|
-
}
|
|
44
|
-
// NOTE(@kitten): Virtual modules may be placed on `module._cache` and we can't rely on the ID to be accurate
|
|
45
|
-
// The IDs are also not necessarily paths. We prefer `filename`, and trust they exist, but if the ID mismatches
|
|
46
|
-
// with the module name, we use the ID, and ignore the filename entirely
|
|
47
|
-
if (filename !== id) {
|
|
48
|
-
virtualModuleNames.add(filename);
|
|
49
|
-
loadedModules.push(id);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
loadedModules.push(filename);
|
|
53
|
-
}
|
|
97
|
+
const { getCapturedModules, uninstall } = installModuleCaptureHook();
|
|
98
|
+
let config;
|
|
99
|
+
try {
|
|
100
|
+
const { getConfig } = require((0, _resolvefrom().default)(_path().default.resolve(projectRoot), 'expo/config'));
|
|
101
|
+
config = await getConfig(projectRoot, {
|
|
102
|
+
skipSDKVersionRequirement: true,
|
|
103
|
+
skipPlugins
|
|
104
|
+
});
|
|
105
|
+
} finally{
|
|
106
|
+
uninstall();
|
|
54
107
|
}
|
|
55
108
|
const ignoredPaths = [
|
|
56
109
|
...DEFAULT_CONFIG_LOADING_IGNORE_PATHS,
|
|
57
|
-
...
|
|
110
|
+
...await loadIgnoredPathsAsync(ignoredFile)
|
|
58
111
|
];
|
|
59
|
-
const
|
|
60
|
-
const existingLoadedModules = (await Promise.all(filteredLoadedModules.map(async (modulePath) => {
|
|
61
|
-
const relativePath = path_1.default.relative(projectRoot, modulePath);
|
|
62
|
-
if ((0, Path_1.isIgnoredPath)(relativePath, ignoredPaths)) {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
try {
|
|
66
|
-
const stat = await promises_1.default.stat(modulePath);
|
|
67
|
-
if (!stat.isFile()) {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
return relativePath;
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
// Filter out virtual paths / non-existent files
|
|
74
|
-
if (error.code === 'ENOENT') {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
throw error;
|
|
78
|
-
}
|
|
79
|
-
}))).filter((modulePath) => modulePath != null);
|
|
112
|
+
const loadedModules = await resolveLoadedModuleSourcesAsync(getCapturedModules(), projectRoot, ignoredPaths);
|
|
80
113
|
const result = JSON.stringify({
|
|
81
|
-
config
|
|
82
|
-
|
|
114
|
+
// The plugins-skipped pass only contributes its module list to the diff; its config is unused.
|
|
115
|
+
config: skipPlugins ? null : config,
|
|
116
|
+
loadedModules
|
|
83
117
|
});
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
118
|
+
if (_nodeprocess().default.send) {
|
|
119
|
+
_nodeprocess().default.send(result);
|
|
120
|
+
} else {
|
|
88
121
|
console.log(result);
|
|
89
122
|
}
|
|
90
123
|
}
|
|
91
124
|
// If running from the command line
|
|
92
125
|
if (require.main?.filename === __filename) {
|
|
93
|
-
(async ()
|
|
94
|
-
const programIndex =
|
|
95
|
-
const programName =
|
|
126
|
+
(async ()=>{
|
|
127
|
+
const programIndex = _nodeprocess().default.argv.findIndex((arg)=>arg === __filename);
|
|
128
|
+
const programName = _nodeprocess().default.argv[programIndex] ?? __filename;
|
|
96
129
|
try {
|
|
97
|
-
await runAsync(programName,
|
|
98
|
-
}
|
|
99
|
-
catch (e) {
|
|
130
|
+
await runAsync(programName, _nodeprocess().default.argv.slice(programIndex + 1));
|
|
131
|
+
} catch (e) {
|
|
100
132
|
console.error('Uncaught Error', e);
|
|
101
|
-
|
|
133
|
+
_nodeprocess().default.exit(1);
|
|
102
134
|
}
|
|
103
135
|
})();
|
|
104
136
|
}
|
|
105
137
|
/**
|
|
106
138
|
* Load the generated ignored paths file from caller and remove the file after loading
|
|
107
|
-
*/
|
|
108
|
-
async function loadIgnoredPathsAsync(ignoredFile) {
|
|
139
|
+
*/ async function loadIgnoredPathsAsync(ignoredFile) {
|
|
109
140
|
if (!ignoredFile) {
|
|
110
|
-
return
|
|
141
|
+
return _Options.DEFAULT_IGNORE_PATHS;
|
|
111
142
|
}
|
|
112
143
|
const ignorePaths = [];
|
|
113
144
|
try {
|
|
114
|
-
const fingerprintIgnore = await
|
|
145
|
+
const fingerprintIgnore = await _promises().default.readFile(ignoredFile, 'utf8');
|
|
115
146
|
const fingerprintIgnoreLines = fingerprintIgnore.split('\n');
|
|
116
|
-
for (const line of fingerprintIgnoreLines)
|
|
147
|
+
for (const line of fingerprintIgnoreLines){
|
|
117
148
|
const trimmedLine = line.trim();
|
|
118
149
|
if (trimmedLine) {
|
|
119
150
|
ignorePaths.push(trimmedLine);
|
|
120
151
|
}
|
|
121
152
|
}
|
|
122
|
-
}
|
|
123
|
-
catch { }
|
|
153
|
+
} catch {}
|
|
124
154
|
return ignorePaths;
|
|
125
155
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
156
|
+
function installModuleCaptureHook() {
|
|
157
|
+
const moduleProto = _module().default.prototype;
|
|
158
|
+
const capturedModules = [];
|
|
159
|
+
const originalCompile = moduleProto._compile;
|
|
160
|
+
moduleProto._compile = function(content, filename) {
|
|
161
|
+
capturedModules.push({
|
|
162
|
+
id: this.id ?? filename,
|
|
163
|
+
filename,
|
|
164
|
+
content
|
|
165
|
+
});
|
|
166
|
+
return originalCompile.call(this, content, filename);
|
|
167
|
+
};
|
|
168
|
+
return {
|
|
169
|
+
getCapturedModules: ()=>capturedModules,
|
|
170
|
+
uninstall: ()=>{
|
|
171
|
+
moduleProto._compile = originalCompile;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
131
174
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
175
|
+
async function resolveLoadedModuleSourcesAsync(capturedModules, projectRoot, ignoredPaths) {
|
|
176
|
+
const seen = new Set();
|
|
177
|
+
const ignoredPathMatchObjects = (0, _Path.buildPathMatchObjects)(ignoredPaths);
|
|
178
|
+
const candidates = capturedModules.map(({ filename, content })=>({
|
|
179
|
+
relativePath: (0, _Path.toPosixPath)(_path().default.relative(projectRoot, filename)),
|
|
180
|
+
filename,
|
|
181
|
+
content
|
|
182
|
+
})).filter(({ relativePath })=>{
|
|
183
|
+
if (seen.has(relativePath) || (0, _Path.isIgnoredPathWithMatchObjects)(relativePath, ignoredPathMatchObjects)) {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
seen.add(relativePath);
|
|
187
|
+
return true;
|
|
188
|
+
});
|
|
189
|
+
const sources = await Promise.all(candidates.map(async ({ relativePath, filename, content })=>{
|
|
190
|
+
try {
|
|
191
|
+
const stat = await _promises().default.stat(filename);
|
|
192
|
+
return stat.isFile() ? {
|
|
193
|
+
type: 'file',
|
|
194
|
+
path: relativePath
|
|
195
|
+
} : null;
|
|
196
|
+
} catch (error) {
|
|
197
|
+
if (error.code === 'ENOENT') {
|
|
198
|
+
return {
|
|
199
|
+
type: 'contents',
|
|
200
|
+
id: relativePath,
|
|
201
|
+
contents: content
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
throw error;
|
|
205
|
+
}
|
|
206
|
+
}));
|
|
207
|
+
return sources.filter((source)=>source !== null);
|
|
141
208
|
}
|
|
142
|
-
|
|
209
|
+
function getExpoConfigLoaderPath() {
|
|
210
|
+
return _path().default.join(__dirname, 'ExpoConfigLoader.js');
|
|
211
|
+
}
|
|
212
|
+
// Ignore known non-native packages loaded while applying config plugins, which the plugins-skipped
|
|
213
|
+
// diff can't drop since they only load during plugin application.
|
|
143
214
|
const DEFAULT_CONFIG_LOADING_IGNORE_PATHS = [
|
|
144
|
-
// We don't want to include the whole project package.json from the ExpoConfigLoader phase.
|
|
145
|
-
'package.json',
|
|
146
|
-
'**/node_modules/@babel/**/*',
|
|
147
215
|
'**/node_modules/@expo/**/*',
|
|
148
|
-
'**/node_modules/@jridgewell/**/*',
|
|
149
|
-
'**/node_modules/cross-spawn/**/*',
|
|
150
|
-
'**/node_modules/isexe/**/*',
|
|
151
|
-
'**/node_modules/shebang-command/**/*',
|
|
152
|
-
'**/node_modules/shebang-regex/**/*',
|
|
153
|
-
'**/node_modules/semver/**/*',
|
|
154
|
-
'**/node_modules/slugify/**/*',
|
|
155
|
-
'**/node_modules/typescript/**/*',
|
|
156
|
-
'**/node_modules/expo/config/**/*',
|
|
157
|
-
'**/node_modules/expo/config.js',
|
|
158
|
-
'**/node_modules/expo/config-plugins.js',
|
|
159
216
|
`**/node_modules/{${[
|
|
160
|
-
'ajv',
|
|
161
|
-
'ajv-formats',
|
|
162
|
-
'ajv-keywords',
|
|
163
217
|
'ansi-styles',
|
|
164
218
|
'base64-js',
|
|
165
219
|
'big-integer',
|
|
166
220
|
'bplist-creator',
|
|
167
221
|
'chalk',
|
|
222
|
+
'cross-spawn',
|
|
168
223
|
'debug',
|
|
169
|
-
'dotenv',
|
|
170
|
-
'dotenv-expand',
|
|
171
|
-
'escape-string-regexp',
|
|
172
|
-
'getenv',
|
|
173
|
-
'graceful-fs',
|
|
174
|
-
'fast-deep-equal',
|
|
175
|
-
'fast-uri',
|
|
176
224
|
'has-flag',
|
|
177
|
-
'
|
|
225
|
+
'isexe',
|
|
178
226
|
'jimp-compact',
|
|
179
|
-
'js-tokens',
|
|
180
|
-
'json5',
|
|
181
|
-
'json-schema-traverse',
|
|
182
227
|
'ms',
|
|
183
228
|
'parse-png',
|
|
184
229
|
'path-key',
|
|
185
|
-
'picocolors',
|
|
186
230
|
'plist',
|
|
187
231
|
'pngjs',
|
|
188
|
-
'lines-and-columns',
|
|
189
|
-
'require-from-string',
|
|
190
|
-
'resolve-from',
|
|
191
232
|
'sax',
|
|
192
|
-
'
|
|
193
|
-
'
|
|
233
|
+
'semver',
|
|
234
|
+
'shebang-command',
|
|
235
|
+
'shebang-regex',
|
|
194
236
|
'simple-plist',
|
|
195
237
|
'stream-buffers',
|
|
196
|
-
'sucrase',
|
|
197
238
|
'supports-color',
|
|
198
|
-
'ts-interface-checker',
|
|
199
|
-
'write-file-atomic',
|
|
200
|
-
'xml2js',
|
|
201
|
-
'xmlbuilder',
|
|
202
|
-
'which',
|
|
203
239
|
'uuid',
|
|
240
|
+
'which',
|
|
204
241
|
'xcode',
|
|
205
|
-
|
|
242
|
+
'xml2js',
|
|
243
|
+
'xmlbuilder'
|
|
244
|
+
].join(',')}}/**/*`
|
|
206
245
|
];
|
|
207
|
-
|
|
246
|
+
|
|
247
|
+
//# sourceMappingURL=ExpoConfigLoader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["ExpoConfigLoader.ts"],"sourcesContent":[null],"names":["getExpoConfigLoaderPath","installModuleCaptureHook","resolveLoadedModuleSourcesAsync","runAsync","programName","args","console","log","projectRoot","path","resolve","skipPlugins","includes","ignoredFileArg","startsWith","ignoredFile","modeFlagIndex","indexOf","mode","undefined","Error","consumeConfigEnvMode","globalThis","__DEV__","loadProjectEnv","getCapturedModules","uninstall","config","getConfig","require","resolveFrom","skipSDKVersionRequirement","ignoredPaths","DEFAULT_CONFIG_LOADING_IGNORE_PATHS","loadIgnoredPathsAsync","loadedModules","result","JSON","stringify","process","send","main","filename","__filename","programIndex","argv","findIndex","arg","slice","e","error","exit","DEFAULT_IGNORE_PATHS","ignorePaths","fingerprintIgnore","fs","readFile","fingerprintIgnoreLines","split","line","trimmedLine","trim","push","moduleProto","module","prototype","capturedModules","originalCompile","_compile","content","id","call","seen","Set","ignoredPathMatchObjects","buildPathMatchObjects","candidates","map","relativePath","toPosixPath","relative","filter","has","isIgnoredPathWithMatchObjects","add","sources","Promise","all","stat","isFile","type","code","contents","source","join","__dirname"],"mappings":"AAAA;;CAEC;;;;;;;;;;;;;;;;QAoNeA;eAAAA;;QA3EAC;eAAAA;;QA6BMC;eAAAA;;;;yBApK+B;;;;;;;gEACtC;;;;;;;gEACI;;;;;;;gEACC;;;;;;;gEACH;;;;;;;gEACO;;;;;;yBAEa;sBAC6C;;;;;;AAMlF,eAAeC,SAASC,WAAmB,EAAEC,OAAiB,EAAE;IAC9D,IAAIA,IAAI,CAAC,EAAE,IAAI,MAAM;QACnBC,QAAQC,GAAG,CACT,CAAC,OAAO,EAAEH,YAAY,4EAA4E,CAAC;QAErG;IACF;IAEA,MAAMI,cAAcC,eAAI,CAACC,OAAO,CAACL,IAAI,CAAC,EAAE;IACxC,MAAMM,cAAcN,KAAKO,QAAQ,CAAC;IAClC,MAAMC,iBAAiBR,IAAI,CAAC,EAAE,IAAI,CAACA,IAAI,CAAC,EAAE,CAACS,UAAU,CAAC,QAAQT,IAAI,CAAC,EAAE,GAAG;IACxE,MAAMU,cAAcF,iBAAiBJ,eAAI,CAACC,OAAO,CAACG,kBAAkB;IAEpE,MAAMG,gBAAgBX,KAAKY,OAAO,CAAC;IACnC,MAAMC,OAAOF,iBAAiB,IAAIX,IAAI,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,EAAE;QACvB,IACEN,KAAKU,GAAG,CAACJ,iBACTK,IAAAA,mCAA6B,EAACL,cAAcJ,0BAC5C;YACA,OAAO;QACT;QACAF,KAAKY,GAAG,CAACN;QACT,OAAO;IACT;IAEF,MAAMO,UAAU,MAAMC,QAAQC,GAAG,CAC/BX,WAAWC,GAAG,CACZ,OAAO,EAAEC,YAAY,EAAEpC,QAAQ,EAAE2B,OAAO,EAAE;QACxC,IAAI;YACF,MAAMmB,OAAO,MAAMjC,mBAAE,CAACiC,IAAI,CAAC9C;YAC3B,OAAO8C,KAAKC,MAAM,KAAK;gBAAEC,MAAM;gBAAQjF,MAAMqE;YAAa,IAAI;QAChE,EAAE,OAAO5B,OAAY;YACnB,IAAIA,MAAMyC,IAAI,KAAK,UAAU;gBAC3B,OAAO;oBAAED,MAAM;oBAAYpB,IAAIQ;oBAAcc,UAAUvB;gBAAQ;YACjE;YACA,MAAMnB;QACR;IACF;IAIJ,OAAOmC,QAAQJ,MAAM,CAAC,CAACY,SAAyCA,WAAW;AAC7E;AAKO,SAAS7F;IACd,OAAOS,eAAI,CAACqF,IAAI,CAACC,WAAW;AAC9B;AAEA,mGAAmG;AACnG,kEAAkE;AAClE,MAAM9D,sCAAsC;IAC1C;IACA,CAAC,iBAAiB,EAAE;QAClB;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD,CAAC6D,IAAI,CAAC,KAAK,MAAM,CAAC;CACpB"}
|
package/build/ExpoResolver.js
CHANGED
|
@@ -1,32 +1,76 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
0 && (module.exports = {
|
|
6
|
+
resolveExpoAutolinkingCliPath: null,
|
|
7
|
+
resolveExpoAutolinkingPackageRoot: null,
|
|
8
|
+
resolveExpoAutolinkingVersion: null,
|
|
9
|
+
resolveExpoConfigPluginsPackagePath: null,
|
|
10
|
+
resolveExpoVersion: null,
|
|
11
|
+
satisfyExpoVersion: null
|
|
12
|
+
});
|
|
13
|
+
function _export(target, all) {
|
|
14
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
_export(exports, {
|
|
20
|
+
get resolveExpoAutolinkingCliPath () {
|
|
21
|
+
return resolveExpoAutolinkingCliPath;
|
|
22
|
+
},
|
|
23
|
+
get resolveExpoAutolinkingPackageRoot () {
|
|
24
|
+
return resolveExpoAutolinkingPackageRoot;
|
|
25
|
+
},
|
|
26
|
+
get resolveExpoAutolinkingVersion () {
|
|
27
|
+
return resolveExpoAutolinkingVersion;
|
|
28
|
+
},
|
|
29
|
+
get resolveExpoConfigPluginsPackagePath () {
|
|
30
|
+
return resolveExpoConfigPluginsPackagePath;
|
|
31
|
+
},
|
|
32
|
+
get resolveExpoVersion () {
|
|
33
|
+
return resolveExpoVersion;
|
|
34
|
+
},
|
|
35
|
+
get satisfyExpoVersion () {
|
|
36
|
+
return satisfyExpoVersion;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
function _path() {
|
|
40
|
+
const data = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
41
|
+
_path = function() {
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
44
|
+
return data;
|
|
45
|
+
}
|
|
46
|
+
function _resolvefrom() {
|
|
47
|
+
const data = /*#__PURE__*/ _interop_require_default(require("resolve-from"));
|
|
48
|
+
_resolvefrom = function() {
|
|
49
|
+
return data;
|
|
50
|
+
};
|
|
51
|
+
return data;
|
|
52
|
+
}
|
|
53
|
+
function _semver() {
|
|
54
|
+
const data = /*#__PURE__*/ _interop_require_default(require("semver"));
|
|
55
|
+
_semver = function() {
|
|
56
|
+
return data;
|
|
57
|
+
};
|
|
58
|
+
return data;
|
|
59
|
+
}
|
|
60
|
+
function _interop_require_default(obj) {
|
|
61
|
+
return obj && obj.__esModule ? obj : {
|
|
62
|
+
default: obj
|
|
63
|
+
};
|
|
64
|
+
}
|
|
15
65
|
let cachedExpoAutolinkingPackageRoot = null;
|
|
16
|
-
/**
|
|
17
|
-
* Resolve the version of `expo` package in the project.
|
|
18
|
-
*/
|
|
19
66
|
function resolveExpoVersion(projectRoot) {
|
|
20
|
-
const expoPackageJsonPath =
|
|
67
|
+
const expoPackageJsonPath = _resolvefrom().default.silent(projectRoot, 'expo/package.json');
|
|
21
68
|
if (expoPackageJsonPath) {
|
|
22
69
|
const expoPackageJson = require(expoPackageJsonPath);
|
|
23
70
|
return expoPackageJson.version;
|
|
24
71
|
}
|
|
25
72
|
return null;
|
|
26
73
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Resolve the package root of `expo-modules-autolinking` package in the project.
|
|
29
|
-
*/
|
|
30
74
|
function resolveExpoAutolinkingPackageRoot(projectRoot) {
|
|
31
75
|
if (cachedExpoAutolinkingPackageRoot) {
|
|
32
76
|
const [cachedProjectRoot, cachedPackageRoot] = cachedExpoAutolinkingPackageRoot;
|
|
@@ -34,52 +78,42 @@ function resolveExpoAutolinkingPackageRoot(projectRoot) {
|
|
|
34
78
|
return cachedPackageRoot;
|
|
35
79
|
}
|
|
36
80
|
}
|
|
37
|
-
const expoPackageRoot =
|
|
38
|
-
const autolinkingPackageJsonPath =
|
|
81
|
+
const expoPackageRoot = _resolvefrom().default.silent(projectRoot, 'expo/package.json');
|
|
82
|
+
const autolinkingPackageJsonPath = _resolvefrom().default.silent(expoPackageRoot ?? projectRoot, 'expo-modules-autolinking/package.json');
|
|
39
83
|
if (autolinkingPackageJsonPath) {
|
|
40
|
-
const autolinkingPackageRoot =
|
|
41
|
-
cachedExpoAutolinkingPackageRoot = [
|
|
84
|
+
const autolinkingPackageRoot = _path().default.dirname(autolinkingPackageJsonPath);
|
|
85
|
+
cachedExpoAutolinkingPackageRoot = [
|
|
86
|
+
projectRoot,
|
|
87
|
+
autolinkingPackageRoot
|
|
88
|
+
];
|
|
42
89
|
return autolinkingPackageRoot;
|
|
43
90
|
}
|
|
44
91
|
return null;
|
|
45
92
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Resolve the path to the `expo-modules-autolinking` CLI in the project.
|
|
48
|
-
* @throws If the package is not found in the project.
|
|
49
|
-
*/
|
|
50
93
|
function resolveExpoAutolinkingCliPath(projectRoot) {
|
|
51
94
|
const autolinkingPackageRoot = resolveExpoAutolinkingPackageRoot(projectRoot);
|
|
52
95
|
if (autolinkingPackageRoot == null) {
|
|
53
96
|
throw new Error('Cannot resolve expo-modules-autolinking package in the project.');
|
|
54
97
|
}
|
|
55
|
-
return
|
|
98
|
+
return _path().default.join(autolinkingPackageRoot, 'bin', 'expo-modules-autolinking.js');
|
|
56
99
|
}
|
|
57
|
-
/**
|
|
58
|
-
* Resolve the version of `expo-modules-autolinking` package in the project.
|
|
59
|
-
*/
|
|
60
100
|
function resolveExpoAutolinkingVersion(projectRoot) {
|
|
61
101
|
const autolinkingPackageRoot = resolveExpoAutolinkingPackageRoot(projectRoot);
|
|
62
102
|
if (autolinkingPackageRoot) {
|
|
63
|
-
const autolinkingPackageJson = require(
|
|
103
|
+
const autolinkingPackageJson = require(_path().default.join(autolinkingPackageRoot, 'package.json'));
|
|
64
104
|
return autolinkingPackageJson.version;
|
|
65
105
|
}
|
|
66
106
|
return null;
|
|
67
107
|
}
|
|
68
|
-
/**
|
|
69
|
-
* Resolve the package root of `expo/config-plugins` package in the project.
|
|
70
|
-
*/
|
|
71
108
|
function resolveExpoConfigPluginsPackagePath(projectRoot) {
|
|
72
|
-
return
|
|
109
|
+
return _resolvefrom().default.silent(projectRoot, 'expo/config-plugins') ?? null;
|
|
73
110
|
}
|
|
74
|
-
/**
|
|
75
|
-
* Resolve the `expo` package version and check if it satisfies the provided semver range.
|
|
76
|
-
* @returns `null` if the `expo` package is not found in the project.
|
|
77
|
-
*/
|
|
78
111
|
function satisfyExpoVersion(projectRoot, range) {
|
|
79
112
|
const expoVersion = resolveExpoVersion(projectRoot);
|
|
80
113
|
if (expoVersion) {
|
|
81
|
-
return
|
|
114
|
+
return _semver().default.satisfies(expoVersion, range);
|
|
82
115
|
}
|
|
83
116
|
return null;
|
|
84
117
|
}
|
|
85
|
-
|
|
118
|
+
|
|
119
|
+
//# sourceMappingURL=ExpoResolver.js.map
|