@expo/cli 0.14.0 → 0.16.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 +13 -5
- package/build/bin/cli.map +1 -1
- package/build/src/api/getVersions.js.map +1 -1
- package/build/src/api/rest/cache/response.js.map +1 -1
- package/build/src/api/rest/client.js +2 -2
- package/build/src/api/rest/client.js.map +1 -1
- package/build/src/api/user/actions.js +1 -1
- package/build/src/api/user/actions.js.map +1 -1
- package/build/src/customize/typescript.js +3 -1
- package/build/src/customize/typescript.js.map +1 -1
- package/build/src/export/createMetadataJson.js +5 -3
- package/build/src/export/createMetadataJson.js.map +1 -1
- package/build/src/export/embed/exportEmbedAsync.js +92 -18
- package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
- package/build/src/export/embed/resolveOptions.js +3 -3
- package/build/src/export/embed/resolveOptions.js.map +1 -1
- package/build/src/export/embed/xcodeCompilerLogger.js +97 -0
- package/build/src/export/embed/xcodeCompilerLogger.js.map +1 -0
- package/build/src/export/exportApp.js +106 -130
- package/build/src/export/exportApp.js.map +1 -1
- package/build/src/export/exportAssets.js +93 -38
- package/build/src/export/exportAssets.js.map +1 -1
- package/build/src/export/exportAsync.js +1 -1
- package/build/src/export/exportAsync.js.map +1 -1
- package/build/src/export/exportHermes.js +0 -90
- package/build/src/export/exportHermes.js.map +1 -1
- package/build/src/export/exportStaticAsync.js +165 -101
- package/build/src/export/exportStaticAsync.js.map +1 -1
- package/build/src/export/favicon.js +13 -5
- package/build/src/export/favicon.js.map +1 -1
- package/build/src/export/fork-bundleAsync.js +84 -57
- package/build/src/export/fork-bundleAsync.js.map +1 -1
- package/build/src/export/index.js +9 -7
- package/build/src/export/index.js.map +1 -1
- package/build/src/export/metroAssetLocalPath.js +101 -0
- package/build/src/export/metroAssetLocalPath.js.map +1 -0
- package/build/src/export/persistMetroAssets.js +115 -31
- package/build/src/export/persistMetroAssets.js.map +1 -1
- package/build/src/export/publicFolder.js +7 -0
- package/build/src/export/publicFolder.js.map +1 -1
- package/build/src/export/resolveOptions.js +1 -1
- package/build/src/export/resolveOptions.js.map +1 -1
- package/build/src/export/saveAssets.js +168 -43
- package/build/src/export/saveAssets.js.map +1 -1
- package/build/src/export/web/exportWebAsync.js +1 -1
- package/build/src/export/web/exportWebAsync.js.map +1 -1
- package/build/src/export/writeContents.js +8 -106
- package/build/src/export/writeContents.js.map +1 -1
- package/build/src/install/applyPlugins.js +52 -0
- package/build/src/install/applyPlugins.js.map +1 -0
- package/build/src/install/checkPackages.js +2 -2
- package/build/src/install/checkPackages.js.map +1 -1
- package/build/src/install/fixPackages.js +84 -0
- package/build/src/install/fixPackages.js.map +1 -0
- package/build/src/install/installAsync.js +50 -60
- package/build/src/install/installAsync.js.map +1 -1
- package/build/src/install/installExpoPackage.js +79 -0
- package/build/src/install/installExpoPackage.js.map +1 -0
- package/build/src/prebuild/clearNativeFolder.js +1 -1
- package/build/src/prebuild/clearNativeFolder.js.map +1 -1
- package/build/src/prebuild/configureProjectAsync.js +3 -3
- package/build/src/prebuild/configureProjectAsync.js.map +1 -1
- package/build/src/prebuild/copyTemplateFiles.js +21 -30
- package/build/src/prebuild/copyTemplateFiles.js.map +1 -1
- package/build/src/prebuild/prebuildAsync.js +45 -16
- package/build/src/prebuild/prebuildAsync.js.map +1 -1
- package/build/src/prebuild/resolveOptions.js +2 -2
- package/build/src/prebuild/resolveOptions.js.map +1 -1
- package/build/src/prebuild/updateFromTemplate.js +6 -6
- package/build/src/prebuild/updateFromTemplate.js.map +1 -1
- package/build/src/prebuild/updatePackageJson.js +49 -36
- package/build/src/prebuild/updatePackageJson.js.map +1 -1
- package/build/src/prebuild/validateTemplatePlatforms.js +2 -2
- package/build/src/prebuild/validateTemplatePlatforms.js.map +1 -1
- package/build/src/run/hints.js +4 -0
- package/build/src/run/hints.js.map +1 -1
- package/build/src/run/index.js +101 -0
- package/build/src/run/index.js.map +1 -0
- package/build/src/start/doctor/dependencies/bundledNativeModules.js +2 -2
- package/build/src/start/doctor/dependencies/bundledNativeModules.js.map +1 -1
- package/build/src/start/doctor/dependencies/getVersionedPackages.js +22 -7
- package/build/src/start/doctor/dependencies/getVersionedPackages.js.map +1 -1
- package/build/src/start/doctor/dependencies/resolvePackages.js +66 -0
- package/build/src/start/doctor/dependencies/resolvePackages.js.map +1 -0
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js +22 -33
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js.map +1 -1
- package/build/src/start/interface/interactiveActions.js +54 -19
- package/build/src/start/interface/interactiveActions.js.map +1 -1
- package/build/src/start/server/BundlerDevServer.js +14 -10
- package/build/src/start/server/BundlerDevServer.js.map +1 -1
- package/build/src/start/server/DevServerManager.js +6 -1
- package/build/src/start/server/DevServerManager.js.map +1 -1
- package/build/src/start/server/DevToolsPluginManager.js +63 -0
- package/build/src/start/server/DevToolsPluginManager.js.map +1 -0
- package/build/src/start/server/getStaticRenderFunctions.js +25 -23
- package/build/src/start/server/getStaticRenderFunctions.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +76 -69
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/MetroTerminalReporter.js +6 -2
- package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
- package/build/src/start/server/metro/TerminalReporter.js +18 -1
- package/build/src/start/server/metro/TerminalReporter.js.map +1 -1
- package/build/src/start/server/metro/bundleApiRoutes.js +5 -3
- package/build/src/start/server/metro/bundleApiRoutes.js.map +1 -1
- package/build/src/start/server/metro/createExpoMetroResolver.js +80 -46
- package/build/src/start/server/metro/createExpoMetroResolver.js.map +1 -1
- package/build/src/start/server/metro/createJResolver.js +152 -0
- package/build/src/start/server/metro/createJResolver.js.map +1 -0
- package/build/src/start/server/metro/createServerRouteMiddleware.js +15 -2
- package/build/src/start/server/metro/createServerRouteMiddleware.js.map +1 -1
- package/build/src/start/server/metro/{inspector-proxy/device.js → debugging/InspectorDevice.js} +10 -38
- package/build/src/start/server/metro/debugging/InspectorDevice.js.map +1 -0
- package/build/src/start/server/metro/debugging/InspectorProxy.js +116 -0
- package/build/src/start/server/metro/debugging/InspectorProxy.js.map +1 -0
- package/build/src/start/server/metro/debugging/createDebugMiddleware.js +45 -0
- package/build/src/start/server/metro/debugging/createDebugMiddleware.js.map +1 -0
- package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/NetworkResponse.js +3 -4
- package/build/src/start/server/metro/debugging/inspectorHandlers/NetworkResponse.js.map +1 -0
- package/build/src/start/server/metro/debugging/inspectorHandlers/PageReload.js.map +1 -0
- package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/VscodeDebuggerGetPossibleBreakpoints.js +5 -6
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeDebuggerGetPossibleBreakpoints.js.map +1 -0
- package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/VscodeDebuggerScriptParsed.js +3 -2
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeDebuggerScriptParsed.js.map +1 -0
- package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/VscodeDebuggerSetBreakpointByUrl.js +3 -2
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeDebuggerSetBreakpointByUrl.js.map +1 -0
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeRuntimeCallFunctionOn.js +24 -0
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeRuntimeCallFunctionOn.js.map +1 -0
- package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/VscodeRuntimeGetProperties.js +5 -4
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeRuntimeGetProperties.js.map +1 -0
- package/build/src/start/server/metro/debugging/inspectorHandlers/types.js.map +1 -0
- package/build/src/start/server/metro/debugging/inspectorHandlers/utils.js +20 -0
- package/build/src/start/server/metro/debugging/inspectorHandlers/utils.js.map +1 -0
- package/build/src/start/server/metro/externals.js +25 -3
- package/build/src/start/server/metro/externals.js.map +1 -1
- package/build/src/start/server/metro/getCssModulesFromBundler.js.map +1 -1
- package/build/src/start/server/metro/instantiateMetro.js +40 -15
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/start/server/metro/metroErrorInterface.js +3 -2
- package/build/src/start/server/metro/metroErrorInterface.js.map +1 -1
- package/build/src/start/server/metro/router.js +5 -6
- package/build/src/start/server/metro/router.js.map +1 -1
- package/build/src/start/server/metro/runServer-fork.js +17 -27
- package/build/src/start/server/metro/runServer-fork.js.map +1 -1
- package/build/src/start/server/metro/serializeHtml.js +59 -0
- package/build/src/start/server/metro/serializeHtml.js.map +1 -0
- package/build/src/start/server/metro/waitForMetroToObserveTypeScriptFile.js +1 -2
- package/build/src/start/server/metro/waitForMetroToObserveTypeScriptFile.js.map +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js +237 -214
- package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
- package/build/src/start/server/metro/withMetroResolvers.js +114 -40
- package/build/src/start/server/metro/withMetroResolvers.js.map +1 -1
- package/build/src/start/server/middleware/DevToolsPluginMiddleware.js +61 -0
- package/build/src/start/server/middleware/DevToolsPluginMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/ExpoMiddleware.js +2 -2
- package/build/src/start/server/middleware/ExpoMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ManifestMiddleware.js +22 -66
- package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/inspector/JsInspector.js +23 -2
- package/build/src/start/server/middleware/inspector/JsInspector.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowser.js +30 -26
- package/build/src/start/server/middleware/inspector/LaunchBrowser.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowser.types.js +7 -7
- package/build/src/start/server/middleware/inspector/LaunchBrowser.types.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplLinux.js +5 -2
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplLinux.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplMacOS.js +3 -2
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplMacOS.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplWindows.js +8 -7
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplWindows.js.map +1 -1
- package/build/src/start/server/middleware/metroOptions.js +176 -0
- package/build/src/start/server/middleware/metroOptions.js.map +1 -0
- package/build/src/start/server/type-generation/__typetests__/fixtures/basic.js.map +1 -1
- package/build/src/start/server/type-generation/__typetests__/route.test.js +11 -3
- package/build/src/start/server/type-generation/__typetests__/route.test.js.map +1 -1
- package/build/src/start/server/type-generation/routes.js +6 -4
- package/build/src/start/server/type-generation/routes.js.map +1 -1
- package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js +1 -1
- package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js.map +1 -1
- package/build/src/utils/analytics/getMetroDebugProperties.js +1 -2
- package/build/src/utils/analytics/getMetroDebugProperties.js.map +1 -1
- package/build/src/utils/analytics/getMetroProperties.js +1 -2
- package/build/src/utils/analytics/getMetroProperties.js.map +1 -1
- package/build/src/utils/analytics/rudderstackClient.js +2 -2
- package/build/src/utils/args.js +4 -2
- package/build/src/utils/args.js.map +1 -1
- package/build/src/utils/cocoapods.js +1 -1
- package/build/src/utils/cocoapods.js.map +1 -1
- package/build/src/utils/codesigning.js +11 -1
- package/build/src/utils/codesigning.js.map +1 -1
- package/build/src/utils/dir.js +18 -8
- package/build/src/utils/dir.js.map +1 -1
- package/build/src/utils/env.js +10 -1
- package/build/src/utils/env.js.map +1 -1
- package/build/src/utils/getOrPromptApplicationId.js +2 -4
- package/build/src/utils/getOrPromptApplicationId.js.map +1 -1
- package/build/src/utils/prompts.js +1 -28
- package/build/src/utils/prompts.js.map +1 -1
- package/build/src/utils/tsconfig/loadTsConfigPaths.js +3 -11
- package/build/src/utils/tsconfig/loadTsConfigPaths.js.map +1 -1
- package/build/src/utils/tsconfig/resolveWithTsConfigPaths.js +22 -12
- package/build/src/utils/tsconfig/resolveWithTsConfigPaths.js.map +1 -1
- package/package.json +19 -18
- package/static/shims/react-native-web/dist/cjs/exports/AppRegistry/AppContainer.js +13 -0
- package/static/shims/react-native-web/dist/exports/AppRegistry/AppContainer.js +12 -0
- package/static/template/index.html +14 -95
- package/build/src/export/printBundleSizes.js +0 -101
- package/build/src/export/printBundleSizes.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/device.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/NetworkResponse.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/PageReload.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerGetPossibleBreakpoints.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerScriptParsed.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerSetBreakpointByUrl.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/VscodeRuntimeGetProperties.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/types.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/index.js +0 -27
- package/build/src/start/server/metro/inspector-proxy/index.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/proxy.js +0 -169
- package/build/src/start/server/metro/inspector-proxy/proxy.js.map +0 -1
- package/build/src/start/server/metro/resolveFromProject.js +0 -90
- package/build/src/start/server/metro/resolveFromProject.js.map +0 -1
- package/build/src/start/server/middleware/inspector/createJsInspectorMiddleware.js +0 -64
- package/build/src/start/server/middleware/inspector/createJsInspectorMiddleware.js.map +0 -1
- /package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/PageReload.js +0 -0
- /package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/types.js +0 -0
|
@@ -14,6 +14,7 @@ var _fetchRouterManifest = require("./fetchRouterManifest");
|
|
|
14
14
|
var _instantiateMetro = require("./instantiateMetro");
|
|
15
15
|
var _metroWatchTypeScriptFiles = require("./metroWatchTypeScriptFiles");
|
|
16
16
|
var _router = require("./router");
|
|
17
|
+
var _serializeHtml = require("./serializeHtml");
|
|
17
18
|
var _waitForMetroToObserveTypeScriptFile = require("./waitForMetroToObserveTypeScriptFile");
|
|
18
19
|
var _log = require("../../../log");
|
|
19
20
|
var _getDevClientProperties = _interopRequireDefault(require("../../../utils/analytics/getDevClientProperties"));
|
|
@@ -24,6 +25,7 @@ var _bundlerDevServer = require("../BundlerDevServer");
|
|
|
24
25
|
var _getStaticRenderFunctions = require("../getStaticRenderFunctions");
|
|
25
26
|
var _contextModuleSourceMapsMiddleware = require("../middleware/ContextModuleSourceMapsMiddleware");
|
|
26
27
|
var _createFileMiddleware = require("../middleware/CreateFileMiddleware");
|
|
28
|
+
var _devToolsPluginMiddleware = require("../middleware/DevToolsPluginMiddleware");
|
|
27
29
|
var _faviconMiddleware = require("../middleware/FaviconMiddleware");
|
|
28
30
|
var _historyFallbackMiddleware = require("../middleware/HistoryFallbackMiddleware");
|
|
29
31
|
var _interstitialPageMiddleware = require("../middleware/InterstitialPageMiddleware");
|
|
@@ -31,6 +33,7 @@ var _manifestMiddleware = require("../middleware/ManifestMiddleware");
|
|
|
31
33
|
var _reactDevToolsPageMiddleware = require("../middleware/ReactDevToolsPageMiddleware");
|
|
32
34
|
var _runtimeRedirectMiddleware = require("../middleware/RuntimeRedirectMiddleware");
|
|
33
35
|
var _serveStaticMiddleware = require("../middleware/ServeStaticMiddleware");
|
|
36
|
+
var _metroOptions = require("../middleware/metroOptions");
|
|
34
37
|
var _mutations = require("../middleware/mutations");
|
|
35
38
|
var _startTypescriptTypeGeneration = require("../type-generation/startTypescriptTypeGeneration");
|
|
36
39
|
function _interopRequireDefault(obj) {
|
|
@@ -82,17 +85,8 @@ class MetroBundlerDevServer extends _bundlerDevServer.BundlerDevServer {
|
|
|
82
85
|
(options.devClient ? Number(process.env.RCT_METRO_PORT) || DEV_CLIENT_METRO_PORT : await (0, _port).getFreePortAsync(EXPO_GO_METRO_PORT));
|
|
83
86
|
return port;
|
|
84
87
|
}
|
|
85
|
-
async
|
|
86
|
-
const
|
|
87
|
-
asJson: true,
|
|
88
|
-
appDir
|
|
89
|
-
});
|
|
90
|
-
if (!manifest) {
|
|
91
|
-
throw new _errors.CommandError("EXPO_ROUTER_SERVER_MANIFEST", "Unexpected error: server manifest could not be fetched.");
|
|
92
|
-
}
|
|
93
|
-
return manifest;
|
|
94
|
-
}
|
|
95
|
-
async exportExpoRouterApiRoutesAsync({ mode , appDir , outputDir }) {
|
|
88
|
+
async exportExpoRouterApiRoutesAsync({ mode , outputDir , prerenderManifest , baseUrl , routerRoot }) {
|
|
89
|
+
const appDir = _path.default.join(this.projectRoot, routerRoot);
|
|
96
90
|
const manifest = await this.getExpoRouterRoutesManifestAsync({
|
|
97
91
|
appDir
|
|
98
92
|
});
|
|
@@ -102,41 +96,52 @@ class MetroBundlerDevServer extends _bundlerDevServer.BundlerDevServer {
|
|
|
102
96
|
const filepath = _path.default.join(appDir, route.file);
|
|
103
97
|
const contents = await (0, _bundleApiRoutes).bundleApiRoute(this.projectRoot, filepath, {
|
|
104
98
|
mode,
|
|
105
|
-
|
|
99
|
+
routerRoot,
|
|
106
100
|
port: (ref = this.getInstance()) == null ? void 0 : ref.location.port,
|
|
107
|
-
shouldThrow: true
|
|
101
|
+
shouldThrow: true,
|
|
102
|
+
baseUrl
|
|
108
103
|
});
|
|
109
104
|
const artifactFilename = _path.default.join(outputDir, _path.default.relative(appDir, filepath.replace(/\.[tj]sx?$/, ".js")));
|
|
110
|
-
|
|
105
|
+
if (contents) {
|
|
106
|
+
files.set(artifactFilename, {
|
|
107
|
+
contents,
|
|
108
|
+
targetDomain: "server"
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
111
|
// Remap the manifest files to represent the output files.
|
|
112
112
|
route.file = artifactFilename;
|
|
113
113
|
}
|
|
114
114
|
return {
|
|
115
|
-
manifest
|
|
115
|
+
manifest: {
|
|
116
|
+
...manifest,
|
|
117
|
+
htmlRoutes: prerenderManifest.htmlRoutes
|
|
118
|
+
},
|
|
116
119
|
files
|
|
117
120
|
};
|
|
118
121
|
}
|
|
119
|
-
async
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return htmlFromSerialAssets(resources, {
|
|
125
|
-
dev: isDev,
|
|
126
|
-
template,
|
|
127
|
-
basePath,
|
|
128
|
-
bundleUrl: isDev ? devBundleUrl : undefined
|
|
122
|
+
async getExpoRouterRoutesManifestAsync({ appDir }) {
|
|
123
|
+
// getBuiltTimeServerManifest
|
|
124
|
+
const manifest = await (0, _fetchRouterManifest).fetchManifest(this.projectRoot, {
|
|
125
|
+
asJson: true,
|
|
126
|
+
appDir
|
|
129
127
|
});
|
|
128
|
+
if (!manifest) {
|
|
129
|
+
throw new _errors.CommandError("EXPO_ROUTER_SERVER_MANIFEST", "Unexpected error: server manifest could not be fetched.");
|
|
130
|
+
}
|
|
131
|
+
return manifest;
|
|
130
132
|
}
|
|
131
|
-
async getStaticRenderFunctionAsync({ mode , minify =mode !== "development" }) {
|
|
133
|
+
async getStaticRenderFunctionAsync({ mode , minify =mode !== "development" , baseUrl , routerRoot }) {
|
|
132
134
|
const url = this.getDevServerUrl();
|
|
133
|
-
const { getStaticContent , getManifest } = await (0, _getStaticRenderFunctions).getStaticRenderFunctions(this.projectRoot, url, {
|
|
135
|
+
const { getStaticContent , getManifest , getBuildTimeServerManifestAsync } = await (0, _getStaticRenderFunctions).getStaticRenderFunctions(this.projectRoot, url, {
|
|
134
136
|
minify,
|
|
135
137
|
dev: mode !== "production",
|
|
136
138
|
// Ensure the API Routes are included
|
|
137
|
-
environment: "node"
|
|
139
|
+
environment: "node",
|
|
140
|
+
baseUrl,
|
|
141
|
+
routerRoot
|
|
138
142
|
});
|
|
139
143
|
return {
|
|
144
|
+
serverManifest: await getBuildTimeServerManifestAsync(),
|
|
140
145
|
// Get routes from Expo Router.
|
|
141
146
|
manifest: await getManifest({
|
|
142
147
|
fetchData: true,
|
|
@@ -148,25 +153,28 @@ class MetroBundlerDevServer extends _bundlerDevServer.BundlerDevServer {
|
|
|
148
153
|
}
|
|
149
154
|
};
|
|
150
155
|
}
|
|
151
|
-
async getStaticResourcesAsync({ mode , minify =mode !== "development" ,
|
|
156
|
+
async getStaticResourcesAsync({ mode , minify =mode !== "development" , includeSourceMaps , baseUrl , mainModuleName , isExporting , asyncRoutes , routerRoot }) {
|
|
152
157
|
var ref;
|
|
153
|
-
const devBundleUrlPathname = (0,
|
|
158
|
+
const devBundleUrlPathname = (0, _metroOptions).createBundleUrlPath({
|
|
154
159
|
platform: "web",
|
|
155
160
|
mode,
|
|
156
161
|
minify,
|
|
157
162
|
environment: "client",
|
|
158
163
|
serializerOutput: "static",
|
|
159
|
-
serializerIncludeMaps:
|
|
160
|
-
mainModuleName: (0, _manifestMiddleware).resolveMainModuleName(this.projectRoot, {
|
|
164
|
+
serializerIncludeMaps: includeSourceMaps,
|
|
165
|
+
mainModuleName: mainModuleName != null ? mainModuleName : (0, _manifestMiddleware).resolveMainModuleName(this.projectRoot, {
|
|
161
166
|
platform: "web"
|
|
162
167
|
}),
|
|
163
|
-
lazy: (0,
|
|
168
|
+
lazy: (0, _metroOptions).shouldEnableAsyncImports(this.projectRoot),
|
|
169
|
+
asyncRoutes,
|
|
170
|
+
baseUrl,
|
|
171
|
+
isExporting,
|
|
172
|
+
routerRoot
|
|
164
173
|
});
|
|
165
174
|
const bundleUrl = new URL(devBundleUrlPathname, this.getDevServerUrl());
|
|
166
175
|
// Fetch the generated HTML from our custom Metro serializer
|
|
167
176
|
const results = await (0, _nodeFetch).default(bundleUrl.toString());
|
|
168
177
|
const txt = await results.text();
|
|
169
|
-
// console.log('STAT:', results.status, results.statusText);
|
|
170
178
|
let data;
|
|
171
179
|
try {
|
|
172
180
|
data = JSON.parse(txt);
|
|
@@ -180,7 +188,7 @@ class MetroBundlerDevServer extends _bundlerDevServer.BundlerDevServer {
|
|
|
180
188
|
throw error;
|
|
181
189
|
}
|
|
182
190
|
// NOTE: This could potentially need more validation in the future.
|
|
183
|
-
if (Array.isArray(data)) {
|
|
191
|
+
if ("artifacts" in data && Array.isArray(data.artifacts)) {
|
|
184
192
|
return data;
|
|
185
193
|
}
|
|
186
194
|
if (data != null && (data.errors || ((ref = data.type) == null ? void 0 : ref.match(/.*Error$/)))) {
|
|
@@ -205,39 +213,49 @@ class MetroBundlerDevServer extends _bundlerDevServer.BundlerDevServer {
|
|
|
205
213
|
}
|
|
206
214
|
throw new Error("Invalid resources returned from the Metro serializer. Expected array, found: " + data);
|
|
207
215
|
}
|
|
208
|
-
async getStaticPageAsync(pathname, { mode , minify =mode !== "development" ,
|
|
209
|
-
const devBundleUrlPathname = (0,
|
|
216
|
+
async getStaticPageAsync(pathname, { mode , minify =mode !== "development" , baseUrl , routerRoot , isExporting , asyncRoutes }) {
|
|
217
|
+
const devBundleUrlPathname = (0, _metroOptions).createBundleUrlPath({
|
|
210
218
|
platform: "web",
|
|
211
219
|
mode,
|
|
212
220
|
environment: "client",
|
|
213
221
|
mainModuleName: (0, _manifestMiddleware).resolveMainModuleName(this.projectRoot, {
|
|
214
222
|
platform: "web"
|
|
215
223
|
}),
|
|
216
|
-
lazy: (0,
|
|
224
|
+
lazy: (0, _metroOptions).shouldEnableAsyncImports(this.projectRoot),
|
|
225
|
+
baseUrl,
|
|
226
|
+
isExporting,
|
|
227
|
+
asyncRoutes,
|
|
228
|
+
routerRoot
|
|
217
229
|
});
|
|
218
230
|
const bundleStaticHtml = async ()=>{
|
|
219
231
|
const { getStaticContent } = await (0, _getStaticRenderFunctions).getStaticRenderFunctions(this.projectRoot, this.getDevServerUrl(), {
|
|
220
232
|
minify: false,
|
|
221
233
|
dev: mode !== "production",
|
|
222
234
|
// Ensure the API Routes are included
|
|
223
|
-
environment: "node"
|
|
235
|
+
environment: "node",
|
|
236
|
+
baseUrl,
|
|
237
|
+
routerRoot
|
|
224
238
|
});
|
|
225
239
|
const location = new URL(pathname, this.getDevServerUrl());
|
|
226
240
|
return await getStaticContent(location);
|
|
227
241
|
};
|
|
228
|
-
const [resources, staticHtml] = await Promise.all([
|
|
242
|
+
const [{ artifacts: resources }, staticHtml] = await Promise.all([
|
|
229
243
|
this.getStaticResourcesAsync({
|
|
244
|
+
isExporting,
|
|
230
245
|
mode,
|
|
231
|
-
minify
|
|
246
|
+
minify,
|
|
247
|
+
baseUrl,
|
|
248
|
+
asyncRoutes,
|
|
249
|
+
routerRoot
|
|
232
250
|
}),
|
|
233
251
|
bundleStaticHtml(),
|
|
234
252
|
]);
|
|
235
|
-
const content =
|
|
253
|
+
const content = (0, _serializeHtml).serializeHtmlWithAssets({
|
|
236
254
|
mode,
|
|
237
255
|
resources,
|
|
238
256
|
template: staticHtml,
|
|
239
257
|
devBundleUrl: devBundleUrlPathname,
|
|
240
|
-
|
|
258
|
+
baseUrl
|
|
241
259
|
});
|
|
242
260
|
return {
|
|
243
261
|
content,
|
|
@@ -299,6 +317,7 @@ class MetroBundlerDevServer extends _bundlerDevServer.BundlerDevServer {
|
|
|
299
317
|
scheme: (_scheme = options.location.scheme) != null ? _scheme : null
|
|
300
318
|
}).getHandler());
|
|
301
319
|
middleware.use(new _reactDevToolsPageMiddleware.ReactDevToolsPageMiddleware(this.projectRoot).getHandler());
|
|
320
|
+
middleware.use(new _devToolsPluginMiddleware.DevToolsPluginMiddleware(this.projectRoot, this.devToolsPluginManager).getHandler());
|
|
302
321
|
const deepLinkMiddleware = new _runtimeRedirectMiddleware.RuntimeRedirectMiddleware(this.projectRoot, {
|
|
303
322
|
onDeepLink: getDeepLinkHandler(this.projectRoot),
|
|
304
323
|
getLocation: ({ runtime })=>{
|
|
@@ -332,25 +351,32 @@ class MetroBundlerDevServer extends _bundlerDevServer.BundlerDevServer {
|
|
|
332
351
|
middleware.use(new _faviconMiddleware.FaviconMiddleware(this.projectRoot).getHandler());
|
|
333
352
|
if (useServerRendering) {
|
|
334
353
|
var ref2;
|
|
335
|
-
const
|
|
354
|
+
const baseUrl = (0, _metroOptions).getBaseUrlFromExpoConfig(exp);
|
|
355
|
+
var _mode1;
|
|
356
|
+
const asyncRoutes = (0, _metroOptions).getAsyncRoutesFromExpoConfig(exp, (_mode1 = options.mode) != null ? _mode1 : "development", "web");
|
|
357
|
+
const routerRoot = (0, _router).getRouterDirectoryModuleIdWithManifest(this.projectRoot, exp);
|
|
358
|
+
const appDir = _path.default.join(this.projectRoot, routerRoot);
|
|
336
359
|
middleware.use((0, _createServerRouteMiddleware).createRouteHandlerMiddleware(this.projectRoot, {
|
|
337
360
|
...options,
|
|
338
361
|
appDir,
|
|
362
|
+
baseUrl,
|
|
363
|
+
routerRoot,
|
|
339
364
|
getWebBundleUrl: manifestMiddleware.getWebBundleUrl.bind(manifestMiddleware),
|
|
340
365
|
getStaticPageAsync: (pathname)=>{
|
|
341
366
|
var _mode;
|
|
342
367
|
return this.getStaticPageAsync(pathname, {
|
|
368
|
+
isExporting: !!options.isExporting,
|
|
343
369
|
mode: (_mode = options.mode) != null ? _mode : "development",
|
|
344
370
|
minify: options.minify,
|
|
345
|
-
|
|
346
|
-
|
|
371
|
+
baseUrl,
|
|
372
|
+
asyncRoutes,
|
|
373
|
+
routerRoot
|
|
347
374
|
});
|
|
348
375
|
}
|
|
349
376
|
}));
|
|
350
|
-
// @ts-expect-error: TODO
|
|
351
377
|
if (((ref2 = exp.web) == null ? void 0 : ref2.output) === "server") {
|
|
352
378
|
// Cache observation for API Routes...
|
|
353
|
-
(0, _waitForMetroToObserveTypeScriptFile).observeApiRouteChanges(
|
|
379
|
+
(0, _waitForMetroToObserveTypeScriptFile).observeApiRouteChanges(appDir, {
|
|
354
380
|
metro,
|
|
355
381
|
server
|
|
356
382
|
}, async (filepath, op)=>{
|
|
@@ -359,7 +385,8 @@ class MetroBundlerDevServer extends _bundlerDevServer.BundlerDevServer {
|
|
|
359
385
|
if (op === "change" || op === "add") {
|
|
360
386
|
(0, _bundleApiRoutes).rebundleApiRoute(this.projectRoot, filepath, {
|
|
361
387
|
...options,
|
|
362
|
-
|
|
388
|
+
routerRoot,
|
|
389
|
+
baseUrl
|
|
363
390
|
});
|
|
364
391
|
}
|
|
365
392
|
if (op === "delete") {
|
|
@@ -469,25 +496,5 @@ function getDeepLinkHandler(projectRoot) {
|
|
|
469
496
|
});
|
|
470
497
|
};
|
|
471
498
|
}
|
|
472
|
-
function htmlFromSerialAssets(assets, { dev , template , basePath , bundleUrl }) {
|
|
473
|
-
// Combine the CSS modules into tags that have hot refresh data attributes.
|
|
474
|
-
const styleString = assets.filter((asset)=>asset.type === "css"
|
|
475
|
-
).map(({ metadata , filename , source })=>{
|
|
476
|
-
if (dev) {
|
|
477
|
-
return `<style data-expo-css-hmr="${metadata.hmrId}">` + source + "\n</style>";
|
|
478
|
-
} else {
|
|
479
|
-
return [
|
|
480
|
-
`<link rel="preload" href="${basePath}/${filename}" as="style">`,
|
|
481
|
-
`<link rel="stylesheet" href="${basePath}/${filename}">`,
|
|
482
|
-
].join("");
|
|
483
|
-
}
|
|
484
|
-
}).join("");
|
|
485
|
-
const jsAssets = assets.filter((asset)=>asset.type === "js"
|
|
486
|
-
);
|
|
487
|
-
const scripts = bundleUrl ? `<script src="${bundleUrl}" defer></script>` : jsAssets.map(({ filename })=>{
|
|
488
|
-
return `<script src="${basePath}/${filename}" defer></script>`;
|
|
489
|
-
}).join("");
|
|
490
|
-
return template.replace("</head>", `${styleString}</head>`).replace("</body>", `${scripts}\n</body>`);
|
|
491
|
-
}
|
|
492
499
|
|
|
493
500
|
//# sourceMappingURL=MetroBundlerDevServer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/metro/MetroBundlerDevServer.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 { getConfig } from '@expo/config';\nimport * as runtimeEnv from '@expo/env';\nimport { SerialAsset } from '@expo/metro-config/build/serializer/serializerAssets';\nimport chalk from 'chalk';\nimport fetch from 'node-fetch';\nimport path from 'path';\n\nimport { bundleApiRoute, rebundleApiRoute } from './bundleApiRoutes';\nimport { createRouteHandlerMiddleware } from './createServerRouteMiddleware';\nimport { fetchManifest } from './fetchRouterManifest';\nimport { instantiateMetroAsync } from './instantiateMetro';\nimport { metroWatchTypeScriptFiles } from './metroWatchTypeScriptFiles';\nimport { getRouterDirectoryWithManifest, isApiRouteConvention } from './router';\nimport { observeApiRouteChanges, observeFileChanges } from './waitForMetroToObserveTypeScriptFile';\nimport { Log } from '../../../log';\nimport getDevClientProperties from '../../../utils/analytics/getDevClientProperties';\nimport { logEventAsync } from '../../../utils/analytics/rudderstackClient';\nimport { CommandError } from '../../../utils/errors';\nimport { getFreePortAsync } from '../../../utils/port';\nimport { BundlerDevServer, BundlerStartOptions, DevServerInstance } from '../BundlerDevServer';\nimport { getStaticRenderFunctions } from '../getStaticRenderFunctions';\nimport { ContextModuleSourceMapsMiddleware } from '../middleware/ContextModuleSourceMapsMiddleware';\nimport { CreateFileMiddleware } from '../middleware/CreateFileMiddleware';\nimport { FaviconMiddleware } from '../middleware/FaviconMiddleware';\nimport { HistoryFallbackMiddleware } from '../middleware/HistoryFallbackMiddleware';\nimport { InterstitialPageMiddleware } from '../middleware/InterstitialPageMiddleware';\nimport {\n createBundleUrlPath,\n resolveMainModuleName,\n shouldEnableAsyncImports,\n} from '../middleware/ManifestMiddleware';\nimport { ReactDevToolsPageMiddleware } from '../middleware/ReactDevToolsPageMiddleware';\nimport {\n DeepLinkHandler,\n RuntimeRedirectMiddleware,\n} from '../middleware/RuntimeRedirectMiddleware';\nimport { ServeStaticMiddleware } from '../middleware/ServeStaticMiddleware';\nimport { prependMiddleware } from '../middleware/mutations';\nimport { startTypescriptTypeGenerationAsync } from '../type-generation/startTypescriptTypeGeneration';\n\nexport class ForwardHtmlError extends CommandError {\n constructor(\n message: string,\n public html: string,\n public statusCode: number\n ) {\n super(message);\n }\n}\n\nconst debug = require('debug')('expo:start:server:metro') as typeof console.log;\n\n/** Default port to use for apps running in Expo Go. */\nconst EXPO_GO_METRO_PORT = 8081;\n\n/** Default port to use for apps that run in standard React Native projects or Expo Dev Clients. */\nconst DEV_CLIENT_METRO_PORT = 8081;\n\nexport class MetroBundlerDevServer extends BundlerDevServer {\n private metro: import('metro').Server | null = null;\n\n get name(): string {\n return 'metro';\n }\n\n async resolvePortAsync(options: Partial<BundlerStartOptions> = {}): Promise<number> {\n const port =\n // If the manually defined port is busy then an error should be thrown...\n options.port ??\n // Otherwise use the default port based on the runtime target.\n (options.devClient\n ? // Don't check if the port is busy if we're using the dev client since most clients are hardcoded to 8081.\n Number(process.env.RCT_METRO_PORT) || DEV_CLIENT_METRO_PORT\n : // Otherwise (running in Expo Go) use a free port that falls back on the classic 8081 port.\n await getFreePortAsync(EXPO_GO_METRO_PORT));\n\n return port;\n }\n\n async getExpoRouterRoutesManifestAsync({ appDir }: { appDir: string }) {\n const manifest = await fetchManifest(this.projectRoot, {\n asJson: true,\n appDir,\n });\n\n if (!manifest) {\n throw new CommandError(\n 'EXPO_ROUTER_SERVER_MANIFEST',\n 'Unexpected error: server manifest could not be fetched.'\n );\n }\n\n return manifest;\n }\n\n async exportExpoRouterApiRoutesAsync({\n mode,\n appDir,\n outputDir,\n }: {\n mode: 'development' | 'production';\n appDir: string;\n outputDir: string;\n }) {\n const manifest = await this.getExpoRouterRoutesManifestAsync({\n appDir,\n });\n\n const files: Map<string, string> = new Map();\n\n for (const route of manifest.apiRoutes) {\n const filepath = path.join(appDir, route.file);\n const contents = await bundleApiRoute(this.projectRoot, filepath, {\n mode,\n appDir,\n port: this.getInstance()?.location.port,\n shouldThrow: true,\n });\n const artifactFilename = path.join(\n outputDir,\n path.relative(appDir, filepath.replace(/\\.[tj]sx?$/, '.js'))\n );\n files.set(artifactFilename, contents!);\n // Remap the manifest files to represent the output files.\n route.file = artifactFilename;\n }\n\n return { manifest, files };\n }\n\n async composeResourcesWithHtml({\n mode,\n resources,\n template,\n devBundleUrl,\n basePath,\n }: {\n mode: 'development' | 'production';\n resources: SerialAsset[];\n template: string;\n /** asset prefix used for deploying to non-standard origins like GitHub pages. */\n basePath: string;\n devBundleUrl?: string;\n }): Promise<string> {\n if (!resources) {\n return '';\n }\n const isDev = mode === 'development';\n return htmlFromSerialAssets(resources, {\n dev: isDev,\n template,\n basePath,\n bundleUrl: isDev ? devBundleUrl : undefined,\n });\n }\n\n async getStaticRenderFunctionAsync({\n mode,\n minify = mode !== 'development',\n }: {\n mode: 'development' | 'production';\n minify?: boolean;\n }) {\n const url = this.getDevServerUrl()!;\n\n const { getStaticContent, getManifest } = await getStaticRenderFunctions(\n this.projectRoot,\n url,\n {\n minify,\n dev: mode !== 'production',\n // Ensure the API Routes are included\n environment: 'node',\n }\n );\n return {\n // Get routes from Expo Router.\n manifest: await getManifest({ fetchData: true, preserveApiRoutes: false }),\n // Get route generating function\n async renderAsync(path: string) {\n return await getStaticContent(new URL(path, url));\n },\n };\n }\n\n async getStaticResourcesAsync({\n mode,\n minify = mode !== 'development',\n includeMaps,\n }: {\n mode: string;\n minify?: boolean;\n includeMaps?: boolean;\n }): Promise<SerialAsset[]> {\n const devBundleUrlPathname = createBundleUrlPath({\n platform: 'web',\n mode,\n minify,\n environment: 'client',\n serializerOutput: 'static',\n serializerIncludeMaps: includeMaps,\n mainModuleName: resolveMainModuleName(this.projectRoot, { platform: 'web' }),\n lazy: shouldEnableAsyncImports(this.projectRoot),\n });\n\n const bundleUrl = new URL(devBundleUrlPathname, this.getDevServerUrl()!);\n\n // Fetch the generated HTML from our custom Metro serializer\n const results = await fetch(bundleUrl.toString());\n\n const txt = await results.text();\n\n // console.log('STAT:', results.status, results.statusText);\n let data: any;\n try {\n data = JSON.parse(txt);\n } catch (error: any) {\n debug(txt);\n\n // Metro can throw this error when the initial module id cannot be resolved.\n if (!results.ok && txt.startsWith('<!DOCTYPE html>')) {\n throw new ForwardHtmlError(\n `Metro failed to bundle the project. Check the console for more information.`,\n txt,\n results.status\n );\n }\n\n Log.error(\n 'Failed to generate resources with Metro, the Metro config may not be using the correct serializer. Ensure the metro.config.js is extending the expo/metro-config and is not overriding the serializer.'\n );\n throw error;\n }\n\n // NOTE: This could potentially need more validation in the future.\n if (Array.isArray(data)) {\n return data;\n }\n\n if (data != null && (data.errors || data.type?.match(/.*Error$/))) {\n // {\n // type: 'InternalError',\n // errors: [],\n // message: 'Metro has encountered an error: While trying to resolve module `stylis` from file `/Users/evanbacon/Documents/GitHub/lab/emotion-error-test/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js`, the package `/Users/evanbacon/Documents/GitHub/lab/emotion-error-test/node_modules/stylis/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/evanbacon/Documents/GitHub/lab/emotion-error-test/node_modules/stylis/dist/stylis.mjs`. Indeed, none of these files exist:\\n' +\n // '\\n' +\n // ' * /Users/evanbacon/Documents/GitHub/lab/emotion-error-test/node_modules/stylis/dist/stylis.mjs(.web.ts|.ts|.web.tsx|.tsx|.web.js|.js|.web.jsx|.jsx|.web.json|.json|.web.cjs|.cjs|.web.scss|.scss|.web.sass|.sass|.web.css|.css)\\n' +\n // ' * /Users/evanbacon/Documents/GitHub/lab/emotion-error-test/node_modules/stylis/dist/stylis.mjs/index(.web.ts|.ts|.web.tsx|.tsx|.web.js|.js|.web.jsx|.jsx|.web.json|.json|.web.cjs|.cjs|.web.scss|.scss|.web.sass|.sass|.web.css|.css): /Users/evanbacon/Documents/GitHub/lab/emotion-error-test/node_modules/metro/src/node-haste/DependencyGraph.js (289:17)\\n' +\n // '\\n' +\n // '\\x1B[0m \\x1B[90m 287 |\\x1B[39m }\\x1B[0m\\n' +\n // '\\x1B[0m \\x1B[90m 288 |\\x1B[39m \\x1B[36mif\\x1B[39m (error \\x1B[36minstanceof\\x1B[39m \\x1B[33mInvalidPackageError\\x1B[39m) {\\x1B[0m\\n' +\n // '\\x1B[0m\\x1B[31m\\x1B[1m>\\x1B[22m\\x1B[39m\\x1B[90m 289 |\\x1B[39m \\x1B[36mthrow\\x1B[39m \\x1B[36mnew\\x1B[39m \\x1B[33mPackageResolutionError\\x1B[39m({\\x1B[0m\\n' +\n // '\\x1B[0m \\x1B[90m |\\x1B[39m \\x1B[31m\\x1B[1m^\\x1B[22m\\x1B[39m\\x1B[0m\\n' +\n // '\\x1B[0m \\x1B[90m 290 |\\x1B[39m packageError\\x1B[33m:\\x1B[39m error\\x1B[33m,\\x1B[39m\\x1B[0m\\n' +\n // '\\x1B[0m \\x1B[90m 291 |\\x1B[39m originModulePath\\x1B[33m:\\x1B[39m \\x1B[36mfrom\\x1B[39m\\x1B[33m,\\x1B[39m\\x1B[0m\\n' +\n // '\\x1B[0m \\x1B[90m 292 |\\x1B[39m targetModuleName\\x1B[33m:\\x1B[39m to\\x1B[33m,\\x1B[39m\\x1B[0m'\n // }\n // The Metro logger already showed this error.\n throw new Error(data.message);\n }\n\n throw new Error(\n 'Invalid resources returned from the Metro serializer. Expected array, found: ' + data\n );\n }\n\n async getStaticPageAsync(\n pathname: string,\n {\n mode,\n minify = mode !== 'development',\n basePath,\n }: {\n mode: 'development' | 'production';\n minify?: boolean;\n basePath: string;\n }\n ) {\n const devBundleUrlPathname = createBundleUrlPath({\n platform: 'web',\n mode,\n environment: 'client',\n mainModuleName: resolveMainModuleName(this.projectRoot, { platform: 'web' }),\n lazy: shouldEnableAsyncImports(this.projectRoot),\n });\n\n const bundleStaticHtml = async (): Promise<string> => {\n const { getStaticContent } = await getStaticRenderFunctions(\n this.projectRoot,\n this.getDevServerUrl()!,\n {\n minify: false,\n dev: mode !== 'production',\n // Ensure the API Routes are included\n environment: 'node',\n }\n );\n\n const location = new URL(pathname, this.getDevServerUrl()!);\n return await getStaticContent(location);\n };\n\n const [resources, staticHtml] = await Promise.all([\n this.getStaticResourcesAsync({ mode, minify }),\n bundleStaticHtml(),\n ]);\n const content = await this.composeResourcesWithHtml({\n mode,\n resources,\n template: staticHtml,\n devBundleUrl: devBundleUrlPathname,\n basePath,\n });\n return {\n content,\n resources,\n };\n }\n\n async watchEnvironmentVariables() {\n if (!this.instance) {\n throw new Error(\n 'Cannot observe environment variable changes without a running Metro instance.'\n );\n }\n if (!this.metro) {\n // This can happen when the run command is used and the server is already running in another\n // process.\n debug('Skipping Environment Variable observation because Metro is not running (headless).');\n return;\n }\n\n const envFiles = runtimeEnv\n .getFiles(process.env.NODE_ENV)\n .map((fileName) => path.join(this.projectRoot, fileName));\n\n observeFileChanges(\n {\n metro: this.metro,\n server: this.instance.server,\n },\n envFiles,\n () => {\n debug('Reloading environment variables...');\n // Force reload the environment variables.\n runtimeEnv.load(this.projectRoot, { force: true });\n }\n );\n }\n\n protected async startImplementationAsync(\n options: BundlerStartOptions\n ): Promise<DevServerInstance> {\n options.port = await this.resolvePortAsync(options);\n this.urlCreator = this.getUrlCreator(options);\n\n const parsedOptions = {\n port: options.port,\n maxWorkers: options.maxWorkers,\n resetCache: options.resetDevServer,\n\n // Use the unversioned metro config.\n // TODO: Deprecate this property when expo-cli goes away.\n unversioned: false,\n };\n\n // Required for symbolication:\n process.env.EXPO_DEV_SERVER_ORIGIN = `http://localhost:${options.port}`;\n\n const { metro, server, middleware, messageSocket } = await instantiateMetroAsync(\n this,\n parsedOptions,\n {\n isExporting: !!options.isExporting,\n }\n );\n\n const manifestMiddleware = await this.getManifestMiddlewareAsync(options);\n\n // Important that we noop source maps for context modules as soon as possible.\n prependMiddleware(middleware, new ContextModuleSourceMapsMiddleware().getHandler());\n\n // We need the manifest handler to be the first middleware to run so our\n // routes take precedence over static files. For example, the manifest is\n // served from '/' and if the user has an index.html file in their project\n // then the manifest handler will never run, the static middleware will run\n // and serve index.html instead of the manifest.\n // https://github.com/expo/expo/issues/13114\n prependMiddleware(middleware, manifestMiddleware.getHandler());\n\n middleware.use(\n new InterstitialPageMiddleware(this.projectRoot, {\n // TODO: Prevent this from becoming stale.\n scheme: options.location.scheme ?? null,\n }).getHandler()\n );\n middleware.use(new ReactDevToolsPageMiddleware(this.projectRoot).getHandler());\n\n const deepLinkMiddleware = new RuntimeRedirectMiddleware(this.projectRoot, {\n onDeepLink: getDeepLinkHandler(this.projectRoot),\n getLocation: ({ runtime }) => {\n if (runtime === 'custom') {\n return this.urlCreator?.constructDevClientUrl();\n } else {\n return this.urlCreator?.constructUrl({\n scheme: 'exp',\n });\n }\n },\n });\n middleware.use(deepLinkMiddleware.getHandler());\n\n middleware.use(new CreateFileMiddleware(this.projectRoot).getHandler());\n\n // Append support for redirecting unhandled requests to the index.html page on web.\n if (this.isTargetingWeb()) {\n const { exp } = getConfig(this.projectRoot, { skipSDKVersionRequirement: true });\n const useServerRendering = ['static', 'server'].includes(exp.web?.output ?? '');\n\n // This MUST be after the manifest middleware so it doesn't have a chance to serve the template `public/index.html`.\n middleware.use(new ServeStaticMiddleware(this.projectRoot).getHandler());\n\n // This should come after the static middleware so it doesn't serve the favicon from `public/favicon.ico`.\n middleware.use(new FaviconMiddleware(this.projectRoot).getHandler());\n\n if (useServerRendering) {\n const appDir = getRouterDirectoryWithManifest(this.projectRoot, exp);\n middleware.use(\n createRouteHandlerMiddleware(this.projectRoot, {\n ...options,\n appDir,\n getWebBundleUrl: manifestMiddleware.getWebBundleUrl.bind(manifestMiddleware),\n getStaticPageAsync: (pathname) => {\n return this.getStaticPageAsync(pathname, {\n mode: options.mode ?? 'development',\n minify: options.minify,\n // No base path in development\n basePath: '',\n });\n },\n })\n );\n\n // @ts-expect-error: TODO\n if (exp.web?.output === 'server') {\n // Cache observation for API Routes...\n observeApiRouteChanges(\n this.projectRoot,\n {\n metro,\n server,\n },\n async (filepath, op) => {\n if (isApiRouteConvention(filepath)) {\n debug(`[expo-cli] ${op} ${filepath}`);\n if (op === 'change' || op === 'add') {\n rebundleApiRoute(this.projectRoot, filepath, {\n ...options,\n appDir,\n });\n }\n\n if (op === 'delete') {\n // TODO: Cancel the bundling of the deleted route.\n }\n }\n }\n );\n }\n } else {\n // This MUST run last since it's the fallback.\n middleware.use(\n new HistoryFallbackMiddleware(manifestMiddleware.getHandler().internal).getHandler()\n );\n }\n }\n // Extend the close method to ensure that we clean up the local info.\n const originalClose = server.close.bind(server);\n\n server.close = (callback?: (err?: Error) => void) => {\n return originalClose((err?: Error) => {\n this.instance = null;\n this.metro = null;\n callback?.(err);\n });\n };\n\n this.metro = metro;\n return {\n server,\n location: {\n // The port is the main thing we want to send back.\n port: options.port,\n // localhost isn't always correct.\n host: 'localhost',\n // http is the only supported protocol on native.\n url: `http://localhost:${options.port}`,\n protocol: 'http',\n },\n middleware,\n messageSocket,\n };\n }\n\n public async waitForTypeScriptAsync(): Promise<boolean> {\n if (!this.instance) {\n throw new Error('Cannot wait for TypeScript without a running server.');\n }\n\n return new Promise<boolean>((resolve) => {\n if (!this.metro) {\n // This can happen when the run command is used and the server is already running in another\n // process. In this case we can't wait for the TypeScript check to complete because we don't\n // have access to the Metro server.\n debug('Skipping TypeScript check because Metro is not running (headless).');\n return resolve(false);\n }\n\n const off = metroWatchTypeScriptFiles({\n projectRoot: this.projectRoot,\n server: this.instance!.server,\n metro: this.metro,\n tsconfig: true,\n throttle: true,\n eventTypes: ['change', 'add'],\n callback: async () => {\n // Run once, this prevents the TypeScript project prerequisite from running on every file change.\n off();\n const { TypeScriptProjectPrerequisite } = await import(\n '../../doctor/typescript/TypeScriptProjectPrerequisite.js'\n );\n\n try {\n const req = new TypeScriptProjectPrerequisite(this.projectRoot);\n await req.bootstrapAsync();\n resolve(true);\n } catch (error: any) {\n // Ensure the process doesn't fail if the TypeScript check fails.\n // This could happen during the install.\n Log.log();\n Log.error(\n chalk.red`Failed to automatically setup TypeScript for your project. Try restarting the dev server to fix.`\n );\n Log.exception(error);\n resolve(false);\n }\n },\n });\n });\n }\n\n public async startTypeScriptServices() {\n return startTypescriptTypeGenerationAsync({\n server: this.instance?.server,\n metro: this.metro,\n projectRoot: this.projectRoot,\n });\n }\n\n protected getConfigModuleIds(): string[] {\n return ['./metro.config.js', './metro.config.json', './rn-cli.config.js'];\n }\n}\n\nexport function getDeepLinkHandler(projectRoot: string): DeepLinkHandler {\n return async ({ runtime }) => {\n if (runtime === 'expo') return;\n const { exp } = getConfig(projectRoot);\n await logEventAsync('dev client start command', {\n status: 'started',\n ...getDevClientProperties(projectRoot, exp),\n });\n };\n}\n\nfunction htmlFromSerialAssets(\n assets: SerialAsset[],\n {\n dev,\n template,\n basePath,\n bundleUrl,\n }: {\n dev: boolean;\n template: string;\n basePath: string;\n /** This is dev-only. */\n bundleUrl?: string;\n }\n) {\n // Combine the CSS modules into tags that have hot refresh data attributes.\n const styleString = assets\n .filter((asset) => asset.type === 'css')\n .map(({ metadata, filename, source }) => {\n if (dev) {\n return `<style data-expo-css-hmr=\"${metadata.hmrId}\">` + source + '\\n</style>';\n } else {\n return [\n `<link rel=\"preload\" href=\"${basePath}/${filename}\" as=\"style\">`,\n `<link rel=\"stylesheet\" href=\"${basePath}/${filename}\">`,\n ].join('');\n }\n })\n .join('');\n\n const jsAssets = assets.filter((asset) => asset.type === 'js');\n\n const scripts = bundleUrl\n ? `<script src=\"${bundleUrl}\" defer></script>`\n : jsAssets\n .map(({ filename }) => {\n return `<script src=\"${basePath}/${filename}\" defer></script>`;\n })\n .join('');\n\n return template\n .replace('</head>', `${styleString}</head>`)\n .replace('</body>', `${scripts}\\n</body>`);\n}\n"],"names":["getDeepLinkHandler","runtimeEnv","ForwardHtmlError","CommandError","constructor","message","html","statusCode","debug","require","EXPO_GO_METRO_PORT","DEV_CLIENT_METRO_PORT","MetroBundlerDevServer","BundlerDevServer","metro","name","resolvePortAsync","options","port","devClient","Number","process","env","RCT_METRO_PORT","getFreePortAsync","getExpoRouterRoutesManifestAsync","appDir","manifest","fetchManifest","projectRoot","asJson","exportExpoRouterApiRoutesAsync","mode","outputDir","files","Map","route","apiRoutes","filepath","path","join","file","contents","bundleApiRoute","getInstance","location","shouldThrow","artifactFilename","relative","replace","set","composeResourcesWithHtml","resources","template","devBundleUrl","basePath","isDev","htmlFromSerialAssets","dev","bundleUrl","undefined","getStaticRenderFunctionAsync","minify","url","getDevServerUrl","getStaticContent","getManifest","getStaticRenderFunctions","environment","fetchData","preserveApiRoutes","renderAsync","URL","getStaticResourcesAsync","includeMaps","data","devBundleUrlPathname","createBundleUrlPath","platform","serializerOutput","serializerIncludeMaps","mainModuleName","resolveMainModuleName","lazy","shouldEnableAsyncImports","results","fetch","toString","txt","text","JSON","parse","error","ok","startsWith","status","Log","Array","isArray","errors","type","match","Error","getStaticPageAsync","pathname","bundleStaticHtml","staticHtml","Promise","all","content","watchEnvironmentVariables","instance","envFiles","getFiles","NODE_ENV","map","fileName","observeFileChanges","server","load","force","startImplementationAsync","urlCreator","getUrlCreator","parsedOptions","maxWorkers","resetCache","resetDevServer","unversioned","EXPO_DEV_SERVER_ORIGIN","middleware","messageSocket","instantiateMetroAsync","isExporting","manifestMiddleware","getManifestMiddlewareAsync","prependMiddleware","ContextModuleSourceMapsMiddleware","getHandler","use","InterstitialPageMiddleware","scheme","ReactDevToolsPageMiddleware","deepLinkMiddleware","RuntimeRedirectMiddleware","onDeepLink","getLocation","runtime","constructDevClientUrl","constructUrl","CreateFileMiddleware","isTargetingWeb","exp","getConfig","skipSDKVersionRequirement","useServerRendering","includes","web","output","ServeStaticMiddleware","FaviconMiddleware","getRouterDirectoryWithManifest","createRouteHandlerMiddleware","getWebBundleUrl","bind","observeApiRouteChanges","op","isApiRouteConvention","rebundleApiRoute","HistoryFallbackMiddleware","internal","originalClose","close","callback","err","host","protocol","waitForTypeScriptAsync","resolve","off","metroWatchTypeScriptFiles","tsconfig","throttle","eventTypes","TypeScriptProjectPrerequisite","req","bootstrapAsync","log","chalk","red","exception","startTypeScriptServices","startTypescriptTypeGenerationAsync","getConfigModuleIds","logEventAsync","getDevClientProperties","assets","styleString","filter","asset","metadata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E,CAAC,CACDjK,IAAI,CAAC,EAAE,CAAC,AAAC;IAEhB,OAAOa,QAAQ,CACZJ,OAAO,CAAC,SAAS,EAAE,CAAC,EAAEoJ,WAAW,CAAC,OAAO,CAAC,CAAC,CAC3CpJ,OAAO,CAAC,SAAS,EAAE,CAAC,EAAE4J,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;CAC9C"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/metro/MetroBundlerDevServer.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 { getConfig } from '@expo/config';\nimport * as runtimeEnv from '@expo/env';\nimport { SerialAsset } from '@expo/metro-config/build/serializer/serializerAssets';\nimport chalk from 'chalk';\nimport { AssetData } from 'metro';\nimport fetch from 'node-fetch';\nimport path from 'path';\n\nimport { bundleApiRoute, rebundleApiRoute } from './bundleApiRoutes';\nimport { createRouteHandlerMiddleware } from './createServerRouteMiddleware';\nimport { ExpoRouterServerManifestV1, fetchManifest } from './fetchRouterManifest';\nimport { instantiateMetroAsync } from './instantiateMetro';\nimport { metroWatchTypeScriptFiles } from './metroWatchTypeScriptFiles';\nimport { getRouterDirectoryModuleIdWithManifest, isApiRouteConvention } from './router';\nimport { serializeHtmlWithAssets } from './serializeHtml';\nimport { observeApiRouteChanges, observeFileChanges } from './waitForMetroToObserveTypeScriptFile';\nimport { ExportAssetMap } from '../../../export/saveAssets';\nimport { Log } from '../../../log';\nimport getDevClientProperties from '../../../utils/analytics/getDevClientProperties';\nimport { logEventAsync } from '../../../utils/analytics/rudderstackClient';\nimport { CommandError } from '../../../utils/errors';\nimport { getFreePortAsync } from '../../../utils/port';\nimport { BundlerDevServer, BundlerStartOptions, DevServerInstance } from '../BundlerDevServer';\nimport { getStaticRenderFunctions } from '../getStaticRenderFunctions';\nimport { ContextModuleSourceMapsMiddleware } from '../middleware/ContextModuleSourceMapsMiddleware';\nimport { CreateFileMiddleware } from '../middleware/CreateFileMiddleware';\nimport { DevToolsPluginMiddleware } from '../middleware/DevToolsPluginMiddleware';\nimport { FaviconMiddleware } from '../middleware/FaviconMiddleware';\nimport { HistoryFallbackMiddleware } from '../middleware/HistoryFallbackMiddleware';\nimport { InterstitialPageMiddleware } from '../middleware/InterstitialPageMiddleware';\nimport { resolveMainModuleName } from '../middleware/ManifestMiddleware';\nimport { ReactDevToolsPageMiddleware } from '../middleware/ReactDevToolsPageMiddleware';\nimport {\n DeepLinkHandler,\n RuntimeRedirectMiddleware,\n} from '../middleware/RuntimeRedirectMiddleware';\nimport { ServeStaticMiddleware } from '../middleware/ServeStaticMiddleware';\nimport {\n shouldEnableAsyncImports,\n createBundleUrlPath,\n getBaseUrlFromExpoConfig,\n getAsyncRoutesFromExpoConfig,\n} from '../middleware/metroOptions';\nimport { prependMiddleware } from '../middleware/mutations';\nimport { startTypescriptTypeGenerationAsync } from '../type-generation/startTypescriptTypeGeneration';\n\nexport type ExpoRouterRuntimeManifest = Awaited<\n ReturnType<typeof import('expo-router/build/static/renderStaticContent').getManifest>\n>;\n\nexport class ForwardHtmlError extends CommandError {\n constructor(\n message: string,\n public html: string,\n public statusCode: number\n ) {\n super(message);\n }\n}\n\nconst debug = require('debug')('expo:start:server:metro') as typeof console.log;\n\n/** Default port to use for apps running in Expo Go. */\nconst EXPO_GO_METRO_PORT = 8081;\n\n/** Default port to use for apps that run in standard React Native projects or Expo Dev Clients. */\nconst DEV_CLIENT_METRO_PORT = 8081;\n\nexport class MetroBundlerDevServer extends BundlerDevServer {\n private metro: import('metro').Server | null = null;\n\n get name(): string {\n return 'metro';\n }\n\n async resolvePortAsync(options: Partial<BundlerStartOptions> = {}): Promise<number> {\n const port =\n // If the manually defined port is busy then an error should be thrown...\n options.port ??\n // Otherwise use the default port based on the runtime target.\n (options.devClient\n ? // Don't check if the port is busy if we're using the dev client since most clients are hardcoded to 8081.\n Number(process.env.RCT_METRO_PORT) || DEV_CLIENT_METRO_PORT\n : // Otherwise (running in Expo Go) use a free port that falls back on the classic 8081 port.\n await getFreePortAsync(EXPO_GO_METRO_PORT));\n\n return port;\n }\n\n async exportExpoRouterApiRoutesAsync({\n mode,\n outputDir,\n prerenderManifest,\n baseUrl,\n routerRoot,\n }: {\n mode: 'development' | 'production';\n outputDir: string;\n // This does not contain the API routes info.\n prerenderManifest: ExpoRouterServerManifestV1;\n baseUrl: string;\n routerRoot: string;\n }): Promise<{ files: ExportAssetMap; manifest: ExpoRouterServerManifestV1<string> }> {\n const appDir = path.join(this.projectRoot, routerRoot);\n const manifest = await this.getExpoRouterRoutesManifestAsync({ appDir });\n\n const files: ExportAssetMap = new Map();\n\n for (const route of manifest.apiRoutes) {\n const filepath = path.join(appDir, route.file);\n const contents = await bundleApiRoute(this.projectRoot, filepath, {\n mode,\n routerRoot,\n port: this.getInstance()?.location.port,\n shouldThrow: true,\n baseUrl,\n });\n const artifactFilename = path.join(\n outputDir,\n path.relative(appDir, filepath.replace(/\\.[tj]sx?$/, '.js'))\n );\n if (contents) {\n files.set(artifactFilename, {\n contents,\n targetDomain: 'server',\n });\n }\n // Remap the manifest files to represent the output files.\n route.file = artifactFilename;\n }\n\n return {\n manifest: {\n ...manifest,\n htmlRoutes: prerenderManifest.htmlRoutes,\n },\n files,\n };\n }\n\n async getExpoRouterRoutesManifestAsync({ appDir }: { appDir: string }) {\n // getBuiltTimeServerManifest\n const manifest = await fetchManifest(this.projectRoot, {\n asJson: true,\n appDir,\n });\n\n if (!manifest) {\n throw new CommandError(\n 'EXPO_ROUTER_SERVER_MANIFEST',\n 'Unexpected error: server manifest could not be fetched.'\n );\n }\n\n return manifest;\n }\n\n async getStaticRenderFunctionAsync({\n mode,\n minify = mode !== 'development',\n baseUrl,\n routerRoot,\n }: {\n mode: 'development' | 'production';\n minify?: boolean;\n baseUrl: string;\n routerRoot: string;\n }): Promise<{\n serverManifest: ExpoRouterServerManifestV1;\n manifest: ExpoRouterRuntimeManifest;\n renderAsync: (path: string) => Promise<string>;\n }> {\n const url = this.getDevServerUrl()!;\n\n const { getStaticContent, getManifest, getBuildTimeServerManifestAsync } =\n await getStaticRenderFunctions(this.projectRoot, url, {\n minify,\n dev: mode !== 'production',\n // Ensure the API Routes are included\n environment: 'node',\n baseUrl,\n routerRoot,\n });\n\n return {\n serverManifest: await getBuildTimeServerManifestAsync(),\n // Get routes from Expo Router.\n manifest: await getManifest({ fetchData: true, preserveApiRoutes: false }),\n // Get route generating function\n async renderAsync(path: string) {\n return await getStaticContent(new URL(path, url));\n },\n };\n }\n\n async getStaticResourcesAsync({\n mode,\n minify = mode !== 'development',\n includeSourceMaps,\n baseUrl,\n mainModuleName,\n isExporting,\n asyncRoutes,\n routerRoot,\n }: {\n isExporting: boolean;\n mode: string;\n minify?: boolean;\n includeSourceMaps?: boolean;\n baseUrl?: string;\n mainModuleName?: string;\n asyncRoutes: boolean;\n routerRoot: string;\n }): Promise<{ artifacts: SerialAsset[]; assets?: AssetData[] }> {\n const devBundleUrlPathname = createBundleUrlPath({\n platform: 'web',\n mode,\n minify,\n environment: 'client',\n serializerOutput: 'static',\n serializerIncludeMaps: includeSourceMaps,\n mainModuleName:\n mainModuleName ?? resolveMainModuleName(this.projectRoot, { platform: 'web' }),\n lazy: shouldEnableAsyncImports(this.projectRoot),\n asyncRoutes,\n baseUrl,\n isExporting,\n routerRoot,\n });\n\n const bundleUrl = new URL(devBundleUrlPathname, this.getDevServerUrl()!);\n\n // Fetch the generated HTML from our custom Metro serializer\n const results = await fetch(bundleUrl.toString());\n\n const txt = await results.text();\n\n let data: any;\n try {\n data = JSON.parse(txt);\n } catch (error: any) {\n debug(txt);\n\n // Metro can throw this error when the initial module id cannot be resolved.\n if (!results.ok && txt.startsWith('<!DOCTYPE html>')) {\n throw new ForwardHtmlError(\n `Metro failed to bundle the project. Check the console for more information.`,\n txt,\n results.status\n );\n }\n\n Log.error(\n 'Failed to generate resources with Metro, the Metro config may not be using the correct serializer. Ensure the metro.config.js is extending the expo/metro-config and is not overriding the serializer.'\n );\n throw error;\n }\n\n // NOTE: This could potentially need more validation in the future.\n if ('artifacts' in data && Array.isArray(data.artifacts)) {\n return data;\n }\n\n if (data != null && (data.errors || data.type?.match(/.*Error$/))) {\n // {\n // type: 'InternalError',\n // errors: [],\n // message: 'Metro has encountered an error: While trying to resolve module `stylis` from file `/Users/evanbacon/Documents/GitHub/lab/emotion-error-test/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js`, the package `/Users/evanbacon/Documents/GitHub/lab/emotion-error-test/node_modules/stylis/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/evanbacon/Documents/GitHub/lab/emotion-error-test/node_modules/stylis/dist/stylis.mjs`. Indeed, none of these files exist:\\n' +\n // '\\n' +\n // ' * /Users/evanbacon/Documents/GitHub/lab/emotion-error-test/node_modules/stylis/dist/stylis.mjs(.web.ts|.ts|.web.tsx|.tsx|.web.js|.js|.web.jsx|.jsx|.web.json|.json|.web.cjs|.cjs|.web.scss|.scss|.web.sass|.sass|.web.css|.css)\\n' +\n // ' * /Users/evanbacon/Documents/GitHub/lab/emotion-error-test/node_modules/stylis/dist/stylis.mjs/index(.web.ts|.ts|.web.tsx|.tsx|.web.js|.js|.web.jsx|.jsx|.web.json|.json|.web.cjs|.cjs|.web.scss|.scss|.web.sass|.sass|.web.css|.css): /Users/evanbacon/Documents/GitHub/lab/emotion-error-test/node_modules/metro/src/node-haste/DependencyGraph.js (289:17)\\n' +\n // '\\n' +\n // '\\x1B[0m \\x1B[90m 287 |\\x1B[39m }\\x1B[0m\\n' +\n // '\\x1B[0m \\x1B[90m 288 |\\x1B[39m \\x1B[36mif\\x1B[39m (error \\x1B[36minstanceof\\x1B[39m \\x1B[33mInvalidPackageError\\x1B[39m) {\\x1B[0m\\n' +\n // '\\x1B[0m\\x1B[31m\\x1B[1m>\\x1B[22m\\x1B[39m\\x1B[90m 289 |\\x1B[39m \\x1B[36mthrow\\x1B[39m \\x1B[36mnew\\x1B[39m \\x1B[33mPackageResolutionError\\x1B[39m({\\x1B[0m\\n' +\n // '\\x1B[0m \\x1B[90m |\\x1B[39m \\x1B[31m\\x1B[1m^\\x1B[22m\\x1B[39m\\x1B[0m\\n' +\n // '\\x1B[0m \\x1B[90m 290 |\\x1B[39m packageError\\x1B[33m:\\x1B[39m error\\x1B[33m,\\x1B[39m\\x1B[0m\\n' +\n // '\\x1B[0m \\x1B[90m 291 |\\x1B[39m originModulePath\\x1B[33m:\\x1B[39m \\x1B[36mfrom\\x1B[39m\\x1B[33m,\\x1B[39m\\x1B[0m\\n' +\n // '\\x1B[0m \\x1B[90m 292 |\\x1B[39m targetModuleName\\x1B[33m:\\x1B[39m to\\x1B[33m,\\x1B[39m\\x1B[0m'\n // }\n // The Metro logger already showed this error.\n throw new Error(data.message);\n }\n\n throw new Error(\n 'Invalid resources returned from the Metro serializer. Expected array, found: ' + data\n );\n }\n\n private async getStaticPageAsync(\n pathname: string,\n {\n mode,\n minify = mode !== 'development',\n baseUrl,\n routerRoot,\n isExporting,\n asyncRoutes,\n }: {\n isExporting: boolean;\n mode: 'development' | 'production';\n minify?: boolean;\n baseUrl: string;\n asyncRoutes: boolean;\n routerRoot: string;\n }\n ) {\n const devBundleUrlPathname = createBundleUrlPath({\n platform: 'web',\n mode,\n environment: 'client',\n mainModuleName: resolveMainModuleName(this.projectRoot, { platform: 'web' }),\n lazy: shouldEnableAsyncImports(this.projectRoot),\n baseUrl,\n isExporting,\n asyncRoutes,\n routerRoot,\n });\n\n const bundleStaticHtml = async (): Promise<string> => {\n const { getStaticContent } = await getStaticRenderFunctions(\n this.projectRoot,\n this.getDevServerUrl()!,\n {\n minify: false,\n dev: mode !== 'production',\n // Ensure the API Routes are included\n environment: 'node',\n baseUrl,\n routerRoot,\n }\n );\n\n const location = new URL(pathname, this.getDevServerUrl()!);\n return await getStaticContent(location);\n };\n\n const [{ artifacts: resources }, staticHtml] = await Promise.all([\n this.getStaticResourcesAsync({ isExporting, mode, minify, baseUrl, asyncRoutes, routerRoot }),\n bundleStaticHtml(),\n ]);\n const content = serializeHtmlWithAssets({\n mode,\n resources,\n template: staticHtml,\n devBundleUrl: devBundleUrlPathname,\n baseUrl,\n });\n return {\n content,\n resources,\n };\n }\n\n async watchEnvironmentVariables() {\n if (!this.instance) {\n throw new Error(\n 'Cannot observe environment variable changes without a running Metro instance.'\n );\n }\n if (!this.metro) {\n // This can happen when the run command is used and the server is already running in another\n // process.\n debug('Skipping Environment Variable observation because Metro is not running (headless).');\n return;\n }\n\n const envFiles = runtimeEnv\n .getFiles(process.env.NODE_ENV)\n .map((fileName) => path.join(this.projectRoot, fileName));\n\n observeFileChanges(\n {\n metro: this.metro,\n server: this.instance.server,\n },\n envFiles,\n () => {\n debug('Reloading environment variables...');\n // Force reload the environment variables.\n runtimeEnv.load(this.projectRoot, { force: true });\n }\n );\n }\n\n protected async startImplementationAsync(\n options: BundlerStartOptions\n ): Promise<DevServerInstance> {\n options.port = await this.resolvePortAsync(options);\n this.urlCreator = this.getUrlCreator(options);\n\n const parsedOptions = {\n port: options.port,\n maxWorkers: options.maxWorkers,\n resetCache: options.resetDevServer,\n\n // Use the unversioned metro config.\n // TODO: Deprecate this property when expo-cli goes away.\n unversioned: false,\n };\n\n // Required for symbolication:\n process.env.EXPO_DEV_SERVER_ORIGIN = `http://localhost:${options.port}`;\n\n const { metro, server, middleware, messageSocket } = await instantiateMetroAsync(\n this,\n parsedOptions,\n {\n isExporting: !!options.isExporting,\n }\n );\n\n const manifestMiddleware = await this.getManifestMiddlewareAsync(options);\n\n // Important that we noop source maps for context modules as soon as possible.\n prependMiddleware(middleware, new ContextModuleSourceMapsMiddleware().getHandler());\n\n // We need the manifest handler to be the first middleware to run so our\n // routes take precedence over static files. For example, the manifest is\n // served from '/' and if the user has an index.html file in their project\n // then the manifest handler will never run, the static middleware will run\n // and serve index.html instead of the manifest.\n // https://github.com/expo/expo/issues/13114\n prependMiddleware(middleware, manifestMiddleware.getHandler());\n\n middleware.use(\n new InterstitialPageMiddleware(this.projectRoot, {\n // TODO: Prevent this from becoming stale.\n scheme: options.location.scheme ?? null,\n }).getHandler()\n );\n middleware.use(new ReactDevToolsPageMiddleware(this.projectRoot).getHandler());\n middleware.use(\n new DevToolsPluginMiddleware(this.projectRoot, this.devToolsPluginManager).getHandler()\n );\n\n const deepLinkMiddleware = new RuntimeRedirectMiddleware(this.projectRoot, {\n onDeepLink: getDeepLinkHandler(this.projectRoot),\n getLocation: ({ runtime }) => {\n if (runtime === 'custom') {\n return this.urlCreator?.constructDevClientUrl();\n } else {\n return this.urlCreator?.constructUrl({\n scheme: 'exp',\n });\n }\n },\n });\n middleware.use(deepLinkMiddleware.getHandler());\n\n middleware.use(new CreateFileMiddleware(this.projectRoot).getHandler());\n\n // Append support for redirecting unhandled requests to the index.html page on web.\n if (this.isTargetingWeb()) {\n const { exp } = getConfig(this.projectRoot, { skipSDKVersionRequirement: true });\n const useServerRendering = ['static', 'server'].includes(exp.web?.output ?? '');\n\n // This MUST be after the manifest middleware so it doesn't have a chance to serve the template `public/index.html`.\n middleware.use(new ServeStaticMiddleware(this.projectRoot).getHandler());\n\n // This should come after the static middleware so it doesn't serve the favicon from `public/favicon.ico`.\n middleware.use(new FaviconMiddleware(this.projectRoot).getHandler());\n\n if (useServerRendering) {\n const baseUrl = getBaseUrlFromExpoConfig(exp);\n const asyncRoutes = getAsyncRoutesFromExpoConfig(exp, options.mode ?? 'development', 'web');\n const routerRoot = getRouterDirectoryModuleIdWithManifest(this.projectRoot, exp);\n const appDir = path.join(this.projectRoot, routerRoot);\n middleware.use(\n createRouteHandlerMiddleware(this.projectRoot, {\n ...options,\n appDir,\n baseUrl,\n routerRoot,\n getWebBundleUrl: manifestMiddleware.getWebBundleUrl.bind(manifestMiddleware),\n getStaticPageAsync: (pathname) => {\n return this.getStaticPageAsync(pathname, {\n isExporting: !!options.isExporting,\n mode: options.mode ?? 'development',\n minify: options.minify,\n baseUrl,\n asyncRoutes,\n routerRoot,\n });\n },\n })\n );\n\n if (exp.web?.output === 'server') {\n // Cache observation for API Routes...\n observeApiRouteChanges(\n appDir,\n {\n metro,\n server,\n },\n async (filepath, op) => {\n if (isApiRouteConvention(filepath)) {\n debug(`[expo-cli] ${op} ${filepath}`);\n if (op === 'change' || op === 'add') {\n rebundleApiRoute(this.projectRoot, filepath, {\n ...options,\n routerRoot,\n baseUrl,\n });\n }\n\n if (op === 'delete') {\n // TODO: Cancel the bundling of the deleted route.\n }\n }\n }\n );\n }\n } else {\n // This MUST run last since it's the fallback.\n middleware.use(\n new HistoryFallbackMiddleware(manifestMiddleware.getHandler().internal).getHandler()\n );\n }\n }\n // Extend the close method to ensure that we clean up the local info.\n const originalClose = server.close.bind(server);\n\n server.close = (callback?: (err?: Error) => void) => {\n return originalClose((err?: Error) => {\n this.instance = null;\n this.metro = null;\n callback?.(err);\n });\n };\n\n this.metro = metro;\n return {\n server,\n location: {\n // The port is the main thing we want to send back.\n port: options.port,\n // localhost isn't always correct.\n host: 'localhost',\n // http is the only supported protocol on native.\n url: `http://localhost:${options.port}`,\n protocol: 'http',\n },\n middleware,\n messageSocket,\n };\n }\n\n public async waitForTypeScriptAsync(): Promise<boolean> {\n if (!this.instance) {\n throw new Error('Cannot wait for TypeScript without a running server.');\n }\n\n return new Promise<boolean>((resolve) => {\n if (!this.metro) {\n // This can happen when the run command is used and the server is already running in another\n // process. In this case we can't wait for the TypeScript check to complete because we don't\n // have access to the Metro server.\n debug('Skipping TypeScript check because Metro is not running (headless).');\n return resolve(false);\n }\n\n const off = metroWatchTypeScriptFiles({\n projectRoot: this.projectRoot,\n server: this.instance!.server,\n metro: this.metro,\n tsconfig: true,\n throttle: true,\n eventTypes: ['change', 'add'],\n callback: async () => {\n // Run once, this prevents the TypeScript project prerequisite from running on every file change.\n off();\n const { TypeScriptProjectPrerequisite } = await import(\n '../../doctor/typescript/TypeScriptProjectPrerequisite.js'\n );\n\n try {\n const req = new TypeScriptProjectPrerequisite(this.projectRoot);\n await req.bootstrapAsync();\n resolve(true);\n } catch (error: any) {\n // Ensure the process doesn't fail if the TypeScript check fails.\n // This could happen during the install.\n Log.log();\n Log.error(\n chalk.red`Failed to automatically setup TypeScript for your project. Try restarting the dev server to fix.`\n );\n Log.exception(error);\n resolve(false);\n }\n },\n });\n });\n }\n\n public async startTypeScriptServices() {\n return startTypescriptTypeGenerationAsync({\n server: this.instance?.server,\n metro: this.metro,\n projectRoot: this.projectRoot,\n });\n }\n\n protected getConfigModuleIds(): string[] {\n return ['./metro.config.js', './metro.config.json', './rn-cli.config.js'];\n }\n}\n\nexport function getDeepLinkHandler(projectRoot: string): DeepLinkHandler {\n return async ({ runtime }) => {\n if (runtime === 'expo') return;\n const { exp } = getConfig(projectRoot);\n await logEventAsync('dev client start command', {\n status: 'started',\n ...getDevClientProperties(projectRoot, exp),\n });\n };\n}\n"],"names":["getDeepLinkHandler","runtimeEnv","ForwardHtmlError","CommandError","constructor","message","html","statusCode","debug","require","EXPO_GO_METRO_PORT","DEV_CLIENT_METRO_PORT","MetroBundlerDevServer","BundlerDevServer","metro","name","resolvePortAsync","options","port","devClient","Number","process","env","RCT_METRO_PORT","getFreePortAsync","exportExpoRouterApiRoutesAsync","mode","outputDir","prerenderManifest","baseUrl","routerRoot","appDir","path","join","projectRoot","manifest","getExpoRouterRoutesManifestAsync","files","Map","route","apiRoutes","filepath","file","contents","bundleApiRoute","getInstance","location","shouldThrow","artifactFilename","relative","replace","set","targetDomain","htmlRoutes","fetchManifest","asJson","getStaticRenderFunctionAsync","minify","url","getDevServerUrl","getStaticContent","getManifest","getBuildTimeServerManifestAsync","getStaticRenderFunctions","dev","environment","serverManifest","fetchData","preserveApiRoutes","renderAsync","URL","getStaticResourcesAsync","includeSourceMaps","mainModuleName","isExporting","asyncRoutes","data","devBundleUrlPathname","createBundleUrlPath","platform","serializerOutput","serializerIncludeMaps","resolveMainModuleName","lazy","shouldEnableAsyncImports","bundleUrl","results","fetch","toString","txt","text","JSON","parse","error","ok","startsWith","status","Log","Array","isArray","artifacts","errors","type","match","Error","getStaticPageAsync","pathname","bundleStaticHtml","resources","staticHtml","Promise","all","content","serializeHtmlWithAssets","template","devBundleUrl","watchEnvironmentVariables","instance","envFiles","getFiles","NODE_ENV","map","fileName","observeFileChanges","server","load","force","startImplementationAsync","urlCreator","getUrlCreator","parsedOptions","maxWorkers","resetCache","resetDevServer","unversioned","EXPO_DEV_SERVER_ORIGIN","middleware","messageSocket","instantiateMetroAsync","manifestMiddleware","getManifestMiddlewareAsync","prependMiddleware","ContextModuleSourceMapsMiddleware","getHandler","use","InterstitialPageMiddleware","scheme","ReactDevToolsPageMiddleware","DevToolsPluginMiddleware","devToolsPluginManager","deepLinkMiddleware","RuntimeRedirectMiddleware","onDeepLink","getLocation","runtime","constructDevClientUrl","constructUrl","CreateFileMiddleware","isTargetingWeb","exp","getConfig","skipSDKVersionRequirement","useServerRendering","includes","web","output","ServeStaticMiddleware","FaviconMiddleware","getBaseUrlFromExpoConfig","getAsyncRoutesFromExpoConfig","getRouterDirectoryModuleIdWithManifest","createRouteHandlerMiddleware","getWebBundleUrl","bind","observeApiRouteChanges","op","isApiRouteConvention","rebundleApiRoute","HistoryFallbackMiddleware","internal","originalClose","close","callback","err","host","protocol","waitForTypeScriptAsync","resolve","off","metroWatchTypeScriptFiles","tsconfig","throttle","eventTypes","TypeScriptProjectPrerequisite","req","bootstrapAsync","log","chalk","red","exception","startTypeScriptServices","startTypescriptTypeGenerationAsync","getConfigModuleIds","logEventAsync","getDevClientProperties"],"mappings":"AAMA;;;;QAimBgBA,kBAAkB,GAAlBA,kBAAkB;AAjmBR,IAAA,OAAc,WAAd,cAAc,CAAA;AAC5BC,IAAAA,UAAU,mCAAM,WAAW,EAAjB;AAEJ,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEP,IAAA,UAAY,kCAAZ,YAAY,EAAA;AACb,IAAA,KAAM,kCAAN,MAAM,EAAA;AAE0B,IAAA,gBAAmB,WAAnB,mBAAmB,CAAA;AACvB,IAAA,4BAA+B,WAA/B,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AAC;KACJ;IAED,MAAaa,uBAAuB,GAAG;YAE3B,GAAa;QADvB,OAAOC,CAAAA,GAAAA,8BAAkC,AAIvC,CAAA,mCAJuC,CAAC;YACxC7E,MAAM,EAAE,CAAA,GAAa,GAAb,IAAI,CAACP,QAAQ,SAAQ,GAArB,KAAA,CAAqB,GAArB,GAAa,CAAEO,MAAM;YAC7B9G,KAAK,EAAE,IAAI,CAACA,KAAK;YACjBoB,WAAW,EAAE,IAAI,CAACA,WAAW;SAC9B,CAAC,CAAC;KACJ;IAED,AAAUwK,kBAAkB,GAAa;QACvC,OAAO;YAAC,mBAAmB;YAAE,qBAAqB;YAAE,oBAAoB;SAAC,CAAC;KAC3E;CACF;QA3hBY9L,qBAAqB,GAArBA,qBAAqB;AA6hB3B,SAASZ,kBAAkB,CAACkC,WAAmB,EAAmB;IACvE,OAAO,OAAO,EAAEwH,OAAO,CAAA,EAAE,GAAK;QAC5B,IAAIA,OAAO,KAAK,MAAM,EAAE,OAAO;QAC/B,MAAM,EAAEK,GAAG,CAAA,EAAE,GAAGC,CAAAA,GAAAA,OAAS,AAAa,CAAA,UAAb,CAAC9H,WAAW,CAAC,AAAC;QACvC,MAAMyK,CAAAA,GAAAA,kBAAa,AAGjB,CAAA,cAHiB,CAAC,0BAA0B,EAAE;YAC9C3G,MAAM,EAAE,SAAS;YACjB,GAAG4G,CAAAA,GAAAA,uBAAsB,AAAkB,CAAA,QAAlB,CAAC1K,WAAW,EAAE6H,GAAG,CAAC;SAC5C,CAAC,CAAC;KACJ,CAAC;CACH"}
|
|
@@ -35,15 +35,15 @@ class MetroTerminalReporter extends _terminalReporter.TerminalReporter {
|
|
|
35
35
|
const env = getEnvironmentForBuildDetails(progress.bundleDetails);
|
|
36
36
|
const platform = env || getPlatformTagForBuildDetails(progress.bundleDetails);
|
|
37
37
|
const inProgress = phase === "in_progress";
|
|
38
|
+
const localPath = progress.bundleDetails.entryFile.startsWith(_path.default.sep) ? _path.default.relative(this.projectRoot, progress.bundleDetails.entryFile) : progress.bundleDetails.entryFile;
|
|
38
39
|
if (!inProgress) {
|
|
39
40
|
const status = phase === "done" ? `Bundling complete ` : `Bundling failed `;
|
|
40
41
|
const color = phase === "done" ? _chalk.default.green : _chalk.default.red;
|
|
41
42
|
const startTime = this._bundleTimers.get(progress.bundleDetails.buildID);
|
|
42
43
|
const time = startTime != null ? _chalk.default.dim(this._getElapsedTime(startTime) + "ms") : "";
|
|
43
44
|
// iOS Bundling complete 150ms
|
|
44
|
-
return color(platform + status) + time;
|
|
45
|
+
return color(platform + status) + time + _chalk.default.reset.dim(" (" + localPath + ")");
|
|
45
46
|
}
|
|
46
|
-
const localPath = progress.bundleDetails.entryFile.startsWith(_path.default.sep) ? _path.default.relative(this.projectRoot, progress.bundleDetails.entryFile) : progress.bundleDetails.entryFile;
|
|
47
47
|
const filledBar = Math.floor(progress.ratio * MAX_PROGRESS_BAR_CHAR_WIDTH);
|
|
48
48
|
const _progress = inProgress ? _chalk.default.green.bgGreen(DARK_BLOCK_CHAR.repeat(filledBar)) + _chalk.default.bgWhite.white(LIGHT_BLOCK_CHAR.repeat(MAX_PROGRESS_BAR_CHAR_WIDTH - filledBar)) + _chalk.default.bold(` ${(100 * progress.ratio).toFixed(1).padStart(4)}% `) + _chalk.default.dim(`(${progress.transformedFileCount.toString().padStart(progress.totalFileCount.toString().length)}/${progress.totalFileCount})`) : "";
|
|
49
49
|
return platform + _chalk.default.reset.dim(`${_path.default.dirname(localPath)}/`) + _chalk.default.bold(_path.default.basename(localPath)) + " " + _progress;
|
|
@@ -55,6 +55,10 @@ class MetroTerminalReporter extends _terminalReporter.TerminalReporter {
|
|
|
55
55
|
shouldFilterClientLog(event) {
|
|
56
56
|
return isAppRegistryStartupMessage(event.data);
|
|
57
57
|
}
|
|
58
|
+
shouldFilterBundleEvent(event) {
|
|
59
|
+
var ref;
|
|
60
|
+
return "bundleDetails" in event && ((ref = event.bundleDetails) == null ? void 0 : ref.bundleType) === "map";
|
|
61
|
+
}
|
|
58
62
|
/** Print the cache clear message. */ transformCacheReset() {
|
|
59
63
|
(0, _terminalReporter).logWarning(this.terminal, _chalk.default`Bundler cache is empty, rebuilding {dim (this may take a minute)}`);
|
|
60
64
|
}
|