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

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,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,aAAa,CAAI,IAAY,EAAE,CAAgB;IACtD,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,wCAAwC,IAAI,0DAA0D,CACvG,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,iCAAsC;AAA7B,oGAAA,WAAW,OAAA;AAEpB;;;;;;GAMG;AACH,SAAgB,MAAM;IACpB,OAAO,aAAa,CAAC,UAAU,EAAE,oBAAoB,EAAE,CAAC,MAAM,CAAC,CAAC;AAClE,CAAC;AAED,kEAAkE;AAClE,SAAgB,cAAc;IAC5B,MAAM,OAAO,GAAG,aAAa,CAAC,gBAAgB,EAAE,oBAAoB,EAAE,CAAC,cAAc,CAAC,CAAC;IACvF,OAAO,IAAI,mCAAgB,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,WAAW;IACzB,OAAO,aAAa,CAAC,eAAe,EAAE,oBAAoB,EAAE,CAAC,WAAW,CAAC,CAAC;AAC5E,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,OAAO,CAAC,EAA0B;IAChD,aAAa,CAAC,WAAW,EAAE,oBAAoB,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,SAAS,CAAC,EAAiC;IACzD,aAAa,CAAC,aAAa,EAAE,oBAAoB,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAChC,aAG0C;IAE1C,aAAa,CAAC,sBAAsB,EAAE,oBAAoB,EAAE,CAAC,kBAAkB,CAAC,CAAC,aAAa,CAAC,CAAC;AAClG,CAAC"}

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

@@ -0,0 +1,36 @@
/** 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');
* }
* }
* ```
*/
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,GAAG;oBACN,OAAO,GAAG,WAAW,CAAC;oBACtB,MAAM;gBACR,KAAK,GAAG;oBACN,OAAO,GAAG,WAAW,CAAC;oBACtB,MAAM;gBACR,KAAK,GAAG;oBACN,OAAO,GAAG,uBAAuB,CAAC;oBAClC,MAA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C,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,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE;QAC5B,mFAAmF;QACnF,sFAAsF;QACtF,qCAAqC;QACrC,gBAAQ,CAAC,OAAO,GAAG,eAAe,CAAC;QAEnC,MAAM,KAAK,GAAG,mBAAmB,CAA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C,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"}