@depup/expo__cli 55.0.22-depup.1 → 57.0.9-depup.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/LICENSE +21 -0
- package/README.md +13 -18
- package/build/bin/cli +4 -4
- package/build/bin/cli.map +1 -1
- package/build/src/api/endpoint.js +4 -4
- package/build/src/api/endpoint.js.map +1 -1
- package/build/src/api/getExpoSchema.js +3 -3
- package/build/src/api/getExpoSchema.js.map +1 -1
- package/build/src/api/graphql/client.js +26 -14
- package/build/src/api/graphql/client.js.map +1 -1
- package/build/src/api/graphql/mutations/TunnelMutation.js +31 -0
- package/build/src/api/graphql/mutations/TunnelMutation.js.map +1 -0
- package/build/src/api/rest/cache/FileSystemResponseCache.js.map +1 -1
- package/build/src/api/rest/cache/ResponseCache.js +5 -5
- package/build/src/api/rest/cache/ResponseCache.js.map +1 -1
- package/build/src/api/rest/client.js +35 -20
- package/build/src/api/rest/client.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithBaseUrl.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithOffline.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithProgress.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithUserAgent.js.map +1 -1
- package/build/src/api/updateDevelopmentSession.js +6 -5
- package/build/src/api/updateDevelopmentSession.js.map +1 -1
- package/build/src/api/user/UserSettings.js +28 -15
- package/build/src/api/user/UserSettings.js.map +1 -1
- package/build/src/api/user/actions.js +10 -3
- package/build/src/api/user/actions.js.map +1 -1
- package/build/src/api/user/expoSsoLauncher.js +76 -24
- package/build/src/api/user/expoSsoLauncher.js.map +1 -1
- package/build/src/api/user/otp.js +4 -4
- package/build/src/api/user/otp.js.map +1 -1
- package/build/src/api/user/user.js +19 -7
- package/build/src/api/user/user.js.map +1 -1
- package/build/src/config/configAsync.js +3 -3
- package/build/src/config/configAsync.js.map +1 -1
- package/build/src/config/index.js.map +1 -1
- package/build/src/customize/customizeAsync.js.map +1 -1
- package/build/src/customize/generate.js +7 -4
- package/build/src/customize/generate.js.map +1 -1
- package/build/src/customize/index.js.map +1 -1
- package/build/src/customize/templates.js +4 -6
- package/build/src/customize/templates.js.map +1 -1
- package/build/src/customize/typescript.js.map +1 -1
- package/build/src/events/index.js +19 -15
- package/build/src/events/index.js.map +1 -1
- package/build/src/events/stream.js +94 -24
- package/build/src/events/stream.js.map +1 -1
- package/build/src/expoUpdatesExports.js +50 -7
- package/build/src/expoUpdatesExports.js.map +1 -1
- package/build/src/export/createMetadataJson.js +2 -1
- package/build/src/export/createMetadataJson.js.map +1 -1
- package/build/src/export/embed/exportEmbedAsync.js +58 -24
- package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
- package/build/src/export/embed/exportServer.js +1 -1
- package/build/src/export/embed/exportServer.js.map +1 -1
- package/build/src/export/embed/index.js +1 -1
- package/build/src/export/embed/index.js.map +1 -1
- package/build/src/export/embed/resolveOptions.js +7 -6
- package/build/src/export/embed/resolveOptions.js.map +1 -1
- package/build/src/export/embed/xcodeCompilerLogger.js +7 -7
- package/build/src/export/embed/xcodeCompilerLogger.js.map +1 -1
- package/build/src/export/exportApp.js +40 -30
- package/build/src/export/exportApp.js.map +1 -1
- package/build/src/export/exportAssets.js +5 -5
- package/build/src/export/exportAssets.js.map +1 -1
- package/build/src/export/exportAsync.js.map +1 -1
- package/build/src/export/exportDomComponents.js +16 -9
- package/build/src/export/exportDomComponents.js.map +1 -1
- package/build/src/export/exportHermes.js +23 -13
- package/build/src/export/exportHermes.js.map +1 -1
- package/build/src/export/exportStaticAsync.js +30 -21
- package/build/src/export/exportStaticAsync.js.map +1 -1
- package/build/src/export/favicon.js +26 -34
- package/build/src/export/favicon.js.map +1 -1
- package/build/src/export/getPublicExpoManifest.js.map +1 -1
- package/build/src/export/getResolvedLocales.js.map +1 -1
- package/build/src/export/html.js +3 -3
- package/build/src/export/html.js.map +1 -1
- package/build/src/export/index.js +2 -0
- package/build/src/export/index.js.map +1 -1
- package/build/src/export/metroAssetLocalPath.js +4 -4
- package/build/src/export/metroAssetLocalPath.js.map +1 -1
- package/build/src/export/persistMetroAssets.js +6 -6
- package/build/src/export/persistMetroAssets.js.map +1 -1
- package/build/src/export/publicFolder.js +16 -4
- package/build/src/export/publicFolder.js.map +1 -1
- package/build/src/export/resolveOptions.js +12 -13
- package/build/src/export/resolveOptions.js.map +1 -1
- package/build/src/export/saveAssets.js +3 -3
- package/build/src/export/saveAssets.js.map +1 -1
- package/build/src/export/static.js +6 -0
- package/build/src/export/static.js.map +1 -0
- package/build/src/export/web/exportWebAsync.js.map +1 -1
- package/build/src/export/web/index.js.map +1 -1
- package/build/src/export/writeContents.js.map +1 -1
- package/build/src/install/checkPackages.js +1 -28
- package/build/src/install/checkPackages.js.map +1 -1
- package/build/src/install/fixPackages.js.map +1 -1
- package/build/src/install/index.js.map +1 -1
- package/build/src/install/installAsync.js +3 -3
- package/build/src/install/installAsync.js.map +1 -1
- package/build/src/install/installExpoPackage.js.map +1 -1
- package/build/src/install/resolveOptions.js.map +1 -1
- package/build/src/install/utils/autoAddConfigPlugins.js +3 -3
- package/build/src/install/utils/autoAddConfigPlugins.js.map +1 -1
- package/build/src/install/utils/checkPackagesCompatibility.js +32 -16
- package/build/src/install/utils/checkPackagesCompatibility.js.map +1 -1
- package/build/src/lint/ESlintPrerequisite.js.map +1 -1
- package/build/src/log.js +32 -14
- package/build/src/log.js.map +1 -1
- package/build/src/login/index.js +25 -5
- package/build/src/login/index.js.map +1 -1
- package/build/src/logout/index.js.map +1 -1
- package/build/src/prebuild/clearNativeFolder.js +49 -14
- package/build/src/prebuild/clearNativeFolder.js.map +1 -1
- package/build/src/prebuild/configureProjectAsync.js.map +1 -1
- package/build/src/prebuild/copyTemplateFiles.js +3 -3
- package/build/src/prebuild/copyTemplateFiles.js.map +1 -1
- package/build/src/prebuild/ensureConfigAsync.js.map +1 -1
- package/build/src/prebuild/index.js +3 -2
- package/build/src/prebuild/index.js.map +1 -1
- package/build/src/prebuild/prebuildAsync.js +31 -6
- package/build/src/prebuild/prebuildAsync.js.map +1 -1
- package/build/src/prebuild/renameTemplateAppName.js +8 -5
- package/build/src/prebuild/renameTemplateAppName.js.map +1 -1
- package/build/src/prebuild/resolveOptions.js +7 -7
- package/build/src/prebuild/resolveOptions.js.map +1 -1
- package/build/src/prebuild/resolveTemplate.js +10 -5
- package/build/src/prebuild/resolveTemplate.js.map +1 -1
- package/build/src/prebuild/updateFromTemplate.js +3 -3
- package/build/src/prebuild/updateFromTemplate.js.map +1 -1
- package/build/src/prebuild/updatePackageJson.js +7 -7
- package/build/src/prebuild/updatePackageJson.js.map +1 -1
- package/build/src/prebuild/validateTemplatePlatforms.js.map +1 -1
- package/build/src/register/index.js.map +1 -1
- package/build/src/run/android/index.js.map +1 -1
- package/build/src/run/android/resolveGradlePropsAsync.js +3 -4
- package/build/src/run/android/resolveGradlePropsAsync.js.map +1 -1
- package/build/src/run/android/resolveInstallApkName.js +48 -1
- package/build/src/run/android/resolveInstallApkName.js.map +1 -1
- package/build/src/run/android/resolveLaunchProps.js +4 -1
- package/build/src/run/android/resolveLaunchProps.js.map +1 -1
- package/build/src/run/android/resolveOptions.js.map +1 -1
- package/build/src/run/android/runAndroidAsync.js.map +1 -1
- package/build/src/run/ensureNativeProject.js.map +1 -1
- package/build/src/run/hints.js +4 -4
- package/build/src/run/hints.js.map +1 -1
- package/build/src/run/index.js.map +1 -1
- package/build/src/run/ios/XcodeBuild.js +163 -23
- package/build/src/run/ios/XcodeBuild.js.map +1 -1
- package/build/src/run/ios/appleDevice/AppleDevice.js +6 -5
- package/build/src/run/ios/appleDevice/AppleDevice.js.map +1 -1
- package/build/src/run/ios/appleDevice/ClientManager.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/AFCClient.js +10 -16
- package/build/src/run/ios/appleDevice/client/AFCClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/DebugserverClient.js +1 -1
- package/build/src/run/ios/appleDevice/client/DebugserverClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/InstallationProxyClient.js +2 -1
- package/build/src/run/ios/appleDevice/client/InstallationProxyClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/LockdowndClient.js +1 -1
- package/build/src/run/ios/appleDevice/client/LockdowndClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/MobileImageMounterClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/ServiceClient.js +3 -3
- package/build/src/run/ios/appleDevice/client/ServiceClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/UsbmuxdClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/installOnDeviceAsync.js +3 -3
- package/build/src/run/ios/appleDevice/installOnDeviceAsync.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/AFCProtocol.js +16 -13
- package/build/src/run/ios/appleDevice/protocol/AFCProtocol.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/AbstractProtocol.js +6 -6
- package/build/src/run/ios/appleDevice/protocol/AbstractProtocol.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/GDBProtocol.js +5 -5
- package/build/src/run/ios/appleDevice/protocol/GDBProtocol.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/LockdownProtocol.js +7 -7
- package/build/src/run/ios/appleDevice/protocol/LockdownProtocol.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/UsbmuxProtocol.js +5 -5
- package/build/src/run/ios/appleDevice/protocol/UsbmuxProtocol.js.map +1 -1
- package/build/src/run/ios/codeSigning/Security.js +8 -8
- package/build/src/run/ios/codeSigning/Security.js.map +1 -1
- package/build/src/run/ios/codeSigning/configureCodeSigning.js +5 -3
- package/build/src/run/ios/codeSigning/configureCodeSigning.js.map +1 -1
- package/build/src/run/ios/codeSigning/resolveCertificateSigningIdentity.js +7 -5
- package/build/src/run/ios/codeSigning/resolveCertificateSigningIdentity.js.map +1 -1
- package/build/src/run/ios/codeSigning/settings.js +3 -3
- package/build/src/run/ios/codeSigning/settings.js.map +1 -1
- package/build/src/run/ios/codeSigning/xcodeCodeSigning.js +4 -4
- package/build/src/run/ios/codeSigning/xcodeCodeSigning.js.map +1 -1
- package/build/src/run/ios/index.js +8 -1
- package/build/src/run/ios/index.js.map +1 -1
- package/build/src/run/ios/launchApp.js +3 -3
- package/build/src/run/ios/launchApp.js.map +1 -1
- package/build/src/run/ios/options/appleDestinations.js.map +1 -1
- package/build/src/run/ios/options/promptDevice.js +3 -3
- package/build/src/run/ios/options/promptDevice.js.map +1 -1
- package/build/src/run/ios/options/resolveDevice.js +8 -3
- package/build/src/run/ios/options/resolveDevice.js.map +1 -1
- package/build/src/run/ios/options/resolveNativeScheme.js +4 -4
- package/build/src/run/ios/options/resolveNativeScheme.js.map +1 -1
- package/build/src/run/ios/options/resolveOptions.js +9 -4
- package/build/src/run/ios/options/resolveOptions.js.map +1 -1
- package/build/src/run/ios/options/resolveXcodeProject.js.map +1 -1
- package/build/src/run/ios/runIosAsync.js +39 -0
- package/build/src/run/ios/runIosAsync.js.map +1 -1
- package/build/src/run/ios/validateExternalBinary.js.map +1 -1
- package/build/src/run/startBundler.js +4 -0
- package/build/src/run/startBundler.js.map +1 -1
- package/build/src/serve/index.js +4 -1
- package/build/src/serve/index.js.map +1 -1
- package/build/src/serve/serveAsync.js +23 -11
- package/build/src/serve/serveAsync.js.map +1 -1
- package/build/src/serve/static.js +69 -0
- package/build/src/serve/static.js.map +1 -0
- package/build/src/start/checkDependenciesOnStart.js +131 -0
- package/build/src/start/checkDependenciesOnStart.js.map +1 -0
- package/build/src/start/detectDevClient.js +3 -3
- package/build/src/start/detectDevClient.js.map +1 -1
- package/build/src/start/doctor/Prerequisite.js +4 -4
- package/build/src/start/doctor/Prerequisite.js.map +1 -1
- package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js +53 -91
- package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js.map +1 -1
- package/build/src/start/doctor/apple/XcodePrerequisite.js +3 -3
- package/build/src/start/doctor/apple/XcodePrerequisite.js.map +1 -1
- package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js +3 -3
- package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js.map +1 -1
- package/build/src/start/doctor/dependencies/getMissingPackages.js +5 -5
- package/build/src/start/doctor/dependencies/getMissingPackages.js.map +1 -1
- package/build/src/start/doctor/dependencies/getVersionedPackages.js +5 -5
- package/build/src/start/doctor/dependencies/getVersionedPackages.js.map +1 -1
- package/build/src/start/doctor/dependencies/reactNativeTv.js +149 -0
- package/build/src/start/doctor/dependencies/reactNativeTv.js.map +1 -0
- package/build/src/start/doctor/dependencies/resolvePackages.js +4 -4
- package/build/src/start/doctor/dependencies/resolvePackages.js.map +1 -1
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js +33 -8
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js.map +1 -1
- package/build/src/start/doctor/ngrok/ExternalModule.js +14 -9
- package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -1
- package/build/src/start/doctor/ngrok/NgrokResolver.js +3 -3
- package/build/src/start/doctor/ngrok/NgrokResolver.js.map +1 -1
- package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js.map +1 -1
- package/build/src/start/doctor/typescript/updateTSConfig.js +3 -3
- package/build/src/start/doctor/typescript/updateTSConfig.js.map +1 -1
- package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js +5 -12
- package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js.map +1 -1
- package/build/src/start/index.js +2 -0
- package/build/src/start/index.js.map +1 -1
- package/build/src/start/interface/KeyPressHandler.js.map +1 -1
- package/build/src/start/interface/cliExtensionMenuItemHandler.js.map +1 -1
- package/build/src/start/interface/commandsTable.js +6 -6
- package/build/src/start/interface/commandsTable.js.map +1 -1
- package/build/src/start/interface/createDevToolsMenuItems.js.map +1 -1
- package/build/src/start/interface/interactiveActions.js +49 -6
- package/build/src/start/interface/interactiveActions.js.map +1 -1
- package/build/src/start/interface/startInterface.js +13 -4
- package/build/src/start/interface/startInterface.js.map +1 -1
- package/build/src/start/platforms/AppIdResolver.js +4 -0
- package/build/src/start/platforms/AppIdResolver.js.map +1 -1
- package/build/src/start/platforms/DeviceManager.js.map +1 -1
- package/build/src/start/platforms/ExpoGoInstaller.js +13 -4
- package/build/src/start/platforms/ExpoGoInstaller.js.map +1 -1
- package/build/src/start/platforms/PlatformManager.js.map +1 -1
- package/build/src/start/platforms/android/AndroidAppIdResolver.js.map +1 -1
- package/build/src/start/platforms/android/AndroidDeviceManager.js.map +1 -1
- package/build/src/start/platforms/android/AndroidPlatformManager.js.map +1 -1
- package/build/src/start/platforms/android/activateWindow.js.map +1 -1
- package/build/src/start/platforms/android/adb.js +36 -34
- package/build/src/start/platforms/android/adb.js.map +1 -1
- package/build/src/start/platforms/android/adbReverse.js +4 -4
- package/build/src/start/platforms/android/adbReverse.js.map +1 -1
- package/build/src/start/platforms/android/emulator.js +5 -5
- package/build/src/start/platforms/android/emulator.js.map +1 -1
- package/build/src/start/platforms/android/getDevices.js.map +1 -1
- package/build/src/start/platforms/android/gradle.js +5 -5
- package/build/src/start/platforms/android/gradle.js.map +1 -1
- package/build/src/start/platforms/android/promptAndroidDevice.js +3 -3
- package/build/src/start/platforms/android/promptAndroidDevice.js.map +1 -1
- package/build/src/start/platforms/ios/AppleAppIdResolver.js.map +1 -1
- package/build/src/start/platforms/ios/AppleDeviceManager.js +20 -6
- package/build/src/start/platforms/ios/AppleDeviceManager.js.map +1 -1
- package/build/src/start/platforms/ios/ApplePlatformManager.js +11 -0
- package/build/src/start/platforms/ios/ApplePlatformManager.js.map +1 -1
- package/build/src/start/platforms/ios/devicectl.js +7 -7
- package/build/src/start/platforms/ios/devicectl.js.map +1 -1
- package/build/src/start/platforms/ios/ensureSimulatorAppRunning.js +26 -11
- package/build/src/start/platforms/ios/ensureSimulatorAppRunning.js.map +1 -1
- package/build/src/start/platforms/ios/getBestSimulator.js +5 -5
- package/build/src/start/platforms/ios/getBestSimulator.js.map +1 -1
- package/build/src/start/platforms/ios/promptAppleDevice.js +5 -4
- package/build/src/start/platforms/ios/promptAppleDevice.js.map +1 -1
- package/build/src/start/platforms/ios/simctl.js +25 -19
- package/build/src/start/platforms/ios/simctl.js.map +1 -1
- package/build/src/start/platforms/ios/simctlLogging.js +3 -3
- package/build/src/start/platforms/ios/simctlLogging.js.map +1 -1
- package/build/src/start/platforms/ios/xcrun.js +3 -3
- package/build/src/start/platforms/ios/xcrun.js.map +1 -1
- package/build/src/start/project/devices.js +6 -6
- package/build/src/start/project/devices.js.map +1 -1
- package/build/src/start/project/dotExpo.js +4 -3
- package/build/src/start/project/dotExpo.js.map +1 -1
- package/build/src/start/resolveOptions.js +7 -7
- package/build/src/start/resolveOptions.js.map +1 -1
- package/build/src/start/server/AsyncNgrok.js +1 -1
- package/build/src/start/server/AsyncNgrok.js.map +1 -1
- package/build/src/start/server/AsyncWsTunnel.js +120 -35
- package/build/src/start/server/AsyncWsTunnel.js.map +1 -1
- package/build/src/start/server/Bonjour.js +8 -3
- package/build/src/start/server/Bonjour.js.map +1 -1
- package/build/src/start/server/BundlerDevServer.js +23 -9
- package/build/src/start/server/BundlerDevServer.js.map +1 -1
- package/build/src/start/server/DevServerManager.js.map +1 -1
- package/build/src/start/server/DevToolsPlugin.js +63 -3
- package/build/src/start/server/DevToolsPlugin.js.map +1 -1
- package/build/src/start/server/DevToolsPlugin.schema.js +8 -3
- package/build/src/start/server/DevToolsPlugin.schema.js.map +1 -1
- package/build/src/start/server/DevToolsPluginCliExtensionExecutor.js +58 -23
- package/build/src/start/server/DevToolsPluginCliExtensionExecutor.js.map +1 -1
- package/build/src/start/server/DevToolsPluginCliExtensionResults.js +29 -0
- package/build/src/start/server/DevToolsPluginCliExtensionResults.js.map +1 -1
- package/build/src/start/server/DevToolsPluginManager.js +20 -6
- package/build/src/start/server/DevToolsPluginManager.js.map +1 -1
- package/build/src/start/server/DevToolsPluginServerHelpers.js +83 -0
- package/build/src/start/server/DevToolsPluginServerHelpers.js.map +1 -0
- package/build/src/start/server/DevelopmentSession.js +41 -24
- package/build/src/start/server/DevelopmentSession.js.map +1 -1
- package/build/src/start/server/MCP.js +10 -3
- package/build/src/start/server/MCP.js.map +1 -1
- package/build/src/start/server/MCPDevToolsPluginCLIExtensions.js +15 -5
- package/build/src/start/server/MCPDevToolsPluginCLIExtensions.js.map +1 -1
- package/build/src/start/server/UrlCreator.js +14 -1
- package/build/src/start/server/UrlCreator.js.map +1 -1
- package/build/src/start/server/createMCPDevToolsExtensionSchema.js +18 -4
- package/build/src/start/server/createMCPDevToolsExtensionSchema.js.map +1 -1
- package/build/src/start/server/getStaticRenderFunctions.js +13 -24
- package/build/src/start/server/getStaticRenderFunctions.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +245 -114
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/MetroTerminalReporter.js +67 -16
- package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
- package/build/src/start/server/metro/TerminalReporter.js +22 -4
- package/build/src/start/server/metro/TerminalReporter.js.map +1 -1
- package/build/src/start/server/metro/createExpoAutolinkingResolver.js +25 -12
- package/build/src/start/server/metro/createExpoAutolinkingResolver.js.map +1 -1
- package/build/src/start/server/metro/createExpoFallbackResolver.js +39 -0
- package/build/src/start/server/metro/createExpoFallbackResolver.js.map +1 -1
- package/build/src/start/server/metro/createFileMap-fork.js +196 -0
- package/build/src/start/server/metro/createFileMap-fork.js.map +1 -0
- package/build/src/start/server/metro/createServerComponentsMiddleware.js +22 -22
- package/build/src/start/server/metro/createServerComponentsMiddleware.js.map +1 -1
- package/build/src/start/server/metro/createServerRouteMiddleware.js.map +1 -1
- package/build/src/start/server/metro/createTypescriptResolver.js +410 -0
- package/build/src/start/server/metro/createTypescriptResolver.js.map +1 -0
- package/build/src/start/server/metro/debugging/MessageHandler.js.map +1 -1
- package/build/src/start/server/metro/debugging/attachAtlas.js +3 -3
- package/build/src/start/server/metro/debugging/attachAtlas.js.map +1 -1
- package/build/src/start/server/metro/debugging/createDebugMiddleware.js +6 -5
- package/build/src/start/server/metro/debugging/createDebugMiddleware.js.map +1 -1
- package/build/src/start/server/metro/debugging/createHandlersFactory.js.map +1 -1
- package/build/src/start/server/metro/debugging/messageHandlers/NetworkResponse.js +20 -4
- package/build/src/start/server/metro/debugging/messageHandlers/NetworkResponse.js.map +1 -1
- package/build/src/start/server/metro/debugging/pageIsSupported.js.map +1 -1
- package/build/src/start/server/metro/dev-server/compression.js.map +1 -1
- package/build/src/start/server/metro/dev-server/createMessageSocket.js +13 -2
- package/build/src/start/server/metro/dev-server/createMessageSocket.js.map +1 -1
- package/build/src/start/server/metro/dev-server/createMetroMiddleware.js +9 -2
- package/build/src/start/server/metro/dev-server/createMetroMiddleware.js.map +1 -1
- package/build/src/start/server/metro/dev-server/utils/socketMessages.js +3 -3
- package/build/src/start/server/metro/dev-server/utils/socketMessages.js.map +1 -1
- package/build/src/start/server/metro/errors/FailedToResolveNativeOnlyModuleError.js.map +1 -1
- package/build/src/start/server/metro/externals.js +4 -4
- package/build/src/start/server/metro/externals.js.map +1 -1
- package/build/src/start/server/metro/fetchRouterManifest.js +3 -3
- package/build/src/start/server/metro/fetchRouterManifest.js.map +1 -1
- package/build/src/start/server/metro/getCssModulesFromBundler.js +3 -3
- package/build/src/start/server/metro/getCssModulesFromBundler.js.map +1 -1
- package/build/src/start/server/metro/instantiateMetro.js +141 -57
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/start/server/metro/log-box/LogBoxLog.js.map +1 -1
- package/build/src/start/server/metro/log-box/LogBoxSymbolication.js +4 -4
- package/build/src/start/server/metro/log-box/LogBoxSymbolication.js.map +1 -1
- package/build/src/start/server/metro/log-box/formatProjectFilePath.js +3 -3
- package/build/src/start/server/metro/log-box/formatProjectFilePath.js.map +1 -1
- package/build/src/start/server/metro/metroErrorInterface.js +16 -13
- package/build/src/start/server/metro/metroErrorInterface.js.map +1 -1
- package/build/src/start/server/metro/metroErrors.js +3 -3
- package/build/src/start/server/metro/metroErrors.js.map +1 -1
- package/build/src/start/server/metro/metroWatchTypeScriptFiles.js +48 -16
- package/build/src/start/server/metro/metroWatchTypeScriptFiles.js.map +1 -1
- package/build/src/start/server/metro/resolveLoader.js +3 -3
- package/build/src/start/server/metro/resolveLoader.js.map +1 -1
- package/build/src/start/server/metro/router.js +23 -14
- package/build/src/start/server/metro/router.js.map +1 -1
- package/build/src/start/server/metro/runServer-fork.js +13 -10
- package/build/src/start/server/metro/runServer-fork.js.map +1 -1
- package/build/src/start/server/metro/serializeHtml.js +29 -13
- package/build/src/start/server/metro/serializeHtml.js.map +1 -1
- package/build/src/start/server/metro/waitForMetroToObserveTypeScriptFile.js +36 -34
- package/build/src/start/server/metro/waitForMetroToObserveTypeScriptFile.js.map +1 -1
- package/build/src/start/server/metro/withMetroErrorReportingResolver.js +53 -30
- package/build/src/start/server/metro/withMetroErrorReportingResolver.js.map +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js +187 -126
- package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
- package/build/src/start/server/metro/withMetroResolvers.js +4 -4
- package/build/src/start/server/metro/withMetroResolvers.js.map +1 -1
- package/build/src/start/server/middleware/ContextModuleSourceMapsMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/CorsMiddleware.js +3 -3
- package/build/src/start/server/middleware/CorsMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/CreateFileMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/DevToolsPluginMiddleware.js +60 -9
- package/build/src/start/server/middleware/DevToolsPluginMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/DomComponentsMiddleware.js +30 -17
- package/build/src/start/server/middleware/DomComponentsMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js +6 -4
- package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ExpoMiddleware.js +3 -3
- package/build/src/start/server/middleware/ExpoMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/FaviconMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/HistoryFallbackMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/InterstitialPageMiddleware.js +13 -8
- package/build/src/start/server/middleware/InterstitialPageMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ManifestMiddleware.js +19 -47
- package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/OpenMiddleware.js +150 -0
- package/build/src/start/server/middleware/OpenMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js +13 -4
- package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ServeStaticMiddleware.js +2 -9
- package/build/src/start/server/middleware/ServeStaticMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/domPolyfills.js +60 -0
- package/build/src/start/server/middleware/domPolyfills.js.map +1 -0
- package/build/src/start/server/middleware/inspector/JsInspector.js +6 -31
- package/build/src/start/server/middleware/inspector/JsInspector.js.map +1 -1
- package/build/src/start/server/middleware/inspector/createJsInspectorMiddleware.js +14 -24
- package/build/src/start/server/middleware/inspector/createJsInspectorMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/inspector/middlwareMutations.js +3 -3
- package/build/src/start/server/middleware/inspector/middlwareMutations.js.map +1 -1
- package/build/src/start/server/middleware/metroOptions.js +15 -14
- package/build/src/start/server/middleware/metroOptions.js.map +1 -1
- package/build/src/start/server/middleware/mutations.js +3 -3
- package/build/src/start/server/middleware/mutations.js.map +1 -1
- package/build/src/start/server/middleware/openHandlers.js +157 -0
- package/build/src/start/server/middleware/openHandlers.js.map +1 -0
- package/build/src/start/server/middleware/resolveAssets.js +4 -4
- package/build/src/start/server/middleware/resolveAssets.js.map +1 -1
- package/build/src/start/server/middleware/resolvePlatform.js +9 -7
- package/build/src/start/server/middleware/resolvePlatform.js.map +1 -1
- package/build/src/start/server/middleware/resolveRuntimeVersionWithExpoUpdatesAsync.js.map +1 -1
- package/build/src/start/server/openPlatforms.js.map +1 -1
- package/build/src/start/server/platformBundlers.js +3 -1
- package/build/src/start/server/platformBundlers.js.map +1 -1
- package/build/src/start/server/serverLogLikeMetro.js +13 -36
- package/build/src/start/server/serverLogLikeMetro.js.map +1 -1
- package/build/src/start/server/type-generation/expo-env.js +3 -3
- package/build/src/start/server/type-generation/expo-env.js.map +1 -1
- package/build/src/start/server/type-generation/routes.js +14 -55
- package/build/src/start/server/type-generation/routes.js.map +1 -1
- package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js.map +1 -1
- package/build/src/start/server/type-generation/tsconfig.js +5 -5
- package/build/src/start/server/type-generation/tsconfig.js.map +1 -1
- package/build/src/start/server/webTemplate.js +12 -10
- package/build/src/start/server/webTemplate.js.map +1 -1
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js +3 -3
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js.map +1 -1
- package/build/src/start/server/webpack/formatWebpackMessages.js.map +1 -1
- package/build/src/start/server/webpack/resolveFromProject.js +4 -4
- package/build/src/start/server/webpack/resolveFromProject.js.map +1 -1
- package/build/src/start/server/webpack/tls.js +3 -3
- package/build/src/start/server/webpack/tls.js.map +1 -1
- package/build/src/start/startAsync.js +21 -11
- package/build/src/start/startAsync.js.map +1 -1
- package/build/src/types.d.ts +2 -0
- package/build/src/utils/FileNotifier.js +1 -1
- package/build/src/utils/FileNotifier.js.map +1 -1
- package/build/src/utils/args.js +5 -5
- package/build/src/utils/args.js.map +1 -1
- package/build/src/utils/array.js +8 -8
- package/build/src/utils/array.js.map +1 -1
- package/build/src/utils/build-cache-providers/helpers.js +4 -4
- package/build/src/utils/build-cache-providers/helpers.js.map +1 -1
- package/build/src/utils/build-cache-providers/index.js +5 -5
- package/build/src/utils/build-cache-providers/index.js.map +1 -1
- package/build/src/utils/cocoapods.js +5 -5
- package/build/src/utils/cocoapods.js.map +1 -1
- package/build/src/utils/codesigning.js +12 -6
- package/build/src/utils/codesigning.js.map +1 -1
- package/build/src/utils/composeMetroIgnorePatterns.js +69 -0
- package/build/src/utils/composeMetroIgnorePatterns.js.map +1 -0
- package/build/src/utils/createTempPath.js +3 -3
- package/build/src/utils/createTempPath.js.map +1 -1
- package/build/src/utils/delay.js +4 -4
- package/build/src/utils/delay.js.map +1 -1
- package/build/src/utils/dir.js +21 -11
- package/build/src/utils/dir.js.map +1 -1
- package/build/src/utils/downloadAppAsync.js.map +1 -1
- package/build/src/utils/downloadExpoGoAsync.js +4 -4
- package/build/src/utils/downloadExpoGoAsync.js.map +1 -1
- package/build/src/utils/editor.js +4 -4
- package/build/src/utils/editor.js.map +1 -1
- package/build/src/utils/env.js +39 -13
- package/build/src/utils/env.js.map +1 -1
- package/build/src/utils/errors.js +6 -6
- package/build/src/utils/errors.js.map +1 -1
- package/build/src/utils/exit.js +15 -19
- package/build/src/utils/exit.js.map +1 -1
- package/build/src/utils/expoUpdatesCli.js +5 -5
- package/build/src/utils/expoUpdatesCli.js.map +1 -1
- package/build/src/utils/fetch.js +4 -4
- package/build/src/utils/fetch.js.map +1 -1
- package/build/src/utils/filePath.js +3 -29
- package/build/src/utils/filePath.js.map +1 -1
- package/build/src/utils/findUp.js +3 -3
- package/build/src/utils/findUp.js.map +1 -1
- package/build/src/utils/fn.js +3 -3
- package/build/src/utils/fn.js.map +1 -1
- package/build/src/utils/freeport.js +3 -3
- package/build/src/utils/freeport.js.map +1 -1
- package/build/src/utils/getOrPromptApplicationId.js +3 -5
- package/build/src/utils/getOrPromptApplicationId.js.map +1 -1
- package/build/src/utils/getRunningProcess.js +5 -5
- package/build/src/utils/getRunningProcess.js.map +1 -1
- package/build/src/utils/git.js +3 -3
- package/build/src/utils/git.js.map +1 -1
- package/build/src/utils/glob.js +3 -3
- package/build/src/utils/glob.js.map +1 -1
- package/build/src/utils/ip.js +4 -4
- package/build/src/utils/ip.js.map +1 -1
- package/build/src/utils/link.js +3 -3
- package/build/src/utils/link.js.map +1 -1
- package/build/src/utils/mergeGitIgnorePaths.js +10 -10
- package/build/src/utils/mergeGitIgnorePaths.js.map +1 -1
- package/build/src/utils/modifyConfigAsync.js +3 -3
- package/build/src/utils/modifyConfigAsync.js.map +1 -1
- package/build/src/utils/net.js +23 -4
- package/build/src/utils/net.js.map +1 -1
- package/build/src/utils/nodeEnv.js +6 -6
- package/build/src/utils/nodeEnv.js.map +1 -1
- package/build/src/utils/npm.js +10 -9
- package/build/src/utils/npm.js.map +1 -1
- package/build/src/utils/obj.js +4 -4
- package/build/src/utils/obj.js.map +1 -1
- package/build/src/utils/open.js +240 -11
- package/build/src/utils/open.js.map +1 -1
- package/build/src/utils/ora.js +4 -4
- package/build/src/utils/ora.js.map +1 -1
- package/build/src/utils/plist.js +5 -4
- package/build/src/utils/plist.js.map +1 -1
- package/build/src/utils/port.js +12 -5
- package/build/src/utils/port.js.map +1 -1
- package/build/src/utils/progress.js +4 -4
- package/build/src/utils/progress.js.map +1 -1
- package/build/src/utils/prompts.js +11 -11
- package/build/src/utils/prompts.js.map +1 -1
- package/build/src/utils/qr.js +5 -4
- package/build/src/utils/qr.js.map +1 -1
- package/build/src/utils/resolveArgs.js +10 -9
- package/build/src/utils/resolveArgs.js.map +1 -1
- package/build/src/utils/scheme.js +4 -4
- package/build/src/utils/scheme.js.map +1 -1
- package/build/src/utils/strings.js.map +1 -1
- package/build/src/utils/tar.js +8 -7
- package/build/src/utils/tar.js.map +1 -1
- package/build/src/utils/telemetry/Telemetry.js +5 -0
- package/build/src/utils/telemetry/Telemetry.js.map +1 -1
- package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
- package/build/src/utils/telemetry/clients/FetchClient.js.map +1 -1
- package/build/src/utils/telemetry/clients/flushFetchDetached.js +5 -1
- package/build/src/utils/telemetry/clients/flushFetchDetached.js.map +1 -1
- package/build/src/utils/telemetry/index.js +4 -4
- package/build/src/utils/telemetry/index.js.map +1 -1
- package/build/src/utils/telemetry/utils/agent.js +42 -0
- package/build/src/utils/telemetry/utils/agent.js.map +1 -0
- package/build/src/utils/telemetry/utils/constants.js +3 -3
- package/build/src/utils/telemetry/utils/constants.js.map +1 -1
- package/build/src/utils/telemetry/utils/context.js +3 -2
- package/build/src/utils/telemetry/utils/context.js.map +1 -1
- package/build/src/utils/url.js +5 -17
- package/build/src/utils/url.js.map +1 -1
- package/build/src/utils/validateApplicationId.js +12 -12
- package/build/src/utils/validateApplicationId.js.map +1 -1
- package/build/src/utils/variadic.js +4 -4
- package/build/src/utils/variadic.js.map +1 -1
- package/build/src/whoami/index.js.map +1 -1
- package/changes.json +16 -36
- package/main.js +3 -0
- package/package.json +86 -90
- package/static/loading-page/index.html +45 -3
- package/static/template/+html.tsx +14 -5
- package/add-module.js +0 -8
- package/build/src/start/server/middleware/inspector/CdpClient.js +0 -81
- package/build/src/start/server/middleware/inspector/CdpClient.js.map +0 -1
- package/build/src/utils/resolveGlobal.js +0 -195
- package/build/src/utils/resolveGlobal.js.map +0 -1
- package/build/src/utils/resolveWatchFolders.js +0 -67
- package/build/src/utils/resolveWatchFolders.js.map +0 -1
- package/build/src/utils/tsconfig/evaluateTsConfig.js +0 -87
- package/build/src/utils/tsconfig/evaluateTsConfig.js.map +0 -1
- package/build/src/utils/tsconfig/loadTsConfigPaths.js +0 -84
- package/build/src/utils/tsconfig/loadTsConfigPaths.js.map +0 -1
- package/build/src/utils/tsconfig/matchTsConfigPathAlias.js +0 -94
- package/build/src/utils/tsconfig/matchTsConfigPathAlias.js.map +0 -1
- package/build/src/utils/tsconfig/resolveWithTsConfigPaths.js +0 -62
- package/build/src/utils/tsconfig/resolveWithTsConfigPaths.js.map +0 -1
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get createInfoHandler () {
|
|
13
|
+
return createInfoHandler;
|
|
14
|
+
},
|
|
15
|
+
get createOpen () {
|
|
16
|
+
return createOpen;
|
|
17
|
+
},
|
|
18
|
+
get resolveOpenInfo () {
|
|
19
|
+
return resolveOpenInfo;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
function createInfoHandler(deps) {
|
|
23
|
+
return ({ platform, runtime })=>resolveOpenInfo({
|
|
24
|
+
platform,
|
|
25
|
+
runtime
|
|
26
|
+
}, deps);
|
|
27
|
+
}
|
|
28
|
+
async function resolveOpenInfo({ platform, runtime }, deps) {
|
|
29
|
+
// Snapshot the live state once per request so the response is internally consistent even if a
|
|
30
|
+
// toggle happens between sub-resolutions.
|
|
31
|
+
const scheme = deps.urlCreator.getScheme();
|
|
32
|
+
const isDevClient = deps.getIsDevClient();
|
|
33
|
+
const isRedirectPageEnabled = deps.getIsRedirectPageEnabled();
|
|
34
|
+
const availableRuntimes = isDevClient ? [
|
|
35
|
+
'custom'
|
|
36
|
+
] : isRedirectPageEnabled ? [
|
|
37
|
+
'expo',
|
|
38
|
+
'custom'
|
|
39
|
+
] : [
|
|
40
|
+
'expo'
|
|
41
|
+
];
|
|
42
|
+
if (platform) {
|
|
43
|
+
return {
|
|
44
|
+
scheme,
|
|
45
|
+
availableRuntimes,
|
|
46
|
+
...await resolvePlatformInfo(platform, runtime, deps, {
|
|
47
|
+
isDevClient,
|
|
48
|
+
isRedirectPageEnabled
|
|
49
|
+
})
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const [ios, android, web] = await Promise.all([
|
|
53
|
+
resolvePlatformInfo('ios', runtime, deps, {
|
|
54
|
+
isDevClient,
|
|
55
|
+
isRedirectPageEnabled
|
|
56
|
+
}),
|
|
57
|
+
resolvePlatformInfo('android', runtime, deps, {
|
|
58
|
+
isDevClient,
|
|
59
|
+
isRedirectPageEnabled
|
|
60
|
+
}),
|
|
61
|
+
resolvePlatformInfo('web', runtime, deps, {
|
|
62
|
+
isDevClient,
|
|
63
|
+
isRedirectPageEnabled
|
|
64
|
+
})
|
|
65
|
+
]);
|
|
66
|
+
return {
|
|
67
|
+
scheme,
|
|
68
|
+
availableRuntimes,
|
|
69
|
+
platforms: {
|
|
70
|
+
ios,
|
|
71
|
+
android,
|
|
72
|
+
web
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
async function resolvePlatformInfo(platform, runtime, deps, state) {
|
|
77
|
+
const { urlCreator, getAppId } = deps;
|
|
78
|
+
const { isDevClient, isRedirectPageEnabled } = state;
|
|
79
|
+
const appId = await getAppId(platform);
|
|
80
|
+
if (platform === 'web') {
|
|
81
|
+
// constructUrl inherits the tunnel host from `defaults.hostType` when --tunnel is active,
|
|
82
|
+
// so this returns the ngrok URL instead of localhost in that case.
|
|
83
|
+
return {
|
|
84
|
+
runtime: 'web',
|
|
85
|
+
url: urlCreator.constructUrl({
|
|
86
|
+
scheme: 'http'
|
|
87
|
+
}),
|
|
88
|
+
appId
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
// Caller explicitly wants the disambiguation page — useful when they want the device (not the
|
|
92
|
+
// dev server) to pick between Expo Go and the dev build. No `runtime` field on the response
|
|
93
|
+
// since the actual runtime depends on the device's choice.
|
|
94
|
+
if (runtime === 'unknown') {
|
|
95
|
+
return {
|
|
96
|
+
url: urlCreator.constructLoadingUrl({}, platform),
|
|
97
|
+
appId
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
// `runtime: 'default'` mirrors what pressing `i` / `a` does in the terminal:
|
|
101
|
+
// --dev-client server → open the dev client directly.
|
|
102
|
+
// project has both → hand off to the disambiguation interstitial so the
|
|
103
|
+
// device resolves between Expo Go and the dev build.
|
|
104
|
+
// else → open Expo Go directly.
|
|
105
|
+
if (runtime === 'default') {
|
|
106
|
+
if (isDevClient) {
|
|
107
|
+
return {
|
|
108
|
+
runtime: 'custom',
|
|
109
|
+
url: urlCreator.constructDevClientUrl(),
|
|
110
|
+
appId
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
if (isRedirectPageEnabled) {
|
|
114
|
+
return {
|
|
115
|
+
url: urlCreator.constructLoadingUrl({}, platform),
|
|
116
|
+
appId
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
runtime: 'expo',
|
|
121
|
+
url: urlCreator.constructUrl({
|
|
122
|
+
scheme: 'exp'
|
|
123
|
+
}),
|
|
124
|
+
appId
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
runtime,
|
|
129
|
+
url: runtime === 'custom' ? urlCreator.constructDevClientUrl() : urlCreator.constructUrl({
|
|
130
|
+
scheme: 'exp'
|
|
131
|
+
}),
|
|
132
|
+
appId
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function createOpen(deps) {
|
|
136
|
+
return async ({ platform })=>{
|
|
137
|
+
if (platform === 'web') {
|
|
138
|
+
const result = await deps.openPlatformAsync('desktop');
|
|
139
|
+
return {
|
|
140
|
+
platform,
|
|
141
|
+
runtime: 'web',
|
|
142
|
+
url: result.url ?? ''
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
const launchTarget = platform === 'ios' ? 'simulator' : 'emulator';
|
|
146
|
+
const result = await deps.openPlatformAsync(launchTarget, {
|
|
147
|
+
shouldPrompt: false
|
|
148
|
+
});
|
|
149
|
+
return {
|
|
150
|
+
platform,
|
|
151
|
+
runtime: deps.getIsDevClient() ? 'custom' : 'expo',
|
|
152
|
+
url: result.url ?? ''
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
//# sourceMappingURL=openHandlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/middleware/openHandlers.ts"],"sourcesContent":["import type {\n OpenActionResult,\n OpenInfoResult,\n OpenMiddlewareOptions,\n OpenNativeRuntime,\n OpenPlatform,\n OpenPlatformInfo,\n OpenRequestedRuntime,\n} from './OpenMiddleware';\nimport type { UrlCreator } from '../UrlCreator';\n\ninterface InfoHandlerDeps {\n /** Stable UrlCreator instance — its `defaults` mutate when `toggleRuntimeMode` runs, so the same instance keeps producing fresh URLs and reflects the current scheme. */\n urlCreator: UrlCreator;\n /**\n * Read live values every call. The dev server's runtime mode can flip mid-run via the `s` key\n * in the terminal, and `expo-dev-client` can be installed while the server is running — both\n * change `isDevClient` and `isRedirectPageEnabled`, and the endpoint should reflect the\n * current state on every request.\n */\n getIsDevClient: () => boolean;\n /** Live mirror of `BundlerDevServer.isRedirectPageEnabled()`. */\n getIsRedirectPageEnabled: () => boolean;\n /**\n * Resolve the native application identifier for a platform (iOS bundle id / Android package\n * name). Implementations should return `null` instead of throwing when the project has no\n * configured identifier; the endpoint surfaces `null` so distributed preview systems can detect\n * that the build can't be matched by app id and either bail out or prompt the user.\n */\n getAppId: (platform: OpenPlatform) => Promise<string | null>;\n}\n\n/**\n * Build the GET handler for `/_expo/open`. Resolves dry-run info for a single platform, or for\n * every platform in discovery mode. Extracted so it can be exercised with a real\n * {@link UrlCreator} in tests (covers tunnel routing in particular).\n */\nexport function createInfoHandler(deps: InfoHandlerDeps): OpenMiddlewareOptions['getInfo'] {\n return ({ platform, runtime }) => resolveOpenInfo({ platform, runtime }, deps);\n}\n\nexport async function resolveOpenInfo(\n { platform, runtime }: { platform: OpenPlatform | null; runtime: OpenRequestedRuntime },\n deps: InfoHandlerDeps\n): Promise<OpenInfoResult> {\n // Snapshot the live state once per request so the response is internally consistent even if a\n // toggle happens between sub-resolutions.\n const scheme = deps.urlCreator.getScheme();\n const isDevClient = deps.getIsDevClient();\n const isRedirectPageEnabled = deps.getIsRedirectPageEnabled();\n const availableRuntimes: OpenNativeRuntime[] = isDevClient\n ? ['custom']\n : isRedirectPageEnabled\n ? ['expo', 'custom']\n : ['expo'];\n\n if (platform) {\n return {\n scheme,\n availableRuntimes,\n ...(await resolvePlatformInfo(platform, runtime, deps, {\n isDevClient,\n isRedirectPageEnabled,\n })),\n };\n }\n\n const [ios, android, web] = await Promise.all([\n resolvePlatformInfo('ios', runtime, deps, { isDevClient, isRedirectPageEnabled }),\n resolvePlatformInfo('android', runtime, deps, { isDevClient, isRedirectPageEnabled }),\n resolvePlatformInfo('web', runtime, deps, { isDevClient, isRedirectPageEnabled }),\n ]);\n return { scheme, availableRuntimes, platforms: { ios, android, web } };\n}\n\nasync function resolvePlatformInfo(\n platform: OpenPlatform,\n runtime: OpenRequestedRuntime,\n deps: InfoHandlerDeps,\n state: { isDevClient: boolean; isRedirectPageEnabled: boolean }\n): Promise<OpenPlatformInfo> {\n const { urlCreator, getAppId } = deps;\n const { isDevClient, isRedirectPageEnabled } = state;\n const appId = await getAppId(platform);\n\n if (platform === 'web') {\n // constructUrl inherits the tunnel host from `defaults.hostType` when --tunnel is active,\n // so this returns the ngrok URL instead of localhost in that case.\n return { runtime: 'web', url: urlCreator.constructUrl({ scheme: 'http' }), appId };\n }\n\n // Caller explicitly wants the disambiguation page — useful when they want the device (not the\n // dev server) to pick between Expo Go and the dev build. No `runtime` field on the response\n // since the actual runtime depends on the device's choice.\n if (runtime === 'unknown') {\n return { url: urlCreator.constructLoadingUrl({}, platform), appId };\n }\n\n // `runtime: 'default'` mirrors what pressing `i` / `a` does in the terminal:\n // --dev-client server → open the dev client directly.\n // project has both → hand off to the disambiguation interstitial so the\n // device resolves between Expo Go and the dev build.\n // else → open Expo Go directly.\n if (runtime === 'default') {\n if (isDevClient) {\n return { runtime: 'custom', url: urlCreator.constructDevClientUrl(), appId };\n }\n if (isRedirectPageEnabled) {\n return { url: urlCreator.constructLoadingUrl({}, platform), appId };\n }\n return { runtime: 'expo', url: urlCreator.constructUrl({ scheme: 'exp' }), appId };\n }\n\n return {\n runtime,\n url:\n runtime === 'custom'\n ? urlCreator.constructDevClientUrl()\n : urlCreator.constructUrl({ scheme: 'exp' }),\n appId,\n };\n}\n\ninterface OpenHandlerDeps {\n /** Live `BundlerDevServer.isDevClient` — `s` in the terminal can flip this between dispatch and response. */\n getIsDevClient: () => boolean;\n /** Same shape as `BundlerDevServer.openPlatformAsync`. */\n openPlatformAsync: (\n launchTarget: 'simulator' | 'emulator' | 'desktop',\n resolver?: { shouldPrompt?: boolean }\n ) => Promise<{ url: string | null }>;\n}\n\n/** Build the POST handler for `/_expo/open` — dispatches to the dev server's platform launcher. */\nexport function createOpen(deps: OpenHandlerDeps): OpenMiddlewareOptions['open'] {\n return async ({ platform }): Promise<OpenActionResult> => {\n if (platform === 'web') {\n const result = await deps.openPlatformAsync('desktop');\n return { platform, runtime: 'web', url: result.url ?? '' };\n }\n const launchTarget = platform === 'ios' ? 'simulator' : 'emulator';\n const result = await deps.openPlatformAsync(launchTarget, { shouldPrompt: false });\n return {\n platform,\n runtime: deps.getIsDevClient() ? 'custom' : 'expo',\n url: result.url ?? '',\n };\n };\n}\n"],"names":["createInfoHandler","createOpen","resolveOpenInfo","deps","platform","runtime","scheme","urlCreator","getScheme","isDevClient","getIsDevClient","isRedirectPageEnabled","getIsRedirectPageEnabled","availableRuntimes","resolvePlatformInfo","ios","android","web","Promise","all","platforms","state","getAppId","appId","url","constructUrl","constructLoadingUrl","constructDevClientUrl","result","openPlatformAsync","launchTarget","shouldPrompt"],"mappings":";;;;;;;;;;;QAqCgBA;eAAAA;;QAiGAC;eAAAA;;QA7FMC;eAAAA;;;AAJf,SAASF,kBAAkBG,IAAqB;IACrD,OAAO,CAAC,EAAEC,QAAQ,EAAEC,OAAO,EAAE,GAAKH,gBAAgB;YAAEE;YAAUC;QAAQ,GAAGF;AAC3E;AAEO,eAAeD,gBACpB,EAAEE,QAAQ,EAAEC,OAAO,EAAoE,EACvFF,IAAqB;IAErB,8FAA8F;IAC9F,0CAA0C;IAC1C,MAAMG,SAASH,KAAKI,UAAU,CAACC,SAAS;IAC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;IAClD,IAAIlB,YAAY,WAAW;QACzB,IAAII,aAAa;YACf,OAAO;gBAAEJ,SAAS;gBAAUmB,KAAKjB,WAAWoB,qBAAqB;gBAAIJ;YAAM;QAC7E;QACA,IAAIZ,uBAAuB;YACzB,OAAO;gBAAEa,KAAKjB,WAAWmB,mBAAmB,CAAC,CAAC,GAAGtB;gBAAWmB;YAAM;QACpE;QACA,OAAO;YAAElB,SAAS;YAAQmB,KAAKjB,WAAWkB,YAAY,CAAC;gBAAEnB,QAAQ;YAAM;YAAIiB;QAAM;IACnF;IAEA,OAAO;QACLlB;QACAmB,KACEnB,YAAY,WACRE,WAAWoB,qBAAqB,KAChCpB,WAAWkB,YAAY,CAAC;YAAEnB,QAAQ;QAAM;QAC9CiB;IACF;AACF;AAaO,SAAStB,WAAWE,IAAqB;IAC9C,OAAO,OAAO,EAAEC,QAAQ,EAAE;QACxB,IAAIA,aAAa,OAAO;YACtB,MAAMwB,SAAS,MAAMzB,KAAK0B,iBAAiB,CAAC;YAC5C,OAAO;gBAAEzB;gBAAUC,SAAS;gBAAOmB,KAAKI,OAAOJ,GAAG,IAAI;YAAG;QAC3D;QACA,MAAMM,eAAe1B,aAAa,QAAQ,cAAc;QACxD,MAAMwB,SAAS,MAAMzB,KAAK0B,iBAAiB,CAACC,cAAc;YAAEC,cAAc;QAAM;QAChF,OAAO;YACL3B;YACAC,SAASF,KAAKO,cAAc,KAAK,WAAW;YAC5Cc,KAAKI,OAAOJ,GAAG,IAAI;QACrB;IACF;AACF"}
|
|
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
getAssetFieldPathsForManifestAsync
|
|
12
|
+
get getAssetFieldPathsForManifestAsync () {
|
|
13
13
|
return getAssetFieldPathsForManifestAsync;
|
|
14
14
|
},
|
|
15
|
-
resolveGoogleServicesFile
|
|
15
|
+
get resolveGoogleServicesFile () {
|
|
16
16
|
return resolveGoogleServicesFile;
|
|
17
17
|
},
|
|
18
|
-
resolveManifestAssets
|
|
18
|
+
get resolveManifestAssets () {
|
|
19
19
|
return resolveManifestAssets;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/middleware/resolveAssets.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config';\nimport fs from 'fs/promises';\nimport path from 'path';\n\nimport { getAssetSchemasAsync } from '../../../api/getExpoSchema';\nimport { BundleAssetWithFileHashes } from '../../../export/saveAssets';\nimport * as Log from '../../../log';\nimport { fileExistsAsync } from '../../../utils/dir';\nimport { CommandError } from '../../../utils/errors';\nimport { get, set } from '../../../utils/obj';\nimport { validateUrl } from '../../../utils/url';\n\ntype ManifestAsset = { fileHashes: string[]; files: string[]; hash: string };\n\nexport type Asset = ManifestAsset | BundleAssetWithFileHashes;\n\ntype ManifestResolutionError = Error & {\n localAssetPath?: string;\n manifestField?: string;\n};\n\n/** Inline the contents of each platform's `googleServicesFile` so runtimes can access them. */\nexport async function resolveGoogleServicesFile(\n projectRoot: string,\n manifest: Partial<Pick<ExpoConfig, 'android' | 'ios'>>\n) {\n if (manifest.android?.googleServicesFile) {\n try {\n const contents = await fs.readFile(\n path.resolve(projectRoot, manifest.android.googleServicesFile),\n 'utf8'\n );\n manifest.android.googleServicesFile = contents;\n } catch {\n Log.warn(\n `Could not parse Expo config: android.googleServicesFile: \"${manifest.android.googleServicesFile}\"`\n );\n // Delete the field so Expo Go doesn't attempt to read it.\n delete manifest.android.googleServicesFile;\n }\n }\n if (manifest.ios?.googleServicesFile) {\n try {\n const contents = await fs.readFile(\n path.resolve(projectRoot, manifest.ios.googleServicesFile),\n 'base64'\n );\n manifest.ios.googleServicesFile = contents;\n } catch {\n Log.warn(\n `Could not parse Expo config: ios.googleServicesFile: \"${manifest.ios.googleServicesFile}\"`\n );\n // Delete the field so Expo Go doesn't attempt to read it.\n delete manifest.ios.googleServicesFile;\n }\n }\n return manifest;\n}\n\n/**\n * Get all fields in the manifest that match assets, then filter the ones that aren't set.\n *\n * @param manifest\n * @returns Asset fields that the user has set like [\"icon\", \"splash.image\", ...]\n */\nexport async function getAssetFieldPathsForManifestAsync(manifest: ExpoConfig): Promise<string[]> {\n // String array like [\"icon\", \"notification.icon\", \"loading.icon\", \"loading.backgroundImage\", \"ios.icon\", ...]\n const sdkAssetFieldPaths = await getAssetSchemasAsync(manifest.sdkVersion);\n return sdkAssetFieldPaths.filter((assetSchema) => get(manifest, assetSchema));\n}\n\n/** Resolve all assets in the app.json inline. */\nexport async function resolveManifestAssets(\n projectRoot: string,\n {\n manifest,\n resolver,\n strict,\n }: {\n manifest: ExpoConfig;\n resolver: (assetPath: string) => Promise<string>;\n strict?: boolean;\n }\n) {\n try {\n // Asset fields that the user has set like [\"icon\", \"splash.image\"]\n const assetSchemas = await getAssetFieldPathsForManifestAsync(manifest);\n // Get the URLs\n const urls = await Promise.all(\n assetSchemas.map(async (manifestField) => {\n const pathOrURL = get(manifest, manifestField);\n // URL\n if (validateUrl(pathOrURL, { requireProtocol: true })) {\n return pathOrURL;\n }\n\n // File path\n if (await fileExistsAsync(path.resolve(projectRoot, pathOrURL))) {\n return await resolver(pathOrURL);\n }\n\n // Unknown\n const err: ManifestResolutionError = new CommandError(\n 'MANIFEST_ASSET',\n 'Could not resolve local asset: ' + pathOrURL\n );\n err.localAssetPath = pathOrURL;\n err.manifestField = manifestField;\n throw err;\n })\n );\n\n // Set the corresponding URL fields\n assetSchemas.forEach((manifestField, index: number) =>\n set(manifest, `${manifestField}Url`, urls[index])\n );\n } catch (error: any) {\n if (error.localAssetPath) {\n Log.warn(\n `Unable to resolve asset \"${error.localAssetPath}\" from \"${error.manifestField}\" in your app.json or app.config.js`\n );\n } else {\n Log.warn(\n `Warning: Unable to resolve manifest assets. Icons and fonts might not work. ${error.message}.`\n );\n }\n\n if (strict) {\n throw new CommandError(\n 'MANIFEST_ASSET',\n 'Failed to export manifest assets: ' + error.message\n );\n }\n }\n}\n"],"names":["getAssetFieldPathsForManifestAsync","resolveGoogleServicesFile","resolveManifestAssets","projectRoot","manifest","android","googleServicesFile","contents","fs","readFile","path","resolve","Log","warn","ios","sdkAssetFieldPaths","getAssetSchemasAsync","sdkVersion","filter","assetSchema","get","resolver","strict","assetSchemas","urls","Promise","all","map","manifestField","pathOrURL","validateUrl","requireProtocol","fileExistsAsync","err","CommandError","localAssetPath","forEach","index","set","error","message"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/middleware/resolveAssets.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config';\nimport fs from 'fs/promises';\nimport path from 'path';\n\nimport { getAssetSchemasAsync } from '../../../api/getExpoSchema';\nimport type { BundleAssetWithFileHashes } from '../../../export/saveAssets';\nimport * as Log from '../../../log';\nimport { fileExistsAsync } from '../../../utils/dir';\nimport { CommandError } from '../../../utils/errors';\nimport { get, set } from '../../../utils/obj';\nimport { validateUrl } from '../../../utils/url';\n\ntype ManifestAsset = { fileHashes: string[]; files: string[]; hash: string };\n\nexport type Asset = ManifestAsset | BundleAssetWithFileHashes;\n\ntype ManifestResolutionError = Error & {\n localAssetPath?: string;\n manifestField?: string;\n};\n\n/** Inline the contents of each platform's `googleServicesFile` so runtimes can access them. */\nexport async function resolveGoogleServicesFile(\n projectRoot: string,\n manifest: Partial<Pick<ExpoConfig, 'android' | 'ios'>>\n) {\n if (manifest.android?.googleServicesFile) {\n try {\n const contents = await fs.readFile(\n path.resolve(projectRoot, manifest.android.googleServicesFile),\n 'utf8'\n );\n manifest.android.googleServicesFile = contents;\n } catch {\n Log.warn(\n `Could not parse Expo config: android.googleServicesFile: \"${manifest.android.googleServicesFile}\"`\n );\n // Delete the field so Expo Go doesn't attempt to read it.\n delete manifest.android.googleServicesFile;\n }\n }\n if (manifest.ios?.googleServicesFile) {\n try {\n const contents = await fs.readFile(\n path.resolve(projectRoot, manifest.ios.googleServicesFile),\n 'base64'\n );\n manifest.ios.googleServicesFile = contents;\n } catch {\n Log.warn(\n `Could not parse Expo config: ios.googleServicesFile: \"${manifest.ios.googleServicesFile}\"`\n );\n // Delete the field so Expo Go doesn't attempt to read it.\n delete manifest.ios.googleServicesFile;\n }\n }\n return manifest;\n}\n\n/**\n * Get all fields in the manifest that match assets, then filter the ones that aren't set.\n *\n * @param manifest\n * @returns Asset fields that the user has set like [\"icon\", \"splash.image\", ...]\n */\nexport async function getAssetFieldPathsForManifestAsync(manifest: ExpoConfig): Promise<string[]> {\n // String array like [\"icon\", \"notification.icon\", \"loading.icon\", \"loading.backgroundImage\", \"ios.icon\", ...]\n const sdkAssetFieldPaths = await getAssetSchemasAsync(manifest.sdkVersion);\n return sdkAssetFieldPaths.filter((assetSchema) => get(manifest, assetSchema));\n}\n\n/** Resolve all assets in the app.json inline. */\nexport async function resolveManifestAssets(\n projectRoot: string,\n {\n manifest,\n resolver,\n strict,\n }: {\n manifest: ExpoConfig;\n resolver: (assetPath: string) => Promise<string>;\n strict?: boolean;\n }\n) {\n try {\n // Asset fields that the user has set like [\"icon\", \"splash.image\"]\n const assetSchemas = await getAssetFieldPathsForManifestAsync(manifest);\n // Get the URLs\n const urls = await Promise.all(\n assetSchemas.map(async (manifestField) => {\n const pathOrURL = get(manifest, manifestField);\n // URL\n if (validateUrl(pathOrURL, { requireProtocol: true })) {\n return pathOrURL;\n }\n\n // File path\n if (await fileExistsAsync(path.resolve(projectRoot, pathOrURL))) {\n return await resolver(pathOrURL);\n }\n\n // Unknown\n const err: ManifestResolutionError = new CommandError(\n 'MANIFEST_ASSET',\n 'Could not resolve local asset: ' + pathOrURL\n );\n err.localAssetPath = pathOrURL;\n err.manifestField = manifestField;\n throw err;\n })\n );\n\n // Set the corresponding URL fields\n assetSchemas.forEach((manifestField, index: number) =>\n set(manifest, `${manifestField}Url`, urls[index])\n );\n } catch (error: any) {\n if (error.localAssetPath) {\n Log.warn(\n `Unable to resolve asset \"${error.localAssetPath}\" from \"${error.manifestField}\" in your app.json or app.config.js`\n );\n } else {\n Log.warn(\n `Warning: Unable to resolve manifest assets. Icons and fonts might not work. ${error.message}.`\n );\n }\n\n if (strict) {\n throw new CommandError(\n 'MANIFEST_ASSET',\n 'Failed to export manifest assets: ' + error.message\n );\n }\n }\n}\n"],"names":["getAssetFieldPathsForManifestAsync","resolveGoogleServicesFile","resolveManifestAssets","projectRoot","manifest","android","googleServicesFile","contents","fs","readFile","path","resolve","Log","warn","ios","sdkAssetFieldPaths","getAssetSchemasAsync","sdkVersion","filter","assetSchema","get","resolver","strict","assetSchemas","urls","Promise","all","map","manifestField","pathOrURL","validateUrl","requireProtocol","fileExistsAsync","err","CommandError","localAssetPath","forEach","index","set","error","message"],"mappings":";;;;;;;;;;;QAiEsBA;eAAAA;;QA3CAC;eAAAA;;QAkDAC;eAAAA;;;;gEAvEP;;;;;;;gEACE;;;;;;+BAEoB;6DAEhB;qBACW;wBACH;qBACJ;qBACG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYrB,eAAeD,0BACpBE,WAAmB,EACnBC,QAAsD;QAElDA,mBAeAA;IAfJ,KAAIA,oBAAAA,SAASC,OAAO,qBAAhBD,kBAAkBE,kBAAkB,EAAE;QACxC,IAAI;YACF,MAAMC,WAAW,MAAMC,mBAAE,CAACC,QAAQ,CAChCC,eAAI,CAACC,OAAO,CAACR,aAAaC,SAASC,OAAO,CAACC,kBAAkB,GAC7D;YAEFF,SAASC,OAAO,CAACC,kBAAkB,GAAGC;QACxC,EAAE,OAAM;YACNK,KAAIC,IAAI,CACN,CAAC,0DAA0D,EAAET,SAASC,OAAO,CAACC,kBAAkB,CAAC,CAAC,CAAC;YAErG,0DAA0D;YAC1D,OAAOF,SAASC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IAAIE,cAAc,GAAGN;YACrBI,IAAIL,aAAa,GAAGA;YACpB,MAAMK;QACR;QAGF,mCAAmC;QACnCV,aAAaa,OAAO,CAAC,CAACR,eAAeS,QACnCC,IAAAA,QAAG,EAAClC,UAAU,GAAGwB,cAAc,GAAG,CAAC,EAAEJ,IAAI,CAACa,MAAM;IAEpD,EAAE,OAAOE,OAAY;QACnB,IAAIA,MAAMJ,cAAc,EAAE;YACxBvB,KAAIC,IAAI,CACN,CAAC,yBAAyB,EAAE0B,MAAMJ,cAAc,CAAC,QAAQ,EAAEI,MAAMX,aAAa,CAAC,mCAAmC,CAAC;QAEvH,OAAO;YACLhB,KAAIC,IAAI,CACN,CAAC,4EAA4E,EAAE0B,MAAMC,OAAO,CAAC,CAAC,CAAC;QAEnG;QAEA,IAAIlB,QAAQ;YACV,MAAM,IAAIY,oBAAY,CACpB,kBACA,uCAAuCK,MAAMC,OAAO;QAExD;IACF;AACF"}
|
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
assertMissingRuntimePlatform
|
|
12
|
+
get assertMissingRuntimePlatform () {
|
|
13
13
|
return assertMissingRuntimePlatform;
|
|
14
14
|
},
|
|
15
|
-
assertRuntimePlatform
|
|
15
|
+
get assertRuntimePlatform () {
|
|
16
16
|
return assertRuntimePlatform;
|
|
17
17
|
},
|
|
18
|
-
parsePlatformHeader
|
|
18
|
+
get parsePlatformHeader () {
|
|
19
19
|
return parsePlatformHeader;
|
|
20
20
|
},
|
|
21
|
-
resolvePlatformFromUserAgentHeader
|
|
21
|
+
get resolvePlatformFromUserAgentHeader () {
|
|
22
22
|
return resolvePlatformFromUserAgentHeader;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -62,9 +62,11 @@ function assertRuntimePlatform(platform) {
|
|
|
62
62
|
if (![
|
|
63
63
|
'android',
|
|
64
64
|
'ios',
|
|
65
|
-
'web'
|
|
65
|
+
'web',
|
|
66
|
+
'tvos',
|
|
67
|
+
'macos'
|
|
66
68
|
].includes(stringifiedPlatform)) {
|
|
67
|
-
throw new _errors.CommandError('PLATFORM_HEADER', `platform must be "android", "ios", or "
|
|
69
|
+
throw new _errors.CommandError('PLATFORM_HEADER', `platform must be "android", "ios", "web", "tvos", or "macos". Received: "${platform}"`);
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/middleware/resolvePlatform.ts"],"sourcesContent":["import { parse } from 'url';\n\nimport { ServerRequest } from './server.types';\nimport { CommandError } from '../../../utils/errors';\n\nconst debug = require('debug')(\n 'expo:start:server:middleware:resolvePlatform'\n) as typeof console.log;\n\n/** Supported platforms */\nexport type RuntimePlatform =
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/middleware/resolvePlatform.ts"],"sourcesContent":["import type { NativePlatform } from '@expo/config';\nimport { parse } from 'url';\n\nimport type { ServerRequest } from './server.types';\nimport { CommandError } from '../../../utils/errors';\n\nconst debug = require('debug')(\n 'expo:start:server:middleware:resolvePlatform'\n) as typeof console.log;\n\n/** Supported native runtime platforms. */\nexport type RuntimePlatform = NativePlatform;\n\n/**\n * Extract the runtime platform from the server request.\n * 1. Query param `platform`: `?platform=ios`\n * 2. Header `expo-platform`: `'expo-platform': ios`\n * 3. Legacy header `exponent-platform`: `'exponent-platform': ios`\n *\n * Returns first item in the case of an array.\n */\nexport function parsePlatformHeader(req: ServerRequest): string | null {\n const url = parse(req.url!, /* parseQueryString */ true);\n const platform =\n url.query?.platform || req.headers['expo-platform'] || req.headers['exponent-platform'];\n return (Array.isArray(platform) ? platform[0] : platform) ?? null;\n}\n\n/** Guess the platform from the user-agent header. */\nexport function resolvePlatformFromUserAgentHeader(req: ServerRequest): string | null {\n let platform = null;\n const userAgent = req.headers['user-agent'];\n if (userAgent?.match(/Android/i)) {\n platform = 'android';\n }\n if (userAgent?.match(/OculusBrowser|Quest/i)) {\n platform = 'android';\n }\n if (userAgent?.match(/iPhone|iPad/i)) {\n platform = 'ios';\n }\n debug(`Resolved platform ${platform} from user-agent header: ${userAgent}`);\n return platform;\n}\n\n/** Assert if the runtime platform is not included. */\nexport function assertMissingRuntimePlatform(platform?: any): asserts platform {\n if (!platform) {\n throw new CommandError(\n 'PLATFORM_HEADER',\n `Must specify \"expo-platform\" header or \"platform\" query parameter`\n );\n }\n}\n\n/** Assert if the runtime platform is not correct. */\nexport function assertRuntimePlatform(platform: string): asserts platform is RuntimePlatform {\n const stringifiedPlatform = String(platform);\n if (!['android', 'ios', 'web', 'tvos', 'macos'].includes(stringifiedPlatform)) {\n throw new CommandError(\n 'PLATFORM_HEADER',\n `platform must be \"android\", \"ios\", \"web\", \"tvos\", or \"macos\". Received: \"${platform}\"`\n );\n }\n}\n"],"names":["assertMissingRuntimePlatform","assertRuntimePlatform","parsePlatformHeader","resolvePlatformFromUserAgentHeader","debug","require","req","url","parse","platform","query","headers","Array","isArray","userAgent","match","CommandError","stringifiedPlatform","String","includes"],"mappings":";;;;;;;;;;;QA8CgBA;eAAAA;;QAUAC;eAAAA;;QAnCAC;eAAAA;;QAQAC;eAAAA;;;;yBA5BM;;;;;;wBAGO;AAE7B,MAAMC,QAAQC,QAAQ,SACpB;AAcK,SAASH,oBAAoBI,GAAkB;QAGlDC;IAFF,MAAMA,MAAMC,IAAAA,YAAK,EAACF,IAAIC,GAAG,EAAG,oBAAoB,GAAG;IACnD,MAAME,WACJF,EAAAA,aAAAA,IAAIG,KAAK,qBAATH,WAAWE,QAAQ,KAAIH,IAAIK,OAAO,CAAC,gBAAgB,IAAIL,IAAIK,OAAO,CAAC,oBAAoB;IACzF,OAAO,AAACC,CAAAA,MAAMC,OAAO,CAACJ,YAAYA,QAAQ,CAAC,EAAE,GAAGA,QAAO,KAAM;AAC/D;AAGO,SAASN,mCAAmCG,GAAkB;IACnE,IAAIG,WAAW;IACf,MAAMK,YAAYR,IAAIK,OAAO,CAAC,aAAa;IAC3C,IAAIG,6BAAAA,UAAWC,KAAK,CAAC,aAAa;QAChCN,WAAW;IACb;IACA,IAAIK,6BAAAA,UAAWC,KAAK,CAAC,yBAAyB;QAC5CN,WAAW;IACb;IACA,IAAIK,6BAAAA,UAAWC,KAAK,CAAC,iBAAiB;QACpCN,WAAW;IACb;IACAL,MAAM,CAAC,kBAAkB,EAAEK,SAAS,yBAAyB,EAAEK,WAAW;IAC1E,OAAOL;AACT;AAGO,SAAST,6BAA6BS,QAAc;IACzD,IAAI,CAACA,UAAU;QACb,MAAM,IAAIO,oBAAY,CACpB,mBACA,CAAC,iEAAiE,CAAC;IAEvE;AACF;AAGO,SAASf,sBAAsBQ,QAAgB;IACpD,MAAMQ,sBAAsBC,OAAOT;IACnC,IAAI,CAAC;QAAC;QAAW;QAAO;QAAO;QAAQ;KAAQ,CAACU,QAAQ,CAACF,sBAAsB;QAC7E,MAAM,IAAID,oBAAY,CACpB,mBACA,CAAC,yEAAyE,EAAEP,SAAS,CAAC,CAAC;IAE3F;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/middleware/resolveRuntimeVersionWithExpoUpdatesAsync.ts"],"sourcesContent":["import { RuntimePlatform } from './resolvePlatform';\nimport { env } from '../../../utils/env';\nimport {\n ExpoUpdatesCLIModuleNotFoundError,\n expoUpdatesCommandAsync,\n} from '../../../utils/expoUpdatesCli';\n\nconst debug = require('debug')('expo:start:server:middleware:resolveRuntimeVersion');\n\nexport async function resolveRuntimeVersionWithExpoUpdatesAsync({\n projectRoot,\n platform,\n}: {\n projectRoot: string;\n platform: RuntimePlatform;\n}): Promise<string | null> {\n try {\n debug('Using expo-updates runtimeversion:resolve CLI for runtime version resolution');\n const extraArgs = env.EXPO_DEBUG ? ['--debug'] : [];\n const resolvedRuntimeVersionJSONResult = await expoUpdatesCommandAsync(projectRoot, [\n 'runtimeversion:resolve',\n '--platform',\n platform,\n ...extraArgs,\n ]);\n const runtimeVersionResult: { runtimeVersion: string | null } = JSON.parse(\n resolvedRuntimeVersionJSONResult\n );\n debug('runtimeversion:resolve output:');\n debug(resolvedRuntimeVersionJSONResult);\n\n return runtimeVersionResult.runtimeVersion ?? null;\n } catch (e: any) {\n if (e instanceof ExpoUpdatesCLIModuleNotFoundError) {\n return null;\n }\n throw e;\n }\n}\n"],"names":["resolveRuntimeVersionWithExpoUpdatesAsync","debug","require","projectRoot","platform","extraArgs","env","EXPO_DEBUG","resolvedRuntimeVersionJSONResult","expoUpdatesCommandAsync","runtimeVersionResult","JSON","parse","runtimeVersion","e","ExpoUpdatesCLIModuleNotFoundError"],"mappings":";;;;+BASsBA;;;eAAAA;;;qBARF;gCAIb;AAEP,MAAMC,QAAQC,QAAQ,SAAS;AAExB,eAAeF,0CAA0C,EAC9DG,WAAW,EACXC,QAAQ,EAIT;IACC,IAAI;QACFH,MAAM;QACN,MAAMI,YAAYC,QAAG,CAACC,UAAU,GAAG;YAAC;SAAU,GAAG,EAAE;QACnD,MAAMC,mCAAmC,MAAMC,IAAAA,uCAAuB,EAACN,aAAa;YAClF;YACA;YACAC;eACGC;SACJ;QACD,MAAMK,uBAA0DC,KAAKC,KAAK,CACxEJ;QAEFP,MAAM;QACNA,MAAMO;QAEN,OAAOE,qBAAqBG,cAAc,IAAI;IAChD,EAAE,OAAOC,GAAQ;QACf,IAAIA,aAAaC,iDAAiC,EAAE;YAClD,OAAO;QACT;QACA,MAAMD;IACR;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/middleware/resolveRuntimeVersionWithExpoUpdatesAsync.ts"],"sourcesContent":["import type { RuntimePlatform } from './resolvePlatform';\nimport { env } from '../../../utils/env';\nimport {\n ExpoUpdatesCLIModuleNotFoundError,\n expoUpdatesCommandAsync,\n} from '../../../utils/expoUpdatesCli';\n\nconst debug = require('debug')('expo:start:server:middleware:resolveRuntimeVersion');\n\nexport async function resolveRuntimeVersionWithExpoUpdatesAsync({\n projectRoot,\n platform,\n}: {\n projectRoot: string;\n platform: RuntimePlatform;\n}): Promise<string | null> {\n try {\n debug('Using expo-updates runtimeversion:resolve CLI for runtime version resolution');\n const extraArgs = env.EXPO_DEBUG ? ['--debug'] : [];\n const resolvedRuntimeVersionJSONResult = await expoUpdatesCommandAsync(projectRoot, [\n 'runtimeversion:resolve',\n '--platform',\n platform,\n ...extraArgs,\n ]);\n const runtimeVersionResult: { runtimeVersion: string | null } = JSON.parse(\n resolvedRuntimeVersionJSONResult\n );\n debug('runtimeversion:resolve output:');\n debug(resolvedRuntimeVersionJSONResult);\n\n return runtimeVersionResult.runtimeVersion ?? null;\n } catch (e: any) {\n if (e instanceof ExpoUpdatesCLIModuleNotFoundError) {\n return null;\n }\n throw e;\n }\n}\n"],"names":["resolveRuntimeVersionWithExpoUpdatesAsync","debug","require","projectRoot","platform","extraArgs","env","EXPO_DEBUG","resolvedRuntimeVersionJSONResult","expoUpdatesCommandAsync","runtimeVersionResult","JSON","parse","runtimeVersion","e","ExpoUpdatesCLIModuleNotFoundError"],"mappings":";;;;+BASsBA;;;eAAAA;;;qBARF;gCAIb;AAEP,MAAMC,QAAQC,QAAQ,SAAS;AAExB,eAAeF,0CAA0C,EAC9DG,WAAW,EACXC,QAAQ,EAIT;IACC,IAAI;QACFH,MAAM;QACN,MAAMI,YAAYC,QAAG,CAACC,UAAU,GAAG;YAAC;SAAU,GAAG,EAAE;QACnD,MAAMC,mCAAmC,MAAMC,IAAAA,uCAAuB,EAACN,aAAa;YAClF;YACA;YACAC;eACGC;SACJ;QACD,MAAMK,uBAA0DC,KAAKC,KAAK,CACxEJ;QAEFP,MAAM;QACNA,MAAMO;QAEN,OAAOE,qBAAqBG,cAAc,IAAI;IAChD,EAAE,OAAOC,GAAQ;QACf,IAAIA,aAAaC,iDAAiC,EAAE;YAClD,OAAO;QACT;QACA,MAAMD;IACR;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/start/server/openPlatforms.ts"],"sourcesContent":["import { DevServerManager } from './DevServerManager';\nimport { AbortCommandError } from '../../utils/errors';\nimport { Options } from '../resolveOptions';\n\n/** Launch the app on various platforms in parallel. */\nexport async function openPlatformsAsync(\n devServerManager: DevServerManager,\n options: Pick<Options, 'ios' | 'android' | 'web'>\n) {\n const results = await Promise.allSettled([\n options.android ? devServerManager.getDefaultDevServer().openPlatformAsync('emulator') : null,\n options.ios ? devServerManager.getDefaultDevServer().openPlatformAsync('simulator') : null,\n options.web\n ? devServerManager\n .ensureWebDevServerRunningAsync()\n .then(() => devServerManager.getWebDevServer()?.openPlatformAsync('desktop'))\n : null,\n ]);\n\n const errors = results\n .map((result) => (result.status === 'rejected' ? result.reason : null))\n .filter(Boolean);\n\n if (errors.length) {\n // ctrl+c\n const isEscapedError = errors.some((error: any) => error.code === 'ABORTED');\n if (isEscapedError) {\n throw new AbortCommandError();\n }\n throw errors[0];\n }\n\n return !!options.android || !!options.ios;\n}\n"],"names":["openPlatformsAsync","devServerManager","options","results","Promise","allSettled","android","getDefaultDevServer","openPlatformAsync","ios","web","ensureWebDevServerRunningAsync","then","getWebDevServer","errors","map","result","status","reason","filter","Boolean","length","isEscapedError","some","error","code","AbortCommandError"],"mappings":";;;;+BAKsBA;;;eAAAA;;;wBAJY;AAI3B,eAAeA,mBACpBC,gBAAkC,EAClCC,OAAiD;IAEjD,MAAMC,UAAU,MAAMC,QAAQC,UAAU,CAAC;QACvCH,QAAQI,OAAO,GAAGL,iBAAiBM,mBAAmB,GAAGC,iBAAiB,CAAC,cAAc;QACzFN,QAAQO,GAAG,GAAGR,iBAAiBM,mBAAmB,GAAGC,iBAAiB,CAAC,eAAe;QACtFN,QAAQQ,GAAG,GACPT,iBACGU,8BAA8B,GAC9BC,IAAI,CAAC;gBAAMX;oBAAAA,oCAAAA,iBAAiBY,eAAe,uBAAhCZ,kCAAoCO,iBAAiB,CAAC;aACpE;KACL;IAED,MAAMM,SAASX,QACZY,GAAG,CAAC,CAACC,SAAYA,OAAOC,MAAM,KAAK,aAAaD,OAAOE,MAAM,GAAG,MAChEC,MAAM,CAACC;IAEV,IAAIN,OAAOO,MAAM,EAAE;QACjB,SAAS;QACT,MAAMC,iBAAiBR,OAAOS,IAAI,CAAC,CAACC,QAAeA,MAAMC,IAAI,KAAK;QAClE,IAAIH,gBAAgB;YAClB,MAAM,IAAII,yBAAiB;QAC7B;QACA,MAAMZ,MAAM,CAAC,EAAE;IACjB;IAEA,OAAO,CAAC,CAACZ,QAAQI,OAAO,IAAI,CAAC,CAACJ,QAAQO,GAAG;AAC3C"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/start/server/openPlatforms.ts"],"sourcesContent":["import type { DevServerManager } from './DevServerManager';\nimport { AbortCommandError } from '../../utils/errors';\nimport type { Options } from '../resolveOptions';\n\n/** Launch the app on various platforms in parallel. */\nexport async function openPlatformsAsync(\n devServerManager: DevServerManager,\n options: Pick<Options, 'ios' | 'android' | 'web'>\n) {\n const results = await Promise.allSettled([\n options.android ? devServerManager.getDefaultDevServer().openPlatformAsync('emulator') : null,\n options.ios ? devServerManager.getDefaultDevServer().openPlatformAsync('simulator') : null,\n options.web\n ? devServerManager\n .ensureWebDevServerRunningAsync()\n .then(() => devServerManager.getWebDevServer()?.openPlatformAsync('desktop'))\n : null,\n ]);\n\n const errors = results\n .map((result) => (result.status === 'rejected' ? result.reason : null))\n .filter(Boolean);\n\n if (errors.length) {\n // ctrl+c\n const isEscapedError = errors.some((error: any) => error.code === 'ABORTED');\n if (isEscapedError) {\n throw new AbortCommandError();\n }\n throw errors[0];\n }\n\n return !!options.android || !!options.ios;\n}\n"],"names":["openPlatformsAsync","devServerManager","options","results","Promise","allSettled","android","getDefaultDevServer","openPlatformAsync","ios","web","ensureWebDevServerRunningAsync","then","getWebDevServer","errors","map","result","status","reason","filter","Boolean","length","isEscapedError","some","error","code","AbortCommandError"],"mappings":";;;;+BAKsBA;;;eAAAA;;;wBAJY;AAI3B,eAAeA,mBACpBC,gBAAkC,EAClCC,OAAiD;IAEjD,MAAMC,UAAU,MAAMC,QAAQC,UAAU,CAAC;QACvCH,QAAQI,OAAO,GAAGL,iBAAiBM,mBAAmB,GAAGC,iBAAiB,CAAC,cAAc;QACzFN,QAAQO,GAAG,GAAGR,iBAAiBM,mBAAmB,GAAGC,iBAAiB,CAAC,eAAe;QACtFN,QAAQQ,GAAG,GACPT,iBACGU,8BAA8B,GAC9BC,IAAI,CAAC;gBAAMX;oBAAAA,oCAAAA,iBAAiBY,eAAe,uBAAhCZ,kCAAoCO,iBAAiB,CAAC;aACpE;KACL;IAED,MAAMM,SAASX,QACZY,GAAG,CAAC,CAACC,SAAYA,OAAOC,MAAM,KAAK,aAAaD,OAAOE,MAAM,GAAG,MAChEC,MAAM,CAACC;IAEV,IAAIN,OAAOO,MAAM,EAAE;QACjB,SAAS;QACT,MAAMC,iBAAiBR,OAAOS,IAAI,CAAC,CAACC,QAAeA,MAAMC,IAAI,KAAK;QAClE,IAAIH,gBAAgB;YAClB,MAAM,IAAII,yBAAiB;QAC7B;QACA,MAAMZ,MAAM,CAAC,EAAE;IACjB;IAEA,OAAO,CAAC,CAACZ,QAAQI,OAAO,IAAI,CAAC,CAACJ,QAAQO,GAAG;AAC3C"}
|
|
@@ -32,7 +32,9 @@ function getPlatformBundlers(projectRoot, exp) {
|
|
|
32
32
|
return {
|
|
33
33
|
ios: ((_exp_ios = exp.ios) == null ? void 0 : _exp_ios.bundler) ?? 'metro',
|
|
34
34
|
android: ((_exp_android = exp.android) == null ? void 0 : _exp_android.bundler) ?? 'metro',
|
|
35
|
-
web
|
|
35
|
+
web,
|
|
36
|
+
tvos: 'metro',
|
|
37
|
+
macos: 'metro'
|
|
36
38
|
};
|
|
37
39
|
}
|
|
38
40
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/start/server/platformBundlers.ts"],"sourcesContent":["import type { ExpoConfig, ExpoConfigWeb, Platform } from '@expo/config';\nimport resolveFrom from 'resolve-from';\n\n/** Which bundler each platform should use. */\nexport type PlatformBundlers = Record<Platform, 'metro' | 'webpack'>;\n\n/** XDL-schema doesn't have `ios.bundler` and `android.bundler`, since this is technically deprecated */\ntype WithBundlerConfig = Pick<ExpoConfigWeb, 'bundler'> | undefined | null;\n\n/** Get the platform bundlers mapping. */\nexport function getPlatformBundlers(\n projectRoot: string,\n exp: Partial<ExpoConfig>\n): PlatformBundlers {\n /**\n * SDK 50+: The web bundler is dynamic based upon the presence of the `@expo/webpack-config` package.\n */\n let web = exp.web?.bundler;\n if (!web) {\n const resolved = resolveFrom.silent(projectRoot, '@expo/webpack-config/package.json');\n web = resolved ? 'webpack' : 'metro';\n }\n\n return {\n ios: (exp.ios as WithBundlerConfig)?.bundler ?? 'metro',\n android: (exp.android as WithBundlerConfig)?.bundler ?? 'metro',\n web,\n };\n}\n"],"names":["getPlatformBundlers","projectRoot","exp","web","bundler","resolved","resolveFrom","silent","ios","android"],"mappings":";;;;+BAUgBA;;;eAAAA;;;;gEATQ;;;;;;;;;;;AASjB,SAASA,oBACdC,WAAmB,EACnBC,GAAwB;QAKdA,UAOFA,UACIA;IAXZ;;GAEC,GACD,IAAIC,OAAMD,WAAAA,IAAIC,GAAG,qBAAPD,SAASE,OAAO;IAC1B,IAAI,CAACD,KAAK;QACR,MAAME,WAAWC,sBAAW,CAACC,MAAM,CAACN,aAAa;QACjDE,MAAME,WAAW,YAAY;IAC/B;IAEA,OAAO;QACLG,KAAK,EAACN,WAAAA,IAAIM,GAAG,qBAAR,AAACN,SAA+BE,OAAO,KAAI;QAChDK,SAAS,EAACP,eAAAA,IAAIO,OAAO,qBAAZ,AAACP,aAAmCE,OAAO,KAAI;QACxDD;
|
|
1
|
+
{"version":3,"sources":["../../../../src/start/server/platformBundlers.ts"],"sourcesContent":["import type { ExpoConfig, ExpoConfigWeb, Platform } from '@expo/config';\nimport resolveFrom from 'resolve-from';\n\n/** Which bundler each platform should use. */\nexport type PlatformBundlers = Record<Platform, 'metro' | 'webpack'>;\n\n/** XDL-schema doesn't have `ios.bundler` and `android.bundler`, since this is technically deprecated */\ntype WithBundlerConfig = Pick<ExpoConfigWeb, 'bundler'> | undefined | null;\n\n/** Get the platform bundlers mapping. */\nexport function getPlatformBundlers(\n projectRoot: string,\n exp: Partial<ExpoConfig>\n): PlatformBundlers {\n /**\n * SDK 50+: The web bundler is dynamic based upon the presence of the `@expo/webpack-config` package.\n */\n let web = exp.web?.bundler;\n if (!web) {\n const resolved = resolveFrom.silent(projectRoot, '@expo/webpack-config/package.json');\n web = resolved ? 'webpack' : 'metro';\n }\n\n return {\n ios: (exp.ios as WithBundlerConfig)?.bundler ?? 'metro',\n android: (exp.android as WithBundlerConfig)?.bundler ?? 'metro',\n web,\n tvos: 'metro',\n macos: 'metro',\n };\n}\n"],"names":["getPlatformBundlers","projectRoot","exp","web","bundler","resolved","resolveFrom","silent","ios","android","tvos","macos"],"mappings":";;;;+BAUgBA;;;eAAAA;;;;gEATQ;;;;;;;;;;;AASjB,SAASA,oBACdC,WAAmB,EACnBC,GAAwB;QAKdA,UAOFA,UACIA;IAXZ;;GAEC,GACD,IAAIC,OAAMD,WAAAA,IAAIC,GAAG,qBAAPD,SAASE,OAAO;IAC1B,IAAI,CAACD,KAAK;QACR,MAAME,WAAWC,sBAAW,CAACC,MAAM,CAACN,aAAa;QACjDE,MAAME,WAAW,YAAY;IAC/B;IAEA,OAAO;QACLG,KAAK,EAACN,WAAAA,IAAIM,GAAG,qBAAR,AAACN,SAA+BE,OAAO,KAAI;QAChDK,SAAS,EAACP,eAAAA,IAAIO,OAAO,qBAAZ,AAACP,aAAmCE,OAAO,KAAI;QACxDD;QACAO,MAAM;QACNC,OAAO;IACT;AACF"}
|
|
@@ -10,23 +10,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
10
10
|
function _export(target, all) {
|
|
11
11
|
for(var name in all)Object.defineProperty(target, name, {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: all
|
|
13
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
_export(exports, {
|
|
17
|
-
augmentLogs
|
|
17
|
+
get augmentLogs () {
|
|
18
18
|
return augmentLogs;
|
|
19
19
|
},
|
|
20
|
-
formatStackLikeMetro
|
|
20
|
+
get formatStackLikeMetro () {
|
|
21
21
|
return formatStackLikeMetro;
|
|
22
22
|
},
|
|
23
|
-
logLikeMetro
|
|
23
|
+
get logLikeMetro () {
|
|
24
24
|
return logLikeMetro;
|
|
25
25
|
},
|
|
26
|
-
maybeSymbolicateAndFormatJSErrorStackLogAsync
|
|
26
|
+
get maybeSymbolicateAndFormatJSErrorStackLogAsync () {
|
|
27
27
|
return maybeSymbolicateAndFormatJSErrorStackLogAsync;
|
|
28
28
|
},
|
|
29
|
-
parseErrorStringToObject
|
|
29
|
+
get parseErrorStringToObject () {
|
|
30
30
|
return parseErrorStringToObject;
|
|
31
31
|
}
|
|
32
32
|
});
|
|
@@ -51,13 +51,6 @@ function _path() {
|
|
|
51
51
|
};
|
|
52
52
|
return data;
|
|
53
53
|
}
|
|
54
|
-
function _sourcemapsupport() {
|
|
55
|
-
const data = require("source-map-support");
|
|
56
|
-
_sourcemapsupport = function() {
|
|
57
|
-
return data;
|
|
58
|
-
};
|
|
59
|
-
return data;
|
|
60
|
-
}
|
|
61
54
|
function _stacktraceparser() {
|
|
62
55
|
const data = /*#__PURE__*/ _interop_require_wildcard(require("stacktrace-parser"));
|
|
63
56
|
_stacktraceparser = function() {
|
|
@@ -65,11 +58,11 @@ function _stacktraceparser() {
|
|
|
65
58
|
};
|
|
66
59
|
return data;
|
|
67
60
|
}
|
|
61
|
+
const _LogBoxLog = require("./metro/log-box/LogBoxLog");
|
|
68
62
|
const _LogBoxSymbolication = require("./metro/log-box/LogBoxSymbolication");
|
|
63
|
+
const _metroErrorInterface = require("./metro/metroErrorInterface");
|
|
69
64
|
const _env = require("../../utils/env");
|
|
70
65
|
const _fn = require("../../utils/fn");
|
|
71
|
-
const _LogBoxLog = require("./metro/log-box/LogBoxLog");
|
|
72
|
-
const _metroErrorInterface = require("./metro/metroErrorInterface");
|
|
73
66
|
function _interop_require_default(obj) {
|
|
74
67
|
return obj && obj.__esModule ? obj : {
|
|
75
68
|
default: obj
|
|
@@ -231,29 +224,13 @@ function augmentLogsInternal(projectRoot) {
|
|
|
231
224
|
// at Background (http://localhost:8081/node_modules/expo-router/node/render.bundle?platform=web&dev=true&hot=false&transform.engine=hermes&transform.routerRoot=app&resolver.environment=node&transform.environment=node:151009:7)
|
|
232
225
|
const customStack = args[1];
|
|
233
226
|
try {
|
|
227
|
+
// `error.stack` is already symbolicated by Node's source map support
|
|
228
|
+
// (registered by `@expo/require-utils` when the SSR bundle is compiled), so the
|
|
229
|
+
// parsed frames already point at original sources. We just reformat them.
|
|
234
230
|
const parsedStack = (0, _LogBoxSymbolication.parseErrorStack)(customStack);
|
|
235
|
-
|
|
236
|
-
// TODO(@kitten): Is there overlap here with metro-source-map?
|
|
237
|
-
const mapped = (0, _sourcemapsupport().mapSourcePosition)({
|
|
238
|
-
// TODO(@kitten): Check if these non-null casts are correct and cannot fail
|
|
239
|
-
source: line.file,
|
|
240
|
-
line: line.lineNumber,
|
|
241
|
-
column: line.column
|
|
242
|
-
});
|
|
243
|
-
const fallbackName = mapped.name ?? '<unknown>';
|
|
244
|
-
return {
|
|
245
|
-
file: mapped.source ?? null,
|
|
246
|
-
lineNumber: mapped.line ?? null,
|
|
247
|
-
column: mapped.column ?? null,
|
|
248
|
-
// Attempt to preserve the react component name if possible.
|
|
249
|
-
methodName: line.methodName ? line.methodName === '<unknown>' ? fallbackName : line.methodName : fallbackName,
|
|
250
|
-
arguments: line.arguments ?? []
|
|
251
|
-
};
|
|
252
|
-
});
|
|
253
|
-
// Replace args[1] with the formatted stack.
|
|
254
|
-
args[1] = '\n' + formatParsedStackLikeMetro(projectRoot, symbolicatedStack, true);
|
|
231
|
+
args[1] = '\n' + formatParsedStackLikeMetro(projectRoot, parsedStack, true);
|
|
255
232
|
} catch {
|
|
256
|
-
// If
|
|
233
|
+
// If parsing fails, log the original stack.
|
|
257
234
|
args.push('\n' + formatStackLikeMetro(projectRoot, customStack));
|
|
258
235
|
}
|
|
259
236
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/start/server/serverLogLikeMetro.ts"],"sourcesContent":["/**\n * Copyright © 2024 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 type { SourcePosition } from '@expo/metro/metro-source-map/Consumer/types';\nimport { INTERNAL_CALLSITES_REGEX } from '@expo/metro-config';\nimport chalk from 'chalk';\nimport path from 'path';\nimport { mapSourcePosition } from 'source-map-support';\nimport * as stackTraceParser from 'stacktrace-parser';\n\nimport { parseErrorStack, StackFrame } from './metro/log-box/LogBoxSymbolication';\nimport { env } from '../../utils/env';\nimport { memoize } from '../../utils/fn';\nimport { LogBoxLog } from './metro/log-box/LogBoxLog';\nimport { getStackAsFormattedLog } from './metro/metroErrorInterface';\n\nconst debug = require('debug')('expo:metro:logger') as typeof console.log;\n\nconst CONSOLE_METHODS = [\n 'trace',\n 'info',\n 'error',\n 'warn',\n 'log',\n 'group',\n 'groupCollapsed',\n 'groupEnd',\n 'debug',\n] as const;\n\ntype ConsoleMethod = (typeof CONSOLE_METHODS)[number];\n\nconst groupStack: any = [];\nlet collapsedGuardTimer: ReturnType<typeof setTimeout> | undefined;\n\nexport function logLikeMetro(\n originalLogFunction: (...args: any[]) => void,\n level: ConsoleMethod,\n platform: 'BRIDGE' | 'NOBRIDGE' | 'λ' | null,\n ...data: any[]\n) {\n const logFunction = console[level] && level !== 'trace' ? level : 'log';\n const color =\n level === 'error'\n ? chalk.inverse.red\n : level === 'warn'\n ? chalk.inverse.yellow\n : chalk.inverse.white;\n\n if (level === 'group') {\n groupStack.push(level);\n } else if (level === 'groupCollapsed') {\n groupStack.push(level);\n clearTimeout(collapsedGuardTimer);\n // Inform users that logs get swallowed if they forget to call `groupEnd`.\n collapsedGuardTimer = setTimeout(() => {\n if (groupStack.includes('groupCollapsed')) {\n originalLogFunction(\n chalk.inverse.yellow.bold(' WARN '),\n 'Expected `console.groupEnd` to be called after `console.groupCollapsed`.'\n );\n groupStack.length = 0;\n }\n }, 3000);\n return;\n } else if (level === 'groupEnd') {\n groupStack.pop();\n if (!groupStack.length) {\n clearTimeout(collapsedGuardTimer);\n }\n return;\n }\n\n if (!groupStack.includes('groupCollapsed')) {\n // Remove excess whitespace at the end of a log message, if possible.\n const lastItem = data[data.length - 1];\n if (typeof lastItem === 'string') {\n data[data.length - 1] = lastItem.trimEnd();\n }\n\n const modePrefix =\n platform && platform !== 'BRIDGE' && platform !== 'NOBRIDGE' ? chalk.bold`${platform} ` : '';\n originalLogFunction(\n modePrefix +\n color.bold(` ${logFunction.toUpperCase()} `) +\n ''.padEnd(groupStack.length * 2, ' '),\n ...data\n );\n }\n}\n\nconst escapedPathSep = path.sep === '\\\\' ? '\\\\\\\\' : path.sep;\nconst SERVER_STACK_MATCHER = new RegExp(\n `${escapedPathSep}(react-dom|metro-runtime|expo-router)${escapedPathSep}`\n);\n\nexport async function maybeSymbolicateAndFormatJSErrorStackLogAsync(\n projectRoot: string,\n level: 'error' | 'warn' | (string & {}),\n error: {\n message: string;\n stack: StackFrame[];\n }\n): Promise<{\n isFallback: boolean;\n stack: string;\n}> {\n const log = new LogBoxLog({\n level: level as 'error' | 'warn',\n message: {\n content: error.message,\n substitutions: [],\n },\n isComponentError: false,\n stack: error.stack,\n category: 'static',\n componentStack: [],\n });\n\n await new Promise((res) => log.symbolicate('stack', res));\n\n const formatted = getStackAsFormattedLog(projectRoot, {\n stack: log.symbolicated?.stack?.stack ?? [],\n codeFrame: log.codeFrame,\n });\n\n // NOTE: Message is printed above stack by the default Metro logic. So we don't need to include it here.\n const symbolicatedErrorStackLog = `\\n\\n${formatted.stack}`;\n\n return {\n isFallback: formatted.isFallback,\n stack: symbolicatedErrorStackLog,\n };\n}\n\n/**\n * Attempt to parse an error message string to an unsymbolicated stack.\n */\nexport function parseErrorStringToObject(errorString: string) {\n // Find the first line of the possible stack trace\n const stackStartIndex = errorString.indexOf('\\n at ');\n if (stackStartIndex === -1) {\n // No stack trace found, return the original error string\n return null;\n }\n const message = errorString.slice(0, stackStartIndex).trim();\n const stack = errorString.slice(stackStartIndex + 1);\n\n try {\n const parsedStack = parseErrorStack(stack);\n\n return {\n message,\n stack: parsedStack,\n };\n } catch (e) {\n // If parsing fails, return the original error string\n debug('Failed to parse error stack:', e);\n return null;\n }\n}\n\ntype ConsoleLogAugmented = typeof console.log & {\n __polyfilled?: typeof console.log;\n};\n\nfunction augmentLogsInternal(projectRoot: string) {\n const augmentLog = (name: ConsoleMethod, fn: ConsoleLogAugmented) => {\n if (fn.__polyfilled) {\n return fn;\n }\n const originalFn = fn.bind(console);\n function logWithStack(...args: any[]) {\n const stack = new Error().stack;\n // Check if the log originates from the server.\n const isServerLog = !!stack?.match(SERVER_STACK_MATCHER);\n\n if (isServerLog) {\n if (name === 'error' || name === 'warn') {\n if (\n args.length === 2 &&\n typeof args[1] === 'string' &&\n args[1].trim().startsWith('at ')\n ) {\n // react-dom custom stacks which are always broken.\n // A stack string like:\n // at div\n // at http://localhost:8081/node_modules/expo-router/node/render.bundle?platform=web&dev=true&hot=false&transform.engine=hermes&transform.routerRoot=app&resolver.environment=node&transform.environment=node:38008:27\n // at Background (http://localhost:8081/node_modules/expo-router/node/render.bundle?platform=web&dev=true&hot=false&transform.engine=hermes&transform.routerRoot=app&resolver.environment=node&transform.environment=node:151009:7)\n const customStack = args[1];\n\n try {\n const parsedStack = parseErrorStack(customStack);\n const symbolicatedStack = parsedStack.map((line) => {\n // TODO(@kitten): Is there overlap here with metro-source-map?\n const mapped = mapSourcePosition({\n // TODO(@kitten): Check if these non-null casts are correct and cannot fail\n source: line.file!,\n line: line.lineNumber!,\n column: line.column!,\n }) as SourcePosition;\n\n const fallbackName = mapped.name ?? '<unknown>';\n return {\n file: mapped.source ?? null,\n lineNumber: mapped.line ?? null,\n column: mapped.column ?? null,\n // Attempt to preserve the react component name if possible.\n methodName: line.methodName\n ? line.methodName === '<unknown>'\n ? fallbackName\n : line.methodName\n : fallbackName,\n arguments: line.arguments ?? [],\n };\n });\n\n // Replace args[1] with the formatted stack.\n args[1] = '\\n' + formatParsedStackLikeMetro(projectRoot, symbolicatedStack, true);\n } catch {\n // If symbolication fails, log the original stack.\n args.push('\\n' + formatStackLikeMetro(projectRoot, customStack));\n }\n } else {\n args.push('\\n' + formatStackLikeMetro(projectRoot, stack!));\n }\n }\n\n logLikeMetro(originalFn, name, 'λ', ...args);\n } else {\n originalFn(...args);\n }\n }\n logWithStack.__polyfilled = true;\n return logWithStack;\n };\n\n for (const name of CONSOLE_METHODS) {\n console[name] = augmentLog(name, console[name]);\n }\n}\n\nexport function formatStackLikeMetro(projectRoot: string, stack: string) {\n // Remove `Error: ` from the beginning of the stack trace.\n // Dim traces that match `INTERNAL_CALLSITES_REGEX`\n\n const stackTrace = stackTraceParser.parse(stack);\n return formatParsedStackLikeMetro(projectRoot, stackTrace);\n}\n\nfunction formatParsedStackLikeMetro(\n projectRoot: string,\n stackTrace: stackTraceParser.StackFrame[],\n isComponentStack = false\n) {\n // Remove `Error: ` from the beginning of the stack trace.\n // Dim traces that match `INTERNAL_CALLSITES_REGEX`\n\n return stackTrace\n .filter(\n (line) =>\n line.file &&\n // Ignore unsymbolicated stack frames. It's not clear how this is possible but it sometimes happens when the graph changes.\n !/^https?:\\/\\//.test(line.file) &&\n (isComponentStack ? true : line.file !== '<anonymous>')\n )\n .map((line) => {\n // Use the same regex we use in Metro config to filter out traces:\n const isCollapsed = INTERNAL_CALLSITES_REGEX.test(line.file!);\n if (!isComponentStack && isCollapsed && !env.EXPO_DEBUG) {\n return null;\n }\n // If a file is collapsed, print it with dim styling.\n const style = isCollapsed ? chalk.dim : chalk.gray;\n // Use the `at` prefix to match Node.js\n let fileName = line.file!;\n if (fileName.startsWith(path.sep)) {\n fileName = path.relative(projectRoot, fileName);\n }\n if (line.lineNumber != null) {\n fileName += `:${line.lineNumber}`;\n if (line.column != null) {\n fileName += `:${line.column}`;\n }\n }\n\n return style(` ${line.methodName} (${fileName})`);\n })\n .filter(Boolean)\n .join('\\n');\n}\n\n/** Augment console logs to check the stack trace and format like Metro logs if we think the log came from the SSR renderer or an API route. */\nexport const augmentLogs = memoize(augmentLogsInternal);\n"],"names":["augmentLogs","formatStackLikeMetro","logLikeMetro","maybeSymbolicateAndFormatJSErrorStackLogAsync","parseErrorStringToObject","debug","require","CONSOLE_METHODS","groupStack","collapsedGuardTimer","originalLogFunction","level","platform","data","logFunction","console","color","chalk","inverse","red","yellow","white","push","clearTimeout","setTimeout","includes","bold","length","pop","lastItem","trimEnd","modePrefix","toUpperCase","padEnd","escapedPathSep","path","sep","SERVER_STACK_MATCHER","RegExp","projectRoot","error","log","LogBoxLog","message","content","substitutions","isComponentError","stack","category","componentStack","Promise","res","symbolicate","formatted","getStackAsFormattedLog","symbolicated","codeFrame","symbolicatedErrorStackLog","isFallback","errorString","stackStartIndex","indexOf","slice","trim","parsedStack","parseErrorStack","e","augmentLogsInternal","augmentLog","name","fn","__polyfilled","originalFn","bind","logWithStack","args","Error","isServerLog","match","startsWith","customStack","symbolicatedStack","map","line","mapped","mapSourcePosition","source","file","lineNumber","column","fallbackName","methodName","arguments","formatParsedStackLikeMetro","stackTrace","stackTraceParser","parse","isComponentStack","filter","test","isCollapsed","INTERNAL_CALLSITES_REGEX","env","EXPO_DEBUG","style","dim","gray","fileName","relative","Boolean","join","memoize"],"mappings":"AAAA;;;;;CAKC;;;;;;;;;;;IAmSYA,WAAW;eAAXA;;IAnDGC,oBAAoB;eAApBA;;IA/MAC,YAAY;eAAZA;;IA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OACCA,KAAKI,IAAI,IACT,2HAA2H;QAC3H,CAAC,eAAeY,IAAI,CAAChB,KAAKI,IAAI,KAC7BU,CAAAA,mBAAmB,OAAOd,KAAKI,IAAI,KAAK,aAAY,GAExDL,GAAG,CAAC,CAACC;QACJ,kEAAkE;QAClE,MAAMiB,cAAcC,uCAAwB,CAACF,IAAI,CAAChB,KAAKI,IAAI;QAC3D,IAAI,CAACU,oBAAoBG,eAAe,CAACE,QAAG,CAACC,UAAU,EAAE;YACvD,OAAO;QACT;QACA,qDAAqD;QACrD,MAAMC,QAAQJ,cAAcnF,gBAAK,CAACwF,GAAG,GAAGxF,gBAAK,CAACyF,IAAI;QAClD,uCAAuC;QACvC,IAAIC,WAAWxB,KAAKI,IAAI;QACxB,IAAIoB,SAAS5B,UAAU,CAAC5C,eAAI,CAACC,GAAG,GAAG;YACjCuE,WAAWxE,eAAI,CAACyE,QAAQ,CAACrE,aAAaoE;QACxC;QACA,IAAIxB,KAAKK,UAAU,IAAI,MAAM;YAC3BmB,YAAY,CAAC,CAAC,EAAExB,KAAKK,UAAU,EAAE;YACjC,IAAIL,KAAKM,MAAM,IAAI,MAAM;gBACvBkB,YAAY,CAAC,CAAC,EAAExB,KAAKM,MAAM,EAAE;YAC/B;QACF;QAEA,OAAOe,MAAM,CAAC,EAAE,EAAErB,KAAKQ,UAAU,CAAC,EAAE,EAAEgB,SAAS,CAAC,CAAC;IACnD,GACCT,MAAM,CAACW,SACPC,IAAI,CAAC;AACV;AAGO,MAAM9G,cAAc+G,IAAAA,WAAO,EAAC5C"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/start/server/serverLogLikeMetro.ts"],"sourcesContent":["/**\n * Copyright © 2024 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 { INTERNAL_CALLSITES_REGEX } from '@expo/metro-config';\nimport chalk from 'chalk';\nimport path from 'path';\nimport * as stackTraceParser from 'stacktrace-parser';\n\nimport { LogBoxLog } from './metro/log-box/LogBoxLog';\nimport type { StackFrame } from './metro/log-box/LogBoxSymbolication';\nimport { parseErrorStack } from './metro/log-box/LogBoxSymbolication';\nimport { getStackAsFormattedLog } from './metro/metroErrorInterface';\nimport { env } from '../../utils/env';\nimport { memoize } from '../../utils/fn';\n\nconst debug = require('debug')('expo:metro:logger') as typeof console.log;\n\nconst CONSOLE_METHODS = [\n 'trace',\n 'info',\n 'error',\n 'warn',\n 'log',\n 'group',\n 'groupCollapsed',\n 'groupEnd',\n 'debug',\n] as const;\n\ntype ConsoleMethod = (typeof CONSOLE_METHODS)[number];\n\nconst groupStack: any = [];\nlet collapsedGuardTimer: ReturnType<typeof setTimeout> | undefined;\n\nexport function logLikeMetro(\n originalLogFunction: (...args: any[]) => void,\n level: ConsoleMethod,\n platform: string | null,\n ...data: any[]\n) {\n const logFunction = console[level] && level !== 'trace' ? level : 'log';\n const color =\n level === 'error'\n ? chalk.inverse.red\n : level === 'warn'\n ? chalk.inverse.yellow\n : chalk.inverse.white;\n\n if (level === 'group') {\n groupStack.push(level);\n } else if (level === 'groupCollapsed') {\n groupStack.push(level);\n clearTimeout(collapsedGuardTimer);\n // Inform users that logs get swallowed if they forget to call `groupEnd`.\n collapsedGuardTimer = setTimeout(() => {\n if (groupStack.includes('groupCollapsed')) {\n originalLogFunction(\n chalk.inverse.yellow.bold(' WARN '),\n 'Expected `console.groupEnd` to be called after `console.groupCollapsed`.'\n );\n groupStack.length = 0;\n }\n }, 3000);\n return;\n } else if (level === 'groupEnd') {\n groupStack.pop();\n if (!groupStack.length) {\n clearTimeout(collapsedGuardTimer);\n }\n return;\n }\n\n if (!groupStack.includes('groupCollapsed')) {\n // Remove excess whitespace at the end of a log message, if possible.\n const lastItem = data[data.length - 1];\n if (typeof lastItem === 'string') {\n data[data.length - 1] = lastItem.trimEnd();\n }\n\n const modePrefix =\n platform && platform !== 'BRIDGE' && platform !== 'NOBRIDGE' ? chalk.bold`${platform} ` : '';\n originalLogFunction(\n modePrefix +\n color.bold(` ${logFunction.toUpperCase()} `) +\n ''.padEnd(groupStack.length * 2, ' '),\n ...data\n );\n }\n}\n\nconst escapedPathSep = path.sep === '\\\\' ? '\\\\\\\\' : path.sep;\nconst SERVER_STACK_MATCHER = new RegExp(\n `${escapedPathSep}(react-dom|metro-runtime|expo-router)${escapedPathSep}`\n);\n\nexport async function maybeSymbolicateAndFormatJSErrorStackLogAsync(\n projectRoot: string,\n level: 'error' | 'warn' | (string & {}),\n error: {\n message: string;\n stack: StackFrame[];\n }\n): Promise<{\n isFallback: boolean;\n stack: string;\n}> {\n const log = new LogBoxLog({\n level: level as 'error' | 'warn',\n message: {\n content: error.message,\n substitutions: [],\n },\n isComponentError: false,\n stack: error.stack,\n category: 'static',\n componentStack: [],\n });\n\n await new Promise((res) => log.symbolicate('stack', res));\n\n const formatted = getStackAsFormattedLog(projectRoot, {\n stack: log.symbolicated?.stack?.stack ?? [],\n codeFrame: log.codeFrame,\n });\n\n // NOTE: Message is printed above stack by the default Metro logic. So we don't need to include it here.\n const symbolicatedErrorStackLog = `\\n\\n${formatted.stack}`;\n\n return {\n isFallback: formatted.isFallback,\n stack: symbolicatedErrorStackLog,\n };\n}\n\n/**\n * Attempt to parse an error message string to an unsymbolicated stack.\n */\nexport function parseErrorStringToObject(errorString: string) {\n // Find the first line of the possible stack trace\n const stackStartIndex = errorString.indexOf('\\n at ');\n if (stackStartIndex === -1) {\n // No stack trace found, return the original error string\n return null;\n }\n const message = errorString.slice(0, stackStartIndex).trim();\n const stack = errorString.slice(stackStartIndex + 1);\n\n try {\n const parsedStack = parseErrorStack(stack);\n\n return {\n message,\n stack: parsedStack,\n };\n } catch (e) {\n // If parsing fails, return the original error string\n debug('Failed to parse error stack:', e);\n return null;\n }\n}\n\ntype ConsoleLogAugmented = typeof console.log & {\n __polyfilled?: typeof console.log;\n};\n\nfunction augmentLogsInternal(projectRoot: string) {\n const augmentLog = (name: ConsoleMethod, fn: ConsoleLogAugmented) => {\n if (fn.__polyfilled) {\n return fn;\n }\n const originalFn = fn.bind(console);\n function logWithStack(...args: any[]) {\n const stack = new Error().stack;\n // Check if the log originates from the server.\n const isServerLog = !!stack?.match(SERVER_STACK_MATCHER);\n\n if (isServerLog) {\n if (name === 'error' || name === 'warn') {\n if (\n args.length === 2 &&\n typeof args[1] === 'string' &&\n args[1].trim().startsWith('at ')\n ) {\n // react-dom custom stacks which are always broken.\n // A stack string like:\n // at div\n // at http://localhost:8081/node_modules/expo-router/node/render.bundle?platform=web&dev=true&hot=false&transform.engine=hermes&transform.routerRoot=app&resolver.environment=node&transform.environment=node:38008:27\n // at Background (http://localhost:8081/node_modules/expo-router/node/render.bundle?platform=web&dev=true&hot=false&transform.engine=hermes&transform.routerRoot=app&resolver.environment=node&transform.environment=node:151009:7)\n const customStack = args[1];\n\n try {\n // `error.stack` is already symbolicated by Node's source map support\n // (registered by `@expo/require-utils` when the SSR bundle is compiled), so the\n // parsed frames already point at original sources. We just reformat them.\n const parsedStack = parseErrorStack(customStack);\n args[1] = '\\n' + formatParsedStackLikeMetro(projectRoot, parsedStack, true);\n } catch {\n // If parsing fails, log the original stack.\n args.push('\\n' + formatStackLikeMetro(projectRoot, customStack));\n }\n } else {\n args.push('\\n' + formatStackLikeMetro(projectRoot, stack!));\n }\n }\n\n logLikeMetro(originalFn, name, 'λ', ...args);\n } else {\n originalFn(...args);\n }\n }\n logWithStack.__polyfilled = true;\n return logWithStack;\n };\n\n for (const name of CONSOLE_METHODS) {\n console[name] = augmentLog(name, console[name]);\n }\n}\n\nexport function formatStackLikeMetro(projectRoot: string, stack: string) {\n // Remove `Error: ` from the beginning of the stack trace.\n // Dim traces that match `INTERNAL_CALLSITES_REGEX`\n\n const stackTrace = stackTraceParser.parse(stack);\n return formatParsedStackLikeMetro(projectRoot, stackTrace);\n}\n\nfunction formatParsedStackLikeMetro(\n projectRoot: string,\n stackTrace: stackTraceParser.StackFrame[],\n isComponentStack = false\n) {\n // Remove `Error: ` from the beginning of the stack trace.\n // Dim traces that match `INTERNAL_CALLSITES_REGEX`\n\n return stackTrace\n .filter(\n (line) =>\n line.file &&\n // Ignore unsymbolicated stack frames. It's not clear how this is possible but it sometimes happens when the graph changes.\n !/^https?:\\/\\//.test(line.file) &&\n (isComponentStack ? true : line.file !== '<anonymous>')\n )\n .map((line) => {\n // Use the same regex we use in Metro config to filter out traces:\n const isCollapsed = INTERNAL_CALLSITES_REGEX.test(line.file!);\n if (!isComponentStack && isCollapsed && !env.EXPO_DEBUG) {\n return null;\n }\n // If a file is collapsed, print it with dim styling.\n const style = isCollapsed ? chalk.dim : chalk.gray;\n // Use the `at` prefix to match Node.js\n let fileName = line.file!;\n if (fileName.startsWith(path.sep)) {\n fileName = path.relative(projectRoot, fileName);\n }\n if (line.lineNumber != null) {\n fileName += `:${line.lineNumber}`;\n if (line.column != null) {\n fileName += `:${line.column}`;\n }\n }\n\n return style(` ${line.methodName} (${fileName})`);\n })\n .filter(Boolean)\n .join('\\n');\n}\n\n/** Augment console logs to check the stack trace and format like Metro logs if we think the log came from the SSR renderer or an API route. */\nexport const augmentLogs = memoize(augmentLogsInternal);\n"],"names":["augmentLogs","formatStackLikeMetro","logLikeMetro","maybeSymbolicateAndFormatJSErrorStackLogAsync","parseErrorStringToObject","debug","require","CONSOLE_METHODS","groupStack","collapsedGuardTimer","originalLogFunction","level","platform","data","logFunction","console","color","chalk","inverse","red","yellow","white","push","clearTimeout","setTimeout","includes","bold","length","pop","lastItem","trimEnd","modePrefix","toUpperCase","padEnd","escapedPathSep","path","sep","SERVER_STACK_MATCHER","RegExp","projectRoot","error","log","LogBoxLog","message","content","substitutions","isComponentError","stack","category","componentStack","Promise","res","symbolicate","formatted","getStackAsFormattedLog","symbolicated","codeFrame","symbolicatedErrorStackLog","isFallback","errorString","stackStartIndex","indexOf","slice","trim","parsedStack","parseErrorStack","e","augmentLogsInternal","augmentLog","name","fn","__polyfilled","originalFn","bind","logWithStack","args","Error","isServerLog","match","startsWith","customStack","formatParsedStackLikeMetro","stackTrace","stackTraceParser","parse","isComponentStack","filter","line","file","test","map","isCollapsed","INTERNAL_CALLSITES_REGEX","env","EXPO_DEBUG","style","dim","gray","fileName","relative","lineNumber","column","methodName","Boolean","join","memoize"],"mappings":"AAAA;;;;;CAKC;;;;;;;;;;;QA4QYA;eAAAA;;QAnDGC;eAAAA;;QAzLAC;eAAAA;;QA6DMC;eAAAA;;QA0CNC;eAAAA;;;;yBAtIyB;;;;;;;gEACvB;;;;;;;gEACD;;;;;;;iEACiB;;;;;;2BAER;qCAEM;qCACO;qBACnB;oBACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAExB,MAAMC,QAAQC,QAAQ,SAAS;AAE/B,MAAMC,kBAAkB;IACtB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAID,MAAMC,aAAkB,EAAE;AAC1B,IAAIC;AAEG,SAASP,aACdQ,mBAA6C,EAC7CC,KAAoB,EACpBC,QAAuB,EACvB,GAAGC,IAAW;IAEd,MAAMC,cAAcC,OAAO,CAACJ,MAAM,IAAIA,UAAU,UAAUA,QAAQ;IAClE,MAAMK,QACJL,UAAU,UACNM,gBAAK,CAACC,OAAO,CAACC,GAAG,GACjBR,UAAU,SACRM,gBAAK,CAACC,OAAO,CAACE,MAAM,GACpBH,gBAAK,CAACC,OAAO,CAACG,KAAK;IAE3B,IAAIV,UAAU,SAAS;QACrBH,WAAWc,IAAI,CAACX;IAClB,OAAO,IAAIA,UAAU,kBAAkB;QACrCH,WAAWc,IAAI,CAACX;QAChBY,aAAad;QACb,0EAA0E;QAC1EA,sBAAsBe,WAAW;YAC/B,IAAIhB,WAAWiB,QAAQ,CAAC,mBAAmB;gBACzCf,oBACEO,gBAAK,CAACC,OAAO,CAACE,MAAM,CAACM,IAAI,CAAC,WAC1B;gBAEFlB,WAAWmB,MAAM,GAAG;YACtB;QACF,GAAG;QACH;IACF,OAAO,IAAIhB,UAAU,YAAY;QAC/BH,WAAWoB,GAAG;QACd,IAA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C,QAAQJ,cAAc1E,gBAAK,CAAC+E,GAAG,GAAG/E,gBAAK,CAACgF,IAAI;QAClD,uCAAuC;QACvC,IAAIC,WAAWX,KAAKC,IAAI;QACxB,IAAIU,SAASnB,UAAU,CAAC5C,eAAI,CAACC,GAAG,GAAG;YACjC8D,WAAW/D,eAAI,CAACgE,QAAQ,CAAC5D,aAAa2D;QACxC;QACA,IAAIX,KAAKa,UAAU,IAAI,MAAM;YAC3BF,YAAY,CAAC,CAAC,EAAEX,KAAKa,UAAU,EAAE;YACjC,IAAIb,KAAKc,MAAM,IAAI,MAAM;gBACvBH,YAAY,CAAC,CAAC,EAAEX,KAAKc,MAAM,EAAE;YAC/B;QACF;QAEA,OAAON,MAAM,CAAC,EAAE,EAAER,KAAKe,UAAU,CAAC,EAAE,EAAEJ,SAAS,CAAC,CAAC;IACnD,GACCZ,MAAM,CAACiB,SACPC,IAAI,CAAC;AACV;AAGO,MAAMxG,cAAcyG,IAAAA,WAAO,EAACtC"}
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
removeExpoEnvDTS
|
|
12
|
+
get removeExpoEnvDTS () {
|
|
13
13
|
return removeExpoEnvDTS;
|
|
14
14
|
},
|
|
15
|
-
writeExpoEnvDTS
|
|
15
|
+
get writeExpoEnvDTS () {
|
|
16
16
|
return writeExpoEnvDTS;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/type-generation/expo-env.ts"],"sourcesContent":["import fs from 'fs/promises';\nimport path from 'path';\n\nconst template = `/// <reference types=\"expo/types\" />\n\n// NOTE: This file should not be edited and should be in your git ignore`;\n\nexport async function writeExpoEnvDTS(projectRoot: string) {\n return fs.writeFile(path.join(projectRoot, 'expo-env.d.ts'), template);\n}\n\nexport async function removeExpoEnvDTS(projectRoot: string) {\n // Force removal of expo-env.d.ts - Ignore any errors if the file does not exist\n return fs.rm(path.join(projectRoot, 'expo-env.d.ts'), { force: true });\n}\n"],"names":["removeExpoEnvDTS","writeExpoEnvDTS","template","projectRoot","fs","writeFile","path","join","rm","force"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/type-generation/expo-env.ts"],"sourcesContent":["import fs from 'fs/promises';\nimport path from 'path';\n\nconst template = `/// <reference types=\"expo/types\" />\n\n// NOTE: This file should not be edited and should be in your git ignore`;\n\nexport async function writeExpoEnvDTS(projectRoot: string) {\n return fs.writeFile(path.join(projectRoot, 'expo-env.d.ts'), template);\n}\n\nexport async function removeExpoEnvDTS(projectRoot: string) {\n // Force removal of expo-env.d.ts - Ignore any errors if the file does not exist\n return fs.rm(path.join(projectRoot, 'expo-env.d.ts'), { force: true });\n}\n"],"names":["removeExpoEnvDTS","writeExpoEnvDTS","template","projectRoot","fs","writeFile","path","join","rm","force"],"mappings":";;;;;;;;;;;QAWsBA;eAAAA;;QAJAC;eAAAA;;;;gEAPP;;;;;;;gEACE;;;;;;;;;;;AAEjB,MAAMC,WAAW,CAAC;;wEAEsD,CAAC;AAElE,eAAeD,gBAAgBE,WAAmB;IACvD,OAAOC,mBAAE,CAACC,SAAS,CAACC,eAAI,CAACC,IAAI,CAACJ,aAAa,kBAAkBD;AAC/D;AAEO,eAAeF,iBAAiBG,WAAmB;IACxD,gFAAgF;IAChF,OAAOC,mBAAE,CAACI,EAAE,CAACF,eAAI,CAACC,IAAI,CAACJ,aAAa,kBAAkB;QAAEM,OAAO;IAAK;AACtE"}
|