@expo/cli 57.0.0 → 57.0.2

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 (31) hide show
  1. package/build/bin/cli +1 -1
  2. package/build/src/events/index.js +1 -1
  3. package/build/src/export/createMetadataJson.js.map +1 -1
  4. package/build/src/export/embed/exportEmbedAsync.js +6 -3
  5. package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
  6. package/build/src/export/embed/resolveOptions.js +2 -1
  7. package/build/src/export/embed/resolveOptions.js.map +1 -1
  8. package/build/src/export/exportApp.js +1 -1
  9. package/build/src/export/exportApp.js.map +1 -1
  10. package/build/src/export/exportHermes.js +9 -1
  11. package/build/src/export/exportHermes.js.map +1 -1
  12. package/build/src/export/resolveOptions.js +9 -10
  13. package/build/src/export/resolveOptions.js.map +1 -1
  14. package/build/src/export/saveAssets.js.map +1 -1
  15. package/build/src/start/server/metro/createExpoAutolinkingResolver.js +21 -8
  16. package/build/src/start/server/metro/createExpoAutolinkingResolver.js.map +1 -1
  17. package/build/src/start/server/metro/instantiateMetro.js +5 -2
  18. package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
  19. package/build/src/start/server/metro/withMetroMultiPlatform.js +88 -11
  20. package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
  21. package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js +3 -1
  22. package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js.map +1 -1
  23. package/build/src/start/server/middleware/InterstitialPageMiddleware.js +3 -1
  24. package/build/src/start/server/middleware/InterstitialPageMiddleware.js.map +1 -1
  25. package/build/src/start/server/middleware/resolvePlatform.js +4 -2
  26. package/build/src/start/server/middleware/resolvePlatform.js.map +1 -1
  27. package/build/src/start/server/platformBundlers.js +3 -1
  28. package/build/src/start/server/platformBundlers.js.map +1 -1
  29. package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
  30. package/build/src/utils/telemetry/utils/context.js +1 -1
  31. package/package.json +12 -12
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/server/middleware/InterstitialPageMiddleware.ts"],"sourcesContent":["import { getConfig, getNameFromConfig } from '@expo/config';\nimport { getRuntimeVersionNullableAsync } from '@expo/config-plugins/build/utils/Updates';\nimport { readFile } from 'fs/promises';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { disableResponseCache, ExpoMiddleware } from './ExpoMiddleware';\nimport type { RuntimePlatform } from './resolvePlatform';\nimport {\n assertMissingRuntimePlatform,\n assertRuntimePlatform,\n parsePlatformHeader,\n resolvePlatformFromUserAgentHeader,\n} from './resolvePlatform';\nimport type { ServerRequest, ServerResponse } from './server.types';\n\ntype ProjectVersion = {\n type: 'sdk' | 'runtime';\n version: string | null;\n};\n\nconst debug = require('debug')(\n 'expo:start:server:middleware:interstitialPage'\n) as typeof console.log;\n\nfunction escapeHtml(value: string): string {\n return value\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;');\n}\n\nexport const LoadingEndpoint = '/_expo/loading';\n\nexport class InterstitialPageMiddleware extends ExpoMiddleware {\n constructor(\n projectRoot: string,\n protected options: { scheme: string | null } = { scheme: null }\n ) {\n super(projectRoot, [LoadingEndpoint]);\n }\n\n /** Get the template HTML page and inject values. */\n async _getPageAsync({\n appName,\n projectVersion,\n }: {\n appName: string;\n projectVersion: ProjectVersion;\n }): Promise<string> {\n const templatePath =\n // Production: This will resolve when installed in the project.\n resolveFrom.silent(this.projectRoot, 'expo/static/loading-page/index.html') ??\n // Development: This will resolve when testing locally.\n path.resolve(__dirname, '../../../../../static/loading-page/index.html');\n let content = (await readFile(templatePath)).toString('utf-8');\n\n content = content.replace(/{{\\s*AppName\\s*}}/, escapeHtml(appName));\n content = content.replace(/{{\\s*Path\\s*}}/, escapeHtml(this.projectRoot));\n content = content.replace(/{{\\s*Scheme\\s*}}/, escapeHtml(this.options.scheme ?? 'Unknown'));\n content = content.replace(\n /{{\\s*ProjectVersionType\\s*}}/,\n `${projectVersion.type === 'sdk' ? 'SDK' : 'Runtime'} version`\n );\n content = content.replace(\n /{{\\s*ProjectVersion\\s*}}/,\n escapeHtml(projectVersion.version ?? 'Undetected')\n );\n\n return content;\n }\n\n /** Get settings for the page from the project config. */\n async _getProjectOptionsAsync(platform: RuntimePlatform): Promise<{\n appName: string;\n projectVersion: ProjectVersion;\n }> {\n assertRuntimePlatform(platform);\n\n const { exp } = getConfig(this.projectRoot);\n const { appName } = getNameFromConfig(exp);\n const runtimeVersion = await getRuntimeVersionNullableAsync(this.projectRoot, exp, platform);\n const sdkVersion = exp.sdkVersion ?? null;\n\n return {\n appName: appName ?? 'App',\n projectVersion:\n sdkVersion && !runtimeVersion\n ? { type: 'sdk', version: sdkVersion }\n : { type: 'runtime', version: runtimeVersion },\n };\n }\n\n async handleRequestAsync(req: ServerRequest, res: ServerResponse): Promise<void> {\n res = disableResponseCache(res);\n res.setHeader('Content-Type', 'text/html');\n\n const platform = parsePlatformHeader(req) ?? resolvePlatformFromUserAgentHeader(req);\n assertMissingRuntimePlatform(platform);\n assertRuntimePlatform(platform);\n\n const { appName, projectVersion } = await this._getProjectOptionsAsync(platform);\n debug(\n `Create loading page. (platform: ${platform}, appName: ${appName}, projectVersion: ${projectVersion.version}, type: ${projectVersion.type})`\n );\n const content = await this._getPageAsync({ appName, projectVersion });\n res.end(content);\n }\n}\n"],"names":["InterstitialPageMiddleware","LoadingEndpoint","debug","require","escapeHtml","value","replace","ExpoMiddleware","projectRoot","options","scheme","_getPageAsync","appName","projectVersion","templatePath","resolveFrom","silent","path","resolve","__dirname","content","readFile","toString","type","version","_getProjectOptionsAsync","platform","assertRuntimePlatform","exp","getConfig","getNameFromConfig","runtimeVersion","getRuntimeVersionNullableAsync","sdkVersion","handleRequestAsync","req","res","disableResponseCache","setHeader","parsePlatformHeader","resolvePlatformFromUserAgentHeader","assertMissingRuntimePlatform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IAEA,uDAAuD,GACvD,MAAMK,wBAAwBC,QAAyB,EAGpD;QACDC,IAAAA,sCAAqB,EAACD;QAEtB,MAAM,EAAEE,GAAG,EAAE,GAAGC,IAAAA,mBAAS,EAAC,IAAI,CAACrB,WAAW;QAC1C,MAAM,EAAEI,OAAO,EAAE,GAAGkB,IAAAA,2BAAiB,EAACF;QACtC,MAAMG,iBAAiB,MAAMC,IAAAA,yCAA8B,EAAC,IAAI,CAACxB,WAAW,EAAEoB,KAAKF;QACnF,MAAMO,aAAaL,IAAIK,UAAU,IAAI;QAErC,OAAO;YACLrB,SAASA,WAAW;YACpBC,gBACEoB,cAAc,CAACF,iBACX;gBAAER,MAAM;gBAAOC,SAASS;YAAW,IACnC;gBAAEV,MAAM;gBAAWC,SAASO;YAAe;QACnD;IACF;IAEA,MAAMG,mBAAmBC,GAAkB,EAAEC,GAAmB,EAAiB;QAC/EA,MAAMC,IAAAA,oCAAoB,EAACD;QAC3BA,IAAIE,SAAS,CAAC,gBAAgB;QAE9B,MAAMZ,WAAWa,IAAAA,oCAAmB,EAACJ,QAAQK,IAAAA,mDAAkC,EAACL;QAChFM,IAAAA,6CAA4B,EAACf;QAC7BC,IAAAA,sCAAqB,EAACD;QAEtB,MAAM,EAAEd,OAAO,EAAEC,cAAc,EAAE,GAAG,MAAM,IAAI,CAACY,uBAAuB,CAACC;QACvExB,MACE,CAAC,gCAAgC,EAAEwB,SAAS,WAAW,EAAEd,QAAQ,kBAAkB,EAAEC,eAAeW,OAAO,CAAC,QAAQ,EAAEX,eAAeU,IAAI,CAAC,CAAC,CAAC;QAE9I,MAAMH,UAAU,MAAM,IAAI,CAACT,aAAa,CAAC;YAAEC;YAASC;QAAe;QACnEuB,IAAIM,GAAG,CAACtB;IACV;AACF"}
1
+ {"version":3,"sources":["../../../../../src/start/server/middleware/InterstitialPageMiddleware.ts"],"sourcesContent":["import { getConfig, getNameFromConfig } from '@expo/config';\nimport { getRuntimeVersionNullableAsync } from '@expo/config-plugins/build/utils/Updates';\nimport { readFile } from 'fs/promises';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { disableResponseCache, ExpoMiddleware } from './ExpoMiddleware';\nimport type { RuntimePlatform } from './resolvePlatform';\nimport {\n assertMissingRuntimePlatform,\n assertRuntimePlatform,\n parsePlatformHeader,\n resolvePlatformFromUserAgentHeader,\n} from './resolvePlatform';\nimport type { ServerRequest, ServerResponse } from './server.types';\n\ntype ProjectVersion = {\n type: 'sdk' | 'runtime';\n version: string | null;\n};\n\nconst debug = require('debug')(\n 'expo:start:server:middleware:interstitialPage'\n) as typeof console.log;\n\nfunction escapeHtml(value: string): string {\n return value\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;');\n}\n\nexport const LoadingEndpoint = '/_expo/loading';\n\nexport class InterstitialPageMiddleware extends ExpoMiddleware {\n constructor(\n projectRoot: string,\n protected options: { scheme: string | null } = { scheme: null }\n ) {\n super(projectRoot, [LoadingEndpoint]);\n }\n\n /** Get the template HTML page and inject values. */\n async _getPageAsync({\n appName,\n projectVersion,\n }: {\n appName: string;\n projectVersion: ProjectVersion;\n }): Promise<string> {\n const templatePath =\n // Production: This will resolve when installed in the project.\n resolveFrom.silent(this.projectRoot, 'expo/static/loading-page/index.html') ??\n // Development: This will resolve when testing locally.\n path.resolve(__dirname, '../../../../../static/loading-page/index.html');\n let content = (await readFile(templatePath)).toString('utf-8');\n\n content = content.replace(/{{\\s*AppName\\s*}}/, escapeHtml(appName));\n content = content.replace(/{{\\s*Path\\s*}}/, escapeHtml(this.projectRoot));\n content = content.replace(/{{\\s*Scheme\\s*}}/, escapeHtml(this.options.scheme ?? 'Unknown'));\n content = content.replace(\n /{{\\s*ProjectVersionType\\s*}}/,\n `${projectVersion.type === 'sdk' ? 'SDK' : 'Runtime'} version`\n );\n content = content.replace(\n /{{\\s*ProjectVersion\\s*}}/,\n escapeHtml(projectVersion.version ?? 'Undetected')\n );\n\n return content;\n }\n\n /** Get settings for the page from the project config. */\n async _getProjectOptionsAsync(platform: RuntimePlatform): Promise<{\n appName: string;\n projectVersion: ProjectVersion;\n }> {\n assertRuntimePlatform(platform);\n\n const { exp } = getConfig(this.projectRoot);\n const { appName } = getNameFromConfig(exp);\n const runtimeVersion = await getRuntimeVersionNullableAsync(\n this.projectRoot,\n exp,\n // TODO(@kitten): Runtime-version resolution only reads ios/android config\n // tvos/macos fall back to the shared `runtimeVersion` until they get explicit support\n platform as 'android' | 'ios'\n );\n const sdkVersion = exp.sdkVersion ?? null;\n\n return {\n appName: appName ?? 'App',\n projectVersion:\n sdkVersion && !runtimeVersion\n ? { type: 'sdk', version: sdkVersion }\n : { type: 'runtime', version: runtimeVersion },\n };\n }\n\n async handleRequestAsync(req: ServerRequest, res: ServerResponse): Promise<void> {\n res = disableResponseCache(res);\n res.setHeader('Content-Type', 'text/html');\n\n const platform = parsePlatformHeader(req) ?? resolvePlatformFromUserAgentHeader(req);\n assertMissingRuntimePlatform(platform);\n assertRuntimePlatform(platform);\n\n const { appName, projectVersion } = await this._getProjectOptionsAsync(platform);\n debug(\n `Create loading page. (platform: ${platform}, appName: ${appName}, projectVersion: ${projectVersion.version}, type: ${projectVersion.type})`\n );\n const content = await this._getPageAsync({ appName, projectVersion });\n res.end(content);\n }\n}\n"],"names":["InterstitialPageMiddleware","LoadingEndpoint","debug","require","escapeHtml","value","replace","ExpoMiddleware","projectRoot","options","scheme","_getPageAsync","appName","projectVersion","templatePath","resolveFrom","silent","path","resolve","__dirname","content","readFile","toString","type","version","_getProjectOptionsAsync","platform","assertRuntimePlatform","exp","getConfig","getNameFromConfig","runtimeVersion","getRuntimeVersionNullableAsync","sdkVersion","handleRequestAsync","req","res","disableResponseCache","setHeader","parsePlatformHeader","resolvePlatformFromUserAgentHeader","assertMissingRuntimePlatform","end"],"mappings":";;;;;;;;;;;QAoCaA;eAAAA;;QAFAC;eAAAA;;;;yBAlCgC;;;;;;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AACD;QAEtB,MAAM,EAAEE,GAAG,EAAE,GAAGC,IAAAA,mBAAS,EAAC,IAAI,CAACrB,WAAW;QAC1C,MAAM,EAAEI,OAAO,EAAE,GAAGkB,IAAAA,2BAAiB,EAACF;QACtC,MAAMG,iBAAiB,MAAMC,IAAAA,yCAA8B,EACzD,IAAI,CAACxB,WAAW,EAChBoB,KACA,0EAA0E;QAC1E,sFAAsF;QACtFF;QAEF,MAAMO,aAAaL,IAAIK,UAAU,IAAI;QAErC,OAAO;YACLrB,SAASA,WAAW;YACpBC,gBACEoB,cAAc,CAACF,iBACX;gBAAER,MAAM;gBAAOC,SAASS;YAAW,IACnC;gBAAEV,MAAM;gBAAWC,SAASO;YAAe;QACnD;IACF;IAEA,MAAMG,mBAAmBC,GAAkB,EAAEC,GAAmB,EAAiB;QAC/EA,MAAMC,IAAAA,oCAAoB,EAACD;QAC3BA,IAAIE,SAAS,CAAC,gBAAgB;QAE9B,MAAMZ,WAAWa,IAAAA,oCAAmB,EAACJ,QAAQK,IAAAA,mDAAkC,EAACL;QAChFM,IAAAA,6CAA4B,EAACf;QAC7BC,IAAAA,sCAAqB,EAACD;QAEtB,MAAM,EAAEd,OAAO,EAAEC,cAAc,EAAE,GAAG,MAAM,IAAI,CAACY,uBAAuB,CAACC;QACvExB,MACE,CAAC,gCAAgC,EAAEwB,SAAS,WAAW,EAAEd,QAAQ,kBAAkB,EAAEC,eAAeW,OAAO,CAAC,QAAQ,EAAEX,eAAeU,IAAI,CAAC,CAAC,CAAC;QAE9I,MAAMH,UAAU,MAAM,IAAI,CAACT,aAAa,CAAC;YAAEC;YAASC;QAAe;QACnEuB,IAAIM,GAAG,CAACtB;IACV;AACF"}
@@ -62,9 +62,11 @@ function assertRuntimePlatform(platform) {
62
62
  if (![
63
63
  'android',
64
64
  'ios',
65
- 'web'
65
+ 'web',
66
+ 'tvos',
67
+ 'macos'
66
68
  ].includes(stringifiedPlatform)) {
67
- throw new _errors.CommandError('PLATFORM_HEADER', `platform must be "android", "ios", or "web". Received: "${platform}"`);
69
+ throw new _errors.CommandError('PLATFORM_HEADER', `platform must be "android", "ios", "web", "tvos", or "macos". Received: "${platform}"`);
68
70
  }
69
71
  }
70
72
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/server/middleware/resolvePlatform.ts"],"sourcesContent":["import { parse } from 'url';\n\nimport type { ServerRequest } from './server.types';\nimport { CommandError } from '../../../utils/errors';\n\nconst debug = require('debug')(\n 'expo:start:server:middleware:resolvePlatform'\n) as typeof console.log;\n\n/** Supported platforms */\nexport type RuntimePlatform = 'ios' | 'android';\n\n/**\n * Extract the runtime platform from the server request.\n * 1. Query param `platform`: `?platform=ios`\n * 2. Header `expo-platform`: `'expo-platform': ios`\n * 3. Legacy header `exponent-platform`: `'exponent-platform': ios`\n *\n * Returns first item in the case of an array.\n */\nexport function parsePlatformHeader(req: ServerRequest): string | null {\n const url = parse(req.url!, /* parseQueryString */ true);\n const platform =\n url.query?.platform || req.headers['expo-platform'] || req.headers['exponent-platform'];\n return (Array.isArray(platform) ? platform[0] : platform) ?? null;\n}\n\n/** Guess the platform from the user-agent header. */\nexport function resolvePlatformFromUserAgentHeader(req: ServerRequest): string | null {\n let platform = null;\n const userAgent = req.headers['user-agent'];\n if (userAgent?.match(/Android/i)) {\n platform = 'android';\n }\n if (userAgent?.match(/OculusBrowser|Quest/i)) {\n platform = 'android';\n }\n if (userAgent?.match(/iPhone|iPad/i)) {\n platform = 'ios';\n }\n debug(`Resolved platform ${platform} from user-agent header: ${userAgent}`);\n return platform;\n}\n\n/** Assert if the runtime platform is not included. */\nexport function assertMissingRuntimePlatform(platform?: any): asserts platform {\n if (!platform) {\n throw new CommandError(\n 'PLATFORM_HEADER',\n `Must specify \"expo-platform\" header or \"platform\" query parameter`\n );\n }\n}\n\n/** Assert if the runtime platform is not correct. */\nexport function assertRuntimePlatform(platform: string): asserts platform is RuntimePlatform {\n const stringifiedPlatform = String(platform);\n if (!['android', 'ios', 'web'].includes(stringifiedPlatform)) {\n throw new CommandError(\n 'PLATFORM_HEADER',\n `platform must be \"android\", \"ios\", or \"web\". Received: \"${platform}\"`\n );\n }\n}\n"],"names":["assertMissingRuntimePlatform","assertRuntimePlatform","parsePlatformHeader","resolvePlatformFromUserAgentHeader","debug","require","req","url","parse","platform","query","headers","Array","isArray","userAgent","match","CommandError","stringifiedPlatform","String","includes"],"mappings":";;;;;;;;;;;QA6CgBA;eAAAA;;QAUAC;eAAAA;;QAnCAC;eAAAA;;QAQAC;eAAAA;;;;yBA5BM;;;;;;wBAGO;AAE7B,MAAMC,QAAQC,QAAQ,SACpB;AAcK,SAASH,oBAAoBI,GAAkB;QAGlDC;IAFF,MAAMA,MAAMC,IAAAA,YAAK,EAACF,IAAIC,GAAG,EAAG,oBAAoB,GAAG;IACnD,MAAME,WACJF,EAAAA,aAAAA,IAAIG,KAAK,qBAATH,WAAWE,QAAQ,KAAIH,IAAIK,OAAO,CAAC,gBAAgB,IAAIL,IAAIK,OAAO,CAAC,oBAAoB;IACzF,OAAO,AAACC,CAAAA,MAAMC,OAAO,CAACJ,YAAYA,QAAQ,CAAC,EAAE,GAAGA,QAAO,KAAM;AAC/D;AAGO,SAASN,mCAAmCG,GAAkB;IACnE,IAAIG,WAAW;IACf,MAAMK,YAAYR,IAAIK,OAAO,CAAC,aAAa;IAC3C,IAAIG,6BAAAA,UAAWC,KAAK,CAAC,aAAa;QAChCN,WAAW;IACb;IACA,IAAIK,6BAAAA,UAAWC,KAAK,CAAC,yBAAyB;QAC5CN,WAAW;IACb;IACA,IAAIK,6BAAAA,UAAWC,KAAK,CAAC,iBAAiB;QACpCN,WAAW;IACb;IACAL,MAAM,CAAC,kBAAkB,EAAEK,SAAS,yBAAyB,EAAEK,WAAW;IAC1E,OAAOL;AACT;AAGO,SAAST,6BAA6BS,QAAc;IACzD,IAAI,CAACA,UAAU;QACb,MAAM,IAAIO,oBAAY,CACpB,mBACA,CAAC,iEAAiE,CAAC;IAEvE;AACF;AAGO,SAASf,sBAAsBQ,QAAgB;IACpD,MAAMQ,sBAAsBC,OAAOT;IACnC,IAAI,CAAC;QAAC;QAAW;QAAO;KAAM,CAACU,QAAQ,CAACF,sBAAsB;QAC5D,MAAM,IAAID,oBAAY,CACpB,mBACA,CAAC,wDAAwD,EAAEP,SAAS,CAAC,CAAC;IAE1E;AACF"}
1
+ {"version":3,"sources":["../../../../../src/start/server/middleware/resolvePlatform.ts"],"sourcesContent":["import type { NativePlatform } from '@expo/config';\nimport { parse } from 'url';\n\nimport type { ServerRequest } from './server.types';\nimport { CommandError } from '../../../utils/errors';\n\nconst debug = require('debug')(\n 'expo:start:server:middleware:resolvePlatform'\n) as typeof console.log;\n\n/** Supported native runtime platforms. */\nexport type RuntimePlatform = NativePlatform;\n\n/**\n * Extract the runtime platform from the server request.\n * 1. Query param `platform`: `?platform=ios`\n * 2. Header `expo-platform`: `'expo-platform': ios`\n * 3. Legacy header `exponent-platform`: `'exponent-platform': ios`\n *\n * Returns first item in the case of an array.\n */\nexport function parsePlatformHeader(req: ServerRequest): string | null {\n const url = parse(req.url!, /* parseQueryString */ true);\n const platform =\n url.query?.platform || req.headers['expo-platform'] || req.headers['exponent-platform'];\n return (Array.isArray(platform) ? platform[0] : platform) ?? null;\n}\n\n/** Guess the platform from the user-agent header. */\nexport function resolvePlatformFromUserAgentHeader(req: ServerRequest): string | null {\n let platform = null;\n const userAgent = req.headers['user-agent'];\n if (userAgent?.match(/Android/i)) {\n platform = 'android';\n }\n if (userAgent?.match(/OculusBrowser|Quest/i)) {\n platform = 'android';\n }\n if (userAgent?.match(/iPhone|iPad/i)) {\n platform = 'ios';\n }\n debug(`Resolved platform ${platform} from user-agent header: ${userAgent}`);\n return platform;\n}\n\n/** Assert if the runtime platform is not included. */\nexport function assertMissingRuntimePlatform(platform?: any): asserts platform {\n if (!platform) {\n throw new CommandError(\n 'PLATFORM_HEADER',\n `Must specify \"expo-platform\" header or \"platform\" query parameter`\n );\n }\n}\n\n/** Assert if the runtime platform is not correct. */\nexport function assertRuntimePlatform(platform: string): asserts platform is RuntimePlatform {\n const stringifiedPlatform = String(platform);\n if (!['android', 'ios', 'web', 'tvos', 'macos'].includes(stringifiedPlatform)) {\n throw new CommandError(\n 'PLATFORM_HEADER',\n `platform must be \"android\", \"ios\", \"web\", \"tvos\", or \"macos\". Received: \"${platform}\"`\n );\n }\n}\n"],"names":["assertMissingRuntimePlatform","assertRuntimePlatform","parsePlatformHeader","resolvePlatformFromUserAgentHeader","debug","require","req","url","parse","platform","query","headers","Array","isArray","userAgent","match","CommandError","stringifiedPlatform","String","includes"],"mappings":";;;;;;;;;;;QA8CgBA;eAAAA;;QAUAC;eAAAA;;QAnCAC;eAAAA;;QAQAC;eAAAA;;;;yBA5BM;;;;;;wBAGO;AAE7B,MAAMC,QAAQC,QAAQ,SACpB;AAcK,SAASH,oBAAoBI,GAAkB;QAGlDC;IAFF,MAAMA,MAAMC,IAAAA,YAAK,EAACF,IAAIC,GAAG,EAAG,oBAAoB,GAAG;IACnD,MAAME,WACJF,EAAAA,aAAAA,IAAIG,KAAK,qBAATH,WAAWE,QAAQ,KAAIH,IAAIK,OAAO,CAAC,gBAAgB,IAAIL,IAAIK,OAAO,CAAC,oBAAoB;IACzF,OAAO,AAACC,CAAAA,MAAMC,OAAO,CAACJ,YAAYA,QAAQ,CAAC,EAAE,GAAGA,QAAO,KAAM;AAC/D;AAGO,SAASN,mCAAmCG,GAAkB;IACnE,IAAIG,WAAW;IACf,MAAMK,YAAYR,IAAIK,OAAO,CAAC,aAAa;IAC3C,IAAIG,6BAAAA,UAAWC,KAAK,CAAC,aAAa;QAChCN,WAAW;IACb;IACA,IAAIK,6BAAAA,UAAWC,KAAK,CAAC,yBAAyB;QAC5CN,WAAW;IACb;IACA,IAAIK,6BAAAA,UAAWC,KAAK,CAAC,iBAAiB;QACpCN,WAAW;IACb;IACAL,MAAM,CAAC,kBAAkB,EAAEK,SAAS,yBAAyB,EAAEK,WAAW;IAC1E,OAAOL;AACT;AAGO,SAAST,6BAA6BS,QAAc;IACzD,IAAI,CAACA,UAAU;QACb,MAAM,IAAIO,oBAAY,CACpB,mBACA,CAAC,iEAAiE,CAAC;IAEvE;AACF;AAGO,SAASf,sBAAsBQ,QAAgB;IACpD,MAAMQ,sBAAsBC,OAAOT;IACnC,IAAI,CAAC;QAAC;QAAW;QAAO;QAAO;QAAQ;KAAQ,CAACU,QAAQ,CAACF,sBAAsB;QAC7E,MAAM,IAAID,oBAAY,CACpB,mBACA,CAAC,yEAAyE,EAAEP,SAAS,CAAC,CAAC;IAE3F;AACF"}
@@ -32,7 +32,9 @@ function getPlatformBundlers(projectRoot, exp) {
32
32
  return {
33
33
  ios: ((_exp_ios = exp.ios) == null ? void 0 : _exp_ios.bundler) ?? 'metro',
34
34
  android: ((_exp_android = exp.android) == null ? void 0 : _exp_android.bundler) ?? 'metro',
35
- web
35
+ web,
36
+ tvos: 'metro',
37
+ macos: 'metro'
36
38
  };
37
39
  }
38
40
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/start/server/platformBundlers.ts"],"sourcesContent":["import type { ExpoConfig, ExpoConfigWeb, Platform } from '@expo/config';\nimport resolveFrom from 'resolve-from';\n\n/** Which bundler each platform should use. */\nexport type PlatformBundlers = Record<Platform, 'metro' | 'webpack'>;\n\n/** XDL-schema doesn't have `ios.bundler` and `android.bundler`, since this is technically deprecated */\ntype WithBundlerConfig = Pick<ExpoConfigWeb, 'bundler'> | undefined | null;\n\n/** Get the platform bundlers mapping. */\nexport function getPlatformBundlers(\n projectRoot: string,\n exp: Partial<ExpoConfig>\n): PlatformBundlers {\n /**\n * SDK 50+: The web bundler is dynamic based upon the presence of the `@expo/webpack-config` package.\n */\n let web = exp.web?.bundler;\n if (!web) {\n const resolved = resolveFrom.silent(projectRoot, '@expo/webpack-config/package.json');\n web = resolved ? 'webpack' : 'metro';\n }\n\n return {\n ios: (exp.ios as WithBundlerConfig)?.bundler ?? 'metro',\n android: (exp.android as WithBundlerConfig)?.bundler ?? 'metro',\n web,\n };\n}\n"],"names":["getPlatformBundlers","projectRoot","exp","web","bundler","resolved","resolveFrom","silent","ios","android"],"mappings":";;;;+BAUgBA;;;eAAAA;;;;gEATQ;;;;;;;;;;;AASjB,SAASA,oBACdC,WAAmB,EACnBC,GAAwB;QAKdA,UAOFA,UACIA;IAXZ;;GAEC,GACD,IAAIC,OAAMD,WAAAA,IAAIC,GAAG,qBAAPD,SAASE,OAAO;IAC1B,IAAI,CAACD,KAAK;QACR,MAAME,WAAWC,sBAAW,CAACC,MAAM,CAACN,aAAa;QACjDE,MAAME,WAAW,YAAY;IAC/B;IAEA,OAAO;QACLG,KAAK,EAACN,WAAAA,IAAIM,GAAG,qBAAR,AAACN,SAA+BE,OAAO,KAAI;QAChDK,SAAS,EAACP,eAAAA,IAAIO,OAAO,qBAAZ,AAACP,aAAmCE,OAAO,KAAI;QACxDD;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/start/server/platformBundlers.ts"],"sourcesContent":["import type { ExpoConfig, ExpoConfigWeb, Platform } from '@expo/config';\nimport resolveFrom from 'resolve-from';\n\n/** Which bundler each platform should use. */\nexport type PlatformBundlers = Record<Platform, 'metro' | 'webpack'>;\n\n/** XDL-schema doesn't have `ios.bundler` and `android.bundler`, since this is technically deprecated */\ntype WithBundlerConfig = Pick<ExpoConfigWeb, 'bundler'> | undefined | null;\n\n/** Get the platform bundlers mapping. */\nexport function getPlatformBundlers(\n projectRoot: string,\n exp: Partial<ExpoConfig>\n): PlatformBundlers {\n /**\n * SDK 50+: The web bundler is dynamic based upon the presence of the `@expo/webpack-config` package.\n */\n let web = exp.web?.bundler;\n if (!web) {\n const resolved = resolveFrom.silent(projectRoot, '@expo/webpack-config/package.json');\n web = resolved ? 'webpack' : 'metro';\n }\n\n return {\n ios: (exp.ios as WithBundlerConfig)?.bundler ?? 'metro',\n android: (exp.android as WithBundlerConfig)?.bundler ?? 'metro',\n web,\n tvos: 'metro',\n macos: 'metro',\n };\n}\n"],"names":["getPlatformBundlers","projectRoot","exp","web","bundler","resolved","resolveFrom","silent","ios","android","tvos","macos"],"mappings":";;;;+BAUgBA;;;eAAAA;;;;gEATQ;;;;;;;;;;;AASjB,SAASA,oBACdC,WAAmB,EACnBC,GAAwB;QAKdA,UAOFA,UACIA;IAXZ;;GAEC,GACD,IAAIC,OAAMD,WAAAA,IAAIC,GAAG,qBAAPD,SAASE,OAAO;IAC1B,IAAI,CAACD,KAAK;QACR,MAAME,WAAWC,sBAAW,CAACC,MAAM,CAACN,aAAa;QACjDE,MAAME,WAAW,YAAY;IAC/B;IAEA,OAAO;QACLG,KAAK,EAACN,WAAAA,IAAIM,GAAG,qBAAR,AAACN,SAA+BE,OAAO,KAAI;QAChDK,SAAS,EAACP,eAAAA,IAAIO,OAAO,qBAAZ,AAACP,aAAmCE,OAAO,KAAI;QACxDD;QACAO,MAAM;QACNC,OAAO;IACT;AACF"}
@@ -26,7 +26,7 @@ class FetchClient {
26
26
  this.headers = {
27
27
  accept: 'application/json',
28
28
  'content-type': 'application/json',
29
- 'user-agent': `expo-cli/${"57.0.0"}`,
29
+ 'user-agent': `expo-cli/${"57.0.2"}`,
30
30
  authorization: 'Basic ' + _nodebuffer().Buffer.from(`${target}:`).toString('base64')
31
31
  };
32
32
  }
@@ -83,7 +83,7 @@ function createContext() {
83
83
  cpu: summarizeCpuInfo(),
84
84
  app: {
85
85
  name: 'expo/cli',
86
- version: "57.0.0"
86
+ version: "57.0.2"
87
87
  },
88
88
  ci: _ciinfo().isCI ? {
89
89
  name: _ciinfo().name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/cli",
3
- "version": "57.0.0",
3
+ "version": "57.0.2",
4
4
  "description": "The Expo CLI",
5
5
  "main": "main.js",
6
6
  "bin": {
@@ -39,23 +39,23 @@
39
39
  "homepage": "https://github.com/expo/expo/tree/main/packages/@expo/cli",
40
40
  "dependencies": {
41
41
  "@expo/code-signing-certificates": "^0.0.6",
42
- "@expo/config": "~57.0.0",
43
- "@expo/config-plugins": "~57.0.0",
42
+ "@expo/config": "~57.0.1",
43
+ "@expo/config-plugins": "~57.0.1",
44
44
  "@expo/devcert": "^1.2.1",
45
45
  "@expo/env": "~2.4.0",
46
46
  "@expo/image-utils": "^0.11.0",
47
- "@expo/inline-modules": "^0.1.0",
47
+ "@expo/inline-modules": "^0.1.1",
48
48
  "@expo/json-file": "^11.0.0",
49
49
  "@expo/log-box": "^57.0.0",
50
50
  "@expo/metro": "~56.0.0",
51
- "@expo/metro-config": "~57.0.0",
51
+ "@expo/metro-config": "~57.0.2",
52
52
  "@expo/metro-file-map": "^57.0.0",
53
53
  "@expo/osascript": "^2.7.0",
54
54
  "@expo/package-manager": "^1.13.0",
55
55
  "@expo/plist": "^0.8.0",
56
- "@expo/prebuild-config": "^57.0.0",
56
+ "@expo/prebuild-config": "^57.0.2",
57
57
  "@expo/require-utils": "^57.0.0",
58
- "@expo/router-server": "^57.0.0",
58
+ "@expo/router-server": "^57.0.1",
59
59
  "@expo/schema-utils": "^57.0.0",
60
60
  "@expo/spawn-async": "^1.8.0",
61
61
  "@expo/ws-tunnel": "^2.0.0",
@@ -156,13 +156,13 @@
156
156
  "playwright": "^1.59.0",
157
157
  "taskr": "^1.1.0",
158
158
  "tree-kill": "^1.2.2",
159
- "expo": "57.0.0-preview.0",
160
- "@expo/fingerprint": "0.20.0",
159
+ "@expo/fingerprint": "0.20.1",
161
160
  "expo-module-scripts": "56.0.3",
162
- "expo-modules-autolinking": "57.0.0",
163
- "expo-router": "57.0.0"
161
+ "expo": "57.0.0",
162
+ "expo-modules-autolinking": "57.0.2",
163
+ "expo-router": "57.0.2"
164
164
  },
165
- "gitHead": "e3eb896c5fdcd89e0cded98ff4e35c9db12cc9c0",
165
+ "gitHead": "ab82681fbcef61d5283c1938290ba5cfe42e9cfd",
166
166
  "scripts": {
167
167
  "build": "taskr",
168
168
  "clean": "expo-module clean",