@expo/cli 0.0.0 → 0.1.2
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/README.md +106 -0
- package/build/bin/cli +152 -0
- package/build/bin/cli.map +1 -0
- package/build/src/api/endpoint.js +17 -0
- package/build/src/api/endpoint.js.map +1 -0
- package/build/src/api/getExpoGoIntermediateCertificate.js +21 -0
- package/build/src/api/getExpoGoIntermediateCertificate.js.map +1 -0
- package/build/src/api/getExpoSchema.js +69 -0
- package/build/src/api/getExpoSchema.js.map +1 -0
- package/build/src/api/getNativeModuleVersions.js +31 -0
- package/build/src/api/getNativeModuleVersions.js.map +1 -0
- package/build/src/api/getProject.js +19 -0
- package/build/src/api/getProject.js.map +1 -0
- package/build/src/api/getProjectDevelopmentCertificate.js +24 -0
- package/build/src/api/getProjectDevelopmentCertificate.js.map +1 -0
- package/build/src/api/getVersions.js +37 -0
- package/build/src/api/getVersions.js.map +1 -0
- package/build/src/api/graphql/client.js +104 -0
- package/build/src/api/graphql/client.js.map +1 -0
- package/build/src/api/graphql/generated.js +113 -0
- package/build/src/api/graphql/generated.js.map +1 -0
- package/build/src/api/graphql/queries/UserQuery.js +43 -0
- package/build/src/api/graphql/queries/UserQuery.js.map +1 -0
- package/build/src/api/rest/cache/FileSystemCache.js +79 -0
- package/build/src/api/rest/cache/FileSystemCache.js.map +1 -0
- package/build/src/api/rest/cache/response.js +31 -0
- package/build/src/api/rest/cache/response.js.map +1 -0
- package/build/src/api/rest/cache/wrapFetchWithCache.js +156 -0
- package/build/src/api/rest/cache/wrapFetchWithCache.js.map +1 -0
- package/build/src/api/rest/client.js +94 -0
- package/build/src/api/rest/client.js.map +1 -0
- package/build/src/api/rest/client.types.js +6 -0
- package/build/src/api/rest/client.types.js.map +1 -0
- package/build/src/api/rest/wrapFetchWithBaseUrl.js +20 -0
- package/build/src/api/rest/wrapFetchWithBaseUrl.js.map +1 -0
- package/build/src/api/rest/wrapFetchWithOffline.js +39 -0
- package/build/src/api/rest/wrapFetchWithOffline.js.map +1 -0
- package/build/src/api/rest/wrapFetchWithProgress.js +59 -0
- package/build/src/api/rest/wrapFetchWithProgress.js.map +1 -0
- package/build/src/api/settings.js +11 -0
- package/build/src/api/settings.js.map +1 -0
- package/build/src/api/signManifest.js +38 -0
- package/build/src/api/signManifest.js.map +1 -0
- package/build/src/api/updateDevelopmentSession.js +74 -0
- package/build/src/api/updateDevelopmentSession.js.map +1 -0
- package/build/src/api/user/UserSettings.js +71 -0
- package/build/src/api/user/UserSettings.js.map +1 -0
- package/build/src/api/user/actions.js +97 -0
- package/build/src/api/user/actions.js.map +1 -0
- package/build/src/api/user/otp.js +139 -0
- package/build/src/api/user/otp.js.map +1 -0
- package/build/src/api/user/user.js +114 -0
- package/build/src/api/user/user.js.map +1 -0
- package/build/src/config/configAsync.js +118 -0
- package/build/src/config/configAsync.js.map +1 -0
- package/build/src/config/index.js +75 -0
- package/build/src/config/index.js.map +1 -0
- package/build/src/export/createBundles.js +62 -0
- package/build/src/export/createBundles.js.map +1 -0
- package/build/src/export/createMetadataJson.js +36 -0
- package/build/src/export/createMetadataJson.js.map +1 -0
- package/build/src/export/exportApp.js +102 -0
- package/build/src/export/exportApp.js.map +1 -0
- package/build/src/export/exportAssets.js +106 -0
- package/build/src/export/exportAssets.js.map +1 -0
- package/build/src/export/exportAsync.js +49 -0
- package/build/src/export/exportAsync.js.map +1 -0
- package/build/src/export/fork-bundleAsync.js +138 -0
- package/build/src/export/fork-bundleAsync.js.map +1 -0
- package/build/src/export/getPublicExpoManifest.js +28 -0
- package/build/src/export/getPublicExpoManifest.js.map +1 -0
- package/build/src/export/getResolvedLocales.js +35 -0
- package/build/src/export/getResolvedLocales.js.map +1 -0
- package/build/src/export/index.js +77 -0
- package/build/src/export/index.js.map +1 -0
- package/build/src/export/printBundleSizes.js +122 -0
- package/build/src/export/printBundleSizes.js.map +1 -0
- package/build/src/export/resolveOptions.js +24 -0
- package/build/src/export/resolveOptions.js.map +1 -0
- package/build/src/export/saveAssets.js +65 -0
- package/build/src/export/saveAssets.js.map +1 -0
- package/build/src/export/writeContents.js +108 -0
- package/build/src/export/writeContents.js.map +1 -0
- package/build/src/install/checkPackages.js +74 -0
- package/build/src/install/checkPackages.js.map +1 -0
- package/build/src/install/index.js +49 -0
- package/build/src/install/index.js.map +1 -0
- package/build/src/install/installAsync.js +103 -0
- package/build/src/install/installAsync.js.map +1 -0
- package/build/src/install/resolveOptions.js +99 -0
- package/build/src/install/resolveOptions.js.map +1 -0
- package/build/src/install/utils/autoAddConfigPlugins.js +87 -0
- package/build/src/install/utils/autoAddConfigPlugins.js.map +1 -0
- package/build/src/log.js +74 -0
- package/build/src/log.js.map +1 -0
- package/build/src/login/index.js +62 -0
- package/build/src/login/index.js.map +1 -0
- package/build/src/logout/index.js +48 -0
- package/build/src/logout/index.js.map +1 -0
- package/build/src/prebuild/clearNativeFolder.js +137 -0
- package/build/src/prebuild/clearNativeFolder.js.map +1 -0
- package/build/src/prebuild/configureProjectAsync.js +68 -0
- package/build/src/prebuild/configureProjectAsync.js.map +1 -0
- package/build/src/prebuild/copyTemplateFiles.js +124 -0
- package/build/src/prebuild/copyTemplateFiles.js.map +1 -0
- package/build/src/prebuild/ensureConfigAsync.js +86 -0
- package/build/src/prebuild/ensureConfigAsync.js.map +1 -0
- package/build/src/prebuild/index.js +90 -0
- package/build/src/prebuild/index.js.map +1 -0
- package/build/src/prebuild/prebuildAsync.js +112 -0
- package/build/src/prebuild/prebuildAsync.js.map +1 -0
- package/build/src/prebuild/resolveOptions.js +97 -0
- package/build/src/prebuild/resolveOptions.js.map +1 -0
- package/build/src/prebuild/resolveTemplate.js +157 -0
- package/build/src/prebuild/resolveTemplate.js.map +1 -0
- package/build/src/prebuild/updateFromTemplate.js +102 -0
- package/build/src/prebuild/updateFromTemplate.js.map +1 -0
- package/build/src/prebuild/updatePackageJson.js +236 -0
- package/build/src/prebuild/updatePackageJson.js.map +1 -0
- package/build/src/prebuild/writeMetroConfig.js +89 -0
- package/build/src/prebuild/writeMetroConfig.js.map +1 -0
- package/build/src/register/index.js +48 -0
- package/build/src/register/index.js.map +1 -0
- package/build/src/register/registerAsync.js +37 -0
- package/build/src/register/registerAsync.js.map +1 -0
- package/build/src/run/android/index.js +97 -0
- package/build/src/run/android/index.js.map +1 -0
- package/build/src/run/android/resolveDevice.js +23 -0
- package/build/src/run/android/resolveDevice.js.map +1 -0
- package/build/src/run/android/resolveGradleProps.js +37 -0
- package/build/src/run/android/resolveGradleProps.js.map +1 -0
- package/build/src/run/android/resolveInstallApkName.js +72 -0
- package/build/src/run/android/resolveInstallApkName.js.map +1 -0
- package/build/src/run/android/resolveLaunchProps.js +32 -0
- package/build/src/run/android/resolveLaunchProps.js.map +1 -0
- package/build/src/run/android/resolveOptions.js +25 -0
- package/build/src/run/android/resolveOptions.js.map +1 -0
- package/build/src/run/android/runAndroidAsync.js +74 -0
- package/build/src/run/android/runAndroidAsync.js.map +1 -0
- package/build/src/run/ensureNativeProject.js +33 -0
- package/build/src/run/ensureNativeProject.js.map +1 -0
- package/build/src/run/hints.js +22 -0
- package/build/src/run/hints.js.map +1 -0
- package/build/src/run/resolveBundlerProps.js +31 -0
- package/build/src/run/resolveBundlerProps.js.map +1 -0
- package/build/src/run/startBundler.js +76 -0
- package/build/src/run/startBundler.js.map +1 -0
- package/build/src/start/doctor/Prerequisite.js +47 -0
- package/build/src/start/doctor/Prerequisite.js.map +1 -0
- package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js +68 -0
- package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js.map +1 -0
- package/build/src/start/doctor/apple/XcodePrerequisite.js +115 -0
- package/build/src/start/doctor/apple/XcodePrerequisite.js.map +1 -0
- package/build/src/start/doctor/apple/XcrunPrerequisite.js +65 -0
- package/build/src/start/doctor/apple/XcrunPrerequisite.js.map +1 -0
- package/build/src/start/doctor/dependencies/bundledNativeModules.js +64 -0
- package/build/src/start/doctor/dependencies/bundledNativeModules.js.map +1 -0
- package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js +131 -0
- package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js.map +1 -0
- package/build/src/start/doctor/dependencies/getMissingPackages.js +95 -0
- package/build/src/start/doctor/dependencies/getMissingPackages.js.map +1 -0
- package/build/src/start/doctor/dependencies/getVersionedPackages.js +119 -0
- package/build/src/start/doctor/dependencies/getVersionedPackages.js.map +1 -0
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js +147 -0
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js.map +1 -0
- package/build/src/start/doctor/ngrok/ExternalModule.js +164 -0
- package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -0
- package/build/src/start/doctor/ngrok/NgrokResolver.js +17 -0
- package/build/src/start/doctor/ngrok/NgrokResolver.js.map +1 -0
- package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js +142 -0
- package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js.map +1 -0
- package/build/src/start/doctor/typescript/updateTSConfig.js +92 -0
- package/build/src/start/doctor/typescript/updateTSConfig.js.map +1 -0
- package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js +112 -0
- package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js.map +1 -0
- package/build/src/start/index.js +116 -0
- package/build/src/start/index.js.map +1 -0
- package/build/src/start/interface/KeyPressHandler.js +99 -0
- package/build/src/start/interface/KeyPressHandler.js.map +1 -0
- package/build/src/start/interface/commandsTable.js +175 -0
- package/build/src/start/interface/commandsTable.js.map +1 -0
- package/build/src/start/interface/interactiveActions.js +134 -0
- package/build/src/start/interface/interactiveActions.js.map +1 -0
- package/build/src/start/interface/startInterface.js +217 -0
- package/build/src/start/interface/startInterface.js.map +1 -0
- package/build/src/start/platforms/AppIdResolver.js +44 -0
- package/build/src/start/platforms/AppIdResolver.js.map +1 -0
- package/build/src/start/platforms/DeviceManager.js +43 -0
- package/build/src/start/platforms/DeviceManager.js.map +1 -0
- package/build/src/start/platforms/ExpoGoInstaller.js +111 -0
- package/build/src/start/platforms/ExpoGoInstaller.js.map +1 -0
- package/build/src/start/platforms/PlatformManager.js +121 -0
- package/build/src/start/platforms/PlatformManager.js.map +1 -0
- package/build/src/start/platforms/android/ADBServer.js +129 -0
- package/build/src/start/platforms/android/ADBServer.js.map +1 -0
- package/build/src/start/platforms/android/AndroidAppIdResolver.js +40 -0
- package/build/src/start/platforms/android/AndroidAppIdResolver.js.map +1 -0
- package/build/src/start/platforms/android/AndroidDeviceManager.js +183 -0
- package/build/src/start/platforms/android/AndroidDeviceManager.js.map +1 -0
- package/build/src/start/platforms/android/AndroidPlatformManager.js +35 -0
- package/build/src/start/platforms/android/AndroidPlatformManager.js.map +1 -0
- package/build/src/start/platforms/android/activateWindow.js +80 -0
- package/build/src/start/platforms/android/activateWindow.js.map +1 -0
- package/build/src/start/platforms/android/adb.js +263 -0
- package/build/src/start/platforms/android/adb.js.map +1 -0
- package/build/src/start/platforms/android/adbReverse.js +84 -0
- package/build/src/start/platforms/android/adbReverse.js.map +1 -0
- package/build/src/start/platforms/android/emulator.js +118 -0
- package/build/src/start/platforms/android/emulator.js.map +1 -0
- package/build/src/start/platforms/android/getDevices.js +36 -0
- package/build/src/start/platforms/android/getDevices.js.map +1 -0
- package/build/src/start/platforms/android/gradle.js +86 -0
- package/build/src/start/platforms/android/gradle.js.map +1 -0
- package/build/src/start/platforms/android/promptAndroidDevice.js +60 -0
- package/build/src/start/platforms/android/promptAndroidDevice.js.map +1 -0
- package/build/src/start/platforms/ios/AppleAppIdResolver.js +46 -0
- package/build/src/start/platforms/ios/AppleAppIdResolver.js.map +1 -0
- package/build/src/start/platforms/ios/AppleDeviceManager.js +201 -0
- package/build/src/start/platforms/ios/AppleDeviceManager.js.map +1 -0
- package/build/src/start/platforms/ios/ApplePlatformManager.js +31 -0
- package/build/src/start/platforms/ios/ApplePlatformManager.js.map +1 -0
- package/build/src/start/platforms/ios/assertSystemRequirements.js +16 -0
- package/build/src/start/platforms/ios/assertSystemRequirements.js.map +1 -0
- package/build/src/start/platforms/ios/ensureSimulatorAppRunning.js +85 -0
- package/build/src/start/platforms/ios/ensureSimulatorAppRunning.js.map +1 -0
- package/build/src/start/platforms/ios/getBestSimulator.js +101 -0
- package/build/src/start/platforms/ios/getBestSimulator.js.map +1 -0
- package/build/src/start/platforms/ios/promptAppleDevice.js +60 -0
- package/build/src/start/platforms/ios/promptAppleDevice.js.map +1 -0
- package/build/src/start/platforms/ios/simctl.js +229 -0
- package/build/src/start/platforms/ios/simctl.js.map +1 -0
- package/build/src/start/platforms/ios/xcrun.js +67 -0
- package/build/src/start/platforms/ios/xcrun.js.map +1 -0
- package/build/src/start/project/devices.js +77 -0
- package/build/src/start/project/devices.js.map +1 -0
- package/build/src/start/project/dotExpo.js +74 -0
- package/build/src/start/project/dotExpo.js.map +1 -0
- package/build/src/start/project/settings.js +13 -0
- package/build/src/start/project/settings.js.map +1 -0
- package/build/src/start/resolveOptions.js +156 -0
- package/build/src/start/resolveOptions.js.map +1 -0
- package/build/src/start/server/AsyncNgrok.js +173 -0
- package/build/src/start/server/AsyncNgrok.js.map +1 -0
- package/build/src/start/server/BundlerDevServer.js +312 -0
- package/build/src/start/server/BundlerDevServer.js.map +1 -0
- package/build/src/start/server/DevServerManager.js +142 -0
- package/build/src/start/server/DevServerManager.js.map +1 -0
- package/build/src/start/server/DevelopmentSession.js +104 -0
- package/build/src/start/server/DevelopmentSession.js.map +1 -0
- package/build/src/start/server/UrlCreator.js +159 -0
- package/build/src/start/server/UrlCreator.js.map +1 -0
- package/build/src/start/server/metro/MetroBundlerDevServer.js +97 -0
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -0
- package/build/src/start/server/metro/MetroTerminalReporter.js +178 -0
- package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -0
- package/build/src/start/server/metro/TerminalReporter.js +87 -0
- package/build/src/start/server/metro/TerminalReporter.js.map +1 -0
- package/build/src/start/server/metro/TerminalReporter.types.js +6 -0
- package/build/src/start/server/metro/TerminalReporter.types.js.map +1 -0
- package/build/src/start/server/metro/instantiateMetro.js +66 -0
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -0
- package/build/src/start/server/metro/resolveFromProject.js +38 -0
- package/build/src/start/server/metro/resolveFromProject.js.map +1 -0
- package/build/src/start/server/middleware/ClassicManifestMiddleware.js +145 -0
- package/build/src/start/server/middleware/ClassicManifestMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js +185 -0
- package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/ExpoMiddleware.js +78 -0
- package/build/src/start/server/middleware/ExpoMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/InterstitialPageMiddleware.js +70 -0
- package/build/src/start/server/middleware/InterstitialPageMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/ManifestMiddleware.js +177 -0
- package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js +69 -0
- package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/createDevServerMiddleware.js +24 -0
- package/build/src/start/server/middleware/createDevServerMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/resolveAssets.js +110 -0
- package/build/src/start/server/middleware/resolveAssets.js.map +1 -0
- package/build/src/start/server/middleware/resolveEntryPoint.js +37 -0
- package/build/src/start/server/middleware/resolveEntryPoint.js.map +1 -0
- package/build/src/start/server/middleware/resolvePlatform.js +32 -0
- package/build/src/start/server/middleware/resolvePlatform.js.map +1 -0
- package/build/src/start/server/middleware/server.types.js +6 -0
- package/build/src/start/server/middleware/server.types.js.map +1 -0
- package/build/src/start/server/openPlatforms.js +30 -0
- package/build/src/start/server/openPlatforms.js.map +1 -0
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js +299 -0
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js.map +1 -0
- package/build/src/start/server/webpack/formatWebpackMessages.js +94 -0
- package/build/src/start/server/webpack/formatWebpackMessages.js.map +1 -0
- package/build/src/start/server/webpack/resolveFromProject.js +43 -0
- package/build/src/start/server/webpack/resolveFromProject.js.map +1 -0
- package/build/src/start/server/webpack/tls.js +72 -0
- package/build/src/start/server/webpack/tls.js.map +1 -0
- package/build/src/start/startAsync.js +150 -0
- package/build/src/start/startAsync.js.map +1 -0
- package/build/src/utils/FileNotifier.js +71 -0
- package/build/src/utils/FileNotifier.js.map +1 -0
- package/build/src/utils/analytics/getDevClientProperties.js +41 -0
- package/build/src/utils/analytics/getDevClientProperties.js.map +1 -0
- package/build/src/utils/analytics/rudderstackClient.js +106 -0
- package/build/src/utils/analytics/rudderstackClient.js.map +1 -0
- package/build/src/utils/ansi.js +17 -0
- package/build/src/utils/ansi.js.map +1 -0
- package/build/src/utils/args.js +77 -0
- package/build/src/utils/args.js.map +1 -0
- package/build/src/utils/array.js +56 -0
- package/build/src/utils/array.js.map +1 -0
- package/build/src/utils/cocoapods.js +143 -0
- package/build/src/utils/cocoapods.js.map +1 -0
- package/build/src/utils/codesigning.js +283 -0
- package/build/src/utils/codesigning.js.map +1 -0
- package/build/src/utils/createFileTransform.js +89 -0
- package/build/src/utils/createFileTransform.js.map +1 -0
- package/build/src/utils/delay.js +39 -0
- package/build/src/utils/delay.js.map +1 -0
- package/build/src/utils/dir.js +38 -0
- package/build/src/utils/dir.js.map +1 -0
- package/build/src/utils/downloadAppAsync.js +74 -0
- package/build/src/utils/downloadAppAsync.js.map +1 -0
- package/build/src/utils/downloadExpoGoAsync.js +99 -0
- package/build/src/utils/downloadExpoGoAsync.js.map +1 -0
- package/build/src/utils/editor.js +60 -0
- package/build/src/utils/editor.js.map +1 -0
- package/build/src/utils/env.js +62 -0
- package/build/src/utils/env.js.map +1 -0
- package/build/src/utils/errors.js +69 -0
- package/build/src/utils/errors.js.map +1 -0
- package/build/src/utils/exit.js +90 -0
- package/build/src/utils/exit.js.map +1 -0
- package/build/src/utils/findUp.js +33 -0
- package/build/src/utils/findUp.js.map +1 -0
- package/build/src/utils/fn.js +32 -0
- package/build/src/utils/fn.js.map +1 -0
- package/build/src/utils/getOrPromptApplicationId.js +183 -0
- package/build/src/utils/getOrPromptApplicationId.js.map +1 -0
- package/build/src/utils/getRunningProcess.js +92 -0
- package/build/src/utils/getRunningProcess.js.map +1 -0
- package/build/src/utils/git.js +88 -0
- package/build/src/utils/git.js.map +1 -0
- package/build/src/utils/glob.js +65 -0
- package/build/src/utils/glob.js.map +1 -0
- package/build/src/utils/ip.js +16 -0
- package/build/src/utils/ip.js.map +1 -0
- package/build/src/utils/isModuleSymlinked.js +37 -0
- package/build/src/utils/isModuleSymlinked.js.map +1 -0
- package/build/src/utils/link.js +31 -0
- package/build/src/utils/link.js.map +1 -0
- package/build/src/utils/mergeGitIgnorePaths.js +112 -0
- package/build/src/utils/mergeGitIgnorePaths.js.map +1 -0
- package/build/src/utils/modifyConfigAsync.js +68 -0
- package/build/src/utils/modifyConfigAsync.js.map +1 -0
- package/build/src/utils/modifyConfigPlugins.js +51 -0
- package/build/src/utils/modifyConfigPlugins.js.map +1 -0
- package/build/src/utils/nodeModules.js +118 -0
- package/build/src/utils/nodeModules.js.map +1 -0
- package/build/src/utils/npm.js +144 -0
- package/build/src/utils/npm.js.map +1 -0
- package/build/src/utils/obj.js +45 -0
- package/build/src/utils/obj.js.map +1 -0
- package/build/src/utils/ora.js +102 -0
- package/build/src/utils/ora.js.map +1 -0
- package/build/src/utils/port.js +130 -0
- package/build/src/utils/port.js.map +1 -0
- package/build/src/utils/profile.js +63 -0
- package/build/src/utils/profile.js.map +1 -0
- package/build/src/utils/progress.js +15 -0
- package/build/src/utils/progress.js.map +1 -0
- package/build/src/utils/prompts.js +127 -0
- package/build/src/utils/prompts.js.map +1 -0
- package/build/src/utils/resolveArgs.js +94 -0
- package/build/src/utils/resolveArgs.js.map +1 -0
- package/build/src/utils/scheme.js +106 -0
- package/build/src/utils/scheme.js.map +1 -0
- package/build/src/utils/tar.js +59 -0
- package/build/src/utils/tar.js.map +1 -0
- package/build/src/utils/url.js +67 -0
- package/build/src/utils/url.js.map +1 -0
- package/build/src/utils/validateApplicationId.js +90 -0
- package/build/src/utils/validateApplicationId.js.map +1 -0
- package/build/src/whoami/index.js +47 -0
- package/build/src/whoami/index.js.map +1 -0
- package/build/src/whoami/whoamiAsync.js +44 -0
- package/build/src/whoami/whoamiAsync.js.map +1 -0
- package/package.json +132 -4
- package/static/loading-page/index.html +270 -0
- package/index.js +0 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
var PackageManager = _interopRequireWildcard(require("@expo/package-manager"));
|
|
6
|
+
var _requireg = _interopRequireDefault(require("requireg"));
|
|
7
|
+
var _resolveFrom = _interopRequireDefault(require("resolve-from"));
|
|
8
|
+
var _semver = _interopRequireDefault(require("semver"));
|
|
9
|
+
var Log = _interopRequireWildcard(require("../../../log"));
|
|
10
|
+
var _delay = require("../../../utils/delay");
|
|
11
|
+
var _env = require("../../../utils/env");
|
|
12
|
+
var _errors = require("../../../utils/errors");
|
|
13
|
+
var _prompts = require("../../../utils/prompts");
|
|
14
|
+
function _interopRequireDefault(obj) {
|
|
15
|
+
return obj && obj.__esModule ? obj : {
|
|
16
|
+
default: obj
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function _interopRequireWildcard(obj) {
|
|
20
|
+
if (obj && obj.__esModule) {
|
|
21
|
+
return obj;
|
|
22
|
+
} else {
|
|
23
|
+
var newObj = {};
|
|
24
|
+
if (obj != null) {
|
|
25
|
+
for(var key in obj){
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
27
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
|
28
|
+
if (desc.get || desc.set) {
|
|
29
|
+
Object.defineProperty(newObj, key, desc);
|
|
30
|
+
} else {
|
|
31
|
+
newObj[key] = obj[key];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
newObj.default = obj;
|
|
37
|
+
return newObj;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
var _ref;
|
|
41
|
+
class ExternalModuleVersionError extends _errors.CommandError {
|
|
42
|
+
constructor(message, shouldGloballyInstall){
|
|
43
|
+
super("EXTERNAL_MODULE_VERSION", message);
|
|
44
|
+
this.shouldGloballyInstall = shouldGloballyInstall;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.ExternalModuleVersionError = ExternalModuleVersionError;
|
|
48
|
+
class ExternalModule {
|
|
49
|
+
constructor(projectRoot, pkg, promptMessage){
|
|
50
|
+
this.projectRoot = projectRoot;
|
|
51
|
+
this.pkg = pkg;
|
|
52
|
+
this.promptMessage = promptMessage;
|
|
53
|
+
this.instance = null;
|
|
54
|
+
}
|
|
55
|
+
/** Resolve the globally or locally installed instance, or prompt to install. */ async resolveAsync({ prefersGlobalInstall , ...options } = {}) {
|
|
56
|
+
try {
|
|
57
|
+
var ref;
|
|
58
|
+
return (ref = this.getVersioned()) != null ? ref : this.installAsync({
|
|
59
|
+
...options,
|
|
60
|
+
shouldGloballyInstall: prefersGlobalInstall
|
|
61
|
+
});
|
|
62
|
+
} catch (error) {
|
|
63
|
+
if (error instanceof ExternalModuleVersionError) {
|
|
64
|
+
var _shouldGloballyInstall;
|
|
65
|
+
// If the module version in not compliant with the version range,
|
|
66
|
+
// we should prompt the user to install the package where it already exists.
|
|
67
|
+
return this.installAsync({
|
|
68
|
+
...options,
|
|
69
|
+
shouldGloballyInstall: (_shouldGloballyInstall = error.shouldGloballyInstall) != null ? _shouldGloballyInstall : prefersGlobalInstall
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** Prompt the user to install the package and try again. */ async installAsync({ shouldPrompt =true , autoInstall , shouldGloballyInstall } = {}) {
|
|
76
|
+
const packageName = [
|
|
77
|
+
this.pkg.name,
|
|
78
|
+
this.pkg.versionRange
|
|
79
|
+
].join("@");
|
|
80
|
+
if (!autoInstall) {
|
|
81
|
+
// Delay the prompt so it doesn't conflict with other dev tool logs
|
|
82
|
+
await (0, _delay).delayAsync(100);
|
|
83
|
+
}
|
|
84
|
+
const answer = autoInstall || shouldPrompt && await (0, _prompts).confirmAsync({
|
|
85
|
+
message: this.promptMessage(packageName),
|
|
86
|
+
initial: true
|
|
87
|
+
});
|
|
88
|
+
if (answer) {
|
|
89
|
+
Log.log(`Installing ${packageName}...`);
|
|
90
|
+
// Always use npm for global installs
|
|
91
|
+
const packageManager = shouldGloballyInstall ? new PackageManager.NpmPackageManager({
|
|
92
|
+
cwd: this.projectRoot,
|
|
93
|
+
log: Log.log,
|
|
94
|
+
silent: !_env.env.EXPO_DEBUG
|
|
95
|
+
}) : PackageManager.createForProject(this.projectRoot, {
|
|
96
|
+
silent: !_env.env.EXPO_DEBUG
|
|
97
|
+
});
|
|
98
|
+
try {
|
|
99
|
+
if (shouldGloballyInstall) {
|
|
100
|
+
await packageManager.addGlobalAsync(packageName);
|
|
101
|
+
} else {
|
|
102
|
+
await packageManager.addDevAsync(packageName);
|
|
103
|
+
}
|
|
104
|
+
Log.log(`Installed ${packageName}`);
|
|
105
|
+
} catch (error) {
|
|
106
|
+
error.message = `Failed to install ${packageName} ${shouldGloballyInstall ? "globally" : "locally"}: ${error.message}`;
|
|
107
|
+
throw error;
|
|
108
|
+
}
|
|
109
|
+
return await this.resolveAsync({
|
|
110
|
+
shouldPrompt: false
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
throw new _errors.CommandError("EXTERNAL_MODULE_AVAILABILITY", `Please install ${packageName} and try again`);
|
|
114
|
+
}
|
|
115
|
+
/** Get the module. */ get() {
|
|
116
|
+
try {
|
|
117
|
+
return this.getVersioned();
|
|
118
|
+
} catch {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/** Get the module, throws if the module is not versioned correctly. */ getVersioned() {
|
|
123
|
+
var ref, _instance;
|
|
124
|
+
(_instance = (_ref = this).instance) != null ? _instance : _ref.instance = (ref = this._resolveModule(true)) != null ? ref : this._resolveModule(false);
|
|
125
|
+
return this.instance;
|
|
126
|
+
}
|
|
127
|
+
/** Exposed for testing. */ _require(moduleId) {
|
|
128
|
+
return require(moduleId);
|
|
129
|
+
}
|
|
130
|
+
/** Resolve a copy that's installed in the project. Exposed for testing. */ _resolveLocal(moduleId) {
|
|
131
|
+
return (0, _resolveFrom).default(this.projectRoot, moduleId);
|
|
132
|
+
}
|
|
133
|
+
/** Resolve a copy that's installed globally. Exposed for testing. */ _resolveGlobal(moduleId) {
|
|
134
|
+
return _requireg.default.resolve(moduleId);
|
|
135
|
+
}
|
|
136
|
+
/** Resolve the module and verify the version. Exposed for testing. */ _resolveModule(isLocal) {
|
|
137
|
+
const resolver = isLocal ? this._resolveLocal.bind(this) : this._resolveGlobal.bind(this);
|
|
138
|
+
try {
|
|
139
|
+
const packageJsonPath = resolver(`${this.pkg.name}/package.json`);
|
|
140
|
+
const packageJson = this._require(packageJsonPath);
|
|
141
|
+
if (packageJson) {
|
|
142
|
+
if (_semver.default.satisfies(packageJson.version, this.pkg.versionRange)) {
|
|
143
|
+
const modulePath = resolver(this.pkg.name);
|
|
144
|
+
const requiredModule = this._require(modulePath);
|
|
145
|
+
if (requiredModule == null) {
|
|
146
|
+
throw new _errors.CommandError("EXTERNAL_MODULE_EXPORT", `${this.pkg.name} exports a nullish value, which is not allowed.`);
|
|
147
|
+
}
|
|
148
|
+
return requiredModule;
|
|
149
|
+
}
|
|
150
|
+
throw new ExternalModuleVersionError(`Required module '${this.pkg.name}@${packageJson.version}' does not satisfy ${this.pkg.versionRange}. Installed at: ${packageJsonPath}`, !isLocal);
|
|
151
|
+
}
|
|
152
|
+
} catch (error) {
|
|
153
|
+
if (error instanceof _errors.CommandError) {
|
|
154
|
+
throw error;
|
|
155
|
+
} else if (error.code !== "MODULE_NOT_FOUND") {
|
|
156
|
+
Log.debug("[External Module] Failed to resolve module", error.message);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
exports.ExternalModule = ExternalModule;
|
|
163
|
+
|
|
164
|
+
//# sourceMappingURL=ExternalModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/doctor/ngrok/ExternalModule.ts"],"sourcesContent":["import * as PackageManager from '@expo/package-manager';\nimport requireGlobal from 'requireg';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\n\nimport * as Log from '../../../log';\nimport { delayAsync } from '../../../utils/delay';\nimport { env } from '../../../utils/env';\nimport { CommandError } from '../../../utils/errors';\nimport { confirmAsync } from '../../../utils/prompts';\n\n/** An error that is thrown when a package is installed but doesn't meet the version criteria. */\nexport class ExternalModuleVersionError extends CommandError {\n constructor(message: string, public readonly shouldGloballyInstall: boolean) {\n super('EXTERNAL_MODULE_VERSION', message);\n }\n}\n\ninterface PromptOptions {\n /** Should prompt the user to install, when false the module will just assert on missing packages, default `true`. Ignored when `autoInstall` is true. */\n shouldPrompt?: boolean;\n /** Should automatically install the package without prompting, default `false` */\n autoInstall?: boolean;\n}\n\nexport interface InstallPromptOptions extends PromptOptions {\n /** Should install the package globally, default `false` */\n shouldGloballyInstall?: boolean;\n}\n\nexport interface ResolvePromptOptions extends PromptOptions {\n /**\n * Prefer to install the package globally, this can be overridden if the function\n * detects that a locally installed package simply needs an upgrade, default `false`\n */\n prefersGlobalInstall?: boolean;\n}\n\n/** Resolves a local or globally installed package, prompts to install if missing. */\nexport class ExternalModule<TModule> {\n private instance: TModule | null = null;\n\n constructor(\n /** Project root for checking if the package is installed locally. */\n private projectRoot: string,\n /** Info on the external package. */\n private pkg: {\n /** NPM package name. */\n name: string;\n /** Required semver range, ex: `^1.0.0`. */\n versionRange: string;\n },\n /** A function used to create the installation prompt message. */\n private promptMessage: (pkgName: string) => string\n ) {}\n\n /** Resolve the globally or locally installed instance, or prompt to install. */\n async resolveAsync({\n prefersGlobalInstall,\n ...options\n }: ResolvePromptOptions = {}): Promise<TModule> {\n try {\n return (\n this.getVersioned() ??\n this.installAsync({\n ...options,\n shouldGloballyInstall: prefersGlobalInstall,\n })\n );\n } catch (error: any) {\n if (error instanceof ExternalModuleVersionError) {\n // If the module version in not compliant with the version range,\n // we should prompt the user to install the package where it already exists.\n return this.installAsync({\n ...options,\n shouldGloballyInstall: error.shouldGloballyInstall ?? prefersGlobalInstall,\n });\n }\n throw error;\n }\n }\n\n /** Prompt the user to install the package and try again. */\n async installAsync({\n shouldPrompt = true,\n autoInstall,\n shouldGloballyInstall,\n }: InstallPromptOptions = {}): Promise<TModule> {\n const packageName = [this.pkg.name, this.pkg.versionRange].join('@');\n if (!autoInstall) {\n // Delay the prompt so it doesn't conflict with other dev tool logs\n await delayAsync(100);\n }\n const answer =\n autoInstall ||\n (shouldPrompt &&\n (await confirmAsync({\n message: this.promptMessage(packageName),\n initial: true,\n })));\n if (answer) {\n Log.log(`Installing ${packageName}...`);\n\n // Always use npm for global installs\n const packageManager = shouldGloballyInstall\n ? new PackageManager.NpmPackageManager({\n cwd: this.projectRoot,\n log: Log.log,\n silent: !env.EXPO_DEBUG,\n })\n : PackageManager.createForProject(this.projectRoot, {\n silent: !env.EXPO_DEBUG,\n });\n\n try {\n if (shouldGloballyInstall) {\n await packageManager.addGlobalAsync(packageName);\n } else {\n await packageManager.addDevAsync(packageName);\n }\n Log.log(`Installed ${packageName}`);\n } catch (error: any) {\n error.message = `Failed to install ${packageName} ${\n shouldGloballyInstall ? 'globally' : 'locally'\n }: ${error.message}`;\n throw error;\n }\n return await this.resolveAsync({ shouldPrompt: false });\n }\n\n throw new CommandError(\n 'EXTERNAL_MODULE_AVAILABILITY',\n `Please install ${packageName} and try again`\n );\n }\n\n /** Get the module. */\n get(): TModule | null {\n try {\n return this.getVersioned();\n } catch {\n return null;\n }\n }\n\n /** Get the module, throws if the module is not versioned correctly. */\n getVersioned(): TModule | null {\n this.instance ??= this._resolveModule(true) ?? this._resolveModule(false);\n return this.instance;\n }\n\n /** Exposed for testing. */\n _require(moduleId: string): any {\n return require(moduleId);\n }\n\n /** Resolve a copy that's installed in the project. Exposed for testing. */\n _resolveLocal(moduleId: string): string {\n return resolveFrom(this.projectRoot, moduleId);\n }\n\n /** Resolve a copy that's installed globally. Exposed for testing. */\n _resolveGlobal(moduleId: string): string {\n return requireGlobal.resolve(moduleId);\n }\n\n /** Resolve the module and verify the version. Exposed for testing. */\n _resolveModule(isLocal: boolean): TModule | null {\n const resolver = isLocal ? this._resolveLocal.bind(this) : this._resolveGlobal.bind(this);\n try {\n const packageJsonPath = resolver(`${this.pkg.name}/package.json`);\n const packageJson = this._require(packageJsonPath);\n if (packageJson) {\n if (semver.satisfies(packageJson.version, this.pkg.versionRange)) {\n const modulePath = resolver(this.pkg.name);\n const requiredModule = this._require(modulePath);\n if (requiredModule == null) {\n throw new CommandError(\n 'EXTERNAL_MODULE_EXPORT',\n `${this.pkg.name} exports a nullish value, which is not allowed.`\n );\n }\n return requiredModule;\n }\n throw new ExternalModuleVersionError(\n `Required module '${this.pkg.name}@${packageJson.version}' does not satisfy ${this.pkg.versionRange}. Installed at: ${packageJsonPath}`,\n !isLocal\n );\n }\n } catch (error: any) {\n if (error instanceof CommandError) {\n throw error;\n } else if (error.code !== 'MODULE_NOT_FOUND') {\n Log.debug('[External Module] Failed to resolve module', error.message);\n }\n }\n return null;\n }\n}\n"],"names":["PackageManager","Log","ExternalModuleVersionError","CommandError","constructor","message","shouldGloballyInstall","ExternalModule","projectRoot","pkg","promptMessage","instance","resolveAsync","prefersGlobalInstall","options","getVersioned","installAsync","error","shouldPrompt","autoInstall","packageName","name","versionRange","join","delayAsync","answer","confirmAsync","initial","log","packageManager","NpmPackageManager","cwd","silent","env","EXPO_DEBUG","createForProject","addGlobalAsync","addDevAsync","get","_resolveModule","_require","moduleId","require","_resolveLocal","resolveFrom","_resolveGlobal","requireGlobal","resolve","isLocal","resolver","bind","packageJsonPath","packageJson","semver","satisfies","version","modulePath","requiredModule","code","debug"],"mappings":"AAAA;;;;AAAYA,IAAAA,cAAc,mCAAM,uBAAuB,EAA7B;AACA,IAAA,SAAU,kCAAV,UAAU,EAAA;AACZ,IAAA,YAAc,kCAAd,cAAc,EAAA;AACnB,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AAEfC,IAAAA,GAAG,mCAAM,cAAc,EAApB;AACY,IAAA,MAAsB,WAAtB,sBAAsB,CAAA;AAC7B,IAAA,IAAoB,WAApB,oBAAoB,CAAA;AACX,IAAA,OAAuB,WAAvB,uBAAuB,CAAA;AACvB,IAAA,QAAwB,WAAxB,wBAAwB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0IjD,IAAI;AAvID,MAAMC,0BAA0B,SAASC,OAAY,aAAA;IAC1DC,YAAYC,OAAe,EAAkBC,qBAA8B,CAAE;QAC3E,KAAK,CAAC,yBAAyB,EAAED,OAAO,CAAC,CAAC;aADCC,qBAA8B,GAA9BA,qBAA8B;KAE1E;CACF;QAJYJ,0BAA0B,GAA1BA,0BAA0B;AA2BhC,MAAMK,cAAc;IAGzBH,YAEUI,WAAmB,EAEnBC,GAKP,EAEOC,aAA0C,CAClD;aAVQF,WAAmB,GAAnBA,WAAmB;aAEnBC,GAKP,GALOA,GAKP;aAEOC,aAA0C,GAA1CA,aAA0C;aAb5CC,QAAQ,GAAmB,IAAI;KAcnC;IAEJ,gFAAgF,CAChF,MAAMC,YAAY,CAAC,EACjBC,oBAAoB,CAAA,EACpB,GAAGC,OAAO,EACW,GAAG,EAAE,EAAoB;QAC9C,IAAI;gBAEA,GAAmB;YADrB,OACE,CAAA,GAAmB,GAAnB,IAAI,CAACC,YAAY,EAA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AMoC,cAAc,GAAG,IAAI,CAACjB,QAAQ,CAACgB,UAAU,CAAC,AAAC;oBACjD,IAAIC,cAAc,IAAI,IAAI,EAAE;wBAC1B,MAAM,IAAItD,OAAY,aAAA,CACpB,wBAAwB,EACxB,CAAC,EAAE,IAAI,CAACM,GAAG,CAACY,IAAI,CAAC,+CAA+C,CAAC,CAClE,CAAC;qBACH;oBACD,OAAOoC,cAAc,CAAC;iBACvB;gBACD,MAAM,IAAIvD,0BAA0B,CAClC,CAAC,iBAAiB,EAAE,IAAI,CAACO,GAAG,CAACY,IAAI,CAAC,CAAC,EAAE+B,WAAW,CAACG,OAAO,CAAC,mBAAmB,EAAE,IAAI,CAAC9C,GAAG,CAACa,YAAY,CAAC,gBAAgB,EAAE6B,eAAe,CAAC,CAAC,EACvI,CAACH,OAAO,CACT,CAAC;aACH;SACF,CAAC,OAAO/B,KAAK,EAAO;YACnB,IAAIA,KAAK,YAAYd,OAAY,aAAA,EAAE;gBACjC,MAAMc,KAAK,CAAC;aACb,MAAM,IAAIA,KAAK,CAACyC,IAAI,KAAK,kBAAkB,EAAE;gBAC5CzD,GAAG,CAAC0D,KAAK,CAAC,4CAA4C,EAAE1C,KAAK,CAACZ,OAAO,CAAC,CAAC;aACxE;SACF;QACD,OAAO,IAAI,CAAC;KACb;CACF;QA/JYE,cAAc,GAAdA,cAAc"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
var _externalModule = require("./ExternalModule");
|
|
6
|
+
class NgrokResolver extends _externalModule.ExternalModule {
|
|
7
|
+
constructor(projectRoot){
|
|
8
|
+
super(projectRoot, {
|
|
9
|
+
name: "@expo/ngrok",
|
|
10
|
+
versionRange: "^4.1.0"
|
|
11
|
+
}, (packageName)=>`The package ${packageName} is required to use tunnels, would you like to install it globally?`
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.NgrokResolver = NgrokResolver;
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=NgrokResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/doctor/ngrok/NgrokResolver.ts"],"sourcesContent":["import { ExternalModule } from './ExternalModule';\n\nexport interface NgrokOptions {\n authtoken?: string;\n port?: string | number | null;\n host?: string;\n httpauth?: string;\n region?: string;\n configPath?: string;\n\n proto?: 'http' | 'tcp' | 'tls';\n addr?: string;\n inspect?: boolean;\n auth?: string;\n host_header?: string;\n bind_tls?: true | false | 'both';\n subdomain?: string;\n hostname?: string;\n crt?: string;\n key?: string;\n client_cas?: string;\n remote_addr?: string;\n}\n\nexport interface NgrokInstance {\n getActiveProcess(): { pid: number };\n connect(\n props: {\n hostname: string;\n configPath: string;\n onStatusChange: (status: string) => void;\n } & NgrokOptions\n ): Promise<string>;\n kill(): Promise<void>;\n}\n\n/** Resolves the ngrok instance from local or globally installed package. */\nexport class NgrokResolver extends ExternalModule<NgrokInstance> {\n constructor(projectRoot: string) {\n super(\n projectRoot,\n {\n name: '@expo/ngrok',\n versionRange: '^4.1.0',\n },\n (packageName) =>\n `The package ${packageName} is required to use tunnels, would you like to install it globally?`\n );\n }\n}\n"],"names":["NgrokResolver","ExternalModule","constructor","projectRoot","name","versionRange","packageName"],"mappings":"AAAA;;;;AAA+B,IAAA,eAAkB,WAAlB,kBAAkB,CAAA;AAqC1C,MAAMA,aAAa,SAASC,eAAc,eAAA;IAC/CC,YAAYC,WAAmB,CAAE;QAC/B,KAAK,CACHA,WAAW,EACX;YACEC,IAAI,EAAE,aAAa;YACnBC,YAAY,EAAE,QAAQ;SACvB,EACD,CAACC,WAAW,GACV,CAAC,YAAY,EAAEA,WAAW,CAAC,mEAAmE,CAAC;QAAA,CAClG,CAAC;KACH;CACF;QAZYN,aAAa,GAAbA,aAAa"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
var _promises = _interopRequireDefault(require("fs/promises"));
|
|
6
|
+
var _path = _interopRequireDefault(require("path"));
|
|
7
|
+
var Log = _interopRequireWildcard(require("../../../log"));
|
|
8
|
+
var _dir = require("../../../utils/dir");
|
|
9
|
+
var _env = require("../../../utils/env");
|
|
10
|
+
var _glob = require("../../../utils/glob");
|
|
11
|
+
var _prerequisite = require("../Prerequisite");
|
|
12
|
+
var _ensureDependenciesAsync = require("../dependencies/ensureDependenciesAsync");
|
|
13
|
+
var _updateTSConfig = require("./updateTSConfig");
|
|
14
|
+
function _interopRequireDefault(obj) {
|
|
15
|
+
return obj && obj.__esModule ? obj : {
|
|
16
|
+
default: obj
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function _interopRequireWildcard(obj) {
|
|
20
|
+
if (obj && obj.__esModule) {
|
|
21
|
+
return obj;
|
|
22
|
+
} else {
|
|
23
|
+
var newObj = {};
|
|
24
|
+
if (obj != null) {
|
|
25
|
+
for(var key in obj){
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
27
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
|
28
|
+
if (desc.get || desc.set) {
|
|
29
|
+
Object.defineProperty(newObj, key, desc);
|
|
30
|
+
} else {
|
|
31
|
+
newObj[key] = obj[key];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
newObj.default = obj;
|
|
37
|
+
return newObj;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
class TypeScriptProjectPrerequisite extends _prerequisite.ProjectPrerequisite {
|
|
41
|
+
/** Ensure a project that hasn't explicitly disabled web support has all the required packages for running in the browser. */ async assertImplementation() {
|
|
42
|
+
if (_env.env.EXPO_NO_TYPESCRIPT_SETUP) {
|
|
43
|
+
Log.warn("Skipping TypeScript setup: EXPO_NO_TYPESCRIPT_SETUP is enabled.");
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
Log.debug("Ensuring TypeScript support is setup");
|
|
47
|
+
const tsConfigPath = _path.default.join(this.projectRoot, "tsconfig.json");
|
|
48
|
+
// Ensure the project is TypeScript before continuing.
|
|
49
|
+
const intent = await this._getSetupRequirements();
|
|
50
|
+
if (!intent) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
// Ensure TypeScript packages are installed
|
|
54
|
+
await this._ensureDependenciesInstalledAsync();
|
|
55
|
+
// Update the config
|
|
56
|
+
await (0, _updateTSConfig).updateTSConfigAsync({
|
|
57
|
+
tsConfigPath,
|
|
58
|
+
isBootstrapping: intent.isBootstrapping
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/** Exposed for testing. */ async _getSetupRequirements() {
|
|
62
|
+
const tsConfigPath = await this._hasTSConfig();
|
|
63
|
+
// Enable TS setup if the project has a `tsconfig.json`
|
|
64
|
+
if (tsConfigPath) {
|
|
65
|
+
const content = await _promises.default.readFile(tsConfigPath, {
|
|
66
|
+
encoding: "utf8"
|
|
67
|
+
}).then((txt)=>txt.trim()
|
|
68
|
+
, // null when the file doesn't exist.
|
|
69
|
+
()=>null
|
|
70
|
+
);
|
|
71
|
+
const isBlankConfig = content === "" || content === "{}";
|
|
72
|
+
return {
|
|
73
|
+
isBootstrapping: isBlankConfig
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
// This is a somewhat heavy check in larger projects.
|
|
77
|
+
// Test that this is reasonably paced by running expo start in `expo/apps/native-component-list`
|
|
78
|
+
const typescriptFile = await this._queryFirstTypeScriptFileAsync();
|
|
79
|
+
if (typescriptFile) {
|
|
80
|
+
return {
|
|
81
|
+
isBootstrapping: true
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
/** Exposed for testing. */ async _ensureDependenciesInstalledAsync({ exp } = {}) {
|
|
87
|
+
try {
|
|
88
|
+
return await (0, _ensureDependenciesAsync).ensureDependenciesAsync(this.projectRoot, {
|
|
89
|
+
exp,
|
|
90
|
+
installMessage: `It looks like you're trying to use TypeScript but don't have the required dependencies installed.`,
|
|
91
|
+
warningMessage: "If you're not using TypeScript, please remove the TypeScript files from your project",
|
|
92
|
+
requiredPackages: [
|
|
93
|
+
// use typescript/package.json to skip node module cache issues when the user installs
|
|
94
|
+
// the package and attempts to resolve the module in the same process.
|
|
95
|
+
{
|
|
96
|
+
file: "typescript/package.json",
|
|
97
|
+
pkg: "typescript"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
file: "@types/react/index.d.ts",
|
|
101
|
+
pkg: "@types/react"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
file: "@types/react-native/index.d.ts",
|
|
105
|
+
pkg: "@types/react-native"
|
|
106
|
+
},
|
|
107
|
+
]
|
|
108
|
+
});
|
|
109
|
+
} catch (error) {
|
|
110
|
+
// Reset the cached check so we can re-run the check if the user re-runs the command by pressing 'w' in the Terminal UI.
|
|
111
|
+
this.resetAssertion();
|
|
112
|
+
throw error;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/** Return the first TypeScript file in the project. */ async _queryFirstTypeScriptFileAsync() {
|
|
116
|
+
const results = await (0, _glob).wrapGlobWithTimeout(()=>// TODO(Bacon): Use `everyMatch` since a bug causes `anyMatch` to return inaccurate results when used multiple times.
|
|
117
|
+
(0, _glob).everyMatchAsync("**/*.@(ts|tsx)", {
|
|
118
|
+
cwd: this.projectRoot,
|
|
119
|
+
ignore: [
|
|
120
|
+
"**/@(Carthage|Pods|node_modules)/**",
|
|
121
|
+
"**/*.d.ts",
|
|
122
|
+
"@(ios|android|web|web-build|dist)/**",
|
|
123
|
+
]
|
|
124
|
+
})
|
|
125
|
+
, 5000);
|
|
126
|
+
if (results === false) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
var ref;
|
|
130
|
+
return (ref = results[0]) != null ? ref : null;
|
|
131
|
+
}
|
|
132
|
+
async _hasTSConfig() {
|
|
133
|
+
const tsConfigPath = _path.default.join(this.projectRoot, "tsconfig.json");
|
|
134
|
+
if (await (0, _dir).fileExistsAsync(tsConfigPath)) {
|
|
135
|
+
return tsConfigPath;
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
exports.TypeScriptProjectPrerequisite = TypeScriptProjectPrerequisite;
|
|
141
|
+
|
|
142
|
+
//# sourceMappingURL=TypeScriptProjectPrerequisite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/doctor/typescript/TypeScriptProjectPrerequisite.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config';\nimport fs from 'fs/promises';\nimport path from 'path';\n\nimport * as Log from '../../../log';\nimport { fileExistsAsync } from '../../../utils/dir';\nimport { env } from '../../../utils/env';\nimport { everyMatchAsync, wrapGlobWithTimeout } from '../../../utils/glob';\nimport { ProjectPrerequisite } from '../Prerequisite';\nimport { ensureDependenciesAsync } from '../dependencies/ensureDependenciesAsync';\nimport { updateTSConfigAsync } from './updateTSConfig';\n\n/** Ensure the project has the required TypeScript support settings. */\nexport class TypeScriptProjectPrerequisite extends ProjectPrerequisite {\n /** Ensure a project that hasn't explicitly disabled web support has all the required packages for running in the browser. */\n async assertImplementation(): Promise<void> {\n if (env.EXPO_NO_TYPESCRIPT_SETUP) {\n Log.warn('Skipping TypeScript setup: EXPO_NO_TYPESCRIPT_SETUP is enabled.');\n return;\n }\n Log.debug('Ensuring TypeScript support is setup');\n\n const tsConfigPath = path.join(this.projectRoot, 'tsconfig.json');\n\n // Ensure the project is TypeScript before continuing.\n const intent = await this._getSetupRequirements();\n if (!intent) {\n return;\n }\n\n // Ensure TypeScript packages are installed\n await this._ensureDependenciesInstalledAsync();\n\n // Update the config\n await updateTSConfigAsync({ tsConfigPath, isBootstrapping: intent.isBootstrapping });\n }\n\n /** Exposed for testing. */\n async _getSetupRequirements(): Promise<{\n /** Indicates that TypeScript support is being bootstrapped. */\n isBootstrapping: boolean;\n } | null> {\n const tsConfigPath = await this._hasTSConfig();\n\n // Enable TS setup if the project has a `tsconfig.json`\n if (tsConfigPath) {\n const content = await fs.readFile(tsConfigPath, { encoding: 'utf8' }).then(\n (txt) => txt.trim(),\n // null when the file doesn't exist.\n () => null\n );\n const isBlankConfig = content === '' || content === '{}';\n return { isBootstrapping: isBlankConfig };\n }\n // This is a somewhat heavy check in larger projects.\n // Test that this is reasonably paced by running expo start in `expo/apps/native-component-list`\n const typescriptFile = await this._queryFirstTypeScriptFileAsync();\n if (typescriptFile) {\n return { isBootstrapping: true };\n }\n\n return null;\n }\n\n /** Exposed for testing. */\n async _ensureDependenciesInstalledAsync({ exp }: { exp?: ExpoConfig } = {}): Promise<boolean> {\n try {\n return await ensureDependenciesAsync(this.projectRoot, {\n exp,\n installMessage: `It looks like you're trying to use TypeScript but don't have the required dependencies installed.`,\n warningMessage:\n \"If you're not using TypeScript, please remove the TypeScript files from your project\",\n requiredPackages: [\n // use typescript/package.json to skip node module cache issues when the user installs\n // the package and attempts to resolve the module in the same process.\n { file: 'typescript/package.json', pkg: 'typescript' },\n { file: '@types/react/index.d.ts', pkg: '@types/react' },\n { file: '@types/react-native/index.d.ts', pkg: '@types/react-native' },\n ],\n });\n } catch (error) {\n // Reset the cached check so we can re-run the check if the user re-runs the command by pressing 'w' in the Terminal UI.\n this.resetAssertion();\n throw error;\n }\n }\n\n /** Return the first TypeScript file in the project. */\n async _queryFirstTypeScriptFileAsync(): Promise<null | string> {\n const results = await wrapGlobWithTimeout(\n () =>\n // TODO(Bacon): Use `everyMatch` since a bug causes `anyMatch` to return inaccurate results when used multiple times.\n everyMatchAsync('**/*.@(ts|tsx)', {\n cwd: this.projectRoot,\n ignore: [\n '**/@(Carthage|Pods|node_modules)/**',\n '**/*.d.ts',\n '@(ios|android|web|web-build|dist)/**',\n ],\n }),\n 5000\n );\n\n if (results === false) {\n return null;\n }\n return results[0] ?? null;\n }\n\n async _hasTSConfig(): Promise<string | null> {\n const tsConfigPath = path.join(this.projectRoot, 'tsconfig.json');\n if (await fileExistsAsync(tsConfigPath)) {\n return tsConfigPath;\n }\n return null;\n }\n}\n"],"names":["Log","TypeScriptProjectPrerequisite","ProjectPrerequisite","assertImplementation","env","EXPO_NO_TYPESCRIPT_SETUP","warn","debug","tsConfigPath","path","join","projectRoot","intent","_getSetupRequirements","_ensureDependenciesInstalledAsync","updateTSConfigAsync","isBootstrapping","_hasTSConfig","content","fs","readFile","encoding","then","txt","trim","isBlankConfig","typescriptFile","_queryFirstTypeScriptFileAsync","exp","ensureDependenciesAsync","installMessage","warningMessage","requiredPackages","file","pkg","error","resetAssertion","results","wrapGlobWithTimeout","everyMatchAsync","cwd","ignore","fileExistsAsync"],"mappings":"AAAA;;;;AACe,IAAA,SAAa,kCAAb,aAAa,EAAA;AACX,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEXA,IAAAA,GAAG,mCAAM,cAAc,EAApB;AACiB,IAAA,IAAoB,WAApB,oBAAoB,CAAA;AAChC,IAAA,IAAoB,WAApB,oBAAoB,CAAA;AACa,IAAA,KAAqB,WAArB,qBAAqB,CAAA;AACtC,IAAA,aAAiB,WAAjB,iBAAiB,CAAA;AACb,IAAA,wBAAyC,WAAzC,yCAAyC,CAAA;AAC7C,IAAA,eAAkB,WAAlB,kBAAkB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAG/C,MAAMC,6BAA6B,SAASC,aAAmB,oBAAA;IACpE,6HAA6H,CAC7H,MAAMC,oBAAoB,GAAkB;QAC1C,IAAIC,IAAG,IAAA,CAACC,wBAAwB,EAAE;YAChCL,GAAG,CAACM,IAAI,CAAC,iEAAiE,CAAC,CAAC;YAC5E,OAAO;SACR;QACDN,GAAG,CAACO,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAElD,MAAMC,YAAY,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AAAC;QAClE,IAAI,MAAM+B,CAAAA,GAAAA,IAAe,AAAc,CAAA,gBAAd,CAAClC,YAAY,CAAC,EAAE;YACvC,OAAOA,YAAY,CAAC;SACrB;QACD,OAAO,IAAI,CAAC;KACb;CACF;QAvGYP,6BAA6B,GAA7BA,6BAA6B"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.updateTSConfigAsync = updateTSConfigAsync;
|
|
6
|
+
exports.baseTSConfigName = void 0;
|
|
7
|
+
var _jsonFile = _interopRequireDefault(require("@expo/json-file"));
|
|
8
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
9
|
+
var Log = _interopRequireWildcard(require("../../../log"));
|
|
10
|
+
function _interopRequireDefault(obj) {
|
|
11
|
+
return obj && obj.__esModule ? obj : {
|
|
12
|
+
default: obj
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function _interopRequireWildcard(obj) {
|
|
16
|
+
if (obj && obj.__esModule) {
|
|
17
|
+
return obj;
|
|
18
|
+
} else {
|
|
19
|
+
var newObj = {};
|
|
20
|
+
if (obj != null) {
|
|
21
|
+
for(var key in obj){
|
|
22
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
23
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
|
24
|
+
if (desc.get || desc.set) {
|
|
25
|
+
Object.defineProperty(newObj, key, desc);
|
|
26
|
+
} else {
|
|
27
|
+
newObj[key] = obj[key];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
newObj.default = obj;
|
|
33
|
+
return newObj;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const baseTSConfigName = "expo/tsconfig.base";
|
|
37
|
+
exports.baseTSConfigName = baseTSConfigName;
|
|
38
|
+
async function updateTSConfigAsync({ tsConfigPath , isBootstrapping }) {
|
|
39
|
+
if (isBootstrapping) {
|
|
40
|
+
await _jsonFile.default.writeAsync(tsConfigPath, {});
|
|
41
|
+
}
|
|
42
|
+
const projectTSConfig = _jsonFile.default.read(tsConfigPath, {
|
|
43
|
+
// Some tsconfig.json files have a generated comment in the file.
|
|
44
|
+
json5: true
|
|
45
|
+
});
|
|
46
|
+
if (projectTSConfig.compilerOptions == null) {
|
|
47
|
+
projectTSConfig.compilerOptions = {};
|
|
48
|
+
isBootstrapping = true;
|
|
49
|
+
}
|
|
50
|
+
const modifications = [];
|
|
51
|
+
// If the extends field isn't defined, set it to the expo default
|
|
52
|
+
if (!projectTSConfig.extends) {
|
|
53
|
+
// if (projectTSConfig.extends !== baseTSConfigName) {
|
|
54
|
+
projectTSConfig.extends = baseTSConfigName;
|
|
55
|
+
modifications.push([
|
|
56
|
+
"extends",
|
|
57
|
+
baseTSConfigName
|
|
58
|
+
]);
|
|
59
|
+
}
|
|
60
|
+
// If no changes, then quietly bail out
|
|
61
|
+
if (!modifications.length) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
// Write changes and log out a summary of what changed
|
|
65
|
+
await _jsonFile.default.writeAsync(tsConfigPath, projectTSConfig);
|
|
66
|
+
Log.log();
|
|
67
|
+
if (isBootstrapping) {
|
|
68
|
+
Log.log(_chalk.default`{bold TypeScript}: A {cyan tsconfig.json} has been auto-generated`);
|
|
69
|
+
} else {
|
|
70
|
+
Log.log(_chalk.default`{bold TypeScript}: The {cyan tsconfig.json} has been updated {dim (Use EXPO_NO_TYPESCRIPT_SETUP to skip)}`);
|
|
71
|
+
logModifications(modifications);
|
|
72
|
+
}
|
|
73
|
+
Log.log();
|
|
74
|
+
}
|
|
75
|
+
function logModifications(modifications) {
|
|
76
|
+
Log.log();
|
|
77
|
+
Log.log(`\u203A {bold Required} modifications made to the {cyan tsconfig.json}:`);
|
|
78
|
+
Log.log();
|
|
79
|
+
// Sort the items based on key name length
|
|
80
|
+
printTable(modifications.sort((a, b)=>a[0].length - b[0].length
|
|
81
|
+
));
|
|
82
|
+
Log.log();
|
|
83
|
+
}
|
|
84
|
+
function printTable(items) {
|
|
85
|
+
const tableFormat = (name, msg)=>` ${_chalk.default.bold`${name}`} is now ${_chalk.default.cyan(msg)}`
|
|
86
|
+
;
|
|
87
|
+
for (const [key, value] of items){
|
|
88
|
+
Log.log(tableFormat(key, value));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=updateTSConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/doctor/typescript/updateTSConfig.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport chalk from 'chalk';\n\nimport * as Log from '../../../log';\n\nexport const baseTSConfigName = 'expo/tsconfig.base';\n\nexport async function updateTSConfigAsync({\n tsConfigPath,\n isBootstrapping,\n}: {\n tsConfigPath: string;\n isBootstrapping: boolean;\n}): Promise<void> {\n if (isBootstrapping) {\n await JsonFile.writeAsync(tsConfigPath, {});\n }\n\n const projectTSConfig = JsonFile.read(tsConfigPath, {\n // Some tsconfig.json files have a generated comment in the file.\n json5: true,\n });\n if (projectTSConfig.compilerOptions == null) {\n projectTSConfig.compilerOptions = {};\n isBootstrapping = true;\n }\n\n const modifications: [string, string][] = [];\n\n // If the extends field isn't defined, set it to the expo default\n if (!projectTSConfig.extends) {\n // if (projectTSConfig.extends !== baseTSConfigName) {\n projectTSConfig.extends = baseTSConfigName;\n modifications.push(['extends', baseTSConfigName]);\n }\n\n // If no changes, then quietly bail out\n if (!modifications.length) {\n return;\n }\n\n // Write changes and log out a summary of what changed\n await JsonFile.writeAsync(tsConfigPath, projectTSConfig);\n\n Log.log();\n\n if (isBootstrapping) {\n Log.log(chalk`{bold TypeScript}: A {cyan tsconfig.json} has been auto-generated`);\n } else {\n Log.log(\n chalk`{bold TypeScript}: The {cyan tsconfig.json} has been updated {dim (Use EXPO_NO_TYPESCRIPT_SETUP to skip)}`\n );\n logModifications(modifications);\n }\n Log.log();\n}\n\nfunction logModifications(modifications: string[][]) {\n Log.log();\n\n Log.log(`\\u203A {bold Required} modifications made to the {cyan tsconfig.json}:`);\n\n Log.log();\n\n // Sort the items based on key name length\n printTable(modifications.sort((a, b) => a[0].length - b[0].length));\n\n Log.log();\n}\n\nfunction printTable(items: string[][]) {\n const tableFormat = (name: string, msg: string) =>\n ` ${chalk.bold`${name}`} is now ${chalk.cyan(msg)}`;\n for (const [key, value] of items) {\n Log.log(tableFormat(key, value));\n }\n}\n"],"names":["updateTSConfigAsync","Log","baseTSConfigName","tsConfigPath","isBootstrapping","JsonFile","writeAsync","projectTSConfig","read","json5","compilerOptions","modifications","extends","push","length","log","chalk","logModifications","printTable","sort","a","b","items","tableFormat","name","msg","bold","cyan","key","value"],"mappings":"AAAA;;;;QAOsBA,mBAAmB,GAAnBA,mBAAmB;;AAPpB,IAAA,SAAiB,kCAAjB,iBAAiB,EAAA;AACpB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEbC,IAAAA,GAAG,mCAAM,cAAc,EAApB;;;;;;;;;;;;;;;;;;;;;;;;;;;AAER,MAAMC,gBAAgB,GAAG,oBAAoB,AAAC;QAAxCA,gBAAgB,GAAhBA,gBAAgB;AAEtB,eAAeF,mBAAmB,CAAC,EACxCG,YAAY,CAAA,EACZC,eAAe,CAAA,EAIhB,EAAiB;IAChB,IAAIA,eAAe,EAAE;QACnB,MAAMC,SAAQ,QAAA,CAACC,UAAU,CAACH,YAAY,EAAE,EAAE,CAAC,CAAC;KAC7C;IAED,MAAMI,eAAe,GAAGF,SAAQ,QAAA,CAACG,IAAI,CAACL,YAAY,EAAE;QAClD,iEAAiE;QACjEM,KAAK,EAAE,IAAI;KACZ,CAAC,AAAC;IACH,IAAIF,eAAe,CAACG,eAAe,IAAI,IAAI,EAAE;QAC3CH,eAAe,CAACG,eAAe,GAAG,EAAE,CAAC;QACrCN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AAY,EAAEC,GAAW,GAC5C,CAAC,EAAE,EAAET,MAAK,QAAA,CAACU,IAAI,CAAC,EAAEF,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAER,MAAK,QAAA,CAACW,IAAI,CAACF,GAAG,CAAC,CAAC,CAAC;IAAC;IACvD,KAAK,MAAM,CAACG,GAAG,EAAEC,KAAK,CAAC,IAAIP,KAAK,CAAE;QAChCrB,GAAG,CAACc,GAAG,CAACQ,WAAW,CAACK,GAAG,EAAEC,KAAK,CAAC,CAAC,CAAC;KAClC;CACF"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.isWebPlatformExcluded = isWebPlatformExcluded;
|
|
6
|
+
var _config = require("@expo/config");
|
|
7
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
8
|
+
var Log = _interopRequireWildcard(require("../../../log"));
|
|
9
|
+
var _env = require("../../../utils/env");
|
|
10
|
+
var _prerequisite = require("../Prerequisite");
|
|
11
|
+
var _ensureDependenciesAsync = require("../dependencies/ensureDependenciesAsync");
|
|
12
|
+
function _interopRequireDefault(obj) {
|
|
13
|
+
return obj && obj.__esModule ? obj : {
|
|
14
|
+
default: obj
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function _interopRequireWildcard(obj) {
|
|
18
|
+
if (obj && obj.__esModule) {
|
|
19
|
+
return obj;
|
|
20
|
+
} else {
|
|
21
|
+
var newObj = {};
|
|
22
|
+
if (obj != null) {
|
|
23
|
+
for(var key in obj){
|
|
24
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
25
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
|
26
|
+
if (desc.get || desc.set) {
|
|
27
|
+
Object.defineProperty(newObj, key, desc);
|
|
28
|
+
} else {
|
|
29
|
+
newObj[key] = obj[key];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
newObj.default = obj;
|
|
35
|
+
return newObj;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
class WebSupportProjectPrerequisite extends _prerequisite.ProjectPrerequisite {
|
|
39
|
+
/** Ensure a project that hasn't explicitly disabled web support has all the required packages for running in the browser. */ async assertImplementation() {
|
|
40
|
+
if (_env.env.EXPO_NO_WEB_SETUP) {
|
|
41
|
+
Log.warn("Skipping web setup: EXPO_NO_WEB_SETUP is enabled.");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
Log.debug("Ensuring web support is setup");
|
|
45
|
+
const result = await this._shouldSetupWebSupportAsync();
|
|
46
|
+
// Ensure web packages are installed
|
|
47
|
+
await this._ensureWebDependenciesInstalledAsync({
|
|
48
|
+
exp: result.exp
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/** Exposed for testing. */ async _shouldSetupWebSupportAsync() {
|
|
52
|
+
const config = (0, _config).getConfig(this.projectRoot);
|
|
53
|
+
// Detect if the 'web' string is purposefully missing from the platforms array.
|
|
54
|
+
if (isWebPlatformExcluded(config.rootConfig)) {
|
|
55
|
+
// Get exact config description with paths.
|
|
56
|
+
const configName = (0, _config).getProjectConfigDescriptionWithPaths(this.projectRoot, config);
|
|
57
|
+
throw new _prerequisite.PrerequisiteCommandError("WEB_SUPPORT", _chalk.default`Skipping web setup: {bold "web"} is not included in the project ${configName} {bold "platforms"} array.`);
|
|
58
|
+
}
|
|
59
|
+
return config;
|
|
60
|
+
}
|
|
61
|
+
/** Exposed for testing. */ async _ensureWebDependenciesInstalledAsync({ exp }) {
|
|
62
|
+
try {
|
|
63
|
+
return await (0, _ensureDependenciesAsync).ensureDependenciesAsync(this.projectRoot, {
|
|
64
|
+
exp,
|
|
65
|
+
installMessage: `It looks like you're trying to use web support but don't have the required dependencies installed.`,
|
|
66
|
+
warningMessage: _chalk.default`If you're not using web, please remove the {bold "web"} string from the platforms array in the project Expo config.`,
|
|
67
|
+
requiredPackages: [
|
|
68
|
+
// use react-native-web/package.json to skip node module cache issues when the user installs
|
|
69
|
+
// the package and attempts to resolve the module in the same process.
|
|
70
|
+
{
|
|
71
|
+
file: "react-native-web/package.json",
|
|
72
|
+
pkg: "react-native-web",
|
|
73
|
+
version: "~0.17.1"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
file: "react-dom/package.json",
|
|
77
|
+
pkg: "react-dom",
|
|
78
|
+
version: "^17.0.1"
|
|
79
|
+
},
|
|
80
|
+
// `webpack` and `webpack-dev-server` should be installed in the `@expo/webpack-config`
|
|
81
|
+
// package, but just in case we'll do the check now.
|
|
82
|
+
{
|
|
83
|
+
file: "webpack-dev-server/package.json",
|
|
84
|
+
// https://github.com/expo/expo-cli/pull/4282
|
|
85
|
+
pkg: "webpack-dev-server",
|
|
86
|
+
version: "~3.11.0",
|
|
87
|
+
dev: true
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
file: "@expo/webpack-config/package.json",
|
|
91
|
+
pkg: "@expo/webpack-config",
|
|
92
|
+
version: "~0.16.2",
|
|
93
|
+
dev: true
|
|
94
|
+
},
|
|
95
|
+
]
|
|
96
|
+
});
|
|
97
|
+
} catch (error) {
|
|
98
|
+
// Reset the cached check so we can re-run the check if the user re-runs the command by pressing 'w' in the Terminal UI.
|
|
99
|
+
this.resetAssertion();
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.WebSupportProjectPrerequisite = WebSupportProjectPrerequisite;
|
|
105
|
+
function isWebPlatformExcluded(rootConfig) {
|
|
106
|
+
var ref, ref1, ref2;
|
|
107
|
+
// Detect if the 'web' string is purposefully missing from the platforms array.
|
|
108
|
+
const isWebExcluded = Array.isArray((ref = rootConfig.expo) == null ? void 0 : ref.platforms) && !!((ref1 = rootConfig.expo) == null ? void 0 : ref1.platforms.length) && !((ref2 = rootConfig.expo) == null ? void 0 : ref2.platforms.includes("web"));
|
|
109
|
+
return isWebExcluded;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
//# sourceMappingURL=WebSupportProjectPrerequisite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/doctor/web/WebSupportProjectPrerequisite.ts"],"sourcesContent":["import {\n AppJSONConfig,\n ExpoConfig,\n getConfig,\n getProjectConfigDescriptionWithPaths,\n ProjectConfig,\n} from '@expo/config';\nimport chalk from 'chalk';\n\nimport * as Log from '../../../log';\nimport { env } from '../../../utils/env';\nimport { PrerequisiteCommandError, ProjectPrerequisite } from '../Prerequisite';\nimport { ensureDependenciesAsync } from '../dependencies/ensureDependenciesAsync';\n\n/** Ensure the project has the required web support settings. */\nexport class WebSupportProjectPrerequisite extends ProjectPrerequisite {\n /** Ensure a project that hasn't explicitly disabled web support has all the required packages for running in the browser. */\n async assertImplementation(): Promise<void> {\n if (env.EXPO_NO_WEB_SETUP) {\n Log.warn('Skipping web setup: EXPO_NO_WEB_SETUP is enabled.');\n return;\n }\n Log.debug('Ensuring web support is setup');\n\n const result = await this._shouldSetupWebSupportAsync();\n\n // Ensure web packages are installed\n await this._ensureWebDependenciesInstalledAsync({ exp: result.exp });\n }\n\n /** Exposed for testing. */\n async _shouldSetupWebSupportAsync(): Promise<ProjectConfig> {\n const config = getConfig(this.projectRoot);\n\n // Detect if the 'web' string is purposefully missing from the platforms array.\n if (isWebPlatformExcluded(config.rootConfig)) {\n // Get exact config description with paths.\n const configName = getProjectConfigDescriptionWithPaths(this.projectRoot, config);\n throw new PrerequisiteCommandError(\n 'WEB_SUPPORT',\n chalk`Skipping web setup: {bold \"web\"} is not included in the project ${configName} {bold \"platforms\"} array.`\n );\n }\n\n return config;\n }\n\n /** Exposed for testing. */\n async _ensureWebDependenciesInstalledAsync({ exp }: { exp: ExpoConfig }): Promise<boolean> {\n try {\n return await ensureDependenciesAsync(this.projectRoot, {\n exp,\n installMessage: `It looks like you're trying to use web support but don't have the required dependencies installed.`,\n warningMessage: chalk`If you're not using web, please remove the {bold \"web\"} string from the platforms array in the project Expo config.`,\n requiredPackages: [\n // use react-native-web/package.json to skip node module cache issues when the user installs\n // the package and attempts to resolve the module in the same process.\n { file: 'react-native-web/package.json', pkg: 'react-native-web', version: '~0.17.1' },\n { file: 'react-dom/package.json', pkg: 'react-dom', version: '^17.0.1' },\n // `webpack` and `webpack-dev-server` should be installed in the `@expo/webpack-config`\n // package, but just in case we'll do the check now.\n {\n file: 'webpack-dev-server/package.json',\n // https://github.com/expo/expo-cli/pull/4282\n pkg: 'webpack-dev-server',\n version: '~3.11.0',\n dev: true,\n },\n {\n file: '@expo/webpack-config/package.json',\n pkg: '@expo/webpack-config',\n version: '~0.16.2',\n dev: true,\n },\n ],\n });\n } catch (error) {\n // Reset the cached check so we can re-run the check if the user re-runs the command by pressing 'w' in the Terminal UI.\n this.resetAssertion();\n throw error;\n }\n }\n}\n\n/** Return `true` if the `web` platform is purposefully excluded from the project Expo config. */\nexport function isWebPlatformExcluded(rootConfig: AppJSONConfig): boolean {\n // Detect if the 'web' string is purposefully missing from the platforms array.\n const isWebExcluded =\n Array.isArray(rootConfig.expo?.platforms) &&\n !!rootConfig.expo?.platforms.length &&\n !rootConfig.expo?.platforms.includes('web');\n return isWebExcluded;\n}\n"],"names":["isWebPlatformExcluded","Log","WebSupportProjectPrerequisite","ProjectPrerequisite","assertImplementation","env","EXPO_NO_WEB_SETUP","warn","debug","result","_shouldSetupWebSupportAsync","_ensureWebDependenciesInstalledAsync","exp","config","getConfig","projectRoot","rootConfig","configName","getProjectConfigDescriptionWithPaths","PrerequisiteCommandError","chalk","ensureDependenciesAsync","installMessage","warningMessage","requiredPackages","file","pkg","version","dev","error","resetAssertion","isWebExcluded","Array","isArray","expo","platforms","length","includes"],"mappings":"AAAA;;;;QAqFgBA,qBAAqB,GAArBA,qBAAqB;AA/E9B,IAAA,OAAc,WAAd,cAAc,CAA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