@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/metro/metroErrorInterface.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 chalk from 'chalk';\nimport resolveFrom from 'resolve-from';\nimport { StackFrame } from 'stacktrace-parser';\nimport terminalLink from 'terminal-link';\n\nimport { Log } from '../../../log';\nimport { createMetroEndpointAsync } from '../getStaticRenderFunctions';\n// import type { CodeFrame, MetroStackFrame } from '@expo/metro-runtime/symbolicate';\n\ntype CodeFrame = {\n content: string;\n location?: {\n row: number;\n column: number;\n [key: string]: any;\n };\n fileName: string;\n};\n\ntype MetroStackFrame = StackFrame & { collapse?: boolean };\n\nfunction fill(width: number): string {\n return Array(width).join(' ');\n}\n\nfunction formatPaths(config: { filePath: string | null; line?: number; col?: number }) {\n const filePath = chalk.reset(config.filePath);\n return (\n chalk.dim('(') +\n filePath +\n chalk.dim(`:${[config.line, config.col].filter(Boolean).join(':')})`)\n );\n}\n\nexport async function logMetroErrorWithStack(\n projectRoot: string,\n {\n stack,\n codeFrame,\n error,\n }: {\n stack: MetroStackFrame[];\n codeFrame: CodeFrame;\n error: Error;\n }\n) {\n // process.stdout.write('\\u001b[0m'); // Reset attributes\n // process.stdout.write('\\u001bc'); // Reset the terminal\n\n const { getStackFormattedLocation } = require(\n resolveFrom(projectRoot, '@expo/metro-runtime/symbolicate')\n );\n\n Log.log();\n Log.log(chalk.red('Metro error: ') + error.message);\n Log.log();\n\n if (codeFrame) {\n const maxWarningLineLength = Math.max(200, process.stdout.columns);\n\n const lineText = codeFrame.content;\n const isPreviewTooLong = codeFrame.content\n .split('\\n')\n .some((line) => line.length > maxWarningLineLength);\n const column = codeFrame.location?.column;\n // When the preview is too long, we skip reading the file and attempting to apply\n // code coloring, this is because it can get very slow.\n if (isPreviewTooLong) {\n let previewLine = '';\n let cursorLine = '';\n\n const formattedPath = formatPaths({\n filePath: codeFrame.fileName,\n line: codeFrame.location?.row,\n col: codeFrame.location?.column,\n });\n // Create a curtailed preview line like:\n // `...transition:'fade'},k._updatePropsStack=function(){clearImmediate(k._updateImmediate),k._updateImmediate...`\n // If there is no text preview or column number, we can't do anything.\n if (lineText && column != null) {\n const rangeWindow = Math.round(\n Math.max(codeFrame.fileName?.length ?? 0, Math.max(80, process.stdout.columns)) / 2\n );\n let minBounds = Math.max(0, column - rangeWindow);\n const maxBounds = Math.min(minBounds + rangeWindow * 2, lineText.length);\n previewLine = lineText.slice(minBounds, maxBounds);\n\n // If we splice content off the start, then we should append `...`.\n // This is unlikely to happen since we limit the activation size.\n if (minBounds > 0) {\n // Adjust the min bounds so the cursor is aligned after we add the \"...\"\n minBounds -= 3;\n previewLine = chalk.dim('...') + previewLine;\n }\n if (maxBounds < lineText.length) {\n previewLine += chalk.dim('...');\n }\n\n // If the column property could be found, then use that to fix the cursor location which is often broken in regex.\n cursorLine = (column == null ? '' : fill(column) + chalk.reset('^')).slice(minBounds);\n\n Log.log(\n [formattedPath, '', previewLine, cursorLine, chalk.dim('(error truncated)')].join('\\n')\n );\n }\n } else {\n Log.log(codeFrame.content);\n }\n }\n\n if (stack?.length) {\n Log.log();\n Log.log(chalk.bold`Call Stack`);\n\n const stackProps = stack.map((frame) => {\n return {\n title: frame.methodName,\n subtitle: getStackFormattedLocation(projectRoot, frame),\n collapse: frame.collapse,\n };\n });\n\n stackProps.forEach((frame) => {\n const position = terminalLink.isSupported\n ? terminalLink(frame.subtitle, frame.subtitle)\n : frame.subtitle;\n let lineItem = chalk.gray(` ${frame.title} (${position})`);\n if (frame.collapse) {\n lineItem = chalk.dim(lineItem);\n }\n Log.log(lineItem);\n });\n } else {\n Log.log(chalk.gray(` ${error.stack}`));\n }\n}\n\nexport async function logMetroError(projectRoot: string, { error }: { error: Error }) {\n const { LogBoxLog, parseErrorStack } = require(\n resolveFrom(projectRoot, '@expo/metro-runtime/symbolicate')\n );\n\n const stack = parseErrorStack(error.stack);\n\n const log = new LogBoxLog({\n level: 'static',\n message: {\n content: error.message,\n substitutions: [],\n },\n isComponentError: false,\n stack,\n category: 'static',\n componentStack: [],\n });\n\n await new Promise((res) => log.symbolicate('stack', res));\n\n logMetroErrorWithStack(projectRoot, {\n stack: log.symbolicated?.stack?.stack ?? [],\n codeFrame: log.codeFrame,\n error,\n });\n}\n\n/** @returns the html required to render the static metro error as an SPA. */\nexport function logFromError({ error, projectRoot }: { error: Error; projectRoot: string }): {\n symbolicated: any;\n symbolicate: (type: string, callback: () => void) => void;\n codeFrame: CodeFrame;\n} {\n const { LogBoxLog, parseErrorStack } = require(\n resolveFrom(projectRoot, '@expo/metro-runtime/symbolicate')\n );\n\n const stack = parseErrorStack(error.stack);\n\n return new LogBoxLog({\n level: 'static',\n message: {\n content: error.message,\n substitutions: [],\n },\n isComponentError: false,\n stack,\n category: 'static',\n componentStack: [],\n });\n}\n\n/** @returns the html required to render the static metro error as an SPA. */\nexport async function logMetroErrorAsync({\n error,\n projectRoot,\n}: {\n error: Error;\n projectRoot: string;\n}) {\n const log = logFromError({ projectRoot, error });\n\n await new Promise<void>((res) => log.symbolicate('stack', res));\n\n logMetroErrorWithStack(projectRoot, {\n stack: log.symbolicated?.stack?.stack ?? [],\n codeFrame: log.codeFrame,\n error,\n });\n}\n\n/** @returns the html required to render the static metro error as an SPA. */\nexport async function getErrorOverlayHtmlAsync({\n error,\n projectRoot,\n}: {\n error: Error;\n projectRoot: string;\n}) {\n const log = logFromError({ projectRoot, error });\n\n await new Promise<void>((res) => log.symbolicate('stack', res));\n\n logMetroErrorWithStack(projectRoot, {\n stack: log.symbolicated?.stack?.stack ?? [],\n codeFrame: log.codeFrame,\n error,\n });\n\n const logBoxContext = {\n selectedLogIndex: 0,\n isDisabled: false,\n logs: [log],\n };\n const html = `<html><head><style>#root,body,html{height:100%}body{overflow:hidden}#root{display:flex}</style></head><body><div id=\"root\"></div><script id=\"_expo-static-error\" type=\"application/json\">${JSON.stringify(\n logBoxContext\n )}</script></body></html>`;\n\n const errorOverlayEntry = await createMetroEndpointAsync(\n projectRoot,\n // Keep the URL relative\n '',\n resolveFrom(projectRoot, 'expo-router/_error'),\n {\n dev: true,\n platform: 'web',\n minify: false,\n environment: 'node',\n }\n );\n\n const htmlWithJs = html.replace('</body>', `<script src=${errorOverlayEntry}></script></body>`);\n return htmlWithJs;\n}\n"],"names":["logMetroErrorWithStack","logMetroError","logFromError","logMetroErrorAsync","getErrorOverlayHtmlAsync","fill","width","Array","join","formatPaths","config","filePath","chalk","reset","dim","line","col","filter","Boolean","projectRoot","stack","codeFrame","error","getStackFormattedLocation","require","resolveFrom","Log","log","red","message","maxWarningLineLength","Math","max","process","stdout","columns","lineText","content","isPreviewTooLong","split","some","length","column","location","previewLine","cursorLine","formattedPath","fileName","row","rangeWindow","round","minBounds","maxBounds","min","slice","bold","stackProps","map","frame","title","methodName","subtitle","collapse","forEach","position","terminalLink","isSupported","lineItem","gray","LogBoxLog","parseErrorStack","level","substitutions","isComponentError","category","componentStack","Promise","res","symbolicate","symbolicated","logBoxContext","selectedLogIndex","isDisabled","logs","html","JSON","stringify","errorOverlayEntry","createMetroEndpointAsync","dev","platform","minify","environment","htmlWithJs","replace"],"mappings":"AAMA;;;;QAkCsBA,sBAAsB,GAAtBA,sBAAsB;QAuGtBC,aAAa,GAAbA,aAAa;QA6BnBC,YAAY,GAAZA,YAAY;QAyBNC,kBAAkB,GAAlBA,kBAAkB;QAmBlBC,wBAAwB,GAAxBA,wBAAwB;AAlN5B,IAAA,MAAO,kCAAP,OAAO,EAAA;AACD,IAAA,YAAc,kCAAd,cAAc,EAAA;AAEb,IAAA,aAAe,kCAAf,eAAe,EAAA;AAEpB,IAAA,IAAc,WAAd,cAAc,CAAA;AACO,IAAA,yBAA6B,WAA7B,6BAA6B,CAAA;;;;;;AAetE,SAASC,IAAI,CAACC,KAAa,EAAU;IACnC,OAAOC,KAAK,CAACD,KAAK,CAAC,CAACE,IAAI,CAAC,GAA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ED,GAAG,CAAC;IAAA,CAAC,CAAC;QAGvDlD,KAA8B;IADvC3B,sBAAsB,CAACmB,WAAW,EAAE;QAClCC,KAAK,EAAEO,CAAAA,KAA8B,GAA9BA,CAAAA,GAAgB,GAAhBA,GAAG,CAACoD,YAAY,SAAO,GAAvBpD,KAAAA,CAAuB,GAAvBA,QAAAA,GAAgB,CAAEP,KAAK,SAAA,GAAvBO,KAAAA,CAAuB,QAAEP,KAAK,AAAP,YAAvBO,KAA8B,GAAI,EAAE;QAC3CN,SAAS,EAAEM,GAAG,CAACN,SAAS;QACxBC,KAAK;KACN,CAAC,CAAC;IAEH,MAAM0D,aAAa,GAAG;QACpBC,gBAAgB,EAAE,CAAC;QACnBC,UAAU,EAAE,KAAK;QACjBC,IAAI,EAAE;YAACxD,GAAG;SAAC;KACZ,AAAC;IACF,MAAMyD,IAAI,GAAG,CAAC,yLAAyL,EAAEC,IAAI,CAACC,SAAS,CACrNN,aAAa,CACd,CAAC,uBAAuB,CAAC,AAAC;IAE3B,MAAMO,iBAAiB,GAAG,MAAMC,CAAAA,GAAAA,yBAAwB,AAWvD,CAAA,yBAXuD,CACtDrE,WAAW,EACX,wBAAwB;IACxB,EAAE,EACFM,CAAAA,GAAAA,YAAW,AAAmC,CAAA,QAAnC,CAACN,WAAW,EAAE,oBAAoB,CAAC,EAC9C;QACEsE,GAAG,EAAE,IAAI;QACTC,QAAQ,EAAE,KAAK;QACfC,MAAM,EAAE,KAAK;QACbC,WAAW,EAAE,MAAM;KACpB,CACF,AAAC;IAEF,MAAMC,UAAU,GAAGT,IAAI,CAACU,OAAO,CAAC,SAAS,EAAE,CAAC,YAAY,EAAEP,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,AAAC;IAChG,OAAOM,UAAU,CAAC;CACnB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/metro/metroErrorInterface.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 chalk from 'chalk';\nimport resolveFrom from 'resolve-from';\nimport { StackFrame } from 'stacktrace-parser';\nimport terminalLink from 'terminal-link';\n\nimport { Log } from '../../../log';\nimport { createMetroEndpointAsync } from '../getStaticRenderFunctions';\n// import type { CodeFrame, MetroStackFrame } from '@expo/metro-runtime/symbolicate';\n\ntype CodeFrame = {\n content: string;\n location?: {\n row: number;\n column: number;\n [key: string]: any;\n };\n fileName: string;\n};\n\ntype MetroStackFrame = StackFrame & { collapse?: boolean };\n\nfunction fill(width: number): string {\n return Array(width).join(' ');\n}\n\nfunction formatPaths(config: { filePath: string | null; line?: number; col?: number }) {\n const filePath = chalk.reset(config.filePath);\n return (\n chalk.dim('(') +\n filePath +\n chalk.dim(`:${[config.line, config.col].filter(Boolean).join(':')})`)\n );\n}\n\nexport async function logMetroErrorWithStack(\n projectRoot: string,\n {\n stack,\n codeFrame,\n error,\n }: {\n stack: MetroStackFrame[];\n codeFrame: CodeFrame;\n error: Error;\n }\n) {\n // process.stdout.write('\\u001b[0m'); // Reset attributes\n // process.stdout.write('\\u001bc'); // Reset the terminal\n\n const { getStackFormattedLocation } = require(\n resolveFrom(projectRoot, '@expo/metro-runtime/symbolicate')\n );\n\n Log.log();\n Log.log(chalk.red('Metro error: ') + error.message);\n Log.log();\n\n if (codeFrame) {\n const maxWarningLineLength = Math.max(200, process.stdout.columns);\n\n const lineText = codeFrame.content;\n const isPreviewTooLong = codeFrame.content\n .split('\\n')\n .some((line) => line.length > maxWarningLineLength);\n const column = codeFrame.location?.column;\n // When the preview is too long, we skip reading the file and attempting to apply\n // code coloring, this is because it can get very slow.\n if (isPreviewTooLong) {\n let previewLine = '';\n let cursorLine = '';\n\n const formattedPath = formatPaths({\n filePath: codeFrame.fileName,\n line: codeFrame.location?.row,\n col: codeFrame.location?.column,\n });\n // Create a curtailed preview line like:\n // `...transition:'fade'},k._updatePropsStack=function(){clearImmediate(k._updateImmediate),k._updateImmediate...`\n // If there is no text preview or column number, we can't do anything.\n if (lineText && column != null) {\n const rangeWindow = Math.round(\n Math.max(codeFrame.fileName?.length ?? 0, Math.max(80, process.stdout.columns)) / 2\n );\n let minBounds = Math.max(0, column - rangeWindow);\n const maxBounds = Math.min(minBounds + rangeWindow * 2, lineText.length);\n previewLine = lineText.slice(minBounds, maxBounds);\n\n // If we splice content off the start, then we should append `...`.\n // This is unlikely to happen since we limit the activation size.\n if (minBounds > 0) {\n // Adjust the min bounds so the cursor is aligned after we add the \"...\"\n minBounds -= 3;\n previewLine = chalk.dim('...') + previewLine;\n }\n if (maxBounds < lineText.length) {\n previewLine += chalk.dim('...');\n }\n\n // If the column property could be found, then use that to fix the cursor location which is often broken in regex.\n cursorLine = (column == null ? '' : fill(column) + chalk.reset('^')).slice(minBounds);\n\n Log.log(\n [formattedPath, '', previewLine, cursorLine, chalk.dim('(error truncated)')].join('\\n')\n );\n }\n } else {\n Log.log(codeFrame.content);\n }\n }\n\n if (stack?.length) {\n Log.log();\n Log.log(chalk.bold`Call Stack`);\n\n const stackProps = stack.map((frame) => {\n return {\n title: frame.methodName,\n subtitle: getStackFormattedLocation(projectRoot, frame),\n collapse: frame.collapse,\n };\n });\n\n stackProps.forEach((frame) => {\n const position = terminalLink.isSupported\n ? terminalLink(frame.subtitle, frame.subtitle)\n : frame.subtitle;\n let lineItem = chalk.gray(` ${frame.title} (${position})`);\n if (frame.collapse) {\n lineItem = chalk.dim(lineItem);\n }\n Log.log(lineItem);\n });\n } else {\n Log.log(chalk.gray(` ${error.stack}`));\n }\n}\n\nexport async function logMetroError(projectRoot: string, { error }: { error: Error }) {\n const { LogBoxLog, parseErrorStack } = require(\n resolveFrom(projectRoot, '@expo/metro-runtime/symbolicate')\n );\n\n const stack = parseErrorStack(error.stack);\n\n const log = new LogBoxLog({\n level: 'static',\n message: {\n content: error.message,\n substitutions: [],\n },\n isComponentError: false,\n stack,\n category: 'static',\n componentStack: [],\n });\n\n await new Promise((res) => log.symbolicate('stack', res));\n\n logMetroErrorWithStack(projectRoot, {\n stack: log.symbolicated?.stack?.stack ?? [],\n codeFrame: log.codeFrame,\n error,\n });\n}\n\n/** @returns the html required to render the static metro error as an SPA. */\nexport function logFromError({ error, projectRoot }: { error: Error; projectRoot: string }): {\n symbolicated: any;\n symbolicate: (type: string, callback: () => void) => void;\n codeFrame: CodeFrame;\n} {\n const { LogBoxLog, parseErrorStack } = require(\n resolveFrom(projectRoot, '@expo/metro-runtime/symbolicate')\n );\n\n const stack = parseErrorStack(error.stack);\n\n return new LogBoxLog({\n level: 'static',\n message: {\n content: error.message,\n substitutions: [],\n },\n isComponentError: false,\n stack,\n category: 'static',\n componentStack: [],\n });\n}\n\n/** @returns the html required to render the static metro error as an SPA. */\nexport async function logMetroErrorAsync({\n error,\n projectRoot,\n}: {\n error: Error;\n projectRoot: string;\n}) {\n const log = logFromError({ projectRoot, error });\n\n await new Promise<void>((res) => log.symbolicate('stack', res));\n\n logMetroErrorWithStack(projectRoot, {\n stack: log.symbolicated?.stack?.stack ?? [],\n codeFrame: log.codeFrame,\n error,\n });\n}\n\n/** @returns the html required to render the static metro error as an SPA. */\nexport async function getErrorOverlayHtmlAsync({\n error,\n projectRoot,\n routerRoot,\n}: {\n error: Error;\n projectRoot: string;\n routerRoot: string;\n}) {\n const log = logFromError({ projectRoot, error });\n\n await new Promise<void>((res) => log.symbolicate('stack', res));\n\n logMetroErrorWithStack(projectRoot, {\n stack: log.symbolicated?.stack?.stack ?? [],\n codeFrame: log.codeFrame,\n error,\n });\n\n const logBoxContext = {\n selectedLogIndex: 0,\n isDisabled: false,\n logs: [log],\n };\n const html = `<html><head><style>#root,body,html{height:100%}body{overflow:hidden}#root{display:flex}</style></head><body><div id=\"root\"></div><script id=\"_expo-static-error\" type=\"application/json\">${JSON.stringify(\n logBoxContext\n )}</script></body></html>`;\n\n const errorOverlayEntry = await createMetroEndpointAsync(\n projectRoot,\n // Keep the URL relative\n '',\n resolveFrom(projectRoot, 'expo-router/_error'),\n {\n dev: true,\n platform: 'web',\n minify: false,\n baseUrl: '',\n routerRoot,\n }\n );\n\n const htmlWithJs = html.replace('</body>', `<script src=${errorOverlayEntry}></script></body>`);\n return htmlWithJs;\n}\n"],"names":["logMetroErrorWithStack","logMetroError","logFromError","logMetroErrorAsync","getErrorOverlayHtmlAsync","fill","width","Array","join","formatPaths","config","filePath","chalk","reset","dim","line","col","filter","Boolean","projectRoot","stack","codeFrame","error","getStackFormattedLocation","require","resolveFrom","Log","log","red","message","maxWarningLineLength","Math","max","process","stdout","columns","lineText","content","isPreviewTooLong","split","some","length","column","location","previewLine","cursorLine","formattedPath","fileName","row","rangeWindow","round","minBounds","maxBounds","min","slice","bold","stackProps","map","frame","title","methodName","subtitle","collapse","forEach","position","terminalLink","isSupported","lineItem","gray","LogBoxLog","parseErrorStack","level","substitutions","isComponentError","category","componentStack","Promise","res","symbolicate","symbolicated","routerRoot","logBoxContext","selectedLogIndex","isDisabled","logs","html","JSON","stringify","errorOverlayEntry","createMetroEndpointAsync","dev","platform","minify","baseUrl","htmlWithJs","replace"],"mappings":"AAMA;;;;QAkCsBA,sBAAsB,GAAtBA,sBAAsB;QAuGtBC,aAAa,GAAbA,aAAa;QA6BnBC,YAAY,GAAZA,YAAY;QAyBNC,kBAAkB,GAAlBA,kBAAkB;QAmBlBC,wBAAwB,GAAxBA,wBAAwB;AAlN5B,IAAA,MAAO,kCAAP,OAAO,EAAA;AACD,IAAA,YAAc,kCAAd,cAAc,EAAA;AAEb,IAAA,aAAe,kCAAf,eAAe,EAAA;AAEpB,IAAA,IAAc,WAAd,cAAc,CAAA;AACO,IAAA,yBAA6B,WAA7B,6BAA6B,CAAA;;;;;;AAetE,SAASC,IAAI,CAACC,KAAa,EAAU;IACnC,OAAOC,KAAK,CAACD,KAAK,CAAC,CAACE,IAAI,CAAC,GAAG,CAAC,CAAC;CAC/B;AAED,SAASC,WAAW,CAACC,MAAgE,EAAE;IACrF,MAAMC,QAAQ,GAAGC,MAAK,QAAA,CAACC,KAAK,CAACH,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,EAAEO,CAAAA,KAA8B,GAA9BA,CAAAA,GAAgB,GAAhBA,GAAG,CAACoD,YAAY,SAAO,GAAvBpD,KAAAA,CAAuB,GAAvBA,QAAAA,GAAgB,CAAEP,KAAK,SAAA,GAAvBO,KAAAA,CAAuB,QAAEP,KAAK,AAAP,YAAvBO,KAA8B,GAAI,EAAE;QAC3CN,SAAS,EAAEM,GAAG,CAACN,SAAS;QACxBC,KAAK;KACN,CAAC,CAAC;IAEH,MAAM2D,aAAa,GAAG;QACpBC,gBAAgB,EAAE,CAAC;QACnBC,UAAU,EAAE,KAAK;QACjBC,IAAI,EAAE;YAACzD,GAAG;SAAC;KACZ,AAAC;IACF,MAAM0D,IAAI,GAAG,CAAC,yLAAyL,EAAEC,IAAI,CAACC,SAAS,CACrNN,aAAa,CACd,CAAC,uBAAuB,CAAC,AAAC;IAE3B,MAAMO,iBAAiB,GAAG,MAAMC,CAAAA,GAAAA,yBAAwB,AAYvD,CAAA,yBAZuD,CACtDtE,WAAW,EACX,wBAAwB;IACxB,EAAE,EACFM,CAAAA,GAAAA,YAAW,AAAmC,CAAA,QAAnC,CAACN,WAAW,EAAE,oBAAoB,CAAC,EAC9C;QACEuE,GAAG,EAAE,IAAI;QACTC,QAAQ,EAAE,KAAK;QACfC,MAAM,EAAE,KAAK;QACbC,OAAO,EAAE,EAAE;QACXb,UAAU;KACX,CACF,AAAC;IAEF,MAAMc,UAAU,GAAGT,IAAI,CAACU,OAAO,CAAC,SAAS,EAAE,CAAC,YAAY,EAAEP,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,AAAC;IAChG,OAAOM,UAAU,CAAC;CACnB"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
exports.getAppRouterRelativeEntryPath = getAppRouterRelativeEntryPath;
|
|
6
6
|
exports.getRouterDirectoryModuleIdWithManifest = getRouterDirectoryModuleIdWithManifest;
|
|
7
|
-
exports.getRouterDirectoryWithManifest = getRouterDirectoryWithManifest;
|
|
8
7
|
exports.getRouterDirectory = getRouterDirectory;
|
|
9
8
|
exports.isApiRouteConvention = isApiRouteConvention;
|
|
10
9
|
exports.getApiRoutesForDirectory = getApiRoutesForDirectory;
|
|
@@ -15,6 +14,7 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
15
14
|
var _resolveFrom = _interopRequireDefault(require("resolve-from"));
|
|
16
15
|
var _log = require("../../../log");
|
|
17
16
|
var _dir = require("../../../utils/dir");
|
|
17
|
+
var _fn = require("../../../utils/fn");
|
|
18
18
|
function _interopRequireDefault(obj) {
|
|
19
19
|
return obj && obj.__esModule ? obj : {
|
|
20
20
|
default: obj
|
|
@@ -44,15 +44,14 @@ function getAppRouterRelativeEntryPath(projectRoot, routerDirectory = getRouterD
|
|
|
44
44
|
function getRouterDirectoryModuleIdWithManifest(projectRoot, exp) {
|
|
45
45
|
var ref, ref1;
|
|
46
46
|
var ref2;
|
|
47
|
-
return (ref2 = (ref = exp.extra) == null ? void 0 : (ref1 = ref.router) == null ? void 0 : ref1.
|
|
48
|
-
}
|
|
49
|
-
function getRouterDirectoryWithManifest(projectRoot, exp) {
|
|
50
|
-
return _path.default.join(projectRoot, getRouterDirectoryModuleIdWithManifest(projectRoot, exp));
|
|
47
|
+
return (ref2 = (ref = exp.extra) == null ? void 0 : (ref1 = ref.router) == null ? void 0 : ref1.root) != null ? ref2 : getRouterDirectory(projectRoot);
|
|
51
48
|
}
|
|
49
|
+
const logSrcDir = (0, _fn).memoize(()=>_log.Log.log(_chalk.default.gray("Using src/app as the root directory for Expo Router."))
|
|
50
|
+
);
|
|
52
51
|
function getRouterDirectory(projectRoot) {
|
|
53
52
|
// more specific directories first
|
|
54
53
|
if ((0, _dir).directoryExistsSync(_path.default.join(projectRoot, "src/app"))) {
|
|
55
|
-
|
|
54
|
+
logSrcDir();
|
|
56
55
|
return "src/app";
|
|
57
56
|
}
|
|
58
57
|
debug("Using app as the root directory for Expo Router.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/metro/router.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config';\nimport chalk from 'chalk';\nimport { sync as globSync } from 'glob';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { Log } from '../../../log';\nimport { directoryExistsSync } from '../../../utils/dir';\n\nconst debug = require('debug')('expo:start:server:metro:router') as typeof console.log;\n\n/**\n * Get the relative path for requiring the `/app` folder relative to the `expo-router/entry` file.\n * This mechanism does require the server to restart after the `expo-router` package is installed.\n */\nexport function getAppRouterRelativeEntryPath(\n projectRoot: string,\n routerDirectory: string = getRouterDirectory(projectRoot)\n): string | undefined {\n // Auto pick App entry\n const routerEntry =\n resolveFrom.silent(projectRoot, 'expo-router/entry') ?? getFallbackEntryRoot(projectRoot);\n if (!routerEntry) {\n return undefined;\n }\n // It doesn't matter if the app folder exists.\n const appFolder = path.join(projectRoot, routerDirectory);\n const appRoot = path.relative(path.dirname(routerEntry), appFolder);\n debug('expo-router entry', routerEntry, appFolder, appRoot);\n return appRoot;\n}\n\n/** If the `expo-router` package is not installed, then use the `expo` package to determine where the node modules are relative to the project. */\nfunction getFallbackEntryRoot(projectRoot: string): string {\n const expoRoot = resolveFrom.silent(projectRoot, 'expo/package.json');\n if (expoRoot) {\n return path.join(path.dirname(path.dirname(expoRoot)), 'expo-router/entry');\n }\n return path.join(projectRoot, 'node_modules/expo-router/entry');\n}\n\nexport function getRouterDirectoryModuleIdWithManifest(\n projectRoot: string,\n exp: ExpoConfig\n): string {\n return exp.extra?.router?.
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/metro/router.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config';\nimport chalk from 'chalk';\nimport { sync as globSync } from 'glob';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { Log } from '../../../log';\nimport { directoryExistsSync } from '../../../utils/dir';\nimport { memoize } from '../../../utils/fn';\n\nconst debug = require('debug')('expo:start:server:metro:router') as typeof console.log;\n\n/**\n * Get the relative path for requiring the `/app` folder relative to the `expo-router/entry` file.\n * This mechanism does require the server to restart after the `expo-router` package is installed.\n */\nexport function getAppRouterRelativeEntryPath(\n projectRoot: string,\n routerDirectory: string = getRouterDirectory(projectRoot)\n): string | undefined {\n // Auto pick App entry\n const routerEntry =\n resolveFrom.silent(projectRoot, 'expo-router/entry') ?? getFallbackEntryRoot(projectRoot);\n if (!routerEntry) {\n return undefined;\n }\n // It doesn't matter if the app folder exists.\n const appFolder = path.join(projectRoot, routerDirectory);\n const appRoot = path.relative(path.dirname(routerEntry), appFolder);\n debug('expo-router entry', routerEntry, appFolder, appRoot);\n return appRoot;\n}\n\n/** If the `expo-router` package is not installed, then use the `expo` package to determine where the node modules are relative to the project. */\nfunction getFallbackEntryRoot(projectRoot: string): string {\n const expoRoot = resolveFrom.silent(projectRoot, 'expo/package.json');\n if (expoRoot) {\n return path.join(path.dirname(path.dirname(expoRoot)), 'expo-router/entry');\n }\n return path.join(projectRoot, 'node_modules/expo-router/entry');\n}\n\nexport function getRouterDirectoryModuleIdWithManifest(\n projectRoot: string,\n exp: ExpoConfig\n): string {\n return exp.extra?.router?.root ?? getRouterDirectory(projectRoot);\n}\n\nconst logSrcDir = memoize(() =>\n Log.log(chalk.gray('Using src/app as the root directory for Expo Router.'))\n);\n\nexport function getRouterDirectory(projectRoot: string): string {\n // more specific directories first\n if (directoryExistsSync(path.join(projectRoot, 'src/app'))) {\n logSrcDir();\n return 'src/app';\n }\n\n debug('Using app as the root directory for Expo Router.');\n return 'app';\n}\n\nexport function isApiRouteConvention(name: string): boolean {\n return /\\+api\\.[tj]sx?$/.test(name);\n}\n\nexport function getApiRoutesForDirectory(cwd: string) {\n return globSync('**/*+api.@(ts|tsx|js|jsx)', {\n cwd,\n absolute: true,\n });\n}\n\n// Used to emulate a context module, but way faster. TODO: May need to adjust the extensions to stay in sync with Metro.\nexport function getRoutePaths(cwd: string) {\n return globSync('**/*.@(ts|tsx|js|jsx)', {\n cwd,\n }).map((p) => './' + normalizePaths(p));\n}\n\nfunction normalizePaths(p: string) {\n return p.replace(/\\\\/g, '/');\n}\n"],"names":["getAppRouterRelativeEntryPath","getRouterDirectoryModuleIdWithManifest","getRouterDirectory","isApiRouteConvention","getApiRoutesForDirectory","getRoutePaths","debug","require","projectRoot","routerDirectory","resolveFrom","routerEntry","silent","getFallbackEntryRoot","undefined","appFolder","path","join","appRoot","relative","dirname","expoRoot","exp","extra","router","root","logSrcDir","memoize","Log","log","chalk","gray","directoryExistsSync","name","test","cwd","globSync","absolute","map","p","normalizePaths","replace"],"mappings":"AAAA;;;;QAgBgBA,6BAA6B,GAA7BA,6BAA6B;QA0B7BC,sCAAsC,GAAtCA,sCAAsC;QAWtCC,kBAAkB,GAAlBA,kBAAkB;QAWlBC,oBAAoB,GAApBA,oBAAoB;QAIpBC,wBAAwB,GAAxBA,wBAAwB;QAQxBC,aAAa,GAAbA,aAAa;AA3EX,IAAA,MAAO,kCAAP,OAAO,EAAA;AACQ,IAAA,KAAM,WAAN,MAAM,CAAA;AACtB,IAAA,KAAM,kCAAN,MAAM,EAAA;AACC,IAAA,YAAc,kCAAd,cAAc,EAAA;AAElB,IAAA,IAAc,WAAd,cAAc,CAAA;AACE,IAAA,IAAoB,WAApB,oBAAoB,CAAA;AAChC,IAAA,GAAmB,WAAnB,mBAAmB,CAAA;;;;;;AAE3C,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,gCAAgC,CAAC,AAAsB,AAAC;AAMhF,SAASP,6BAA6B,CAC3CQ,WAAmB,EACnBC,eAAuB,GAAGP,kBAAkB,CAACM,WAAW,CAAC,EACrC;QAGlBE,GAAoD;IAFtD,sBAAsB;IACtB,MAAMC,WAAW,GACfD,CAAAA,GAAoD,GAApDA,YAAW,QAAA,CAACE,MAAM,CAACJ,WAAW,EAAE,mBAAmB,CAAC,YAApDE,GAAoD,GAAIG,oBAAoB,CAACL,WAAW,CAAC,AAAC;IAC5F,IAAI,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CAACC,MAAK,QAAA,CAACC,IAAI,CAAC,sDAAsD,CAAC,CAAC;AAAA,CAC5E,AAAC;AAEK,SAAS7B,kBAAkB,CAACM,WAAmB,EAAU;IAC9D,kCAAkC;IAClC,IAAIwB,CAAAA,GAAAA,IAAmB,AAAmC,CAAA,oBAAnC,CAAChB,KAAI,QAAA,CAACC,IAAI,CAACT,WAAW,EAAE,SAAS,CAAC,CAAC,EAAE;QAC1DkB,SAAS,EAAE,CAAC;QACZ,OAAO,SAAS,CAAC;KAClB;IAEDpB,KAAK,CAAC,kDAAkD,CAAC,CAAC;IAC1D,OAAO,KAAK,CAAC;CACd;AAEM,SAASH,oBAAoB,CAAC8B,IAAY,EAAW;IAC1D,OAAO,kBAAkBC,IAAI,CAACD,IAAI,CAAC,CAAC;CACrC;AAEM,SAAS7B,wBAAwB,CAAC+B,GAAW,EAAE;IACpD,OAAOC,CAAAA,GAAAA,KAAQ,AAGb,CAAA,KAHa,CAAC,2BAA2B,EAAE;QAC3CD,GAAG;QACHE,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;CACJ;AAGM,SAAShC,aAAa,CAAC8B,GAAW,EAAE;IACzC,OAAOC,CAAAA,GAAAA,KAAQ,AAEb,CAAA,KAFa,CAAC,uBAAuB,EAAE;QACvCD,GAAG;KACJ,CAAC,CAACG,GAAG,CAAC,CAACC,CAAC,GAAK,IAAI,GAAGC,cAAc,CAACD,CAAC,CAAC;IAAA,CAAC,CAAC;CACzC;AAED,SAASC,cAAc,CAACD,CAAS,EAAE;IACjC,OAAOA,CAAC,CAACE,OAAO,QAAQ,GAAG,CAAC,CAAC;CAC9B"}
|
|
@@ -6,20 +6,18 @@ exports.runServer = void 0;
|
|
|
6
6
|
var _assert = _interopRequireDefault(require("assert"));
|
|
7
7
|
var _http = _interopRequireDefault(require("http"));
|
|
8
8
|
var _https = _interopRequireDefault(require("https"));
|
|
9
|
+
var _metro = _interopRequireDefault(require("metro"));
|
|
10
|
+
var _hmrServer = _interopRequireDefault(require("metro/src/HmrServer"));
|
|
11
|
+
var _createWebsocketServer = _interopRequireDefault(require("metro/src/lib/createWebsocketServer"));
|
|
9
12
|
var _url = require("url");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var _env = require("../../../utils/env");
|
|
13
|
+
var _log = require("../../../log");
|
|
14
|
+
var _getRunningProcess = require("../../../utils/getRunningProcess");
|
|
13
15
|
function _interopRequireDefault(obj) {
|
|
14
16
|
return obj && obj.__esModule ? obj : {
|
|
15
17
|
default: obj
|
|
16
18
|
};
|
|
17
19
|
}
|
|
18
20
|
const runServer = async (metroBundler, config, { hasReducedPerformance =false , host , onError , onReady , secureServerOptions , waitForBundler =false , websocketEndpoints ={} , watch })=>{
|
|
19
|
-
const projectRoot = metroBundler.projectRoot;
|
|
20
|
-
const Metro = (0, _resolveFromProject).importMetroFromProject(projectRoot);
|
|
21
|
-
const createWebsocketServer = (0, _resolveFromProject).importMetroCreateWebsocketServerFromProject(projectRoot);
|
|
22
|
-
const MetroHmrServer = (0, _resolveFromProject).importMetroHmrServerFromProject(projectRoot);
|
|
23
21
|
// await earlyPortCheck(host, config.server.port);
|
|
24
22
|
// if (secure != null || secureCert != null || secureKey != null) {
|
|
25
23
|
// // eslint-disable-next-line no-console
|
|
@@ -30,20 +28,13 @@ const runServer = async (metroBundler, config, { hasReducedPerformance =false ,
|
|
|
30
28
|
// "Metro's https development server.",
|
|
31
29
|
// );
|
|
32
30
|
// }
|
|
33
|
-
const { middleware , end , metroServer } = await
|
|
31
|
+
const { middleware , end , metroServer } = await _metro.default.createConnectMiddleware(config, {
|
|
34
32
|
hasReducedPerformance,
|
|
35
33
|
waitForBundler,
|
|
36
34
|
watch
|
|
37
35
|
});
|
|
38
36
|
(0, _assert).default(typeof middleware.use === "function");
|
|
39
37
|
const serverApp = middleware;
|
|
40
|
-
let inspectorProxy = null;
|
|
41
|
-
if (config.server.runInspectorProxy && !_env.env.EXPO_NO_INSPECTOR_PROXY) {
|
|
42
|
-
inspectorProxy = (0, _inspectorProxy).createInspectorProxy(metroBundler, config.projectRoot);
|
|
43
|
-
} else if (config.server.runInspectorProxy) {
|
|
44
|
-
const { InspectorProxy } = (0, _resolveFromProject).importMetroInspectorProxyFromProject(projectRoot);
|
|
45
|
-
inspectorProxy = new InspectorProxy(config.projectRoot);
|
|
46
|
-
}
|
|
47
38
|
let httpServer;
|
|
48
39
|
if (secureServerOptions != null) {
|
|
49
40
|
httpServer = _https.default.createServer(secureServerOptions, serverApp);
|
|
@@ -52,6 +43,14 @@ const runServer = async (metroBundler, config, { hasReducedPerformance =false ,
|
|
|
52
43
|
}
|
|
53
44
|
return new Promise((resolve, reject)=>{
|
|
54
45
|
httpServer.on("error", (error)=>{
|
|
46
|
+
if ("code" in error && error.code === "EADDRINUSE") {
|
|
47
|
+
// If `Error: listen EADDRINUSE: address already in use :::8081` then print additional info
|
|
48
|
+
// about the process before throwing.
|
|
49
|
+
const info = (0, _getRunningProcess).getRunningProcess(config.server.port);
|
|
50
|
+
if (info) {
|
|
51
|
+
_log.Log.error(`Port ${config.server.port} is busy running ${info.command} in: ${info.directory}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
55
54
|
if (onError) {
|
|
56
55
|
onError(error);
|
|
57
56
|
}
|
|
@@ -63,11 +62,9 @@ const runServer = async (metroBundler, config, { hasReducedPerformance =false ,
|
|
|
63
62
|
onReady(httpServer);
|
|
64
63
|
}
|
|
65
64
|
Object.assign(websocketEndpoints, {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"/hot": createWebsocketServer({
|
|
70
|
-
websocketServer: new MetroHmrServer(metroServer.getBundler(), metroServer.getCreateModuleId(), config)
|
|
65
|
+
// @ts-expect-error: incorrect types
|
|
66
|
+
"/hot": (0, _createWebsocketServer).default({
|
|
67
|
+
websocketServer: new _hmrServer.default(metroServer.getBundler(), metroServer.getCreateModuleId(), config)
|
|
71
68
|
})
|
|
72
69
|
});
|
|
73
70
|
httpServer.on("upgrade", (request, socket, head)=>{
|
|
@@ -80,13 +77,6 @@ const runServer = async (metroBundler, config, { hasReducedPerformance =false ,
|
|
|
80
77
|
socket.destroy();
|
|
81
78
|
}
|
|
82
79
|
});
|
|
83
|
-
if (inspectorProxy) {
|
|
84
|
-
// TODO(hypuk): Refactor inspectorProxy.processRequest into separate request handlers
|
|
85
|
-
// so that we could provide routes (/json/list and /json/version) here.
|
|
86
|
-
// Currently this causes Metro to give warning about T31407894.
|
|
87
|
-
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
|
|
88
|
-
serverApp.use(inspectorProxy.processRequest.bind(inspectorProxy));
|
|
89
|
-
}
|
|
90
80
|
resolve({
|
|
91
81
|
server: httpServer,
|
|
92
82
|
metro: metroServer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/metro/runServer-fork.ts"],"sourcesContent":["// Copyright © 2023 650 Industries.\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n//\n// Forks https://github.com/facebook/metro/blob/b80d9a0f638ee9fb82ff69cd3c8d9f4309ca1da2/packages/metro/src/index.flow.js#L57\n// and adds the ability to access the bundler instance.\nimport assert from 'assert';\nimport http from 'http';\nimport https from 'https';\nimport { RunServerOptions, Server } from 'metro';\nimport
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/metro/runServer-fork.ts"],"sourcesContent":["// Copyright © 2023 650 Industries.\n// Copyright (c) Meta Platforms, Inc. and affiliates.\n//\n// Forks https://github.com/facebook/metro/blob/b80d9a0f638ee9fb82ff69cd3c8d9f4309ca1da2/packages/metro/src/index.flow.js#L57\n// and adds the ability to access the bundler instance.\nimport assert from 'assert';\nimport http from 'http';\nimport https from 'https';\nimport Metro, { RunServerOptions, Server } from 'metro';\nimport MetroHmrServer from 'metro/src/HmrServer';\nimport createWebsocketServer from 'metro/src/lib/createWebsocketServer';\nimport { ConfigT } from 'metro-config';\nimport { parse } from 'url';\n\nimport { MetroBundlerDevServer } from './MetroBundlerDevServer';\nimport { Log } from '../../../log';\nimport { getRunningProcess } from '../../../utils/getRunningProcess';\nimport type { ConnectAppType } from '../middleware/server.types';\n\nexport const runServer = async (\n metroBundler: MetroBundlerDevServer,\n config: ConfigT,\n {\n hasReducedPerformance = false,\n host,\n onError,\n onReady,\n secureServerOptions,\n waitForBundler = false,\n websocketEndpoints = {},\n watch,\n }: RunServerOptions\n): Promise<{ server: http.Server | https.Server; metro: Server }> => {\n // await earlyPortCheck(host, config.server.port);\n\n // if (secure != null || secureCert != null || secureKey != null) {\n // // eslint-disable-next-line no-console\n // console.warn(\n // chalk.inverse.yellow.bold(' DEPRECATED '),\n // 'The `secure`, `secureCert`, and `secureKey` options are now deprecated. ' +\n // 'Please use the `secureServerOptions` object instead to pass options to ' +\n // \"Metro's https development server.\",\n // );\n // }\n\n const { middleware, end, metroServer } = await Metro.createConnectMiddleware(config, {\n hasReducedPerformance,\n waitForBundler,\n watch,\n });\n\n assert(typeof (middleware as any).use === 'function');\n const serverApp = middleware as ConnectAppType;\n\n let httpServer: http.Server | https.Server;\n\n if (secureServerOptions != null) {\n httpServer = https.createServer(secureServerOptions, serverApp);\n } else {\n httpServer = http.createServer(serverApp);\n }\n return new Promise<{ server: http.Server | https.Server; metro: Server }>((resolve, reject) => {\n httpServer.on('error', (error) => {\n if ('code' in error && error.code === 'EADDRINUSE') {\n // If `Error: listen EADDRINUSE: address already in use :::8081` then print additional info\n // about the process before throwing.\n const info = getRunningProcess(config.server.port);\n if (info) {\n Log.error(\n `Port ${config.server.port} is busy running ${info.command} in: ${info.directory}`\n );\n }\n }\n\n if (onError) {\n onError(error);\n }\n reject(error);\n end();\n });\n\n httpServer.listen(config.server.port, host, () => {\n if (onReady) {\n onReady(httpServer);\n }\n\n Object.assign(websocketEndpoints, {\n // @ts-expect-error: incorrect types\n '/hot': createWebsocketServer({\n websocketServer: new MetroHmrServer(\n metroServer.getBundler(),\n metroServer.getCreateModuleId(),\n config\n ),\n }),\n });\n\n httpServer.on('upgrade', (request, socket, head) => {\n const { pathname } = parse(request.url!);\n if (pathname != null && websocketEndpoints[pathname]) {\n websocketEndpoints[pathname].handleUpgrade(request, socket, head, (ws) => {\n websocketEndpoints[pathname].emit('connection', ws, request);\n });\n } else {\n socket.destroy();\n }\n });\n\n resolve({ server: httpServer, metro: metroServer });\n });\n\n // Disable any kind of automatic timeout behavior for incoming\n // requests in case it takes the packager more than the default\n // timeout of 120 seconds to respond to a request.\n httpServer.timeout = 0;\n\n httpServer.on('close', () => {\n end();\n });\n });\n};\n"],"names":["runServer","metroBundler","config","hasReducedPerformance","host","onError","onReady","secureServerOptions","waitForBundler","websocketEndpoints","watch","middleware","end","metroServer","Metro","createConnectMiddleware","assert","use","serverApp","httpServer","https","createServer","http","Promise","resolve","reject","on","error","code","info","getRunningProcess","server","port","Log","command","directory","listen","Object","assign","createWebsocketServer","websocketServer","MetroHmrServer","getBundler","getCreateModuleId","request","socket","head","pathname","parse","url","handleUpgrade","ws","emit","destroy","metro","timeout"],"mappings":"AAKA;;;;;AAAmB,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AACV,IAAA,KAAM,kCAAN,MAAM,EAAA;AACL,IAAA,MAAO,kCAAP,OAAO,EAAA;AACuB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAC5B,IAAA,UAAqB,kCAArB,qBAAqB,EAAA;AACd,IAAA,sBAAqC,kCAArC,qCAAqC,EAAA;AAEjD,IAAA,IAAK,WAAL,KAAK,CAAA;AAGP,IAAA,IAAc,WAAd,cAAc,CAAA;AACA,IAAA,kBAAkC,WAAlC,kCAAkC,CAAA;;;;;;AAG7D,MAAMA,SAAS,GAAG,OACvBC,YAAmC,EACnCC,MAAe,EACf,EACEC,qBAAqB,EAAG,KAAK,CAAA,EAC7BC,IAAI,CAAA,EACJC,OAAO,CAAA,EACPC,OAAO,CAAA,EACPC,mBAAmB,CAAA,EACnBC,cAAc,EAAG,KAAK,CAAA,EACtBC,kBAAkB,EAAG,EAAE,CAAA,EACvBC,KAAK,CAAA,EACY,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AM;oBACLC,MAAM,CAACQ,OAAO,EAAE,CAAC;iBAClB;aACF,CAAC,CAAC;YAEH7B,OAAO,CAAC;gBAAEO,MAAM,EAAEZ,UAAU;gBAAEmC,KAAK,EAAEzC,WAAW;aAAE,CAAC,CAAC;SACrD,CAAC,CAAC;QAEH,8DAA8D;QAC9D,+DAA+D;QAC/D,kDAAkD;QAClDM,UAAU,CAACoC,OAAO,GAAG,CAAC,CAAC;QAEvBpC,UAAU,CAACO,EAAE,CAAC,OAAO,EAAE,IAAM;YAC3Bd,GAAG,EAAE,CAAC;SACP,CAAC,CAAC;KACJ,CAAC,CAAC;CACJ,AAAC;QArGWZ,SAAS,GAATA,SAAS"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.serializeHtmlWithAssets = serializeHtmlWithAssets;
|
|
6
|
+
const debug = require("debug")("expo:metro:html");
|
|
7
|
+
function serializeHtmlWithAssets({ mode , resources , template , devBundleUrl , baseUrl , route }) {
|
|
8
|
+
if (!resources) {
|
|
9
|
+
return "";
|
|
10
|
+
}
|
|
11
|
+
const isDev = mode === "development";
|
|
12
|
+
return htmlFromSerialAssets(resources, {
|
|
13
|
+
dev: isDev,
|
|
14
|
+
template,
|
|
15
|
+
baseUrl,
|
|
16
|
+
bundleUrl: isDev ? devBundleUrl : undefined,
|
|
17
|
+
route
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function htmlFromSerialAssets(assets, { dev , template , baseUrl , bundleUrl , route }) {
|
|
21
|
+
// Combine the CSS modules into tags that have hot refresh data attributes.
|
|
22
|
+
const styleString = assets.filter((asset)=>asset.type === "css"
|
|
23
|
+
).map(({ metadata , filename , source })=>{
|
|
24
|
+
if (dev) {
|
|
25
|
+
return `<style data-expo-css-hmr="${metadata.hmrId}">` + source + "\n</style>";
|
|
26
|
+
} else {
|
|
27
|
+
return [
|
|
28
|
+
`<link rel="preload" href="${baseUrl}/${filename}" as="style">`,
|
|
29
|
+
`<link rel="stylesheet" href="${baseUrl}/${filename}">`,
|
|
30
|
+
].join("");
|
|
31
|
+
}
|
|
32
|
+
}).join("");
|
|
33
|
+
const jsAssets = assets.filter((asset)=>asset.type === "js"
|
|
34
|
+
);
|
|
35
|
+
const scripts = bundleUrl ? `<script src="${bundleUrl}" defer></script>` : jsAssets.map(({ filename , metadata })=>{
|
|
36
|
+
// TODO: Mark dependencies of the HTML and include them to prevent waterfalls.
|
|
37
|
+
if (metadata.isAsync) {
|
|
38
|
+
// We have the data required to match async chunks to the route's HTML file.
|
|
39
|
+
if ((route == null ? void 0 : route.entryPoints) && metadata.modulePaths && Array.isArray(route.entryPoints) && Array.isArray(metadata.modulePaths)) {
|
|
40
|
+
// TODO: Handle module IDs like `expo-router/build/views/Unmatched.js`
|
|
41
|
+
const doesAsyncChunkContainRouteEntryPoint = route.entryPoints.some((entryPoint)=>metadata.modulePaths.includes(entryPoint)
|
|
42
|
+
);
|
|
43
|
+
if (!doesAsyncChunkContainRouteEntryPoint) {
|
|
44
|
+
return "";
|
|
45
|
+
}
|
|
46
|
+
debug("Linking async chunk %s to HTML for route %s", filename, route.contextKey);
|
|
47
|
+
// Pass through to the next condition.
|
|
48
|
+
} else {
|
|
49
|
+
return "";
|
|
50
|
+
}
|
|
51
|
+
// Mark async chunks as defer so they don't block the page load.
|
|
52
|
+
// return `<script src="${baseUrl}/${filename}" defer></script>`;
|
|
53
|
+
}
|
|
54
|
+
return `<script src="${baseUrl}/${filename}" defer></script>`;
|
|
55
|
+
}).join("");
|
|
56
|
+
return template.replace("</head>", `${styleString}</head>`).replace("</body>", `${scripts}\n</body>`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=serializeHtml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/metro/serializeHtml.ts"],"sourcesContent":["import { SerialAsset } from '@expo/metro-config/build/serializer/serializerAssets';\nimport { RouteNode } from 'expo-router/build/Route';\n\nconst debug = require('debug')('expo:metro:html') as typeof console.log;\n\nexport function serializeHtmlWithAssets({\n mode,\n resources,\n template,\n devBundleUrl,\n baseUrl,\n route,\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 baseUrl: string;\n devBundleUrl?: string;\n route?: RouteNode;\n}): string {\n if (!resources) {\n return '';\n }\n const isDev = mode === 'development';\n return htmlFromSerialAssets(resources, {\n dev: isDev,\n template,\n baseUrl,\n bundleUrl: isDev ? devBundleUrl : undefined,\n route,\n });\n}\n\nfunction htmlFromSerialAssets(\n assets: SerialAsset[],\n {\n dev,\n template,\n baseUrl,\n bundleUrl,\n route,\n }: {\n dev: boolean;\n template: string;\n baseUrl: string;\n /** This is dev-only. */\n bundleUrl?: string;\n route?: RouteNode;\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=\"${baseUrl}/${filename}\" as=\"style\">`,\n `<link rel=\"stylesheet\" href=\"${baseUrl}/${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, metadata }) => {\n // TODO: Mark dependencies of the HTML and include them to prevent waterfalls.\n if (metadata.isAsync) {\n // We have the data required to match async chunks to the route's HTML file.\n if (\n route?.entryPoints &&\n metadata.modulePaths &&\n Array.isArray(route.entryPoints) &&\n Array.isArray(metadata.modulePaths)\n ) {\n // TODO: Handle module IDs like `expo-router/build/views/Unmatched.js`\n const doesAsyncChunkContainRouteEntryPoint = route.entryPoints.some((entryPoint) =>\n (metadata.modulePaths as string[]).includes(entryPoint)\n );\n if (!doesAsyncChunkContainRouteEntryPoint) {\n return '';\n }\n debug('Linking async chunk %s to HTML for route %s', filename, route.contextKey);\n // Pass through to the next condition.\n } else {\n return '';\n }\n // Mark async chunks as defer so they don't block the page load.\n // return `<script src=\"${baseUrl}/${filename}\" defer></script>`;\n }\n\n return `<script src=\"${baseUrl}/${filename}\" defer></script>`;\n })\n .join('');\n\n return template\n .replace('</head>', `${styleString}</head>`)\n .replace('</body>', `${scripts}\\n</body>`);\n}\n"],"names":["serializeHtmlWithAssets","debug","require","mode","resources","template","devBundleUrl","baseUrl","route","isDev","htmlFromSerialAssets","dev","bundleUrl","undefined","assets","styleString","filter","asset","type","map","metadata","filename","source","hmrId","join","jsAssets","scripts","isAsync","entryPoints","modulePaths","Array","isArray","doesAsyncChunkContainRouteEntryPoint","some","entryPoint","includes","contextKey","replace"],"mappings":"AAAA;;;;QAKgBA,uBAAuB,GAAvBA,uBAAuB;AAFvC,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,AAAsB,AAAC;AAEjE,SAASF,uBAAuB,CAAC,EACtCG,IAAI,CAAA,EACJC,SAAS,CAAA,EACTC,QAAQ,CAAA,EACRC,YAAY,CAAA,EACZC,OAAO,CAAA,EACPC,KAAK,CAAA,EASN,EAAU;IACT,IAAI,CAACJ,SAAS,EAAE;QACd,OAAO,EAAE,CAAC;KACX;IACD,MAAMK,KAAK,GAAGN,IAAI,KAAK,aAAa,AAAC;IACrC,OAAOO,oBAAoB,CAACN,SAAS,EAAE;QACrCO,GAAG,EAAEF,KAAK;QACVJ,QAAQ;QACRE,OAAO;QACPK,SAAS,EAAEH,KAAK,GAAGH,YAAY,GAAGO,SAAS;QAC3CL,KAAK;KACN,CAAC,CAAC;CACJ;AAED,SAASE,oBAAoB,CAC3BI,MAAqB,EACrB,EACEH,GAAG,CAAA,EACHN,QAAQ,CAAA,EACRE,OAAO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E,KAAK,CAACC,OAAO,CAACX,QAAQ,CAACS,WAAW,CAAC,EACnC;gBACA,sEAAsE;gBACtE,MAAMG,oCAAoC,GAAGxB,KAAK,CAACoB,WAAW,CAACK,IAAI,CAAC,CAACC,UAAU,GAC7E,AAACd,QAAQ,CAACS,WAAW,CAAcM,QAAQ,CAACD,UAAU,CAAC;gBAAA,CACxD,AAAC;gBACF,IAAI,CAACF,oCAAoC,EAAE;oBACzC,OAAO,EAAE,CAAC;iBACX;gBACD/B,KAAK,CAAC,6CAA6C,EAAEoB,QAAQ,EAAEb,KAAK,CAAC4B,UAAU,CAAC,CAAC;YACjF,sCAAsC;aACvC,MAAM;gBACL,OAAO,EAAE,CAAC;aACX;QACD,gEAAgE;QAChE,iEAAiE;SAClE;QAED,OAAO,CAAC,aAAa,EAAE7B,OAAO,CAAC,CAAC,EAAEc,QAAQ,CAAC,iBAAiB,CAAC,CAAC;KAC/D,CAAC,CACDG,IAAI,CAAC,EAAE,CAAC,AAAC;IAEhB,OAAOnB,QAAQ,CACZgC,OAAO,CAAC,SAAS,EAAE,CAAC,EAAEtB,WAAW,CAAC,OAAO,CAAC,CAAC,CAC3CsB,OAAO,CAAC,SAAS,EAAE,CAAC,EAAEX,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;CAC9C"}
|
|
@@ -12,9 +12,8 @@ function _interopRequireDefault(obj) {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
const debug = require("debug")("expo:start:server:metro:waitForTypescript");
|
|
15
|
-
function observeApiRouteChanges(
|
|
15
|
+
function observeApiRouteChanges(appDir, runner, callback) {
|
|
16
16
|
const watcher = runner.metro.getBundler().getBundler().getWatcher();
|
|
17
|
-
const appDir = _path.default.join(projectRoot, "app");
|
|
18
17
|
const listener = ({ eventsQueue })=>{
|
|
19
18
|
for (const event of eventsQueue){
|
|
20
19
|
if (// event.type === 'add' &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/metro/waitForMetroToObserveTypeScriptFile.ts"],"sourcesContent":["import path from 'path';\n\nimport type { ServerLike } from '../BundlerDevServer';\n\nconst debug = require('debug')('expo:start:server:metro:waitForTypescript') as typeof console.log;\n\n/**\n * Use the native file watcher / Metro ruleset to detect if a\n * TypeScript file is added to the project during development.\n */\nexport function observeApiRouteChanges(\n
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/metro/waitForMetroToObserveTypeScriptFile.ts"],"sourcesContent":["import path from 'path';\n\nimport type { ServerLike } from '../BundlerDevServer';\n\nconst debug = require('debug')('expo:start:server:metro:waitForTypescript') as typeof console.log;\n\n/**\n * Use the native file watcher / Metro ruleset to detect if a\n * TypeScript file is added to the project during development.\n */\nexport function observeApiRouteChanges(\n appDir: string,\n runner: {\n metro: import('metro').Server;\n server: ServerLike;\n },\n callback: (filepath: string, operation: string) => Promise<void>\n): () => void {\n const watcher = runner.metro.getBundler().getBundler().getWatcher();\n\n const listener = ({\n eventsQueue,\n }: {\n eventsQueue: {\n filePath: string;\n metadata?: {\n type: 'f' | 'd' | 'l'; // Regular file / Directory / Symlink\n } | null;\n type: string;\n }[];\n }) => {\n for (const event of eventsQueue) {\n if (\n // event.type === 'add' &&\n // event.metadata?.type !== 'd' &&\n // We need to ignore node_modules because Metro will add all of the files in node_modules to the watcher.\n !/node_modules/.test(event.filePath) &&\n event.filePath.startsWith(appDir)\n ) {\n const { filePath } = event;\n callback(filePath, event.type);\n }\n }\n };\n\n watcher.addListener('change', listener);\n\n const off = () => {\n watcher.removeListener('change', listener);\n };\n\n runner.server.addListener?.('close', off);\n return off;\n}\n\n/**\n * Use the native file watcher / Metro ruleset to detect if a\n * TypeScript file is added to the project during development.\n */\nexport function waitForMetroToObserveTypeScriptFile(\n projectRoot: string,\n runner: {\n metro: import('metro').Server;\n server: ServerLike;\n },\n callback: () => Promise<void>\n): () => void {\n const watcher = runner.metro.getBundler().getBundler().getWatcher();\n\n const tsconfigPath = path.join(projectRoot, 'tsconfig.json');\n\n const listener = ({\n eventsQueue,\n }: {\n eventsQueue: {\n filePath: string;\n metadata?: {\n type: 'f' | 'd' | 'l'; // Regular file / Directory / Symlink\n } | null;\n type: string;\n }[];\n }) => {\n for (const event of eventsQueue) {\n if (\n event.type === 'add' &&\n event.metadata?.type !== 'd' &&\n // We need to ignore node_modules because Metro will add all of the files in node_modules to the watcher.\n !/node_modules/.test(event.filePath)\n ) {\n const { filePath } = event;\n // Is TypeScript?\n if (\n // If the user adds a TypeScript file to the observable files in their project.\n /\\.tsx?$/.test(filePath) ||\n // Or if the user adds a tsconfig.json file to the project root.\n filePath === tsconfigPath\n ) {\n debug('Detected TypeScript file added to the project: ', filePath);\n callback();\n off();\n return;\n }\n }\n }\n };\n\n debug('Waiting for TypeScript files to be added to the project...');\n watcher.addListener('change', listener);\n\n const off = () => {\n watcher.removeListener('change', listener);\n };\n\n runner.server.addListener?.('close', off);\n return off;\n}\n\nexport function observeFileChanges(\n runner: {\n metro: import('metro').Server;\n server: ServerLike;\n },\n files: string[],\n callback: () => void | Promise<void>\n): () => void {\n const watcher = runner.metro.getBundler().getBundler().getWatcher();\n\n const listener = ({\n eventsQueue,\n }: {\n eventsQueue: {\n filePath: string;\n metadata?: {\n type: 'f' | 'd' | 'l'; // Regular file / Directory / Symlink\n } | null;\n type: string;\n }[];\n }) => {\n for (const event of eventsQueue) {\n if (\n // event.type === 'add' &&\n event.metadata?.type !== 'd' &&\n // We need to ignore node_modules because Metro will add all of the files in node_modules to the watcher.\n !/node_modules/.test(event.filePath)\n ) {\n const { filePath } = event;\n // Is TypeScript?\n if (files.includes(filePath)) {\n debug('Observed change:', filePath);\n callback();\n return;\n }\n }\n }\n };\n\n debug('Watching file changes:', files);\n watcher.addListener('change', listener);\n\n const off = () => {\n watcher.removeListener('change', listener);\n };\n\n runner.server.addListener?.('close', off);\n return off;\n}\n"],"names":["observeApiRouteChanges","waitForMetroToObserveTypeScriptFile","observeFileChanges","debug","require","appDir","runner","callback","watcher","metro","getBundler","getWatcher","listener","eventsQueue","event","test","filePath","startsWith","type","addListener","off","removeListener","server","projectRoot","tsconfigPath","path","join","metadata","files","includes"],"mappings":"AAAA;;;;QAUgBA,sBAAsB,GAAtBA,sBAAsB;QAiDtBC,mCAAmC,GAAnCA,mCAAmC;QA0DnCC,kBAAkB,GAAlBA,kBAAkB;AArHjB,IAAA,KAAM,kCAAN,MAAM,EAAA;;;;;;AAIvB,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,2CAA2C,CAAC,AAAsB,AAAC;AAM3F,SAASJ,sBAAsB,CACpCK,MAAc,EACdC,MAGC,EACDC,QAAgE,EACpD;IACZ,MAAMC,OAAO,GAAGF,MAAM,CAACG,KAAK,CAACC,UAAU,EAAE,CAACA,UAAU,EAAE,CAACC,UAAU,EAAE,AAAC;IAEpE,MAAMC,QAAQ,GAAG,CAAC,EAChBC,WAAW,CAAA,EASZ,GAAK;QACJ,KAAK,MAAMC,KAAK,IAAID,WAAW,CAAE;YAC/B,IACE,0BAA0B;YAC1B,kCAAkC;YAClC,yGAAyG;YACzG,CAAC,eAAeE,IAAI,CAACD,KAAK,CAACE,QAAQ,CAAC,IACpCF,KAAK,CAACE,QAAQ,CAACC,UAAU,CAACZ,MAAM,CAAC,EACjC;gBACA,MAAM,EAAEW,QAAQ,CAAA,EAAE,GAAGF,KAAK,AAAC;gBAC3BP,QAAQ,CAACS,QAAQ,EAAEF,KAAK,CAACI,IAAI,CAAC,CAAC;aAChC;SACF;KACF,AAAC;IAEFV,OAAO,CAACW,WAAW,CAAC,QAAQ,EAAEP,QAAQ,CAAC,CAAC;IAExC,MAAMQ,GAAG,GAAG,IAAM;QAChBZ,OAAO,CAACa,cAAc,CAAC,QAAQ,EAAET,QAAQ,CAAC,CAAC;KAC5C,AAAC;IAEFN,MAAM,CAACgB,MAAM,CAACH,WAAW,QAAgB,GAAzCb,KAAAA,CAAyC,GAAzCA,MAAM,CAACgB,MAAM,CAACH,WAAW,CAAG,OAAO,EAAEC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