@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
package/build/Config.js CHANGED
@@ -1,27 +1,55 @@
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.loadConfigAsync = loadConfigAsync;
7
- exports.normalizeSourceSkips = normalizeSourceSkips;
8
- const promises_1 = __importDefault(require("fs/promises"));
9
- const path_1 = __importDefault(require("path"));
10
- const SourceSkips_1 = require("./sourcer/SourceSkips");
11
- const CONFIG_FILES = ['fingerprint.config.js', 'fingerprint.config.cjs'];
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ 0 && (module.exports = {
6
+ loadConfigAsync: null,
7
+ normalizeSourceSkips: 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 loadConfigAsync () {
17
+ return loadConfigAsync;
18
+ },
19
+ get normalizeSourceSkips () {
20
+ return normalizeSourceSkips;
21
+ }
22
+ });
23
+ function _promises() {
24
+ const data = /*#__PURE__*/ _interop_require_default(require("fs/promises"));
25
+ _promises = function() {
26
+ return data;
27
+ };
28
+ return data;
29
+ }
30
+ function _path() {
31
+ const data = /*#__PURE__*/ _interop_require_default(require("path"));
32
+ _path = function() {
33
+ return data;
34
+ };
35
+ return data;
36
+ }
37
+ const _SourceSkips = require("./sourcer/SourceSkips");
38
+ function _interop_require_default(obj) {
39
+ return obj && obj.__esModule ? obj : {
40
+ default: obj
41
+ };
42
+ }
43
+ const CONFIG_FILES = [
44
+ 'fingerprint.config.js',
45
+ 'fingerprint.config.cjs'
46
+ ];
12
47
  const debug = require('debug')('expo:fingerprint:Config');
13
- /**
14
- * Load the fingerprint.config.js from project root.
15
- * @param projectRoot The project root directory.
16
- * @param silent Whether to mute console logs when loading the config. This is useful for expo-updates integration and makes sure the JSON output is valid.
17
- * @returns The loaded config or null if no config file was found.
18
- */
19
48
  async function loadConfigAsync(projectRoot, silent = false) {
20
49
  let configFile;
21
50
  try {
22
51
  configFile = await resolveConfigFileAsync(projectRoot);
23
- }
24
- catch {
52
+ } catch {
25
53
  return null;
26
54
  }
27
55
  debug('Resolved config file:', configFile);
@@ -29,13 +57,13 @@ async function loadConfigAsync(projectRoot, silent = false) {
29
57
  let rawConfig;
30
58
  try {
31
59
  rawConfig = require(configFile);
32
- }
33
- catch (e) {
60
+ } catch (e) {
34
61
  debug('Error loading config file:', e);
35
62
  rawConfig = {};
36
63
  }
37
64
  unregisterMuteLogs?.();
38
65
  const supportedConfigKeys = [
66
+ 'preset',
39
67
  'concurrentIoLimit',
40
68
  'hashAlgorithm',
41
69
  'ignorePaths',
@@ -43,39 +71,37 @@ async function loadConfigAsync(projectRoot, silent = false) {
43
71
  'sourceSkips',
44
72
  'enableReactImportsPatcher',
45
73
  'useRNCoreAutolinkingFromExpo',
74
+ 'nativeModuleSourceType',
75
+ 'configPluginSourceType',
46
76
  'debug',
47
- 'fileHookTransform',
77
+ 'fileHookTransform'
48
78
  ];
49
79
  const config = {};
50
- for (const key of supportedConfigKeys) {
80
+ for (const key of supportedConfigKeys){
51
81
  if (key in rawConfig) {
52
82
  if (key === 'sourceSkips') {
53
83
  config[key] = normalizeSourceSkips(rawConfig[key]);
54
- }
55
- else {
84
+ } else {
56
85
  config[key] = rawConfig[key];
57
86
  }
58
87
  }
59
88
  }
60
89
  return config;
61
90
  }
62
- /**
63
- * Normalize the sourceSkips from enum number or string array to a valid enum number.
64
- */
65
91
  function normalizeSourceSkips(sourceSkips) {
66
92
  if (sourceSkips == null) {
67
- return SourceSkips_1.SourceSkips.None;
93
+ return _SourceSkips.SourceSkips.None;
68
94
  }
69
95
  if (typeof sourceSkips === 'number') {
70
96
  return sourceSkips;
71
97
  }
72
98
  if (Array.isArray(sourceSkips)) {
73
- let result = SourceSkips_1.SourceSkips.None;
74
- for (const value of sourceSkips) {
99
+ let result = _SourceSkips.SourceSkips.None;
100
+ for (const value of sourceSkips){
75
101
  if (typeof value !== 'string') {
76
102
  continue;
77
103
  }
78
- const skipValue = SourceSkips_1.SourceSkips[value];
104
+ const skipValue = _SourceSkips.SourceSkips[value];
79
105
  if (skipValue != null) {
80
106
  result |= skipValue;
81
107
  }
@@ -86,11 +112,10 @@ function normalizeSourceSkips(sourceSkips) {
86
112
  }
87
113
  /**
88
114
  * Resolve the config file path from the project root.
89
- */
90
- async function resolveConfigFileAsync(projectRoot) {
91
- return await Promise.any(CONFIG_FILES.map(async (file) => {
92
- const configPath = path_1.default.resolve(projectRoot, file);
93
- const stat = await promises_1.default.stat(configPath);
115
+ */ async function resolveConfigFileAsync(projectRoot) {
116
+ return await Promise.any(CONFIG_FILES.map(async (file)=>{
117
+ const configPath = _path().default.resolve(projectRoot, file);
118
+ const stat = await _promises().default.stat(configPath);
94
119
  if (!stat.isFile()) {
95
120
  throw new Error(`Config file is not a file: ${configPath}`);
96
121
  }
@@ -100,21 +125,21 @@ async function resolveConfigFileAsync(projectRoot) {
100
125
  /**
101
126
  * Monkey-patch the console to mute logs.
102
127
  * @returns A function to unregister the monkey-patch.
103
- */
104
- function muteLogs() {
128
+ */ function muteLogs() {
105
129
  const originalConsole = {
106
130
  log: console.log,
107
131
  warn: console.warn,
108
- error: console.error,
132
+ error: console.error
109
133
  };
110
- const unregister = () => {
134
+ const unregister = ()=>{
111
135
  console.log = originalConsole.log;
112
136
  console.warn = originalConsole.warn;
113
137
  console.error = originalConsole.error;
114
138
  };
115
- console.log = () => { };
116
- console.warn = () => { };
117
- console.error = () => { };
139
+ console.log = ()=>{};
140
+ console.warn = ()=>{};
141
+ console.error = ()=>{};
118
142
  return unregister;
119
143
  }
120
- //# sourceMappingURL=Config.js.map
144
+
145
+ //# sourceMappingURL=Config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Config.js","sourceRoot":"","sources":["../src/Config.ts"],"names":[],"mappings":";;;;;AAoBA,0CA4CC;AAKD,oDAqBC;AA1FD,2DAA6B;AAC7B,gDAAwB;AAGxB,uDAAoD;AAEpD,MAAM,YAAY,GAAG,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,CAAC;AAEzE,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,yBAAyB,CAAC,CAAC;AAM1D;;;;;GAKG;AACI,KAAK,UAAU,eAAe,CACnC,WAAmB,EACnB,SAAkB,KAAK;IAEvB,IAAI,UAAkB,CAAC;IACvB,IAAI,CAAC;QACH,UAAU,GAAG,MAAM,sBAAsB,CAAC,WAAW,CAAC,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,KAAK,CAAC,uBAAuB,EAAE,UAAU,CAAC,CAAC;IAE3C,MAAM,kBAAkB,GAAG,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACtD,IAAI,SAAS,CAAC;IACd,IAAI,CAAC;QACH,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QACpB,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC;QACvC,SAAS,GAAG,EAAE,CAAC;IACjB,CAAC;IACD,kBAAkB,EAAE,EAAE,CAAC;IAEvB,MAAM,mBAAmB,GAAqB;QAC5C,mBAAmB;QACnB,eAAe;QACf,aAAa;QACb,cAAc;QACd,aAAa;QACb,2BAA2B;QAC3B,8BAA8B;QAC9B,OAAO;QACP,mBAAmB;KACpB,CA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B,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAC9B,MAAM,UAAU,GAAG,cAAI,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QACnD,MAAM,IAAI,GAAG,MAAM,kBAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,8BAA8B,UAAU,EAAE,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,QAAQ;IACf,MAAM,eAAe,GAAG;QACtB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC;IACF,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,OAAO,CAAC,GAAG,GAAG,eAAe,CAAC,GAAG,CAAC;QAClC,OAAO,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;QACpC,OAAO,CAAC,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC;IACxC,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;IACvB,OAAO,CAAC,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;IACxB,OAAO,CAAC,KAAK,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;IACzB,OAAO,UAAU,CAAC;AACpB,CAAC"}
1
+ {"version":3,"sources":["Config.ts"],"sourcesContent":[null],"names":["loadConfigAsync","normalizeSourceSkips","CONFIG_FILES","debug","require","projectRoot","silent","configFile","resolveConfigFileAsync","unregisterMuteLogs","muteLogs","rawConfig","e","supportedConfigKeys","config","key","sourceSkips","SourceSkips","None","Array","isArray","result","value","skipValue","Error","Promise","any","map","file","configPath","path","resolve","stat","fs","isFile","originalConsole","log","console","warn","error","unregister"],"mappings":";;;;;;;;;;;;;;;QAoBsBA;eAAAA;;QAoDNC;eAAAA;;;;gEAxED;;;;;;;gEACE;;;;;;6BAGW;;;;;;AAE5B,MAAMC,eAAe;IAAC;IAAyB;CAAyB;AAExE,MAAMC,QAAQC,QAAQ,SAAS;AAYxB,eAAeJ,gBACpBK,WAAmB,EACnBC,SAAkB,KAAK;IAEvB,IAAIC;IACJ,IAAI;QACFA,aAAa,MAAMC,uBAAuBH;IAC5C,EAAE,OAAM;QACN,OAAO;IACT;IACAF,MAAM,yBAAyBI;IAE/B,MAAME,qBAAqBH,SAASI,aAAa;IACjD,IAAIC;IACJ,IAAI;QACFA,YAAYP,QAAQG;IACtB,EAAE,OAAOK,GAAY;QACnBT,MAAM,8BAA8BS;QACpCD,YAAY,CAAC;IACf;IACAF;IAEA,MAAMI,sBAAwC;QAC5C;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IACD,MAAMC,SAA2B,CAAC;IAClC,KAAK,MAAMC,OAAOF,oBAAqB;QACrC,IAAIE,OAAOJ,WAAW;YACpB,IAAII,QAAQ,eAAe;gBACzBD,MAAM,CAACC,IAAI,GAAGd,qBAAqBU,SAAS,CAACI,IAAI;YACnD,OAAO;gBACLD,MAAM,CAACC,IAAI,GAAGJ,SAAS,CAACI,IAAI;YAC9B;QACF;IACF;IACA,OAAOD;AACT;AAKO,SAASb,qBAAqBe,WAAkC;IACrE,IAAIA,eAAe,MAAM;QACvB,OAAOC,wBAAW,CAACC,IAAI;IACzB;IACA,IAAI,OAAOF,gBAAgB,UAAU;QACnC,OAAOA;IACT;IACA,IAAIG,MAAMC,OAAO,CAACJ,cAAc;QAC9B,IAAIK,SAAsBJ,wBAAW,CAACC,IAAI;QAC1C,KAAK,MAAMI,SAASN,YAAa;YAC/B,IAAI,OAAOM,UAAU,UAAU;gBAC7B;YACF;YACA,MAAMC,YAAYN,wBAAW,CAACK,MAAM;YACpC,IAAIC,aAAa,MAAM;gBACrBF,UAAUE;YACZ;QACF;QACA,OAAOF;IACT;IACA,MAAM,IAAIG,MAAM,CAAC,0BAA0B,EAAER,aAAa;AAC5D;AAEA;;CAEC,GACD,eAAeR,uBAAuBH,WAAmB;IACvD,OAAO,MAAMoB,QAAQC,GAAG,CACtBxB,aAAayB,GAAG,CAAC,OAAOC;QACtB,MAAMC,aAAaC,eAAI,CAACC,OAAO,CAAC1B,aAAauB;QAC7C,MAAMI,OAAO,MAAMC,mBAAE,CAACD,IAAI,CAACH;QAC3B,IAAI,CAACG,KAAKE,MAAM,IAAI;YAClB,MAAM,IAAIV,MAAM,CAAC,2BAA2B,EAAEK,YAAY;QAC5D;QACA,OAAOA;IACT;AAEJ;AAEA;;;CAGC,GACD,SAASnB;IACP,MAAMyB,kBAAkB;QACtBC,KAAKC,QAAQD,GAAG;QAChBE,MAAMD,QAAQC,IAAI;QAClBC,OAAOF,QAAQE,KAAK;IACtB;IACA,MAAMC,aAAa;QACjBH,QAAQD,GAAG,GAAGD,gBAAgBC,GAAG;QACjCC,QAAQC,IAAI,GAAGH,gBAAgBG,IAAI;QACnCD,QAAQE,KAAK,GAAGJ,gBAAgBI,KAAK;IACvC;IACAF,QAAQD,GAAG,GAAG,KAAO;IACrBC,QAAQC,IAAI,GAAG,KAAO;IACtBD,QAAQE,KAAK,GAAG,KAAO;IACvB,OAAOC;AACT"}
package/build/Dedup.js CHANGED
@@ -1,19 +1,48 @@
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.dedupSources = dedupSources;
7
- exports.mergeSourceWithReasons = mergeSourceWithReasons;
8
- const assert_1 = __importDefault(require("assert"));
9
- const path_1 = __importDefault(require("path"));
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ 0 && (module.exports = {
6
+ dedupSources: null,
7
+ mergeSourceWithReasons: 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 dedupSources () {
17
+ return dedupSources;
18
+ },
19
+ get mergeSourceWithReasons () {
20
+ return mergeSourceWithReasons;
21
+ }
22
+ });
23
+ function _assert() {
24
+ const data = /*#__PURE__*/ _interop_require_default(require("assert"));
25
+ _assert = function() {
26
+ return data;
27
+ };
28
+ return data;
29
+ }
30
+ function _path() {
31
+ const data = /*#__PURE__*/ _interop_require_default(require("path"));
32
+ _path = function() {
33
+ return data;
34
+ };
35
+ return data;
36
+ }
37
+ function _interop_require_default(obj) {
38
+ return obj && obj.__esModule ? obj : {
39
+ default: obj
40
+ };
41
+ }
10
42
  const debug = require('debug')('expo:fingerprint:Dedup');
11
- /**
12
- * Strip duplicated sources, mainly for duplicated file or dir
13
- */
14
43
  function dedupSources(sources, projectRoot) {
15
44
  const newSources = [];
16
- for (const source of sources) {
45
+ for (const source of sources){
17
46
  const [duplicatedItemIndex, shouldSwapSource] = findDuplicatedSourceIndex(newSources, source, projectRoot);
18
47
  const duplicatedItem = newSources[duplicatedItemIndex];
19
48
  if (duplicatedItem != null) {
@@ -21,62 +50,79 @@ function dedupSources(sources, projectRoot) {
21
50
  if (shouldSwapSource) {
22
51
  newSources[duplicatedItemIndex] = {
23
52
  ...source,
24
- reasons: [...source.reasons, ...duplicatedItem.reasons],
53
+ reasons: [
54
+ ...source.reasons,
55
+ ...duplicatedItem.reasons
56
+ ]
25
57
  };
58
+ } else {
59
+ duplicatedItem.reasons = [
60
+ ...duplicatedItem.reasons,
61
+ ...source.reasons
62
+ ];
26
63
  }
27
- else {
28
- duplicatedItem.reasons = [...duplicatedItem.reasons, ...source.reasons];
29
- }
30
- }
31
- else {
64
+ } else {
32
65
  newSources.push(source);
33
66
  }
34
67
  }
35
68
  return newSources;
36
69
  }
37
- /**
38
- * When two sources are duplicated, merge `src`'s reasons into `dst`
39
- */
40
70
  function mergeSourceWithReasons(dst, src) {
41
71
  return dst;
42
72
  }
43
73
  /**
44
74
  * Find the duplicated `source` in `newSources`
45
75
  * @return tuple of [duplicatedItemIndexInNewSources, shouldSwapSource]
46
- */
47
- function findDuplicatedSourceIndex(newSources, source, projectRoot) {
76
+ */ function findDuplicatedSourceIndex(newSources, source, projectRoot) {
48
77
  let shouldSwapSource = false;
49
78
  if (source.type === 'contents') {
50
79
  return [
51
- newSources.findIndex((item) => item.type === source.type && item.id === source.id) ?? null,
52
- shouldSwapSource,
80
+ newSources.findIndex((item)=>item.type === source.type && item.id === source.id) ?? null,
81
+ shouldSwapSource
82
+ ];
83
+ }
84
+ if (source.type === 'package') {
85
+ const key = source.overrideHashKey ?? `${source.name}@${source.version}`;
86
+ return [
87
+ newSources.findIndex((item)=>item.type === 'package' && (item.overrideHashKey ?? `${item.name}@${item.version}`) === key) ?? null,
88
+ shouldSwapSource
53
89
  ];
54
90
  }
55
- for (const [index, existingSource] of newSources.entries()) {
56
- if (existingSource.type === 'contents') {
91
+ for (const [index, existingSource] of newSources.entries()){
92
+ if (existingSource.type === 'contents' || existingSource.type === 'package') {
57
93
  continue;
58
94
  }
59
95
  if (isDescendant(source, existingSource, projectRoot)) {
60
- return [index, shouldSwapSource];
96
+ return [
97
+ index,
98
+ shouldSwapSource
99
+ ];
61
100
  }
62
- // If the new source is ancestor of existing source, replace swap the existing source with the new source
101
+ // If the new source is ancestor of existing source, swap the existing source with the new source
63
102
  if (isDescendant(existingSource, source, projectRoot)) {
64
103
  shouldSwapSource = true;
65
- return [index, shouldSwapSource];
104
+ return [
105
+ index,
106
+ shouldSwapSource
107
+ ];
66
108
  }
67
109
  }
68
- return [-1, shouldSwapSource];
110
+ return [
111
+ -1,
112
+ shouldSwapSource
113
+ ];
69
114
  }
70
115
  function isDescendant(from, to, projectRoot) {
71
116
  if (from === to) {
72
117
  return true;
73
118
  }
74
- const fromPath = path_1.default.join(projectRoot, from.filePath);
75
- const toPath = path_1.default.join(projectRoot, to.filePath);
76
- const result = path_1.default.relative(fromPath, toPath).match(/^[./\\/]*$/) != null;
119
+ const fromPath = _path().default.join(projectRoot, from.filePath);
120
+ const toPath = _path().default.join(projectRoot, to.filePath);
121
+ const result = _path().default.relative(fromPath, toPath).match(/^[./\\/]*$/) != null;
77
122
  if (result) {
78
- (0, assert_1.default)(!(to.type === 'file' && from.type === 'dir'), `Unexpected case which a dir is a descendant of a file - from[${fromPath}] to[${toPath}]`);
123
+ (0, _assert().default)(!(to.type === 'file' && from.type === 'dir'), `Unexpected case which a dir is a descendant of a file - from[${fromPath}] to[${toPath}]`);
79
124
  }
80
125
  return result;
81
126
  }
82
- //# sourceMappingURL=Dedup.js.map
127
+
128
+ //# sourceMappingURL=Dedup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dedup.js","sourceRoot":"","sources":["../src/Dedup.ts"],"names":[],"mappings":";;;;;AAUA,oCAyBC;AAKD,wDAEC;AA1CD,oDAA4B;AAC5B,gDAAwB;AAIxB,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,wBAAwB,CAAC,CAAC;AAEzD;;GAEG;AACH,SAAgB,YAAY,CAAC,OAAqB,EAAE,WAAmB;IACrE,MAAM,UAAU,GAAiB,EAAE,CAAC;IACpC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,GAAG,yBAAyB,CACvE,UAAU,EACV,MAAM,EACN,WAAW,CACZ,CAAC;QACF,MAAM,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;QACvD,IAAI,cAAc,IAAI,IAAI,EAAE,CAAC;YAC3B,KAAK,CAAC,+BAA+B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAC/D,IAAI,gBAAgB,EAAE,CAAC;gBACrB,UAAU,CA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,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,CAAC;YACtD,gBAAgB,GAAG,IAAI,CAAC;YACxB,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,YAAY,CACnB,IAAoC,EACpC,EAAkC,EAClC,WAAmB;IAEnB,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,cAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,IAAI,CAAC;IAC3E,IAAI,MAAM,EAAE,CAAC;QACX,IAAA,gBAAM,EACJ,CAAC,CAAC,EAAE,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,EAC5C,gEAAgE,QAAQ,QAAQ,MAAM,GAAG,CAC1F,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"sources":["Dedup.ts"],"sourcesContent":[null],"names":["dedupSources","mergeSourceWithReasons","debug","require","sources","projectRoot","newSources","source","duplicatedItemIndex","shouldSwapSource","findDuplicatedSourceIndex","duplicatedItem","JSON","stringify","reasons","push","dst","src","type","findIndex","item","id","key","overrideHashKey","name","version","index","existingSource","entries","isDescendant","from","to","fromPath","path","join","filePath","toPath","result","relative","match","assert"],"mappings":";;;;;;;;;;;;;;;QAUgBA;eAAAA;;QA8BAC;eAAAA;;;;gEAxCG;;;;;;;g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AAKG,eAAe,IAAI,GAAGH,KAAKI,IAAI,CAAC,CAAC,EAAEJ,KAAKK,OAAO,EAAE,AAAD,MAAOH,QAC5D;YACLb;SACD;IACH;IAEA,KAAK,MAAM,CAACiB,OAAOC,eAAe,IAAIrB,WAAWsB,OAAO,GAAI;QAC1D,IAAID,eAAeT,IAAI,KAAK,cAAcS,eAAeT,IAAI,KAAK,WAAW;YAC3E;QACF;QACA,IAAIW,aAAatB,QAAQoB,gBAAgBtB,cAAc;YACrD,OAAO;gBAACqB;gBAAOjB;aAAiB;QAClC;QACA,iGAAiG;QACjG,IAAIoB,aAAaF,gBAAgBpB,QAAQF,cAAc;YACrDI,mBAAmB;YACnB,OAAO;gBAACiB;gBAAOjB;aAAiB;QAClC;IACF;IACA,OAAO;QAAC,CAAC;QAAGA;KAAiB;AAC/B;AAEA,SAASoB,aACPC,IAAoC,EACpCC,EAAkC,EAClC1B,WAAmB;IAEnB,IAAIyB,SAASC,IAAI;QACf,OAAO;IACT;IAEA,MAAMC,WAAWC,eAAI,CAACC,IAAI,CAAC7B,aAAayB,KAAKK,QAAQ;IACrD,MAAMC,SAASH,eAAI,CAACC,IAAI,CAAC7B,aAAa0B,GAAGI,QAAQ;IACjD,MAAME,SAASJ,eAAI,CAACK,QAAQ,CAACN,UAAUI,QAAQG,KAAK,CAAC,iBAAiB;IACtE,IAAIF,QAAQ;QACVG,IAAAA,iBAAM,EACJ,CAAET,CAAAA,GAAGb,IAAI,KAAK,UAAUY,KAAKZ,IAAI,KAAK,KAAI,GAC1C,CAAC,6DAA6D,EAAEc,SAAS,KAAK,EAAEI,OAAO,CAAC,CAAC;IAE7F;IACA,OAAOC;AACT"}
@@ -1,9 +1,18 @@
1
- import type { ProjectConfig } from 'expo/config';
1
+ import type { ProjectConfig } from '@expo/config';
2
+ import { type LoadedModuleSource } from './ExpoConfigLoader';
2
3
  import type { NormalizedOptions } from './Fingerprint.types';
3
4
  /**
4
5
  * An out-of-process `expo/config` loader that can be used to get the Expo config and loaded modules.
5
6
  */
6
7
  export declare function getExpoConfigAsync(projectRoot: string, options: NormalizedOptions): Promise<{
7
8
  config: ProjectConfig | null;
8
- loadedModules: string[] | null;
9
+ loadedModules: LoadedModuleSource[] | null;
9
10
  }>;
11
+ /**
12
+ * Keep only the config-plugin modules attributable to applying plugins.
13
+ *
14
+ * Anything that also loads when plugins are skipped is the config-loading framework and is dropped.
15
+ * In-repo files are always kept regardless of the diff, so a local plugin imported at the top of
16
+ * `app.config` (which loads during config evaluation, not plugin application) is never lost.
17
+ */
18
+ export declare function diffLoadedModules(withPlugins: LoadedModuleSource[], withoutPlugins: LoadedModuleSource[]): LoadedModuleSource[];
@@ -1,54 +1,138 @@
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.getExpoConfigAsync = getExpoConfigAsync;
7
- const promises_1 = __importDefault(require("fs/promises"));
8
- const os_1 = __importDefault(require("os"));
9
- const path_1 = __importDefault(require("path"));
10
- const resolve_from_1 = __importDefault(require("resolve-from"));
11
- const ExpoConfigLoader_1 = require("./ExpoConfigLoader");
12
- const SpawnIPC_1 = require("./utils/SpawnIPC");
13
- /**
14
- * An out-of-process `expo/config` loader that can be used to get the Expo config and loaded modules.
15
- */
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ 0 && (module.exports = {
6
+ diffLoadedModules: null,
7
+ getExpoConfigAsync: 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 diffLoadedModules () {
17
+ return diffLoadedModules;
18
+ },
19
+ get getExpoConfigAsync () {
20
+ return getExpoConfigAsync;
21
+ }
22
+ });
23
+ function _env() {
24
+ const data = require("@expo/env");
25
+ _env = 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 _os() {
38
+ const data = /*#__PURE__*/ _interop_require_default(require("os"));
39
+ _os = function() {
40
+ return data;
41
+ };
42
+ return data;
43
+ }
44
+ function _path() {
45
+ const data = /*#__PURE__*/ _interop_require_default(require("path"));
46
+ _path = function() {
47
+ return data;
48
+ };
49
+ return data;
50
+ }
51
+ function _resolvefrom() {
52
+ const data = /*#__PURE__*/ _interop_require_default(require("resolve-from"));
53
+ _resolvefrom = function() {
54
+ return data;
55
+ };
56
+ return data;
57
+ }
58
+ const _ExpoConfigLoader = require("./ExpoConfigLoader");
59
+ const _SpawnIPC = require("./utils/SpawnIPC");
60
+ function _interop_require_default(obj) {
61
+ return obj && obj.__esModule ? obj : {
62
+ default: obj
63
+ };
64
+ }
65
+ const FINGERPRINT_ENV_MODE = 'development';
16
66
  async function getExpoConfigAsync(projectRoot, options) {
17
67
  const result = {
18
68
  config: null,
19
- loadedModules: null,
69
+ loadedModules: null
20
70
  };
21
- if (!resolve_from_1.default.silent(path_1.default.resolve(projectRoot), 'expo/config')) {
71
+ if (!_resolvefrom().default.silent(_path().default.resolve(projectRoot), 'expo/config')) {
22
72
  return result;
23
73
  }
24
- const tmpDir = await promises_1.default.mkdtemp(path_1.default.join(os_1.default.tmpdir(), 'expo-fingerprint-'));
74
+ const tmpDir = await _promises().default.mkdtemp(_path().default.join(_os().default.tmpdir(), 'expo-fingerprint-'));
25
75
  const ignoredFile = await createTempIgnoredFileAsync(tmpDir, options);
26
76
  try {
27
- const { message } = await (0, SpawnIPC_1.spawnWithIpcAsync)('node', [(0, ExpoConfigLoader_1.getExpoConfigLoaderPath)(), path_1.default.resolve(projectRoot), ignoredFile], { cwd: projectRoot });
28
- const stdoutJson = JSON.parse(message);
29
- result.config = stdoutJson.config;
30
- result.loadedModules = stdoutJson.loadedModules;
31
- }
32
- catch (e) {
77
+ const [{ config, loadedModules: modulesWithPlugins }, { loadedModules: modulesWithoutPlugins }] = await Promise.all([
78
+ spawnConfigLoaderAsync(projectRoot, ignoredFile, /* skipPlugins */ false),
79
+ spawnConfigLoaderAsync(projectRoot, ignoredFile, /* skipPlugins */ true)
80
+ ]);
81
+ result.config = config;
82
+ result.loadedModules = diffLoadedModules(modulesWithPlugins ?? [], modulesWithoutPlugins ?? []);
83
+ } catch (e) {
33
84
  if (e instanceof Error) {
34
85
  console.warn(`Cannot get Expo config from an Expo project - ${e.message}: `, e.stack);
35
86
  }
36
- }
37
- finally {
87
+ } finally{
38
88
  try {
39
- await promises_1.default.rm(tmpDir, { recursive: true });
40
- }
41
- catch { }
89
+ await _promises().default.rm(tmpDir, {
90
+ recursive: true
91
+ });
92
+ } catch {}
42
93
  }
43
94
  return result;
44
95
  }
96
+ async function spawnConfigLoaderAsync(projectRoot, ignoredFile, skipPlugins) {
97
+ const args = [
98
+ (0, _ExpoConfigLoader.getExpoConfigLoaderPath)(),
99
+ _path().default.resolve(projectRoot),
100
+ ignoredFile,
101
+ '--mode',
102
+ FINGERPRINT_ENV_MODE
103
+ ];
104
+ if (skipPlugins) {
105
+ args.push('--skipPlugins');
106
+ }
107
+ const childEnv = (0, _env().setNodeEnv)(FINGERPRINT_ENV_MODE, {
108
+ systemEnv: (0, _env().getOriginalEnv)()
109
+ });
110
+ childEnv.__EXPO_CONFIG_MODE = FINGERPRINT_ENV_MODE;
111
+ const { message } = await (0, _SpawnIPC.spawnWithIpcAsync)('node', args, {
112
+ cwd: projectRoot,
113
+ env: childEnv
114
+ });
115
+ return JSON.parse(message);
116
+ }
117
+ function diffLoadedModules(withPlugins, withoutPlugins) {
118
+ const skippedKeys = new Set(withoutPlugins.map(getLoadedModuleKey));
119
+ return withPlugins.filter((source)=>isInRepoLoadedModule(source) || !skippedKeys.has(getLoadedModuleKey(source)));
120
+ }
121
+ /** Stable identity of a loaded module: its file path, or its id for a virtual module. */ function getLoadedModuleKey(source) {
122
+ return source.type === 'file' ? source.path : source.id;
123
+ }
124
+ /** Whether a loaded module is a project-local file (e.g. a local config plugin) rather than a dependency. */ function isInRepoLoadedModule(source) {
125
+ const key = getLoadedModuleKey(source);
126
+ // `..` means the path escaped the project root (e.g. a hoisted or linked dependency).
127
+ return !key.startsWith('..') && !key.includes('node_modules');
128
+ }
45
129
  /**
46
130
  * Create a temporary file with ignored paths from options that will be read by the ExpoConfigLoader.
47
- */
48
- async function createTempIgnoredFileAsync(tmpDir, options) {
49
- const ignoredFile = path_1.default.join(tmpDir, '.fingerprintignore');
50
- const ignorePaths = options.ignorePathMatchObjects.map((match) => match.pattern);
51
- await promises_1.default.writeFile(ignoredFile, ignorePaths.join('\n'));
131
+ */ async function createTempIgnoredFileAsync(tmpDir, options) {
132
+ const ignoredFile = _path().default.join(tmpDir, '.fingerprintignore');
133
+ const ignorePaths = options.ignorePathMatchObjects.map((match)=>match.pattern);
134
+ await _promises().default.writeFile(ignoredFile, ignorePaths.join('\n'));
52
135
  return ignoredFile;
53
136
  }
54
- //# sourceMappingURL=ExpoConfig.js.map
137
+
138
+ //# sourceMappingURL=ExpoConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoConfig.js","sourceRoot":"","sources":["../src/ExpoConfig.ts"],"names":[],"mappings":";;;;;AAaA,gDAsCC;AAlDD,2DAA6B;AAC7B,4CAAoB;AACpB,gDAAwB;AACxB,gEAAuC;AAEvC,yDAA6D;AAE7D,+CAAqD;AAErD;;GAEG;AACI,KAAK,UAAU,kBAAkB,CACtC,WAAmB,EACnB,OAA0B;IAK1B,MAAM,MAAM,GAAG;QACb,MAAM,EAAE,IAAI;QACZ,aAAa,EAAE,IAAI;KACpB,CAAC;IAEF,IAAI,CAAC,sBAAW,CAAC,MAAM,CAAC,cAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC;QAClE,OAAO,MAAM,CAAC;IAChB,CAAC;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AAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjF,MAAM,kBAAE,CAAC,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACxD,OAAO,WAAW,CAAC;AACrB,CAAC"}
1
+ {"version":3,"sources":["ExpoConfig.ts"],"sourcesContent":[null],"names":["diffLoadedModules","getExpoConfigAsync","FINGERPRINT_ENV_MODE","projectRoot","options","result","config","loadedModules","resolveFrom","silent","path","resolve","tmpDir","fs","mkdtemp","join","os","tmpdir","ignoredFile","createTempIgnoredFileAsync","modulesWithPlugins","modulesWithoutPlugins","Promise","all","spawnConfigLoaderAsync","e","Error","console","warn","message","stack","rm","recursive","skipPlugins","args","getExpoConfigLoaderPath","push","childEnv","setNodeEnv","systemEnv","getOriginalEnv","__EXPO_CONFIG_MODE","spawnWithIpcAsync","cwd","env","JSON","parse","withPlugins","withoutPlugins","skippedKeys","Set","map","getLoadedModuleKey","filter","source","isInRepoLoadedModule","has","type","id","key","startsWith","includes","ignorePaths","ignorePathMatchObjects","match","pattern","writeFile"],"mappings":";;;;;;;;;;;;;;;QAwFgBA;eAAAA;;QAxEMC;eAAAA;;;;yBAfqB;;;;;;;gEAC5B;;;;;;;gEACA;;;;;;;gEACE;;;;;;;gEACO;;;;;;kCAEyC;0BAE/B;;;;;;AAElC,MAAMC,uBAAuB;AAKtB,eAAeD,mBACpBE,WAAmB,EACnBC,OAA0B;IAK1B,MAAMC,SAGF;QACFC,QAAQ;QACRC,eAAe;IACjB;IAEA,IAAI,CAACC,sBAAW,CAACC,MAAM,CAACC,eAAI,CAACC,OAAO,CAACR,cAAc,gBAAgB;QACjE,OAAOE;IACT;IAEA,MAAMO,SAAS,MAAMC,mBAAE,CAACC,OAAO,CAACJ,eAAI,CAACK,IAAI,CAACC,aAAE,CAACC,MAAM,IAAI;IACvD,MAAMC,cAAc,MAAMC,2BAA2BP,QAAQR;IAC7D,IAAI;QACF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