@expo/cli 0.22.7 → 0.22.9

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.
Files changed (49) hide show
  1. package/build/bin/cli +1 -1
  2. package/build/src/api/rest/client.js +2 -0
  3. package/build/src/api/rest/client.js.map +1 -1
  4. package/build/src/customize/customizeAsync.js +4 -1
  5. package/build/src/customize/customizeAsync.js.map +1 -1
  6. package/build/src/customize/templates.js +12 -0
  7. package/build/src/customize/templates.js.map +1 -1
  8. package/build/src/export/embed/exportEager.js +5 -3
  9. package/build/src/export/embed/exportEager.js.map +1 -1
  10. package/build/src/export/embed/exportEmbedAsync.js +4 -4
  11. package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
  12. package/build/src/export/embed/exportServer.js +2 -1
  13. package/build/src/export/embed/exportServer.js.map +1 -1
  14. package/build/src/export/embed/index.js +4 -0
  15. package/build/src/export/embed/index.js.map +1 -1
  16. package/build/src/export/embed/resolveOptions.js +2 -1
  17. package/build/src/export/embed/resolveOptions.js.map +1 -1
  18. package/build/src/export/exportApp.js +2 -1
  19. package/build/src/export/exportApp.js.map +1 -1
  20. package/build/src/install/index.js +2 -1
  21. package/build/src/install/index.js.map +1 -1
  22. package/build/src/install/installAsync.js +2 -1
  23. package/build/src/install/installAsync.js.map +1 -1
  24. package/build/src/install/installExpoPackage.js +14 -6
  25. package/build/src/install/installExpoPackage.js.map +1 -1
  26. package/build/src/install/resolveOptions.js +2 -0
  27. package/build/src/install/resolveOptions.js.map +1 -1
  28. package/build/src/prebuild/index.js +1 -1
  29. package/build/src/prebuild/index.js.map +1 -1
  30. package/build/src/run/ios/XcodeBuild.types.js.map +1 -1
  31. package/build/src/run/ios/index.js +4 -0
  32. package/build/src/run/ios/index.js.map +1 -1
  33. package/build/src/run/ios/options/resolveOptions.js +2 -1
  34. package/build/src/run/ios/options/resolveOptions.js.map +1 -1
  35. package/build/src/run/ios/runIosAsync.js +87 -8
  36. package/build/src/run/ios/runIosAsync.js.map +1 -1
  37. package/build/src/start/server/metro/MetroBundlerDevServer.js +1 -2
  38. package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
  39. package/build/src/start/server/metro/createServerComponentsMiddleware.js +42 -5
  40. package/build/src/start/server/metro/createServerComponentsMiddleware.js.map +1 -1
  41. package/build/src/utils/env.js +6 -0
  42. package/build/src/utils/env.js.map +1 -1
  43. package/build/src/utils/ip.js +8 -1
  44. package/build/src/utils/ip.js.map +1 -1
  45. package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
  46. package/build/src/utils/telemetry/utils/context.js +1 -1
  47. package/package.json +14 -14
  48. package/static/template/+html.tsx +28 -0
  49. package/static/template/+native-intent.ts +9 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/run/ios/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport path from 'path';\n\nimport { XcodeConfiguration } from './XcodeBuild.types';\nimport { Command } from '../../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../../utils/args';\nimport { logCmdError } from '../../utils/errors';\n\nexport const expoRunIos: Command = async (argv) => {\n const rawArgsMap: arg.Spec = {\n // Types\n '--help': Boolean,\n '--no-build-cache': Boolean,\n '--no-install': Boolean,\n '--no-bundler': Boolean,\n '--configuration': String,\n '--binary': String,\n\n '--port': Number,\n // Aliases\n '-p': '--port',\n\n '-h': '--help',\n };\n const args = assertWithOptionsArgs(rawArgsMap, {\n argv,\n\n permissive: true,\n });\n\n // '-d' -> '--device': Boolean,\n // '--scheme': String,\n\n if (args['--help']) {\n printHelp(\n `Run the iOS app binary locally`,\n `npx expo run:ios`,\n [\n `--no-build-cache Clear the native derived data before building`,\n `--no-install Skip installing dependencies`,\n `--no-bundler Skip starting the Metro bundler`,\n `--scheme [scheme] Scheme to build`,\n `--binary <path> Path to existing .app or .ipa to install.`,\n chalk`--configuration <configuration> Xcode configuration to use. Debug or Release. {dim Default: Debug}`,\n `-d, --device [device] Device name or UDID to build the app on`,\n chalk`-p, --port <port> Port to start the Metro bundler on. {dim Default: 8081}`,\n `-h, --help Usage info`,\n ].join('\\n'),\n [\n '',\n chalk` Build for production (unsigned) with the {bold Release} configuration:`,\n chalk` {dim $} npx expo run:ios --configuration Release`,\n '',\n ].join('\\n')\n );\n }\n\n const { resolveStringOrBooleanArgsAsync } = await import('../../utils/resolveArgs.js');\n const parsed = await resolveStringOrBooleanArgsAsync(argv ?? [], rawArgsMap, {\n '--scheme': Boolean,\n '--device': Boolean,\n '-d': '--device',\n }).catch(logCmdError);\n\n const { runIosAsync } = await import('./runIosAsync.js');\n return runIosAsync(path.resolve(parsed.projectRoot), {\n // Parsed options\n buildCache: !args['--no-build-cache'],\n install: !args['--no-install'],\n bundler: !args['--no-bundler'],\n port: args['--port'],\n binary: args['--binary'],\n\n // Custom parsed args\n device: parsed.args['--device'],\n scheme: parsed.args['--scheme'],\n configuration: parsed.args['--configuration'] as XcodeConfiguration,\n }).catch(logCmdError);\n};\n"],"names":["expoRunIos","argv","rawArgsMap","Boolean","String","Number","args","assertWithOptionsArgs","permissive","printHelp","chalk","join","resolveStringOrBooleanArgsAsync","parsed","catch","logCmdError","runIosAsync","path","resolve","projectRoot","buildCache","install","bundler","port","binary","device","scheme","configuration"],"mappings":"AAAA;;;;;+BAUaA,YAAU;;aAAVA,UAAU;;;8DARL,OAAO;;;;;;;8DACR,MAAM;;;;;;sBAI0B,kBAAkB;wBACvC,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzC,MAAMA,UAAU,GAAY,OAAOC,IAAI,GAAK;IACjD,MAAMC,UAAU,GAAa;QAC3B,QAAQ;QACR,QAAQ,EAAEC,OAAO;QACjB,kBAAkB,EAAEA,OAAO;QAC3B,cAAc,EAAEA,OAAO;QACvB,cAAc,EAAEA,OAAO;QACvB,iBAAiB,EAAEC,MAAM;QACzB,UAAU,EAAEA,MAAM;QAElB,QAAQ,EAAEC,MAAM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WAAW,CAAA,EAAE,GAAG,MAAM,iEAAA,OAAM,CAAC,kBAAkB,GAAC,AAAC;IACzD,OAAOA,WAAW,CAACC,KAAI,EAAA,QAAA,CAACC,OAAO,CAACL,MAAM,CAACM,WAAW,CAAC,EAAE;QACnD,iBAAiB;QACjBC,UAAU,EAAE,CAACd,IAAI,CAAC,kBAAkB,CAAC;QACrCe,OAAO,EAAE,CAACf,IAAI,CAAC,cAAc,CAAC;QAC9BgB,OAAO,EAAE,CAAChB,IAAI,CAAC,cAAc,CAAC;QAC9BiB,IAAI,EAAEjB,IAAI,CAAC,QAAQ,CAAC;QACpBkB,MAAM,EAAElB,IAAI,CAAC,UAAU,CAAC;QAExB,qBAAqB;QACrBmB,MAAM,EAAEZ,MAAM,CAACP,IAAI,CAAC,UAAU,CAAC;QAC/BoB,MAAM,EAAEb,MAAM,CAACP,IAAI,CAAC,UAAU,CAAC;QAC/BqB,aAAa,EAAEd,MAAM,CAACP,IAAI,CAAC,iBAAiB,CAAC;KAC9C,CAAC,CAACQ,KAAK,CAACC,OAAW,YAAA,CAAC,CAAC;AACxB,CAAC,AAAC"}
1
+ {"version":3,"sources":["../../../../src/run/ios/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport path from 'path';\n\nimport { XcodeConfiguration } from './XcodeBuild.types';\nimport { Command } from '../../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../../utils/args';\nimport { logCmdError } from '../../utils/errors';\n\nexport const expoRunIos: Command = async (argv) => {\n const rawArgsMap: arg.Spec = {\n // Types\n '--help': Boolean,\n '--no-build-cache': Boolean,\n '--no-install': Boolean,\n '--no-bundler': Boolean,\n '--configuration': String,\n '--binary': String,\n\n '--port': Number,\n\n // Undocumented flag for re-bundling the app and assets for a build to try different JS code in release builds.\n // Also updates the app.json.\n '--unstable-rebundle': Boolean,\n // Aliases\n '-p': '--port',\n\n '-h': '--help',\n };\n const args = assertWithOptionsArgs(rawArgsMap, {\n argv,\n\n permissive: true,\n });\n\n // '-d' -> '--device': Boolean,\n // '--scheme': String,\n\n if (args['--help']) {\n printHelp(\n `Run the iOS app binary locally`,\n `npx expo run:ios`,\n [\n `--no-build-cache Clear the native derived data before building`,\n `--no-install Skip installing dependencies`,\n `--no-bundler Skip starting the Metro bundler`,\n `--scheme [scheme] Scheme to build`,\n `--binary <path> Path to existing .app or .ipa to install.`,\n chalk`--configuration <configuration> Xcode configuration to use. Debug or Release. {dim Default: Debug}`,\n `-d, --device [device] Device name or UDID to build the app on`,\n chalk`-p, --port <port> Port to start the Metro bundler on. {dim Default: 8081}`,\n `-h, --help Usage info`,\n ].join('\\n'),\n [\n '',\n chalk` Build for production (unsigned) with the {bold Release} configuration:`,\n chalk` {dim $} npx expo run:ios --configuration Release`,\n '',\n ].join('\\n')\n );\n }\n\n const { resolveStringOrBooleanArgsAsync } = await import('../../utils/resolveArgs.js');\n const parsed = await resolveStringOrBooleanArgsAsync(argv ?? [], rawArgsMap, {\n '--scheme': Boolean,\n '--device': Boolean,\n '-d': '--device',\n }).catch(logCmdError);\n\n const { runIosAsync } = await import('./runIosAsync.js');\n return runIosAsync(path.resolve(parsed.projectRoot), {\n // Parsed options\n buildCache: !args['--no-build-cache'],\n install: !args['--no-install'],\n bundler: !args['--no-bundler'],\n port: args['--port'],\n binary: args['--binary'],\n rebundle: args['--unstable-rebundle'],\n\n // Custom parsed args\n device: parsed.args['--device'],\n scheme: parsed.args['--scheme'],\n configuration: parsed.args['--configuration'] as XcodeConfiguration,\n }).catch(logCmdError);\n};\n"],"names":["expoRunIos","argv","rawArgsMap","Boolean","String","Number","args","assertWithOptionsArgs","permissive","printHelp","chalk","join","resolveStringOrBooleanArgsAsync","parsed","catch","logCmdError","runIosAsync","path","resolve","projectRoot","buildCache","install","bundler","port","binary","rebundle","device","scheme","configuration"],"mappings":"AAAA;;;;;+BAUaA,YAAU;;aAAVA,UAAU;;;8DARL,OAAO;;;;;;;8DACR,MAAM;;;;;;sBAI0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");
11
11
  const _resolveXcodeProject = require("./resolveXcodeProject");
12
12
  const _simctl = require("../../../start/platforms/ios/simctl");
13
+ const _profile = require("../../../utils/profile");
13
14
  const _resolveBundlerProps = require("../../resolveBundlerProps");
14
15
  async function resolveOptionsAsync(projectRoot, options) {
15
16
  const xcodeProject = (0, _resolveXcodeProject.resolveXcodeProject)(projectRoot);
@@ -21,7 +22,7 @@ async function resolveOptionsAsync(projectRoot, options) {
21
22
  const configuration = options.configuration || "Debug";
22
23
  // Resolve the device based on the provided device id or prompt
23
24
  // from a list of devices (connected or simulated) that are filtered by the scheme.
24
- const device = await (0, _resolveDevice.resolveDeviceAsync)(options.device, {
25
+ const device = await (0, _profile.profile)(_resolveDevice.resolveDeviceAsync)(options.device, {
25
26
  // It's unclear if there's any value to asserting that we haven't hardcoded the os type in the CLI.
26
27
  osType: (0, _simctl.isOSType)(osType) ? osType : undefined,
27
28
  xcodeProject,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/run/ios/options/resolveOptions.ts"],"sourcesContent":["import { isSimulatorDevice, resolveDeviceAsync } from './resolveDevice';\nimport { resolveNativeSchemePropsAsync } from './resolveNativeScheme';\nimport { resolveXcodeProject } from './resolveXcodeProject';\nimport { isOSType } from '../../../start/platforms/ios/simctl';\nimport { resolveBundlerPropsAsync } from '../../resolveBundlerProps';\nimport { BuildProps, Options } from '../XcodeBuild.types';\n\n/** Resolve arguments for the `run:ios` command. */\nexport async function resolveOptionsAsync(\n projectRoot: string,\n options: Options\n): Promise<BuildProps> {\n const xcodeProject = resolveXcodeProject(projectRoot);\n\n const bundlerProps = await resolveBundlerPropsAsync(projectRoot, options);\n\n // Resolve the scheme before the device so we can filter devices based on\n // whichever scheme is selected (i.e. don't present TV devices if the scheme cannot be run on a TV).\n const { osType, name: scheme } = await resolveNativeSchemePropsAsync(\n projectRoot,\n options,\n xcodeProject\n );\n\n // Use the configuration or `Debug` if none is provided.\n const configuration = options.configuration || 'Debug';\n\n // Resolve the device based on the provided device id or prompt\n // from a list of devices (connected or simulated) that are filtered by the scheme.\n const device = await resolveDeviceAsync(options.device, {\n // It's unclear if there's any value to asserting that we haven't hardcoded the os type in the CLI.\n osType: isOSType(osType) ? osType : undefined,\n xcodeProject,\n scheme,\n configuration,\n });\n\n const isSimulator = isSimulatorDevice(device);\n\n // This optimization skips resetting the Metro cache needlessly.\n // The cache is reset in `../node_modules/react-native/scripts/react-native-xcode.sh` when the\n // project is running in Debug and built onto a physical device. It seems that this is done because\n // the script is run from Xcode and unaware of the CLI instance.\n const shouldSkipInitialBundling = configuration === 'Debug' && !isSimulator;\n\n return {\n ...bundlerProps,\n shouldStartBundler: options.configuration === 'Debug' || bundlerProps.shouldStartBundler,\n projectRoot,\n isSimulator,\n xcodeProject,\n device,\n configuration,\n shouldSkipInitialBundling,\n buildCache: options.buildCache !== false,\n scheme,\n };\n}\n"],"names":["resolveOptionsAsync","projectRoot","options","xcodeProject","resolveXcodeProject","bundlerProps","resolveBundlerPropsAsync","osType","name","scheme","resolveNativeSchemePropsAsync","configuration","device","resolveDeviceAsync","isOSType","undefined","isSimulator","isSimulatorDevice","shouldSkipInitialBundling","shouldStartBundler","buildCache"],"mappings":"AAAA;;;;+BAQsBA,qBAAmB;;aAAnBA,mBAAmB;;+BARa,iBAAiB;qCACzB,uBAAuB;qCACjC,uBAAuB;wBAClC,qCAAqC;qCACrB,2BAA2B;AAI7D,eAAeA,mBAAmB,CACvCC,WAAmB,EACnBC,OAAgB,EACK;IACrB,MAAMC,YAAY,GAAGC,IAAAA,oBAAmB,oBAAA,EAACH,WAAW,CAAC,AAAC;IAEtD,MAAMI,YAAY,GAAG,MAAMC,IAAAA,oBAAwB,yBAAA,EAACL,WAAW,EAAEC,OAAO,CAAC,AAAC;IAE1E,yEAAyE;IACzE,oGAAoG;IACpG,MAAM,EAAEK,MAAM,CAAA,EAAEC,IAAI,EAAEC,MAAM,CAAA,EAAE,GAAG,MAAMC,IAAAA,oBAA6B,8BAAA,EAClET,WAAW,EACXC,OAAO,EACPC,YAAY,CACb,AAAC;IAEF,wDAAwD;IACxD,MAAMQ,aAAa,GAAGT,OAAO,CAACS,aAAa,IAAI,OAAO,AAAC;IAEvD,+DAA+D;IAC/D,mFAAmF;IACnF,MAAMC,MAAM,GAAG,MAAMC,IAAAA,cAAkB,mBAAA,EAACX,OAAO,CAACU,MAAM,EAAE;QACtD,mGAAmG;QACnGL,MAAM,EAAEO,IAAAA,OAAQ,SAAA,EAACP,MAAM,CAAC,GAAGA,MAAM,GAAGQ,SAAS;QAC7CZ,YAAY;QACZM,MAAM;QACNE,aAAa;KACd,CAAC,AAAC;IAEH,MAAMK,WAAW,GAAGC,IAAAA,cAAiB,kBAAA,EAACL,MAAM,CAAC,AAAC;IAE9C,gEAAgE;IAChE,8FAA8F;IAC9F,mGAAmG;IACnG,gEAAgE;IAChE,MAAMM,yBAAyB,GAAGP,aAAa,KAAK,OAAO,IAAI,CAACK,WAAW,AAAC;IAE5E,OAAO;QACL,GAAGX,YAAY;QACfc,kBAAkB,EAAEjB,OAAO,CAACS,aAAa,KAAK,OAAO,IAAIN,YAAY,CAACc,kBAAkB;QACxFlB,WAAW;QACXe,WAAW;QACXb,YAAY;QACZS,MAAM;QACND,aAAa;QACbO,yBAAyB;QACzBE,UAAU,EAAElB,OAAO,CAACkB,UAAU,KAAK,KAAK;QACxCX,MAAM;KACP,CAAC;AACJ,CAAC"}
1
+ {"version":3,"sources":["../../../../../src/run/ios/options/resolveOptions.ts"],"sourcesContent":["import { isSimulatorDevice, resolveDeviceAsync } from './resolveDevice';\nimport { resolveNativeSchemePropsAsync } from './resolveNativeScheme';\nimport { resolveXcodeProject } from './resolveXcodeProject';\nimport { isOSType } from '../../../start/platforms/ios/simctl';\nimport { profile } from '../../../utils/profile';\nimport { resolveBundlerPropsAsync } from '../../resolveBundlerProps';\nimport { BuildProps, Options } from '../XcodeBuild.types';\n\n/** Resolve arguments for the `run:ios` command. */\nexport async function resolveOptionsAsync(\n projectRoot: string,\n options: Options\n): Promise<BuildProps> {\n const xcodeProject = resolveXcodeProject(projectRoot);\n\n const bundlerProps = await resolveBundlerPropsAsync(projectRoot, options);\n\n // Resolve the scheme before the device so we can filter devices based on\n // whichever scheme is selected (i.e. don't present TV devices if the scheme cannot be run on a TV).\n const { osType, name: scheme } = await resolveNativeSchemePropsAsync(\n projectRoot,\n options,\n xcodeProject\n );\n\n // Use the configuration or `Debug` if none is provided.\n const configuration = options.configuration || 'Debug';\n\n // Resolve the device based on the provided device id or prompt\n // from a list of devices (connected or simulated) that are filtered by the scheme.\n const device = await profile(resolveDeviceAsync)(options.device, {\n // It's unclear if there's any value to asserting that we haven't hardcoded the os type in the CLI.\n osType: isOSType(osType) ? osType : undefined,\n xcodeProject,\n scheme,\n configuration,\n });\n\n const isSimulator = isSimulatorDevice(device);\n\n // This optimization skips resetting the Metro cache needlessly.\n // The cache is reset in `../node_modules/react-native/scripts/react-native-xcode.sh` when the\n // project is running in Debug and built onto a physical device. It seems that this is done because\n // the script is run from Xcode and unaware of the CLI instance.\n const shouldSkipInitialBundling = configuration === 'Debug' && !isSimulator;\n\n return {\n ...bundlerProps,\n shouldStartBundler: options.configuration === 'Debug' || bundlerProps.shouldStartBundler,\n projectRoot,\n isSimulator,\n xcodeProject,\n device,\n configuration,\n shouldSkipInitialBundling,\n buildCache: options.buildCache !== false,\n scheme,\n };\n}\n"],"names":["resolveOptionsAsync","projectRoot","options","xcodeProject","resolveXcodeProject","bundlerProps","resolveBundlerPropsAsync","osType","name","scheme","resolveNativeSchemePropsAsync","configuration","device","profile","resolveDeviceAsync","isOSType","undefined","isSimulator","isSimulatorDevice","shouldSkipInitialBundling","shouldStartBundler","buildCache"],"mappings":"AAAA;;;;+BASsBA,qBAAmB;;aAAnBA,mBAAmB;;+BATa,iBAAiB;qCACzB,uBAAuB;qCACjC,uBAAuB;wBAClC,qCAAqC;yBACtC,wBAAwB;qCACP,2BAA2B;AAI7D,eAAeA,mBAAmB,CACvCC,WAAmB,EACnBC,OAAg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6,13 @@ Object.defineProperty(exports, "runIosAsync", {
6
6
  enumerable: true,
7
7
  get: ()=>runIosAsync
8
8
  });
9
+ function _spawnAsync() {
10
+ const data = /*#__PURE__*/ _interopRequireDefault(require("@expo/spawn-async"));
11
+ _spawnAsync = function() {
12
+ return data;
13
+ };
14
+ return data;
15
+ }
9
16
  function _chalk() {
10
17
  const data = /*#__PURE__*/ _interopRequireDefault(require("chalk"));
11
18
  _chalk = function() {
@@ -13,7 +20,22 @@ function _chalk() {
13
20
  };
14
21
  return data;
15
22
  }
23
+ function _fs() {
24
+ const data = /*#__PURE__*/ _interopRequireDefault(require("fs"));
25
+ _fs = function() {
26
+ return data;
27
+ };
28
+ return data;
29
+ }
30
+ function _path() {
31
+ const data = /*#__PURE__*/ _interopRequireDefault(require("path"));
32
+ _path = function() {
33
+ return data;
34
+ };
35
+ return data;
36
+ }
16
37
  const _log = /*#__PURE__*/ _interopRequireWildcard(require("../../log"));
38
+ const _appleAppIdResolver = require("../../start/platforms/ios/AppleAppIdResolver");
17
39
  const _cocoapods = require("../../utils/cocoapods");
18
40
  const _nodeEnv = require("../../utils/nodeEnv");
19
41
  const _port = require("../../utils/port");
@@ -27,6 +49,8 @@ const _launchApp = require("./launchApp");
27
49
  const _resolveOptions = require("./options/resolveOptions");
28
50
  const _validateExternalBinary = require("./validateExternalBinary");
29
51
  const _exportEager = require("../../export/embed/exportEager");
52
+ const _simctl = require("../../start/platforms/ios/simctl");
53
+ const _errors = require("../../utils/errors");
30
54
  function _interopRequireDefault(obj) {
31
55
  return obj && obj.__esModule ? obj : {
32
56
  default: obj
@@ -85,11 +109,53 @@ async function runIosAsync(projectRoot, options) {
85
109
  await (0, _cocoapods.maybePromptToSyncPodsAsync)(projectRoot);
86
110
  }
87
111
  // Resolve the CLI arguments into useable options.
88
- const props = await (0, _resolveOptions.resolveOptionsAsync)(projectRoot, options);
89
- let binaryPath;
112
+ const props = await (0, _profile.profile)(_resolveOptions.resolveOptionsAsync)(projectRoot, options);
113
+ if (options.rebundle) {
114
+ _log.warn(`The --unstable-rebundle flag is experimental and may not work as expected.`);
115
+ // Get the existing binary path to re-bundle the app.
116
+ let binaryPath;
117
+ if (!options.binary) {
118
+ if (!props.isSimulator) {
119
+ throw new Error("Re-bundling on physical devices requires the --binary flag.");
120
+ }
121
+ const appId = await new _appleAppIdResolver.AppleAppIdResolver(projectRoot).getAppIdAsync();
122
+ const possibleBinaryPath = await (0, _simctl.getContainerPathAsync)(props.device, {
123
+ appId
124
+ });
125
+ if (!possibleBinaryPath) {
126
+ throw new _errors.CommandError(`Cannot rebundle because no --binary was provided and no existing binary was found on the device for ID: ${appId}.`);
127
+ }
128
+ binaryPath = possibleBinaryPath;
129
+ _log.log("Re-using existing binary path:", binaryPath);
130
+ // Set the binary path to the existing binary path.
131
+ options.binary = binaryPath;
132
+ }
133
+ _log.log("Rebundling the Expo config file");
134
+ // Re-bundle the config file the same way the app was originally bundled.
135
+ await (0, _spawnAsync().default)("node", [
136
+ _path().default.join(require.resolve("expo-constants/package.json"), "../scripts/getAppConfig.js"),
137
+ projectRoot,
138
+ _path().default.join(options.binary, "EXConstants.bundle"),
139
+ ]);
140
+ // Re-bundle the app.
141
+ const possibleBundleOutput = _path().default.join(options.binary, "main.jsbundle");
142
+ if (_fs().default.existsSync(possibleBundleOutput)) {
143
+ _log.log("Rebundling the app...");
144
+ await (0, _exportEager.exportEagerAsync)(projectRoot, {
145
+ resetCache: false,
146
+ dev: false,
147
+ platform: "ios",
148
+ assetsDest: _path().default.join(options.binary, "assets"),
149
+ bundleOutput: possibleBundleOutput
150
+ });
151
+ } else {
152
+ _log.warn("Bundle output not found at expected location:", possibleBundleOutput);
153
+ }
154
+ }
155
+ let binaryPath1;
90
156
  if (options.binary) {
91
- binaryPath = await (0, _validateExternalBinary.getValidBinaryPathAsync)(options.binary, props);
92
- _log.log("Using custom binary path:", binaryPath);
157
+ binaryPath1 = await (0, _validateExternalBinary.getValidBinaryPathAsync)(options.binary, props);
158
+ _log.log("Using custom binary path:", binaryPath1);
93
159
  } else {
94
160
  let eagerBundleOptions;
95
161
  if (options.configuration === "Release") {
@@ -105,15 +171,28 @@ async function runIosAsync(projectRoot, options) {
105
171
  });
106
172
  // Find the path to the built app binary, this will be used to install the binary
107
173
  // on a device.
108
- binaryPath = await (0, _profile.profile)(_xcodeBuild.getAppBinaryPath)(buildOutput);
174
+ binaryPath1 = await (0, _profile.profile)(_xcodeBuild.getAppBinaryPath)(buildOutput);
109
175
  }
110
- debug("Binary path:", binaryPath);
176
+ debug("Binary path:", binaryPath1);
111
177
  // Ensure the port hasn't become busy during the build.
112
178
  if (props.shouldStartBundler && !await (0, _port.ensurePortAvailabilityAsync)(projectRoot, props)) {
113
179
  props.shouldStartBundler = false;
114
180
  }
115
- const launchInfo = await (0, _launchApp.getLaunchInfoForBinaryAsync)(binaryPath);
181
+ const launchInfo = await (0, _launchApp.getLaunchInfoForBinaryAsync)(binaryPath1);
116
182
  const isCustomBinary = !!options.binary;
183
+ // Always close the app before launching on a simulator. Otherwise certain cached resources like the splashscreen will not be available.
184
+ if (props.isSimulator) {
185
+ try {
186
+ await (0, _simctl.simctlAsync)([
187
+ "terminate",
188
+ props.device.udid,
189
+ launchInfo.bundleId
190
+ ]);
191
+ } catch (error) {
192
+ // If we failed it's likely that the app was not running to begin with and we will get an `invalid device` error
193
+ debug("Failed to terminate app (possibly because it was not running):", error);
194
+ }
195
+ }
117
196
  // Start the dev server which creates all of the required info for
118
197
  // launching the app on a simulator.
119
198
  const manager = await (0, _startBundler.startBundlerAsync)(projectRoot, {
@@ -123,7 +202,7 @@ async function runIosAsync(projectRoot, options) {
123
202
  scheme: isCustomBinary ? launchInfo.schemes[0] : (ref = await (0, _scheme.getSchemesForIosAsync)(projectRoot)) == null ? void 0 : ref[0]
124
203
  });
125
204
  // Install and launch the app binary on a device.
126
- await (0, _launchApp.launchAppAsync)(binaryPath, manager, {
205
+ await (0, _launchApp.launchAppAsync)(binaryPath1, manager, {
127
206
  isSimulator: props.isSimulator,
128
207
  device: props.device,
129
208
  shouldStartBundler: props.shouldStartBundler
@@ -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 { 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 { getLaunchInfoForBinaryAsync, launchAppAsync } from './launchApp';\nimport { resolveOptionsAsync } from './options/resolveOptions';\nimport { getValidBinaryPathAsync } from './validateExternalBinary';\nimport { exportEagerAsync } from '../../export/embed/exportEager';\n\nconst debug = require('debug')('expo:run:ios');\n\nexport async function runIosAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.configuration === 'Release' ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n assertPlatform();\n\n const install = !!options.install;\n\n if ((await ensureNativeProjectAsync(projectRoot, { platform: 'ios', install })) && install) {\n await maybePromptToSyncPodsAsync(projectRoot);\n }\n\n // Resolve the CLI arguments into useable options.\n const props = await resolveOptionsAsync(projectRoot, options);\n\n let binaryPath: string;\n if (options.binary) {\n binaryPath = await getValidBinaryPathAsync(options.binary, props);\n Log.log('Using custom binary path:', binaryPath);\n } else {\n let eagerBundleOptions: string | undefined;\n\n if (options.configuration === 'Release') {\n eagerBundleOptions = JSON.stringify(\n await exportEagerAsync(projectRoot, {\n dev: false,\n platform: 'ios',\n })\n );\n }\n\n // Spawn the `xcodebuild` process to create the app binary.\n const buildOutput = await XcodeBuild.buildAsync({\n ...props,\n eagerBundleOptions,\n });\n\n // Find the path to the built app binary, this will be used to install the binary\n // on a device.\n binaryPath = await profile(XcodeBuild.getAppBinaryPath)(buildOutput);\n }\n debug('Binary path:', binaryPath);\n\n // Ensure the port hasn't become busy during the build.\n if (props.shouldStartBundler && !(await ensurePortAvailabilityAsync(projectRoot, props))) {\n props.shouldStartBundler = false;\n }\n\n const launchInfo = await getLaunchInfoForBinaryAsync(binaryPath);\n const isCustomBinary = !!options.binary;\n\n // Start the dev server which creates all of the required info for\n // launching the app on a simulator.\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n headless: !props.shouldStartBundler,\n // If a scheme is specified then use that instead of the package name.\n\n scheme: isCustomBinary\n ? // If launching a custom binary, use the schemes in the Info.plist.\n launchInfo.schemes[0]\n : // If a scheme is specified then use that instead of the package name.\n (await getSchemesForIosAsync(projectRoot))?.[0],\n });\n\n // Install and launch the app binary on a device.\n await launchAppAsync(\n binaryPath,\n manager,\n {\n isSimulator: props.isSimulator,\n device: props.device,\n shouldStartBundler: props.shouldStartBundler,\n },\n launchInfo.bundleId\n );\n\n // Log the location of the JS logs for the device.\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n } else {\n await manager.stopAsync();\n }\n}\n\nfunction assertPlatform() {\n if (process.platform !== 'darwin') {\n Log.exit(\n chalk`iOS apps can only be built on macOS devices. Use {cyan eas build -p ios} to build in the cloud.`\n );\n }\n}\n"],"names":["runIosAsync","debug","require","projectRoot","options","setNodeEnv","configuration","load","assertPlatform","install","ensureNativeProjectAsync","platform","maybePromptToSyncPodsAsync","props","resolveOptionsAsync","binaryPath","binary","getValidBinaryPathAsync","Log","log","eagerBundleOptions","JSON","stringify","exportEagerAsync","dev","buildOutput","XcodeBuild","buildAsync","profile","getAppBinaryPath","shouldStartBundler","ensurePortAvailabilityAsync","launchInfo","getLaunchInfoForBinaryAsync","isCustomBinary","manager","startBundlerAsync","port","headless","scheme","schemes","getSchemesForIosAsync","launchAppAsync","isSimulator","device","bundleId","logProjectLogsLocation","stopAsync","process","exit","chalk"],"mappings":"AAAA;;;;+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CAAC,CAAC,CAAC,GAErB,CAAA,GAA0C,GAAzC,MAAMC,IAAAA,OAAqB,sBAAA,EAACtC,WAAW,CAAC,SAAM,GAA/C,KAAA,CAA+C,GAA/C,GAA0C,AAAE,CAAC,CAAC,CAAC;KACpD,CAAC,AAAC;IAEH,iDAAiD;IACjD,MAAMuC,IAAAA,UAAc,eAAA,EAClB3B,UAAU,EACVoB,OAAO,EACP;QACEQ,WAAW,EAAE9B,KAAK,CAAC8B,WAAW;QAC9BC,MAAM,EAAE/B,KAAK,CAAC+B,MAAM;QACpBd,kBAAkB,EAAEjB,KAAK,CAACiB,kBAAkB;KAC7C,EACDE,UAAU,CAACa,QAAQ,CACpB,CAAC;IAEF,kDAAkD;IAClD,IAAIhC,KAAK,CAACiB,kBAAkB,EAAE;QAC5BgB,IAAAA,MAAsB,uBAAA,GAAE,CAAC;IAC3B,OAAO;QACL,MAAMX,OAAO,CAACY,SAAS,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC;AAED,SAASvC,cAAc,GAAG;IACxB,IAAIwC,OAAO,CAACrC,QAAQ,KAAK,QAAQ,EAAE;QACjCO,IAAG,CAAC+B,IAAI,CACNC,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,+FAA+F,CAAC,CACvG,CAAC;IACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"sources":["../../../../src/run/ios/runIosAsync.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport * as Log from '../../log';\nimport { AppleAppIdResolver } from '../../start/platforms/ios/AppleAppIdResolver';\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 { getLaunchInfoForBinaryAsync, launchAppAsync } from './launchApp';\nimport { resolveOptionsAsync } from './options/resolveOptions';\nimport { getValidBinaryPathAsync } from './validateExternalBinary';\nimport { exportEagerAsync } from '../../export/embed/exportEager';\nimport { getContainerPathAsync, simctlAsync } from '../../start/platforms/ios/simctl';\nimport { CommandError } from '../../utils/errors';\n\nconst debug = require('debug')('expo:run:ios');\n\nexport async function runIosAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.configuration === 'Release' ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n assertPlatform();\n\n const install = !!options.install;\n\n if ((await ensureNativeProjectAsync(projectRoot, { platform: 'ios', install })) && install) {\n await maybePromptToSyncPodsAsync(projectRoot);\n }\n\n // Resolve the CLI arguments into useable options.\n const props = await profile(resolveOptionsAsync)(projectRoot, options);\n\n if (options.rebundle) {\n Log.warn(`The --unstable-rebundle flag is experimental and may not work as expected.`);\n // Get the existing binary path to re-bundle the app.\n\n let binaryPath: string;\n if (!options.binary) {\n if (!props.isSimulator) {\n throw new Error('Re-bundling on physical devices requires the --binary flag.');\n }\n const appId = await new AppleAppIdResolver(projectRoot).getAppIdAsync();\n const possibleBinaryPath = await getContainerPathAsync(props.device, {\n appId,\n });\n if (!possibleBinaryPath) {\n throw new CommandError(\n `Cannot rebundle because no --binary was provided and no existing binary was found on the device for ID: ${appId}.`\n );\n }\n binaryPath = possibleBinaryPath;\n Log.log('Re-using existing binary path:', binaryPath);\n // Set the binary path to the existing binary path.\n options.binary = binaryPath;\n }\n\n Log.log('Rebundling the Expo config file');\n // Re-bundle the config file the same way the app was originally bundled.\n await spawnAsync('node', [\n path.join(require.resolve('expo-constants/package.json'), '../scripts/getAppConfig.js'),\n projectRoot,\n path.join(options.binary, 'EXConstants.bundle'),\n ]);\n // Re-bundle the app.\n\n const possibleBundleOutput = path.join(options.binary, 'main.jsbundle');\n\n if (fs.existsSync(possibleBundleOutput)) {\n Log.log('Rebundling the app...');\n await exportEagerAsync(projectRoot, {\n resetCache: false,\n dev: false,\n platform: 'ios',\n assetsDest: path.join(options.binary, 'assets'),\n bundleOutput: possibleBundleOutput,\n });\n } else {\n Log.warn('Bundle output not found at expected location:', possibleBundleOutput);\n }\n }\n\n let binaryPath: string;\n if (options.binary) {\n binaryPath = await getValidBinaryPathAsync(options.binary, props);\n Log.log('Using custom binary path:', binaryPath);\n } else {\n let eagerBundleOptions: string | undefined;\n\n if (options.configuration === 'Release') {\n eagerBundleOptions = JSON.stringify(\n await exportEagerAsync(projectRoot, {\n dev: false,\n platform: 'ios',\n })\n );\n }\n\n // Spawn the `xcodebuild` process to create the app binary.\n const buildOutput = await XcodeBuild.buildAsync({\n ...props,\n eagerBundleOptions,\n });\n\n // Find the path to the built app binary, this will be used to install the binary\n // on a device.\n binaryPath = await profile(XcodeBuild.getAppBinaryPath)(buildOutput);\n }\n debug('Binary path:', binaryPath);\n\n // Ensure the port hasn't become busy during the build.\n if (props.shouldStartBundler && !(await ensurePortAvailabilityAsync(projectRoot, props))) {\n props.shouldStartBundler = false;\n }\n\n const launchInfo = await getLaunchInfoForBinaryAsync(binaryPath);\n const isCustomBinary = !!options.binary;\n\n // Always close the app before launching on a simulator. Otherwise certain cached resources like the splashscreen will not be available.\n if (props.isSimulator) {\n try {\n await simctlAsync(['terminate', props.device.udid, launchInfo.bundleId]);\n } catch (error) {\n // If we failed it's likely that the app was not running to begin with and we will get an `invalid device` error\n debug('Failed to terminate app (possibly because it was not running):', error);\n }\n }\n\n // Start the dev server which creates all of the required info for\n // launching the app on a simulator.\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n headless: !props.shouldStartBundler,\n // If a scheme is specified then use that instead of the package name.\n\n scheme: isCustomBinary\n ? // If launching a custom binary, use the schemes in the Info.plist.\n launchInfo.schemes[0]\n : // If a scheme is specified then use that instead of the package name.\n (await getSchemesForIosAsync(projectRoot))?.[0],\n });\n\n // Install and launch the app binary on a device.\n await launchAppAsync(\n binaryPath,\n manager,\n {\n isSimulator: props.isSimulator,\n device: props.device,\n shouldStartBundler: props.shouldStartBundler,\n },\n launchInfo.bundleId\n );\n\n // Log the location of the JS logs for the device.\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n } else {\n await manager.stopAsync();\n }\n}\n\nfunction assertPlatform() {\n if (process.platform !== 'darwin') {\n Log.exit(\n chalk`iOS apps can only be built on macOS devices. Use {cyan eas build -p ios} to build in the cloud.`\n );\n }\n}\n"],"names":["runIosAsync","debug","require","projectRoot","options","setNodeEnv","configuration","load","assertPlatform","install","ensureNativeProjectAsync","platform","maybePromptToSyncPodsAsync","props","profile","resolveOptionsAsync","rebundle","Log","warn","binaryPath","binary","isSimulator","Error","appId","AppleAppIdResolver","getAppIdAsync","possibleBinaryPath","getContainerPathAsync","device","CommandError","log","spawnAsync","path","join","resolve","possibleBundleOutput","fs","existsSync","exportEagerAsync","resetCache","dev","assetsDest","bundleOutput","getValidBinaryPathAsync","eagerBundleOptions","JSON","stringify","buildOutput","XcodeBuild","buildAsync","getAppBinaryPath","shouldStartBundler","ensurePortAvailabilityAsync","launchInfo","getLaunchInfoForBinaryAsync","isCustomBinary","simctlAsync","udid","bundleId","error","manager","startBundlerAsync","port","headless","scheme","schemes","getSchemesForIosAsync","launchAppAsync","logProjectLogsLocation","stopAsync","process","exit","chalk"],"mappings":"AAAA;;;;+BA0BsBA,aAAW;;aAAXA,WAAW;;;8DA1BV,mBAAmB;;;;;;;8DACxB,OAAO;;;;;;;8DACV,IAAI;;;;;;;8DACF,MAAM;;;;;;2DAEF,WAAW;oCACG,8CAA8C;2BACtC,uBAAuB;yBACvC,qBAAqB;sBACJ,kBAAkB;yBACtC,qBAAqB;wBACP,oBAAoB;qCACjB,wBAAwB;uBAC1B,UAAU;8BACf,iBAAiB;kEACvB,cAAc;2BAEkB,aAAa;gCACrC,0BAA0B;wCACtB,0BAA0B;6BACjC,gCAAgC;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E,CAAC;IAC3B,OAAO;QACL,MAAMR,OAAO,CAACS,SAAS,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC;AAED,SAAS7D,cAAc,GAAG;IACxB,IAAI8D,OAAO,CAAC3D,QAAQ,KAAK,QAAQ,EAAE;QACjCM,IAAG,CAACsD,IAAI,CACNC,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,+FAA+F,CAAC,CACvG,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -890,8 +890,7 @@ class MetroBundlerDevServer extends _bundlerDevServer.BundlerDevServer {
890
890
  // NOTE: We throw away the updates and instead simply send a trigger to the client to re-fetch the server route.
891
891
  if (!isInitialUpdate && hasUpdate) {
892
892
  // Clear all SSR modules before sending the reload event. This ensures that the next event will rebuild the in-memory state from scratch.
893
- // @ts-expect-error: __c is not on global but is injected by Metro.
894
- if (typeof globalThis.__c === "function") globalThis.__c();
893
+ // if (typeof globalThis.__c === 'function') globalThis.__c();
895
894
  onReload();
896
895
  }
897
896
  }