@expo/cli 0.14.0 → 0.16.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 +13 -5
- package/build/bin/cli.map +1 -1
- package/build/src/api/getVersions.js.map +1 -1
- package/build/src/api/rest/cache/response.js.map +1 -1
- package/build/src/api/rest/client.js +2 -2
- package/build/src/api/rest/client.js.map +1 -1
- package/build/src/api/user/actions.js +1 -1
- package/build/src/api/user/actions.js.map +1 -1
- package/build/src/customize/typescript.js +3 -1
- package/build/src/customize/typescript.js.map +1 -1
- package/build/src/export/createMetadataJson.js +5 -3
- package/build/src/export/createMetadataJson.js.map +1 -1
- package/build/src/export/embed/exportEmbedAsync.js +92 -18
- package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
- package/build/src/export/embed/resolveOptions.js +3 -3
- package/build/src/export/embed/resolveOptions.js.map +1 -1
- package/build/src/export/embed/xcodeCompilerLogger.js +97 -0
- package/build/src/export/embed/xcodeCompilerLogger.js.map +1 -0
- package/build/src/export/exportApp.js +106 -130
- package/build/src/export/exportApp.js.map +1 -1
- package/build/src/export/exportAssets.js +93 -38
- 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 +0 -90
- package/build/src/export/exportHermes.js.map +1 -1
- package/build/src/export/exportStaticAsync.js +165 -101
- package/build/src/export/exportStaticAsync.js.map +1 -1
- package/build/src/export/favicon.js +13 -5
- package/build/src/export/favicon.js.map +1 -1
- package/build/src/export/fork-bundleAsync.js +84 -57
- package/build/src/export/fork-bundleAsync.js.map +1 -1
- package/build/src/export/index.js +9 -7
- package/build/src/export/index.js.map +1 -1
- package/build/src/export/metroAssetLocalPath.js +101 -0
- package/build/src/export/metroAssetLocalPath.js.map +1 -0
- package/build/src/export/persistMetroAssets.js +115 -31
- package/build/src/export/persistMetroAssets.js.map +1 -1
- package/build/src/export/publicFolder.js +7 -0
- package/build/src/export/publicFolder.js.map +1 -1
- package/build/src/export/resolveOptions.js +1 -1
- package/build/src/export/resolveOptions.js.map +1 -1
- package/build/src/export/saveAssets.js +168 -43
- package/build/src/export/saveAssets.js.map +1 -1
- package/build/src/export/web/exportWebAsync.js +1 -1
- package/build/src/export/web/exportWebAsync.js.map +1 -1
- package/build/src/export/writeContents.js +8 -106
- package/build/src/export/writeContents.js.map +1 -1
- package/build/src/install/applyPlugins.js +52 -0
- package/build/src/install/applyPlugins.js.map +1 -0
- package/build/src/install/checkPackages.js +2 -2
- package/build/src/install/checkPackages.js.map +1 -1
- package/build/src/install/fixPackages.js +84 -0
- package/build/src/install/fixPackages.js.map +1 -0
- package/build/src/install/installAsync.js +50 -60
- package/build/src/install/installAsync.js.map +1 -1
- package/build/src/install/installExpoPackage.js +79 -0
- package/build/src/install/installExpoPackage.js.map +1 -0
- package/build/src/prebuild/clearNativeFolder.js +1 -1
- package/build/src/prebuild/clearNativeFolder.js.map +1 -1
- package/build/src/prebuild/configureProjectAsync.js +3 -3
- package/build/src/prebuild/configureProjectAsync.js.map +1 -1
- package/build/src/prebuild/copyTemplateFiles.js +21 -30
- package/build/src/prebuild/copyTemplateFiles.js.map +1 -1
- package/build/src/prebuild/prebuildAsync.js +45 -16
- package/build/src/prebuild/prebuildAsync.js.map +1 -1
- package/build/src/prebuild/resolveOptions.js +2 -2
- package/build/src/prebuild/resolveOptions.js.map +1 -1
- package/build/src/prebuild/updateFromTemplate.js +6 -6
- package/build/src/prebuild/updateFromTemplate.js.map +1 -1
- package/build/src/prebuild/updatePackageJson.js +49 -36
- package/build/src/prebuild/updatePackageJson.js.map +1 -1
- package/build/src/prebuild/validateTemplatePlatforms.js +2 -2
- package/build/src/prebuild/validateTemplatePlatforms.js.map +1 -1
- package/build/src/run/hints.js +4 -0
- package/build/src/run/hints.js.map +1 -1
- package/build/src/run/index.js +101 -0
- package/build/src/run/index.js.map +1 -0
- package/build/src/start/doctor/dependencies/bundledNativeModules.js +2 -2
- package/build/src/start/doctor/dependencies/bundledNativeModules.js.map +1 -1
- package/build/src/start/doctor/dependencies/getVersionedPackages.js +22 -7
- package/build/src/start/doctor/dependencies/getVersionedPackages.js.map +1 -1
- package/build/src/start/doctor/dependencies/resolvePackages.js +66 -0
- package/build/src/start/doctor/dependencies/resolvePackages.js.map +1 -0
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js +22 -33
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js.map +1 -1
- package/build/src/start/interface/interactiveActions.js +54 -19
- package/build/src/start/interface/interactiveActions.js.map +1 -1
- package/build/src/start/server/BundlerDevServer.js +14 -10
- package/build/src/start/server/BundlerDevServer.js.map +1 -1
- package/build/src/start/server/DevServerManager.js +6 -1
- package/build/src/start/server/DevServerManager.js.map +1 -1
- package/build/src/start/server/DevToolsPluginManager.js +63 -0
- package/build/src/start/server/DevToolsPluginManager.js.map +1 -0
- package/build/src/start/server/getStaticRenderFunctions.js +25 -23
- package/build/src/start/server/getStaticRenderFunctions.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +76 -69
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/MetroTerminalReporter.js +6 -2
- package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
- package/build/src/start/server/metro/TerminalReporter.js +18 -1
- package/build/src/start/server/metro/TerminalReporter.js.map +1 -1
- package/build/src/start/server/metro/bundleApiRoutes.js +5 -3
- package/build/src/start/server/metro/bundleApiRoutes.js.map +1 -1
- package/build/src/start/server/metro/createExpoMetroResolver.js +80 -46
- package/build/src/start/server/metro/createExpoMetroResolver.js.map +1 -1
- package/build/src/start/server/metro/createJResolver.js +152 -0
- package/build/src/start/server/metro/createJResolver.js.map +1 -0
- package/build/src/start/server/metro/createServerRouteMiddleware.js +15 -2
- package/build/src/start/server/metro/createServerRouteMiddleware.js.map +1 -1
- package/build/src/start/server/metro/{inspector-proxy/device.js → debugging/InspectorDevice.js} +10 -38
- package/build/src/start/server/metro/debugging/InspectorDevice.js.map +1 -0
- package/build/src/start/server/metro/debugging/InspectorProxy.js +116 -0
- package/build/src/start/server/metro/debugging/InspectorProxy.js.map +1 -0
- package/build/src/start/server/metro/debugging/createDebugMiddleware.js +45 -0
- package/build/src/start/server/metro/debugging/createDebugMiddleware.js.map +1 -0
- package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/NetworkResponse.js +3 -4
- package/build/src/start/server/metro/debugging/inspectorHandlers/NetworkResponse.js.map +1 -0
- package/build/src/start/server/metro/debugging/inspectorHandlers/PageReload.js.map +1 -0
- package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/VscodeDebuggerGetPossibleBreakpoints.js +5 -6
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeDebuggerGetPossibleBreakpoints.js.map +1 -0
- package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/VscodeDebuggerScriptParsed.js +3 -2
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeDebuggerScriptParsed.js.map +1 -0
- package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/VscodeDebuggerSetBreakpointByUrl.js +3 -2
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeDebuggerSetBreakpointByUrl.js.map +1 -0
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeRuntimeCallFunctionOn.js +24 -0
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeRuntimeCallFunctionOn.js.map +1 -0
- package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/VscodeRuntimeGetProperties.js +5 -4
- package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeRuntimeGetProperties.js.map +1 -0
- package/build/src/start/server/metro/debugging/inspectorHandlers/types.js.map +1 -0
- package/build/src/start/server/metro/debugging/inspectorHandlers/utils.js +20 -0
- package/build/src/start/server/metro/debugging/inspectorHandlers/utils.js.map +1 -0
- package/build/src/start/server/metro/externals.js +25 -3
- package/build/src/start/server/metro/externals.js.map +1 -1
- package/build/src/start/server/metro/getCssModulesFromBundler.js.map +1 -1
- package/build/src/start/server/metro/instantiateMetro.js +40 -15
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/start/server/metro/metroErrorInterface.js +3 -2
- package/build/src/start/server/metro/metroErrorInterface.js.map +1 -1
- package/build/src/start/server/metro/router.js +5 -6
- package/build/src/start/server/metro/router.js.map +1 -1
- package/build/src/start/server/metro/runServer-fork.js +17 -27
- package/build/src/start/server/metro/runServer-fork.js.map +1 -1
- package/build/src/start/server/metro/serializeHtml.js +59 -0
- package/build/src/start/server/metro/serializeHtml.js.map +1 -0
- package/build/src/start/server/metro/waitForMetroToObserveTypeScriptFile.js +1 -2
- package/build/src/start/server/metro/waitForMetroToObserveTypeScriptFile.js.map +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js +237 -214
- package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
- package/build/src/start/server/metro/withMetroResolvers.js +114 -40
- package/build/src/start/server/metro/withMetroResolvers.js.map +1 -1
- package/build/src/start/server/middleware/DevToolsPluginMiddleware.js +61 -0
- package/build/src/start/server/middleware/DevToolsPluginMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/ExpoMiddleware.js +2 -2
- package/build/src/start/server/middleware/ExpoMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ManifestMiddleware.js +22 -66
- package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/inspector/JsInspector.js +23 -2
- package/build/src/start/server/middleware/inspector/JsInspector.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowser.js +30 -26
- package/build/src/start/server/middleware/inspector/LaunchBrowser.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowser.types.js +7 -7
- package/build/src/start/server/middleware/inspector/LaunchBrowser.types.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplLinux.js +5 -2
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplLinux.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplMacOS.js +3 -2
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplMacOS.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplWindows.js +8 -7
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplWindows.js.map +1 -1
- package/build/src/start/server/middleware/metroOptions.js +176 -0
- package/build/src/start/server/middleware/metroOptions.js.map +1 -0
- package/build/src/start/server/type-generation/__typetests__/fixtures/basic.js.map +1 -1
- package/build/src/start/server/type-generation/__typetests__/route.test.js +11 -3
- package/build/src/start/server/type-generation/__typetests__/route.test.js.map +1 -1
- package/build/src/start/server/type-generation/routes.js +6 -4
- package/build/src/start/server/type-generation/routes.js.map +1 -1
- package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js +1 -1
- package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js.map +1 -1
- package/build/src/utils/analytics/getMetroDebugProperties.js +1 -2
- package/build/src/utils/analytics/getMetroDebugProperties.js.map +1 -1
- package/build/src/utils/analytics/getMetroProperties.js +1 -2
- package/build/src/utils/analytics/getMetroProperties.js.map +1 -1
- package/build/src/utils/analytics/rudderstackClient.js +2 -2
- package/build/src/utils/args.js +4 -2
- package/build/src/utils/args.js.map +1 -1
- package/build/src/utils/cocoapods.js +1 -1
- package/build/src/utils/cocoapods.js.map +1 -1
- package/build/src/utils/codesigning.js +11 -1
- package/build/src/utils/codesigning.js.map +1 -1
- package/build/src/utils/dir.js +18 -8
- package/build/src/utils/dir.js.map +1 -1
- package/build/src/utils/env.js +10 -1
- package/build/src/utils/env.js.map +1 -1
- package/build/src/utils/getOrPromptApplicationId.js +2 -4
- package/build/src/utils/getOrPromptApplicationId.js.map +1 -1
- package/build/src/utils/prompts.js +1 -28
- package/build/src/utils/prompts.js.map +1 -1
- package/build/src/utils/tsconfig/loadTsConfigPaths.js +3 -11
- package/build/src/utils/tsconfig/loadTsConfigPaths.js.map +1 -1
- package/build/src/utils/tsconfig/resolveWithTsConfigPaths.js +22 -12
- package/build/src/utils/tsconfig/resolveWithTsConfigPaths.js.map +1 -1
- package/package.json +19 -18
- package/static/shims/react-native-web/dist/cjs/exports/AppRegistry/AppContainer.js +13 -0
- package/static/shims/react-native-web/dist/exports/AppRegistry/AppContainer.js +12 -0
- package/static/template/index.html +14 -95
- package/build/src/export/printBundleSizes.js +0 -101
- package/build/src/export/printBundleSizes.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/device.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/NetworkResponse.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/PageReload.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerGetPossibleBreakpoints.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerScriptParsed.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerSetBreakpointByUrl.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/VscodeRuntimeGetProperties.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/types.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/index.js +0 -27
- package/build/src/start/server/metro/inspector-proxy/index.js.map +0 -1
- package/build/src/start/server/metro/inspector-proxy/proxy.js +0 -169
- package/build/src/start/server/metro/inspector-proxy/proxy.js.map +0 -1
- package/build/src/start/server/metro/resolveFromProject.js +0 -90
- package/build/src/start/server/metro/resolveFromProject.js.map +0 -1
- package/build/src/start/server/middleware/inspector/createJsInspectorMiddleware.js +0 -64
- package/build/src/start/server/middleware/inspector/createJsInspectorMiddleware.js.map +0 -1
- /package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/PageReload.js +0 -0
- /package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/types.js +0 -0
|
@@ -1 +1 @@
|
|
|
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,GAA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OA,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(\n projectRoot: string,\n exp: ExpoConfig = getConfig(projectRoot).exp\n): Promise<string> {\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(\n projectRoot: string,\n exp: ExpoConfig = getConfig(projectRoot).exp\n): Promise<string> {\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;;;;Q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CACpB"}
|
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
Object.defineProperty(exports, "PromptType", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _prompts.PromptType;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
5
|
exports.default = prompt;
|
|
12
6
|
exports.confirmAsync = confirmAsync;
|
|
13
7
|
exports.selectAsync = selectAsync;
|
|
@@ -18,7 +12,7 @@ exports.resumeInteractions = resumeInteractions;
|
|
|
18
12
|
exports.createSelectionFilter = createSelectionFilter;
|
|
19
13
|
exports.promptAsync = void 0;
|
|
20
14
|
var _assert = _interopRequireDefault(require("assert"));
|
|
21
|
-
var _prompts =
|
|
15
|
+
var _prompts = _interopRequireDefault(require("prompts"));
|
|
22
16
|
var _errors = require("./errors");
|
|
23
17
|
var _interactive = require("./interactive");
|
|
24
18
|
async function prompt(questions, { nonInteractiveHelp , ...options } = {}) {
|
|
@@ -54,27 +48,6 @@ function _interopRequireDefault(obj) {
|
|
|
54
48
|
default: obj
|
|
55
49
|
};
|
|
56
50
|
}
|
|
57
|
-
function _interopRequireWildcard(obj) {
|
|
58
|
-
if (obj && obj.__esModule) {
|
|
59
|
-
return obj;
|
|
60
|
-
} else {
|
|
61
|
-
var newObj = {};
|
|
62
|
-
if (obj != null) {
|
|
63
|
-
for(var key in obj){
|
|
64
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
65
|
-
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
|
66
|
-
if (desc.get || desc.set) {
|
|
67
|
-
Object.defineProperty(newObj, key, desc);
|
|
68
|
-
} else {
|
|
69
|
-
newObj[key] = obj[key];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
newObj.default = obj;
|
|
75
|
-
return newObj;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
51
|
const debug = require("debug")("expo:utils:prompts");
|
|
79
52
|
/** Interaction observers for detecting when keystroke tracking should pause/resume. */ const listeners = [];
|
|
80
53
|
async function confirmAsync(questions, options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/prompts.ts"],"sourcesContent":["import assert from 'assert';\nimport prompts, { Choice, Options, PromptObject
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/prompts.ts"],"sourcesContent":["import assert from 'assert';\nimport prompts, { Choice, Options, PromptObject } from 'prompts';\n\nimport { AbortCommandError, CommandError } from './errors';\nimport { isInteractive } from './interactive';\n\nconst debug = require('debug')('expo:utils:prompts') as typeof console.log;\n\nexport type Question<V extends string = string> = PromptObject<V> & {\n optionsPerPage?: number;\n};\n\nexport interface ExpoChoice<T> extends Choice {\n value: T;\n}\n\ntype PromptOptions = { nonInteractiveHelp?: string } & Options;\n\nexport type NamelessQuestion = Omit<Question<'value'>, 'name' | 'type'>;\n\ntype InteractionOptions = { pause: boolean; canEscape?: boolean };\n\ntype InteractionCallback = (options: InteractionOptions) => void;\n\n/** Interaction observers for detecting when keystroke tracking should pause/resume. */\nconst listeners: InteractionCallback[] = [];\n\nexport default async function prompt(\n questions: Question | Question[],\n { nonInteractiveHelp, ...options }: PromptOptions = {}\n) {\n questions = Array.isArray(questions) ? questions : [questions];\n if (!isInteractive() && questions.length !== 0) {\n let message = `Input is required, but 'npx expo' is in non-interactive mode.\\n`;\n if (nonInteractiveHelp) {\n message += nonInteractiveHelp;\n } else {\n const question = questions[0];\n const questionMessage =\n typeof question.message === 'function'\n ? question.message(undefined, {}, question)\n : question.message;\n\n message += `Required input:\\n${(questionMessage || '').trim().replace(/^/gm, '> ')}`;\n }\n throw new CommandError('NON_INTERACTIVE', message);\n }\n\n pauseInteractions();\n try {\n const results = await prompts(questions, {\n onCancel() {\n throw new AbortCommandError();\n },\n ...options,\n });\n\n return results;\n } finally {\n resumeInteractions();\n }\n}\n\n/**\n * Create a standard yes/no confirmation that can be cancelled.\n *\n * @param questions\n * @param options\n */\nexport async function confirmAsync(\n questions: NamelessQuestion,\n options?: PromptOptions\n): Promise<boolean> {\n const { value } = await prompt(\n {\n initial: true,\n ...questions,\n name: 'value',\n type: 'confirm',\n },\n options\n );\n return value ?? null;\n}\n\n/** Select an option from a list of options. */\nexport async function selectAsync<T>(\n message: string,\n choices: ExpoChoice<T>[],\n options?: PromptOptions\n): Promise<T> {\n const { value } = await prompt(\n {\n message,\n choices,\n name: 'value',\n type: 'select',\n },\n options\n );\n return value ?? null;\n}\n\nexport const promptAsync = prompt;\n\n/** Used to pause/resume interaction observers while prompting (made for TerminalUI). */\nexport function addInteractionListener(callback: InteractionCallback) {\n listeners.push(callback);\n}\n\nexport function removeInteractionListener(callback: InteractionCallback) {\n const listenerIndex = listeners.findIndex((_callback) => _callback === callback);\n assert(\n listenerIndex >= 0,\n 'removeInteractionListener(): cannot remove an unregistered event listener.'\n );\n listeners.splice(listenerIndex, 1);\n}\n\n/** Notify all listeners that keypress observations must pause. */\nexport function pauseInteractions(options: Omit<InteractionOptions, 'pause'> = {}) {\n debug('Interaction observers paused');\n for (const listener of listeners) {\n listener({ pause: true, ...options });\n }\n}\n\n/** Notify all listeners that keypress observations can start.. */\nexport function resumeInteractions(options: Omit<InteractionOptions, 'pause'> = {}) {\n debug('Interaction observers resumed');\n for (const listener of listeners) {\n listener({ pause: false, ...options });\n }\n}\n\nexport function createSelectionFilter(): (input: any, choices: Choice[]) => Promise<any> {\n function escapeRegex(string: string) {\n return string.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n return async (input: any, choices: Choice[]) => {\n try {\n const regex = new RegExp(escapeRegex(input), 'i');\n return choices.filter((choice: any) => regex.test(choice.title));\n } catch (error: any) {\n debug('Error filtering choices', error);\n return [];\n }\n };\n}\n"],"names":["prompt","confirmAsync","selectAsync","addInteractionListener","removeInteractionListener","pauseInteractions","resumeInteractions","createSelectionFilter","questions","nonInteractiveHelp","options","Array","isArray","isInteractive","length","message","question","questionMessage","undefined","trim","replace","CommandError","results","prompts","onCancel","AbortCommandError","debug","require","listeners","value","initial","name","type","choices","promptAsync","callback","push","listenerIndex","findIndex","_callback","assert","splice","listener","pause","escapeRegex","string","input","regex","RegExp","filter","choice","test","title","error"],"mappings":"AAAA;;;;kBA2B8BA,MAAM;QA0CdC,YAAY,GAAZA,YAAY;QAiBZC,WAAW,GAAXA,WAAW;QAoBjBC,sBAAsB,GAAtBA,sBAAsB;QAItBC,yBAAyB,GAAzBA,yBAAyB;QAUzBC,iBAAiB,GAAjBA,iBAAiB;QAQjBC,kBAAkB,GAAlBA,kBAAkB;QAOlBC,qBAAqB,GAArBA,qBAAqB;;AAvIlB,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AAC4B,IAAA,QAAS,kCAAT,SAAS,EAAA;AAEhB,IAAA,OAAU,WAAV,UAAU,CAAA;AAC5B,IAAA,YAAe,WAAf,eAAe,CAAA;AAuB9B,eAAeP,MAAM,CAClCQ,SAAgC,EAChC,EAAEC,kBAAkB,CAAA,EAAE,GAAGC,OAAO,EAAiB,GAAG,EAAE,EACtD;IACAF,SAAS,GAAGG,KAAK,CAACC,OAAO,CAACJ,SAAS,CAAC,GAAGA,SAAS,GAAG;QAACA,SAAS;KAAC,CAAC;IAC/D,IAAI,CAACK,CAAAA,GAAAA,YAAa,AAAE,CAAA,cAAF,EAAE,IAAIL,SAAS,CAACM,MAAM,KAAK,CAAC,EAAE;QAC9C,IAAIC,OAAO,GAAG,CAAC,+DAA+D,CAAC,AAAC;QAChF,IAAIN,kBAAkB,EAAE;YACtBM,OAAO,IAAIN,kBAAkB,CAAC;SAC/B,MAAM;YACL,MAAMO,QAAQ,GAAGR,SAAS,CAAC,CAAC,CAAC,AAAC;YAC9B,MAAMS,eAAe,GACnB,OAAOD,QAAQ,CAACD,OAAO,KAAK,UAAU,GAClCC,QAAQ,CAACD,OAAO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O0B,KAAU,EAAEb,OAAiB,GAAK;QAC9C,IAAI;YACF,MAAMc,KAAK,GAAG,IAAIC,MAAM,CAACJ,WAAW,CAACE,KAAK,CAAC,EAAE,GAAG,CAAC,AAAC;YAClD,OAAOb,OAAO,CAACgB,MAAM,CAAC,CAACC,MAAW,GAAKH,KAAK,CAACI,IAAI,CAACD,MAAM,CAACE,KAAK,CAAC;YAAA,CAAC,CAAC;SAClE,CAAC,OAAOC,KAAK,EAAO;YACnB3B,KAAK,CAAC,yBAAyB,EAAE2B,KAAK,CAAC,CAAC;YACxC,OAAO,EAAE,CAAC;SACX;KACF,CAAC;CACH"}
|
|
@@ -19,18 +19,10 @@ async function loadTsConfigPathsAsync(dir) {
|
|
|
19
19
|
const options = (ref = await readTsconfigAsync(dir)) != null ? ref : await readJsconfigAsync(dir);
|
|
20
20
|
if (options) {
|
|
21
21
|
var ref1, ref2;
|
|
22
|
-
const [
|
|
23
|
-
if ((ref1 = config.compilerOptions) == null ? void 0 : ref1.baseUrl) {
|
|
24
|
-
var ref3;
|
|
25
|
-
return {
|
|
26
|
-
paths: (ref3 = config.compilerOptions) == null ? void 0 : ref3.paths,
|
|
27
|
-
baseUrl: _path.default.resolve(dir, config.compilerOptions.baseUrl)
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
debug(`No baseUrl found in ${filepath}`);
|
|
22
|
+
const [, config] = options;
|
|
31
23
|
return {
|
|
32
|
-
paths: (
|
|
33
|
-
baseUrl: dir
|
|
24
|
+
paths: (ref1 = config.compilerOptions) == null ? void 0 : ref1.paths,
|
|
25
|
+
baseUrl: ((ref2 = config.compilerOptions) == null ? void 0 : ref2.baseUrl) ? _path.default.resolve(dir, config.compilerOptions.baseUrl) : undefined
|
|
34
26
|
};
|
|
35
27
|
}
|
|
36
28
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/utils/tsconfig/loadTsConfigPaths.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport path from 'path';\n\nimport { evaluateTsConfig, importTypeScriptFromProjectOptionally } from './evaluateTsConfig';\nimport { fileExistsAsync } from '../dir';\n\nexport type TsConfigPaths = {\n paths?: Record<string, string[]>;\n baseUrl
|
|
1
|
+
{"version":3,"sources":["../../../../src/utils/tsconfig/loadTsConfigPaths.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport path from 'path';\n\nimport { evaluateTsConfig, importTypeScriptFromProjectOptionally } from './evaluateTsConfig';\nimport { fileExistsAsync } from '../dir';\n\nexport type TsConfigPaths = {\n paths?: Record<string, string[]>;\n baseUrl?: string;\n};\n\ntype ConfigReadResults = [\n string,\n {\n compilerOptions?: {\n baseUrl?: string;\n paths?: Record<string, string[]>;\n };\n },\n];\n\nconst debug = require('debug')('expo:utils:tsconfig:load') as typeof console.log;\n\nexport async function loadTsConfigPathsAsync(dir: string): Promise<TsConfigPaths | null> {\n const options = (await readTsconfigAsync(dir)) ?? (await readJsconfigAsync(dir));\n if (options) {\n const [, config] = options;\n return {\n paths: config.compilerOptions?.paths,\n baseUrl: config.compilerOptions?.baseUrl\n ? path.resolve(dir, config.compilerOptions.baseUrl)\n : undefined,\n };\n }\n return null;\n}\n\nasync function readJsconfigAsync(projectRoot: string): Promise<null | ConfigReadResults> {\n const configPath = path.join(projectRoot, 'jsconfig.json');\n if (await fileExistsAsync(configPath)) {\n const config = await JsonFile.readAsync(configPath, { json5: true });\n if (config) {\n return [configPath, config];\n }\n }\n return null;\n}\n\n// TODO: Refactor for speed\nexport async function readTsconfigAsync(projectRoot: string): Promise<null | ConfigReadResults> {\n const configPath = path.join(projectRoot, 'tsconfig.json');\n if (await fileExistsAsync(configPath)) {\n // We need to fully evaluate the tsconfig to get the baseUrl and paths in case they were applied in `extends`.\n const ts = importTypeScriptFromProjectOptionally(projectRoot);\n if (ts) {\n return [configPath, evaluateTsConfig(ts, configPath)];\n }\n debug(`typescript module not found in: ${projectRoot}`);\n }\n return null;\n}\n"],"names":["loadTsConfigPathsAsync","readTsconfigAsync","debug","require","dir","options","readJsconfigAsync","config","paths","compilerOptions","baseUrl","path","resolve","undefined","projectRoot","configPath","join","fileExistsAsync","JsonFile","readAsync","json5","ts","importTypeScriptFromProjectOptionally","evaluateTsConfig"],"mappings":"AAAA;;;;QAuBsBA,sBAAsB,GAAtBA,sBAAsB;QA0BtBC,iBAAiB,GAAjBA,iBAAiB;AAjDlB,IAAA,SAAiB,kCAAjB,iBAAiB,EAAA;AACrB,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEiD,IAAA,iBAAoB,WAApB,oBAAoB,CAAA;AAC5D,IAAA,IAAQ,WAAR,QAAQ,CAAA;;;;;;AAiBxC,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,0BAA0B,CAAC,AAAsB,AAAC;AAE1E,eAAeH,sBAAsB,CAACI,GAAW,EAAiC;QACvE,GAA8B;IAA9C,MAAMC,OAAO,GAAG,CAAA,GAA8B,GAA7B,MAAMJ,iBAAiB,CAACG,GAAG,CAAC,YAA7B,GAA8B,GAAK,MAAME,iBAAiB,CAACF,GAAG,CAAC,AAAC,AAAC;IACjF,IAAIC,OAAO,EAAE;YAGFE,IAAsB,EACpBA,IAAsB;QAHjC,MAAM,GAAGA,MAAM,CAAC,GAAGF,OAAO,AAAC;QAC3B,OAAO;YACLG,KAAK,EAAED,CAAAA,IAAsB,GAAtBA,MAAM,CAACE,eAAe,SAAO,GAA7BF,KAAAA,CAA6B,GAA7BA,IAAsB,CAAEC,KAAK;YACpCE,OAAO,EAAEH,CAAAA,CAAAA,IAAsB,GAAtBA,MAAM,CAACE,eAAe,SAAS,GAA/BF,KAAAA,CAA+B,GAA/BA,IAAsB,CAAEG,OAAO,CAAA,GACpCC,KAAI,QAAA,CAACC,OAAO,CAACR,GAAG,EAAEG,MAAM,CAACE,eAAe,CAACC,OAAO,CAAC,GACjDG,SAAS;SACd,CAAC;KACH;IACD,OAAO,IAAI,CAAC;CACb;AAED,eAAeP,iBAAiB,CAACQ,WAAmB,EAAqC;IACvF,MAAMC,UAAU,GAAGJ,KAAI,QAAA,CAACK,IAAI,CAACF,WAAW,EAAE,eAAe,CAAC,AAAC;IAC3D,IAAI,MAAMG,CAAAA,GAAAA,IAAe,AAAY,CAAA,gBAAZ,CAACF,UAAU,CAAC,EAAE;QACrC,MAAMR,MAAM,GAAG,MAAMW,SAAQ,QAAA,CAACC,SAAS,CAACJ,UAAU,EAAE;YAAEK,KAAK,EAAE,IAAI;SAAE,CAAC,AAAC;QACrE,IAAIb,MAAM,EAAE;YACV,OAAO;gBAACQ,UAAU;gBAAER,MAAM;aAAC,CAAC;SAC7B;KACF;IACD,OAAO,IAAI,CAAC;CACb;AAGM,eAAeN,iBAAiB,CAACa,WAAmB,EAAqC;IAC9F,MAAMC,UAAU,GAAGJ,KAAI,QAAA,CAACK,IAAI,CAACF,WAAW,EAAE,eAAe,CAAC,AAAC;IAC3D,IAAI,MAAMG,CAAAA,GAAAA,IAAe,AAAY,CAAA,gBAAZ,CAACF,UAAU,CAAC,EAAE;QACrC,8GAA8G;QAC9G,MAAMM,EAAE,GAAGC,CAAAA,GAAAA,iBAAqC,AAAa,CAAA,sCAAb,CAACR,WAAW,CAAC,AAAC;QAC9D,IAAIO,EAAE,EAAE;YACN,OAAO;gBAACN,UAAU;gBAAEQ,CAAAA,GAAAA,iBAAgB,AAAgB,CAAA,iBAAhB,CAACF,EAAE,EAAEN,UAAU,CAAC;aAAC,CAAC;SACvD;QACDb,KAAK,CAAC,CAAC,gCAAgC,EAAEY,WAAW,CAAC,CAAC,CAAC,CAAC;KACzD;IACD,OAAO,IAAI,CAAC;CACb"}
|
|
@@ -15,24 +15,34 @@ const isAbsolute = process.platform === "win32" ? _path.default.win32.isAbsolute
|
|
|
15
15
|
function resolveWithTsConfigPaths(config, request, resolve) {
|
|
16
16
|
const aliases = Object.keys(config.paths);
|
|
17
17
|
if (// If no aliases are added bail out
|
|
18
|
-
!aliases.length || // Library authors cannot utilize this feature in userspace.
|
|
18
|
+
(!aliases.length && !config.hasBaseUrl) || // Library authors cannot utilize this feature in userspace.
|
|
19
19
|
/node_modules/.test(request.originModulePath) || // Absolute paths are not supported
|
|
20
20
|
isAbsolute(request.moduleName) || // Relative paths are not supported
|
|
21
21
|
/^\.\.?($|[\\/])/.test(request.moduleName)) {
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
24
|
const matched = (0, _matchTsConfigPathAlias).matchTsConfigPathAlias(aliases, request.moduleName);
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
if (matched) {
|
|
26
|
+
for (const alias of config.paths[matched.text]){
|
|
27
|
+
const nextModuleName = matched.star ? alias.replace("*", matched.star) : alias;
|
|
28
|
+
if (/\.d\.ts$/.test(nextModuleName)) continue;
|
|
29
|
+
const possibleResult = _path.default.join(config.baseUrl, nextModuleName);
|
|
30
|
+
const result = resolve(possibleResult);
|
|
31
|
+
if (result) {
|
|
32
|
+
debug(`${request.moduleName} -> ${possibleResult}`);
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
// Only resolve against baseUrl if no `paths` groups were matched.
|
|
38
|
+
// Base URL is resolved after paths, and before node_modules.
|
|
39
|
+
if (config.hasBaseUrl) {
|
|
40
|
+
const possibleResult = _path.default.join(config.baseUrl, request.moduleName);
|
|
41
|
+
const result = resolve(possibleResult);
|
|
42
|
+
if (result) {
|
|
43
|
+
debug(`baseUrl: ${request.moduleName} -> ${possibleResult}`);
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
36
46
|
}
|
|
37
47
|
}
|
|
38
48
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/utils/tsconfig/resolveWithTsConfigPaths.ts"],"sourcesContent":["import { Resolution } from 'metro-resolver';\nimport path from 'path';\n\nimport { matchTsConfigPathAlias } from './matchTsConfigPathAlias';\n\ntype Paths = { [match: string]: string[] };\n\nconst debug = require('debug')('expo:metro:tsconfig-paths') as typeof console.log;\n\nconst isAbsolute = process.platform === 'win32' ? path.win32.isAbsolute : path.posix.isAbsolute;\n\nexport function resolveWithTsConfigPaths(\n config: { paths: Paths; baseUrl: string },\n request: {\n /** Import request */\n moduleName: string;\n /** Originating file path */\n originModulePath: string;\n },\n resolve: (moduleName: string) => Resolution | null\n): Resolution | null {\n const aliases = Object.keys(config.paths);\n\n if (\n // If no aliases are added bail out\n !aliases.length ||\n // Library authors cannot utilize this feature in userspace.\n /node_modules/.test(request.originModulePath) ||\n // Absolute paths are not supported\n isAbsolute(request.moduleName) ||\n // Relative paths are not supported\n /^\\.\\.?($|[\\\\/])/.test(request.moduleName)\n ) {\n return null;\n }\n\n const matched = matchTsConfigPathAlias(aliases, request.moduleName);\n if (
|
|
1
|
+
{"version":3,"sources":["../../../../src/utils/tsconfig/resolveWithTsConfigPaths.ts"],"sourcesContent":["import { Resolution } from 'metro-resolver';\nimport path from 'path';\n\nimport { matchTsConfigPathAlias } from './matchTsConfigPathAlias';\n\ntype Paths = { [match: string]: string[] };\n\nconst debug = require('debug')('expo:metro:tsconfig-paths') as typeof console.log;\n\nconst isAbsolute = process.platform === 'win32' ? path.win32.isAbsolute : path.posix.isAbsolute;\n\nexport function resolveWithTsConfigPaths(\n config: { paths: Paths; baseUrl: string; hasBaseUrl: boolean },\n request: {\n /** Import request */\n moduleName: string;\n /** Originating file path */\n originModulePath: string;\n },\n resolve: (moduleName: string) => Resolution | null\n): Resolution | null {\n const aliases = Object.keys(config.paths);\n\n if (\n // If no aliases are added bail out\n (!aliases.length && !config.hasBaseUrl) ||\n // Library authors cannot utilize this feature in userspace.\n /node_modules/.test(request.originModulePath) ||\n // Absolute paths are not supported\n isAbsolute(request.moduleName) ||\n // Relative paths are not supported\n /^\\.\\.?($|[\\\\/])/.test(request.moduleName)\n ) {\n return null;\n }\n\n const matched = matchTsConfigPathAlias(aliases, request.moduleName);\n if (matched) {\n for (const alias of config.paths[matched.text]) {\n const nextModuleName = matched.star ? alias.replace('*', matched.star) : alias;\n\n if (/\\.d\\.ts$/.test(nextModuleName)) continue;\n\n const possibleResult = path.join(config.baseUrl, nextModuleName);\n\n const result = resolve(possibleResult);\n if (result) {\n debug(`${request.moduleName} -> ${possibleResult}`);\n return result;\n }\n }\n } else {\n // Only resolve against baseUrl if no `paths` groups were matched.\n // Base URL is resolved after paths, and before node_modules.\n if (config.hasBaseUrl) {\n const possibleResult = path.join(config.baseUrl, request.moduleName);\n const result = resolve(possibleResult);\n if (result) {\n debug(`baseUrl: ${request.moduleName} -> ${possibleResult}`);\n return result;\n }\n }\n }\n\n return null;\n}\n"],"names":["resolveWithTsConfigPaths","debug","require","isAbsolute","process","platform","path","win32","posix","config","request","resolve","aliases","Object","keys","paths","length","hasBaseUrl","test","originModulePath","moduleName","matched","matchTsConfigPathAlias","alias","text","nextModuleName","star","replace","possibleResult","join","baseUrl","result"],"mappings":"AAAA;;;;QAWgBA,wBAAwB,GAAxBA,wBAAwB;AAVvB,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEgB,IAAA,uBAA0B,WAA1B,0BAA0B,CAAA;;;;;;AAIjE,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,2BAA2B,CAAC,AAAsB,AAAC;AAElF,MAAMC,UAAU,GAAGC,OAAO,CAACC,QAAQ,KAAK,OAAO,GAAGC,KAAI,QAAA,CAACC,KAAK,CAACJ,UAAU,GAAGG,KAAI,QAAA,CAACE,KAAK,CAACL,UAAU,AAAC;AAEzF,SAASH,wBAAwB,CACtCS,MAA8D,EAC9DC,OAKC,EACDC,OAAkD,EAC/B;IACnB,MAAMC,OAAO,GAAGC,MAAM,CAACC,IAAI,CAACL,MAAM,CAACM,KAAK,CAAC,AAAC;IAE1C,IACE,mCAAmC;IACnC,CAAC,CAACH,OAAO,CAAC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AAM,GAAGpB,OAAO,CAACiB,cAAc,CAAC,AAAC;YACvC,IAAIG,MAAM,EAAE;gBACV9B,KAAK,CAAC,CAAC,SAAS,EAAES,OAAO,CAACU,UAAU,CAAC,IAAI,EAAEQ,cAAc,CAAC,CAAC,CAAC,CAAC;gBAC7D,OAAOG,MAAM,CAAC;aACf;SACF;KACF;IAED,OAAO,IAAI,CAAC;CACb"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "The Expo CLI",
|
|
5
5
|
"main": "build/bin/cli",
|
|
6
6
|
"bin": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"lint": "expo-module lint",
|
|
18
18
|
"typecheck": "expo-module typecheck",
|
|
19
19
|
"test": "expo-module test",
|
|
20
|
-
"test:e2e": "jest --config e2e/jest.config.js",
|
|
20
|
+
"test:e2e": "jest --config e2e/jest.config.js --runInBand",
|
|
21
21
|
"prepublishOnly": "expo-module prepublishOnly",
|
|
22
22
|
"expo-module": "expo-module",
|
|
23
23
|
"generate-graphql-code": "graphql-codegen --config graphql-codegen.yml"
|
|
@@ -39,29 +39,30 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@babel/runtime": "^7.20.0",
|
|
41
41
|
"@expo/code-signing-certificates": "0.0.5",
|
|
42
|
-
"@expo/
|
|
43
|
-
"@expo/config": "~8.
|
|
44
|
-
"@expo/config-plugins": "~7.6.0",
|
|
42
|
+
"@expo/config": "~8.5.0",
|
|
43
|
+
"@expo/config-plugins": "~7.8.0",
|
|
45
44
|
"@expo/devcert": "^1.0.0",
|
|
46
|
-
"@expo/env": "~0.
|
|
45
|
+
"@expo/env": "~0.2.0",
|
|
47
46
|
"@expo/json-file": "^8.2.37",
|
|
48
|
-
"@expo/metro-config": "~0.
|
|
47
|
+
"@expo/metro-config": "~0.16.0",
|
|
49
48
|
"@expo/osascript": "^2.0.31",
|
|
50
49
|
"@expo/package-manager": "^1.1.1",
|
|
51
|
-
"@expo/plist": "^0.0
|
|
52
|
-
"@expo/prebuild-config": "6.
|
|
50
|
+
"@expo/plist": "^0.1.0",
|
|
51
|
+
"@expo/prebuild-config": "6.7.0",
|
|
53
52
|
"@expo/rudder-sdk-node": "1.1.1",
|
|
53
|
+
"@expo/server": "^0.3.0",
|
|
54
54
|
"@expo/spawn-async": "1.5.0",
|
|
55
55
|
"@expo/xcpretty": "^4.2.1",
|
|
56
56
|
"@urql/core": "2.3.6",
|
|
57
57
|
"@urql/exchange-retry": "0.3.0",
|
|
58
58
|
"accepts": "^1.3.8",
|
|
59
|
-
"arg": "
|
|
59
|
+
"arg": "5.0.2",
|
|
60
60
|
"better-opn": "~3.0.2",
|
|
61
61
|
"bplist-parser": "^0.3.1",
|
|
62
62
|
"cacache": "^15.3.0",
|
|
63
63
|
"chalk": "^4.0.0",
|
|
64
64
|
"ci-info": "^3.3.0",
|
|
65
|
+
"connect": "^3.7.0",
|
|
65
66
|
"debug": "^4.3.4",
|
|
66
67
|
"env-editor": "^0.4.1",
|
|
67
68
|
"form-data": "^3.0.1",
|
|
@@ -73,6 +74,8 @@
|
|
|
73
74
|
"graphql-tag": "^2.10.1",
|
|
74
75
|
"https-proxy-agent": "^5.0.1",
|
|
75
76
|
"internal-ip": "4.3.0",
|
|
77
|
+
"is-docker": "^2.0.0",
|
|
78
|
+
"is-wsl": "^2.1.1",
|
|
76
79
|
"js-yaml": "^3.13.1",
|
|
77
80
|
"json-schema-deref-sync": "^0.13.0",
|
|
78
81
|
"md5hex": "^1.0.0",
|
|
@@ -81,6 +84,7 @@
|
|
|
81
84
|
"node-fetch": "^2.6.7",
|
|
82
85
|
"node-forge": "^1.3.1",
|
|
83
86
|
"npm-package-arg": "^7.0.0",
|
|
87
|
+
"open": "^8.3.0",
|
|
84
88
|
"ora": "3.4.0",
|
|
85
89
|
"pretty-bytes": "5.6.0",
|
|
86
90
|
"progress": "2.0.3",
|
|
@@ -90,22 +94,19 @@
|
|
|
90
94
|
"requireg": "^0.2.2",
|
|
91
95
|
"resolve": "^1.22.2",
|
|
92
96
|
"resolve-from": "^5.0.0",
|
|
97
|
+
"resolve.exports": "^2.0.2",
|
|
93
98
|
"semver": "^7.5.3",
|
|
94
99
|
"send": "^0.18.0",
|
|
95
100
|
"slugify": "^1.3.4",
|
|
96
101
|
"structured-headers": "^0.4.1",
|
|
97
102
|
"tar": "^6.0.5",
|
|
103
|
+
"temp-dir": "^2.0.0",
|
|
98
104
|
"tempy": "^0.7.1",
|
|
99
105
|
"terminal-link": "^2.1.1",
|
|
100
106
|
"text-table": "^0.2.0",
|
|
101
107
|
"url-join": "4.0.0",
|
|
102
108
|
"wrap-ansi": "^7.0.0",
|
|
103
|
-
"ws": "^8.12.1"
|
|
104
|
-
"connect": "^3.7.0",
|
|
105
|
-
"is-docker": "^2.0.0",
|
|
106
|
-
"is-wsl": "^2.1.1",
|
|
107
|
-
"open": "^8.3.0",
|
|
108
|
-
"temp-dir": "^2.0.0"
|
|
109
|
+
"ws": "^8.12.1"
|
|
109
110
|
},
|
|
110
111
|
"taskr": {
|
|
111
112
|
"requires": [
|
|
@@ -114,7 +115,7 @@
|
|
|
114
115
|
},
|
|
115
116
|
"devDependencies": {
|
|
116
117
|
"@expo/multipart-body-parser": "^1.0.0",
|
|
117
|
-
"@expo/ngrok": "4.1.
|
|
118
|
+
"@expo/ngrok": "4.1.3",
|
|
118
119
|
"@expo/webpack-config": "^0.17.4",
|
|
119
120
|
"@graphql-codegen/cli": "2.16.3",
|
|
120
121
|
"@graphql-codegen/typescript": "2.8.7",
|
|
@@ -158,5 +159,5 @@
|
|
|
158
159
|
"tree-kill": "^1.2.2",
|
|
159
160
|
"tsd": "^0.28.1"
|
|
160
161
|
},
|
|
161
|
-
"gitHead": "
|
|
162
|
+
"gitHead": "2763e9cc6f2317b40da73382fe2595f8deebff46"
|
|
162
163
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// NOTE(EvanBacon): `react-native-web` adds a extra `div`s around the root HTML, these
|
|
2
|
+
// make static rendering much harder as we expect the root element to be `<html>`.
|
|
3
|
+
// This resolution will alias to a simple in-out component to avoid the extra HTML.
|
|
4
|
+
function AppContainer({ children }) {
|
|
5
|
+
return children;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9
|
+
AppContainer.displayName = 'AppContainer';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
module.exports = AppContainer;
|
|
13
|
+
module.exports.default = AppContainer;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// NOTE(EvanBacon): `react-native-web` adds a extra `div`s around the root HTML, these
|
|
2
|
+
// make static rendering much harder as we expect the root element to be `<html>`.
|
|
3
|
+
// This resolution will alias to a simple in-out component to avoid the extra HTML.
|
|
4
|
+
function AppContainer({ children }) {
|
|
5
|
+
return children;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9
|
+
AppContainer.displayName = 'AppContainer';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default AppContainer;
|
|
@@ -3,113 +3,32 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
-
|
|
7
|
-
This viewport works for phones with notches.
|
|
8
|
-
It's optimized for gestures by disabling global zoom.
|
|
9
|
-
-->
|
|
10
|
-
<meta
|
|
11
|
-
name="viewport"
|
|
12
|
-
content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1.00001, viewport-fit=cover"
|
|
13
|
-
/>
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
|
14
7
|
<title>%WEB_TITLE%</title>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/exports/StyleSheet/initialRules.js
|
|
19
|
-
*/
|
|
8
|
+
<!-- The `react-native-web` recommended style reset: https://necolas.github.io/react-native-web/docs/setup/#root-element -->
|
|
9
|
+
<style id="expo-reset">
|
|
10
|
+
/* These styles make the body full-height */
|
|
20
11
|
html,
|
|
21
|
-
body
|
|
22
|
-
|
|
23
|
-
width: 100%;
|
|
24
|
-
/* To smooth any scrolling behavior */
|
|
25
|
-
-webkit-overflow-scrolling: touch;
|
|
26
|
-
margin: 0px;
|
|
27
|
-
padding: 0px;
|
|
28
|
-
/* Allows content to fill the viewport and go beyond the bottom */
|
|
29
|
-
min-height: 100%;
|
|
12
|
+
body {
|
|
13
|
+
height: 100%;
|
|
30
14
|
}
|
|
15
|
+
/* These styles disable body scrolling if you are using <ScrollView> */
|
|
16
|
+
body {
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
}
|
|
19
|
+
/* These styles make the root element full-height */
|
|
31
20
|
#root {
|
|
32
|
-
flex-shrink: 0;
|
|
33
|
-
flex-basis: auto;
|
|
34
|
-
flex-grow: 1;
|
|
35
21
|
display: flex;
|
|
22
|
+
height: 100%;
|
|
36
23
|
flex: 1;
|
|
37
24
|
}
|
|
38
|
-
|
|
39
|
-
html {
|
|
40
|
-
scroll-behavior: smooth;
|
|
41
|
-
/* Prevent text size change on orientation change https://gist.github.com/tfausak/2222823#file-ios-8-web-app-html-L138 */
|
|
42
|
-
-webkit-text-size-adjust: 100%;
|
|
43
|
-
height: calc(100% + env(safe-area-inset-top));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
body {
|
|
47
|
-
display: flex;
|
|
48
|
-
/* Allows you to scroll below the viewport; default value is visible */
|
|
49
|
-
overflow-y: auto;
|
|
50
|
-
overscroll-behavior-y: none;
|
|
51
|
-
text-rendering: optimizeLegibility;
|
|
52
|
-
-webkit-font-smoothing: antialiased;
|
|
53
|
-
-moz-osx-font-smoothing: grayscale;
|
|
54
|
-
-ms-overflow-style: scrollbar;
|
|
55
|
-
}
|
|
56
|
-
/* Enable for apps that support dark-theme */
|
|
57
|
-
/*@media (prefers-color-scheme: dark) {
|
|
58
|
-
body {
|
|
59
|
-
background-color: black;
|
|
60
|
-
}
|
|
61
|
-
}*/
|
|
62
25
|
</style>
|
|
63
26
|
</head>
|
|
64
27
|
|
|
65
28
|
<body>
|
|
66
|
-
<!--
|
|
67
|
-
A generic no script element with a reload button and a message.
|
|
68
|
-
Feel free to customize this however you'd like.
|
|
69
|
-
-->
|
|
29
|
+
<!-- Use static rendering with Expo Router to support running without JavaScript. -->
|
|
70
30
|
<noscript>
|
|
71
|
-
|
|
72
|
-
action=""
|
|
73
|
-
style="
|
|
74
|
-
background-color: #fff;
|
|
75
|
-
position: fixed;
|
|
76
|
-
top: 0;
|
|
77
|
-
left: 0;
|
|
78
|
-
right: 0;
|
|
79
|
-
bottom: 0;
|
|
80
|
-
z-index: 9999;
|
|
81
|
-
"
|
|
82
|
-
>
|
|
83
|
-
<div
|
|
84
|
-
style="
|
|
85
|
-
font-size: 18px;
|
|
86
|
-
font-family: Helvetica, sans-serif;
|
|
87
|
-
line-height: 24px;
|
|
88
|
-
margin: 10%;
|
|
89
|
-
width: 80%;
|
|
90
|
-
"
|
|
91
|
-
>
|
|
92
|
-
<p>Oh no! It looks like JavaScript is not enabled in your browser.</p>
|
|
93
|
-
<p style="margin: 20px 0;">
|
|
94
|
-
<button
|
|
95
|
-
type="submit"
|
|
96
|
-
style="
|
|
97
|
-
background-color: #4630eb;
|
|
98
|
-
border-radius: 100px;
|
|
99
|
-
border: none;
|
|
100
|
-
box-shadow: none;
|
|
101
|
-
color: #fff;
|
|
102
|
-
cursor: pointer;
|
|
103
|
-
font-weight: bold;
|
|
104
|
-
line-height: 20px;
|
|
105
|
-
padding: 6px 16px;
|
|
106
|
-
"
|
|
107
|
-
>
|
|
108
|
-
Reload
|
|
109
|
-
</button>
|
|
110
|
-
</p>
|
|
111
|
-
</div>
|
|
112
|
-
</form>
|
|
31
|
+
You need to enable JavaScript to run this app.
|
|
113
32
|
</noscript>
|
|
114
33
|
<!-- The root element for your Expo app. -->
|
|
115
34
|
<div id="root"></div>
|