@expo/cli 0.24.6 → 0.24.8

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 (28) hide show
  1. package/build/bin/cli +1 -1
  2. package/build/src/run/android/resolveOptions.js +13 -1
  3. package/build/src/run/android/resolveOptions.js.map +1 -1
  4. package/build/src/run/android/runAndroidAsync.js +17 -24
  5. package/build/src/run/android/runAndroidAsync.js.map +1 -1
  6. package/build/src/run/ios/options/resolveOptions.js +13 -1
  7. package/build/src/run/ios/options/resolveOptions.js.map +1 -1
  8. package/build/src/run/ios/runIosAsync.js +20 -19
  9. package/build/src/run/ios/runIosAsync.js.map +1 -1
  10. package/build/src/start/server/metro/createExpoFallbackResolver.js +6 -4
  11. package/build/src/start/server/metro/createExpoFallbackResolver.js.map +1 -1
  12. package/build/src/start/server/metro/instantiateMetro.js +2 -2
  13. package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
  14. package/build/src/start/server/metro/withMetroMultiPlatform.js +1 -0
  15. package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
  16. package/build/src/utils/remote-build-cache-providers/eas.js +12 -2
  17. package/build/src/utils/remote-build-cache-providers/eas.js.map +1 -1
  18. package/build/src/utils/remote-build-cache-providers/helpers.js +55 -3
  19. package/build/src/utils/remote-build-cache-providers/helpers.js.map +1 -1
  20. package/build/src/utils/remote-build-cache-providers/index.js +168 -0
  21. package/build/src/utils/remote-build-cache-providers/index.js.map +1 -0
  22. package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
  23. package/build/src/utils/telemetry/utils/context.js +1 -1
  24. package/build/src/utils/tsconfig/evaluateTsConfig.js +7 -2
  25. package/build/src/utils/tsconfig/evaluateTsConfig.js.map +1 -1
  26. package/package.json +6 -6
  27. package/build/src/run/remoteBuildCache.js +0 -80
  28. package/build/src/run/remoteBuildCache.js.map +0 -1
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ resolvePluginFunction: function() {
13
+ return resolvePluginFunction;
14
+ },
15
+ resolveRemoteBuildCache: function() {
16
+ return resolveRemoteBuildCache;
17
+ },
18
+ resolveRemoteBuildCacheProvider: function() {
19
+ return resolveRemoteBuildCacheProvider;
20
+ },
21
+ uploadRemoteBuildCache: function() {
22
+ return uploadRemoteBuildCache;
23
+ }
24
+ });
25
+ function _resolvefrom() {
26
+ const data = /*#__PURE__*/ _interop_require_default(require("resolve-from"));
27
+ _resolvefrom = function() {
28
+ return data;
29
+ };
30
+ return data;
31
+ }
32
+ const _eas = require("./eas");
33
+ const _helpers = require("./helpers");
34
+ function _interop_require_default(obj) {
35
+ return obj && obj.__esModule ? obj : {
36
+ default: obj
37
+ };
38
+ }
39
+ const debug = require('debug')('expo:run:remote-build');
40
+ const resolveRemoteBuildCacheProvider = (provider, projectRoot)=>{
41
+ if (!provider) {
42
+ return;
43
+ }
44
+ if (provider === 'eas') {
45
+ return {
46
+ plugin: _eas.EASRemoteBuildCacheProvider,
47
+ options: {}
48
+ };
49
+ }
50
+ if (typeof provider === 'object' && typeof provider.plugin === 'string') {
51
+ const plugin = resolvePluginFunction(projectRoot, provider.plugin);
52
+ return {
53
+ plugin,
54
+ options: provider.options
55
+ };
56
+ }
57
+ throw new Error('Invalid remote build cache provider');
58
+ };
59
+ async function resolveRemoteBuildCache({ projectRoot, platform, provider, runOptions }) {
60
+ const fingerprintHash = await calculateFingerprintHashAsync({
61
+ projectRoot,
62
+ platform,
63
+ provider,
64
+ runOptions
65
+ });
66
+ if (!fingerprintHash) {
67
+ return null;
68
+ }
69
+ return await provider.plugin.resolveRemoteBuildCache({
70
+ fingerprintHash,
71
+ platform,
72
+ runOptions,
73
+ projectRoot
74
+ }, provider.options);
75
+ }
76
+ async function uploadRemoteBuildCache({ projectRoot, platform, provider, buildPath, runOptions }) {
77
+ const fingerprintHash = await calculateFingerprintHashAsync({
78
+ projectRoot,
79
+ platform,
80
+ provider,
81
+ runOptions
82
+ });
83
+ if (!fingerprintHash) {
84
+ debug('No fingerprint hash found, skipping upload');
85
+ return;
86
+ }
87
+ await provider.plugin.uploadRemoteBuildCache({
88
+ projectRoot,
89
+ platform,
90
+ fingerprintHash,
91
+ buildPath,
92
+ runOptions
93
+ }, provider.options);
94
+ }
95
+ async function calculateFingerprintHashAsync({ projectRoot, platform, provider, runOptions }) {
96
+ if (provider.plugin.calculateFingerprintHash) {
97
+ return await provider.plugin.calculateFingerprintHash({
98
+ projectRoot,
99
+ platform,
100
+ runOptions
101
+ }, provider.options);
102
+ }
103
+ const Fingerprint = importFingerprintForDev(projectRoot);
104
+ if (!Fingerprint) {
105
+ debug('@expo/fingerprint is not installed in the project, unable to calculate fingerprint');
106
+ return null;
107
+ }
108
+ const fingerprint = await Fingerprint.createFingerprintAsync(projectRoot);
109
+ return fingerprint.hash;
110
+ }
111
+ function importFingerprintForDev(projectRoot) {
112
+ try {
113
+ return require(require.resolve('@expo/fingerprint', {
114
+ paths: [
115
+ projectRoot
116
+ ]
117
+ }));
118
+ } catch {
119
+ return null;
120
+ }
121
+ }
122
+ /**
123
+ * Resolve the provider plugin from a node module or package.
124
+ * If the module or package does not include a provider plugin, this function throws.
125
+ * The resolution is done in following order:
126
+ * 1. Is the reference a relative file path or an import specifier with file path? e.g. `./file.js`, `pkg/file.js` or `@org/pkg/file.js`?
127
+ * - Resolve the provider plugin as-is
128
+ * 2. Does the module have a valid provider plugin in the `main` field?
129
+ * - Resolve the `main` entry point as provider plugin
130
+ */ function resolvePluginFilePathForModule(projectRoot, pluginReference) {
131
+ if ((0, _helpers.moduleNameIsDirectFileReference)(pluginReference)) {
132
+ // Only resolve `./file.js`, `package/file.js`, `@org/package/file.js`
133
+ const pluginScriptFile = _resolvefrom().default.silent(projectRoot, pluginReference);
134
+ if (pluginScriptFile) {
135
+ return pluginScriptFile;
136
+ }
137
+ } else if ((0, _helpers.moduleNameIsPackageReference)(pluginReference)) {
138
+ // Try to resole the `main` entry as config plugin
139
+ const packageMainEntry = _resolvefrom().default.silent(projectRoot, pluginReference);
140
+ if (packageMainEntry) {
141
+ return packageMainEntry;
142
+ }
143
+ }
144
+ throw new Error(`Failed to resolve provider plugin for module "${pluginReference}" relative to "${projectRoot}". Do you have node modules installed?`);
145
+ }
146
+ function resolvePluginFunction(projectRoot, pluginReference) {
147
+ const pluginFile = resolvePluginFilePathForModule(projectRoot, pluginReference);
148
+ try {
149
+ let plugin = require(pluginFile);
150
+ if ((plugin == null ? void 0 : plugin.default) != null) {
151
+ plugin = plugin.default;
152
+ }
153
+ if (typeof plugin !== 'object' || typeof plugin.resolveRemoteBuildCache !== 'function' || typeof plugin.uploadRemoteBuildCache !== 'function') {
154
+ throw new Error(`
155
+ The provider plugin "${pluginReference}" must export an object containing
156
+ the resolveRemoteBuildCache and uploadRemoteBuildCache functions.
157
+ `);
158
+ }
159
+ return plugin;
160
+ } catch (error) {
161
+ if (error instanceof SyntaxError) {
162
+ // Add error linking to the docs of how create a valid provider plugin
163
+ }
164
+ throw error;
165
+ }
166
+ }
167
+
168
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/utils/remote-build-cache-providers/index.ts"],"sourcesContent":["import {\n ExpoConfig,\n RemoteBuildCachePlugin,\n RemoteBuildCacheProvider,\n RunOptions,\n} from '@expo/config';\nimport resolveFrom from 'resolve-from';\n\nimport { EASRemoteBuildCacheProvider } from './eas';\nimport { moduleNameIsDirectFileReference, moduleNameIsPackageReference } from './helpers';\n\nconst debug = require('debug')('expo:run:remote-build') as typeof console.log;\n\nexport const resolveRemoteBuildCacheProvider = (\n provider:\n | Required<Required<ExpoConfig>['experiments']>['remoteBuildCache']['provider']\n | undefined,\n projectRoot: string\n): RemoteBuildCacheProvider | undefined => {\n if (!provider) {\n return;\n }\n\n if (provider === 'eas') {\n return { plugin: EASRemoteBuildCacheProvider, options: {} };\n }\n\n if (typeof provider === 'object' && typeof provider.plugin === 'string') {\n const plugin = resolvePluginFunction(projectRoot, provider.plugin);\n\n return { plugin, options: provider.options };\n }\n\n throw new Error('Invalid remote build cache provider');\n};\n\nexport async function resolveRemoteBuildCache({\n projectRoot,\n platform,\n provider,\n runOptions,\n}: {\n projectRoot: string;\n platform: 'android' | 'ios';\n provider: RemoteBuildCacheProvider;\n runOptions: RunOptions;\n}): Promise<string | null> {\n const fingerprintHash = await calculateFingerprintHashAsync({\n projectRoot,\n platform,\n provider,\n runOptions,\n });\n if (!fingerprintHash) {\n return null;\n }\n\n return await provider.plugin.resolveRemoteBuildCache(\n { fingerprintHash, platform, runOptions, projectRoot },\n provider.options\n );\n}\n\nexport async function uploadRemoteBuildCache({\n projectRoot,\n platform,\n provider,\n buildPath,\n runOptions,\n}: {\n projectRoot: string;\n platform: 'android' | 'ios';\n provider: RemoteBuildCacheProvider;\n buildPath: string;\n runOptions: RunOptions;\n}): Promise<void> {\n const fingerprintHash = await calculateFingerprintHashAsync({\n projectRoot,\n platform,\n provider,\n runOptions,\n });\n if (!fingerprintHash) {\n debug('No fingerprint hash found, skipping upload');\n return;\n }\n\n await provider.plugin.uploadRemoteBuildCache(\n {\n projectRoot,\n platform,\n fingerprintHash,\n buildPath,\n runOptions,\n },\n provider.options\n );\n}\n\nasync function calculateFingerprintHashAsync({\n projectRoot,\n platform,\n provider,\n runOptions,\n}: {\n projectRoot: string;\n platform: 'android' | 'ios';\n provider: RemoteBuildCacheProvider;\n runOptions: RunOptions;\n}): Promise<string | null> {\n if (provider.plugin.calculateFingerprintHash) {\n return await provider.plugin.calculateFingerprintHash(\n { projectRoot, platform, runOptions },\n provider.options\n );\n }\n\n const Fingerprint = importFingerprintForDev(projectRoot);\n if (!Fingerprint) {\n debug('@expo/fingerprint is not installed in the project, unable to calculate fingerprint');\n return null;\n }\n const fingerprint = await Fingerprint.createFingerprintAsync(projectRoot);\n\n return fingerprint.hash;\n}\n\nfunction importFingerprintForDev(projectRoot: string): null | typeof import('@expo/fingerprint') {\n try {\n return require(require.resolve('@expo/fingerprint', { paths: [projectRoot] }));\n } catch {\n return null;\n }\n}\n\n/**\n * Resolve the provider plugin from a node module or package.\n * If the module or package does not include a provider plugin, this function throws.\n * The resolution is done in following order:\n * 1. Is the reference a relative file path or an import specifier with file path? e.g. `./file.js`, `pkg/file.js` or `@org/pkg/file.js`?\n * - Resolve the provider plugin as-is\n * 2. Does the module have a valid provider plugin in the `main` field?\n * - Resolve the `main` entry point as provider plugin\n */\nfunction resolvePluginFilePathForModule(projectRoot: string, pluginReference: string) {\n if (moduleNameIsDirectFileReference(pluginReference)) {\n // Only resolve `./file.js`, `package/file.js`, `@org/package/file.js`\n const pluginScriptFile = resolveFrom.silent(projectRoot, pluginReference);\n if (pluginScriptFile) {\n return pluginScriptFile;\n }\n } else if (moduleNameIsPackageReference(pluginReference)) {\n // Try to resole the `main` entry as config plugin\n const packageMainEntry = resolveFrom.silent(projectRoot, pluginReference);\n if (packageMainEntry) {\n return packageMainEntry;\n }\n }\n\n throw new Error(\n `Failed to resolve provider plugin for module \"${pluginReference}\" relative to \"${projectRoot}\". Do you have node modules installed?`\n );\n}\n\n// Resolve the module function and assert type\nexport function resolvePluginFunction(\n projectRoot: string,\n pluginReference: string\n): RemoteBuildCachePlugin {\n const pluginFile = resolvePluginFilePathForModule(projectRoot, pluginReference);\n\n try {\n let plugin = require(pluginFile);\n if (plugin?.default != null) {\n plugin = plugin.default;\n }\n\n if (\n typeof plugin !== 'object' ||\n typeof plugin.resolveRemoteBuildCache !== 'function' ||\n typeof plugin.uploadRemoteBuildCache !== 'function'\n ) {\n throw new Error(`\n The provider plugin \"${pluginReference}\" must export an object containing\n the resolveRemoteBuildCache and uploadRemoteBuildCache functions.\n `);\n }\n return plugin;\n } catch (error) {\n if (error instanceof SyntaxError) {\n // Add error linking to the docs of how create a valid provider plugin\n }\n throw error;\n }\n}\n"],"names":["resolvePluginFunction","resolveRemoteBuildCache","resolveRemoteBuildCacheProvider","uploadRemoteBuildCache","debug","require","provider","projectRoot","plugin","EASRemoteBuildCacheProvider","options","Error","platform","runOptions","fingerprintHash","calculateFingerprintHashAsync","buildPath","calculateFingerprintHash","Fingerprint","importFingerprintForDev","fingerprint","createFingerprintAsync","hash","resolve","paths","resolvePluginFilePathForModule","pluginReference","moduleNameIsDirectFileReference","pluginScriptFile","resolveFrom","silent","moduleNameIsPackageReference","packageMainEntry","pluginFile","default","error","SyntaxError"],"mappings":";;;;;;;;;;;IAqKgBA,qBAAqB;eAArBA;;IAjIMC,uBAAuB;eAAvBA;;IAvBTC,+BAA+B;eAA/BA;;IAkDSC,sBAAsB;eAAtBA;;;;gEAzDE;;;;;;qBAEoB;yBACkC;;;;;;AAE9E,MAAMC,QAAQC,QAAQ,SAAS;AAExB,MAAMH,kCAAkC,CAC7CI,UAGAC;IAEA,IAAI,CAACD,UAAU;QACb;IACF;IAEA,IAAIA,aAAa,OAAO;QACtB,OAAO;YAAEE,QAAQC,gCAA2B;YAAEC,SAAS,CAAC;QAAE;IAC5D;IAEA,IAAI,OAAOJ,aAAa,YAAY,OAAOA,SAASE,MAAM,KAAK,UAAU;QACvE,MAAMA,SAASR,sBAAsBO,aAAaD,SAASE,MAAM;QAEjE,OAAO;YAAEA;YAAQE,SAASJ,SAASI,OAAO;QAAC;IAC7C;IAEA,MAAM,IAAIC,MAAM;AAClB;AAEO,eAAeV,wBAAwB,EAC5CM,WAAW,EACXK,QAAQ,EACRN,QAAQ,EACRO,UAAU,EAMX;IACC,MAAMC,kBAAkB,MAAMC,8BAA8B;QAC1DR;QACAK;QACAN;QACAO;IACF;IACA,IAAI,CAACC,iBAAiB;QACpB,OAAO;IACT;IAEA,OAAO,MAAMR,SAASE,MAAM,CAACP,uBAAuB,CAClD;QAAEa;QAAiBF;QAAUC;QAAYN;IAAY,GACrDD,SAASI,OAAO;AAEpB;AAEO,eAAeP,uBAAuB,EA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IACF;IAEA,MAAM,IAAIrB,MACR,CAAC,8CAA8C,EAAEe,gBAAgB,eAAe,EAAEnB,YAAY,sCAAsC,CAAC;AAEzI;AAGO,SAASP,sBACdO,WAAmB,EACnBmB,eAAuB;IAEvB,MAAMO,aAAaR,+BAA+BlB,aAAamB;IAE/D,IAAI;QACF,IAAIlB,SAASH,QAAQ4B;QACrB,IAAIzB,CAAAA,0BAAAA,OAAQ0B,OAAO,KAAI,MAAM;YAC3B1B,SAASA,OAAO0B,OAAO;QACzB;QAEA,IACE,OAAO1B,WAAW,YAClB,OAAOA,OAAOP,uBAAuB,KAAK,cAC1C,OAAOO,OAAOL,sBAAsB,KAAK,YACzC;YACA,MAAM,IAAIQ,MAAM,CAAC;6BACM,EAAEe,gBAAgB;;MAEzC,CAAC;QACH;QACA,OAAOlB;IACT,EAAE,OAAO2B,OAAO;QACd,IAAIA,iBAAiBC,aAAa;QAChC,sEAAsE;QACxE;QACA,MAAMD;IACR;AACF"}
@@ -33,7 +33,7 @@ class FetchClient {
33
33
  this.headers = {
34
34
  accept: 'application/json',
35
35
  'content-type': 'application/json',
36
- 'user-agent': `expo-cli/${"0.24.6"}`,
36
+ 'user-agent': `expo-cli/${"0.24.8"}`,
37
37
  authorization: 'Basic ' + _nodebuffer().Buffer.from(`${target}:`).toString('base64')
38
38
  };
39
39
  }
@@ -83,7 +83,7 @@ function createContext() {
83
83
  cpu: summarizeCpuInfo(),
84
84
  app: {
85
85
  name: 'expo/cli',
86
- version: "0.24.6"
86
+ version: "0.24.8"
87
87
  },
88
88
  ci: _ciinfo().isCI ? {
89
89
  name: _ciinfo().name,
@@ -54,8 +54,13 @@ function evaluateTsConfig(ts, tsConfigPath) {
54
54
  ]
55
55
  }, _path().default.dirname(tsConfigPath));
56
56
  if (jsonFileContents.errors) {
57
- // filter out "no inputs were found in config file" error
58
- jsonFileContents.errors = jsonFileContents.errors.filter(({ code })=>code !== 18003);
57
+ jsonFileContents.errors = jsonFileContents.errors.filter(({ code })=>{
58
+ // TS18003: filter out "no inputs were found in config file" error */
59
+ // TS6046: filter out "Argument for '--module' option must be" error
60
+ // this error can be ignored since we're only typically interested in `paths` and `baseUrl`
61
+ return code !== 18003 && code !== 6046;
62
+ })// filter out non-error diagnostics
63
+ .filter(({ category })=>category !== 1 /*DiagnosticCategory.Error = 1*/ );
59
64
  }
60
65
  if ((_jsonFileContents_errors = jsonFileContents.errors) == null ? void 0 : _jsonFileContents_errors.length) {
61
66
  throw new Error(ts.formatDiagnostic(jsonFileContents.errors[0], formatDiagnosticsHost));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/utils/tsconfig/evaluateTsConfig.ts"],"sourcesContent":["import path from 'path';\nimport resolveFrom from 'resolve-from';\n\nexport function evaluateTsConfig(ts: typeof import('typescript'), tsConfigPath: string) {\n const formatDiagnosticsHost: import('typescript').FormatDiagnosticsHost = {\n getNewLine: () => require('os').EOL,\n getCurrentDirectory: ts.sys.getCurrentDirectory,\n getCanonicalFileName: (fileName: string) => fileName,\n };\n\n try {\n const { config, error } = ts.readConfigFile(tsConfigPath, ts.sys.readFile);\n\n if (error) {\n throw new Error(ts.formatDiagnostic(error, formatDiagnosticsHost));\n }\n\n const jsonFileContents = ts.parseJsonConfigFileContent(\n config,\n {\n ...ts.sys,\n readDirectory: (_, ext) => [ext ? `file${ext[0]}` : `file.ts`],\n },\n path.dirname(tsConfigPath)\n );\n\n if (jsonFileContents.errors) {\n // filter out \"no inputs were found in config file\" error\n jsonFileContents.errors = jsonFileContents.errors.filter(({ code }) => code !== 18003);\n }\n\n if (jsonFileContents.errors?.length) {\n throw new Error(ts.formatDiagnostic(jsonFileContents.errors[0], formatDiagnosticsHost));\n }\n\n return { compilerOptions: jsonFileContents.options, raw: config.raw };\n } catch (error: any) {\n if (error?.name === 'SyntaxError') {\n throw new Error('tsconfig.json is invalid:\\n' + (error.message ?? ''));\n }\n throw error;\n }\n}\n\nexport function importTypeScriptFromProjectOptionally(\n projectRoot: string\n): typeof import('typescript') | null {\n const resolvedPath = resolveFrom.silent(projectRoot, 'typescript');\n if (!resolvedPath) {\n return null;\n }\n return require(resolvedPath);\n}\n"],"names":["evaluateTsConfig","importTypeScriptFromProjectOptionally","ts","tsConfigPath","formatDiagnosticsHost","getNewLine","require","EOL","getCurrentDirectory","sys","getCanonicalFileName","fileName","jsonFileContents","config","error","readConfigFile","readFile","Error","formatDiagnostic","parseJsonConfigFileContent","readDirectory","_","ext","path","dirname","errors","filter","code","length","compilerOptions","options","raw","name","message","projectRoot","resolvedPath","resolveFrom","silent"],"mappings":";;;;;;;;;;;IAGgBA,gBAAgB;eAAhBA;;IAyCAC,qCAAqC;eAArCA;;;;gEA5CC;;;;;;;gEACO;;;;;;;;;;;AAEjB,SAASD,iBAAiBE,EAA+B,EAAEC,YAAoB;IACpF,MAAMC,wBAAoE;QACxEC,YAAY,IAAMC,QAAQ,MAAMC,GAAG;QACnCC,qBAAqBN,GAAGO,GAAG,CAACD,mBAAmB;QAC/CE,sBAAsB,CAACC,WAAqBA;IAC9C;IAEA,IAAI;YAqBEC;QApBJ,MAAM,EAAEC,MAAM,EAAEC,KAAK,EAAE,GAAGZ,GAAGa,cAAc,CAACZ,cAAcD,GAAGO,GAAG,CAACO,QAAQ;QAEzE,IAAIF,OAAO;YACT,MAAM,IAAIG,MAAMf,GAAGgB,gBAAgB,CAACJ,OAAOV;QAC7C;QAEA,MAAMQ,mBAAmBV,GAAGiB,0BAA0B,CACpDN,QACA;YACE,GAAGX,GAAGO,GAAG;YACTW,eAAe,CAACC,GAAGC,MAAQ;oBAACA,MAAM,CAAC,IAAI,EAAEA,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,OAAO,CAAC;iBAAC;QAChE,GACAC,eAAI,CAACC,OAAO,CAACrB;QAGf,IAAIS,iBAAiBa,MAAM,EAAE;YAC3B,yDAAyD;YACzDb,iBAAiBa,MAAM,GAAGb,iBAAiBa,MAAM,CAACC,MAAM,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAKA,SAAS;QAClF;QAEA,KAAIf,2BAAAA,iBAAiBa,MAAM,qBAAvBb,yBAAyBgB,MAAM,EAAE;YACnC,MAAM,IAAIX,MAAMf,GAAGgB,gBAAgB,CAACN,iBAAiBa,MAAM,CAAC,EAAE,EAAErB;QAClE;QAEA,OAAO;YAAEyB,iBAAiBjB,iBAAiBkB,OAAO;YAAEC,KAAKlB,OAAOkB,GAAG;QAAC;IACtE,EAAE,OAAOjB,OAAY;QACnB,IAAIA,CAAAA,yBAAAA,MAAOkB,IAAI,MAAK,eAAe;YACjC,MAAM,IAAIf,MAAM,gCAAiCH,CAAAA,MAAMmB,OAAO,IAAI,EAAC;QACrE;QACA,MAAMnB;IACR;AACF;AAEO,SAASb,sCACdiC,WAAmB;IAEnB,MAAMC,eAAeC,sBAAW,CAACC,MAAM,CAACH,aAAa;IACrD,IAAI,CAACC,cAAc;QACjB,OAAO;IACT;IACA,OAAO7B,QAAQ6B;AACjB"}
1
+ {"version":3,"sources":["../../../../src/utils/tsconfig/evaluateTsConfig.ts"],"sourcesContent":["import path from 'path';\nimport resolveFrom from 'resolve-from';\n\nexport function evaluateTsConfig(ts: typeof import('typescript'), tsConfigPath: string) {\n const formatDiagnosticsHost: import('typescript').FormatDiagnosticsHost = {\n getNewLine: () => require('os').EOL,\n getCurrentDirectory: ts.sys.getCurrentDirectory,\n getCanonicalFileName: (fileName: string) => fileName,\n };\n\n try {\n const { config, error } = ts.readConfigFile(tsConfigPath, ts.sys.readFile);\n\n if (error) {\n throw new Error(ts.formatDiagnostic(error, formatDiagnosticsHost));\n }\n\n const jsonFileContents = ts.parseJsonConfigFileContent(\n config,\n {\n ...ts.sys,\n readDirectory: (_, ext) => [ext ? `file${ext[0]}` : `file.ts`],\n },\n path.dirname(tsConfigPath)\n );\n\n if (jsonFileContents.errors) {\n jsonFileContents.errors = jsonFileContents.errors\n .filter(({ code }) => {\n // TS18003: filter out \"no inputs were found in config file\" error */\n // TS6046: filter out \"Argument for '--module' option must be\" error\n // this error can be ignored since we're only typically interested in `paths` and `baseUrl`\n return code !== 18003 && code !== 6046;\n })\n // filter out non-error diagnostics\n .filter(({ category }) => category !== 1 /*DiagnosticCategory.Error = 1*/);\n }\n\n if (jsonFileContents.errors?.length) {\n throw new Error(ts.formatDiagnostic(jsonFileContents.errors[0], formatDiagnosticsHost));\n }\n\n return { compilerOptions: jsonFileContents.options, raw: config.raw };\n } catch (error: any) {\n if (error?.name === 'SyntaxError') {\n throw new Error('tsconfig.json is invalid:\\n' + (error.message ?? ''));\n }\n throw error;\n }\n}\n\nexport function importTypeScriptFromProjectOptionally(\n projectRoot: string\n): typeof import('typescript') | null {\n const resolvedPath = resolveFrom.silent(projectRoot, 'typescript');\n if (!resolvedPath) {\n return null;\n }\n return require(resolvedPath);\n}\n"],"names":["evaluateTsConfig","importTypeScriptFromProjectOptionally","ts","tsConfigPath","formatDiagnosticsHost","getNewLine","require","EOL","getCurrentDirectory","sys","getCanonicalFileName","fileName","jsonFileContents","config","error","readConfigFile","readFile","Error","formatDiagnostic","parseJsonConfigFileContent","readDirectory","_","ext","path","dirname","errors","filter","code","category","length","compilerOptions","options","raw","name","message","projectRoot","resolvedPath","resolveFrom","silent"],"mappings":";;;;;;;;;;;IAGgBA,gBAAgB;eAAhBA;;IAgDAC,qCAAqC;eAArCA;;;;gEAnDC;;;;;;;gEACO;;;;;;;;;;;AAEjB,SAASD,iBAAiBE,EAA+B,EAAEC,YAAoB;IACpF,MAAMC,wBAAoE;QACxEC,YAAY,IAAMC,QAAQ,MAAMC,GAAG;QACnCC,qBAAqBN,GAAGO,GAAG,CAACD,mBAAmB;QAC/CE,sBAAsB,CAACC,WAAqBA;IAC9C;IAEA,IAAI;YA4BEC;QA3BJ,MAAM,EAAEC,MAAM,EAAEC,KAAK,EAAE,GAAGZ,GAAGa,cAAc,CAACZ,cAAcD,GAAGO,GAAG,CAACO,QAAQ;QAEzE,IAAIF,OAAO;YACT,MAAM,IAAIG,MAAMf,GAAGgB,gBAAgB,CAACJ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",
4
4
  "description": "The Expo CLI",
5
5
  "main": "build/bin/cli",
6
6
  "bin": {
@@ -42,17 +42,17 @@
42
42
  "@0no-co/graphql.web": "^1.0.8",
43
43
  "@babel/runtime": "^7.20.0",
44
44
  "@expo/code-signing-certificates": "^0.0.5",
45
- "@expo/config": "~11.0.5",
46
- "@expo/config-plugins": "~9.1.7",
45
+ "@expo/config": "~11.0.6",
46
+ "@expo/config-plugins": "~10.0.0",
47
47
  "@expo/devcert": "^1.1.2",
48
48
  "@expo/env": "~1.0.4",
49
49
  "@expo/image-utils": "^0.7.3",
50
50
  "@expo/json-file": "^9.1.3",
51
- "@expo/metro-config": "~0.20.8",
51
+ "@expo/metro-config": "~0.20.10",
52
52
  "@expo/osascript": "^2.2.3",
53
53
  "@expo/package-manager": "^1.8.3",
54
54
  "@expo/plist": "^0.3.3",
55
- "@expo/prebuild-config": "^9.0.2",
55
+ "@expo/prebuild-config": "^9.0.3",
56
56
  "@expo/spawn-async": "^1.7.2",
57
57
  "@expo/ws-tunnel": "^1.0.1",
58
58
  "@expo/xcpretty": "^4.3.0",
@@ -152,5 +152,5 @@
152
152
  "tree-kill": "^1.2.2",
153
153
  "tsd": "^0.28.1"
154
154
  },
155
- "gitHead": "a639a661a5329e58f916cf69b8f1a7718bbdd26e"
155
+ "gitHead": "bb2cf89d99a9d7f70b07419cc36cdf80c2764217"
156
156
  }
@@ -1,80 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- resolveRemoteBuildCache: function() {
13
- return resolveRemoteBuildCache;
14
- },
15
- uploadRemoteBuildCache: function() {
16
- return uploadRemoteBuildCache;
17
- }
18
- });
19
- const _eas = require("../utils/remote-build-cache-providers/eas");
20
- const debug = require('debug')('expo:run:remote-build');
21
- async function resolveRemoteBuildCache(projectRoot, { platform, provider, runOptions }) {
22
- const fingerprintHash = await calculateFingerprintHashAsync(projectRoot, platform, provider);
23
- if (!fingerprintHash) {
24
- return null;
25
- }
26
- if (provider === 'eas') {
27
- return await (0, _eas.resolveEASRemoteBuildCache)({
28
- platform,
29
- fingerprintHash,
30
- projectRoot,
31
- runOptions
32
- });
33
- }
34
- return null;
35
- }
36
- async function uploadRemoteBuildCache(projectRoot, { platform, provider, buildPath }) {
37
- const fingerprintHash = await calculateFingerprintHashAsync(projectRoot, platform, provider);
38
- if (!fingerprintHash) {
39
- return;
40
- }
41
- if (provider === 'eas') {
42
- await (0, _eas.uploadEASRemoteBuildCache)({
43
- projectRoot,
44
- platform,
45
- fingerprintHash,
46
- buildPath
47
- });
48
- }
49
- }
50
- async function calculateFingerprintHashAsync(projectRoot, platform, provider) {
51
- if (provider === 'eas') {
52
- const easFingerprintHash = await (0, _eas.calculateEASFingerprintHashAsync)({
53
- projectRoot,
54
- platform
55
- });
56
- if (easFingerprintHash) {
57
- return easFingerprintHash;
58
- }
59
- }
60
- const Fingerprint = importFingerprintForDev(projectRoot);
61
- if (!Fingerprint) {
62
- debug('@expo/fingerprint is not installed in the project, skip checking for remote builds');
63
- return null;
64
- }
65
- const fingerprint = await Fingerprint.createFingerprintAsync(projectRoot);
66
- return fingerprint.hash;
67
- }
68
- function importFingerprintForDev(projectRoot) {
69
- try {
70
- return require(require.resolve('@expo/fingerprint', {
71
- paths: [
72
- projectRoot
73
- ]
74
- }));
75
- } catch {
76
- return null;
77
- }
78
- }
79
-
80
- //# sourceMappingURL=remoteBuildCache.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/run/remoteBuildCache.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config';\nimport { ModPlatform } from '@expo/config-plugins';\n\nimport { type Options as AndroidRunOptions } from './android/resolveOptions';\nimport { type Options as IosRunOptions } from './ios/XcodeBuild.types';\nimport {\n calculateEASFingerprintHashAsync,\n resolveEASRemoteBuildCache,\n uploadEASRemoteBuildCache,\n} from '../utils/remote-build-cache-providers/eas';\nconst debug = require('debug')('expo:run:remote-build') as typeof console.log;\n\nexport async function resolveRemoteBuildCache(\n projectRoot: string,\n {\n platform,\n provider,\n runOptions,\n }: {\n platform: ModPlatform;\n provider?: Required<Required<ExpoConfig>['experiments']>['remoteBuildCache']['provider'];\n runOptions: AndroidRunOptions | IosRunOptions;\n }\n): Promise<string | null> {\n const fingerprintHash = await calculateFingerprintHashAsync(projectRoot, platform, provider);\n if (!fingerprintHash) {\n return null;\n }\n\n if (provider === 'eas') {\n return await resolveEASRemoteBuildCache({ platform, fingerprintHash, projectRoot, runOptions });\n }\n\n return null;\n}\n\nexport async function uploadRemoteBuildCache(\n projectRoot: string,\n {\n platform,\n provider,\n buildPath,\n }: {\n platform: ModPlatform;\n provider?: Required<Required<ExpoConfig>['experiments']>['remoteBuildCache']['provider'];\n buildPath?: string;\n }\n): Promise<void> {\n const fingerprintHash = await calculateFingerprintHashAsync(projectRoot, platform, provider);\n if (!fingerprintHash) {\n return;\n }\n\n if (provider === 'eas') {\n await uploadEASRemoteBuildCache({\n projectRoot,\n platform,\n fingerprintHash,\n buildPath,\n });\n }\n}\n\nasync function calculateFingerprintHashAsync(\n projectRoot: string,\n platform: ModPlatform,\n provider?: Required<Required<ExpoConfig>['experiments']>['remoteBuildCache']['provider']\n): Promise<string | null> {\n if (provider === 'eas') {\n const easFingerprintHash = await calculateEASFingerprintHashAsync({ projectRoot, platform });\n if (easFingerprintHash) {\n return easFingerprintHash;\n }\n }\n\n const Fingerprint = importFingerprintForDev(projectRoot);\n if (!Fingerprint) {\n debug('@expo/fingerprint is not installed in the project, skip checking for remote builds');\n return null;\n }\n const fingerprint = await Fingerprint.createFingerprintAsync(projectRoot);\n\n return fingerprint.hash;\n}\n\nfunction importFingerprintForDev(projectRoot: string): null | typeof import('@expo/fingerprint') {\n try {\n return require(require.resolve('@expo/fingerprint', { paths: [projectRoot] }));\n } catch {\n return null;\n }\n}\n"],"names":["resolveRemoteBuildCache","uploadRemoteBuildCache","debug","require","projectRoot","platform","provider","runOptions","fingerprintHash","calculateFingerprintHashAsync","resolveEASRemoteBuildCache","buildPath","uploadEASRemoteBuildCache","easFingerprintHash","calculateEASFingerprintHashAsync","Fingerprint","importFingerprintForDev","fingerprint","createFingerprintAsync","hash","resolve","paths"],"mappings":";;;;;;;;;;;IAYsBA,uBAAuB;eAAvBA;;IAwBAC,sBAAsB;eAAtBA;;;qBA3Bf;AACP,MAAMC,QAAQC,QAAQ,SAAS;AAExB,eAAeH,wBACpBI,WAAmB,EACnB,EACEC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EAKX;IAED,MAAMC,kBAAkB,MAAMC,8BAA8BL,aAAaC,UAAUC;IACnF,IAAI,CAACE,iBAAiB;QACpB,OAAO;IACT;IAEA,IAAIF,aAAa,OAAO;QACtB,OAAO,MAAMI,IAAAA,+BAA0B,EAAC;YAAEL;YAAUG;YAAiBJ;YAAaG;QAAW;IAC/F;IAEA,OAAO;AACT;AAEO,eAAeN,uBACpBG,WAAmB,EACnB,EACEC,QAAQ,EACRC,QAAQ,EACRK,SAAS,EAKV;IAED,MAAMH,kBAAkB,MAAMC,8BAA8BL,aAAaC,UAAUC;IACnF,IAAI,CAACE,iBAAiB;QACpB;IACF;IAEA,IAAIF,aAAa,OAAO;QACtB,MAAMM,IAAAA,8BAAyB,EAAC;YAC9BR;YACAC;YACAG;YACAG;QACF;IACF;AACF;AAEA,eAAeF,8BACbL,WAAmB,EACnBC,QAAqB,EACrBC,QAAwF;IAExF,IAAIA,aAAa,OAAO;QACtB,MAAMO,qBAAqB,MAAMC,IAAAA,qCAAgC,EAAC;YAAEV;YAAaC;QAAS;QAC1F,IAAIQ,oBAAoB;YACtB,OAAOA;QACT;IACF;IAEA,MAAME,cAAcC,wBAAwBZ;IAC5C,IAAI,CAACW,aAAa;QAChBb,MAAM;QACN,OAAO;IACT;IACA,MAAMe,cAAc,MAAMF,YAAYG,sBAAsB,CAACd;IAE7D,OAAOa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