@expo/cli 0.11.1 → 0.13.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 +2 -2
- package/build/src/api/getExpoGoIntermediateCertificate.js +1 -1
- package/build/src/api/getExpoGoIntermediateCertificate.js.map +1 -1
- package/build/src/api/getExpoSchema.js +1 -1
- package/build/src/api/getExpoSchema.js.map +1 -1
- package/build/src/api/getNativeModuleVersions.js +1 -1
- package/build/src/api/getNativeModuleVersions.js.map +1 -1
- package/build/src/api/getProjectDevelopmentCertificate.js +1 -1
- package/build/src/api/getProjectDevelopmentCertificate.js.map +1 -1
- package/build/src/api/getVersions.js +1 -1
- package/build/src/api/getVersions.js.map +1 -1
- package/build/src/api/rest/cache/wrapFetchWithCache.js.map +1 -1
- package/build/src/api/rest/client.js +5 -5
- package/build/src/api/rest/client.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithOffline.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithProgress.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithProxy.js.map +1 -1
- package/build/src/api/updateDevelopmentSession.js +1 -1
- package/build/src/api/updateDevelopmentSession.js.map +1 -1
- package/build/src/api/user/actions.js +2 -2
- package/build/src/api/user/actions.js.map +1 -1
- package/build/src/api/user/otp.js +1 -1
- package/build/src/api/user/otp.js.map +1 -1
- package/build/src/api/user/user.js +2 -2
- package/build/src/api/user/user.js.map +1 -1
- package/build/src/config/configAsync.js +17 -1
- package/build/src/config/configAsync.js.map +1 -1
- package/build/src/customize/customizeAsync.js +1 -1
- package/build/src/customize/customizeAsync.js.map +1 -1
- package/build/src/customize/generate.js +29 -2
- package/build/src/customize/generate.js.map +1 -1
- package/build/src/customize/templates.js +8 -0
- package/build/src/customize/templates.js.map +1 -1
- package/build/src/customize/typescript.js +54 -0
- package/build/src/customize/typescript.js.map +1 -0
- package/build/src/export/createBundles.js +1 -31
- package/build/src/export/createBundles.js.map +1 -1
- package/build/src/export/createMetadataJson.js.map +1 -1
- package/build/src/export/embed/exportEmbedAsync.js +52 -4
- package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
- package/build/src/export/embed/index.js +1 -3
- package/build/src/export/embed/index.js.map +1 -1
- package/build/src/export/embed/resolveOptions.js +6 -10
- package/build/src/export/embed/resolveOptions.js.map +1 -1
- package/build/src/export/exportApp.js +73 -46
- package/build/src/export/exportApp.js.map +1 -1
- package/build/src/export/exportAssets.js +4 -4
- package/build/src/export/exportAssets.js.map +1 -1
- package/build/src/export/exportAsync.js +1 -1
- package/build/src/export/exportAsync.js.map +1 -1
- package/build/src/export/exportHermes.js +204 -0
- package/build/src/export/exportHermes.js.map +1 -0
- package/build/src/export/exportStaticAsync.js +48 -14
- package/build/src/export/exportStaticAsync.js.map +1 -1
- package/build/src/export/favicon.js +7 -7
- package/build/src/export/favicon.js.map +1 -1
- package/build/src/export/fork-bundleAsync.js +35 -12
- package/build/src/export/fork-bundleAsync.js.map +1 -1
- package/build/src/export/getPublicExpoManifest.js +1 -1
- package/build/src/export/getPublicExpoManifest.js.map +1 -1
- package/build/src/export/getResolvedLocales.js.map +1 -1
- package/build/src/export/persistMetroAssets.js +118 -0
- package/build/src/export/persistMetroAssets.js.map +1 -0
- package/build/src/export/printBundleSizes.js.map +1 -1
- package/build/src/export/saveAssets.js.map +1 -1
- package/build/src/export/web/exportWebAsync.js.map +1 -1
- package/build/src/export/writeContents.js +5 -1
- package/build/src/export/writeContents.js.map +1 -1
- package/build/src/install/checkPackages.js +1 -1
- package/build/src/install/checkPackages.js.map +1 -1
- package/build/src/install/index.js +1 -0
- package/build/src/install/index.js.map +1 -1
- package/build/src/install/installAsync.js +2 -1
- package/build/src/install/installAsync.js.map +1 -1
- package/build/src/install/resolveOptions.js +7 -4
- package/build/src/install/resolveOptions.js.map +1 -1
- package/build/src/prebuild/configureProjectAsync.js +5 -9
- package/build/src/prebuild/configureProjectAsync.js.map +1 -1
- package/build/src/prebuild/index.js +2 -0
- package/build/src/prebuild/index.js.map +1 -1
- package/build/src/prebuild/prebuildAsync.js +7 -6
- package/build/src/prebuild/prebuildAsync.js.map +1 -1
- package/build/src/prebuild/resolveOptions.js +4 -2
- package/build/src/prebuild/resolveOptions.js.map +1 -1
- package/build/src/prebuild/updateFromTemplate.js +8 -5
- package/build/src/prebuild/updateFromTemplate.js.map +1 -1
- package/build/src/register/registerAsync.js +0 -1
- package/build/src/register/registerAsync.js.map +1 -1
- package/build/src/run/android/resolveInstallApkName.js.map +1 -1
- package/build/src/run/android/resolveOptions.js +1 -1
- package/build/src/run/android/resolveOptions.js.map +1 -1
- package/build/src/run/android/runAndroidAsync.js +7 -2
- package/build/src/run/android/runAndroidAsync.js.map +1 -1
- package/build/src/run/ios/XcodeBuild.js +2 -2
- package/build/src/run/ios/XcodeBuild.js.map +1 -1
- package/build/src/run/ios/appleDevice/AppleDevice.js +4 -4
- package/build/src/run/ios/appleDevice/AppleDevice.js.map +1 -1
- package/build/src/run/ios/appleDevice/ClientManager.js +1 -1
- package/build/src/run/ios/appleDevice/ClientManager.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/AFCClient.js +1 -1
- package/build/src/run/ios/appleDevice/client/AFCClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/DebugserverClient.js +1 -1
- package/build/src/run/ios/appleDevice/client/DebugserverClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/InstallationProxyClient.js +1 -1
- package/build/src/run/ios/appleDevice/client/InstallationProxyClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/LockdowndClient.js +1 -1
- package/build/src/run/ios/appleDevice/client/LockdowndClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/MobileImageMounterClient.js +1 -1
- package/build/src/run/ios/appleDevice/client/MobileImageMounterClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/ServiceClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/UsbmuxdClient.js +1 -1
- package/build/src/run/ios/appleDevice/client/UsbmuxdClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/installOnDeviceAsync.js +1 -1
- package/build/src/run/ios/appleDevice/installOnDeviceAsync.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/AFCProtocol.js +1 -1
- package/build/src/run/ios/appleDevice/protocol/AFCProtocol.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/AbstractProtocol.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/GDBProtocol.js +1 -1
- package/build/src/run/ios/appleDevice/protocol/GDBProtocol.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/LockdownProtocol.js +1 -1
- package/build/src/run/ios/appleDevice/protocol/LockdownProtocol.js.map +1 -1
- package/build/src/run/ios/codeSigning/configureCodeSigning.js +1 -1
- package/build/src/run/ios/codeSigning/configureCodeSigning.js.map +1 -1
- package/build/src/run/ios/codeSigning/resolveCertificateSigningIdentity.js +2 -2
- package/build/src/run/ios/codeSigning/resolveCertificateSigningIdentity.js.map +1 -1
- package/build/src/run/ios/codeSigning/xcodeCodeSigning.js +3 -0
- package/build/src/run/ios/codeSigning/xcodeCodeSigning.js.map +1 -1
- package/build/src/run/ios/index.js.map +1 -1
- package/build/src/run/ios/launchApp.js +2 -2
- package/build/src/run/ios/launchApp.js.map +1 -1
- package/build/src/run/ios/options/resolveDevice.js +1 -1
- package/build/src/run/ios/options/resolveDevice.js.map +1 -1
- package/build/src/run/ios/options/resolveOptions.js +2 -2
- package/build/src/run/ios/options/resolveOptions.js.map +1 -1
- package/build/src/run/ios/runIosAsync.js +8 -3
- package/build/src/run/ios/runIosAsync.js.map +1 -1
- package/build/src/start/doctor/apple/XcodePrerequisite.js +43 -2
- package/build/src/start/doctor/apple/XcodePrerequisite.js.map +1 -1
- package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js +1 -1
- package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js.map +1 -1
- package/build/src/start/doctor/dependencies/getVersionedPackages.js +5 -3
- package/build/src/start/doctor/dependencies/getVersionedPackages.js.map +1 -1
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js +1 -1
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js.map +1 -1
- package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -1
- package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js +7 -7
- package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js.map +1 -1
- package/build/src/start/doctor/typescript/updateTSConfig.js +11 -10
- package/build/src/start/doctor/typescript/updateTSConfig.js.map +1 -1
- package/build/src/start/index.js +0 -2
- package/build/src/start/index.js.map +1 -1
- package/build/src/start/interface/interactiveActions.js +4 -4
- package/build/src/start/interface/interactiveActions.js.map +1 -1
- package/build/src/start/interface/startInterface.js +3 -3
- package/build/src/start/interface/startInterface.js.map +1 -1
- package/build/src/start/platforms/ExpoGoInstaller.js.map +1 -1
- package/build/src/start/platforms/PlatformManager.js.map +1 -1
- package/build/src/start/platforms/android/ADBServer.js +1 -1
- package/build/src/start/platforms/android/ADBServer.js.map +1 -1
- package/build/src/start/platforms/android/AndroidDeviceManager.js +5 -5
- package/build/src/start/platforms/android/AndroidDeviceManager.js.map +1 -1
- package/build/src/start/platforms/android/AndroidPlatformManager.js +1 -1
- package/build/src/start/platforms/android/AndroidPlatformManager.js.map +1 -1
- package/build/src/start/platforms/android/adb.js +1 -1
- package/build/src/start/platforms/android/adb.js.map +1 -1
- package/build/src/start/platforms/android/adbReverse.js +2 -2
- package/build/src/start/platforms/android/adbReverse.js.map +1 -1
- package/build/src/start/platforms/android/emulator.js +1 -1
- package/build/src/start/platforms/android/emulator.js.map +1 -1
- package/build/src/start/platforms/android/getDevices.js +1 -1
- package/build/src/start/platforms/android/getDevices.js.map +1 -1
- package/build/src/start/platforms/android/promptAndroidDevice.js +1 -1
- package/build/src/start/platforms/android/promptAndroidDevice.js.map +1 -1
- package/build/src/start/platforms/ios/AppleDeviceManager.js +5 -5
- package/build/src/start/platforms/ios/AppleDeviceManager.js.map +1 -1
- package/build/src/start/platforms/ios/ApplePlatformManager.js +1 -1
- package/build/src/start/platforms/ios/ApplePlatformManager.js.map +1 -1
- package/build/src/start/platforms/ios/ensureSimulatorAppRunning.js.map +1 -1
- package/build/src/start/platforms/ios/getBestSimulator.js +1 -1
- package/build/src/start/platforms/ios/getBestSimulator.js.map +1 -1
- package/build/src/start/platforms/ios/promptAppleDevice.js +1 -1
- package/build/src/start/platforms/ios/promptAppleDevice.js.map +1 -1
- package/build/src/start/platforms/ios/simctl.js +1 -1
- package/build/src/start/platforms/ios/simctl.js.map +1 -1
- package/build/src/start/platforms/ios/simctlLogging.js +1 -1
- package/build/src/start/platforms/ios/simctlLogging.js.map +1 -1
- package/build/src/start/resolveOptions.js +0 -5
- package/build/src/start/resolveOptions.js.map +1 -1
- package/build/src/start/server/AsyncNgrok.js +4 -3
- package/build/src/start/server/AsyncNgrok.js.map +1 -1
- package/build/src/start/server/BundlerDevServer.js +4 -11
- package/build/src/start/server/BundlerDevServer.js.map +1 -1
- package/build/src/start/server/DevServerManager.js +3 -2
- package/build/src/start/server/DevServerManager.js.map +1 -1
- package/build/src/start/server/UrlCreator.js +2 -1
- package/build/src/start/server/UrlCreator.js.map +1 -1
- package/build/src/start/server/getStaticRenderFunctions.js +3 -12
- package/build/src/start/server/getStaticRenderFunctions.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +57 -36
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/MetroTerminalReporter.js +15 -4
- package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
- 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/inspector-proxy/device.js.map +1 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/NetworkResponse.js.map +1 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/PageReload.js.map +1 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerGetPossibleBreakpoints.js.map +1 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerScriptParsed.js.map +1 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerSetBreakpointByUrl.js.map +1 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/VscodeRuntimeGetProperties.js.map +1 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/types.js.map +1 -1
- package/build/src/start/server/metro/inspector-proxy/index.js +1 -1
- package/build/src/start/server/metro/inspector-proxy/index.js.map +1 -1
- package/build/src/start/server/metro/instantiateMetro.js +74 -13
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/start/server/metro/metroErrorInterface.js.map +1 -1
- package/build/src/start/server/metro/resolveFromProject.js +13 -4
- package/build/src/start/server/metro/resolveFromProject.js.map +1 -1
- package/build/src/start/server/metro/runServer-fork.js +1 -1
- package/build/src/start/server/metro/runServer-fork.js.map +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js +43 -5
- package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
- package/build/src/start/server/metro/withMetroResolvers.js +1 -1
- package/build/src/start/server/metro/withMetroResolvers.js.map +1 -1
- package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js +3 -3
- package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ExpoMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/FaviconMiddleware.js +1 -1
- package/build/src/start/server/middleware/FaviconMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/InterstitialPageMiddleware.js +3 -3
- package/build/src/start/server/middleware/InterstitialPageMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ManifestMiddleware.js +8 -5
- package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js +1 -1
- package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ServeStaticMiddleware.js +1 -1
- package/build/src/start/server/middleware/ServeStaticMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/inspector/JsInspector.js +69 -0
- package/build/src/start/server/middleware/inspector/JsInspector.js.map +1 -0
- package/build/src/start/server/middleware/inspector/LaunchBrowser.js +57 -0
- package/build/src/start/server/middleware/inspector/LaunchBrowser.js.map +1 -0
- package/build/src/start/server/middleware/inspector/LaunchBrowser.types.js +13 -0
- package/build/src/start/server/middleware/inspector/LaunchBrowser.types.js.map +1 -0
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplLinux.js +79 -0
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplLinux.js.map +1 -0
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplMacOS.js +78 -0
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplMacOS.js.map +1 -0
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplWindows.js +121 -0
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplWindows.js.map +1 -0
- package/build/src/start/server/middleware/inspector/createJsInspectorMiddleware.js +64 -0
- package/build/src/start/server/middleware/inspector/createJsInspectorMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/inspector/middlwareMutations.js +19 -0
- package/build/src/start/server/middleware/inspector/middlwareMutations.js.map +1 -0
- package/build/src/start/server/middleware/mutations.js +19 -0
- package/build/src/start/server/middleware/mutations.js.map +1 -0
- package/build/src/start/server/middleware/remoteDevtoolsCorsMiddleware.js +31 -0
- package/build/src/start/server/middleware/remoteDevtoolsCorsMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/remoteDevtoolsSecurityHeadersMiddleware.js +17 -0
- package/build/src/start/server/middleware/remoteDevtoolsSecurityHeadersMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/resolveAssets.js.map +1 -1
- package/build/src/start/server/middleware/resolvePlatform.js.map +1 -1
- package/build/src/start/server/middleware/server.types.js.map +1 -1
- package/build/src/start/server/middleware/suppressErrorMiddleware.js +16 -0
- package/build/src/start/server/middleware/suppressErrorMiddleware.js.map +1 -0
- package/build/src/start/server/openPlatforms.js.map +1 -1
- package/build/src/start/server/type-generation/__typetests__/fixtures/basic.js.map +1 -1
- package/build/src/start/server/type-generation/routes.js +6 -6
- package/build/src/start/server/type-generation/routes.js.map +1 -1
- package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js +3 -3
- package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js.map +1 -1
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js +19 -87
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js.map +1 -1
- package/build/src/start/server/webpack/compile.js +1 -1
- package/build/src/start/server/webpack/compile.js.map +1 -1
- package/build/src/start/startAsync.js +10 -32
- package/build/src/start/startAsync.js.map +1 -1
- package/build/src/utils/FileNotifier.js +1 -1
- package/build/src/utils/FileNotifier.js.map +1 -1
- package/build/src/utils/analytics/metroDebuggerMiddleware.js +1 -1
- package/build/src/utils/analytics/metroDebuggerMiddleware.js.map +1 -1
- package/build/src/utils/analytics/rudderstackClient.js +2 -2
- package/build/src/utils/array.js.map +1 -1
- package/build/src/utils/cocoapods.js +2 -2
- package/build/src/utils/cocoapods.js.map +1 -1
- package/build/src/utils/codesigning.js +2 -2
- package/build/src/utils/codesigning.js.map +1 -1
- package/build/src/utils/downloadAppAsync.js +1 -1
- package/build/src/utils/downloadAppAsync.js.map +1 -1
- package/build/src/utils/downloadExpoGoAsync.js +2 -2
- package/build/src/utils/downloadExpoGoAsync.js.map +1 -1
- package/build/src/utils/editor.js +1 -1
- package/build/src/utils/editor.js.map +1 -1
- package/build/src/utils/env.js +1 -1
- package/build/src/utils/env.js.map +1 -1
- package/build/src/utils/errors.js.map +1 -1
- package/build/src/utils/getOrPromptApplicationId.js +2 -2
- package/build/src/utils/getOrPromptApplicationId.js.map +1 -1
- package/build/src/utils/git.js +1 -1
- package/build/src/utils/git.js.map +1 -1
- package/build/src/utils/modifyConfigAsync.js +1 -1
- package/build/src/utils/modifyConfigAsync.js.map +1 -1
- package/build/src/utils/modifyConfigPlugins.js +1 -1
- package/build/src/utils/modifyConfigPlugins.js.map +1 -1
- package/build/src/utils/npm.js +1 -1
- package/build/src/utils/npm.js.map +1 -1
- package/build/src/utils/obj.js.map +1 -1
- package/build/src/utils/plist.js +1 -1
- package/build/src/utils/plist.js.map +1 -1
- package/build/src/utils/port.js +46 -18
- package/build/src/utils/port.js.map +1 -1
- package/build/src/utils/profile.js +1 -1
- package/build/src/utils/profile.js.map +1 -1
- package/build/src/utils/scheme.js +1 -1
- package/build/src/utils/scheme.js.map +1 -1
- package/build/src/utils/tsconfig/loadTsConfigPaths.js +1 -1
- package/build/src/utils/tsconfig/loadTsConfigPaths.js.map +1 -1
- package/build/src/utils/validateApplicationId.js +85 -5
- package/build/src/utils/validateApplicationId.js.map +1 -1
- package/package.json +19 -13
- package/build/src/api/signManifest.js +0 -26
- package/build/src/api/signManifest.js.map +0 -1
- package/build/src/start/server/middleware/ClassicManifestMiddleware.js +0 -155
- package/build/src/start/server/middleware/ClassicManifestMiddleware.js.map +0 -1
- package/build/src/start/server/middleware/createDevServerMiddleware.js +0 -24
- package/build/src/start/server/middleware/createDevServerMiddleware.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/downloadExpoGoAsync.ts"],"sourcesContent":["import { getExpoHomeDirectory } from '@expo/config/build/getUserState';\nimport path from 'path';\nimport ProgressBar from 'progress';\nimport { gt } from 'semver';\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/downloadExpoGoAsync.ts"],"sourcesContent":["import { getExpoHomeDirectory } from '@expo/config/build/getUserState';\nimport path from 'path';\nimport ProgressBar from 'progress';\nimport { gt } from 'semver';\n\nimport { downloadAppAsync } from './downloadAppAsync';\nimport { CommandError } from './errors';\nimport { ora } from './ora';\nimport { profile } from './profile';\nimport { createProgressBar } from './progress';\nimport { getVersionsAsync, SDKVersion } from '../api/getVersions';\nimport { Log } from '../log';\n\nconst debug = require('debug')('expo:utils:downloadExpoGo') as typeof console.log;\n\nconst platformSettings: Record<\n string,\n {\n shouldExtractResults: boolean;\n versionsKey: keyof SDKVersion;\n getFilePath: (filename: string) => string;\n }\n> = {\n ios: {\n versionsKey: 'iosClientUrl',\n getFilePath: (filename) =>\n path.join(getExpoHomeDirectory(), 'ios-simulator-app-cache', `${filename}.app`),\n shouldExtractResults: true,\n },\n android: {\n versionsKey: 'androidClientUrl',\n getFilePath: (filename) =>\n path.join(getExpoHomeDirectory(), 'android-apk-cache', `${filename}.apk`),\n shouldExtractResults: false,\n },\n};\n\n/**\n * @internal exposed for testing.\n * @returns the matching `SDKVersion` object from the Expo API.\n */\nexport async function getExpoGoVersionEntryAsync(sdkVersion: string): Promise<SDKVersion> {\n const { sdkVersions: versions } = await getVersionsAsync();\n let version: SDKVersion;\n\n if (sdkVersion.toUpperCase() === 'UNVERSIONED') {\n // find the latest version\n const latestVersionKey = Object.keys(versions).reduce((a, b) => {\n if (gt(b, a)) {\n return b;\n }\n return a;\n }, '0.0.0');\n\n Log.warn(\n `Downloading the latest Expo Go client (${latestVersionKey}). This will not fully conform to UNVERSIONED.`\n );\n version = versions[latestVersionKey];\n } else {\n version = versions[sdkVersion];\n }\n\n if (!version) {\n throw new CommandError(`Unable to find a version of Expo Go for SDK ${sdkVersion}`);\n }\n return version;\n}\n\n/** Download the Expo Go app from the Expo servers (if only it was this easy for every app). */\nexport async function downloadExpoGoAsync(\n platform: keyof typeof platformSettings,\n {\n url,\n sdkVersion,\n }: {\n url?: string;\n sdkVersion?: string;\n }\n): Promise<string> {\n const { getFilePath, versionsKey, shouldExtractResults } = platformSettings[platform];\n\n const spinner = ora({ text: 'Fetching Expo Go', color: 'white' }).start();\n\n let bar: ProgressBar | null = null;\n\n try {\n if (!url) {\n if (!sdkVersion) {\n throw new CommandError(\n `Unable to determine which Expo Go version to install (platform: ${platform})`\n );\n }\n\n const version = await getExpoGoVersionEntryAsync(sdkVersion);\n\n debug(`Installing Expo Go version for SDK ${sdkVersion} at URL: ${version[versionsKey]}`);\n url = version[versionsKey] as string;\n }\n } catch (error) {\n spinner.fail();\n throw error;\n }\n\n const filename = path.parse(url).name;\n\n try {\n const outputPath = getFilePath(filename);\n debug(`Downloading Expo Go from \"${url}\" to \"${outputPath}\".`);\n debug(\n `The requested copy of Expo Go might already be cached in: \"${getExpoHomeDirectory()}\". You can disable the cache with EXPO_NO_CACHE=1`\n );\n await profile(downloadAppAsync)({\n url,\n // Save all encrypted cache data to `~/.expo/expo-go`\n cacheDirectory: 'expo-go',\n outputPath,\n extract: shouldExtractResults,\n onProgress({ progress, total }) {\n if (progress && total) {\n if (!bar) {\n if (spinner.isSpinning) {\n spinner.stop();\n }\n bar = createProgressBar('Downloading the Expo Go app [:bar] :percent :etas', {\n width: 64,\n total: 100,\n // clear: true,\n complete: '=',\n incomplete: ' ',\n });\n } else {\n bar!.update(progress, total);\n }\n }\n },\n });\n return outputPath;\n } finally {\n spinner.stop();\n // @ts-expect-error\n bar?.terminate();\n }\n}\n"],"names":["getExpoGoVersionEntryAsync","downloadExpoGoAsync","debug","require","platformSettings","ios","versionsKey","getFilePath","filename","path","join","getExpoHomeDirectory","shouldExtractResults","android","sdkVersion","sdkVersions","versions","getVersionsAsync","version","toUpperCase","latestVersionKey","Object","keys","reduce","a","b","gt","Log","warn","CommandError","platform","url","spinner","ora","text","color","start","bar","error","fail","parse","name","outputPath","profile","downloadAppAsync","cacheDirectory","extract","onProgress","progress","total","isSpinning","stop","createProgressBar","width","complete","incomplete","update","terminate"],"mappings":"AAAA;;;;QAyCsBA,0BAA0B,GAA1BA,0BAA0B;QA4B1BC,mBAAmB,GAAnBA,mBAAmB;AArEJ,IAAA,aAAiC,WAAjC,iCAAiC,CAAA;AACrD,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEJ,IAAA,OAAQ,WAAR,QAAQ,CAAA;AAEM,IAAA,iBAAoB,WAApB,oBAAoB,CAAA;AACxB,IAAA,OAAU,W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Q,EAAE,GAAG;4BACbC,UAAU,EAAE,GAAG;yBAChB,CAAC,CAAC;qBACJ,MAAM;wBACLlB,GAAG,CAAEmB,MAAM,CAACR,QAAQ,EAAEC,KAAK,CAAC,CAAC;qBAC9B;iBACF;aACF;SACF,CAAC,CAAC;QACH,OAAOP,UAAU,CAAC;KACnB,QAAS;QACRV,OAAO,CAACmB,IAAI,EAAE,CAAC;QACf,mBAAmB;QACnBd,GAAG,QAAW,GAAdA,KAAAA,CAAc,GAAdA,GAAG,CAAEoB,SAAS,EAAE,AA5IpB,CA4IqB;KAClB;CACF"}
|
|
@@ -6,8 +6,8 @@ exports.guessEditor = guessEditor;
|
|
|
6
6
|
exports.openInEditorAsync = openInEditorAsync;
|
|
7
7
|
var _spawnAsync = _interopRequireDefault(require("@expo/spawn-async"));
|
|
8
8
|
var _envEditor = _interopRequireDefault(require("env-editor"));
|
|
9
|
-
var Log = _interopRequireWildcard(require("../log"));
|
|
10
9
|
var _env = require("./env");
|
|
10
|
+
var Log = _interopRequireWildcard(require("../log"));
|
|
11
11
|
function _interopRequireDefault(obj) {
|
|
12
12
|
return obj && obj.__esModule ? obj : {
|
|
13
13
|
default: obj
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/editor.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport editors from 'env-editor';\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/editor.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport editors from 'env-editor';\n\nimport { env } from './env';\nimport * as Log from '../log';\n\nconst debug = require('debug')('expo:utils:editor') as typeof console.log;\n\n/** Guess what the default editor is and default to VSCode. */\nexport function guessEditor(): editors.Editor {\n try {\n const editor = env.EXPO_EDITOR;\n if (editor) {\n debug('Using $EXPO_EDITOR:', editor);\n return editors.getEditor(editor);\n }\n debug('Falling back on $EDITOR:', editor);\n return editors.defaultEditor();\n } catch {\n debug('Falling back on vscode');\n return editors.getEditor('vscode');\n }\n}\n\n/** Open a file path in a given editor. */\nexport async function openInEditorAsync(path: string): Promise<boolean> {\n const editor = guessEditor();\n\n debug(`Opening ${path} in ${editor?.name} (bin: ${editor?.binary}, id: ${editor?.id})`);\n if (editor) {\n try {\n await spawnAsync(editor.binary, [path]);\n return true;\n } catch (error: any) {\n debug(`Failed to auto open path in editor (path: ${path}, binary: ${editor.binary}):`, error);\n }\n }\n\n Log.error(\n 'Could not open editor, you can set it by defining the $EDITOR environment variable with the binary of your editor. (e.g. \"vscode\" or \"atom\")'\n );\n return false;\n}\n"],"names":["guessEditor","openInEditorAsync","Log","debug","require","editor","env","EXPO_EDITOR","editors","getEditor","defaultEditor","path","name","binary","id","spawnAsync","error"],"mappings":"AAAA;;;;QASgBA,WAAW,GAAXA,WAAW;QAgBLC,iBAAiB,GAAjBA,iBAAiB;AAzBhB,IAAA,WAAmB,kCAAnB,mBAAmB,EAAA;AACtB,IAAA,UAAY,kCAAZ,YAAY,EAAA;AAEZ,IAAA,IAAO,WAAP,OAAO,CAAA;AACfC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEf,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,mBAAmB,CAAC,AAAsB,AAAC;AAGnE,SAASJ,WAAW,GAAmB;IAC5C,IAAI;QACF,MAAMK,MAAM,GAAGC,IAAG,IAAA,CAACC,WAAW,AAAC;QAC/B,IAAIF,MAAM,EAAE;YACVF,KAAK,CAAC,qBAAqB,EAAEE,MAAM,CAAC,CAAC;YACrC,OAAOG,UAAO,QAAA,CAACC,SAAS,CAACJ,MAAM,CAAC,CAAC;SAClC;QACDF,KAAK,CAAC,0BAA0B,EAAEE,MAAM,CAAC,CAAC;QAC1C,OAAOG,UAAO,QAAA,CAACE,aAAa,EAAE,CAAC;KAChC,CAAC,OAAM;QACNP,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAChC,OAAOK,UAAO,QAAA,CAACC,SAAS,CAAC,QAAQ,CAAC,CAAC;KACpC;CACF;AAGM,eAAeR,iBAAiB,CAACU,IAAY,EAAoB;IACtE,MAAMN,MAAM,GAAGL,WAAW,EAAE,AAAC;IAE7BG,KAAK,CAAC,CAAC,QAAQ,EAAEQ,IAAI,CAAC,IAAI,EAAEN,MAAM,QAAM,GAAZA,KAAAA,CAAY,GAAZA,MAAM,CAAEO,IAAI,CAAC,OAAO,EAAEP,MAAM,QAAQ,GAAdA,KAAAA,CAAc,GAAdA,MAAM,CAAEQ,MAAM,CAAC,MAAM,EAAER,MAAM,QAAI,GAAVA,KAAAA,CAAU,GAAVA,MAAM,CAAES,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACxF,IAAIT,MAAM,EAAE;QACV,IAAI;YACF,MAAMU,CAAAA,GAAAA,WAAU,AAAuB,CAAA,QAAvB,CAACV,MAAM,CAACQ,MAAM,EAAE;gBAACF,IAAI;aAAC,CAAC,CAAC;YACxC,OAAO,IAAI,CAAC;SACb,CAAC,OAAOK,KAAK,EAAO;YACnBb,KAAK,CAAC,CAAC,0CAA0C,EAAEQ,IAAI,CAAC,UAAU,EAAEN,MAAM,CAACQ,MAAM,CAAC,EAAE,CAAC,EAAEG,KAAK,CAAC,CAAC;SAC/F;KACF;IAEDd,GAAG,CAACc,KAAK,CACP,8IAA8I,CAC/I,CAAC;IACF,OAAO,KAAK,CAAC;CACd"}
|
package/build/src/utils/env.js
CHANGED
|
@@ -56,7 +56,7 @@ class Env {
|
|
|
56
56
|
return (0, _getenv).int("RCT_METRO_PORT", 0);
|
|
57
57
|
}
|
|
58
58
|
/** Skip validating the manifest during `export`. */ get EXPO_SKIP_MANIFEST_VALIDATION_TOKEN() {
|
|
59
|
-
return !!(0, _getenv).string("EXPO_SKIP_MANIFEST_VALIDATION_TOKEN");
|
|
59
|
+
return !!(0, _getenv).string("EXPO_SKIP_MANIFEST_VALIDATION_TOKEN", "");
|
|
60
60
|
}
|
|
61
61
|
/** Public folder path relative to the project root. Default to `public` */ get EXPO_PUBLIC_FOLDER() {
|
|
62
62
|
return (0, _getenv).string("EXPO_PUBLIC_FOLDER", "public");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/env.ts"],"sourcesContent":["import { boolish, int, string } from 'getenv';\n\n// @expo/webpack-config -> expo-pwa -> @expo/image-utils: EXPO_IMAGE_UTILS_NO_SHARP\n\n// TODO: EXPO_CLI_USERNAME, EXPO_CLI_PASSWORD\n\nclass Env {\n /** Enable profiling metrics */\n get EXPO_PROFILE() {\n return boolish('EXPO_PROFILE', false);\n }\n\n /** Enable debug logging */\n get EXPO_DEBUG() {\n return boolish('EXPO_DEBUG', false);\n }\n\n /** Disable all network requests */\n get EXPO_OFFLINE() {\n return boolish('EXPO_OFFLINE', false);\n }\n\n /** Enable the beta version of Expo (TODO: Should this just be in the beta version of expo releases?) */\n get EXPO_BETA() {\n return boolish('EXPO_BETA', false);\n }\n\n /** Enable staging API environment */\n get EXPO_STAGING() {\n return boolish('EXPO_STAGING', false);\n }\n\n /** Enable local API environment */\n get EXPO_LOCAL() {\n return boolish('EXPO_LOCAL', false);\n }\n\n /** Is running in non-interactive CI mode */\n get CI() {\n return boolish('CI', false);\n }\n\n /** Disable telemetry (analytics) */\n get EXPO_NO_TELEMETRY() {\n return boolish('EXPO_NO_TELEMETRY', false);\n }\n\n /** local directory to the universe repo for testing locally */\n get EXPO_UNIVERSE_DIR() {\n return string('EXPO_UNIVERSE_DIR', '');\n }\n\n /** @deprecated Default Webpack host string */\n get WEB_HOST() {\n return string('WEB_HOST', '0.0.0.0');\n }\n\n /** Skip warning users about a dirty git status */\n get EXPO_NO_GIT_STATUS() {\n return boolish('EXPO_NO_GIT_STATUS', false);\n }\n /** Disable auto web setup */\n get EXPO_NO_WEB_SETUP() {\n return boolish('EXPO_NO_WEB_SETUP', false);\n }\n /** Disable auto TypeScript setup */\n get EXPO_NO_TYPESCRIPT_SETUP() {\n return boolish('EXPO_NO_TYPESCRIPT_SETUP', false);\n }\n /** Disable all API caches. Does not disable bundler caches. */\n get EXPO_NO_CACHE() {\n return boolish('EXPO_NO_CACHE', false);\n }\n /** Disable the app select redirect page. */\n get EXPO_NO_REDIRECT_PAGE() {\n return boolish('EXPO_NO_REDIRECT_PAGE', false);\n }\n /** The React Metro port that's baked into react-native scripts and tools. */\n get RCT_METRO_PORT() {\n return int('RCT_METRO_PORT', 0);\n }\n /** Skip validating the manifest during `export`. */\n get EXPO_SKIP_MANIFEST_VALIDATION_TOKEN(): boolean {\n return !!string('EXPO_SKIP_MANIFEST_VALIDATION_TOKEN');\n }\n\n /** Public folder path relative to the project root. Default to `public` */\n get EXPO_PUBLIC_FOLDER(): string {\n return string('EXPO_PUBLIC_FOLDER', 'public');\n }\n\n /** Higher priority `$EDIOTR` variable for indicating which editor to use when pressing `o` in the Terminal UI. */\n get EXPO_EDITOR(): string {\n return string('EXPO_EDITOR', '');\n }\n\n /** Enable auto server root detection for Metro. This will change the server root to the workspace root. */\n get EXPO_USE_METRO_WORKSPACE_ROOT(): boolean {\n return boolish('EXPO_USE_METRO_WORKSPACE_ROOT', false);\n }\n\n /**\n * Overwrite the dev server URL, disregarding the `--port`, `--host`, `--tunnel`, `--lan`, `--localhost` arguments.\n * This is useful for browser editors that require custom proxy URLs.\n */\n get EXPO_PACKAGER_PROXY_URL(): string {\n return string('EXPO_PACKAGER_PROXY_URL', '');\n }\n\n /**\n * **Experimental** - Disable using `exp.direct` as the hostname for\n * `--tunnel` connections. This enables **https://** forwarding which\n * can be used to test universal links on iOS.\n *\n * This may cause issues with `expo-linking` and Expo Go.\n *\n * Select the exact subdomain by passing a string value that is not one of: `true`, `false`, `1`, `0`.\n */\n get EXPO_TUNNEL_SUBDOMAIN(): string | boolean {\n const subdomain = string('EXPO_TUNNEL_SUBDOMAIN', '');\n if (['0', 'false', ''].includes(subdomain)) {\n return false;\n } else if (['1', 'true'].includes(subdomain)) {\n return true;\n }\n return subdomain;\n }\n\n /**\n * Force Expo CLI to use the [`resolver.resolverMainFields`](https://facebook.github.io/metro/docs/configuration/#resolvermainfields) from the project `metro.config.js` for all platforms.\n *\n * By default, Expo CLI will use `['browser', 'module', 'main']` (default for Webpack) for web and the user-defined main fields for other platforms.\n */\n get EXPO_METRO_NO_MAIN_FIELD_OVERRIDE(): boolean {\n return boolish('EXPO_METRO_NO_MAIN_FIELD_OVERRIDE', false);\n }\n\n /**\n * HTTP/HTTPS proxy to connect to for network requests. Configures [https-proxy-agent](https://www.npmjs.com/package/https-proxy-agent).\n */\n get HTTP_PROXY(): string {\n return process.env.HTTP_PROXY || process.env.http_proxy || '';\n }\n\n /** Use the network inspector by overriding the metro inspector proxy with a custom version */\n get EXPO_NO_INSPECTOR_PROXY(): boolean {\n return boolish('EXPO_NO_INSPECTOR_PROXY', false);\n }\n\n /** Disable lazy bundling in Metro bundler. */\n get EXPO_NO_METRO_LAZY() {\n return boolish('EXPO_NO_METRO_LAZY', false);\n }\n\n /** Enable the unstable inverse dependency stack trace for Metro bundling errors. */\n get EXPO_METRO_UNSTABLE_ERRORS() {\n return boolish('EXPO_METRO_UNSTABLE_ERRORS', false);\n }\n}\n\nexport const env = new Env();\n"],"names":["Env","EXPO_PROFILE","boolish","EXPO_DEBUG","EXPO_OFFLINE","EXPO_BETA","EXPO_STAGING","EXPO_LOCAL","CI","EXPO_NO_TELEMETRY","EXPO_UNIVERSE_DIR","string","WEB_HOST","EXPO_NO_GIT_STATUS","EXPO_NO_WEB_SETUP","EXPO_NO_TYPESCRIPT_SETUP","EXPO_NO_CACHE","EXPO_NO_REDIRECT_PAGE","RCT_METRO_PORT","int","EXPO_SKIP_MANIFEST_VALIDATION_TOKEN","EXPO_PUBLIC_FOLDER","EXPO_EDITOR","EXPO_USE_METRO_WORKSPACE_ROOT","EXPO_PACKAGER_PROXY_URL","EXPO_TUNNEL_SUBDOMAIN","subdomain","includes","EXPO_METRO_NO_MAIN_FIELD_OVERRIDE","HTTP_PROXY","process","env","http_proxy","EXPO_N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1
|
+
{"version":3,"sources":["../../../src/utils/env.ts"],"sourcesContent":["import { boolish, int, string } from 'getenv';\n\n// @expo/webpack-config -> expo-pwa -> @expo/image-utils: EXPO_IMAGE_UTILS_NO_SHARP\n\n// TODO: EXPO_CLI_USERNAME, EXPO_CLI_PASSWORD\n\nclass Env {\n /** Enable profiling metrics */\n get EXPO_PROFILE() {\n return boolish('EXPO_PROFILE', false);\n }\n\n /** Enable debug logging */\n get EXPO_DEBUG() {\n return boolish('EXPO_DEBUG', false);\n }\n\n /** Disable all network requests */\n get EXPO_OFFLINE() {\n return boolish('EXPO_OFFLINE', false);\n }\n\n /** Enable the beta version of Expo (TODO: Should this just be in the beta version of expo releases?) */\n get EXPO_BETA() {\n return boolish('EXPO_BETA', false);\n }\n\n /** Enable staging API environment */\n get EXPO_STAGING() {\n return boolish('EXPO_STAGING', false);\n }\n\n /** Enable local API environment */\n get EXPO_LOCAL() {\n return boolish('EXPO_LOCAL', false);\n }\n\n /** Is running in non-interactive CI mode */\n get CI() {\n return boolish('CI', false);\n }\n\n /** Disable telemetry (analytics) */\n get EXPO_NO_TELEMETRY() {\n return boolish('EXPO_NO_TELEMETRY', false);\n }\n\n /** local directory to the universe repo for testing locally */\n get EXPO_UNIVERSE_DIR() {\n return string('EXPO_UNIVERSE_DIR', '');\n }\n\n /** @deprecated Default Webpack host string */\n get WEB_HOST() {\n return string('WEB_HOST', '0.0.0.0');\n }\n\n /** Skip warning users about a dirty git status */\n get EXPO_NO_GIT_STATUS() {\n return boolish('EXPO_NO_GIT_STATUS', false);\n }\n /** Disable auto web setup */\n get EXPO_NO_WEB_SETUP() {\n return boolish('EXPO_NO_WEB_SETUP', false);\n }\n /** Disable auto TypeScript setup */\n get EXPO_NO_TYPESCRIPT_SETUP() {\n return boolish('EXPO_NO_TYPESCRIPT_SETUP', false);\n }\n /** Disable all API caches. Does not disable bundler caches. */\n get EXPO_NO_CACHE() {\n return boolish('EXPO_NO_CACHE', false);\n }\n /** Disable the app select redirect page. */\n get EXPO_NO_REDIRECT_PAGE() {\n return boolish('EXPO_NO_REDIRECT_PAGE', false);\n }\n /** The React Metro port that's baked into react-native scripts and tools. */\n get RCT_METRO_PORT() {\n return int('RCT_METRO_PORT', 0);\n }\n /** Skip validating the manifest during `export`. */\n get EXPO_SKIP_MANIFEST_VALIDATION_TOKEN(): boolean {\n return !!string('EXPO_SKIP_MANIFEST_VALIDATION_TOKEN', '');\n }\n\n /** Public folder path relative to the project root. Default to `public` */\n get EXPO_PUBLIC_FOLDER(): string {\n return string('EXPO_PUBLIC_FOLDER', 'public');\n }\n\n /** Higher priority `$EDIOTR` variable for indicating which editor to use when pressing `o` in the Terminal UI. */\n get EXPO_EDITOR(): string {\n return string('EXPO_EDITOR', '');\n }\n\n /** Enable auto server root detection for Metro. This will change the server root to the workspace root. */\n get EXPO_USE_METRO_WORKSPACE_ROOT(): boolean {\n return boolish('EXPO_USE_METRO_WORKSPACE_ROOT', false);\n }\n\n /**\n * Overwrite the dev server URL, disregarding the `--port`, `--host`, `--tunnel`, `--lan`, `--localhost` arguments.\n * This is useful for browser editors that require custom proxy URLs.\n */\n get EXPO_PACKAGER_PROXY_URL(): string {\n return string('EXPO_PACKAGER_PROXY_URL', '');\n }\n\n /**\n * **Experimental** - Disable using `exp.direct` as the hostname for\n * `--tunnel` connections. This enables **https://** forwarding which\n * can be used to test universal links on iOS.\n *\n * This may cause issues with `expo-linking` and Expo Go.\n *\n * Select the exact subdomain by passing a string value that is not one of: `true`, `false`, `1`, `0`.\n */\n get EXPO_TUNNEL_SUBDOMAIN(): string | boolean {\n const subdomain = string('EXPO_TUNNEL_SUBDOMAIN', '');\n if (['0', 'false', ''].includes(subdomain)) {\n return false;\n } else if (['1', 'true'].includes(subdomain)) {\n return true;\n }\n return subdomain;\n }\n\n /**\n * Force Expo CLI to use the [`resolver.resolverMainFields`](https://facebook.github.io/metro/docs/configuration/#resolvermainfields) from the project `metro.config.js` for all platforms.\n *\n * By default, Expo CLI will use `['browser', 'module', 'main']` (default for Webpack) for web and the user-defined main fields for other platforms.\n */\n get EXPO_METRO_NO_MAIN_FIELD_OVERRIDE(): boolean {\n return boolish('EXPO_METRO_NO_MAIN_FIELD_OVERRIDE', false);\n }\n\n /**\n * HTTP/HTTPS proxy to connect to for network requests. Configures [https-proxy-agent](https://www.npmjs.com/package/https-proxy-agent).\n */\n get HTTP_PROXY(): string {\n return process.env.HTTP_PROXY || process.env.http_proxy || '';\n }\n\n /** Use the network inspector by overriding the metro inspector proxy with a custom version */\n get EXPO_NO_INSPECTOR_PROXY(): boolean {\n return boolish('EXPO_NO_INSPECTOR_PROXY', false);\n }\n\n /** Disable lazy bundling in Metro bundler. */\n get EXPO_NO_METRO_LAZY() {\n return boolish('EXPO_NO_METRO_LAZY', false);\n }\n\n /** Enable the unstable inverse dependency stack trace for Metro bundling errors. */\n get EXPO_METRO_UNSTABLE_ERRORS() {\n return boolish('EXPO_METRO_UNSTABLE_ERRORS', false);\n }\n}\n\nexport const env = new Env();\n"],"names":["Env","EXPO_PROFILE","boolish","EXPO_DEBUG","EXPO_OFFLINE","EXPO_BETA","EXPO_STAGING","EXPO_LOCAL","CI","EXPO_NO_TELEMETRY","EXPO_UNIVERSE_DIR","string","WEB_HOST","EXPO_NO_GIT_STATUS","EXPO_NO_WEB_SETUP","EXPO_NO_TYPESCRIPT_SETUP","EXPO_NO_CACHE","EXPO_NO_REDIRECT_PAGE","RCT_METRO_PORT","int","EXPO_SKIP_MANIFEST_VALIDATION_TOKEN","EXPO_PUBLIC_FOLDER","EXPO_EDITOR","EXPO_USE_METRO_WORKSPACE_ROOT","EXPO_PACKAGER_PROXY_URL","EXPO_TUNNEL_SUBDOMAIN","subdomain","includes","EXPO_METRO_NO_MAIN_FIELD_OVERRIDE","HTTP_PROXY","process","env","http_proxy","EXPO_NO_INSPECTOR_PROXY","EXPO_NO_METRO_LAZY","EXPO_METRO_UNSTABLE_ERRORS"],"mappings":"AAAA;;;;;AAAqC,IAAA,OAAQ,WAAR,QA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IAAIC,uBAAuB,GAAY;QACrC,OAAO/B,CAAAA,GAAAA,OAAO,AAAkC,CAAA,QAAlC,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;KAClD;IAED,8CAA8C,CAC9C,IAAIgC,kBAAkB,GAAG;QACvB,OAAOhC,CAAAA,GAAAA,OAAO,AAA6B,CAAA,QAA7B,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;KAC7C;IAED,oFAAoF,CACpF,IAAIiC,0BAA0B,GAAG;QAC/B,OAAOjC,CAAAA,GAAAA,OAAO,AAAqC,CAAA,QAArC,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;KACrD;CACF;AAEM,MAAM6B,GAAG,GAAG,IAAI/B,GAAG,EAAE,AAAC;QAAhB+B,GAAG,GAAHA,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/errors.ts"],"sourcesContent":["import { AssertionError } from 'assert';\nimport chalk from 'chalk';\n\nimport { exit } from '../log';\n\nconst ERROR_PREFIX = 'Error: ';\n\n/**\n * General error, formatted as a message in red text when caught by expo-cli (no stack trace is printed). Should be used in favor of `log.error()` in most cases.\n */\nexport class CommandError extends Error {\n name = 'CommandError';\n readonly isCommandError = true;\n\n constructor(public code: string
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/errors.ts"],"sourcesContent":["import { AssertionError } from 'assert';\nimport chalk from 'chalk';\n\nimport { exit } from '../log';\n\nconst ERROR_PREFIX = 'Error: ';\n\n/**\n * General error, formatted as a message in red text when caught by expo-cli (no stack trace is printed). Should be used in favor of `log.error()` in most cases.\n */\nexport class CommandError extends Error {\n name = 'CommandError';\n readonly isCommandError = true;\n\n constructor(\n public code: string,\n message: string = ''\n ) {\n super('');\n // If e.toString() was called to get `message` we don't want it to look\n // like \"Error: Error:\".\n if (message.startsWith(ERROR_PREFIX)) {\n message = message.substring(ERROR_PREFIX.length);\n }\n\n this.message = message || code;\n }\n}\n\nexport class AbortCommandError extends CommandError {\n constructor() {\n super('ABORTED', 'Interactive prompt was cancelled.');\n }\n}\n\n/**\n * Used to end a CLI process without printing a stack trace in the Expo CLI. Should be used in favor of `process.exit`.\n */\nexport class SilentError extends CommandError {\n constructor(messageOrError?: string | Error) {\n const message =\n (typeof messageOrError === 'string' ? messageOrError : messageOrError?.message) ??\n 'This error should fail silently in the CLI';\n super('SILENT', message);\n if (typeof messageOrError !== 'string') {\n // forward the props of the incoming error for tests or processes outside of expo-cli that use expo cli internals.\n this.stack = messageOrError?.stack ?? this.stack;\n this.name = messageOrError?.name ?? this.name;\n }\n }\n}\n\nexport function logCmdError(error: Error): never {\n if (error instanceof AbortCommandError || error instanceof SilentError) {\n // Do nothing, this is used for prompts or other cases that were custom logged.\n process.exit(0);\n } else if (\n error instanceof CommandError ||\n error instanceof AssertionError ||\n error.name === 'ApiV2Error' ||\n error.name === 'ConfigError'\n ) {\n // Print the stack trace in debug mode only.\n exit(error);\n }\n\n const errorDetails = error.stack ? '\\n' + chalk.gray(error.stack) : '';\n\n exit(chalk.red(error.toString()) + errorDetails);\n}\n\n/** This should never be thrown in production. */\nexport class UnimplementedError extends Error {\n constructor() {\n super('Unimplemented');\n this.name = 'UnimplementedError';\n }\n}\n"],"names":["logCmdError","ERROR_PREFIX","CommandError","Error","constructor","code","message","name","isCommandError","startsWith","substring","length","AbortCommandError","SilentError","messageOrError","stack","error","process","exit","AssertionError","errorDetails","chalk","gray","red","toString","UnimplementedError"],"mappings":"AAAA;;;;QAoDgBA,WAAW,GAAXA,WAAW;AApDI,IAAA,OAAQ,WAAR,QAAQ,CAAA;AACrB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEJ,IAAA,IAAQ,WAAR,QAAQ,CAAA;;;;;;AAE7B,MAAMC,YAAY,GAAG,SAAS,AAAC;AAKxB,MAAMC,YAAY,SAASC,KAAK;IAIrCC,YACSC,IAAY,EACnBC,OAAe,GAAG,EAAE,CACpB;QACA,KAAK,CAAC,EAAE,CAAC,CAAC;aAHHD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AXA,WAAW;AAcjB,SAASb,WAAW,CAACgB,KAAY,EAAS;IAC/C,IAAIA,KAAK,YAAYJ,iBAAiB,IAAII,KAAK,YAAYH,WAAW,EAAE;QACtE,+EAA+E;QAC/EI,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB,MAAM,IACLF,KAAK,YAAYd,YAAY,IAC7Bc,KAAK,YAAYG,OAAc,eAAA,IAC/BH,KAAK,CAACT,IAAI,KAAK,YAAY,IAC3BS,KAAK,CAACT,IAAI,KAAK,aAAa,EAC5B;QACA,4CAA4C;QAC5CW,CAAAA,GAAAA,IAAI,AAAO,CAAA,KAAP,CAACF,KAAK,CAAC,CAAC;KACb;IAED,MAAMI,YAAY,GAAGJ,KAAK,CAACD,KAAK,GAAG,IAAI,GAAGM,MAAK,QAAA,CAACC,IAAI,CAACN,KAAK,CAACD,KAAK,CAAC,GAAG,EAAE,AAAC;IAEvEG,CAAAA,GAAAA,IAAI,AAA4C,CAAA,KAA5C,CAACG,MAAK,QAAA,CAACE,GAAG,CAACP,KAAK,CAACQ,QAAQ,EAAE,CAAC,GAAGJ,YAAY,CAAC,CAAC;CAClD;AAGM,MAAMK,kBAAkB,SAAStB,KAAK;IAC3CC,aAAc;QACZ,KAAK,CAAC,eAAe,CAAC,CAAC;QACvB,IAAI,CAACG,IAAI,GAAG,oBAAoB,CAAC;KAClC;CACF;QALYkB,kBAAkB,GAAlBA,kBAAkB"}
|
|
@@ -6,11 +6,11 @@ exports.getOrPromptForBundleIdentifier = getOrPromptForBundleIdentifier;
|
|
|
6
6
|
exports.getOrPromptForPackage = getOrPromptForPackage;
|
|
7
7
|
var _config = require("@expo/config");
|
|
8
8
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
9
|
-
var Log = _interopRequireWildcard(require("../log"));
|
|
10
9
|
var _link = require("./link");
|
|
11
10
|
var _modifyConfigAsync = require("./modifyConfigAsync");
|
|
12
11
|
var _prompts = _interopRequireWildcard(require("./prompts"));
|
|
13
12
|
var _validateApplicationId = require("./validateApplicationId");
|
|
13
|
+
var Log = _interopRequireWildcard(require("../log"));
|
|
14
14
|
function _interopRequireDefault(obj) {
|
|
15
15
|
return obj && obj.__esModule ? obj : {
|
|
16
16
|
default: obj
|
|
@@ -156,7 +156,7 @@ async function promptForPackageAsync(projectRoot, exp) {
|
|
|
156
156
|
name: "packageName",
|
|
157
157
|
initial: (ref = await getRecommendedPackageNameAsync(exp)) != null ? ref : undefined,
|
|
158
158
|
message: `What would you like your Android package name to be?`,
|
|
159
|
-
validate: _validateApplicationId.
|
|
159
|
+
validate: _validateApplicationId.validatePackageWithWarning
|
|
160
160
|
}, {
|
|
161
161
|
nonInteractiveHelp: NO_PACKAGE_MESSAGE
|
|
162
162
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/getOrPromptApplicationId.ts"],"sourcesContent":["import { ExpoConfig, getAccountUsername, getConfig } from '@expo/config';\nimport chalk from 'chalk';\n\nimport * as Log from '../log';\nimport { learnMore } from './link';\nimport { attemptModification } from './modifyConfigAsync';\nimport prompt, { confirmAsync } from './prompts';\nimport {\n assertValidBundleId,\n assertValidPackage,\n getBundleIdWarningAsync,\n getPackageNameWarningAsync,\n validateBundleId,\n validatePackage,\n} from './validateApplicationId';\n\nfunction getUsernameAsync(exp: ExpoConfig) {\n // TODO: Use XDL's UserManager\n // import { UserManager } from 'xdl';\n return getAccountUsername(exp);\n}\n\nconst NO_BUNDLE_ID_MESSAGE = `Project must have a \\`ios.bundleIdentifier\\` set in the Expo config (app.json or app.config.js).`;\n\nconst NO_PACKAGE_MESSAGE = `Project must have a \\`android.package\\` set in the Expo config (app.json or app.config.js).`;\n\n/**\n * Get the bundle identifier from the Expo config or prompt the user to choose a new bundle identifier.\n * Prompted value will be validated against the App Store and a local regex.\n * If the project Expo config is a static JSON file, the bundle identifier will be updated in the config automatically.\n */\nexport async function getOrPromptForBundleIdentifier(projectRoot: string): Promise<string> {\n const { exp } = getConfig(projectRoot);\n\n const current = exp.ios?.bundleIdentifier;\n if (current) {\n assertValidBundleId(current);\n return current;\n }\n\n Log.log(\n chalk`\\n{bold 📝 iOS Bundle Identifier} {dim ${learnMore(\n 'https://expo.fyi/bundle-identifier'\n )}}\\n`\n );\n\n return await promptForBundleIdAsync(projectRoot, exp);\n}\n\nasync function promptForBundleIdAsync(projectRoot: string, exp: ExpoConfig): Promise<string> {\n // Prompt the user for the bundle ID.\n // Even if the project is using a dynamic config we can still\n // prompt a better error message, recommend a default value, and help the user\n // validate their custom bundle ID upfront.\n const { bundleIdentifier } = await prompt(\n {\n type: 'text',\n name: 'bundleIdentifier',\n initial: (await getRecommendedBundleIdAsync(exp)) ?? undefined,\n // The Apple helps people know this isn't an EAS feature.\n message: `What would you like your iOS bundle identifier to be?`,\n validate: validateBundleId,\n },\n {\n nonInteractiveHelp: NO_BUNDLE_ID_MESSAGE,\n }\n );\n\n // Warn the user if the bundle ID is already in use.\n const warning = await getBundleIdWarningAsync(bundleIdentifier);\n if (warning && !(await warnAndConfirmAsync(warning))) {\n // Cycle the Bundle ID prompt to try again.\n return await promptForBundleIdAsync(projectRoot, exp);\n }\n\n // Apply the changes to the config.\n await attemptModification(\n projectRoot,\n {\n ios: { ...(exp.ios || {}), bundleIdentifier },\n },\n { ios: { bundleIdentifier } }\n );\n\n return bundleIdentifier;\n}\n\nasync function warnAndConfirmAsync(warning: string): Promise<boolean> {\n Log.log();\n Log.warn(warning);\n Log.log();\n if (\n !(await confirmAsync({\n message: `Continue?`,\n initial: true,\n }))\n ) {\n return false;\n }\n return true;\n}\n\n// Recommend a bundle identifier based on the username and project slug.\nasync function getRecommendedBundleIdAsync(exp: ExpoConfig): Promise<string | null> {\n // Attempt to use the android package name first since it's convenient to have them aligned.\n if (exp.android?.package && validateBundleId(exp.android?.package)) {\n return exp.android?.package;\n } else {\n const username = await getUsernameAsync(exp);\n const possibleId = `com.${username}.${exp.slug}`;\n if (username && validateBundleId(possibleId)) {\n return possibleId;\n }\n }\n\n return null;\n}\n\n// Recommend a package name based on the username and project slug.\nasync function getRecommendedPackageNameAsync(exp: ExpoConfig): Promise<string | null> {\n // Attempt to use the ios bundle id first since it's convenient to have them aligned.\n if (exp.ios?.bundleIdentifier && validatePackage(exp.ios.bundleIdentifier)) {\n return exp.ios.bundleIdentifier;\n } else {\n const username = await getUsernameAsync(exp);\n // It's common to use dashes in your node project name, strip them from the suggested package name.\n const possibleId = `com.${username}.${exp.slug}`.split('-').join('');\n if (username && validatePackage(possibleId)) {\n return possibleId;\n }\n }\n return null;\n}\n\n/**\n * Get the package name from the Expo config or prompt the user to choose a new package name.\n * Prompted value will be validated against the Play Store and a local regex.\n * If the project Expo config is a static JSON file, the package name will be updated in the config automatically.\n */\nexport async function getOrPromptForPackage(projectRoot: string): Promise<string> {\n const { exp } = getConfig(projectRoot);\n\n const current = exp.android?.package;\n if (current) {\n assertValidPackage(current);\n return current;\n }\n\n Log.log(\n chalk`\\n{bold 📝 Android package} {dim ${learnMore('https://expo.fyi/android-package')}}\\n`\n );\n\n return await promptForPackageAsync(projectRoot, exp);\n}\n\nasync function promptForPackageAsync(projectRoot: string, exp: ExpoConfig): Promise<string> {\n // Prompt the user for the android package.\n // Even if the project is using a dynamic config we can still\n // prompt a better error message, recommend a default value, and help the user\n // validate their custom android package upfront.\n const { packageName } = await prompt(\n {\n type: 'text',\n name: 'packageName',\n initial: (await getRecommendedPackageNameAsync(exp)) ?? undefined,\n message: `What would you like your Android package name to be?`,\n validate: validatePackage,\n },\n {\n nonInteractiveHelp: NO_PACKAGE_MESSAGE,\n }\n );\n\n // Warn the user if the package name is already in use.\n const warning = await getPackageNameWarningAsync(packageName);\n if (warning && !(await warnAndConfirmAsync(warning))) {\n // Cycle the Package name prompt to try again.\n return await promptForPackageAsync(projectRoot, exp);\n }\n\n // Apply the changes to the config.\n await attemptModification(\n projectRoot,\n {\n android: { ...(exp.android || {}), package: packageName },\n },\n {\n android: { package: packageName },\n }\n );\n\n return packageName;\n}\n"],"names":["getOrPromptForBundleIdentifier","getOrPromptForPackage","Log","getUsernameAsync","exp","getAccountUsername","NO_BUNDLE_ID_MESSAGE","NO_PACKAGE_MESSAGE","projectRoot","getConfig","current","ios","bundleIdentifier","assertValidBundleId","log","chalk","learnMore","promptForBundleIdAsync","prompt","type","name","initial","getRecommendedBundleIdAsync","undefined","message","validate","validateBundleId","nonInteractiveHelp","warning","getBundleIdWarningAsync","warnAndConfirmAsync","attemptModification","warn","confirmAsync","android","package","username","possibleId","slug","getRecommendedPackageNameAsync","validatePackage","split","join","assertValidPackage","promptForPackageAsync","packageName","getPackageNameWarningAsync"],"mappings":"AAAA;;;;QA+BsBA,8BAA8B,GAA9BA,8BAA8B;QA4G9BC,qBAAqB,GAArBA,qBAAqB;AA3Ie,IAAA,OAAc,WAAd,cAAc,CAAA;AACtD,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEbC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACW,IAAA,KAAQ,WAAR,QAAQ,CAAA;AACE,IAAA,kBAAqB,WAArB,qBAAqB,CAAA;AACpB,IAAA,QAAW,mCAAX,WAAW,EAAA;AAQzC,IAAA,sBAAyB,WAAzB,yBAAyB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhC,SAASC,gBAAgB,CAACC,GAAe,EAAE;IACzC,8BAA8B;IAC9B,qCAAqC;IACrC,OAAOC,CAAAA,GAAAA,OAAkB,AAAK,CAAA,mBAAL,CAACD,GAAG,CAAC,CAAC;CAChC;AAED,MAAME,oBAAoB,GAAG,CAAC,gGAAgG,CAAC,AAAC;AAEhI,MAAMC,kBAAkB,GAAG,CAAC,2FAA2F,CAAC,AAAC;AAOlH,eAAeP,8BAA8B,CAACQ,WAAmB,EAAmB;QAGzEJ,GAAO;IAFvB,MAAM,EAAEA,GAAG,CAAA,EAAE,GAAGK,CAAAA,GAAAA,OAAS,AAAa,CAAA,UAAb,CAACD,WAAW,CAAC,AAAC;IAEvC,MAAME,OAAO,GAAGN,CA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,CAAE,MAAME,mBAAmB,CAACF,OAAO,CAAC,AAAC,EAAE;QACpD,8CAA8C;QAC9C,OAAO,MAAMgB,qBAAqB,CAACpC,WAAW,EAAEJ,GAAG,CAAC,CAAC;KACtD;IAED,mCAAmC;IACnC,MAAM2B,CAAAA,GAAAA,kBAAmB,AAQxB,CAAA,oBARwB,CACvBvB,WAAW,EACX;QACE0B,OAAO,EAAE;YAAE,GAAI9B,GAAG,CAAC8B,OAAO,IAAI,EAAE;YAAGC,OAAO,EAAEU,WAAW;SAAE;KAC1D,EACD;QACEX,OAAO,EAAE;YAAEC,OAAO,EAAEU,WAAW;SAAE;KAClC,CACF,CAAC;IAEF,OAAOA,WAAW,CAAC;CACpB"}
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/getOrPromptApplicationId.ts"],"sourcesContent":["import { ExpoConfig, getAccountUsername, getConfig } from '@expo/config';\nimport chalk from 'chalk';\n\nimport { learnMore } from './link';\nimport { attemptModification } from './modifyConfigAsync';\nimport prompt, { confirmAsync } from './prompts';\nimport {\n assertValidBundleId,\n assertValidPackage,\n getBundleIdWarningAsync,\n getPackageNameWarningAsync,\n validateBundleId,\n validatePackage,\n validatePackageWithWarning,\n} from './validateApplicationId';\nimport * as Log from '../log';\n\nfunction getUsernameAsync(exp: ExpoConfig) {\n // TODO: Use XDL's UserManager\n // import { UserManager } from 'xdl';\n return getAccountUsername(exp);\n}\n\nconst NO_BUNDLE_ID_MESSAGE = `Project must have a \\`ios.bundleIdentifier\\` set in the Expo config (app.json or app.config.js).`;\n\nconst NO_PACKAGE_MESSAGE = `Project must have a \\`android.package\\` set in the Expo config (app.json or app.config.js).`;\n\n/**\n * Get the bundle identifier from the Expo config or prompt the user to choose a new bundle identifier.\n * Prompted value will be validated against the App Store and a local regex.\n * If the project Expo config is a static JSON file, the bundle identifier will be updated in the config automatically.\n */\nexport async function getOrPromptForBundleIdentifier(projectRoot: string): Promise<string> {\n const { exp } = getConfig(projectRoot);\n\n const current = exp.ios?.bundleIdentifier;\n if (current) {\n assertValidBundleId(current);\n return current;\n }\n\n Log.log(\n chalk`\\n{bold 📝 iOS Bundle Identifier} {dim ${learnMore(\n 'https://expo.fyi/bundle-identifier'\n )}}\\n`\n );\n\n return await promptForBundleIdAsync(projectRoot, exp);\n}\n\nasync function promptForBundleIdAsync(projectRoot: string, exp: ExpoConfig): Promise<string> {\n // Prompt the user for the bundle ID.\n // Even if the project is using a dynamic config we can still\n // prompt a better error message, recommend a default value, and help the user\n // validate their custom bundle ID upfront.\n const { bundleIdentifier } = await prompt(\n {\n type: 'text',\n name: 'bundleIdentifier',\n initial: (await getRecommendedBundleIdAsync(exp)) ?? undefined,\n // The Apple helps people know this isn't an EAS feature.\n message: `What would you like your iOS bundle identifier to be?`,\n validate: validateBundleId,\n },\n {\n nonInteractiveHelp: NO_BUNDLE_ID_MESSAGE,\n }\n );\n\n // Warn the user if the bundle ID is already in use.\n const warning = await getBundleIdWarningAsync(bundleIdentifier);\n if (warning && !(await warnAndConfirmAsync(warning))) {\n // Cycle the Bundle ID prompt to try again.\n return await promptForBundleIdAsync(projectRoot, exp);\n }\n\n // Apply the changes to the config.\n await attemptModification(\n projectRoot,\n {\n ios: { ...(exp.ios || {}), bundleIdentifier },\n },\n { ios: { bundleIdentifier } }\n );\n\n return bundleIdentifier;\n}\n\nasync function warnAndConfirmAsync(warning: string): Promise<boolean> {\n Log.log();\n Log.warn(warning);\n Log.log();\n if (\n !(await confirmAsync({\n message: `Continue?`,\n initial: true,\n }))\n ) {\n return false;\n }\n return true;\n}\n\n// Recommend a bundle identifier based on the username and project slug.\nasync function getRecommendedBundleIdAsync(exp: ExpoConfig): Promise<string | null> {\n // Attempt to use the android package name first since it's convenient to have them aligned.\n if (exp.android?.package && validateBundleId(exp.android?.package)) {\n return exp.android?.package;\n } else {\n const username = await getUsernameAsync(exp);\n const possibleId = `com.${username}.${exp.slug}`;\n if (username && validateBundleId(possibleId)) {\n return possibleId;\n }\n }\n\n return null;\n}\n\n// Recommend a package name based on the username and project slug.\nasync function getRecommendedPackageNameAsync(exp: ExpoConfig): Promise<string | null> {\n // Attempt to use the ios bundle id first since it's convenient to have them aligned.\n if (exp.ios?.bundleIdentifier && validatePackage(exp.ios.bundleIdentifier)) {\n return exp.ios.bundleIdentifier;\n } else {\n const username = await getUsernameAsync(exp);\n // It's common to use dashes in your node project name, strip them from the suggested package name.\n const possibleId = `com.${username}.${exp.slug}`.split('-').join('');\n if (username && validatePackage(possibleId)) {\n return possibleId;\n }\n }\n return null;\n}\n\n/**\n * Get the package name from the Expo config or prompt the user to choose a new package name.\n * Prompted value will be validated against the Play Store and a local regex.\n * If the project Expo config is a static JSON file, the package name will be updated in the config automatically.\n */\nexport async function getOrPromptForPackage(projectRoot: string): Promise<string> {\n const { exp } = getConfig(projectRoot);\n\n const current = exp.android?.package;\n if (current) {\n assertValidPackage(current);\n return current;\n }\n\n Log.log(\n chalk`\\n{bold 📝 Android package} {dim ${learnMore('https://expo.fyi/android-package')}}\\n`\n );\n\n return await promptForPackageAsync(projectRoot, exp);\n}\n\nasync function promptForPackageAsync(projectRoot: string, exp: ExpoConfig): Promise<string> {\n // Prompt the user for the android package.\n // Even if the project is using a dynamic config we can still\n // prompt a better error message, recommend a default value, and help the user\n // validate their custom android package upfront.\n const { packageName } = await prompt(\n {\n type: 'text',\n name: 'packageName',\n initial: (await getRecommendedPackageNameAsync(exp)) ?? undefined,\n message: `What would you like your Android package name to be?`,\n validate: validatePackageWithWarning,\n },\n {\n nonInteractiveHelp: NO_PACKAGE_MESSAGE,\n }\n );\n\n // Warn the user if the package name is already in use.\n const warning = await getPackageNameWarningAsync(packageName);\n if (warning && !(await warnAndConfirmAsync(warning))) {\n // Cycle the Package name prompt to try again.\n return await promptForPackageAsync(projectRoot, exp);\n }\n\n // Apply the changes to the config.\n await attemptModification(\n projectRoot,\n {\n android: { ...(exp.android || {}), package: packageName },\n },\n {\n android: { package: packageName },\n }\n );\n\n return packageName;\n}\n"],"names":["getOrPromptForBundleIdentifier","getOrPromptForPackage","Log","getUsernameAsync","exp","getAccountUsername","NO_BUNDLE_ID_MESSAGE","NO_PACKAGE_MESSAGE","projectRoot","getConfig","current","ios","bundleIdentifier","assertValidBundleId","log","chalk","learnMore","promptForBundleIdAsync","prompt","type","name","initial","getRecommendedBundleIdAsync","undefined","message","validate","validateBundleId","nonInteractiveHelp","warning","getBundleIdWarningAsync","warnAndConfirmAsync","attemptModification","warn","confirmAsync","android","package","username","possibleId","slug","getRecommendedPackageNameAsync","validatePackage","split","join","assertValidPackage","promptForPackageAsync","packageName","validatePackageWithWarning","getPackageNameWarningAsync"],"mappings":"AAAA;;;;QAgCsBA,8BAA8B,GAA9BA,8BAA8B;QA4G9BC,qBAAqB,GAArBA,qBAAqB;AA5Ie,IAAA,OAAc,WAAd,cAAc,CAAA;AACtD,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEC,IAAA,KAAQ,WAAR,QAAQ,CAAA;AACE,IAAA,kBAAqB,WAArB,qBAAqB,CAAA;AACpB,IAAA,QAAW,mCAAX,WAAW,EAAA;AASzC,IAAA,sBAAyB,WAAzB,yBAAyB,CAAA;AACpBC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEf,SAASC,gBAAgB,CAACC,GAAe,EAAE;IACzC,8BAA8B;IAC9B,qCAAqC;IACrC,OAAOC,CAAAA,GAAAA,OAAkB,AAAK,CAAA,mBAAL,CAACD,GAAG,CAAC,CAAC;CAChC;AAED,MAAME,oBAAoB,GAAG,CAAC,gGAAgG,CAAC,AAAC;AAEhI,MAAMC,kBAAkB,GAAG,CAAC,2FAA2F,CAAC,AAAC;AAOlH,eAAeP,8BAA8B,CAACQ,WAAmB,EAAmB;QAGzEJ,GAAO;IAFvB,MAAM,EAAEA,GAAG,CAAA,EAAE,GAAGK,CAAAA,GAAAA,OAAS,AAAa,CAAA,UAAb,CAACD,WAAW,CAAC,AAAC;IAEvC,MAAME,OAAO,GAAGN,CAAAA,G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AE,MAAME,mBAAmB,CAACF,OAAO,CAAC,AAAC,EAAE;QACpD,8CAA8C;QAC9C,OAAO,MAAMgB,qBAAqB,CAACpC,WAAW,EAAEJ,GAAG,CAAC,CAAC;KACtD;IAED,mCAAmC;IACnC,MAAM2B,CAAAA,GAAAA,kBAAmB,AAQxB,CAAA,oBARwB,CACvBvB,WAAW,EACX;QACE0B,OAAO,EAAE;YAAE,GAAI9B,GAAG,CAAC8B,OAAO,IAAI,EAAE;YAAGC,OAAO,EAAEU,WAAW;SAAE;KAC1D,EACD;QACEX,OAAO,EAAE;YAAEC,OAAO,EAAEU,WAAW;SAAE;KAClC,CACF,CAAC;IAEF,OAAOA,WAAW,CAAC;CACpB"}
|
package/build/src/utils/git.js
CHANGED
|
@@ -6,10 +6,10 @@ exports.maybeBailOnGitStatusAsync = maybeBailOnGitStatusAsync;
|
|
|
6
6
|
exports.validateGitStatusAsync = validateGitStatusAsync;
|
|
7
7
|
var _spawnAsync = _interopRequireDefault(require("@expo/spawn-async"));
|
|
8
8
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
9
|
-
var Log = _interopRequireWildcard(require("../log"));
|
|
10
9
|
var _env = require("./env");
|
|
11
10
|
var _interactive = require("./interactive");
|
|
12
11
|
var _prompts = require("./prompts");
|
|
12
|
+
var Log = _interopRequireWildcard(require("../log"));
|
|
13
13
|
function _interopRequireDefault(obj) {
|
|
14
14
|
return obj && obj.__esModule ? obj : {
|
|
15
15
|
default: obj
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/git.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/git.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\n\nimport { env } from './env';\nimport { isInteractive } from './interactive';\nimport { confirmAsync } from './prompts';\nimport * as Log from '../log';\n\nexport async function maybeBailOnGitStatusAsync(): Promise<boolean> {\n if (env.EXPO_NO_GIT_STATUS) {\n Log.warn(\n 'Git status is dirty but the command will continue because EXPO_NO_GIT_STATUS is enabled...'\n );\n return false;\n }\n const isGitStatusClean = await validateGitStatusAsync();\n\n // Give people a chance to bail out if git working tree is dirty\n if (!isGitStatusClean) {\n if (!isInteractive()) {\n Log.warn(\n `Git status is dirty but the command will continue because the terminal is not interactive.`\n );\n return false;\n }\n\n Log.log();\n const answer = await confirmAsync({\n message: `Would you like to proceed?`,\n });\n\n if (!answer) {\n return true;\n }\n\n Log.log();\n }\n return false;\n}\n\nexport async function validateGitStatusAsync(): Promise<boolean> {\n let workingTreeStatus = 'unknown';\n try {\n const result = await spawnAsync('git', ['status', '--porcelain']);\n workingTreeStatus = result.stdout === '' ? 'clean' : 'dirty';\n } catch {\n // Maybe git is not installed?\n // Maybe this project is not using git?\n }\n\n if (workingTreeStatus === 'clean') {\n Log.log(`Your git working tree is ${chalk.green('clean')}`);\n Log.log('To revert the changes after this command completes, you can run the following:');\n Log.log(' git clean --force && git reset --hard');\n return true;\n } else if (workingTreeStatus === 'dirty') {\n Log.log(`${chalk.bold('Warning!')} Your git working tree is ${chalk.red('dirty')}.`);\n Log.log(\n `It's recommended to ${chalk.bold(\n 'commit all your changes before proceeding'\n )}, so you can revert the changes made by this command if necessary.`\n );\n } else {\n Log.log(\"We couldn't find a git repository in your project directory.\");\n Log.log(\"It's recommended to back up your project before proceeding.\");\n }\n\n return false;\n}\n"],"names":["maybeBailOnGitStatusAsync","validateGitStatusAsync","Log","env","EXPO_NO_GIT_STATUS","warn","isGitStatusClean","isInteractive","log","answer","confirmAsync","message","workingTreeStatus","result","spawnAsync","stdout","chalk","green","bold","red"],"mappings":"AAAA;;;;QAQsBA,yBAAyB,GAAzBA,yBAAyB;QAgCzBC,sBAAsB,GAAtBA,sBAAsB;AAxCrB,IAAA,WAAmB,kCAAnB,mBAAmB,EAAA;AACxB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEL,IAAA,IAA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IAED,IAAIH,iBAAiB,KAAK,OAAO,EAAE;QACjCV,GAAG,CAACM,GAAG,CAAC,CAAC,yBAAyB,EAAEQ,MAAK,QAAA,CAACC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5Df,GAAG,CAACM,GAAG,CAAC,gFAAgF,CAAC,CAAC;QAC1FN,GAAG,CAACM,GAAG,CAAC,yCAAyC,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC;KACb,MAAM,IAAII,iBAAiB,KAAK,OAAO,EAAE;QACxCV,GAAG,CAACM,GAAG,CAAC,CAAC,EAAEQ,MAAK,QAAA,CAACE,IAAI,CAAC,UAAU,CAAC,CAAC,0BAA0B,EAAEF,MAAK,QAAA,CAACG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACrFjB,GAAG,CAACM,GAAG,CACL,CAAC,oBAAoB,EAAEQ,MAAK,QAAA,CAACE,IAAI,CAC/B,2CAA2C,CAC5C,CAAC,kEAAkE,CAAC,CACtE,CAAC;KACH,MAAM;QACLhB,GAAG,CAACM,GAAG,CAAC,8DAA8D,CAAC,CAAC;QACxEN,GAAG,CAACM,GAAG,CAAC,6DAA6D,CAAC,CAAC;KACxE;IAED,OAAO,KAAK,CAAC;CACd"}
|
|
@@ -6,8 +6,8 @@ exports.attemptModification = attemptModification;
|
|
|
6
6
|
exports.warnAboutConfigAndThrow = warnAboutConfigAndThrow;
|
|
7
7
|
var _config = require("@expo/config");
|
|
8
8
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
9
|
-
var Log = _interopRequireWildcard(require("../log"));
|
|
10
9
|
var _errors = require("./errors");
|
|
10
|
+
var Log = _interopRequireWildcard(require("../log"));
|
|
11
11
|
function _interopRequireDefault(obj) {
|
|
12
12
|
return obj && obj.__esModule ? obj : {
|
|
13
13
|
default: obj
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/modifyConfigAsync.ts"],"sourcesContent":["import { ExpoConfig, modifyConfigAsync } from '@expo/config';\nimport chalk from 'chalk';\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/modifyConfigAsync.ts"],"sourcesContent":["import { ExpoConfig, modifyConfigAsync } from '@expo/config';\nimport chalk from 'chalk';\n\nimport { SilentError } from './errors';\nimport * as Log from '../log';\n\n/** Wraps `[@expo/config] modifyConfigAsync()` and adds additional logging. */\nexport async function attemptModification(\n projectRoot: string,\n edits: Partial<ExpoConfig>,\n exactEdits: Partial<ExpoConfig>\n): Promise<void> {\n const modification = await modifyConfigAsync(projectRoot, edits, {\n skipSDKVersionRequirement: true,\n });\n if (modification.type === 'success') {\n Log.log();\n } else {\n warnAboutConfigAndThrow(modification.type, modification.message!, exactEdits);\n }\n}\n\nfunction logNoConfig() {\n Log.log(\n chalk.yellow(\n `No Expo config was found. Please create an Expo config (${chalk.bold`app.json`} or ${chalk.bold`app.config.js`}) in your project root.`\n )\n );\n}\n\nexport function warnAboutConfigAndThrow(type: string, message: string, edits: Partial<ExpoConfig>) {\n Log.log();\n if (type === 'warn') {\n // The project is using a dynamic config, give the user a helpful log and bail out.\n Log.log(chalk.yellow(message));\n } else {\n logNoConfig();\n }\n\n notifyAboutManualConfigEdits(edits);\n throw new SilentError();\n}\n\nfunction notifyAboutManualConfigEdits(edits: Partial<ExpoConfig>) {\n Log.log(chalk.cyan(`Please add the following to your Expo config`));\n Log.log();\n Log.log(JSON.stringify(edits, null, 2));\n Log.log();\n}\n"],"names":["attemptModification","warnAboutConfigAndThrow","Log","projectRoot","edits","exactEdits","modification","modifyConfigAsync","skipSDKVersionRequirement","type","log","message","logNoConfig","chalk","yellow","bold","notifyAboutManualConfigEdits","SilentError","cyan","JSON","stringify"],"mappings":"AAAA;;;;QAOsBA,mBAAmB,GAAnBA,mBAAmB;QAuBzBC,uBAAuB,GAAvBA,uBAAuB;AA9BO,IAAA,OAAc,WAAd,cAAc,CAAA;AAC1C,IAAA,MAAO,kCAAP,OAAO,EAAA;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AAK,QAAA,CAACK,IAAI,CAAC,CAAC,4CAA4C,CAAC,CAAC,CAAC,CAAC;IACpEhB,GAAG,CAACQ,GAAG,EAAE,CAAC;IACVR,GAAG,CAACQ,GAAG,CAACS,IAAI,CAACC,SAAS,CAAChB,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACxCF,GAAG,CAACQ,GAAG,EAAE,CAAC;CACX"}
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
exports.attemptAddingPluginsAsync = attemptAddingPluginsAsync;
|
|
6
6
|
var _config = require("@expo/config");
|
|
7
|
-
var Log = _interopRequireWildcard(require("../log"));
|
|
8
7
|
var _modifyConfigAsync = require("./modifyConfigAsync");
|
|
8
|
+
var Log = _interopRequireWildcard(require("../log"));
|
|
9
9
|
function _interopRequireWildcard(obj) {
|
|
10
10
|
if (obj && obj.__esModule) {
|
|
11
11
|
return obj;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/modifyConfigPlugins.ts"],"sourcesContent":["import { ExpoConfig, modifyConfigAsync } from '@expo/config';\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/modifyConfigPlugins.ts"],"sourcesContent":["import { ExpoConfig, modifyConfigAsync } from '@expo/config';\n\nimport { warnAboutConfigAndThrow } from './modifyConfigAsync';\nimport * as Log from '../log';\n\nexport async function attemptAddingPluginsAsync(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'plugins'>,\n plugins: string[]\n): Promise<void> {\n if (!plugins.length) return;\n\n const edits = {\n plugins: [...new Set((exp.plugins || []).concat(plugins))],\n };\n const modification = await modifyConfigAsync(projectRoot, edits, {\n skipSDKVersionRequirement: true,\n skipPlugins: true,\n });\n if (modification.type === 'success') {\n Log.log(`\\u203A Added config plugin${plugins.length === 1 ? '' : 's'}: ${plugins.join(', ')}`);\n } else {\n const exactEdits = {\n plugins,\n };\n warnAboutConfigAndThrow(modification.type, modification.message!, exactEdits);\n }\n}\n"],"names":["attemptAddingPluginsAsync","Log","projectRoot","exp","plugins","length","edits","Set","concat","modification","modifyConfigAsync","skipSDKVersionRequirement","skipPlugins","type","log","join","exactEdits","warnAboutConfigAndThrow","message"],"mappings":"AAAA;;;;QAKsBA,yBAAyB,GAAzBA,yBAAyB;AALD,IAAA,OAAc,WAAd,cAAc,CAAA;AAEpB,IAAA,kBAAqB,WAArB,qBAAqB,CAAA;AACjDC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;;;;;;;;;;;;;;;;;;;;;;AAER,eAAeD,yBAAyB,CAC7CE,WAAmB,EACnBC,GAAgC,EAChCC,OAAiB,EACF;IACf,IAAI,CAACA,OAAO,CAACC,MAAM,EAAE,OAAO;IAE5B,MAAMC,KAAK,GAAG;QACZF,OAAO,EAAE;eAAI,IAAIG,GAAG,CAAC,CAACJ,GAAG,CAACC,OAAO,IAAI,EAAE,CAAC,CAACI,MAAM,CAACJ,OAAO,CAAC,CAAC;SAAC;KAC3D,AAAC;IACF,MAAMK,YAAY,GAAG,MAAMC,CAAAA,GAAAA,OAAiB,AAG1C,CAAA,kBAH0C,CAACR,WAAW,EAAEI,KAAK,EAAE;QAC/DK,yBAAyB,EAAE,IAAI;QAC/BC,WAAW,EAAE,IAAI;KAClB,CAAC,AAAC;IACH,IAAIH,YAAY,CAACI,IAAI,KAAK,SAAS,EAAE;QACnCZ,GAAG,CAACa,GAAG,CAAC,CAAC,0BAA0B,EAAEV,OAAO,CAACC,MAAM,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,EAAE,EAAED,OAAO,CAACW,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;KAChG,MAAM;QACL,MAAMC,UAAU,GAAG;YACjBZ,OAAO;SACR,AAAC;QACFa,CAAAA,GAAAA,kBAAuB,AAAsD,CAAA,wBAAtD,CAACR,YAAY,CAACI,IAAI,EAAEJ,YAAY,CAACS,OAAO,EAAGF,UAAU,CAAC,CAAC;KAC/E;CACF"}
|
package/build/src/utils/npm.js
CHANGED
|
@@ -16,10 +16,10 @@ var _slugify = _interopRequireDefault(require("slugify"));
|
|
|
16
16
|
var _stream = require("stream");
|
|
17
17
|
var _tar = _interopRequireDefault(require("tar"));
|
|
18
18
|
var _util = require("util");
|
|
19
|
-
var _client = require("../api/rest/client");
|
|
20
19
|
var _createFileTransform = require("./createFileTransform");
|
|
21
20
|
var _dir = require("./dir");
|
|
22
21
|
var _errors = require("./errors");
|
|
22
|
+
var _client = require("../api/rest/client");
|
|
23
23
|
function _interopRequireDefault(obj) {
|
|
24
24
|
return obj && obj.__esModule ? obj : {
|
|
25
25
|
default: obj
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/npm.ts"],"sourcesContent":["import { JSONValue } from '@expo/json-file';\nimport spawnAsync from '@expo/spawn-async';\nimport assert from 'assert';\nimport fs from 'fs';\nimport slugify from 'slugify';\nimport { Stream } from 'stream';\nimport tar from 'tar';\nimport { promisify } from 'util';\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/npm.ts"],"sourcesContent":["import { JSONValue } from '@expo/json-file';\nimport spawnAsync from '@expo/spawn-async';\nimport assert from 'assert';\nimport fs from 'fs';\nimport slugify from 'slugify';\nimport { Stream } from 'stream';\nimport tar from 'tar';\nimport { promisify } from 'util';\n\nimport { createEntryResolver, createFileTransform } from './createFileTransform';\nimport { ensureDirectoryAsync } from './dir';\nimport { CommandError } from './errors';\nimport { createCachedFetch } from '../api/rest/client';\n\nconst debug = require('debug')('expo:utils:npm') as typeof console.log;\n\nconst cachedFetch = createCachedFetch({\n cacheDirectory: 'template-cache',\n // Time to live. How long (in ms) responses remain cached before being automatically ejected. If undefined, responses are never automatically ejected from the cache.\n // ttl: 1000,\n});\n\nexport function sanitizeNpmPackageName(name: string): string {\n // https://github.com/npm/validate-npm-package-name/#naming-rules\n return (\n applyKnownNpmPackageNameRules(name) ||\n applyKnownNpmPackageNameRules(slugify(name)) ||\n // If nothing is left use 'app' like we do in Xcode projects.\n 'app'\n );\n}\n\nfunction applyKnownNpmPackageNameRules(name: string): string | null {\n // https://github.com/npm/validate-npm-package-name/#naming-rules\n\n // package name cannot start with '.' or '_'.\n while (/^(\\.|_)/.test(name)) {\n name = name.substring(1);\n }\n\n name = name.toLowerCase().replace(/[^a-zA-Z._\\-/@]/g, '');\n\n return (\n name\n // .replace(/![a-z0-9-._~]+/g, '')\n // Remove special characters\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '') || null\n );\n}\n\nexport async function npmViewAsync(...props: string[]): Promise<JSONValue> {\n const cmd = ['view', ...props, '--json'];\n const results = (await spawnAsync('npm', cmd)).stdout?.trim();\n const cmdString = `npm ${cmd.join(' ')}`;\n debug('Run:', cmdString);\n if (!results) {\n return null;\n }\n try {\n return JSON.parse(results);\n } catch (error: any) {\n throw new Error(\n `Could not parse JSON returned from \"${cmdString}\".\\n\\n${results}\\n\\nError: ${error.message}`\n );\n }\n}\n\n/** Given a package name like `expo` or `expo@beta`, return the registry URL if it exists. */\nexport async function getNpmUrlAsync(packageName: string): Promise<string> {\n const results = await npmViewAsync(packageName, 'dist.tarball');\n\n assert(results, `Could not get npm url for package \"${packageName}\"`);\n\n // Fully qualified url returns a string.\n // Example:\n // 𝝠 npm view expo-template-bare-minimum@sdk-33 dist.tarball --json\n if (typeof results === 'string') {\n return results;\n }\n\n // When the tag is arbitrary, the tarball url is an array, return the last value as it's the most recent.\n // Example:\n // 𝝠 npm view expo-template-bare-minimum@33 dist.tarball --json\n if (Array.isArray(results)) {\n return results[results.length - 1] as string;\n }\n\n throw new CommandError(\n 'Expected results of `npm view ...` to be an array or string. Instead found: ' + results\n );\n}\n\n// @ts-ignore\nconst pipeline = promisify(Stream.pipeline);\n\nexport async function downloadAndExtractNpmModuleAsync(\n npmName: string,\n props: ExtractProps\n): Promise<void> {\n const url = await getNpmUrlAsync(npmName);\n\n debug('Fetch from URL:', url);\n await extractNpmTarballFromUrlAsync(url, props);\n}\n\nexport async function extractLocalNpmTarballAsync(\n tarFilePath: string,\n props: ExtractProps\n): Promise<void> {\n const readStream = fs.createReadStream(tarFilePath);\n await extractNpmTarballAsync(readStream, props);\n}\n\ntype ExtractProps = {\n name: string;\n cwd: string;\n strip?: number;\n fileList?: string[];\n};\n\nasync function createUrlStreamAsync(url: string) {\n const response = await cachedFetch(url);\n if (!response.ok) {\n throw new Error(`Unexpected response: ${response.statusText}. From url: ${url}`);\n }\n\n return response.body;\n}\n\nexport async function extractNpmTarballFromUrlAsync(\n url: string,\n props: ExtractProps\n): Promise<void> {\n await extractNpmTarballAsync(await createUrlStreamAsync(url), props);\n}\n\nexport async function extractNpmTarballAsync(\n stream: NodeJS.ReadableStream,\n props: ExtractProps\n): Promise<void> {\n const { cwd, strip, name, fileList = [] } = props;\n\n await ensureDirectoryAsync(cwd);\n\n await pipeline(\n stream,\n tar.extract(\n {\n cwd,\n transform: createFileTransform(name),\n onentry: createEntryResolver(name),\n strip: strip ?? 1,\n },\n fileList\n )\n );\n}\n"],"names":["sanitizeNpmPackageName","npmViewAsync","getNpmUrlAsync","downloadAndExtractNpmModuleAsync","extractLocalNpmTarballAsync","extractNpmTarballFromUrlAsync","extractNpmTarballAsync","debug","require","cachedFetch","createCachedFetch","cacheDirectory","name","applyKnownNpmPackageNameRules","slugify","test","substring","toLowerCase","replace","normalize","props","cmd","results","spawnAsync","stdout","trim","cmdString","join","JSON","parse","error","Error","message","packageName","assert","Array","isArray","length","CommandError","pipeline","promisify","Stream","npmName","url","tarFilePath","readStream","fs","createReadStream","createUrlStreamAsync","response","ok","statusText","body","stream","cwd","strip","fileList","ensureDirectoryAsync","tar","extract","transform","createFileTransform","onentry","createEntryResolver"],"mappings":"AAAA;;;;QAsBgBA,sBAAsB,GAAtBA,sBAAsB;QA6BhBC,YAAY,GAAZA,YAAY;QAkBZC,cAAc,GAAdA,cAAc;QA2BdC,gCAAgC,GAAhCA,gCAAgC;QAUh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,eAAe/C,6BAA6B,CACjDsC,GAAW,EACXvB,KAAmB,EACJ;IACf,MAAMd,sBAAsB,CAAC,MAAM0C,oBAAoB,CAACL,GAAG,CAAC,EAAEvB,KAAK,CAAC,CAAC;CACtE;AAEM,eAAed,sBAAsB,CAC1C+C,MAA6B,EAC7BjC,KAAmB,EACJ;IACf,MAAM,EAAEkC,GAAG,CAAA,EAAEC,KAAK,CAAA,EAAE3C,IAAI,CAAA,EAAE4C,QAAQ,EAAG,EAAE,CAAA,EAAE,GAAGpC,KAAK,AAAC;IAElD,MAAMqC,CAAAA,GAAAA,IAAoB,AAAK,CAAA,qBAAL,CAACH,GAAG,CAAC,CAAC;IAEhC,MAAMf,QAAQ,CACZc,MAAM,EACNK,IAAG,QAAA,CAACC,OAAO,CACT;QACEL,GAAG;QACHM,SAAS,EAAEC,CAAAA,GAAAA,oBAAmB,AAAM,CAAA,oBAAN,CAACjD,IAAI,CAAC;QACpCkD,OAAO,EAAEC,CAAAA,GAAAA,oBAAmB,AAAM,CAAA,oBAAN,CAACnD,IAAI,CAAC;QAClC2C,KAAK,EAAEA,KAAK,WAALA,KAAK,GAAI,CAAC;KAClB,EACDC,QAAQ,CACT,CACF,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/obj.ts"],"sourcesContent":["/** `lodash.get` */\nexport function get(obj: any, key: string): any | null {\n const branches = key.split('.');\n let current: any = obj;\n let branch: string | undefined;\n while ((branch = branches.shift())) {\n if (!(branch in current)) {\n return null;\n }\n current = current[branch];\n }\n return current;\n}\n\n/** `lodash.set` */\nexport function set(obj: any, key: string, value: any): any | null {\n const branches = key.split('.');\n let current: any = obj;\n let branch: string | undefined;\n while ((branch = branches.shift())) {\n if (branches.length === 0) {\n current[branch] = value;\n return obj;\n }\n\n if (!(branch in current)) {\n current[branch] = {};\n }\n\n current = current[branch];\n }\n return null;\n}\n\n/** `lodash.pickBy` */\nexport function pickBy<T>(\n obj: { [key: string]: T },\n predicate: (value: T, key: string) => boolean | undefined\n) {\n return Object.entries(obj).reduce((acc, [key, value]) => {\n
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/obj.ts"],"sourcesContent":["/** `lodash.get` */\nexport function get(obj: any, key: string): any | null {\n const branches = key.split('.');\n let current: any = obj;\n let branch: string | undefined;\n while ((branch = branches.shift())) {\n if (!(branch in current)) {\n return null;\n }\n current = current[branch];\n }\n return current;\n}\n\n/** `lodash.set` */\nexport function set(obj: any, key: string, value: any): any | null {\n const branches = key.split('.');\n let current: any = obj;\n let branch: string | undefined;\n while ((branch = branches.shift())) {\n if (branches.length === 0) {\n current[branch] = value;\n return obj;\n }\n\n if (!(branch in current)) {\n current[branch] = {};\n }\n\n current = current[branch];\n }\n return null;\n}\n\n/** `lodash.pickBy` */\nexport function pickBy<T>(\n obj: { [key: string]: T },\n predicate: (value: T, key: string) => boolean | undefined\n) {\n return Object.entries(obj).reduce(\n (acc, [key, value]) => {\n if (predicate(value, key)) {\n acc[key] = value;\n }\n return acc;\n },\n {} as { [key: string]: T }\n );\n}\n"],"names":["get","set","pickBy","obj","key","branches","split","current","branch","shift","value","length","predicate","Object","entries","reduce","acc"],"mappings":"AACA;;;;QAAgBA,GAAG,GAAHA,GAAG;QAcHC,GAAG,GAAHA,GAAG;QAoBHC,MAAM,GAANA,MAAM;AAlCf,SAASF,GAAG,CAACG,GAAQ,EAAEC,GAAW,EAAc;IACrD,MAAMC,QAAQ,GAAGD,GAAG,CAACE,KAAK,CAAC,GAAG,CAAC,AAAC;IAChC,IAAIC,OAAO,GAAQJ,GAAG,AAAC;IACvB,IAAIK,MAAM,AAAoB,AAAC;IAC/B,MAAQA,MAAM,GAAGH,QAAQ,CAACI,KAAK,EAAE,CAAG;QAClC,IAAI,CAAC,CAACD,MAAM,IAAID,OAAO,CAAC,EAAE;YACxB,OAAO,IAAI,CAAC;SACb;QACDA,OAAO,GAAGA,OAAO,CAACC,MAAM,CAAC,CAAC;KAC3B;IACD,OAAOD,OAAO,CAAC;CAChB;AAGM,SAASN,GAAG,CAACE,GAAQ,EAAEC,GAAW,EAAEM,KAAU,EAAc;IACjE,MAAML,QAAQ,GAAGD,GAAG,CAACE,KAAK,CAAC,GAAG,CAAC,AAAC;IAChC,IAAIC,OAAO,GAAQJ,GAAG,AAAC;IACvB,IAAIK,MAAM,AAAoB,AAAC;IAC/B,MAAQA,MAAM,GAAGH,QAAQ,CAACI,KAAK,EAAE,CAAG;QAClC,IAAIJ,QAAQ,CAACM,MAAM,KAAK,CAAC,EAAE;YACzBJ,OAAO,CAACC,MAAM,CAAC,GAAGE,KAAK,CAAC;YACxB,OAAOP,GAAG,CAAC;SACZ;QAED,IAAI,CAAC,CAACK,MAAM,IAAID,OAAO,CAAC,EAAE;YACxBA,OAAO,CAACC,MAAM,CAAC,GAAG,EAAE,CAAC;SACtB;QAEDD,OAAO,GAAGA,OAAO,CAACC,MAAM,CAAC,CAAC;KAC3B;IACD,OAAO,IAAI,CAAC;CACb;AAGM,SAASN,MAAM,CACpBC,GAAyB,EACzBS,SAAyD,EACzD;IACA,OAAOC,MAAM,CAACC,OAAO,CAACX,GAAG,CAAC,CAACY,MAAM,CAC/B,CAACC,GAAG,EAAE,CAACZ,GAAG,EAAEM,KAAK,CAAC,GAAK;QACrB,IAAIE,SAAS,CAACF,KAAK,EAAEN,GAAG,CAAC,EAAE;YACzBY,GAAG,CAACZ,GAAG,CAAC,GAAGM,KAAK,CAAC;SAClB;QACD,OAAOM,GAAG,CAAC;KACZ,EACD,EAAE,CACH,CAAC;CACH"}
|
package/build/src/utils/plist.js
CHANGED
|
@@ -7,8 +7,8 @@ exports.parsePlistBuffer = parsePlistBuffer;
|
|
|
7
7
|
var _plist = _interopRequireDefault(require("@expo/plist"));
|
|
8
8
|
var _bplistParser = _interopRequireDefault(require("bplist-parser"));
|
|
9
9
|
var _promises = _interopRequireDefault(require("fs/promises"));
|
|
10
|
-
var Log = _interopRequireWildcard(require("../log"));
|
|
11
10
|
var _errors = require("./errors");
|
|
11
|
+
var Log = _interopRequireWildcard(require("../log"));
|
|
12
12
|
function _interopRequireDefault(obj) {
|
|
13
13
|
return obj && obj.__esModule ? obj : {
|
|
14
14
|
default: obj
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/plist.ts"],"sourcesContent":["import plist from '@expo/plist';\nimport binaryPlist from 'bplist-parser';\nimport fs from 'fs/promises';\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/plist.ts"],"sourcesContent":["import plist from '@expo/plist';\nimport binaryPlist from 'bplist-parser';\nimport fs from 'fs/promises';\n\nimport { CommandError } from './errors';\nimport * as Log from '../log';\n\nconst CHAR_CHEVRON_OPEN = 60;\nconst CHAR_B_LOWER = 98;\n// .mobileprovision\n// const CHAR_ZERO = 30;\n\nexport async function parsePlistAsync(plistPath: string) {\n Log.debug(`Parse plist: ${plistPath}`);\n\n return parsePlistBuffer(await fs.readFile(plistPath));\n}\n\nexport function parsePlistBuffer(contents: Buffer) {\n if (contents[0] === CHAR_CHEVRON_OPEN) {\n const info = plist.parse(contents.toString());\n if (Array.isArray(info)) return info[0];\n return info;\n } else if (contents[0] === CHAR_B_LOWER) {\n // @ts-expect-error\n const info = binaryPlist.parseBuffer(contents);\n if (Array.isArray(info)) return info[0];\n return info;\n } else {\n throw new CommandError(\n 'PLIST',\n `Cannot parse plist of type byte (0x${contents[0].toString(16)})`\n );\n }\n}\n"],"names":["parsePlistAsync","parsePlistBuffer","Log","CHAR_CHEVRON_OPEN","CHAR_B_LOWER","plistPath","debug","fs","readFile","contents","info","plist","parse","toString","Array","isArray","binaryPlist","parseBuffer","CommandError"],"mappings":"AAAA;;;;QAYsBA,eAAe,GAAfA,eAAe;QAMrBC,gBAAgB,GAAhBA,gBAAgB;AAlBd,IAAA,MAAa,kCAAb,aAAa,EAAA;AACP,IAAA,aAAe,kCAAf,eAAe,EAAA;AACxB,IAAA,SAAa,kCAAb,aAAa,EAAA;AAEC,IAAA,OAA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|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
5
|
exports.getFreePortAsync = getFreePortAsync;
|
|
6
|
+
exports.ensurePortAvailabilityAsync = ensurePortAvailabilityAsync;
|
|
6
7
|
exports.choosePortAsync = choosePortAsync;
|
|
7
8
|
exports.resolvePortAsync = resolvePortAsync;
|
|
8
9
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
9
10
|
var _freeportAsync = _interopRequireDefault(require("freeport-async"));
|
|
10
|
-
var Log = _interopRequireWildcard(require("../log"));
|
|
11
11
|
var _env = require("./env");
|
|
12
12
|
var _errors = require("./errors");
|
|
13
|
+
var Log = _interopRequireWildcard(require("../log"));
|
|
13
14
|
function _interopRequireDefault(obj) {
|
|
14
15
|
return obj && obj.__esModule ? obj : {
|
|
15
16
|
default: obj
|
|
@@ -48,21 +49,46 @@ async function getFreePortAsync(rangeStart) {
|
|
|
48
49
|
}
|
|
49
50
|
return port;
|
|
50
51
|
}
|
|
52
|
+
async function ensurePortAvailabilityAsync(projectRoot, { port }) {
|
|
53
|
+
const freePort = await (0, _freeportAsync).default(port, {
|
|
54
|
+
hostnames: [
|
|
55
|
+
null
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
// Check if port has become busy during the build.
|
|
59
|
+
if (freePort === port) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
const isBusy = await isBusyPortRunningSameProcessAsync(projectRoot, {
|
|
63
|
+
port
|
|
64
|
+
});
|
|
65
|
+
if (!isBusy) {
|
|
66
|
+
throw new _errors.CommandError(`Port "${port}" became busy running another process while the app was compiling. Re-run command to use a new port.`);
|
|
67
|
+
}
|
|
68
|
+
// Log that the dev server will not be started and that the logs will appear in another window.
|
|
69
|
+
Log.log("\u203A The dev server for this app is already running in another window. Logs will appear there.");
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
function isRestrictedPort(port) {
|
|
73
|
+
if (process.platform !== "win32" && port < 1024) {
|
|
74
|
+
const isRoot = process.getuid && process.getuid() === 0;
|
|
75
|
+
return !isRoot;
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
async function isBusyPortRunningSameProcessAsync(projectRoot, { port }) {
|
|
80
|
+
const { getRunningProcess } = require("./getRunningProcess");
|
|
81
|
+
const runningProcess = isRestrictedPort(port) ? null : getRunningProcess(port);
|
|
82
|
+
if (runningProcess) {
|
|
83
|
+
if (runningProcess.directory === projectRoot) {
|
|
84
|
+
return true;
|
|
85
|
+
} else {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
51
91
|
async function choosePortAsync(projectRoot, { defaultPort , host , reuseExistingPort }) {
|
|
52
|
-
const [{ getRunningProcess }, { confirmAsync }, isRoot, Log1] = await Promise.all([
|
|
53
|
-
Promise.resolve().then(function() {
|
|
54
|
-
return _interopRequireWildcard(require("./getRunningProcess"));
|
|
55
|
-
}),
|
|
56
|
-
Promise.resolve().then(function() {
|
|
57
|
-
return _interopRequireWildcard(require("./prompts"));
|
|
58
|
-
}),
|
|
59
|
-
Promise.resolve().then(function() {
|
|
60
|
-
return _interopRequireWildcard(require("is-root"));
|
|
61
|
-
}),
|
|
62
|
-
Promise.resolve().then(function() {
|
|
63
|
-
return _interopRequireWildcard(require("../log"));
|
|
64
|
-
}),
|
|
65
|
-
]);
|
|
66
92
|
try {
|
|
67
93
|
const port = await (0, _freeportAsync).default(defaultPort, {
|
|
68
94
|
hostnames: [
|
|
@@ -72,8 +98,9 @@ async function choosePortAsync(projectRoot, { defaultPort , host , reuseExisting
|
|
|
72
98
|
if (port === defaultPort) {
|
|
73
99
|
return port;
|
|
74
100
|
}
|
|
75
|
-
const isRestricted =
|
|
101
|
+
const isRestricted = isRestrictedPort(port);
|
|
76
102
|
let message = isRestricted ? `Admin permissions are required to run a server on a port below 1024` : `Port ${_chalk.default.bold(defaultPort)} is`;
|
|
103
|
+
const { getRunningProcess } = require("./getRunningProcess");
|
|
77
104
|
const runningProcess = isRestricted ? null : getRunningProcess(defaultPort);
|
|
78
105
|
if (runningProcess) {
|
|
79
106
|
const pidTag = _chalk.default.gray(`(pid ${runningProcess.pid})`);
|
|
@@ -89,7 +116,8 @@ async function choosePortAsync(projectRoot, { defaultPort , host , reuseExisting
|
|
|
89
116
|
} else {
|
|
90
117
|
message += " being used by another process";
|
|
91
118
|
}
|
|
92
|
-
|
|
119
|
+
Log.log(`\u203A ${message}`);
|
|
120
|
+
const { confirmAsync } = require("./prompts");
|
|
93
121
|
const change = await confirmAsync({
|
|
94
122
|
message: `Use port ${port} instead?`,
|
|
95
123
|
initial: true
|
|
@@ -99,7 +127,7 @@ async function choosePortAsync(projectRoot, { defaultPort , host , reuseExisting
|
|
|
99
127
|
if (error.code === "ABORTED") {
|
|
100
128
|
throw error;
|
|
101
129
|
} else if (error.code === "NON_INTERACTIVE") {
|
|
102
|
-
|
|
130
|
+
Log.warn(_chalk.default.yellow(error.message));
|
|
103
131
|
return null;
|
|
104
132
|
}
|
|
105
133
|
throw error;
|