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

View File

@@ -0,0 +1 @@
module.exports = require("metro-config/private/__flowtests__/types-flowtest");

View File

@@ -0,0 +1,13 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
* @oncall react_native
*/
declare function createModuleIdFactory(): (path: string) => number;
export default createModuleIdFactory;

View File

@@ -0,0 +1 @@
module.exports = require("metro-config/private/defaults/createModuleIdFactory");

View File

@@ -0,0 +1,21 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
* @oncall react_native
*/
import type { RootPerfLogger } from "../types";
export { default as defaultCreateModuleIdFactory } from "./createModuleIdFactory";
export declare const assetExts: Array<string>;
export declare const assetResolutions: Array<string>;
export declare const sourceExts: Array<string>;
export declare const additionalExts: Array<string>;
export declare const moduleSystem: string;
export declare const platforms: Array<string>;
export declare const DEFAULT_METRO_MINIFIER_PATH: "metro-minify-terser";
export declare const noopPerfLoggerFactory: () => RootPerfLogger;

View File

@@ -0,0 +1,2 @@
module.exports = require("metro-config/private/defaults/defaults");
module.exports.default = module.exports;

View File

@@ -0,0 +1,13 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
* @oncall react_native
*/
declare function exclusionList(additionalExclusions?: ReadonlyArray<RegExp | string>): RegExp;
export default exclusionList;

View File

@@ -0,0 +1 @@
module.exports = require("metro-config/private/defaults/exclusionList");

View File

@@ -0,0 +1,13 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
* @oncall react_native
*/
declare function getMaxWorkers(workers: null | undefined | number): number;
export default getMaxWorkers;

View File

@@ -0,0 +1 @@
module.exports = require("metro-config/private/defaults/getMaxWorkers");

View File

@@ -0,0 +1,14 @@
// See: https://github.com/facebook/metro/blob/v0.83.2/packages/metro-config/src/defaults/index.js
// NOTE(cedric): This file can't be typed properly due to complex CJS structures
// NOTE(cedric): This file has lots more exports, but neither of them should be used directly by Expo
import type { ConfigT } from '../types';
interface getDefaultConfig {
(rootPath: string | null): Promise<ConfigT>;
getDefaultValues: (rootPath: string | null) => ConfigT;
}
declare const getDefaultValues: getDefaultConfig;
export default getDefaultValues;

View File

@@ -0,0 +1 @@
module.exports = require("metro-config/private/defaults/index");

View File

@@ -0,0 +1,14 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
* @oncall react_native
*/
import type { InputConfigT } from "../types";
declare function validConfig(): Promise<InputConfigT>;
export default validConfig;

View File

@@ -0,0 +1 @@
module.exports = require("metro-config/private/defaults/validConfig");

2
node_modules/@expo/metro/metro-config/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import * as _namespace from "./index.flow";
export = _namespace;

21
node_modules/@expo/metro/metro-config/index.flow.d.ts generated vendored Normal file
View File

@@ -0,0 +1,21 @@
import getDefaultConfig from "./defaults";
import { loadConfig, mergeConfig, resolveConfig } from "./loadConfig";
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
export type * from "./types";
export { getDefaultConfig, loadConfig, mergeConfig, resolveConfig };
/**
* Backwards-compatibility with CommonJS consumers using interopRequireDefault.
* Do not add to this list.
*
* @deprecated Default import from 'metro-config' is deprecated, use named exports.
*/

1
node_modules/@expo/metro/metro-config/index.flow.js generated vendored Normal file
View File

@@ -0,0 +1 @@
module.exports = require("metro-config/private/index.flow");

1
node_modules/@expo/metro/metro-config/index.js generated vendored Normal file
View File

@@ -0,0 +1 @@
module.exports = require("metro-config");

61
node_modules/@expo/metro/metro-config/loadConfig.d.ts generated vendored Normal file
View File

@@ -0,0 +1,61 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @oncall react_native
*/
import type {ConfigT, InputConfigT, YargArguments} from './types';
type ResolveConfigResult = {
filepath: string;
isEmpty: boolean;
config:
| ((baseConfig: ConfigT) => Promise<ConfigT>)
| ((baseConfig: ConfigT) => ConfigT)
| InputConfigT;
};
declare function resolveConfig(
filePath?: string,
cwd?: string,
): Promise<ResolveConfigResult>;
/**
* Merge two or more partial config objects (or functions returning partial
* configs) together, with arguments to the right overriding the left.
*
* Functions will be parsed the current config (the merge of all configs to the
* left).
*
* Functions may be async, in which case this function will return a promise.
* Otherwise it will return synchronously.
*/
declare function mergeConfig<
T extends InputConfigT,
R extends ReadonlyArray<
| InputConfigT
| ((baseConfig: T) => InputConfigT)
| ((baseConfig: T) => Promise<InputConfigT>)
>,
>(
base: T | (() => T),
...configs: R
): R extends ReadonlyArray<InputConfigT | ((baseConfig: T) => InputConfigT)>
? T
: Promise<T>;
/**
* Load the metro configuration from disk
* @param {object} argv Arguments coming from the CLI, can be empty
* @param {object} defaultConfigOverrides A configuration that can override the default config
* @return {object} Configuration returned
*/
declare function loadConfig(
argvInput?: YargArguments,
defaultConfigOverrides?: InputConfigT,
): Promise<ConfigT>;
export declare function loadConfigFile(
absolutePath: string,
): Promise<ResolveConfigResult>;
export {loadConfig, resolveConfig, mergeConfig};

2
node_modules/@expo/metro/metro-config/loadConfig.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
module.exports = require("metro-config/private/loadConfig");
module.exports.default = module.exports;

253
node_modules/@expo/metro/metro-config/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,253 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
* @oncall react_native
*/
import type { HandleFunction, Server } from "connect";
import type { CacheStore, MetroCache } from "../metro-cache";
import type { CacheManagerFactory } from "../metro-file-map";
import type { CustomResolver } from "../metro-resolver";
import type { JsTransformerConfig } from "../metro-transform-worker";
import type { DeltaResult, Module, ReadOnlyGraph, SerializerOptions, TransformResult } from "../metro/DeltaBundler/types";
import type { Reporter } from "../metro/lib/reporting";
import type MetroServer from "../metro/Server";
import type { IntermediateStackFrame } from "../metro/Server/symbolicate";
export interface _ExtraTransformOptions_transform {
readonly experimentalImportSupport?: boolean;
readonly inlineRequires?: {
readonly blockList: {
readonly [absoluteModulePath: string]: true;
};
} | boolean;
readonly nonInlinedRequires?: ReadonlyArray<string>;
readonly unstable_memoizeInlineRequires?: boolean;
readonly unstable_nonMemoizedInlineRequires?: ReadonlyArray<string>;
}
export interface ExtraTransformOptions {
readonly preloadedModules?: {
readonly [path: string]: true;
} | false;
readonly ramGroups?: ReadonlyArray<string>;
readonly transform?: _ExtraTransformOptions_transform;
}
export interface GetTransformOptionsOpts {
dev: boolean;
/**
* @deprecated Always true
*/
hot: true;
platform?: null | string;
}
export type GetTransformOptions = (entryPoints: ReadonlyArray<string>, options: GetTransformOptionsOpts, getDependenciesOf: (absoluteFilePath: string) => Promise<Array<string>>) => Promise<Partial<ExtraTransformOptions>>;
export type Middleware = HandleFunction;
export interface _PerfAnnotations_string {
readonly [key: string]: string;
}
export interface _PerfAnnotations_int {
readonly [key: string]: number;
}
export interface _PerfAnnotations_double {
readonly [key: string]: number;
}
export interface _PerfAnnotations_bool {
readonly [key: string]: boolean;
}
export interface _PerfAnnotations_string_array {
readonly [key: string]: ReadonlyArray<string>;
}
export interface _PerfAnnotations_int_array {
readonly [key: string]: ReadonlyArray<number>;
}
export interface _PerfAnnotations_double_array {
readonly [key: string]: ReadonlyArray<number>;
}
export interface _PerfAnnotations_bool_array {
readonly [key: string]: ReadonlyArray<boolean>;
}
export interface PerfAnnotations {
string?: _PerfAnnotations_string;
int?: _PerfAnnotations_int;
double?: _PerfAnnotations_double;
bool?: _PerfAnnotations_bool;
string_array?: _PerfAnnotations_string_array;
int_array?: _PerfAnnotations_int_array;
double_array?: _PerfAnnotations_double_array;
bool_array?: _PerfAnnotations_bool_array;
}
export interface PerfLoggerPointOptions {
readonly timestamp?: number;
}
export interface PerfLogger {
point(name: string, opts?: PerfLoggerPointOptions): void;
annotate(annotations: PerfAnnotations): void;
subSpan(label: string): PerfLogger;
}
export interface RootPerfLogger extends PerfLogger {
start(opts?: PerfLoggerPointOptions): void;
end(status: "SUCCESS" | "FAIL" | "CANCEL", opts?: PerfLoggerPointOptions): void;
}
export interface PerfLoggerFactoryOptions {
readonly key?: number;
}
export type PerfLoggerFactory = (type: "START_UP" | "BUNDLING_REQUEST" | "HMR", opts?: PerfLoggerFactoryOptions) => RootPerfLogger;
export interface _ResolverConfigT_extraNodeModules {
[name: string]: string;
}
export interface _ResolverConfigT_unstable_conditionsByPlatform {
readonly [platform: string]: ReadonlyArray<string>;
}
export interface ResolverConfigT {
assetExts: ReadonlyArray<string>;
assetResolutions: ReadonlyArray<string>;
blacklistRE?: RegExp | Array<RegExp>;
blockList?: RegExp | Array<RegExp>;
disableHierarchicalLookup: boolean;
dependencyExtractor?: null | string;
emptyModulePath: string;
enableGlobalPackages: boolean;
extraNodeModules: _ResolverConfigT_extraNodeModules;
hasteImplModulePath?: null | string;
nodeModulesPaths: ReadonlyArray<string>;
platforms: ReadonlyArray<string>;
resolveRequest?: null | CustomResolver;
resolverMainFields: ReadonlyArray<string>;
sourceExts: ReadonlyArray<string>;
unstable_conditionNames: ReadonlyArray<string>;
unstable_conditionsByPlatform: _ResolverConfigT_unstable_conditionsByPlatform;
unstable_enablePackageExports: boolean;
useWatchman: boolean;
requireCycleIgnorePatterns: ReadonlyArray<RegExp>;
}
export interface SerializerConfigT {
createModuleIdFactory: () => (path: string) => number;
customSerializer?: null | ((entryPoint: string, preModules: ReadonlyArray<Module>, graph: ReadOnlyGraph, options: SerializerOptions) => Promise<string | {
code: string;
map: string;
}>);
experimentalSerializerHook: (graph: ReadOnlyGraph, delta: DeltaResult) => any;
getModulesRunBeforeMainModule: (entryFilePath: string) => Array<string>;
getPolyfills: ($$PARAM_0$$: {
platform?: null | string;
}) => ReadonlyArray<string>;
getRunModuleStatement: (moduleId: number | string, globalPrefix: string) => string;
polyfillModuleNames: ReadonlyArray<string>;
processModuleFilter: (modules: Module) => boolean;
isThirdPartyModule: (module: {
readonly path: string;
}) => boolean;
}
export interface _TransformerConfigT_transformVariants {
readonly [name: string]: Partial<ExtraTransformOptions>;
}
export interface TransformerConfigT extends JsTransformerConfig {
getTransformOptions: GetTransformOptions;
transformVariants: _TransformerConfigT_transformVariants;
publicPath: string;
unstable_workerThreads: boolean;
}
export interface MetalConfigT {
cacheVersion: string;
fileMapCacheDirectory?: string;
hasteMapCacheDirectory?: string;
unstable_fileMapCacheManagerFactory?: CacheManagerFactory;
maxWorkers: number;
unstable_perfLoggerFactory?: null | undefined | PerfLoggerFactory;
projectRoot: string;
stickyWorkers: boolean;
transformerPath: string;
reporter: Reporter;
resetCache: boolean;
watchFolders: ReadonlyArray<string>;
}
type CacheStoresConfigT = ReadonlyArray<CacheStore<TransformResult>>;
export interface ServerConfigT {
/** @deprecated */
enhanceMiddleware: ($$PARAM_0$$: Middleware, $$PARAM_1$$: MetroServer) => Middleware | Server;
forwardClientLogs: boolean;
port: number;
rewriteRequestUrl: ($$PARAM_0$$: string) => string;
unstable_serverRoot?: null | string;
useGlobalHotkey: boolean;
verifyConnections: boolean;
}
export interface SymbolicatorConfigT {
customizeFrame: ($$PARAM_0$$: {
readonly file?: null | string;
readonly lineNumber?: null | number;
readonly column?: null | number;
readonly methodName?: null | string;
}) => (null | undefined | {
readonly collapse?: boolean;
}) | Promise<null | undefined | {
readonly collapse?: boolean;
}>;
customizeStack: ($$PARAM_0$$: Array<IntermediateStackFrame>, $$PARAM_1$$: any) => Array<IntermediateStackFrame> | Promise<Array<IntermediateStackFrame>>;
}
export interface _WatcherConfigT_healthCheck {
readonly enabled: boolean;
readonly interval: number;
readonly timeout: number;
readonly filePrefix: string;
}
export interface _WatcherConfigT_unstable_autoSaveCache {
readonly enabled: boolean;
readonly debounceMs?: number;
}
export interface _WatcherConfigT_watchman {
readonly deferStates: ReadonlyArray<string>;
}
export interface WatcherConfigT {
additionalExts: ReadonlyArray<string>;
healthCheck: _WatcherConfigT_healthCheck;
unstable_autoSaveCache: _WatcherConfigT_unstable_autoSaveCache;
unstable_lazySha1: boolean;
unstable_workerThreads: boolean;
watchman: _WatcherConfigT_watchman;
}
export interface _InputConfigT_watcher extends Readonly<Partial<Omit<WatcherConfigT, "healthCheck" | "unstable_autoSaveCache" | "watchman">>> {
readonly healthCheck?: Partial<Readonly<WatcherConfigT["healthCheck"]>>;
readonly unstable_autoSaveCache?: Partial<Readonly<WatcherConfigT["unstable_autoSaveCache"]>>;
readonly watchman?: Partial<Readonly<WatcherConfigT["watchman"]>>;
}
export interface InputConfigT extends Readonly<Partial<MetalConfigT>> {
readonly cacheStores?: CacheStoresConfigT | (($$PARAM_0$$: MetroCache) => CacheStoresConfigT);
readonly resolver?: Readonly<Partial<ResolverConfigT>>;
readonly server?: Readonly<Partial<ServerConfigT>>;
readonly serializer?: Readonly<Partial<SerializerConfigT>>;
readonly symbolicator?: Readonly<Partial<SymbolicatorConfigT>>;
readonly transformer?: Readonly<Partial<TransformerConfigT>>;
readonly watcher?: _InputConfigT_watcher;
}
export type MetroConfig = InputConfigT;
export interface ConfigT extends Readonly<MetalConfigT> {
readonly cacheStores: CacheStoresConfigT;
readonly resolver: Readonly<ResolverConfigT>;
readonly server: Readonly<ServerConfigT>;
readonly serializer: Readonly<SerializerConfigT>;
readonly symbolicator: Readonly<SymbolicatorConfigT>;
readonly transformer: Readonly<TransformerConfigT>;
readonly watcher: Readonly<WatcherConfigT>;
}
export interface YargArguments {
readonly config?: string;
readonly cwd?: string;
readonly port?: string | number;
readonly host?: string;
readonly projectRoot?: string;
readonly watchFolders?: Array<string>;
readonly assetExts?: Array<string>;
readonly sourceExts?: Array<string>;
readonly platforms?: Array<string>;
readonly "max-workers"?: string | number;
readonly maxWorkers?: string | number;
readonly transformer?: string;
readonly "reset-cache"?: boolean;
readonly resetCache?: boolean;
readonly verbose?: boolean;
}

1
node_modules/@expo/metro/metro-config/types.js generated vendored Normal file
View File

@@ -0,0 +1 @@
module.exports = require("metro-config/private/types");