first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

1
node_modules/expo-server/README.md generated vendored Normal file
View File

@@ -0,0 +1 @@
Server API for Expo Router projects

View File

@@ -0,0 +1,61 @@
/**
* Copyright © 2025 650 Industries.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @hidden */
export type _ImmutableHeaders = Omit<Headers, 'append' | 'delete' | 'set'>;
declare const ImmutableHeaders_base: {
new (init?: HeadersInit): Headers;
prototype: Headers;
};
/**
* An immutable version of the Fetch API's [`Headers`](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object which prevents mutations.
*/
export declare class ImmutableHeaders extends ImmutableHeaders_base {
#private;
set(): void;
append(): void;
delete(): void;
}
/** @hidden */
export type _ImmutableRequest = Omit<Request, 'body' | 'bodyUsed' | 'arrayBuffer' | 'blob' | 'formData' | 'json' | 'text' | 'bytes' | 'headers'> & {
headers: ImmutableHeaders;
};
/**
* An immutable version of the Fetch API's [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) object which prevents mutations to the request body and headers.
*/
export declare class ImmutableRequest implements _ImmutableRequest, RequestInit {
#private;
constructor(request: Request);
get cache(): RequestCache;
get credentials(): RequestCredentials;
get destination(): RequestDestination;
get integrity(): string;
get keepalive(): boolean;
get method(): string;
get mode(): RequestMode;
get redirect(): RequestRedirect;
get referrer(): string;
get referrerPolicy(): ReferrerPolicy;
get signal(): AbortSignal;
get url(): string;
get bodyUsed(): boolean;
get duplex(): "half" | undefined;
get headers(): ImmutableHeaders;
/** The request body is not accessible in immutable requests. */
get body(): never;
arrayBuffer(): Promise<void>;
blob(): Promise<void>;
bytes(): Promise<void>;
formData(): Promise<void>;
json(): Promise<void>;
text(): Promise<void>;
/**
* Creates a mutable clone of the original request. This is provided as an escape hatch.
*/
clone(): Request;
}
export declare function assertRuntimeFetchAPISupport({ Request, Response, Headers, process, }?: any): void;
export {};

160
node_modules/expo-server/build/cjs/ImmutableRequest.js generated vendored Normal file
View File

@@ -0,0 +1,160 @@
"use strict";
/**
* Copyright © 2025 650 Industries.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImmutableRequest = exports.ImmutableHeaders = void 0;
exports.assertRuntimeFetchAPISupport = assertRuntimeFetchAPISupport;
const getHeadersConstructor = () => {
if (typeof Headers !== 'undefined') {
return Headers;
}
else {
// NOTE(@kitten): The `assertRuntimeFetchAPISupport` helper will catch this. Currently only an issue in Jest
return (globalThis.Headers ??
class _MockHeaders {
constructor() {
throw new Error('Runtime built-in Headers API is not available.');
}
});
}
};
/**
* An immutable version of the Fetch API's [`Headers`](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object which prevents mutations.
*/
class ImmutableHeaders extends getHeadersConstructor() {
// TODO(@hassankhan): Merge with `ReadonlyHeaders` from `expo-router`
#throwImmutableError() {
throw new Error('This operation is not allowed on immutable headers.');
}
set() {
this.#throwImmutableError();
}
append() {
this.#throwImmutableError();
}
delete() {
this.#throwImmutableError();
}
}
exports.ImmutableHeaders = ImmutableHeaders;
/**
* An immutable version of the Fetch API's [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) object which prevents mutations to the request body and headers.
*/
class ImmutableRequest {
#headers;
#request;
constructor(request) {
this.#headers = new ImmutableHeaders(request.headers);
this.#request = request;
}
get cache() {
return this.#request.cache;
}
get credentials() {
return this.#request.credentials;
}
get destination() {
return this.#request.destination;
}
get integrity() {
return this.#request.integrity;
}
get keepalive() {
return this.#request.keepalive;
}
get method() {
return this.#request.method;
}
get mode() {
return this.#request.mode;
}
get redirect() {
return this.#request.redirect;
}
get referrer() {
return this.#request.referrer;
}
get referrerPolicy() {
return this.#request.referrerPolicy;
}
get signal() {
return this.#request.signal;
}
get url() {
return this.#request.url;
}
get bodyUsed() {
return this.#request.bodyUsed;
}
get duplex() {
return this.#request.duplex;
}
get headers() {
return this.#headers;
}
#throwImmutableBodyError() {
throw new Error('This operation is not allowed on immutable requests.');
}
/** The request body is not accessible in immutable requests. */
get body() {
// NOTE(@kitten): `new Request(req.url, req)` may internally access `req.body` to copy the request
// We can pretend it is `null`. Marking `bodyUsed` makes no sense here as it manipulates the subsequent
// code paths, but pretending there was no body should be safe
return null;
}
async arrayBuffer() {
this.#throwImmutableBodyError();
}
async blob() {
this.#throwImmutableBodyError();
}
async bytes() {
this.#throwImmutableBodyError();
}
async formData() {
this.#throwImmutableBodyError();
}
async json() {
this.#throwImmutableBodyError();
}
async text() {
this.#throwImmutableBodyError();
}
/**
* Creates a mutable clone of the original request. This is provided as an escape hatch.
*/
clone() {
return this.#request.clone();
}
}
exports.ImmutableRequest = ImmutableRequest;
// Add assertions to improve usage in non-standard environments.
function assertRuntimeFetchAPISupport({ Request, Response, Headers, process, } = globalThis) {
// Check if Request and Response are available.
if (typeof Request === 'undefined' ||
typeof Response === 'undefined' ||
typeof Headers === 'undefined') {
// Detect if `--no-experimental-fetch` flag is enabled and warn that it must be disabled.
if (typeof process !== 'undefined' && process.env && process.env.NODE_OPTIONS) {
const nodeOptions = process.env.NODE_OPTIONS;
if (nodeOptions.includes('--no-experimental-fetch')) {
throw new Error('NODE_OPTIONS="--no-experimental-fetch" is not supported with Expo server. Node.js built-in Request/Response APIs are required to continue.');
}
}
// If Node.js is <18, throw an error.
if (typeof process !== 'undefined' && process.version) {
const version = process.version;
const majorVersion = parseInt(version.replace(/v/g, '').split('.')[0], 10);
if (majorVersion < 18) {
throw new Error(`Node.js version ${majorVersion} is not supported. Upgrade to Node.js 20 or newer.`);
}
}
// Default error event for missing APIs.
throw new Error('Runtime built-in Request/Response/Headers APIs are not available. If running Node ensure that Node Fetch API, first available in Node.js 18, is enabled.');
}
}
//# sourceMappingURL=ImmutableRequest.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ImmutableRequest.js","sourceRoot":"","sources":["../../src/ImmutableRequest.ts"],"names":[],"mappings":";AAAA;;;;;GAK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AAC;gBACtB,MAAM,IAAI,KAAK,CACb,mBAAmB,YAAY,oDAAoD,CACpF,CAAC;YACJ,CAAC;QACH,CAAC;QAED,wCAAwC;QACxC,MAAM,IAAI,KAAK,CACb,0JAA0J,CAC3J,CAAC;IACJ,CAAC;AACH,CAAC"}

13
node_modules/expo-server/build/cjs/global.types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,13 @@
declare global {
interface RequestInit {
duplex?: 'half';
}
interface Request {
duplex?: 'half';
}
interface Response {
cf?: unknown;
webSocket?: unknown;
}
}
export {};

3
node_modules/expo-server/build/cjs/global.types.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=global.types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"global.types.js","sourceRoot":"","sources":["../../src/global.types.ts"],"names":[],"mappings":""}

2
node_modules/expo-server/build/cjs/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export * from './runtime/api';
export type * from './types';

18
node_modules/expo-server/build/cjs/index.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./runtime/api"), exports);
//# sourceMappingURL=index.js.map

1
node_modules/expo-server/build/cjs/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B"}

108
node_modules/expo-server/build/cjs/manifest.d.ts generated vendored Normal file
View File

@@ -0,0 +1,108 @@
/**
* Asset manifest for client hydration bundles.
*
* {@link import('@expo/router-server/src/static/renderStaticContent').GetStaticContentOptions}
*/
export interface AssetInfo {
css: string[];
js: string[];
}
/**
* Rendering configuration. Discriminated union supporting multiple rendering modes.
*/
export type RenderingConfiguration = RenderingConfigurationForSSR;
/**
* Configuration for server-side rendering (SSR). HTML is rendered at runtime on each request.
*/
export interface RenderingConfigurationForSSR {
mode: 'ssr';
/** Path to the SSR render module, typically `_expo/server/render.js` */
file: string;
}
export interface MiddlewareInfo {
/**
* Path to the module that contains the middleware function as a default export.
*
* @example _expo/functions/+middleware.js
*/
file: string;
}
export interface RouteInfo<TRegex = RegExp | string> {
file: string;
page: string;
/**
* Regex for matching a path against the route.
* The regex is normalized for named matchers so keys must be looked up against the `routeKeys` object to collect the original route param names.
* Regex matching alone cannot accurately route to a file, the order in which routes are matched is equally important to ensure correct priority.
*/
namedRegex: TRegex;
/**
* Keys are route param names that have been normalized for a regex named-matcher, values are the original route param names.
*/
routeKeys: Record<string, string>;
/** Indicates that the route was generated and does not map to any file in the project's routes directory. */
generated?: boolean;
/** Indicates that this is a redirect that should use 301 instead of 307 */
permanent?: boolean;
/** If a redirect, which methods are allowed. Undefined represents all methods */
methods?: string[];
/** Path to the loader module for this route, typically `_expo/loaders/[ROUTE].js`. When present, the loader should be executed before rendering. */
loader?: string;
/** Per-route async chunk assets. Merged with top-level `assets` at serve time. */
assets?: AssetInfo;
}
export interface RoutesManifest<TRegex = RegExp | string> {
/**
* Middleware function that runs before any route matching.
* Only allowed at the root level and requires web.output: "server".
*/
middleware?: MiddlewareInfo;
/**
* Headers to be applied to all responses from the server.
*/
headers?: Record<string, string | string[]>;
/**
* Routes that are matched after HTML routes and invoke WinterCG-compliant functions.
*/
apiRoutes: RouteInfo<TRegex>[];
/**
* Routes that return static HTML files for a given path.
* These are only matched against requests with method `GET` and `HEAD`.
*/
htmlRoutes: RouteInfo<TRegex>[];
/**
* List of routes that are matched last and return with status code 404.
*/
notFoundRoutes: RouteInfo<TRegex>[];
/**
* List of routes that match second. Returns 301 and redirects to another path.
*/
redirects: RouteInfo<TRegex>[];
/**
* Rewrites. After middleware has processed and regular routing resumes, these occur first.
*/
rewrites: RouteInfo<TRegex>[];
/**
* CSS/JS assets. Used for client hydration in SSR mode.
*/
assets?: AssetInfo;
/**
* Rendering configuration. Determines how HTML is generated.
* When present, HTML routes are rendered at runtime instead of being served from pre-rendered files.
*/
rendering?: RenderingConfiguration;
}
export type RawManifest = RoutesManifest<string>;
export type Manifest = RoutesManifest<RegExp>;
export type Route = RouteInfo<RegExp>;
/**
* @type {import('@expo/router-server/src/static/renderStaticContent').GetStaticContentOptions}
*/
export interface GetStaticContentOptions {
loader?: {
data?: unknown;
key: string;
};
request?: Request;
assets?: AssetInfo;
}

3
node_modules/expo-server/build/cjs/manifest.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=manifest.js.map

1
node_modules/expo-server/build/cjs/manifest.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/manifest.ts"],"names":[],"mappings":""}

36
node_modules/expo-server/build/cjs/middleware/rsc.d.ts generated vendored Normal file
View File

@@ -0,0 +1,36 @@
/**
* Copyright © 2024 650 Industries.
* Copyright © 2024 dai-shi.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* https://github.com/dai-shi/waku/blob/f9111ed7d96c95d7e128b37e8f7ae2d80122218e/packages/waku/src/lib/middleware/rsc.ts#L1
*/
type ResolvedConfig = any;
export type RenderRscArgs = {
config: ResolvedConfig;
input: string;
searchParams: URLSearchParams;
platform: string;
engine?: 'hermes' | null;
method: 'GET' | 'POST';
body?: ReadableStream | null;
contentType?: string | undefined;
decodedBody?: unknown;
moduleIdCallback?: ((id: string) => void) | undefined;
onError?: (err: unknown) => void;
headers: Record<string, string>;
};
export declare const decodeInput: (encodedInput: string) => string;
export declare function getRscMiddleware(options: {
config: ResolvedConfig;
baseUrl: string;
rscPath: string;
renderRsc: (args: RenderRscArgs) => Promise<ReadableStream<any>>;
onError?: (err: unknown) => void;
}): {
GET: (req: Request) => Promise<Response>;
POST: (req: Request) => Promise<Response>;
};
export {};

124
node_modules/expo-server/build/cjs/middleware/rsc.js generated vendored Normal file
View File

@@ -0,0 +1,124 @@
"use strict";
/**
* Copyright © 2024 650 Industries.
* Copyright © 2024 dai-shi.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* https://github.com/dai-shi/waku/blob/f9111ed7d96c95d7e128b37e8f7ae2d80122218e/packages/waku/src/lib/middleware/rsc.ts#L1
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.decodeInput = void 0;
exports.getRscMiddleware = getRscMiddleware;
const decodeInput = (encodedInput) => {
if (encodedInput === 'index.txt') {
return '';
}
if (encodedInput?.endsWith('.txt')) {
return encodedInput.slice(0, -'.txt'.length);
}
const err = new Error('Invalid encoded input');
err.statusCode = 400;
throw err;
};
exports.decodeInput = decodeInput;
// Production / Development API Route for handling RSC. Must be applied to the RSC paths, e.g. `/_flight/[...slug]+api.tsx`
function getRscMiddleware(options) {
let rscPathPrefix = options.rscPath;
if (rscPathPrefix !== '/' && !rscPathPrefix.endsWith('/')) {
rscPathPrefix += '/';
}
async function getOrPostAsync(req) {
const url = new URL(req.url);
const { method } = req;
if (method !== 'GET' && method !== 'POST') {
throw new Error(`Unsupported method '${method}'`);
}
const platform = url.searchParams.get('platform') ?? req.headers.get('expo-platform');
if (typeof platform !== 'string' || !platform) {
return new Response('Missing expo-platform header or platform query parameter', {
status: 500,
headers: {
'Content-Type': 'text/plain',
},
});
}
const engine = url.searchParams.get('transform.engine');
// TODO: Will the hermes flag apply in production later?
if (engine && !['hermes'].includes(engine)) {
return new Response(`Query parameter "transform.engine" is an unsupported value: ${engine}`, {
status: 500,
headers: {
'Content-Type': 'text/plain',
},
});
}
let encodedInput = url.pathname.replace(
// TODO: baseUrl support
rscPathPrefix, '');
// First segment should be the target platform.
// This is used for aligning with production exports which are statically exported to a single location at build-time.
encodedInput = encodedInput.replace(new RegExp(`^${platform}/`), '');
try {
encodedInput = (0, exports.decodeInput)(encodedInput);
}
catch {
return new Response(`Invalid encoded input: "${encodedInput}"`, {
status: 400,
headers: {
'Content-Type': 'text/plain',
},
});
}
try {
const args = {
config: options.config,
platform,
engine: engine,
input: encodedInput,
searchParams: url.searchParams,
method,
body: req.body,
contentType: req.headers.get('Content-Type') ?? '',
decodedBody: req.headers.get('X-Expo-Params'),
onError: options.onError,
headers: headersToRecord(req.headers),
};
const readable = await options.renderRsc(args);
return new Response(readable, {
headers: {
// The response is a streamed text file
'Content-Type': 'text/plain',
},
});
}
catch (err) {
if (err instanceof Response) {
return err;
}
if (process.env.NODE_ENV !== 'development') {
throw err;
}
console.error(err);
return new Response(`Unexpected server error rendering RSC: ` + err.message, {
status: 'statusCode' in err ? err.statusCode : 500,
headers: {
'Content-Type': 'text/plain',
},
});
}
}
return {
GET: getOrPostAsync,
POST: getOrPostAsync,
};
}
function headersToRecord(headers) {
const record = {};
for (const [key, value] of headers.entries()) {
record[key] = value;
}
return record;
}
//# sourceMappingURL=rsc.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"rsc.js","sourceRoot":"","sources":["../../../src/middleware/rsc.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAgCH,4CA6GC;AA1HM,MAAM,WAAW,GAAG,CAAC,YAAoB,EAAE,EAAE;IAClD,IAAI,YAAY,KAAK,WAAW,EAAE,CAAC;QACjC,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACnC,OAAO,YAAY,CAAC,KAAK,CA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YACF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAE/C,OAAO,IAAI,QAAQ,CAAC,QAAQ,EAAE;gBAC5B,OAAO,EAAE;oBACP,uCAAuC;oBACvC,cAAc,EAAE,YAAY;iBAC7B;aACF,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;gBAC5B,OAAO,GAAG,CAAC;YACb,CAAC;YACD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;gBAC3C,MAAM,GAAG,CAAC;YACZ,CAAC;YACD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAEnB,OAAO,IAAI,QAAQ,CAAC,yCAAyC,GAAG,GAAG,CAAC,OAAO,EAAE;gBAC3E,MAAM,EAAE,YAAY,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG;gBAClD,OAAO,EAAE;oBACP,cAAc,EAAE,YAAY;iBAC7B;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO;QACL,GAAG,EAAE,cAAc;QACnB,IAAI,EAAE,cAAc;KACrB,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,OAAgB;IACvC,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QAC7C,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACtB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}

4
node_modules/expo-server/build/cjs/private.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export { ImmutableRequest } from './ImmutableRequest';
export { type RenderRscArgs, getRscMiddleware } from './middleware/rsc';
export { resolveLoaderContextKey } from './utils/matchers';
export type * from './manifest';

10
node_modules/expo-server/build/cjs/private.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveLoaderContextKey = exports.getRscMiddleware = exports.ImmutableRequest = void 0;
var ImmutableRequest_1 = require("./ImmutableRequest");
Object.defineProperty(exports, "ImmutableRequest", { enumerable: true, get: function () { return ImmutableRequest_1.ImmutableRequest; } });
var rsc_1 = require("./middleware/rsc");
Object.defineProperty(exports, "getRscMiddleware", { enumerable: true, get: function () { return rsc_1.getRscMiddleware; } });
var matchers_1 = require("./utils/matchers");
Object.defineProperty(exports, "resolveLoaderContextKey", { enumerable: true, get: function () { return matchers_1.resolveLoaderContextKey; } });
//# sourceMappingURL=private.js.map

1
node_modules/expo-server/build/cjs/private.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"private.js","sourceRoot":"","sources":["../../src/private.ts"],"names":[],"mappings":";;;AAAA,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,wCAAwE;AAA3C,uGAAA,gBAAgB,OAAA;AAC7C,6CAA2D;AAAlD,mHAAA,uBAAuB,OAAA"}

23
node_modules/expo-server/build/cjs/rendering.d.ts generated vendored Normal file
View File

@@ -0,0 +1,23 @@
import { type ImmutableRequest } from './ImmutableRequest';
import type { AssetInfo, GetStaticContentOptions } from './manifest';
/**
* The SSR render module exported from `_expo/server/render.js`.
*
* {@link import('@expo/router-server/src/static/renderStaticContent')}
*/
export interface ServerRenderModule {
/** {@link import('@expo/router-server/src/static/renderStaticContent').getStaticContent} */
getStaticContent(location: URL, options?: GetStaticContentOptions): Promise<string>;
}
export interface RenderOptions {
loader?: {
data: unknown;
key: string;
};
assets?: AssetInfo;
}
export type SsrRenderFn = (request: Request, options?: RenderOptions) => Promise<string>;
/** Module exported from loader bundle, typically `_expo/loaders/[ROUTE].js` */
export interface LoaderModule {
loader(request: ImmutableRequest | undefined, params: Record<string, string>): Promise<unknown> | unknown;
}

3
node_modules/expo-server/build/cjs/rendering.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=rendering.js.map

1
node_modules/expo-server/build/cjs/rendering.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"rendering.js","sourceRoot":"","sources":["../../src/rendering.ts"],"names":[],"mappings":""}

51
node_modules/expo-server/build/cjs/runtime/api.d.ts generated vendored Normal file
View File

@@ -0,0 +1,51 @@
import { ImmutableHeaders } from '../ImmutableRequest';
export { StatusError } from './error';
/** Returns the current request's URL.
*
* This typically returns the request's URL, or on certain platform,
* the origin of the request. This does not use the `Origin` header
* in development as it may contain an untrusted value.
* @returns A request origin
*/
export declare function origin(): string | null;
/** Returns an immutable copy of the current request's headers. */
export declare function requestHeaders(): ImmutableHeaders;
/** Returns the request's environment, if the server runtime supports this.
*
* In EAS Hosting, the returned environment name is the
* [alias or deployment identifier](https://docs.expo.dev/eas/hosting/deployments-and-aliases/),
* but the value may differ for other providers.
*
* @returns A request environment name, or `null` for production.
*/
export declare function environment(): string | null;
/** Runs a task immediately and instructs the runtime to complete the task.
*
* A request handler may be terminated as soon as the client has finished the full `Response`
* and unhandled promise rejections may not be logged properly. To run tasks concurrently to
* a request handler and keep the request alive until the task is completed, pass a task
* function to `runTask` instead. The request handler will be kept alive until the task
* completes.
*
* @param fn - A task function to execute. The request handler will be kept alive until this task finishes.
*/
export declare function runTask(fn: () => Promise<unknown>): void;
/** Defers a task until after a response has been sent.
*
* This only calls the task function once the request handler has finished resolving a `Response`
* and keeps the request handler alive until the task is completed. This is useful to run non-critical
* tasks after the request handler, for example to log analytics datapoints. If the request handler
* rejects with an error, deferred tasks won't be executed.
*
* @param fn - A task function to execute after the request handler has finished.
*/
export declare function deferTask(fn: () => Promise<unknown> | void): void;
/** Sets headers on the `Response` the current request handler will return.
*
* This only updates the headers once the request handler has finished and resolved a `Response`.
* It will either receive a set of `Headers` or an equivalent object containing headers, which will
* be merged into the response's headers once it's returned.
*
* @param updateHeaders - A `Headers` object, a record of headers, or a function that receives `Headers` to be updated or can return a `Headers` object that will be merged into the response headers.
*/
export declare function setResponseHeaders(updateHeaders: Headers | Record<string, string | string[]> | ((headers: Headers) => Headers | void)): void;

92
node_modules/expo-server/build/cjs/runtime/api.js generated vendored Normal file
View File

@@ -0,0 +1,92 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StatusError = void 0;
exports.origin = origin;
exports.requestHeaders = requestHeaders;
exports.environment = environment;
exports.runTask = runTask;
exports.deferTask = deferTask;
exports.setResponseHeaders = setResponseHeaders;
const ImmutableRequest_1 = require("../ImmutableRequest");
const scope_1 = require("./scope");
function enforcedRequestScope() {
const scope = scope_1.scopeRef.current?.getStore();
if (scope === undefined) {
throw new Error('Invalid server runtime API call. Runtime APIs can only be called during ongoing requests.\n' +
'- You may be calling this API in the global scope.\n' +
'- You might be calling this API outside of a promise scoped to a request.\n' +
'- You might have more than one copy of this API installed.');
}
return scope;
}
function assertSupport(name, v) {
if (v === undefined) {
throw new Error(`Unsupported server runtime API call: ${name}. This API is not supported in your current environment.`);
}
return v;
}
var error_1 = require("./error");
Object.defineProperty(exports, "StatusError", { enumerable: true, get: function () { return error_1.StatusError; } });
/** Returns the current request's URL.
*
* This typically returns the request's URL, or on certain platform,
* the origin of the request. This does not use the `Origin` header
* in development as it may contain an untrusted value.
* @returns A request origin
*/
function origin() {
return assertSupport('origin()', enforcedRequestScope().origin);
}
/** Returns an immutable copy of the current request's headers. */
function requestHeaders() {
const headers = assertSupport('requestHeaders', enforcedRequestScope().requestHeaders);
return new ImmutableRequest_1.ImmutableHeaders(headers);
}
/** Returns the request's environment, if the server runtime supports this.
*
* In EAS Hosting, the returned environment name is the
* [alias or deployment identifier](https://docs.expo.dev/eas/hosting/deployments-and-aliases/),
* but the value may differ for other providers.
*
* @returns A request environment name, or `null` for production.
*/
function environment() {
return assertSupport('environment()', enforcedRequestScope().environment);
}
/** Runs a task immediately and instructs the runtime to complete the task.
*
* A request handler may be terminated as soon as the client has finished the full `Response`
* and unhandled promise rejections may not be logged properly. To run tasks concurrently to
* a request handler and keep the request alive until the task is completed, pass a task
* function to `runTask` instead. The request handler will be kept alive until the task
* completes.
*
* @param fn - A task function to execute. The request handler will be kept alive until this task finishes.
*/
function runTask(fn) {
assertSupport('runTask()', enforcedRequestScope().waitUntil)(fn());
}
/** Defers a task until after a response has been sent.
*
* This only calls the task function once the request handler has finished resolving a `Response`
* and keeps the request handler alive until the task is completed. This is useful to run non-critical
* tasks after the request handler, for example to log analytics datapoints. If the request handler
* rejects with an error, deferred tasks won't be executed.
*
* @param fn - A task function to execute after the request handler has finished.
*/
function deferTask(fn) {
assertSupport('deferTask()', enforcedRequestScope().deferTask)(fn);
}
/** Sets headers on the `Response` the current request handler will return.
*
* This only updates the headers once the request handler has finished and resolved a `Response`.
* It will either receive a set of `Headers` or an equivalent object containing headers, which will
* be merged into the response's headers once it's returned.
*
* @param updateHeaders - A `Headers` object, a record of headers, or a function that receives `Headers` to be updated or can return a `Headers` object that will be merged into the response headers.
*/
function setResponseHeaders(updateHeaders) {
assertSupport('setResponseHeaders()', enforcedRequestScope().setResponseHeaders)(updateHeaders);
}
//# sourceMappingURL=api.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/runtime/api.ts"],"names":[],"mappings":";;;AAkCA,wBAEC;AAGD,wCAGC;AAUD,kCAEC;AAYD,0BAEC;AAWD,8BAEC;AAUD,gDAOC;AAlGD,0DAAuD;AACvD,mCAAoD;AAEpD,SAAS,oBAAoB;IAC3B,MAAM,KAAK,GAAG,gBAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;IAC3C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,6FAA6F;YAC3F,sDAAsD;YACtD,6EAA6E;YAC7E,4DAA4D,CAC/D,CAAC;IACJ,CAAC;IACD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error response representation which can be thrown anywhere in server-side code.
*
* A `StatusError` can be thrown by a request handler and will be caught by the `expo-server`
* runtime and replaced by a `Response` with the `status` and `body` that's been passed to
* the `StatusError`.
*
* @example
* ```ts
* import { StatusError } from 'expo-server';
*
* export function GET(request, { postId }) {
* if (!postId) {
* throw new StatusError(400, 'postId parameter is required');
* }
* }
* ```
*/
export declare class StatusError extends Error {
status: number;
body: string;
constructor(status?: number, body?: {
error?: string;
[key: string]: any;
} | Error | string);
constructor(status?: number, errorOptions?: {
cause: unknown;
error?: string;
});
constructor(status?: number, body?: {
error?: string;
[key: string]: any;
} | Error | string, errorOptions?: {
cause?: unknown;
});
}
export declare function errorToResponse(error: Error): Response;

86
node_modules/expo-server/build/cjs/runtime/error.js generated vendored Normal file
View File

@@ -0,0 +1,86 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StatusError = void 0;
exports.errorToResponse = errorToResponse;
/** An error response representation which can be thrown anywhere in server-side code.
*
* A `StatusError` can be thrown by a request handler and will be caught by the `expo-server`
* runtime and replaced by a `Response` with the `status` and `body` that's been passed to
* the `StatusError`.
*
* @example
* ```ts
* import { StatusError } from 'expo-server';
*
* export function GET(request, { postId }) {
* if (!postId) {
* throw new StatusError(400, 'postId parameter is required');
* }
* }
* ```
*/
class StatusError extends Error {
status;
body;
constructor(status = 500, body, errorOptions) {
const cause = (errorOptions != null && errorOptions.cause) ??
(body != null && typeof body === 'object' && body.cause != null ? body.cause : undefined);
let message = typeof body === 'object' ? (body instanceof Error ? body.message : body.error) : body;
if (message == null) {
switch (status) {
case 400:
message = 'Bad Request';
break;
case 401:
message = 'Unauthorized';
break;
case 403:
message = 'Forbidden';
break;
case 404:
message = 'Not Found';
break;
case 500:
message = 'Internal Server Error';
break;
default:
message = 'Unknown Error';
}
}
super(message, cause ? { cause } : undefined);
this.name = 'StatusError';
this.status = status;
if (body instanceof Error) {
this.body = JSON.stringify({ error: body.message }, null, 2);
}
else {
this.body =
typeof body === 'object'
? JSON.stringify(body, null, 2)
: (body ?? JSON.stringify({ error: message }, null, 2));
}
}
}
exports.StatusError = StatusError;
function errorToResponse(error) {
if (error instanceof StatusError) {
return new Response(error.body, {
status: error.status,
headers: {
'Content-Type': 'application/json; charset=utf-8',
},
});
}
else if ('status' in error && typeof error.status === 'number') {
const body = 'body' in error && typeof error.body === 'string'
? error.body
: JSON.stringify({ error: error.message }, null, 2);
return new Response(body, {
status: error.status,
});
}
else {
return new Response(`${error}`, { status: 500 });
}
}
//# sourceMappingURL=error.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../src/runtime/error.ts"],"names":[],"mappings":";;;AAyEA,0CAmBC;AA5FD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,WAAY,SAAQ,KAAK;IACpC,MAAM,CAAS;IACf,IAAI,CAAS;IASb,YACE,MAAM,GAAG,GAAG,EACZ,IAA+E,EAC/E,YAAkC;QAElC,MAAM,KAAK,GACT,CAAC,YAAY,IAAI,IAAI,IAAI,YAAY,CAAC,KAAK,CAAC;YAC5C,CAAC,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC5F,IAAI,OAAO,GACT,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,YAAY,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACxF,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YACpB,QAAQ,MAAM,EAAE,CAAC;gBACf,KAAK,GAAG;oBACN,OAAO,GAAG,aAAa,CAAC;oBACxB,MAAM;gBACR,KAAK,GAAG;oBACN,OAAO,GAAG,cAAc,CAAC;oBACzB,MAAM;gBACR,KAAK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AAK,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QACjE,MAAM,IAAI,GACR,MAAM,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;YAC/C,CAAC,CAAC,KAAK,CAAC,IAAI;YACZ,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACxD,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE;YACxB,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,QAAQ,CAAC,GAAG,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IACnD,CAAC;AACH,CAAC"}

11
node_modules/expo-server/build/cjs/runtime/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
import { type ScopeDefinition, type RequestAPI } from './scope';
export interface RequestAPISetup extends RequestAPI {
origin?: string | null;
environment?: string | null;
requestHeaders?: Headers;
waitUntil?(promise: Promise<unknown>): void;
}
type RequestContextFactory = (...args: any[]) => Partial<RequestAPISetup>;
type RequestScopeRunner<F extends RequestContextFactory> = (fn: (...args: Parameters<F>) => Promise<Response>, ...args: Parameters<F>) => Promise<Response>;
export declare function createRequestScope<F extends RequestContextFactory>(scopeDefinition: ScopeDefinition, makeRequestAPISetup: F): RequestScopeRunner<F>;
export {};

126
node_modules/expo-server/build/cjs/runtime/index.js generated vendored Normal file
View File

@@ -0,0 +1,126 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createRequestScope = createRequestScope;
const error_1 = require("./error");
const scope_1 = require("./scope");
const importMetaRegistry_1 = require("../utils/importMetaRegistry");
function setupRuntime() {
try {
Object.defineProperty(globalThis, 'origin', {
enumerable: true,
configurable: true,
get() {
// NOTE(@kitten): By convention, this property must be a string, and runtimes typically
// choose to stringify "null" when the value is not available
return scope_1.scopeRef.current?.getStore()?.origin ?? 'null';
},
});
}
catch { }
try {
Object.defineProperty(globalThis, '__ExpoImportMetaRegistry', {
enumerable: true,
configurable: true,
get() {
return importMetaRegistry_1.importMetaRegistry;
},
});
}
catch { }
}
function createRequestScope(scopeDefinition, makeRequestAPISetup) {
setupRuntime();
// NOTE(@kitten): For long-running servers, this will always be a noop. It therefore
// makes sense for us to provide a default that doesn't do anything.
function defaultWaitUntil(promise) {
promise.finally(() => { });
}
return async (run, ...args) => {
// Initialize the scope definition which is used to isolate the runtime API between
// requests. The implementation of scopes differs per runtime, and is only initialized
// once the first request is received
scope_1.scopeRef.current = scopeDefinition;
const setup = makeRequestAPISetup(...args);
const { waitUntil = defaultWaitUntil } = setup;
const deferredTasks = [];
const responseHeadersUpdates = [];
const scope = {
...setup,
origin: setup.origin,
environment: setup.environment,
requestHeaders: setup.requestHeaders,
waitUntil,
deferTask: setup.deferTask,
setResponseHeaders(updateHeaders) {
responseHeadersUpdates.push(updateHeaders);
},
};
if (!scope.deferTask) {
scope.deferTask = function deferTask(fn) {
deferredTasks.push(fn);
};
}
let result;
try {
result =
scope_1.scopeRef.current != null
? await scope_1.scopeRef.current.run(scope, () => run(...args))
: await run(...args);
}
catch (error) {
if (error != null && error instanceof Response && !error.bodyUsed) {
result = error;
}
else if (error != null && error instanceof Error && 'status' in error) {
return (0, error_1.errorToResponse)(error);
}
else {
throw error;
}
}
// Recreate the response with mutable headers, since the original response
// may have an immutable headers guard (like from `Response.redirect()`)
result = new Response(result.body, {
...result,
status: result.status,
statusText: result.statusText,
headers: result.headers,
// Cloudflare-specific response properties
cf: result.cf,
webSocket: result.webSocket,
});
deferredTasks.forEach((fn) => {
const maybePromise = fn();
if (maybePromise != null)
waitUntil(maybePromise);
});
for (const updateHeaders of responseHeadersUpdates) {
let headers = result.headers;
if (typeof updateHeaders === 'function') {
headers = updateHeaders(result.headers) || headers;
}
else if (updateHeaders instanceof Headers) {
headers = updateHeaders;
}
else if (typeof updateHeaders === 'object' && updateHeaders) {
for (const headerName in updateHeaders) {
if (Array.isArray(updateHeaders[headerName])) {
for (const headerValue of updateHeaders[headerName]) {
headers.append(headerName, headerValue);
}
}
else if (updateHeaders[headerName] != null) {
headers.set(headerName, updateHeaders[headerName]);
}
}
}
if (headers !== result.headers) {
for (const [headerName, headerValue] of headers) {
result.headers.set(headerName, headerValue);
}
}
}
return result;
};
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/index.ts"],"names":[],"mappings":";;AAyCA,gDAoGC;AA7ID,mCAA0C;AAC1C,mCAAiG;AACjG,oEAAiE;AASjE,SAAS,YAAY;IACnB,IAAI,CAAC;QACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,QAAQ,EAAE;YAC1C,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,IAAI;YAClB,GAAG;gBACD,uFAAuF;gBACvF,6DAA6D;gBAC7D,OAAO,gBAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,MAAM,IAAI,MAAM,CAAC;YACxD,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,IAAI,CAAC;QACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,0BAA0B,EAAE;YAC5D,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,IAAI;YAClB,GAAG;gBACD,OAAO,uCAAkB,CAAC;YAC5B,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;AACZ,CAAC;AASD,SAAgB,kBAAkB,CAChC,eAAgC,EAChC,mBAAsB;IAEtB,YAAY,EAAE,CAAC;IAEf,oFAAoF;IACpF,oEAAoE;IACpE,SAAS,gBAAgB,CAAC,OAAyB;QACjD,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,K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vC,IAAI,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;wBAC7C,KAAK,MAAM,WAAW,IAAI,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC;4BACpD,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;wBAC1C,CAAC;oBACH,CAAC;yBAAM,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,IAAI,EAAE,CAAC;wBAC7C,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;oBACrD,CAAC;gBACH,CAAC;YACH,CAAC;YACD,IAAI,OAAO,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC;gBAC/B,KAAK,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,IAAI,OAAO,EAAE,CAAC;oBAChD,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;gBAC9C,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}

18
node_modules/expo-server/build/cjs/runtime/scope.d.ts generated vendored Normal file
View File

@@ -0,0 +1,18 @@
export type UpdateResponseHeaders = Headers | Record<string, string | string[]> | ((headers: Headers) => Headers | void);
export interface RequestAPI {
origin?: string | null;
environment?: string | null;
requestHeaders?: Headers;
waitUntil?(promise: Promise<unknown>): void;
deferTask?(fn: () => Promise<unknown> | void): void;
setResponseHeaders?(updateHeaders: UpdateResponseHeaders): void;
}
export interface ScopeDefinition<Scope extends RequestAPI = any> {
getStore(): Scope | undefined;
run<R>(scope: Scope, runner: () => R): R;
run<R, TArgs extends any[]>(scope: Scope, runner: (...args: TArgs) => R, ...args: TArgs): R;
}
declare const scopeRef: {
current: ScopeDefinition<RequestAPI> | null;
};
export { scopeRef };

12
node_modules/expo-server/build/cjs/runtime/scope.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.scopeRef = void 0;
// NOTE(@kitten): When multiple versions of `@expo/server` are bundled, we still want to reuse the same scope definition
const scopeSymbol = Symbol.for('expoServerRuntime');
const sharedScope = globalThis;
const scopeRef = sharedScope[scopeSymbol] ||
(sharedScope[scopeSymbol] = {
current: null,
});
exports.scopeRef = scopeRef;
//# sourceMappingURL=scope.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../src/runtime/scope.ts"],"names":[],"mappings":";;;AAoBA,wHAAwH;AACxH,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AACpD,MAAM,WAAW,GACf,UAAU,CAAC;AAEb,MAAM,QAAQ,GACZ,WAAW,CAAC,WAAW,CAAC;IACxB,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG;QAC1B,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;AAEI,4BAAQ"}

84
node_modules/expo-server/build/cjs/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,84 @@
import type { _ImmutableHeaders, _ImmutableRequest } from './ImmutableRequest';
/**
* An immutable version of the Fetch API's `Headers` object. It cannot be mutated or modified.
*/
export interface ImmutableHeaders extends _ImmutableHeaders {
}
/**
* An immutable version of the Fetch API's `Request` object. It cannot be mutated or modified, its
* headers are immutable, and you won't have access to the request body.
*/
export interface ImmutableRequest extends _ImmutableRequest {
readonly url: string;
readonly method: string;
}
/**
* Middleware function type. Middleware run for every request in your app, or on
* specified conditionally matched methods and path patterns, as per {@link MiddlewareMatcher}.
* @param request - An `ImmutableRequest` with read-only headers and no body access
* @example
* ```ts
* import type { MiddlewareFunction } from 'expo-server';
*
* const middleware: MiddlewareFunction = async (request) => {
* console.log(`Middleware executed for: ${request.url}`);
* };
*
* export default middleware;
* ```
* @see [Server middleware](https://docs.expo.dev/router/web/middleware/) for more information.
*/
export type MiddlewareFunction = (request: ImmutableRequest) => Promise<Response | void> | Response | void;
/** Middleware matcher settings that restricts the middleware to run conditionally. */
export interface MiddlewareMatcher {
/** Set this to a list of path patterns to conditionally run middleware on. This may be exact paths,
* paths containing parameter or catch-all segments (`'/posts/[postId]'` or `'/blog/[...slug]'`), or
* regular expressions matching paths.
* @example ['/api', '/posts/[id]', '/blog/[...slug]']
*/
patterns?: (string | RegExp)[];
/** Set this to a list of HTTP methods to conditionally run middleware on. By default, middleware will
* match all HTTP methods.
* @example ['POST', 'PUT', 'DELETE']
*/
methods?: string[];
}
/** Exported from a `+middleware.ts` file to configure the server-side middleware function.
* @example
* ```ts
* import type { MiddlewareSettings } from 'expo-server';
*
* export const unstable_settings: MiddlewareSettings = {
* matcher: {
* methods: ['GET'],
* patterns: ['/api', '/admin/[...path]'],
* },
* };
* ```
* @see https://docs.expo.dev/router/reference/middleware/
*/
export interface MiddlewareSettings {
/** Matcher definition that restricts the middleware to run conditionally. */
matcher?: MiddlewareMatcher;
}
/**
* Function type for route loaders. Loaders are executed on the server during
* SSR/SSG to fetch data required by a route.
*
* During SSG (Static Site Generation), the `request` parameter will be `undefined`
* as there is no HTTP request at build time.
*
* @param request - An `ImmutableRequest` with read-only headers and no body access. In SSG, this is `undefined`
* @param params - Route parameters extracted from the URL path
* @example
* ```ts
* import type { LoaderFunction } from 'expo-server';
*
* export const loader: LoaderFunction = async (request, params) => {
* const data = await fetchData(params.id);
* return { data };
* };
* ```
* @see [Data loaders](/router/web/data-loaders) for more information.
*/
export type LoaderFunction<T = any> = (request: ImmutableRequest | undefined, params: Record<string, string | string[]>) => Promise<T> | T;

3
node_modules/expo-server/build/cjs/types.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map

1
node_modules/expo-server/build/cjs/types.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,15 @@
/**
* Copyright © 2025 650 Industries.
* Copyright (c) Remix Software Inc. 2020-2021
* Copyright (c) Shopify Inc. 2022-2024
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* Original license https://github.com/remix-run/remix/blob/6d6caaed5dfc436242962dcb2ff9617757a11e17/LICENSE.md
* Code from https://github.com/remix-run/remix/blob/6d6caaed5dfc436242962dcb2ff9617757a11e17/packages/remix-node/stream.ts#L66
*/
import type { Readable } from 'node:stream';
export declare const createReadableStreamFromReadable: (source: Readable & {
readableHighWaterMark?: number;
}) => ReadableStream<Uint8Array<ArrayBufferLike>>;

View File

@@ -0,0 +1,97 @@
"use strict";
/**
* Copyright © 2025 650 Industries.
* Copyright (c) Remix Software Inc. 2020-2021
* Copyright (c) Shopify Inc. 2022-2024
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* Original license https://github.com/remix-run/remix/blob/6d6caaed5dfc436242962dcb2ff9617757a11e17/LICENSE.md
* Code from https://github.com/remix-run/remix/blob/6d6caaed5dfc436242962dcb2ff9617757a11e17/packages/remix-node/stream.ts#L66
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.createReadableStreamFromReadable = void 0;
const node_stream_1 = require("node:stream");
const createReadableStreamFromReadable = (source) => {
const pump = new StreamPump(source);
const stream = new ReadableStream(pump, pump);
return stream;
};
exports.createReadableStreamFromReadable = createReadableStreamFromReadable;
class StreamPump {
highWaterMark;
accumalatedSize;
stream;
controller;
constructor(stream) {
this.highWaterMark =
stream.readableHighWaterMark || new node_stream_1.Stream.Readable().readableHighWaterMark;
this.accumalatedSize = 0;
this.stream = stream;
this.enqueue = this.enqueue.bind(this);
this.error = this.error.bind(this);
this.close = this.close.bind(this);
}
size(chunk) {
return chunk?.byteLength || 0;
}
start(controller) {
this.controller = controller;
this.stream.on('data', this.enqueue);
this.stream.once('error', this.error);
this.stream.once('end', this.close);
this.stream.once('close', this.close);
}
pull() {
this.resume();
}
cancel(reason) {
if (this.stream.destroy) {
this.stream.destroy(reason);
}
this.stream.off('data', this.enqueue);
this.stream.off('error', this.error);
this.stream.off('end', this.close);
this.stream.off('close', this.close);
}
enqueue(chunk) {
if (this.controller) {
try {
const bytes = chunk instanceof Uint8Array ? chunk : Buffer.from(chunk);
const available = (this.controller.desiredSize || 0) - bytes.byteLength;
this.controller.enqueue(bytes);
if (available <= 0) {
this.pause();
}
}
catch {
this.controller.error(new Error('Could not create Buffer, chunk must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object'));
this.cancel();
}
}
}
pause() {
if (this.stream.pause) {
this.stream.pause();
}
}
resume() {
if (this.stream.readable && this.stream.resume) {
this.stream.resume();
}
}
close() {
if (this.controller) {
this.controller.close();
delete this.controller;
}
}
error(error) {
if (this.controller) {
this.controller.error(error);
delete this.controller;
}
}
}
//# sourceMappingURL=createReadableStreamFromReadable.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"createReadableStreamFromReadable.js","sourceRoot":"","sources":["../../../src/utils/createReadableStreamFromReadable.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAGH,6CAAqC;AAE9B,MAAM,gCAAgC,GAAG,CAC9C,MAAqD,EACrD,EAAE;IACF,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AANW,QAAA,gCAAgC,oCAM3C;AAEF,MAAM,UAAU;IACP,aAAa,CAAS;IACtB,eAAe,CAAS;IACvB,MAAM,CAMZ;IACM,UAAU,CAAwC;IAE1D,YACE,MAMC;QAED,IAAI,CAAC,aAAa;YAChB,MAAM,CAAC,qBAAqB,IAAI,IAAI,oBAAM,CAAC,QAAQ,EAAE,CAAC,qBAAqB,CAAC;QAC9E,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,M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H,CAAC;IAED,KAAK,CAAC,KAAY;QAChB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC7B,OAAO,IAAI,CAAC,UAAU,CAAC;QACzB,CAAC;IACH,CAAC;CACF"}

View File

@@ -0,0 +1 @@
export declare const appendHeadersRecord: (headers: Headers, updateHeaders: Record<string, string | string[]>, shouldOverwrite: boolean) => void;

20
node_modules/expo-server/build/cjs/utils/headers.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.appendHeadersRecord = void 0;
const appendHeadersRecord = (headers, updateHeaders, shouldOverwrite) => {
for (const headerName in updateHeaders) {
if (Array.isArray(updateHeaders[headerName])) {
for (const headerValue of updateHeaders[headerName]) {
headers.append(headerName, headerValue);
}
}
else if (!shouldOverwrite && headers.has(headerName)) {
continue;
}
else if (updateHeaders[headerName] != null) {
headers.set(headerName, updateHeaders[headerName]);
}
}
};
exports.appendHeadersRecord = appendHeadersRecord;
//# sourceMappingURL=headers.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"headers.js","sourceRoot":"","sources":["../../../src/utils/headers.ts"],"names":[],"mappings":";;;AAAO,MAAM,mBAAmB,GAAG,CACjC,OAAgB,EAChB,aAAgD,EAChD,eAAwB,EAClB,EAAE;IACR,KAAK,MAAM,UAAU,IAAI,aAAa,EAAE,CAAC;QACvC,IAAI,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;YAC7C,KAAK,MAAM,WAAW,IAAI,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC;gBACpD,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;YAC1C,CAAC;QACH,CAAC;aAAM,IAAI,CAAC,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YACvD,SAAS;QACX,CAAC;aAAM,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,IAAI,EAAE,CAAC;YAC7C,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAhBW,QAAA,mBAAmB,uBAgB9B"}

View File

@@ -0,0 +1,3 @@
export declare const importMetaRegistry: {
readonly url: string;
};

View File

@@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.importMetaRegistry = void 0;
const DEFAULT_SCRIPT_NAME = 'file:///__main.js';
const REGEXP_REPLACE_SLASHES = /\\/g;
const WIN32_PATH_REGEXP = /^[a-zA-Z]:[/\\]/;
// - ./runtime/importMetaRegistry.ts (this file) -> importMetaRegistry.url
// - ./runtime/index.ts -> globalThis.__ExpoImportMetaRegistry
// - <source>
const CALL_DEPTH = 3;
function getFileName(offset = 0) {
const originalStackFormatter = Error.prepareStackTrace;
const originalStackTraceLimit = Error.stackTraceLimit;
try {
Error.stackTraceLimit = offset;
Error.prepareStackTrace = (_err, stack) => stack[offset - 1]?.getFileName();
return new Error().stack;
}
finally {
Error.prepareStackTrace = originalStackFormatter;
Error.stackTraceLimit = originalStackTraceLimit;
}
}
/**
* Convert any platform-specific path to a POSIX path.
*/
function toPosixPath(filePath) {
return filePath.replace(REGEXP_REPLACE_SLASHES, '/');
}
exports.importMetaRegistry = {
get url() {
let scriptName = getFileName(CALL_DEPTH);
if (scriptName) {
if (scriptName[0] === '/') {
scriptName = `file://${scriptName}`;
}
else if (WIN32_PATH_REGEXP.test(scriptName)) {
scriptName = `file:///${scriptName}`;
}
}
return toPosixPath(scriptName || DEFAULT_SCRIPT_NAME);
},
};
//# sourceMappingURL=importMetaRegistry.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"importMetaRegistry.js","sourceRoot":"","sources":["../../../src/utils/importMetaRegistry.ts"],"names":[],"mappings":";;;AAAA,MAAM,mBA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C,UAAU,IAAI,mBAAmB,CAAC,CAAC;IACxD,CAAC;CACF,CAAC"}

24
node_modules/expo-server/build/cjs/utils/matchers.d.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
import type { Route } from '../manifest';
export declare function isResponse(input: unknown): input is Response;
export declare function parseParams(request: Request, route: Route): Record<string, string>;
/**
* Resolves a route's context key into a concrete path by substituting dynamic segments
* with actual param values.
*
* @example
* ```tsx
* resolveLoaderContextKey('/users/[id]`, { id: '123' }) // /users/123
* ```
*
* @see import('expo-router/src/utils/matchers').getSingularId
*/
export declare function resolveLoaderContextKey(contextKey: string, params: Record<string, string | string[]>): string;
export declare function getRedirectRewriteLocation(url: URL, request: Request, route: Route): URL;
/** Match `[page]` -> `page`
* @privateRemarks Ported from `expo-router/src/matchers.tsx`
*/
export declare function matchDynamicName(name: string): string | undefined;
/** Match `[...page]` -> `page`
* @privateRemarks Ported from `expo-router/src/matchers.tsx`
*/
export declare function matchDeepDynamicRouteName(name: string): string | undefined;

112
node_modules/expo-server/build/cjs/utils/matchers.js generated vendored Normal file
View File

@@ -0,0 +1,112 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isResponse = isResponse;
exports.parseParams = parseParams;
exports.resolveLoaderContextKey = resolveLoaderContextKey;
exports.getRedirectRewriteLocation = getRedirectRewriteLocation;
exports.matchDynamicName = matchDynamicName;
exports.matchDeepDynamicRouteName = matchDeepDynamicRouteName;
function isResponse(input) {
return !!input && typeof input === 'object' && input instanceof Response;
}
function parseParams(request, route) {
const params = {};
const { pathname } = new URL(request.url);
const match = route.namedRegex.exec(pathname);
if (match?.groups) {
for (const [key, value] of Object.entries(match.groups)) {
const namedKey = route.routeKeys[key];
params[namedKey] = value;
}
}
return params;
}
/**
* Resolves a route's context key into a concrete path by substituting dynamic segments
* with actual param values.
*
* @example
* ```tsx
* resolveLoaderContextKey('/users/[id]`, { id: '123' }) // /users/123
* ```
*
* @see import('expo-router/src/utils/matchers').getSingularId
*/
function resolveLoaderContextKey(contextKey, params) {
const normalizedKey = contextKey.startsWith('/') ? contextKey.slice(1) : contextKey;
// TODO(@hassankhan): Extract this logic into its own function and share with getRedirectRewriteLocation() below
const resolved = normalizedKey
.split('/')
.map((segment) => {
let match;
if ((match = matchDeepDynamicRouteName(segment))) {
const value = params[match];
if (value == null)
return segment;
return Array.isArray(value) ? value.join('/') : value;
}
if ((match = matchDynamicName(segment))) {
const value = params[match];
if (value == null)
return segment;
return Array.isArray(value) ? value.join('/') : value;
}
return segment;
})
.join('/');
return `/${resolved}`;
}
function getRedirectRewriteLocation(url, request, route) {
const originalQueryParams = url.searchParams.entries();
const params = parseParams(request, route);
const target = route.page
.split('/')
.map((segment) => {
let match;
if ((match = matchDynamicName(segment))) {
const value = params[match];
delete params[match];
return typeof value === 'string'
? value.split('/')[0] /* If we are redirecting from a catch-all route, we need to remove the extra segments */
: (value ?? segment);
}
else if ((match = matchDeepDynamicRouteName(segment))) {
const value = params[match];
delete params[match];
return value ?? segment;
}
else {
return segment;
}
})
.join('/');
const targetUrl = new URL(target, url.origin);
// NOTE: React Navigation doesn't differentiate between a path parameter
// and a search parameter. We have to preserve leftover search parameters
// to ensure we don't lose any intentional parameters with special meaning
for (const key in params)
targetUrl.searchParams.append(key, params[key]);
// NOTE(@krystofwoldrich): Query matching is not supported at the moment.
// Copy original query parameters to the target URL
for (const [key, value] of originalQueryParams) {
// NOTE(@krystofwoldrich): Params created from route overwrite existing (might be unexpected to the user)
if (!targetUrl.searchParams.has(key)) {
targetUrl.searchParams.append(key, value);
}
}
return targetUrl;
}
/** Match `[page]` -> `page`
* @privateRemarks Ported from `expo-router/src/matchers.tsx`
*/
function matchDynamicName(name) {
// Don't match `...` or `[` or `]` inside the brackets
return name.match(/^\[([^[\](?:\.\.\.)]+?)\]$/)?.[1]; // eslint-disable-line no-useless-escape
}
/** Match `[...page]` -> `page`
* @privateRemarks Ported from `expo-router/src/matchers.tsx`
*/
function matchDeepDynamicRouteName(name) {
return name.match(/^\[\.\.\.([^/]+?)\]$/)?.[1];
}
//# sourceMappingURL=matchers.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"matchers.js","sourceRoot":"","sources":["../../../src/utils/matchers.ts"],"names":[],"mappings":";;AAEA,gCAEC;AAED,kCAWC;AAaD,0DAyBC;AAED,gEAyCC;AAKD,4CAGC;AAKD,8DAEC;AA/GD,SAAgB,UAAU,CAAC,KAAc;IACvC,OAAO,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,QAAQ,CAAC;AAC3E,CAAC;AAED,SAAgB,WAAW,CAAC,OAAgB,EAAE,KAAY;IACxD,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,KAAK,EAAE,MAAM,EAAE,CAAC;QAClB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YACxD,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YACtC,MAAM,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;QAC3B,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,uBAAuB,CACrC,UAAkB,EAClB,MAAyC;IAEzC,MAAM,aAAa,GAAG,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IACpF,gHAAgH;IAChH,MAAM,QAAQ,GAAG,aAAa;SAC3B,KAAK,CAAC,GAAG,CAAC;SAC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ACH,SAAgB,gBAAgB,CAAC,IAAY;IAC3C,sDAAsD;IACtD,OAAO,IAAI,CAAC,KAAK,CAAC,4BAA4B,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,wCAAwC;AAChG,CAAC;AAED;;GAEG;AACH,SAAgB,yBAAyB,CAAC,IAAY;IACpD,OAAO,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC"}

View File

@@ -0,0 +1,9 @@
import type { MiddlewareFunction, MiddlewareSettings } from '../types';
export interface MiddlewareModule {
default: MiddlewareFunction;
unstable_settings?: MiddlewareSettings;
}
/**
* Determines whether middleware should run for a given request based on matcher configuration.
*/
export declare function shouldRunMiddleware(request: Request, middleware: MiddlewareModule): boolean;

82
node_modules/expo-server/build/cjs/utils/middleware.js generated vendored Normal file
View File

@@ -0,0 +1,82 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.shouldRunMiddleware = shouldRunMiddleware;
const matchers_1 = require("./matchers");
/**
* Determines whether middleware should run for a given request based on matcher configuration.
*/
function shouldRunMiddleware(request, middleware) {
const matcher = middleware.unstable_settings?.matcher;
// No matcher means middleware runs on all requests
if (!matcher) {
return true;
}
const url = new URL(request.url);
const pathname = url.pathname;
// Check HTTP methods, if specified
if (matcher.methods) {
const methods = matcher.methods.map((method) => method.toUpperCase());
if (methods.length === 0 || !methods.includes(request.method)) {
return false;
}
}
// Check path patterns, if specified
if (matcher.patterns) {
const patterns = Array.isArray(matcher.patterns) ? matcher.patterns : [matcher.patterns];
if (patterns.length === 0) {
return false;
}
return patterns.some((pattern) => matchesPattern(pathname, pattern));
}
// If neither methods nor patterns are specified, run middleware on all requests
return true;
}
/**
* Tests if a pathname matches a given pattern. The matching order is as follows:
*
* - Exact string
* - Named parameters (supports `[param]` and `[...param]`)
* - Regular expression
*/
function matchesPattern(pathname, pattern) {
if (typeof pattern === 'string') {
if (pattern === pathname) {
return true;
}
if (hasNamedParameters(pattern)) {
return namedParamToRegex(pattern).test(pathname);
}
}
else if (pattern != null) {
return pattern.test(pathname);
}
return false;
}
/**
* Check if a pattern contains named parameters like `[postId]` or `[...slug]`
*/
function hasNamedParameters(pattern) {
return pattern.split('/').some((segment) => {
return (0, matchers_1.matchDynamicName)(segment) || (0, matchers_1.matchDeepDynamicRouteName)(segment);
});
}
/**
* Convert a pattern with named parameters to regex
*/
function namedParamToRegex(pattern) {
const normalizedPattern = pattern.replace(/\/$/, '') || '/';
const segments = normalizedPattern.split('/');
const regexSegments = segments.map((segment) => {
if (!segment)
return '';
if ((0, matchers_1.matchDeepDynamicRouteName)(segment)) {
return '.+';
}
if ((0, matchers_1.matchDynamicName)(segment)) {
return '[^/]+';
}
return segment.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
});
return new RegExp(`^${regexSegments.join('/')}(?:/)?$`);
}
//# sourceMappingURL=middleware.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../src/utils/middleware.ts"],"names":[],"mappings":";;AAWA,kDA8BC;AAxCD,yCAAyE;AAOzE;;GAEG;AACH,SAAgB,mBAAmB,CAAC,OAAgB,EAAE,UAA4B;IAChF,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,EAAE,OAAO,CAAC;IAEtD,mDAAmD;IACnD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IAE9B,mCAAmC;IACnC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QACtE,IAAI,OAAO,CAAC,MAAM,KAAK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QACzC,OAAO,IAAA,2BAAgB,EAAC,OAAO,CAAC,IAAI,IAAA,oCAAyB,EAAC,OAAO,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,OAAe;IACxC,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC;IAC5D,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9C,MAAM,aAAa,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7C,IAAI,CAAC,OAAO;YAAE,OAAO,EAAE,CAAC;QAExB,IAAI,IAAA,oCAAyB,EAAC,OAAO,CAAC,EAAE,CAAC;YACvC,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,IAAA,2BAAgB,EAAC,OAAO,CAAC,EAAE,CAAC;YAC9B,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,OAAO,OAAO,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,MAAM,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAC1D,CAAC"}

View File

@@ -0,0 +1,42 @@
import type { Manifest, MiddlewareInfo, Route } from '../manifest';
import { MiddlewareModule } from '../utils/middleware';
/** Internal errors class to indicate that the server has failed
* @remarks
* This should be thrown for unexpected errors, so they show up as crashes.
* Typically malformed project structure, missing manifest, html or other files.
*/
export declare class ExpoError extends Error {
constructor(message: string);
static isExpoError(error: unknown): error is ExpoError;
}
type ResponseInitLike = Omit<ResponseInit, 'headers'> & {
headers: Headers;
cf?: unknown;
webSocket?: unknown;
};
type CallbackRouteType = 'html' | 'api' | 'notFoundHtml' | 'notAllowedApi';
type CallbackRoute = (Route & {
type: CallbackRouteType;
}) | {
type: null;
};
type BeforeResponseCallback = (responseInit: ResponseInitLike, route: CallbackRoute) => ResponseInitLike;
export interface RequestHandlerParams {
/** Before handler response 4XX, not before unhandled error */
beforeErrorResponse?: BeforeResponseCallback;
/** Before handler responses */
beforeResponse?: BeforeResponseCallback;
/** Before handler HTML responses, not before 404 HTML */
beforeHTMLResponse?: BeforeResponseCallback;
/** Before handler API responses */
beforeAPIResponse?: BeforeResponseCallback;
}
export interface RequestHandlerInput {
getHtml(request: Request, route: Route): Promise<string | Response | null>;
getRoutesManifest(): Promise<Manifest | null>;
getApiRoute(route: Route): Promise<any>;
getMiddleware(route: MiddlewareInfo): Promise<MiddlewareModule>;
getLoaderData(request: Request, route: Route): Promise<Response>;
}
export declare function createRequestHandler({ getRoutesManifest, getHtml, getApiRoute, getMiddleware, getLoaderData, beforeErrorResponse, beforeResponse, beforeHTMLResponse, beforeAPIResponse, }: RequestHandlerParams & RequestHandlerInput): (request: Request) => Promise<Response>;
export {};

260
node_modules/expo-server/build/cjs/vendor/abstract.js generated vendored Normal file
View File

@@ -0,0 +1,260 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExpoError = void 0;
exports.createRequestHandler = createRequestHandler;
const ImmutableRequest_1 = require("../ImmutableRequest");
const matchers_1 = require("../utils/matchers");
const middleware_1 = require("../utils/middleware");
/** Internal errors class to indicate that the server has failed
* @remarks
* This should be thrown for unexpected errors, so they show up as crashes.
* Typically malformed project structure, missing manifest, html or other files.
*/
class ExpoError extends Error {
constructor(message) {
super(message);
this.name = 'ExpoError';
}
static isExpoError(error) {
return !!error && error instanceof ExpoError;
}
}
exports.ExpoError = ExpoError;
function noopBeforeResponse(responseInit, _route) {
return responseInit;
}
function createRequestHandler({ getRoutesManifest, getHtml, getApiRoute, getMiddleware, getLoaderData, beforeErrorResponse = noopBeforeResponse, beforeResponse = noopBeforeResponse, beforeHTMLResponse = noopBeforeResponse, beforeAPIResponse = noopBeforeResponse, }) {
let manifest = null;
return async function handler(request) {
manifest = await getRoutesManifest();
return requestHandler(request, manifest);
};
async function requestHandler(incomingRequest, manifest) {
if (!manifest) {
// NOTE(@EvanBacon): Development error when Expo Router is not setup.
// NOTE(@kitten): If the manifest is not found, we treat this as
// an SSG deployment and do nothing
return createResponse(null, null, 'Not found', {
status: 404,
headers: new Headers({
'Content-Type': 'text/plain',
}),
});
}
let request = incomingRequest;
let url = new URL(request.url);
if (manifest.middleware) {
const middleware = await getMiddleware(manifest.middleware);
if ((0, middleware_1.shouldRunMiddleware)(request, middleware)) {
const middlewareResponse = await middleware.default(new ImmutableRequest_1.ImmutableRequest(request));
if (middlewareResponse instanceof Response) {
return middlewareResponse;
}
// If middleware returns undefined/void, continue to route matching
}
}
if (manifest.redirects) {
for (const route of manifest.redirects) {
if (!route.namedRegex.test(url.pathname)) {
continue;
}
if (route.methods && !route.methods.includes(request.method)) {
continue;
}
return respondRedirect(url, request, route);
}
}
if (manifest.rewrites) {
for (const route of manifest.rewrites) {
if (!route.namedRegex.test(url.pathname)) {
continue;
}
if (route.methods && !route.methods.includes(request.method)) {
continue;
}
// Replace URL and Request with rewrite target
url = (0, matchers_1.getRedirectRewriteLocation)(url, request, route);
request = new Request(url, request);
}
}
// First, test static routes and loader data requests
if (request.method === 'GET' || request.method === 'HEAD') {
const isLoaderRequest = url.pathname.startsWith('/_expo/loaders/');
const matchedPath = isLoaderRequest
? url.pathname.replace('/_expo/loaders', '').replace(/\/index$/, '/')
: url.pathname;
for (const route of manifest.htmlRoutes) {
if (!route.namedRegex.test(matchedPath)) {
continue;
}
// Handle loader data requests for client-side navigation
if (isLoaderRequest) {
if (!route.loader) {
continue; // Route matched but has no loader
}
// Create a request with the actual route path so `parseParams()` works correctly
// NOTE(@hassankhan): Relocate the request rewriting logic from here
url.pathname = matchedPath;
const loaderRequest = new Request(url, request);
return createResponseFrom('api', route, await getLoaderData(loaderRequest, route));
}
const html = await getHtml(request, route);
return respondHTML(html, route);
}
}
// Next, test API routes
for (const route of manifest.apiRoutes) {
if (!route.namedRegex.test(url.pathname)) {
continue;
}
const mod = await getApiRoute(route);
return await respondAPI(mod, request, route);
}
// Finally, test 404 routes
if (request.method === 'GET' || request.method === 'HEAD') {
for (const route of manifest.notFoundRoutes) {
if (!route.namedRegex.test(url.pathname)) {
continue;
}
try {
const contents = await getHtml(request, route);
return respondNotFoundHTML(contents, route);
}
catch {
// NOTE(@krystofwoldrich): Should we show a dismissible RedBox in development?
// Handle missing/corrupted not found route files
continue;
}
}
}
// 404
return createResponse(null, null, 'Not found', {
status: 404,
headers: new Headers({ 'Content-Type': 'text/plain' }),
});
}
function createResponse(routeType = null, route, bodyInit, responseInit) {
const originalStatus = responseInit.status;
let callbackRoute;
if (route && routeType) {
route.type = routeType;
callbackRoute = route;
}
else {
callbackRoute = { type: null };
}
let modifiedResponseInit = responseInit;
// Apply user-defined headers, if provided
if (manifest?.headers) {
for (const headerName in manifest.headers) {
if (Array.isArray(manifest.headers[headerName])) {
for (const headerValue of manifest.headers[headerName]) {
modifiedResponseInit.headers.append(headerName, headerValue);
}
}
else if (manifest.headers[headerName] != null &&
!modifiedResponseInit.headers.has(headerName)) {
modifiedResponseInit.headers.set(headerName, manifest.headers[headerName]);
}
}
}
// Callback call order matters, general rule is to call more specific callbacks first.
if (routeType === 'html') {
modifiedResponseInit = beforeHTMLResponse(modifiedResponseInit, callbackRoute);
}
if (routeType === 'api') {
modifiedResponseInit = beforeAPIResponse(modifiedResponseInit, callbackRoute);
}
// Second to last is error response callback
if (typeof originalStatus === 'number' &&
(originalStatus === 0 /* Response.error() */ || originalStatus > 399)) {
modifiedResponseInit = beforeErrorResponse(modifiedResponseInit, callbackRoute);
}
// Generic before response callback last
modifiedResponseInit = beforeResponse(modifiedResponseInit, callbackRoute);
if (originalStatus === 0) {
// Response.error() results in status 0, which will cause new Response() to fail.
// We convert it to 500 only if originally 0, if cbs set the values to 0, we don't protect against it.
modifiedResponseInit.status = 500;
}
return new Response(bodyInit, modifiedResponseInit);
}
function createResponseFrom(routeType = null, route, response) {
const modifiedResponseInit = {
headers: new Headers(response.headers),
status: response.status,
statusText: response.statusText,
cf: response.cf,
webSocket: response.webSocket,
};
return createResponse(routeType, route, response.body, modifiedResponseInit);
}
async function respondNotFoundHTML(html, route) {
if (typeof html === 'string') {
return createResponse('notFoundHtml', route, html, {
status: 404,
headers: new Headers({
'Content-Type': 'text/html',
}),
});
}
if ((0, matchers_1.isResponse)(html)) {
// Only used for development errors
return html;
}
throw new ExpoError(`HTML route file ${route.page}.html could not be loaded`);
}
async function respondAPI(mod, request, route) {
if (!mod || typeof mod !== 'object') {
throw new ExpoError(`API route module ${route.page} could not be loaded`);
}
if ((0, matchers_1.isResponse)(mod)) {
// Only used for development API route bundling errors
return mod;
}
const handler = mod[request.method];
if (!handler || typeof handler !== 'function') {
return createResponse('notAllowedApi', route, 'Method not allowed', {
status: 405,
headers: new Headers({
'Content-Type': 'text/plain',
}),
});
}
const params = (0, matchers_1.parseParams)(request, route);
const response = await handler(request, params);
if (!(0, matchers_1.isResponse)(response)) {
throw new ExpoError(`API route ${request.method} handler ${route.page} resolved to a non-Response result`);
}
return createResponseFrom('api', route, response);
}
function respondHTML(html, route) {
if (typeof html === 'string') {
return createResponse('html', route, html, {
status: 200,
headers: new Headers({
'Content-Type': 'text/html',
}),
});
}
if ((0, matchers_1.isResponse)(html)) {
// Only used for development error responses
return html;
}
throw new ExpoError(`HTML route file ${route.page}.html could not be loaded`);
}
function respondRedirect(url, request, route) {
// NOTE(@krystofwoldrich): @expo/server would not redirect when location was empty,
// it would keep searching for match and eventually return 404. Worker redirects to origin.
const target = (0, matchers_1.getRedirectRewriteLocation)(url, request, route);
let status;
if (request.method === 'GET' || request.method === 'HEAD') {
status = route.permanent ? 301 : 302;
}
else {
status = route.permanent ? 308 : 307;
}
return Response.redirect(target, status);
}
}
//# sourceMappingURL=abstract.js.map

File diff suppressed because one or more lines are too long

12
node_modules/expo-server/build/cjs/vendor/bun.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import { type RequestHandlerInput as ExpoRequestHandlerInput, type RequestHandlerParams as ExpoRequestHandlerParams } from './abstract';
export { ExpoError } from './abstract';
export type RequestHandler = (req: Request) => Promise<Response>;
export interface RequestHandlerParams extends ExpoRequestHandlerParams, Partial<ExpoRequestHandlerInput> {
}
/**
* Returns a request handler for Express that serves the response using Remix.
*/
export declare function createRequestHandler(params: {
build: string;
environment?: string | null;
}, setup?: RequestHandlerParams): RequestHandler;

22
node_modules/expo-server/build/cjs/vendor/bun.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExpoError = void 0;
exports.createRequestHandler = createRequestHandler;
const node_async_hooks_1 = require("node:async_hooks");
const abstract_1 = require("./abstract");
const node_1 = require("./environment/node");
var abstract_2 = require("./abstract");
Object.defineProperty(exports, "ExpoError", { enumerable: true, get: function () { return abstract_2.ExpoError; } });
const STORE = new node_async_hooks_1.AsyncLocalStorage();
/**
* Returns a request handler for Express that serves the response using Remix.
*/
function createRequestHandler(params, setup) {
const run = (0, node_1.createNodeRequestScope)(STORE, params);
const onRequest = (0, abstract_1.createRequestHandler)({
...(0, node_1.createNodeEnv)(params),
...setup,
});
return (request) => run(onRequest, request);
}
//# sourceMappingURL=bun.js.map

1
node_modules/expo-server/build/cjs/vendor/bun.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"bun.js","sourceRoot":"","sources":["../../../src/vendor/bun.ts"],"names":[],"mappings":";;;AAsBA,oDAUC;AAhCD,uDAAqD;AAErD,yCAIoB;AACpB,6CAA2E;AAE3E,uCAAuC;AAA9B,qGAAA,SAAS,OAAA;AAIlB,MAAM,KAAK,GAAG,IAAI,oCAAiB,EAAE,CAAC;AAMtC;;GAEG;AACH,SAAgB,oBAAoB,CAClC,MAAsD,EACtD,KAA4B;IAE5B,MAAM,GAAG,GAAG,IAAA,6BAAsB,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,IAAA,+BAAiB,EAAC;QAClC,GAAG,IAAA,oBAAa,EAAC,MAAM,CAAC;QACxB,GAAG,KAAK;KACT,CAAC,CAAC;IACH,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC"}

13
node_modules/expo-server/build/cjs/vendor/eas.d.ts generated vendored Normal file
View File

@@ -0,0 +1,13 @@
import { type RequestHandlerParams } from './abstract';
import { ExecutionContext } from './environment/workerd';
export { ExpoError } from './abstract';
export interface RequestHandler<Env = unknown> {
(req: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
preload(): Promise<void>;
}
/**
* Returns a request handler for EAS Hosting deployments.
*/
export declare function createRequestHandler<Env = unknown>(params: {
build?: string;
}, setup?: RequestHandlerParams): RequestHandler<Env>;

30
node_modules/expo-server/build/cjs/vendor/eas.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExpoError = void 0;
exports.createRequestHandler = createRequestHandler;
const node_async_hooks_1 = require("node:async_hooks");
const runtime_1 = require("../runtime");
const abstract_1 = require("./abstract");
const workerd_1 = require("./environment/workerd");
var abstract_2 = require("./abstract");
Object.defineProperty(exports, "ExpoError", { enumerable: true, get: function () { return abstract_2.ExpoError; } });
const STORE = new node_async_hooks_1.AsyncLocalStorage();
/**
* Returns a request handler for EAS Hosting deployments.
*/
function createRequestHandler(params, setup) {
const makeRequestAPISetup = (request, _env, ctx) => ({
origin: request.headers.get('Origin') || null,
environment: request.headers.get('eas-environment') || null,
waitUntil: ctx.waitUntil?.bind(ctx),
});
const run = (0, runtime_1.createRequestScope)(STORE, makeRequestAPISetup);
const common = (0, workerd_1.createWorkerdEnv)(params);
const onRequest = (0, abstract_1.createRequestHandler)({ ...common, ...setup });
function handler(request, env, ctx) {
return run(onRequest, request, env, ctx);
}
handler.preload = common.preload;
return handler;
}
//# sourceMappingURL=eas.js.map

1
node_modules/expo-server/build/cjs/vendor/eas.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"eas.js","sourceRoot":"","sources":["../../../src/vendor/eas.ts"],"names":[],"mappings":";;;AAkBA,oDAmBC;AArCD,uDAAqD;AAErD,wCAAgD;AAChD,yCAAkG;AAClG,mDAA2E;AAE3E,uCAAuC;AAA9B,qGAAA,SAAS,OAAA;AAOlB,MAAM,KAAK,GAAG,IAAI,oCAAiB,EAAE,CAAC;AAEtC;;GAEG;AACH,SAAgB,oBAAoB,CAClC,MAA0B,EAC1B,KAA4B;IAE5B,MAAM,mBAAmB,GAAG,CAAC,OAAgB,EAAE,IAAS,EAAE,GAAqB,EAAE,EAAE,CAAC,CAAC;QACnF,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI;QAC7C,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,IAAI;QAC3D,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC;KACpC,CAAC,CAAC;IACH,MAAM,GAAG,GAAG,IAAA,4BAAkB,EAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAG,IAAA,0BAAgB,EAAC,MAAM,CAAC,CAAC;IACxC,MAAM,SAAS,GAAG,IAAA,+BAAiB,EAAC,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;IAE7D,SAAS,OAAO,CAAC,OAAgB,EAAE,GAAQ,EAAE,GAAqB;QAChE,OAAO,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IACjC,OAAO,OAAO,CAAC;AACjB,CAAC"}

View File

@@ -0,0 +1,17 @@
import type { Manifest, MiddlewareInfo, Route } from '../../manifest';
interface EnvironmentInput {
readText(request: string): Promise<string | null>;
readJson(request: string): Promise<unknown>;
loadModule(request: string): Promise<unknown>;
isDevelopment: boolean;
}
export interface CommonEnvironment {
getRoutesManifest(): Promise<Manifest | null>;
getHtml(request: Request, route: Route): Promise<string | Response | null>;
getApiRoute(route: Route): Promise<unknown>;
getMiddleware(middleware: MiddlewareInfo): Promise<any>;
getLoaderData(request: Request, route: Route): Promise<Response>;
preload(): Promise<void>;
}
export declare function createEnvironment(input: EnvironmentInput): CommonEnvironment;
export {};

View File

@@ -0,0 +1,171 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createEnvironment = createEnvironment;
const ImmutableRequest_1 = require("../../ImmutableRequest");
const matchers_1 = require("../../utils/matchers");
function initManifestRegExp(manifest) {
return {
...manifest,
htmlRoutes: manifest.htmlRoutes?.map((route) => ({
...route,
namedRegex: new RegExp(route.namedRegex),
})) ?? [],
apiRoutes: manifest.apiRoutes?.map((route) => ({
...route,
namedRegex: new RegExp(route.namedRegex),
})) ?? [],
notFoundRoutes: manifest.notFoundRoutes?.map((route) => ({
...route,
namedRegex: new RegExp(route.namedRegex),
})) ?? [],
redirects: manifest.redirects?.map((route) => ({
...route,
namedRegex: new RegExp(route.namedRegex),
})) ?? [],
rewrites: manifest.rewrites?.map((route) => ({
...route,
namedRegex: new RegExp(route.namedRegex),
})) ?? [],
};
}
function createEnvironment(input) {
// Cached manifest and SSR renderer, initialized on first request
let cachedManifest;
let ssrRenderer = null;
async function getRoutesManifest() {
if (cachedManifest === undefined || input.isDevelopment) {
const json = await input.readJson('_expo/routes.json');
cachedManifest = json ? initManifestRegExp(json) : null;
}
return cachedManifest;
}
async function getServerRenderer() {
if (ssrRenderer && !input.isDevelopment) {
return ssrRenderer;
}
const manifest = await getRoutesManifest();
if (manifest?.rendering?.mode !== 'ssr') {
return null;
}
// If `manifest.rendering.mode === 'ssr'`, we always expect the SSR rendering module to be
// available
const ssrModule = (await input.loadModule(manifest.rendering.file));
if (!ssrModule) {
throw new Error(`SSR module not found at: ${manifest.rendering.file}`);
}
const topLevelAssets = manifest.assets;
ssrRenderer = async (request, options) => {
const url = new URL(request.url);
const location = new URL(url.pathname + url.search, url.origin);
const assets = mergeAssets(topLevelAssets, options?.assets);
return ssrModule.getStaticContent(location, {
loader: options?.loader,
request,
assets,
});
};
return ssrRenderer;
}
async function executeLoader(request, route, params) {
if (!route.loader) {
return undefined;
}
const loaderModule = (await input.loadModule(route.loader));
if (!loaderModule) {
throw new Error(`Loader module not found at: ${route.loader}`);
}
return loaderModule.loader(new ImmutableRequest_1.ImmutableRequest(request), params);
}
return {
getRoutesManifest,
async getHtml(request, route) {
// SSR path: Render at runtime if SSR module is available
const renderer = await getServerRenderer();
if (renderer) {
let renderOptions = { assets: route.assets };
try {
if (route.loader) {
const params = (0, matchers_1.parseParams)(request, route);
const result = await executeLoader(request, route, params);
const data = (0, matchers_1.isResponse)(result) ? await result.json() : result;
renderOptions = {
assets: route.assets,
loader: {
data: data ?? null,
key: (0, matchers_1.resolveLoaderContextKey)(route.page, params),
},
};
}
return await renderer(request, renderOptions);
}
catch (error) {
console.error('SSR render error:', error);
throw error;
}
}
// SSG fallback: Read pre-rendered HTML from disk
let html;
if ((html = await input.readText(route.page + '.html')) != null) {
return html;
}
// Serve a static file by route name with hoisted index
// See: https://github.com/expo/expo/pull/27935
const INDEX_PATH = '/index';
if (route.page.endsWith(INDEX_PATH) && route.page.length > INDEX_PATH.length) {
const page = route.page.slice(0, -INDEX_PATH.length);
if ((html = await input.readText(page + '.html')) != null) {
return html;
}
}
return null;
},
async getApiRoute(route) {
return input.loadModule(route.file);
},
async getMiddleware(middleware) {
const mod = (await input.loadModule(middleware.file));
if (typeof mod?.default !== 'function') {
return null;
}
return mod;
},
async getLoaderData(request, route) {
const params = (0, matchers_1.parseParams)(request, route);
const result = await executeLoader(request, route, params);
if ((0, matchers_1.isResponse)(result)) {
return result;
}
return Response.json(result ?? null);
},
async preload() {
if (input.isDevelopment) {
return;
}
const manifest = await getRoutesManifest();
if (manifest) {
const requests = [];
if (manifest.middleware)
requests.push(manifest.middleware.file);
if (manifest.rendering)
requests.push(manifest.rendering.file);
for (const apiRoute of manifest.apiRoutes)
requests.push(apiRoute.file);
for (const htmlRoute of manifest.htmlRoutes) {
if (htmlRoute.loader)
requests.push(htmlRoute.loader);
}
await Promise.all(requests.map((request) => input.loadModule(request)));
}
},
};
}
/**
* Merges top-level assets with per-route async chunk assets. Top-level assets come first
*/
function mergeAssets(topLevel, routeLevel) {
return {
css: [...(topLevel?.css ?? []), ...(routeLevel?.css ?? [])],
js: [...(topLevel?.js ?? []), ...(routeLevel?.js ?? [])],
};
}
//# sourceMappingURL=common.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,10 @@
import { type CommonEnvironment } from './common';
import type { ScopeDefinition } from '../../runtime/scope';
interface NodeEnvParams {
build: string;
environment?: string | null;
isDevelopment?: boolean;
}
export declare function createNodeEnv(params: NodeEnvParams): CommonEnvironment;
export declare function createNodeRequestScope(scopeDefinition: ScopeDefinition, params: NodeEnvParams): (fn: (request: Request) => Promise<Response>, request: Request) => Promise<Response>;
export {};

View File

@@ -0,0 +1,66 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createNodeEnv = createNodeEnv;
exports.createNodeRequestScope = createNodeRequestScope;
const node_fs_1 = __importDefault(require("node:fs"));
const node_path_1 = __importDefault(require("node:path"));
const common_1 = require("./common");
const ImmutableRequest_1 = require("../../ImmutableRequest");
const runtime_1 = require("../../runtime");
function createNodeEnv(params) {
(0, ImmutableRequest_1.assertRuntimeFetchAPISupport)();
async function readText(request) {
const filePath = node_path_1.default.join(params.build, request);
if (!node_fs_1.default.existsSync(filePath)) {
return null;
}
try {
return await node_fs_1.default.promises.readFile(filePath, 'utf-8');
}
catch {
return null;
}
}
async function readJson(request) {
const json = await readText(request);
return json != null ? JSON.parse(json) : null;
}
async function loadModule(request) {
const filePath = node_path_1.default.join(params.build, request);
if (!node_fs_1.default.existsSync(filePath)) {
return null;
}
else if (/\.c?js$/.test(filePath)) {
return require(filePath);
}
else {
return await import(filePath);
}
}
return (0, common_1.createEnvironment)({
readText,
readJson,
loadModule,
isDevelopment: params.isDevelopment ?? false,
});
}
const getRequestURLOrigin = (request) => {
try {
// NOTE: We don't trust any headers on incoming requests in "raw" environments
return new URL(request.url).origin || null;
}
catch {
return null;
}
};
function createNodeRequestScope(scopeDefinition, params) {
return (0, runtime_1.createRequestScope)(scopeDefinition, (request) => ({
requestHeaders: request.headers,
origin: getRequestURLOrigin(request),
environment: params.environment ?? process.env.NODE_ENV,
}));
}
//# sourceMappingURL=node.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../../../src/vendor/environment/node.ts"],"names":[],"mappings":";;;;;AAcA,sCAqCC;AAWD,wDAMC;AApED,sDAAyB;AACzB,0DAA6B;AAE7B,qCAAqE;AACrE,6DAAsE;AACtE,2CAAmD;AASnD,SAAgB,aAAa,CAAC,MAAqB;IACjD,IAAA,+CAA4B,GAAE,CAAC;IAE/B,KAAK,UAAU,QAAQ,CAAC,OAAe;QACrC,MAAM,QAAQ,GAAG,mBAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,iBAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,CAAC;YACH,OAAO,MAAM,iBAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACvD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,KAAK,UAAU,QAAQ,CAAC,OAAe;QACrC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,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,CAAC,QAAQ;KACxD,CAAC,CAAC,CAAC;AACN,CAAC"}

View File

@@ -0,0 +1,14 @@
import { type CommonEnvironment } from './common';
import type { ScopeDefinition } from '../../runtime/scope';
interface WorkerdEnvParams {
build?: string;
environment?: string | null;
isDevelopment?: boolean;
}
export declare function createWorkerdEnv(params: WorkerdEnvParams): CommonEnvironment;
export interface ExecutionContext {
waitUntil?(promise: Promise<any>): void;
props?: any;
}
export declare function createWorkerdRequestScope<Env = unknown>(scopeDefinition: ScopeDefinition, params: WorkerdEnvParams): (fn: (request: Request, _env: Env, ctx: ExecutionContext) => Promise<Response>, request: Request, _env: Env, ctx: ExecutionContext) => Promise<Response>;
export {};

View File

@@ -0,0 +1,83 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createWorkerdEnv = createWorkerdEnv;
exports.createWorkerdRequestScope = createWorkerdRequestScope;
const common_1 = require("./common");
const runtime_1 = require("../../runtime");
const createCachedImport = () => {
const importCache = new Map();
return async function importCached(request) {
let result = importCache.get(request);
if (!result) {
try {
result = { type: 'success', value: await import(request) };
}
catch (error) {
result = { type: 'error', value: error };
}
importCache.set(request, result);
}
if (result.type === 'success') {
return result.value;
}
else {
throw result.value;
}
};
};
function createWorkerdEnv(params) {
const build = params.build || '.';
const importCached = createCachedImport();
async function readText(request) {
try {
const mod = await importCached(`${build}/${request}`);
return mod.default;
}
catch {
return null;
}
}
async function readJson(request) {
try {
const mod = await importCached(`${build}/${request}`);
if (typeof mod.default === 'string' && mod.default[0] === '{') {
return JSON.parse(mod.default);
}
else {
return mod.default;
}
}
catch {
return null;
}
}
async function loadModule(request) {
const target = `${build}/${request}`;
return (await import(target)).default;
}
return (0, common_1.createEnvironment)({
readText,
readJson,
loadModule,
isDevelopment: params.isDevelopment ?? false,
});
}
const getRequestURLOrigin = (request) => {
try {
// NOTE: We don't trust any headers on incoming requests in "raw" environments
return new URL(request.url).origin || null;
}
catch {
return null;
}
};
function createWorkerdRequestScope(scopeDefinition, params) {
const makeRequestAPISetup = (request, _env, ctx) => ({
requestHeaders: request.headers,
origin: getRequestURLOrigin(request),
environment: params.environment ?? null,
waitUntil: ctx.waitUntil?.bind(ctx),
});
return (0, runtime_1.createRequestScope)(scopeDefinition, makeRequestAPISetup);
}
//# sourceMappingURL=workerd.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"workerd.js","sourceRoot":"","sources":["../../../../src/vendor/environment/workerd.ts"],"names":[],"mappings":";;AA8BA,4CAqCC;AAgBD,8DAWC;AA9FD,qCAAqE;AACrE,2CAAmD;AAGnD,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,MAAM,WAAW,GAAG,IAAI,GAAG,EAAyD,CAAC;IACrF,OAAO,KAAK,UAAU,YAAY,CAAU,OAAe;QACzD,IAAI,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,IAAI,CAAC;gBACH,MAAM,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7D,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;YAC3C,CAAC;YACD,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACnC,CAAC;QACD,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,MAAM,CAAC,KAAU,CAAC;QAC3B,CAAC;aAAM,CAAC;YACN,MAAM,MAAM,CAAC,KAAK,CAAC;QACrB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC,CAAC;AAQF,SAAgB,gBAAgB,CAAC,MAAwB;IACvD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,GAAG,CAAC;IAClC,MAAM,YAAY,GAAG,kBAAkB,EAAE,C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IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF,SAAgB,yBAAyB,CACvC,eAAgC,EAChC,MAAwB;IAExB,MAAM,mBAAmB,GAAG,CAAC,OAAgB,EAAE,IAAS,EAAE,GAAqB,EAAE,EAAE,CAAC,CAAC;QACnF,cAAc,EAAE,OAAO,CAAC,OAAO;QAC/B,MAAM,EAAE,mBAAmB,CAAC,OAAO,CAAC;QACpC,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,IAAI;QACvC,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC;KACpC,CAAC,CAAC;IACH,OAAO,IAAA,4BAAkB,EAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC;AAClE,CAAC"}

15
node_modules/expo-server/build/cjs/vendor/express.d.ts generated vendored Normal file
View File

@@ -0,0 +1,15 @@
import type * as express from 'express';
import { type RequestHandlerInput as ExpoRequestHandlerInput, type RequestHandlerParams as ExpoRequestHandlerParams } from './abstract';
export { ExpoError } from './abstract';
export type RequestHandler = (req: express.Request, res: express.Response, next: express.NextFunction) => Promise<void>;
export interface RequestHandlerParams extends ExpoRequestHandlerParams, Partial<ExpoRequestHandlerInput> {
handleRouteError?(error: Error): Promise<Response>;
}
/**
* Returns a request handler for Express that serves the response using Remix.
*/
export declare function createRequestHandler(params: {
build: string;
environment?: string | null;
}, setup?: RequestHandlerParams): RequestHandler;
export { convertRequest, respond } from './http';

57
node_modules/expo-server/build/cjs/vendor/express.js generated vendored Normal file
View File

@@ -0,0 +1,57 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.respond = exports.convertRequest = exports.ExpoError = void 0;
exports.createRequestHandler = createRequestHandler;
const node_async_hooks_1 = require("node:async_hooks");
const abstract_1 = require("./abstract");
const node_1 = require("./environment/node");
const http_1 = require("./http");
var abstract_2 = require("./abstract");
Object.defineProperty(exports, "ExpoError", { enumerable: true, get: function () { return abstract_2.ExpoError; } });
const STORE = new node_async_hooks_1.AsyncLocalStorage();
/**
* Returns a request handler for Express that serves the response using Remix.
*/
function createRequestHandler(params, setup) {
const run = (0, node_1.createNodeRequestScope)(STORE, params);
const onRequest = (0, abstract_1.createRequestHandler)({
...(0, node_1.createNodeEnv)(params),
...setup,
});
async function requestHandler(request) {
try {
return await run(onRequest, request);
}
catch (error) {
const handleRouteError = setup?.handleRouteError;
if (handleRouteError && error != null && typeof error === 'object') {
try {
return await handleRouteError(error);
}
catch {
// Rethrow original error below
}
}
throw error;
}
}
return async (req, res, next) => {
if (!req?.url || !req.method) {
return next();
}
try {
const request = (0, http_1.convertRequest)(req, res);
const response = await requestHandler(request);
await (0, http_1.respond)(res, response);
}
catch (error) {
// Express doesn't support async functions, so we have to pass along the
// error manually using next().
next(error);
}
};
}
var http_2 = require("./http");
Object.defineProperty(exports, "convertRequest", { enumerable: true, get: function () { return http_2.convertRequest; } });
Object.defineProperty(exports, "respond", { enumerable: true, get: function () { return http_2.respond; } });
//# sourceMappingURL=express.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"express.js","sourceRoot":"","sources":["../../../src/vendor/express.ts"],"names":[],"mappings":";;;AA8BA,oDAwCC;AArED,uDAAqD;AAErD,yCAIoB;AACpB,6CAA2E;AAC3E,iCAAiD;AAEjD,uCAAuC;AAA9B,qGAAA,SAAS,OAAA;AAQlB,MAAM,KAAK,GAAG,IAAI,oCAAiB,EAAE,CAAC;AAQtC;;GAEG;AACH,SAAgB,oBAAoB,CAClC,MAAsD,EACtD,KAA4B;IAE5B,MAAM,GAAG,GAAG,IAAA,6BAAsB,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,IAAA,+BAAiB,EAAC;QAClC,GAAG,IAAA,oBAAa,EAAC,MAAM,CAAC;QACxB,GAAG,KAAK;KACT,CAAC,CAAC;IAEH,KAAK,UAAU,cAAc,CAAC,OAAgB;QAC5C,IAAI,CAAC;YACH,OAAO,MAAM,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACvC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,gBAAgB,GAAG,KAAK,EAAE,gBAAgB,CAAC;YACjD,IAAI,gBAAgB,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACnE,IAAI,CAAC;oBACH,OAAO,MAAM,gBAAgB,CAAC,KAAc,CAAC,CAAC;gBAChD,CAAC;gBAAC,MAAM,CAAC;oBACP,+BAA+B;gBACjC,CAAC;YACH,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,KAAK,EAAE,GAAoB,EAAE,GAAqB,EAAE,IAA0B,EAAE,EAAE;QACvF,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;YAC7B,OAAO,IAAI,EAAE,CAAC;QAChB,CAAC;QACD,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,IAAA,qBAAc,EAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YACzC,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;YAC/C,MAAM,IAAA,cAAO,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC/B,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,wEAAwE;YACxE,+BAA+B;YAC/B,IAAI,CAAC,KAAK,CAAC,CAAC;QACd,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,+BAAiD;AAAxC,sGAAA,cAAc,OAAA;AAAE,+FAAA,OAAO,OAAA"}

21
node_modules/expo-server/build/cjs/vendor/http.d.ts generated vendored Normal file
View File

@@ -0,0 +1,21 @@
import * as http from 'http';
import { type RequestHandlerInput as ExpoRequestHandlerInput, type RequestHandlerParams as ExpoRequestHandlerParams } from './abstract';
export { ExpoError } from './abstract';
type NextFunction = (err?: any) => void;
export type RequestHandler = (req: http.IncomingMessage, res: http.ServerResponse, next: NextFunction) => Promise<void>;
export interface RequestHandlerParams extends ExpoRequestHandlerParams, Partial<ExpoRequestHandlerInput> {
handleRouteError?(error: Error): Promise<Response>;
}
/**
* Returns a request handler for http that serves the response using Remix.
*/
export declare function createRequestHandler(params: {
build: string;
environment?: string | null;
isDevelopment?: boolean;
}, setup?: Partial<RequestHandlerParams>): RequestHandler;
export declare function convertRequest(req: http.IncomingMessage, res: http.ServerResponse): Request;
interface RespondOptions {
signal?: AbortSignal;
}
export declare function respond(nodeResponse: http.ServerResponse, webResponse: Response, options?: RespondOptions): Promise<void>;

119
node_modules/expo-server/build/cjs/vendor/http.js generated vendored Normal file
View File

@@ -0,0 +1,119 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExpoError = void 0;
exports.createRequestHandler = createRequestHandler;
exports.convertRequest = convertRequest;
exports.respond = respond;
const node_async_hooks_1 = require("node:async_hooks");
const node_stream_1 = require("node:stream");
const promises_1 = require("node:stream/promises");
const abstract_1 = require("./abstract");
const node_1 = require("./environment/node");
var abstract_2 = require("./abstract");
Object.defineProperty(exports, "ExpoError", { enumerable: true, get: function () { return abstract_2.ExpoError; } });
const STORE = new node_async_hooks_1.AsyncLocalStorage();
/**
* Returns a request handler for http that serves the response using Remix.
*/
function createRequestHandler(params, setup) {
const run = (0, node_1.createNodeRequestScope)(STORE, params);
const onRequest = (0, abstract_1.createRequestHandler)({
...(0, node_1.createNodeEnv)(params),
...setup,
});
async function requestHandler(request) {
try {
return await run(onRequest, request);
}
catch (error) {
const handleRouteError = setup?.handleRouteError;
if (handleRouteError && error != null && typeof error === 'object') {
try {
return await handleRouteError(error);
}
catch {
// Rethrow original error below
}
}
throw error;
}
}
return async (req, res, next) => {
if (!req?.url || !req.method) {
return next();
}
try {
const request = convertRequest(req, res);
const response = await requestHandler(request);
await respond(res, response, { signal: request.signal });
}
catch (error) {
// http doesn't support async functions, so we have to pass along the
// error manually using next().
next(error);
}
};
}
function convertRawHeaders(requestHeaders) {
const headers = new Headers();
for (let index = 0; index < requestHeaders.length; index += 2) {
headers.append(requestHeaders[index], requestHeaders[index + 1]);
}
return headers;
}
// Convert an http request to an expo request
function convertRequest(req, res) {
const url = new URL(req.url, `http://${req.headers.host}`);
// Abort action/loaders once we can no longer write a response or request aborts
const controller = new AbortController();
res.once('close', () => controller.abort());
res.once('error', (err) => controller.abort(err));
req.once('error', (err) => controller.abort(err));
const init = {
method: req.method,
headers: convertRawHeaders(req.rawHeaders),
signal: controller.signal,
};
if (req.method !== 'GET' && req.method !== 'HEAD') {
init.body = node_stream_1.Readable.toWeb(req);
init.duplex = 'half';
}
return new Request(url.href, init);
}
/** Assign Headers to a Node.js OutgoingMessage (request) */
const assignOutgoingMessageHeaders = (outgoing, headers) => {
// Preassemble array headers, mostly only for Set-Cookie
// We're avoiding `getSetCookie` since support is unclear in Node 18
const collection = {};
for (const [key, value] of headers) {
if (Array.isArray(collection[key])) {
collection[key].push(value);
}
else if (collection[key] != null) {
collection[key] = [collection[key], value];
}
else {
collection[key] = value;
}
}
// We don't use `setHeaders` due to a Bun bug (Fix: https://github.com/oven-sh/bun/pull/27050)
for (const key in collection) {
outgoing.setHeader(key, collection[key]);
}
};
async function respond(nodeResponse, webResponse, options) {
if (nodeResponse.writableEnded || nodeResponse.destroyed) {
return;
}
nodeResponse.statusMessage = webResponse.statusText;
nodeResponse.statusCode = webResponse.status;
assignOutgoingMessageHeaders(nodeResponse, webResponse.headers);
if (webResponse.body && !options?.signal?.aborted) {
const body = node_stream_1.Readable.fromWeb(webResponse.body);
await (0, promises_1.pipeline)(body, nodeResponse, { signal: options?.signal });
}
else {
nodeResponse.end();
}
}
//# sourceMappingURL=http.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/vendor/http.ts"],"names":[],"mappings":";;;AAkCA,oDAwCC;AAWD,wCAqBC;AA0BD,0BAmBC;AAtJD,uDAAqD;AACrD,6CAAuC;AACvC,m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EACjC,WAAqB,EACrB,OAAwB;IAExB,IAAI,YAAY,CAAC,aAAa,IAAI,YAAY,CAAC,SAAS,EAAE,CAAC;QACzD,OAAO;IACT,CAAC;IAED,YAAY,CAAC,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC;IACpD,YAAY,CAAC,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC;IAC7C,4BAA4B,CAAC,YAAY,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAEhE,IAAI,WAAW,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;QAClD,MAAM,IAAI,GAAG,sBAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,IAA0B,CAAC,CAAC;QACtE,MAAM,IAAA,mBAAQ,EAAC,IAAI,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAClE,CAAC;SAAM,CAAC;QACN,YAAY,CAAC,GAAG,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}

15
node_modules/expo-server/build/cjs/vendor/netlify.d.ts generated vendored Normal file
View File

@@ -0,0 +1,15 @@
export { ExpoError } from './abstract';
declare const scopeSymbol: unique symbol;
interface NetlifyContext {
deploy?: {
context?: string | null;
};
site?: {
url?: string | null;
};
waitUntil?: (promise: Promise<unknown>) => void;
[scopeSymbol]?: unknown;
}
export declare function createRequestHandler(params: {
build: string;
}): (req: Request, ctx?: NetlifyContext) => Promise<Response>;

46
node_modules/expo-server/build/cjs/vendor/netlify.js generated vendored Normal file
View File

@@ -0,0 +1,46 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExpoError = void 0;
exports.createRequestHandler = createRequestHandler;
const abstract_1 = require("./abstract");
const runtime_1 = require("../runtime");
const node_1 = require("./environment/node");
var abstract_2 = require("./abstract");
Object.defineProperty(exports, "ExpoError", { enumerable: true, get: function () { return abstract_2.ExpoError; } });
const scopeSymbol = Symbol.for('expoServerScope');
/** @see https://docs.netlify.com/build/functions/api/#netlify-specific-context-object */
function getContext() {
const fromGlobal = globalThis;
if (!fromGlobal.Netlify) {
throw new Error('"globalThis.Netlify" is missing but expected.\n' +
'- Are you using Netlify Server Functions 1.0 instead of 2.0?\n' +
'- Make sure your Netlify function has a default export instead of exporting "handler".');
}
return fromGlobal.Netlify?.context ?? {};
}
// Netlify already has an async-scoped context in NetlifyContext, so we can attach
// our scope context to this object
const STORE = {
getStore: () => getContext()[scopeSymbol],
run(scope, runner, ...args) {
getContext()[scopeSymbol] = scope;
return runner(...args);
},
};
function createRequestHandler(params) {
const makeRequestAPISetup = (request, context) => ({
origin: (context ?? getContext()).site?.url || request.headers.get('Origin') || null,
environment: (context ?? getContext()).deploy?.context || null,
waitUntil: (context ?? getContext()).waitUntil,
});
const run = (0, runtime_1.createRequestScope)(STORE, makeRequestAPISetup);
const onRequest = (0, abstract_1.createRequestHandler)((0, node_1.createNodeEnv)(params));
return async (req, ctx) => {
if ('multiValueHeaders' in req) {
throw new Error('Unexpected Request object. API was called by Netlify Server Functions 1.0\n' +
'- Make sure your Netlify function has a default export instead of exporting "handler".');
}
return await run(onRequest, req, ctx);
};
}
//# sourceMappingURL=netlify.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"netlify.js","sourceRoot":"","sources":["../../../src/vendor/netlify.ts"],"names":[],"mappings":";;;AAyCA,oDAiBC;AA1DD,yCAAuE;AACvE,wCAAgD;AAChD,6CAAmD;AAGnD,uCAAuC;AAA9B,qGAAA,SAAS,OAAA;AAElB,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AASlD,yFAAyF;AACzF,SAAS,UAAU;IACjB,MAAM,UAAU,GAEZ,UAAU,CAAC;IACf,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,iDAAiD;YAC/C,gEAAgE;YAChE,wFAAwF,CAC3F,CAAC;IACJ,CAAC;IACD,OAAO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CAAC;AACJ,CAAC"}

13
node_modules/expo-server/build/cjs/vendor/vercel.d.ts generated vendored Normal file
View File

@@ -0,0 +1,13 @@
import * as http from 'http';
export { ExpoError } from './abstract';
export type RequestHandler = (req: http.IncomingMessage, res: http.ServerResponse) => Promise<void>;
/**
* Returns a request handler for Vercel's Node.js runtime that serves the
* response using Remix.
*/
export declare function createRequestHandler(params: {
build: string;
}): RequestHandler;
export declare function convertHeaders(requestHeaders: http.IncomingMessage['headers']): Headers;
export declare function convertRequest(req: http.IncomingMessage, res: http.ServerResponse): Request;
export declare function respond(res: http.ServerResponse, expoRes: Response): Promise<void>;

109
node_modules/expo-server/build/cjs/vendor/vercel.js generated vendored Normal file
View File

@@ -0,0 +1,109 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExpoError = void 0;
exports.createRequestHandler = createRequestHandler;
exports.convertHeaders = convertHeaders;
exports.convertRequest = convertRequest;
exports.respond = respond;
const node_stream_1 = require("node:stream");
const promises_1 = require("node:stream/promises");
const abstract_1 = require("./abstract");
const runtime_1 = require("../runtime");
const node_1 = require("./environment/node");
const createReadableStreamFromReadable_1 = require("../utils/createReadableStreamFromReadable");
var abstract_2 = require("./abstract");
Object.defineProperty(exports, "ExpoError", { enumerable: true, get: function () { return abstract_2.ExpoError; } });
const scopeSymbol = Symbol.for('expoServerScope');
const SYMBOL_FOR_REQ_CONTEXT = Symbol.for('@vercel/request-context');
/** @see https://github.com/vercel/vercel/blob/b189b39/packages/functions/src/get-context.ts */
function getContext() {
const fromSymbol = globalThis;
return fromSymbol[SYMBOL_FOR_REQ_CONTEXT]?.get?.() ?? {};
}
// Vercel already has an async-scoped context in VercelContext, so we can attach
// our scope context to this object
const STORE = {
getStore: () => getContext()[scopeSymbol],
run(scope, runner, ...args) {
getContext()[scopeSymbol] = scope;
return runner(...args);
},
};
/**
* Returns a request handler for Vercel's Node.js runtime that serves the
* response using Remix.
*/
function createRequestHandler(params) {
const makeRequestAPISetup = (request) => {
const host = request.headers.get('host');
const proto = request.headers.get('x-forwarded-proto') || 'https';
return {
origin: host ? `${proto}://${host}` : null,
// See: https://github.com/vercel/vercel/blob/b189b39/packages/functions/src/get-env.ts#L25C3-L25C13
environment: process.env.VERCEL_ENV ?? process.env.NODE_ENV,
waitUntil: getContext().waitUntil,
};
};
const run = (0, runtime_1.createRequestScope)(STORE, makeRequestAPISetup);
const onRequest = (0, abstract_1.createRequestHandler)((0, node_1.createNodeEnv)(params));
return async (req, res) => {
return respond(res, await run(onRequest, convertRequest(req, res)));
};
}
function convertHeaders(requestHeaders) {
const headers = new Headers();
for (const [key, values] of Object.entries(requestHeaders)) {
if (values) {
if (Array.isArray(values)) {
for (const value of values) {
headers.append(key, value);
}
}
else {
headers.set(key, values);
}
}
}
return headers;
}
function convertRawHeaders(requestHeaders) {
const headers = new Headers();
for (let index = 0; index < requestHeaders.length; index += 2) {
headers.append(requestHeaders[index], requestHeaders[index + 1]);
}
return headers;
}
function convertRequest(req, res) {
const host = req.headers['x-forwarded-host'] || req.headers['host'];
// doesn't seem to be available on their req object!
const protocol = req.headers['x-forwarded-proto'] || 'https';
const url = new URL(`${protocol}://${host}${req.url}`);
// Abort action/loaders once we can no longer write a response
const controller = new AbortController();
res.on('close', () => controller.abort());
const init = {
method: req.method,
headers: convertRawHeaders(req.rawHeaders),
// Cast until reason/throwIfAborted added
// https://github.com/mysticatea/abort-controller/issues/36
signal: controller.signal,
};
if (req.method !== 'GET' && req.method !== 'HEAD') {
// NOTE(@krystofwoldrich) Readable.toWeb breaks the stream in Vercel Functions, unknown why.
// No error is thrown, but reading the stream like `await req.json()` never resolves.
init.body = (0, createReadableStreamFromReadable_1.createReadableStreamFromReadable)(req);
init.duplex = 'half';
}
return new Request(url.href, init);
}
async function respond(res, expoRes) {
res.statusMessage = expoRes.statusText;
res.writeHead(expoRes.status, expoRes.statusText, [...expoRes.headers.entries()].flat());
if (expoRes.body) {
await (0, promises_1.pipeline)(node_stream_1.Readable.fromWeb(expoRes.body), res);
}
else {
res.end();
}
}
//# sourceMappingURL=vercel.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"vercel.js","sourceRoot":"","sources":["../../../src/vendor/vercel.ts"],"names":[],"mappings":";;;AAiDA,oDAgBC;AAED,wCAcC;AAUD,wCA0BC;AAED,0BAQC;AA3HD,6CAAuC;AACvC,mDAAgD;AAGhD,yCAAuE;AACvE,wCAAgD;AAChD,6CAAmD;AAEnD,gGAA6F;AAE7F,uCAAuC;AAA9B,qGAAA,SAAS,OAAA;AAIlB,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAOlD,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AAErE,+FAA+F;AAC/F,SAAS,UAAU;IACjB,MAAM,UAAU,GAEZ,UAAU,CAAC;IACf,OAAO,UAAU,CAAC,sBAAsB,CAAC,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC;AAC3D,CAAC;AAED,gFAAgF;AAChF,mCAAmC;AACnC,MAAM,KAAK,GAAoB;IAC7B,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC,WAAW,CAAC;IACzC,GAAG,CAAC,KAAU,EAAE,MAA+B,EAAE,GAAG,IAAW;QAC7D,UAAU,EAAE,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC;QAClC,OAAO,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IACzB,CAAC;CACF,CAAC;AAEF;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,MAAyB;IAC5D,MAAM,mBAAmB,GAAG,CAAC,OAAgB,EAAE,EAAE;QAC/C,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,OAAO,CAAC;QAClE,OAAO;YACL,MAAM,EAAE,IAA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,MAAM,CAAC;IACvB,CAAC;IAED,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC;AAEM,KAAK,UAAU,OAAO,CAAC,GAAwB,EAAE,OAAiB;IACvE,GAAG,CAAC,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC;IACvC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACzF,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,IAAA,mBAAQ,EAAC,sBAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,IAA0B,CAAC,EAAE,GAAG,CAAC,CAAC;IAC5E,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,GAAG,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}

14
node_modules/expo-server/build/cjs/vendor/workerd.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
import { type RequestHandlerParams } from './abstract';
import { ExecutionContext } from './environment/workerd';
export { ExpoError } from './abstract';
export interface RequestHandler<Env = unknown> {
(req: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
preload(): Promise<void>;
}
/**
* Returns a request handler for Workerd deployments.
*/
export declare function createRequestHandler<Env = unknown>(params: {
build: string;
environment?: string | null;
}, setup?: RequestHandlerParams): RequestHandler<Env>;

24
node_modules/expo-server/build/cjs/vendor/workerd.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExpoError = void 0;
exports.createRequestHandler = createRequestHandler;
const node_async_hooks_1 = require("node:async_hooks");
const abstract_1 = require("./abstract");
const workerd_1 = require("./environment/workerd");
var abstract_2 = require("./abstract");
Object.defineProperty(exports, "ExpoError", { enumerable: true, get: function () { return abstract_2.ExpoError; } });
const STORE = new node_async_hooks_1.AsyncLocalStorage();
/**
* Returns a request handler for Workerd deployments.
*/
function createRequestHandler(params, setup) {
const run = (0, workerd_1.createWorkerdRequestScope)(STORE, params);
const common = (0, workerd_1.createWorkerdEnv)(params);
const onRequest = (0, abstract_1.createRequestHandler)({ ...common, ...setup });
function handler(request, env, ctx) {
return run(onRequest, request, env, ctx);
}
handler.preload = common.preload;
return handler;
}
//# sourceMappingURL=workerd.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"workerd.js","sourceRoot":"","sources":["../../../src/vendor/workerd.ts"],"names":[],"mappings":";;;AAqBA,oDAcC;AAnCD,uDAAqD;AAErD,yCAAkG;AAClG,mDAI+B;AAE/B,uCAAuC;AAA9B,qGAAA,SAAS,OAAA;AAOlB,MAAM,KAAK,GAAG,IAAI,oCAAiB,EAAE,CAAC;AAEtC;;GAEG;AACH,SAAgB,oBAAoB,CAClC,MAAsD,EACtD,KAA4B;IAE5B,MAAM,GAAG,GAAG,IAAA,mCAAyB,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,IAAA,0BAAgB,EAAC,MAAM,CAAC,CAAC;IACxC,MAAM,SAAS,GAAG,IAAA,+BAAiB,EAAC,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;IAE7D,SAAS,OAAO,CAAC,OAAgB,EAAE,GAAQ,EAAE,GAAqB;QAChE,OAAO,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IACjC,OAAO,OAAO,CAAC;AACjB,CAAC"}

View File

@@ -0,0 +1,61 @@
/**
* Copyright © 2025 650 Industries.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @hidden */
export type _ImmutableHeaders = Omit<Headers, 'append' | 'delete' | 'set'>;
declare const ImmutableHeaders_base: {
new (init?: HeadersInit): Headers;
prototype: Headers;
};
/**
* An immutable version of the Fetch API's [`Headers`](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object which prevents mutations.
*/
export declare class ImmutableHeaders extends ImmutableHeaders_base {
#private;
set(): void;
append(): void;
delete(): void;
}
/** @hidden */
export type _ImmutableRequest = Omit<Request, 'body' | 'bodyUsed' | 'arrayBuffer' | 'blob' | 'formData' | 'json' | 'text' | 'bytes' | 'headers'> & {
headers: ImmutableHeaders;
};
/**
* An immutable version of the Fetch API's [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) object which prevents mutations to the request body and headers.
*/
export declare class ImmutableRequest implements _ImmutableRequest, RequestInit {
#private;
constructor(request: Request);
get cache(): RequestCache;
get credentials(): RequestCredentials;
get destination(): RequestDestination;
get integrity(): string;
get keepalive(): boolean;
get method(): string;
get mode(): RequestMode;
get redirect(): RequestRedirect;
get referrer(): string;
get referrerPolicy(): ReferrerPolicy;
get signal(): AbortSignal;
get url(): string;
get bodyUsed(): boolean;
get duplex(): "half" | undefined;
get headers(): ImmutableHeaders;
/** The request body is not accessible in immutable requests. */
get body(): never;
arrayBuffer(): Promise<void>;
blob(): Promise<void>;
bytes(): Promise<void>;
formData(): Promise<void>;
json(): Promise<void>;
text(): Promise<void>;
/**
* Creates a mutable clone of the original request. This is provided as an escape hatch.
*/
clone(): Request;
}
export declare function assertRuntimeFetchAPISupport({ Request, Response, Headers, process, }?: any): void;
export {};

154
node_modules/expo-server/build/mjs/ImmutableRequest.js generated vendored Normal file
View File

@@ -0,0 +1,154 @@
/**
* Copyright © 2025 650 Industries.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const getHeadersConstructor = () => {
if (typeof Headers !== 'undefined') {
return Headers;
}
else {
// NOTE(@kitten): The `assertRuntimeFetchAPISupport` helper will catch this. Currently only an issue in Jest
return (globalThis.Headers ??
class _MockHeaders {
constructor() {
throw new Error('Runtime built-in Headers API is not available.');
}
});
}
};
/**
* An immutable version of the Fetch API's [`Headers`](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object which prevents mutations.
*/
export class ImmutableHeaders extends getHeadersConstructor() {
// TODO(@hassankhan): Merge with `ReadonlyHeaders` from `expo-router`
#throwImmutableError() {
throw new Error('This operation is not allowed on immutable headers.');
}
set() {
this.#throwImmutableError();
}
append() {
this.#throwImmutableError();
}
delete() {
this.#throwImmutableError();
}
}
/**
* An immutable version of the Fetch API's [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) object which prevents mutations to the request body and headers.
*/
export class ImmutableRequest {
#headers;
#request;
constructor(request) {
this.#headers = new ImmutableHeaders(request.headers);
this.#request = request;
}
get cache() {
return this.#request.cache;
}
get credentials() {
return this.#request.credentials;
}
get destination() {
return this.#request.destination;
}
get integrity() {
return this.#request.integrity;
}
get keepalive() {
return this.#request.keepalive;
}
get method() {
return this.#request.method;
}
get mode() {
return this.#request.mode;
}
get redirect() {
return this.#request.redirect;
}
get referrer() {
return this.#request.referrer;
}
get referrerPolicy() {
return this.#request.referrerPolicy;
}
get signal() {
return this.#request.signal;
}
get url() {
return this.#request.url;
}
get bodyUsed() {
return this.#request.bodyUsed;
}
get duplex() {
return this.#request.duplex;
}
get headers() {
return this.#headers;
}
#throwImmutableBodyError() {
throw new Error('This operation is not allowed on immutable requests.');
}
/** The request body is not accessible in immutable requests. */
get body() {
// NOTE(@kitten): `new Request(req.url, req)` may internally access `req.body` to copy the request
// We can pretend it is `null`. Marking `bodyUsed` makes no sense here as it manipulates the subsequent
// code paths, but pretending there was no body should be safe
return null;
}
async arrayBuffer() {
this.#throwImmutableBodyError();
}
async blob() {
this.#throwImmutableBodyError();
}
async bytes() {
this.#throwImmutableBodyError();
}
async formData() {
this.#throwImmutableBodyError();
}
async json() {
this.#throwImmutableBodyError();
}
async text() {
this.#throwImmutableBodyError();
}
/**
* Creates a mutable clone of the original request. This is provided as an escape hatch.
*/
clone() {
return this.#request.clone();
}
}
// Add assertions to improve usage in non-standard environments.
export function assertRuntimeFetchAPISupport({ Request, Response, Headers, process, } = globalThis) {
// Check if Request and Response are available.
if (typeof Request === 'undefined' ||
typeof Response === 'undefined' ||
typeof Headers === 'undefined') {
// Detect if `--no-experimental-fetch` flag is enabled and warn that it must be disabled.
if (typeof process !== 'undefined' && process.env && process.env.NODE_OPTIONS) {
const nodeOptions = process.env.NODE_OPTIONS;
if (nodeOptions.includes('--no-experimental-fetch')) {
throw new Error('NODE_OPTIONS="--no-experimental-fetch" is not supported with Expo server. Node.js built-in Request/Response APIs are required to continue.');
}
}
// If Node.js is <18, throw an error.
if (typeof process !== 'undefined' && process.version) {
const version = process.version;
const majorVersion = parseInt(version.replace(/v/g, '').split('.')[0], 10);
if (majorVersion < 18) {
throw new Error(`Node.js version ${majorVersion} is not supported. Upgrade to Node.js 20 or newer.`);
}
}
// Default error event for missing APIs.
throw new Error('Runtime built-in Request/Response/Headers APIs are not available. If running Node ensure that Node Fetch API, first available in Node.js 18, is enabled.');
}
}
//# sourceMappingURL=ImmutableRequest.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ImmutableRequest.js","sourceRoot":"","sources":["../../src/ImmutableRequest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,qBAAqB,GAAG,GAAmB,EAAE;IACjD,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;QACnC,OAAO,OAAO,CAAC;IACjB,CAAC;SAAM,CAAC;QACN,4GAA4G;QAC5G,OAAO,CACL,UAAU,CAAC,OAAO;YAClB,MAAM,YAAY;gBAChB;oBACE,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;gBACpE,CAAC;aACF,CACF,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAKF;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,qBAAqB,EAAE;IAC3D,qEAAqE;IACrE,oBAAoB;QAClB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IAED,GAAG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,QAAQ,KAAK,WAAW;QAC/B,OAAO,OAAO,KAAK,WAAW,EAC9B,CAAC;QACD,yFAAyF;QACzF,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;YAC9E,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;YAC7C,IAAI,WAAW,CAAC,QAAQ,CAAC,yBAAyB,CAAC,EAAE,CAAC;gBACpD,MAAM,IAAI,KAAK,CACb,4IAA4I,CAC7I,CAAC;YACJ,CAAC;QACH,CAAC;QACD,qCAAqC;QACrC,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACtD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;YAChC,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3E,IAAI,YAAY,GAAG,EAAE,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CACb,mBAAmB,YAAY,oDAAoD,CACpF,CAAC;YACJ,CAAC;QACH,CAAC;QAED,wCAAwC;QACxC,MAAM,IAAI,KAAK,CACb,0JAA0J,CAC3J,CAAC;IACJ,CAAC;AACH,CAAC"}

13
node_modules/expo-server/build/mjs/global.types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,13 @@
declare global {
interface RequestInit {
duplex?: 'half';
}
interface Request {
duplex?: 'half';
}
interface Response {
cf?: unknown;
webSocket?: unknown;
}
}
export {};

2
node_modules/expo-server/build/mjs/global.types.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=global.types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"global.types.js","sourceRoot":"","sources":["../../src/global.types.ts"],"names":[],"mappings":""}

2
node_modules/expo-server/build/mjs/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export * from './runtime/api';
export type * from './types';

2
node_modules/expo-server/build/mjs/index.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export * from './runtime/api';
//# sourceMappingURL=index.js.map

1
node_modules/expo-server/build/mjs/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}

108
node_modules/expo-server/build/mjs/manifest.d.ts generated vendored Normal file
View File

@@ -0,0 +1,108 @@
/**
* Asset manifest for client hydration bundles.
*
* {@link import('@expo/router-server/src/static/renderStaticContent').GetStaticContentOptions}
*/
export interface AssetInfo {
css: string[];
js: string[];
}
/**
* Rendering configuration. Discriminated union supporting multiple rendering modes.
*/
export type RenderingConfiguration = RenderingConfigurationForSSR;
/**
* Configuration for server-side rendering (SSR). HTML is rendered at runtime on each request.
*/
export interface RenderingConfigurationForSSR {
mode: 'ssr';
/** Path to the SSR render module, typically `_expo/server/render.js` */
file: string;
}
export interface MiddlewareInfo {
/**
* Path to the module that contains the middleware function as a default export.
*
* @example _expo/functions/+middleware.js
*/
file: string;
}
export interface RouteInfo<TRegex = RegExp | string> {
file: string;
page: string;
/**
* Regex for matching a path against the route.
* The regex is normalized for named matchers so keys must be looked up against the `routeKeys` object to collect the original route param names.
* Regex matching alone cannot accurately route to a file, the order in which routes are matched is equally important to ensure correct priority.
*/
namedRegex: TRegex;
/**
* Keys are route param names that have been normalized for a regex named-matcher, values are the original route param names.
*/
routeKeys: Record<string, string>;
/** Indicates that the route was generated and does not map to any file in the project's routes directory. */
generated?: boolean;
/** Indicates that this is a redirect that should use 301 instead of 307 */
permanent?: boolean;
/** If a redirect, which methods are allowed. Undefined represents all methods */
methods?: string[];
/** Path to the loader module for this route, typically `_expo/loaders/[ROUTE].js`. When present, the loader should be executed before rendering. */
loader?: string;
/** Per-route async chunk assets. Merged with top-level `assets` at serve time. */
assets?: AssetInfo;
}
export interface RoutesManifest<TRegex = RegExp | string> {
/**
* Middleware function that runs before any route matching.
* Only allowed at the root level and requires web.output: "server".
*/
middleware?: MiddlewareInfo;
/**
* Headers to be applied to all responses from the server.
*/
headers?: Record<string, string | string[]>;
/**
* Routes that are matched after HTML routes and invoke WinterCG-compliant functions.
*/
apiRoutes: RouteInfo<TRegex>[];
/**
* Routes that return static HTML files for a given path.
* These are only matched against requests with method `GET` and `HEAD`.
*/
htmlRoutes: RouteInfo<TRegex>[];
/**
* List of routes that are matched last and return with status code 404.
*/
notFoundRoutes: RouteInfo<TRegex>[];
/**
* List of routes that match second. Returns 301 and redirects to another path.
*/
redirects: RouteInfo<TRegex>[];
/**
* Rewrites. After middleware has processed and regular routing resumes, these occur first.
*/
rewrites: RouteInfo<TRegex>[];
/**
* CSS/JS assets. Used for client hydration in SSR mode.
*/
assets?: AssetInfo;
/**
* Rendering configuration. Determines how HTML is generated.
* When present, HTML routes are rendered at runtime instead of being served from pre-rendered files.
*/
rendering?: RenderingConfiguration;
}
export type RawManifest = RoutesManifest<string>;
export type Manifest = RoutesManifest<RegExp>;
export type Route = RouteInfo<RegExp>;
/**
* @type {import('@expo/router-server/src/static/renderStaticContent').GetStaticContentOptions}
*/
export interface GetStaticContentOptions {
loader?: {
data?: unknown;
key: string;
};
request?: Request;
assets?: AssetInfo;
}

2
node_modules/expo-server/build/mjs/manifest.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=manifest.js.map

1
node_modules/expo-server/build/mjs/manifest.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/manifest.ts"],"names":[],"mappings":""}

36
node_modules/expo-server/build/mjs/middleware/rsc.d.ts generated vendored Normal file
View File

@@ -0,0 +1,36 @@
/**
* Copyright © 2024 650 Industries.
* Copyright © 2024 dai-shi.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* https://github.com/dai-shi/waku/blob/f9111ed7d96c95d7e128b37e8f7ae2d80122218e/packages/waku/src/lib/middleware/rsc.ts#L1
*/
type ResolvedConfig = any;
export type RenderRscArgs = {
config: ResolvedConfig;
input: string;
searchParams: URLSearchParams;
platform: string;
engine?: 'hermes' | null;
method: 'GET' | 'POST';
body?: ReadableStream | null;
contentType?: string | undefined;
decodedBody?: unknown;
moduleIdCallback?: ((id: string) => void) | undefined;
onError?: (err: unknown) => void;
headers: Record<string, string>;
};
export declare const decodeInput: (encodedInput: string) => string;
export declare function getRscMiddleware(options: {
config: ResolvedConfig;
baseUrl: string;
rscPath: string;
renderRsc: (args: RenderRscArgs) => Promise<ReadableStream<any>>;
onError?: (err: unknown) => void;
}): {
GET: (req: Request) => Promise<Response>;
POST: (req: Request) => Promise<Response>;
};
export {};

119
node_modules/expo-server/build/mjs/middleware/rsc.js generated vendored Normal file
View File

@@ -0,0 +1,119 @@
/**
* Copyright © 2024 650 Industries.
* Copyright © 2024 dai-shi.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* https://github.com/dai-shi/waku/blob/f9111ed7d96c95d7e128b37e8f7ae2d80122218e/packages/waku/src/lib/middleware/rsc.ts#L1
*/
export const decodeInput = (encodedInput) => {
if (encodedInput === 'index.txt') {
return '';
}
if (encodedInput?.endsWith('.txt')) {
return encodedInput.slice(0, -'.txt'.length);
}
const err = new Error('Invalid encoded input');
err.statusCode = 400;
throw err;
};
// Production / Development API Route for handling RSC. Must be applied to the RSC paths, e.g. `/_flight/[...slug]+api.tsx`
export function getRscMiddleware(options) {
let rscPathPrefix = options.rscPath;
if (rscPathPrefix !== '/' && !rscPathPrefix.endsWith('/')) {
rscPathPrefix += '/';
}
async function getOrPostAsync(req) {
const url = new URL(req.url);
const { method } = req;
if (method !== 'GET' && method !== 'POST') {
throw new Error(`Unsupported method '${method}'`);
}
const platform = url.searchParams.get('platform') ?? req.headers.get('expo-platform');
if (typeof platform !== 'string' || !platform) {
return new Response('Missing expo-platform header or platform query parameter', {
status: 500,
headers: {
'Content-Type': 'text/plain',
},
});
}
const engine = url.searchParams.get('transform.engine');
// TODO: Will the hermes flag apply in production later?
if (engine && !['hermes'].includes(engine)) {
return new Response(`Query parameter "transform.engine" is an unsupported value: ${engine}`, {
status: 500,
headers: {
'Content-Type': 'text/plain',
},
});
}
let encodedInput = url.pathname.replace(
// TODO: baseUrl support
rscPathPrefix, '');
// First segment should be the target platform.
// This is used for aligning with production exports which are statically exported to a single location at build-time.
encodedInput = encodedInput.replace(new RegExp(`^${platform}/`), '');
try {
encodedInput = decodeInput(encodedInput);
}
catch {
return new Response(`Invalid encoded input: "${encodedInput}"`, {
status: 400,
headers: {
'Content-Type': 'text/plain',
},
});
}
try {
const args = {
config: options.config,
platform,
engine: engine,
input: encodedInput,
searchParams: url.searchParams,
method,
body: req.body,
contentType: req.headers.get('Content-Type') ?? '',
decodedBody: req.headers.get('X-Expo-Params'),
onError: options.onError,
headers: headersToRecord(req.headers),
};
const readable = await options.renderRsc(args);
return new Response(readable, {
headers: {
// The response is a streamed text file
'Content-Type': 'text/plain',
},
});
}
catch (err) {
if (err instanceof Response) {
return err;
}
if (process.env.NODE_ENV !== 'development') {
throw err;
}
console.error(err);
return new Response(`Unexpected server error rendering RSC: ` + err.message, {
status: 'statusCode' in err ? err.statusCode : 500,
headers: {
'Content-Type': 'text/plain',
},
});
}
}
return {
GET: getOrPostAsync,
POST: getOrPostAsync,
};
}
function headersToRecord(headers) {
const record = {};
for (const [key, value] of headers.entries()) {
record[key] = value;
}
return record;
}
//# sourceMappingURL=rsc.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"rsc.js","sourceRoot":"","sources":["../../../src/middleware/rsc.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmBH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,YAAoB,EAAE,EAAE;IAClD,IAAI,YAAY,KAAK,WAAW,EAAE,CAAC;Q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