@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
@@ -0,0 +1,26 @@
1
+ import type { ConfigPluginSourceType, FingerprintPreset, NativeModuleSourceType } from './Fingerprint.types';
2
+ import { SourceSkips } from './sourcer/SourceSkips';
3
+ export interface ResolvedPreset {
4
+ sourceSkips: SourceSkips;
5
+ nativeModuleSourceType: NativeModuleSourceType;
6
+ configPluginSourceType: ConfigPluginSourceType;
7
+ }
8
+ /**
9
+ * The preset used when a project doesn't configure one.
10
+ */
11
+ export declare const DEFAULT_PRESET: FingerprintPreset;
12
+ /**
13
+ * Resolve a preset name to the settings it stands for.
14
+ *
15
+ * - `strict`: highest fidelity - the historical default. Only skips prebuild-mutated package.json
16
+ * scripts so a fingerprint stays consistent before and after prebuild. Autolinking config is
17
+ * still sorted before hashing, so the fingerprint changes once on upgrade.
18
+ * - `balanced`: the default. Also ignores app version and string runtime version churn, the EAS
19
+ * Build files (`eas.json` and `.easignore`), and path fields in the resolved autolinking config,
20
+ * and hashes autolinked packages and node_modules config-plugin modules by their `package.json`
21
+ * version. Best first-time experience.
22
+ * - `relaxed`: for building multiple variants from one native project. Additionally ignores app
23
+ * names, bundle identifiers, schemes, and assets, while still hashing the config-plugins list so
24
+ * adding a plugin still changes the fingerprint.
25
+ */
26
+ export declare function resolvePreset(preset: FingerprintPreset): ResolvedPreset;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ 0 && (module.exports = {
6
+ DEFAULT_PRESET: null,
7
+ resolvePreset: 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 DEFAULT_PRESET () {
17
+ return DEFAULT_PRESET;
18
+ },
19
+ get resolvePreset () {
20
+ return resolvePreset;
21
+ }
22
+ });
23
+ const _SourceSkips = require("./sourcer/SourceSkips");
24
+ const DEFAULT_PRESET = 'balanced';
25
+ function resolvePreset(preset) {
26
+ switch(preset){
27
+ case 'strict':
28
+ return {
29
+ sourceSkips: _SourceSkips.SourceSkips.PackageJsonAndroidAndIosScriptsIfNotContainRun,
30
+ nativeModuleSourceType: 'files',
31
+ configPluginSourceType: 'files'
32
+ };
33
+ case 'balanced':
34
+ return {
35
+ sourceSkips: _SourceSkips.SourceSkips.PackageJsonAndroidAndIosScriptsIfNotContainRun | _SourceSkips.SourceSkips.ExpoConfigVersions | _SourceSkips.SourceSkips.ExpoConfigRuntimeVersionIfString | _SourceSkips.SourceSkips.EasJson | _SourceSkips.SourceSkips.Easignore | _SourceSkips.SourceSkips.AutolinkingConfigPaths,
36
+ nativeModuleSourceType: 'package',
37
+ configPluginSourceType: 'package'
38
+ };
39
+ case 'relaxed':
40
+ return {
41
+ sourceSkips: _SourceSkips.SourceSkips.PackageJsonAndroidAndIosScriptsIfNotContainRun | _SourceSkips.SourceSkips.ExpoConfigVersions | _SourceSkips.SourceSkips.ExpoConfigRuntimeVersionIfString | _SourceSkips.SourceSkips.EasJson | _SourceSkips.SourceSkips.Easignore | _SourceSkips.SourceSkips.AutolinkingConfigPaths | _SourceSkips.SourceSkips.ExpoConfigNames | _SourceSkips.SourceSkips.ExpoConfigAndroidPackage | _SourceSkips.SourceSkips.ExpoConfigIosBundleIdentifier | _SourceSkips.SourceSkips.ExpoConfigSchemes | _SourceSkips.SourceSkips.ExpoConfigAssets,
42
+ nativeModuleSourceType: 'package',
43
+ configPluginSourceType: 'package'
44
+ };
45
+ default:
46
+ throw new Error(`Invalid fingerprint preset: ${preset}. Supported presets are 'strict', 'balanced', and 'relaxed'.`);
47
+ }
48
+ }
49
+
50
+ //# sourceMappingURL=Presets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Presets.ts"],"sourcesContent":[null],"names":["DEFAULT_PRESET","resolvePreset","preset","sourceSkips","SourceSkips","PackageJsonAndroidAndIosScriptsIfNotContainRun","nativeModuleSourceType","configPluginSourceType","ExpoConfigVersions","ExpoConfigRuntimeVersionIfString","EasJson","Easignore","AutolinkingConfigPaths","ExpoConfigNames","ExpoConfigAndroidPackage","ExpoConfigIosBundleIdentifier","ExpoConfigSchemes","ExpoConfigAssets","Error"],"mappings":";;;;;;;;;;;;;;;QAgBaA;eAAAA;;QAgBGC;eAAAA;;;6BA3BY;AAWrB,MAAMD,iBAAoC;AAgB1C,SAASC,cAAcC,MAAyB;IACrD,OAAQA;QACN,KAAK;YACH,OAAO;gBACLC,aAAaC,wBAAW,CAACC,8CAA8C;gBACvEC,wBAAwB;gBACxBC,wBAAwB;YAC1B;QACF,KAAK;YACH,OAAO;gBACLJ,aACEC,wBAAW,CAACC,8CAA8C,GAC1DD,wBAAW,CAACI,kBAAkB,GAC9BJ,wBAAW,CAACK,gCAAgC,GAC5CL,wBAAW,CAACM,OAAO,GACnBN,wBAAW,CAACO,SAAS,GACrBP,wBAAW,CAACQ,sBAAsB;gBACpCN,wBAAwB;gBACxBC,wBAAwB;YAC1B;QACF,KAAK;YACH,OAAO;gBACLJ,aACEC,wBAAW,CAACC,8CAA8C,GAC1DD,wBAAW,CAACI,kBAAkB,GAC9BJ,wBAAW,CAACK,gCAAgC,GAC5CL,wBAAW,CAACM,OAAO,GACnBN,wBAAW,CAACO,SAAS,GACrBP,wBAAW,CAACQ,sBAAsB,GAClCR,wBAAW,CAACS,eAAe,GAC3BT,wBAAW,CAACU,wBAAwB,GACpCV,wBAAW,CAACW,6BAA6B,GACzCX,wBAAW,CAACY,iBAAiB,GAC7BZ,wBAAW,CAACa,gBAAgB;gBAC9BX,wBAAwB;gBACxBC,wBAAwB;YAC1B;QACF;YACE,MAAM,IAAIW,MACR,CAAC,4BAA4B,EAAEhB,OAAO,4DAA4D,CAAC;IAEzG;AACF"}
@@ -1,48 +1,89 @@
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.resolveProjectWorkflowAsync = resolveProjectWorkflowAsync;
7
- exports.resolveProjectWorkflowPerPlatformAsync = resolveProjectWorkflowPerPlatformAsync;
8
- const spawn_async_1 = __importDefault(require("@expo/spawn-async"));
9
- const promises_1 = __importDefault(require("fs/promises"));
10
- const glob_1 = require("glob");
11
- const ignore_1 = __importDefault(require("ignore"));
12
- const path_1 = __importDefault(require("path"));
13
- const ExpoResolver_1 = require("./ExpoResolver");
14
- const Path_1 = require("./utils/Path");
15
- /**
16
- * Replicated project workflow detection logic from expo-updates:
17
- * - https://github.com/expo/expo/blob/9b829e0749b8ff04f55a02b03cd1fefa74c5cd8d/packages/expo-updates/utils/src/workflow.ts
18
- * - https://github.com/expo/expo/blob/9b829e0749b8ff04f55a02b03cd1fefa74c5cd8d/packages/expo-updates/utils/src/vcs.ts
19
- */
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ 0 && (module.exports = {
6
+ resolveProjectWorkflowAsync: null,
7
+ resolveProjectWorkflowPerPlatformAsync: 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 resolveProjectWorkflowAsync () {
17
+ return resolveProjectWorkflowAsync;
18
+ },
19
+ get resolveProjectWorkflowPerPlatformAsync () {
20
+ return resolveProjectWorkflowPerPlatformAsync;
21
+ }
22
+ });
23
+ function _spawnasync() {
24
+ const data = /*#__PURE__*/ _interop_require_default(require("@expo/spawn-async"));
25
+ _spawnasync = 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 _glob() {
38
+ const data = require("glob");
39
+ _glob = function() {
40
+ return data;
41
+ };
42
+ return data;
43
+ }
44
+ function _ignore() {
45
+ const data = /*#__PURE__*/ _interop_require_default(require("ignore"));
46
+ _ignore = function() {
47
+ return data;
48
+ };
49
+ return data;
50
+ }
51
+ function _path() {
52
+ const data = /*#__PURE__*/ _interop_require_default(require("path"));
53
+ _path = function() {
54
+ return data;
55
+ };
56
+ return data;
57
+ }
58
+ const _ExpoResolver = require("./ExpoResolver");
59
+ const _Path = require("./utils/Path");
60
+ function _interop_require_default(obj) {
61
+ return obj && obj.__esModule ? obj : {
62
+ default: obj
63
+ };
64
+ }
20
65
  async function resolveProjectWorkflowAsync(projectRoot, platform, fingerprintIgnorePaths) {
21
- const configPluginsPackageRoot = (0, ExpoResolver_1.resolveExpoConfigPluginsPackagePath)(projectRoot);
66
+ const configPluginsPackageRoot = (0, _ExpoResolver.resolveExpoConfigPluginsPackagePath)(projectRoot);
22
67
  if (configPluginsPackageRoot == null) {
23
68
  return 'unknown';
24
69
  }
25
70
  const { AndroidConfig, IOSConfig } = require(configPluginsPackageRoot);
26
71
  let platformWorkflowMarkers;
27
72
  try {
28
- platformWorkflowMarkers =
29
- platform === 'android'
30
- ? [
31
- path_1.default.join(projectRoot, 'android/app/build.gradle'),
32
- await AndroidConfig.Paths.getAndroidManifestAsync(projectRoot),
33
- ]
34
- : [IOSConfig.Paths.getPBXProjectPath(projectRoot)];
35
- }
36
- catch {
73
+ platformWorkflowMarkers = platform === 'android' ? [
74
+ _path().default.join(projectRoot, 'android/app/build.gradle'),
75
+ await AndroidConfig.Paths.getAndroidManifestAsync(projectRoot)
76
+ ] : [
77
+ IOSConfig.Paths.getPBXProjectPath(projectRoot)
78
+ ];
79
+ } catch {
37
80
  return 'managed';
38
81
  }
39
82
  const vcsClient = await getVCSClientAsync(projectRoot);
40
- const vcsRoot = path_1.default.normalize(await vcsClient.getRootPathAsync());
41
- for (const marker of platformWorkflowMarkers) {
42
- const relativeMarker = (0, Path_1.toPosixPath)(path_1.default.relative(vcsRoot, marker));
43
- if ((await (0, Path_1.pathExistsAsync)(marker)) &&
44
- !(0, Path_1.isIgnoredPathWithMatchObjects)(relativeMarker, fingerprintIgnorePaths) &&
45
- !(await vcsClient.isFileIgnoredAsync(relativeMarker))) {
83
+ const vcsRoot = _path().default.normalize(await vcsClient.getRootPathAsync());
84
+ for (const marker of platformWorkflowMarkers){
85
+ const relativeMarker = (0, _Path.toPosixPath)(_path().default.relative(vcsRoot, marker));
86
+ if (await (0, _Path.pathExistsAsync)(marker) && !(0, _Path.isIgnoredPathWithMatchObjects)(relativeMarker, fingerprintIgnorePaths) && !await vcsClient.isFileIgnoredAsync(relativeMarker)) {
46
87
  return 'generic';
47
88
  }
48
89
  }
@@ -51,41 +92,51 @@ async function resolveProjectWorkflowAsync(projectRoot, platform, fingerprintIgn
51
92
  async function resolveProjectWorkflowPerPlatformAsync(projectRoot, fingerprintIgnorePaths) {
52
93
  const [android, ios] = await Promise.all([
53
94
  resolveProjectWorkflowAsync(projectRoot, 'android', fingerprintIgnorePaths),
54
- resolveProjectWorkflowAsync(projectRoot, 'ios', fingerprintIgnorePaths),
95
+ resolveProjectWorkflowAsync(projectRoot, 'ios', fingerprintIgnorePaths)
55
96
  ]);
56
- return { android, ios };
97
+ return {
98
+ android,
99
+ ios
100
+ };
57
101
  }
58
102
  async function getVCSClientAsync(projectRoot) {
59
103
  if (await isGitInstalledAndConfiguredAsync(projectRoot)) {
60
104
  return new GitClient(projectRoot);
61
- }
62
- else {
105
+ } else {
63
106
  return new NoVCSClient(projectRoot);
64
107
  }
65
108
  }
66
109
  class GitClient {
67
110
  projectRoot;
68
- constructor(projectRoot) {
111
+ constructor(projectRoot){
69
112
  this.projectRoot = projectRoot;
70
113
  }
71
114
  async getRootPathAsync() {
72
- return (await (0, spawn_async_1.default)('git', ['rev-parse', '--show-toplevel'], { cwd: this.projectRoot })).stdout.trim();
115
+ return (await (0, _spawnasync().default)('git', [
116
+ 'rev-parse',
117
+ '--show-toplevel'
118
+ ], {
119
+ cwd: this.projectRoot
120
+ })).stdout.trim();
73
121
  }
74
122
  async isFileIgnoredAsync(filePath) {
75
123
  try {
76
- await (0, spawn_async_1.default)('git', ['check-ignore', '-q', filePath], {
77
- cwd: path_1.default.normalize(await this.getRootPathAsync()),
124
+ await (0, _spawnasync().default)('git', [
125
+ 'check-ignore',
126
+ '-q',
127
+ filePath
128
+ ], {
129
+ cwd: _path().default.normalize(await this.getRootPathAsync())
78
130
  });
79
131
  return true;
80
- }
81
- catch {
132
+ } catch {
82
133
  return false;
83
134
  }
84
135
  }
85
136
  }
86
137
  class NoVCSClient {
87
138
  projectRoot;
88
- constructor(projectRoot) {
139
+ constructor(projectRoot){
89
140
  this.projectRoot = projectRoot;
90
141
  }
91
142
  async getRootPathAsync() {
@@ -99,18 +150,23 @@ class NoVCSClient {
99
150
  }
100
151
  async function isGitInstalledAndConfiguredAsync(projectRoot) {
101
152
  try {
102
- await (0, spawn_async_1.default)('git', ['--help']);
103
- }
104
- catch (error) {
153
+ await (0, _spawnasync().default)('git', [
154
+ '--help'
155
+ ]);
156
+ } catch (error) {
105
157
  if (error.code === 'ENOENT') {
106
158
  return false;
107
159
  }
108
160
  throw error;
109
161
  }
110
162
  try {
111
- await (0, spawn_async_1.default)('git', ['rev-parse', '--show-toplevel'], { cwd: projectRoot });
112
- }
113
- catch {
163
+ await (0, _spawnasync().default)('git', [
164
+ 'rev-parse',
165
+ '--show-toplevel'
166
+ ], {
167
+ cwd: projectRoot
168
+ });
169
+ } catch {
114
170
  return false;
115
171
  }
116
172
  return true;
@@ -131,37 +187,43 @@ node_modules
131
187
  *
132
188
  * Differs from the eas-cli Ignore class by not using `.easignore`. Otherwise this is copied. May try
133
189
  * to merge the implementations soon.
134
- */
135
- class Ignore {
190
+ */ class Ignore {
136
191
  rootDir;
137
192
  ignoreMapping = [];
138
- constructor(rootDir) {
193
+ constructor(rootDir){
139
194
  this.rootDir = rootDir;
140
195
  }
141
196
  async initIgnoreAsync() {
142
- const ignoreFilePaths = (await (0, glob_1.glob)(`**/${GITIGNORE_FILENAME}`, {
197
+ const ignoreFilePaths = (await (0, _glob().glob)(`**/${GITIGNORE_FILENAME}`, {
143
198
  cwd: this.rootDir,
144
- ignore: ['node_modules'],
145
- follow: false,
146
- }))
147
- // ensure that parent dir is before child directories
148
- .sort((a, b) => a.length - b.length && a.localeCompare(b));
149
- const ignoreMapping = await Promise.all(ignoreFilePaths.map(async (filePath) => {
199
+ ignore: [
200
+ 'node_modules'
201
+ ],
202
+ follow: false
203
+ }))// ensure that parent dir is before child directories
204
+ .sort((a, b)=>a.length - b.length && a.localeCompare(b));
205
+ const ignoreMapping = await Promise.all(ignoreFilePaths.map(async (filePath)=>{
150
206
  return [
151
207
  filePath.slice(0, filePath.length - GITIGNORE_FILENAME.length),
152
- (0, ignore_1.default)().add(await promises_1.default.readFile(path_1.default.join(this.rootDir, filePath), 'utf-8')),
208
+ (0, _ignore().default)().add(await _promises().default.readFile(_path().default.join(this.rootDir, filePath), 'utf-8'))
153
209
  ];
154
210
  }));
155
- this.ignoreMapping = [['', (0, ignore_1.default)().add(DEFAULT_IGNORE)], ...ignoreMapping];
211
+ this.ignoreMapping = [
212
+ [
213
+ '',
214
+ (0, _ignore().default)().add(DEFAULT_IGNORE)
215
+ ],
216
+ ...ignoreMapping
217
+ ];
156
218
  }
157
219
  ignores(relativePath) {
158
- for (const [prefix, ignore] of this.ignoreMapping) {
220
+ for (const [prefix, ignore] of this.ignoreMapping){
159
221
  if (relativePath.startsWith(prefix) && ignore.ignores(relativePath.slice(prefix.length))) {
160
222
  return true;
161
223
  }
162
224
  }
163
225
  return false;
164
226
  }
165
- }
166
- //#endregion - a copy of vcs client and ignore handler from expo-updates
167
- //# sourceMappingURL=ProjectWorkflow.js.map
227
+ } //#endregion - a copy of vcs client and ignore handler from expo-updates
228
+
229
+ //# sourceMappingURL=ProjectWorkflow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectWorkflow.js","sourceRoot":"","sources":["../src/ProjectWorkflow.ts"],"names":[],"mappings":";;;;;AAkBA,kEAqCC;AAED,wFASC;AAlED,oEAA2C;AAC3C,2DAA6B;AAC7B,+BAA4B;AAE5B,oDAAkC;AAElC,gDAAwB;AAExB,iDAAqE;AAErE,uCAA2F;AAE3F;;;;GAIG;AAEI,KAAK,UAAU,2BAA2B,CAC/C,WAAmB,EACnB,QAAkB,EAClB,sBAAmC;IAEnC,MAAM,wBAAwB,GAAG,IAAA,kDAAmC,EAAC,WAAW,CAAC,CAAC;IAClF,IAAI,wBAAwB,IAAI,IAAI,EAAE,CAAC;QACrC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAEvE,IAAI,uBAAiC,CAAC;IACtC,IAAI,CAAC;QACH,uBAAuB;YACrB,QAAQ,KAAK,SAAS;gBACpB,CAAC,CAAC;oBACE,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,0BAA0B,CAAC;oBAClD,MAAM,aAAa,CAAC,KAAK,CAAC,uBAAuB,CAAC,WAAW,CAAC;iBAC/D;gBACH,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,iBAAiB,CAAC,WAAW,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,cAAI,CAAC,SAAS,CAAC,MAAM,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACnE,KAAK,MAAM,MAAM,IAAI,uBAAuB,EAAE,CAAC;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,aAAa,CAAC,CAAC;IACpF,CAAC;IAEM,OAAO,CAAC,YAAoB;QACjC,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YAClD,IAAI,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;gBACzF,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,wEAAwE"}
1
+ {"version":3,"sources":["ProjectWorkflow.ts"],"sourcesContent":[null],"names":["resolveProjectWorkflowAsync","resolveProjectWorkflowPerPlatformAsync","projectRoot","platform","fingerprintIgnorePaths","configPluginsPackageRoot","resolveExpoConfigPluginsPackagePath","AndroidConfig","IOSConfig","require","platformWorkflowMarkers","path","join","Paths","getAndroidManifestAsync","getPBXProjectPath","vcsClient","getVCSClientAsync","vcsRoot","normalize","getRootPathAsync","marker","relativeMarker","toPosixPath","relative","pathExistsAsync","isIgnoredPathWithMatchObjects","isFileIgnoredAsync","android","ios","Promise","all","isGitInstalledAndConfiguredAsync","GitClient","NoVCSClient","spawnAsync","cwd","stdout","trim","filePath","ignore","Ignore","initIgnoreAsync","ignores","error","code","GITIGNORE_FILENAME","DEFAULT_IGNORE","ignoreMapping","rootDir","ignoreFilePaths","glob","follow","sort","a","b","length","localeCompare","map","slice","createIgnore","add","fs","readFile","relativePath","prefix","startsWith"],"mappings":";;;;;;;;;;;;;;;QAkBsBA;eAAAA;;QAuCAC;eAAAA;;;;gEAzDC;;;;;;;gEACR;;;;;;;yBACM;;;;;;;gEAEI;;;;;;;gEAER;;;;;;8BAEmC;sBAEwB;;;;;;AAQrE,eAAeD,4BACpBE,WAAmB,EACnBC,QAAkB,EAClBC,sBAAmC;IAEnC,MAAMC,2BAA2BC,IAAAA,iDAAmC,EAACJ;IACrE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kB,AACtB,CAAA,MAAMC,IAAAA,YAAI,EAAC,CAAC,GAAG,EAAEL,oBAAoB,EAAE;YACrCV,KAAK,IAAI,CAACa,OAAO;YACjBT,QAAQ;gBAAC;aAAe;YACxBY,QAAQ;QACV,EAAC,CAED,qDAAqD;SACpDC,IAAI,CAAC,CAACC,GAAGC,IAAMD,EAAEE,MAAM,GAAGD,EAAEC,MAAM,IAAIF,EAAEG,aAAa,CAACF;QAEzD,MAAMP,gBAAgB,MAAMlB,QAAQC,GAAG,CACrCmB,gBAAgBQ,GAAG,CAAC,OAAOnB;YACzB,OAAO;gBACLA,SAASoB,KAAK,CAAC,GAAGpB,SAASiB,MAAM,GAAGV,mBAAmBU,MAAM;gBAC7DI,IAAAA,iBAAY,IAAGC,GAAG,CAAC,MAAMC,mBAAE,CAACC,QAAQ,CAACpD,eAAI,CAACC,IAAI,CAAC,IAAI,CAACqC,OAAO,EAAEV,WAAW;aACzE;QACH;QAEF,IAAI,CAACS,aAAa,GAAG;YAAC;gBAAC;gBAAIY,IAAAA,iBAAY,IAAGC,GAAG,CAACd;aAAgB;eAAKC;SAAc;IACnF;IAEOL,QAAQqB,YAAoB,EAAW;QAC5C,KAAK,MAAM,CAACC,QAAQzB,OAAO,IAAI,IAAI,CAACQ,aAAa,CAAE;YACjD,IAAIgB,aAAaE,UAAU,CAACD,WAAWzB,OAAOG,OAAO,CAACqB,aAAaL,KAAK,CAACM,OAAOT,MAAM,IAAI;gBACxF,OAAO;YACT;QACF;QACA,OAAO;IACT;AACF,EAEA,wEAAwE"}
package/build/Sort.js CHANGED
@@ -1,7 +1,25 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sortSources = sortSources;
4
- exports.compareSource = compareSource;
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ 0 && (module.exports = {
6
+ compareSource: null,
7
+ sortSources: 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 compareSource () {
17
+ return compareSource;
18
+ },
19
+ get sortSources () {
20
+ return sortSources;
21
+ }
22
+ });
5
23
  function sortSources(sources) {
6
24
  return sources.sort(compareSource);
7
25
  }
@@ -9,15 +27,8 @@ const typeOrder = {
9
27
  file: 0,
10
28
  dir: 1,
11
29
  contents: 2,
30
+ package: 3
12
31
  };
13
- /**
14
- * Comparator between two sources.
15
- * This is useful for sorting sources in a consistent order.
16
- * @returns:
17
- * == 0 if a and b are equal,
18
- * < 0 if a is less than b,
19
- * > 0 if a is greater than b.
20
- */
21
32
  function compareSource(a, b) {
22
33
  const typeResult = typeOrder[a.type] - typeOrder[b.type];
23
34
  if (typeResult === 0) {
@@ -25,16 +36,19 @@ function compareSource(a, b) {
25
36
  const aValue = a.overrideHashKey ?? a.filePath;
26
37
  const bValue = b.overrideHashKey ?? b.filePath;
27
38
  return aValue.localeCompare(bValue);
28
- }
29
- else if (a.type === 'dir' && b.type === 'dir') {
39
+ } else if (a.type === 'dir' && b.type === 'dir') {
30
40
  const aValue = a.overrideHashKey ?? a.filePath;
31
41
  const bValue = b.overrideHashKey ?? b.filePath;
32
42
  return aValue.localeCompare(bValue);
33
- }
34
- else if (a.type === 'contents' && b.type === 'contents') {
43
+ } else if (a.type === 'contents' && b.type === 'contents') {
35
44
  return a.id.localeCompare(b.id);
45
+ } else if (a.type === 'package' && b.type === 'package') {
46
+ const aValue = a.overrideHashKey ?? `${a.name}@${a.version}`;
47
+ const bValue = b.overrideHashKey ?? `${b.name}@${b.version}`;
48
+ return aValue.localeCompare(bValue);
36
49
  }
37
50
  }
38
51
  return typeResult;
39
52
  }
40
- //# sourceMappingURL=Sort.js.map
53
+
54
+ //# sourceMappingURL=Sort.js.map
package/build/Sort.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Sort.js","sourceRoot":"","sources":["../src/Sort.ts"],"names":[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,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
1
+ {"version":3,"sources":["Sort.ts"],"sourcesContent":[null],"names":["compareSource","sortSources","sources","sort","typeOrder","file","dir","contents","package","a","b","typeResult","type","aValue","overrideHashKey","filePath","bValue","localeCompare","id","name","version"],"mappings":";;;;;;;;;;;;;;;QAqBgBA;eAAAA;;QAnBAC;eAAAA;;;AAAT,SAASA,YAAkCC,OAAY;IAC5D,OAAOA,QAAQC,IAAI,CAACH;AACtB;AAEA,MAAMI,YAAY;IAChBC,MAAM;IACNC,KAAK;IACLC,UAAU;IACVC,SAAS;AACX;AAUO,SAASR,cAAcS,CAAa,EAAEC,CAAa;IACxD,MAAMC,aAAaP,SAAS,CAACK,EAAEG,IAAI,CAAC,GAAGR,SAAS,CAACM,EAAEE,IAAI,CAAC;IACxD,IAAID,eAAe,GAAG;QACpB,IAAIF,EAAEG,IAAI,KAAK,UAAUF,EAAEE,IAAI,KAAK,QAAQ;YAC1C,MAAMC,SAASJ,EAAEK,eAAe,IAAIL,EAAEM,QAAQ;YAC9C,MAAMC,SAASN,EAAEI,eAAe,IAAIJ,EAAEK,QAAQ;YAC9C,OAAOF,OAAOI,aAAa,CAACD;QAC9B,OAAO,IAAIP,EAAEG,IAAI,KAAK,SAASF,EAAEE,IAAI,KAAK,OAAO;YAC/C,MAAMC,SAASJ,EAAEK,eAAe,IAAIL,EAAEM,QAAQ;YAC9C,MAAMC,SAASN,EAAEI,eAAe,IAAIJ,EAAEK,QAAQ;YAC9C,OAAOF,OAAOI,aAAa,CAACD;QAC9B,OAAO,IAAIP,EAAEG,IAAI,KAAK,cAAcF,EAAEE,IAAI,KAAK,YAAY;YACzD,OAAOH,EAAES,EAAE,CAACD,aAAa,CAACP,EAAEQ,EAAE;QAChC,OAAO,IAAIT,EAAEG,IAAI,KAAK,aAAaF,EAAEE,IAAI,KAAK,WAAW;YACvD,MAAMC,SAASJ,EAAEK,eAAe,IAAI,GAAGL,EAAEU,IAAI,CAAC,CAAC,EAAEV,EAAEW,OAAO,EAAE;YAC5D,MAAMJ,SAASN,EAAEI,eAAe,IAAI,GAAGJ,EAAES,IAAI,CAAC,CAAC,EAAET,EAAEU,OAAO,EAAE;YAC5D,OAAOP,OAAOI,aAAa,CAACD;QAC9B;IACF;IACA,OAAOL;AACT"}
@@ -1,31 +1,37 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FileHookTransform = void 0;
4
- const stream_1 = require("stream");
5
- /**
6
- * A transform stream that allows to hook into file contents and transform them.
7
- */
8
- class FileHookTransform extends stream_1.Transform {
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FileHookTransform", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return FileHookTransform;
9
+ }
10
+ });
11
+ function _stream() {
12
+ const data = require("stream");
13
+ _stream = function() {
14
+ return data;
15
+ };
16
+ return data;
17
+ }
18
+ class FileHookTransform extends _stream().Transform {
9
19
  source;
10
20
  transformFn;
11
21
  debug;
12
22
  _isTransformed = undefined;
13
- constructor(source, transformFn, debug) {
14
- super();
15
- this.source = source;
16
- this.transformFn = transformFn;
17
- this.debug = debug;
23
+ constructor(source, transformFn, debug){
24
+ super(), this.source = source, this.transformFn = transformFn, this.debug = debug;
18
25
  }
19
26
  /**
20
- * Indicates whether the file content has been transformed.
21
- * @returns boolean value if `debug` is true, otherwise the value would be undefined.
22
- */
23
- get isTransformed() {
27
+ * Indicates whether the file content has been transformed.
28
+ * @returns boolean value if `debug` is true, otherwise the value would be undefined.
29
+ */ get isTransformed() {
24
30
  return this._isTransformed;
25
31
  }
26
32
  //#region - Transform implementations
27
33
  _transform(chunk, encoding, callback) {
28
- const result = this.transformFn(this.source, chunk, false /* isEndOfFile */, encoding);
34
+ const result = this.transformFn(this.source, chunk, false, encoding);
29
35
  if (this.debug) {
30
36
  this._isTransformed ||= chunk !== result;
31
37
  }
@@ -35,12 +41,12 @@ class FileHookTransform extends stream_1.Transform {
35
41
  callback();
36
42
  }
37
43
  _flush(callback) {
38
- const result = this.transformFn(this.source, null, true /* isEndOfFile */, 'utf8');
44
+ const result = this.transformFn(this.source, null, true, 'utf8');
39
45
  if (result) {
40
46
  this.push(result);
41
47
  }
42
48
  callback();
43
49
  }
44
50
  }
45
- exports.FileHookTransform = FileHookTransform;
46
- //# sourceMappingURL=FileHookTransform.js.map
51
+
52
+ //# sourceMappingURL=FileHookTransform.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileHookTransform.js","sourceRoot":"","sources":["../../src/hash/FileHookTransform.ts"],"names":[],"mappings":";;;AAAA,mCAA2D;AAI3D;;GAEG;AACH,MAAa,iBAAkB,SAAQ,kBAAS;IAI3B;IACA;IACA;IALX,cAAc,GAAwB,SAAS,CAAC;IAExD,YACmB,MAA+B,EAC/B,WAAsC,EACtC,KAA0B;QAE3C,KAAK,EAAE,CAAC;QAJS,WAAM,GAAN,MAAM,CAAyB;QAC/B,gBAAW,GAAX,WAAW,CAA2B;QACtC,UAAK,GAAL,KAAK,CAAqB;IAG7C,CAAC;IAED;;;OAGG;IACH,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,qCAAqC;IAErC,UAAU,CAAC,KAAU,EAAE,QAAwB,EAAE,QAA2B;QAC1E,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;QACvF,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,cAAc,KAAK,KAAK,KAAK,MAAM,CAAC;QAC3C,CAAC;QACD,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpB,CAAC;QACD,QAAQ,EAAE,CAAC;IACb,CAAC;IAED,MAAM,CAAC,QAA2B;QAChC,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;QACnF,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpB,CAAC;QACD,QAAQ,EAAE,CAAC;IACb,CAAC;CAGF;AAzCD,8CAyCC"}
1
+ {"version":3,"sources":["hash/FileHookTransform.ts"],"sourcesContent":[null],"names":["FileHookTransform","Transform","_isTransformed","undefined","source","transformFn","debug","isTransformed","_transform","chunk","encoding","callback","result","push","_flush"],"mappings":";;;;+BAOaA;;;eAAAA;;;;yBAPqC;;;;;;AAO3C,MAAMA,0BAA0BC,mBAAS;;;;IACtCC,iBAAsCC,UAAU;IAExD,YACE,AAAiBC,MAA+B,EAChD,AAAiBC,WAAsC,EACvD,AAAiBC,KAA0B,CAC3C;QACA,KAAK,SAJYF,SAAAA,aACAC,cAAAA,kBACAC,QAAAA;IAGnB;IAEA;;;GAGC,GACD,IAAIC,gBAAqC;QACvC,OAAO,IAAI,CAACL,cAAc;IAC5B;IAEA,qCAAqC;IAErCM,WAAWC,KAAU,EAAEC,QAAwB,EAAEC,QAA2B,EAAQ;QAClF,MAAMC,SAAS,IAAI,CAACP,WAAW,CAAC,IAAI,CAACD,MAAM,EAAEK,OAAO,OAAyBC;QAC7E,IAAI,IAAI,CAACJ,KAAK,EAAE;YACd,IAAI,CAACJ,cAAc,KAAKO,UAAUG;QACpC;QACA,IAAIA,QAAQ;YACV,IAAI,CAACC,IAAI,CAACD;QACZ;QACAD;IACF;IAEAG,OAAOH,QAA2B,EAAQ;QACxC,MAAMC,SAAS,IAAI,CAACP,WAAW,CAAC,IAAI,CAACD,MAAM,EAAE,MAAM,MAAwB;QAC3E,IAAIQ,QAAQ;YACV,IAAI,CAACC,IAAI,CAACD;QACZ;QACAD;IACF;AAGF"}
@@ -1,4 +1,4 @@
1
- import type { Fingerprint, FingerprintSource, HashResultContents, HashResultDir, HashResultFile, HashSource, HashSourceContents, NormalizedOptions } from '../Fingerprint.types';
1
+ import type { Fingerprint, FingerprintSource, HashResultContents, HashResultDir, HashResultFile, HashResultPackage, HashSource, HashSourceContents, HashSourcePackage, NormalizedOptions } from '../Fingerprint.types';
2
2
  import { type Limiter } from '../utils/Concurrency';
3
3
  /**
4
4
  * Create a `Fingerprint` from `HashSources` array
@@ -22,6 +22,13 @@ export declare function createDirHashResultsAsync(dirPath: string, limiter: Limi
22
22
  * Create `HashResult` for a `HashSourceContents`
23
23
  */
24
24
  export declare function createContentsHashResultsAsync(source: HashSourceContents, options: NormalizedOptions): Promise<HashResultContents>;
25
+ /**
26
+ * Create a `HashResult` for a package from its embedded `name` and `version`.
27
+ * The sourcer reads these from the `package.json`, so the hash depends on the package identity
28
+ * rather than its resolved path or unrelated contents.
29
+ * Returns null when the package is ignored.
30
+ */
31
+ export declare function createPackageHashResultsAsync(source: HashSourcePackage, options: NormalizedOptions): Promise<HashResultPackage | null>;
25
32
  /**
26
33
  * Create id from given source
27
34
  */