@expo/cli 0.0.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +106 -0
- package/build/bin/cli +152 -0
- package/build/bin/cli.map +1 -0
- package/build/src/api/endpoint.js +17 -0
- package/build/src/api/endpoint.js.map +1 -0
- package/build/src/api/getExpoGoIntermediateCertificate.js +21 -0
- package/build/src/api/getExpoGoIntermediateCertificate.js.map +1 -0
- package/build/src/api/getExpoSchema.js +69 -0
- package/build/src/api/getExpoSchema.js.map +1 -0
- package/build/src/api/getNativeModuleVersions.js +31 -0
- package/build/src/api/getNativeModuleVersions.js.map +1 -0
- package/build/src/api/getProject.js +19 -0
- package/build/src/api/getProject.js.map +1 -0
- package/build/src/api/getProjectDevelopmentCertificate.js +24 -0
- package/build/src/api/getProjectDevelopmentCertificate.js.map +1 -0
- package/build/src/api/getVersions.js +37 -0
- package/build/src/api/getVersions.js.map +1 -0
- package/build/src/api/graphql/client.js +104 -0
- package/build/src/api/graphql/client.js.map +1 -0
- package/build/src/api/graphql/generated.js +113 -0
- package/build/src/api/graphql/generated.js.map +1 -0
- package/build/src/api/graphql/queries/UserQuery.js +43 -0
- package/build/src/api/graphql/queries/UserQuery.js.map +1 -0
- package/build/src/api/rest/cache/FileSystemCache.js +79 -0
- package/build/src/api/rest/cache/FileSystemCache.js.map +1 -0
- package/build/src/api/rest/cache/response.js +31 -0
- package/build/src/api/rest/cache/response.js.map +1 -0
- package/build/src/api/rest/cache/wrapFetchWithCache.js +156 -0
- package/build/src/api/rest/cache/wrapFetchWithCache.js.map +1 -0
- package/build/src/api/rest/client.js +94 -0
- package/build/src/api/rest/client.js.map +1 -0
- package/build/src/api/rest/client.types.js +6 -0
- package/build/src/api/rest/client.types.js.map +1 -0
- package/build/src/api/rest/wrapFetchWithBaseUrl.js +20 -0
- package/build/src/api/rest/wrapFetchWithBaseUrl.js.map +1 -0
- package/build/src/api/rest/wrapFetchWithOffline.js +39 -0
- package/build/src/api/rest/wrapFetchWithOffline.js.map +1 -0
- package/build/src/api/rest/wrapFetchWithProgress.js +59 -0
- package/build/src/api/rest/wrapFetchWithProgress.js.map +1 -0
- package/build/src/api/settings.js +11 -0
- package/build/src/api/settings.js.map +1 -0
- package/build/src/api/signManifest.js +38 -0
- package/build/src/api/signManifest.js.map +1 -0
- package/build/src/api/updateDevelopmentSession.js +74 -0
- package/build/src/api/updateDevelopmentSession.js.map +1 -0
- package/build/src/api/user/UserSettings.js +71 -0
- package/build/src/api/user/UserSettings.js.map +1 -0
- package/build/src/api/user/actions.js +97 -0
- package/build/src/api/user/actions.js.map +1 -0
- package/build/src/api/user/otp.js +139 -0
- package/build/src/api/user/otp.js.map +1 -0
- package/build/src/api/user/user.js +114 -0
- package/build/src/api/user/user.js.map +1 -0
- package/build/src/config/configAsync.js +118 -0
- package/build/src/config/configAsync.js.map +1 -0
- package/build/src/config/index.js +75 -0
- package/build/src/config/index.js.map +1 -0
- package/build/src/export/createBundles.js +62 -0
- package/build/src/export/createBundles.js.map +1 -0
- package/build/src/export/createMetadataJson.js +36 -0
- package/build/src/export/createMetadataJson.js.map +1 -0
- package/build/src/export/exportApp.js +102 -0
- package/build/src/export/exportApp.js.map +1 -0
- package/build/src/export/exportAssets.js +106 -0
- package/build/src/export/exportAssets.js.map +1 -0
- package/build/src/export/exportAsync.js +49 -0
- package/build/src/export/exportAsync.js.map +1 -0
- package/build/src/export/fork-bundleAsync.js +138 -0
- package/build/src/export/fork-bundleAsync.js.map +1 -0
- package/build/src/export/getPublicExpoManifest.js +28 -0
- package/build/src/export/getPublicExpoManifest.js.map +1 -0
- package/build/src/export/getResolvedLocales.js +35 -0
- package/build/src/export/getResolvedLocales.js.map +1 -0
- package/build/src/export/index.js +77 -0
- package/build/src/export/index.js.map +1 -0
- package/build/src/export/printBundleSizes.js +122 -0
- package/build/src/export/printBundleSizes.js.map +1 -0
- package/build/src/export/resolveOptions.js +24 -0
- package/build/src/export/resolveOptions.js.map +1 -0
- package/build/src/export/saveAssets.js +65 -0
- package/build/src/export/saveAssets.js.map +1 -0
- package/build/src/export/writeContents.js +108 -0
- package/build/src/export/writeContents.js.map +1 -0
- package/build/src/install/checkPackages.js +74 -0
- package/build/src/install/checkPackages.js.map +1 -0
- package/build/src/install/index.js +49 -0
- package/build/src/install/index.js.map +1 -0
- package/build/src/install/installAsync.js +103 -0
- package/build/src/install/installAsync.js.map +1 -0
- package/build/src/install/resolveOptions.js +99 -0
- package/build/src/install/resolveOptions.js.map +1 -0
- package/build/src/install/utils/autoAddConfigPlugins.js +87 -0
- package/build/src/install/utils/autoAddConfigPlugins.js.map +1 -0
- package/build/src/log.js +74 -0
- package/build/src/log.js.map +1 -0
- package/build/src/login/index.js +62 -0
- package/build/src/login/index.js.map +1 -0
- package/build/src/logout/index.js +48 -0
- package/build/src/logout/index.js.map +1 -0
- package/build/src/prebuild/clearNativeFolder.js +137 -0
- package/build/src/prebuild/clearNativeFolder.js.map +1 -0
- package/build/src/prebuild/configureProjectAsync.js +68 -0
- package/build/src/prebuild/configureProjectAsync.js.map +1 -0
- package/build/src/prebuild/copyTemplateFiles.js +124 -0
- package/build/src/prebuild/copyTemplateFiles.js.map +1 -0
- package/build/src/prebuild/ensureConfigAsync.js +86 -0
- package/build/src/prebuild/ensureConfigAsync.js.map +1 -0
- package/build/src/prebuild/index.js +90 -0
- package/build/src/prebuild/index.js.map +1 -0
- package/build/src/prebuild/prebuildAsync.js +112 -0
- package/build/src/prebuild/prebuildAsync.js.map +1 -0
- package/build/src/prebuild/resolveOptions.js +97 -0
- package/build/src/prebuild/resolveOptions.js.map +1 -0
- package/build/src/prebuild/resolveTemplate.js +157 -0
- package/build/src/prebuild/resolveTemplate.js.map +1 -0
- package/build/src/prebuild/updateFromTemplate.js +102 -0
- package/build/src/prebuild/updateFromTemplate.js.map +1 -0
- package/build/src/prebuild/updatePackageJson.js +236 -0
- package/build/src/prebuild/updatePackageJson.js.map +1 -0
- package/build/src/prebuild/writeMetroConfig.js +89 -0
- package/build/src/prebuild/writeMetroConfig.js.map +1 -0
- package/build/src/register/index.js +48 -0
- package/build/src/register/index.js.map +1 -0
- package/build/src/register/registerAsync.js +37 -0
- package/build/src/register/registerAsync.js.map +1 -0
- package/build/src/run/android/index.js +97 -0
- package/build/src/run/android/index.js.map +1 -0
- package/build/src/run/android/resolveDevice.js +23 -0
- package/build/src/run/android/resolveDevice.js.map +1 -0
- package/build/src/run/android/resolveGradleProps.js +37 -0
- package/build/src/run/android/resolveGradleProps.js.map +1 -0
- package/build/src/run/android/resolveInstallApkName.js +72 -0
- package/build/src/run/android/resolveInstallApkName.js.map +1 -0
- package/build/src/run/android/resolveLaunchProps.js +32 -0
- package/build/src/run/android/resolveLaunchProps.js.map +1 -0
- package/build/src/run/android/resolveOptions.js +25 -0
- package/build/src/run/android/resolveOptions.js.map +1 -0
- package/build/src/run/android/runAndroidAsync.js +74 -0
- package/build/src/run/android/runAndroidAsync.js.map +1 -0
- package/build/src/run/ensureNativeProject.js +33 -0
- package/build/src/run/ensureNativeProject.js.map +1 -0
- package/build/src/run/hints.js +22 -0
- package/build/src/run/hints.js.map +1 -0
- package/build/src/run/resolveBundlerProps.js +31 -0
- package/build/src/run/resolveBundlerProps.js.map +1 -0
- package/build/src/run/startBundler.js +76 -0
- package/build/src/run/startBundler.js.map +1 -0
- package/build/src/start/doctor/Prerequisite.js +47 -0
- package/build/src/start/doctor/Prerequisite.js.map +1 -0
- package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js +68 -0
- package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js.map +1 -0
- package/build/src/start/doctor/apple/XcodePrerequisite.js +115 -0
- package/build/src/start/doctor/apple/XcodePrerequisite.js.map +1 -0
- package/build/src/start/doctor/apple/XcrunPrerequisite.js +65 -0
- package/build/src/start/doctor/apple/XcrunPrerequisite.js.map +1 -0
- package/build/src/start/doctor/dependencies/bundledNativeModules.js +64 -0
- package/build/src/start/doctor/dependencies/bundledNativeModules.js.map +1 -0
- package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js +131 -0
- package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js.map +1 -0
- package/build/src/start/doctor/dependencies/getMissingPackages.js +95 -0
- package/build/src/start/doctor/dependencies/getMissingPackages.js.map +1 -0
- package/build/src/start/doctor/dependencies/getVersionedPackages.js +119 -0
- package/build/src/start/doctor/dependencies/getVersionedPackages.js.map +1 -0
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js +147 -0
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js.map +1 -0
- package/build/src/start/doctor/ngrok/ExternalModule.js +164 -0
- package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -0
- package/build/src/start/doctor/ngrok/NgrokResolver.js +17 -0
- package/build/src/start/doctor/ngrok/NgrokResolver.js.map +1 -0
- package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js +142 -0
- package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js.map +1 -0
- package/build/src/start/doctor/typescript/updateTSConfig.js +92 -0
- package/build/src/start/doctor/typescript/updateTSConfig.js.map +1 -0
- package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js +112 -0
- package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js.map +1 -0
- package/build/src/start/index.js +116 -0
- package/build/src/start/index.js.map +1 -0
- package/build/src/start/interface/KeyPressHandler.js +99 -0
- package/build/src/start/interface/KeyPressHandler.js.map +1 -0
- package/build/src/start/interface/commandsTable.js +175 -0
- package/build/src/start/interface/commandsTable.js.map +1 -0
- package/build/src/start/interface/interactiveActions.js +134 -0
- package/build/src/start/interface/interactiveActions.js.map +1 -0
- package/build/src/start/interface/startInterface.js +217 -0
- package/build/src/start/interface/startInterface.js.map +1 -0
- package/build/src/start/platforms/AppIdResolver.js +44 -0
- package/build/src/start/platforms/AppIdResolver.js.map +1 -0
- package/build/src/start/platforms/DeviceManager.js +43 -0
- package/build/src/start/platforms/DeviceManager.js.map +1 -0
- package/build/src/start/platforms/ExpoGoInstaller.js +111 -0
- package/build/src/start/platforms/ExpoGoInstaller.js.map +1 -0
- package/build/src/start/platforms/PlatformManager.js +121 -0
- package/build/src/start/platforms/PlatformManager.js.map +1 -0
- package/build/src/start/platforms/android/ADBServer.js +129 -0
- package/build/src/start/platforms/android/ADBServer.js.map +1 -0
- package/build/src/start/platforms/android/AndroidAppIdResolver.js +40 -0
- package/build/src/start/platforms/android/AndroidAppIdResolver.js.map +1 -0
- package/build/src/start/platforms/android/AndroidDeviceManager.js +183 -0
- package/build/src/start/platforms/android/AndroidDeviceManager.js.map +1 -0
- package/build/src/start/platforms/android/AndroidPlatformManager.js +35 -0
- package/build/src/start/platforms/android/AndroidPlatformManager.js.map +1 -0
- package/build/src/start/platforms/android/activateWindow.js +80 -0
- package/build/src/start/platforms/android/activateWindow.js.map +1 -0
- package/build/src/start/platforms/android/adb.js +263 -0
- package/build/src/start/platforms/android/adb.js.map +1 -0
- package/build/src/start/platforms/android/adbReverse.js +84 -0
- package/build/src/start/platforms/android/adbReverse.js.map +1 -0
- package/build/src/start/platforms/android/emulator.js +118 -0
- package/build/src/start/platforms/android/emulator.js.map +1 -0
- package/build/src/start/platforms/android/getDevices.js +36 -0
- package/build/src/start/platforms/android/getDevices.js.map +1 -0
- package/build/src/start/platforms/android/gradle.js +86 -0
- package/build/src/start/platforms/android/gradle.js.map +1 -0
- package/build/src/start/platforms/android/promptAndroidDevice.js +60 -0
- package/build/src/start/platforms/android/promptAndroidDevice.js.map +1 -0
- package/build/src/start/platforms/ios/AppleAppIdResolver.js +46 -0
- package/build/src/start/platforms/ios/AppleAppIdResolver.js.map +1 -0
- package/build/src/start/platforms/ios/AppleDeviceManager.js +201 -0
- package/build/src/start/platforms/ios/AppleDeviceManager.js.map +1 -0
- package/build/src/start/platforms/ios/ApplePlatformManager.js +31 -0
- package/build/src/start/platforms/ios/ApplePlatformManager.js.map +1 -0
- package/build/src/start/platforms/ios/assertSystemRequirements.js +16 -0
- package/build/src/start/platforms/ios/assertSystemRequirements.js.map +1 -0
- package/build/src/start/platforms/ios/ensureSimulatorAppRunning.js +85 -0
- package/build/src/start/platforms/ios/ensureSimulatorAppRunning.js.map +1 -0
- package/build/src/start/platforms/ios/getBestSimulator.js +101 -0
- package/build/src/start/platforms/ios/getBestSimulator.js.map +1 -0
- package/build/src/start/platforms/ios/promptAppleDevice.js +60 -0
- package/build/src/start/platforms/ios/promptAppleDevice.js.map +1 -0
- package/build/src/start/platforms/ios/simctl.js +229 -0
- package/build/src/start/platforms/ios/simctl.js.map +1 -0
- package/build/src/start/platforms/ios/xcrun.js +67 -0
- package/build/src/start/platforms/ios/xcrun.js.map +1 -0
- package/build/src/start/project/devices.js +77 -0
- package/build/src/start/project/devices.js.map +1 -0
- package/build/src/start/project/dotExpo.js +74 -0
- package/build/src/start/project/dotExpo.js.map +1 -0
- package/build/src/start/project/settings.js +13 -0
- package/build/src/start/project/settings.js.map +1 -0
- package/build/src/start/resolveOptions.js +156 -0
- package/build/src/start/resolveOptions.js.map +1 -0
- package/build/src/start/server/AsyncNgrok.js +173 -0
- package/build/src/start/server/AsyncNgrok.js.map +1 -0
- package/build/src/start/server/BundlerDevServer.js +312 -0
- package/build/src/start/server/BundlerDevServer.js.map +1 -0
- package/build/src/start/server/DevServerManager.js +142 -0
- package/build/src/start/server/DevServerManager.js.map +1 -0
- package/build/src/start/server/DevelopmentSession.js +104 -0
- package/build/src/start/server/DevelopmentSession.js.map +1 -0
- package/build/src/start/server/UrlCreator.js +159 -0
- package/build/src/start/server/UrlCreator.js.map +1 -0
- package/build/src/start/server/metro/MetroBundlerDevServer.js +97 -0
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -0
- package/build/src/start/server/metro/MetroTerminalReporter.js +178 -0
- package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -0
- package/build/src/start/server/metro/TerminalReporter.js +87 -0
- package/build/src/start/server/metro/TerminalReporter.js.map +1 -0
- package/build/src/start/server/metro/TerminalReporter.types.js +6 -0
- package/build/src/start/server/metro/TerminalReporter.types.js.map +1 -0
- package/build/src/start/server/metro/instantiateMetro.js +66 -0
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -0
- package/build/src/start/server/metro/resolveFromProject.js +38 -0
- package/build/src/start/server/metro/resolveFromProject.js.map +1 -0
- package/build/src/start/server/middleware/ClassicManifestMiddleware.js +145 -0
- package/build/src/start/server/middleware/ClassicManifestMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js +185 -0
- package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/ExpoMiddleware.js +78 -0
- package/build/src/start/server/middleware/ExpoMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/InterstitialPageMiddleware.js +70 -0
- package/build/src/start/server/middleware/InterstitialPageMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/ManifestMiddleware.js +177 -0
- package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js +69 -0
- package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/createDevServerMiddleware.js +24 -0
- package/build/src/start/server/middleware/createDevServerMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/resolveAssets.js +110 -0
- package/build/src/start/server/middleware/resolveAssets.js.map +1 -0
- package/build/src/start/server/middleware/resolveEntryPoint.js +37 -0
- package/build/src/start/server/middleware/resolveEntryPoint.js.map +1 -0
- package/build/src/start/server/middleware/resolvePlatform.js +32 -0
- package/build/src/start/server/middleware/resolvePlatform.js.map +1 -0
- package/build/src/start/server/middleware/server.types.js +6 -0
- package/build/src/start/server/middleware/server.types.js.map +1 -0
- package/build/src/start/server/openPlatforms.js +30 -0
- package/build/src/start/server/openPlatforms.js.map +1 -0
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js +299 -0
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js.map +1 -0
- package/build/src/start/server/webpack/formatWebpackMessages.js +94 -0
- package/build/src/start/server/webpack/formatWebpackMessages.js.map +1 -0
- package/build/src/start/server/webpack/resolveFromProject.js +43 -0
- package/build/src/start/server/webpack/resolveFromProject.js.map +1 -0
- package/build/src/start/server/webpack/tls.js +72 -0
- package/build/src/start/server/webpack/tls.js.map +1 -0
- package/build/src/start/startAsync.js +150 -0
- package/build/src/start/startAsync.js.map +1 -0
- package/build/src/utils/FileNotifier.js +71 -0
- package/build/src/utils/FileNotifier.js.map +1 -0
- package/build/src/utils/analytics/getDevClientProperties.js +41 -0
- package/build/src/utils/analytics/getDevClientProperties.js.map +1 -0
- package/build/src/utils/analytics/rudderstackClient.js +106 -0
- package/build/src/utils/analytics/rudderstackClient.js.map +1 -0
- package/build/src/utils/ansi.js +17 -0
- package/build/src/utils/ansi.js.map +1 -0
- package/build/src/utils/args.js +77 -0
- package/build/src/utils/args.js.map +1 -0
- package/build/src/utils/array.js +56 -0
- package/build/src/utils/array.js.map +1 -0
- package/build/src/utils/cocoapods.js +143 -0
- package/build/src/utils/cocoapods.js.map +1 -0
- package/build/src/utils/codesigning.js +283 -0
- package/build/src/utils/codesigning.js.map +1 -0
- package/build/src/utils/createFileTransform.js +89 -0
- package/build/src/utils/createFileTransform.js.map +1 -0
- package/build/src/utils/delay.js +39 -0
- package/build/src/utils/delay.js.map +1 -0
- package/build/src/utils/dir.js +38 -0
- package/build/src/utils/dir.js.map +1 -0
- package/build/src/utils/downloadAppAsync.js +74 -0
- package/build/src/utils/downloadAppAsync.js.map +1 -0
- package/build/src/utils/downloadExpoGoAsync.js +99 -0
- package/build/src/utils/downloadExpoGoAsync.js.map +1 -0
- package/build/src/utils/editor.js +60 -0
- package/build/src/utils/editor.js.map +1 -0
- package/build/src/utils/env.js +62 -0
- package/build/src/utils/env.js.map +1 -0
- package/build/src/utils/errors.js +69 -0
- package/build/src/utils/errors.js.map +1 -0
- package/build/src/utils/exit.js +90 -0
- package/build/src/utils/exit.js.map +1 -0
- package/build/src/utils/findUp.js +33 -0
- package/build/src/utils/findUp.js.map +1 -0
- package/build/src/utils/fn.js +32 -0
- package/build/src/utils/fn.js.map +1 -0
- package/build/src/utils/getOrPromptApplicationId.js +183 -0
- package/build/src/utils/getOrPromptApplicationId.js.map +1 -0
- package/build/src/utils/getRunningProcess.js +92 -0
- package/build/src/utils/getRunningProcess.js.map +1 -0
- package/build/src/utils/git.js +88 -0
- package/build/src/utils/git.js.map +1 -0
- package/build/src/utils/glob.js +65 -0
- package/build/src/utils/glob.js.map +1 -0
- package/build/src/utils/ip.js +16 -0
- package/build/src/utils/ip.js.map +1 -0
- package/build/src/utils/isModuleSymlinked.js +37 -0
- package/build/src/utils/isModuleSymlinked.js.map +1 -0
- package/build/src/utils/link.js +31 -0
- package/build/src/utils/link.js.map +1 -0
- package/build/src/utils/mergeGitIgnorePaths.js +112 -0
- package/build/src/utils/mergeGitIgnorePaths.js.map +1 -0
- package/build/src/utils/modifyConfigAsync.js +68 -0
- package/build/src/utils/modifyConfigAsync.js.map +1 -0
- package/build/src/utils/modifyConfigPlugins.js +51 -0
- package/build/src/utils/modifyConfigPlugins.js.map +1 -0
- package/build/src/utils/nodeModules.js +118 -0
- package/build/src/utils/nodeModules.js.map +1 -0
- package/build/src/utils/npm.js +144 -0
- package/build/src/utils/npm.js.map +1 -0
- package/build/src/utils/obj.js +45 -0
- package/build/src/utils/obj.js.map +1 -0
- package/build/src/utils/ora.js +102 -0
- package/build/src/utils/ora.js.map +1 -0
- package/build/src/utils/port.js +130 -0
- package/build/src/utils/port.js.map +1 -0
- package/build/src/utils/profile.js +63 -0
- package/build/src/utils/profile.js.map +1 -0
- package/build/src/utils/progress.js +15 -0
- package/build/src/utils/progress.js.map +1 -0
- package/build/src/utils/prompts.js +127 -0
- package/build/src/utils/prompts.js.map +1 -0
- package/build/src/utils/resolveArgs.js +94 -0
- package/build/src/utils/resolveArgs.js.map +1 -0
- package/build/src/utils/scheme.js +106 -0
- package/build/src/utils/scheme.js.map +1 -0
- package/build/src/utils/tar.js +59 -0
- package/build/src/utils/tar.js.map +1 -0
- package/build/src/utils/url.js +67 -0
- package/build/src/utils/url.js.map +1 -0
- package/build/src/utils/validateApplicationId.js +90 -0
- package/build/src/utils/validateApplicationId.js.map +1 -0
- package/build/src/whoami/index.js +47 -0
- package/build/src/whoami/index.js.map +1 -0
- package/build/src/whoami/whoamiAsync.js +44 -0
- package/build/src/whoami/whoamiAsync.js.map +1 -0
- package/package.json +132 -4
- package/static/loading-page/index.html +270 -0
- package/index.js +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.exportAppAsync = exportAppAsync;
|
|
6
|
+
var _path = _interopRequireDefault(require("path"));
|
|
7
|
+
var Log = _interopRequireWildcard(require("../log"));
|
|
8
|
+
var _dir = require("../utils/dir");
|
|
9
|
+
var _createBundles = require("./createBundles");
|
|
10
|
+
var _exportAssets = require("./exportAssets");
|
|
11
|
+
var _getPublicExpoManifest = require("./getPublicExpoManifest");
|
|
12
|
+
var _printBundleSizes = require("./printBundleSizes");
|
|
13
|
+
var _writeContents = require("./writeContents");
|
|
14
|
+
function _interopRequireDefault(obj) {
|
|
15
|
+
return obj && obj.__esModule ? obj : {
|
|
16
|
+
default: obj
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function _interopRequireWildcard(obj) {
|
|
20
|
+
if (obj && obj.__esModule) {
|
|
21
|
+
return obj;
|
|
22
|
+
} else {
|
|
23
|
+
var newObj = {};
|
|
24
|
+
if (obj != null) {
|
|
25
|
+
for(var key in obj){
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
27
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
|
28
|
+
if (desc.get || desc.set) {
|
|
29
|
+
Object.defineProperty(newObj, key, desc);
|
|
30
|
+
} else {
|
|
31
|
+
newObj[key] = obj[key];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
newObj.default = obj;
|
|
37
|
+
return newObj;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async function exportAppAsync(projectRoot, { platforms , outputDir , clear , dev , dumpAssetmap , dumpSourcemap }) {
|
|
41
|
+
const exp = await (0, _getPublicExpoManifest).getPublicExpoManifestAsync(projectRoot);
|
|
42
|
+
const outputPath = _path.default.resolve(projectRoot, outputDir);
|
|
43
|
+
const assetsPath = _path.default.join(outputPath, "assets");
|
|
44
|
+
const bundlesPath = _path.default.join(outputPath, "bundles");
|
|
45
|
+
await Promise.all([
|
|
46
|
+
assetsPath,
|
|
47
|
+
bundlesPath
|
|
48
|
+
].map(_dir.ensureDirectoryAsync));
|
|
49
|
+
// Run metro bundler and create the JS bundles/source maps.
|
|
50
|
+
const bundles = await (0, _createBundles).createBundlesAsync(projectRoot, {
|
|
51
|
+
resetCache: !!clear
|
|
52
|
+
}, {
|
|
53
|
+
platforms,
|
|
54
|
+
dev,
|
|
55
|
+
useDevServer: true
|
|
56
|
+
});
|
|
57
|
+
// Log bundle size info to the user
|
|
58
|
+
(0, _printBundleSizes).printBundleSizes(bundles);
|
|
59
|
+
// Write the JS bundles to disk, and get the bundle file names (this could change with async chunk loading support).
|
|
60
|
+
const { hashes , fileNames } = await (0, _writeContents).writeBundlesAsync({
|
|
61
|
+
bundles,
|
|
62
|
+
outputDir: bundlesPath
|
|
63
|
+
});
|
|
64
|
+
Log.log("Finished saving JS Bundles");
|
|
65
|
+
const { assets } = await (0, _exportAssets).exportAssetsAsync(projectRoot, {
|
|
66
|
+
exp,
|
|
67
|
+
outputDir: outputPath,
|
|
68
|
+
bundles
|
|
69
|
+
});
|
|
70
|
+
if (dumpAssetmap) {
|
|
71
|
+
Log.log("Dumping asset map");
|
|
72
|
+
await (0, _writeContents).writeAssetMapAsync({
|
|
73
|
+
outputDir: outputPath,
|
|
74
|
+
assets
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
// build source maps
|
|
78
|
+
if (dumpSourcemap) {
|
|
79
|
+
Log.log("Dumping source maps");
|
|
80
|
+
await (0, _writeContents).writeSourceMapsAsync({
|
|
81
|
+
bundles,
|
|
82
|
+
hashes,
|
|
83
|
+
outputDir: bundlesPath,
|
|
84
|
+
fileNames
|
|
85
|
+
});
|
|
86
|
+
Log.log("Preparing additional debugging files");
|
|
87
|
+
// If we output source maps, then add a debug HTML file which the user can open in
|
|
88
|
+
// the web browser to inspect the output like web.
|
|
89
|
+
await (0, _writeContents).writeDebugHtmlAsync({
|
|
90
|
+
outputDir: outputPath,
|
|
91
|
+
fileNames
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
// Generate a `metadata.json` and the export is complete.
|
|
95
|
+
await (0, _writeContents).writeMetadataJsonAsync({
|
|
96
|
+
outputDir,
|
|
97
|
+
bundles,
|
|
98
|
+
fileNames
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=exportApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/export/exportApp.ts"],"sourcesContent":["import path from 'path';\n\nimport * as Log from '../log';\nimport { ensureDirectoryAsync } from '../utils/dir';\nimport { createBundlesAsync } from './createBundles';\nimport { exportAssetsAsync } from './exportAssets';\nimport { getPublicExpoManifestAsync } from './getPublicExpoManifest';\nimport { printBundleSizes } from './printBundleSizes';\nimport { Options } from './resolveOptions';\nimport {\n writeAssetMapAsync,\n writeBundlesAsync,\n writeDebugHtmlAsync,\n writeMetadataJsonAsync,\n writeSourceMapsAsync,\n} from './writeContents';\n\n/**\n * The structure of the outputDir will be:\n *\n * ```\n * ├── assets\n * │ └── *\n * ├── bundles\n * │ ├── android-01ee6e3ab3e8c16a4d926c91808d5320.js\n * │ └── ios-ee8206cc754d3f7aa9123b7f909d94ea.js\n * └── metadata.json\n * ```\n */\nexport async function exportAppAsync(\n projectRoot: string,\n {\n platforms,\n outputDir,\n clear,\n dev,\n dumpAssetmap,\n dumpSourcemap,\n }: Pick<Options, 'dumpAssetmap' | 'dumpSourcemap' | 'dev' | 'clear' | 'outputDir' | 'platforms'>\n): Promise<void> {\n const exp = await getPublicExpoManifestAsync(projectRoot);\n\n const outputPath = path.resolve(projectRoot, outputDir);\n const assetsPath = path.join(outputPath, 'assets');\n const bundlesPath = path.join(outputPath, 'bundles');\n\n await Promise.all([assetsPath, bundlesPath].map(ensureDirectoryAsync));\n\n // Run metro bundler and create the JS bundles/source maps.\n const bundles = await createBundlesAsync(\n projectRoot,\n { resetCache: !!clear },\n {\n platforms,\n dev,\n useDevServer: true,\n // TODO: Disable source map generation if we aren't outputting them.\n }\n );\n\n // Log bundle size info to the user\n printBundleSizes(bundles);\n\n // Write the JS bundles to disk, and get the bundle file names (this could change with async chunk loading support).\n const { hashes, fileNames } = await writeBundlesAsync({ bundles, outputDir: bundlesPath });\n\n Log.log('Finished saving JS Bundles');\n\n const { assets } = await exportAssetsAsync(projectRoot, {\n exp,\n outputDir: outputPath,\n bundles,\n });\n\n if (dumpAssetmap) {\n Log.log('Dumping asset map');\n await writeAssetMapAsync({ outputDir: outputPath, assets });\n }\n\n // build source maps\n if (dumpSourcemap) {\n Log.log('Dumping source maps');\n await writeSourceMapsAsync({\n bundles,\n hashes,\n outputDir: bundlesPath,\n fileNames,\n });\n\n Log.log('Preparing additional debugging files');\n // If we output source maps, then add a debug HTML file which the user can open in\n // the web browser to inspect the output like web.\n await writeDebugHtmlAsync({\n outputDir: outputPath,\n fileNames,\n });\n }\n\n // Generate a `metadata.json` and the export is complete.\n await writeMetadataJsonAsync({ outputDir, bundles, fileNames });\n}\n"],"names":["exportAppAsync","Log","projectRoot","platforms","outputDir","clear","dev","dumpAssetmap","dumpSourcemap","exp","getPublicExpoManifestAsync","outputPath","path","resolve","assetsPath","join","bundlesPath","Promise","all","map","ensureDirectoryAsync","bundles","createBundlesAsync","resetCache","useDevServer","printBundleSizes","hashes","fileNames","writeBundlesAsync","log","assets","exportAssetsAsync","writeAssetMapAsync","writeSourceMapsAsync","writeDebugHtmlAsync","writeMetadataJsonAsync"],"mappings":"AAAA;;;;QA6BsBA,cAAc,GAAdA,cAAc;AA7BnB,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEXC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACsB,IAAA,IAAc,WAAd,cAAc,CAAA;AAChB,IAAA,cAAiB,WAAjB,iBAAiB,CAAA;AAClB,IAAA,aAAgB,WAAhB,gBAAgB,CAAA;AACP,IAAA,sBAAyB,WAAzB,yBAAyB,CAAA;AACnC,IAAA,iBAAoB,WAApB,oBAAoB,CAAA;AAQ9C,IAAA,cAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcjB,eAAeD,cAAc,CAClCE,WAAmB,EACnB,EACEC,SAAS,CAAA,EACTC,SAAS,CAAA,EACTC,KAAK,CAAA,EACLC,GAAG,CAAA,EACHC,YAAY,CAAA,EACZC,aAAa,CAAA,EACiF,EACjF;IACf,MAAMC,GAAG,GAAG,MAAMC,CAAAA,GAAAA,sBAA0B,AAAa,CAAA,2BAAb,CAACR,WAAW,CAAC,AAAC;IAE1D,MAAMS,UAAU,GAAGC,KAAI,QAAA,CAACC,OAAO,CAACX,WAAW,EAAEE,SAAS,CAAC,AAAC;IACxD,MAAMU,UAAU,GAAGF,KAAI,QAAA,CAACG,IAAI,CAACJ,UAAU,EAAE,QAAQ,CAAC,AAAC;IACnD,MAAMK,WAAW,GAAGJ,KAAI,QAAA,CAACG,IAAI,CAACJ,UAAU,EAAE,SAAS,CAAC,AAAC;IAErD,MAAMM,OAAO,CAACC,GAAG,CAAC;QAACJ,UAAU;QAAEE,WAAW;KAAC,CAACG,GAAG,CAACC,IAAoB,qBAAA,CAAC,CAAC,CAAC;IAEvE,2DAA2D;IAC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C;QAChD,kFAAkF;QAClF,kDAAkD;QAClD,MAAMK,CAAAA,GAAAA,cAAmB,AAGvB,CAAA,oBAHuB,CAAC;YACxB9B,SAAS,EAAEO,UAAU;YACrBgB,SAAS;SACV,CAAC,CAAC;KACJ;IAED,yDAAyD;IACzD,MAAMQ,CAAAA,GAAAA,cAAsB,AAAmC,CAAA,uBAAnC,CAAC;QAAE/B,SAAS;QAAEiB,OAAO;QAAEM,SAAS;KAAE,CAAC,CAAC;CACjE"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.resolveAssetBundlePatternsAsync = resolveAssetBundlePatternsAsync;
|
|
6
|
+
exports.exportAssetsAsync = exportAssetsAsync;
|
|
7
|
+
var _minimatch = _interopRequireDefault(require("minimatch"));
|
|
8
|
+
var _path = _interopRequireDefault(require("path"));
|
|
9
|
+
var Log = _interopRequireWildcard(require("../log"));
|
|
10
|
+
var _resolveAssets = require("../start/server/middleware/resolveAssets");
|
|
11
|
+
var _array = require("../utils/array");
|
|
12
|
+
var _saveAssets = require("./saveAssets");
|
|
13
|
+
function _interopRequireDefault(obj) {
|
|
14
|
+
return obj && obj.__esModule ? obj : {
|
|
15
|
+
default: obj
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function _interopRequireWildcard(obj) {
|
|
19
|
+
if (obj && obj.__esModule) {
|
|
20
|
+
return obj;
|
|
21
|
+
} else {
|
|
22
|
+
var newObj = {};
|
|
23
|
+
if (obj != null) {
|
|
24
|
+
for(var key in obj){
|
|
25
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
26
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
|
27
|
+
if (desc.get || desc.set) {
|
|
28
|
+
Object.defineProperty(newObj, key, desc);
|
|
29
|
+
} else {
|
|
30
|
+
newObj[key] = obj[key];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
newObj.default = obj;
|
|
36
|
+
return newObj;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function resolveAssetBundlePatternsAsync(projectRoot, exp, assets) {
|
|
40
|
+
var ref1;
|
|
41
|
+
if (!((ref1 = exp.assetBundlePatterns) == null ? void 0 : ref1.length) || !assets.length) {
|
|
42
|
+
delete exp.assetBundlePatterns;
|
|
43
|
+
return exp;
|
|
44
|
+
}
|
|
45
|
+
// Convert asset patterns to a list of asset strings that match them.
|
|
46
|
+
// Assets strings are formatted as `asset_<hash>.<type>` and represent
|
|
47
|
+
// the name that the file will have in the app bundle. The `asset_` prefix is
|
|
48
|
+
// needed because android doesn't support assets that start with numbers.
|
|
49
|
+
const fullPatterns = exp.assetBundlePatterns.map((p)=>_path.default.join(projectRoot, p)
|
|
50
|
+
);
|
|
51
|
+
logPatterns(fullPatterns);
|
|
52
|
+
const allBundledAssets = assets.map((asset)=>{
|
|
53
|
+
const shouldBundle = shouldBundleAsset(asset, fullPatterns);
|
|
54
|
+
if (shouldBundle) {
|
|
55
|
+
var ref;
|
|
56
|
+
Log.debug(`${shouldBundle ? "Include" : "Exclude"} asset ${(ref = asset.files) == null ? void 0 : ref[0]}`);
|
|
57
|
+
return asset.fileHashes.map((hash)=>"asset_" + hash + ("type" in asset && asset.type ? "." + asset.type : "")
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
return [];
|
|
61
|
+
}).flat();
|
|
62
|
+
// The assets returned by the RN packager has duplicates so make sure we
|
|
63
|
+
// only bundle each once.
|
|
64
|
+
exp.bundledAssets = [
|
|
65
|
+
...new Set(allBundledAssets)
|
|
66
|
+
];
|
|
67
|
+
delete exp.assetBundlePatterns;
|
|
68
|
+
return exp;
|
|
69
|
+
}
|
|
70
|
+
function logPatterns(patterns) {
|
|
71
|
+
// Only log the patterns in debug mode, if they aren't already defined in the app.json, then all files will be targeted.
|
|
72
|
+
Log.log("\nProcessing asset bundle patterns:");
|
|
73
|
+
patterns.forEach((p)=>Log.log("- " + p)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
function shouldBundleAsset(asset, patterns) {
|
|
77
|
+
var ref;
|
|
78
|
+
const file = (ref = asset.files) == null ? void 0 : ref[0];
|
|
79
|
+
return !!("__packager_asset" in asset && asset.__packager_asset && file && patterns.some((pattern)=>(0, _minimatch).default(file, pattern)
|
|
80
|
+
));
|
|
81
|
+
}
|
|
82
|
+
async function exportAssetsAsync(projectRoot, { exp , outputDir , bundles }) {
|
|
83
|
+
var ref;
|
|
84
|
+
const assets = (0, _array).uniqBy(Object.values(bundles).flatMap((bundle)=>bundle.assets
|
|
85
|
+
), (asset)=>asset.hash
|
|
86
|
+
);
|
|
87
|
+
if ((ref = assets[0]) == null ? void 0 : ref.fileHashes) {
|
|
88
|
+
Log.log("Saving assets");
|
|
89
|
+
await (0, _saveAssets).saveAssetsAsync(projectRoot, {
|
|
90
|
+
assets,
|
|
91
|
+
outputDir
|
|
92
|
+
});
|
|
93
|
+
} else {
|
|
94
|
+
Log.log("No assets to upload, skipped.");
|
|
95
|
+
}
|
|
96
|
+
// Add google services file if it exists
|
|
97
|
+
await (0, _resolveAssets).resolveGoogleServicesFile(projectRoot, exp);
|
|
98
|
+
// Updates the manifest to reflect additional asset bundling + configs
|
|
99
|
+
await resolveAssetBundlePatternsAsync(projectRoot, exp, assets);
|
|
100
|
+
return {
|
|
101
|
+
exp,
|
|
102
|
+
assets
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
//# sourceMappingURL=exportAssets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/export/exportAssets.ts"],"sourcesContent":["import { ExpoAppManifest } from '@expo/config';\nimport { ModPlatform } from '@expo/config-plugins';\nimport { BundleOutput } from '@expo/dev-server';\nimport minimatch from 'minimatch';\nimport path from 'path';\n\nimport * as Log from '../log';\nimport { resolveGoogleServicesFile } from '../start/server/middleware/resolveAssets';\nimport { uniqBy } from '../utils/array';\nimport { Asset, saveAssetsAsync } from './saveAssets';\n\n/**\n * Resolves the assetBundlePatterns from the manifest and returns a list of assets to bundle.\n *\n * @modifies {exp}\n */\nexport async function resolveAssetBundlePatternsAsync(\n projectRoot: string,\n exp: Pick<ExpoAppManifest, 'bundledAssets' | 'assetBundlePatterns'>,\n assets: Asset[]\n) {\n if (!exp.assetBundlePatterns?.length || !assets.length) {\n delete exp.assetBundlePatterns;\n return exp;\n }\n // Convert asset patterns to a list of asset strings that match them.\n // Assets strings are formatted as `asset_<hash>.<type>` and represent\n // the name that the file will have in the app bundle. The `asset_` prefix is\n // needed because android doesn't support assets that start with numbers.\n\n const fullPatterns: string[] = exp.assetBundlePatterns.map((p: string) =>\n path.join(projectRoot, p)\n );\n\n logPatterns(fullPatterns);\n\n const allBundledAssets = assets\n .map((asset) => {\n const shouldBundle = shouldBundleAsset(asset, fullPatterns);\n if (shouldBundle) {\n Log.debug(`${shouldBundle ? 'Include' : 'Exclude'} asset ${asset.files?.[0]}`);\n return asset.fileHashes.map(\n (hash) => 'asset_' + hash + ('type' in asset && asset.type ? '.' + asset.type : '')\n );\n }\n return [];\n })\n .flat();\n\n // The assets returned by the RN packager has duplicates so make sure we\n // only bundle each once.\n exp.bundledAssets = [...new Set(allBundledAssets)];\n delete exp.assetBundlePatterns;\n\n return exp;\n}\n\nfunction logPatterns(patterns: string[]) {\n // Only log the patterns in debug mode, if they aren't already defined in the app.json, then all files will be targeted.\n Log.log('\\nProcessing asset bundle patterns:');\n patterns.forEach((p) => Log.log('- ' + p));\n}\n\nfunction shouldBundleAsset(asset: Asset, patterns: string[]) {\n const file = asset.files?.[0];\n return !!(\n '__packager_asset' in asset &&\n asset.__packager_asset &&\n file &&\n patterns.some((pattern) => minimatch(file, pattern))\n );\n}\n\nexport async function exportAssetsAsync(\n projectRoot: string,\n {\n exp,\n outputDir,\n bundles,\n }: {\n exp: ExpoAppManifest;\n bundles: Partial<Record<ModPlatform, BundleOutput>>;\n outputDir: string;\n }\n) {\n const assets: Asset[] = uniqBy(\n Object.values(bundles).flatMap((bundle) => bundle!.assets),\n (asset) => asset.hash\n );\n\n if (assets[0]?.fileHashes) {\n Log.log('Saving assets');\n await saveAssetsAsync(projectRoot, { assets, outputDir });\n } else {\n Log.log('No assets to upload, skipped.');\n }\n\n // Add google services file if it exists\n await resolveGoogleServicesFile(projectRoot, exp);\n\n // Updates the manifest to reflect additional asset bundling + configs\n await resolveAssetBundlePatternsAsync(projectRoot, exp, assets);\n\n return { exp, assets };\n}\n"],"names":["resolveAssetBundlePatternsAsync","exportAssetsAsync","Log","projectRoot","exp","assets","assetBundlePatterns","length","fullPatterns","map","p","path","join","logPatterns","allBundledAssets","asset","shouldBundle","shouldBundleAsset","debug","files","fileHashes","hash","type","flat","bundledAssets","Set","patterns","log","forEach","file","__packager_asset","some","pattern","minimatch","outputDir","bundles","uniqBy","Object","values","flatMap","bundle","saveAssetsAsync","resolveGoogleServicesFile"],"mappings":"AAAA;;;;QAgBsBA,+BAA+B,GAA/BA,+BAA+B;QAyD/BC,iBAAiB,GAAjBA,iBAAiB;AAtEjB,IAAA,UAAW,kCAAX,WAAW,EAAA;AAChB,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEXC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AAC2B,IAAA,cAA0C,WAA1C,0CAA0C,CAAA;AAC7D,IAAA,MAAgB,WAAhB,gBAAgB,CAAA;AACA,IAAA,WAAc,WAAd,cAAc,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAO9C,eAAeF,+BAA+B,CACnDG,WAAmB,EACnBC,GAAmE,EACnEC,MAAe,EACf;QACKD,IAAuB;IAA5B,IAAI,CAACA,CAAAA,CAAAA,IAAuB,GAAvBA,GAAG,CAACE,mBAAmB,SAAQ,GAA/BF,KAAAA,CAA+B,GAA/BA,IAAuB,CAA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CAAC,eAAe,CAAC,CAAC;QACzB,MAAMc,CAAAA,GAAAA,WAAe,AAAoC,CAAA,gBAApC,CAACtC,WAAW,EAAE;YAAEE,MAAM;YAAE6B,SAAS;SAAE,CAAC,CAAC;KAC3D,MAAM;QACLhC,GAAG,CAACyB,GAAG,CAAC,+BAA+B,CAAC,CAAC;KAC1C;IAED,wCAAwC;IACxC,MAAMe,CAAAA,GAAAA,cAAyB,AAAkB,CAAA,0BAAlB,CAACvC,WAAW,EAAEC,GAAG,CAAC,CAAC;IAElD,sEAAsE;IACtE,MAAMJ,+BAA+B,CAACG,WAAW,EAAEC,GAAG,EAAEC,MAAM,CAAC,CAAC;IAEhE,OAAO;QAAED,GAAG;QAAEC,MAAM;KAAE,CAAC;CACxB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.exportAsync = exportAsync;
|
|
6
|
+
var _path = _interopRequireDefault(require("path"));
|
|
7
|
+
var Log = _interopRequireWildcard(require("../log"));
|
|
8
|
+
var _dir = require("../utils/dir");
|
|
9
|
+
var _exportApp = require("./exportApp");
|
|
10
|
+
function _interopRequireDefault(obj) {
|
|
11
|
+
return obj && obj.__esModule ? obj : {
|
|
12
|
+
default: obj
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function _interopRequireWildcard(obj) {
|
|
16
|
+
if (obj && obj.__esModule) {
|
|
17
|
+
return obj;
|
|
18
|
+
} else {
|
|
19
|
+
var newObj = {};
|
|
20
|
+
if (obj != null) {
|
|
21
|
+
for(var key in obj){
|
|
22
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
23
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
|
24
|
+
if (desc.get || desc.set) {
|
|
25
|
+
Object.defineProperty(newObj, key, desc);
|
|
26
|
+
} else {
|
|
27
|
+
newObj[key] = obj[key];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
newObj.default = obj;
|
|
33
|
+
return newObj;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async function exportAsync(projectRoot, options) {
|
|
37
|
+
// Ensure the output directory is created
|
|
38
|
+
const outputPath = _path.default.resolve(projectRoot, options.outputDir);
|
|
39
|
+
// Delete the output directory if it exists
|
|
40
|
+
await (0, _dir).removeAsync(outputPath);
|
|
41
|
+
// Create the output directory
|
|
42
|
+
await (0, _dir).ensureDirectoryAsync(outputPath);
|
|
43
|
+
// Export the app
|
|
44
|
+
await (0, _exportApp).exportAppAsync(projectRoot, options);
|
|
45
|
+
// Final notes
|
|
46
|
+
Log.log(`Export was successful. Your exported files can be found in ${options.outputDir}`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=exportAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/export/exportAsync.ts"],"sourcesContent":["import path from 'path';\n\nimport * as Log from '../log';\nimport { ensureDirectoryAsync, removeAsync } from '../utils/dir';\nimport { exportAppAsync } from './exportApp';\nimport { Options } from './resolveOptions';\n\nexport async function exportAsync(projectRoot: string, options: Options) {\n // Ensure the output directory is created\n const outputPath = path.resolve(projectRoot, options.outputDir);\n // Delete the output directory if it exists\n await removeAsync(outputPath);\n // Create the output directory\n await ensureDirectoryAsync(outputPath);\n\n // Export the app\n await exportAppAsync(projectRoot, options);\n\n // Final notes\n Log.log(`Export was successful. Your exported files can be found in ${options.outputDir}`);\n}\n"],"names":["exportAsync","Log","projectRoot","options","outputPath","path","resolve","outputDir","removeAsync","ensureDirectoryAsync","exportAppAsync","log"],"mappings":"AAAA;;;;QAOsBA,WAAW,GAAXA,WAAW;AAPhB,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEXC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACmC,IAAA,IAAc,WAAd,cAAc,CAAA;AACjC,IAAA,UAAa,WAAb,aAAa,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGrC,eAAeD,WAAW,CAACE,WAAmB,EAAEC,OAAgB,EAAE;IACvE,yCAAyC;IACzC,MAAMC,UAAU,GAAGC,KAAI,QAAA,CAACC,OAAO,CAACJ,WAAW,EAAEC,OAAO,CAACI,SAAS,CAAC,AAAC;IAChE,2CAA2C;IAC3C,MAAMC,CAAAA,GAAAA,IAAW,AAAY,CAAA,YAAZ,CAACJ,UAAU,CAAC,CAAC;IAC9B,8BAA8B;IAC9B,MAAMK,CAAAA,GAAAA,IAAoB,AAAY,CAAA,qBAAZ,CAACL,UAAU,CAAC,CAAC;IAEvC,iBAAiB;IACjB,MAAMM,CAAAA,GAAAA,UAAc,AAAsB,CAAA,eAAtB,CAACR,WAAW,EAAEC,OAAO,CAAC,CAAC;IAE3C,cAAc;IACdF,GAAG,CAACU,GAAG,CAAC,CAAC,2DAA2D,EAAER,OAAO,CAACI,SAAS,CAAC,CAAC,CAAC,CAAC;CAC5F"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.bundleAsync = bundleAsync;
|
|
6
|
+
var _config = require("@expo/config");
|
|
7
|
+
var _hermesBundler = require("@expo/dev-server/build/HermesBundler");
|
|
8
|
+
var _importMetroFromProject = require("@expo/dev-server/build/metro/importMetroFromProject");
|
|
9
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
10
|
+
var _metroCore = require("metro-core");
|
|
11
|
+
var _metroTerminalReporter = require("../start/server/metro/MetroTerminalReporter");
|
|
12
|
+
function _interopRequireDefault(obj) {
|
|
13
|
+
return obj && obj.__esModule ? obj : {
|
|
14
|
+
default: obj
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function getExpoMetroConfig(projectRoot, { logger }) {
|
|
18
|
+
try {
|
|
19
|
+
return (0, _importMetroFromProject).importExpoMetroConfigFromProject(projectRoot);
|
|
20
|
+
} catch {
|
|
21
|
+
// If expo isn't installed, use the unversioned config and warn about installing expo.
|
|
22
|
+
}
|
|
23
|
+
const unversionedVersion = require("@expo/metro-config/package.json").version;
|
|
24
|
+
logger.info({
|
|
25
|
+
tag: "expo"
|
|
26
|
+
}, _chalk.default.gray(`\u203A Unversioned ${_chalk.default.bold`@expo/metro-config@${unversionedVersion}`} is being used. Bundling apps may not work as expected, and is subject to breaking changes. Install ${_chalk.default.bold`expo`} or set the app.json sdkVersion to use a stable version of @expo/metro-config.`));
|
|
27
|
+
return require("@expo/metro-config");
|
|
28
|
+
}
|
|
29
|
+
let nextBuildID = 0;
|
|
30
|
+
async function bundleAsync(projectRoot, expoConfig, options, bundles) {
|
|
31
|
+
const metro = (0, _importMetroFromProject).importMetroFromProject(projectRoot);
|
|
32
|
+
const Server = (0, _importMetroFromProject).importMetroServerFromProject(projectRoot);
|
|
33
|
+
let reportEvent;
|
|
34
|
+
const terminal = new _metroCore.Terminal(process.stdout);
|
|
35
|
+
const terminalReporter = new _metroTerminalReporter.MetroTerminalReporter(projectRoot, terminal);
|
|
36
|
+
const reporter = {
|
|
37
|
+
update (event) {
|
|
38
|
+
terminalReporter.update(event);
|
|
39
|
+
if (reportEvent) {
|
|
40
|
+
reportEvent(event);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const ExpoMetroConfig = getExpoMetroConfig(projectRoot, options);
|
|
45
|
+
const config = await ExpoMetroConfig.loadAsync(projectRoot, {
|
|
46
|
+
reporter,
|
|
47
|
+
...options
|
|
48
|
+
});
|
|
49
|
+
const buildID = `bundle_${nextBuildID++}`;
|
|
50
|
+
// @ts-expect-error
|
|
51
|
+
const metroServer = await metro.runMetro(config, {
|
|
52
|
+
watch: false
|
|
53
|
+
});
|
|
54
|
+
const buildAsync = async (bundle)=>{
|
|
55
|
+
var _dev, _minify;
|
|
56
|
+
const bundleOptions = {
|
|
57
|
+
...Server.DEFAULT_BUNDLE_OPTIONS,
|
|
58
|
+
bundleType: "bundle",
|
|
59
|
+
platform: bundle.platform,
|
|
60
|
+
entryFile: bundle.entryPoint,
|
|
61
|
+
dev: (_dev = bundle.dev) != null ? _dev : false,
|
|
62
|
+
minify: (_minify = bundle.minify) != null ? _minify : !bundle.dev,
|
|
63
|
+
inlineSourceMap: false,
|
|
64
|
+
sourceMapUrl: bundle.sourceMapUrl,
|
|
65
|
+
createModuleIdFactory: config.serializer.createModuleIdFactory,
|
|
66
|
+
onProgress: (transformedFileCount, totalFileCount)=>{
|
|
67
|
+
if (!options.quiet) {
|
|
68
|
+
reporter.update({
|
|
69
|
+
buildID,
|
|
70
|
+
type: "bundle_transform_progressed",
|
|
71
|
+
transformedFileCount,
|
|
72
|
+
totalFileCount
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
var _dev1, _minify1;
|
|
78
|
+
reporter.update({
|
|
79
|
+
buildID,
|
|
80
|
+
type: "bundle_build_started",
|
|
81
|
+
bundleDetails: {
|
|
82
|
+
bundleType: bundleOptions.bundleType,
|
|
83
|
+
platform: bundle.platform,
|
|
84
|
+
entryFile: bundle.entryPoint,
|
|
85
|
+
dev: (_dev1 = bundle.dev) != null ? _dev1 : false,
|
|
86
|
+
minify: (_minify1 = bundle.minify) != null ? _minify1 : false
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const { code , map } = await metroServer.build(bundleOptions);
|
|
90
|
+
const assets = await metroServer.getAssets(bundleOptions);
|
|
91
|
+
reporter.update({
|
|
92
|
+
buildID,
|
|
93
|
+
type: "bundle_build_done"
|
|
94
|
+
});
|
|
95
|
+
return {
|
|
96
|
+
code,
|
|
97
|
+
map,
|
|
98
|
+
assets
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
const maybeAddHermesBundleAsync = async (bundle, bundleOutput)=>{
|
|
102
|
+
const { platform } = bundle;
|
|
103
|
+
const isHermesManaged = (0, _hermesBundler).isEnableHermesManaged(expoConfig, platform);
|
|
104
|
+
const paths = (0, _config).getConfigFilePaths(projectRoot);
|
|
105
|
+
var _dynamicConfigPath, ref;
|
|
106
|
+
const configFilePath = (ref = (_dynamicConfigPath = paths.dynamicConfigPath) != null ? _dynamicConfigPath : paths.staticConfigPath) != null ? ref : "app.json";
|
|
107
|
+
await (0, _hermesBundler).maybeThrowFromInconsistentEngineAsync(projectRoot, configFilePath, platform, isHermesManaged);
|
|
108
|
+
if (isHermesManaged) {
|
|
109
|
+
const platformTag = _chalk.default.bold({
|
|
110
|
+
ios: "iOS",
|
|
111
|
+
android: "Android",
|
|
112
|
+
web: "Web"
|
|
113
|
+
}[platform] || platform);
|
|
114
|
+
options.logger.info({
|
|
115
|
+
tag: "expo"
|
|
116
|
+
}, `💿 ${platformTag} Building Hermes bytecode for the bundle`);
|
|
117
|
+
const hermesBundleOutput = await (0, _hermesBundler).buildHermesBundleAsync(projectRoot, bundleOutput.code, bundleOutput.map, bundle.minify);
|
|
118
|
+
bundleOutput.hermesBytecodeBundle = hermesBundleOutput.hbc;
|
|
119
|
+
bundleOutput.hermesSourcemap = hermesBundleOutput.sourcemap;
|
|
120
|
+
}
|
|
121
|
+
return bundleOutput;
|
|
122
|
+
};
|
|
123
|
+
try {
|
|
124
|
+
const intermediateOutputs = await Promise.all(bundles.map((bundle)=>buildAsync(bundle)
|
|
125
|
+
));
|
|
126
|
+
const bundleOutputs = [];
|
|
127
|
+
for(let i = 0; i < bundles.length; ++i){
|
|
128
|
+
// hermesc does not support parallel building even we spawn processes.
|
|
129
|
+
// we should build them sequentially.
|
|
130
|
+
bundleOutputs.push(await maybeAddHermesBundleAsync(bundles[i], intermediateOutputs[i]));
|
|
131
|
+
}
|
|
132
|
+
return bundleOutputs;
|
|
133
|
+
} finally{
|
|
134
|
+
metroServer.end();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
//# sourceMappingURL=fork-bundleAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/export/fork-bundleAsync.ts"],"sourcesContent":["import Log from '@expo/bunyan';\nimport { ExpoConfig, getConfigFilePaths } from '@expo/config';\nimport {\n buildHermesBundleAsync,\n isEnableHermesManaged,\n maybeThrowFromInconsistentEngineAsync,\n} from '@expo/dev-server/build/HermesBundler';\nimport {\n importExpoMetroConfigFromProject,\n importMetroFromProject,\n importMetroServerFromProject,\n} from '@expo/dev-server/build/metro/importMetroFromProject';\nimport { LoadOptions } from '@expo/metro-config';\nimport chalk from 'chalk';\nimport Metro from 'metro';\nimport { Terminal } from 'metro-core';\n\nimport { MetroTerminalReporter } from '../start/server/metro/MetroTerminalReporter';\n\nexport type MetroDevServerOptions = LoadOptions & {\n logger: Log;\n quiet?: boolean;\n};\nexport type BundleOptions = {\n entryPoint: string;\n platform: 'android' | 'ios' | 'web';\n dev?: boolean;\n minify?: boolean;\n sourceMapUrl?: string;\n};\nexport type BundleAssetWithFileHashes = Metro.AssetData & {\n fileHashes: string[]; // added by the hashAssets asset plugin\n};\nexport type BundleOutput = {\n code: string;\n map: string;\n hermesBytecodeBundle?: Uint8Array;\n hermesSourcemap?: string;\n assets: readonly BundleAssetWithFileHashes[];\n};\n\nfunction getExpoMetroConfig(\n projectRoot: string,\n { logger }: Pick<MetroDevServerOptions, 'logger'>\n): typeof import('@expo/metro-config') {\n try {\n return importExpoMetroConfigFromProject(projectRoot);\n } catch {\n // If expo isn't installed, use the unversioned config and warn about installing expo.\n }\n\n const unversionedVersion = require('@expo/metro-config/package.json').version;\n logger.info(\n { tag: 'expo' },\n chalk.gray(\n `\\u203A Unversioned ${chalk.bold`@expo/metro-config@${unversionedVersion}`} is being used. Bundling apps may not work as expected, and is subject to breaking changes. Install ${chalk.bold`expo`} or set the app.json sdkVersion to use a stable version of @expo/metro-config.`\n )\n );\n\n return require('@expo/metro-config');\n}\n\nlet nextBuildID = 0;\n\n// Fork of @expo/dev-server bundleAsync to add Metro logging back.\n\nexport async function bundleAsync(\n projectRoot: string,\n expoConfig: ExpoConfig,\n options: MetroDevServerOptions,\n bundles: BundleOptions[]\n): Promise<BundleOutput[]> {\n const metro = importMetroFromProject(projectRoot);\n const Server = importMetroServerFromProject(projectRoot);\n\n let reportEvent: ((event: any) => void) | undefined;\n\n const terminal = new Terminal(process.stdout);\n const terminalReporter = new MetroTerminalReporter(projectRoot, terminal);\n\n const reporter = {\n update(event: any) {\n terminalReporter.update(event);\n if (reportEvent) {\n reportEvent(event);\n }\n },\n };\n\n const ExpoMetroConfig = getExpoMetroConfig(projectRoot, options);\n\n const config = await ExpoMetroConfig.loadAsync(projectRoot, { reporter, ...options });\n const buildID = `bundle_${nextBuildID++}`;\n\n // @ts-expect-error\n const metroServer = await metro.runMetro(config, {\n watch: false,\n });\n\n const buildAsync = async (bundle: BundleOptions): Promise<BundleOutput> => {\n const bundleOptions: Metro.BundleOptions = {\n ...Server.DEFAULT_BUNDLE_OPTIONS,\n bundleType: 'bundle',\n platform: bundle.platform,\n entryFile: bundle.entryPoint,\n dev: bundle.dev ?? false,\n minify: bundle.minify ?? !bundle.dev,\n inlineSourceMap: false,\n sourceMapUrl: bundle.sourceMapUrl,\n createModuleIdFactory: config.serializer.createModuleIdFactory,\n onProgress: (transformedFileCount: number, totalFileCount: number) => {\n if (!options.quiet) {\n reporter.update({\n buildID,\n type: 'bundle_transform_progressed',\n transformedFileCount,\n totalFileCount,\n });\n }\n },\n };\n reporter.update({\n buildID,\n type: 'bundle_build_started',\n bundleDetails: {\n bundleType: bundleOptions.bundleType,\n platform: bundle.platform,\n entryFile: bundle.entryPoint,\n dev: bundle.dev ?? false,\n minify: bundle.minify ?? false,\n },\n });\n const { code, map } = await metroServer.build(bundleOptions);\n const assets = (await metroServer.getAssets(\n bundleOptions\n )) as readonly BundleAssetWithFileHashes[];\n reporter.update({\n buildID,\n type: 'bundle_build_done',\n });\n return { code, map, assets };\n };\n\n const maybeAddHermesBundleAsync = async (\n bundle: BundleOptions,\n bundleOutput: BundleOutput\n ): Promise<BundleOutput> => {\n const { platform } = bundle;\n const isHermesManaged = isEnableHermesManaged(expoConfig, platform);\n\n const paths = getConfigFilePaths(projectRoot);\n const configFilePath = paths.dynamicConfigPath ?? paths.staticConfigPath ?? 'app.json';\n await maybeThrowFromInconsistentEngineAsync(\n projectRoot,\n configFilePath,\n platform,\n isHermesManaged\n );\n\n if (isHermesManaged) {\n const platformTag = chalk.bold(\n { ios: 'iOS', android: 'Android', web: 'Web' }[platform] || platform\n );\n options.logger.info(\n { tag: 'expo' },\n `💿 ${platformTag} Building Hermes bytecode for the bundle`\n );\n const hermesBundleOutput = await buildHermesBundleAsync(\n projectRoot,\n bundleOutput.code,\n bundleOutput.map,\n bundle.minify\n );\n bundleOutput.hermesBytecodeBundle = hermesBundleOutput.hbc;\n bundleOutput.hermesSourcemap = hermesBundleOutput.sourcemap;\n }\n return bundleOutput;\n };\n\n try {\n const intermediateOutputs = await Promise.all(bundles.map((bundle) => buildAsync(bundle)));\n const bundleOutputs: BundleOutput[] = [];\n for (let i = 0; i < bundles.length; ++i) {\n // hermesc does not support parallel building even we spawn processes.\n // we should build them sequentially.\n bundleOutputs.push(await maybeAddHermesBundleAsync(bundles[i], intermediateOutputs[i]));\n }\n return bundleOutputs;\n } finally {\n metroServer.end();\n }\n}\n"],"names":["bundleAsync","getExpoMetroConfig","projectRoot","logger","importExpoMetroConfigFromProject","unversionedVersion","require","version","info","tag","chalk","gray","bold","nextBuildID","expoConfig","options","bundles","metro","importMetroFromProject","Server","importMetroServerFromProject","reportEvent","terminal","Terminal","process","stdout","terminalReporter","MetroTerminalReporter","reporter","update","event","ExpoMetroConfig","config","loadAsync","buildID","metroServer","runMetro","watch","buildAsync","bundle","bundleOptions","DEFAULT_BUNDLE_OPTIONS","bundleType","platform","entryFile","entryPoint","dev","minify","inlineSourceMap","sourceMapUrl","createModuleIdFactory","serializer","onProgress","transformedFileCount","totalFileCount","quiet","type","bundleDetails","code","map","build","assets","getAssets","maybeAddHermesBundleAsync","bundleOutput","isHermesManaged","isEnableHermesManaged","paths","getConfigFilePaths","configFilePath","dynamicConfigPath","staticConfigPath","maybeThrowFromInconsistentEngineAsync","platformTag","ios","android","web","hermesBundleOutput","buildHermesBundleAsync","hermesBytecodeBundle","hbc","hermesSourcemap","sourcemap","intermediateOutputs","Promise","all","bundleOutputs","i","length","push","end"],"mappings":"AAAA;;;;QAkEsBA,WAAW,GAAXA,WAAW;AAjEc,IAAA,OAAc,WAAd,cAAc,CAAA;AAKtD,IAAA,cAAsC,WAAtC,sCAAsC,CAAA;AAKtC,IAAA,uBAAqD,WAArD,qDAAqD,CAAA;AAE1C,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEA,IAAA,UAAY,WAAZ,YAAY,CAAA;AAEC,IAAA,sBAA6C,WAA7C,6CAA6C,CAAA;;;;;;AAwBnF,SAASC,kBAAkB,CACzBC,WAAmB,EACnB,EAAEC,MAAM,CAAA,EAAyC,EACZ;IACrC,IAAI;QACF,OAAOC,CAAAA,GAAAA,uBAAgC,AAAa,CAAA,iCAAb,CAACF,WAAW,CAAC,CAAC;KACtD,CAAC,OAAM;IACN,sFAAsF;KACvF;IAED,MAAMG,kBAAkB,GAAGC,OAAO,CAAC,iCAAiC,CAAC,CAACC,OAAO,AAAC;IAC9EJ,MAAM,CAACK,IAAI,CACT;QAAEC,GAAG,EAAE,MAAM;KAAE,EACfC,MAAK,QAAA,CAACC,IAAI,CACR,CAAC,mBAAmB,EAAED,MAAK,QAAA,CAACE,IAAI,CAAC,mBAAmB,EAAEP,kBAAkB,CAAC,CAAC,CAAC,oGAAoG,EAAEK,MAAK,QAAA,CAACE,IAAI,CAAC,IAAI,CAAC,CAAC,8EAA8E,CAAC,CAClR,CACF,CAAC;IAEF,OAAON,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACtC;AAED,IAAIO,WAAW,GAAG,CAAC,AAA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,wCAAwC,CAAC,CAC3D,CAAC;YACF,MAAMI,kBAAkB,GAAG,MAAMC,CAAAA,GAAAA,cAAsB,AAKtD,CAAA,uBALsD,CACrD5E,WAAW,EACX8D,YAAY,CAACN,IAAI,EACjBM,YAAY,CAACL,GAAG,EAChBpB,MAAM,CAACQ,MAAM,CACd,AAAC;YACFiB,YAAY,CAACe,oBAAoB,GAAGF,kBAAkB,CAACG,GAAG,CAAC;YAC3DhB,YAAY,CAACiB,eAAe,GAAGJ,kBAAkB,CAACK,SAAS,CAAC;SAC7D;QACD,OAAOlB,YAAY,CAAC;KACrB,AAAC;IAEF,IAAI;QACF,MAAMmB,mBAAmB,GAAG,MAAMC,OAAO,CAACC,GAAG,CAACrE,OAAO,CAAC2C,GAAG,CAAC,CAACpB,MAAM,GAAKD,UAAU,CAACC,MAAM,CAAC;QAAA,CAAC,CAAC,AAAC;QAC3F,MAAM+C,aAAa,GAAmB,EAAE,AAAC;QACzC,IAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGvE,OAAO,CAACwE,MAAM,EAAE,EAAED,CAAC,CAAE;YACvC,sEAAsE;YACtE,qCAAqC;YACrCD,aAAa,CAACG,IAAI,CAAC,MAAM1B,yBAAyB,CAAC/C,OAAO,CAACuE,CAAC,CAAC,EAAEJ,mBAAmB,CAACI,CAAC,CAAC,CAAC,CAAC,CAAC;SACzF;QACD,OAAOD,aAAa,CAAC;KACtB,QAAS;QACRnD,WAAW,CAACuD,GAAG,EAAE,CAAC;KACnB;CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.getPublicExpoManifestAsync = getPublicExpoManifestAsync;
|
|
6
|
+
var _config = require("@expo/config");
|
|
7
|
+
var _env = require("../utils/env");
|
|
8
|
+
var _errors = require("../utils/errors");
|
|
9
|
+
var _getResolvedLocales = require("./getResolvedLocales");
|
|
10
|
+
async function getPublicExpoManifestAsync(projectRoot) {
|
|
11
|
+
// Read the config in public mode which strips the `hooks`.
|
|
12
|
+
const { exp } = (0, _config).getConfig(projectRoot, {
|
|
13
|
+
isPublicConfig: true,
|
|
14
|
+
// This shouldn't be needed since the CLI is vendored in `expo`.
|
|
15
|
+
skipSDKVersionRequirement: true
|
|
16
|
+
});
|
|
17
|
+
// Only allow projects to be published with UNVERSIONED if a correct token is set in env
|
|
18
|
+
if (exp.sdkVersion === "UNVERSIONED" && !_env.env.EXPO_SKIP_MANIFEST_VALIDATION_TOKEN) {
|
|
19
|
+
throw new _errors.CommandError("INVALID_OPTIONS", "Cannot publish with sdkVersion UNVERSIONED.");
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
...exp,
|
|
23
|
+
locales: await (0, _getResolvedLocales).getResolvedLocalesAsync(projectRoot, exp),
|
|
24
|
+
sdkVersion: exp.sdkVersion
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=getPublicExpoManifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/export/getPublicExpoManifest.ts"],"sourcesContent":["import { ExpoAppManifest, getConfig } from '@expo/config';\n\nimport { env } from '../utils/env';\nimport { CommandError } from '../utils/errors';\nimport { getResolvedLocalesAsync } from './getResolvedLocales';\n\n/** Get the public Expo manifest from the local project config. */\nexport async function getPublicExpoManifestAsync(projectRoot: string): Promise<ExpoAppManifest> {\n // Read the config in public mode which strips the `hooks`.\n const { exp } = getConfig(projectRoot, {\n isPublicConfig: true,\n // This shouldn't be needed since the CLI is vendored in `expo`.\n skipSDKVersionRequirement: true,\n });\n\n // Only allow projects to be published with UNVERSIONED if a correct token is set in env\n if (exp.sdkVersion === 'UNVERSIONED' && !env.EXPO_SKIP_MANIFEST_VALIDATION_TOKEN) {\n throw new CommandError('INVALID_OPTIONS', 'Cannot publish with sdkVersion UNVERSIONED.');\n }\n\n return {\n ...exp,\n locales: await getResolvedLocalesAsync(projectRoot, exp),\n sdkVersion: exp.sdkVersion!,\n };\n}\n"],"names":["getPublicExpoManifestAsync","projectRoot","exp","getConfig","isPublicConfig","skipSDKVersionRequirement","sdkVersion","env","EXPO_SKIP_MANIFEST_VALIDATION_TOKEN","CommandError","locales","getResolvedLocalesAsync"],"mappings":"AAAA;;;;QAOsBA,0BAA0B,GAA1BA,0BAA0B;AAPL,IAAA,OAAc,WAAd,cAAc,CAAA;AAErC,IAAA,IAAc,WAAd,cAAc,CAAA;AACL,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;AACN,IAAA,mBAAsB,WAAtB,sBAAsB,CAAA;AAGvD,eAAeA,0BAA0B,CAACC,WAAmB,EAA4B;IAC9F,2DAA2D;IAC3D,MAAM,EAAEC,GAAG,CAAA,EAAE,GAAGC,CAAAA,GAAAA,OAAS,AAIvB,CAAA,UAJuB,CAACF,WAAW,EAAE;QACrCG,cAAc,EAAE,IAAI;QACpB,gEAAgE;QAChEC,yBAAyB,EAAE,IAAI;KAChC,CAAC,AAAC;IAEH,wFAAwF;IACxF,IAAIH,GAAG,CAACI,UAAU,KAAK,aAAa,IAAI,CAACC,IAAG,IAAA,CAACC,mCAAmC,EAAE;QAChF,MAAM,IAAIC,OAAY,aAAA,CAAC,iBAAiB,EAAE,6CAA6C,CAAC,CAAC;KAC1F;IAED,OAAO;QACL,GAAGP,GAAG;QACNQ,OAAO,EAAE,MAAMC,CAAAA,GAAAA,mBAAuB,AAAkB,CAAA,wBAAlB,CAACV,WAAW,EAAEC,GAAG,CAAC;QACxDI,UAAU,EAAEJ,GAAG,CAACI,UAAU;KAC3B,CAAC;CACH"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.getResolvedLocalesAsync = getResolvedLocalesAsync;
|
|
6
|
+
var _jsonFile = _interopRequireDefault(require("@expo/json-file"));
|
|
7
|
+
var _path = _interopRequireDefault(require("path"));
|
|
8
|
+
var _errors = require("../utils/errors");
|
|
9
|
+
function _interopRequireDefault(obj) {
|
|
10
|
+
return obj && obj.__esModule ? obj : {
|
|
11
|
+
default: obj
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
async function getResolvedLocalesAsync(projectRoot, exp) {
|
|
15
|
+
if (!exp.locales) {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
const locales = {};
|
|
19
|
+
for (const [lang, localeJsonPath] of Object.entries(exp.locales)){
|
|
20
|
+
if (typeof localeJsonPath === "string") {
|
|
21
|
+
try {
|
|
22
|
+
locales[lang] = await _jsonFile.default.readAsync(_path.default.join(projectRoot, localeJsonPath));
|
|
23
|
+
} catch (error) {
|
|
24
|
+
throw new _errors.CommandError("EXPO_CONFIG", JSON.stringify(error));
|
|
25
|
+
}
|
|
26
|
+
} else {
|
|
27
|
+
// In the off chance that someone defined the locales json in the config, pass it directly to the object.
|
|
28
|
+
// We do this to make the types more elegant.
|
|
29
|
+
locales[lang] = localeJsonPath;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return locales;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=getResolvedLocales.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/export/getResolvedLocales.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config';\nimport JsonFile, { JSONObject } from '@expo/json-file';\nimport path from 'path';\n\nimport { CommandError } from '../utils/errors';\n\ntype LocaleMap = Record<string, JSONObject>;\n\n// Similar to how we resolve locales in `@expo/config-plugins`\nexport async function getResolvedLocalesAsync(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'locales'>\n): Promise<LocaleMap> {\n if (!exp.locales) {\n return {};\n }\n\n const locales: LocaleMap = {};\n for (const [lang, localeJsonPath] of Object.entries(exp.locales)) {\n if (typeof localeJsonPath === 'string') {\n try {\n locales[lang] = await JsonFile.readAsync(path.join(projectRoot, localeJsonPath));\n } catch (error: any) {\n throw new CommandError('EXPO_CONFIG', JSON.stringify(error));\n }\n } else {\n // In the off chance that someone defined the locales json in the config, pass it directly to the object.\n // We do this to make the types more elegant.\n locales[lang] = localeJsonPath;\n }\n }\n return locales;\n}\n"],"names":["getResolvedLocalesAsync","projectRoot","exp","locales","lang","localeJsonPath","Object","entries","JsonFile","readAsync","path","join","error","CommandError","JSON","stringify"],"mappings":"AAAA;;;;QASsBA,uBAAuB,GAAvBA,uBAAuB;AARR,IAAA,SAAiB,kCAAjB,iBAAiB,EAAA;AACrC,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEM,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;;;;;;AAKvC,eAAeA,uBAAuB,CAC3CC,WAAmB,EACnBC,GAAgC,EACZ;IACpB,IAAI,CAACA,GAAG,CAACC,OAAO,EAAE;QAChB,OAAO,EAAE,CAAC;KACX;IAED,MAAMA,OAAO,GAAc,EAAE,AAAC;IAC9B,KAAK,MAAM,CAACC,IAAI,EAAEC,cAAc,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,GAAG,CAACC,OAAO,CAAC,CAAE;QAChE,IAAI,OAAOE,cAAc,KAAK,QAAQ,EAAE;YACtC,IAAI;gBACFF,OAAO,CAACC,IAAI,CAAC,GAAG,MAAMI,SAAQ,QAAA,CAACC,SAAS,CAACC,KAAI,QAAA,CAACC,IAAI,CAACV,WAAW,EAAEI,cAAc,CAAC,CAAC,CAAC;aAClF,CAAC,OAAOO,KAAK,EAAO;gBACnB,MAAM,IAAIC,OAAY,aAAA,CAAC,aAAa,EAAEC,IAAI,CAACC,SAAS,CAACH,KAAK,CAAC,CAAC,CAAC;aAC9D;SACF,MAAM;YACL,yGAAyG;YACzG,6CAA6C;YAC7CT,OAAO,CAACC,IAAI,CAAC,GAAGC,cAAc,CAAC;SAChC;KACF;IACD,OAAOF,OAAO,CAAC;CAChB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.expoExport = void 0;
|
|
7
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
8
|
+
var _args = require("../utils/args");
|
|
9
|
+
var _errors = require("../utils/errors");
|
|
10
|
+
function _interopRequireDefault(obj) {
|
|
11
|
+
return obj && obj.__esModule ? obj : {
|
|
12
|
+
default: obj
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function _interopRequireWildcard(obj) {
|
|
16
|
+
if (obj && obj.__esModule) {
|
|
17
|
+
return obj;
|
|
18
|
+
} else {
|
|
19
|
+
var newObj = {};
|
|
20
|
+
if (obj != null) {
|
|
21
|
+
for(var key in obj){
|
|
22
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
23
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
|
24
|
+
if (desc.get || desc.set) {
|
|
25
|
+
Object.defineProperty(newObj, key, desc);
|
|
26
|
+
} else {
|
|
27
|
+
newObj[key] = obj[key];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
newObj.default = obj;
|
|
33
|
+
return newObj;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const expoExport = async (argv)=>{
|
|
37
|
+
const args = (0, _args).assertArgs({
|
|
38
|
+
// Types
|
|
39
|
+
"--help": Boolean,
|
|
40
|
+
"--clear": Boolean,
|
|
41
|
+
"--dump-assetmap": Boolean,
|
|
42
|
+
"--dev": Boolean,
|
|
43
|
+
"--dump-sourcemap": Boolean,
|
|
44
|
+
"--max-workers": Number,
|
|
45
|
+
"--output-dir": String,
|
|
46
|
+
// Aliases
|
|
47
|
+
"-h": "--help",
|
|
48
|
+
// '-s': '--dump-sourcemap',
|
|
49
|
+
// '-d': '--dump-assetmap',
|
|
50
|
+
"-c": "--clear"
|
|
51
|
+
}, argv);
|
|
52
|
+
if (args["--help"]) {
|
|
53
|
+
(0, _args).printHelp(`Export the static files of the app for hosting it on a web server`, _chalk.default`npx expo export {dim <dir>}`, [
|
|
54
|
+
_chalk.default`<dir> Directory of the Expo project. {dim Default: Current working directory}`,
|
|
55
|
+
_chalk.default`--platform <all|android|ios> Platforms: android, ios, all. {dim Default: all}`,
|
|
56
|
+
`--dev Configure static files for developing locally using a non-https server`,
|
|
57
|
+
_chalk.default`--output-dir <dir> The directory to export the static files to. {dim Default: dist}`,
|
|
58
|
+
`--max-workers <number> Maximum number of tasks to allow the bundler to spawn`,
|
|
59
|
+
`--dump-assetmap Dump the asset map for further processing`,
|
|
60
|
+
`--dump-sourcemap Dump the source map for debugging the JS bundle`,
|
|
61
|
+
`-c, --clear Clear the bundler cache`,
|
|
62
|
+
`-h, --help Usage info`,
|
|
63
|
+
].join("\n"));
|
|
64
|
+
}
|
|
65
|
+
const projectRoot = (0, _args).getProjectRoot(args);
|
|
66
|
+
const { resolveOptionsAsync } = await Promise.resolve().then(function() {
|
|
67
|
+
return _interopRequireWildcard(require("./resolveOptions"));
|
|
68
|
+
});
|
|
69
|
+
const options = await resolveOptionsAsync(args).catch(_errors.logCmdError);
|
|
70
|
+
const { exportAsync } = await Promise.resolve().then(function() {
|
|
71
|
+
return _interopRequireWildcard(require("./exportAsync"));
|
|
72
|
+
});
|
|
73
|
+
return exportAsync(projectRoot, options).catch(_errors.logCmdError);
|
|
74
|
+
};
|
|
75
|
+
exports.expoExport = expoExport;
|
|
76
|
+
|
|
77
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/export/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport { assertArgs, getProjectRoot, printHelp } from '../utils/args';\nimport { logCmdError } from '../utils/errors';\n\nexport const expoExport: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n '--clear': Boolean,\n '--dump-assetmap': Boolean,\n '--dev': Boolean,\n '--dump-sourcemap': Boolean,\n '--max-workers': Number,\n '--output-dir': String,\n // Aliases\n '-h': '--help',\n // '-s': '--dump-sourcemap',\n // '-d': '--dump-assetmap',\n '-c': '--clear',\n },\n argv\n );\n\n if (args['--help']) {\n printHelp(\n `Export the static files of the app for hosting it on a web server`,\n chalk`npx expo export {dim <dir>}`,\n [\n chalk`<dir> Directory of the Expo project. {dim Default: Current working directory}`,\n chalk`--platform <all|android|ios> Platforms: android, ios, all. {dim Default: all}`,\n `--dev Configure static files for developing locally using a non-https server`,\n chalk`--output-dir <dir> The directory to export the static files to. {dim Default: dist}`,\n `--max-workers <number> Maximum number of tasks to allow the bundler to spawn`,\n `--dump-assetmap Dump the asset map for further processing`,\n `--dump-sourcemap Dump the source map for debugging the JS bundle`,\n `-c, --clear Clear the bundler cache`,\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n const projectRoot = getProjectRoot(args);\n const { resolveOptionsAsync } = await import('./resolveOptions');\n const options = await resolveOptionsAsync(args).catch(logCmdError);\n\n const { exportAsync } = await import('./exportAsync');\n return exportAsync(projectRoot, options).catch(logCmdError);\n};\n"],"names":["expoExport","argv","args","assertArgs","Boolean","Number","String","printHelp","chalk","join","projectRoot","getProjectRoot","resolveOptionsAsync","options","catch","logCmdError","exportAsync"],"mappings":"AAAA;;;;;;AACkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAG6B,IAAA,KAAe,WAAf,eAAe,CAAA;AACzC,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtC,MAAMA,UAAU,GAAY,OAAOC,IAAI,GAAK;IACjD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAU,AAiBtB,CAAA,WAjBsB,CACrB;QACE,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