@expo/cli 0.22.8 → 0.22.9
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 +1 -1
- package/build/src/api/rest/client.js +2 -0
- package/build/src/api/rest/client.js.map +1 -1
- package/build/src/export/embed/exportEmbedAsync.js +3 -3
- package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
- package/build/src/export/embed/index.js +4 -0
- package/build/src/export/embed/index.js.map +1 -1
- package/build/src/export/embed/resolveOptions.js +2 -1
- package/build/src/export/embed/resolveOptions.js.map +1 -1
- package/build/src/install/index.js +1 -0
- package/build/src/install/index.js.map +1 -1
- package/build/src/install/installAsync.js +2 -1
- package/build/src/install/installAsync.js.map +1 -1
- package/build/src/install/installExpoPackage.js +14 -6
- package/build/src/install/installExpoPackage.js.map +1 -1
- package/build/src/install/resolveOptions.js +2 -0
- package/build/src/install/resolveOptions.js.map +1 -1
- package/build/src/utils/env.js +3 -0
- package/build/src/utils/env.js.map +1 -1
- package/build/src/utils/ip.js +8 -1
- package/build/src/utils/ip.js.map +1 -1
- package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
- package/build/src/utils/telemetry/utils/context.js +1 -1
- package/package.json +14 -14
package/build/bin/cli
CHANGED
|
@@ -125,6 +125,7 @@ function wrapFetchWithCredentials(fetchFunction) {
|
|
|
125
125
|
* Determine if the provided error is related to a network issue.
|
|
126
126
|
* When this returns true, offline mode should be enabled.
|
|
127
127
|
* - `ENOTFOUND` is thrown when the DNS lookup failed
|
|
128
|
+
* - `EAI_AGAIN` is thrown when DNS lookup failed due to a server-side error
|
|
128
129
|
* - `UND_ERR_CONNECT_TIMEOUT` is thrown after DNS is resolved, but server can't be reached
|
|
129
130
|
*
|
|
130
131
|
* @see https://nodejs.org/api/errors.html
|
|
@@ -132,6 +133,7 @@ function wrapFetchWithCredentials(fetchFunction) {
|
|
|
132
133
|
*/ function isNetworkError(error) {
|
|
133
134
|
return "code" in error && error.code && [
|
|
134
135
|
"ENOTFOUND",
|
|
136
|
+
"EAI_AGAIN",
|
|
135
137
|
"UND_ERR_CONNECT_TIMEOUT"
|
|
136
138
|
].includes(error.code);
|
|
137
139
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/api/rest/client.ts"],"sourcesContent":["import { getExpoHomeDirectory } from '@expo/config/build/getUserState';\nimport type { JSONValue } from '@expo/json-file';\nimport path from 'path';\n\nimport { wrapFetchWithCache } from './cache/wrapFetchWithCache';\nimport type { FetchLike } from './client.types';\nimport { wrapFetchWithBaseUrl } from './wrapFetchWithBaseUrl';\nimport { wrapFetchWithOffline } from './wrapFetchWithOffline';\nimport { wrapFetchWithProgress } from './wrapFetchWithProgress';\nimport { wrapFetchWithProxy } from './wrapFetchWithProxy';\nimport { wrapFetchWithUserAgent } from './wrapFetchWithUserAgent';\nimport { env } from '../../utils/env';\nimport { CommandError } from '../../utils/errors';\nimport { fetch } from '../../utils/fetch';\nimport { getExpoApiBaseUrl } from '../endpoint';\nimport { disableNetwork } from '../settings';\nimport { getAccessToken, getSession } from '../user/UserSettings';\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 * An error defining that the server 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 client.\n */\nexport class UnexpectedServerData extends Error {\n readonly name = 'UnexpectedServerData';\n}\n\n/** Validate the response json contains `.data` property, or throw an unexpected server data error */\nexport function getResponseDataOrThrow<T = any>(json: unknown): T {\n if (!!json && typeof json === 'object' && 'data' in json) {\n return json.data as T;\n }\n\n throw new UnexpectedServerData(\n !!json && typeof json === 'object' ? JSON.stringify(json) : 'Unknown data received from server.'\n );\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 = getAccessToken();\n if (token) {\n resolvedHeaders.authorization = `Bearer ${token}`;\n } else {\n const sessionSecret = getSession()?.sessionSecret;\n if (sessionSecret) {\n resolvedHeaders['expo-session'] = sessionSecret;\n }\n }\n\n try {\n const response = await fetchFunction(url, {\n ...options,\n headers: resolvedHeaders,\n });\n\n // Handle expected API errors (4xx)\n if (response.status >= 400 && response.status < 500) {\n const body = await response.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\n return response;\n } catch (error: any) {\n // When running `expo start`, but wifi or internet has issues\n if (\n isNetworkError(error) || // node-fetch error handling\n ('cause' in error && isNetworkError(error.cause)) // undici error handling\n ) {\n disableNetwork();\n\n throw new CommandError(\n 'OFFLINE',\n 'Network connection is unreliable. Try again with the environment variable `EXPO_OFFLINE=1` to skip network requests.'\n );\n }\n\n throw error;\n }\n };\n}\n\n/**\n * Determine if the provided error is related to a network issue.\n * When this returns true, offline mode should be enabled.\n * - `ENOTFOUND` is thrown when the DNS lookup failed\n * - `UND_ERR_CONNECT_TIMEOUT` is thrown after DNS is resolved, but server can't be reached\n *\n * @see https://nodejs.org/api/errors.html\n * @see https://github.com/nodejs/undici#network-address-family-autoselection\n */\nfunction isNetworkError(error: Error & { code?: string }) {\n return (\n 'code' in error && error.code && ['ENOTFOUND', 'UND_ERR_CONNECT_TIMEOUT'].includes(error.code)\n );\n}\n\nconst fetchWithOffline = wrapFetchWithOffline(wrapFetchWithUserAgent(fetch));\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 const { FileSystemResponseCache } =\n require('./cache/FileSystemResponseCache') as typeof import('./cache/FileSystemResponseCache');\n\n return wrapFetchWithCache(\n fetch,\n new FileSystemResponseCache({\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":["ApiV2Error","UnexpectedServerError","UnexpectedServerData","getResponseDataOrThrow","wrapFetchWithCredentials","createCachedFetch","fetchAsync","Error","name","constructor","response","message","code","expoApiV2ErrorCode","expoApiV2ErrorDetails","details","expoApiV2ErrorServerStack","stack","expoApiV2ErrorMetadata","metadata","json","data","JSON","stringify","fetchFunction","fetchWithCredentials","url","options","Array","isArray","headers","resolvedHeaders","token","getAccessToken","authorization","getSession","sessionSecret","status","body","text","parse","errors","length","error","includes","isNetworkError","cause","disableNetwork","CommandError","fetchWithOffline","wrapFetchWithOffline","wrapFetchWithUserAgent","fetch","fetchWithBaseUrl","wrapFetchWithBaseUrl","getExpoApiBaseUrl","fetchWithProxy","wrapFetchWithProxy","wrapFetchWithProgress","cacheDirectory","ttl","skipCache","env","EXPO_BETA","EXPO_NO_CACHE","FileSystemResponseCache","require","wrapFetchWithCache","path","join","getExpoHomeDirectory"],"mappings":"AAAA;;;;;;;;;;;IAkBaA,UAAU,MAAVA,UAAU;IA4BVC,qBAAqB,MAArBA,qBAAqB;IAQrBC,oBAAoB,MAApBA,oBAAoB;IAKjBC,sBAAsB,MAAtBA,sBAAsB;IAatBC,wBAAwB,MAAxBA,wBAAwB;IAwFxBC,iBAAiB,MAAjBA,iBAAiB;IA6BpBC,UAAU,MAAVA,UAAU;;;yBA7Lc,iCAAiC;;;;;;;8DAErD,MAAM;;;;;;oCAEY,4BAA4B;sCAE1B,wBAAwB;sCACxB,wBAAwB;uCACvB,yBAAyB;oCAC5B,sBAAsB;wCAClB,0BAA0B;qBAC7C,iBAAiB;wBACR,oBAAoB;uBAC3B,mBAAmB;0BACP,aAAa;0BAChB,aAAa;8BACD,sBAAsB;;;;;;AAE1D,MAAMN,UAAU,SAASO,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,yB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mBAAA,EACvBf,KAAK,EACL,IAAIa,uBAAuB,CAAC;QAC1BN,cAAc,EAAES,KAAI,EAAA,QAAA,CAACC,IAAI,CAACC,IAAAA,aAAoB,EAAA,qBAAA,GAAE,EAAEX,cAAc,CAAC;QACjEC,GAAG;KACJ,CAAC,CACH,CAAC;AACJ,CAAC;AAGM,MAAMtD,UAAU,GAAGoD,IAAAA,sBAAqB,sBAAA,EAACtD,wBAAwB,CAACoD,cAAc,CAAC,CAAC,AAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/api/rest/client.ts"],"sourcesContent":["import { getExpoHomeDirectory } from '@expo/config/build/getUserState';\nimport type { JSONValue } from '@expo/json-file';\nimport path from 'path';\n\nimport { wrapFetchWithCache } from './cache/wrapFetchWithCache';\nimport type { FetchLike } from './client.types';\nimport { wrapFetchWithBaseUrl } from './wrapFetchWithBaseUrl';\nimport { wrapFetchWithOffline } from './wrapFetchWithOffline';\nimport { wrapFetchWithProgress } from './wrapFetchWithProgress';\nimport { wrapFetchWithProxy } from './wrapFetchWithProxy';\nimport { wrapFetchWithUserAgent } from './wrapFetchWithUserAgent';\nimport { env } from '../../utils/env';\nimport { CommandError } from '../../utils/errors';\nimport { fetch } from '../../utils/fetch';\nimport { getExpoApiBaseUrl } from '../endpoint';\nimport { disableNetwork } from '../settings';\nimport { getAccessToken, getSession } from '../user/UserSettings';\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 * An error defining that the server 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 client.\n */\nexport class UnexpectedServerData extends Error {\n readonly name = 'UnexpectedServerData';\n}\n\n/** Validate the response json contains `.data` property, or throw an unexpected server data error */\nexport function getResponseDataOrThrow<T = any>(json: unknown): T {\n if (!!json && typeof json === 'object' && 'data' in json) {\n return json.data as T;\n }\n\n throw new UnexpectedServerData(\n !!json && typeof json === 'object' ? JSON.stringify(json) : 'Unknown data received from server.'\n );\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 = getAccessToken();\n if (token) {\n resolvedHeaders.authorization = `Bearer ${token}`;\n } else {\n const sessionSecret = getSession()?.sessionSecret;\n if (sessionSecret) {\n resolvedHeaders['expo-session'] = sessionSecret;\n }\n }\n\n try {\n const response = await fetchFunction(url, {\n ...options,\n headers: resolvedHeaders,\n });\n\n // Handle expected API errors (4xx)\n if (response.status >= 400 && response.status < 500) {\n const body = await response.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\n return response;\n } catch (error: any) {\n // When running `expo start`, but wifi or internet has issues\n if (\n isNetworkError(error) || // node-fetch error handling\n ('cause' in error && isNetworkError(error.cause)) // undici error handling\n ) {\n disableNetwork();\n\n throw new CommandError(\n 'OFFLINE',\n 'Network connection is unreliable. Try again with the environment variable `EXPO_OFFLINE=1` to skip network requests.'\n );\n }\n\n throw error;\n }\n };\n}\n\n/**\n * Determine if the provided error is related to a network issue.\n * When this returns true, offline mode should be enabled.\n * - `ENOTFOUND` is thrown when the DNS lookup failed\n * - `EAI_AGAIN` is thrown when DNS lookup failed due to a server-side error\n * - `UND_ERR_CONNECT_TIMEOUT` is thrown after DNS is resolved, but server can't be reached\n *\n * @see https://nodejs.org/api/errors.html\n * @see https://github.com/nodejs/undici#network-address-family-autoselection\n */\nfunction isNetworkError(error: Error & { code?: string }) {\n return (\n 'code' in error &&\n error.code &&\n ['ENOTFOUND', 'EAI_AGAIN', 'UND_ERR_CONNECT_TIMEOUT'].includes(error.code)\n );\n}\n\nconst fetchWithOffline = wrapFetchWithOffline(wrapFetchWithUserAgent(fetch));\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 const { FileSystemResponseCache } =\n require('./cache/FileSystemResponseCache') as typeof import('./cache/FileSystemResponseCache');\n\n return wrapFetchWithCache(\n fetch,\n new FileSystemResponseCache({\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":["ApiV2Error","UnexpectedServerError","UnexpectedServerData","getResponseDataOrThrow","wrapFetchWithCredentials","createCachedFetch","fetchAsync","Error","name","constructor","response","message","code","expoApiV2ErrorCode","expoApiV2ErrorDetails","details","expoApiV2ErrorServerStack","stack","expoApiV2ErrorMetadata","metadata","json","data","JSON","stringify","fetchFunction","fetchWithCredentials","url","options","Array","isArray","headers","resolvedHeaders","token","getAccessToken","authorization","getSession","sessionSecret","status","body","text","parse","errors","length","error","includes","isNetworkError","cause","disableNetwork","CommandError","fetchWithOffline","wrapFetchWithOffline","wrapFetchWithUserAgent","fetch","fetchWithBaseUrl","wrapFetchWithBaseUrl","getExpoApiBaseUrl","fetchWithProxy","wrapFetchWithProxy","wrapFetchWithProgress","cacheDirectory","ttl","skipCache","env","EXPO_BETA","EXPO_NO_CACHE","FileSystemResponseCache","require","wrapFetchWithCache","path","join","getExpoHomeDirectory"],"mappings":"AAAA;;;;;;;;;;;IAkBaA,UAAU,MAAVA,UAAU;IA4BVC,qBAAqB,MAArBA,qBAAqB;IAQrBC,oBAAoB,MAApBA,oBAAoB;IAKjBC,sBAAsB,MAAtBA,sBAAsB;IAatBC,wBAAwB,MAAxBA,wBAAwB;IA2FxBC,iBAAiB,MAAjBA,iBAAiB;IA6BpBC,UAAU,MAAVA,UAAU;;;yBAhMc,iCAAiC;;;;;;;8DAErD,MAAM;;;;;;oCAEY,4BAA4B;sCAE1B,wBAAwB;sCACxB,wBAAwB;uCACvB,yBAAyB;oCAC5B,sBAAsB;wCAClB,0BAA0B;qBAC7C,iBAAiB;wBACR,oBAAoB;uBAC3B,mBAAmB;0BACP,aAAa;0BAChB,aAAa;8BACD,sBAAsB;;;;;;AAE1D,MAAMN,UAAU,SAASO,KAAK;IACnC,AAASC,IAAI,GAAG,YAAY,CAAC;IAO7BC,YAAYC,QAMX,CAAE;QACD,KAAK,CAACA,QAAQ,CAACC,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AAS,IAAIC,IAAG,IAAA,CAACC,SAAS,IAAID,IAAG,IAAA,CAACE,aAAa,EAAE;QACnD,OAAOZ,KAAK,CAAC;IACf,CAAC;IAED,MAAM,EAAEa,uBAAuB,CAAA,EAAE,GAC/BC,OAAO,CAAC,iCAAiC,CAAC,AAAoD,AAAC;IAEjG,OAAOC,IAAAA,mBAAkB,mBAAA,EACvBf,KAAK,EACL,IAAIa,uBAAuB,CAAC;QAC1BN,cAAc,EAAES,KAAI,EAAA,QAAA,CAACC,IAAI,CAACC,IAAAA,aAAoB,EAAA,qBAAA,GAAE,EAAEX,cAAc,CAAC;QACjEC,GAAG;KACJ,CAAC,CACH,CAAC;AACJ,CAAC;AAGM,MAAMtD,UAAU,GAAGoD,IAAAA,sBAAqB,sBAAA,EAACtD,wBAAwB,CAACoD,cAAc,CAAC,CAAC,AAAC"}
|
|
@@ -188,6 +188,7 @@ async function exportEmbedInternalAsync(projectRoot, options) {
|
|
|
188
188
|
const hasDomComponents = domComponentProxyOutputDir && files.size > 0;
|
|
189
189
|
// Persist bundle and source maps.
|
|
190
190
|
await Promise.all([
|
|
191
|
+
// @ts-expect-error: The `save()` method from metro is typed to support `code: string` only but it also supports `Buffer` actually.
|
|
191
192
|
_bundle().default.save(bundle, options, _log.Log.log),
|
|
192
193
|
// Write dom components proxy files.
|
|
193
194
|
hasDomComponents ? (0, _saveAssets.persistMetroFilesAsync)(files, domComponentProxyOutputDir) : null,
|
|
@@ -234,8 +235,7 @@ async function exportEmbedBundleAndAssetsAsync(projectRoot, options) {
|
|
|
234
235
|
mode: options.dev ? "development" : "production",
|
|
235
236
|
engine: isHermes ? "hermes" : undefined,
|
|
236
237
|
serializerIncludeMaps: !!sourceMapUrl,
|
|
237
|
-
|
|
238
|
-
bytecode: false,
|
|
238
|
+
bytecode: options.bytecode ?? false,
|
|
239
239
|
// source map inline
|
|
240
240
|
reactCompiler: !!((ref = exp.experiments) == null ? void 0 : ref.reactCompiler)
|
|
241
241
|
}, files, {
|
|
@@ -283,7 +283,7 @@ async function exportEmbedBundleAndAssetsAsync(projectRoot, options) {
|
|
|
283
283
|
return {
|
|
284
284
|
files,
|
|
285
285
|
bundle: {
|
|
286
|
-
code: bundles.artifacts.filter((a)=>a.type === "js")[0].source
|
|
286
|
+
code: bundles.artifacts.filter((a)=>a.type === "js")[0].source,
|
|
287
287
|
// Can be optional when source maps aren't enabled.
|
|
288
288
|
map: (ref2 = bundles.artifacts.filter((a)=>a.type === "map")[0]) == null ? void 0 : ref2.source.toString()
|
|
289
289
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/export/embed/exportEmbedAsync.ts"],"sourcesContent":["/**\n * Copyright © 2023 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { getConfig } from '@expo/config';\nimport getMetroAssets from '@expo/metro-config/build/transform-worker/getAssets';\nimport assert from 'assert';\nimport fs from 'fs';\nimport { sync as globSync } from 'glob';\nimport Server from 'metro/src/Server';\nimport splitBundleOptions from 'metro/src/lib/splitBundleOptions';\nimport output from 'metro/src/shared/output/bundle';\nimport type { BundleOptions } from 'metro/src/shared/types';\nimport path from 'path';\n\nimport { deserializeEagerKey, getExportEmbedOptionsKey, Options } from './resolveOptions';\nimport { isExecutingFromXcodebuild, logMetroErrorInXcode } from './xcodeCompilerLogger';\nimport { Log } from '../../log';\nimport { DevServerManager } from '../../start/server/DevServerManager';\nimport { MetroBundlerDevServer } from '../../start/server/metro/MetroBundlerDevServer';\nimport { loadMetroConfigAsync } from '../../start/server/metro/instantiateMetro';\nimport { assertMetroPrivateServer } from '../../start/server/metro/metroPrivateServer';\nimport { DOM_COMPONENTS_BUNDLE_DIR } from '../../start/server/middleware/DomComponentsMiddleware';\nimport { getMetroDirectBundleOptionsForExpoConfig } from '../../start/server/middleware/metroOptions';\nimport { stripAnsi } from '../../utils/ansi';\nimport { copyAsync, removeAsync } from '../../utils/dir';\nimport { env } from '../../utils/env';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { exportDomComponentAsync } from '../exportDomComponents';\nimport { isEnableHermesManaged } from '../exportHermes';\nimport { persistMetroAssetsAsync } from '../persistMetroAssets';\nimport { copyPublicFolderAsync } from '../publicFolder';\nimport { BundleAssetWithFileHashes, ExportAssetMap, persistMetroFilesAsync } from '../saveAssets';\nimport { exportStandaloneServerAsync } from './exportServer';\nimport { ensureProcessExitsAfterDelay } from '../../utils/exit';\nimport { resolveRealEntryFilePath } from '../../utils/filePath';\n\nconst debug = require('debug')('expo:export:embed');\n\nfunction guessCopiedAppleBundlePath(bundleOutput: string) {\n // Ensure the path is familiar before guessing.\n if (\n !bundleOutput.match(/\\/Xcode\\/DerivedData\\/.*\\/Build\\/Products\\//) &&\n !bundleOutput.match(/\\/CoreSimulator\\/Devices\\/.*\\/data\\/Containers\\/Bundle\\/Application\\//)\n ) {\n debug('Bundling to non-standard location:', bundleOutput);\n return false;\n }\n const bundleName = path.basename(bundleOutput);\n const bundleParent = path.dirname(bundleOutput);\n const possiblePath = globSync(`*.app/${bundleName}`, {\n cwd: bundleParent,\n absolute: true,\n // bundle identifiers can start with dots.\n dot: true,\n })[0];\n debug('Possible path for previous bundle:', possiblePath);\n return possiblePath;\n}\n\nexport async function exportEmbedAsync(projectRoot: string, options: Options) {\n // The React Native build scripts always enable the cache reset but we shouldn't need this in CI environments.\n // By disabling it, we can eagerly bundle code before the build and reuse the cached artifacts in subsequent builds.\n if (env.CI && options.resetCache) {\n debug('CI environment detected, disabling automatic cache reset');\n options.resetCache = false;\n }\n\n setNodeEnv(options.dev ? 'development' : 'production');\n require('@expo/env').load(projectRoot);\n\n // This is an optimized codepath that can occur during `npx expo run` and does not occur during builds from Xcode or Android Studio.\n // Here we reconcile a bundle pass that was run before the native build process. This order can fail faster and is show better errors since the logs won't be obscured by Xcode and Android Studio.\n // This path is also used for automatically deploying server bundles to a remote host.\n const eagerBundleOptions = env.__EXPO_EAGER_BUNDLE_OPTIONS\n ? deserializeEagerKey(env.__EXPO_EAGER_BUNDLE_OPTIONS)\n : null;\n if (eagerBundleOptions) {\n // Get the cache key for the current process to compare against the eager key.\n const inputKey = getExportEmbedOptionsKey(options);\n\n // If the app was bundled previously in the same process, then we should reuse the Metro cache.\n options.resetCache = false;\n\n if (eagerBundleOptions.key === inputKey) {\n // Copy the eager bundleOutput and assets to the new locations.\n await removeAsync(options.bundleOutput);\n\n copyAsync(eagerBundleOptions.options.bundleOutput, options.bundleOutput);\n\n if (eagerBundleOptions.options.assetsDest && options.assetsDest) {\n copyAsync(eagerBundleOptions.options.assetsDest, options.assetsDest);\n }\n\n console.log('info: Copied output to binary:', options.bundleOutput);\n return;\n }\n // TODO: sourcemapOutput is set on Android but not during eager. This is tolerable since it doesn't invalidate the Metro cache.\n console.log(' Eager key:', eagerBundleOptions.key);\n console.log('Request key:', inputKey);\n\n // TODO: We may want an analytic event here in the future to understand when this happens.\n console.warn('warning: Eager bundle does not match new options, bundling again.');\n }\n\n await exportEmbedInternalAsync(projectRoot, options);\n\n // Ensure the process closes after bundling\n ensureProcessExitsAfterDelay();\n}\n\nexport async function exportEmbedInternalAsync(projectRoot: string, options: Options) {\n // Ensure we delete the old bundle to trigger a failure if the bundle cannot be created.\n await removeAsync(options.bundleOutput);\n\n // The iOS bundle is copied in to the Xcode project, so we need to remove the old one\n // to prevent Xcode from loading the old one after a build failure.\n if (options.platform === 'ios') {\n const previousPath = guessCopiedAppleBundlePath(options.bundleOutput);\n if (previousPath && fs.existsSync(previousPath)) {\n debug('Removing previous iOS bundle:', previousPath);\n await removeAsync(previousPath);\n }\n }\n\n const { bundle, assets, files } = await exportEmbedBundleAndAssetsAsync(projectRoot, options);\n\n fs.mkdirSync(path.dirname(options.bundleOutput), { recursive: true, mode: 0o755 });\n\n // On Android, dom components proxy files should write to the assets directory instead of the res directory.\n // We use the bundleOutput directory to get the assets directory.\n const domComponentProxyOutputDir =\n options.platform === 'android' ? path.dirname(options.bundleOutput) : options.assetsDest;\n const hasDomComponents = domComponentProxyOutputDir && files.size > 0;\n\n // Persist bundle and source maps.\n await Promise.all([\n output.save(bundle, options, Log.log),\n\n // Write dom components proxy files.\n hasDomComponents ? persistMetroFilesAsync(files, domComponentProxyOutputDir) : null,\n // Copy public folder for dom components only if\n hasDomComponents\n ? copyPublicFolderAsync(\n path.resolve(projectRoot, env.EXPO_PUBLIC_FOLDER),\n path.join(domComponentProxyOutputDir, DOM_COMPONENTS_BUNDLE_DIR)\n )\n : null,\n\n // NOTE(EvanBacon): This may need to be adjusted in the future if want to support baseUrl on native\n // platforms when doing production embeds (unlikely).\n options.assetsDest\n ? persistMetroAssetsAsync(projectRoot, assets, {\n platform: options.platform,\n outputDirectory: options.assetsDest,\n iosAssetCatalogDirectory: options.assetCatalogDest,\n })\n : null,\n ]);\n}\n\nexport async function exportEmbedBundleAndAssetsAsync(\n projectRoot: string,\n options: Options\n): Promise<{\n bundle: Awaited<ReturnType<Server['build']>>;\n assets: readonly BundleAssetWithFileHashes[];\n files: ExportAssetMap;\n}> {\n const devServerManager = await DevServerManager.startMetroAsync(projectRoot, {\n minify: options.minify,\n mode: options.dev ? 'development' : 'production',\n port: 8081,\n isExporting: true,\n location: {},\n resetDevServer: options.resetCache,\n maxWorkers: options.maxWorkers,\n });\n\n const devServer = devServerManager.getDefaultDevServer();\n assert(devServer instanceof MetroBundlerDevServer);\n\n const { exp, pkg } = getConfig(projectRoot, { skipSDKVersionRequirement: true });\n const isHermes = isEnableHermesManaged(exp, options.platform);\n\n let sourceMapUrl = options.sourcemapOutput;\n if (sourceMapUrl && !options.sourcemapUseAbsolutePath) {\n sourceMapUrl = path.basename(sourceMapUrl);\n }\n\n const files: ExportAssetMap = new Map();\n\n try {\n const bundles = await devServer.nativeExportBundleAsync(\n {\n // TODO: Re-enable when we get bytecode chunk splitting working again.\n splitChunks: false, //devServer.isReactServerComponentsEnabled,\n mainModuleName: resolveRealEntryFilePath(projectRoot, options.entryFile),\n platform: options.platform,\n minify: options.minify,\n mode: options.dev ? 'development' : 'production',\n engine: isHermes ? 'hermes' : undefined,\n serializerIncludeMaps: !!sourceMapUrl,\n // Never output bytecode in the exported bundle since that is hardcoded in the native run script.\n bytecode: false,\n // source map inline\n reactCompiler: !!exp.experiments?.reactCompiler,\n },\n files,\n {\n sourceMapUrl,\n unstable_transformProfile: (options.unstableTransformProfile ||\n (isHermes ? 'hermes-stable' : 'default')) as BundleOptions['unstable_transformProfile'],\n }\n );\n\n const apiRoutesEnabled =\n devServer.isReactServerComponentsEnabled || exp.web?.output === 'server';\n\n if (apiRoutesEnabled) {\n await exportStandaloneServerAsync(projectRoot, devServer, {\n exp,\n pkg,\n files,\n options,\n });\n }\n\n // TODO: Remove duplicates...\n const expoDomComponentReferences = bundles.artifacts\n .map((artifact) =>\n Array.isArray(artifact.metadata.expoDomComponentReferences)\n ? artifact.metadata.expoDomComponentReferences\n : []\n )\n .flat();\n if (expoDomComponentReferences.length > 0) {\n await Promise.all(\n // TODO: Make a version of this which uses `this.metro.getBundler().buildGraphForEntries([])` to bundle all the DOM components at once.\n expoDomComponentReferences.map(async (filePath) => {\n const { bundle } = await exportDomComponentAsync({\n filePath,\n projectRoot,\n dev: options.dev,\n devServer,\n isHermes,\n includeSourceMaps: !!sourceMapUrl,\n exp,\n files,\n });\n\n if (options.assetsDest) {\n // Save assets like a typical bundler, preserving the file paths on web.\n // This is saving web-style inside of a native app's binary.\n await persistMetroAssetsAsync(\n projectRoot,\n bundle.assets.map((asset) => ({\n ...asset,\n httpServerLocation: path.join(DOM_COMPONENTS_BUNDLE_DIR, asset.httpServerLocation),\n })),\n {\n files,\n platform: 'web',\n outputDirectory: options.assetsDest,\n }\n );\n }\n })\n );\n }\n\n return {\n files,\n bundle: {\n code: bundles.artifacts.filter((a: any) => a.type === 'js')[0].source.toString(),\n // Can be optional when source maps aren't enabled.\n map: bundles.artifacts.filter((a: any) => a.type === 'map')[0]?.source.toString(),\n },\n assets: bundles.assets,\n };\n } catch (error: any) {\n if (isError(error)) {\n // Log using Xcode error format so the errors are picked up by xcodebuild.\n // https://developer.apple.com/documentation/xcode/running-custom-scripts-during-a-build#Log-errors-and-warnings-from-your-script\n if (options.platform === 'ios') {\n // If the error is about to be presented in Xcode, strip the ansi characters from the message.\n if ('message' in error && isExecutingFromXcodebuild()) {\n error.message = stripAnsi(error.message) as string;\n }\n logMetroErrorInXcode(projectRoot, error);\n }\n }\n throw error;\n } finally {\n devServerManager.stopAsync();\n }\n}\n\n// Exports for expo-updates\nexport async function createMetroServerAndBundleRequestAsync(\n projectRoot: string,\n options: Pick<\n Options,\n | 'maxWorkers'\n | 'config'\n | 'platform'\n | 'sourcemapOutput'\n | 'sourcemapUseAbsolutePath'\n | 'entryFile'\n | 'minify'\n | 'dev'\n | 'resetCache'\n | 'unstableTransformProfile'\n >\n): Promise<{ server: Server; bundleRequest: BundleOptions }> {\n const exp = getConfig(projectRoot, { skipSDKVersionRequirement: true }).exp;\n\n // TODO: This is slow ~40ms\n const { config } = await loadMetroConfigAsync(\n projectRoot,\n {\n // TODO: This is always enabled in the native script and there's no way to disable it.\n resetCache: options.resetCache,\n\n maxWorkers: options.maxWorkers,\n config: options.config,\n },\n {\n exp,\n isExporting: true,\n getMetroBundler() {\n return server.getBundler().getBundler();\n },\n }\n );\n\n const isHermes = isEnableHermesManaged(exp, options.platform);\n\n let sourceMapUrl = options.sourcemapOutput;\n if (sourceMapUrl && !options.sourcemapUseAbsolutePath) {\n sourceMapUrl = path.basename(sourceMapUrl);\n }\n\n // TODO(cedric): check if we can use the proper `bundleType=bundle` and `entryPoint=mainModuleName` properties\n // @ts-expect-error: see above\n const bundleRequest: BundleOptions = {\n ...Server.DEFAULT_BUNDLE_OPTIONS,\n ...getMetroDirectBundleOptionsForExpoConfig(projectRoot, exp, {\n splitChunks: false,\n mainModuleName: resolveRealEntryFilePath(projectRoot, options.entryFile),\n platform: options.platform,\n minify: options.minify,\n mode: options.dev ? 'development' : 'production',\n engine: isHermes ? 'hermes' : undefined,\n isExporting: true,\n // Never output bytecode in the exported bundle since that is hardcoded in the native run script.\n bytecode: false,\n }),\n sourceMapUrl,\n unstable_transformProfile: (options.unstableTransformProfile ||\n (isHermes ? 'hermes-stable' : 'default')) as BundleOptions['unstable_transformProfile'],\n };\n\n const server = new Server(config, {\n watch: false,\n });\n\n return { server, bundleRequest };\n}\n\nexport async function exportEmbedAssetsAsync(\n server: Server,\n bundleRequest: BundleOptions,\n projectRoot: string,\n options: Pick<Options, 'platform'>\n) {\n try {\n const { entryFile, onProgress, resolverOptions, transformOptions } = splitBundleOptions({\n ...bundleRequest,\n bundleType: 'todo',\n });\n\n assertMetroPrivateServer(server);\n\n const dependencies = await server._bundler.getDependencies(\n [entryFile],\n transformOptions,\n resolverOptions,\n { onProgress, shallow: false, lazy: false }\n );\n\n const config = server._config;\n\n return getMetroAssets(dependencies, {\n processModuleFilter: config.serializer.processModuleFilter,\n assetPlugins: config.transformer.assetPlugins,\n platform: transformOptions.platform!,\n // Forked out of Metro because the `this._getServerRootDir()` doesn't match the development\n // behavior.\n projectRoot: config.projectRoot, // this._getServerRootDir(),\n publicPath: config.transformer.publicPath,\n });\n } catch (error: any) {\n if (isError(error)) {\n // Log using Xcode error format so the errors are picked up by xcodebuild.\n // https://developer.apple.com/documentation/xcode/running-custom-scripts-during-a-build#Log-errors-and-warnings-from-your-script\n if (options.platform === 'ios') {\n // If the error is about to be presented in Xcode, strip the ansi characters from the message.\n if ('message' in error && isExecutingFromXcodebuild()) {\n error.message = stripAnsi(error.message) as string;\n }\n logMetroErrorInXcode(projectRoot, error);\n }\n }\n throw error;\n }\n}\n\nfunction isError(error: any): error is Error {\n return error instanceof Error;\n}\n"],"names":["exportEmbedAsync","exportEmbedInternalAsync","exportEmbedBundleAndAssetsAsync","createMetroServerAndBundleRequestAsync","exportEmbedAssetsAsync","debug","require","guessCopiedAppleBundlePath","bundleOutput","match","bundleName","path","basename","bundleParent","dirname","possiblePath","globSync","cwd","absolute","dot","projectRoot","options","env","CI","resetCache","setNodeEnv","dev","load","eagerBundleOptions","__EXPO_EAGER_BUNDLE_OPTIONS","deserializeEagerKey","inputKey","getExportEmbedOptionsKey","key","removeAsync","copyAsync","assetsDest","console","log","warn","ensureProcessExitsAfterDelay","platform","previousPath","fs","existsSync","bundle","assets","files","mkdirSync","recursive","mode","domComponentProxyOutputDir","hasDomComponents","size","Promise","all","output","save","Log","persistMetroFilesAsync","copyPublicFolderAsync","resolve","EXPO_PUBLIC_FOLDER","join","DOM_COMPONENTS_BUNDLE_DIR","persistMetroAssetsAsync","outputDirectory","iosAssetCatalogDirectory","assetCatalogDest","devServerManager","DevServerManager","startMetroAsync","minify","port","isExporting","location","resetDevServer","maxWorkers","devServer","getDefaultDevServer","assert","MetroBundlerDevServer","exp","pkg","getConfig","skipSDKVersionRequirement","isHermes","isEnableHermesManaged","sourceMapUrl","sourcemapOutput","sourcemapUseAbsolutePath","Map","bundles","nativeExportBundleAsync","splitChunks","mainModuleName","resolveRealEntryFilePath","entryFile","engine","undefined","serializerIncludeMaps","bytecode","reactCompiler","experiments","unstable_transformProfile","unstableTransformProfile","apiRoutesEnabled","isReactServerComponentsEnabled","web","exportStandaloneServerAsync","expoDomComponentReferences","artifacts","map","artifact","Array","isArray","metadata","flat","length","filePath","exportDomComponentAsync","includeSourceMaps","asset","httpServerLocation","code","filter","a","type","source","toString","error","isError","isExecutingFromXcodebuild","message","stripAnsi","logMetroErrorInXcode","stopAsync","config","loadMetroConfigAsync","getMetroBundler","server","getBundler","bundleRequest","Server","DEFAULT_BUNDLE_OPTIONS","getMetroDirectBundleOptionsForExpoConfig","watch","onProgress","resolverOptions","transformOptions","splitBundleOptions","bundleType","assertMetroPrivateServer","dependencies","_bundler","getDependencies","shallow","lazy","_config","getMetroAssets","processModuleFilter","serializer","assetPlugins","transformer","publicPath","Error"],"mappings":"AAAA;;;;;CAKC,GACD;;;;;;;;;;;IAwDsBA,gBAAgB,MAAhBA,gBAAgB;IAmDhBC,wBAAwB,MAAxBA,wBAAwB;IA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,UAAU,EAAE3B,MAAM,CAAC0B,WAAW,CAACC,UAAU;SAC1C,CAAC,CAAC;IACL,EAAE,OAAOlC,KAAK,EAAO;QACnB,IAAIC,OAAO,CAACD,KAAK,CAAC,EAAE;YAClB,0EAA0E;YAC1E,iIAAiI;YACjI,IAAI7G,OAAO,CAACoB,QAAQ,KAAK,KAAK,EAAE;gBAC9B,8FAA8F;gBAC9F,IAAI,SAAS,IAAIyF,KAAK,IAAIE,IAAAA,oBAAyB,0BAAA,GAAE,EAAE;oBACrDF,KAAK,CAACG,OAAO,GAAGC,IAAAA,KAAS,UAAA,EAACJ,KAAK,CAACG,OAAO,CAAC,AAAU,CAAC;gBACrD,CAAC;gBACDE,IAAAA,oBAAoB,qBAAA,EAACnH,WAAW,EAAE8G,KAAK,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;QACD,MAAMA,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAASC,OAAO,CAACD,KAAU,EAAkB;IAC3C,OAAOA,KAAK,YAAYmC,KAAK,CAAC;AAChC,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/export/embed/exportEmbedAsync.ts"],"sourcesContent":["/**\n * Copyright © 2023 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { getConfig } from '@expo/config';\nimport getMetroAssets from '@expo/metro-config/build/transform-worker/getAssets';\nimport assert from 'assert';\nimport fs from 'fs';\nimport { sync as globSync } from 'glob';\nimport Server from 'metro/src/Server';\nimport splitBundleOptions from 'metro/src/lib/splitBundleOptions';\nimport output from 'metro/src/shared/output/bundle';\nimport type { BundleOptions } from 'metro/src/shared/types';\nimport path from 'path';\n\nimport { deserializeEagerKey, getExportEmbedOptionsKey, Options } from './resolveOptions';\nimport { isExecutingFromXcodebuild, logMetroErrorInXcode } from './xcodeCompilerLogger';\nimport { Log } from '../../log';\nimport { DevServerManager } from '../../start/server/DevServerManager';\nimport { MetroBundlerDevServer } from '../../start/server/metro/MetroBundlerDevServer';\nimport { loadMetroConfigAsync } from '../../start/server/metro/instantiateMetro';\nimport { assertMetroPrivateServer } from '../../start/server/metro/metroPrivateServer';\nimport { DOM_COMPONENTS_BUNDLE_DIR } from '../../start/server/middleware/DomComponentsMiddleware';\nimport { getMetroDirectBundleOptionsForExpoConfig } from '../../start/server/middleware/metroOptions';\nimport { stripAnsi } from '../../utils/ansi';\nimport { copyAsync, removeAsync } from '../../utils/dir';\nimport { env } from '../../utils/env';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { exportDomComponentAsync } from '../exportDomComponents';\nimport { isEnableHermesManaged } from '../exportHermes';\nimport { persistMetroAssetsAsync } from '../persistMetroAssets';\nimport { copyPublicFolderAsync } from '../publicFolder';\nimport { BundleAssetWithFileHashes, ExportAssetMap, persistMetroFilesAsync } from '../saveAssets';\nimport { exportStandaloneServerAsync } from './exportServer';\nimport { ensureProcessExitsAfterDelay } from '../../utils/exit';\nimport { resolveRealEntryFilePath } from '../../utils/filePath';\n\nconst debug = require('debug')('expo:export:embed');\n\n/**\n * Extended type for the Metro server build result to support the `code` property as a `Buffer`.\n */\ntype ExtendedMetroServerBuildResult =\n | Awaited<ReturnType<Server['build']>>\n | {\n code: string | Buffer;\n };\n\nfunction guessCopiedAppleBundlePath(bundleOutput: string) {\n // Ensure the path is familiar before guessing.\n if (\n !bundleOutput.match(/\\/Xcode\\/DerivedData\\/.*\\/Build\\/Products\\//) &&\n !bundleOutput.match(/\\/CoreSimulator\\/Devices\\/.*\\/data\\/Containers\\/Bundle\\/Application\\//)\n ) {\n debug('Bundling to non-standard location:', bundleOutput);\n return false;\n }\n const bundleName = path.basename(bundleOutput);\n const bundleParent = path.dirname(bundleOutput);\n const possiblePath = globSync(`*.app/${bundleName}`, {\n cwd: bundleParent,\n absolute: true,\n // bundle identifiers can start with dots.\n dot: true,\n })[0];\n debug('Possible path for previous bundle:', possiblePath);\n return possiblePath;\n}\n\nexport async function exportEmbedAsync(projectRoot: string, options: Options) {\n // The React Native build scripts always enable the cache reset but we shouldn't need this in CI environments.\n // By disabling it, we can eagerly bundle code before the build and reuse the cached artifacts in subsequent builds.\n if (env.CI && options.resetCache) {\n debug('CI environment detected, disabling automatic cache reset');\n options.resetCache = false;\n }\n\n setNodeEnv(options.dev ? 'development' : 'production');\n require('@expo/env').load(projectRoot);\n\n // This is an optimized codepath that can occur during `npx expo run` and does not occur during builds from Xcode or Android Studio.\n // Here we reconcile a bundle pass that was run before the native build process. This order can fail faster and is show better errors since the logs won't be obscured by Xcode and Android Studio.\n // This path is also used for automatically deploying server bundles to a remote host.\n const eagerBundleOptions = env.__EXPO_EAGER_BUNDLE_OPTIONS\n ? deserializeEagerKey(env.__EXPO_EAGER_BUNDLE_OPTIONS)\n : null;\n if (eagerBundleOptions) {\n // Get the cache key for the current process to compare against the eager key.\n const inputKey = getExportEmbedOptionsKey(options);\n\n // If the app was bundled previously in the same process, then we should reuse the Metro cache.\n options.resetCache = false;\n\n if (eagerBundleOptions.key === inputKey) {\n // Copy the eager bundleOutput and assets to the new locations.\n await removeAsync(options.bundleOutput);\n\n copyAsync(eagerBundleOptions.options.bundleOutput, options.bundleOutput);\n\n if (eagerBundleOptions.options.assetsDest && options.assetsDest) {\n copyAsync(eagerBundleOptions.options.assetsDest, options.assetsDest);\n }\n\n console.log('info: Copied output to binary:', options.bundleOutput);\n return;\n }\n // TODO: sourcemapOutput is set on Android but not during eager. This is tolerable since it doesn't invalidate the Metro cache.\n console.log(' Eager key:', eagerBundleOptions.key);\n console.log('Request key:', inputKey);\n\n // TODO: We may want an analytic event here in the future to understand when this happens.\n console.warn('warning: Eager bundle does not match new options, bundling again.');\n }\n\n await exportEmbedInternalAsync(projectRoot, options);\n\n // Ensure the process closes after bundling\n ensureProcessExitsAfterDelay();\n}\n\nexport async function exportEmbedInternalAsync(projectRoot: string, options: Options) {\n // Ensure we delete the old bundle to trigger a failure if the bundle cannot be created.\n await removeAsync(options.bundleOutput);\n\n // The iOS bundle is copied in to the Xcode project, so we need to remove the old one\n // to prevent Xcode from loading the old one after a build failure.\n if (options.platform === 'ios') {\n const previousPath = guessCopiedAppleBundlePath(options.bundleOutput);\n if (previousPath && fs.existsSync(previousPath)) {\n debug('Removing previous iOS bundle:', previousPath);\n await removeAsync(previousPath);\n }\n }\n\n const { bundle, assets, files } = await exportEmbedBundleAndAssetsAsync(projectRoot, options);\n\n fs.mkdirSync(path.dirname(options.bundleOutput), { recursive: true, mode: 0o755 });\n\n // On Android, dom components proxy files should write to the assets directory instead of the res directory.\n // We use the bundleOutput directory to get the assets directory.\n const domComponentProxyOutputDir =\n options.platform === 'android' ? path.dirname(options.bundleOutput) : options.assetsDest;\n const hasDomComponents = domComponentProxyOutputDir && files.size > 0;\n\n // Persist bundle and source maps.\n await Promise.all([\n // @ts-expect-error: The `save()` method from metro is typed to support `code: string` only but it also supports `Buffer` actually.\n output.save(bundle, options, Log.log),\n\n // Write dom components proxy files.\n hasDomComponents ? persistMetroFilesAsync(files, domComponentProxyOutputDir) : null,\n // Copy public folder for dom components only if\n hasDomComponents\n ? copyPublicFolderAsync(\n path.resolve(projectRoot, env.EXPO_PUBLIC_FOLDER),\n path.join(domComponentProxyOutputDir, DOM_COMPONENTS_BUNDLE_DIR)\n )\n : null,\n\n // NOTE(EvanBacon): This may need to be adjusted in the future if want to support baseUrl on native\n // platforms when doing production embeds (unlikely).\n options.assetsDest\n ? persistMetroAssetsAsync(projectRoot, assets, {\n platform: options.platform,\n outputDirectory: options.assetsDest,\n iosAssetCatalogDirectory: options.assetCatalogDest,\n })\n : null,\n ]);\n}\n\nexport async function exportEmbedBundleAndAssetsAsync(\n projectRoot: string,\n options: Options\n): Promise<{\n bundle: ExtendedMetroServerBuildResult;\n assets: readonly BundleAssetWithFileHashes[];\n files: ExportAssetMap;\n}> {\n const devServerManager = await DevServerManager.startMetroAsync(projectRoot, {\n minify: options.minify,\n mode: options.dev ? 'development' : 'production',\n port: 8081,\n isExporting: true,\n location: {},\n resetDevServer: options.resetCache,\n maxWorkers: options.maxWorkers,\n });\n\n const devServer = devServerManager.getDefaultDevServer();\n assert(devServer instanceof MetroBundlerDevServer);\n\n const { exp, pkg } = getConfig(projectRoot, { skipSDKVersionRequirement: true });\n const isHermes = isEnableHermesManaged(exp, options.platform);\n\n let sourceMapUrl = options.sourcemapOutput;\n if (sourceMapUrl && !options.sourcemapUseAbsolutePath) {\n sourceMapUrl = path.basename(sourceMapUrl);\n }\n\n const files: ExportAssetMap = new Map();\n\n try {\n const bundles = await devServer.nativeExportBundleAsync(\n {\n // TODO: Re-enable when we get bytecode chunk splitting working again.\n splitChunks: false, //devServer.isReactServerComponentsEnabled,\n mainModuleName: resolveRealEntryFilePath(projectRoot, options.entryFile),\n platform: options.platform,\n minify: options.minify,\n mode: options.dev ? 'development' : 'production',\n engine: isHermes ? 'hermes' : undefined,\n serializerIncludeMaps: !!sourceMapUrl,\n bytecode: options.bytecode ?? false,\n // source map inline\n reactCompiler: !!exp.experiments?.reactCompiler,\n },\n files,\n {\n sourceMapUrl,\n unstable_transformProfile: (options.unstableTransformProfile ||\n (isHermes ? 'hermes-stable' : 'default')) as BundleOptions['unstable_transformProfile'],\n }\n );\n\n const apiRoutesEnabled =\n devServer.isReactServerComponentsEnabled || exp.web?.output === 'server';\n\n if (apiRoutesEnabled) {\n await exportStandaloneServerAsync(projectRoot, devServer, {\n exp,\n pkg,\n files,\n options,\n });\n }\n\n // TODO: Remove duplicates...\n const expoDomComponentReferences = bundles.artifacts\n .map((artifact) =>\n Array.isArray(artifact.metadata.expoDomComponentReferences)\n ? artifact.metadata.expoDomComponentReferences\n : []\n )\n .flat();\n if (expoDomComponentReferences.length > 0) {\n await Promise.all(\n // TODO: Make a version of this which uses `this.metro.getBundler().buildGraphForEntries([])` to bundle all the DOM components at once.\n expoDomComponentReferences.map(async (filePath) => {\n const { bundle } = await exportDomComponentAsync({\n filePath,\n projectRoot,\n dev: options.dev,\n devServer,\n isHermes,\n includeSourceMaps: !!sourceMapUrl,\n exp,\n files,\n });\n\n if (options.assetsDest) {\n // Save assets like a typical bundler, preserving the file paths on web.\n // This is saving web-style inside of a native app's binary.\n await persistMetroAssetsAsync(\n projectRoot,\n bundle.assets.map((asset) => ({\n ...asset,\n httpServerLocation: path.join(DOM_COMPONENTS_BUNDLE_DIR, asset.httpServerLocation),\n })),\n {\n files,\n platform: 'web',\n outputDirectory: options.assetsDest,\n }\n );\n }\n })\n );\n }\n\n return {\n files,\n bundle: {\n code: bundles.artifacts.filter((a: any) => a.type === 'js')[0].source,\n // Can be optional when source maps aren't enabled.\n map: bundles.artifacts.filter((a: any) => a.type === 'map')[0]?.source.toString(),\n },\n assets: bundles.assets,\n };\n } catch (error: any) {\n if (isError(error)) {\n // Log using Xcode error format so the errors are picked up by xcodebuild.\n // https://developer.apple.com/documentation/xcode/running-custom-scripts-during-a-build#Log-errors-and-warnings-from-your-script\n if (options.platform === 'ios') {\n // If the error is about to be presented in Xcode, strip the ansi characters from the message.\n if ('message' in error && isExecutingFromXcodebuild()) {\n error.message = stripAnsi(error.message) as string;\n }\n logMetroErrorInXcode(projectRoot, error);\n }\n }\n throw error;\n } finally {\n devServerManager.stopAsync();\n }\n}\n\n// Exports for expo-updates\nexport async function createMetroServerAndBundleRequestAsync(\n projectRoot: string,\n options: Pick<\n Options,\n | 'maxWorkers'\n | 'config'\n | 'platform'\n | 'sourcemapOutput'\n | 'sourcemapUseAbsolutePath'\n | 'entryFile'\n | 'minify'\n | 'dev'\n | 'resetCache'\n | 'unstableTransformProfile'\n >\n): Promise<{ server: Server; bundleRequest: BundleOptions }> {\n const exp = getConfig(projectRoot, { skipSDKVersionRequirement: true }).exp;\n\n // TODO: This is slow ~40ms\n const { config } = await loadMetroConfigAsync(\n projectRoot,\n {\n // TODO: This is always enabled in the native script and there's no way to disable it.\n resetCache: options.resetCache,\n\n maxWorkers: options.maxWorkers,\n config: options.config,\n },\n {\n exp,\n isExporting: true,\n getMetroBundler() {\n return server.getBundler().getBundler();\n },\n }\n );\n\n const isHermes = isEnableHermesManaged(exp, options.platform);\n\n let sourceMapUrl = options.sourcemapOutput;\n if (sourceMapUrl && !options.sourcemapUseAbsolutePath) {\n sourceMapUrl = path.basename(sourceMapUrl);\n }\n\n // TODO(cedric): check if we can use the proper `bundleType=bundle` and `entryPoint=mainModuleName` properties\n // @ts-expect-error: see above\n const bundleRequest: BundleOptions = {\n ...Server.DEFAULT_BUNDLE_OPTIONS,\n ...getMetroDirectBundleOptionsForExpoConfig(projectRoot, exp, {\n splitChunks: false,\n mainModuleName: resolveRealEntryFilePath(projectRoot, options.entryFile),\n platform: options.platform,\n minify: options.minify,\n mode: options.dev ? 'development' : 'production',\n engine: isHermes ? 'hermes' : undefined,\n isExporting: true,\n // Never output bytecode in the exported bundle since that is hardcoded in the native run script.\n bytecode: false,\n }),\n sourceMapUrl,\n unstable_transformProfile: (options.unstableTransformProfile ||\n (isHermes ? 'hermes-stable' : 'default')) as BundleOptions['unstable_transformProfile'],\n };\n\n const server = new Server(config, {\n watch: false,\n });\n\n return { server, bundleRequest };\n}\n\nexport async function exportEmbedAssetsAsync(\n server: Server,\n bundleRequest: BundleOptions,\n projectRoot: string,\n options: Pick<Options, 'platform'>\n) {\n try {\n const { entryFile, onProgress, resolverOptions, transformOptions } = splitBundleOptions({\n ...bundleRequest,\n bundleType: 'todo',\n });\n\n assertMetroPrivateServer(server);\n\n const dependencies = await server._bundler.getDependencies(\n [entryFile],\n transformOptions,\n resolverOptions,\n { onProgress, shallow: false, lazy: false }\n );\n\n const config = server._config;\n\n return getMetroAssets(dependencies, {\n processModuleFilter: config.serializer.processModuleFilter,\n assetPlugins: config.transformer.assetPlugins,\n platform: transformOptions.platform!,\n // Forked out of Metro because the `this._getServerRootDir()` doesn't match the development\n // behavior.\n projectRoot: config.projectRoot, // this._getServerRootDir(),\n publicPath: config.transformer.publicPath,\n });\n } catch (error: any) {\n if (isError(error)) {\n // Log using Xcode error format so the errors are picked up by xcodebuild.\n // https://developer.apple.com/documentation/xcode/running-custom-scripts-during-a-build#Log-errors-and-warnings-from-your-script\n if (options.platform === 'ios') {\n // If the error is about to be presented in Xcode, strip the ansi characters from the message.\n if ('message' in error && isExecutingFromXcodebuild()) {\n error.message = stripAnsi(error.message) as string;\n }\n logMetroErrorInXcode(projectRoot, error);\n }\n }\n throw error;\n }\n}\n\nfunction isError(error: any): error is Error {\n return error instanceof Error;\n}\n"],"names":["exportEmbedAsync","exportEmbedInternalAsync","exportEmbedBundleAndAssetsAsync","createMetroServerAndBundleRequestAsync","exportEmbedAssetsAsync","debug","require","guessCopiedAppleBundlePath","bundleOutput","match","bundleName","path","basename","bundleParent","dirname","possiblePath","globSync","cwd","absolute","dot","projectRoot","options","env","CI","resetCache","setNodeEnv","dev","load","eagerBundleOptions","__EXPO_EAGER_BUNDLE_OPTIONS","deserializeEagerKey","inputKey","getExportEmbedOptionsKey","key","removeAsync","copyAsync","assetsDest","console","log","warn","ensureProcessExitsAfterDelay","platform","previousPath","fs","existsSync","bundle","assets","files","mkdirSync","recursive","mode","domComponentProxyOutputDir","hasDomComponents","size","Promise","all","output","save","Log","persistMetroFilesAsync","copyPublicFolderAsync","resolve","EXPO_PUBLIC_FOLDER","join","DOM_COMPONENTS_BUNDLE_DIR","persistMetroAssetsAsync","outputDirectory","iosAssetCatalogDirectory","assetCatalogDest","devServerManager","DevServerManager","startMetroAsync","minify","port","isExporting","location","resetDevServer","maxWorkers","devServer","getDefaultDevServer","assert","MetroBundlerDevServer","exp","pkg","getConfig","skipSDKVersionRequirement","isHermes","isEnableHermesManaged","sourceMapUrl","sourcemapOutput","sourcemapUseAbsolutePath","Map","bundles","nativeExportBundleAsync","splitChunks","mainModuleName","resolveRealEntryFilePath","entryFile","engine","undefined","serializerIncludeMaps","bytecode","reactCompiler","experiments","unstable_transformProfile","unstableTransformProfile","apiRoutesEnabled","isReactServerComponentsEnabled","web","exportStandaloneServerAsync","expoDomComponentReferences","artifacts","map","artifact","Array","isArray","metadata","flat","length","filePath","exportDomComponentAsync","includeSourceMaps","asset","httpServerLocation","code","filter","a","type","source","toString","error","isError","isExecutingFromXcodebuild","message","stripAnsi","logMetroErrorInXcode","stopAsync","config","loadMetroConfigAsync","getMetroBundler","server","getBundler","bundleRequest","Server","DEFAULT_BUNDLE_OPTIONS","getMetroDirectBundleOptionsForExpoConfig","watch","onProgress","resolverOptions","transformOptions","splitBundleOptions","bundleType","assertMetroPrivateServer","dependencies","_bundler","getDependencies","shallow","lazy","_config","getMetroAssets","processModuleFilter","serializer","assetPlugins","transformer","publicPath","Error"],"mappings":"AAAA;;;;;CAKC,GACD;;;;;;;;;;;IAiEsBA,gBAAgB,MAAhBA,gBAAgB;IAmDhBC,wBAAwB,MAAxBA,wBAAwB;IAmDxBC,+BAA+B,MAA/BA,+BAA+B;IAyI/BC,sCAAsC,MAAtCA,sCAAsC;IAuEtCC,sBAAsB,MAAtBA,sBAAsB;;;yBAvXlB,cAAc;;;;;;;8DACb,qDAAqD;;;;;;;8DAC7D,QAAQ;;;;;;;8DACZ,IAAI;;;;;;;yBACc,MAAM;;;;;;;8DACpB,kBAAkB;;;;;;;8DACN,kCAAkC;;;;;;;8DAC9C,gCAAgC;;;;;;;8DAElC,MAAM;;;;;;gCAEgD,kBAAkB;qCACzB,uBAAuB;qBACnE,WAAW;kCACE,qCAAqC;uCAChC,gDAAgD;kCACjD,2CAA2C;oCACvC,6CAA6C;yCAC5C,uDAAuD;8BACxC,4CAA4C;sBAC3E,kBAAkB;qBACL,iBAAiB;qBACpC,iBAAiB;yBACV,qBAAqB;qCACR,wBAAwB;8BAC1B,iBAAiB;oCACf,uBAAuB;8BACzB,iBAAiB;4BAC2B,eAAe;8BACrD,gBAAgB;sBACf,kBAAkB;0BACtB,sBAAsB;;;;;;AAE/D,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,mBAAmB,CAAC,AAAC;AAWpD,SAASC,0BAA0B,CAACC,YAAoB,EAAE;IACxD,+CAA+C;IAC/C,IACE,CAACA,YAAY,CAAC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B,EAChBD,eAAe,EACf;YAAED,UAAU;YAAES,OAAO,EAAE,KAAK;YAAEC,IAAI,EAAE,KAAK;SAAE,CAC5C,AAAC;QAEF,MAAMpB,MAAM,GAAGG,MAAM,CAACkB,OAAO,AAAC;QAE9B,OAAOC,IAAAA,UAAc,EAAA,QAAA,EAACN,YAAY,EAAE;YAClCO,mBAAmB,EAAEvB,MAAM,CAACwB,UAAU,CAACD,mBAAmB;YAC1DE,YAAY,EAAEzB,MAAM,CAAC0B,WAAW,CAACD,YAAY;YAC7CzH,QAAQ,EAAE4G,gBAAgB,CAAC5G,QAAQ;YACnC,2FAA2F;YAC3F,YAAY;YACZrB,WAAW,EAAEqH,MAAM,CAACrH,WAAW;YAC/BgJ,UAAU,EAAE3B,MAAM,CAAC0B,WAAW,CAACC,UAAU;SAC1C,CAAC,CAAC;IACL,EAAE,OAAOlC,KAAK,EAAO;QACnB,IAAIC,OAAO,CAACD,KAAK,CAAC,EAAE;YAClB,0EAA0E;YAC1E,iIAAiI;YACjI,IAAI7G,OAAO,CAACoB,QAAQ,KAAK,KAAK,EAAE;gBAC9B,8FAA8F;gBAC9F,IAAI,SAAS,IAAIyF,KAAK,IAAIE,IAAAA,oBAAyB,0BAAA,GAAE,EAAE;oBACrDF,KAAK,CAACG,OAAO,GAAGC,IAAAA,KAAS,UAAA,EAACJ,KAAK,CAACG,OAAO,CAAC,AAAU,CAAC;gBACrD,CAAC;gBACDE,IAAAA,oBAAoB,qBAAA,EAACnH,WAAW,EAAE8G,KAAK,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;QACD,MAAMA,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAASC,OAAO,CAACD,KAAU,EAAkB;IAC3C,OAAOA,KAAK,YAAYmC,KAAK,CAAC;AAChC,CAAC"}
|
|
@@ -87,6 +87,8 @@ const expoExportEmbed = async (argv)=>{
|
|
|
87
87
|
"--config-cmd": String,
|
|
88
88
|
// New flag to guess the other flags based on the environment.
|
|
89
89
|
"--eager": Boolean,
|
|
90
|
+
// Export the bundle as Hermes bytecode bundle
|
|
91
|
+
"--bytecode": Boolean,
|
|
90
92
|
// This is here for compatibility with the `npx react-native bundle` command.
|
|
91
93
|
// devs should use `DEBUG=expo:*` instead.
|
|
92
94
|
"--verbose": Boolean,
|
|
@@ -118,6 +120,7 @@ const expoExportEmbed = async (argv)=>{
|
|
|
118
120
|
`--unstable-transform-profile <string> Experimental, transform JS for a specific JS engine. Currently supported: hermes, hermes-canary, default`,
|
|
119
121
|
`--reset-cache Removes cached files`,
|
|
120
122
|
`--eager Eagerly export the bundle with default options`,
|
|
123
|
+
`--bytecode Export the bundle as Hermes bytecode bundle`,
|
|
121
124
|
`-v, --verbose Enables debug logging`,
|
|
122
125
|
`--config <string> Path to the CLI configuration file`,
|
|
123
126
|
// This is seemingly unused.
|
|
@@ -134,6 +137,7 @@ const expoExportEmbed = async (argv)=>{
|
|
|
134
137
|
return (async ()=>{
|
|
135
138
|
const parsed = await resolveCustomBooleanArgsAsync(argv ?? [], rawArgsMap, {
|
|
136
139
|
"--eager": Boolean,
|
|
140
|
+
"--bytecode": Boolean,
|
|
137
141
|
"--dev": Boolean,
|
|
138
142
|
"--minify": Boolean,
|
|
139
143
|
"--sourcemap-use-absolute-path": Boolean,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/export/embed/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport path from 'path';\n\nimport { Command } from '../../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../../utils/args';\n\nexport const expoExportEmbed: Command = async (argv) => {\n const rawArgsMap: arg.Spec = {\n // Types\n '--entry-file': String,\n '--platform': String,\n '--transformer': String,\n '--bundle-output': String,\n '--bundle-encoding': String,\n '--max-workers': Number,\n '--sourcemap-output': String,\n '--sourcemap-sources-root': String,\n '--assets-dest': String,\n '--asset-catalog-dest': String,\n '--unstable-transform-profile': String,\n '--config': String,\n\n // Hack: This is added because react-native-xcode.sh script always includes this value.\n // If supplied, we'll do nothing with the value, but at least the process won't crash.\n // Note that we also don't show this value in the `--help` prompt since we don't want people to use it.\n '--config-cmd': String,\n\n // New flag to guess the other flags based on the environment.\n '--eager': Boolean,\n\n // This is here for compatibility with the `npx react-native bundle` command.\n // devs should use `DEBUG=expo:*` instead.\n '--verbose': Boolean,\n '--help': Boolean,\n // Aliases\n '-h': '--help',\n '-v': '--verbose',\n };\n const args = assertWithOptionsArgs(rawArgsMap, {\n argv,\n permissive: true,\n });\n\n if (args['--help']) {\n printHelp(\n `(Internal) Export the JavaScript bundle during a native build script for embedding in a native binary`,\n chalk`npx expo export:embed {dim <dir>}`,\n [\n chalk`<dir> Directory of the Expo project. {dim Default: Current working directory}`,\n `--entry-file <path> Path to the root JS file, either absolute or relative to JS root`,\n `--platform <string> Either \"ios\" or \"android\" (default: \"ios\")`,\n `--transformer <string> Specify a custom transformer to be used`,\n `--dev [boolean] If false, warnings are disabled and the bundle is minified (default: true)`,\n `--minify [boolean] Allows overriding whether bundle is minified. This defaults to false if dev is true, and true if dev is false. Disabling minification can be useful for speeding up production builds for testing purposes.`,\n `--bundle-output <string> File name where to store the resulting bundle, ex. /tmp/groups.bundle`,\n `--bundle-encoding <string> Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer). (default: \"utf8\")`,\n `--max-workers <number> Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine.`,\n `--sourcemap-output <string> File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map`,\n `--sourcemap-sources-root <string> Path to make sourcemap's sources entries relative to, ex. /root/dir`,\n `--sourcemap-use-absolute-path Report SourceMapURL using its full path`,\n `--assets-dest <string> Directory name where to store assets referenced in the bundle`,\n `--asset-catalog-dest <string> Directory to create an iOS Asset Catalog for images`,\n `--unstable-transform-profile <string> Experimental, transform JS for a specific JS engine. Currently supported: hermes, hermes-canary, default`,\n `--reset-cache Removes cached files`,\n `--eager Eagerly export the bundle with default options`,\n `-v, --verbose Enables debug logging`,\n\n `--config <string> Path to the CLI configuration file`,\n // This is seemingly unused.\n `--read-global-cache Try to fetch transformed JS code from the global cache, if configured.`,\n\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n const [\n { exportEmbedAsync },\n { resolveOptions },\n { logCmdError },\n { resolveCustomBooleanArgsAsync },\n ] = await Promise.all([\n import('./exportEmbedAsync.js'),\n import('./resolveOptions.js'),\n import('../../utils/errors.js'),\n import('../../utils/resolveArgs.js'),\n ]);\n\n return (async () => {\n const parsed = await resolveCustomBooleanArgsAsync(argv ?? [], rawArgsMap, {\n '--eager': Boolean,\n '--dev': Boolean,\n '--minify': Boolean,\n '--sourcemap-use-absolute-path': Boolean,\n '--reset-cache': Boolean,\n '--read-global-cache': Boolean,\n });\n\n const projectRoot = path.resolve(parsed.projectRoot);\n return exportEmbedAsync(projectRoot, resolveOptions(projectRoot, args, parsed));\n })().catch(logCmdError);\n};\n"],"names":["expoExportEmbed","argv","rawArgsMap","String","Number","Boolean","args","assertWithOptionsArgs","permissive","printHelp","chalk","join","exportEmbedAsync","resolveOptions","logCmdError","resolveCustomBooleanArgsAsync","Promise","all","parsed","projectRoot","path","resolve","catch"],"mappings":"AAAA;;;;;+BAQaA,iBAAe;;aAAfA,eAAe;;;8DANV,OAAO;;;;;;;8DACR,MAAM;;;;;;sBAG0B,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE5D,MAAMA,eAAe,GAAY,OAAOC,IAAI,GAAK;IACtD,MAAMC,UAAU,GAAa;QAC3B,QAAQ;QACR,cAAc,EAAEC,MAAM;QACtB,YAAY,EAAEA,MAAM;QACpB,eAAe,EAAEA,MAAM;QACvB,iBAAiB,EAAEA,MAAM;QACzB,mBAAmB,EAAEA,MAAM;QAC3B,eAAe,EAAEC,MAAM;QACvB,oBAAoB,EAAED,MAAM;QAC5B,0BAA0B,EAAEA,MAAM;QAClC,eAAe,EAAEA,MAAM;QACvB,sBAAsB,EAAEA,MAAM;QAC9B,8BAA8B,EAAEA,MAAM;QACtC,UAAU,EAAEA,MAAM;QAElB,uFAAuF;QACvF,sFAAsF;QACtF,uGAAuG;QACvG,cAAc,EAAEA,MAAM;QAEtB,8DAA8D;QAC9D,SAAS,EAAEE,OAAO;
|
|
1
|
+
{"version":3,"sources":["../../../../src/export/embed/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport path from 'path';\n\nimport { Command } from '../../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../../utils/args';\n\nexport const expoExportEmbed: Command = async (argv) => {\n const rawArgsMap: arg.Spec = {\n // Types\n '--entry-file': String,\n '--platform': String,\n '--transformer': String,\n '--bundle-output': String,\n '--bundle-encoding': String,\n '--max-workers': Number,\n '--sourcemap-output': String,\n '--sourcemap-sources-root': String,\n '--assets-dest': String,\n '--asset-catalog-dest': String,\n '--unstable-transform-profile': String,\n '--config': String,\n\n // Hack: This is added because react-native-xcode.sh script always includes this value.\n // If supplied, we'll do nothing with the value, but at least the process won't crash.\n // Note that we also don't show this value in the `--help` prompt since we don't want people to use it.\n '--config-cmd': String,\n\n // New flag to guess the other flags based on the environment.\n '--eager': Boolean,\n // Export the bundle as Hermes bytecode bundle\n '--bytecode': Boolean,\n\n // This is here for compatibility with the `npx react-native bundle` command.\n // devs should use `DEBUG=expo:*` instead.\n '--verbose': Boolean,\n '--help': Boolean,\n // Aliases\n '-h': '--help',\n '-v': '--verbose',\n };\n const args = assertWithOptionsArgs(rawArgsMap, {\n argv,\n permissive: true,\n });\n\n if (args['--help']) {\n printHelp(\n `(Internal) Export the JavaScript bundle during a native build script for embedding in a native binary`,\n chalk`npx expo export:embed {dim <dir>}`,\n [\n chalk`<dir> Directory of the Expo project. {dim Default: Current working directory}`,\n `--entry-file <path> Path to the root JS file, either absolute or relative to JS root`,\n `--platform <string> Either \"ios\" or \"android\" (default: \"ios\")`,\n `--transformer <string> Specify a custom transformer to be used`,\n `--dev [boolean] If false, warnings are disabled and the bundle is minified (default: true)`,\n `--minify [boolean] Allows overriding whether bundle is minified. This defaults to false if dev is true, and true if dev is false. Disabling minification can be useful for speeding up production builds for testing purposes.`,\n `--bundle-output <string> File name where to store the resulting bundle, ex. /tmp/groups.bundle`,\n `--bundle-encoding <string> Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer). (default: \"utf8\")`,\n `--max-workers <number> Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine.`,\n `--sourcemap-output <string> File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map`,\n `--sourcemap-sources-root <string> Path to make sourcemap's sources entries relative to, ex. /root/dir`,\n `--sourcemap-use-absolute-path Report SourceMapURL using its full path`,\n `--assets-dest <string> Directory name where to store assets referenced in the bundle`,\n `--asset-catalog-dest <string> Directory to create an iOS Asset Catalog for images`,\n `--unstable-transform-profile <string> Experimental, transform JS for a specific JS engine. Currently supported: hermes, hermes-canary, default`,\n `--reset-cache Removes cached files`,\n `--eager Eagerly export the bundle with default options`,\n `--bytecode Export the bundle as Hermes bytecode bundle`,\n `-v, --verbose Enables debug logging`,\n\n `--config <string> Path to the CLI configuration file`,\n // This is seemingly unused.\n `--read-global-cache Try to fetch transformed JS code from the global cache, if configured.`,\n\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n const [\n { exportEmbedAsync },\n { resolveOptions },\n { logCmdError },\n { resolveCustomBooleanArgsAsync },\n ] = await Promise.all([\n import('./exportEmbedAsync.js'),\n import('./resolveOptions.js'),\n import('../../utils/errors.js'),\n import('../../utils/resolveArgs.js'),\n ]);\n\n return (async () => {\n const parsed = await resolveCustomBooleanArgsAsync(argv ?? [], rawArgsMap, {\n '--eager': Boolean,\n '--bytecode': Boolean,\n '--dev': Boolean,\n '--minify': Boolean,\n '--sourcemap-use-absolute-path': Boolean,\n '--reset-cache': Boolean,\n '--read-global-cache': Boolean,\n });\n\n const projectRoot = path.resolve(parsed.projectRoot);\n return exportEmbedAsync(projectRoot, resolveOptions(projectRoot, args, parsed));\n })().catch(logCmdError);\n};\n"],"names":["expoExportEmbed","argv","rawArgsMap","String","Number","Boolean","args","assertWithOptionsArgs","permissive","printHelp","chalk","join","exportEmbedAsync","resolveOptions","logCmdError","resolveCustomBooleanArgsAsync","Promise","all","parsed","projectRoot","path","resolve","catch"],"mappings":"AAAA;;;;;+BAQaA,iBAAe;;aAAfA,eAAe;;;8DANV,OAAO;;;;;;;8DACR,MAAM;;;;;;sBAG0B,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE5D,MAAMA,eAAe,GAAY,OAAOC,IAAI,GAAK;IACtD,MAAMC,UAAU,GAAa;QAC3B,QAAQ;QACR,cAAc,EAAEC,MAAM;QACtB,YAAY,EAAEA,MAAM;QACpB,eAAe,EAAEA,MAAM;QACvB,iBAAiB,EAAEA,MAAM;QACzB,mBAAmB,EAAEA,MAAM;QAC3B,eAAe,EAAEC,MAAM;QACvB,oBAAoB,EAAED,MAAM;QAC5B,0BAA0B,EAAEA,MAAM;QAClC,eAAe,EAAEA,MAAM;QACvB,sBAAsB,EAAEA,MAAM;QAC9B,8BAA8B,EAAEA,MAAM;QACtC,UAAU,EAAEA,MAAM;QAElB,uFAAuF;QACvF,sFAAsF;QACtF,uGAAuG;QACvG,cAAc,EAAEA,MAAM;QAEtB,8DAA8D;QAC9D,SAAS,EAAEE,OAAO;QAClB,8CAA8C;QAC9C,YAAY,EAAEA,OAAO;QAErB,6EAA6E;QAC7E,0CAA0C;QAC1C,WAAW,EAAEA,OAAO;QACpB,QAAQ,EAAEA,OAAO;QACjB,UAAU;QACV,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,WAAW;KAClB,AAAC;IACF,MAAMC,IAAI,GAAGC,IAAAA,KAAqB,sBAAA,EAACL,UAAU,EAAE;QAC7CD,IAAI;QACJO,UAAU,EAAE,IAAI;K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AAC,AAAC;IAEH,OAAO,CAAC,UAAY;QAClB,MAAMC,MAAM,GAAG,MAAMH,6BAA6B,CAACd,IAAI,IAAI,EAAE,EAAEC,UAAU,EAAE;YACzE,SAAS,EAAEG,OAAO;YAClB,YAAY,EAAEA,OAAO;YACrB,OAAO,EAAEA,OAAO;YAChB,UAAU,EAAEA,OAAO;YACnB,+BAA+B,EAAEA,OAAO;YACxC,eAAe,EAAEA,OAAO;YACxB,qBAAqB,EAAEA,OAAO;SAC/B,CAAC,AAAC;QAEH,MAAMc,WAAW,GAAGC,KAAI,EAAA,QAAA,CAACC,OAAO,CAACH,MAAM,CAACC,WAAW,CAAC,AAAC;QACrD,OAAOP,gBAAgB,CAACO,WAAW,EAAEN,cAAc,CAACM,WAAW,EAAEb,IAAI,EAAEY,MAAM,CAAC,CAAC,CAAC;IAClF,CAAC,CAAC,EAAE,CAACI,KAAK,CAACR,WAAW,CAAC,CAAC;AAC1B,CAAC,AAAC"}
|
|
@@ -88,7 +88,8 @@ function resolveOptions(projectRoot, args, parsed) {
|
|
|
88
88
|
config: args["--config"] ? _path().default.resolve(args["--config"]) : undefined,
|
|
89
89
|
dev,
|
|
90
90
|
minify: parsed.args["--minify"],
|
|
91
|
-
eager: !!parsed.args["--eager"]
|
|
91
|
+
eager: !!parsed.args["--eager"],
|
|
92
|
+
bytecode: parsed.args["--bytecode"]
|
|
92
93
|
};
|
|
93
94
|
if (commonOptions.eager) {
|
|
94
95
|
return resolveEagerOptionsAsync(projectRoot, commonOptions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/export/embed/resolveOptions.ts"],"sourcesContent":["import { resolveEntryPoint } from '@expo/config/paths';\nimport arg from 'arg';\nimport type { OutputOptions } from 'metro/src/shared/types';\nimport canonicalize from 'metro-core/src/canonicalize';\nimport os from 'os';\nimport path from 'path';\n\nimport { env } from '../../utils/env';\nimport { CommandError } from '../../utils/errors';\nimport { resolveCustomBooleanArgsAsync } from '../../utils/resolveArgs';\nimport { isAndroidUsingHermes, isIosUsingHermes } from '../exportHermes';\n\nexport interface Options {\n assetsDest?: string;\n assetCatalogDest?: string;\n entryFile: string;\n resetCache: boolean;\n transformer?: string;\n minify?: boolean;\n config?: string;\n platform: string;\n dev: boolean;\n bundleOutput: string;\n bundleEncoding?: OutputOptions['bundleEncoding'];\n maxWorkers?: number;\n sourcemapOutput?: string;\n sourcemapSourcesRoot?: string;\n sourcemapUseAbsolutePath: boolean;\n verbose: boolean;\n unstableTransformProfile?: string;\n eager?: boolean;\n}\n\nfunction assertIsBoolean(val: any): asserts val is boolean {\n if (typeof val !== 'boolean') {\n throw new CommandError(`Expected boolean, got ${typeof val}`);\n }\n}\n\nfunction getBundleEncoding(encoding: string | undefined): OutputOptions['bundleEncoding'] {\n return encoding === 'utf8' || encoding === 'utf16le' || encoding === 'ascii'\n ? encoding\n : undefined;\n}\n\nexport function resolveOptions(\n projectRoot: string,\n args: arg.Result<arg.Spec>,\n parsed: Awaited<ReturnType<typeof resolveCustomBooleanArgsAsync>>\n): Options {\n const dev = parsed.args['--dev'] ?? true;\n assertIsBoolean(dev);\n\n const platform = args['--platform'];\n if (!platform) {\n throw new CommandError(`Missing required argument: --platform`);\n }\n\n const bundleOutput = args['--bundle-output'];\n\n const commonOptions = {\n entryFile: args['--entry-file'] ?? resolveEntryPoint(projectRoot, { platform }),\n assetCatalogDest: args['--asset-catalog-dest'],\n platform,\n transformer: args['--transformer'],\n // TODO: Support `--dev false`\n // dev: false,\n bundleOutput,\n bundleEncoding: getBundleEncoding(args['--bundle-encoding']) ?? 'utf8',\n maxWorkers: args['--max-workers'],\n sourcemapOutput: args['--sourcemap-output'],\n sourcemapSourcesRoot: args['--sourcemap-sources-root'],\n sourcemapUseAbsolutePath: !!parsed.args['--sourcemap-use-absolute-path'],\n assetsDest: args['--assets-dest'],\n unstableTransformProfile: args['--unstable-transform-profile'],\n resetCache: !!parsed.args['--reset-cache'],\n verbose: args['--verbose'] ?? env.EXPO_DEBUG,\n config: args['--config'] ? path.resolve(args['--config']) : undefined,\n dev,\n minify: parsed.args['--minify'] as boolean | undefined,\n eager: !!parsed.args['--eager'],\n };\n\n if (commonOptions.eager) {\n return resolveEagerOptionsAsync(projectRoot, commonOptions);\n }\n\n // Perform extra assertions after the eager options are resolved.\n\n if (!bundleOutput) {\n throw new CommandError(`Missing required argument: --bundle-output`);\n }\n\n const minify = parsed.args['--minify'] ?? !dev;\n assertIsBoolean(minify);\n\n return { ...commonOptions, minify, bundleOutput };\n}\n\nfunction getTemporaryPath() {\n return path.join(os.tmpdir(), Math.random().toString(36).substring(2));\n}\n\n/** Best effort guess of which options will be used for the export:embed invocation that is called from the native build scripts. */\nexport function resolveEagerOptionsAsync(\n projectRoot: string,\n {\n dev,\n platform,\n assetsDest,\n bundleOutput,\n minify,\n ...options\n }: Partial<Omit<Options, 'platform' | 'dev'>> & {\n platform: string;\n dev: boolean;\n }\n): Options {\n // If the minify prop is undefined, then check if the project is using hermes.\n minify ??= !(platform === 'android'\n ? isAndroidUsingHermes(projectRoot)\n : isIosUsingHermes(projectRoot));\n\n let destination: string | undefined;\n\n if (!assetsDest) {\n destination ??= getTemporaryPath();\n assetsDest = path.join(destination, 'assets');\n }\n\n if (!bundleOutput) {\n destination ??= getTemporaryPath();\n bundleOutput =\n platform === 'ios'\n ? path.join(destination, 'main.jsbundle')\n : path.join(destination, 'index.js');\n }\n\n return {\n ...options,\n eager: options.eager ?? true,\n bundleOutput,\n assetsDest,\n entryFile: options.entryFile ?? resolveEntryPoint(projectRoot, { platform }),\n resetCache: !!options.resetCache,\n platform,\n minify,\n dev,\n bundleEncoding: 'utf8',\n sourcemapUseAbsolutePath: false,\n verbose: env.EXPO_DEBUG,\n };\n}\n\nexport function getExportEmbedOptionsKey({\n // Extract all values that won't change the Metro results.\n resetCache,\n assetsDest,\n bundleOutput,\n verbose,\n maxWorkers,\n eager,\n ...options\n}: Options) {\n // Create a sorted key for the options, removing values that won't change the Metro results.\n return JSON.stringify(options, canonicalize);\n}\n\nexport function deserializeEagerKey(key: string) {\n return JSON.parse(key) as { options: Options; key: string };\n}\n"],"names":["resolveOptions","resolveEagerOptionsAsync","getExportEmbedOptionsKey","deserializeEagerKey","assertIsBoolean","val","CommandError","getBundleEncoding","encoding","undefined","projectRoot","args","parsed","dev","platform","bundleOutput","commonOptions","entryFile","resolveEntryPoint","assetCatalogDest","transformer","bundleEncoding","maxWorkers","sourcemapOutput","sourcemapSourcesRoot","sourcemapUseAbsolutePath","assetsDest","unstableTransformProfile","resetCache","verbose","env","EXPO_DEBUG","config","path","resolve","minify","eager","getTemporaryPath","join","os","tmpdir","Math","random","toString","substring","options","isAndroidUsingHermes","isIosUsingHermes","destination","JSON","stringify","canonicalize","key","parse"],"mappings":"AAAA;;;;;;;;;;;IA6CgBA,cAAc,MAAdA,cAAc;IA2DdC,wBAAwB,MAAxBA,wBAAwB;IAkDxBC,wBAAwB,MAAxBA,wBAAwB;IAcxBC,mBAAmB,MAAnBA,mBAAmB;;;yBAxKD,oBAAoB;;;;;;;8DAG7B,6BAA6B;;;;;;;8DACvC,IAAI;;;;;;;8DACF,MAAM;;;;;;qBAEH,iBAAiB;wBACR,oBAAoB;8BAEM,iBAAiB;;;;;;AAuBxE,SAASC,eAAe,CAACC,GAAQ,EAA0B;IACzD,IAAI,OAAOA,GAAG,KAAK,SAAS,EAAE;QAC5B,MAAM,IAAIC,OAAY,aAAA,CAAC,CAAC,sBAAsB,EAAE,OAAOD,GAAG,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC;AACH,CAAC;AAED,SAASE,iBAAiB,CAACC,QAA4B,EAAmC;IACxF,OAAOA,QAAQ,KAAK,MAAM,IAAIA,QAAQ,KAAK,SAAS,IAAIA,QAAQ,KAAK,OAAO,GACxEA,QAAQ,GACRC,SAAS,CAAC;AAChB,CAAC;AAEM,SAAST,cAAc,CAC5BU,WAAmB,EACnBC,IAA0B,EAC1BC,MAAiE,EACxD;IACT,MAAMC,GAAG,GAAGD,MAAM,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AAmB,CAACiD,GAAW,EAAE;IAC/C,OAAOH,IAAI,CAACI,KAAK,CAACD,GAAG,CAAC,CAAsC;AAC9D,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/export/embed/resolveOptions.ts"],"sourcesContent":["import { resolveEntryPoint } from '@expo/config/paths';\nimport arg from 'arg';\nimport type { OutputOptions } from 'metro/src/shared/types';\nimport canonicalize from 'metro-core/src/canonicalize';\nimport os from 'os';\nimport path from 'path';\n\nimport { env } from '../../utils/env';\nimport { CommandError } from '../../utils/errors';\nimport { resolveCustomBooleanArgsAsync } from '../../utils/resolveArgs';\nimport { isAndroidUsingHermes, isIosUsingHermes } from '../exportHermes';\n\nexport interface Options {\n assetsDest?: string;\n assetCatalogDest?: string;\n entryFile: string;\n resetCache: boolean;\n transformer?: string;\n minify?: boolean;\n config?: string;\n platform: string;\n dev: boolean;\n bundleOutput: string;\n bundleEncoding?: OutputOptions['bundleEncoding'];\n maxWorkers?: number;\n sourcemapOutput?: string;\n sourcemapSourcesRoot?: string;\n sourcemapUseAbsolutePath: boolean;\n verbose: boolean;\n unstableTransformProfile?: string;\n eager?: boolean;\n bytecode?: boolean;\n}\n\nfunction assertIsBoolean(val: any): asserts val is boolean {\n if (typeof val !== 'boolean') {\n throw new CommandError(`Expected boolean, got ${typeof val}`);\n }\n}\n\nfunction getBundleEncoding(encoding: string | undefined): OutputOptions['bundleEncoding'] {\n return encoding === 'utf8' || encoding === 'utf16le' || encoding === 'ascii'\n ? encoding\n : undefined;\n}\n\nexport function resolveOptions(\n projectRoot: string,\n args: arg.Result<arg.Spec>,\n parsed: Awaited<ReturnType<typeof resolveCustomBooleanArgsAsync>>\n): Options {\n const dev = parsed.args['--dev'] ?? true;\n assertIsBoolean(dev);\n\n const platform = args['--platform'];\n if (!platform) {\n throw new CommandError(`Missing required argument: --platform`);\n }\n\n const bundleOutput = args['--bundle-output'];\n\n const commonOptions = {\n entryFile: args['--entry-file'] ?? resolveEntryPoint(projectRoot, { platform }),\n assetCatalogDest: args['--asset-catalog-dest'],\n platform,\n transformer: args['--transformer'],\n // TODO: Support `--dev false`\n // dev: false,\n bundleOutput,\n bundleEncoding: getBundleEncoding(args['--bundle-encoding']) ?? 'utf8',\n maxWorkers: args['--max-workers'],\n sourcemapOutput: args['--sourcemap-output'],\n sourcemapSourcesRoot: args['--sourcemap-sources-root'],\n sourcemapUseAbsolutePath: !!parsed.args['--sourcemap-use-absolute-path'],\n assetsDest: args['--assets-dest'],\n unstableTransformProfile: args['--unstable-transform-profile'],\n resetCache: !!parsed.args['--reset-cache'],\n verbose: args['--verbose'] ?? env.EXPO_DEBUG,\n config: args['--config'] ? path.resolve(args['--config']) : undefined,\n dev,\n minify: parsed.args['--minify'] as boolean | undefined,\n eager: !!parsed.args['--eager'],\n bytecode: parsed.args['--bytecode'] as boolean | undefined,\n };\n\n if (commonOptions.eager) {\n return resolveEagerOptionsAsync(projectRoot, commonOptions);\n }\n\n // Perform extra assertions after the eager options are resolved.\n\n if (!bundleOutput) {\n throw new CommandError(`Missing required argument: --bundle-output`);\n }\n\n const minify = parsed.args['--minify'] ?? !dev;\n assertIsBoolean(minify);\n\n return { ...commonOptions, minify, bundleOutput };\n}\n\nfunction getTemporaryPath() {\n return path.join(os.tmpdir(), Math.random().toString(36).substring(2));\n}\n\n/** Best effort guess of which options will be used for the export:embed invocation that is called from the native build scripts. */\nexport function resolveEagerOptionsAsync(\n projectRoot: string,\n {\n dev,\n platform,\n assetsDest,\n bundleOutput,\n minify,\n ...options\n }: Partial<Omit<Options, 'platform' | 'dev'>> & {\n platform: string;\n dev: boolean;\n }\n): Options {\n // If the minify prop is undefined, then check if the project is using hermes.\n minify ??= !(platform === 'android'\n ? isAndroidUsingHermes(projectRoot)\n : isIosUsingHermes(projectRoot));\n\n let destination: string | undefined;\n\n if (!assetsDest) {\n destination ??= getTemporaryPath();\n assetsDest = path.join(destination, 'assets');\n }\n\n if (!bundleOutput) {\n destination ??= getTemporaryPath();\n bundleOutput =\n platform === 'ios'\n ? path.join(destination, 'main.jsbundle')\n : path.join(destination, 'index.js');\n }\n\n return {\n ...options,\n eager: options.eager ?? true,\n bundleOutput,\n assetsDest,\n entryFile: options.entryFile ?? resolveEntryPoint(projectRoot, { platform }),\n resetCache: !!options.resetCache,\n platform,\n minify,\n dev,\n bundleEncoding: 'utf8',\n sourcemapUseAbsolutePath: false,\n verbose: env.EXPO_DEBUG,\n };\n}\n\nexport function getExportEmbedOptionsKey({\n // Extract all values that won't change the Metro results.\n resetCache,\n assetsDest,\n bundleOutput,\n verbose,\n maxWorkers,\n eager,\n ...options\n}: Options) {\n // Create a sorted key for the options, removing values that won't change the Metro results.\n return JSON.stringify(options, canonicalize);\n}\n\nexport function deserializeEagerKey(key: string) {\n return JSON.parse(key) as { options: Options; key: string };\n}\n"],"names":["resolveOptions","resolveEagerOptionsAsync","getExportEmbedOptionsKey","deserializeEagerKey","assertIsBoolean","val","CommandError","getBundleEncoding","encoding","undefined","projectRoot","args","parsed","dev","platform","bundleOutput","commonOptions","entryFile","resolveEntryPoint","assetCatalogDest","transformer","bundleEncoding","maxWorkers","sourcemapOutput","sourcemapSourcesRoot","sourcemapUseAbsolutePath","assetsDest","unstableTransformProfile","resetCache","verbose","env","EXPO_DEBUG","config","path","resolve","minify","eager","bytecode","getTemporaryPath","join","os","tmpdir","Math","random","toString","substring","options","isAndroidUsingHermes","isIosUsingHermes","destination","JSON","stringify","canonicalize","key","parse"],"mappings":"AAAA;;;;;;;;;;;IA8CgBA,cAAc,MAAdA,cAAc;IA4DdC,wBAAwB,MAAxBA,wBAAwB;IAkDxBC,wBAAwB,MAAxBA,wBAAwB;IAcxBC,mBAAmB,MAAnBA,mBAAmB;;;yBA1KD,oBAAoB;;;;;;;8DAG7B,6BAA6B;;;;;;;8DACvC,IAAI;;;;;;;8DACF,MAAM;;;;;;qBAEH,iBAAiB;wBACR,oBAAoB;8BAEM,iBAAiB;;;;;;AAwBxE,SAASC,eAAe,CAACC,GAAQ,EAA0B;IACzD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OAAO,CAAClB,UAAU;QAChCd,QAAQ;QACRqB,MAAM;QACNtB,GAAG;QACHQ,cAAc,EAAE,MAAM;QACtBI,wBAAwB,EAAE,KAAK;QAC/BI,OAAO,EAAEC,IAAG,IAAA,CAACC,UAAU;KACxB,CAAC;AACJ,CAAC;AAEM,SAAS7B,wBAAwB,CAAC,EACvC,0DAA0D;AAC1D0B,UAAU,CAAA,EACVF,UAAU,CAAA,EACVX,YAAY,CAAA,EACZc,OAAO,CAAA,EACPP,UAAU,CAAA,EACVc,KAAK,CAAA,EACL,GAAGU,OAAO,EACF,EAAE;IACV,4FAA4F;IAC5F,OAAOI,IAAI,CAACC,SAAS,CAACL,OAAO,EAAEM,aAAY,EAAA,QAAA,CAAC,CAAC;AAC/C,CAAC;AAEM,SAASjD,mBAAmB,CAACkD,GAAW,EAAE;IAC/C,OAAOH,IAAI,CAACI,KAAK,CAACD,GAAG,CAAC,CAAsC;AAC9D,CAAC"}
|
|
@@ -34,6 +34,7 @@ const expoInstall = async (argv)=>{
|
|
|
34
34
|
if (args["--help"]) {
|
|
35
35
|
(0, _args.printHelp)(`Install a module or other package to a project`, `npx expo install`, [
|
|
36
36
|
`--check Check which installed packages need to be updated`,
|
|
37
|
+
"--dev Save the dependencies as devDependencies",
|
|
37
38
|
`--fix Automatically update any invalid package versions`,
|
|
38
39
|
(0, _chalk().default)`--npm Use npm to install dependencies. {dim Default when package-lock.json exists}`,
|
|
39
40
|
(0, _chalk().default)`--yarn Use Yarn to install dependencies. {dim Default when yarn.lock exists}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/install/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../utils/args';\n\nexport const expoInstall: Command = async (argv) => {\n const args = assertWithOptionsArgs(\n {\n // Other options are parsed manually.\n '--help': Boolean,\n // Aliases\n '-h': '--help',\n },\n {\n argv,\n // Allow other options, we'll throw an error if unexpected values are passed.\n permissive: true,\n }\n );\n\n if (args['--help']) {\n printHelp(\n `Install a module or other package to a project`,\n `npx expo install`,\n [\n `--check Check which installed packages need to be updated`,\n `--fix Automatically update any invalid package versions`,\n chalk`--npm Use npm to install dependencies. {dim Default when package-lock.json exists}`,\n chalk`--yarn Use Yarn to install dependencies. {dim Default when yarn.lock exists}`,\n chalk`--bun Use bun to install dependencies. {dim Default when bun.lock or bun.lockb exists}`,\n chalk`--pnpm Use pnpm to install dependencies. {dim Default when pnpm-lock.yaml exists}`,\n `-h, --help Usage info`,\n ].join('\\n'),\n [\n '',\n chalk` Additional options can be passed to the underlying install command by using {bold --}`,\n chalk` {dim $} npx expo install react -- --verbose`,\n chalk` {dim >} yarn add react --verbose`,\n '',\n ].join('\\n')\n );\n }\n\n // Load modules after the help prompt so `npx expo install -h` shows as fast as possible.\n const { installAsync } = require('./installAsync') as typeof import('./installAsync');\n const { logCmdError } = require('../utils/errors') as typeof import('../utils/errors');\n const { resolveArgsAsync } = require('./resolveOptions') as typeof import('./resolveOptions');\n\n const { variadic, options, extras } = await resolveArgsAsync(process.argv.slice(3)).catch(\n logCmdError\n );\n return installAsync(variadic, options, extras).catch(logCmdError);\n};\n"],"names":["expoInstall","argv","args","assertWithOptionsArgs","Boolean","permissive","printHelp","chalk","join","installAsync","require","logCmdError","resolveArgsAsync","variadic","options","extras","process","slice","catch"],"mappings":"AAAA;;;;;+BAMaA,aAAW;;aAAXA,WAAW;;;8DALN,OAAO;;;;;;sBAGwB,eAAe;;;;;;AAEzD,MAAMA,WAAW,GAAY,OAAOC,IAAI,GAAK;IAClD,MAAMC,IAAI,GAAGC,IAAAA,KAAqB,sBAAA,EAChC;QACE,qCAAqC;QACrC,QAAQ,EAAEC,OAAO;QACjB,UAAU;QACV,IAAI,EAAE,QAAQ;KACf,EACD;QACEH,IAAI;QACJ,6EAA6E;QAC7EI,UAAU,EAAE,IAAI;KACjB,CACF,AAAC;IAEF,IAAIH,IA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AAEC,OAAO,EAAEC,MAAM,CAAC,CAACG,KAAK,CAACP,WAAW,CAAC,CAAC;AACpE,CAAC,AAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/install/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../utils/args';\n\nexport const expoInstall: Command = async (argv) => {\n const args = assertWithOptionsArgs(\n {\n // Other options are parsed manually.\n '--help': Boolean,\n // Aliases\n '-h': '--help',\n },\n {\n argv,\n // Allow other options, we'll throw an error if unexpected values are passed.\n permissive: true,\n }\n );\n\n if (args['--help']) {\n printHelp(\n `Install a module or other package to a project`,\n `npx expo install`,\n [\n `--check Check which installed packages need to be updated`,\n '--dev Save the dependencies as devDependencies',\n `--fix Automatically update any invalid package versions`,\n chalk`--npm Use npm to install dependencies. {dim Default when package-lock.json exists}`,\n chalk`--yarn Use Yarn to install dependencies. {dim Default when yarn.lock exists}`,\n chalk`--bun Use bun to install dependencies. {dim Default when bun.lock or bun.lockb exists}`,\n chalk`--pnpm Use pnpm to install dependencies. {dim Default when pnpm-lock.yaml exists}`,\n `-h, --help Usage info`,\n ].join('\\n'),\n [\n '',\n chalk` Additional options can be passed to the underlying install command by using {bold --}`,\n chalk` {dim $} npx expo install react -- --verbose`,\n chalk` {dim >} yarn add react --verbose`,\n '',\n ].join('\\n')\n );\n }\n\n // Load modules after the help prompt so `npx expo install -h` shows as fast as possible.\n const { installAsync } = require('./installAsync') as typeof import('./installAsync');\n const { logCmdError } = require('../utils/errors') as typeof import('../utils/errors');\n const { resolveArgsAsync } = require('./resolveOptions') as typeof import('./resolveOptions');\n\n const { variadic, options, extras } = await resolveArgsAsync(process.argv.slice(3)).catch(\n logCmdError\n );\n return installAsync(variadic, options, extras).catch(logCmdError);\n};\n"],"names":["expoInstall","argv","args","assertWithOptionsArgs","Boolean","permissive","printHelp","chalk","join","installAsync","require","logCmdError","resolveArgsAsync","variadic","options","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AEC,WAAW,CAAA,EAAE,GAAGD,OAAO,CAAC,iBAAiB,CAAC,AAAoC,AAAC;IACvF,MAAM,EAAEE,gBAAgB,CAAA,EAAE,GAAGF,OAAO,CAAC,kBAAkB,CAAC,AAAqC,AAAC;IAE9F,MAAM,EAAEG,QAAQ,CAAA,EAAEC,OAAO,CAAA,EAAEC,MAAM,CAAA,EAAE,GAAG,MAAMH,gBAAgB,CAACI,OAAO,CAACf,IAAI,CAACgB,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,KAAK,CACvFP,WAAW,CACZ,AAAC;IACF,OAAOF,YAAY,CAACI,QAAQ,EAAEC,OAAO,EAAEC,MAAM,CAAC,CAACG,KAAK,CAACP,WAAW,CAAC,CAAC;AACpE,CAAC,AAAC"}
|
|
@@ -39,6 +39,7 @@ const _installExpoPackage = require("./installExpoPackage");
|
|
|
39
39
|
const _log = /*#__PURE__*/ _interopRequireWildcard(require("../log"));
|
|
40
40
|
const _checkPackagesCompatibility = require("./utils/checkPackagesCompatibility");
|
|
41
41
|
const _getVersionedPackages = require("../start/doctor/dependencies/getVersionedPackages");
|
|
42
|
+
const _env = require("../utils/env");
|
|
42
43
|
const _errors = require("../utils/errors");
|
|
43
44
|
const _findUp = require("../utils/findUp");
|
|
44
45
|
const _link = require("../utils/link");
|
|
@@ -119,7 +120,7 @@ async function installAsync(packages, options, packageManagerArguments = []) {
|
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
122
|
// note(simek): check out the packages compatibility with New Architecture against RND API
|
|
122
|
-
if (!
|
|
123
|
+
if (!_env.env.EXPO_NO_NEW_ARCH_COMPAT_CHECK) {
|
|
123
124
|
await (0, _checkPackagesCompatibility.checkPackagesCompatibility)(otherPackages);
|
|
124
125
|
}
|
|
125
126
|
// Read the project Expo config without plugins.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/install/installAsync.ts"],"sourcesContent":["import { getConfig, getPackageJson } from '@expo/config';\nimport * as PackageManager from '@expo/package-manager';\nimport chalk from 'chalk';\n\nimport { applyPluginsAsync } from './applyPlugins';\nimport { checkPackagesAsync } from './checkPackages';\nimport { installExpoPackageAsync } from './installExpoPackage';\nimport { Options } from './resolveOptions';\nimport * as Log from '../log';\nimport { checkPackagesCompatibility } from './utils/checkPackagesCompatibility';\nimport { getVersionedPackagesAsync } from '../start/doctor/dependencies/getVersionedPackages';\nimport { CommandError } from '../utils/errors';\nimport { findUpProjectRootOrAssert } from '../utils/findUp';\nimport { learnMore } from '../utils/link';\nimport { setNodeEnv } from '../utils/nodeEnv';\nimport { joinWithCommasAnd } from '../utils/strings';\n\n/**\n * Installs versions of specified packages compatible with the current Expo SDK version, or\n * checks/ fixes dependencies in project if they don't match compatible versions specified in bundledNativeModules or versions endpoints.\n *\n * @param packages list of packages to install, if installing specific packages and not checking/ fixing\n * @param options options, including check or fix\n * @param packageManagerArguments arguments to forward to the package manager invoked while installing\n * @returns Promise<void>\n */\nexport async function installAsync(\n packages: string[],\n options: Options & { projectRoot?: string },\n packageManagerArguments: string[] = []\n) {\n setNodeEnv('development');\n // Locate the project root based on the process current working directory.\n // This enables users to run `npx expo install` from a subdirectory of the project.\n const projectRoot = options?.projectRoot ?? findUpProjectRootOrAssert(process.cwd());\n require('@expo/env').load(projectRoot);\n\n // Resolve the package manager used by the project, or based on the provided arguments.\n const packageManager = PackageManager.createForProject(projectRoot, {\n npm: options.npm,\n yarn: options.yarn,\n bun: options.bun,\n pnpm: options.pnpm,\n silent: options.silent,\n log: Log.log,\n });\n\n const expoVersion = findPackageByName(packages, 'expo');\n const otherPackages = packages.filter((pkg) => pkg !== expoVersion);\n\n // Abort early when installing `expo@<version>` and other packages with `--fix/--check`\n if (packageHasVersion(expoVersion) && otherPackages.length && (options.check || options.fix)) {\n throw new CommandError(\n 'BAD_ARGS',\n `Cannot install other packages with ${expoVersion} and --fix or --check`\n );\n }\n\n // Only check/fix packages if `expo@<version>` is not requested\n if (!packageHasVersion(expoVersion) && (options.check || options.fix)) {\n return await checkPackagesAsync(projectRoot, {\n packages,\n options,\n packageManager,\n packageManagerArguments,\n });\n }\n\n // note(simek): check out the packages compatibility with New Architecture against RND API\n if (!process.env.EXPO_NO_NEW_ARCH_COMPAT_CHECK) {\n await checkPackagesCompatibility(otherPackages);\n }\n\n // Read the project Expo config without plugins.\n const { exp } = getConfig(projectRoot, {\n // Sometimes users will add a plugin to the config before installing the library,\n // this wouldn't work unless we dangerously disable plugin serialization.\n skipPlugins: true,\n });\n\n // Resolve the versioned packages, then install them.\n return installPackagesAsync(projectRoot, {\n ...options,\n packageManager,\n packages,\n packageManagerArguments,\n sdkVersion: exp.sdkVersion!,\n });\n}\n\n/** Version packages and install in a project. */\nexport async function installPackagesAsync(\n projectRoot: string,\n {\n packages,\n packageManager,\n sdkVersion,\n packageManagerArguments,\n fix,\n check,\n dev,\n }: Options & {\n /**\n * List of packages to version, grouped by the type of dependency.\n * @example ['uuid', 'react-native-reanimated@latest']\n */\n packages: string[];\n /** Package manager to use when installing the versioned packages. */\n packageManager: PackageManager.NodePackageManager;\n /**\n * SDK to version `packages` for.\n * @example '44.0.0'\n */\n sdkVersion: string;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n }\n): Promise<void> {\n // Read the project Expo config without plugins.\n const pkg = getPackageJson(projectRoot);\n\n //assertNotInstallingExcludedPackages(projectRoot, packages, pkg);\n\n const versioning = await getVersionedPackagesAsync(projectRoot, {\n packages,\n // sdkVersion is always defined because we don't skipSDKVersionRequirement in getConfig.\n sdkVersion,\n pkg,\n });\n\n Log.log(\n chalk`\\u203A Installing ${\n versioning.messages.length ? versioning.messages.join(' and ') + ' ' : ''\n }using {bold ${packageManager.name}}`\n );\n\n if (versioning.excludedNativeModules.length) {\n const alreadyExcluded = versioning.excludedNativeModules.filter(\n (module) => module.isExcludedFromValidation\n );\n const specifiedExactVersion = versioning.excludedNativeModules.filter(\n (module) => !module.isExcludedFromValidation\n );\n\n if (alreadyExcluded.length) {\n Log.log(\n chalk`\\u203A Using ${joinWithCommasAnd(\n alreadyExcluded.map(\n ({ bundledNativeVersion, name, specifiedVersion }) =>\n `${specifiedVersion || 'latest'} instead of ${bundledNativeVersion} for ${name}`\n )\n )} because ${\n alreadyExcluded.length > 1 ? 'they are' : 'it is'\n } listed in {bold expo.install.exclude} in package.json. ${learnMore(\n 'https://docs.expo.dev/more/expo-cli/#configuring-dependency-validation'\n )}`\n );\n }\n\n if (specifiedExactVersion.length) {\n Log.log(\n chalk`\\u203A Using ${joinWithCommasAnd(\n specifiedExactVersion.map(\n ({ bundledNativeVersion, name, specifiedVersion }) =>\n `${specifiedVersion} instead of ${bundledNativeVersion} for ${name}`\n )\n )} because ${\n specifiedExactVersion.length > 1 ? 'these versions' : 'this version'\n } was explicitly provided. Packages excluded from dependency validation should be listed in {bold expo.install.exclude} in package.json. ${learnMore(\n 'https://docs.expo.dev/more/expo-cli/#configuring-dependency-validation'\n )}`\n );\n }\n }\n\n // `expo` needs to be installed before installing other packages\n const expoPackage = findPackageByName(packages, 'expo');\n if (expoPackage) {\n const postInstallCommand = packages.filter((pkg) => pkg !== expoPackage);\n\n // Pipe options to the next command\n if (fix) postInstallCommand.push('--fix');\n if (check) postInstallCommand.push('--check');\n\n // Abort after installing `expo`, follow up command is spawn in a new process\n return await installExpoPackageAsync(projectRoot, {\n packageManager,\n packageManagerArguments,\n expoPackageToInstall: versioning.packages.find((pkg) => pkg.startsWith('expo@'))!,\n followUpCommandArgs: postInstallCommand,\n });\n }\n\n if (dev) {\n await packageManager.addDevAsync([...packageManagerArguments, ...versioning.packages]);\n } else {\n await packageManager.addAsync([...packageManagerArguments, ...versioning.packages]);\n }\n\n await applyPluginsAsync(projectRoot, versioning.packages);\n}\n\n/** Find a package, by name, in the requested packages list (`expo` -> `expo`/`expo@<version>`) */\nfunction findPackageByName(packages: string[], name: string) {\n return packages.find((pkg) => pkg === name || pkg.startsWith(`${name}@`));\n}\n\n/** Determine if a specific version is requested for a package */\nfunction packageHasVersion(name = '') {\n return name.includes('@');\n}\n"],"names":["installAsync","installPackagesAsync","packages","options","packageManagerArguments","setNodeEnv","projectRoot","findUpProjectRootOrAssert","process","cwd","require","load","packageManager","PackageManager","createForProject","npm","yarn","bun","pnpm","silent","log","Log","expoVersion","findPackageByName","otherPackages","filter","pkg","packageHasVersion","length","check","fix","CommandError","checkPackagesAsync","env","EXPO_NO_NEW_ARCH_COMPAT_CHECK","checkPackagesCompatibility","exp","getConfig","skipPlugins","sdkVersion","dev","getPackageJson","versioning","getVersionedPackagesAsync","chalk","messages","join","name","excludedNativeModules","alreadyExcluded","module","isExcludedFromValidation","specifiedExactVersion","joinWithCommasAnd","map","bundledNativeVersion","specifiedVersion","learnMore","expoPackage","postInstallCommand","push","installExpoPackageAsync","expoPackageToInstall","find","startsWith","followUpCommandArgs","addDevAsync","addAsync","applyPluginsAsync","includes"],"mappings":"AAAA;;;;;;;;;;;IA0BsBA,YAAY,MAAZA,YAAY;IAiEZC,oBAAoB,MAApBA,oBAAoB;;;yBA3FA,cAAc;;;;;;;+DACxB,uBAAuB;;;;;;;8DACrC,OAAO;;;;;;8BAES,gBAAgB;+BACf,iBAAiB;oCACZ,sBAAsB;2DAEzC,QAAQ;4CACc,oCAAoC;sCACrC,mDAAmD;wBAChE,iBAAiB;wBACJ,iBAAiB;sBACjC,eAAe;yBACd,kBAAkB;yBACX,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAW7C,eAAeD,YAAY,CAChCE,QAAkB,EAClBC,OAA2C,EAC3CC,uBAAiC,GAAG,EAAE,EACtC;IACAC,IAAAA,QAAU,WAAA,EAAC,aAAa,CAAC,CAAC;IAC1B,0EAA0E;IAC1E,mFAAmF;IACnF,MAAMC,WAAW,GAAGH,CAAAA,OAAO,QAAa,GAApBA,KAAAA,CAAoB,GAApBA,OAAO,CAAEG,WAAW,CAAA,IAAIC,IAAAA,OAAyB,0BAAA,EAACC,O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,GAAG,GAAKA,GAAG,KAAKqB,IAAI,IAAIrB,GAAG,CAACsC,UAAU,CAAC,CAAC,EAAEjB,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,+DAA+D,GAC/D,SAASpB,iBAAiB,CAACoB,IAAI,GAAG,EAAE,EAAE;IACpC,OAAOA,IAAI,CAACsB,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/install/installAsync.ts"],"sourcesContent":["import { getConfig, getPackageJson } from '@expo/config';\nimport * as PackageManager from '@expo/package-manager';\nimport chalk from 'chalk';\n\nimport { applyPluginsAsync } from './applyPlugins';\nimport { checkPackagesAsync } from './checkPackages';\nimport { installExpoPackageAsync } from './installExpoPackage';\nimport { Options } from './resolveOptions';\nimport * as Log from '../log';\nimport { checkPackagesCompatibility } from './utils/checkPackagesCompatibility';\nimport { getVersionedPackagesAsync } from '../start/doctor/dependencies/getVersionedPackages';\nimport { env } from '../utils/env';\nimport { CommandError } from '../utils/errors';\nimport { findUpProjectRootOrAssert } from '../utils/findUp';\nimport { learnMore } from '../utils/link';\nimport { setNodeEnv } from '../utils/nodeEnv';\nimport { joinWithCommasAnd } from '../utils/strings';\n\n/**\n * Installs versions of specified packages compatible with the current Expo SDK version, or\n * checks/ fixes dependencies in project if they don't match compatible versions specified in bundledNativeModules or versions endpoints.\n *\n * @param packages list of packages to install, if installing specific packages and not checking/ fixing\n * @param options options, including check or fix\n * @param packageManagerArguments arguments to forward to the package manager invoked while installing\n * @returns Promise<void>\n */\nexport async function installAsync(\n packages: string[],\n options: Options & { projectRoot?: string },\n packageManagerArguments: string[] = []\n) {\n setNodeEnv('development');\n // Locate the project root based on the process current working directory.\n // This enables users to run `npx expo install` from a subdirectory of the project.\n const projectRoot = options?.projectRoot ?? findUpProjectRootOrAssert(process.cwd());\n require('@expo/env').load(projectRoot);\n\n // Resolve the package manager used by the project, or based on the provided arguments.\n const packageManager = PackageManager.createForProject(projectRoot, {\n npm: options.npm,\n yarn: options.yarn,\n bun: options.bun,\n pnpm: options.pnpm,\n silent: options.silent,\n log: Log.log,\n });\n\n const expoVersion = findPackageByName(packages, 'expo');\n const otherPackages = packages.filter((pkg) => pkg !== expoVersion);\n\n // Abort early when installing `expo@<version>` and other packages with `--fix/--check`\n if (packageHasVersion(expoVersion) && otherPackages.length && (options.check || options.fix)) {\n throw new CommandError(\n 'BAD_ARGS',\n `Cannot install other packages with ${expoVersion} and --fix or --check`\n );\n }\n\n // Only check/fix packages if `expo@<version>` is not requested\n if (!packageHasVersion(expoVersion) && (options.check || options.fix)) {\n return await checkPackagesAsync(projectRoot, {\n packages,\n options,\n packageManager,\n packageManagerArguments,\n });\n }\n\n // note(simek): check out the packages compatibility with New Architecture against RND API\n if (!env.EXPO_NO_NEW_ARCH_COMPAT_CHECK) {\n await checkPackagesCompatibility(otherPackages);\n }\n\n // Read the project Expo config without plugins.\n const { exp } = getConfig(projectRoot, {\n // Sometimes users will add a plugin to the config before installing the library,\n // this wouldn't work unless we dangerously disable plugin serialization.\n skipPlugins: true,\n });\n\n // Resolve the versioned packages, then install them.\n return installPackagesAsync(projectRoot, {\n ...options,\n packageManager,\n packages,\n packageManagerArguments,\n sdkVersion: exp.sdkVersion!,\n });\n}\n\n/** Version packages and install in a project. */\nexport async function installPackagesAsync(\n projectRoot: string,\n {\n packages,\n packageManager,\n sdkVersion,\n packageManagerArguments,\n fix,\n check,\n dev,\n }: Options & {\n /**\n * List of packages to version, grouped by the type of dependency.\n * @example ['uuid', 'react-native-reanimated@latest']\n */\n packages: string[];\n /** Package manager to use when installing the versioned packages. */\n packageManager: PackageManager.NodePackageManager;\n /**\n * SDK to version `packages` for.\n * @example '44.0.0'\n */\n sdkVersion: string;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n }\n): Promise<void> {\n // Read the project Expo config without plugins.\n const pkg = getPackageJson(projectRoot);\n\n //assertNotInstallingExcludedPackages(projectRoot, packages, pkg);\n\n const versioning = await getVersionedPackagesAsync(projectRoot, {\n packages,\n // sdkVersion is always defined because we don't skipSDKVersionRequirement in getConfig.\n sdkVersion,\n pkg,\n });\n\n Log.log(\n chalk`\\u203A Installing ${\n versioning.messages.length ? versioning.messages.join(' and ') + ' ' : ''\n }using {bold ${packageManager.name}}`\n );\n\n if (versioning.excludedNativeModules.length) {\n const alreadyExcluded = versioning.excludedNativeModules.filter(\n (module) => module.isExcludedFromValidation\n );\n const specifiedExactVersion = versioning.excludedNativeModules.filter(\n (module) => !module.isExcludedFromValidation\n );\n\n if (alreadyExcluded.length) {\n Log.log(\n chalk`\\u203A Using ${joinWithCommasAnd(\n alreadyExcluded.map(\n ({ bundledNativeVersion, name, specifiedVersion }) =>\n `${specifiedVersion || 'latest'} instead of ${bundledNativeVersion} for ${name}`\n )\n )} because ${\n alreadyExcluded.length > 1 ? 'they are' : 'it is'\n } listed in {bold expo.install.exclude} in package.json. ${learnMore(\n 'https://docs.expo.dev/more/expo-cli/#configuring-dependency-validation'\n )}`\n );\n }\n\n if (specifiedExactVersion.length) {\n Log.log(\n chalk`\\u203A Using ${joinWithCommasAnd(\n specifiedExactVersion.map(\n ({ bundledNativeVersion, name, specifiedVersion }) =>\n `${specifiedVersion} instead of ${bundledNativeVersion} for ${name}`\n )\n )} because ${\n specifiedExactVersion.length > 1 ? 'these versions' : 'this version'\n } was explicitly provided. Packages excluded from dependency validation should be listed in {bold expo.install.exclude} in package.json. ${learnMore(\n 'https://docs.expo.dev/more/expo-cli/#configuring-dependency-validation'\n )}`\n );\n }\n }\n\n // `expo` needs to be installed before installing other packages\n const expoPackage = findPackageByName(packages, 'expo');\n if (expoPackage) {\n const postInstallCommand = packages.filter((pkg) => pkg !== expoPackage);\n\n // Pipe options to the next command\n if (fix) postInstallCommand.push('--fix');\n if (check) postInstallCommand.push('--check');\n\n // Abort after installing `expo`, follow up command is spawn in a new process\n return await installExpoPackageAsync(projectRoot, {\n packageManager,\n packageManagerArguments,\n expoPackageToInstall: versioning.packages.find((pkg) => pkg.startsWith('expo@'))!,\n followUpCommandArgs: postInstallCommand,\n });\n }\n\n if (dev) {\n await packageManager.addDevAsync([...packageManagerArguments, ...versioning.packages]);\n } else {\n await packageManager.addAsync([...packageManagerArguments, ...versioning.packages]);\n }\n\n await applyPluginsAsync(projectRoot, versioning.packages);\n}\n\n/** Find a package, by name, in the requested packages list (`expo` -> `expo`/`expo@<version>`) */\nfunction findPackageByName(packages: string[], name: string) {\n return packages.find((pkg) => pkg === name || pkg.startsWith(`${name}@`));\n}\n\n/** Determine if a specific version is requested for a package */\nfunction packageHasVersion(name = '') {\n return name.includes('@');\n}\n"],"names":["installAsync","installPackagesAsync","packages","options","packageManagerArguments","setNodeEnv","projectRoot","findUpProjectRootOrAssert","process","cwd","require","load","packageManager","PackageManager","createForProject","npm","yarn","bun","pnpm","silent","log","Log","expoVersion","findPackageByName","otherPackages","filter","pkg","packageHasVersion","length","check","fix","CommandError","checkPackagesAsync","env","EXPO_NO_NEW_ARCH_COMPAT_CHECK","checkPackagesCompatibility","exp","getConfig","skipPlugins","sdkVersion","dev","getPackageJson","versioning","getVersionedPackagesAsync","chalk","messages","join","name","excludedNativeModules","alreadyExcluded","module","isExcludedFromValidation","specifiedExactVersion","joinWithCommasAnd","map","bundledNativeVersion","specifiedVersion","learnMore","expoPackage","postInstallCommand","push","installExpoPackageAsync","expoPackageToInstall","find","startsWith","followUpCommandArgs","addDevAsync","addAsync","applyPluginsAsync","includes"],"mappings":"AAAA;;;;;;;;;;;IA2BsBA,YAAY,MAAZA,YAAY;IAiEZC,oBAAoB,MAApBA,oBAAoB;;;yBA5FA,cAAc;;;;;;;+DACxB,uBAAuB;;;;;;;8DACrC,OAAO;;;;;;8BAES,gBAAgB;+BACf,iBAAiB;oCACZ,sBAAsB;2DAEzC,QAAQ;4CACc,oCAAoC;sCACrC,mDAAmD;qBACzE,cAAc;wBACL,iBAAiB;wB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BAAuB;eAAKsC,UAAU,CAACxC,QAAQ;SAAC,CAAC,CAAC;IACzF,OAAO;QACL,MAAMU,cAAc,CAACuD,QAAQ,CAAC;eAAI/D,uBAAuB;eAAKsC,UAAU,CAACxC,QAAQ;SAAC,CAAC,CAAC;IACtF,CAAC;IAED,MAAMkE,IAAAA,aAAiB,kBAAA,EAAC9D,WAAW,EAAEoC,UAAU,CAACxC,QAAQ,CAAC,CAAC;AAC5D,CAAC;AAED,gGAAgG,GAChG,SAASqB,iBAAiB,CAACrB,QAAkB,EAAE6C,IAAY,EAAE;IAC3D,OAAO7C,QAAQ,CAAC6D,IAAI,CAAC,CAACrC,GAAG,GAAKA,GAAG,KAAKqB,IAAI,IAAIrB,GAAG,CAACsC,UAAU,CAAC,CAAC,EAAEjB,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,+DAA+D,GAC/D,SAASpB,iBAAiB,CAACoB,IAAI,GAAG,EAAE,EAAE;IACpC,OAAOA,IAAI,CAACsB,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -66,7 +66,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
66
66
|
}
|
|
67
67
|
return newObj;
|
|
68
68
|
}
|
|
69
|
-
async function installExpoPackageAsync(projectRoot, { packageManager , packageManagerArguments , expoPackageToInstall , followUpCommandArgs }) {
|
|
69
|
+
async function installExpoPackageAsync(projectRoot, { packageManager , packageManagerArguments , expoPackageToInstall , followUpCommandArgs , dev }) {
|
|
70
70
|
// Check if there's potentially a dev server running in the current folder and warn about it
|
|
71
71
|
// (not guaranteed to be Expo CLI, and the CLI isn't always running on 8081, but it's a good guess)
|
|
72
72
|
const isExpoMaybeRunningForProject = !!await (0, _getRunningProcess.getRunningProcess)(8081);
|
|
@@ -75,10 +75,17 @@ async function installExpoPackageAsync(projectRoot, { packageManager , packageMa
|
|
|
75
75
|
}
|
|
76
76
|
// Safe to use current process to upgrade Expo package- doesn't affect current process
|
|
77
77
|
try {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
if (dev) {
|
|
79
|
+
await packageManager.addDevAsync([
|
|
80
|
+
...packageManagerArguments,
|
|
81
|
+
expoPackageToInstall
|
|
82
|
+
]);
|
|
83
|
+
} else {
|
|
84
|
+
await packageManager.addAsync([
|
|
85
|
+
...packageManagerArguments,
|
|
86
|
+
expoPackageToInstall
|
|
87
|
+
]);
|
|
88
|
+
}
|
|
82
89
|
} catch (error) {
|
|
83
90
|
_log.error((0, _chalk().default)`Cannot install the latest Expo package. Install {bold expo@latest} with ${packageManager.name} and then run {bold npx expo install} again.`);
|
|
84
91
|
throw error;
|
|
@@ -88,8 +95,9 @@ async function installExpoPackageAsync(projectRoot, { packageManager , packageMa
|
|
|
88
95
|
let commandSegments = [
|
|
89
96
|
"expo",
|
|
90
97
|
"install",
|
|
98
|
+
dev ? "--dev" : "",
|
|
91
99
|
...followUpCommandArgs
|
|
92
|
-
];
|
|
100
|
+
].filter(Boolean);
|
|
93
101
|
if (packageManagerArguments.length) {
|
|
94
102
|
commandSegments = [
|
|
95
103
|
...commandSegments,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/install/installExpoPackage.ts"],"sourcesContent":["import * as PackageManager from '@expo/package-manager';\nimport spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\n\nimport * as Log from '../log';\nimport { getRunningProcess } from '../utils/getRunningProcess';\n\n/**\n * Given a list of incompatible packages, installs the correct versions of the packages with the package manager used for the project.\n * This exits immediately after spawning the install command, since the command shouldn't remain running while it is being updated.\n */\nexport async function installExpoPackageAsync(\n projectRoot: string,\n {\n packageManager,\n packageManagerArguments,\n expoPackageToInstall,\n followUpCommandArgs,\n }: {\n /** Package manager to use when installing the versioned packages. */\n packageManager: PackageManager.NodePackageManager;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n expoPackageToInstall: string;\n followUpCommandArgs: string[];\n }\n) {\n // Check if there's potentially a dev server running in the current folder and warn about it\n // (not guaranteed to be Expo CLI, and the CLI isn't always running on 8081, but it's a good guess)\n const isExpoMaybeRunningForProject = !!(await getRunningProcess(8081));\n\n if (isExpoMaybeRunningForProject) {\n Log.warn(\n 'The Expo CLI appears to be running this project in another terminal window. Close and restart any Expo CLI instances after the installation to complete the update.'\n );\n }\n\n // Safe to use current process to upgrade Expo package- doesn't affect current process\n try {\n await packageManager.addAsync([...packageManagerArguments, expoPackageToInstall]);\n } catch (error) {\n Log.error(\n chalk`Cannot install the latest Expo package. Install {bold expo@latest} with ${packageManager.name} and then run {bold npx expo install} again.`\n );\n throw error;\n }\n\n // Spawn a new process to install the rest of the packages if there are any, as only then will the latest Expo package be used\n if (followUpCommandArgs.length) {\n let commandSegments = ['expo', 'install', ...followUpCommandArgs];\n if (packageManagerArguments.length) {\n commandSegments = [...commandSegments, '--', ...packageManagerArguments];\n }\n\n Log.log(chalk`\\u203A Running {bold npx expo install} under the updated expo version`);\n Log.log('> ' + commandSegments.join(' '));\n\n await spawnAsync('npx', commandSegments, {\n stdio: 'inherit',\n cwd: projectRoot,\n env: { ...process.env },\n });\n }\n}\n"],"names":["installExpoPackageAsync","projectRoot","packageManager","packageManagerArguments","expoPackageToInstall","followUpCommandArgs","isExpoMaybeRunningForProject","getRunningProcess","Log","warn","addAsync","error","chalk","name","length","commandSegments","log","join","spawnAsync","stdio","cwd","env","process"],"mappings":"AAAA;;;;+
|
|
1
|
+
{"version":3,"sources":["../../../src/install/installExpoPackage.ts"],"sourcesContent":["import * as PackageManager from '@expo/package-manager';\nimport spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\n\nimport * as Log from '../log';\nimport type { Options } from './resolveOptions';\nimport { getRunningProcess } from '../utils/getRunningProcess';\n\n/**\n * Given a list of incompatible packages, installs the correct versions of the packages with the package manager used for the project.\n * This exits immediately after spawning the install command, since the command shouldn't remain running while it is being updated.\n */\nexport async function installExpoPackageAsync(\n projectRoot: string,\n {\n packageManager,\n packageManagerArguments,\n expoPackageToInstall,\n followUpCommandArgs,\n dev,\n }: Pick<Options, 'dev'> & {\n /** Package manager to use when installing the versioned packages. */\n packageManager: PackageManager.NodePackageManager;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n expoPackageToInstall: string;\n followUpCommandArgs: string[];\n }\n) {\n // Check if there's potentially a dev server running in the current folder and warn about it\n // (not guaranteed to be Expo CLI, and the CLI isn't always running on 8081, but it's a good guess)\n const isExpoMaybeRunningForProject = !!(await getRunningProcess(8081));\n\n if (isExpoMaybeRunningForProject) {\n Log.warn(\n 'The Expo CLI appears to be running this project in another terminal window. Close and restart any Expo CLI instances after the installation to complete the update.'\n );\n }\n\n // Safe to use current process to upgrade Expo package- doesn't affect current process\n try {\n if (dev) {\n await packageManager.addDevAsync([...packageManagerArguments, expoPackageToInstall]);\n } else {\n await packageManager.addAsync([...packageManagerArguments, expoPackageToInstall]);\n }\n } catch (error) {\n Log.error(\n chalk`Cannot install the latest Expo package. Install {bold expo@latest} with ${packageManager.name} and then run {bold npx expo install} again.`\n );\n throw error;\n }\n\n // Spawn a new process to install the rest of the packages if there are any, as only then will the latest Expo package be used\n if (followUpCommandArgs.length) {\n let commandSegments = ['expo', 'install', dev ? '--dev' : '', ...followUpCommandArgs].filter(\n Boolean\n );\n if (packageManagerArguments.length) {\n commandSegments = [...commandSegments, '--', ...packageManagerArguments];\n }\n\n Log.log(chalk`\\u203A Running {bold npx expo install} under the updated expo version`);\n Log.log('> ' + commandSegments.join(' '));\n\n await spawnAsync('npx', commandSegments, {\n stdio: 'inherit',\n cwd: projectRoot,\n env: { ...process.env },\n });\n }\n}\n"],"names":["installExpoPackageAsync","projectRoot","packageManager","packageManagerArguments","expoPackageToInstall","followUpCommandArgs","dev","isExpoMaybeRunningForProject","getRunningProcess","Log","warn","addDevAsync","addAsync","error","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,CAACa,MAAM,CAC1FC,OAAO,CACR,AAAC;QACF,IAAIhB,uBAAuB,CAACa,MAAM,EAAE;YAClCC,eAAe,GAAG;mBAAIA,eAAe;gBAAE,IAAI;mBAAKd,uBAAuB;aAAC,CAAC;QAC3E,CAAC;QAEDM,IAAG,CAACW,GAAG,CAACN,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,qEAAqE,CAAC,CAAC,CAAC;QACtFL,IAAG,CAACW,GAAG,CAAC,IAAI,GAAGH,eAAe,CAACI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAE1C,MAAMC,IAAAA,WAAU,EAAA,QAAA,EAAC,KAAK,EAAEL,eAAe,EAAE;YACvCM,KAAK,EAAE,SAAS;YAChBC,GAAG,EAAEvB,WAAW;YAChBwB,GAAG,EAAE;gBAAE,GAAGC,OAAO,CAACD,GAAG;aAAE;SACxB,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -28,6 +28,7 @@ async function resolveArgsAsync(argv) {
|
|
|
28
28
|
const { variadic , extras , flags } = (0, _variadic.parseVariadicArguments)(argv);
|
|
29
29
|
(0, _variadic.assertUnexpectedVariadicFlags)([
|
|
30
30
|
"--check",
|
|
31
|
+
"--dev",
|
|
31
32
|
"--fix",
|
|
32
33
|
"--npm",
|
|
33
34
|
"--pnpm",
|
|
@@ -43,6 +44,7 @@ async function resolveArgsAsync(argv) {
|
|
|
43
44
|
variadic,
|
|
44
45
|
options: resolveOptions({
|
|
45
46
|
fix: !!flags["--fix"],
|
|
47
|
+
dev: !!flags["--dev"],
|
|
46
48
|
check: !!flags["--check"],
|
|
47
49
|
yarn: !!flags["--yarn"],
|
|
48
50
|
npm: !!flags["--npm"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/install/resolveOptions.ts"],"sourcesContent":["import { NodePackageManagerForProject } from '@expo/package-manager';\n\nimport { CommandError } from '../utils/errors';\nimport { assertUnexpectedVariadicFlags, parseVariadicArguments } from '../utils/variadic';\n\nexport type Options = Pick<NodePackageManagerForProject, 'npm' | 'pnpm' | 'yarn' | 'bun'> & {\n /** Check which packages need to be updated, does not install any provided packages. */\n check?: boolean;\n /** Should the dependencies be fixed automatically. */\n fix?: boolean;\n /** Should disable install output, used for commands like `prebuild` that run install internally. */\n silent?: boolean;\n /** Should be installed as dev dependencies */\n dev?: boolean;\n};\n\nfunction resolveOptions(options: Options): Options {\n if (options.fix && options.check) {\n throw new CommandError('BAD_ARGS', 'Specify at most one of: --check, --fix');\n }\n if ([options.npm, options.pnpm, options.yarn, options.bun].filter(Boolean).length > 1) {\n throw new CommandError('BAD_ARGS', 'Specify at most one of: --npm, --pnpm, --yarn, --bun');\n }\n return {\n ...options,\n };\n}\n\nexport async function resolveArgsAsync(\n argv: string[]\n): Promise<{ variadic: string[]; options: Options; extras: string[] }> {\n const { variadic, extras, flags } = parseVariadicArguments(argv);\n\n assertUnexpectedVariadicFlags(\n ['--check', '--fix', '--npm', '--pnpm', '--yarn', '--bun'],\n { variadic, extras, flags },\n 'npx expo install'\n );\n\n return {\n // Variadic arguments like `npx expo install react react-dom` -> ['react', 'react-dom']\n variadic,\n options: resolveOptions({\n fix: !!flags['--fix'],\n check: !!flags['--check'],\n yarn: !!flags['--yarn'],\n npm: !!flags['--npm'],\n pnpm: !!flags['--pnpm'],\n bun: !!flags['--bun'],\n }),\n extras,\n };\n}\n"],"names":["resolveArgsAsync","resolveOptions","options","fix","check","CommandError","npm","pnpm","yarn","bun","filter","Boolean","length","argv","variadic","extras","flags","parseVariadicArguments","assertUnexpectedVariadicFlags"],"mappings":"AAAA;;;;+BA4BsBA,kBAAgB;;aAAhBA,gBAAgB;;wBA1BT,iBAAiB;0BACwB,mBAAmB;AAazF,SAASC,cAAc,CAACC,OAAgB,EAAW;IACjD,IAAIA,OAAO,CAACC,GAAG,IAAID,OAAO,CAACE,KAAK,EAAE;QAChC,MAAM,IAAIC,OAAY,aAAA,CAAC,UAAU,EAAE,wCAAwC,CAAC,CAAC;IAC/E,CAAC;IACD,IAAI;QAACH,OAAO,CAACI,GAAG;QAAEJ,OAAO,CAACK,IAAI;QAAEL,OAAO,CAACM,IAAI;QAAEN,OAAO,CAACO,GAAG;KAAC,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,MAAM,GAAG,CAAC,EAAE;QACrF,MAAM,IAAIP,OAAY,aAAA,CAAC,UAAU,EAAE,sDAAsD,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO;QACL,GAAGH,OAAO;KACX,CAAC;AACJ,CAAC;AAEM,eAAeF,gBAAgB,CACpCa,IAAc,EACuD;IACrE,MAAM,EAAEC,QAAQ,CAAA,EAAEC,MAAM,CAAA,EAAEC,KAAK,CAAA,EAAE,GAAGC,IAAAA,SAAsB,uBAAA,EAACJ,IAAI,CAAC,AAAC;IAEjEK,IAAAA,SAA6B,8BAAA,EAC3B;QAAC,SAAS;QAAE,OAAO;QAAE,OAAO;QAAE,QAAQ;QAAE,QAAQ;QAAE,OAAO;KAAC,
|
|
1
|
+
{"version":3,"sources":["../../../src/install/resolveOptions.ts"],"sourcesContent":["import { NodePackageManagerForProject } from '@expo/package-manager';\n\nimport { CommandError } from '../utils/errors';\nimport { assertUnexpectedVariadicFlags, parseVariadicArguments } from '../utils/variadic';\n\nexport type Options = Pick<NodePackageManagerForProject, 'npm' | 'pnpm' | 'yarn' | 'bun'> & {\n /** Check which packages need to be updated, does not install any provided packages. */\n check?: boolean;\n /** Should the dependencies be fixed automatically. */\n fix?: boolean;\n /** Should disable install output, used for commands like `prebuild` that run install internally. */\n silent?: boolean;\n /** Should be installed as dev dependencies */\n dev?: boolean;\n};\n\nfunction resolveOptions(options: Options): Options {\n if (options.fix && options.check) {\n throw new CommandError('BAD_ARGS', 'Specify at most one of: --check, --fix');\n }\n if ([options.npm, options.pnpm, options.yarn, options.bun].filter(Boolean).length > 1) {\n throw new CommandError('BAD_ARGS', 'Specify at most one of: --npm, --pnpm, --yarn, --bun');\n }\n return {\n ...options,\n };\n}\n\nexport async function resolveArgsAsync(\n argv: string[]\n): Promise<{ variadic: string[]; options: Options; extras: string[] }> {\n const { variadic, extras, flags } = parseVariadicArguments(argv);\n\n assertUnexpectedVariadicFlags(\n ['--check', '--dev', '--fix', '--npm', '--pnpm', '--yarn', '--bun'],\n { variadic, extras, flags },\n 'npx expo install'\n );\n\n return {\n // Variadic arguments like `npx expo install react react-dom` -> ['react', 'react-dom']\n variadic,\n options: resolveOptions({\n fix: !!flags['--fix'],\n dev: !!flags['--dev'],\n check: !!flags['--check'],\n yarn: !!flags['--yarn'],\n npm: !!flags['--npm'],\n pnpm: !!flags['--pnpm'],\n bun: !!flags['--bun'],\n }),\n extras,\n };\n}\n"],"names":["resolveArgsAsync","resolveOptions","options","fix","check","CommandError","npm","pnpm","yarn","bun","filter","Boolean","length","argv","variadic","extras","flags","parseVariadicArguments","assertUnexpectedVariadicFlags","dev"],"mappings":"AAAA;;;;+BA4BsBA,kBAAgB;;aAAhBA,gBAAgB;;wBA1BT,iBAAiB;0BACwB,mBAAmB;AAazF,SAASC,cAAc,CAACC,OAAgB,EAAW;IACjD,IAAIA,OAAO,CAACC,GAAG,IAAID,OAAO,CAACE,KAAK,EAAE;QAChC,MAAM,IAAIC,OAAY,aAAA,CAAC,UAAU,EAAE,wCAAwC,CAAC,CAAC;IAC/E,CAAC;IACD,IAAI;QAACH,OAAO,CAACI,GAAG;QAAEJ,OAAO,CAACK,IAAI;QAAEL,OAAO,CAACM,IAAI;QAAEN,OAAO,CAACO,GAAG;KAAC,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,MAAM,GAAG,CAAC,EAAE;QACrF,MAAM,IAAIP,OAAY,aAAA,CAAC,UAAU,EAAE,sDAAsD,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO;QACL,GAAGH,OAAO;KACX,CAAC;AACJ,CAAC;AAEM,eAAeF,gBAAgB,CACpCa,IAAc,EACuD;IACrE,MAAM,EAAEC,QAAQ,CAAA,EAAEC,MAAM,CAAA,EAAEC,KAAK,CAAA,EAAE,GAAGC,IAAAA,SAAsB,uBAAA,EAACJ,IAAI,CAAC,AAAC;IAEjEK,IAAAA,SAA6B,8BAAA,EAC3B;QAAC,SAAS;QAAE,OAAO;QAAE,OAAO;QAAE,OAAO;QAAE,QAAQ;QAAE,QAAQ;QAAE,OAAO;KAAC,EACnE;QAAEJ,QAAQ;QAAEC,MAAM;QAAEC,KAAK;KAAE,EAC3B,kBAAkB,CACnB,CAAC;IAEF,OAAO;QACL,uFAAuF;QACvFF,QAAQ;QACRZ,OAAO,EAAED,cAAc,CAAC;YACtBE,GAAG,EAAE,CAAC,CAACa,KAAK,CAAC,OAAO,CAAC;YACrBG,GAAG,EAAE,CAAC,CAACH,KAAK,CAAC,OAAO,CAAC;YACrBZ,KAAK,EAAE,CAAC,CAACY,KAAK,CAAC,SAAS,CAAC;YACzBR,IAAI,EAAE,CAAC,CAACQ,KAAK,CAAC,QAAQ,CAAC;YACvBV,GAAG,EAAE,CAAC,CAACU,KAAK,CAAC,OAAO,CAAC;YACrBT,IAAI,EAAE,CAAC,CAACS,KAAK,CAAC,QAAQ,CAAC;YACvBP,GAAG,EAAE,CAAC,CAACO,KAAK,CAAC,OAAO,CAAC;SACtB,CAAC;QACFD,MAAM;KACP,CAAC;AACJ,CAAC"}
|
package/build/src/utils/env.js
CHANGED
|
@@ -175,6 +175,9 @@ class Env {
|
|
|
175
175
|
/** Enable unstable/experimental support for deploying the native server in `npx expo run` commands. */ get EXPO_UNSTABLE_DEPLOY_SERVER() {
|
|
176
176
|
return (0, _getenv().boolish)("EXPO_UNSTABLE_DEPLOY_SERVER", false);
|
|
177
177
|
}
|
|
178
|
+
/** Disable the React Native Directory compatibility check for new architecture when installing packages */ get EXPO_NO_NEW_ARCH_COMPAT_CHECK() {
|
|
179
|
+
return (0, _getenv().boolish)("EXPO_NO_NEW_ARCH_COMPAT_CHECK", false);
|
|
180
|
+
}
|
|
178
181
|
}
|
|
179
182
|
const env = new Env();
|
|
180
183
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/env.ts"],"sourcesContent":["import { boolish, int, string } from 'getenv';\n\n// @expo/webpack-config -> expo-pwa -> @expo/image-utils: EXPO_IMAGE_UTILS_NO_SHARP\n\n// TODO: EXPO_CLI_USERNAME, EXPO_CLI_PASSWORD\n\nclass Env {\n /** Enable profiling metrics */\n get EXPO_PROFILE() {\n return boolish('EXPO_PROFILE', false);\n }\n\n /** Enable debug logging */\n get EXPO_DEBUG() {\n return boolish('EXPO_DEBUG', false);\n }\n\n /** Disable all network requests */\n get EXPO_OFFLINE() {\n return boolish('EXPO_OFFLINE', false);\n }\n\n /** Enable the beta version of Expo (TODO: Should this just be in the beta version of expo releases?) */\n get EXPO_BETA() {\n return boolish('EXPO_BETA', false);\n }\n\n /** Enable staging API environment */\n get EXPO_STAGING() {\n return boolish('EXPO_STAGING', false);\n }\n\n /** Enable local API environment */\n get EXPO_LOCAL() {\n return boolish('EXPO_LOCAL', false);\n }\n\n /** Is running in non-interactive CI mode */\n get CI() {\n return boolish('CI', false);\n }\n\n /** Disable telemetry (analytics) */\n get EXPO_NO_TELEMETRY() {\n return boolish('EXPO_NO_TELEMETRY', false);\n }\n\n /** Disable detaching telemetry to separate process */\n get EXPO_NO_TELEMETRY_DETACH() {\n return boolish('EXPO_NO_TELEMETRY_DETACH', false);\n }\n\n /** local directory to the universe repo for testing locally */\n get EXPO_UNIVERSE_DIR() {\n return string('EXPO_UNIVERSE_DIR', '');\n }\n\n /** @deprecated Default Webpack host string */\n get WEB_HOST() {\n return string('WEB_HOST', '0.0.0.0');\n }\n\n /** Skip warning users about a dirty git status */\n get EXPO_NO_GIT_STATUS() {\n return boolish('EXPO_NO_GIT_STATUS', false);\n }\n /** Disable auto web setup */\n get EXPO_NO_WEB_SETUP() {\n return boolish('EXPO_NO_WEB_SETUP', false);\n }\n /** Disable auto TypeScript setup */\n get EXPO_NO_TYPESCRIPT_SETUP() {\n return boolish('EXPO_NO_TYPESCRIPT_SETUP', false);\n }\n /** Disable all API caches. Does not disable bundler caches. */\n get EXPO_NO_CACHE() {\n return boolish('EXPO_NO_CACHE', false);\n }\n /** Disable the app select redirect page. */\n get EXPO_NO_REDIRECT_PAGE() {\n return boolish('EXPO_NO_REDIRECT_PAGE', false);\n }\n /** The React Metro port that's baked into react-native scripts and tools. */\n get RCT_METRO_PORT() {\n return int('RCT_METRO_PORT', 0);\n }\n /** Skip validating the manifest during `export`. */\n get EXPO_SKIP_MANIFEST_VALIDATION_TOKEN(): boolean {\n return !!string('EXPO_SKIP_MANIFEST_VALIDATION_TOKEN', '');\n }\n\n /** Public folder path relative to the project root. Default to `public` */\n get EXPO_PUBLIC_FOLDER(): string {\n return string('EXPO_PUBLIC_FOLDER', 'public');\n }\n\n /** Higher priority `$EDIOTR` variable for indicating which editor to use when pressing `o` in the Terminal UI. */\n get EXPO_EDITOR(): string {\n return string('EXPO_EDITOR', '');\n }\n\n /**\n * Overwrite the dev server URL, disregarding the `--port`, `--host`, `--tunnel`, `--lan`, `--localhost` arguments.\n * This is useful for browser editors that require custom proxy URLs.\n */\n get EXPO_PACKAGER_PROXY_URL(): string {\n return string('EXPO_PACKAGER_PROXY_URL', '');\n }\n\n /**\n * **Experimental** - Disable using `exp.direct` as the hostname for\n * `--tunnel` connections. This enables **https://** forwarding which\n * can be used to test universal links on iOS.\n *\n * This may cause issues with `expo-linking` and Expo Go.\n *\n * Select the exact subdomain by passing a string value that is not one of: `true`, `false`, `1`, `0`.\n */\n get EXPO_TUNNEL_SUBDOMAIN(): string | boolean {\n const subdomain = string('EXPO_TUNNEL_SUBDOMAIN', '');\n if (['0', 'false', ''].includes(subdomain)) {\n return false;\n } else if (['1', 'true'].includes(subdomain)) {\n return true;\n }\n return subdomain;\n }\n\n /**\n * Force Expo CLI to use the [`resolver.resolverMainFields`](https://facebook.github.io/metro/docs/configuration/#resolvermainfields) from the project `metro.config.js` for all platforms.\n *\n * By default, Expo CLI will use `['browser', 'module', 'main']` (default for Webpack) for web and the user-defined main fields for other platforms.\n */\n get EXPO_METRO_NO_MAIN_FIELD_OVERRIDE(): boolean {\n return boolish('EXPO_METRO_NO_MAIN_FIELD_OVERRIDE', false);\n }\n\n /**\n * HTTP/HTTPS proxy to connect to for network requests. Configures [https-proxy-agent](https://www.npmjs.com/package/https-proxy-agent).\n */\n get HTTP_PROXY(): string {\n return process.env.HTTP_PROXY || process.env.http_proxy || '';\n }\n\n /**\n * Use the network inspector by overriding the metro inspector proxy with a custom version.\n * @deprecated This has been replaced by `@react-native/dev-middleware` and is now unused.\n */\n get EXPO_NO_INSPECTOR_PROXY(): boolean {\n return boolish('EXPO_NO_INSPECTOR_PROXY', false);\n }\n\n /** Disable lazy bundling in Metro bundler. */\n get EXPO_NO_METRO_LAZY() {\n return boolish('EXPO_NO_METRO_LAZY', false);\n }\n\n /** Enable the unstable inverse dependency stack trace for Metro bundling errors. */\n get EXPO_METRO_UNSTABLE_ERRORS() {\n return boolish('EXPO_METRO_UNSTABLE_ERRORS', false);\n }\n\n /** Enable the unstable fast resolver for Metro. */\n get EXPO_USE_FAST_RESOLVER() {\n return boolish('EXPO_USE_FAST_RESOLVER', false);\n }\n\n /** Disable Environment Variable injection in client bundles. */\n get EXPO_NO_CLIENT_ENV_VARS(): boolean {\n return boolish('EXPO_NO_CLIENT_ENV_VARS', false);\n }\n\n /** Set the default `user` that should be passed to `--user` with ADB commands. Used for installing APKs on Android devices with multiple profiles. Defaults to `0`. */\n get EXPO_ADB_USER(): string {\n return string('EXPO_ADB_USER', '0');\n }\n\n /** Used internally to enable E2E utilities. This behavior is not stable to external users. */\n get __EXPO_E2E_TEST(): boolean {\n return boolish('__EXPO_E2E_TEST', false);\n }\n\n /** Unstable: Force single-bundle exports in production. */\n get EXPO_NO_BUNDLE_SPLITTING(): boolean {\n return boolish('EXPO_NO_BUNDLE_SPLITTING', false);\n }\n\n /** Enable unstable/experimental Atlas to gather bundle information during development or export */\n get EXPO_UNSTABLE_ATLAS() {\n return boolish('EXPO_UNSTABLE_ATLAS', false);\n }\n\n /** Unstable: Enable tree shaking for Metro. */\n get EXPO_UNSTABLE_TREE_SHAKING() {\n return boolish('EXPO_UNSTABLE_TREE_SHAKING', false);\n }\n\n /** Unstable: Enable eager bundling where transformation runs uncached after the entire bundle has been created. This is required for production tree shaking and less optimized for development bundling. */\n get EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH() {\n return boolish('EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH', false);\n }\n\n /** Enable the use of Expo's custom metro require implementation. The custom require supports better debugging, tree shaking, and React Server Components. */\n get EXPO_USE_METRO_REQUIRE() {\n return boolish('EXPO_USE_METRO_REQUIRE', false);\n }\n\n /** Internal key used to pass eager bundle data from the CLI to the native run scripts during `npx expo run` commands. */\n get __EXPO_EAGER_BUNDLE_OPTIONS() {\n return string('__EXPO_EAGER_BUNDLE_OPTIONS', '');\n }\n\n /** Disable server deployment during production builds (during `expo export:embed`). This is useful for testing API routes and server components against a local server. */\n get EXPO_NO_DEPLOY(): boolean {\n return boolish('EXPO_NO_DEPLOY', false);\n }\n\n /** Enable hydration during development when rendering Expo Web */\n get EXPO_WEB_DEV_HYDRATE(): boolean {\n return boolish('EXPO_WEB_DEV_HYDRATE', false);\n }\n\n /** Enable experimental React Server Functions support. */\n get EXPO_UNSTABLE_SERVER_FUNCTIONS(): boolean {\n return boolish('EXPO_UNSTABLE_SERVER_FUNCTIONS', false);\n }\n\n /** Enable unstable/experimental mode where React Native Web isn't required to run Expo apps on web. */\n get EXPO_NO_REACT_NATIVE_WEB(): boolean {\n return boolish('EXPO_NO_REACT_NATIVE_WEB', false);\n }\n\n /** Enable unstable/experimental support for deploying the native server in `npx expo run` commands. */\n get EXPO_UNSTABLE_DEPLOY_SERVER(): boolean {\n return boolish('EXPO_UNSTABLE_DEPLOY_SERVER', false);\n }\n}\n\nexport const env = new Env();\n"],"names":["env","Env","EXPO_PROFILE","boolish","EXPO_DEBUG","EXPO_OFFLINE","EXPO_BETA","EXPO_STAGING","EXPO_LOCAL","CI","EXPO_NO_TELEMETRY","EXPO_NO_TELEMETRY_DETACH","EXPO_UNIVERSE_DIR","string","WEB_HOST","EXPO_NO_GIT_STATUS","EXPO_NO_WEB_SETUP","EXPO_NO_TYPESCRIPT_SETUP","EXPO_NO_CACHE","EXPO_NO_REDIRECT_PAGE","RCT_METRO_PORT","int","EXPO_SKIP_MANIFEST_VALIDATION_TOKEN","EXPO_PUBLIC_FOLDER","EXPO_EDITOR","EXPO_PACKAGER_PROXY_URL","EXPO_TUNNEL_SUBDOMAIN","subdomain","includes","EXPO_METRO_NO_MAIN_FIELD_OVERRIDE","HTTP_PROXY","process","http_proxy","EXPO_NO_INSPECTOR_PROXY","EXPO_NO_METRO_LAZY","EXPO_METRO_UNSTABLE_ERRORS","EXPO_USE_FAST_RESOLVER","EXPO_NO_CLIENT_ENV_VARS","EXPO_ADB_USER","__EXPO_E2E_TEST","EXPO_NO_BUNDLE_SPLITTING","EXPO_UNSTABLE_ATLAS","EXPO_UNSTABLE_TREE_SHAKING","EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH","EXPO_USE_METRO_REQUIRE","__EXPO_EAGER_BUNDLE_OPTIONS","EXPO_NO_DEPLOY","EXPO_WEB_DEV_HYDRATE","EXPO_UNSTABLE_SERVER_FUNCTIONS","EXPO_NO_REACT_NATIVE_WEB","EXPO_UNSTABLE_DEPLOY_SERVER"],"mappings":"AAAA;;;;+BA8OaA,KAAG;;aAAHA,GAAG;;;yBA9OqB,QAAQ;;;;;;AAE7C,mFAAmF;AAEnF,6CAA6C;AAE7C,MAAMC,GAAG;IACP,6BAA6B,OACzBC,YAAY,GAAG;QACjB,OAAOC,IAAAA,OAAO,EAAA,QAAA,EAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACxC;IAEA,yBAAyB,OACrBC,UAAU,GAAG;QACf,OAAOD,IAAAA,OAAO,EAAA,QAAA,EAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IACtC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,IAAAA,OAAO,EAAA,QAAA,EAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;IACpD;IAEA,qGAAqG,OACjG+C,2BAA2B,GAAY;QACzC,OAAO/C,IAAAA,OAAO,EAAA,QAAA,EAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;IACvD;CACD;AAEM,MAAMH,GAAG,GAAG,IAAIC,GAAG,EAAE,AAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/env.ts"],"sourcesContent":["import { boolish, int, string } from 'getenv';\n\n// @expo/webpack-config -> expo-pwa -> @expo/image-utils: EXPO_IMAGE_UTILS_NO_SHARP\n\n// TODO: EXPO_CLI_USERNAME, EXPO_CLI_PASSWORD\n\nclass Env {\n /** Enable profiling metrics */\n get EXPO_PROFILE() {\n return boolish('EXPO_PROFILE', false);\n }\n\n /** Enable debug logging */\n get EXPO_DEBUG() {\n return boolish('EXPO_DEBUG', false);\n }\n\n /** Disable all network requests */\n get EXPO_OFFLINE() {\n return boolish('EXPO_OFFLINE', false);\n }\n\n /** Enable the beta version of Expo (TODO: Should this just be in the beta version of expo releases?) */\n get EXPO_BETA() {\n return boolish('EXPO_BETA', false);\n }\n\n /** Enable staging API environment */\n get EXPO_STAGING() {\n return boolish('EXPO_STAGING', false);\n }\n\n /** Enable local API environment */\n get EXPO_LOCAL() {\n return boolish('EXPO_LOCAL', false);\n }\n\n /** Is running in non-interactive CI mode */\n get CI() {\n return boolish('CI', false);\n }\n\n /** Disable telemetry (analytics) */\n get EXPO_NO_TELEMETRY() {\n return boolish('EXPO_NO_TELEMETRY', false);\n }\n\n /** Disable detaching telemetry to separate process */\n get EXPO_NO_TELEMETRY_DETACH() {\n return boolish('EXPO_NO_TELEMETRY_DETACH', false);\n }\n\n /** local directory to the universe repo for testing locally */\n get EXPO_UNIVERSE_DIR() {\n return string('EXPO_UNIVERSE_DIR', '');\n }\n\n /** @deprecated Default Webpack host string */\n get WEB_HOST() {\n return string('WEB_HOST', '0.0.0.0');\n }\n\n /** Skip warning users about a dirty git status */\n get EXPO_NO_GIT_STATUS() {\n return boolish('EXPO_NO_GIT_STATUS', false);\n }\n /** Disable auto web setup */\n get EXPO_NO_WEB_SETUP() {\n return boolish('EXPO_NO_WEB_SETUP', false);\n }\n /** Disable auto TypeScript setup */\n get EXPO_NO_TYPESCRIPT_SETUP() {\n return boolish('EXPO_NO_TYPESCRIPT_SETUP', false);\n }\n /** Disable all API caches. Does not disable bundler caches. */\n get EXPO_NO_CACHE() {\n return boolish('EXPO_NO_CACHE', false);\n }\n /** Disable the app select redirect page. */\n get EXPO_NO_REDIRECT_PAGE() {\n return boolish('EXPO_NO_REDIRECT_PAGE', false);\n }\n /** The React Metro port that's baked into react-native scripts and tools. */\n get RCT_METRO_PORT() {\n return int('RCT_METRO_PORT', 0);\n }\n /** Skip validating the manifest during `export`. */\n get EXPO_SKIP_MANIFEST_VALIDATION_TOKEN(): boolean {\n return !!string('EXPO_SKIP_MANIFEST_VALIDATION_TOKEN', '');\n }\n\n /** Public folder path relative to the project root. Default to `public` */\n get EXPO_PUBLIC_FOLDER(): string {\n return string('EXPO_PUBLIC_FOLDER', 'public');\n }\n\n /** Higher priority `$EDIOTR` variable for indicating which editor to use when pressing `o` in the Terminal UI. */\n get EXPO_EDITOR(): string {\n return string('EXPO_EDITOR', '');\n }\n\n /**\n * Overwrite the dev server URL, disregarding the `--port`, `--host`, `--tunnel`, `--lan`, `--localhost` arguments.\n * This is useful for browser editors that require custom proxy URLs.\n */\n get EXPO_PACKAGER_PROXY_URL(): string {\n return string('EXPO_PACKAGER_PROXY_URL', '');\n }\n\n /**\n * **Experimental** - Disable using `exp.direct` as the hostname for\n * `--tunnel` connections. This enables **https://** forwarding which\n * can be used to test universal links on iOS.\n *\n * This may cause issues with `expo-linking` and Expo Go.\n *\n * Select the exact subdomain by passing a string value that is not one of: `true`, `false`, `1`, `0`.\n */\n get EXPO_TUNNEL_SUBDOMAIN(): string | boolean {\n const subdomain = string('EXPO_TUNNEL_SUBDOMAIN', '');\n if (['0', 'false', ''].includes(subdomain)) {\n return false;\n } else if (['1', 'true'].includes(subdomain)) {\n return true;\n }\n return subdomain;\n }\n\n /**\n * Force Expo CLI to use the [`resolver.resolverMainFields`](https://facebook.github.io/metro/docs/configuration/#resolvermainfields) from the project `metro.config.js` for all platforms.\n *\n * By default, Expo CLI will use `['browser', 'module', 'main']` (default for Webpack) for web and the user-defined main fields for other platforms.\n */\n get EXPO_METRO_NO_MAIN_FIELD_OVERRIDE(): boolean {\n return boolish('EXPO_METRO_NO_MAIN_FIELD_OVERRIDE', false);\n }\n\n /**\n * HTTP/HTTPS proxy to connect to for network requests. Configures [https-proxy-agent](https://www.npmjs.com/package/https-proxy-agent).\n */\n get HTTP_PROXY(): string {\n return process.env.HTTP_PROXY || process.env.http_proxy || '';\n }\n\n /**\n * Use the network inspector by overriding the metro inspector proxy with a custom version.\n * @deprecated This has been replaced by `@react-native/dev-middleware` and is now unused.\n */\n get EXPO_NO_INSPECTOR_PROXY(): boolean {\n return boolish('EXPO_NO_INSPECTOR_PROXY', false);\n }\n\n /** Disable lazy bundling in Metro bundler. */\n get EXPO_NO_METRO_LAZY() {\n return boolish('EXPO_NO_METRO_LAZY', false);\n }\n\n /** Enable the unstable inverse dependency stack trace for Metro bundling errors. */\n get EXPO_METRO_UNSTABLE_ERRORS() {\n return boolish('EXPO_METRO_UNSTABLE_ERRORS', false);\n }\n\n /** Enable the unstable fast resolver for Metro. */\n get EXPO_USE_FAST_RESOLVER() {\n return boolish('EXPO_USE_FAST_RESOLVER', false);\n }\n\n /** Disable Environment Variable injection in client bundles. */\n get EXPO_NO_CLIENT_ENV_VARS(): boolean {\n return boolish('EXPO_NO_CLIENT_ENV_VARS', false);\n }\n\n /** Set the default `user` that should be passed to `--user` with ADB commands. Used for installing APKs on Android devices with multiple profiles. Defaults to `0`. */\n get EXPO_ADB_USER(): string {\n return string('EXPO_ADB_USER', '0');\n }\n\n /** Used internally to enable E2E utilities. This behavior is not stable to external users. */\n get __EXPO_E2E_TEST(): boolean {\n return boolish('__EXPO_E2E_TEST', false);\n }\n\n /** Unstable: Force single-bundle exports in production. */\n get EXPO_NO_BUNDLE_SPLITTING(): boolean {\n return boolish('EXPO_NO_BUNDLE_SPLITTING', false);\n }\n\n /** Enable unstable/experimental Atlas to gather bundle information during development or export */\n get EXPO_UNSTABLE_ATLAS() {\n return boolish('EXPO_UNSTABLE_ATLAS', false);\n }\n\n /** Unstable: Enable tree shaking for Metro. */\n get EXPO_UNSTABLE_TREE_SHAKING() {\n return boolish('EXPO_UNSTABLE_TREE_SHAKING', false);\n }\n\n /** Unstable: Enable eager bundling where transformation runs uncached after the entire bundle has been created. This is required for production tree shaking and less optimized for development bundling. */\n get EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH() {\n return boolish('EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH', false);\n }\n\n /** Enable the use of Expo's custom metro require implementation. The custom require supports better debugging, tree shaking, and React Server Components. */\n get EXPO_USE_METRO_REQUIRE() {\n return boolish('EXPO_USE_METRO_REQUIRE', false);\n }\n\n /** Internal key used to pass eager bundle data from the CLI to the native run scripts during `npx expo run` commands. */\n get __EXPO_EAGER_BUNDLE_OPTIONS() {\n return string('__EXPO_EAGER_BUNDLE_OPTIONS', '');\n }\n\n /** Disable server deployment during production builds (during `expo export:embed`). This is useful for testing API routes and server components against a local server. */\n get EXPO_NO_DEPLOY(): boolean {\n return boolish('EXPO_NO_DEPLOY', false);\n }\n\n /** Enable hydration during development when rendering Expo Web */\n get EXPO_WEB_DEV_HYDRATE(): boolean {\n return boolish('EXPO_WEB_DEV_HYDRATE', false);\n }\n\n /** Enable experimental React Server Functions support. */\n get EXPO_UNSTABLE_SERVER_FUNCTIONS(): boolean {\n return boolish('EXPO_UNSTABLE_SERVER_FUNCTIONS', false);\n }\n\n /** Enable unstable/experimental mode where React Native Web isn't required to run Expo apps on web. */\n get EXPO_NO_REACT_NATIVE_WEB(): boolean {\n return boolish('EXPO_NO_REACT_NATIVE_WEB', false);\n }\n\n /** Enable unstable/experimental support for deploying the native server in `npx expo run` commands. */\n get EXPO_UNSTABLE_DEPLOY_SERVER(): boolean {\n return boolish('EXPO_UNSTABLE_DEPLOY_SERVER', false);\n }\n\n /** Disable the React Native Directory compatibility check for new architecture when installing packages */\n get EXPO_NO_NEW_ARCH_COMPAT_CHECK(): boolean {\n return boolish('EXPO_NO_NEW_ARCH_COMPAT_CHECK', false);\n }\n}\n\nexport const env = new Env();\n"],"names":["env","Env","EXPO_PROFILE","boolish","EXPO_DEBUG","EXPO_OFFLINE","EXPO_BETA","EXPO_STAGING","EXPO_LOCAL","CI","EXPO_NO_TELEMETRY","EXPO_NO_TELEMETRY_DETACH","EXPO_UNIVERSE_DIR","string","WEB_HOST","EXPO_NO_GIT_STATUS","EXPO_NO_WEB_SETUP","EXPO_NO_TYPESCRIPT_SETUP","EXPO_NO_CACHE","EXPO_NO_REDIRECT_PAGE","RCT_METRO_PORT","int","EXPO_SKIP_MANIFEST_VALIDATION_TOKEN","EXPO_PUBLIC_FOLDER","EXPO_EDITOR","EXPO_PACKAGER_PROXY_URL","EXPO_TUNNEL_SUBDOMAIN","subdomain","includes","EXPO_METRO_NO_MAIN_FIELD_OVERRIDE","HTTP_PROXY","process","http_proxy","EXPO_NO_INSPECTOR_PROXY","EXPO_NO_METRO_LAZY","EXPO_METRO_UNSTABLE_ERRORS","EXPO_USE_FAST_RESOLVER","EXPO_NO_CLIENT_ENV_VARS","EXPO_ADB_USER","__EXPO_E2E_TEST","EXPO_NO_BUNDLE_SPLITTING","EXPO_UNSTABLE_ATLAS","EXPO_UNSTABLE_TREE_SHAKING","EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH","EXPO_USE_METRO_REQUIRE","__EXPO_EAGER_BUNDLE_OPTIONS","EXPO_NO_DEPLOY","EXPO_WEB_DEV_HYDRATE","EXPO_UNSTABLE_SERVER_FUNCTIONS","EXPO_NO_REACT_NATIVE_WEB","EXPO_UNSTABLE_DEPLO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c,GAAY;QAC5B,OAAO3C,IAAAA,OAAO,EAAA,QAAA,EAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;IAC1C;IAEA,gEAAgE,OAC5D4C,oBAAoB,GAAY;QAClC,OAAO5C,IAAAA,OAAO,EAAA,QAAA,EAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;IAChD;IAEA,wDAAwD,OACpD6C,8BAA8B,GAAY;QAC5C,OAAO7C,IAAAA,OAAO,EAAA,QAAA,EAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;IAC1D;IAEA,qGAAqG,OACjG8C,wBAAwB,GAAY;QACtC,OAAO9C,IAAAA,OAAO,EAAA,QAAA,EAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;IACpD;IAEA,qGAAqG,OACjG+C,2BAA2B,GAAY;QACzC,OAAO/C,IAAAA,OAAO,EAAA,QAAA,EAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;IACvD;IAEA,yGAAyG,OACrGgD,6BAA6B,GAAY;QAC3C,OAAOhD,IAAAA,OAAO,EAAA,QAAA,EAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;IACzD;CACD;AAEM,MAAMH,GAAG,GAAG,IAAIC,GAAG,EAAE,AAAC"}
|
package/build/src/utils/ip.js
CHANGED
|
@@ -96,7 +96,14 @@ function _interopRequireDefault(obj) {
|
|
|
96
96
|
if (!routeAddress) {
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
99
|
-
|
|
99
|
+
let ifaces;
|
|
100
|
+
try {
|
|
101
|
+
ifaces = (0, _nodeOs().networkInterfaces)();
|
|
102
|
+
} catch {
|
|
103
|
+
// NOTE: This usually doesn't throw, but invalid builds or unknown targets in Node.js
|
|
104
|
+
// can cause this call to unexpectedly raise a system error
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
100
107
|
for(const iface in ifaces){
|
|
101
108
|
const assignments = ifaces[iface];
|
|
102
109
|
for(let i = 0; assignments && i < assignments.length; i++){
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/ip.ts"],"sourcesContent":["import internalIp from 'internal-ip';\nimport { spawnSync } from 'node:child_process';\nimport { isIPv4 } from 'node:net';\nimport { networkInterfaces } from 'node:os';\n\n/** Gets a route address by opening a UDP socket to a publicly routed address.\n * @privateRemarks\n * This is wrapped in `spawnSync` since the original `getIpAddress` utility exported\n * in this module is used synchronosly. An appropriate timeout has been set and UDP\n * ports don't send a message when opened.\n * @throws if `spawnSync` fails\n */\nfunction getRouteAddress(): string | null {\n const { error, status, stdout } = spawnSync(process.execPath, ['-'], {\n // This should be the cheapest method to determine the default route\n // By opening a socket to a publicly routed IP address, we let the default\n // gateway handle this socket, which means the socket's address will be\n // the prioritised route for public IP addresses.\n // It might fall back to `\"0.0.0.0\"` when no network connection is established\n input: `\n var socket = require('dgram').createSocket({ type: 'udp4', reuseAddr: true });\n socket.unref();\n socket.connect(53, '1.1.1.1', function() {\n var address = socket.address();\n socket.close();\n if (address && 'address' in address) {\n process.stdout.write(address.address);\n process.exit(0);\n } else {\n process.exit(1);\n }\n });\n `,\n shell: false,\n timeout: 500,\n encoding: 'utf8',\n windowsVerbatimArguments: false,\n windowsHide: true,\n });\n // We only use the stdout as an IP, if it validates as an IP and we got a zero exit code\n if (status || error) {\n return null;\n } else if (!status && typeof stdout === 'string' && isIPv4(stdout.trim())) {\n return stdout.trim();\n } else {\n return null;\n }\n}\n\n/** By convention, a zero mac address means we have a virtual device, which we'd like to exclude */\nconst VIRTUAL_MAC_ADDRESS = '00:00:00:00:00:00';\n\n/** Determines the internal IP address by opening a socket, then checking the socket address against non-internal network interface assignments\n * @throws If no address can be determined.\n */\nfunction getRouteIPAddress(): string | null {\n // We check the IP address we get against the available network interfaces\n // It's only an internal IP address if we have a matching address on an interface's IP assignment\n let routeAddress: string | null = null;\n try {\n routeAddress = getRouteAddress();\n } catch {}\n if (!routeAddress) {\n return null;\n }\n
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/ip.ts"],"sourcesContent":["import internalIp from 'internal-ip';\nimport { spawnSync } from 'node:child_process';\nimport { isIPv4 } from 'node:net';\nimport { networkInterfaces } from 'node:os';\n\n/** Gets a route address by opening a UDP socket to a publicly routed address.\n * @privateRemarks\n * This is wrapped in `spawnSync` since the original `getIpAddress` utility exported\n * in this module is used synchronosly. An appropriate timeout has been set and UDP\n * ports don't send a message when opened.\n * @throws if `spawnSync` fails\n */\nfunction getRouteAddress(): string | null {\n const { error, status, stdout } = spawnSync(process.execPath, ['-'], {\n // This should be the cheapest method to determine the default route\n // By opening a socket to a publicly routed IP address, we let the default\n // gateway handle this socket, which means the socket's address will be\n // the prioritised route for public IP addresses.\n // It might fall back to `\"0.0.0.0\"` when no network connection is established\n input: `\n var socket = require('dgram').createSocket({ type: 'udp4', reuseAddr: true });\n socket.unref();\n socket.connect(53, '1.1.1.1', function() {\n var address = socket.address();\n socket.close();\n if (address && 'address' in address) {\n process.stdout.write(address.address);\n process.exit(0);\n } else {\n process.exit(1);\n }\n });\n `,\n shell: false,\n timeout: 500,\n encoding: 'utf8',\n windowsVerbatimArguments: false,\n windowsHide: true,\n });\n // We only use the stdout as an IP, if it validates as an IP and we got a zero exit code\n if (status || error) {\n return null;\n } else if (!status && typeof stdout === 'string' && isIPv4(stdout.trim())) {\n return stdout.trim();\n } else {\n return null;\n }\n}\n\n/** By convention, a zero mac address means we have a virtual device, which we'd like to exclude */\nconst VIRTUAL_MAC_ADDRESS = '00:00:00:00:00:00';\n\n/** Determines the internal IP address by opening a socket, then checking the socket address against non-internal network interface assignments\n * @throws If no address can be determined.\n */\nfunction getRouteIPAddress(): string | null {\n // We check the IP address we get against the available network interfaces\n // It's only an internal IP address if we have a matching address on an interface's IP assignment\n let routeAddress: string | null = null;\n try {\n routeAddress = getRouteAddress();\n } catch {}\n if (!routeAddress) {\n return null;\n }\n let ifaces: ReturnType<typeof networkInterfaces>;\n try {\n ifaces = networkInterfaces();\n } catch {\n // NOTE: This usually doesn't throw, but invalid builds or unknown targets in Node.js\n // can cause this call to unexpectedly raise a system error\n return null;\n }\n for (const iface in ifaces) {\n const assignments = ifaces[iface];\n for (let i = 0; assignments && i < assignments.length; i++) {\n const assignment = assignments[i];\n // Only use IPv4 assigments that aren't internal\n // Only use IPv4 assignment if it's not a virtual device (e.g. a VPN network interface)\n if (\n assignment.family === 'IPv4' &&\n !assignment.internal &&\n assignment.address === routeAddress &&\n assignment.mac !== VIRTUAL_MAC_ADDRESS\n )\n return routeAddress;\n }\n }\n return null;\n}\n\nexport function getIpAddress(): string {\n return internalIp.v4.sync() || getRouteIPAddress() || '127.0.0.1';\n}\n"],"names":["getIpAddress","getRouteAddress","error","status","stdout","spawnSync","process","execPath","input","shell","timeout","encoding","windowsVerbatimArguments","windowsHide","isIPv4","trim","VIRTUAL_MAC_ADDRESS","getRouteIPAddress","routeAddress","ifaces","networkInterfaces","iface","assignments","i","length","assignment","family","internal","address","mac","internalIp","v4","sync"],"mappings":"AAAA;;;;+BA2FgBA,cAAY;;aAAZA,YAAY;;;8DA3FL,aAAa;;;;;;;yBACV,oBAAoB;;;;;;;yBACvB,UAAU;;;;;;;yBACC,SAAS;;;;;;;;;;;AAE3C;;;;;;CAMC,GACD,SAASC,eAAe,GAAkB;IACxC,MAAM,EAAEC,KAAK,CAAA,EAAEC,MAAM,CAAA,EAAEC,MAAM,CAAA,EAAE,GAAGC,IAAAA,iBAAS,EAAA,UAAA,EAACC,OAAO,CAACC,QAAQ,EAAE;QAAC,GAAG;KAAC,EAAE;QACnE,oEAAoE;QACpE,0EAA0E;QAC1E,uEAAuE;QACvE,iDAAiD;QACjD,8EAA8E;QAC9EC,KAAK,EAAE,CAAC;;;;;;;;;;;;;IAaR,CAAC;QACDC,KAAK,EAAE,KAAK;QACZC,OAAO,EAAE,GAAG;QACZC,QAAQ,EAAE,MAAM;QAChBC,wBAAwB,EAAE,KAAK;QAC/BC,WAAW,EAAE,IAAI;KAClB,CAAC,AAAC;IACH,wFAAwF;IACxF,IAAIV,MAAM,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C,OAAOE,YAAY,CAAC;QACxB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAEM,SAASlB,YAAY,GAAW;IACrC,OAAO8B,WAAU,EAAA,QAAA,CAACC,EAAE,CAACC,IAAI,EAAE,IAAIf,iBAAiB,EAAE,IAAI,WAAW,CAAC;AACpE,CAAC"}
|
|
@@ -31,7 +31,7 @@ class FetchClient {
|
|
|
31
31
|
this.headers = {
|
|
32
32
|
accept: "application/json",
|
|
33
33
|
"content-type": "application/json",
|
|
34
|
-
"user-agent": `expo-cli/${"0.22.
|
|
34
|
+
"user-agent": `expo-cli/${"0.22.9"}`,
|
|
35
35
|
authorization: "Basic " + _nodeBuffer().Buffer.from(`${target}:`).toString("base64")
|
|
36
36
|
};
|
|
37
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/cli",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.9",
|
|
4
4
|
"description": "The Expo CLI",
|
|
5
5
|
"main": "build/bin/cli",
|
|
6
6
|
"bin": {
|
|
@@ -42,21 +42,21 @@
|
|
|
42
42
|
"@0no-co/graphql.web": "^1.0.8",
|
|
43
43
|
"@babel/runtime": "^7.20.0",
|
|
44
44
|
"@expo/code-signing-certificates": "^0.0.5",
|
|
45
|
-
"@expo/config": "~10.0.
|
|
46
|
-
"@expo/config-plugins": "~9.0.
|
|
45
|
+
"@expo/config": "~10.0.8",
|
|
46
|
+
"@expo/config-plugins": "~9.0.14",
|
|
47
47
|
"@expo/devcert": "^1.1.2",
|
|
48
|
-
"@expo/env": "~0.4.
|
|
49
|
-
"@expo/image-utils": "^0.6.
|
|
50
|
-
"@expo/json-file": "^9.0.
|
|
51
|
-
"@expo/metro-config": "~0.19.
|
|
52
|
-
"@expo/osascript": "^2.
|
|
53
|
-
"@expo/package-manager": "^1.7.
|
|
54
|
-
"@expo/plist": "^0.2.
|
|
55
|
-
"@expo/prebuild-config": "^8.0.
|
|
48
|
+
"@expo/env": "~0.4.1",
|
|
49
|
+
"@expo/image-utils": "^0.6.4",
|
|
50
|
+
"@expo/json-file": "^9.0.1",
|
|
51
|
+
"@expo/metro-config": "~0.19.9",
|
|
52
|
+
"@expo/osascript": "^2.1.5",
|
|
53
|
+
"@expo/package-manager": "^1.7.1",
|
|
54
|
+
"@expo/plist": "^0.2.1",
|
|
55
|
+
"@expo/prebuild-config": "^8.0.25",
|
|
56
56
|
"@expo/rudder-sdk-node": "^1.1.1",
|
|
57
57
|
"@expo/spawn-async": "^1.7.2",
|
|
58
58
|
"@expo/xcpretty": "^4.3.0",
|
|
59
|
-
"@react-native/dev-middleware": "0.76.
|
|
59
|
+
"@react-native/dev-middleware": "0.76.6",
|
|
60
60
|
"@urql/core": "^5.0.6",
|
|
61
61
|
"@urql/exchange-retry": "^1.3.0",
|
|
62
62
|
"accepts": "^1.3.8",
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
"@types/ws": "^8.5.4",
|
|
155
155
|
"devtools-protocol": "^0.0.1113120",
|
|
156
156
|
"expo-atlas": "^0.4.0",
|
|
157
|
-
"expo-module-scripts": "^4.0.
|
|
157
|
+
"expo-module-scripts": "^4.0.3",
|
|
158
158
|
"find-process": "^1.4.7",
|
|
159
159
|
"jest-runner-tsd": "^6.0.0",
|
|
160
160
|
"klaw-sync": "^6.0.0",
|
|
@@ -167,5 +167,5 @@
|
|
|
167
167
|
"tree-kill": "^1.2.2",
|
|
168
168
|
"tsd": "^0.28.1"
|
|
169
169
|
},
|
|
170
|
-
"gitHead": "
|
|
170
|
+
"gitHead": "986a4689b91f3efc527f7178a320b987c0005842"
|
|
171
171
|
}
|