@expo/cli 0.10.11 → 0.10.13
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 +2 -2
- package/build/src/install/index.js +1 -0
- package/build/src/install/index.js.map +1 -1
- package/build/src/install/installAsync.js +1 -0
- package/build/src/install/installAsync.js.map +1 -1
- package/build/src/install/resolveOptions.js +7 -4
- package/build/src/install/resolveOptions.js.map +1 -1
- package/build/src/prebuild/index.js +2 -0
- package/build/src/prebuild/index.js.map +1 -1
- package/build/src/prebuild/prebuildAsync.js +2 -1
- package/build/src/prebuild/prebuildAsync.js.map +1 -1
- package/build/src/prebuild/resolveOptions.js +4 -2
- package/build/src/prebuild/resolveOptions.js.map +1 -1
- package/build/src/run/android/runAndroidAsync.js +5 -0
- package/build/src/run/android/runAndroidAsync.js.map +1 -1
- package/build/src/run/ios/appleDevice/AppleDevice.js +35 -2
- package/build/src/run/ios/appleDevice/AppleDevice.js.map +1 -1
- package/build/src/run/ios/runIosAsync.js +5 -0
- package/build/src/run/ios/runIosAsync.js.map +1 -1
- package/build/src/start/server/middleware/ClassicManifestMiddleware.js +1 -1
- package/build/src/utils/analytics/rudderstackClient.js +2 -2
- package/build/src/utils/port.js +45 -17
- package/build/src/utils/port.js.map +1 -1
- package/package.json +3 -4
package/build/bin/cli
CHANGED
|
@@ -132,7 +132,7 @@ const args = (0, _arg).default({
|
|
|
132
132
|
});
|
|
133
133
|
if (args["--version"]) {
|
|
134
134
|
// Version is added in the build script.
|
|
135
|
-
console.log("0.10.
|
|
135
|
+
console.log("0.10.13");
|
|
136
136
|
process.exit(0);
|
|
137
137
|
}
|
|
138
138
|
if (args["--non-interactive"]) {
|
|
@@ -262,7 +262,7 @@ commands[command]().then((exec)=>{
|
|
|
262
262
|
logEventAsync("action", {
|
|
263
263
|
action: `expo ${command}`,
|
|
264
264
|
source: "expo/cli",
|
|
265
|
-
source_version: "0.10.
|
|
265
|
+
source_version: "0.10.13"
|
|
266
266
|
});
|
|
267
267
|
});
|
|
268
268
|
|
|
@@ -28,6 +28,7 @@ const expoInstall = async (argv)=>{
|
|
|
28
28
|
`--fix Automatically update any invalid package versions`,
|
|
29
29
|
_chalk.default`--npm Use npm to install dependencies. {dim Default when package-lock.json exists}`,
|
|
30
30
|
_chalk.default`--yarn Use Yarn to install dependencies. {dim Default when yarn.lock exists}`,
|
|
31
|
+
_chalk.default`--bun Use bun to install dependencies. {dim Default when bun.lockb exists}`,
|
|
31
32
|
_chalk.default`--pnpm Use pnpm to install dependencies. {dim Default when pnpm-lock.yaml exists}`,
|
|
32
33
|
`-h, --help Usage info`,
|
|
33
34
|
].join("\n"), [
|
|
@@ -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`--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;;;;;;AACkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAGwB,IAAA,KAAe,WAAf,eAAe,CAAA;;;;;;AAEzD,MAAMA,WAAW,GAAY,OAAOC,IAAI,GAAK;IAClD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAqB,AAYjC,CAAA,sBAZiC,CAChC;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,CAAAA,GAAAA,KAAS,
|
|
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.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;;;;;;AACkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAGwB,IAAA,KAAe,WAAf,eAAe,CAAA;;;;;;AAEzD,MAAMA,WAAW,GAAY,OAAOC,IAAI,GAAK;IAClD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAqB,AAYjC,CAAA,sBAZiC,CAChC;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,CAAAA,GAAAA,KAAS,AAmBR,CAAA,UAnBQ,CACP,CAAC,8CAA8C,CAAC,EAChD,CAAC,gBAAgB,CAAC,EAClB;YACE,CAAC,6DAA6D,CAAC;YAC/D,CAAC,6DAA6D,CAAC;YAC/DC,MAAK,QAAA,CAAC,wFAAwF,CAAC;YAC/FA,MAAK,QAAA,CAAC,iFAAiF,CAAC;YACxFA,MAAK,QAAA,CAAC,gFAAgF,CAAC;YACvFA,MAAK,QAAA,CAAC,sFAAsF,CAAC;YAC7F,CAAC,sBAAsB,CAAC;SACzB,CAACC,IAAI,CAAC,IAAI,CAAC,EACZ;YACE,EAAE;YACFD,MAAK,QAAA,CAAC,uFAAuF,CAAC;YAC9FA,MAAK,QAAA,CAAC,+CAA+C,CAAC;YACtDA,MAAK,QAAA,CAAC,oCAAoC,CAAC;YAC3C,EAAE;SACH,CAACC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;KACH;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;CACnE,AAAC;QA/CWX,WAAW,GAAXA,WAAW"}
|
|
@@ -53,6 +53,7 @@ async function installAsync(packages, options, packageManagerArguments = []) {
|
|
|
53
53
|
const packageManager = PackageManager.createForProject(projectRoot, {
|
|
54
54
|
npm: options.npm,
|
|
55
55
|
yarn: options.yarn,
|
|
56
|
+
bun: options.bun,
|
|
56
57
|
pnpm: options.pnpm,
|
|
57
58
|
silent: options.silent,
|
|
58
59
|
log: Log.log
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/install/installAsync.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport * as PackageManager from '@expo/package-manager';\nimport chalk from 'chalk';\n\nimport * as Log from '../log';\nimport {\n getOperationLog,\n getVersionedPackagesAsync,\n} from '../start/doctor/dependencies/getVersionedPackages';\nimport { getVersionedDependenciesAsync } from '../start/doctor/dependencies/validateDependenciesVersions';\nimport { groupBy } from '../utils/array';\nimport { findUpProjectRootOrAssert } from '../utils/findUp';\nimport { learnMore } from '../utils/link';\nimport { setNodeEnv } from '../utils/nodeEnv';\nimport { joinWithCommasAnd } from '../utils/strings';\nimport { checkPackagesAsync } from './checkPackages';\nimport { Options } from './resolveOptions';\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 pnpm: options.pnpm,\n silent: options.silent,\n log: Log.log,\n });\n\n if (options.check || options.fix) {\n return await checkPackagesAsync(projectRoot, {\n packages,\n options,\n packageManager,\n packageManagerArguments,\n });\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 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 }: {\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 } = 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 //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 Log.log(\n chalk`\\u203A Using latest version instead of ${joinWithCommasAnd(\n versioning.excludedNativeModules.map(\n ({ bundledNativeVersion, name }) => `${bundledNativeVersion} for ${name}`\n )\n )} because ${\n versioning.excludedNativeModules.length > 1 ? 'they are' : 'it is'\n } listed in {bold expo.install.exclude} in package.json. ${learnMore(\n 'https://expo.dev/more/expo-cli/#configuring-dependency-validation'\n )}`\n );\n }\n\n await packageManager.addAsync([...packageManagerArguments, ...versioning.packages]);\n\n await applyPluginsAsync(projectRoot, versioning.packages);\n}\n\nexport async function fixPackagesAsync(\n projectRoot: string,\n {\n packages,\n packageManager,\n sdkVersion,\n packageManagerArguments,\n }: {\n packages: Awaited<ReturnType<typeof getVersionedDependenciesAsync>>;\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 if (!packages.length) {\n return;\n }\n\n const { dependencies = [], devDependencies = [] } = groupBy(packages, (dep) => dep.packageType);\n const versioningMessages = getOperationLog({\n othersCount: 0, // All fixable packages are versioned\n nativeModulesCount: packages.length,\n sdkVersion,\n });\n\n Log.log(\n chalk`\\u203A Installing ${\n versioningMessages.length ? versioningMessages.join(' and ') + ' ' : ''\n }using {bold ${packageManager.name}}`\n );\n\n if (dependencies.length) {\n const versionedPackages = dependencies.map(\n (dep) => `${dep.packageName}@${dep.expectedVersionOrRange}`\n );\n\n await packageManager.addAsync([...packageManagerArguments, ...versionedPackages]);\n\n await applyPluginsAsync(projectRoot, versionedPackages);\n }\n\n if (devDependencies.length) {\n await packageManager.addDevAsync([\n ...packageManagerArguments,\n ...devDependencies.map((dep) => `${dep.packageName}@${dep.expectedVersionOrRange}`),\n ]);\n }\n}\n\n/**\n * A convenience feature for automatically applying Expo Config Plugins to the `app.json` after installing them.\n * This should be dropped in favor of autolinking in the future.\n */\nasync function applyPluginsAsync(projectRoot: string, packages: string[]) {\n const { autoAddConfigPluginsAsync } = await import('./utils/autoAddConfigPlugins');\n\n try {\n const { exp } = getConfig(projectRoot, { skipSDKVersionRequirement: true });\n\n // Only auto add plugins if the plugins array is defined or if the project is using SDK +42.\n await autoAddConfigPluginsAsync(\n projectRoot,\n exp,\n // Split any possible NPM tags. i.e. `expo@latest` -> `expo`\n packages.map((pkg) => pkg.split('@')[0]).filter(Boolean)\n );\n } catch (error: any) {\n // If we fail to apply plugins, the log a warning and continue.\n if (error.isPluginError) {\n Log.warn(`Skipping config plugin check: ` + error.message);\n return;\n }\n // Any other error, rethrow.\n throw error;\n }\n}\n"],"names":["installAsync","installPackagesAsync","fixPackagesAsync","PackageManager","Log","packages","options","packageManagerArguments","setNodeEnv","projectRoot","findUpProjectRootOrAssert","process","cwd","require","load","packageManager","createForProject","npm","yarn","pnpm","silent","log","check","fix","checkPackagesAsync","exp","getConfig","skipPlugins","sdkVersion","pkg","versioning","getVersionedPackagesAsync","chalk","messages","length","join","name","excludedNativeModules","joinWithCommasAnd","map","bundledNativeVersion","learnMore","addAsync","applyPluginsAsync","dependencies","devDependencies","groupBy","dep","packageType","versioningMessages","getOperationLog","othersCount","nativeModulesCount","versionedPackages","packageName","expectedVersionOrRange","addDevAsync","autoAddConfigPluginsAsync","skipSDKVersionRequirement","split","filter","Boolean","error","isPluginError","warn","message"],"mappings":"AAAA;;;;QAkBsBA,YAAY,GAAZA,YAAY;QA8CZC,oBAAoB,GAApBA,oBAAoB;QAoEpBC,gBAAgB,GAAhBA,gBAAgB;AApIZ,IAAA,OAAc,WAAd,cAAc,CAAA;AAC5BC,IAAAA,cAAc,mCAAM,uBAAuB,EAA7B;AACR,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEbC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AAIR,IAAA,qBAAmD,WAAnD,mDAAmD,CAAA;AAElC,IAAA,MAAgB,WAAhB,gBAAgB,CAAA;AACE,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;AACjC,IAAA,KAAe,WAAf,eAAe,CAAA;AACd,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;AACX,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;AACjB,IAAA,cAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAG7C,eAAeJ,YAAY,CAChCK,QAAkB,EAClBC,OAA2C,EAC3CC,uBAAiC,GAAG,EAAE,EACtC;IACAC,CAAAA,GAAAA,QAAU,AAAe,CAAA,WAAf,CAAC,aAAa,CAAC,CAAC;QAGNF,YAAmB;IAFvC,0EAA0E;IAC1E,mFAAmF;IACnF,MAAMG,WAAW,GAAGH,CAAAA,YAAmB,GAAnBA,OAAO,CAACG,WAAW,YAAnBH,YAAmB,GAAII,CAAAA,GAAAA,OAAyB,AAAe,CAAA,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X,MAAM,EAAE;QAC1B,MAAMnB,cAAc,CAACyC,WAAW,CAAC;eAC5BjD,uBAAuB;eACvBsC,eAAe,CAACN,GAAG,CAAC,CAACQ,GAAG,GAAK,CAAC,EAAEA,GAAG,CAACO,WAAW,CAAC,CAAC,EAAEP,GAAG,CAACQ,sBAAsB,CAAC,CAAC;YAAA,CAAC;SACpF,CAAC,CAAC;KACJ;CACF;AAED;;;GAGG,CACH,eAAeZ,iBAAiB,CAAClC,WAAmB,EAAEJ,QAAkB,EAAE;IACxE,MAAM,EAAEoD,yBAAyB,CAAA,EAAE,GAAG,MAAM;+CAAO,8BAA8B;MAAC,AAAC;IAEnF,IAAI;QACF,MAAM,EAAEhC,GAAG,CAAA,EAAE,GAAGC,CAAAA,GAAAA,OAAS,AAAkD,CAAA,UAAlD,CAACjB,WAAW,EAAE;YAAEiD,yBAAyB,EAAE,IAAI;SAAE,CAAC,AAAC;QAE5E,4FAA4F;QAC5F,MAAMD,yBAAyB,CAC7BhD,WAAW,EACXgB,GAAG,EACH,4DAA4D;QAC5DpB,QAAQ,CAACkC,GAAG,CAAC,CAACV,GAAG,GAAKA,GAAG,CAAC8B,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAAA,CAAC,CAACC,MAAM,CAACC,OAAO,CAAC,CACzD,CAAC;KACH,CAAC,OAAOC,KAAK,EAAO;QACnB,+DAA+D;QAC/D,IAAIA,KAAK,CAACC,aAAa,EAAE;YACvB3D,GAAG,CAAC4D,IAAI,CAAC,CAAC,8BAA8B,CAAC,GAAGF,KAAK,CAACG,OAAO,CAAC,CAAC;YAC3D,OAAO;SACR;QACD,4BAA4B;QAC5B,MAAMH,KAAK,CAAC;KACb;CACF"}
|
|
1
|
+
{"version":3,"sources":["../../../src/install/installAsync.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport * as PackageManager from '@expo/package-manager';\nimport chalk from 'chalk';\n\nimport * as Log from '../log';\nimport {\n getOperationLog,\n getVersionedPackagesAsync,\n} from '../start/doctor/dependencies/getVersionedPackages';\nimport { getVersionedDependenciesAsync } from '../start/doctor/dependencies/validateDependenciesVersions';\nimport { groupBy } from '../utils/array';\nimport { findUpProjectRootOrAssert } from '../utils/findUp';\nimport { learnMore } from '../utils/link';\nimport { setNodeEnv } from '../utils/nodeEnv';\nimport { joinWithCommasAnd } from '../utils/strings';\nimport { checkPackagesAsync } from './checkPackages';\nimport { Options } from './resolveOptions';\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 if (options.check || options.fix) {\n return await checkPackagesAsync(projectRoot, {\n packages,\n options,\n packageManager,\n packageManagerArguments,\n });\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 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 }: {\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 } = 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 //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 Log.log(\n chalk`\\u203A Using latest version instead of ${joinWithCommasAnd(\n versioning.excludedNativeModules.map(\n ({ bundledNativeVersion, name }) => `${bundledNativeVersion} for ${name}`\n )\n )} because ${\n versioning.excludedNativeModules.length > 1 ? 'they are' : 'it is'\n } listed in {bold expo.install.exclude} in package.json. ${learnMore(\n 'https://expo.dev/more/expo-cli/#configuring-dependency-validation'\n )}`\n );\n }\n\n await packageManager.addAsync([...packageManagerArguments, ...versioning.packages]);\n\n await applyPluginsAsync(projectRoot, versioning.packages);\n}\n\nexport async function fixPackagesAsync(\n projectRoot: string,\n {\n packages,\n packageManager,\n sdkVersion,\n packageManagerArguments,\n }: {\n packages: Awaited<ReturnType<typeof getVersionedDependenciesAsync>>;\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 if (!packages.length) {\n return;\n }\n\n const { dependencies = [], devDependencies = [] } = groupBy(packages, (dep) => dep.packageType);\n const versioningMessages = getOperationLog({\n othersCount: 0, // All fixable packages are versioned\n nativeModulesCount: packages.length,\n sdkVersion,\n });\n\n Log.log(\n chalk`\\u203A Installing ${\n versioningMessages.length ? versioningMessages.join(' and ') + ' ' : ''\n }using {bold ${packageManager.name}}`\n );\n\n if (dependencies.length) {\n const versionedPackages = dependencies.map(\n (dep) => `${dep.packageName}@${dep.expectedVersionOrRange}`\n );\n\n await packageManager.addAsync([...packageManagerArguments, ...versionedPackages]);\n\n await applyPluginsAsync(projectRoot, versionedPackages);\n }\n\n if (devDependencies.length) {\n await packageManager.addDevAsync([\n ...packageManagerArguments,\n ...devDependencies.map((dep) => `${dep.packageName}@${dep.expectedVersionOrRange}`),\n ]);\n }\n}\n\n/**\n * A convenience feature for automatically applying Expo Config Plugins to the `app.json` after installing them.\n * This should be dropped in favor of autolinking in the future.\n */\nasync function applyPluginsAsync(projectRoot: string, packages: string[]) {\n const { autoAddConfigPluginsAsync } = await import('./utils/autoAddConfigPlugins');\n\n try {\n const { exp } = getConfig(projectRoot, { skipSDKVersionRequirement: true });\n\n // Only auto add plugins if the plugins array is defined or if the project is using SDK +42.\n await autoAddConfigPluginsAsync(\n projectRoot,\n exp,\n // Split any possible NPM tags. i.e. `expo@latest` -> `expo`\n packages.map((pkg) => pkg.split('@')[0]).filter(Boolean)\n );\n } catch (error: any) {\n // If we fail to apply plugins, the log a warning and continue.\n if (error.isPluginError) {\n Log.warn(`Skipping config plugin check: ` + error.message);\n return;\n }\n // Any other error, rethrow.\n throw error;\n }\n}\n"],"names":["installAsync","installPackagesAsync","fixPackagesAsync","PackageManager","Log","packages","options","packageManagerArguments","setNodeEnv","projectRoot","findUpProjectRootOrAssert","process","cwd","require","load","packageManager","createForProject","npm","yarn","bun","pnpm","silent","log","check","fix","checkPackagesAsync","exp","getConfig","skipPlugins","sdkVersion","pkg","versioning","getVersionedPackagesAsync","chalk","messages","length","join","name","excludedNativeModules","joinWithCommasAnd","map","bundledNativeVersion","learnMore","addAsync","applyPluginsAsync","dependencies","devDependencies","groupBy","dep","packageType","versioningMessages","getOperationLog","othersCount","nativeModulesCount","versionedPackages","packageName","expectedVersionOrRange","addDevAsync","autoAddConfigPluginsAsync","skipSDKVersionRequirement","split","filter","Boolean","error","isPluginError","warn","message"],"mappings":"AAAA;;;;QAkBsBA,YAAY,GAAZA,YAAY;QA+CZC,oBAAoB,GAApBA,oBAAoB;QAoEpBC,gBAAgB,GAAhBA,gBAAgB;AArIZ,IAAA,OAAc,WAAd,cAAc,CAAA;AAC5BC,IAAAA,cAAc,mCAAM,uBAAuB,EAA7B;AACR,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEbC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AAIR,IAAA,qBAAmD,WAAnD,mDAAmD,CAAA;AAElC,IAAA,MAAgB,WAAhB,gBAAgB,CAAA;AACE,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;AACjC,IAAA,KAAe,WAAf,eAAe,CAAA;AACd,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;AACX,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;AACjB,IAAA,cAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAG7C,eAAeJ,YAAY,CAChCK,QAAkB,EAClBC,OAA2C,EAC3CC,uBAAiC,GAAG,EAAE,EACtC;IACAC,CAAAA,GAAAA,QAAU,AAAe,CAAA,WAAf,CAAC,aAAa,CAAC,CAAC;QAGNF,YAAmB;IAFvC,0EAA0E;IAC1E,mFAAmF;IACnF,MAAMG,WAAW,GAAGH,CAAAA,YAAmB,GAAnBA,OAAO,CAACG,WAAW,YAAnBH,YAAmB,GAAII,CAAAA,GAAAA,OAAyB,AAAe,CAAA,0BAAf,CAACC,OAAO,CAACC,GAAG,EAAE,CAAC,AAAC;IACpFC,OAAO,CAAC,WAAW,CAAC,CAACC,IAAI,CAACL,WAAW,CAAC,CAAC;IAEvC,uFAAuF;IACvF,MAAMM,cAAc,GAAGZ,cAAc,CAACa,gBAAgB,CAACP,WAAW,EAAE;QAClEQ,G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,CAAC,EAAEP,GAAG,CAACQ,sBAAsB,CAAC,CAAC;YAAA,CAAC;SACpF,CAAC,CAAC;KACJ;CACF;AAED;;;GAGG,CACH,eAAeZ,iBAAiB,CAACnC,WAAmB,EAAEJ,QAAkB,EAAE;IACxE,MAAM,EAAEqD,yBAAyB,CAAA,EAAE,GAAG,MAAM;+CAAO,8BAA8B;MAAC,AAAC;IAEnF,IAAI;QACF,MAAM,EAAEhC,GAAG,CAAA,EAAE,GAAGC,CAAAA,GAAAA,OAAS,AAAkD,CAAA,UAAlD,CAAClB,WAAW,EAAE;YAAEkD,yBAAyB,EAAE,IAAI;SAAE,CAAC,AAAC;QAE5E,4FAA4F;QAC5F,MAAMD,yBAAyB,CAC7BjD,WAAW,EACXiB,GAAG,EACH,4DAA4D;QAC5DrB,QAAQ,CAACmC,GAAG,CAAC,CAACV,GAAG,GAAKA,GAAG,CAAC8B,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAAA,CAAC,CAACC,MAAM,CAACC,OAAO,CAAC,CACzD,CAAC;KACH,CAAC,OAAOC,KAAK,EAAO;QACnB,+DAA+D;QAC/D,IAAIA,KAAK,CAACC,aAAa,EAAE;YACvB5D,GAAG,CAAC6D,IAAI,CAAC,CAAC,8BAA8B,CAAC,GAAGF,KAAK,CAACG,OAAO,CAAC,CAAC;YAC3D,OAAO;SACR;QACD,4BAA4B;QAC5B,MAAMH,KAAK,CAAC;KACb;CACF"}
|
|
@@ -12,9 +12,10 @@ function resolveOptions(options) {
|
|
|
12
12
|
if ([
|
|
13
13
|
options.npm,
|
|
14
14
|
options.pnpm,
|
|
15
|
-
options.yarn
|
|
15
|
+
options.yarn,
|
|
16
|
+
options.bun
|
|
16
17
|
].filter(Boolean).length > 1) {
|
|
17
|
-
throw new _errors.CommandError("BAD_ARGS", "Specify at most one of: --npm, --pnpm, --yarn");
|
|
18
|
+
throw new _errors.CommandError("BAD_ARGS", "Specify at most one of: --npm, --pnpm, --yarn, --bun");
|
|
18
19
|
}
|
|
19
20
|
return {
|
|
20
21
|
...options
|
|
@@ -27,7 +28,8 @@ async function resolveArgsAsync(argv) {
|
|
|
27
28
|
"--fix",
|
|
28
29
|
"--npm",
|
|
29
30
|
"--pnpm",
|
|
30
|
-
"--yarn"
|
|
31
|
+
"--yarn",
|
|
32
|
+
"--bun"
|
|
31
33
|
], {
|
|
32
34
|
variadic,
|
|
33
35
|
extras,
|
|
@@ -41,7 +43,8 @@ async function resolveArgsAsync(argv) {
|
|
|
41
43
|
check: !!flags["--check"],
|
|
42
44
|
yarn: !!flags["--yarn"],
|
|
43
45
|
npm: !!flags["--npm"],
|
|
44
|
-
pnpm: !!flags["--pnpm"]
|
|
46
|
+
pnpm: !!flags["--pnpm"],
|
|
47
|
+
bun: !!flags["--bun"]
|
|
45
48
|
}),
|
|
46
49
|
extras
|
|
47
50
|
};
|
|
@@ -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'> & {\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};\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].filter(Boolean).length > 1) {\n throw new CommandError('BAD_ARGS', 'Specify at most one of: --npm, --pnpm, --yarn');\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'],\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 }),\n extras,\n };\n}\n"],"names":["resolveArgsAsync","resolveOptions","options","fix","check","CommandError","npm","pnpm","yarn","filter","Boolean","length","argv","variadic","extras","flags","parseVariadicArguments","assertUnexpectedVariadicFlags"],"mappings":"AAAA;;;;QA0BsBA,gBAAgB,GAAhBA,gBAAgB;AAxBT,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;AACwB,IAAA,SAAmB,WAAnB,mBAAmB,CAAA;AAWzF,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;KAC9E;IACD,IAAI;QAACH,OAAO,CAACI,GAAG;QAAEJ,OAAO,CAACK,IAAI;QAAEL,OAAO,CAACM,IAAI;KAAC,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,MAAM,GAAG,CAAC,EAAE;
|
|
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};\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;;;;QA0BsBA,gBAAgB,GAAhBA,gBAAgB;AAxBT,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;AACwB,IAAA,SAAmB,WAAnB,mBAAmB,CAAA;AAWzF,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;KAC9E;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;KAC5F;IACD,OAAO;QACL,GAAGH,OAAO;KACX,CAAC;CACH;AAEM,eAAeF,gBAAgB,CACpCa,IAAc,EACuD;IACrE,MAAM,EAAEC,QAAQ,CAAA,EAAEC,MAAM,CAAA,EAAEC,KAAK,CAAA,EAAE,GAAGC,CAAAA,GAAAA,SAAsB,AAAM,CAAA,uBAAN,CAACJ,IAAI,CAAC,AAAC;IAEjEK,CAAAA,GAAAA,SAA6B,AAI5B,CAAA,8BAJ4B,CAC3B;QAAC,SAAS;QAAE,OAAO;QAAE,OAAO;QAAE,QAAQ;QAAE,QAAQ;QAAE,OAAO;KAAC,EAC1D;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;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;CACH"}
|
|
@@ -40,6 +40,7 @@ const expoPrebuild = async (argv)=>{
|
|
|
40
40
|
"--npm": Boolean,
|
|
41
41
|
"--pnpm": Boolean,
|
|
42
42
|
"--yarn": Boolean,
|
|
43
|
+
"--bun": Boolean,
|
|
43
44
|
"--no-install": Boolean,
|
|
44
45
|
"--template": String,
|
|
45
46
|
"--platform": String,
|
|
@@ -56,6 +57,7 @@ const expoPrebuild = async (argv)=>{
|
|
|
56
57
|
`--clean Delete the native folders and regenerate them before applying changes`,
|
|
57
58
|
_chalk.default`--npm Use npm to install dependencies. {dim Default when package-lock.json exists}`,
|
|
58
59
|
_chalk.default`--yarn Use Yarn to install dependencies. {dim Default when yarn.lock exists}`,
|
|
60
|
+
_chalk.default`--bun Use bun to install dependencies. {dim Default when bun.lockb exists}`,
|
|
59
61
|
_chalk.default`--pnpm Use pnpm to install dependencies. {dim Default when pnpm-lock.yaml exists}`,
|
|
60
62
|
`--template <template> Project template to clone from. File path pointing to a local tar file or a github repo`,
|
|
61
63
|
_chalk.default`-p, --platform <all|android|ios> Platforms to sync: ios, android, all. {dim Default: all}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/prebuild/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport { assertArgs, getProjectRoot, printHelp } from '../utils/args';\n\nexport const expoPrebuild: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n '--clean': Boolean,\n '--npm': Boolean,\n '--pnpm': Boolean,\n '--yarn': Boolean,\n '--no-install': Boolean,\n '--template': String,\n '--platform': String,\n '--skip-dependency-update': String,\n // Aliases\n '-h': '--help',\n '-p': '--platform',\n '-t': '--type',\n },\n argv\n );\n\n if (args['--help']) {\n printHelp(\n `Create native iOS and Android project files for building natively`,\n chalk`npx expo prebuild {dim <dir>}`,\n [\n chalk`<dir> Directory of the Expo project. {dim Default: Current working directory}`,\n `--no-install Skip installing npm packages and CocoaPods`,\n `--clean Delete the native folders and regenerate them before applying changes`,\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`--pnpm Use pnpm to install dependencies. {dim Default when pnpm-lock.yaml exists}`,\n `--template <template> Project template to clone from. File path pointing to a local tar file or a github repo`,\n chalk`-p, --platform <all|android|ios> Platforms to sync: ios, android, all. {dim Default: all}`,\n `--skip-dependency-update <dependencies> Preserves versions of listed packages in package.json (comma separated list)`,\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n // Load modules after the help prompt so `npx expo prebuild -h` shows as fast as possible.\n const [\n // ./prebuildAsync\n { prebuildAsync },\n // ./resolveOptions\n { resolvePlatformOption, resolvePackageManagerOptions, resolveSkipDependencyUpdate },\n // ../utils/errors\n { logCmdError },\n ] = await Promise.all([\n import('./prebuildAsync'),\n import('./resolveOptions'),\n import('../utils/errors'),\n ]);\n\n return (() => {\n return prebuildAsync(getProjectRoot(args), {\n // Parsed options\n clean: args['--clean'],\n\n packageManager: resolvePackageManagerOptions(args),\n install: !args['--no-install'],\n platforms: resolvePlatformOption(args['--platform']),\n // TODO: Parse\n skipDependencyUpdate: resolveSkipDependencyUpdate(args['--skip-dependency-update']),\n template: args['--template'],\n });\n })().catch(logCmdError);\n};\n"],"names":["expoPrebuild","argv","args","assertArgs","Boolean","String","printHelp","chalk","join","prebuildAsync","resolvePlatformOption","resolvePackageManagerOptions","resolveSkipDependencyUpdate","logCmdError","Promise","all","getProjectRoot","clean","packageManager","install","platforms","skipDependencyUpdate","template","catch"],"mappings":"AAAA;;;;;;AACkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAG6B,IAAA,KAAe,WAAf,eAAe,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9D,MAAMA,YAAY,GAAY,OAAOC,IAAI,GAAK;IACnD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAU,
|
|
1
|
+
{"version":3,"sources":["../../../src/prebuild/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport { assertArgs, getProjectRoot, printHelp } from '../utils/args';\n\nexport const expoPrebuild: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n '--clean': Boolean,\n '--npm': Boolean,\n '--pnpm': Boolean,\n '--yarn': Boolean,\n '--bun': Boolean,\n '--no-install': Boolean,\n '--template': String,\n '--platform': String,\n '--skip-dependency-update': String,\n // Aliases\n '-h': '--help',\n '-p': '--platform',\n '-t': '--type',\n },\n argv\n );\n\n if (args['--help']) {\n printHelp(\n `Create native iOS and Android project files for building natively`,\n chalk`npx expo prebuild {dim <dir>}`,\n [\n chalk`<dir> Directory of the Expo project. {dim Default: Current working directory}`,\n `--no-install Skip installing npm packages and CocoaPods`,\n `--clean Delete the native folders and regenerate them before applying changes`,\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.lockb exists}`,\n chalk`--pnpm Use pnpm to install dependencies. {dim Default when pnpm-lock.yaml exists}`,\n `--template <template> Project template to clone from. File path pointing to a local tar file or a github repo`,\n chalk`-p, --platform <all|android|ios> Platforms to sync: ios, android, all. {dim Default: all}`,\n `--skip-dependency-update <dependencies> Preserves versions of listed packages in package.json (comma separated list)`,\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n // Load modules after the help prompt so `npx expo prebuild -h` shows as fast as possible.\n const [\n // ./prebuildAsync\n { prebuildAsync },\n // ./resolveOptions\n { resolvePlatformOption, resolvePackageManagerOptions, resolveSkipDependencyUpdate },\n // ../utils/errors\n { logCmdError },\n ] = await Promise.all([\n import('./prebuildAsync'),\n import('./resolveOptions'),\n import('../utils/errors'),\n ]);\n\n return (() => {\n return prebuildAsync(getProjectRoot(args), {\n // Parsed options\n clean: args['--clean'],\n\n packageManager: resolvePackageManagerOptions(args),\n install: !args['--no-install'],\n platforms: resolvePlatformOption(args['--platform']),\n // TODO: Parse\n skipDependencyUpdate: resolveSkipDependencyUpdate(args['--skip-dependency-update']),\n template: args['--template'],\n });\n })().catch(logCmdError);\n};\n"],"names":["expoPrebuild","argv","args","assertArgs","Boolean","String","printHelp","chalk","join","prebuildAsync","resolvePlatformOption","resolvePackageManagerOptions","resolveSkipDependencyUpdate","logCmdError","Promise","all","getProjectRoot","clean","packageManager","install","platforms","skipDependencyUpdate","template","catch"],"mappings":"AAAA;;;;;;AACkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAG6B,IAAA,KAAe,WAAf,eAAe,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9D,MAAMA,YAAY,GAAY,OAAOC,IAAI,GAAK;IACnD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAU,AAmBtB,CAAA,WAnBsB,CACrB;QACE,QAAQ;QACR,QAAQ,EAAEC,OAAO;QACjB,SAAS,EAAEA,OAAO;QAClB,OAAO,EAAEA,OAAO;QAChB,QAAQ,EAAEA,OAAO;QACjB,QAAQ,EAAEA,OAAO;QACjB,OAAO,EAAEA,OAAO;QAChB,cAAc,EAAEA,OAAO;QACvB,YAAY,EAAEC,MAAM;QACpB,YAAY,EAAEA,MAAM;QACpB,0BAA0B,EAAEA,MAAM;QAClC,UAAU;QACV,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,QAAQ;KACf,EACDJ,IAAI,CACL,AAAC;IAEF,IAAIC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAClBI,CAAAA,GAAAA,KAAS,AAgBR,CAAA,UAhBQ,CACP,CAAC,iEAAiE,CAAC,EACnEC,MAAK,QAAA,CAAC,6BAA6B,CAAC,EACpC;YACEA,MAAK,QAAA,CAAC,gHAAgH,CAAC;YACvH,CAAC,mFAAmF,CAAC;YACrF,CAAC,8GAA8G,CAAC;YAChHA,MAAK,QAAA,CAAC,qHAAqH,CAAC;YAC5HA,MAAK,QAAA,CAAC,8GAA8G,CAAC;YACrHA,MAAK,QAAA,CAAC,6GAA6G,CAAC;YACpHA,MAAK,QAAA,CAAC,mHAAmH,CAAC;YAC1H,CAAC,gIAAgI,CAAC;YAClIA,MAAK,QAAA,CAAC,iGAAiG,CAAC;YACxG,CAAC,qHAAqH,CAAC;YACvH,CAAC,mDAAmD,CAAC;SACtD,CAACC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;KACH;IAED,0FAA0F;IAC1F,MAAM,CACJ,kBAAkB;IAClB,EAAEC,aAAa,CAAA,EAAE,EACjB,mBAAmB;IACnB,EAAEC,qBAAqB,CAAA,EAAEC,4BAA4B,CAAA,EAAEC,2BAA2B,CAAA,EAAE,EACpF,kBAAkB;IAClB,EAAEC,WAAW,CAAA,EAAE,GAChB,GAAG,MAAMC,OAAO,CAACC,GAAG,CAAC;QACpB;mDAAO,iBAAiB;UAAC;QACzB;mDAAO,kBAAkB;UAAC;QAC1B;mDAAO,iBAAiB;UAAC;KAC1B,CAAC,AAAC;IAEH,OAAO,CAAC,IAAM;QACZ,OAAON,aAAa,CAACO,CAAAA,GAAAA,KAAc,AAAM,CAAA,eAAN,CAACd,IAAI,CAAC,EAAE;YACzC,iBAAiB;YACjBe,KAAK,EAAEf,IAAI,CAAC,SAAS,CAAC;YAEtBgB,cAAc,EAAEP,4BAA4B,CAACT,IAAI,CAAC;YAClDiB,OAAO,EAAE,CAACjB,IAAI,CAAC,cAAc,CAAC;YAC9BkB,SAAS,EAAEV,qBAAqB,CAACR,IAAI,CAAC,YAAY,CAAC,CAAC;YACpD,cAAc;YACdmB,oBAAoB,EAAET,2BAA2B,CAACV,IAAI,CAAC,0BAA0B,CAAC,CAAC;YACnFoB,QAAQ,EAAEpB,IAAI,CAAC,YAAY,CAAC;SAC7B,CAAC,CAAC;KACJ,CAAC,EAAE,CAACqB,KAAK,CAACV,WAAW,CAAC,CAAC;CACzB,AAAC;QArEWb,YAAY,GAAZA,YAAY"}
|
|
@@ -71,7 +71,7 @@ async function prebuildAsync(projectRoot, options) {
|
|
|
71
71
|
});
|
|
72
72
|
// Install node modules
|
|
73
73
|
if (options.install) {
|
|
74
|
-
var ref, ref1, ref2, ref3;
|
|
74
|
+
var ref, ref1, ref2, ref3, ref4;
|
|
75
75
|
if (hasNewDependencies && ((ref = options.packageManager) == null ? void 0 : ref.npm)) {
|
|
76
76
|
await (0, _nodeModules).clearNodeModulesAsync(projectRoot);
|
|
77
77
|
}
|
|
@@ -79,6 +79,7 @@ async function prebuildAsync(projectRoot, options) {
|
|
|
79
79
|
npm: !!((ref1 = options.packageManager) == null ? void 0 : ref1.npm),
|
|
80
80
|
yarn: !!((ref2 = options.packageManager) == null ? void 0 : ref2.yarn),
|
|
81
81
|
pnpm: !!((ref3 = options.packageManager) == null ? void 0 : ref3.pnpm),
|
|
82
|
+
bun: !!((ref4 = options.packageManager) == null ? void 0 : ref4.bun),
|
|
82
83
|
silent: !(_env.env.EXPO_DEBUG || _env.env.CI)
|
|
83
84
|
});
|
|
84
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/prebuild/prebuildAsync.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config';\nimport { ModPlatform } from '@expo/config-plugins';\n\nimport { installAsync } from '../install/installAsync';\nimport { env } from '../utils/env';\nimport { setNodeEnv } from '../utils/nodeEnv';\nimport { clearNodeModulesAsync } from '../utils/nodeModules';\nimport { logNewSection } from '../utils/ora';\nimport { profile } from '../utils/profile';\nimport { clearNativeFolder, promptToClearMalformedNativeProjectsAsync } from './clearNativeFolder';\nimport { configureProjectAsync } from './configureProjectAsync';\nimport { ensureConfigAsync } from './ensureConfigAsync';\nimport { assertPlatforms, ensureValidPlatforms, resolveTemplateOption } from './resolveOptions';\nimport { updateFromTemplateAsync } from './updateFromTemplate';\n\nconst debug = require('debug')('expo:prebuild') as typeof console.log;\n\nexport type PrebuildResults = {\n /** Expo config. */\n exp: ExpoConfig;\n /** Indicates if the process created new files. */\n hasNewProjectFiles: boolean;\n /** The platforms that were prebuilt. */\n platforms: ModPlatform[];\n /** Indicates if pod install was run. */\n podInstall: boolean;\n /** Indicates if node modules were installed. */\n nodeInstall: boolean;\n};\n\n/**\n * Entry point into the prebuild process, delegates to other helpers to perform various steps.\n *\n * 0. Attempt to clean the project folders.\n * 1. Create native projects (ios, android).\n * 2. Install node modules.\n * 3. Apply config to native projects.\n * 4. Install CocoaPods.\n */\nexport async function prebuildAsync(\n projectRoot: string,\n options: {\n /** Should install node modules and cocoapods. */\n install?: boolean;\n /** List of platforms to prebuild. */\n platforms: ModPlatform[];\n /** Should delete the native folders before attempting to prebuild. */\n clean?: boolean;\n /** URL or file path to the prebuild template. */\n template?: string;\n /** Name of the node package manager to install with. */\n packageManager?: {\n npm?: boolean;\n yarn?: boolean;\n pnpm?: boolean;\n };\n /** List of node modules to skip updating. */\n skipDependencyUpdate?: string[];\n }\n): Promise<PrebuildResults | null> {\n setNodeEnv('development');\n require('@expo/env').load(projectRoot);\n\n if (options.clean) {\n const { maybeBailOnGitStatusAsync } = await import('../utils/git');\n // Clean the project folders...\n if (await maybeBailOnGitStatusAsync()) {\n return null;\n }\n // Clear the native folders before syncing\n await clearNativeFolder(projectRoot, options.platforms);\n } else {\n // Check if the existing project folders are malformed.\n await promptToClearMalformedNativeProjectsAsync(projectRoot, options.platforms);\n }\n\n // Warn if the project is attempting to prebuild an unsupported platform (iOS on Windows).\n options.platforms = ensureValidPlatforms(options.platforms);\n // Assert if no platforms are left over after filtering.\n assertPlatforms(options.platforms);\n\n // Get the Expo config, create it if missing.\n const { exp, pkg } = await ensureConfigAsync(projectRoot, { platforms: options.platforms });\n\n // Create native projects from template.\n const { hasNewProjectFiles, needsPodInstall, hasNewDependencies } = await updateFromTemplateAsync(\n projectRoot,\n {\n exp,\n pkg,\n template: options.template != null ? resolveTemplateOption(options.template) : undefined,\n platforms: options.platforms,\n skipDependencyUpdate: options.skipDependencyUpdate,\n }\n );\n\n // Install node modules\n if (options.install) {\n if (hasNewDependencies && options.packageManager?.npm) {\n await clearNodeModulesAsync(projectRoot);\n }\n\n await installAsync([], {\n npm: !!options.packageManager?.npm,\n yarn: !!options.packageManager?.yarn,\n pnpm: !!options.packageManager?.pnpm,\n silent: !(env.EXPO_DEBUG || env.CI),\n });\n }\n\n // Apply Expo config to native projects\n const configSyncingStep = logNewSection('Config syncing');\n try {\n await profile(configureProjectAsync)(projectRoot, {\n platforms: options.platforms,\n });\n configSyncingStep.succeed('Config synced');\n } catch (error) {\n configSyncingStep.fail('Config sync failed');\n throw error;\n }\n\n // Install CocoaPods\n let podsInstalled: boolean = false;\n // err towards running pod install less because it's slow and users can easily run npx pod-install afterwards.\n if (options.platforms.includes('ios') && options.install && needsPodInstall) {\n const { installCocoaPodsAsync } = await import('../utils/cocoapods');\n\n podsInstalled = await installCocoaPodsAsync(projectRoot);\n } else {\n debug('Skipped pod install');\n }\n\n return {\n nodeInstall: !!options.install,\n podInstall: !podsInstalled,\n platforms: options.platforms,\n hasNewProjectFiles,\n exp,\n };\n}\n"],"names":["prebuildAsync","debug","require","projectRoot","options","setNodeEnv","load","clean","maybeBailOnGitStatusAsync","clearNativeFolder","platforms","promptToClearMalformedNativeProjectsAsync","ensureValidPlatforms","assertPlatforms","exp","pkg","ensureConfigAsync","hasNewProjectFiles","needsPodInstall","hasNewDependencies","updateFromTemplateAsync","template","resolveTemplateOption","undefined","skipDependencyUpdate","install","packageManager","npm","clearNodeModulesAsync","installAsync","yarn","pnpm","silent","env","EXPO_DEBUG","CI","configSyncingStep","logNewSection","profile","configureProjectAsync","succeed","error","fail","podsInstalled","includes","installCocoaPodsAsync","nodeInstall","podInstall"],"mappings":"AAAA;;;;QAuCsBA,aAAa,GAAbA,aAAa;AApCN,IAAA,aAAyB,WAAzB,yBAAyB,CAAA;AAClC,IAAA,IAAc,WAAd,cAAc,CAAA;AACP,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;AACP,IAAA,YAAsB,WAAtB,sBAAsB,CAAA;AAC9B,IAAA,IAAc,WAAd,cAAc,CAAA;AACpB,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;AACmC,IAAA,kBAAqB,WAArB,qBAAqB,CAAA;AAC5D,IAAA,sBAAyB,WAAzB,yBAAyB,CAAA;AAC7B,IAAA,kBAAqB,WAArB,qBAAqB,CAAA;AACsB,IAAA,eAAkB,WAAlB,kBAAkB,CAAA;AACvD,IAAA,mBAAsB,WAAtB,sBAAsB,CAAA;;;;;;;;;;;;;;;;;;;;;;AAE9D,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,AAAsB,AAAC;AAwB/D,eAAeF,aAAa,CACjCG,WAAmB,EACnBC,
|
|
1
|
+
{"version":3,"sources":["../../../src/prebuild/prebuildAsync.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config';\nimport { ModPlatform } from '@expo/config-plugins';\n\nimport { installAsync } from '../install/installAsync';\nimport { env } from '../utils/env';\nimport { setNodeEnv } from '../utils/nodeEnv';\nimport { clearNodeModulesAsync } from '../utils/nodeModules';\nimport { logNewSection } from '../utils/ora';\nimport { profile } from '../utils/profile';\nimport { clearNativeFolder, promptToClearMalformedNativeProjectsAsync } from './clearNativeFolder';\nimport { configureProjectAsync } from './configureProjectAsync';\nimport { ensureConfigAsync } from './ensureConfigAsync';\nimport { assertPlatforms, ensureValidPlatforms, resolveTemplateOption } from './resolveOptions';\nimport { updateFromTemplateAsync } from './updateFromTemplate';\n\nconst debug = require('debug')('expo:prebuild') as typeof console.log;\n\nexport type PrebuildResults = {\n /** Expo config. */\n exp: ExpoConfig;\n /** Indicates if the process created new files. */\n hasNewProjectFiles: boolean;\n /** The platforms that were prebuilt. */\n platforms: ModPlatform[];\n /** Indicates if pod install was run. */\n podInstall: boolean;\n /** Indicates if node modules were installed. */\n nodeInstall: boolean;\n};\n\n/**\n * Entry point into the prebuild process, delegates to other helpers to perform various steps.\n *\n * 0. Attempt to clean the project folders.\n * 1. Create native projects (ios, android).\n * 2. Install node modules.\n * 3. Apply config to native projects.\n * 4. Install CocoaPods.\n */\nexport async function prebuildAsync(\n projectRoot: string,\n options: {\n /** Should install node modules and cocoapods. */\n install?: boolean;\n /** List of platforms to prebuild. */\n platforms: ModPlatform[];\n /** Should delete the native folders before attempting to prebuild. */\n clean?: boolean;\n /** URL or file path to the prebuild template. */\n template?: string;\n /** Name of the node package manager to install with. */\n packageManager?: {\n npm?: boolean;\n yarn?: boolean;\n pnpm?: boolean;\n bun?: boolean;\n };\n /** List of node modules to skip updating. */\n skipDependencyUpdate?: string[];\n }\n): Promise<PrebuildResults | null> {\n setNodeEnv('development');\n require('@expo/env').load(projectRoot);\n\n if (options.clean) {\n const { maybeBailOnGitStatusAsync } = await import('../utils/git');\n // Clean the project folders...\n if (await maybeBailOnGitStatusAsync()) {\n return null;\n }\n // Clear the native folders before syncing\n await clearNativeFolder(projectRoot, options.platforms);\n } else {\n // Check if the existing project folders are malformed.\n await promptToClearMalformedNativeProjectsAsync(projectRoot, options.platforms);\n }\n\n // Warn if the project is attempting to prebuild an unsupported platform (iOS on Windows).\n options.platforms = ensureValidPlatforms(options.platforms);\n // Assert if no platforms are left over after filtering.\n assertPlatforms(options.platforms);\n\n // Get the Expo config, create it if missing.\n const { exp, pkg } = await ensureConfigAsync(projectRoot, { platforms: options.platforms });\n\n // Create native projects from template.\n const { hasNewProjectFiles, needsPodInstall, hasNewDependencies } = await updateFromTemplateAsync(\n projectRoot,\n {\n exp,\n pkg,\n template: options.template != null ? resolveTemplateOption(options.template) : undefined,\n platforms: options.platforms,\n skipDependencyUpdate: options.skipDependencyUpdate,\n }\n );\n\n // Install node modules\n if (options.install) {\n if (hasNewDependencies && options.packageManager?.npm) {\n await clearNodeModulesAsync(projectRoot);\n }\n\n await installAsync([], {\n npm: !!options.packageManager?.npm,\n yarn: !!options.packageManager?.yarn,\n pnpm: !!options.packageManager?.pnpm,\n bun: !!options.packageManager?.bun,\n silent: !(env.EXPO_DEBUG || env.CI),\n });\n }\n\n // Apply Expo config to native projects\n const configSyncingStep = logNewSection('Config syncing');\n try {\n await profile(configureProjectAsync)(projectRoot, {\n platforms: options.platforms,\n });\n configSyncingStep.succeed('Config synced');\n } catch (error) {\n configSyncingStep.fail('Config sync failed');\n throw error;\n }\n\n // Install CocoaPods\n let podsInstalled: boolean = false;\n // err towards running pod install less because it's slow and users can easily run npx pod-install afterwards.\n if (options.platforms.includes('ios') && options.install && needsPodInstall) {\n const { installCocoaPodsAsync } = await import('../utils/cocoapods');\n\n podsInstalled = await installCocoaPodsAsync(projectRoot);\n } else {\n debug('Skipped pod install');\n }\n\n return {\n nodeInstall: !!options.install,\n podInstall: !podsInstalled,\n platforms: options.platforms,\n hasNewProjectFiles,\n exp,\n };\n}\n"],"names":["prebuildAsync","debug","require","projectRoot","options","setNodeEnv","load","clean","maybeBailOnGitStatusAsync","clearNativeFolder","platforms","promptToClearMalformedNativeProjectsAsync","ensureValidPlatforms","assertPlatforms","exp","pkg","ensureConfigAsync","hasNewProjectFiles","needsPodInstall","hasNewDependencies","updateFromTemplateAsync","template","resolveTemplateOption","undefined","skipDependencyUpdate","install","packageManager","npm","clearNodeModulesAsync","installAsync","yarn","pnpm","bun","silent","env","EXPO_DEBUG","CI","configSyncingStep","logNewSection","profile","configureProjectAsync","succeed","error","fail","podsInstalled","includes","installCocoaPodsAsync","nodeInstall","podInstall"],"mappings":"AAAA;;;;QAuCsBA,aAAa,GAAbA,aAAa;AApCN,IAAA,aAAyB,WAAzB,yBAAyB,CAAA;AAClC,IAAA,IAAc,WAAd,cAAc,CAAA;AACP,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;AACP,IAAA,YAAsB,WAAtB,sBAAsB,CAAA;AAC9B,IAAA,IAAc,WAAd,cAAc,CAAA;AACpB,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;AACmC,IAAA,kBAAqB,WAArB,qBAAqB,CAAA;AAC5D,IAAA,sBAAyB,WAAzB,yBAAyB,CAAA;AAC7B,IAAA,kBAAqB,WAArB,qBAAqB,CAAA;AACsB,IAAA,eAAkB,WAAlB,kBAAkB,CAAA;AACvD,IAAA,mBAAsB,WAAtB,sBAAsB,CAAA;;;;;;;;;;;;;;;;;;;;;;AAE9D,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,AAAsB,AAA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C;CACH"}
|
|
@@ -45,15 +45,17 @@ function resolvePackageManagerOptions(args) {
|
|
|
45
45
|
const managers = {
|
|
46
46
|
npm: args["--npm"],
|
|
47
47
|
yarn: args["--yarn"],
|
|
48
|
-
pnpm: args["--pnpm"]
|
|
48
|
+
pnpm: args["--pnpm"],
|
|
49
|
+
bun: args["--bun"]
|
|
49
50
|
};
|
|
50
51
|
if ([
|
|
51
52
|
managers.npm,
|
|
52
53
|
managers.pnpm,
|
|
53
54
|
managers.yarn,
|
|
55
|
+
managers.bun,
|
|
54
56
|
!!args["--no-install"]
|
|
55
57
|
].filter(Boolean).length > 1) {
|
|
56
|
-
throw new _errors.CommandError("BAD_ARGS", "Specify at most one of: --no-install, --npm, --pnpm, --yarn");
|
|
58
|
+
throw new _errors.CommandError("BAD_ARGS", "Specify at most one of: --no-install, --npm, --pnpm, --yarn, --bun");
|
|
57
59
|
}
|
|
58
60
|
return managers;
|
|
59
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/prebuild/resolveOptions.ts"],"sourcesContent":["import { ModPlatform } from '@expo/config-plugins';\nimport assert from 'assert';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport * as Log from '../log';\nimport { CommandError } from '../utils/errors';\nimport { validateUrl } from '../utils/url';\n\nexport function resolvePackageManagerOptions(args: any) {\n const managers: Record<string, boolean> = {\n npm: args['--npm'],\n yarn: args['--yarn'],\n pnpm: args['--pnpm'],\n };\n\n if (\n [managers.npm, managers.pnpm, managers.yarn, !!args['--no-install']].filter(Boolean).length > 1\n ) {\n throw new CommandError(\n 'BAD_ARGS',\n 'Specify at most one of: --no-install, --npm, --pnpm, --yarn'\n );\n }\n\n return managers;\n}\n\n/** Resolves a template option as a URL or file path pointing to a tar file. */\nexport function resolveTemplateOption(template: string) {\n if (validateUrl(template)) {\n return template;\n }\n const templatePath = path.resolve(template);\n assert(fs.existsSync(templatePath), 'template file does not exist: ' + templatePath);\n assert(\n fs.statSync(templatePath).isFile(),\n 'template must be a tar file created by running `npm pack` in a project: ' + templatePath\n );\n\n return templatePath;\n}\n\n/** Resolves dependencies to skip from a string joined by `,`. Example: `react-native,expo,lodash` */\nexport function resolveSkipDependencyUpdate(value: any) {\n if (!value || typeof value !== 'string') {\n return [];\n }\n return value.split(',');\n}\n\n/** Returns an array of platforms based on the input platform identifier and runtime constraints. */\nexport function resolvePlatformOption(\n platform: string = 'all',\n { loose }: { loose?: boolean } = {}\n): ModPlatform[] {\n switch (platform) {\n case 'ios':\n return ['ios'];\n case 'android':\n return ['android'];\n case 'all':\n return loose || process.platform !== 'win32' ? ['android', 'ios'] : ['android'];\n default:\n return [platform as ModPlatform];\n }\n}\n\n/** Warns and filters out unsupported platforms based on the runtime constraints. Essentially this means no iOS on Windows devices. */\nexport function ensureValidPlatforms(platforms: ModPlatform[]): ModPlatform[] {\n // Skip ejecting for iOS on Windows\n if (process.platform === 'win32' && platforms.includes('ios')) {\n Log.warn(\n chalk`⚠️ Skipping generating the iOS native project files. Run {bold expo eject} again from macOS or Linux to generate the iOS project.\\n`\n );\n return platforms.filter((platform) => platform !== 'ios');\n }\n return platforms;\n}\n\n/** Asserts platform length must be greater than zero. */\nexport function assertPlatforms(platforms: ModPlatform[]) {\n if (!platforms?.length) {\n throw new CommandError('At least one platform must be enabled when syncing');\n }\n}\n"],"names":["resolvePackageManagerOptions","resolveTemplateOption","resolveSkipDependencyUpdate","resolvePlatformOption","ensureValidPlatforms","assertPlatforms","Log","args","managers","npm","yarn","pnpm","filter","Boolean","length","CommandError","template","validateUrl","templatePath","path","resolve","assert","fs","existsSync","statSync","isFile","value","split","platform","loose","process","platforms","includes","warn","chalk"],"mappings":"AAAA;;;;QAUgBA,4BAA4B,GAA5BA,4BAA4B;
|
|
1
|
+
{"version":3,"sources":["../../../src/prebuild/resolveOptions.ts"],"sourcesContent":["import { ModPlatform } from '@expo/config-plugins';\nimport assert from 'assert';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport * as Log from '../log';\nimport { CommandError } from '../utils/errors';\nimport { validateUrl } from '../utils/url';\n\nexport function resolvePackageManagerOptions(args: any) {\n const managers: Record<string, boolean> = {\n npm: args['--npm'],\n yarn: args['--yarn'],\n pnpm: args['--pnpm'],\n bun: args['--bun'],\n };\n\n if (\n [managers.npm, managers.pnpm, managers.yarn, managers.bun, !!args['--no-install']].filter(\n Boolean\n ).length > 1\n ) {\n throw new CommandError(\n 'BAD_ARGS',\n 'Specify at most one of: --no-install, --npm, --pnpm, --yarn, --bun'\n );\n }\n\n return managers;\n}\n\n/** Resolves a template option as a URL or file path pointing to a tar file. */\nexport function resolveTemplateOption(template: string) {\n if (validateUrl(template)) {\n return template;\n }\n const templatePath = path.resolve(template);\n assert(fs.existsSync(templatePath), 'template file does not exist: ' + templatePath);\n assert(\n fs.statSync(templatePath).isFile(),\n 'template must be a tar file created by running `npm pack` in a project: ' + templatePath\n );\n\n return templatePath;\n}\n\n/** Resolves dependencies to skip from a string joined by `,`. Example: `react-native,expo,lodash` */\nexport function resolveSkipDependencyUpdate(value: any) {\n if (!value || typeof value !== 'string') {\n return [];\n }\n return value.split(',');\n}\n\n/** Returns an array of platforms based on the input platform identifier and runtime constraints. */\nexport function resolvePlatformOption(\n platform: string = 'all',\n { loose }: { loose?: boolean } = {}\n): ModPlatform[] {\n switch (platform) {\n case 'ios':\n return ['ios'];\n case 'android':\n return ['android'];\n case 'all':\n return loose || process.platform !== 'win32' ? ['android', 'ios'] : ['android'];\n default:\n return [platform as ModPlatform];\n }\n}\n\n/** Warns and filters out unsupported platforms based on the runtime constraints. Essentially this means no iOS on Windows devices. */\nexport function ensureValidPlatforms(platforms: ModPlatform[]): ModPlatform[] {\n // Skip ejecting for iOS on Windows\n if (process.platform === 'win32' && platforms.includes('ios')) {\n Log.warn(\n chalk`⚠️ Skipping generating the iOS native project files. Run {bold expo eject} again from macOS or Linux to generate the iOS project.\\n`\n );\n return platforms.filter((platform) => platform !== 'ios');\n }\n return platforms;\n}\n\n/** Asserts platform length must be greater than zero. */\nexport function assertPlatforms(platforms: ModPlatform[]) {\n if (!platforms?.length) {\n throw new CommandError('At least one platform must be enabled when syncing');\n }\n}\n"],"names":["resolvePackageManagerOptions","resolveTemplateOption","resolveSkipDependencyUpdate","resolvePlatformOption","ensureValidPlatforms","assertPlatforms","Log","args","managers","npm","yarn","pnpm","bun","filter","Boolean","length","CommandError","template","validateUrl","templatePath","path","resolve","assert","fs","existsSync","statSync","isFile","value","split","platform","loose","process","platforms","includes","warn","chalk"],"mappings":"AAAA;;;;QAUgBA,4BAA4B,GAA5BA,4BAA4B;QAuB5BC,qBAAqB,GAArBA,qBAAqB;QAerBC,2BAA2B,GAA3BA,2BAA2B;QAQ3BC,qBAAqB,GAArBA,qBAAqB;QAiBrBC,oBAAoB,GAApBA,oBAAoB;QAYpBC,eAAe,GAAfA,eAAe;AApFZ,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AACT,IAAA,MAAO,kCAAP,OAAO,EAAA;AACV,IAAA,GAAI,kCAAJ,IAAI,EAAA;AACF,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEXC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACc,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;AAClB,IAAA,IAAc,WAAd,cAAc,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEnC,SAASN,4BAA4B,CAACO,IAAS,EAAE;IACtD,MAAMC,QAAQ,GAA4B;QACxCC,GAAG,EAAEF,IAAI,CAAC,OAAO,CAAC;QAClBG,IAAI,EAAEH,IAAI,CAAC,QAAQ,CAAC;QACpBI,IAAI,EAAEJ,IAAI,CAAC,QAAQ,CAAC;QACpBK,GAAG,EAAEL,IAAI,CAAC,OAAO,CAAC;KACnB,AAAC;IAEF,IACE;QAACC,QAAQ,CAACC,GAAG;QAAED,QAAQ,CAACG,IAAI;QAAEH,QAAQ,CAACE,IAAI;QAAEF,QAAQ,CAACI,GAAG;QAA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AAQ,KAAK,OAAO,GAAG;gBAAC,SAAS;gBAAE,KAAK;aAAC,GAAG;gBAAC,SAAS;aAAC,CAAC;QAClF;YACE,OAAO;gBAACA,QAAQ;aAAgB,CAAC;KACpC;CACF;AAGM,SAASzB,oBAAoB,CAAC4B,SAAwB,EAAiB;IAC5E,mCAAmC;IACnC,IAAID,OAAO,CAACF,QAAQ,KAAK,OAAO,IAAIG,SAAS,CAACC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAC7D3B,GAAG,CAAC4B,IAAI,CACNC,MAAK,QAAA,CAAC,wIAAoI,CAAC,CAC5I,CAAC;QACF,OAAOH,SAAS,CAACnB,MAAM,CAAC,CAACgB,QAAQ,GAAKA,QAAQ,KAAK,KAAK;QAAA,CAAC,CAAC;KAC3D;IACD,OAAOG,SAAS,CAAC;CAClB;AAGM,SAAS3B,eAAe,CAAC2B,SAAwB,EAAE;IACxD,IAAI,CAACA,CAAAA,SAAS,QAAQ,GAAjBA,KAAAA,CAAiB,GAAjBA,SAAS,CAAEjB,MAAM,CAAA,EAAE;QACtB,MAAM,IAAIC,OAAY,aAAA,CAAC,oDAAoD,CAAC,CAAC;KAC9E;CACF"}
|
|
@@ -7,6 +7,7 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
7
7
|
var _log = require("../../log");
|
|
8
8
|
var _gradle = require("../../start/platforms/android/gradle");
|
|
9
9
|
var _nodeEnv = require("../../utils/nodeEnv");
|
|
10
|
+
var _port = require("../../utils/port");
|
|
10
11
|
var _scheme = require("../../utils/scheme");
|
|
11
12
|
var _ensureNativeProject = require("../ensureNativeProject");
|
|
12
13
|
var _hints = require("../hints");
|
|
@@ -38,6 +39,10 @@ async function runAndroidAsync(projectRoot, { install , ...options }) {
|
|
|
38
39
|
appName: props.appName,
|
|
39
40
|
buildCache: props.buildCache
|
|
40
41
|
});
|
|
42
|
+
// Ensure the port hasn't become busy during the build.
|
|
43
|
+
if (props.shouldStartBundler && !await (0, _port).ensurePortAvailabilityAsync(projectRoot, props)) {
|
|
44
|
+
props.shouldStartBundler = false;
|
|
45
|
+
}
|
|
41
46
|
const manager = await (0, _startBundler).startBundlerAsync(projectRoot, {
|
|
42
47
|
port: props.port,
|
|
43
48
|
// If a scheme is specified then use that instead of the package name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/run/android/runAndroidAsync.ts"],"sourcesContent":["import path from 'path';\n\nimport { Log } from '../../log';\nimport { assembleAsync, installAsync } from '../../start/platforms/android/gradle';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { getSchemesForAndroidAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\nimport { resolveInstallApkNameAsync } from './resolveInstallApkName';\nimport { Options, ResolvedOptions, resolveOptionsAsync } from './resolveOptions';\n\nconst debug = require('debug')('expo:run:android');\n\nexport async function runAndroidAsync(projectRoot: string, { install, ...options }: Options) {\n // NOTE: This is a guess, the developer can overwrite with `NODE_ENV`.\n setNodeEnv(options.variant === 'release' ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n await ensureNativeProjectAsync(projectRoot, { platform: 'android', install });\n\n const props = await resolveOptionsAsync(projectRoot, options);\n\n debug('Package name: ' + props.packageName);\n Log.log('› Building app...');\n\n const androidProjectRoot = path.join(projectRoot, 'android');\n\n await assembleAsync(androidProjectRoot, {\n variant: props.variant,\n port: props.port,\n appName: props.appName,\n buildCache: props.buildCache,\n });\n\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n // If a scheme is specified then use that instead of the package name.\n scheme: (await getSchemesForAndroidAsync(projectRoot))?.[0],\n headless: !props.shouldStartBundler,\n });\n\n await installAppAsync(androidProjectRoot, props);\n\n await manager.getDefaultDevServer().openCustomRuntimeAsync(\n 'emulator',\n {\n applicationId: props.packageName,\n },\n { device: props.device.device }\n );\n\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n }\n}\n\nasync function installAppAsync(androidProjectRoot: string, props: ResolvedOptions) {\n // Find the APK file path\n const apkFile = await resolveInstallApkNameAsync(props.device.device, props);\n\n if (apkFile) {\n // Attempt to install the APK from the file path\n const binaryPath = path.join(props.apkVariantDirectory, apkFile);\n debug('Installing:', binaryPath);\n await props.device.installAppAsync(binaryPath);\n } else {\n // If we cannot resolve the APK file path then we can attempt to install using Gradle.\n // This offers more advanced resolution that we may not have first class support for.\n Log.log('› Failed to locate binary file, installing with Gradle...');\n await installAsync(androidProjectRoot, {\n variant: props.variant ?? 'debug',\n appName: props.appName ?? 'app',\n port: props.port,\n });\n }\n}\n"],"names":["runAndroidAsync","debug","require","projectRoot","install","options","setNodeEnv","variant","load","ensureNativeProjectAsync","platform","props","resolveOptionsAsync","packageName","Log","log","androidProjectRoot","path","join","assembleAsync","port","appName","buildCache","manager","startBundlerAsync","scheme","getSchemesForAndroidAsync","headless","
|
|
1
|
+
{"version":3,"sources":["../../../../src/run/android/runAndroidAsync.ts"],"sourcesContent":["import path from 'path';\n\nimport { Log } from '../../log';\nimport { assembleAsync, installAsync } from '../../start/platforms/android/gradle';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { ensurePortAvailabilityAsync } from '../../utils/port';\nimport { getSchemesForAndroidAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\nimport { resolveInstallApkNameAsync } from './resolveInstallApkName';\nimport { Options, ResolvedOptions, resolveOptionsAsync } from './resolveOptions';\n\nconst debug = require('debug')('expo:run:android');\n\nexport async function runAndroidAsync(projectRoot: string, { install, ...options }: Options) {\n // NOTE: This is a guess, the developer can overwrite with `NODE_ENV`.\n setNodeEnv(options.variant === 'release' ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n await ensureNativeProjectAsync(projectRoot, { platform: 'android', install });\n\n const props = await resolveOptionsAsync(projectRoot, options);\n\n debug('Package name: ' + props.packageName);\n Log.log('› Building app...');\n\n const androidProjectRoot = path.join(projectRoot, 'android');\n\n await assembleAsync(androidProjectRoot, {\n variant: props.variant,\n port: props.port,\n appName: props.appName,\n buildCache: props.buildCache,\n });\n\n // Ensure the port hasn't become busy during the build.\n if (props.shouldStartBundler && !(await ensurePortAvailabilityAsync(projectRoot, props))) {\n props.shouldStartBundler = false;\n }\n\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n // If a scheme is specified then use that instead of the package name.\n scheme: (await getSchemesForAndroidAsync(projectRoot))?.[0],\n headless: !props.shouldStartBundler,\n });\n\n await installAppAsync(androidProjectRoot, props);\n\n await manager.getDefaultDevServer().openCustomRuntimeAsync(\n 'emulator',\n {\n applicationId: props.packageName,\n },\n { device: props.device.device }\n );\n\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n }\n}\n\nasync function installAppAsync(androidProjectRoot: string, props: ResolvedOptions) {\n // Find the APK file path\n const apkFile = await resolveInstallApkNameAsync(props.device.device, props);\n\n if (apkFile) {\n // Attempt to install the APK from the file path\n const binaryPath = path.join(props.apkVariantDirectory, apkFile);\n debug('Installing:', binaryPath);\n await props.device.installAppAsync(binaryPath);\n } else {\n // If we cannot resolve the APK file path then we can attempt to install using Gradle.\n // This offers more advanced resolution that we may not have first class support for.\n Log.log('› Failed to locate binary file, installing with Gradle...');\n await installAsync(androidProjectRoot, {\n variant: props.variant ?? 'debug',\n appName: props.appName ?? 'app',\n port: props.port,\n });\n }\n}\n"],"names":["runAndroidAsync","debug","require","projectRoot","install","options","setNodeEnv","variant","load","ensureNativeProjectAsync","platform","props","resolveOptionsAsync","packageName","Log","log","androidProjectRoot","path","join","assembleAsync","port","appName","buildCache","shouldStartBundler","ensurePortAvailabilityAsync","manager","startBundlerAsync","scheme","getSchemesForAndroidAsync","headless","installAppAsync","getDefaultDevServer","openCustomRuntimeAsync","applicationId","device","logProjectLogsLocation","apkFile","resolveInstallApkNameAsync","binaryPath","apkVariantDirectory","installAsync"],"m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EAAE;QAC5BY,CAAAA,GAAAA,MAAsB,AAAE,CAAA,uBAAF,EAAE,CAAC;KAC1B;CACF;AAED,eAAeL,eAAe,CAACd,kBAA0B,EAAEL,KAAsB,EAAE;IACjF,yBAAyB;IACzB,MAAMyB,OAAO,GAAG,MAAMC,CAAAA,GAAAA,sBAA0B,AAA4B,CAAA,2BAA5B,CAAC1B,KAAK,CAACuB,MAAM,CAACA,MAAM,EAAEvB,KAAK,CAAC,AAAC;IAE7E,IAAIyB,OAAO,EAAE;QACX,gDAAgD;QAChD,MAAME,UAAU,GAAGrB,KAAI,QAAA,CAACC,IAAI,CAACP,KAAK,CAAC4B,mBAAmB,EAAEH,OAAO,CAAC,AAAC;QACjEnC,KAAK,CAAC,aAAa,EAAEqC,UAAU,CAAC,CAAC;QACjC,MAAM3B,KAAK,CAACuB,MAAM,CAACJ,eAAe,CAACQ,UAAU,CAAC,CAAC;KAChD,MAAM;QACL,sFAAsF;QACtF,qFAAqF;QACrFxB,IAAG,IAAA,CAACC,GAAG,CAAC,gEAA2D,CAAC,CAAC;YAE1DJ,QAAa,EACbA,QAAa;QAFxB,MAAM6B,CAAAA,GAAAA,OAAY,AAIhB,CAAA,aAJgB,CAACxB,kBAAkB,EAAE;YACrCT,OAAO,EAAEI,CAAAA,QAAa,GAAbA,KAAK,CAACJ,OAAO,YAAbI,QAAa,GAAI,OAAO;YACjCU,OAAO,EAAEV,CAAAA,QAAa,GAAbA,KAAK,CAACU,OAAO,YAAbV,QAAa,GAAI,KAAK;YAC/BS,IAAI,EAAET,KAAK,CAACS,IAAI;SACjB,CAAC,CAAC;KACJ;CACF"}
|
|
@@ -9,6 +9,7 @@ var _fs = _interopRequireDefault(require("fs"));
|
|
|
9
9
|
var _path = _interopRequireDefault(require("path"));
|
|
10
10
|
var _log = require("../../../log");
|
|
11
11
|
var _xcodeDeveloperDiskImagePrerequisite = require("../../../start/doctor/apple/XcodeDeveloperDiskImagePrerequisite");
|
|
12
|
+
var _xcrun = require("../../../start/platforms/ios/xcrun");
|
|
12
13
|
var _delay = require("../../../utils/delay");
|
|
13
14
|
var _errors = require("../../../utils/errors");
|
|
14
15
|
var _exit = require("../../../utils/exit");
|
|
@@ -76,10 +77,11 @@ async function runOnDevice({ udid , appPath , bundleId , waitForApp , deltaPath
|
|
|
76
77
|
// launch fails with EBusy or ENotFound if you try to launch immediately after install
|
|
77
78
|
await (0, _delay).delayAsync(200);
|
|
78
79
|
const debugServerClient = await launchApp(clientManager, {
|
|
80
|
+
bundleId,
|
|
79
81
|
appInfo,
|
|
80
82
|
detach: !waitForApp
|
|
81
83
|
});
|
|
82
|
-
if (waitForApp) {
|
|
84
|
+
if (waitForApp && debugServerClient) {
|
|
83
85
|
(0, _exit).installExitHooks(async ()=>{
|
|
84
86
|
// causes continue() to return
|
|
85
87
|
debugServerClient.halt();
|
|
@@ -129,7 +131,7 @@ async function uploadApp(clientManager, { appBinaryPath , destinationPath }) {
|
|
|
129
131
|
}
|
|
130
132
|
await afcClient.uploadDirectory(appBinaryPath, destinationPath);
|
|
131
133
|
}
|
|
132
|
-
async function
|
|
134
|
+
async function launchAppWithUsbmux(clientManager, { appInfo , detach }) {
|
|
133
135
|
let tries = 0;
|
|
134
136
|
while(tries < 3){
|
|
135
137
|
const debugServerClient = await clientManager.getDebugserverClient();
|
|
@@ -158,5 +160,36 @@ async function launchApp(clientManager, { appInfo , detach }) {
|
|
|
158
160
|
}
|
|
159
161
|
throw new _errors.CommandError("Unable to launch app, number of tries exceeded");
|
|
160
162
|
}
|
|
163
|
+
async function launchAppWithDeviceCtl(deviceId, bundleId) {
|
|
164
|
+
await (0, _xcrun).xcrunAsync([
|
|
165
|
+
"devicectl",
|
|
166
|
+
"device",
|
|
167
|
+
"process",
|
|
168
|
+
"launch",
|
|
169
|
+
"--device",
|
|
170
|
+
deviceId,
|
|
171
|
+
bundleId
|
|
172
|
+
]);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* iOS 17 introduces a new protocol called RemoteXPC.
|
|
176
|
+
* This is not yet implemented, so we fallback to devicectl.
|
|
177
|
+
*
|
|
178
|
+
* @see https://github.com/doronz88/pymobiledevice3/blob/master/misc/RemoteXPC.md#process-remoted
|
|
179
|
+
*/ async function launchApp(clientManager, { bundleId , appInfo , detach }) {
|
|
180
|
+
try {
|
|
181
|
+
return await launchAppWithUsbmux(clientManager, {
|
|
182
|
+
appInfo,
|
|
183
|
+
detach
|
|
184
|
+
});
|
|
185
|
+
} catch (error) {
|
|
186
|
+
debug("Failed to launch app with Usbmuxd, falling back to xcrun...", error);
|
|
187
|
+
// Get the device UDID and close the connection, to allow `xcrun devicectl` to connect
|
|
188
|
+
const deviceId = clientManager.device.Properties.SerialNumber;
|
|
189
|
+
clientManager.end();
|
|
190
|
+
// Fallback to devicectl for iOS 17 support
|
|
191
|
+
return await launchAppWithDeviceCtl(deviceId, bundleId);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
161
194
|
|
|
162
195
|
//# sourceMappingURL=AppleDevice.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/run/ios/appleDevice/AppleDevice.ts"],"sourcesContent":["import Debug from 'debug';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { Log } from '../../../log';\nimport { XcodeDeveloperDiskImagePrerequisite } from '../../../start/doctor/apple/XcodeDeveloperDiskImagePrerequisite';\nimport { delayAsync } from '../../../utils/delay';\nimport { CommandError } from '../../../utils/errors';\nimport { installExitHooks } from '../../../utils/exit';\nimport { ClientManager } from './ClientManager';\nimport { IPLookupResult, OnInstallProgressCallback } from './client/InstallationProxyClient';\nimport { LockdowndClient } from './client/LockdowndClient';\nimport { UsbmuxdClient } from './client/UsbmuxdClient';\nimport { AFC_STATUS, AFCError } from './protocol/AFCProtocol';\n\nconst debug = Debug('expo:apple-device');\n\n// NOTE(EvanBacon): I have a feeling this shape will change with new iOS versions (tested against iOS 15).\nexport interface ConnectedDevice {\n /** @example `00008101-001964A22629003A` */\n udid: string;\n /** @example `Evan's phone` */\n name: string;\n /** @example `iPhone13,4` */\n model: string;\n /** @example `device` */\n deviceType: 'device' | 'catalyst';\n /** @example `USB` */\n connectionType: 'USB' | 'Network';\n /** @example `15.4.1` */\n osVersion: string;\n}\n\n/** @returns a list of connected Apple devices. */\nexport async function getConnectedDevicesAsync(): Promise<ConnectedDevice[]> {\n const client = new UsbmuxdClient(UsbmuxdClient.connectUsbmuxdSocket());\n const devices = await client.getDevices();\n client.socket.end();\n\n return Promise.all(\n devices.map(async (device): Promise<ConnectedDevice> => {\n const socket = await new UsbmuxdClient(UsbmuxdClient.connectUsbmuxdSocket()).connect(\n device,\n 62078\n );\n const deviceValues = await new LockdowndClient(socket).getAllValues();\n socket.end();\n // TODO(EvanBacon): Add support for osType (ipad, watchos, etc)\n return {\n // TODO(EvanBacon): Better name\n name: deviceValues.DeviceName ?? deviceValues.ProductType ?? 'unknown iOS device',\n model: deviceValues.ProductType,\n osVersion: deviceValues.ProductVersion,\n deviceType: 'device',\n connectionType: device.Properties.ConnectionType,\n udid: device.Properties.SerialNumber,\n };\n })\n );\n}\n\n/** Install and run an Apple app binary on a connected Apple device. */\nexport async function runOnDevice({\n udid,\n appPath,\n bundleId,\n waitForApp,\n deltaPath,\n onProgress,\n}: {\n /** Apple device UDID */\n udid: string;\n /** File path to the app binary (ipa) */\n appPath: string;\n /** Bundle identifier for the app at `appPath` */\n bundleId: string;\n /** Wait for the app to launch before returning */\n waitForApp: boolean;\n /** File path to the app deltas folder to use for faster subsequent installs */\n deltaPath: string;\n /** Callback to be called with progress updates */\n onProgress: OnInstallProgressCallback;\n}) {\n const clientManager = await ClientManager.create(udid);\n\n try {\n await mountDeveloperDiskImage(clientManager);\n\n const packageName = path.basename(appPath);\n const destPackagePath = path.join('PublicStaging', packageName);\n\n await uploadApp(clientManager, { appBinaryPath: appPath, destinationPath: destPackagePath });\n\n const installer = await clientManager.getInstallationProxyClient();\n await installer.installApp(\n destPackagePath,\n bundleId,\n {\n // https://github.com/ios-control/ios-deploy/blob/0f2ffb1e564aa67a2dfca7cdf13de47ce489d835/src/ios-deploy/ios-deploy.m#L2491-L2508\n ApplicationsType: 'Any',\n\n CFBundleIdentifier: bundleId,\n CloseOnInvalidate: '1',\n InvalidateOnDetach: '1',\n IsUserInitiated: '1',\n // Disable checking for wifi devices, this is nominally faster.\n PreferWifi: '0',\n // Only info I could find on these:\n // https://github.com/wwxxyx/Quectel_BG96/blob/310876f90fc1093a59e45e381160eddcc31697d0/Apple_Homekit/homekit_certification_tools/ATS%206/ATS%206/ATS.app/Contents/Frameworks/CaptureKit.framework/Versions/A/Resources/MobileDevice/MobileInstallation.h#L112-L121\n PackageType: 'Developer',\n ShadowParentKey: deltaPath,\n // SkipUninstall: '1'\n },\n onProgress\n );\n\n const {\n // TODO(EvanBacon): This can be undefined when querying App Clips.\n [bundleId]: appInfo,\n } = await installer.lookupApp([bundleId]);\n\n if (appInfo) {\n // launch fails with EBusy or ENotFound if you try to launch immediately after install\n await delayAsync(200);\n const debugServerClient = await launchApp(clientManager, { appInfo, detach: !waitForApp });\n if (waitForApp) {\n installExitHooks(async () => {\n // causes continue() to return\n debugServerClient.halt();\n // give continue() time to return response\n await delayAsync(64);\n });\n\n debug(`Waiting for app to close...\\n`);\n const result = await debugServerClient.continue();\n // TODO: I have no idea what this packet means yet (successful close?)\n // if not a close (ie, most likely due to halt from onBeforeExit), then kill the app\n if (result !== 'W00') {\n await debugServerClient.kill();\n }\n }\n } else {\n Log.warn(`App \"${bundleId}\" installed but couldn't be launched. Open on device manually.`);\n }\n } finally {\n clientManager.end();\n }\n}\n\n/** Mount the developer disk image for Xcode. */\nasync function mountDeveloperDiskImage(clientManager: ClientManager) {\n const imageMounter = await clientManager.getMobileImageMounterClient();\n // Check if already mounted. If not, mount.\n if (!(await imageMounter.lookupImage()).ImageSignature) {\n // verify DeveloperDiskImage exists (TODO: how does this work on Windows/Linux?)\n // TODO: if windows/linux, download?\n const version = await (await clientManager.getLockdowndClient()).getValue('ProductVersion');\n const developerDiskImagePath = await XcodeDeveloperDiskImagePrerequisite.instance.assertAsync({\n version,\n });\n const developerDiskImageSig = fs.readFileSync(`${developerDiskImagePath}.signature`);\n await imageMounter.uploadImage(developerDiskImagePath, developerDiskImageSig);\n await imageMounter.mountImage(developerDiskImagePath, developerDiskImageSig);\n }\n}\n\nasync function uploadApp(\n clientManager: ClientManager,\n { appBinaryPath, destinationPath }: { appBinaryPath: string; destinationPath: string }\n) {\n const afcClient = await clientManager.getAFCClient();\n try {\n await afcClient.getFileInfo('PublicStaging');\n } catch (err: any) {\n if (err instanceof AFCError && err.status === AFC_STATUS.OBJECT_NOT_FOUND) {\n await afcClient.makeDirectory('PublicStaging');\n } else {\n throw err;\n }\n }\n await afcClient.uploadDirectory(appBinaryPath, destinationPath);\n}\n\nasync function launchApp(\n clientManager: ClientManager,\n { appInfo, detach }: { appInfo: IPLookupResult[string]; detach?: boolean }\n) {\n let tries = 0;\n while (tries < 3) {\n const debugServerClient = await clientManager.getDebugserverClient();\n await debugServerClient.setMaxPacketSize(1024);\n await debugServerClient.setWorkingDir(appInfo.Container);\n await debugServerClient.launchApp(appInfo.Path, appInfo.CFBundleExecutable);\n\n const result = await debugServerClient.checkLaunchSuccess();\n if (result === 'OK') {\n if (detach) {\n // https://github.com/libimobiledevice/libimobiledevice/blob/25059d4c7d75e03aab516af2929d7c6e6d4c17de/tools/idevicedebug.c#L455-L464\n const res = await debugServerClient.sendCommand('D', []);\n debug('Disconnect from debug server request:', res);\n if (res !== 'OK') {\n console.warn(\n 'Something went wrong while attempting to disconnect from iOS debug server, you may need to reopen the app manually.'\n );\n }\n }\n\n return debugServerClient;\n } else if (result === 'EBusy' || result === 'ENotFound') {\n debug('Device busy or app not found, trying to launch again in .5s...');\n tries++;\n debugServerClient.socket.end();\n await delayAsync(500);\n } else {\n throw new CommandError(`There was an error launching app: ${result}`);\n }\n }\n throw new CommandError('Unable to launch app, number of tries exceeded');\n}\n"],"names":["getConnectedDevicesAsync","runOnDevice","debug","Debug","client","UsbmuxdClient","connectUsbmuxdSocket","devices","getDevices","socket","end","Promise","all","map","device","connect","deviceValues","LockdowndClient","getAllValues","name","DeviceName","ProductType","model","osVersion","ProductVersion","deviceType","connectionType","Properties","ConnectionType","udid","SerialNumber","appPath","bundleId","waitForApp","deltaPath","onProgress","clientManager","ClientManager","create","mountDeveloperDiskImage","packageName","path","basename","destPackagePath","join","uploadApp","appBinaryPath","destinationPath","installer","getInstallationProxyClient","installApp","ApplicationsType","CFBundleIdentifier","CloseOnInvalidate","InvalidateOnDetach","IsUserInitiated","PreferWifi","PackageType","ShadowParentKey","appInfo","lookupApp","delayAsync","debugServerClient","launchApp","detach","installExitHooks","halt","result","continue","kill","Log","warn","imageMounter","getMobileImageMounterClient","lookupImage","ImageSignature","version","getLockdowndClient","getValue","developerDiskImagePath","XcodeDeveloperDiskImagePrerequisite","instance","assertAsync","developerDiskImageSig","fs","readFileSync","uploadImage","mountImage","afcClient","getAFCClient","getFileInfo","err","AFCError","status","AFC_STATUS","OBJECT_NOT_FOUND","makeDirectory","uploadDirectory","tries","getDebugserverClient","setMaxPacketSize","setWorkingDir","Container","Path","CFBundleExecutable","checkLaunchSuccess","res","sendCommand","console","CommandError"],"mappings":"AAAA;;;;QAkCsBA,wBAAwB,GAAxBA,wBAAwB;QA4BxBC,WAAW,GAAXA,WAAW;AA9Df,IAAA,MAAO,kCAAP,OAAO,EAAA;AACV,IAAA,GAAI,kCAAJ,IAAI,EAAA;AACF,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEH,IAAA,IAAc,WAAd,cAAc,CAAA;AACkB,IAAA,oCAAiE,WAAjE,iEAAiE,CAAA;AAC1F,IAAA,MAAsB,WAAtB,sBAAsB,CAAA;AACpB,IAAA,OAAuB,WAAvB,uBAAuB,CAAA;AACnB,IAAA,KAAqB,WAArB,qBAAqB,CAAA;AACxB,IAAA,cAAiB,WAAjB,iBAAiB,CAAA;AAEf,IAAA,gBAA0B,WAA1B,0BAA0B,CAA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C/C,MAAMtC,iBAAiB,CAACuC,aAAa,CAAC1C,OAAO,CAAC2C,SAAS,CAAC,CAAC;QACzD,MAAMxC,iBAAiB,CAACC,SAAS,CAACJ,OAAO,CAAC4C,IAAI,EAAE5C,OAAO,CAAC6C,kBAAkB,CAAC,CAAC;QAE5E,MAAMrC,MAAM,GAAG,MAAML,iBAAiB,CAAC2C,kBAAkB,EAAE,AAAC;QAC5D,IAAItC,MAAM,KAAK,IAAI,EAAE;YACnB,IAAIH,MAAM,EAAE;gBACV,oIAAoI;gBACpI,MAAM0C,GAAG,GAAG,MAAM5C,iBAAiB,CAAC6C,WAAW,CAAC,GAAG,EAAE,EAAE,CAAC,AAAC;gBACzDzG,KAAK,CAAC,uCAAuC,EAAEwG,GAAG,CAAC,CAAC;gBACpD,IAAIA,GAAG,KAAK,IAAI,EAAE;oBAChBE,OAAO,CAACrC,IAAI,CACV,qHAAqH,CACtH,CAAC;iBACH;aACF;YAED,OAAOT,iBAAiB,CAAC;SAC1B,MAAM,IAAIK,MAAM,KAAK,OAAO,IAAIA,MAAM,KAAK,WAAW,EAAE;YACvDjE,KAAK,CAAC,gEAAgE,CAAC,CAAC;YACxEgG,KAAK,EAAE,CAAC;YACRpC,iBAAiB,CAACrD,MAAM,CAACC,GAAG,EAAE,CAAC;YAC/B,MAAMmD,CAAAA,GAAAA,MAAU,AAAK,CAAA,WAAL,CAAC,GAAG,CAAC,CAAC;SACvB,MAAM;YACL,MAAM,IAAIgD,OAAY,aAAA,CAAC,CAAC,kCAAkC,EAAE1C,MAAM,CAAC,CAAC,CAAC,CAAC;SACvE;KACF;IACD,MAAM,IAAI0C,OAAY,aAAA,CAAC,gDAAgD,CAAC,CAAC;CAC1E"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/run/ios/appleDevice/AppleDevice.ts"],"sourcesContent":["import Debug from 'debug';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { Log } from '../../../log';\nimport { XcodeDeveloperDiskImagePrerequisite } from '../../../start/doctor/apple/XcodeDeveloperDiskImagePrerequisite';\nimport { xcrunAsync } from '../../../start/platforms/ios/xcrun';\nimport { delayAsync } from '../../../utils/delay';\nimport { CommandError } from '../../../utils/errors';\nimport { installExitHooks } from '../../../utils/exit';\nimport { ClientManager } from './ClientManager';\nimport { IPLookupResult, OnInstallProgressCallback } from './client/InstallationProxyClient';\nimport { LockdowndClient } from './client/LockdowndClient';\nimport { UsbmuxdClient } from './client/UsbmuxdClient';\nimport { AFC_STATUS, AFCError } from './protocol/AFCProtocol';\n\nconst debug = Debug('expo:apple-device');\n\n// NOTE(EvanBacon): I have a feeling this shape will change with new iOS versions (tested against iOS 15).\nexport interface ConnectedDevice {\n /** @example `00008101-001964A22629003A` */\n udid: string;\n /** @example `Evan's phone` */\n name: string;\n /** @example `iPhone13,4` */\n model: string;\n /** @example `device` */\n deviceType: 'device' | 'catalyst';\n /** @example `USB` */\n connectionType: 'USB' | 'Network';\n /** @example `15.4.1` */\n osVersion: string;\n}\n\n/** @returns a list of connected Apple devices. */\nexport async function getConnectedDevicesAsync(): Promise<ConnectedDevice[]> {\n const client = new UsbmuxdClient(UsbmuxdClient.connectUsbmuxdSocket());\n const devices = await client.getDevices();\n client.socket.end();\n\n return Promise.all(\n devices.map(async (device): Promise<ConnectedDevice> => {\n const socket = await new UsbmuxdClient(UsbmuxdClient.connectUsbmuxdSocket()).connect(\n device,\n 62078\n );\n const deviceValues = await new LockdowndClient(socket).getAllValues();\n socket.end();\n // TODO(EvanBacon): Add support for osType (ipad, watchos, etc)\n return {\n // TODO(EvanBacon): Better name\n name: deviceValues.DeviceName ?? deviceValues.ProductType ?? 'unknown iOS device',\n model: deviceValues.ProductType,\n osVersion: deviceValues.ProductVersion,\n deviceType: 'device',\n connectionType: device.Properties.ConnectionType,\n udid: device.Properties.SerialNumber,\n };\n })\n );\n}\n\n/** Install and run an Apple app binary on a connected Apple device. */\nexport async function runOnDevice({\n udid,\n appPath,\n bundleId,\n waitForApp,\n deltaPath,\n onProgress,\n}: {\n /** Apple device UDID */\n udid: string;\n /** File path to the app binary (ipa) */\n appPath: string;\n /** Bundle identifier for the app at `appPath` */\n bundleId: string;\n /** Wait for the app to launch before returning */\n waitForApp: boolean;\n /** File path to the app deltas folder to use for faster subsequent installs */\n deltaPath: string;\n /** Callback to be called with progress updates */\n onProgress: OnInstallProgressCallback;\n}) {\n const clientManager = await ClientManager.create(udid);\n\n try {\n await mountDeveloperDiskImage(clientManager);\n\n const packageName = path.basename(appPath);\n const destPackagePath = path.join('PublicStaging', packageName);\n\n await uploadApp(clientManager, { appBinaryPath: appPath, destinationPath: destPackagePath });\n\n const installer = await clientManager.getInstallationProxyClient();\n await installer.installApp(\n destPackagePath,\n bundleId,\n {\n // https://github.com/ios-control/ios-deploy/blob/0f2ffb1e564aa67a2dfca7cdf13de47ce489d835/src/ios-deploy/ios-deploy.m#L2491-L2508\n ApplicationsType: 'Any',\n\n CFBundleIdentifier: bundleId,\n CloseOnInvalidate: '1',\n InvalidateOnDetach: '1',\n IsUserInitiated: '1',\n // Disable checking for wifi devices, this is nominally faster.\n PreferWifi: '0',\n // Only info I could find on these:\n // https://github.com/wwxxyx/Quectel_BG96/blob/310876f90fc1093a59e45e381160eddcc31697d0/Apple_Homekit/homekit_certification_tools/ATS%206/ATS%206/ATS.app/Contents/Frameworks/CaptureKit.framework/Versions/A/Resources/MobileDevice/MobileInstallation.h#L112-L121\n PackageType: 'Developer',\n ShadowParentKey: deltaPath,\n // SkipUninstall: '1'\n },\n onProgress\n );\n\n const {\n // TODO(EvanBacon): This can be undefined when querying App Clips.\n [bundleId]: appInfo,\n } = await installer.lookupApp([bundleId]);\n\n if (appInfo) {\n // launch fails with EBusy or ENotFound if you try to launch immediately after install\n await delayAsync(200);\n const debugServerClient = await launchApp(clientManager, {\n bundleId,\n appInfo,\n detach: !waitForApp,\n });\n\n if (waitForApp && debugServerClient) {\n installExitHooks(async () => {\n // causes continue() to return\n debugServerClient.halt();\n // give continue() time to return response\n await delayAsync(64);\n });\n\n debug(`Waiting for app to close...\\n`);\n const result = await debugServerClient.continue();\n // TODO: I have no idea what this packet means yet (successful close?)\n // if not a close (ie, most likely due to halt from onBeforeExit), then kill the app\n if (result !== 'W00') {\n await debugServerClient.kill();\n }\n }\n } else {\n Log.warn(`App \"${bundleId}\" installed but couldn't be launched. Open on device manually.`);\n }\n } finally {\n clientManager.end();\n }\n}\n\n/** Mount the developer disk image for Xcode. */\nasync function mountDeveloperDiskImage(clientManager: ClientManager) {\n const imageMounter = await clientManager.getMobileImageMounterClient();\n // Check if already mounted. If not, mount.\n if (!(await imageMounter.lookupImage()).ImageSignature) {\n // verify DeveloperDiskImage exists (TODO: how does this work on Windows/Linux?)\n // TODO: if windows/linux, download?\n const version = await (await clientManager.getLockdowndClient()).getValue('ProductVersion');\n const developerDiskImagePath = await XcodeDeveloperDiskImagePrerequisite.instance.assertAsync({\n version,\n });\n const developerDiskImageSig = fs.readFileSync(`${developerDiskImagePath}.signature`);\n await imageMounter.uploadImage(developerDiskImagePath, developerDiskImageSig);\n await imageMounter.mountImage(developerDiskImagePath, developerDiskImageSig);\n }\n}\n\nasync function uploadApp(\n clientManager: ClientManager,\n { appBinaryPath, destinationPath }: { appBinaryPath: string; destinationPath: string }\n) {\n const afcClient = await clientManager.getAFCClient();\n try {\n await afcClient.getFileInfo('PublicStaging');\n } catch (err: any) {\n if (err instanceof AFCError && err.status === AFC_STATUS.OBJECT_NOT_FOUND) {\n await afcClient.makeDirectory('PublicStaging');\n } else {\n throw err;\n }\n }\n await afcClient.uploadDirectory(appBinaryPath, destinationPath);\n}\n\nasync function launchAppWithUsbmux(\n clientManager: ClientManager,\n { appInfo, detach }: { appInfo: IPLookupResult[string]; detach?: boolean }\n) {\n let tries = 0;\n while (tries < 3) {\n const debugServerClient = await clientManager.getDebugserverClient();\n await debugServerClient.setMaxPacketSize(1024);\n await debugServerClient.setWorkingDir(appInfo.Container);\n await debugServerClient.launchApp(appInfo.Path, appInfo.CFBundleExecutable);\n\n const result = await debugServerClient.checkLaunchSuccess();\n if (result === 'OK') {\n if (detach) {\n // https://github.com/libimobiledevice/libimobiledevice/blob/25059d4c7d75e03aab516af2929d7c6e6d4c17de/tools/idevicedebug.c#L455-L464\n const res = await debugServerClient.sendCommand('D', []);\n debug('Disconnect from debug server request:', res);\n if (res !== 'OK') {\n console.warn(\n 'Something went wrong while attempting to disconnect from iOS debug server, you may need to reopen the app manually.'\n );\n }\n }\n\n return debugServerClient;\n } else if (result === 'EBusy' || result === 'ENotFound') {\n debug('Device busy or app not found, trying to launch again in .5s...');\n tries++;\n debugServerClient.socket.end();\n await delayAsync(500);\n } else {\n throw new CommandError(`There was an error launching app: ${result}`);\n }\n }\n throw new CommandError('Unable to launch app, number of tries exceeded');\n}\n\nasync function launchAppWithDeviceCtl(deviceId: string, bundleId: string) {\n await xcrunAsync(['devicectl', 'device', 'process', 'launch', '--device', deviceId, bundleId]);\n}\n\n/**\n * iOS 17 introduces a new protocol called RemoteXPC.\n * This is not yet implemented, so we fallback to devicectl.\n *\n * @see https://github.com/doronz88/pymobiledevice3/blob/master/misc/RemoteXPC.md#process-remoted\n */\nasync function launchApp(\n clientManager: ClientManager,\n {\n bundleId,\n appInfo,\n detach,\n }: { bundleId: string; appInfo: IPLookupResult[string]; detach?: boolean }\n) {\n try {\n return await launchAppWithUsbmux(clientManager, { appInfo, detach });\n } catch (error) {\n debug('Failed to launch app with Usbmuxd, falling back to xcrun...', error);\n\n // Get the device UDID and close the connection, to allow `xcrun devicectl` to connect\n const deviceId = clientManager.device.Properties.SerialNumber;\n clientManager.end();\n\n // Fallback to devicectl for iOS 17 support\n return await launchAppWithDeviceCtl(deviceId, bundleId);\n }\n}\n"],"names":["getConnectedDevicesAsync","runOnDevice","debug","Debug","client","UsbmuxdClient","connectUsbmuxdSocket","devices","getDevices","socket","end","Promise","all","map","device","connect","deviceValues","LockdowndClient","getAllValues","name","DeviceName","ProductType","model","osVersion","ProductVersion","deviceType","connectionType","Properties","ConnectionType","udid","SerialNumber","appPath","bundleId","waitForApp","deltaPath","onProgress","clientManager","ClientManager","create","mountDeveloperDiskImage","packageName","path","basename","destPackagePath","join","uploadApp","appBinaryPath","destinationPath","installer","getInstallationProxyClient","installApp","ApplicationsType","CFBundleIdentifier","CloseOnInvalidate","InvalidateOnDetach","IsUserInitiated","PreferWifi","PackageType","ShadowParentKey","appInfo","lookupApp","delayAsync","debugServerClient","launchApp","detach","installExitHooks","halt","result","continue","kill","Log","warn","imageMounter","getMobileImageMounterClient","lookupImage","ImageSignature","version","getLockdowndClient","getValue","developerDiskImagePath","XcodeDeveloperDiskImagePrerequisite","instance","assertAsync","developerDiskImageSig","fs","readFileSync","uploadImage","mountImage","afcClient","getAFCClient","getFileInfo","err","AFCError","status","AFC_STATUS","OBJECT_NOT_FOUND","makeDirectory","uploadDirectory","launchAppWithUsbmux","tries","getDebugserverClient","setMaxPacketSize","setWorkingDir","Container","Path","CFBundleExecutable","checkLaunchSuccess","res","sendCommand","console","CommandError","launchAppWithDeviceCtl","deviceId","xcrunAsync","error"],"mappings":"AAAA;;;;QAmCsBA,wBAAwB,GAAxBA,wBAAwB;QA4BxBC,WAAW,GAAXA,WAAW;AA/Df,IAAA,MAAO,kCAAP,OAAO,EAAA;AACV,IAAA,GAAI,kCAAJ,IAAI,EAAA;AACF,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEH,IAAA,IAAc,WAAd,cAAc,CAAA;AACkB,IAAA,oCAAiE,WAAjE,iEAAiE,CAAA;AAC1F,IAAA,MAAoC,WAApC,oCAAoC,CAAA;AACpC,IAAA,MAAsB,WAAtB,sBAAsB,CAAA;AACpB,IAAA,OAAuB,WAAvB,uBAAuB,CAAA;AACnB,IAAA,KAAqB,WAArB,qBAAqB,CAAA;AACxB,IAAA,cAAiB,WAAjB,iBAAiB,CAAA;AAEf,IAAA,gBAA0B,WAA1B,0BAA0B,CAAA;AAC5B,IAAA,cAAwB,WAAxB,wBAAwB,CAAA;AACjB,IAAA,YAAwB,WAAxB,wBA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C,CAAC;CAChG;AAED;;;;;GAKG,CACH,eAAe+B,SAAS,CACtB3B,aAA4B,EAC5B,EACEJ,QAAQ,CAAA,EACR2B,OAAO,CAAA,EACPK,MAAM,CAAA,EACkE,EAC1E;IACA,IAAI;QACF,OAAO,MAAMkC,mBAAmB,CAAC9D,aAAa,EAAE;YAAEuB,OAAO;YAAEK,MAAM;SAAE,CAAC,CAAC;KACtE,CAAC,OAAOkD,KAAK,EAAE;QACdhH,KAAK,CAAC,6DAA6D,EAAEgH,KAAK,CAAC,CAAC;QAE5E,sFAAsF;QACtF,MAAMF,QAAQ,GAAG5E,aAAa,CAACtB,MAAM,CAACa,UAAU,CAACG,YAAY,AAAC;QAC9DM,aAAa,CAAC1B,GAAG,EAAE,CAAC;QAEpB,2CAA2C;QAC3C,OAAO,MAAMqG,sBAAsB,CAACC,QAAQ,EAAEhF,QAAQ,CAAC,CAAC;KACzD;CACF"}
|
|
@@ -7,6 +7,7 @@ var _chalk = _interopRequireDefault(require("chalk"));
|
|
|
7
7
|
var Log = _interopRequireWildcard(require("../../log"));
|
|
8
8
|
var _cocoapods = require("../../utils/cocoapods");
|
|
9
9
|
var _nodeEnv = require("../../utils/nodeEnv");
|
|
10
|
+
var _port = require("../../utils/port");
|
|
10
11
|
var _profile = require("../../utils/profile");
|
|
11
12
|
var _scheme = require("../../utils/scheme");
|
|
12
13
|
var _ensureNativeProject = require("../ensureNativeProject");
|
|
@@ -60,6 +61,10 @@ async function runIosAsync(projectRoot, options) {
|
|
|
60
61
|
// Find the path to the built app binary, this will be used to install the binary
|
|
61
62
|
// on a device.
|
|
62
63
|
const binaryPath = await (0, _profile).profile(XcodeBuild.getAppBinaryPath)(buildOutput);
|
|
64
|
+
// Ensure the port hasn't become busy during the build.
|
|
65
|
+
if (props.shouldStartBundler && !await (0, _port).ensurePortAvailabilityAsync(projectRoot, props)) {
|
|
66
|
+
props.shouldStartBundler = false;
|
|
67
|
+
}
|
|
63
68
|
// Start the dev server which creates all of the required info for
|
|
64
69
|
// launching the app on a simulator.
|
|
65
70
|
const manager = await (0, _startBundler).startBundlerAsync(projectRoot, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/run/ios/runIosAsync.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport * as Log from '../../log';\nimport { maybePromptToSyncPodsAsync } from '../../utils/cocoapods';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { profile } from '../../utils/profile';\nimport { getSchemesForIosAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\nimport * as XcodeBuild from './XcodeBuild';\nimport { Options } from './XcodeBuild.types';\nimport { launchAppAsync } from './launchApp';\nimport { resolveOptionsAsync } from './options/resolveOptions';\n\nexport async function runIosAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.configuration === 'Release' ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n assertPlatform();\n\n const install = !!options.install;\n\n if ((await ensureNativeProjectAsync(projectRoot, { platform: 'ios', install })) && install) {\n await maybePromptToSyncPodsAsync(projectRoot);\n }\n\n // Resolve the CLI arguments into useable options.\n const props = await resolveOptionsAsync(projectRoot, options);\n\n // Spawn the `xcodebuild` process to create the app binary.\n const buildOutput = await XcodeBuild.buildAsync(props);\n\n // Find the path to the built app binary, this will be used to install the binary\n // on a device.\n const binaryPath = await profile(XcodeBuild.getAppBinaryPath)(buildOutput);\n\n // Start the dev server which creates all of the required info for\n // launching the app on a simulator.\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n headless: !props.shouldStartBundler,\n // If a scheme is specified then use that instead of the package name.\n scheme: (await getSchemesForIosAsync(projectRoot))?.[0],\n });\n\n // Install and launch the app binary on a device.\n await launchAppAsync(binaryPath, manager, {\n isSimulator: props.isSimulator,\n device: props.device,\n shouldStartBundler: props.shouldStartBundler,\n });\n\n // Log the location of the JS logs for the device.\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n }\n}\n\nfunction assertPlatform() {\n if (process.platform !== 'darwin') {\n Log.exit(\n chalk`iOS apps can only be built on macOS devices. Use {cyan eas build -p ios} to build in the cloud.`\n );\n }\n}\n"],"names":["runIosAsync","Log","XcodeBuild","projectRoot","options","setNodeEnv","configuration","require","load","assertPlatform","install","ensureNativeProjectAsync","platform","maybePromptToSyncPodsAsync","props","resolveOptionsAsync","buildOutput","buildAsync","binaryPath","profile","getAppBinaryPath","manager","startBundlerAsync","port","headless","
|
|
1
|
+
{"version":3,"sources":["../../../../src/run/ios/runIosAsync.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport * as Log from '../../log';\nimport { maybePromptToSyncPodsAsync } from '../../utils/cocoapods';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { ensurePortAvailabilityAsync } from '../../utils/port';\nimport { profile } from '../../utils/profile';\nimport { getSchemesForIosAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\nimport * as XcodeBuild from './XcodeBuild';\nimport { Options } from './XcodeBuild.types';\nimport { launchAppAsync } from './launchApp';\nimport { resolveOptionsAsync } from './options/resolveOptions';\n\nexport async function runIosAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.configuration === 'Release' ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n assertPlatform();\n\n const install = !!options.install;\n\n if ((await ensureNativeProjectAsync(projectRoot, { platform: 'ios', install })) && install) {\n await maybePromptToSyncPodsAsync(projectRoot);\n }\n\n // Resolve the CLI arguments into useable options.\n const props = await resolveOptionsAsync(projectRoot, options);\n\n // Spawn the `xcodebuild` process to create the app binary.\n const buildOutput = await XcodeBuild.buildAsync(props);\n\n // Find the path to the built app binary, this will be used to install the binary\n // on a device.\n const binaryPath = await profile(XcodeBuild.getAppBinaryPath)(buildOutput);\n\n // Ensure the port hasn't become busy during the build.\n if (props.shouldStartBundler && !(await ensurePortAvailabilityAsync(projectRoot, props))) {\n props.shouldStartBundler = false;\n }\n\n // Start the dev server which creates all of the required info for\n // launching the app on a simulator.\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n headless: !props.shouldStartBundler,\n // If a scheme is specified then use that instead of the package name.\n scheme: (await getSchemesForIosAsync(projectRoot))?.[0],\n });\n\n // Install and launch the app binary on a device.\n await launchAppAsync(binaryPath, manager, {\n isSimulator: props.isSimulator,\n device: props.device,\n shouldStartBundler: props.shouldStartBundler,\n });\n\n // Log the location of the JS logs for the device.\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n }\n}\n\nfunction assertPlatform() {\n if (process.platform !== 'darwin') {\n Log.exit(\n chalk`iOS apps can only be built on macOS devices. Use {cyan eas build -p ios} to build in the cloud.`\n );\n }\n}\n"],"names":["runIosAsync","Log","XcodeBuild","projectRoot","options","setNodeEnv","configuration","require","load","assertPlatform","install","ensureNativeProjectAsync","platform","maybePromptToSyncPodsAsync","props","resolveOptionsAsync","buildOutput","buildAsync","binaryPath","profile","getAppBinaryPath","shouldStartBundler","ensurePortAvailabilityAsync","manager","startBundlerAsync","port","headless","scheme","getSchemesForIosAsync","launchAppAsync","isSimulator","device","logProjectLogsLocation","process","exit","chalk"],"mappings":"AAAA;;;;QAgBsBA,WAAW,GAAXA,WAAW;AAhBf,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEbC,IAAAA,GAAG,mCAAM,WAAW,EAAjB;AAC4B,IAAA,UAAuB,WAAvB,uBAAuB,CAAA;AACvC,IAAA,QAAqB,WAArB,qBAAqB,CAAA;AACJ,IAAA,KAAkB,WAAlB,kBAAkB,CAAA;AACtC,IAAA,QAAqB,WAArB,qBAAqB,CAAA;AACP,IAAA,OAAoB,WAApB,oBAAoB,CAAA;AACjB,IAAA,oBAAwB,WAAxB,wBAAwB,CAAA;AAC1B,IAAA,MAAU,WAAV,UAAU,CAAA;AACf,IAAA,aAAiB,WAAjB,iBAAiB,CAAA;A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B,WAAW,EAAEW,KAAK,CAAC,AAAC,EAAE;QACxFA,KAAK,CAACO,kBAAkB,GAAG,KAAK,CAAC;KAClC;IAED,kEAAkE;IAClE,oCAAoC;IACpC,MAAME,OAAO,GAAG,MAAMC,CAAAA,GAAAA,aAAiB,AAKrC,CAAA,kBALqC,CAACrB,WAAW,EAAE;QACnDsB,IAAI,EAAEX,KAAK,CAACW,IAAI;QAChBC,QAAQ,EAAE,CAACZ,KAAK,CAACO,kBAAkB;QACnC,sEAAsE;QACtEM,MAAM,EAAE,CAAA,GAA0C,GAAzC,MAAMC,CAAAA,GAAAA,OAAqB,AAAa,CAAA,sBAAb,CAACzB,WAAW,CAAC,SAAM,GAA/C,KAAA,CAA+C,GAA/C,GAA0C,AAAE,CAAC,CAAC,CAAC;KACxD,CAAC,AAAC;IAEH,iDAAiD;IACjD,MAAM0B,CAAAA,GAAAA,UAAc,AAIlB,CAAA,eAJkB,CAACX,UAAU,EAAEK,OAAO,EAAE;QACxCO,WAAW,EAAEhB,KAAK,CAACgB,WAAW;QAC9BC,MAAM,EAAEjB,KAAK,CAACiB,MAAM;QACpBV,kBAAkB,EAAEP,KAAK,CAACO,kBAAkB;KAC7C,CAAC,CAAC;IAEH,kDAAkD;IAClD,IAAIP,KAAK,CAACO,kBAAkB,EAAE;QAC5BW,CAAAA,GAAAA,MAAsB,AAAE,CAAA,uBAAF,EAAE,CAAC;KAC1B;CACF;AAED,SAASvB,cAAc,GAAG;IACxB,IAAIwB,OAAO,CAACrB,QAAQ,KAAK,QAAQ,EAAE;QACjCX,GAAG,CAACiC,IAAI,CACNC,MAAK,QAAA,CAAC,+FAA+F,CAAC,CACvG,CAAC;KACH;CACF"}
|
|
@@ -138,7 +138,7 @@ async function createHostInfoAsync() {
|
|
|
138
138
|
host: await _userSettings.default.getAnonymousIdentifierAsync(),
|
|
139
139
|
server: "expo",
|
|
140
140
|
// Defined in the build step
|
|
141
|
-
serverVersion: "0.10.
|
|
141
|
+
serverVersion: "0.10.13",
|
|
142
142
|
serverDriver: _manifestMiddleware.DEVELOPER_TOOL,
|
|
143
143
|
serverOS: _os.default.platform(),
|
|
144
144
|
serverOSVersion: _os.default.release()
|
|
@@ -94,7 +94,7 @@ async function logEventAsync(event, properties = {}) {
|
|
|
94
94
|
}
|
|
95
95
|
const { userId , deviceId } = identifyData;
|
|
96
96
|
const commonEventProperties = {
|
|
97
|
-
source_version: "0.10.
|
|
97
|
+
source_version: "0.10.13",
|
|
98
98
|
source: "expo"
|
|
99
99
|
};
|
|
100
100
|
const identity = {
|
|
@@ -135,7 +135,7 @@ function getContext() {
|
|
|
135
135
|
},
|
|
136
136
|
app: {
|
|
137
137
|
name: "expo",
|
|
138
|
-
version: "0.10.
|
|
138
|
+
version: "0.10.13"
|
|
139
139
|
},
|
|
140
140
|
ci: ciInfo.isCI ? {
|
|
141
141
|
name: ciInfo.name,
|
package/build/src/utils/port.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
5
|
exports.getFreePortAsync = getFreePortAsync;
|
|
6
|
+
exports.ensurePortAvailabilityAsync = ensurePortAvailabilityAsync;
|
|
6
7
|
exports.choosePortAsync = choosePortAsync;
|
|
7
8
|
exports.resolvePortAsync = resolvePortAsync;
|
|
8
9
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
@@ -48,21 +49,46 @@ async function getFreePortAsync(rangeStart) {
|
|
|
48
49
|
}
|
|
49
50
|
return port;
|
|
50
51
|
}
|
|
52
|
+
async function ensurePortAvailabilityAsync(projectRoot, { port }) {
|
|
53
|
+
const freePort = await (0, _freeportAsync).default(port, {
|
|
54
|
+
hostnames: [
|
|
55
|
+
null
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
// Check if port has become busy during the build.
|
|
59
|
+
if (freePort === port) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
const isBusy = await isBusyPortRunningSameProcessAsync(projectRoot, {
|
|
63
|
+
port
|
|
64
|
+
});
|
|
65
|
+
if (!isBusy) {
|
|
66
|
+
throw new _errors.CommandError(`Port "${port}" became busy running another process while the app was compiling. Re-run command to use a new port.`);
|
|
67
|
+
}
|
|
68
|
+
// Log that the dev server will not be started and that the logs will appear in another window.
|
|
69
|
+
Log.log("\u203A The dev server for this app is already running in another window. Logs will appear there.");
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
function isRestrictedPort(port) {
|
|
73
|
+
if (process.platform !== "win32" && port < 1024) {
|
|
74
|
+
const isRoot = process.getuid && process.getuid() === 0;
|
|
75
|
+
return !isRoot;
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
async function isBusyPortRunningSameProcessAsync(projectRoot, { port }) {
|
|
80
|
+
const { getRunningProcess } = require("./getRunningProcess");
|
|
81
|
+
const runningProcess = isRestrictedPort(port) ? null : getRunningProcess(port);
|
|
82
|
+
if (runningProcess) {
|
|
83
|
+
if (runningProcess.directory === projectRoot) {
|
|
84
|
+
return true;
|
|
85
|
+
} else {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
51
91
|
async function choosePortAsync(projectRoot, { defaultPort , host , reuseExistingPort }) {
|
|
52
|
-
const [{ getRunningProcess }, { confirmAsync }, isRoot, Log1] = await Promise.all([
|
|
53
|
-
Promise.resolve().then(function() {
|
|
54
|
-
return _interopRequireWildcard(require("./getRunningProcess"));
|
|
55
|
-
}),
|
|
56
|
-
Promise.resolve().then(function() {
|
|
57
|
-
return _interopRequireWildcard(require("./prompts"));
|
|
58
|
-
}),
|
|
59
|
-
Promise.resolve().then(function() {
|
|
60
|
-
return _interopRequireWildcard(require("is-root"));
|
|
61
|
-
}),
|
|
62
|
-
Promise.resolve().then(function() {
|
|
63
|
-
return _interopRequireWildcard(require("../log"));
|
|
64
|
-
}),
|
|
65
|
-
]);
|
|
66
92
|
try {
|
|
67
93
|
const port = await (0, _freeportAsync).default(defaultPort, {
|
|
68
94
|
hostnames: [
|
|
@@ -72,8 +98,9 @@ async function choosePortAsync(projectRoot, { defaultPort , host , reuseExisting
|
|
|
72
98
|
if (port === defaultPort) {
|
|
73
99
|
return port;
|
|
74
100
|
}
|
|
75
|
-
const isRestricted =
|
|
101
|
+
const isRestricted = isRestrictedPort(port);
|
|
76
102
|
let message = isRestricted ? `Admin permissions are required to run a server on a port below 1024` : `Port ${_chalk.default.bold(defaultPort)} is`;
|
|
103
|
+
const { getRunningProcess } = require("./getRunningProcess");
|
|
77
104
|
const runningProcess = isRestricted ? null : getRunningProcess(defaultPort);
|
|
78
105
|
if (runningProcess) {
|
|
79
106
|
const pidTag = _chalk.default.gray(`(pid ${runningProcess.pid})`);
|
|
@@ -89,7 +116,8 @@ async function choosePortAsync(projectRoot, { defaultPort , host , reuseExisting
|
|
|
89
116
|
} else {
|
|
90
117
|
message += " being used by another process";
|
|
91
118
|
}
|
|
92
|
-
|
|
119
|
+
Log.log(`\u203A ${message}`);
|
|
120
|
+
const { confirmAsync } = require("./prompts");
|
|
93
121
|
const change = await confirmAsync({
|
|
94
122
|
message: `Use port ${port} instead?`,
|
|
95
123
|
initial: true
|
|
@@ -99,7 +127,7 @@ async function choosePortAsync(projectRoot, { defaultPort , host , reuseExisting
|
|
|
99
127
|
if (error.code === "ABORTED") {
|
|
100
128
|
throw error;
|
|
101
129
|
} else if (error.code === "NON_INTERACTIVE") {
|
|
102
|
-
|
|
130
|
+
Log.warn(_chalk.default.yellow(error.message));
|
|
103
131
|
return null;
|
|
104
132
|
}
|
|
105
133
|
throw error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/port.ts"],"sourcesContent":["import chalk from 'chalk';\nimport freeportAsync from 'freeport-async';\n\nimport * as Log from '../log';\nimport { env } from './env';\nimport { CommandError } from './errors';\n\n/** Get a free port or assert a CLI command error. */\nexport async function getFreePortAsync(rangeStart: number): Promise<number> {\n const port = await freeportAsync(rangeStart, { hostnames: [null, 'localhost'] });\n if (!port) {\n throw new CommandError('NO_PORT_FOUND', 'No available port found');\n }\n\n return port;\n}\n\n// TODO(Bacon): Revisit after all start and run code is merged.\nexport async function choosePortAsync(\n projectRoot: string,\n {\n defaultPort,\n host,\n reuseExistingPort,\n }: {\n defaultPort: number;\n host?: string;\n reuseExistingPort?: boolean;\n }\n): Promise<number | null> {\n const [{ getRunningProcess }, { confirmAsync }, isRoot, Log] = await Promise.all([\n import('./getRunningProcess'),\n import('./prompts'),\n import('is-root'),\n import('../log'),\n ]);\n\n try {\n const port = await freeportAsync(defaultPort, { hostnames: [host ?? null] });\n if (port === defaultPort) {\n return port;\n }\n\n const isRestricted = process.platform !== 'win32' && defaultPort < 1024 && !isRoot.default();\n\n let message = isRestricted\n ? `Admin permissions are required to run a server on a port below 1024`\n : `Port ${chalk.bold(defaultPort)} is`;\n\n const runningProcess = isRestricted ? null : getRunningProcess(defaultPort);\n\n if (runningProcess) {\n const pidTag = chalk.gray(`(pid ${runningProcess.pid})`);\n if (runningProcess.directory === projectRoot) {\n message += ` running this app in another window`;\n if (reuseExistingPort) {\n return null;\n }\n } else {\n message += ` running ${chalk.cyan(runningProcess.command)} in another window`;\n }\n message += '\\n' + chalk.gray(` ${runningProcess.directory} ${pidTag}`);\n } else {\n message += ' being used by another process';\n }\n\n Log.log(`\\u203A ${message}`);\n const change = await confirmAsync({\n message: `Use port ${port} instead?`,\n initial: true,\n });\n return change ? port : null;\n } catch (error: any) {\n if (error.code === 'ABORTED') {\n throw error;\n } else if (error.code === 'NON_INTERACTIVE') {\n Log.warn(chalk.yellow(error.message));\n return null;\n }\n throw error;\n }\n}\n\n// TODO(Bacon): Revisit after all start and run code is merged.\nexport async function resolvePortAsync(\n projectRoot: string,\n {\n /** Should opt to reuse a port that is running the same project in another window. */\n reuseExistingPort,\n /** Preferred port. */\n defaultPort,\n /** Backup port for when the default isn't available. */\n fallbackPort,\n }: {\n reuseExistingPort?: boolean;\n defaultPort?: string | number;\n fallbackPort?: number;\n } = {}\n): Promise<number | null> {\n let port: number;\n if (typeof defaultPort === 'string') {\n port = parseInt(defaultPort, 10);\n } else if (typeof defaultPort === 'number') {\n port = defaultPort;\n } else {\n port = env.RCT_METRO_PORT || fallbackPort || 8081;\n }\n\n // Only check the port when the bundler is running.\n const resolvedPort = await choosePortAsync(projectRoot, {\n defaultPort: port,\n reuseExistingPort,\n });\n if (resolvedPort == null) {\n Log.log('\\u203A Skipping dev server');\n // Skip bundling if the port is null\n } else {\n // Use the new or resolved port\n process.env.RCT_METRO_PORT = String(resolvedPort);\n }\n\n return resolvedPort;\n}\n"],"names":["getFreePortAsync","choosePortAsync","resolvePortAsync","Log","rangeStart","port","freeportAsync","hostnames","CommandError","projectRoot","defaultPort","host","reuseExistingPort","getRunningProcess","confirmAsync","isRoot","Promise","all","isRestricted","process","platform","default","message","chalk","bold","runningProcess","pidTag","gray","pid","directory","cyan","command","log","change","initial","error","code","warn","yellow","fallbackPort","parseInt","env","RCT_METRO_PORT","resolvedPort","String"],"mappings":"AAAA;;;;QAQsBA,gBAAgB,GAAhBA,gBAAgB;QAUhBC,eAAe,GAAfA,eAAe;QAkEfC,gBAAgB,GAAhBA,gBAAgB;AApFpB,IAAA,MAAO,kCAAP,OAAO,EAAA;AACC,IAAA,cAAgB,kCAAhB,gBAAgB,EAAA;AAE9BC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACK,IAAA,IAAO,WAAP,OAAO,CAAA;AACE,IAAA,OAAU,WAAV,UAAU,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGhC,eAAeH,gBAAgB,CAACI,UAAkB,EAAmB;IAC1E,MAAMC,IAAI,GAAG,MAAMC,CAAAA,GAAAA,cAAa,AAAgD,CAAA,QAAhD,CAACF,UAAU,EAAE;QAAEG,SAAS,EAAE;YAAC,IAAI;YAAE,WAAW;SAAC;KAAE,CAAC,AAAC;IACjF,IAAI,CAACF,IAAI,EAAE;QACT,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tBF,WAAW,CAAA,EACX,wDAAwD,CACxD6B,YAAY,CAAA,EAKb,GAAG,EAAE,EACkB;IACxB,IAAIlC,IAAI,AAAQ,AAAC;IACjB,IAAI,OAAOK,WAAW,KAAK,QAAQ,EAAE;QACnCL,IAAI,GAAGmC,QAAQ,CAAC9B,WAAW,EAAE,EAAE,CAAC,CAAC;KAClC,MAAM,IAAI,OAAOA,WAAW,KAAK,QAAQ,EAAE;QAC1CL,IAAI,GAAGK,WAAW,CAAC;KACpB,MAAM;QACLL,IAAI,GAAGoC,IAAG,IAAA,CAACC,cAAc,IAAIH,YAAY,IAAI,IAAI,CAAC;KACnD;IAED,mDAAmD;IACnD,MAAMI,YAAY,GAAG,MAAM1C,eAAe,CAACQ,WAAW,EAAE;QACtDC,WAAW,EAAEL,IAAI;QACjBO,iBAAiB;KAClB,CAAC,AAAC;IACH,IAAI+B,YAAY,IAAI,IAAI,EAAE;QACxBxC,GAAG,CAAC6B,GAAG,CAAC,4BAA4B,CAAC,CAAC;IACtC,oCAAoC;KACrC,MAAM;QACL,+BAA+B;QAC/Bb,OAAO,CAACsB,GAAG,CAACC,cAAc,GAAGE,MAAM,CAACD,YAAY,CAAC,CAAC;KACnD;IAED,OAAOA,YAAY,CAAC;CACrB"}
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/port.ts"],"sourcesContent":["import chalk from 'chalk';\nimport freeportAsync from 'freeport-async';\n\nimport * as Log from '../log';\nimport { env } from './env';\nimport { CommandError } from './errors';\n\n/** Get a free port or assert a CLI command error. */\nexport async function getFreePortAsync(rangeStart: number): Promise<number> {\n const port = await freeportAsync(rangeStart, { hostnames: [null, 'localhost'] });\n if (!port) {\n throw new CommandError('NO_PORT_FOUND', 'No available port found');\n }\n\n return port;\n}\n\n/** @return `true` if the port can still be used to start the dev server, `false` if the dev server should be skipped, and asserts if the port is now taken. */\nexport async function ensurePortAvailabilityAsync(\n projectRoot: string,\n { port }: { port: number }\n): Promise<boolean> {\n const freePort = await freeportAsync(port, { hostnames: [null] });\n // Check if port has become busy during the build.\n if (freePort === port) {\n return true;\n }\n\n const isBusy = await isBusyPortRunningSameProcessAsync(projectRoot, { port });\n if (!isBusy) {\n throw new CommandError(\n `Port \"${port}\" became busy running another process while the app was compiling. Re-run command to use a new port.`\n );\n }\n\n // Log that the dev server will not be started and that the logs will appear in another window.\n Log.log(\n '› The dev server for this app is already running in another window. Logs will appear there.'\n );\n return false;\n}\n\nfunction isRestrictedPort(port: number) {\n if (process.platform !== 'win32' && port < 1024) {\n const isRoot = process.getuid && process.getuid() === 0;\n return !isRoot;\n }\n return false;\n}\n\nasync function isBusyPortRunningSameProcessAsync(projectRoot: string, { port }: { port: number }) {\n const { getRunningProcess } =\n require('./getRunningProcess') as typeof import('./getRunningProcess');\n\n const runningProcess = isRestrictedPort(port) ? null : getRunningProcess(port);\n if (runningProcess) {\n if (runningProcess.directory === projectRoot) {\n return true;\n } else {\n return false;\n }\n }\n\n return null;\n}\n\n// TODO(Bacon): Revisit after all start and run code is merged.\nexport async function choosePortAsync(\n projectRoot: string,\n {\n defaultPort,\n host,\n reuseExistingPort,\n }: {\n defaultPort: number;\n host?: string;\n reuseExistingPort?: boolean;\n }\n): Promise<number | null> {\n try {\n const port = await freeportAsync(defaultPort, { hostnames: [host ?? null] });\n if (port === defaultPort) {\n return port;\n }\n\n const isRestricted = isRestrictedPort(port);\n\n let message = isRestricted\n ? `Admin permissions are required to run a server on a port below 1024`\n : `Port ${chalk.bold(defaultPort)} is`;\n\n const { getRunningProcess } =\n require('./getRunningProcess') as typeof import('./getRunningProcess');\n const runningProcess = isRestricted ? null : getRunningProcess(defaultPort);\n\n if (runningProcess) {\n const pidTag = chalk.gray(`(pid ${runningProcess.pid})`);\n if (runningProcess.directory === projectRoot) {\n message += ` running this app in another window`;\n if (reuseExistingPort) {\n return null;\n }\n } else {\n message += ` running ${chalk.cyan(runningProcess.command)} in another window`;\n }\n message += '\\n' + chalk.gray(` ${runningProcess.directory} ${pidTag}`);\n } else {\n message += ' being used by another process';\n }\n\n Log.log(`\\u203A ${message}`);\n const { confirmAsync } = require('./prompts') as typeof import('./prompts');\n const change = await confirmAsync({\n message: `Use port ${port} instead?`,\n initial: true,\n });\n return change ? port : null;\n } catch (error: any) {\n if (error.code === 'ABORTED') {\n throw error;\n } else if (error.code === 'NON_INTERACTIVE') {\n Log.warn(chalk.yellow(error.message));\n return null;\n }\n throw error;\n }\n}\n\n// TODO(Bacon): Revisit after all start and run code is merged.\nexport async function resolvePortAsync(\n projectRoot: string,\n {\n /** Should opt to reuse a port that is running the same project in another window. */\n reuseExistingPort,\n /** Preferred port. */\n defaultPort,\n /** Backup port for when the default isn't available. */\n fallbackPort,\n }: {\n reuseExistingPort?: boolean;\n defaultPort?: string | number;\n fallbackPort?: number;\n } = {}\n): Promise<number | null> {\n let port: number;\n if (typeof defaultPort === 'string') {\n port = parseInt(defaultPort, 10);\n } else if (typeof defaultPort === 'number') {\n port = defaultPort;\n } else {\n port = env.RCT_METRO_PORT || fallbackPort || 8081;\n }\n\n // Only check the port when the bundler is running.\n const resolvedPort = await choosePortAsync(projectRoot, {\n defaultPort: port,\n reuseExistingPort,\n });\n if (resolvedPort == null) {\n Log.log('\\u203A Skipping dev server');\n // Skip bundling if the port is null\n } else {\n // Use the new or resolved port\n process.env.RCT_METRO_PORT = String(resolvedPort);\n }\n\n return resolvedPort;\n}\n"],"names":["getFreePortAsync","ensurePortAvailabilityAsync","choosePortAsync","resolvePortAsync","Log","rangeStart","port","freeportAsync","hostnames","CommandError","projectRoot","freePort","isBusy","isBusyPortRunningSameProcessAsync","log","isRestrictedPort","process","platform","isRoot","getuid","getRunningProcess","require","runningProcess","directory","defaultPort","host","reuseExistingPort","isRestricted","message","chalk","bold","pidTag","gray","pid","cyan","command","confirmAsync","change","initial","error","code","warn","yellow","fallbackPort","parseInt","env","RCT_METRO_PORT","resolvedPort","String"],"mappings":"AAAA;;;;QAQsBA,gBAAgB,GAAhBA,gBAAgB;QAUhBC,2BAA2B,GAA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ED,OAAOA,YAAY,CAAC;CACrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/cli",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.13",
|
|
4
4
|
"description": "The Expo CLI",
|
|
5
5
|
"main": "build/bin/cli",
|
|
6
6
|
"bin": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@expo/json-file": "^8.2.37",
|
|
48
48
|
"@expo/metro-config": "~0.10.0",
|
|
49
49
|
"@expo/osascript": "^2.0.31",
|
|
50
|
-
"@expo/package-manager": "~1.
|
|
50
|
+
"@expo/package-manager": "~1.1.0",
|
|
51
51
|
"@expo/plist": "^0.0.20",
|
|
52
52
|
"@expo/prebuild-config": "6.2.6",
|
|
53
53
|
"@expo/rudder-sdk-node": "1.1.1",
|
|
@@ -72,7 +72,6 @@
|
|
|
72
72
|
"graphql-tag": "^2.10.1",
|
|
73
73
|
"https-proxy-agent": "^5.0.1",
|
|
74
74
|
"internal-ip": "4.3.0",
|
|
75
|
-
"is-root": "^2.1.0",
|
|
76
75
|
"js-yaml": "^3.13.1",
|
|
77
76
|
"json-schema-deref-sync": "^0.13.0",
|
|
78
77
|
"md5-file": "^3.2.3",
|
|
@@ -150,5 +149,5 @@
|
|
|
150
149
|
"jest-runner-tsd": "^6.0.0",
|
|
151
150
|
"tsd": "^0.28.1"
|
|
152
151
|
},
|
|
153
|
-
"gitHead": "
|
|
152
|
+
"gitHead": "ad4c3294898ce319585bad3fe6de839443863a55"
|
|
154
153
|
}
|