@expo/cli 0.4.6 → 0.4.7

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
@@ -121,7 +121,7 @@ const args = (0, _arg).default({
121
121
  });
122
122
  if (args["--version"]) {
123
123
  // Version is added in the build script.
124
- console.log("0.4.6");
124
+ console.log("0.4.7");
125
125
  process.exit(0);
126
126
  }
127
127
  if (args["--non-interactive"]) {
@@ -248,7 +248,7 @@ commands[command]().then((exec)=>{
248
248
  logEventAsync("action", {
249
249
  action: `expo ${command}`,
250
250
  source: "expo/cli",
251
- source_version: "0.4.6"
251
+ source_version: "0.4.7"
252
252
  });
253
253
  });
254
254
 
@@ -15,6 +15,7 @@ var _fileSystemCache = require("./cache/FileSystemCache");
15
15
  var _wrapFetchWithCache = require("./cache/wrapFetchWithCache");
16
16
  var _wrapFetchWithBaseUrl = require("./wrapFetchWithBaseUrl");
17
17
  var _wrapFetchWithOffline = require("./wrapFetchWithOffline");
18
+ var _wrapFetchWithProgress = require("./wrapFetchWithProgress");
18
19
  var _wrapFetchWithProxy = require("./wrapFetchWithProxy");
19
20
  function _interopRequireDefault(obj) {
20
21
  return obj && obj.__esModule ? obj : {
@@ -80,18 +81,18 @@ function wrapFetchWithCredentials(fetchFunction) {
80
81
  const fetchWithOffline = (0, _wrapFetchWithOffline).wrapFetchWithOffline(_nodeFetch.default);
81
82
  const fetchWithBaseUrl = (0, _wrapFetchWithBaseUrl).wrapFetchWithBaseUrl(fetchWithOffline, (0, _endpoint).getExpoApiBaseUrl() + "/v2/");
82
83
  const fetchWithProxy = (0, _wrapFetchWithProxy).wrapFetchWithProxy(fetchWithBaseUrl);
83
- const fetchWithCredentials = wrapFetchWithCredentials(fetchWithProxy);
84
- function createCachedFetch({ fetch , cacheDirectory , ttl , skipCache }) {
84
+ const fetchWithCredentials = (0, _wrapFetchWithProgress).wrapFetchWithProgress(wrapFetchWithCredentials(fetchWithProxy));
85
+ function createCachedFetch({ fetch =fetchWithCredentials , cacheDirectory , ttl , skipCache }) {
85
86
  // Disable all caching in EXPO_BETA.
86
87
  if (skipCache || _env.env.EXPO_BETA || _env.env.EXPO_NO_CACHE) {
87
- return fetch != null ? fetch : fetchWithCredentials;
88
+ return fetch;
88
89
  }
89
- return (0, _wrapFetchWithCache).wrapFetchWithCache(fetch != null ? fetch : fetchWithCredentials, new _fileSystemCache.FileSystemCache({
90
+ return (0, _wrapFetchWithCache).wrapFetchWithCache(fetch, new _fileSystemCache.FileSystemCache({
90
91
  cacheDirectory: _path.default.join((0, _getUserState).getExpoHomeDirectory(), cacheDirectory),
91
92
  ttl
92
93
  }));
93
94
  }
94
- const fetchAsync = wrapFetchWithCredentials(fetchWithProxy);
95
+ const fetchAsync = (0, _wrapFetchWithProgress).wrapFetchWithProgress(wrapFetchWithCredentials(fetchWithProxy));
95
96
  exports.fetchAsync = fetchAsync;
96
97
 
97
98
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/api/rest/client.ts"],"sourcesContent":["import { getExpoHomeDirectory } from '@expo/config/build/getUserState';\nimport { JSONValue } from '@expo/json-file';\nimport fetchInstance from 'node-fetch';\nimport path from 'path';\n\nimport { env } from '../../utils/env';\nimport { getExpoApiBaseUrl } from '../endpoint';\nimport UserSettings from '../user/UserSettings';\nimport { FileSystemCache } from './cache/FileSystemCache';\nimport { wrapFetchWithCache } from './cache/wrapFetchWithCache';\nimport { FetchLike } from './client.types';\nimport { wrapFetchWithBaseUrl } from './wrapFetchWithBaseUrl';\nimport { wrapFetchWithOffline } from './wrapFetchWithOffline';\nimport { wrapFetchWithProxy } from './wrapFetchWithProxy';\n\nexport class ApiV2Error extends Error {\n readonly name = 'ApiV2Error';\n readonly code: string;\n readonly expoApiV2ErrorCode: string;\n readonly expoApiV2ErrorDetails?: JSONValue;\n readonly expoApiV2ErrorServerStack?: string;\n readonly expoApiV2ErrorMetadata?: object;\n\n constructor(response: {\n message: string;\n code: string;\n stack?: string;\n details?: JSONValue;\n metadata?: object;\n }) {\n super(response.message);\n this.code = response.code;\n this.expoApiV2ErrorCode = response.code;\n this.expoApiV2ErrorDetails = response.details;\n this.expoApiV2ErrorServerStack = response.stack;\n this.expoApiV2ErrorMetadata = response.metadata;\n }\n}\n\n/**\n * An Expo server error that didn't return the expected error JSON information.\n * The only 'expected' place for this is in testing, all other cases are bugs with the server.\n */\nexport class UnexpectedServerError extends Error {\n readonly name = 'UnexpectedServerError';\n}\n\n/**\n * @returns a `fetch` function that will inject user authentication information and handle errors from the Expo API.\n */\nexport function wrapFetchWithCredentials(fetchFunction: FetchLike): FetchLike {\n return async function fetchWithCredentials(url, options = {}) {\n if (Array.isArray(options.headers)) {\n throw new Error('request headers must be in object form');\n }\n\n const resolvedHeaders = options.headers ?? ({} as any);\n\n const token = UserSettings.getAccessToken();\n if (token) {\n resolvedHeaders.authorization = `Bearer ${token}`;\n } else {\n const sessionSecret = UserSettings.getSession()?.sessionSecret;\n if (sessionSecret) {\n resolvedHeaders['expo-session'] = sessionSecret;\n }\n }\n\n const results = await fetchFunction(url, {\n ...options,\n headers: resolvedHeaders,\n });\n\n if (results.status >= 400 && results.status < 500) {\n const body = await results.text();\n try {\n const data = JSON.parse(body);\n if (data?.errors?.length) {\n throw new ApiV2Error(data.errors[0]);\n }\n } catch (error: any) {\n // Server returned non-json response.\n if (error.message.includes('in JSON at position')) {\n throw new UnexpectedServerError(body);\n }\n throw error;\n }\n }\n return results;\n };\n}\n\nconst fetchWithOffline = wrapFetchWithOffline(fetchInstance);\n\nconst fetchWithBaseUrl = wrapFetchWithBaseUrl(fetchWithOffline, getExpoApiBaseUrl() + '/v2/');\n\nconst fetchWithProxy = wrapFetchWithProxy(fetchWithBaseUrl);\n\nconst fetchWithCredentials = wrapFetchWithCredentials(fetchWithProxy);\n\n/**\n * Create an instance of the fully qualified fetch command (auto authentication and api) but with caching in the '~/.expo' directory.\n * Caching is disabled automatically if the EXPO_NO_CACHE or EXPO_BETA environment variables are enabled.\n */\nexport function createCachedFetch({\n fetch,\n cacheDirectory,\n ttl,\n skipCache,\n}: {\n fetch?: FetchLike;\n cacheDirectory: string;\n ttl?: number;\n skipCache?: boolean;\n}): FetchLike {\n // Disable all caching in EXPO_BETA.\n if (skipCache || env.EXPO_BETA || env.EXPO_NO_CACHE) {\n return fetch ?? fetchWithCredentials;\n }\n\n return wrapFetchWithCache(\n fetch ?? fetchWithCredentials,\n new FileSystemCache({\n cacheDirectory: path.join(getExpoHomeDirectory(), cacheDirectory),\n ttl,\n })\n );\n}\n\n/** Instance of fetch with automatic base URL pointing to the Expo API, user credential injection, and API error handling. Caching not included. */\nexport const fetchAsync = wrapFetchWithCredentials(fetchWithProxy);\n"],"names":["wrapFetchWithCredentials","createCachedFetch","ApiV2Error","Error","name","constructor","response","message","code","expoApiV2ErrorCode","expoApiV2ErrorDetails","details","expoApiV2ErrorServerStack","stack","expoApiV2ErrorMetadata","metadata","UnexpectedServerError","fetchFunction","fetchWithCredentials","url","options","Array","isArray","headers","resolvedHeaders","token","UserSettings","getAccessToken","authorization","sessionSecret","getSession","results","status","body","text","data","JSON","parse","errors","length","error","includes","fetchWithOffline","wrapFetchWithOffline","fetchInstance","fetchWithBaseUrl","wrapFetchWithBaseUrl","getExpoApiBaseUrl","fetchWithProxy","wrapFetchWithProxy","fetch","cacheDirectory","ttl","skipCache","env","EXPO_BETA","EXPO_NO_CACHE","wrapFetchWithCache","FileSystemCache","path","join","getExpoHomeDirectory","fetchAsync"],"mappings":"AAAA;;;;QAkDgBA,wBAAwB,GAAxBA,wBAAwB;QAsDxBC,iBAAiB,GAAjBA,iBAAiB;;AAxGI,IAAA,aAAiC,WAAjC,iCAAiC,CAAA;AAE5C,IAAA,UAAY,kCAAZ,YAAY,EAAA;AACrB,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEH,IAAA,IAAiB,WAAjB,iBAAiB,CAAA;AACH,IAAA,SAAa,WAAb,aAAa,CAAA;AACtB,IAAA,a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D,OAAOT,OAAO,CAAC;KAChB,CAAC;CACH;AAED,MAAMW,gBAAgB,GAAGC,CAAAA,GAAAA,qBAAoB,AAAe,CAAA,qBAAf,CAACC,UAAa,QAAA,CAAC,AAAC;AAE7D,MAAMC,gBAAgB,GAAGC,CAAAA,GAAAA,qBAAoB,AAAgD,CAAA,qBAAhD,CAACJ,gBAAgB,EAAEK,CAAAA,GAAAA,SAAiB,AAAE,CAAA,kBAAF,EAAE,GAAG,MAAM,CAAC,AAAC;AAE9F,MAAMC,cAAc,GAAGC,CAAAA,GAAAA,mBAAkB,AAAkB,CAAA,mBAAlB,CAACJ,gBAAgB,CAAC,AAAC;AAE5D,MAAM3B,oBAAoB,GAAGlB,wBAAwB,CAACgD,cAAc,CAAC,AAAC;AAM/D,SAAS/C,iBAAiB,CAAC,EAChCiD,KAAK,CAAA,EACLC,cAAc,CAAA,EACdC,GAAG,CAAA,EACHC,SAAS,CAAA,EAMV,EAAa;IACZ,oCAAoC;IACpC,IAAIA,SAAS,IAAIC,IAAG,IAAA,CAACC,SAAS,IAAID,IAAG,IAAA,CAACE,aAAa,EAAE;QACnD,OAAON,KAAK,WAALA,KAAK,GAAIhC,oBAAoB,CAAC;KACtC;IAED,OAAOuC,CAAAA,GAAAA,mBAAkB,AAMxB,CAAA,mBANwB,CACvBP,KAAK,WAALA,KAAK,GAAIhC,oBAAoB,EAC7B,IAAIwC,gBAAe,gBAAA,CAAC;QAClBP,cAAc,EAAEQ,KAAI,QAAA,CAACC,IAAI,CAACC,CAAAA,GAAAA,aAAoB,AAAE,CAAA,qBAAF,EAAE,EAAEV,cAAc,CAAC;QACjEC,GAAG;KACJ,CAAC,CACH,CAAC;CACH;AAGM,MAAMU,UAAU,GAAG9D,wBAAwB,CAACgD,cAAc,CAAC,AAAC;QAAtDc,UAAU,GAAVA,UAAU"}
1
+ {"version":3,"sources":["../../../../src/api/rest/client.ts"],"sourcesContent":["import { getExpoHomeDirectory } from '@expo/config/build/getUserState';\nimport { JSONValue } from '@expo/json-file';\nimport fetchInstance from 'node-fetch';\nimport path from 'path';\n\nimport { env } from '../../utils/env';\nimport { getExpoApiBaseUrl } from '../endpoint';\nimport UserSettings from '../user/UserSettings';\nimport { FileSystemCache } from './cache/FileSystemCache';\nimport { wrapFetchWithCache } from './cache/wrapFetchWithCache';\nimport { FetchLike } from './client.types';\nimport { wrapFetchWithBaseUrl } from './wrapFetchWithBaseUrl';\nimport { wrapFetchWithOffline } from './wrapFetchWithOffline';\nimport { wrapFetchWithProgress } from './wrapFetchWithProgress';\nimport { wrapFetchWithProxy } from './wrapFetchWithProxy';\n\nexport class ApiV2Error extends Error {\n readonly name = 'ApiV2Error';\n readonly code: string;\n readonly expoApiV2ErrorCode: string;\n readonly expoApiV2ErrorDetails?: JSONValue;\n readonly expoApiV2ErrorServerStack?: string;\n readonly expoApiV2ErrorMetadata?: object;\n\n constructor(response: {\n message: string;\n code: string;\n stack?: string;\n details?: JSONValue;\n metadata?: object;\n }) {\n super(response.message);\n this.code = response.code;\n this.expoApiV2ErrorCode = response.code;\n this.expoApiV2ErrorDetails = response.details;\n this.expoApiV2ErrorServerStack = response.stack;\n this.expoApiV2ErrorMetadata = response.metadata;\n }\n}\n\n/**\n * An Expo server error that didn't return the expected error JSON information.\n * The only 'expected' place for this is in testing, all other cases are bugs with the server.\n */\nexport class UnexpectedServerError extends Error {\n readonly name = 'UnexpectedServerError';\n}\n\n/**\n * @returns a `fetch` function that will inject user authentication information and handle errors from the Expo API.\n */\nexport function wrapFetchWithCredentials(fetchFunction: FetchLike): FetchLike {\n return async function fetchWithCredentials(url, options = {}) {\n if (Array.isArray(options.headers)) {\n throw new Error('request headers must be in object form');\n }\n\n const resolvedHeaders = options.headers ?? ({} as any);\n\n const token = UserSettings.getAccessToken();\n if (token) {\n resolvedHeaders.authorization = `Bearer ${token}`;\n } else {\n const sessionSecret = UserSettings.getSession()?.sessionSecret;\n if (sessionSecret) {\n resolvedHeaders['expo-session'] = sessionSecret;\n }\n }\n\n const results = await fetchFunction(url, {\n ...options,\n headers: resolvedHeaders,\n });\n\n if (results.status >= 400 && results.status < 500) {\n const body = await results.text();\n try {\n const data = JSON.parse(body);\n if (data?.errors?.length) {\n throw new ApiV2Error(data.errors[0]);\n }\n } catch (error: any) {\n // Server returned non-json response.\n if (error.message.includes('in JSON at position')) {\n throw new UnexpectedServerError(body);\n }\n throw error;\n }\n }\n return results;\n };\n}\n\nconst fetchWithOffline = wrapFetchWithOffline(fetchInstance);\n\nconst fetchWithBaseUrl = wrapFetchWithBaseUrl(fetchWithOffline, getExpoApiBaseUrl() + '/v2/');\n\nconst fetchWithProxy = wrapFetchWithProxy(fetchWithBaseUrl);\n\nconst fetchWithCredentials = wrapFetchWithProgress(wrapFetchWithCredentials(fetchWithProxy));\n\n/**\n * Create an instance of the fully qualified fetch command (auto authentication and api) but with caching in the '~/.expo' directory.\n * Caching is disabled automatically if the EXPO_NO_CACHE or EXPO_BETA environment variables are enabled.\n */\nexport function createCachedFetch({\n fetch = fetchWithCredentials,\n cacheDirectory,\n ttl,\n skipCache,\n}: {\n fetch?: FetchLike;\n cacheDirectory: string;\n ttl?: number;\n skipCache?: boolean;\n}): FetchLike {\n // Disable all caching in EXPO_BETA.\n if (skipCache || env.EXPO_BETA || env.EXPO_NO_CACHE) {\n return fetch;\n }\n\n return wrapFetchWithCache(\n fetch,\n new FileSystemCache({\n cacheDirectory: path.join(getExpoHomeDirectory(), cacheDirectory),\n ttl,\n })\n );\n}\n\n/** Instance of fetch with automatic base URL pointing to the Expo API, user credential injection, and API error handling. Caching not included. */\nexport const fetchAsync = wrapFetchWithProgress(wrapFetchWithCredentials(fetchWithProxy));\n"],"names":["wrapFetchWithCredentials","createCachedFetch","ApiV2Error","Error","name","constructor","response","message","code","expoApiV2ErrorCode","expoApiV2ErrorDetails","details","expoApiV2ErrorServerStack","stack","expoApiV2ErrorMetadata","metadata","UnexpectedServerError","fetchFunction","fetchWithCredentials","url","options","Array","isArray","headers","resolvedHeaders","token","UserSettings","getAccessToken","authorization","sessionSecret","getSession","results","status","body","text","data","JSON","parse","errors","length","error","includes","fetchWithOffline","wrapFetchWithOffline","fetchInstance","fetchWithBaseUrl","wrapFetchWithBaseUrl","getExpoApiBaseUrl","fetchWithProxy","wrapFetchWithProxy","wrapFetchWithProgress","fetch","cacheDirectory","ttl","skipCache","env","EXPO_BETA","EXPO_NO_CACHE","wrapFetchWithCache","FileSystemCache","path","join","getExpoHomeDirectory","fetchAsync"],"mappings":"AAAA;;;;QAmDgBA,wBAAwB,GAAxBA,wBAAwB;QAsDxBC,iBAAiB,GAAjBA,iBAAiB;;AAzGI,IAAA,aAAiC,WAAjC,iCAAiC,CAAA;AAE5C,IAAA,UAAY,kCAAZ,YAAY,EAAA;AACrB,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEH,IAAA,IAAiB,WAAjB,iBAAiB,CAAA;AACH,IAAA,SAAa,WAAb,aAAa,CAAA;AACtB,IAAA,aAAsB,kCAAtB,sBAAsB,EAAA;AACf,IAAA,gBAAyB,WAAzB,yBAAyB,CAAA;AACtB,IAAA,mBAA4B,WAA5B,4BAA4B,CAAA;AAE1B,IAAA,qBAAwB,WAAxB,wBAAwB,CAAA;AACxB,IAAA,qBAAwB,WAAxB,wBAAwB,CAAA;AACvB,IAAA,sBAAyB,WAAzB,yBAAyB,CAAA;AAC5B,IAAA,mBAAsB,WAAtB,sBAAsB,CAAA;;;;;;AAElD,MAAMC,UAAU,SAASC,KAAK;IACnC,AAASC,IAAI,GAAG,YAAY,CAAC;IAO7BC,YAAYC,QAMX,CAAE;QACD,KAAK,CAACA,QAAQ,CAACC,OAAO,CAAC,CAAC;QACxB,IAAI,CAACC,IAAI,GAAGF,QAAQ,CAACE,IAAI,CAAC;QAC1B,IAAI,CAACC,kBAAkB,GAAGH,QAAQ,CAACE,IAAI,CAAC;QACxC,IAAI,CAACE,qBAAqB,GAAGJ,QAAQ,CAACK,OAAO,CAAC;QAC9C,IAAI,CAACC,yBAAyB,GAAGN,QAAQ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,cAAc,CAAA,EACdC,GAAG,CAAA,EACHC,SAAS,CAAA,EAMV,EAAa;IACZ,oCAAoC;IACpC,IAAIA,SAAS,IAAIC,IAAG,IAAA,CAACC,SAAS,IAAID,IAAG,IAAA,CAACE,aAAa,EAAE;QACnD,OAAON,KAAK,CAAC;KACd;IAED,OAAOO,CAAAA,GAAAA,mBAAkB,AAMxB,CAAA,mBANwB,CACvBP,KAAK,EACL,IAAIQ,gBAAe,gBAAA,CAAC;QAClBP,cAAc,EAAEQ,KAAI,QAAA,CAACC,IAAI,CAACC,CAAAA,GAAAA,aAAoB,AAAE,CAAA,qBAAF,EAAE,EAAEV,cAAc,CAAC;QACjEC,GAAG;KACJ,CAAC,CACH,CAAC;CACH;AAGM,MAAMU,UAAU,GAAGb,CAAAA,GAAAA,sBAAqB,AAA0C,CAAA,sBAA1C,CAAClD,wBAAwB,CAACgD,cAAc,CAAC,CAAC,AAAC;QAA7Ee,UAAU,GAAVA,UAAU"}
@@ -6,6 +6,7 @@ exports.wrapFetchWithBaseUrl = wrapFetchWithBaseUrl;
6
6
  var _url = require("url");
7
7
  const debug = require("debug")("expo:api:fetch:base");
8
8
  function wrapFetchWithBaseUrl(fetch, baseUrl) {
9
+ // NOTE(EvanBacon): DO NOT RETURN AN ASYNC WRAPPER. THIS BREAKS LOADING INDICATORS.
9
10
  return (url, init)=>{
10
11
  if (typeof url !== "string") {
11
12
  throw new TypeError("Custom fetch function only accepts a string URL as the first parameter");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/api/rest/wrapFetchWithBaseUrl.ts"],"sourcesContent":["import { URL } from 'url';\n\nimport { FetchLike } from './client.types';\n\nconst debug = require('debug')('expo:api:fetch:base') as typeof console.log;\n\n/**\n * Wrap a fetch function with support for a predefined base URL.\n * This implementation works like the browser fetch, applying the input to a prefix base URL.\n */\nexport function wrapFetchWithBaseUrl(fetch: FetchLike, baseUrl: string): FetchLike {\n return (url, init) => {\n if (typeof url !== 'string') {\n throw new TypeError('Custom fetch function only accepts a string URL as the first parameter');\n }\n const parsed = new URL(url, baseUrl);\n if (init?.searchParams) {\n parsed.search = init.searchParams.toString();\n }\n debug('fetch:', parsed.toString().trim());\n return fetch(parsed.toString(), init);\n };\n}\n"],"names":["wrapFetchWithBaseUrl","debug","require","fetch","baseUrl","url","init","TypeError","parsed","URL","searchParams","search","toString","trim"],"mappings":"AAAA;;;;QAUgBA,oBAAoB,GAApBA,oBAAoB;AAVhB,IAAA,IAAK,WAAL,KAAK,CAAA;AAIzB,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,qBAAqB,CAAC,AAAsB,AAAC;AAMrE,SAASF,oBAAoB,CAACG,KAAgB,EAAEC,OAAe,EAAa;IACjF,OAAO,CAACC,GAAG,EAAEC,IAAI,GAAK;QACpB,IAAI,OAAOD,GAAG,KAAK,QAAQ,EAAE;YAC3B,MAAM,IAAIE,SAAS,CAAC,wEAAwE,CAAC,CAAC;SAC/F;QACD,MAAMC,MAAM,GAAG,IAAIC,IAAG,IAAA,CAACJ,GAAG,EAAED,OAAO,CAAC,AAAC;QACrC,IAAIE,IAAI,QAAc,GAAlBA,KAAAA,CAAkB,GAAlBA,IAAI,CAAEI,YAAY,EAAE;YACtBF,MAAM,CAACG,MAAM,GAAGL,IAAI,CAACI,YAAY,CAACE,QAAQ,EAAE,CAAC;SAC9C;QACDX,KAAK,CAAC,QAAQ,EAAEO,MAAM,CAACI,QAAQ,EAAE,CAACC,IAAI,EAAE,CAAC,CAAC;QAC1C,OAAOV,KAAK,CAACK,MAAM,CAACI,QAAQ,EAAE,EAAEN,IAAI,CAAC,CAAC;KACvC,CAAC;CACH"}
1
+ {"version":3,"sources":["../../../../src/api/rest/wrapFetchWithBaseUrl.ts"],"sourcesContent":["import { URL } from 'url';\n\nimport { FetchLike } from './client.types';\n\nconst debug = require('debug')('expo:api:fetch:base') as typeof console.log;\n\n/**\n * Wrap a fetch function with support for a predefined base URL.\n * This implementation works like the browser fetch, applying the input to a prefix base URL.\n */\nexport function wrapFetchWithBaseUrl(fetch: FetchLike, baseUrl: string): FetchLike {\n // NOTE(EvanBacon): DO NOT RETURN AN ASYNC WRAPPER. THIS BREAKS LOADING INDICATORS.\n return (url, init) => {\n if (typeof url !== 'string') {\n throw new TypeError('Custom fetch function only accepts a string URL as the first parameter');\n }\n const parsed = new URL(url, baseUrl);\n if (init?.searchParams) {\n parsed.search = init.searchParams.toString();\n }\n debug('fetch:', parsed.toString().trim());\n return fetch(parsed.toString(), init);\n };\n}\n"],"names":["wrapFetchWithBaseUrl","debug","require","fetch","baseUrl","url","init","TypeError","parsed","URL","searchParams","search","toString","trim"],"mappings":"AAAA;;;;QAUgBA,oBAAoB,GAApBA,oBAAoB;AAVhB,IAAA,IAAK,WAAL,KAAK,CAAA;AAIzB,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,qBAAqB,CAAC,AAAsB,AAAC;AAMrE,SAASF,oBAAoB,CAACG,KAAgB,EAAEC,OAAe,EAAa;IACjF,mFAAmF;IACnF,OAAO,CAACC,GAAG,EAAEC,IAAI,GAAK;QACpB,IAAI,OAAOD,GAAG,KAAK,QAAQ,EAAE;YAC3B,MAAM,IAAIE,SAAS,CAAC,wEAAwE,CAAC,CAAC;SAC/F;QACD,MAAMC,MAAM,GAAG,IAAIC,IAAG,IAAA,CAACJ,GAAG,EAAED,OAAO,CAAC,AAAC;QACrC,IAAIE,IAAI,QAAc,GAAlBA,KAAAA,CAAkB,GAAlBA,IAAI,CAAEI,YAAY,EAAE;YACtBF,MAAM,CAACG,MAAM,GAAGL,IAAI,CAACI,YAAY,CAACE,QAAQ,EAAE,CAAC;SAC9C;QACDX,KAAK,CAAC,QAAQ,EAAEO,MAAM,CAACI,QAAQ,EAAE,CAACC,IAAI,EAAE,CAAC,CAAC;QAC1C,OAAOV,KAAK,CAACK,MAAM,CAACI,QAAQ,EAAE,EAAEN,IAAI,CAAC,CAAC;KACvC,CAAC;CACH"}
@@ -6,7 +6,8 @@ exports.wrapFetchWithOffline = wrapFetchWithOffline;
6
6
  var _settings = require("../settings");
7
7
  const debug = require("debug")("expo:api:fetch:offline");
8
8
  function wrapFetchWithOffline(fetchFunction) {
9
- return async function fetchWithOffline(url, options = {}) {
9
+ // NOTE(EvanBacon): DO NOT RETURN AN ASYNC WRAPPER. THIS BREAKS LOADING INDICATORS.
10
+ return function fetchWithOffline(url, options = {}) {
10
11
  if (_settings.APISettings.isOffline) {
11
12
  debug("Skipping network request: " + url);
12
13
  options.timeout = 1;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/api/rest/wrapFetchWithOffline.ts"],"sourcesContent":["import { APISettings } from '../settings';\nimport { FetchLike } from './client.types';\n\nconst debug = require('debug')('expo:api:fetch:offline') as typeof console.log;\n\n/** Wrap fetch with support for APISettings offline mode. */\nexport function wrapFetchWithOffline(fetchFunction: FetchLike): FetchLike {\n return async function fetchWithOffline(url, options = {}) {\n if (APISettings.isOffline) {\n debug('Skipping network request: ' + url);\n options.timeout = 1;\n }\n return fetchFunction(url, options);\n };\n}\n"],"names":["wrapFetchWithOffline","debug","require","fetchFunction","fetchWithOffline","url","options","APISettings","isOffline","timeout"],"mappings":"AAAA;;;;QAMgBA,oBAAoB,GAApBA,oBAAoB;AANR,IAAA,SAAa,WAAb,aAAa,CAAA;AAGzC,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,wBAAwB,CAAC,AAAsB,AAAC;AAGxE,SAASF,oBAAoB,CAACG,aAAwB,EAAa;IACxE,OAAO,eAAeC,gBAAgB,CAACC,GAAG,EAAEC,OAAO,GAAG,EAAE,EAAE;QACxD,IAAIC,SAAW,YAAA,CAACC,SAAS,EAAE;YACzBP,KAAK,CAAC,4BAA4B,GAAGI,GAAG,CAAC,CAAC;YAC1CC,OAAO,CAACG,OAAO,GAAG,CAAC,CAAC;SACrB;QACD,OAAON,aAAa,CAACE,GAAG,EAAEC,OAAO,CAAC,CAAC;KACpC,CAAC;CACH"}
1
+ {"version":3,"sources":["../../../../src/api/rest/wrapFetchWithOffline.ts"],"sourcesContent":["import { APISettings } from '../settings';\nimport { FetchLike } from './client.types';\n\nconst debug = require('debug')('expo:api:fetch:offline') as typeof console.log;\n\n/** Wrap fetch with support for APISettings offline mode. */\nexport function wrapFetchWithOffline(fetchFunction: FetchLike): FetchLike {\n // NOTE(EvanBacon): DO NOT RETURN AN ASYNC WRAPPER. THIS BREAKS LOADING INDICATORS.\n return function fetchWithOffline(url, options = {}) {\n if (APISettings.isOffline) {\n debug('Skipping network request: ' + url);\n options.timeout = 1;\n }\n return fetchFunction(url, options);\n };\n}\n"],"names":["wrapFetchWithOffline","debug","require","fetchFunction","fetchWithOffline","url","options","APISettings","isOffline","timeout"],"mappings":"AAAA;;;;QAMgBA,oBAAoB,GAApBA,oBAAoB;AANR,IAAA,SAAa,WAAb,aAAa,CAAA;AAGzC,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,wBAAwB,CAAC,AAAsB,AAAC;AAGxE,SAASF,oBAAoB,CAACG,aAAwB,EAAa;IACxE,mFAAmF;IACnF,OAAO,SAASC,gBAAgB,CAACC,GAAG,EAAEC,OAAO,GAAG,EAAE,EAAE;QAClD,IAAIC,SAAW,YAAA,CAACC,SAAS,EAAE;YACzBP,KAAK,CAAC,4BAA4B,GAAGI,GAAG,CAAC,CAAC;YAC1CC,OAAO,CAACG,OAAO,GAAG,CAAC,CAAC;SACrB;QACD,OAAON,aAAa,CAACE,GAAG,EAAEC,OAAO,CAAC,CAAC;KACpC,CAAC;CACH"}
@@ -25,34 +25,39 @@ function _interopRequireWildcard(obj) {
25
25
  return newObj;
26
26
  }
27
27
  }
28
+ const debug = require("debug")("expo:api:fetch:progress");
28
29
  function wrapFetchWithProgress(fetch) {
29
- return async (url, init)=>{
30
- const res = await fetch(url, init);
31
- if (res.ok && (init == null ? void 0 : init.onProgress)) {
32
- const totalDownloadSize = res.headers.get("Content-Length");
33
- const total = Number(totalDownloadSize);
34
- if (!totalDownloadSize || isNaN(total) || total < 0) {
35
- Log.warn('Progress callback not supported for network request because "Content-Length" header missing or invalid in response from URL:', url.toString());
36
- return res;
37
- }
38
- let length = 0;
39
- res.body.on("data", (chunk)=>{
40
- length += chunk.length;
41
- onProgress();
42
- });
43
- res.body.on("end", ()=>{
44
- onProgress();
45
- });
46
- const onProgress = ()=>{
47
- const progress = length / total;
48
- init.onProgress == null ? void 0 : init.onProgress({
49
- progress,
50
- total,
51
- loaded: length
30
+ return (url, init)=>{
31
+ return fetch(url, init).then((res)=>{
32
+ if (res.ok && (init == null ? void 0 : init.onProgress)) {
33
+ const totalDownloadSize = res.headers.get("Content-Length");
34
+ const total = Number(totalDownloadSize);
35
+ debug(`Download size: ${totalDownloadSize}`);
36
+ if (!totalDownloadSize || isNaN(total) || total < 0) {
37
+ Log.warn('Progress callback not supported for network request because "Content-Length" header missing or invalid in response from URL:', url.toString());
38
+ return res;
39
+ }
40
+ let length = 0;
41
+ debug(`Starting progress animation for ${url}`);
42
+ res.body.on("data", (chunk)=>{
43
+ length += Buffer.byteLength(chunk);
44
+ onProgress();
52
45
  });
53
- };
54
- }
55
- return res;
46
+ res.body.on("end", ()=>{
47
+ debug(`Finished progress animation for ${url}`);
48
+ onProgress();
49
+ });
50
+ const onProgress = ()=>{
51
+ const progress = length / total || 0;
52
+ init.onProgress == null ? void 0 : init.onProgress({
53
+ progress,
54
+ total,
55
+ loaded: length
56
+ });
57
+ };
58
+ }
59
+ return res;
60
+ });
56
61
  };
57
62
  }
58
63
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/api/rest/wrapFetchWithProgress.ts"],"sourcesContent":["import * as Log from '../../log';\nimport { FetchLike } from './client.types';\n\nexport function wrapFetchWithProgress(fetch: FetchLike): FetchLike {\n return async (url, init) => {\n const res = await fetch(url, init);\n if (res.ok && init?.onProgress) {\n const totalDownloadSize = res.headers.get('Content-Length');\n const total = Number(totalDownloadSize);\n\n if (!totalDownloadSize || isNaN(total) || total < 0) {\n Log.warn(\n 'Progress callback not supported for network request because \"Content-Length\" header missing or invalid in response from URL:',\n url.toString()\n );\n return res;\n }\n\n let length = 0;\n\n res.body.on('data', (chunk) => {\n length += chunk.length;\n onProgress();\n });\n\n res.body.on('end', () => {\n onProgress();\n });\n\n const onProgress = () => {\n const progress = length / total;\n\n init.onProgress?.({\n progress,\n total,\n loaded: length,\n });\n };\n }\n return res;\n };\n}\n"],"names":["wrapFetchWithProgress","Log","fetch","url","init","res","ok","onProgress","totalDownloadSize","headers","get","total","Number","isNaN","warn","toString","length","body","on","chunk","progress","loaded"],"mappings":"AAAA;;;;QAGgBA,qBAAqB,GAArBA,qBAAqB;AAHzBC,IAAAA,GAAG,mCAAM,WAAW,EAAjB;;;;;;;;;;;;;;;;;;;;;;AAGR,SAASD,qBAAqB,CAACE,KAAgB,EAAa;IACjE,OAAO,OAAOC,GAAG,EAAEC,IAAI,GAAK;QAC1B,MAAMC,GAAG,GAAG,MAAMH,KAAK,CAACC,GAAG,EAAEC,IAAI,CAAC,AAAC;QACnC,IAAIC,GAAG,CAACC,EAAE,IAAIF,CAAAA,IAAI,QAAY,GAAhBA,KAAAA,CAAgB,GAAhBA,IAAI,CAAEG,UAAU,CAAA,EAAE;YAC9B,MAAMC,iBAAiB,GAAGH,GAAG,CAACI,OAAO,CAACC,GAAG,CAAC,gBAAgB,CAAC,AAAC;YAC5D,MAAMC,KAAK,GAAGC,MAAM,CAACJ,iBAAiB,CAAC,AAAC;YAExC,IAAI,CAACA,iBAAiB,IAAIK,KAAK,CAACF,KAAK,CAAC,IAAIA,KAAK,GAAG,CAAC,EAAE;gBACnDV,GAAG,CAACa,IAAI,CACN,8HAA8H,EAC9HX,GAAG,CAACY,QAAQ,EAAE,CACf,CAAC;gBACF,OAAOV,GAAG,CAAC;aACZ;YAED,IAAIW,MAAM,GAAG,CAAC,AAAC;YAEfX,GAAG,CAACY,IAAI,CAACC,EAAE,CAAC,MAAM,EAAE,CAACC,KAAK,GAAK;gBAC7BH,MAAM,IAAIG,KAAK,CAACH,MAAM,CAAC;gBACvBT,UAAU,EAAE,CAAC;aACd,CAAC,CAAC;YAEHF,GAAG,CAACY,IAAI,CAACC,EAAE,CAAC,KAAK,EAAE,IAAM;gBACvBX,UAAU,EAAE,CAAC;aACd,CAAC,CAAC;YAEH,MAAMA,UAAU,GAAG,IAAM;gBACvB,MAAMa,QAAQ,GAAGJ,MAAM,GAAGL,KAAK,AAAC;gBAEhCP,IAAI,CAACG,UAAU,QAIb,GAJFH,KAAAA,CAIE,GAJFA,IAAI,CAACG,UAAU,CAAG;oBAChBa,QAAQ;oBACRT,KAAK;oBACLU,MAAM,EAAEL,MAAM;iBACf,CAAC,AApCV,CAoCW;aACJ,AAAC;SACH;QACD,OAAOX,GAAG,CAAC;KACZ,CAAC;CACH"}
1
+ {"version":3,"sources":["../../../../src/api/rest/wrapFetchWithProgress.ts"],"sourcesContent":["import * as Log from '../../log';\nimport { FetchLike } from './client.types';\nconst debug = require('debug')('expo:api:fetch:progress') as typeof console.log;\n\nexport function wrapFetchWithProgress(fetch: FetchLike): FetchLike {\n return (url, init) => {\n return fetch(url, init).then((res) => {\n if (res.ok && init?.onProgress) {\n const totalDownloadSize = res.headers.get('Content-Length');\n const total = Number(totalDownloadSize);\n\n debug(`Download size: ${totalDownloadSize}`);\n if (!totalDownloadSize || isNaN(total) || total < 0) {\n Log.warn(\n 'Progress callback not supported for network request because \"Content-Length\" header missing or invalid in response from URL:',\n url.toString()\n );\n return res;\n }\n\n let length = 0;\n\n debug(`Starting progress animation for ${url}`);\n res.body.on('data', (chunk) => {\n length += Buffer.byteLength(chunk);\n onProgress();\n });\n\n res.body.on('end', () => {\n debug(`Finished progress animation for ${url}`);\n onProgress();\n });\n\n const onProgress = () => {\n const progress = length / total || 0;\n init.onProgress?.({\n progress,\n total,\n loaded: length,\n });\n };\n }\n return res;\n });\n };\n}\n"],"names":["wrapFetchWithProgress","Log","debug","require","fetch","url","init","then","res","ok","onProgress","totalDownloadSize","headers","get","total","Number","isNaN","warn","toString","length","body","on","chunk","Buffer","byteLength","progress","loaded"],"mappings":"AAAA;;;;QAIgBA,qBAAqB,GAArBA,qBAAqB;AAJzBC,IAAAA,GAAG,mCAAM,WAAW,EAAjB;;;;;;;;;;;;;;;;;;;;;;AAEf,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,yBAAyB,CAAC,AAAsB,AAAC;AAEzE,SAASH,qBAAqB,CAACI,KAAgB,EAAa;IACjE,OAAO,CAACC,GAAG,EAAEC,IAAI,GAAK;QACpB,OAAOF,KAAK,CAACC,GAAG,EAAEC,IAAI,CAAC,CAACC,IAAI,CAAC,CAACC,GAAG,GAAK;YACpC,IAAIA,GAAG,CAACC,EAAE,IAAIH,CAAAA,IAAI,QAAY,GAAhBA,KAAAA,CAAgB,GAAhBA,IAAI,CAAEI,UAAU,CAAA,EAAE;gBAC9B,MAAMC,iBAAiB,GAAGH,GAAG,CAACI,OAAO,CAACC,GAAG,CAAC,gBAAgB,CAAC,AAAC;gBAC5D,MAAMC,KAAK,GAAGC,MAAM,CAACJ,iBAAiB,CAAC,AAAC;gBAExCT,KAAK,CAAC,CAAC,eAAe,EAAES,iBAAiB,CAAC,CAAC,CAAC,CAAC;gBAC7C,IAAI,CAACA,iBAAiB,IAAIK,KAAK,CAACF,KAAK,CAAC,IAAIA,KAAK,GAAG,CAAC,EAAE;oBACnDb,GAAG,CAACgB,IAAI,CACN,8HAA8H,EAC9HZ,GAAG,CAACa,QAAQ,EAAE,CACf,CAAC;oBACF,OAAOV,GAAG,CAAC;iBACZ;gBAED,IAAIW,MAAM,GAAG,CAAC,AAAC;gBAEfjB,KAAK,CAAC,CAAC,gCAAgC,EAAEG,GAAG,CAAC,CAAC,CAAC,CAAC;gBAChDG,GAAG,CAACY,IAAI,CAACC,EAAE,CAAC,MAAM,EAAE,CAACC,KAAK,GAAK;oBAC7BH,MAAM,IAAII,MAAM,CAACC,UAAU,CAACF,KAAK,CAAC,CAAC;oBACnCZ,UAAU,EAAE,CAAC;iBACd,CAAC,CAAC;gBAEHF,GAAG,CAACY,IAAI,CAACC,EAAE,CAAC,KAAK,EAAE,IAAM;oBACvBnB,KAAK,CAAC,CAAC,gCAAgC,EAAEG,GAAG,CAAC,CAAC,CAAC,CAAC;oBAChDK,UAAU,EAAE,CAAC;iBACd,CAAC,CAAC;gBAEH,MAAMA,UAAU,GAAG,IAAM;oBACvB,MAAMe,QAAQ,GAAGN,MAAM,GAAGL,KAAK,IAAI,CAAC,AAAC;oBACrCR,IAAI,CAACI,UAAU,QAIb,GAJFJ,KAAAA,CAIE,GAJFA,IAAI,CAACI,UAAU,CAAG;wBAChBe,QAAQ;wBACRX,KAAK;wBACLY,MAAM,EAAEP,MAAM;qBACf,CAAC,AAvCZ,CAuCa;iBACJ,AAAC;aACH;YACD,OAAOX,GAAG,CAAC;SACZ,CAAC,CAAC;KACJ,CAAC;CACH"}
@@ -12,7 +12,8 @@ function _interopRequireDefault(obj) {
12
12
  }
13
13
  const debug = require("debug")("expo:api:fetch:proxy");
14
14
  function wrapFetchWithProxy(fetchFunction) {
15
- return async function fetchWithProxy(url, options = {}) {
15
+ // NOTE(EvanBacon): DO NOT RETURN AN ASYNC WRAPPER. THIS BREAKS LOADING INDICATORS.
16
+ return function fetchWithProxy(url, options = {}) {
16
17
  const proxy = _env.env.HTTP_PROXY;
17
18
  if (!options.agent && proxy) {
18
19
  debug("Using proxy:", proxy);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/api/rest/wrapFetchWithProxy.ts"],"sourcesContent":["import createHttpsProxyAgent from 'https-proxy-agent';\n\nimport { env } from '../../utils/env';\nimport { FetchLike } from './client.types';\n\nconst debug = require('debug')('expo:api:fetch:proxy') as typeof console.log;\n\n/** Wrap fetch with support for proxies. */\nexport function wrapFetchWithProxy(fetchFunction: FetchLike): FetchLike {\n return async function fetchWithProxy(url, options = {}) {\n const proxy = env.HTTP_PROXY;\n if (!options.agent && proxy) {\n debug('Using proxy:', proxy);\n options.agent = createHttpsProxyAgent(proxy);\n }\n return fetchFunction(url, options);\n };\n}\n"],"names":["wrapFetchWithProxy","debug","require","fetchFunction","fetchWithProxy","url","options","proxy","env","HTTP_PROXY","agent","createHttpsProxyAgent"],"mappings":"AAAA;;;;QAQgBA,kBAAkB,GAAlBA,kBAAkB;AARA,IAAA,gBAAmB,kCAAnB,mBAAmB,EAAA;AAEjC,IAAA,IAAiB,WAAjB,iBAAiB,CAAA;;;;;;AAGrC,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,sBAAsB,CAAC,AAAsB,AAAC;AAGtE,SAASF,kBAAkB,CAACG,aAAwB,EAAa;IACtE,OAAO,eAAeC,cAAc,CAACC,GAAG,EAAEC,OAAO,GAAG,EAAE,EAAE;QACtD,MAAMC,KAAK,GAAGC,IAAG,IAAA,CAACC,UAAU,AAAC;QAC7B,IAAI,CAACH,OAAO,CAACI,KAAK,IAAIH,KAAK,EAAE;YAC3BN,KAAK,CAAC,cAAc,EAAEM,KAAK,CAAC,CAAC;YAC7BD,OAAO,CAACI,KAAK,GAAGC,CAAAA,GAAAA,gBAAqB,AAAO,CAAA,QAAP,CAACJ,KAAK,CAAC,CAAC;SAC9C;QACD,OAAOJ,aAAa,CAACE,GAAG,EAAEC,OAAO,CAAC,CAAC;KACpC,CAAC;CACH"}
1
+ {"version":3,"sources":["../../../../src/api/rest/wrapFetchWithProxy.ts"],"sourcesContent":["import createHttpsProxyAgent from 'https-proxy-agent';\n\nimport { env } from '../../utils/env';\nimport { FetchLike } from './client.types';\n\nconst debug = require('debug')('expo:api:fetch:proxy') as typeof console.log;\n\n/** Wrap fetch with support for proxies. */\nexport function wrapFetchWithProxy(fetchFunction: FetchLike): FetchLike {\n // NOTE(EvanBacon): DO NOT RETURN AN ASYNC WRAPPER. THIS BREAKS LOADING INDICATORS.\n return function fetchWithProxy(url, options = {}) {\n const proxy = env.HTTP_PROXY;\n if (!options.agent && proxy) {\n debug('Using proxy:', proxy);\n options.agent = createHttpsProxyAgent(proxy);\n }\n return fetchFunction(url, options);\n };\n}\n"],"names":["wrapFetchWithProxy","debug","require","fetchFunction","fetchWithProxy","url","options","proxy","env","HTTP_PROXY","agent","createHttpsProxyAgent"],"mappings":"AAAA;;;;QAQgBA,kBAAkB,GAAlBA,kBAAkB;AARA,IAAA,gBAAmB,kCAAnB,mBAAmB,EAAA;AAEjC,IAAA,IAAiB,WAAjB,iBAAiB,CAAA;;;;;;AAGrC,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,sBAAsB,CAAC,AAAsB,AAAC;AAGtE,SAASF,kBAAkB,CAACG,aAAwB,EAAa;IACtE,mFAAmF;IACnF,OAAO,SAASC,cAAc,CAACC,GAAG,EAAEC,OAAO,GAAG,EAAE,EAAE;QAChD,MAAMC,KAAK,GAAGC,IAAG,IAAA,CAACC,UAAU,AAAC;QAC7B,IAAI,CAACH,OAAO,CAACI,KAAK,IAAIH,KAAK,EAAE;YAC3BN,KAAK,CAAC,cAAc,EAAEM,KAAK,CAAC,CAAC;YAC7BD,OAAO,CAACI,KAAK,GAAGC,CAAAA,GAAAA,gBAAqB,AAAO,CAAA,QAAP,CAACJ,KAAK,CAAC,CAAC;SAC9C;QACD,OAAOJ,aAAa,CAACE,GAAG,EAAEC,OAAO,CAAC,CAAC;KACpC,CAAC;CACH"}
@@ -80,10 +80,10 @@ class DevServerManagerActions {
80
80
  Log.log();
81
81
  }
82
82
  async openJsInspectorAsync() {
83
+ var ref;
83
84
  Log.log("Opening JavaScript inspector in the browser...");
84
- const port = this.devServerManager.getNativeDevServerPort();
85
- (0, _assert).default(port, "Metro dev server is not running");
86
- const metroServerOrigin = `http://localhost:${port}`;
85
+ const metroServerOrigin = (ref = this.devServerManager.getDefaultDevServer().getNativeRuntimeUrl()) == null ? void 0 : ref.replace(/^exp:\/\//, "http://");
86
+ (0, _assert).default(metroServerOrigin, "Metro dev server is not running");
87
87
  const apps = await (0, _devServer).queryAllInspectorAppsAsync(metroServerOrigin);
88
88
  if (!apps.length) {
89
89
  Log.warn(`No compatible apps connected. JavaScript Debugging can only be used with the Hermes engine. ${(0, _link).learnMore("https://docs.expo.dev/guides/using-hermes/")}`);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/start/interface/interactiveActions.ts"],"sourcesContent":["import { openJsInspector, queryAllInspectorAppsAsync } from '@expo/dev-server';\nimport assert from 'assert';\nimport chalk from 'chalk';\n\nimport * as Log from '../../log';\nimport { learnMore } from '../../utils/link';\nimport { selectAsync } from '../../utils/prompts';\nimport { DevServerManager } from '../server/DevServerManager';\nimport { BLT, printHelp, printItem, printQRCode, printUsage, StartOptions } from './commandsTable';\n\nconst debug = require('debug')('expo:start:interface:interactiveActions') as typeof console.log;\n\n/** Wraps the DevServerManager and adds an interface for user actions. */\nexport class DevServerManagerActions {\n constructor(private devServerManager: DevServerManager) {}\n\n printDevServerInfo(\n options: Pick<StartOptions, 'devClient' | 'isWebSocketsEnabled' | 'platforms'>\n ) {\n // If native dev server is running, print its URL.\n if (this.devServerManager.getNativeDevServerPort()) {\n const devServer = this.devServerManager.getDefaultDevServer();\n try {\n const nativeRuntimeUrl = devServer.getNativeRuntimeUrl()!;\n const interstitialPageUrl = devServer.getRedirectUrl();\n\n printQRCode(interstitialPageUrl ?? nativeRuntimeUrl);\n\n if (interstitialPageUrl) {\n Log.log(\n printItem(\n chalk`Choose an app to open your project at {underline ${interstitialPageUrl}}`\n )\n );\n }\n Log.log(printItem(chalk`Metro waiting on {underline ${nativeRuntimeUrl}}`));\n // TODO: if development build, change this message!\n Log.log(printItem('Scan the QR code above with Expo Go (Android) or the Camera app (iOS)'));\n } catch (error) {\n // @ts-ignore: If there is no development build scheme, then skip the QR code.\n if (error.code !== 'NO_DEV_CLIENT_SCHEME') {\n throw error;\n } else {\n const serverUrl = devServer.getDevServerUrl();\n Log.log(printItem(chalk`Metro waiting on {underline ${serverUrl}}`));\n Log.log(printItem(`Linking is disabled because the client scheme cannot be resolved.`));\n }\n }\n }\n\n const webDevServer = this.devServerManager.getWebDevServer();\n const webUrl = webDevServer?.getDevServerUrl({ hostType: 'localhost' });\n if (webUrl) {\n Log.log();\n Log.log(printItem(chalk`Web is waiting on {underline ${webUrl}}`));\n }\n\n printUsage(options, { verbose: false });\n printHelp();\n Log.log();\n }\n\n async openJsInspectorAsync() {\n Log.log('Opening JavaScript inspector in the browser...');\n const port = this.devServerManager.getNativeDevServerPort();\n assert(port, 'Metro dev server is not running');\n const metroServerOrigin = `http://localhost:${port}`;\n const apps = await queryAllInspectorAppsAsync(metroServerOrigin);\n if (!apps.length) {\n Log.warn(\n `No compatible apps connected. JavaScript Debugging can only be used with the Hermes engine. ${learnMore(\n 'https://docs.expo.dev/guides/using-hermes/'\n )}`\n );\n return;\n }\n for (const app of apps) {\n openJsInspector(app);\n }\n }\n\n reloadApp() {\n Log.log(`${BLT} Reloading apps`);\n // Send reload requests over the dev servers\n this.devServerManager.broadcastMessage('reload');\n }\n\n async openMoreToolsAsync() {\n try {\n // Options match: Chrome > View > Developer\n const value = await selectAsync(chalk`Dev tools {dim (native only)}`, [\n { title: 'Inspect elements', value: 'toggleElementInspector' },\n { title: 'Toggle performance monitor', value: 'togglePerformanceMonitor' },\n { title: 'Toggle developer menu', value: 'toggleDevMenu' },\n { title: 'Reload app', value: 'reload' },\n // TODO: Maybe a \"View Source\" option to open code.\n // Toggling Remote JS Debugging is pretty rough, so leaving it disabled.\n // { title: 'Toggle Remote Debugging', value: 'toggleRemoteDebugging' },\n ]);\n this.devServerManager.broadcastMessage('sendDevCommand', { name: value });\n } catch (error: any) {\n debug(error);\n // do nothing\n } finally {\n printHelp();\n }\n }\n\n toggleDevMenu() {\n Log.log(`${BLT} Toggling dev menu`);\n this.devServerManager.broadcastMessage('devMenu');\n }\n}\n"],"names":["Log","debug","require","DevServerManagerActions","constructor","devServerManager","printDevServerInfo","options","getNativeDevServerPort","devServer","getDefaultDevServer","nativeRuntimeUrl","getNativeRuntimeUrl","interstitialPageUrl","getRedirectUrl","printQRCode","log","printItem","chalk","error","code","serverUrl","getDevServerUrl","webDevServer","getWebDevServer","webUrl","hostType","printUsage","verbose","printHelp","openJsInspectorAsync","port","assert","metroServerOrigin","apps","queryAllInspectorAppsAsync","length","warn","learnMore","app","openJsInspector","reloadApp","BLT","broadcastMessage","openMoreToolsAsync","value","selectAsync","title","name","toggleDevMenu"],"mappings":"AAAA;;;;AAA4D,IAAA,UAAkB,WAAlB,kBAAkB,CAAA;AAC3D,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AACT,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEbA,IAAAA,GAAG,mCAAM,WAAW,EAAjB;AACW,IAAA,KAAkB,WAAlB,kBAAkB,CAAA;AAChB,IAAA,QAAqB,WAArB,qBAAqB,CAAA;AAEgC,IAAA,cAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElG,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,yCAAyC,CAAC,AAAsB,AAAC;AAGzF,MAAMC,uBAAuB;IAClCC,YAAoBC,gBAAkC,CAAE;aAApCA,gBAAkC,GAAlCA,gBAAkC;KAAI;IAE1DC,kBAAkB,CAChBC,OAA8E,EAC9E;QACA,kDAAkD;QAClD,IAAI,IAAI,CAACF,gBAAgB,CAACG,sBAAsB,EAAE,EAAE;YAClD,MAAMC,SAAS,GAAG,IAAI,CAACJ,gBAAgB,CAACK,mBAAmB,EAAE,AAAC;YAC9D,IAAI;gBACF,MAAMC,gBAAgB,GAAGF,SAAS,CAACG,mBAAmB,EAAE,AAAC,AAAC;gBAC1D,MAAMC,mBAAmB,GAAGJ,SAAS,CAACK,cAAc,EAAE,AAAC;gBAEvDC,CAAAA,GAAAA,cAAW,AAAyC,CAAA,YAAzC,CAACF,mBAAmB,WAAnBA,mBAAmB,GAAIF,gBAAgB,CAAC,CAAC;gBAErD,IAAIE,mBAAmB,EAAE;oBACvBb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BAAgB,CAACsC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;KAClD;IAED,MAAMC,kBAAkB,GAAG;QACzB,IAAI;YACF,2CAA2C;YAC3C,MAAMC,KAAK,GAAG,MAAMC,CAAAA,GAAAA,QAAW,AAQ7B,CAAA,YAR6B,CAAC5B,MAAK,QAAA,CAAC,6BAA6B,CAAC,EAAE;gBACpE;oBAAE6B,KAAK,EAAE,kBAAkB;oBAAEF,KAAK,EAAE,wBAAwB;iBAAE;gBAC9D;oBAAEE,KAAK,EAAE,4BAA4B;oBAAEF,KAAK,EAAE,0BAA0B;iBAAE;gBAC1E;oBAAEE,KAAK,EAAE,uBAAuB;oBAAEF,KAAK,EAAE,eAAe;iBAAE;gBAC1D;oBAAEE,KAAK,EAAE,YAAY;oBAAEF,KAAK,EAAE,QAAQ;iBAAE;aAIzC,CAAC,AAAC;YACH,IAAI,CAACxC,gBAAgB,CAACsC,gBAAgB,CAAC,gBAAgB,EAAE;gBAAEK,IAAI,EAAEH,KAAK;aAAE,CAAC,CAAC;SAC3E,CAAC,OAAO1B,KAAK,EAAO;YACnBlB,KAAK,CAACkB,KAAK,CAAC,CAAC;QACb,aAAa;SACd,QAAS;YACRU,CAAAA,GAAAA,cAAS,AAAE,CAAA,UAAF,EAAE,CAAC;SACb;KACF;IAEDoB,aAAa,GAAG;QACdjD,GAAG,CAACgB,GAAG,CAAC,CAAC,EAAE0B,cAAG,IAAA,CAAC,kBAAkB,CAAC,CAAC,CAAC;QACpC,IAAI,CAACrC,gBAAgB,CAACsC,gBAAgB,CAAC,SAAS,CAAC,CAAC;KACnD;CACF;QAnGYxC,uBAAuB,GAAvBA,uBAAuB"}
1
+ {"version":3,"sources":["../../../../src/start/interface/interactiveActions.ts"],"sourcesContent":["import { openJsInspector, queryAllInspectorAppsAsync } from '@expo/dev-server';\nimport assert from 'assert';\nimport chalk from 'chalk';\n\nimport * as Log from '../../log';\nimport { learnMore } from '../../utils/link';\nimport { selectAsync } from '../../utils/prompts';\nimport { DevServerManager } from '../server/DevServerManager';\nimport { BLT, printHelp, printItem, printQRCode, printUsage, StartOptions } from './commandsTable';\n\nconst debug = require('debug')('expo:start:interface:interactiveActions') as typeof console.log;\n\n/** Wraps the DevServerManager and adds an interface for user actions. */\nexport class DevServerManagerActions {\n constructor(private devServerManager: DevServerManager) {}\n\n printDevServerInfo(\n options: Pick<StartOptions, 'devClient' | 'isWebSocketsEnabled' | 'platforms'>\n ) {\n // If native dev server is running, print its URL.\n if (this.devServerManager.getNativeDevServerPort()) {\n const devServer = this.devServerManager.getDefaultDevServer();\n try {\n const nativeRuntimeUrl = devServer.getNativeRuntimeUrl()!;\n const interstitialPageUrl = devServer.getRedirectUrl();\n\n printQRCode(interstitialPageUrl ?? nativeRuntimeUrl);\n\n if (interstitialPageUrl) {\n Log.log(\n printItem(\n chalk`Choose an app to open your project at {underline ${interstitialPageUrl}}`\n )\n );\n }\n Log.log(printItem(chalk`Metro waiting on {underline ${nativeRuntimeUrl}}`));\n // TODO: if development build, change this message!\n Log.log(printItem('Scan the QR code above with Expo Go (Android) or the Camera app (iOS)'));\n } catch (error) {\n // @ts-ignore: If there is no development build scheme, then skip the QR code.\n if (error.code !== 'NO_DEV_CLIENT_SCHEME') {\n throw error;\n } else {\n const serverUrl = devServer.getDevServerUrl();\n Log.log(printItem(chalk`Metro waiting on {underline ${serverUrl}}`));\n Log.log(printItem(`Linking is disabled because the client scheme cannot be resolved.`));\n }\n }\n }\n\n const webDevServer = this.devServerManager.getWebDevServer();\n const webUrl = webDevServer?.getDevServerUrl({ hostType: 'localhost' });\n if (webUrl) {\n Log.log();\n Log.log(printItem(chalk`Web is waiting on {underline ${webUrl}}`));\n }\n\n printUsage(options, { verbose: false });\n printHelp();\n Log.log();\n }\n\n async openJsInspectorAsync() {\n Log.log('Opening JavaScript inspector in the browser...');\n const metroServerOrigin = this.devServerManager\n .getDefaultDevServer()\n .getNativeRuntimeUrl()\n ?.replace(/^exp:\\/\\//, 'http://');\n assert(metroServerOrigin, 'Metro dev server is not running');\n const apps = await queryAllInspectorAppsAsync(metroServerOrigin);\n if (!apps.length) {\n Log.warn(\n `No compatible apps connected. JavaScript Debugging can only be used with the Hermes engine. ${learnMore(\n 'https://docs.expo.dev/guides/using-hermes/'\n )}`\n );\n return;\n }\n for (const app of apps) {\n openJsInspector(app);\n }\n }\n\n reloadApp() {\n Log.log(`${BLT} Reloading apps`);\n // Send reload requests over the dev servers\n this.devServerManager.broadcastMessage('reload');\n }\n\n async openMoreToolsAsync() {\n try {\n // Options match: Chrome > View > Developer\n const value = await selectAsync(chalk`Dev tools {dim (native only)}`, [\n { title: 'Inspect elements', value: 'toggleElementInspector' },\n { title: 'Toggle performance monitor', value: 'togglePerformanceMonitor' },\n { title: 'Toggle developer menu', value: 'toggleDevMenu' },\n { title: 'Reload app', value: 'reload' },\n // TODO: Maybe a \"View Source\" option to open code.\n // Toggling Remote JS Debugging is pretty rough, so leaving it disabled.\n // { title: 'Toggle Remote Debugging', value: 'toggleRemoteDebugging' },\n ]);\n this.devServerManager.broadcastMessage('sendDevCommand', { name: value });\n } catch (error: any) {\n debug(error);\n // do nothing\n } finally {\n printHelp();\n }\n }\n\n toggleDevMenu() {\n Log.log(`${BLT} Toggling dev menu`);\n this.devServerManager.broadcastMessage('devMenu');\n }\n}\n"],"names":["Log","debug","require","DevServerManagerActions","constructor","devServerManager","printDevServerInfo","options","getNativeDevServerPort","devServer","getDefaultDevServer","nativeRuntimeUrl","getNativeRuntimeUrl","interstitialPageUrl","getRedirectUrl","printQRCode","log","printItem","chalk","error","code","serverUrl","getDevServerUrl","webDevServer","getWebDevServer","webUrl","hostType","printUsage","verbose","printHelp","openJsInspectorAsync","metroServerOrigin","replace","assert","apps","queryAllInspectorAppsAsync","length","warn","learnMore","app","openJsInspector","reloadApp","BLT","broadcastMessage","openMoreToolsAsync","value","selectAsync","title","name","toggleDevMenu"],"mappings":"AAAA;;;;AAA4D,IAAA,UAAkB,WAAlB,kBAAkB,CAAA;AAC3D,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BAAEF,KAAK,EAAE,wBAAwB;iBAAE;gBAC9D;oBAAEE,KAAK,EAAE,4BAA4B;oBAAEF,KAAK,EAAE,0BAA0B;iBAAE;gBAC1E;oBAAEE,KAAK,EAAE,uBAAuB;oBAAEF,KAAK,EAAE,eAAe;iBAAE;gBAC1D;oBAAEE,KAAK,EAAE,YAAY;oBAAEF,KAAK,EAAE,QAAQ;iBAAE;aAIzC,CAAC,AAAC;YACH,IAAI,CAACxC,gBAAgB,CAACsC,gBAAgB,CAAC,gBAAgB,EAAE;gBAAEK,IAAI,EAAEH,KAAK;aAAE,CAAC,CAAC;SAC3E,CAAC,OAAO1B,KAAK,EAAO;YACnBlB,KAAK,CAACkB,KAAK,CAAC,CAAC;QACb,aAAa;SACd,QAAS;YACRU,CAAAA,GAAAA,cAAS,AAAE,CAAA,UAAF,EAAE,CAAC;SACb;KACF;IAEDoB,aAAa,GAAG;QACdjD,GAAG,CAACgB,GAAG,CAAC,CAAC,EAAE0B,cAAG,IAAA,CAAC,kBAAkB,CAAC,CAAC,CAAC;QACpC,IAAI,CAACrC,gBAAgB,CAACsC,gBAAgB,CAAC,SAAS,CAAC,CAAC;KACnD;CACF;QArGYxC,uBAAuB,GAAvBA,uBAAuB"}
@@ -130,7 +130,7 @@ async function createHostInfoAsync() {
130
130
  host: await _userSettings.default.getAnonymousIdentifierAsync(),
131
131
  server: "expo",
132
132
  // Defined in the build step
133
- serverVersion: "0.4.6",
133
+ serverVersion: "0.4.7",
134
134
  serverDriver: _manifestMiddleware.DEVELOPER_TOOL,
135
135
  serverOS: _os.default.platform(),
136
136
  serverOSVersion: _os.default.release()
@@ -94,7 +94,7 @@ async function logEventAsync(event, properties = {}) {
94
94
  }
95
95
  const { userId , deviceId } = identifyData;
96
96
  const commonEventProperties = {
97
- source_version: "0.4.6",
97
+ source_version: "0.4.7",
98
98
  source: "expo"
99
99
  };
100
100
  const identity = {
@@ -135,7 +135,7 @@ function getContext() {
135
135
  },
136
136
  app: {
137
137
  name: "expo",
138
- version: "0.4.6"
138
+ version: "0.4.7"
139
139
  },
140
140
  ci: ciInfo.isCI ? {
141
141
  name: ciInfo.name,
@@ -9,7 +9,6 @@ var _stream = require("stream");
9
9
  var _tempy = _interopRequireDefault(require("tempy"));
10
10
  var _util = require("util");
11
11
  var _client = require("../api/rest/client");
12
- var _wrapFetchWithProgress = require("../api/rest/wrapFetchWithProgress");
13
12
  var _dir = require("./dir");
14
13
  var _errors = require("./errors");
15
14
  var _tar = require("./tar");
@@ -33,7 +32,7 @@ async function downloadAsync({ url , outputPath , cacheDirectory , onProgress }
33
32
  });
34
33
  }
35
34
  debug(`Downloading ${url} to ${outputPath}`);
36
- const res = await (0, _wrapFetchWithProgress).wrapFetchWithProgress(fetchInstance)(url, {
35
+ const res = await fetchInstance(url, {
37
36
  timeout: TIMER_DURATION,
38
37
  onProgress
39
38
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/downloadAppAsync.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { Stream } from 'stream';\nimport temporary from 'tempy';\nimport { promisify } from 'util';\n\nimport { createCachedFetch, fetchAsync } from '../api/rest/client';\nimport { FetchLike, ProgressCallback } from '../api/rest/client.types';\nimport { wrapFetchWithProgress } from '../api/rest/wrapFetchWithProgress';\nimport { ensureDirectoryAsync } from './dir';\nimport { CommandError } from './errors';\nimport { extractAsync } from './tar';\n\nconst debug = require('debug')('expo:utils:downloadAppAsync') as typeof console.log;\n\nconst TIMER_DURATION = 30000;\n\nconst pipeline = promisify(Stream.pipeline);\n\nasync function downloadAsync({\n url,\n outputPath,\n cacheDirectory,\n onProgress,\n}: {\n url: string;\n outputPath: string;\n cacheDirectory?: string;\n onProgress?: ProgressCallback;\n}) {\n let fetchInstance: FetchLike = fetchAsync;\n if (cacheDirectory) {\n // Reconstruct the cached fetch since caching could be disabled.\n fetchInstance = createCachedFetch({\n // We'll use a 1 week cache for versions so older values get flushed out eventually.\n ttl: 1000 * 60 * 60 * 24 * 7,\n // Users can also nuke their `~/.expo` directory to clear the cache.\n cacheDirectory,\n });\n }\n\n debug(`Downloading ${url} to ${outputPath}`);\n const res = await wrapFetchWithProgress(fetchInstance)(url, {\n timeout: TIMER_DURATION,\n onProgress,\n });\n if (!res.ok) {\n throw new CommandError(\n 'FILE_DOWNLOAD',\n `Unexpected response: ${res.statusText}. From url: ${url}`\n );\n }\n return pipeline(res.body, fs.createWriteStream(outputPath));\n}\n\nexport async function downloadAppAsync({\n url,\n outputPath,\n extract = false,\n cacheDirectory,\n onProgress,\n}: {\n url: string;\n outputPath: string;\n extract?: boolean;\n cacheDirectory?: string;\n onProgress?: ProgressCallback;\n}): Promise<void> {\n if (extract) {\n // For iOS we download the ipa to a file then pass that file into the extractor.\n // In the future we should just pipe the `res.body -> tar.extract` directly.\n // I tried this and it created some weird errors where observing the data stream\n // would corrupt the file causing tar to fail with `TAR_BAD_ARCHIVE`.\n const tmpPath = temporary.file({ name: path.basename(outputPath) });\n await downloadAsync({ url, outputPath: tmpPath, cacheDirectory, onProgress });\n debug(`Extracting ${tmpPath} to ${outputPath}`);\n await ensureDirectoryAsync(outputPath);\n await extractAsync(tmpPath, outputPath);\n } else {\n await ensureDirectoryAsync(path.dirname(outputPath));\n await downloadAsync({ url, outputPath, cacheDirectory, onProgress });\n }\n}\n"],"names":["downloadAppAsync","debug","require","TIMER_DURATION","pipeline","promisify","Stream","downloadAsync","url","outputPath","cacheDirectory","onProgress","fetchInstance","fetchAsync","createCachedFetch","ttl","res","wrapFetchWithProgress","timeout","ok","CommandError","statusText","body","fs","createWriteStream","extract","tmpPath","temporary","file","name","path","basename","ensureDirectoryAsync","extractAsync","dirname"],"mappings":"AAAA;;;;QAuDsBA,gBAAgB,GAAhBA,gBAAgB;AAvDvB,IAAA,GAAI,kCAAJ,IAAI,EAAA;AACF,IAAA,KAAM,kCAAN,MAAM,EAAA;AACA,IAAA,OAAQ,WAAR,QAAQ,CAAA;AACT,IAAA,MAAO,kCAAP,OAAO,EAAA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ppAsync.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { Stream } from 'stream';\nimport temporary from 'tempy';\nimport { promisify } from 'util';\n\nimport { createCachedFetch, fetchAsync } from '../api/rest/client';\nimport { FetchLike, ProgressCallback } from '../api/rest/client.types';\nimport { ensureDirectoryAsync } from './dir';\nimport { CommandError } from './errors';\nimport { extractAsync } from './tar';\n\nconst debug = require('debug')('expo:utils:downloadAppAsync') as typeof console.log;\n\nconst TIMER_DURATION = 30000;\n\nconst pipeline = promisify(Stream.pipeline);\n\nasync function downloadAsync({\n url,\n outputPath,\n cacheDirectory,\n onProgress,\n}: {\n url: string;\n outputPath: string;\n cacheDirectory?: string;\n onProgress?: ProgressCallback;\n}) {\n let fetchInstance: FetchLike = fetchAsync;\n if (cacheDirectory) {\n // Reconstruct the cached fetch since caching could be disabled.\n fetchInstance = createCachedFetch({\n // We'll use a 1 week cache for versions so older values get flushed out eventually.\n ttl: 1000 * 60 * 60 * 24 * 7,\n // Users can also nuke their `~/.expo` directory to clear the cache.\n cacheDirectory,\n });\n }\n\n debug(`Downloading ${url} to ${outputPath}`);\n const res = await fetchInstance(url, {\n timeout: TIMER_DURATION,\n onProgress,\n });\n if (!res.ok) {\n throw new CommandError(\n 'FILE_DOWNLOAD',\n `Unexpected response: ${res.statusText}. From url: ${url}`\n );\n }\n return pipeline(res.body, fs.createWriteStream(outputPath));\n}\n\nexport async function downloadAppAsync({\n url,\n outputPath,\n extract = false,\n cacheDirectory,\n onProgress,\n}: {\n url: string;\n outputPath: string;\n extract?: boolean;\n cacheDirectory?: string;\n onProgress?: ProgressCallback;\n}): Promise<void> {\n if (extract) {\n // For iOS we download the ipa to a file then pass that file into the extractor.\n // In the future we should just pipe the `res.body -> tar.extract` directly.\n // I tried this and it created some weird errors where observing the data stream\n // would corrupt the file causing tar to fail with `TAR_BAD_ARCHIVE`.\n const tmpPath = temporary.file({ name: path.basename(outputPath) });\n await downloadAsync({ url, outputPath: tmpPath, cacheDirectory, onProgress });\n debug(`Extracting ${tmpPath} to ${outputPath}`);\n await ensureDirectoryAsync(outputPath);\n await extractAsync(tmpPath, outputPath);\n } else {\n await ensureDirectoryAsync(path.dirname(outputPath));\n await downloadAsync({ url, outputPath, cacheDirectory, onProgress });\n }\n}\n"],"names":["downloadAppAsync","debug","require","TIMER_DURATION","pipeline","promisify","Stream","downloadAsync","url","outputPath","cacheDirectory","onProgress","fetchInstance","fetchAsync","createCachedFetch","ttl","res","timeout","ok","CommandError","statusText","body","fs","createWriteStream","extract","tmpPath","temporary","file","name","path","basename","ensureDirectoryAsync","extractAsync","dirname"],"mappings":"AAAA;;;;QAsDsBA,gBAAgB,GAAhBA,gBAAgB;AAtDvB,IAAA,GAAI,kCAAJ,IAAI,EAAA;AACF,IAAA,KAAM,kCAAN,MAAM,EAAA;AACA,IAAA,OAAQ,WAAR,QAAQ,CAAA;AACT,IAAA,MAAO,kCAAP,OAAO,EAAA;AACH,IAAA,KAAM,WAAN,MAAM,CAAA;AAEc,IAAA,OAAoB,WAApB,oBAAoB,CAAA;AAE7B,IAAA,IAAO,WAAP,OAAO,CAAA;AACf,IAAA,OAAU,WAAV,UAAU,CAAA;AACV,IAAA,IAAO,WAAP,OAAO,CAAA;;;;;;AAEpC,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,6BAA6B,CAAC,AAAsB,AAAC;AAEpF,MAAMC,cAAc,GAAG,KAAK,AAAC;AAE7B,MAAMC,QAAQ,GAAGC,CAAAA,GAAAA,KAAS,AAAiB,CAAA,UAAjB,CAACC,OAAM,OAAA,CAACF,QAAQ,CAAC,AAAC;AAE5C,eAAeG,aAAa,CAAC,EAC3BC,GAAG,CAAA,EACHC,UAAU,CAAA,EACVC,cAAc,CAAA,EACdC,UAAU,CAAA,EAMX,EAAE;IACD,IAAIC,aAAa,GAAcC,OAAU,WAAA,AAAC;IAC1C,IAAIH,cAAc,EAAE;QAClB,gEAAgE;QAChEE,aAAa,GAAGE,CAAAA,GAAA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B,UAAU,CAAC,CAAC,CAAC,CAAC;QAChD,MAAMsB,CAAAA,GAAAA,IAAoB,AAAY,CAAA,qBAAZ,CAACtB,UAAU,CAAC,CAAC;QACvC,MAAMuB,CAAAA,GAAAA,IAAY,AAAqB,CAAA,aAArB,CAACP,OAAO,EAAEhB,UAAU,CAAC,CAAC;KACzC,MAAM;QACL,MAAMsB,CAAAA,GAAAA,IAAoB,AAA0B,CAAA,qBAA1B,CAACF,KAAI,QAAA,CAACI,OAAO,CAACxB,UAAU,CAAC,CAAC,CAAC;QACrD,MAAMF,aAAa,CAAC;YAAEC,GAAG;YAAEC,UAAU;YAAEC,cAAc;YAAEC,UAAU;SAAE,CAAC,CAAC;KACtE;CACF"}
@@ -8,6 +8,7 @@ var _path = _interopRequireDefault(require("path"));
8
8
  var _getVersions = require("../api/getVersions");
9
9
  var _downloadAppAsync = require("./downloadAppAsync");
10
10
  var _errors = require("./errors");
11
+ var _ora = require("./ora");
11
12
  var _profile = require("./profile");
12
13
  var _progress = require("./progress");
13
14
  function _interopRequireDefault(obj) {
@@ -32,13 +33,11 @@ const platformSettings = {
32
33
  };
33
34
  async function downloadExpoGoAsync(platform, { url , sdkVersion }) {
34
35
  const { getFilePath , versionsKey , shouldExtractResults } = platformSettings[platform];
35
- const bar = (0, _progress).createProgressBar("Downloading the Expo Go app [:bar] :percent :etas", {
36
- width: 64,
37
- total: 100,
38
- clear: true,
39
- complete: "=",
40
- incomplete: " "
41
- });
36
+ const spinner = (0, _ora).ora({
37
+ text: "Fetching Expo Go",
38
+ color: "white"
39
+ }).start();
40
+ let bar = null;
42
41
  if (!url) {
43
42
  if (!sdkVersion) {
44
43
  throw new _errors.CommandError(`Unable to determine which Expo Go version to install (platform: ${platform})`);
@@ -62,14 +61,28 @@ async function downloadExpoGoAsync(platform, { url , sdkVersion }) {
62
61
  cacheDirectory: "expo-go",
63
62
  outputPath,
64
63
  extract: shouldExtractResults,
65
- onProgress ({ progress }) {
66
- if (bar) {
67
- bar.tick(1, progress);
64
+ onProgress ({ progress , total }) {
65
+ if (progress && total) {
66
+ if (!bar) {
67
+ if (spinner.isSpinning) {
68
+ spinner.stop();
69
+ }
70
+ bar = (0, _progress).createProgressBar("Downloading the Expo Go app [:bar] :percent :etas", {
71
+ width: 64,
72
+ total: 100,
73
+ // clear: true,
74
+ complete: "=",
75
+ incomplete: " "
76
+ });
77
+ }
78
+ bar.update(progress, total);
68
79
  }
69
80
  }
70
81
  });
71
82
  return outputPath;
72
83
  } finally{
84
+ spinner.stop();
85
+ // @ts-expect-error
73
86
  bar == null ? void 0 : bar.terminate();
74
87
  }
75
88
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/downloadExpoGoAsync.ts"],"sourcesContent":["import { getExpoHomeDirectory } from '@expo/config/build/getUserState';\nimport path from 'path';\n\nimport { getVersionsAsync, SDKVersion } from '../api/getVersions';\nimport { downloadAppAsync } from './downloadAppAsync';\nimport { CommandError } from './errors';\nimport { profile } from './profile';\nimport { createProgressBar } from './progress';\n\nconst debug = require('debug')('expo:utils:downloadExpoGo') as typeof console.log;\n\nconst platformSettings: Record<\n string,\n {\n shouldExtractResults: boolean;\n versionsKey: keyof SDKVersion;\n getFilePath: (filename: string) => string;\n }\n> = {\n ios: {\n versionsKey: 'iosClientUrl',\n getFilePath: (filename) =>\n path.join(getExpoHomeDirectory(), 'ios-simulator-app-cache', `${filename}.app`),\n shouldExtractResults: true,\n },\n android: {\n versionsKey: 'androidClientUrl',\n getFilePath: (filename) =>\n path.join(getExpoHomeDirectory(), 'android-apk-cache', `${filename}.apk`),\n shouldExtractResults: false,\n },\n};\n\n/** Download the Expo Go app from the Expo servers (if only it was this easy for every app). */\nexport async function downloadExpoGoAsync(\n platform: keyof typeof platformSettings,\n {\n url,\n sdkVersion,\n }: {\n url?: string;\n sdkVersion?: string;\n }\n): Promise<string> {\n const { getFilePath, versionsKey, shouldExtractResults } = platformSettings[platform];\n\n const bar = createProgressBar('Downloading the Expo Go app [:bar] :percent :etas', {\n width: 64,\n total: 100,\n clear: true,\n complete: '=',\n incomplete: ' ',\n });\n\n if (!url) {\n if (!sdkVersion) {\n throw new CommandError(\n `Unable to determine which Expo Go version to install (platform: ${platform})`\n );\n }\n const { sdkVersions: versions } = await getVersionsAsync();\n\n const version = versions[sdkVersion];\n if (!version) {\n throw new CommandError(\n `Unable to find a version of Expo Go for SDK ${sdkVersion} (platform: ${platform})`\n );\n }\n debug(`Installing Expo Go version for SDK ${sdkVersion} at URL: ${version[versionsKey]}`);\n url = version[versionsKey] as string;\n }\n\n const filename = path.parse(url).name;\n\n try {\n const outputPath = getFilePath(filename);\n debug(`Downloading Expo Go from \"${url}\" to \"${outputPath}\".`);\n debug(\n `The requested copy of Expo Go might already be cached in: \"${getExpoHomeDirectory()}\". You can disable the cache with EXPO_NO_CACHE=1`\n );\n await profile(downloadAppAsync)({\n url,\n // Save all encrypted cache data to `~/.expo/expo-go`\n cacheDirectory: 'expo-go',\n outputPath,\n extract: shouldExtractResults,\n onProgress({ progress }) {\n if (bar) {\n bar.tick(1, progress);\n }\n },\n });\n return outputPath;\n } finally {\n bar?.terminate();\n }\n}\n"],"names":["downloadExpoGoAsync","debug","require","platformSettings","ios","versionsKey","getFilePath","filename","path","join","getExpoHomeDirectory","shouldExtractResults","android","platform","url","sdkVersion","bar","createProgressBar","width","total","clear","complete","incomplete","CommandError","sdkVersions","versions","getVersionsAsync","version","parse","name","outputPath","profile","downloadAppAsync","cacheDirectory","extract","onProgress","progress","tick","terminate"],"mappings":"AAAA;;;;QAkCsBA,mBAAmB,GAAnBA,mBAAmB;AAlCJ,IAAA,aAAiC,WAAjC,iCAAiC,CAAA;AACrD,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEsB,IAAA,YAAoB,WAApB,oBAAoB,CAAA;AAChC,IAAA,iBAAoB,WAApB,oBAAoB,CAAA;AACxB,IAAA,OAAU,WAAV,UAAU,CAAA;AACf,IAAA,QAAW,WAAX,WAAW,CAAA;AACD,IAAA,SAAY,W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B,IAAI,CAAC,CAAC,EAAED,QAAQ,CAAC,CAAC;iBACvB;aACF;SACF,CAAC,CAAC;QACH,OAAON,UAAU,CAAC;KACnB,QAAS;QACRd,GAAG,QAAW,GAAdA,KAAAA,CAAc,GAAdA,GAAG,CAAEsB,SAAS,EAAE,AA9FpB,CA8FqB;KAClB;CACF"}
1
+ {"version":3,"sources":["../../../src/utils/downloadExpoGoAsync.ts"],"sourcesContent":["import { getExpoHomeDirectory } from '@expo/config/build/getUserState';\nimport path from 'path';\nimport ProgressBar from 'progress';\n\nimport { getVersionsAsync, SDKVersion } from '../api/getVersions';\nimport { downloadAppAsync } from './downloadAppAsync';\nimport { CommandError } from './errors';\nimport { ora } from './ora';\nimport { profile } from './profile';\nimport { createProgressBar } from './progress';\n\nconst debug = require('debug')('expo:utils:downloadExpoGo') as typeof console.log;\n\nconst platformSettings: Record<\n string,\n {\n shouldExtractResults: boolean;\n versionsKey: keyof SDKVersion;\n getFilePath: (filename: string) => string;\n }\n> = {\n ios: {\n versionsKey: 'iosClientUrl',\n getFilePath: (filename) =>\n path.join(getExpoHomeDirectory(), 'ios-simulator-app-cache', `${filename}.app`),\n shouldExtractResults: true,\n },\n android: {\n versionsKey: 'androidClientUrl',\n getFilePath: (filename) =>\n path.join(getExpoHomeDirectory(), 'android-apk-cache', `${filename}.apk`),\n shouldExtractResults: false,\n },\n};\n\n/** Download the Expo Go app from the Expo servers (if only it was this easy for every app). */\nexport async function downloadExpoGoAsync(\n platform: keyof typeof platformSettings,\n {\n url,\n sdkVersion,\n }: {\n url?: string;\n sdkVersion?: string;\n }\n): Promise<string> {\n const { getFilePath, versionsKey, shouldExtractResults } = platformSettings[platform];\n\n const spinner = ora({ text: 'Fetching Expo Go', color: 'white' }).start();\n\n let bar: ProgressBar | null = null;\n\n if (!url) {\n if (!sdkVersion) {\n throw new CommandError(\n `Unable to determine which Expo Go version to install (platform: ${platform})`\n );\n }\n const { sdkVersions: versions } = await getVersionsAsync();\n\n const version = versions[sdkVersion];\n if (!version) {\n throw new CommandError(\n `Unable to find a version of Expo Go for SDK ${sdkVersion} (platform: ${platform})`\n );\n }\n debug(`Installing Expo Go version for SDK ${sdkVersion} at URL: ${version[versionsKey]}`);\n url = version[versionsKey] as string;\n }\n\n const filename = path.parse(url).name;\n\n try {\n const outputPath = getFilePath(filename);\n debug(`Downloading Expo Go from \"${url}\" to \"${outputPath}\".`);\n debug(\n `The requested copy of Expo Go might already be cached in: \"${getExpoHomeDirectory()}\". You can disable the cache with EXPO_NO_CACHE=1`\n );\n await profile(downloadAppAsync)({\n url,\n // Save all encrypted cache data to `~/.expo/expo-go`\n cacheDirectory: 'expo-go',\n outputPath,\n extract: shouldExtractResults,\n onProgress({ progress, total }) {\n if (progress && total) {\n if (!bar) {\n if (spinner.isSpinning) {\n spinner.stop();\n }\n bar = createProgressBar('Downloading the Expo Go app [:bar] :percent :etas', {\n width: 64,\n total: 100,\n // clear: true,\n complete: '=',\n incomplete: ' ',\n });\n }\n bar!.update(progress, total);\n }\n },\n });\n return outputPath;\n } finally {\n spinner.stop();\n // @ts-expect-error\n bar?.terminate();\n }\n}\n"],"names":["downloadExpoGoAsync","debug","require","platformSettings","ios","versionsKey","getFilePath","filename","path","join","getExpoHomeDirectory","shouldExtractResults","android","platform","url","sdkVersion","spinner","ora","text","color","start","bar","CommandError","sdkVersions","versions","getVersionsAsync","version","parse","name","outputPath","profile","downloadAppAsync","cacheDirectory","extract","onProgress","progress","total","isSpinning","stop","createProgressBar","width","complete","incomplete","update","terminate"],"mappings":"AAAA;;;;QAoCsBA,mBAAmB,GAAnBA,mBAAmB;AApCJ,IAAA,aAAiC,WAAjC,iCAAiC,CAAA;AACrD,IAAA,KAAM,kCAAN,MAAM,EAAA;AAGsB,IAAA,YAAoB,WAApB,oBAAoB,CAAA;AAChC,IAAA,iBAAoB,WAApB,oBAAoB,CAAA;AACxB,IAAA,OAAU,WAAV,UAAU,CAAA;AACnB,IAAA,IAAO,WAAP,OAAO,CAAA;AACH,IA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AID,QAAQ,IAAIC,KAAK,EAAE;oBACrB,IAAI,CAACf,GAAG,EAAE;wBACR,IAAIL,OAAO,CAACqB,UAAU,EAAE;4BACtBrB,OAAO,CAACsB,IAAI,EAAE,CAAC;yBAChB;wBACDjB,GAAG,GAAGkB,CAAAA,GAAAA,SAAiB,AAMrB,CAAA,kBANqB,CAAC,mDAAmD,EAAE;4BAC3EC,KAAK,EAAE,EAAE;4BACTJ,KAAK,EAAE,GAAG;4BACV,eAAe;4BACfK,QAAQ,EAAE,GAAG;4BACbC,UAAU,EAAE,GAAG;yBAChB,CAAC,CAAC;qBACJ;oBACDrB,GAAG,CAAEsB,MAAM,CAACR,QAAQ,EAAEC,KAAK,CAAC,CAAC;iBAC9B;aACF;SACF,CAAC,CAAC;QACH,OAAOP,UAAU,CAAC;KACnB,QAAS;QACRb,OAAO,CAACsB,IAAI,EAAE,CAAC;QACf,mBAAmB;QACnBjB,GAAG,QAAW,GAAdA,KAAAA,CAAc,GAAdA,GAAG,CAAEuB,SAAS,EAAE,AA1GpB,CA0GqB;KAClB;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/cli",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "The Expo CLI",
5
5
  "main": "build/bin/cli",
6
6
  "bin": {
@@ -40,7 +40,7 @@
40
40
  "@expo/code-signing-certificates": "^0.0.2",
41
41
  "@expo/config": "~7.0.2",
42
42
  "@expo/config-plugins": "~5.0.3",
43
- "@expo/dev-server": "0.1.122",
43
+ "@expo/dev-server": "0.1.123",
44
44
  "@expo/devcert": "^1.0.0",
45
45
  "@expo/json-file": "^8.2.35",
46
46
  "@expo/metro-config": "~0.5.0",
@@ -138,5 +138,5 @@
138
138
  "structured-headers": "^0.4.1",
139
139
  "taskr": "1.1.0"
140
140
  },
141
- "gitHead": "1a87dcc55895a9e16e3d4fd0fa78f2244c1d961f"
141
+ "gitHead": "029acef85addf3f25136a50d0a7a178bd0b109dc"
142
142
  }