@expo/cli 0.17.9 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bin/cli +11 -7
- package/build/bin/cli.map +1 -1
- package/build/src/api/getExpoSchema.js +23 -5
- package/build/src/api/getExpoSchema.js.map +1 -1
- package/build/src/api/graphql/client.js +28 -10
- package/build/src/api/graphql/client.js.map +1 -1
- package/build/src/api/graphql/queries/AppQuery.js +16 -4
- package/build/src/api/graphql/queries/AppQuery.js.map +1 -1
- package/build/src/api/graphql/queries/UserQuery.js +8 -2
- package/build/src/api/graphql/queries/UserQuery.js.map +1 -1
- package/build/src/api/graphql/types/App.js +8 -2
- package/build/src/api/graphql/types/App.js.map +1 -1
- package/build/src/api/rest/cache/FileSystemCache.js +21 -9
- package/build/src/api/rest/cache/FileSystemCache.js.map +1 -1
- package/build/src/api/rest/cache/response.js +9 -3
- package/build/src/api/rest/cache/response.js.map +1 -1
- package/build/src/api/rest/cache/wrapFetchWithCache.js +32 -8
- package/build/src/api/rest/cache/wrapFetchWithCache.js.map +1 -1
- package/build/src/api/rest/client.js +23 -5
- package/build/src/api/rest/client.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithBaseUrl.js +9 -4
- package/build/src/api/rest/wrapFetchWithBaseUrl.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithProxy.js +8 -2
- package/build/src/api/rest/wrapFetchWithProxy.js.map +1 -1
- package/build/src/api/settings.js +8 -2
- package/build/src/api/settings.js.map +1 -1
- package/build/src/api/updateDevelopmentSession.js +18 -6
- package/build/src/api/updateDevelopmentSession.js.map +1 -1
- package/build/src/api/user/UserSettings.js +26 -8
- package/build/src/api/user/UserSettings.js.map +1 -1
- package/build/src/api/user/actions.js +17 -5
- package/build/src/api/user/actions.js.map +1 -1
- package/build/src/api/user/expoSsoLauncher.js +32 -8
- package/build/src/api/user/expoSsoLauncher.js.map +1 -1
- package/build/src/api/user/otp.js +17 -5
- package/build/src/api/user/otp.js.map +1 -1
- package/build/src/api/user/user.js +19 -12
- package/build/src/api/user/user.js.map +1 -1
- package/build/src/config/configAsync.js +25 -7
- package/build/src/config/configAsync.js.map +1 -1
- package/build/src/config/index.js +9 -3
- package/build/src/config/index.js.map +1 -1
- package/build/src/customize/customizeAsync.js +8 -2
- package/build/src/customize/customizeAsync.js.map +1 -1
- package/build/src/customize/generate.js +16 -4
- package/build/src/customize/generate.js.map +1 -1
- package/build/src/customize/index.js +10 -4
- package/build/src/customize/index.js.map +1 -1
- package/build/src/customize/templates.js +33 -9
- package/build/src/customize/templates.js.map +1 -1
- package/build/src/customize/typescript.js +8 -2
- package/build/src/customize/typescript.js.map +1 -1
- package/build/src/export/createMetadataJson.js +8 -2
- package/build/src/export/createMetadataJson.js.map +1 -1
- package/build/src/export/embed/exportEmbedAsync.js +58 -18
- package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
- package/build/src/export/embed/index.js +17 -5
- package/build/src/export/embed/index.js.map +1 -1
- package/build/src/export/embed/resolveOptions.js +8 -2
- package/build/src/export/embed/resolveOptions.js.map +1 -1
- package/build/src/export/embed/xcodeCompilerLogger.js +16 -4
- package/build/src/export/embed/xcodeCompilerLogger.js.map +1 -1
- package/build/src/export/exportApp.js +32 -12
- package/build/src/export/exportApp.js.map +1 -1
- package/build/src/export/exportAssets.js +27 -9
- package/build/src/export/exportAssets.js.map +1 -1
- package/build/src/export/exportAsync.js +10 -2
- package/build/src/export/exportAsync.js.map +1 -1
- package/build/src/export/exportHermes.js +29 -17
- package/build/src/export/exportHermes.js.map +1 -1
- package/build/src/export/exportStaticAsync.js +69 -37
- package/build/src/export/exportStaticAsync.js.map +1 -1
- package/build/src/export/favicon.js +33 -9
- package/build/src/export/favicon.js.map +1 -1
- package/build/src/export/fork-bundleAsync.js +61 -16
- package/build/src/export/fork-bundleAsync.js.map +1 -1
- package/build/src/export/getPublicExpoManifest.js +8 -2
- package/build/src/export/getPublicExpoManifest.js.map +1 -1
- package/build/src/export/getResolvedLocales.js +15 -3
- package/build/src/export/getResolvedLocales.js.map +1 -1
- package/build/src/export/index.js +11 -5
- package/build/src/export/index.js.map +1 -1
- package/build/src/export/metroAssetLocalPath.js +9 -3
- package/build/src/export/metroAssetLocalPath.js.map +1 -1
- package/build/src/export/persistMetroAssets.js +27 -15
- package/build/src/export/persistMetroAssets.js.map +1 -1
- package/build/src/export/publicFolder.js +18 -6
- package/build/src/export/publicFolder.js.map +1 -1
- package/build/src/export/resolveOptions.js +8 -2
- package/build/src/export/resolveOptions.js.map +1 -1
- package/build/src/export/saveAssets.js +43 -19
- package/build/src/export/saveAssets.js.map +1 -1
- package/build/src/export/web/exportWebAsync.js +16 -4
- package/build/src/export/web/exportWebAsync.js.map +1 -1
- package/build/src/export/web/index.js +9 -3
- package/build/src/export/web/index.js.map +1 -1
- package/build/src/install/applyPlugins.js +8 -2
- package/build/src/install/applyPlugins.js.map +1 -1
- package/build/src/install/checkPackages.js +18 -6
- package/build/src/install/checkPackages.js.map +1 -1
- package/build/src/install/fixPackages.js +8 -2
- package/build/src/install/fixPackages.js.map +1 -1
- package/build/src/install/index.js +14 -8
- package/build/src/install/index.js.map +1 -1
- package/build/src/install/installAsync.js +27 -9
- package/build/src/install/installAsync.js.map +1 -1
- package/build/src/install/installExpoPackage.js +17 -5
- package/build/src/install/installExpoPackage.js.map +1 -1
- package/build/src/install/utils/autoAddConfigPlugins.js +17 -5
- package/build/src/install/utils/autoAddConfigPlugins.js.map +1 -1
- package/build/src/log.js +9 -3
- package/build/src/log.js.map +1 -1
- package/build/src/prebuild/clearNativeFolder.js +37 -13
- package/build/src/prebuild/clearNativeFolder.js.map +1 -1
- package/build/src/prebuild/configureProjectAsync.js +16 -4
- package/build/src/prebuild/configureProjectAsync.js.map +1 -1
- package/build/src/prebuild/copyTemplateFiles.js +29 -11
- package/build/src/prebuild/copyTemplateFiles.js.map +1 -1
- package/build/src/prebuild/ensureConfigAsync.js +24 -6
- package/build/src/prebuild/ensureConfigAsync.js.map +1 -1
- package/build/src/prebuild/index.js +14 -8
- package/build/src/prebuild/index.js.map +1 -1
- package/build/src/prebuild/prebuildAsync.js +9 -3
- package/build/src/prebuild/prebuildAsync.js.map +1 -1
- package/build/src/prebuild/renameTemplateAppName.js +119 -0
- package/build/src/prebuild/renameTemplateAppName.js.map +1 -0
- package/build/src/prebuild/resolveOptions.js +32 -8
- package/build/src/prebuild/resolveOptions.js.map +1 -1
- package/build/src/prebuild/resolveTemplate.js +44 -14
- package/build/src/prebuild/resolveTemplate.js.map +1 -1
- package/build/src/prebuild/updateFromTemplate.js +18 -2
- package/build/src/prebuild/updateFromTemplate.js.map +1 -1
- package/build/src/prebuild/updatePackageJson.js +49 -13
- package/build/src/prebuild/updatePackageJson.js.map +1 -1
- package/build/src/prebuild/validateTemplatePlatforms.js +16 -4
- package/build/src/prebuild/validateTemplatePlatforms.js.map +1 -1
- package/build/src/run/android/index.js +20 -4
- package/build/src/run/android/index.js.map +1 -1
- package/build/src/run/android/resolveGradlePropsAsync.js +55 -0
- package/build/src/run/android/resolveGradlePropsAsync.js.map +1 -0
- package/build/src/run/android/resolveInstallApkName.js +18 -6
- package/build/src/run/android/resolveInstallApkName.js.map +1 -1
- package/build/src/run/android/resolveLaunchProps.js +10 -4
- package/build/src/run/android/resolveLaunchProps.js.map +1 -1
- package/build/src/run/android/resolveOptions.js +5 -3
- package/build/src/run/android/resolveOptions.js.map +1 -1
- package/build/src/run/android/runAndroidAsync.js +13 -4
- package/build/src/run/android/runAndroidAsync.js.map +1 -1
- package/build/src/run/ensureNativeProject.js +15 -3
- package/build/src/run/ensureNativeProject.js.map +1 -1
- package/build/src/run/hints.js +10 -4
- package/build/src/run/hints.js.map +1 -1
- package/build/src/run/index.js +8 -2
- package/build/src/run/index.js.map +1 -1
- package/build/src/run/ios/XcodeBuild.js +57 -21
- package/build/src/run/ios/XcodeBuild.js.map +1 -1
- package/build/src/run/ios/appleDevice/AppleDevice.js +25 -7
- package/build/src/run/ios/appleDevice/AppleDevice.js.map +1 -1
- package/build/src/run/ios/appleDevice/ClientManager.js +10 -4
- package/build/src/run/ios/appleDevice/ClientManager.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/AFCClient.js +34 -10
- package/build/src/run/ios/appleDevice/client/AFCClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/DebugserverClient.js +16 -4
- package/build/src/run/ios/appleDevice/client/DebugserverClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/InstallationProxyClient.js +8 -2
- package/build/src/run/ios/appleDevice/client/InstallationProxyClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/LockdowndClient.js +17 -5
- package/build/src/run/ios/appleDevice/client/LockdowndClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/MobileImageMounterClient.js +17 -5
- package/build/src/run/ios/appleDevice/client/MobileImageMounterClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/UsbmuxdClient.js +25 -7
- package/build/src/run/ios/appleDevice/client/UsbmuxdClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/installOnDeviceAsync.js +24 -6
- package/build/src/run/ios/appleDevice/installOnDeviceAsync.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/AFCProtocol.js +8 -2
- package/build/src/run/ios/appleDevice/protocol/AFCProtocol.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/AbstractProtocol.js +16 -4
- package/build/src/run/ios/appleDevice/protocol/AbstractProtocol.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/GDBProtocol.js +8 -2
- package/build/src/run/ios/appleDevice/protocol/GDBProtocol.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/LockdownProtocol.js +16 -4
- package/build/src/run/ios/appleDevice/protocol/LockdownProtocol.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/UsbmuxProtocol.js +16 -4
- package/build/src/run/ios/appleDevice/protocol/UsbmuxProtocol.js.map +1 -1
- package/build/src/run/ios/codeSigning/Security.js +17 -5
- package/build/src/run/ios/codeSigning/Security.js.map +1 -1
- package/build/src/run/ios/codeSigning/configureCodeSigning.js +8 -2
- package/build/src/run/ios/codeSigning/configureCodeSigning.js.map +1 -1
- package/build/src/run/ios/codeSigning/resolveCertificateSigningIdentity.js +9 -3
- package/build/src/run/ios/codeSigning/resolveCertificateSigningIdentity.js.map +1 -1
- package/build/src/run/ios/codeSigning/simulatorCodeSigning.js +25 -7
- package/build/src/run/ios/codeSigning/simulatorCodeSigning.js.map +1 -1
- package/build/src/run/ios/codeSigning/xcodeCodeSigning.js +22 -10
- package/build/src/run/ios/codeSigning/xcodeCodeSigning.js.map +1 -1
- package/build/src/run/ios/index.js +19 -7
- package/build/src/run/ios/index.js.map +1 -1
- package/build/src/run/ios/launchApp.js +17 -5
- package/build/src/run/ios/launchApp.js.map +1 -1
- package/build/src/run/ios/options/promptDevice.js +9 -3
- package/build/src/run/ios/options/promptDevice.js.map +1 -1
- package/build/src/run/ios/options/resolveDevice.js +1 -2
- package/build/src/run/ios/options/resolveDevice.js.map +1 -1
- package/build/src/run/ios/options/resolveNativeScheme.js +27 -9
- package/build/src/run/ios/options/resolveNativeScheme.js.map +1 -1
- package/build/src/run/ios/options/resolveXcodeProject.js +8 -2
- package/build/src/run/ios/options/resolveXcodeProject.js.map +1 -1
- package/build/src/run/ios/runIosAsync.js +10 -2
- package/build/src/run/ios/runIosAsync.js.map +1 -1
- package/build/src/run/startBundler.js +16 -4
- package/build/src/run/startBundler.js.map +1 -1
- package/build/src/start/detectDevClient.js +29 -0
- package/build/src/start/detectDevClient.js.map +1 -0
- package/build/src/start/doctor/SecurityBinPrerequisite.js +8 -2
- package/build/src/start/doctor/SecurityBinPrerequisite.js.map +1 -1
- package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js +16 -4
- package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js.map +1 -1
- package/build/src/start/doctor/apple/XcodeDeveloperDiskImagePrerequisite.js +16 -4
- package/build/src/start/doctor/apple/XcodeDeveloperDiskImagePrerequisite.js.map +1 -1
- package/build/src/start/doctor/apple/XcodePrerequisite.js +79 -29
- package/build/src/start/doctor/apple/XcodePrerequisite.js.map +1 -1
- package/build/src/start/doctor/apple/XcrunPrerequisite.js +24 -6
- package/build/src/start/doctor/apple/XcrunPrerequisite.js.map +1 -1
- package/build/src/start/doctor/dependencies/bundledNativeModules.js +25 -7
- package/build/src/start/doctor/dependencies/bundledNativeModules.js.map +1 -1
- package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js +27 -9
- package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js.map +1 -1
- package/build/src/start/doctor/dependencies/getMissingPackages.js +24 -6
- package/build/src/start/doctor/dependencies/getMissingPackages.js.map +1 -1
- package/build/src/start/doctor/dependencies/getVersionedPackages.js +8 -2
- package/build/src/start/doctor/dependencies/getVersionedPackages.js.map +1 -1
- package/build/src/start/doctor/dependencies/resolvePackages.js +25 -7
- package/build/src/start/doctor/dependencies/resolvePackages.js.map +1 -1
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js +32 -21
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js.map +1 -1
- package/build/src/start/doctor/ngrok/ExternalModule.js +33 -9
- package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -1
- package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js +18 -6
- package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js.map +1 -1
- package/build/src/start/doctor/typescript/updateTSConfig.js +29 -11
- package/build/src/start/doctor/typescript/updateTSConfig.js.map +1 -1
- package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js +18 -6
- package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js.map +1 -1
- package/build/src/start/index.js +17 -11
- package/build/src/start/index.js.map +1 -1
- package/build/src/start/interface/commandsTable.js +27 -9
- package/build/src/start/interface/commandsTable.js.map +1 -1
- package/build/src/start/interface/interactiveActions.js +17 -11
- package/build/src/start/interface/interactiveActions.js.map +1 -1
- package/build/src/start/interface/startInterface.js +8 -2
- package/build/src/start/interface/startInterface.js.map +1 -1
- package/build/src/start/platforms/AppIdResolver.js +9 -3
- package/build/src/start/platforms/AppIdResolver.js.map +1 -1
- package/build/src/start/platforms/DeviceManager.js +8 -2
- package/build/src/start/platforms/DeviceManager.js.map +1 -1
- package/build/src/start/platforms/ExpoGoInstaller.js +30 -14
- package/build/src/start/platforms/ExpoGoInstaller.js.map +1 -1
- package/build/src/start/platforms/PlatformManager.js +33 -13
- package/build/src/start/platforms/PlatformManager.js.map +1 -1
- package/build/src/start/platforms/android/ADBServer.js +17 -5
- package/build/src/start/platforms/android/ADBServer.js.map +1 -1
- package/build/src/start/platforms/android/AndroidAppIdResolver.js +13 -7
- package/build/src/start/platforms/android/AndroidAppIdResolver.js.map +1 -1
- package/build/src/start/platforms/android/AndroidDeviceManager.js +19 -7
- package/build/src/start/platforms/android/AndroidDeviceManager.js.map +1 -1
- package/build/src/start/platforms/android/AndroidSdk.js +34 -10
- package/build/src/start/platforms/android/AndroidSdk.js.map +1 -1
- package/build/src/start/platforms/android/activateWindow.js +16 -4
- package/build/src/start/platforms/android/activateWindow.js.map +1 -1
- package/build/src/start/platforms/android/adb.js +21 -4
- package/build/src/start/platforms/android/adb.js.map +1 -1
- package/build/src/start/platforms/android/emulator.js +32 -8
- package/build/src/start/platforms/android/emulator.js.map +1 -1
- package/build/src/start/platforms/android/gradle.js +23 -6
- package/build/src/start/platforms/android/gradle.js.map +1 -1
- package/build/src/start/platforms/android/promptAndroidDevice.js +10 -4
- package/build/src/start/platforms/android/promptAndroidDevice.js.map +1 -1
- package/build/src/start/platforms/ios/AppleAppIdResolver.js +26 -8
- package/build/src/start/platforms/ios/AppleAppIdResolver.js.map +1 -1
- package/build/src/start/platforms/ios/AppleDeviceManager.js +50 -18
- package/build/src/start/platforms/ios/AppleDeviceManager.js.map +1 -1
- package/build/src/start/platforms/ios/assertSystemRequirements.js +4 -3
- package/build/src/start/platforms/ios/assertSystemRequirements.js.map +1 -1
- package/build/src/start/platforms/ios/ensureSimulatorAppRunning.js +16 -4
- package/build/src/start/platforms/ios/ensureSimulatorAppRunning.js.map +1 -1
- package/build/src/start/platforms/ios/getBestSimulator.js +8 -2
- package/build/src/start/platforms/ios/getBestSimulator.js.map +1 -1
- package/build/src/start/platforms/ios/promptAppleDevice.js +9 -3
- package/build/src/start/platforms/ios/promptAppleDevice.js.map +1 -1
- package/build/src/start/platforms/ios/simctl.js +12 -6
- package/build/src/start/platforms/ios/simctl.js.map +1 -1
- package/build/src/start/platforms/ios/simctlLogging.js +40 -10
- package/build/src/start/platforms/ios/simctlLogging.js.map +1 -1
- package/build/src/start/platforms/ios/xcrun.js +16 -4
- package/build/src/start/platforms/ios/xcrun.js.map +1 -1
- package/build/src/start/project/dotExpo.js +27 -9
- package/build/src/start/project/dotExpo.js.map +1 -1
- package/build/src/start/resolveOptions.js +33 -15
- package/build/src/start/resolveOptions.js.map +1 -1
- package/build/src/start/server/AsyncNgrok.js +34 -10
- package/build/src/start/server/AsyncNgrok.js.map +1 -1
- package/build/src/start/server/BundlerDevServer.js +16 -4
- package/build/src/start/server/BundlerDevServer.js.map +1 -1
- package/build/src/start/server/DevServerManager.js +28 -10
- package/build/src/start/server/DevServerManager.js.map +1 -1
- package/build/src/start/server/DevToolsPluginManager.js +16 -4
- package/build/src/start/server/DevToolsPluginManager.js.map +1 -1
- package/build/src/start/server/DevelopmentSession.js +9 -3
- package/build/src/start/server/DevelopmentSession.js.map +1 -1
- package/build/src/start/server/ReactDevToolsProxy.js +26 -8
- package/build/src/start/server/ReactDevToolsProxy.js.map +1 -1
- package/build/src/start/server/UrlCreator.js +19 -6
- package/build/src/start/server/UrlCreator.js.map +1 -1
- package/build/src/start/server/getStaticRenderFunctions.js +91 -55
- package/build/src/start/server/getStaticRenderFunctions.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +231 -83
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/MetroTerminalReporter.js +30 -15
- package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
- package/build/src/start/server/metro/TerminalReporter.js +26 -8
- package/build/src/start/server/metro/TerminalReporter.js.map +1 -1
- package/build/src/start/server/metro/TerminalReporter.types.js.map +1 -1
- package/build/src/start/server/metro/createExpoMetroResolver.js +56 -20
- package/build/src/start/server/metro/createExpoMetroResolver.js.map +1 -1
- package/build/src/start/server/metro/createJResolver.js +90 -45
- package/build/src/start/server/metro/createJResolver.js.map +1 -1
- package/build/src/start/server/metro/createServerRouteMiddleware.js +29 -28
- package/build/src/start/server/metro/createServerRouteMiddleware.js.map +1 -1
- package/build/src/start/server/metro/debugging/MessageHandler.js +27 -0
- package/build/src/start/server/metro/debugging/MessageHandler.js.map +1 -0
- package/build/src/start/server/metro/debugging/createDebugMiddleware.js +11 -8
- package/build/src/start/server/metro/debugging/createDebugMiddleware.js.map +1 -1
- package/build/src/start/server/metro/debugging/createHandlersFactory.js +63 -0
- package/build/src/start/server/metro/debugging/createHandlersFactory.js.map +1 -0
- package/build/src/start/server/metro/debugging/{inspectorHandlers/utils.js → getDebuggerType.js} +1 -6
- package/build/src/start/server/metro/debugging/getDebuggerType.js.map +1 -0
- package/build/src/start/server/metro/debugging/{inspectorHandlers → messageHandlers}/NetworkResponse.js +8 -5
- package/build/src/start/server/metro/debugging/messageHandlers/NetworkResponse.js.map +1 -0
- package/build/src/start/server/metro/debugging/{inspectorHandlers → messageHandlers}/PageReload.js +7 -6
- package/build/src/start/server/metro/debugging/messageHandlers/PageReload.js.map +1 -0
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeDebuggerGetPossibleBreakpoints.js +25 -0
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeDebuggerGetPossibleBreakpoints.js.map +1 -0
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeDebuggerSetBreakpointByUrl.js +22 -0
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeDebuggerSetBreakpointByUrl.js.map +1 -0
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeRuntimeCallFunctionOn.js +28 -0
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeRuntimeCallFunctionOn.js.map +1 -0
- package/build/src/start/server/metro/debugging/{inspectorHandlers → messageHandlers}/VscodeRuntimeGetProperties.js +10 -6
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeRuntimeGetProperties.js.map +1 -0
- package/build/src/start/server/metro/debugging/pageIsSupported.js +14 -0
- package/build/src/start/server/metro/debugging/pageIsSupported.js.map +1 -0
- package/build/src/start/server/metro/debugging/types.js.map +1 -0
- package/build/src/start/server/metro/externals.js +51 -64
- package/build/src/start/server/metro/externals.js.map +1 -1
- package/build/src/start/server/metro/fetchRouterManifest.js +8 -2
- package/build/src/start/server/metro/fetchRouterManifest.js.map +1 -1
- package/build/src/start/server/metro/formatFileCandidates.js +8 -2
- package/build/src/start/server/metro/formatFileCandidates.js.map +1 -1
- package/build/src/start/server/metro/getCssModulesFromBundler.js +34 -10
- package/build/src/start/server/metro/getCssModulesFromBundler.js.map +1 -1
- package/build/src/start/server/metro/instantiateMetro.js +96 -30
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/start/server/metro/metroErrorInterface.js +40 -21
- package/build/src/start/server/metro/metroErrorInterface.js.map +1 -1
- package/build/src/start/server/metro/metroVirtualModules.js +82 -0
- package/build/src/start/server/metro/metroVirtualModules.js.map +1 -0
- package/build/src/start/server/metro/metroWatchTypeScriptFiles.js +8 -2
- package/build/src/start/server/metro/metroWatchTypeScriptFiles.js.map +1 -1
- package/build/src/start/server/metro/router.js +44 -17
- package/build/src/start/server/metro/router.js.map +1 -1
- package/build/src/start/server/metro/runServer-fork.js +56 -14
- package/build/src/start/server/metro/runServer-fork.js.map +1 -1
- package/build/src/start/server/metro/serializeHtml.js +25 -12
- package/build/src/start/server/metro/serializeHtml.js.map +1 -1
- package/build/src/start/server/metro/waitForMetroToObserveTypeScriptFile.js +8 -2
- package/build/src/start/server/metro/waitForMetroToObserveTypeScriptFile.js.map +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js +148 -46
- package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
- package/build/src/start/server/metro/withMetroResolvers.js +31 -13
- package/build/src/start/server/metro/withMetroResolvers.js.map +1 -1
- package/build/src/start/server/middleware/CreateFileMiddleware.js +22 -10
- package/build/src/start/server/middleware/CreateFileMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/DevToolsPluginMiddleware.js +16 -4
- package/build/src/start/server/middleware/DevToolsPluginMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js +42 -12
- package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ExpoMiddleware.js +8 -2
- package/build/src/start/server/middleware/ExpoMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/InterstitialPageMiddleware.js +41 -11
- package/build/src/start/server/middleware/InterstitialPageMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ManifestMiddleware.js +40 -10
- package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ReactDevToolsPageMiddleware.js +24 -6
- package/build/src/start/server/middleware/ReactDevToolsPageMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js +8 -2
- package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ServeStaticMiddleware.js +24 -6
- package/build/src/start/server/middleware/ServeStaticMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/inspector/JsInspector.js +25 -8
- package/build/src/start/server/middleware/inspector/JsInspector.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowser.js +10 -4
- package/build/src/start/server/middleware/inspector/LaunchBrowser.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplLinux.js +24 -6
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplLinux.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplMacOS.js +33 -9
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplMacOS.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplWindows.js +27 -11
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplWindows.js.map +1 -1
- package/build/src/start/server/middleware/inspector/createJsInspectorMiddleware.js +33 -9
- package/build/src/start/server/middleware/inspector/createJsInspectorMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/metroOptions.js +12 -2
- package/build/src/start/server/middleware/metroOptions.js.map +1 -1
- package/build/src/start/server/middleware/resolveAssets.js +17 -5
- package/build/src/start/server/middleware/resolveAssets.js.map +1 -1
- package/build/src/start/server/middleware/resolvePlatform.js +8 -2
- package/build/src/start/server/middleware/resolvePlatform.js.map +1 -1
- package/build/src/start/server/platformBundlers.js +8 -2
- package/build/src/start/server/platformBundlers.js.map +1 -1
- package/build/src/start/server/serverLogLikeMetro.js +37 -13
- package/build/src/start/server/serverLogLikeMetro.js.map +1 -1
- package/build/src/start/server/type-generation/expo-env.js +16 -4
- package/build/src/start/server/type-generation/expo-env.js.map +1 -1
- package/build/src/start/server/type-generation/routes.js +91 -37
- package/build/src/start/server/type-generation/routes.js.map +1 -1
- package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js +27 -9
- package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js.map +1 -1
- package/build/src/start/server/type-generation/tsconfig.js +27 -9
- package/build/src/start/server/type-generation/tsconfig.js.map +1 -1
- package/build/src/start/server/webTemplate.js +26 -8
- package/build/src/start/server/webTemplate.js.map +1 -1
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js +36 -12
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js.map +1 -1
- package/build/src/start/server/webpack/compile.js +17 -5
- package/build/src/start/server/webpack/compile.js.map +1 -1
- package/build/src/start/server/webpack/resolveFromProject.js +8 -2
- package/build/src/start/server/webpack/resolveFromProject.js.map +1 -1
- package/build/src/start/server/webpack/tls.js +35 -11
- package/build/src/start/server/webpack/tls.js.map +1 -1
- package/build/src/start/startAsync.js +36 -11
- package/build/src/start/startAsync.js.map +1 -1
- package/build/src/utils/FileNotifier.js +32 -8
- package/build/src/utils/FileNotifier.js.map +1 -1
- package/build/src/utils/analytics/getDevClientProperties.js +26 -8
- package/build/src/utils/analytics/getDevClientProperties.js.map +1 -1
- package/build/src/utils/analytics/metroDebuggerMiddleware.js +2 -2
- package/build/src/utils/analytics/metroDebuggerMiddleware.js.map +1 -1
- package/build/src/utils/args.js +32 -8
- package/build/src/utils/args.js.map +1 -1
- package/build/src/utils/cocoapods.js +64 -28
- package/build/src/utils/cocoapods.js.map +1 -1
- package/build/src/utils/codesigning.js +79 -29
- package/build/src/utils/codesigning.js.map +1 -1
- package/build/src/utils/createFileTransform.js +24 -69
- package/build/src/utils/createFileTransform.js.map +1 -1
- package/build/src/utils/dir.js +33 -26
- package/build/src/utils/dir.js.map +1 -1
- package/build/src/utils/downloadAppAsync.js +40 -10
- package/build/src/utils/downloadAppAsync.js.map +1 -1
- package/build/src/utils/downloadExpoGoAsync.js +26 -11
- package/build/src/utils/downloadExpoGoAsync.js.map +1 -1
- package/build/src/utils/editor.js +18 -6
- package/build/src/utils/editor.js.map +1 -1
- package/build/src/utils/env.js +40 -31
- package/build/src/utils/env.js.map +1 -1
- package/build/src/utils/errors.js +20 -5
- package/build/src/utils/errors.js.map +1 -1
- package/build/src/utils/findUp.js +18 -6
- package/build/src/utils/findUp.js.map +1 -1
- package/build/src/utils/getOrPromptApplicationId.js +19 -7
- package/build/src/utils/getOrPromptApplicationId.js.map +1 -1
- package/build/src/utils/getRunningProcess.js +18 -6
- package/build/src/utils/getRunningProcess.js.map +1 -1
- package/build/src/utils/git.js +18 -6
- package/build/src/utils/git.js.map +1 -1
- package/build/src/utils/glob.js +9 -3
- package/build/src/utils/glob.js.map +1 -1
- package/build/src/utils/ip.js +8 -2
- package/build/src/utils/ip.js.map +1 -1
- package/build/src/utils/isModuleSymlinked.js +16 -4
- package/build/src/utils/isModuleSymlinked.js.map +1 -1
- package/build/src/utils/link.js +18 -6
- package/build/src/utils/link.js.map +1 -1
- package/build/src/utils/mergeGitIgnorePaths.js +25 -13
- package/build/src/utils/mergeGitIgnorePaths.js.map +1 -1
- package/build/src/utils/modifyConfigAsync.js +18 -6
- package/build/src/utils/modifyConfigAsync.js.map +1 -1
- package/build/src/utils/modifyConfigPlugins.js +8 -2
- package/build/src/utils/modifyConfigPlugins.js.map +1 -1
- package/build/src/utils/nodeEnv.js +2 -0
- package/build/src/utils/nodeEnv.js.map +1 -1
- package/build/src/utils/nodeModules.js +23 -5
- package/build/src/utils/nodeModules.js.map +1 -1
- package/build/src/utils/npm.js +64 -17
- package/build/src/utils/npm.js.map +1 -1
- package/build/src/utils/open.js +9 -3
- package/build/src/utils/open.js.map +1 -1
- package/build/src/utils/ora.js +16 -4
- package/build/src/utils/ora.js.map +1 -1
- package/build/src/utils/plist.js +24 -6
- package/build/src/utils/plist.js.map +1 -1
- package/build/src/utils/port.js +22 -10
- package/build/src/utils/port.js.map +1 -1
- package/build/src/utils/profile.js +8 -2
- package/build/src/utils/profile.js.map +1 -1
- package/build/src/utils/progress.js +8 -2
- package/build/src/utils/progress.js.map +1 -1
- package/build/src/utils/prompts.js +16 -4
- package/build/src/utils/prompts.js.map +1 -1
- package/build/src/utils/scheme.js +75 -23
- package/build/src/utils/scheme.js.map +1 -1
- package/build/src/utils/tar.js +16 -4
- package/build/src/utils/tar.js.map +1 -1
- package/build/src/utils/telemetry/DetachedClient.js +87 -0
- package/build/src/utils/telemetry/DetachedClient.js.map +1 -0
- package/build/src/utils/telemetry/RudderClient.js +98 -0
- package/build/src/utils/telemetry/RudderClient.js.map +1 -0
- package/build/src/utils/telemetry/flushDetached.js +43 -0
- package/build/src/utils/telemetry/flushDetached.js.map +1 -0
- package/build/src/utils/telemetry/getContext.js +92 -0
- package/build/src/utils/telemetry/getContext.js.map +1 -0
- package/build/src/utils/telemetry/index.js +32 -0
- package/build/src/utils/telemetry/index.js.map +1 -0
- package/build/src/utils/telemetry/types.js +6 -0
- package/build/src/utils/telemetry/types.js.map +1 -0
- package/build/src/utils/tsconfig/evaluateTsConfig.js +16 -4
- package/build/src/utils/tsconfig/evaluateTsConfig.js.map +1 -1
- package/build/src/utils/tsconfig/loadTsConfigPaths.js +18 -6
- package/build/src/utils/tsconfig/loadTsConfigPaths.js.map +1 -1
- package/build/src/utils/tsconfig/resolveWithTsConfigPaths.js +10 -4
- package/build/src/utils/tsconfig/resolveWithTsConfigPaths.js.map +1 -1
- package/build/src/utils/url.js +19 -10
- package/build/src/utils/url.js.map +1 -1
- package/build/src/utils/validateApplicationId.js +18 -6
- package/build/src/utils/validateApplicationId.js.map +1 -1
- package/build/src/whoami/whoamiAsync.js +8 -2
- package/build/src/whoami/whoamiAsync.js.map +1 -1
- package/package.json +15 -16
- package/static/canary/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js +27907 -0
- package/static/canary/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js +9494 -0
- package/static/canary/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.js +10015 -0
- package/static/canary/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +28375 -0
- package/static/canary/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +9714 -0
- package/build/src/run/android/resolveGradleProps.js +0 -37
- package/build/src/run/android/resolveGradleProps.js.map +0 -1
- package/build/src/start/server/metro/bundleApiRoutes.js +0 -52
- package/build/src/start/server/metro/bundleApiRoutes.js.map +0 -1
- package/build/src/start/server/metro/debugging/InspectorDevice.js +0 -80
- package/build/src/start/server/metro/debugging/InspectorDevice.js.map +0 -1
- package/build/src/start/server/metro/debugging/InspectorProxy.js +0 -116
- package/build/src/start/server/metro/debugging/InspectorProxy.js.map +0 -1
- package/build/src/start/server/metro/debugging/inspectorHandlers/NetworkResponse.js.map +0 -1
- package/build/src/start/server/metro/debugging/inspectorHandlers/PageReload.js.map +0 -1
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeDebuggerGetPossibleBreakpoints.js +0 -21
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeDebuggerGetPossibleBreakpoints.js.map +0 -1
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeDebuggerScriptParsed.js +0 -56
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeDebuggerScriptParsed.js.map +0 -1
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeDebuggerSetBreakpointByUrl.js +0 -18
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeDebuggerSetBreakpointByUrl.js.map +0 -1
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeRuntimeCallFunctionOn.js +0 -24
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeRuntimeCallFunctionOn.js.map +0 -1
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeRuntimeGetProperties.js.map +0 -1
- package/build/src/start/server/metro/debugging/inspectorHandlers/types.js.map +0 -1
- package/build/src/start/server/metro/debugging/inspectorHandlers/utils.js.map +0 -1
- package/build/src/start/server/type-generation/__typetests__/fixtures/basic.js +0 -38
- package/build/src/start/server/type-generation/__typetests__/fixtures/basic.js.map +0 -1
- package/build/src/start/server/type-generation/__typetests__/generateFixtures.js +0 -38
- package/build/src/start/server/type-generation/__typetests__/generateFixtures.js.map +0 -1
- package/build/src/start/server/type-generation/__typetests__/route.test.js +0 -184
- package/build/src/start/server/type-generation/__typetests__/route.test.js.map +0 -1
- package/build/src/utils/analytics/rudderstackClient.js +0 -147
- package/build/src/utils/analytics/rudderstackClient.js.map +0 -1
- /package/build/src/start/server/metro/debugging/{inspectorHandlers/types.js → types.js} +0 -0
|
@@ -7,13 +7,38 @@ exports.withExtendedResolver = withExtendedResolver;
|
|
|
7
7
|
exports.shouldAliasAssetRegistryForWeb = shouldAliasAssetRegistryForWeb;
|
|
8
8
|
exports.shouldAliasModule = shouldAliasModule;
|
|
9
9
|
exports.withMetroMultiPlatformAsync = withMetroMultiPlatformAsync;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
function _fs() {
|
|
11
|
+
const data = _interopRequireDefault(require("fs"));
|
|
12
|
+
_fs = function() {
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
function metroResolver() {
|
|
18
|
+
const data = _interopRequireWildcard(require("metro-resolver"));
|
|
19
|
+
metroResolver = function() {
|
|
20
|
+
return data;
|
|
21
|
+
};
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
24
|
+
function _path() {
|
|
25
|
+
const data = _interopRequireDefault(require("path"));
|
|
26
|
+
_path = function() {
|
|
27
|
+
return data;
|
|
28
|
+
};
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
function _resolveFrom() {
|
|
32
|
+
const data = _interopRequireDefault(require("resolve-from"));
|
|
33
|
+
_resolveFrom = function() {
|
|
34
|
+
return data;
|
|
35
|
+
};
|
|
36
|
+
return data;
|
|
37
|
+
}
|
|
14
38
|
var _createExpoMetroResolver = require("./createExpoMetroResolver");
|
|
15
39
|
var _externals = require("./externals");
|
|
16
40
|
var _metroErrors = require("./metroErrors");
|
|
41
|
+
var _metroVirtualModules = require("./metroVirtualModules");
|
|
17
42
|
var _withMetroResolvers = require("./withMetroResolvers");
|
|
18
43
|
var _log = require("../../../log");
|
|
19
44
|
var _fileNotifier = require("../../../utils/FileNotifier");
|
|
@@ -22,6 +47,7 @@ var _exit = require("../../../utils/exit");
|
|
|
22
47
|
var _interactive = require("../../../utils/interactive");
|
|
23
48
|
var _loadTsConfigPaths = require("../../../utils/tsconfig/loadTsConfigPaths");
|
|
24
49
|
var _resolveWithTsConfigPaths = require("../../../utils/tsconfig/resolveWithTsConfigPaths");
|
|
50
|
+
var _metroOptions = require("../middleware/metroOptions");
|
|
25
51
|
function _interopRequireDefault(obj) {
|
|
26
52
|
return obj && obj.__esModule ? obj : {
|
|
27
53
|
default: obj
|
|
@@ -49,21 +75,30 @@ function _interopRequireWildcard(obj) {
|
|
|
49
75
|
}
|
|
50
76
|
}
|
|
51
77
|
const debug = require("debug")("expo:start:server:metro:multi-platform");
|
|
52
|
-
function withWebPolyfills(config) {
|
|
78
|
+
function withWebPolyfills(config, { getMetroBundler }) {
|
|
53
79
|
const originalGetPolyfills = config.serializer.getPolyfills ? config.serializer.getPolyfills.bind(config.serializer) : ()=>[]
|
|
54
80
|
;
|
|
55
81
|
const getPolyfills = (ctx)=>{
|
|
82
|
+
const virtualModuleId = `\0polyfill:external-require`;
|
|
83
|
+
const contents = (()=>{
|
|
84
|
+
if (ctx.platform === "web") {
|
|
85
|
+
return `global.$$require_external = typeof window === "undefined" ? require : () => null;`;
|
|
86
|
+
} else {
|
|
87
|
+
// Wrap in try/catch to support Android.
|
|
88
|
+
return 'try { global.$$require_external = typeof expo === "undefined" ? eval("require") : (moduleId) => { throw new Error(`Node.js standard library module ${moduleId} is not available in this JavaScript environment`);} } catch { global.$$require_external = (moduleId) => { throw new Error(`Node.js standard library module ${moduleId} is not available in this JavaScript environment`);} }';
|
|
89
|
+
}
|
|
90
|
+
})();
|
|
91
|
+
(0, _metroVirtualModules).getMetroBundlerWithVirtualModules(getMetroBundler()).setVirtualModule(virtualModuleId, contents);
|
|
56
92
|
if (ctx.platform === "web") {
|
|
57
93
|
return [
|
|
58
|
-
|
|
59
|
-
_path.default.join(config.projectRoot, _externals.EXTERNAL_REQUIRE_POLYFILL)
|
|
94
|
+
virtualModuleId
|
|
60
95
|
];
|
|
61
96
|
}
|
|
62
97
|
// Generally uses `rn-get-polyfills`
|
|
63
98
|
const polyfills = originalGetPolyfills(ctx);
|
|
64
99
|
return [
|
|
65
100
|
...polyfills,
|
|
66
|
-
|
|
101
|
+
virtualModuleId
|
|
67
102
|
];
|
|
68
103
|
};
|
|
69
104
|
return {
|
|
@@ -90,16 +125,19 @@ function getNodejsExtensions(srcExts) {
|
|
|
90
125
|
nodejsSourceExtensions.splice(jsIndex + 1, 0, ...mjsExts);
|
|
91
126
|
return nodejsSourceExtensions;
|
|
92
127
|
}
|
|
93
|
-
function withExtendedResolver(config, { tsconfig , isTsconfigPathsEnabled , isFastResolverEnabled , isExporting }) {
|
|
128
|
+
function withExtendedResolver(config, { tsconfig , isTsconfigPathsEnabled , isFastResolverEnabled , isExporting , isReactCanaryEnabled , getMetroBundler }) {
|
|
94
129
|
var ref5, ref1, ref2, ref3;
|
|
95
130
|
if (isFastResolverEnabled) {
|
|
96
131
|
_log.Log.warn(`Experimental bundling features are enabled.`);
|
|
97
132
|
}
|
|
133
|
+
if (isReactCanaryEnabled) {
|
|
134
|
+
_log.Log.warn(`Experimental React Canary version is enabled.`);
|
|
135
|
+
}
|
|
98
136
|
// Get the `transformer.assetRegistryPath`
|
|
99
137
|
// this needs to be unified since you can't dynamically
|
|
100
138
|
// swap out the transformer based on platform.
|
|
101
|
-
const assetRegistryPath = _fs.default.realpathSync(_path.default.resolve((
|
|
102
|
-
const defaultResolver = metroResolver.resolve;
|
|
139
|
+
const assetRegistryPath = _fs().default.realpathSync(_path().default.resolve(_resolveFrom().default(config.projectRoot, "@react-native/assets-registry/registry.js")));
|
|
140
|
+
const defaultResolver = metroResolver().resolve;
|
|
103
141
|
var ref4;
|
|
104
142
|
const resolver = isFastResolverEnabled ? (0, _createExpoMetroResolver).createFastResolver({
|
|
105
143
|
preserveSymlinks: (ref4 = (ref5 = config.resolver) == null ? void 0 : ref5.unstable_enableSymlinks) != null ? ref4 : true,
|
|
@@ -115,7 +153,7 @@ function withExtendedResolver(config, { tsconfig , isTsconfigPathsEnabled , isFa
|
|
|
115
153
|
};
|
|
116
154
|
const universalAliases = [];
|
|
117
155
|
// This package is currently always installed as it is included in the `expo` package.
|
|
118
|
-
if (_resolveFrom.default.silent(config.projectRoot, "@expo/vector-icons")) {
|
|
156
|
+
if (_resolveFrom().default.silent(config.projectRoot, "@expo/vector-icons")) {
|
|
119
157
|
debug("Enabling alias: react-native-vector-icons -> @expo/vector-icons");
|
|
120
158
|
universalAliases.push([
|
|
121
159
|
/^react-native-vector-icons(\/.*)?/,
|
|
@@ -174,7 +212,6 @@ function withExtendedResolver(config, { tsconfig , isTsconfigPathsEnabled , isFa
|
|
|
174
212
|
}
|
|
175
213
|
}
|
|
176
214
|
let nodejsSourceExtensions = null;
|
|
177
|
-
const shimsFolder = _path.default.join(config.projectRoot, _externals.METRO_SHIMS_FOLDER);
|
|
178
215
|
function getStrictResolver({ resolveRequest , ...context }, platform) {
|
|
179
216
|
return function doResolve(moduleName) {
|
|
180
217
|
return resolver(context, moduleName, platform);
|
|
@@ -197,6 +234,28 @@ function withExtendedResolver(config, { tsconfig , isTsconfigPathsEnabled , isFa
|
|
|
197
234
|
};
|
|
198
235
|
}
|
|
199
236
|
const metroConfigWithCustomResolver = (0, _withMetroResolvers).withMetroResolvers(config, [
|
|
237
|
+
// Mock out production react imports in development.
|
|
238
|
+
(context, moduleName, platform)=>{
|
|
239
|
+
// This resolution is dev-only to prevent bundling the production React packages in development.
|
|
240
|
+
// @ts-expect-error: dev is not on type.
|
|
241
|
+
if (!context.dev) return null;
|
|
242
|
+
if (// Match react-native renderers.
|
|
243
|
+
(platform !== "web" && context.originModulePath.match(/[\\/]node_modules[\\/]react-native[\\/]/) && moduleName.match(/([\\/]ReactFabric|ReactNativeRenderer)-prod/)) || // Match react production imports.
|
|
244
|
+
(moduleName.match(/\.production(\.min)?\.js$/) && // Match if the import originated from a react package.
|
|
245
|
+
context.originModulePath.match(/[\\/]node_modules[\\/](react[-\\/]|scheduler[\\/])/))) {
|
|
246
|
+
debug(`Skipping production module: ${moduleName}`);
|
|
247
|
+
// /Users/path/to/expo/node_modules/react/index.js ./cjs/react.production.min.js
|
|
248
|
+
// /Users/path/to/expo/node_modules/react/jsx-dev-runtime.js ./cjs/react-jsx-dev-runtime.production.min.js
|
|
249
|
+
// /Users/path/to/expo/node_modules/react-is/index.js ./cjs/react-is.production.min.js
|
|
250
|
+
// /Users/path/to/expo/node_modules/react-refresh/runtime.js ./cjs/react-refresh-runtime.production.min.js
|
|
251
|
+
// /Users/path/to/expo/node_modules/react-native/node_modules/scheduler/index.native.js ./cjs/scheduler.native.production.min.js
|
|
252
|
+
// /Users/path/to/expo/node_modules/react-native/node_modules/react-is/index.js ./cjs/react-is.production.min.js
|
|
253
|
+
return {
|
|
254
|
+
type: "empty"
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
return null;
|
|
258
|
+
},
|
|
200
259
|
// tsconfig paths
|
|
201
260
|
(context, moduleName, platform)=>{
|
|
202
261
|
var ref;
|
|
@@ -207,18 +266,19 @@ function withExtendedResolver(config, { tsconfig , isTsconfigPathsEnabled , isFa
|
|
|
207
266
|
},
|
|
208
267
|
// Node.js externals support
|
|
209
268
|
(context, moduleName, platform)=>{
|
|
210
|
-
var
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
if (platform !== "web") {
|
|
269
|
+
var ref, ref6;
|
|
270
|
+
const isServer = ((ref = context.customResolverOptions) == null ? void 0 : ref.environment) === "node" || ((ref6 = context.customResolverOptions) == null ? void 0 : ref6.environment) === "react-server";
|
|
271
|
+
if (platform !== "web" && !isServer) {
|
|
272
|
+
// This is a web/server-only feature, we may extend the shimming to native platforms in the future.
|
|
215
273
|
return null;
|
|
216
274
|
}
|
|
217
275
|
const moduleId = (0, _externals).isNodeExternal(moduleName);
|
|
218
276
|
if (!moduleId) {
|
|
219
277
|
return null;
|
|
220
278
|
}
|
|
221
|
-
if (
|
|
279
|
+
if (// In browser runtimes, we want to either resolve a local node module by the same name, or shim the module to
|
|
280
|
+
// prevent crashing when Node.js built-ins are imported.
|
|
281
|
+
!isServer) {
|
|
222
282
|
// Perform optional resolve first. If the module doesn't exist (no module in the node_modules)
|
|
223
283
|
// then we can mock the file to use an empty module.
|
|
224
284
|
const result = getOptionalResolver(context, platform)(moduleName);
|
|
@@ -227,9 +287,14 @@ function withExtendedResolver(config, { tsconfig , isTsconfigPathsEnabled , isFa
|
|
|
227
287
|
type: "empty"
|
|
228
288
|
};
|
|
229
289
|
}
|
|
230
|
-
const
|
|
231
|
-
debug(`
|
|
232
|
-
|
|
290
|
+
const contents = `module.exports=$$require_external('node:${moduleId}');`;
|
|
291
|
+
debug(`Virtualizing Node.js "${moduleId}"`);
|
|
292
|
+
const virtualModuleId = `\0node:${moduleId}`;
|
|
293
|
+
(0, _metroVirtualModules).getMetroBundlerWithVirtualModules(getMetroBundler()).setVirtualModule(virtualModuleId, contents);
|
|
294
|
+
return {
|
|
295
|
+
type: "sourceFile",
|
|
296
|
+
filePath: virtualModuleId
|
|
297
|
+
};
|
|
233
298
|
},
|
|
234
299
|
// Basic moduleId aliases
|
|
235
300
|
(context, moduleName, platform)=>{
|
|
@@ -272,21 +337,46 @@ function withExtendedResolver(config, { tsconfig , isTsconfigPathsEnabled , isFa
|
|
|
272
337
|
if (result.type !== "sourceFile") {
|
|
273
338
|
return result;
|
|
274
339
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
result.filePath = assetRegistryPath;
|
|
281
|
-
}
|
|
282
|
-
if (platform === "web" && result.filePath.includes("node_modules")) {
|
|
283
|
-
// Replace with static shims
|
|
284
|
-
const normalName = normalizeSlashes(result.filePath)// Drop everything up until the `node_modules` folder.
|
|
285
|
-
.replace(/.*node_modules\//, "");
|
|
286
|
-
const shimPath = _path.default.join(shimsFolder, normalName);
|
|
287
|
-
if (_fs.default.existsSync(shimPath)) {
|
|
340
|
+
if (platform === "web") {
|
|
341
|
+
// Replace the web resolver with the original one.
|
|
342
|
+
// This is basically an alias for web-only.
|
|
343
|
+
// TODO: Drop this in favor of the standalone asset registry module.
|
|
344
|
+
if (shouldAliasAssetRegistryForWeb(platform, result)) {
|
|
288
345
|
// @ts-expect-error: `readonly` for some reason.
|
|
289
|
-
result.filePath =
|
|
346
|
+
result.filePath = assetRegistryPath;
|
|
347
|
+
}
|
|
348
|
+
if (platform === "web" && result.filePath.includes("node_modules")) {
|
|
349
|
+
// Replace with static shims
|
|
350
|
+
const normalName = normalizeSlashes(result.filePath)// Drop everything up until the `node_modules` folder.
|
|
351
|
+
.replace(/.*node_modules\//, "");
|
|
352
|
+
const shimFile = (0, _externals).shouldCreateVirtualShim(normalName);
|
|
353
|
+
if (shimFile) {
|
|
354
|
+
const virtualId = `\0shim:${normalName}`;
|
|
355
|
+
const bundler = (0, _metroVirtualModules).getMetroBundlerWithVirtualModules(getMetroBundler());
|
|
356
|
+
if (!bundler.hasVirtualModule(virtualId)) {
|
|
357
|
+
bundler.setVirtualModule(virtualId, _fs().default.readFileSync(shimFile, "utf8"));
|
|
358
|
+
}
|
|
359
|
+
debug(`Redirecting module "${result.filePath}" to shim`);
|
|
360
|
+
return {
|
|
361
|
+
...result,
|
|
362
|
+
filePath: virtualId
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
} else {
|
|
367
|
+
// When server components are enabled, redirect React Native's renderer to the canary build
|
|
368
|
+
// this will enable the use hook and other requisite features from React 19.
|
|
369
|
+
if (isReactCanaryEnabled && result.filePath.includes("node_modules")) {
|
|
370
|
+
const normalName = normalizeSlashes(result.filePath)// Drop everything up until the `node_modules` folder.
|
|
371
|
+
.replace(/.*node_modules\//, "");
|
|
372
|
+
const canaryFile = (0, _externals).shouldCreateVirtualCanary(normalName);
|
|
373
|
+
if (canaryFile) {
|
|
374
|
+
debug(`Redirecting React Native module "${result.filePath}" to canary build`);
|
|
375
|
+
return {
|
|
376
|
+
...result,
|
|
377
|
+
filePath: canaryFile
|
|
378
|
+
};
|
|
379
|
+
}
|
|
290
380
|
}
|
|
291
381
|
}
|
|
292
382
|
return result;
|
|
@@ -299,7 +389,8 @@ function withExtendedResolver(config, { tsconfig , isTsconfigPathsEnabled , isFa
|
|
|
299
389
|
...immutableContext,
|
|
300
390
|
preferNativePlatform: platform !== "web"
|
|
301
391
|
};
|
|
302
|
-
if (((ref = context.customResolverOptions) == null ? void 0 : ref.environment)
|
|
392
|
+
if ((0, _metroOptions).isServerEnvironment((ref = context.customResolverOptions) == null ? void 0 : ref.environment)) {
|
|
393
|
+
var ref7;
|
|
303
394
|
// Adjust nodejs source extensions to sort mjs after js, including platform variants.
|
|
304
395
|
if (nodejsSourceExtensions === null) {
|
|
305
396
|
nodejsSourceExtensions = getNodejsExtensions(context.sourceExts);
|
|
@@ -317,6 +408,15 @@ function withExtendedResolver(config, { tsconfig , isTsconfigPathsEnabled , isFa
|
|
|
317
408
|
"main",
|
|
318
409
|
"module"
|
|
319
410
|
];
|
|
411
|
+
// Enable react-server import conditions.
|
|
412
|
+
if (((ref7 = context.customResolverOptions) == null ? void 0 : ref7.environment) === "react-server") {
|
|
413
|
+
context.unstable_conditionNames = [
|
|
414
|
+
"node",
|
|
415
|
+
"require",
|
|
416
|
+
"react-server",
|
|
417
|
+
"server"
|
|
418
|
+
];
|
|
419
|
+
}
|
|
320
420
|
} else {
|
|
321
421
|
// Non-server changes
|
|
322
422
|
if (!_env.env.EXPO_METRO_NO_MAIN_FIELD_OVERRIDE && platform && platform in preferredMainFields) {
|
|
@@ -331,10 +431,10 @@ function shouldAliasAssetRegistryForWeb(platform, result) {
|
|
|
331
431
|
return platform === "web" && (result == null ? void 0 : result.type) === "sourceFile" && typeof (result == null ? void 0 : result.filePath) === "string" && normalizeSlashes(result.filePath).endsWith("react-native-web/dist/modules/AssetRegistry/index.js");
|
|
332
432
|
}
|
|
333
433
|
function shouldAliasModule(input, alias) {
|
|
334
|
-
var ref,
|
|
335
|
-
return input.platform === alias.platform && ((ref = input.result) == null ? void 0 : ref.type) === "sourceFile" && typeof ((
|
|
434
|
+
var ref, ref8;
|
|
435
|
+
return input.platform === alias.platform && ((ref = input.result) == null ? void 0 : ref.type) === "sourceFile" && typeof ((ref8 = input.result) == null ? void 0 : ref8.filePath) === "string" && normalizeSlashes(input.result.filePath).endsWith(alias.output);
|
|
336
436
|
}
|
|
337
|
-
async function withMetroMultiPlatformAsync(projectRoot, { config , exp , platformBundlers , isTsconfigPathsEnabled , webOutput , isFastResolverEnabled , isExporting }) {
|
|
437
|
+
async function withMetroMultiPlatformAsync(projectRoot, { config , exp , platformBundlers , isTsconfigPathsEnabled , webOutput , isFastResolverEnabled , isExporting , isReactCanaryEnabled , getMetroBundler }) {
|
|
338
438
|
if (!config.projectRoot) {
|
|
339
439
|
// @ts-expect-error: read-only types
|
|
340
440
|
config.projectRoot = projectRoot;
|
|
@@ -356,18 +456,16 @@ async function withMetroMultiPlatformAsync(projectRoot, { config , exp , platfor
|
|
|
356
456
|
config.watchFolders = [];
|
|
357
457
|
}
|
|
358
458
|
// @ts-expect-error: watchFolders is readonly
|
|
359
|
-
config.watchFolders.push(_path.default.join(require.resolve("metro-runtime/package.json"), "../.."));
|
|
459
|
+
config.watchFolders.push(_path().default.join(require.resolve("metro-runtime/package.json"), "../.."));
|
|
360
460
|
}
|
|
361
461
|
// @ts-expect-error
|
|
362
462
|
config.transformer._expoRouterWebRendering = webOutput;
|
|
363
463
|
// @ts-expect-error: Invalidate the cache when the location of expo-router changes on-disk.
|
|
364
|
-
config.transformer._expoRouterPath = _resolveFrom.default.silent(projectRoot, "expo-router");
|
|
464
|
+
config.transformer._expoRouterPath = _resolveFrom().default.silent(projectRoot, "expo-router");
|
|
365
465
|
let tsconfig = null;
|
|
366
466
|
if (isTsconfigPathsEnabled) {
|
|
367
467
|
tsconfig = await (0, _loadTsConfigPaths).loadTsConfigPathsAsync(projectRoot);
|
|
368
468
|
}
|
|
369
|
-
await (0, _externals).setupShimFiles(projectRoot);
|
|
370
|
-
await (0, _externals).setupNodeExternals(projectRoot);
|
|
371
469
|
let expoConfigPlatforms = Object.entries(platformBundlers).filter(([platform, bundler])=>{
|
|
372
470
|
var ref;
|
|
373
471
|
return bundler === "metro" && ((ref = exp.platforms) == null ? void 0 : ref.includes(platform));
|
|
@@ -380,12 +478,16 @@ async function withMetroMultiPlatformAsync(projectRoot, { config , exp , platfor
|
|
|
380
478
|
}
|
|
381
479
|
// @ts-expect-error: typed as `readonly`.
|
|
382
480
|
config.resolver.platforms = expoConfigPlatforms;
|
|
383
|
-
config = withWebPolyfills(config
|
|
481
|
+
config = withWebPolyfills(config, {
|
|
482
|
+
getMetroBundler
|
|
483
|
+
});
|
|
384
484
|
return withExtendedResolver(config, {
|
|
385
485
|
tsconfig,
|
|
386
486
|
isExporting,
|
|
387
487
|
isTsconfigPathsEnabled,
|
|
388
|
-
isFastResolverEnabled
|
|
488
|
+
isFastResolverEnabled,
|
|
489
|
+
isReactCanaryEnabled,
|
|
490
|
+
getMetroBundler
|
|
389
491
|
});
|
|
390
492
|
}
|
|
391
493
|
function isDirectoryIn(a, b) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/metro/withMetroMultiPlatform.ts"],"sourcesContent":["/**\n * Copyright © 2022 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { ExpoConfig, Platform } from '@expo/config';\nimport fs from 'fs';\nimport { ConfigT } from 'metro-config';\nimport { Resolution, ResolutionContext, CustomResolutionContext } from 'metro-resolver';\nimport * as metroResolver from 'metro-resolver';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { createFastResolver } from './createExpoMetroResolver';\nimport {\n EXTERNAL_REQUIRE_NATIVE_POLYFILL,\n EXTERNAL_REQUIRE_POLYFILL,\n METRO_SHIMS_FOLDER,\n getNodeExternalModuleId,\n isNodeExternal,\n setupNodeExternals,\n setupShimFiles,\n} from './externals';\nimport { isFailedToResolveNameError, isFailedToResolvePathError } from './metroErrors';\nimport {\n withMetroErrorReportingResolver,\n withMetroMutatedResolverContext,\n withMetroResolvers,\n} from './withMetroResolvers';\nimport { Log } from '../../../log';\nimport { FileNotifier } from '../../../utils/FileNotifier';\nimport { env } from '../../../utils/env';\nimport { installExitHooks } from '../../../utils/exit';\nimport { isInteractive } from '../../../utils/interactive';\nimport { loadTsConfigPathsAsync, TsConfigPaths } from '../../../utils/tsconfig/loadTsConfigPaths';\nimport { resolveWithTsConfigPaths } from '../../../utils/tsconfig/resolveWithTsConfigPaths';\nimport { PlatformBundlers } from '../platformBundlers';\n\ntype Mutable<T> = { -readonly [K in keyof T]: T[K] };\n\nconst debug = require('debug')('expo:start:server:metro:multi-platform') as typeof console.log;\n\nfunction withWebPolyfills(config: ConfigT): ConfigT {\n const originalGetPolyfills = config.serializer.getPolyfills\n ? config.serializer.getPolyfills.bind(config.serializer)\n : () => [];\n\n const getPolyfills = (ctx: { platform: string | null }): readonly string[] => {\n if (ctx.platform === 'web') {\n return [\n // NOTE: We might need this for all platforms\n path.join(config.projectRoot, EXTERNAL_REQUIRE_POLYFILL),\n // TODO: runtime polyfills, i.e. Fast Refresh, error overlay, React Dev Tools...\n ];\n }\n // Generally uses `rn-get-polyfills`\n const polyfills = originalGetPolyfills(ctx);\n\n return [...polyfills, path.join(config.projectRoot, EXTERNAL_REQUIRE_NATIVE_POLYFILL)];\n };\n\n return {\n ...config,\n serializer: {\n ...config.serializer,\n getPolyfills,\n },\n };\n}\n\nfunction normalizeSlashes(p: string) {\n return p.replace(/\\\\/g, '/');\n}\n\nexport function getNodejsExtensions(srcExts: readonly string[]): string[] {\n const mjsExts = srcExts.filter((ext) => /mjs$/.test(ext));\n const nodejsSourceExtensions = srcExts.filter((ext) => !/mjs$/.test(ext));\n // find index of last `*.js` extension\n const jsIndex = nodejsSourceExtensions.reduce((index, ext, i) => {\n return /jsx?$/.test(ext) ? i : index;\n }, -1);\n\n // insert `*.mjs` extensions after `*.js` extensions\n nodejsSourceExtensions.splice(jsIndex + 1, 0, ...mjsExts);\n\n return nodejsSourceExtensions;\n}\n\n/**\n * Apply custom resolvers to do the following:\n * - Disable `.native.js` extensions on web.\n * - Alias `react-native` to `react-native-web` on web.\n * - Redirect `react-native-web/dist/modules/AssetRegistry/index.js` to `@react-native/assets/registry.js` on web.\n * - Add support for `tsconfig.json`/`jsconfig.json` aliases via `compilerOptions.paths`.\n */\nexport function withExtendedResolver(\n config: ConfigT,\n {\n tsconfig,\n isTsconfigPathsEnabled,\n isFastResolverEnabled,\n isExporting,\n }: {\n tsconfig: TsConfigPaths | null;\n isTsconfigPathsEnabled?: boolean;\n isFastResolverEnabled?: boolean;\n isExporting?: boolean;\n }\n) {\n if (isFastResolverEnabled) {\n Log.warn(`Experimental bundling features are enabled.`);\n }\n\n // Get the `transformer.assetRegistryPath`\n // this needs to be unified since you can't dynamically\n // swap out the transformer based on platform.\n const assetRegistryPath = fs.realpathSync(\n path.resolve(resolveFrom(config.projectRoot, '@react-native/assets-registry/registry.js'))\n );\n\n const defaultResolver = metroResolver.resolve;\n const resolver = isFastResolverEnabled\n ? createFastResolver({\n preserveSymlinks: config.resolver?.unstable_enableSymlinks ?? true,\n blockList: Array.isArray(config.resolver?.blockList)\n ? config.resolver?.blockList\n : [config.resolver?.blockList],\n })\n : defaultResolver;\n\n const aliases: { [key: string]: Record<string, string> } = {\n web: {\n 'react-native': 'react-native-web',\n 'react-native/index': 'react-native-web',\n },\n };\n\n const universalAliases: [RegExp, string][] = [];\n\n // This package is currently always installed as it is included in the `expo` package.\n if (resolveFrom.silent(config.projectRoot, '@expo/vector-icons')) {\n debug('Enabling alias: react-native-vector-icons -> @expo/vector-icons');\n universalAliases.push([/^react-native-vector-icons(\\/.*)?/, '@expo/vector-icons$1']);\n }\n\n const preferredMainFields: { [key: string]: string[] } = {\n // Defaults from Expo Webpack. Most packages using `react-native` don't support web\n // in the `react-native` field, so we should prefer the `browser` field.\n // https://github.com/expo/router/issues/37\n web: ['browser', 'module', 'main'],\n };\n\n let tsConfigResolve =\n isTsconfigPathsEnabled && (tsconfig?.paths || tsconfig?.baseUrl != null)\n ? resolveWithTsConfigPaths.bind(resolveWithTsConfigPaths, {\n paths: tsconfig.paths ?? {},\n baseUrl: tsconfig.baseUrl ?? config.projectRoot,\n hasBaseUrl: !!tsconfig.baseUrl,\n })\n : null;\n\n // TODO: Move this to be a transform key for invalidation.\n if (!isExporting && isInteractive()) {\n if (isTsconfigPathsEnabled) {\n // TODO: We should track all the files that used imports and invalidate them\n // currently the user will need to save all the files that use imports to\n // use the new aliases.\n const configWatcher = new FileNotifier(config.projectRoot, [\n './tsconfig.json',\n './jsconfig.json',\n ]);\n configWatcher.startObserving(() => {\n debug('Reloading tsconfig.json');\n loadTsConfigPathsAsync(config.projectRoot).then((tsConfigPaths) => {\n if (tsConfigPaths?.paths && !!Object.keys(tsConfigPaths.paths).length) {\n debug('Enabling tsconfig.json paths support');\n tsConfigResolve = resolveWithTsConfigPaths.bind(resolveWithTsConfigPaths, {\n paths: tsConfigPaths.paths ?? {},\n baseUrl: tsConfigPaths.baseUrl ?? config.projectRoot,\n hasBaseUrl: !!tsConfigPaths.baseUrl,\n });\n } else {\n debug('Disabling tsconfig.json paths support');\n tsConfigResolve = null;\n }\n });\n });\n\n // TODO: This probably prevents the process from exiting.\n installExitHooks(() => {\n configWatcher.stopObserving();\n });\n } else {\n debug('Skipping tsconfig.json paths support');\n }\n }\n\n let nodejsSourceExtensions: string[] | null = null;\n\n const shimsFolder = path.join(config.projectRoot, METRO_SHIMS_FOLDER);\n\n function getStrictResolver(\n { resolveRequest, ...context }: ResolutionContext,\n platform: string | null\n ) {\n return function doResolve(moduleName: string): Resolution {\n return resolver(context, moduleName, platform);\n };\n }\n\n function getOptionalResolver(context: ResolutionContext, platform: string | null) {\n const doResolve = getStrictResolver(context, platform);\n return function optionalResolve(moduleName: string): Resolution | null {\n try {\n return doResolve(moduleName);\n } catch (error) {\n // If the error is directly related to a resolver not being able to resolve a module, then\n // we can ignore the error and try the next resolver. Otherwise, we should throw the error.\n const isResolutionError =\n isFailedToResolveNameError(error) || isFailedToResolvePathError(error);\n if (!isResolutionError) {\n throw error;\n }\n }\n return null;\n };\n }\n\n const metroConfigWithCustomResolver = withMetroResolvers(config, [\n // tsconfig paths\n (context: ResolutionContext, moduleName: string, platform: string | null) => {\n return (\n tsConfigResolve?.(\n {\n originModulePath: context.originModulePath,\n moduleName,\n },\n getOptionalResolver(context, platform)\n ) ?? null\n );\n },\n\n // Node.js externals support\n (context: ResolutionContext, moduleName: string, platform: string | null) => {\n // This is a web-only feature, we may extend the shimming to native platforms in the future.\n if (platform !== 'web') {\n return null;\n }\n\n const moduleId = isNodeExternal(moduleName);\n if (!moduleId) {\n return null;\n }\n\n if (\n // In browser runtimes, we want to either resolve a local node module by the same name, or shim the module to\n // prevent crashing when Node.js built-ins are imported.\n context.customResolverOptions?.environment !== 'node'\n ) {\n // Perform optional resolve first. If the module doesn't exist (no module in the node_modules)\n // then we can mock the file to use an empty module.\n const result = getOptionalResolver(context, platform)(moduleName);\n return (\n result ?? {\n // In this case, mock the file to use an empty module.\n type: 'empty',\n }\n );\n }\n\n const redirectedModuleName = getNodeExternalModuleId(context.originModulePath, moduleId);\n debug(`Redirecting Node.js external \"${moduleId}\" to \"${redirectedModuleName}\"`);\n return getStrictResolver(context, platform)(redirectedModuleName);\n },\n\n // Basic moduleId aliases\n (context: ResolutionContext, moduleName: string, platform: string | null) => {\n // Conditionally remap `react-native` to `react-native-web` on web in\n // a way that doesn't require Babel to resolve the alias.\n if (platform && platform in aliases && aliases[platform][moduleName]) {\n const redirectedModuleName = aliases[platform][moduleName];\n return getStrictResolver(context, platform)(redirectedModuleName);\n }\n\n for (const [matcher, alias] of universalAliases) {\n const match = moduleName.match(matcher);\n if (match) {\n const aliasedModule = alias.replace(\n /\\$(\\d+)/g,\n (_, index) => match[parseInt(index, 10)] ?? ''\n );\n const doResolve = getStrictResolver(context, platform);\n debug(`Alias \"${moduleName}\" to \"${aliasedModule}\"`);\n return doResolve(aliasedModule);\n }\n }\n\n return null;\n },\n\n // HACK(EvanBacon):\n // React Native uses `event-target-shim` incorrectly and this causes the native runtime\n // to fail to load. This is a temporary workaround until we can fix this upstream.\n // https://github.com/facebook/react-native/pull/38628\n (context: ResolutionContext, moduleName: string, platform: string | null) => {\n if (platform !== 'web' && moduleName === 'event-target-shim') {\n debug('For event-target-shim to use js:', context.originModulePath);\n const doResolve = getStrictResolver(context, platform);\n return doResolve('event-target-shim/dist/event-target-shim.js');\n }\n\n return null;\n },\n\n // TODO: Reduce these as much as possible in the future.\n // Complex post-resolution rewrites.\n (context: ResolutionContext, moduleName: string, platform: string | null) => {\n const doResolve = getStrictResolver(context, platform);\n\n const result = doResolve(moduleName);\n\n if (result.type !== 'sourceFile') {\n return result;\n }\n\n // Replace the web resolver with the original one.\n // This is basically an alias for web-only.\n // TODO: Drop this in favor of the standalone asset registry module.\n if (shouldAliasAssetRegistryForWeb(platform, result)) {\n // @ts-expect-error: `readonly` for some reason.\n result.filePath = assetRegistryPath;\n }\n\n if (platform === 'web' && result.filePath.includes('node_modules')) {\n // Replace with static shims\n\n const normalName = normalizeSlashes(result.filePath)\n // Drop everything up until the `node_modules` folder.\n .replace(/.*node_modules\\//, '');\n\n const shimPath = path.join(shimsFolder, normalName);\n if (fs.existsSync(shimPath)) {\n // @ts-expect-error: `readonly` for some reason.\n result.filePath = shimPath;\n }\n }\n\n return result;\n },\n ]);\n\n // Ensure we mutate the resolution context to include the custom resolver options for server and web.\n const metroConfigWithCustomContext = withMetroMutatedResolverContext(\n metroConfigWithCustomResolver,\n (\n immutableContext: CustomResolutionContext,\n moduleName: string,\n platform: string | null\n ): CustomResolutionContext => {\n const context: Mutable<CustomResolutionContext> = {\n ...immutableContext,\n preferNativePlatform: platform !== 'web',\n };\n\n if (context.customResolverOptions?.environment === 'node') {\n // Adjust nodejs source extensions to sort mjs after js, including platform variants.\n if (nodejsSourceExtensions === null) {\n nodejsSourceExtensions = getNodejsExtensions(context.sourceExts);\n }\n context.sourceExts = nodejsSourceExtensions;\n\n context.unstable_enablePackageExports = true;\n context.unstable_conditionNames = ['node', 'require'];\n context.unstable_conditionsByPlatform = {};\n // Node.js runtimes should only be importing main at the moment.\n // This is a temporary fix until we can support the package.json exports.\n context.mainFields = ['main', 'module'];\n } else {\n // Non-server changes\n\n if (!env.EXPO_METRO_NO_MAIN_FIELD_OVERRIDE && platform && platform in preferredMainFields) {\n context.mainFields = preferredMainFields[platform];\n }\n }\n\n return context;\n }\n );\n\n return withMetroErrorReportingResolver(metroConfigWithCustomContext);\n}\n\n/** @returns `true` if the incoming resolution should be swapped on web. */\nexport function shouldAliasAssetRegistryForWeb(\n platform: string | null,\n result: Resolution\n): boolean {\n return (\n platform === 'web' &&\n result?.type === 'sourceFile' &&\n typeof result?.filePath === 'string' &&\n normalizeSlashes(result.filePath).endsWith(\n 'react-native-web/dist/modules/AssetRegistry/index.js'\n )\n );\n}\n/** @returns `true` if the incoming resolution should be swapped. */\nexport function shouldAliasModule(\n input: {\n platform: string | null;\n result: Resolution;\n },\n alias: { platform: string; output: string }\n): boolean {\n return (\n input.platform === alias.platform &&\n input.result?.type === 'sourceFile' &&\n typeof input.result?.filePath === 'string' &&\n normalizeSlashes(input.result.filePath).endsWith(alias.output)\n );\n}\n\n/** Add support for `react-native-web` and the Web platform. */\nexport async function withMetroMultiPlatformAsync(\n projectRoot: string,\n {\n config,\n exp,\n platformBundlers,\n isTsconfigPathsEnabled,\n webOutput,\n isFastResolverEnabled,\n isExporting,\n }: {\n config: ConfigT;\n exp: ExpoConfig;\n isTsconfigPathsEnabled: boolean;\n platformBundlers: PlatformBundlers;\n webOutput?: 'single' | 'static' | 'server';\n isFastResolverEnabled?: boolean;\n isExporting?: boolean;\n }\n) {\n if (!config.projectRoot) {\n // @ts-expect-error: read-only types\n config.projectRoot = projectRoot;\n }\n\n // Required for @expo/metro-runtime to format paths in the web LogBox.\n process.env.EXPO_PUBLIC_PROJECT_ROOT = process.env.EXPO_PUBLIC_PROJECT_ROOT ?? projectRoot;\n\n if (['static', 'server'].includes(webOutput ?? '')) {\n // Enable static rendering in runtime space.\n process.env.EXPO_PUBLIC_USE_STATIC = '1';\n }\n\n // This is used for running Expo CLI in development against projects outside the monorepo.\n if (!isDirectoryIn(__dirname, projectRoot)) {\n if (!config.watchFolders) {\n // @ts-expect-error: watchFolders is readonly\n config.watchFolders = [];\n }\n // @ts-expect-error: watchFolders is readonly\n config.watchFolders.push(path.join(require.resolve('metro-runtime/package.json'), '../..'));\n }\n\n // @ts-expect-error\n config.transformer._expoRouterWebRendering = webOutput;\n // @ts-expect-error: Invalidate the cache when the location of expo-router changes on-disk.\n config.transformer._expoRouterPath = resolveFrom.silent(projectRoot, 'expo-router');\n\n let tsconfig: null | TsConfigPaths = null;\n\n if (isTsconfigPathsEnabled) {\n tsconfig = await loadTsConfigPathsAsync(projectRoot);\n }\n\n await setupShimFiles(projectRoot);\n await setupNodeExternals(projectRoot);\n\n let expoConfigPlatforms = Object.entries(platformBundlers)\n .filter(\n ([platform, bundler]) => bundler === 'metro' && exp.platforms?.includes(platform as Platform)\n )\n .map(([platform]) => platform);\n\n if (Array.isArray(config.resolver.platforms)) {\n expoConfigPlatforms = [...new Set(expoConfigPlatforms.concat(config.resolver.platforms))];\n }\n\n // @ts-expect-error: typed as `readonly`.\n config.resolver.platforms = expoConfigPlatforms;\n\n config = withWebPolyfills(config);\n\n return withExtendedResolver(config, {\n tsconfig,\n isExporting,\n isTsconfigPathsEnabled,\n isFastResolverEnabled,\n });\n}\n\nfunction isDirectoryIn(a: string, b: string) {\n return b.startsWith(a) && b.length > a.length;\n}\n"],"names":["getNodejsExtensions","withExtendedResolver","shouldAliasAssetRegistryForWeb","shouldAliasModule","withMetroMultiPlatformAsync","metroResolver","debug","require","withWebPolyfills","config","originalGetPolyfills","serializer","getPolyfills","bind","ctx","platform","path","join","projectRoot","EXTERNAL_REQUIRE_POLYFILL","polyfills","EXTERNAL_REQUIRE_NATIVE_POLYFILL","normalizeSlashes","p","replace","srcExts","mjsExts","filter","ext","test","nodejsSourceExtensions","jsIndex","reduce","index","i","splice","tsconfig","isTsconfigPathsEnabled","isFastResolverEnabled","isExporting","Log","warn","assetRegistryPath","fs","realpathSync","resolve","resolveFrom","defaultResolver","resolver","createFastResolver","preserveSymlinks","unstable_enableSymlinks","blockList","Array","isArray","aliases","web","universalAliases","silent","push","preferredMainFields","tsConfigResolve","paths","baseUrl","resolveWithTsConfigPaths","hasBaseUrl","isInteractive","configWatcher","FileNotifier","startObserving","loadTsConfigPathsAsync","then","tsConfigPaths","Object","keys","length","installExitHooks","stopObserving","shimsFolder","METRO_SHIMS_FOLDER","getStrictResolver","resolveRequest","context","doResolve","moduleName","getOptionalResolver","optionalResolve","error","isResolutionError","isFailedToResolveNameError","isFailedToResolvePathError","metroConfigWithCustomResolver","withMetroResolvers","originModulePath","moduleId","isNodeExternal","customResolverOptions","environment","result","type","redirectedModuleName","getNodeExternalModuleId","matcher","alias","match","aliasedModule","_","parseInt","filePath","includes","normalName","shimPath","existsSync","metroConfigWithCustomContext","withMetroMutatedResolverContext","immutableContext","preferNativePlatform","sourceExts","unstable_enablePackageExports","unstable_conditionNames","unstable_conditionsByPlatform","mainFields","env","EXPO_METRO_NO_MAIN_FIELD_OVERRIDE","withMetroErrorReportingResolver","endsWith","input","output","exp","platformBundlers","webOutput","process","EXPO_PUBLIC_PROJECT_ROOT","EXPO_PUBLIC_USE_STATIC","isDirectoryIn","__dirname","watchFolders","transformer","_expoRouterWebRendering","_expoRouterPath","setupShimFiles","setupNodeExternals","expoConfigPlatforms","entries","bundler","platforms","map","Set","concat","a","b","startsWith"],"mappings":"AAMA;;;;QAqEgBA,mBAAmB,GAAnBA,mBAAmB;QAqBnBC,oBAAoB,GAApBA,oBAAoB;QA0SpBC,8BAA8B,GAA9BA,8BAA8B;QAc9BC,iBAAiB,GAAjBA,iBAAiB;QAgBXC,2BAA2B,GAA3BA,2BAA2B;AAjalC,IAAA,GAAI,kCAAJ,IAAI,EAAA;AAGPC,IAAAA,aAAa,mCAAM,gBAAgB,EAAtB;AACR,IAAA,KAAM,kCAAN,MAAM,EAAA;AACC,IAAA,YAAc,kCAAd,cAAc,EAAA;AAEH,IAAA,wBAA2B,WAA3B,2BAA2B,CAAA;AASvD,IAAA,UAAa,WAAb,aAAa,C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;KAAA,CAC9F,CACAmI,GAAG,CAAC,CAAC,CAACnI,QAAQ,CAAC,GAAKA,QAAQ;IAAA,CAAC,AAAC;IAEjC,IAAIsC,KAAK,CAACC,OAAO,CAAC7C,MAAM,CAACuC,QAAQ,CAACiG,SAAS,CAAC,EAAE;QAC5CH,mBAAmB,GAAG;eAAI,IAAIK,GAAG,CAACL,mBAAmB,CAACM,MAAM,CAAC3I,MAAM,CAACuC,QAAQ,CAACiG,SAAS,CAAC,CAAC;SAAC,CAAC;KAC3F;IAED,yCAAyC;IACzCxI,MAAM,CAACuC,QAAQ,CAACiG,SAAS,GAAGH,mBAAmB,CAAC;IAEhDrI,MAAM,GAAGD,gBAAgB,CAACC,MAAM,CAAC,CAAC;IAElC,OAAOR,oBAAoB,CAACQ,MAAM,EAAE;QAClC2B,QAAQ;QACRG,WAAW;QACXF,sBAAsB;QACtBC,qBAAqB;KACtB,CAAC,CAAC;CACJ;AAED,SAASgG,aAAa,CAACe,CAAS,EAAEC,CAAS,EAAE;IAC3C,OAAOA,CAAC,CAACC,UAAU,CAACF,CAAC,CAAC,IAAIC,CAAC,CAAC3E,MAAM,GAAG0E,CAAC,CAAC1E,MAAM,CAAC;CAC/C"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/metro/withMetroMultiPlatform.ts"],"sourcesContent":["/**\n * Copyright © 2022 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { ExpoConfig, Platform } from '@expo/config';\nimport fs from 'fs';\nimport Bundler from 'metro/src/Bundler';\nimport { ConfigT } from 'metro-config';\nimport { Resolution, ResolutionContext, CustomResolutionContext } from 'metro-resolver';\nimport * as metroResolver from 'metro-resolver';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { createFastResolver } from './createExpoMetroResolver';\nimport { isNodeExternal, shouldCreateVirtualCanary, shouldCreateVirtualShim } from './externals';\nimport { isFailedToResolveNameError, isFailedToResolvePathError } from './metroErrors';\nimport { getMetroBundlerWithVirtualModules } from './metroVirtualModules';\nimport {\n withMetroErrorReportingResolver,\n withMetroMutatedResolverContext,\n withMetroResolvers,\n} from './withMetroResolvers';\nimport { Log } from '../../../log';\nimport { FileNotifier } from '../../../utils/FileNotifier';\nimport { env } from '../../../utils/env';\nimport { installExitHooks } from '../../../utils/exit';\nimport { isInteractive } from '../../../utils/interactive';\nimport { loadTsConfigPathsAsync, TsConfigPaths } from '../../../utils/tsconfig/loadTsConfigPaths';\nimport { resolveWithTsConfigPaths } from '../../../utils/tsconfig/resolveWithTsConfigPaths';\nimport { isServerEnvironment } from '../middleware/metroOptions';\nimport { PlatformBundlers } from '../platformBundlers';\n\ntype Mutable<T> = { -readonly [K in keyof T]: T[K] };\n\nconst debug = require('debug')('expo:start:server:metro:multi-platform') as typeof console.log;\n\nfunction withWebPolyfills(\n config: ConfigT,\n {\n getMetroBundler,\n }: {\n getMetroBundler: () => Bundler;\n }\n): ConfigT {\n const originalGetPolyfills = config.serializer.getPolyfills\n ? config.serializer.getPolyfills.bind(config.serializer)\n : () => [];\n\n const getPolyfills = (ctx: { platform: string | null }): readonly string[] => {\n const virtualModuleId = `\\0polyfill:external-require`;\n\n const contents = (() => {\n if (ctx.platform === 'web') {\n return `global.$$require_external = typeof window === \"undefined\" ? require : () => null;`;\n } else {\n // Wrap in try/catch to support Android.\n return 'try { global.$$require_external = typeof expo === \"undefined\" ? eval(\"require\") : (moduleId) => { throw new Error(`Node.js standard library module ${moduleId} is not available in this JavaScript environment`);} } catch { global.$$require_external = (moduleId) => { throw new Error(`Node.js standard library module ${moduleId} is not available in this JavaScript environment`);} }';\n }\n })();\n getMetroBundlerWithVirtualModules(getMetroBundler()).setVirtualModule(\n virtualModuleId,\n contents\n );\n\n if (ctx.platform === 'web') {\n return [virtualModuleId];\n }\n\n // Generally uses `rn-get-polyfills`\n const polyfills = originalGetPolyfills(ctx);\n return [...polyfills, virtualModuleId];\n };\n\n return {\n ...config,\n serializer: {\n ...config.serializer,\n getPolyfills,\n },\n };\n}\n\nfunction normalizeSlashes(p: string) {\n return p.replace(/\\\\/g, '/');\n}\n\nexport function getNodejsExtensions(srcExts: readonly string[]): string[] {\n const mjsExts = srcExts.filter((ext) => /mjs$/.test(ext));\n const nodejsSourceExtensions = srcExts.filter((ext) => !/mjs$/.test(ext));\n // find index of last `*.js` extension\n const jsIndex = nodejsSourceExtensions.reduce((index, ext, i) => {\n return /jsx?$/.test(ext) ? i : index;\n }, -1);\n\n // insert `*.mjs` extensions after `*.js` extensions\n nodejsSourceExtensions.splice(jsIndex + 1, 0, ...mjsExts);\n\n return nodejsSourceExtensions;\n}\n\n/**\n * Apply custom resolvers to do the following:\n * - Disable `.native.js` extensions on web.\n * - Alias `react-native` to `react-native-web` on web.\n * - Redirect `react-native-web/dist/modules/AssetRegistry/index.js` to `@react-native/assets/registry.js` on web.\n * - Add support for `tsconfig.json`/`jsconfig.json` aliases via `compilerOptions.paths`.\n * - Alias react-native renderer code to a vendored React canary build on native.\n */\nexport function withExtendedResolver(\n config: ConfigT,\n {\n tsconfig,\n isTsconfigPathsEnabled,\n isFastResolverEnabled,\n isExporting,\n isReactCanaryEnabled,\n getMetroBundler,\n }: {\n tsconfig: TsConfigPaths | null;\n isTsconfigPathsEnabled?: boolean;\n isFastResolverEnabled?: boolean;\n isExporting?: boolean;\n isReactCanaryEnabled?: boolean;\n getMetroBundler: () => Bundler;\n }\n) {\n if (isFastResolverEnabled) {\n Log.warn(`Experimental bundling features are enabled.`);\n }\n if (isReactCanaryEnabled) {\n Log.warn(`Experimental React Canary version is enabled.`);\n }\n\n // Get the `transformer.assetRegistryPath`\n // this needs to be unified since you can't dynamically\n // swap out the transformer based on platform.\n const assetRegistryPath = fs.realpathSync(\n path.resolve(resolveFrom(config.projectRoot, '@react-native/assets-registry/registry.js'))\n );\n\n const defaultResolver = metroResolver.resolve;\n const resolver = isFastResolverEnabled\n ? createFastResolver({\n preserveSymlinks: config.resolver?.unstable_enableSymlinks ?? true,\n blockList: Array.isArray(config.resolver?.blockList)\n ? config.resolver?.blockList\n : [config.resolver?.blockList],\n })\n : defaultResolver;\n\n const aliases: { [key: string]: Record<string, string> } = {\n web: {\n 'react-native': 'react-native-web',\n 'react-native/index': 'react-native-web',\n },\n };\n\n const universalAliases: [RegExp, string][] = [];\n\n // This package is currently always installed as it is included in the `expo` package.\n if (resolveFrom.silent(config.projectRoot, '@expo/vector-icons')) {\n debug('Enabling alias: react-native-vector-icons -> @expo/vector-icons');\n universalAliases.push([/^react-native-vector-icons(\\/.*)?/, '@expo/vector-icons$1']);\n }\n\n const preferredMainFields: { [key: string]: string[] } = {\n // Defaults from Expo Webpack. Most packages using `react-native` don't support web\n // in the `react-native` field, so we should prefer the `browser` field.\n // https://github.com/expo/router/issues/37\n web: ['browser', 'module', 'main'],\n };\n\n let tsConfigResolve =\n isTsconfigPathsEnabled && (tsconfig?.paths || tsconfig?.baseUrl != null)\n ? resolveWithTsConfigPaths.bind(resolveWithTsConfigPaths, {\n paths: tsconfig.paths ?? {},\n baseUrl: tsconfig.baseUrl ?? config.projectRoot,\n hasBaseUrl: !!tsconfig.baseUrl,\n })\n : null;\n\n // TODO: Move this to be a transform key for invalidation.\n if (!isExporting && isInteractive()) {\n if (isTsconfigPathsEnabled) {\n // TODO: We should track all the files that used imports and invalidate them\n // currently the user will need to save all the files that use imports to\n // use the new aliases.\n const configWatcher = new FileNotifier(config.projectRoot, [\n './tsconfig.json',\n './jsconfig.json',\n ]);\n configWatcher.startObserving(() => {\n debug('Reloading tsconfig.json');\n loadTsConfigPathsAsync(config.projectRoot).then((tsConfigPaths) => {\n if (tsConfigPaths?.paths && !!Object.keys(tsConfigPaths.paths).length) {\n debug('Enabling tsconfig.json paths support');\n tsConfigResolve = resolveWithTsConfigPaths.bind(resolveWithTsConfigPaths, {\n paths: tsConfigPaths.paths ?? {},\n baseUrl: tsConfigPaths.baseUrl ?? config.projectRoot,\n hasBaseUrl: !!tsConfigPaths.baseUrl,\n });\n } else {\n debug('Disabling tsconfig.json paths support');\n tsConfigResolve = null;\n }\n });\n });\n\n // TODO: This probably prevents the process from exiting.\n installExitHooks(() => {\n configWatcher.stopObserving();\n });\n } else {\n debug('Skipping tsconfig.json paths support');\n }\n }\n\n let nodejsSourceExtensions: string[] | null = null;\n\n function getStrictResolver(\n { resolveRequest, ...context }: ResolutionContext,\n platform: string | null\n ) {\n return function doResolve(moduleName: string): Resolution {\n return resolver(context, moduleName, platform);\n };\n }\n\n function getOptionalResolver(context: ResolutionContext, platform: string | null) {\n const doResolve = getStrictResolver(context, platform);\n return function optionalResolve(moduleName: string): Resolution | null {\n try {\n return doResolve(moduleName);\n } catch (error) {\n // If the error is directly related to a resolver not being able to resolve a module, then\n // we can ignore the error and try the next resolver. Otherwise, we should throw the error.\n const isResolutionError =\n isFailedToResolveNameError(error) || isFailedToResolvePathError(error);\n if (!isResolutionError) {\n throw error;\n }\n }\n return null;\n };\n }\n\n const metroConfigWithCustomResolver = withMetroResolvers(config, [\n // Mock out production react imports in development.\n (context: ResolutionContext, moduleName: string, platform: string | null) => {\n // This resolution is dev-only to prevent bundling the production React packages in development.\n // @ts-expect-error: dev is not on type.\n if (!context.dev) return null;\n\n if (\n // Match react-native renderers.\n (platform !== 'web' &&\n context.originModulePath.match(/[\\\\/]node_modules[\\\\/]react-native[\\\\/]/) &&\n moduleName.match(/([\\\\/]ReactFabric|ReactNativeRenderer)-prod/)) ||\n // Match react production imports.\n (moduleName.match(/\\.production(\\.min)?\\.js$/) &&\n // Match if the import originated from a react package.\n context.originModulePath.match(/[\\\\/]node_modules[\\\\/](react[-\\\\/]|scheduler[\\\\/])/))\n ) {\n debug(`Skipping production module: ${moduleName}`);\n // /Users/path/to/expo/node_modules/react/index.js ./cjs/react.production.min.js\n // /Users/path/to/expo/node_modules/react/jsx-dev-runtime.js ./cjs/react-jsx-dev-runtime.production.min.js\n // /Users/path/to/expo/node_modules/react-is/index.js ./cjs/react-is.production.min.js\n // /Users/path/to/expo/node_modules/react-refresh/runtime.js ./cjs/react-refresh-runtime.production.min.js\n // /Users/path/to/expo/node_modules/react-native/node_modules/scheduler/index.native.js ./cjs/scheduler.native.production.min.js\n // /Users/path/to/expo/node_modules/react-native/node_modules/react-is/index.js ./cjs/react-is.production.min.js\n return {\n type: 'empty',\n };\n }\n return null;\n },\n // tsconfig paths\n (context: ResolutionContext, moduleName: string, platform: string | null) => {\n return (\n tsConfigResolve?.(\n {\n originModulePath: context.originModulePath,\n moduleName,\n },\n getOptionalResolver(context, platform)\n ) ?? null\n );\n },\n\n // Node.js externals support\n (context: ResolutionContext, moduleName: string, platform: string | null) => {\n const isServer =\n context.customResolverOptions?.environment === 'node' ||\n context.customResolverOptions?.environment === 'react-server';\n\n if (platform !== 'web' && !isServer) {\n // This is a web/server-only feature, we may extend the shimming to native platforms in the future.\n return null;\n }\n\n const moduleId = isNodeExternal(moduleName);\n if (!moduleId) {\n return null;\n }\n\n if (\n // In browser runtimes, we want to either resolve a local node module by the same name, or shim the module to\n // prevent crashing when Node.js built-ins are imported.\n !isServer\n ) {\n // Perform optional resolve first. If the module doesn't exist (no module in the node_modules)\n // then we can mock the file to use an empty module.\n const result = getOptionalResolver(context, platform)(moduleName);\n return (\n result ?? {\n // In this case, mock the file to use an empty module.\n type: 'empty',\n }\n );\n }\n\n const contents = `module.exports=$$require_external('node:${moduleId}');`;\n debug(`Virtualizing Node.js \"${moduleId}\"`);\n const virtualModuleId = `\\0node:${moduleId}`;\n getMetroBundlerWithVirtualModules(getMetroBundler()).setVirtualModule(\n virtualModuleId,\n contents\n );\n return {\n type: 'sourceFile',\n filePath: virtualModuleId,\n };\n },\n\n // Basic moduleId aliases\n (context: ResolutionContext, moduleName: string, platform: string | null) => {\n // Conditionally remap `react-native` to `react-native-web` on web in\n // a way that doesn't require Babel to resolve the alias.\n if (platform && platform in aliases && aliases[platform][moduleName]) {\n const redirectedModuleName = aliases[platform][moduleName];\n return getStrictResolver(context, platform)(redirectedModuleName);\n }\n\n for (const [matcher, alias] of universalAliases) {\n const match = moduleName.match(matcher);\n if (match) {\n const aliasedModule = alias.replace(\n /\\$(\\d+)/g,\n (_, index) => match[parseInt(index, 10)] ?? ''\n );\n const doResolve = getStrictResolver(context, platform);\n debug(`Alias \"${moduleName}\" to \"${aliasedModule}\"`);\n return doResolve(aliasedModule);\n }\n }\n\n return null;\n },\n\n // HACK(EvanBacon):\n // React Native uses `event-target-shim` incorrectly and this causes the native runtime\n // to fail to load. This is a temporary workaround until we can fix this upstream.\n // https://github.com/facebook/react-native/pull/38628\n (context: ResolutionContext, moduleName: string, platform: string | null) => {\n if (platform !== 'web' && moduleName === 'event-target-shim') {\n debug('For event-target-shim to use js:', context.originModulePath);\n const doResolve = getStrictResolver(context, platform);\n return doResolve('event-target-shim/dist/event-target-shim.js');\n }\n\n return null;\n },\n\n // TODO: Reduce these as much as possible in the future.\n // Complex post-resolution rewrites.\n (context: ResolutionContext, moduleName: string, platform: string | null) => {\n const doResolve = getStrictResolver(context, platform);\n\n const result = doResolve(moduleName);\n\n if (result.type !== 'sourceFile') {\n return result;\n }\n\n if (platform === 'web') {\n // Replace the web resolver with the original one.\n // This is basically an alias for web-only.\n // TODO: Drop this in favor of the standalone asset registry module.\n if (shouldAliasAssetRegistryForWeb(platform, result)) {\n // @ts-expect-error: `readonly` for some reason.\n result.filePath = assetRegistryPath;\n }\n\n if (platform === 'web' && result.filePath.includes('node_modules')) {\n // Replace with static shims\n\n const normalName = normalizeSlashes(result.filePath)\n // Drop everything up until the `node_modules` folder.\n .replace(/.*node_modules\\//, '');\n\n const shimFile = shouldCreateVirtualShim(normalName);\n if (shimFile) {\n const virtualId = `\\0shim:${normalName}`;\n const bundler = getMetroBundlerWithVirtualModules(getMetroBundler());\n if (!bundler.hasVirtualModule(virtualId)) {\n bundler.setVirtualModule(virtualId, fs.readFileSync(shimFile, 'utf8'));\n }\n debug(`Redirecting module \"${result.filePath}\" to shim`);\n\n return {\n ...result,\n filePath: virtualId,\n };\n }\n }\n } else {\n // When server components are enabled, redirect React Native's renderer to the canary build\n // this will enable the use hook and other requisite features from React 19.\n if (isReactCanaryEnabled && result.filePath.includes('node_modules')) {\n const normalName = normalizeSlashes(result.filePath)\n // Drop everything up until the `node_modules` folder.\n .replace(/.*node_modules\\//, '');\n\n const canaryFile = shouldCreateVirtualCanary(normalName);\n if (canaryFile) {\n debug(`Redirecting React Native module \"${result.filePath}\" to canary build`);\n return {\n ...result,\n filePath: canaryFile,\n };\n }\n }\n }\n\n return result;\n },\n ]);\n\n // Ensure we mutate the resolution context to include the custom resolver options for server and web.\n const metroConfigWithCustomContext = withMetroMutatedResolverContext(\n metroConfigWithCustomResolver,\n (\n immutableContext: CustomResolutionContext,\n moduleName: string,\n platform: string | null\n ): CustomResolutionContext => {\n const context: Mutable<CustomResolutionContext> = {\n ...immutableContext,\n preferNativePlatform: platform !== 'web',\n };\n\n if (isServerEnvironment(context.customResolverOptions?.environment)) {\n // Adjust nodejs source extensions to sort mjs after js, including platform variants.\n if (nodejsSourceExtensions === null) {\n nodejsSourceExtensions = getNodejsExtensions(context.sourceExts);\n }\n context.sourceExts = nodejsSourceExtensions;\n\n context.unstable_enablePackageExports = true;\n context.unstable_conditionNames = ['node', 'require'];\n context.unstable_conditionsByPlatform = {};\n // Node.js runtimes should only be importing main at the moment.\n // This is a temporary fix until we can support the package.json exports.\n context.mainFields = ['main', 'module'];\n\n // Enable react-server import conditions.\n if (context.customResolverOptions?.environment === 'react-server') {\n context.unstable_conditionNames = ['node', 'require', 'react-server', 'server'];\n }\n } else {\n // Non-server changes\n\n if (!env.EXPO_METRO_NO_MAIN_FIELD_OVERRIDE && platform && platform in preferredMainFields) {\n context.mainFields = preferredMainFields[platform];\n }\n }\n\n return context;\n }\n );\n\n return withMetroErrorReportingResolver(metroConfigWithCustomContext);\n}\n\n/** @returns `true` if the incoming resolution should be swapped on web. */\nexport function shouldAliasAssetRegistryForWeb(\n platform: string | null,\n result: Resolution\n): boolean {\n return (\n platform === 'web' &&\n result?.type === 'sourceFile' &&\n typeof result?.filePath === 'string' &&\n normalizeSlashes(result.filePath).endsWith(\n 'react-native-web/dist/modules/AssetRegistry/index.js'\n )\n );\n}\n/** @returns `true` if the incoming resolution should be swapped. */\nexport function shouldAliasModule(\n input: {\n platform: string | null;\n result: Resolution;\n },\n alias: { platform: string; output: string }\n): boolean {\n return (\n input.platform === alias.platform &&\n input.result?.type === 'sourceFile' &&\n typeof input.result?.filePath === 'string' &&\n normalizeSlashes(input.result.filePath).endsWith(alias.output)\n );\n}\n\n/** Add support for `react-native-web` and the Web platform. */\nexport async function withMetroMultiPlatformAsync(\n projectRoot: string,\n {\n config,\n exp,\n platformBundlers,\n isTsconfigPathsEnabled,\n webOutput,\n isFastResolverEnabled,\n isExporting,\n isReactCanaryEnabled,\n getMetroBundler,\n }: {\n config: ConfigT;\n exp: ExpoConfig;\n isTsconfigPathsEnabled: boolean;\n platformBundlers: PlatformBundlers;\n webOutput?: 'single' | 'static' | 'server';\n isFastResolverEnabled?: boolean;\n isExporting?: boolean;\n isReactCanaryEnabled: boolean;\n getMetroBundler: () => Bundler;\n }\n) {\n if (!config.projectRoot) {\n // @ts-expect-error: read-only types\n config.projectRoot = projectRoot;\n }\n\n // Required for @expo/metro-runtime to format paths in the web LogBox.\n process.env.EXPO_PUBLIC_PROJECT_ROOT = process.env.EXPO_PUBLIC_PROJECT_ROOT ?? projectRoot;\n\n if (['static', 'server'].includes(webOutput ?? '')) {\n // Enable static rendering in runtime space.\n process.env.EXPO_PUBLIC_USE_STATIC = '1';\n }\n\n // This is used for running Expo CLI in development against projects outside the monorepo.\n if (!isDirectoryIn(__dirname, projectRoot)) {\n if (!config.watchFolders) {\n // @ts-expect-error: watchFolders is readonly\n config.watchFolders = [];\n }\n // @ts-expect-error: watchFolders is readonly\n config.watchFolders.push(path.join(require.resolve('metro-runtime/package.json'), '../..'));\n }\n\n // @ts-expect-error\n config.transformer._expoRouterWebRendering = webOutput;\n // @ts-expect-error: Invalidate the cache when the location of expo-router changes on-disk.\n config.transformer._expoRouterPath = resolveFrom.silent(projectRoot, 'expo-router');\n\n let tsconfig: null | TsConfigPaths = null;\n\n if (isTsconfigPathsEnabled) {\n tsconfig = await loadTsConfigPathsAsync(projectRoot);\n }\n\n let expoConfigPlatforms = Object.entries(platformBundlers)\n .filter(\n ([platform, bundler]) => bundler === 'metro' && exp.platforms?.includes(platform as Platform)\n )\n .map(([platform]) => platform);\n\n if (Array.isArray(config.resolver.platforms)) {\n expoConfigPlatforms = [...new Set(expoConfigPlatforms.concat(config.resolver.platforms))];\n }\n\n // @ts-expect-error: typed as `readonly`.\n config.resolver.platforms = expoConfigPlatforms;\n\n config = withWebPolyfills(config, { getMetroBundler });\n\n return withExtendedResolver(config, {\n tsconfig,\n isExporting,\n isTsconfigPathsEnabled,\n isFastResolverEnabled,\n isReactCanaryEnabled,\n getMetroBundler,\n });\n}\n\nfunction isDirectoryIn(a: string, b: string) {\n return b.startsWith(a) && b.length > a.length;\n}\n"],"names":["getNodejsExtensions","withExtendedResolver","shouldAliasAssetRegistryForWeb","shouldAliasModule","withMetroMultiPlatformAsync","metroResolver","debug","require","withWebPolyfills","config","getMetroBundler","originalGetPolyfills","serializer","getPolyfills","bind","ctx","virtualModuleId","contents","platform","getMetroBundlerWithVirtualModules","setVirtualModule","polyfills","normalizeSlashes","p","replace","srcExts","mjsExts","filter","ext","test","nodejsSourceExtensions","jsIndex","reduce","index","i","splice","tsconfig","isTsconfigPathsEnabled","isFastResolverEnabled","isExporting","isReactCanaryEnabled","Log","warn","assetRegistryPath","fs","realpathSync","path","resolve","resolveFrom","projectRoot","defaultResolver","resolver","createFastResolver","preserveSymlinks","unstable_enableSymlinks","blockList","Array","isArray","aliases","web","universalAliases","silent","push","preferredMainFields","tsConfigResolve","paths","baseUrl","resolveWithTsConfigPaths","hasBaseUrl","isInteractive","configWatcher","FileNotifier","startObserving","loadTsConfigPathsAsync","then","tsConfigPaths","Object","keys","length","installExitHooks","stopObserving","getStrictResolver","resolveRequest","context","doResolve","moduleName","getOptionalResolver","optionalResolve","error","isResolutionError","isFailedToResolveNameError","isFailedToResolvePathError","metroConfigWithCustomResolver","withMetroResolvers","dev","originModulePath","match","type","isServer","customResolverOptions","environment","moduleId","isNodeExternal","result","filePath","redirectedModuleName","matcher","alias","aliasedModule","_","parseInt","includes","normalName","shimFile","shouldCreateVirtualShim","virtualId","bundler","hasVirtualModule","readFileSync","canaryFile","shouldCreateVirtualCanary","metroConfigWithCustomContext","withMetroMutatedResolverContext","immutableContext","preferNativePlatform","isServerEnvironment","sourceExts","unstable_enablePackageExports","unstable_conditionNames","unstable_conditionsByPlatform","mainFields","env","EXPO_METRO_NO_MAIN_FIELD_OVERRIDE","withMetroErrorReportingResolver","endsWith","input","output","exp","platformBundlers","webOutput","process","EXPO_PUBLIC_PROJECT_ROOT","EXPO_PUBLIC_USE_STATIC","isDirectoryIn","__dirname","watchFolders","join","transformer","_expoRouterWebRendering","_expoRouterPath","expoConfigPlatforms","entries","platforms","map","Set","concat","a","b","startsWith"],"mappings":"AAMA;;;;QAkFgBA,mBAAmB,GAAnBA,mBAAmB;QAsBnBC,oBAAoB,GAApBA,oBAAoB;QAyXpBC,8BAA8B,GAA9BA,8BAA8B;QAc9BC,iBAAiB,GAAjBA,iBAAiB;QAgBXC,2BAA2B,GAA3BA,2BAA2B;SA9flC,GAAI;gDAAJ,IAAI;IAAJ,GAAI;;;;;SAIPC,aAAa;iDAAM,gBAAgB;IAAnCA,aAAa;;;;;SACR,KAAM;gDAAN,MAAM;IAAN,KAAM;;;;;SACC,YAAc;gDAAd,cAAc;IAAd,YAAc;;;;;AAEH,IAAA,wBAA2B,WAA3B,2BAA2B,CAAA;AACqB,IAAA,UAAa,WAAb,aAAa,CAAA;AACzB,IAAA,YAAe,WAAf,eAAe,CAAA;AACpC,IAAA,oBAAuB,WAAvB,uBAAuB,CAAA;AAKlE,IAAA,mBAAsB,WAAtB,sBAAsB,CAAA;AACT,IAAA,IAAc,WAAd,cAAc,CAAA;AACL,IAA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,QAAQ,CAAC7F,QAAQ,CAAa,CAAA,CAAA;KAAA,CAC9F,CACAuI,GAAG,CAAC,CAAC,CAACvI,QAAQ,CAAC,GAAKA,QAAQ;IAAA,CAAC,AAAC;IAEjC,IAAIsC,KAAK,CAACC,OAAO,CAAChD,MAAM,CAAC0C,QAAQ,CAACqG,SAAS,CAAC,EAAE;QAC5CF,mBAAmB,GAAG;eAAI,IAAII,GAAG,CAACJ,mBAAmB,CAACK,MAAM,CAAClJ,MAAM,CAAC0C,QAAQ,CAACqG,SAAS,CAAC,CAAC;SAAC,CAAC;KAC3F;IAED,yCAAyC;IACzC/I,MAAM,CAAC0C,QAAQ,CAACqG,SAAS,GAAGF,mBAAmB,CAAC;IAEhD7I,MAAM,GAAGD,gBAAgB,CAACC,MAAM,EAAE;QAAEC,eAAe;KAAE,CAAC,CAAC;IAEvD,OAAOT,oBAAoB,CAACQ,MAAM,EAAE;QAClC2B,QAAQ;QACRG,WAAW;QACXF,sBAAsB;QACtBC,qBAAqB;QACrBE,oBAAoB;QACpB9B,eAAe;KAChB,CAAC,CAAC;CACJ;AAED,SAASqI,aAAa,CAACa,CAAS,EAAEC,CAAS,EAAE;IAC3C,OAAOA,CAAC,CAACC,UAAU,CAACF,CAAC,CAAC,IAAIC,CAAC,CAAC/E,MAAM,GAAG8E,CAAC,CAAC9E,MAAM,CAAC;CAC/C"}
|
|
@@ -6,9 +6,27 @@ exports.getDefaultMetroResolver = getDefaultMetroResolver;
|
|
|
6
6
|
exports.withMetroResolvers = withMetroResolvers;
|
|
7
7
|
exports.withMetroMutatedResolverContext = withMetroMutatedResolverContext;
|
|
8
8
|
exports.withMetroErrorReportingResolver = withMetroErrorReportingResolver;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
function _chalk() {
|
|
10
|
+
const data = _interopRequireDefault(require("chalk"));
|
|
11
|
+
_chalk = function() {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
return data;
|
|
15
|
+
}
|
|
16
|
+
function metroResolver() {
|
|
17
|
+
const data = _interopRequireWildcard(require("metro-resolver"));
|
|
18
|
+
metroResolver = function() {
|
|
19
|
+
return data;
|
|
20
|
+
};
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
function _path() {
|
|
24
|
+
const data = _interopRequireDefault(require("path"));
|
|
25
|
+
_path = function() {
|
|
26
|
+
return data;
|
|
27
|
+
};
|
|
28
|
+
return data;
|
|
29
|
+
}
|
|
12
30
|
var _metroErrors = require("./metroErrors");
|
|
13
31
|
var _env = require("../../../utils/env");
|
|
14
32
|
function _interopRequireDefault(obj) {
|
|
@@ -40,7 +58,7 @@ function _interopRequireWildcard(obj) {
|
|
|
40
58
|
const debug = require("debug")("expo:metro:withMetroResolvers");
|
|
41
59
|
function getDefaultMetroResolver(projectRoot) {
|
|
42
60
|
return (context, moduleName, platform)=>{
|
|
43
|
-
return metroResolver.resolve(context, moduleName, platform);
|
|
61
|
+
return metroResolver().resolve(context, moduleName, platform);
|
|
44
62
|
};
|
|
45
63
|
}
|
|
46
64
|
function optionsKeyForContext(context) {
|
|
@@ -191,25 +209,25 @@ function withMetroErrorReportingResolver(config) {
|
|
|
191
209
|
35);
|
|
192
210
|
if (inverseTree.previous.length > 0) {
|
|
193
211
|
debug("Found inverse graph:", JSON.stringify(inverseTree, null, 2));
|
|
194
|
-
let extraMessage = _chalk.default.bold("Import stack:");
|
|
212
|
+
let extraMessage = _chalk().default.bold("Import stack:");
|
|
195
213
|
const printRecursive = (tree, depth = 0)=>{
|
|
196
|
-
let filename = _path.default.relative(root, tree.origin);
|
|
214
|
+
let filename = _path().default.relative(root, tree.origin);
|
|
197
215
|
if (filename.match(/\?ctx=[\w\d]+$/)) {
|
|
198
|
-
filename = filename.replace(/\?ctx=[\w\d]+$/, _chalk.default.dim(" (require.context)"));
|
|
216
|
+
filename = filename.replace(/\?ctx=[\w\d]+$/, _chalk().default.dim(" (require.context)"));
|
|
199
217
|
} else {
|
|
200
|
-
let formattedRequest = _chalk.default.green(`"${tree.request}"`);
|
|
218
|
+
let formattedRequest = _chalk().default.green(`"${tree.request}"`);
|
|
201
219
|
if (// If bundling for web and the import is pulling internals from outside of react-native
|
|
202
220
|
// then mark it as an invalid import.
|
|
203
221
|
platform === "web" && !/^(node_modules\/)?react-native\//.test(filename) && tree.request.match(/^react-native\/.*/)) {
|
|
204
|
-
formattedRequest = formattedRequest + _chalk.default`\n {yellow Importing react-native internals is not supported on web.}`;
|
|
222
|
+
formattedRequest = formattedRequest + _chalk().default`\n {yellow Importing react-native internals is not supported on web.}`;
|
|
205
223
|
}
|
|
206
|
-
filename = filename + _chalk.default`\n{gray |} {cyan import} ${formattedRequest}\n`;
|
|
224
|
+
filename = filename + _chalk().default`\n{gray |} {cyan import} ${formattedRequest}\n`;
|
|
207
225
|
}
|
|
208
|
-
let line = "\n" + pad(depth) + _chalk.default.gray(" ") + filename;
|
|
226
|
+
let line = "\n" + pad(depth) + _chalk().default.gray(" ") + filename;
|
|
209
227
|
if (filename.match(/node_modules/)) {
|
|
210
|
-
line = _chalk.default.gray(// Bold the node module name
|
|
228
|
+
line = _chalk().default.gray(// Bold the node module name
|
|
211
229
|
line.replace(/node_modules\/([^/]+)/, (_match, p1)=>{
|
|
212
|
-
return "node_modules/" + _chalk.default.bold(p1);
|
|
230
|
+
return "node_modules/" + _chalk().default.bold(p1);
|
|
213
231
|
}));
|
|
214
232
|
}
|
|
215
233
|
extraMessage += line;
|