@expo/cli 0.20.4 → 0.20.5

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 CHANGED
@@ -120,7 +120,7 @@ const args = (0, _arg().default)({
120
120
  });
121
121
  if (args["--version"]) {
122
122
  // Version is added in the build script.
123
- console.log("0.20.4");
123
+ console.log("0.20.5");
124
124
  process.exit(0);
125
125
  }
126
126
  if (args["--non-interactive"]) {
@@ -90,11 +90,16 @@ async function checkPackagesAsync(projectRoot, { packages , packageManager , opt
90
90
  * For that reason, you cannot use nexpo to test for the sub-dependency check,
91
91
  * and you cannot replace this guard with a try/catch around the import('expo-router')
92
92
  */ if ((ref3 = pkg.dependencies) == null ? void 0 : ref3["expo-router"]) {
93
- const { doctor: routerDoctor } = await Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("expo-router/doctor.js")));
94
- dependencies.push(...routerDoctor(pkg, require.resolve("@react-navigation/native"), {
95
- bold: _chalk().default.bold,
96
- learnMore: _link.learnMore
97
- }));
93
+ try {
94
+ const { doctor: routerDoctor } = await Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("expo-router/doctor.js")));
95
+ dependencies.push(...routerDoctor(pkg, require.resolve("@react-navigation/native"), {
96
+ bold: _chalk().default.bold,
97
+ learnMore: _link.learnMore
98
+ }));
99
+ } catch (error) {
100
+ _log.log(`Skipped checking expo-router dependencies: expo-router/doctor.js not found.`);
101
+ debug("expo-router/doctor error:", error);
102
+ }
98
103
  }
99
104
  if (!dependencies.length) {
100
105
  _log.exit(_chalk().default.greenBright("Dependencies are up to date"), 0);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/install/checkPackages.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport * as PackageManager from '@expo/package-manager';\nimport chalk from 'chalk';\n\nimport { fixPackagesAsync } from './fixPackages';\nimport { Options } from './resolveOptions';\nimport * as Log from '../log';\nimport {\n getVersionedDependenciesAsync,\n logIncorrectDependencies,\n} from '../start/doctor/dependencies/validateDependenciesVersions';\nimport { isInteractive } from '../utils/interactive';\nimport { learnMore } from '../utils/link';\nimport { confirmAsync } from '../utils/prompts';\nimport { joinWithCommasAnd } from '../utils/strings';\n\nconst debug = require('debug')('expo:install:check') as typeof console.log;\n\n/**\n * Handles `expo install --fix|check'.\n * Checks installed dependencies against bundledNativeModules and versions endpoints to find any incompatibilities.\n * If `--fix` is passed, it will install the correct versions of the dependencies.\n * If `--check` is passed, it will prompt the user to install the correct versions of the dependencies (on interactive terminal).\n */\nexport async function checkPackagesAsync(\n projectRoot: string,\n {\n packages,\n packageManager,\n options: { fix },\n packageManagerArguments,\n }: {\n /**\n * List of packages to version\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 /** How the check should resolve */\n options: Pick<Options, 'fix'>;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n }\n) {\n // Read the project Expo config without plugins.\n const { exp, pkg } = 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 if (pkg.expo?.install?.exclude?.length) {\n Log.log(\n chalk`Skipped ${fix ? 'fixing' : 'checking'} dependencies: ${joinWithCommasAnd(\n pkg.expo.install.exclude\n )}. These dependencies are 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 const dependencies = await getVersionedDependenciesAsync(projectRoot, exp, pkg, packages);\n\n /*\n * Expo Router projects will do this additional check\n * Note: The e2e tests use nexpo which will always resolve 'expo-router/doctor.js'\n * For that reason, you cannot use nexpo to test for the sub-dependency check,\n * and you cannot replace this guard with a try/catch around the import('expo-router')\n */\n if (pkg.dependencies?.['expo-router']) {\n const { doctor: routerDoctor } = await import('expo-router/doctor.js');\n dependencies.push(\n ...routerDoctor(pkg, require.resolve('@react-navigation/native'), {\n bold: chalk.bold,\n learnMore,\n })\n );\n }\n\n if (!dependencies.length) {\n Log.exit(chalk.greenBright('Dependencies are up to date'), 0);\n }\n\n logIncorrectDependencies(dependencies);\n\n const value =\n // If `--fix` then always fix.\n fix ||\n // Otherwise prompt to fix when not running in CI.\n (isInteractive() && (await confirmAsync({ message: 'Fix dependencies?' }).catch(() => false)));\n\n if (value) {\n debug('Installing fixed dependencies:', dependencies);\n // Install the corrected dependencies.\n return fixPackagesAsync(projectRoot, {\n packageManager,\n packages: dependencies,\n packageManagerArguments,\n sdkVersion: exp.sdkVersion!,\n });\n }\n\n // Exit with non-zero exit code if any of the dependencies are out of date.\n Log.exit(chalk.red('Found outdated dependencies'), 1);\n}\n"],"names":["checkPackagesAsync","debug","require","projectRoot","packages","packageManager","options","fix","packageManagerArguments","pkg","exp","getConfig","skipPlugins","expo","install","exclude","length","Log","log","chalk","joinWithCommasAnd","learnMore","dependencies","getVersionedDependenciesAsync","doctor","routerDoctor","push","resolve","bold","exit","greenBright","logIncorrectDependencies","value","isInteractive","confirmAsync","message","catch","fixPackagesAsync","sdkVersion","red"],"mappings":"AAAA;;;;+BAwBsBA,oBAAkB;;aAAlBA,kBAAkB;;;yBAxBd,cAAc;;;;;;;8DAEtB,OAAO;;;;;;6BAEQ,eAAe;2DAE3B,QAAQ;8CAItB,2DAA2D;6BACpC,sBAAsB;sBAC1B,eAAe;yBACZ,kBAAkB;yBACb,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEpD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,oBAAoB,CAAC,AAAsB,AAAC;AAQpE,eAAeF,kBAAkB,CACtCG,WAAmB,EACnB,EACEC,QAAQ,CAAA,EACRC,cAAc,CAAA,EACdC,OAAO,EAAE,EAAEC,GAAG,CAAA,EAAE,CAAA,E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yB,OAAO,CAAC,0BAA0B,CAAC,EAAE;YAChEC,IAAI,EAAET,MAAK,EAAA,QAAA,CAACS,IAAI;YAChBP,SAAS,EAATA,KAAS,UAAA;SACV,CAAC,CACH,CAAC;IACJ,CAAC;IAED,IAAI,CAACC,YAAY,CAACN,MAAM,EAAE;QACxBC,IAAG,CAACY,IAAI,CAACV,MAAK,EAAA,QAAA,CAACW,WAAW,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC,CAAC;IAChE,CAAC;IAEDC,IAAAA,6BAAwB,yBAAA,EAACT,YAAY,CAAC,CAAC;IAEvC,MAAMU,KAAK,GACT,8BAA8B;IAC9BzB,GAAG,IACH,kDAAkD;IAClD,CAAC0B,IAAAA,YAAa,cAAA,GAAE,IAAK,MAAMC,IAAAA,QAAY,aAAA,EAAC;QAAEC,OAAO,EAAE,mBAAmB;KAAE,CAAC,CAACC,KAAK,CAAC,IAAM,KAAK,CAAC,AAAC,CAAC,AAAC;IAEjG,IAAIJ,KAAK,EAAE;QACT/B,KAAK,CAAC,gCAAgC,EAAEqB,YAAY,CAAC,CAAC;QACtD,sCAAsC;QACtC,OAAOe,IAAAA,YAAgB,iBAAA,EAAClC,WAAW,EAAE;YACnCE,cAAc;YACdD,QAAQ,EAAEkB,YAAY;YACtBd,uBAAuB;YACvB8B,UAAU,EAAE5B,GAAG,CAAC4B,UAAU;SAC3B,CAAC,CAAC;IACL,CAAC;IAED,2EAA2E;IAC3ErB,IAAG,CAACY,IAAI,CAACV,MAAK,EAAA,QAAA,CAACoB,GAAG,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC,CAAC;AACxD,CAAC"}
1
+ {"version":3,"sources":["../../../src/install/checkPackages.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport * as PackageManager from '@expo/package-manager';\nimport chalk from 'chalk';\n\nimport { fixPackagesAsync } from './fixPackages';\nimport { Options } from './resolveOptions';\nimport * as Log from '../log';\nimport {\n getVersionedDependenciesAsync,\n logIncorrectDependencies,\n} from '../start/doctor/dependencies/validateDependenciesVersions';\nimport { isInteractive } from '../utils/interactive';\nimport { learnMore } from '../utils/link';\nimport { confirmAsync } from '../utils/prompts';\nimport { joinWithCommasAnd } from '../utils/strings';\n\nconst debug = require('debug')('expo:install:check') as typeof console.log;\n\n/**\n * Handles `expo install --fix|check'.\n * Checks installed dependencies against bundledNativeModules and versions endpoints to find any incompatibilities.\n * If `--fix` is passed, it will install the correct versions of the dependencies.\n * If `--check` is passed, it will prompt the user to install the correct versions of the dependencies (on interactive terminal).\n */\nexport async function checkPackagesAsync(\n projectRoot: string,\n {\n packages,\n packageManager,\n options: { fix },\n packageManagerArguments,\n }: {\n /**\n * List of packages to version\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 /** How the check should resolve */\n options: Pick<Options, 'fix'>;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n }\n) {\n // Read the project Expo config without plugins.\n const { exp, pkg } = 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 if (pkg.expo?.install?.exclude?.length) {\n Log.log(\n chalk`Skipped ${fix ? 'fixing' : 'checking'} dependencies: ${joinWithCommasAnd(\n pkg.expo.install.exclude\n )}. These dependencies are 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 const dependencies = await getVersionedDependenciesAsync(projectRoot, exp, pkg, packages);\n\n /*\n * Expo Router projects will do this additional check\n * Note: The e2e tests use nexpo which will always resolve 'expo-router/doctor.js'\n * For that reason, you cannot use nexpo to test for the sub-dependency check,\n * and you cannot replace this guard with a try/catch around the import('expo-router')\n */\n if (pkg.dependencies?.['expo-router']) {\n try {\n const { doctor: routerDoctor } = await import('expo-router/doctor.js');\n dependencies.push(\n ...routerDoctor(pkg, require.resolve('@react-navigation/native'), {\n bold: chalk.bold,\n learnMore,\n })\n );\n } catch (error) {\n Log.log(`Skipped checking expo-router dependencies: expo-router/doctor.js not found.`);\n debug('expo-router/doctor error:', error);\n }\n }\n\n if (!dependencies.length) {\n Log.exit(chalk.greenBright('Dependencies are up to date'), 0);\n }\n\n logIncorrectDependencies(dependencies);\n\n const value =\n // If `--fix` then always fix.\n fix ||\n // Otherwise prompt to fix when not running in CI.\n (isInteractive() && (await confirmAsync({ message: 'Fix dependencies?' }).catch(() => false)));\n\n if (value) {\n debug('Installing fixed dependencies:', dependencies);\n // Install the corrected dependencies.\n return fixPackagesAsync(projectRoot, {\n packageManager,\n packages: dependencies,\n packageManagerArguments,\n sdkVersion: exp.sdkVersion!,\n });\n }\n\n // Exit with non-zero exit code if any of the dependencies are out of date.\n Log.exit(chalk.red('Found outdated dependencies'), 1);\n}\n"],"names":["checkPackagesAsync","debug","require","projectRoot","packages","packageManager","options","fix","packageManagerArguments","pkg","exp","getConfig","skipPlugins","expo","install","exclude","length","Log","log","chalk","joinWithCommasAnd","learnMore","dependencies","getVersionedDependenciesAsync","doctor","routerDoctor","push","resolve","bold","error","exit","greenBright","logIncorrectDependencies","value","isInteractive","confirmAsync","message","catch","fixPackagesAsync","sdkVersion","red"],"mappings":"AAAA;;;;+BAwBsBA,oBAAkB;;aAAlBA,kBAAkB;;;yBAxBd,cAAc;;;;;;;8DAEtB,OAAO;;;;;;6BAEQ,eAAe;2DAE3B,QAAQ;8CAItB,2DAA2D;6BACpC,sBAAsB;sBAC1B,eAAe;yBACZ,kBAAkB;yBACb,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEpD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,oBAAoB,CAAC,AAAsB,AAAC;AAQpE,eAAeF,kBAAkB,CACtCG,WAAmB,EACnB,EACEC,QAAQ,CAA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AAC,CAAC,CAAC;AACxD,CAAC"}
@@ -45,11 +45,9 @@ async function startTypescriptTypeGenerationAsync({ metro , projectRoot , server
45
45
  // If typed routes are disabled, remove any files that were added.
46
46
  if (!((ref = exp.experiments) == null ? void 0 : ref.typedRoutes)) {
47
47
  debug("Removing typed routes side-effects (experiments.typedRoutes: false)");
48
- const gitIgnorePath = _path().default.join(projectRoot, ".gitignore");
49
48
  await Promise.all([
50
49
  (0, _tsconfig.forceRemovalTSConfig)(projectRoot),
51
- (0, _expoEnv.removeExpoEnvDTS)(projectRoot),
52
- (0, _mergeGitIgnorePaths.removeFromGitIgnore)(gitIgnorePath, "expo-env.d.ts"),
50
+ (0, _expoEnv.removeExpoEnvDTS)(projectRoot)
53
51
  ]);
54
52
  } else {
55
53
  var ref1;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/server/type-generation/startTypescriptTypeGeneration.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport fs from 'fs/promises';\nimport { Server } from 'metro';\nimport path from 'path';\n\nimport { removeExpoEnvDTS, writeExpoEnvDTS } from './expo-env';\nimport { setupTypedRoutes } from './routes';\nimport { forceRemovalTSConfig, forceUpdateTSConfig } from './tsconfig';\nimport { removeFromGitIgnore, upsertGitIgnoreContents } from '../../../utils/mergeGitIgnorePaths';\nimport { ensureDotExpoProjectDirectoryInitialized } from '../../project/dotExpo';\nimport { ServerLike } from '../BundlerDevServer';\nimport { getRouterDirectoryModuleIdWithManifest } from '../metro/router';\n\nexport interface TypeScriptTypeGenerationOptions {\n server?: ServerLike;\n metro?: Server | null;\n projectRoot: string;\n}\n\nconst debug = require('debug')('expo:typed-routes') as typeof console.log;\n\n/** Setup all requisite features for statically typed routes in Expo Router v2 / SDK +49. */\nexport async function startTypescriptTypeGenerationAsync({\n metro,\n projectRoot,\n server,\n}: TypeScriptTypeGenerationOptions) {\n const { exp } = getConfig(projectRoot);\n\n // If typed routes are disabled, remove any files that were added.\n if (!exp.experiments?.typedRoutes) {\n debug('Removing typed routes side-effects (experiments.typedRoutes: false)');\n const gitIgnorePath = path.join(projectRoot, '.gitignore');\n await Promise.all([\n forceRemovalTSConfig(projectRoot),\n removeExpoEnvDTS(projectRoot),\n removeFromGitIgnore(gitIgnorePath, 'expo-env.d.ts'),\n ]);\n } else {\n const dotExpoDir = ensureDotExpoProjectDirectoryInitialized(projectRoot);\n const typesDirectory = path.resolve(dotExpoDir, './types');\n debug(\n 'Ensuring typed routes side-effects are setup (experiments.typedRoutes: true, typesDirectory: %s)',\n typesDirectory\n );\n\n // Ensure the types directory exists.\n await fs.mkdir(typesDirectory, { recursive: true });\n\n await Promise.all([\n upsertGitIgnoreContents(path.join(projectRoot, '.gitignore'), 'expo-env.d.ts'),\n writeExpoEnvDTS(projectRoot),\n forceUpdateTSConfig(projectRoot),\n setupTypedRoutes({\n metro,\n server,\n typesDirectory,\n projectRoot,\n routerDirectory: path.join(\n projectRoot,\n getRouterDirectoryModuleIdWithManifest(projectRoot, exp)\n ),\n plugin: exp?.extra?.router,\n }),\n ]);\n }\n}\n"],"names":["startTypescriptTypeGenerationAsync","debug","require","metro","projectRoot","server","exp","getConfig","experiments","typedRoutes","gitIgnorePath","path","join","Promise","all","forceRemovalTSConfig","removeExpoEnvDTS","removeFromGitIgnore","dotExpoDir","ensureDotExpoProjectDirectoryInitialized","typesDirectory","resolve","fs","mkdir","recursive","upsertGitIgnoreContents","writeExpoEnvDTS","forceUpdateTSConfig","setupTypedRoutes","routerDirectory","getRouterDirectoryModuleIdWithManifest","plugin","extra","router"],"mappings":"AAAA;;;;+BAsBsBA,oCAAkC;;aAAlCA,kCAAkC;;;yBAtB9B,cAAc;;;;;;;8DACzB,aAAa;;;;;;;8DAEX,MAAM;;;;;;yBAE2B,YAAY;wBAC7B,UAAU;0BACe,YAAY;qCACT,oCAAoC;yBACxC,uBAAuB;wBAEzB,iBAAiB;;;;;;AAQxE,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,mBAAmB,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Ae,CAAC;YAC9EsB,IAAAA,QAAe,gBAAA,EAACtB,WAAW,CAAC;YAC5BuB,IAAAA,SAAmB,oBAAA,EAACvB,WAAW,CAAC;YAChCwB,IAAAA,OAAgB,iBAAA,EAAC;gBACfzB,KAAK;gBACLE,MAAM;gBACNe,cAAc;gBACdhB,WAAW;gBACXyB,eAAe,EAAElB,KAAI,EAAA,QAAA,CAACC,IAAI,CACxBR,WAAW,EACX0B,IAAAA,OAAsC,uCAAA,EAAC1B,WAAW,EAAEE,GAAG,CAAC,CACzD;gBACDyB,MAAM,EAAEzB,GAAG,QAAO,GAAVA,KAAAA,CAAU,GAAVA,CAAAA,IAAU,GAAVA,GAAG,CAAE0B,KAAK,SAAA,GAAV1B,KAAAA,CAAU,GAAVA,IAAU,CAAE2B,MAAM,AAAR;aACnB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
1
+ {"version":3,"sources":["../../../../../src/start/server/type-generation/startTypescriptTypeGeneration.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport fs from 'fs/promises';\nimport { Server } from 'metro';\nimport path from 'path';\n\nimport { removeExpoEnvDTS, writeExpoEnvDTS } from './expo-env';\nimport { setupTypedRoutes } from './routes';\nimport { forceRemovalTSConfig, forceUpdateTSConfig } from './tsconfig';\nimport { upsertGitIgnoreContents } from '../../../utils/mergeGitIgnorePaths';\nimport { ensureDotExpoProjectDirectoryInitialized } from '../../project/dotExpo';\nimport { ServerLike } from '../BundlerDevServer';\nimport { getRouterDirectoryModuleIdWithManifest } from '../metro/router';\n\nexport interface TypeScriptTypeGenerationOptions {\n server?: ServerLike;\n metro?: Server | null;\n projectRoot: string;\n}\n\nconst debug = require('debug')('expo:typed-routes') as typeof console.log;\n\n/** Setup all requisite features for statically typed routes in Expo Router v2 / SDK +49. */\nexport async function startTypescriptTypeGenerationAsync({\n metro,\n projectRoot,\n server,\n}: TypeScriptTypeGenerationOptions) {\n const { exp } = getConfig(projectRoot);\n\n // If typed routes are disabled, remove any files that were added.\n if (!exp.experiments?.typedRoutes) {\n debug('Removing typed routes side-effects (experiments.typedRoutes: false)');\n await Promise.all([forceRemovalTSConfig(projectRoot), removeExpoEnvDTS(projectRoot)]);\n } else {\n const dotExpoDir = ensureDotExpoProjectDirectoryInitialized(projectRoot);\n const typesDirectory = path.resolve(dotExpoDir, './types');\n debug(\n 'Ensuring typed routes side-effects are setup (experiments.typedRoutes: true, typesDirectory: %s)',\n typesDirectory\n );\n\n // Ensure the types directory exists.\n await fs.mkdir(typesDirectory, { recursive: true });\n\n await Promise.all([\n upsertGitIgnoreContents(path.join(projectRoot, '.gitignore'), 'expo-env.d.ts'),\n writeExpoEnvDTS(projectRoot),\n forceUpdateTSConfig(projectRoot),\n setupTypedRoutes({\n metro,\n server,\n typesDirectory,\n projectRoot,\n routerDirectory: path.join(\n projectRoot,\n getRouterDirectoryModuleIdWithManifest(projectRoot, exp)\n ),\n plugin: exp?.extra?.router,\n }),\n ]);\n }\n}\n"],"names":["startTypescriptTypeGenerationAsync","debug","require","metro","projectRoot","server","exp","getConfig","experiments","typedRoutes","Promise","all","forceRemovalTSConfig","removeExpoEnvDTS","dotExpoDir","ensureDotExpoProjectDirectoryInitialized","typesDirectory","path","resolve","fs","mkdir","recursive","upsertGitIgnoreContents","join","writeExpoEnvDTS","forceUpdateTSConfig","setupTypedRoutes","routerDirectory","getRouterDirectoryModuleIdWithManifest","plugin","extra","router"],"mappings":"AAAA;;;;+BAsBsBA,oCAAkC;;aAAlCA,kCAAkC;;;yBAtB9B,cAAc;;;;;;;8DACzB,aAAa;;;;;;;8DAEX,MAAM;;;;;;yBAE2B,YAAY;wBAC7B,UAAU;0BACe,YAAY;qCAC9B,oCAAoC;yBACnB,uBAAuB;wBAEzB,iBAAiB;;;;;;AAQxE,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,mBAAmB,CAAC,AAAsB,AAAC;AAGnE,eAAeF,kCAAkC,CAAC,EACvDG,KAAK,CAAA,EAC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,EAAA,QAAA,CAACM,IAAI,CACxBnB,WAAW,EACXwB,IAAAA,OAAsC,uCAAA,EAACxB,WAAW,EAAEE,GAAG,CAAC,CACzD;gBACDuB,MAAM,EAAEvB,GAAG,QAAO,GAAVA,KAAAA,CAAU,GAAVA,CAAAA,IAAU,GAAVA,GAAG,CAAEwB,KAAK,SAAA,GAAVxB,KAAAA,CAAU,GAAVA,IAAU,CAAEyB,MAAM,AAAR;aACnB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
@@ -31,7 +31,7 @@ class FetchClient {
31
31
  this.headers = {
32
32
  accept: "application/json",
33
33
  "content-type": "application/json",
34
- "user-agent": `expo-cli/${"0.20.4"}`,
34
+ "user-agent": `expo-cli/${"0.20.5"}`,
35
35
  authorization: "Basic " + _nodeBuffer().Buffer.from(`${target}:`).toString("base64")
36
36
  };
37
37
  }
@@ -79,7 +79,7 @@ function createContext() {
79
79
  cpu: summarizeCpuInfo(),
80
80
  app: {
81
81
  name: "expo/cli",
82
- version: "0.20.4"
82
+ version: "0.20.5"
83
83
  },
84
84
  ci: _ciInfo().isCI ? {
85
85
  name: _ciInfo().name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/cli",
3
- "version": "0.20.4",
3
+ "version": "0.20.5",
4
4
  "description": "The Expo CLI",
5
5
  "main": "build/bin/cli",
6
6
  "bin": {
@@ -167,5 +167,5 @@
167
167
  "tree-kill": "^1.2.2",
168
168
  "tsd": "^0.28.1"
169
169
  },
170
- "gitHead": "1f84b4c952ed9785c41ee65c9877e44f1df27af9"
170
+ "gitHead": "024c279602d4a91278c2f243a9cdbba25cf267db"
171
171
  }