@expo/cli 55.0.6 → 55.0.8
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 -1
- package/build/bin/cli.map +1 -1
- package/build/src/api/user/actions.js +5 -2
- package/build/src/api/user/actions.js.map +1 -1
- package/build/src/api/user/expoSsoLauncher.js +22 -49
- package/build/src/api/user/expoSsoLauncher.js.map +1 -1
- package/build/src/api/user/user.js +6 -5
- package/build/src/api/user/user.js.map +1 -1
- package/build/src/config/configAsync.js +1 -1
- package/build/src/config/configAsync.js.map +1 -1
- package/build/src/customize/customizeAsync.js +1 -1
- package/build/src/customize/customizeAsync.js.map +1 -1
- package/build/src/export/embed/exportEmbedAsync.js +1 -1
- package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
- package/build/src/export/exportApp.js +1 -1
- package/build/src/export/exportApp.js.map +1 -1
- package/build/src/export/exportStaticAsync.js +7 -11
- package/build/src/export/exportStaticAsync.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/install/installAsync.js +1 -1
- package/build/src/install/installAsync.js.map +1 -1
- package/build/src/lint/lintAsync.js +1 -1
- package/build/src/lint/lintAsync.js.map +1 -1
- package/build/src/login/index.js +6 -2
- package/build/src/login/index.js.map +1 -1
- package/build/src/prebuild/prebuildAsync.js +1 -1
- package/build/src/prebuild/prebuildAsync.js.map +1 -1
- package/build/src/run/android/runAndroidAsync.js +1 -1
- package/build/src/run/android/runAndroidAsync.js.map +1 -1
- package/build/src/run/ios/runIosAsync.js +1 -1
- package/build/src/run/ios/runIosAsync.js.map +1 -1
- package/build/src/serve/serveAsync.js +1 -1
- package/build/src/serve/serveAsync.js.map +1 -1
- package/build/src/start/interface/commandsTable.js +89 -69
- package/build/src/start/interface/commandsTable.js.map +1 -1
- package/build/src/start/interface/interactiveActions.js +29 -14
- package/build/src/start/interface/interactiveActions.js.map +1 -1
- package/build/src/start/platforms/ios/devicectl.js +4 -1
- package/build/src/start/platforms/ios/devicectl.js.map +1 -1
- package/build/src/start/server/BundlerDevServer.js +16 -9
- package/build/src/start/server/BundlerDevServer.js.map +1 -1
- package/build/src/start/server/DevServerManager.js +5 -1
- package/build/src/start/server/DevServerManager.js.map +1 -1
- package/build/src/start/server/UrlCreator.js +17 -7
- package/build/src/start/server/UrlCreator.js.map +1 -1
- package/build/src/start/server/getStaticRenderFunctions.js +8 -8
- package/build/src/start/server/getStaticRenderFunctions.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +20 -20
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/MetroTerminalReporter.js +1 -1
- package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
- package/build/src/start/server/metro/createServerComponentsMiddleware.js +1 -1
- package/build/src/start/server/metro/createServerComponentsMiddleware.js.map +1 -1
- package/build/src/start/server/metro/debugging/createDebugMiddleware.js +5 -1
- package/build/src/start/server/metro/debugging/createDebugMiddleware.js.map +1 -1
- package/build/src/start/server/metro/dev-server/createMetroMiddleware.js +18 -18
- package/build/src/start/server/metro/dev-server/createMetroMiddleware.js.map +1 -1
- package/build/src/start/server/metro/instantiateMetro.js +9 -5
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/start/server/metro/log-box/LogBoxSymbolication.js +5 -1
- package/build/src/start/server/metro/log-box/LogBoxSymbolication.js.map +1 -1
- package/build/src/start/server/metro/resolveLoader.js +2 -0
- package/build/src/start/server/metro/resolveLoader.js.map +1 -1
- package/build/src/start/server/metro/runServer-fork.js +6 -5
- package/build/src/start/server/metro/runServer-fork.js.map +1 -1
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js +4 -4
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js.map +1 -1
- package/build/src/utils/downloadExpoGoAsync.js +36 -0
- package/build/src/utils/downloadExpoGoAsync.js.map +1 -1
- package/build/src/utils/editor.js +404 -31
- package/build/src/utils/editor.js.map +1 -1
- package/build/src/utils/env.js +13 -11
- package/build/src/utils/env.js.map +1 -1
- package/build/src/utils/getRunningProcess.js +80 -41
- package/build/src/utils/getRunningProcess.js.map +1 -1
- package/build/src/utils/ip.js +44 -8
- package/build/src/utils/ip.js.map +1 -1
- package/build/src/utils/nodeEnv.js +66 -1
- package/build/src/utils/nodeEnv.js.map +1 -1
- package/build/src/utils/port.js +2 -2
- package/build/src/utils/port.js.map +1 -1
- package/build/src/utils/qr.js +186 -0
- package/build/src/utils/qr.js.map +1 -0
- package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
- package/build/src/utils/telemetry/utils/context.js +1 -1
- package/package.json +16 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/install/installAsync.ts"],"sourcesContent":["import { getConfig, getPackageJson } from '@expo/config';\nimport * as PackageManager from '@expo/package-manager';\nimport chalk from 'chalk';\n\nimport { applyPluginsAsync } from './applyPlugins';\nimport { checkPackagesAsync } from './checkPackages';\nimport { installExpoPackageAsync } from './installExpoPackage';\nimport { Options } from './resolveOptions';\nimport * as Log from '../log';\nimport { checkPackagesCompatibility } from './utils/checkPackagesCompatibility';\nimport { getVersionedPackagesAsync } from '../start/doctor/dependencies/getVersionedPackages';\nimport { env } from '../utils/env';\nimport { CommandError } from '../utils/errors';\nimport { findUpProjectRootOrAssert } from '../utils/findUp';\nimport { learnMore } from '../utils/link';\nimport { setNodeEnv } from '../utils/nodeEnv';\nimport { joinWithCommasAnd } from '../utils/strings';\n\n/**\n * Installs versions of specified packages compatible with the current Expo SDK version, or\n * checks/ fixes dependencies in project if they don't match compatible versions specified in bundledNativeModules or versions endpoints.\n *\n * @param packages list of packages to install, if installing specific packages and not checking/ fixing\n * @param options options, including check or fix\n * @param packageManagerArguments arguments to forward to the package manager invoked while installing\n * @returns Promise<void>\n */\nexport async function installAsync(\n packages: string[],\n options: Options & { projectRoot?: string },\n packageManagerArguments: string[] = []\n) {\n setNodeEnv('development');\n // Locate the project root based on the process current working directory.\n // This enables users to run `npx expo install` from a subdirectory of the project.\n const projectRoot = options?.projectRoot ?? findUpProjectRootOrAssert(process.cwd());\n require('@expo/env').load(projectRoot);\n\n // Resolve the package manager used by the project, or based on the provided arguments.\n const packageManager = PackageManager.createForProject(projectRoot, {\n npm: options.npm,\n yarn: options.yarn,\n bun: options.bun,\n pnpm: options.pnpm,\n silent: options.silent,\n log: Log.log,\n });\n\n const expoVersion = findPackageByName(packages, 'expo');\n const otherPackages = packages.filter((pkg) => pkg !== expoVersion);\n\n // Abort early when installing `expo@<version>` and other packages with `--fix/--check`\n if (packageHasVersion(expoVersion) && otherPackages.length && (options.check || options.fix)) {\n throw new CommandError(\n 'BAD_ARGS',\n `Cannot install other packages with ${expoVersion} and --fix or --check`\n );\n }\n\n // Only check/fix packages if `expo@<version>` is not requested\n if (!packageHasVersion(expoVersion) && (options.check || options.fix)) {\n return await checkPackagesAsync(projectRoot, {\n packages,\n options,\n packageManager,\n packageManagerArguments,\n });\n }\n\n // note(simek): check out the packages compatibility with New Architecture against RND API\n if (!env.EXPO_NO_DEPENDENCY_VALIDATION && !env.EXPO_NO_NEW_ARCH_COMPAT_CHECK) {\n await checkPackagesCompatibility(otherPackages);\n }\n\n // Read the project Expo config without plugins.\n const { exp } = getConfig(projectRoot, {\n // Sometimes users will add a plugin to the config before installing the library,\n // this wouldn't work unless we dangerously disable plugin serialization.\n skipPlugins: true,\n });\n\n // Resolve the versioned packages, then install them.\n return installPackagesAsync(projectRoot, {\n ...options,\n packageManager,\n packages,\n packageManagerArguments,\n sdkVersion: exp.sdkVersion!,\n });\n}\n\n/** Version packages and install in a project. */\nexport async function installPackagesAsync(\n projectRoot: string,\n {\n packages,\n packageManager,\n sdkVersion,\n packageManagerArguments,\n fix,\n check,\n dev,\n }: Options & {\n /**\n * List of packages to version, grouped by the type of dependency.\n * @example ['uuid', 'react-native-reanimated@latest']\n */\n packages: string[];\n /** Package manager to use when installing the versioned packages. */\n packageManager: PackageManager.NodePackageManager;\n /**\n * SDK to version `packages` for.\n * @example '44.0.0'\n */\n sdkVersion: string;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n }\n): Promise<void> {\n // Read the project Expo config without plugins.\n const pkg = getPackageJson(projectRoot);\n\n //assertNotInstallingExcludedPackages(projectRoot, packages, pkg);\n\n const versioning = await getVersionedPackagesAsync(projectRoot, {\n packages,\n // sdkVersion is always defined because we don't skipSDKVersionRequirement in getConfig.\n sdkVersion,\n pkg,\n });\n\n Log.log(\n chalk`\\u203A Installing ${\n versioning.messages.length ? versioning.messages.join(' and ') + ' ' : ''\n }using {bold ${packageManager.name}}`\n );\n\n if (versioning.excludedNativeModules.length) {\n const alreadyExcluded = versioning.excludedNativeModules.filter(\n (module) => module.isExcludedFromValidation\n );\n const specifiedExactVersion = versioning.excludedNativeModules.filter(\n (module) => !module.isExcludedFromValidation\n );\n\n if (alreadyExcluded.length) {\n Log.log(\n chalk`\\u203A Using ${joinWithCommasAnd(\n alreadyExcluded.map(\n ({ bundledNativeVersion, name, specifiedVersion }) =>\n `${specifiedVersion || 'latest'} instead of ${bundledNativeVersion} for ${name}`\n )\n )} because ${\n alreadyExcluded.length > 1 ? 'they are' : 'it is'\n } listed in {bold expo.install.exclude} in package.json. ${learnMore(\n 'https://docs.expo.dev/more/expo-cli/#configuring-dependency-validation'\n )}`\n );\n }\n\n if (specifiedExactVersion.length) {\n Log.log(\n chalk`\\u203A Using ${joinWithCommasAnd(\n specifiedExactVersion.map(\n ({ bundledNativeVersion, name, specifiedVersion }) =>\n `${specifiedVersion} instead of ${bundledNativeVersion} for ${name}`\n )\n )} because ${\n specifiedExactVersion.length > 1 ? 'these versions' : 'this version'\n } was explicitly provided. Packages excluded from dependency validation should be listed in {bold expo.install.exclude} in package.json. ${learnMore(\n 'https://docs.expo.dev/more/expo-cli/#configuring-dependency-validation'\n )}`\n );\n }\n }\n\n // `expo` needs to be installed before installing other packages\n const expoPackage = findPackageByName(packages, 'expo');\n if (expoPackage) {\n const postInstallCommand = packages.filter((pkg) => pkg !== expoPackage);\n\n // Pipe options to the next command\n if (fix) postInstallCommand.push('--fix');\n if (check) postInstallCommand.push('--check');\n\n // Abort after installing `expo`, follow up command is spawn in a new process\n return await installExpoPackageAsync(projectRoot, {\n packageManager,\n packageManagerArguments,\n expoPackageToInstall: versioning.packages.find((pkg) => pkg.startsWith('expo@'))!,\n followUpCommandArgs: postInstallCommand,\n });\n }\n\n if (dev) {\n await packageManager.addDevAsync([...packageManagerArguments, ...versioning.packages]);\n } else {\n await packageManager.addAsync([...packageManagerArguments, ...versioning.packages]);\n }\n\n await applyPluginsAsync(projectRoot, versioning.packages);\n}\n\n/** Find a package, by name, in the requested packages list (`expo` -> `expo`/`expo@<version>`) */\nfunction findPackageByName(packages: string[], name: string) {\n return packages.find((pkg) => pkg === name || pkg.startsWith(`${name}@`));\n}\n\n/** Determine if a specific version is requested for a package */\nfunction packageHasVersion(name = '') {\n return name.indexOf('@', 1) > 0; // Scoped packages may start with `@`\n}\n"],"names":["installAsync","installPackagesAsync","packages","options","packageManagerArguments","setNodeEnv","projectRoot","findUpProjectRootOrAssert","process","cwd","require","load","packageManager","PackageManager","createForProject","npm","yarn","bun","pnpm","silent","log","Log","expoVersion","findPackageByName","otherPackages","filter","pkg","packageHasVersion","length","check","fix","CommandError","checkPackagesAsync","env","EXPO_NO_DEPENDENCY_VALIDATION","EXPO_NO_NEW_ARCH_COMPAT_CHECK","checkPackagesCompatibility","exp","getConfig","skipPlugins","sdkVersion","dev","getPackageJson","versioning","getVersionedPackagesAsync","chalk","messages","join","name","excludedNativeModules","alreadyExcluded","module","isExcludedFromValidation","specifiedExactVersion","joinWithCommasAnd","map","bundledNativeVersion","specifiedVersion","learnMore","expoPackage","postInstallCommand","push","installExpoPackageAsync","expoPackageToInstall","find","startsWith","followUpCommandArgs","addDevAsync","addAsync","applyPluginsAsync","indexOf"],"mappings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MAAMU,eAAewD,QAAQ,CAAC;eAAIhE;eAA4BuC,WAAWzC,QAAQ;SAAC;IACpF;IAEA,MAAMmE,IAAAA,+BAAiB,EAAC/D,aAAaqC,WAAWzC,QAAQ;AAC1D;AAEA,gGAAgG,GAChG,SAASqB,kBAAkBrB,QAAkB,EAAE8C,IAAY;IACzD,OAAO9C,SAAS8D,IAAI,CAAC,CAACtC,MAAQA,QAAQsB,QAAQtB,IAAIuC,UAAU,CAAC,GAAGjB,KAAK,CAAC,CAAC;AACzE;AAEA,+DAA+D,GAC/D,SAASrB,kBAAkBqB,OAAO,EAAE;IAClC,OAAOA,KAAKsB,OAAO,CAAC,KAAK,KAAK,GAAG,qCAAqC;AACxE"}
|
|
1
|
+
{"version":3,"sources":["../../../src/install/installAsync.ts"],"sourcesContent":["import { getConfig, getPackageJson } from '@expo/config';\nimport * as PackageManager from '@expo/package-manager';\nimport chalk from 'chalk';\n\nimport { applyPluginsAsync } from './applyPlugins';\nimport { checkPackagesAsync } from './checkPackages';\nimport { installExpoPackageAsync } from './installExpoPackage';\nimport { Options } from './resolveOptions';\nimport * as Log from '../log';\nimport { checkPackagesCompatibility } from './utils/checkPackagesCompatibility';\nimport { getVersionedPackagesAsync } from '../start/doctor/dependencies/getVersionedPackages';\nimport { env } from '../utils/env';\nimport { CommandError } from '../utils/errors';\nimport { findUpProjectRootOrAssert } from '../utils/findUp';\nimport { learnMore } from '../utils/link';\nimport { setNodeEnv, loadEnvFiles } from '../utils/nodeEnv';\nimport { joinWithCommasAnd } from '../utils/strings';\n\n/**\n * Installs versions of specified packages compatible with the current Expo SDK version, or\n * checks/ fixes dependencies in project if they don't match compatible versions specified in bundledNativeModules or versions endpoints.\n *\n * @param packages list of packages to install, if installing specific packages and not checking/ fixing\n * @param options options, including check or fix\n * @param packageManagerArguments arguments to forward to the package manager invoked while installing\n * @returns Promise<void>\n */\nexport async function installAsync(\n packages: string[],\n options: Options & { projectRoot?: string },\n packageManagerArguments: string[] = []\n) {\n setNodeEnv('development');\n // Locate the project root based on the process current working directory.\n // This enables users to run `npx expo install` from a subdirectory of the project.\n const projectRoot = options?.projectRoot ?? findUpProjectRootOrAssert(process.cwd());\n loadEnvFiles(projectRoot);\n\n // Resolve the package manager used by the project, or based on the provided arguments.\n const packageManager = PackageManager.createForProject(projectRoot, {\n npm: options.npm,\n yarn: options.yarn,\n bun: options.bun,\n pnpm: options.pnpm,\n silent: options.silent,\n log: Log.log,\n });\n\n const expoVersion = findPackageByName(packages, 'expo');\n const otherPackages = packages.filter((pkg) => pkg !== expoVersion);\n\n // Abort early when installing `expo@<version>` and other packages with `--fix/--check`\n if (packageHasVersion(expoVersion) && otherPackages.length && (options.check || options.fix)) {\n throw new CommandError(\n 'BAD_ARGS',\n `Cannot install other packages with ${expoVersion} and --fix or --check`\n );\n }\n\n // Only check/fix packages if `expo@<version>` is not requested\n if (!packageHasVersion(expoVersion) && (options.check || options.fix)) {\n return await checkPackagesAsync(projectRoot, {\n packages,\n options,\n packageManager,\n packageManagerArguments,\n });\n }\n\n // note(simek): check out the packages compatibility with New Architecture against RND API\n if (!env.EXPO_NO_DEPENDENCY_VALIDATION && !env.EXPO_NO_NEW_ARCH_COMPAT_CHECK) {\n await checkPackagesCompatibility(otherPackages);\n }\n\n // Read the project Expo config without plugins.\n const { exp } = getConfig(projectRoot, {\n // Sometimes users will add a plugin to the config before installing the library,\n // this wouldn't work unless we dangerously disable plugin serialization.\n skipPlugins: true,\n });\n\n // Resolve the versioned packages, then install them.\n return installPackagesAsync(projectRoot, {\n ...options,\n packageManager,\n packages,\n packageManagerArguments,\n sdkVersion: exp.sdkVersion!,\n });\n}\n\n/** Version packages and install in a project. */\nexport async function installPackagesAsync(\n projectRoot: string,\n {\n packages,\n packageManager,\n sdkVersion,\n packageManagerArguments,\n fix,\n check,\n dev,\n }: Options & {\n /**\n * List of packages to version, grouped by the type of dependency.\n * @example ['uuid', 'react-native-reanimated@latest']\n */\n packages: string[];\n /** Package manager to use when installing the versioned packages. */\n packageManager: PackageManager.NodePackageManager;\n /**\n * SDK to version `packages` for.\n * @example '44.0.0'\n */\n sdkVersion: string;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n }\n): Promise<void> {\n // Read the project Expo config without plugins.\n const pkg = getPackageJson(projectRoot);\n\n //assertNotInstallingExcludedPackages(projectRoot, packages, pkg);\n\n const versioning = await getVersionedPackagesAsync(projectRoot, {\n packages,\n // sdkVersion is always defined because we don't skipSDKVersionRequirement in getConfig.\n sdkVersion,\n pkg,\n });\n\n Log.log(\n chalk`\\u203A Installing ${\n versioning.messages.length ? versioning.messages.join(' and ') + ' ' : ''\n }using {bold ${packageManager.name}}`\n );\n\n if (versioning.excludedNativeModules.length) {\n const alreadyExcluded = versioning.excludedNativeModules.filter(\n (module) => module.isExcludedFromValidation\n );\n const specifiedExactVersion = versioning.excludedNativeModules.filter(\n (module) => !module.isExcludedFromValidation\n );\n\n if (alreadyExcluded.length) {\n Log.log(\n chalk`\\u203A Using ${joinWithCommasAnd(\n alreadyExcluded.map(\n ({ bundledNativeVersion, name, specifiedVersion }) =>\n `${specifiedVersion || 'latest'} instead of ${bundledNativeVersion} for ${name}`\n )\n )} because ${\n alreadyExcluded.length > 1 ? 'they are' : 'it is'\n } listed in {bold expo.install.exclude} in package.json. ${learnMore(\n 'https://docs.expo.dev/more/expo-cli/#configuring-dependency-validation'\n )}`\n );\n }\n\n if (specifiedExactVersion.length) {\n Log.log(\n chalk`\\u203A Using ${joinWithCommasAnd(\n specifiedExactVersion.map(\n ({ bundledNativeVersion, name, specifiedVersion }) =>\n `${specifiedVersion} instead of ${bundledNativeVersion} for ${name}`\n )\n )} because ${\n specifiedExactVersion.length > 1 ? 'these versions' : 'this version'\n } was explicitly provided. Packages excluded from dependency validation should be listed in {bold expo.install.exclude} in package.json. ${learnMore(\n 'https://docs.expo.dev/more/expo-cli/#configuring-dependency-validation'\n )}`\n );\n }\n }\n\n // `expo` needs to be installed before installing other packages\n const expoPackage = findPackageByName(packages, 'expo');\n if (expoPackage) {\n const postInstallCommand = packages.filter((pkg) => pkg !== expoPackage);\n\n // Pipe options to the next command\n if (fix) postInstallCommand.push('--fix');\n if (check) postInstallCommand.push('--check');\n\n // Abort after installing `expo`, follow up command is spawn in a new process\n return await installExpoPackageAsync(projectRoot, {\n packageManager,\n packageManagerArguments,\n expoPackageToInstall: versioning.packages.find((pkg) => pkg.startsWith('expo@'))!,\n followUpCommandArgs: postInstallCommand,\n });\n }\n\n if (dev) {\n await packageManager.addDevAsync([...packageManagerArguments, ...versioning.packages]);\n } else {\n await packageManager.addAsync([...packageManagerArguments, ...versioning.packages]);\n }\n\n await applyPluginsAsync(projectRoot, versioning.packages);\n}\n\n/** Find a package, by name, in the requested packages list (`expo` -> `expo`/`expo@<version>`) */\nfunction findPackageByName(packages: string[], name: string) {\n return packages.find((pkg) => pkg === name || pkg.startsWith(`${name}@`));\n}\n\n/** Determine if a specific version is requested for a package */\nfunction packageHasVersion(name = '') {\n return name.indexOf('@', 1) > 0; // Scoped packages may start with `@`\n}\n"],"names":["installAsync","installPackagesAsync","packages","options","packageManagerArguments","setNodeEnv","projectRoot","findUpProjectRootOrAssert","process","cwd","loadEnvFiles","packageManager","PackageManager","createForProject","npm","yarn","bun","pnpm","silent","log","Log","expoVersion","findPackageByName","otherPackages","filter","pkg","packageHasVersion","length","check","fix","CommandError","checkPackagesAsync","env","EXPO_NO_DEPENDENCY_VALIDATION","EXPO_NO_NEW_ARCH_COMPAT_CHECK","checkPackagesCompatibility","exp","getConfig","skipPlugins","sdkVersion","dev","getPackageJson","versioning","getVersionedPackagesAsync","chalk","messages","join","name","excludedNativeModules","alreadyExcluded","module","isExcludedFromValidation","specifiedExactVersion","joinWithCommasAnd","map","bundledNativeVersion","specifiedVersion","learnMore","expoPackage","postInstallCommand","push","installExpoPackageAsync","expoPackageToInstall","find","startsWith","followUpCommandArgs","addDevAsync","addAsync","applyPluginsAsync","indexOf"],"mapp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,eAAewD,QAAQ,CAAC;eAAI/D;eAA4BsC,WAAWxC,QAAQ;SAAC;IACpF;IAEA,MAAMkE,IAAAA,+BAAiB,EAAC9D,aAAaoC,WAAWxC,QAAQ;AAC1D;AAEA,gGAAgG,GAChG,SAASoB,kBAAkBpB,QAAkB,EAAE6C,IAAY;IACzD,OAAO7C,SAAS6D,IAAI,CAAC,CAACtC,MAAQA,QAAQsB,QAAQtB,IAAIuC,UAAU,CAAC,GAAGjB,KAAK,CAAC,CAAC;AACzE;AAEA,+DAA+D,GAC/D,SAASrB,kBAAkBqB,OAAO,EAAE;IAClC,OAAOA,KAAKsB,OAAO,CAAC,KAAK,KAAK,GAAG,qCAAqC;AACxE"}
|
|
@@ -97,7 +97,7 @@ const lintAsync = async (inputs, options, eslintArguments = [])=>{
|
|
|
97
97
|
// Locate the project root based on the process current working directory.
|
|
98
98
|
// This enables users to run `npx expo install` from a subdirectory of the project.
|
|
99
99
|
const projectRoot = (options == null ? void 0 : options.projectRoot) ?? (0, _findUp.findUpProjectRootOrAssert)(process.cwd());
|
|
100
|
-
|
|
100
|
+
(0, _nodeEnv.loadEnvFiles)(projectRoot);
|
|
101
101
|
// TODO: Perhaps we should assert that TypeScript is required.
|
|
102
102
|
const prerequisite = new _ESlintPrerequisite.ESLintProjectPrerequisite(projectRoot);
|
|
103
103
|
if (!await prerequisite.assertAsync()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lint/lintAsync.ts"],"sourcesContent":["import { createForProject } from '@expo/package-manager';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport semver from 'semver';\n\nimport { ESLintProjectPrerequisite } from './ESlintPrerequisite';\nimport type { Options } from './resolveOptions';\nimport { CommandError } from '../utils/errors';\nimport { findUpProjectRootOrAssert } from '../utils/findUp';\nimport { setNodeEnv } from '../utils/nodeEnv';\n\nconst debug = require('debug')('expo:lint');\n\nconst DEFAULT_INPUTS = ['src', 'app', 'components'];\n\nexport const lintAsync = async (\n inputs: string[],\n options: Options & { projectRoot?: string },\n eslintArguments: string[] = []\n) => {\n setNodeEnv('development');\n // Locate the project root based on the process current working directory.\n // This enables users to run `npx expo install` from a subdirectory of the project.\n const projectRoot = options?.projectRoot ?? findUpProjectRootOrAssert(process.cwd());\n
|
|
1
|
+
{"version":3,"sources":["../../../src/lint/lintAsync.ts"],"sourcesContent":["import { createForProject } from '@expo/package-manager';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport semver from 'semver';\n\nimport { ESLintProjectPrerequisite } from './ESlintPrerequisite';\nimport type { Options } from './resolveOptions';\nimport { CommandError } from '../utils/errors';\nimport { findUpProjectRootOrAssert } from '../utils/findUp';\nimport { setNodeEnv, loadEnvFiles } from '../utils/nodeEnv';\n\nconst debug = require('debug')('expo:lint');\n\nconst DEFAULT_INPUTS = ['src', 'app', 'components'];\n\nexport const lintAsync = async (\n inputs: string[],\n options: Options & { projectRoot?: string },\n eslintArguments: string[] = []\n) => {\n setNodeEnv('development');\n // Locate the project root based on the process current working directory.\n // This enables users to run `npx expo install` from a subdirectory of the project.\n const projectRoot = options?.projectRoot ?? findUpProjectRootOrAssert(process.cwd());\n loadEnvFiles(projectRoot);\n\n // TODO: Perhaps we should assert that TypeScript is required.\n\n const prerequisite = new ESLintProjectPrerequisite(projectRoot);\n if (!(await prerequisite.assertAsync())) {\n await prerequisite.bootstrapAsync();\n }\n\n // TODO(@kitten): The direct require is fine, since we assume `expo > @expo/cli` does not depend on eslint\n // However, it'd be safer to replace this with resolve-from, or another way of requiring via the project root\n const { loadESLint } = require('eslint');\n\n const mod = await import('eslint');\n\n let ESLint: typeof import('eslint').ESLint;\n // loadESLint is >= 8.57.0 (https://github.com/eslint/eslint/releases/tag/v8.57.0) https://github.com/eslint/eslint/pull/18098\n if ('loadESLint' in mod) {\n ESLint = await loadESLint({ cwd: options.projectRoot });\n } else {\n throw new CommandError(\n 'npx expo lint requires ESLint version 8.57.0 or greater. Upgrade eslint or use npx eslint directly.'\n );\n }\n\n const version = ESLint?.version;\n\n if (!version || semver.lt(version, '8.57.0')) {\n throw new CommandError(\n 'npx expo lint requires ESLint version 8.57.0 or greater. Upgrade eslint or use npx eslint directly.'\n );\n }\n\n if (!inputs.length) {\n DEFAULT_INPUTS.map((input) => {\n const abs = path.join(projectRoot, input);\n if (fs.existsSync(abs)) {\n inputs.push(abs);\n }\n });\n }\n\n const eslintArgs: string[] = [];\n inputs.forEach((input) => {\n eslintArgs.push(input);\n });\n options.ext.forEach((ext) => {\n eslintArgs.push('--ext', ext);\n });\n\n eslintArgs.push(`--fix=${options.fix}`);\n eslintArgs.push(`--cache=${options.cache}`);\n\n if (options.config) {\n eslintArgs.push(`--config`, options.config);\n }\n if (!options.ignore) {\n eslintArgs.push('--no-ignore');\n }\n options.ignorePattern.forEach((pattern) => {\n eslintArgs.push(`--ignore-pattern=${pattern}`);\n });\n\n eslintArgs.push(...options.fixType.map((type) => `--fix-type=${type}`));\n\n if (options.quiet) {\n eslintArgs.push('--quiet');\n }\n\n if (options.maxWarnings != null && options.maxWarnings >= 0) {\n eslintArgs.push(`--max-warnings=${options.maxWarnings.toString()}`);\n }\n\n const cacheDir = path.join(projectRoot, '.expo', 'cache', 'eslint/');\n // Add other defaults\n eslintArgs.push(`--cache-location=${cacheDir}`);\n\n // Add passthrough arguments\n eslintArguments.forEach((arg) => {\n eslintArgs.push(arg);\n });\n\n debug('Running ESLint with args: %O', eslintArgs);\n\n const manager = createForProject(projectRoot, { silent: true });\n\n try {\n // TODO: Custom logger\n // - Use relative paths\n // - When react-hooks/exhaustive-deps is hit, notify about enabling React Compiler.\n // - Green check when no issues are found.\n await manager.runBinAsync(['eslint', ...eslintArgs], {\n stdio: 'inherit',\n });\n } catch (error: any) {\n process.exit(error.status);\n }\n};\n"],"names":["lintAsync","debug","require","DEFAULT_INPUTS","inputs","options","eslintArguments","setNodeEnv","projectRoot","findUpProjectRootOrAssert","process","cwd","loadEnvFiles","prerequisite","ESLintProjectPrerequisite","assertAsync","bootstrapAsync","loadESLint","mod","ESLint","CommandError","version","semver","lt","length","map","input","abs","path","join","fs","existsSync","push","eslintArgs","forEach","ext","fix","cache","config","ignore","ignorePattern","pattern","fixType","type","quiet","maxWarnings","toString","cacheDir","arg","manager","createForProject","silent","runBinAsync","stdio","error","exit","status"],"mappings":";;;;+BAeaA;;;eAAAA;;;;yBAfoB;;;;;;;gEAClB;;;;;;;gEACE;;;;;;;gEACE;;;;;;oCAEuB;wBAEb;wBACa;yBACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzC,MAAMC,QAAQC,QAAQ,SAAS;AAE/B,MAAMC,iBAAiB;IAAC;IAAO;IAAO;CAAa;AAE5C,MAAMH,YAAY,OACvBI,QACAC,SACAC,kBAA4B,EAAE;IAE9BC,IAAAA,mBAAU,EAAC;IACX,0EAA0E;IAC1E,mFAAmF;IACnF,MAAMC,cAAcH,CAAAA,2BAAAA,QAASG,WAAW,KAAIC,IAAAA,iCAAyB,EAACC,QAAQC,GAAG;IACjFC,IAAAA,qBAAY,EAACJ;IAEb,8DAA8D;IAE9D,MAAMK,eAAe,IAAIC,6CAAyB,CAACN;IACnD,IAAI,CAAE,MAAMK,aAAaE,WAAW,IAAK;QACvC,MAAMF,aAAaG,cAAc;IACnC;IAEA,0GAA0G;IAC1G,6GAA6G;IAC7G,MAAM,EAAEC,UAAU,EAAE,GAAGf,QAAQ;IAE/B,MAAMgB,MAAM,MAAM,mEAAA,QAAO;IAEzB,IAAIC;IACJ,8HAA8H;IAC9H,IAAI,gBAAgBD,KAAK;QACvBC,SAAS,MAAMF,WAAW;YAAEN,KAAKN,QAAQG,WAAW;QAAC;IACvD,OAAO;QACL,MAAM,IAAIY,oBAAY,CACpB;IAEJ;IAEA,MAAMC,UAAUF,0BAAAA,OAAQE,OAAO;IAE/B,IAAI,CAACA,WAAWC,iBAAM,CAACC,EAAE,CAACF,SAAS,WAAW;QAC5C,MAAM,IAAID,oBAAY,CACpB;IAEJ;IA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ByB,WAAWD,IAAI,CAAC,CAAC,iBAAiB,EAAEe,UAAU;IAE9C,4BAA4B;IAC5BzC,gBAAgB4B,OAAO,CAAC,CAACc;QACvBf,WAAWD,IAAI,CAACgB;IAClB;IAEA/C,MAAM,gCAAgCgC;IAEtC,MAAMgB,UAAUC,IAAAA,kCAAgB,EAAC1C,aAAa;QAAE2C,QAAQ;IAAK;IAE7D,IAAI;QACF,sBAAsB;QACtB,uBAAuB;QACvB,mFAAmF;QACnF,0CAA0C;QAC1C,MAAMF,QAAQG,WAAW,CAAC;YAAC;eAAanB;SAAW,EAAE;YACnDoB,OAAO;QACT;IACF,EAAE,OAAOC,OAAY;QACnB5C,QAAQ6C,IAAI,CAACD,MAAME,MAAM;IAC3B;AACF"}
|
package/build/src/login/index.js
CHANGED
|
@@ -60,11 +60,13 @@ const expoLogin = async (argv)=>{
|
|
|
60
60
|
'--password': String,
|
|
61
61
|
'--otp': String,
|
|
62
62
|
'--sso': Boolean,
|
|
63
|
+
'--browser': Boolean,
|
|
63
64
|
// Aliases
|
|
64
65
|
'-h': '--help',
|
|
65
66
|
'-u': '--username',
|
|
66
67
|
'-p': '--password',
|
|
67
|
-
'-s': '--sso'
|
|
68
|
+
'-s': '--sso',
|
|
69
|
+
'-b': '--browser'
|
|
68
70
|
}, argv);
|
|
69
71
|
if (args['--help']) {
|
|
70
72
|
(0, _args.printHelp)(`Log in to an Expo account`, `npx expo login`, [
|
|
@@ -72,6 +74,7 @@ const expoLogin = async (argv)=>{
|
|
|
72
74
|
`-p, --password <string> Password`,
|
|
73
75
|
`--otp <string> One-time password from your 2FA device`,
|
|
74
76
|
`-s, --sso Log in with SSO`,
|
|
77
|
+
`-b, --browser Log in with a browser`,
|
|
75
78
|
`-h, --help Usage info`
|
|
76
79
|
].join('\n'));
|
|
77
80
|
}
|
|
@@ -81,7 +84,8 @@ const expoLogin = async (argv)=>{
|
|
|
81
84
|
username: args['--username'],
|
|
82
85
|
password: args['--password'],
|
|
83
86
|
otp: args['--otp'],
|
|
84
|
-
sso: !!args['--sso']
|
|
87
|
+
sso: !!args['--sso'],
|
|
88
|
+
browser: !!args['--browser']
|
|
85
89
|
}).catch(_errors.logCmdError);
|
|
86
90
|
};
|
|
87
91
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/login/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from '../../bin/cli';\nimport { assertArgs, printHelp } from '../utils/args';\nimport { logCmdError } from '../utils/errors';\n\nexport const expoLogin: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n '--username': String,\n '--password': String,\n '--otp': String,\n '--sso': Boolean,\n // Aliases\n '-h': '--help',\n '-u': '--username',\n '-p': '--password',\n '-s': '--sso',\n },\n argv\n );\n\n if (args['--help']) {\n printHelp(\n `Log in to an Expo account`,\n `npx expo login`,\n [\n `-u, --username <string> Username`,\n `-p, --password <string> Password`,\n `--otp <string> One-time password from your 2FA device`,\n `-s, --sso Log in with SSO`,\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n const { showLoginPromptAsync } = await import('../api/user/actions.js');\n return showLoginPromptAsync({\n // Parsed options\n username: args['--username'],\n password: args['--password'],\n otp: args['--otp'],\n sso: !!args['--sso'],\n }).catch(logCmdError);\n};\n"],"names":["expoLogin","argv","args","assertArgs","Boolean","String","printHelp","join","showLoginPromptAsync","username","password","otp","sso","catch","logCmdError"],"mappings":";;;;;+BAKaA;;;eAAAA;;;sBAHyB;wBACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErB,MAAMA,YAAqB,OAAOC;IACvC,MAAMC,OAAOC,IAAAA,gBAAU,EACrB;QACE,QAAQ;QACR,UAAUC;QACV,cAAcC;QACd,cAAcA;QACd,SAASA;QACT,SAASD;QACT,UAAU;QACV,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;IACR,GACAH;IAGF,IAAIC,IAAI,CAAC,SAAS,EAAE;QAClBI,IAAAA,eAAS,EACP,CAAC,yBAAyB,CAAC,EAC3B,CAAC,cAAc,CAAC,EAChB;YACE,CAAC,iCAAiC,CAAC;YACnC,CAAC,iCAAiC,CAAC;YACnC,CAAC,+DAA+D,CAAC;YACjE,CAAC,wCAAwC,CAAC;YAC1C,CAAC,mCAAmC,CAAC;SACtC,CAACC,IAAI,CAAC;IAEX;IAEA,MAAM,EAAEC,oBAAoB,EAAE,GAAG,MAAM,mEAAA,QAAO;IAC9C,OAAOA,qBAAqB;QAC1B,iBAAiB;QACjBC,UAAUP,IAAI,CAAC,aAAa;QAC5BQ,UAAUR,IAAI,CAAC,aAAa;QAC5BS,KAAKT,IAAI,CAAC,QAAQ;QAClBU,KAAK,CAAC,CAACV,IAAI,CAAC,QAAQ;
|
|
1
|
+
{"version":3,"sources":["../../../src/login/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from '../../bin/cli';\nimport { assertArgs, printHelp } from '../utils/args';\nimport { logCmdError } from '../utils/errors';\n\nexport const expoLogin: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n '--username': String,\n '--password': String,\n '--otp': String,\n '--sso': Boolean,\n '--browser': Boolean,\n // Aliases\n '-h': '--help',\n '-u': '--username',\n '-p': '--password',\n '-s': '--sso',\n '-b': '--browser',\n },\n argv\n );\n\n if (args['--help']) {\n printHelp(\n `Log in to an Expo account`,\n `npx expo login`,\n [\n `-u, --username <string> Username`,\n `-p, --password <string> Password`,\n `--otp <string> One-time password from your 2FA device`,\n `-s, --sso Log in with SSO`,\n `-b, --browser Log in with a browser`,\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n const { showLoginPromptAsync } = await import('../api/user/actions.js');\n return showLoginPromptAsync({\n // Parsed options\n username: args['--username'],\n password: args['--password'],\n otp: args['--otp'],\n sso: !!args['--sso'],\n browser: !!args['--browser'],\n }).catch(logCmdError);\n};\n"],"names":["expoLogin","argv","args","assertArgs","Boolean","String","printHelp","join","showLoginPromptAsync","username","password","otp","sso","browser","catch","logCmdError"],"mappings":";;;;;+BAKaA;;;eAAAA;;;sBAHyB;wBACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErB,MAAMA,YAAqB,OAAOC;IACvC,MAAMC,OAAOC,IAAAA,gBAAU,EACrB;QACE,QAAQ;QACR,UAAUC;QACV,cAAcC;QACd,cAAcA;QACd,SAASA;QACT,SAASD;QACT,aAAaA;QACb,UAAU;QACV,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;IACR,GACAH;IAGF,IAAIC,IAAI,CAAC,SAAS,EAAE;QAClBI,IAAAA,eAAS,EACP,CAAC,yBAAyB,CAAC,EAC3B,CAAC,cAAc,CAAC,EAChB;YACE,CAAC,iCAAiC,CAAC;YACnC,CAAC,iCAAiC,CAAC;YACnC,CAAC,+DAA+D,CAAC;YACjE,CAAC,wCAAwC,CAAC;YAC1C,CAAC,8CAA8C,CAAC;YAChD,CAAC,mCAAmC,CAAC;SACtC,CAACC,IAAI,CAAC;IAEX;IAEA,MAAM,EAAEC,oBAAoB,EAAE,GAAG,MAAM,mEAAA,QAAO;IAC9C,OAAOA,qBAAqB;QAC1B,iBAAiB;QACjBC,UAAUP,IAAI,CAAC,aAAa;QAC5BQ,UAAUR,IAAI,CAAC,aAAa;QAC5BS,KAAKT,IAAI,CAAC,QAAQ;QAClBU,KAAK,CAAC,CAACV,IAAI,CAAC,QAAQ;QACpBW,SAAS,CAAC,CAACX,IAAI,CAAC,YAAY;IAC9B,GAAGY,KAAK,CAACC,mBAAW;AACtB"}
|
|
@@ -84,7 +84,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
84
84
|
const debug = require('debug')('expo:prebuild');
|
|
85
85
|
async function prebuildAsync(projectRoot, options) {
|
|
86
86
|
(0, _nodeEnv.setNodeEnv)('development');
|
|
87
|
-
|
|
87
|
+
(0, _nodeEnv.loadEnvFiles)(projectRoot);
|
|
88
88
|
const { platforms } = (0, _config().getConfig)(projectRoot).exp;
|
|
89
89
|
if (platforms == null ? void 0 : platforms.length) {
|
|
90
90
|
// Filter out platforms that aren't in the app.json.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/prebuild/prebuildAsync.ts"],"sourcesContent":["import { ExpoConfig, getConfig } from '@expo/config';\nimport { ModPlatform } from '@expo/config-plugins';\nimport chalk from 'chalk';\n\nimport { clearNativeFolder, promptToClearMalformedNativeProjectsAsync } from './clearNativeFolder';\nimport { configureProjectAsync } from './configureProjectAsync';\nimport { ensureConfigAsync } from './ensureConfigAsync';\nimport { assertPlatforms, ensureValidPlatforms, resolveTemplateOption } from './resolveOptions';\nimport { updateFromTemplateAsync } from './updateFromTemplate';\nimport { installAsync } from '../install/installAsync';\nimport { Log } from '../log';\nimport { env } from '../utils/env';\nimport { setNodeEnv } from '../utils/nodeEnv';\nimport { clearNodeModulesAsync } from '../utils/nodeModules';\nimport { logNewSection } from '../utils/ora';\nimport { profile } from '../utils/profile';\nimport { confirmAsync } from '../utils/prompts';\n\nconst debug = require('debug')('expo:prebuild') as typeof console.log;\n\nexport type PrebuildResults = {\n /** Expo config. */\n exp: ExpoConfig;\n /** Indicates if the process created new files. */\n hasNewProjectFiles: boolean;\n /** The platforms that were prebuilt. */\n platforms: ModPlatform[];\n /** Indicates if pod install was run. */\n podInstall: boolean;\n /** Indicates if node modules were installed. */\n nodeInstall: boolean;\n};\n\n/**\n * Entry point into the prebuild process, delegates to other helpers to perform various steps.\n *\n * 0. Attempt to clean the project folders.\n * 1. Create native projects (ios, android).\n * 2. Install node modules.\n * 3. Apply config to native projects.\n * 4. Install CocoaPods.\n */\nexport async function prebuildAsync(\n projectRoot: string,\n options: {\n /** Should install node modules and cocoapods. */\n install?: boolean;\n /** List of platforms to prebuild. */\n platforms: ModPlatform[];\n /** Should delete the native folders before attempting to prebuild. */\n clean?: boolean;\n /** URL or file path to the prebuild template. */\n template?: string;\n /** Name of the node package manager to install with. */\n packageManager?: {\n npm?: boolean;\n yarn?: boolean;\n pnpm?: boolean;\n bun?: boolean;\n };\n /** List of node modules to skip updating. */\n skipDependencyUpdate?: string[];\n }\n): Promise<PrebuildResults | null> {\n setNodeEnv('development');\n require('@expo/env').load(projectRoot);\n\n const { platforms } = getConfig(projectRoot).exp;\n if (platforms?.length) {\n // Filter out platforms that aren't in the app.json.\n const finalPlatforms = options.platforms.filter((platform) => platforms.includes(platform));\n if (finalPlatforms.length > 0) {\n options.platforms = finalPlatforms;\n } else {\n const requestedPlatforms = options.platforms.join(', ');\n Log.warn(\n chalk`⚠️ Requested prebuild for \"${requestedPlatforms}\", but only \"${platforms.join(', ')}\" is present in app config (\"expo.platforms\" entry). Continuing with \"${requestedPlatforms}\".`\n );\n }\n }\n if (options.clean) {\n const { maybeBailOnGitStatusAsync } = await import('../utils/git.js');\n // Clean the project folders...\n if (await maybeBailOnGitStatusAsync()) {\n return null;\n }\n // Clear the native folders before syncing\n await clearNativeFolder(projectRoot, options.platforms);\n } else {\n // Check if the existing project folders are malformed.\n await promptToClearMalformedNativeProjectsAsync(projectRoot, options.platforms);\n }\n\n // Warn if the project is attempting to prebuild an unsupported platform (iOS on Windows).\n options.platforms = ensureValidPlatforms(options.platforms);\n // Assert if no platforms are left over after filtering.\n assertPlatforms(options.platforms);\n\n // Get the Expo config, create it if missing.\n const { exp, pkg } = await ensureConfigAsync(projectRoot, { platforms: options.platforms });\n\n // Create native projects from template.\n const { hasNewProjectFiles, needsPodInstall, templateChecksum, changedDependencies } =\n await updateFromTemplateAsync(projectRoot, {\n exp,\n pkg,\n template: options.template != null ? resolveTemplateOption(options.template) : undefined,\n platforms: options.platforms,\n skipDependencyUpdate: options.skipDependencyUpdate,\n });\n\n // Install node modules\n if (options.install) {\n if (changedDependencies.length) {\n if (options.packageManager?.npm) {\n await clearNodeModulesAsync(projectRoot);\n }\n\n Log.log(chalk.gray(chalk`Dependencies in the {bold package.json} changed:`));\n Log.log(chalk.gray(' ' + changedDependencies.join(', ')));\n\n // Installing dependencies is a legacy feature from the unversioned\n // command. We know opt to not change dependencies unless a template\n // indicates a new dependency is required, or if the core dependencies are wrong.\n if (\n await confirmAsync({\n message: `Install the updated dependencies?`,\n initial: true,\n })\n ) {\n await installAsync([], {\n npm: !!options.packageManager?.npm,\n yarn: !!options.packageManager?.yarn,\n pnpm: !!options.packageManager?.pnpm,\n bun: !!options.packageManager?.bun,\n silent: !(env.EXPO_DEBUG || env.CI),\n });\n }\n }\n }\n\n // Apply Expo config to native projects. Prevent log-spew from ora when running in debug mode.\n const configSyncingStep: { succeed(text?: string): unknown; fail(text?: string): unknown } =\n env.EXPO_DEBUG\n ? {\n succeed(text) {\n Log.log(text!);\n },\n fail(text) {\n Log.error(text!);\n },\n }\n : logNewSection('Running prebuild');\n try {\n await profile(configureProjectAsync)(projectRoot, {\n platforms: options.platforms,\n exp,\n templateChecksum,\n });\n configSyncingStep.succeed('Finished prebuild');\n } catch (error) {\n configSyncingStep.fail('Prebuild failed');\n throw error;\n }\n\n // Install CocoaPods\n let podsInstalled: boolean = false;\n // err towards running pod install less because it's slow and users can easily run npx pod-install afterwards.\n if (options.platforms.includes('ios') && options.install && needsPodInstall) {\n const { installCocoaPodsAsync } = await import('../utils/cocoapods.js');\n\n podsInstalled = await installCocoaPodsAsync(projectRoot);\n } else {\n debug('Skipped pod install');\n }\n\n return {\n nodeInstall: !!options.install,\n podInstall: !podsInstalled,\n platforms: options.platforms,\n hasNewProjectFiles,\n exp,\n };\n}\n"],"names":["prebuildAsync","debug","require","projectRoot","options","setNodeEnv","load","platforms","getConfig","exp","length","finalPlatforms","filter","platform","includes","requestedPlatforms","join","Log","warn","chalk","clean","maybeBailOnGitStatusAsync","clearNativeFolder","promptToClearMalformedNativeProjectsAsync","ensureValidPlatforms","assertPlatforms","pkg","ensureConfigAsync","hasNewProjectFiles","needsPodInstall","templateChecksum","changedDependencies","updateFromTemplateAsync","template","resolveTemplateOption","undefined","skipDependencyUpdate","install","packageManager","npm","clearNodeModulesAsync","log","gray","confirmAsync","message","initial","installAsync","yarn","pnpm","bun","silent","env","EXPO_DEBUG","CI","configSyncingStep","succeed","text","fail","error","logNewSection","profile","configureProjectAsync","podsInstalled","installCocoaPodsAsync","nodeInstall","podInstall"],"mappings":";;;;+BA0CsBA;;;eAAAA;;;;yBA1CgB;;;;;;;gEAEpB;;;;;;mCAE2D;uCACvC;mCACJ;gCAC2C;oCACrC;8BACX;qBACT;qBACA;yBACO;6BACW;qBACR;yBACN;yBACK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAwBxB,eAAeF,cACpBG,WAAmB,EACnBC,OAkBC;IAEDC,IAAAA,mBAAU,EAAC;IACXH,QAAQ,aAAaI,IAAI,CAACH;IAE1B,MAAM,EAAEI,SAAS,EAAE,GAAGC,IAAAA,mBAAS,EAACL,aAAaM,GAAG;IAChD,IAAIF,6BAAAA,UAAWG,MAAM,EAAE;QACrB,oDAAoD;QACpD,MAAMC,iBAAiBP,QAAQG,SAAS,CAACK,MAAM,CAAC,CAACC,WAAaN,UAAUO,QAAQ,CAACD;QACjF,IAAIF,eAAeD,MAAM,GAAG,GAAG;YAC7BN,QAAQG,SAAS,GAAGI;QACtB,OAAO;YACL,MAAMI,qBAAqBX,QAAQG,SAAS,CAACS,IAAI,CAAC;YAClDC,QAAG,CAACC,IAAI,CACNC,IAAAA,gBAAK,CAAA,CAAC,4BAA4B,EAAEJ,mBAAmB,aAAa,EAAER,UAAUS,IAAI,CAAC,MAAM,sEAAsE,EAAED,mBAAmB,EAAE,CAAC;QAE7L;IACF;IACA,IAAIX,QAAQgB,KAAK,EAAE;QACjB,MAAM,EAAEC,yBAAyB,EAAE,GAAG,MAAM,mEAAA,QAAO;QACnD,+BAA+B;QAC/B,IAAI,MAAMA,6BAA6B;YACrC,OAAO;QACT;QACA,0CAA0C;QAC1C,MAAMC,IAAAA,oCAAiB,EAACnB,aAAaC,QAAQ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AAQiC,OAAO;QAC9B4B,YAAY,CAACH;QACbvD,WAAWH,QAAQG,SAAS;QAC5BqB;QACAnB;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../src/prebuild/prebuildAsync.ts"],"sourcesContent":["import { ExpoConfig, getConfig } from '@expo/config';\nimport { ModPlatform } from '@expo/config-plugins';\nimport chalk from 'chalk';\n\nimport { clearNativeFolder, promptToClearMalformedNativeProjectsAsync } from './clearNativeFolder';\nimport { configureProjectAsync } from './configureProjectAsync';\nimport { ensureConfigAsync } from './ensureConfigAsync';\nimport { assertPlatforms, ensureValidPlatforms, resolveTemplateOption } from './resolveOptions';\nimport { updateFromTemplateAsync } from './updateFromTemplate';\nimport { installAsync } from '../install/installAsync';\nimport { Log } from '../log';\nimport { env } from '../utils/env';\nimport { setNodeEnv, loadEnvFiles } from '../utils/nodeEnv';\nimport { clearNodeModulesAsync } from '../utils/nodeModules';\nimport { logNewSection } from '../utils/ora';\nimport { profile } from '../utils/profile';\nimport { confirmAsync } from '../utils/prompts';\n\nconst debug = require('debug')('expo:prebuild') as typeof console.log;\n\nexport type PrebuildResults = {\n /** Expo config. */\n exp: ExpoConfig;\n /** Indicates if the process created new files. */\n hasNewProjectFiles: boolean;\n /** The platforms that were prebuilt. */\n platforms: ModPlatform[];\n /** Indicates if pod install was run. */\n podInstall: boolean;\n /** Indicates if node modules were installed. */\n nodeInstall: boolean;\n};\n\n/**\n * Entry point into the prebuild process, delegates to other helpers to perform various steps.\n *\n * 0. Attempt to clean the project folders.\n * 1. Create native projects (ios, android).\n * 2. Install node modules.\n * 3. Apply config to native projects.\n * 4. Install CocoaPods.\n */\nexport async function prebuildAsync(\n projectRoot: string,\n options: {\n /** Should install node modules and cocoapods. */\n install?: boolean;\n /** List of platforms to prebuild. */\n platforms: ModPlatform[];\n /** Should delete the native folders before attempting to prebuild. */\n clean?: boolean;\n /** URL or file path to the prebuild template. */\n template?: string;\n /** Name of the node package manager to install with. */\n packageManager?: {\n npm?: boolean;\n yarn?: boolean;\n pnpm?: boolean;\n bun?: boolean;\n };\n /** List of node modules to skip updating. */\n skipDependencyUpdate?: string[];\n }\n): Promise<PrebuildResults | null> {\n setNodeEnv('development');\n loadEnvFiles(projectRoot);\n\n const { platforms } = getConfig(projectRoot).exp;\n if (platforms?.length) {\n // Filter out platforms that aren't in the app.json.\n const finalPlatforms = options.platforms.filter((platform) => platforms.includes(platform));\n if (finalPlatforms.length > 0) {\n options.platforms = finalPlatforms;\n } else {\n const requestedPlatforms = options.platforms.join(', ');\n Log.warn(\n chalk`⚠️ Requested prebuild for \"${requestedPlatforms}\", but only \"${platforms.join(', ')}\" is present in app config (\"expo.platforms\" entry). Continuing with \"${requestedPlatforms}\".`\n );\n }\n }\n if (options.clean) {\n const { maybeBailOnGitStatusAsync } = await import('../utils/git.js');\n // Clean the project folders...\n if (await maybeBailOnGitStatusAsync()) {\n return null;\n }\n // Clear the native folders before syncing\n await clearNativeFolder(projectRoot, options.platforms);\n } else {\n // Check if the existing project folders are malformed.\n await promptToClearMalformedNativeProjectsAsync(projectRoot, options.platforms);\n }\n\n // Warn if the project is attempting to prebuild an unsupported platform (iOS on Windows).\n options.platforms = ensureValidPlatforms(options.platforms);\n // Assert if no platforms are left over after filtering.\n assertPlatforms(options.platforms);\n\n // Get the Expo config, create it if missing.\n const { exp, pkg } = await ensureConfigAsync(projectRoot, { platforms: options.platforms });\n\n // Create native projects from template.\n const { hasNewProjectFiles, needsPodInstall, templateChecksum, changedDependencies } =\n await updateFromTemplateAsync(projectRoot, {\n exp,\n pkg,\n template: options.template != null ? resolveTemplateOption(options.template) : undefined,\n platforms: options.platforms,\n skipDependencyUpdate: options.skipDependencyUpdate,\n });\n\n // Install node modules\n if (options.install) {\n if (changedDependencies.length) {\n if (options.packageManager?.npm) {\n await clearNodeModulesAsync(projectRoot);\n }\n\n Log.log(chalk.gray(chalk`Dependencies in the {bold package.json} changed:`));\n Log.log(chalk.gray(' ' + changedDependencies.join(', ')));\n\n // Installing dependencies is a legacy feature from the unversioned\n // command. We know opt to not change dependencies unless a template\n // indicates a new dependency is required, or if the core dependencies are wrong.\n if (\n await confirmAsync({\n message: `Install the updated dependencies?`,\n initial: true,\n })\n ) {\n await installAsync([], {\n npm: !!options.packageManager?.npm,\n yarn: !!options.packageManager?.yarn,\n pnpm: !!options.packageManager?.pnpm,\n bun: !!options.packageManager?.bun,\n silent: !(env.EXPO_DEBUG || env.CI),\n });\n }\n }\n }\n\n // Apply Expo config to native projects. Prevent log-spew from ora when running in debug mode.\n const configSyncingStep: { succeed(text?: string): unknown; fail(text?: string): unknown } =\n env.EXPO_DEBUG\n ? {\n succeed(text) {\n Log.log(text!);\n },\n fail(text) {\n Log.error(text!);\n },\n }\n : logNewSection('Running prebuild');\n try {\n await profile(configureProjectAsync)(projectRoot, {\n platforms: options.platforms,\n exp,\n templateChecksum,\n });\n configSyncingStep.succeed('Finished prebuild');\n } catch (error) {\n configSyncingStep.fail('Prebuild failed');\n throw error;\n }\n\n // Install CocoaPods\n let podsInstalled: boolean = false;\n // err towards running pod install less because it's slow and users can easily run npx pod-install afterwards.\n if (options.platforms.includes('ios') && options.install && needsPodInstall) {\n const { installCocoaPodsAsync } = await import('../utils/cocoapods.js');\n\n podsInstalled = await installCocoaPodsAsync(projectRoot);\n } else {\n debug('Skipped pod install');\n }\n\n return {\n nodeInstall: !!options.install,\n podInstall: !podsInstalled,\n platforms: options.platforms,\n hasNewProjectFiles,\n exp,\n };\n}\n"],"names":["prebuildAsync","debug","require","projectRoot","options","setNodeEnv","loadEnvFiles","platforms","getConfig","exp","length","finalPlatforms","filter","platform","includes","requestedPlatforms","join","Log","warn","chalk","clean","maybeBailOnGitStatusAsync","clearNativeFolder","promptToClearMalformedNativeProjectsAsync","ensureValidPlatforms","assertPlatforms","pkg","ensureConfigAsync","hasNewProjectFiles","needsPodInstall","templateChecksum","changedDependencies","updateFromTemplateAsync","template","resolveTemplateOption","undefined","skipDependencyUpdate","install","packageManager","npm","clearNodeModulesAsync","log","gray","confirmAsync","message","initial","installAsync","yarn","pnpm","bun","silent","env","EXPO_DEBUG","CI","configSyncingStep","succeed","text","fail","error","logNewSection","profile","configureProjectAsync","podsInstalled","installCocoaPodsAsync","nodeInstall","podInstall"],"mappings":";;;;+BA0CsBA;;;eAAAA;;;;yBA1CgB;;;;;;;gEAEpB;;;;;;mCAE2D;uCACvC;mCACJ;gCAC2C;oCACrC;8BACX;qBACT;qBACA;yBACqB;6BACH;qBACR;yBACN;yBACK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAwBxB,eAAeF,cACpBG,WAAmB,EACnBC,OAkBC;IAEDC,IAAAA,mBAAU,EAAC;IACXC,IAAAA,qBAAY,EAACH;IAEb,MAAM,EAAEI,SAAS,EAAE,GAAGC,IAAAA,mBAAS,EAACL,aAAaM,GAAG;IAChD,IAAIF,6BAAAA,UAAWG,MAAM,EAAE;QACrB,oDAAoD;QACpD,MAAMC,iBAAiBP,QAAQG,SAAS,CAACK,MAAM,CAAC,CAACC,WAAaN,UAAUO,QAAQ,CAACD;QACjF,IAAIF,eAAeD,MAAM,GAAG,GAAG;YAC7BN,QAAQG,SAAS,GAAGI;QACtB,OAAO;YACL,MAAMI,qBAAqBX,QAAQG,SAAS,CAACS,IAAI,CAAC;YAClDC,QAAG,CAACC,IAAI,CACNC,IAAAA,gBAAK,CAAA,CAAC,4BAA4B,EAAEJ,mBAAmB,aAAa,EAAER,UAAUS,IAAI,CAAC,MAAM,sEAAsE,EAAED,mBAAmB,EAAE,CAAC;QAE7L;IACF;IACA,IAAIX,QAAQgB,KAAK,EAAE;QACjB,MAAM,EAAEC,yBAAyB,EAAE,GAAG,MAAM,mEAAA,QAAO;QACnD,+BAA+B;QAC/B,IAAI,MAAMA,6BAA6B;YACrC,OAAO;QACT;QACA,0CAA0C;QAC1C,MAAMC,IAAAA,oCAAiB,EAACnB,aAAaC,QAAQG,SAAS;IACxD,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AC9B4B,YAAY,CAACH;QACbvD,WAAWH,QAAQG,SAAS;QAC5BqB;QACAnB;IACF;AACF"}
|
|
@@ -53,7 +53,7 @@ async function runAndroidAsync(projectRoot, { install, ...options }) {
|
|
|
53
53
|
// NOTE: This is a guess, the developer can overwrite with `NODE_ENV`.
|
|
54
54
|
const isProduction = (_options_variant = options.variant) == null ? void 0 : _options_variant.toLowerCase().endsWith('release');
|
|
55
55
|
(0, _nodeEnv.setNodeEnv)(isProduction ? 'production' : 'development');
|
|
56
|
-
|
|
56
|
+
(0, _nodeEnv.loadEnvFiles)(projectRoot);
|
|
57
57
|
await (0, _ensureNativeProject.ensureNativeProjectAsync)(projectRoot, {
|
|
58
58
|
platform: 'android',
|
|
59
59
|
install
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/run/android/runAndroidAsync.ts"],"sourcesContent":["import chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { resolveInstallApkNameAsync } from './resolveInstallApkName';\nimport { Options, ResolvedOptions, resolveOptionsAsync } from './resolveOptions';\nimport { exportEagerAsync } from '../../export/embed/exportEager';\nimport { Log } from '../../log';\nimport type { AndroidOpenInCustomProps } from '../../start/platforms/android/AndroidPlatformManager';\nimport { assembleAsync, installAsync } from '../../start/platforms/android/gradle';\nimport { resolveBuildCache, uploadBuildCache } from '../../utils/build-cache-providers';\nimport { CommandError } from '../../utils/errors';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { ensurePortAvailabilityAsync } from '../../utils/port';\nimport { getSchemesForAndroidAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\n\nconst debug = require('debug')('expo:run:android');\n\nexport async function runAndroidAsync(projectRoot: string, { install, ...options }: Options) {\n // NOTE: This is a guess, the developer can overwrite with `NODE_ENV`.\n const isProduction = options.variant?.toLowerCase().endsWith('release');\n setNodeEnv(isProduction ? 'production' : 'development');\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/run/android/runAndroidAsync.ts"],"sourcesContent":["import chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { resolveInstallApkNameAsync } from './resolveInstallApkName';\nimport { Options, ResolvedOptions, resolveOptionsAsync } from './resolveOptions';\nimport { exportEagerAsync } from '../../export/embed/exportEager';\nimport { Log } from '../../log';\nimport type { AndroidOpenInCustomProps } from '../../start/platforms/android/AndroidPlatformManager';\nimport { assembleAsync, installAsync } from '../../start/platforms/android/gradle';\nimport { resolveBuildCache, uploadBuildCache } from '../../utils/build-cache-providers';\nimport { CommandError } from '../../utils/errors';\nimport { setNodeEnv, loadEnvFiles } from '../../utils/nodeEnv';\nimport { ensurePortAvailabilityAsync } from '../../utils/port';\nimport { getSchemesForAndroidAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\n\nconst debug = require('debug')('expo:run:android');\n\nexport async function runAndroidAsync(projectRoot: string, { install, ...options }: Options) {\n // NOTE: This is a guess, the developer can overwrite with `NODE_ENV`.\n const isProduction = options.variant?.toLowerCase().endsWith('release');\n setNodeEnv(isProduction ? 'production' : 'development');\n loadEnvFiles(projectRoot);\n\n await ensureNativeProjectAsync(projectRoot, { platform: 'android', install });\n\n const props = await resolveOptionsAsync(projectRoot, options);\n\n if (!options.binary && props.buildCacheProvider) {\n const localPath = await resolveBuildCache({\n projectRoot,\n platform: 'android',\n provider: props.buildCacheProvider,\n runOptions: options,\n });\n if (localPath) {\n options.binary = localPath;\n }\n }\n\n debug('Package name: ' + props.packageName);\n Log.log('› Building app...');\n\n const androidProjectRoot = path.join(projectRoot, 'android');\n\n let shouldUpdateBuildCache = false;\n if (!options.binary) {\n let eagerBundleOptions: string | undefined;\n\n if (isProduction) {\n eagerBundleOptions = JSON.stringify(\n await exportEagerAsync(projectRoot, {\n dev: false,\n platform: 'android',\n })\n );\n }\n\n await assembleAsync(androidProjectRoot, {\n variant: props.variant,\n port: props.port,\n appName: props.appName,\n buildCache: props.buildCache,\n architectures: props.architectures,\n eagerBundleOptions,\n });\n shouldUpdateBuildCache = true;\n\n // Ensure the port hasn't become busy during the build.\n if (props.shouldStartBundler && !(await ensurePortAvailabilityAsync(projectRoot, props))) {\n props.shouldStartBundler = false;\n }\n }\n\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n // If a scheme is specified then use that instead of the package name.\n scheme: (await getSchemesForAndroidAsync(projectRoot))?.[0],\n headless: !props.shouldStartBundler,\n });\n\n if (!options.binary) {\n // Find the APK file path\n const apkFile = await resolveInstallApkNameAsync(props.device.device, props);\n if (apkFile) {\n // Attempt to install the APK from the file path\n options.binary = path.join(props.apkVariantDirectory, apkFile);\n }\n }\n\n if (options.binary) {\n // Attempt to install the APK from the file path\n const binaryPath = path.join(options.binary);\n\n if (!fs.existsSync(binaryPath)) {\n throw new CommandError(`The path to the custom Android binary does not exist: ${binaryPath}`);\n }\n Log.log(chalk.gray`\\u203A Installing ${binaryPath}`);\n await props.device.installAppAsync(binaryPath);\n } else {\n await installAppAsync(androidProjectRoot, props);\n }\n\n await manager.getDefaultDevServer().openCustomRuntimeAsync<AndroidOpenInCustomProps>(\n 'emulator',\n {\n applicationId: props.packageName,\n customAppId: props.customAppId,\n launchActivity: props.launchActivity,\n },\n { device: props.device.device }\n );\n\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n } else {\n await manager.stopAsync();\n }\n\n if (options.binary && shouldUpdateBuildCache && props.buildCacheProvider) {\n await uploadBuildCache({\n projectRoot,\n platform: 'android',\n provider: props.buildCacheProvider,\n buildPath: options.binary,\n runOptions: options,\n });\n }\n}\n\nasync function installAppAsync(androidProjectRoot: string, props: ResolvedOptions) {\n // If we cannot resolve the APK file path then we can attempt to install using Gradle.\n // This offers more advanced resolution that we may not have first class support for.\n Log.log('› Failed to locate binary file, installing with Gradle...');\n await installAsync(androidProjectRoot, {\n variant: props.variant ?? 'debug',\n appName: props.appName ?? 'app',\n port: props.port,\n });\n}\n"],"names":["runAndroidAsync","debug","require","projectRoot","install","options","isProduction","variant","toLowerCase","endsWith","setNodeEnv","loadEnvFiles","ensureNativeProjectAsync","platform","props","resolveOptionsAsync","binary","buildCacheProvider","localPath","resolveBuildCache","provider","runOptions","packageName","Log","log","androidProjectRoot","path","join","shouldUpdateBuildCache","eagerBundleOptions","JSON","stringify","exportEagerAsync","dev","assembleAsync","port","appName","buildCache","architectures","shouldStartBundler","ensurePortAvailabilityAsync","manager","startBundlerAsync","scheme","getSchemesForAndroidAsync","headless","apkFile","resolveInstallApkNameAsync","device","apkVariantDirectory","binaryPath","fs","existsSync","CommandError","chalk","gray","installAppAsync","getDefaultDevServer","openCustomRuntimeAsync","applicationId","customAppId","launchActivity","logProjectLogsLocation","stopAsync","uploadBuildCache","buildPath","installAsync"],"mappings":";;;;+BAqBsBA;;;eAAAA;;;;gEArBJ;;;;;;;gEACH;;;;;;;gEACE;;;;;;uCAE0B;gCACmB;6BAC7B;qBACb;wBAEwB;qCACQ;wBACvB;yBACY;sBACG;wBACF;qCACD;uBACF;8BACL;;;;;;AAElC,MAAMC,QAAQC,QAAQ,SAAS;AAExB,eAAeF,gBAAgBG,WAAmB,EAAE,EAAEC,OAAO,EAAE,GAAGC,SAAkB;QAEpEA,kBAyDV;IA1DX,sEAAsE;IACtE,MAAMC,gBAAeD,mBAAAA,QAAQE,OAAO,qBAAfF,iBAAiBG,WAAW,GAAGC,QAAQ,CAAC;IAC7DC,IAAAA,mBAAU,EAACJ,eAAe,eAAe;IACzCK,IAAAA,qBAAY,EAACR;IAEb,MAAMS,IAAAA,6CAAwB,EAACT,aAAa;QAAEU,UAAU;QAAWT;IAAQ;IAE3E,MAAMU,QAAQ,MAAMC,IAAAA,mCAAmB,EAACZ,aAAaE;IAErD,IAAI,CAACA,QAAQW,MAAM,IAAIF,MAAMG,kBAAkB,EAAE;QAC/C,MAAMC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O,MAAMP,OAAO,IAAI;QAC1B6B,SAAStB,MAAMsB,OAAO,IAAI;QAC1BD,MAAMrB,MAAMqB,IAAI;IAClB;AACF"}
|
|
@@ -104,7 +104,7 @@ const debug = require('debug')('expo:run:ios');
|
|
|
104
104
|
async function runIosAsync(projectRoot, options) {
|
|
105
105
|
var _this;
|
|
106
106
|
(0, _nodeEnv.setNodeEnv)(options.configuration === 'Release' ? 'production' : 'development');
|
|
107
|
-
|
|
107
|
+
(0, _nodeEnv.loadEnvFiles)(projectRoot);
|
|
108
108
|
assertPlatform();
|
|
109
109
|
const install = !!options.install;
|
|
110
110
|
if (await (0, _ensureNativeProject.ensureNativeProjectAsync)(projectRoot, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/run/ios/runIosAsync.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport * as XcodeBuild from './XcodeBuild';\nimport { Options } from './XcodeBuild.types';\nimport { getLaunchInfoForBinaryAsync, launchAppAsync } from './launchApp';\nimport { resolveOptionsAsync } from './options/resolveOptions';\nimport { getValidBinaryPathAsync } from './validateExternalBinary';\nimport { exportEagerAsync } from '../../export/embed/exportEager';\nimport * as Log from '../../log';\nimport { AppleAppIdResolver } from '../../start/platforms/ios/AppleAppIdResolver';\nimport { getContainerPathAsync, simctlAsync } from '../../start/platforms/ios/simctl';\nimport { resolveBuildCache, uploadBuildCache } from '../../utils/build-cache-providers';\nimport { maybePromptToSyncPodsAsync } from '../../utils/cocoapods';\nimport { CommandError } from '../../utils/errors';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { ensurePortAvailabilityAsync } from '../../utils/port';\nimport { profile } from '../../utils/profile';\nimport { getSchemesForIosAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\n\nconst debug = require('debug')('expo:run:ios');\n\nexport async function runIosAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.configuration === 'Release' ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n assertPlatform();\n\n const install = !!options.install;\n\n if ((await ensureNativeProjectAsync(projectRoot, { platform: 'ios', install })) && install) {\n await maybePromptToSyncPodsAsync(projectRoot);\n }\n\n // Resolve the CLI arguments into useable options.\n const props = await profile(resolveOptionsAsync)(projectRoot, options);\n\n // We only support build cache for simulator builds for now.\n if (!options.binary && props.buildCacheProvider && props.isSimulator) {\n const localPath = await resolveBuildCache({\n projectRoot,\n platform: 'ios',\n runOptions: options,\n provider: props.buildCacheProvider,\n });\n if (localPath) {\n options.binary = localPath;\n }\n }\n\n if (options.rebundle) {\n Log.warn(`The --unstable-rebundle flag is experimental and may not work as expected.`);\n // Get the existing binary path to re-bundle the app.\n\n let binaryPath: string;\n if (!options.binary) {\n if (!props.isSimulator) {\n throw new Error('Re-bundling on physical devices requires the --binary flag.');\n }\n const appId = await new AppleAppIdResolver(projectRoot).getAppIdAsync();\n const possibleBinaryPath = await getContainerPathAsync(props.device, {\n appId,\n });\n if (!possibleBinaryPath) {\n throw new CommandError(\n `Cannot rebundle because no --binary was provided and no existing binary was found on the device for ID: ${appId}.`\n );\n }\n binaryPath = possibleBinaryPath;\n Log.log('Re-using existing binary path:', binaryPath);\n // Set the binary path to the existing binary path.\n options.binary = binaryPath;\n }\n\n Log.log('Rebundling the Expo config file');\n // Re-bundle the config file the same way the app was originally bundled.\n await spawnAsync('node', [\n // TODO(@kitten): This isn't correct. The template installs expo-constants, but expo also depends on it\n // This however means that the top-level module doesn't have to exist. With isolated dependencies this will then fail\n // But we can't resolve via `expo` because that then may do something differently than autolinking if the root has a different version\n path.join(require.resolve('expo-constants/package.json'), '../scripts/getAppConfig.js'),\n projectRoot,\n path.join(options.binary, 'EXConstants.bundle'),\n ]);\n // Re-bundle the app.\n\n const possibleBundleOutput = path.join(options.binary, 'main.jsbundle');\n\n if (fs.existsSync(possibleBundleOutput)) {\n Log.log('Rebundling the app...');\n await exportEagerAsync(projectRoot, {\n resetCache: false,\n dev: false,\n platform: 'ios',\n assetsDest: path.join(options.binary, 'assets'),\n bundleOutput: possibleBundleOutput,\n });\n } else {\n Log.warn('Bundle output not found at expected location:', possibleBundleOutput);\n }\n }\n\n let binaryPath: string;\n let shouldUpdateBuildCache = false;\n if (options.binary) {\n binaryPath = await getValidBinaryPathAsync(options.binary, props);\n Log.log('Using custom binary path:', binaryPath);\n } else {\n let eagerBundleOptions: string | undefined;\n\n if (options.configuration === 'Release') {\n eagerBundleOptions = JSON.stringify(\n await exportEagerAsync(projectRoot, {\n dev: false,\n platform: 'ios',\n })\n );\n }\n\n // Spawn the `xcodebuild` process to create the app binary.\n const buildOutput = await XcodeBuild.buildAsync({\n ...props,\n eagerBundleOptions,\n });\n\n // Find the path to the built app binary, this will be used to install the binary\n // on a device.\n binaryPath = await profile(XcodeBuild.getAppBinaryPath)(buildOutput);\n // We only support build cache for simulator builds for now.\n shouldUpdateBuildCache = props.isSimulator;\n }\n debug('Binary path:', binaryPath);\n\n // Ensure the port hasn't become busy during the build.\n if (props.shouldStartBundler && !(await ensurePortAvailabilityAsync(projectRoot, props))) {\n props.shouldStartBundler = false;\n }\n\n const launchInfo = await getLaunchInfoForBinaryAsync(binaryPath);\n const isCustomBinary = !!options.binary;\n\n // Always close the app before launching on a simulator. Otherwise certain cached resources like the splashscreen will not be available.\n if (props.isSimulator) {\n try {\n await simctlAsync(['terminate', props.device.udid, launchInfo.bundleId]);\n } catch (error) {\n // If we failed it's likely that the app was not running to begin with and we will get an `invalid device` error\n debug('Failed to terminate app (possibly because it was not running):', error);\n }\n }\n\n // Start the dev server which creates all of the required info for\n // launching the app on a simulator.\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n headless: !props.shouldStartBundler,\n // If a scheme is specified then use that instead of the package name.\n\n scheme: isCustomBinary\n ? // If launching a custom binary, use the schemes in the Info.plist.\n launchInfo.schemes[0]\n : // If a scheme is specified then use that instead of the package name.\n (await getSchemesForIosAsync(projectRoot))?.[0],\n });\n\n // Install and launch the app binary on a device.\n await launchAppAsync(\n binaryPath,\n manager,\n {\n isSimulator: props.isSimulator,\n device: props.device,\n shouldStartBundler: props.shouldStartBundler,\n },\n launchInfo.bundleId\n );\n\n // Log the location of the JS logs for the device.\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n } else {\n await manager.stopAsync();\n }\n\n if (shouldUpdateBuildCache && props.buildCacheProvider) {\n await uploadBuildCache({\n projectRoot,\n platform: 'ios',\n provider: props.buildCacheProvider,\n buildPath: binaryPath,\n runOptions: options,\n });\n }\n}\n\nfunction assertPlatform() {\n if (process.platform !== 'darwin') {\n Log.exit(\n chalk`iOS apps can only be built on macOS devices. Use {cyan eas build -p ios} to build in the cloud.`\n );\n }\n}\n"],"names":["runIosAsync","debug","require","projectRoot","options","setNodeEnv","configuration","load","assertPlatform","install","ensureNativeProjectAsync","platform","maybePromptToSyncPodsAsync","props","profile","resolveOptionsAsync","binary","buildCacheProvider","isSimulator","localPath","resolveBuildCache","runOptions","provider","rebundle","Log","warn","binaryPath","Error","appId","AppleAppIdResolver","getAppIdAsync","possibleBinaryPath","getContainerPathAsync","device","CommandError","log","spawnAsync","path","join","resolve","possibleBundleOutput","fs","existsSync","exportEagerAsync","resetCache","dev","assetsDest","bundleOutput","shouldUpdateBuildCache","getValidBinaryPathAsync","eagerBundleOptions","JSON","stringify","buildOutput","XcodeBuild","buildAsync","getAppBinaryPath","shouldStartBundler","ensurePortAvailabilityAsync","launchInfo","getLaunchInfoForBinaryAsync","isCustomBinary","simctlAsync","udid","bundleId","error","manager","startBundlerAsync","port","headless","scheme","schemes","getSchemesForIosAsync","launchAppAsync","logProjectLogsLocation","stopAsync","uploadBuildCache","buildPath","process","exit","chalk"],"mappings":";;;;+BA2BsBA;;;eAAAA;;;;gEA3BC;;;;;;;gEACL;;;;;;;gEACH;;;;;;;gEACE;;;;;;oEAEW;2BAEg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,kDAAkD;IAClD,IAAInD,MAAM4C,kBAAkB,EAAE;QAC5BiB,IAAAA,6BAAsB;IACxB,OAAO;QACL,MAAMR,QAAQS,SAAS;IACzB;IAEA,IAAI3B,0BAA0BnC,MAAMI,kBAAkB,EAAE;QACtD,MAAM2D,IAAAA,qCAAgB,EAAC;YACrBzE;YACAQ,UAAU;YACVW,UAAUT,MAAMI,kBAAkB;YAClC4D,WAAWnD;YACXL,YAAYjB;QACd;IACF;AACF;AAEA,SAASI;IACP,IAAIsE,QAAQnE,QAAQ,KAAK,UAAU;QACjCa,KAAIuD,IAAI,CACNC,IAAAA,gBAAK,CAAA,CAAC,+FAA+F,CAAC;IAE1G;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/run/ios/runIosAsync.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport * as XcodeBuild from './XcodeBuild';\nimport { Options } from './XcodeBuild.types';\nimport { getLaunchInfoForBinaryAsync, launchAppAsync } from './launchApp';\nimport { resolveOptionsAsync } from './options/resolveOptions';\nimport { getValidBinaryPathAsync } from './validateExternalBinary';\nimport { exportEagerAsync } from '../../export/embed/exportEager';\nimport * as Log from '../../log';\nimport { AppleAppIdResolver } from '../../start/platforms/ios/AppleAppIdResolver';\nimport { getContainerPathAsync, simctlAsync } from '../../start/platforms/ios/simctl';\nimport { resolveBuildCache, uploadBuildCache } from '../../utils/build-cache-providers';\nimport { maybePromptToSyncPodsAsync } from '../../utils/cocoapods';\nimport { CommandError } from '../../utils/errors';\nimport { setNodeEnv, loadEnvFiles } from '../../utils/nodeEnv';\nimport { ensurePortAvailabilityAsync } from '../../utils/port';\nimport { profile } from '../../utils/profile';\nimport { getSchemesForIosAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\n\nconst debug = require('debug')('expo:run:ios');\n\nexport async function runIosAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.configuration === 'Release' ? 'production' : 'development');\n loadEnvFiles(projectRoot);\n\n assertPlatform();\n\n const install = !!options.install;\n\n if ((await ensureNativeProjectAsync(projectRoot, { platform: 'ios', install })) && install) {\n await maybePromptToSyncPodsAsync(projectRoot);\n }\n\n // Resolve the CLI arguments into useable options.\n const props = await profile(resolveOptionsAsync)(projectRoot, options);\n\n // We only support build cache for simulator builds for now.\n if (!options.binary && props.buildCacheProvider && props.isSimulator) {\n const localPath = await resolveBuildCache({\n projectRoot,\n platform: 'ios',\n runOptions: options,\n provider: props.buildCacheProvider,\n });\n if (localPath) {\n options.binary = localPath;\n }\n }\n\n if (options.rebundle) {\n Log.warn(`The --unstable-rebundle flag is experimental and may not work as expected.`);\n // Get the existing binary path to re-bundle the app.\n\n let binaryPath: string;\n if (!options.binary) {\n if (!props.isSimulator) {\n throw new Error('Re-bundling on physical devices requires the --binary flag.');\n }\n const appId = await new AppleAppIdResolver(projectRoot).getAppIdAsync();\n const possibleBinaryPath = await getContainerPathAsync(props.device, {\n appId,\n });\n if (!possibleBinaryPath) {\n throw new CommandError(\n `Cannot rebundle because no --binary was provided and no existing binary was found on the device for ID: ${appId}.`\n );\n }\n binaryPath = possibleBinaryPath;\n Log.log('Re-using existing binary path:', binaryPath);\n // Set the binary path to the existing binary path.\n options.binary = binaryPath;\n }\n\n Log.log('Rebundling the Expo config file');\n // Re-bundle the config file the same way the app was originally bundled.\n await spawnAsync('node', [\n // TODO(@kitten): This isn't correct. The template installs expo-constants, but expo also depends on it\n // This however means that the top-level module doesn't have to exist. With isolated dependencies this will then fail\n // But we can't resolve via `expo` because that then may do something differently than autolinking if the root has a different version\n path.join(require.resolve('expo-constants/package.json'), '../scripts/getAppConfig.js'),\n projectRoot,\n path.join(options.binary, 'EXConstants.bundle'),\n ]);\n // Re-bundle the app.\n\n const possibleBundleOutput = path.join(options.binary, 'main.jsbundle');\n\n if (fs.existsSync(possibleBundleOutput)) {\n Log.log('Rebundling the app...');\n await exportEagerAsync(projectRoot, {\n resetCache: false,\n dev: false,\n platform: 'ios',\n assetsDest: path.join(options.binary, 'assets'),\n bundleOutput: possibleBundleOutput,\n });\n } else {\n Log.warn('Bundle output not found at expected location:', possibleBundleOutput);\n }\n }\n\n let binaryPath: string;\n let shouldUpdateBuildCache = false;\n if (options.binary) {\n binaryPath = await getValidBinaryPathAsync(options.binary, props);\n Log.log('Using custom binary path:', binaryPath);\n } else {\n let eagerBundleOptions: string | undefined;\n\n if (options.configuration === 'Release') {\n eagerBundleOptions = JSON.stringify(\n await exportEagerAsync(projectRoot, {\n dev: false,\n platform: 'ios',\n })\n );\n }\n\n // Spawn the `xcodebuild` process to create the app binary.\n const buildOutput = await XcodeBuild.buildAsync({\n ...props,\n eagerBundleOptions,\n });\n\n // Find the path to the built app binary, this will be used to install the binary\n // on a device.\n binaryPath = await profile(XcodeBuild.getAppBinaryPath)(buildOutput);\n // We only support build cache for simulator builds for now.\n shouldUpdateBuildCache = props.isSimulator;\n }\n debug('Binary path:', binaryPath);\n\n // Ensure the port hasn't become busy during the build.\n if (props.shouldStartBundler && !(await ensurePortAvailabilityAsync(projectRoot, props))) {\n props.shouldStartBundler = false;\n }\n\n const launchInfo = await getLaunchInfoForBinaryAsync(binaryPath);\n const isCustomBinary = !!options.binary;\n\n // Always close the app before launching on a simulator. Otherwise certain cached resources like the splashscreen will not be available.\n if (props.isSimulator) {\n try {\n await simctlAsync(['terminate', props.device.udid, launchInfo.bundleId]);\n } catch (error) {\n // If we failed it's likely that the app was not running to begin with and we will get an `invalid device` error\n debug('Failed to terminate app (possibly because it was not running):', error);\n }\n }\n\n // Start the dev server which creates all of the required info for\n // launching the app on a simulator.\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n headless: !props.shouldStartBundler,\n // If a scheme is specified then use that instead of the package name.\n\n scheme: isCustomBinary\n ? // If launching a custom binary, use the schemes in the Info.plist.\n launchInfo.schemes[0]\n : // If a scheme is specified then use that instead of the package name.\n (await getSchemesForIosAsync(projectRoot))?.[0],\n });\n\n // Install and launch the app binary on a device.\n await launchAppAsync(\n binaryPath,\n manager,\n {\n isSimulator: props.isSimulator,\n device: props.device,\n shouldStartBundler: props.shouldStartBundler,\n },\n launchInfo.bundleId\n );\n\n // Log the location of the JS logs for the device.\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n } else {\n await manager.stopAsync();\n }\n\n if (shouldUpdateBuildCache && props.buildCacheProvider) {\n await uploadBuildCache({\n projectRoot,\n platform: 'ios',\n provider: props.buildCacheProvider,\n buildPath: binaryPath,\n runOptions: options,\n });\n }\n}\n\nfunction assertPlatform() {\n if (process.platform !== 'darwin') {\n Log.exit(\n chalk`iOS apps can only be built on macOS devices. Use {cyan eas build -p ios} to build in the cloud.`\n );\n }\n}\n"],"names":["runIosAsync","debug","require","projectRoot","options","setNodeEnv","configuration","loadEnvFiles","assertPlatform","install","ensureNativeProjectAsync","platform","maybePromptToSyncPodsAsync","props","profile","resolveOptionsAsync","binary","buildCacheProvider","isSimulator","localPath","resolveBuildCache","runOptions","provider","rebundle","Log","warn","binaryPath","Error","appId","AppleAppIdResolver","getAppIdAsync","possibleBinaryPath","getContainerPathAsync","device","CommandError","log","spawnAsync","path","join","resolve","possibleBundleOutput","fs","existsSync","exportEagerAsync","resetCache","dev","assetsDest","bundleOutput","shouldUpdateBuildCache","getValidBinaryPathAsync","eagerBundleOptions","JSON","stringify","buildOutput","XcodeBuild","buildAsync","getAppBinaryPath","shouldStartBundler","ensurePortAvailabilityAsync","launchInfo","getLaunchInfoForBinaryAsync","isCustomBinary","simctlAsync","udid","bundleId","error","manager","startBundlerAsync","port","headless","scheme","schemes","getSchemesForIosAsync","launchAppAsync","logProjectLogsLocation","stopAsync","uploadBuildCache","buildPath","process","exit","chalk"],"mappings":";;;;+BA2BsBA;;;eAAAA;;;;gEA3BC;;;;;;;gEACL;;;;;;;gEACH;;;;;;;gEACE;;;;;;oEAEW;2BAEgC;gC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,IAAInD,MAAM4C,kBAAkB,EAAE;QAC5BiB,IAAAA,6BAAsB;IACxB,OAAO;QACL,MAAMR,QAAQS,SAAS;IACzB;IAEA,IAAI3B,0BAA0BnC,MAAMI,kBAAkB,EAAE;QACtD,MAAM2D,IAAAA,qCAAgB,EAAC;YACrBzE;YACAQ,UAAU;YACVW,UAAUT,MAAMI,kBAAkB;YAClC4D,WAAWnD;YACXL,YAAYjB;QACd;IACF;AACF;AAEA,SAASI;IACP,IAAIsE,QAAQnE,QAAQ,KAAK,UAAU;QACjCa,KAAIuD,IAAI,CACNC,IAAAA,gBAAK,CAAA,CAAC,+FAA+F,CAAC;IAE1G;AACF"}
|
|
@@ -106,7 +106,7 @@ const debug = require('debug')('expo:serve');
|
|
|
106
106
|
async function serveAsync(inputDir, options) {
|
|
107
107
|
const projectRoot = (0, _findUp.findUpProjectRootOrAssert)(inputDir);
|
|
108
108
|
(0, _nodeEnv.setNodeEnv)('production');
|
|
109
|
-
|
|
109
|
+
(0, _nodeEnv.loadEnvFiles)(projectRoot);
|
|
110
110
|
const port = await (0, _port.resolvePortAsync)(projectRoot, {
|
|
111
111
|
defaultPort: options.port,
|
|
112
112
|
fallbackPort: 8081
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/serve/serveAsync.ts"],"sourcesContent":["import chalk from 'chalk';\nimport connect from 'connect';\nimport { createRequestHandler } from 'expo-server/adapter/http';\nimport http from 'http';\nimport path from 'path';\nimport send from 'send';\n\nimport * as Log from '../log';\nimport { directoryExistsAsync, fileExistsAsync } from '../utils/dir';\nimport { CommandError } from '../utils/errors';\nimport { findUpProjectRootOrAssert } from '../utils/findUp';\nimport { setNodeEnv } from '../utils/nodeEnv';\nimport { resolvePortAsync } from '../utils/port';\n\ntype Options = {\n port?: number;\n isDefaultDirectory: boolean;\n};\n\nconst debug = require('debug')('expo:serve') as typeof console.log;\n\n// Start a basic http server\nexport async function serveAsync(inputDir: string, options: Options) {\n const projectRoot = findUpProjectRootOrAssert(inputDir);\n\n setNodeEnv('production');\n
|
|
1
|
+
{"version":3,"sources":["../../../src/serve/serveAsync.ts"],"sourcesContent":["import chalk from 'chalk';\nimport connect from 'connect';\nimport { createRequestHandler } from 'expo-server/adapter/http';\nimport http from 'http';\nimport path from 'path';\nimport send from 'send';\n\nimport * as Log from '../log';\nimport { directoryExistsAsync, fileExistsAsync } from '../utils/dir';\nimport { CommandError } from '../utils/errors';\nimport { findUpProjectRootOrAssert } from '../utils/findUp';\nimport { setNodeEnv, loadEnvFiles } from '../utils/nodeEnv';\nimport { resolvePortAsync } from '../utils/port';\n\ntype Options = {\n port?: number;\n isDefaultDirectory: boolean;\n};\n\nconst debug = require('debug')('expo:serve') as typeof console.log;\n\n// Start a basic http server\nexport async function serveAsync(inputDir: string, options: Options) {\n const projectRoot = findUpProjectRootOrAssert(inputDir);\n\n setNodeEnv('production');\n loadEnvFiles(projectRoot);\n\n const port = await resolvePortAsync(projectRoot, {\n defaultPort: options.port,\n fallbackPort: 8081,\n });\n\n if (port == null) {\n throw new CommandError('Could not start server. Port is not available.');\n }\n options.port = port;\n\n const serverDist = options.isDefaultDirectory ? path.join(inputDir, 'dist') : inputDir;\n // TODO: `.expo/server/ios`, `.expo/server/android`, etc.\n\n if (!(await directoryExistsAsync(serverDist))) {\n throw new CommandError(\n `The server directory ${serverDist} does not exist. Run \\`npx expo export\\` first.`\n );\n }\n\n const isStatic = await isStaticExportAsync(serverDist);\n\n Log.log(chalk.dim(`Starting ${isStatic ? 'static ' : ''}server in ${serverDist}`));\n\n if (isStatic) {\n await startStaticServerAsync(serverDist, options);\n } else {\n await startDynamicServerAsync(serverDist, options);\n }\n Log.log(`Server running at http://localhost:${options.port}`);\n // Detect the type of server we need to setup:\n}\n\nasync function startStaticServerAsync(dist: string, options: Options) {\n const server = http.createServer((req, res) => {\n // Remove query strings and decode URI\n const filePath = decodeURI(req.url?.split('?')[0] ?? '');\n\n send(req, filePath, {\n root: dist,\n index: 'index.html',\n extensions: ['html'],\n })\n .on('error', (err: any) => {\n if (err.status === 404) {\n res.statusCode = 404;\n res.end('Not Found');\n return;\n }\n res.statusCode = err.status || 500;\n res.end('Internal Server Error');\n })\n .pipe(res);\n });\n\n server.listen(options.port!);\n}\n\nasync function startDynamicServerAsync(dist: string, options: Options) {\n const middleware = connect();\n\n const staticDirectory = path.join(dist, 'client');\n const serverDirectory = path.join(dist, 'server');\n\n const serverHandler = createRequestHandler({ build: serverDirectory });\n\n // DOM component CORS support\n middleware.use((req, res, next) => {\n // TODO: Only when origin is `file://` (iOS), and Android equivalent.\n\n // Required for DOM components security in release builds.\n\n res.setHeader('Access-Control-Allow-Origin', '*');\n res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');\n res.setHeader(\n 'Access-Control-Allow-Headers',\n 'Origin, X-Requested-With, Content-Type, Accept, expo-platform'\n );\n\n // Handle OPTIONS preflight requests\n if (req.method === 'OPTIONS') {\n res.statusCode = 200;\n res.end();\n return;\n }\n next();\n });\n\n middleware.use((req, res, next) => {\n if (!req?.url || (req.method !== 'GET' && req.method !== 'HEAD')) {\n return next();\n }\n\n const pathname = canParseURL(req.url) ? new URL(req.url).pathname : req.url;\n if (!pathname) {\n return next();\n }\n\n debug(`Maybe serve static:`, pathname);\n\n const stream = send(req, pathname, {\n root: staticDirectory,\n extensions: ['html'],\n });\n\n // add file listener for fallthrough\n let forwardError = false;\n stream.on('file', function onFile() {\n // once file is determined, always forward error\n forwardError = true;\n });\n\n // forward errors\n stream.on('error', function error(err: any) {\n if (forwardError || !(err.statusCode < 500)) {\n next(err);\n return;\n }\n\n next();\n });\n\n // pipe\n stream.pipe(res);\n });\n\n middleware.use(serverHandler);\n\n middleware.listen(options.port!);\n}\n\nfunction canParseURL(url: string): boolean {\n try {\n // eslint-disable-next-line no-new\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function isStaticExportAsync(dist: string): Promise<boolean> {\n const routesFile = path.join(dist, `server/_expo/routes.json`);\n return !(await fileExistsAsync(routesFile));\n}\n"],"names":["serveAsync","debug","require","inputDir","options","projectRoot","findUpProjectRootOrAssert","setNodeEnv","loadEnvFiles","port","resolvePortAsync","defaultPort","fallbackPort","CommandError","serverDist","isDefaultDirectory","path","join","directoryExistsAsync","isStatic","isStaticExportAsync","Log","log","chalk","dim","startStaticServerAsync","startDynamicServerAsync","dist","server","http","createServer","req","res","filePath","decodeURI","url","split","send","root","index","extensions","on","err","status","statusCode","end","pipe","listen","middleware","connect","staticDirectory","serverDirectory","serverHandler","createRequestHandler","build","use","next","setHeader","method","pathname","canParseURL","URL","stream","forwardError","onFile","error","routesFile","fileExistsAsync"],"mappings":";;;;+BAsBsBA;;;eAAAA;;;;gEAtBJ;;;;;;;gEACE;;;;;;;yBACiB;;;;;;;gEACpB;;;;;;;gEACA;;;;;;;gEACA;;;;;;6DAEI;qBACiC;wBACzB;wBACa;yBACD;sBACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOjC,MAAMC,QAAQC,QAAQ,SAAS;AAGxB,eAAeF,WAAWG,QAAgB,EAAEC,OAAgB;IACjE,MAAMC,cAAcC,IAAAA,iCAAyB,EAACH;IAE9CI,IAAAA,mBAAU,EAAC;IACXC,IAAAA,qBAAY,EAACH;IAEb,MAAMI,OAAO,MAAMC,IAAAA,sBAAgB,EAACL,aAAa;QAC/CM,aAAaP,QAAQK,IAAI;QACzBG,cAAc;IAChB;IAEA,IAAIH,QAAQ,MAAM;QAChB,MAAM,IAAII,oBAAY,CAAC;IACzB;IACAT,QAAQK,IAAI,GAAGA;IAEf,MAAMK,aAAaV,QAAQW,kBAAkB,GAAGC,eAAI,CAACC,IAAI,CAACd,UAAU,UAAUA;IAC9E,0DAA0D;IAE1D,IAAI,CAAE,MAAMe,IAAAA,yBAAoB,EAACJ,aAAc;QAC7C,MAAM,IAAID,oBAAY,CACpB,CAAC,qBAAqB,EAAEC,WAAW,+CAA+C,CAAC;IAEvF;IAEA,MAAMK,W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