@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.
Files changed (88) hide show
  1. package/build/Config.js +69 -44
  2. package/build/Config.js.map +1 -1
  3. package/build/Dedup.js +82 -36
  4. package/build/Dedup.js.map +1 -1
  5. package/build/ExpoConfig.d.ts +11 -2
  6. package/build/ExpoConfig.js +118 -34
  7. package/build/ExpoConfig.js.map +1 -1
  8. package/build/ExpoConfigLoader.d.ts +41 -0
  9. package/build/ExpoConfigLoader.js +185 -145
  10. package/build/ExpoConfigLoader.js.map +1 -1
  11. package/build/ExpoResolver.js +77 -43
  12. package/build/ExpoResolver.js.map +1 -1
  13. package/build/Fingerprint.js +67 -76
  14. package/build/Fingerprint.js.map +1 -1
  15. package/build/Fingerprint.types.d.ts +98 -5
  16. package/build/Fingerprint.types.js +6 -3
  17. package/build/Fingerprint.types.js.map +1 -1
  18. package/build/Options.d.ts +1 -2
  19. package/build/Options.js +101 -51
  20. package/build/Options.js.map +1 -1
  21. package/build/Presets.d.ts +26 -0
  22. package/build/Presets.js +50 -0
  23. package/build/Presets.js.map +1 -0
  24. package/build/ProjectWorkflow.js +129 -67
  25. package/build/ProjectWorkflow.js.map +1 -1
  26. package/build/Sort.js +30 -16
  27. package/build/Sort.js.map +1 -1
  28. package/build/hash/FileHookTransform.js +26 -20
  29. package/build/hash/FileHookTransform.js.map +1 -1
  30. package/build/hash/Hash.d.ts +8 -1
  31. package/build/hash/Hash.js +208 -116
  32. package/build/hash/Hash.js.map +1 -1
  33. package/build/hash/ReactImportsPatcher.js +39 -27
  34. package/build/hash/ReactImportsPatcher.js.map +1 -1
  35. package/build/index.js +40 -22
  36. package/build/index.js.map +1 -1
  37. package/build/sourcer/AutolinkingConfig.d.ts +19 -0
  38. package/build/sourcer/AutolinkingConfig.js +159 -0
  39. package/build/sourcer/AutolinkingConfig.js.map +1 -0
  40. package/build/sourcer/Bare.js +192 -94
  41. package/build/sourcer/Bare.js.map +1 -1
  42. package/build/sourcer/Expo.d.ts +3 -2
  43. package/build/sourcer/Expo.js +264 -121
  44. package/build/sourcer/Expo.js.map +1 -1
  45. package/build/sourcer/Packages.d.ts +4 -3
  46. package/build/sourcer/Packages.js +83 -23
  47. package/build/sourcer/Packages.js.map +1 -1
  48. package/build/sourcer/PatchPackage.js +32 -14
  49. package/build/sourcer/PatchPackage.js.map +1 -1
  50. package/build/sourcer/SourceSkips.d.ts +27 -2
  51. package/build/sourcer/SourceSkips.js +65 -48
  52. package/build/sourcer/SourceSkips.js.map +1 -1
  53. package/build/sourcer/Sourcer.js +57 -38
  54. package/build/sourcer/Sourcer.js.map +1 -1
  55. package/build/sourcer/Utils.d.ts +14 -0
  56. package/build/sourcer/Utils.js +113 -41
  57. package/build/sourcer/Utils.js.map +1 -1
  58. package/build/types/module.d.ts +7 -0
  59. package/build/utils/Concurrency.js +29 -22
  60. package/build/utils/Concurrency.js.map +1 -1
  61. package/build/utils/Path.d.ts +5 -0
  62. package/build/utils/Path.js +138 -75
  63. package/build/utils/Path.js.map +1 -1
  64. package/build/utils/Predicates.js +11 -3
  65. package/build/utils/Predicates.js.map +1 -1
  66. package/build/utils/Profile.js +29 -20
  67. package/build/utils/Profile.js.map +1 -1
  68. package/build/utils/SpawnIPC.js +41 -16
  69. package/build/utils/SpawnIPC.js.map +1 -1
  70. package/cli/build/cli.js +94 -60
  71. package/cli/build/cli.js.map +1 -0
  72. package/cli/build/commands/diffFingerprints.js +76 -53
  73. package/cli/build/commands/diffFingerprints.js.map +1 -0
  74. package/cli/build/commands/generateFingerprint.js +129 -72
  75. package/cli/build/commands/generateFingerprint.js.map +1 -0
  76. package/cli/build/runLegacyCLIAsync.js +31 -22
  77. package/cli/build/runLegacyCLIAsync.js.map +1 -0
  78. package/cli/build/utils/args.js +110 -67
  79. package/cli/build/utils/args.js.map +1 -0
  80. package/cli/build/utils/errors.js +49 -20
  81. package/cli/build/utils/errors.js.map +1 -0
  82. package/cli/build/utils/log.js +62 -20
  83. package/cli/build/utils/log.js.map +1 -0
  84. package/cli/build/utils/readFingerprintFileAsync.js +25 -9
  85. package/cli/build/utils/readFingerprintFileAsync.js.map +1 -0
  86. package/cli/build/utils/withConsoleDisabledAsync.js +16 -8
  87. package/cli/build/utils/withConsoleDisabledAsync.js.map +1 -0
  88. package/package.json +37 -31
@@ -1,7 +1,15 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.nonNullish = nonNullish;
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "nonNullish", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return nonNullish;
9
+ }
10
+ });
4
11
  function nonNullish(value) {
5
12
  return value !== null && value !== undefined;
6
13
  }
7
- //# sourceMappingURL=Predicates.js.map
14
+
15
+ //# sourceMappingURL=Predicates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Predicates.js","sourceRoot":"","sources":["../../src/utils/Predicates.ts"],"names":[],"mappings":";;AAAA,gCAEC;AAFD,SAAgB,UAAU,CAAS,KAAgC;IACjE,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC"}
1
+ {"version":3,"sources":["utils/Predicates.ts"],"sourcesContent":[null],"names":["nonNullish","value","undefined"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA,WAAmBC,KAAgC;IACjE,OAAOA,UAAU,QAAQA,UAAUC;AACrC"}
@@ -1,23 +1,31 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.profile = profile;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- /**
9
- * Wrap a method and profile the time it takes to execute the method using `EXPO_PROFILE`.
10
- * Works best with named functions (i.e. not arrow functions).
11
- *
12
- * @param fn function to profile.
13
- * @param functionName optional name of the function to display in the profile output.
14
- */
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "profile", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return profile;
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 _interop_require_default(obj) {
19
+ return obj && obj.__esModule ? obj : {
20
+ default: obj
21
+ };
22
+ }
15
23
  function profile(options, fn, functionName = fn.name) {
16
24
  if (!process.env['DEBUG'] || options.silent) {
17
25
  return fn;
18
26
  }
19
- const name = chalk_1.default.dim(`⏱ [profile] ${functionName ?? 'unknown'}`);
20
- return ((...args) => {
27
+ const name = _chalk().default.dim(`⏱ [profile] ${functionName ?? 'unknown'}`);
28
+ return (...args)=>{
21
29
  // Start the timer.
22
30
  console.time(name);
23
31
  // Invoke the method.
@@ -28,15 +36,16 @@ function profile(options, fn, functionName = fn.name) {
28
36
  return results;
29
37
  }
30
38
  // Otherwise await to profile after the promise resolves.
31
- return new Promise((resolve, reject) => {
32
- results.then((results) => {
39
+ return new Promise((resolve, reject)=>{
40
+ results.then((results)=>{
33
41
  resolve(results);
34
42
  console.timeEnd(name);
35
- }, (reason) => {
43
+ }, (reason)=>{
36
44
  reject(reason);
37
45
  console.timeEnd(name);
38
46
  });
39
47
  });
40
- });
48
+ };
41
49
  }
42
- //# sourceMappingURL=Profile.js.map
50
+
51
+ //# sourceMappingURL=Profile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Profile.js","sourceRoot":"","sources":["../../src/utils/Profile.ts"],"names":[],"mappings":";;;;;AAWA,0BAsCC;AAjDD,kDAA0B;AAI1B;;;;;;GAMG;AACH,SAAgB,OAAO,CACrB,OAA0B,EAC1B,EAAK,EACL,eAAuB,EAAE,CAAC,IAAI;IAE9B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QAC5C,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,IAAI,GAAG,eAAK,CAAC,GAAG,CAAC,gBAAgB,YAAY,IAAI,SAAS,EAAE,CAAC,CAAC;IAEpE,OAAO,CAAC,CAAC,GAAG,IAAW,EAAE,EAAE;QACzB,mBAAmB;QACnB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnB,qBAAqB;QACrB,MAAM,OAAO,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QAE5B,oCAAoC;QACpC,IAAI,CAAC,CAAC,OAAO,YAAY,OAAO,CAAC,EAAE,CAAC;YAClC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACtB,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,yDAAyD;QACzD,OAAO,IAAI,OAAO,CAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC7D,OAAO,CAAC,IAAI,CACV,CAAC,OAAO,EAAE,EAAE;gBACV,OAAO,CAAC,OAAO,CAAC,CAAC;gBACjB,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC,EACD,CAAC,MAAM,EAAE,EAAE;gBACT,MAAM,CAAC,MAAM,CAAC,CAAC;gBACf,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAM,CAAC;AACV,CAAC"}
1
+ {"version":3,"sources":["utils/Profile.ts"],"sourcesContent":[null],"names":["profile","options","fn","functionName","name","process","env","silent","chalk","dim","args","console","time","results","Promise","timeEnd","resolve","reject","then","reason"],"mappings":";;;;+BAWgBA;;;eAAAA;;;;gEAXE;;;;;;;;;;;AAWX,SAASA,QACdC,OAA0B,EAC1BC,EAAK,EACLC,eAAuBD,GAAGE,IAAI;IAE9B,IAAI,CAACC,QAAQC,GAAG,CAAC,QAAQ,IAAIL,QAAQM,MAAM,EAAE;QAC3C,OAAOL;IACT;IAEA,MAAME,OAAOI,gBAAK,CAACC,GAAG,CAAC,CAAC,aAAa,EAAEN,gBAAgB,WAAW;IAElE,OAAQ,CAAC,GAAGO;QACV,mBAAmB;QACnBC,QAAQC,IAAI,CAACR;QAEb,qBAAqB;QACrB,MAAMS,UAAUX,MAAMQ;QAEtB,oCAAoC;QACpC,IAAI,CAAEG,CAAAA,mBAAmBC,OAAM,GAAI;YACjCH,QAAQI,OAAO,CAACX;YAChB,OAAOS;QACT;QAEA,yDAAyD;QACzD,OAAO,IAAIC,QAAgC,CAACE,SAASC;YACnDJ,QAAQK,IAAI,CACV,CAACL;gBACCG,QAAQH;gBACRF,QAAQI,OAAO,CAACX;YAClB,GACA,CAACe;gBACCF,OAAOE;gBACPR,QAAQI,OAAO,CAACX;YAClB;QAEJ;IACF;AACF"}
@@ -1,21 +1,45 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.spawnWithIpcAsync = spawnWithIpcAsync;
7
- const spawn_async_1 = __importDefault(require("@expo/spawn-async"));
8
- const node_assert_1 = __importDefault(require("node:assert"));
9
- async function spawnWithIpcAsync(command, args, options
10
- // @ts-expect-error: spawnAsync returns a customized Promise
11
- ) {
12
- (0, node_assert_1.default)(options?.stdio == null, 'Cannot override stdio when using IPC');
13
- const promise = (0, spawn_async_1.default)(command, args, {
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "spawnWithIpcAsync", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return spawnWithIpcAsync;
9
+ }
10
+ });
11
+ function _spawnasync() {
12
+ const data = /*#__PURE__*/ _interop_require_default(require("@expo/spawn-async"));
13
+ _spawnasync = function() {
14
+ return data;
15
+ };
16
+ return data;
17
+ }
18
+ function _nodeassert() {
19
+ const data = /*#__PURE__*/ _interop_require_default(require("node:assert"));
20
+ _nodeassert = function() {
21
+ return data;
22
+ };
23
+ return data;
24
+ }
25
+ function _interop_require_default(obj) {
26
+ return obj && obj.__esModule ? obj : {
27
+ default: obj
28
+ };
29
+ }
30
+ async function spawnWithIpcAsync(command, args, options) {
31
+ (0, _nodeassert().default)(options?.stdio == null, 'Cannot override stdio when using IPC');
32
+ const promise = (0, _spawnasync().default)(command, args, {
14
33
  ...options,
15
- stdio: ['pipe', 'pipe', 'pipe', 'ipc'],
34
+ stdio: [
35
+ 'pipe',
36
+ 'pipe',
37
+ 'pipe',
38
+ 'ipc'
39
+ ]
16
40
  });
17
41
  const messageChunks = [];
18
- const appendMessage = (message) => {
42
+ const appendMessage = (message)=>{
19
43
  messageChunks.push(message);
20
44
  };
21
45
  promise.child.on('message', appendMessage);
@@ -23,7 +47,8 @@ async function spawnWithIpcAsync(command, args, options
23
47
  promise.child.off('message', appendMessage);
24
48
  return {
25
49
  ...result,
26
- message: messageChunks.join(''),
50
+ message: messageChunks.join('')
27
51
  };
28
52
  }
29
- //# sourceMappingURL=SpawnIPC.js.map
53
+
54
+ //# sourceMappingURL=SpawnIPC.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpawnIPC.js","sourceRoot":"","sources":["../../src/utils/SpawnIPC.ts"],"names":[],"mappings":";;;;;AAWA,8CAwBC;AAnCD,oEAI2B;AAC3B,8DAAiC;AAM1B,KAAK,UAAU,iBAAiB,CACrC,OAAe,EACf,IAAe,EACf,OAAsB;AACtB,4DAA4D;;IAE5D,IAAA,qBAAM,EAAC,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,sCAAsC,CAAC,CAAC;IAEvE,MAAM,OAAO,GAAG,IAAA,qBAAU,EAAC,OAAO,EAAE,IAAI,EAAE;QACxC,GAAG,OAAO;QACV,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;KACvC,CAAC,CAAC;IAEH,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,MAAM,aAAa,GAAG,CAAC,OAAY,EAAE,EAAE;QACrC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC;IACF,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAC3C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;IAC7B,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAC5C,OAAO;QACL,GAAG,MAAM;QACT,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;KAChC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"sources":["utils/SpawnIPC.ts"],"sourcesContent":[null],"names":["spawnWithIpcAsync","command","args","options","assert","stdio","promise","spawnAsync","messageChunks","appendMessage","message","push","child","on","result","off","join"],"mappings":";;;;+BAWsBA;;;eAAAA;;;;gEAPf;;;;;;;gEACY;;;;;;;;;;;AAMZ,eAAeA,kBACpBC,OAAe,EACfC,IAAe,EACfC,OAAsB;IAGtBC,IAAAA,qBAAM,EAACD,SAASE,SAAS,MAAM;IAE/B,MAAMC,UAAUC,IAAAA,qBAAU,EAACN,SAASC,MAAM;QACxC,GAAGC,OAAO;QACVE,OAAO;YAAC;YAAQ;YAAQ;YAAQ;SAAM;IACxC;IAEA,MAAMG,gBAA0B,EAAE;IAClC,MAAMC,gBAAgB,CAACC;QACrBF,cAAcG,IAAI,CAACD;IACrB;IACAJ,QAAQM,KAAK,CAACC,EAAE,CAAC,WAAWJ;IAC5B,MAAMK,SAAS,MAAMR;IACrBA,QAAQM,KAAK,CAACG,GAAG,CAAC,WAAWN;IAC7B,OAAO;QACL,GAAGK,MAAM;QACTJ,SAASF,cAAcQ,IAAI,CAAC;IAC9B;AACF"}
package/cli/build/cli.js CHANGED
@@ -1,69 +1,104 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
18
5
  });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
6
+ function _arg() {
7
+ const data = /*#__PURE__*/ _interop_require_default(require("arg"));
8
+ _arg = function() {
9
+ return data;
27
10
  };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
11
+ return data;
12
+ }
13
+ function _chalk() {
14
+ const data = /*#__PURE__*/ _interop_require_default(require("chalk"));
15
+ _chalk = function() {
16
+ return data;
34
17
  };
35
- })();
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- const arg_1 = __importDefault(require("arg"));
41
- const chalk_1 = __importDefault(require("chalk"));
42
- const debug_1 = __importDefault(require("debug"));
43
- const getenv_1 = require("getenv");
44
- const runLegacyCLIAsync_1 = require("./runLegacyCLIAsync");
45
- const errors_1 = require("./utils/errors");
46
- const Log = __importStar(require("./utils/log"));
47
- // Setup before requiring `debug`.
48
- if ((0, getenv_1.boolish)('EXPO_DEBUG', false)) {
49
- debug_1.default.enable('@expo/fingerprint:*');
18
+ return data;
19
+ }
20
+ function _debug() {
21
+ const data = /*#__PURE__*/ _interop_require_default(require("debug"));
22
+ _debug = function() {
23
+ return data;
24
+ };
25
+ return data;
26
+ }
27
+ function _getenv() {
28
+ const data = require("getenv");
29
+ _getenv = function() {
30
+ return data;
31
+ };
32
+ return data;
33
+ }
34
+ const _runLegacyCLIAsync = require("./runLegacyCLIAsync");
35
+ const _errors = require("./utils/errors");
36
+ const _log = /*#__PURE__*/ _interop_require_wildcard(require("./utils/log"));
37
+ function _interop_require_default(obj) {
38
+ return obj && obj.__esModule ? obj : {
39
+ default: obj
40
+ };
41
+ }
42
+ function _getRequireWildcardCache(nodeInterop) {
43
+ if (typeof WeakMap !== "function") return null;
44
+ var cacheBabelInterop = new WeakMap();
45
+ var cacheNodeInterop = new WeakMap();
46
+ return (_getRequireWildcardCache = function(nodeInterop) {
47
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
48
+ })(nodeInterop);
50
49
  }
51
- else if (debug_1.default.enabled('@expo/fingerprint:')) {
50
+ function _interop_require_wildcard(obj, nodeInterop) {
51
+ if (!nodeInterop && obj && obj.__esModule) {
52
+ return obj;
53
+ }
54
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
55
+ return {
56
+ default: obj
57
+ };
58
+ }
59
+ var cache = _getRequireWildcardCache(nodeInterop);
60
+ if (cache && cache.has(obj)) {
61
+ return cache.get(obj);
62
+ }
63
+ var newObj = {
64
+ __proto__: null
65
+ };
66
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
67
+ for(var key in obj){
68
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
69
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
70
+ if (desc && (desc.get || desc.set)) {
71
+ Object.defineProperty(newObj, key, desc);
72
+ } else {
73
+ newObj[key] = obj[key];
74
+ }
75
+ }
76
+ }
77
+ newObj.default = obj;
78
+ if (cache) {
79
+ cache.set(obj, newObj);
80
+ }
81
+ return newObj;
82
+ }
83
+ // Setup before requiring `debug`.
84
+ if ((0, _getenv().boolish)('EXPO_DEBUG', false)) {
85
+ _debug().default.enable('@expo/fingerprint:*');
86
+ } else if (_debug().default.enabled('@expo/fingerprint:')) {
52
87
  process.env.EXPO_DEBUG = '1';
53
88
  }
54
89
  const commands = {
55
90
  // Add a new command here
56
- 'fingerprint:generate': () => import('./commands/generateFingerprint.js').then((i) => i.generateFingerprintAsync),
57
- 'fingerprint:diff': () => import('./commands/diffFingerprints.js').then((i) => i.diffFingerprintsAsync),
91
+ 'fingerprint:generate': ()=>import('./commands/generateFingerprint.js').then((i)=>i.generateFingerprintAsync),
92
+ 'fingerprint:diff': ()=>import('./commands/diffFingerprints.js').then((i)=>i.diffFingerprintsAsync)
58
93
  };
59
- const args = (0, arg_1.default)({
94
+ const args = (0, _arg().default)({
60
95
  // Types
61
96
  '--version': Boolean,
62
97
  '--help': Boolean,
63
98
  // Aliases
64
- '-h': '--help',
99
+ '-h': '--help'
65
100
  }, {
66
- permissive: true,
101
+ permissive: true
67
102
  });
68
103
  if (args['--version']) {
69
104
  // Version is added in the build script.
@@ -74,8 +109,8 @@ if (args['--version']) {
74
109
  const command = args._[0];
75
110
  const commandArgs = args._.slice(1);
76
111
  // Handle `--help` flag
77
- if ((args['--help'] && !command) || !command) {
78
- Log.exit((0, chalk_1.default) `
112
+ if (args['--help'] && !command || !command) {
113
+ _log.exit((0, _chalk().default)`
79
114
  {bold Usage}
80
115
  {dim $} npx @expo/fingerprint <command>
81
116
 
@@ -94,13 +129,12 @@ if (args['--help']) {
94
129
  commandArgs.push('--help');
95
130
  }
96
131
  // Install exit hooks
97
- process.on('SIGINT', () => process.exit(0));
98
- process.on('SIGTERM', () => process.exit(0));
132
+ process.on('SIGINT', ()=>process.exit(0));
133
+ process.on('SIGTERM', ()=>process.exit(0));
99
134
  if (!commands[command]) {
100
- (0, runLegacyCLIAsync_1.runLegacyCLIAsync)(args._).catch(errors_1.logCmdError);
101
- }
102
- else {
103
- commands[command]()
104
- .then((exec) => exec(commandArgs))
105
- .catch(errors_1.logCmdError);
135
+ (0, _runLegacyCLIAsync.runLegacyCLIAsync)(args._).catch(_errors.logCmdError);
136
+ } else {
137
+ commands[command]().then((exec)=>exec(commandArgs)).catch(_errors.logCmdError);
106
138
  }
139
+
140
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["cli.ts"],"sourcesContent":[null],"names":["boolish","Debug","enable","enabled","process","env","EXPO_DEBUG","commands","then","i","generateFingerprintAsync","diffFingerprintsAsync","args","arg","Boolean","permissive","packageJSON","require","console","log","version","exit","command","_","commandArgs","slice","Log","chalk","Object","keys","sort","join","push","on","runLegacyCLIAsync","catch","logCmdError","exec"],"mappings":";;;;;;gEACgB;;;;;;;gEACE;;;;;;;gEACA;;;;;;;yBACM;;;;;;mCAEU;wBACN;6DACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErB,kCAAkC;AAClC,IAAIA,IAAAA,iBAAO,EAAC,cAAc,QAAQ;IAChCC,gBAAK,CAACC,MAAM,CAAC;AACf,OAAO,IAAID,gBAAK,CAACE,OAAO,CAAC,uBAAuB;IAC9CC,QAAQC,GAAG,CAACC,UAAU,GAAG;AAC3B;AAIA,MAAMC,WAA0D;IAC9D,yBAAyB;IACzB,wBAAwB,IACtB,MAAM,CAAC,qCAAqCC,IAAI,CAAC,CAACC,IAAMA,EAAEC,wBAAwB;IACpF,oBAAoB,IAClB,MAAM,CAAC,kCAAkCF,IAAI,CAAC,CAACC,IAAMA,EAAEE,qBAAqB;AAChF;AAEA,MAAMC,OAAOC,IAAAA,cAAG,EACd;IACE,QAAQ;IACR,aAAaC;IACb,UAAUA;IAEV,UAAU;IACV,MAAM;AACR,GACA;IACEC,YAAY;AACd;AAGF,IAAIH,IAAI,CAAC,YAAY,EAAE;IACrB,wCAAwC;IACxC,MAAMI,cAAcC,QAAQ;IAC5BC,QAAQC,GAAG,CAACH,YAAYI,OAAO;IAC/BhB,QAAQiB,IAAI,CAAC;AACf;AAEA,MAAMC,UAAUV,KAAKW,CAAC,CAAC,EAAE;AACzB,MAAMC,cAAcZ,KAAKW,CAAC,CAACE,KAAK,CAAC;AAEjC,uBAAuB;AACvB,IAAI,AAACb,IAAI,CAAC,SAAS,IAAI,CAACU,WAAY,CAACA,SAAS;IAC5CI,KAAIL,IAAI,CACNM,IAAAA,gBAAK,CAAA,CAAC;;;;;EAKR,EAAEC,OAAOC,IAAI,CAACtB,UAAUuB,IAAI,GAAGC,IAAI,CAAC,MAAM;;;;;;;EAO1C,CAAC,EACC;AAEJ;AAEA,6CAA6C;AAC7C,IAAInB,IAAI,CAAC,SAAS,EAAE;IAClBY,YAAYQ,IAAI,CAAC;AACnB;AAEA,qBAAqB;AACrB5B,QAAQ6B,EAAE,CAAC,UAAU,IAAM7B,QAAQiB,IAAI,CAAC;AACxCjB,QAAQ6B,EAAE,CAAC,WAAW,IAAM7B,QAAQiB,IAAI,CAAC;AAEzC,IAAI,CAACd,QAAQ,CAACe,QAAQ,EAAE;IACtBY,IAAAA,oCAAiB,EAACtB,KAAKW,CAAC,EAAEY,KAAK,CAACC,mBAAW;AAC7C,OAAO;IACL7B,QAAQ,CAACe,QAAQ,GACdd,IAAI,CAAC,CAAC6B,OAASA,KAAKb,cACpBW,KAAK,CAACC,mBAAW;AACtB"}
@@ -1,57 +1,80 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "diffFingerprintsAsync", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return diffFingerprintsAsync;
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
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
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 function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
16
+ return data;
17
+ }
18
+ const _index = require("../../../build/index");
19
+ const _args = require("../utils/args");
20
+ const _errors = require("../utils/errors");
21
+ const _log = /*#__PURE__*/ _interop_require_wildcard(require("../utils/log"));
22
+ const _readFingerprintFileAsync = /*#__PURE__*/ _interop_require_default(require("../utils/readFingerprintFileAsync"));
23
+ function _interop_require_default(obj) {
24
+ return obj && obj.__esModule ? obj : {
25
+ default: obj
33
26
  };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.diffFingerprintsAsync = void 0;
40
- const chalk_1 = __importDefault(require("chalk"));
41
- const index_1 = require("../../../build/index");
42
- const args_1 = require("../utils/args");
43
- const errors_1 = require("../utils/errors");
44
- const Log = __importStar(require("../utils/log"));
45
- const readFingerprintFileAsync_1 = __importDefault(require("../utils/readFingerprintFileAsync"));
46
- const diffFingerprintsAsync = async (argv) => {
47
- const args = (0, args_1.assertArgs)({
27
+ }
28
+ function _getRequireWildcardCache(nodeInterop) {
29
+ if (typeof WeakMap !== "function") return null;
30
+ var cacheBabelInterop = new WeakMap();
31
+ var cacheNodeInterop = new WeakMap();
32
+ return (_getRequireWildcardCache = function(nodeInterop) {
33
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
34
+ })(nodeInterop);
35
+ }
36
+ function _interop_require_wildcard(obj, nodeInterop) {
37
+ if (!nodeInterop && obj && obj.__esModule) {
38
+ return obj;
39
+ }
40
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
41
+ return {
42
+ default: obj
43
+ };
44
+ }
45
+ var cache = _getRequireWildcardCache(nodeInterop);
46
+ if (cache && cache.has(obj)) {
47
+ return cache.get(obj);
48
+ }
49
+ var newObj = {
50
+ __proto__: null
51
+ };
52
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
53
+ for(var key in obj){
54
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
55
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
56
+ if (desc && (desc.get || desc.set)) {
57
+ Object.defineProperty(newObj, key, desc);
58
+ } else {
59
+ newObj[key] = obj[key];
60
+ }
61
+ }
62
+ }
63
+ newObj.default = obj;
64
+ if (cache) {
65
+ cache.set(obj, newObj);
66
+ }
67
+ return newObj;
68
+ }
69
+ const diffFingerprintsAsync = async (argv)=>{
70
+ const args = (0, _args.assertArgs)({
48
71
  // Types
49
72
  '--help': Boolean,
50
73
  // Aliases
51
- '-h': '--help',
74
+ '-h': '--help'
52
75
  }, argv ?? []);
53
76
  if (args['--help']) {
54
- Log.exit((0, chalk_1.default) `
77
+ _log.exit((0, _chalk().default)`
55
78
  {bold Description}
56
79
  Diff two fingerprints
57
80
 
@@ -62,18 +85,18 @@ Diff two fingerprints
62
85
  -h, --help Output usage information
63
86
  `, 0);
64
87
  }
65
- const fingerprintFile1 = (0, args_1.getFileArgumentAtIndex)(args, 0);
66
- const fingerprintFile2 = (0, args_1.getFileArgumentAtIndex)(args, 1);
88
+ const fingerprintFile1 = (0, _args.getFileArgumentAtIndex)(args, 0);
89
+ const fingerprintFile2 = (0, _args.getFileArgumentAtIndex)(args, 1);
67
90
  const [fingerprint1ToDiff, fingerprint2ToDiff] = await Promise.all([
68
- (0, readFingerprintFileAsync_1.default)(fingerprintFile1),
69
- (0, readFingerprintFileAsync_1.default)(fingerprintFile2),
91
+ (0, _readFingerprintFileAsync.default)(fingerprintFile1),
92
+ (0, _readFingerprintFileAsync.default)(fingerprintFile2)
70
93
  ]);
71
94
  try {
72
- const diff = (0, index_1.diffFingerprints)(fingerprint1ToDiff, fingerprint2ToDiff);
95
+ const diff = (0, _index.diffFingerprints)(fingerprint1ToDiff, fingerprint2ToDiff);
73
96
  console.log(JSON.stringify(diff, null, 2));
74
- }
75
- catch (e) {
76
- throw new errors_1.CommandError(e.message);
97
+ } catch (e) {
98
+ throw new _errors.CommandError(e.message);
77
99
  }
78
100
  };
79
- exports.diffFingerprintsAsync = diffFingerprintsAsync;
101
+
102
+ //# sourceMappingURL=diffFingerprints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["commands/diffFingerprints.ts"],"sourcesContent":[null],"names":["diffFingerprintsAsync","argv","args","assertArgs","Boolean","Log","exit","chalk","fingerprintFile1","getFileArgumentAtIndex","fingerprintFile2","fingerprint1ToDiff","fingerprint2ToDiff","Promise","all","readFingerprintFileAsync","diff","diffFingerprints","console","log","JSON","stringify","e","CommandError","message"],"mappings":";;;;+BASaA;;;eAAAA;;;;gEATK;;;;;;uBAEe;sBAEkB;wBACtB;6DACR;iFACgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9B,MAAMA,wBAAiC,OAAOC;IACnD,MAAMC,OAAOC,IAAAA,gBAAU,EACrB;QACE,QAAQ;QACR,UAAUC;QACV,UAAU;QACV,MAAM;IACR,GACAH,QAAQ,EAAE;IAGZ,IAAIC,IAAI,CAAC,SAAS,EAAE;QAClBG,KAAIC,IAAI,CACNC,IAAAA,gBAAK,CAAA,CAAC;;;;;;;;;IASR,CAAC,EACC;IAEJ;IAEA,MAAMC,mBAAmBC,IAAAA,4BAAsB,EAACP,MAAM;IACtD,MAAMQ,mBAAmBD,IAAAA,4BAAsB,EAACP,MAAM;IAEtD,MAAM,CAACS,oBAAoBC,mBAAmB,GAAG,MAAMC,QAAQC,GAAG,CAAC;QACjEC,IAAAA,iCAAwB,EAACP;QACzBO,IAAAA,iCAAwB,EAACL;KAC1B;IACD,IAAI;QACF,MAAMM,OAAOC,IAAAA,uBAAgB,EAACN,oBAAoBC;QAClDM,QAAQC,GAAG,CAACC,KAAKC,SAAS,CAACL,MAAM,MAAM;IACzC,EAAE,OAAOM,GAAQ;QACf,MAAM,IAAIC,oBAAY,CAACD,EAAEE,OAAO;IAClC;AACF"}