@expo/cli 0.22.8 → 0.22.10
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 +1 -1
- package/build/src/api/rest/client.js +2 -0
- package/build/src/api/rest/client.js.map +1 -1
- package/build/src/export/embed/exportEmbedAsync.js +3 -3
- package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
- package/build/src/export/embed/exportServer.js +13 -9
- package/build/src/export/embed/exportServer.js.map +1 -1
- package/build/src/export/embed/index.js +4 -0
- package/build/src/export/embed/index.js.map +1 -1
- package/build/src/export/embed/resolveOptions.js +2 -1
- package/build/src/export/embed/resolveOptions.js.map +1 -1
- package/build/src/export/embed/xcodeCompilerLogger.js +1 -0
- package/build/src/export/embed/xcodeCompilerLogger.js.map +1 -1
- package/build/src/export/exportApp.js +27 -12
- package/build/src/export/exportApp.js.map +1 -1
- package/build/src/export/exportStaticAsync.js +18 -2
- package/build/src/export/exportStaticAsync.js.map +1 -1
- package/build/src/export/publicFolder.js +6 -1
- package/build/src/export/publicFolder.js.map +1 -1
- package/build/src/export/saveAssets.js +1 -1
- package/build/src/export/saveAssets.js.map +1 -1
- package/build/src/install/index.js +1 -0
- package/build/src/install/index.js.map +1 -1
- package/build/src/install/installAsync.js +2 -1
- package/build/src/install/installAsync.js.map +1 -1
- package/build/src/install/installExpoPackage.js +14 -6
- package/build/src/install/installExpoPackage.js.map +1 -1
- package/build/src/install/resolveOptions.js +2 -0
- package/build/src/install/resolveOptions.js.map +1 -1
- package/build/src/serve/serveAsync.js +4 -2
- package/build/src/serve/serveAsync.js.map +1 -1
- package/build/src/start/doctor/dependencies/getVersionedPackages.js +4 -0
- package/build/src/start/doctor/dependencies/getVersionedPackages.js.map +1 -1
- package/build/src/start/server/getStaticRenderFunctions.js +2 -1
- package/build/src/start/server/getStaticRenderFunctions.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +105 -55
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/createJResolver.js +15 -5
- package/build/src/start/server/metro/createJResolver.js.map +1 -1
- package/build/src/start/server/metro/createServerComponentsMiddleware.js +28 -4
- package/build/src/start/server/metro/createServerComponentsMiddleware.js.map +1 -1
- package/build/src/start/server/metro/metroErrorInterface.js +5 -1
- package/build/src/start/server/metro/metroErrorInterface.js.map +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js +2 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
- package/build/src/start/server/middleware/ManifestMiddleware.js +6 -3
- package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/metroOptions.js +1 -1
- package/build/src/start/server/middleware/metroOptions.js.map +1 -1
- package/build/src/start/startAsync.js +1 -1
- package/build/src/start/startAsync.js.map +1 -1
- package/build/src/utils/env.js +9 -0
- package/build/src/utils/env.js.map +1 -1
- package/build/src/utils/ip.js +8 -1
- package/build/src/utils/ip.js.map +1 -1
- package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
- package/build/src/utils/telemetry/utils/context.js +1 -1
- package/package.json +16 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/install/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../utils/args';\n\nexport const expoInstall: Command = async (argv) => {\n const args = assertWithOptionsArgs(\n {\n // Other options are parsed manually.\n '--help': Boolean,\n // Aliases\n '-h': '--help',\n },\n {\n argv,\n // Allow other options, we'll throw an error if unexpected values are passed.\n permissive: true,\n }\n );\n\n if (args['--help']) {\n printHelp(\n `Install a module or other package to a project`,\n `npx expo install`,\n [\n `--check Check which installed packages need to be updated`,\n `--fix Automatically update any invalid package versions`,\n chalk`--npm Use npm to install dependencies. {dim Default when package-lock.json exists}`,\n chalk`--yarn Use Yarn to install dependencies. {dim Default when yarn.lock exists}`,\n chalk`--bun Use bun to install dependencies. {dim Default when bun.lock or bun.lockb exists}`,\n chalk`--pnpm Use pnpm to install dependencies. {dim Default when pnpm-lock.yaml exists}`,\n `-h, --help Usage info`,\n ].join('\\n'),\n [\n '',\n chalk` Additional options can be passed to the underlying install command by using {bold --}`,\n chalk` {dim $} npx expo install react -- --verbose`,\n chalk` {dim >} yarn add react --verbose`,\n '',\n ].join('\\n')\n );\n }\n\n // Load modules after the help prompt so `npx expo install -h` shows as fast as possible.\n const { installAsync } = require('./installAsync') as typeof import('./installAsync');\n const { logCmdError } = require('../utils/errors') as typeof import('../utils/errors');\n const { resolveArgsAsync } = require('./resolveOptions') as typeof import('./resolveOptions');\n\n const { variadic, options, extras } = await resolveArgsAsync(process.argv.slice(3)).catch(\n logCmdError\n );\n return installAsync(variadic, options, extras).catch(logCmdError);\n};\n"],"names":["expoInstall","argv","args","assertWithOptionsArgs","Boolean","permissive","printHelp","chalk","join","installAsync","require","logCmdError","resolveArgsAsync","variadic","options","extras","process","slice","catch"],"mappings":"AAAA;;;;;+BAMaA,aAAW;;aAAXA,WAAW;;;8DALN,OAAO;;;;;;sBAGwB,eAAe;;;;;;AAEzD,MAAMA,WAAW,GAAY,OAAOC,IAAI,GAAK;IAClD,MAAMC,IAAI,GAAGC,IAAAA,KAAqB,sBAAA,EAChC;QACE,qCAAqC;QACrC,QAAQ,EAAEC,OAAO;QACjB,UAAU;QACV,IAAI,EAAE,QAAQ;KACf,EACD;QACEH,IAAI;QACJ,6EAA6E;QAC7EI,UAAU,EAAE,IAAI;KACjB,CACF,AAAC;IAEF,IAAIH,IAAI,CAAC,QAAQ,CAAC,EAAE;QAClBI,IAAAA,KAAS,UAAA,EACP,CAAC,8CAA8C,CAAC,EAChD,CAAC,gBAAgB,CAAC,EAClB;YACE,CAAC,6DAA6D,CAAC;YAC/D,CAAC,6DAA6D,CAAC;YAC/DC,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,wFAAwF,CAAC;YAC/FA,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,iFAAiF,CAAC;YACxFA,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,4FAA4F,CAAC;YACnGA,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,sFAAsF,CAAC;YAC7F,CAAC,sBAAsB,CAAC;SACzB,CAACC,IAAI,CAAC,IAAI,CAAC,EACZ;YACE,EAAE;YACFD,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,uFAAuF,CAAC;YAC9FA,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,+CAA+C,CAAC;YACtDA,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,oCAAoC,CAAC;YAC3C,EAAE;SACH,CAACC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IACJ,CAAC;IAED,yFAAyF;IACzF,MAAM,EAAEC,YAAY,CAAA,EAAE,GAAGC,OAAO,CAAC,gBAAgB,CAAC,AAAmC,AAAC;IACtF,MAAM,EAAEC,WAAW,CAAA,EAAE,GAAGD,OAAO,CAAC,iBAAiB,CAAC,AAAoC,AAAC;IACvF,MAAM,EAAEE,gBAAgB,CAAA,EAAE,GAAGF,OAAO,CAAC,kBAAkB,CAAC,AAAqC,AAAC;IAE9F,MAAM,EAAEG,QAAQ,CAAA,EAAEC,OAAO,CAAA,EAAEC,MAAM,CAAA,EAAE,GAAG,MAAMH,gBAAgB,CAACI,OAAO,CAACf,IAAI,CAACgB,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,KAAK,CACvFP,WAAW,CACZ,AAAC;IACF,OAAOF,YAAY,CAACI,QAAQ,EAAEC,OAAO,EAAEC,MAAM,CAAC,CAACG,KAAK,CAACP,WAAW,CAAC,CAAC;AACpE,CAAC,AAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/install/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../utils/args';\n\nexport const expoInstall: Command = async (argv) => {\n const args = assertWithOptionsArgs(\n {\n // Other options are parsed manually.\n '--help': Boolean,\n // Aliases\n '-h': '--help',\n },\n {\n argv,\n // Allow other options, we'll throw an error if unexpected values are passed.\n permissive: true,\n }\n );\n\n if (args['--help']) {\n printHelp(\n `Install a module or other package to a project`,\n `npx expo install`,\n [\n `--check Check which installed packages need to be updated`,\n '--dev Save the dependencies as devDependencies',\n `--fix Automatically update any invalid package versions`,\n chalk`--npm Use npm to install dependencies. {dim Default when package-lock.json exists}`,\n chalk`--yarn Use Yarn to install dependencies. {dim Default when yarn.lock exists}`,\n chalk`--bun Use bun to install dependencies. {dim Default when bun.lock or bun.lockb exists}`,\n chalk`--pnpm Use pnpm to install dependencies. {dim Default when pnpm-lock.yaml exists}`,\n `-h, --help Usage info`,\n ].join('\\n'),\n [\n '',\n chalk` Additional options can be passed to the underlying install command by using {bold --}`,\n chalk` {dim $} npx expo install react -- --verbose`,\n chalk` {dim >} yarn add react --verbose`,\n '',\n ].join('\\n')\n );\n }\n\n // Load modules after the help prompt so `npx expo install -h` shows as fast as possible.\n const { installAsync } = require('./installAsync') as typeof import('./installAsync');\n const { logCmdError } = require('../utils/errors') as typeof import('../utils/errors');\n const { resolveArgsAsync } = require('./resolveOptions') as typeof import('./resolveOptions');\n\n const { variadic, options, extras } = await resolveArgsAsync(process.argv.slice(3)).catch(\n logCmdError\n );\n return installAsync(variadic, options, extras).catch(logCmdError);\n};\n"],"names":["expoInstall","argv","args","assertWithOptionsArgs","Boolean","permissive","printHelp","chalk","join","installAsync","require","logCmdError","resolveArgsAsync","variadic","options","extras","process","slice","catch"],"mappings":"AAAA;;;;;+BAMaA,aAAW;;aAAXA,WAAW;;;8DALN,OAAO;;;;;;sBAGwB,eAAe;;;;;;AAEzD,MAAMA,WAAW,GAAY,OAAOC,IAAI,GAAK;IAClD,MAAMC,IAAI,GAAGC,IAAAA,KAAqB,sBAAA,EAChC;QACE,qCAAqC;QACrC,QAAQ,EAAEC,OAAO;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AAMH,gBAAgB,CAACI,OAAO,CAACf,IAAI,CAACgB,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,KAAK,CACvFP,WAAW,CACZ,AAAC;IACF,OAAOF,YAAY,CAACI,QAAQ,EAAEC,OAAO,EAAEC,MAAM,CAAC,CAACG,KAAK,CAACP,WAAW,CAAC,CAAC;AACpE,CAAC,AAAC"}
|
|
@@ -39,6 +39,7 @@ const _installExpoPackage = require("./installExpoPackage");
|
|
|
39
39
|
const _log = /*#__PURE__*/ _interopRequireWildcard(require("../log"));
|
|
40
40
|
const _checkPackagesCompatibility = require("./utils/checkPackagesCompatibility");
|
|
41
41
|
const _getVersionedPackages = require("../start/doctor/dependencies/getVersionedPackages");
|
|
42
|
+
const _env = require("../utils/env");
|
|
42
43
|
const _errors = require("../utils/errors");
|
|
43
44
|
const _findUp = require("../utils/findUp");
|
|
44
45
|
const _link = require("../utils/link");
|
|
@@ -119,7 +120,7 @@ async function installAsync(packages, options, packageManagerArguments = []) {
|
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
122
|
// note(simek): check out the packages compatibility with New Architecture against RND API
|
|
122
|
-
if (!
|
|
123
|
+
if (!_env.env.EXPO_NO_DEPENDENCY_VALIDATION && !_env.env.EXPO_NO_NEW_ARCH_COMPAT_CHECK) {
|
|
123
124
|
await (0, _checkPackagesCompatibility.checkPackagesCompatibility)(otherPackages);
|
|
124
125
|
}
|
|
125
126
|
// Read the project Expo config without plugins.
|
|
@@ -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 { 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 (!process.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.includes('@');\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_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","includes"],"mappings":"AAAA;;;;;;;;;;;IA0BsBA,YAAY,MAAZA,YAAY;IAiEZC,oBAAoB,MAApBA,oBAAoB;;;yBA3FA,cAAc;;;;;;;+DACxB,uBAAuB;;;;;;;8DACrC,OAAO;;;;;;8BAES,gBAAgB;+BACf,iBAAiB;oCACZ,sBAAsB;2DAEzC,QAAQ;4CACc,oCAAoC;sCACrC,mDAAmD;wBAChE,iBAAiB;wBACJ,iBAAiB;sBACjC,eAAe;yBACd,kBAAkB;yBACX,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAW7C,eAAeD,YAAY,CAChCE,QAAkB,EAClBC,OAA2C,EAC3CC,uBAAiC,GAAG,EAAE,EACtC;IACAC,IAAAA,QAAU,WAAA,EAAC,aAAa,CAAC,CAAC;IAC1B,0EAA0E;IAC1E,mFAAmF;IACnF,MAAMC,WAAW,GAAGH,CAAAA,OAAO,QAAa,GAApBA,KAAAA,CAAoB,GAApBA,OAAO,CAAEG,WAAW,CAAA,IAAIC,IAAAA,OAAyB,0BAAA,EAACC,OAAO,CAACC,GAAG,EAAE,CAAC,AAAC;IACrFC,OAAO,CAAC,WAAW,CAAC,CAACC,IAAI,CAACL,WAAW,CAAC,CAAC;IAEvC,uFAAuF;IACvF,MAAMM,cAAc,GAAGC,eAAc,EAAA,CAACC,gBAAgB,CAACR,WAAW,EAAE;QAClES,GAAG,EAAE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IACpC,OAAOA,IAAI,CAACsB,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC"}
|
|
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.includes('@');\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","includes"],"mappings":"AAAA;;;;;;;;;;;IA2BsBA,YAAY,MAAZA,YAAY;IAiEZC,oBAAoB,MAApBA,oBAAoB;;;yBA5FA,cAAc;;;;;;;+DACxB,uBAAuB;;;;;;;8DACrC,OAAO;;;;;;8BAES,gBAAgB;+BACf,iBAAiB;oCACZ,sBAAsB;2DAEzC,QAAQ;4CACc,oCAAoC;sCACrC,mDAAmD;qBACzE,cAAc;wBACL,iBAAiB;wBACJ,iBAAiB;sBACjC,eAAe;yBACd,kBAAkB;yBACX,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAW7C,eAAeD,YAAY,CAChCE,QAAkB,E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AAC;eAAIhE,uBAAuB;eAAKuC,UAAU,CAACzC,QAAQ;SAAC,CAAC,CAAC;IACtF,CAAC;IAED,MAAMmE,IAAAA,aAAiB,kBAAA,EAAC/D,WAAW,EAAEqC,UAAU,CAACzC,QAAQ,CAAC,CAAC;AAC5D,CAAC;AAED,gGAAgG,GAChG,SAASqB,iBAAiB,CAACrB,QAAkB,EAAE8C,IAAY,EAAE;IAC3D,OAAO9C,QAAQ,CAAC8D,IAAI,CAAC,CAACtC,GAAG,GAAKA,GAAG,KAAKsB,IAAI,IAAItB,GAAG,CAACuC,UAAU,CAAC,CAAC,EAAEjB,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,+DAA+D,GAC/D,SAASrB,iBAAiB,CAACqB,IAAI,GAAG,EAAE,EAAE;IACpC,OAAOA,IAAI,CAACsB,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -66,7 +66,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
66
66
|
}
|
|
67
67
|
return newObj;
|
|
68
68
|
}
|
|
69
|
-
async function installExpoPackageAsync(projectRoot, { packageManager , packageManagerArguments , expoPackageToInstall , followUpCommandArgs }) {
|
|
69
|
+
async function installExpoPackageAsync(projectRoot, { packageManager , packageManagerArguments , expoPackageToInstall , followUpCommandArgs , dev }) {
|
|
70
70
|
// Check if there's potentially a dev server running in the current folder and warn about it
|
|
71
71
|
// (not guaranteed to be Expo CLI, and the CLI isn't always running on 8081, but it's a good guess)
|
|
72
72
|
const isExpoMaybeRunningForProject = !!await (0, _getRunningProcess.getRunningProcess)(8081);
|
|
@@ -75,10 +75,17 @@ async function installExpoPackageAsync(projectRoot, { packageManager , packageMa
|
|
|
75
75
|
}
|
|
76
76
|
// Safe to use current process to upgrade Expo package- doesn't affect current process
|
|
77
77
|
try {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
if (dev) {
|
|
79
|
+
await packageManager.addDevAsync([
|
|
80
|
+
...packageManagerArguments,
|
|
81
|
+
expoPackageToInstall
|
|
82
|
+
]);
|
|
83
|
+
} else {
|
|
84
|
+
await packageManager.addAsync([
|
|
85
|
+
...packageManagerArguments,
|
|
86
|
+
expoPackageToInstall
|
|
87
|
+
]);
|
|
88
|
+
}
|
|
82
89
|
} catch (error) {
|
|
83
90
|
_log.error((0, _chalk().default)`Cannot install the latest Expo package. Install {bold expo@latest} with ${packageManager.name} and then run {bold npx expo install} again.`);
|
|
84
91
|
throw error;
|
|
@@ -88,8 +95,9 @@ async function installExpoPackageAsync(projectRoot, { packageManager , packageMa
|
|
|
88
95
|
let commandSegments = [
|
|
89
96
|
"expo",
|
|
90
97
|
"install",
|
|
98
|
+
dev ? "--dev" : "",
|
|
91
99
|
...followUpCommandArgs
|
|
92
|
-
];
|
|
100
|
+
].filter(Boolean);
|
|
93
101
|
if (packageManagerArguments.length) {
|
|
94
102
|
commandSegments = [
|
|
95
103
|
...commandSegments,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/install/installExpoPackage.ts"],"sourcesContent":["import * as PackageManager from '@expo/package-manager';\nimport spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\n\nimport * as Log from '../log';\nimport { getRunningProcess } from '../utils/getRunningProcess';\n\n/**\n * Given a list of incompatible packages, installs the correct versions of the packages with the package manager used for the project.\n * This exits immediately after spawning the install command, since the command shouldn't remain running while it is being updated.\n */\nexport async function installExpoPackageAsync(\n projectRoot: string,\n {\n packageManager,\n packageManagerArguments,\n expoPackageToInstall,\n followUpCommandArgs,\n }: {\n /** Package manager to use when installing the versioned packages. */\n packageManager: PackageManager.NodePackageManager;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n expoPackageToInstall: string;\n followUpCommandArgs: string[];\n }\n) {\n // Check if there's potentially a dev server running in the current folder and warn about it\n // (not guaranteed to be Expo CLI, and the CLI isn't always running on 8081, but it's a good guess)\n const isExpoMaybeRunningForProject = !!(await getRunningProcess(8081));\n\n if (isExpoMaybeRunningForProject) {\n Log.warn(\n 'The Expo CLI appears to be running this project in another terminal window. Close and restart any Expo CLI instances after the installation to complete the update.'\n );\n }\n\n // Safe to use current process to upgrade Expo package- doesn't affect current process\n try {\n await packageManager.addAsync([...packageManagerArguments, expoPackageToInstall]);\n } catch (error) {\n Log.error(\n chalk`Cannot install the latest Expo package. Install {bold expo@latest} with ${packageManager.name} and then run {bold npx expo install} again.`\n );\n throw error;\n }\n\n // Spawn a new process to install the rest of the packages if there are any, as only then will the latest Expo package be used\n if (followUpCommandArgs.length) {\n let commandSegments = ['expo', 'install', ...followUpCommandArgs];\n if (packageManagerArguments.length) {\n commandSegments = [...commandSegments, '--', ...packageManagerArguments];\n }\n\n Log.log(chalk`\\u203A Running {bold npx expo install} under the updated expo version`);\n Log.log('> ' + commandSegments.join(' '));\n\n await spawnAsync('npx', commandSegments, {\n stdio: 'inherit',\n cwd: projectRoot,\n env: { ...process.env },\n });\n }\n}\n"],"names":["installExpoPackageAsync","projectRoot","packageManager","packageManagerArguments","expoPackageToInstall","followUpCommandArgs","isExpoMaybeRunningForProject","getRunningProcess","Log","warn","addAsync","error","chalk","name","length","commandSegments","log","join","spawnAsync","stdio","cwd","env","process"],"mappings":"AAAA;;;;+
|
|
1
|
+
{"version":3,"sources":["../../../src/install/installExpoPackage.ts"],"sourcesContent":["import * as PackageManager from '@expo/package-manager';\nimport spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\n\nimport * as Log from '../log';\nimport type { Options } from './resolveOptions';\nimport { getRunningProcess } from '../utils/getRunningProcess';\n\n/**\n * Given a list of incompatible packages, installs the correct versions of the packages with the package manager used for the project.\n * This exits immediately after spawning the install command, since the command shouldn't remain running while it is being updated.\n */\nexport async function installExpoPackageAsync(\n projectRoot: string,\n {\n packageManager,\n packageManagerArguments,\n expoPackageToInstall,\n followUpCommandArgs,\n dev,\n }: Pick<Options, 'dev'> & {\n /** Package manager to use when installing the versioned packages. */\n packageManager: PackageManager.NodePackageManager;\n /**\n * Extra parameters to pass to the `packageManager` when installing versioned packages.\n * @example ['--no-save']\n */\n packageManagerArguments: string[];\n expoPackageToInstall: string;\n followUpCommandArgs: string[];\n }\n) {\n // Check if there's potentially a dev server running in the current folder and warn about it\n // (not guaranteed to be Expo CLI, and the CLI isn't always running on 8081, but it's a good guess)\n const isExpoMaybeRunningForProject = !!(await getRunningProcess(8081));\n\n if (isExpoMaybeRunningForProject) {\n Log.warn(\n 'The Expo CLI appears to be running this project in another terminal window. Close and restart any Expo CLI instances after the installation to complete the update.'\n );\n }\n\n // Safe to use current process to upgrade Expo package- doesn't affect current process\n try {\n if (dev) {\n await packageManager.addDevAsync([...packageManagerArguments, expoPackageToInstall]);\n } else {\n await packageManager.addAsync([...packageManagerArguments, expoPackageToInstall]);\n }\n } catch (error) {\n Log.error(\n chalk`Cannot install the latest Expo package. Install {bold expo@latest} with ${packageManager.name} and then run {bold npx expo install} again.`\n );\n throw error;\n }\n\n // Spawn a new process to install the rest of the packages if there are any, as only then will the latest Expo package be used\n if (followUpCommandArgs.length) {\n let commandSegments = ['expo', 'install', dev ? '--dev' : '', ...followUpCommandArgs].filter(\n Boolean\n );\n if (packageManagerArguments.length) {\n commandSegments = [...commandSegments, '--', ...packageManagerArguments];\n }\n\n Log.log(chalk`\\u203A Running {bold npx expo install} under the updated expo version`);\n Log.log('> ' + commandSegments.join(' '));\n\n await spawnAsync('npx', commandSegments, {\n stdio: 'inherit',\n cwd: projectRoot,\n env: { ...process.env },\n });\n }\n}\n"],"names":["installExpoPackageAsync","projectRoot","packageManager","packageManagerArguments","expoPackageToInstall","followUpCommandArgs","dev","isExpoMaybeRunningForProject","getRunningProcess","Log","warn","addDevAsync","addAsync","error","chalk","name","length","commandSegments","filter","Boolean","log","join","spawnAsync","stdio","cwd","env","process"],"mappings":"AAAA;;;;+BAYsBA,yBAAuB;;aAAvBA,u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AIA,eAAe;gBAAE,IAAI;mBAAKd,uBAAuB;aAAC,CAAC;QAC3E,CAAC;QAEDM,IAAG,CAACW,GAAG,CAACN,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,qEAAqE,CAAC,CAAC,CAAC;QACtFL,IAAG,CAACW,GAAG,CAAC,IAAI,GAAGH,eAAe,CAACI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAE1C,MAAMC,IAAAA,WAAU,EAAA,QAAA,EAAC,KAAK,EAAEL,eAAe,EAAE;YACvCM,KAAK,EAAE,SAAS;YAChBC,GAAG,EAAEvB,WAAW;YAChBwB,GAAG,EAAE;gBAAE,GAAGC,OAAO,CAACD,GAAG;aAAE;SACxB,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -28,6 +28,7 @@ async function resolveArgsAsync(argv) {
|
|
|
28
28
|
const { variadic , extras , flags } = (0, _variadic.parseVariadicArguments)(argv);
|
|
29
29
|
(0, _variadic.assertUnexpectedVariadicFlags)([
|
|
30
30
|
"--check",
|
|
31
|
+
"--dev",
|
|
31
32
|
"--fix",
|
|
32
33
|
"--npm",
|
|
33
34
|
"--pnpm",
|
|
@@ -43,6 +44,7 @@ async function resolveArgsAsync(argv) {
|
|
|
43
44
|
variadic,
|
|
44
45
|
options: resolveOptions({
|
|
45
46
|
fix: !!flags["--fix"],
|
|
47
|
+
dev: !!flags["--dev"],
|
|
46
48
|
check: !!flags["--check"],
|
|
47
49
|
yarn: !!flags["--yarn"],
|
|
48
50
|
npm: !!flags["--npm"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/install/resolveOptions.ts"],"sourcesContent":["import { NodePackageManagerForProject } from '@expo/package-manager';\n\nimport { CommandError } from '../utils/errors';\nimport { assertUnexpectedVariadicFlags, parseVariadicArguments } from '../utils/variadic';\n\nexport type Options = Pick<NodePackageManagerForProject, 'npm' | 'pnpm' | 'yarn' | 'bun'> & {\n /** Check which packages need to be updated, does not install any provided packages. */\n check?: boolean;\n /** Should the dependencies be fixed automatically. */\n fix?: boolean;\n /** Should disable install output, used for commands like `prebuild` that run install internally. */\n silent?: boolean;\n /** Should be installed as dev dependencies */\n dev?: boolean;\n};\n\nfunction resolveOptions(options: Options): Options {\n if (options.fix && options.check) {\n throw new CommandError('BAD_ARGS', 'Specify at most one of: --check, --fix');\n }\n if ([options.npm, options.pnpm, options.yarn, options.bun].filter(Boolean).length > 1) {\n throw new CommandError('BAD_ARGS', 'Specify at most one of: --npm, --pnpm, --yarn, --bun');\n }\n return {\n ...options,\n };\n}\n\nexport async function resolveArgsAsync(\n argv: string[]\n): Promise<{ variadic: string[]; options: Options; extras: string[] }> {\n const { variadic, extras, flags } = parseVariadicArguments(argv);\n\n assertUnexpectedVariadicFlags(\n ['--check', '--fix', '--npm', '--pnpm', '--yarn', '--bun'],\n { variadic, extras, flags },\n 'npx expo install'\n );\n\n return {\n // Variadic arguments like `npx expo install react react-dom` -> ['react', 'react-dom']\n variadic,\n options: resolveOptions({\n fix: !!flags['--fix'],\n check: !!flags['--check'],\n yarn: !!flags['--yarn'],\n npm: !!flags['--npm'],\n pnpm: !!flags['--pnpm'],\n bun: !!flags['--bun'],\n }),\n extras,\n };\n}\n"],"names":["resolveArgsAsync","resolveOptions","options","fix","check","CommandError","npm","pnpm","yarn","bun","filter","Boolean","length","argv","variadic","extras","flags","parseVariadicArguments","assertUnexpectedVariadicFlags"],"mappings":"AAAA;;;;+BA4BsBA,kBAAgB;;aAAhBA,gBAAgB;;wBA1BT,iBAAiB;0BACwB,mBAAmB;AAazF,SAASC,cAAc,CAACC,OAAgB,EAAW;IACjD,IAAIA,OAAO,CAACC,GAAG,IAAID,OAAO,CAACE,KAAK,EAAE;QAChC,MAAM,IAAIC,OAAY,aAAA,CAAC,UAAU,EAAE,wCAAwC,CAAC,CAAC;IAC/E,CAAC;IACD,IAAI;QAACH,OAAO,CAACI,GAAG;QAAEJ,OAAO,CAACK,IAAI;QAAEL,OAAO,CAACM,IAAI;QAAEN,OAAO,CAACO,GAAG;KAAC,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,MAAM,GAAG,CAAC,EAAE;QACrF,MAAM,IAAIP,OAAY,aAAA,CAAC,UAAU,EAAE,sDAAsD,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO;QACL,GAAGH,OAAO;KACX,CAAC;AACJ,CAAC;AAEM,eAAeF,gBAAgB,CACpCa,IAAc,EACuD;IACrE,MAAM,EAAEC,QAAQ,CAAA,EAAEC,MAAM,CAAA,EAAEC,KAAK,CAAA,EAAE,GAAGC,IAAAA,SAAsB,uBAAA,EAACJ,IAAI,CAAC,AAAC;IAEjEK,IAAAA,SAA6B,8BAAA,EAC3B;QAAC,SAAS;QAAE,OAAO;QAAE,OAAO;QAAE,QAAQ;QAAE,QAAQ;QAAE,OAAO;KAAC,
|
|
1
|
+
{"version":3,"sources":["../../../src/install/resolveOptions.ts"],"sourcesContent":["import { NodePackageManagerForProject } from '@expo/package-manager';\n\nimport { CommandError } from '../utils/errors';\nimport { assertUnexpectedVariadicFlags, parseVariadicArguments } from '../utils/variadic';\n\nexport type Options = Pick<NodePackageManagerForProject, 'npm' | 'pnpm' | 'yarn' | 'bun'> & {\n /** Check which packages need to be updated, does not install any provided packages. */\n check?: boolean;\n /** Should the dependencies be fixed automatically. */\n fix?: boolean;\n /** Should disable install output, used for commands like `prebuild` that run install internally. */\n silent?: boolean;\n /** Should be installed as dev dependencies */\n dev?: boolean;\n};\n\nfunction resolveOptions(options: Options): Options {\n if (options.fix && options.check) {\n throw new CommandError('BAD_ARGS', 'Specify at most one of: --check, --fix');\n }\n if ([options.npm, options.pnpm, options.yarn, options.bun].filter(Boolean).length > 1) {\n throw new CommandError('BAD_ARGS', 'Specify at most one of: --npm, --pnpm, --yarn, --bun');\n }\n return {\n ...options,\n };\n}\n\nexport async function resolveArgsAsync(\n argv: string[]\n): Promise<{ variadic: string[]; options: Options; extras: string[] }> {\n const { variadic, extras, flags } = parseVariadicArguments(argv);\n\n assertUnexpectedVariadicFlags(\n ['--check', '--dev', '--fix', '--npm', '--pnpm', '--yarn', '--bun'],\n { variadic, extras, flags },\n 'npx expo install'\n );\n\n return {\n // Variadic arguments like `npx expo install react react-dom` -> ['react', 'react-dom']\n variadic,\n options: resolveOptions({\n fix: !!flags['--fix'],\n dev: !!flags['--dev'],\n check: !!flags['--check'],\n yarn: !!flags['--yarn'],\n npm: !!flags['--npm'],\n pnpm: !!flags['--pnpm'],\n bun: !!flags['--bun'],\n }),\n extras,\n };\n}\n"],"names":["resolveArgsAsync","resolveOptions","options","fix","check","CommandError","npm","pnpm","yarn","bun","filter","Boolean","length","argv","variadic","extras","flags","parseVariadicArguments","assertUnexpectedVariadicFlags","dev"],"mappings":"AAAA;;;;+BA4BsBA,kBAAgB;;aAAhBA,gBAAgB;;wBA1BT,iBAAiB;0BACwB,mBAAmB;AAazF,SAASC,cAAc,CAACC,OAAgB,EAAW;IACjD,IAAIA,OAAO,CAACC,GAAG,IAAID,OAAO,CAACE,KAAK,EAAE;QAChC,MAAM,IAAIC,OAAY,aAAA,CAAC,UAAU,EAAE,wCAAwC,CAAC,CAAC;IAC/E,CAAC;IACD,IAAI;QAACH,OAAO,CAACI,GAAG;QAAEJ,OAAO,CAACK,IAAI;QAAEL,OAAO,CAACM,IAAI;QAAEN,OAAO,CAACO,GAAG;KAAC,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,MAAM,GAAG,CAAC,EAAE;QACrF,MAAM,IAAIP,OAAY,aAAA,CAAC,UAAU,EAAE,sDAAsD,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO;QACL,GAAGH,OAAO;KACX,CAAC;AACJ,CAAC;AAEM,eAAeF,gBAAgB,CACpCa,IAAc,EACuD;IACrE,MAAM,EAAEC,QAAQ,CAAA,EAAEC,MAAM,CAAA,EAAEC,KAAK,CAAA,EAAE,GAAGC,IAAAA,SAAsB,uBAAA,EAACJ,IAAI,CAAC,AAAC;IAEjEK,IAAAA,SAA6B,8BAAA,EAC3B;QAAC,SAAS;QAAE,OAAO;QAAE,OAAO;QAAE,OAAO;QAAE,QAAQ;QAAE,QAAQ;QAAE,OAAO;KAAC,EACnE;QAAEJ,QAAQ;QAAEC,MAAM;QAAEC,KAAK;KAAE,EAC3B,kBAAkB,CACnB,CAAC;IAEF,OAAO;QACL,uFAAuF;QACvFF,QAAQ;QACRZ,OAAO,EAAED,cAAc,CAAC;YACtBE,GAAG,EAAE,CAAC,CAACa,KAAK,CAAC,OAAO,CAAC;YACrBG,GAAG,EAAE,CAAC,CAACH,KAAK,CAAC,OAAO,CAAC;YACrBZ,KAAK,EAAE,CAAC,CAACY,KAAK,CAAC,SAAS,CAAC;YACzBR,IAAI,EAAE,CAAC,CAACQ,KAAK,CAAC,QAAQ,CAAC;YACvBV,GAAG,EAAE,CAAC,CAACU,KAAK,CAAC,OAAO,CAAC;YACrBT,IAAI,EAAE,CAAC,CAACS,KAAK,CAAC,QAAQ,CAAC;YACvBP,GAAG,EAAE,CAAC,CAACO,KAAK,CAAC,OAAO,CAAC;SACtB,CAAC;QACFD,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -51,6 +51,7 @@ function _send() {
|
|
|
51
51
|
const _log = /*#__PURE__*/ _interopRequireWildcard(require("../log"));
|
|
52
52
|
const _dir = require("../utils/dir");
|
|
53
53
|
const _errors = require("../utils/errors");
|
|
54
|
+
const _findUp = require("../utils/findUp");
|
|
54
55
|
const _nodeEnv = require("../utils/nodeEnv");
|
|
55
56
|
const _port = require("../utils/port");
|
|
56
57
|
function _interopRequireDefault(obj) {
|
|
@@ -98,7 +99,8 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
98
99
|
return newObj;
|
|
99
100
|
}
|
|
100
101
|
const debug = require("debug")("expo:serve");
|
|
101
|
-
async function serveAsync(
|
|
102
|
+
async function serveAsync(inputDir, options) {
|
|
103
|
+
const projectRoot = (0, _findUp.findUpProjectRootOrAssert)(inputDir);
|
|
102
104
|
(0, _nodeEnv.setNodeEnv)("production");
|
|
103
105
|
require("@expo/env").load(projectRoot);
|
|
104
106
|
const port = await (0, _port.resolvePortAsync)(projectRoot, {
|
|
@@ -109,7 +111,7 @@ async function serveAsync(projectRoot, options) {
|
|
|
109
111
|
throw new _errors.CommandError("Could not start server. Port is not available.");
|
|
110
112
|
}
|
|
111
113
|
options.port = port;
|
|
112
|
-
const serverDist = options.isDefaultDirectory ? _path().default.join(
|
|
114
|
+
const serverDist = options.isDefaultDirectory ? _path().default.join(inputDir, "dist") : inputDir;
|
|
113
115
|
// TODO: `.expo/server/ios`, `.expo/server/android`, etc.
|
|
114
116
|
if (!await (0, _dir.directoryExistsAsync)(serverDist)) {
|
|
115
117
|
throw new _errors.CommandError(`The server directory ${serverDist} does not exist. Run \`npx expo export\` first.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/serve/serveAsync.ts"],"sourcesContent":["import { createRequestHandler } from '@expo/server/build/vendor/http';\nimport chalk from 'chalk';\nimport connect from 'connect';\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 { 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(projectRoot: string, options: Options) {\n setNodeEnv('production');\n require('@expo/env').load(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(projectRoot, 'dist') : projectRoot;\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 })\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","projectRoot","options","setNodeEnv","load","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","on","err","status","statusCode","end","pipe","listen","middleware","connect","staticDirectory","serverDirectory","serverHandler","createRequestHandler","build","use","next","setHeader","method","pathname","canParseURL","URL","stream","extensions","forwardError","onFile","error","routesFile","fileExistsAsync"],"mappings":"AAAA;;;;+BAqBsBA,YAAU;;aAAVA,UAAU;;;yBArBK,gCAAgC;;;;;;;8DACnD,OAAO;;;;;;;8DACL,SAAS;;;;;;;8DACZ,MAAM;;;;;;;8DACN,MAAM;;;;;;;8DACN,MAAM;;;;;;2DAEF,QAAQ;qBACyB,cAAc;wBACvC,iBAAiB;yBACnB,kBAAkB;sBACZ,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOhD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,AAAsB,AAAC;AAG5D,eAAeF,UAAU,CAACG,WAAmB,EAAEC,OAAgB,EAAE;IACtEC,IAAAA,QAAU,WAAA,EAAC,YAAY,CA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C,UAAU,GAAGlD,KAAI,EAAA,QAAA,CAACC,IAAI,CAACU,IAAI,EAAE,CAAC,wBAAwB,CAAC,CAAC,AAAC;IAC/D,OAAO,CAAE,MAAMwC,IAAAA,IAAe,gBAAA,EAACD,UAAU,CAAC,AAAC,CAAC;AAC9C,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/serve/serveAsync.ts"],"sourcesContent":["import { createRequestHandler } from '@expo/server/build/vendor/http';\nimport chalk from 'chalk';\nimport connect from 'connect';\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 require('@expo/env').load(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 })\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","load","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","on","err","status","statusCode","end","pipe","listen","middleware","connect","staticDirectory","serverDirectory","serverHandler","createRequestHandler","build","use","next","setHeader","method","pathname","canParseURL","URL","stream","extensions","forwardError","onFile","error","routesFile","fileExistsAsync"],"mappings":"AAAA;;;;+BAsBsBA,YAAU;;aAAVA,UAAU;;;yBAtBK,gCAAgC;;;;;;;8DACnD,OAAO;;;;;;;8DACL,SAAS;;;;;;;8DACZ,MAAM;;;;;;;8DACN,MAAM;;;;;;;8DACN,MAAM;;;;;;2DAEF,QAAQ;qBACyB,cAAc;wBACvC,iBAAiB;wBACJ,iBAAiB;yBAChC,kBAAkB;sBACZ,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOhD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,AAAsB,AAAC;AAG5D,eAAeF,UAAU,CAACG,QAAgB,EAAEC,OAAgB,EAAE;IACnE,MAAMC,WAAW,GAAGC,IAAAA,OAAyB,0BAAA,EAACH,QAAQ,CAAC,AAAC;IAExDI,IAAAA,QAAU,WAAA,EAAC,YAAY,CAAC,CAAC;IACzBL,OAAO,CAAC,WAAW,CAAC,CAACM,IAAI,CAACH,WAAW,CAAC,CAAC;IAEvC,MAAMI,IAAI,GAAG,MAAMC,IAAAA,KAAgB,iBAAA,EAACL,WA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AAe,gBAAA,EAACD,UAAU,CAAC,AAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -57,6 +57,10 @@ async function getCombinedKnownVersionsAsync({ projectRoot , sdkVersion , skipCa
|
|
|
57
57
|
if (skipRemoteVersions) {
|
|
58
58
|
_log.Log.warn("Dependency validation might be unreliable when using canary SDK versions");
|
|
59
59
|
}
|
|
60
|
+
if (_env.env.EXPO_NO_DEPENDENCY_VALIDATION) {
|
|
61
|
+
debug("Dependency validation is disabled through EXPO_NO_DEPENDENCY_VALIDATION=1");
|
|
62
|
+
return {};
|
|
63
|
+
}
|
|
60
64
|
const bundledNativeModules = sdkVersion ? await (0, _bundledNativeModules.getVersionedNativeModulesAsync)(projectRoot, sdkVersion, {
|
|
61
65
|
skipRemoteVersions
|
|
62
66
|
}) : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/doctor/dependencies/getVersionedPackages.ts"],"sourcesContent":["import { PackageJSONConfig } from '@expo/config';\nimport npmPackageArg from 'npm-package-arg';\n\nimport { getVersionedNativeModulesAsync } from './bundledNativeModules';\nimport { hasExpoCanaryAsync } from './resolvePackages';\nimport { getVersionsAsync, SDKVersion } from '../../../api/getVersions';\nimport { Log } from '../../../log';\nimport { env } from '../../../utils/env';\nimport { CommandError } from '../../../utils/errors';\n\nconst debug = require('debug')(\n 'expo:doctor:dependencies:getVersionedPackages'\n) as typeof console.log;\n\nexport type DependencyList = Record<string, string>;\n\n/** Adds `react-dom`, `react`, and `react-native` to the list of known package versions (`relatedPackages`) */\nfunction normalizeSdkVersionObject(version?: SDKVersion): Record<string, string> {\n if (!version) {\n return {};\n }\n const { relatedPackages, facebookReactVersion, facebookReactNativeVersion, expoVersion } =\n version;\n\n const reactVersion = facebookReactVersion\n ? {\n react: facebookReactVersion,\n 'react-dom': facebookReactVersion,\n }\n : undefined;\n\n const expoVersionIfAvailable = expoVersion ? { expo: expoVersion } : undefined;\n\n return {\n ...relatedPackages,\n ...reactVersion,\n ...expoVersionIfAvailable,\n 'react-native': facebookReactNativeVersion,\n };\n}\n\n/** Get the known versions for a given SDK, combines all sources. */\nexport async function getCombinedKnownVersionsAsync({\n projectRoot,\n sdkVersion,\n skipCache,\n}: {\n projectRoot: string;\n sdkVersion?: string;\n skipCache?: boolean;\n}) {\n const skipRemoteVersions = await hasExpoCanaryAsync(projectRoot);\n if (skipRemoteVersions) {\n Log.warn('Dependency validation might be unreliable when using canary SDK versions');\n }\n\n const bundledNativeModules = sdkVersion\n ? await getVersionedNativeModulesAsync(projectRoot, sdkVersion, { skipRemoteVersions })\n : {};\n const versionsForSdk = !skipRemoteVersions\n ? await getRemoteVersionsForSdkAsync({ sdkVersion, skipCache })\n : {};\n return {\n ...bundledNativeModules,\n // Prefer the remote versions over the bundled versions, this enables us to push\n // emergency fixes that users can access without having to update the `expo` package.\n ...versionsForSdk,\n };\n}\n\n/** @returns a key/value list of known dependencies and their version (including range). */\nexport async function getRemoteVersionsForSdkAsync({\n sdkVersion,\n skipCache,\n}: { sdkVersion?: string; skipCache?: boolean } = {}): Promise<DependencyList> {\n if (env.EXPO_OFFLINE) {\n Log.warn('Dependency validation is unreliable in offline-mode');\n return {};\n }\n\n try {\n const { sdkVersions } = await getVersionsAsync({ skipCache });\n\n // We only want versioned dependencies so skip if they cannot be found.\n if (!sdkVersion || !(sdkVersion in sdkVersions)) {\n debug(\n `Skipping versioned dependencies because the SDK version is not found. (sdkVersion: ${sdkVersion}, available: ${Object.keys(\n sdkVersions\n ).join(', ')})`\n );\n return {};\n }\n\n const version = sdkVersions[sdkVersion as keyof typeof sdkVersions] as unknown as SDKVersion;\n\n return normalizeSdkVersionObject(version);\n } catch (error: any) {\n if (error instanceof CommandError && error.code === 'OFFLINE') {\n return getRemoteVersionsForSdkAsync({ sdkVersion, skipCache });\n }\n throw error;\n }\n}\n\ntype ExcludedNativeModules = {\n name: string;\n bundledNativeVersion: string;\n isExcludedFromValidation: boolean;\n specifiedVersion?: string; // e.g. 1.2.3, latest\n};\n\n/**\n * Versions a list of `packages` against a given `sdkVersion` based on local and remote versioning resources.\n *\n * @param projectRoot\n * @param param1\n * @returns\n */\nexport async function getVersionedPackagesAsync(\n projectRoot: string,\n {\n packages,\n sdkVersion,\n pkg,\n }: {\n /** List of npm packages to process. */\n packages: string[];\n /** Target SDK Version number to version the `packages` for. */\n sdkVersion: string;\n pkg: PackageJSONConfig;\n }\n): Promise<{\n packages: string[];\n messages: string[];\n excludedNativeModules: ExcludedNativeModules[];\n}> {\n const versionsForSdk = await getCombinedKnownVersionsAsync({\n projectRoot,\n sdkVersion,\n skipCache: true,\n });\n\n let nativeModulesCount = 0;\n let othersCount = 0;\n const excludedNativeModules: ExcludedNativeModules[] = [];\n\n const versionedPackages = packages.map((arg) => {\n const { name, type, raw, rawSpec } = npmPackageArg(arg);\n\n if (['tag', 'version', 'range'].includes(type) && name && versionsForSdk[name]) {\n // Unimodule packages from npm registry are modified to use the bundled version.\n // Some packages have the recommended version listed in https://exp.host/--/api/v2/versions.\n const isExcludedFromValidation = pkg?.expo?.install?.exclude?.includes(name);\n const hasSpecifiedExactVersion = rawSpec !== '' && rawSpec !== '*';\n if (isExcludedFromValidation || hasSpecifiedExactVersion) {\n othersCount++;\n excludedNativeModules.push({\n name,\n bundledNativeVersion: versionsForSdk[name],\n isExcludedFromValidation,\n specifiedVersion: hasSpecifiedExactVersion ? rawSpec : '',\n });\n return raw;\n }\n nativeModulesCount++;\n return `${name}@${versionsForSdk[name]}`;\n } else {\n // Other packages are passed through unmodified.\n othersCount++;\n return raw;\n }\n });\n\n const messages = getOperationLog({\n othersCount,\n nativeModulesCount,\n sdkVersion,\n });\n\n return {\n packages: versionedPackages,\n messages,\n excludedNativeModules,\n };\n}\n\n/** Craft a set of messages regarding the install operations. */\nexport function getOperationLog({\n nativeModulesCount,\n sdkVersion,\n othersCount,\n}: {\n nativeModulesCount: number;\n othersCount: number;\n sdkVersion: string;\n}): string[] {\n return [\n nativeModulesCount > 0 &&\n `${nativeModulesCount} SDK ${sdkVersion} compatible native ${\n nativeModulesCount === 1 ? 'module' : 'modules'\n }`,\n othersCount > 0 && `${othersCount} other ${othersCount === 1 ? 'package' : 'packages'}`,\n ].filter(Boolean) as string[];\n}\n"],"names":["getCombinedKnownVersionsAsync","getRemoteVersionsForSdkAsync","getVersionedPackagesAsync","getOperationLog","debug","require","normalizeSdkVersionObject","version","relatedPackages","facebookReactVersion","facebookReactNativeVersion","expoVersion","reactVersion","react","undefined","expoVersionIfAvailable","expo","projectRoot","sdkVersion","skipCache","skipRemoteVersions","hasExpoCanaryAsync","Log","warn","bundledNativeModules","getVersionedNativeModulesAsync","versionsForSdk","env","EXPO_OFFLINE","sdkVersions","getVersionsAsync","Object","keys","join","error","CommandError","code","packages","pkg","nativeModulesCount","othersCount","excludedNativeModules","versionedPackages","map","arg","name","type","raw","rawSpec","npmPackageArg","includes","isExcludedFromValidation","install","exclude","hasSpecifiedExactVersion","push","bundledNativeVersion","specifiedVersion","messages","filter","Boolean"],"mappings":"AAAA;;;;;;;;;;;IA0CsBA,6BAA6B,MAA7BA,6BAA6B;IA6B7BC,4BAA4B,MAA5BA,4BAA4B;IA+C5BC,yBAAyB,MAAzBA,yBAAyB;IAqE/BC,eAAe,MAAfA,eAAe;;;8DA1LL,iBAAiB;;;;;;sCAEI,wBAAwB;iCACpC,mBAAmB;6BACT,0BAA0B;qBACnD,cAAc;qBACd,oBAAoB;wBACX,uBAAuB;;;;;;AAEpD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAC5B,+CAA+C,CAChD,AAAsB,AAAC;AAIxB,4GAA4G,GAC5G,SAASC,yBAAyB,CAACC,OAAoB,EAA0B;IAC/E,IAAI,CAACA,OAAO,EAAE;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,EAAEC,eAAe,CAAA,EAAEC,oBAAoB,CAAA,EAAEC,0BAA0B,CAAA,EAAEC,WAAW,CAAA,EAAE,GACtFJ,OAAO,AAAC;IAEV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qC,WAAW;QACXD,kBAAkB;QAClBrB,UAAU;KACX,CAAC,AAAC;IAEH,OAAO;QACLmB,QAAQ,EAAEK,iBAAiB;QAC3BgB,QAAQ;QACRjB,qBAAqB;KACtB,CAAC;AACJ,CAAC;AAGM,SAAStC,eAAe,CAAC,EAC9BoC,kBAAkB,CAAA,EAClBrB,UAAU,CAAA,EACVsB,WAAW,CAAA,EAKZ,EAAY;IACX,OAAO;QACLD,kBAAkB,GAAG,CAAC,IACpB,CAAC,EAAEA,kBAAkB,CAAC,KAAK,EAAErB,UAAU,CAAC,mBAAmB,EACzDqB,kBAAkB,KAAK,CAAC,GAAG,QAAQ,GAAG,SAAS,CAChD,CAAC;QACJC,WAAW,GAAG,CAAC,IAAI,CAAC,EAAEA,WAAW,CAAC,OAAO,EAAEA,WAAW,KAAK,CAAC,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;KACxF,CAACmB,MAAM,CAACC,OAAO,CAAC,CAAa;AAChC,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/doctor/dependencies/getVersionedPackages.ts"],"sourcesContent":["import { PackageJSONConfig } from '@expo/config';\nimport npmPackageArg from 'npm-package-arg';\n\nimport { getVersionedNativeModulesAsync } from './bundledNativeModules';\nimport { hasExpoCanaryAsync } from './resolvePackages';\nimport { getVersionsAsync, SDKVersion } from '../../../api/getVersions';\nimport { Log } from '../../../log';\nimport { env } from '../../../utils/env';\nimport { CommandError } from '../../../utils/errors';\n\nconst debug = require('debug')(\n 'expo:doctor:dependencies:getVersionedPackages'\n) as typeof console.log;\n\nexport type DependencyList = Record<string, string>;\n\n/** Adds `react-dom`, `react`, and `react-native` to the list of known package versions (`relatedPackages`) */\nfunction normalizeSdkVersionObject(version?: SDKVersion): Record<string, string> {\n if (!version) {\n return {};\n }\n const { relatedPackages, facebookReactVersion, facebookReactNativeVersion, expoVersion } =\n version;\n\n const reactVersion = facebookReactVersion\n ? {\n react: facebookReactVersion,\n 'react-dom': facebookReactVersion,\n }\n : undefined;\n\n const expoVersionIfAvailable = expoVersion ? { expo: expoVersion } : undefined;\n\n return {\n ...relatedPackages,\n ...reactVersion,\n ...expoVersionIfAvailable,\n 'react-native': facebookReactNativeVersion,\n };\n}\n\n/** Get the known versions for a given SDK, combines all sources. */\nexport async function getCombinedKnownVersionsAsync({\n projectRoot,\n sdkVersion,\n skipCache,\n}: {\n projectRoot: string;\n sdkVersion?: string;\n skipCache?: boolean;\n}) {\n const skipRemoteVersions = await hasExpoCanaryAsync(projectRoot);\n if (skipRemoteVersions) {\n Log.warn('Dependency validation might be unreliable when using canary SDK versions');\n }\n\n if (env.EXPO_NO_DEPENDENCY_VALIDATION) {\n debug('Dependency validation is disabled through EXPO_NO_DEPENDENCY_VALIDATION=1');\n return {};\n }\n\n const bundledNativeModules = sdkVersion\n ? await getVersionedNativeModulesAsync(projectRoot, sdkVersion, { skipRemoteVersions })\n : {};\n const versionsForSdk = !skipRemoteVersions\n ? await getRemoteVersionsForSdkAsync({ sdkVersion, skipCache })\n : {};\n return {\n ...bundledNativeModules,\n // Prefer the remote versions over the bundled versions, this enables us to push\n // emergency fixes that users can access without having to update the `expo` package.\n ...versionsForSdk,\n };\n}\n\n/** @returns a key/value list of known dependencies and their version (including range). */\nexport async function getRemoteVersionsForSdkAsync({\n sdkVersion,\n skipCache,\n}: { sdkVersion?: string; skipCache?: boolean } = {}): Promise<DependencyList> {\n if (env.EXPO_OFFLINE) {\n Log.warn('Dependency validation is unreliable in offline-mode');\n return {};\n }\n\n try {\n const { sdkVersions } = await getVersionsAsync({ skipCache });\n\n // We only want versioned dependencies so skip if they cannot be found.\n if (!sdkVersion || !(sdkVersion in sdkVersions)) {\n debug(\n `Skipping versioned dependencies because the SDK version is not found. (sdkVersion: ${sdkVersion}, available: ${Object.keys(\n sdkVersions\n ).join(', ')})`\n );\n return {};\n }\n\n const version = sdkVersions[sdkVersion as keyof typeof sdkVersions] as unknown as SDKVersion;\n\n return normalizeSdkVersionObject(version);\n } catch (error: any) {\n if (error instanceof CommandError && error.code === 'OFFLINE') {\n return getRemoteVersionsForSdkAsync({ sdkVersion, skipCache });\n }\n throw error;\n }\n}\n\ntype ExcludedNativeModules = {\n name: string;\n bundledNativeVersion: string;\n isExcludedFromValidation: boolean;\n specifiedVersion?: string; // e.g. 1.2.3, latest\n};\n\n/**\n * Versions a list of `packages` against a given `sdkVersion` based on local and remote versioning resources.\n *\n * @param projectRoot\n * @param param1\n * @returns\n */\nexport async function getVersionedPackagesAsync(\n projectRoot: string,\n {\n packages,\n sdkVersion,\n pkg,\n }: {\n /** List of npm packages to process. */\n packages: string[];\n /** Target SDK Version number to version the `packages` for. */\n sdkVersion: string;\n pkg: PackageJSONConfig;\n }\n): Promise<{\n packages: string[];\n messages: string[];\n excludedNativeModules: ExcludedNativeModules[];\n}> {\n const versionsForSdk = await getCombinedKnownVersionsAsync({\n projectRoot,\n sdkVersion,\n skipCache: true,\n });\n\n let nativeModulesCount = 0;\n let othersCount = 0;\n const excludedNativeModules: ExcludedNativeModules[] = [];\n\n const versionedPackages = packages.map((arg) => {\n const { name, type, raw, rawSpec } = npmPackageArg(arg);\n\n if (['tag', 'version', 'range'].includes(type) && name && versionsForSdk[name]) {\n // Unimodule packages from npm registry are modified to use the bundled version.\n // Some packages have the recommended version listed in https://exp.host/--/api/v2/versions.\n const isExcludedFromValidation = pkg?.expo?.install?.exclude?.includes(name);\n const hasSpecifiedExactVersion = rawSpec !== '' && rawSpec !== '*';\n if (isExcludedFromValidation || hasSpecifiedExactVersion) {\n othersCount++;\n excludedNativeModules.push({\n name,\n bundledNativeVersion: versionsForSdk[name],\n isExcludedFromValidation,\n specifiedVersion: hasSpecifiedExactVersion ? rawSpec : '',\n });\n return raw;\n }\n nativeModulesCount++;\n return `${name}@${versionsForSdk[name]}`;\n } else {\n // Other packages are passed through unmodified.\n othersCount++;\n return raw;\n }\n });\n\n const messages = getOperationLog({\n othersCount,\n nativeModulesCount,\n sdkVersion,\n });\n\n return {\n packages: versionedPackages,\n messages,\n excludedNativeModules,\n };\n}\n\n/** Craft a set of messages regarding the install operations. */\nexport function getOperationLog({\n nativeModulesCount,\n sdkVersion,\n othersCount,\n}: {\n nativeModulesCount: number;\n othersCount: number;\n sdkVersion: string;\n}): string[] {\n return [\n nativeModulesCount > 0 &&\n `${nativeModulesCount} SDK ${sdkVersion} compatible native ${\n nativeModulesCount === 1 ? 'module' : 'modules'\n }`,\n othersCount > 0 && `${othersCount} other ${othersCount === 1 ? 'package' : 'packages'}`,\n ].filter(Boolean) as string[];\n}\n"],"names":["getCombinedKnownVersionsAsync","getRemoteVersionsForSdkAsync","getVersionedPackagesAsync","getOperationLog","debug","require","normalizeSdkVersionObject","version","relatedPackages","facebookReactVersion","facebookReactNativeVersion","expoVersion","reactVersion","react","undefined","expoVersionIfAvailable","expo","projectRoot","sdkVersion","skipCache","skipRemoteVersions","hasExpoCanaryAsync","Log","warn","env","EXPO_NO_DEPENDENCY_VALIDATION","bundledNativeModules","getVersionedNativeModulesAsync","versionsForSdk","EXPO_OFFLINE","sdkVersions","getVersionsAsync","Object","keys","join","error","CommandError","code","packages","pkg","nativeModulesCount","othersCount","excludedNativeModules","versionedPackages","map","arg","name","type","raw","rawSpec","npmPackageArg","includes","isExcludedFromValidation","install","exclude","hasSpecifiedExactVersion","push","bundledNativeVersion","specifiedVersion","messages","filter","Boolean"],"mappings":"AAAA;;;;;;;;;;;IA0CsBA,6BAA6B,MAA7BA,6BAA6B;IAkC7BC,4BAA4B,MAA5BA,4BAA4B;IA+C5BC,yBAAyB,MAAzBA,yBAAyB;IAqE/BC,eAAe,MAAfA,eAAe;;;8DA/LL,iBAAiB;;;;;;sCAEI,wBAAwB;iCACpC,mBAAmB;6BACT,0BAA0B;qBACnD,cAAc;qBACd,oBAAoB;wBACX,uBAAuB;;;;;;AAEpD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAC5B,+CAA+C,CAChD,AAAsB,AAAC;AAIxB,4GAA4G,GAC5G,SAASC,yBA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AG,EAAE;iBAC1D,CAAC,CAAC;gBACH,OAAOD,GAAG,CAAC;YACb,CAAC;YACDR,kBAAkB,EAAE,CAAC;YACrB,OAAO,CAAC,EAAEM,IAAI,CAAC,CAAC,EAAElB,cAAc,CAACkB,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3C,OAAO;YACL,gDAAgD;YAChDL,WAAW,EAAE,CAAC;YACd,OAAOO,GAAG,CAAC;QACb,CAAC;IACH,CAAC,CAAC,AAAC;IAEH,MAAMW,QAAQ,GAAGxD,eAAe,CAAC;QAC/BsC,WAAW;QACXD,kBAAkB;QAClBtB,UAAU;KACX,CAAC,AAAC;IAEH,OAAO;QACLoB,QAAQ,EAAEK,iBAAiB;QAC3BgB,QAAQ;QACRjB,qBAAqB;KACtB,CAAC;AACJ,CAAC;AAGM,SAASvC,eAAe,CAAC,EAC9BqC,kBAAkB,CAAA,EAClBtB,UAAU,CAAA,EACVuB,WAAW,CAAA,EAKZ,EAAY;IACX,OAAO;QACLD,kBAAkB,GAAG,CAAC,IACpB,CAAC,EAAEA,kBAAkB,CAAC,KAAK,EAAEtB,UAAU,CAAC,mBAAmB,EACzDsB,kBAAkB,KAAK,CAAC,GAAG,QAAQ,GAAG,SAAS,CAChD,CAAC;QACJC,WAAW,GAAG,CAAC,IAAI,CAAC,EAAEA,WAAW,CAAC,OAAO,EAAEA,WAAW,KAAK,CAAC,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;KACxF,CAACmB,MAAM,CAACC,OAAO,CAAC,CAAa;AAChC,CAAC"}
|
|
@@ -136,9 +136,10 @@ function evalMetroAndWrapFunctions(projectRoot, script, filename, isExporting) {
|
|
|
136
136
|
await (0, _metroErrorInterface.logMetroError)(projectRoot, {
|
|
137
137
|
error
|
|
138
138
|
});
|
|
139
|
-
if (isExporting) {
|
|
139
|
+
if (isExporting || error[_metroErrorInterface.IS_METRO_BUNDLE_ERROR_SYMBOL]) {
|
|
140
140
|
throw error;
|
|
141
141
|
} else {
|
|
142
|
+
// TODO: When does this happen?
|
|
142
143
|
throw new _errors.SilentError(error);
|
|
143
144
|
}
|
|
144
145
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/start/server/getStaticRenderFunctions.ts"],"sourcesContent":["/**\n * Copyright © 2022 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { getMetroServerRoot } from '@expo/config/paths';\nimport fs from 'fs';\nimport path from 'path';\nimport requireString from 'require-from-string';\n\nimport { logMetroError } from './metro/metroErrorInterface';\nimport { createBundleUrlPath, ExpoMetroOptions } from './middleware/metroOptions';\nimport { augmentLogs } from './serverLogLikeMetro';\nimport { delayAsync } from '../../utils/delay';\nimport { SilentError } from '../../utils/errors';\nimport { profile } from '../../utils/profile';\n\n/** The list of input keys will become optional, everything else will remain the same. */\nexport type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nexport const cachedSourceMaps: Map<string, { url: string; map: string }> = new Map();\n\n// Support unhandled rejections\n// Detect if running in Bun\n\n// @ts-expect-error: This is a global variable that is set by Bun.\nif (!process.isBun) {\n require('source-map-support').install({\n retrieveSourceMap(source: string) {\n if (cachedSourceMaps.has(source)) {\n return cachedSourceMaps.get(source);\n }\n return null;\n },\n });\n}\n\nasync function ensureFileInRootDirectory(projectRoot: string, otherFile: string) {\n // Cannot be accessed using Metro's server API, we need to move the file\n // into the project root and try again.\n if (!path.relative(projectRoot, otherFile).startsWith('..' + path.sep)) {\n return otherFile;\n }\n\n // Copy the file into the project to ensure it works in monorepos.\n // This means the file cannot have any relative imports.\n const tempDir = path.join(projectRoot, '.expo/static-tmp');\n await fs.promises.mkdir(tempDir, { recursive: true });\n const moduleId = path.join(tempDir, path.basename(otherFile));\n await fs.promises.writeFile(moduleId, await fs.promises.readFile(otherFile, 'utf8'));\n // Sleep to give watchman time to register the file.\n await delayAsync(50);\n return moduleId;\n}\n\nexport async function createMetroEndpointAsync(\n projectRoot: string,\n devServerUrl: string,\n absoluteFilePath: string,\n props: PickPartial<ExpoMetroOptions, 'mainModuleName' | 'bytecode'>\n): Promise<string> {\n const root = getMetroServerRoot(projectRoot);\n const safeOtherFile = await ensureFileInRootDirectory(projectRoot, absoluteFilePath);\n const serverPath = path.relative(root, safeOtherFile).replace(/\\.[jt]sx?$/, '');\n\n const urlFragment = createBundleUrlPath({\n mainModuleName: serverPath,\n lazy: false,\n asyncRoutes: false,\n inlineSourceMap: false,\n engine: 'hermes',\n minify: false,\n bytecode: false,\n ...props,\n });\n\n let url: string;\n if (devServerUrl) {\n url = new URL(urlFragment.replace(/^\\//, ''), devServerUrl).toString();\n } else {\n url = '/' + urlFragment.replace(/^\\/+/, '');\n }\n return url;\n}\n\nexport function evalMetroAndWrapFunctions<T = Record<string, any>>(\n projectRoot: string,\n script: string,\n filename: string,\n isExporting: boolean\n): T {\n // TODO: Add back stack trace logic that hides traces from metro-runtime and other internal modules.\n const contents = evalMetroNoHandling(projectRoot, script, filename);\n\n if (!contents) {\n // This can happen if ErrorUtils isn't working correctly on web and failing to throw an error when a module throws.\n // This is unexpected behavior and should not be pretty formatted, therefore we're avoiding CommandError.\n throw new Error(\n '[Expo SSR] Module returned undefined, this could be due to a misconfiguration in Metro error handling'\n );\n }\n // wrap each function with a try/catch that uses Metro's error formatter\n return Object.keys(contents).reduce((acc, key) => {\n const fn = contents[key];\n if (typeof fn !== 'function') {\n return { ...acc, [key]: fn };\n }\n\n acc[key] = async function (...props: any[]) {\n try {\n return await fn.apply(this, props);\n } catch (error: any) {\n await logMetroError(projectRoot, { error });\n if (isExporting) {\n throw error;\n } else {\n throw new SilentError(error);\n }\n }\n };\n return acc;\n }, {} as any);\n}\n\nexport function evalMetroNoHandling(projectRoot: string, src: string, filename: string) {\n augmentLogs(projectRoot);\n\n return profile(requireString, 'eval-metro-bundle')(src, filename);\n}\n"],"names":["cachedSourceMaps","createMetroEndpointAsync","evalMetroAndWrapFunctions","evalMetroNoHandling","Map","process","isBun","require","install","retrieveSourceMap","source","has","get","ensureFileInRootDirectory","projectRoot","otherFile","path","relative","startsWith","sep","tempDir","join","fs","promises","mkdir","recursive","moduleId","basename","writeFile","readFile","delayAsync","devServerUrl","absoluteFilePath","props","root","getMetroServerRoot","safeOtherFile","serverPath","replace","urlFragment","createBundleUrlPath","mainModuleName","lazy","asyncRoutes","inlineSourceMap","engine","minify","bytecode","url","URL","toString","script","filename","isExporting","contents","Error","Object","keys","reduce","acc","key","fn","apply","error","logMetroError","SilentError","src","augmentLogs","profile","requireString"],"mappings":"AAAA;;;;;CAKC,GACD;;;;;;;;;;;IAeaA,gBAAgB,MAAhBA,gBAAgB;IAmCPC,wBAAwB,MAAxBA,wBAAwB;IA8B9BC,yBAAyB,MAAzBA,yBAAyB;
|
|
1
|
+
{"version":3,"sources":["../../../../src/start/server/getStaticRenderFunctions.ts"],"sourcesContent":["/**\n * Copyright © 2022 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { getMetroServerRoot } from '@expo/config/paths';\nimport fs from 'fs';\nimport path from 'path';\nimport requireString from 'require-from-string';\n\nimport { IS_METRO_BUNDLE_ERROR_SYMBOL, logMetroError } from './metro/metroErrorInterface';\nimport { createBundleUrlPath, ExpoMetroOptions } from './middleware/metroOptions';\nimport { augmentLogs } from './serverLogLikeMetro';\nimport { delayAsync } from '../../utils/delay';\nimport { SilentError } from '../../utils/errors';\nimport { profile } from '../../utils/profile';\n\n/** The list of input keys will become optional, everything else will remain the same. */\nexport type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nexport const cachedSourceMaps: Map<string, { url: string; map: string }> = new Map();\n\n// Support unhandled rejections\n// Detect if running in Bun\n\n// @ts-expect-error: This is a global variable that is set by Bun.\nif (!process.isBun) {\n require('source-map-support').install({\n retrieveSourceMap(source: string) {\n if (cachedSourceMaps.has(source)) {\n return cachedSourceMaps.get(source);\n }\n return null;\n },\n });\n}\n\nasync function ensureFileInRootDirectory(projectRoot: string, otherFile: string) {\n // Cannot be accessed using Metro's server API, we need to move the file\n // into the project root and try again.\n if (!path.relative(projectRoot, otherFile).startsWith('..' + path.sep)) {\n return otherFile;\n }\n\n // Copy the file into the project to ensure it works in monorepos.\n // This means the file cannot have any relative imports.\n const tempDir = path.join(projectRoot, '.expo/static-tmp');\n await fs.promises.mkdir(tempDir, { recursive: true });\n const moduleId = path.join(tempDir, path.basename(otherFile));\n await fs.promises.writeFile(moduleId, await fs.promises.readFile(otherFile, 'utf8'));\n // Sleep to give watchman time to register the file.\n await delayAsync(50);\n return moduleId;\n}\n\nexport async function createMetroEndpointAsync(\n projectRoot: string,\n devServerUrl: string,\n absoluteFilePath: string,\n props: PickPartial<ExpoMetroOptions, 'mainModuleName' | 'bytecode'>\n): Promise<string> {\n const root = getMetroServerRoot(projectRoot);\n const safeOtherFile = await ensureFileInRootDirectory(projectRoot, absoluteFilePath);\n const serverPath = path.relative(root, safeOtherFile).replace(/\\.[jt]sx?$/, '');\n\n const urlFragment = createBundleUrlPath({\n mainModuleName: serverPath,\n lazy: false,\n asyncRoutes: false,\n inlineSourceMap: false,\n engine: 'hermes',\n minify: false,\n bytecode: false,\n ...props,\n });\n\n let url: string;\n if (devServerUrl) {\n url = new URL(urlFragment.replace(/^\\//, ''), devServerUrl).toString();\n } else {\n url = '/' + urlFragment.replace(/^\\/+/, '');\n }\n return url;\n}\n\nexport function evalMetroAndWrapFunctions<T = Record<string, any>>(\n projectRoot: string,\n script: string,\n filename: string,\n isExporting: boolean\n): T {\n // TODO: Add back stack trace logic that hides traces from metro-runtime and other internal modules.\n const contents = evalMetroNoHandling(projectRoot, script, filename);\n\n if (!contents) {\n // This can happen if ErrorUtils isn't working correctly on web and failing to throw an error when a module throws.\n // This is unexpected behavior and should not be pretty formatted, therefore we're avoiding CommandError.\n throw new Error(\n '[Expo SSR] Module returned undefined, this could be due to a misconfiguration in Metro error handling'\n );\n }\n // wrap each function with a try/catch that uses Metro's error formatter\n return Object.keys(contents).reduce((acc, key) => {\n const fn = contents[key];\n if (typeof fn !== 'function') {\n return { ...acc, [key]: fn };\n }\n\n acc[key] = async function (...props: any[]) {\n try {\n return await fn.apply(this, props);\n } catch (error: any) {\n await logMetroError(projectRoot, { error });\n\n if (isExporting || error[IS_METRO_BUNDLE_ERROR_SYMBOL]) {\n throw error;\n } else {\n // TODO: When does this happen?\n throw new SilentError(error);\n }\n }\n };\n return acc;\n }, {} as any);\n}\n\nexport function evalMetroNoHandling(projectRoot: string, src: string, filename: string) {\n augmentLogs(projectRoot);\n\n return profile(requireString, 'eval-metro-bundle')(src, filename);\n}\n"],"names":["cachedSourceMaps","createMetroEndpointAsync","evalMetroAndWrapFunctions","evalMetroNoHandling","Map","process","isBun","require","install","retrieveSourceMap","source","has","get","ensureFileInRootDirectory","projectRoot","otherFile","path","relative","startsWith","sep","tempDir","join","fs","promises","mkdir","recursive","moduleId","basename","writeFile","readFile","delayAsync","devServerUrl","absoluteFilePath","props","root","getMetroServerRoot","safeOtherFile","serverPath","replace","urlFragment","createBundleUrlPath","mainModuleName","lazy","asyncRoutes","inlineSourceMap","engine","minify","bytecode","url","URL","toString","script","filename","isExporting","contents","Error","Object","keys","reduce","acc","key","fn","apply","error","logMetroError","IS_METRO_BUNDLE_ERROR_SYMBOL","SilentError","src","augmentLogs","profile","requireString"],"mappings":"AAAA;;;;;CAKC,GACD;;;;;;;;;;;IAeaA,gBAAgB,MAAhBA,gBAAgB;IAmCPC,wBAAwB,MAAxBA,wBAAwB;IA8B9BC,yBAAyB,MAAzBA,yBAAyB;IAyCzBC,mBAAmB,MAAnBA,mBAAmB;;;yBAzHA,oBAAoB;;;;;;;8DACxC,IAAI;;;;;;;8DACF,MAAM;;;;;;;8DACG,qBAAqB;;;;;;qCAEa,6BAA6B;8BACnC,2BAA2B;oCACrD,sBAAsB;uBACvB,mBAAmB;wBAClB,oBAAoB;yBACxB,qBAAqB;;;;;;AAKtC,MAAMH,gBAAgB,GAA8C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