@expo/cli 56.1.14 → 56.1.16

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 (27) hide show
  1. package/build/bin/cli +1 -1
  2. package/build/src/api/graphql/client.js +19 -4
  3. package/build/src/api/graphql/client.js.map +1 -1
  4. package/build/src/api/graphql/mutations/TunnelMutation.js +31 -0
  5. package/build/src/api/graphql/mutations/TunnelMutation.js.map +1 -0
  6. package/build/src/events/index.js +1 -1
  7. package/build/src/prebuild/prebuildAsync.js +3 -1
  8. package/build/src/prebuild/prebuildAsync.js.map +1 -1
  9. package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js +53 -91
  10. package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js.map +1 -1
  11. package/build/src/start/platforms/ios/AppleDeviceManager.js +8 -2
  12. package/build/src/start/platforms/ios/AppleDeviceManager.js.map +1 -1
  13. package/build/src/start/platforms/ios/ensureSimulatorAppRunning.js +26 -11
  14. package/build/src/start/platforms/ios/ensureSimulatorAppRunning.js.map +1 -1
  15. package/build/src/start/server/AsyncWsTunnel.js +120 -35
  16. package/build/src/start/server/AsyncWsTunnel.js.map +1 -1
  17. package/build/src/start/server/BundlerDevServer.js +12 -2
  18. package/build/src/start/server/BundlerDevServer.js.map +1 -1
  19. package/build/src/start/server/metro/MetroTerminalReporter.js +2 -1
  20. package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
  21. package/build/src/start/server/metro/serializeHtml.js +11 -2
  22. package/build/src/start/server/metro/serializeHtml.js.map +1 -1
  23. package/build/src/utils/env.js +3 -0
  24. package/build/src/utils/env.js.map +1 -1
  25. package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
  26. package/build/src/utils/telemetry/utils/context.js +1 -1
  27. package/package.json +13 -13
package/build/bin/cli CHANGED
@@ -139,7 +139,7 @@ const args = (0, _arg().default)({
139
139
  });
140
140
  if (args['--version']) {
141
141
  // Version is added in the build script.
142
- console.log("56.1.14");
142
+ console.log("56.1.16");
143
143
  process.exit(0);
144
144
  }
145
145
  if (args['--non-interactive']) {
@@ -18,6 +18,9 @@ _export(exports, {
18
18
  get graphql () {
19
19
  return graphql;
20
20
  },
21
+ get mutate () {
22
+ return mutate;
23
+ },
21
24
  get query () {
22
25
  return query;
23
26
  }
@@ -73,7 +76,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
73
76
  function graphql(query) {
74
77
  return query.trim();
75
78
  }
76
- const query = (()=>{
79
+ const { query, mutate } = (()=>{
77
80
  const url = (0, _endpoint.getExpoApiBaseUrl)() + '/graphql';
78
81
  let _fetch1;
79
82
  const wrappedFetch = (...args)=>{
@@ -110,7 +113,8 @@ const query = (()=>{
110
113
  function resetCache() {
111
114
  cache = {};
112
115
  }
113
- return async function query(query, variables, options) {
116
+ async function request(query, variables, options, // Mutations must never be served from (or written to) the in-memory cache.
117
+ useCache) {
114
118
  let isTransient = false;
115
119
  let response;
116
120
  let data;
@@ -123,11 +127,12 @@ const query = (()=>{
123
127
  const headersKey = stringifySorted(headers);
124
128
  if (!cacheKey || cacheKey !== headersKey) {
125
129
  resetCache();
130
+ cacheKey = headersKey;
126
131
  }
127
132
  // Retrieve a cached result, if we have any via a `query => variables => Result` cache key
128
133
  const variablesKey = stringifySorted(variables);
129
134
  const queryCache = cache[query] || (cache[query] = new Map());
130
- if (queryCache.has(variablesKey)) {
135
+ if (useCache && queryCache.has(variablesKey)) {
131
136
  data = queryCache.get(variablesKey);
132
137
  }
133
138
  // Retry the query if it fails due to an unknown or transient error
@@ -179,7 +184,9 @@ const query = (()=>{
179
184
  }
180
185
  // Store the data in the cache, and only return a result if we have any values
181
186
  if (data) {
182
- queryCache.set(variablesKey, data);
187
+ if (useCache) {
188
+ queryCache.set(variablesKey, data);
189
+ }
183
190
  const keys = Object.keys(data);
184
191
  if (keys.length > 0 && keys.some((key)=>data[key] != null)) {
185
192
  return data;
@@ -198,6 +205,14 @@ const query = (()=>{
198
205
  } else {
199
206
  throw new _client.UnexpectedServerData('Unexpected server error: No returned query result');
200
207
  }
208
+ }
209
+ return {
210
+ /** Run a GraphQL query, served from the in-memory cache when possible. */ query (document, variables, options) {
211
+ return request(document, variables, options, /* useCache */ true);
212
+ },
213
+ /** Run a GraphQL mutation, always hitting the network and never touching the cache. */ mutate (document, variables, options) {
214
+ return request(document, variables, options, /* useCache */ false);
215
+ }
201
216
  };
202
217
  })();
203
218
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/api/graphql/client.ts"],"sourcesContent":["import * as Log from '../../log';\nimport { fetch, type Response } from '../../utils/fetch';\nimport { getExpoApiBaseUrl } from '../endpoint';\nimport {\n getResponseDataOrThrow,\n UnexpectedServerData,\n UnexpectedServerError,\n} from '../rest/client';\nimport type { FetchLike } from '../rest/client.types';\nimport { wrapFetchWithOffline } from '../rest/wrapFetchWithOffline';\nimport { wrapFetchWithUserAgent } from '../rest/wrapFetchWithUserAgent';\nimport { getAccessToken, getSession } from '../user/UserSettings';\n\ntype JSONObject = Record<string, unknown>;\ntype EmptyVariables = Record<string, never>;\n\nexport type StaticDocumentNode<Result extends JSONObject, Variables extends JSONObject> = string & {\n readonly __graphql: (vars: Variables) => Result;\n};\n\nexport function graphql<Result extends JSONObject, Variables extends JSONObject = EmptyVariables>(\n query: string\n): StaticDocumentNode<Result, Variables> {\n return query.trim() as StaticDocumentNode<Result, Variables>;\n}\n\nexport { UnexpectedServerError, UnexpectedServerData };\n\nexport interface QueryOptions {\n headers?: Record<string, string>;\n}\n\nexport const query = (() => {\n const url = getExpoApiBaseUrl() + '/graphql';\n\n let _fetch: FetchLike | undefined;\n const wrappedFetch: FetchLike = (...args) => {\n if (!_fetch) {\n _fetch = wrapFetchWithOffline(wrapFetchWithUserAgent(fetch));\n }\n return _fetch(...args);\n };\n\n const randomDelay = (attemptCount: number) =>\n new Promise((resolve) => {\n setTimeout(resolve, Math.min(500 + Math.random() * 1000 * attemptCount, 4_000));\n });\n\n const getFetchHeaders = (): Record<string, string> => {\n const token = getAccessToken();\n const headers: Record<string, string> = {\n 'content-type': 'application/json',\n accept: 'application/graphql-response+json, application/graphql+json, application/json',\n };\n let sessionSecret: string | undefined;\n if (token) {\n headers.authorization = `Bearer ${token}`;\n } else if ((sessionSecret = getSession()?.sessionSecret)) {\n headers['expo-session'] = sessionSecret;\n }\n return headers;\n };\n\n // NOTE(@kitten): This only sorted keys one level deep since this is sufficient for most cases\n const stringifySorted = (variables: JSONObject): string =>\n JSON.stringify(\n Object.keys(variables)\n .sort()\n .reduce((acc, key) => {\n acc[key] = variables[key];\n return acc;\n }, {} as JSONObject)\n );\n\n let cache: Record<string, Map<string, unknown>> = {};\n let cacheKey: string | undefined;\n\n function resetCache() {\n cache = {};\n }\n\n return async function query<Result extends JSONObject, Variables extends JSONObject>(\n query: StaticDocumentNode<Result, Variables>,\n variables: Variables,\n options?: QueryOptions\n ): Promise<Result> {\n let isTransient = false;\n let response: Response | undefined;\n let data: Result | null | undefined;\n let error: unknown;\n\n // Pre-instantiate headers and reset the cache if they've changed\n const headers = { ...getFetchHeaders(), ...options?.headers };\n const headersKey = stringifySorted(headers);\n if (!cacheKey || cacheKey !== headersKey) {\n resetCache();\n }\n\n // Retrieve a cached result, if we have any via a `query => variables => Result` cache key\n const variablesKey = stringifySorted(variables);\n const queryCache = cache[query] || (cache[query] = new Map());\n if (queryCache.has(variablesKey)) {\n data = queryCache.get(variablesKey) as Result;\n }\n\n // Retry the query if it fails due to an unknown or transient error\n for (let attemptCount = 0; attemptCount < 3 && !data; attemptCount++) {\n // Add a random delay on each subsequent attempt\n if (attemptCount > 0) {\n await randomDelay(attemptCount);\n }\n\n try {\n response = await wrappedFetch(url, {\n ...options,\n method: 'POST',\n body: JSON.stringify({ query, variables }),\n headers,\n });\n } catch (networkError) {\n error = networkError || error;\n continue;\n }\n\n const json = await response.json();\n if (typeof json === 'object' && json) {\n // If we have a transient error, we retry immediately and discard the data\n // Otherwise, we store the first available error and get the data\n if ('errors' in json && Array.isArray(json.errors)) {\n isTransient = json.errors.some((e: any) => e?.extensions?.isTransient);\n if (isTransient) {\n data = undefined;\n continue;\n } else {\n error = json.errors[0] || error;\n }\n }\n\n try {\n data = getResponseDataOrThrow<Result | null>(json);\n } catch (dataError) {\n // We only use the data error, if we don't have an error already\n if (!error) {\n error = dataError || error;\n }\n continue;\n }\n }\n }\n\n // Store the data in the cache, and only return a result if we have any values\n if (data) {\n queryCache.set(variablesKey, data);\n const keys = Object.keys(data);\n if (keys.length > 0 && keys.some((key) => data[key as keyof typeof data] != null)) {\n return data;\n }\n }\n\n // If we have an error, rethrow it wrapped in our custom errors\n if (error) {\n if (isTransient) {\n Log.error(`We've encountered a transient error, please try again shortly.`);\n }\n const wrappedError = new UnexpectedServerError('' + (error as any).message);\n wrappedError.cause = error;\n throw wrappedError;\n } else if (response && !response.ok) {\n throw new UnexpectedServerError(`Unexpected server error: ${response.statusText}`);\n } else {\n throw new UnexpectedServerData('Unexpected server error: No returned query result');\n }\n };\n})();\n"],"names":["UnexpectedServerData","UnexpectedServerError","graphql","query","trim","url","getExpoApiBaseUrl","_fetch","wrappedFetch","args","wrapFetchWithOffline","wrapFetchWithUserAgent","fetch","randomDelay","attemptCount","Promise","resolve","setTimeout","Math","min","random","getFetchHeaders","getSession","token","getAccessToken","headers","accept","sessionSecret","authorization","stringifySorted","variables","JSON","stringify","Object","keys","sort","reduce","acc","key","cache","cacheKey","resetCache","options","isTransient","response","data","error","headersKey","variablesKey","queryCache","Map","has","get","method","body","networkError","json","Array","isArray","errors","some","e","extensions","undefined","getResponseDataOrThrow","dataError","set","length","Log","wrappedError","message","cause","ok","statusText"],"mappings":";;;;;;;;;;;QA0BgCA;eAAAA,4BAAoB;;QAA3CC;eAAAA,6BAAqB;;QANdC;eAAAA;;QAYHC;eAAAA;;;6DAhCQ;uBACgB;0BACH;wBAK3B;sCAE8B;wCACE;8BACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASpC,SAASD,QACdC,KAAa;IAEb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I,CAACnB,OAAO;wBACVA,QAAQmB,aAAanB;oBACvB;oBACA;gBACF;YACF;QACF;QAEA,8EAA8E;QAC9E,IAAID,MAAM;YACRI,WAAWiB,GAAG,CAAClB,cAAcH;YAC7B,MAAMX,OAAOD,OAAOC,IAAI,CAACW;YACzB,IAAIX,KAAKiC,MAAM,GAAG,KAAKjC,KAAK0B,IAAI,CAAC,CAACtB,MAAQO,IAAI,CAACP,IAAyB,IAAI,OAAO;gBACjF,OAAOO;YACT;QACF;QAEA,+DAA+D;QAC/D,IAAIC,OAAO;YACT,IAAIH,aAAa;gBACfyB,KAAItB,KAAK,CAAC,CAAC,8DAA8D,CAAC;YAC5E;YACA,MAAMuB,eAAe,IAAIpE,6BAAqB,CAAC,KAAK,AAAC6C,MAAcwB,OAAO;YAC1ED,aAAaE,KAAK,GAAGzB;YACrB,MAAMuB;QACR,OAAO,IAAIzB,YAAY,CAACA,SAAS4B,EAAE,EAAE;YACnC,MAAM,IAAIvE,6BAAqB,CAAC,CAAC,yBAAyB,EAAE2C,SAAS6B,UAAU,EAAE;QACnF,OAAO;YACL,MAAM,IAAIzE,4BAAoB,CAAC;QACjC;IACF;AACF,CAAA"}
1
+ {"version":3,"sources":["../../../../src/api/graphql/client.ts"],"sourcesContent":["import * as Log from '../../log';\nimport { fetch, type Response } from '../../utils/fetch';\nimport { getExpoApiBaseUrl } from '../endpoint';\nimport {\n getResponseDataOrThrow,\n UnexpectedServerData,\n UnexpectedServerError,\n} from '../rest/client';\nimport type { FetchLike } from '../rest/client.types';\nimport { wrapFetchWithOffline } from '../rest/wrapFetchWithOffline';\nimport { wrapFetchWithUserAgent } from '../rest/wrapFetchWithUserAgent';\nimport { getAccessToken, getSession } from '../user/UserSettings';\n\ntype JSONObject = Record<string, unknown>;\ntype EmptyVariables = Record<string, never>;\n\nexport type StaticDocumentNode<Result extends JSONObject, Variables extends JSONObject> = string & {\n readonly __graphql: (vars: Variables) => Result;\n};\n\nexport function graphql<Result extends JSONObject, Variables extends JSONObject = EmptyVariables>(\n query: string\n): StaticDocumentNode<Result, Variables> {\n return query.trim() as StaticDocumentNode<Result, Variables>;\n}\n\nexport { UnexpectedServerError, UnexpectedServerData };\n\nexport interface QueryOptions {\n headers?: Record<string, string>;\n}\n\nexport const { query, mutate } = (() => {\n const url = getExpoApiBaseUrl() + '/graphql';\n\n let _fetch: FetchLike | undefined;\n const wrappedFetch: FetchLike = (...args) => {\n if (!_fetch) {\n _fetch = wrapFetchWithOffline(wrapFetchWithUserAgent(fetch));\n }\n return _fetch(...args);\n };\n\n const randomDelay = (attemptCount: number) =>\n new Promise((resolve) => {\n setTimeout(resolve, Math.min(500 + Math.random() * 1000 * attemptCount, 4_000));\n });\n\n const getFetchHeaders = (): Record<string, string> => {\n const token = getAccessToken();\n const headers: Record<string, string> = {\n 'content-type': 'application/json',\n accept: 'application/graphql-response+json, application/graphql+json, application/json',\n };\n let sessionSecret: string | undefined;\n if (token) {\n headers.authorization = `Bearer ${token}`;\n } else if ((sessionSecret = getSession()?.sessionSecret)) {\n headers['expo-session'] = sessionSecret;\n }\n return headers;\n };\n\n // NOTE(@kitten): This only sorted keys one level deep since this is sufficient for most cases\n const stringifySorted = (variables: JSONObject): string =>\n JSON.stringify(\n Object.keys(variables)\n .sort()\n .reduce((acc, key) => {\n acc[key] = variables[key];\n return acc;\n }, {} as JSONObject)\n );\n\n let cache: Record<string, Map<string, unknown>> = {};\n let cacheKey: string | undefined;\n\n function resetCache() {\n cache = {};\n }\n\n async function request<Result extends JSONObject, Variables extends JSONObject>(\n query: StaticDocumentNode<Result, Variables>,\n variables: Variables,\n options: QueryOptions | undefined,\n // Mutations must never be served from (or written to) the in-memory cache.\n useCache: boolean\n ): Promise<Result> {\n let isTransient = false;\n let response: Response | undefined;\n let data: Result | null | undefined;\n let error: unknown;\n\n // Pre-instantiate headers and reset the cache if they've changed\n const headers = { ...getFetchHeaders(), ...options?.headers };\n const headersKey = stringifySorted(headers);\n if (!cacheKey || cacheKey !== headersKey) {\n resetCache();\n cacheKey = headersKey;\n }\n\n // Retrieve a cached result, if we have any via a `query => variables => Result` cache key\n const variablesKey = stringifySorted(variables);\n const queryCache = cache[query] || (cache[query] = new Map());\n if (useCache && queryCache.has(variablesKey)) {\n data = queryCache.get(variablesKey) as Result;\n }\n\n // Retry the query if it fails due to an unknown or transient error\n for (let attemptCount = 0; attemptCount < 3 && !data; attemptCount++) {\n // Add a random delay on each subsequent attempt\n if (attemptCount > 0) {\n await randomDelay(attemptCount);\n }\n\n try {\n response = await wrappedFetch(url, {\n ...options,\n method: 'POST',\n body: JSON.stringify({ query, variables }),\n headers,\n });\n } catch (networkError) {\n error = networkError || error;\n continue;\n }\n\n const json = await response.json();\n if (typeof json === 'object' && json) {\n // If we have a transient error, we retry immediately and discard the data\n // Otherwise, we store the first available error and get the data\n if ('errors' in json && Array.isArray(json.errors)) {\n isTransient = json.errors.some((e: any) => e?.extensions?.isTransient);\n if (isTransient) {\n data = undefined;\n continue;\n } else {\n error = json.errors[0] || error;\n }\n }\n\n try {\n data = getResponseDataOrThrow<Result | null>(json);\n } catch (dataError) {\n // We only use the data error, if we don't have an error already\n if (!error) {\n error = dataError || error;\n }\n continue;\n }\n }\n }\n\n // Store the data in the cache, and only return a result if we have any values\n if (data) {\n if (useCache) {\n queryCache.set(variablesKey, data);\n }\n const keys = Object.keys(data);\n if (keys.length > 0 && keys.some((key) => data[key as keyof typeof data] != null)) {\n return data;\n }\n }\n\n // If we have an error, rethrow it wrapped in our custom errors\n if (error) {\n if (isTransient) {\n Log.error(`We've encountered a transient error, please try again shortly.`);\n }\n const wrappedError = new UnexpectedServerError('' + (error as any).message);\n wrappedError.cause = error;\n throw wrappedError;\n } else if (response && !response.ok) {\n throw new UnexpectedServerError(`Unexpected server error: ${response.statusText}`);\n } else {\n throw new UnexpectedServerData('Unexpected server error: No returned query result');\n }\n }\n\n return {\n /** Run a GraphQL query, served from the in-memory cache when possible. */\n query<Result extends JSONObject, Variables extends JSONObject>(\n document: StaticDocumentNode<Result, Variables>,\n variables: Variables,\n options?: QueryOptions\n ): Promise<Result> {\n return request(document, variables, options, /* useCache */ true);\n },\n /** Run a GraphQL mutation, always hitting the network and never touching the cache. */\n mutate<Result extends JSONObject, Variables extends JSONObject>(\n document: StaticDocumentNode<Result, Variables>,\n variables: Variables,\n options?: QueryOptions\n ): Promise<Result> {\n return request(document, variables, options, /* useCache */ false);\n },\n };\n})();\n"],"names":["UnexpectedServerData","UnexpectedServerError","graphql","mutate","query","trim","url","getExpoApiBaseUrl","_fetch","wrappedFetch","args","wrapFetchWithOffline","wrapFetchWithUserAgent","fetch","randomDelay","attemptCount","Promise","resolve","setTimeout","Math","min","random","getFetchHeaders","getSession","token","getAccessToken","headers","accept","sessionSecret","authorization","stringifySorted","variables","JSON","stringify","Object","keys","sort","reduce","acc","key","cache","cacheKey","resetCache","request","options","useCache","isTransient","response","data","error","headersKey","variablesKey","queryCache","Map","has","get","method","body","networkError","json","Array","isArray","errors","some","e","extensions","undefined","getResponseDataOrThrow","dataError","set","length","Log","wrappedError","message","cause","ok","statusText","document"],"mappings":";;;;;;;;;;;QA0BgCA;eAAAA,4BAAoB;;QAA3CC;eAAAA,6BAAqB;;QANdC;eAAAA;;QAYMC;eAAAA;;QAAPC;eAAAA;;;6DAhCM;uBACgB;0BACH;wBAK3B;sCAE8B;wCACE;8BACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASpC,SAASF,QACdE,KAAa;IAEb,OAAOA,MAAMC,IAAI;AACnB;AAQO,MAAM,EAAED,KAAK,EAAED,MAAM,EAAE,GAAG,AAAC,CAAA;IAChC,MAAMG,MAAMC,IAAAA,2BAAiB,MAAK;IAElC,IAAIC;IACJ,MAAMC,eAA0B,CAAC,GAAGC;QAClC,IAAI,CAACF,SAAQ;YACXA,UAASG,IAAAA,0CAAoB,EAACC,IAAAA,8CAAsB,EAACC,YAAK;QAC5D;QACA,OAAOL,WAAUE;IACnB;IAEA,MAAMI,cAAc,CAACC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AAK4B,IAAI,CAAC,CAACxB,MAAQS,IAAI,CAACT,IAAyB,IAAI,OAAO;gBACjF,OAAOS;YACT;QACF;QAEA,+DAA+D;QAC/D,IAAIC,OAAO;YACT,IAAIH,aAAa;gBACfyB,KAAItB,KAAK,CAAC,CAAC,8DAA8D,CAAC;YAC5E;YACA,MAAMuB,eAAe,IAAIvE,6BAAqB,CAAC,KAAK,AAACgD,MAAcwB,OAAO;YAC1ED,aAAaE,KAAK,GAAGzB;YACrB,MAAMuB;QACR,OAAO,IAAIzB,YAAY,CAACA,SAAS4B,EAAE,EAAE;YACnC,MAAM,IAAI1E,6BAAqB,CAAC,CAAC,yBAAyB,EAAE8C,SAAS6B,UAAU,EAAE;QACnF,OAAO;YACL,MAAM,IAAI5E,4BAAoB,CAAC;QACjC;IACF;IAEA,OAAO;QACL,wEAAwE,GACxEI,OACEyE,QAA+C,EAC/C9C,SAAoB,EACpBa,OAAsB;YAEtB,OAAOD,QAAQkC,UAAU9C,WAAWa,SAAS,YAAY,GAAG;QAC9D;QACA,qFAAqF,GACrFzC,QACE0E,QAA+C,EAC/C9C,SAAoB,EACpBa,OAAsB;YAEtB,OAAOD,QAAQkC,UAAU9C,WAAWa,SAAS,YAAY,GAAG;QAC9D;IACF;AACF,CAAA"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "TunnelMutation", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return TunnelMutation;
9
+ }
10
+ });
11
+ const _client = require("../client");
12
+ const CreateSignedTunnelUrlDocument = (0, _client.graphql)(`
13
+ mutation CreateSignedTunnelUrl($accountId: ID!) {
14
+ tunnels {
15
+ createSignedTunnelUrl(accountId: $accountId) {
16
+ label
17
+ url
18
+ }
19
+ }
20
+ }
21
+ `);
22
+ const TunnelMutation = {
23
+ async createSignedTunnelUrlAsync (accountId) {
24
+ const data = await (0, _client.mutate)(CreateSignedTunnelUrlDocument, {
25
+ accountId
26
+ });
27
+ return data.tunnels.createSignedTunnelUrl;
28
+ }
29
+ };
30
+
31
+ //# sourceMappingURL=TunnelMutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/api/graphql/mutations/TunnelMutation.ts"],"sourcesContent":["import { graphql, mutate } from '../client';\n\nexport type SignedTunnelUrl = {\n /** The unique tunnel label, used as the hostname segment of the tunnel URL. */\n label: string;\n /** The signed tunnel URL `@expo/ws-tunnel` connects to. */\n url: string;\n};\n\ntype CreateSignedTunnelUrlData = {\n tunnels: {\n createSignedTunnelUrl: SignedTunnelUrl;\n };\n};\n\ntype CreateSignedTunnelUrlVariables = {\n accountId: string;\n};\n\nconst CreateSignedTunnelUrlDocument = graphql<\n CreateSignedTunnelUrlData,\n CreateSignedTunnelUrlVariables\n>(`\n mutation CreateSignedTunnelUrl($accountId: ID!) {\n tunnels {\n createSignedTunnelUrl(accountId: $accountId) {\n label\n url\n }\n }\n }\n`);\n\nexport const TunnelMutation = {\n async createSignedTunnelUrlAsync(accountId: string): Promise<SignedTunnelUrl> {\n const data = await mutate(CreateSignedTunnelUrlDocument, { accountId });\n return data.tunnels.createSignedTunnelUrl;\n },\n};\n"],"names":["TunnelMutation","CreateSignedTunnelUrlDocument","graphql","createSignedTunnelUrlAsync","accountId","data","mutate","tunnels","createSignedTunnelUrl"],"mappings":";;;;+BAiCaA;;;eAAAA;;;wBAjCmB;AAmBhC,MAAMC,gCAAgCC,IAAAA,eAAO,EAG3C,CAAC;;;;;;;;;AASH,CAAC;AAEM,MAAMF,iBAAiB;IAC5B,MAAMG,4BAA2BC,SAAiB;QAChD,MAAMC,OAAO,MAAMC,IAAAA,cAAM,EAACL,+BAA+B;YAAEG;QAAU;QACrE,OAAOC,KAAKE,OAAO,CAACC,qBAAqB;IAC3C;AACF"}
@@ -76,7 +76,7 @@ function getInitMetadata() {
76
76
  return {
77
77
  format: 'v0-jsonl',
78
78
  // Version is added in the build script.
79
- version: "56.1.14" ?? 'UNVERSIONED'
79
+ version: "56.1.16" ?? 'UNVERSIONED'
80
80
  };
81
81
  }
82
82
  function getWellKnownTemporaryLogFile(projectRoot, command) {
@@ -195,7 +195,9 @@ async function prebuildAsync(projectRoot, options) {
195
195
  const inlineModules = ((_exp_experiments = exp.experiments) == null ? void 0 : _exp_experiments.inlineModules) ?? false;
196
196
  if (inlineModules && options.platforms.includes('ios')) {
197
197
  await (0, _inlinemodules().updateXcodeProject)(projectRoot, {
198
- watchedDirectories: inlineModules.watchedDirectories ?? []
198
+ watchedDirectories: inlineModules.watchedDirectories ?? [],
199
+ xcodeProjectTargets: inlineModules.xcodeProjectTargets,
200
+ name: exp.name
199
201
  });
200
202
  }
201
203
  return {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/prebuild/prebuildAsync.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config';\nimport { getConfig } from '@expo/config';\nimport type { ModPlatform } from '@expo/config-plugins';\nimport { updateXcodeProject } from '@expo/inline-modules';\nimport chalk from 'chalk';\n\nimport {\n clearNativeFolder,\n promptToClearMalformedNativeProjectsAsync,\n maybeBailOnNativeModuleAsync,\n} from './clearNativeFolder';\nimport { configureProjectAsync } from './configureProjectAsync';\nimport { ensureConfigAsync } from './ensureConfigAsync';\nimport { assertPlatforms, ensureValidPlatforms, resolveTemplateOption } from './resolveOptions';\nimport { updateFromTemplateAsync } from './updateFromTemplate';\nimport { installAsync } from '../install/installAsync';\nimport { Log } from '../log';\nimport { env } from '../utils/env';\nimport { setNodeEnv, loadEnvFiles } from '../utils/nodeEnv';\nimport { clearNodeModulesAsync } from '../utils/nodeModules';\nimport { logNewSection } from '../utils/ora';\nimport { profile } from '../utils/profile';\nimport { confirmAsync } from '../utils/prompts';\n\nconst debug = require('debug')('expo:prebuild') as typeof console.log;\n\nexport type PrebuildResults = {\n /** Expo config. */\n exp: ExpoConfig;\n /** Indicates if the process created new files. */\n hasNewProjectFiles: boolean;\n /** The platforms that were prebuilt. */\n platforms: ModPlatform[];\n /** Indicates if pod install was run. */\n podInstall: boolean;\n /** Indicates if node modules were installed. */\n nodeInstall: boolean;\n};\n\n/**\n * Entry point into the prebuild process, delegates to other helpers to perform various steps.\n *\n * 0. Attempt to clean the project folders.\n * 1. Create native projects (ios, android).\n * 2. Install node modules.\n * 3. Apply config to native projects.\n * 4. Install CocoaPods.\n */\nexport async function prebuildAsync(\n projectRoot: string,\n options: {\n /** Should install node modules and cocoapods. */\n install?: boolean;\n /** List of platforms to prebuild. */\n platforms: ModPlatform[];\n /** Should delete the native folders before attempting to prebuild. */\n clean?: boolean;\n /** URL or file path to the prebuild template. */\n template?: string;\n /** Name of the node package manager to install with. */\n packageManager?: {\n npm?: boolean;\n yarn?: boolean;\n pnpm?: boolean;\n bun?: boolean;\n };\n /** List of node modules to skip updating. */\n skipDependencyUpdate?: string[];\n }\n): Promise<PrebuildResults | null> {\n setNodeEnv('development');\n loadEnvFiles(projectRoot);\n\n const { platforms } = getConfig(projectRoot).exp;\n if (platforms?.length) {\n // Filter out platforms that aren't in the app.json.\n const finalPlatforms = options.platforms.filter((platform) => platforms.includes(platform));\n if (finalPlatforms.length > 0) {\n options.platforms = finalPlatforms;\n } else {\n const requestedPlatforms = options.platforms.join(', ');\n Log.warn(\n chalk`⚠️ Requested prebuild for \"${requestedPlatforms}\", but only \"${platforms.join(', ')}\" is present in app config (\"expo.platforms\" entry). Continuing with \"${requestedPlatforms}\".`\n );\n }\n }\n if (options.clean) {\n const { maybeBailOnGitStatusAsync } = await import('../utils/git.js');\n // Clean the project folders...\n if (await maybeBailOnGitStatusAsync()) {\n return null;\n }\n // Check if the target project is actually a native module, which we don't want to erase\n if (await maybeBailOnNativeModuleAsync(projectRoot)) {\n return null;\n }\n // Clear the native folders before syncing\n await clearNativeFolder(projectRoot, options.platforms);\n } else {\n // Check if the existing project folders are malformed.\n await promptToClearMalformedNativeProjectsAsync(projectRoot, options.platforms);\n }\n\n // Warn if the project is attempting to prebuild an unsupported platform (iOS on Windows).\n options.platforms = ensureValidPlatforms(options.platforms);\n // Assert if no platforms are left over after filtering.\n assertPlatforms(options.platforms);\n\n // Get the Expo config, create it if missing.\n const { exp, pkg } = await ensureConfigAsync(projectRoot, { platforms: options.platforms });\n\n // Create native projects from template.\n const { hasNewProjectFiles, needsPodInstall, templateChecksum, changedDependencies } =\n await updateFromTemplateAsync(projectRoot, {\n exp,\n pkg,\n template: options.template != null ? resolveTemplateOption(options.template) : undefined,\n platforms: options.platforms,\n skipDependencyUpdate: options.skipDependencyUpdate,\n });\n\n // Install node modules\n if (options.install) {\n if (changedDependencies.length) {\n if (options.packageManager?.npm) {\n await clearNodeModulesAsync(projectRoot);\n }\n\n Log.log(chalk.gray(chalk`Dependencies in the {bold package.json} changed:`));\n Log.log(chalk.gray(' ' + changedDependencies.join(', ')));\n\n // Installing dependencies is a legacy feature from the unversioned\n // command. We know opt to not change dependencies unless a template\n // indicates a new dependency is required, or if the core dependencies are wrong.\n if (\n await confirmAsync({\n message: `Install the updated dependencies?`,\n initial: true,\n })\n ) {\n await installAsync([], {\n npm: !!options.packageManager?.npm,\n yarn: !!options.packageManager?.yarn,\n pnpm: !!options.packageManager?.pnpm,\n bun: !!options.packageManager?.bun,\n silent: !(env.EXPO_DEBUG || env.CI),\n });\n }\n }\n }\n\n // Apply Expo config to native projects. Prevent log-spew from ora when running in debug mode.\n const configSyncingStep: { succeed(text?: string): unknown; fail(text?: string): unknown } =\n env.EXPO_DEBUG\n ? {\n succeed(text) {\n Log.log(text!);\n },\n fail(text) {\n Log.error(text!);\n },\n }\n : logNewSection('Running prebuild');\n try {\n await profile(configureProjectAsync)(projectRoot, {\n platforms: options.platforms,\n exp,\n templateChecksum,\n });\n configSyncingStep.succeed('Finished prebuild');\n } catch (error) {\n configSyncingStep.fail('Prebuild failed');\n throw error;\n }\n\n // Install CocoaPods\n let podsInstalled: boolean = false;\n // err towards running pod install less because it's slow and users can easily run npx pod-install afterwards.\n if (options.platforms.includes('ios') && options.install && needsPodInstall) {\n const { installCocoaPodsAsync } = await import('../utils/cocoapods.js');\n\n podsInstalled = await installCocoaPodsAsync(projectRoot);\n } else {\n debug('Skipped pod install');\n }\n const inlineModules = exp.experiments?.inlineModules ?? false;\n if (inlineModules && options.platforms.includes('ios')) {\n await updateXcodeProject(projectRoot, {\n watchedDirectories: inlineModules.watchedDirectories ?? [],\n });\n }\n\n return {\n nodeInstall: !!options.install,\n podInstall: !podsInstalled,\n platforms: options.platforms,\n hasNewProjectFiles,\n exp,\n };\n}\n"],"names":["prebuildAsync","debug","require","projectRoot","options","exp","setNodeEnv","loadEnvFiles","platforms","getConfig","length","finalPlatforms","filter","platform","includes","requestedPlatforms","join","Log","warn","chalk","clean","maybeBailOnGitStatusAsync","maybeBailOnNativeModuleAsync","clearNativeFolder","promptToClearMalformedNativeProjectsAsync","ensureValidPlatforms","assertPlatforms","pkg","ensureConfigAsync","hasNewProjectFiles","needsPodInstall","templateChecksum","changedDependencies","updateFromTemplateAsync","template","resolveTemplateOption","undefined","skipDependencyUpdate","install","packageManager","npm","clearNodeModulesAsync","log","gray","confirmAsync","message","initial","installAsync","yarn","pnpm","bun","silent","env","EXPO_DEBUG","CI","configSyncingStep","succeed","text","fail","error","logNewSection","profile","configureProjectAsync","podsInstalled","installCocoaPodsAsync","inlineModules","experiments","updateXcodeProject","watchedDirectories","nodeInstall","podInstall"],"mappings":";;;;+BAgDsBA;;;eAAAA;;;;yBA/CI;;;;;;;yBAES;;;;;;;gEACjB;;;;;;mCAMX;uCAC+B;mCACJ;gCAC2C;oCACrC;8BACX;qBACT;qBACA;yBACqB;6BACH;qBACR;yBACN;yBACK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAwBxB,eAAeF,cACpBG,WAAmB,EACnBC,OAkBC;QAqHqBC;IAnHtBC,IAAAA,mBAAU,EAAC;IACXC,IAAAA,qBAAY,EAACJ;IAEb,MAAM,EAAEK,SAAS,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G,CAACC,UAAU,IAAID,QAAG,CAACE,EAAE,AAAD;gBACnC;YACF;QACF;IACF;IAEA,8FAA8F;IAC9F,MAAMC,oBACJH,QAAG,CAACC,UAAU,GACV;QACEG,SAAQC,IAAI;YACVxC,QAAG,CAACyB,GAAG,CAACe;QACV;QACAC,MAAKD,IAAI;YACPxC,QAAG,CAAC0C,KAAK,CAACF;QACZ;IACF,IACAG,IAAAA,kBAAa,EAAC;IACpB,IAAI;QACF,MAAMC,IAAAA,gBAAO,EAACC,4CAAqB,EAAE3D,aAAa;YAChDK,WAAWJ,QAAQI,SAAS;YAC5BH;YACA0B;QACF;QACAwB,kBAAkBC,OAAO,CAAC;IAC5B,EAAE,OAAOG,OAAO;QACdJ,kBAAkBG,IAAI,CAAC;QACvB,MAAMC;IACR;IAEA,oBAAoB;IACpB,IAAII,gBAAyB;IAC7B,8GAA8G;IAC9G,IAAI3D,QAAQI,SAAS,CAACM,QAAQ,CAAC,UAAUV,QAAQkC,OAAO,IAAIR,iBAAiB;QAC3E,MAAM,EAAEkC,qBAAqB,EAAE,GAAG,MAAM,mEAAA,QAAO;QAE/CD,gBAAgB,MAAMC,sBAAsB7D;IAC9C,OAAO;QACLF,MAAM;IACR;IACA,MAAMgE,gBAAgB5D,EAAAA,mBAAAA,IAAI6D,WAAW,qBAAf7D,iBAAiB4D,aAAa,KAAI;IACxD,IAAIA,iBAAiB7D,QAAQI,SAAS,CAACM,QAAQ,CAAC,QAAQ;QACtD,MAAMqD,IAAAA,mCAAkB,EAAChE,aAAa;YACpCiE,oBAAoBH,cAAcG,kBAAkB,IAAI,EAAE;QAC5D;IACF;IAEA,OAAO;QACLC,aAAa,CAAC,CAACjE,QAAQkC,OAAO;QAC9BgC,YAAY,CAACP;QACbvD,WAAWJ,QAAQI,SAAS;QAC5BqB;QACAxB;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/prebuild/prebuildAsync.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config';\nimport { getConfig } from '@expo/config';\nimport type { ModPlatform } from '@expo/config-plugins';\nimport { updateXcodeProject } from '@expo/inline-modules';\nimport chalk from 'chalk';\n\nimport {\n clearNativeFolder,\n promptToClearMalformedNativeProjectsAsync,\n maybeBailOnNativeModuleAsync,\n} from './clearNativeFolder';\nimport { configureProjectAsync } from './configureProjectAsync';\nimport { ensureConfigAsync } from './ensureConfigAsync';\nimport { assertPlatforms, ensureValidPlatforms, resolveTemplateOption } from './resolveOptions';\nimport { updateFromTemplateAsync } from './updateFromTemplate';\nimport { installAsync } from '../install/installAsync';\nimport { Log } from '../log';\nimport { env } from '../utils/env';\nimport { setNodeEnv, loadEnvFiles } from '../utils/nodeEnv';\nimport { clearNodeModulesAsync } from '../utils/nodeModules';\nimport { logNewSection } from '../utils/ora';\nimport { profile } from '../utils/profile';\nimport { confirmAsync } from '../utils/prompts';\n\nconst debug = require('debug')('expo:prebuild') as typeof console.log;\n\nexport type PrebuildResults = {\n /** Expo config. */\n exp: ExpoConfig;\n /** Indicates if the process created new files. */\n hasNewProjectFiles: boolean;\n /** The platforms that were prebuilt. */\n platforms: ModPlatform[];\n /** Indicates if pod install was run. */\n podInstall: boolean;\n /** Indicates if node modules were installed. */\n nodeInstall: boolean;\n};\n\n/**\n * Entry point into the prebuild process, delegates to other helpers to perform various steps.\n *\n * 0. Attempt to clean the project folders.\n * 1. Create native projects (ios, android).\n * 2. Install node modules.\n * 3. Apply config to native projects.\n * 4. Install CocoaPods.\n */\nexport async function prebuildAsync(\n projectRoot: string,\n options: {\n /** Should install node modules and cocoapods. */\n install?: boolean;\n /** List of platforms to prebuild. */\n platforms: ModPlatform[];\n /** Should delete the native folders before attempting to prebuild. */\n clean?: boolean;\n /** URL or file path to the prebuild template. */\n template?: string;\n /** Name of the node package manager to install with. */\n packageManager?: {\n npm?: boolean;\n yarn?: boolean;\n pnpm?: boolean;\n bun?: boolean;\n };\n /** List of node modules to skip updating. */\n skipDependencyUpdate?: string[];\n }\n): Promise<PrebuildResults | null> {\n setNodeEnv('development');\n loadEnvFiles(projectRoot);\n\n const { platforms } = getConfig(projectRoot).exp;\n if (platforms?.length) {\n // Filter out platforms that aren't in the app.json.\n const finalPlatforms = options.platforms.filter((platform) => platforms.includes(platform));\n if (finalPlatforms.length > 0) {\n options.platforms = finalPlatforms;\n } else {\n const requestedPlatforms = options.platforms.join(', ');\n Log.warn(\n chalk`⚠️ Requested prebuild for \"${requestedPlatforms}\", but only \"${platforms.join(', ')}\" is present in app config (\"expo.platforms\" entry). Continuing with \"${requestedPlatforms}\".`\n );\n }\n }\n if (options.clean) {\n const { maybeBailOnGitStatusAsync } = await import('../utils/git.js');\n // Clean the project folders...\n if (await maybeBailOnGitStatusAsync()) {\n return null;\n }\n // Check if the target project is actually a native module, which we don't want to erase\n if (await maybeBailOnNativeModuleAsync(projectRoot)) {\n return null;\n }\n // Clear the native folders before syncing\n await clearNativeFolder(projectRoot, options.platforms);\n } else {\n // Check if the existing project folders are malformed.\n await promptToClearMalformedNativeProjectsAsync(projectRoot, options.platforms);\n }\n\n // Warn if the project is attempting to prebuild an unsupported platform (iOS on Windows).\n options.platforms = ensureValidPlatforms(options.platforms);\n // Assert if no platforms are left over after filtering.\n assertPlatforms(options.platforms);\n\n // Get the Expo config, create it if missing.\n const { exp, pkg } = await ensureConfigAsync(projectRoot, { platforms: options.platforms });\n\n // Create native projects from template.\n const { hasNewProjectFiles, needsPodInstall, templateChecksum, changedDependencies } =\n await updateFromTemplateAsync(projectRoot, {\n exp,\n pkg,\n template: options.template != null ? resolveTemplateOption(options.template) : undefined,\n platforms: options.platforms,\n skipDependencyUpdate: options.skipDependencyUpdate,\n });\n\n // Install node modules\n if (options.install) {\n if (changedDependencies.length) {\n if (options.packageManager?.npm) {\n await clearNodeModulesAsync(projectRoot);\n }\n\n Log.log(chalk.gray(chalk`Dependencies in the {bold package.json} changed:`));\n Log.log(chalk.gray(' ' + changedDependencies.join(', ')));\n\n // Installing dependencies is a legacy feature from the unversioned\n // command. We know opt to not change dependencies unless a template\n // indicates a new dependency is required, or if the core dependencies are wrong.\n if (\n await confirmAsync({\n message: `Install the updated dependencies?`,\n initial: true,\n })\n ) {\n await installAsync([], {\n npm: !!options.packageManager?.npm,\n yarn: !!options.packageManager?.yarn,\n pnpm: !!options.packageManager?.pnpm,\n bun: !!options.packageManager?.bun,\n silent: !(env.EXPO_DEBUG || env.CI),\n });\n }\n }\n }\n\n // Apply Expo config to native projects. Prevent log-spew from ora when running in debug mode.\n const configSyncingStep: { succeed(text?: string): unknown; fail(text?: string): unknown } =\n env.EXPO_DEBUG\n ? {\n succeed(text) {\n Log.log(text!);\n },\n fail(text) {\n Log.error(text!);\n },\n }\n : logNewSection('Running prebuild');\n try {\n await profile(configureProjectAsync)(projectRoot, {\n platforms: options.platforms,\n exp,\n templateChecksum,\n });\n configSyncingStep.succeed('Finished prebuild');\n } catch (error) {\n configSyncingStep.fail('Prebuild failed');\n throw error;\n }\n\n // Install CocoaPods\n let podsInstalled: boolean = false;\n // err towards running pod install less because it's slow and users can easily run npx pod-install afterwards.\n if (options.platforms.includes('ios') && options.install && needsPodInstall) {\n const { installCocoaPodsAsync } = await import('../utils/cocoapods.js');\n\n podsInstalled = await installCocoaPodsAsync(projectRoot);\n } else {\n debug('Skipped pod install');\n }\n const inlineModules = exp.experiments?.inlineModules ?? false;\n if (inlineModules && options.platforms.includes('ios')) {\n await updateXcodeProject(projectRoot, {\n watchedDirectories: inlineModules.watchedDirectories ?? [],\n xcodeProjectTargets: inlineModules.xcodeProjectTargets,\n name: exp.name,\n });\n }\n\n return {\n nodeInstall: !!options.install,\n podInstall: !podsInstalled,\n platforms: options.platforms,\n hasNewProjectFiles,\n exp,\n };\n}\n"],"names":["prebuildAsync","debug","require","projectRoot","options","exp","setNodeEnv","loadEnvFiles","platforms","getConfig","length","finalPlatforms","filter","platform","includes","requestedPlatforms","join","Log","warn","chalk","clean","maybeBailOnGitStatusAsync","maybeBailOnNativeModuleAsync","clearNativeFolder","promptToClearMalformedNativeProjectsAsync","ensureValidPlatforms","assertPlatforms","pkg","ensureConfigAsync","hasNewProjectFiles","needsPodInstall","templateChecksum","changedDependencies","updateFromTemplateAsync","template","resolveTemplateOption","undefined","skipDependencyUpdate","install","packageManager","npm","clearNodeModulesAsync","log","gray","confirmAsync","message","initial","installAsync","yarn","pnpm","bun","silent","env","EXPO_DEBUG","CI","configSyncingStep","succeed","text","fail","error","logNewSection","profile","configureProjectAsync","podsInstalled","installCocoaPodsAsync","inlineModules","experiments","updateXcodeProject","watchedDirectories","xcodeProjectTargets","name","nodeInstall","podInstall"],"mappings":";;;;+BAgDsBA;;;eAAAA;;;;yBA/CI;;;;;;;yBAES;;;;;;;gEACjB;;;;;;mCAMX;uCAC+B;mCACJ;gCAC2C;oCACrC;8BACX;qBACT;qBACA;yBACqB;6BACH;qBACR;yBACN;yBACK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAwBxB,eAAeF,cACpBG,WAAmB,EACnBC,OAkBC;QAqHqBC;IAnHtBC,IAAAA,mBAAU,EAAC;IACXC,IAAAA,qBAAY,EAACJ;IAEb,MAAM,EAAEK,SAAS,EAAE,GAAGC,IAAAA,mBAAS,EAACN,aAAaE,GAAG;IAChD,IAAIG,6BAAAA,UAAWE,MAAM,EAAE;QACrB,oDAAoD;QACpD,MAAMC,iBAAiBP,QAAQI,SAAS,CAACI,MAAM,CAAC,CAACC,WAAaL,UAAUM,QAAQ,CAACD;QACjF,IAAIF,eAAeD,MAAM,GAAG,GAAG;YAC7BN,QAAQI,SAAS,GAAGG;QACtB,OAAO;YACL,MAAMI,qBAAqBX,QAAQI,SAAS,CAACQ,IAAI,CAAC;YAClDC,QAAG,CAACC,IAAI,CACNC,IAAAA,gBAAK,CAAA,CAAC,4BAA4B,EAAEJ,mBAAmB,aAAa,EAAEP,UAAUQ,IAAI,CAAC,MAAM,sEAAsE,EAAED,mBAAmB,EAAE,CAAC;QAE7L;IACF;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EA,oBAAoB;IACpB,IAAII,gBAAyB;IAC7B,8GAA8G;IAC9G,IAAI3D,QAAQI,SAAS,CAACM,QAAQ,CAAC,UAAUV,QAAQkC,OAAO,IAAIR,iBAAiB;QAC3E,MAAM,EAAEkC,qBAAqB,EAAE,GAAG,MAAM,mEAAA,QAAO;QAE/CD,gBAAgB,MAAMC,sBAAsB7D;IAC9C,OAAO;QACLF,MAAM;IACR;IACA,MAAMgE,gBAAgB5D,EAAAA,mBAAAA,IAAI6D,WAAW,qBAAf7D,iBAAiB4D,aAAa,KAAI;IACxD,IAAIA,iBAAiB7D,QAAQI,SAAS,CAACM,QAAQ,CAAC,QAAQ;QACtD,MAAMqD,IAAAA,mCAAkB,EAAChE,aAAa;YACpCiE,oBAAoBH,cAAcG,kBAAkB,IAAI,EAAE;YAC1DC,qBAAqBJ,cAAcI,mBAAmB;YACtDC,MAAMjE,IAAIiE,IAAI;QAChB;IACF;IAEA,OAAO;QACLC,aAAa,CAAC,CAACnE,QAAQkC,OAAO;QAC9BkC,YAAY,CAACT;QACbvD,WAAWJ,QAAQI,SAAS;QAC5BqB;QACAxB;IACF;AACF"}
@@ -22,112 +22,49 @@ function _spawnasync() {
22
22
  };
23
23
  return data;
24
24
  }
25
- function _path() {
26
- const data = /*#__PURE__*/ _interop_require_default(require("path"));
27
- _path = function() {
25
+ function _nodepath() {
26
+ const data = /*#__PURE__*/ _interop_require_default(require("node:path"));
27
+ _nodepath = function() {
28
28
  return data;
29
29
  };
30
30
  return data;
31
31
  }
32
- const _log = /*#__PURE__*/ _interop_require_wildcard(require("../../../log"));
32
+ const _log = require("../../../log");
33
33
  const _Prerequisite = require("../Prerequisite");
34
34
  function _interop_require_default(obj) {
35
35
  return obj && obj.__esModule ? obj : {
36
36
  default: obj
37
37
  };
38
38
  }
39
- function _getRequireWildcardCache(nodeInterop) {
40
- if (typeof WeakMap !== "function") return null;
41
- var cacheBabelInterop = new WeakMap();
42
- var cacheNodeInterop = new WeakMap();
43
- return (_getRequireWildcardCache = function(nodeInterop) {
44
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
45
- })(nodeInterop);
46
- }
47
- function _interop_require_wildcard(obj, nodeInterop) {
48
- if (!nodeInterop && obj && obj.__esModule) {
49
- return obj;
50
- }
51
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
52
- return {
53
- default: obj
54
- };
55
- }
56
- var cache = _getRequireWildcardCache(nodeInterop);
57
- if (cache && cache.has(obj)) {
58
- return cache.get(obj);
59
- }
60
- var newObj = {
61
- __proto__: null
62
- };
63
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
64
- for(var key in obj){
65
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
66
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
67
- if (desc && (desc.get || desc.set)) {
68
- Object.defineProperty(newObj, key, desc);
69
- } else {
70
- newObj[key] = obj[key];
71
- }
72
- }
73
- }
74
- newObj.default = obj;
75
- if (cache) {
76
- cache.set(obj, newObj);
77
- }
78
- return newObj;
79
- }
80
39
  const debug = require('debug')('expo:doctor:apple:simulatorApp');
81
- /**
82
- * Get the bundle ID of the Simulator.app via AppleScript / LaunchServices.
83
- * May return null if the Simulator.app is not registered in LaunchServices
84
- * (e.g. when Xcode lives on an external or renamed volume).
85
- */ async function getSimulatorAppIdViaAppleScriptAsync() {
86
- try {
87
- return (await (0, _osascript().execAsync)('id of app "Simulator"')).trim();
88
- } catch {
89
- // This error may occur in CI where the user intends to install just the simulators but no
90
- // Xcode, or when Simulator.app is not registered in LaunchServices (e.g. Xcode on an
91
- // external or renamed volume).
92
- }
93
- return null;
94
- }
95
- /**
96
- * Fallback: locate Simulator.app via the active Xcode developer directory and read its
97
- * CFBundleIdentifier directly from the app bundle's Info.plist.
98
- * This works even when LaunchServices hasn't indexed Simulator.app.
99
- */ async function getSimulatorAppIdFromBundleAsync() {
100
- try {
101
- const { stdout: developerDir } = await (0, _spawnasync().default)('xcode-select', [
102
- '--print-path'
103
- ]);
104
- const simulatorInfoPlist = _path().default.join(developerDir.trim(), 'Applications', 'Simulator.app', 'Contents', 'Info.plist');
105
- const { stdout: bundleId } = await (0, _spawnasync().default)('defaults', [
106
- 'read',
107
- simulatorInfoPlist,
108
- 'CFBundleIdentifier'
109
- ]);
110
- return bundleId.trim() || null;
111
- } catch {
112
- // Simulator.app not found at the expected path or xcode-select is unavailable.
113
- }
114
- return null;
115
- }
116
- async function getSimulatorAppIdAsync() {
117
- return await getSimulatorAppIdViaAppleScriptAsync() ?? await getSimulatorAppIdFromBundleAsync();
118
- }
40
+ // NOTE(cedric): Xcode 27 Beta moved the `<xcode>/Contents/Developer/Applications` to `<xcode>/Contents/Applications`
41
+ const XCODE_DEVICE_HUB_PATH = '../Applications/DeviceHub.app/Contents/Info.plist';
42
+ const XCODE_SIMULATOR_PATH = './Applications/Simulator.app/Contents/Info.plist';
119
43
  class SimulatorAppPrerequisite extends _Prerequisite.Prerequisite {
120
44
  static #_ = this.instance = new SimulatorAppPrerequisite();
121
45
  async assertImplementation() {
122
- const result = await getSimulatorAppIdAsync();
123
- if (!result) {
124
- // This error may occur in CI where the users intends to install just the simulators but no Xcode.
125
- throw new _Prerequisite.PrerequisiteCommandError('SIMULATOR_APP', "Can't determine id of Simulator app; the Simulator is most likely not installed on this machine. Run `sudo xcode-select -s /Applications/Xcode.app`");
46
+ // Xcode 27 replaces Simulator with DeviceHub
47
+ // See: https://developer.apple.com/documentation/xcode/device-hub
48
+ // TODO(cedric): once Xcode 27 stable is released, resolve DeviceHub first
49
+ let appId = await (0, _osascript().safeIdOfAppAsync)('Simulator').then((appId)=>{
50
+ return appId || (0, _osascript().safeIdOfAppAsync)('DeviceHub');
51
+ });
52
+ if (!appId) {
53
+ const xcodePath = await getXcodeSelectPath();
54
+ debug('Xcode select path: %s', xcodePath);
55
+ if (xcodePath) {
56
+ appId = await getXcodeInfoPlistBundleId(_nodepath().default.join(xcodePath, XCODE_SIMULATOR_PATH)).then((appId)=>{
57
+ return appId || getXcodeInfoPlistBundleId(_nodepath().default.join(xcodePath, XCODE_DEVICE_HUB_PATH));
58
+ });
59
+ }
126
60
  }
127
- if (result !== 'com.apple.iphonesimulator' && result !== 'com.apple.CoreSimulator.SimulatorTrampoline') {
128
- throw new _Prerequisite.PrerequisiteCommandError('SIMULATOR_APP', "Simulator is installed but is identified as '" + result + "'; don't know what that is.");
61
+ if (!appId) {
62
+ throw new _Prerequisite.PrerequisiteCommandError('SIMULATOR_APP', "Can't determine id of Device Hub or Simulator app; the Device Hub or Simulator is most likely not installed on this machine. Run `sudo xcode-select -s /Applications/Xcode.app`");
129
63
  }
130
- debug(`Simulator app id: ${result}`);
64
+ if (appId !== 'com.apple.dt.Devices' && appId !== 'com.apple.iphonesimulator' && appId !== 'com.apple.CoreSimulator.SimulatorTrampoline') {
65
+ throw new _Prerequisite.PrerequisiteCommandError('SIMULATOR_APP', `Device Hub or Simulator is installed but is identified as '${appId}'; don't know what that is.`);
66
+ }
67
+ debug('Xcode simulator app id: %s', appId);
131
68
  try {
132
69
  // make sure we can run simctl
133
70
  await (0, _spawnasync().default)('xcrun', [
@@ -135,10 +72,35 @@ class SimulatorAppPrerequisite extends _Prerequisite.Prerequisite {
135
72
  'help'
136
73
  ]);
137
74
  } catch (error) {
138
- _log.warn(`Unable to run simctl:\n${error.toString()}`);
75
+ _log.Log.warn(`Unable to run simctl:\n${error.toString()}`);
139
76
  throw new _Prerequisite.PrerequisiteCommandError('SIMCTL', 'xcrun is not configured correctly. Ensure `sudo xcode-select --reset` works before running this command again.');
140
77
  }
141
78
  }
142
79
  }
80
+ async function getXcodeSelectPath() {
81
+ try {
82
+ const result = await (0, _spawnasync().default)('xcode-select', [
83
+ '--print-path'
84
+ ]);
85
+ return result.stdout.trim() || null;
86
+ } catch {
87
+ return null;
88
+ }
89
+ }
90
+ /**
91
+ * Read the Info.plist of an app within Xcode and return the bundle ID.
92
+ * This uses `defaults read <path>/Info.plist CFBundleIdentifier`.
93
+ */ async function getXcodeInfoPlistBundleId(infoPlistPath) {
94
+ try {
95
+ const result = await (0, _spawnasync().default)('defaults', [
96
+ 'read',
97
+ infoPlistPath,
98
+ 'CFBundleIdentifier'
99
+ ]);
100
+ return result.stdout.trim() || null;
101
+ } catch {
102
+ return null;
103
+ }
104
+ }
143
105
 
144
106
  //# sourceMappingURL=SimulatorAppPrerequisite.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/doctor/apple/SimulatorAppPrerequisite.ts"],"sourcesContent":["import { execAsync } from '@expo/osascript';\nimport spawnAsync from '@expo/spawn-async';\nimport path from 'path';\n\nimport * as Log from '../../../log';\nimport { Prerequisite, PrerequisiteCommandError } from '../Prerequisite';\n\nconst debug = require('debug')('expo:doctor:apple:simulatorApp') as typeof console.log;\n\n/**\n * Get the bundle ID of the Simulator.app via AppleScript / LaunchServices.\n * May return null if the Simulator.app is not registered in LaunchServices\n * (e.g. when Xcode lives on an external or renamed volume).\n */\nasync function getSimulatorAppIdViaAppleScriptAsync(): Promise<string | null> {\n try {\n return (await execAsync('id of app \"Simulator\"')).trim();\n } catch {\n // This error may occur in CI where the user intends to install just the simulators but no\n // Xcode, or when Simulator.app is not registered in LaunchServices (e.g. Xcode on an\n // external or renamed volume).\n }\n return null;\n}\n\n/**\n * Fallback: locate Simulator.app via the active Xcode developer directory and read its\n * CFBundleIdentifier directly from the app bundle's Info.plist.\n * This works even when LaunchServices hasn't indexed Simulator.app.\n */\nasync function getSimulatorAppIdFromBundleAsync(): Promise<string | null> {\n try {\n const { stdout: developerDir } = await spawnAsync('xcode-select', ['--print-path']);\n const simulatorInfoPlist = path.join(\n developerDir.trim(),\n 'Applications',\n 'Simulator.app',\n 'Contents',\n 'Info.plist'\n );\n const { stdout: bundleId } = await spawnAsync('defaults', [\n 'read',\n simulatorInfoPlist,\n 'CFBundleIdentifier',\n ]);\n return bundleId.trim() || null;\n } catch {\n // Simulator.app not found at the expected path or xcode-select is unavailable.\n }\n return null;\n}\n\nasync function getSimulatorAppIdAsync(): Promise<string | null> {\n return (\n (await getSimulatorAppIdViaAppleScriptAsync()) ?? (await getSimulatorAppIdFromBundleAsync())\n );\n}\n\nexport class SimulatorAppPrerequisite extends Prerequisite {\n static instance = new SimulatorAppPrerequisite();\n\n async assertImplementation(): Promise<void> {\n const result = await getSimulatorAppIdAsync();\n if (!result) {\n // This error may occur in CI where the users intends to install just the simulators but no Xcode.\n throw new PrerequisiteCommandError(\n 'SIMULATOR_APP',\n \"Can't determine id of Simulator app; the Simulator is most likely not installed on this machine. Run `sudo xcode-select -s /Applications/Xcode.app`\"\n );\n }\n if (\n result !== 'com.apple.iphonesimulator' &&\n result !== 'com.apple.CoreSimulator.SimulatorTrampoline'\n ) {\n throw new PrerequisiteCommandError(\n 'SIMULATOR_APP',\n \"Simulator is installed but is identified as '\" + result + \"'; don't know what that is.\"\n );\n }\n debug(`Simulator app id: ${result}`);\n\n try {\n // make sure we can run simctl\n await spawnAsync('xcrun', ['simctl', 'help']);\n } catch (error: any) {\n Log.warn(`Unable to run simctl:\\n${error.toString()}`);\n throw new PrerequisiteCommandError(\n 'SIMCTL',\n 'xcrun is not configured correctly. Ensure `sudo xcode-select --reset` works before running this command again.'\n );\n }\n }\n}\n"],"names":["SimulatorAppPrerequisite","debug","require","getSimulatorAppIdViaAppleScriptAsync","execAsync","trim","getSimulatorAppIdFromBundleAsync","stdout","developerDir","spawnAsync","simulatorInfoPlist","path","join","bundleId","getSimulatorAppIdAsync","Prerequisite","instance","assertImplementation","result","PrerequisiteCommandError","error","Log","warn","toString"],"mappings":";;;;+BA0DaA;;;eAAAA;;;;yBA1Da;;;;;;;gEACH;;;;;;;gEACN;;;;;;6DAEI;8BACkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEvD,MAAMC,QAAQC,QAAQ,SAAS;AAE/B;;;;CAIC,GACD,eAAeC;IACb,IAAI;QACF,OAAO,AAAC,CAAA,MAAMC,IAAAA,sBAAS,EAAC,wBAAuB,EAAGC,IAAI;IACxD,EAAE,OAAM;IACN,0FAA0F;IAC1F,qFAAqF;IACrF,+BAA+B;IACjC;IACA,OAAO;AACT;AAEA;;;;CAIC,GACD,eAAeC;IACb,IAAI;QACF,MAAM,EAAEC,QAAQC,YAAY,EAAE,GAAG,MAAMC,IAAAA,qBAAU,EAAC,gBAAgB;YAAC;SAAe;QAClF,MAAMC,qBAAqBC,eAAI,CAACC,IAAI,CAClCJ,aAAaH,IAAI,IACjB,gBACA,iBACA,YACA;QAEF,MAAM,EAAEE,QAAQM,QAAQ,EAAE,GAAG,MAAMJ,IAAAA,qBAAU,EAAC,YAAY;YACxD;YACAC;YACA;SACD;QACD,OAAOG,SAASR,IAAI,MAAM;IAC5B,EAAE,OAAM;IACN,+EAA+E;IACjF;IACA,OAAO;AACT;AAEA,eAAeS;IACb,OACE,AAAC,MAAMX,0CAA4C,MAAMG;AAE7D;AAEO,MAAMN,iCAAiCe,0BAAY;qBACjDC,WAAW,IAAIhB;IAEtB,MAAMiB,uBAAsC;QAC1C,MAAMC,SAAS,MAAMJ;QACrB,IAAI,CAACI,QAAQ;YACX,kGAAkG;YAClG,MAAM,IAAIC,sCAAwB,CAChC,iBACA;QAEJ;QACA,IACED,WAAW,+BACXA,WAAW,+CACX;YACA,MAAM,IAAIC,sCAAwB,CAChC,iBACA,kDAAkDD,SAAS;QAE/D;QACAjB,MAAM,CAAC,kBAAkB,EAAEiB,QAAQ;QAEnC,IAAI;YACF,8BAA8B;YAC9B,MAAMT,IAAAA,qBAAU,EAAC,SAAS;gBAAC;gBAAU;aAAO;QAC9C,EAAE,OAAOW,OAAY;YACnBC,KAAIC,IAAI,CAAC,CAAC,uBAAuB,EAAEF,MAAMG,QAAQ,IAAI;YACrD,MAAM,IAAIJ,sCAAwB,CAChC,UACA;QAEJ;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../../src/start/doctor/apple/SimulatorAppPrerequisite.ts"],"sourcesContent":["import { safeIdOfAppAsync } from '@expo/osascript';\nimport spawnAsync from '@expo/spawn-async';\nimport path from 'node:path';\n\nimport { Log } from '../../../log';\nimport { Prerequisite, PrerequisiteCommandError } from '../Prerequisite';\n\nconst debug = require('debug')('expo:doctor:apple:simulatorApp') as typeof console.log;\n\n// NOTE(cedric): Xcode 27 Beta moved the `<xcode>/Contents/Developer/Applications` to `<xcode>/Contents/Applications`\nconst XCODE_DEVICE_HUB_PATH = '../Applications/DeviceHub.app/Contents/Info.plist';\nconst XCODE_SIMULATOR_PATH = './Applications/Simulator.app/Contents/Info.plist';\n\nexport class SimulatorAppPrerequisite extends Prerequisite {\n static instance = new SimulatorAppPrerequisite();\n\n async assertImplementation(): Promise<void> {\n // Xcode 27 replaces Simulator with DeviceHub\n // See: https://developer.apple.com/documentation/xcode/device-hub\n // TODO(cedric): once Xcode 27 stable is released, resolve DeviceHub first\n let appId = await safeIdOfAppAsync('Simulator').then((appId) => {\n return appId || safeIdOfAppAsync('DeviceHub');\n });\n\n if (!appId) {\n const xcodePath = await getXcodeSelectPath();\n debug('Xcode select path: %s', xcodePath);\n if (xcodePath) {\n appId = await getXcodeInfoPlistBundleId(path.join(xcodePath, XCODE_SIMULATOR_PATH)).then(\n (appId) => {\n return appId || getXcodeInfoPlistBundleId(path.join(xcodePath, XCODE_DEVICE_HUB_PATH));\n }\n );\n }\n }\n\n if (!appId) {\n throw new PrerequisiteCommandError(\n 'SIMULATOR_APP',\n \"Can't determine id of Device Hub or Simulator app; the Device Hub or Simulator is most likely not installed on this machine. Run `sudo xcode-select -s /Applications/Xcode.app`\"\n );\n }\n\n if (\n appId !== 'com.apple.dt.Devices' &&\n appId !== 'com.apple.iphonesimulator' &&\n appId !== 'com.apple.CoreSimulator.SimulatorTrampoline'\n ) {\n throw new PrerequisiteCommandError(\n 'SIMULATOR_APP',\n `Device Hub or Simulator is installed but is identified as '${appId}'; don't know what that is.`\n );\n }\n\n debug('Xcode simulator app id: %s', appId);\n\n try {\n // make sure we can run simctl\n await spawnAsync('xcrun', ['simctl', 'help']);\n } catch (error: any) {\n Log.warn(`Unable to run simctl:\\n${error.toString()}`);\n throw new PrerequisiteCommandError(\n 'SIMCTL',\n 'xcrun is not configured correctly. Ensure `sudo xcode-select --reset` works before running this command again.'\n );\n }\n }\n}\n\nasync function getXcodeSelectPath() {\n try {\n const result = await spawnAsync('xcode-select', ['--print-path']);\n return result.stdout.trim() || null;\n } catch {\n return null;\n }\n}\n\n/**\n * Read the Info.plist of an app within Xcode and return the bundle ID.\n * This uses `defaults read <path>/Info.plist CFBundleIdentifier`.\n */\nasync function getXcodeInfoPlistBundleId(infoPlistPath: string) {\n try {\n const result = await spawnAsync('defaults', ['read', infoPlistPath, 'CFBundleIdentifier']);\n return result.stdout.trim() || null;\n } catch {\n return null;\n }\n}\n"],"names":["SimulatorAppPrerequisite","debug","require","XCODE_DEVICE_HUB_PATH","XCODE_SIMULATOR_PATH","Prerequisite","instance","assertImplementation","appId","safeIdOfAppAsync","then","xcodePath","getXcodeSelectPath","getXcodeInfoPlistBundleId","path","join","PrerequisiteCommandError","spawnAsync","error","Log","warn","toString","result","stdout","trim","infoPlistPath"],"mappings":";;;;+BAaaA;;;eAAAA;;;;yBAboB;;;;;;;gEACV;;;;;;;gEACN;;;;;;qBAEG;8BACmC;;;;;;AAEvD,MAAMC,QAAQC,QAAQ,SAAS;AAE/B,qHAAqH;AACrH,MAAMC,wBAAwB;AAC9B,MAAMC,uBAAuB;AAEtB,MAAMJ,iCAAiCK,0BAAY;qBACjDC,WAAW,IAAIN;IAEtB,MAAMO,uBAAsC;QAC1C,6CAA6C;QAC7C,kEAAkE;QAClE,0EAA0E;QAC1E,IAAIC,QAAQ,MAAMC,IAAAA,6BAAgB,EAAC,aAAaC,IAAI,CAAC,CAACF;YACpD,OAAOA,SAASC,IAAAA,6BAAgB,EAAC;QACnC;QAEA,IAAI,CAACD,OAAO;YACV,MAAMG,YAAY,MAAMC;YACxBX,MAAM,yBAAyBU;YAC/B,IAAIA,WAAW;gBACbH,QAAQ,MAAMK,0BAA0BC,mBAAI,CAACC,IAAI,CAACJ,WAAWP,uBAAuBM,IAAI,CACtF,CAACF;oBACC,OAAOA,SAASK,0BAA0BC,mBAAI,CAACC,IAAI,CAACJ,WAAWR;gBACjE;YAEJ;QACF;QAEA,IAAI,CAACK,OAAO;YACV,MAAM,IAAIQ,sCAAwB,CAChC,iBACA;QAEJ;QAEA,IACER,UAAU,0BACVA,UAAU,+BACVA,UAAU,+CACV;YACA,MAAM,IAAIQ,sCAAwB,CAChC,iBACA,CAAC,2DAA2D,EAAER,MAAM,2BAA2B,CAAC;QAEpG;QAEAP,MAAM,8BAA8BO;QAEpC,IAAI;YACF,8BAA8B;YAC9B,MAAMS,IAAAA,qBAAU,EAAC,SAAS;gBAAC;gBAAU;aAAO;QAC9C,EAAE,OAAOC,OAAY;YACnBC,QAAG,CAACC,IAAI,CAAC,CAAC,uBAAuB,EAAEF,MAAMG,QAAQ,IAAI;YACrD,MAAM,IAAIL,sCAAwB,CAChC,UACA;QAEJ;IACF;AACF;AAEA,eAAeJ;IACb,IAAI;QACF,MAAMU,SAAS,MAAML,IAAAA,qBAAU,EAAC,gBAAgB;YAAC;SAAe;QAChE,OAAOK,OAAOC,MAAM,CAACC,IAAI,MAAM;IACjC,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEA;;;CAGC,GACD,eAAeX,0BAA0BY,aAAqB;IAC5D,IAAI;QACF,MAAMH,SAAS,MAAML,IAAAA,qBAAU,EAAC,YAAY;YAAC;YAAQQ;YAAe;SAAqB;QACzF,OAAOH,OAAOC,MAAM,CAACC,IAAI,MAAM;IACjC,EAAE,OAAM;QACN,OAAO;IACT;AACF"}
@@ -17,7 +17,7 @@ _export(exports, {
17
17
  }
18
18
  });
19
19
  function _osascript() {
20
- const data = /*#__PURE__*/ _interop_require_wildcard(require("@expo/osascript"));
20
+ const data = require("@expo/osascript");
21
21
  _osascript = function() {
22
22
  return data;
23
23
  };
@@ -273,7 +273,13 @@ class AppleDeviceManager extends _DeviceManager.DeviceManager {
273
273
  // In non-interactive mode, we should assume this is an agent and not attempt to focus the Simulator app since it doesn't need focus.
274
274
  if ((0, _interactive.isInteractive)()) {
275
275
  // TODO: Focus the individual window
276
- await _osascript().execAsync(`tell application "Simulator" to activate`);
276
+ await (0, _osascript().spawnAsync)([
277
+ `if application "Simulator" is running then`,
278
+ `tell application "Simulator" to activate`,
279
+ `else if application "DeviceHub" is running then`,
280
+ `tell application "DeviceHub" to activate`,
281
+ `end if`
282
+ ]);
277
283
  }
278
284
  }
279
285
  getExpoGoAppId() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/platforms/ios/AppleDeviceManager.ts"],"sourcesContent":["import * as osascript from '@expo/osascript';\nimport assert from 'assert';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { assertSystemRequirementsAsync } from './assertSystemRequirements';\nimport { ensureSimulatorAppRunningAsync } from './ensureSimulatorAppRunning';\nimport {\n getBestBootedSimulatorAsync,\n getBestUnbootedSimulatorAsync,\n getSelectableSimulatorsAsync,\n} from './getBestSimulator';\nimport { promptAppleDeviceAsync } from './promptAppleDevice';\nimport * as SimControl from './simctl';\nimport { delayAsync, waitForActionAsync } from '../../../utils/delay';\nimport { CommandError } from '../../../utils/errors';\nimport { isInteractive } from '../../../utils/interactive';\nimport { parsePlistAsync } from '../../../utils/plist';\nimport { validateUrl } from '../../../utils/url';\nimport { DeviceManager } from '../DeviceManager';\nimport { ExpoGoInstaller } from '../ExpoGoInstaller';\nimport type { BaseResolveDeviceProps } from '../PlatformManager';\n\nconst debug = require('debug')('expo:start:platforms:ios:AppleDeviceManager') as typeof console.log;\n\nconst EXPO_GO_BUNDLE_IDENTIFIER = 'host.exp.Exponent';\n\n/**\n * Ensure a simulator is booted and the Simulator app is opened.\n * This is where any timeout related error handling should live.\n */\nexport async function ensureSimulatorOpenAsync(\n { udid, osType }: Partial<Pick<SimControl.Device, 'udid' | 'osType'>> = {},\n tryAgain: boolean = true\n): Promise<SimControl.Device> {\n // Use a default simulator if none was specified\n if (!udid) {\n // If a simulator is open, side step the entire booting sequence.\n const simulatorOpenedByApp = await getBestBootedSimulatorAsync({ osType });\n if (simulatorOpenedByApp) {\n return simulatorOpenedByApp;\n }\n\n // Otherwise, find the best possible simulator from user defaults and continue\n const bestUdid = await getBestUnbootedSimulatorAsync({ osType });\n if (!bestUdid) {\n throw new CommandError('No simulators found.');\n }\n udid = bestUdid;\n }\n\n const bootedDevice = await waitForActionAsync({\n action: () => {\n // Just for the type check.\n assert(udid);\n return SimControl.bootAsync({ udid });\n },\n });\n\n if (!bootedDevice) {\n // Give it a second chance, this might not be needed but it could potentially lead to a better UX on slower devices.\n if (tryAgain) {\n return await ensureSimulatorOpenAsync({ udid, osType }, false);\n }\n // TODO: We should eliminate all needs for a timeout error, it's bad UX to get an error about the simulator not starting while the user can clearly see it starting on their slow computer.\n throw new CommandError(\n 'SIMULATOR_TIMEOUT',\n `Simulator didn't boot fast enough. Try opening Simulator first, then running your app.`\n );\n }\n return bootedDevice;\n}\nexport class AppleDeviceManager extends DeviceManager<SimControl.Device> {\n static assertSystemRequirementsAsync = assertSystemRequirementsAsync;\n\n static async resolveAsync({\n device,\n shouldPrompt,\n }: BaseResolveDeviceProps<\n Partial<Pick<SimControl.Device, 'udid' | 'osType'>>\n > = {}): Promise<AppleDeviceManager> {\n if (shouldPrompt) {\n const devices = await getSelectableSimulatorsAsync(device);\n device = await promptAppleDeviceAsync(devices, device?.osType);\n }\n\n const booted = await ensureSimulatorOpenAsync(device);\n return new AppleDeviceManager(booted);\n }\n\n get name() {\n return this.device.name;\n }\n\n get identifier(): string {\n return this.device.udid;\n }\n\n async getAppVersionAsync(\n appId: string,\n { containerPath }: { containerPath?: string } = {}\n ): Promise<string | null> {\n return await SimControl.getInfoPlistValueAsync(this.device, {\n appId,\n key: 'CFBundleShortVersionString',\n containerPath,\n });\n }\n\n async startAsync(): Promise<SimControl.Device> {\n return ensureSimulatorOpenAsync({ osType: this.device.osType, udid: this.device.udid });\n }\n\n async launchApplicationIdAsync(appId: string) {\n try {\n const result = await SimControl.openAppIdAsync(this.device, {\n appId,\n });\n if (result.status === 0) {\n await this.activateWindowAsync();\n } else {\n throw new CommandError(result.stderr);\n }\n } catch (error: any) {\n let errorMessage = `Couldn't open iOS app with ID \"${appId}\" on device \"${this.name}\".`;\n if (error instanceof CommandError && error.code === 'APP_NOT_INSTALLED') {\n if (appId === EXPO_GO_BUNDLE_IDENTIFIER) {\n errorMessage = `Couldn't open Expo Go app on device \"${this.name}\". Install it: https://expo.dev/go.`;\n } else {\n errorMessage += `\\nThe app might not be installed, try installing it with: ${chalk.bold(\n `npx expo run:ios -d ${this.device.udid}`\n )}`;\n }\n }\n if (error.stderr) {\n errorMessage += chalk.gray(`\\n${error.stderr}`);\n } else if (error.message) {\n errorMessage += chalk.gray(`\\n${error.message}`);\n }\n throw new CommandError(errorMessage);\n }\n }\n\n async installAppAsync(filePath: string) {\n await SimControl.installAsync(this.device, {\n filePath,\n });\n\n await this.waitForAppInstalledAsync(await this.getApplicationIdFromBundle(filePath));\n }\n\n private async getApplicationIdFromBundle(filePath: string): Promise<string> {\n debug('getApplicationIdFromBundle:', filePath);\n const builtInfoPlistPath = path.join(filePath, 'Info.plist');\n if (fs.existsSync(builtInfoPlistPath)) {\n const { CFBundleIdentifier } = await parsePlistAsync(builtInfoPlistPath);\n debug('getApplicationIdFromBundle: using built Info.plist', CFBundleIdentifier);\n return CFBundleIdentifier;\n }\n debug('getApplicationIdFromBundle: no Info.plist found');\n return EXPO_GO_BUNDLE_IDENTIFIER;\n }\n\n private async waitForAppInstalledAsync(applicationId: string): Promise<boolean> {\n while (true) {\n if (await this.isAppInstalledAndIfSoReturnContainerPathForIOSAsync(applicationId)) {\n return true;\n }\n await delayAsync(100);\n }\n }\n\n async uninstallAppAsync(appId: string) {\n await SimControl.uninstallAsync(this.device, {\n appId,\n });\n }\n\n async isAppInstalledAndIfSoReturnContainerPathForIOSAsync(appId: string) {\n return (\n (await SimControl.getContainerPathAsync(this.device, {\n appId,\n })) ?? false\n );\n }\n\n async openUrlAsync(url: string, options: { appId?: string } = {}) {\n // Non-compliant URLs will be treated as application identifiers.\n if (!validateUrl(url, { requireProtocol: true })) {\n return await this.launchApplicationIdAsync(url);\n }\n\n try {\n await SimControl.openUrlAsync(this.device, { url, appId: options.appId });\n } catch (error: any) {\n // 194 means the device does not conform to a given URL, in this case we'll assume that the desired app is not installed.\n if (error.status === 194) {\n // An error was encountered processing the command (domain=NSOSStatusErrorDomain, code=-10814):\n // The operation couldn’t be completed. (OSStatus error -10814.)\n //\n // This can be thrown when no app conforms to the URI scheme that we attempted to open.\n throw new CommandError(\n 'APP_NOT_INSTALLED',\n `Device ${this.device.name} (${this.device.udid}) has no app to handle the URI: ${url}`\n );\n }\n throw error;\n }\n }\n\n async activateWindowAsync() {\n await ensureSimulatorAppRunningAsync(this.device);\n\n // If we're in interactive mode, we can attempt to focus the Simulator app.\n // In non-interactive mode, we should assume this is an agent and not attempt to focus the Simulator app since it doesn't need focus.\n if (isInteractive()) {\n // TODO: Focus the individual window\n await osascript.execAsync(`tell application \"Simulator\" to activate`);\n }\n }\n\n getExpoGoAppId(): string {\n return EXPO_GO_BUNDLE_IDENTIFIER;\n }\n\n async ensureExpoGoAsync(sdkVersion: string): Promise<boolean> {\n if (this.device.osType === 'watchOS') {\n throw new CommandError(\n 'UNSUPPORTED_DEVICE',\n `Expo Go is not supported on Apple Watch. Please select an iPhone or iPad simulator instead.`\n );\n }\n const installer = new ExpoGoInstaller('ios', EXPO_GO_BUNDLE_IDENTIFIER, sdkVersion);\n return installer.ensureAsync(this);\n }\n}\n"],"names":["AppleDeviceManager","ensureSimulatorOpenAsync","debug","require","EXPO_GO_BUNDLE_IDENTIFIER","udid","osType","tryAgain","simulatorOpenedByApp","getBestBootedSimulatorAsync","bestUdid","getBestUnbootedSimulatorAsync","CommandError","bootedDevice","waitForActionAsync","action","assert","SimControl","bootAsync","DeviceManager","assertSystemRequirementsAsync","resolveAsync","device","shouldPrompt","devices","getSelectableSimulatorsAsync","promptAppleDeviceAsync","booted","name","identifier","getAppVersionAsync","appId","containerPath","getInfoPlistValueAsync","key","startAsync","launchApplicationIdAsync","result","openAppIdAsync","status","activateWindowAsync","stderr","error","errorMessage","code","chalk","bold","gray","message","installAppAsync","filePath","installAsync","waitForAppInstalledAsync","getApplicationIdFromBundle","builtInfoPlistPath","path","join","fs","existsSync","CFBundleIdentifier","parsePlistAsync","applicationId","isAppInstalledAndIfSoReturnContainerPathForIOSAsync","delayAsync","uninstallAppAsync","uninstallAsync","getContainerPathAsync","openUrlAsync","url","options","validateUrl","requireProtocol","ensureSimulatorAppRunningAsync","isInteractive","osascript","execAsync","getExpoGoAppId","ensureExpoGoAsync","sdkVersion","installer","ExpoGoInstaller","ensureAsync"],"mappings":";;;;;;;;;;;QAyEaA;eAAAA;;QAzCSC;eAAAA;;;;iEAhCK;;;;;;;gEACR;;;;;;;gEACD;;;;;;;gEACH;;;;;;;gEACE;;;;;;0CAE6B;2CACC;kCAKxC;mCACgC;gEACX;uBACmB;wBAClB;6BACC;uBACE;qBACJ;+BACE;iCACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGhC,MAAMC,QAAQC,QAAQ,SAAS;AAE/B,MAAMC,4BAA4B;AAM3B,eAAeH,yBACpB,EAAEI,IAAI,EAAEC,MAAM,EAAuD,GAAG,CAAC,CAAC,EAC1EC,WAAoB,IAAI;IAExB,gDAAgD;IAChD,IAAI,CAACF,MAAM;QACT,iEAAiE;QACjE,MAAMG,uBAAuB,MAAMC,IAAAA,6CAA2B,EAAC;YAAEH;QAAO;QACxE,IAAIE,sBAAsB;YACxB,OAAOA;QACT;QAEA,8EAA8E;QAC9E,MAAME,WAAW,MAAMC,IAAAA,+CAA6B,EAAC;YAAEL;QAAO;QAC9D,IAAI,CAACI,UAAU;YACb,MAAM,IAAIE,oBAAY,CAAC;QAC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C,EAAE,EAAE,IAAI,CAACN,MAAM,CAACjB,IAAI,CAAC,gCAAgC,EAAE+D,KAAK;YAE3F;YACA,MAAM1B;QACR;IACF;IAEA,MAAMF,sBAAsB;QAC1B,MAAMgC,IAAAA,yDAA8B,EAAC,IAAI,CAAClD,MAAM;QAEhD,2EAA2E;QAC3E,qIAAqI;QACrI,IAAImD,IAAAA,0BAAa,KAAI;YACnB,oCAAoC;YACpC,MAAMC,aAAUC,SAAS,CAAC,CAAC,wCAAwC,CAAC;QACtE;IACF;IAEAC,iBAAyB;QACvB,OAAOxE;IACT;IAEA,MAAMyE,kBAAkBC,UAAkB,EAAoB;QAC5D,IAAI,IAAI,CAACxD,MAAM,CAAChB,MAAM,KAAK,WAAW;YACpC,MAAM,IAAIM,oBAAY,CACpB,sBACA,CAAC,2FAA2F,CAAC;QAEjG;QACA,MAAMmE,YAAY,IAAIC,gCAAe,CAAC,OAAO5E,2BAA2B0E;QACxE,OAAOC,UAAUE,WAAW,CAAC,IAAI;IACnC;AACF"}
1
+ {"version":3,"sources":["../../../../../src/start/platforms/ios/AppleDeviceManager.ts"],"sourcesContent":["import { spawnAsync as spawnAppleScriptAsync } from '@expo/osascript';\nimport assert from 'assert';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { assertSystemRequirementsAsync } from './assertSystemRequirements';\nimport { ensureSimulatorAppRunningAsync } from './ensureSimulatorAppRunning';\nimport {\n getBestBootedSimulatorAsync,\n getBestUnbootedSimulatorAsync,\n getSelectableSimulatorsAsync,\n} from './getBestSimulator';\nimport { promptAppleDeviceAsync } from './promptAppleDevice';\nimport * as SimControl from './simctl';\nimport { delayAsync, waitForActionAsync } from '../../../utils/delay';\nimport { CommandError } from '../../../utils/errors';\nimport { isInteractive } from '../../../utils/interactive';\nimport { parsePlistAsync } from '../../../utils/plist';\nimport { validateUrl } from '../../../utils/url';\nimport { DeviceManager } from '../DeviceManager';\nimport { ExpoGoInstaller } from '../ExpoGoInstaller';\nimport type { BaseResolveDeviceProps } from '../PlatformManager';\n\nconst debug = require('debug')('expo:start:platforms:ios:AppleDeviceManager') as typeof console.log;\n\nconst EXPO_GO_BUNDLE_IDENTIFIER = 'host.exp.Exponent';\n\n/**\n * Ensure a simulator is booted and the Simulator app is opened.\n * This is where any timeout related error handling should live.\n */\nexport async function ensureSimulatorOpenAsync(\n { udid, osType }: Partial<Pick<SimControl.Device, 'udid' | 'osType'>> = {},\n tryAgain: boolean = true\n): Promise<SimControl.Device> {\n // Use a default simulator if none was specified\n if (!udid) {\n // If a simulator is open, side step the entire booting sequence.\n const simulatorOpenedByApp = await getBestBootedSimulatorAsync({ osType });\n if (simulatorOpenedByApp) {\n return simulatorOpenedByApp;\n }\n\n // Otherwise, find the best possible simulator from user defaults and continue\n const bestUdid = await getBestUnbootedSimulatorAsync({ osType });\n if (!bestUdid) {\n throw new CommandError('No simulators found.');\n }\n udid = bestUdid;\n }\n\n const bootedDevice = await waitForActionAsync({\n action: () => {\n // Just for the type check.\n assert(udid);\n return SimControl.bootAsync({ udid });\n },\n });\n\n if (!bootedDevice) {\n // Give it a second chance, this might not be needed but it could potentially lead to a better UX on slower devices.\n if (tryAgain) {\n return await ensureSimulatorOpenAsync({ udid, osType }, false);\n }\n // TODO: We should eliminate all needs for a timeout error, it's bad UX to get an error about the simulator not starting while the user can clearly see it starting on their slow computer.\n throw new CommandError(\n 'SIMULATOR_TIMEOUT',\n `Simulator didn't boot fast enough. Try opening Simulator first, then running your app.`\n );\n }\n return bootedDevice;\n}\nexport class AppleDeviceManager extends DeviceManager<SimControl.Device> {\n static assertSystemRequirementsAsync = assertSystemRequirementsAsync;\n\n static async resolveAsync({\n device,\n shouldPrompt,\n }: BaseResolveDeviceProps<\n Partial<Pick<SimControl.Device, 'udid' | 'osType'>>\n > = {}): Promise<AppleDeviceManager> {\n if (shouldPrompt) {\n const devices = await getSelectableSimulatorsAsync(device);\n device = await promptAppleDeviceAsync(devices, device?.osType);\n }\n\n const booted = await ensureSimulatorOpenAsync(device);\n return new AppleDeviceManager(booted);\n }\n\n get name() {\n return this.device.name;\n }\n\n get identifier(): string {\n return this.device.udid;\n }\n\n async getAppVersionAsync(\n appId: string,\n { containerPath }: { containerPath?: string } = {}\n ): Promise<string | null> {\n return await SimControl.getInfoPlistValueAsync(this.device, {\n appId,\n key: 'CFBundleShortVersionString',\n containerPath,\n });\n }\n\n async startAsync(): Promise<SimControl.Device> {\n return ensureSimulatorOpenAsync({ osType: this.device.osType, udid: this.device.udid });\n }\n\n async launchApplicationIdAsync(appId: string) {\n try {\n const result = await SimControl.openAppIdAsync(this.device, {\n appId,\n });\n if (result.status === 0) {\n await this.activateWindowAsync();\n } else {\n throw new CommandError(result.stderr);\n }\n } catch (error: any) {\n let errorMessage = `Couldn't open iOS app with ID \"${appId}\" on device \"${this.name}\".`;\n if (error instanceof CommandError && error.code === 'APP_NOT_INSTALLED') {\n if (appId === EXPO_GO_BUNDLE_IDENTIFIER) {\n errorMessage = `Couldn't open Expo Go app on device \"${this.name}\". Install it: https://expo.dev/go.`;\n } else {\n errorMessage += `\\nThe app might not be installed, try installing it with: ${chalk.bold(\n `npx expo run:ios -d ${this.device.udid}`\n )}`;\n }\n }\n if (error.stderr) {\n errorMessage += chalk.gray(`\\n${error.stderr}`);\n } else if (error.message) {\n errorMessage += chalk.gray(`\\n${error.message}`);\n }\n throw new CommandError(errorMessage);\n }\n }\n\n async installAppAsync(filePath: string) {\n await SimControl.installAsync(this.device, {\n filePath,\n });\n\n await this.waitForAppInstalledAsync(await this.getApplicationIdFromBundle(filePath));\n }\n\n private async getApplicationIdFromBundle(filePath: string): Promise<string> {\n debug('getApplicationIdFromBundle:', filePath);\n const builtInfoPlistPath = path.join(filePath, 'Info.plist');\n if (fs.existsSync(builtInfoPlistPath)) {\n const { CFBundleIdentifier } = await parsePlistAsync(builtInfoPlistPath);\n debug('getApplicationIdFromBundle: using built Info.plist', CFBundleIdentifier);\n return CFBundleIdentifier;\n }\n debug('getApplicationIdFromBundle: no Info.plist found');\n return EXPO_GO_BUNDLE_IDENTIFIER;\n }\n\n private async waitForAppInstalledAsync(applicationId: string): Promise<boolean> {\n while (true) {\n if (await this.isAppInstalledAndIfSoReturnContainerPathForIOSAsync(applicationId)) {\n return true;\n }\n await delayAsync(100);\n }\n }\n\n async uninstallAppAsync(appId: string) {\n await SimControl.uninstallAsync(this.device, {\n appId,\n });\n }\n\n async isAppInstalledAndIfSoReturnContainerPathForIOSAsync(appId: string) {\n return (\n (await SimControl.getContainerPathAsync(this.device, {\n appId,\n })) ?? false\n );\n }\n\n async openUrlAsync(url: string, options: { appId?: string } = {}) {\n // Non-compliant URLs will be treated as application identifiers.\n if (!validateUrl(url, { requireProtocol: true })) {\n return await this.launchApplicationIdAsync(url);\n }\n\n try {\n await SimControl.openUrlAsync(this.device, { url, appId: options.appId });\n } catch (error: any) {\n // 194 means the device does not conform to a given URL, in this case we'll assume that the desired app is not installed.\n if (error.status === 194) {\n // An error was encountered processing the command (domain=NSOSStatusErrorDomain, code=-10814):\n // The operation couldn’t be completed. (OSStatus error -10814.)\n //\n // This can be thrown when no app conforms to the URI scheme that we attempted to open.\n throw new CommandError(\n 'APP_NOT_INSTALLED',\n `Device ${this.device.name} (${this.device.udid}) has no app to handle the URI: ${url}`\n );\n }\n throw error;\n }\n }\n\n async activateWindowAsync() {\n await ensureSimulatorAppRunningAsync(this.device);\n\n // If we're in interactive mode, we can attempt to focus the Simulator app.\n // In non-interactive mode, we should assume this is an agent and not attempt to focus the Simulator app since it doesn't need focus.\n if (isInteractive()) {\n // TODO: Focus the individual window\n await spawnAppleScriptAsync([\n `if application \"Simulator\" is running then`,\n `tell application \"Simulator\" to activate`,\n `else if application \"DeviceHub\" is running then`,\n `tell application \"DeviceHub\" to activate`,\n `end if`,\n ]);\n }\n }\n\n getExpoGoAppId(): string {\n return EXPO_GO_BUNDLE_IDENTIFIER;\n }\n\n async ensureExpoGoAsync(sdkVersion: string): Promise<boolean> {\n if (this.device.osType === 'watchOS') {\n throw new CommandError(\n 'UNSUPPORTED_DEVICE',\n `Expo Go is not supported on Apple Watch. Please select an iPhone or iPad simulator instead.`\n );\n }\n const installer = new ExpoGoInstaller('ios', EXPO_GO_BUNDLE_IDENTIFIER, sdkVersion);\n return installer.ensureAsync(this);\n }\n}\n"],"names":["AppleDeviceManager","ensureSimulatorOpenAsync","debug","require","EXPO_GO_BUNDLE_IDENTIFIER","udid","osType","tryAgain","simulatorOpenedByApp","getBestBootedSimulatorAsync","bestUdid","getBestUnbootedSimulatorAsync","CommandError","bootedDevice","waitForActionAsync","action","assert","SimControl","bootAsync","DeviceManager","assertSystemRequirementsAsync","resolveAsync","device","shouldPrompt","devices","getSelectableSimulatorsAsync","promptAppleDeviceAsync","booted","name","identifier","getAppVersionAsync","appId","containerPath","getInfoPlistValueAsync","key","startAsync","launchApplicationIdAsync","result","openAppIdAsync","status","activateWindowAsync","stderr","error","errorMessage","code","chalk","bold","gray","message","installAppAsync","filePath","installAsync","waitForAppInstalledAsync","getApplicationIdFromBundle","builtInfoPlistPath","path","join","fs","existsSync","CFBundleIdentifier","parsePlistAsync","applicationId","isAppInstalledAndIfSoReturnContainerPathForIOSAsync","delayAsync","uninstallAppAsync","uninstallAsync","getContainerPathAsync","openUrlAsync","url","options","validateUrl","requireProtocol","ensureSimulatorAppRunningAsync","isInteractive","spawnAppleScriptAsync","getExpoGoAppId","ensureExpoGoAsync","sdkVersion","installer","ExpoGoInstaller","ensureAsync"],"mappings":";;;;;;;;;;;QAyEaA;eAAAA;;QAzCSC;eAAAA;;;;yBAhC8B;;;;;;;gEACjC;;;;;;;gEACD;;;;;;;gEACH;;;;;;;gEACE;;;;;;0CAE6B;2CACC;kCAKxC;mCACgC;gEACX;uBACmB;wBAClB;6BACC;uBACE;qBACJ;+BACE;iCACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGhC,MAAMC,QAAQC,QAAQ,SAAS;AAE/B,MAAMC,4BAA4B;AAM3B,eA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