@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,64 +1,98 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "generateFingerprintAsync", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return generateFingerprintAsync;
|
|
7
9
|
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
10
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
11
|
+
function _chalk() {
|
|
12
|
+
const data = /*#__PURE__*/ _interop_require_default(require("chalk"));
|
|
13
|
+
_chalk = function() {
|
|
14
|
+
return data;
|
|
26
15
|
};
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
function _getenv() {
|
|
19
|
+
const data = require("getenv");
|
|
20
|
+
_getenv = function() {
|
|
21
|
+
return data;
|
|
33
22
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
25
|
+
const _index = require("../../../build/index");
|
|
26
|
+
const _args = require("../utils/args");
|
|
27
|
+
const _errors = require("../utils/errors");
|
|
28
|
+
const _log = /*#__PURE__*/ _interop_require_wildcard(require("../utils/log"));
|
|
29
|
+
const _withConsoleDisabledAsync = require("../utils/withConsoleDisabledAsync");
|
|
30
|
+
function _interop_require_default(obj) {
|
|
31
|
+
return obj && obj.__esModule ? obj : {
|
|
32
|
+
default: obj
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
36
|
+
if (typeof WeakMap !== "function") return null;
|
|
37
|
+
var cacheBabelInterop = new WeakMap();
|
|
38
|
+
var cacheNodeInterop = new WeakMap();
|
|
39
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
40
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
41
|
+
})(nodeInterop);
|
|
42
|
+
}
|
|
43
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
44
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
45
|
+
return obj;
|
|
46
|
+
}
|
|
47
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
48
|
+
return {
|
|
49
|
+
default: obj
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
53
|
+
if (cache && cache.has(obj)) {
|
|
54
|
+
return cache.get(obj);
|
|
55
|
+
}
|
|
56
|
+
var newObj = {
|
|
57
|
+
__proto__: null
|
|
58
|
+
};
|
|
59
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
60
|
+
for(var key in obj){
|
|
61
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
62
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
63
|
+
if (desc && (desc.get || desc.set)) {
|
|
64
|
+
Object.defineProperty(newObj, key, desc);
|
|
65
|
+
} else {
|
|
66
|
+
newObj[key] = obj[key];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
newObj.default = obj;
|
|
71
|
+
if (cache) {
|
|
72
|
+
cache.set(obj, newObj);
|
|
73
|
+
}
|
|
74
|
+
return newObj;
|
|
75
|
+
}
|
|
76
|
+
const generateFingerprintAsync = async (argv)=>{
|
|
77
|
+
const args = (0, _args.assertArgs)({
|
|
49
78
|
// Types
|
|
50
79
|
'--help': Boolean,
|
|
51
|
-
'--
|
|
80
|
+
'--preset': String,
|
|
81
|
+
'--platform': [
|
|
82
|
+
String
|
|
83
|
+
],
|
|
52
84
|
'--concurrent-io-limit': Number,
|
|
53
85
|
'--hash-algorithm': String,
|
|
54
|
-
'--ignore-path': [
|
|
86
|
+
'--ignore-path': [
|
|
87
|
+
String
|
|
88
|
+
],
|
|
55
89
|
'--source-skips': Number,
|
|
56
90
|
'--debug': Boolean,
|
|
57
91
|
// Aliases
|
|
58
|
-
'-h': '--help'
|
|
92
|
+
'-h': '--help'
|
|
59
93
|
}, argv ?? []);
|
|
60
94
|
if (args['--help']) {
|
|
61
|
-
|
|
95
|
+
_log.exit((0, _chalk().default)`
|
|
62
96
|
{bold Description}
|
|
63
97
|
Generate fingerprint for a project
|
|
64
98
|
|
|
@@ -66,11 +100,12 @@ Generate fingerprint for a project
|
|
|
66
100
|
{dim $} npx @expo/fingerprint fingerprint:generate
|
|
67
101
|
|
|
68
102
|
Options
|
|
103
|
+
--preset <string> Preset to derive defaults from: 'strict', 'balanced' (default), or 'relaxed'. An explicit --source-skips overrides the preset.
|
|
69
104
|
--platform <string[]> Limit native files to those for specified platforms. Default is ['android', 'ios'].
|
|
70
105
|
--concurrent-io-limit <number> I/O concurrent limit. Default is the number of CPU cores.
|
|
71
106
|
--hash-algorithm <string> The algorithm to use for crypto.createHash(). Default is 'sha1'.
|
|
72
107
|
--ignore-path <string[]> Ignore files and directories from hashing. The supported pattern is the same as glob().
|
|
73
|
-
--source-skips <number> Skips some sources from fingerprint. Value is the result of bitwise-OR'ing desired values of SourceSkips.
|
|
108
|
+
--source-skips <number> Skips some sources from fingerprint. Value is the result of bitwise-OR'ing desired values of SourceSkips. Overrides the preset's source skips.
|
|
74
109
|
--debug Whether to include verbose debug information in output
|
|
75
110
|
-h, --help Output usage information
|
|
76
111
|
`, 0);
|
|
@@ -78,54 +113,76 @@ Generate fingerprint for a project
|
|
|
78
113
|
const platforms = args['--platform'];
|
|
79
114
|
if (platforms) {
|
|
80
115
|
if (!Array.isArray(platforms)) {
|
|
81
|
-
throw new
|
|
116
|
+
throw new _errors.CommandError(`Invalid value for --platform`);
|
|
82
117
|
}
|
|
83
|
-
if (!platforms.every((elem)
|
|
84
|
-
|
|
118
|
+
if (!platforms.every((elem)=>[
|
|
119
|
+
'ios',
|
|
120
|
+
'android'
|
|
121
|
+
].includes(elem))) {
|
|
122
|
+
throw new _errors.CommandError(`Invalid value for --platform: ${platforms}`);
|
|
85
123
|
}
|
|
86
124
|
}
|
|
87
125
|
const concurrentIoLimit = args['--concurrent-io-limit'];
|
|
88
126
|
if (concurrentIoLimit && !Number.isInteger(concurrentIoLimit)) {
|
|
89
|
-
throw new
|
|
127
|
+
throw new _errors.CommandError(`Invalid value for --concurrent-io-limit argument: ${concurrentIoLimit}`);
|
|
90
128
|
}
|
|
91
129
|
const hashAlgorithm = args['--hash-algorithm'];
|
|
92
130
|
if (hashAlgorithm && typeof hashAlgorithm !== 'string') {
|
|
93
|
-
throw new
|
|
131
|
+
throw new _errors.CommandError(`Invalid value for --hash-algorithm: ${hashAlgorithm}`);
|
|
94
132
|
}
|
|
95
133
|
const ignorePaths = args['--ignore-path'];
|
|
96
134
|
if (ignorePaths) {
|
|
97
135
|
if (!Array.isArray(ignorePaths)) {
|
|
98
|
-
throw new
|
|
136
|
+
throw new _errors.CommandError(`Invalid value for --ignore-path`);
|
|
99
137
|
}
|
|
100
|
-
if (!ignorePaths.every((elem)
|
|
101
|
-
throw new
|
|
138
|
+
if (!ignorePaths.every((elem)=>typeof elem === 'string')) {
|
|
139
|
+
throw new _errors.CommandError(`Invalid value for --ignore-path: ${ignorePaths}`);
|
|
102
140
|
}
|
|
103
141
|
}
|
|
104
142
|
const sourceSkips = args['--source-skips'];
|
|
105
143
|
if (sourceSkips && !Number.isInteger(sourceSkips)) {
|
|
106
|
-
throw new
|
|
144
|
+
throw new _errors.CommandError(`Invalid value for --source-skips argument: ${sourceSkips}`);
|
|
145
|
+
}
|
|
146
|
+
const preset = args['--preset'];
|
|
147
|
+
if (preset && ![
|
|
148
|
+
'strict',
|
|
149
|
+
'balanced',
|
|
150
|
+
'relaxed'
|
|
151
|
+
].includes(preset)) {
|
|
152
|
+
throw new _errors.CommandError(`Invalid value for --preset argument: ${preset}. Supported presets are 'strict', 'balanced', and 'relaxed'.`);
|
|
107
153
|
}
|
|
108
154
|
const options = {
|
|
109
155
|
debug: !!process.env.DEBUG || args['--debug'],
|
|
110
156
|
silent: true,
|
|
111
|
-
useRNCoreAutolinkingFromExpo: process.env['USE_RNCORE_AUTOLINKING_FROM_EXPO']
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
...
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
...
|
|
157
|
+
useRNCoreAutolinkingFromExpo: process.env['USE_RNCORE_AUTOLINKING_FROM_EXPO'] ? (0, _getenv().boolish)('USE_RNCORE_AUTOLINKING_FROM_EXPO') : undefined,
|
|
158
|
+
...preset ? {
|
|
159
|
+
preset
|
|
160
|
+
} : null,
|
|
161
|
+
...platforms ? {
|
|
162
|
+
platforms
|
|
163
|
+
} : null,
|
|
164
|
+
...concurrentIoLimit ? {
|
|
165
|
+
concurrentIoLimit
|
|
166
|
+
} : null,
|
|
167
|
+
...hashAlgorithm ? {
|
|
168
|
+
hashAlgorithm
|
|
169
|
+
} : null,
|
|
170
|
+
...ignorePaths ? {
|
|
171
|
+
ignorePaths
|
|
172
|
+
} : null,
|
|
173
|
+
...sourceSkips ? {
|
|
174
|
+
sourceSkips
|
|
175
|
+
} : null
|
|
119
176
|
};
|
|
120
|
-
const projectRoot = (0,
|
|
121
|
-
const result = await (0,
|
|
177
|
+
const projectRoot = (0, _args.getProjectRoot)(args);
|
|
178
|
+
const result = await (0, _withConsoleDisabledAsync.withConsoleDisabledAsync)(async ()=>{
|
|
122
179
|
try {
|
|
123
|
-
return await (0,
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
throw new errors_1.CommandError(e.message);
|
|
180
|
+
return await (0, _index.createFingerprintAsync)(projectRoot, options);
|
|
181
|
+
} catch (e) {
|
|
182
|
+
throw new _errors.CommandError(e.message);
|
|
127
183
|
}
|
|
128
184
|
});
|
|
129
185
|
console.log(JSON.stringify(result));
|
|
130
186
|
};
|
|
131
|
-
|
|
187
|
+
|
|
188
|
+
//# sourceMappingURL=generateFingerprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["commands/generateFingerprint.ts"],"sourcesContent":[null],"names":["generateFingerprintAsync","argv","args","assertArgs","Boolean","String","Number","Log","exit","chalk","platforms","Array","isArray","CommandError","every","elem","includes","concurrentIoLimit","isInteger","hashAlgorithm","ignorePaths","sourceSkips","preset","options","debug","process","env","DEBUG","silent","useRNCoreAutolinkingFromExpo","boolish","undefined","projectRoot","getProjectRoot","result","withConsoleDisabledAsync","createFingerprintAsync","e","message","console","log","JSON","stringify"],"mappings":";;;;+BAUaA;;;eAAAA;;;;gEAVK;;;;;;;yBACM;;;;;;uBAE2C;sBAExB;wBACd;6DACR;0CACoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElC,MAAMA,2BAAoC,OAAOC;IACtD,MAAMC,OAAOC,IAAAA,gBAAU,EACrB;QACE,QAAQ;QACR,UAAUC;QACV,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|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "runLegacyCLIAsync", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return runLegacyCLIAsync;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _index = require("../../build/index.js");
|
|
12
|
+
const _readFingerprintFileAsync = /*#__PURE__*/ _interop_require_default(require("./utils/readFingerprintFileAsync.js"));
|
|
13
|
+
function _interop_require_default(obj) {
|
|
14
|
+
return obj && obj.__esModule ? obj : {
|
|
15
|
+
default: obj
|
|
16
|
+
};
|
|
17
|
+
}
|
|
9
18
|
async function runLegacyCLIAsync(args) {
|
|
10
19
|
const projectRoot = args[0];
|
|
11
|
-
if (projectRoot == null ||
|
|
20
|
+
if (projectRoot == null || args.length !== 1 && args.length !== 2 && args.length !== 3) {
|
|
12
21
|
console.log(`Usage: npx @expo/fingerprint <projectRoot> [fingerprintFile1ToDiff] [fingerprintFile2ToDiff]`);
|
|
13
22
|
process.exit(1);
|
|
14
23
|
}
|
|
15
24
|
const fingerprintFile1ToDiff = args[1];
|
|
16
25
|
const fingerprintFile2ToDiff = args[2];
|
|
17
26
|
const [fingerprint1ToDiff, fingerprint2ToDiff] = await Promise.all([
|
|
18
|
-
fingerprintFile1ToDiff ? (0,
|
|
19
|
-
fingerprintFile2ToDiff ? (0,
|
|
27
|
+
fingerprintFile1ToDiff ? (0, _readFingerprintFileAsync.default)(fingerprintFile1ToDiff) : null,
|
|
28
|
+
fingerprintFile2ToDiff ? (0, _readFingerprintFileAsync.default)(fingerprintFile2ToDiff) : null
|
|
20
29
|
]);
|
|
21
30
|
const options = {
|
|
22
31
|
debug: !!process.env.DEBUG,
|
|
23
|
-
useRNCoreAutolinkingFromExpo: process.env.USE_RNCORE_AUTOLINKING_FROM_EXPO
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
useRNCoreAutolinkingFromExpo: process.env.USE_RNCORE_AUTOLINKING_FROM_EXPO ? [
|
|
33
|
+
'1',
|
|
34
|
+
'true'
|
|
35
|
+
].includes(process.env.USE_RNCORE_AUTOLINKING_FROM_EXPO) : undefined
|
|
26
36
|
};
|
|
27
37
|
try {
|
|
28
38
|
if (fingerprint1ToDiff && fingerprint2ToDiff) {
|
|
29
|
-
const diff = (0,
|
|
39
|
+
const diff = (0, _index.diffFingerprints)(fingerprint1ToDiff, fingerprint2ToDiff);
|
|
30
40
|
console.log(JSON.stringify(diff, null, 2));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const diff = await (0, index_js_1.diffFingerprintChangesAsync)(fingerprint1ToDiff, projectRoot, options);
|
|
41
|
+
} else if (fingerprint1ToDiff) {
|
|
42
|
+
const diff = await (0, _index.diffFingerprintChangesAsync)(fingerprint1ToDiff, projectRoot, options);
|
|
34
43
|
console.log(JSON.stringify(diff, null, 2));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const fingerprint = await (0, index_js_1.createFingerprintAsync)(projectRoot, options);
|
|
44
|
+
} else {
|
|
45
|
+
const fingerprint = await (0, _index.createFingerprintAsync)(projectRoot, options);
|
|
38
46
|
console.log(JSON.stringify(fingerprint, null, 2));
|
|
39
47
|
}
|
|
40
|
-
}
|
|
41
|
-
catch (e) {
|
|
48
|
+
} catch (e) {
|
|
42
49
|
console.error('Uncaught Error', e);
|
|
43
50
|
process.exit(1);
|
|
44
51
|
}
|
|
45
52
|
}
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=runLegacyCLIAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["runLegacyCLIAsync.ts"],"sourcesContent":[null],"names":["runLegacyCLIAsync","args","projectRoot","length","console","log","process","exit","fingerprintFile1ToDiff","fingerprintFile2ToDiff","fingerprint1ToDiff","fingerprint2ToDiff","Promise","all","readFingerprintFileAsync","options","debug","env","DEBUG","useRNCoreAutolinkingFromExpo","USE_RNCORE_AUTOLINKING_FROM_EXPO","includes","undefined","diff","diffFingerprints","JSON","stringify","diffFingerprintChangesAsync","fingerprint","createFingerprintAsync","e","error"],"mappings":";;;;+BAOsBA;;;eAAAA;;;uBAHf;iFAC8B;;;;;;AAE9B,eAAeA,kBAAkBC,IAAc;IACpD,MAAMC,cAAcD,IAAI,CAAC,EAAE;IAE3B,IAAIC,eAAe,QAASD,KAAKE,MAAM,KAAK,KAAKF,KAAKE,MAAM,KAAK,KAAKF,KAAKE,MAAM,KAAK,GAAI;QACxFC,QAAQC,GAAG,CACT,CAAC,4FAA4F,CAAC;QAEhGC,QAAQC,IAAI,CAAC;IACf;IAEA,MAAMC,yBAAyBP,IAAI,CAAC,EAAE;IACtC,MAAMQ,yBAAyBR,IAAI,CAAC,EAAE;IAEtC,MAAM,CAACS,oBAAoBC,mBAAmB,GAAG,MAAMC,QAAQC,GAAG,CAAC;QACjEL,yBAAyBM,IAAAA,iCAAwB,EAACN,0BAA0B;QAC5EC,yBAAyBK,IAAAA,iCAAwB,EAACL,0BAA0B;KAC7E;IAED,MAAMM,UAAU;QACdC,OAAO,CAAC,CAACV,QAAQW,GAAG,CAACC,KAAK;QAC1BC,8BAA8Bb,QAAQW,GAAG,CAACG,gCAAgC,GACtE;YAAC;YAAK;SAAO,CAACC,QAAQ,CAACf,QAAQW,GAAG,CAACG,gCAAgC,IACnEE;IACN;IACA,IAAI;QACF,IAAIZ,sBAAsBC,oBAAoB;YAC5C,MAAMY,OAAOC,IAAAA,uBAAgB,EAACd,oBAAoBC;YAClDP,QAAQC,GAAG,CAACoB,KAAKC,SAAS,CAACH,MAAM,MAAM;QACzC,OAAO,IAAIb,oBAAoB;YAC7B,MAAMa,OAAO,MAAMI,IAAAA,kCAA2B,EAACjB,oBAAoBR,aAAaa;YAChFX,QAAQC,GAAG,CAACoB,KAAKC,SAAS,CAACH,MAAM,MAAM;QACzC,OAAO;YACL,MAAMK,cAAc,MAAMC,IAAAA,6BAAsB,EAAC3B,aAAaa;YAC9DX,QAAQC,GAAG,CAACoB,KAAKC,SAAS,CAACE,aAAa,MAAM;QAChD;IACF,EAAE,OAAOE,GAAG;QACV1B,QAAQ2B,KAAK,CAAC,kBAAkBD;QAChCxB,QAAQC,IAAI,CAAC;IACf;AACF"}
|
package/cli/build/utils/args.js
CHANGED
|
@@ -1,88 +1,129 @@
|
|
|
1
|
+
// Common utilities for interacting with `args` library.
|
|
2
|
+
// These functions should be used by every command.
|
|
1
3
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
0 && (module.exports = {
|
|
8
|
+
assertArgs: null,
|
|
9
|
+
getFileArgumentAtIndex: null,
|
|
10
|
+
getProjectRoot: null,
|
|
11
|
+
requireArg: 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 assertArgs () {
|
|
21
|
+
return assertArgs;
|
|
22
|
+
},
|
|
23
|
+
get getFileArgumentAtIndex () {
|
|
24
|
+
return getFileArgumentAtIndex;
|
|
25
|
+
},
|
|
26
|
+
get getProjectRoot () {
|
|
27
|
+
return getProjectRoot;
|
|
28
|
+
},
|
|
29
|
+
get requireArg () {
|
|
30
|
+
return requireArg;
|
|
7
31
|
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
32
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
33
|
+
function _arg() {
|
|
34
|
+
const data = /*#__PURE__*/ _interop_require_default(require("arg"));
|
|
35
|
+
_arg = function() {
|
|
36
|
+
return data;
|
|
26
37
|
};
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return
|
|
38
|
+
return data;
|
|
39
|
+
}
|
|
40
|
+
function _fs() {
|
|
41
|
+
const data = require("fs");
|
|
42
|
+
_fs = function() {
|
|
43
|
+
return data;
|
|
33
44
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
47
|
+
function _path() {
|
|
48
|
+
const data = require("path");
|
|
49
|
+
_path = function() {
|
|
50
|
+
return data;
|
|
51
|
+
};
|
|
52
|
+
return data;
|
|
53
|
+
}
|
|
54
|
+
const _log = /*#__PURE__*/ _interop_require_wildcard(require("./log"));
|
|
55
|
+
function _interop_require_default(obj) {
|
|
56
|
+
return obj && obj.__esModule ? obj : {
|
|
57
|
+
default: obj
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
61
|
+
if (typeof WeakMap !== "function") return null;
|
|
62
|
+
var cacheBabelInterop = new WeakMap();
|
|
63
|
+
var cacheNodeInterop = new WeakMap();
|
|
64
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
65
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
66
|
+
})(nodeInterop);
|
|
67
|
+
}
|
|
68
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
69
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
70
|
+
return obj;
|
|
71
|
+
}
|
|
72
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
73
|
+
return {
|
|
74
|
+
default: obj
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
78
|
+
if (cache && cache.has(obj)) {
|
|
79
|
+
return cache.get(obj);
|
|
80
|
+
}
|
|
81
|
+
var newObj = {
|
|
82
|
+
__proto__: null
|
|
83
|
+
};
|
|
84
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
85
|
+
for(var key in obj){
|
|
86
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
87
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
88
|
+
if (desc && (desc.get || desc.set)) {
|
|
89
|
+
Object.defineProperty(newObj, key, desc);
|
|
90
|
+
} else {
|
|
91
|
+
newObj[key] = obj[key];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
newObj.default = obj;
|
|
96
|
+
if (cache) {
|
|
97
|
+
cache.set(obj, newObj);
|
|
98
|
+
}
|
|
99
|
+
return newObj;
|
|
100
|
+
}
|
|
54
101
|
function getProjectRoot(args) {
|
|
55
|
-
const projectRoot = (0,
|
|
56
|
-
if (!(0,
|
|
57
|
-
|
|
102
|
+
const projectRoot = (0, _path().resolve)(args._[0] || '.');
|
|
103
|
+
if (!(0, _fs().existsSync)(projectRoot)) {
|
|
104
|
+
_log.exit(`Invalid project root: ${projectRoot}`);
|
|
58
105
|
}
|
|
59
106
|
return projectRoot;
|
|
60
107
|
}
|
|
61
108
|
function getFileArgumentAtIndex(args, index) {
|
|
62
109
|
if (args._[index] == null) {
|
|
63
|
-
|
|
110
|
+
_log.exit(`Argument at index ${index} is not set`);
|
|
64
111
|
}
|
|
65
|
-
const path = (0,
|
|
66
|
-
if (!(0,
|
|
67
|
-
|
|
112
|
+
const path = (0, _path().resolve)(args._[index]);
|
|
113
|
+
if (!(0, _fs().existsSync)(path)) {
|
|
114
|
+
_log.exit(`Invalid file: ${path}`);
|
|
68
115
|
}
|
|
69
116
|
return path;
|
|
70
117
|
}
|
|
71
|
-
/**
|
|
72
|
-
* Parse args and assert unknown options.
|
|
73
|
-
*
|
|
74
|
-
* @param schema the `args` schema for parsing the command line arguments.
|
|
75
|
-
* @param argv extra strings
|
|
76
|
-
* @returns processed args object.
|
|
77
|
-
*/
|
|
78
118
|
function assertArgs(schema, argv) {
|
|
79
119
|
try {
|
|
80
|
-
return (0,
|
|
81
|
-
|
|
82
|
-
|
|
120
|
+
return (0, _arg().default)(schema, {
|
|
121
|
+
argv
|
|
122
|
+
});
|
|
123
|
+
} catch (error) {
|
|
83
124
|
// Ensure unknown options are handled the same way.
|
|
84
125
|
if (error.code === 'ARG_UNKNOWN_OPTION') {
|
|
85
|
-
|
|
126
|
+
_log.exit(error.message, 1);
|
|
86
127
|
}
|
|
87
128
|
// Otherwise rethrow the error.
|
|
88
129
|
throw error;
|
|
@@ -91,7 +132,9 @@ function assertArgs(schema, argv) {
|
|
|
91
132
|
function requireArg(args, name) {
|
|
92
133
|
const value = args[name];
|
|
93
134
|
if (value === undefined || value === null) {
|
|
94
|
-
|
|
135
|
+
_log.exit(`${name} must be provided`, 1);
|
|
95
136
|
}
|
|
96
137
|
return value;
|
|
97
138
|
}
|
|
139
|
+
|
|
140
|
+
//# sourceMappingURL=args.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["utils/args.ts"],"sourcesContent":[null],"names":["assertArgs","getFileArgumentAtIndex","getProjectRoot","requireArg","args","projectRoot","resolve","_","existsSync","Log","exit","index","path","schema","argv","arg","error","code","message","name","value","undefined"],"mappings":"AAAA,wDAAwD;AACxD,mDAAmD;;;;;;;;;;;;;;;;;;QAwCnCA;eAAAA;;QAlBAC;eAAAA;;QAVAC;eAAAA;;QAyCAC;eAAAA;;;;gEApDA;;;;;;;yBACW;;;;;;;yBACH;;;;;;6DAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOd,SAASD,eAAeE,IAA0B;IACvD,MAAMC,cAAcC,IAAAA,eAAO,EAACF,KAAKG,CAAC,CAAC,EAAE,IAAI;IAEzC,IAAI,CAACC,IAAAA,gBAAU,EAACH,cAAc;QAC5BI,KAAIC,IAAI,CAAC,CAAC,sBAAsB,EAAEL,aAAa;IACjD;IAEA,OAAOA;AACT;AAEO,SAASJ,uBAAuBG,IAA0B,EAAEO,KAAa;IAC9E,IAAIP,KAAKG,CAAC,CAACI,MAAM,IAAI,MAAM;QACzBF,KAAIC,IAAI,CAAC,CAAC,kBAAkB,EAAEC,MAAM,WAAW,CAAC;IAClD;IACA,MAAMC,OAAON,IAAAA,eAAO,EAACF,KAAKG,CAAC,CAACI,MAAM;IAClC,IAAI,CAACH,IAAAA,gBAAU,EAACI,OAAO;QACrBH,KAAIC,IAAI,CAAC,CAAC,cAAc,EAAEE,MAAM;IAClC;IACA,OAAOA;AACT;AASO,SAASZ,WAAWa,MAAgB,EAAEC,IAAc;IACzD,IAAI;QACF,OAAOC,IAAAA,cAAG,EAACF,QAAQ;YAAEC;QAAK;IAC5B,EAAE,OAAOE,OAAY;QACnB,mDAAmD;QACnD,IAAIA,MAAMC,IAAI,KAAK,sBAAsB;YACvCR,KAAIC,IAAI,CAACM,MAAME,OAAO,EAAE;QAC1B;QACA,+BAA+B;QAC/B,MAAMF;IACR;AACF;AAEO,SAASb,WAAWC,IAA0B,EAAEe,IAAS;IAC9D,MAAMC,QAAQhB,IAAI,CAACe,KAAK;IACxB,IAAIC,UAAUC,aAAaD,UAAU,MAAM;QACzCX,KAAIC,IAAI,CAAC,GAAGS,KAAK,iBAAiB,CAAC,EAAE;IACvC;IACA,OAAOC;AACT"}
|
|
@@ -1,24 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
0 && (module.exports = {
|
|
6
|
+
CommandError: null,
|
|
7
|
+
logCmdError: 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 CommandError () {
|
|
17
|
+
return CommandError;
|
|
18
|
+
},
|
|
19
|
+
get logCmdError () {
|
|
20
|
+
return logCmdError;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
function _assert() {
|
|
24
|
+
const data = require("assert");
|
|
25
|
+
_assert = function() {
|
|
26
|
+
return data;
|
|
27
|
+
};
|
|
28
|
+
return data;
|
|
29
|
+
}
|
|
30
|
+
function _chalk() {
|
|
31
|
+
const data = /*#__PURE__*/ _interop_require_default(require("chalk"));
|
|
32
|
+
_chalk = function() {
|
|
33
|
+
return data;
|
|
34
|
+
};
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
const _log = require("./log");
|
|
38
|
+
function _interop_require_default(obj) {
|
|
39
|
+
return obj && obj.__esModule ? obj : {
|
|
40
|
+
default: obj
|
|
41
|
+
};
|
|
42
|
+
}
|
|
11
43
|
const ERROR_PREFIX = 'Error: ';
|
|
12
|
-
/**
|
|
13
|
-
* General error, formatted as a message in red text when caught by expo-cli (no stack trace is printed). Should be used in favor of `log.error()` in most cases.
|
|
14
|
-
*/
|
|
15
44
|
class CommandError extends Error {
|
|
16
45
|
code;
|
|
17
46
|
name = 'CommandError';
|
|
18
47
|
isCommandError = true;
|
|
19
|
-
constructor(code, message = '')
|
|
20
|
-
super('');
|
|
21
|
-
this.code = code;
|
|
48
|
+
constructor(code, message = ''){
|
|
49
|
+
super(''), this.code = code;
|
|
22
50
|
// If e.toString() was called to get `message` we don't want it to look
|
|
23
51
|
// like "Error: Error:".
|
|
24
52
|
if (message.startsWith(ERROR_PREFIX)) {
|
|
@@ -27,15 +55,16 @@ class CommandError extends Error {
|
|
|
27
55
|
this.message = message || code;
|
|
28
56
|
}
|
|
29
57
|
}
|
|
30
|
-
exports.CommandError = CommandError;
|
|
31
58
|
function logCmdError(error) {
|
|
32
59
|
if (!(error instanceof Error)) {
|
|
33
60
|
throw error;
|
|
34
61
|
}
|
|
35
|
-
if (error instanceof CommandError || error instanceof
|
|
62
|
+
if (error instanceof CommandError || error instanceof _assert().AssertionError) {
|
|
36
63
|
// Print the stack trace in debug mode only.
|
|
37
|
-
(0,
|
|
64
|
+
(0, _log.exit)(error);
|
|
38
65
|
}
|
|
39
|
-
const errorDetails = error.stack ? '\n' +
|
|
40
|
-
(0,
|
|
66
|
+
const errorDetails = error.stack ? '\n' + _chalk().default.gray(error.stack) : '';
|
|
67
|
+
(0, _log.exit)(_chalk().default.red(error.toString()) + errorDetails);
|
|
41
68
|
}
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=errors.js.map
|