@expo/cli 55.0.3 → 56.0.0-canary-20260128-67ce8d5

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 (43) hide show
  1. package/build/bin/cli +3 -1
  2. package/build/bin/cli.map +1 -1
  3. package/build/src/start/interface/interactiveActions.js +2 -1
  4. package/build/src/start/interface/interactiveActions.js.map +1 -1
  5. package/build/src/start/server/UrlCreator.js +1 -1
  6. package/build/src/start/server/UrlCreator.js.map +1 -1
  7. package/build/src/start/server/metro/DevToolsPluginWebsocketEndpoint.js +1 -1
  8. package/build/src/start/server/metro/DevToolsPluginWebsocketEndpoint.js.map +1 -1
  9. package/build/src/start/server/metro/MetroBundlerDevServer.js +4 -4
  10. package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
  11. package/build/src/start/server/metro/MetroTerminalReporter.js +144 -33
  12. package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
  13. package/build/src/start/server/metro/createServerComponentsMiddleware.js +2 -2
  14. package/build/src/start/server/metro/createServerComponentsMiddleware.js.map +1 -1
  15. package/build/src/start/server/metro/fetchRouterManifest.js +1 -13
  16. package/build/src/start/server/metro/fetchRouterManifest.js.map +1 -1
  17. package/build/src/start/server/metro/instantiateMetro.js +53 -0
  18. package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
  19. package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js +3 -1
  20. package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js.map +1 -1
  21. package/build/src/start/server/middleware/ManifestMiddleware.js +14 -9
  22. package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
  23. package/build/src/start/server/type-generation/routes.js +2 -62
  24. package/build/src/start/server/type-generation/routes.js.map +1 -1
  25. package/build/src/utils/build-cache-providers/index.js +1 -1
  26. package/build/src/utils/build-cache-providers/index.js.map +1 -1
  27. package/build/src/utils/env.js +28 -0
  28. package/build/src/utils/env.js.map +1 -1
  29. package/build/src/utils/freeport.js +21 -5
  30. package/build/src/utils/freeport.js.map +1 -1
  31. package/build/src/utils/interactive.js +1 -1
  32. package/build/src/utils/interactive.js.map +1 -1
  33. package/build/src/utils/jsonl.js +243 -0
  34. package/build/src/utils/jsonl.js.map +1 -0
  35. package/build/src/utils/port.js +4 -4
  36. package/build/src/utils/port.js.map +1 -1
  37. package/build/src/utils/progress.js +5 -0
  38. package/build/src/utils/progress.js.map +1 -1
  39. package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
  40. package/build/src/utils/telemetry/utils/context.js +1 -1
  41. package/build/src/utils/url.js +4 -8
  42. package/build/src/utils/url.js.map +1 -1
  43. package/package.json +19 -20
package/build/bin/cli CHANGED
@@ -31,6 +31,7 @@ function _getenv() {
31
31
  };
32
32
  return data;
33
33
  }
34
+ const _jsonl = require("../src/utils/jsonl");
34
35
  function _interop_require_default(obj) {
35
36
  return obj && obj.__esModule ? obj : {
36
37
  default: obj
@@ -77,6 +78,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
77
78
  }
78
79
  return newObj;
79
80
  }
81
+ (0, _jsonl.installJsonlInterceptor)();
80
82
  // Setup before requiring `debug`.
81
83
  if ((0, _getenv().boolish)('EXPO_DEBUG', false)) {
82
84
  _debug().default.enable('expo:*');
@@ -123,7 +125,7 @@ const args = (0, _arg().default)({
123
125
  });
124
126
  if (args['--version']) {
125
127
  // Version is added in the build script.
126
- console.log("55.0.3");
128
+ console.log("56.0.0-canary-20260128-67ce8d5");
127
129
  process.exit(0);
128
130
  }
129
131
  if (args['--non-interactive']) {
package/build/bin/cli.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../bin/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport Debug from 'debug';\nimport { boolish } from 'getenv';\n\n// Setup before requiring `debug`.\nif (boolish('EXPO_DEBUG', false)) {\n Debug.enable('expo:*');\n} else if (Debug.enabled('expo:')) {\n process.env.EXPO_DEBUG = '1';\n}\n\nconst defaultCmd = 'start';\n\nexport type Command = (argv?: string[]) => void;\n\nconst commands: { [command: string]: () => Promise<Command> } = {\n // Add a new command here\n // NOTE(EvanBacon): Ensure every bundler-related command sets `NODE_ENV` as expected for the command.\n run: () => import('../src/run/index.js').then((i) => i.expoRun),\n 'run:ios': () => import('../src/run/ios/index.js').then((i) => i.expoRunIos),\n 'run:android': () => import('../src/run/android/index.js').then((i) => i.expoRunAndroid),\n start: () => import('../src/start/index.js').then((i) => i.expoStart),\n prebuild: () => import('../src/prebuild/index.js').then((i) => i.expoPrebuild),\n config: () => import('../src/config/index.js').then((i) => i.expoConfig),\n export: () => import('../src/export/index.js').then((i) => i.expoExport),\n 'export:web': () => import('../src/export/web/index.js').then((i) => i.expoExportWeb),\n 'export:embed': () => import('../src/export/embed/index.js').then((i) => i.expoExportEmbed),\n\n serve: () => import('../src/serve/index.js').then((i) => i.expoServe),\n\n // Auxiliary commands\n install: () => import('../src/install/index.js').then((i) => i.expoInstall),\n add: () => import('../src/install/index.js').then((i) => i.expoInstall),\n customize: () => import('../src/customize/index.js').then((i) => i.expoCustomize),\n lint: () => import('../src/lint/index.js').then((i) => i.expoLint),\n\n // Auth\n login: () => import('../src/login/index.js').then((i) => i.expoLogin),\n logout: () => import('../src/logout/index.js').then((i) => i.expoLogout),\n register: () => import('../src/register/index.js').then((i) => i.expoRegister),\n whoami: () => import('../src/whoami/index.js').then((i) => i.expoWhoami),\n};\n\nconst args = arg(\n {\n // Types\n '--version': Boolean,\n '--help': Boolean,\n // NOTE(EvanBacon): This is here to silence warnings from processes that\n // expect the global expo-cli.\n '--non-interactive': Boolean,\n\n // Aliases\n '-v': '--version',\n '-h': '--help',\n },\n {\n permissive: true,\n }\n);\n\nif (args['--version']) {\n // Version is added in the build script.\n console.log(process.env.__EXPO_VERSION);\n process.exit(0);\n}\n\nif (args['--non-interactive']) {\n console.warn(chalk.yellow` {bold --non-interactive} is not supported, use {bold $CI=1} instead`);\n}\n\n// Check if we are running `npx expo <subcommand>` or `npx expo`\nconst isSubcommand = Boolean(commands[args._[0]]);\n\n// Handle `--help` flag\nif (!isSubcommand && args['--help']) {\n const {\n login,\n logout,\n whoami,\n register,\n start,\n install,\n add,\n export: _export,\n config,\n customize,\n prebuild,\n 'run:ios': runIos,\n 'run:android': runAndroid,\n // NOTE(EvanBacon): Don't document this command as it's a temporary\n // workaround until we can use `expo export` for all production bundling.\n // https://github.com/expo/expo/pull/21396/files#r1121025873\n 'export:embed': exportEmbed_unused,\n // The export:web command is deprecated. Hide it from the help prompt.\n 'export:web': exportWeb_unused,\n // Other ignored commands, these are intentially not listed in the `--help` output\n run: _run,\n // NOTE(cedric): Still pending the migration to ESLint's flat config\n lint: _lint,\n serve,\n // All other commands\n ...others\n } = commands;\n\n console.log(chalk`\n {bold Usage}\n {dim $} npx expo <command>\n\n {bold Commands}\n ${Object.keys({ start, export: _export, ...others }).join(', ')}\n ${Object.keys({ 'run:ios': runIos, 'run:android': runAndroid, prebuild }).join(', ')}\n ${Object.keys({ install, customize, config, serve }).join(', ')}\n {dim ${Object.keys({ login, logout, whoami, register }).join(', ')}}\n\n {bold Options}\n --version, -v Version number\n --help, -h Usage info\n\n For more info run a command with the {bold --help} flag\n {dim $} npx expo start --help\n`);\n\n process.exit(0);\n}\n\n// NOTE(EvanBacon): Squat some directory names to help with migration,\n// users can still use folders named \"send\" or \"eject\" by using the fully qualified `npx expo start ./send`.\nif (!isSubcommand) {\n const migrationMap: Record<string, string> = {\n init: 'npx create-expo-app',\n eject: 'npx expo prebuild',\n web: 'npx expo start --web',\n 'start:web': 'npx expo start --web',\n 'build:ios': 'eas build -p ios',\n 'build:android': 'eas build -p android',\n 'client:install:ios': 'npx expo start --ios',\n 'client:install:android': 'npx expo start --android',\n doctor: 'npx expo-doctor',\n upgrade: 'https://docs.expo.dev/workflow/upgrading-expo-sdk-walkthrough/',\n 'customize:web': 'npx expo customize',\n\n publish: 'eas update',\n 'publish:set': 'eas update',\n 'publish:rollback': 'eas update',\n 'publish:history': 'eas update',\n 'publish:details': 'eas update',\n\n 'build:web': 'npx expo export:web',\n\n 'credentials:manager': `eas credentials`,\n 'fetch:ios:certs': `eas credentials`,\n 'fetch:android:keystore': `eas credentials`,\n 'fetch:android:hashes': `eas credentials`,\n 'fetch:android:upload-cert': `eas credentials`,\n 'push:android:upload': `eas credentials`,\n 'push:android:show': `eas credentials`,\n 'push:android:clear': `eas credentials`,\n url: `eas build:list`,\n 'url:ipa': `eas build:list`,\n 'url:apk': `eas build:list`,\n webhooks: `eas webhook`,\n 'webhooks:add': `eas webhook:create`,\n 'webhooks:remove': `eas webhook:delete`,\n 'webhooks:update': `eas webhook:update`,\n\n 'build:status': `eas build:list`,\n 'upload:android': `eas submit -p android`,\n 'upload:ios': `eas submit -p ios`,\n };\n\n // TODO: Log telemetry about invalid command used.\n const subcommand = args._[0];\n if (subcommand in migrationMap) {\n const replacement = migrationMap[subcommand];\n console.log();\n const instruction = subcommand === 'upgrade' ? 'follow this guide' : 'use';\n console.log(\n chalk.yellow` {gray $} {bold expo ${subcommand}} is not supported in the local CLI, please ${instruction} {bold ${replacement}} instead`\n );\n console.log();\n process.exit(1);\n }\n const deprecated = ['send', 'client:ios'];\n if (deprecated.includes(subcommand)) {\n console.log();\n console.log(chalk.yellow` {gray $} {bold expo ${subcommand}} is deprecated`);\n console.log();\n process.exit(1);\n }\n}\n\nconst command = isSubcommand ? args._[0] : defaultCmd;\nconst commandArgs = isSubcommand ? args._.slice(1) : args._;\n\n// Push the help flag to the subcommand args.\nif (args['--help']) {\n commandArgs.push('--help');\n}\n\n// Install exit hooks\nprocess.on('SIGINT', () => process.exit(0));\nprocess.on('SIGTERM', () => process.exit(0));\n\ncommands[command]().then((exec) => {\n exec(commandArgs);\n\n // NOTE(EvanBacon): Track some basic telemetry events indicating the command\n // that was run. This can be disabled with the $EXPO_NO_TELEMETRY environment variable.\n // We do this to determine how well deprecations are going before removing a command.\n if (!boolish('EXPO_NO_TELEMETRY', false)) {\n const { recordCommand } =\n require('../src/utils/telemetry') as typeof import('../src/utils/telemetry');\n recordCommand(command);\n }\n});\n"],"names":["boolish","Debug","enable","enabled","process","env","EXPO_DEBUG","defaultCmd","commands","run","then","i","expoRun","expoRunIos","expoRunAndroid","start","expoStart","prebuild","expoPrebuild","config","expoConfig","export","expoExport","expoExportWeb","expoExportEmbed","serve","expoServe","install","expoInstall","add","customize","expoCustomize","lint","expoLint","login","expoLogin","logout","expoLogout","register","expoRegister","whoami","expoWhoami","args","arg","Boolean","permissive","console","log","__EXPO_VERSION","exit","warn","chalk","yellow","isSubcommand","_","_export","runIos","runAndroid","exportEmbed_unused","exportWeb_unused","_run","_lint","others","Object","keys","join","migrationMap","init","eject","web","doctor","upgrade","publish","url","webhooks","subcommand","replacement","instruction","deprecated","includes","command","commandArgs","slice","push","on","exec","recordCommand","require"],"mappings":";;;;;;gEACgB;;;;;;;gEACE;;;;;;;gEACA;;;;;;;yBACM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAExB,kCAAkC;AAClC,IAAIA,IAAAA,iBAAO,EAAC,cAAc,QAAQ;IAChCC,gBAAK,CAACC,MAAM,CAAC;AACf,OAAO,IAAID,gBAAK,CAACE,OAAO,CAAC,UAAU;IACjCC,QAAQC,GAAG,CAACC,UAAU,GAAG;AAC3B;AAEA,MAAMC,aAAa;AAInB,MAAMC,WAA0D;IAC9D,yBAAyB;IACzB,qGAAqG;IACrGC,KAAK,IAAM,mEAAA,QAAO,yBAAuBC,IAAI,CAAC,CAACC,IAAMA,EAAEC,OAAO;IAC9D,WAAW,IAAM,mEAAA,QAAO,6BAA2BF,IAAI,CAAC,CAACC,IAAMA,EAAEE,UAAU;IAC3E,eAAe,IAAM,mEAAA,QAAO,iCAA+BH,IAAI,CAAC,CAACC,IAAMA,EAAEG,cAAc;IACvFC,OAAO,IAAM,mEAAA,QAAO,2BAAyBL,IAAI,CAAC,CAACC,IAAMA,EAAEK,SAAS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#!/usr/bin/env node\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport Debug from 'debug';\nimport { boolish } from 'getenv';\n\n// JSONL interceptor - must be installed before any output occurs\nimport { installJsonlInterceptor } from '../src/utils/jsonl';\ninstallJsonlInterceptor();\n\n// Setup before requiring `debug`.\nif (boolish('EXPO_DEBUG', false)) {\n Debug.enable('expo:*');\n} else if (Debug.enabled('expo:')) {\n process.env.EXPO_DEBUG = '1';\n}\n\nconst defaultCmd = 'start';\n\nexport type Command = (argv?: string[]) => void;\n\nconst commands: { [command: string]: () => Promise<Command> } = {\n // Add a new command here\n // NOTE(EvanBacon): Ensure every bundler-related command sets `NODE_ENV` as expected for the command.\n run: () => import('../src/run/index.js').then((i) => i.expoRun),\n 'run:ios': () => import('../src/run/ios/index.js').then((i) => i.expoRunIos),\n 'run:android': () => import('../src/run/android/index.js').then((i) => i.expoRunAndroid),\n start: () => import('../src/start/index.js').then((i) => i.expoStart),\n prebuild: () => import('../src/prebuild/index.js').then((i) => i.expoPrebuild),\n config: () => import('../src/config/index.js').then((i) => i.expoConfig),\n export: () => import('../src/export/index.js').then((i) => i.expoExport),\n 'export:web': () => import('../src/export/web/index.js').then((i) => i.expoExportWeb),\n 'export:embed': () => import('../src/export/embed/index.js').then((i) => i.expoExportEmbed),\n\n serve: () => import('../src/serve/index.js').then((i) => i.expoServe),\n\n // Auxiliary commands\n install: () => import('../src/install/index.js').then((i) => i.expoInstall),\n add: () => import('../src/install/index.js').then((i) => i.expoInstall),\n customize: () => import('../src/customize/index.js').then((i) => i.expoCustomize),\n lint: () => import('../src/lint/index.js').then((i) => i.expoLint),\n\n // Auth\n login: () => import('../src/login/index.js').then((i) => i.expoLogin),\n logout: () => import('../src/logout/index.js').then((i) => i.expoLogout),\n register: () => import('../src/register/index.js').then((i) => i.expoRegister),\n whoami: () => import('../src/whoami/index.js').then((i) => i.expoWhoami),\n};\n\nconst args = arg(\n {\n // Types\n '--version': Boolean,\n '--help': Boolean,\n // NOTE(EvanBacon): This is here to silence warnings from processes that\n // expect the global expo-cli.\n '--non-interactive': Boolean,\n\n // Aliases\n '-v': '--version',\n '-h': '--help',\n },\n {\n permissive: true,\n }\n);\n\nif (args['--version']) {\n // Version is added in the build script.\n console.log(process.env.__EXPO_VERSION);\n process.exit(0);\n}\n\nif (args['--non-interactive']) {\n console.warn(chalk.yellow` {bold --non-interactive} is not supported, use {bold $CI=1} instead`);\n}\n\n// Check if we are running `npx expo <subcommand>` or `npx expo`\nconst isSubcommand = Boolean(commands[args._[0]]);\n\n// Handle `--help` flag\nif (!isSubcommand && args['--help']) {\n const {\n login,\n logout,\n whoami,\n register,\n start,\n install,\n add,\n export: _export,\n config,\n customize,\n prebuild,\n 'run:ios': runIos,\n 'run:android': runAndroid,\n // NOTE(EvanBacon): Don't document this command as it's a temporary\n // workaround until we can use `expo export` for all production bundling.\n // https://github.com/expo/expo/pull/21396/files#r1121025873\n 'export:embed': exportEmbed_unused,\n // The export:web command is deprecated. Hide it from the help prompt.\n 'export:web': exportWeb_unused,\n // Other ignored commands, these are intentially not listed in the `--help` output\n run: _run,\n // NOTE(cedric): Still pending the migration to ESLint's flat config\n lint: _lint,\n serve,\n // All other commands\n ...others\n } = commands;\n\n console.log(chalk`\n {bold Usage}\n {dim $} npx expo <command>\n\n {bold Commands}\n ${Object.keys({ start, export: _export, ...others }).join(', ')}\n ${Object.keys({ 'run:ios': runIos, 'run:android': runAndroid, prebuild }).join(', ')}\n ${Object.keys({ install, customize, config, serve }).join(', ')}\n {dim ${Object.keys({ login, logout, whoami, register }).join(', ')}}\n\n {bold Options}\n --version, -v Version number\n --help, -h Usage info\n\n For more info run a command with the {bold --help} flag\n {dim $} npx expo start --help\n`);\n\n process.exit(0);\n}\n\n// NOTE(EvanBacon): Squat some directory names to help with migration,\n// users can still use folders named \"send\" or \"eject\" by using the fully qualified `npx expo start ./send`.\nif (!isSubcommand) {\n const migrationMap: Record<string, string> = {\n init: 'npx create-expo-app',\n eject: 'npx expo prebuild',\n web: 'npx expo start --web',\n 'start:web': 'npx expo start --web',\n 'build:ios': 'eas build -p ios',\n 'build:android': 'eas build -p android',\n 'client:install:ios': 'npx expo start --ios',\n 'client:install:android': 'npx expo start --android',\n doctor: 'npx expo-doctor',\n upgrade: 'https://docs.expo.dev/workflow/upgrading-expo-sdk-walkthrough/',\n 'customize:web': 'npx expo customize',\n\n publish: 'eas update',\n 'publish:set': 'eas update',\n 'publish:rollback': 'eas update',\n 'publish:history': 'eas update',\n 'publish:details': 'eas update',\n\n 'build:web': 'npx expo export:web',\n\n 'credentials:manager': `eas credentials`,\n 'fetch:ios:certs': `eas credentials`,\n 'fetch:android:keystore': `eas credentials`,\n 'fetch:android:hashes': `eas credentials`,\n 'fetch:android:upload-cert': `eas credentials`,\n 'push:android:upload': `eas credentials`,\n 'push:android:show': `eas credentials`,\n 'push:android:clear': `eas credentials`,\n url: `eas build:list`,\n 'url:ipa': `eas build:list`,\n 'url:apk': `eas build:list`,\n webhooks: `eas webhook`,\n 'webhooks:add': `eas webhook:create`,\n 'webhooks:remove': `eas webhook:delete`,\n 'webhooks:update': `eas webhook:update`,\n\n 'build:status': `eas build:list`,\n 'upload:android': `eas submit -p android`,\n 'upload:ios': `eas submit -p ios`,\n };\n\n // TODO: Log telemetry about invalid command used.\n const subcommand = args._[0];\n if (subcommand in migrationMap) {\n const replacement = migrationMap[subcommand];\n console.log();\n const instruction = subcommand === 'upgrade' ? 'follow this guide' : 'use';\n console.log(\n chalk.yellow` {gray $} {bold expo ${subcommand}} is not supported in the local CLI, please ${instruction} {bold ${replacement}} instead`\n );\n console.log();\n process.exit(1);\n }\n const deprecated = ['send', 'client:ios'];\n if (deprecated.includes(subcommand)) {\n console.log();\n console.log(chalk.yellow` {gray $} {bold expo ${subcommand}} is deprecated`);\n console.log();\n process.exit(1);\n }\n}\n\nconst command = isSubcommand ? args._[0] : defaultCmd;\nconst commandArgs = isSubcommand ? args._.slice(1) : args._;\n\n// Push the help flag to the subcommand args.\nif (args['--help']) {\n commandArgs.push('--help');\n}\n\n// Install exit hooks\nprocess.on('SIGINT', () => process.exit(0));\nprocess.on('SIGTERM', () => process.exit(0));\n\ncommands[command]().then((exec) => {\n exec(commandArgs);\n\n // NOTE(EvanBacon): Track some basic telemetry events indicating the command\n // that was run. This can be disabled with the $EXPO_NO_TELEMETRY environment variable.\n // We do this to determine how well deprecations are going before removing a command.\n if (!boolish('EXPO_NO_TELEMETRY', false)) {\n const { recordCommand } =\n require('../src/utils/telemetry') as typeof import('../src/utils/telemetry');\n recordCommand(command);\n }\n});\n"],"names":["installJsonlInterceptor","boolish","Debug","enable","enabled","process","env","EXPO_DEBUG","defaultCmd","commands","run","then","i","expoRun","expoRunIos","expoRunAndroid","start","expoStart","prebuild","expoPrebuild","config","expoConfig","export","expoExport","expoExportWeb","expoExportEmbed","serve","expoServe","install","expoInstall","add","customize","expoCustomize","lint","expoLint","login","expoLogin","logout","expoLogout","register","expoRegister","whoami","expoWhoami","args","arg","Boolean","permissive","console","log","__EXPO_VERSION","exit","warn","chalk","yellow","isSubcommand","_","_export","runIos","runAndroid","exportEmbed_unused","exportWeb_unused","_run","_lint","others","Object","keys","join","migrationMap","init","eject","web","doctor","upgrade","publish","url","webhooks","subcommand","replacement","instruction","deprecated","includes","command","commandArgs","slice","push","on","exec","recordCommand","require"],"mappings":";;;;;;gEACgB;;;;;;;gEACE;;;;;;;gEACA;;;;;;;yBACM;;;;;;uBAGgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACxCA,IAAAA,8BAAuB;AAEvB,kCAAkC;AAClC,IAAIC,IAAAA,iBAAO,EAAC,cAAc,QAAQ;IAChCC,gBAAK,CAACC,MAAM,CAAC;AACf,OAAO,IAAID,gBAAK,CAACE,OAAO,CAAC,UAAU;IACjCC,QAAQC,GAAG,CAACC,UAAU,GAAG;AAC3B;AAEA,MAAMC,aAAa;AAInB,MAAMC,WAA0D;IAC9D,yBAAyB;IACzB,qGAAqG;IACrGC,KAA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Q6C,IAAI,CAAC;AAEzCzC,QAAQ,CAACwE,QAAQ,GAAGtE,IAAI,CAAC,CAAC2E;IACxBA,KAAKJ;IAEL,4EAA4E;IAC5E,uFAAuF;IACvF,qFAAqF;IACrF,IAAI,CAACjF,IAAAA,iBAAO,EAAC,qBAAqB,QAAQ;QACxC,MAAM,EAAEsF,aAAa,EAAE,GACrBC,QAAQ;QACVD,cAAcN;IAChB;AACF"}
@@ -100,11 +100,12 @@ class DevServerManagerActions {
100
100
  _log.log((0, _commandsTable.printItem)('Scan the QR code above to open the project in a development build. ' + (0, _link.learnMore)('https://expo.fyi/start')));
101
101
  }
102
102
  } catch (error) {
103
- console.log('err', error);
104
103
  // @ts-ignore: If there is no development build scheme, then skip the QR code.
105
104
  if (error.code !== 'NO_DEV_CLIENT_SCHEME') {
105
+ console.error('Failed to print QR code:', error);
106
106
  throw error;
107
107
  } else {
108
+ console.error('No development build scheme found:', error);
108
109
  const serverUrl = devServer.getDevServerUrl();
109
110
  _log.log((0, _commandsTable.printItem)((0, _chalk().default)`Metro waiting on {underline ${serverUrl}}`));
110
111
  _log.log((0, _commandsTable.printItem)(`Linking is disabled because the client scheme cannot be resolved.`));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/start/interface/interactiveActions.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport { BLT, printHelp, printItem, printQRCode, printUsage, StartOptions } from './commandsTable';\nimport { createDevToolsMenuItems } from './createDevToolsMenuItems';\nimport * as Log from '../../log';\nimport { env } from '../../utils/env';\nimport { learnMore } from '../../utils/link';\nimport { openBrowserAsync } from '../../utils/open';\nimport { ExpoChoice, selectAsync } from '../../utils/prompts';\nimport { DevServerManager } from '../server/DevServerManager';\nimport {\n openJsInspector,\n queryAllInspectorAppsAsync,\n promptInspectorAppAsync,\n} from '../server/middleware/inspector/JsInspector';\n\nconst debug = require('debug')('expo:start:interface:interactiveActions') as typeof console.log;\n\ninterface MoreToolMenuItem extends ExpoChoice<string> {\n action?: () => unknown;\n}\n\n/** Wraps the DevServerManager and adds an interface for user actions. */\nexport class DevServerManagerActions {\n constructor(\n private devServerManager: DevServerManager,\n private options: Pick<StartOptions, 'devClient' | 'platforms'>\n ) {}\n\n printDevServerInfo(\n options: Pick<StartOptions, 'devClient' | 'isWebSocketsEnabled' | 'platforms'>\n ) {\n // If native dev server is running, print its URL.\n if (this.devServerManager.getNativeDevServerPort()) {\n const devServer = this.devServerManager.getDefaultDevServer();\n try {\n const nativeRuntimeUrl = devServer.getNativeRuntimeUrl()!;\n const interstitialPageUrl = devServer.getRedirectUrl();\n\n printQRCode(interstitialPageUrl ?? nativeRuntimeUrl);\n\n if (interstitialPageUrl) {\n Log.log(\n printItem(\n chalk`Choose an app to open your project at {underline ${interstitialPageUrl}}`\n )\n );\n }\n\n if (env.__EXPO_E2E_TEST) {\n // Print the URL to stdout for tests\n console.info(\n `[__EXPO_E2E_TEST:server] ${JSON.stringify({ url: devServer.getDevServerUrl() })}`\n );\n }\n\n Log.log(printItem(chalk`Metro waiting on {underline ${nativeRuntimeUrl}}`));\n if (options.devClient === false) {\n // TODO: if development build, change this message!\n Log.log(printItem('Scan the QR code above to open the project in Expo Go.'));\n } else {\n Log.log(\n printItem(\n 'Scan the QR code above to open the project in a development build. ' +\n learnMore('https://expo.fyi/start')\n )\n );\n }\n } catch (error) {\n console.log('err', error);\n // @ts-ignore: If there is no development build scheme, then skip the QR code.\n if (error.code !== 'NO_DEV_CLIENT_SCHEME') {\n throw error;\n } else {\n const serverUrl = devServer.getDevServerUrl();\n Log.log(printItem(chalk`Metro waiting on {underline ${serverUrl}}`));\n Log.log(printItem(`Linking is disabled because the client scheme cannot be resolved.`));\n }\n }\n }\n\n if (this.options.platforms?.includes('web')) {\n const webDevServer = this.devServerManager.getWebDevServer();\n const webUrl = webDevServer?.getDevServerUrl({ hostType: 'localhost' });\n if (webUrl) {\n Log.log();\n Log.log(printItem(chalk`Web is waiting on {underline ${webUrl}}`));\n }\n }\n\n printUsage(options, { verbose: false });\n printHelp();\n Log.log();\n }\n\n async openJsInspectorAsync() {\n try {\n const metroServerOrigin = this.devServerManager.getDefaultDevServer().getJsInspectorBaseUrl();\n const apps = await queryAllInspectorAppsAsync(metroServerOrigin);\n if (!apps.length) {\n return Log.warn(\n chalk`{bold Debug:} No compatible apps connected, React Native DevTools can only be used with Hermes. ${learnMore(\n 'https://docs.expo.dev/guides/using-hermes/'\n )}`\n );\n }\n\n const app = await promptInspectorAppAsync(apps);\n if (!app) {\n return Log.error(chalk`{bold Debug:} No inspectable device selected`);\n }\n\n if (!(await openJsInspector(metroServerOrigin, app))) {\n Log.warn(\n chalk`{bold Debug:} Failed to open the React Native DevTools, see debug logs for more info.`\n );\n }\n } catch (error: any) {\n // Handle aborting prompt\n if (error.code === 'ABORTED') return;\n\n Log.error('Failed to open the React Native DevTools.');\n Log.exception(error);\n }\n }\n\n reloadApp() {\n Log.log(`${BLT} Reloading apps`);\n // Send reload requests over the dev servers\n this.devServerManager.broadcastMessage('reload');\n }\n\n async openMoreToolsAsync() {\n // Options match: Chrome > View > Developer\n try {\n const defaultMenuItems: MoreToolMenuItem[] = [\n { title: 'Inspect elements', value: 'toggleElementInspector' },\n { title: 'Toggle performance monitor', value: 'togglePerformanceMonitor' },\n { title: 'Toggle developer menu', value: 'toggleDevMenu' },\n { title: 'Reload app', value: 'reload' },\n // TODO: Maybe a \"View Source\" option to open code.\n ];\n\n const defaultServerUrl = this.devServerManager\n .getDefaultDevServer()\n .getUrlCreator()\n .constructUrl({ scheme: 'http' });\n\n const metroServerOrigin = this.devServerManager.getDefaultDevServer().getJsInspectorBaseUrl();\n const plugins = await this.devServerManager.devtoolsPluginManager.queryPluginsAsync();\n\n const menuItems = [\n ...defaultMenuItems,\n ...createDevToolsMenuItems(plugins, defaultServerUrl, metroServerOrigin),\n ];\n\n const value = await selectAsync(chalk`Dev tools {dim (native only)}`, menuItems);\n const menuItem = menuItems.find((item) => item.value === value);\n if (menuItem?.action) {\n menuItem.action();\n } else if (menuItem?.value) {\n this.devServerManager.broadcastMessage('sendDevCommand', { name: menuItem.value });\n }\n } catch (error: any) {\n debug(error);\n // do nothing\n } finally {\n printHelp();\n }\n }\n\n toggleDevMenu() {\n Log.log(`${BLT} Toggling dev menu`);\n this.devServerManager.broadcastMessage('devMenu');\n }\n}\n"],"names":["DevServerManagerActions","debug","require","constructor","devServerManager","options","printDevServerInfo","getNativeDevServerPort","devServer","getDefaultDevServer","nativeRuntimeUrl","getNativeRuntimeUrl","interstitialPageUrl","getRedirectUrl","printQRCode","Log","log","printItem","chalk","env","__EXPO_E2E_TEST","console","info","JSON","stringify","url","getDevServerUrl","devClient","learnMore","error","code","serverUrl","platforms","includes","webDevServer","getWebDevServer","webUrl","hostType","printUsage","verbose","printHelp","openJsInspectorAsync","metroServerOrigin","getJsInspectorBaseUrl","apps","queryAllInspectorAppsAsync","length","warn","app","promptInspectorAppAsync","openJsInspector","exception","reloadApp","BLT","broadcastMessage","openMoreToolsAsync","defaultMenuItems","title","value","defaultServerUrl","getUrlCreator","constructUrl","scheme","plugins","devtoolsPluginManager","queryPluginsAsync","menuItems","createDevToolsMenuItems","selectAsync","menuItem","find","item","action","name","toggleDevMenu"],"mappings":";;;;+BAuBaA;;;eAAAA;;;;gEAvBK;;;;;;+BAE+D;yCACzC;6DACnB;qBACD;sBACM;yBAEc;6BAMjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEP,MAAMC,QAAQC,QAAQ,SAAS;AAOxB,MAAMF;IACXG,YACE,AAAQC,gBAAkC,EAC1C,AAAQC,OAAsD,CAC9D;aAFQD,mBAAAA;aACAC,UAAAA;IACP;IAEHC,mBACED,OAA8E,EAC9E;YAkDI;QAjDJ,kDAAkD;QAClD,IAAI,IAAI,CAACD,gBAAgB,CAACG,sBAAsB,IAAI;YAClD,MAAMC,YAAY,IAAI,CAACJ,gBAAgB,CAACK,mBAAmB;YAC3D,IAAI;gBACF,MAAMC,mBAAmBF,UAAUG,mB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
1
+ {"version":3,"sources":["../../../../src/start/interface/interactiveActions.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport { BLT, printHelp, printItem, printQRCode, printUsage, StartOptions } from './commandsTable';\nimport { createDevToolsMenuItems } from './createDevToolsMenuItems';\nimport * as Log from '../../log';\nimport { env } from '../../utils/env';\nimport { learnMore } from '../../utils/link';\nimport { openBrowserAsync } from '../../utils/open';\nimport { ExpoChoice, selectAsync } from '../../utils/prompts';\nimport { DevServerManager } from '../server/DevServerManager';\nimport {\n openJsInspector,\n queryAllInspectorAppsAsync,\n promptInspectorAppAsync,\n} from '../server/middleware/inspector/JsInspector';\n\nconst debug = require('debug')('expo:start:interface:interactiveActions') as typeof console.log;\n\ninterface MoreToolMenuItem extends ExpoChoice<string> {\n action?: () => unknown;\n}\n\n/** Wraps the DevServerManager and adds an interface for user actions. */\nexport class DevServerManagerActions {\n constructor(\n private devServerManager: DevServerManager,\n private options: Pick<StartOptions, 'devClient' | 'platforms'>\n ) {}\n\n printDevServerInfo(\n options: Pick<StartOptions, 'devClient' | 'isWebSocketsEnabled' | 'platforms'>\n ) {\n // If native dev server is running, print its URL.\n if (this.devServerManager.getNativeDevServerPort()) {\n const devServer = this.devServerManager.getDefaultDevServer();\n try {\n const nativeRuntimeUrl = devServer.getNativeRuntimeUrl()!;\n const interstitialPageUrl = devServer.getRedirectUrl();\n\n printQRCode(interstitialPageUrl ?? nativeRuntimeUrl);\n\n if (interstitialPageUrl) {\n Log.log(\n printItem(\n chalk`Choose an app to open your project at {underline ${interstitialPageUrl}}`\n )\n );\n }\n\n if (env.__EXPO_E2E_TEST) {\n // Print the URL to stdout for tests\n console.info(\n `[__EXPO_E2E_TEST:server] ${JSON.stringify({ url: devServer.getDevServerUrl() })}`\n );\n }\n\n Log.log(printItem(chalk`Metro waiting on {underline ${nativeRuntimeUrl}}`));\n if (options.devClient === false) {\n // TODO: if development build, change this message!\n Log.log(printItem('Scan the QR code above to open the project in Expo Go.'));\n } else {\n Log.log(\n printItem(\n 'Scan the QR code above to open the project in a development build. ' +\n learnMore('https://expo.fyi/start')\n )\n );\n }\n } catch (error) {\n // @ts-ignore: If there is no development build scheme, then skip the QR code.\n if (error.code !== 'NO_DEV_CLIENT_SCHEME') {\n console.error('Failed to print QR code:', error);\n throw error;\n } else {\n console.error('No development build scheme found:', error);\n const serverUrl = devServer.getDevServerUrl();\n Log.log(printItem(chalk`Metro waiting on {underline ${serverUrl}}`));\n Log.log(printItem(`Linking is disabled because the client scheme cannot be resolved.`));\n }\n }\n }\n\n if (this.options.platforms?.includes('web')) {\n const webDevServer = this.devServerManager.getWebDevServer();\n const webUrl = webDevServer?.getDevServerUrl({ hostType: 'localhost' });\n if (webUrl) {\n Log.log();\n Log.log(printItem(chalk`Web is waiting on {underline ${webUrl}}`));\n }\n }\n\n printUsage(options, { verbose: false });\n printHelp();\n Log.log();\n }\n\n async openJsInspectorAsync() {\n try {\n const metroServerOrigin = this.devServerManager.getDefaultDevServer().getJsInspectorBaseUrl();\n const apps = await queryAllInspectorAppsAsync(metroServerOrigin);\n if (!apps.length) {\n return Log.warn(\n chalk`{bold Debug:} No compatible apps connected, React Native DevTools can only be used with Hermes. ${learnMore(\n 'https://docs.expo.dev/guides/using-hermes/'\n )}`\n );\n }\n\n const app = await promptInspectorAppAsync(apps);\n if (!app) {\n return Log.error(chalk`{bold Debug:} No inspectable device selected`);\n }\n\n if (!(await openJsInspector(metroServerOrigin, app))) {\n Log.warn(\n chalk`{bold Debug:} Failed to open the React Native DevTools, see debug logs for more info.`\n );\n }\n } catch (error: any) {\n // Handle aborting prompt\n if (error.code === 'ABORTED') return;\n\n Log.error('Failed to open the React Native DevTools.');\n Log.exception(error);\n }\n }\n\n reloadApp() {\n Log.log(`${BLT} Reloading apps`);\n // Send reload requests over the dev servers\n this.devServerManager.broadcastMessage('reload');\n }\n\n async openMoreToolsAsync() {\n // Options match: Chrome > View > Developer\n try {\n const defaultMenuItems: MoreToolMenuItem[] = [\n { title: 'Inspect elements', value: 'toggleElementInspector' },\n { title: 'Toggle performance monitor', value: 'togglePerformanceMonitor' },\n { title: 'Toggle developer menu', value: 'toggleDevMenu' },\n { title: 'Reload app', value: 'reload' },\n // TODO: Maybe a \"View Source\" option to open code.\n ];\n\n const defaultServerUrl = this.devServerManager\n .getDefaultDevServer()\n .getUrlCreator()\n .constructUrl({ scheme: 'http' });\n\n const metroServerOrigin = this.devServerManager.getDefaultDevServer().getJsInspectorBaseUrl();\n const plugins = await this.devServerManager.devtoolsPluginManager.queryPluginsAsync();\n\n const menuItems = [\n ...defaultMenuItems,\n ...createDevToolsMenuItems(plugins, defaultServerUrl, metroServerOrigin),\n ];\n\n const value = await selectAsync(chalk`Dev tools {dim (native only)}`, menuItems);\n const menuItem = menuItems.find((item) => item.value === value);\n if (menuItem?.action) {\n menuItem.action();\n } else if (menuItem?.value) {\n this.devServerManager.broadcastMessage('sendDevCommand', { name: menuItem.value });\n }\n } catch (error: any) {\n debug(error);\n // do nothing\n } finally {\n printHelp();\n }\n }\n\n toggleDevMenu() {\n Log.log(`${BLT} Toggling dev menu`);\n this.devServerManager.broadcastMessage('devMenu');\n }\n}\n"],"names":["DevServerManagerActions","debug","require","constructor","devServerManager","options","printDevServerInfo","getNativeDevServerPort","devServer","getDefaultDevServer","nativeRuntimeUrl","getNativeRuntimeUrl","interstitialPageUrl","getRedirectUrl","printQRCode","Log","log","printItem","chalk","env","__EXPO_E2E_TEST","console","info","JSON","stringify","url","getDevServerUrl","devClient","learnMore","error","code","serverUrl","platforms","includes","webDevServer","getWebDevServer","webUrl","hostType","printUsage","verbose","printHelp","openJsInspectorAsync","metroServerOrigin","getJsInspectorBaseUrl","apps","queryAllInspectorAppsAsync","length","warn","app","promptInspectorAppAsync","openJsInspector","exception","reloadApp","BLT","broadcastMessage","openMoreToolsAsync","defaultMenuItems","title","value","defaultServerUrl","getUrlCreator","constructUrl","scheme","plugins","devtoolsPluginManager","queryPluginsAsync","menuItems","createDevToolsMenuItems","selectAsync","menuItem","find","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BAAK,CAAA,CAAC,6BAA6B,CAAC,EAAEgD;YACtE,MAAMG,WAAWH,UAAUI,IAAI,CAAC,CAACC,OAASA,KAAKb,KAAK,KAAKA;YACzD,IAAIW,4BAAAA,SAAUG,MAAM,EAAE;gBACpBH,SAASG,MAAM;YACjB,OAAO,IAAIH,4BAAAA,SAAUX,KAAK,EAAE;gBAC1B,IAAI,CAACtD,gBAAgB,CAACkD,gBAAgB,CAAC,kBAAkB;oBAAEmB,MAAMJ,SAASX,KAAK;gBAAC;YAClF;QACF,EAAE,OAAO7B,OAAY;YACnB5B,MAAM4B;QACN,aAAa;QACf,SAAU;YACRW,IAAAA,wBAAS;QACX;IACF;IAEAkC,gBAAgB;QACd3D,KAAIC,GAAG,CAAC,GAAGqC,kBAAG,CAAC,kBAAkB,CAAC;QAClC,IAAI,CAACjD,gBAAgB,CAACkD,gBAAgB,CAAC;IACzC;AACF"}
@@ -158,7 +158,7 @@ class UrlCreator {
158
158
  }
159
159
  return {
160
160
  hostname: getDefaultHostname(options),
161
- port: this.bundlerInfo.port.toString(),
161
+ port: options.port ?? this.bundlerInfo.port.toString(),
162
162
  protocol: options.scheme ?? 'http'
163
163
  };
164
164
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/start/server/UrlCreator.ts"],"sourcesContent":["import assert from 'assert';\nimport { URL } from 'url';\n\nimport * as Log from '../../log';\nimport { getIpAddress } from '../../utils/ip';\n\nconst debug = require('debug')('expo:start:server:urlCreator') as typeof console.log;\n\nexport interface CreateURLOptions {\n /** URL scheme to use when opening apps in custom runtimes. */\n scheme?: string | null;\n /** Type of dev server host to use. */\n hostType?: 'localhost' | 'lan' | 'tunnel';\n /** Requested hostname. */\n hostname?: string | null;\n}\n\ninterface UrlComponents {\n port: string;\n hostname: string;\n protocol: string;\n}\nexport class UrlCreator {\n constructor(\n public defaults: CreateURLOptions | undefined,\n private bundlerInfo: { port: number; getTunnelUrl?: () => string | null }\n ) {}\n\n /**\n * Return a URL for the \"loading\" interstitial page that is used to disambiguate which\n * native runtime to open the dev server with.\n *\n * @param options options for creating the URL\n * @param platform when opening the URL from the CLI to a connected device we can specify the platform as a query parameter, otherwise it will be inferred from the unsafe user agent sniffing.\n *\n * @returns URL like `http://localhost:8081/_expo/loading?platform=ios`\n * @returns URL like `http://localhost:8081/_expo/loading` when no platform is provided.\n */\n public constructLoadingUrl(options: CreateURLOptions, platform: string | null): string {\n const url = new URL('_expo/loading', this.constructUrl({ scheme: 'http', ...options }));\n if (platform) {\n url.search = new URLSearchParams({ platform }).toString();\n }\n const loadingUrl = url.toString();\n debug(`Loading URL: ${loadingUrl}`);\n return loadingUrl;\n }\n\n /** Create a URI for launching in a native dev client. Returns `null` when no `scheme` can be resolved. */\n public constructDevClientUrl(options?: CreateURLOptions): null | string {\n const protocol = options?.scheme || this.defaults?.scheme;\n\n if (\n !protocol ||\n // Prohibit the use of http(s) in dev client URIs since they'll never be valid.\n ['http', 'https'].includes(protocol.toLowerCase()) ||\n // Prohibit the use of `_` characters in the protocol, Node will throw an error when parsing these URLs\n protocol.includes('_')\n ) {\n debug(`Invalid protocol for dev client URL: ${protocol}`);\n return null;\n }\n\n const manifestUrl = this.constructUrl({\n ...options,\n scheme: this.defaults?.hostType === 'tunnel' ? 'https' : 'http',\n });\n const devClientUrl = `${protocol}://expo-development-client/?url=${encodeURIComponent(\n manifestUrl\n )}`;\n debug(`Dev client URL: ${devClientUrl} -- manifestUrl: ${manifestUrl} -- %O`, options);\n return devClientUrl;\n }\n\n /** Create a generic URL. */\n public constructUrl(options?: Partial<CreateURLOptions> | null): string {\n const urlComponents = this.getUrlComponents({\n ...this.defaults,\n ...options,\n });\n const url = joinUrlComponents(urlComponents);\n debug(`URL: ${url}`);\n return url;\n }\n\n /** Get the URL components from the Ngrok server URL. */\n private getTunnelUrlComponents(options: Pick<CreateURLOptions, 'scheme'>): UrlComponents | null {\n const tunnelUrl = this.bundlerInfo.getTunnelUrl?.();\n if (!tunnelUrl) {\n return null;\n }\n const parsed = new URL(tunnelUrl);\n return {\n port: parsed.port,\n hostname: parsed.hostname,\n protocol: options.scheme ?? 'http',\n };\n }\n\n private getUrlComponents(options: CreateURLOptions): UrlComponents {\n // Proxy comes first.\n const proxyURL = getProxyUrl();\n if (proxyURL) {\n return getUrlComponentsFromProxyUrl(options, proxyURL);\n }\n\n // Ngrok.\n if (options.hostType === 'tunnel') {\n const components = this.getTunnelUrlComponents(options);\n if (components) {\n return components;\n }\n Log.warn('Tunnel URL not found (it might not be ready yet), falling back to LAN URL.');\n } else if (options.hostType === 'localhost' && !options.hostname) {\n options.hostname = 'localhost';\n }\n\n return {\n hostname: getDefaultHostname(options),\n port: this.bundlerInfo.port.toString(),\n protocol: options.scheme ?? 'http',\n };\n }\n}\n\nfunction getUrlComponentsFromProxyUrl(\n options: Pick<CreateURLOptions, 'scheme'>,\n url: string\n): UrlComponents {\n const parsedProxyUrl = new URL(url);\n let protocol = options.scheme ?? 'http';\n if (parsedProxyUrl.protocol === 'https:') {\n if (protocol === 'http') {\n protocol = 'https';\n }\n if (!parsedProxyUrl.port) {\n parsedProxyUrl.port = '443';\n }\n }\n return {\n port: parsedProxyUrl.port,\n hostname: parsedProxyUrl.hostname,\n protocol,\n };\n}\n\nfunction getDefaultHostname(options: Pick<CreateURLOptions, 'hostname'>) {\n // TODO: Drop REACT_NATIVE_PACKAGER_HOSTNAME\n if (process.env.REACT_NATIVE_PACKAGER_HOSTNAME) {\n return process.env.REACT_NATIVE_PACKAGER_HOSTNAME.trim();\n } else if (options.hostname === 'localhost') {\n // Restrict the use of `localhost`\n // TODO: Note why we do this.\n return '127.0.0.1';\n }\n\n return options.hostname || getIpAddress();\n}\n\nfunction joinUrlComponents({ protocol, hostname, port }: Partial<UrlComponents>): string {\n assert(hostname, 'hostname cannot be inferred.');\n const validProtocol = protocol ? `${protocol}://` : '';\n\n const url = `${validProtocol}${hostname}`;\n\n if (port) {\n return url + `:${port}`;\n }\n\n return url;\n}\n\n/** @deprecated */\nfunction getProxyUrl(): string | undefined {\n return process.env.EXPO_PACKAGER_PROXY_URL;\n}\n\n// TODO: Drop the undocumented env variables:\n// REACT_NATIVE_PACKAGER_HOSTNAME\n// EXPO_PACKAGER_PROXY_URL\n"],"names":["UrlCreator","debug","require","constructor","defaults","bundlerInfo","constructLoadingUrl","options","platform","url","URL","constructUrl","scheme","search","URLSearchParams","toString","loadingUrl","constructDevClientUrl","protocol","includes","toLowerCase","manifestUrl","hostType","devClientUrl","encodeURIComponent","urlComponents","getUrlComponents","joinUrlComponents","getTunnelUrlComponents","tunnelUrl","getTunnelUrl","parsed","port","hostname","proxyURL","getProxyUrl","getUrlComponentsFromProxyUrl","components","Log","warn","getDefaultHostname","parsedProxyUrl","process","env","REACT_NATIVE_PACKAGER_HOSTNAME","trim","getIpAddress","assert","validProtocol","EXPO_PACKAGER_PROXY_URL"],"mappings":";;;;+BAsBaA;;;eAAAA;;;;gEAtBM;;;;;;;yBACC;;;;;;6DAEC;oBACQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAgBxB,MAAMF;IACXG,YACE,AAAOC,QAAsC,EAC7C,AAAQC,WAAiE,CACzE;aAFOD,WAAAA;aACCC,cAAAA;IACP;IAEH;;;;;;;;;GASC,GACD,AAAOC,oBAAoBC,OAAyB,EAAEC,QAAuB,EAAU;QACrF,MAAMC,MAAM,IAAIC,CAAAA,MAAE,KAAC,CAAC,iBAAiB,IAAI,CAACC,YAAY,CAAC;YAAEC,QAAQ;YAAQ,GAAGL,OAAO;QAAC;QACpF,IAAIC,UAAU;YACZC,IAAII,MAAM,GAAG,IAAIC,gBAAgB;gBAAEN;YAAS,GAAGO,QAAQ;QACzD;QACA,MAAMC,aAAaP,IAAIM,QAAQ;QAC/Bd,MAAM,CAAC,aAAa,EAAEe,YAAY;QAClC,OAAOA;IACT;IAEA,wGAAwG,GACxG,AAAOC,sBAAsBV,OAA0B,EAAiB;YAClC,g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QAAQ,IAAIa,IAAAA,gBAAY;AACzC;AAEA,SAASnB,kBAAkB,EAAET,QAAQ,EAAEe,QAAQ,EAAED,IAAI,EAA0B;IAC7Ee,IAAAA,iBAAM,EAACd,UAAU;IACjB,MAAMe,gBAAgB9B,WAAW,GAAGA,SAAS,GAAG,CAAC,GAAG;IAEpD,MAAMT,MAAM,GAAGuC,gBAAgBf,UAAU;IAEzC,IAAID,MAAM;QACR,OAAOvB,MAAM,CAAC,CAAC,EAAEuB,MAAM;IACzB;IAEA,OAAOvB;AACT;AAEA,gBAAgB,GAChB,SAAS0B;IACP,OAAOO,QAAQC,GAAG,CAACM,uBAAuB;AAC5C,EAEA,6CAA6C;CAC7C,iCAAiC;CACjC,0BAA0B"}
1
+ {"version":3,"sources":["../../../../src/start/server/UrlCreator.ts"],"sourcesContent":["import assert from 'assert';\nimport { URL } from 'url';\n\nimport * as Log from '../../log';\nimport { getIpAddress } from '../../utils/ip';\n\nconst debug = require('debug')('expo:start:server:urlCreator') as typeof console.log;\n\nexport interface CreateURLOptions {\n /** URL scheme to use when opening apps in custom runtimes. */\n scheme?: string | null;\n /** Type of dev server host to use. */\n hostType?: 'localhost' | 'lan' | 'tunnel';\n /** Requested hostname. */\n hostname?: string | null;\n /** Requested port. */\n port?: string | null;\n}\n\ninterface UrlComponents {\n port: string;\n hostname: string;\n protocol: string;\n}\nexport class UrlCreator {\n constructor(\n public defaults: CreateURLOptions | undefined,\n private bundlerInfo: { port: number; getTunnelUrl?: () => string | null }\n ) {}\n\n /**\n * Return a URL for the \"loading\" interstitial page that is used to disambiguate which\n * native runtime to open the dev server with.\n *\n * @param options options for creating the URL\n * @param platform when opening the URL from the CLI to a connected device we can specify the platform as a query parameter, otherwise it will be inferred from the unsafe user agent sniffing.\n *\n * @returns URL like `http://localhost:8081/_expo/loading?platform=ios`\n * @returns URL like `http://localhost:8081/_expo/loading` when no platform is provided.\n */\n public constructLoadingUrl(options: CreateURLOptions, platform: string | null): string {\n const url = new URL('_expo/loading', this.constructUrl({ scheme: 'http', ...options }));\n if (platform) {\n url.search = new URLSearchParams({ platform }).toString();\n }\n const loadingUrl = url.toString();\n debug(`Loading URL: ${loadingUrl}`);\n return loadingUrl;\n }\n\n /** Create a URI for launching in a native dev client. Returns `null` when no `scheme` can be resolved. */\n public constructDevClientUrl(options?: CreateURLOptions): null | string {\n const protocol = options?.scheme || this.defaults?.scheme;\n\n if (\n !protocol ||\n // Prohibit the use of http(s) in dev client URIs since they'll never be valid.\n ['http', 'https'].includes(protocol.toLowerCase()) ||\n // Prohibit the use of `_` characters in the protocol, Node will throw an error when parsing these URLs\n protocol.includes('_')\n ) {\n debug(`Invalid protocol for dev client URL: ${protocol}`);\n return null;\n }\n\n const manifestUrl = this.constructUrl({\n ...options,\n scheme: this.defaults?.hostType === 'tunnel' ? 'https' : 'http',\n });\n const devClientUrl = `${protocol}://expo-development-client/?url=${encodeURIComponent(\n manifestUrl\n )}`;\n debug(`Dev client URL: ${devClientUrl} -- manifestUrl: ${manifestUrl} -- %O`, options);\n return devClientUrl;\n }\n\n /** Create a generic URL. */\n public constructUrl(options?: Partial<CreateURLOptions> | null): string {\n const urlComponents = this.getUrlComponents({\n ...this.defaults,\n ...options,\n });\n const url = joinUrlComponents(urlComponents);\n debug(`URL: ${url}`);\n return url;\n }\n\n /** Get the URL components from the Ngrok server URL. */\n private getTunnelUrlComponents(options: Pick<CreateURLOptions, 'scheme'>): UrlComponents | null {\n const tunnelUrl = this.bundlerInfo.getTunnelUrl?.();\n if (!tunnelUrl) {\n return null;\n }\n const parsed = new URL(tunnelUrl);\n return {\n port: parsed.port,\n hostname: parsed.hostname,\n protocol: options.scheme ?? 'http',\n };\n }\n\n private getUrlComponents(options: CreateURLOptions): UrlComponents {\n // Proxy comes first.\n const proxyURL = getProxyUrl();\n if (proxyURL) {\n return getUrlComponentsFromProxyUrl(options, proxyURL);\n }\n\n // Ngrok.\n if (options.hostType === 'tunnel') {\n const components = this.getTunnelUrlComponents(options);\n if (components) {\n return components;\n }\n Log.warn('Tunnel URL not found (it might not be ready yet), falling back to LAN URL.');\n } else if (options.hostType === 'localhost' && !options.hostname) {\n options.hostname = 'localhost';\n }\n\n return {\n hostname: getDefaultHostname(options),\n port: options.port ?? this.bundlerInfo.port.toString(),\n protocol: options.scheme ?? 'http',\n };\n }\n}\n\nfunction getUrlComponentsFromProxyUrl(\n options: Pick<CreateURLOptions, 'scheme'>,\n url: string\n): UrlComponents {\n const parsedProxyUrl = new URL(url);\n let protocol = options.scheme ?? 'http';\n if (parsedProxyUrl.protocol === 'https:') {\n if (protocol === 'http') {\n protocol = 'https';\n }\n if (!parsedProxyUrl.port) {\n parsedProxyUrl.port = '443';\n }\n }\n return {\n port: parsedProxyUrl.port,\n hostname: parsedProxyUrl.hostname,\n protocol,\n };\n}\n\nfunction getDefaultHostname(options: Pick<CreateURLOptions, 'hostname'>) {\n // TODO: Drop REACT_NATIVE_PACKAGER_HOSTNAME\n if (process.env.REACT_NATIVE_PACKAGER_HOSTNAME) {\n return process.env.REACT_NATIVE_PACKAGER_HOSTNAME.trim();\n } else if (options.hostname === 'localhost') {\n // Restrict the use of `localhost`\n // TODO: Note why we do this.\n return '127.0.0.1';\n }\n\n return options.hostname || getIpAddress();\n}\n\nfunction joinUrlComponents({ protocol, hostname, port }: Partial<UrlComponents>): string {\n assert(hostname, 'hostname cannot be inferred.');\n const validProtocol = protocol ? `${protocol}://` : '';\n\n const url = `${validProtocol}${hostname}`;\n\n if (port) {\n return url + `:${port}`;\n }\n\n return url;\n}\n\n/** @deprecated */\nfunction getProxyUrl(): string | undefined {\n return process.env.EXPO_PACKAGER_PROXY_URL;\n}\n\n// TODO: Drop the undocumented env variables:\n// REACT_NATIVE_PACKAGER_HOSTNAME\n// EXPO_PACKAGER_PROXY_URL\n"],"names":["UrlCreator","debug","require","constructor","defaults","bundlerInfo","constructLoadingUrl","options","platform","url","URL","constructUrl","scheme","search","URLSearchParams","toString","loadingUrl","constructDevClientUrl","protocol","includes","toLowerCase","manifestUrl","hostType","devClientUrl","encodeURIComponent","urlComponents","getUrlComponents","joinUrlComponents","getTunnelUrlComponents","tunnelUrl","getTunnelUrl","parsed","port","hostname","proxyURL","getProxyUrl","getUrlComponentsFromProxyUrl","components","Log","warn","getDefaultHostname","parsedProxyUrl","process","env","REACT_NATIVE_PACKAGER_HOSTNAME","trim","getIpAddress","assert","validProtocol","EXPO_PACKAGER_PROXY_URL"],"mappings":";;;;+BAwBaA;;;eAAAA;;;;gEAxBM;;;;;;;yBACC;;;;;;6DAEC;oBACQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAkBxB,MAAMF;IACXG,YACE,AAAOC,QAAsC,EAC7C,AAAQC,WAAiE,CACzE;aAFOD,WAAAA;aACCC,cAAAA;IACP;IAEH;;;;;;;;;GASC,GACD,AAAOC,oBAAoBC,OAAyB,EAAEC,QAAuB,EAAU;QACrF,MAAMC,MAAM,IAAIC,CAAAA,MAAE,KAAC,CAAC,iBAAiB,IAAI,CAACC,YAAY,CAAC;YAAEC,QAAQ;YAAQ,GAAGL,OAAO;QAAC;QACpF,IAAIC,UAAU;YACZC,IAAII,MAAM,GAAG,IAAIC,gBAAgB;gBAAEN;YAAS,GAAGO,QAAQ;QACzD;QACA,MAAMC,aAAaP,IAAIM,QAAQ;QAC/Bd,MAAM,CAAC,aAAa,EAAEe,YAAY;QAClC,OAAOA;IACT;IAEA,wGAAwG,GACxG,AAAOC,sBAAsBV,OAA0B,EAAiB;YAClC,gBAe1B;QAfV,MAAMW,WAAWX,CAAAA,2BAAAA,QAASK,MAAM,OAAI,iBAAA,IAAI,CAACR,QAAQ,qBAAb,eAAeQ,MAAM;QAEzD,IACE,CAACM,YACD,+EAA+E;QAC/E;YAAC;YAAQ;SAAQ,CAACC,QAAQ,CAACD,SAASE,WAAW,OAC/C,uGAAuG;QACvGF,SAASC,QAAQ,CAAC,MAClB;YACAlB,MAAM,CA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AAU;IAEzC,IAAID,MAAM;QACR,OAAOvB,MAAM,CAAC,CAAC,EAAEuB,MAAM;IACzB;IAEA,OAAOvB;AACT;AAEA,gBAAgB,GAChB,SAAS0B;IACP,OAAOO,QAAQC,GAAG,CAACM,uBAAuB;AAC5C,EAEA,6CAA6C;CAC7C,iCAAiC;CACjC,0BAA0B"}
@@ -22,7 +22,7 @@ function createDevToolsPluginWebsocketEndpoint({ serverBaseUrl }) {
22
22
  });
23
23
  wss.on('connection', (ws, request)=>{
24
24
  // Explicitly limit devtools websocket to loopback requests
25
- if (!(0, _net.isLocalSocket)(request.socket) || !(0, _net.isMatchingOrigin)(request, serverBaseUrl)) {
25
+ if (request.headers.origin && !(0, _net.isMatchingOrigin)(request, serverBaseUrl)) {
26
26
  // NOTE: `socket.close` nicely closes the websocket, which will still allow incoming messages
27
27
  // `socket.terminate` instead forcefully closes down the socket
28
28
  ws.terminate();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/server/metro/DevToolsPluginWebsocketEndpoint.ts"],"sourcesContent":["import { WebSocket, WebSocketServer } from 'ws';\n\nimport { isLocalSocket, isMatchingOrigin } from '../../../utils/net';\n\ninterface DevToolsPluginWebsocketEndpointParams {\n serverBaseUrl: string;\n}\n\nexport function createDevToolsPluginWebsocketEndpoint({\n serverBaseUrl,\n}: DevToolsPluginWebsocketEndpointParams): Record<string, WebSocketServer> {\n const wss = new WebSocketServer({ noServer: true });\n\n wss.on('connection', (ws, request) => {\n // Explicitly limit devtools websocket to loopback requests\n if (!isLocalSocket(request.socket) || !isMatchingOrigin(request, serverBaseUrl)) {\n // NOTE: `socket.close` nicely closes the websocket, which will still allow incoming messages\n // `socket.terminate` instead forcefully closes down the socket\n ws.terminate();\n return;\n }\n\n ws.on('message', (message, isBinary) => {\n // Broadcast the received message to all other connected clients\n wss.clients.forEach((client) => {\n if (client !== ws && client.readyState === WebSocket.OPEN) {\n client.send(message, { binary: isBinary });\n }\n });\n });\n });\n\n return { '/expo-dev-plugins/broadcast': wss };\n}\n"],"names":["createDevToolsPluginWebsocketEndpoint","serverBaseUrl","wss","WebSocketServer","noServer","on","ws","request","isLocalSocket","socket","isMatchingOrigin","terminate","message","isBinary","clients","forEach","client","readyState","WebSocket","OPEN","send","binary"],"mappings":";;;;+BAQgBA;;;eAAAA;;;;yBAR2B;;;;;;qBAEK;AAMzC,SAASA,sCAAsC,EACpDC,aAAa,EACyB;IACtC,MAAMC,MAAM,IAAIC,CAAAA,KAAc,iBAAC,CAAC;QAAEC,UAAU;IAAK;IAEjDF,IAAIG,EAAE,CAAC,cAAc,CAACC,IAAIC;QACxB,2DAA2D;QAC3D,IAAI,CAACC,IAAAA,kBAAa,EAACD,QAAQE,MAAM,KAAK,CAACC,IAAAA,qBAAgB,EAACH,SAASN,gBAAgB;YAC/E,6FAA6F;YAC7F,+DAA+D;YAC/DK,GAAGK,SAAS;YACZ;QACF;QAEAL,GAAGD,EAAE,CAAC,WAAW,CAACO,SAASC;YACzB,gEAAgE;YAChEX,IAAIY,OAAO,CAACC,OAAO,CAAC,CAACC;gBACnB,IAAIA,WAAWV,MAAMU,OAAOC,UAAU,KAAKC,eAAS,CAACC,IAAI,EAAE;oBACzDH,OAAOI,IAAI,CAACR,SAAS;wBAAES,QAAQR;oBAAS;gBAC1C;YACF;QACF;IACF;IAEA,OAAO;QAAE,+BAA+BX;IAAI;AAC9C"}
1
+ {"version":3,"sources":["../../../../../src/start/server/metro/DevToolsPluginWebsocketEndpoint.ts"],"sourcesContent":["import { WebSocket, WebSocketServer } from 'ws';\n\nimport { isMatchingOrigin } from '../../../utils/net';\n\ninterface DevToolsPluginWebsocketEndpointParams {\n serverBaseUrl: string;\n}\n\nexport function createDevToolsPluginWebsocketEndpoint({\n serverBaseUrl,\n}: DevToolsPluginWebsocketEndpointParams): Record<string, WebSocketServer> {\n const wss = new WebSocketServer({ noServer: true });\n\n wss.on('connection', (ws, request) => {\n // Explicitly limit devtools websocket to loopback requests\n if (request.headers.origin && !isMatchingOrigin(request, serverBaseUrl)) {\n // NOTE: `socket.close` nicely closes the websocket, which will still allow incoming messages\n // `socket.terminate` instead forcefully closes down the socket\n ws.terminate();\n return;\n }\n\n ws.on('message', (message, isBinary) => {\n // Broadcast the received message to all other connected clients\n wss.clients.forEach((client) => {\n if (client !== ws && client.readyState === WebSocket.OPEN) {\n client.send(message, { binary: isBinary });\n }\n });\n });\n });\n\n return { '/expo-dev-plugins/broadcast': wss };\n}\n"],"names":["createDevToolsPluginWebsocketEndpoint","serverBaseUrl","wss","WebSocketServer","noServer","on","ws","request","headers","origin","isMatchingOrigin","terminate","message","isBinary","clients","forEach","client","readyState","WebSocket","OPEN","send","binary"],"mappings":";;;;+BAQgBA;;;eAAAA;;;;yBAR2B;;;;;;qBAEV;AAM1B,SAASA,sCAAsC,EACpDC,aAAa,EACyB;IACtC,MAAMC,MAAM,IAAIC,CAAAA,KAAc,iBAAC,CAAC;QAAEC,UAAU;IAAK;IAEjDF,IAAIG,EAAE,CAAC,cAAc,CAACC,IAAIC;QACxB,2DAA2D;QAC3D,IAAIA,QAAQC,OAAO,CAACC,MAAM,IAAI,CAACC,IAAAA,qBAAgB,EAACH,SAASN,gBAAgB;YACvE,6FAA6F;YAC7F,+DAA+D;YAC/DK,GAAGK,SAAS;YACZ;QACF;QAEAL,GAAGD,EAAE,CAAC,WAAW,CAACO,SAASC;YACzB,gEAAgE;YAChEX,IAAIY,OAAO,CAACC,OAAO,CAAC,CAACC;gBACnB,IAAIA,WAAWV,MAAMU,OAAOC,UAAU,KAAKC,eAAS,CAACC,IAAI,EAAE;oBACzDH,OAAOI,IAAI,CAACR,SAAS;wBAAES,QAAQR;oBAAS;gBAC1C;YACF;QACF;IACF;IAEA,OAAO;QAAE,+BAA+BX;IAAI;AAC9C"}
@@ -287,7 +287,7 @@ class MetroBundlerDevServer extends _BundlerDevServer.BundlerDevServer {
287
287
  /**
288
288
  * Bundle render module for use in SSR
289
289
  */ async exportExpoRouterRenderModuleAsync({ files, includeSourceMaps, platform = 'web' }) {
290
- const renderModule = await this.ssrLoadModuleContents('@expo/router-server/node/render.js', {
290
+ const renderModule = await this.ssrLoadModuleContents(require.resolve('@expo/router-server/node/render.js'), {
291
291
  environment: 'node',
292
292
  platform
293
293
  });
@@ -347,7 +347,7 @@ class MetroBundlerDevServer extends _BundlerDevServer.BundlerDevServer {
347
347
  var _exp_extra, _exp_extra1;
348
348
  const { exp } = (0, _config().getConfig)(this.projectRoot);
349
349
  // NOTE: This could probably be folded back into `renderStaticContent` when expo-asset and font support RSC.
350
- const { getBuildTimeServerManifestAsync, getManifest } = await this.ssrLoadModule('@expo/router-server/build/static/getServerManifest.js', {
350
+ const { getBuildTimeServerManifestAsync, getManifest } = await this.ssrLoadModule(require.resolve('@expo/router-server/build/static/getServerManifest.js'), {
351
351
  // Only use react-server environment when the routes are using react-server rendering by default.
352
352
  environment: this.isReactServerRoutesEnabled ? 'react-server' : 'node'
353
353
  });
@@ -368,7 +368,7 @@ class MetroBundlerDevServer extends _BundlerDevServer.BundlerDevServer {
368
368
  (0, _assert().default)(routerRoot != null, 'The server must be started before calling getStaticRenderFunctionAsync.');
369
369
  const appDir = _path().default.join(this.projectRoot, routerRoot);
370
370
  const url = this.getDevServerUrlOrAssert();
371
- const { getStaticContent, getManifest, getBuildTimeServerManifestAsync } = await this.ssrLoadModule('@expo/router-server/node/render.js', {
371
+ const { getStaticContent, getManifest, getBuildTimeServerManifestAsync } = await this.ssrLoadModule(require.resolve('@expo/router-server/node/render.js'), {
372
372
  // This must always use the legacy rendering resolution (no `react-server`) because it leverages
373
373
  // the previous React SSG utilities which aren't available in React 19.
374
374
  environment: 'node'
@@ -456,7 +456,7 @@ class MetroBundlerDevServer extends _BundlerDevServer.BundlerDevServer {
456
456
  });
457
457
  const bundleStaticHtml = async ()=>{
458
458
  var _exp_extra_router, _exp_extra;
459
- const { getStaticContent } = await this.ssrLoadModule('@expo/router-server/node/render.js', {
459
+ const { getStaticContent } = await this.ssrLoadModule(require.resolve('@expo/router-server/node/render.js'), {
460
460
  // This must always use the legacy rendering resolution (no `react-server`) because it leverages
461
461
  // the previous React SSG utilities which aren't available in React 19.
462
462
  environment: 'node',