@expo/cli 56.1.3 → 56.1.4

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.
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.3");
142
+ console.log("56.1.4");
143
143
  process.exit(0);
144
144
  }
145
145
  if (args['--non-interactive']) {
@@ -30,7 +30,7 @@ function getExpoWebsiteBaseUrl() {
30
30
  if (_env.env.EXPO_STAGING) {
31
31
  return `https://staging.expo.dev`;
32
32
  } else if (_env.env.EXPO_LOCAL) {
33
- return `http://127.0.0.1:3001`;
33
+ return `http://expo.test`;
34
34
  } else {
35
35
  return `https://expo.dev`;
36
36
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/api/endpoint.ts"],"sourcesContent":["import { env } from '../utils/env';\n\n/** Get the URL for the expo.dev API. */\nexport function getExpoApiBaseUrl(): string {\n if (env.EXPO_STAGING) {\n return `https://staging-api.expo.dev`;\n } else if (env.EXPO_LOCAL) {\n return `http://127.0.0.1:3000`;\n } else {\n return `https://api.expo.dev`;\n }\n}\n\n/** Get the URL for the expo.dev website. */\nexport function getExpoWebsiteBaseUrl(): string {\n if (env.EXPO_STAGING) {\n return `https://staging.expo.dev`;\n } else if (env.EXPO_LOCAL) {\n return `http://127.0.0.1:3001`;\n } else {\n return `https://expo.dev`;\n }\n}\n"],"names":["getExpoApiBaseUrl","getExpoWebsiteBaseUrl","env","EXPO_STAGING","EXPO_LOCAL"],"mappings":";;;;;;;;;;;QAGgBA;eAAAA;;QAWAC;eAAAA;;;qBAdI;AAGb,SAASD;IACd,IAAIE,QAAG,CAACC,YAAY,EAAE;QACpB,OAAO,CAAC,4BAA4B,CAAC;IACvC,OAAO,IAAID,QAAG,CAACE,UAAU,EAAE;QACzB,OAAO,CAAC,qBAAqB,CAAC;IAChC,OAAO;QACL,OAAO,CAAC,oBAAoB,CAAC;IAC/B;AACF;AAGO,SAASH;IACd,IAAIC,QAAG,CAACC,YAAY,EAAE;QACpB,OAAO,CAAC,wBAAwB,CAAC;IACnC,OAAO,IAAID,QAAG,CAACE,UAAU,EAAE;QACzB,OAAO,CAAC,qBAAqB,CAAC;IAChC,OAAO;QACL,OAAO,CAAC,gBAAgB,CAAC;IAC3B;AACF"}
1
+ {"version":3,"sources":["../../../src/api/endpoint.ts"],"sourcesContent":["import { env } from '../utils/env';\n\n/** Get the URL for the expo.dev API. */\nexport function getExpoApiBaseUrl(): string {\n if (env.EXPO_STAGING) {\n return `https://staging-api.expo.dev`;\n } else if (env.EXPO_LOCAL) {\n return `http://127.0.0.1:3000`;\n } else {\n return `https://api.expo.dev`;\n }\n}\n\n/** Get the URL for the expo.dev website. */\nexport function getExpoWebsiteBaseUrl(): string {\n if (env.EXPO_STAGING) {\n return `https://staging.expo.dev`;\n } else if (env.EXPO_LOCAL) {\n return `http://expo.test`;\n } else {\n return `https://expo.dev`;\n }\n}\n"],"names":["getExpoApiBaseUrl","getExpoWebsiteBaseUrl","env","EXPO_STAGING","EXPO_LOCAL"],"mappings":";;;;;;;;;;;QAGgBA;eAAAA;;QAWAC;eAAAA;;;qBAdI;AAGb,SAASD;IACd,IAAIE,QAAG,CAACC,YAAY,EAAE;QACpB,OAAO,CAAC,4BAA4B,CAAC;IACvC,OAAO,IAAID,QAAG,CAACE,UAAU,EAAE;QACzB,OAAO,CAAC,qBAAqB,CAAC;IAChC,OAAO;QACL,OAAO,CAAC,oBAAoB,CAAC;IAC/B;AACF;AAGO,SAASH;IACd,IAAIC,QAAG,CAACC,YAAY,EAAE;QACpB,OAAO,CAAC,wBAAwB,CAAC;IACnC,OAAO,IAAID,QAAG,CAACE,UAAU,EAAE;QACzB,OAAO,CAAC,gBAAgB,CAAC;IAC3B,OAAO;QACL,OAAO,CAAC,gBAAgB,CAAC;IAC3B;AACF"}
@@ -22,21 +22,23 @@ function _betteropn() {
22
22
  };
23
23
  return data;
24
24
  }
25
- function _http() {
26
- const data = /*#__PURE__*/ _interop_require_default(require("http"));
27
- _http = function() {
25
+ function _crypto() {
26
+ const data = /*#__PURE__*/ _interop_require_default(require("crypto"));
27
+ _crypto = function() {
28
28
  return data;
29
29
  };
30
30
  return data;
31
31
  }
32
- function _querystring() {
33
- const data = /*#__PURE__*/ _interop_require_default(require("querystring"));
34
- _querystring = function() {
32
+ function _http() {
33
+ const data = /*#__PURE__*/ _interop_require_default(require("http"));
34
+ _http = function() {
35
35
  return data;
36
36
  };
37
37
  return data;
38
38
  }
39
39
  const _log = /*#__PURE__*/ _interop_require_wildcard(require("../../log"));
40
+ const _errors = require("../../utils/errors");
41
+ const _client = require("../rest/client");
40
42
  function _interop_require_default(obj) {
41
43
  return obj && obj.__esModule ? obj : {
42
44
  default: obj
@@ -83,15 +85,57 @@ function _interop_require_wildcard(obj, nodeInterop) {
83
85
  }
84
86
  return newObj;
85
87
  }
88
+ const CLIENT_ID = 'expo-cli';
89
+ function generateCodeVerifier() {
90
+ return _crypto().default.randomBytes(32).toString('base64url');
91
+ }
92
+ function generateCodeChallenge(codeVerifier) {
93
+ return _crypto().default.createHash('sha256').update(codeVerifier).digest('base64url');
94
+ }
95
+ function generateState() {
96
+ return _crypto().default.randomBytes(32).toString('base64url');
97
+ }
98
+ async function exchangeCodeForSessionSecretAsync({ code, codeVerifier, redirectUri }) {
99
+ const response = await (0, _client.fetchAsync)('auth/token', {
100
+ method: 'POST',
101
+ headers: {
102
+ 'Content-Type': 'application/json'
103
+ },
104
+ body: JSON.stringify({
105
+ grant_type: 'authorization_code',
106
+ code,
107
+ redirect_uri: redirectUri,
108
+ code_verifier: codeVerifier,
109
+ client_id: CLIENT_ID
110
+ })
111
+ });
112
+ const { session_secret: sessionSecret } = (0, _client.getResponseDataOrThrow)(await response.json());
113
+ if (!sessionSecret) {
114
+ throw new _errors.CommandError('BROWSER_AUTH', 'Failed to obtain session secret from token exchange.');
115
+ }
116
+ return sessionSecret;
117
+ }
86
118
  async function getSessionUsingBrowserAuthFlowAsync({ expoWebsiteUrl, sso = false }) {
87
119
  const scheme = 'http';
88
120
  const hostname = 'localhost';
89
- const path = '/auth/callback';
121
+ const callbackPath = '/auth/callback';
122
+ const codeVerifier = generateCodeVerifier();
123
+ const codeChallenge = generateCodeChallenge(codeVerifier);
124
+ const state = generateState();
125
+ const buildRedirectUri = (port)=>`${scheme}://${hostname}:${port}${callbackPath}`;
90
126
  const buildExpoLoginUrl = (port, sso)=>{
91
- const params = _querystring().default.stringify({
92
- confirm_account: 'true',
93
- app_redirect_uri: `${scheme}://${hostname}:${port}${path}`
94
- });
127
+ // Note: we avoid URLSearchParams here because better-opn calls encodeURI()
128
+ // on the URL before passing it to AppleScript, which would double-encode
129
+ // the percent-encoded values from URLSearchParams.toString().
130
+ const params = [
131
+ `client_id=${CLIENT_ID}`,
132
+ `redirect_uri=${buildRedirectUri(port)}`,
133
+ `response_type=code`,
134
+ `code_challenge=${codeChallenge}`,
135
+ `code_challenge_method=S256`,
136
+ `state=${state}`,
137
+ `confirm_account=true`
138
+ ].join('&');
95
139
  return `${expoWebsiteUrl}${sso ? '/sso-login' : '/login'}?${params}`;
96
140
  };
97
141
  // Start server and begin auth flow
@@ -110,22 +154,35 @@ async function getSessionUsingBrowserAuthFlowAsync({ expoWebsiteUrl, sso = false
110
154
  connection.destroy();
111
155
  }
112
156
  };
113
- try {
157
+ const handleRequestAsync = async ()=>{
114
158
  var _request_url;
115
- if (!(request.method === 'GET' && ((_request_url = request.url) == null ? void 0 : _request_url.includes('/auth/callback')))) {
116
- throw new Error('Unexpected login response.');
159
+ if (!(request.method === 'GET' && ((_request_url = request.url) == null ? void 0 : _request_url.includes(callbackPath)))) {
160
+ throw new _errors.CommandError('BROWSER_AUTH', 'Unexpected login response.');
117
161
  }
118
162
  const url = new URL(request.url, `http:${request.headers.host}`);
119
- const sessionSecret = url.searchParams.get('session_secret');
120
- if (!sessionSecret) {
121
- throw new Error('Request missing session_secret search parameter.');
163
+ const code = url.searchParams.get('code');
164
+ const returnedState = url.searchParams.get('state');
165
+ if (!code) {
166
+ throw new _errors.CommandError('BROWSER_AUTH', 'Request missing code search parameter.');
122
167
  }
168
+ if (returnedState !== state) {
169
+ throw new _errors.CommandError('BROWSER_AUTH', 'State mismatch. Possible CSRF attack.');
170
+ }
171
+ const address = server.address();
172
+ (0, _assert().default)(address !== null && typeof address === 'object');
173
+ const redirectUri = buildRedirectUri(address.port);
174
+ const sessionSecret = await exchangeCodeForSessionSecretAsync({
175
+ code,
176
+ codeVerifier,
177
+ redirectUri
178
+ });
123
179
  resolve(sessionSecret);
124
180
  redirectAndCleanup('success');
125
- } catch (error) {
181
+ };
182
+ handleRequestAsync().catch((error)=>{
126
183
  redirectAndCleanup('error');
127
184
  reject(error);
128
- }
185
+ });
129
186
  });
130
187
  server.listen(0, hostname, ()=>{
131
188
  _log.log('Waiting for browser login...');
@@ -133,6 +190,7 @@ async function getSessionUsingBrowserAuthFlowAsync({ expoWebsiteUrl, sso = false
133
190
  (0, _assert().default)(address !== null && typeof address === 'object', 'Server address and port should be set after listening has begun');
134
191
  const port = address.port;
135
192
  const authorizeUrl = buildExpoLoginUrl(port, sso);
193
+ _log.log(`If your browser doesn't automatically open, visit this link to log in: ${authorizeUrl}`);
136
194
  (0, _betteropn().default)(authorizeUrl);
137
195
  });
138
196
  server.on('connection', (connection)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/api/user/expoSsoLauncher.ts"],"sourcesContent":["import assert from 'assert';\nimport openBrowserAsync from 'better-opn';\nimport http from 'http';\nimport type { Socket } from 'node:net';\nimport querystring from 'querystring';\n\nimport * as Log from '../../log';\n\nexport async function getSessionUsingBrowserAuthFlowAsync({\n expoWebsiteUrl,\n sso = false,\n}: {\n expoWebsiteUrl: string;\n sso?: boolean;\n}): Promise<string> {\n const scheme = 'http';\n const hostname = 'localhost';\n const path = '/auth/callback';\n\n const buildExpoLoginUrl = (port: number, sso: boolean): string => {\n const params = querystring.stringify({\n confirm_account: 'true',\n app_redirect_uri: `${scheme}://${hostname}:${port}${path}`,\n });\n return `${expoWebsiteUrl}${sso ? '/sso-login' : '/login'}?${params}`;\n };\n\n // Start server and begin auth flow\n const executeAuthFlow = (): Promise<string> => {\n return new Promise<string>(async (resolve, reject) => {\n const connections = new Set<Socket>();\n\n const server = http.createServer(\n (request: http.IncomingMessage, response: http.ServerResponse) => {\n const redirectAndCleanup = (result: 'success' | 'error'): void => {\n const redirectUrl = `${expoWebsiteUrl}/oauth/expo-cli?result=${result}`;\n response.writeHead(302, { Location: redirectUrl });\n response.end();\n server.close();\n for (const connection of connections) {\n connection.destroy();\n }\n };\n\n try {\n if (!(request.method === 'GET' && request.url?.includes('/auth/callback'))) {\n throw new Error('Unexpected login response.');\n }\n const url = new URL(request.url, `http:${request.headers.host}`);\n const sessionSecret = url.searchParams.get('session_secret');\n\n if (!sessionSecret) {\n throw new Error('Request missing session_secret search parameter.');\n }\n resolve(sessionSecret);\n redirectAndCleanup('success');\n } catch (error) {\n redirectAndCleanup('error');\n reject(error);\n }\n }\n );\n\n server.listen(0, hostname, () => {\n Log.log('Waiting for browser login...');\n\n const address = server.address();\n assert(\n address !== null && typeof address === 'object',\n 'Server address and port should be set after listening has begun'\n );\n const port = address.port;\n const authorizeUrl = buildExpoLoginUrl(port, sso);\n openBrowserAsync(authorizeUrl);\n });\n\n server.on('connection', (connection) => {\n connections.add(connection);\n\n connection.on('close', () => {\n connections.delete(connection);\n });\n });\n });\n };\n\n return await executeAuthFlow();\n}\n"],"names":["getSessionUsingBrowserAuthFlowAsync","expoWebsiteUrl","sso","scheme","hostname","path","buildExpoLoginUrl","port","params","querystring","stringify","confirm_account","app_redirect_uri","executeAuthFlow","Promise","resolve","reject","connections","Set","server","http","createServer","request","response","redirectAndCleanup","result","redirectUrl","writeHead","Location","end","close","connection","destroy","method","url","includes","Error","URL","headers","host","sessionSecret","searchParams","get","error","listen","Log","log","address","assert","authorizeUrl","openBrowserAsync","on","add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MC,gBAAgBN,IAAIO,YAAY,CAACC,GAAG,CAAC;oBAE3C,IAAI,CAACF,eAAe;wBAClB,MAAM,IAAIJ,MAAM;oBAClB;oBACArB,QAAQyB;oBACRhB,mBAAmB;gBACrB,EAAE,OAAOmB,OAAO;oBACdnB,mBAAmB;oBACnBR,OAAO2B;gBACT;YACF;YAGFxB,OAAOyB,MAAM,CAAC,GAAGxC,UAAU;gBACzByC,KAAIC,GAAG,CAAC;gBAER,MAAMC,UAAU5B,OAAO4B,OAAO;gBAC9BC,IAAAA,iBAAM,EACJD,YAAY,QAAQ,OAAOA,YAAY,UACvC;gBAEF,MAAMxC,OAAOwC,QAAQxC,IAAI;gBACzB,MAAM0C,eAAe3C,kBAAkBC,MAAML;gBAC7CgD,IAAAA,oBAAgB,EAACD;YACnB;YAEA9B,OAAOgC,EAAE,CAAC,cAAc,CAACpB;gBACvBd,YAAYmC,GAAG,CAACrB;gBAEhBA,WAAWoB,EAAE,CAAC,SAAS;oBACrBlC,YAAYoC,MAAM,CAACtB;gBACrB;YACF;QACF;IACF;IAEA,OAAO,MAAMlB;AACf"}
1
+ {"version":3,"sources":["../../../../src/api/user/expoSsoLauncher.ts"],"sourcesContent":["import assert from 'assert';\nimport openBrowserAsync from 'better-opn';\nimport crypto from 'crypto';\nimport http from 'http';\nimport type { Socket } from 'node:net';\n\nimport * as Log from '../../log';\nimport { CommandError } from '../../utils/errors';\nimport { fetchAsync, getResponseDataOrThrow } from '../rest/client';\n\nconst CLIENT_ID = 'expo-cli';\n\nfunction generateCodeVerifier(): string {\n return crypto.randomBytes(32).toString('base64url');\n}\n\nfunction generateCodeChallenge(codeVerifier: string): string {\n return crypto.createHash('sha256').update(codeVerifier).digest('base64url');\n}\n\nfunction generateState(): string {\n return crypto.randomBytes(32).toString('base64url');\n}\n\nasync function exchangeCodeForSessionSecretAsync({\n code,\n codeVerifier,\n redirectUri,\n}: {\n code: string;\n codeVerifier: string;\n redirectUri: string;\n}): Promise<string> {\n const response = await fetchAsync('auth/token', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n grant_type: 'authorization_code',\n code,\n redirect_uri: redirectUri,\n code_verifier: codeVerifier,\n client_id: CLIENT_ID,\n }),\n });\n const { session_secret: sessionSecret } = getResponseDataOrThrow<{ session_secret?: string }>(\n await response.json()\n );\n if (!sessionSecret) {\n throw new CommandError('BROWSER_AUTH', 'Failed to obtain session secret from token exchange.');\n }\n return sessionSecret;\n}\n\nexport async function getSessionUsingBrowserAuthFlowAsync({\n expoWebsiteUrl,\n sso = false,\n}: {\n expoWebsiteUrl: string;\n sso?: boolean;\n}): Promise<string> {\n const scheme = 'http';\n const hostname = 'localhost';\n const callbackPath = '/auth/callback';\n\n const codeVerifier = generateCodeVerifier();\n const codeChallenge = generateCodeChallenge(codeVerifier);\n const state = generateState();\n\n const buildRedirectUri = (port: number): string =>\n `${scheme}://${hostname}:${port}${callbackPath}`;\n\n const buildExpoLoginUrl = (port: number, sso: boolean): string => {\n // Note: we avoid URLSearchParams here because better-opn calls encodeURI()\n // on the URL before passing it to AppleScript, which would double-encode\n // the percent-encoded values from URLSearchParams.toString().\n const params = [\n `client_id=${CLIENT_ID}`,\n `redirect_uri=${buildRedirectUri(port)}`,\n `response_type=code`,\n `code_challenge=${codeChallenge}`,\n `code_challenge_method=S256`,\n `state=${state}`,\n `confirm_account=true`,\n ].join('&');\n return `${expoWebsiteUrl}${sso ? '/sso-login' : '/login'}?${params}`;\n };\n\n // Start server and begin auth flow\n const executeAuthFlow = (): Promise<string> => {\n return new Promise<string>(async (resolve, reject) => {\n const connections = new Set<Socket>();\n\n const server = http.createServer(\n (request: http.IncomingMessage, response: http.ServerResponse) => {\n const redirectAndCleanup = (result: 'success' | 'error'): void => {\n const redirectUrl = `${expoWebsiteUrl}/oauth/expo-cli?result=${result}`;\n response.writeHead(302, { Location: redirectUrl });\n response.end();\n server.close();\n for (const connection of connections) {\n connection.destroy();\n }\n };\n\n const handleRequestAsync = async (): Promise<void> => {\n if (!(request.method === 'GET' && request.url?.includes(callbackPath))) {\n throw new CommandError('BROWSER_AUTH', 'Unexpected login response.');\n }\n const url = new URL(request.url, `http:${request.headers.host}`);\n const code = url.searchParams.get('code');\n const returnedState = url.searchParams.get('state');\n\n if (!code) {\n throw new CommandError('BROWSER_AUTH', 'Request missing code search parameter.');\n }\n if (returnedState !== state) {\n throw new CommandError('BROWSER_AUTH', 'State mismatch. Possible CSRF attack.');\n }\n\n const address = server.address();\n assert(address !== null && typeof address === 'object');\n const redirectUri = buildRedirectUri(address.port);\n\n const sessionSecret = await exchangeCodeForSessionSecretAsync({\n code,\n codeVerifier,\n redirectUri,\n });\n\n resolve(sessionSecret);\n redirectAndCleanup('success');\n };\n\n handleRequestAsync().catch((error) => {\n redirectAndCleanup('error');\n reject(error);\n });\n }\n );\n\n server.listen(0, hostname, () => {\n Log.log('Waiting for browser login...');\n\n const address = server.address();\n assert(\n address !== null && typeof address === 'object',\n 'Server address and port should be set after listening has begun'\n );\n const port = address.port;\n const authorizeUrl = buildExpoLoginUrl(port, sso);\n Log.log(\n `If your browser doesn't automatically open, visit this link to log in: ${authorizeUrl}`\n );\n openBrowserAsync(authorizeUrl);\n });\n\n server.on('connection', (connection) => {\n connections.add(connection);\n\n connection.on('close', () => {\n connections.delete(connection);\n });\n });\n });\n };\n\n return await executeAuthFlow();\n}\n"],"names":["getSessionUsingBrowserAuthFlowAsync","CLIENT_ID","generateCodeVerifier","crypto","randomBytes","toString","generateCodeChallenge","codeVerifier","createHash","update","digest","generateState","exchangeCodeForSessionSecretAsync","code","redirectUri","response","fetchAsync","method","headers","body","JSON","stringify","grant_type","redirect_uri","code_verifier","client_id","session_secret","sessionSecret","getResponseDataOrThrow","json","CommandError","expoWebsiteUrl","sso","scheme","hostname","callbackPath","codeChallenge","state","buildRedirectUri","port","buildExpoLoginUrl","params","join","executeAuthFlow","Promise","resolve","reject","connections","Set","server","http","createServer","request","redirectAndCleanup","result","redirectUrl","writeHead","Location","end","close","connection","destroy","handleRequestAsync","url","includes","URL","host","searchParams","get","returnedState","address","assert","catch","error","listen","Log","log","authorizeUrl","openBrowserAsync","on","add","delete"],"mappings":";;;;+BAqDsBA;;;eAAAA;;;;gEArDH;;;;;;;gEACU;;;;;;;gEACV;;;;;;;gEACF;;;;;;6DAGI;wBACQ;wBACsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEnD,MAAMC,YAAY;AAElB,SAASC;IACP,OAAOC,iBAAM,CAACC,WAAW,CAAC,IAAIC,QAAQ,CAAC;AACzC;AAEA,SAASC,sBAAsBC,YAAoB;IACjD,OAAOJ,iBAAM,CAACK,UAAU,CAAC,UAAUC,MAAM,CAACF,cAAcG,MAAM,CAAC;AACjE;AAEA,SAASC;IACP,OAAOR,iBAAM,CAACC,WAAW,CAAC,IAAIC,QAAQ,CAAC;AACzC;AAEA,eAAeO,kCAAkC,EAC/CC,IAAI,EACJN,YAAY,EACZO,WAAW,EAKZ;IACC,MAAMC,WAAW,MAAMC,IAAAA,kBAAU,EAAC,cAAc;QAC9CC,QAAQ;QACRC,SAAS;YAAE,gBAAgB;QAAmB;QAC9CC,MAAMC,KAAKC,SAAS,CAAC;YACnBC,YAAY;YACZT;YACAU,cAAcT;YACdU,eAAejB;YACfkB,WAAWxB;QACb;IACF;IACA,MAAM,EAAEyB,gBAAgBC,aAAa,EAAE,GAAGC,IAAAA,8BAAsB,EAC9D,MAAMb,SAASc,IAAI;IAErB,IAAI,CAACF,eAAe;QAClB,MAAM,IAAIG,oBAAY,CAAC,gBAAgB;IACzC;IACA,OAAOH;AACT;AAEO,eAAe3B,oCAAoC,EACxD+B,cAAc,EACdC,MAAM,KAAK,EAIZ;IACC,MAAMC,SAAS;IACf,MAAMC,WAAW;IACjB,MAAMC,eAAe;IAErB,MAAM5B,eAAeL;IACrB,MAAMkC,gBAAgB9B,sBAAsBC;IAC5C,MAAM8B,QAAQ1B;IAEd,MAAM2B,mBAAmB,CAACC,OACx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II,YAAY,CAACC,GAAG,CAAC;oBAClC,MAAMC,gBAAgBN,IAAII,YAAY,CAACC,GAAG,CAAC;oBAE3C,IAAI,CAACvD,MAAM;wBACT,MAAM,IAAIiB,oBAAY,CAAC,gBAAgB;oBACzC;oBACA,IAAIuC,kBAAkBhC,OAAO;wBAC3B,MAAM,IAAIP,oBAAY,CAAC,gBAAgB;oBACzC;oBAEA,MAAMwC,UAAUrB,OAAOqB,OAAO;oBAC9BC,IAAAA,iBAAM,EAACD,YAAY,QAAQ,OAAOA,YAAY;oBAC9C,MAAMxD,cAAcwB,iBAAiBgC,QAAQ/B,IAAI;oBAEjD,MAAMZ,gBAAgB,MAAMf,kCAAkC;wBAC5DC;wBACAN;wBACAO;oBACF;oBAEA+B,QAAQlB;oBACR0B,mBAAmB;gBACrB;gBAEAS,qBAAqBU,KAAK,CAAC,CAACC;oBAC1BpB,mBAAmB;oBACnBP,OAAO2B;gBACT;YACF;YAGFxB,OAAOyB,MAAM,CAAC,GAAGxC,UAAU;gBACzByC,KAAIC,GAAG,CAAC;gBAER,MAAMN,UAAUrB,OAAOqB,OAAO;gBAC9BC,IAAAA,iBAAM,EACJD,YAAY,QAAQ,OAAOA,YAAY,UACvC;gBAEF,MAAM/B,OAAO+B,QAAQ/B,IAAI;gBACzB,MAAMsC,eAAerC,kBAAkBD,MAAMP;gBAC7C2C,KAAIC,GAAG,CACL,CAAC,uEAAuE,EAAEC,cAAc;gBAE1FC,IAAAA,oBAAgB,EAACD;YACnB;YAEA5B,OAAO8B,EAAE,CAAC,cAAc,CAACnB;gBACvBb,YAAYiC,GAAG,CAACpB;gBAEhBA,WAAWmB,EAAE,CAAC,SAAS;oBACrBhC,YAAYkC,MAAM,CAACrB;gBACrB;YACF;QACF;IACF;IAEA,OAAO,MAAMjB;AACf"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/customize/typescript.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\n\nimport { Log } from '../log';\n\nexport async function typescript(projectRoot: string) {\n const { TypeScriptProjectPrerequisite } = await import(\n '../start/doctor/typescript/TypeScriptProjectPrerequisite.js'\n );\n const { MetroBundlerDevServer } = await import('../start/server/metro/MetroBundlerDevServer.js');\n const { getPlatformBundlers } = await import('../start/server/platformBundlers.js');\n\n try {\n await new TypeScriptProjectPrerequisite(projectRoot).bootstrapAsync();\n } catch (error: any) {\n // Ensure the process doesn't fail if the TypeScript check fails.\n // This could happen during the install.\n Log.log();\n Log.exception(error);\n return;\n }\n\n const { exp } = getConfig(projectRoot, { skipSDKVersionRequirement: true });\n await new MetroBundlerDevServer(projectRoot, getPlatformBundlers(projectRoot, exp), {\n isDevClient: true,\n }).startTypeScriptServices();\n}\n"],"names":["typescript","projectRoot","TypeScriptProjectPrerequisite","MetroBundlerDevServer","getPlatformBundlers","bootstrapAsync","error","Log","log","exception","exp","getConfig","skipSDKVersionRequirement","isDevClient","startTypeScriptServices"],"mappings":";;;;+BAIsBA;;;eAAAA;;;;yBAJI;;;;;;qBAEN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,eAAeA,WAAWC,WAAmB;IAClD,MAAM,EAAEC,6BAA6B,EAAE,GAAG,MAAM,mEAAA,QAC9C;IAEF,MAAM,EAAEC,qBAAqB,EAAE,GAAG,MAAM,mEAAA,QAAO;IAC/C,MAAM,EAAEC,mBAAmB,EAAE,GAAG,MAAM,mEAAA,QAAO;IAE7C,IAAI;QACF,MAAM,IAAIF,8BAA8BD,aAAaI,cAAc;IACrE,EAAE,OAAOC,OAAY;QACnB,iEAAiE;QACjE,wCAAwC;QACxCC,QAAG,CAACC,GAAG;QACPD,QAAG,CAACE,SAAS,CAACH;QACd;IACF;IAEA,MAAM,EAAEI,GAAG,EAAE,GAAGC,IAAAA,mBAAS,EAACV,aAAa;QAAEW,2BAA2B;IAAK;IACzE,MAAM,IAAIT,sBAAsBF,aAAaG,oBAAoBH,aAAaS,MAAM;QAClFG,aAAa;IACf,GAAGC,uBAAuB;AAC5B"}
1
+ {"version":3,"sources":["../../../src/customize/typescript.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\n\nimport { Log } from '../log';\n\nexport async function typescript(projectRoot: string) {\n const { TypeScriptProjectPrerequisite } =\n await import('../start/doctor/typescript/TypeScriptProjectPrerequisite.js');\n const { MetroBundlerDevServer } = await import('../start/server/metro/MetroBundlerDevServer.js');\n const { getPlatformBundlers } = await import('../start/server/platformBundlers.js');\n\n try {\n await new TypeScriptProjectPrerequisite(projectRoot).bootstrapAsync();\n } catch (error: any) {\n // Ensure the process doesn't fail if the TypeScript check fails.\n // This could happen during the install.\n Log.log();\n Log.exception(error);\n return;\n }\n\n const { exp } = getConfig(projectRoot, { skipSDKVersionRequirement: true });\n await new MetroBundlerDevServer(projectRoot, getPlatformBundlers(projectRoot, exp), {\n isDevClient: true,\n }).startTypeScriptServices();\n}\n"],"names":["typescript","projectRoot","TypeScriptProjectPrerequisite","MetroBundlerDevServer","getPlatformBundlers","bootstrapAsync","error","Log","log","exception","exp","getConfig","skipSDKVersionRequirement","isDevClient","startTypeScriptServices"],"mappings":";;;;+BAIsBA;;;eAAAA;;;;yBAJI;;;;;;qBAEN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,eAAeA,WAAWC,WAAmB;IAClD,MAAM,EAAEC,6BAA6B,EAAE,GACrC,MAAM,mEAAA,QAAO;IACf,MAAM,EAAEC,qBAAqB,EAAE,GAAG,MAAM,mEAAA,QAAO;IAC/C,MAAM,EAAEC,mBAAmB,EAAE,GAAG,MAAM,mEAAA,QAAO;IAE7C,IAAI;QACF,MAAM,IAAIF,8BAA8BD,aAAaI,cAAc;IACrE,EAAE,OAAOC,OAAY;QACnB,iEAAiE;QACjE,wCAAwC;QACxCC,QAAG,CAACC,GAAG;QACPD,QAAG,CAACE,SAAS,CAACH;QACd;IACF;IAEA,MAAM,EAAEI,GAAG,EAAE,GAAGC,IAAAA,mBAAS,EAACV,aAAa;QAAEW,2BAA2B;IAAK;IACzE,MAAM,IAAIT,sBAAsBF,aAAaG,oBAAoBH,aAAaS,MAAM;QAClFG,aAAa;IACf,GAAGC,uBAAuB;AAC5B"}
@@ -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.3" ?? 'UNVERSIONED'
79
+ version: "56.1.4" ?? 'UNVERSIONED'
80
80
  };
81
81
  }
82
82
  function getWellKnownTemporaryLogFile(projectRoot, command) {
@@ -84,13 +84,6 @@ function _private() {
84
84
  };
85
85
  return data;
86
86
  }
87
- function _https() {
88
- const data = /*#__PURE__*/ _interop_require_default(require("https"));
89
- _https = function() {
90
- return data;
91
- };
92
- return data;
93
- }
94
87
  function _path() {
95
88
  const data = /*#__PURE__*/ _interop_require_default(require("path"));
96
89
  _path = function() {
@@ -928,13 +921,13 @@ class MetroBundlerDevServer extends _BundlerDevServer.BundlerDevServer {
928
921
  apiRoutes: hasApiRoutes,
929
922
  exporting: !!options.isExporting
930
923
  });
931
- const { metro, hmrServer, server, middleware, messageSocket } = await (0, _instantiateMetro.instantiateMetroAsync)(this, parsedOptions, {
924
+ const { metro, hmrServer, address, server, middleware, messageSocket } = await (0, _instantiateMetro.instantiateMetroAsync)(this, parsedOptions, {
932
925
  isExporting: !!options.isExporting,
933
926
  exp
934
927
  });
935
- const protocol = server instanceof _https().default.Server ? 'https' : 'http';
936
928
  // Required for symbolication:
937
- process.env.EXPO_DEV_SERVER_ORIGIN = `${protocol}://localhost:${options.port}`;
929
+ const serverBaseUrl = `${(address == null ? void 0 : address.protocol) ?? 'http'}://localhost:${(address == null ? void 0 : address.port) ?? options.port}`;
930
+ process.env.EXPO_DEV_SERVER_ORIGIN = serverBaseUrl;
938
931
  if (!options.isExporting) {
939
932
  var _metro__config_server, _metro__config;
940
933
  const manifestMiddleware = await this.getManifestMiddlewareAsync(options);
@@ -1131,11 +1124,11 @@ class MetroBundlerDevServer extends _BundlerDevServer.BundlerDevServer {
1131
1124
  server,
1132
1125
  location: {
1133
1126
  // The port is the main thing we want to send back.
1134
- port: options.port,
1127
+ port: (address == null ? void 0 : address.port) ?? options.port,
1135
1128
  // localhost isn't always correct.
1136
1129
  host: 'localhost',
1137
- url: `${protocol}://localhost:${options.port}`,
1138
- protocol
1130
+ url: serverBaseUrl,
1131
+ protocol: (address == null ? void 0 : address.protocol) ?? 'http'
1139
1132
  },
1140
1133
  middleware,
1141
1134
  messageSocket