@expo/cli 55.0.0-canary-20260119-70f7c28 → 55.0.0-canary-20260121-a63c0dd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bin/cli +1 -1
- package/build/src/export/exportStaticAsync.js +5 -4
- package/build/src/export/exportStaticAsync.js.map +1 -1
- package/build/src/prebuild/updatePackageJson.js +2 -2
- package/build/src/prebuild/updatePackageJson.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +18 -9
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/createServerRouteMiddleware.js +5 -2
- package/build/src/start/server/metro/createServerRouteMiddleware.js.map +1 -1
- package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
- package/build/src/utils/telemetry/utils/context.js +1 -1
- package/package.json +18 -18
|
@@ -67,7 +67,7 @@ function createRouteHandlerMiddleware(projectRoot, options) {
|
|
|
67
67
|
// In development, set `loader` property on all HTML routes. We can't know which routes
|
|
68
68
|
// have loaders without bundling via Metro to detect exports. In production, this is
|
|
69
69
|
// populated by `exportStaticAsync.ts` after bundling.
|
|
70
|
-
// At runtime, `getLoaderData()` returns
|
|
70
|
+
// At runtime, `getLoaderData()` returns a 404 response if no loader exists.
|
|
71
71
|
for (const route of manifest.htmlRoutes){
|
|
72
72
|
route.loader = `_expo/loaders${route.page}.js`;
|
|
73
73
|
}
|
|
@@ -200,7 +200,10 @@ function createRouteHandlerMiddleware(projectRoot, options) {
|
|
|
200
200
|
}
|
|
201
201
|
},
|
|
202
202
|
async getLoaderData (request, route) {
|
|
203
|
-
|
|
203
|
+
const response = await options.executeLoaderAsync(route, new (_private()).ImmutableRequest(request));
|
|
204
|
+
return response ?? new Response(null, {
|
|
205
|
+
status: 404
|
|
206
|
+
});
|
|
204
207
|
}
|
|
205
208
|
});
|
|
206
209
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/metro/createServerRouteMiddleware.ts"],"sourcesContent":["/**\n * Copyright © 2022 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport type { ProjectConfig } from '@expo/config';\nimport type { MiddlewareSettings } from 'expo-server';\nimport { createRequestHandler } from 'expo-server/adapter/http';\nimport { ImmutableRequest, type RouteInfo } from 'expo-server/private';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { fetchManifest } from './fetchRouterManifest';\nimport { getErrorOverlayHtmlAsync } from './metroErrorInterface';\nimport {\n warnInvalidWebOutput,\n warnInvalidMiddlewareOutput,\n warnInvalidMiddlewareMatcherSettings,\n} from './router';\nimport { CommandError } from '../../../utils/errors';\n\nconst debug = require('debug')('expo:start:server:metro') as typeof console.log;\n\nexport function createRouteHandlerMiddleware(\n projectRoot: string,\n options: {\n appDir: string;\n routerRoot: string;\n getStaticPageAsync: (\n pathname: string,\n route: RouteInfo<RegExp>,\n request?: ImmutableRequest\n ) => Promise<{ content: string }>;\n bundleApiRoute: (\n functionFilePath: string\n ) => Promise<null | Record<string, Function> | Response>;\n executeLoaderAsync: (\n route: RouteInfo<RegExp>,\n request: ImmutableRequest\n ) => Promise<{ data: unknown } | undefined>;\n config: ProjectConfig;\n headers: Record<string, string | string[]>;\n } & import('@expo/router-server/build/routes-manifest').Options\n) {\n if (!resolveFrom.silent(projectRoot, 'expo-router')) {\n throw new CommandError(\n `static and server rendering requires the expo-router package to be installed in your project. Either install the expo-router package or change 'web.output' to 'single' in your app.json.`\n );\n }\n\n return createRequestHandler(\n { build: '' },\n {\n async getRoutesManifest() {\n const manifest = await fetchManifest(projectRoot, options);\n debug('manifest', manifest);\n\n const { exp } = options.config;\n\n if (manifest && exp.extra?.router?.unstable_useServerDataLoaders === true) {\n // In development, set `loader` property on all HTML routes. We can't know which routes\n // have loaders without bundling via Metro to detect exports. In production, this is\n // populated by `exportStaticAsync.ts` after bundling.\n // At runtime, `getLoaderData()` returns `undefined` if no loader exists.\n for (const route of manifest.htmlRoutes) {\n route.loader = `_expo/loaders${route.page}.js`;\n }\n }\n\n // NOTE: no app dir if null\n // TODO: Redirect to 404 page\n return (\n manifest ?? {\n // Support the onboarding screen if there's no manifest\n htmlRoutes: [\n {\n file: 'index.js',\n page: '/index',\n routeKeys: {},\n namedRegex: /^\\/(?:index)?\\/?$/i,\n },\n ],\n apiRoutes: [],\n notFoundRoutes: [],\n redirects: [],\n rewrites: [],\n }\n );\n },\n async getHtml(request, route) {\n try {\n const { exp } = options.config;\n const isSSREnabled =\n exp.web?.output === 'server' && exp.extra?.router?.unstable_useServerRendering === true;\n\n const { content } = await options.getStaticPageAsync(\n request.url,\n route,\n isSSREnabled ? new ImmutableRequest(request) : undefined\n );\n return content;\n } catch (error: any) {\n // Forward the Metro server response as-is. It won't be pretty, but at least it will be accurate.\n\n try {\n return new Response(\n await getErrorOverlayHtmlAsync({\n error,\n projectRoot,\n routerRoot: options.routerRoot,\n }),\n {\n status: 500,\n headers: {\n 'Content-Type': 'text/html',\n },\n }\n );\n } catch (staticError: any) {\n debug('Failed to render static error overlay:', staticError);\n // Fallback error for when Expo Router is misconfigured in the project.\n return new Response(\n '<span><h3>Internal Error:</h3><b>Project is not setup correctly for static rendering (check terminal for more info):</b><br/>' +\n error.message +\n '<br/><br/>' +\n staticError.message +\n '</span>',\n {\n status: 500,\n headers: {\n 'Content-Type': 'text/html',\n },\n }\n );\n }\n }\n },\n async handleRouteError(error) {\n // NOTE(@kitten): ExpoError is currently not exposed by expo-server just yet\n if (error && typeof error === 'object' && error.name === 'ExpoError') {\n // TODO(@krystofwoldrich): Can we show code snippet of the handler?\n // NOTE(@krystofwoldrich): Removing stack since to avoid confusion. The error is not in the server code.\n delete error.stack;\n }\n\n const htmlServerError = await getErrorOverlayHtmlAsync({\n error,\n projectRoot,\n routerRoot: options.routerRoot!,\n });\n\n return new Response(htmlServerError, {\n status: 500,\n headers: {\n 'Content-Type': 'text/html',\n },\n });\n },\n async getApiRoute(route) {\n const { exp } = options.config;\n if (exp.web?.output !== 'server') {\n warnInvalidWebOutput();\n }\n\n // TODO(@kitten): Unify with MetroBundlerDevServer#exportExpoRouterApiRoutesAsync\n const resolvedFunctionPath = path.isAbsolute(route.file)\n ? route.file\n : path.join(options.appDir, route.file);\n try {\n debug(`Bundling API route at: ${resolvedFunctionPath}`);\n return await options.bundleApiRoute(resolvedFunctionPath!);\n } catch (error: any) {\n return new Response(\n 'Failed to load API Route: ' + resolvedFunctionPath + '\\n\\n' + error.message,\n {\n status: 500,\n headers: {\n 'Content-Type': 'text/html',\n },\n }\n );\n }\n },\n async getMiddleware(route) {\n const { exp } = options.config;\n\n if (!options.unstable_useServerMiddleware) {\n return {\n default: () => {\n throw new CommandError(\n 'Server middleware is not enabled. Add unstable_useServerMiddleware: true to your `expo-router` plugin config.'\n );\n },\n };\n }\n\n if (exp.web?.output !== 'server') {\n warnInvalidMiddlewareOutput();\n return {\n default: () => {\n console.warn(\n 'Server middleware is only supported when web.output is set to \"server\" in your app config'\n );\n },\n };\n }\n\n // TODO(@kitten): Unify with MetroBundlerDevServer#exportMiddlewareAsync\n const resolvedFunctionPath = path.isAbsolute(route.file)\n ? route.file\n : path.join(options.appDir, route.file);\n try {\n debug(`Bundling middleware at: ${resolvedFunctionPath}`);\n const middlewareModule = (await options.bundleApiRoute(resolvedFunctionPath!)) as any;\n\n if ((middlewareModule.unstable_settings as MiddlewareSettings)?.matcher) {\n warnInvalidMiddlewareMatcherSettings(middlewareModule.unstable_settings?.matcher);\n }\n\n return middlewareModule;\n } catch (error: any) {\n return new Response(\n 'Failed to load middleware: ' + resolvedFunctionPath + '\\n\\n' + error.message,\n {\n status: 500,\n headers: {\n 'Content-Type': 'text/html',\n },\n }\n );\n }\n },\n async getLoaderData(request, route) {\n return options.executeLoaderAsync(route, new ImmutableRequest(request));\n },\n }\n );\n}\n"],"names":["createRouteHandlerMiddleware","debug","require","projectRoot","options","resolveFrom","silent","CommandError","createRequestHandler","build","getRoutesManifest","exp","manifest","fetchManifest","config","extra","router","unstable_useServerDataLoaders","route","htmlRoutes","loader","page","file","routeKeys","namedRegex","apiRoutes","notFoundRoutes","redirects","rewrites","getHtml","request","isSSREnabled","web","output","unstable_useServerRendering","content","getStaticPageAsync","url","ImmutableRequest","undefined","error","Response","getErrorOverlayHtmlAsync","routerRoot","status","headers","staticError","message","handleRouteError","name","stack","htmlServerError","getApiRoute","warnInvalidWebOutput","resolvedFunctionPath","path","isAbsolute","join","appDir","bundleApiRoute","getMiddleware","unstable_useServerMiddleware","default","warnInvalidMiddlewareOutput","console","warn","middlewareModule","unstable_settings","matcher","warnInvalidMiddlewareMatcherSettings","getLoaderData","executeLoaderAsync"],"mappings":"AAAA;;;;;CAKC;;;;+BAoBeA;;;eAAAA;;;;yBAhBqB;;;;;;;yBACY;;;;;;;gEAChC;;;;;;;gEACO;;;;;;qCAEM;qCACW;wBAKlC;wBACsB;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAExB,SAASF,6BACdG,WAAmB,EACnBC,OAiB+D;IAE/D,IAAI,CAACC,sBAAW,CAACC,MAAM,CAACH,aAAa,gBAAgB;QACnD,MAAM,IAAII,oBAAY,CACpB,CAAC,yLAAyL,CAAC;IAE/L;IAEA,OAAOC,IAAAA,4BAAoB,EACzB;QAAEC,OAAO;IAAG,GACZ;QACE,MAAMC;gBAMYC,mBAAAA;YALhB,MAAMC,WAAW,MAAMC,IAAAA,kCAAa,EAACV,aAAaC;YAClDH,MAAM,YAAYW;YAElB,MAAM,EAAED,GAAG,EAAE,GAAGP,QAAQU,MAAM;YAE9B,IAAIF,YAAYD,EAAAA,aAAAA,IAAII,KAAK,sBAATJ,oBAAAA,WAAWK,MAAM,qBAAjBL,kBAAmBM,6BAA6B,MAAK,MAAM;gBACzE,uFAAuF;gBACvF,oFAAoF;gBACpF,sDAAsD;gBACtD,yEAAyE;gBACzE,KAAK,MAAMC,SAASN,SAASO,UAAU,CAAE;oBACvCD,MAAME,MAAM,GA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,IAAIqB,GAAG,qBAAPrB,SAASsB,MAAM,MAAK,UAAU;gBAChC8B,IAAAA,mCAA2B;gBAC3B,OAAO;oBACLD,SAAS;wBACPE,QAAQC,IAAI,CACV;oBAEJ;gBACF;YACF;YAEA,wEAAwE;YACxE,MAAMX,uBAAuBC,eAAI,CAACC,UAAU,CAACtC,MAAMI,IAAI,IACnDJ,MAAMI,IAAI,GACViC,eAAI,CAACE,IAAI,CAACrD,QAAQsD,MAAM,EAAExC,MAAMI,IAAI;YACxC,IAAI;oBAIG4C;gBAHLjE,MAAM,CAAC,wBAAwB,EAAEqD,sBAAsB;gBACvD,MAAMY,mBAAoB,MAAM9D,QAAQuD,cAAc,CAACL;gBAEvD,KAAKY,sCAAAA,iBAAiBC,iBAAiB,qBAAnC,AAACD,oCAA2DE,OAAO,EAAE;wBAClCF;oBAArCG,IAAAA,4CAAoC,GAACH,uCAAAA,iBAAiBC,iBAAiB,qBAAlCD,qCAAoCE,OAAO;gBAClF;gBAEA,OAAOF;YACT,EAAE,OAAO1B,OAAY;gBACnB,OAAO,IAAIC,SACT,gCAAgCa,uBAAuB,SAASd,MAAMO,OAAO,EAC7E;oBACEH,QAAQ;oBACRC,SAAS;wBACP,gBAAgB;oBAClB;gBACF;YAEJ;QACF;QACA,MAAMyB,eAAcxC,OAAO,EAAEZ,KAAK;YAChC,OAAOd,QAAQmE,kBAAkB,CAACrD,OAAO,IAAIoB,CAAAA,UAAe,kBAAC,CAACR;QAChE;IACF;AAEJ"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/metro/createServerRouteMiddleware.ts"],"sourcesContent":["/**\n * Copyright © 2022 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport type { ProjectConfig } from '@expo/config';\nimport type { MiddlewareSettings } from 'expo-server';\nimport { createRequestHandler } from 'expo-server/adapter/http';\nimport { ImmutableRequest, type RouteInfo } from 'expo-server/private';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { fetchManifest } from './fetchRouterManifest';\nimport { getErrorOverlayHtmlAsync } from './metroErrorInterface';\nimport {\n warnInvalidWebOutput,\n warnInvalidMiddlewareOutput,\n warnInvalidMiddlewareMatcherSettings,\n} from './router';\nimport { CommandError } from '../../../utils/errors';\n\nconst debug = require('debug')('expo:start:server:metro') as typeof console.log;\n\nexport function createRouteHandlerMiddleware(\n projectRoot: string,\n options: {\n appDir: string;\n routerRoot: string;\n getStaticPageAsync: (\n pathname: string,\n route: RouteInfo<RegExp>,\n request?: ImmutableRequest\n ) => Promise<{ content: string }>;\n bundleApiRoute: (\n functionFilePath: string\n ) => Promise<null | Record<string, Function> | Response>;\n executeLoaderAsync: (\n route: RouteInfo<RegExp>,\n request: ImmutableRequest\n ) => Promise<Response | undefined>;\n config: ProjectConfig;\n headers: Record<string, string | string[]>;\n } & import('@expo/router-server/build/routes-manifest').Options\n) {\n if (!resolveFrom.silent(projectRoot, 'expo-router')) {\n throw new CommandError(\n `static and server rendering requires the expo-router package to be installed in your project. Either install the expo-router package or change 'web.output' to 'single' in your app.json.`\n );\n }\n\n return createRequestHandler(\n { build: '' },\n {\n async getRoutesManifest() {\n const manifest = await fetchManifest(projectRoot, options);\n debug('manifest', manifest);\n\n const { exp } = options.config;\n\n if (manifest && exp.extra?.router?.unstable_useServerDataLoaders === true) {\n // In development, set `loader` property on all HTML routes. We can't know which routes\n // have loaders without bundling via Metro to detect exports. In production, this is\n // populated by `exportStaticAsync.ts` after bundling.\n // At runtime, `getLoaderData()` returns a 404 response if no loader exists.\n for (const route of manifest.htmlRoutes) {\n route.loader = `_expo/loaders${route.page}.js`;\n }\n }\n\n // NOTE: no app dir if null\n // TODO: Redirect to 404 page\n return (\n manifest ?? {\n // Support the onboarding screen if there's no manifest\n htmlRoutes: [\n {\n file: 'index.js',\n page: '/index',\n routeKeys: {},\n namedRegex: /^\\/(?:index)?\\/?$/i,\n },\n ],\n apiRoutes: [],\n notFoundRoutes: [],\n redirects: [],\n rewrites: [],\n }\n );\n },\n async getHtml(request, route) {\n try {\n const { exp } = options.config;\n const isSSREnabled =\n exp.web?.output === 'server' && exp.extra?.router?.unstable_useServerRendering === true;\n\n const { content } = await options.getStaticPageAsync(\n request.url,\n route,\n isSSREnabled ? new ImmutableRequest(request) : undefined\n );\n return content;\n } catch (error: any) {\n // Forward the Metro server response as-is. It won't be pretty, but at least it will be accurate.\n\n try {\n return new Response(\n await getErrorOverlayHtmlAsync({\n error,\n projectRoot,\n routerRoot: options.routerRoot,\n }),\n {\n status: 500,\n headers: {\n 'Content-Type': 'text/html',\n },\n }\n );\n } catch (staticError: any) {\n debug('Failed to render static error overlay:', staticError);\n // Fallback error for when Expo Router is misconfigured in the project.\n return new Response(\n '<span><h3>Internal Error:</h3><b>Project is not setup correctly for static rendering (check terminal for more info):</b><br/>' +\n error.message +\n '<br/><br/>' +\n staticError.message +\n '</span>',\n {\n status: 500,\n headers: {\n 'Content-Type': 'text/html',\n },\n }\n );\n }\n }\n },\n async handleRouteError(error) {\n // NOTE(@kitten): ExpoError is currently not exposed by expo-server just yet\n if (error && typeof error === 'object' && error.name === 'ExpoError') {\n // TODO(@krystofwoldrich): Can we show code snippet of the handler?\n // NOTE(@krystofwoldrich): Removing stack since to avoid confusion. The error is not in the server code.\n delete error.stack;\n }\n\n const htmlServerError = await getErrorOverlayHtmlAsync({\n error,\n projectRoot,\n routerRoot: options.routerRoot!,\n });\n\n return new Response(htmlServerError, {\n status: 500,\n headers: {\n 'Content-Type': 'text/html',\n },\n });\n },\n async getApiRoute(route) {\n const { exp } = options.config;\n if (exp.web?.output !== 'server') {\n warnInvalidWebOutput();\n }\n\n // TODO(@kitten): Unify with MetroBundlerDevServer#exportExpoRouterApiRoutesAsync\n const resolvedFunctionPath = path.isAbsolute(route.file)\n ? route.file\n : path.join(options.appDir, route.file);\n try {\n debug(`Bundling API route at: ${resolvedFunctionPath}`);\n return await options.bundleApiRoute(resolvedFunctionPath!);\n } catch (error: any) {\n return new Response(\n 'Failed to load API Route: ' + resolvedFunctionPath + '\\n\\n' + error.message,\n {\n status: 500,\n headers: {\n 'Content-Type': 'text/html',\n },\n }\n );\n }\n },\n async getMiddleware(route) {\n const { exp } = options.config;\n\n if (!options.unstable_useServerMiddleware) {\n return {\n default: () => {\n throw new CommandError(\n 'Server middleware is not enabled. Add unstable_useServerMiddleware: true to your `expo-router` plugin config.'\n );\n },\n };\n }\n\n if (exp.web?.output !== 'server') {\n warnInvalidMiddlewareOutput();\n return {\n default: () => {\n console.warn(\n 'Server middleware is only supported when web.output is set to \"server\" in your app config'\n );\n },\n };\n }\n\n // TODO(@kitten): Unify with MetroBundlerDevServer#exportMiddlewareAsync\n const resolvedFunctionPath = path.isAbsolute(route.file)\n ? route.file\n : path.join(options.appDir, route.file);\n try {\n debug(`Bundling middleware at: ${resolvedFunctionPath}`);\n const middlewareModule = (await options.bundleApiRoute(resolvedFunctionPath!)) as any;\n\n if ((middlewareModule.unstable_settings as MiddlewareSettings)?.matcher) {\n warnInvalidMiddlewareMatcherSettings(middlewareModule.unstable_settings?.matcher);\n }\n\n return middlewareModule;\n } catch (error: any) {\n return new Response(\n 'Failed to load middleware: ' + resolvedFunctionPath + '\\n\\n' + error.message,\n {\n status: 500,\n headers: {\n 'Content-Type': 'text/html',\n },\n }\n );\n }\n },\n async getLoaderData(request, route) {\n const response = await options.executeLoaderAsync(route, new ImmutableRequest(request));\n return response ?? new Response(null, { status: 404 });\n },\n }\n );\n}\n"],"names":["createRouteHandlerMiddleware","debug","require","projectRoot","options","resolveFrom","silent","CommandError","createRequestHandler","build","getRoutesManifest","exp","manifest","fetchManifest","config","extra","router","unstable_useServerDataLoaders","route","htmlRoutes","loader","page","file","routeKeys","namedRegex","apiRoutes","notFoundRoutes","redirects","rewrites","getHtml","request","isSSREnabled","web","output","unstable_useServerRendering","content","getStaticPageAsync","url","ImmutableRequest","undefined","error","Response","getErrorOverlayHtmlAsync","routerRoot","status","headers","staticError","message","handleRouteError","name","stack","htmlServerError","getApiRoute","warnInvalidWebOutput","resolvedFunctionPath","path","isAbsolute","join","appDir","bundleApiRoute","getMiddleware","unstable_useServerMiddleware","default","warnInvalidMiddlewareOutput","console","warn","middlewareModule","unstable_settings","matcher","warnInvalidMiddlewareMatcherSettings","getLoaderData","response","executeLoaderAsync"],"mappings":"AAAA;;;;;CAKC;;;;+BAoBeA;;;eAAAA;;;;yBAhBqB;;;;;;;yBACY;;;;;;;gEAChC;;;;;;;gEACO;;;;;;qCAEM;qCACW;wBAKlC;wBACsB;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAExB,SAASF,6BACdG,WAAmB,EACnBC,OAiB+D;IAE/D,IAAI,CAACC,sBAAW,CAACC,MAAM,CAACH,aAAa,gBAAgB;QACnD,MAAM,IAAII,oBAAY,CACpB,CAAC,yLAAyL,CAAC;IAE/L;IAEA,OAAOC,IAAAA,4BAAoB,EACzB;QAAEC,OAAO;IAAG,GACZ;QACE,MAAMC;gBAMYC,mBAAAA;YALhB,MAAMC,WAAW,MAAMC,IAAAA,kCAAa,EAACV,aAAaC;YAClDH,MAAM,YAAYW;YAElB,MAAM,EAAED,GAAG,EAAE,GAAGP,QAAQU,MAAM;YAE9B,IAAIF,YAAYD,EAAAA,aAAAA,IAAII,KAAK,sBAATJ,oBAAAA,WAAWK,MAAM,qBAAjBL,kBAAmBM,6BAA6B,MAAK,MAAM;gBACzE,uFAAuF;gBACvF,oFAAoF;gBACpF,sDAAsD;gBACtD,4EAA4E;gBAC5E,KAAK,MAAMC,SAASN,SAASO,UAAU,CAAE;oBACvCD,MAAME,MAAM,GAAG,CAAC,aAAa,EAAEF,MAAMG,IAAI,CAAC,GAAG,CAAC;gBAChD;YACF;YAEA,2BAA2B;YAC3B,6BAA6B;YAC7B,OACET,YAAY;gBACV,uDAAuD;gBACvDO,YAAY;oBACV;wBACEG,MAAM;wBACND,MAAM;wBACNE,WAAW,CAAC;wBACZC,YAAY;oBACd;iBACD;gBACDC,WAAW,EAAE;gBACbC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,GACViC,eAAI,CAACE,IAAI,CAACrD,QAAQsD,MAAM,EAAExC,MAAMI,IAAI;YACxC,IAAI;oBAIG4C;gBAHLjE,MAAM,CAAC,wBAAwB,EAAEqD,sBAAsB;gBACvD,MAAMY,mBAAoB,MAAM9D,QAAQuD,cAAc,CAACL;gBAEvD,KAAKY,sCAAAA,iBAAiBC,iBAAiB,qBAAnC,AAACD,oCAA2DE,OAAO,EAAE;wBAClCF;oBAArCG,IAAAA,4CAAoC,GAACH,uCAAAA,iBAAiBC,iBAAiB,qBAAlCD,qCAAoCE,OAAO;gBAClF;gBAEA,OAAOF;YACT,EAAE,OAAO1B,OAAY;gBACnB,OAAO,IAAIC,SACT,gCAAgCa,uBAAuB,SAASd,MAAMO,OAAO,EAC7E;oBACEH,QAAQ;oBACRC,SAAS;wBACP,gBAAgB;oBAClB;gBACF;YAEJ;QACF;QACA,MAAMyB,eAAcxC,OAAO,EAAEZ,KAAK;YAChC,MAAMqD,WAAW,MAAMnE,QAAQoE,kBAAkB,CAACtD,OAAO,IAAIoB,CAAAA,UAAe,kBAAC,CAACR;YAC9E,OAAOyC,YAAY,IAAI9B,SAAS,MAAM;gBAAEG,QAAQ;YAAI;QACtD;IACF;AAEJ"}
|
|
@@ -33,7 +33,7 @@ class FetchClient {
|
|
|
33
33
|
this.headers = {
|
|
34
34
|
accept: 'application/json',
|
|
35
35
|
'content-type': 'application/json',
|
|
36
|
-
'user-agent': `expo-cli/${"55.0.0-canary-
|
|
36
|
+
'user-agent': `expo-cli/${"55.0.0-canary-20260121-a63c0dd"}`,
|
|
37
37
|
authorization: 'Basic ' + _nodebuffer().Buffer.from(`${target}:`).toString('base64')
|
|
38
38
|
};
|
|
39
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/cli",
|
|
3
|
-
"version": "55.0.0-canary-
|
|
3
|
+
"version": "55.0.0-canary-20260121-a63c0dd",
|
|
4
4
|
"description": "The Expo CLI",
|
|
5
5
|
"main": "build/bin/cli",
|
|
6
6
|
"bin": {
|
|
@@ -43,21 +43,21 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@0no-co/graphql.web": "^1.0.8",
|
|
45
45
|
"@expo/code-signing-certificates": "^0.0.6",
|
|
46
|
-
"@expo/config": "12.0.14-canary-
|
|
47
|
-
"@expo/config-plugins": "54.1.0-canary-
|
|
46
|
+
"@expo/config": "12.0.14-canary-20260121-a63c0dd",
|
|
47
|
+
"@expo/config-plugins": "54.1.0-canary-20260121-a63c0dd",
|
|
48
48
|
"@expo/devcert": "^1.2.1",
|
|
49
|
-
"@expo/env": "2.0.9-canary-
|
|
50
|
-
"@expo/image-utils": "0.8.9-canary-
|
|
51
|
-
"@expo/json-file": "10.0.9-canary-
|
|
49
|
+
"@expo/env": "2.0.9-canary-20260121-a63c0dd",
|
|
50
|
+
"@expo/image-utils": "0.8.9-canary-20260121-a63c0dd",
|
|
51
|
+
"@expo/json-file": "10.0.9-canary-20260121-a63c0dd",
|
|
52
52
|
"@expo/metro": "~54.2.0",
|
|
53
|
-
"@expo/metro-config": "54.1.0-canary-
|
|
54
|
-
"@expo/osascript": "2.3.9-canary-
|
|
55
|
-
"@expo/package-manager": "1.9.11-canary-
|
|
56
|
-
"@expo/plist": "0.4.9-canary-
|
|
57
|
-
"@expo/prebuild-config": "55.0.0-canary-
|
|
58
|
-
"@expo/router-server": "0.2.0-canary-
|
|
59
|
-
"@expo/log-box": "0.0.13-canary-
|
|
60
|
-
"@expo/schema-utils": "0.1.9-canary-
|
|
53
|
+
"@expo/metro-config": "54.1.0-canary-20260121-a63c0dd",
|
|
54
|
+
"@expo/osascript": "2.3.9-canary-20260121-a63c0dd",
|
|
55
|
+
"@expo/package-manager": "1.9.11-canary-20260121-a63c0dd",
|
|
56
|
+
"@expo/plist": "0.4.9-canary-20260121-a63c0dd",
|
|
57
|
+
"@expo/prebuild-config": "55.0.0-canary-20260121-a63c0dd",
|
|
58
|
+
"@expo/router-server": "0.2.0-canary-20260121-a63c0dd",
|
|
59
|
+
"@expo/log-box": "0.0.13-canary-20260121-a63c0dd",
|
|
60
|
+
"@expo/schema-utils": "0.1.9-canary-20260121-a63c0dd",
|
|
61
61
|
"@expo/spawn-async": "^1.7.2",
|
|
62
62
|
"@expo/ws-tunnel": "^1.0.1",
|
|
63
63
|
"@expo/xcpretty": "^4.3.0",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"debug": "^4.3.4",
|
|
77
77
|
"dnssd-advertise": "^1.0.8",
|
|
78
78
|
"env-editor": "^0.4.1",
|
|
79
|
-
"expo-server": "1.1.0-canary-
|
|
79
|
+
"expo-server": "1.1.0-canary-20260121-a63c0dd",
|
|
80
80
|
"freeport-async": "^2.0.0",
|
|
81
81
|
"getenv": "^2.0.0",
|
|
82
82
|
"glob": "^13.0.0",
|
|
@@ -113,8 +113,8 @@
|
|
|
113
113
|
]
|
|
114
114
|
},
|
|
115
115
|
"peerDependencies": {
|
|
116
|
-
"expo": "55.0.0-canary-
|
|
117
|
-
"expo-router": "7.0.0-canary-
|
|
116
|
+
"expo": "55.0.0-canary-20260121-a63c0dd",
|
|
117
|
+
"expo-router": "7.0.0-canary-20260121-a63c0dd",
|
|
118
118
|
"react-native": "*"
|
|
119
119
|
},
|
|
120
120
|
"peerDependenciesMeta": {
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"@types/ws": "^8.5.4",
|
|
160
160
|
"devtools-protocol": "^0.0.1113120",
|
|
161
161
|
"expo-atlas": "^0.4.1",
|
|
162
|
-
"expo-module-scripts": "5.1.0-canary-
|
|
162
|
+
"expo-module-scripts": "5.1.0-canary-20260121-a63c0dd",
|
|
163
163
|
"find-process": "^1.4.7",
|
|
164
164
|
"jest-runner-tsd": "^6.0.0",
|
|
165
165
|
"klaw-sync": "^6.0.0",
|