@expo/cli 56.0.6 → 56.1.0
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/events/index.js +1 -1
- package/build/src/start/resolveOptions.js +2 -2
- package/build/src/start/resolveOptions.js.map +1 -1
- package/build/src/start/server/getStaticRenderFunctions.js +7 -19
- package/build/src/start/server/getStaticRenderFunctions.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +4 -12
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/MetroTerminalReporter.js +58 -8
- package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
- package/build/src/start/server/metro/TerminalReporter.js +18 -0
- package/build/src/start/server/metro/TerminalReporter.js.map +1 -1
- package/build/src/start/server/metro/createFileMap-fork.js +2 -17
- package/build/src/start/server/metro/createFileMap-fork.js.map +1 -1
- package/build/src/start/server/metro/instantiateMetro.js +46 -3
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/start/server/metro/runServer-fork.js +1 -8
- package/build/src/start/server/metro/runServer-fork.js.map +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js +17 -4
- package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
- package/build/src/start/server/middleware/metroOptions.js +3 -2
- package/build/src/start/server/middleware/metroOptions.js.map +1 -1
- package/build/src/start/server/serverLogLikeMetro.js +5 -28
- package/build/src/start/server/serverLogLikeMetro.js.map +1 -1
- package/build/src/utils/composeMetroIgnorePatterns.js +69 -0
- package/build/src/utils/composeMetroIgnorePatterns.js.map +1 -0
- package/build/src/utils/port.js +7 -0
- package/build/src/utils/port.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 +16 -18
package/build/bin/cli
CHANGED
|
@@ -152,7 +152,7 @@ async function resolvePortsAsync(projectRoot, options, settings) {
|
|
|
152
152
|
// Default web port
|
|
153
153
|
fallbackPort: 19006
|
|
154
154
|
});
|
|
155
|
-
if (
|
|
155
|
+
if (webpackPort == null) {
|
|
156
156
|
throw new _errors.AbortCommandError();
|
|
157
157
|
}
|
|
158
158
|
multiBundlerSettings.webpackPort = webpackPort;
|
|
@@ -162,7 +162,7 @@ async function resolvePortsAsync(projectRoot, options, settings) {
|
|
|
162
162
|
defaultPort: options.port,
|
|
163
163
|
fallbackPort
|
|
164
164
|
});
|
|
165
|
-
if (
|
|
165
|
+
if (metroPort == null) {
|
|
166
166
|
throw new _errors.AbortCommandError();
|
|
167
167
|
}
|
|
168
168
|
multiBundlerSettings.metroPort = metroPort;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/start/resolveOptions.ts"],"sourcesContent":["import assert from 'assert';\nimport chalk from 'chalk';\n\nimport { canResolveDevClient, hasDirectDevClientDependency } from './detectDevClient';\nimport { Log } from '../log';\nimport { envIsWebcontainer } from '../utils/env';\nimport { AbortCommandError, CommandError } from '../utils/errors';\nimport { resolvePortAsync } from '../utils/port';\n\nexport type Options = {\n privateKeyPath: string | null;\n android: boolean;\n web: boolean;\n ios: boolean;\n offline: boolean;\n clear: boolean;\n dev: boolean;\n https: boolean;\n maxWorkers: number;\n port: number;\n /** Should instruct the bundler to create minified bundles. */\n minify: boolean;\n devClient: boolean;\n scheme: string | null;\n host: 'localhost' | 'lan' | 'tunnel';\n};\n\nexport async function resolveOptionsAsync(projectRoot: string, args: any): Promise<Options> {\n if (args['--dev-client'] && args['--go']) {\n throw new CommandError('BAD_ARGS', 'Cannot use both --dev-client and --go together.');\n }\n const host = resolveHostType({\n host: args['--host'],\n offline: args['--offline'],\n lan: args['--lan'],\n localhost: args['--localhost'],\n tunnel: args['--tunnel'],\n });\n\n if (args['--https']) {\n Log.warn(chalk`{bold --https} option is deprecated in favor of {bold --tunnel}`);\n }\n\n // User can force the default target by passing either `--dev-client` or `--go`. They can also\n // swap between them during development by pressing `s`.\n const isUserDefinedDevClient =\n !!args['--dev-client'] || (args['--go'] == null ? false : !args['--go']);\n\n // If the user didn't specify `--dev-client` or `--go` we check if they have the dev client package\n // in their package.json.\n const isAutoDevClient =\n args['--dev-client'] == null &&\n args['--go'] == null &&\n hasDirectDevClientDependency(projectRoot);\n\n const isDevClient = isAutoDevClient || isUserDefinedDevClient;\n\n const scheme = await resolveSchemeAsync(projectRoot, {\n scheme: args['--scheme'],\n devClient: isDevClient,\n });\n\n return {\n privateKeyPath: args['--private-key-path'] ?? null,\n\n android: !!args['--android'],\n web: !!args['--web'],\n ios: !!args['--ios'],\n offline: !!args['--offline'],\n\n clear: !!args['--clear'],\n dev: !args['--no-dev'],\n https: !!args['--https'],\n maxWorkers: args['--max-workers'],\n port: args['--port'],\n minify: !!args['--minify'],\n\n devClient: isDevClient,\n\n scheme,\n host,\n };\n}\n\nexport async function resolveSchemeAsync(\n projectRoot: string,\n options: { scheme?: string; devClient?: boolean }\n): Promise<string | null> {\n if (typeof options.scheme === 'string') {\n // Use the custom scheme\n return options.scheme ?? null;\n }\n\n if (options.devClient || canResolveDevClient(projectRoot)) {\n const { getOptionalDevClientSchemeAsync } =\n require('../utils/scheme') as typeof import('../utils/scheme');\n // Attempt to find the scheme or warn the user how to setup a custom scheme\n const resolvedScheme = await getOptionalDevClientSchemeAsync(projectRoot);\n if (!resolvedScheme.scheme) {\n if (resolvedScheme.resolution === 'shared') {\n // This can happen if one of the native projects has no URI schemes defined in it.\n // Normally, this should never happen.\n Log.warn(\n chalk`Could not find a shared URI scheme for the dev client between the local {bold /ios} and {bold /android} directories. App launches (QR code, interstitial, terminal keys) may not work as expected. You can configure a custom scheme using the {bold --scheme} option, or by running {bold npx expo prebuild} to regenerate the native directories with URI schemes.`\n );\n } else if (['ios', 'android'].includes(resolvedScheme.resolution)) {\n Log.warn(\n chalk`The {bold /${resolvedScheme.resolution}} project does not contain any URI schemes. Expo CLI will not be able to use links to launch the project. You can configure a custom URI scheme using the {bold --scheme} option.`\n );\n }\n }\n return resolvedScheme.scheme;\n } else {\n // Ensure this is reset when users don't use `--scheme`, `--dev-client` and don't have the `expo-dev-client` package installed.\n return null;\n }\n}\n\n/** Resolve and assert host type options. */\nexport function resolveHostType(options: {\n host?: string;\n offline?: boolean;\n lan?: boolean;\n localhost?: boolean;\n tunnel?: boolean;\n}): 'lan' | 'tunnel' | 'localhost' {\n if (\n [options.offline, options.host, options.lan, options.localhost, options.tunnel].filter((i) => i)\n .length > 1\n ) {\n throw new CommandError(\n 'BAD_ARGS',\n 'Specify at most one of: --offline, --host, --tunnel, --lan, --localhost'\n );\n }\n\n if (options.offline) {\n // Force `lan` in offline mode.\n return 'lan';\n } else if (options.host) {\n assert.match(options.host, /^(lan|tunnel|localhost)$/);\n return options.host as 'lan' | 'tunnel' | 'localhost';\n } else if (options.tunnel) {\n return 'tunnel';\n } else if (options.lan) {\n return 'lan';\n } else if (options.localhost) {\n return 'localhost';\n }\n\n // If no option is provided, and we are running in Stackblitz, enable tunnel by default\n if (envIsWebcontainer()) {\n return 'tunnel';\n }\n\n return 'lan';\n}\n\n/** Resolve the port options for all supported bundlers. */\nexport async function resolvePortsAsync(\n projectRoot: string,\n options: Partial<Pick<Options, 'port' | 'devClient'>>,\n settings: { webOnly?: boolean }\n) {\n const multiBundlerSettings: { webpackPort?: number; metroPort?: number } = {};\n\n if (settings.webOnly) {\n const webpackPort = await resolvePortAsync(projectRoot, {\n defaultPort: options.port,\n // Default web port\n fallbackPort: 19006,\n });\n if (!webpackPort) {\n throw new AbortCommandError();\n }\n multiBundlerSettings.webpackPort = webpackPort;\n } else {\n const fallbackPort = process.env.RCT_METRO_PORT\n ? parseInt(process.env.RCT_METRO_PORT, 10)\n : 8081;\n const metroPort = await resolvePortAsync(projectRoot, {\n defaultPort: options.port,\n fallbackPort,\n });\n if (!metroPort) {\n throw new AbortCommandError();\n }\n multiBundlerSettings.metroPort = metroPort;\n }\n\n return multiBundlerSettings;\n}\n"],"names":["resolveHostType","resolveOptionsAsync","resolvePortsAsync","resolveSchemeAsync","projectRoot","args","CommandError","host","offline","lan","localhost","tunnel","Log","warn","chalk","isUserDefinedDevClient","isAutoDevClient","hasDirectDevClientDependency","isDevClient","scheme","devClient","privateKeyPath","android","web","ios","clear","dev","https","maxWorkers","port","minify","options","canResolveDevClient","getOptionalDevClientSchemeAsync","require","resolvedScheme","resolution","includes","filter","i","length","assert","match","envIsWebcontainer","settings","multiBundlerSettings","webOnly","webpackPort","resolvePortAsync","defaultPort","fallbackPort","AbortCommandError","process","env","RCT_METRO_PORT","parseInt","metroPort"],"mappings":";;;;;;;;;;;QAuHgBA;eAAAA;;QA5FMC;eAAAA;;QAoIAC;eAAAA;;QA3EAC;eAAAA;;;;gEApFH;;;;;;;gEACD;;;;;;iCAEgD;qBAC9C;qBACc;wBACc;sBACf;;;;;;AAoB1B,eAAeF,oBAAoBG,WAAmB,EAAEC,IAAS;IACtE,IAAIA,IAAI,CAAC,eAAe,IAAIA,IAAI,CAAC,OAAO,EAAE;QACxC,MAAM,IAAIC,oBAAY,CAAC,YAAY;IACrC;IACA,MAAMC,OAAOP,gBAAgB;QAC3BO,MAAMF,IAAI,CAAC,SAAS;QACpBG,SAASH,IAAI,CAAC,YAAY;QAC1BI,KAAKJ,IAAI,CAAC,QAAQ;QAClBK,WAAWL,IAAI,CAAC,cAAc;QAC9BM,QAAQN,IAAI,CAAC,WAAW;IAC1B;IAEA,IAAIA,IAAI,CAAC,UAAU,EAAE;QACnBO,QAAG,CAACC,IAAI,CAACC,IAAAA,gBAAK,CAAA,CAAC,+DAA+D,CAAC;IACjF;IAEA,8FAA8F;IAC9F,wDAAwD;IACxD,MAAMC,yBACJ,CAAC,CAACV,IAAI,CAAC,eAAe,IAAKA,CAAAA,IAAI,CAAC,OAAO,IAAI,OAAO,QAAQ,CAACA,IAAI,CAAC,OAAO,AAAD;IAExE,mGAAmG;IACnG,yBAAyB;IACzB,MAAMW,kBACJX,IAAI,CAAC,eAAe,IAA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AAM,IAAII,yBAAiB;QAC7B;QACAN,qBAAqBE,WAAW,GAAGA;IACrC,OAAO;QACL,MAAMG,eAAeE,QAAQC,GAAG,CAACC,cAAc,GAC3CC,SAASH,QAAQC,GAAG,CAACC,cAAc,EAAE,MACrC;QACJ,MAAME,YAAY,MAAMR,IAAAA,sBAAgB,EAAC5C,aAAa;YACpD6C,aAAalB,QAAQF,IAAI;YACzBqB;QACF;QACA,IAAI,CAACM,WAAW;YACd,MAAM,IAAIL,yBAAiB;QAC7B;QACAN,qBAAqBW,SAAS,GAAGA;IACnC;IAEA,OAAOX;AACT"}
|
|
1
|
+
{"version":3,"sources":["../../../src/start/resolveOptions.ts"],"sourcesContent":["import assert from 'assert';\nimport chalk from 'chalk';\n\nimport { canResolveDevClient, hasDirectDevClientDependency } from './detectDevClient';\nimport { Log } from '../log';\nimport { envIsWebcontainer } from '../utils/env';\nimport { AbortCommandError, CommandError } from '../utils/errors';\nimport { resolvePortAsync } from '../utils/port';\n\nexport type Options = {\n privateKeyPath: string | null;\n android: boolean;\n web: boolean;\n ios: boolean;\n offline: boolean;\n clear: boolean;\n dev: boolean;\n https: boolean;\n maxWorkers: number;\n port: number;\n /** Should instruct the bundler to create minified bundles. */\n minify: boolean;\n devClient: boolean;\n scheme: string | null;\n host: 'localhost' | 'lan' | 'tunnel';\n};\n\nexport async function resolveOptionsAsync(projectRoot: string, args: any): Promise<Options> {\n if (args['--dev-client'] && args['--go']) {\n throw new CommandError('BAD_ARGS', 'Cannot use both --dev-client and --go together.');\n }\n const host = resolveHostType({\n host: args['--host'],\n offline: args['--offline'],\n lan: args['--lan'],\n localhost: args['--localhost'],\n tunnel: args['--tunnel'],\n });\n\n if (args['--https']) {\n Log.warn(chalk`{bold --https} option is deprecated in favor of {bold --tunnel}`);\n }\n\n // User can force the default target by passing either `--dev-client` or `--go`. They can also\n // swap between them during development by pressing `s`.\n const isUserDefinedDevClient =\n !!args['--dev-client'] || (args['--go'] == null ? false : !args['--go']);\n\n // If the user didn't specify `--dev-client` or `--go` we check if they have the dev client package\n // in their package.json.\n const isAutoDevClient =\n args['--dev-client'] == null &&\n args['--go'] == null &&\n hasDirectDevClientDependency(projectRoot);\n\n const isDevClient = isAutoDevClient || isUserDefinedDevClient;\n\n const scheme = await resolveSchemeAsync(projectRoot, {\n scheme: args['--scheme'],\n devClient: isDevClient,\n });\n\n return {\n privateKeyPath: args['--private-key-path'] ?? null,\n\n android: !!args['--android'],\n web: !!args['--web'],\n ios: !!args['--ios'],\n offline: !!args['--offline'],\n\n clear: !!args['--clear'],\n dev: !args['--no-dev'],\n https: !!args['--https'],\n maxWorkers: args['--max-workers'],\n port: args['--port'],\n minify: !!args['--minify'],\n\n devClient: isDevClient,\n\n scheme,\n host,\n };\n}\n\nexport async function resolveSchemeAsync(\n projectRoot: string,\n options: { scheme?: string; devClient?: boolean }\n): Promise<string | null> {\n if (typeof options.scheme === 'string') {\n // Use the custom scheme\n return options.scheme ?? null;\n }\n\n if (options.devClient || canResolveDevClient(projectRoot)) {\n const { getOptionalDevClientSchemeAsync } =\n require('../utils/scheme') as typeof import('../utils/scheme');\n // Attempt to find the scheme or warn the user how to setup a custom scheme\n const resolvedScheme = await getOptionalDevClientSchemeAsync(projectRoot);\n if (!resolvedScheme.scheme) {\n if (resolvedScheme.resolution === 'shared') {\n // This can happen if one of the native projects has no URI schemes defined in it.\n // Normally, this should never happen.\n Log.warn(\n chalk`Could not find a shared URI scheme for the dev client between the local {bold /ios} and {bold /android} directories. App launches (QR code, interstitial, terminal keys) may not work as expected. You can configure a custom scheme using the {bold --scheme} option, or by running {bold npx expo prebuild} to regenerate the native directories with URI schemes.`\n );\n } else if (['ios', 'android'].includes(resolvedScheme.resolution)) {\n Log.warn(\n chalk`The {bold /${resolvedScheme.resolution}} project does not contain any URI schemes. Expo CLI will not be able to use links to launch the project. You can configure a custom URI scheme using the {bold --scheme} option.`\n );\n }\n }\n return resolvedScheme.scheme;\n } else {\n // Ensure this is reset when users don't use `--scheme`, `--dev-client` and don't have the `expo-dev-client` package installed.\n return null;\n }\n}\n\n/** Resolve and assert host type options. */\nexport function resolveHostType(options: {\n host?: string;\n offline?: boolean;\n lan?: boolean;\n localhost?: boolean;\n tunnel?: boolean;\n}): 'lan' | 'tunnel' | 'localhost' {\n if (\n [options.offline, options.host, options.lan, options.localhost, options.tunnel].filter((i) => i)\n .length > 1\n ) {\n throw new CommandError(\n 'BAD_ARGS',\n 'Specify at most one of: --offline, --host, --tunnel, --lan, --localhost'\n );\n }\n\n if (options.offline) {\n // Force `lan` in offline mode.\n return 'lan';\n } else if (options.host) {\n assert.match(options.host, /^(lan|tunnel|localhost)$/);\n return options.host as 'lan' | 'tunnel' | 'localhost';\n } else if (options.tunnel) {\n return 'tunnel';\n } else if (options.lan) {\n return 'lan';\n } else if (options.localhost) {\n return 'localhost';\n }\n\n // If no option is provided, and we are running in Stackblitz, enable tunnel by default\n if (envIsWebcontainer()) {\n return 'tunnel';\n }\n\n return 'lan';\n}\n\n/** Resolve the port options for all supported bundlers. */\nexport async function resolvePortsAsync(\n projectRoot: string,\n options: Partial<Pick<Options, 'port' | 'devClient'>>,\n settings: { webOnly?: boolean }\n) {\n const multiBundlerSettings: { webpackPort?: number; metroPort?: number } = {};\n\n if (settings.webOnly) {\n const webpackPort = await resolvePortAsync(projectRoot, {\n defaultPort: options.port,\n // Default web port\n fallbackPort: 19006,\n });\n if (webpackPort == null) {\n throw new AbortCommandError();\n }\n multiBundlerSettings.webpackPort = webpackPort;\n } else {\n const fallbackPort = process.env.RCT_METRO_PORT\n ? parseInt(process.env.RCT_METRO_PORT, 10)\n : 8081;\n const metroPort = await resolvePortAsync(projectRoot, {\n defaultPort: options.port,\n fallbackPort,\n });\n if (metroPort == null) {\n throw new AbortCommandError();\n }\n multiBundlerSettings.metroPort = metroPort;\n }\n\n return multiBundlerSettings;\n}\n"],"names":["resolveHostType","resolveOptionsAsync","resolvePortsAsync","resolveSchemeAsync","projectRoot","args","CommandError","host","offline","lan","localhost","tunnel","Log","warn","chalk","isUserDefinedDevClient","isAutoDevClient","hasDirectDevClientDependency","isDevClient","scheme","devClient","privateKeyPath","android","web","ios","clear","dev","https","maxWorkers","port","minify","options","canResolveDevClient","getOptionalDevClientSchemeAsync","require","resolvedScheme","resolution","includes","filter","i","length","assert","match","envIsWebcontainer","settings","multiBundlerSettings","webOnly","webpackPort","resolvePortAsync","defaultPort","fallbackPort","AbortCommandError","process","env","RCT_METRO_PORT","parseInt","metroPort"],"mappings":";;;;;;;;;;;QAuHgBA;eAAAA;;QA5FMC;eAAAA;;QAoIAC;eAAAA;;QA3EAC;eAAAA;;;;gEApFH;;;;;;;gEACD;;;;;;iCAEgD;qBAC9C;qBACc;wBACc;sBACf;;;;;;AAoB1B,eAAeF,oBAAoBG,WAAmB,EAAEC,IAAS;IACtE,IAAIA,IAAI,CAAC,eAAe,IAAIA,IAAI,CAAC,OAAO,EAAE;QACxC,MAAM,IAAIC,oBAAY,CAAC,YAAY;IACrC;IACA,MAAMC,OAAOP,gBAAgB;QAC3BO,MAAMF,IAAI,CAAC,SAAS;QACpBG,SAASH,IAAI,CAAC,YAAY;QAC1BI,KAAKJ,IAAI,CAAC,QAAQ;QAClBK,WAAWL,IAAI,CAAC,cAAc;QAC9BM,QAAQN,IAAI,CAAC,WAAW;IAC1B;IAEA,IAAIA,IAAI,CAAC,UAAU,EAAE;QACnBO,QAAG,CAACC,IAAI,CAACC,IAAAA,gBAAK,CAAA,CAAC,+DAA+D,CAAC;IACjF;IAEA,8FAA8F;IAC9F,wDAAwD;IACxD,MAAMC,yBACJ,CAAC,CAACV,IAAI,CAAC,eAAe,IAAKA,CAAAA,IAAI,CAAC,OAAO,IAAI,OAAO,QAAQ,CAACA,IAAI,CAAC,OAAO,AAAD;IAExE,mGAAmG;IACnG,yBAAyB;IACzB,MAAMW,kBACJX,IAAI,CAAC,eAAe,IAAI,QACxBA,IAAI,CAAC,OAAO,IAAI,QAChBY,IAAAA,6CAA4B,EAACb;IAE/B,MAAMc,cA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,eAAeE,QAAQC,GAAG,CAACC,cAAc,GAC3CC,SAASH,QAAQC,GAAG,CAACC,cAAc,EAAE,MACrC;QACJ,MAAME,YAAY,MAAMR,IAAAA,sBAAgB,EAAC5C,aAAa;YACpD6C,aAAalB,QAAQF,IAAI;YACzBqB;QACF;QACA,IAAIM,aAAa,MAAM;YACrB,MAAM,IAAIL,yBAAiB;QAC7B;QACAN,qBAAqBW,SAAS,GAAGA;IACnC;IAEA,OAAOX;AACT"}
|
|
@@ -14,9 +14,6 @@ function _export(target, all) {
|
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
_export(exports, {
|
|
17
|
-
get cachedSourceMaps () {
|
|
18
|
-
return cachedSourceMaps;
|
|
19
|
-
},
|
|
20
17
|
get createMetroEndpointAsync () {
|
|
21
18
|
return createMetroEndpointAsync;
|
|
22
19
|
},
|
|
@@ -68,18 +65,6 @@ function _interop_require_default(obj) {
|
|
|
68
65
|
};
|
|
69
66
|
}
|
|
70
67
|
const debug = require('debug')('expo:start:server:getStaticRenderFunctions');
|
|
71
|
-
const cachedSourceMaps = new Map();
|
|
72
|
-
// Detect if running in Bun
|
|
73
|
-
if (!process.isBun) {
|
|
74
|
-
require('source-map-support').install({
|
|
75
|
-
retrieveSourceMap (source) {
|
|
76
|
-
if (cachedSourceMaps.has(source)) {
|
|
77
|
-
return cachedSourceMaps.get(source);
|
|
78
|
-
}
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
68
|
async function ensureFileInRootDirectory(projectRoot, otherFile) {
|
|
84
69
|
// Cannot be accessed using Metro's server API, we need to move the file
|
|
85
70
|
// into the project root and try again.
|
|
@@ -120,9 +105,9 @@ async function createMetroEndpointAsync(projectRoot, devServerUrl, absoluteFileP
|
|
|
120
105
|
}
|
|
121
106
|
return url;
|
|
122
107
|
}
|
|
123
|
-
function evalMetroAndWrapFunctions(projectRoot, script, filename, isExporting) {
|
|
108
|
+
function evalMetroAndWrapFunctions(projectRoot, script, filename, sourceMap, isExporting) {
|
|
124
109
|
// TODO: Add back stack trace logic that hides traces from metro-runtime and other internal modules.
|
|
125
|
-
const contents = evalMetroNoHandling(projectRoot, script, filename);
|
|
110
|
+
const contents = evalMetroNoHandling(projectRoot, script, filename, sourceMap);
|
|
126
111
|
if (!contents) {
|
|
127
112
|
// This can happen if ErrorUtils isn't working correctly on web and failing to throw an error when a module throws.
|
|
128
113
|
// This is unexpected behavior and should not be pretty formatted, therefore we're avoiding CommandError.
|
|
@@ -155,7 +140,7 @@ function evalMetroAndWrapFunctions(projectRoot, script, filename, isExporting) {
|
|
|
155
140
|
return acc;
|
|
156
141
|
}, {});
|
|
157
142
|
}
|
|
158
|
-
function evalMetroNoHandling(projectRoot, src, filename) {
|
|
143
|
+
function evalMetroNoHandling(projectRoot, src, filename, sourceMap) {
|
|
159
144
|
(0, _serverLogLikeMetro.augmentLogs)(projectRoot);
|
|
160
145
|
// NOTE(@kitten): `require-from-string` derives a base path from the filename we pass it,
|
|
161
146
|
// but doesn't validate that the filename exists. These debug messages should help identify
|
|
@@ -165,7 +150,10 @@ function evalMetroNoHandling(projectRoot, src, filename) {
|
|
|
165
150
|
} else if (!(0, _filePath.toPosixPath)(_path().default.dirname(filename)).startsWith((0, _filePath.toPosixPath)(projectRoot))) {
|
|
166
151
|
debug(`evalMetroNoHandling received filename outside of the project root: ${filename}`);
|
|
167
152
|
}
|
|
168
|
-
return (0, _profile.profile)(_requireutils().evalModule, 'eval-metro-bundle')(src, filename
|
|
153
|
+
return (0, _profile.profile)(_requireutils().evalModule, 'eval-metro-bundle')(src, filename, {
|
|
154
|
+
cache: false,
|
|
155
|
+
sourceMap
|
|
156
|
+
});
|
|
169
157
|
}
|
|
170
158
|
|
|
171
159
|
//# sourceMappingURL=getStaticRenderFunctions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/start/server/getStaticRenderFunctions.ts"],"sourcesContent":["/**\n * Copyright © 2022 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 { getMetroServerRoot } from '@expo/config/paths';\nimport { evalModule } from '@expo/require-utils';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { IS_METRO_BUNDLE_ERROR_SYMBOL, logMetroError } from './metro/metroErrorInterface';\nimport type { ExpoMetroOptions } from './middleware/metroOptions';\nimport { createBundleUrlPath } from './middleware/metroOptions';\nimport { augmentLogs } from './serverLogLikeMetro';\nimport { delayAsync } from '../../utils/delay';\nimport { SilentError } from '../../utils/errors';\nimport { toPosixPath } from '../../utils/filePath';\nimport { profile } from '../../utils/profile';\n\nconst debug = require('debug')('expo:start:server:getStaticRenderFunctions') as typeof console.log;\n\n/** The list of input keys will become optional, everything else will remain the same. */\nexport type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\
|
|
1
|
+
{"version":3,"sources":["../../../../src/start/server/getStaticRenderFunctions.ts"],"sourcesContent":["/**\n * Copyright © 2022 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 { getMetroServerRoot } from '@expo/config/paths';\nimport { evalModule } from '@expo/require-utils';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { IS_METRO_BUNDLE_ERROR_SYMBOL, logMetroError } from './metro/metroErrorInterface';\nimport type { ExpoMetroOptions } from './middleware/metroOptions';\nimport { createBundleUrlPath } from './middleware/metroOptions';\nimport { augmentLogs } from './serverLogLikeMetro';\nimport { delayAsync } from '../../utils/delay';\nimport { SilentError } from '../../utils/errors';\nimport { toPosixPath } from '../../utils/filePath';\nimport { profile } from '../../utils/profile';\n\nconst debug = require('debug')('expo:start:server:getStaticRenderFunctions') as typeof console.log;\n\n/** The list of input keys will become optional, everything else will remain the same. */\nexport type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nasync function ensureFileInRootDirectory(projectRoot: string, otherFile: string) {\n // Cannot be accessed using Metro's server API, we need to move the file\n // into the project root and try again.\n if (!path.relative(projectRoot, otherFile).startsWith('..' + path.sep)) {\n return otherFile;\n }\n\n // Copy the file into the project to ensure it works in monorepos.\n // This means the file cannot have any relative imports.\n const tempDir = path.join(projectRoot, '.expo/static-tmp');\n await fs.promises.mkdir(tempDir, { recursive: true });\n const moduleId = path.join(tempDir, path.basename(otherFile));\n await fs.promises.writeFile(moduleId, await fs.promises.readFile(otherFile, 'utf8'));\n // Sleep to give watchman time to register the file.\n await delayAsync(50);\n return moduleId;\n}\n\nexport async function createMetroEndpointAsync(\n projectRoot: string,\n devServerUrl: string,\n absoluteFilePath: string,\n props: PickPartial<ExpoMetroOptions, 'mainModuleName' | 'bytecode'>\n): Promise<string> {\n const root = getMetroServerRoot(projectRoot);\n const safeOtherFile = await ensureFileInRootDirectory(projectRoot, absoluteFilePath);\n const serverPath = path.relative(root, safeOtherFile).replace(/\\.[jt]sx?$/, '');\n\n const urlFragment = createBundleUrlPath({\n mainModuleName: serverPath,\n lazy: false,\n asyncRoutes: false,\n inlineSourceMap: false,\n engine: 'hermes',\n minify: false,\n bytecode: false,\n ...props,\n });\n\n let url: string;\n if (devServerUrl) {\n url = new URL(urlFragment.replace(/^\\//, ''), devServerUrl).toString();\n } else {\n url = '/' + urlFragment.replace(/^\\/+/, '');\n }\n return url;\n}\n\nexport function evalMetroAndWrapFunctions<T = Record<string, any>>(\n projectRoot: string,\n script: string,\n filename: string,\n sourceMap: string | undefined,\n isExporting: boolean\n): T {\n // TODO: Add back stack trace logic that hides traces from metro-runtime and other internal modules.\n const contents = evalMetroNoHandling(projectRoot, script, filename, sourceMap);\n\n if (!contents) {\n // This can happen if ErrorUtils isn't working correctly on web and failing to throw an error when a module throws.\n // This is unexpected behavior and should not be pretty formatted, therefore we're avoiding CommandError.\n throw new Error(\n '[Expo SSR] Module returned undefined, this could be due to a misconfiguration in Metro error handling'\n );\n }\n // wrap each function with a try/catch that uses Metro's error formatter\n return Object.keys(contents).reduce((acc, key) => {\n const fn = contents[key];\n if (typeof fn !== 'function') {\n return { ...acc, [key]: fn };\n }\n\n acc[key] = async function (...props: any[]) {\n try {\n return await fn.apply(this, props);\n } catch (error: any) {\n await logMetroError(projectRoot, { error });\n\n if (isExporting || error[IS_METRO_BUNDLE_ERROR_SYMBOL]) {\n throw error;\n } else {\n // TODO: When does this happen?\n throw new SilentError(error);\n }\n }\n };\n return acc;\n }, {} as any);\n}\n\nexport function evalMetroNoHandling(\n projectRoot: string,\n src: string,\n filename: string,\n sourceMap?: string\n) {\n augmentLogs(projectRoot);\n\n // NOTE(@kitten): `require-from-string` derives a base path from the filename we pass it,\n // but doesn't validate that the filename exists. These debug messages should help identify\n // these problems, if they occur in user projects without reproductions\n if (!fs.existsSync(path.dirname(filename))) {\n debug(`evalMetroNoHandling received filename in a directory that does not exist: ${filename}`);\n } else if (!toPosixPath(path.dirname(filename)).startsWith(toPosixPath(projectRoot))) {\n debug(`evalMetroNoHandling received filename outside of the project root: ${filename}`);\n }\n\n return profile(evalModule, 'eval-metro-bundle')(src, filename, {\n cache: false,\n sourceMap,\n });\n}\n"],"names":["createMetroEndpointAsync","evalMetroAndWrapFunctions","evalMetroNoHandling","debug","require","ensureFileInRootDirectory","projectRoot","otherFile","path","relative","startsWith","sep","tempDir","join","fs","promises","mkdir","recursive","moduleId","basename","writeFile","readFile","delayAsync","devServerUrl","absoluteFilePath","props","root","getMetroServerRoot","safeOtherFile","serverPath","replace","urlFragment","createBundleUrlPath","mainModuleName","lazy","asyncRoutes","inlineSourceMap","engine","minify","bytecode","url","URL","toString","script","filename","sourceMap","isExporting","contents","Error","Object","keys","reduce","acc","key","fn","apply","error","logMetroError","IS_METRO_BUNDLE_ERROR_SYMBOL","SilentError","src","augmentLogs","existsSync","dirname","toPosixPath","profile","evalModule","cache"],"mappings":"AAAA;;;;;CAKC;;;;;;;;;;;QAsCqBA;eAAAA;;QA8BNC;eAAAA;;QA0CAC;eAAAA;;;;yBA7GmB;;;;;;;yBACR;;;;;;;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,CAACoB,IAAAA,qBAAW,EAACxD,eAAI,CAACuD,OAAO,CAACnB,WAAWlC,UAAU,CAACsD,IAAAA,qBAAW,EAAC1D,eAAe;QACpFH,MAAM,CAAC,mEAAmE,EAAEyC,UAAU;IACxF;IAEA,OAAOqB,IAAAA,gBAAO,EAACC,0BAAU,EAAE,qBAAqBN,KAAKhB,UAAU;QAC7DuB,OAAO;QACPtB;IACF;AACF"}
|
|
@@ -666,7 +666,8 @@ class MetroBundlerDevServer extends _BundlerDevServer.BundlerDevServer {
|
|
|
666
666
|
modulesOnly: expoBundleOptions.modulesOnly ?? false,
|
|
667
667
|
runModule: expoBundleOptions.runModule ?? true,
|
|
668
668
|
sourceUrl: expoBundleOptions.sourceUrl,
|
|
669
|
-
sourceMapUrl: extraOptions.sourceMapUrl ?? expoBundleOptions.sourceMapUrl
|
|
669
|
+
sourceMapUrl: extraOptions.sourceMapUrl ?? expoBundleOptions.sourceMapUrl,
|
|
670
|
+
excludeSource: expoBundleOptions.serializerOptions.excludeSource ?? false
|
|
670
671
|
},
|
|
671
672
|
transformOptions
|
|
672
673
|
});
|
|
@@ -703,15 +704,6 @@ class MetroBundlerDevServer extends _BundlerDevServer.BundlerDevServer {
|
|
|
703
704
|
// https://github.com/facebook/metro/blob/2405f2f6c37a1b641cc379b9c733b1eff0c1c2a1/packages/metro/src/lib/parseOptionsFromUrl.js#L55-L87
|
|
704
705
|
const { filename, bundle, map, ...rest } = await this.metroLoadModuleContents(filePath, opts);
|
|
705
706
|
const scriptContents = wrapBundle(bundle);
|
|
706
|
-
if (map) {
|
|
707
|
-
debug('Registering SSR source map for:', filename);
|
|
708
|
-
_getStaticRenderFunctions.cachedSourceMaps.set(filename, {
|
|
709
|
-
url: this.projectRoot,
|
|
710
|
-
map
|
|
711
|
-
});
|
|
712
|
-
} else {
|
|
713
|
-
debug('No SSR source map found for:', filename);
|
|
714
|
-
}
|
|
715
707
|
return {
|
|
716
708
|
...rest,
|
|
717
709
|
src: scriptContents,
|
|
@@ -1305,7 +1297,7 @@ class MetroBundlerDevServer extends _BundlerDevServer.BundlerDevServer {
|
|
|
1305
1297
|
if (!(apiRoute == null ? void 0 : apiRoute.src)) {
|
|
1306
1298
|
return null;
|
|
1307
1299
|
}
|
|
1308
|
-
return (0, _getStaticRenderFunctions.evalMetroNoHandling)(this.projectRoot, apiRoute.src, apiRoute.filename);
|
|
1300
|
+
return (0, _getStaticRenderFunctions.evalMetroNoHandling)(this.projectRoot, apiRoute.src, apiRoute.filename, apiRoute.map);
|
|
1309
1301
|
} catch (error) {
|
|
1310
1302
|
// Format any errors that were thrown in the global scope of the evaluation.
|
|
1311
1303
|
if (error instanceof Error) {
|
|
@@ -1691,7 +1683,7 @@ class MetroBundlerDevServer extends _BundlerDevServer.BundlerDevServer {
|
|
|
1691
1683
|
const url = new URL(relativePath, this.getDevServerUrlOrAssert());
|
|
1692
1684
|
this.setupHmr(url);
|
|
1693
1685
|
}
|
|
1694
|
-
return (0, _getStaticRenderFunctions.evalMetroAndWrapFunctions)(this.projectRoot, res.src, res.filename, specificOptions.isExporting ?? this.instanceMetroOptions.isExporting);
|
|
1686
|
+
return (0, _getStaticRenderFunctions.evalMetroAndWrapFunctions)(this.projectRoot, res.src, res.filename, res.map, specificOptions.isExporting ?? this.instanceMetroOptions.isExporting);
|
|
1695
1687
|
}, this.rscRenderer = null, this.onReloadRscEvent = null, // API Routes
|
|
1696
1688
|
this.pendingRouteOperations = new Map(), this.watchedLoaderFiles = new Set();
|
|
1697
1689
|
}
|