@expo/cli 0.4.6 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bin/cli +2 -2
- package/build/src/api/rest/client.js +6 -5
- package/build/src/api/rest/client.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithBaseUrl.js +1 -0
- package/build/src/api/rest/wrapFetchWithBaseUrl.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithOffline.js +2 -1
- package/build/src/api/rest/wrapFetchWithOffline.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithProgress.js +31 -26
- package/build/src/api/rest/wrapFetchWithProgress.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithProxy.js +2 -1
- package/build/src/api/rest/wrapFetchWithProxy.js.map +1 -1
- package/build/src/start/interface/interactiveActions.js +2 -3
- package/build/src/start/interface/interactiveActions.js.map +1 -1
- package/build/src/start/server/BundlerDevServer.js +8 -0
- package/build/src/start/server/BundlerDevServer.js.map +1 -1
- package/build/src/start/server/middleware/ClassicManifestMiddleware.js +1 -1
- package/build/src/utils/analytics/rudderstackClient.js +2 -2
- package/build/src/utils/downloadAppAsync.js +1 -2
- package/build/src/utils/downloadAppAsync.js.map +1 -1
- package/build/src/utils/downloadExpoGoAsync.js +23 -10
- package/build/src/utils/downloadExpoGoAsync.js.map +1 -1
- package/package.json +3 -3
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.
|
|
124
|
+
console.log("0.4.8");
|
|
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.
|
|
251
|
+
source_version: "0.4.8"
|
|
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
|
|
88
|
+
return fetch;
|
|
88
89
|
}
|
|
89
|
-
return (0, _wrapFetchWithCache).wrapFetchWithCache(fetch
|
|
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
|
|
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,CA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wBAAwB,CAACgD,cAAc,CAAC,CAAC,AAAC;AAMtF,SAAS/C,iBAAiB,CAAC,EAChCkD,KAAK,EAAGjC,oBAAoB,CAAA,EAC5BkC,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
|
-
|
|
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
|
|
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
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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"}
|
|
@@ -81,9 +81,8 @@ class DevServerManagerActions {
|
|
|
81
81
|
}
|
|
82
82
|
async openJsInspectorAsync() {
|
|
83
83
|
Log.log("Opening JavaScript inspector in the browser...");
|
|
84
|
-
const
|
|
85
|
-
(0, _assert).default(
|
|
86
|
-
const metroServerOrigin = `http://localhost:${port}`;
|
|
84
|
+
const metroServerOrigin = this.devServerManager.getDefaultDevServer().getJsInspectorBaseUrl();
|
|
85
|
+
(0, _assert).default(metroServerOrigin, "Metro dev server is not running");
|
|
87
86
|
const apps = await (0, _devServer).queryAllInspectorAppsAsync(metroServerOrigin);
|
|
88
87
|
if (!apps.length) {
|
|
89
88
|
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
|
|
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.getDefaultDevServer().getJsInspectorBaseUrl();\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","getJsInspectorBaseUrl","assert","apps","queryAllInspectorAppsAsync","length","warn","learnMore","app","openJsInspector","reloadApp","BLT","broadcastMessage","openMoreToolsAsync","value","selectAsync","title","name","toggleDevMenu"],"mappings":"AAAA;;;;AAA4D,IAAA,UAAkB,WAAlB,kBAAkB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AK,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;QAlGYxC,uBAAuB,GAAvBA,uBAAuB"}
|
|
@@ -257,6 +257,14 @@ class BundlerDevServer {
|
|
|
257
257
|
var _url;
|
|
258
258
|
return (_url = location.url) != null ? _url : null;
|
|
259
259
|
}
|
|
260
|
+
/** Get the base URL for JS inspector */ getJsInspectorBaseUrl() {
|
|
261
|
+
if (this.name !== "metro") {
|
|
262
|
+
throw new _errors.CommandError("DEV_SERVER", `Cannot get the JS inspector base url - bundler[${this.name}]`);
|
|
263
|
+
}
|
|
264
|
+
return this.getUrlCreator().constructUrl({
|
|
265
|
+
scheme: "http"
|
|
266
|
+
});
|
|
267
|
+
}
|
|
260
268
|
/** Get the tunnel URL from ngrok. */ getTunnelUrl() {
|
|
261
269
|
var ref;
|
|
262
270
|
var ref3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/start/server/BundlerDevServer.ts"],"sourcesContent":["import { MessageSocket } from '@expo/dev-server';\nimport assert from 'assert';\nimport openBrowserAsync from 'better-opn';\nimport resolveFrom from 'resolve-from';\n\nimport { APISettings } from '../../api/settings';\nimport * as Log from '../../log';\nimport { FileNotifier } from '../../utils/FileNotifier';\nimport { resolveWithTimeout } from '../../utils/delay';\nimport { env } from '../../utils/env';\nimport { CommandError } from '../../utils/errors';\nimport {\n BaseOpenInCustomProps,\n BaseResolveDeviceProps,\n PlatformManager,\n} from '../platforms/PlatformManager';\nimport { AsyncNgrok } from './AsyncNgrok';\nimport { DevelopmentSession } from './DevelopmentSession';\nimport { CreateURLOptions, UrlCreator } from './UrlCreator';\nimport { PlatformBundlers } from './platformBundlers';\n\nconst debug = require('debug')('expo:start:server:devServer') as typeof console.log;\n\nexport type ServerLike = {\n close(callback?: (err?: Error) => void): void;\n};\n\nexport type DevServerInstance = {\n /** Bundler dev server instance. */\n server: ServerLike;\n /** Dev server URL location properties. */\n location: {\n url: string;\n port: number;\n protocol: 'http' | 'https';\n host?: string;\n };\n /** Additional middleware that's attached to the `server`. */\n middleware: any;\n /** Message socket for communicating with the runtime. */\n messageSocket: MessageSocket;\n};\n\nexport interface BundlerStartOptions {\n /** Should the dev server use `https` protocol. */\n https?: boolean;\n /** Should start the dev servers in development mode (minify). */\n mode?: 'development' | 'production';\n /** Is dev client enabled. */\n devClient?: boolean;\n /** Should run dev servers with clean caches. */\n resetDevServer?: boolean;\n /** Which manifest type to serve. */\n forceManifestType?: 'expo-updates' | 'classic';\n /** Code signing private key path (defaults to same directory as certificate) */\n privateKeyPath?: string;\n\n /** Max amount of workers (threads) to use with Metro bundler, defaults to undefined for max workers. */\n maxWorkers?: number;\n /** Port to start the dev server on. */\n port?: number;\n\n /** Should start a headless dev server e.g. mock representation to approximate info from a server running in a different process. */\n headless?: boolean;\n /** Should instruct the bundler to create minified bundles. */\n minify?: boolean;\n\n // Webpack options\n /** Should modify and create PWA icons. */\n isImageEditingEnabled?: boolean;\n\n location: CreateURLOptions;\n}\n\nconst PLATFORM_MANAGERS = {\n simulator: () =>\n require('../platforms/ios/ApplePlatformManager')\n .ApplePlatformManager as typeof import('../platforms/ios/ApplePlatformManager').ApplePlatformManager,\n emulator: () =>\n require('../platforms/android/AndroidPlatformManager')\n .AndroidPlatformManager as typeof import('../platforms/android/AndroidPlatformManager').AndroidPlatformManager,\n};\n\nconst MIDDLEWARES = {\n classic: () =>\n require('./middleware/ClassicManifestMiddleware')\n .ClassicManifestMiddleware as typeof import('./middleware/ClassicManifestMiddleware').ClassicManifestMiddleware,\n 'expo-updates': () =>\n require('./middleware/ExpoGoManifestHandlerMiddleware')\n .ExpoGoManifestHandlerMiddleware as typeof import('./middleware/ExpoGoManifestHandlerMiddleware').ExpoGoManifestHandlerMiddleware,\n};\n\nexport abstract class BundlerDevServer {\n /** Name of the bundler. */\n abstract get name(): string;\n\n /** Ngrok instance for managing tunnel connections. */\n protected ngrok: AsyncNgrok | null = null;\n /** Interfaces with the Expo 'Development Session' API. */\n protected devSession: DevelopmentSession | null = null;\n /** Http server and related info. */\n protected instance: DevServerInstance | null = null;\n /** Native platform interfaces for opening projects. */\n private platformManagers: Record<string, PlatformManager<any>> = {};\n /** Manages the creation of dev server URLs. */\n protected urlCreator?: UrlCreator | null = null;\n\n constructor(\n /** Project root folder. */\n public projectRoot: string,\n /** A mapping of bundlers to platforms. */\n public platformBundlers: PlatformBundlers,\n // TODO: Replace with custom scheme maybe...\n public isDevClient?: boolean\n ) {}\n\n protected setInstance(instance: DevServerInstance) {\n this.instance = instance;\n }\n\n /** Get the manifest middleware function. */\n protected async getManifestMiddlewareAsync(\n options: Pick<\n BundlerStartOptions,\n 'minify' | 'mode' | 'forceManifestType' | 'privateKeyPath'\n > = {}\n ) {\n const manifestType = options.forceManifestType || 'classic';\n assert(manifestType in MIDDLEWARES, `Manifest middleware for type '${manifestType}' not found`);\n const Middleware = MIDDLEWARES[manifestType]();\n\n const urlCreator = this.getUrlCreator();\n const middleware = new Middleware(this.projectRoot, {\n constructUrl: urlCreator.constructUrl.bind(urlCreator),\n mode: options.mode,\n minify: options.minify,\n isNativeWebpack: this.name === 'webpack' && this.isTargetingNative(),\n privateKeyPath: options.privateKeyPath,\n });\n return middleware.getHandler();\n }\n\n /** Start the dev server using settings defined in the start command. */\n public async startAsync(options: BundlerStartOptions): Promise<DevServerInstance> {\n await this.stopAsync();\n\n let instance: DevServerInstance;\n if (options.headless) {\n instance = await this.startHeadlessAsync(options);\n } else {\n instance = await this.startImplementationAsync(options);\n }\n\n this.setInstance(instance);\n await this.postStartAsync(options);\n return instance;\n }\n\n protected abstract startImplementationAsync(\n options: BundlerStartOptions\n ): Promise<DevServerInstance>;\n\n /**\n * Creates a mock server representation that can be used to estimate URLs for a server started in another process.\n * This is used for the run commands where you can reuse the server from a previous run.\n */\n private async startHeadlessAsync(options: BundlerStartOptions): Promise<DevServerInstance> {\n if (!options.port)\n throw new CommandError('HEADLESS_SERVER', 'headless dev server requires a port option');\n this.urlCreator = this.getUrlCreator(options);\n\n return {\n // Create a mock server\n server: {\n close: () => {\n this.instance = null;\n },\n },\n location: {\n // The port is the main thing we want to send back.\n port: options.port,\n // localhost isn't always correct.\n host: 'localhost',\n // http is the only supported protocol on native.\n url: `http://localhost:${options.port}`,\n protocol: 'http',\n },\n middleware: {},\n messageSocket: {\n broadcast: () => {\n throw new CommandError('HEADLESS_SERVER', 'Cannot broadcast messages to headless server');\n },\n },\n };\n }\n\n /**\n * Runs after the `startAsync` function, performing any additional common operations.\n * You can assume the dev server is started by the time this function is called.\n */\n protected async postStartAsync(options: BundlerStartOptions) {\n if (\n options.location.hostType === 'tunnel' &&\n !APISettings.isOffline &&\n // This is a hack to prevent using tunnel on web since we block it upstream for some reason.\n this.isTargetingNative()\n ) {\n await this._startTunnelAsync();\n }\n await this.startDevSessionAsync();\n\n this.watchConfig();\n }\n\n protected abstract getConfigModuleIds(): string[];\n\n protected watchConfig() {\n const notifier = new FileNotifier(this.projectRoot, this.getConfigModuleIds());\n notifier.startObserving();\n }\n\n /** Create ngrok instance and start the tunnel server. Exposed for testing. */\n public async _startTunnelAsync(): Promise<AsyncNgrok | null> {\n const port = this.getInstance()?.location.port;\n if (!port) return null;\n debug('[ngrok] connect to port: ' + port);\n this.ngrok = new AsyncNgrok(this.projectRoot, port);\n await this.ngrok.startAsync();\n return this.ngrok;\n }\n\n protected async startDevSessionAsync() {\n // This is used to make Expo Go open the project in either Expo Go, or the web browser.\n // Must come after ngrok (`startTunnelAsync`) setup.\n\n if (this.devSession) {\n this.devSession.stopNotifying();\n }\n\n this.devSession = new DevelopmentSession(\n this.projectRoot,\n // This URL will be used on external devices so the computer IP won't be relevant.\n this.isTargetingNative()\n ? this.getNativeRuntimeUrl()\n : this.getDevServerUrl({ hostType: 'localhost' }),\n () => {\n // TODO: This appears to be happening consistently after an hour.\n // We should investigate why this is happening and fix it on our servers.\n // Log.error(\n // chalk.red(\n // '\\nAn unexpected error occurred while updating the Dev Session API. This project will not appear in the \"Development servers\" section of the Expo Go app until this process has been restarted.'\n // )\n // );\n // Log.exception(error);\n this.devSession?.closeAsync().catch((error) => {\n debug('[dev-session] error closing: ' + error.message);\n });\n }\n );\n\n await this.devSession.startAsync({\n runtime: this.isTargetingNative() ? 'native' : 'web',\n });\n }\n\n public isTargetingNative() {\n // Temporary hack while we implement multi-bundler dev server proxy.\n return true;\n }\n\n public isTargetingWeb() {\n return this.platformBundlers.web === this.name;\n }\n\n /**\n * Sends a message over web sockets to any connected device,\n * does nothing when the dev server is not running.\n *\n * @param method name of the command. In RN projects `reload`, and `devMenu` are available. In Expo Go, `sendDevCommand` is available.\n * @param params\n */\n public broadcastMessage(\n method: 'reload' | 'devMenu' | 'sendDevCommand',\n params?: Record<string, any>\n ) {\n this.getInstance()?.messageSocket.broadcast(method, params);\n }\n\n /** Get the running dev server instance. */\n public getInstance() {\n return this.instance;\n }\n\n /** Stop the running dev server instance. */\n async stopAsync() {\n // Stop the dev session timer and tell Expo API to remove dev session.\n await this.devSession?.closeAsync();\n\n // Stop ngrok if running.\n await this.ngrok?.stopAsync().catch((e) => {\n Log.error(`Error stopping ngrok:`);\n Log.exception(e);\n });\n\n return resolveWithTimeout(\n () =>\n new Promise<void>((resolve, reject) => {\n // Close the server.\n debug(`Stopping dev server (bundler: ${this.name})`);\n\n if (this.instance?.server) {\n this.instance.server.close((error) => {\n debug(`Stopped dev server (bundler: ${this.name})`);\n this.instance = null;\n if (error) {\n reject(error);\n } else {\n resolve();\n }\n });\n } else {\n debug(`Stopped dev server (bundler: ${this.name})`);\n this.instance = null;\n resolve();\n }\n }),\n {\n // NOTE(Bacon): Metro dev server doesn't seem to be closing in time.\n timeout: 1000,\n errorMessage: `Timeout waiting for '${this.name}' dev server to close`,\n }\n );\n }\n\n protected getUrlCreator(options: Partial<Pick<BundlerStartOptions, 'port' | 'location'>> = {}) {\n if (!this.urlCreator) {\n assert(options?.port, 'Dev server instance not found');\n this.urlCreator = new UrlCreator(options.location, {\n port: options.port,\n getTunnelUrl: this.getTunnelUrl.bind(this),\n });\n }\n return this.urlCreator;\n }\n\n public getNativeRuntimeUrl(opts: Partial<CreateURLOptions> = {}) {\n return this.isDevClient\n ? this.getUrlCreator().constructDevClientUrl(opts) ?? this.getDevServerUrl()\n : this.getUrlCreator().constructUrl({ ...opts, scheme: 'exp' });\n }\n\n /** Get the URL for the running instance of the dev server. */\n public getDevServerUrl(options: { hostType?: 'localhost' } = {}): string | null {\n const instance = this.getInstance();\n if (!instance?.location) {\n return null;\n }\n const { location } = instance;\n if (options.hostType === 'localhost') {\n return `${location.protocol}://localhost:${location.port}`;\n }\n return location.url ?? null;\n }\n\n /** Get the tunnel URL from ngrok. */\n public getTunnelUrl(): string | null {\n return this.ngrok?.getActiveUrl() ?? null;\n }\n\n /** Open the dev server in a runtime. */\n public async openPlatformAsync(\n launchTarget: keyof typeof PLATFORM_MANAGERS | 'desktop',\n resolver: BaseResolveDeviceProps<any> = {}\n ) {\n if (launchTarget === 'desktop') {\n const serverUrl = this.getDevServerUrl({ hostType: 'localhost' });\n // Allow opening the tunnel URL when using Metro web.\n const url = this.name === 'metro' ? this.getTunnelUrl() ?? serverUrl : serverUrl;\n await openBrowserAsync(url!);\n return { url };\n }\n\n const runtime = this.isTargetingNative() ? (this.isDevClient ? 'custom' : 'expo') : 'web';\n const manager = await this.getPlatformManagerAsync(launchTarget);\n return manager.openAsync({ runtime }, resolver);\n }\n\n /** Open the dev server in a runtime. */\n public async openCustomRuntimeAsync(\n launchTarget: keyof typeof PLATFORM_MANAGERS,\n launchProps: Partial<BaseOpenInCustomProps> = {},\n resolver: BaseResolveDeviceProps<any> = {}\n ) {\n const runtime = this.isTargetingNative() ? (this.isDevClient ? 'custom' : 'expo') : 'web';\n if (runtime !== 'custom') {\n throw new CommandError(\n `dev server cannot open custom runtimes either because it does not target native platforms or because it is not targeting dev clients. (target: ${runtime})`\n );\n }\n\n const manager = await this.getPlatformManagerAsync(launchTarget);\n return manager.openAsync({ runtime: 'custom', props: launchProps }, resolver);\n }\n\n /** Get the URL for opening in Expo Go. */\n protected getExpoGoUrl(): string {\n return this.getUrlCreator().constructUrl({ scheme: 'exp' });\n }\n\n /** Should use the interstitial page for selecting which runtime to use. */\n protected isRedirectPageEnabled(): boolean {\n return (\n !env.EXPO_NO_REDIRECT_PAGE &&\n // if user passed --dev-client flag, skip interstitial page\n !this.isDevClient &&\n // Checks if dev client is installed.\n !!resolveFrom.silent(this.projectRoot, 'expo-dev-client')\n );\n }\n\n /** Get the redirect URL when redirecting is enabled. */\n public getRedirectUrl(platform: keyof typeof PLATFORM_MANAGERS | null = null): string | null {\n if (!this.isRedirectPageEnabled()) {\n debug('Redirect page is disabled');\n return null;\n }\n\n return (\n this.getUrlCreator().constructLoadingUrl(\n {},\n platform === 'emulator' ? 'android' : platform === 'simulator' ? 'ios' : null\n ) ?? null\n );\n }\n\n protected async getPlatformManagerAsync(platform: keyof typeof PLATFORM_MANAGERS) {\n if (!this.platformManagers[platform]) {\n const Manager = PLATFORM_MANAGERS[platform]();\n const port = this.getInstance()?.location.port;\n if (!port || !this.urlCreator) {\n throw new CommandError(\n 'DEV_SERVER',\n 'Cannot interact with native platforms until dev server has started'\n );\n }\n debug(`Creating platform manager (platform: ${platform}, port: ${port})`);\n this.platformManagers[platform] = new Manager(this.projectRoot, port, {\n getCustomRuntimeUrl: this.urlCreator.constructDevClientUrl.bind(this.urlCreator),\n getExpoGoUrl: this.getExpoGoUrl.bind(this),\n getRedirectUrl: this.getRedirectUrl.bind(this, platform),\n getDevServerUrl: this.getDevServerUrl.bind(this, { hostType: 'localhost' }),\n });\n }\n return this.platformManagers[platform];\n }\n}\n"],"names":["Log","debug","require","PLATFORM_MANAGERS","simulator","ApplePlatformManager","emulator","AndroidPlatformManager","MIDDLEWARES","classic","ClassicManifestMiddleware","ExpoGoManifestHandlerMiddleware","BundlerDevServer","constructor","projectRoot","platformBundlers","isDevClient","ngrok","devSession","instance","platformManagers","urlCreator","setInstance","getManifestMiddlewareAsync","options","manifestType","forceManifestType","assert","Middleware","getUrlCreator","middleware","constructUrl","bind","mode","minify","isNativeWebpack","name","isTargetingNative","privateKeyPath","getHandler","startAsync","stopAsync","headless","startHeadlessAsync","startImplementationAsync","postStartAsync","port","CommandError","server","close","location","host","url","protocol","messageSocket","broadcast","hostType","APISettings","isOffline","_startTunnelAsync","startDevSessionAsync","watchConfig","notifier","FileNotifier","getConfigModuleIds","startObserving","getInstance","AsyncNgrok","stopNotifying","DevelopmentSession","getNativeRuntimeUrl","getDevServerUrl","closeAsync","catch","error","message","runtime","isTargetingWeb","web","broadcastMessage","method","params","e","exception","resolveWithTimeout","Promise","resolve","reject","timeout","errorMessage","UrlCreator","getTunnelUrl","opts","constructDevClientUrl","scheme","getActiveUrl","openPlatformAsync","launchTarget","resolver","serverUrl","openBrowserAsync","manager","getPlatformManagerAsync","openAsync","openCustomRuntimeAsync","launchProps","props","getExpoGoUrl","isRedirectPageEnabled","env","EXPO_NO_REDIRECT_PAGE","resolveFrom","silent","getRedirectUrl","platform","constructLoadingUrl","Manager","getCustomRunt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AACjF,IAAI,CAAC,IAAI,EAAEkF,QAAQ,CAAC;gBACxD3C,eAAe,EAAE,IAAI,CAACA,eAAe,CAACvC,IAAI,CAAC,IAAI,EAAE;oBAAEwB,QAAQ,EAAE,WAAW;iBAAE,CAAC;aAC5E,CAAC,CAAC;SACJ;QACD,OAAO,IAAI,CAACpC,gBAAgB,CAAC8F,QAAQ,CAAC,CAAC;KACxC;CACF;QA3WqBtG,gBAAgB,GAAhBA,gBAAgB"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/start/server/BundlerDevServer.ts"],"sourcesContent":["import { MessageSocket } from '@expo/dev-server';\nimport assert from 'assert';\nimport openBrowserAsync from 'better-opn';\nimport resolveFrom from 'resolve-from';\n\nimport { APISettings } from '../../api/settings';\nimport * as Log from '../../log';\nimport { FileNotifier } from '../../utils/FileNotifier';\nimport { resolveWithTimeout } from '../../utils/delay';\nimport { env } from '../../utils/env';\nimport { CommandError } from '../../utils/errors';\nimport {\n BaseOpenInCustomProps,\n BaseResolveDeviceProps,\n PlatformManager,\n} from '../platforms/PlatformManager';\nimport { AsyncNgrok } from './AsyncNgrok';\nimport { DevelopmentSession } from './DevelopmentSession';\nimport { CreateURLOptions, UrlCreator } from './UrlCreator';\nimport { PlatformBundlers } from './platformBundlers';\n\nconst debug = require('debug')('expo:start:server:devServer') as typeof console.log;\n\nexport type ServerLike = {\n close(callback?: (err?: Error) => void): void;\n};\n\nexport type DevServerInstance = {\n /** Bundler dev server instance. */\n server: ServerLike;\n /** Dev server URL location properties. */\n location: {\n url: string;\n port: number;\n protocol: 'http' | 'https';\n host?: string;\n };\n /** Additional middleware that's attached to the `server`. */\n middleware: any;\n /** Message socket for communicating with the runtime. */\n messageSocket: MessageSocket;\n};\n\nexport interface BundlerStartOptions {\n /** Should the dev server use `https` protocol. */\n https?: boolean;\n /** Should start the dev servers in development mode (minify). */\n mode?: 'development' | 'production';\n /** Is dev client enabled. */\n devClient?: boolean;\n /** Should run dev servers with clean caches. */\n resetDevServer?: boolean;\n /** Which manifest type to serve. */\n forceManifestType?: 'expo-updates' | 'classic';\n /** Code signing private key path (defaults to same directory as certificate) */\n privateKeyPath?: string;\n\n /** Max amount of workers (threads) to use with Metro bundler, defaults to undefined for max workers. */\n maxWorkers?: number;\n /** Port to start the dev server on. */\n port?: number;\n\n /** Should start a headless dev server e.g. mock representation to approximate info from a server running in a different process. */\n headless?: boolean;\n /** Should instruct the bundler to create minified bundles. */\n minify?: boolean;\n\n // Webpack options\n /** Should modify and create PWA icons. */\n isImageEditingEnabled?: boolean;\n\n location: CreateURLOptions;\n}\n\nconst PLATFORM_MANAGERS = {\n simulator: () =>\n require('../platforms/ios/ApplePlatformManager')\n .ApplePlatformManager as typeof import('../platforms/ios/ApplePlatformManager').ApplePlatformManager,\n emulator: () =>\n require('../platforms/android/AndroidPlatformManager')\n .AndroidPlatformManager as typeof import('../platforms/android/AndroidPlatformManager').AndroidPlatformManager,\n};\n\nconst MIDDLEWARES = {\n classic: () =>\n require('./middleware/ClassicManifestMiddleware')\n .ClassicManifestMiddleware as typeof import('./middleware/ClassicManifestMiddleware').ClassicManifestMiddleware,\n 'expo-updates': () =>\n require('./middleware/ExpoGoManifestHandlerMiddleware')\n .ExpoGoManifestHandlerMiddleware as typeof import('./middleware/ExpoGoManifestHandlerMiddleware').ExpoGoManifestHandlerMiddleware,\n};\n\nexport abstract class BundlerDevServer {\n /** Name of the bundler. */\n abstract get name(): string;\n\n /** Ngrok instance for managing tunnel connections. */\n protected ngrok: AsyncNgrok | null = null;\n /** Interfaces with the Expo 'Development Session' API. */\n protected devSession: DevelopmentSession | null = null;\n /** Http server and related info. */\n protected instance: DevServerInstance | null = null;\n /** Native platform interfaces for opening projects. */\n private platformManagers: Record<string, PlatformManager<any>> = {};\n /** Manages the creation of dev server URLs. */\n protected urlCreator?: UrlCreator | null = null;\n\n constructor(\n /** Project root folder. */\n public projectRoot: string,\n /** A mapping of bundlers to platforms. */\n public platformBundlers: PlatformBundlers,\n // TODO: Replace with custom scheme maybe...\n public isDevClient?: boolean\n ) {}\n\n protected setInstance(instance: DevServerInstance) {\n this.instance = instance;\n }\n\n /** Get the manifest middleware function. */\n protected async getManifestMiddlewareAsync(\n options: Pick<\n BundlerStartOptions,\n 'minify' | 'mode' | 'forceManifestType' | 'privateKeyPath'\n > = {}\n ) {\n const manifestType = options.forceManifestType || 'classic';\n assert(manifestType in MIDDLEWARES, `Manifest middleware for type '${manifestType}' not found`);\n const Middleware = MIDDLEWARES[manifestType]();\n\n const urlCreator = this.getUrlCreator();\n const middleware = new Middleware(this.projectRoot, {\n constructUrl: urlCreator.constructUrl.bind(urlCreator),\n mode: options.mode,\n minify: options.minify,\n isNativeWebpack: this.name === 'webpack' && this.isTargetingNative(),\n privateKeyPath: options.privateKeyPath,\n });\n return middleware.getHandler();\n }\n\n /** Start the dev server using settings defined in the start command. */\n public async startAsync(options: BundlerStartOptions): Promise<DevServerInstance> {\n await this.stopAsync();\n\n let instance: DevServerInstance;\n if (options.headless) {\n instance = await this.startHeadlessAsync(options);\n } else {\n instance = await this.startImplementationAsync(options);\n }\n\n this.setInstance(instance);\n await this.postStartAsync(options);\n return instance;\n }\n\n protected abstract startImplementationAsync(\n options: BundlerStartOptions\n ): Promise<DevServerInstance>;\n\n /**\n * Creates a mock server representation that can be used to estimate URLs for a server started in another process.\n * This is used for the run commands where you can reuse the server from a previous run.\n */\n private async startHeadlessAsync(options: BundlerStartOptions): Promise<DevServerInstance> {\n if (!options.port)\n throw new CommandError('HEADLESS_SERVER', 'headless dev server requires a port option');\n this.urlCreator = this.getUrlCreator(options);\n\n return {\n // Create a mock server\n server: {\n close: () => {\n this.instance = null;\n },\n },\n location: {\n // The port is the main thing we want to send back.\n port: options.port,\n // localhost isn't always correct.\n host: 'localhost',\n // http is the only supported protocol on native.\n url: `http://localhost:${options.port}`,\n protocol: 'http',\n },\n middleware: {},\n messageSocket: {\n broadcast: () => {\n throw new CommandError('HEADLESS_SERVER', 'Cannot broadcast messages to headless server');\n },\n },\n };\n }\n\n /**\n * Runs after the `startAsync` function, performing any additional common operations.\n * You can assume the dev server is started by the time this function is called.\n */\n protected async postStartAsync(options: BundlerStartOptions) {\n if (\n options.location.hostType === 'tunnel' &&\n !APISettings.isOffline &&\n // This is a hack to prevent using tunnel on web since we block it upstream for some reason.\n this.isTargetingNative()\n ) {\n await this._startTunnelAsync();\n }\n await this.startDevSessionAsync();\n\n this.watchConfig();\n }\n\n protected abstract getConfigModuleIds(): string[];\n\n protected watchConfig() {\n const notifier = new FileNotifier(this.projectRoot, this.getConfigModuleIds());\n notifier.startObserving();\n }\n\n /** Create ngrok instance and start the tunnel server. Exposed for testing. */\n public async _startTunnelAsync(): Promise<AsyncNgrok | null> {\n const port = this.getInstance()?.location.port;\n if (!port) return null;\n debug('[ngrok] connect to port: ' + port);\n this.ngrok = new AsyncNgrok(this.projectRoot, port);\n await this.ngrok.startAsync();\n return this.ngrok;\n }\n\n protected async startDevSessionAsync() {\n // This is used to make Expo Go open the project in either Expo Go, or the web browser.\n // Must come after ngrok (`startTunnelAsync`) setup.\n\n if (this.devSession) {\n this.devSession.stopNotifying();\n }\n\n this.devSession = new DevelopmentSession(\n this.projectRoot,\n // This URL will be used on external devices so the computer IP won't be relevant.\n this.isTargetingNative()\n ? this.getNativeRuntimeUrl()\n : this.getDevServerUrl({ hostType: 'localhost' }),\n () => {\n // TODO: This appears to be happening consistently after an hour.\n // We should investigate why this is happening and fix it on our servers.\n // Log.error(\n // chalk.red(\n // '\\nAn unexpected error occurred while updating the Dev Session API. This project will not appear in the \"Development servers\" section of the Expo Go app until this process has been restarted.'\n // )\n // );\n // Log.exception(error);\n this.devSession?.closeAsync().catch((error) => {\n debug('[dev-session] error closing: ' + error.message);\n });\n }\n );\n\n await this.devSession.startAsync({\n runtime: this.isTargetingNative() ? 'native' : 'web',\n });\n }\n\n public isTargetingNative() {\n // Temporary hack while we implement multi-bundler dev server proxy.\n return true;\n }\n\n public isTargetingWeb() {\n return this.platformBundlers.web === this.name;\n }\n\n /**\n * Sends a message over web sockets to any connected device,\n * does nothing when the dev server is not running.\n *\n * @param method name of the command. In RN projects `reload`, and `devMenu` are available. In Expo Go, `sendDevCommand` is available.\n * @param params\n */\n public broadcastMessage(\n method: 'reload' | 'devMenu' | 'sendDevCommand',\n params?: Record<string, any>\n ) {\n this.getInstance()?.messageSocket.broadcast(method, params);\n }\n\n /** Get the running dev server instance. */\n public getInstance() {\n return this.instance;\n }\n\n /** Stop the running dev server instance. */\n async stopAsync() {\n // Stop the dev session timer and tell Expo API to remove dev session.\n await this.devSession?.closeAsync();\n\n // Stop ngrok if running.\n await this.ngrok?.stopAsync().catch((e) => {\n Log.error(`Error stopping ngrok:`);\n Log.exception(e);\n });\n\n return resolveWithTimeout(\n () =>\n new Promise<void>((resolve, reject) => {\n // Close the server.\n debug(`Stopping dev server (bundler: ${this.name})`);\n\n if (this.instance?.server) {\n this.instance.server.close((error) => {\n debug(`Stopped dev server (bundler: ${this.name})`);\n this.instance = null;\n if (error) {\n reject(error);\n } else {\n resolve();\n }\n });\n } else {\n debug(`Stopped dev server (bundler: ${this.name})`);\n this.instance = null;\n resolve();\n }\n }),\n {\n // NOTE(Bacon): Metro dev server doesn't seem to be closing in time.\n timeout: 1000,\n errorMessage: `Timeout waiting for '${this.name}' dev server to close`,\n }\n );\n }\n\n protected getUrlCreator(options: Partial<Pick<BundlerStartOptions, 'port' | 'location'>> = {}) {\n if (!this.urlCreator) {\n assert(options?.port, 'Dev server instance not found');\n this.urlCreator = new UrlCreator(options.location, {\n port: options.port,\n getTunnelUrl: this.getTunnelUrl.bind(this),\n });\n }\n return this.urlCreator;\n }\n\n public getNativeRuntimeUrl(opts: Partial<CreateURLOptions> = {}) {\n return this.isDevClient\n ? this.getUrlCreator().constructDevClientUrl(opts) ?? this.getDevServerUrl()\n : this.getUrlCreator().constructUrl({ ...opts, scheme: 'exp' });\n }\n\n /** Get the URL for the running instance of the dev server. */\n public getDevServerUrl(options: { hostType?: 'localhost' } = {}): string | null {\n const instance = this.getInstance();\n if (!instance?.location) {\n return null;\n }\n const { location } = instance;\n if (options.hostType === 'localhost') {\n return `${location.protocol}://localhost:${location.port}`;\n }\n return location.url ?? null;\n }\n\n /** Get the base URL for JS inspector */\n public getJsInspectorBaseUrl(): string {\n if (this.name !== 'metro') {\n throw new CommandError(\n 'DEV_SERVER',\n `Cannot get the JS inspector base url - bundler[${this.name}]`\n );\n }\n return this.getUrlCreator().constructUrl({ scheme: 'http' });\n }\n\n /** Get the tunnel URL from ngrok. */\n public getTunnelUrl(): string | null {\n return this.ngrok?.getActiveUrl() ?? null;\n }\n\n /** Open the dev server in a runtime. */\n public async openPlatformAsync(\n launchTarget: keyof typeof PLATFORM_MANAGERS | 'desktop',\n resolver: BaseResolveDeviceProps<any> = {}\n ) {\n if (launchTarget === 'desktop') {\n const serverUrl = this.getDevServerUrl({ hostType: 'localhost' });\n // Allow opening the tunnel URL when using Metro web.\n const url = this.name === 'metro' ? this.getTunnelUrl() ?? serverUrl : serverUrl;\n await openBrowserAsync(url!);\n return { url };\n }\n\n const runtime = this.isTargetingNative() ? (this.isDevClient ? 'custom' : 'expo') : 'web';\n const manager = await this.getPlatformManagerAsync(launchTarget);\n return manager.openAsync({ runtime }, resolver);\n }\n\n /** Open the dev server in a runtime. */\n public async openCustomRuntimeAsync(\n launchTarget: keyof typeof PLATFORM_MANAGERS,\n launchProps: Partial<BaseOpenInCustomProps> = {},\n resolver: BaseResolveDeviceProps<any> = {}\n ) {\n const runtime = this.isTargetingNative() ? (this.isDevClient ? 'custom' : 'expo') : 'web';\n if (runtime !== 'custom') {\n throw new CommandError(\n `dev server cannot open custom runtimes either because it does not target native platforms or because it is not targeting dev clients. (target: ${runtime})`\n );\n }\n\n const manager = await this.getPlatformManagerAsync(launchTarget);\n return manager.openAsync({ runtime: 'custom', props: launchProps }, resolver);\n }\n\n /** Get the URL for opening in Expo Go. */\n protected getExpoGoUrl(): string {\n return this.getUrlCreator().constructUrl({ scheme: 'exp' });\n }\n\n /** Should use the interstitial page for selecting which runtime to use. */\n protected isRedirectPageEnabled(): boolean {\n return (\n !env.EXPO_NO_REDIRECT_PAGE &&\n // if user passed --dev-client flag, skip interstitial page\n !this.isDevClient &&\n // Checks if dev client is installed.\n !!resolveFrom.silent(this.projectRoot, 'expo-dev-client')\n );\n }\n\n /** Get the redirect URL when redirecting is enabled. */\n public getRedirectUrl(platform: keyof typeof PLATFORM_MANAGERS | null = null): string | null {\n if (!this.isRedirectPageEnabled()) {\n debug('Redirect page is disabled');\n return null;\n }\n\n return (\n this.getUrlCreator().constructLoadingUrl(\n {},\n platform === 'emulator' ? 'android' : platform === 'simulator' ? 'ios' : null\n ) ?? null\n );\n }\n\n protected async getPlatformManagerAsync(platform: keyof typeof PLATFORM_MANAGERS) {\n if (!this.platformManagers[platform]) {\n const Manager = PLATFORM_MANAGERS[platform]();\n const port = this.getInstance()?.location.port;\n if (!port || !this.urlCreator) {\n throw new CommandError(\n 'DEV_SERVER',\n 'Cannot interact with native platforms until dev server has started'\n );\n }\n debug(`Creating platform manager (platform: ${platform}, port: ${port})`);\n this.platformManagers[platform] = new Manager(this.projectRoot, port, {\n getCustomRuntimeUrl: this.urlCreator.constructDevClientUrl.bind(this.urlCreator),\n getExpoGoUrl: this.getExpoGoUrl.bind(this),\n getRedirectUrl: this.getRedirectUrl.bind(this, platform),\n getDevServerUrl: this.getDevServerUrl.bind(this, { hostType: 'localhost' }),\n });\n }\n return this.platformManagers[platform];\n }\n}\n"],"names":["Log","debug","require","PLATFORM_MANAGERS","simulator","ApplePlatformManager","emulator","AndroidPlatformManager","MIDDLEWARES","classic","ClassicManifestMiddleware","ExpoGoManifestHandlerMiddleware","BundlerDevServer","constructor","projectRoot","platformBundlers","isDevClient","ngrok","devSession","instance","platformManagers","urlCreator","setInstance","getManifestMiddlewareAsync","options","manifestType","forceManifestType","assert","Middleware","getUrlCreator","middleware","constructUrl","bind","mode","minify","isNativeWebpack","name","isTargetingNative","privateKeyPath","getHandler","startAsync","stopAsync","headless","startHeadlessAsync","startImplementationAsync","postStartAsync","port","CommandError","server","close","location","host","url","protocol","messageSocket","broadcast","hostType","APISettings","isOffline","_startTunnelAsync","startDevSessionAsync","watchConfig","notifier","FileNotifier","getConfigModuleIds","startObserving","getInstance","AsyncNgrok","stopNotifying","DevelopmentSession","getNativeRuntimeUrl","getDevServerUrl","closeAsync","catch","error","message","runtime","isTargetingWeb","web","broadcastMessage","method","params","e","exception","resolveWithTimeout","Promise","resolve","reject","timeout","errorMessage","UrlCreator","getTunnelUrl","opts","constructDevClientUrl","scheme","getJsInspectorBaseUrl","getActiveUrl","openPlatformAsync","launchTarget","resolver","serverUrl","openBrowserAsync","manager","getPlatformManagerAsync","openAsync","openCustomRuntimeAsync","launchProps","props","getExpoGoUrl","isRedirectPageEnabled","env","EXPO_NO_REDIRECT_PAGE","resolveFrom","silent","getRedirectUrl","platform","constructLoadingUrl","Manager","getCustomRuntimeUrl"],"mappings":"AAAA;;;;AACmB,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AACE,IAAA,UAAY,kCAAZ,YAAY,EAAA;AACjB,IAAA,YAAc,kCAAd,cAAc,EAAA;AAEV,IAAA,SAAoB,WAApB,oBAAoB,CAAA;AACpCA,IAAAA,GAAG,mCAAM,WAAW,EAAjB;AACc,IAAA,aAA0B,WAA1B,0BAA0B,CAAA;AACpB,IAAA,MAAmB,WAAnB,mBAAmB,CAAA;AAClC,IAAA,IAAiB,WAAjB,iBAAiB,CAAA;AACR,IAAA,OAAoB,WAApB,oBAAoB,CAAA;AAMtB,IAAA,WAAc,WAAd,cAAc,CAAA;AACN,IAAA,mBAAsB,WAAtB,sBAAsB,CAAA;AACZ,IAAA,WAAc,WAAd,cAAc,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAG3D,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,6BAA6B,CAAC,AAAsB,AAAC;AAqDpF,MAAMC,iBAAiB,GAAG;IACxBC,SAAS,EAAE,I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|
host: await _userSettings.default.getAnonymousIdentifierAsync(),
|
|
131
131
|
server: "expo",
|
|
132
132
|
// Defined in the build step
|
|
133
|
-
serverVersion: "0.4.
|
|
133
|
+
serverVersion: "0.4.8",
|
|
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.
|
|
97
|
+
source_version: "0.4.8",
|
|
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.
|
|
138
|
+
version: "0.4.8"
|
|
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
|
|
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 {
|
|
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 { 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,AAA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QAAA,CAACC,QAAQ,CAACrB,UAAU,CAAC;SAAE,CAAC,AAAC;QACpE,MAAMF,aAAa,CAAC;YAAEC,GAAG;YAAEC,UAAU,EAAEgB,OAAO;YAAEf,cAAc;YAAEC,UAAU;SAAE,CAAC,CAAC;QAC9EV,KAAK,CAAC,CAAC,WAAW,EAAEwB,OAAO,CAAC,IAAI,EAAEhB,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
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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 (
|
|
67
|
-
bar
|
|
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
|
|
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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,CAAA,qBAAF,EAAE,CAAC,iDAAiD,CAAC,CACxI,CAAC;QACF,MAAMoB,CAAAA,GAAAA,QAAO,AAAkB,CAAA,QAAlB,CAACC,iBAAgB,iBAAA,CAAC,CAAC;YAC9BjB,GAAG;YACH,qDAAqD;YACrDkB,cAAc,EAAE,SAAS;YACzBH,UAAU;YACVI,OAAO,EAAEtB,oBAAoB;YAC7BuB,UAAU,EAAC,EAAEC,QAAQ,CAAA,EAAEC,KAAK,CAAA,EAAE,EAAE;gBAC9B,IAAID,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.
|
|
3
|
+
"version": "0.4.8",
|
|
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.
|
|
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": "
|
|
141
|
+
"gitHead": "4cfefb886fd394c376290f24dabf987cdd6e6ca0"
|
|
142
142
|
}
|